@makeswift/runtime 0.15.0 → 0.16.0-canary.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/cjs/builder/serialization/control-serialization.js +38 -37
- package/dist/cjs/builder/serialization/control-serialization.js.map +1 -1
- package/dist/cjs/components/builtin/Box/Box.js.map +1 -1
- package/dist/cjs/components/builtin/Box/register.js +25 -24
- package/dist/cjs/components/builtin/Box/register.js.map +1 -1
- package/dist/cjs/components/builtin/Button/Button.js.map +1 -1
- package/dist/cjs/components/builtin/Button/register.js +13 -12
- package/dist/cjs/components/builtin/Button/register.js.map +1 -1
- package/dist/cjs/components/builtin/Carousel/Carousel.js.map +1 -1
- package/dist/cjs/components/builtin/Carousel/register.js +26 -14
- package/dist/cjs/components/builtin/Carousel/register.js.map +1 -1
- package/dist/cjs/components/builtin/Countdown/Countdown.js.map +1 -1
- package/dist/cjs/components/builtin/Countdown/register.js +4 -3
- package/dist/cjs/components/builtin/Countdown/register.js.map +1 -1
- package/dist/cjs/components/builtin/Divider/Divider.js.map +1 -1
- package/dist/cjs/components/builtin/Divider/register.js +3 -2
- package/dist/cjs/components/builtin/Divider/register.js.map +1 -1
- package/dist/cjs/components/builtin/Form/Form.js.map +1 -1
- package/dist/cjs/components/builtin/Form/context/FormContext.js.map +1 -1
- package/dist/cjs/components/builtin/Form/register.js +6 -5
- package/dist/cjs/components/builtin/Form/register.js.map +1 -1
- package/dist/cjs/components/builtin/Image/Image.js.map +1 -1
- package/dist/cjs/components/builtin/Image/register.js +6 -5
- package/dist/cjs/components/builtin/Image/register.js.map +1 -1
- package/dist/cjs/components/builtin/Navigation/Navigation.js.map +1 -1
- package/dist/cjs/components/builtin/Navigation/components/DropDownButton/index.js.map +1 -1
- package/dist/cjs/components/builtin/Navigation/components/LinksPlaceholder/index.js.map +1 -1
- package/dist/cjs/components/builtin/Navigation/components/MobileMenu/components/MobileDropDownButton/index.js.map +1 -1
- package/dist/cjs/components/builtin/Navigation/components/MobileMenu/index.js.map +1 -1
- package/dist/cjs/components/builtin/Navigation/register.js +32 -16
- package/dist/cjs/components/builtin/Navigation/register.js.map +1 -1
- package/dist/cjs/components/builtin/SocialLinks/SocialLinks.js.map +1 -1
- package/dist/cjs/components/builtin/SocialLinks/components/SocialLinksPlaceholder/index.js.map +1 -1
- package/dist/cjs/components/builtin/SocialLinks/register.js +3 -2
- package/dist/cjs/components/builtin/SocialLinks/register.js.map +1 -1
- package/dist/cjs/components/builtin/Video/register.js +2 -1
- package/dist/cjs/components/builtin/Video/register.js.map +1 -1
- package/dist/cjs/components/hooks/index.js +5 -1
- package/dist/cjs/components/hooks/index.js.map +1 -1
- package/dist/cjs/components/hooks/useBorder.js +3 -3
- package/dist/cjs/components/hooks/useBorder.js.map +1 -1
- package/dist/cjs/components/hooks/useBoxShadow.js +6 -5
- package/dist/cjs/components/hooks/useBoxShadow.js.map +1 -1
- package/dist/cjs/{prop-controllers/copy/shadows.js → components/hooks/useCheckboxPropControllerData.js} +11 -25
- package/dist/cjs/components/hooks/useCheckboxPropControllerData.js.map +1 -0
- package/dist/cjs/{prop-controllers/copy/responsive-color.js → components/hooks/useLinkPropControllerData.js} +11 -16
- package/dist/cjs/components/hooks/useLinkPropControllerData.js.map +1 -0
- package/dist/cjs/components/hooks/useNumberPropControllerData.js +34 -0
- package/dist/cjs/components/hooks/useNumberPropControllerData.js.map +1 -0
- package/dist/cjs/components/hooks/useResponsiveColor.js +2 -2
- package/dist/cjs/components/hooks/useResponsiveColor.js.map +1 -1
- package/dist/cjs/components/hooks/useResponsiveColorPropControllerData.js +34 -0
- package/dist/cjs/components/hooks/useResponsiveColorPropControllerData.js.map +1 -0
- package/dist/cjs/components/hooks/useResponsiveLengthPropControllerData.js +34 -0
- package/dist/cjs/components/hooks/useResponsiveLengthPropControllerData.js.map +1 -0
- package/dist/cjs/components/shared/GutterContainer/index.js.map +1 -1
- package/dist/cjs/components/shared/Link/index.js.map +1 -1
- package/dist/cjs/components/shared/grid-item.js.map +1 -1
- package/dist/cjs/components/utils/responsive-style.js.map +1 -1
- package/dist/cjs/controls/control.js +5 -4
- package/dist/cjs/controls/control.js.map +1 -1
- package/dist/cjs/controls/rich-text/introspection.js +2 -9
- package/dist/cjs/controls/rich-text/introspection.js.map +1 -1
- package/dist/cjs/css/border.js.map +1 -1
- package/dist/cjs/next/api-handler/handlers/manifest.js +1 -1
- package/dist/cjs/prop-controllers/copy/navigation-links.js +2 -2
- package/dist/cjs/prop-controllers/copy/navigation-links.js.map +1 -1
- package/dist/cjs/prop-controllers/copy.js +9 -10
- package/dist/cjs/prop-controllers/copy.js.map +1 -1
- package/dist/cjs/prop-controllers/descriptors.js +0 -69
- package/dist/cjs/prop-controllers/descriptors.js.map +1 -1
- package/dist/cjs/prop-controllers/index.js.map +1 -1
- package/dist/cjs/prop-controllers/introspection.js +9 -38
- package/dist/cjs/prop-controllers/introspection.js.map +1 -1
- package/dist/cjs/runtimes/react/controls.js +63 -14
- package/dist/cjs/runtimes/react/controls.js.map +1 -1
- package/dist/esm/builder/serialization/control-serialization.js +13 -10
- package/dist/esm/builder/serialization/control-serialization.js.map +1 -1
- package/dist/esm/components/builtin/Box/Box.js.map +1 -1
- package/dist/esm/components/builtin/Box/register.js +5 -4
- package/dist/esm/components/builtin/Box/register.js.map +1 -1
- package/dist/esm/components/builtin/Button/Button.js.map +1 -1
- package/dist/esm/components/builtin/Button/register.js +4 -3
- package/dist/esm/components/builtin/Button/register.js.map +1 -1
- package/dist/esm/components/builtin/Carousel/Carousel.js.map +1 -1
- package/dist/esm/components/builtin/Carousel/register.js +31 -14
- package/dist/esm/components/builtin/Carousel/register.js.map +1 -1
- package/dist/esm/components/builtin/Countdown/Countdown.js.map +1 -1
- package/dist/esm/components/builtin/Countdown/register.js +4 -3
- package/dist/esm/components/builtin/Countdown/register.js.map +1 -1
- package/dist/esm/components/builtin/Divider/Divider.js.map +1 -1
- package/dist/esm/components/builtin/Divider/register.js +3 -2
- package/dist/esm/components/builtin/Divider/register.js.map +1 -1
- package/dist/esm/components/builtin/Form/Form.js.map +1 -1
- package/dist/esm/components/builtin/Form/context/FormContext.js.map +1 -1
- package/dist/esm/components/builtin/Form/register.js +6 -5
- package/dist/esm/components/builtin/Form/register.js.map +1 -1
- package/dist/esm/components/builtin/Image/Image.js.map +1 -1
- package/dist/esm/components/builtin/Image/register.js +6 -5
- package/dist/esm/components/builtin/Image/register.js.map +1 -1
- package/dist/esm/components/builtin/Navigation/Navigation.js.map +1 -1
- package/dist/esm/components/builtin/Navigation/components/DropDownButton/index.js.map +1 -1
- package/dist/esm/components/builtin/Navigation/components/LinksPlaceholder/index.js.map +1 -1
- package/dist/esm/components/builtin/Navigation/components/MobileMenu/components/MobileDropDownButton/index.js.map +1 -1
- package/dist/esm/components/builtin/Navigation/components/MobileMenu/index.js.map +1 -1
- package/dist/esm/components/builtin/Navigation/register.js +41 -16
- package/dist/esm/components/builtin/Navigation/register.js.map +1 -1
- package/dist/esm/components/builtin/SocialLinks/SocialLinks.js.map +1 -1
- package/dist/esm/components/builtin/SocialLinks/components/SocialLinksPlaceholder/index.js.map +1 -1
- package/dist/esm/components/builtin/SocialLinks/register.js +3 -2
- package/dist/esm/components/builtin/SocialLinks/register.js.map +1 -1
- package/dist/esm/components/builtin/Video/register.js +2 -1
- package/dist/esm/components/builtin/Video/register.js.map +1 -1
- package/dist/esm/components/hooks/index.js +2 -0
- package/dist/esm/components/hooks/index.js.map +1 -1
- package/dist/esm/components/hooks/useBorder.js +5 -3
- package/dist/esm/components/hooks/useBorder.js.map +1 -1
- package/dist/esm/components/hooks/useBoxShadow.js +9 -5
- package/dist/esm/components/hooks/useBoxShadow.js.map +1 -1
- package/dist/esm/components/hooks/useCheckboxPropControllerData.js +12 -0
- package/dist/esm/components/hooks/useCheckboxPropControllerData.js.map +1 -0
- package/dist/esm/components/hooks/useLinkPropControllerData.js +12 -0
- package/dist/esm/components/hooks/useLinkPropControllerData.js.map +1 -0
- package/dist/esm/components/hooks/useNumberPropControllerData.js +10 -0
- package/dist/esm/components/hooks/useNumberPropControllerData.js.map +1 -0
- package/dist/esm/components/hooks/useResponsiveColor.js +2 -2
- package/dist/esm/components/hooks/useResponsiveColor.js.map +1 -1
- package/dist/esm/components/hooks/useResponsiveColorPropControllerData.js +12 -0
- package/dist/esm/components/hooks/useResponsiveColorPropControllerData.js.map +1 -0
- package/dist/esm/components/hooks/useResponsiveLengthPropControllerData.js +12 -0
- package/dist/esm/components/hooks/useResponsiveLengthPropControllerData.js.map +1 -0
- package/dist/esm/components/shared/GutterContainer/index.js.map +1 -1
- package/dist/esm/components/shared/Link/index.js.map +1 -1
- package/dist/esm/components/shared/grid-item.js.map +1 -1
- package/dist/esm/components/utils/responsive-style.js.map +1 -1
- package/dist/esm/controls/control.js +5 -4
- package/dist/esm/controls/control.js.map +1 -1
- package/dist/esm/controls/rich-text/introspection.js +2 -9
- package/dist/esm/controls/rich-text/introspection.js.map +1 -1
- package/dist/esm/css/border.js.map +1 -1
- package/dist/esm/next/api-handler/handlers/manifest.js +1 -1
- package/dist/esm/prop-controllers/copy/navigation-links.js +2 -2
- package/dist/esm/prop-controllers/copy/navigation-links.js.map +1 -1
- package/dist/esm/prop-controllers/copy.js +13 -10
- package/dist/esm/prop-controllers/copy.js.map +1 -1
- package/dist/esm/prop-controllers/descriptors.js +0 -58
- package/dist/esm/prop-controllers/descriptors.js.map +1 -1
- package/dist/esm/prop-controllers/index.js.map +1 -1
- package/dist/esm/prop-controllers/introspection.js +15 -35
- package/dist/esm/prop-controllers/introspection.js.map +1 -1
- package/dist/esm/runtimes/react/controls.js +72 -17
- package/dist/esm/runtimes/react/controls.js.map +1 -1
- package/dist/types/builder/serialization/control-serialization.d.ts +34 -48
- package/dist/types/builder/serialization/control-serialization.d.ts.map +1 -1
- package/dist/types/components/builtin/Box/Box.d.ts.map +1 -1
- package/dist/types/components/builtin/Box/register.d.ts.map +1 -1
- package/dist/types/components/builtin/Button/Button.d.ts +3 -2
- package/dist/types/components/builtin/Button/Button.d.ts.map +1 -1
- package/dist/types/components/builtin/Button/register.d.ts.map +1 -1
- package/dist/types/components/builtin/Carousel/Carousel.d.ts +5 -5
- package/dist/types/components/builtin/Carousel/Carousel.d.ts.map +1 -1
- package/dist/types/components/builtin/Carousel/register.d.ts.map +1 -1
- package/dist/types/components/builtin/Countdown/Countdown.d.ts.map +1 -1
- package/dist/types/components/builtin/Countdown/register.d.ts.map +1 -1
- package/dist/types/components/builtin/Divider/Divider.d.ts +3 -2
- package/dist/types/components/builtin/Divider/Divider.d.ts.map +1 -1
- package/dist/types/components/builtin/Divider/register.d.ts.map +1 -1
- package/dist/types/components/builtin/Form/Form.d.ts +4 -3
- package/dist/types/components/builtin/Form/Form.d.ts.map +1 -1
- package/dist/types/components/builtin/Form/context/FormContext.d.ts +2 -1
- package/dist/types/components/builtin/Form/context/FormContext.d.ts.map +1 -1
- package/dist/types/components/builtin/Form/register.d.ts.map +1 -1
- package/dist/types/components/builtin/Image/Image.d.ts +3 -2
- package/dist/types/components/builtin/Image/Image.d.ts.map +1 -1
- package/dist/types/components/builtin/Image/register.d.ts.map +1 -1
- package/dist/types/components/builtin/Navigation/Navigation.d.ts +5 -4
- package/dist/types/components/builtin/Navigation/Navigation.d.ts.map +1 -1
- package/dist/types/components/builtin/Navigation/components/DropDownButton/index.d.ts +6 -5
- package/dist/types/components/builtin/Navigation/components/DropDownButton/index.d.ts.map +1 -1
- package/dist/types/components/builtin/Navigation/components/LinksPlaceholder/index.d.ts +2 -2
- package/dist/types/components/builtin/Navigation/components/LinksPlaceholder/index.d.ts.map +1 -1
- package/dist/types/components/builtin/Navigation/components/MobileMenu/components/MobileDropDownButton/index.d.ts +6 -5
- package/dist/types/components/builtin/Navigation/components/MobileMenu/components/MobileDropDownButton/index.d.ts.map +1 -1
- package/dist/types/components/builtin/Navigation/components/MobileMenu/index.d.ts +2 -1
- package/dist/types/components/builtin/Navigation/components/MobileMenu/index.d.ts.map +1 -1
- package/dist/types/components/builtin/Navigation/register.d.ts.map +1 -1
- package/dist/types/components/builtin/SocialLinks/SocialLinks.d.ts.map +1 -1
- package/dist/types/components/builtin/SocialLinks/components/SocialLinksPlaceholder/index.d.ts +2 -2
- package/dist/types/components/builtin/SocialLinks/components/SocialLinksPlaceholder/index.d.ts.map +1 -1
- package/dist/types/components/builtin/SocialLinks/register.d.ts.map +1 -1
- package/dist/types/components/builtin/Video/register.d.ts.map +1 -1
- package/dist/types/components/hooks/index.d.ts +2 -0
- package/dist/types/components/hooks/index.d.ts.map +1 -1
- package/dist/types/components/hooks/useBorder.d.ts +2 -2
- package/dist/types/components/hooks/useBorder.d.ts.map +1 -1
- package/dist/types/components/hooks/useBoxShadow.d.ts +14 -14
- package/dist/types/components/hooks/useBoxShadow.d.ts.map +1 -1
- package/dist/types/components/hooks/useCheckboxPropControllerData.d.ts +3 -0
- package/dist/types/components/hooks/useCheckboxPropControllerData.d.ts.map +1 -0
- package/dist/types/components/hooks/useLinkPropControllerData.d.ts +3 -0
- package/dist/types/components/hooks/useLinkPropControllerData.d.ts.map +1 -0
- package/dist/types/components/hooks/useNumberPropControllerData.d.ts +3 -0
- package/dist/types/components/hooks/useNumberPropControllerData.d.ts.map +1 -0
- package/dist/types/components/hooks/useResponsiveColor.d.ts +2 -4
- package/dist/types/components/hooks/useResponsiveColor.d.ts.map +1 -1
- package/dist/types/components/hooks/useResponsiveColorPropControllerData.d.ts +4 -0
- package/dist/types/components/hooks/useResponsiveColorPropControllerData.d.ts.map +1 -0
- package/dist/types/components/hooks/useResponsiveLengthPropControllerData.d.ts +3 -0
- package/dist/types/components/hooks/useResponsiveLengthPropControllerData.d.ts.map +1 -0
- package/dist/types/components/shared/GutterContainer/index.d.ts +2 -2
- package/dist/types/components/shared/GutterContainer/index.d.ts.map +1 -1
- package/dist/types/components/shared/Link/index.d.ts +1 -1
- package/dist/types/components/shared/Link/index.d.ts.map +1 -1
- package/dist/types/components/shared/grid-item.d.ts +4 -3
- package/dist/types/components/shared/grid-item.d.ts.map +1 -1
- package/dist/types/components/utils/responsive-style.d.ts +8 -7
- package/dist/types/components/utils/responsive-style.d.ts.map +1 -1
- package/dist/types/controls/control.d.ts.map +1 -1
- package/dist/types/controls/rich-text/introspection.d.ts.map +1 -1
- package/dist/types/css/border.d.ts +1 -1
- package/dist/types/css/border.d.ts.map +1 -1
- package/dist/types/prop-controllers/copy/navigation-links.d.ts.map +1 -1
- package/dist/types/prop-controllers/copy.d.ts.map +1 -1
- package/dist/types/prop-controllers/descriptors.d.ts +21 -263
- package/dist/types/prop-controllers/descriptors.d.ts.map +1 -1
- package/dist/types/prop-controllers/index.d.ts +2 -1
- package/dist/types/prop-controllers/index.d.ts.map +1 -1
- package/dist/types/prop-controllers/introspection.d.ts +1 -4
- package/dist/types/prop-controllers/introspection.d.ts.map +1 -1
- package/dist/types/runtimes/react/controls.d.ts +5 -7
- package/dist/types/runtimes/react/controls.d.ts.map +1 -1
- package/package.json +2 -1
- package/dist/cjs/prop-controllers/copy/border.js +0 -53
- package/dist/cjs/prop-controllers/copy/border.js.map +0 -1
- package/dist/cjs/prop-controllers/copy/link.js +0 -63
- package/dist/cjs/prop-controllers/copy/link.js.map +0 -1
- package/dist/cjs/prop-controllers/copy/responsive-color.js.map +0 -1
- package/dist/cjs/prop-controllers/copy/shadows.js.map +0 -1
- package/dist/esm/prop-controllers/copy/border.js +0 -29
- package/dist/esm/prop-controllers/copy/border.js.map +0 -1
- package/dist/esm/prop-controllers/copy/link.js +0 -39
- package/dist/esm/prop-controllers/copy/link.js.map +0 -1
- package/dist/esm/prop-controllers/copy/responsive-color.js +0 -15
- package/dist/esm/prop-controllers/copy/responsive-color.js.map +0 -1
- package/dist/esm/prop-controllers/copy/shadows.js +0 -24
- package/dist/esm/prop-controllers/copy/shadows.js.map +0 -1
- package/dist/types/prop-controllers/copy/border.d.ts +0 -4
- package/dist/types/prop-controllers/copy/border.d.ts.map +0 -1
- package/dist/types/prop-controllers/copy/border.test.d.ts +0 -2
- package/dist/types/prop-controllers/copy/border.test.d.ts.map +0 -1
- package/dist/types/prop-controllers/copy/link.d.ts +0 -4
- package/dist/types/prop-controllers/copy/link.d.ts.map +0 -1
- package/dist/types/prop-controllers/copy/responsive-color.d.ts +0 -4
- package/dist/types/prop-controllers/copy/responsive-color.d.ts.map +0 -1
- package/dist/types/prop-controllers/copy/shadows.d.ts +0 -4
- package/dist/types/prop-controllers/copy/shadows.d.ts.map +0 -1
- package/dist/types/prop-controllers/copy/shadows.test.d.ts +0 -2
- package/dist/types/prop-controllers/copy/shadows.test.d.ts.map +0 -1
|
@@ -19,11 +19,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
19
19
|
var descriptors_exports = {};
|
|
20
20
|
__export(descriptors_exports, {
|
|
21
21
|
Backgrounds: () => Backgrounds,
|
|
22
|
-
Border: () => Border,
|
|
23
|
-
BorderPropControllerFormat: () => BorderPropControllerFormat,
|
|
24
|
-
BorderRadius: () => BorderRadius,
|
|
25
|
-
BorderRadiusPropControllerFormat: () => BorderRadiusPropControllerFormat,
|
|
26
|
-
Checkbox: () => Checkbox,
|
|
27
22
|
Date: () => Date,
|
|
28
23
|
ElementID: () => ElementID,
|
|
29
24
|
Font: () => Font,
|
|
@@ -32,23 +27,17 @@ __export(descriptors_exports, {
|
|
|
32
27
|
Grid: () => Grid,
|
|
33
28
|
Image: () => Image,
|
|
34
29
|
Images: () => Images,
|
|
35
|
-
Link: () => Link,
|
|
36
30
|
List: () => List,
|
|
37
31
|
Margin: () => Margin,
|
|
38
32
|
MarginPropControllerFormat: () => MarginPropControllerFormat,
|
|
39
33
|
NavigationLinks: () => NavigationLinks,
|
|
40
|
-
Number: () => Number,
|
|
41
34
|
Padding: () => Padding,
|
|
42
35
|
PaddingPropControllerFormat: () => PaddingPropControllerFormat,
|
|
43
|
-
ResponsiveColor: () => ResponsiveColor,
|
|
44
36
|
ResponsiveIconRadioGroup: () => ResponsiveIconRadioGroup,
|
|
45
|
-
ResponsiveLength: () => ResponsiveLength,
|
|
46
37
|
ResponsiveNumber: () => ResponsiveNumber,
|
|
47
38
|
ResponsiveOpacity: () => ResponsiveOpacity,
|
|
48
39
|
ResponsiveSelect: () => ResponsiveSelect,
|
|
49
40
|
RichText: () => RichText,
|
|
50
|
-
Shadows: () => Shadows,
|
|
51
|
-
ShadowsPropControllerFormat: () => ShadowsPropControllerFormat,
|
|
52
41
|
Shape: () => Shape,
|
|
53
42
|
SocialLinks: () => SocialLinks,
|
|
54
43
|
Table: () => Table,
|
|
@@ -82,9 +71,6 @@ var import_style2 = require("../controls/style");
|
|
|
82
71
|
var import_introspection = require("./introspection");
|
|
83
72
|
const Types = {
|
|
84
73
|
Backgrounds: "Backgrounds",
|
|
85
|
-
Border: "Border",
|
|
86
|
-
BorderRadius: "BorderRadius",
|
|
87
|
-
Checkbox: "Checkbox",
|
|
88
74
|
Date: "Date",
|
|
89
75
|
ElementID: "ElementID",
|
|
90
76
|
Font: "Font",
|
|
@@ -93,20 +79,15 @@ const Types = {
|
|
|
93
79
|
Grid: "Grid",
|
|
94
80
|
Image: "Image",
|
|
95
81
|
Images: "Images",
|
|
96
|
-
Link: "Link",
|
|
97
82
|
List: "List",
|
|
98
83
|
Margin: "Margin",
|
|
99
84
|
NavigationLinks: "NavigationLinks",
|
|
100
|
-
Number: "Number",
|
|
101
85
|
Padding: "Padding",
|
|
102
|
-
ResponsiveColor: "ResponsiveColor",
|
|
103
86
|
ResponsiveIconRadioGroup: "ResponsiveIconRadioGroup",
|
|
104
|
-
ResponsiveLength: "ResponsiveLength",
|
|
105
87
|
ResponsiveNumber: "ResponsiveNumber",
|
|
106
88
|
ResponsiveOpacity: "ResponsiveOpacity",
|
|
107
89
|
ResponsiveSelect: "ResponsiveSelect",
|
|
108
90
|
RichText: "RichText",
|
|
109
|
-
Shadows: "Shadows",
|
|
110
91
|
Shape: "Shape",
|
|
111
92
|
SocialLinks: "SocialLinks",
|
|
112
93
|
Table: "Table",
|
|
@@ -122,25 +103,6 @@ const Types = {
|
|
|
122
103
|
function Backgrounds(options = {}) {
|
|
123
104
|
return { type: Types.Backgrounds, version: 1, options };
|
|
124
105
|
}
|
|
125
|
-
const BorderPropControllerFormat = {
|
|
126
|
-
ClassName: "makeswift::prop-controllers::border::format::class-name",
|
|
127
|
-
ResponsiveValue: "makeswift::prop-controllers:border::format::responsive-value"
|
|
128
|
-
};
|
|
129
|
-
function Border(options = {}) {
|
|
130
|
-
return { type: Types.Border, options };
|
|
131
|
-
}
|
|
132
|
-
Border.Format = BorderPropControllerFormat;
|
|
133
|
-
const BorderRadiusPropControllerFormat = {
|
|
134
|
-
ClassName: "makeswift::prop-controllers::border-radius::format::class-name",
|
|
135
|
-
ResponsiveValue: "makeswift::prop-controllers::border-radius::format::responsive-value"
|
|
136
|
-
};
|
|
137
|
-
function BorderRadius(options = {}) {
|
|
138
|
-
return { type: Types.BorderRadius, options };
|
|
139
|
-
}
|
|
140
|
-
BorderRadius.Format = BorderRadiusPropControllerFormat;
|
|
141
|
-
function Checkbox(options) {
|
|
142
|
-
return { type: Types.Checkbox, options };
|
|
143
|
-
}
|
|
144
106
|
function Date(options = {}) {
|
|
145
107
|
return { type: Types.Date, options };
|
|
146
108
|
}
|
|
@@ -171,9 +133,6 @@ function Image(options = {}) {
|
|
|
171
133
|
function Images(options = {}) {
|
|
172
134
|
return { type: Types.Images, version: 1, options };
|
|
173
135
|
}
|
|
174
|
-
function Link(options = {}) {
|
|
175
|
-
return { type: Types.Link, options };
|
|
176
|
-
}
|
|
177
136
|
function List(options) {
|
|
178
137
|
return { type: Types.List, options };
|
|
179
138
|
}
|
|
@@ -208,9 +167,6 @@ Margin.Format = MarginPropControllerFormat;
|
|
|
208
167
|
function NavigationLinks(options = {}) {
|
|
209
168
|
return { type: Types.NavigationLinks, options };
|
|
210
169
|
}
|
|
211
|
-
function Number(options = {}) {
|
|
212
|
-
return { type: Types.Number, options };
|
|
213
|
-
}
|
|
214
170
|
const PaddingPropControllerFormat = {
|
|
215
171
|
ClassName: "makeswift::prop-controllers::padding::format::class-name",
|
|
216
172
|
ResponsiveValue: "makeswift::prop-controllers::padding::format::responsive-value"
|
|
@@ -219,15 +175,9 @@ function Padding(options = {}) {
|
|
|
219
175
|
return { type: Types.Padding, options };
|
|
220
176
|
}
|
|
221
177
|
Padding.Format = PaddingPropControllerFormat;
|
|
222
|
-
function ResponsiveColor(options = {}) {
|
|
223
|
-
return { type: Types.ResponsiveColor, options };
|
|
224
|
-
}
|
|
225
178
|
function ResponsiveIconRadioGroup(options) {
|
|
226
179
|
return { type: Types.ResponsiveIconRadioGroup, options };
|
|
227
180
|
}
|
|
228
|
-
function ResponsiveLength(options = {}) {
|
|
229
|
-
return { type: Types.ResponsiveLength, options };
|
|
230
|
-
}
|
|
231
181
|
function ResponsiveNumber(options = {}) {
|
|
232
182
|
return { type: Types.ResponsiveNumber, options };
|
|
233
183
|
}
|
|
@@ -240,14 +190,6 @@ function ResponsiveSelect(options) {
|
|
|
240
190
|
function RichText(options = {}) {
|
|
241
191
|
return { type: Types.RichText, options };
|
|
242
192
|
}
|
|
243
|
-
const ShadowsPropControllerFormat = {
|
|
244
|
-
ClassName: "makeswift::prop-controllers::shadows::format::class-name",
|
|
245
|
-
ResponsiveValue: "makeswift::prop-controllers::shadows::format::responsive-value"
|
|
246
|
-
};
|
|
247
|
-
function Shadows(options = {}) {
|
|
248
|
-
return { type: Types.Shadows, options };
|
|
249
|
-
}
|
|
250
|
-
Shadows.Format = ShadowsPropControllerFormat;
|
|
251
193
|
function Shape(options) {
|
|
252
194
|
return { type: Types.Shape, options };
|
|
253
195
|
}
|
|
@@ -334,11 +276,6 @@ Width.Format = WidthPropControllerFormat;
|
|
|
334
276
|
// Annotate the CommonJS export names for ESM import in node:
|
|
335
277
|
0 && (module.exports = {
|
|
336
278
|
Backgrounds,
|
|
337
|
-
Border,
|
|
338
|
-
BorderPropControllerFormat,
|
|
339
|
-
BorderRadius,
|
|
340
|
-
BorderRadiusPropControllerFormat,
|
|
341
|
-
Checkbox,
|
|
342
279
|
Date,
|
|
343
280
|
ElementID,
|
|
344
281
|
Font,
|
|
@@ -347,23 +284,17 @@ Width.Format = WidthPropControllerFormat;
|
|
|
347
284
|
Grid,
|
|
348
285
|
Image,
|
|
349
286
|
Images,
|
|
350
|
-
Link,
|
|
351
287
|
List,
|
|
352
288
|
Margin,
|
|
353
289
|
MarginPropControllerFormat,
|
|
354
290
|
NavigationLinks,
|
|
355
|
-
Number,
|
|
356
291
|
Padding,
|
|
357
292
|
PaddingPropControllerFormat,
|
|
358
|
-
ResponsiveColor,
|
|
359
293
|
ResponsiveIconRadioGroup,
|
|
360
|
-
ResponsiveLength,
|
|
361
294
|
ResponsiveNumber,
|
|
362
295
|
ResponsiveOpacity,
|
|
363
296
|
ResponsiveSelect,
|
|
364
297
|
RichText,
|
|
365
|
-
Shadows,
|
|
366
|
-
ShadowsPropControllerFormat,
|
|
367
298
|
Shape,
|
|
368
299
|
SocialLinks,
|
|
369
300
|
Table,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/prop-controllers/descriptors.ts"],"sourcesContent":["import {\n ResolveBorderControlValue,\n ResolveBorderRadiusControlValue,\n ResolveMarginControlValue,\n ResolvePaddingControlValue,\n ResolveShadowsControlValue,\n ResolveWidthControlValue,\n} from '../runtimes/react/controls'\nimport { StyleControlFormattedValue } from '../runtimes/react/controls/style'\nimport type { Element, Data, MergeTranslatableDataContext } from '../state/react-page'\nimport type { ResponsiveColor } from '../runtimes/react/controls'\nimport { NumberControlDefinition } from '../controls/number'\nimport { NumberControlValue } from '../runtimes/react/controls/number'\nimport { StyleControlType } from '../controls/style'\nimport {\n CheckboxControlDefinition,\n ColorControlDefinition,\n ComboboxControlDefinition,\n ImageControlDefinition,\n LinkControlDefinition,\n ListControlDefinition,\n SelectControlDefinition,\n ShapeControlDefinition,\n SlotControlDefinition,\n TextAreaControlDefinition,\n TextInputControlDefinition,\n StyleControlDefinition,\n RichTextV2ControlDefinition,\n StyleV2ControlDefinition,\n TypographyControlDefinition,\n} from '../controls'\nimport { TextInputControlValue } from '../runtimes/react/controls/text-input'\nimport { TextAreaControlValue } from '../runtimes/react/controls/text-area'\nimport { ColorControlValue } from '../runtimes/react/controls/color'\nimport { SelectControlValue } from '../runtimes/react/controls/select'\nimport { CheckboxControlValue } from '../runtimes/react/controls/checkbox'\nimport { ResolveImageControlValue } from '../runtimes/react/controls/image'\nimport { ShapeControlValue } from '../runtimes/react/controls/shape'\nimport { ListControlValue } from '../runtimes/react/controls/list'\nimport { ComboboxControlValue } from '../runtimes/react/controls/combobox'\nimport { LinkControlValue } from '../runtimes/react/controls/link'\nimport { SlotControlValue } from '../runtimes/react/controls/slot'\nimport { RichTextControlDefinition, RichTextDTO } from '../controls/rich-text'\nimport { RichTextControlValue } from '../runtimes/react/controls/rich-text/rich-text'\nimport { RichTextV2ControlValue } from '../runtimes/react/controls/rich-text-v2'\nimport { StyleV2ControlFormattedValue } from '../runtimes/react/controls/style-v2'\nimport { IconRadioGroupControlDefinition } from '../controls/icon-radio-group'\nimport { IconRadioGroupControlValue } from '../runtimes/react/controls/icon-radio-group'\nimport { TypographyControlValue } from '../runtimes/react/controls/typography'\nimport {\n getElementChildren,\n getFileIds,\n getPageIds,\n getSwatchIds,\n getTypographyIds,\n} from './introspection'\n\nexport type { Data }\n\n// See https://github.com/microsoft/TypeScript/issues/15300\nexport type IndexSignatureHack<T> = T extends Record<string, any>\n ? { [K in keyof T]: IndexSignatureHack<T[K]> }\n : T\n\nexport type Device = string\n\nexport type DeviceOverride<T> = { deviceId: Device; value: T }\n\nexport type ResponsiveValue<T> = DeviceOverride<T>[]\n\nexport type ResponsiveValueType<T> = T extends ResponsiveValue<infer U> ? U : never\n\ntype Color = { swatchId: string; alpha: number }\n\ntype IconName =\n | 'HeightAuto16'\n | 'HeightMatch16'\n | 'VerticalAlignStart16'\n | 'VerticalAlignMiddle16'\n | 'VerticalAlignEnd16'\n | 'VerticalAlignSpaceBetween16'\n | 'ButtonPill16'\n | 'ButtonRounded16'\n | 'ButtonSquare16'\n | 'SizeSmall16'\n | 'SizeMedium16'\n | 'SizeLarge16'\n | 'ArrowInside16'\n | 'ArrowCenter16'\n | 'ArrowOutside16'\n | 'CountdownSolid16'\n | 'CountdownSolidSplit16'\n | 'CountdownOutline16'\n | 'CountdownOutlineSplit16'\n | 'CountdownNaked16'\n | 'Sun16'\n | 'Moon16'\n | 'AlignLeft16'\n | 'AlignCenter16'\n | 'AlignRight16'\n | 'Star16'\n | 'StarCircle16'\n | 'StarRoundedSquare16'\n | 'StarSquare16'\n\nexport type Gap = { value: number; unit: 'px' }\n\nexport type Length = { value: number; unit: 'px' | '%' }\n\ntype OpenPageLink = {\n type: 'OPEN_PAGE'\n payload: { pageId: string | null | undefined; openInNewTab: boolean }\n}\n\ntype OpenURLLink = { type: 'OPEN_URL'; payload: { url: string; openInNewTab: boolean } }\n\ntype SendEmailLink = {\n type: 'SEND_EMAIL'\n payload: { to: string; subject?: string; body?: string }\n}\n\ntype CallPhoneLink = { type: 'CALL_PHONE'; payload: { phoneNumber: string } }\n\ntype ScrollToElementLink = {\n type: 'SCROLL_TO_ELEMENT'\n payload: {\n elementIdConfig: { elementKey: string; propName: string } | null | undefined\n block: 'start' | 'center' | 'end'\n }\n}\n\ntype Link = OpenPageLink | OpenURLLink | SendEmailLink | CallPhoneLink | ScrollToElementLink\n\ntype TextStyle = {\n fontFamily?: string | null | undefined\n letterSpacing: number | null | undefined\n fontSize: { value: number; unit: 'px' } | null | undefined\n fontWeight: number | null | undefined\n textTransform: 'uppercase'[]\n fontStyle: 'italic'[]\n}\n\nexport const Types = {\n Backgrounds: 'Backgrounds',\n Border: 'Border',\n BorderRadius: 'BorderRadius',\n Checkbox: 'Checkbox',\n Date: 'Date',\n ElementID: 'ElementID',\n Font: 'Font',\n GapX: 'GapX',\n GapY: 'GapY',\n Grid: 'Grid',\n Image: 'Image',\n Images: 'Images',\n Link: 'Link',\n List: 'List',\n Margin: 'Margin',\n NavigationLinks: 'NavigationLinks',\n Number: 'Number',\n Padding: 'Padding',\n ResponsiveColor: 'ResponsiveColor',\n ResponsiveIconRadioGroup: 'ResponsiveIconRadioGroup',\n ResponsiveLength: 'ResponsiveLength',\n ResponsiveNumber: 'ResponsiveNumber',\n ResponsiveOpacity: 'ResponsiveOpacity',\n ResponsiveSelect: 'ResponsiveSelect',\n RichText: 'RichText',\n Shadows: 'Shadows',\n Shape: 'Shape',\n SocialLinks: 'SocialLinks',\n Table: 'Table',\n TableFormFields: 'TableFormFields',\n Typeahead: 'Typeahead',\n TextArea: 'TextArea',\n TextInput: 'TextInput',\n TextStyle: 'TextStyle',\n Video: 'Video',\n Width: 'Width',\n Style: StyleControlType,\n} as const\n\ntype Options<T> = T | ((props: Record<string, unknown>, deviceMode: Device) => T)\n\nexport type ResolveOptions<T extends Options<unknown>> = T extends Options<infer U> ? U : never\n\ntype ColorBackground = { type: 'color'; id: string; payload: Color | null }\n\ntype GradientStop = { id: string; location: number; color: Color | null }\n\ntype Gradient = { angle?: number; isRadial?: boolean; stops: GradientStop[] }\n\ntype GradientBackground = { type: 'gradient'; id: string; payload: Gradient }\n\ntype BackgroundImagePosition = { x: number; y: number }\n\ntype BackgroundImageSize = 'cover' | 'contain' | 'auto'\n\ntype BackgroundImageRepeat = 'no-repeat' | 'repeat-x' | 'repeat-y' | 'repeat'\n\ntype BackgroundImageV0 = {\n imageId: ImageValueV0\n position: BackgroundImagePosition\n size?: BackgroundImageSize\n repeat?: BackgroundImageRepeat\n opacity?: number\n parallax?: number\n priority?: boolean\n}\n\ntype BackgroundImageV1 = {\n version: 1\n image: ImageValueV1\n position: BackgroundImagePosition\n size?: BackgroundImageSize\n repeat?: BackgroundImageRepeat\n opacity?: number\n parallax?: number\n priority?: boolean\n}\n\nexport type BackgroundImage = BackgroundImageV0 | BackgroundImageV1\n\ntype ImageBackgroundV0 = { type: 'image'; id: string; payload: BackgroundImageV0 }\n\ntype ImageBackgroundV1 = { type: 'image-v1'; id: string; payload: BackgroundImageV1 }\n\nexport type ImageBackground = ImageBackgroundV0 | ImageBackgroundV1\n\ntype BackgroundVideoAspectRatio = 'wide' | 'standard'\n\ntype BackgroundVideo = {\n url?: string\n maskColor?: Color | null\n opacity?: number\n zoom?: number\n aspectRatio?: BackgroundVideoAspectRatio\n parallax?: number\n}\n\ntype VideoBackground = { type: 'video'; id: string; payload: BackgroundVideo }\n\ntype Background = ColorBackground | GradientBackground | ImageBackground | VideoBackground\n\nexport type BackgroundsValue = ResponsiveValue<Background[]>\n\ntype BackgroundsOptions = Options<Record<string, never>>\n\nexport type BackgroundsDescriptor<_T = BackgroundsValue> = {\n type: typeof Types.Backgrounds\n version?: 1\n options: BackgroundsOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Backgrounds(options: BackgroundsOptions = {}): BackgroundsDescriptor {\n return { type: Types.Backgrounds, version: 1, options }\n}\n\ntype BorderSideStyle = 'dashed' | 'dotted' | 'solid'\n\nexport type BorderSide = {\n width: number | null | undefined\n style: BorderSideStyle\n color?: Color | null\n}\n\ntype Border = {\n [K in 'top' | 'right' | 'bottom' | 'left' as `border${Capitalize<K>}`]:\n | BorderSide\n | null\n | undefined\n}\n\nexport type BorderValue = ResponsiveValue<Border>\n\nexport const BorderPropControllerFormat = {\n ClassName: 'makeswift::prop-controllers::border::format::class-name',\n ResponsiveValue: 'makeswift::prop-controllers:border::format::responsive-value',\n} as const\n\nexport type BorderPropControllerFormat =\n typeof BorderPropControllerFormat[keyof typeof BorderPropControllerFormat]\n\ntype BorderOptions = { format?: BorderPropControllerFormat }\n\nexport type BorderDescriptor<_T = BorderValue, U extends BorderOptions = BorderOptions> = {\n type: typeof Types.Border\n options: U\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Border<T extends BorderOptions>(\n options: T & BorderOptions = {} as T,\n): BorderDescriptor<BorderValue, T> {\n return { type: Types.Border, options }\n}\n\nBorder.Format = BorderPropControllerFormat\n\ntype BorderRadius = {\n [K in 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' as `border${Capitalize<K>}Radius`]:\n | Length\n | null\n | undefined\n}\n\nexport type BorderRadiusValue = ResponsiveValue<BorderRadius>\n\nexport const BorderRadiusPropControllerFormat = {\n ClassName: 'makeswift::prop-controllers::border-radius::format::class-name',\n ResponsiveValue: 'makeswift::prop-controllers::border-radius::format::responsive-value',\n} as const\n\nexport type BorderRadiusPropControllerFormat =\n typeof BorderRadiusPropControllerFormat[keyof typeof BorderRadiusPropControllerFormat]\n\ntype BorderRadiusOptions = { format?: BorderRadiusPropControllerFormat }\n\nexport type BorderRadiusDescriptor<\n _T = BorderRadiusValue,\n U extends BorderRadiusOptions = BorderRadiusOptions,\n> = {\n type: typeof Types.BorderRadius\n options: U\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function BorderRadius<T extends BorderRadiusOptions>(\n options: T & BorderRadiusOptions = {} as T,\n): BorderRadiusDescriptor<BorderRadiusValue, T> {\n return { type: Types.BorderRadius, options }\n}\n\nBorderRadius.Format = BorderRadiusPropControllerFormat\n\nexport type CheckboxValue = boolean\n\nexport type CheckboxOptions = Options<{\n preset?: CheckboxValue\n label: string\n hidden?: boolean\n}>\n\nexport type CheckboxDescriptor<_T = CheckboxValue> = {\n type: typeof Types.Checkbox\n options: CheckboxOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Checkbox(options: CheckboxOptions): CheckboxDescriptor {\n return { type: Types.Checkbox, options }\n}\n\nexport type DateValue = string\n\nexport type DateOptions = Options<{ preset?: DateValue }>\n\nexport type DateDescriptor<_T = DateValue> = { type: typeof Types.Date; options: DateOptions }\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Date(options: DateOptions = {}): DateDescriptor {\n return { type: Types.Date, options }\n}\n\nexport type ElementIDValue = string\n\ntype ElementIDOptions = Options<Record<string, never>>\n\ntype ElementIDDescriptor<_T = ElementIDValue> = {\n type: typeof Types.ElementID\n options: ElementIDOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function ElementID(options: ElementIDOptions = {}): ElementIDDescriptor {\n return { type: Types.ElementID, options }\n}\n\nexport type FontValue = ResponsiveValue<string>\n\ntype FontOptions = Options<{ preset?: FontValue; label?: string }>\n\ntype FontDescriptor<_T = FontValue> = { type: typeof Types.Font; options: FontOptions }\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Font(options: FontOptions = {}): FontDescriptor {\n return { type: Types.Font, options }\n}\n\nexport type GapXValue = ResponsiveValue<Gap>\n\nexport type GapXOptions = Options<{\n preset?: GapXValue\n label?: string\n defaultValue?: Gap\n min?: number\n max?: number\n step?: number\n hidden?: boolean\n}>\n\nexport type GapXDescriptor<_T = GapXValue> = { type: typeof Types.GapX; options: GapXOptions }\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function GapX(options: GapXOptions = {}): GapXDescriptor {\n return { type: Types.GapX, options }\n}\n\nexport type GapYValue = ResponsiveValue<Gap>\n\nexport type GapYOptions = Options<{\n preset?: GapYValue\n label?: string\n defaultValue?: Gap\n step?: number\n min?: number\n max?: number\n hidden?: boolean\n}>\n\nexport type GapYDescriptor<_T = GapYValue> = { type: typeof Types.GapY; options: GapYOptions }\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function GapY(options: GapYOptions = {}): GapYDescriptor {\n return { type: Types.GapY, options }\n}\n\ntype GridColumn = { count: number; spans: number[][] }\n\nexport type GridValue = { elements: Element[]; columns: ResponsiveValue<GridColumn> }\n\ntype GridOptions = Options<Record<string, never>>\n\ntype GridDescriptor<_T = GridValue> = { type: typeof Types.Grid; options: GridOptions }\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Grid(options: GridOptions = {}): GridDescriptor {\n return { type: Types.Grid, options }\n}\n\nexport function mergeGridPropControllerTranslatedData(\n data: GridValue,\n context: MergeTranslatableDataContext,\n) {\n return {\n ...data,\n elements: data.elements.map(element => context.mergeTranslatedData(element)),\n }\n}\n\nexport type ImageValueV0 = string\n\ntype ImageValueV1MakeswiftFile = {\n version: 1\n type: 'makeswift-file'\n id: string\n}\n\ntype ImageValueV1ExternalFile = {\n version: 1\n type: 'external-file'\n url: string\n width?: number | null\n height?: number | null\n}\n\nexport type ImageValueV1 = ImageValueV1MakeswiftFile | ImageValueV1ExternalFile\n\nexport type ImageValue = ImageValueV0 | ImageValueV1\n\nexport type ImageOptions = Options<{ label?: string; hidden?: boolean }>\n\nexport type ImageDescriptor<_T = ImageValue> = {\n type: typeof Types.Image\n version?: 1\n options: ImageOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Image(options: ImageOptions = {}): ImageDescriptor {\n return { type: Types.Image, version: 1, options }\n}\n\nexport type ImagesValueV0Item = {\n key: string\n props: {\n link?: Link\n file?: ImageValueV0\n altText?: string\n }\n}\n\nexport type ImagesValueV1Item = {\n key: string\n version: 1\n props: {\n link?: Link\n file?: ImageValueV1\n altText?: string\n }\n}\n\nexport type ImagesValueItem = ImagesValueV0Item | ImagesValueV1Item\n\nexport type ImagesValue = ImagesValueItem[]\n\ntype ImagesOptions = Options<{ preset?: ImagesValue }>\n\nexport type ImagesDescriptor<_T = ImagesValue> = {\n type: typeof Types.Images\n version?: 1\n options: ImagesOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Images(options: ImagesOptions = {}): ImagesDescriptor {\n return { type: Types.Images, version: 1, options }\n}\n\nexport type LinkValue = Link\n\nexport type LinkOptions = Options<{\n preset?: LinkValue\n label?: string\n defaultValue?: Link\n options?: { value: Link['type']; label: string }[]\n hidden?: boolean\n}>\n\nexport type LinkDescriptor<_T = LinkValue> = { type: typeof Types.Link; options: LinkOptions }\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Link(options: LinkOptions = {}): LinkDescriptor {\n return { type: Types.Link, options }\n}\n\ntype ListValueItem<T extends Data> = { id: string; value?: T }\n\nexport type ListValue<T extends Data = Data> = ListValueItem<T>[]\n\nexport type ListOptions<T extends Data> = {\n type: PanelDescriptor<T>\n label?: string\n getItemLabel?: ((value: T | undefined) => string) | ((value: T | undefined) => Promise<string>)\n preset?: ListValue<T>\n defaultValue?: ListValue<T>\n}\n\nexport type ListDescriptor<T extends ListValue = ListValue> = {\n type: typeof Types.List\n options: ListOptions<T extends ListValue<infer U> ? U : never>\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function List<T extends Data>(options: ListOptions<T>): ListDescriptor<ListValue<T>> {\n return { type: Types.List, options }\n}\n\nexport function introspectListPropControllerData<T>(\n descriptor: ListDescriptor,\n value: ListValue | undefined,\n func: (definition: Descriptor, data: Data) => T[],\n): T[] {\n if (value == null) return []\n\n return value.flatMap(item => (item.value ? func(descriptor.options.type, item.value) : []))\n}\n\nexport function getListPropControllerElementChildren<T>(\n descriptor: ListDescriptor<T extends ListValue<Data> ? T : ListValue<Data>>,\n value: ListValue | undefined,\n) {\n return introspectListPropControllerData(descriptor, value, getElementChildren)\n}\n\nexport function getListPropControllerSwatchIds<T>(\n descriptor: ListDescriptor<T extends ListValue<Data> ? T : ListValue<Data>>,\n value: ListValue | undefined,\n) {\n return introspectListPropControllerData(descriptor, value, getSwatchIds)\n}\n\nexport function getListPropControllerFileIds<T>(\n descriptor: ListDescriptor<T extends ListValue<Data> ? T : ListValue<Data>>,\n value: ListValue | undefined,\n) {\n return introspectListPropControllerData(descriptor, value, getFileIds)\n}\n\nexport function getListPropControllerTypographyIds<T>(\n descriptor: ListDescriptor<T extends ListValue<Data> ? T : ListValue<Data>>,\n value: ListValue | undefined,\n) {\n return introspectListPropControllerData(descriptor, value, getTypographyIds)\n}\n\nexport function getListPropControllerPageIds<T>(\n descriptor: ListDescriptor<T extends ListValue<Data> ? T : ListValue<Data>>,\n value: ListValue | undefined,\n) {\n return introspectListPropControllerData(descriptor, value, getPageIds)\n}\n\ntype MarginSide = { value: number; unit: 'px' } | 'auto'\n\ntype Margin = {\n [K in 'top' | 'right' | 'bottom' | 'left' as `margin${Capitalize<K>}`]:\n | MarginSide\n | null\n | undefined\n}\n\nexport type MarginValue = ResponsiveValue<Margin>\n\nexport const MarginPropControllerFormat = {\n ClassName: 'makeswift::prop-controllers::margin::format::class-name',\n ResponsiveValue: 'makeswift::prop-controllers::margin::format::responsive-value',\n} as const\n\nexport type MarginPropControllerFormat =\n typeof MarginPropControllerFormat[keyof typeof MarginPropControllerFormat]\n\ntype MarginOptions = { preset?: MarginValue; format?: MarginPropControllerFormat }\n\nexport type MarginDescriptor<_T = MarginValue, U extends MarginOptions = MarginOptions> = {\n type: typeof Types.Margin\n options: U\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Margin<T extends MarginOptions>(\n options: T & MarginOptions = {} as T,\n): MarginDescriptor<MarginValue, T> {\n return { type: Types.Margin, options }\n}\n\nMargin.Format = MarginPropControllerFormat\n\ntype ButtonVariant = 'flat' | 'outline' | 'shadow' | 'clear' | 'blocky' | 'bubbly' | 'skewed'\n\ntype ButtonShape = 'pill' | 'rounded' | 'square'\n\ntype ButtonSize = 'small' | 'medium' | 'large'\n\nexport type NavigationButton = {\n id: string\n type: 'button'\n payload: {\n label: string\n link?: Link\n variant?: ResponsiveValue<ButtonVariant>\n shape?: ResponsiveValue<ButtonShape>\n size?: ResponsiveValue<ButtonSize>\n textColor?: ResponsiveValue<Color>\n color?: ResponsiveValue<Color>\n textStyle?: ResponsiveValue<TextStyle>\n }\n}\n\ntype NavigationDropdownCaretType = 'caret' | 'plus' | 'arrow-down' | 'chevron-down'\n\ntype NavigationDropdownLink = {\n id: string\n payload: {\n label: string\n link?: Link\n color?: ResponsiveValue<Color>\n textStyle?: ResponsiveValue<TextStyle>\n }\n}\n\ntype NavigationDropdown = {\n id: string\n type: 'dropdown'\n payload: {\n label: string\n caret?: NavigationDropdownCaretType\n links?: NavigationDropdownLink[]\n variant?: ResponsiveValue<ButtonVariant>\n shape?: ResponsiveValue<ButtonShape>\n size?: ResponsiveValue<ButtonSize>\n textColor?: ResponsiveValue<Color>\n color?: ResponsiveValue<Color>\n textStyle?: ResponsiveValue<TextStyle>\n }\n}\n\nexport type NavigationLinksValue = (NavigationButton | NavigationDropdown)[]\n\ntype NavigationLinksOptions = Options<Record<string, never>>\n\ntype NavigationLinksDescriptor<_T = NavigationLinksValue> = {\n type: typeof Types.NavigationLinks\n options: NavigationLinksOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function NavigationLinks(options: NavigationLinksOptions = {}): NavigationLinksDescriptor {\n return { type: Types.NavigationLinks, options }\n}\n\nexport type NumberValue = number\n\nexport type NumberOptions = Options<{\n preset?: NumberValue\n label?: string\n defaultValue?: number\n min?: number\n max?: number\n step?: number\n suffix?: string\n hidden?: boolean\n}>\n\nexport type NumberDescriptor<_T = NumberValue> = {\n type: typeof Types.Number\n options: NumberOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Number(options: NumberOptions = {}): NumberDescriptor {\n return { type: Types.Number, options }\n}\n\ntype PaddingSide = { value: number; unit: 'px' }\n\ntype Padding = {\n [K in 'top' | 'right' | 'bottom' | 'left' as `padding${Capitalize<K>}`]:\n | PaddingSide\n | null\n | undefined\n}\n\nexport type PaddingValue = ResponsiveValue<Padding>\n\nexport const PaddingPropControllerFormat = {\n ClassName: 'makeswift::prop-controllers::padding::format::class-name',\n ResponsiveValue: 'makeswift::prop-controllers::padding::format::responsive-value',\n} as const\n\nexport type PaddingPropControllerFormat =\n typeof PaddingPropControllerFormat[keyof typeof PaddingPropControllerFormat]\n\ntype PaddingOptions = { preset?: PaddingValue; format?: PaddingPropControllerFormat }\n\nexport type PaddingDescriptor<_T = PaddingValue, U extends PaddingOptions = PaddingOptions> = {\n type: typeof Types.Padding\n options: U\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Padding<T extends PaddingOptions>(\n options: T & PaddingOptions = {} as T,\n): PaddingDescriptor<PaddingValue, T> {\n return { type: Types.Padding, options }\n}\n\nPadding.Format = PaddingPropControllerFormat\n\nexport type ResponsiveColorValue = ResponsiveValue<Color>\n\ntype ResponsiveColorOptions = Options<{ label?: string; placeholder?: string; hidden?: boolean }>\n\nexport type ResponsiveColorDescriptor<_T = ResponsiveColorValue> = {\n type: typeof Types.ResponsiveColor\n options: ResponsiveColorOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function ResponsiveColor(options: ResponsiveColorOptions = {}): ResponsiveColorDescriptor {\n return { type: Types.ResponsiveColor, options }\n}\n\nexport type IconRadioGroupOption<T extends string> = { value: T; label: string; icon: IconName }\n\nexport type ResponsiveIconRadioGroupValue<T extends string = string> = ResponsiveValue<T>\n\nexport type ResponsiveIconRadioGroupOptions<T extends string = string, U extends T = T> = Options<{\n label?: string\n options: IconRadioGroupOption<T>[]\n defaultValue?: U\n hidden?: boolean\n}>\n\nexport type ResponsiveIconRadioGroupDescriptor<\n T extends ResponsiveIconRadioGroupValue<string> = ResponsiveIconRadioGroupValue<string>,\n> = {\n type: typeof Types.ResponsiveIconRadioGroup\n options: ResponsiveIconRadioGroupOptions<ResponsiveValueType<T>>\n}\n\n// HACK(miguel): We have to use a layer of indirection with `_T` and `T` because otherwise the\n// values provided would undergo type widening. For some reason, the extra layer of indirection\n// reuslts in TypeScript not widening types. Note, this only happens when the returned value of this\n// function is passed to another as an argument, which is common with the `registerComponent` API.\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function ResponsiveIconRadioGroup<_T extends string, T extends _T, U extends T>(\n options: ResponsiveIconRadioGroupOptions<T, U>,\n): ResponsiveIconRadioGroupDescriptor<ResponsiveIconRadioGroupValue<T>> {\n return { type: Types.ResponsiveIconRadioGroup, options }\n}\n\nexport type ResponsiveLengthValue = ResponsiveValue<Length>\n\nexport type LengthOption =\n | { value: 'px'; label: 'Pixels'; icon: 'Px16' }\n | { value: '%'; label: 'Percentage'; icon: 'Percent16' }\n\nexport type ResponsiveLengthOptions = Options<{\n label?: string\n options?: LengthOption[]\n defaultValue?: Length\n hidden?: boolean\n}>\n\nexport type ResponsiveLengthDescriptor<_T = ResponsiveLengthValue> = {\n type: typeof Types.ResponsiveLength\n options: ResponsiveLengthOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function ResponsiveLength(\n options: ResponsiveLengthOptions = {},\n): ResponsiveLengthDescriptor {\n return { type: Types.ResponsiveLength, options }\n}\n\nexport type ResponsiveNumberValue = ResponsiveValue<number>\n\nexport type ResponsiveNumberOptions = Options<{\n label?: string\n defaultValue?: number\n min?: number\n max?: number\n step?: number\n suffix?: string\n hidden?: boolean\n}>\n\nexport type ResponsiveNumberDescriptor<_T = ResponsiveNumberValue> = {\n type: typeof Types.ResponsiveNumber\n options: ResponsiveNumberOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function ResponsiveNumber(\n options: ResponsiveNumberOptions = {},\n): ResponsiveNumberDescriptor {\n return { type: Types.ResponsiveNumber, options }\n}\n\nexport type ResponsiveOpacityValue = ResponsiveValue<number>\n\ntype ResponsiveOpacityOptions = Options<Record<string, never>>\n\ntype ResponsiveOpacityDescriptor<_T = ResponsiveOpacityValue> = {\n type: typeof Types.ResponsiveOpacity\n options: ResponsiveOpacityOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function ResponsiveOpacity(\n options: ResponsiveOpacityOptions = {},\n): ResponsiveOpacityDescriptor {\n return { type: Types.ResponsiveOpacity, options }\n}\n\nexport type ResponsiveSelectValue<T extends string = string> = ResponsiveValue<T>\n\nexport type SelectLabelOrientation = 'vertical' | 'horizontal'\n\nexport type SelectOption<T extends string> = { value: T; label: string }\n\nexport type ResponsiveSelectOptions<T extends string = string, U extends T = T> = Options<{\n label?: string\n labelOrientation?: SelectLabelOrientation\n options: SelectOption<T>[]\n defaultValue?: U\n hidden?: boolean\n}>\n\nexport type ResponsiveSelectDescriptor<\n T extends ResponsiveSelectValue<string> = ResponsiveSelectValue<string>,\n> = {\n type: typeof Types.ResponsiveSelect\n options: ResponsiveSelectOptions<ResponsiveValueType<T>>\n}\n\n// HACK(miguel): We have to use a layer of indirection with `_T` and `T` because otherwise the\n// values provided would undergo type widening. For some reason, the extra layer of indirection\n// reuslts in TypeScript not widening types. Note, this only happens when the returned value of this\n// function is passed to another as an argument, which is common with the `registerComponent` API.\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function ResponsiveSelect<_T extends string, T extends _T, U extends T>(\n options: ResponsiveSelectOptions<T, U>,\n): ResponsiveSelectDescriptor<ResponsiveSelectValue<T>> {\n return { type: Types.ResponsiveSelect, options }\n}\n\nexport type RichTextValue = IndexSignatureHack<RichTextDTO>\n\nexport type RichTextOptions = Options<{ preset?: RichTextValue }>\n\nexport type RichTextDescriptor<_T extends Data = RichTextValue> = {\n type: typeof Types.RichText\n options: RichTextOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function RichText(options: RichTextOptions = {}): RichTextDescriptor {\n return { type: Types.RichText, options }\n}\n\ntype Shadow = {\n color?: Color | null\n blurRadius?: number\n spreadRadius?: number\n offsetX?: number\n offsetY?: number\n inset?: boolean\n}\n\ntype Shadows = { id: string; payload: Shadow }[]\n\nexport type ShadowsValue = ResponsiveValue<Shadows>\n\nexport const ShadowsPropControllerFormat = {\n ClassName: 'makeswift::prop-controllers::shadows::format::class-name',\n ResponsiveValue: 'makeswift::prop-controllers::shadows::format::responsive-value',\n} as const\n\nexport type ShadowsPropControllerFormat =\n typeof ShadowsPropControllerFormat[keyof typeof ShadowsPropControllerFormat]\n\ntype ShadowsOptions = { format?: ShadowsPropControllerFormat }\n\nexport type ShadowsDescriptor<_T = ShadowsValue, U extends ShadowsOptions = ShadowsOptions> = {\n type: typeof Types.Shadows\n options: U\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Shadows<T extends ShadowsOptions>(\n options: T & ShadowsOptions = {} as T,\n): ShadowsDescriptor<ShadowsValue, T> {\n return { type: Types.Shadows, options }\n}\n\nShadows.Format = ShadowsPropControllerFormat\n\nexport type ShapeValue<T extends Data = Data> = Record<string, T>\n\ntype ShapeOptions<T extends Record<string, PanelDescriptor>> = {\n type: T\n preset?: { [K in keyof T]?: DescriptorValueType<T[K]> }\n}\n\nexport type ShapeDescriptor<\n _T extends Record<string, Data>,\n U extends Record<string, PanelDescriptor>,\n> = {\n type: typeof Types.Shape\n options: ShapeOptions<U>\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Shape<T extends Record<string, PanelDescriptor>>(\n options: ShapeOptions<T>,\n): ShapeDescriptor<{ [K in keyof T]?: DescriptorValueType<T[K]> }, T> {\n return { type: Types.Shape, options }\n}\n\nexport function introspectShapePropControllerData<T>(\n descriptor: ShapeDescriptor<Record<string, Data>, Record<string, PanelDescriptor>>,\n value: ShapeValue | undefined,\n func: (definition: Descriptor, data: Data) => T[],\n): T[] {\n if (value == null) return []\n\n return Object.entries(descriptor.options.type).flatMap(([key, definition]) =>\n func(definition, value[key]),\n )\n}\n\nexport function getShapePropControllerElementChildren(\n descriptor: ShapeDescriptor<Record<string, Data>, Record<string, PanelDescriptor>>,\n value: ShapeValue | undefined,\n): Element[] {\n return introspectShapePropControllerData(descriptor, value, getElementChildren)\n}\n\nexport function getShapePropControllerFileIds(\n descriptor: ShapeDescriptor<Record<string, Data>, Record<string, PanelDescriptor>>,\n value: ShapeValue | undefined,\n): string[] {\n return introspectShapePropControllerData(descriptor, value, getFileIds)\n}\n\nexport function getShapePropControllerTypographyIds(\n descriptor: ShapeDescriptor<Record<string, Data>, Record<string, PanelDescriptor>>,\n value: ShapeValue | undefined,\n): string[] {\n return introspectShapePropControllerData(descriptor, value, getTypographyIds)\n}\n\nexport function getShapePropControllerPageIds(\n descriptor: ShapeDescriptor<Record<string, Data>, Record<string, PanelDescriptor>>,\n value: ShapeValue | undefined,\n): string[] {\n return introspectShapePropControllerData(descriptor, value, getPageIds)\n}\n\nexport function getShapePropControllerSwatchIds(\n descriptor: ShapeDescriptor<Record<string, Data>, Record<string, PanelDescriptor>>,\n value: ShapeValue | undefined,\n): string[] {\n return introspectShapePropControllerData(descriptor, value, getSwatchIds)\n}\n\nexport const socialLinkTypesV0 = [\n 'angellist',\n 'codepen',\n 'discord',\n 'dribbble',\n 'facebook',\n 'github',\n 'instagram',\n 'linkedin',\n 'medium',\n 'pinterest',\n 'reddit',\n 'rss',\n 'snapchat',\n 'soundcloud',\n 'spotify',\n 'telegram',\n 'tumblr',\n 'twitch',\n 'twitter',\n 'vimeo',\n 'whatsapp',\n 'yelp',\n 'youtube',\n] as const\n\ntype SocialLinkTypeV0 = typeof socialLinkTypesV0[number]\n\nexport const socialLinkTypesV1 = [...socialLinkTypesV0, 'x', 'slack'] as const\n\ntype SocialLinkTypeV1 = typeof socialLinkTypesV1[number]\n\ntype SocialLinkV0 = { type: SocialLinkTypeV0; url: string }\n\ntype SocialLinkV1 = { type: SocialLinkTypeV1; url: string }\n\ntype SocialLinksLinkV0 = { id: string; payload: SocialLinkV0 }\n\ntype SocialLinksLinkV1 = { id: string; payload: SocialLinkV1 }\n\ntype SocialLinksValueV0 = { links: SocialLinksLinkV0[]; openInNewTab: boolean }\n\ntype SocialLinksValueV1 = { links: SocialLinksLinkV1[]; openInNewTab: boolean }\n\nexport type SocialLinksValue = SocialLinksValueV0 | SocialLinksValueV1\n\ntype SocialLinksOptions = Options<{ preset?: SocialLinksValueV1 }>\n\nexport type SocialLinksDescriptor<_T = SocialLinksValueV1> = {\n type: typeof Types.SocialLinks\n options: SocialLinksOptions\n version?: 1\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function SocialLinks(options: SocialLinksOptions = {}): SocialLinksDescriptor {\n return { type: Types.SocialLinks, options, version: 1 }\n}\n\nexport type TableValue = string\n\ntype TableOptions = Options<{ preset?: TableValue }>\n\ntype TableDescriptor<_T = TableValue> = { type: typeof Types.Table; options: TableOptions }\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Table(options: TableOptions = {}): TableDescriptor {\n return { type: Types.Table, options }\n}\n\ntype TableFormField = {\n id: string\n tableColumnId: string\n label?: string\n placeholder?: string\n defaultValue?: string | boolean | string[]\n required?: boolean\n hidden?: boolean\n type?: 'select' | 'radio'\n hideLabel?: boolean\n autofill?: boolean\n}\n\ntype Grid = { count: number; spans: number[][] }\n\nexport type TableFormFieldsValue = { fields: TableFormField[]; grid: ResponsiveValue<Grid> }\n\ntype TableFormFieldsOptions = Options<{ preset?: TableFormFieldsValue }>\n\nexport type TableFormFieldsDescriptor<_T = TableFormFieldsValue> = {\n type: typeof Types.TableFormFields\n options: TableFormFieldsOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function TableFormFields(options: TableFormFieldsOptions = {}): TableFormFieldsDescriptor {\n return { type: Types.TableFormFields, options }\n}\n\nexport type TypeaheadValue<T extends Data = Data> = {\n id: string\n label: string\n value: T\n}\n\nexport type TypeaheadOptions<T extends Data> = {\n getItems: (query: string) => Promise<TypeaheadValue<T>[]>\n label?: string\n preset?: TypeaheadValue<T>\n defaultValue?: TypeaheadValue<T>\n}\n\nexport type TypeaheadDescriptor<T extends TypeaheadValue = TypeaheadValue> = {\n type: typeof Types.Typeahead\n options: TypeaheadOptions<T extends TypeaheadValue<infer U> ? U : never>\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Typeahead<T extends Data>(\n options: TypeaheadOptions<T>,\n): TypeaheadDescriptor<TypeaheadValue<T>> {\n return { type: Types.Typeahead, options }\n}\n\nexport type TextAreaValue = string\n\ntype TextAreaOptions = Options<{ preset?: TextAreaValue; label?: string; rows?: number }>\n\ntype TextAreaDescriptor<_T = TextAreaValue> = {\n type: typeof Types.TextArea\n options: TextAreaOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function TextArea(options: TextAreaOptions = {}): TextAreaDescriptor {\n return { type: Types.TextArea, options }\n}\n\nexport type TextInputValue = string\n\nexport type TextInputOptions = Options<{ label?: string; placeholder?: string; hidden?: boolean }>\n\nexport type TextInputDescriptor<_T = TextInputValue> = {\n type: typeof Types.TextInput\n options: TextInputOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function TextInput(options: TextInputOptions = {}): TextInputDescriptor {\n return { type: Types.TextInput, options }\n}\n\nexport type TextStyleValue = ResponsiveValue<TextStyle>\n\nexport type TextStyleOptions = Options<{\n preset?: TextStyleValue\n label?: string\n hidden?: boolean\n}>\n\nexport type TextStyleDescriptor<_T = TextStyleValue> = {\n type: typeof Types.TextStyle\n options: TextStyleOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function TextStyle(options: TextStyleOptions = {}): TextStyleDescriptor {\n return { type: Types.TextStyle, options }\n}\n\ntype Video = {\n url?: string\n muted?: boolean\n playing?: boolean\n loop?: boolean\n controls?: boolean\n}\n\nexport type VideoValue = Video\n\ntype VideoOptions = Options<{ preset?: VideoValue }>\n\ntype VideoDescriptor<_T = VideoValue> = { type: typeof Types.Video; options: VideoOptions }\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Video(options: VideoOptions = {}): VideoDescriptor {\n return { type: Types.Video, options }\n}\n\nexport type WidthValue = ResponsiveValue<Length>\n\nexport const WidthPropControllerFormat = {\n ClassName: 'makeswift::prop-controllers::width::format::class-name',\n ResponsiveValue: 'makeswift::prop-controllers::width::format::responsive-value',\n} as const\n\ntype WidthControlValueFormat =\n typeof WidthPropControllerFormat[keyof typeof WidthPropControllerFormat]\n\ntype WidthOptions = {\n preset?: WidthValue\n defaultValue?: Length\n format?: WidthControlValueFormat\n}\n\nexport type WidthDescriptor<_T = WidthValue, U extends WidthOptions = WidthOptions> = {\n type: typeof Types.Width\n options: U\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Width<T extends WidthOptions>(\n options: T & WidthOptions = {} as T,\n): WidthDescriptor<WidthValue, T> {\n return { type: Types.Width, options }\n}\n\nWidth.Format = WidthPropControllerFormat\n\nexport type Descriptor<T extends Data = Data> =\n | BackgroundsDescriptor<T>\n | BorderDescriptor<T>\n | BorderRadiusDescriptor<T>\n | CheckboxDescriptor<T>\n | DateDescriptor<T>\n | ElementIDDescriptor<T>\n | FontDescriptor<T>\n | GapXDescriptor<T>\n | GapYDescriptor<T>\n | GridDescriptor<T>\n | ImageDescriptor<T>\n | ImagesDescriptor<T>\n | LinkDescriptor<T>\n | ListDescriptor<T extends ListValue ? T : ListValue>\n | MarginDescriptor<T>\n | NavigationLinksDescriptor<T>\n | NumberDescriptor<T>\n | PaddingDescriptor<T>\n | ResponsiveColorDescriptor<T>\n | ResponsiveIconRadioGroupDescriptor<\n T extends ResponsiveIconRadioGroupValue<string> ? T : ResponsiveIconRadioGroupValue<string>\n >\n | ResponsiveLengthDescriptor<T>\n | ResponsiveNumberDescriptor<T>\n | ResponsiveOpacityDescriptor<T>\n | ResponsiveSelectDescriptor<\n T extends ResponsiveSelectValue<string> ? T : ResponsiveSelectValue<string>\n >\n | RichTextDescriptor<T>\n | ShadowsDescriptor<T>\n | ShapeDescriptor<T extends ShapeValue ? T : ShapeValue, any>\n | SocialLinksDescriptor<T>\n | TableDescriptor<T>\n | TableFormFieldsDescriptor<T>\n | TypeaheadDescriptor<T extends TypeaheadValue ? T : TypeaheadValue>\n | TextAreaDescriptor<T>\n | TextInputDescriptor<T>\n | TextStyleDescriptor<T>\n | VideoDescriptor<T>\n | WidthDescriptor<T>\n | StyleControlDefinition\n | StyleV2ControlDefinition\n | NumberControlDefinition\n | CheckboxControlDefinition\n | TextInputControlDefinition\n | TextAreaControlDefinition\n | SelectControlDefinition\n | ColorControlDefinition\n | IconRadioGroupControlDefinition\n | ImageControlDefinition\n | ComboboxControlDefinition\n | ShapeControlDefinition\n | ListControlDefinition\n | LinkControlDefinition\n | SlotControlDefinition\n | RichTextControlDefinition\n | RichTextV2ControlDefinition\n | TypographyControlDefinition\n\nexport type PanelDescriptorType =\n | typeof Types.Backgrounds\n | typeof Types.ResponsiveIconRadioGroup\n | typeof Types.Margin\n | typeof Types.Padding\n | typeof Types.Border\n | typeof Types.Shadows\n | typeof Types.GapY\n | typeof Types.GapX\n | typeof Types.BorderRadius\n | typeof Types.Checkbox\n | typeof Types.TextInput\n | typeof Types.Link\n | typeof Types.List\n | typeof Types.Shape\n | typeof Types.ResponsiveSelect\n | typeof Types.ResponsiveColor\n | typeof Types.TextStyle\n | typeof Types.Images\n | typeof Types.ResponsiveNumber\n | typeof Types.Number\n | typeof Types.Date\n | typeof Types.Font\n | typeof Types.TextArea\n | typeof Types.Table\n | typeof Types.Typeahead\n | typeof Types.RichText\n | typeof Types.Image\n | typeof Types.ResponsiveOpacity\n | typeof Types.SocialLinks\n | typeof Types.Video\n | typeof Types.NavigationLinks\n\nexport type PanelDescriptor<T extends Data = Data> = Extract<\n Descriptor<T>,\n { type: PanelDescriptorType }\n>\n\nexport type DescriptorValueType<T extends Descriptor> = T extends NumberControlDefinition\n ? NumberControlValue<T>\n : T extends CheckboxControlDefinition\n ? CheckboxControlValue<T>\n : T extends TextInputControlDefinition\n ? TextInputControlValue<T>\n : T extends TextAreaControlDefinition\n ? TextAreaControlValue<T>\n : T extends SelectControlDefinition\n ? SelectControlValue<T>\n : T extends ColorControlDefinition\n ? ColorControlValue<T>\n : T extends StyleControlDefinition\n ? StyleControlFormattedValue\n : T extends StyleV2ControlDefinition\n ? StyleV2ControlFormattedValue\n : T extends IconRadioGroupControlDefinition\n ? IconRadioGroupControlValue<T>\n : T extends ImageControlDefinition\n ? ResolveImageControlValue<T>\n : T extends ComboboxControlDefinition\n ? ComboboxControlValue<T>\n : T extends ShapeControlDefinition\n ? ShapeControlValue<T>\n : T extends ListControlDefinition\n ? ListControlValue<T>\n : T extends LinkControlDefinition\n ? LinkControlValue<T>\n : T extends SlotControlDefinition\n ? SlotControlValue\n : T extends RichTextControlDefinition\n ? RichTextControlValue\n : T extends RichTextV2ControlDefinition\n ? RichTextV2ControlValue\n : T extends StyleV2ControlDefinition\n ? StyleV2ControlFormattedValue\n : T extends TypographyControlDefinition\n ? TypographyControlValue\n : T['type'] extends typeof Types.ResponsiveColor\n ? ResponsiveColor | null | undefined\n : T['type'] extends typeof Types.Width\n ? ResolveWidthControlValue<T>\n : T['type'] extends typeof Types.Padding\n ? ResolvePaddingControlValue<T>\n : T['type'] extends typeof Types.Margin\n ? ResolveMarginControlValue<T>\n : T['type'] extends typeof Types.BorderRadius\n ? ResolveBorderRadiusControlValue<T>\n : T['type'] extends typeof Types.Shadows\n ? ResolveShadowsControlValue<T>\n : T['type'] extends typeof Types.Border\n ? ResolveBorderControlValue<T>\n : T extends Descriptor<infer U>\n ? U | undefined\n : never\n\nexport type PanelDescriptorValueType<T extends PanelDescriptor> = T extends PanelDescriptor<infer U>\n ? U\n : never\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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A;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAIO,MAAM,oBAAoB,CAAC,GAAG,mBAAmB,KAAK,OAAO;AA8B7D,SAAS,YAAY,UAA8B,CAAC,GAA0B;AACnF,SAAO,EAAE,MAAM,MAAM,aAAa,SAAS,SAAS,EAAE;AACxD;AAYO,SAAS,MAAM,UAAwB,CAAC,GAAoB;AACjE,SAAO,EAAE,MAAM,MAAM,OAAO,QAAQ;AACtC;AA8BO,SAAS,gBAAgB,UAAkC,CAAC,GAA8B;AAC/F,SAAO,EAAE,MAAM,MAAM,iBAAiB,QAAQ;AAChD;AAwBO,SAAS,UACd,SACwC;AACxC,SAAO,EAAE,MAAM,MAAM,WAAW,QAAQ;AAC1C;AAeO,SAAS,SAAS,UAA2B,CAAC,GAAuB;AAC1E,SAAO,EAAE,MAAM,MAAM,UAAU,QAAQ;AACzC;AAeO,SAAS,UAAU,UAA4B,CAAC,GAAwB;AAC7E,SAAO,EAAE,MAAM,MAAM,WAAW,QAAQ;AAC1C;AAmBO,SAAS,UAAU,UAA4B,CAAC,GAAwB;AAC7E,SAAO,EAAE,MAAM,MAAM,WAAW,QAAQ;AAC1C;AAoBO,SAAS,MAAM,UAAwB,CAAC,GAAoB;AACjE,SAAO,EAAE,MAAM,MAAM,OAAO,QAAQ;AACtC;AAIO,MAAM,4BAA4B;AAAA,EACvC,WAAW;AAAA,EACX,iBAAiB;AACnB;AAoBO,SAAS,MACd,UAA4B,CAAC,GACG;AAChC,SAAO,EAAE,MAAM,MAAM,OAAO,QAAQ;AACtC;AAEA,MAAM,SAAS;","names":["import_style"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/prop-controllers/descriptors.ts"],"sourcesContent":["import {\n ResolveMarginControlValue,\n ResolvePaddingControlValue,\n ResolveWidthControlValue,\n ResponsiveColor,\n} from '../runtimes/react/controls'\nimport { StyleControlFormattedValue } from '../runtimes/react/controls/style'\nimport type { Element, Data, MergeTranslatableDataContext } from '../state/react-page'\nimport { NumberControlDefinition } from '../controls/number'\nimport { NumberControlValue } from '../runtimes/react/controls/number'\nimport { StyleControlType } from '../controls/style'\nimport {\n CheckboxControlDefinition,\n ColorControlDefinition,\n ComboboxControlDefinition,\n ImageControlDefinition,\n LinkControlDefinition,\n ListControlDefinition,\n SelectControlDefinition,\n ShapeControlDefinition,\n SlotControlDefinition,\n TextAreaControlDefinition,\n TextInputControlDefinition,\n StyleControlDefinition,\n RichTextV2ControlDefinition,\n StyleV2ControlDefinition,\n TypographyControlDefinition,\n} from '../controls'\nimport { TextInputControlValue } from '../runtimes/react/controls/text-input'\nimport { TextAreaControlValue } from '../runtimes/react/controls/text-area'\nimport { ColorControlValue } from '../runtimes/react/controls/color'\nimport { SelectControlValue } from '../runtimes/react/controls/select'\nimport { CheckboxControlValue } from '../runtimes/react/controls/checkbox'\nimport { ResolveImageControlValue } from '../runtimes/react/controls/image'\nimport { ShapeControlValue } from '../runtimes/react/controls/shape'\nimport { ListControlValue } from '../runtimes/react/controls/list'\nimport { ComboboxControlValue } from '../runtimes/react/controls/combobox'\nimport { LinkControlValue } from '../runtimes/react/controls/link'\nimport { SlotControlValue } from '../runtimes/react/controls/slot'\nimport { RichTextControlDefinition, RichTextDTO } from '../controls/rich-text'\nimport { RichTextControlValue } from '../runtimes/react/controls/rich-text/rich-text'\nimport { RichTextV2ControlValue } from '../runtimes/react/controls/rich-text-v2'\nimport { StyleV2ControlFormattedValue } from '../runtimes/react/controls/style-v2'\nimport { IconRadioGroupControlDefinition } from '../controls/icon-radio-group'\nimport { IconRadioGroupControlValue } from '../runtimes/react/controls/icon-radio-group'\nimport { TypographyControlValue } from '../runtimes/react/controls/typography'\nimport {\n getElementChildren,\n getFileIds,\n getPageIds,\n getSwatchIds,\n getTypographyIds,\n} from './introspection'\nimport {\n BorderDescriptor,\n CheckboxDescriptor,\n LinkData,\n LinkDescriptor,\n LinkPropControllerValue,\n Types as PropControllerTypes,\n ColorData as Color,\n LengthData as Length,\n ResponsiveValueType,\n ShadowsDescriptor,\n ResolveShadowsPropControllerValue,\n ResponsiveValue,\n Options,\n ResponsiveLengthDescriptor,\n ResolveResponsiveLengthPropControllerValue,\n NumberDescriptor,\n ResolveNumberPropControllerValue,\n ResponsiveColorDescriptor,\n ResolveCheckboxPropControllerValue,\n BorderRadiusDescriptor,\n ResolveBorderPropControllerValue,\n ResolveBorderRadiusPropControllerValue,\n} from '@makeswift/prop-controllers'\n\nexport type { Data }\n\n// See https://github.com/microsoft/TypeScript/issues/15300\nexport type IndexSignatureHack<T> = T extends Record<string, any>\n ? { [K in keyof T]: IndexSignatureHack<T[K]> }\n : T\n\ntype IconName =\n | 'HeightAuto16'\n | 'HeightMatch16'\n | 'VerticalAlignStart16'\n | 'VerticalAlignMiddle16'\n | 'VerticalAlignEnd16'\n | 'VerticalAlignSpaceBetween16'\n | 'ButtonPill16'\n | 'ButtonRounded16'\n | 'ButtonSquare16'\n | 'SizeSmall16'\n | 'SizeMedium16'\n | 'SizeLarge16'\n | 'ArrowInside16'\n | 'ArrowCenter16'\n | 'ArrowOutside16'\n | 'CountdownSolid16'\n | 'CountdownSolidSplit16'\n | 'CountdownOutline16'\n | 'CountdownOutlineSplit16'\n | 'CountdownNaked16'\n | 'Sun16'\n | 'Moon16'\n | 'AlignLeft16'\n | 'AlignCenter16'\n | 'AlignRight16'\n | 'Star16'\n | 'StarCircle16'\n | 'StarRoundedSquare16'\n | 'StarSquare16'\n\nexport type Gap = { value: number; unit: 'px' }\n\ntype TextStyle = {\n fontFamily?: string | null | undefined\n letterSpacing: number | null | undefined\n fontSize: { value: number; unit: 'px' } | null | undefined\n fontWeight: number | null | undefined\n textTransform: 'uppercase'[]\n fontStyle: 'italic'[]\n}\n\nexport const Types = {\n Backgrounds: 'Backgrounds',\n Date: 'Date',\n ElementID: 'ElementID',\n Font: 'Font',\n GapX: 'GapX',\n GapY: 'GapY',\n Grid: 'Grid',\n Image: 'Image',\n Images: 'Images',\n List: 'List',\n Margin: 'Margin',\n NavigationLinks: 'NavigationLinks',\n Padding: 'Padding',\n ResponsiveIconRadioGroup: 'ResponsiveIconRadioGroup',\n ResponsiveNumber: 'ResponsiveNumber',\n ResponsiveOpacity: 'ResponsiveOpacity',\n ResponsiveSelect: 'ResponsiveSelect',\n RichText: 'RichText',\n Shape: 'Shape',\n SocialLinks: 'SocialLinks',\n Table: 'Table',\n TableFormFields: 'TableFormFields',\n Typeahead: 'Typeahead',\n TextArea: 'TextArea',\n TextInput: 'TextInput',\n TextStyle: 'TextStyle',\n Video: 'Video',\n Width: 'Width',\n Style: StyleControlType,\n} as const\n\ntype ColorBackground = { type: 'color'; id: string; payload: Color | null }\n\ntype GradientStop = { id: string; location: number; color: Color | null }\n\ntype Gradient = { angle?: number; isRadial?: boolean; stops: GradientStop[] }\n\ntype GradientBackground = { type: 'gradient'; id: string; payload: Gradient }\n\ntype BackgroundImagePosition = { x: number; y: number }\n\ntype BackgroundImageSize = 'cover' | 'contain' | 'auto'\n\ntype BackgroundImageRepeat = 'no-repeat' | 'repeat-x' | 'repeat-y' | 'repeat'\n\ntype BackgroundImageV0 = {\n imageId: ImageValueV0\n position: BackgroundImagePosition\n size?: BackgroundImageSize\n repeat?: BackgroundImageRepeat\n opacity?: number\n parallax?: number\n priority?: boolean\n}\n\ntype BackgroundImageV1 = {\n version: 1\n image: ImageValueV1\n position: BackgroundImagePosition\n size?: BackgroundImageSize\n repeat?: BackgroundImageRepeat\n opacity?: number\n parallax?: number\n priority?: boolean\n}\n\nexport type BackgroundImage = BackgroundImageV0 | BackgroundImageV1\n\ntype ImageBackgroundV0 = { type: 'image'; id: string; payload: BackgroundImageV0 }\n\ntype ImageBackgroundV1 = { type: 'image-v1'; id: string; payload: BackgroundImageV1 }\n\nexport type ImageBackground = ImageBackgroundV0 | ImageBackgroundV1\n\ntype BackgroundVideoAspectRatio = 'wide' | 'standard'\n\ntype BackgroundVideo = {\n url?: string\n maskColor?: Color | null\n opacity?: number\n zoom?: number\n aspectRatio?: BackgroundVideoAspectRatio\n parallax?: number\n}\n\ntype VideoBackground = { type: 'video'; id: string; payload: BackgroundVideo }\n\ntype Background = ColorBackground | GradientBackground | ImageBackground | VideoBackground\n\nexport type BackgroundsValue = ResponsiveValue<Background[]>\n\ntype BackgroundsOptions = Options<Record<string, never>>\n\nexport type BackgroundsDescriptor<_T = BackgroundsValue> = {\n type: typeof Types.Backgrounds\n version?: 1\n options: BackgroundsOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Backgrounds(options: BackgroundsOptions = {}): BackgroundsDescriptor {\n return { type: Types.Backgrounds, version: 1, options }\n}\n\nexport type DateValue = string\n\nexport type DateOptions = Options<{ preset?: DateValue }>\n\nexport type DateDescriptor<_T = DateValue> = { type: typeof Types.Date; options: DateOptions }\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Date(options: DateOptions = {}): DateDescriptor {\n return { type: Types.Date, options }\n}\n\nexport type ElementIDValue = string\n\ntype ElementIDOptions = Options<Record<string, never>>\n\ntype ElementIDDescriptor<_T = ElementIDValue> = {\n type: typeof Types.ElementID\n options: ElementIDOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function ElementID(options: ElementIDOptions = {}): ElementIDDescriptor {\n return { type: Types.ElementID, options }\n}\n\nexport type FontValue = ResponsiveValue<string>\n\ntype FontOptions = Options<{ preset?: FontValue; label?: string }>\n\ntype FontDescriptor<_T = FontValue> = { type: typeof Types.Font; options: FontOptions }\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Font(options: FontOptions = {}): FontDescriptor {\n return { type: Types.Font, options }\n}\n\nexport type GapXValue = ResponsiveValue<Gap>\n\nexport type GapXOptions = Options<{\n preset?: GapXValue\n label?: string\n defaultValue?: Gap\n min?: number\n max?: number\n step?: number\n hidden?: boolean\n}>\n\nexport type GapXDescriptor<_T = GapXValue> = { type: typeof Types.GapX; options: GapXOptions }\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function GapX(options: GapXOptions = {}): GapXDescriptor {\n return { type: Types.GapX, options }\n}\n\nexport type GapYValue = ResponsiveValue<Gap>\n\nexport type GapYOptions = Options<{\n preset?: GapYValue\n label?: string\n defaultValue?: Gap\n step?: number\n min?: number\n max?: number\n hidden?: boolean\n}>\n\nexport type GapYDescriptor<_T = GapYValue> = { type: typeof Types.GapY; options: GapYOptions }\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function GapY(options: GapYOptions = {}): GapYDescriptor {\n return { type: Types.GapY, options }\n}\n\ntype GridColumn = { count: number; spans: number[][] }\n\nexport type GridValue = { elements: Element[]; columns: ResponsiveValue<GridColumn> }\n\ntype GridOptions = Options<Record<string, never>>\n\ntype GridDescriptor<_T = GridValue> = { type: typeof Types.Grid; options: GridOptions }\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Grid(options: GridOptions = {}): GridDescriptor {\n return { type: Types.Grid, options }\n}\n\nexport function mergeGridPropControllerTranslatedData(\n data: GridValue,\n context: MergeTranslatableDataContext,\n) {\n return {\n ...data,\n elements: data.elements.map(element => context.mergeTranslatedData(element)),\n }\n}\n\nexport type ImageValueV0 = string\n\ntype ImageValueV1MakeswiftFile = {\n version: 1\n type: 'makeswift-file'\n id: string\n}\n\ntype ImageValueV1ExternalFile = {\n version: 1\n type: 'external-file'\n url: string\n width?: number | null\n height?: number | null\n}\n\nexport type ImageValueV1 = ImageValueV1MakeswiftFile | ImageValueV1ExternalFile\n\nexport type ImageValue = ImageValueV0 | ImageValueV1\n\nexport type ImageOptions = Options<{ label?: string; hidden?: boolean }>\n\nexport type ImageDescriptor<_T = ImageValue> = {\n type: typeof Types.Image\n version?: 1\n options: ImageOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Image(options: ImageOptions = {}): ImageDescriptor {\n return { type: Types.Image, version: 1, options }\n}\n\nexport type ImagesValueV0Item = {\n key: string\n props: {\n link?: LinkData\n file?: ImageValueV0\n altText?: string\n }\n}\n\nexport type ImagesValueV1Item = {\n key: string\n version: 1\n props: {\n link?: LinkData\n file?: ImageValueV1\n altText?: string\n }\n}\n\nexport type ImagesValueItem = ImagesValueV0Item | ImagesValueV1Item\n\nexport type ImagesValue = ImagesValueItem[]\n\ntype ImagesOptions = Options<{ preset?: ImagesValue }>\n\nexport type ImagesDescriptor<_T = ImagesValue> = {\n type: typeof Types.Images\n version?: 1\n options: ImagesOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Images(options: ImagesOptions = {}): ImagesDescriptor {\n return { type: Types.Images, version: 1, options }\n}\n\ntype ListValueItem<T extends Data> = { id: string; value?: T }\n\nexport type ListValue<T extends Data = Data> = ListValueItem<T>[]\n\nexport type ListOptions<T extends Data> = {\n type: PanelDescriptor<T>\n label?: string\n getItemLabel?: ((value: T | undefined) => string) | ((value: T | undefined) => Promise<string>)\n preset?: ListValue<T>\n defaultValue?: ListValue<T>\n}\n\nexport type ListDescriptor<T extends ListValue = ListValue> = {\n type: typeof Types.List\n options: ListOptions<T extends ListValue<infer U> ? U : never>\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function List<T extends Data>(options: ListOptions<T>): ListDescriptor<ListValue<T>> {\n return { type: Types.List, options }\n}\n\nexport function introspectListPropControllerData<T>(\n descriptor: ListDescriptor,\n value: ListValue | undefined,\n func: (definition: Descriptor, data: Data) => T[],\n): T[] {\n if (value == null) return []\n\n return value.flatMap(item => (item.value ? func(descriptor.options.type, item.value) : []))\n}\n\nexport function getListPropControllerElementChildren<T>(\n descriptor: ListDescriptor<T extends ListValue<Data> ? T : ListValue<Data>>,\n value: ListValue | undefined,\n) {\n return introspectListPropControllerData(descriptor, value, getElementChildren)\n}\n\nexport function getListPropControllerSwatchIds<T>(\n descriptor: ListDescriptor<T extends ListValue<Data> ? T : ListValue<Data>>,\n value: ListValue | undefined,\n) {\n return introspectListPropControllerData(descriptor, value, getSwatchIds)\n}\n\nexport function getListPropControllerFileIds<T>(\n descriptor: ListDescriptor<T extends ListValue<Data> ? T : ListValue<Data>>,\n value: ListValue | undefined,\n) {\n return introspectListPropControllerData(descriptor, value, getFileIds)\n}\n\nexport function getListPropControllerTypographyIds<T>(\n descriptor: ListDescriptor<T extends ListValue<Data> ? T : ListValue<Data>>,\n value: ListValue | undefined,\n) {\n return introspectListPropControllerData(descriptor, value, getTypographyIds)\n}\n\nexport function getListPropControllerPageIds<T>(\n descriptor: ListDescriptor<T extends ListValue<Data> ? T : ListValue<Data>>,\n value: ListValue | undefined,\n) {\n return introspectListPropControllerData(descriptor, value, getPageIds)\n}\n\ntype MarginSide = { value: number; unit: 'px' } | 'auto'\n\ntype Margin = {\n [K in 'top' | 'right' | 'bottom' | 'left' as `margin${Capitalize<K>}`]:\n | MarginSide\n | null\n | undefined\n}\n\nexport type MarginValue = ResponsiveValue<Margin>\n\nexport const MarginPropControllerFormat = {\n ClassName: 'makeswift::prop-controllers::margin::format::class-name',\n ResponsiveValue: 'makeswift::prop-controllers::margin::format::responsive-value',\n} as const\n\nexport type MarginPropControllerFormat =\n typeof MarginPropControllerFormat[keyof typeof MarginPropControllerFormat]\n\ntype MarginOptions = { preset?: MarginValue; format?: MarginPropControllerFormat }\n\nexport type MarginDescriptor<_T = MarginValue, U extends MarginOptions = MarginOptions> = {\n type: typeof Types.Margin\n options: U\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Margin<T extends MarginOptions>(\n options: T & MarginOptions = {} as T,\n): MarginDescriptor<MarginValue, T> {\n return { type: Types.Margin, options }\n}\n\nMargin.Format = MarginPropControllerFormat\n\ntype ButtonVariant = 'flat' | 'outline' | 'shadow' | 'clear' | 'blocky' | 'bubbly' | 'skewed'\n\ntype ButtonShape = 'pill' | 'rounded' | 'square'\n\ntype ButtonSize = 'small' | 'medium' | 'large'\n\nexport type NavigationButton = {\n id: string\n type: 'button'\n payload: {\n label: string\n link?: LinkData\n variant?: ResponsiveValue<ButtonVariant>\n shape?: ResponsiveValue<ButtonShape>\n size?: ResponsiveValue<ButtonSize>\n textColor?: ResponsiveValue<Color>\n color?: ResponsiveValue<Color>\n textStyle?: ResponsiveValue<TextStyle>\n }\n}\n\ntype NavigationDropdownCaretType = 'caret' | 'plus' | 'arrow-down' | 'chevron-down'\n\ntype NavigationDropdownLink = {\n id: string\n payload: {\n label: string\n link?: LinkData\n color?: ResponsiveValue<Color>\n textStyle?: ResponsiveValue<TextStyle>\n }\n}\n\ntype NavigationDropdown = {\n id: string\n type: 'dropdown'\n payload: {\n label: string\n caret?: NavigationDropdownCaretType\n links?: NavigationDropdownLink[]\n variant?: ResponsiveValue<ButtonVariant>\n shape?: ResponsiveValue<ButtonShape>\n size?: ResponsiveValue<ButtonSize>\n textColor?: ResponsiveValue<Color>\n color?: ResponsiveValue<Color>\n textStyle?: ResponsiveValue<TextStyle>\n }\n}\n\nexport type NavigationLinksValue = (NavigationButton | NavigationDropdown)[]\n\ntype NavigationLinksOptions = Options<Record<string, never>>\n\ntype NavigationLinksDescriptor<_T = NavigationLinksValue> = {\n type: typeof Types.NavigationLinks\n options: NavigationLinksOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function NavigationLinks(options: NavigationLinksOptions = {}): NavigationLinksDescriptor {\n return { type: Types.NavigationLinks, options }\n}\n\ntype PaddingSide = { value: number; unit: 'px' }\n\ntype Padding = {\n [K in 'top' | 'right' | 'bottom' | 'left' as `padding${Capitalize<K>}`]:\n | PaddingSide\n | null\n | undefined\n}\n\nexport type PaddingValue = ResponsiveValue<Padding>\n\nexport const PaddingPropControllerFormat = {\n ClassName: 'makeswift::prop-controllers::padding::format::class-name',\n ResponsiveValue: 'makeswift::prop-controllers::padding::format::responsive-value',\n} as const\n\nexport type PaddingPropControllerFormat =\n typeof PaddingPropControllerFormat[keyof typeof PaddingPropControllerFormat]\n\ntype PaddingOptions = { preset?: PaddingValue; format?: PaddingPropControllerFormat }\n\nexport type PaddingDescriptor<_T = PaddingValue, U extends PaddingOptions = PaddingOptions> = {\n type: typeof Types.Padding\n options: U\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Padding<T extends PaddingOptions>(\n options: T & PaddingOptions = {} as T,\n): PaddingDescriptor<PaddingValue, T> {\n return { type: Types.Padding, options }\n}\n\nPadding.Format = PaddingPropControllerFormat\n\nexport type IconRadioGroupOption<T extends string> = { value: T; label: string; icon: IconName }\n\nexport type ResponsiveIconRadioGroupValue<T extends string = string> = ResponsiveValue<T>\n\nexport type ResponsiveIconRadioGroupOptions<T extends string = string, U extends T = T> = Options<{\n label?: string\n options: IconRadioGroupOption<T>[]\n defaultValue?: U\n hidden?: boolean\n}>\n\nexport type ResponsiveIconRadioGroupDescriptor<\n T extends ResponsiveIconRadioGroupValue<string> = ResponsiveIconRadioGroupValue<string>,\n> = {\n type: typeof Types.ResponsiveIconRadioGroup\n options: ResponsiveIconRadioGroupOptions<ResponsiveValueType<T>>\n}\n\n// HACK(miguel): We have to use a layer of indirection with `_T` and `T` because otherwise the\n// values provided would undergo type widening. For some reason, the extra layer of indirection\n// reuslts in TypeScript not widening types. Note, this only happens when the returned value of this\n// function is passed to another as an argument, which is common with the `registerComponent` API.\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function ResponsiveIconRadioGroup<_T extends string, T extends _T, U extends T>(\n options: ResponsiveIconRadioGroupOptions<T, U>,\n): ResponsiveIconRadioGroupDescriptor<ResponsiveIconRadioGroupValue<T>> {\n return { type: Types.ResponsiveIconRadioGroup, options }\n}\n\nexport type ResponsiveNumberValue = ResponsiveValue<number>\n\nexport type ResponsiveNumberOptions = Options<{\n label?: string\n defaultValue?: number\n min?: number\n max?: number\n step?: number\n suffix?: string\n hidden?: boolean\n}>\n\nexport type ResponsiveNumberDescriptor<_T = ResponsiveNumberValue> = {\n type: typeof Types.ResponsiveNumber\n options: ResponsiveNumberOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function ResponsiveNumber(\n options: ResponsiveNumberOptions = {},\n): ResponsiveNumberDescriptor {\n return { type: Types.ResponsiveNumber, options }\n}\n\nexport type ResponsiveOpacityValue = ResponsiveValue<number>\n\ntype ResponsiveOpacityOptions = Options<Record<string, never>>\n\ntype ResponsiveOpacityDescriptor<_T = ResponsiveOpacityValue> = {\n type: typeof Types.ResponsiveOpacity\n options: ResponsiveOpacityOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function ResponsiveOpacity(\n options: ResponsiveOpacityOptions = {},\n): ResponsiveOpacityDescriptor {\n return { type: Types.ResponsiveOpacity, options }\n}\n\nexport type ResponsiveSelectValue<T extends string = string> = ResponsiveValue<T>\n\nexport type SelectLabelOrientation = 'vertical' | 'horizontal'\n\nexport type SelectOption<T extends string> = { value: T; label: string }\n\nexport type ResponsiveSelectOptions<T extends string = string, U extends T = T> = Options<{\n label?: string\n labelOrientation?: SelectLabelOrientation\n options: SelectOption<T>[]\n defaultValue?: U\n hidden?: boolean\n}>\n\nexport type ResponsiveSelectDescriptor<\n T extends ResponsiveSelectValue<string> = ResponsiveSelectValue<string>,\n> = {\n type: typeof Types.ResponsiveSelect\n options: ResponsiveSelectOptions<ResponsiveValueType<T>>\n}\n\n// HACK(miguel): We have to use a layer of indirection with `_T` and `T` because otherwise the\n// values provided would undergo type widening. For some reason, the extra layer of indirection\n// reuslts in TypeScript not widening types. Note, this only happens when the returned value of this\n// function is passed to another as an argument, which is common with the `registerComponent` API.\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function ResponsiveSelect<_T extends string, T extends _T, U extends T>(\n options: ResponsiveSelectOptions<T, U>,\n): ResponsiveSelectDescriptor<ResponsiveSelectValue<T>> {\n return { type: Types.ResponsiveSelect, options }\n}\n\nexport type RichTextValue = IndexSignatureHack<RichTextDTO>\n\nexport type RichTextOptions = Options<{ preset?: RichTextValue }>\n\nexport type RichTextDescriptor<_T extends Data = RichTextValue> = {\n type: typeof Types.RichText\n options: RichTextOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function RichText(options: RichTextOptions = {}): RichTextDescriptor {\n return { type: Types.RichText, options }\n}\n\nexport type ShapeValue<T extends Data = Data> = Record<string, T>\n\ntype ShapeOptions<T extends Record<string, PanelDescriptor>> = {\n type: T\n preset?: { [K in keyof T]?: DescriptorValueType<T[K]> }\n}\n\nexport type ShapeDescriptor<\n _T extends Record<string, Data>,\n U extends Record<string, PanelDescriptor>,\n> = {\n type: typeof Types.Shape\n options: ShapeOptions<U>\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Shape<T extends Record<string, PanelDescriptor>>(\n options: ShapeOptions<T>,\n): ShapeDescriptor<{ [K in keyof T]?: DescriptorValueType<T[K]> }, T> {\n return { type: Types.Shape, options }\n}\n\nexport function introspectShapePropControllerData<T>(\n descriptor: ShapeDescriptor<Record<string, Data>, Record<string, PanelDescriptor>>,\n value: ShapeValue | undefined,\n func: (definition: Descriptor, data: Data) => T[],\n): T[] {\n if (value == null) return []\n\n return Object.entries(descriptor.options.type).flatMap(([key, definition]) =>\n func(definition, value[key]),\n )\n}\n\nexport function getShapePropControllerElementChildren(\n descriptor: ShapeDescriptor<Record<string, Data>, Record<string, PanelDescriptor>>,\n value: ShapeValue | undefined,\n): Element[] {\n return introspectShapePropControllerData(descriptor, value, getElementChildren)\n}\n\nexport function getShapePropControllerFileIds(\n descriptor: ShapeDescriptor<Record<string, Data>, Record<string, PanelDescriptor>>,\n value: ShapeValue | undefined,\n): string[] {\n return introspectShapePropControllerData(descriptor, value, getFileIds)\n}\n\nexport function getShapePropControllerTypographyIds(\n descriptor: ShapeDescriptor<Record<string, Data>, Record<string, PanelDescriptor>>,\n value: ShapeValue | undefined,\n): string[] {\n return introspectShapePropControllerData(descriptor, value, getTypographyIds)\n}\n\nexport function getShapePropControllerPageIds(\n descriptor: ShapeDescriptor<Record<string, Data>, Record<string, PanelDescriptor>>,\n value: ShapeValue | undefined,\n): string[] {\n return introspectShapePropControllerData(descriptor, value, getPageIds)\n}\n\nexport function getShapePropControllerSwatchIds(\n descriptor: ShapeDescriptor<Record<string, Data>, Record<string, PanelDescriptor>>,\n value: ShapeValue | undefined,\n): string[] {\n return introspectShapePropControllerData(descriptor, value, getSwatchIds)\n}\n\nexport const socialLinkTypesV0 = [\n 'angellist',\n 'codepen',\n 'discord',\n 'dribbble',\n 'facebook',\n 'github',\n 'instagram',\n 'linkedin',\n 'medium',\n 'pinterest',\n 'reddit',\n 'rss',\n 'snapchat',\n 'soundcloud',\n 'spotify',\n 'telegram',\n 'tumblr',\n 'twitch',\n 'twitter',\n 'vimeo',\n 'whatsapp',\n 'yelp',\n 'youtube',\n] as const\n\ntype SocialLinkTypeV0 = typeof socialLinkTypesV0[number]\n\nexport const socialLinkTypesV1 = [...socialLinkTypesV0, 'x', 'slack'] as const\n\ntype SocialLinkTypeV1 = typeof socialLinkTypesV1[number]\n\ntype SocialLinkV0 = { type: SocialLinkTypeV0; url: string }\n\ntype SocialLinkV1 = { type: SocialLinkTypeV1; url: string }\n\ntype SocialLinksLinkV0 = { id: string; payload: SocialLinkV0 }\n\ntype SocialLinksLinkV1 = { id: string; payload: SocialLinkV1 }\n\ntype SocialLinksValueV0 = { links: SocialLinksLinkV0[]; openInNewTab: boolean }\n\ntype SocialLinksValueV1 = { links: SocialLinksLinkV1[]; openInNewTab: boolean }\n\nexport type SocialLinksValue = SocialLinksValueV0 | SocialLinksValueV1\n\ntype SocialLinksOptions = Options<{ preset?: SocialLinksValueV1 }>\n\nexport type SocialLinksDescriptor<_T = SocialLinksValueV1> = {\n type: typeof Types.SocialLinks\n options: SocialLinksOptions\n version?: 1\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function SocialLinks(options: SocialLinksOptions = {}): SocialLinksDescriptor {\n return { type: Types.SocialLinks, options, version: 1 }\n}\n\nexport type TableValue = string\n\ntype TableOptions = Options<{ preset?: TableValue }>\n\ntype TableDescriptor<_T = TableValue> = { type: typeof Types.Table; options: TableOptions }\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Table(options: TableOptions = {}): TableDescriptor {\n return { type: Types.Table, options }\n}\n\ntype TableFormField = {\n id: string\n tableColumnId: string\n label?: string\n placeholder?: string\n defaultValue?: string | boolean | string[]\n required?: boolean\n hidden?: boolean\n type?: 'select' | 'radio'\n hideLabel?: boolean\n autofill?: boolean\n}\n\ntype Grid = { count: number; spans: number[][] }\n\nexport type TableFormFieldsValue = { fields: TableFormField[]; grid: ResponsiveValue<Grid> }\n\ntype TableFormFieldsOptions = Options<{ preset?: TableFormFieldsValue }>\n\nexport type TableFormFieldsDescriptor<_T = TableFormFieldsValue> = {\n type: typeof Types.TableFormFields\n options: TableFormFieldsOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function TableFormFields(options: TableFormFieldsOptions = {}): TableFormFieldsDescriptor {\n return { type: Types.TableFormFields, options }\n}\n\nexport type TypeaheadValue<T extends Data = Data> = {\n id: string\n label: string\n value: T\n}\n\nexport type TypeaheadOptions<T extends Data> = {\n getItems: (query: string) => Promise<TypeaheadValue<T>[]>\n label?: string\n preset?: TypeaheadValue<T>\n defaultValue?: TypeaheadValue<T>\n}\n\nexport type TypeaheadDescriptor<T extends TypeaheadValue = TypeaheadValue> = {\n type: typeof Types.Typeahead\n options: TypeaheadOptions<T extends TypeaheadValue<infer U> ? U : never>\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Typeahead<T extends Data>(\n options: TypeaheadOptions<T>,\n): TypeaheadDescriptor<TypeaheadValue<T>> {\n return { type: Types.Typeahead, options }\n}\n\nexport type TextAreaValue = string\n\ntype TextAreaOptions = Options<{ preset?: TextAreaValue; label?: string; rows?: number }>\n\ntype TextAreaDescriptor<_T = TextAreaValue> = {\n type: typeof Types.TextArea\n options: TextAreaOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function TextArea(options: TextAreaOptions = {}): TextAreaDescriptor {\n return { type: Types.TextArea, options }\n}\n\nexport type TextInputValue = string\n\nexport type TextInputOptions = Options<{ label?: string; placeholder?: string; hidden?: boolean }>\n\nexport type TextInputDescriptor<_T = TextInputValue> = {\n type: typeof Types.TextInput\n options: TextInputOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function TextInput(options: TextInputOptions = {}): TextInputDescriptor {\n return { type: Types.TextInput, options }\n}\n\nexport type TextStyleValue = ResponsiveValue<TextStyle>\n\nexport type TextStyleOptions = Options<{\n preset?: TextStyleValue\n label?: string\n hidden?: boolean\n}>\n\nexport type TextStyleDescriptor<_T = TextStyleValue> = {\n type: typeof Types.TextStyle\n options: TextStyleOptions\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function TextStyle(options: TextStyleOptions = {}): TextStyleDescriptor {\n return { type: Types.TextStyle, options }\n}\n\ntype Video = {\n url?: string\n muted?: boolean\n playing?: boolean\n loop?: boolean\n controls?: boolean\n}\n\nexport type VideoValue = Video\n\ntype VideoOptions = Options<{ preset?: VideoValue }>\n\ntype VideoDescriptor<_T = VideoValue> = { type: typeof Types.Video; options: VideoOptions }\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Video(options: VideoOptions = {}): VideoDescriptor {\n return { type: Types.Video, options }\n}\n\nexport type WidthValue = ResponsiveValue<Length>\n\nexport const WidthPropControllerFormat = {\n ClassName: 'makeswift::prop-controllers::width::format::class-name',\n ResponsiveValue: 'makeswift::prop-controllers::width::format::responsive-value',\n} as const\n\ntype WidthControlValueFormat =\n typeof WidthPropControllerFormat[keyof typeof WidthPropControllerFormat]\n\ntype WidthOptions = {\n preset?: WidthValue\n defaultValue?: Length\n format?: WidthControlValueFormat\n}\n\nexport type WidthDescriptor<_T = WidthValue, U extends WidthOptions = WidthOptions> = {\n type: typeof Types.Width\n options: U\n}\n\n/**\n * @deprecated Imports from `@makeswift/runtime/prop-controllers` are deprecated. Use\n * `@makeswift/runtime/controls` instead.\n */\nexport function Width<T extends WidthOptions>(\n options: T & WidthOptions = {} as T,\n): WidthDescriptor<WidthValue, T> {\n return { type: Types.Width, options }\n}\n\nWidth.Format = WidthPropControllerFormat\n\nexport type Descriptor<T extends Data = Data> =\n | BackgroundsDescriptor<T>\n | BorderDescriptor<T>\n | BorderRadiusDescriptor<T>\n | CheckboxDescriptor<T>\n | DateDescriptor<T>\n | ElementIDDescriptor<T>\n | FontDescriptor<T>\n | GapXDescriptor<T>\n | GapYDescriptor<T>\n | GridDescriptor<T>\n | ImageDescriptor<T>\n | ImagesDescriptor<T>\n | LinkDescriptor<T>\n | ListDescriptor<T extends ListValue ? T : ListValue>\n | MarginDescriptor<T>\n | NavigationLinksDescriptor<T>\n | NumberDescriptor<T>\n | PaddingDescriptor<T>\n | ResponsiveColorDescriptor<T>\n | ResponsiveIconRadioGroupDescriptor<\n T extends ResponsiveIconRadioGroupValue<string> ? T : ResponsiveIconRadioGroupValue<string>\n >\n | ResponsiveLengthDescriptor<T>\n | ResponsiveNumberDescriptor<T>\n | ResponsiveOpacityDescriptor<T>\n | ResponsiveSelectDescriptor<\n T extends ResponsiveSelectValue<string> ? T : ResponsiveSelectValue<string>\n >\n | RichTextDescriptor<T>\n | ShadowsDescriptor<T>\n | ShapeDescriptor<T extends ShapeValue ? T : ShapeValue, any>\n | SocialLinksDescriptor<T>\n | TableDescriptor<T>\n | TableFormFieldsDescriptor<T>\n | TypeaheadDescriptor<T extends TypeaheadValue ? T : TypeaheadValue>\n | TextAreaDescriptor<T>\n | TextInputDescriptor<T>\n | TextStyleDescriptor<T>\n | VideoDescriptor<T>\n | WidthDescriptor<T>\n | StyleControlDefinition\n | StyleV2ControlDefinition\n | NumberControlDefinition\n | CheckboxControlDefinition\n | TextInputControlDefinition\n | TextAreaControlDefinition\n | SelectControlDefinition\n | ColorControlDefinition\n | IconRadioGroupControlDefinition\n | ImageControlDefinition\n | ComboboxControlDefinition\n | ShapeControlDefinition\n | ListControlDefinition\n | LinkControlDefinition\n | SlotControlDefinition\n | RichTextControlDefinition\n | RichTextV2ControlDefinition\n | TypographyControlDefinition\n\nexport type PanelDescriptorType =\n | typeof Types.Backgrounds\n | typeof Types.ResponsiveIconRadioGroup\n | typeof Types.Margin\n | typeof Types.Padding\n | typeof PropControllerTypes.Shadows\n | typeof PropControllerTypes.Border\n | typeof Types.GapY\n | typeof Types.GapX\n | typeof PropControllerTypes.BorderRadius\n | typeof PropControllerTypes.Checkbox\n | typeof Types.TextInput\n | typeof PropControllerTypes.Link\n | typeof Types.List\n | typeof Types.Shape\n | typeof Types.ResponsiveSelect\n | typeof PropControllerTypes.ResponsiveColor\n | typeof Types.TextStyle\n | typeof Types.Images\n | typeof Types.ResponsiveNumber\n | typeof PropControllerTypes.Number\n | typeof Types.Date\n | typeof Types.Font\n | typeof Types.TextArea\n | typeof Types.Table\n | typeof Types.Typeahead\n | typeof Types.RichText\n | typeof Types.Image\n | typeof Types.ResponsiveOpacity\n | typeof Types.SocialLinks\n | typeof Types.Video\n | typeof Types.NavigationLinks\n\nexport type PanelDescriptor<T extends Data = Data> = Extract<\n Descriptor<T>,\n { type: PanelDescriptorType }\n>\n\nexport type DescriptorValueType<T extends Descriptor> = T extends NumberControlDefinition\n ? NumberControlValue<T>\n : T extends CheckboxControlDefinition\n ? CheckboxControlValue<T>\n : T extends TextInputControlDefinition\n ? TextInputControlValue<T>\n : T extends TextAreaControlDefinition\n ? TextAreaControlValue<T>\n : T extends SelectControlDefinition\n ? SelectControlValue<T>\n : T extends ColorControlDefinition\n ? ColorControlValue<T>\n : T extends StyleControlDefinition\n ? StyleControlFormattedValue\n : T extends StyleV2ControlDefinition\n ? StyleV2ControlFormattedValue\n : T extends IconRadioGroupControlDefinition\n ? IconRadioGroupControlValue<T>\n : T extends ImageControlDefinition\n ? ResolveImageControlValue<T>\n : T extends ComboboxControlDefinition\n ? ComboboxControlValue<T>\n : T extends ShapeControlDefinition\n ? ShapeControlValue<T>\n : T extends ListControlDefinition\n ? ListControlValue<T>\n : T extends LinkControlDefinition\n ? LinkControlValue<T>\n : T extends SlotControlDefinition\n ? SlotControlValue\n : T extends RichTextControlDefinition\n ? RichTextControlValue\n : T extends RichTextV2ControlDefinition\n ? RichTextV2ControlValue\n : T extends StyleV2ControlDefinition\n ? StyleV2ControlFormattedValue\n : T extends TypographyControlDefinition\n ? TypographyControlValue\n : T['type'] extends typeof PropControllerTypes.ResponsiveColor\n ? // TODO(miguel): We're not importing a resolver type from `@makeswift/prop-controllers` because\n // the resolved type is tightly coupled with the runtime (i.e., it's the result of an API call).\n // This means that we probably want to rethink how types are resolved and where that lives.\n ResponsiveColor | null | undefined\n : T['type'] extends typeof PropControllerTypes.Checkbox\n ? ResolveCheckboxPropControllerValue<Extract<T, { type: typeof PropControllerTypes.Checkbox }>>\n : T['type'] extends typeof PropControllerTypes.Link\n ? LinkPropControllerValue\n : T['type'] extends typeof Types.Width\n ? ResolveWidthControlValue<T>\n : T['type'] extends typeof Types.Padding\n ? ResolvePaddingControlValue<T>\n : T['type'] extends typeof Types.Margin\n ? ResolveMarginControlValue<T>\n : T['type'] extends typeof PropControllerTypes.BorderRadius\n ? ResolveBorderRadiusPropControllerValue<\n Extract<T, { type: typeof PropControllerTypes.BorderRadius }>\n >\n : T['type'] extends typeof PropControllerTypes.Shadows\n ? ResolveShadowsPropControllerValue<Extract<T, { type: typeof PropControllerTypes.Shadows }>>\n : T['type'] extends typeof PropControllerTypes.ResponsiveLength\n ? ResolveResponsiveLengthPropControllerValue<\n Extract<T, { type: typeof PropControllerTypes.ResponsiveLength }>\n >\n : T['type'] extends typeof PropControllerTypes.Border\n ? ResolveBorderPropControllerValue<Extract<T, { type: typeof PropControllerTypes.Border }>>\n : T['type'] extends typeof PropControllerTypes.Number\n ? ResolveNumberPropControllerValue<Extract<T, { type: typeof PropControllerTypes.Number }>>\n : T extends Descriptor<infer U>\n ? U | undefined\n : never\n\nexport type PanelDescriptorValueType<T extends PanelDescriptor> = T extends PanelDescriptor<infer U>\n ? U\n : never\n"],"mappings":";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AO,EAAE,MAAM,MAAM,WAAW,QAAQ;AAC1C;AAoBO,SAAS,MAAM,UAAwB,CAAC,GAAoB;AACjE,SAAO,EAAE,MAAM,MAAM,OAAO,QAAQ;AACtC;AAIO,MAAM,4BAA4B;AAAA,EACvC,WAAW;AAAA,EACX,iBAAiB;AACnB;AAoBO,SAAS,MACd,UAA4B,CAAC,GACG;AAChC,SAAO,EAAE,MAAM,MAAM,OAAO,QAAQ;AACtC;AAEA,MAAM,SAAS;","names":["import_style"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/prop-controllers/index.ts"],"sourcesContent":["export type {\n
|
|
1
|
+
{"version":3,"sources":["../../../src/prop-controllers/index.ts"],"sourcesContent":["export type {\n Data,\n Descriptor as PropControllerDescriptor,\n DescriptorValueType as PropControllerDescriptorValueType,\n Gap,\n DateDescriptor,\n DateValue,\n GapXDescriptor,\n GapXOptions,\n GapXValue,\n GapYDescriptor,\n GapYOptions,\n GapYValue,\n ResponsiveNumberDescriptor,\n ResponsiveNumberOptions,\n ResponsiveNumberValue,\n ResponsiveIconRadioGroupDescriptor,\n ResponsiveIconRadioGroupValue,\n ResponsiveSelectDescriptor,\n ResponsiveSelectValue,\n ImageDescriptor,\n ImageValue,\n ImageValueV0,\n ImageValueV1,\n ImagesDescriptor,\n ImagesValueV0Item,\n ImagesValueV1Item,\n ImagesValueItem,\n ImagesValue,\n ImageBackground,\n BackgroundsDescriptor,\n BackgroundImage,\n ListDescriptor,\n ListValue,\n ListOptions,\n RichTextDescriptor,\n RichTextValue,\n ShapeDescriptor,\n ShapeValue,\n TextInputDescriptor,\n TextInputValue,\n TextStyleDescriptor,\n TextStyleValue,\n TypeaheadDescriptor,\n TypeaheadValue,\n TypeaheadOptions,\n PanelDescriptor,\n PanelDescriptorType,\n PanelDescriptorValueType,\n SocialLinksDescriptor,\n SocialLinksValue,\n} from './descriptors'\nexport type {\n ResponsiveValueType,\n Device,\n DeviceOverride,\n ResponsiveValue,\n} from '@makeswift/prop-controllers'\nexport { socialLinkTypesV0, socialLinkTypesV1 } from './descriptors'\nexport * as Props from './descriptors'\nexport type {\n PropControllerMessage,\n RichTextPropControllerMessage,\n TableFormFieldsMessage,\n} from './instances'\nexport { RichTextPropControllerMessageType, TableFormFieldsMessageType } from './instances'\nexport * as Introspection from './introspection'\nexport { copy as imageCopy } from './copy/image'\nexport { copy as imagesCopy } from './copy/images'\nexport { copy as backgroundsCopy } from './copy/backgrounds'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA0DA,yBAAqD;AACrD,YAAuB;AAMvB,uBAA8E;AAC9E,oBAA+B;AAC/B,mBAAkC;AAClC,oBAAmC;AACnC,yBAAwC;","names":[]}
|
|
@@ -20,13 +20,10 @@ var introspection_exports = {};
|
|
|
20
20
|
__export(introspection_exports, {
|
|
21
21
|
getBackgroundsFileIds: () => getBackgroundsFileIds,
|
|
22
22
|
getBackgroundsSwatchIds: () => getBackgroundsSwatchIds,
|
|
23
|
-
getBorderSwatchIds: () => getBorderSwatchIds,
|
|
24
|
-
getBoxShadowsSwatchIds: () => getBoxShadowsSwatchIds,
|
|
25
23
|
getElementChildren: () => getElementChildren,
|
|
26
24
|
getElementId: () => getElementId,
|
|
27
25
|
getFileIds: () => getFileIds,
|
|
28
26
|
getPageIds: () => getPageIds,
|
|
29
|
-
getResponsiveColorSwatchIds: () => getResponsiveColorSwatchIds,
|
|
30
27
|
getSwatchIds: () => getSwatchIds,
|
|
31
28
|
getTableIds: () => getTableIds,
|
|
32
29
|
getTypographyIds: () => getTypographyIds
|
|
@@ -38,6 +35,7 @@ var import_introspection = require("../controls/rich-text/introspection");
|
|
|
38
35
|
var import_introspection2 = require("../controls/rich-text-v2/introspection");
|
|
39
36
|
var import_rich_text_v2 = require("../controls/rich-text-v2/rich-text-v2");
|
|
40
37
|
var import_ts_pattern = require("ts-pattern");
|
|
38
|
+
var import_prop_controllers = require("@makeswift/prop-controllers");
|
|
41
39
|
function getElementChildren(descriptor, prop) {
|
|
42
40
|
if (prop == null)
|
|
43
41
|
return [];
|
|
@@ -90,30 +88,14 @@ function getBackgroundsSwatchIds(value) {
|
|
|
90
88
|
}
|
|
91
89
|
}) ?? [];
|
|
92
90
|
}
|
|
93
|
-
function getBorderSwatchIds(value) {
|
|
94
|
-
return value?.flatMap((override) => override.value).flatMap((borderValue) => {
|
|
95
|
-
return [
|
|
96
|
-
borderValue.borderTop?.color?.swatchId,
|
|
97
|
-
borderValue.borderRight?.color?.swatchId,
|
|
98
|
-
borderValue.borderBottom?.color?.swatchId,
|
|
99
|
-
borderValue.borderLeft?.color?.swatchId
|
|
100
|
-
].filter((swatchId) => swatchId != null);
|
|
101
|
-
}) ?? [];
|
|
102
|
-
}
|
|
103
|
-
function getBoxShadowsSwatchIds(value) {
|
|
104
|
-
return value?.flatMap((override) => override.value).map((item) => item.payload.color?.swatchId).filter((swatchId) => swatchId != null) ?? [];
|
|
105
|
-
}
|
|
106
|
-
function getResponsiveColorSwatchIds(value) {
|
|
107
|
-
return value?.map((override) => override.value).map((color) => color.swatchId) ?? [];
|
|
108
|
-
}
|
|
109
91
|
function getSwatchIds(descriptor, prop) {
|
|
110
92
|
if (prop == null)
|
|
111
93
|
return [];
|
|
112
94
|
switch (descriptor.type) {
|
|
113
95
|
case import_descriptors.Types.Backgrounds:
|
|
114
96
|
return getBackgroundsSwatchIds(prop);
|
|
115
|
-
case
|
|
116
|
-
return
|
|
97
|
+
case import_prop_controllers.Types.Border:
|
|
98
|
+
return (0, import_prop_controllers.getBorderPropControllerDataSwatchIds)(prop);
|
|
117
99
|
case import_descriptors.Types.NavigationLinks: {
|
|
118
100
|
const value = prop;
|
|
119
101
|
return value?.flatMap((item) => {
|
|
@@ -127,10 +109,10 @@ function getSwatchIds(descriptor, prop) {
|
|
|
127
109
|
}
|
|
128
110
|
}) ?? [];
|
|
129
111
|
}
|
|
130
|
-
case
|
|
131
|
-
return
|
|
132
|
-
case
|
|
133
|
-
return
|
|
112
|
+
case import_prop_controllers.Types.ResponsiveColor:
|
|
113
|
+
return (0, import_prop_controllers.getResponsiveColorPropControllerDataSawtchIds)(prop);
|
|
114
|
+
case import_prop_controllers.Types.Shadows:
|
|
115
|
+
return (0, import_prop_controllers.getShadowsPropControllerDataSwatchIds)(prop);
|
|
134
116
|
case import_controls.RichTextControlType:
|
|
135
117
|
case import_descriptors.Types.RichText: {
|
|
136
118
|
return (0, import_introspection.getRichTextSwatchIds)(prop);
|
|
@@ -259,16 +241,8 @@ function getPageIds(descriptor, prop) {
|
|
|
259
241
|
if (prop == null)
|
|
260
242
|
return [];
|
|
261
243
|
switch (descriptor.type) {
|
|
262
|
-
case
|
|
263
|
-
|
|
264
|
-
if (value == null)
|
|
265
|
-
return [];
|
|
266
|
-
switch (value.type) {
|
|
267
|
-
case "OPEN_PAGE":
|
|
268
|
-
return value.payload.pageId == null ? [] : [value.payload.pageId];
|
|
269
|
-
default:
|
|
270
|
-
return [];
|
|
271
|
-
}
|
|
244
|
+
case import_prop_controllers.Types.Link: {
|
|
245
|
+
return (0, import_prop_controllers.getLinkPropControllerPageIds)(prop);
|
|
272
246
|
}
|
|
273
247
|
case import_controls.LinkControlType: {
|
|
274
248
|
const value = prop;
|
|
@@ -342,13 +316,10 @@ function getPageIds(descriptor, prop) {
|
|
|
342
316
|
0 && (module.exports = {
|
|
343
317
|
getBackgroundsFileIds,
|
|
344
318
|
getBackgroundsSwatchIds,
|
|
345
|
-
getBorderSwatchIds,
|
|
346
|
-
getBoxShadowsSwatchIds,
|
|
347
319
|
getElementChildren,
|
|
348
320
|
getElementId,
|
|
349
321
|
getFileIds,
|
|
350
322
|
getPageIds,
|
|
351
|
-
getResponsiveColorSwatchIds,
|
|
352
323
|
getSwatchIds,
|
|
353
324
|
getTableIds,
|
|
354
325
|
getTypographyIds
|