@strapi/plugin-color-picker 5.37.1 → 5.38.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/dist/admin/components/ColorPickerIcon.js.map +1 -1
- package/dist/admin/components/ColorPickerIcon.mjs.map +1 -1
- package/dist/admin/components/ColorPickerInput.js.map +1 -1
- package/dist/admin/components/ColorPickerInput.mjs +1 -1
- package/dist/admin/components/ColorPickerInput.mjs.map +1 -1
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/index.mjs.map +1 -1
- package/dist/admin/utils/getTrad.js.map +1 -1
- package/dist/admin/utils/getTrad.mjs.map +1 -1
- package/dist/admin/utils/prefixPluginTranslations.js.map +1 -1
- package/dist/admin/utils/prefixPluginTranslations.mjs.map +1 -1
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/register.js.map +1 -1
- package/dist/server/register.mjs.map +1 -1
- package/package.json +4 -4
|
@@ -1 +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,
|
|
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,uBAAAA,CAAOC,iBAAAA,CAAK;;;;;;;;;AAS5B,CAAC;MAEYC,eAAAA,GAAkB,IAAA;AAC7B,IAAA,qBACEC,cAAA,CAACJ,OAAAA,EAAAA;QAAQK,cAAAA,EAAe,QAAA;QAASC,UAAAA,EAAW,QAAA;QAASC,KAAAA,EAAO,CAAA;QAAGC,MAAAA,EAAQ,CAAA;QAAGC,SAAS,EAAA,IAAA;QAACC,aAAW,EAAA,IAAA;AAC7F,QAAA,QAAA,gBAAAN,cAAA,CAACO,gBAAAA,EAAAA,EAAAA;;AAGP;;;;"}
|
|
@@ -1 +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,
|
|
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,MAAAA,CAAOC,IAAAA,CAAK;;;;;;;;;AAS5B,CAAC;MAEYC,eAAAA,GAAkB,IAAA;AAC7B,IAAA,qBACEC,GAAA,CAACJ,OAAAA,EAAAA;QAAQK,cAAAA,EAAe,QAAA;QAASC,UAAAA,EAAW,QAAA;QAASC,KAAAA,EAAO,CAAA;QAAGC,MAAAA,EAAQ,CAAA;QAAGC,SAAS,EAAA,IAAA;QAACC,aAAW,EAAA,IAAA;AAC7F,QAAA,QAAA,gBAAAN,GAAA,CAACO,UAAAA,EAAAA,EAAAA;;AAGP;;;;"}
|
|
@@ -1 +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\n /**\n * The color that will show in the field. We can't presume to show black or something\n * if no value is currently set (as `null` really corresponds to no color, not\n * black), so default to empty string if nothing else is available. */\n const color = field.value ?? props.placeholder ?? '';\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 : 'neutral500'}\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 // No default value. If nothing is selected, the input will be empty.\n defaultValue={field.value ?? ''}\n // Here we default to #000000 as the placeholder, because, absent a\n // user defined placeholder, we want to indicate the desired format.\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","placeholder","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","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,CAAA,CAAE,CAAC;;AAEjD,CAAC;AAED,MAAMC,iBAAAA,GAAoB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AA,GAAGpE;;;;;;;;;AAMd,8BAAAoC,cAAA,CAACC,mBAAMyC,IAAI,EAAA,EAAA,CAAA;AACX,8BAAA1C,cAAA,CAACC,mBAAM0C,KAAK,EAAA,EAAA;;;;AAIpB,CACA;;;;"}
|
|
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\n /**\n * The color that will show in the field. We can't presume to show black or something\n * if no value is currently set (as `null` really corresponds to no color, not\n * black), so default to empty string if nothing else is available. */\n const color = field.value ?? props.placeholder ?? '';\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 : 'neutral500'}\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 // No default value. If nothing is selected, the input will be empty.\n defaultValue={field.value ?? ''}\n // Here we default to #000000 as the placeholder, because, absent a\n // user defined placeholder, we want to indicate the desired format.\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","placeholder","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","Hint","Error"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,MAAMA,YAAAA,GAAeC,uBAAAA,CAAOC,GAAG;;;;;AAKX,oBAAA,EAAE,CAACC,KAAAA,GAAUA,KAAAA,CAAMC,KAAK,CAAC;;AAE7C,CAAC;AAED,MAAMC,WAAAA,GAAcJ,uBAAAA,CAAOK,4BAAAA,CAAe;;;;;;;WAO/B,EAAE,CAAC,EAAEC,KAAK,EAAE,GAAKA,KAAAA,CAAMC,MAAM,CAAC,CAAA,CAAE,CAAC;YAChC,EAAE,CAAC,EAAED,KAAK,EAAE,GAAKA,KAAAA,CAAMC,MAAM,CAAC,CAAA,CAAE,CAAC;;;;mBAI1B,EA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ACxBW,oDAAAA,EAAAA,EAAIa,eAAAA,CAAQ,+BAAA,CAAA;oDACZC,cAAAA,EAAgB;AAClB,iDAAA,CAAA;gDACAQ,KAAAA,EAAO;oDAAEC,aAAAA,EAAe;AAAY,iDAAA;gDACpC1C,IAAAA,EAAMA,IAAAA;;gDAENyD,YAAAA,EAAc/C,KAAAA,CAAME,KAAK,IAAI,EAAA;;;gDAG7BC,WAAAA,EAAY,SAAA;AACZmC,gDAAAA,QAAAA,EAAUtC,MAAMsC,QAAQ;AACvB,gDAAA,GAAGpE;;;;;;;;;AAMd,8BAAAoC,cAAA,CAACC,mBAAMyC,IAAI,EAAA,EAAA,CAAA;AACX,8BAAA1C,cAAA,CAACC,mBAAM0C,KAAK,EAAA,EAAA;;;;AAIpB,CAAA;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { useComposedRefs, Field, Flex, Popover, Typography, Box, Button } from '@strapi/design-system';
|
|
4
4
|
import { CaretDown } from '@strapi/icons';
|
|
5
5
|
import { useField } from '@strapi/strapi/admin';
|
|
6
6
|
import { HexColorPicker } from 'react-colorful';
|
|
@@ -1 +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\n /**\n * The color that will show in the field. We can't presume to show black or something\n * if no value is currently set (as `null` really corresponds to no color, not\n * black), so default to empty string if nothing else is available. */\n const color = field.value ?? props.placeholder ?? '';\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 : 'neutral500'}\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 // No default value. If nothing is selected, the input will be empty.\n defaultValue={field.value ?? ''}\n // Here we default to #000000 as the placeholder, because, absent a\n // user defined placeholder, we want to indicate the desired format.\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","placeholder","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","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,CAAC,CAAA,CAAE,CAAC;;;;UAInC,EAAE,CAAC,EAAED,KAAK,EAAE,GAAKA,KAAMI,CAAAA,MAAM,CAACC,UAAU,CAAC;;;AAGnD,CAAC;AA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,IAACC,CAAAA,IAAAA,EAAAA;oCAAK4B,UAAY,EAAA,CAAA;oCAAGC,WAAa,EAAA,CAAA;oCAAGC,cAAe,EAAA,UAAA;;sDAClDpC,GAACqC,CAAAA,GAAAA,EAAAA;4CAAIC,YAAc,EAAA,CAAA;AACjB,4CAAA,QAAA,gBAAAtC,GAACwB,CAAAA,UAAAA,EAAAA;gDAAWF,OAAQ,EAAA,OAAA;gDAAQiB,GAAI,EAAA,OAAA;gDAAQZ,SAAU,EAAA,YAAA;0DAC/CnC,aAAc,CAAA;AACbW,oDAAAA,EAAAA,EAAIa,OAAQ,CAAA,2BAAA,CAAA;oDACZC,cAAgB,EAAA;AAClB,iDAAA;;;AAGJ,sDAAAjB,GAAA,CAACC,MAAMC,IAAI,EAAA;oEACTF,GAAA,CAACC,MAAMuC,KAAK,EAAA;AACVzB,gDAAAA,YAAAA,EAAYvB,aAAc,CAAA;AACxBW,oDAAAA,EAAAA,EAAIa,OAAQ,CAAA,+BAAA,CAAA;oDACZC,cAAgB,EAAA;AAClB,iDAAA,CAAA;gDACAQ,KAAO,EAAA;oDAAEC,aAAe,EAAA;AAAY,iDAAA;gDACpC1C,IAAMA,EAAAA,IAAAA;;gDAENyD,YAAc/C,EAAAA,KAAAA,CAAME,KAAK,IAAI,EAAA;;;gDAG7BC,WAAY,EAAA,SAAA;AACZmC,gDAAAA,QAAAA,EAAUtC,MAAMsC,QAAQ;AACvB,gDAAA,GAAGpE;;;;;;;;;AAMd,8BAAAoC,GAAA,CAACC,MAAMyC,IAAI,EAAA,EAAA,CAAA;AACX,8BAAA1C,GAAA,CAACC,MAAM0C,KAAK,EAAA,EAAA;;;;AAIpB,CACA;;;;"}
|
|
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\n /**\n * The color that will show in the field. We can't presume to show black or something\n * if no value is currently set (as `null` really corresponds to no color, not\n * black), so default to empty string if nothing else is available. */\n const color = field.value ?? props.placeholder ?? '';\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 : 'neutral500'}\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 // No default value. If nothing is selected, the input will be empty.\n defaultValue={field.value ?? ''}\n // Here we default to #000000 as the placeholder, because, absent a\n // user defined placeholder, we want to indicate the desired format.\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","placeholder","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","Hint","Error"],"mappings":";;;;;;;;;;AAmBA,MAAMA,YAAAA,GAAeC,MAAAA,CAAOC,GAAG;;;;;AAKX,oBAAA,EAAE,CAACC,KAAAA,GAAUA,KAAAA,CAAMC,KAAK,CAAC;;AAE7C,CAAC;AAED,MAAMC,WAAAA,GAAcJ,MAAAA,CAAOK,cAAAA,CAAe;;;;;;;WAO/B,EAAE,CAAC,EAAEC,KAAK,EAAE,GAAKA,KAAAA,CAAMC,MAAM,CAAC,CAAA,CAAE,CAAC;YAChC,EAAE,CAAC,EAAED,KAAK,EAAE,GAAKA,KAAAA,CAAMC,MAAM,CAAC,CAAA,CAAE,CAAC;;;;mBAI1B,EAAE,CAAC,EAAED,KAAK,EAAE,GAAKA,KAAAA,CAAMC,MAAM,CAAC,CAAA,CAAE,CAAC;;;;;;YAMxC,EAAE,CAAC,EAAED,KAAK,EAAE,GAAKA,KAAAA,CAAMC,MAAM,CAAC,CAAA,CAAE,CAAC;gBAC7B,EAAE,CAAC,EAAED,KAAK,EAAE,GAAKA,KAAAA,CAAMC,MAAM,CAAC,CAAA,CAAE,CAAC;;AAEjD,CAAC;AAED,MAAMC,iBAAAA,GAAoBR,MAAAA,CAAOS,MAAAA,CAAO;;;;;;;;;WAS7B,EAAE,CAAC,EAAEH,KA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,EAAA,CAAA;AACX,8BAAA1C,GAAA,CAACC,MAAM0C,KAAK,EAAA,EAAA;;;;AAIpB,CAAA;;;;"}
|
package/dist/admin/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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;QACfA,
|
|
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;QACfA,GAAAA,CAAIC,YAAY,CAACF,QAAQ,CAAC;YACxBG,IAAAA,EAAM,OAAA;YACNC,QAAAA,EAAU,cAAA;YACVC,IAAAA,EAAM,QAAA;YACNC,IAAAA,EAAMC,+BAAAA;YACNC,SAAAA,EAAW;AACTC,gBAAAA,EAAAA,EAAIC,eAAAA,CAAQ,oBAAA,CAAA;gBACZC,cAAAA,EAAgB;AAClB,aAAA;YACAC,eAAAA,EAAiB;AACfH,gBAAAA,EAAAA,EAAIC,eAAAA,CAAQ,0BAAA,CAAA;gBACZC,cAAAA,EAAgB;AAClB,aAAA;YACAE,UAAAA,EAAY;gBACVC,KAAAA,EAAO,UACL,oDAAO,kCAAA,KAAA,CAAiCC,IAAI,CAAC,CAACC,UAAY;A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MC,kDAAyBD,IAAAA,EAAM5B,iBAAAA,CAAAA;AACrC2B,oBAAAA;AACF,iBAAA;AACF,YAAA,CAAA,CAAA,CACCG,KAAK,CAAC,IAAA;gBACL,OAAO;AACLF,oBAAAA,IAAAA,EAAM,EAAC;AACPD,oBAAAA;AACF,iBAAA;AACF,YAAA,CAAA,CAAA;AACJ,QAAA,CAAA,CAAA,CAAA;QAGF,OAAOH,OAAAA,CAAQO,OAAO,CAACR,aAAAA,CAAAA;AACzB,IAAA;AACF,CAAA;;;;"}
|
package/dist/admin/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","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;QACfA,
|
|
1
|
+
{"version":3,"file":"index.mjs","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;QACfA,GAAAA,CAAIC,YAAY,CAACF,QAAQ,CAAC;YACxBG,IAAAA,EAAM,OAAA;YACNC,QAAAA,EAAU,cAAA;YACVC,IAAAA,EAAM,QAAA;YACNC,IAAAA,EAAMC,eAAAA;YACNC,SAAAA,EAAW;AACTC,gBAAAA,EAAAA,EAAIC,OAAAA,CAAQ,oBAAA,CAAA;gBACZC,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H,OAAAA,CAAQI,GAAG,CAAC,CAACC,MAAAA,GAAAA;AACX,YAAA,OAAO,iCAAM,CAAC,CAAC,eAAe,EAAEA,MAAAA,CAAO,KAAK,CAAC,CAAA,CAC1ChB,IAAI,CAAC,CAAC,EAAEE,OAAAA,EAASe,IAAI,EAAE,GAAA;gBACtB,OAAO;AACLA,oBAAAA,IAAAA,EAAMC,yBAAyBD,IAAAA,EAAM5B,QAAAA,CAAAA;AACrC2B,oBAAAA;AACF,iBAAA;AACF,YAAA,CAAA,CAAA,CACCG,KAAK,CAAC,IAAA;gBACL,OAAO;AACLF,oBAAAA,IAAAA,EAAM,EAAC;AACPD,oBAAAA;AACF,iBAAA;AACF,YAAA,CAAA,CAAA;AACJ,QAAA,CAAA,CAAA,CAAA;QAGF,OAAOH,OAAAA,CAAQO,OAAO,CAACR,aAAAA,CAAAA;AACzB,IAAA;AACF,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getTrad.js","sources":["../../../admin/src/utils/getTrad.ts"],"sourcesContent":["import { pluginId } from '../pluginId';\n\nexport const getTrad = (id: string) => `${pluginId}.${id}`;\n"],"names":["getTrad","id","pluginId"],"mappings":";;;;AAEO,MAAMA,UAAU,CAACC,EAAAA,GAAe,GAAGC,
|
|
1
|
+
{"version":3,"file":"getTrad.js","sources":["../../../admin/src/utils/getTrad.ts"],"sourcesContent":["import { pluginId } from '../pluginId';\n\nexport const getTrad = (id: string) => `${pluginId}.${id}`;\n"],"names":["getTrad","id","pluginId"],"mappings":";;;;AAEO,MAAMA,UAAU,CAACC,EAAAA,GAAe,GAAGC,iBAAAA,CAAS,CAAC,EAAED,EAAAA,CAAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getTrad.mjs","sources":["../../../admin/src/utils/getTrad.ts"],"sourcesContent":["import { pluginId } from '../pluginId';\n\nexport const getTrad = (id: string) => `${pluginId}.${id}`;\n"],"names":["getTrad","id","pluginId"],"mappings":";;AAEO,MAAMA,UAAU,CAACC,EAAAA,GAAe,GAAGC,
|
|
1
|
+
{"version":3,"file":"getTrad.mjs","sources":["../../../admin/src/utils/getTrad.ts"],"sourcesContent":["import { pluginId } from '../pluginId';\n\nexport const getTrad = (id: string) => `${pluginId}.${id}`;\n"],"names":["getTrad","id","pluginId"],"mappings":";;AAEO,MAAMA,UAAU,CAACC,EAAAA,GAAe,GAAGC,QAAAA,CAAS,CAAC,EAAED,EAAAA,CAAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prefixPluginTranslations.js","sources":["../../../admin/src/utils/prefixPluginTranslations.ts"],"sourcesContent":["type TradOptions = Record<string, string>;\n\nconst prefixPluginTranslations = (trad: TradOptions, pluginId: string): TradOptions => {\n if (!pluginId) {\n throw new TypeError(\"pluginId can't be empty\");\n }\n return Object.keys(trad).reduce((acc, current) => {\n acc[`${pluginId}.${current}`] = trad[current];\n return acc;\n }, {} as TradOptions);\n};\n\nexport { prefixPluginTranslations };\n"],"names":["prefixPluginTranslations","trad","pluginId","Object","keys","reduce","acc","current"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"prefixPluginTranslations.js","sources":["../../../admin/src/utils/prefixPluginTranslations.ts"],"sourcesContent":["type TradOptions = Record<string, string>;\n\nconst prefixPluginTranslations = (trad: TradOptions, pluginId: string): TradOptions => {\n if (!pluginId) {\n throw new TypeError(\"pluginId can't be empty\");\n }\n return Object.keys(trad).reduce((acc, current) => {\n acc[`${pluginId}.${current}`] = trad[current];\n return acc;\n }, {} as TradOptions);\n};\n\nexport { prefixPluginTranslations };\n"],"names":["prefixPluginTranslations","trad","pluginId","Object","keys","reduce","acc","current"],"mappings":";;AAEA,MAAMA,wBAAAA,GAA2B,CAACC,IAAAA,EAAmBC,QAAAA,GAAAA;AAInD,IAAA,OAAOC,OAAOC,IAAI,CAACH,MAAMI,MAAM,CAAC,CAACC,GAAAA,EAAKC,OAAAA,GAAAA;QACpCD,GAAG,CAAC,CAAA,EAAGJ,QAAAA,CAAS,CAAC,EAAEK,SAAS,CAAC,GAAGN,IAAI,CAACM,OAAAA,CAAQ;QAC7C,OAAOD,GAAAA;AACT,IAAA,CAAA,EAAG,EAAC,CAAA;AACN;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prefixPluginTranslations.mjs","sources":["../../../admin/src/utils/prefixPluginTranslations.ts"],"sourcesContent":["type TradOptions = Record<string, string>;\n\nconst prefixPluginTranslations = (trad: TradOptions, pluginId: string): TradOptions => {\n if (!pluginId) {\n throw new TypeError(\"pluginId can't be empty\");\n }\n return Object.keys(trad).reduce((acc, current) => {\n acc[`${pluginId}.${current}`] = trad[current];\n return acc;\n }, {} as TradOptions);\n};\n\nexport { prefixPluginTranslations };\n"],"names":["prefixPluginTranslations","trad","pluginId","Object","keys","reduce","acc","current"],"mappings":"
|
|
1
|
+
{"version":3,"file":"prefixPluginTranslations.mjs","sources":["../../../admin/src/utils/prefixPluginTranslations.ts"],"sourcesContent":["type TradOptions = Record<string, string>;\n\nconst prefixPluginTranslations = (trad: TradOptions, pluginId: string): TradOptions => {\n if (!pluginId) {\n throw new TypeError(\"pluginId can't be empty\");\n }\n return Object.keys(trad).reduce((acc, current) => {\n acc[`${pluginId}.${current}`] = trad[current];\n return acc;\n }, {} as TradOptions);\n};\n\nexport { prefixPluginTranslations };\n"],"names":["prefixPluginTranslations","trad","pluginId","Object","keys","reduce","acc","current"],"mappings":"AAEA,MAAMA,wBAAAA,GAA2B,CAACC,IAAAA,EAAmBC,QAAAA,GAAAA;AAInD,IAAA,OAAOC,OAAOC,IAAI,CAACH,MAAMI,MAAM,CAAC,CAACC,GAAAA,EAAKC,OAAAA,GAAAA;QACpCD,GAAG,CAAC,CAAA,EAAGJ,QAAAA,CAAS,CAAC,EAAEK,SAAS,CAAC,GAAGN,IAAI,CAACM,OAAAA,CAAQ;QAC7C,OAAOD,GAAAA;AACT,IAAA,CAAA,EAAG,EAAC,CAAA;AACN;;;;"}
|
package/dist/server/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../server/src/index.ts"],"sourcesContent":["import { register } from './register';\n\nexport default {\n register,\n};\n"],"names":["register"],"mappings":";;;;AAEA,YAAe;AACbA,cAAAA;AACF,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../server/src/index.ts"],"sourcesContent":["import { register } from './register';\n\nexport default {\n register,\n};\n"],"names":["register"],"mappings":";;;;AAEA,YAAe;AACbA,cAAAA;AACF,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../server/src/index.ts"],"sourcesContent":["import { register } from './register';\n\nexport default {\n register,\n};\n"],"names":["register"],"mappings":";;AAEA,YAAe;AACbA,IAAAA;AACF,
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../server/src/index.ts"],"sourcesContent":["import { register } from './register';\n\nexport default {\n register,\n};\n"],"names":["register"],"mappings":";;AAEA,YAAe;AACbA,IAAAA;AACF,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.js","sources":["../../server/src/register.ts"],"sourcesContent":["export const register = ({ strapi }: any) => {\n strapi.customFields.register({\n name: 'color',\n plugin: 'color-picker',\n type: 'string',\n });\n};\n"],"names":["register","strapi","customFields","name","plugin","type"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"register.js","sources":["../../server/src/register.ts"],"sourcesContent":["export const register = ({ strapi }: any) => {\n strapi.customFields.register({\n name: 'color',\n plugin: 'color-picker',\n type: 'string',\n });\n};\n"],"names":["register","strapi","customFields","name","plugin","type"],"mappings":";;AAAO,MAAMA,QAAAA,GAAW,CAAC,EAAEC,MAAM,EAAO,GAAA;IACtCA,MAAAA,CAAOC,YAAY,CAACF,QAAQ,CAAC;QAC3BG,IAAAA,EAAM,OAAA;QACNC,MAAAA,EAAQ,cAAA;QACRC,IAAAA,EAAM;AACR,KAAA,CAAA;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.mjs","sources":["../../server/src/register.ts"],"sourcesContent":["export const register = ({ strapi }: any) => {\n strapi.customFields.register({\n name: 'color',\n plugin: 'color-picker',\n type: 'string',\n });\n};\n"],"names":["register","strapi","customFields","name","plugin","type"],"mappings":"
|
|
1
|
+
{"version":3,"file":"register.mjs","sources":["../../server/src/register.ts"],"sourcesContent":["export const register = ({ strapi }: any) => {\n strapi.customFields.register({\n name: 'color',\n plugin: 'color-picker',\n type: 'string',\n });\n};\n"],"names":["register","strapi","customFields","name","plugin","type"],"mappings":"AAAO,MAAMA,QAAAA,GAAW,CAAC,EAAEC,MAAM,EAAO,GAAA;IACtCA,MAAAA,CAAOC,YAAY,CAACF,QAAQ,CAAC;QAC3BG,IAAAA,EAAM,OAAA;QACNC,MAAAA,EAAQ,cAAA;QACRC,IAAAA,EAAM;AACR,KAAA,CAAA;AACF;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strapi/plugin-color-picker",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.38.0",
|
|
4
4
|
"description": "Strapi maintained Custom Fields",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -57,13 +57,13 @@
|
|
|
57
57
|
"watch": "run -T rollup -c -w"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@strapi/design-system": "2.
|
|
61
|
-
"@strapi/icons": "2.
|
|
60
|
+
"@strapi/design-system": "2.2.0",
|
|
61
|
+
"@strapi/icons": "2.2.0",
|
|
62
62
|
"react-colorful": "5.6.1",
|
|
63
63
|
"react-intl": "6.6.2"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"@strapi/strapi": "5.
|
|
66
|
+
"@strapi/strapi": "5.38.0",
|
|
67
67
|
"@testing-library/react": "16.3.0",
|
|
68
68
|
"@testing-library/user-event": "14.6.1",
|
|
69
69
|
"react": "18.3.1",
|