@makeswift/runtime 0.10.12 → 0.10.13

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.
Files changed (94) hide show
  1. package/dist/Box.cjs.js +1 -1
  2. package/dist/Box.es.js +2 -2
  3. package/dist/Button.cjs.js +1 -1
  4. package/dist/Button.es.js +2 -2
  5. package/dist/Carousel.cjs.js +1 -1
  6. package/dist/Carousel.es.js +2 -2
  7. package/dist/Countdown.cjs.js +1 -1
  8. package/dist/Countdown.es.js +2 -2
  9. package/dist/Divider.cjs.js +1 -1
  10. package/dist/Divider.es.js +2 -2
  11. package/dist/Embed.es.js +1 -1
  12. package/dist/Form.cjs.js +1 -1
  13. package/dist/Form.es.js +2 -2
  14. package/dist/Image.cjs.js +1 -1
  15. package/dist/Image.es.js +2 -2
  16. package/dist/LiveProvider.cjs.js +1 -1
  17. package/dist/LiveProvider.es.js +2 -2
  18. package/dist/Navigation.cjs.js +1 -1
  19. package/dist/Navigation.es.js +2 -2
  20. package/dist/PreviewProvider.cjs.js +1 -1
  21. package/dist/PreviewProvider.es.js +2 -2
  22. package/dist/ReadOnlyText.cjs.js +1 -1
  23. package/dist/ReadOnlyText.es.js +2 -2
  24. package/dist/ReadOnlyTextV2.cjs.js +1 -1
  25. package/dist/ReadOnlyTextV2.es.js +2 -2
  26. package/dist/Root.cjs.js +1 -1
  27. package/dist/Root.es.js +2 -2
  28. package/dist/SocialLinks.cjs.js +1 -1
  29. package/dist/SocialLinks.es.js +2 -2
  30. package/dist/Video.es.js +1 -1
  31. package/dist/components.cjs.js +1 -1
  32. package/dist/components.es.js +1 -1
  33. package/dist/control-serialization.es.js +1 -1
  34. package/dist/controls.cjs.js +13 -10
  35. package/dist/controls.cjs.js.map +1 -1
  36. package/dist/controls.es.js +2 -2
  37. package/dist/index.cjs.js +29 -10
  38. package/dist/index.cjs.js.map +1 -1
  39. package/dist/index.cjs8.js +1 -1
  40. package/dist/index.cjs9.js +1 -1
  41. package/dist/index.es.js +22 -3
  42. package/dist/index.es.js.map +1 -1
  43. package/dist/index.es2.js +1 -1
  44. package/dist/index.es4.js +1 -1
  45. package/dist/index.es5.js +1 -1
  46. package/dist/index.es6.js +1 -1
  47. package/dist/index.es8.js +2 -2
  48. package/dist/index.es9.js +2 -2
  49. package/dist/next.cjs.js +1 -1
  50. package/dist/next.es.js +1 -1
  51. package/dist/number.cjs.js +14 -0
  52. package/dist/number.cjs.js.map +1 -0
  53. package/dist/number.es.js +10 -0
  54. package/dist/number.es.js.map +1 -0
  55. package/dist/prop-controllers.cjs.js +1 -0
  56. package/dist/prop-controllers.cjs.js.map +1 -1
  57. package/dist/prop-controllers.es.js +1 -1
  58. package/dist/react-page.cjs.js +94 -16
  59. package/dist/react-page.cjs.js.map +1 -1
  60. package/dist/react-page.es.js +83 -14
  61. package/dist/react-page.es.js.map +1 -1
  62. package/dist/react.cjs.js +1 -1
  63. package/dist/react.es.js +1 -1
  64. package/dist/slate.cjs.js +1 -1
  65. package/dist/slate.es.js +2 -2
  66. package/dist/toText.es.js +1 -1
  67. package/dist/types/src/controls/control.d.ts +1 -0
  68. package/dist/types/src/controls/control.d.ts.map +1 -1
  69. package/dist/types/src/controls/list.d.ts +3 -0
  70. package/dist/types/src/controls/list.d.ts.map +1 -1
  71. package/dist/types/src/controls/shape.d.ts +3 -0
  72. package/dist/types/src/controls/shape.d.ts.map +1 -1
  73. package/dist/types/src/next/api-handler/handlers/translatable-data.d.ts +13 -0
  74. package/dist/types/src/next/api-handler/handlers/translatable-data.d.ts.map +1 -0
  75. package/dist/types/src/next/api-handler/index.d.ts +2 -1
  76. package/dist/types/src/next/api-handler/index.d.ts.map +1 -1
  77. package/dist/types/src/next/client.d.ts +2 -1
  78. package/dist/types/src/next/client.d.ts.map +1 -1
  79. package/dist/types/src/prop-controllers/copy/images.d.ts +2 -2
  80. package/dist/types/src/prop-controllers/copy/images.d.ts.map +1 -1
  81. package/dist/types/src/prop-controllers/descriptors.d.ts +16 -4
  82. package/dist/types/src/prop-controllers/descriptors.d.ts.map +1 -1
  83. package/dist/types/src/prop-controllers/index.d.ts +2 -1
  84. package/dist/types/src/prop-controllers/index.d.ts.map +1 -1
  85. package/dist/types/src/prop-controllers/introspection.d.ts.map +1 -1
  86. package/dist/types/src/runtimes/react/index.d.ts +2 -0
  87. package/dist/types/src/runtimes/react/index.d.ts.map +1 -1
  88. package/dist/types/src/state/react-page.d.ts +1 -0
  89. package/dist/types/src/state/react-page.d.ts.map +1 -1
  90. package/package.json +1 -1
  91. package/dist/text-input.cjs.js +0 -26
  92. package/dist/text-input.cjs.js.map +0 -1
  93. package/dist/text-input.es.js +0 -18
  94. package/dist/text-input.es.js.map +0 -1
package/dist/index.es2.js CHANGED
@@ -30,7 +30,7 @@ var __objRest = (source, exclude) => {
30
30
  return target;
31
31
  };
32
32
  import { useMemo, useState, useEffect, useCallback, useRef, forwardRef, createElement, Children } from "react";
33
- import { aD as getBackgroundsFileIds, aE as getBackgroundsSwatchIds, _ as useStyle } from "./react-page.es.js";
33
+ import { aH as getBackgroundsFileIds, aI as getBackgroundsSwatchIds, $ as useStyle } from "./react-page.es.js";
34
34
  import "use-sync-external-store/shim";
35
35
  import { B as isNonNullable, F as useFiles, G as useSwatches, v as useResponsiveGridItem, c as DEFAULT_BOX_ANIMATE_TYPE, f as DEFAULT_ITEM_ANIMATE_TYPE, e as DEFAULT_BOX_ANIMATE_DURATION, d as DEFAULT_BOX_ANIMATE_DELAY, i as DEFAULT_ITEM_STAGGER_DURATION, n as useResponsiveStyle, q as colorToString } from "./index.es.js";
36
36
  import "./actions.es.js";
package/dist/index.es4.js CHANGED
@@ -30,7 +30,7 @@ var __objRest = (source, exclude) => {
30
30
  return target;
31
31
  };
32
32
  import { cx } from "@emotion/css";
33
- import { _ as useStyle } from "./react-page.es.js";
33
+ import { $ as useStyle } from "./react-page.es.js";
34
34
  import { n as useResponsiveStyle } from "./index.es.js";
35
35
  import { jsx } from "react/jsx-runtime";
36
36
  function GutterContainer(_a) {
package/dist/index.es5.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Node, Transforms, Text, Editor } from "slate";
2
2
  import { ReactEditor } from "slate-react";
3
- import { bT as ElementUtils } from "./react-page.es.js";
3
+ import { c0 as ElementUtils } from "./react-page.es.js";
4
4
  function withBuilder(editor) {
5
5
  editor.resetValue = function(value) {
6
6
  var _a;
package/dist/index.es6.js CHANGED
@@ -17,7 +17,7 @@ var __spreadValues = (a, b) => {
17
17
  return a;
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- import { bT as ElementUtils, bw as createRichTextV2Plugin, aN as Link, bU as onChange, bV as getValue, bW as isLinkElement, _ as useStyle, bP as InlineType } from "./react-page.es.js";
20
+ import { c0 as ElementUtils, bF as createRichTextV2Plugin, aS as Link, c1 as onChange, c2 as getValue, c3 as isLinkElement, $ as useStyle, bY as InlineType } from "./react-page.es.js";
21
21
  import { L as Link$1 } from "./index.es3.js";
22
22
  import { cx } from "@emotion/css";
23
23
  import { jsx, Fragment } from "react/jsx-runtime";
package/dist/index.es8.js CHANGED
@@ -36,7 +36,7 @@ import { useCallback, useState, useEffect, forwardRef, useImperativeHandle, useM
36
36
  import { Range, createEditor } from "slate";
37
37
  import { ReactEditor, withReact, Slate, Editable } from "slate-react";
38
38
  import { n as useResponsiveStyle, L as useEnhancedTypography, N as useTypographyClassName, u as useIsInBuilder, O as useBuilderEditMode, Q as pollBoxModel } from "./index.es.js";
39
- import { _ as useStyle, bO as BlockType, bP as InlineType, bo as richTextDTOtoDAO, bn as richTextDTOtoSelection, b as deepEqual, bH as withBlock, bC as withTypography, bG as onKeyDown, c0 as BuilderEditMode } from "./react-page.es.js";
39
+ import { $ as useStyle, bX as BlockType, bY as InlineType, bx as richTextDTOtoDAO, bw as richTextDTOtoSelection, e as deepEqual, bQ as withBlock, bL as withTypography, bP as onKeyDown, c9 as BuilderEditMode } from "./react-page.es.js";
40
40
  import "ts-pattern";
41
41
  import "uuid";
42
42
  import { jsx } from "react/jsx-runtime";
@@ -47,7 +47,7 @@ import "./actions.es.js";
47
47
  import { u as useIsomorphicLayoutEffect } from "./useIsomorphicLayoutEffect.es.js";
48
48
  import "use-sync-external-store/shim/with-selector";
49
49
  import "next/dynamic";
50
- import "./text-input.es.js";
50
+ import "./number.es.js";
51
51
  import "./combobox.es.js";
52
52
  import "use-sync-external-store/shim";
53
53
  import "redux";
package/dist/index.es9.js CHANGED
@@ -33,7 +33,7 @@ import { useEffect, useMemo, useState, useRef, useCallback } from "react";
33
33
  import { Range, createEditor } from "slate";
34
34
  import isHotkey from "is-hotkey";
35
35
  import { ReactEditor, withReact, Slate, Editable } from "slate-react";
36
- import { bu as richTextV2DataToDescendents, bO as BlockType, br as RichTextV2Mode, bK as InlineModePlugin, bI as BlockPlugin, bD as TypographyPlugin, bM as TextAlignPlugin, bS as InlinePlugin, c0 as BuilderEditMode } from "./react-page.es.js";
36
+ import { bD as richTextV2DataToDescendents, bX as BlockType, bA as RichTextV2Mode, bT as InlineModePlugin, bR as BlockPlugin, bM as TypographyPlugin, bV as TextAlignPlugin, b$ as InlinePlugin, c9 as BuilderEditMode } from "./react-page.es.js";
37
37
  import "ts-pattern";
38
38
  import { T as ControlValue, u as useIsInBuilder, r as useBreakpoints, Q as pollBoxModel, O as useBuilderEditMode } from "./index.es.js";
39
39
  import { w as withBuilder } from "./index.es5.js";
@@ -53,7 +53,7 @@ import "@emotion/serialize";
53
53
  import "@emotion/utils";
54
54
  import "use-sync-external-store/shim/with-selector";
55
55
  import "next/dynamic";
56
- import "./text-input.es.js";
56
+ import "./number.es.js";
57
57
  import "./combobox.es.js";
58
58
  import "use-sync-external-store/shim";
59
59
  import "./types.es.js";
package/dist/next.cjs.js CHANGED
@@ -19,7 +19,7 @@ require("@emotion/css");
19
19
  require("@emotion/serialize");
20
20
  require("@emotion/utils");
21
21
  require("is-hotkey");
22
- require("./text-input.cjs.js");
22
+ require("./number.cjs.js");
23
23
  require("./combobox.cjs.js");
24
24
  require("use-sync-external-store/shim");
25
25
  require("./types.cjs.js");
package/dist/next.es.js CHANGED
@@ -17,7 +17,7 @@ import "@emotion/css";
17
17
  import "@emotion/serialize";
18
18
  import "@emotion/utils";
19
19
  import "is-hotkey";
20
- import "./text-input.es.js";
20
+ import "./number.es.js";
21
21
  import "./combobox.es.js";
22
22
  import "use-sync-external-store/shim";
23
23
  import "./types.es.js";
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ const CheckboxControlType = "makeswift::controls::checkbox";
3
+ function Checkbox(config = {}) {
4
+ return { type: CheckboxControlType, config };
5
+ }
6
+ const NumberControlType = "makeswift::controls::number";
7
+ function Number(config = {}) {
8
+ return { type: NumberControlType, config };
9
+ }
10
+ exports.Checkbox = Checkbox;
11
+ exports.CheckboxControlType = CheckboxControlType;
12
+ exports.Number = Number;
13
+ exports.NumberControlType = NumberControlType;
14
+ //# sourceMappingURL=number.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number.cjs.js","sources":["../src/controls/checkbox.ts","../src/controls/number.ts"],"sourcesContent":["export type CheckboxControlData = boolean\n\nexport const CheckboxControlType = 'makeswift::controls::checkbox'\n\ntype CheckboxControlConfig = {\n label?: string\n defaultValue?: boolean\n}\n\nexport type CheckboxControlDefinition<C extends CheckboxControlConfig = CheckboxControlConfig> = {\n type: typeof CheckboxControlType\n config: C\n}\n\nexport function Checkbox<C extends CheckboxControlConfig>(\n config: C = {} as C,\n): CheckboxControlDefinition<C> {\n return { type: CheckboxControlType, config }\n}\n","export type NumberControlData = number\n\nexport const NumberControlType = 'makeswift::controls::number'\n\ntype NumberControlConfig = {\n label?: string\n labelOrientation?: 'vertical' | 'horizontal'\n defaultValue?: number\n min?: number\n max?: number\n step?: number\n suffix?: string\n}\n\nexport type NumberControlDefinition<C extends NumberControlConfig = NumberControlConfig> = {\n type: typeof NumberControlType\n config: C\n}\n\nexport function Number<C extends NumberControlConfig>(\n config: C = {} as C,\n): NumberControlDefinition<C> {\n return { type: NumberControlType, config }\n}\n"],"names":[],"mappings":";AAEO,MAAM,sBAAsB;AAajC,kBAAA,SAAY,IACkB;AACvB,SAAA,EAAE,MAAM,qBAAqB;AACtC;AChBO,MAAM,oBAAoB;AAkB/B,gBAAA,SAAY,IACgB;AACrB,SAAA,EAAE,MAAM,mBAAmB;AACpC;;;;;"}
@@ -0,0 +1,10 @@
1
+ const CheckboxControlType = "makeswift::controls::checkbox";
2
+ function Checkbox(config = {}) {
3
+ return { type: CheckboxControlType, config };
4
+ }
5
+ const NumberControlType = "makeswift::controls::number";
6
+ function Number(config = {}) {
7
+ return { type: NumberControlType, config };
8
+ }
9
+ export { CheckboxControlType as C, NumberControlType as N, Checkbox as a, Number as b };
10
+ //# sourceMappingURL=number.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number.es.js","sources":["../src/controls/checkbox.ts","../src/controls/number.ts"],"sourcesContent":["export type CheckboxControlData = boolean\n\nexport const CheckboxControlType = 'makeswift::controls::checkbox'\n\ntype CheckboxControlConfig = {\n label?: string\n defaultValue?: boolean\n}\n\nexport type CheckboxControlDefinition<C extends CheckboxControlConfig = CheckboxControlConfig> = {\n type: typeof CheckboxControlType\n config: C\n}\n\nexport function Checkbox<C extends CheckboxControlConfig>(\n config: C = {} as C,\n): CheckboxControlDefinition<C> {\n return { type: CheckboxControlType, config }\n}\n","export type NumberControlData = number\n\nexport const NumberControlType = 'makeswift::controls::number'\n\ntype NumberControlConfig = {\n label?: string\n labelOrientation?: 'vertical' | 'horizontal'\n defaultValue?: number\n min?: number\n max?: number\n step?: number\n suffix?: string\n}\n\nexport type NumberControlDefinition<C extends NumberControlConfig = NumberControlConfig> = {\n type: typeof NumberControlType\n config: C\n}\n\nexport function Number<C extends NumberControlConfig>(\n config: C = {} as C,\n): NumberControlDefinition<C> {\n return { type: NumberControlType, config }\n}\n"],"names":[],"mappings":"AAEO,MAAM,sBAAsB;AAajC,kBAAA,SAAY,IACkB;AACvB,SAAA,EAAE,MAAM,qBAAqB;AACtC;AChBO,MAAM,oBAAoB;AAkB/B,gBAAA,SAAY,IACgB;AACrB,SAAA,EAAE,MAAM,mBAAmB;AACpC;;"}
@@ -21,4 +21,5 @@ exports.Props = reactPage.descriptors;
21
21
  exports.RichTextPropControllerMessageType = reactPage.RichTextPropControllerMessageType;
22
22
  exports.TableFormFieldsMessageType = reactPage.TableFormFieldsMessageType;
23
23
  exports.imageCopy = reactPage.copy;
24
+ exports.imagesCopy = reactPage.copy$1;
24
25
  //# sourceMappingURL=prop-controllers.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"prop-controllers.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"prop-controllers.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,4 +1,4 @@
1
- export { i as Introspection, d as Props, R as RichTextPropControllerMessageType, T as TableFormFieldsMessageType, a as imageCopy } from "./react-page.es.js";
1
+ export { i as Introspection, d as Props, R as RichTextPropControllerMessageType, T as TableFormFieldsMessageType, a as imageCopy, b as imagesCopy } from "./react-page.es.js";
2
2
  import "redux";
3
3
  import "redux-thunk";
4
4
  import "./actions.es.js";
@@ -616,7 +616,7 @@ function Image$1(options = {}) {
616
616
  return { type: Types.Image, version: 1, options };
617
617
  }
618
618
  function Images(options = {}) {
619
- return { type: Types.Images, options };
619
+ return { type: Types.Images, version: 1, options };
620
620
  }
621
621
  function Link$1(options = {}) {
622
622
  return { type: Types.Link, options };
@@ -730,10 +730,10 @@ function TableFormFields(options = {}) {
730
730
  function Typeahead(options) {
731
731
  return { type: Types.Typeahead, options };
732
732
  }
733
- function TextArea(options = {}) {
733
+ function TextArea$1(options = {}) {
734
734
  return { type: Types.TextArea, options };
735
735
  }
736
- function TextInput(options = {}) {
736
+ function TextInput$1(options = {}) {
737
737
  return { type: Types.TextInput, options };
738
738
  }
739
739
  function TextStyle(options = {}) {
@@ -801,8 +801,8 @@ var descriptors = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePro
801
801
  Table,
802
802
  TableFormFields,
803
803
  Typeahead,
804
- TextArea,
805
- TextInput,
804
+ TextArea: TextArea$1,
805
+ TextInput: TextInput$1,
806
806
  TextStyle,
807
807
  Video,
808
808
  WidthPropControllerFormat,
@@ -1094,6 +1094,9 @@ function getListTypographyIds(definition2, value) {
1094
1094
  function getListPageIds(definition2, value) {
1095
1095
  return introspectListData(definition2, value, getPageIds);
1096
1096
  }
1097
+ function getListTranslatableData(definition2, data) {
1098
+ return Object.fromEntries(data.map((item) => [item.id, getTranslatableData(definition2.config.type, item.value)]));
1099
+ }
1097
1100
  const ShapeControlType = "makeswift::controls::shape";
1098
1101
  function Shape(config) {
1099
1102
  return { type: ShapeControlType, config };
@@ -1167,6 +1170,20 @@ function getShapePageIds(definition2, data) {
1167
1170
  function getShapeFileIds(definition2, data) {
1168
1171
  return introspectShapeData(definition2, data, getFileIds);
1169
1172
  }
1173
+ function getShapeTranslatableData(definition2, data) {
1174
+ return Object.fromEntries(Object.entries(definition2.config.type).map(([key, definition22]) => [
1175
+ key,
1176
+ getTranslatableData(definition22, data[key])
1177
+ ]));
1178
+ }
1179
+ const TextAreaControlType = "makeswift::controls::text-area";
1180
+ function TextArea(config = {}) {
1181
+ return { type: TextAreaControlType, config };
1182
+ }
1183
+ const TextInputControlType = "makeswift::controls::text-input";
1184
+ function TextInput(config = {}) {
1185
+ return { type: TextInputControlType, config };
1186
+ }
1170
1187
  const SlotControlType = "makeswift::controls::slot";
1171
1188
  function Slot() {
1172
1189
  return { type: SlotControlType };
@@ -1455,18 +1472,23 @@ if (void 0) {
1455
1472
  });
1456
1473
  });
1457
1474
  }
1458
- function copy$8(value, context) {
1475
+ function copy$8(descriptor, value, context) {
1459
1476
  if (value == null)
1460
1477
  return value;
1461
1478
  return value.map(copyImagesPanelItem);
1462
1479
  function copyImagesPanelItem(imagesPanelItem) {
1463
- var _a;
1464
1480
  const { file } = imagesPanelItem.props;
1465
1481
  if (file == null)
1466
1482
  return imagesPanelItem;
1467
1483
  return __spreadProps(__spreadValues({}, imagesPanelItem), {
1468
1484
  props: __spreadProps(__spreadValues({}, imagesPanelItem.props), {
1469
- file: (_a = context.replacementContext.fileIds.get(file)) != null ? _a : file
1485
+ file: tsPattern.match([descriptor, file]).with([tsPattern.P.any, tsPattern.P.string], ([, f]) => {
1486
+ var _a;
1487
+ return (_a = context.replacementContext.fileIds.get(f)) != null ? _a : f;
1488
+ }).with([{ version: 1 }, { type: "makeswift-file", version: 1 }], ([, f]) => {
1489
+ var _a;
1490
+ return (_a = context.replacementContext.fileIds.get(f.id)) != null ? _a : f.id;
1491
+ }).otherwise(([, f]) => f)
1470
1492
  })
1471
1493
  });
1472
1494
  }
@@ -1502,9 +1524,8 @@ if (void 0) {
1502
1524
  globalElementIds: /* @__PURE__ */ new Map(),
1503
1525
  globalElementData: /* @__PURE__ */ new Map()
1504
1526
  };
1505
- const result = copy$8(data, {
1506
- replacementContext,
1507
- copyElement: (node) => node
1527
+ const result = copy$8({ type: "Images", options: {} }, data, {
1528
+ replacementContext
1508
1529
  });
1509
1530
  expect(result).toMatchObject(expected);
1510
1531
  });
@@ -1945,7 +1966,7 @@ function copy$1(descriptor, value, context) {
1945
1966
  case "Image":
1946
1967
  return copy$9(descriptor, value, context);
1947
1968
  case "Images":
1948
- return copy$8(value, context);
1969
+ return copy$8(descriptor, value, context);
1949
1970
  case "ResponsiveColor":
1950
1971
  return copy$7(value, context);
1951
1972
  case "TableFormFields":
@@ -3996,6 +4017,21 @@ function merge(definition2, a, b = a, context) {
3996
4017
  return b;
3997
4018
  }
3998
4019
  }
4020
+ function getTranslatableData(definition2, data) {
4021
+ switch (definition2.type) {
4022
+ case Types.TextInput:
4023
+ case Types.TextArea:
4024
+ case TextInputControlType:
4025
+ case TextAreaControlType:
4026
+ return data;
4027
+ case ListControlType:
4028
+ return getListTranslatableData(definition2, data);
4029
+ case ShapeControlType:
4030
+ return getShapeTranslatableData(definition2, data);
4031
+ default:
4032
+ return null;
4033
+ }
4034
+ }
3999
4035
  const StyleV2ControlType = "makeswift::controls::style-v2";
4000
4036
  const unstable_useStyleV2ClassName = useStyle;
4001
4037
  function unstable_StyleV2(config) {
@@ -4334,7 +4370,7 @@ function getFileIds(descriptor, prop) {
4334
4370
  }
4335
4371
  case Types.Images: {
4336
4372
  const value = prop;
4337
- return (_a = value == null ? void 0 : value.flatMap((item) => item.props.file == null ? [] : [item.props.file])) != null ? _a : [];
4373
+ return (_a = value == null ? void 0 : value.flatMap((item) => tsPattern.match(item.props.file).with(tsPattern.P.string, (f) => [f]).with({ type: "makeswift-file", version: 1 }, (f) => [f.id]).with({ type: "external-file", version: 1 }, () => []).with(tsPattern.P.nullish, () => []).otherwise(() => []))) != null ? _a : [];
4338
4374
  }
4339
4375
  case ImageControlType: {
4340
4376
  const value = prop;
@@ -4642,6 +4678,39 @@ function copyElementTree(state, elementTree, replacementContext) {
4642
4678
  const copy$12 = JSON.parse(JSON.stringify(elementTree));
4643
4679
  return copyElementTreeNode(state, createReplacementContext(replacementContext))(copy$12);
4644
4680
  }
4681
+ function* traverseElementTree(state, elementTree) {
4682
+ yield elementTree;
4683
+ if (isElementReference(elementTree))
4684
+ return;
4685
+ const descriptors2 = getComponentPropControllerDescriptors(state, elementTree.type);
4686
+ if (descriptors2 == null)
4687
+ return;
4688
+ for (const [propKey, descriptor] of Object.entries(descriptors2)) {
4689
+ const children = getElementChildren(descriptor, elementTree.props[propKey]);
4690
+ for (const child of children) {
4691
+ if (!isElementReference(child))
4692
+ yield* traverseElementTree(state, child);
4693
+ yield child;
4694
+ }
4695
+ }
4696
+ }
4697
+ function getElementTreeTranslatableData(state, elementTree) {
4698
+ const translatableData = {};
4699
+ for (const element of traverseElementTree(state, elementTree)) {
4700
+ if (isElementReference(element))
4701
+ continue;
4702
+ const descriptors2 = getComponentPropControllerDescriptors(state, element.type);
4703
+ if (descriptors2 == null)
4704
+ continue;
4705
+ Object.entries(descriptors2).forEach(([propName, descriptor]) => {
4706
+ const translatablePropData = getTranslatableData(descriptor, element.props[propName]);
4707
+ if (translatablePropData != null) {
4708
+ translatableData[`${element.key}:${propName}`] = translatablePropData;
4709
+ }
4710
+ });
4711
+ }
4712
+ return translatableData;
4713
+ }
4645
4714
  function getIsInBuilder(state) {
4646
4715
  return state.isInBuilder;
4647
4716
  }
@@ -4759,8 +4828,12 @@ exports.Table = Table;
4759
4828
  exports.TableFormFields = TableFormFields;
4760
4829
  exports.TableFormFieldsMessageType = TableFormFieldsMessageType;
4761
4830
  exports.TextAlignPlugin = TextAlignPlugin;
4762
- exports.TextArea = TextArea;
4763
- exports.TextInput = TextInput;
4831
+ exports.TextArea = TextArea$1;
4832
+ exports.TextArea$1 = TextArea;
4833
+ exports.TextAreaControlType = TextAreaControlType;
4834
+ exports.TextInput = TextInput$1;
4835
+ exports.TextInput$1 = TextInput;
4836
+ exports.TextInputControlType = TextInputControlType;
4764
4837
  exports.TextStyle = TextStyle;
4765
4838
  exports.Types = Types;
4766
4839
  exports.TypographyActions = TypographyActions;
@@ -4771,7 +4844,8 @@ exports.Width = Width;
4771
4844
  exports.WidthPropControllerFormat = WidthPropControllerFormat;
4772
4845
  exports.configureStore = configureStore;
4773
4846
  exports.copy = copy$9;
4774
- exports.copy$1 = copy;
4847
+ exports.copy$1 = copy$8;
4848
+ exports.copy$2 = copy;
4775
4849
  exports.copyColorData = copyColorData;
4776
4850
  exports.copyElementTree = copyElementTree;
4777
4851
  exports.copyImageData = copyImageData;
@@ -4804,6 +4878,7 @@ exports.getElement = getElement;
4804
4878
  exports.getElementChildren = getElementChildren;
4805
4879
  exports.getElementId = getElementId;
4806
4880
  exports.getElementPropControllerDescriptors = getElementPropControllerDescriptors;
4881
+ exports.getElementTreeTranslatableData = getElementTreeTranslatableData;
4807
4882
  exports.getFileIds = getFileIds;
4808
4883
  exports.getInitialState = getInitialState$7;
4809
4884
  exports.getInitialState$1 = getInitialState$2;
@@ -4813,6 +4888,7 @@ exports.getListElementChildren = getListElementChildren;
4813
4888
  exports.getListFileIds = getListFileIds;
4814
4889
  exports.getListPageIds = getListPageIds;
4815
4890
  exports.getListSwatchIds = getListSwatchIds;
4891
+ exports.getListTranslatableData = getListTranslatableData;
4816
4892
  exports.getListTypographyIds = getListTypographyIds;
4817
4893
  exports.getLocales = getLocales;
4818
4894
  exports.getPageIds = getPageIds;
@@ -4826,9 +4902,11 @@ exports.getShapeElementChildren = getShapeElementChildren;
4826
4902
  exports.getShapeFileIds = getShapeFileIds;
4827
4903
  exports.getShapePageIds = getShapePageIds;
4828
4904
  exports.getShapeSwatchIds = getShapeSwatchIds;
4905
+ exports.getShapeTranslatableData = getShapeTranslatableData;
4829
4906
  exports.getShapeTypographyIds = getShapeTypographyIds;
4830
4907
  exports.getSwatchIds = getSwatchIds;
4831
4908
  exports.getTableIds = getTableIds;
4909
+ exports.getTranslatableData = getTranslatableData;
4832
4910
  exports.getTypographyIds = getTypographyIds;
4833
4911
  exports.getTypographySwatchIds = getTypographySwatchIds;
4834
4912
  exports.getTypographyTypographyIds = getTypographyTypographyIds;