@strapi/plugin-color-picker 0.0.0-next.fe88c7878fe2948cfdc68f4867329c1032a618b2 → 0.0.0-next.ffc36acb308febe288f1a31b62cbbb75b286585c
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin/components/ColorPickerIcon.js +31 -0
- package/dist/admin/components/ColorPickerIcon.js.map +1 -0
- package/dist/admin/components/ColorPickerIcon.mjs +29 -0
- package/dist/admin/components/ColorPickerIcon.mjs.map +1 -0
- package/dist/admin/components/ColorPickerInput.js +199 -0
- package/dist/admin/components/ColorPickerInput.js.map +1 -0
- package/dist/admin/components/ColorPickerInput.mjs +178 -0
- package/dist/admin/components/ColorPickerInput.mjs.map +1 -0
- package/dist/admin/index.js +107 -8
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/index.mjs +102 -8
- package/dist/admin/index.mjs.map +1 -1
- package/dist/admin/pluginId.js +6 -0
- package/dist/admin/pluginId.js.map +1 -0
- package/dist/admin/pluginId.mjs +4 -0
- package/dist/admin/pluginId.mjs.map +1 -0
- package/dist/admin/src/components/ColorPickerInput.d.ts +3 -28
- package/dist/admin/src/components/tests/ColorPickerInput.test.d.ts +1 -0
- package/dist/admin/src/utils/prefixPluginTranslations.d.ts +3 -0
- package/dist/admin/translations/cs.json.js +17 -0
- package/dist/admin/translations/cs.json.js.map +1 -0
- package/dist/admin/translations/cs.json.mjs +15 -0
- package/dist/admin/translations/cs.json.mjs.map +1 -0
- package/dist/admin/translations/en.json.js +20 -0
- package/dist/admin/translations/en.json.js.map +1 -0
- package/dist/admin/translations/en.json.mjs +18 -0
- package/dist/admin/translations/en.json.mjs.map +1 -0
- package/dist/admin/translations/ru.json.js +20 -0
- package/dist/admin/translations/ru.json.js.map +1 -0
- package/dist/admin/translations/ru.json.mjs +18 -0
- package/dist/admin/translations/ru.json.mjs.map +1 -0
- package/dist/admin/translations/sv.json.js +17 -0
- package/dist/admin/translations/sv.json.js.map +1 -0
- package/dist/admin/translations/sv.json.mjs +15 -0
- package/dist/admin/translations/sv.json.mjs.map +1 -0
- package/dist/admin/translations/tr.json.js +17 -0
- package/dist/admin/translations/tr.json.js.map +1 -0
- package/dist/admin/translations/tr.json.mjs +15 -0
- package/dist/admin/translations/tr.json.mjs.map +1 -0
- package/dist/admin/translations/uk.json.js +20 -0
- package/dist/admin/translations/uk.json.js.map +1 -0
- package/dist/admin/translations/uk.json.mjs +18 -0
- package/dist/admin/translations/uk.json.mjs.map +1 -0
- package/dist/admin/translations/zh.json.js +17 -0
- package/dist/admin/translations/zh.json.js.map +1 -0
- package/dist/admin/translations/zh.json.mjs +15 -0
- package/dist/admin/translations/zh.json.mjs.map +1 -0
- package/dist/admin/utils/getTrad.js +8 -0
- package/dist/admin/utils/getTrad.js.map +1 -0
- package/dist/admin/utils/getTrad.mjs +6 -0
- package/dist/admin/utils/getTrad.mjs.map +1 -0
- package/dist/admin/utils/prefixPluginTranslations.js +11 -0
- package/dist/admin/utils/prefixPluginTranslations.js.map +1 -0
- package/dist/admin/utils/prefixPluginTranslations.mjs +9 -0
- package/dist/admin/utils/prefixPluginTranslations.mjs.map +1 -0
- package/dist/server/index.js +7 -10
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +6 -12
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/register.js +12 -0
- package/dist/server/register.js.map +1 -0
- package/dist/server/register.mjs +10 -0
- package/dist/server/register.mjs.map +1 -0
- package/package.json +24 -24
- package/dist/_chunks/ColorPickerInput-0lOoTrf0.js +0 -206
- package/dist/_chunks/ColorPickerInput-0lOoTrf0.js.map +0 -1
- package/dist/_chunks/ColorPickerInput-fKB6YXW8.mjs +0 -185
- package/dist/_chunks/ColorPickerInput-fKB6YXW8.mjs.map +0 -1
- package/dist/_chunks/cs-4GdZY0p6.js +0 -16
- package/dist/_chunks/cs-4GdZY0p6.js.map +0 -1
- package/dist/_chunks/cs-A2xRj-2-.mjs +0 -16
- package/dist/_chunks/cs-A2xRj-2-.mjs.map +0 -1
- package/dist/_chunks/en-L6ZZWDJv.mjs +0 -19
- package/dist/_chunks/en-L6ZZWDJv.mjs.map +0 -1
- package/dist/_chunks/en-WeRHjVEB.js +0 -19
- package/dist/_chunks/en-WeRHjVEB.js.map +0 -1
- package/dist/_chunks/index-OJYEuoCq.js +0 -117
- package/dist/_chunks/index-OJYEuoCq.js.map +0 -1
- package/dist/_chunks/index-uOrtnJpz.mjs +0 -116
- package/dist/_chunks/index-uOrtnJpz.mjs.map +0 -1
- package/dist/_chunks/ru-LLXYEOwl.mjs +0 -19
- package/dist/_chunks/ru-LLXYEOwl.mjs.map +0 -1
- package/dist/_chunks/ru-UXN_ByI9.js +0 -19
- package/dist/_chunks/ru-UXN_ByI9.js.map +0 -1
- package/dist/_chunks/sv-3-Yk9bKb.js +0 -16
- package/dist/_chunks/sv-3-Yk9bKb.js.map +0 -1
- package/dist/_chunks/sv-QqRPNQLw.mjs +0 -16
- package/dist/_chunks/sv-QqRPNQLw.mjs.map +0 -1
- package/dist/_chunks/tr-AbD-f8F0.js +0 -16
- package/dist/_chunks/tr-AbD-f8F0.js.map +0 -1
- package/dist/_chunks/tr-qYGSw8gH.mjs +0 -16
- package/dist/_chunks/tr-qYGSw8gH.mjs.map +0 -1
- package/dist/_chunks/zh-c23gv_oM.js +0 -16
- package/dist/_chunks/zh-c23gv_oM.js.map +0 -1
- package/dist/_chunks/zh-fPTOIT6s.mjs +0 -16
- package/dist/_chunks/zh-fPTOIT6s.mjs.map +0 -1
- package/dist/admin/src/hooks/useComposeRefs.d.ts +0 -29
- package/strapi-server.js +0 -3
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var designSystem = require('@strapi/design-system');
|
|
5
|
+
var icons = require('@strapi/icons');
|
|
6
|
+
var styledComponents = require('styled-components');
|
|
7
|
+
|
|
8
|
+
const IconBox = styledComponents.styled(designSystem.Flex)`
|
|
9
|
+
/* Hard code color values */
|
|
10
|
+
/* to stay consistent between themes */
|
|
11
|
+
background-color: #f0f0ff; /* primary100 */
|
|
12
|
+
border: 1px solid #d9d8ff; /* primary200 */
|
|
13
|
+
|
|
14
|
+
svg > path {
|
|
15
|
+
fill: #4945ff; /* primary600 */
|
|
16
|
+
}
|
|
17
|
+
`;
|
|
18
|
+
const ColorPickerIcon = ()=>{
|
|
19
|
+
return /*#__PURE__*/ jsxRuntime.jsx(IconBox, {
|
|
20
|
+
justifyContent: "center",
|
|
21
|
+
alignItems: "center",
|
|
22
|
+
width: 7,
|
|
23
|
+
height: 6,
|
|
24
|
+
hasRadius: true,
|
|
25
|
+
"aria-hidden": true,
|
|
26
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(icons.PaintBrush, {})
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
exports.ColorPickerIcon = ColorPickerIcon;
|
|
31
|
+
//# sourceMappingURL=ColorPickerIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorPickerIcon.js","sources":["../../../admin/src/components/ColorPickerIcon.tsx"],"sourcesContent":["import { Flex } from '@strapi/design-system';\nimport { PaintBrush } from '@strapi/icons';\nimport { styled } from 'styled-components';\n\nconst IconBox = styled(Flex)`\n /* Hard code color values */\n /* to stay consistent between themes */\n background-color: #f0f0ff; /* primary100 */\n border: 1px solid #d9d8ff; /* primary200 */\n\n svg > path {\n fill: #4945ff; /* primary600 */\n }\n`;\n\nexport const ColorPickerIcon = () => {\n return (\n <IconBox justifyContent=\"center\" alignItems=\"center\" width={7} height={6} hasRadius aria-hidden>\n <PaintBrush />\n </IconBox>\n );\n};\n"],"names":["IconBox","styled","Flex","ColorPickerIcon","_jsx","justifyContent","alignItems","width","height","hasRadius","aria-hidden","PaintBrush"],"mappings":";;;;;;;AAIA,MAAMA,OAAAA,GAAUC,uBAAOC,CAAAA,iBAAAA,CAAK;;;;;;;;;AAS5B,CAAC;MAEYC,eAAkB,GAAA,IAAA;AAC7B,IAAA,qBACEC,cAACJ,CAAAA,OAAAA,EAAAA;QAAQK,cAAe,EAAA,QAAA;QAASC,UAAW,EAAA,QAAA;QAASC,KAAO,EAAA,CAAA;QAAGC,MAAQ,EAAA,CAAA;QAAGC,SAAS,EAAA,IAAA;QAACC,aAAW,EAAA,IAAA;AAC7F,QAAA,QAAA,gBAAAN,cAACO,CAAAA,gBAAAA,EAAAA,EAAAA;;AAGP;;;;"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { Flex } from '@strapi/design-system';
|
|
3
|
+
import { PaintBrush } from '@strapi/icons';
|
|
4
|
+
import { styled } from 'styled-components';
|
|
5
|
+
|
|
6
|
+
const IconBox = styled(Flex)`
|
|
7
|
+
/* Hard code color values */
|
|
8
|
+
/* to stay consistent between themes */
|
|
9
|
+
background-color: #f0f0ff; /* primary100 */
|
|
10
|
+
border: 1px solid #d9d8ff; /* primary200 */
|
|
11
|
+
|
|
12
|
+
svg > path {
|
|
13
|
+
fill: #4945ff; /* primary600 */
|
|
14
|
+
}
|
|
15
|
+
`;
|
|
16
|
+
const ColorPickerIcon = ()=>{
|
|
17
|
+
return /*#__PURE__*/ jsx(IconBox, {
|
|
18
|
+
justifyContent: "center",
|
|
19
|
+
alignItems: "center",
|
|
20
|
+
width: 7,
|
|
21
|
+
height: 6,
|
|
22
|
+
hasRadius: true,
|
|
23
|
+
"aria-hidden": true,
|
|
24
|
+
children: /*#__PURE__*/ jsx(PaintBrush, {})
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export { ColorPickerIcon };
|
|
29
|
+
//# sourceMappingURL=ColorPickerIcon.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorPickerIcon.mjs","sources":["../../../admin/src/components/ColorPickerIcon.tsx"],"sourcesContent":["import { Flex } from '@strapi/design-system';\nimport { PaintBrush } from '@strapi/icons';\nimport { styled } from 'styled-components';\n\nconst IconBox = styled(Flex)`\n /* Hard code color values */\n /* to stay consistent between themes */\n background-color: #f0f0ff; /* primary100 */\n border: 1px solid #d9d8ff; /* primary200 */\n\n svg > path {\n fill: #4945ff; /* primary600 */\n }\n`;\n\nexport const ColorPickerIcon = () => {\n return (\n <IconBox justifyContent=\"center\" alignItems=\"center\" width={7} height={6} hasRadius aria-hidden>\n <PaintBrush />\n </IconBox>\n );\n};\n"],"names":["IconBox","styled","Flex","ColorPickerIcon","_jsx","justifyContent","alignItems","width","height","hasRadius","aria-hidden","PaintBrush"],"mappings":";;;;;AAIA,MAAMA,OAAAA,GAAUC,MAAOC,CAAAA,IAAAA,CAAK;;;;;;;;;AAS5B,CAAC;MAEYC,eAAkB,GAAA,IAAA;AAC7B,IAAA,qBACEC,GAACJ,CAAAA,OAAAA,EAAAA;QAAQK,cAAe,EAAA,QAAA;QAASC,UAAW,EAAA,QAAA;QAASC,KAAO,EAAA,CAAA;QAAGC,MAAQ,EAAA,CAAA;QAAGC,SAAS,EAAA,IAAA;QAACC,aAAW,EAAA,IAAA;AAC7F,QAAA,QAAA,gBAAAN,GAACO,CAAAA,UAAAA,EAAAA,EAAAA;;AAGP;;;;"}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var designSystem = require('@strapi/design-system');
|
|
6
|
+
var icons = require('@strapi/icons');
|
|
7
|
+
var admin = require('@strapi/strapi/admin');
|
|
8
|
+
var reactColorful = require('react-colorful');
|
|
9
|
+
var reactIntl = require('react-intl');
|
|
10
|
+
var styledComponents = require('styled-components');
|
|
11
|
+
var getTrad = require('../utils/getTrad.js');
|
|
12
|
+
|
|
13
|
+
function _interopNamespaceDefault(e) {
|
|
14
|
+
var n = Object.create(null);
|
|
15
|
+
if (e) {
|
|
16
|
+
Object.keys(e).forEach(function (k) {
|
|
17
|
+
if (k !== 'default') {
|
|
18
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
19
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function () { return e[k]; }
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
n.default = e;
|
|
27
|
+
return Object.freeze(n);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
31
|
+
|
|
32
|
+
const ColorPreview = styledComponents.styled.div`
|
|
33
|
+
border-radius: 50%;
|
|
34
|
+
width: 20px;
|
|
35
|
+
height: 20px;
|
|
36
|
+
margin-right: 10px;
|
|
37
|
+
background-color: ${(props)=>props.color};
|
|
38
|
+
border: 1px solid rgba(0, 0, 0, 0.1);
|
|
39
|
+
`;
|
|
40
|
+
const ColorPicker = styledComponents.styled(reactColorful.HexColorPicker)`
|
|
41
|
+
&& {
|
|
42
|
+
width: 100%;
|
|
43
|
+
aspect-ratio: 1.5;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.react-colorful__pointer {
|
|
47
|
+
width: ${({ theme })=>theme.spaces[3]};
|
|
48
|
+
height: ${({ theme })=>theme.spaces[3]};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.react-colorful__saturation {
|
|
52
|
+
border-radius: ${({ theme })=>theme.spaces[1]};
|
|
53
|
+
border-bottom: none;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.react-colorful__hue {
|
|
57
|
+
border-radius: 10px;
|
|
58
|
+
height: ${({ theme })=>theme.spaces[3]};
|
|
59
|
+
margin-top: ${({ theme })=>theme.spaces[2]};
|
|
60
|
+
}
|
|
61
|
+
`;
|
|
62
|
+
const ColorPickerToggle = styledComponents.styled(designSystem.Button)`
|
|
63
|
+
& > span {
|
|
64
|
+
display: flex;
|
|
65
|
+
justify-content: space-between;
|
|
66
|
+
align-items: center;
|
|
67
|
+
width: 100%;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
svg {
|
|
71
|
+
width: ${({ theme })=>theme.spaces[2]};
|
|
72
|
+
height: ${({ theme })=>theme.spaces[2]};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
svg > path {
|
|
76
|
+
fill: ${({ theme })=>theme.colors.neutral500};
|
|
77
|
+
justify-self: flex-end;
|
|
78
|
+
}
|
|
79
|
+
`;
|
|
80
|
+
const ColorPickerPopover = styledComponents.styled(designSystem.Popover.Content)`
|
|
81
|
+
padding: ${({ theme })=>theme.spaces[2]};
|
|
82
|
+
min-height: 270px;
|
|
83
|
+
`;
|
|
84
|
+
const ColorPickerInput = /*#__PURE__*/ React__namespace.forwardRef(({ hint, disabled, labelAction, label, name, required, ...props }, forwardedRef)=>{
|
|
85
|
+
const [showColorPicker, setShowColorPicker] = React__namespace.useState(false);
|
|
86
|
+
const colorPickerButtonRef = React__namespace.useRef(null);
|
|
87
|
+
const { formatMessage } = reactIntl.useIntl();
|
|
88
|
+
const field = admin.useField(name);
|
|
89
|
+
const color = field.value ?? '#000000';
|
|
90
|
+
const composedRefs = designSystem.useComposedRefs(forwardedRef, colorPickerButtonRef);
|
|
91
|
+
return /*#__PURE__*/ jsxRuntime.jsx(designSystem.Field.Root, {
|
|
92
|
+
name: name,
|
|
93
|
+
id: name,
|
|
94
|
+
error: field.error,
|
|
95
|
+
hint: hint,
|
|
96
|
+
required: required,
|
|
97
|
+
children: /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
|
|
98
|
+
direction: "column",
|
|
99
|
+
alignItems: "stretch",
|
|
100
|
+
gap: 1,
|
|
101
|
+
children: [
|
|
102
|
+
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Field.Label, {
|
|
103
|
+
action: labelAction,
|
|
104
|
+
children: label
|
|
105
|
+
}),
|
|
106
|
+
/*#__PURE__*/ jsxRuntime.jsxs(designSystem.Popover.Root, {
|
|
107
|
+
onOpenChange: setShowColorPicker,
|
|
108
|
+
children: [
|
|
109
|
+
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Popover.Trigger, {
|
|
110
|
+
children: /*#__PURE__*/ jsxRuntime.jsxs(ColorPickerToggle, {
|
|
111
|
+
ref: composedRefs,
|
|
112
|
+
"aria-label": formatMessage({
|
|
113
|
+
id: getTrad.getTrad('color-picker.toggle.aria-label'),
|
|
114
|
+
defaultMessage: 'Color picker toggle'
|
|
115
|
+
}),
|
|
116
|
+
"aria-controls": "color-picker-value",
|
|
117
|
+
"aria-haspopup": "dialog",
|
|
118
|
+
"aria-expanded": showColorPicker,
|
|
119
|
+
"aria-disabled": disabled,
|
|
120
|
+
disabled: disabled,
|
|
121
|
+
variant: "tertiary",
|
|
122
|
+
size: "L",
|
|
123
|
+
children: [
|
|
124
|
+
/*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
|
|
125
|
+
children: [
|
|
126
|
+
/*#__PURE__*/ jsxRuntime.jsx(ColorPreview, {
|
|
127
|
+
color: color
|
|
128
|
+
}),
|
|
129
|
+
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Typography, {
|
|
130
|
+
style: {
|
|
131
|
+
textTransform: 'uppercase'
|
|
132
|
+
},
|
|
133
|
+
textColor: field.value ? undefined : 'neutral600',
|
|
134
|
+
variant: "omega",
|
|
135
|
+
children: color
|
|
136
|
+
})
|
|
137
|
+
]
|
|
138
|
+
}),
|
|
139
|
+
/*#__PURE__*/ jsxRuntime.jsx(icons.CaretDown, {
|
|
140
|
+
"aria-hidden": true
|
|
141
|
+
})
|
|
142
|
+
]
|
|
143
|
+
})
|
|
144
|
+
}),
|
|
145
|
+
/*#__PURE__*/ jsxRuntime.jsxs(ColorPickerPopover, {
|
|
146
|
+
sideOffset: 4,
|
|
147
|
+
children: [
|
|
148
|
+
/*#__PURE__*/ jsxRuntime.jsx(ColorPicker, {
|
|
149
|
+
color: color,
|
|
150
|
+
onChange: (hexValue)=>field.onChange(name, hexValue)
|
|
151
|
+
}),
|
|
152
|
+
/*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
|
|
153
|
+
paddingTop: 3,
|
|
154
|
+
paddingLeft: 4,
|
|
155
|
+
justifyContent: "flex-end",
|
|
156
|
+
children: [
|
|
157
|
+
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Box, {
|
|
158
|
+
paddingRight: 2,
|
|
159
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Typography, {
|
|
160
|
+
variant: "omega",
|
|
161
|
+
tag: "label",
|
|
162
|
+
textColor: "neutral600",
|
|
163
|
+
children: formatMessage({
|
|
164
|
+
id: getTrad.getTrad('color-picker.input.format'),
|
|
165
|
+
defaultMessage: 'HEX'
|
|
166
|
+
})
|
|
167
|
+
})
|
|
168
|
+
}),
|
|
169
|
+
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Field.Root, {
|
|
170
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Field.Input, {
|
|
171
|
+
"aria-label": formatMessage({
|
|
172
|
+
id: getTrad.getTrad('color-picker.input.aria-label'),
|
|
173
|
+
defaultMessage: 'Color picker input'
|
|
174
|
+
}),
|
|
175
|
+
style: {
|
|
176
|
+
textTransform: 'uppercase'
|
|
177
|
+
},
|
|
178
|
+
name: name,
|
|
179
|
+
defaultValue: color,
|
|
180
|
+
placeholder: "#000000",
|
|
181
|
+
onChange: field.onChange,
|
|
182
|
+
...props
|
|
183
|
+
})
|
|
184
|
+
})
|
|
185
|
+
]
|
|
186
|
+
})
|
|
187
|
+
]
|
|
188
|
+
})
|
|
189
|
+
]
|
|
190
|
+
}),
|
|
191
|
+
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Field.Hint, {}),
|
|
192
|
+
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Field.Error, {})
|
|
193
|
+
]
|
|
194
|
+
})
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
exports.ColorPickerInput = ColorPickerInput;
|
|
199
|
+
//# sourceMappingURL=ColorPickerInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorPickerInput.js","sources":["../../../admin/src/components/ColorPickerInput.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport {\n Button,\n Box,\n Field,\n Flex,\n Popover,\n Typography,\n useComposedRefs,\n} from '@strapi/design-system';\nimport { CaretDown } from '@strapi/icons';\nimport { type InputProps, useField } from '@strapi/strapi/admin';\nimport { HexColorPicker } from 'react-colorful';\nimport { useIntl } from 'react-intl';\nimport { styled } from 'styled-components';\n\nimport { getTrad } from '../utils/getTrad';\n\nconst ColorPreview = styled.div`\n border-radius: 50%;\n width: 20px;\n height: 20px;\n margin-right: 10px;\n background-color: ${(props) => props.color};\n border: 1px solid rgba(0, 0, 0, 0.1);\n`;\n\nconst ColorPicker = styled(HexColorPicker)`\n && {\n width: 100%;\n aspect-ratio: 1.5;\n }\n\n .react-colorful__pointer {\n width: ${({ theme }) => theme.spaces[3]};\n height: ${({ theme }) => theme.spaces[3]};\n }\n\n .react-colorful__saturation {\n border-radius: ${({ theme }) => theme.spaces[1]};\n border-bottom: none;\n }\n\n .react-colorful__hue {\n border-radius: 10px;\n height: ${({ theme }) => theme.spaces[3]};\n margin-top: ${({ theme }) => theme.spaces[2]};\n }\n`;\n\nconst ColorPickerToggle = styled(Button)`\n & > span {\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n }\n\n svg {\n width: ${({ theme }) => theme.spaces[2]};\n height: ${({ theme }) => theme.spaces[2]};\n }\n\n svg > path {\n fill: ${({ theme }) => theme.colors.neutral500};\n justify-self: flex-end;\n }\n`;\n\nconst ColorPickerPopover = styled(Popover.Content)`\n padding: ${({ theme }) => theme.spaces[2]};\n min-height: 270px;\n`;\n\ntype ColorPickerInputProps = InputProps & {\n labelAction?: React.ReactNode;\n};\n\nexport const ColorPickerInput = React.forwardRef<HTMLButtonElement, ColorPickerInputProps>(\n ({ hint, disabled, labelAction, label, name, required, ...props }, forwardedRef) => {\n const [showColorPicker, setShowColorPicker] = React.useState(false);\n const colorPickerButtonRef = React.useRef<HTMLButtonElement>(null!);\n const { formatMessage } = useIntl();\n const field = useField(name);\n const color = field.value ?? '#000000';\n\n const composedRefs = useComposedRefs(forwardedRef, colorPickerButtonRef);\n\n return (\n <Field.Root name={name} id={name} error={field.error} hint={hint} required={required}>\n <Flex direction=\"column\" alignItems=\"stretch\" gap={1}>\n <Field.Label action={labelAction}>{label}</Field.Label>\n <Popover.Root onOpenChange={setShowColorPicker}>\n <Popover.Trigger>\n <ColorPickerToggle\n ref={composedRefs}\n aria-label={formatMessage({\n id: getTrad('color-picker.toggle.aria-label'),\n defaultMessage: 'Color picker toggle',\n })}\n aria-controls=\"color-picker-value\"\n aria-haspopup=\"dialog\"\n aria-expanded={showColorPicker}\n aria-disabled={disabled}\n disabled={disabled}\n variant=\"tertiary\"\n size=\"L\"\n >\n <Flex>\n <ColorPreview color={color} />\n <Typography\n style={{ textTransform: 'uppercase' }}\n textColor={field.value ? undefined : 'neutral600'}\n variant=\"omega\"\n >\n {color}\n </Typography>\n </Flex>\n <CaretDown aria-hidden />\n </ColorPickerToggle>\n </Popover.Trigger>\n <ColorPickerPopover sideOffset={4}>\n <ColorPicker color={color} onChange={(hexValue) => field.onChange(name, hexValue)} />\n <Flex paddingTop={3} paddingLeft={4} justifyContent=\"flex-end\">\n <Box paddingRight={2}>\n <Typography variant=\"omega\" tag=\"label\" textColor=\"neutral600\">\n {formatMessage({\n id: getTrad('color-picker.input.format'),\n defaultMessage: 'HEX',\n })}\n </Typography>\n </Box>\n <Field.Root>\n <Field.Input\n aria-label={formatMessage({\n id: getTrad('color-picker.input.aria-label'),\n defaultMessage: 'Color picker input',\n })}\n style={{ textTransform: 'uppercase' }}\n name={name}\n defaultValue={color}\n placeholder=\"#000000\"\n onChange={field.onChange}\n {...props}\n />\n </Field.Root>\n </Flex>\n </ColorPickerPopover>\n </Popover.Root>\n <Field.Hint />\n <Field.Error />\n </Flex>\n </Field.Root>\n );\n }\n);\n"],"names":["ColorPreview","styled","div","props","color","ColorPicker","HexColorPicker","theme","spaces","ColorPickerToggle","Button","colors","neutral500","ColorPickerPopover","Popover","Content","ColorPickerInput","React","forwardRef","hint","disabled","labelAction","label","name","required","forwardedRef","showColorPicker","setShowColorPicker","useState","colorPickerButtonRef","useRef","formatMessage","useIntl","field","useField","value","composedRefs","useComposedRefs","_jsx","Field","Root","id","error","_jsxs","Flex","direction","alignItems","gap","Label","action","onOpenChange","Trigger","ref","aria-label","getTrad","defaultMessage","aria-controls","aria-haspopup","aria-expanded","aria-disabled","variant","size","Typography","style","textTransform","textColor","undefined","CaretDown","aria-hidden","sideOffset","onChange","hexValue","paddingTop","paddingLeft","justifyContent","Box","paddingRight","tag","Input","defaultValue","placeholder","Hint","Error"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,MAAMA,YAAAA,GAAeC,uBAAOC,CAAAA,GAAG;;;;;AAKX,oBAAA,EAAE,CAACC,KAAAA,GAAUA,KAAMC,CAAAA,KAAK,CAAC;;AAE7C,CAAC;AAED,MAAMC,WAAAA,GAAcJ,uBAAOK,CAAAA,4BAAAA,CAAe;;;;;;;WAO/B,EAAE,CAAC,EAAEC,KAAK,EAAE,GAAKA,KAAMC,CAAAA,MAAM,CAAC,CAAA,CAAE,CAAC;YAChC,EAAE,CAAC,EAAED,KAAK,EAAE,GAAKA,KAAMC,CAAAA,MAAM,CAAC,CAAA,CAAE,CAAC;;;;mBAI1B,EAAE,CAAC,EAAED,KAAK,EAAE,GAAKA,KAAMC,CAAAA,MAAM,CAAC,CAAA,CAAE,CAAC;;;;;;YAMxC,EAAE,CAAC,EAAED,KAAK,EAAE,GAAKA,KAAMC,CAAAA,MAAM,CAAC,CAAA,CAAE,CAAC;gBAC7B,EAAE,CAAC,EAAED,KAAK,EAAE,GAAKA,KAAMC,CAAAA,MAAM,CAAC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;;;;;;;;AAMd,8BAAAmC,cAAA,CAACC,mBAAM0C,IAAI,EAAA,EAAA,CAAA;AACX,8BAAA3C,cAAA,CAACC,mBAAM2C,KAAK,EAAA,EAAA;;;;AAIpB,CACA;;;;"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Button, Popover, useComposedRefs, Field, Flex, Typography, Box } from '@strapi/design-system';
|
|
4
|
+
import { CaretDown } from '@strapi/icons';
|
|
5
|
+
import { useField } from '@strapi/strapi/admin';
|
|
6
|
+
import { HexColorPicker } from 'react-colorful';
|
|
7
|
+
import { useIntl } from 'react-intl';
|
|
8
|
+
import { styled } from 'styled-components';
|
|
9
|
+
import { getTrad } from '../utils/getTrad.mjs';
|
|
10
|
+
|
|
11
|
+
const ColorPreview = styled.div`
|
|
12
|
+
border-radius: 50%;
|
|
13
|
+
width: 20px;
|
|
14
|
+
height: 20px;
|
|
15
|
+
margin-right: 10px;
|
|
16
|
+
background-color: ${(props)=>props.color};
|
|
17
|
+
border: 1px solid rgba(0, 0, 0, 0.1);
|
|
18
|
+
`;
|
|
19
|
+
const ColorPicker = styled(HexColorPicker)`
|
|
20
|
+
&& {
|
|
21
|
+
width: 100%;
|
|
22
|
+
aspect-ratio: 1.5;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.react-colorful__pointer {
|
|
26
|
+
width: ${({ theme })=>theme.spaces[3]};
|
|
27
|
+
height: ${({ theme })=>theme.spaces[3]};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.react-colorful__saturation {
|
|
31
|
+
border-radius: ${({ theme })=>theme.spaces[1]};
|
|
32
|
+
border-bottom: none;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.react-colorful__hue {
|
|
36
|
+
border-radius: 10px;
|
|
37
|
+
height: ${({ theme })=>theme.spaces[3]};
|
|
38
|
+
margin-top: ${({ theme })=>theme.spaces[2]};
|
|
39
|
+
}
|
|
40
|
+
`;
|
|
41
|
+
const ColorPickerToggle = styled(Button)`
|
|
42
|
+
& > span {
|
|
43
|
+
display: flex;
|
|
44
|
+
justify-content: space-between;
|
|
45
|
+
align-items: center;
|
|
46
|
+
width: 100%;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
svg {
|
|
50
|
+
width: ${({ theme })=>theme.spaces[2]};
|
|
51
|
+
height: ${({ theme })=>theme.spaces[2]};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
svg > path {
|
|
55
|
+
fill: ${({ theme })=>theme.colors.neutral500};
|
|
56
|
+
justify-self: flex-end;
|
|
57
|
+
}
|
|
58
|
+
`;
|
|
59
|
+
const ColorPickerPopover = styled(Popover.Content)`
|
|
60
|
+
padding: ${({ theme })=>theme.spaces[2]};
|
|
61
|
+
min-height: 270px;
|
|
62
|
+
`;
|
|
63
|
+
const ColorPickerInput = /*#__PURE__*/ React.forwardRef(({ hint, disabled, labelAction, label, name, required, ...props }, forwardedRef)=>{
|
|
64
|
+
const [showColorPicker, setShowColorPicker] = React.useState(false);
|
|
65
|
+
const colorPickerButtonRef = React.useRef(null);
|
|
66
|
+
const { formatMessage } = useIntl();
|
|
67
|
+
const field = useField(name);
|
|
68
|
+
const color = field.value ?? '#000000';
|
|
69
|
+
const composedRefs = useComposedRefs(forwardedRef, colorPickerButtonRef);
|
|
70
|
+
return /*#__PURE__*/ jsx(Field.Root, {
|
|
71
|
+
name: name,
|
|
72
|
+
id: name,
|
|
73
|
+
error: field.error,
|
|
74
|
+
hint: hint,
|
|
75
|
+
required: required,
|
|
76
|
+
children: /*#__PURE__*/ jsxs(Flex, {
|
|
77
|
+
direction: "column",
|
|
78
|
+
alignItems: "stretch",
|
|
79
|
+
gap: 1,
|
|
80
|
+
children: [
|
|
81
|
+
/*#__PURE__*/ jsx(Field.Label, {
|
|
82
|
+
action: labelAction,
|
|
83
|
+
children: label
|
|
84
|
+
}),
|
|
85
|
+
/*#__PURE__*/ jsxs(Popover.Root, {
|
|
86
|
+
onOpenChange: setShowColorPicker,
|
|
87
|
+
children: [
|
|
88
|
+
/*#__PURE__*/ jsx(Popover.Trigger, {
|
|
89
|
+
children: /*#__PURE__*/ jsxs(ColorPickerToggle, {
|
|
90
|
+
ref: composedRefs,
|
|
91
|
+
"aria-label": formatMessage({
|
|
92
|
+
id: getTrad('color-picker.toggle.aria-label'),
|
|
93
|
+
defaultMessage: 'Color picker toggle'
|
|
94
|
+
}),
|
|
95
|
+
"aria-controls": "color-picker-value",
|
|
96
|
+
"aria-haspopup": "dialog",
|
|
97
|
+
"aria-expanded": showColorPicker,
|
|
98
|
+
"aria-disabled": disabled,
|
|
99
|
+
disabled: disabled,
|
|
100
|
+
variant: "tertiary",
|
|
101
|
+
size: "L",
|
|
102
|
+
children: [
|
|
103
|
+
/*#__PURE__*/ jsxs(Flex, {
|
|
104
|
+
children: [
|
|
105
|
+
/*#__PURE__*/ jsx(ColorPreview, {
|
|
106
|
+
color: color
|
|
107
|
+
}),
|
|
108
|
+
/*#__PURE__*/ jsx(Typography, {
|
|
109
|
+
style: {
|
|
110
|
+
textTransform: 'uppercase'
|
|
111
|
+
},
|
|
112
|
+
textColor: field.value ? undefined : 'neutral600',
|
|
113
|
+
variant: "omega",
|
|
114
|
+
children: color
|
|
115
|
+
})
|
|
116
|
+
]
|
|
117
|
+
}),
|
|
118
|
+
/*#__PURE__*/ jsx(CaretDown, {
|
|
119
|
+
"aria-hidden": true
|
|
120
|
+
})
|
|
121
|
+
]
|
|
122
|
+
})
|
|
123
|
+
}),
|
|
124
|
+
/*#__PURE__*/ jsxs(ColorPickerPopover, {
|
|
125
|
+
sideOffset: 4,
|
|
126
|
+
children: [
|
|
127
|
+
/*#__PURE__*/ jsx(ColorPicker, {
|
|
128
|
+
color: color,
|
|
129
|
+
onChange: (hexValue)=>field.onChange(name, hexValue)
|
|
130
|
+
}),
|
|
131
|
+
/*#__PURE__*/ jsxs(Flex, {
|
|
132
|
+
paddingTop: 3,
|
|
133
|
+
paddingLeft: 4,
|
|
134
|
+
justifyContent: "flex-end",
|
|
135
|
+
children: [
|
|
136
|
+
/*#__PURE__*/ jsx(Box, {
|
|
137
|
+
paddingRight: 2,
|
|
138
|
+
children: /*#__PURE__*/ jsx(Typography, {
|
|
139
|
+
variant: "omega",
|
|
140
|
+
tag: "label",
|
|
141
|
+
textColor: "neutral600",
|
|
142
|
+
children: formatMessage({
|
|
143
|
+
id: getTrad('color-picker.input.format'),
|
|
144
|
+
defaultMessage: 'HEX'
|
|
145
|
+
})
|
|
146
|
+
})
|
|
147
|
+
}),
|
|
148
|
+
/*#__PURE__*/ jsx(Field.Root, {
|
|
149
|
+
children: /*#__PURE__*/ jsx(Field.Input, {
|
|
150
|
+
"aria-label": formatMessage({
|
|
151
|
+
id: getTrad('color-picker.input.aria-label'),
|
|
152
|
+
defaultMessage: 'Color picker input'
|
|
153
|
+
}),
|
|
154
|
+
style: {
|
|
155
|
+
textTransform: 'uppercase'
|
|
156
|
+
},
|
|
157
|
+
name: name,
|
|
158
|
+
defaultValue: color,
|
|
159
|
+
placeholder: "#000000",
|
|
160
|
+
onChange: field.onChange,
|
|
161
|
+
...props
|
|
162
|
+
})
|
|
163
|
+
})
|
|
164
|
+
]
|
|
165
|
+
})
|
|
166
|
+
]
|
|
167
|
+
})
|
|
168
|
+
]
|
|
169
|
+
}),
|
|
170
|
+
/*#__PURE__*/ jsx(Field.Hint, {}),
|
|
171
|
+
/*#__PURE__*/ jsx(Field.Error, {})
|
|
172
|
+
]
|
|
173
|
+
})
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
export { ColorPickerInput };
|
|
178
|
+
//# sourceMappingURL=ColorPickerInput.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorPickerInput.mjs","sources":["../../../admin/src/components/ColorPickerInput.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport {\n Button,\n Box,\n Field,\n Flex,\n Popover,\n Typography,\n useComposedRefs,\n} from '@strapi/design-system';\nimport { CaretDown } from '@strapi/icons';\nimport { type InputProps, useField } from '@strapi/strapi/admin';\nimport { HexColorPicker } from 'react-colorful';\nimport { useIntl } from 'react-intl';\nimport { styled } from 'styled-components';\n\nimport { getTrad } from '../utils/getTrad';\n\nconst ColorPreview = styled.div`\n border-radius: 50%;\n width: 20px;\n height: 20px;\n margin-right: 10px;\n background-color: ${(props) => props.color};\n border: 1px solid rgba(0, 0, 0, 0.1);\n`;\n\nconst ColorPicker = styled(HexColorPicker)`\n && {\n width: 100%;\n aspect-ratio: 1.5;\n }\n\n .react-colorful__pointer {\n width: ${({ theme }) => theme.spaces[3]};\n height: ${({ theme }) => theme.spaces[3]};\n }\n\n .react-colorful__saturation {\n border-radius: ${({ theme }) => theme.spaces[1]};\n border-bottom: none;\n }\n\n .react-colorful__hue {\n border-radius: 10px;\n height: ${({ theme }) => theme.spaces[3]};\n margin-top: ${({ theme }) => theme.spaces[2]};\n }\n`;\n\nconst ColorPickerToggle = styled(Button)`\n & > span {\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n }\n\n svg {\n width: ${({ theme }) => theme.spaces[2]};\n height: ${({ theme }) => theme.spaces[2]};\n }\n\n svg > path {\n fill: ${({ theme }) => theme.colors.neutral500};\n justify-self: flex-end;\n }\n`;\n\nconst ColorPickerPopover = styled(Popover.Content)`\n padding: ${({ theme }) => theme.spaces[2]};\n min-height: 270px;\n`;\n\ntype ColorPickerInputProps = InputProps & {\n labelAction?: React.ReactNode;\n};\n\nexport const ColorPickerInput = React.forwardRef<HTMLButtonElement, ColorPickerInputProps>(\n ({ hint, disabled, labelAction, label, name, required, ...props }, forwardedRef) => {\n const [showColorPicker, setShowColorPicker] = React.useState(false);\n const colorPickerButtonRef = React.useRef<HTMLButtonElement>(null!);\n const { formatMessage } = useIntl();\n const field = useField(name);\n const color = field.value ?? '#000000';\n\n const composedRefs = useComposedRefs(forwardedRef, colorPickerButtonRef);\n\n return (\n <Field.Root name={name} id={name} error={field.error} hint={hint} required={required}>\n <Flex direction=\"column\" alignItems=\"stretch\" gap={1}>\n <Field.Label action={labelAction}>{label}</Field.Label>\n <Popover.Root onOpenChange={setShowColorPicker}>\n <Popover.Trigger>\n <ColorPickerToggle\n ref={composedRefs}\n aria-label={formatMessage({\n id: getTrad('color-picker.toggle.aria-label'),\n defaultMessage: 'Color picker toggle',\n })}\n aria-controls=\"color-picker-value\"\n aria-haspopup=\"dialog\"\n aria-expanded={showColorPicker}\n aria-disabled={disabled}\n disabled={disabled}\n variant=\"tertiary\"\n size=\"L\"\n >\n <Flex>\n <ColorPreview color={color} />\n <Typography\n style={{ textTransform: 'uppercase' }}\n textColor={field.value ? undefined : 'neutral600'}\n variant=\"omega\"\n >\n {color}\n </Typography>\n </Flex>\n <CaretDown aria-hidden />\n </ColorPickerToggle>\n </Popover.Trigger>\n <ColorPickerPopover sideOffset={4}>\n <ColorPicker color={color} onChange={(hexValue) => field.onChange(name, hexValue)} />\n <Flex paddingTop={3} paddingLeft={4} justifyContent=\"flex-end\">\n <Box paddingRight={2}>\n <Typography variant=\"omega\" tag=\"label\" textColor=\"neutral600\">\n {formatMessage({\n id: getTrad('color-picker.input.format'),\n defaultMessage: 'HEX',\n })}\n </Typography>\n </Box>\n <Field.Root>\n <Field.Input\n aria-label={formatMessage({\n id: getTrad('color-picker.input.aria-label'),\n defaultMessage: 'Color picker input',\n })}\n style={{ textTransform: 'uppercase' }}\n name={name}\n defaultValue={color}\n placeholder=\"#000000\"\n onChange={field.onChange}\n {...props}\n />\n </Field.Root>\n </Flex>\n </ColorPickerPopover>\n </Popover.Root>\n <Field.Hint />\n <Field.Error />\n </Flex>\n </Field.Root>\n );\n }\n);\n"],"names":["ColorPreview","styled","div","props","color","ColorPicker","HexColorPicker","theme","spaces","ColorPickerToggle","Button","colors","neutral500","ColorPickerPopover","Popover","Content","ColorPickerInput","React","forwardRef","hint","disabled","labelAction","label","name","required","forwardedRef","showColorPicker","setShowColorPicker","useState","colorPickerButtonRef","useRef","formatMessage","useIntl","field","useField","value","composedRefs","useComposedRefs","_jsx","Field","Root","id","error","_jsxs","Flex","direction","alignItems","gap","Label","action","onOpenChange","Trigger","ref","aria-label","getTrad","defaultMessage","aria-controls","aria-haspopup","aria-expanded","aria-disabled","variant","size","Typography","style","textTransform","textColor","undefined","CaretDown","aria-hidden","sideOffset","onChange","hexValue","paddingTop","paddingLeft","justifyContent","Box","paddingRight","tag","Input","defaultValue","placeholder","Hint","Error"],"mappings":";;;;;;;;;;AAmBA,MAAMA,YAAAA,GAAeC,MAAOC,CAAAA,GAAG;;;;;AAKX,oBAAA,EAAE,CAACC,KAAAA,GAAUA,KAAMC,CAAAA,KAAK,CAAC;;AAE7C,CAAC;AAED,MAAMC,WAAAA,GAAcJ,MAAOK,CAAAA,cAAAA,CAAe;;;;;;;WAO/B,EAAE,CAAC,EAAEC,KAAK,EAAE,GAAKA,KAAMC,CAAAA,MAAM,CAAC,CAAA,CAAE,CAAC;YAChC,EAAE,CAAC,EAAED,KAAK,EAAE,GAAKA,KAAMC,CAAAA,MAAM,CAAC,CAAA,CAAE,CAAC;;;;mBAI1B,EAAE,CAAC,EAAED,KAAK,EAAE,GAAKA,KAAMC,CAAAA,MAAM,CAAC,CAAA,CAAE,CAAC;;;;;;YAMxC,EAAE,CAAC,EAAED,KAAK,EAAE,GAAKA,KAAMC,CAAAA,MAAM,CAAC,CAAA,CAAE,CAAC;gBAC7B,EAAE,CAAC,EAAED,KAAK,EAAE,GAAKA,KAAMC,CAAAA,MAAM,CAAC,CAAA,CAAE,CAAC;;AAEjD,CAAC;AAED,MAAMC,iBAAAA,GAAoBR,MAAOS,CAAAA,MAAAA,CAAO;;;;;;;;;WAS7B,EAAE,CAAC,EAAEH,KAAK,EAAE,GAAKA,KAAMC,CAAAA,MAAM,CAAC,CAAA,CAAE,CAAC;YAChC,EAAE,CAAC,EAAED,KAAK,EAAE,GAAKA,KAAMC,CAAAA,MAAM,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(
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var ColorPickerIcon = require('./components/ColorPickerIcon.js');
|
|
4
|
+
var pluginId = require('./pluginId.js');
|
|
5
|
+
var getTrad = require('./utils/getTrad.js');
|
|
6
|
+
var prefixPluginTranslations = require('./utils/prefixPluginTranslations.js');
|
|
7
|
+
|
|
8
|
+
function _interopNamespaceDefaultOnly (e) { return Object.freeze({ __proto__: null, default: e }); }
|
|
9
|
+
|
|
10
|
+
function __variableDynamicImportRuntime1__(path) {
|
|
11
|
+
switch (path) {
|
|
12
|
+
case './translations/cs.json': return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceDefaultOnly(require('./translations/cs.json.js')); });
|
|
13
|
+
case './translations/en.json': return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceDefaultOnly(require('./translations/en.json.js')); });
|
|
14
|
+
case './translations/ru.json': return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceDefaultOnly(require('./translations/ru.json.js')); });
|
|
15
|
+
case './translations/sv.json': return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceDefaultOnly(require('./translations/sv.json.js')); });
|
|
16
|
+
case './translations/tr.json': return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceDefaultOnly(require('./translations/tr.json.js')); });
|
|
17
|
+
case './translations/uk.json': return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceDefaultOnly(require('./translations/uk.json.js')); });
|
|
18
|
+
case './translations/zh.json': return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceDefaultOnly(require('./translations/zh.json.js')); });
|
|
19
|
+
default: return new Promise(function(resolve, reject) {
|
|
20
|
+
(typeof queueMicrotask === 'function' ? queueMicrotask : setTimeout)(
|
|
21
|
+
reject.bind(null, new Error("Unknown variable dynamic import: " + path))
|
|
22
|
+
);
|
|
23
|
+
})
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
// eslint-disable-next-line import/no-default-export
|
|
27
|
+
var index = {
|
|
28
|
+
/**
|
|
29
|
+
* TODO: we need to have the type for StrapiApp done from `@strapi/admin` package.
|
|
30
|
+
*/ // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
31
|
+
register (app) {
|
|
32
|
+
app.customFields.register({
|
|
33
|
+
name: 'color',
|
|
34
|
+
pluginId: 'color-picker',
|
|
35
|
+
type: 'string',
|
|
36
|
+
icon: ColorPickerIcon.ColorPickerIcon,
|
|
37
|
+
intlLabel: {
|
|
38
|
+
id: getTrad.getTrad('color-picker.label'),
|
|
39
|
+
defaultMessage: 'Color'
|
|
40
|
+
},
|
|
41
|
+
intlDescription: {
|
|
42
|
+
id: getTrad.getTrad('color-picker.description'),
|
|
43
|
+
defaultMessage: 'Select any color'
|
|
44
|
+
},
|
|
45
|
+
components: {
|
|
46
|
+
Input: async ()=>Promise.resolve().then(function () { return require('./components/ColorPickerInput.js'); }).then((module)=>({
|
|
47
|
+
default: module.ColorPickerInput
|
|
48
|
+
}))
|
|
49
|
+
},
|
|
50
|
+
options: {
|
|
51
|
+
advanced: [
|
|
52
|
+
{
|
|
53
|
+
intlLabel: {
|
|
54
|
+
id: getTrad.getTrad('color-picker.options.advanced.regex'),
|
|
55
|
+
defaultMessage: 'RegExp pattern'
|
|
56
|
+
},
|
|
57
|
+
name: 'regex',
|
|
58
|
+
type: 'text',
|
|
59
|
+
defaultValue: '^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$',
|
|
60
|
+
description: {
|
|
61
|
+
id: getTrad.getTrad('color-picker.options.advanced.regex.description'),
|
|
62
|
+
defaultMessage: 'The text of the regular expression'
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
sectionTitle: {
|
|
67
|
+
id: 'global.settings',
|
|
68
|
+
defaultMessage: 'Settings'
|
|
69
|
+
},
|
|
70
|
+
items: [
|
|
71
|
+
{
|
|
72
|
+
name: 'required',
|
|
73
|
+
type: 'checkbox',
|
|
74
|
+
intlLabel: {
|
|
75
|
+
id: getTrad.getTrad('color-picker.options.advanced.requiredField'),
|
|
76
|
+
defaultMessage: 'Required field'
|
|
77
|
+
},
|
|
78
|
+
description: {
|
|
79
|
+
id: getTrad.getTrad('color-picker.options.advanced.requiredField.description'),
|
|
80
|
+
defaultMessage: "You won't be able to create an entry if this field is empty"
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
},
|
|
89
|
+
async registerTrads ({ locales }) {
|
|
90
|
+
const importedTrads = await Promise.all(locales.map((locale)=>{
|
|
91
|
+
return __variableDynamicImportRuntime1__(`./translations/${locale}.json`).then(({ default: data })=>{
|
|
92
|
+
return {
|
|
93
|
+
data: prefixPluginTranslations.prefixPluginTranslations(data, pluginId.pluginId),
|
|
94
|
+
locale
|
|
95
|
+
};
|
|
96
|
+
}).catch(()=>{
|
|
97
|
+
return {
|
|
98
|
+
data: {},
|
|
99
|
+
locale
|
|
100
|
+
};
|
|
101
|
+
});
|
|
102
|
+
}));
|
|
103
|
+
return Promise.resolve(importedTrads);
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
module.exports = index;
|
|
9
108
|
//# sourceMappingURL=index.js.map
|
package/dist/admin/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../admin/src/index.ts"],"sourcesContent":["import { ColorPickerIcon } from './components/ColorPickerIcon';\nimport { pluginId } from './pluginId';\nimport { getTrad } from './utils/getTrad';\nimport { prefixPluginTranslations } from './utils/prefixPluginTranslations';\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n /**\n * TODO: we need to have the type for StrapiApp done from `@strapi/admin` package.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n register(app: any) {\n app.customFields.register({\n name: 'color',\n pluginId: 'color-picker',\n type: 'string',\n icon: ColorPickerIcon,\n intlLabel: {\n id: getTrad('color-picker.label'),\n defaultMessage: 'Color',\n },\n intlDescription: {\n id: getTrad('color-picker.description'),\n defaultMessage: 'Select any color',\n },\n components: {\n Input: async () =>\n import('./components/ColorPickerInput').then((module) => ({\n default: module.ColorPickerInput,\n })),\n },\n options: {\n advanced: [\n {\n intlLabel: {\n id: getTrad('color-picker.options.advanced.regex'),\n defaultMessage: 'RegExp pattern',\n },\n name: 'regex',\n type: 'text',\n defaultValue: '^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$',\n description: {\n id: getTrad('color-picker.options.advanced.regex.description'),\n defaultMessage: 'The text of the regular expression',\n },\n },\n {\n sectionTitle: {\n id: 'global.settings',\n defaultMessage: 'Settings',\n },\n items: [\n {\n name: 'required',\n type: 'checkbox',\n intlLabel: {\n id: getTrad('color-picker.options.advanced.requiredField'),\n defaultMessage: 'Required field',\n },\n description: {\n id: getTrad('color-picker.options.advanced.requiredField.description'),\n defaultMessage: \"You won't be able to create an entry if this field is empty\",\n },\n },\n ],\n },\n ],\n },\n });\n },\n async registerTrads({ locales }: { locales: string[] }) {\n const importedTrads = await Promise.all(\n locales.map((locale) => {\n return import(`./translations/${locale}.json`)\n .then(({ default: data }) => {\n return {\n data: prefixPluginTranslations(data, pluginId),\n locale,\n };\n })\n .catch(() => {\n return {\n data: {},\n locale,\n };\n });\n })\n );\n\n return Promise.resolve(importedTrads);\n },\n};\n"],"names":["register","app","customFields","name","pluginId","type","icon","ColorPickerIcon","intlLabel","id","getTrad","defaultMessage","intlDescription","components","Input","then","module","default","ColorPickerInput","options","advanced","defaultValue","description","sectionTitle","items","registerTrads","locales","importedTrads","Promise","all","map","locale","data","prefixPluginTranslations","catch","resolve"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAKA;AACA,YAAe;AACb;;AAEC;AAEDA,IAAAA,QAAAA,CAAAA,CAASC,GAAQ,EAAA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