@makeswift/runtime 0.9.11 → 0.9.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Box.cjs.js +1 -1
- package/dist/Box.es.js +1 -1
- package/dist/Button.cjs.js +1 -1
- package/dist/Button.es.js +1 -1
- package/dist/Carousel.cjs.js +1 -1
- package/dist/Carousel.es.js +1 -1
- package/dist/Countdown.cjs.js +1 -1
- package/dist/Countdown.es.js +1 -1
- package/dist/Divider.cjs.js +1 -1
- package/dist/Divider.es.js +1 -1
- package/dist/Form.cjs.js +1 -1
- package/dist/Form.es.js +1 -1
- package/dist/Image.cjs.js +1 -1
- package/dist/Image.es.js +1 -1
- package/dist/LiveProvider.cjs.js +1 -1
- package/dist/LiveProvider.es.js +3 -3
- package/dist/Navigation.cjs.js +1 -1
- package/dist/Navigation.es.js +1 -1
- package/dist/PreviewProvider.cjs.js +1 -1
- package/dist/PreviewProvider.es.js +3 -3
- package/dist/ReadOnlyText.cjs.js +18 -3
- package/dist/ReadOnlyText.cjs.js.map +1 -1
- package/dist/ReadOnlyText.es.js +20 -5
- package/dist/ReadOnlyText.es.js.map +1 -1
- package/dist/ReadOnlyTextV2.cjs.js +116 -240
- package/dist/ReadOnlyTextV2.cjs.js.map +1 -1
- package/dist/ReadOnlyTextV2.es.js +115 -238
- package/dist/ReadOnlyTextV2.es.js.map +1 -1
- package/dist/Root.cjs.js +1 -1
- package/dist/Root.es.js +1 -1
- package/dist/SocialLinks.cjs.js +1 -1
- package/dist/SocialLinks.es.js +1 -1
- package/dist/Text.cjs.js +1 -1
- package/dist/Text.es.js +1 -1
- package/dist/components.cjs.js +1 -1
- package/dist/components.es.js +1 -1
- package/dist/control-serialization.es.js +1 -1
- package/dist/controls.cjs.js +28 -18
- package/dist/controls.cjs.js.map +1 -1
- package/dist/controls.es.js +2 -2
- package/dist/index.cjs.js +39 -38
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs10.js +2 -2
- package/dist/index.cjs2.js +3 -3
- package/dist/index.cjs2.js.map +1 -1
- package/dist/index.cjs5.js +5 -6
- package/dist/index.cjs5.js.map +1 -1
- package/dist/index.cjs6.js +20 -0
- package/dist/index.cjs6.js.map +1 -1
- package/dist/index.cjs8.js +1 -1
- package/dist/index.cjs9.js +27 -31
- package/dist/index.cjs9.js.map +1 -1
- package/dist/index.es.js +14 -14
- package/dist/index.es.js.map +1 -1
- package/dist/index.es10.js +4 -4
- package/dist/index.es2.js +2 -2
- package/dist/index.es3.js +1 -1
- package/dist/index.es5.js +1 -2
- package/dist/index.es5.js.map +1 -1
- package/dist/index.es6.js +21 -2
- package/dist/index.es6.js.map +1 -1
- package/dist/index.es8.js +1 -1
- package/dist/index.es9.js +31 -35
- package/dist/index.es9.js.map +1 -1
- package/dist/next.cjs.js +1 -1
- package/dist/next.es.js +2 -2
- package/dist/react-page.cjs.js +310 -147
- package/dist/react-page.cjs.js.map +1 -1
- package/dist/react-page.es.js +297 -146
- package/dist/react-page.es.js.map +1 -1
- package/dist/react.cjs.js +1 -1
- package/dist/react.es.js +1 -1
- package/dist/slate.cjs.js +40 -27
- package/dist/slate.cjs.js.map +1 -1
- package/dist/slate.es.js +49 -37
- package/dist/slate.es.js.map +1 -1
- package/dist/{typography.cjs.js → text-input.cjs.js} +1 -9
- package/dist/text-input.cjs.js.map +1 -0
- package/dist/{typography.es.js → text-input.es.js} +2 -8
- package/dist/text-input.es.js.map +1 -0
- package/dist/types/src/components/builtin/Text/ReadOnlyText.d.ts.map +1 -1
- package/dist/types/src/controls/list.d.ts +5 -2
- package/dist/types/src/controls/list.d.ts.map +1 -1
- package/dist/types/src/controls/rich-text/introspection.d.ts +5 -0
- package/dist/types/src/controls/rich-text/introspection.d.ts.map +1 -0
- package/dist/types/src/controls/rich-text/introspection.test.d.ts +2 -0
- package/dist/types/src/controls/rich-text/introspection.test.d.ts.map +1 -0
- package/dist/types/src/controls/rich-text-v2/introspection.d.ts +5 -0
- package/dist/types/src/controls/rich-text-v2/introspection.d.ts.map +1 -0
- package/dist/types/src/controls/rich-text-v2/introspection.test.d.ts +2 -0
- package/dist/types/src/controls/rich-text-v2/introspection.test.d.ts.map +1 -0
- package/dist/types/src/controls/rich-text-v2/rich-text-v2.d.ts +15 -3
- package/dist/types/src/controls/rich-text-v2/rich-text-v2.d.ts.map +1 -1
- package/dist/types/src/controls/rich-text-v2/translation.d.ts +1 -1
- package/dist/types/src/controls/rich-text-v2/translation.d.ts.map +1 -1
- package/dist/types/src/controls/shape.d.ts +5 -2
- package/dist/types/src/controls/shape.d.ts.map +1 -1
- package/dist/types/src/controls/typography.d.ts +2 -0
- package/dist/types/src/controls/typography.d.ts.map +1 -1
- package/dist/types/src/prop-controllers/descriptors.d.ts +10 -0
- package/dist/types/src/prop-controllers/descriptors.d.ts.map +1 -1
- package/dist/types/src/prop-controllers/introspection.d.ts +0 -2
- package/dist/types/src/prop-controllers/introspection.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/editable-text-v2.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/render-element.d.ts +1 -1
- package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/render-element.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/useRemoteChanges.d.ts +4 -0
- package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/useRemoteChanges.d.ts.map +1 -0
- package/dist/types/src/runtimes/react/controls/rich-text-v2/ReadOnlyTextV2.d.ts +7 -16
- package/dist/types/src/runtimes/react/controls/rich-text-v2/ReadOnlyTextV2.d.ts.map +1 -1
- package/dist/types/src/slate/LinkPlugin/index.d.ts.map +1 -1
- package/dist/types/src/slate/LocalChangesPlugin/index.d.ts +16 -0
- package/dist/types/src/slate/LocalChangesPlugin/index.d.ts.map +1 -0
- package/dist/types/src/slate/TextAlignPlugin/index.d.ts.map +1 -1
- package/dist/types/src/slate/index.d.ts +1 -0
- package/dist/types/src/slate/index.d.ts.map +1 -1
- package/dist/types/src/slate/types.d.ts +2 -2
- package/dist/types/src/slate/types.d.ts.map +1 -1
- package/dist/types.cjs2.js +67 -48
- package/dist/types.cjs2.js.map +1 -1
- package/dist/types.es2.js +64 -45
- package/dist/types.es2.js.map +1 -1
- package/package.json +1 -2
- package/dist/typography.cjs.js.map +0 -1
- package/dist/typography.es.js.map +0 -1
package/dist/controls.cjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
-
var
|
|
3
|
+
var textInput = require("./text-input.cjs.js");
|
|
4
4
|
var reactPage = require("./react-page.cjs.js");
|
|
5
5
|
var combobox = require("./combobox.cjs.js");
|
|
6
6
|
require("redux");
|
|
@@ -13,21 +13,19 @@ require("@emotion/css");
|
|
|
13
13
|
require("@emotion/serialize");
|
|
14
14
|
require("@emotion/utils");
|
|
15
15
|
require("slate");
|
|
16
|
-
exports.Checkbox =
|
|
17
|
-
exports.CheckboxControlType =
|
|
18
|
-
exports.IconRadioGroupControlType =
|
|
19
|
-
exports.Number =
|
|
20
|
-
exports.NumberControlType =
|
|
21
|
-
exports.Select =
|
|
22
|
-
exports.SelectControlType =
|
|
23
|
-
exports.TextArea =
|
|
24
|
-
exports.TextAreaControlType =
|
|
25
|
-
exports.TextInput =
|
|
26
|
-
exports.TextInputControlType =
|
|
27
|
-
exports.
|
|
28
|
-
exports.
|
|
29
|
-
exports.unstable_IconRadioGroupIcon = typography.unstable_IconRadioGroupIcon;
|
|
30
|
-
exports.unstable_Typography = typography.unstable_Typography;
|
|
16
|
+
exports.Checkbox = textInput.Checkbox;
|
|
17
|
+
exports.CheckboxControlType = textInput.CheckboxControlType;
|
|
18
|
+
exports.IconRadioGroupControlType = textInput.IconRadioGroupControlType;
|
|
19
|
+
exports.Number = textInput.Number;
|
|
20
|
+
exports.NumberControlType = textInput.NumberControlType;
|
|
21
|
+
exports.Select = textInput.Select;
|
|
22
|
+
exports.SelectControlType = textInput.SelectControlType;
|
|
23
|
+
exports.TextArea = textInput.TextArea;
|
|
24
|
+
exports.TextAreaControlType = textInput.TextAreaControlType;
|
|
25
|
+
exports.TextInput = textInput.TextInput;
|
|
26
|
+
exports.TextInputControlType = textInput.TextInputControlType;
|
|
27
|
+
exports.unstable_IconRadioGroup = textInput.unstable_IconRadioGroup;
|
|
28
|
+
exports.unstable_IconRadioGroupIcon = textInput.unstable_IconRadioGroupIcon;
|
|
31
29
|
exports.Color = reactPage.Color;
|
|
32
30
|
exports.ColorControlType = reactPage.ColorControlType;
|
|
33
31
|
exports.Image = reactPage.Image$1;
|
|
@@ -64,6 +62,7 @@ exports.StyleControlType = reactPage.StyleControlType;
|
|
|
64
62
|
exports.StyleV2Control = reactPage.StyleV2Control;
|
|
65
63
|
exports.StyleV2ControlMessageType = reactPage.StyleV2ControlMessageType;
|
|
66
64
|
exports.StyleV2ControlType = reactPage.StyleV2ControlType;
|
|
65
|
+
exports.TypographyControlType = reactPage.TypographyControlType;
|
|
67
66
|
exports.copy = reactPage.copy;
|
|
68
67
|
exports.copyColorData = reactPage.copyColorData;
|
|
69
68
|
exports.copyImageData = reactPage.copyImageData;
|
|
@@ -73,8 +72,18 @@ exports.copyShapeData = reactPage.copyShapeData;
|
|
|
73
72
|
exports.copySlotData = reactPage.copySlotData;
|
|
74
73
|
exports.copyStyleData = reactPage.copyStyleData;
|
|
75
74
|
exports.createRichTextV2Plugin = reactPage.createRichTextV2Plugin;
|
|
76
|
-
exports.
|
|
77
|
-
exports.
|
|
75
|
+
exports.getListElementChildren = reactPage.getListElementChildren;
|
|
76
|
+
exports.getListFileIds = reactPage.getListFileIds;
|
|
77
|
+
exports.getListPageIds = reactPage.getListPageIds;
|
|
78
|
+
exports.getListSwatchIds = reactPage.getListSwatchIds;
|
|
79
|
+
exports.getListTypographyIds = reactPage.getListTypographyIds;
|
|
80
|
+
exports.getShapeElementChildren = reactPage.getShapeElementChildren;
|
|
81
|
+
exports.getShapeFileIds = reactPage.getShapeFileIds;
|
|
82
|
+
exports.getShapePageIds = reactPage.getShapePageIds;
|
|
83
|
+
exports.getShapeSwatchIds = reactPage.getShapeSwatchIds;
|
|
84
|
+
exports.getShapeTypographyIds = reactPage.getShapeTypographyIds;
|
|
85
|
+
exports.getTypographySwatchIds = reactPage.getTypographySwatchIds;
|
|
86
|
+
exports.getTypographyTypographyIds = reactPage.getTypographyTypographyIds;
|
|
78
87
|
exports.isRichTextV1Data = reactPage.isRichTextV1Data;
|
|
79
88
|
exports.merge = reactPage.merge;
|
|
80
89
|
exports.mergeSlotData = reactPage.mergeSlotData;
|
|
@@ -86,6 +95,7 @@ exports.richTextV2DescendentsToData = reactPage.richTextV2DescendentsToData;
|
|
|
86
95
|
exports.toSelectionDTO = reactPage.toSelectionDTO;
|
|
87
96
|
exports.unstable_RichTextV2 = reactPage.unstable_RichTextV2;
|
|
88
97
|
exports.unstable_StyleV2 = reactPage.unstable_StyleV2;
|
|
98
|
+
exports.unstable_Typography = reactPage.unstable_Typography;
|
|
89
99
|
exports.unstable_useStyleV2ClassName = reactPage.unstable_useStyleV2ClassName;
|
|
90
100
|
exports.Combobox = combobox.Combobox;
|
|
91
101
|
exports.ComboboxControlType = combobox.ComboboxControlType;
|
package/dist/controls.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controls.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"controls.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/controls.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { b as Checkbox, C as CheckboxControlType, I as IconRadioGroupControlType, d as Number, N as NumberControlType, e as Select, S as SelectControlType, f as TextArea, T as TextAreaControlType, g as TextInput, a as TextInputControlType, c as unstable_IconRadioGroup, u as unstable_IconRadioGroupIcon } from "./text-input.es.js";
|
|
2
|
+
export { az as Color, ad as ColorControlType, aD as Image, ac as ImageControlType, $ as ImageControlValueFormat, aF as Link, ab as LinkControlType, aH as List, aJ as ListControl, aI as ListControlMessageType, a9 as ListControlType, ba as ObjectType, bb as RichText, bd as RichTextControl, bc as RichTextControlMessageType, a6 as RichTextControlType, bm as RichTextV2Control, bl as RichTextV2ControlMessageType, a5 as RichTextV2ControlType, bi as RichTextV2Mode, aQ as Shape, aS as ShapeControl, aR as ShapeControlMessageType, aa as ShapeControlType, aZ as Slot, a$ as SlotControl, a_ as SlotControlMessageType, a7 as SlotControlType, b2 as Style, b4 as StyleControl, b3 as StyleControlMessageType, _ as StyleControlProperty, a4 as StyleControlType, b9 as StyleV2Control, b8 as StyleV2ControlMessageType, a8 as StyleV2ControlType, a3 as TypographyControlType, aB as copy, aA as copyColorData, aE as copyImageData, aG as copyLinkData, aK as copyListData, aT as copyShapeData, b0 as copySlotData, b5 as copyStyleData, bj as createRichTextV2Plugin, aL as getListElementChildren, aN as getListFileIds, aP as getListPageIds, aM as getListSwatchIds, aO as getListTypographyIds, aU as getShapeElementChildren, aY as getShapeFileIds, aX as getShapePageIds, aV as getShapeSwatchIds, aW as getShapeTypographyIds, bq as getTypographySwatchIds, br as getTypographyTypographyIds, a1 as isRichTextV1Data, aC as merge, b1 as mergeSlotData, bh as richTextDAOToDTO, bf as richTextDTOtoDAO, be as richTextDTOtoSelection, bn as richTextV2DataToDescendents, bo as richTextV2DescendentsToData, bg as toSelectionDTO, bk as unstable_RichTextV2, b7 as unstable_StyleV2, bp as unstable_Typography, b6 as unstable_useStyleV2ClassName } from "./react-page.es.js";
|
|
3
3
|
export { a as Combobox, C as ComboboxControlType } from "./combobox.es.js";
|
|
4
4
|
import "redux";
|
|
5
5
|
import "redux-thunk";
|
package/dist/index.cjs.js
CHANGED
|
@@ -41,7 +41,7 @@ var dynamic = require("next/dynamic");
|
|
|
41
41
|
var reactPage = require("./react-page.cjs.js");
|
|
42
42
|
var actions = require("./actions.cjs.js");
|
|
43
43
|
var jsxRuntime = require("react/jsx-runtime");
|
|
44
|
-
var
|
|
44
|
+
var textInput = require("./text-input.cjs.js");
|
|
45
45
|
var combobox = require("./combobox.cjs.js");
|
|
46
46
|
require("slate");
|
|
47
47
|
var shim = require("use-sync-external-store/shim");
|
|
@@ -1053,8 +1053,8 @@ Received "${apiKey}" instead.`);
|
|
|
1053
1053
|
getResourcesFromElementDescriptors(elementDescriptors, element2.props);
|
|
1054
1054
|
}
|
|
1055
1055
|
const typographies = await this.getTypographies([...typographyIds]);
|
|
1056
|
-
typographies.forEach((
|
|
1057
|
-
|
|
1056
|
+
typographies.forEach((typography) => {
|
|
1057
|
+
typography == null ? void 0 : typography.style.forEach((style) => {
|
|
1058
1058
|
var _a;
|
|
1059
1059
|
const swatchId = (_a = style.value.color) == null ? void 0 : _a.swatchId;
|
|
1060
1060
|
if (swatchId != null)
|
|
@@ -1089,7 +1089,7 @@ Received "${apiKey}" instead.`);
|
|
|
1089
1089
|
var _a;
|
|
1090
1090
|
return {
|
|
1091
1091
|
id,
|
|
1092
|
-
value: (_a = typographies.find((
|
|
1092
|
+
value: (_a = typographies.find((typography) => (typography == null ? void 0 : typography.id) === id)) != null ? _a : null
|
|
1093
1093
|
};
|
|
1094
1094
|
}),
|
|
1095
1095
|
[types.APIResourceType.Table]: [...tableIds].map((id) => {
|
|
@@ -1240,7 +1240,7 @@ async function fonts(_req, res, { getFonts } = {}) {
|
|
|
1240
1240
|
const fonts2 = (_a = await (getFonts == null ? void 0 : getFonts())) != null ? _a : [];
|
|
1241
1241
|
return res.json(fonts2);
|
|
1242
1242
|
}
|
|
1243
|
-
const version = "0.9.
|
|
1243
|
+
const version = "0.9.12";
|
|
1244
1244
|
async function handler(req, res, { apiKey, unstable_siteVersions }) {
|
|
1245
1245
|
if (req.query.secret !== apiKey) {
|
|
1246
1246
|
return res.status(401).json({ message: "Unauthorized" });
|
|
@@ -2597,6 +2597,9 @@ const FallbackComponent = React.forwardRef(function FallbackComponent2({
|
|
|
2597
2597
|
})]
|
|
2598
2598
|
});
|
|
2599
2599
|
});
|
|
2600
|
+
function isNonNullable(value) {
|
|
2601
|
+
return value != null;
|
|
2602
|
+
}
|
|
2600
2603
|
function useSwatch(swatchId) {
|
|
2601
2604
|
const client = useMakeswiftClient();
|
|
2602
2605
|
const readSwatch = () => swatchId == null ? null : client.readSwatch(swatchId);
|
|
@@ -2652,12 +2655,12 @@ function useFiles(fileIds) {
|
|
|
2652
2655
|
function useTypography(typographyId) {
|
|
2653
2656
|
const client = useMakeswiftClient();
|
|
2654
2657
|
const readTypography = () => typographyId == null ? null : client.readTypography(typographyId);
|
|
2655
|
-
const
|
|
2658
|
+
const typography = shim.useSyncExternalStore(client.subscribe, readTypography, readTypography);
|
|
2656
2659
|
React.useEffect(() => {
|
|
2657
2660
|
if (typographyId != null)
|
|
2658
2661
|
client.fetchTypography(typographyId).catch(console.error);
|
|
2659
2662
|
}, [client, typographyId]);
|
|
2660
|
-
return
|
|
2663
|
+
return typography;
|
|
2661
2664
|
}
|
|
2662
2665
|
function useGlobalElement(globalElementId) {
|
|
2663
2666
|
const client = useMakeswiftClient();
|
|
@@ -2705,7 +2708,7 @@ function mapSideColor(swatches, _e) {
|
|
|
2705
2708
|
return __spreadProps(__spreadValues({}, restOfSide), {
|
|
2706
2709
|
color: color && {
|
|
2707
2710
|
alpha: color.alpha,
|
|
2708
|
-
swatch: swatches.filter(
|
|
2711
|
+
swatch: swatches.filter(isNonNullable).find((s) => s && s.id === color.swatchId)
|
|
2709
2712
|
}
|
|
2710
2713
|
});
|
|
2711
2714
|
}
|
|
@@ -2751,7 +2754,7 @@ function useBoxShadow(value) {
|
|
|
2751
2754
|
return __spreadProps(__spreadValues({}, restOfShadow), {
|
|
2752
2755
|
payload: {
|
|
2753
2756
|
color: color != null ? {
|
|
2754
|
-
swatch: swatches.filter(
|
|
2757
|
+
swatch: swatches.filter(isNonNullable).find((s) => s && s.id === color.swatchId),
|
|
2755
2758
|
alpha: color.alpha
|
|
2756
2759
|
} : null,
|
|
2757
2760
|
inset: inset != null ? inset : ShadowDefaultValue.inset,
|
|
@@ -2775,7 +2778,7 @@ function useResponsiveColor(color) {
|
|
|
2775
2778
|
const { swatchId, alpha } = v;
|
|
2776
2779
|
const swatch = swatches.find((s) => s && s.id === swatchId);
|
|
2777
2780
|
return swatch == null ? null : __spreadProps(__spreadValues({}, rest), { value: { swatch, alpha } });
|
|
2778
|
-
}).filter(
|
|
2781
|
+
}).filter(isNonNullable);
|
|
2779
2782
|
}
|
|
2780
2783
|
const getIndexes = (spans, index) => {
|
|
2781
2784
|
const flattened = spans.reduce((a, s) => a.concat(s), []);
|
|
@@ -3271,7 +3274,7 @@ function useRichTextV2(data, definition, control) {
|
|
|
3271
3274
|
control
|
|
3272
3275
|
}) : /* @__PURE__ */ jsxRuntime.jsx(ReadOnlyText, {
|
|
3273
3276
|
text: data,
|
|
3274
|
-
|
|
3277
|
+
definition
|
|
3275
3278
|
});
|
|
3276
3279
|
}
|
|
3277
3280
|
function useSelectControlValue(data, definition) {
|
|
@@ -3497,15 +3500,12 @@ function useTextAreaValue(data, definition) {
|
|
|
3497
3500
|
function useTextInputValue(data, definition) {
|
|
3498
3501
|
return data != null ? data : definition.config.defaultValue;
|
|
3499
3502
|
}
|
|
3500
|
-
function
|
|
3501
|
-
|
|
3502
|
-
}
|
|
3503
|
-
function typographyFragementToTypographyControlData(typography2) {
|
|
3504
|
-
if (typography2 == null)
|
|
3503
|
+
function typographyFragementToTypographyControlData(typography) {
|
|
3504
|
+
if (typography == null)
|
|
3505
3505
|
return void 0;
|
|
3506
3506
|
return {
|
|
3507
|
-
id:
|
|
3508
|
-
style:
|
|
3507
|
+
id: typography.id,
|
|
3508
|
+
style: typography.style.map(({ deviceId, value }) => {
|
|
3509
3509
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
3510
3510
|
return {
|
|
3511
3511
|
deviceId,
|
|
@@ -3531,7 +3531,7 @@ function getTypographyStyleSwatchIds(style) {
|
|
|
3531
3531
|
return (_a = style == null ? void 0 : style.map((override) => override.value).flatMap((typographyStyle) => {
|
|
3532
3532
|
var _a2;
|
|
3533
3533
|
return (_a2 = typographyStyle.color) == null ? void 0 : _a2.swatchId;
|
|
3534
|
-
}).filter(isNonNullable)) != null ? _a : [];
|
|
3534
|
+
}).filter(reactPage.isNonNullable)) != null ? _a : [];
|
|
3535
3535
|
}
|
|
3536
3536
|
const withColor = (swatches) => (deviceRawTypographyValue) => {
|
|
3537
3537
|
var _b, _c;
|
|
@@ -3559,15 +3559,15 @@ const withColor = (swatches) => (deviceRawTypographyValue) => {
|
|
|
3559
3559
|
const getDeviceId = ({ deviceId }) => deviceId;
|
|
3560
3560
|
function useEnhancedTypography(value) {
|
|
3561
3561
|
var _a, _b, _c;
|
|
3562
|
-
const
|
|
3563
|
-
const source = (_b =
|
|
3562
|
+
const typography = typographyFragementToTypographyControlData(useTypography((_a = value == null ? void 0 : value.id) != null ? _a : null));
|
|
3563
|
+
const source = (_b = typography == null ? void 0 : typography.style) != null ? _b : [];
|
|
3564
3564
|
const override = (_c = value == null ? void 0 : value.style) != null ? _c : [];
|
|
3565
3565
|
const breakpoints = useBreakpoints();
|
|
3566
3566
|
const swatchIds = [
|
|
3567
3567
|
...getTypographyStyleSwatchIds(value == null ? void 0 : value.style),
|
|
3568
|
-
...getTypographyStyleSwatchIds(
|
|
3568
|
+
...getTypographyStyleSwatchIds(typography == null ? void 0 : typography.style)
|
|
3569
3569
|
];
|
|
3570
|
-
const swatches = useSwatches(swatchIds).filter(isNonNullable);
|
|
3570
|
+
const swatches = useSwatches(swatchIds).filter(reactPage.isNonNullable);
|
|
3571
3571
|
const enhancedSource = source.map(withColor(swatches));
|
|
3572
3572
|
const enhancedOverride = override.map(withColor(swatches));
|
|
3573
3573
|
const devices = [
|
|
@@ -3594,7 +3594,7 @@ function useEnhancedTypography(value) {
|
|
|
3594
3594
|
};
|
|
3595
3595
|
}
|
|
3596
3596
|
return null;
|
|
3597
|
-
}).filter(isNonNullable);
|
|
3597
|
+
}).filter(reactPage.isNonNullable);
|
|
3598
3598
|
}
|
|
3599
3599
|
function useTypographyClassName(value) {
|
|
3600
3600
|
return reactPage.useStyle(useResponsiveStyle([value], ([value2]) => {
|
|
@@ -3636,31 +3636,31 @@ function ControlValue({
|
|
|
3636
3636
|
control
|
|
3637
3637
|
}) {
|
|
3638
3638
|
switch (definition.type) {
|
|
3639
|
-
case
|
|
3639
|
+
case textInput.CheckboxControlType:
|
|
3640
3640
|
return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
|
|
3641
3641
|
hook: useCheckboxControlValue,
|
|
3642
3642
|
parameters: [data, definition],
|
|
3643
3643
|
children: (value) => children(value)
|
|
3644
3644
|
}, definition.type);
|
|
3645
|
-
case
|
|
3645
|
+
case textInput.NumberControlType:
|
|
3646
3646
|
return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
|
|
3647
3647
|
hook: useNumber,
|
|
3648
3648
|
parameters: [data, definition],
|
|
3649
3649
|
children: (value) => children(value)
|
|
3650
3650
|
}, definition.type);
|
|
3651
|
-
case
|
|
3651
|
+
case textInput.TextInputControlType:
|
|
3652
3652
|
return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
|
|
3653
3653
|
hook: useTextInputValue,
|
|
3654
3654
|
parameters: [data, definition],
|
|
3655
3655
|
children: (value) => children(value)
|
|
3656
3656
|
}, definition.type);
|
|
3657
|
-
case
|
|
3657
|
+
case textInput.TextAreaControlType:
|
|
3658
3658
|
return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
|
|
3659
3659
|
hook: useTextAreaValue,
|
|
3660
3660
|
parameters: [data, definition],
|
|
3661
3661
|
children: (value) => children(value)
|
|
3662
3662
|
}, definition.type);
|
|
3663
|
-
case
|
|
3663
|
+
case textInput.SelectControlType:
|
|
3664
3664
|
return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
|
|
3665
3665
|
hook: useSelectControlValue,
|
|
3666
3666
|
parameters: [data, definition],
|
|
@@ -3672,7 +3672,7 @@ function ControlValue({
|
|
|
3672
3672
|
parameters: [data, definition],
|
|
3673
3673
|
children: (value) => children(value)
|
|
3674
3674
|
}, definition.type);
|
|
3675
|
-
case
|
|
3675
|
+
case textInput.IconRadioGroupControlType:
|
|
3676
3676
|
return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
|
|
3677
3677
|
hook: useIconRadioGroupValue,
|
|
3678
3678
|
parameters: [data, definition],
|
|
@@ -3741,7 +3741,7 @@ function ControlValue({
|
|
|
3741
3741
|
parameters: [data, definition, control],
|
|
3742
3742
|
children: (value) => children(value)
|
|
3743
3743
|
}, definition.type);
|
|
3744
|
-
case
|
|
3744
|
+
case reactPage.TypographyControlType:
|
|
3745
3745
|
return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
|
|
3746
3746
|
hook: useTypographyValue,
|
|
3747
3747
|
parameters: [data],
|
|
@@ -3788,20 +3788,20 @@ function PropsValue({
|
|
|
3788
3788
|
return Object.entries(propControllerDescriptorsRef.current).reduceRight((renderFn, [propName, descriptor]) => (propsValue) => {
|
|
3789
3789
|
var _a2, _b, _c, _d;
|
|
3790
3790
|
switch (descriptor.type) {
|
|
3791
|
-
case
|
|
3792
|
-
case
|
|
3793
|
-
case
|
|
3794
|
-
case
|
|
3795
|
-
case
|
|
3791
|
+
case textInput.CheckboxControlType:
|
|
3792
|
+
case textInput.NumberControlType:
|
|
3793
|
+
case textInput.TextInputControlType:
|
|
3794
|
+
case textInput.TextAreaControlType:
|
|
3795
|
+
case textInput.SelectControlType:
|
|
3796
3796
|
case reactPage.ColorControlType:
|
|
3797
|
-
case
|
|
3797
|
+
case textInput.IconRadioGroupControlType:
|
|
3798
3798
|
case reactPage.ImageControlType:
|
|
3799
3799
|
case combobox.ComboboxControlType:
|
|
3800
3800
|
case reactPage.ShapeControlType:
|
|
3801
3801
|
case reactPage.ListControlType:
|
|
3802
3802
|
case reactPage.LinkControlType:
|
|
3803
3803
|
case reactPage.StyleV2ControlType:
|
|
3804
|
-
case
|
|
3804
|
+
case reactPage.TypographyControlType:
|
|
3805
3805
|
return /* @__PURE__ */ jsxRuntime.jsx(ControlValue, {
|
|
3806
3806
|
definition: descriptor,
|
|
3807
3807
|
data: props[propName],
|
|
@@ -4332,6 +4332,7 @@ exports.forwardNextDynamicRef = forwardNextDynamicRef;
|
|
|
4332
4332
|
exports.getServerSideProps = getServerSideProps;
|
|
4333
4333
|
exports.getStaticPaths = getStaticPaths;
|
|
4334
4334
|
exports.getStaticProps = getStaticProps;
|
|
4335
|
+
exports.isNonNullable = isNonNullable;
|
|
4335
4336
|
exports.pollBoxModel = pollBoxModel;
|
|
4336
4337
|
exports.shallowEqual = shallowEqual;
|
|
4337
4338
|
exports.useBorder = useBorder;
|