@makeswift/runtime 0.10.12 → 0.10.13
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 +1 -1
- package/dist/Box.es.js +2 -2
- package/dist/Button.cjs.js +1 -1
- package/dist/Button.es.js +2 -2
- package/dist/Carousel.cjs.js +1 -1
- package/dist/Carousel.es.js +2 -2
- package/dist/Countdown.cjs.js +1 -1
- package/dist/Countdown.es.js +2 -2
- package/dist/Divider.cjs.js +1 -1
- package/dist/Divider.es.js +2 -2
- package/dist/Embed.es.js +1 -1
- package/dist/Form.cjs.js +1 -1
- package/dist/Form.es.js +2 -2
- package/dist/Image.cjs.js +1 -1
- package/dist/Image.es.js +2 -2
- package/dist/LiveProvider.cjs.js +1 -1
- package/dist/LiveProvider.es.js +2 -2
- package/dist/Navigation.cjs.js +1 -1
- package/dist/Navigation.es.js +2 -2
- package/dist/PreviewProvider.cjs.js +1 -1
- package/dist/PreviewProvider.es.js +2 -2
- package/dist/ReadOnlyText.cjs.js +1 -1
- package/dist/ReadOnlyText.es.js +2 -2
- package/dist/ReadOnlyTextV2.cjs.js +1 -1
- package/dist/ReadOnlyTextV2.es.js +2 -2
- package/dist/Root.cjs.js +1 -1
- package/dist/Root.es.js +2 -2
- package/dist/SocialLinks.cjs.js +1 -1
- package/dist/SocialLinks.es.js +2 -2
- package/dist/Video.es.js +1 -1
- package/dist/components.cjs.js +1 -1
- package/dist/components.es.js +1 -1
- package/dist/control-serialization.es.js +1 -1
- package/dist/controls.cjs.js +13 -10
- package/dist/controls.cjs.js.map +1 -1
- package/dist/controls.es.js +2 -2
- package/dist/index.cjs.js +29 -10
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs8.js +1 -1
- package/dist/index.cjs9.js +1 -1
- package/dist/index.es.js +22 -3
- package/dist/index.es.js.map +1 -1
- package/dist/index.es2.js +1 -1
- package/dist/index.es4.js +1 -1
- package/dist/index.es5.js +1 -1
- package/dist/index.es6.js +1 -1
- package/dist/index.es8.js +2 -2
- package/dist/index.es9.js +2 -2
- package/dist/next.cjs.js +1 -1
- package/dist/next.es.js +1 -1
- package/dist/number.cjs.js +14 -0
- package/dist/number.cjs.js.map +1 -0
- package/dist/number.es.js +10 -0
- package/dist/number.es.js.map +1 -0
- package/dist/prop-controllers.cjs.js +1 -0
- package/dist/prop-controllers.cjs.js.map +1 -1
- package/dist/prop-controllers.es.js +1 -1
- package/dist/react-page.cjs.js +94 -16
- package/dist/react-page.cjs.js.map +1 -1
- package/dist/react-page.es.js +83 -14
- package/dist/react-page.es.js.map +1 -1
- package/dist/react.cjs.js +1 -1
- package/dist/react.es.js +1 -1
- package/dist/slate.cjs.js +1 -1
- package/dist/slate.es.js +2 -2
- package/dist/toText.es.js +1 -1
- package/dist/types/src/controls/control.d.ts +1 -0
- package/dist/types/src/controls/control.d.ts.map +1 -1
- package/dist/types/src/controls/list.d.ts +3 -0
- package/dist/types/src/controls/list.d.ts.map +1 -1
- package/dist/types/src/controls/shape.d.ts +3 -0
- package/dist/types/src/controls/shape.d.ts.map +1 -1
- package/dist/types/src/next/api-handler/handlers/translatable-data.d.ts +13 -0
- package/dist/types/src/next/api-handler/handlers/translatable-data.d.ts.map +1 -0
- package/dist/types/src/next/api-handler/index.d.ts +2 -1
- package/dist/types/src/next/api-handler/index.d.ts.map +1 -1
- package/dist/types/src/next/client.d.ts +2 -1
- package/dist/types/src/next/client.d.ts.map +1 -1
- package/dist/types/src/prop-controllers/copy/images.d.ts +2 -2
- package/dist/types/src/prop-controllers/copy/images.d.ts.map +1 -1
- package/dist/types/src/prop-controllers/descriptors.d.ts +16 -4
- package/dist/types/src/prop-controllers/descriptors.d.ts.map +1 -1
- package/dist/types/src/prop-controllers/index.d.ts +2 -1
- package/dist/types/src/prop-controllers/index.d.ts.map +1 -1
- package/dist/types/src/prop-controllers/introspection.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/index.d.ts +2 -0
- package/dist/types/src/runtimes/react/index.d.ts.map +1 -1
- package/dist/types/src/state/react-page.d.ts +1 -0
- package/dist/types/src/state/react-page.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/text-input.cjs.js +0 -26
- package/dist/text-input.cjs.js.map +0 -1
- package/dist/text-input.es.js +0 -18
- package/dist/text-input.es.js.map +0 -1
package/dist/index.cjs8.js
CHANGED
|
@@ -49,7 +49,7 @@ require("./actions.cjs.js");
|
|
|
49
49
|
var useIsomorphicLayoutEffect = require("./useIsomorphicLayoutEffect.cjs.js");
|
|
50
50
|
require("use-sync-external-store/shim/with-selector");
|
|
51
51
|
require("next/dynamic");
|
|
52
|
-
require("./
|
|
52
|
+
require("./number.cjs.js");
|
|
53
53
|
require("./combobox.cjs.js");
|
|
54
54
|
require("use-sync-external-store/shim");
|
|
55
55
|
require("redux");
|
package/dist/index.cjs9.js
CHANGED
|
@@ -55,7 +55,7 @@ require("@emotion/serialize");
|
|
|
55
55
|
require("@emotion/utils");
|
|
56
56
|
require("use-sync-external-store/shim/with-selector");
|
|
57
57
|
require("next/dynamic");
|
|
58
|
-
require("./
|
|
58
|
+
require("./number.cjs.js");
|
|
59
59
|
require("./combobox.cjs.js");
|
|
60
60
|
require("use-sync-external-store/shim");
|
|
61
61
|
require("./types.cjs.js");
|
package/dist/index.es.js
CHANGED
|
@@ -38,10 +38,10 @@ import * as React from "react";
|
|
|
38
38
|
import { useEffect, createContext, useContext, useState, useMemo, useRef, Children, createElement, forwardRef, memo, useId, useCallback, useImperativeHandle, Component, Suspense } from "react";
|
|
39
39
|
import { useSyncExternalStoreWithSelector } from "use-sync-external-store/shim/with-selector";
|
|
40
40
|
import dynamic from "next/dynamic";
|
|
41
|
-
import {
|
|
41
|
+
import { e as deepEqual, f as createDocumentReference, g as getPropControllerDescriptors, h as isElementReference, j as getDefaultLocale, k as getLocales, l as getSwatchIds, m as getFileIds, n as getTypographyIds, o as getTableIds, p as getPageIds, q as getElementChildren, E as ElementID, B as Backgrounds, W as Width, r as ResponsiveIconRadioGroup, M as Margin, P as Padding, s as Border, t as BorderRadius, S as Shadows, G as GapY, u as GapX, v as ResponsiveSelect, w as ResponsiveNumber, x as Checkbox, y as Grid, z as TextInput, L as Link, A as ResponsiveColor, D as TextStyle, C as ComponentIcon, I as Images, N as Number$1, F as Date$1, H as Font, J as ResponsiveLength, K as TextArea, O as Table, Q as TableFormFields, U as Image, V as ResponsiveOpacity, X as NavigationLinks, Y as SocialLinks, Z as RichText, _ as Video, $ as useStyle, a0 as getBorderSwatchIds, a1 as getBoxShadowsSwatchIds, a2 as getResponsiveColorSwatchIds, a3 as StyleControlProperty, a4 as ImageControlValueFormat, a5 as isPropControllersHandle, a6 as isRichTextV1Data, a7 as isNonNullable$1, a8 as TypographyControlType, a9 as StyleControlType, aa as RichTextV2ControlType, ab as RichTextControlType, ac as SlotControlType, ad as StyleV2ControlType, ae as ListControlType, af as ShapeControlType, ag as LinkControlType, ah as ImageControlType, ai as IconRadioGroupControlType, aj as ColorControlType, ak as SelectControlType, al as TextAreaControlType, am as TextInputControlType, an as getComponentPropControllerDescriptors, ao as getPropControllers, ap as Types, aq as BorderPropControllerFormat, ar as ShadowsPropControllerFormat, as as BorderRadiusPropControllerFormat, at as MarginPropControllerFormat, au as PaddingPropControllerFormat, av as WidthPropControllerFormat, aw as configureStore$1, ax as copyElementTree, ay as getBreakpoints, az as getElementTreeTranslatableData, aA as parseLocalesInput, aB as getDocument, aC as getElementId, aD as getIsInBuilder, aE as getReactComponent, aF as getBuilderEditMode, aG as getIsPreview } from "./react-page.es.js";
|
|
42
42
|
import { A as ActionTypes, o as apiResourceFulfilled, p as registerComponentEffect, q as registerReactComponentEffect, t as registerComponentHandleEffect, v as mountComponentEffect } from "./actions.es.js";
|
|
43
43
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
44
|
-
import {
|
|
44
|
+
import { N as NumberControlType, C as CheckboxControlType } from "./number.es.js";
|
|
45
45
|
import { C as ComboboxControlType } from "./combobox.es.js";
|
|
46
46
|
import { v4 } from "uuid";
|
|
47
47
|
import "slate";
|
|
@@ -1101,6 +1101,9 @@ Received "${apiKey}" instead.`);
|
|
|
1101
1101
|
const sitemap = await response.json();
|
|
1102
1102
|
return sitemap;
|
|
1103
1103
|
}
|
|
1104
|
+
getTranslatableData(elementTree2) {
|
|
1105
|
+
return this.runtime.getTranslatableData(elementTree2);
|
|
1106
|
+
}
|
|
1104
1107
|
}
|
|
1105
1108
|
class Document$1 extends NextDocument {
|
|
1106
1109
|
static async getInitialProps(ctx) {
|
|
@@ -1156,7 +1159,7 @@ async function fonts(_req, res, { getFonts } = {}) {
|
|
|
1156
1159
|
const fonts2 = (_a = await (getFonts == null ? void 0 : getFonts())) != null ? _a : [];
|
|
1157
1160
|
return res.json(fonts2);
|
|
1158
1161
|
}
|
|
1159
|
-
const version = "0.10.
|
|
1162
|
+
const version = "0.10.13";
|
|
1160
1163
|
async function handler(req, res, { apiKey, siteVersions }) {
|
|
1161
1164
|
if (req.query.secret !== apiKey) {
|
|
1162
1165
|
return res.status(401).json({ message: "Unauthorized" });
|
|
@@ -1255,6 +1258,14 @@ Read more here: https://nextjs.org/blog/next-12-2#on-demand-incremental-static-r
|
|
|
1255
1258
|
return res.status(500).json({ message: "Error Revalidating" });
|
|
1256
1259
|
}
|
|
1257
1260
|
}
|
|
1261
|
+
async function translatableData(req, res, client) {
|
|
1262
|
+
const elementTree2 = req.body.elementTree;
|
|
1263
|
+
if (elementTree2 == null) {
|
|
1264
|
+
return res.status(400).json({ message: "elementTree must be defined" });
|
|
1265
|
+
}
|
|
1266
|
+
const translatableData2 = client.getTranslatableData(elementTree2);
|
|
1267
|
+
return res.json({ translatableData: translatableData2 });
|
|
1268
|
+
}
|
|
1258
1269
|
function MakeswiftApiHandler(apiKey, {
|
|
1259
1270
|
appOrigin = "https://app.makeswift.com",
|
|
1260
1271
|
apiOrigin = "https://api.makeswift.com",
|
|
@@ -1298,6 +1309,8 @@ Read more about dynamic catch-all routes here: https://nextjs.org/docs/routing/d
|
|
|
1298
1309
|
return fonts(req, res, { getFonts });
|
|
1299
1310
|
if (matches("/element-tree"))
|
|
1300
1311
|
return elementTree(req, res);
|
|
1312
|
+
if (matches("/translatable-data"))
|
|
1313
|
+
return translatableData(req, res, client);
|
|
1301
1314
|
const handleResource = (resource) => resource === null ? res.status(404).json({ message: "Not Found" }) : res.json(resource);
|
|
1302
1315
|
if (m = matches("/swatches/:id")) {
|
|
1303
1316
|
return client.getSwatch(m.params.id).then(handleResource);
|
|
@@ -3916,6 +3929,9 @@ class ReactRuntime {
|
|
|
3916
3929
|
static getBreakpoints() {
|
|
3917
3930
|
return getBreakpoints(this.store.getState());
|
|
3918
3931
|
}
|
|
3932
|
+
static getTranslatableData(elementTree2) {
|
|
3933
|
+
return getElementTreeTranslatableData(this.store.getState(), elementTree2);
|
|
3934
|
+
}
|
|
3919
3935
|
registerComponent(component, {
|
|
3920
3936
|
type,
|
|
3921
3937
|
label,
|
|
@@ -3940,6 +3956,9 @@ class ReactRuntime {
|
|
|
3940
3956
|
getBreakpoints() {
|
|
3941
3957
|
return getBreakpoints(this.store.getState());
|
|
3942
3958
|
}
|
|
3959
|
+
getTranslatableData(elementTree2) {
|
|
3960
|
+
return getElementTreeTranslatableData(this.store.getState(), elementTree2);
|
|
3961
|
+
}
|
|
3943
3962
|
}
|
|
3944
3963
|
__publicField(ReactRuntime, "store", configureStore$1());
|
|
3945
3964
|
registerBuiltinComponents(ReactRuntime);
|