@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.
- package/dist/controls.es.js +1 -1
- package/dist/index.cjs.js +23 -17
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +22 -16
- package/dist/index.es.js.map +1 -1
- package/dist/rich-text.cjs.js +76 -49
- package/dist/rich-text.cjs.js.map +1 -1
- package/dist/rich-text.es.js +77 -50
- package/dist/rich-text.es.js.map +1 -1
- package/dist/types/src/controls/control.d.ts +4 -3
- package/dist/types/src/controls/control.d.ts.map +1 -1
- package/dist/types/src/controls/list.d.ts +1 -1
- package/dist/types/src/controls/list.d.ts.map +1 -1
- package/dist/types/src/controls/rich-text/rich-text.d.ts +1 -1
- package/dist/types/src/controls/rich-text/rich-text.d.ts.map +1 -1
- package/dist/types/src/controls/shape.d.ts +1 -1
- package/dist/types/src/controls/shape.d.ts.map +1 -1
- package/dist/types/src/controls/slot.d.ts +1 -1
- package/dist/types/src/controls/slot.d.ts.map +1 -1
- package/dist/types/src/prop-controllers/instances.d.ts +3 -3
- package/dist/types/src/prop-controllers/instances.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/control.d.ts +3 -2
- package/dist/types/src/runtimes/react/controls/control.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -45,7 +45,7 @@ import { cache, cx } from "@emotion/css";
|
|
|
45
45
|
import { serializeStyles } from "@emotion/serialize";
|
|
46
46
|
import { registerStyles, insertStyles } from "@emotion/utils";
|
|
47
47
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
48
|
-
import { S as ShapeControlType, L as ListControlType, T as Types, E as ElementID, B as Backgrounds, W as Width, f as ResponsiveIconRadioGroup, M as Margin, P as Padding, g as Border, h as BorderRadius, i as Shadows, G as GapY, j as GapX, k as ResponsiveSelect, l as ResponsiveNumber, m as Checkbox, n as Grid, o as TextInput, p as Link, q as ResponsiveColor, s as TextStyle, t as Images, N as Number$1, D as Date$1, F as Font, u as ResponsiveLength, v as TextArea, w as Table, x as TableFormFields, y as Image, z as ResponsiveOpacity, A as NavigationLinks, H as SocialLinks, J as RichText, V as Video, K as StyleControlProperty, O as ImageControlValueFormat, b as SlotControlType,
|
|
48
|
+
import { S as ShapeControlType, L as ListControlType, T as Types, E as ElementID, B as Backgrounds, W as Width, f as ResponsiveIconRadioGroup, M as Margin, P as Padding, g as Border, h as BorderRadius, i as Shadows, G as GapY, j as GapX, k as ResponsiveSelect, l as ResponsiveNumber, m as Checkbox, n as Grid, o as TextInput, p as Link, q as ResponsiveColor, s as TextStyle, t as Images, N as Number$1, D as Date$1, F as Font, u as ResponsiveLength, v as TextArea, w as Table, x as TableFormFields, y as Image, z as ResponsiveOpacity, A as NavigationLinks, H as SocialLinks, J as RichText, V as Video, K as StyleControlProperty, O as ImageControlValueFormat, Q as RichTextControlType, b as SlotControlType, U as LinkControlType, I as ImageControlType, C as ColorControlType, X as BorderPropControllerFormat, Y as ShadowsPropControllerFormat, Z as BorderRadiusPropControllerFormat, _ as MarginPropControllerFormat, $ as PaddingPropControllerFormat, a0 as WidthPropControllerFormat, a1 as StyleControlType } from "./rich-text.es.js";
|
|
49
49
|
import "slate";
|
|
50
50
|
import { S as SelectControlType, T as TextAreaControlType, a as TextInputControlType, N as NumberControlType, C as CheckboxControlType } from "./text-input.es.js";
|
|
51
51
|
import { C as ComboboxControlType } from "./combobox.es.js";
|
|
@@ -968,7 +968,7 @@ function useCachedSite(siteId) {
|
|
|
968
968
|
const site = useSyncExternalStore(client.subscribe, getSnapshot, getSnapshot);
|
|
969
969
|
return site;
|
|
970
970
|
}
|
|
971
|
-
const version = "0.7.
|
|
971
|
+
const version = "0.7.16";
|
|
972
972
|
class Makeswift {
|
|
973
973
|
constructor(apiKey, { apiOrigin = "https://api.makeswift.com" } = {}) {
|
|
974
974
|
__publicField(this, "apiKey");
|
|
@@ -3377,6 +3377,20 @@ function ListControlValue({
|
|
|
3377
3377
|
function useNumber(numberControlData, controlDefinition) {
|
|
3378
3378
|
return numberControlData != null ? numberControlData : controlDefinition.config.defaultValue;
|
|
3379
3379
|
}
|
|
3380
|
+
const Text = forwardNextDynamicRef((patch) => dynamic(() => patch(import("./index.es5.js"))));
|
|
3381
|
+
function useRichText(data, control) {
|
|
3382
|
+
const textCallbackRef = useCallback((handle) => {
|
|
3383
|
+
var _a;
|
|
3384
|
+
if (isPropControllersHandle(handle))
|
|
3385
|
+
(_a = handle == null ? void 0 : handle.setPropControllers) == null ? void 0 : _a.call(handle, control == null ? null : {
|
|
3386
|
+
text: control
|
|
3387
|
+
});
|
|
3388
|
+
}, [control]);
|
|
3389
|
+
return /* @__PURE__ */ jsx(Text, {
|
|
3390
|
+
text: data,
|
|
3391
|
+
ref: textCallbackRef
|
|
3392
|
+
});
|
|
3393
|
+
}
|
|
3380
3394
|
function useSelectControlValue(data, definition) {
|
|
3381
3395
|
return data != null ? data : definition == null ? void 0 : definition.config.defaultValue;
|
|
3382
3396
|
}
|
|
@@ -3644,24 +3658,16 @@ function ControlValue({
|
|
|
3644
3658
|
parameters: [data, control],
|
|
3645
3659
|
children: (value) => children(value)
|
|
3646
3660
|
}, definition.type);
|
|
3661
|
+
case RichTextControlType:
|
|
3662
|
+
return /* @__PURE__ */ jsx(RenderHook, {
|
|
3663
|
+
hook: useRichText,
|
|
3664
|
+
parameters: [data, control],
|
|
3665
|
+
children: (value) => children(value)
|
|
3666
|
+
}, definition.type);
|
|
3647
3667
|
default:
|
|
3648
3668
|
return children(data);
|
|
3649
3669
|
}
|
|
3650
3670
|
}
|
|
3651
|
-
const Text = forwardNextDynamicRef((patch) => dynamic(() => patch(import("./index.es5.js"))));
|
|
3652
|
-
function useRichText(data, control) {
|
|
3653
|
-
const textCallbackRef = useCallback((handle) => {
|
|
3654
|
-
var _a;
|
|
3655
|
-
if (isPropControllersHandle(handle))
|
|
3656
|
-
(_a = handle == null ? void 0 : handle.setPropControllers) == null ? void 0 : _a.call(handle, control == null ? null : {
|
|
3657
|
-
text: control
|
|
3658
|
-
});
|
|
3659
|
-
}, [control]);
|
|
3660
|
-
return /* @__PURE__ */ jsx(Text, {
|
|
3661
|
-
text: data,
|
|
3662
|
-
ref: textCallbackRef
|
|
3663
|
-
});
|
|
3664
|
-
}
|
|
3665
3671
|
function useWidthStyle(value, descriptor) {
|
|
3666
3672
|
return useStyle(responsiveWidth(value, descriptor.options.defaultValue));
|
|
3667
3673
|
}
|