WIP remove mycustomfields plugin

This commit is contained in:
Rémi de Juvigny 2022-09-07 10:56:25 +02:00
parent acd1d0640f
commit b381606c1a
18 changed files with 20 additions and 24 deletions

View File

@ -1,10 +1,6 @@
# Strapi plugin Custom Fields # Strapi plugin Color Picker
A custom field plugin to house Strapi maintained custom fields A Strapi-maintainted color picker custom field
## Custom Fields
- [Color Picker](#color-picker)
## Installation ## Installation
@ -12,10 +8,10 @@ To install this plugin, you need to add an NPM dependency to your Strapi applica
```sh ```sh
# Using Yarn # Using Yarn
yarn add @strapi/custom-fields yarn add @strapi/plugin-color-picker
# Or using NPM # Or using NPM
npm install @strapi/custom-fields npm install @strapi/plugin-color-picker
``` ```
Then, you'll need to build your admin panel: Then, you'll need to build your admin panel:
@ -28,7 +24,7 @@ yarn build
npm run build npm run build
``` ```
## Color Picker ## Usage
Use saturation and hue sliders to select a color and save the value as a HEX string Use saturation and hue sliders to select a color and save the value as a HEX string

View File

@ -5,7 +5,7 @@ import { IntlProvider } from 'react-intl';
import ColorPickerInput from '../ColorPicker/ColorPickerInput'; import ColorPickerInput from '../ColorPicker/ColorPickerInput';
const mockAttribute = { const mockAttribute = {
customField: 'plugin::custom-fields.color-picker', customField: 'plugin::color-picker.color',
pluginOptions: { i18n: { localized: true } }, pluginOptions: { i18n: { localized: true } },
type: 'string', type: 'string',
}; };

View File

@ -6,13 +6,13 @@ import getTrad from './utils/getTrad';
export default { export default {
register(app) { register(app) {
app.customFields.register({ app.customFields.register({
name: 'color-picker', name: 'color',
pluginId: 'custom-fields', pluginId: 'color-picker',
type: 'string', type: 'string',
icon: ColorPickerIcon, icon: ColorPickerIcon,
intlLabel: { intlLabel: {
id: getTrad('color-picker.label'), id: getTrad('color-picker.label'),
defaultMessage: 'Color Picker', defaultMessage: 'Color',
}, },
intlDescription: { intlDescription: {
id: getTrad('color-picker.description'), id: getTrad('color-picker.description'),

View File

@ -1,5 +1,5 @@
{ {
"color-picker.label": "Color Picker", "color-picker.label": "Color",
"color-picker.description": "Select any color", "color-picker.description": "Select any color",
"color-picker.settings": "Settings", "color-picker.settings": "Settings",
"color-picket.input.format": "HEX", "color-picket.input.format": "HEX",
@ -9,4 +9,4 @@
"color-picker.options.advanced.requiredField.description": "You won't be able to create an entry if this field is empty", "color-picker.options.advanced.requiredField.description": "You won't be able to create an entry if this field is empty",
"color-picker.toggle.aria-label": "Color picker toggle", "color-picker.toggle.aria-label": "Color picker toggle",
"color-picker.input.aria-label": "Color picker input" "color-picker.input.aria-label": "Color picker input"
} }

View File

@ -1,5 +1,5 @@
import pluginId from '../pluginId'; import pluginId from '../pluginId';
const getTrad = id => `${pluginId}.${id}`; const getTrad = (id) => `${pluginId}.${id}`;
export default getTrad; export default getTrad;

View File

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

View File

@ -1,12 +1,12 @@
{ {
"name": "@strapi/custom-fields", "name": "@strapi/plugin-color-picker",
"version": "4.3.4", "version": "4.3.4",
"description": "Strapi maintained Custom Fields", "description": "Color picker custom field",
"strapi": { "strapi": {
"name": "custom-fields", "name": "color-picker",
"description": "Strapi maintained Custom Fields", "description": "Color picker custom field",
"kind": "plugin", "kind": "plugin",
"displayName": "Custom Fields" "displayName": "Color Picker"
}, },
"dependencies": {}, "dependencies": {},
"peerDependencies": { "peerDependencies": {
@ -15,7 +15,7 @@
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/strapi/strapi.git", "url": "https://github.com/strapi/strapi.git",
"directory": "packages/plugins/custom-fields" "directory": "packages/plugins/color-picker"
}, },
"license": "SEE LICENSE IN LICENSE", "license": "SEE LICENSE IN LICENSE",
"author": { "author": {

View File

@ -2,8 +2,8 @@
module.exports = ({ strapi }) => { module.exports = ({ strapi }) => {
strapi.customFields.register({ strapi.customFields.register({
name: 'color-picker', name: 'color',
plugin: 'custom-fields', plugin: 'color-picker',
type: 'string', type: 'string',
}); });
}; };