@strapi/plugin-color-picker 0.0.0-next.c7c44a121f7abc0c52826a7d310fe4534b8727f0 → 0.0.0-next.c80d4d9b205f7844215758ba333894819685e6c1

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.
Files changed (63) hide show
  1. package/dist/_chunks/ColorPickerInput-0lOoTrf0.js +206 -0
  2. package/dist/_chunks/{ColorPickerInput-8c35610d.js.map → ColorPickerInput-0lOoTrf0.js.map} +1 -1
  3. package/dist/_chunks/ColorPickerInput-fKB6YXW8.mjs +185 -0
  4. package/dist/_chunks/{ColorPickerInput-b9dc2ba1.mjs.map → ColorPickerInput-fKB6YXW8.mjs.map} +1 -1
  5. package/dist/_chunks/{cs-c22467c6.js → cs-4GdZY0p6.js} +1 -1
  6. package/dist/_chunks/cs-4GdZY0p6.js.map +1 -0
  7. package/dist/_chunks/{cs-32e5b75a.mjs → cs-A2xRj-2-.mjs} +1 -1
  8. package/dist/_chunks/cs-A2xRj-2-.mjs.map +1 -0
  9. package/dist/_chunks/{en-2230584b.mjs → en-L6ZZWDJv.mjs} +1 -1
  10. package/dist/_chunks/en-L6ZZWDJv.mjs.map +1 -0
  11. package/dist/_chunks/{en-eb6717ab.js → en-WeRHjVEB.js} +1 -1
  12. package/dist/_chunks/en-WeRHjVEB.js.map +1 -0
  13. package/dist/_chunks/{index-83ab6784.js → index-OJYEuoCq.js} +7 -16
  14. package/dist/_chunks/index-OJYEuoCq.js.map +1 -0
  15. package/dist/_chunks/{index-b4858a3b.mjs → index-uOrtnJpz.mjs} +7 -16
  16. package/dist/_chunks/index-uOrtnJpz.mjs.map +1 -0
  17. package/dist/_chunks/{ru-0bf57448.mjs → ru-LLXYEOwl.mjs} +1 -1
  18. package/dist/_chunks/ru-LLXYEOwl.mjs.map +1 -0
  19. package/dist/_chunks/{ru-1d1cf8a8.js → ru-UXN_ByI9.js} +1 -1
  20. package/dist/_chunks/ru-UXN_ByI9.js.map +1 -0
  21. package/dist/_chunks/{sv-6e7fa200.js → sv-3-Yk9bKb.js} +1 -1
  22. package/dist/_chunks/sv-3-Yk9bKb.js.map +1 -0
  23. package/dist/_chunks/{sv-de6a785a.mjs → sv-QqRPNQLw.mjs} +1 -1
  24. package/dist/_chunks/sv-QqRPNQLw.mjs.map +1 -0
  25. package/dist/_chunks/{tr-67b6e192.js → tr-AbD-f8F0.js} +1 -1
  26. package/dist/_chunks/tr-AbD-f8F0.js.map +1 -0
  27. package/dist/_chunks/{tr-4d632eac.mjs → tr-qYGSw8gH.mjs} +1 -1
  28. package/dist/_chunks/tr-qYGSw8gH.mjs.map +1 -0
  29. package/dist/_chunks/{zh-e5010f8b.js → zh-c23gv_oM.js} +1 -1
  30. package/dist/_chunks/zh-c23gv_oM.js.map +1 -0
  31. package/dist/_chunks/{zh-5ba3e025.mjs → zh-fPTOIT6s.mjs} +1 -1
  32. package/dist/_chunks/zh-fPTOIT6s.mjs.map +1 -0
  33. package/dist/admin/index.js +2 -2
  34. package/dist/admin/index.mjs +2 -2
  35. package/dist/server/src/index.d.ts.map +1 -0
  36. package/dist/server/src/register.d.ts.map +1 -0
  37. package/package.json +12 -16
  38. package/dist/_chunks/ColorPickerInput-8c35610d.js +0 -298
  39. package/dist/_chunks/ColorPickerInput-b9dc2ba1.mjs +0 -277
  40. package/dist/_chunks/cs-32e5b75a.mjs.map +0 -1
  41. package/dist/_chunks/cs-c22467c6.js.map +0 -1
  42. package/dist/_chunks/en-2230584b.mjs.map +0 -1
  43. package/dist/_chunks/en-eb6717ab.js.map +0 -1
  44. package/dist/_chunks/index-83ab6784.js.map +0 -1
  45. package/dist/_chunks/index-b4858a3b.mjs.map +0 -1
  46. package/dist/_chunks/ru-0bf57448.mjs.map +0 -1
  47. package/dist/_chunks/ru-1d1cf8a8.js.map +0 -1
  48. package/dist/_chunks/sv-6e7fa200.js.map +0 -1
  49. package/dist/_chunks/sv-de6a785a.mjs.map +0 -1
  50. package/dist/_chunks/tr-4d632eac.mjs.map +0 -1
  51. package/dist/_chunks/tr-67b6e192.js.map +0 -1
  52. package/dist/_chunks/zh-5ba3e025.mjs.map +0 -1
  53. package/dist/_chunks/zh-e5010f8b.js.map +0 -1
  54. package/dist/server/index.d.ts.map +0 -1
  55. package/dist/server/register.d.ts.map +0 -1
  56. /package/dist/admin/{components → src/components}/ColorPickerIcon.d.ts +0 -0
  57. /package/dist/admin/{components → src/components}/ColorPickerInput.d.ts +0 -0
  58. /package/dist/admin/{hooks → src/hooks}/useComposeRefs.d.ts +0 -0
  59. /package/dist/admin/{index.d.ts → src/index.d.ts} +0 -0
  60. /package/dist/admin/{pluginId.d.ts → src/pluginId.d.ts} +0 -0
  61. /package/dist/admin/{utils → src/utils}/getTrad.d.ts +0 -0
  62. /package/dist/server/{index.d.ts → src/index.d.ts} +0 -0
  63. /package/dist/server/{register.d.ts → src/register.d.ts} +0 -0
@@ -1,5 +1,5 @@
1
1
  import { prefixPluginTranslations } from "@strapi/helper-plugin";
2
- import { jsxDEV } from "react/jsx-dev-runtime";
2
+ import { jsx } from "react/jsx-runtime";
3
3
  import { Flex, Icon } from "@strapi/design-system";
4
4
  import { Paint } from "@strapi/icons";
5
5
  import styled from "styled-components";
@@ -23,15 +23,7 @@ const IconBox = styled(Flex)`
23
23
  }
24
24
  `;
25
25
  const ColorPickerIcon = () => {
26
- return /* @__PURE__ */ jsxDEV(IconBox, { justifyContent: "center", alignItems: "center", width: 7, height: 6, hasRadius: true, "aria-hidden": true, children: /* @__PURE__ */ jsxDEV(Icon, { as: Paint }, void 0, false, {
27
- fileName: "/home/runner/work/strapi/strapi/packages/plugins/color-picker/admin/src/components/ColorPickerIcon.tsx",
28
- lineNumber: 19,
29
- columnNumber: 7
30
- }, globalThis) }, void 0, false, {
31
- fileName: "/home/runner/work/strapi/strapi/packages/plugins/color-picker/admin/src/components/ColorPickerIcon.tsx",
32
- lineNumber: 18,
33
- columnNumber: 5
34
- }, globalThis);
26
+ return /* @__PURE__ */ jsx(IconBox, { justifyContent: "center", alignItems: "center", width: 7, height: 6, hasRadius: true, "aria-hidden": true, children: /* @__PURE__ */ jsx(Icon, { as: Paint }) });
35
27
  };
36
28
  const pluginId = "color-picker";
37
29
  const getTrad = (id) => `${pluginId}.${id}`;
@@ -55,10 +47,9 @@ const index = {
55
47
  defaultMessage: "Select any color"
56
48
  },
57
49
  components: {
58
- Input: async () => import(
59
- /* webpackChunkName: "color-picker-input-component" */
60
- "./ColorPickerInput-b9dc2ba1.mjs"
61
- ).then((module) => ({ default: module.ColorPickerInput }))
50
+ Input: async () => import("./ColorPickerInput-fKB6YXW8.mjs").then((module) => ({
51
+ default: module.ColorPickerInput
52
+ }))
62
53
  },
63
54
  options: {
64
55
  advanced: [
@@ -102,7 +93,7 @@ const index = {
102
93
  async registerTrads({ locales }) {
103
94
  const importedTrads = await Promise.all(
104
95
  locales.map((locale) => {
105
- return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/cs.json": () => import("./cs-32e5b75a.mjs"), "./translations/en.json": () => import("./en-2230584b.mjs"), "./translations/ru.json": () => import("./ru-0bf57448.mjs"), "./translations/sv.json": () => import("./sv-de6a785a.mjs"), "./translations/tr.json": () => import("./tr-4d632eac.mjs"), "./translations/zh.json": () => import("./zh-5ba3e025.mjs") }), `./translations/${locale}.json`).then(({ default: data }) => {
96
+ return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/cs.json": () => import("./cs-A2xRj-2-.mjs"), "./translations/en.json": () => import("./en-L6ZZWDJv.mjs"), "./translations/ru.json": () => import("./ru-LLXYEOwl.mjs"), "./translations/sv.json": () => import("./sv-QqRPNQLw.mjs"), "./translations/tr.json": () => import("./tr-qYGSw8gH.mjs"), "./translations/zh.json": () => import("./zh-fPTOIT6s.mjs") }), `./translations/${locale}.json`).then(({ default: data }) => {
106
97
  return {
107
98
  data: prefixPluginTranslations(data, pluginId),
108
99
  locale
@@ -122,4 +113,4 @@ export {
122
113
  getTrad as g,
123
114
  index as i
124
115
  };
125
- //# sourceMappingURL=index-b4858a3b.mjs.map
116
+ //# sourceMappingURL=index-uOrtnJpz.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-uOrtnJpz.mjs","sources":["../../admin/src/components/ColorPickerIcon.tsx","../../admin/src/pluginId.ts","../../admin/src/utils/getTrad.ts","../../admin/src/index.ts"],"sourcesContent":["import { Flex, Icon } from '@strapi/design-system';\nimport { Paint } 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 <Icon as={Paint} />\n </IconBox>\n );\n};\n","export const pluginId = 'color-picker';\n","import { pluginId } from '../pluginId';\n\nexport const getTrad = (id: string) => `${pluginId}.${id}`;\n","import { prefixPluginTranslations } from '@strapi/helper-plugin';\n\nimport { ColorPickerIcon } from './components/ColorPickerIcon';\nimport { pluginId } from './pluginId';\nimport { getTrad } from './utils/getTrad';\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":[],"mappings":";;;;;;;;;;;;;;AAIA,MAAM,UAAU,OAAO,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWpB,MAAM,kBAAkB,MAAM;AACnC,6BACG,SAAQ,EAAA,gBAAe,UAAS,YAAW,UAAS,OAAO,GAAG,QAAQ,GAAG,WAAS,MAAC,eAAW,MAC7F,8BAAC,MAAK,EAAA,IAAI,OAAO,EACnB,CAAA;AAEJ;ACrBO,MAAM,WAAW;ACEjB,MAAM,UAAU,CAAC,OAAe,GAAG,QAAQ,IAAI,EAAE;ACKxD,MAAe,QAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKb,SAAS,KAAU;AACjB,QAAI,aAAa,SAAS;AAAA,MACxB,MAAM;AAAA,MACN,UAAU;AAAA,MACV,MAAM;AAAA,MACN,MAAM;AAAA,MACN,WAAW;AAAA,QACT,IAAI,QAAQ,oBAAoB;AAAA,QAChC,gBAAgB;AAAA,MAClB;AAAA,MACA,iBAAiB;AAAA,QACf,IAAI,QAAQ,0BAA0B;AAAA,QACtC,gBAAgB;AAAA,MAClB;AAAA,MACA,YAAY;AAAA,QACV,OAAO,YACL,OAAO,iCAA+B,EAAE,KAAK,CAAC,YAAY;AAAA,UACxD,SAAS,OAAO;AAAA,QAAA,EAChB;AAAA,MACN;AAAA,MACA,SAAS;AAAA,QACP,UAAU;AAAA,UACR;AAAA,YACE,WAAW;AAAA,cACT,IAAI,QAAQ,qCAAqC;AAAA,cACjD,gBAAgB;AAAA,YAClB;AAAA,YACA,MAAM;AAAA,YACN,MAAM;AAAA,YACN,cAAc;AAAA,YACd,aAAa;AAAA,cACX,IAAI,QAAQ,iDAAiD;AAAA,cAC7D,gBAAgB;AAAA,YAClB;AAAA,UACF;AAAA,UACA;AAAA,YACE,cAAc;AAAA,cACZ,IAAI;AAAA,cACJ,gBAAgB;AAAA,YAClB;AAAA,YACA,OAAO;AAAA,cACL;AAAA,gBACE,MAAM;AAAA,gBACN,MAAM;AAAA,gBACN,WAAW;AAAA,kBACT,IAAI,QAAQ,6CAA6C;AAAA,kBACzD,gBAAgB;AAAA,gBAClB;AAAA,gBACA,aAAa;AAAA,kBACX,IAAI,QAAQ,yDAAyD;AAAA,kBACrE,gBAAgB;AAAA,gBAClB;AAAA,cACF;AAAA,YACF;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IAAA,CACD;AAAA,EACH;AAAA,EACA,MAAM,cAAc,EAAE,WAAkC;AAChD,UAAA,gBAAgB,MAAM,QAAQ;AAAA,MAClC,QAAQ,IAAI,CAAC,WAAW;AACf,eAAA,qCAA+B,uBAAA,OAAA,EAAA,0BAAA,MAAA,OAAA,mBAAA,GAAA,0BAAA,MAAA,OAAA,mBAAA,GAAA,0BAAA,MAAA,OAAA,mBAAA,GAAA,0BAAA,MAAA,OAAA,mBAAA,GAAA,0BAAA,MAAA,OAAA,mBAAA,GAAA,0BAAA,MAAA,OAAA,mBAAA,EAAA,CAAA,GAAA,kBAAA,MAAA,OAAA,EACnC,KAAK,CAAC,EAAE,SAAS,WAAW;AACpB,iBAAA;AAAA,YACL,MAAM,yBAAyB,MAAM,QAAQ;AAAA,YAC7C;AAAA,UAAA;AAAA,QACF,CACD,EACA,MAAM,MAAM;AACJ,iBAAA;AAAA,YACL,MAAM,CAAC;AAAA,YACP;AAAA,UAAA;AAAA,QACF,CACD;AAAA,MAAA,CACJ;AAAA,IAAA;AAGI,WAAA,QAAQ,QAAQ,aAAa;AAAA,EACtC;AACF;"}
@@ -16,4 +16,4 @@ const ru = {
16
16
  export {
17
17
  ru as default
18
18
  };
19
- //# sourceMappingURL=ru-0bf57448.mjs.map
19
+ //# sourceMappingURL=ru-LLXYEOwl.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ru-LLXYEOwl.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
@@ -16,4 +16,4 @@ const ru = {
16
16
  "plugin.name": "Выбор цвета"
17
17
  };
18
18
  exports.default = ru;
19
- //# sourceMappingURL=ru-1d1cf8a8.js.map
19
+ //# sourceMappingURL=ru-UXN_ByI9.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ru-UXN_ByI9.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}
@@ -13,4 +13,4 @@ const sv = {
13
13
  "color-picker.toggle.aria-label": "Växla färgväljare"
14
14
  };
15
15
  exports.default = sv;
16
- //# sourceMappingURL=sv-6e7fa200.js.map
16
+ //# sourceMappingURL=sv-3-Yk9bKb.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sv-3-Yk9bKb.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
@@ -13,4 +13,4 @@ const sv = {
13
13
  export {
14
14
  sv as default
15
15
  };
16
- //# sourceMappingURL=sv-de6a785a.mjs.map
16
+ //# sourceMappingURL=sv-QqRPNQLw.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sv-QqRPNQLw.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
@@ -13,4 +13,4 @@ const tr = {
13
13
  "color-picker.toggle.aria-label": "Renk seçici anahtarı"
14
14
  };
15
15
  exports.default = tr;
16
- //# sourceMappingURL=tr-67b6e192.js.map
16
+ //# sourceMappingURL=tr-AbD-f8F0.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tr-AbD-f8F0.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
@@ -13,4 +13,4 @@ const tr = {
13
13
  export {
14
14
  tr as default
15
15
  };
16
- //# sourceMappingURL=tr-4d632eac.mjs.map
16
+ //# sourceMappingURL=tr-qYGSw8gH.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tr-qYGSw8gH.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
@@ -13,4 +13,4 @@ const zh = {
13
13
  "color-picker.toggle.aria-label": "選色器開關"
14
14
  };
15
15
  exports.default = zh;
16
- //# sourceMappingURL=zh-e5010f8b.js.map
16
+ //# sourceMappingURL=zh-c23gv_oM.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zh-c23gv_oM.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
@@ -13,4 +13,4 @@ const zh = {
13
13
  export {
14
14
  zh as default
15
15
  };
16
- //# sourceMappingURL=zh-5ba3e025.mjs.map
16
+ //# sourceMappingURL=zh-fPTOIT6s.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zh-fPTOIT6s.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
- const index = require("../_chunks/index-83ab6784.js");
2
+ const index = require("../_chunks/index-OJYEuoCq.js");
3
3
  require("@strapi/helper-plugin");
4
- require("react/jsx-dev-runtime");
4
+ require("react/jsx-runtime");
5
5
  require("@strapi/design-system");
6
6
  require("@strapi/icons");
7
7
  require("styled-components");
@@ -1,6 +1,6 @@
1
- import { i } from "../_chunks/index-b4858a3b.mjs";
1
+ import { i } from "../_chunks/index-uOrtnJpz.mjs";
2
2
  import "@strapi/helper-plugin";
3
- import "react/jsx-dev-runtime";
3
+ import "react/jsx-runtime";
4
4
  import "@strapi/design-system";
5
5
  import "@strapi/icons";
6
6
  import "styled-components";
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../server/src/index.ts"],"names":[],"mappings":";;;AAEA,wBAEE"}
@@ -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": "0.0.0-next.c7c44a121f7abc0c52826a7d310fe4534b8727f0",
3
+ "version": "0.0.0-next.c80d4d9b205f7844215758ba333894819685e6c1",
4
4
  "description": "Strapi maintained Custom Fields",
5
5
  "repository": {
6
6
  "type": "git",
@@ -22,14 +22,14 @@
22
22
  ],
23
23
  "exports": {
24
24
  "./strapi-admin": {
25
- "types": "./dist/admin/index.d.ts",
25
+ "types": "./dist/admin/src/index.d.ts",
26
26
  "source": "./admin/src/index.ts",
27
27
  "import": "./dist/admin/index.mjs",
28
28
  "require": "./dist/admin/index.js",
29
29
  "default": "./dist/admin/index.js"
30
30
  },
31
31
  "./strapi-server": {
32
- "types": "./dist/server/index.d.ts",
32
+ "types": "./dist/server/src/index.d.ts",
33
33
  "source": "./server/src/index.ts",
34
34
  "import": "./dist/server/index.mjs",
35
35
  "require": "./dist/server/index.js",
@@ -44,11 +44,7 @@
44
44
  "scripts": {
45
45
  "build": "strapi plugin:build --force",
46
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",
51
- "prepublishOnly": "yarn clean && yarn build",
47
+ "lint": "run -T eslint .",
52
48
  "test:front": "run -T cross-env IS_EE=true jest --config ./jest.config.front.js",
53
49
  "test:front:ce": "run -T cross-env IS_EE=false jest --config ./jest.config.front.js",
54
50
  "test:front:watch": "run -T cross-env IS_EE=true jest --config ./jest.config.front.js --watchAll",
@@ -57,18 +53,18 @@
57
53
  "watch": "strapi plugin:watch"
58
54
  },
59
55
  "dependencies": {
60
- "@strapi/design-system": "1.13.0",
61
- "@strapi/helper-plugin": "0.0.0-next.c7c44a121f7abc0c52826a7d310fe4534b8727f0",
62
- "@strapi/icons": "1.13.0",
56
+ "@strapi/design-system": "1.18.0",
57
+ "@strapi/helper-plugin": "0.0.0-next.c80d4d9b205f7844215758ba333894819685e6c1",
58
+ "@strapi/icons": "1.18.0",
63
59
  "prop-types": "^15.8.1",
64
60
  "react-colorful": "5.6.1",
65
61
  "react-intl": "6.4.1"
66
62
  },
67
63
  "devDependencies": {
68
- "@strapi/strapi": "0.0.0-next.c7c44a121f7abc0c52826a7d310fe4534b8727f0",
64
+ "@strapi/strapi": "0.0.0-next.c80d4d9b205f7844215758ba333894819685e6c1",
69
65
  "@testing-library/react": "14.0.0",
70
66
  "@testing-library/user-event": "14.4.3",
71
- "@types/styled-components": "5.1.26",
67
+ "@types/styled-components": "5.1.32",
72
68
  "react": "^18.2.0",
73
69
  "react-dom": "^18.2.0",
74
70
  "react-router-dom": "5.3.4",
@@ -79,8 +75,8 @@
79
75
  "@strapi/strapi": "^4.4.0",
80
76
  "react": "^17.0.0 || ^18.0.0",
81
77
  "react-dom": "^17.0.0 || ^18.0.0",
82
- "react-router-dom": "5.3.4",
83
- "styled-components": "5.3.3"
78
+ "react-router-dom": "^5.2.0",
79
+ "styled-components": "^5.2.1"
84
80
  },
85
81
  "engines": {
86
82
  "node": ">=18.0.0 <=20.x.x",
@@ -92,5 +88,5 @@
92
88
  "kind": "plugin",
93
89
  "displayName": "Color Picker"
94
90
  },
95
- "gitHead": "c7c44a121f7abc0c52826a7d310fe4534b8727f0"
91
+ "gitHead": "c80d4d9b205f7844215758ba333894819685e6c1"
96
92
  }
@@ -1,298 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const jsxDevRuntime = require("react/jsx-dev-runtime");
4
- const React = require("react");
5
- const designSystem = require("@strapi/design-system");
6
- const icons = require("@strapi/icons");
7
- const reactColorful = require("react-colorful");
8
- const reactIntl = require("react-intl");
9
- const styled = require("styled-components");
10
- const index = require("./index-83ab6784.js");
11
- require("@strapi/helper-plugin");
12
- const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
13
- function _interopNamespace(e) {
14
- if (e && e.__esModule)
15
- return e;
16
- const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
17
- if (e) {
18
- for (const k in e) {
19
- if (k !== "default") {
20
- const d = Object.getOwnPropertyDescriptor(e, k);
21
- Object.defineProperty(n, k, d.get ? d : {
22
- enumerable: true,
23
- get: () => e[k]
24
- });
25
- }
26
- }
27
- }
28
- n.default = e;
29
- return Object.freeze(n);
30
- }
31
- const React__namespace = /* @__PURE__ */ _interopNamespace(React);
32
- const styled__default = /* @__PURE__ */ _interopDefault(styled);
33
- function setRef(ref, value) {
34
- if (typeof ref === "function") {
35
- ref(value);
36
- } else if (ref !== null && ref !== void 0) {
37
- ref.current = value;
38
- }
39
- }
40
- function composeRefs(...refs) {
41
- return (node) => refs.forEach((ref) => setRef(ref, node));
42
- }
43
- function useComposedRefs(...refs) {
44
- return React__namespace.useCallback(composeRefs(...refs), refs);
45
- }
46
- const ColorPreview = styled__default.default.div`
47
- border-radius: 50%;
48
- width: 20px;
49
- height: 20px;
50
- margin-right: 10px;
51
- background-color: ${(props) => props.color};
52
- border: 1px solid rgba(0, 0, 0, 0.1);
53
- `;
54
- const ColorPicker = styled__default.default(reactColorful.HexColorPicker)`
55
- && {
56
- width: 100%;
57
- aspect-ratio: 1.5;
58
- }
59
-
60
- .react-colorful__pointer {
61
- width: ${({ theme }) => theme.spaces[3]};
62
- height: ${({ theme }) => theme.spaces[3]};
63
- }
64
-
65
- .react-colorful__saturation {
66
- border-radius: ${({ theme }) => theme.spaces[1]};
67
- border-bottom: none;
68
- }
69
-
70
- .react-colorful__hue {
71
- border-radius: 10px;
72
- height: ${({ theme }) => theme.spaces[3]};
73
- margin-top: ${({ theme }) => theme.spaces[2]};
74
- }
75
- `;
76
- const ColorPickerToggle = styled__default.default(designSystem.BaseButton)`
77
- display: flex;
78
- justify-content: space-between;
79
- align-items: center;
80
-
81
- svg {
82
- width: ${({ theme }) => theme.spaces[2]};
83
- height: ${({ theme }) => theme.spaces[2]};
84
- }
85
-
86
- svg > path {
87
- fill: ${({ theme }) => theme.colors.neutral500};
88
- justify-self: flex-end;
89
- }
90
- `;
91
- const ColorPickerPopover = styled__default.default(designSystem.Popover)`
92
- padding: ${({ theme }) => theme.spaces[2]};
93
- min-height: 270px;
94
- `;
95
- const ColorPickerInput = React__namespace.forwardRef(
96
- ({
97
- attribute,
98
- description,
99
- disabled = false,
100
- error,
101
- intlLabel,
102
- labelAction,
103
- name,
104
- onChange,
105
- required = false,
106
- value = ""
107
- }, forwardedRef) => {
108
- const [showColorPicker, setShowColorPicker] = React__namespace.useState(false);
109
- const colorPickerButtonRef = React__namespace.useRef(null);
110
- const { formatMessage } = reactIntl.useIntl();
111
- const color = value || "#000000";
112
- const handleBlur = (e) => {
113
- e.preventDefault();
114
- if (!e.currentTarget.contains(e.relatedTarget)) {
115
- setShowColorPicker(false);
116
- }
117
- };
118
- const composedRefs = useComposedRefs(forwardedRef, colorPickerButtonRef);
119
- return /* @__PURE__ */ jsxDevRuntime.jsxDEV(
120
- designSystem.Field,
121
- {
122
- name,
123
- id: name,
124
- error,
125
- hint: description && formatMessage(description),
126
- required,
127
- children: /* @__PURE__ */ jsxDevRuntime.jsxDEV(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 1, children: [
128
- /* @__PURE__ */ jsxDevRuntime.jsxDEV(designSystem.FieldLabel, { action: labelAction, children: formatMessage(intlLabel) }, void 0, false, {
129
- fileName: "/home/runner/work/strapi/strapi/packages/plugins/color-picker/admin/src/components/ColorPickerInput.tsx",
130
- lineNumber: 138,
131
- columnNumber: 11
132
- }, globalThis),
133
- /* @__PURE__ */ jsxDevRuntime.jsxDEV(
134
- ColorPickerToggle,
135
- {
136
- ref: composedRefs,
137
- "aria-label": formatMessage({
138
- id: index.getTrad("color-picker.toggle.aria-label"),
139
- defaultMessage: "Color picker toggle"
140
- }),
141
- "aria-controls": "color-picker-value",
142
- "aria-haspopup": "dialog",
143
- "aria-expanded": showColorPicker,
144
- "aria-disabled": disabled,
145
- disabled,
146
- onClick: () => setShowColorPicker(!showColorPicker),
147
- children: [
148
- /* @__PURE__ */ jsxDevRuntime.jsxDEV(designSystem.Flex, { children: [
149
- /* @__PURE__ */ jsxDevRuntime.jsxDEV(ColorPreview, { color }, void 0, false, {
150
- fileName: "/home/runner/work/strapi/strapi/packages/plugins/color-picker/admin/src/components/ColorPickerInput.tsx",
151
- lineNumber: 153,
152
- columnNumber: 15
153
- }, globalThis),
154
- /* @__PURE__ */ jsxDevRuntime.jsxDEV(
155
- designSystem.Typography,
156
- {
157
- style: { textTransform: "uppercase" },
158
- textColor: value ? void 0 : "neutral600",
159
- variant: "omega",
160
- children: color
161
- },
162
- void 0,
163
- false,
164
- {
165
- fileName: "/home/runner/work/strapi/strapi/packages/plugins/color-picker/admin/src/components/ColorPickerInput.tsx",
166
- lineNumber: 154,
167
- columnNumber: 15
168
- },
169
- globalThis
170
- )
171
- ] }, void 0, true, {
172
- fileName: "/home/runner/work/strapi/strapi/packages/plugins/color-picker/admin/src/components/ColorPickerInput.tsx",
173
- lineNumber: 152,
174
- columnNumber: 13
175
- }, globalThis),
176
- /* @__PURE__ */ jsxDevRuntime.jsxDEV(icons.CarretDown, { "aria-hidden": true }, void 0, false, {
177
- fileName: "/home/runner/work/strapi/strapi/packages/plugins/color-picker/admin/src/components/ColorPickerInput.tsx",
178
- lineNumber: 162,
179
- columnNumber: 13
180
- }, globalThis)
181
- ]
182
- },
183
- void 0,
184
- true,
185
- {
186
- fileName: "/home/runner/work/strapi/strapi/packages/plugins/color-picker/admin/src/components/ColorPickerInput.tsx",
187
- lineNumber: 139,
188
- columnNumber: 11
189
- },
190
- globalThis
191
- ),
192
- showColorPicker && /* @__PURE__ */ jsxDevRuntime.jsxDEV(
193
- ColorPickerPopover,
194
- {
195
- onBlur: handleBlur,
196
- role: "dialog",
197
- source: colorPickerButtonRef,
198
- spacing: 4,
199
- children: /* @__PURE__ */ jsxDevRuntime.jsxDEV(designSystem.FocusTrap, { onEscape: () => setShowColorPicker(false), children: [
200
- /* @__PURE__ */ jsxDevRuntime.jsxDEV(
201
- ColorPicker,
202
- {
203
- color,
204
- onChange: (hexValue) => onChange({ target: { name, value: hexValue, type: attribute.type } })
205
- },
206
- void 0,
207
- false,
208
- {
209
- fileName: "/home/runner/work/strapi/strapi/packages/plugins/color-picker/admin/src/components/ColorPickerInput.tsx",
210
- lineNumber: 172,
211
- columnNumber: 17
212
- },
213
- globalThis
214
- ),
215
- /* @__PURE__ */ jsxDevRuntime.jsxDEV(designSystem.Flex, { paddingTop: 3, paddingLeft: 4, justifyContent: "flex-end", children: [
216
- /* @__PURE__ */ jsxDevRuntime.jsxDEV(designSystem.Box, { paddingRight: 2, children: /* @__PURE__ */ jsxDevRuntime.jsxDEV(designSystem.Typography, { variant: "omega", as: "label", textColor: "neutral600", children: formatMessage({
217
- id: index.getTrad("color-picker.input.format"),
218
- defaultMessage: "HEX"
219
- }) }, void 0, false, {
220
- fileName: "/home/runner/work/strapi/strapi/packages/plugins/color-picker/admin/src/components/ColorPickerInput.tsx",
221
- lineNumber: 180,
222
- columnNumber: 21
223
- }, globalThis) }, void 0, false, {
224
- fileName: "/home/runner/work/strapi/strapi/packages/plugins/color-picker/admin/src/components/ColorPickerInput.tsx",
225
- lineNumber: 179,
226
- columnNumber: 19
227
- }, globalThis),
228
- /* @__PURE__ */ jsxDevRuntime.jsxDEV(
229
- designSystem.FieldInput,
230
- {
231
- id: "color-picker-value",
232
- "aria-label": formatMessage({
233
- id: index.getTrad("color-picker.input.aria-label"),
234
- defaultMessage: "Color picker input"
235
- }),
236
- style: { textTransform: "uppercase" },
237
- value,
238
- placeholder: "#000000",
239
- onChange
240
- },
241
- void 0,
242
- false,
243
- {
244
- fileName: "/home/runner/work/strapi/strapi/packages/plugins/color-picker/admin/src/components/ColorPickerInput.tsx",
245
- lineNumber: 187,
246
- columnNumber: 19
247
- },
248
- globalThis
249
- )
250
- ] }, void 0, true, {
251
- fileName: "/home/runner/work/strapi/strapi/packages/plugins/color-picker/admin/src/components/ColorPickerInput.tsx",
252
- lineNumber: 178,
253
- columnNumber: 17
254
- }, globalThis)
255
- ] }, void 0, true, {
256
- fileName: "/home/runner/work/strapi/strapi/packages/plugins/color-picker/admin/src/components/ColorPickerInput.tsx",
257
- lineNumber: 171,
258
- columnNumber: 15
259
- }, globalThis)
260
- },
261
- void 0,
262
- false,
263
- {
264
- fileName: "/home/runner/work/strapi/strapi/packages/plugins/color-picker/admin/src/components/ColorPickerInput.tsx",
265
- lineNumber: 165,
266
- columnNumber: 13
267
- },
268
- globalThis
269
- ),
270
- /* @__PURE__ */ jsxDevRuntime.jsxDEV(designSystem.FieldHint, {}, void 0, false, {
271
- fileName: "/home/runner/work/strapi/strapi/packages/plugins/color-picker/admin/src/components/ColorPickerInput.tsx",
272
- lineNumber: 202,
273
- columnNumber: 11
274
- }, globalThis),
275
- /* @__PURE__ */ jsxDevRuntime.jsxDEV(designSystem.FieldError, {}, void 0, false, {
276
- fileName: "/home/runner/work/strapi/strapi/packages/plugins/color-picker/admin/src/components/ColorPickerInput.tsx",
277
- lineNumber: 203,
278
- columnNumber: 11
279
- }, globalThis)
280
- ] }, void 0, true, {
281
- fileName: "/home/runner/work/strapi/strapi/packages/plugins/color-picker/admin/src/components/ColorPickerInput.tsx",
282
- lineNumber: 137,
283
- columnNumber: 9
284
- }, globalThis)
285
- },
286
- void 0,
287
- false,
288
- {
289
- fileName: "/home/runner/work/strapi/strapi/packages/plugins/color-picker/admin/src/components/ColorPickerInput.tsx",
290
- lineNumber: 129,
291
- columnNumber: 7
292
- },
293
- globalThis
294
- );
295
- }
296
- );
297
- exports.ColorPickerInput = ColorPickerInput;
298
- //# sourceMappingURL=ColorPickerInput-8c35610d.js.map