@makeswift/runtime 0.6.2 → 0.6.4

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 (135) hide show
  1. package/dist/Box.cjs.js +1 -1
  2. package/dist/Box.es.js +1 -1
  3. package/dist/Button.cjs.js +1 -1
  4. package/dist/Button.es.js +1 -1
  5. package/dist/Carousel.cjs.js +1 -1
  6. package/dist/Carousel.es.js +1 -1
  7. package/dist/Countdown.cjs.js +1 -1
  8. package/dist/Countdown.es.js +1 -1
  9. package/dist/Divider.cjs.js +1 -1
  10. package/dist/Divider.es.js +1 -1
  11. package/dist/EditableText.cjs.js +22 -4
  12. package/dist/EditableText.cjs.js.map +1 -1
  13. package/dist/EditableText.es.js +24 -6
  14. package/dist/EditableText.es.js.map +1 -1
  15. package/dist/Embed.cjs.js +1 -1
  16. package/dist/Embed.es.js +1 -1
  17. package/dist/Form.cjs.js +1 -1
  18. package/dist/Form.es.js +1 -1
  19. package/dist/Image.cjs.js +3 -6
  20. package/dist/Image.cjs.js.map +1 -1
  21. package/dist/Image.es.js +4 -7
  22. package/dist/Image.es.js.map +1 -1
  23. package/dist/LiveProvider.cjs.js +1 -1
  24. package/dist/LiveProvider.es.js +1 -1
  25. package/dist/Navigation.cjs.js +1 -1
  26. package/dist/Navigation.es.js +1 -1
  27. package/dist/PreviewProvider.cjs.js +55 -18
  28. package/dist/PreviewProvider.cjs.js.map +1 -1
  29. package/dist/PreviewProvider.es.js +55 -19
  30. package/dist/PreviewProvider.es.js.map +1 -1
  31. package/dist/ReadOnlyText.cjs.js +7 -4
  32. package/dist/ReadOnlyText.cjs.js.map +1 -1
  33. package/dist/ReadOnlyText.es.js +7 -4
  34. package/dist/ReadOnlyText.es.js.map +1 -1
  35. package/dist/Root.cjs.js +1 -1
  36. package/dist/Root.es.js +1 -1
  37. package/dist/SocialLinks.cjs.js +1 -1
  38. package/dist/SocialLinks.es.js +1 -1
  39. package/dist/Text.cjs.js +1 -1
  40. package/dist/Text.es.js +1 -1
  41. package/dist/Video.cjs.js +1 -1
  42. package/dist/Video.es.js +1 -1
  43. package/dist/actions.cjs.js +11 -1
  44. package/dist/actions.cjs.js.map +1 -1
  45. package/dist/actions.es.js +11 -2
  46. package/dist/actions.es.js.map +1 -1
  47. package/dist/builder.cjs.js +2 -1
  48. package/dist/builder.cjs.js.map +1 -1
  49. package/dist/builder.es.js +2 -1
  50. package/dist/builder.es.js.map +1 -1
  51. package/dist/components.cjs.js +1 -1
  52. package/dist/components.es.js +1 -1
  53. package/dist/constants.cjs.js +26 -21
  54. package/dist/constants.cjs.js.map +1 -1
  55. package/dist/constants.es.js +7 -3
  56. package/dist/constants.es.js.map +1 -1
  57. package/dist/control-serialization.cjs.js +37 -37
  58. package/dist/control-serialization.cjs.js.map +1 -1
  59. package/dist/control-serialization.es.js +1 -1
  60. package/dist/control.cjs.js +22 -22
  61. package/dist/control.cjs.js.map +1 -1
  62. package/dist/control.es.js +1 -1
  63. package/dist/controls.cjs.js +22 -17
  64. package/dist/controls.cjs.js.map +1 -1
  65. package/dist/controls.es.js +2 -1
  66. package/dist/controls.es.js.map +1 -1
  67. package/dist/index.cjs.js +279 -216
  68. package/dist/index.cjs.js.map +1 -1
  69. package/dist/index.cjs2.js +1 -1
  70. package/dist/index.cjs5.js +36 -139
  71. package/dist/index.cjs5.js.map +1 -1
  72. package/dist/index.cjs6.js +141 -0
  73. package/dist/index.cjs6.js.map +1 -0
  74. package/dist/index.es.js +92 -33
  75. package/dist/index.es.js.map +1 -1
  76. package/dist/index.es2.js +2 -2
  77. package/dist/index.es5.js +34 -138
  78. package/dist/index.es5.js.map +1 -1
  79. package/dist/index.es6.js +139 -0
  80. package/dist/index.es6.js.map +1 -0
  81. package/dist/main.cjs.js +2 -1
  82. package/dist/main.cjs.js.map +1 -1
  83. package/dist/main.es.js +2 -2
  84. package/dist/next.cjs.js +1 -1
  85. package/dist/next.es.js +2 -2
  86. package/dist/prop-controllers.cjs.js +5 -4
  87. package/dist/prop-controllers.cjs.js.map +1 -1
  88. package/dist/prop-controllers.es.js +2 -1
  89. package/dist/prop-controllers.es.js.map +1 -1
  90. package/dist/react.cjs.js +1 -1
  91. package/dist/react.es.js +1 -1
  92. package/dist/{slot.cjs.js → rich-text.cjs.js} +104 -12
  93. package/dist/rich-text.cjs.js.map +1 -0
  94. package/dist/{slot.es.js → rich-text.es.js} +98 -12
  95. package/dist/rich-text.es.js.map +1 -0
  96. package/dist/types/src/components/builtin/Image/Image.d.ts.map +1 -1
  97. package/dist/types/src/components/builtin/Text/EditableText.d.ts.map +1 -1
  98. package/dist/types/src/components/builtin/Text/ReadOnlyText.d.ts.map +1 -1
  99. package/dist/types/src/components/builtin/Text/register.d.ts.map +1 -1
  100. package/dist/types/src/controls/index.d.ts +1 -0
  101. package/dist/types/src/controls/index.d.ts.map +1 -1
  102. package/dist/types/src/controls/rich-text.d.ts +66 -0
  103. package/dist/types/src/controls/rich-text.d.ts.map +1 -0
  104. package/dist/types/src/controls/style.d.ts +16 -4
  105. package/dist/types/src/controls/style.d.ts.map +1 -1
  106. package/dist/types/src/index.d.ts +1 -1
  107. package/dist/types/src/index.d.ts.map +1 -1
  108. package/dist/types/src/next/api-handler.d.ts +1 -0
  109. package/dist/types/src/next/api-handler.d.ts.map +1 -1
  110. package/dist/types/src/next/preview-mode.d.ts.map +1 -1
  111. package/dist/types/src/prop-controllers/descriptors.d.ts +4 -2
  112. package/dist/types/src/prop-controllers/descriptors.d.ts.map +1 -1
  113. package/dist/types/src/prop-controllers/instances.d.ts +14 -4
  114. package/dist/types/src/prop-controllers/instances.d.ts.map +1 -1
  115. package/dist/types/src/runtimes/react/controls/rich-text.d.ts +8 -0
  116. package/dist/types/src/runtimes/react/controls/rich-text.d.ts.map +1 -0
  117. package/dist/types/src/runtimes/react/controls/slot.d.ts.map +1 -1
  118. package/dist/types/src/runtimes/react/controls.d.ts.map +1 -1
  119. package/dist/types/src/runtimes/react/index.d.ts +2 -0
  120. package/dist/types/src/runtimes/react/index.d.ts.map +1 -1
  121. package/dist/types/src/runtimes/react/poll-box-model.d.ts +6 -0
  122. package/dist/types/src/runtimes/react/poll-box-model.d.ts.map +1 -0
  123. package/dist/types/src/state/actions.d.ts +12 -1
  124. package/dist/types/src/state/actions.d.ts.map +1 -1
  125. package/dist/types/src/state/modules/builder-edit-mode.d.ts +11 -0
  126. package/dist/types/src/state/modules/builder-edit-mode.d.ts.map +1 -0
  127. package/dist/types/src/state/react-builder-preview.d.ts +2 -0
  128. package/dist/types/src/state/react-builder-preview.d.ts.map +1 -1
  129. package/dist/types/src/state/react-page.d.ts +3 -0
  130. package/dist/types/src/state/react-page.d.ts.map +1 -1
  131. package/package.json +1 -1
  132. package/dist/slot.cjs.js.map +0 -1
  133. package/dist/slot.es.js.map +0 -1
  134. package/dist/types/src/utils/constants.d.ts +0 -6
  135. package/dist/types/src/utils/constants.d.ts.map +0 -1
package/dist/index.cjs.js CHANGED
@@ -45,7 +45,7 @@ var css = require("@emotion/css");
45
45
  var serialize = require("@emotion/serialize");
46
46
  var utils = require("@emotion/utils");
47
47
  var jsxRuntime = require("react/jsx-runtime");
48
- var slot = require("./slot.cjs.js");
48
+ var richText = require("./rich-text.cjs.js");
49
49
  var textInput = require("./text-input.cjs.js");
50
50
  var combobox = require("./combobox.cjs.js");
51
51
  var control = require("./control.cjs.js");
@@ -180,13 +180,13 @@ async function introspect(element, client, store) {
180
180
  getResourcesFromElementDescriptors({ propName: descriptor.config.type }, { propName: item.value });
181
181
  });
182
182
  }
183
- if (descriptor.type === slot.Types.Shape) {
183
+ if (descriptor.type === richText.Types.Shape) {
184
184
  const prop = props[propName];
185
185
  if (prop == null)
186
186
  return;
187
187
  getResourcesFromElementDescriptors(descriptor.options.type, prop);
188
188
  }
189
- if (descriptor.type === slot.Types.List) {
189
+ if (descriptor.type === richText.Types.List) {
190
190
  const prop = props[propName];
191
191
  if (prop == null)
192
192
  return;
@@ -991,7 +991,7 @@ function PreviewModeScript({
991
991
  isPreview = false,
992
992
  appOrigin = "https://app.makeswift.com"
993
993
  }) {
994
- const __html = `
994
+ const previewModeScript = `
995
995
  const isPreview = ${isPreview}
996
996
  const appOrigin = '${appOrigin.replace("'", "\\'")}'
997
997
  const searchParamName = 'x-makeswift-preview-mode'
@@ -1039,12 +1039,43 @@ if (originalUrl.searchParams.has(searchParamName)) {
1039
1039
  window.history.replaceState(null, '', url)
1040
1040
  }
1041
1041
  `;
1042
- return /* @__PURE__ */ jsxRuntime.jsx("script", {
1043
- id: "makeswift-preview-mode",
1044
- type: "module",
1045
- dangerouslySetInnerHTML: {
1046
- __html
1042
+ const makeswiftConnectionCheckScript = `
1043
+ const appOrigin = '${appOrigin.replace("'", "\\'")}'
1044
+
1045
+ if (window.parent !== window) {
1046
+ window.addEventListener('message', event => {
1047
+ if (
1048
+ event.origin === appOrigin &&
1049
+ event.data.type === '${actions.ActionTypes.MAKESWIFT_CONNECTION_INIT}'
1050
+ ) {
1051
+ setInterval(() => {
1052
+ window.parent.postMessage({
1053
+ type: '${actions.ActionTypes.MAKESWIFT_CONNECTION_CHECK}',
1054
+ payload: {
1055
+ currentUrl: window.location.href
1056
+ }
1057
+ }, appOrigin)
1058
+ }, 20)
1047
1059
  }
1060
+ })
1061
+
1062
+ window.parent.postMessage({ type: '${actions.ActionTypes.MAKESWIFT_CONNECTION_INIT}' }, appOrigin)
1063
+ }
1064
+ `;
1065
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
1066
+ children: [/* @__PURE__ */ jsxRuntime.jsx("script", {
1067
+ id: "makeswift-preview-mode",
1068
+ type: "module",
1069
+ dangerouslySetInnerHTML: {
1070
+ __html: previewModeScript
1071
+ }
1072
+ }), /* @__PURE__ */ jsxRuntime.jsx("script", {
1073
+ id: "makeswift-connection-check",
1074
+ type: "module",
1075
+ dangerouslySetInnerHTML: {
1076
+ __html: makeswiftConnectionCheckScript
1077
+ }
1078
+ })]
1048
1079
  });
1049
1080
  }
1050
1081
  class Document$1 extends NextDocument__default["default"] {
@@ -1083,7 +1114,7 @@ class Document$1 extends NextDocument__default["default"] {
1083
1114
  });
1084
1115
  }
1085
1116
  }
1086
- const version = "0.6.2";
1117
+ const version = "0.6.4";
1087
1118
  function isErrorWithMessage(error) {
1088
1119
  return typeof error === "object" && error !== null && "message" in error && typeof error.message === "string";
1089
1120
  }
@@ -1123,7 +1154,8 @@ Read more about dynamic catch-all routes here: https://nextjs.org/docs/routing/d
1123
1154
  return res.status(401).json({ message: "Unauthorized" });
1124
1155
  return res.json({
1125
1156
  version,
1126
- previewMode: true
1157
+ previewMode: true,
1158
+ interactionMode: true
1127
1159
  });
1128
1160
  }
1129
1161
  case "revalidate": {
@@ -1414,13 +1446,13 @@ function registerComponent$c(runtime) {
1414
1446
  type: constants.MakeswiftComponentType.Box,
1415
1447
  label: "Box",
1416
1448
  props: {
1417
- id: slot.ElementID(),
1418
- backgrounds: slot.Backgrounds(),
1419
- width: slot.Width({
1420
- format: slot.Width.Format.ClassName,
1449
+ id: richText.ElementID(),
1450
+ backgrounds: richText.Backgrounds(),
1451
+ width: richText.Width({
1452
+ format: richText.Width.Format.ClassName,
1421
1453
  defaultValue: { value: 100, unit: "%" }
1422
1454
  }),
1423
- height: slot.ResponsiveIconRadioGroup({
1455
+ height: richText.ResponsiveIconRadioGroup({
1424
1456
  label: "Height",
1425
1457
  options: [
1426
1458
  { value: "auto", label: "Auto", icon: "HeightAuto16" },
@@ -1428,7 +1460,7 @@ function registerComponent$c(runtime) {
1428
1460
  ],
1429
1461
  defaultValue: "auto"
1430
1462
  }),
1431
- verticalAlign: slot.ResponsiveIconRadioGroup({
1463
+ verticalAlign: richText.ResponsiveIconRadioGroup({
1432
1464
  label: "Align items",
1433
1465
  options: [
1434
1466
  { value: "flex-start", label: "Top", icon: "VerticalAlignStart16" },
@@ -1442,9 +1474,9 @@ function registerComponent$c(runtime) {
1442
1474
  ],
1443
1475
  defaultValue: "flex-start"
1444
1476
  }),
1445
- margin: slot.Margin({ format: slot.Margin.Format.ClassName }),
1446
- padding: slot.Padding({
1447
- format: slot.Padding.Format.ClassName,
1477
+ margin: richText.Margin({ format: richText.Margin.Format.ClassName }),
1478
+ padding: richText.Padding({
1479
+ format: richText.Padding.Format.ClassName,
1448
1480
  preset: [
1449
1481
  {
1450
1482
  deviceId: "desktop",
@@ -1457,16 +1489,16 @@ function registerComponent$c(runtime) {
1457
1489
  }
1458
1490
  ]
1459
1491
  }),
1460
- border: slot.Border({ format: slot.Border.Format.ClassName }),
1461
- borderRadius: slot.BorderRadius({ format: slot.BorderRadius.Format.ClassName }),
1462
- boxShadow: slot.Shadows({ format: slot.Shadows.Format.ClassName }),
1463
- rowGap: slot.GapY((props) => ({
1492
+ border: richText.Border({ format: richText.Border.Format.ClassName }),
1493
+ borderRadius: richText.BorderRadius({ format: richText.BorderRadius.Format.ClassName }),
1494
+ boxShadow: richText.Shadows({ format: richText.Shadows.Format.ClassName }),
1495
+ rowGap: richText.GapY((props) => ({
1464
1496
  hidden: props.children == null
1465
1497
  })),
1466
- columnGap: slot.GapX((props) => ({
1498
+ columnGap: richText.GapX((props) => ({
1467
1499
  hidden: props.children == null
1468
1500
  })),
1469
- boxAnimateType: slot.ResponsiveSelect({
1501
+ boxAnimateType: richText.ResponsiveSelect({
1470
1502
  label: "Animate box in",
1471
1503
  labelOrientation: "vertical",
1472
1504
  options: [
@@ -1482,7 +1514,7 @@ function registerComponent$c(runtime) {
1482
1514
  ],
1483
1515
  defaultValue: "none"
1484
1516
  }),
1485
- boxAnimateDuration: slot.ResponsiveNumber((props, device) => ({
1517
+ boxAnimateDuration: richText.ResponsiveNumber((props, device) => ({
1486
1518
  label: "Box duration",
1487
1519
  defaultValue: DEFAULT_BOX_ANIMATE_DURATION,
1488
1520
  min: 0.1,
@@ -1490,7 +1522,7 @@ function registerComponent$c(runtime) {
1490
1522
  suffix: "s",
1491
1523
  hidden: isHiddenBasedOnBoxAnimation(props, device)
1492
1524
  })),
1493
- boxAnimateDelay: slot.ResponsiveNumber((props, device) => ({
1525
+ boxAnimateDelay: richText.ResponsiveNumber((props, device) => ({
1494
1526
  label: "Box delay",
1495
1527
  defaultValue: DEFAULT_BOX_ANIMATE_DELAY,
1496
1528
  min: 0,
@@ -1498,7 +1530,7 @@ function registerComponent$c(runtime) {
1498
1530
  suffix: "s",
1499
1531
  hidden: isHiddenBasedOnBoxAnimation(props, device)
1500
1532
  })),
1501
- itemAnimateType: slot.ResponsiveSelect({
1533
+ itemAnimateType: richText.ResponsiveSelect({
1502
1534
  label: "Animate items in",
1503
1535
  labelOrientation: "vertical",
1504
1536
  options: [
@@ -1514,7 +1546,7 @@ function registerComponent$c(runtime) {
1514
1546
  ],
1515
1547
  defaultValue: "none"
1516
1548
  }),
1517
- itemAnimateDuration: slot.ResponsiveNumber((props, device) => ({
1549
+ itemAnimateDuration: richText.ResponsiveNumber((props, device) => ({
1518
1550
  label: "Items duration",
1519
1551
  defaultValue: DEFAULT_BOX_ANIMATE_DURATION,
1520
1552
  min: 0.1,
@@ -1522,7 +1554,7 @@ function registerComponent$c(runtime) {
1522
1554
  suffix: "s",
1523
1555
  hidden: isHiddenBasedOnItemAnimation(props, device)
1524
1556
  })),
1525
- itemAnimateDelay: slot.ResponsiveNumber((props, device) => ({
1557
+ itemAnimateDelay: richText.ResponsiveNumber((props, device) => ({
1526
1558
  label: "Items delay",
1527
1559
  defaultValue: DEFAULT_ITEM_ANIMATE_DELAY,
1528
1560
  min: 0,
@@ -1530,7 +1562,7 @@ function registerComponent$c(runtime) {
1530
1562
  suffix: "s",
1531
1563
  hidden: isHiddenBasedOnItemAnimation(props, device)
1532
1564
  })),
1533
- itemStaggerDuration: slot.ResponsiveNumber((props, device) => ({
1565
+ itemStaggerDuration: richText.ResponsiveNumber((props, device) => ({
1534
1566
  label: "Stagger",
1535
1567
  min: 0,
1536
1568
  step: 0.05,
@@ -1538,11 +1570,11 @@ function registerComponent$c(runtime) {
1538
1570
  defaultValue: DEFAULT_ITEM_STAGGER_DURATION,
1539
1571
  hidden: isHiddenBasedOnItemAnimation(props, device)
1540
1572
  })),
1541
- hidePlaceholder: slot.Checkbox((props) => ({
1573
+ hidePlaceholder: richText.Checkbox((props) => ({
1542
1574
  label: "Hide placeholder",
1543
1575
  hidden: props.children != null
1544
1576
  })),
1545
- children: slot.Grid()
1577
+ children: richText.Grid()
1546
1578
  }
1547
1579
  });
1548
1580
  }
@@ -1553,9 +1585,9 @@ function registerComponent$b(runtime) {
1553
1585
  type: constants.MakeswiftComponentType.Button,
1554
1586
  label: "Button",
1555
1587
  props: {
1556
- id: slot.ElementID(),
1557
- children: slot.TextInput({ placeholder: "Button text" }),
1558
- link: slot.Link({
1588
+ id: richText.ElementID(),
1589
+ children: richText.TextInput({ placeholder: "Button text" }),
1590
+ link: richText.Link({
1559
1591
  defaultValue: {
1560
1592
  type: "OPEN_PAGE",
1561
1593
  payload: {
@@ -1564,7 +1596,7 @@ function registerComponent$b(runtime) {
1564
1596
  }
1565
1597
  }
1566
1598
  }),
1567
- variant: slot.ResponsiveSelect({
1599
+ variant: richText.ResponsiveSelect({
1568
1600
  label: "Style",
1569
1601
  labelOrientation: "horizontal",
1570
1602
  options: [
@@ -1578,7 +1610,7 @@ function registerComponent$b(runtime) {
1578
1610
  ],
1579
1611
  defaultValue: "flat"
1580
1612
  }),
1581
- shape: slot.ResponsiveIconRadioGroup({
1613
+ shape: richText.ResponsiveIconRadioGroup({
1582
1614
  label: "Shape",
1583
1615
  options: [
1584
1616
  { label: "Pill", value: "pill", icon: "ButtonPill16" },
@@ -1587,7 +1619,7 @@ function registerComponent$b(runtime) {
1587
1619
  ],
1588
1620
  defaultValue: "rounded"
1589
1621
  }),
1590
- size: slot.ResponsiveIconRadioGroup({
1622
+ size: richText.ResponsiveIconRadioGroup({
1591
1623
  label: "Size",
1592
1624
  options: [
1593
1625
  { label: "Small", value: "small", icon: "SizeSmall16" },
@@ -1596,19 +1628,19 @@ function registerComponent$b(runtime) {
1596
1628
  ],
1597
1629
  defaultValue: "medium"
1598
1630
  }),
1599
- color: slot.ResponsiveColor((props, device) => {
1631
+ color: richText.ResponsiveColor((props, device) => {
1600
1632
  var _a;
1601
1633
  const variant = props.variant;
1602
1634
  const hidden = ((_a = findDeviceOverride(variant, device)) == null ? void 0 : _a.value) === "clear";
1603
1635
  return { placeholder: "black", hidden };
1604
1636
  }),
1605
- textColor: slot.ResponsiveColor({
1637
+ textColor: richText.ResponsiveColor({
1606
1638
  label: "Text color",
1607
1639
  placeholder: "white"
1608
1640
  }),
1609
- textStyle: slot.TextStyle(),
1610
- width: slot.Width(),
1611
- margin: slot.Margin({ format: slot.Margin.Format.ClassName })
1641
+ textStyle: richText.TextStyle(),
1642
+ width: richText.Width(),
1643
+ margin: richText.Margin({ format: richText.Margin.Format.ClassName })
1612
1644
  }
1613
1645
  });
1614
1646
  }
@@ -1620,20 +1652,20 @@ function registerComponent$a(runtime) {
1620
1652
  label: "Carousel",
1621
1653
  icon: "Carousel40",
1622
1654
  props: {
1623
- id: slot.ElementID(),
1624
- images: slot.Images({
1655
+ id: richText.ElementID(),
1656
+ images: richText.Images({
1625
1657
  preset: [
1626
1658
  { key: uuid__default["default"](), props: {} },
1627
1659
  { key: uuid__default["default"](), props: {} },
1628
1660
  { key: uuid__default["default"](), props: {} }
1629
1661
  ]
1630
1662
  }),
1631
- width: slot.Width({
1632
- format: slot.Width.Format.ClassName,
1663
+ width: richText.Width({
1664
+ format: richText.Width.Format.ClassName,
1633
1665
  defaultValue: { value: 400, unit: "px" }
1634
1666
  }),
1635
- margin: slot.Margin({ format: slot.Margin.Format.ClassName }),
1636
- pageSize: slot.ResponsiveNumber((props) => {
1667
+ margin: richText.Margin({ format: richText.Margin.Format.ClassName }),
1668
+ pageSize: richText.ResponsiveNumber((props) => {
1637
1669
  var _a;
1638
1670
  const images = props.images;
1639
1671
  const imagesLength = (_a = images == null ? void 0 : images.length) != null ? _a : 0;
@@ -1645,7 +1677,7 @@ function registerComponent$a(runtime) {
1645
1677
  step: 1
1646
1678
  };
1647
1679
  }),
1648
- step: slot.ResponsiveNumber((props, device) => {
1680
+ step: richText.ResponsiveNumber((props, device) => {
1649
1681
  var _a, _b;
1650
1682
  const pageSize = props.pageSize;
1651
1683
  const pageSizeValue = (_b = (_a = findDeviceOverride(pageSize, device)) == null ? void 0 : _a.value) != null ? _b : 1;
@@ -1657,7 +1689,7 @@ function registerComponent$a(runtime) {
1657
1689
  step: 1
1658
1690
  };
1659
1691
  }),
1660
- slideAlignment: slot.ResponsiveIconRadioGroup({
1692
+ slideAlignment: richText.ResponsiveIconRadioGroup({
1661
1693
  label: "Alignment",
1662
1694
  options: [
1663
1695
  { label: "Top", value: "flex-start", icon: "VerticalAlignStart16" },
@@ -1666,13 +1698,13 @@ function registerComponent$a(runtime) {
1666
1698
  ],
1667
1699
  defaultValue: "center"
1668
1700
  }),
1669
- gap: slot.GapX({
1701
+ gap: richText.GapX({
1670
1702
  label: "Gap",
1671
1703
  step: 5,
1672
1704
  defaultValue: { value: 0, unit: "px" }
1673
1705
  }),
1674
- autoplay: slot.Checkbox({ label: "Autoplay" }),
1675
- delay: slot.Number((props) => ({
1706
+ autoplay: richText.Checkbox({ label: "Autoplay" }),
1707
+ delay: richText.Number((props) => ({
1676
1708
  label: "Delay",
1677
1709
  preset: 5,
1678
1710
  min: 1,
@@ -1680,8 +1712,8 @@ function registerComponent$a(runtime) {
1680
1712
  suffix: "seconds",
1681
1713
  hidden: !props.autoplay
1682
1714
  })),
1683
- showArrows: slot.Checkbox({ preset: true, label: "Show arrows" }),
1684
- arrowPosition: slot.ResponsiveIconRadioGroup((props) => ({
1715
+ showArrows: richText.Checkbox({ preset: true, label: "Show arrows" }),
1716
+ arrowPosition: richText.ResponsiveIconRadioGroup((props) => ({
1685
1717
  label: "Arrow position",
1686
1718
  options: [
1687
1719
  { label: "Inside", value: "inside", icon: "ArrowInside16" },
@@ -1691,24 +1723,24 @@ function registerComponent$a(runtime) {
1691
1723
  defaultValue: "inside",
1692
1724
  hidden: props.showArrows === false
1693
1725
  })),
1694
- arrowColor: slot.ResponsiveColor((props) => ({
1726
+ arrowColor: richText.ResponsiveColor((props) => ({
1695
1727
  label: "Arrow color",
1696
1728
  placeholder: "black",
1697
1729
  hidden: props.showArrows === false
1698
1730
  })),
1699
- arrowBackground: slot.ResponsiveColor((props) => ({
1731
+ arrowBackground: richText.ResponsiveColor((props) => ({
1700
1732
  label: "Arrow background",
1701
1733
  placeholder: "white",
1702
1734
  hidden: props.showArrows === false
1703
1735
  })),
1704
- showDots: slot.Checkbox({ preset: true, label: "Show dots" }),
1705
- dotColor: slot.ResponsiveColor((props) => ({
1736
+ showDots: richText.Checkbox({ preset: true, label: "Show dots" }),
1737
+ dotColor: richText.ResponsiveColor((props) => ({
1706
1738
  label: "Dot color",
1707
1739
  placeholder: "black",
1708
1740
  hidden: props.showDots === false
1709
1741
  })),
1710
- slideBorder: slot.Border({ format: slot.Border.Format.ClassName }),
1711
- slideBorderRadius: slot.BorderRadius({ format: slot.BorderRadius.Format.ClassName })
1742
+ slideBorder: richText.Border({ format: richText.Border.Format.ClassName }),
1743
+ slideBorderRadius: richText.BorderRadius({ format: richText.BorderRadius.Format.ClassName })
1712
1744
  }
1713
1745
  });
1714
1746
  }
@@ -1720,11 +1752,11 @@ function registerComponent$9(runtime) {
1720
1752
  label: "Countdown",
1721
1753
  icon: "Countdown40",
1722
1754
  props: {
1723
- id: slot.ElementID(),
1724
- date: slot.Date(() => ({
1755
+ id: richText.ElementID(),
1756
+ date: richText.Date(() => ({
1725
1757
  preset: new Date(Date.now() + 1e3 * 60 * 60 * 24 * 2).toISOString()
1726
1758
  })),
1727
- variant: slot.ResponsiveIconRadioGroup({
1759
+ variant: richText.ResponsiveIconRadioGroup({
1728
1760
  label: "Style",
1729
1761
  options: [
1730
1762
  { label: "Filled", value: "filled", icon: "CountdownSolid16" },
@@ -1743,7 +1775,7 @@ function registerComponent$9(runtime) {
1743
1775
  ],
1744
1776
  defaultValue: "filled"
1745
1777
  }),
1746
- shape: slot.ResponsiveIconRadioGroup({
1778
+ shape: richText.ResponsiveIconRadioGroup({
1747
1779
  label: "Shape",
1748
1780
  options: [
1749
1781
  { label: "Pill", value: "pill", icon: "ButtonPill16" },
@@ -1752,7 +1784,7 @@ function registerComponent$9(runtime) {
1752
1784
  ],
1753
1785
  defaultValue: "rounded"
1754
1786
  }),
1755
- size: slot.ResponsiveIconRadioGroup({
1787
+ size: richText.ResponsiveIconRadioGroup({
1756
1788
  label: "Size",
1757
1789
  options: [
1758
1790
  { label: "Small", value: "small", icon: "SizeSmall16" },
@@ -1761,7 +1793,7 @@ function registerComponent$9(runtime) {
1761
1793
  ],
1762
1794
  defaultValue: "medium"
1763
1795
  }),
1764
- gap: slot.GapX({
1796
+ gap: richText.GapX({
1765
1797
  preset: [{ deviceId: "desktop", value: { value: 10, unit: "px" } }],
1766
1798
  label: "Gap",
1767
1799
  step: 1,
@@ -1769,32 +1801,32 @@ function registerComponent$9(runtime) {
1769
1801
  max: 100,
1770
1802
  defaultValue: { value: 0, unit: "px" }
1771
1803
  }),
1772
- numberFont: slot.Font({ label: "Number font" }),
1773
- numberColor: slot.ResponsiveColor({
1804
+ numberFont: richText.Font({ label: "Number font" }),
1805
+ numberColor: richText.ResponsiveColor({
1774
1806
  label: "Number color",
1775
1807
  placeholder: "white"
1776
1808
  }),
1777
- blockColor: slot.ResponsiveColor({
1809
+ blockColor: richText.ResponsiveColor({
1778
1810
  label: "Block color",
1779
1811
  placeholder: "black"
1780
1812
  }),
1781
- labelFont: slot.Font({ label: "Label font" }),
1782
- labelColor: slot.ResponsiveColor({
1813
+ labelFont: richText.Font({ label: "Label font" }),
1814
+ labelColor: richText.ResponsiveColor({
1783
1815
  label: "Label color",
1784
1816
  placeholder: "black"
1785
1817
  }),
1786
- width: slot.Width({
1787
- format: slot.Width.Format.ClassName,
1818
+ width: richText.Width({
1819
+ format: richText.Width.Format.ClassName,
1788
1820
  defaultValue: { value: 560, unit: "px" }
1789
1821
  }),
1790
- margin: slot.Margin({ format: slot.Margin.Format.ClassName }),
1791
- daysLabel: slot.TextInput({ label: "Days label", placeholder: "Days" }),
1792
- hoursLabel: slot.TextInput({ label: "Hours label", placeholder: "Hours" }),
1793
- minutesLabel: slot.TextInput({
1822
+ margin: richText.Margin({ format: richText.Margin.Format.ClassName }),
1823
+ daysLabel: richText.TextInput({ label: "Days label", placeholder: "Days" }),
1824
+ hoursLabel: richText.TextInput({ label: "Hours label", placeholder: "Hours" }),
1825
+ minutesLabel: richText.TextInput({
1794
1826
  label: "Minutes label",
1795
1827
  placeholder: "Minutes"
1796
1828
  }),
1797
- secondsLabel: slot.TextInput({
1829
+ secondsLabel: richText.TextInput({
1798
1830
  label: "Seconds label",
1799
1831
  placeholder: "Seconds"
1800
1832
  })
@@ -1809,8 +1841,8 @@ function registerComponent$8(runtime) {
1809
1841
  label: "Divider",
1810
1842
  icon: "Divider40",
1811
1843
  props: {
1812
- id: slot.ElementID(),
1813
- variant: slot.ResponsiveSelect({
1844
+ id: richText.ElementID(),
1845
+ variant: richText.ResponsiveSelect({
1814
1846
  label: "Style",
1815
1847
  labelOrientation: "horizontal",
1816
1848
  options: [
@@ -1821,17 +1853,17 @@ function registerComponent$8(runtime) {
1821
1853
  ],
1822
1854
  defaultValue: "solid"
1823
1855
  }),
1824
- thickness: slot.ResponsiveLength({
1856
+ thickness: richText.ResponsiveLength({
1825
1857
  label: "Height",
1826
1858
  defaultValue: { value: 1, unit: "px" },
1827
1859
  options: [{ value: "px", label: "Pixels", icon: "Px16" }]
1828
1860
  }),
1829
- color: slot.ResponsiveColor({ placeholder: "black" }),
1830
- width: slot.Width({
1831
- format: slot.Width.Format.ClassName,
1861
+ color: richText.ResponsiveColor({ placeholder: "black" }),
1862
+ width: richText.Width({
1863
+ format: richText.Width.Format.ClassName,
1832
1864
  defaultValue: { value: 100, unit: "%" }
1833
1865
  }),
1834
- margin: slot.Margin({ format: slot.Margin.Format.ClassName })
1866
+ margin: richText.Margin({ format: richText.Margin.Format.ClassName })
1835
1867
  }
1836
1868
  });
1837
1869
  }
@@ -1843,10 +1875,10 @@ function registerComponent$7(runtime) {
1843
1875
  label: "Embed",
1844
1876
  icon: "Code40",
1845
1877
  props: {
1846
- id: slot.ElementID(),
1847
- html: slot.TextArea({ label: "Code", rows: 20 }),
1848
- width: slot.Width({ format: slot.Width.Format.ClassName }),
1849
- margin: slot.Margin({ format: slot.Margin.Format.ClassName })
1878
+ id: richText.ElementID(),
1879
+ html: richText.TextArea({ label: "Code", rows: 20 }),
1880
+ width: richText.Width({ format: richText.Width.Format.ClassName }),
1881
+ margin: richText.Margin({ format: richText.Margin.Format.ClassName })
1850
1882
  }
1851
1883
  });
1852
1884
  }
@@ -1882,10 +1914,10 @@ function registerComponent$6(runtime) {
1882
1914
  label: "Form",
1883
1915
  icon: "Form40",
1884
1916
  props: {
1885
- id: slot.ElementID(),
1886
- tableId: slot.Table(),
1887
- fields: slot.TableFormFields(),
1888
- submitLink: slot.Link((props) => ({
1917
+ id: richText.ElementID(),
1918
+ tableId: richText.Table(),
1919
+ fields: richText.TableFormFields(),
1920
+ submitLink: richText.Link((props) => ({
1889
1921
  label: "Redirect to",
1890
1922
  options: [
1891
1923
  { value: "OPEN_PAGE", label: "Open page" },
@@ -1893,13 +1925,13 @@ function registerComponent$6(runtime) {
1893
1925
  ],
1894
1926
  hidden: props.tableId == null
1895
1927
  })),
1896
- gap: slot.GapY((props) => ({
1928
+ gap: richText.GapY((props) => ({
1897
1929
  preset: [{ deviceId: "desktop", value: { value: 10, unit: "px" } }],
1898
1930
  label: "Gap",
1899
1931
  defaultValue: { value: 0, unit: "px" },
1900
1932
  hidden: props.tableId == null
1901
1933
  })),
1902
- shape: slot.ResponsiveIconRadioGroup((props) => ({
1934
+ shape: richText.ResponsiveIconRadioGroup((props) => ({
1903
1935
  label: "Shape",
1904
1936
  options: [
1905
1937
  { label: "Pill", value: Shapes.PILL, icon: "ButtonPill16" },
@@ -1909,7 +1941,7 @@ function registerComponent$6(runtime) {
1909
1941
  defaultValue: Shapes.ROUNDED,
1910
1942
  hidden: props.tableId == null
1911
1943
  })),
1912
- size: slot.ResponsiveIconRadioGroup((props) => ({
1944
+ size: richText.ResponsiveIconRadioGroup((props) => ({
1913
1945
  label: "Size",
1914
1946
  options: [
1915
1947
  { label: "Small", value: Sizes.SMALL, icon: "SizeSmall16" },
@@ -1919,7 +1951,7 @@ function registerComponent$6(runtime) {
1919
1951
  defaultValue: Sizes.MEDIUM,
1920
1952
  hidden: (props == null ? void 0 : props.tableId) == null
1921
1953
  })),
1922
- contrast: slot.ResponsiveIconRadioGroup((props) => ({
1954
+ contrast: richText.ResponsiveIconRadioGroup((props) => ({
1923
1955
  label: "Color",
1924
1956
  options: [
1925
1957
  { label: "Light mode", value: Contrasts.LIGHT, icon: "Sun16" },
@@ -1928,8 +1960,8 @@ function registerComponent$6(runtime) {
1928
1960
  defaultValue: Contrasts.LIGHT,
1929
1961
  hidden: props.tableId == null
1930
1962
  })),
1931
- labelTextStyle: slot.TextStyle({ label: "Label text style" }),
1932
- labelTextColor: slot.ResponsiveColor((props, device) => {
1963
+ labelTextStyle: richText.TextStyle({ label: "Label text style" }),
1964
+ labelTextColor: richText.ResponsiveColor((props, device) => {
1933
1965
  const hidden = props.tableId == null;
1934
1966
  const responsiveContrast = props.contrast;
1935
1967
  const contrast = findDeviceOverride(responsiveContrast, device);
@@ -1939,23 +1971,23 @@ function registerComponent$6(runtime) {
1939
1971
  placeholder: (contrast == null ? void 0 : contrast.value) === Contrasts.DARK ? "rgba(255,255,255,0.95)" : "rgba(0,0,0,0.8)"
1940
1972
  };
1941
1973
  }),
1942
- submitTextStyle: slot.TextStyle({ label: "Button text style" }),
1943
- brandColor: slot.ResponsiveColor((props) => ({
1974
+ submitTextStyle: richText.TextStyle({ label: "Button text style" }),
1975
+ brandColor: richText.ResponsiveColor((props) => ({
1944
1976
  label: "Button color",
1945
1977
  placeholder: "black",
1946
1978
  hidden: props.tableId == null
1947
1979
  })),
1948
- submitTextColor: slot.ResponsiveColor((props) => ({
1980
+ submitTextColor: richText.ResponsiveColor((props) => ({
1949
1981
  label: "Button text color",
1950
1982
  placeholder: "white",
1951
1983
  hidden: props.tableId == null
1952
1984
  })),
1953
- submitLabel: slot.TextInput((props) => ({
1985
+ submitLabel: richText.TextInput((props) => ({
1954
1986
  label: "Button label",
1955
1987
  placeholder: "Submit",
1956
1988
  hidden: props.tableId == null
1957
1989
  })),
1958
- submitVariant: slot.ResponsiveSelect((props) => ({
1990
+ submitVariant: richText.ResponsiveSelect((props) => ({
1959
1991
  label: "Button style",
1960
1992
  options: [
1961
1993
  { value: "flat", label: "Flat" },
@@ -1969,11 +2001,11 @@ function registerComponent$6(runtime) {
1969
2001
  defaultValue: "flat",
1970
2002
  hidden: props.tableId == null
1971
2003
  })),
1972
- submitWidth: slot.ResponsiveLength((props) => ({
2004
+ submitWidth: richText.ResponsiveLength((props) => ({
1973
2005
  label: "Button width",
1974
2006
  hidden: props.tableId == null
1975
2007
  })),
1976
- submitAlignment: slot.ResponsiveIconRadioGroup((props) => ({
2008
+ submitAlignment: richText.ResponsiveIconRadioGroup((props) => ({
1977
2009
  label: "Button alignment",
1978
2010
  options: [
1979
2011
  { label: "Left", value: Alignments.LEFT, icon: "AlignLeft16" },
@@ -1983,12 +2015,12 @@ function registerComponent$6(runtime) {
1983
2015
  defaultValue: Alignments.CENTER,
1984
2016
  hidden: props.tableId == null
1985
2017
  })),
1986
- width: slot.Width({
2018
+ width: richText.Width({
1987
2019
  preset: [{ deviceId: "desktop", value: { value: 550, unit: "px" } }],
1988
2020
  defaultValue: { value: 100, unit: "%" },
1989
- format: slot.Width.Format.ClassName
2021
+ format: richText.Width.Format.ClassName
1990
2022
  }),
1991
- margin: slot.Margin({ format: slot.Margin.Format.ClassName })
2023
+ margin: richText.Margin({ format: richText.Margin.Format.ClassName })
1992
2024
  }
1993
2025
  });
1994
2026
  }
@@ -1999,17 +2031,17 @@ function registerComponent$5(runtime) {
1999
2031
  type: constants.MakeswiftComponentType.Image,
2000
2032
  label: "Image",
2001
2033
  props: {
2002
- id: slot.ElementID(),
2003
- file: slot.Image(),
2004
- altText: slot.TextInput({ label: "Alt text" }),
2005
- link: slot.Link({ label: "On click" }),
2006
- width: slot.Width(),
2007
- margin: slot.Margin({ format: slot.Margin.Format.ClassName }),
2008
- padding: slot.Padding({ format: slot.Padding.Format.ClassName }),
2009
- border: slot.Border({ format: slot.Border.Format.ClassName }),
2010
- borderRadius: slot.BorderRadius({ format: slot.BorderRadius.Format.ClassName }),
2011
- boxShadow: slot.Shadows({ format: slot.Shadows.Format.ClassName }),
2012
- opacity: slot.ResponsiveOpacity()
2034
+ id: richText.ElementID(),
2035
+ file: richText.Image(),
2036
+ altText: richText.TextInput({ label: "Alt text" }),
2037
+ link: richText.Link({ label: "On click" }),
2038
+ width: richText.Width(),
2039
+ margin: richText.Margin({ format: richText.Margin.Format.ClassName }),
2040
+ padding: richText.Padding({ format: richText.Padding.Format.ClassName }),
2041
+ border: richText.Border({ format: richText.Border.Format.ClassName }),
2042
+ borderRadius: richText.BorderRadius({ format: richText.BorderRadius.Format.ClassName }),
2043
+ boxShadow: richText.Shadows({ format: richText.Shadows.Format.ClassName }),
2044
+ opacity: richText.ResponsiveOpacity()
2013
2045
  }
2014
2046
  });
2015
2047
  }
@@ -2021,21 +2053,21 @@ function registerComponent$4(runtime) {
2021
2053
  label: "Navigation",
2022
2054
  icon: "Navigation40",
2023
2055
  props: {
2024
- id: slot.ElementID(),
2025
- links: slot.NavigationLinks(),
2026
- linkTextStyle: slot.TextStyle((props) => {
2056
+ id: richText.ElementID(),
2057
+ links: richText.NavigationLinks(),
2058
+ linkTextStyle: richText.TextStyle((props) => {
2027
2059
  const links = props.links;
2028
2060
  return {
2029
2061
  label: "Link text style",
2030
2062
  hidden: links == null || links.length === 0
2031
2063
  };
2032
2064
  }),
2033
- showLogo: slot.Checkbox({ preset: true, label: "Show logo" }),
2034
- logoFile: slot.Image((props) => ({
2065
+ showLogo: richText.Checkbox({ preset: true, label: "Show logo" }),
2066
+ logoFile: richText.Image((props) => ({
2035
2067
  label: "Logo",
2036
2068
  hidden: props.showLogo === false
2037
2069
  })),
2038
- logoWidth: slot.ResponsiveLength((props) => ({
2070
+ logoWidth: richText.ResponsiveLength((props) => ({
2039
2071
  preset: [{ deviceId: "desktop", value: { value: 100, unit: "px" } }],
2040
2072
  label: "Logo width",
2041
2073
  min: 0,
@@ -2043,15 +2075,15 @@ function registerComponent$4(runtime) {
2043
2075
  options: [{ value: "px", label: "Pixels", icon: "Px16" }],
2044
2076
  hidden: props.showLogo === false
2045
2077
  })),
2046
- logoAltText: slot.TextInput((props) => ({
2078
+ logoAltText: richText.TextInput((props) => ({
2047
2079
  label: "Logo alt text",
2048
2080
  hidden: props.showLogo === false
2049
2081
  })),
2050
- logoLink: slot.Link((props) => ({
2082
+ logoLink: richText.Link((props) => ({
2051
2083
  label: "Logo on click",
2052
2084
  hidden: props.showLogo === false
2053
2085
  })),
2054
- alignment: slot.ResponsiveIconRadioGroup({
2086
+ alignment: richText.ResponsiveIconRadioGroup({
2055
2087
  label: "Alignment",
2056
2088
  options: [
2057
2089
  { label: "Left", value: "flex-start", icon: "AlignLeft16" },
@@ -2060,7 +2092,7 @@ function registerComponent$4(runtime) {
2060
2092
  ],
2061
2093
  defaultValue: "flex-end"
2062
2094
  }),
2063
- gutter: slot.GapX({
2095
+ gutter: richText.GapX({
2064
2096
  preset: [{ deviceId: "desktop", value: { value: 10, unit: "px" } }],
2065
2097
  label: "Link gap",
2066
2098
  min: 0,
@@ -2068,14 +2100,14 @@ function registerComponent$4(runtime) {
2068
2100
  step: 1,
2069
2101
  defaultValue: { value: 0, unit: "px" }
2070
2102
  }),
2071
- mobileMenuAnimation: slot.ResponsiveSelect({
2103
+ mobileMenuAnimation: richText.ResponsiveSelect({
2072
2104
  label: "Mobile menu",
2073
2105
  options: [
2074
2106
  { value: "coverRight", label: "Cover from right" },
2075
2107
  { value: "coverLeft", label: "Cover from left" }
2076
2108
  ]
2077
2109
  }),
2078
- mobileMenuOpenIconColor: slot.ResponsiveColor((props, device) => {
2110
+ mobileMenuOpenIconColor: richText.ResponsiveColor((props, device) => {
2079
2111
  const mobileMenuAnimation = props.mobileMenuAnimation;
2080
2112
  const hidden = !findDeviceOverride(mobileMenuAnimation, device);
2081
2113
  return {
@@ -2084,7 +2116,7 @@ function registerComponent$4(runtime) {
2084
2116
  hidden
2085
2117
  };
2086
2118
  }),
2087
- mobileMenuCloseIconColor: slot.ResponsiveColor((props, device) => {
2119
+ mobileMenuCloseIconColor: richText.ResponsiveColor((props, device) => {
2088
2120
  const mobileMenuAnimation = props.mobileMenuAnimation;
2089
2121
  const hidden = !findDeviceOverride(mobileMenuAnimation, device);
2090
2122
  return {
@@ -2093,7 +2125,7 @@ function registerComponent$4(runtime) {
2093
2125
  hidden
2094
2126
  };
2095
2127
  }),
2096
- mobileMenuBackgroundColor: slot.ResponsiveColor((props, device) => {
2128
+ mobileMenuBackgroundColor: richText.ResponsiveColor((props, device) => {
2097
2129
  const mobileMenuAnimation = props.mobileMenuAnimation;
2098
2130
  const hidden = !findDeviceOverride(mobileMenuAnimation, device);
2099
2131
  return {
@@ -2102,11 +2134,11 @@ function registerComponent$4(runtime) {
2102
2134
  hidden
2103
2135
  };
2104
2136
  }),
2105
- width: slot.Width({
2106
- format: slot.Width.Format.ClassName,
2137
+ width: richText.Width({
2138
+ format: richText.Width.Format.ClassName,
2107
2139
  defaultValue: { value: 100, unit: "%" }
2108
2140
  }),
2109
- margin: slot.Margin({ format: slot.Margin.Format.ClassName })
2141
+ margin: richText.Margin({ format: richText.Margin.Format.ClassName })
2110
2142
  }
2111
2143
  });
2112
2144
  }
@@ -2118,10 +2150,10 @@ function registerComponent$3(runtime) {
2118
2150
  label: "Page",
2119
2151
  hidden: true,
2120
2152
  props: {
2121
- children: slot.Grid(),
2122
- backgrounds: slot.Backgrounds(),
2123
- rowGap: slot.GapY(),
2124
- columnGap: slot.GapX()
2153
+ children: richText.Grid(),
2154
+ backgrounds: richText.Backgrounds(),
2155
+ rowGap: richText.GapY(),
2156
+ columnGap: richText.GapX()
2125
2157
  }
2126
2158
  });
2127
2159
  }
@@ -2133,8 +2165,8 @@ function registerComponent$2(runtime) {
2133
2165
  label: "Social Links",
2134
2166
  icon: "SocialLinks40",
2135
2167
  props: {
2136
- id: slot.ElementID(),
2137
- links: slot.SocialLinks({
2168
+ id: richText.ElementID(),
2169
+ links: richText.SocialLinks({
2138
2170
  preset: {
2139
2171
  links: [
2140
2172
  {
@@ -2153,7 +2185,7 @@ function registerComponent$2(runtime) {
2153
2185
  openInNewTab: false
2154
2186
  }
2155
2187
  }),
2156
- shape: slot.ResponsiveIconRadioGroup((props) => {
2188
+ shape: richText.ResponsiveIconRadioGroup((props) => {
2157
2189
  const links = props.links;
2158
2190
  return {
2159
2191
  label: "Shape",
@@ -2167,7 +2199,7 @@ function registerComponent$2(runtime) {
2167
2199
  hidden: links == null || links.links.length === 0
2168
2200
  };
2169
2201
  }),
2170
- size: slot.ResponsiveIconRadioGroup((props) => {
2202
+ size: richText.ResponsiveIconRadioGroup((props) => {
2171
2203
  const links = props.links;
2172
2204
  return {
2173
2205
  label: "Size",
@@ -2180,7 +2212,7 @@ function registerComponent$2(runtime) {
2180
2212
  hidden: links == null || links.links.length === 0
2181
2213
  };
2182
2214
  }),
2183
- hoverStyle: slot.ResponsiveSelect((props) => {
2215
+ hoverStyle: richText.ResponsiveSelect((props) => {
2184
2216
  const links = props.links;
2185
2217
  const hidden = links == null || links.links.length === 0;
2186
2218
  return {
@@ -2196,7 +2228,7 @@ function registerComponent$2(runtime) {
2196
2228
  hidden
2197
2229
  };
2198
2230
  }),
2199
- fill: slot.ResponsiveColor((props) => {
2231
+ fill: richText.ResponsiveColor((props) => {
2200
2232
  const links = props.links;
2201
2233
  const hidden = links == null || links.links.length === 0;
2202
2234
  return {
@@ -2204,7 +2236,7 @@ function registerComponent$2(runtime) {
2204
2236
  hidden
2205
2237
  };
2206
2238
  }),
2207
- backgroundColor: slot.ResponsiveColor((props) => {
2239
+ backgroundColor: richText.ResponsiveColor((props) => {
2208
2240
  const links = props.links;
2209
2241
  const hidden = links == null || links.links.length === 0;
2210
2242
  return {
@@ -2212,7 +2244,7 @@ function registerComponent$2(runtime) {
2212
2244
  hidden
2213
2245
  };
2214
2246
  }),
2215
- alignment: slot.ResponsiveIconRadioGroup({
2247
+ alignment: richText.ResponsiveIconRadioGroup({
2216
2248
  label: "Alignment",
2217
2249
  options: [
2218
2250
  { label: "flex-start", value: "flex-start", icon: "AlignLeft16" },
@@ -2221,7 +2253,7 @@ function registerComponent$2(runtime) {
2221
2253
  ],
2222
2254
  defaultValue: "center"
2223
2255
  }),
2224
- gutter: slot.GapX({
2256
+ gutter: richText.GapX({
2225
2257
  preset: [{ deviceId: "desktop", value: { value: 10, unit: "px" } }],
2226
2258
  label: "Link gap",
2227
2259
  min: 0,
@@ -2229,12 +2261,12 @@ function registerComponent$2(runtime) {
2229
2261
  step: 1,
2230
2262
  defaultValue: { value: 0, unit: "px" }
2231
2263
  }),
2232
- width: slot.Width({
2233
- format: slot.Width.Format.ClassName,
2264
+ width: richText.Width({
2265
+ format: richText.Width.Format.ClassName,
2234
2266
  defaultValue: { value: 100, unit: "%" }
2235
2267
  }),
2236
- margin: slot.Margin({
2237
- format: slot.Margin.Format.ClassName,
2268
+ margin: richText.Margin({
2269
+ format: richText.Margin.Format.ClassName,
2238
2270
  preset: [
2239
2271
  {
2240
2272
  deviceId: "desktop",
@@ -2257,10 +2289,11 @@ function registerComponent$1(runtime) {
2257
2289
  type: constants.MakeswiftComponentType.Text,
2258
2290
  label: "Text",
2259
2291
  props: {
2260
- id: slot.ElementID(),
2261
- text: slot.RichText(() => ({
2292
+ id: richText.ElementID(),
2293
+ text: richText.RichText(() => ({
2262
2294
  preset: {
2263
2295
  document: {
2296
+ object: "document",
2264
2297
  nodes: [
2265
2298
  {
2266
2299
  object: "block",
@@ -2301,13 +2334,13 @@ function registerComponent$1(runtime) {
2301
2334
  }
2302
2335
  }
2303
2336
  })),
2304
- width: slot.Width({
2305
- format: slot.Width.Format.ClassName,
2337
+ width: richText.Width({
2338
+ format: richText.Width.Format.ClassName,
2306
2339
  preset: [{ deviceId: "desktop", value: { value: 700, unit: "px" } }],
2307
2340
  defaultValue: { value: 100, unit: "%" }
2308
2341
  }),
2309
- margin: slot.Margin({
2310
- format: slot.Margin.Format.ClassName,
2342
+ margin: richText.Margin({
2343
+ format: richText.Margin.Format.ClassName,
2311
2344
  preset: [
2312
2345
  {
2313
2346
  deviceId: "desktop",
@@ -2331,14 +2364,14 @@ function registerComponent(runtime) {
2331
2364
  label: "Video",
2332
2365
  icon: "Video40",
2333
2366
  props: {
2334
- id: slot.ElementID(),
2335
- video: slot.Video({ preset: { controls: true } }),
2336
- width: slot.Width({
2337
- format: slot.Width.Format.ClassName,
2367
+ id: richText.ElementID(),
2368
+ video: richText.Video({ preset: { controls: true } }),
2369
+ width: richText.Width({
2370
+ format: richText.Width.Format.ClassName,
2338
2371
  defaultValue: { value: 560, unit: "px" }
2339
2372
  }),
2340
- margin: slot.Margin({ format: slot.Margin.Format.ClassName }),
2341
- borderRadius: slot.BorderRadius({ format: slot.BorderRadius.Format.ClassName })
2373
+ margin: richText.Margin({ format: richText.Margin.Format.ClassName }),
2374
+ borderRadius: richText.BorderRadius({ format: richText.BorderRadius.Format.ClassName })
2342
2375
  }
2343
2376
  });
2344
2377
  }
@@ -2854,7 +2887,7 @@ const defaultPadding = {
2854
2887
  };
2855
2888
  function useStyleControlCssObject(style, controlDefinition) {
2856
2889
  const { properties } = controlDefinition.config;
2857
- return __spreadValues(__spreadValues({}, properties.includes(slot.StyleControlProperty.Width) && {
2890
+ return __spreadValues(__spreadValues({}, properties.includes(richText.StyleControlProperty.Width) && {
2858
2891
  maxWidth: "100%"
2859
2892
  }), responsiveStyle([
2860
2893
  style == null ? void 0 : style.width,
@@ -2865,19 +2898,19 @@ function useStyleControlCssObject(style, controlDefinition) {
2865
2898
  style == null ? void 0 : style.textStyle
2866
2899
  ], ([width, margin, padding, border, borderRadius, textStyle]) => {
2867
2900
  var _a, _b, _c2, _d, _e, _f, _g, _h, _i, _j, _k;
2868
- return __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, properties.includes(slot.StyleControlProperty.Width) && {
2901
+ return __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, properties.includes(richText.StyleControlProperty.Width) && {
2869
2902
  width: (_a = widthToString(width)) != null ? _a : "100%"
2870
- }), properties.includes(slot.StyleControlProperty.Margin) && marginPropertyDataToStyle(margin != null ? margin : defaultMargin, defaultMargin)), properties.includes(slot.StyleControlProperty.Padding) && paddingPropertyDataToStyle(padding != null ? padding : defaultPadding, defaultPadding)), properties.includes(slot.StyleControlProperty.Border) && {
2903
+ }), properties.includes(richText.StyleControlProperty.Margin) && marginPropertyDataToStyle(margin != null ? margin : defaultMargin, defaultMargin)), properties.includes(richText.StyleControlProperty.Padding) && paddingPropertyDataToStyle(padding != null ? padding : defaultPadding, defaultPadding)), properties.includes(richText.StyleControlProperty.Border) && {
2871
2904
  borderTop: (_b = borderSideToString2(border == null ? void 0 : border.borderTop)) != null ? _b : "0 solid black",
2872
2905
  borderRight: (_c2 = borderSideToString2(border == null ? void 0 : border.borderRight)) != null ? _c2 : "0 solid black",
2873
2906
  borderBottom: (_d = borderSideToString2(border == null ? void 0 : border.borderBottom)) != null ? _d : "0 solid black",
2874
2907
  borderLeft: (_e = borderSideToString2(border == null ? void 0 : border.borderLeft)) != null ? _e : "0 solid black"
2875
- }), properties.includes(slot.StyleControlProperty.BorderRadius) && {
2908
+ }), properties.includes(richText.StyleControlProperty.BorderRadius) && {
2876
2909
  borderTopLeftRadius: (_f = borderRadiusToString(borderRadius == null ? void 0 : borderRadius.borderTopLeftRadius)) != null ? _f : 0,
2877
2910
  borderTopRightRadius: (_g = borderRadiusToString(borderRadius == null ? void 0 : borderRadius.borderTopRightRadius)) != null ? _g : 0,
2878
2911
  borderBottomRightRadius: (_h = borderRadiusToString(borderRadius == null ? void 0 : borderRadius.borderBottomRightRadius)) != null ? _h : 0,
2879
2912
  borderBottomLeftRadius: (_i = borderRadiusToString(borderRadius == null ? void 0 : borderRadius.borderBottomLeftRadius)) != null ? _i : 0
2880
- }), properties.includes(slot.StyleControlProperty.TextStyle) && __spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, (textStyle == null ? void 0 : textStyle.fontFamily) && { fontFamily: textStyle.fontFamily }), (textStyle == null ? void 0 : textStyle.letterSpacing) && { letterSpacing: textStyle.letterSpacing }), (textStyle == null ? void 0 : textStyle.fontSize) && { fontSize: fontSizeToString(textStyle.fontSize) }), (textStyle == null ? void 0 : textStyle.fontWeight) && { fontWeight: textStyle.fontWeight }), {
2913
+ }), properties.includes(richText.StyleControlProperty.TextStyle) && __spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, (textStyle == null ? void 0 : textStyle.fontFamily) && { fontFamily: textStyle.fontFamily }), (textStyle == null ? void 0 : textStyle.letterSpacing) && { letterSpacing: textStyle.letterSpacing }), (textStyle == null ? void 0 : textStyle.fontSize) && { fontSize: fontSizeToString(textStyle.fontSize) }), (textStyle == null ? void 0 : textStyle.fontWeight) && { fontWeight: textStyle.fontWeight }), {
2881
2914
  textTransform: (_j = textStyle == null ? void 0 : textStyle.textTransform) != null ? _j : [],
2882
2915
  fontStyle: (_k = textStyle == null ? void 0 : textStyle.fontStyle) != null ? _k : []
2883
2916
  }));
@@ -2940,10 +2973,10 @@ function useComboboxControlValue(data) {
2940
2973
  }
2941
2974
  function useImageControlValue(data, definition) {
2942
2975
  var _a;
2943
- const format = (_a = definition.config.format) != null ? _a : slot.ImageControlValueFormat.URL;
2976
+ const format = (_a = definition.config.format) != null ? _a : richText.ImageControlValueFormat.URL;
2944
2977
  const fileId = data != null ? data : null;
2945
2978
  const file = useFile(fileId);
2946
- if (format === slot.ImageControlValueFormat.URL) {
2979
+ if (format === richText.ImageControlValueFormat.URL) {
2947
2980
  return file == null ? void 0 : file.publicUrl;
2948
2981
  }
2949
2982
  if (file == null || file.dimensions == null)
@@ -3091,13 +3124,13 @@ function ControlValue({
3091
3124
  parameters: [data, definition],
3092
3125
  children: (value) => children(value)
3093
3126
  }, definition.type);
3094
- case slot.ColorControlType:
3127
+ case richText.ColorControlType:
3095
3128
  return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
3096
3129
  hook: useColorValue,
3097
3130
  parameters: [data, definition],
3098
3131
  children: (value) => children(value)
3099
3132
  }, definition.type);
3100
- case slot.ImageControlType:
3133
+ case richText.ImageControlType:
3101
3134
  return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
3102
3135
  hook: useImageControlValue,
3103
3136
  parameters: [data, definition],
@@ -3131,6 +3164,25 @@ function ControlValue({
3131
3164
  return children(data);
3132
3165
  }
3133
3166
  }
3167
+ function pollBoxModel({
3168
+ element,
3169
+ onBoxModelChange
3170
+ }) {
3171
+ let currentBoxModel = null;
3172
+ const handleAnimationFrameRequest = () => {
3173
+ const measuredBoxModel = boxModels.getBox(element);
3174
+ if (!deepEqual(currentBoxModel, measuredBoxModel)) {
3175
+ currentBoxModel = measuredBoxModel;
3176
+ onBoxModelChange(currentBoxModel);
3177
+ }
3178
+ animationFrameHandle = requestAnimationFrame(handleAnimationFrameRequest);
3179
+ };
3180
+ let animationFrameHandle = requestAnimationFrame(handleAnimationFrameRequest);
3181
+ return () => {
3182
+ cancelAnimationFrame(animationFrameHandle);
3183
+ onBoxModelChange(null);
3184
+ };
3185
+ }
3134
3186
  function useSlot(data, control2) {
3135
3187
  if (data == null || data.elements.length === 0) {
3136
3188
  return /* @__PURE__ */ jsxRuntime.jsx(Slot.Placeholder, {
@@ -3274,24 +3326,21 @@ function SlotPlaceholder({
3274
3326
  })
3275
3327
  });
3276
3328
  }
3277
- function pollBoxModel({
3278
- element,
3279
- onBoxModelChange
3280
- }) {
3281
- let currentBoxModel = null;
3282
- const handleAnimationFrameRequest = () => {
3283
- const measuredBoxModel = boxModels.getBox(element);
3284
- if (!deepEqual(currentBoxModel, measuredBoxModel)) {
3285
- currentBoxModel = measuredBoxModel;
3286
- onBoxModelChange(currentBoxModel);
3287
- }
3288
- animationFrameHandle = requestAnimationFrame(handleAnimationFrameRequest);
3289
- };
3290
- let animationFrameHandle = requestAnimationFrame(handleAnimationFrameRequest);
3291
- return () => {
3292
- cancelAnimationFrame(animationFrameHandle);
3293
- onBoxModelChange(null);
3294
- };
3329
+ const Text = forwardNextDynamicRef((patch) => dynamic__default["default"](() => patch(Promise.resolve().then(function() {
3330
+ return require("./index.cjs5.js");
3331
+ }))));
3332
+ function useRichText(data, control2) {
3333
+ const textCallbackRef = React.useCallback((handle) => {
3334
+ var _a;
3335
+ if (constants.isPropControllersHandle(handle))
3336
+ (_a = handle == null ? void 0 : handle.setPropControllers) == null ? void 0 : _a.call(handle, control2 == null ? null : {
3337
+ text: control2
3338
+ });
3339
+ }, [control2]);
3340
+ return /* @__PURE__ */ jsxRuntime.jsx(Text, {
3341
+ text: data,
3342
+ ref: textCallbackRef
3343
+ });
3295
3344
  }
3296
3345
  function useWidthStyle(value, descriptor) {
3297
3346
  return useStyle(responsiveWidth(value, descriptor.options.defaultValue));
@@ -3328,15 +3377,15 @@ function PropsValue({
3328
3377
  return constants.getPropControllers(state, documentKey, element.key);
3329
3378
  });
3330
3379
  return Object.entries(propControllerDescriptorsRef.current).reduceRight((renderFn, [propName, descriptor]) => (propsValue) => {
3331
- var _a2;
3380
+ var _a2, _b;
3332
3381
  switch (descriptor.type) {
3333
3382
  case textInput.CheckboxControlType:
3334
3383
  case textInput.NumberControlType:
3335
3384
  case textInput.TextInputControlType:
3336
3385
  case textInput.TextAreaControlType:
3337
3386
  case textInput.SelectControlType:
3338
- case slot.ColorControlType:
3339
- case slot.ImageControlType:
3387
+ case richText.ColorControlType:
3388
+ case richText.ImageControlType:
3340
3389
  case combobox.ComboboxControlType:
3341
3390
  case control.ShapeControlType:
3342
3391
  case control.ListControlType:
@@ -3348,7 +3397,7 @@ function PropsValue({
3348
3397
  [propName]: value
3349
3398
  }))
3350
3399
  });
3351
- case slot.StyleControlType:
3400
+ case richText.StyleControlType:
3352
3401
  return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
3353
3402
  hook: useFormattedStyle,
3354
3403
  parameters: [props[propName], descriptor],
@@ -3356,8 +3405,17 @@ function PropsValue({
3356
3405
  [propName]: value
3357
3406
  }))
3358
3407
  }, descriptor.type);
3359
- case slot.SlotControlType: {
3360
- const control2 = (_a2 = propControllers == null ? void 0 : propControllers[propName]) != null ? _a2 : null;
3408
+ case richText.RichTextControlType:
3409
+ const control$1 = (_a2 = propControllers == null ? void 0 : propControllers[propName]) != null ? _a2 : null;
3410
+ return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
3411
+ hook: useRichText,
3412
+ parameters: [props[propName], control$1],
3413
+ children: (value) => renderFn(__spreadProps(__spreadValues({}, propsValue), {
3414
+ [propName]: value
3415
+ }))
3416
+ }, descriptor.type);
3417
+ case richText.SlotControlType: {
3418
+ const control2 = (_b = propControllers == null ? void 0 : propControllers[propName]) != null ? _b : null;
3361
3419
  return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
3362
3420
  hook: useSlot,
3363
3421
  parameters: [props[propName], control2],
@@ -3366,9 +3424,9 @@ function PropsValue({
3366
3424
  }))
3367
3425
  }, descriptor.type);
3368
3426
  }
3369
- case slot.Types.Width:
3427
+ case richText.Types.Width:
3370
3428
  switch (descriptor.options.format) {
3371
- case slot.WidthPropControllerFormat.ClassName:
3429
+ case richText.WidthPropControllerFormat.ClassName:
3372
3430
  return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
3373
3431
  hook: useWidthStyle,
3374
3432
  parameters: [props[propName], descriptor],
@@ -3381,9 +3439,9 @@ function PropsValue({
3381
3439
  [propName]: props[propName]
3382
3440
  }));
3383
3441
  }
3384
- case slot.Types.Padding:
3442
+ case richText.Types.Padding:
3385
3443
  switch (descriptor.options.format) {
3386
- case slot.PaddingPropControllerFormat.ClassName:
3444
+ case richText.PaddingPropControllerFormat.ClassName:
3387
3445
  return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
3388
3446
  hook: usePaddingStyle,
3389
3447
  parameters: [props[propName]],
@@ -3396,9 +3454,9 @@ function PropsValue({
3396
3454
  [propName]: props[propName]
3397
3455
  }));
3398
3456
  }
3399
- case slot.Types.Margin:
3457
+ case richText.Types.Margin:
3400
3458
  switch (descriptor.options.format) {
3401
- case slot.MarginPropControllerFormat.ClassName:
3459
+ case richText.MarginPropControllerFormat.ClassName:
3402
3460
  return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
3403
3461
  hook: useMarginStyle,
3404
3462
  parameters: [props[propName]],
@@ -3411,9 +3469,9 @@ function PropsValue({
3411
3469
  [propName]: props[propName]
3412
3470
  }));
3413
3471
  }
3414
- case slot.Types.BorderRadius:
3472
+ case richText.Types.BorderRadius:
3415
3473
  switch (descriptor.options.format) {
3416
- case slot.BorderRadiusPropControllerFormat.ClassName:
3474
+ case richText.BorderRadiusPropControllerFormat.ClassName:
3417
3475
  return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
3418
3476
  hook: useBorderRadiusStyle,
3419
3477
  parameters: [props[propName]],
@@ -3426,9 +3484,9 @@ function PropsValue({
3426
3484
  [propName]: props[propName]
3427
3485
  }));
3428
3486
  }
3429
- case slot.Types.Shadows:
3487
+ case richText.Types.Shadows:
3430
3488
  switch (descriptor.options.format) {
3431
- case slot.ShadowsPropControllerFormat.ClassName:
3489
+ case richText.ShadowsPropControllerFormat.ClassName:
3432
3490
  return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
3433
3491
  hook: useShadowsStyle,
3434
3492
  parameters: [props[propName]],
@@ -3441,9 +3499,9 @@ function PropsValue({
3441
3499
  [propName]: props[propName]
3442
3500
  }));
3443
3501
  }
3444
- case slot.Types.Border:
3502
+ case richText.Types.Border:
3445
3503
  switch (descriptor.options.format) {
3446
- case slot.BorderPropControllerFormat.ClassName:
3504
+ case richText.BorderPropControllerFormat.ClassName:
3447
3505
  return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
3448
3506
  hook: useBorderStyle,
3449
3507
  parameters: [props[propName]],
@@ -3456,7 +3514,7 @@ function PropsValue({
3456
3514
  [propName]: props[propName]
3457
3515
  }));
3458
3516
  }
3459
- case slot.Types.ResponsiveColor:
3517
+ case richText.Types.ResponsiveColor:
3460
3518
  return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
3461
3519
  hook: useResponsiveColor,
3462
3520
  parameters: [props[propName]],
@@ -3616,6 +3674,9 @@ function useIsInBuilder() {
3616
3674
  function useIsPreview() {
3617
3675
  return useSelector((state) => constants.getIsPreview(state));
3618
3676
  }
3677
+ function useBuilderEditMode() {
3678
+ return useSelector((state) => constants.getBuilderEditMode(state));
3679
+ }
3619
3680
  function useDispatch() {
3620
3681
  const store = React.useContext(StoreContext);
3621
3682
  return store.dispatch;
@@ -3781,6 +3842,7 @@ exports.forwardNextDynamicRef = forwardNextDynamicRef;
3781
3842
  exports.getServerSideProps = getServerSideProps;
3782
3843
  exports.getStaticPaths = getStaticPaths;
3783
3844
  exports.getStaticProps = getStaticProps;
3845
+ exports.pollBoxModel = pollBoxModel;
3784
3846
  exports.responsiveGridItem = responsiveGridItem;
3785
3847
  exports.responsiveStyle = responsiveStyle;
3786
3848
  exports.responsiveTextStyle = responsiveTextStyle;
@@ -3789,6 +3851,7 @@ exports.shallowMergeFallbacks = shallowMergeFallbacks;
3789
3851
  exports.storeContextDefaultValue = storeContextDefaultValue;
3790
3852
  exports.useBorder = useBorder;
3791
3853
  exports.useBoxShadow = useBoxShadow;
3854
+ exports.useBuilderEditMode = useBuilderEditMode;
3792
3855
  exports.useElementId = useElementId;
3793
3856
  exports.useFile = useFile;
3794
3857
  exports.useFiles = useFiles;