@makeswift/runtime 0.18.0-canary.4 → 0.18.0-canary.5
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 +2 -2
- package/dist/cjs/builder/serialization/control-serialization.js.map +1 -1
- package/dist/cjs/components/builtin/Button/register.js +1 -1
- package/dist/cjs/components/builtin/Button/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 -4
- package/dist/cjs/components/builtin/Countdown/register.js.map +1 -1
- package/dist/cjs/components/builtin/Form/Form.js.map +1 -1
- package/dist/cjs/components/builtin/Form/register.js +1 -1
- 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 +13 -14
- 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/register.js +1 -1
- package/dist/cjs/components/builtin/Navigation/register.js.map +1 -1
- package/dist/cjs/components/builtin/SocialLinks/register.js +16 -6
- package/dist/cjs/components/builtin/SocialLinks/register.js.map +1 -1
- package/dist/cjs/components/hooks/useTextInputPropControllerData.js +32 -0
- package/dist/cjs/components/hooks/useTextInputPropControllerData.js.map +1 -0
- package/dist/cjs/controls/control.js +2 -3
- package/dist/cjs/controls/control.js.map +1 -1
- package/dist/cjs/next/api-handler/handlers/manifest.js +1 -1
- package/dist/cjs/prop-controllers/descriptors.js +2 -44
- package/dist/cjs/prop-controllers/descriptors.js.map +1 -1
- package/dist/cjs/prop-controllers/index.js +2 -7
- package/dist/cjs/prop-controllers/index.js.map +1 -1
- package/dist/cjs/runtimes/react/controls.js +16 -0
- package/dist/cjs/runtimes/react/controls.js.map +1 -1
- package/dist/esm/builder/serialization/control-serialization.js +2 -2
- package/dist/esm/builder/serialization/control-serialization.js.map +1 -1
- package/dist/esm/components/builtin/Button/register.js +2 -1
- package/dist/esm/components/builtin/Button/register.js.map +1 -1
- package/dist/esm/components/builtin/Countdown/Countdown.js.map +1 -1
- package/dist/esm/components/builtin/Countdown/register.js +5 -4
- package/dist/esm/components/builtin/Countdown/register.js.map +1 -1
- package/dist/esm/components/builtin/Form/Form.js.map +1 -1
- package/dist/esm/components/builtin/Form/register.js +2 -1
- 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 +3 -3
- 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/register.js +3 -2
- package/dist/esm/components/builtin/Navigation/register.js.map +1 -1
- package/dist/esm/components/builtin/SocialLinks/register.js +25 -7
- package/dist/esm/components/builtin/SocialLinks/register.js.map +1 -1
- package/dist/esm/components/hooks/useTextInputPropControllerData.js +10 -0
- package/dist/esm/components/hooks/useTextInputPropControllerData.js.map +1 -0
- package/dist/esm/controls/control.js +2 -3
- package/dist/esm/controls/control.js.map +1 -1
- package/dist/esm/next/api-handler/handlers/manifest.js +1 -1
- package/dist/esm/prop-controllers/descriptors.js +1 -39
- package/dist/esm/prop-controllers/descriptors.js.map +1 -1
- package/dist/esm/prop-controllers/index.js +1 -4
- package/dist/esm/prop-controllers/index.js.map +1 -1
- package/dist/esm/runtimes/react/controls.js +25 -2
- package/dist/esm/runtimes/react/controls.js.map +1 -1
- package/dist/types/builder/serialization/control-serialization.d.ts +5 -4
- package/dist/types/builder/serialization/control-serialization.d.ts.map +1 -1
- package/dist/types/components/builtin/Button/register.d.ts.map +1 -1
- package/dist/types/components/builtin/Countdown/Countdown.d.ts +5 -5
- 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/Form/Form.d.ts +2 -2
- package/dist/types/components/builtin/Form/Form.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 +1 -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 +2 -2
- package/dist/types/components/builtin/Navigation/Navigation.d.ts.map +1 -1
- package/dist/types/components/builtin/Navigation/register.d.ts.map +1 -1
- package/dist/types/components/builtin/SocialLinks/register.d.ts.map +1 -1
- package/dist/types/components/hooks/useTextInputPropControllerData.d.ts +3 -0
- package/dist/types/components/hooks/useTextInputPropControllerData.d.ts.map +1 -0
- package/dist/types/controls/control.d.ts.map +1 -1
- package/dist/types/next/components/tests/page-social-links-prop-controller.test.d.ts +3 -0
- package/dist/types/next/components/tests/page-social-links-prop-controller.test.d.ts.map +1 -0
- package/dist/types/next/components/tests/page-text-input-prop-controller.test.d.ts +3 -0
- package/dist/types/next/components/tests/page-text-input-prop-controller.test.d.ts.map +1 -0
- package/dist/types/prop-controllers/descriptors.d.ts +6 -61
- package/dist/types/prop-controllers/descriptors.d.ts.map +1 -1
- package/dist/types/prop-controllers/index.d.ts +1 -2
- package/dist/types/prop-controllers/index.d.ts.map +1 -1
- package/dist/types/runtimes/react/controls.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/builtin/Navigation/register.ts"],"sourcesContent":["import { Props } from '../../../prop-controllers'\nimport { ResponsiveSelectValue } from '../../../prop-controllers/descriptors'\nimport { ReactRuntime } from '../../../runtimes/react'\nimport { findBreakpointOverride, getBaseBreakpoint } from '../../../state/modules/breakpoints'\nimport { MakeswiftComponentType } from '../constants'\nimport { ComponentIcon } from '../../../state/modules/components-meta'\nimport { lazy } from 'react'\nimport {\n ControlDataTypeKey,\n Checkbox,\n Link,\n ResponsiveColor,\n ResponsiveLength,\n ResponsiveLengthPropControllerDataV1Type,\n checkboxPropControllerDataSchema,\n getCheckboxPropControllerDataBoolean,\n Margin,\n Width,\n TextStyle,\n NavigationLinks,\n NavigationLinksData,\n GapX,\n ElementID,\n Image,\n} from '@makeswift/prop-controllers'\n\nexport function registerComponent(runtime: ReactRuntime) {\n return runtime.registerComponent(\n lazy(() => import('./Navigation')),\n {\n type: MakeswiftComponentType.Navigation,\n label: 'Navigation',\n icon: ComponentIcon.Navigation,\n props: {\n id: ElementID(),\n links: NavigationLinks(),\n linkTextStyle: TextStyle(props => {\n const links = props.links as NavigationLinksData | undefined\n\n return {\n label: 'Link text style',\n hidden: links == null || links.length === 0,\n }\n }),\n showLogo: Checkbox({ preset: true, label: 'Show logo' }),\n logoFile: Image(props => ({\n label: 'Logo',\n hidden:\n getCheckboxPropControllerDataBoolean(\n checkboxPropControllerDataSchema.optional().catch(undefined).parse(props.showLogo),\n ) === false,\n })),\n logoWidth: ResponsiveLength(props => ({\n // TODO(miguel): We're manually constructing the data here but should be using a factory\n // function instead. This is because the factory function currently expects a definition\n // but we don't have one to pass here. Perhaps we should make the factory function not\n // require the definition and use the latest version when a definition isn't provided.\n preset: {\n [ControlDataTypeKey]: ResponsiveLengthPropControllerDataV1Type,\n value: [\n {\n deviceId: getBaseBreakpoint(runtime.getBreakpoints()).id,\n value: { value: 100, unit: 'px' },\n },\n ],\n },\n label: 'Logo width',\n min: 0,\n max: 1000,\n // TODO: This is hardcoded value, import it from LengthInputOptions\n options: [{ value: 'px', label: 'Pixels', icon: 'Px16' }],\n hidden:\n getCheckboxPropControllerDataBoolean(\n checkboxPropControllerDataSchema.optional().catch(undefined).parse(props.showLogo),\n ) === false,\n })),\n logoAltText:
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/builtin/Navigation/register.ts"],"sourcesContent":["import { Props } from '../../../prop-controllers'\nimport { ResponsiveSelectValue } from '../../../prop-controllers/descriptors'\nimport { ReactRuntime } from '../../../runtimes/react'\nimport { findBreakpointOverride, getBaseBreakpoint } from '../../../state/modules/breakpoints'\nimport { MakeswiftComponentType } from '../constants'\nimport { ComponentIcon } from '../../../state/modules/components-meta'\nimport { lazy } from 'react'\nimport {\n ControlDataTypeKey,\n Checkbox,\n Link,\n ResponsiveColor,\n ResponsiveLength,\n ResponsiveLengthPropControllerDataV1Type,\n checkboxPropControllerDataSchema,\n getCheckboxPropControllerDataBoolean,\n Margin,\n Width,\n TextStyle,\n NavigationLinks,\n NavigationLinksData,\n GapX,\n ElementID,\n Image,\n TextInput,\n} from '@makeswift/prop-controllers'\n\nexport function registerComponent(runtime: ReactRuntime) {\n return runtime.registerComponent(\n lazy(() => import('./Navigation')),\n {\n type: MakeswiftComponentType.Navigation,\n label: 'Navigation',\n icon: ComponentIcon.Navigation,\n props: {\n id: ElementID(),\n links: NavigationLinks(),\n linkTextStyle: TextStyle(props => {\n const links = props.links as NavigationLinksData | undefined\n\n return {\n label: 'Link text style',\n hidden: links == null || links.length === 0,\n }\n }),\n showLogo: Checkbox({ preset: true, label: 'Show logo' }),\n logoFile: Image(props => ({\n label: 'Logo',\n hidden:\n getCheckboxPropControllerDataBoolean(\n checkboxPropControllerDataSchema.optional().catch(undefined).parse(props.showLogo),\n ) === false,\n })),\n logoWidth: ResponsiveLength(props => ({\n // TODO(miguel): We're manually constructing the data here but should be using a factory\n // function instead. This is because the factory function currently expects a definition\n // but we don't have one to pass here. Perhaps we should make the factory function not\n // require the definition and use the latest version when a definition isn't provided.\n preset: {\n [ControlDataTypeKey]: ResponsiveLengthPropControllerDataV1Type,\n value: [\n {\n deviceId: getBaseBreakpoint(runtime.getBreakpoints()).id,\n value: { value: 100, unit: 'px' },\n },\n ],\n },\n label: 'Logo width',\n min: 0,\n max: 1000,\n // TODO: This is hardcoded value, import it from LengthInputOptions\n options: [{ value: 'px', label: 'Pixels', icon: 'Px16' }],\n hidden:\n getCheckboxPropControllerDataBoolean(\n checkboxPropControllerDataSchema.optional().catch(undefined).parse(props.showLogo),\n ) === false,\n })),\n logoAltText: TextInput(props => ({\n label: 'Logo alt text',\n hidden:\n getCheckboxPropControllerDataBoolean(\n checkboxPropControllerDataSchema.optional().catch(undefined).parse(props.showLogo),\n ) === false,\n })),\n logoLink: Link(props => ({\n label: 'Logo on click',\n hidden:\n getCheckboxPropControllerDataBoolean(\n checkboxPropControllerDataSchema.optional().catch(undefined).parse(props.showLogo),\n ) === false,\n })),\n alignment: Props.ResponsiveIconRadioGroup({\n label: 'Alignment',\n options: [\n { label: 'Left', value: 'flex-start', icon: 'AlignLeft16' },\n { label: 'Center', value: 'center', icon: 'AlignCenter16' },\n { label: 'End', value: 'flex-end', icon: 'AlignRight16' },\n ],\n defaultValue: 'flex-end',\n }),\n gutter: GapX({\n preset: [\n {\n deviceId: getBaseBreakpoint(runtime.getBreakpoints()).id,\n value: { value: 10, unit: 'px' },\n },\n ],\n label: 'Link gap',\n min: 0,\n max: 100,\n step: 1,\n defaultValue: { value: 0, unit: 'px' },\n }),\n mobileMenuAnimation: Props.ResponsiveSelect({\n label: 'Mobile menu',\n options: [\n { value: 'coverRight', label: 'Cover from right' },\n { value: 'coverLeft', label: 'Cover from left' },\n ],\n }),\n mobileMenuOpenIconColor: ResponsiveColor((props, device) => {\n const mobileMenuAnimation = props.mobileMenuAnimation as\n | ResponsiveSelectValue<string>\n | undefined\n const hidden = !findBreakpointOverride(\n runtime.getBreakpoints(),\n mobileMenuAnimation,\n device,\n )\n\n return {\n label: 'Open icon color',\n placeholder: 'rgba(161, 168, 194, 0.5)',\n hidden,\n }\n }),\n mobileMenuCloseIconColor: ResponsiveColor((props, device) => {\n const mobileMenuAnimation = props.mobileMenuAnimation as\n | ResponsiveSelectValue<string>\n | undefined\n const hidden = !findBreakpointOverride(\n runtime.getBreakpoints(),\n mobileMenuAnimation,\n device,\n )\n\n return {\n label: 'Close icon color',\n placeholder: 'rgba(161, 168, 194, 0.5)',\n hidden,\n }\n }),\n mobileMenuBackgroundColor: ResponsiveColor((props, device) => {\n const mobileMenuAnimation = props.mobileMenuAnimation as\n | ResponsiveSelectValue<string>\n | undefined\n const hidden = !findBreakpointOverride(\n runtime.getBreakpoints(),\n mobileMenuAnimation,\n device,\n )\n\n return {\n label: 'Menu BG color',\n placeholder: 'black',\n hidden,\n }\n }),\n width: Width({\n format: Width.Format.ClassName,\n defaultValue: { value: 100, unit: '%' },\n }),\n margin: Margin({ format: Margin.Format.ClassName }),\n },\n },\n )\n}\n"],"mappings":"AAAA,SAAS,aAAa;AAGtB,SAAS,wBAAwB,yBAAyB;AAC1D,SAAS,8BAA8B;AACvC,SAAS,qBAAqB;AAC9B,SAAS,YAAY;AACrB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEA,SAAS,kBAAkB,SAAuB;AACvD,SAAO,QAAQ;AAAA,IACb,KAAK,MAAM,OAAO,cAAc,CAAC;AAAA,IACjC;AAAA,MACE,MAAM,uBAAuB;AAAA,MAC7B,OAAO;AAAA,MACP,MAAM,cAAc;AAAA,MACpB,OAAO;AAAA,QACL,IAAI,UAAU;AAAA,QACd,OAAO,gBAAgB;AAAA,QACvB,eAAe,UAAU,WAAS;AAChC,gBAAM,QAAQ,MAAM;AAEpB,iBAAO;AAAA,YACL,OAAO;AAAA,YACP,QAAQ,SAAS,QAAQ,MAAM,WAAW;AAAA,UAC5C;AAAA,QACF,CAAC;AAAA,QACD,UAAU,SAAS,EAAE,QAAQ,MAAM,OAAO,YAAY,CAAC;AAAA,QACvD,UAAU,MAAM,YAAU;AAAA,UACxB,OAAO;AAAA,UACP,QACE;AAAA,YACE,iCAAiC,SAAS,EAAE,MAAM,MAAS,EAAE,MAAM,MAAM,QAAQ;AAAA,UACnF,MAAM;AAAA,QACV,EAAE;AAAA,QACF,WAAW,iBAAiB,YAAU;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,OAAO,EAAE,QAAQ,OAAO,OAAO,UAAU,CAAC;AAAA,MACpD;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
|
|
@@ -3,7 +3,15 @@ import { getBaseBreakpoint } from "../../../state/modules/breakpoints";
|
|
|
3
3
|
import { MakeswiftComponentType } from "../constants";
|
|
4
4
|
import { ComponentIcon } from "../../../state/modules/components-meta";
|
|
5
5
|
import { lazy } from "react";
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
ElementID,
|
|
8
|
+
GapX,
|
|
9
|
+
Margin,
|
|
10
|
+
ResponsiveColor,
|
|
11
|
+
SocialLinks,
|
|
12
|
+
Width,
|
|
13
|
+
getSocialLinksPropControllerDataSocialLinksData
|
|
14
|
+
} from "@makeswift/prop-controllers";
|
|
7
15
|
function registerComponent(runtime) {
|
|
8
16
|
return runtime.registerComponent(
|
|
9
17
|
lazy(() => import("./SocialLinks")),
|
|
@@ -13,7 +21,7 @@ function registerComponent(runtime) {
|
|
|
13
21
|
icon: ComponentIcon.SocialLinks,
|
|
14
22
|
props: {
|
|
15
23
|
id: ElementID(),
|
|
16
|
-
links:
|
|
24
|
+
links: SocialLinks({
|
|
17
25
|
preset: {
|
|
18
26
|
links: [
|
|
19
27
|
{
|
|
@@ -33,7 +41,9 @@ function registerComponent(runtime) {
|
|
|
33
41
|
}
|
|
34
42
|
}),
|
|
35
43
|
shape: Props.ResponsiveIconRadioGroup((props) => {
|
|
36
|
-
const links =
|
|
44
|
+
const links = getSocialLinksPropControllerDataSocialLinksData(
|
|
45
|
+
props.links
|
|
46
|
+
);
|
|
37
47
|
return {
|
|
38
48
|
label: "Shape",
|
|
39
49
|
options: [
|
|
@@ -47,7 +57,9 @@ function registerComponent(runtime) {
|
|
|
47
57
|
};
|
|
48
58
|
}),
|
|
49
59
|
size: Props.ResponsiveIconRadioGroup((props) => {
|
|
50
|
-
const links =
|
|
60
|
+
const links = getSocialLinksPropControllerDataSocialLinksData(
|
|
61
|
+
props.links
|
|
62
|
+
);
|
|
51
63
|
return {
|
|
52
64
|
label: "Size",
|
|
53
65
|
options: [
|
|
@@ -60,7 +72,9 @@ function registerComponent(runtime) {
|
|
|
60
72
|
};
|
|
61
73
|
}),
|
|
62
74
|
hoverStyle: Props.ResponsiveSelect((props) => {
|
|
63
|
-
const links =
|
|
75
|
+
const links = getSocialLinksPropControllerDataSocialLinksData(
|
|
76
|
+
props.links
|
|
77
|
+
);
|
|
64
78
|
const hidden = links == null || links.links.length === 0;
|
|
65
79
|
return {
|
|
66
80
|
label: "On hover",
|
|
@@ -76,7 +90,9 @@ function registerComponent(runtime) {
|
|
|
76
90
|
};
|
|
77
91
|
}),
|
|
78
92
|
fill: ResponsiveColor((props) => {
|
|
79
|
-
const links =
|
|
93
|
+
const links = getSocialLinksPropControllerDataSocialLinksData(
|
|
94
|
+
props.links
|
|
95
|
+
);
|
|
80
96
|
const hidden = links == null || links.links.length === 0;
|
|
81
97
|
return {
|
|
82
98
|
label: "Icon color",
|
|
@@ -84,7 +100,9 @@ function registerComponent(runtime) {
|
|
|
84
100
|
};
|
|
85
101
|
}),
|
|
86
102
|
backgroundColor: ResponsiveColor((props) => {
|
|
87
|
-
const links =
|
|
103
|
+
const links = getSocialLinksPropControllerDataSocialLinksData(
|
|
104
|
+
props.links
|
|
105
|
+
);
|
|
88
106
|
const hidden = links == null || links.links.length === 0;
|
|
89
107
|
return {
|
|
90
108
|
label: "Shape color",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/builtin/SocialLinks/register.ts"],"sourcesContent":["import { Props } from '../../../prop-controllers'\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/builtin/SocialLinks/register.ts"],"sourcesContent":["import { Props } from '../../../prop-controllers'\nimport { ReactRuntime } from '../../../runtimes/react'\nimport { getBaseBreakpoint } from '../../../state/modules/breakpoints'\nimport { MakeswiftComponentType } from '../constants'\nimport { ComponentIcon } from '../../../state/modules/components-meta'\nimport { lazy } from 'react'\nimport {\n ElementID,\n GapX,\n Margin,\n ResponsiveColor,\n SocialLinks,\n SocialLinksPropControllerData,\n Width,\n getSocialLinksPropControllerDataSocialLinksData,\n} from '@makeswift/prop-controllers'\n\nexport function registerComponent(runtime: ReactRuntime) {\n return runtime.registerComponent(\n lazy(() => import('./SocialLinks')),\n {\n type: MakeswiftComponentType.SocialLinks,\n label: 'Social Links',\n icon: ComponentIcon.SocialLinks,\n props: {\n id: ElementID(),\n links: SocialLinks({\n preset: {\n links: [\n {\n id: 'facebook',\n payload: { type: 'facebook', url: 'https://www.facebook.com' },\n },\n {\n id: 'instagram',\n payload: { type: 'instagram', url: 'https://www.instagram.com' },\n },\n {\n id: 'twitter',\n payload: { type: 'twitter', url: 'https://www.twitter.com' },\n },\n ],\n openInNewTab: false,\n },\n }),\n shape: Props.ResponsiveIconRadioGroup(props => {\n const links = getSocialLinksPropControllerDataSocialLinksData(\n props.links as SocialLinksPropControllerData | undefined,\n )\n\n return {\n label: 'Shape',\n options: [\n { label: 'Naked', value: 'naked', icon: 'Star16' },\n { label: 'Circle', value: 'circle', icon: 'StarCircle16' },\n { label: 'Rounded', value: 'rounded', icon: 'StarRoundedSquare16' },\n { label: 'Square', value: 'square', icon: 'StarSquare16' },\n ],\n defaultValue: 'naked',\n hidden: links == null || links.links.length === 0,\n }\n }),\n size: Props.ResponsiveIconRadioGroup(props => {\n const links = getSocialLinksPropControllerDataSocialLinksData(\n props.links as SocialLinksPropControllerData | undefined,\n )\n\n return {\n label: 'Size',\n options: [\n { label: 'Small', value: 'small', icon: 'SizeSmall16' },\n { label: 'Medium', value: 'medium', icon: 'SizeMedium16' },\n { label: 'Large', value: 'large', icon: 'SizeLarge16' },\n ],\n defaultValue: 'medium',\n hidden: links == null || links.links.length === 0,\n }\n }),\n hoverStyle: Props.ResponsiveSelect(props => {\n const links = getSocialLinksPropControllerDataSocialLinksData(\n props.links as SocialLinksPropControllerData | undefined,\n )\n const hidden = links == null || links.links.length === 0\n\n return {\n label: 'On hover',\n options: [\n { value: 'none', label: 'None' },\n { value: 'grow', label: 'Grow' },\n { value: 'shrink', label: 'Shrink' },\n { value: 'fade', label: 'Fade' },\n ],\n defaultValue: 'none',\n labelOrientation: 'horizontal',\n hidden,\n }\n }),\n fill: ResponsiveColor(props => {\n const links = getSocialLinksPropControllerDataSocialLinksData(\n props.links as SocialLinksPropControllerData | undefined,\n )\n const hidden = links == null || links.links.length === 0\n\n return {\n label: 'Icon color',\n hidden,\n }\n }),\n backgroundColor: ResponsiveColor(props => {\n const links = getSocialLinksPropControllerDataSocialLinksData(\n props.links as SocialLinksPropControllerData | undefined,\n )\n const hidden = links == null || links.links.length === 0\n\n return {\n label: 'Shape color',\n hidden,\n }\n }),\n alignment: Props.ResponsiveIconRadioGroup({\n label: 'Alignment',\n options: [\n { label: 'flex-start', value: 'flex-start', icon: 'AlignLeft16' },\n { label: 'center', value: 'center', icon: 'AlignCenter16' },\n { label: 'flex-end', value: 'flex-end', icon: 'AlignRight16' },\n ],\n defaultValue: 'center',\n }),\n gutter: GapX({\n preset: [\n {\n deviceId: getBaseBreakpoint(runtime.getBreakpoints()).id,\n value: { value: 10, unit: 'px' },\n },\n ],\n label: 'Link gap',\n min: 0,\n max: 100,\n step: 1,\n defaultValue: { value: 0, unit: 'px' },\n }),\n width: Width({\n format: Width.Format.ClassName,\n defaultValue: { value: 100, unit: '%' },\n }),\n margin: Margin({\n format: Margin.Format.ClassName,\n preset: [\n {\n deviceId: getBaseBreakpoint(runtime.getBreakpoints()).id,\n value: {\n marginTop: { value: 10, unit: 'px' },\n marginRight: 'auto',\n marginBottom: { value: 10, unit: 'px' },\n marginLeft: 'auto',\n },\n },\n ],\n }),\n },\n },\n )\n}\n"],"mappings":"AAAA,SAAS,aAAa;AAEtB,SAAS,yBAAyB;AAClC,SAAS,8BAA8B;AACvC,SAAS,qBAAqB;AAC9B,SAAS,YAAY;AACrB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAA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c;AAAA,YAChE,EAAE,OAAO,UAAU,OAAO,UAAU,MAAM,gBAAgB;AAAA,YAC1D,EAAE,OAAO,YAAY,OAAO,YAAY,MAAM,eAAe;AAAA,UAC/D;AAAA,UACA,cAAc;AAAA,QAChB,CAAC;AAAA,QACD,QAAQ,KAAK;AAAA,UACX,QAAQ;AAAA,YACN;AAAA,cACE,UAAU,kBAAkB,QAAQ,eAAe,CAAC,EAAE;AAAA,cACtD,OAAO,EAAE,OAAO,IAAI,MAAM,KAAK;AAAA,YACjC;AAAA,UACF;AAAA,UACA,OAAO;AAAA,UACP,KAAK;AAAA,UACL,KAAK;AAAA,UACL,MAAM;AAAA,UACN,cAAc,EAAE,OAAO,GAAG,MAAM,KAAK;AAAA,QACvC,CAAC;AAAA,QACD,OAAO,MAAM;AAAA,UACX,QAAQ,MAAM,OAAO;AAAA,UACrB,cAAc,EAAE,OAAO,KAAK,MAAM,IAAI;AAAA,QACxC,CAAC;AAAA,QACD,QAAQ,OAAO;AAAA,UACb,QAAQ,OAAO,OAAO;AAAA,UACtB,QAAQ;AAAA,YACN;AAAA,cACE,UAAU,kBAAkB,QAAQ,eAAe,CAAC,EAAE;AAAA,cACtD,OAAO;AAAA,gBACL,WAAW,EAAE,OAAO,IAAI,MAAM,KAAK;AAAA,gBACnC,aAAa;AAAA,gBACb,cAAc,EAAE,OAAO,IAAI,MAAM,KAAK;AAAA,gBACtC,YAAY;AAAA,cACd;AAAA,YACF;AAAA,UACF;AAAA,QACF,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getTextInputPropControllerDataString
|
|
3
|
+
} from "@makeswift/prop-controllers";
|
|
4
|
+
function useTextInputPropControllerData(data) {
|
|
5
|
+
return getTextInputPropControllerDataString(data);
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
useTextInputPropControllerData
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=useTextInputPropControllerData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/hooks/useTextInputPropControllerData.ts"],"sourcesContent":["import {\n TextInputPropControllerData,\n getTextInputPropControllerDataString,\n} from '@makeswift/prop-controllers'\n\nexport function useTextInputPropControllerData(\n data: TextInputPropControllerData | undefined,\n): string | undefined {\n return getTextInputPropControllerDataString(data)\n}\n"],"mappings":"AAAA;AAAA,EAEE;AAAA,OACK;AAEA,SAAS,+BACd,MACoB;AACpB,SAAO,qCAAqC,IAAI;AAClD;","names":[]}
|
|
@@ -27,7 +27,6 @@ import {
|
|
|
27
27
|
mergeSlotData,
|
|
28
28
|
SlotControlType
|
|
29
29
|
} from "./slot";
|
|
30
|
-
import { Types } from "../prop-controllers/descriptors";
|
|
31
30
|
import {
|
|
32
31
|
Types as PropControllerTypes,
|
|
33
32
|
mergeGridPropControllerTranslatedData
|
|
@@ -100,7 +99,7 @@ function merge(definition, a, b = a, context) {
|
|
|
100
99
|
}
|
|
101
100
|
function getTranslatableData(definition, data) {
|
|
102
101
|
switch (definition.type) {
|
|
103
|
-
case
|
|
102
|
+
case PropControllerTypes.TextInput:
|
|
104
103
|
case PropControllerTypes.TextArea:
|
|
105
104
|
case TextInputControlType:
|
|
106
105
|
case TextAreaControlType:
|
|
@@ -126,7 +125,7 @@ function mergeTranslatedData(definition, data, translatedData, context) {
|
|
|
126
125
|
if (data == null)
|
|
127
126
|
return data;
|
|
128
127
|
switch (definition.type) {
|
|
129
|
-
case
|
|
128
|
+
case PropControllerTypes.TextInput:
|
|
130
129
|
case PropControllerTypes.TextArea:
|
|
131
130
|
case TextInputControlType:
|
|
132
131
|
case TextAreaControlType:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/controls/control.ts"],"sourcesContent":["import {\n ColorControlData,\n ColorControlDefinition,\n ColorControlType,\n TextInputControlData,\n TextInputControlDefinition,\n TextInputControlType,\n TextAreaControlData,\n TextAreaControlDefinition,\n TextAreaControlType,\n CheckboxControlData,\n CheckboxControlDefinition,\n NumberControlData,\n NumberControlDefinition,\n ComboboxControlData,\n ComboboxControlDefinition,\n IconRadioGroupControlData,\n IconRadioGroupControlDefinition,\n ImageControlType,\n ImageControlData,\n ImageControlDefinition,\n LinkControlData,\n LinkControlDefinition,\n LinkControlType,\n copyColorData,\n copyLinkData,\n} from '@makeswift/controls'\n\nimport { copyImageData } from './image'\nimport {\n ListControlData,\n ListControlDefinition,\n copyListData,\n ListControlType,\n getListTranslatableData,\n mergeListTranslatedData,\n ListControlTranslationDto,\n} from './list'\nimport { SelectControlData, SelectControlDefinition } from './select'\nimport {\n ShapeControlData,\n ShapeControlDefinition,\n copyShapeData,\n ShapeControlType,\n getShapeTranslatableData,\n mergeShapeTranslatedData,\n ShapeControlTranslationDto,\n} from './shape'\nimport { copyStyleData, StyleControlData, StyleControlDefinition, StyleControlType } from './style'\nimport {\n copySlotData,\n mergeSlotControlTranslatedData,\n mergeSlotData,\n SlotControlData,\n SlotControlDefinition,\n SlotControlType,\n} from './slot'\n\nimport { Descriptor, Types } from '../prop-controllers/descriptors'\nimport {\n GridPropControllerData,\n Types as PropControllerTypes,\n mergeGridPropControllerTranslatedData,\n} from '@makeswift/prop-controllers'\nimport { copy as propControllerCopy } from '../prop-controllers/copy'\nimport { CopyContext, Data, MergeContext, MergeTranslatableDataContext } from '../state/react-page'\nimport {\n RichTextControlData,\n RichTextControlDefinition,\n RichTextControlType,\n copyRichTextData,\n richTextDTOtoDAO,\n} from './rich-text'\nimport { DELETED_PROP_CONTROLLER_TYPES, PropControllerDescriptor } from '../prop-controllers'\n\nimport { richTextV2DescendentsToData } from './rich-text-v2/dto'\nimport { copyRichTextV2Data } from './rich-text-v2/copy'\nimport {\n RichTextV2ControlData,\n RichTextV2ControlDefinition,\n RichTextV2ControlType,\n isRichTextV1Data,\n} from './rich-text-v2/rich-text-v2'\n\nimport { StyleV2ControlData, StyleV2ControlDefinition } from './style-v2'\nimport { TypographyControlData, TypographyControlDefinition } from './typography'\nimport {\n RichTextV2ControlTranslationDto,\n getRichTextV2TranslatableData,\n mergeRichTextV2TranslatedData,\n} from './rich-text-v2/translation'\nimport { IndexSignatureHack } from '../utils/index-signature-hack'\n\nexport type ControlDefinition =\n | CheckboxControlDefinition\n | NumberControlDefinition\n | TextInputControlDefinition\n | TextAreaControlDefinition\n | SelectControlDefinition\n | ColorControlDefinition\n | IconRadioGroupControlDefinition\n | ImageControlDefinition\n | ComboboxControlDefinition\n | ShapeControlDefinition\n | ListControlDefinition<any>\n | LinkControlDefinition\n | SlotControlDefinition\n | ShapeControlDefinition\n | RichTextControlDefinition\n | RichTextV2ControlDefinition\n | StyleControlDefinition\n | StyleV2ControlDefinition\n | TypographyControlDefinition\n\nexport type ControlDefinitionData<T extends ControlDefinition> = T extends CheckboxControlDefinition\n ? CheckboxControlData\n : T extends NumberControlDefinition\n ? NumberControlData\n : T extends TextInputControlDefinition\n ? TextInputControlData\n : T extends TextAreaControlDefinition\n ? TextAreaControlData\n : T extends SelectControlDefinition\n ? SelectControlData<T>\n : T extends ColorControlDefinition\n ? ColorControlData\n : T extends IconRadioGroupControlDefinition\n ? IconRadioGroupControlData<T>\n : T extends ImageControlDefinition\n ? ImageControlData\n : T extends ComboboxControlDefinition\n ? ComboboxControlData<T>\n : T extends ShapeControlDefinition\n ? ShapeControlData<T>\n : T extends ListControlDefinition\n ? ListControlData<T>\n : T extends LinkControlDefinition\n ? LinkControlData\n : T extends RichTextControlDefinition\n ? IndexSignatureHack<RichTextControlData>\n : T extends RichTextV2ControlDefinition\n ? RichTextV2ControlData\n : T extends StyleControlDefinition\n ? StyleControlData\n : T extends StyleV2ControlDefinition\n ? StyleV2ControlData\n : T extends TypographyControlDefinition\n ? TypographyControlData\n : never\n\nexport function copy(definition: Descriptor | ControlDefinition, value: any, context: CopyContext) {\n switch (definition.type) {\n case PropControllerTypes.Backgrounds:\n case PropControllerTypes.Grid:\n case PropControllerTypes.NavigationLinks:\n case PropControllerTypes.Link:\n case PropControllerTypes.Shadows:\n case PropControllerTypes.Image:\n case PropControllerTypes.Images:\n case PropControllerTypes.ResponsiveColor:\n case PropControllerTypes.TableFormFields:\n case PropControllerTypes.Table:\n case PropControllerTypes.Border:\n case PropControllerTypes.ElementID:\n return propControllerCopy(definition, value, context)\n case DELETED_PROP_CONTROLLER_TYPES.RichText:\n case RichTextControlType:\n return copyRichTextData(value, context)\n case RichTextV2ControlType:\n return copyRichTextV2Data(\n isRichTextV1Data(value) ? richTextV2DescendentsToData(richTextDTOtoDAO(value)) : value,\n context,\n )\n case ColorControlType:\n return copyColorData(value, context)\n case ImageControlType:\n return copyImageData(value, context)\n case LinkControlType:\n return copyLinkData(value, context)\n case ShapeControlType:\n return copyShapeData(definition, value, context)\n case ListControlType:\n return copyListData(definition, value, context)\n case StyleControlType:\n return copyStyleData(value, context)\n case SlotControlType:\n return copySlotData(value, context)\n default:\n return value\n }\n}\n\nexport function merge(\n definition: PropControllerDescriptor,\n a: Data,\n b: Data = a,\n context: MergeContext,\n): Data {\n switch (definition.type) {\n case SlotControlType:\n return mergeSlotData(a as SlotControlData, b as SlotControlData, context)\n\n default:\n return b\n }\n}\n\nexport function getTranslatableData(definition: Descriptor | ControlDefinition, data: Data): Data {\n switch (definition.type) {\n case Types.TextInput:\n case PropControllerTypes.TextArea:\n case TextInputControlType:\n case TextAreaControlType:\n return data\n\n case RichTextV2ControlType:\n const richTextData = data as RichTextV2ControlData | RichTextControlData\n\n if (isRichTextV1Data(richTextData)) return null\n\n return getRichTextV2TranslatableData(definition, richTextData as RichTextV2ControlData)\n\n case ListControlType:\n if (data == null) return null\n\n return getListTranslatableData(definition, data as ListControlData)\n\n case ShapeControlType:\n if (data == null) return null\n\n return getShapeTranslatableData(definition, data as ShapeControlData)\n\n default:\n return null\n }\n}\n\nexport function mergeTranslatedData(\n definition: PropControllerDescriptor,\n data: Data,\n translatedData: Data,\n context: MergeTranslatableDataContext,\n): Data {\n if (data == null) return data\n\n switch (definition.type) {\n case Types.TextInput:\n case PropControllerTypes.TextArea:\n case TextInputControlType:\n case TextAreaControlType:\n if (translatedData == null) return data\n\n return translatedData\n\n case PropControllerTypes.Grid:\n return mergeGridPropControllerTranslatedData(data as GridPropControllerData, context)\n\n case SlotControlType:\n return mergeSlotControlTranslatedData(data as SlotControlData, context)\n\n case RichTextV2ControlType:\n if (translatedData == null) return data\n\n return mergeRichTextV2TranslatedData(\n definition,\n data as RichTextV2ControlData,\n translatedData as RichTextV2ControlTranslationDto,\n )\n\n case ListControlType:\n if (translatedData == null) return data\n\n return mergeListTranslatedData(\n definition,\n data as ListControlData,\n translatedData as ListControlTranslationDto,\n context,\n )\n\n case ShapeControlType:\n if (translatedData == null) return data\n\n return mergeShapeTranslatedData(\n definition,\n data as ShapeControlData,\n translatedData as ShapeControlTranslationDto,\n context,\n )\n\n default:\n return data\n }\n}\n"],"mappings":"AAAA;AAAA,EAGE;AAAA,EAGA;AAAA,EAGA;AAAA,EASA;AAAA,EAKA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,qBAAqB;AAC9B;AAAA,EAGE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AAEP;AAAA,EAGE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,eAAyD,wBAAwB;AAC1F;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EAGA;AAAA,OACK;AAEP,SAAqB,aAAa;AAClC;AAAA,EAEE,SAAS;AAAA,EACT;AAAA,OACK;AACP,SAAS,QAAQ,0BAA0B;AAE3C;AAAA,EAGE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,qCAA+D;AAExE,SAAS,mCAAmC;AAC5C,SAAS,0BAA0B;AACnC;AAAA,EAGE;AAAA,EACA;AAAA,OACK;AAIP;AAAA,EAEE;AAAA,EACA;AAAA,OACK;AA4DA,SAAS,KAAK,YAA4C,OAAY,SAAsB;AACjG,UAA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AAAA,IACL,KAAK;AACH,aAAO;AAAA,IAET,KAAK;AACH,YAAM,eAAe;AAErB,UAAI,iBAAiB,YAAY;AAAG,eAAO;AAE3C,aAAO,8BAA8B,YAAY,YAAqC;AAAA,IAExF,KAAK;AACH,UAAI,QAAQ;AAAM,eAAO;AAEzB,aAAO,wBAAwB,YAAY,IAAuB;AAAA,IAEpE,KAAK;AACH,UAAI,QAAQ;AAAM,eAAO;AAEzB,aAAO,yBAAyB,YAAY,IAAwB;AAAA,IAEtE;AACE,aAAO;AAAA,EACX;AACF;AAEO,SAAS,oBACd,YACA,MACA,gBACA,SACM;AACN,MAAI,QAAQ;AAAM,WAAO;AAEzB,UAAQ,WAAW,MAAM;AAAA,IACvB,KAAK,MAAM;AAAA,IACX,KAAK,oBAAoB;AAAA,IACzB,KAAK;AAAA,IACL,KAAK;AACH,UAAI,kBAAkB;AAAM,eAAO;AAEnC,aAAO;AAAA,IAET,KAAK,oBAAoB;AACvB,aAAO,sCAAsC,MAAgC,OAAO;AAAA,IAEtF,KAAK;AACH,aAAO,+BAA+B,MAAyB,OAAO;AAAA,IAExE,KAAK;AACH,UAAI,kBAAkB;AAAM,eAAO;AAEnC,aAAO;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,IAEF,KAAK;AACH,UAAI,kBAAkB;AAAM,eAAO;AAEnC,aAAO;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,IAEF,KAAK;AACH,UAAI,kBAAkB;AAAM,eAAO;AAEnC,aAAO;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,IAEF;AACE,aAAO;AAAA,EACX;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/controls/control.ts"],"sourcesContent":["import {\n ColorControlData,\n ColorControlDefinition,\n ColorControlType,\n TextInputControlData,\n TextInputControlDefinition,\n TextInputControlType,\n TextAreaControlData,\n TextAreaControlDefinition,\n TextAreaControlType,\n CheckboxControlData,\n CheckboxControlDefinition,\n NumberControlData,\n NumberControlDefinition,\n ComboboxControlData,\n ComboboxControlDefinition,\n IconRadioGroupControlData,\n IconRadioGroupControlDefinition,\n ImageControlType,\n ImageControlData,\n ImageControlDefinition,\n LinkControlData,\n LinkControlDefinition,\n LinkControlType,\n copyColorData,\n copyLinkData,\n} from '@makeswift/controls'\n\nimport { copyImageData } from './image'\nimport {\n ListControlData,\n ListControlDefinition,\n copyListData,\n ListControlType,\n getListTranslatableData,\n mergeListTranslatedData,\n ListControlTranslationDto,\n} from './list'\nimport { SelectControlData, SelectControlDefinition } from './select'\nimport {\n ShapeControlData,\n ShapeControlDefinition,\n copyShapeData,\n ShapeControlType,\n getShapeTranslatableData,\n mergeShapeTranslatedData,\n ShapeControlTranslationDto,\n} from './shape'\nimport { copyStyleData, StyleControlData, StyleControlDefinition, StyleControlType } from './style'\nimport {\n copySlotData,\n mergeSlotControlTranslatedData,\n mergeSlotData,\n SlotControlData,\n SlotControlDefinition,\n SlotControlType,\n} from './slot'\n\nimport { Descriptor } from '../prop-controllers/descriptors'\nimport {\n GridPropControllerData,\n Types as PropControllerTypes,\n mergeGridPropControllerTranslatedData,\n} from '@makeswift/prop-controllers'\nimport { copy as propControllerCopy } from '../prop-controllers/copy'\nimport { CopyContext, Data, MergeContext, MergeTranslatableDataContext } from '../state/react-page'\nimport {\n RichTextControlData,\n RichTextControlDefinition,\n RichTextControlType,\n copyRichTextData,\n richTextDTOtoDAO,\n} from './rich-text'\nimport { DELETED_PROP_CONTROLLER_TYPES, PropControllerDescriptor } from '../prop-controllers'\n\nimport { richTextV2DescendentsToData } from './rich-text-v2/dto'\nimport { copyRichTextV2Data } from './rich-text-v2/copy'\nimport {\n RichTextV2ControlData,\n RichTextV2ControlDefinition,\n RichTextV2ControlType,\n isRichTextV1Data,\n} from './rich-text-v2/rich-text-v2'\n\nimport { StyleV2ControlData, StyleV2ControlDefinition } from './style-v2'\nimport { TypographyControlData, TypographyControlDefinition } from './typography'\nimport {\n RichTextV2ControlTranslationDto,\n getRichTextV2TranslatableData,\n mergeRichTextV2TranslatedData,\n} from './rich-text-v2/translation'\nimport { IndexSignatureHack } from '../utils/index-signature-hack'\n\nexport type ControlDefinition =\n | CheckboxControlDefinition\n | NumberControlDefinition\n | TextInputControlDefinition\n | TextAreaControlDefinition\n | SelectControlDefinition\n | ColorControlDefinition\n | IconRadioGroupControlDefinition\n | ImageControlDefinition\n | ComboboxControlDefinition\n | ShapeControlDefinition\n | ListControlDefinition<any>\n | LinkControlDefinition\n | SlotControlDefinition\n | ShapeControlDefinition\n | RichTextControlDefinition\n | RichTextV2ControlDefinition\n | StyleControlDefinition\n | StyleV2ControlDefinition\n | TypographyControlDefinition\n\nexport type ControlDefinitionData<T extends ControlDefinition> = T extends CheckboxControlDefinition\n ? CheckboxControlData\n : T extends NumberControlDefinition\n ? NumberControlData\n : T extends TextInputControlDefinition\n ? TextInputControlData\n : T extends TextAreaControlDefinition\n ? TextAreaControlData\n : T extends SelectControlDefinition\n ? SelectControlData<T>\n : T extends ColorControlDefinition\n ? ColorControlData\n : T extends IconRadioGroupControlDefinition\n ? IconRadioGroupControlData<T>\n : T extends ImageControlDefinition\n ? ImageControlData\n : T extends ComboboxControlDefinition\n ? ComboboxControlData<T>\n : T extends ShapeControlDefinition\n ? ShapeControlData<T>\n : T extends ListControlDefinition\n ? ListControlData<T>\n : T extends LinkControlDefinition\n ? LinkControlData\n : T extends RichTextControlDefinition\n ? IndexSignatureHack<RichTextControlData>\n : T extends RichTextV2ControlDefinition\n ? RichTextV2ControlData\n : T extends StyleControlDefinition\n ? StyleControlData\n : T extends StyleV2ControlDefinition\n ? StyleV2ControlData\n : T extends TypographyControlDefinition\n ? TypographyControlData\n : never\n\nexport function copy(definition: Descriptor | ControlDefinition, value: any, context: CopyContext) {\n switch (definition.type) {\n case PropControllerTypes.Backgrounds:\n case PropControllerTypes.Grid:\n case PropControllerTypes.NavigationLinks:\n case PropControllerTypes.Link:\n case PropControllerTypes.Shadows:\n case PropControllerTypes.Image:\n case PropControllerTypes.Images:\n case PropControllerTypes.ResponsiveColor:\n case PropControllerTypes.TableFormFields:\n case PropControllerTypes.Table:\n case PropControllerTypes.Border:\n case PropControllerTypes.ElementID:\n return propControllerCopy(definition, value, context)\n case DELETED_PROP_CONTROLLER_TYPES.RichText:\n case RichTextControlType:\n return copyRichTextData(value, context)\n case RichTextV2ControlType:\n return copyRichTextV2Data(\n isRichTextV1Data(value) ? richTextV2DescendentsToData(richTextDTOtoDAO(value)) : value,\n context,\n )\n case ColorControlType:\n return copyColorData(value, context)\n case ImageControlType:\n return copyImageData(value, context)\n case LinkControlType:\n return copyLinkData(value, context)\n case ShapeControlType:\n return copyShapeData(definition, value, context)\n case ListControlType:\n return copyListData(definition, value, context)\n case StyleControlType:\n return copyStyleData(value, context)\n case SlotControlType:\n return copySlotData(value, context)\n default:\n return value\n }\n}\n\nexport function merge(\n definition: PropControllerDescriptor,\n a: Data,\n b: Data = a,\n context: MergeContext,\n): Data {\n switch (definition.type) {\n case SlotControlType:\n return mergeSlotData(a as SlotControlData, b as SlotControlData, context)\n\n default:\n return b\n }\n}\n\nexport function getTranslatableData(definition: Descriptor | ControlDefinition, data: Data): Data {\n switch (definition.type) {\n case PropControllerTypes.TextInput:\n case PropControllerTypes.TextArea:\n case TextInputControlType:\n case TextAreaControlType:\n return data\n\n case RichTextV2ControlType:\n const richTextData = data as RichTextV2ControlData | RichTextControlData\n\n if (isRichTextV1Data(richTextData)) return null\n\n return getRichTextV2TranslatableData(definition, richTextData as RichTextV2ControlData)\n\n case ListControlType:\n if (data == null) return null\n\n return getListTranslatableData(definition, data as ListControlData)\n\n case ShapeControlType:\n if (data == null) return null\n\n return getShapeTranslatableData(definition, data as ShapeControlData)\n\n default:\n return null\n }\n}\n\nexport function mergeTranslatedData(\n definition: PropControllerDescriptor,\n data: Data,\n translatedData: Data,\n context: MergeTranslatableDataContext,\n): Data {\n if (data == null) return data\n\n switch (definition.type) {\n case PropControllerTypes.TextInput:\n case PropControllerTypes.TextArea:\n case TextInputControlType:\n case TextAreaControlType:\n if (translatedData == null) return data\n\n return translatedData\n\n case PropControllerTypes.Grid:\n return mergeGridPropControllerTranslatedData(data as GridPropControllerData, context)\n\n case SlotControlType:\n return mergeSlotControlTranslatedData(data as SlotControlData, context)\n\n case RichTextV2ControlType:\n if (translatedData == null) return data\n\n return mergeRichTextV2TranslatedData(\n definition,\n data as RichTextV2ControlData,\n translatedData as RichTextV2ControlTranslationDto,\n )\n\n case ListControlType:\n if (translatedData == null) return data\n\n return mergeListTranslatedData(\n definition,\n data as ListControlData,\n translatedData as ListControlTranslationDto,\n context,\n )\n\n case ShapeControlType:\n if (translatedData == null) return data\n\n return mergeShapeTranslatedData(\n definition,\n data as ShapeControlData,\n translatedData as ShapeControlTranslationDto,\n context,\n )\n\n default:\n return data\n }\n}\n"],"mappings":"AAAA;AAAA,EAGE;AAAA,EAGA;AAAA,EAGA;AAAA,EASA;AAAA,EAKA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,qBAAqB;AAC9B;AAAA,EAGE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AAEP;AAAA,EAGE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,eAAyD,wBAAwB;AAC1F;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EAGA;AAAA,OACK;AAGP;AAAA,EAEE,SAAS;AAAA,EACT;AAAA,OACK;AACP,SAAS,QAAQ,0BAA0B;AAE3C;AAAA,EAGE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,qCAA+D;AAExE,SAAS,mCAAmC;AAC5C,SAAS,0BAA0B;AACnC;AAAA,EAGE;AAAA,EACA;AAAA,OACK;AAIP;AAAA,EAEE;AAAA,EACA;AAAA,OACK;AA4DA,SAAS,KAAK,YAA4C,OAAY,SAAsB;AACjG,UAAQ,WAAW,MAAM;AAAA,IACvB,K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O;AAAA,IAET,KAAK;AACH,YAAM,eAAe;AAErB,UAAI,iBAAiB,YAAY;AAAG,eAAO;AAE3C,aAAO,8BAA8B,YAAY,YAAqC;AAAA,IAExF,KAAK;AACH,UAAI,QAAQ;AAAM,eAAO;AAEzB,aAAO,wBAAwB,YAAY,IAAuB;AAAA,IAEpE,KAAK;AACH,UAAI,QAAQ;AAAM,eAAO;AAEzB,aAAO,yBAAyB,YAAY,IAAwB;AAAA,IAEtE;AACE,aAAO;AAAA,EACX;AACF;AAEO,SAAS,oBACd,YACA,MACA,gBACA,SACM;AACN,MAAI,QAAQ;AAAM,WAAO;AAEzB,UAAQ,WAAW,MAAM;AAAA,IACvB,KAAK,oBAAoB;AAAA,IACzB,KAAK,oBAAoB;AAAA,IACzB,KAAK;AAAA,IACL,KAAK;AACH,UAAI,kBAAkB;AAAM,eAAO;AAEnC,aAAO;AAAA,IAET,KAAK,oBAAoB;AACvB,aAAO,sCAAsC,MAAgC,OAAO;AAAA,IAEtF,KAAK;AACH,aAAO,+BAA+B,MAAyB,OAAO;AAAA,IAExE,KAAK;AACH,UAAI,kBAAkB;AAAM,eAAO;AAEnC,aAAO;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,IAEF,KAAK;AACH,UAAI,kBAAkB;AAAM,eAAO;AAEnC,aAAO;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,IAEF,KAAK;AACH,UAAI,kBAAkB;AAAM,eAAO;AAEnC,aAAO;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,IAEF;AACE,aAAO;AAAA,EACX;AACF;","names":[]}
|
|
@@ -13,7 +13,7 @@ async function handler(...args) {
|
|
|
13
13
|
const supportsPreviewMode = match(args).with(routeHandlerPattern, () => false).with(apiRoutePattern, () => true).exhaustive();
|
|
14
14
|
const supportsDraftMode = match(args).with(routeHandlerPattern, () => true).with(apiRoutePattern, () => false).exhaustive();
|
|
15
15
|
const body = {
|
|
16
|
-
version: "0.18.0-canary.
|
|
16
|
+
version: "0.18.0-canary.5",
|
|
17
17
|
previewMode: supportsPreviewMode,
|
|
18
18
|
draftMode: supportsDraftMode,
|
|
19
19
|
interactionMode: true,
|
|
@@ -2,8 +2,6 @@ import { StyleControlType } from "../controls/style";
|
|
|
2
2
|
const Types = {
|
|
3
3
|
ResponsiveIconRadioGroup: "ResponsiveIconRadioGroup",
|
|
4
4
|
ResponsiveSelect: "ResponsiveSelect",
|
|
5
|
-
SocialLinks: "SocialLinks",
|
|
6
|
-
TextInput: "TextInput",
|
|
7
5
|
Style: StyleControlType
|
|
8
6
|
};
|
|
9
7
|
function ResponsiveIconRadioGroup(options) {
|
|
@@ -12,45 +10,9 @@ function ResponsiveIconRadioGroup(options) {
|
|
|
12
10
|
function ResponsiveSelect(options) {
|
|
13
11
|
return { type: Types.ResponsiveSelect, options };
|
|
14
12
|
}
|
|
15
|
-
const socialLinkTypesV0 = [
|
|
16
|
-
"angellist",
|
|
17
|
-
"codepen",
|
|
18
|
-
"discord",
|
|
19
|
-
"dribbble",
|
|
20
|
-
"facebook",
|
|
21
|
-
"github",
|
|
22
|
-
"instagram",
|
|
23
|
-
"linkedin",
|
|
24
|
-
"medium",
|
|
25
|
-
"pinterest",
|
|
26
|
-
"reddit",
|
|
27
|
-
"rss",
|
|
28
|
-
"snapchat",
|
|
29
|
-
"soundcloud",
|
|
30
|
-
"spotify",
|
|
31
|
-
"telegram",
|
|
32
|
-
"tumblr",
|
|
33
|
-
"twitch",
|
|
34
|
-
"twitter",
|
|
35
|
-
"vimeo",
|
|
36
|
-
"whatsapp",
|
|
37
|
-
"yelp",
|
|
38
|
-
"youtube"
|
|
39
|
-
];
|
|
40
|
-
const socialLinkTypesV1 = [...socialLinkTypesV0, "x", "slack"];
|
|
41
|
-
function SocialLinks(options = {}) {
|
|
42
|
-
return { type: Types.SocialLinks, options, version: 1 };
|
|
43
|
-
}
|
|
44
|
-
function TextInput(options = {}) {
|
|
45
|
-
return { type: Types.TextInput, options };
|
|
46
|
-
}
|
|
47
13
|
export {
|
|
48
14
|
ResponsiveIconRadioGroup,
|
|
49
15
|
ResponsiveSelect,
|
|
50
|
-
|
|
51
|
-
TextInput,
|
|
52
|
-
Types,
|
|
53
|
-
socialLinkTypesV0,
|
|
54
|
-
socialLinkTypesV1
|
|
16
|
+
Types
|
|
55
17
|
};
|
|
56
18
|
//# sourceMappingURL=descriptors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/prop-controllers/descriptors.ts"],"sourcesContent":["import {\n CheckboxControlDefinition,\n IconRadioGroupControlDefinition,\n NumberControlDefinition,\n TextInputControlDefinition,\n TextAreaControlDefinition,\n} from '@makeswift/controls'\nimport { ResponsiveColor } from '../runtimes/react/controls'\nimport { StyleControlFormattedValue } from '../runtimes/react/controls/style'\nimport type { Data } from '../state/react-page'\nimport { NumberControlValue } from '../runtimes/react/controls/number'\nimport { StyleControlType } from '../controls/style'\nimport {\n ColorControlDefinition,\n ComboboxControlDefinition,\n ImageControlDefinition,\n LinkControlDefinition,\n ListControlDefinition,\n SelectControlDefinition,\n ShapeControlDefinition,\n SlotControlDefinition,\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 } 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 { IconRadioGroupControlValue } from '../runtimes/react/controls/icon-radio-group'\nimport { TypographyControlValue } from '../runtimes/react/controls/typography'\nimport {\n BorderDescriptor,\n CheckboxDescriptor,\n LinkDescriptor,\n ResolveLinkPropControllerValue,\n Types as PropControllerTypes,\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 DateDescriptor,\n ResolveDatePropControllerValue,\n FontDescriptor,\n ResolveFontPropControllerValue,\n VideoDescriptor,\n ResolveVideoPropControllerValue,\n TableDescriptor,\n ResolveTablePropControllerValue,\n MarginDescriptor,\n ResolveMarginPropControllerValue,\n PaddingDescriptor,\n ResolvePaddingPropControllerValue,\n WidthDescriptor,\n ResolveWidthPropControllerValue,\n TextStyleDescriptor,\n ResolveTextStylePropControllerValue,\n NavigationLinksDescriptor,\n ResolveNavigationLinksPropControllerValue,\n TextAreaDescriptor,\n ResolveTextAreaPropControllerValue,\n GapX,\n ResponsiveNumber,\n ResolveGapYPropControllerValue,\n GapYDescriptor,\n ElementIDDescriptor,\n ResolveElementIDPropControllerValue,\n TableFormFieldsDescriptor,\n ResolveTableFormFieldsPropControllerValue,\n GridDescriptor,\n ResolveGridPropControllerValue,\n ImageDescriptor,\n ResolveImagePropControllerValue,\n ImagesDescriptor,\n ResolveImagesPropControllerValue,\n BackgroundsDescriptor,\n ResolveBackgroundsPropControllerValue,\n type Descriptor as PropDescriptor,\n type Value as PropValue,\n ResponsiveOpacity,\n} from '@makeswift/prop-controllers'\nimport { DeletedPropControllerDescriptor } from './deleted'\n\nexport type { Data }\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 const Types = {\n ResponsiveIconRadioGroup: 'ResponsiveIconRadioGroup',\n ResponsiveSelect: 'ResponsiveSelect',\n SocialLinks: 'SocialLinks',\n TextInput: 'TextInput',\n Style: StyleControlType,\n} as const\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 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 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 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 Descriptor<T extends Data = Data> =\n | DeletedPropControllerDescriptor<T>\n | BackgroundsDescriptor<T>\n | BorderDescriptor<T>\n | BorderRadiusDescriptor<T>\n | CheckboxDescriptor<T>\n | DateDescriptor<T>\n | ElementIDDescriptor<T>\n | FontDescriptor<T>\n | PropDescriptor<typeof GapX>\n | GapYDescriptor<T>\n | GridDescriptor<T>\n | ImageDescriptor<T>\n | ImagesDescriptor<T>\n | LinkDescriptor<T>\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 | PropDescriptor<typeof ResponsiveNumber>\n | PropDescriptor<typeof ResponsiveOpacity>\n | ResponsiveSelectDescriptor<\n T extends ResponsiveSelectValue<string> ? T : ResponsiveSelectValue<string>\n >\n | ShadowsDescriptor<T>\n | SocialLinksDescriptor<T>\n | TableDescriptor<T>\n | TableFormFieldsDescriptor<T>\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 PropControllerTypes.Backgrounds\n | typeof Types.ResponsiveIconRadioGroup\n | typeof PropControllerTypes.Margin\n | typeof PropControllerTypes.Padding\n | typeof PropControllerTypes.Shadows\n | typeof PropControllerTypes.Border\n | typeof PropControllerTypes.GapY\n | typeof PropControllerTypes.GapX\n | typeof PropControllerTypes.BorderRadius\n | typeof PropControllerTypes.Checkbox\n | typeof Types.TextInput\n | typeof PropControllerTypes.Link\n | typeof Types.ResponsiveSelect\n | typeof PropControllerTypes.ResponsiveColor\n | typeof PropControllerTypes.TextStyle\n | typeof PropControllerTypes.Images\n | typeof PropControllerTypes.ResponsiveNumber\n | typeof PropControllerTypes.Number\n | typeof PropControllerTypes.Date\n | typeof PropControllerTypes.Font\n | typeof PropControllerTypes.TextArea\n | typeof PropControllerTypes.Table\n | typeof PropControllerTypes.Image\n | typeof PropControllerTypes.ResponsiveOpacity\n | typeof Types.SocialLinks\n | typeof PropControllerTypes.Video\n | typeof PropControllerTypes.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.Backgrounds\n ? ResolveBackgroundsPropControllerValue<\n Extract<T, { type: typeof PropControllerTypes.Backgrounds }>\n >\n : T['type'] extends typeof PropControllerTypes.Checkbox\n ? ResolveCheckboxPropControllerValue<Extract<T, { type: typeof PropControllerTypes.Checkbox }>>\n : T['type'] extends typeof PropControllerTypes.Date\n ? ResolveDatePropControllerValue<Extract<T, { type: typeof PropControllerTypes.Date }>>\n : T['type'] extends typeof PropControllerTypes.ElementID\n ? ResolveElementIDPropControllerValue<Extract<T, { type: typeof PropControllerTypes.ElementID }>>\n : T['type'] extends typeof PropControllerTypes.Font\n ? ResolveFontPropControllerValue<Extract<T, { type: typeof PropControllerTypes.Font }>>\n : T['type'] extends typeof PropControllerTypes.GapX\n ? PropValue<T> | undefined\n : T['type'] extends typeof PropControllerTypes.GapY\n ? ResolveGapYPropControllerValue<Extract<T, { type: typeof PropControllerTypes.GapY }>>\n : T['type'] extends typeof PropControllerTypes.Grid\n ? ResolveGridPropControllerValue<Extract<T, { type: typeof PropControllerTypes.Grid }>>\n : T['type'] extends typeof PropControllerTypes.Image\n ? ResolveImagePropControllerValue<Extract<T, { type: typeof PropControllerTypes.Image }>>\n : T['type'] extends typeof PropControllerTypes.Images\n ? ResolveImagesPropControllerValue<Extract<T, { type: typeof PropControllerTypes.Images }>>\n : T['type'] extends typeof PropControllerTypes.ResponsiveNumber\n ? PropValue<T> | undefined\n : T['type'] extends typeof PropControllerTypes.ResponsiveOpacity\n ? PropValue<T> | undefined\n : T['type'] extends typeof PropControllerTypes.Link\n ? ResolveLinkPropControllerValue<Extract<T, { type: typeof PropControllerTypes.Link }>>\n : T['type'] extends typeof PropControllerTypes.Width\n ? ResolveWidthPropControllerValue<Extract<T, { type: typeof PropControllerTypes.Width }>>\n : T['type'] extends typeof PropControllerTypes.Padding\n ? ResolvePaddingPropControllerValue<Extract<T, { type: typeof PropControllerTypes.Padding }>>\n : T['type'] extends typeof PropControllerTypes.Margin\n ? ResolveMarginPropControllerValue<Extract<T, { type: typeof PropControllerTypes.Margin }>>\n : T['type'] extends typeof PropControllerTypes.NavigationLinks\n ? ResolveNavigationLinksPropControllerValue<\n Extract<T, { type: typeof PropControllerTypes.NavigationLinks }>\n >\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['type'] extends typeof PropControllerTypes.Table\n ? ResolveTablePropControllerValue<Extract<T, { type: typeof PropControllerTypes.Table }>>\n : T['type'] extends typeof PropControllerTypes.TableFormFields\n ? ResolveTableFormFieldsPropControllerValue<\n Extract<T, { type: typeof PropControllerTypes.TableFormFields }>\n >\n : T['type'] extends typeof PropControllerTypes.TextStyle\n ? ResolveTextStylePropControllerValue<Extract<T, { type: typeof PropControllerTypes.TextStyle }>>\n : T['type'] extends typeof PropControllerTypes.TextArea\n ? ResolveTextAreaPropControllerValue<Extract<T, { type: typeof PropControllerTypes.TextArea }>>\n : T['type'] extends typeof PropControllerTypes.Video\n ? ResolveVideoPropControllerValue<Extract<T, { type: typeof PropControllerTypes.Video }>>\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":"AAWA,SAAS,wBAAwB;AAiI1B,MAAM,QAAQ;AAAA,EACnB,0BAA0B;AAAA,EAC1B,kBAAkB;AAAA,EAClB,aAAa;AAAA,EACb,WAAW;AAAA,EACX,OAAO;AACT;AA4BO,SAAS,yBACd,SACsE;AACtE,SAAO,EAAE,MAAM,MAAM,0BAA0B,QAAQ;AACzD;AA+BO,SAAS,iBACd,SACsD;AACtD,SAAO,EAAE,MAAM,MAAM,kBAAkB,QAAQ;AACjD;AAEO,MAAM,oBAAoB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;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;AAeO,SAAS,UAAU,UAA4B,CAAC,GAAwB;AAC7E,SAAO,EAAE,MAAM,MAAM,WAAW,QAAQ;AAC1C;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/prop-controllers/descriptors.ts"],"sourcesContent":["import {\n CheckboxControlDefinition,\n IconRadioGroupControlDefinition,\n NumberControlDefinition,\n TextInputControlDefinition,\n TextAreaControlDefinition,\n} from '@makeswift/controls'\nimport { ResponsiveColor } from '../runtimes/react/controls'\nimport { StyleControlFormattedValue } from '../runtimes/react/controls/style'\nimport type { Data } from '../state/react-page'\nimport { NumberControlValue } from '../runtimes/react/controls/number'\nimport { StyleControlType } from '../controls/style'\nimport {\n ColorControlDefinition,\n ComboboxControlDefinition,\n ImageControlDefinition,\n LinkControlDefinition,\n ListControlDefinition,\n SelectControlDefinition,\n ShapeControlDefinition,\n SlotControlDefinition,\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 } 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 { IconRadioGroupControlValue } from '../runtimes/react/controls/icon-radio-group'\nimport { TypographyControlValue } from '../runtimes/react/controls/typography'\nimport {\n BorderDescriptor,\n CheckboxDescriptor,\n LinkDescriptor,\n ResolveLinkPropControllerValue,\n Types as PropControllerTypes,\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 DateDescriptor,\n ResolveDatePropControllerValue,\n FontDescriptor,\n ResolveFontPropControllerValue,\n VideoDescriptor,\n ResolveVideoPropControllerValue,\n TableDescriptor,\n ResolveTablePropControllerValue,\n MarginDescriptor,\n ResolveMarginPropControllerValue,\n PaddingDescriptor,\n ResolvePaddingPropControllerValue,\n WidthDescriptor,\n ResolveWidthPropControllerValue,\n TextStyleDescriptor,\n ResolveTextStylePropControllerValue,\n NavigationLinksDescriptor,\n ResolveNavigationLinksPropControllerValue,\n TextAreaDescriptor,\n ResolveTextAreaPropControllerValue,\n GapX,\n ResponsiveNumber,\n ResolveGapYPropControllerValue,\n GapYDescriptor,\n ElementIDDescriptor,\n ResolveElementIDPropControllerValue,\n TableFormFieldsDescriptor,\n ResolveTableFormFieldsPropControllerValue,\n GridDescriptor,\n ResolveGridPropControllerValue,\n ImageDescriptor,\n ResolveImagePropControllerValue,\n ImagesDescriptor,\n ResolveImagesPropControllerValue,\n BackgroundsDescriptor,\n ResolveBackgroundsPropControllerValue,\n type Descriptor as PropDescriptor,\n type Value as PropValue,\n ResponsiveOpacity,\n ResolveSocialLinksPropControllerValue,\n SocialLinksDescriptor,\n TextInputDescriptor,\n ResolveTextInputPropControllerValue,\n} from '@makeswift/prop-controllers'\nimport { DeletedPropControllerDescriptor } from './deleted'\n\nexport type { Data }\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 const Types = {\n ResponsiveIconRadioGroup: 'ResponsiveIconRadioGroup',\n ResponsiveSelect: 'ResponsiveSelect',\n Style: StyleControlType,\n} as const\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 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 Descriptor<T extends Data = Data> =\n | DeletedPropControllerDescriptor<T>\n | BackgroundsDescriptor<T>\n | BorderDescriptor<T>\n | BorderRadiusDescriptor<T>\n | CheckboxDescriptor<T>\n | DateDescriptor<T>\n | ElementIDDescriptor<T>\n | FontDescriptor<T>\n | PropDescriptor<typeof GapX>\n | GapYDescriptor<T>\n | GridDescriptor<T>\n | ImageDescriptor<T>\n | ImagesDescriptor<T>\n | LinkDescriptor<T>\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 | PropDescriptor<typeof ResponsiveNumber>\n | PropDescriptor<typeof ResponsiveOpacity>\n | ResponsiveSelectDescriptor<\n T extends ResponsiveSelectValue<string> ? T : ResponsiveSelectValue<string>\n >\n | ShadowsDescriptor<T>\n | SocialLinksDescriptor<T>\n | TableDescriptor<T>\n | TableFormFieldsDescriptor<T>\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 PropControllerTypes.Backgrounds\n | typeof Types.ResponsiveIconRadioGroup\n | typeof PropControllerTypes.Margin\n | typeof PropControllerTypes.Padding\n | typeof PropControllerTypes.Shadows\n | typeof PropControllerTypes.Border\n | typeof PropControllerTypes.GapY\n | typeof PropControllerTypes.GapX\n | typeof PropControllerTypes.BorderRadius\n | typeof PropControllerTypes.Checkbox\n | typeof PropControllerTypes.TextInput\n | typeof PropControllerTypes.Link\n | typeof Types.ResponsiveSelect\n | typeof PropControllerTypes.ResponsiveColor\n | typeof PropControllerTypes.TextStyle\n | typeof PropControllerTypes.Images\n | typeof PropControllerTypes.ResponsiveNumber\n | typeof PropControllerTypes.Number\n | typeof PropControllerTypes.Date\n | typeof PropControllerTypes.Font\n | typeof PropControllerTypes.TextArea\n | typeof PropControllerTypes.Table\n | typeof PropControllerTypes.Image\n | typeof PropControllerTypes.ResponsiveOpacity\n | typeof PropControllerTypes.SocialLinks\n | typeof PropControllerTypes.Video\n | typeof PropControllerTypes.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.Backgrounds\n ? ResolveBackgroundsPropControllerValue<\n Extract<T, { type: typeof PropControllerTypes.Backgrounds }>\n >\n : T['type'] extends typeof PropControllerTypes.Checkbox\n ? ResolveCheckboxPropControllerValue<Extract<T, { type: typeof PropControllerTypes.Checkbox }>>\n : T['type'] extends typeof PropControllerTypes.Date\n ? ResolveDatePropControllerValue<Extract<T, { type: typeof PropControllerTypes.Date }>>\n : T['type'] extends typeof PropControllerTypes.ElementID\n ? ResolveElementIDPropControllerValue<Extract<T, { type: typeof PropControllerTypes.ElementID }>>\n : T['type'] extends typeof PropControllerTypes.Font\n ? ResolveFontPropControllerValue<Extract<T, { type: typeof PropControllerTypes.Font }>>\n : T['type'] extends typeof PropControllerTypes.GapX\n ? PropValue<T> | undefined\n : T['type'] extends typeof PropControllerTypes.GapY\n ? ResolveGapYPropControllerValue<Extract<T, { type: typeof PropControllerTypes.GapY }>>\n : T['type'] extends typeof PropControllerTypes.Grid\n ? ResolveGridPropControllerValue<Extract<T, { type: typeof PropControllerTypes.Grid }>>\n : T['type'] extends typeof PropControllerTypes.Image\n ? ResolveImagePropControllerValue<Extract<T, { type: typeof PropControllerTypes.Image }>>\n : T['type'] extends typeof PropControllerTypes.Images\n ? ResolveImagesPropControllerValue<Extract<T, { type: typeof PropControllerTypes.Images }>>\n : T['type'] extends typeof PropControllerTypes.ResponsiveNumber\n ? PropValue<T> | undefined\n : T['type'] extends typeof PropControllerTypes.ResponsiveOpacity\n ? PropValue<T> | undefined\n : T['type'] extends typeof PropControllerTypes.Link\n ? ResolveLinkPropControllerValue<Extract<T, { type: typeof PropControllerTypes.Link }>>\n : T['type'] extends typeof PropControllerTypes.Width\n ? ResolveWidthPropControllerValue<Extract<T, { type: typeof PropControllerTypes.Width }>>\n : T['type'] extends typeof PropControllerTypes.Padding\n ? ResolvePaddingPropControllerValue<Extract<T, { type: typeof PropControllerTypes.Padding }>>\n : T['type'] extends typeof PropControllerTypes.Margin\n ? ResolveMarginPropControllerValue<Extract<T, { type: typeof PropControllerTypes.Margin }>>\n : T['type'] extends typeof PropControllerTypes.NavigationLinks\n ? ResolveNavigationLinksPropControllerValue<\n Extract<T, { type: typeof PropControllerTypes.NavigationLinks }>\n >\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.SocialLinks\n ? ResolveSocialLinksPropControllerValue<\n Extract<T, { type: typeof PropControllerTypes.SocialLinks }>\n >\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['type'] extends typeof PropControllerTypes.Table\n ? ResolveTablePropControllerValue<Extract<T, { type: typeof PropControllerTypes.Table }>>\n : T['type'] extends typeof PropControllerTypes.TableFormFields\n ? ResolveTableFormFieldsPropControllerValue<\n Extract<T, { type: typeof PropControllerTypes.TableFormFields }>\n >\n : T['type'] extends typeof PropControllerTypes.TextStyle\n ? ResolveTextStylePropControllerValue<Extract<T, { type: typeof PropControllerTypes.TextStyle }>>\n : T['type'] extends typeof PropControllerTypes.TextArea\n ? ResolveTextAreaPropControllerValue<Extract<T, { type: typeof PropControllerTypes.TextArea }>>\n : T['type'] extends typeof PropControllerTypes.TextInput\n ? ResolveTextInputPropControllerValue<Extract<T, { type: typeof PropControllerTypes.TextInput }>>\n : T['type'] extends typeof PropControllerTypes.Video\n ? ResolveVideoPropControllerValue<Extract<T, { type: typeof PropControllerTypes.Video }>>\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":"AAWA,SAAS,wBAAwB;AAqI1B,MAAM,QAAQ;AAAA,EACnB,0BAA0B;AAAA,EAC1B,kBAAkB;AAAA,EAClB,OAAO;AACT;AA4BO,SAAS,yBACd,SACsE;AACtE,SAAO,EAAE,MAAM,MAAM,0BAA0B,QAAQ;AACzD;AA+BO,SAAS,iBACd,SACsD;AACtD,SAAO,EAAE,MAAM,MAAM,kBAAkB,QAAQ;AACjD;","names":[]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { socialLinkTypesV0, socialLinkTypesV1 } from "./descriptors";
|
|
2
1
|
import * as Props from "./descriptors";
|
|
3
2
|
import { RichTextPropControllerMessageType, TableFormFieldsMessageType } from "./instances";
|
|
4
3
|
import * as Introspection from "./introspection";
|
|
@@ -8,8 +7,6 @@ export {
|
|
|
8
7
|
Introspection,
|
|
9
8
|
Props,
|
|
10
9
|
RichTextPropControllerMessageType,
|
|
11
|
-
TableFormFieldsMessageType
|
|
12
|
-
socialLinkTypesV0,
|
|
13
|
-
socialLinkTypesV1
|
|
10
|
+
TableFormFieldsMessageType
|
|
14
11
|
};
|
|
15
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/prop-controllers/index.ts"],"sourcesContent":["export type {\n Data,\n Descriptor as PropControllerDescriptor,\n DescriptorValueType as PropControllerDescriptorValueType,\n ResponsiveIconRadioGroupDescriptor,\n ResponsiveIconRadioGroupValue,\n ResponsiveSelectDescriptor,\n ResponsiveSelectValue,\n
|
|
1
|
+
{"version":3,"sources":["../../../src/prop-controllers/index.ts"],"sourcesContent":["export type {\n Data,\n Descriptor as PropControllerDescriptor,\n DescriptorValueType as PropControllerDescriptorValueType,\n ResponsiveIconRadioGroupDescriptor,\n ResponsiveIconRadioGroupValue,\n ResponsiveSelectDescriptor,\n ResponsiveSelectValue,\n PanelDescriptor,\n PanelDescriptorType,\n PanelDescriptorValueType,\n} from './descriptors'\nexport type {\n ResponsiveValueType,\n Device,\n DeviceOverride,\n ResponsiveValue,\n} from '@makeswift/prop-controllers'\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 { DELETED_PROP_CONTROLLER_TYPES } from './deleted'\n"],"mappings":"AAkBA,YAAY,WAAW;AAMvB,SAAS,mCAAmC,kCAAkC;AAC9E,YAAY,mBAAmB;AAC/B,SAAS,qCAAqC;","names":[]}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useRef } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
CheckboxControlType,
|
|
5
|
+
IconRadioGroupControlType,
|
|
6
|
+
NumberControlType,
|
|
7
|
+
TextInputControlType,
|
|
8
|
+
TextAreaControlType
|
|
9
|
+
} from "@makeswift/controls";
|
|
4
10
|
import * as ReactPage from "../../state/react-page";
|
|
5
11
|
import {
|
|
6
12
|
useBoxShadow,
|
|
@@ -61,7 +67,8 @@ import {
|
|
|
61
67
|
WidthPropControllerFormat,
|
|
62
68
|
GapX,
|
|
63
69
|
ResponsiveNumber,
|
|
64
|
-
ResponsiveOpacity
|
|
70
|
+
ResponsiveOpacity,
|
|
71
|
+
getSocialLinksPropControllerDataSocialLinksData
|
|
65
72
|
} from "@makeswift/prop-controllers";
|
|
66
73
|
import { useResponsiveLengthPropControllerData } from "../../components/hooks/useResponsiveLengthPropControllerData";
|
|
67
74
|
import { useNumberPropControllerData } from "../../components/hooks/useNumberPropControllerData";
|
|
@@ -77,6 +84,7 @@ import { useGridPropControllerData } from "../../components/hooks/useGridPropCon
|
|
|
77
84
|
import { useImagePropControllerData } from "../../components/hooks/useImagePropControllerData";
|
|
78
85
|
import { useImagesPropControllerData } from "../../components/hooks/useImagesPropControllerData";
|
|
79
86
|
import { useBackgroundsPropControllerData } from "../../components/hooks/useBackgroundsPropControllerData";
|
|
87
|
+
import { useTextInputPropControllerData } from "../../components/hooks/useTextInputPropControllerData";
|
|
80
88
|
function useWidthStyle(data, descriptor) {
|
|
81
89
|
const value = getWidthPropControllerDataResponsiveLengthData(data);
|
|
82
90
|
return useStyle(useResponsiveWidth(value, descriptor.options.defaultValue));
|
|
@@ -463,6 +471,16 @@ function PropsValue({ element, children }) {
|
|
|
463
471
|
},
|
|
464
472
|
descriptor.type
|
|
465
473
|
);
|
|
474
|
+
case PropControllerTypes.TextInput:
|
|
475
|
+
return /* @__PURE__ */ jsx(
|
|
476
|
+
RenderHook,
|
|
477
|
+
{
|
|
478
|
+
hook: useTextInputPropControllerData,
|
|
479
|
+
parameters: [props[propName]],
|
|
480
|
+
children: (value) => renderFn({ ...propsValue, [propName]: value })
|
|
481
|
+
},
|
|
482
|
+
descriptor.type
|
|
483
|
+
);
|
|
466
484
|
case PropControllerTypes.TextArea:
|
|
467
485
|
return /* @__PURE__ */ jsx(
|
|
468
486
|
RenderHook,
|
|
@@ -513,6 +531,11 @@ function PropsValue({ element, children }) {
|
|
|
513
531
|
},
|
|
514
532
|
descriptor.type
|
|
515
533
|
);
|
|
534
|
+
case PropControllerTypes.SocialLinks:
|
|
535
|
+
return renderFn({
|
|
536
|
+
...propsValue,
|
|
537
|
+
[propName]: getSocialLinksPropControllerDataSocialLinksData(props[propName])
|
|
538
|
+
});
|
|
516
539
|
case PropControllerTypes.Grid:
|
|
517
540
|
return /* @__PURE__ */ jsx(
|
|
518
541
|
RenderHook,
|