@makeswift/runtime 0.10.12 → 0.10.14
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 +2 -2
- package/dist/Box.es.js +3 -3
- package/dist/Button.cjs.js +2 -2
- package/dist/Button.es.js +3 -3
- package/dist/Carousel.cjs.js +2 -2
- package/dist/Carousel.es.js +3 -3
- package/dist/Countdown.cjs.js +1 -1
- package/dist/Countdown.es.js +2 -2
- package/dist/Divider.cjs.js +2 -2
- package/dist/Divider.es.js +3 -3
- 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 +2 -2
- package/dist/LiveProvider.es.js +3 -3
- package/dist/Navigation.cjs.js +2 -2
- package/dist/Navigation.es.js +3 -3
- package/dist/PreviewProvider.cjs.js +2 -2
- package/dist/PreviewProvider.es.js +3 -3
- 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 +2 -2
- package/dist/SocialLinks.es.js +3 -3
- 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.cjs.js +1 -1
- package/dist/control-serialization.es.js +2 -2
- 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 +30 -11
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs2.js +37 -6
- package/dist/index.cjs2.js.map +1 -1
- package/dist/index.cjs8.js +1 -1
- package/dist/index.cjs9.js +1 -1
- package/dist/index.es.js +23 -4
- package/dist/index.es.js.map +1 -1
- package/dist/index.es2.js +38 -7
- package/dist/index.es2.js.map +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 +2 -0
- package/dist/prop-controllers.cjs.js.map +1 -1
- package/dist/prop-controllers.es.js +1 -1
- package/dist/react-page.cjs.js +139 -53
- package/dist/react-page.cjs.js.map +1 -1
- package/dist/react-page.es.js +127 -51
- 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/components/hooks/useBackgrounds.d.ts.map +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/backgrounds.d.ts +2 -2
- package/dist/types/src/prop-controllers/copy/backgrounds.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 +38 -9
- package/dist/types/src/prop-controllers/descriptors.d.ts.map +1 -1
- package/dist/types/src/prop-controllers/index.d.ts +3 -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/controls.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { a as Checkbox, C as CheckboxControlType, b as Number, N as NumberControlType } from "./number.es.js";
|
|
2
|
+
export { aK as Color, ak as ColorControlType, aj as IconRadioGroupControlType, aR as Image, ai as ImageControlType, a5 as ImageControlValueFormat, aT as Link, ah as LinkControlType, aV as List, aX as ListControl, aW as ListControlMessageType, af as ListControlType, bu as ObjectType, _ as RichText, bw as RichTextControl, bv as RichTextControlMessageType, ac as RichTextControlType, bD as RichTextV2Control, bC as RichTextV2ControlMessageType, ab as RichTextV2ControlType, bB as RichTextV2Mode, b3 as Select, al as SelectControlType, b4 as Shape, b6 as ShapeControl, b5 as ShapeControlMessageType, ag as ShapeControlType, be as Slot, bg as SlotControl, bf as SlotControlMessageType, ad as SlotControlType, bj as Style, bl as StyleControl, bk as StyleControlMessageType, a4 as StyleControlProperty, aa as StyleControlType, bq as StyleV2Control, bp as StyleV2ControlMessageType, ae as StyleV2ControlType, br as TextArea, am as TextAreaControlType, bs as TextInput, an as TextInputControlType, a9 as TypographyControlType, aM as copy, aL as copyColorData, aS as copyImageData, aU as copyLinkData, aY as copyListData, bt as copyRichTextData, b7 as copyShapeData, bh as copySlotData, bm as copyStyleData, bG as createRichTextV2Plugin, aZ as getListElementChildren, a$ as getListFileIds, b1 as getListPageIds, a_ as getListSwatchIds, b2 as getListTranslatableData, b0 as getListTypographyIds, b8 as getShapeElementChildren, bc as getShapeFileIds, bb as getShapePageIds, b9 as getShapeSwatchIds, bd as getShapeTranslatableData, ba as getShapeTypographyIds, aO as getTranslatableData, bI as getTypographySwatchIds, bJ as getTypographyTypographyIds, a7 as isRichTextV1Data, aN as merge, bi as mergeSlotData, bA as richTextDAOToDTO, by as richTextDTOtoDAO, bx as richTextDTOtoSelection, bE as richTextV2DataToDescendents, bF as richTextV2DescendentsToData, bz as toSelectionDTO, aQ as unstable_IconRadioGroup, aP as unstable_IconRadioGroupIcon, bo as unstable_StyleV2, bH as unstable_Typography, bn as unstable_useStyleV2ClassName } from "./react-page.es.js";
|
|
3
3
|
export { a as Combobox, C as ComboboxControlType } from "./combobox.es.js";
|
|
4
4
|
import "redux";
|
|
5
5
|
import "redux-thunk";
|
package/dist/index.cjs.js
CHANGED
|
@@ -41,11 +41,11 @@ var dynamic = require("next/dynamic");
|
|
|
41
41
|
var reactPage = require("./react-page.cjs.js");
|
|
42
42
|
var actions = require("./actions.cjs.js");
|
|
43
43
|
var jsxRuntime = require("react/jsx-runtime");
|
|
44
|
-
var
|
|
44
|
+
var number = require("./number.cjs.js");
|
|
45
45
|
var combobox = require("./combobox.cjs.js");
|
|
46
|
+
require("ts-pattern");
|
|
46
47
|
var uuid = require("uuid");
|
|
47
48
|
require("slate");
|
|
48
|
-
require("ts-pattern");
|
|
49
49
|
var shim = require("use-sync-external-store/shim");
|
|
50
50
|
var redux = require("redux");
|
|
51
51
|
var thunk = require("redux-thunk");
|
|
@@ -1134,6 +1134,9 @@ Received "${apiKey}" instead.`);
|
|
|
1134
1134
|
const sitemap = await response.json();
|
|
1135
1135
|
return sitemap;
|
|
1136
1136
|
}
|
|
1137
|
+
getTranslatableData(elementTree2) {
|
|
1138
|
+
return this.runtime.getTranslatableData(elementTree2);
|
|
1139
|
+
}
|
|
1137
1140
|
}
|
|
1138
1141
|
class Document$1 extends NextDocument__default["default"] {
|
|
1139
1142
|
static async getInitialProps(ctx) {
|
|
@@ -1189,7 +1192,7 @@ async function fonts(_req, res, { getFonts } = {}) {
|
|
|
1189
1192
|
const fonts2 = (_a = await (getFonts == null ? void 0 : getFonts())) != null ? _a : [];
|
|
1190
1193
|
return res.json(fonts2);
|
|
1191
1194
|
}
|
|
1192
|
-
const version = "0.10.
|
|
1195
|
+
const version = "0.10.14";
|
|
1193
1196
|
async function handler(req, res, { apiKey, siteVersions }) {
|
|
1194
1197
|
if (req.query.secret !== apiKey) {
|
|
1195
1198
|
return res.status(401).json({ message: "Unauthorized" });
|
|
@@ -1288,6 +1291,14 @@ Read more here: https://nextjs.org/blog/next-12-2#on-demand-incremental-static-r
|
|
|
1288
1291
|
return res.status(500).json({ message: "Error Revalidating" });
|
|
1289
1292
|
}
|
|
1290
1293
|
}
|
|
1294
|
+
async function translatableData(req, res, client) {
|
|
1295
|
+
const elementTree2 = req.body.elementTree;
|
|
1296
|
+
if (elementTree2 == null) {
|
|
1297
|
+
return res.status(400).json({ message: "elementTree must be defined" });
|
|
1298
|
+
}
|
|
1299
|
+
const translatableData2 = client.getTranslatableData(elementTree2);
|
|
1300
|
+
return res.json({ translatableData: translatableData2 });
|
|
1301
|
+
}
|
|
1291
1302
|
function MakeswiftApiHandler(apiKey, {
|
|
1292
1303
|
appOrigin = "https://app.makeswift.com",
|
|
1293
1304
|
apiOrigin = "https://api.makeswift.com",
|
|
@@ -1331,6 +1342,8 @@ Read more about dynamic catch-all routes here: https://nextjs.org/docs/routing/d
|
|
|
1331
1342
|
return fonts(req, res, { getFonts });
|
|
1332
1343
|
if (matches("/element-tree"))
|
|
1333
1344
|
return elementTree(req, res);
|
|
1345
|
+
if (matches("/translatable-data"))
|
|
1346
|
+
return translatableData(req, res, client);
|
|
1334
1347
|
const handleResource = (resource) => resource === null ? res.status(404).json({ message: "Not Found" }) : res.json(resource);
|
|
1335
1348
|
if (m = matches("/swatches/:id")) {
|
|
1336
1349
|
return client.getSwatch(m.params.id).then(handleResource);
|
|
@@ -3562,25 +3575,25 @@ function ControlValue({
|
|
|
3562
3575
|
control
|
|
3563
3576
|
}) {
|
|
3564
3577
|
switch (definition.type) {
|
|
3565
|
-
case
|
|
3578
|
+
case number.CheckboxControlType:
|
|
3566
3579
|
return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
|
|
3567
3580
|
hook: useCheckboxControlValue,
|
|
3568
3581
|
parameters: [data, definition],
|
|
3569
3582
|
children: (value) => children(value)
|
|
3570
3583
|
}, definition.type);
|
|
3571
|
-
case
|
|
3584
|
+
case number.NumberControlType:
|
|
3572
3585
|
return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
|
|
3573
3586
|
hook: useNumber,
|
|
3574
3587
|
parameters: [data, definition],
|
|
3575
3588
|
children: (value) => children(value)
|
|
3576
3589
|
}, definition.type);
|
|
3577
|
-
case
|
|
3590
|
+
case reactPage.TextInputControlType:
|
|
3578
3591
|
return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
|
|
3579
3592
|
hook: useTextInputValue,
|
|
3580
3593
|
parameters: [data, definition],
|
|
3581
3594
|
children: (value) => children(value)
|
|
3582
3595
|
}, definition.type);
|
|
3583
|
-
case
|
|
3596
|
+
case reactPage.TextAreaControlType:
|
|
3584
3597
|
return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
|
|
3585
3598
|
hook: useTextAreaValue,
|
|
3586
3599
|
parameters: [data, definition],
|
|
@@ -3714,10 +3727,10 @@ function PropsValue({
|
|
|
3714
3727
|
return Object.entries(propControllerDescriptorsRef.current).reduceRight((renderFn, [propName, descriptor]) => (propsValue) => {
|
|
3715
3728
|
var _a2, _b, _c, _d;
|
|
3716
3729
|
switch (descriptor.type) {
|
|
3717
|
-
case
|
|
3718
|
-
case
|
|
3719
|
-
case
|
|
3720
|
-
case
|
|
3730
|
+
case number.CheckboxControlType:
|
|
3731
|
+
case number.NumberControlType:
|
|
3732
|
+
case reactPage.TextInputControlType:
|
|
3733
|
+
case reactPage.TextAreaControlType:
|
|
3721
3734
|
case reactPage.SelectControlType:
|
|
3722
3735
|
case reactPage.ColorControlType:
|
|
3723
3736
|
case reactPage.IconRadioGroupControlType:
|
|
@@ -3985,6 +3998,9 @@ class ReactRuntime {
|
|
|
3985
3998
|
static getBreakpoints() {
|
|
3986
3999
|
return reactPage.getBreakpoints(this.store.getState());
|
|
3987
4000
|
}
|
|
4001
|
+
static getTranslatableData(elementTree2) {
|
|
4002
|
+
return reactPage.getElementTreeTranslatableData(this.store.getState(), elementTree2);
|
|
4003
|
+
}
|
|
3988
4004
|
registerComponent(component, {
|
|
3989
4005
|
type,
|
|
3990
4006
|
label,
|
|
@@ -4009,6 +4025,9 @@ class ReactRuntime {
|
|
|
4009
4025
|
getBreakpoints() {
|
|
4010
4026
|
return reactPage.getBreakpoints(this.store.getState());
|
|
4011
4027
|
}
|
|
4028
|
+
getTranslatableData(elementTree2) {
|
|
4029
|
+
return reactPage.getElementTreeTranslatableData(this.store.getState(), elementTree2);
|
|
4030
|
+
}
|
|
4012
4031
|
}
|
|
4013
4032
|
__publicField(ReactRuntime, "store", reactPage.configureStore());
|
|
4014
4033
|
registerBuiltinComponents(ReactRuntime);
|