@makeswift/runtime 0.12.3 → 0.12.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 (45) hide show
  1. package/dist/LiveProvider.es.js +1 -1
  2. package/dist/PreviewProvider.es.js +1 -1
  3. package/dist/ReadOnlyText.es.js +1 -1
  4. package/dist/ReadOnlyTextV2.es.js +1 -1
  5. package/dist/control-serialization.es.js +1 -1
  6. package/dist/controls.cjs.js +8 -1
  7. package/dist/controls.cjs.js.map +1 -1
  8. package/dist/controls.es.js +2 -2
  9. package/dist/index.cjs.js +14 -6
  10. package/dist/index.cjs.js.map +1 -1
  11. package/dist/index.es.js +16 -8
  12. package/dist/index.es.js.map +1 -1
  13. package/dist/index.es2.js +1 -1
  14. package/dist/index.es5.js +1 -1
  15. package/dist/index.es6.js +1 -1
  16. package/dist/index.es8.js +1 -1
  17. package/dist/index.es9.js +1 -1
  18. package/dist/number.cjs.js +11 -2
  19. package/dist/number.cjs.js.map +1 -1
  20. package/dist/number.es.js +8 -3
  21. package/dist/number.es.js.map +1 -1
  22. package/dist/react-page.cjs.js +11 -3
  23. package/dist/react-page.cjs.js.map +1 -1
  24. package/dist/react-page.es.js +8 -4
  25. package/dist/react-page.es.js.map +1 -1
  26. package/dist/slate.es.js +1 -1
  27. package/dist/toText.es.js +1 -1
  28. package/dist/types/src/controls/checkbox.d.ts +9 -1
  29. package/dist/types/src/controls/checkbox.d.ts.map +1 -1
  30. package/dist/types/src/controls/color.d.ts +1 -2
  31. package/dist/types/src/controls/color.d.ts.map +1 -1
  32. package/dist/types/src/controls/control-data-type-key.d.ts +2 -0
  33. package/dist/types/src/controls/control-data-type-key.d.ts.map +1 -0
  34. package/dist/types/src/controls/number.d.ts +9 -1
  35. package/dist/types/src/controls/number.d.ts.map +1 -1
  36. package/dist/types/src/controls/text-area.d.ts +9 -1
  37. package/dist/types/src/controls/text-area.d.ts.map +1 -1
  38. package/dist/types/src/controls/text-input.d.ts +10 -1
  39. package/dist/types/src/controls/text-input.d.ts.map +1 -1
  40. package/dist/types/src/runtimes/react/controls/checkbox.d.ts.map +1 -1
  41. package/dist/types/src/runtimes/react/controls/number.d.ts +2 -2
  42. package/dist/types/src/runtimes/react/controls/number.d.ts.map +1 -1
  43. package/dist/types/src/runtimes/react/controls/text-area.d.ts.map +1 -1
  44. package/dist/types/src/runtimes/react/controls/text-input.d.ts.map +1 -1
  45. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import { useMemo } from "react";
2
2
  import { a as ReactRuntime, K as StoreContext, M as MakeswiftProvider } from "./index.es.js";
3
- import { av as configureStore } from "./react-page.es.js";
3
+ import { az as configureStore } from "./react-page.es.js";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  import "use-sync-external-store/shim/with-selector";
6
6
  import "next/dynamic";
@@ -23,7 +23,7 @@ import { J as ElementImperativeHandle, a as ReactRuntime, K as StoreContext, M a
23
23
  import { createStore, applyMiddleware, combineReducers } from "redux";
24
24
  import thunk from "redux-thunk";
25
25
  import Router from "next/router";
26
- import { ca as getInitialState$3, cb as reducer$4, cc as getDocument$1, c as createDocument, cd as getComponentsMeta$1, ce as getComponentPropControllerDescriptors$1, ax as getBreakpoints, f as deepEqual, aE as getBuilderEditMode, cf as BuilderEditMode, cg as getDocumentKeysSortedByDepth, ch as getPropController, ci as getPropControllersHandle, cj as getElement, ck as getElementPropControllerDescriptors, cl as createPropController, j as isElementReference, a4 as isPropControllersHandle, cm as reducer$5, cn as reducer$7, co as reducer$8, cp as reducer$9, cq as reducer$a, cr as reducer$b, cs as reducer$c, ct as getInitialState$4 } from "./react-page.es.js";
26
+ import { ce as getInitialState$3, cf as reducer$4, cg as getDocument$1, c as createDocument, ch as getComponentsMeta$1, ci as getComponentPropControllerDescriptors$1, aB as getBreakpoints, f as deepEqual, aI as getBuilderEditMode, cj as BuilderEditMode, ck as getDocumentKeysSortedByDepth, cl as getPropController, cm as getPropControllersHandle, cn as getElement, co as getElementPropControllerDescriptors, cp as createPropController, j as isElementReference, a4 as isPropControllersHandle, cq as reducer$5, cr as reducer$7, cs as reducer$8, ct as reducer$9, cu as reducer$a, cv as reducer$b, cw as reducer$c, cx as getInitialState$4 } from "./react-page.es.js";
27
27
  import { removeIn, setIn } from "immutable";
28
28
  import { A as ActionTypes, v as unregisterMeasurable, w as registerMeasurable, x as registerBuilderComponent, j as setBreakpoints, k as setLocale, y as changePathnameStart, z as changePathnameComplete, B as changeElementBoxModels, C as changeDocumentElementSize, D as handleWheel, E as handlePointerMove, F as elementFromPointChange, G as setIsInBuilder, H as unregisterBuilderComponent, I as unregisterPropControllers, J as registerPropControllers, K as registerPropControllersHandle, r as registerDocument, L as registerComponentHandle, M as messageBuilderPropController, N as registerDocumentEffect } from "./actions.es.js";
29
29
  import { i as isMeasurable, a as getMeasurables$1, b as getBoxModels$1, m as measure, d as getBoxModel$1, r as reducer$6 } from "./box-models.es.js";
@@ -2,7 +2,7 @@ import { cx } from "@emotion/css";
2
2
  import { forwardRef } from "react";
3
3
  import { L as useEnhancedTypography, N as useTypographyClassName, n as useResponsiveStyle } from "./index.es.js";
4
4
  import "ts-pattern";
5
- import { bD as richTextDTOtoDAO, _ as useStyle, c1 as BlockType, c2 as InlineType } from "./react-page.es.js";
5
+ import { bH as richTextDTOtoDAO, _ as useStyle, c5 as BlockType, c6 as InlineType } from "./react-page.es.js";
6
6
  import "./actions.es.js";
7
7
  import "slate";
8
8
  import "uuid";
@@ -15,7 +15,7 @@ var __objRest = (source, exclude) => {
15
15
  };
16
16
  import { forwardRef } from "react";
17
17
  import "ts-pattern";
18
- import { bG as RichTextV2Mode, bZ as InlineModePlugin, bX as BlockPlugin, bS as TypographyPlugin, b$ as TextAlignPlugin, c5 as InlinePlugin, _ as useStyle } from "./react-page.es.js";
18
+ import { bK as RichTextV2Mode, c1 as InlineModePlugin, b$ as BlockPlugin, bW as TypographyPlugin, c3 as TextAlignPlugin, c9 as InlinePlugin, _ as useStyle } from "./react-page.es.js";
19
19
  import "./actions.es.js";
20
20
  import "slate";
21
21
  import "uuid";
@@ -32,7 +32,7 @@ var __objRest = (source, exclude) => {
32
32
  const import_meta = {};
33
33
  import "ts-pattern";
34
34
  import { C as ComboboxControlType } from "./combobox.es.js";
35
- import { ad as ListControlType, ae as ShapeControlType, ac as StyleV2ControlType, a9 as RichTextV2ControlType, ao as Types } from "./react-page.es.js";
35
+ import { ah as ListControlType, ai as ShapeControlType, ag as StyleV2ControlType, ad as RichTextV2ControlType, as as Types } from "./react-page.es.js";
36
36
  import "./actions.es.js";
37
37
  import "uuid";
38
38
  import "slate";
@@ -22,14 +22,17 @@ require("@emotion/css");
22
22
  require("@emotion/serialize");
23
23
  require("@emotion/utils");
24
24
  exports.Checkbox = number.Checkbox;
25
+ exports.CheckboxControlDataTypeKey = number.CheckboxControlDataTypeKey;
26
+ exports.CheckboxControlDataTypeValueV1 = number.CheckboxControlDataTypeValueV1;
25
27
  exports.CheckboxControlType = number.CheckboxControlType;
26
28
  exports.Number = number.Number;
29
+ exports.NumberControlDataTypeKey = number.NumberControlDataTypeKey;
30
+ exports.NumberControlDataTypeValueV1 = number.NumberControlDataTypeValueV1;
27
31
  exports.NumberControlType = number.NumberControlType;
28
32
  exports.Color = reactPage.Color;
29
33
  exports.ColorControlDataTypeKey = reactPage.ColorControlDataTypeKey;
30
34
  exports.ColorControlDataTypeValueV1 = reactPage.ColorControlDataTypeValueV1;
31
35
  exports.ColorControlType = reactPage.ColorControlType;
32
- exports.ControlDataTypeKey = reactPage.ControlDataTypeKey;
33
36
  exports.IconRadioGroupControlType = reactPage.IconRadioGroupControlType;
34
37
  exports.Image = reactPage.Image$1;
35
38
  exports.ImageControlType = reactPage.ImageControlType;
@@ -68,8 +71,12 @@ exports.StyleV2Control = reactPage.StyleV2Control;
68
71
  exports.StyleV2ControlMessageType = reactPage.StyleV2ControlMessageType;
69
72
  exports.StyleV2ControlType = reactPage.StyleV2ControlType;
70
73
  exports.TextArea = reactPage.TextArea$1;
74
+ exports.TextAreaControlDataTypeKey = reactPage.TextAreaControlDataTypeKey;
75
+ exports.TextAreaControlDataTypeValueV1 = reactPage.TextAreaControlDataTypeValueV1;
71
76
  exports.TextAreaControlType = reactPage.TextAreaControlType;
72
77
  exports.TextInput = reactPage.TextInput$1;
78
+ exports.TextInputControlDataTypeKey = reactPage.TextInputControlDataTypeKey;
79
+ exports.TextInputControlDataTypeValueV1 = reactPage.TextInputControlDataTypeValueV1;
73
80
  exports.TextInputControlType = reactPage.TextInputControlType;
74
81
  exports.TypographyControlType = reactPage.TypographyControlType;
75
82
  exports.copy = reactPage.copy$3;
@@ -1 +1 @@
1
- {"version":3,"file":"controls.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"controls.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,5 +1,5 @@
1
- export { a as Checkbox, C as CheckboxControlType, b as Number, N as NumberControlType } from "./number.es.js";
2
- export { aL as Color, aJ as ColorControlDataTypeKey, aK as ColorControlDataTypeValueV1, ai as ColorControlType, aI as ControlDataTypeKey, ah as IconRadioGroupControlType, aT as Image, ag as ImageControlType, a3 as ImageControlValueFormat, aV as Link, af as LinkControlType, aX as List, aZ as ListControl, aY as ListControlMessageType, ad as ListControlType, bz as ObjectType, Y as RichText, bB as RichTextControl, bA as RichTextControlMessageType, aa as RichTextControlType, bI as RichTextV2Control, bH as RichTextV2ControlMessageType, a9 as RichTextV2ControlType, bG as RichTextV2Mode, b6 as Select, aj as SelectControlType, b7 as Shape, b9 as ShapeControl, b8 as ShapeControlMessageType, ae as ShapeControlType, bi as Slot, bk as SlotControl, bj as SlotControlMessageType, ab as SlotControlType, bo as Style, bq as StyleControl, bp as StyleControlMessageType, a2 as StyleControlProperty, a8 as StyleControlType, bv as StyleV2Control, bu as StyleV2ControlMessageType, ac as StyleV2ControlType, bw as TextArea, ak as TextAreaControlType, bx as TextInput, al as TextInputControlType, a7 as TypographyControlType, aN as copy, aM as copyColorData, aU as copyImageData, aW as copyLinkData, a_ as copyListData, by as copyRichTextData, ba as copyShapeData, bl as copySlotData, br as copyStyleData, bL as createRichTextV2Plugin, a$ as getListElementChildren, b1 as getListFileIds, b3 as getListPageIds, b0 as getListSwatchIds, b4 as getListTranslatableData, b2 as getListTypographyIds, bb as getShapeElementChildren, bf as getShapeFileIds, be as getShapePageIds, bc as getShapeSwatchIds, bg as getShapeTranslatableData, bd as getShapeTypographyIds, aP as getTranslatableData, bN as getTypographySwatchIds, bO as getTypographyTypographyIds, a5 as isRichTextV1Data, aO as merge, b5 as mergeListTranslatedData, bh as mergeShapeTranslatedData, bn as mergeSlotControlTranslatedData, bm as mergeSlotData, aQ as mergeTranslatedData, bF as richTextDAOToDTO, bD as richTextDTOtoDAO, bC as richTextDTOtoSelection, bJ as richTextV2DataToDescendents, bK as richTextV2DescendentsToData, bE as toSelectionDTO, aS as unstable_IconRadioGroup, aR as unstable_IconRadioGroupIcon, bt as unstable_StyleV2, bM as unstable_Typography, bs as unstable_useStyleV2ClassName } from "./react-page.es.js";
1
+ export { e as Checkbox, C as CheckboxControlDataTypeKey, a as CheckboxControlDataTypeValueV1, d as CheckboxControlType, f as Number, N as NumberControlDataTypeKey, b as NumberControlDataTypeValueV1, c as NumberControlType } from "./number.es.js";
2
+ export { aP as Color, aN as ColorControlDataTypeKey, aO as ColorControlDataTypeValueV1, am as ColorControlType, al as IconRadioGroupControlType, aX as Image, ak as ImageControlType, a3 as ImageControlValueFormat, aZ as Link, aj as LinkControlType, a$ as List, b1 as ListControl, b0 as ListControlMessageType, ah as ListControlType, bD as ObjectType, Y as RichText, bF as RichTextControl, bE as RichTextControlMessageType, ae as RichTextControlType, bM as RichTextV2Control, bL as RichTextV2ControlMessageType, ad as RichTextV2ControlType, bK as RichTextV2Mode, ba as Select, an as SelectControlType, bb as Shape, bd as ShapeControl, bc as ShapeControlMessageType, ai as ShapeControlType, bm as Slot, bo as SlotControl, bn as SlotControlMessageType, af as SlotControlType, bs as Style, bu as StyleControl, bt as StyleControlMessageType, a2 as StyleControlProperty, ac as StyleControlType, bz as StyleV2Control, by as StyleV2ControlMessageType, ag as StyleV2ControlType, bA as TextArea, a6 as TextAreaControlDataTypeKey, a7 as TextAreaControlDataTypeValueV1, ao as TextAreaControlType, bB as TextInput, a8 as TextInputControlDataTypeKey, a9 as TextInputControlDataTypeValueV1, ap as TextInputControlType, ab as TypographyControlType, aR as copy, aQ as copyColorData, aY as copyImageData, a_ as copyLinkData, b2 as copyListData, bC as copyRichTextData, be as copyShapeData, bp as copySlotData, bv as copyStyleData, bP as createRichTextV2Plugin, b3 as getListElementChildren, b5 as getListFileIds, b7 as getListPageIds, b4 as getListSwatchIds, b8 as getListTranslatableData, b6 as getListTypographyIds, bf as getShapeElementChildren, bj as getShapeFileIds, bi as getShapePageIds, bg as getShapeSwatchIds, bk as getShapeTranslatableData, bh as getShapeTypographyIds, aT as getTranslatableData, bR as getTypographySwatchIds, bS as getTypographyTypographyIds, a5 as isRichTextV1Data, aS as merge, b9 as mergeListTranslatedData, bl as mergeShapeTranslatedData, br as mergeSlotControlTranslatedData, bq as mergeSlotData, aU as mergeTranslatedData, bJ as richTextDAOToDTO, bH as richTextDTOtoDAO, bG as richTextDTOtoSelection, bN as richTextV2DataToDescendents, bO as richTextV2DescendentsToData, bI as toSelectionDTO, aW as unstable_IconRadioGroup, aV as unstable_IconRadioGroupIcon, bx as unstable_StyleV2, bQ as unstable_Typography, bw as unstable_useStyleV2ClassName } from "./react-page.es.js";
3
3
  export { a as Combobox, C as ComboboxControlType } from "./combobox.es.js";
4
4
  import "redux";
5
5
  import "redux-thunk";
package/dist/index.cjs.js CHANGED
@@ -1251,7 +1251,7 @@ async function fonts(_req, res, { getFonts } = {}) {
1251
1251
  const fonts2 = (_a = await (getFonts == null ? void 0 : getFonts())) != null ? _a : [];
1252
1252
  return res.json(fonts2);
1253
1253
  }
1254
- const version = "0.12.3";
1254
+ const version = "0.12.4";
1255
1255
  async function handler(req, res, { apiKey, siteVersions }) {
1256
1256
  if (req.query.secret !== apiKey) {
1257
1257
  return res.status(401).json({ message: "Unauthorized" });
@@ -3122,7 +3122,9 @@ function RenderHook({
3122
3122
  return children(useHook(...parameters));
3123
3123
  }
3124
3124
  function useCheckboxControlValue(data, definition) {
3125
- return data != null ? data : definition.config.defaultValue;
3125
+ var _a;
3126
+ const value = (_a = tsPattern.match(data).with({ [number.CheckboxControlDataTypeKey]: number.CheckboxControlDataTypeValueV1 }, (val) => val.value).otherwise((val) => val)) != null ? _a : definition.config.defaultValue;
3127
+ return value;
3126
3128
  }
3127
3129
  function useColorValue(data, definition) {
3128
3130
  var _a, _b;
@@ -3255,8 +3257,10 @@ function ListControlValue({
3255
3257
  children: (value) => renderFn([value, ...listControlValue])
3256
3258
  }), children)([]);
3257
3259
  }
3258
- function useNumber(numberControlData, controlDefinition) {
3259
- return numberControlData != null ? numberControlData : controlDefinition.config.defaultValue;
3260
+ function useNumber(data, definition) {
3261
+ var _a;
3262
+ const value = (_a = tsPattern.match(data).with({ [number.NumberControlDataTypeKey]: number.NumberControlDataTypeValueV1 }, (val) => val.value).otherwise((val) => val)) != null ? _a : definition.config.defaultValue;
3263
+ return value;
3260
3264
  }
3261
3265
  const EditableText$1 = forwardNextDynamicRef((patch) => dynamic__default["default"](() => patch(Promise.resolve().then(function() {
3262
3266
  return require("./index.cjs8.js");
@@ -3524,10 +3528,14 @@ function StyleV2ControlValue({
3524
3528
  })([]);
3525
3529
  }
3526
3530
  function useTextAreaValue(data, definition) {
3527
- return data != null ? data : definition.config.defaultValue;
3531
+ var _a;
3532
+ const value = (_a = tsPattern.match(data).with({ [reactPage.TextAreaControlDataTypeKey]: reactPage.TextAreaControlDataTypeValueV1 }, (val) => val.value).otherwise((val) => val)) != null ? _a : definition.config.defaultValue;
3533
+ return value;
3528
3534
  }
3529
3535
  function useTextInputValue(data, definition) {
3530
- return data != null ? data : definition.config.defaultValue;
3536
+ var _a;
3537
+ const value = (_a = tsPattern.match(data).with({ [reactPage.TextInputControlDataTypeKey]: reactPage.TextInputControlDataTypeValueV1 }, (val) => val.value).otherwise((val) => val)) != null ? _a : definition.config.defaultValue;
3538
+ return value;
3531
3539
  }
3532
3540
  function typographyFragementToTypographyControlData(typography) {
3533
3541
  if (typography == null)