@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
@@ -49,7 +49,7 @@ require("./actions.cjs.js");
49
49
  var useIsomorphicLayoutEffect = require("./useIsomorphicLayoutEffect.cjs.js");
50
50
  require("use-sync-external-store/shim/with-selector");
51
51
  require("next/dynamic");
52
- require("./text-input.cjs.js");
52
+ require("./number.cjs.js");
53
53
  require("./combobox.cjs.js");
54
54
  require("use-sync-external-store/shim");
55
55
  require("redux");
@@ -55,7 +55,7 @@ require("@emotion/serialize");
55
55
  require("@emotion/utils");
56
56
  require("use-sync-external-store/shim/with-selector");
57
57
  require("next/dynamic");
58
- require("./text-input.cjs.js");
58
+ require("./number.cjs.js");
59
59
  require("./combobox.cjs.js");
60
60
  require("use-sync-external-store/shim");
61
61
  require("./types.cjs.js");
package/dist/index.es.js CHANGED
@@ -38,10 +38,10 @@ import * as React from "react";
38
38
  import { useEffect, createContext, useContext, useState, useMemo, useRef, Children, createElement, forwardRef, memo, useId, useCallback, useImperativeHandle, Component, Suspense } from "react";
39
39
  import { useSyncExternalStoreWithSelector } from "use-sync-external-store/shim/with-selector";
40
40
  import dynamic from "next/dynamic";
41
- import { b as deepEqual, e as createDocumentReference, g as getPropControllerDescriptors, f as isElementReference, h as getDefaultLocale, j as getLocales, k as getSwatchIds, l as getFileIds, m as getTypographyIds, n as getTableIds, o as getPageIds, p as getElementChildren, E as ElementID, B as Backgrounds, W as Width, q as ResponsiveIconRadioGroup, M as Margin, P as Padding, r as Border, s as BorderRadius, S as Shadows, G as GapY, t as GapX, u as ResponsiveSelect, v as ResponsiveNumber, w as Checkbox, x as Grid, y as TextInput, L as Link, z as ResponsiveColor, A as TextStyle, C as ComponentIcon, I as Images, N as Number$1, D as Date$1, F as Font, H as ResponsiveLength, J as TextArea, K as Table, O as TableFormFields, Q as Image, U as ResponsiveOpacity, V as NavigationLinks, X as SocialLinks, Y as RichText, Z as Video, _ as useStyle, $ as getBorderSwatchIds, a0 as getBoxShadowsSwatchIds, a1 as getResponsiveColorSwatchIds, a2 as StyleControlProperty, a3 as ImageControlValueFormat, a4 as isPropControllersHandle, a5 as isRichTextV1Data, a6 as isNonNullable$1, a7 as TypographyControlType, a8 as StyleControlType, a9 as RichTextV2ControlType, aa as RichTextControlType, ab as SlotControlType, ac as StyleV2ControlType, ad as ListControlType, ae as ShapeControlType, af as LinkControlType, ag as ImageControlType, ah as IconRadioGroupControlType, ai as ColorControlType, aj as SelectControlType, ak as getComponentPropControllerDescriptors, al as getPropControllers, am as Types, an as BorderPropControllerFormat, ao as ShadowsPropControllerFormat, ap as BorderRadiusPropControllerFormat, aq as MarginPropControllerFormat, ar as PaddingPropControllerFormat, as as WidthPropControllerFormat, at as configureStore$1, au as copyElementTree, av as getBreakpoints, aw as parseLocalesInput, ax as getDocument, ay as getElementId, az as getIsInBuilder, aA as getReactComponent, aB as getBuilderEditMode, aC as getIsPreview } from "./react-page.es.js";
41
+ import { e as deepEqual, f as createDocumentReference, g as getPropControllerDescriptors, h as isElementReference, j as getDefaultLocale, k as getLocales, l as getSwatchIds, m as getFileIds, n as getTypographyIds, o as getTableIds, p as getPageIds, q as getElementChildren, E as ElementID, B as Backgrounds, W as Width, r as ResponsiveIconRadioGroup, M as Margin, P as Padding, s as Border, t as BorderRadius, S as Shadows, G as GapY, u as GapX, v as ResponsiveSelect, w as ResponsiveNumber, x as Checkbox, y as Grid, z as TextInput, L as Link, A as ResponsiveColor, D as TextStyle, C as ComponentIcon, I as Images, N as Number$1, F as Date$1, H as Font, J as ResponsiveLength, K as TextArea, O as Table, Q as TableFormFields, U as Image, V as ResponsiveOpacity, X as NavigationLinks, Y as SocialLinks, Z as RichText, _ as Video, $ as useStyle, a0 as getBorderSwatchIds, a1 as getBoxShadowsSwatchIds, a2 as getResponsiveColorSwatchIds, a3 as StyleControlProperty, a4 as ImageControlValueFormat, a5 as isPropControllersHandle, a6 as isRichTextV1Data, a7 as isNonNullable$1, a8 as TypographyControlType, a9 as StyleControlType, aa as RichTextV2ControlType, ab as RichTextControlType, ac as SlotControlType, ad as StyleV2ControlType, ae as ListControlType, af as ShapeControlType, ag as LinkControlType, ah as ImageControlType, ai as IconRadioGroupControlType, aj as ColorControlType, ak as SelectControlType, al as TextAreaControlType, am as TextInputControlType, an as getComponentPropControllerDescriptors, ao as getPropControllers, ap as Types, aq as BorderPropControllerFormat, ar as ShadowsPropControllerFormat, as as BorderRadiusPropControllerFormat, at as MarginPropControllerFormat, au as PaddingPropControllerFormat, av as WidthPropControllerFormat, aw as configureStore$1, ax as copyElementTree, ay as getBreakpoints, az as getElementTreeTranslatableData, aA as parseLocalesInput, aB as getDocument, aC as getElementId, aD as getIsInBuilder, aE as getReactComponent, aF as getBuilderEditMode, aG as getIsPreview } from "./react-page.es.js";
42
42
  import { A as ActionTypes, o as apiResourceFulfilled, p as registerComponentEffect, q as registerReactComponentEffect, t as registerComponentHandleEffect, v as mountComponentEffect } from "./actions.es.js";
43
43
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
44
- import { T as TextAreaControlType, a as TextInputControlType, N as NumberControlType, C as CheckboxControlType } from "./text-input.es.js";
44
+ import { N as NumberControlType, C as CheckboxControlType } from "./number.es.js";
45
45
  import { C as ComboboxControlType } from "./combobox.es.js";
46
46
  import { v4 } from "uuid";
47
47
  import "slate";
@@ -1101,6 +1101,9 @@ Received "${apiKey}" instead.`);
1101
1101
  const sitemap = await response.json();
1102
1102
  return sitemap;
1103
1103
  }
1104
+ getTranslatableData(elementTree2) {
1105
+ return this.runtime.getTranslatableData(elementTree2);
1106
+ }
1104
1107
  }
1105
1108
  class Document$1 extends NextDocument {
1106
1109
  static async getInitialProps(ctx) {
@@ -1156,7 +1159,7 @@ async function fonts(_req, res, { getFonts } = {}) {
1156
1159
  const fonts2 = (_a = await (getFonts == null ? void 0 : getFonts())) != null ? _a : [];
1157
1160
  return res.json(fonts2);
1158
1161
  }
1159
- const version = "0.10.12";
1162
+ const version = "0.10.13";
1160
1163
  async function handler(req, res, { apiKey, siteVersions }) {
1161
1164
  if (req.query.secret !== apiKey) {
1162
1165
  return res.status(401).json({ message: "Unauthorized" });
@@ -1255,6 +1258,14 @@ Read more here: https://nextjs.org/blog/next-12-2#on-demand-incremental-static-r
1255
1258
  return res.status(500).json({ message: "Error Revalidating" });
1256
1259
  }
1257
1260
  }
1261
+ async function translatableData(req, res, client) {
1262
+ const elementTree2 = req.body.elementTree;
1263
+ if (elementTree2 == null) {
1264
+ return res.status(400).json({ message: "elementTree must be defined" });
1265
+ }
1266
+ const translatableData2 = client.getTranslatableData(elementTree2);
1267
+ return res.json({ translatableData: translatableData2 });
1268
+ }
1258
1269
  function MakeswiftApiHandler(apiKey, {
1259
1270
  appOrigin = "https://app.makeswift.com",
1260
1271
  apiOrigin = "https://api.makeswift.com",
@@ -1298,6 +1309,8 @@ Read more about dynamic catch-all routes here: https://nextjs.org/docs/routing/d
1298
1309
  return fonts(req, res, { getFonts });
1299
1310
  if (matches("/element-tree"))
1300
1311
  return elementTree(req, res);
1312
+ if (matches("/translatable-data"))
1313
+ return translatableData(req, res, client);
1301
1314
  const handleResource = (resource) => resource === null ? res.status(404).json({ message: "Not Found" }) : res.json(resource);
1302
1315
  if (m = matches("/swatches/:id")) {
1303
1316
  return client.getSwatch(m.params.id).then(handleResource);
@@ -3916,6 +3929,9 @@ class ReactRuntime {
3916
3929
  static getBreakpoints() {
3917
3930
  return getBreakpoints(this.store.getState());
3918
3931
  }
3932
+ static getTranslatableData(elementTree2) {
3933
+ return getElementTreeTranslatableData(this.store.getState(), elementTree2);
3934
+ }
3919
3935
  registerComponent(component, {
3920
3936
  type,
3921
3937
  label,
@@ -3940,6 +3956,9 @@ class ReactRuntime {
3940
3956
  getBreakpoints() {
3941
3957
  return getBreakpoints(this.store.getState());
3942
3958
  }
3959
+ getTranslatableData(elementTree2) {
3960
+ return getElementTreeTranslatableData(this.store.getState(), elementTree2);
3961
+ }
3943
3962
  }
3944
3963
  __publicField(ReactRuntime, "store", configureStore$1());
3945
3964
  registerBuiltinComponents(ReactRuntime);