@frontify/guideline-blocks-settings 0.37.4 → 0.37.6
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/Link/LinkInput.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.es.js +14 -14
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.es.js +22 -22
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.es.js.map +1 -1
- package/dist/index.cjs.js +8 -8
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.umd.js +6 -6
- package/dist/index.umd.js.map +1 -1
- package/dist/settings/border.es.js +15 -11
- package/dist/settings/border.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
/* empty css */
|
|
2
|
-
import { MultiInputLayout as
|
|
3
|
-
import { BORDER_COLOR_DEFAULT_VALUE as
|
|
2
|
+
import { MultiInputLayout as t, numericalOrPixelRule as f, minimumNumericalOrPixelRule as y, maximumNumericalOrPixelOrAutoRule as _, appendUnit as I } from "@frontify/sidebar-settings";
|
|
3
|
+
import { BORDER_COLOR_DEFAULT_VALUE as D, BORDER_WIDTH_DEFAULT_VALUE as L } from "./defaultValues.es.js";
|
|
4
4
|
import { BorderStyle as l } from "./types.es.js";
|
|
5
|
-
const
|
|
6
|
-
const r = e != null && e.id ? `hasBorder_${e.id}` : "hasBorder", a = e != null && e.id ? `borderSelection_${e.id}` : "borderSelection", u = e != null && e.id ? `borderStyle_${e.id}` : "borderStyle", d = e != null && e.id ? `borderWidth_${e.id}` : "borderWidth", c = e != null && e.id ? `borderColor_${e.id}` : "borderColor",
|
|
5
|
+
const C = (e) => {
|
|
6
|
+
const r = e != null && e.id ? `hasBorder_${e.id}` : "hasBorder", a = e != null && e.id ? `borderSelection_${e.id}` : "borderSelection", u = e != null && e.id ? `borderStyle_${e.id}` : "borderStyle", d = e != null && e.id ? `borderWidth_${e.id}` : "borderWidth", c = e != null && e.id ? `borderColor_${e.id}` : "borderColor", m = (e == null ? void 0 : e.defaultColor) || D, b = e != null && e.switchLabel ? e.switchLabel : void 0;
|
|
7
7
|
return {
|
|
8
8
|
id: r,
|
|
9
9
|
label: "Border",
|
|
10
10
|
type: "switch",
|
|
11
|
-
switchLabel:
|
|
11
|
+
switchLabel: b,
|
|
12
12
|
defaultValue: !!(e != null && e.defaultValue),
|
|
13
13
|
on: [
|
|
14
14
|
{
|
|
15
15
|
id: a,
|
|
16
16
|
type: "multiInput",
|
|
17
|
-
layout:
|
|
17
|
+
layout: t.Columns,
|
|
18
18
|
lastItemFullWidth: !0,
|
|
19
19
|
blocks: [
|
|
20
20
|
{
|
|
@@ -39,15 +39,19 @@ const O = (e) => {
|
|
|
39
39
|
{
|
|
40
40
|
id: d,
|
|
41
41
|
type: "input",
|
|
42
|
-
defaultValue:
|
|
43
|
-
rules: [
|
|
42
|
+
defaultValue: L,
|
|
43
|
+
rules: [
|
|
44
|
+
f,
|
|
45
|
+
y(0),
|
|
46
|
+
_(500)
|
|
47
|
+
],
|
|
44
48
|
placeholder: "e.g. 3px",
|
|
45
|
-
onChange: (
|
|
49
|
+
onChange: (h) => I(h, d)
|
|
46
50
|
},
|
|
47
51
|
{
|
|
48
52
|
id: c,
|
|
49
53
|
type: "colorInput",
|
|
50
|
-
defaultValue:
|
|
54
|
+
defaultValue: m
|
|
51
55
|
}
|
|
52
56
|
]
|
|
53
57
|
}
|
|
@@ -56,6 +60,6 @@ const O = (e) => {
|
|
|
56
60
|
};
|
|
57
61
|
};
|
|
58
62
|
export {
|
|
59
|
-
|
|
63
|
+
C as getBorderSettings
|
|
60
64
|
};
|
|
61
65
|
//# sourceMappingURL=border.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"border.es.js","sources":["../../src/settings/border.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n type Color,\n MultiInputLayout,\n type SettingBlock,\n appendUnit,\n maximumNumericalOrPixelOrAutoRule,\n numericalOrPixelRule,\n} from '../';\n\nimport { BORDER_COLOR_DEFAULT_VALUE, BORDER_WIDTH_DEFAULT_VALUE } from './defaultValues';\nimport { BorderStyle } from './types';\n\n/**\n * Returns border settings: border switch, border style, border width, border color\n *\n * @param options Options for the settings\n * @param options.id Custom suffix for the setting ids\n * @param options.switchLabel Label for the border switch\n * @param options.defaultValue Default value for the border switch\n * @returns {SettingBlock} Returns border settings\n */\n\ntype BorderSettingsType = {\n id?: string;\n defaultValue?: boolean;\n defaultColor?: Color;\n switchLabel?: string;\n};\n\nexport const getBorderSettings = (options?: BorderSettingsType): SettingBlock => {\n const hasId = options?.id ? `hasBorder_${options.id}` : 'hasBorder';\n const selectionId = options?.id ? `borderSelection_${options.id}` : 'borderSelection';\n const styleId = options?.id ? `borderStyle_${options.id}` : 'borderStyle';\n const widthId = options?.id ? `borderWidth_${options.id}` : 'borderWidth';\n const colorId = options?.id ? `borderColor_${options.id}` : 'borderColor';\n const defaultColor = options?.defaultColor || BORDER_COLOR_DEFAULT_VALUE;\n const switchLabel = options?.switchLabel ? options.switchLabel : undefined;\n\n return {\n id: hasId,\n label: 'Border',\n type: 'switch',\n switchLabel,\n defaultValue: !!options?.defaultValue,\n on: [\n {\n id: selectionId,\n type: 'multiInput',\n layout: MultiInputLayout.Columns,\n lastItemFullWidth: true,\n blocks: [\n {\n id: styleId,\n type: 'dropdown',\n defaultValue: BorderStyle.Solid,\n choices: [\n {\n value: BorderStyle.Solid,\n label: BorderStyle.Solid,\n },\n {\n value: BorderStyle.Dotted,\n label: BorderStyle.Dotted,\n },\n {\n value: BorderStyle.Dashed,\n label: BorderStyle.Dashed,\n },\n ],\n },\n {\n id: widthId,\n type: 'input',\n defaultValue: BORDER_WIDTH_DEFAULT_VALUE,\n rules: [numericalOrPixelRule
|
|
1
|
+
{"version":3,"file":"border.es.js","sources":["../../src/settings/border.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n type Color,\n MultiInputLayout,\n type SettingBlock,\n appendUnit,\n maximumNumericalOrPixelOrAutoRule,\n minimumNumericalOrPixelRule,\n numericalOrPixelRule,\n} from '../';\n\nimport { BORDER_COLOR_DEFAULT_VALUE, BORDER_WIDTH_DEFAULT_VALUE } from './defaultValues';\nimport { BorderStyle } from './types';\n\n/**\n * Returns border settings: border switch, border style, border width, border color\n *\n * @param options Options for the settings\n * @param options.id Custom suffix for the setting ids\n * @param options.switchLabel Label for the border switch\n * @param options.defaultValue Default value for the border switch\n * @returns {SettingBlock} Returns border settings\n */\n\ntype BorderSettingsType = {\n id?: string;\n defaultValue?: boolean;\n defaultColor?: Color;\n switchLabel?: string;\n};\n\nexport const getBorderSettings = (options?: BorderSettingsType): SettingBlock => {\n const hasId = options?.id ? `hasBorder_${options.id}` : 'hasBorder';\n const selectionId = options?.id ? `borderSelection_${options.id}` : 'borderSelection';\n const styleId = options?.id ? `borderStyle_${options.id}` : 'borderStyle';\n const widthId = options?.id ? `borderWidth_${options.id}` : 'borderWidth';\n const colorId = options?.id ? `borderColor_${options.id}` : 'borderColor';\n const defaultColor = options?.defaultColor || BORDER_COLOR_DEFAULT_VALUE;\n const switchLabel = options?.switchLabel ? options.switchLabel : undefined;\n\n return {\n id: hasId,\n label: 'Border',\n type: 'switch',\n switchLabel,\n defaultValue: !!options?.defaultValue,\n on: [\n {\n id: selectionId,\n type: 'multiInput',\n layout: MultiInputLayout.Columns,\n lastItemFullWidth: true,\n blocks: [\n {\n id: styleId,\n type: 'dropdown',\n defaultValue: BorderStyle.Solid,\n choices: [\n {\n value: BorderStyle.Solid,\n label: BorderStyle.Solid,\n },\n {\n value: BorderStyle.Dotted,\n label: BorderStyle.Dotted,\n },\n {\n value: BorderStyle.Dashed,\n label: BorderStyle.Dashed,\n },\n ],\n },\n {\n id: widthId,\n type: 'input',\n defaultValue: BORDER_WIDTH_DEFAULT_VALUE,\n rules: [\n numericalOrPixelRule,\n minimumNumericalOrPixelRule(0),\n maximumNumericalOrPixelOrAutoRule(500),\n ],\n placeholder: 'e.g. 3px',\n onChange: (bundle) => appendUnit(bundle, widthId),\n },\n {\n id: colorId,\n type: 'colorInput',\n defaultValue: defaultColor,\n },\n ],\n },\n ],\n off: [],\n };\n};\n"],"names":["getBorderSettings","options","hasId","selectionId","styleId","widthId","colorId","defaultColor","BORDER_COLOR_DEFAULT_VALUE","switchLabel","MultiInputLayout","BorderStyle","BORDER_WIDTH_DEFAULT_VALUE","numericalOrPixelRule","minimumNumericalOrPixelRule","maximumNumericalOrPixelOrAutoRule","bundle","appendUnit"],"mappings":";;;;AAgCa,MAAAA,IAAoB,CAACC,MAA+C;AAC7E,QAAMC,IAAQD,KAAA,QAAAA,EAAS,KAAK,aAAaA,EAAQ,EAAE,KAAK,aAClDE,IAAcF,KAAA,QAAAA,EAAS,KAAK,mBAAmBA,EAAQ,EAAE,KAAK,mBAC9DG,IAAUH,KAAA,QAAAA,EAAS,KAAK,eAAeA,EAAQ,EAAE,KAAK,eACtDI,IAAUJ,KAAA,QAAAA,EAAS,KAAK,eAAeA,EAAQ,EAAE,KAAK,eACtDK,IAAUL,KAAA,QAAAA,EAAS,KAAK,eAAeA,EAAQ,EAAE,KAAK,eACtDM,KAAeN,KAAA,gBAAAA,EAAS,iBAAgBO,GACxCC,IAAcR,KAAA,QAAAA,EAAS,cAAcA,EAAQ,cAAc;AAE1D,SAAA;AAAA,IACH,IAAIC;AAAA,IACJ,OAAO;AAAA,IACP,MAAM;AAAA,IACN,aAAAO;AAAA,IACA,cAAc,CAAC,EAACR,KAAA,QAAAA,EAAS;AAAA,IACzB,IAAI;AAAA,MACA;AAAA,QACI,IAAIE;AAAA,QACJ,MAAM;AAAA,QACN,QAAQO,EAAiB;AAAA,QACzB,mBAAmB;AAAA,QACnB,QAAQ;AAAA,UACJ;AAAA,YACI,IAAIN;AAAA,YACJ,MAAM;AAAA,YACN,cAAcO,EAAY;AAAA,YAC1B,SAAS;AAAA,cACL;AAAA,gBACI,OAAOA,EAAY;AAAA,gBACnB,OAAOA,EAAY;AAAA,cACvB;AAAA,cACA;AAAA,gBACI,OAAOA,EAAY;AAAA,gBACnB,OAAOA,EAAY;AAAA,cACvB;AAAA,cACA;AAAA,gBACI,OAAOA,EAAY;AAAA,gBACnB,OAAOA,EAAY;AAAA,cACvB;AAAA,YACJ;AAAA,UACJ;AAAA,UACA;AAAA,YACI,IAAIN;AAAA,YACJ,MAAM;AAAA,YACN,cAAcO;AAAA,YACd,OAAO;AAAA,cACHC;AAAA,cACAC,EAA4B,CAAC;AAAA,cAC7BC,EAAkC,GAAG;AAAA,YACzC;AAAA,YACA,aAAa;AAAA,YACb,UAAU,CAACC,MAAWC,EAAWD,GAAQX,CAAO;AAAA,UACpD;AAAA,UACA;AAAA,YACI,IAAIC;AAAA,YACJ,MAAM;AAAA,YACN,cAAcC;AAAA,UAClB;AAAA,QACJ;AAAA,MACJ;AAAA,IACJ;AAAA,IACA,KAAK,CAAC;AAAA,EAAA;AAEd;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontify/guideline-blocks-settings",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.37.
|
|
4
|
+
"version": "0.37.6",
|
|
5
5
|
"description": "Provides types and helpers for the guideline block development",
|
|
6
6
|
"author": "Frontify Developers <developers@frontify.com>",
|
|
7
7
|
"repository": {
|