@makeswift/runtime 0.1.8 → 0.1.10
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/Box.cjs.js +2 -3
- package/dist/Box.cjs.js.map +1 -1
- package/dist/Box.es.js +2 -3
- package/dist/Box.es.js.map +1 -1
- package/dist/Button.cjs.js +4 -3
- package/dist/Button.cjs.js.map +1 -1
- package/dist/Button.es.js +4 -3
- package/dist/Button.es.js.map +1 -1
- package/dist/Carousel.cjs.js +5 -4
- package/dist/Carousel.cjs.js.map +1 -1
- package/dist/Carousel.es.js +5 -4
- package/dist/Carousel.es.js.map +1 -1
- package/dist/Countdown.cjs.js +5 -4
- package/dist/Countdown.cjs.js.map +1 -1
- package/dist/Countdown.es.js +5 -4
- package/dist/Countdown.es.js.map +1 -1
- package/dist/Divider.cjs.js +4 -3
- package/dist/Divider.cjs.js.map +1 -1
- package/dist/Divider.es.js +4 -3
- package/dist/Divider.es.js.map +1 -1
- package/dist/Embed.cjs.js +4 -3
- package/dist/Embed.cjs.js.map +1 -1
- package/dist/Embed.es.js +4 -3
- package/dist/Embed.es.js.map +1 -1
- package/dist/Form.cjs.js +3 -4
- package/dist/Form.cjs.js.map +1 -1
- package/dist/Form.es.js +3 -4
- package/dist/Form.es.js.map +1 -1
- package/dist/Image.cjs2.js +4 -3
- package/dist/Image.cjs2.js.map +1 -1
- package/dist/Image.es2.js +4 -3
- package/dist/Image.es2.js.map +1 -1
- package/dist/Navigation.cjs.js +4 -3
- package/dist/Navigation.cjs.js.map +1 -1
- package/dist/Navigation.es.js +4 -3
- package/dist/Navigation.es.js.map +1 -1
- package/dist/Root.cjs.js +4 -3
- package/dist/Root.cjs.js.map +1 -1
- package/dist/Root.es.js +4 -3
- package/dist/Root.es.js.map +1 -1
- package/dist/SocialLinks.cjs.js +4 -3
- package/dist/SocialLinks.cjs.js.map +1 -1
- package/dist/SocialLinks.es.js +4 -3
- package/dist/SocialLinks.es.js.map +1 -1
- package/dist/Text.cjs.js +2 -3
- package/dist/Text.cjs.js.map +1 -1
- package/dist/Text.es.js +2 -3
- package/dist/Text.es.js.map +1 -1
- package/dist/Video.cjs.js +5 -4
- package/dist/Video.cjs.js.map +1 -1
- package/dist/Video.es.js +5 -4
- package/dist/Video.es.js.map +1 -1
- package/dist/actions.es.js +1 -1
- package/dist/builder.cjs.js +0 -2
- package/dist/builder.cjs.js.map +1 -1
- package/dist/builder.es.js +0 -2
- package/dist/builder.es.js.map +1 -1
- package/dist/components.cjs.js +2 -3
- package/dist/components.cjs.js.map +1 -1
- package/dist/components.es.js +2 -3
- package/dist/components.es.js.map +1 -1
- package/dist/control-serialization.cjs.js +37 -39
- package/dist/control-serialization.cjs.js.map +1 -1
- package/dist/control-serialization.es.js +1 -3
- package/dist/control-serialization.es.js.map +1 -1
- package/dist/controls.cjs.js +9 -5
- package/dist/controls.cjs.js.map +1 -1
- package/dist/controls.es.js +2 -2
- package/dist/cssMediaRules.cjs.js +1 -13
- package/dist/cssMediaRules.cjs.js.map +1 -1
- package/dist/cssMediaRules.es.js +1 -13
- package/dist/cssMediaRules.es.js.map +1 -1
- package/dist/image.cjs.js +269 -1
- package/dist/image.cjs.js.map +1 -1
- package/dist/image.es.js +230 -1
- package/dist/image.es.js.map +1 -1
- package/dist/index.cjs.js +382 -187
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +212 -18
- package/dist/index.es.js.map +1 -1
- package/dist/index.es2.js +1 -1
- package/dist/index.es3.js +1 -1
- package/dist/main.cjs.js +2 -3
- package/dist/main.cjs.js.map +1 -1
- package/dist/main.es.js +2 -3
- package/dist/main.es.js.map +1 -1
- package/dist/next.cjs.js +4 -3
- package/dist/next.cjs.js.map +1 -1
- package/dist/next.es.js +5 -4
- package/dist/next.es.js.map +1 -1
- package/dist/prop-controllers.cjs.js +5 -6
- package/dist/prop-controllers.cjs.js.map +1 -1
- package/dist/prop-controllers.es.js +2 -3
- package/dist/prop-controllers.es.js.map +1 -1
- package/dist/react-builder-preview.cjs.js +21 -78
- package/dist/react-builder-preview.cjs.js.map +1 -1
- package/dist/react-builder-preview.es.js +28 -85
- package/dist/react-builder-preview.es.js.map +1 -1
- package/dist/react-page.cjs.js +113 -48
- package/dist/react-page.cjs.js.map +1 -1
- package/dist/react-page.es.js +80 -20
- package/dist/react-page.es.js.map +1 -1
- package/dist/react.cjs.js +4 -3
- package/dist/react.cjs.js.map +1 -1
- package/dist/react.es.js +4 -3
- package/dist/react.es.js.map +1 -1
- package/dist/{instances.cjs.js → slot.cjs.js} +28 -4
- package/dist/slot.cjs.js.map +1 -0
- package/dist/{instances.es.js → slot.es.js} +23 -3
- package/dist/slot.es.js.map +1 -0
- package/dist/types/box-model.d.ts +1 -1
- package/dist/types/box-model.d.ts.map +1 -1
- package/dist/types/controls/index.d.ts +1 -0
- package/dist/types/controls/index.d.ts.map +1 -1
- package/dist/types/controls/slot.d.ts +42 -0
- package/dist/types/controls/slot.d.ts.map +1 -0
- package/dist/types/prop-controllers/descriptors.d.ts +2 -2
- package/dist/types/prop-controllers/descriptors.d.ts.map +1 -1
- package/dist/types/prop-controllers/instances.d.ts +3 -2
- package/dist/types/prop-controllers/instances.d.ts.map +1 -1
- package/dist/types/prop-controllers/introspection.d.ts.map +1 -1
- package/dist/types/runtimes/react/controls/slot.d.ts +30 -0
- package/dist/types/runtimes/react/controls/slot.d.ts.map +1 -0
- package/dist/types/runtimes/react/controls/style.d.ts.map +1 -1
- package/dist/types/runtimes/react/controls.d.ts.map +1 -1
- package/dist/types/runtimes/react/index.d.ts +4 -0
- package/dist/types/runtimes/react/index.d.ts.map +1 -1
- package/dist/types/runtimes/react/use-style.d.ts +3 -0
- package/dist/types/runtimes/react/use-style.d.ts.map +1 -0
- package/dist/types/state/modules/prop-controller-handles.d.ts +1 -0
- package/dist/types/state/modules/prop-controller-handles.d.ts.map +1 -1
- package/dist/types/state/react-builder-preview.d.ts.map +1 -1
- package/dist/types/state/react-page.d.ts +3 -0
- package/dist/types/state/react-page.d.ts.map +1 -1
- package/dist/useBoxShadow.es.js +1 -1
- package/package.json +2 -2
- package/dist/descriptors.cjs.js +0 -232
- package/dist/descriptors.cjs.js.map +0 -1
- package/dist/descriptors.es.js +0 -196
- package/dist/descriptors.es.js.map +0 -1
- package/dist/instances.cjs.js.map +0 -1
- package/dist/instances.es.js.map +0 -1
- package/dist/style.cjs.js +0 -41
- package/dist/style.cjs.js.map +0 -1
- package/dist/style.es.js +0 -38
- package/dist/style.es.js.map +0 -1
package/dist/style.cjs.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const StyleControlType = "makeswift::controls::style";
|
|
3
|
-
const StyleControlProperty = {
|
|
4
|
-
Width: "makeswift::controls::style::property::width",
|
|
5
|
-
Margin: "makeswift::controls::style::property::margin",
|
|
6
|
-
Padding: "makeswift::controls::style::property::padding",
|
|
7
|
-
Border: "makeswift::controls::style::property::border",
|
|
8
|
-
BorderRadius: "makeswift::controls::style::property::border-radius",
|
|
9
|
-
TextStyle: "makeswift::controls::style::property::text-style"
|
|
10
|
-
};
|
|
11
|
-
const StyleControlDefaultProperties = [
|
|
12
|
-
StyleControlProperty.Width,
|
|
13
|
-
StyleControlProperty.Margin
|
|
14
|
-
];
|
|
15
|
-
const AllStyleControlProperties = [
|
|
16
|
-
StyleControlProperty.Width,
|
|
17
|
-
StyleControlProperty.Margin,
|
|
18
|
-
StyleControlProperty.Padding,
|
|
19
|
-
StyleControlProperty.Border,
|
|
20
|
-
StyleControlProperty.BorderRadius,
|
|
21
|
-
StyleControlProperty.TextStyle
|
|
22
|
-
];
|
|
23
|
-
function Style(params) {
|
|
24
|
-
var _a;
|
|
25
|
-
return {
|
|
26
|
-
type: StyleControlType,
|
|
27
|
-
config: { properties: (_a = params == null ? void 0 : params.properties) != null ? _a : StyleControlDefaultProperties }
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
Style.Default = StyleControlDefaultProperties;
|
|
31
|
-
Style.All = AllStyleControlProperties;
|
|
32
|
-
Style.Width = StyleControlProperty.Width;
|
|
33
|
-
Style.Margin = StyleControlProperty.Margin;
|
|
34
|
-
Style.Padding = StyleControlProperty.Padding;
|
|
35
|
-
Style.Border = StyleControlProperty.Border;
|
|
36
|
-
Style.BorderRadius = StyleControlProperty.BorderRadius;
|
|
37
|
-
Style.TextStyle = StyleControlProperty.TextStyle;
|
|
38
|
-
exports.Style = Style;
|
|
39
|
-
exports.StyleControlProperty = StyleControlProperty;
|
|
40
|
-
exports.StyleControlType = StyleControlType;
|
|
41
|
-
//# sourceMappingURL=style.cjs.js.map
|
package/dist/style.cjs.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"style.cjs.js","sources":["../src/controls/style.ts"],"sourcesContent":["import { ColorData, ResponsiveValue } from './types'\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/length\n *\n * @todos\n * - Add additional units\n * - Rename `value` field to `amount` or a more descriptive name representative of the \"distance\"\n * represented by a CSS length\n */\nexport type LengthData = { value: number; unit: 'px' }\n\n/** @see https://developer.mozilla.org/en-US/docs/Web/CSS/percentage */\nexport type PercentageData = { value: number; unit: '%' }\n\n/** @see https://developer.mozilla.org/en-US/docs/Web/CSS/length-percentage */\nexport type LengthPercentageData = LengthData | PercentageData\n\n/** @see https://developer.mozilla.org/en-US/docs/Web/CSS/width */\nexport type WidthPropertyData = LengthPercentageData\n\n/** @see https://developer.mozilla.org/en-US/docs/Web/CSS/margin#constituent_properties */\nexport type MarginLonghandPropertyData = LengthData | 'auto'\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/margin\n *\n * @todos\n * - Remove `null` from possible values\n * - Remove `undefined` from possible values and make fields optional\n */\nexport type MarginPropertyData = {\n marginTop: MarginLonghandPropertyData | null | undefined\n marginRight: MarginLonghandPropertyData | null | undefined\n marginBottom: MarginLonghandPropertyData | null | undefined\n marginLeft: MarginLonghandPropertyData | null | undefined\n}\n\n/** @see https://developer.mozilla.org/en-US/docs/Web/CSS/padding#constituent_properties */\nexport type PaddingLonghandPropertyData = LengthData\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/padding\n *\n * @todos\n * - Remove `null` from possible values\n * - Remove `undefined` from possible values and make fields optional\n */\nexport type PaddingPropertyData = {\n paddingTop: PaddingLonghandPropertyData | null | undefined\n paddingRight: PaddingLonghandPropertyData | null | undefined\n paddingBottom: PaddingLonghandPropertyData | null | undefined\n paddingLeft: PaddingLonghandPropertyData | null | undefined\n}\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-style\n */\ntype BorderStyle = 'dotted' | 'dashed' | 'solid'\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-top#constituent_properties\n *\n * @todos\n * - Change `width` to be a `Length`\n * - Remove `null` from possible values\n * - Remove `undefined` from possible values and make fields optional\n */\nexport type BorderSideShorthandPropertyData = {\n width: number | null | undefined\n style: BorderStyle\n color?: ColorData | null\n}\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border\n *\n * @todos\n * - Remove `null` from possible values\n * - Remove `undefined` from possible values and make fields optional\n */\nexport type BorderPropertyData = {\n borderTop: BorderSideShorthandPropertyData | null | undefined\n borderRight: BorderSideShorthandPropertyData | null | undefined\n borderBottom: BorderSideShorthandPropertyData | null | undefined\n borderLeft: BorderSideShorthandPropertyData | null | undefined\n}\n\n/** @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-radius#constituent_properties */\nexport type BorderRadiusLonghandPropertyData = LengthPercentageData\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-radius\n *\n * @todos\n * - Remove `null` from possible values of longhand properties\n * - Remove `undefined` from possible values and make fields optional\n */\nexport type BorderRadiusPropertyData = {\n borderTopLeftRadius: LengthPercentageData | null | undefined\n borderTopRightRadius: LengthPercentageData | null | undefined\n borderBottomRightRadius: LengthPercentageData | null | undefined\n borderBottomLeftRadius: LengthPercentageData | null | undefined\n}\n\n/**\n * https://developer.mozilla.org/en-US/docs/Web/CSS/font-family\n *\n * @todos\n * - Remove `null` from possible values of longhand properties\n * - Remove `undefined` from possible values and make fields optional\n */\nexport type FontFamilyPropertyData = string | null | undefined\n\n/**\n * https://developer.mozilla.org/en-US/docs/Web/CSS/letter-spacing\n *\n * @todos\n * - Remove `null` from possible values of longhand properties\n * - Remove `undefined` from possible values and make fields optional\n */\nexport type LetterSpacingPropertyData = number | null | undefined\n\n/**\n * https://developer.mozilla.org/en-US/docs/Web/CSS/font-size\n *\n * @todos\n * - Remove `null` from possible values of longhand properties\n * - Remove `undefined` from possible values and make fields optional\n */\nexport type FontSizePropertyData =\n | {\n value: number\n unit: 'px'\n }\n | null\n | undefined\n\n/**\n * https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight\n *\n * @todos\n * - Remove `null` from possible values of longhand properties\n * - Remove `undefined` from possible values and make fields optional\n */\nexport type FontWeightPropertyData = number | null | undefined\n\n/**\n * https://developer.mozilla.org/en-US/docs/Web/CSS/text-transform\n *\n * @todos\n * - Match the type with specification\n */\nexport type TextTransformPropertyData = 'uppercase'[]\n\n/**\n * https://developer.mozilla.org/en-US/docs/Web/CSS/font-style\n *\n * @todos\n * - Match the type with specification\n */\nexport type FontStylePropertyData = 'italic'[]\n\n/**\n * @todos\n * - Remove `null` from possible values of longhand properties\n * - Remove `undefined` from possible values and make fields optional\n */\nexport type TextStylePropertyData = {\n fontFamily?: FontFamilyPropertyData | null | undefined\n letterSpacing: LetterSpacingPropertyData | null | undefined\n fontSize: FontSizePropertyData | null | undefined\n fontWeight: FontWeightPropertyData | null | undefined\n textTransform: TextTransformPropertyData\n fontStyle: FontStylePropertyData\n}\n\nexport type StyleControlData = {\n width?: ResponsiveValue<WidthPropertyData>\n margin?: ResponsiveValue<MarginPropertyData>\n padding?: ResponsiveValue<PaddingPropertyData>\n border?: ResponsiveValue<BorderPropertyData>\n borderRadius?: ResponsiveValue<BorderRadiusPropertyData>\n textStyle?: ResponsiveValue<TextStylePropertyData>\n}\n\nexport const StyleControlType = 'makeswift::controls::style'\n\nexport const StyleControlProperty = {\n Width: 'makeswift::controls::style::property::width',\n Margin: 'makeswift::controls::style::property::margin',\n Padding: 'makeswift::controls::style::property::padding',\n Border: 'makeswift::controls::style::property::border',\n BorderRadius: 'makeswift::controls::style::property::border-radius',\n TextStyle: 'makeswift::controls::style::property::text-style',\n} as const\n\nexport type StyleControlProperty = typeof StyleControlProperty[keyof typeof StyleControlProperty]\n\ntype StyleControlParams = { properties?: StyleControlProperty[] }\n\nexport type StyleControlConfig = { properties: StyleControlProperty[] }\n\nconst StyleControlDefaultProperties: StyleControlProperty[] = [\n StyleControlProperty.Width,\n StyleControlProperty.Margin,\n]\n\nconst AllStyleControlProperties: StyleControlProperty[] = [\n StyleControlProperty.Width,\n StyleControlProperty.Margin,\n StyleControlProperty.Padding,\n StyleControlProperty.Border,\n StyleControlProperty.BorderRadius,\n StyleControlProperty.TextStyle,\n]\n\nexport type StyleControlDefinition = {\n type: typeof StyleControlType\n config: StyleControlConfig\n}\n\n/**\n * @todos\n * - Add support for custom panel labels.\n * - Add support for default values. Internally, default values must be represented with the same\n * format as the underlying data so that controls can show these values.\n */\nexport function Style(params?: StyleControlParams): StyleControlDefinition {\n return {\n type: StyleControlType,\n config: { properties: params?.properties ?? StyleControlDefaultProperties },\n }\n}\n\nStyle.Default = StyleControlDefaultProperties\nStyle.All = AllStyleControlProperties\n\nStyle.Width = StyleControlProperty.Width\nStyle.Margin = StyleControlProperty.Margin\nStyle.Padding = StyleControlProperty.Padding\nStyle.Border = StyleControlProperty.Border\nStyle.BorderRadius = StyleControlProperty.BorderRadius\nStyle.TextStyle = StyleControlProperty.TextStyle\n"],"names":[],"mappings":";AA0LO,MAAM,mBAAmB;AAEzB,MAAM,uBAAuB;AAAA,EAClC,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,WAAW;AACb;AAQA,MAAM,gCAAwD;AAAA,EAC5D,qBAAqB;AAAA,EACrB,qBAAqB;AACvB;AAEA,MAAM,4BAAoD;AAAA,EACxD,qBAAqB;AAAA,EACrB,qBAAqB;AAAA,EACrB,qBAAqB;AAAA,EACrB,qBAAqB;AAAA,EACrB,qBAAqB;AAAA,EACrB,qBAAqB;AACvB;AAaO,eAAe,QAAqD;;AAClE,SAAA;AAAA,IACL,MAAM;AAAA,IACN,QAAQ,EAAE,YAAY,uCAAQ,eAAR,YAAsB,8BAA8B;AAAA,EAAA;AAE9E;AAEA,MAAM,UAAU;AAChB,MAAM,MAAM;AAEZ,MAAM,QAAQ,qBAAqB;AACnC,MAAM,SAAS,qBAAqB;AACpC,MAAM,UAAU,qBAAqB;AACrC,MAAM,SAAS,qBAAqB;AACpC,MAAM,eAAe,qBAAqB;AAC1C,MAAM,YAAY,qBAAqB;;;;"}
|
package/dist/style.es.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
const StyleControlType = "makeswift::controls::style";
|
|
2
|
-
const StyleControlProperty = {
|
|
3
|
-
Width: "makeswift::controls::style::property::width",
|
|
4
|
-
Margin: "makeswift::controls::style::property::margin",
|
|
5
|
-
Padding: "makeswift::controls::style::property::padding",
|
|
6
|
-
Border: "makeswift::controls::style::property::border",
|
|
7
|
-
BorderRadius: "makeswift::controls::style::property::border-radius",
|
|
8
|
-
TextStyle: "makeswift::controls::style::property::text-style"
|
|
9
|
-
};
|
|
10
|
-
const StyleControlDefaultProperties = [
|
|
11
|
-
StyleControlProperty.Width,
|
|
12
|
-
StyleControlProperty.Margin
|
|
13
|
-
];
|
|
14
|
-
const AllStyleControlProperties = [
|
|
15
|
-
StyleControlProperty.Width,
|
|
16
|
-
StyleControlProperty.Margin,
|
|
17
|
-
StyleControlProperty.Padding,
|
|
18
|
-
StyleControlProperty.Border,
|
|
19
|
-
StyleControlProperty.BorderRadius,
|
|
20
|
-
StyleControlProperty.TextStyle
|
|
21
|
-
];
|
|
22
|
-
function Style(params) {
|
|
23
|
-
var _a;
|
|
24
|
-
return {
|
|
25
|
-
type: StyleControlType,
|
|
26
|
-
config: { properties: (_a = params == null ? void 0 : params.properties) != null ? _a : StyleControlDefaultProperties }
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
Style.Default = StyleControlDefaultProperties;
|
|
30
|
-
Style.All = AllStyleControlProperties;
|
|
31
|
-
Style.Width = StyleControlProperty.Width;
|
|
32
|
-
Style.Margin = StyleControlProperty.Margin;
|
|
33
|
-
Style.Padding = StyleControlProperty.Padding;
|
|
34
|
-
Style.Border = StyleControlProperty.Border;
|
|
35
|
-
Style.BorderRadius = StyleControlProperty.BorderRadius;
|
|
36
|
-
Style.TextStyle = StyleControlProperty.TextStyle;
|
|
37
|
-
export { StyleControlType as S, StyleControlProperty as a, Style as b };
|
|
38
|
-
//# sourceMappingURL=style.es.js.map
|
package/dist/style.es.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"style.es.js","sources":["../src/controls/style.ts"],"sourcesContent":["import { ColorData, ResponsiveValue } from './types'\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/length\n *\n * @todos\n * - Add additional units\n * - Rename `value` field to `amount` or a more descriptive name representative of the \"distance\"\n * represented by a CSS length\n */\nexport type LengthData = { value: number; unit: 'px' }\n\n/** @see https://developer.mozilla.org/en-US/docs/Web/CSS/percentage */\nexport type PercentageData = { value: number; unit: '%' }\n\n/** @see https://developer.mozilla.org/en-US/docs/Web/CSS/length-percentage */\nexport type LengthPercentageData = LengthData | PercentageData\n\n/** @see https://developer.mozilla.org/en-US/docs/Web/CSS/width */\nexport type WidthPropertyData = LengthPercentageData\n\n/** @see https://developer.mozilla.org/en-US/docs/Web/CSS/margin#constituent_properties */\nexport type MarginLonghandPropertyData = LengthData | 'auto'\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/margin\n *\n * @todos\n * - Remove `null` from possible values\n * - Remove `undefined` from possible values and make fields optional\n */\nexport type MarginPropertyData = {\n marginTop: MarginLonghandPropertyData | null | undefined\n marginRight: MarginLonghandPropertyData | null | undefined\n marginBottom: MarginLonghandPropertyData | null | undefined\n marginLeft: MarginLonghandPropertyData | null | undefined\n}\n\n/** @see https://developer.mozilla.org/en-US/docs/Web/CSS/padding#constituent_properties */\nexport type PaddingLonghandPropertyData = LengthData\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/padding\n *\n * @todos\n * - Remove `null` from possible values\n * - Remove `undefined` from possible values and make fields optional\n */\nexport type PaddingPropertyData = {\n paddingTop: PaddingLonghandPropertyData | null | undefined\n paddingRight: PaddingLonghandPropertyData | null | undefined\n paddingBottom: PaddingLonghandPropertyData | null | undefined\n paddingLeft: PaddingLonghandPropertyData | null | undefined\n}\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-style\n */\ntype BorderStyle = 'dotted' | 'dashed' | 'solid'\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-top#constituent_properties\n *\n * @todos\n * - Change `width` to be a `Length`\n * - Remove `null` from possible values\n * - Remove `undefined` from possible values and make fields optional\n */\nexport type BorderSideShorthandPropertyData = {\n width: number | null | undefined\n style: BorderStyle\n color?: ColorData | null\n}\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border\n *\n * @todos\n * - Remove `null` from possible values\n * - Remove `undefined` from possible values and make fields optional\n */\nexport type BorderPropertyData = {\n borderTop: BorderSideShorthandPropertyData | null | undefined\n borderRight: BorderSideShorthandPropertyData | null | undefined\n borderBottom: BorderSideShorthandPropertyData | null | undefined\n borderLeft: BorderSideShorthandPropertyData | null | undefined\n}\n\n/** @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-radius#constituent_properties */\nexport type BorderRadiusLonghandPropertyData = LengthPercentageData\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/border-radius\n *\n * @todos\n * - Remove `null` from possible values of longhand properties\n * - Remove `undefined` from possible values and make fields optional\n */\nexport type BorderRadiusPropertyData = {\n borderTopLeftRadius: LengthPercentageData | null | undefined\n borderTopRightRadius: LengthPercentageData | null | undefined\n borderBottomRightRadius: LengthPercentageData | null | undefined\n borderBottomLeftRadius: LengthPercentageData | null | undefined\n}\n\n/**\n * https://developer.mozilla.org/en-US/docs/Web/CSS/font-family\n *\n * @todos\n * - Remove `null` from possible values of longhand properties\n * - Remove `undefined` from possible values and make fields optional\n */\nexport type FontFamilyPropertyData = string | null | undefined\n\n/**\n * https://developer.mozilla.org/en-US/docs/Web/CSS/letter-spacing\n *\n * @todos\n * - Remove `null` from possible values of longhand properties\n * - Remove `undefined` from possible values and make fields optional\n */\nexport type LetterSpacingPropertyData = number | null | undefined\n\n/**\n * https://developer.mozilla.org/en-US/docs/Web/CSS/font-size\n *\n * @todos\n * - Remove `null` from possible values of longhand properties\n * - Remove `undefined` from possible values and make fields optional\n */\nexport type FontSizePropertyData =\n | {\n value: number\n unit: 'px'\n }\n | null\n | undefined\n\n/**\n * https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight\n *\n * @todos\n * - Remove `null` from possible values of longhand properties\n * - Remove `undefined` from possible values and make fields optional\n */\nexport type FontWeightPropertyData = number | null | undefined\n\n/**\n * https://developer.mozilla.org/en-US/docs/Web/CSS/text-transform\n *\n * @todos\n * - Match the type with specification\n */\nexport type TextTransformPropertyData = 'uppercase'[]\n\n/**\n * https://developer.mozilla.org/en-US/docs/Web/CSS/font-style\n *\n * @todos\n * - Match the type with specification\n */\nexport type FontStylePropertyData = 'italic'[]\n\n/**\n * @todos\n * - Remove `null` from possible values of longhand properties\n * - Remove `undefined` from possible values and make fields optional\n */\nexport type TextStylePropertyData = {\n fontFamily?: FontFamilyPropertyData | null | undefined\n letterSpacing: LetterSpacingPropertyData | null | undefined\n fontSize: FontSizePropertyData | null | undefined\n fontWeight: FontWeightPropertyData | null | undefined\n textTransform: TextTransformPropertyData\n fontStyle: FontStylePropertyData\n}\n\nexport type StyleControlData = {\n width?: ResponsiveValue<WidthPropertyData>\n margin?: ResponsiveValue<MarginPropertyData>\n padding?: ResponsiveValue<PaddingPropertyData>\n border?: ResponsiveValue<BorderPropertyData>\n borderRadius?: ResponsiveValue<BorderRadiusPropertyData>\n textStyle?: ResponsiveValue<TextStylePropertyData>\n}\n\nexport const StyleControlType = 'makeswift::controls::style'\n\nexport const StyleControlProperty = {\n Width: 'makeswift::controls::style::property::width',\n Margin: 'makeswift::controls::style::property::margin',\n Padding: 'makeswift::controls::style::property::padding',\n Border: 'makeswift::controls::style::property::border',\n BorderRadius: 'makeswift::controls::style::property::border-radius',\n TextStyle: 'makeswift::controls::style::property::text-style',\n} as const\n\nexport type StyleControlProperty = typeof StyleControlProperty[keyof typeof StyleControlProperty]\n\ntype StyleControlParams = { properties?: StyleControlProperty[] }\n\nexport type StyleControlConfig = { properties: StyleControlProperty[] }\n\nconst StyleControlDefaultProperties: StyleControlProperty[] = [\n StyleControlProperty.Width,\n StyleControlProperty.Margin,\n]\n\nconst AllStyleControlProperties: StyleControlProperty[] = [\n StyleControlProperty.Width,\n StyleControlProperty.Margin,\n StyleControlProperty.Padding,\n StyleControlProperty.Border,\n StyleControlProperty.BorderRadius,\n StyleControlProperty.TextStyle,\n]\n\nexport type StyleControlDefinition = {\n type: typeof StyleControlType\n config: StyleControlConfig\n}\n\n/**\n * @todos\n * - Add support for custom panel labels.\n * - Add support for default values. Internally, default values must be represented with the same\n * format as the underlying data so that controls can show these values.\n */\nexport function Style(params?: StyleControlParams): StyleControlDefinition {\n return {\n type: StyleControlType,\n config: { properties: params?.properties ?? StyleControlDefaultProperties },\n }\n}\n\nStyle.Default = StyleControlDefaultProperties\nStyle.All = AllStyleControlProperties\n\nStyle.Width = StyleControlProperty.Width\nStyle.Margin = StyleControlProperty.Margin\nStyle.Padding = StyleControlProperty.Padding\nStyle.Border = StyleControlProperty.Border\nStyle.BorderRadius = StyleControlProperty.BorderRadius\nStyle.TextStyle = StyleControlProperty.TextStyle\n"],"names":[],"mappings":"AA0LO,MAAM,mBAAmB;AAEzB,MAAM,uBAAuB;AAAA,EAClC,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,WAAW;AACb;AAQA,MAAM,gCAAwD;AAAA,EAC5D,qBAAqB;AAAA,EACrB,qBAAqB;AACvB;AAEA,MAAM,4BAAoD;AAAA,EACxD,qBAAqB;AAAA,EACrB,qBAAqB;AAAA,EACrB,qBAAqB;AAAA,EACrB,qBAAqB;AAAA,EACrB,qBAAqB;AAAA,EACrB,qBAAqB;AACvB;AAaO,eAAe,QAAqD;AA1CpE;AA2CE,SAAA;AAAA,IACL,MAAM;AAAA,IACN,QAAQ,EAAE,YAAY,uCAAQ,eAAR,YAAsB,8BAA8B;AAAA,EAAA;AAE9E;AAEA,MAAM,UAAU;AAChB,MAAM,MAAM;AAEZ,MAAM,QAAQ,qBAAqB;AACnC,MAAM,SAAS,qBAAqB;AACpC,MAAM,UAAU,qBAAqB;AACrC,MAAM,SAAS,qBAAqB;AACpC,MAAM,eAAe,qBAAqB;AAC1C,MAAM,YAAY,qBAAqB;;"}
|