@makeswift/runtime 0.7.15 → 0.7.16

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.
@@ -1,5 +1,5 @@
1
1
  export { b as Checkbox, C as CheckboxControlType, c as Number, N as NumberControlType, d as Select, S as SelectControlType, e as TextArea, T as TextAreaControlType, f as TextInput, a as TextInputControlType } from "./text-input.es.js";
2
- export { aw as BlockTextAlignment, au as BlockType, a2 as Color, C as ColorControlType, a4 as Image, I as ImageControlType, O as ImageControlValueFormat, av as InlineType, a6 as Link, Q as LinkControlType, a8 as List, aa as ListControl, a9 as ListControlMessageType, L as ListControlType, am as ObjectType, an as RichText, ap as RichTextControl, ao as RichTextControlMessageType, a0 as RichTextControlType, ac as Shape, ae as ShapeControl, ad as ShapeControlMessageType, S as ShapeControlType, ag as Slot, ai as SlotControl, ah as SlotControlMessageType, b as SlotControlType, ak as Style, K as StyleControlProperty, a1 as StyleControlType, a as copy, a3 as copyColorData, a5 as copyImageData, a7 as copyLinkData, ab as copyListData, af as copyShapeData, aj as copySlotData, al as copyStyleData, at as richTextDAOToDTO, ar as richTextDTOtoDAO, aq as richTextDTOtoSelection, as as toSelectionDTO } from "./rich-text.es.js";
2
+ export { aw as BlockTextAlignment, au as BlockType, a2 as Color, C as ColorControlType, a4 as Image, I as ImageControlType, O as ImageControlValueFormat, av as InlineType, a6 as Link, U as LinkControlType, a8 as List, aa as ListControl, a9 as ListControlMessageType, L as ListControlType, am as ObjectType, an as RichText, ap as RichTextControl, ao as RichTextControlMessageType, Q as RichTextControlType, ac as Shape, ae as ShapeControl, ad as ShapeControlMessageType, S as ShapeControlType, ag as Slot, ai as SlotControl, ah as SlotControlMessageType, b as SlotControlType, ak as Style, K as StyleControlProperty, a1 as StyleControlType, a as copy, a3 as copyColorData, a5 as copyImageData, a7 as copyLinkData, ab as copyListData, af as copyShapeData, aj as copySlotData, al as copyStyleData, at as richTextDAOToDTO, ar as richTextDTOtoDAO, aq as richTextDTOtoSelection, as as toSelectionDTO } from "./rich-text.es.js";
3
3
  export { a as Combobox, C as ComboboxControlType } from "./combobox.es.js";
4
4
  import "./actions.es.js";
5
5
  import "slate";
package/dist/index.cjs.js CHANGED
@@ -1002,7 +1002,7 @@ function useCachedSite(siteId) {
1002
1002
  const site = shim.useSyncExternalStore(client.subscribe, getSnapshot, getSnapshot);
1003
1003
  return site;
1004
1004
  }
1005
- const version = "0.7.15";
1005
+ const version = "0.7.16";
1006
1006
  class Makeswift {
1007
1007
  constructor(apiKey, { apiOrigin = "https://api.makeswift.com" } = {}) {
1008
1008
  __publicField(this, "apiKey");
@@ -3437,6 +3437,22 @@ function ListControlValue({
3437
3437
  function useNumber(numberControlData, controlDefinition) {
3438
3438
  return numberControlData != null ? numberControlData : controlDefinition.config.defaultValue;
3439
3439
  }
3440
+ const Text = forwardNextDynamicRef((patch) => dynamic__default["default"](() => patch(Promise.resolve().then(function() {
3441
+ return require("./index.cjs5.js");
3442
+ }))));
3443
+ function useRichText(data, control) {
3444
+ const textCallbackRef = React.useCallback((handle) => {
3445
+ var _a;
3446
+ if (constants.isPropControllersHandle(handle))
3447
+ (_a = handle == null ? void 0 : handle.setPropControllers) == null ? void 0 : _a.call(handle, control == null ? null : {
3448
+ text: control
3449
+ });
3450
+ }, [control]);
3451
+ return /* @__PURE__ */ jsxRuntime.jsx(Text, {
3452
+ text: data,
3453
+ ref: textCallbackRef
3454
+ });
3455
+ }
3440
3456
  function useSelectControlValue(data, definition) {
3441
3457
  return data != null ? data : definition == null ? void 0 : definition.config.defaultValue;
3442
3458
  }
@@ -3704,26 +3720,16 @@ function ControlValue({
3704
3720
  parameters: [data, control],
3705
3721
  children: (value) => children(value)
3706
3722
  }, definition.type);
3723
+ case richText.RichTextControlType:
3724
+ return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
3725
+ hook: useRichText,
3726
+ parameters: [data, control],
3727
+ children: (value) => children(value)
3728
+ }, definition.type);
3707
3729
  default:
3708
3730
  return children(data);
3709
3731
  }
3710
3732
  }
3711
- const Text = forwardNextDynamicRef((patch) => dynamic__default["default"](() => patch(Promise.resolve().then(function() {
3712
- return require("./index.cjs5.js");
3713
- }))));
3714
- function useRichText(data, control) {
3715
- const textCallbackRef = React.useCallback((handle) => {
3716
- var _a;
3717
- if (constants.isPropControllersHandle(handle))
3718
- (_a = handle == null ? void 0 : handle.setPropControllers) == null ? void 0 : _a.call(handle, control == null ? null : {
3719
- text: control
3720
- });
3721
- }, [control]);
3722
- return /* @__PURE__ */ jsxRuntime.jsx(Text, {
3723
- text: data,
3724
- ref: textCallbackRef
3725
- });
3726
- }
3727
3733
  function useWidthStyle(value, descriptor) {
3728
3734
  return useStyle(responsiveWidth(value, descriptor.options.defaultValue));
3729
3735
  }