@strapi/plugin-color-picker 4.15.0-alpha.0 → 4.15.0
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/LICENSE +15 -0
- package/dist/_chunks/ColorPickerInput-6f0d1bb5.js +298 -0
- package/dist/_chunks/ColorPickerInput-6f0d1bb5.js.map +1 -0
- package/dist/_chunks/ColorPickerInput-f3a9f863.mjs +277 -0
- package/dist/_chunks/ColorPickerInput-f3a9f863.mjs.map +1 -0
- package/dist/_chunks/{cs-70e06424.mjs → cs-32e5b75a.mjs} +3 -3
- package/dist/_chunks/cs-32e5b75a.mjs.map +1 -0
- package/dist/_chunks/cs-c22467c6.js +16 -0
- package/dist/_chunks/cs-c22467c6.js.map +1 -0
- package/dist/_chunks/{en-096b1095.mjs → en-2230584b.mjs} +3 -3
- package/dist/_chunks/en-2230584b.mjs.map +1 -0
- package/dist/_chunks/en-eb6717ab.js +19 -0
- package/dist/_chunks/en-eb6717ab.js.map +1 -0
- package/dist/_chunks/index-476267d4.js +126 -0
- package/dist/_chunks/index-476267d4.js.map +1 -0
- package/dist/_chunks/index-e797ad4f.mjs +125 -0
- package/dist/_chunks/index-e797ad4f.mjs.map +1 -0
- package/dist/_chunks/{ru-05c0aa5b.mjs → ru-0bf57448.mjs} +3 -3
- package/dist/_chunks/ru-0bf57448.mjs.map +1 -0
- package/dist/_chunks/ru-1d1cf8a8.js +19 -0
- package/dist/_chunks/ru-1d1cf8a8.js.map +1 -0
- package/dist/_chunks/sv-6e7fa200.js +16 -0
- package/dist/_chunks/sv-6e7fa200.js.map +1 -0
- package/dist/_chunks/{sv-6ccbf5f0.mjs → sv-de6a785a.mjs} +3 -3
- package/dist/_chunks/sv-de6a785a.mjs.map +1 -0
- package/dist/_chunks/{tr-34587a44.mjs → tr-4d632eac.mjs} +3 -3
- package/dist/_chunks/tr-4d632eac.mjs.map +1 -0
- package/dist/_chunks/tr-67b6e192.js +16 -0
- package/dist/_chunks/tr-67b6e192.js.map +1 -0
- package/dist/_chunks/{zh-667ba169.mjs → zh-5ba3e025.mjs} +3 -3
- package/dist/_chunks/zh-5ba3e025.mjs.map +1 -0
- package/dist/_chunks/zh-e5010f8b.js +16 -0
- package/dist/_chunks/zh-e5010f8b.js.map +1 -0
- package/dist/admin/components/ColorPickerInput.d.ts +1 -1
- package/dist/admin/index.d.ts +3 -1
- package/dist/admin/index.js +8 -1
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/index.mjs +3 -3
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +12 -1
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +6 -5
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/register.d.ts +1 -0
- package/dist/server/register.d.ts.map +1 -0
- package/package.json +20 -20
- package/dist/_chunks/ColorPickerInput-35879029.mjs +0 -168
- package/dist/_chunks/ColorPickerInput-35879029.mjs.map +0 -1
- package/dist/_chunks/ColorPickerInput-d3f12809.js +0 -47
- package/dist/_chunks/ColorPickerInput-d3f12809.js.map +0 -1
- package/dist/_chunks/cs-67f98136.js +0 -2
- package/dist/_chunks/cs-67f98136.js.map +0 -1
- package/dist/_chunks/cs-70e06424.mjs.map +0 -1
- package/dist/_chunks/en-096b1095.mjs.map +0 -1
- package/dist/_chunks/en-32ea9fdb.js +0 -2
- package/dist/_chunks/en-32ea9fdb.js.map +0 -1
- package/dist/_chunks/index-2963da37.js +0 -37
- package/dist/_chunks/index-2963da37.js.map +0 -1
- package/dist/_chunks/index-85aee7ac.mjs +0 -730
- package/dist/_chunks/index-85aee7ac.mjs.map +0 -1
- package/dist/_chunks/ru-05c0aa5b.mjs.map +0 -1
- package/dist/_chunks/ru-c5a712be.js +0 -2
- package/dist/_chunks/ru-c5a712be.js.map +0 -1
- package/dist/_chunks/sv-6ccbf5f0.mjs.map +0 -1
- package/dist/_chunks/sv-e4ea8db8.js +0 -2
- package/dist/_chunks/sv-e4ea8db8.js.map +0 -1
- package/dist/_chunks/tr-34587a44.mjs.map +0 -1
- package/dist/_chunks/tr-fb5cfb93.js +0 -2
- package/dist/_chunks/tr-fb5cfb93.js.map +0 -1
- package/dist/_chunks/zh-667ba169.mjs.map +0 -1
- package/dist/_chunks/zh-b25c84c2.js +0 -2
- package/dist/_chunks/zh-b25c84c2.js.map +0 -1
package/dist/server/index.mjs
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
1
|
+
const register = ({ strapi }) => {
|
|
2
|
+
strapi.customFields.register({
|
|
3
3
|
name: "color",
|
|
4
4
|
plugin: "color-picker",
|
|
5
5
|
type: "string"
|
|
6
6
|
});
|
|
7
|
-
}
|
|
8
|
-
|
|
7
|
+
};
|
|
8
|
+
const index = {
|
|
9
|
+
register
|
|
9
10
|
};
|
|
10
11
|
export {
|
|
11
|
-
|
|
12
|
+
index as default
|
|
12
13
|
};
|
|
13
14
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../server/src/register.ts","../../server/src/index.ts"],"sourcesContent":["export const register = ({ strapi }: any) => {\n strapi.customFields.register({\n name: 'color',\n plugin: 'color-picker',\n type: 'string',\n });\n};\n","import { register } from './register';\n\nexport default {\n register,\n};\n"],"names":[
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../server/src/register.ts","../../server/src/index.ts"],"sourcesContent":["export const register = ({ strapi }: any) => {\n strapi.customFields.register({\n name: 'color',\n plugin: 'color-picker',\n type: 'string',\n });\n};\n","import { register } from './register';\n\nexport default {\n register,\n};\n"],"names":[],"mappings":"AAAO,MAAM,WAAW,CAAC,EAAE,aAAkB;AAC3C,SAAO,aAAa,SAAS;AAAA,IAC3B,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,MAAM;AAAA,EAAA,CACP;AACH;ACJA,MAAe,QAAA;AAAA,EACb;AACF;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../server/src/register.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,eAAgB,GAAG,SAMvC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strapi/plugin-color-picker",
|
|
3
|
-
"version": "4.15.0
|
|
3
|
+
"version": "4.15.0",
|
|
4
4
|
"description": "Strapi maintained Custom Fields",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -41,37 +41,31 @@
|
|
|
41
41
|
"./dist",
|
|
42
42
|
"strapi-server.js"
|
|
43
43
|
],
|
|
44
|
-
"strapi": {
|
|
45
|
-
"name": "color-picker",
|
|
46
|
-
"description": "Color picker custom field",
|
|
47
|
-
"kind": "plugin",
|
|
48
|
-
"displayName": "Color Picker"
|
|
49
|
-
},
|
|
50
44
|
"scripts": {
|
|
51
|
-
"build": "
|
|
52
|
-
"watch": "run -T tsc -w --preserveWatchOutput",
|
|
45
|
+
"build": "strapi plugin:build --force",
|
|
53
46
|
"clean": "run -T rimraf ./dist",
|
|
47
|
+
"lint": "yarn lint:project && yarn lint:back && yarn lint:front",
|
|
48
|
+
"lint:back": "run -T eslint ./server -c ./server/.eslintrc.js",
|
|
49
|
+
"lint:front": "run -T eslint ./admin -c ./admin/.eslintrc.js",
|
|
50
|
+
"lint:project": "run -T eslint . -c ./.eslintrc.js",
|
|
54
51
|
"prepublishOnly": "yarn clean && yarn build",
|
|
55
52
|
"test:front": "run -T cross-env IS_EE=true jest --config ./jest.config.front.js",
|
|
56
|
-
"test:front:watch": "run -T cross-env IS_EE=true jest --config ./jest.config.front.js --watchAll",
|
|
57
53
|
"test:front:ce": "run -T cross-env IS_EE=false jest --config ./jest.config.front.js",
|
|
54
|
+
"test:front:watch": "run -T cross-env IS_EE=true jest --config ./jest.config.front.js --watchAll",
|
|
58
55
|
"test:front:watch:ce": "run -T cross-env IS_EE=false jest --config ./jest.config.front.js --watchAll",
|
|
59
56
|
"test:ts:front": "run -T tsc -p admin/tsconfig.json",
|
|
60
|
-
"
|
|
61
|
-
"lint:project": "run -T eslint . -c ./.eslintrc.js",
|
|
62
|
-
"lint:back": "run -T eslint ./server -c ./server/.eslintrc.js",
|
|
63
|
-
"lint:front": "run -T eslint ./admin -c ./admin/.eslintrc.js"
|
|
57
|
+
"watch": "strapi plugin:watch"
|
|
64
58
|
},
|
|
65
59
|
"dependencies": {
|
|
66
|
-
"@strapi/design-system": "1.
|
|
67
|
-
"@strapi/helper-plugin": "4.15.0
|
|
68
|
-
"@strapi/icons": "1.
|
|
60
|
+
"@strapi/design-system": "1.13.0",
|
|
61
|
+
"@strapi/helper-plugin": "4.15.0",
|
|
62
|
+
"@strapi/icons": "1.13.0",
|
|
69
63
|
"prop-types": "^15.8.1",
|
|
70
64
|
"react-colorful": "5.6.1",
|
|
71
65
|
"react-intl": "6.4.1"
|
|
72
66
|
},
|
|
73
67
|
"devDependencies": {
|
|
74
|
-
"@strapi/strapi": "4.15.0
|
|
68
|
+
"@strapi/strapi": "4.15.0",
|
|
75
69
|
"@testing-library/react": "14.0.0",
|
|
76
70
|
"@testing-library/user-event": "14.4.3",
|
|
77
71
|
"@types/styled-components": "5.1.26",
|
|
@@ -89,8 +83,14 @@
|
|
|
89
83
|
"styled-components": "5.3.3"
|
|
90
84
|
},
|
|
91
85
|
"engines": {
|
|
92
|
-
"node": ">=
|
|
86
|
+
"node": ">=18.0.0 <=20.x.x",
|
|
93
87
|
"npm": ">=6.0.0"
|
|
94
88
|
},
|
|
95
|
-
"
|
|
89
|
+
"strapi": {
|
|
90
|
+
"name": "color-picker",
|
|
91
|
+
"description": "Color picker custom field",
|
|
92
|
+
"kind": "plugin",
|
|
93
|
+
"displayName": "Color Picker"
|
|
94
|
+
},
|
|
95
|
+
"gitHead": "6e44e1e68db5153e485e61bdc03f42efb0311406"
|
|
96
96
|
}
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import { j as r, g as f } from "./index-85aee7ac.mjs";
|
|
2
|
-
import * as a from "react";
|
|
3
|
-
import { BaseButton as R, Popover as $, Field as T, Flex as g, FieldLabel as F, Typography as j, FocusTrap as B, Box as _, FieldInput as E, FieldHint as I, FieldError as M } from "@strapi/design-system";
|
|
4
|
-
import { CarretDown as H } from "@strapi/icons";
|
|
5
|
-
import { HexColorPicker as D } from "react-colorful";
|
|
6
|
-
import { useIntl as L } from "react-intl";
|
|
7
|
-
import l from "styled-components";
|
|
8
|
-
import "@strapi/helper-plugin";
|
|
9
|
-
function S(e, o) {
|
|
10
|
-
typeof e == "function" ? e(o) : e != null && (e.current = o);
|
|
11
|
-
}
|
|
12
|
-
function U(...e) {
|
|
13
|
-
return (o) => e.forEach((i) => S(i, o));
|
|
14
|
-
}
|
|
15
|
-
function X(...e) {
|
|
16
|
-
return a.useCallback(U(...e), e);
|
|
17
|
-
}
|
|
18
|
-
const q = l.div`
|
|
19
|
-
border-radius: 50%;
|
|
20
|
-
width: 20px;
|
|
21
|
-
height: 20px;
|
|
22
|
-
margin-right: 10px;
|
|
23
|
-
background-color: ${(e) => e.color};
|
|
24
|
-
border: 1px solid rgba(0, 0, 0, 0.1);
|
|
25
|
-
`, z = l(D)`
|
|
26
|
-
&& {
|
|
27
|
-
width: 100%;
|
|
28
|
-
aspect-ratio: 1.5;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.react-colorful__pointer {
|
|
32
|
-
width: ${({ theme: e }) => e.spaces[3]};
|
|
33
|
-
height: ${({ theme: e }) => e.spaces[3]};
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.react-colorful__saturation {
|
|
37
|
-
border-radius: ${({ theme: e }) => e.spaces[1]};
|
|
38
|
-
border-bottom: none;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.react-colorful__hue {
|
|
42
|
-
border-radius: 10px;
|
|
43
|
-
height: ${({ theme: e }) => e.spaces[3]};
|
|
44
|
-
margin-top: ${({ theme: e }) => e.spaces[2]};
|
|
45
|
-
}
|
|
46
|
-
`, A = l(R)`
|
|
47
|
-
display: flex;
|
|
48
|
-
justify-content: space-between;
|
|
49
|
-
align-items: center;
|
|
50
|
-
|
|
51
|
-
svg {
|
|
52
|
-
width: ${({ theme: e }) => e.spaces[2]};
|
|
53
|
-
height: ${({ theme: e }) => e.spaces[2]};
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
svg > path {
|
|
57
|
-
fill: ${({ theme: e }) => e.colors.neutral500};
|
|
58
|
-
justify-self: flex-end;
|
|
59
|
-
}
|
|
60
|
-
`, G = l($)`
|
|
61
|
-
padding: ${({ theme: e }) => e.spaces[2]};
|
|
62
|
-
min-height: 270px;
|
|
63
|
-
`, Y = a.forwardRef(
|
|
64
|
-
({
|
|
65
|
-
attribute: e,
|
|
66
|
-
description: o,
|
|
67
|
-
disabled: i = !1,
|
|
68
|
-
error: k,
|
|
69
|
-
intlLabel: C,
|
|
70
|
-
labelAction: b,
|
|
71
|
-
name: c,
|
|
72
|
-
onChange: h,
|
|
73
|
-
required: y = !1,
|
|
74
|
-
value: n = ""
|
|
75
|
-
}, P) => {
|
|
76
|
-
const [p, d] = a.useState(!1), x = a.useRef(), { formatMessage: t } = L(), u = n || "#000000", m = { textTransform: "uppercase" }, v = (s) => {
|
|
77
|
-
s.preventDefault(), s.currentTarget.contains(s.relatedTarget) || d(!1);
|
|
78
|
-
}, w = X(P, x);
|
|
79
|
-
return /* @__PURE__ */ r.jsx(
|
|
80
|
-
T,
|
|
81
|
-
{
|
|
82
|
-
name: c,
|
|
83
|
-
id: c,
|
|
84
|
-
error: k,
|
|
85
|
-
hint: o && t(o),
|
|
86
|
-
required: y,
|
|
87
|
-
children: /* @__PURE__ */ r.jsxs(g, { direction: "column", alignItems: "stretch", gap: 1, children: [
|
|
88
|
-
/* @__PURE__ */ r.jsx(F, { action: b, children: t(C) }),
|
|
89
|
-
/* @__PURE__ */ r.jsxs(
|
|
90
|
-
A,
|
|
91
|
-
{
|
|
92
|
-
ref: w,
|
|
93
|
-
"aria-label": t({
|
|
94
|
-
id: f("color-picker.toggle.aria-label"),
|
|
95
|
-
defaultMessage: "Color picker toggle"
|
|
96
|
-
}),
|
|
97
|
-
"aria-controls": "color-picker-value",
|
|
98
|
-
"aria-haspopup": "dialog",
|
|
99
|
-
"aria-expanded": p,
|
|
100
|
-
"aria-disabled": i,
|
|
101
|
-
disabled: i,
|
|
102
|
-
onClick: () => d(!p),
|
|
103
|
-
children: [
|
|
104
|
-
/* @__PURE__ */ r.jsxs(g, { children: [
|
|
105
|
-
/* @__PURE__ */ r.jsx(q, { color: u }),
|
|
106
|
-
/* @__PURE__ */ r.jsx(
|
|
107
|
-
j,
|
|
108
|
-
{
|
|
109
|
-
style: m,
|
|
110
|
-
textColor: n ? null : "neutral600",
|
|
111
|
-
variant: "omega",
|
|
112
|
-
children: u
|
|
113
|
-
}
|
|
114
|
-
)
|
|
115
|
-
] }),
|
|
116
|
-
/* @__PURE__ */ r.jsx(H, { "aria-hidden": !0 })
|
|
117
|
-
]
|
|
118
|
-
}
|
|
119
|
-
),
|
|
120
|
-
p && /* @__PURE__ */ r.jsx(
|
|
121
|
-
G,
|
|
122
|
-
{
|
|
123
|
-
onBlur: v,
|
|
124
|
-
role: "dialog",
|
|
125
|
-
source: x,
|
|
126
|
-
spacing: 4,
|
|
127
|
-
children: /* @__PURE__ */ r.jsxs(B, { onEscape: () => d(!1), children: [
|
|
128
|
-
/* @__PURE__ */ r.jsx(
|
|
129
|
-
z,
|
|
130
|
-
{
|
|
131
|
-
color: u,
|
|
132
|
-
onChange: (s) => h({ target: { name: c, value: s, type: e.type } })
|
|
133
|
-
}
|
|
134
|
-
),
|
|
135
|
-
/* @__PURE__ */ r.jsxs(g, { paddingTop: 3, paddingLeft: 4, justifyContent: "flex-end", children: [
|
|
136
|
-
/* @__PURE__ */ r.jsx(_, { paddingRight: 2, children: /* @__PURE__ */ r.jsx(j, { variant: "omega", as: "label", textColor: "neutral600", children: t({
|
|
137
|
-
id: f("color-picker.input.format"),
|
|
138
|
-
defaultMessage: "HEX"
|
|
139
|
-
}) }) }),
|
|
140
|
-
/* @__PURE__ */ r.jsx(
|
|
141
|
-
E,
|
|
142
|
-
{
|
|
143
|
-
id: "color-picker-value",
|
|
144
|
-
"aria-label": t({
|
|
145
|
-
id: f("color-picker.input.aria-label"),
|
|
146
|
-
defaultMessage: "Color picker input"
|
|
147
|
-
}),
|
|
148
|
-
style: m,
|
|
149
|
-
value: n,
|
|
150
|
-
placeholder: "#000000",
|
|
151
|
-
onChange: h
|
|
152
|
-
}
|
|
153
|
-
)
|
|
154
|
-
] })
|
|
155
|
-
] })
|
|
156
|
-
}
|
|
157
|
-
),
|
|
158
|
-
/* @__PURE__ */ r.jsx(I, {}),
|
|
159
|
-
/* @__PURE__ */ r.jsx(M, {})
|
|
160
|
-
] })
|
|
161
|
-
}
|
|
162
|
-
);
|
|
163
|
-
}
|
|
164
|
-
);
|
|
165
|
-
export {
|
|
166
|
-
Y as ColorPickerInput
|
|
167
|
-
};
|
|
168
|
-
//# sourceMappingURL=ColorPickerInput-35879029.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ColorPickerInput-35879029.mjs","sources":["../../admin/src/hooks/useComposeRefs.ts","../../admin/src/components/ColorPickerInput.tsx"],"sourcesContent":["import * as React from 'react';\n\ntype PossibleRef<T> = React.Ref<T> | undefined;\n\n/**\n * Set a given ref to a given value\n * This utility takes care of different types of refs: callback refs and RefObject(s)\n */\nfunction setRef<T>(ref: PossibleRef<T>, value: T) {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref !== null && ref !== undefined) {\n (ref as React.MutableRefObject<T>).current = value;\n }\n}\n\n/**\n * A utility to compose multiple refs together\n * Accepts callback refs and RefObject(s)\n */\nfunction composeRefs<T>(...refs: PossibleRef<T>[]) {\n return (node: T) => refs.forEach((ref) => setRef(ref, node));\n}\n\n/**\n * Takes multiple React like refs either React.Ref or a callback:\n * (node: T) => void and returns a single function that can be\n * passed to a React component as a ref.\n *\n * Example:\n * ```tsx\n * import { useComposedRefs } from '../hooks/useComposedRefs';\n *\n * const Component = React.forwardRef<HTMLInputElement, ComponentProps>((props, forwardedRef) => {\n * const ref = useComposedRefs(internalRef, forwardedRef);\n *\n * React.useEffect(() => {\n * ref.current.focus();\n * }, [ref]);\n *\n * return <input ref={ref} />\n * }\n * ```\n */\nfunction useComposedRefs<T>(...refs: PossibleRef<T>[]) {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return React.useCallback(composeRefs(...refs), refs);\n}\n\nexport { composeRefs, useComposedRefs };\n","import * as React from 'react';\n\nimport {\n BaseButton,\n Box,\n Field,\n FieldError,\n FieldHint,\n FieldInput,\n FieldLabel,\n Flex,\n FocusTrap,\n Popover,\n Typography,\n} from '@strapi/design-system';\nimport { CarretDown } from '@strapi/icons';\nimport { HexColorPicker } from 'react-colorful';\nimport { useIntl, MessageDescriptor } from 'react-intl';\nimport styled from 'styled-components';\n\nimport { useComposedRefs } from '../hooks/useComposeRefs';\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(BaseButton)`\n display: flex;\n justify-content: space-between;\n align-items: center;\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)`\n padding: ${({ theme }) => theme.spaces[2]};\n min-height: 270px;\n`;\n\n/**\n * TODO: A lot of these props should extend `FieldProps`\n */\ninterface ColorPickerInputProps {\n intlLabel: MessageDescriptor;\n /**\n * TODO: this should be extended from `FieldInputProps['onChange']\n * but that conflicts with it's secondary usage in `HexColorPicker`\n */\n onChange: (event: { target: { name: string; value: string; type: string } }) => void;\n attribute: { type: string; [key: string]: unknown };\n name: string;\n description?: MessageDescriptor;\n disabled?: boolean;\n error?: string;\n labelAction?: React.ReactNode;\n required?: boolean;\n value?: string;\n}\n\nexport const ColorPickerInput = React.forwardRef<HTMLDivElement, ColorPickerInputProps>(\n (\n {\n attribute,\n description,\n disabled = false,\n error,\n intlLabel,\n labelAction,\n name,\n onChange,\n required = false,\n value = '',\n },\n forwardedRef\n ) => {\n const [showColorPicker, setShowColorPicker] = React.useState(false);\n const colorPickerButtonRef = React.useRef();\n const { formatMessage } = useIntl();\n const color = value || '#000000';\n const styleUppercase = { textTransform: 'uppercase' };\n\n const handleBlur: React.FocusEventHandler<HTMLDivElement> = (e) => {\n e.preventDefault();\n\n if (!e.currentTarget.contains(e.relatedTarget)) {\n setShowColorPicker(false);\n }\n };\n\n const composedRefs = useComposedRefs(forwardedRef, colorPickerButtonRef);\n\n return (\n <Field\n name={name}\n id={name}\n // GenericInput calls formatMessage and returns a string for the error\n error={error}\n hint={description && formatMessage(description)}\n required={required}\n >\n <Flex direction=\"column\" alignItems=\"stretch\" gap={1}>\n <FieldLabel action={labelAction}>{formatMessage(intlLabel)}</FieldLabel>\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 onClick={() => setShowColorPicker(!showColorPicker)}\n >\n <Flex>\n <ColorPreview color={color} />\n <Typography\n style={styleUppercase}\n textColor={value ? null : 'neutral600'}\n variant=\"omega\"\n >\n {color}\n </Typography>\n </Flex>\n <CarretDown aria-hidden />\n </ColorPickerToggle>\n {showColorPicker && (\n <ColorPickerPopover\n onBlur={handleBlur}\n role=\"dialog\"\n source={colorPickerButtonRef}\n spacing={4}\n >\n <FocusTrap onEscape={() => setShowColorPicker(false)}>\n <ColorPicker\n color={color}\n onChange={(hexValue) =>\n onChange({ target: { name, value: hexValue, type: attribute.type } })\n }\n />\n <Flex paddingTop={3} paddingLeft={4} justifyContent=\"flex-end\">\n <Box paddingRight={2}>\n <Typography variant=\"omega\" as=\"label\" textColor=\"neutral600\">\n {formatMessage({\n id: getTrad('color-picker.input.format'),\n defaultMessage: 'HEX',\n })}\n </Typography>\n </Box>\n <FieldInput\n id=\"color-picker-value\"\n aria-label={formatMessage({\n id: getTrad('color-picker.input.aria-label'),\n defaultMessage: 'Color picker input',\n })}\n style={styleUppercase}\n value={value}\n placeholder=\"#000000\"\n onChange={onChange}\n />\n </Flex>\n </FocusTrap>\n </ColorPickerPopover>\n )}\n <FieldHint />\n <FieldError />\n </Flex>\n </Field>\n );\n }\n);\n"],"names":["setRef","ref","value","composeRefs","refs","node","useComposedRefs","React","ColorPreview","styled","props","ColorPicker","HexColorPicker","theme","ColorPickerToggle","BaseButton","ColorPickerPopover","Popover","ColorPickerInput","attribute","description","disabled","error","intlLabel","labelAction","name","onChange","required","forwardedRef","showColorPicker","setShowColorPicker","colorPickerButtonRef","formatMessage","useIntl","color","styleUppercase","handleBlur","e","composedRefs","jsx","Field","Flex","FieldLabel","jsxs","getTrad","Typography","CarretDown","FocusTrap","hexValue","Box","FieldInput","FieldHint","FieldError"],"mappings":";;;;;;;;AAQA,SAASA,EAAUC,GAAqBC,GAAU;AAC5C,EAAA,OAAOD,KAAQ,aACjBA,EAAIC,CAAK,IACA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A,wBAC3C,gBAAgB;AAAA,sBAAA,CACjB;AAAA,sBACD,OAAOT;AAAA,sBACP,OAAAjC;AAAA,sBACA,aAAY;AAAA,sBACZ,UAAAwB;AAAA,oBAAA;AAAA,kBACF;AAAA,gBAAA,GACF;AAAA,cAAA,GACF;AAAA,YAAA;AAAA,UACF;AAAA,gCAEDyB,GAAU,EAAA;AAAA,gCACVC,GAAW,EAAA;AAAA,QAAA,GACd;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-2963da37.js"),C=require("react"),r=require("@strapi/design-system"),P=require("@strapi/icons"),T=require("react-colorful"),v=require("react-intl"),c=require("styled-components");require("@strapi/helper-plugin");function w(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const a=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(o,s,a.get?a:{enumerable:!0,get:()=>e[s]})}}return o.default=e,Object.freeze(o)}const l=w(C);function $(e,o){typeof e=="function"?e(o):e!=null&&(e.current=o)}function F(...e){return o=>e.forEach(s=>$(s,o))}function _(...e){return l.useCallback(F(...e),e)}const q=c.div`
|
|
2
|
-
border-radius: 50%;
|
|
3
|
-
width: 20px;
|
|
4
|
-
height: 20px;
|
|
5
|
-
margin-right: 10px;
|
|
6
|
-
background-color: ${e=>e.color};
|
|
7
|
-
border: 1px solid rgba(0, 0, 0, 0.1);
|
|
8
|
-
`,S=c(T.HexColorPicker)`
|
|
9
|
-
&& {
|
|
10
|
-
width: 100%;
|
|
11
|
-
aspect-ratio: 1.5;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.react-colorful__pointer {
|
|
15
|
-
width: ${({theme:e})=>e.spaces[3]};
|
|
16
|
-
height: ${({theme:e})=>e.spaces[3]};
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.react-colorful__saturation {
|
|
20
|
-
border-radius: ${({theme:e})=>e.spaces[1]};
|
|
21
|
-
border-bottom: none;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.react-colorful__hue {
|
|
25
|
-
border-radius: 10px;
|
|
26
|
-
height: ${({theme:e})=>e.spaces[3]};
|
|
27
|
-
margin-top: ${({theme:e})=>e.spaces[2]};
|
|
28
|
-
}
|
|
29
|
-
`,B=c(r.BaseButton)`
|
|
30
|
-
display: flex;
|
|
31
|
-
justify-content: space-between;
|
|
32
|
-
align-items: center;
|
|
33
|
-
|
|
34
|
-
svg {
|
|
35
|
-
width: ${({theme:e})=>e.spaces[2]};
|
|
36
|
-
height: ${({theme:e})=>e.spaces[2]};
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
svg > path {
|
|
40
|
-
fill: ${({theme:e})=>e.colors.neutral500};
|
|
41
|
-
justify-self: flex-end;
|
|
42
|
-
}
|
|
43
|
-
`,I=c(r.Popover)`
|
|
44
|
-
padding: ${({theme:e})=>e.spaces[2]};
|
|
45
|
-
min-height: 270px;
|
|
46
|
-
`,M=l.forwardRef(({attribute:e,description:o,disabled:s=!1,error:a,intlLabel:m,labelAction:R,name:u,onChange:f,required:b=!1,value:p=""},y)=>{const[d,x]=l.useState(!1),j=l.useRef(),{formatMessage:i}=v.useIntl(),g=p||"#000000",h={textTransform:"uppercase"},E=n=>{n.preventDefault(),n.currentTarget.contains(n.relatedTarget)||x(!1)},k=_(y,j);return t.jsxRuntimeExports.jsx(r.Field,{name:u,id:u,error:a,hint:o&&i(o),required:b,children:t.jsxRuntimeExports.jsxs(r.Flex,{direction:"column",alignItems:"stretch",gap:1,children:[t.jsxRuntimeExports.jsx(r.FieldLabel,{action:R,children:i(m)}),t.jsxRuntimeExports.jsxs(B,{ref:k,"aria-label":i({id:t.getTrad("color-picker.toggle.aria-label"),defaultMessage:"Color picker toggle"}),"aria-controls":"color-picker-value","aria-haspopup":"dialog","aria-expanded":d,"aria-disabled":s,disabled:s,onClick:()=>x(!d),children:[t.jsxRuntimeExports.jsxs(r.Flex,{children:[t.jsxRuntimeExports.jsx(q,{color:g}),t.jsxRuntimeExports.jsx(r.Typography,{style:h,textColor:p?null:"neutral600",variant:"omega",children:g})]}),t.jsxRuntimeExports.jsx(P.CarretDown,{"aria-hidden":!0})]}),d&&t.jsxRuntimeExports.jsx(I,{onBlur:E,role:"dialog",source:j,spacing:4,children:t.jsxRuntimeExports.jsxs(r.FocusTrap,{onEscape:()=>x(!1),children:[t.jsxRuntimeExports.jsx(S,{color:g,onChange:n=>f({target:{name:u,value:n,type:e.type}})}),t.jsxRuntimeExports.jsxs(r.Flex,{paddingTop:3,paddingLeft:4,justifyContent:"flex-end",children:[t.jsxRuntimeExports.jsx(r.Box,{paddingRight:2,children:t.jsxRuntimeExports.jsx(r.Typography,{variant:"omega",as:"label",textColor:"neutral600",children:i({id:t.getTrad("color-picker.input.format"),defaultMessage:"HEX"})})}),t.jsxRuntimeExports.jsx(r.FieldInput,{id:"color-picker-value","aria-label":i({id:t.getTrad("color-picker.input.aria-label"),defaultMessage:"Color picker input"}),style:h,value:p,placeholder:"#000000",onChange:f})]})]})}),t.jsxRuntimeExports.jsx(r.FieldHint,{}),t.jsxRuntimeExports.jsx(r.FieldError,{})]})})});exports.ColorPickerInput=M;
|
|
47
|
-
//# sourceMappingURL=ColorPickerInput-d3f12809.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ColorPickerInput-d3f12809.js","sources":["../../admin/src/hooks/useComposeRefs.ts","../../admin/src/components/ColorPickerInput.tsx"],"sourcesContent":["import * as React from 'react';\n\ntype PossibleRef<T> = React.Ref<T> | undefined;\n\n/**\n * Set a given ref to a given value\n * This utility takes care of different types of refs: callback refs and RefObject(s)\n */\nfunction setRef<T>(ref: PossibleRef<T>, value: T) {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref !== null && ref !== undefined) {\n (ref as React.MutableRefObject<T>).current = value;\n }\n}\n\n/**\n * A utility to compose multiple refs together\n * Accepts callback refs and RefObject(s)\n */\nfunction composeRefs<T>(...refs: PossibleRef<T>[]) {\n return (node: T) => refs.forEach((ref) => setRef(ref, node));\n}\n\n/**\n * Takes multiple React like refs either React.Ref or a callback:\n * (node: T) => void and returns a single function that can be\n * passed to a React component as a ref.\n *\n * Example:\n * ```tsx\n * import { useComposedRefs } from '../hooks/useComposedRefs';\n *\n * const Component = React.forwardRef<HTMLInputElement, ComponentProps>((props, forwardedRef) => {\n * const ref = useComposedRefs(internalRef, forwardedRef);\n *\n * React.useEffect(() => {\n * ref.current.focus();\n * }, [ref]);\n *\n * return <input ref={ref} />\n * }\n * ```\n */\nfunction useComposedRefs<T>(...refs: PossibleRef<T>[]) {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return React.useCallback(composeRefs(...refs), refs);\n}\n\nexport { composeRefs, useComposedRefs };\n","import * as React from 'react';\n\nimport {\n BaseButton,\n Box,\n Field,\n FieldError,\n FieldHint,\n FieldInput,\n FieldLabel,\n Flex,\n FocusTrap,\n Popover,\n Typography,\n} from '@strapi/design-system';\nimport { CarretDown } from '@strapi/icons';\nimport { HexColorPicker } from 'react-colorful';\nimport { useIntl, MessageDescriptor } from 'react-intl';\nimport styled from 'styled-components';\n\nimport { useComposedRefs } from '../hooks/useComposeRefs';\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(BaseButton)`\n display: flex;\n justify-content: space-between;\n align-items: center;\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)`\n padding: ${({ theme }) => theme.spaces[2]};\n min-height: 270px;\n`;\n\n/**\n * TODO: A lot of these props should extend `FieldProps`\n */\ninterface ColorPickerInputProps {\n intlLabel: MessageDescriptor;\n /**\n * TODO: this should be extended from `FieldInputProps['onChange']\n * but that conflicts with it's secondary usage in `HexColorPicker`\n */\n onChange: (event: { target: { name: string; value: string; type: string } }) => void;\n attribute: { type: string; [key: string]: unknown };\n name: string;\n description?: MessageDescriptor;\n disabled?: boolean;\n error?: string;\n labelAction?: React.ReactNode;\n required?: boolean;\n value?: string;\n}\n\nexport const ColorPickerInput = React.forwardRef<HTMLDivElement, ColorPickerInputProps>(\n (\n {\n attribute,\n description,\n disabled = false,\n error,\n intlLabel,\n labelAction,\n name,\n onChange,\n required = false,\n value = '',\n },\n forwardedRef\n ) => {\n const [showColorPicker, setShowColorPicker] = React.useState(false);\n const colorPickerButtonRef = React.useRef();\n const { formatMessage } = useIntl();\n const color = value || '#000000';\n const styleUppercase = { textTransform: 'uppercase' };\n\n const handleBlur: React.FocusEventHandler<HTMLDivElement> = (e) => {\n e.preventDefault();\n\n if (!e.currentTarget.contains(e.relatedTarget)) {\n setShowColorPicker(false);\n }\n };\n\n const composedRefs = useComposedRefs(forwardedRef, colorPickerButtonRef);\n\n return (\n <Field\n name={name}\n id={name}\n // GenericInput calls formatMessage and returns a string for the error\n error={error}\n hint={description && formatMessage(description)}\n required={required}\n >\n <Flex direction=\"column\" alignItems=\"stretch\" gap={1}>\n <FieldLabel action={labelAction}>{formatMessage(intlLabel)}</FieldLabel>\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 onClick={() => setShowColorPicker(!showColorPicker)}\n >\n <Flex>\n <ColorPreview color={color} />\n <Typography\n style={styleUppercase}\n textColor={value ? null : 'neutral600'}\n variant=\"omega\"\n >\n {color}\n </Typography>\n </Flex>\n <CarretDown aria-hidden />\n </ColorPickerToggle>\n {showColorPicker && (\n <ColorPickerPopover\n onBlur={handleBlur}\n role=\"dialog\"\n source={colorPickerButtonRef}\n spacing={4}\n >\n <FocusTrap onEscape={() => setShowColorPicker(false)}>\n <ColorPicker\n color={color}\n onChange={(hexValue) =>\n onChange({ target: { name, value: hexValue, type: attribute.type } })\n }\n />\n <Flex paddingTop={3} paddingLeft={4} justifyContent=\"flex-end\">\n <Box paddingRight={2}>\n <Typography variant=\"omega\" as=\"label\" textColor=\"neutral600\">\n {formatMessage({\n id: getTrad('color-picker.input.format'),\n defaultMessage: 'HEX',\n })}\n </Typography>\n </Box>\n <FieldInput\n id=\"color-picker-value\"\n aria-label={formatMessage({\n id: getTrad('color-picker.input.aria-label'),\n defaultMessage: 'Color picker input',\n })}\n style={styleUppercase}\n value={value}\n placeholder=\"#000000\"\n onChange={onChange}\n />\n </Flex>\n </FocusTrap>\n </ColorPickerPopover>\n )}\n <FieldHint />\n <FieldError />\n </Flex>\n </Field>\n );\n }\n);\n"],"names":["setRef","ref","value","composeRefs","refs","node","useComposedRefs","React","ColorPreview","styled","props","ColorPicker","HexColorPicker","theme","ColorPickerToggle","BaseButton","ColorPickerPopover","Popover","ColorPickerInput","attribute","description","disabled","error","intlLabel","labelAction","name","onChange","required","forwardedRef","showColorPicker","setShowColorPicker","colorPickerButtonRef","formatMessage","useIntl","color","styleUppercase","handleBlur","e","composedRefs","jsx","Field","Flex","FieldLabel","jsxs","getTrad","Typography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A,CACC,MAAOV,EACP,UAAWjC,EAAQ,KAAO,aAC1B,QAAQ,QAEP,SAAAgC,CAAA,CACH,CAAA,EACF,EACAK,EAAAA,kBAAAA,IAACO,EAAW,WAAA,CAAA,cAAW,EAAC,CAAA,CAAA,CAAA,CAC1B,EACCjB,GACCU,EAAA,kBAAA,IAACvB,EAAA,CACC,OAAQoB,EACR,KAAK,SACL,OAAQL,EACR,QAAS,EAET,kCAACgB,EAAAA,UAAU,CAAA,SAAU,IAAMjB,EAAmB,EAAK,EACjD,SAAA,CAAAS,EAAA,kBAAA,IAAC5B,EAAA,CACC,MAAAuB,EACA,SAAWc,GACTtB,EAAS,CAAE,OAAQ,CAAE,KAAAD,EAAM,MAAOuB,EAAU,KAAM7B,EAAU,MAAQ,CAAA,CAExE,2BACCsB,EAAAA,KAAK,CAAA,WAAY,EAAG,YAAa,EAAG,eAAe,WAClD,SAAA,CAACF,EAAA,kBAAA,IAAAU,EAAA,IAAA,CAAI,aAAc,EACjB,SAACV,EAAAA,kBAAAA,IAAAM,EAAA,WAAA,CAAW,QAAQ,QAAQ,GAAG,QAAQ,UAAU,aAC9C,SAAcb,EAAA,CACb,GAAIY,UAAQ,2BAA2B,EACvC,eAAgB,KAAA,CACjB,EACH,CACF,CAAA,EACAL,EAAA,kBAAA,IAACW,EAAA,WAAA,CACC,GAAG,qBACH,aAAYlB,EAAc,CACxB,GAAIY,UAAQ,+BAA+B,EAC3C,eAAgB,oBAAA,CACjB,EACD,MAAOT,EACP,MAAAjC,EACA,YAAY,UACZ,SAAAwB,CAAA,CACF,CAAA,EACF,CAAA,EACF,CAAA,CACF,0BAEDyB,EAAU,UAAA,EAAA,0BACVC,EAAW,WAAA,EAAA,CAAA,EACd,CAAA,CAAA,CAGN,CACF"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={"color-picker.description":"Vyberte libovolnou barvu","color-picker.input.aria-label":"Vstup pro výběr barvy","color-picker.input.format":"HEX","color-picker.label":"Barva","color-picker.options.advanced.regex":"RegExp vzor","color-picker.options.advanced.regex.description":"Zadejte regulární výraz pro ověření hodnoty HEX","color-picker.options.advanced.requiredField":"Povinné pole","color-picker.options.advanced.requiredField.description":"Pokud je toto pole prázdné, nebudete moci vytvořit záznam","color-picker.settings":"Nastavení","color-picker.toggle.aria-label":"Přepínač výběru barvy"};exports.default=e;
|
|
2
|
-
//# sourceMappingURL=cs-67f98136.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cs-67f98136.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cs-70e06424.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"en-096b1095.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={"color-picker.description":"Select any color","color-picker.input.aria-label":"Color picker input","color-picker.input.format":"HEX","color-picker.label":"Color","color-picker.options.advanced.regex":"RegExp pattern","color-picker.options.advanced.regex.description":"Provide a regular expression to validate the HEX value","color-picker.options.advanced.requiredField":"Required field","color-picker.options.advanced.requiredField.description":"You won't be able to create an entry if this field is empty","color-picker.settings":"Settings","color-picker.toggle.aria-label":"Color picker toggle","plugin.description.long":"A Strapi-maintained color picker custom field. Use saturation and hue sliders to select a color and save the value as a HEX string.","plugin.description.short":"A Strapi-maintained color picker custom field.","plugin.name":"Color picker"};exports.default=e;
|
|
2
|
-
//# sourceMappingURL=en-32ea9fdb.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"en-32ea9fdb.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";const cr=require("@strapi/helper-plugin"),we=require("react"),Ce=require("@strapi/design-system"),fr=require("@strapi/icons"),dr=require("styled-components"),vr=(h,p)=>{const g=h[p];return g?typeof g=="function"?g():Promise.resolve(g):new Promise((y,w)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(w.bind(null,new Error("Unknown variable dynamic import: "+p)))})};var X={exports:{}},I={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.min.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Pe;function pr(){if(Pe)return I;Pe=1;var h=we,p=Symbol.for("react.element"),g=Symbol.for("react.fragment"),y=Object.prototype.hasOwnProperty,w=h.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,$={key:!0,ref:!0,__self:!0,__source:!0};function k(_,c,C){var v,b={},T=null,q=null;C!==void 0&&(T=""+C),c.key!==void 0&&(T=""+c.key),c.ref!==void 0&&(q=c.ref);for(v in c)y.call(c,v)&&!$.hasOwnProperty(v)&&(b[v]=c[v]);if(_&&_.defaultProps)for(v in c=_.defaultProps,c)b[v]===void 0&&(b[v]=c[v]);return{$$typeof:p,type:_,key:T,ref:q,props:b,_owner:w.current}}return I.Fragment=g,I.jsx=k,I.jsxs=k,I}var A={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.development.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var xe;function gr(){return xe||(xe=1,process.env.NODE_ENV!=="production"&&function(){var h=we,p=Symbol.for("react.element"),g=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),$=Symbol.for("react.profiler"),k=Symbol.for("react.provider"),_=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),b=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),q=Symbol.for("react.offscreen"),Q=Symbol.iterator,Se="@@iterator";function je(e){if(e===null||typeof e!="object")return null;var r=Q&&e[Q]||e[Se];return typeof r=="function"?r:null}var O=h.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function f(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];ke("error",e,t)}}function ke(e,r,t){{var n=O.ReactDebugCurrentFrame,o=n.getStackAddendum();o!==""&&(r+="%s",t=t.concat([o]));var s=t.map(function(i){return String(i)});s.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,s)}}var Fe=!1,De=!1,Ie=!1,Ae=!1,$e=!1,ee;ee=Symbol.for("react.module.reference");function qe(e){return!!(typeof e=="string"||typeof e=="function"||e===y||e===$||$e||e===w||e===C||e===v||Ae||e===q||Fe||De||Ie||typeof e=="object"&&e!==null&&(e.$$typeof===T||e.$$typeof===b||e.$$typeof===k||e.$$typeof===_||e.$$typeof===c||e.$$typeof===ee||e.getModuleId!==void 0))}function Me(e,r,t){var n=e.displayName;if(n)return n;var o=r.displayName||r.name||"";return o!==""?t+"("+o+")":t}function re(e){return e.displayName||"Context"}function E(e){if(e==null)return null;if(typeof e.tag=="number"&&f("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case y:return"Fragment";case g:return"Portal";case $:return"Profiler";case w:return"StrictMode";case C:return"Suspense";case v:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case _:var r=e;return re(r)+".Consumer";case k:var t=e;return re(t._context)+".Provider";case c:return Me(e,e.render,"ForwardRef");case b:var n=e.displayName||null;return n!==null?n:E(e.type)||"Memo";case T:{var o=e,s=o._payload,i=o._init;try{return E(i(s))}catch{return null}}}return null}var P=Object.assign,F=0,te,ne,ae,ie,oe,se,ue;function le(){}le.__reactDisabledLog=!0;function We(){{if(F===0){te=console.log,ne=console.info,ae=console.warn,ie=console.error,oe=console.group,se=console.groupCollapsed,ue=console.groupEnd;var e={configurable:!0,enumerable:!0,value:le,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}F++}}function Ye(){{if(F--,F===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:P({},e,{value:te}),info:P({},e,{value:ne}),warn:P({},e,{value:ae}),error:P({},e,{value:ie}),group:P({},e,{value:oe}),groupCollapsed:P({},e,{value:se}),groupEnd:P({},e,{value:ue})})}F<0&&f("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var V=O.ReactCurrentDispatcher,U;function M(e,r,t){{if(U===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);U=n&&n[1]||""}return`
|
|
18
|
-
`+U+e}}var B=!1,W;{var Le=typeof WeakMap=="function"?WeakMap:Map;W=new Le}function ce(e,r){if(!e||B)return"";{var t=W.get(e);if(t!==void 0)return t}var n;B=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var s;s=V.current,V.current=null,We();try{if(r){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(R){n=R}Reflect.construct(e,[],i)}else{try{i.call()}catch(R){n=R}e.call(i.prototype)}}else{try{throw Error()}catch(R){n=R}e()}}catch(R){if(R&&n&&typeof R.stack=="string"){for(var a=R.stack.split(`
|
|
19
|
-
`),d=n.stack.split(`
|
|
20
|
-
`),u=a.length-1,l=d.length-1;u>=1&&l>=0&&a[u]!==d[l];)l--;for(;u>=1&&l>=0;u--,l--)if(a[u]!==d[l]){if(u!==1||l!==1)do if(u--,l--,l<0||a[u]!==d[l]){var m=`
|
|
21
|
-
`+a[u].replace(" at new "," at ");return e.displayName&&m.includes("<anonymous>")&&(m=m.replace("<anonymous>",e.displayName)),typeof e=="function"&&W.set(e,m),m}while(u>=1&&l>=0);break}}}finally{B=!1,V.current=s,Ye(),Error.prepareStackTrace=o}var j=e?e.displayName||e.name:"",Te=j?M(j):"";return typeof e=="function"&&W.set(e,Te),Te}function Ne(e,r,t){return ce(e,!1)}function Ve(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function Y(e,r,t){if(e==null)return"";if(typeof e=="function")return ce(e,Ve(e));if(typeof e=="string")return M(e);switch(e){case C:return M("Suspense");case v:return M("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case c:return Ne(e.render);case b:return Y(e.type,r,t);case T:{var n=e,o=n._payload,s=n._init;try{return Y(s(o),r,t)}catch{}}}return""}var L=Object.prototype.hasOwnProperty,fe={},de=O.ReactDebugCurrentFrame;function N(e){if(e){var r=e._owner,t=Y(e.type,e._source,r?r.type:null);de.setExtraStackFrame(t)}else de.setExtraStackFrame(null)}function Ue(e,r,t,n,o){{var s=Function.call.bind(L);for(var i in e)if(s(e,i)){var a=void 0;try{if(typeof e[i]!="function"){var d=Error((n||"React class")+": "+t+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}a=e[i](r,i,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(u){a=u}a&&!(a instanceof Error)&&(N(o),f("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,i,typeof a),N(null)),a instanceof Error&&!(a.message in fe)&&(fe[a.message]=!0,N(o),f("Failed %s type: %s",t,a.message),N(null))}}}var Be=Array.isArray;function J(e){return Be(e)}function Je(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function ze(e){try{return ve(e),!1}catch{return!0}}function ve(e){return""+e}function pe(e){if(ze(e))return f("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Je(e)),ve(e)}var D=O.ReactCurrentOwner,Ge={key:!0,ref:!0,__self:!0,__source:!0},ge,me,z;z={};function He(e){if(L.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Ke(e){if(L.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Xe(e,r){if(typeof e.ref=="string"&&D.current&&r&&D.current.stateNode!==r){var t=E(D.current.type);z[t]||(f('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',E(D.current.type),e.ref),z[t]=!0)}}function Ze(e,r){{var t=function(){ge||(ge=!0,f("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function Qe(e,r){{var t=function(){me||(me=!0,f("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var er=function(e,r,t,n,o,s,i){var a={$$typeof:p,type:e,key:r,ref:t,props:i,_owner:s};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function rr(e,r,t,n,o){{var s,i={},a=null,d=null;t!==void 0&&(pe(t),a=""+t),Ke(r)&&(pe(r.key),a=""+r.key),He(r)&&(d=r.ref,Xe(r,o));for(s in r)L.call(r,s)&&!Ge.hasOwnProperty(s)&&(i[s]=r[s]);if(e&&e.defaultProps){var u=e.defaultProps;for(s in u)i[s]===void 0&&(i[s]=u[s])}if(a||d){var l=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&Ze(i,l),d&&Qe(i,l)}return er(e,a,d,o,n,D.current,i)}}var G=O.ReactCurrentOwner,he=O.ReactDebugCurrentFrame;function S(e){if(e){var r=e._owner,t=Y(e.type,e._source,r?r.type:null);he.setExtraStackFrame(t)}else he.setExtraStackFrame(null)}var H;H=!1;function K(e){return typeof e=="object"&&e!==null&&e.$$typeof===p}function ye(){{if(G.current){var e=E(G.current.type);if(e)return`
|
|
22
|
-
|
|
23
|
-
Check the render method of \``+e+"`."}return""}}function tr(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return`
|
|
24
|
-
|
|
25
|
-
Check your code at `+r+":"+t+"."}return""}}var be={};function nr(e){{var r=ye();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
|
|
26
|
-
|
|
27
|
-
Check the top-level render call using <`+t+">.")}return r}}function Ee(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=nr(r);if(be[t])return;be[t]=!0;var n="";e&&e._owner&&e._owner!==G.current&&(n=" It was passed a child from "+E(e._owner.type)+"."),S(e),f('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),S(null)}}function Re(e,r){{if(typeof e!="object")return;if(J(e))for(var t=0;t<e.length;t++){var n=e[t];K(n)&&Ee(n,r)}else if(K(e))e._store&&(e._store.validated=!0);else if(e){var o=je(e);if(typeof o=="function"&&o!==e.entries)for(var s=o.call(e),i;!(i=s.next()).done;)K(i.value)&&Ee(i.value,r)}}}function ar(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===c||r.$$typeof===b))t=r.propTypes;else return;if(t){var n=E(r);Ue(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!H){H=!0;var o=E(r);f("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",o||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&f("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ir(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){S(e),f("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),S(null);break}}e.ref!==null&&(S(e),f("Invalid attribute `ref` supplied to `React.Fragment`."),S(null))}}function _e(e,r,t,n,o,s){{var i=qe(e);if(!i){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var d=tr(o);d?a+=d:a+=ye();var u;e===null?u="null":J(e)?u="array":e!==void 0&&e.$$typeof===p?(u="<"+(E(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):u=typeof e,f("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",u,a)}var l=rr(e,r,t,o,s);if(l==null)return l;if(i){var m=r.children;if(m!==void 0)if(n)if(J(m)){for(var j=0;j<m.length;j++)Re(m[j],e);Object.freeze&&Object.freeze(m)}else f("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Re(m,e)}return e===y?ir(l):ar(l),l}}function or(e,r,t){return _e(e,r,t,!0)}function sr(e,r,t){return _e(e,r,t,!1)}var ur=sr,lr=or;A.Fragment=y,A.jsx=ur,A.jsxs=lr}()),A}process.env.NODE_ENV==="production"?X.exports=pr():X.exports=gr();var Z=X.exports;const mr=dr(Ce.Flex)`
|
|
28
|
-
/* Hard code color values */
|
|
29
|
-
/* to stay consistent between themes */
|
|
30
|
-
background-color: #f0f0ff; /* primary100 */
|
|
31
|
-
border: 1px solid #d9d8ff; /* primary200 */
|
|
32
|
-
|
|
33
|
-
svg > path {
|
|
34
|
-
fill: #4945ff; /* primary600 */
|
|
35
|
-
}
|
|
36
|
-
`,hr=()=>Z.jsx(mr,{justifyContent:"center",alignItems:"center",width:7,height:6,hasRadius:!0,"aria-hidden":!0,children:Z.jsx(Ce.Icon,{as:fr.Paint})}),Oe="color-picker",x=h=>`${Oe}.${h}`,yr={register(h){h.customFields.register({name:"color",pluginId:"color-picker",type:"string",icon:hr,intlLabel:{id:x("color-picker.label"),defaultMessage:"Color"},intlDescription:{id:x("color-picker.description"),defaultMessage:"Select any color"},components:{Input:async()=>Promise.resolve().then(()=>require("./ColorPickerInput-d3f12809.js")).then(p=>({default:p.ColorPickerInput}))},options:{advanced:[{intlLabel:{id:x("color-picker.options.advanced.regex"),defaultMessage:"RegExp pattern"},name:"regex",type:"text",defaultValue:"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$",description:{id:x("color-picker.options.advanced.regex.description"),defaultMessage:"The text of the regular expression"}},{sectionTitle:{id:"global.settings",defaultMessage:"Settings"},items:[{name:"required",type:"checkbox",intlLabel:{id:x("color-picker.options.advanced.requiredField"),defaultMessage:"Required field"},description:{id:x("color-picker.options.advanced.requiredField.description"),defaultMessage:"You won't be able to create an entry if this field is empty"}}]}]}})},async registerTrads({locales:h}){const p=await Promise.all(h.map(g=>vr(Object.assign({"./translations/cs.json":()=>Promise.resolve().then(()=>require("./cs-67f98136.js")),"./translations/en.json":()=>Promise.resolve().then(()=>require("./en-32ea9fdb.js")),"./translations/ru.json":()=>Promise.resolve().then(()=>require("./ru-c5a712be.js")),"./translations/sv.json":()=>Promise.resolve().then(()=>require("./sv-e4ea8db8.js")),"./translations/tr.json":()=>Promise.resolve().then(()=>require("./tr-fb5cfb93.js")),"./translations/zh.json":()=>Promise.resolve().then(()=>require("./zh-b25c84c2.js"))}),`./translations/${g}.json`).then(({default:y})=>({data:cr.prefixPluginTranslations(y,Oe),locale:g})).catch(()=>({data:{},locale:g}))));return Promise.resolve(p)}};exports.getTrad=x;exports.index=yr;exports.jsxRuntimeExports=Z;
|
|
37
|
-
//# sourceMappingURL=index-2963da37.js.map
|