@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
package/dist/index.es2.js CHANGED
@@ -30,7 +30,7 @@ var __objRest = (source, exclude) => {
30
30
  return target;
31
31
  };
32
32
  import { useMemo, useState, useEffect, useCallback, useRef, forwardRef, createElement, Children } from "react";
33
- import { aG as getBackgroundsFileIds, aH as getBackgroundsSwatchIds, _ as useStyle } from "./react-page.es.js";
33
+ import { aL as getBackgroundsFileIds, aM as getBackgroundsSwatchIds, _ as useStyle } from "./react-page.es.js";
34
34
  import "use-sync-external-store/shim";
35
35
  import { B as isNonNullable, F as useFiles, G as useSwatches, v as useResponsiveGridItem, c as DEFAULT_BOX_ANIMATE_TYPE, f as DEFAULT_ITEM_ANIMATE_TYPE, e as DEFAULT_BOX_ANIMATE_DURATION, d as DEFAULT_BOX_ANIMATE_DELAY, i as DEFAULT_ITEM_STAGGER_DURATION, n as useResponsiveStyle, q as colorToString } from "./index.es.js";
36
36
  import { match, P } from "ts-pattern";
package/dist/index.es5.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Node, Transforms, Text, Editor } from "slate";
2
2
  import { ReactEditor } from "slate-react";
3
- import { c6 as ElementUtils } from "./react-page.es.js";
3
+ import { ca as ElementUtils } from "./react-page.es.js";
4
4
  function withBuilder(editor) {
5
5
  editor.resetValue = function(value) {
6
6
  var _a;
package/dist/index.es6.js CHANGED
@@ -17,7 +17,7 @@ var __spreadValues = (a, b) => {
17
17
  return a;
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- import { c6 as ElementUtils, bL as createRichTextV2Plugin, aV as Link, c7 as onChange, c8 as getValue, c9 as isLinkElement, _ as useStyle, c2 as InlineType } from "./react-page.es.js";
20
+ import { ca as ElementUtils, bP as createRichTextV2Plugin, aZ as Link, cb as onChange, cc as getValue, cd as isLinkElement, _ as useStyle, c6 as InlineType } from "./react-page.es.js";
21
21
  import { L as Link$1 } from "./index.es3.js";
22
22
  import { cx } from "@emotion/css";
23
23
  import { jsx, Fragment } from "react/jsx-runtime";
package/dist/index.es8.js CHANGED
@@ -37,7 +37,7 @@ import { Range, createEditor } from "slate";
37
37
  import { ReactEditor, withReact, Slate, Editable } from "slate-react";
38
38
  import { n as useResponsiveStyle, L as useEnhancedTypography, N as useTypographyClassName, u as useIsInBuilder, O as useBuilderEditMode, Q as pollBoxModel } from "./index.es.js";
39
39
  import "ts-pattern";
40
- import { _ as useStyle, c1 as BlockType, c2 as InlineType, bD as richTextDTOtoDAO, bC as richTextDTOtoSelection, f as deepEqual, bW as withBlock, bR as withTypography, bV as onKeyDown, cf as BuilderEditMode } from "./react-page.es.js";
40
+ import { _ as useStyle, c5 as BlockType, c6 as InlineType, bH as richTextDTOtoDAO, bG as richTextDTOtoSelection, f as deepEqual, b_ as withBlock, bV as withTypography, bZ as onKeyDown, cj as BuilderEditMode } from "./react-page.es.js";
41
41
  import "uuid";
42
42
  import "escape-html";
43
43
  import "slate-hyperscript";
package/dist/index.es9.js CHANGED
@@ -34,7 +34,7 @@ import { Range, createEditor } from "slate";
34
34
  import isHotkey from "is-hotkey";
35
35
  import { ReactEditor, withReact, Slate, Editable } from "slate-react";
36
36
  import "ts-pattern";
37
- import { bJ as richTextV2DataToDescendents, c1 as BlockType, bG as RichTextV2Mode, bZ as InlineModePlugin, bX as BlockPlugin, bS as TypographyPlugin, b$ as TextAlignPlugin, c5 as InlinePlugin, cf as BuilderEditMode } from "./react-page.es.js";
37
+ import { bN as richTextV2DataToDescendents, c5 as BlockType, bK as RichTextV2Mode, c1 as InlineModePlugin, b$ as BlockPlugin, bW as TypographyPlugin, c3 as TextAlignPlugin, c9 as InlinePlugin, cj as BuilderEditMode } from "./react-page.es.js";
38
38
  import "escape-html";
39
39
  import "slate-hyperscript";
40
40
  import "parse5";
@@ -1,14 +1,23 @@
1
1
  "use strict";
2
+ var reactPage = require("./react-page.cjs.js");
3
+ const CheckboxControlDataTypeKey = reactPage.ControlDataTypeKey;
4
+ const CheckboxControlDataTypeValueV1 = "checkbox::v1";
2
5
  const CheckboxControlType = "makeswift::controls::checkbox";
3
6
  function Checkbox(config = {}) {
4
- return { type: CheckboxControlType, config };
7
+ return { type: CheckboxControlType, config, version: 1 };
5
8
  }
9
+ const NumberControlDataTypeKey = reactPage.ControlDataTypeKey;
10
+ const NumberControlDataTypeValueV1 = "number::v1";
6
11
  const NumberControlType = "makeswift::controls::number";
7
12
  function Number(config = {}) {
8
- return { type: NumberControlType, config };
13
+ return { type: NumberControlType, config, version: 1 };
9
14
  }
10
15
  exports.Checkbox = Checkbox;
16
+ exports.CheckboxControlDataTypeKey = CheckboxControlDataTypeKey;
17
+ exports.CheckboxControlDataTypeValueV1 = CheckboxControlDataTypeValueV1;
11
18
  exports.CheckboxControlType = CheckboxControlType;
12
19
  exports.Number = Number;
20
+ exports.NumberControlDataTypeKey = NumberControlDataTypeKey;
21
+ exports.NumberControlDataTypeValueV1 = NumberControlDataTypeValueV1;
13
22
  exports.NumberControlType = NumberControlType;
14
23
  //# sourceMappingURL=number.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"number.cjs.js","sources":["../src/controls/checkbox.ts","../src/controls/number.ts"],"sourcesContent":["export type CheckboxControlData = boolean\n\nexport const CheckboxControlType = 'makeswift::controls::checkbox'\n\ntype CheckboxControlConfig = {\n label?: string\n defaultValue?: boolean\n}\n\nexport type CheckboxControlDefinition<C extends CheckboxControlConfig = CheckboxControlConfig> = {\n type: typeof CheckboxControlType\n config: C\n}\n\nexport function Checkbox<C extends CheckboxControlConfig>(\n config: C = {} as C,\n): CheckboxControlDefinition<C> {\n return { type: CheckboxControlType, config }\n}\n","export type NumberControlData = number\n\nexport const NumberControlType = 'makeswift::controls::number'\n\ntype NumberControlConfig = {\n label?: string\n labelOrientation?: 'vertical' | 'horizontal'\n defaultValue?: number\n min?: number\n max?: number\n step?: number\n suffix?: string\n}\n\nexport type NumberControlDefinition<C extends NumberControlConfig = NumberControlConfig> = {\n type: typeof NumberControlType\n config: C\n}\n\nexport function Number<C extends NumberControlConfig>(\n config: C = {} as C,\n): NumberControlDefinition<C> {\n return { type: NumberControlType, config }\n}\n"],"names":[],"mappings":";AAEO,MAAM,sBAAsB;AAajC,kBAAA,SAAY,IACkB;AACvB,SAAA,EAAE,MAAM,qBAAqB;AACtC;AChBO,MAAM,oBAAoB;AAkB/B,gBAAA,SAAY,IACgB;AACrB,SAAA,EAAE,MAAM,mBAAmB;AACpC;;;;;"}
1
+ {"version":3,"file":"number.cjs.js","sources":["../src/controls/checkbox.ts","../src/controls/number.ts"],"sourcesContent":["import { ControlDataTypeKey } from \"./control-data-type-key\"\n\nexport const CheckboxControlDataTypeKey = ControlDataTypeKey\n\nexport const CheckboxControlDataTypeValueV1 = 'checkbox::v1'\n\nexport type CheckboxControlDataV0 = boolean\n\nexport type CheckboxControlDataV1 = {\n [CheckboxControlDataTypeKey]: typeof CheckboxControlDataTypeValueV1\n value: boolean,\n}\n\nexport type CheckboxControlData = CheckboxControlDataV0 | CheckboxControlDataV1\n\nexport const CheckboxControlType = 'makeswift::controls::checkbox'\n\ntype CheckboxControlConfig = {\n label?: string\n defaultValue?: boolean\n}\n\nexport type CheckboxControlDefinition<C extends CheckboxControlConfig = CheckboxControlConfig> = {\n type: typeof CheckboxControlType\n config: C\n version?: 1\n}\n\nexport function Checkbox<C extends CheckboxControlConfig>(\n config: C = {} as C,\n): CheckboxControlDefinition<C> {\n return { type: CheckboxControlType, config, version: 1 }\n}\n","import { ControlDataTypeKey } from \"./control-data-type-key\"\n\nexport const NumberControlDataTypeKey = ControlDataTypeKey\n\nexport const NumberControlDataTypeValueV1 = 'number::v1'\n\nexport type NumberControlDataV0 = number\n\nexport type NumberControlDataV1 = {\n [NumberControlDataTypeKey]: typeof NumberControlDataTypeValueV1\n value: number,\n}\n\nexport type NumberControlData = NumberControlDataV0 | NumberControlDataV1\n\nexport const NumberControlType = 'makeswift::controls::number'\n\ntype NumberControlConfig = {\n label?: string\n labelOrientation?: 'vertical' | 'horizontal'\n defaultValue?: number\n min?: number\n max?: number\n step?: number\n suffix?: string\n}\n\nexport type NumberControlDefinition<C extends NumberControlConfig = NumberControlConfig> = {\n type: typeof NumberControlType\n config: C\n version?: 1\n}\n\nexport function Number<C extends NumberControlConfig>(\n config: C = {} as C,\n): NumberControlDefinition<C> {\n return { type: NumberControlType, config, version: 1 }\n}\n"],"names":["ControlDataTypeKey"],"mappings":";;AAEO,MAAM,6BAA6BA,UAAA;AAEnC,MAAM,iCAAiC;AAWvC,MAAM,sBAAsB;AAcjC,kBAAA,SAAY,IACkB;AAC9B,SAAO,EAAE,MAAM,qBAAqB,QAAQ,SAAS,EAAE;AACzD;AC9BO,MAAM,2BAA2BA,UAAA;AAEjC,MAAM,+BAA+B;AAWrC,MAAM,oBAAoB;AAmB/B,gBAAA,SAAY,IACgB;AAC5B,SAAO,EAAE,MAAM,mBAAmB,QAAQ,SAAS,EAAE;AACvD;;;;;;;;;"}
package/dist/number.es.js CHANGED
@@ -1,10 +1,15 @@
1
+ import { aK as ControlDataTypeKey } from "./react-page.es.js";
2
+ const CheckboxControlDataTypeKey = ControlDataTypeKey;
3
+ const CheckboxControlDataTypeValueV1 = "checkbox::v1";
1
4
  const CheckboxControlType = "makeswift::controls::checkbox";
2
5
  function Checkbox(config = {}) {
3
- return { type: CheckboxControlType, config };
6
+ return { type: CheckboxControlType, config, version: 1 };
4
7
  }
8
+ const NumberControlDataTypeKey = ControlDataTypeKey;
9
+ const NumberControlDataTypeValueV1 = "number::v1";
5
10
  const NumberControlType = "makeswift::controls::number";
6
11
  function Number(config = {}) {
7
- return { type: NumberControlType, config };
12
+ return { type: NumberControlType, config, version: 1 };
8
13
  }
9
- export { CheckboxControlType as C, NumberControlType as N, Checkbox as a, Number as b };
14
+ export { CheckboxControlDataTypeKey as C, NumberControlDataTypeKey as N, CheckboxControlDataTypeValueV1 as a, NumberControlDataTypeValueV1 as b, NumberControlType as c, CheckboxControlType as d, Checkbox as e, Number as f };
10
15
  //# sourceMappingURL=number.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"number.es.js","sources":["../src/controls/checkbox.ts","../src/controls/number.ts"],"sourcesContent":["export type CheckboxControlData = boolean\n\nexport const CheckboxControlType = 'makeswift::controls::checkbox'\n\ntype CheckboxControlConfig = {\n label?: string\n defaultValue?: boolean\n}\n\nexport type CheckboxControlDefinition<C extends CheckboxControlConfig = CheckboxControlConfig> = {\n type: typeof CheckboxControlType\n config: C\n}\n\nexport function Checkbox<C extends CheckboxControlConfig>(\n config: C = {} as C,\n): CheckboxControlDefinition<C> {\n return { type: CheckboxControlType, config }\n}\n","export type NumberControlData = number\n\nexport const NumberControlType = 'makeswift::controls::number'\n\ntype NumberControlConfig = {\n label?: string\n labelOrientation?: 'vertical' | 'horizontal'\n defaultValue?: number\n min?: number\n max?: number\n step?: number\n suffix?: string\n}\n\nexport type NumberControlDefinition<C extends NumberControlConfig = NumberControlConfig> = {\n type: typeof NumberControlType\n config: C\n}\n\nexport function Number<C extends NumberControlConfig>(\n config: C = {} as C,\n): NumberControlDefinition<C> {\n return { type: NumberControlType, config }\n}\n"],"names":[],"mappings":"AAEO,MAAM,sBAAsB;AAajC,kBAAA,SAAY,IACkB;AACvB,SAAA,EAAE,MAAM,qBAAqB;AACtC;AChBO,MAAM,oBAAoB;AAkB/B,gBAAA,SAAY,IACgB;AACrB,SAAA,EAAE,MAAM,mBAAmB;AACpC;;"}
1
+ {"version":3,"file":"number.es.js","sources":["../src/controls/checkbox.ts","../src/controls/number.ts"],"sourcesContent":["import { ControlDataTypeKey } from \"./control-data-type-key\"\n\nexport const CheckboxControlDataTypeKey = ControlDataTypeKey\n\nexport const CheckboxControlDataTypeValueV1 = 'checkbox::v1'\n\nexport type CheckboxControlDataV0 = boolean\n\nexport type CheckboxControlDataV1 = {\n [CheckboxControlDataTypeKey]: typeof CheckboxControlDataTypeValueV1\n value: boolean,\n}\n\nexport type CheckboxControlData = CheckboxControlDataV0 | CheckboxControlDataV1\n\nexport const CheckboxControlType = 'makeswift::controls::checkbox'\n\ntype CheckboxControlConfig = {\n label?: string\n defaultValue?: boolean\n}\n\nexport type CheckboxControlDefinition<C extends CheckboxControlConfig = CheckboxControlConfig> = {\n type: typeof CheckboxControlType\n config: C\n version?: 1\n}\n\nexport function Checkbox<C extends CheckboxControlConfig>(\n config: C = {} as C,\n): CheckboxControlDefinition<C> {\n return { type: CheckboxControlType, config, version: 1 }\n}\n","import { ControlDataTypeKey } from \"./control-data-type-key\"\n\nexport const NumberControlDataTypeKey = ControlDataTypeKey\n\nexport const NumberControlDataTypeValueV1 = 'number::v1'\n\nexport type NumberControlDataV0 = number\n\nexport type NumberControlDataV1 = {\n [NumberControlDataTypeKey]: typeof NumberControlDataTypeValueV1\n value: number,\n}\n\nexport type NumberControlData = NumberControlDataV0 | NumberControlDataV1\n\nexport const NumberControlType = 'makeswift::controls::number'\n\ntype NumberControlConfig = {\n label?: string\n labelOrientation?: 'vertical' | 'horizontal'\n defaultValue?: number\n min?: number\n max?: number\n step?: number\n suffix?: string\n}\n\nexport type NumberControlDefinition<C extends NumberControlConfig = NumberControlConfig> = {\n type: typeof NumberControlType\n config: C\n version?: 1\n}\n\nexport function Number<C extends NumberControlConfig>(\n config: C = {} as C,\n): NumberControlDefinition<C> {\n return { type: NumberControlType, config, version: 1 }\n}\n"],"names":[],"mappings":";AAEO,MAAM,6BAA6B;AAEnC,MAAM,iCAAiC;AAWvC,MAAM,sBAAsB;AAcjC,kBAAA,SAAY,IACkB;AAC9B,SAAO,EAAE,MAAM,qBAAqB,QAAQ,SAAS,EAAE;AACzD;AC9BO,MAAM,2BAA2B;AAEjC,MAAM,+BAA+B;AAWrC,MAAM,oBAAoB;AAmB/B,gBAAA,SAAY,IACgB;AAC5B,SAAO,EAAE,MAAM,mBAAmB,QAAQ,SAAS,EAAE;AACvD;;"}
@@ -294,7 +294,7 @@ function Color(config = {}) {
294
294
  function copyColorData(value, context) {
295
295
  if (value == null)
296
296
  return value;
297
- return tsPattern.match(value).with({ [ControlDataTypeKey]: ColorControlDataTypeValueV1 }, (val) => {
297
+ return tsPattern.match(value).with({ [ColorControlDataTypeKey]: ColorControlDataTypeValueV1 }, (val) => {
298
298
  var _a;
299
299
  return __spreadProps(__spreadValues({}, val), {
300
300
  swatchId: (_a = context.replacementContext.swatchIds.get(val.swatchId)) != null ? _a : val.swatchId
@@ -1173,13 +1173,17 @@ function mergeShapeTranslatedData(definition2, data, translatedData, context) {
1173
1173
  mergeTranslatedData(definition22, data[key], translatedData[key], context)
1174
1174
  ]));
1175
1175
  }
1176
+ const TextAreaControlDataTypeKey = ControlDataTypeKey;
1177
+ const TextAreaControlDataTypeValueV1 = "text-area::v1";
1176
1178
  const TextAreaControlType = "makeswift::controls::text-area";
1177
1179
  function TextArea(config = {}) {
1178
- return { type: TextAreaControlType, config };
1180
+ return { type: TextAreaControlType, config, version: 1 };
1179
1181
  }
1182
+ const TextInputControlDataTypeKey = ControlDataTypeKey;
1183
+ const TextInputControlDataTypeValueV1 = "text-input::v1";
1180
1184
  const TextInputControlType = "makeswift::controls::text-input";
1181
1185
  function TextInput(config = {}) {
1182
- return { type: TextInputControlType, config };
1186
+ return { type: TextInputControlType, config, version: 1 };
1183
1187
  }
1184
1188
  const SlotControlType = "makeswift::controls::slot";
1185
1189
  function Slot() {
@@ -5220,9 +5224,13 @@ exports.TableFormFieldsMessageType = TableFormFieldsMessageType;
5220
5224
  exports.TextAlignPlugin = TextAlignPlugin;
5221
5225
  exports.TextArea = TextArea$1;
5222
5226
  exports.TextArea$1 = TextArea;
5227
+ exports.TextAreaControlDataTypeKey = TextAreaControlDataTypeKey;
5228
+ exports.TextAreaControlDataTypeValueV1 = TextAreaControlDataTypeValueV1;
5223
5229
  exports.TextAreaControlType = TextAreaControlType;
5224
5230
  exports.TextInput = TextInput$1;
5225
5231
  exports.TextInput$1 = TextInput;
5232
+ exports.TextInputControlDataTypeKey = TextInputControlDataTypeKey;
5233
+ exports.TextInputControlDataTypeValueV1 = TextInputControlDataTypeValueV1;
5226
5234
  exports.TextInputControlType = TextInputControlType;
5227
5235
  exports.TextStyle = TextStyle;
5228
5236
  exports.Types = Types;