@makeswift/runtime 0.10.13 → 0.10.15
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.es.js +1 -1
- package/dist/Divider.cjs.js +1 -1
- package/dist/Divider.es.js +2 -2
- package/dist/Embed.es.js +1 -1
- package/dist/Form.es.js +1 -1
- package/dist/Image.es.js +1 -1
- 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.es.js +1 -1
- package/dist/ReadOnlyTextV2.es.js +1 -1
- package/dist/Root.es.js +1 -1
- package/dist/SocialLinks.cjs.js +1 -1
- package/dist/SocialLinks.es.js +2 -2
- package/dist/Video.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 +1 -1
- package/dist/controls.es.js +1 -1
- package/dist/index.cjs.js +18 -12
- 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.es.js +19 -13
- 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 +1 -1
- package/dist/index.es9.js +1 -1
- 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 +55 -42
- package/dist/react-page.cjs.js.map +1 -1
- package/dist/react-page.es.js +54 -42
- package/dist/react-page.es.js.map +1 -1
- package/dist/slate.es.js +1 -1
- package/dist/toText.es.js +1 -1
- package/dist/types/src/components/hooks/useBackgrounds.d.ts.map +1 -1
- package/dist/types/src/controls/image.d.ts +16 -1
- package/dist/types/src/controls/image.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/descriptors.d.ts +22 -5
- 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/controls/image.d.ts.map +1 -1
- package/dist/types/types/locale.d.ts +1 -1
- package/package.json +1 -1
package/dist/react-page.es.js
CHANGED
|
@@ -566,7 +566,7 @@ const Types = {
|
|
|
566
566
|
Style: StyleControlType
|
|
567
567
|
};
|
|
568
568
|
function Backgrounds(options = {}) {
|
|
569
|
-
return { type: Types.Backgrounds, options };
|
|
569
|
+
return { type: Types.Backgrounds, version: 1, options };
|
|
570
570
|
}
|
|
571
571
|
const BorderPropControllerFormat = {
|
|
572
572
|
ClassName: "makeswift::prop-controllers::border::format::class-name",
|
|
@@ -807,14 +807,19 @@ const ImageControlValueFormat = {
|
|
|
807
807
|
WithDimensions: "makeswift::controls::image::format::with-dimensions"
|
|
808
808
|
};
|
|
809
809
|
function Image(config = {}) {
|
|
810
|
-
return { type: ImageControlType, config };
|
|
810
|
+
return { type: ImageControlType, config, version: 1 };
|
|
811
811
|
}
|
|
812
812
|
Image.Format = ImageControlValueFormat;
|
|
813
813
|
function copyImageData(value, context) {
|
|
814
|
-
var _a;
|
|
815
814
|
if (value == null)
|
|
816
815
|
return value;
|
|
817
|
-
return (
|
|
816
|
+
return match(value).with(P.string, (id) => {
|
|
817
|
+
var _a;
|
|
818
|
+
return (_a = context.replacementContext.fileIds.get(id)) != null ? _a : id;
|
|
819
|
+
}).with({ type: "makeswift-file" }, ({ id }) => {
|
|
820
|
+
var _a;
|
|
821
|
+
return (_a = context.replacementContext.fileIds.get(id)) != null ? _a : id;
|
|
822
|
+
}).otherwise((val) => val);
|
|
818
823
|
}
|
|
819
824
|
if (import_meta.vitest) {
|
|
820
825
|
const { describe, test, expect } = import_meta.vitest;
|
|
@@ -1221,41 +1226,51 @@ function mergeSlotData(base = { columns: [], elements: [] }, override = { column
|
|
|
1221
1226
|
});
|
|
1222
1227
|
return { columns: mergedColumns, elements: mergedElements };
|
|
1223
1228
|
}
|
|
1224
|
-
function copy$e(value, context) {
|
|
1229
|
+
function copy$e(descriptor, value, context) {
|
|
1225
1230
|
if (value == null)
|
|
1226
1231
|
return value;
|
|
1227
1232
|
return value.map((override) => __spreadProps(__spreadValues({}, override), {
|
|
1228
1233
|
value: override.value.map((backgroundItem) => {
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
});
|
|
1247
|
-
})
|
|
1234
|
+
return match([descriptor, backgroundItem]).with([P.any, { type: "color" }], ([, item]) => {
|
|
1235
|
+
var _a;
|
|
1236
|
+
return __spreadProps(__spreadValues({}, item), {
|
|
1237
|
+
payload: item.payload === null ? null : __spreadProps(__spreadValues({}, item.payload), {
|
|
1238
|
+
swatchId: (_a = context.replacementContext.swatchIds.get(item.payload.swatchId)) != null ? _a : item.payload.swatchId
|
|
1239
|
+
})
|
|
1240
|
+
});
|
|
1241
|
+
}).with([P.any, { type: "gradient" }], ([, item]) => {
|
|
1242
|
+
return __spreadProps(__spreadValues({}, item), {
|
|
1243
|
+
payload: __spreadProps(__spreadValues({}, item.payload), {
|
|
1244
|
+
stops: item.payload.stops.map((stop) => {
|
|
1245
|
+
var _a;
|
|
1246
|
+
return __spreadProps(__spreadValues({}, stop), {
|
|
1247
|
+
color: stop.color == null ? null : __spreadProps(__spreadValues({}, stop.color), {
|
|
1248
|
+
swatchId: (_a = context.replacementContext.swatchIds.get(stop.color.swatchId)) != null ? _a : stop.color.swatchId
|
|
1249
|
+
})
|
|
1250
|
+
});
|
|
1248
1251
|
})
|
|
1249
|
-
})
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1252
|
+
})
|
|
1253
|
+
});
|
|
1254
|
+
}).with([
|
|
1255
|
+
{ version: 1 },
|
|
1256
|
+
{ type: "image-v1", version: 1, payload: { image: { type: "makeswift-file" } } }
|
|
1257
|
+
], ([, item]) => {
|
|
1258
|
+
var _a;
|
|
1259
|
+
return __spreadProps(__spreadValues({}, item), {
|
|
1260
|
+
payload: __spreadProps(__spreadValues({}, item.payload), {
|
|
1261
|
+
image: __spreadProps(__spreadValues({}, item.payload.image), {
|
|
1262
|
+
id: (_a = context.replacementContext.fileIds.get(item.payload.image.id)) != null ? _a : item.payload.image.id
|
|
1254
1263
|
})
|
|
1255
|
-
})
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1264
|
+
})
|
|
1265
|
+
});
|
|
1266
|
+
}).with([P.any, { type: "image", payload: { imageId: P.string } }], ([, item]) => {
|
|
1267
|
+
var _a;
|
|
1268
|
+
return __spreadProps(__spreadValues({}, item), {
|
|
1269
|
+
payload: __spreadProps(__spreadValues({}, item.payload), {
|
|
1270
|
+
imageId: (_a = context.replacementContext.fileIds.get(item.payload.imageId)) != null ? _a : item.payload.imageId
|
|
1271
|
+
})
|
|
1272
|
+
});
|
|
1273
|
+
}).otherwise(() => backgroundItem);
|
|
1259
1274
|
})
|
|
1260
1275
|
}));
|
|
1261
1276
|
}
|
|
@@ -1947,7 +1962,7 @@ function copy$2(value, context) {
|
|
|
1947
1962
|
function copy$1(descriptor, value, context) {
|
|
1948
1963
|
switch (descriptor.type) {
|
|
1949
1964
|
case "Backgrounds":
|
|
1950
|
-
return copy$e(value, context);
|
|
1965
|
+
return copy$e(descriptor, value, context);
|
|
1951
1966
|
case "Grid":
|
|
1952
1967
|
return copy$d(value, context);
|
|
1953
1968
|
case "NavigationLinks":
|
|
@@ -4343,12 +4358,9 @@ function getSwatchIds(descriptor, prop) {
|
|
|
4343
4358
|
function getBackgroundsFileIds(value) {
|
|
4344
4359
|
var _a;
|
|
4345
4360
|
return (_a = value == null ? void 0 : value.flatMap((override) => override.value).flatMap((backgroundItem) => {
|
|
4346
|
-
|
|
4347
|
-
|
|
4348
|
-
|
|
4349
|
-
default:
|
|
4350
|
-
return [];
|
|
4351
|
-
}
|
|
4361
|
+
return match(backgroundItem).with({ type: "image-v1", payload: { image: { type: "makeswift-file" } } }, (item) => [
|
|
4362
|
+
item.payload.image.id
|
|
4363
|
+
]).with({ type: "image", payload: { imageId: P.string } }, (item) => [item.payload.imageId]).otherwise(() => []);
|
|
4352
4364
|
})) != null ? _a : [];
|
|
4353
4365
|
}
|
|
4354
4366
|
function getFileIds(descriptor, prop) {
|
|
@@ -4367,7 +4379,7 @@ function getFileIds(descriptor, prop) {
|
|
|
4367
4379
|
}
|
|
4368
4380
|
case ImageControlType: {
|
|
4369
4381
|
const value = prop;
|
|
4370
|
-
return value
|
|
4382
|
+
return match(value).with(P.string, (f) => [f]).with({ type: "makeswift-file" }, (f) => [f.id]).with({ type: "external-file" }, () => []).otherwise(() => []);
|
|
4371
4383
|
}
|
|
4372
4384
|
case ShapeControlType: {
|
|
4373
4385
|
return getShapeFileIds(descriptor, prop);
|
|
@@ -4734,5 +4746,5 @@ function configureStore({
|
|
|
4734
4746
|
locales: getInitialState(locales != null ? locales : preloadedState == null ? void 0 : preloadedState.locales)
|
|
4735
4747
|
}), applyMiddleware(thunk));
|
|
4736
4748
|
}
|
|
4737
|
-
export {
|
|
4749
|
+
export { Video as $, TextInput$1 as A, Backgrounds as B, ComponentIcon as C, ResponsiveColor as D, ElementID as E, TextStyle as F, GapY as G, Date as H, Images as I, Font as J, ResponsiveLength as K, Link$1 as L, Margin as M, Number as N, TextArea$1 as O, Padding as P, Table as Q, RichTextPropControllerMessageType as R, Shadows as S, TableFormFieldsMessageType as T, TableFormFields as U, Image$1 as V, Width as W, ResponsiveOpacity as X, NavigationLinks as Y, SocialLinks as Z, RichText as _, copy$9 as a, getListFileIds as a$, useStyle as a0, getBorderSwatchIds as a1, getBoxShadowsSwatchIds as a2, getResponsiveColorSwatchIds as a3, StyleControlProperty as a4, ImageControlValueFormat as a5, isPropControllersHandle as a6, isRichTextV1Data as a7, isNonNullable as a8, TypographyControlType as a9, getElementTreeTranslatableData as aA, parseLocalesInput as aB, getDocument as aC, getElementId as aD, getIsInBuilder as aE, getReactComponent as aF, getBuilderEditMode as aG, getIsPreview as aH, getBackgroundsFileIds as aI, getBackgroundsSwatchIds as aJ, Color as aK, copyColorData as aL, copy as aM, merge as aN, getTranslatableData as aO, unstable_IconRadioGroupIcon as aP, unstable_IconRadioGroup as aQ, Image as aR, copyImageData as aS, Link as aT, copyLinkData as aU, List as aV, ListControlMessageType as aW, ListControl as aX, copyListData as aY, getListElementChildren as aZ, getListSwatchIds as a_, StyleControlType as aa, RichTextV2ControlType as ab, RichTextControlType as ac, SlotControlType as ad, StyleV2ControlType as ae, ListControlType as af, ShapeControlType as ag, LinkControlType as ah, ImageControlType as ai, IconRadioGroupControlType as aj, ColorControlType as ak, SelectControlType as al, TextAreaControlType as am, TextInputControlType as an, getComponentPropControllerDescriptors as ao, getPropControllers as ap, Types as aq, BorderPropControllerFormat as ar, ShadowsPropControllerFormat as as, BorderRadiusPropControllerFormat as at, MarginPropControllerFormat as au, PaddingPropControllerFormat as av, WidthPropControllerFormat as aw, configureStore as ax, copyElementTree as ay, getBreakpoints as az, copy$8 as b, withInline as b$, getListTypographyIds as b0, getListPageIds as b1, getListTranslatableData as b2, Select as b3, Shape as b4, ShapeControlMessageType as b5, ShapeControl as b6, copyShapeData as b7, getShapeElementChildren as b8, getShapeSwatchIds as b9, richTextDAOToDTO as bA, RichTextV2Mode as bB, RichTextV2ControlMessageType as bC, RichTextV2Control as bD, richTextV2DataToDescendents as bE, richTextV2DescendentsToData as bF, createRichTextV2Plugin as bG, unstable_Typography as bH, getTypographySwatchIds as bI, getTypographyTypographyIds as bJ, TypographyActions as bK, TYPOGRAPHY_KEY as bL, withTypography as bM, TypographyPlugin as bN, BlockActions as bO, ListActions as bP, onKeyDown as bQ, withBlock as bR, BlockPlugin as bS, withInlineMode as bT, InlineModePlugin as bU, withTextAlign as bV, TextAlignPlugin as bW, RootBlockType as bX, BlockType as bY, InlineType as bZ, BlockTextAlignment as b_, getShapeTypographyIds as ba, getShapePageIds as bb, getShapeFileIds as bc, getShapeTranslatableData as bd, Slot as be, SlotControlMessageType as bf, SlotControl as bg, copySlotData as bh, mergeSlotData as bi, Style as bj, StyleControlMessageType as bk, StyleControl as bl, copyStyleData as bm, unstable_useStyleV2ClassName as bn, unstable_StyleV2 as bo, StyleV2ControlMessageType as bp, StyleV2Control as bq, TextArea as br, TextInput as bs, copyRichTextData as bt, ObjectType as bu, RichTextControlMessageType as bv, RichTextControl as bw, richTextDTOtoSelection as bx, richTextDTOtoDAO as by, toSelectionDTO as bz, createDocument as c, InlinePlugin as c0, ElementUtils as c1, onChange$1 as c2, getValue$3 as c3, isLinkElement as c4, getInitialState$7 as c5, reducer$8 as c6, getDocument$1 as c7, getComponentsMeta as c8, getComponentPropControllerDescriptors$1 as c9, BuilderEditMode as ca, getDocumentKeysSortedByDepth as cb, getPropController as cc, getPropControllersHandle as cd, getElement as ce, getElementPropControllerDescriptors as cf, createPropController as cg, reducer$7 as ch, reducer$9 as ci, reducer$6 as cj, reducer$5 as ck, reducer$4 as cl, reducer$3 as cm, reducer$2 as cn, reducer$1 as co, getInitialState$2 as cp, descriptors as d, copy$e as e, deepEqual as f, createDocumentReference as g, getPropControllerDescriptors as h, introspection as i, isElementReference as j, getDefaultLocale as k, getLocales as l, getSwatchIds as m, getFileIds as n, getTypographyIds as o, getTableIds as p, getPageIds as q, getElementChildren as r, ResponsiveIconRadioGroup as s, Border as t, BorderRadius as u, GapX as v, ResponsiveSelect as w, ResponsiveNumber as x, Checkbox as y, Grid as z };
|
|
4738
4750
|
//# sourceMappingURL=react-page.es.js.map
|