@makeswift/runtime 0.7.4 → 0.7.5
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/Box.cjs.js +3 -0
- package/dist/Box.cjs.js.map +1 -1
- package/dist/Box.es.js +3 -0
- package/dist/Box.es.js.map +1 -1
- package/dist/EditableText.cjs.js +4 -0
- package/dist/EditableText.cjs.js.map +1 -1
- package/dist/EditableText.es.js +4 -0
- package/dist/EditableText.es.js.map +1 -1
- package/dist/Form.cjs.js +3 -0
- package/dist/Form.cjs.js.map +1 -1
- package/dist/Form.es.js +3 -0
- package/dist/Form.es.js.map +1 -1
- package/dist/PreviewProvider.cjs.js +108 -5
- package/dist/PreviewProvider.cjs.js.map +1 -1
- package/dist/PreviewProvider.es.js +122 -19
- package/dist/PreviewProvider.es.js.map +1 -1
- package/dist/actions.cjs.js +11 -1
- package/dist/actions.cjs.js.map +1 -1
- package/dist/actions.es.js +10 -2
- package/dist/actions.es.js.map +1 -1
- package/dist/index.cjs.js +19 -6
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +20 -7
- package/dist/index.es.js.map +1 -1
- package/dist/main.cjs.js +1 -0
- package/dist/main.cjs.js.map +1 -1
- package/dist/main.es.js +1 -1
- package/dist/types/src/components/builtin/Box/Box.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Form/Form.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Text/EditableText.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/next/api-handler.d.ts +1 -0
- package/dist/types/src/next/api-handler.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/element-imperative-handle.d.ts +6 -0
- package/dist/types/src/runtimes/react/element-imperative-handle.d.ts.map +1 -1
- package/dist/types/src/state/actions.d.ts +24 -1
- package/dist/types/src/state/actions.d.ts.map +1 -1
- package/dist/types/src/state/modules/element-imperative-handles.d.ts +7 -0
- package/dist/types/src/state/modules/element-imperative-handles.d.ts.map +1 -0
- package/dist/types/src/state/modules/pointer.d.ts +12 -0
- package/dist/types/src/state/modules/pointer.d.ts.map +1 -0
- package/dist/types/src/state/react-builder-preview.d.ts +7 -0
- package/dist/types/src/state/react-builder-preview.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -40,7 +40,7 @@ import { useEffect, createContext, useContext, useState, useMemo, useRef, Childr
|
|
|
40
40
|
import { useSyncExternalStoreWithSelector } from "use-sync-external-store/shim/with-selector";
|
|
41
41
|
import dynamic from "next/dynamic";
|
|
42
42
|
import { g as getPropControllerDescriptors, i as isElementReference, a as getElementSwatchIds, b as getFileIds, d as getTypographyIds, e as getTableIds, f as getPageIds, h as getElementChildren, j as createDocumentReference, M as MakeswiftComponentType, k as getBorderSwatchIds, l as isNonNullable$1, m as getBoxShadowsSwatchIds, n as getResponsiveColorSwatchIds, o as isPropControllersHandle, p as getComponentPropControllerDescriptors, q as getPropControllers, r as configureStore$1, s as getDocument, t as getElementId, u as getIsPreview, v as getIsInBuilder, w as copyElementTree, x as getReactComponent, y as getBuilderEditMode } from "./constants.es.js";
|
|
43
|
-
import { A as ActionTypes,
|
|
43
|
+
import { A as ActionTypes, j as introspectedResourcesFulfilled, k as apiResourceFulfilled, t as typographiesFulfilled, l as registerComponentHandleEffect, n as mountComponentEffect, o as registerComponentEffect, p as registerReactComponentEffect } from "./actions.es.js";
|
|
44
44
|
import { cache, cx } from "@emotion/css";
|
|
45
45
|
import { serializeStyles } from "@emotion/serialize";
|
|
46
46
|
import { registerStyles, insertStyles } from "@emotion/utils";
|
|
@@ -966,7 +966,7 @@ function useCachedSite(siteId) {
|
|
|
966
966
|
const site = useSyncExternalStore(client.subscribe, getSnapshot, getSnapshot);
|
|
967
967
|
return site;
|
|
968
968
|
}
|
|
969
|
-
const version = "0.7.
|
|
969
|
+
const version = "0.7.5";
|
|
970
970
|
class Makeswift {
|
|
971
971
|
constructor(apiKey, { apiOrigin = "https://api.makeswift.com" } = {}) {
|
|
972
972
|
__publicField(this, "apiKey");
|
|
@@ -1349,7 +1349,8 @@ Read more about dynamic catch-all routes here: https://nextjs.org/docs/routing/d
|
|
|
1349
1349
|
version,
|
|
1350
1350
|
previewMode: true,
|
|
1351
1351
|
interactionMode: true,
|
|
1352
|
-
clientSideNavigation: true
|
|
1352
|
+
clientSideNavigation: true,
|
|
1353
|
+
elementFromPoint: true
|
|
1353
1354
|
});
|
|
1354
1355
|
}
|
|
1355
1356
|
case "revalidate": {
|
|
@@ -3495,7 +3496,7 @@ function useSlot(data, control) {
|
|
|
3495
3496
|
control,
|
|
3496
3497
|
grid: data.columns,
|
|
3497
3498
|
index: i,
|
|
3498
|
-
children: /* @__PURE__ */ jsx(Element, {
|
|
3499
|
+
children: /* @__PURE__ */ jsx(Element$1, {
|
|
3499
3500
|
element
|
|
3500
3501
|
})
|
|
3501
3502
|
}, element.key))
|
|
@@ -3882,6 +3883,18 @@ class ElementImperativeHandle {
|
|
|
3882
3883
|
current.setPropControllers(propControllers);
|
|
3883
3884
|
this.lastPropControllers = propControllers;
|
|
3884
3885
|
}
|
|
3886
|
+
getDomNode() {
|
|
3887
|
+
const current = this.getCurrent();
|
|
3888
|
+
if (isDomNodeHandle(current))
|
|
3889
|
+
return current.getDomNode();
|
|
3890
|
+
return current instanceof Element ? current : null;
|
|
3891
|
+
}
|
|
3892
|
+
}
|
|
3893
|
+
function isDomNodeHandle(value) {
|
|
3894
|
+
if (typeof value === "object" && value !== null && "getDomNode" in value && typeof value.getDomNode === "function") {
|
|
3895
|
+
return true;
|
|
3896
|
+
}
|
|
3897
|
+
return false;
|
|
3885
3898
|
}
|
|
3886
3899
|
const storeContextDefaultValue = configureStore$1();
|
|
3887
3900
|
function createReactRuntime(store) {
|
|
@@ -4046,7 +4059,7 @@ const ElementReference = memo(forwardRef(function ElementReference2({
|
|
|
4046
4059
|
})
|
|
4047
4060
|
});
|
|
4048
4061
|
}));
|
|
4049
|
-
const Element = memo(forwardRef(function Element2({
|
|
4062
|
+
const Element$1 = memo(forwardRef(function Element2({
|
|
4050
4063
|
element
|
|
4051
4064
|
}, ref) {
|
|
4052
4065
|
const elementKey = element.key;
|
|
@@ -4094,7 +4107,7 @@ const Document = memo(forwardRef(function Document2({
|
|
|
4094
4107
|
}, ref) {
|
|
4095
4108
|
return /* @__PURE__ */ jsx(DocumentContext.Provider, {
|
|
4096
4109
|
value: document2.key,
|
|
4097
|
-
children: /* @__PURE__ */ jsx(Element, {
|
|
4110
|
+
children: /* @__PURE__ */ jsx(Element$1, {
|
|
4098
4111
|
ref,
|
|
4099
4112
|
element: document2.rootElement
|
|
4100
4113
|
})
|
|
@@ -4115,5 +4128,5 @@ const DocumentReference = memo(forwardRef(function DocumentReference2({
|
|
|
4115
4128
|
document: document2
|
|
4116
4129
|
});
|
|
4117
4130
|
}));
|
|
4118
|
-
export { getServerSideProps as $, Alignments as A, useFile as B, Contrasts as C, DocumentReference as D, Element as E, DEVICES as F, findDeviceOverride as G, forwardNextDynamicRef as H, useIsPreview as I, useFiles as J, useSwatches as K, usePagePathnameSlice as L, useElementId as M, deepEqual as N, storeContextDefaultValue as O, PageProvider as P, StoreContext as Q, RuntimeProvider as R, Shapes as S, MakeswiftProvider as T, useBuilderEditMode as U, pollBoxModel as V, useTypography as W, shallowMergeFallbacks as X, MakeswiftClient as Y, getStaticPaths as Z, getStaticProps as _, ReactRuntime as a, Page as a0, Makeswift as a1, PreviewModeScript as a2, Document$1 as a3, MakeswiftApiHandler as a4, usePageId as b, DEFAULT_BOX_ANIMATE_TYPE as c, DEFAULT_BOX_ANIMATE_DELAY as d, DEFAULT_BOX_ANIMATE_DURATION as e, DEFAULT_ITEM_ANIMATE_TYPE as f, DEFAULT_ITEM_ANIMATE_DELAY as g, DEFAULT_ITEM_ANIMATE_DURATION as h, DEFAULT_ITEM_STAGGER_DURATION as i, useBorder as j, useBoxShadow as k, useResponsiveColor as l, useMediaQuery as m, Page$1 as n, useStyle as o, responsiveWidth as p, responsiveTextStyle as q, responsiveStyle as r, colorToString as s, Sizes as t, useIsInBuilder as u, useFormContext as v, responsiveGridItem as w, useTable as x, useMakeswiftClient as y, Provider as z };
|
|
4131
|
+
export { getServerSideProps as $, Alignments as A, useFile as B, Contrasts as C, DocumentReference as D, Element$1 as E, DEVICES as F, findDeviceOverride as G, forwardNextDynamicRef as H, useIsPreview as I, useFiles as J, useSwatches as K, usePagePathnameSlice as L, useElementId as M, deepEqual as N, storeContextDefaultValue as O, PageProvider as P, StoreContext as Q, RuntimeProvider as R, Shapes as S, MakeswiftProvider as T, useBuilderEditMode as U, pollBoxModel as V, useTypography as W, shallowMergeFallbacks as X, MakeswiftClient as Y, getStaticPaths as Z, getStaticProps as _, ReactRuntime as a, Page as a0, Makeswift as a1, PreviewModeScript as a2, Document$1 as a3, MakeswiftApiHandler as a4, usePageId as b, DEFAULT_BOX_ANIMATE_TYPE as c, DEFAULT_BOX_ANIMATE_DELAY as d, DEFAULT_BOX_ANIMATE_DURATION as e, DEFAULT_ITEM_ANIMATE_TYPE as f, DEFAULT_ITEM_ANIMATE_DELAY as g, DEFAULT_ITEM_ANIMATE_DURATION as h, DEFAULT_ITEM_STAGGER_DURATION as i, useBorder as j, useBoxShadow as k, useResponsiveColor as l, useMediaQuery as m, Page$1 as n, useStyle as o, responsiveWidth as p, responsiveTextStyle as q, responsiveStyle as r, colorToString as s, Sizes as t, useIsInBuilder as u, useFormContext as v, responsiveGridItem as w, useTable as x, useMakeswiftClient as y, Provider as z };
|
|
4119
4132
|
//# sourceMappingURL=index.es.js.map
|