@makeswift/runtime 0.9.9 → 0.9.10
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/PreviewProvider.es.js +2 -2
- package/dist/ReadOnlyText.es.js +1 -1
- package/dist/ReadOnlyTextV2.cjs.js +3 -1
- package/dist/ReadOnlyTextV2.cjs.js.map +1 -1
- package/dist/ReadOnlyTextV2.es.js +4 -2
- package/dist/ReadOnlyTextV2.es.js.map +1 -1
- package/dist/api.cjs.js +19 -0
- package/dist/api.cjs.js.map +1 -1
- package/dist/api.es.js +19 -0
- package/dist/api.es.js.map +1 -1
- package/dist/controls.cjs.js +2 -0
- package/dist/controls.cjs.js.map +1 -1
- package/dist/controls.es.js +1 -1
- package/dist/index.cjs.js +119 -28
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs10.js +6 -2
- package/dist/index.cjs10.js.map +1 -1
- package/dist/index.cjs5.js +30 -75
- package/dist/index.cjs5.js.map +1 -1
- package/dist/index.cjs9.js +4 -1
- package/dist/index.cjs9.js.map +1 -1
- package/dist/index.es.js +120 -29
- package/dist/index.es.js.map +1 -1
- package/dist/index.es10.js +8 -4
- package/dist/index.es10.js.map +1 -1
- package/dist/index.es5.js +31 -73
- package/dist/index.es5.js.map +1 -1
- package/dist/index.es6.js +1 -1
- package/dist/index.es9.js +5 -2
- package/dist/index.es9.js.map +1 -1
- package/dist/react-page.cjs.js +37 -17
- package/dist/react-page.cjs.js.map +1 -1
- package/dist/react-page.es.js +36 -18
- package/dist/react-page.es.js.map +1 -1
- package/dist/slate.cjs.js +69 -6
- package/dist/slate.cjs.js.map +1 -1
- package/dist/slate.es.js +69 -7
- package/dist/slate.es.js.map +1 -1
- package/dist/types/src/api/graphql/documents/fragments.d.ts +1 -0
- package/dist/types/src/api/graphql/documents/fragments.d.ts.map +1 -1
- package/dist/types/src/api/graphql/documents/queries.d.ts +1 -0
- package/dist/types/src/api/graphql/documents/queries.d.ts.map +1 -1
- package/dist/types/src/api/graphql/generated/fragment-document-nodes.d.ts +1 -0
- package/dist/types/src/api/graphql/generated/fragment-document-nodes.d.ts.map +1 -1
- package/dist/types/src/api/graphql/generated/types.d.ts +17 -0
- package/dist/types/src/api/graphql/generated/types.d.ts.map +1 -1
- package/dist/types/src/api/graphql/types.d.ts +3 -3
- package/dist/types/src/api/graphql/types.d.ts.map +1 -1
- package/dist/types/src/api/react.d.ts +13 -2
- package/dist/types/src/api/react.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Text/components/Element/block.d.ts +1 -1
- package/dist/types/src/components/builtin/Text/components/Element/block.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Text/components/Element/element.d.ts.map +1 -1
- package/dist/types/src/components/page/Page.d.ts.map +1 -1
- package/dist/types/src/controls/rich-text/fixtures/v2-data-types.d.ts +3 -0
- package/dist/types/src/controls/rich-text/fixtures/v2-data-types.d.ts.map +1 -0
- package/dist/types/src/controls/rich-text/translation.d.ts.map +1 -1
- package/dist/types/src/controls/rich-text-v2/index.d.ts +1 -0
- package/dist/types/src/controls/rich-text-v2/index.d.ts.map +1 -1
- package/dist/types/src/controls/rich-text-v2/rich-text-v2.d.ts +15 -11
- package/dist/types/src/controls/rich-text-v2/rich-text-v2.d.ts.map +1 -1
- package/dist/types/src/controls/rich-text-v2/translation.d.ts +5 -0
- package/dist/types/src/controls/rich-text-v2/translation.d.ts.map +1 -0
- package/dist/types/src/controls/typography.d.ts +2 -2
- package/dist/types/src/controls/typography.d.ts.map +1 -1
- package/dist/types/src/next/api-handler/index.d.ts.map +1 -1
- package/dist/types/src/next/client.d.ts +7 -2
- package/dist/types/src/next/client.d.ts.map +1 -1
- package/dist/types/src/next/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/rich-text-v2/EditableTextV2/editable-text-v2.d.ts +1 -1
- package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/editable-text-v2.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/typography.d.ts +5 -5
- package/dist/types/src/runtimes/react/controls/typography.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/hooks/makeswift-api.d.ts +2 -1
- package/dist/types/src/runtimes/react/hooks/makeswift-api.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/index.d.ts.map +1 -1
- package/dist/types/src/slate/TypographyPlugin/getValue.d.ts +1 -1
- package/dist/types/src/slate/TypographyPlugin/getValue.d.ts.map +1 -1
- package/dist/types/src/slate/TypographyPlugin/index.d.ts.map +1 -1
- package/dist/types/src/state/makeswift-api-client.d.ts +1 -1
- package/dist/types/src/state/makeswift-api-client.d.ts.map +1 -1
- package/dist/types/src/state/modules/api-resources.d.ts.map +1 -1
- package/dist/types.cjs.js +1 -0
- package/dist/types.cjs.js.map +1 -1
- package/dist/types.cjs2.js +1 -5
- package/dist/types.cjs2.js.map +1 -1
- package/dist/types.es.js +1 -0
- package/dist/types.es.js.map +1 -1
- package/dist/types.es2.js +2 -6
- package/dist/types.es2.js.map +1 -1
- package/dist/typography.cjs.js.map +1 -1
- package/dist/typography.es.js.map +1 -1
- package/package.json +1 -1
package/dist/react-page.es.js
CHANGED
|
@@ -2138,6 +2138,11 @@ function toNodeDTO(node) {
|
|
|
2138
2138
|
case BlockType.Heading1:
|
|
2139
2139
|
case BlockType.Heading2:
|
|
2140
2140
|
case BlockType.Heading3:
|
|
2141
|
+
case BlockType.Heading4:
|
|
2142
|
+
case BlockType.Heading5:
|
|
2143
|
+
case BlockType.Heading6:
|
|
2144
|
+
case BlockType.Default:
|
|
2145
|
+
case BlockType.Text:
|
|
2141
2146
|
case BlockType.BlockQuote:
|
|
2142
2147
|
case BlockType.Paragraph:
|
|
2143
2148
|
case BlockType.OrderedList:
|
|
@@ -2260,6 +2265,16 @@ class RichTextControl extends PropController {
|
|
|
2260
2265
|
this.send({ type: RichTextControlMessageType.CHANGE_BOX_MODEL, payload: { boxModel } });
|
|
2261
2266
|
}
|
|
2262
2267
|
}
|
|
2268
|
+
function richTextV2DataToDescendents(data) {
|
|
2269
|
+
return data.descendants;
|
|
2270
|
+
}
|
|
2271
|
+
function richTextV2DescendentsToData(descendants) {
|
|
2272
|
+
return {
|
|
2273
|
+
type: RichTextV2ControlType,
|
|
2274
|
+
version: 2,
|
|
2275
|
+
descendants
|
|
2276
|
+
};
|
|
2277
|
+
}
|
|
2263
2278
|
const RichTextV2ControlType = "makeswift::controls::rich-text-v2";
|
|
2264
2279
|
const RichTextV2Mode = {
|
|
2265
2280
|
Inline: "makeswift::controls::rich-text-v2::mode::inline",
|
|
@@ -2278,15 +2293,15 @@ function unstable_RichTextV2(config = {}) {
|
|
|
2278
2293
|
return { type: RichTextV2ControlType, config };
|
|
2279
2294
|
}
|
|
2280
2295
|
const RichTextV2ControlMessageType = {
|
|
2281
|
-
RESET_VALUE: "
|
|
2282
|
-
FOCUS: "
|
|
2283
|
-
RUN_PLUGIN_CONTROL_ACTION: "
|
|
2284
|
-
SET_DEFAULT_VALUE: "
|
|
2285
|
-
SET_PLUGIN_CONTROL_VALUE: "
|
|
2286
|
-
ON_CHANGE: "
|
|
2287
|
-
SELECT: "
|
|
2288
|
-
SWITCH_TO_BUILD_MODE: "
|
|
2289
|
-
CHANGE_BOX_MODEL: "
|
|
2296
|
+
RESET_VALUE: "makeswift::controls::rich-text-v2::control-message::reset-value",
|
|
2297
|
+
FOCUS: "makeswift::controls::rich-text-v2::control-message::focus",
|
|
2298
|
+
RUN_PLUGIN_CONTROL_ACTION: "makeswift::controls::rich-text-v2::control-message::run-plugin-control-action",
|
|
2299
|
+
SET_DEFAULT_VALUE: "makeswift::controls::rich-text-v2::control-message::set-default-value",
|
|
2300
|
+
SET_PLUGIN_CONTROL_VALUE: "makeswift::controls::rich-text-v2::control-message::set-plugin-control-value",
|
|
2301
|
+
ON_CHANGE: "makeswift::controls::rich-text-v2::control-message::on-change",
|
|
2302
|
+
SELECT: "makeswift::controls::rich-text-v2::control-message::select",
|
|
2303
|
+
SWITCH_TO_BUILD_MODE: "makeswift::controls::rich-text-v2::control-message::switch-to-build-mode",
|
|
2304
|
+
CHANGE_BOX_MODEL: "makeswift::controls::rich-text-v2::control-message::change-box-model"
|
|
2290
2305
|
};
|
|
2291
2306
|
class RichTextV2Control extends PropController {
|
|
2292
2307
|
constructor(send, descriptor) {
|
|
@@ -2306,7 +2321,7 @@ class RichTextV2Control extends PropController {
|
|
|
2306
2321
|
case RichTextV2ControlMessageType.RESET_VALUE: {
|
|
2307
2322
|
if (this.defaultValue) {
|
|
2308
2323
|
this.editor.selection = null;
|
|
2309
|
-
this.editor.children = this.defaultValue;
|
|
2324
|
+
this.editor.children = this.defaultValue.descendants;
|
|
2310
2325
|
this.editor.onChange();
|
|
2311
2326
|
}
|
|
2312
2327
|
break;
|
|
@@ -2332,8 +2347,11 @@ class RichTextV2Control extends PropController {
|
|
|
2332
2347
|
});
|
|
2333
2348
|
}
|
|
2334
2349
|
setDefaultValue(defaultValue) {
|
|
2335
|
-
this.defaultValue = defaultValue;
|
|
2336
|
-
this.send({
|
|
2350
|
+
this.defaultValue = richTextV2DescendentsToData(defaultValue);
|
|
2351
|
+
this.send({
|
|
2352
|
+
type: RichTextV2ControlMessageType.SET_DEFAULT_VALUE,
|
|
2353
|
+
value: richTextV2DescendentsToData(defaultValue)
|
|
2354
|
+
});
|
|
2337
2355
|
}
|
|
2338
2356
|
select() {
|
|
2339
2357
|
this.send({ type: RichTextV2ControlMessageType.SELECT });
|
|
@@ -2348,7 +2366,7 @@ class RichTextV2Control extends PropController {
|
|
|
2348
2366
|
return;
|
|
2349
2367
|
this.send({
|
|
2350
2368
|
type: RichTextV2ControlMessageType.ON_CHANGE,
|
|
2351
|
-
value
|
|
2369
|
+
value: richTextV2DescendentsToData(value)
|
|
2352
2370
|
});
|
|
2353
2371
|
this.send({
|
|
2354
2372
|
type: RichTextV2ControlMessageType.SET_PLUGIN_CONTROL_VALUE,
|
|
@@ -2363,7 +2381,7 @@ class RichTextV2Control extends PropController {
|
|
|
2363
2381
|
}
|
|
2364
2382
|
}
|
|
2365
2383
|
function isRichTextV1Data(value) {
|
|
2366
|
-
return value !== void 0 && typeof value === "object" && !Array.isArray(value);
|
|
2384
|
+
return value !== void 0 && typeof value === "object" && !Array.isArray(value) && "object" in value;
|
|
2367
2385
|
}
|
|
2368
2386
|
function isNonNullable(value) {
|
|
2369
2387
|
return value != null;
|
|
@@ -2530,11 +2548,11 @@ function getSwatchIds(descriptor, prop) {
|
|
|
2530
2548
|
return ((_a4 = plugin.control) == null ? void 0 : _a4.definition) && plugin.control.getLeafValue ? getSwatchIds(plugin.control.definition, plugin.control.getLeafValue(text)) : [];
|
|
2531
2549
|
})) != null ? _a3 : [];
|
|
2532
2550
|
};
|
|
2533
|
-
const
|
|
2551
|
+
const data = prop;
|
|
2534
2552
|
const plugins = descriptor.config.plugins;
|
|
2535
|
-
if (isRichTextV1Data(
|
|
2553
|
+
if (isRichTextV1Data(data))
|
|
2536
2554
|
return [];
|
|
2537
|
-
return descendants.flatMap((d) => getDescendantSwatchIds(d));
|
|
2555
|
+
return data.descendants.flatMap((d) => getDescendantSwatchIds(d));
|
|
2538
2556
|
}
|
|
2539
2557
|
case ShapeControlType: {
|
|
2540
2558
|
return introspectShapeData(descriptor, prop, getSwatchIds);
|
|
@@ -2950,5 +2968,5 @@ function configureStore({
|
|
|
2950
2968
|
locales: getInitialState(locales != null ? locales : preloadedState == null ? void 0 : preloadedState.locales)
|
|
2951
2969
|
}), applyMiddleware(thunk));
|
|
2952
2970
|
}
|
|
2953
|
-
export { StyleControlProperty as $, TableFormFields as A, Backgrounds as B, ComponentIcon as C, Date as D, ElementID as E, Font as F, GapY as G, Image$1 as H, Images as I, ResponsiveOpacity as J, NavigationLinks as K, Link$1 as L, Margin as M, Number as N, SocialLinks as O, Padding as P, RichText$1 as Q, RichTextPropControllerMessageType as R, Shadows as S, TableFormFieldsMessageType as T, useStyle as U, Video as V, Width as W, getBorderSwatchIds as X, isNonNullable as Y, getBoxShadowsSwatchIds as Z, getResponsiveColorSwatchIds as _, createDocumentReference as a, StyleV2ControlMessageType as a$, ImageControlValueFormat as a0, isPropControllersHandle as a1, isRichTextV1Data as a2, StyleControlType as a3, RichTextV2ControlType as a4, RichTextControlType as a5, SlotControlType as a6, StyleV2ControlType as a7, ListControlType as a8, ShapeControlType as a9, copy as aA, merge as aB, Image as aC, copyImageData as aD, Link as aE, copyLinkData as aF, List as aG, ListControlMessageType as aH, ListControl as aI, copyListData as aJ, introspectListData as aK, Shape as aL, ShapeControlMessageType as aM, ShapeControl as aN, copyShapeData as aO, introspectShapeData as aP, Slot as aQ, SlotControlMessageType as aR, SlotControl as aS, copySlotData as aT, mergeSlotData as aU, Style as aV, StyleControlMessageType as aW, StyleControl as aX, copyStyleData as aY, unstable_useStyleV2ClassName as aZ, unstable_StyleV2 as a_, LinkControlType as aa, ImageControlType as ab, ColorControlType as ac, getComponentPropControllerDescriptors as ad, getPropControllers as ae, Types as af, BorderPropControllerFormat as ag, ShadowsPropControllerFormat as ah, BorderRadiusPropControllerFormat as ai, MarginPropControllerFormat as aj, PaddingPropControllerFormat as ak, WidthPropControllerFormat as al, configureStore as am, copyElementTree as an, getBreakpoints as ao, parseLocalesInput as ap, getDocument as aq, getElementId as ar, getIsPreview as as, getIsInBuilder as at, getReactComponent as au, getBuilderEditMode as av, getBackgroundsFileIds as aw, getBackgroundsSwatchIds as ax, Color as ay, copyColorData as az, isElementReference as b, StyleV2Control as b0, ObjectType as b1, RichText as b2, RichTextControlMessageType as b3, RichTextControl as b4, richTextDTOtoSelection as b5, richTextDTOtoDAO as b6, toSelectionDTO as b7, richTextDAOToDTO as b8, RichTextV2Mode as b9, reducer$
|
|
2971
|
+
export { StyleControlProperty as $, TableFormFields as A, Backgrounds as B, ComponentIcon as C, Date as D, ElementID as E, Font as F, GapY as G, Image$1 as H, Images as I, ResponsiveOpacity as J, NavigationLinks as K, Link$1 as L, Margin as M, Number as N, SocialLinks as O, Padding as P, RichText$1 as Q, RichTextPropControllerMessageType as R, Shadows as S, TableFormFieldsMessageType as T, useStyle as U, Video as V, Width as W, getBorderSwatchIds as X, isNonNullable as Y, getBoxShadowsSwatchIds as Z, getResponsiveColorSwatchIds as _, createDocumentReference as a, StyleV2ControlMessageType as a$, ImageControlValueFormat as a0, isPropControllersHandle as a1, isRichTextV1Data as a2, StyleControlType as a3, RichTextV2ControlType as a4, RichTextControlType as a5, SlotControlType as a6, StyleV2ControlType as a7, ListControlType as a8, ShapeControlType as a9, copy as aA, merge as aB, Image as aC, copyImageData as aD, Link as aE, copyLinkData as aF, List as aG, ListControlMessageType as aH, ListControl as aI, copyListData as aJ, introspectListData as aK, Shape as aL, ShapeControlMessageType as aM, ShapeControl as aN, copyShapeData as aO, introspectShapeData as aP, Slot as aQ, SlotControlMessageType as aR, SlotControl as aS, copySlotData as aT, mergeSlotData as aU, Style as aV, StyleControlMessageType as aW, StyleControl as aX, copyStyleData as aY, unstable_useStyleV2ClassName as aZ, unstable_StyleV2 as a_, LinkControlType as aa, ImageControlType as ab, ColorControlType as ac, getComponentPropControllerDescriptors as ad, getPropControllers as ae, Types as af, BorderPropControllerFormat as ag, ShadowsPropControllerFormat as ah, BorderRadiusPropControllerFormat as ai, MarginPropControllerFormat as aj, PaddingPropControllerFormat as ak, WidthPropControllerFormat as al, configureStore as am, copyElementTree as an, getBreakpoints as ao, parseLocalesInput as ap, getDocument as aq, getElementId as ar, getIsPreview as as, getIsInBuilder as at, getReactComponent as au, getBuilderEditMode as av, getBackgroundsFileIds as aw, getBackgroundsSwatchIds as ax, Color as ay, copyColorData as az, isElementReference as b, StyleV2Control as b0, ObjectType as b1, RichText as b2, RichTextControlMessageType as b3, RichTextControl as b4, richTextDTOtoSelection as b5, richTextDTOtoDAO as b6, toSelectionDTO as b7, richTextDAOToDTO as b8, RichTextV2Mode as b9, reducer$6 as bA, reducer$5 as bB, reducer$4 as bC, reducer$3 as bD, reducer$2 as bE, reducer$1 as bF, getInitialState$2 as bG, createRichTextV2Plugin as ba, unstable_RichTextV2 as bb, RichTextV2ControlMessageType as bc, RichTextV2Control as bd, richTextV2DataToDescendents as be, richTextV2DescendentsToData as bf, InlineType as bg, RootBlockType as bh, BlockType as bi, BlockTextAlignment as bj, getInitialState$7 as bk, reducer$8 as bl, getDocument$1 as bm, getComponentsMeta as bn, getComponentPropControllerDescriptors$1 as bo, getLocales as bp, getDefaultLocale as bq, BuilderEditMode as br, getDocumentKeysSortedByDepth as bs, getPropController as bt, getPropControllersHandle as bu, getElement as bv, getElementPropControllerDescriptors as bw, createPropController as bx, reducer$7 as by, reducer$9 as bz, createDocument as c, descriptors as d, getSwatchIds as e, getFileIds as f, getPropControllerDescriptors as g, getTypographyIds as h, introspection as i, getTableIds as j, getPageIds as k, getElementChildren as l, ResponsiveIconRadioGroup as m, Border as n, BorderRadius as o, GapX as p, ResponsiveSelect as q, ResponsiveNumber as r, Checkbox as s, Grid as t, TextInput as u, ResponsiveColor as v, TextStyle as w, ResponsiveLength as x, TextArea as y, Table as z };
|
|
2954
2972
|
//# sourceMappingURL=react-page.es.js.map
|