@frontify/guideline-blocks-settings 2.0.0 → 2.0.1
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/components/Attachments/AttachmentItem.es.js +83 -83
- package/dist/components/Attachments/AttachmentItem.es.js.map +1 -1
- package/dist/components/Attachments/Attachments.es.js +51 -54
- package/dist/components/Attachments/Attachments.es.js.map +1 -1
- package/dist/components/BlockInjectButton/BlockInjectButton.es.js +56 -57
- package/dist/components/BlockInjectButton/BlockInjectButton.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/BlockItemWrapper.es.js +25 -25
- package/dist/components/BlockItemWrapper/BlockItemWrapper.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/context/MultiFlyoutContext.es.js +3 -3
- package/dist/components/Link/LinkInput.es.js +35 -35
- package/dist/components/Link/LinkInput.es.js.map +1 -1
- package/dist/components/Link/LinkSelector/LinkSelector.es.js +31 -31
- package/dist/components/Link/LinkSelector/LinkSelector.es.js.map +1 -1
- package/dist/components/Link/helpers/filterDocumentSectionsWithUnreadableTitles.es.js +2 -5
- package/dist/components/Link/helpers/filterDocumentSectionsWithUnreadableTitles.es.js.map +1 -1
- package/dist/components/Link/utils/getUrl.es.js +9 -15
- package/dist/components/Link/utils/getUrl.es.js.map +1 -1
- package/dist/components/RichTextEditor/RichTextEditor.es.js +39 -39
- package/dist/components/RichTextEditor/RichTextEditor.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/ButtonMarkupElementNode.es.js +24 -25
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/ButtonMarkupElementNode.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.es.js +6 -6
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.es.js +25 -25
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.es.js +29 -33
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/submitFloatingButton.es.js +6 -6
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/submitFloatingButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.es.js +22 -23
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.es.js +61 -63
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButtonText.es.js +6 -6
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButtonText.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getButtonStyle.es.js +6 -7
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getButtonStyle.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/withButton.es.js +21 -21
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/withButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ColumnBreakPlugin/ColumnBreakPlugin.es.js +15 -19
- package/dist/components/RichTextEditor/plugins/ColumnBreakPlugin/ColumnBreakPlugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.es.js +5 -5
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.es.js +13 -13
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.es.js +23 -23
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.es.js +7 -8
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/index.es.js +23 -27
- package/dist/components/RichTextEditor/plugins/LinkPlugin/index.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/getUrl.es.js +6 -9
- package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/getUrl.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.es.js +24 -28
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.es.js +24 -28
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.es.js +24 -28
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.es.js +24 -28
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.es.js +24 -28
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.es.js +24 -28
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.es.js +24 -28
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.es.js +25 -29
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.es.js +25 -29
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.es.js +26 -30
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.es.js +26 -30
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.es.js.map +1 -1
- package/dist/guideline-blocks-settings.css +1 -0
- package/dist/helpers/customCoordinatesGetterFactory.es.js +18 -18
- package/dist/helpers/customCoordinatesGetterFactory.es.js.map +1 -1
- package/dist/hooks/useAttachments.es.js +6 -6
- package/dist/hooks/useAttachments.es.js.map +1 -1
- package/dist/index.cjs.js +7 -7
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +0 -15
- package/dist/index.es.js +208 -208
- package/dist/index.umd.js +7 -7
- package/dist/index.umd.js.map +1 -1
- package/dist/settings/background.es.js +4 -4
- package/dist/settings/background.es.js.map +1 -1
- package/dist/settings/border.es.js +17 -17
- package/dist/settings/border.es.js.map +1 -1
- package/dist/settings/borderRadius.es.js +12 -15
- package/dist/settings/borderRadius.es.js.map +1 -1
- package/dist/settings/borderRadiusExtended.es.js +25 -28
- package/dist/settings/borderRadiusExtended.es.js.map +1 -1
- package/dist/settings/gutter.es.js +17 -20
- package/dist/settings/gutter.es.js.map +1 -1
- package/dist/settings/margin.es.js +14 -14
- package/dist/settings/margin.es.js.map +1 -1
- package/dist/settings/marginExtended.es.js +29 -29
- package/dist/settings/marginExtended.es.js.map +1 -1
- package/dist/settings/padding.es.js +14 -14
- package/dist/settings/padding.es.js.map +1 -1
- package/dist/settings/paddingExtended.es.js +28 -28
- package/dist/settings/paddingExtended.es.js.map +1 -1
- package/dist/settings/securityDownloadable.es.js +8 -11
- package/dist/settings/securityDownloadable.es.js.map +1 -1
- package/dist/utilities/color/getReadableColor.es.js +6 -6
- package/dist/utilities/color/getReadableColor.es.js.map +1 -1
- package/dist/utilities/color/isDark.es.js +4 -4
- package/dist/utilities/color/isDark.es.js.map +1 -1
- package/package.json +16 -16
- package/dist/styles.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"marginExtended.es.js","sources":["../../src/settings/marginExtended.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n MultiInputLayout,\n type SettingBlock,\n appendUnit,\n maximumNumericalOrPixelOrAutoRule,\n numericalOrPixelRule,\n presetCustomValue,\n} from '../';\n\nimport { MARGIN_DEFAULT_PLACEHOLDER } from './defaultValues';\nimport { getMarginSlider } from './margin';\nimport { marginStyleMap } from './types';\n\ntype MarginSettingsType = {\n id?: string;\n};\n\n/**\n * Returns margin settings: margin switch, margin slider, custom margin input for every direction\n *\n * @param options Options for the settings\n * @param options.id Custom suffix for the setting ids\n * @returns {SettingBlock} Returns margin settings\n */\nexport const getMarginExtendedSettings = (options?: MarginSettingsType): SettingBlock => {\n const hasId = options?.id ? `hasExtendedCustomMargin_${options?.id}` : 'hasExtendedCustomMargin';\n const valueId = options?.id ? `extendedMarginValues_${options?.id}` : 'extendedMarginValues';\n const choiceId = options?.id ? `extendedMarginChoice_${options?.id}` : 'extendedMarginChoice';\n const topId = options?.id ? `extendedMarginTop_${options?.id}` : 'extendedMarginTop';\n const leftId = options?.id ? `extendedMarginLeft_${options?.id}` : 'extendedMarginLeft';\n const rightId = options?.id ? `extendedMarginRight_${options?.id}` : 'extendedMarginRight';\n const bottomId = options?.id ? `extendedMarginBottom_${options?.id}` : 'extendedMarginBottom';\n\n return {\n id: hasId,\n label: 'Margin',\n type: 'switch',\n switchLabel: 'Custom',\n defaultValue: false,\n info: 'The spacing around UI elements to create more negative space',\n onChange: (bundle) => {\n presetCustomValue(bundle, choiceId, topId, marginStyleMap);\n presetCustomValue(bundle, choiceId, leftId, marginStyleMap);\n presetCustomValue(bundle, choiceId, rightId, marginStyleMap);\n presetCustomValue(bundle, choiceId, bottomId, marginStyleMap);\n },\n on: [\n {\n id: valueId,\n type: 'multiInput',\n layout: MultiInputLayout.Spider,\n blocks: [\n {\n id: topId,\n type: 'input',\n label: 'Top',\n placeholder: MARGIN_DEFAULT_PLACEHOLDER,\n onChange: (bundle) => appendUnit(bundle, topId),\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n },\n {\n id: leftId,\n type: 'input',\n label: 'Left',\n placeholder: MARGIN_DEFAULT_PLACEHOLDER,\n onChange: (bundle) => appendUnit(bundle, leftId),\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n },\n {\n id: rightId,\n type: 'input',\n label: 'Right',\n placeholder: MARGIN_DEFAULT_PLACEHOLDER,\n onChange: (bundle) => appendUnit(bundle, rightId),\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n },\n {\n id: bottomId,\n type: 'input',\n label: 'Bottom',\n placeholder: MARGIN_DEFAULT_PLACEHOLDER,\n onChange: (bundle) => appendUnit(bundle, bottomId),\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n },\n ],\n },\n ],\n off: [getMarginSlider(choiceId)],\n };\n};\n"],"names":["getMarginExtendedSettings","options","hasId","valueId","choiceId","topId","leftId","rightId","bottomId","bundle","presetCustomValue","marginStyleMap","MultiInputLayout","MARGIN_DEFAULT_PLACEHOLDER","appendUnit","numericalOrPixelRule","maximumNumericalOrPixelOrAutoRule","getMarginSlider"],"mappings":";;;;;AA0BO,MAAMA,IAA4B,CAACC,MAA+C;AACrF,QAAMC,IAAQD,
|
|
1
|
+
{"version":3,"file":"marginExtended.es.js","sources":["../../src/settings/marginExtended.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n MultiInputLayout,\n type SettingBlock,\n appendUnit,\n maximumNumericalOrPixelOrAutoRule,\n numericalOrPixelRule,\n presetCustomValue,\n} from '../';\n\nimport { MARGIN_DEFAULT_PLACEHOLDER } from './defaultValues';\nimport { getMarginSlider } from './margin';\nimport { marginStyleMap } from './types';\n\ntype MarginSettingsType = {\n id?: string;\n};\n\n/**\n * Returns margin settings: margin switch, margin slider, custom margin input for every direction\n *\n * @param options Options for the settings\n * @param options.id Custom suffix for the setting ids\n * @returns {SettingBlock} Returns margin settings\n */\nexport const getMarginExtendedSettings = (options?: MarginSettingsType): SettingBlock => {\n const hasId = options?.id ? `hasExtendedCustomMargin_${options?.id}` : 'hasExtendedCustomMargin';\n const valueId = options?.id ? `extendedMarginValues_${options?.id}` : 'extendedMarginValues';\n const choiceId = options?.id ? `extendedMarginChoice_${options?.id}` : 'extendedMarginChoice';\n const topId = options?.id ? `extendedMarginTop_${options?.id}` : 'extendedMarginTop';\n const leftId = options?.id ? `extendedMarginLeft_${options?.id}` : 'extendedMarginLeft';\n const rightId = options?.id ? `extendedMarginRight_${options?.id}` : 'extendedMarginRight';\n const bottomId = options?.id ? `extendedMarginBottom_${options?.id}` : 'extendedMarginBottom';\n\n return {\n id: hasId,\n label: 'Margin',\n type: 'switch',\n switchLabel: 'Custom',\n defaultValue: false,\n info: 'The spacing around UI elements to create more negative space',\n onChange: (bundle) => {\n presetCustomValue(bundle, choiceId, topId, marginStyleMap);\n presetCustomValue(bundle, choiceId, leftId, marginStyleMap);\n presetCustomValue(bundle, choiceId, rightId, marginStyleMap);\n presetCustomValue(bundle, choiceId, bottomId, marginStyleMap);\n },\n on: [\n {\n id: valueId,\n type: 'multiInput',\n layout: MultiInputLayout.Spider,\n blocks: [\n {\n id: topId,\n type: 'input',\n label: 'Top',\n placeholder: MARGIN_DEFAULT_PLACEHOLDER,\n onChange: (bundle) => appendUnit(bundle, topId),\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n },\n {\n id: leftId,\n type: 'input',\n label: 'Left',\n placeholder: MARGIN_DEFAULT_PLACEHOLDER,\n onChange: (bundle) => appendUnit(bundle, leftId),\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n },\n {\n id: rightId,\n type: 'input',\n label: 'Right',\n placeholder: MARGIN_DEFAULT_PLACEHOLDER,\n onChange: (bundle) => appendUnit(bundle, rightId),\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n },\n {\n id: bottomId,\n type: 'input',\n label: 'Bottom',\n placeholder: MARGIN_DEFAULT_PLACEHOLDER,\n onChange: (bundle) => appendUnit(bundle, bottomId),\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n },\n ],\n },\n ],\n off: [getMarginSlider(choiceId)],\n };\n};\n"],"names":["getMarginExtendedSettings","options","hasId","valueId","choiceId","topId","leftId","rightId","bottomId","bundle","presetCustomValue","marginStyleMap","MultiInputLayout","MARGIN_DEFAULT_PLACEHOLDER","appendUnit","numericalOrPixelRule","maximumNumericalOrPixelOrAutoRule","getMarginSlider"],"mappings":";;;;;AA0BO,MAAMA,IAA4B,CAACC,MAA+C;AACrF,QAAMC,IAAQD,GAAS,KAAK,2BAA2BA,GAAS,EAAE,KAAK,2BACjEE,IAAUF,GAAS,KAAK,wBAAwBA,GAAS,EAAE,KAAK,wBAChEG,IAAWH,GAAS,KAAK,wBAAwBA,GAAS,EAAE,KAAK,wBACjEI,IAAQJ,GAAS,KAAK,qBAAqBA,GAAS,EAAE,KAAK,qBAC3DK,IAASL,GAAS,KAAK,sBAAsBA,GAAS,EAAE,KAAK,sBAC7DM,IAAUN,GAAS,KAAK,uBAAuBA,GAAS,EAAE,KAAK,uBAC/DO,IAAWP,GAAS,KAAK,wBAAwBA,GAAS,EAAE,KAAK;AAEvE,SAAO;AAAA,IACH,IAAIC;AAAA,IACJ,OAAO;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA,IACb,cAAc;AAAA,IACd,MAAM;AAAA,IACN,UAAU,CAACO,MAAW;AAClB,MAAAC,EAAkBD,GAAQL,GAAUC,GAAOM,CAAc,GACzDD,EAAkBD,GAAQL,GAAUE,GAAQK,CAAc,GAC1DD,EAAkBD,GAAQL,GAAUG,GAASI,CAAc,GAC3DD,EAAkBD,GAAQL,GAAUI,GAAUG,CAAc;AAAA,IAChE;AAAA,IACA,IAAI;AAAA,MACA;AAAA,QACI,IAAIR;AAAA,QACJ,MAAM;AAAA,QACN,QAAQS,EAAiB;AAAA,QACzB,QAAQ;AAAA,UACJ;AAAA,YACI,IAAIP;AAAA,YACJ,MAAM;AAAA,YACN,OAAO;AAAA,YACP,aAAaQ;AAAA,YACb,UAAU,CAACJ,MAAWK,EAAWL,GAAQJ,CAAK;AAAA,YAC9C,OAAO,CAACU,GAAsBC,EAAkC,GAAG,CAAC;AAAA,UAAA;AAAA,UAExE;AAAA,YACI,IAAIV;AAAA,YACJ,MAAM;AAAA,YACN,OAAO;AAAA,YACP,aAAaO;AAAA,YACb,UAAU,CAACJ,MAAWK,EAAWL,GAAQH,CAAM;AAAA,YAC/C,OAAO,CAACS,GAAsBC,EAAkC,GAAG,CAAC;AAAA,UAAA;AAAA,UAExE;AAAA,YACI,IAAIT;AAAA,YACJ,MAAM;AAAA,YACN,OAAO;AAAA,YACP,aAAaM;AAAA,YACb,UAAU,CAACJ,MAAWK,EAAWL,GAAQF,CAAO;AAAA,YAChD,OAAO,CAACQ,GAAsBC,EAAkC,GAAG,CAAC;AAAA,UAAA;AAAA,UAExE;AAAA,YACI,IAAIR;AAAA,YACJ,MAAM;AAAA,YACN,OAAO;AAAA,YACP,aAAaK;AAAA,YACb,UAAU,CAACJ,MAAWK,EAAWL,GAAQD,CAAQ;AAAA,YACjD,OAAO,CAACO,GAAsBC,EAAkC,GAAG,CAAC;AAAA,UAAA;AAAA,QACxE;AAAA,MACJ;AAAA,IACJ;AAAA,IAEJ,KAAK,CAACC,EAAgBb,CAAQ,CAAC;AAAA,EAAA;AAEvC;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* empty css */
|
|
2
|
-
import {
|
|
3
|
-
import { PADDING_DEFAULT_PLACEHOLDER as
|
|
4
|
-
import { Padding as a, paddingStyleMap as
|
|
5
|
-
const
|
|
2
|
+
import { numericalOrPixelRule as n, appendUnit as u, maximumNumericalOrPixelOrAutoRule as r, presetCustomValue as o } from "@frontify/sidebar-settings";
|
|
3
|
+
import { PADDING_DEFAULT_PLACEHOLDER as m } from "./defaultValues.es.js";
|
|
4
|
+
import { Padding as a, paddingStyleMap as g } from "./types.es.js";
|
|
5
|
+
const c = (e) => ({
|
|
6
6
|
id: e,
|
|
7
7
|
type: "segmentedControls",
|
|
8
8
|
defaultValue: a.Small,
|
|
@@ -24,30 +24,30 @@ const f = (e) => ({
|
|
|
24
24
|
label: "L"
|
|
25
25
|
}
|
|
26
26
|
]
|
|
27
|
-
}),
|
|
28
|
-
const
|
|
27
|
+
}), P = (e) => {
|
|
28
|
+
const t = e?.id ? `hasCustomPaddingValue_${e?.id}` : "hasCustomPaddingValue", l = e?.id ? `paddingValue_${e?.id}` : "paddingValue", i = e?.id ? `paddingChoice_${e?.id}` : "paddingChoice";
|
|
29
29
|
return {
|
|
30
|
-
id:
|
|
30
|
+
id: t,
|
|
31
31
|
label: "Padding",
|
|
32
32
|
type: "switch",
|
|
33
33
|
switchLabel: "Custom",
|
|
34
34
|
defaultValue: !1,
|
|
35
35
|
info: "The spacing around UI elements to create more negative space",
|
|
36
|
-
onChange: (d) =>
|
|
36
|
+
onChange: (d) => o(d, i, l, e?.paddingStyleMap || g),
|
|
37
37
|
on: [
|
|
38
38
|
{
|
|
39
39
|
id: l,
|
|
40
40
|
type: "input",
|
|
41
|
-
placeholder:
|
|
42
|
-
rules: [
|
|
43
|
-
onChange: (d) =>
|
|
41
|
+
placeholder: m,
|
|
42
|
+
rules: [n, r(500)],
|
|
43
|
+
onChange: (d) => u(d, l)
|
|
44
44
|
}
|
|
45
45
|
],
|
|
46
|
-
off: [
|
|
46
|
+
off: [c(i)]
|
|
47
47
|
};
|
|
48
48
|
};
|
|
49
49
|
export {
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
P as getPaddingSettings,
|
|
51
|
+
c as getPaddingSlider
|
|
52
52
|
};
|
|
53
53
|
//# sourceMappingURL=padding.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"padding.es.js","sources":["../../src/settings/padding.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n type SettingBlock,\n appendUnit,\n maximumNumericalOrPixelOrAutoRule,\n numericalOrPixelRule,\n presetCustomValue,\n} from '../';\n\nimport { PADDING_DEFAULT_PLACEHOLDER } from './defaultValues';\nimport { Padding, paddingStyleMap } from './types';\n\ntype PaddingSettingsType = {\n id?: string;\n paddingStyleMap?: Record<Padding, string>;\n};\n\n/**\n * Returns padding settings: padding switch, padding slider, custom padding input\n *\n * @param options Options for the settings\n * @param options.id Custom suffix for the setting ids\n * @returns {SettingBlock} Returns padding settings\n */\nexport const getPaddingSlider = (id: string): SettingBlock => ({\n id,\n type: 'segmentedControls',\n defaultValue: Padding.Small,\n choices: [\n {\n value: Padding.None,\n label: 'None',\n },\n {\n value: Padding.Small,\n label: 'S',\n },\n {\n value: Padding.Medium,\n label: 'M',\n },\n {\n value: Padding.Large,\n label: 'L',\n },\n ],\n});\n\nexport const getPaddingSettings = (options?: PaddingSettingsType): SettingBlock => {\n const hasId = options?.id ? `hasCustomPaddingValue_${options?.id}` : 'hasCustomPaddingValue';\n const valueId = options?.id ? `paddingValue_${options?.id}` : 'paddingValue';\n const choiceId = options?.id ? `paddingChoice_${options?.id}` : 'paddingChoice';\n\n return {\n id: hasId,\n label: 'Padding',\n type: 'switch',\n switchLabel: 'Custom',\n defaultValue: false,\n info: 'The spacing around UI elements to create more negative space',\n onChange: (bundle) => presetCustomValue(bundle, choiceId, valueId, options?.paddingStyleMap || paddingStyleMap),\n on: [\n {\n id: valueId,\n type: 'input',\n placeholder: PADDING_DEFAULT_PLACEHOLDER,\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n onChange: (bundle) => appendUnit(bundle, valueId),\n },\n ],\n off: [getPaddingSlider(choiceId)],\n };\n};\n"],"names":["getPaddingSlider","id","Padding","getPaddingSettings","options","hasId","valueId","choiceId","bundle","presetCustomValue","paddingStyleMap","PADDING_DEFAULT_PLACEHOLDER","numericalOrPixelRule","maximumNumericalOrPixelOrAutoRule","appendUnit"],"mappings":";;;;AAyBO,MAAMA,IAAmB,CAACC,OAA8B;AAAA,EAC3D,IAAAA;AAAA,EACA,MAAM;AAAA,EACN,cAAcC,EAAQ;AAAA,EACtB,SAAS;AAAA,IACL;AAAA,MACI,OAAOA,EAAQ;AAAA,MACf,OAAO;AAAA,IAAA;AAAA,IAEX;AAAA,MACI,OAAOA,EAAQ;AAAA,MACf,OAAO;AAAA,IAAA;AAAA,IAEX;AAAA,MACI,OAAOA,EAAQ;AAAA,MACf,OAAO;AAAA,IAAA;AAAA,IAEX;AAAA,MACI,OAAOA,EAAQ;AAAA,MACf,OAAO;AAAA,IAAA;AAAA,EACX;AAER,IAEaC,IAAqB,CAACC,MAAgD;AAC/E,QAAMC,IAAQD,
|
|
1
|
+
{"version":3,"file":"padding.es.js","sources":["../../src/settings/padding.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n type SettingBlock,\n appendUnit,\n maximumNumericalOrPixelOrAutoRule,\n numericalOrPixelRule,\n presetCustomValue,\n} from '../';\n\nimport { PADDING_DEFAULT_PLACEHOLDER } from './defaultValues';\nimport { Padding, paddingStyleMap } from './types';\n\ntype PaddingSettingsType = {\n id?: string;\n paddingStyleMap?: Record<Padding, string>;\n};\n\n/**\n * Returns padding settings: padding switch, padding slider, custom padding input\n *\n * @param options Options for the settings\n * @param options.id Custom suffix for the setting ids\n * @returns {SettingBlock} Returns padding settings\n */\nexport const getPaddingSlider = (id: string): SettingBlock => ({\n id,\n type: 'segmentedControls',\n defaultValue: Padding.Small,\n choices: [\n {\n value: Padding.None,\n label: 'None',\n },\n {\n value: Padding.Small,\n label: 'S',\n },\n {\n value: Padding.Medium,\n label: 'M',\n },\n {\n value: Padding.Large,\n label: 'L',\n },\n ],\n});\n\nexport const getPaddingSettings = (options?: PaddingSettingsType): SettingBlock => {\n const hasId = options?.id ? `hasCustomPaddingValue_${options?.id}` : 'hasCustomPaddingValue';\n const valueId = options?.id ? `paddingValue_${options?.id}` : 'paddingValue';\n const choiceId = options?.id ? `paddingChoice_${options?.id}` : 'paddingChoice';\n\n return {\n id: hasId,\n label: 'Padding',\n type: 'switch',\n switchLabel: 'Custom',\n defaultValue: false,\n info: 'The spacing around UI elements to create more negative space',\n onChange: (bundle) => presetCustomValue(bundle, choiceId, valueId, options?.paddingStyleMap || paddingStyleMap),\n on: [\n {\n id: valueId,\n type: 'input',\n placeholder: PADDING_DEFAULT_PLACEHOLDER,\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n onChange: (bundle) => appendUnit(bundle, valueId),\n },\n ],\n off: [getPaddingSlider(choiceId)],\n };\n};\n"],"names":["getPaddingSlider","id","Padding","getPaddingSettings","options","hasId","valueId","choiceId","bundle","presetCustomValue","paddingStyleMap","PADDING_DEFAULT_PLACEHOLDER","numericalOrPixelRule","maximumNumericalOrPixelOrAutoRule","appendUnit"],"mappings":";;;;AAyBO,MAAMA,IAAmB,CAACC,OAA8B;AAAA,EAC3D,IAAAA;AAAA,EACA,MAAM;AAAA,EACN,cAAcC,EAAQ;AAAA,EACtB,SAAS;AAAA,IACL;AAAA,MACI,OAAOA,EAAQ;AAAA,MACf,OAAO;AAAA,IAAA;AAAA,IAEX;AAAA,MACI,OAAOA,EAAQ;AAAA,MACf,OAAO;AAAA,IAAA;AAAA,IAEX;AAAA,MACI,OAAOA,EAAQ;AAAA,MACf,OAAO;AAAA,IAAA;AAAA,IAEX;AAAA,MACI,OAAOA,EAAQ;AAAA,MACf,OAAO;AAAA,IAAA;AAAA,EACX;AAER,IAEaC,IAAqB,CAACC,MAAgD;AAC/E,QAAMC,IAAQD,GAAS,KAAK,yBAAyBA,GAAS,EAAE,KAAK,yBAC/DE,IAAUF,GAAS,KAAK,gBAAgBA,GAAS,EAAE,KAAK,gBACxDG,IAAWH,GAAS,KAAK,iBAAiBA,GAAS,EAAE,KAAK;AAEhE,SAAO;AAAA,IACH,IAAIC;AAAA,IACJ,OAAO;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA,IACb,cAAc;AAAA,IACd,MAAM;AAAA,IACN,UAAU,CAACG,MAAWC,EAAkBD,GAAQD,GAAUD,GAASF,GAAS,mBAAmBM,CAAe;AAAA,IAC9G,IAAI;AAAA,MACA;AAAA,QACI,IAAIJ;AAAA,QACJ,MAAM;AAAA,QACN,aAAaK;AAAA,QACb,OAAO,CAACC,GAAsBC,EAAkC,GAAG,CAAC;AAAA,QACpE,UAAU,CAACL,MAAWM,EAAWN,GAAQF,CAAO;AAAA,MAAA;AAAA,IACpD;AAAA,IAEJ,KAAK,CAACN,EAAiBO,CAAQ,CAAC;AAAA,EAAA;AAExC;"}
|
|
@@ -1,65 +1,65 @@
|
|
|
1
1
|
/* empty css */
|
|
2
|
-
import { numericalOrPixelRule as
|
|
3
|
-
import { PADDING_DEFAULT_PLACEHOLDER as
|
|
4
|
-
import { getPaddingSlider as
|
|
5
|
-
import { paddingStyleMap as
|
|
6
|
-
const
|
|
7
|
-
const
|
|
2
|
+
import { numericalOrPixelRule as i, MultiInputLayout as P, maximumNumericalOrPixelOrAutoRule as a, appendUnit as n, presetCustomValue as l } from "@frontify/sidebar-settings";
|
|
3
|
+
import { PADDING_DEFAULT_PLACEHOLDER as g } from "./defaultValues.es.js";
|
|
4
|
+
import { getPaddingSlider as x } from "./padding.es.js";
|
|
5
|
+
import { paddingStyleMap as r } from "./types.es.js";
|
|
6
|
+
const _ = (e) => {
|
|
7
|
+
const h = e?.id ? `hasExtendedCustomPadding_${e?.id}` : "hasExtendedCustomPadding", p = e?.id ? `extendedPaddingValues_${e?.id}` : "extendedPaddingValues", t = e?.id ? `extendedPaddingChoice_${e?.id}` : "extendedPaddingChoice", o = e?.id ? `extendedPaddingTop_${e?.id}` : "extendedPaddingTop", u = e?.id ? `extendedPaddingLeft_${e?.id}` : "extendedPaddingLeft", m = e?.id ? `extendedPaddingRight_${e?.id}` : "extendedPaddingRight", c = e?.id ? `extendedPaddingBottom_${e?.id}` : "extendedPaddingBottom";
|
|
8
8
|
return {
|
|
9
|
-
id:
|
|
9
|
+
id: h,
|
|
10
10
|
label: "Padding",
|
|
11
11
|
type: "switch",
|
|
12
12
|
switchLabel: "Custom",
|
|
13
13
|
defaultValue: !1,
|
|
14
14
|
info: "The spacing around UI elements to create more negative space",
|
|
15
15
|
onChange: (d) => {
|
|
16
|
-
|
|
16
|
+
l(d, t, o, r), l(d, t, u, r), l(d, t, m, r), l(d, t, c, r);
|
|
17
17
|
},
|
|
18
18
|
on: [
|
|
19
19
|
{
|
|
20
|
-
id:
|
|
20
|
+
id: p,
|
|
21
21
|
type: "multiInput",
|
|
22
|
-
layout:
|
|
22
|
+
layout: P.Spider,
|
|
23
23
|
blocks: [
|
|
24
24
|
{
|
|
25
|
-
id:
|
|
25
|
+
id: o,
|
|
26
26
|
type: "input",
|
|
27
27
|
label: "Top",
|
|
28
|
-
placeholder:
|
|
29
|
-
onChange: (d) =>
|
|
30
|
-
rules: [
|
|
28
|
+
placeholder: g,
|
|
29
|
+
onChange: (d) => n(d, o),
|
|
30
|
+
rules: [i, a(500)]
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
|
-
id:
|
|
33
|
+
id: u,
|
|
34
34
|
type: "input",
|
|
35
35
|
label: "Left",
|
|
36
|
-
placeholder:
|
|
37
|
-
onChange: (d) =>
|
|
38
|
-
rules: [
|
|
36
|
+
placeholder: g,
|
|
37
|
+
onChange: (d) => n(d, u),
|
|
38
|
+
rules: [i, a(500)]
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
|
-
id:
|
|
41
|
+
id: m,
|
|
42
42
|
type: "input",
|
|
43
43
|
label: "Right",
|
|
44
|
-
placeholder:
|
|
45
|
-
onChange: (d) =>
|
|
46
|
-
rules: [
|
|
44
|
+
placeholder: g,
|
|
45
|
+
onChange: (d) => n(d, m),
|
|
46
|
+
rules: [i, a(500)]
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
|
-
id:
|
|
49
|
+
id: c,
|
|
50
50
|
type: "input",
|
|
51
51
|
label: "Bottom",
|
|
52
|
-
placeholder:
|
|
53
|
-
onChange: (d) =>
|
|
54
|
-
rules: [
|
|
52
|
+
placeholder: g,
|
|
53
|
+
onChange: (d) => n(d, c),
|
|
54
|
+
rules: [i, a(500)]
|
|
55
55
|
}
|
|
56
56
|
]
|
|
57
57
|
}
|
|
58
58
|
],
|
|
59
|
-
off: [
|
|
59
|
+
off: [x(t)]
|
|
60
60
|
};
|
|
61
61
|
};
|
|
62
62
|
export {
|
|
63
|
-
|
|
63
|
+
_ as getPaddingExtendedSettings
|
|
64
64
|
};
|
|
65
65
|
//# sourceMappingURL=paddingExtended.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paddingExtended.es.js","sources":["../../src/settings/paddingExtended.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n MultiInputLayout,\n type SettingBlock,\n appendUnit,\n maximumNumericalOrPixelOrAutoRule,\n numericalOrPixelRule,\n presetCustomValue,\n} from '../';\n\nimport { PADDING_DEFAULT_PLACEHOLDER } from './defaultValues';\nimport { getPaddingSlider } from './padding';\nimport { paddingStyleMap } from './types';\n\ntype PaddingSettingsType = {\n id?: string;\n};\n\n/**\n * Returns padding settings: padding switch, padding slider, custom padding input for every direction\n *\n * @param options Options for the settings\n * @param options.id Custom suffix for the setting ids\n * @returns {SettingBlock} Returns padding settings\n */\nexport const getPaddingExtendedSettings = (options?: PaddingSettingsType): SettingBlock => {\n const hasId = options?.id ? `hasExtendedCustomPadding_${options?.id}` : 'hasExtendedCustomPadding';\n const valueId = options?.id ? `extendedPaddingValues_${options?.id}` : 'extendedPaddingValues';\n const choiceId = options?.id ? `extendedPaddingChoice_${options?.id}` : 'extendedPaddingChoice';\n const topId = options?.id ? `extendedPaddingTop_${options?.id}` : 'extendedPaddingTop';\n const leftId = options?.id ? `extendedPaddingLeft_${options?.id}` : 'extendedPaddingLeft';\n const rightId = options?.id ? `extendedPaddingRight_${options?.id}` : 'extendedPaddingRight';\n const bottomId = options?.id ? `extendedPaddingBottom_${options?.id}` : 'extendedPaddingBottom';\n\n return {\n id: hasId,\n label: 'Padding',\n type: 'switch',\n switchLabel: 'Custom',\n defaultValue: false,\n info: 'The spacing around UI elements to create more negative space',\n onChange: (bundle) => {\n presetCustomValue(bundle, choiceId, topId, paddingStyleMap);\n presetCustomValue(bundle, choiceId, leftId, paddingStyleMap);\n presetCustomValue(bundle, choiceId, rightId, paddingStyleMap);\n presetCustomValue(bundle, choiceId, bottomId, paddingStyleMap);\n },\n on: [\n {\n id: valueId,\n type: 'multiInput',\n layout: MultiInputLayout.Spider,\n blocks: [\n {\n id: topId,\n type: 'input',\n label: 'Top',\n placeholder: PADDING_DEFAULT_PLACEHOLDER,\n onChange: (bundle) => appendUnit(bundle, topId),\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n },\n {\n id: leftId,\n type: 'input',\n label: 'Left',\n placeholder: PADDING_DEFAULT_PLACEHOLDER,\n onChange: (bundle) => appendUnit(bundle, leftId),\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n },\n {\n id: rightId,\n type: 'input',\n label: 'Right',\n placeholder: PADDING_DEFAULT_PLACEHOLDER,\n onChange: (bundle) => appendUnit(bundle, rightId),\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n },\n {\n id: bottomId,\n type: 'input',\n label: 'Bottom',\n placeholder: PADDING_DEFAULT_PLACEHOLDER,\n onChange: (bundle) => appendUnit(bundle, bottomId),\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n },\n ],\n },\n ],\n off: [getPaddingSlider(choiceId)],\n };\n};\n"],"names":["getPaddingExtendedSettings","options","hasId","valueId","choiceId","topId","leftId","rightId","bottomId","bundle","presetCustomValue","paddingStyleMap","MultiInputLayout","PADDING_DEFAULT_PLACEHOLDER","appendUnit","numericalOrPixelRule","maximumNumericalOrPixelOrAutoRule","getPaddingSlider"],"mappings":";;;;;AA0BO,MAAMA,IAA6B,CAACC,MAAgD;AACvF,QAAMC,IAAQD,
|
|
1
|
+
{"version":3,"file":"paddingExtended.es.js","sources":["../../src/settings/paddingExtended.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n MultiInputLayout,\n type SettingBlock,\n appendUnit,\n maximumNumericalOrPixelOrAutoRule,\n numericalOrPixelRule,\n presetCustomValue,\n} from '../';\n\nimport { PADDING_DEFAULT_PLACEHOLDER } from './defaultValues';\nimport { getPaddingSlider } from './padding';\nimport { paddingStyleMap } from './types';\n\ntype PaddingSettingsType = {\n id?: string;\n};\n\n/**\n * Returns padding settings: padding switch, padding slider, custom padding input for every direction\n *\n * @param options Options for the settings\n * @param options.id Custom suffix for the setting ids\n * @returns {SettingBlock} Returns padding settings\n */\nexport const getPaddingExtendedSettings = (options?: PaddingSettingsType): SettingBlock => {\n const hasId = options?.id ? `hasExtendedCustomPadding_${options?.id}` : 'hasExtendedCustomPadding';\n const valueId = options?.id ? `extendedPaddingValues_${options?.id}` : 'extendedPaddingValues';\n const choiceId = options?.id ? `extendedPaddingChoice_${options?.id}` : 'extendedPaddingChoice';\n const topId = options?.id ? `extendedPaddingTop_${options?.id}` : 'extendedPaddingTop';\n const leftId = options?.id ? `extendedPaddingLeft_${options?.id}` : 'extendedPaddingLeft';\n const rightId = options?.id ? `extendedPaddingRight_${options?.id}` : 'extendedPaddingRight';\n const bottomId = options?.id ? `extendedPaddingBottom_${options?.id}` : 'extendedPaddingBottom';\n\n return {\n id: hasId,\n label: 'Padding',\n type: 'switch',\n switchLabel: 'Custom',\n defaultValue: false,\n info: 'The spacing around UI elements to create more negative space',\n onChange: (bundle) => {\n presetCustomValue(bundle, choiceId, topId, paddingStyleMap);\n presetCustomValue(bundle, choiceId, leftId, paddingStyleMap);\n presetCustomValue(bundle, choiceId, rightId, paddingStyleMap);\n presetCustomValue(bundle, choiceId, bottomId, paddingStyleMap);\n },\n on: [\n {\n id: valueId,\n type: 'multiInput',\n layout: MultiInputLayout.Spider,\n blocks: [\n {\n id: topId,\n type: 'input',\n label: 'Top',\n placeholder: PADDING_DEFAULT_PLACEHOLDER,\n onChange: (bundle) => appendUnit(bundle, topId),\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n },\n {\n id: leftId,\n type: 'input',\n label: 'Left',\n placeholder: PADDING_DEFAULT_PLACEHOLDER,\n onChange: (bundle) => appendUnit(bundle, leftId),\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n },\n {\n id: rightId,\n type: 'input',\n label: 'Right',\n placeholder: PADDING_DEFAULT_PLACEHOLDER,\n onChange: (bundle) => appendUnit(bundle, rightId),\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n },\n {\n id: bottomId,\n type: 'input',\n label: 'Bottom',\n placeholder: PADDING_DEFAULT_PLACEHOLDER,\n onChange: (bundle) => appendUnit(bundle, bottomId),\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n },\n ],\n },\n ],\n off: [getPaddingSlider(choiceId)],\n };\n};\n"],"names":["getPaddingExtendedSettings","options","hasId","valueId","choiceId","topId","leftId","rightId","bottomId","bundle","presetCustomValue","paddingStyleMap","MultiInputLayout","PADDING_DEFAULT_PLACEHOLDER","appendUnit","numericalOrPixelRule","maximumNumericalOrPixelOrAutoRule","getPaddingSlider"],"mappings":";;;;;AA0BO,MAAMA,IAA6B,CAACC,MAAgD;AACvF,QAAMC,IAAQD,GAAS,KAAK,4BAA4BA,GAAS,EAAE,KAAK,4BAClEE,IAAUF,GAAS,KAAK,yBAAyBA,GAAS,EAAE,KAAK,yBACjEG,IAAWH,GAAS,KAAK,yBAAyBA,GAAS,EAAE,KAAK,yBAClEI,IAAQJ,GAAS,KAAK,sBAAsBA,GAAS,EAAE,KAAK,sBAC5DK,IAASL,GAAS,KAAK,uBAAuBA,GAAS,EAAE,KAAK,uBAC9DM,IAAUN,GAAS,KAAK,wBAAwBA,GAAS,EAAE,KAAK,wBAChEO,IAAWP,GAAS,KAAK,yBAAyBA,GAAS,EAAE,KAAK;AAExE,SAAO;AAAA,IACH,IAAIC;AAAA,IACJ,OAAO;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA,IACb,cAAc;AAAA,IACd,MAAM;AAAA,IACN,UAAU,CAACO,MAAW;AAClB,MAAAC,EAAkBD,GAAQL,GAAUC,GAAOM,CAAe,GAC1DD,EAAkBD,GAAQL,GAAUE,GAAQK,CAAe,GAC3DD,EAAkBD,GAAQL,GAAUG,GAASI,CAAe,GAC5DD,EAAkBD,GAAQL,GAAUI,GAAUG,CAAe;AAAA,IACjE;AAAA,IACA,IAAI;AAAA,MACA;AAAA,QACI,IAAIR;AAAA,QACJ,MAAM;AAAA,QACN,QAAQS,EAAiB;AAAA,QACzB,QAAQ;AAAA,UACJ;AAAA,YACI,IAAIP;AAAA,YACJ,MAAM;AAAA,YACN,OAAO;AAAA,YACP,aAAaQ;AAAA,YACb,UAAU,CAACJ,MAAWK,EAAWL,GAAQJ,CAAK;AAAA,YAC9C,OAAO,CAACU,GAAsBC,EAAkC,GAAG,CAAC;AAAA,UAAA;AAAA,UAExE;AAAA,YACI,IAAIV;AAAA,YACJ,MAAM;AAAA,YACN,OAAO;AAAA,YACP,aAAaO;AAAA,YACb,UAAU,CAACJ,MAAWK,EAAWL,GAAQH,CAAM;AAAA,YAC/C,OAAO,CAACS,GAAsBC,EAAkC,GAAG,CAAC;AAAA,UAAA;AAAA,UAExE;AAAA,YACI,IAAIT;AAAA,YACJ,MAAM;AAAA,YACN,OAAO;AAAA,YACP,aAAaM;AAAA,YACb,UAAU,CAACJ,MAAWK,EAAWL,GAAQF,CAAO;AAAA,YAChD,OAAO,CAACQ,GAAsBC,EAAkC,GAAG,CAAC;AAAA,UAAA;AAAA,UAExE;AAAA,YACI,IAAIR;AAAA,YACJ,MAAM;AAAA,YACN,OAAO;AAAA,YACP,aAAaK;AAAA,YACb,UAAU,CAACJ,MAAWK,EAAWL,GAAQD,CAAQ;AAAA,YACjD,OAAO,CAACO,GAAsBC,EAAkC,GAAG,CAAC;AAAA,UAAA;AAAA,QACxE;AAAA,MACJ;AAAA,IACJ;AAAA,IAEJ,KAAK,CAACC,EAAiBb,CAAQ,CAAC;AAAA,EAAA;AAExC;"}
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
import { Security as
|
|
2
|
-
const
|
|
3
|
-
const
|
|
1
|
+
import { Security as o } from "./types.es.js";
|
|
2
|
+
const d = (e) => {
|
|
3
|
+
const t = r(e?.globalControlId);
|
|
4
4
|
return {
|
|
5
|
-
id: e
|
|
5
|
+
id: e?.id ? e.id : "downloadable",
|
|
6
6
|
type: "switch",
|
|
7
7
|
defaultValue: !1,
|
|
8
8
|
label: "Downloadable",
|
|
9
|
-
show: (
|
|
10
|
-
var l;
|
|
11
|
-
return ((l = a.getBlock(r)) == null ? void 0 : l.value) === t.Custom;
|
|
12
|
-
}
|
|
9
|
+
show: (l) => l.getBlock(t)?.value === o.Custom
|
|
13
10
|
};
|
|
14
|
-
},
|
|
11
|
+
}, r = (e) => e || "security";
|
|
15
12
|
export {
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
d as getSecurityDownloadableSetting,
|
|
14
|
+
r as getSecurityGlobalControlId
|
|
18
15
|
};
|
|
19
16
|
//# sourceMappingURL=securityDownloadable.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"securityDownloadable.es.js","sources":["../../src/settings/securityDownloadable.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type SettingBlock } from '..';\n\nimport { Security } from './types';\n\n/**\n * Returns the downloadable security settings.\n *\n * @param {string} id custom id for the setting block\n * @param {string} globalControlId custom id for the global control setting block\n *\n * @returns {SettingBlock} Returns downloadable security settings.\n */\n\ntype SecurityDownloadableSettingType = {\n id?: string;\n globalControlId?: string;\n};\n\nexport const getSecurityDownloadableSetting = (options?: SecurityDownloadableSettingType): SettingBlock => {\n const securityId = getSecurityGlobalControlId(options?.globalControlId);\n return {\n id: options?.id ? options.id : 'downloadable',\n type: 'switch',\n defaultValue: false,\n label: 'Downloadable',\n show: (bundle) => bundle.getBlock(securityId)?.value === Security.Custom,\n };\n};\n\nexport const getSecurityGlobalControlId = (id?: string): string => {\n return id || 'security';\n};\n"],"names":["getSecurityDownloadableSetting","options","securityId","getSecurityGlobalControlId","bundle","
|
|
1
|
+
{"version":3,"file":"securityDownloadable.es.js","sources":["../../src/settings/securityDownloadable.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type SettingBlock } from '..';\n\nimport { Security } from './types';\n\n/**\n * Returns the downloadable security settings.\n *\n * @param {string} id custom id for the setting block\n * @param {string} globalControlId custom id for the global control setting block\n *\n * @returns {SettingBlock} Returns downloadable security settings.\n */\n\ntype SecurityDownloadableSettingType = {\n id?: string;\n globalControlId?: string;\n};\n\nexport const getSecurityDownloadableSetting = (options?: SecurityDownloadableSettingType): SettingBlock => {\n const securityId = getSecurityGlobalControlId(options?.globalControlId);\n return {\n id: options?.id ? options.id : 'downloadable',\n type: 'switch',\n defaultValue: false,\n label: 'Downloadable',\n show: (bundle) => bundle.getBlock(securityId)?.value === Security.Custom,\n };\n};\n\nexport const getSecurityGlobalControlId = (id?: string): string => {\n return id || 'security';\n};\n"],"names":["getSecurityDownloadableSetting","options","securityId","getSecurityGlobalControlId","bundle","Security","id"],"mappings":";AAoBO,MAAMA,IAAiC,CAACC,MAA4D;AACvG,QAAMC,IAAaC,EAA2BF,GAAS,eAAe;AACtE,SAAO;AAAA,IACH,IAAIA,GAAS,KAAKA,EAAQ,KAAK;AAAA,IAC/B,MAAM;AAAA,IACN,cAAc;AAAA,IACd,OAAO;AAAA,IACP,MAAM,CAACG,MAAWA,EAAO,SAASF,CAAU,GAAG,UAAUG,EAAS;AAAA,EAAA;AAE1E,GAEaF,IAA6B,CAACG,MAChCA,KAAM;"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { TinyColor as n, readability as
|
|
1
|
+
import { TinyColor as n, readability as d } from "@ctrl/tinycolor";
|
|
2
2
|
import { toShortRgba as i } from "./toShortRgba.es.js";
|
|
3
|
-
const s = (
|
|
4
|
-
const t = s(
|
|
3
|
+
const s = (e) => typeof e == "object" && ["red", "green", "blue"].every((t) => e?.hasOwnProperty(t)), y = (e, r) => {
|
|
4
|
+
const t = s(e) ? i(e) : e, a = s(r) ? i(r) : r;
|
|
5
5
|
let o = new n(t);
|
|
6
|
-
const
|
|
7
|
-
for (;
|
|
6
|
+
const p = new n(a);
|
|
7
|
+
for (; d(o, p) < 4.5; )
|
|
8
8
|
o = o.darken(1);
|
|
9
9
|
return o.toRgbString();
|
|
10
10
|
};
|
|
11
11
|
export {
|
|
12
|
-
|
|
12
|
+
y as getReadableColor
|
|
13
13
|
};
|
|
14
14
|
//# sourceMappingURL=getReadableColor.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getReadableColor.es.js","sources":["../../../src/utilities/color/getReadableColor.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type ColorInput, TinyColor, readability } from '@ctrl/tinycolor';\nimport { type Color } from '@frontify/sidebar-settings';\n\nimport { toShortRgba } from './toShortRgba';\n\n/**\n * Returns darkened text color for a given background color, so that it is readable and has enough contrast (above 4.5)\n *\n * @param {Object} textColor Object of RGBA values\n * @param {Object} backgroundColor Object of RGBA values\n * @returns {string} To be used as css value\n */\n\nconst isRgbaLongFormat = (value: unknown): value is Color => {\n const requiredKeys = ['red', 'green', 'blue'];\n return typeof value === 'object' && requiredKeys.every((i) => value?.hasOwnProperty(i));\n};\n\nexport const getReadableColor = (textColor: unknown, backgroundColor: unknown): string => {\n const inputTextColor = isRgbaLongFormat(textColor) ? toShortRgba(textColor) : (textColor as ColorInput);\n const inputBackgroundColor = isRgbaLongFormat(backgroundColor)\n ? toShortRgba(backgroundColor)\n : (backgroundColor as ColorInput);\n let parsedTextColor = new TinyColor(inputTextColor);\n const parsedBackgroundColor = new TinyColor(inputBackgroundColor);\n\n // darken the text color until readability is good\n while (readability(parsedTextColor, parsedBackgroundColor) < 4.5) {\n parsedTextColor = parsedTextColor.darken(1);\n }\n\n return parsedTextColor.toRgbString();\n};\n"],"names":["isRgbaLongFormat","value","i","getReadableColor","textColor","backgroundColor","inputTextColor","toShortRgba","inputBackgroundColor","parsedTextColor","TinyColor","parsedBackgroundColor","readability"],"mappings":";;AAeA,MAAMA,IAAmB,CAACC,MAEf,OAAOA,KAAU,YADH,CAAC,OAAO,SAAS,MAAM,EACK,MAAM,CAACC,MAAMD,
|
|
1
|
+
{"version":3,"file":"getReadableColor.es.js","sources":["../../../src/utilities/color/getReadableColor.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type ColorInput, TinyColor, readability } from '@ctrl/tinycolor';\nimport { type Color } from '@frontify/sidebar-settings';\n\nimport { toShortRgba } from './toShortRgba';\n\n/**\n * Returns darkened text color for a given background color, so that it is readable and has enough contrast (above 4.5)\n *\n * @param {Object} textColor Object of RGBA values\n * @param {Object} backgroundColor Object of RGBA values\n * @returns {string} To be used as css value\n */\n\nconst isRgbaLongFormat = (value: unknown): value is Color => {\n const requiredKeys = ['red', 'green', 'blue'];\n return typeof value === 'object' && requiredKeys.every((i) => value?.hasOwnProperty(i));\n};\n\nexport const getReadableColor = (textColor: unknown, backgroundColor: unknown): string => {\n const inputTextColor = isRgbaLongFormat(textColor) ? toShortRgba(textColor) : (textColor as ColorInput);\n const inputBackgroundColor = isRgbaLongFormat(backgroundColor)\n ? toShortRgba(backgroundColor)\n : (backgroundColor as ColorInput);\n let parsedTextColor = new TinyColor(inputTextColor);\n const parsedBackgroundColor = new TinyColor(inputBackgroundColor);\n\n // darken the text color until readability is good\n while (readability(parsedTextColor, parsedBackgroundColor) < 4.5) {\n parsedTextColor = parsedTextColor.darken(1);\n }\n\n return parsedTextColor.toRgbString();\n};\n"],"names":["isRgbaLongFormat","value","i","getReadableColor","textColor","backgroundColor","inputTextColor","toShortRgba","inputBackgroundColor","parsedTextColor","TinyColor","parsedBackgroundColor","readability"],"mappings":";;AAeA,MAAMA,IAAmB,CAACC,MAEf,OAAOA,KAAU,YADH,CAAC,OAAO,SAAS,MAAM,EACK,MAAM,CAACC,MAAMD,GAAO,eAAeC,CAAC,CAAC,GAG7EC,IAAmB,CAACC,GAAoBC,MAAqC;AACtF,QAAMC,IAAiBN,EAAiBI,CAAS,IAAIG,EAAYH,CAAS,IAAKA,GACzEI,IAAuBR,EAAiBK,CAAe,IACvDE,EAAYF,CAAe,IAC1BA;AACP,MAAII,IAAkB,IAAIC,EAAUJ,CAAc;AAClD,QAAMK,IAAwB,IAAID,EAAUF,CAAoB;AAGhE,SAAOI,EAAYH,GAAiBE,CAAqB,IAAI;AACzD,IAAAF,IAAkBA,EAAgB,OAAO,CAAC;AAG9C,SAAOA,EAAgB,YAAA;AAC3B;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { TinyColor as n } from "@ctrl/tinycolor";
|
|
2
2
|
import { toShortRgba as s } from "./toShortRgba.es.js";
|
|
3
|
-
const i = (r) => typeof r == "object" && ["red", "green", "blue"].every((o) => r
|
|
4
|
-
const o = i(r) ? s(r) : r,
|
|
5
|
-
return
|
|
3
|
+
const i = (r) => typeof r == "object" && ["red", "green", "blue"].every((o) => r?.hasOwnProperty(o)), g = (r, t) => {
|
|
4
|
+
const o = i(r) ? s(r) : r, e = new n(o);
|
|
5
|
+
return t ? e.getBrightness() < t : e.isDark() || e.getAlpha() > 0.25 && e.getAlpha() < 1;
|
|
6
6
|
};
|
|
7
7
|
export {
|
|
8
|
-
|
|
8
|
+
g as isDark
|
|
9
9
|
};
|
|
10
10
|
//# sourceMappingURL=isDark.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isDark.es.js","sources":["../../../src/utilities/color/isDark.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type ColorInput, TinyColor } from '@ctrl/tinycolor';\nimport { type Color } from '@frontify/sidebar-settings';\n\nimport { toShortRgba } from './toShortRgba';\n\n/**\n * Calculates if text should be in a light color depending on color (e.g. background-color)\n *\n * @param {Object} value Object of RGBA values\n * @param {Number|undefined} threshold Threshold for the brightness\n * @returns {Boolean} Return if the color is dark\n */\n\nconst isRgbaLongFormat = (value: unknown): value is Color => {\n const requiredKeys = ['red', 'green', 'blue'];\n return typeof value === 'object' && requiredKeys.every((i) => value?.hasOwnProperty(i));\n};\n\nexport const isDark = (color: unknown, threshold?: number): boolean => {\n const inputColor = isRgbaLongFormat(color) ? toShortRgba(color) : (color as ColorInput);\n const parsedColor = new TinyColor(inputColor);\n\n if (threshold) {\n return parsedColor.getBrightness() < threshold;\n }\n\n return parsedColor.isDark() || (parsedColor.getAlpha() > 0.25 && parsedColor.getAlpha() < 1);\n};\n"],"names":["isRgbaLongFormat","value","i","isDark","color","threshold","inputColor","toShortRgba","parsedColor","TinyColor"],"mappings":";;AAeA,MAAMA,IAAmB,CAACC,MAEf,OAAOA,KAAU,YADH,CAAC,OAAO,SAAS,MAAM,EACK,MAAM,CAACC,MAAMD,
|
|
1
|
+
{"version":3,"file":"isDark.es.js","sources":["../../../src/utilities/color/isDark.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type ColorInput, TinyColor } from '@ctrl/tinycolor';\nimport { type Color } from '@frontify/sidebar-settings';\n\nimport { toShortRgba } from './toShortRgba';\n\n/**\n * Calculates if text should be in a light color depending on color (e.g. background-color)\n *\n * @param {Object} value Object of RGBA values\n * @param {Number|undefined} threshold Threshold for the brightness\n * @returns {Boolean} Return if the color is dark\n */\n\nconst isRgbaLongFormat = (value: unknown): value is Color => {\n const requiredKeys = ['red', 'green', 'blue'];\n return typeof value === 'object' && requiredKeys.every((i) => value?.hasOwnProperty(i));\n};\n\nexport const isDark = (color: unknown, threshold?: number): boolean => {\n const inputColor = isRgbaLongFormat(color) ? toShortRgba(color) : (color as ColorInput);\n const parsedColor = new TinyColor(inputColor);\n\n if (threshold) {\n return parsedColor.getBrightness() < threshold;\n }\n\n return parsedColor.isDark() || (parsedColor.getAlpha() > 0.25 && parsedColor.getAlpha() < 1);\n};\n"],"names":["isRgbaLongFormat","value","i","isDark","color","threshold","inputColor","toShortRgba","parsedColor","TinyColor"],"mappings":";;AAeA,MAAMA,IAAmB,CAACC,MAEf,OAAOA,KAAU,YADH,CAAC,OAAO,SAAS,MAAM,EACK,MAAM,CAACC,MAAMD,GAAO,eAAeC,CAAC,CAAC,GAG7EC,IAAS,CAACC,GAAgBC,MAAgC;AACnE,QAAMC,IAAaN,EAAiBI,CAAK,IAAIG,EAAYH,CAAK,IAAKA,GAC7DI,IAAc,IAAIC,EAAUH,CAAU;AAE5C,SAAID,IACOG,EAAY,kBAAkBH,IAGlCG,EAAY,YAAaA,EAAY,aAAa,QAAQA,EAAY,SAAA,IAAa;AAC9F;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontify/guideline-blocks-settings",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.1",
|
|
5
5
|
"description": "Provides types and helpers for the guideline block development",
|
|
6
6
|
"author": "Frontify Developers <developers@frontify.com>",
|
|
7
7
|
"repository": {
|
|
@@ -42,41 +42,41 @@
|
|
|
42
42
|
"@react-aria/focus": "^3.21.3",
|
|
43
43
|
"@react-stately/overlays": "^3.6.21",
|
|
44
44
|
"@tailwindcss/container-queries": "^0.1.1",
|
|
45
|
-
"@frontify/sidebar-settings": "^0.10.
|
|
45
|
+
"@frontify/sidebar-settings": "^0.10.9"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@babel/core": "^7.
|
|
48
|
+
"@babel/core": "^7.29.0",
|
|
49
49
|
"@frontify/eslint-config-react": "1.0.8",
|
|
50
50
|
"@testing-library/jest-dom": "^6.9.1",
|
|
51
|
-
"@testing-library/react": "^16.3.
|
|
51
|
+
"@testing-library/react": "^16.3.2",
|
|
52
52
|
"@testing-library/user-event": "14.6.1",
|
|
53
53
|
"@types/node": "^24.10.1",
|
|
54
54
|
"@types/react": "^18.3.27",
|
|
55
55
|
"@types/react-dom": "^18.3.7",
|
|
56
56
|
"@types/sinon": "^21.0.0",
|
|
57
|
-
"@vitejs/plugin-react": "^5.1.
|
|
58
|
-
"@vitest/ui": "^
|
|
59
|
-
"autoprefixer": "^10.4.
|
|
60
|
-
"cypress": "^15.
|
|
57
|
+
"@vitejs/plugin-react": "^5.1.3",
|
|
58
|
+
"@vitest/ui": "^4.0.18",
|
|
59
|
+
"autoprefixer": "^10.4.24",
|
|
60
|
+
"cypress": "^15.9.0",
|
|
61
61
|
"cypress-real-events": "^1.15.0",
|
|
62
|
-
"eslint": "^9.39.
|
|
62
|
+
"eslint": "^9.39.2",
|
|
63
63
|
"eslint-plugin-notice": "^1.0.0",
|
|
64
|
-
"happy-dom": "^20.0
|
|
64
|
+
"happy-dom": "^20.5.0",
|
|
65
65
|
"mitt": "^3.0.1",
|
|
66
|
-
"msw": "^
|
|
66
|
+
"msw": "^2.12.7",
|
|
67
67
|
"postcss": "^8.5.6",
|
|
68
68
|
"prettier": "^3.7.4",
|
|
69
69
|
"react": "^18.3.1",
|
|
70
70
|
"react-dom": "^18.3.1",
|
|
71
|
-
"rollup": "^4.
|
|
72
|
-
"sinon": "21.0.
|
|
71
|
+
"rollup": "^4.57.1",
|
|
72
|
+
"sinon": "21.0.1",
|
|
73
73
|
"tailwindcss": "^3.4.18",
|
|
74
74
|
"typescript": "^5.9.3",
|
|
75
|
-
"vite": "^
|
|
76
|
-
"vite-plugin-dts": "^
|
|
75
|
+
"vite": "^7.3.1",
|
|
76
|
+
"vite-plugin-dts": "^4.5.4",
|
|
77
77
|
"vite-plugin-externalize-deps": "^0.10.0",
|
|
78
78
|
"vite-plugin-externals": "^0.6.2",
|
|
79
|
-
"vitest": "^
|
|
79
|
+
"vitest": "^4.0.18"
|
|
80
80
|
},
|
|
81
81
|
"scripts": {
|
|
82
82
|
"build": "vite build",
|