@makeswift/runtime 0.9.4 → 0.9.6
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 -3
- package/dist/Box.es.js +3 -3
- package/dist/Button.cjs.js +3 -3
- package/dist/Button.es.js +3 -3
- package/dist/Carousel.cjs.js +3 -3
- package/dist/Carousel.es.js +3 -3
- package/dist/Countdown.cjs.js +1 -1
- package/dist/Countdown.es.js +1 -1
- package/dist/Divider.cjs.js +3 -3
- package/dist/Divider.es.js +3 -3
- package/dist/Embed.cjs.js +1 -0
- package/dist/Embed.cjs.js.map +1 -1
- package/dist/Embed.es.js +1 -0
- package/dist/Embed.es.js.map +1 -1
- package/dist/Form.cjs.js +1 -1
- package/dist/Form.es.js +1 -1
- package/dist/Image.cjs.js +1 -1
- package/dist/Image.es.js +1 -1
- package/dist/LiveProvider.cjs.js +4 -4
- package/dist/LiveProvider.es.js +5 -5
- package/dist/Navigation.cjs.js +2 -2
- package/dist/Navigation.es.js +2 -2
- package/dist/PreviewProvider.cjs.js +8 -7
- package/dist/PreviewProvider.cjs.js.map +1 -1
- package/dist/PreviewProvider.es.js +11 -10
- package/dist/PreviewProvider.es.js.map +1 -1
- package/dist/ReadOnlyText.cjs.js +3 -2
- package/dist/ReadOnlyText.cjs.js.map +1 -1
- package/dist/ReadOnlyText.es.js +5 -4
- package/dist/ReadOnlyText.es.js.map +1 -1
- package/dist/ReadOnlyTextV2.cjs.js +12 -12
- package/dist/ReadOnlyTextV2.cjs.js.map +1 -1
- package/dist/ReadOnlyTextV2.es.js +14 -14
- package/dist/ReadOnlyTextV2.es.js.map +1 -1
- package/dist/Root.cjs.js +1 -1
- package/dist/Root.es.js +1 -1
- package/dist/SocialLinks.cjs.js +3 -3
- package/dist/SocialLinks.es.js +3 -3
- package/dist/Text.cjs.js +1 -1
- package/dist/Text.es.js +1 -1
- package/dist/Video.cjs.js +1 -0
- package/dist/Video.cjs.js.map +1 -1
- package/dist/Video.es.js +1 -0
- package/dist/Video.es.js.map +1 -1
- package/dist/actions.cjs.js +467 -3
- package/dist/actions.cjs.js.map +1 -1
- package/dist/actions.es.js +467 -4
- package/dist/actions.es.js.map +1 -1
- package/dist/api.cjs.js +20 -1
- package/dist/api.cjs.js.map +1 -1
- package/dist/api.es.js +20 -1
- package/dist/api.es.js.map +1 -1
- package/dist/box-model.cjs.js +1 -0
- package/dist/box-model.cjs.js.map +1 -1
- package/dist/box-model.es.js +1 -0
- package/dist/box-model.es.js.map +1 -1
- package/dist/builder.cjs.js +1 -0
- package/dist/builder.cjs.js.map +1 -1
- package/dist/builder.es.js +1 -0
- package/dist/builder.es.js.map +1 -1
- package/dist/components.cjs.js +1 -1
- package/dist/components.es.js +1 -1
- package/dist/control-serialization.cjs.js +1 -0
- package/dist/control-serialization.cjs.js.map +1 -1
- package/dist/control-serialization.es.js +1 -0
- package/dist/control-serialization.es.js.map +1 -1
- package/dist/controls.cjs.js +1 -0
- package/dist/controls.cjs.js.map +1 -1
- package/dist/controls.es.js +2 -1
- package/dist/controls.es.js.map +1 -1
- package/dist/index.cjs.js +71 -41
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs10.js +5 -4
- package/dist/index.cjs10.js.map +1 -1
- package/dist/index.cjs2.js +1 -0
- package/dist/index.cjs2.js.map +1 -1
- package/dist/index.cjs5.js +30 -14
- package/dist/index.cjs5.js.map +1 -1
- package/dist/index.cjs8.js +1 -1
- package/dist/index.cjs9.js +4 -4
- package/dist/index.es.js +74 -45
- package/dist/index.es.js.map +1 -1
- package/dist/index.es10.js +7 -6
- package/dist/index.es10.js.map +1 -1
- package/dist/index.es2.js +2 -1
- package/dist/index.es2.js.map +1 -1
- package/dist/index.es5.js +32 -16
- package/dist/index.es5.js.map +1 -1
- package/dist/index.es6.js +1 -1
- package/dist/index.es8.js +1 -1
- package/dist/index.es9.js +6 -6
- package/dist/main.cjs.js +1 -0
- package/dist/main.cjs.js.map +1 -1
- package/dist/main.es.js +1 -0
- package/dist/main.es.js.map +1 -1
- package/dist/next.cjs.js +1 -1
- package/dist/next.es.js +2 -2
- package/dist/prop-controllers.cjs.js +1 -0
- package/dist/prop-controllers.cjs.js.map +1 -1
- package/dist/prop-controllers.es.js +1 -0
- package/dist/prop-controllers.es.js.map +1 -1
- package/dist/react-page.cjs.js +27 -32
- package/dist/react-page.cjs.js.map +1 -1
- package/dist/react-page.es.js +27 -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 +25 -67
- package/dist/slate.cjs.js.map +1 -1
- package/dist/slate.es.js +31 -71
- package/dist/slate.es.js.map +1 -1
- package/dist/state/breakpoints.cjs.js +14 -0
- package/dist/state/breakpoints.cjs.js.map +1 -1
- package/dist/state/breakpoints.es.js +14 -1
- package/dist/state/breakpoints.es.js.map +1 -1
- package/dist/types/src/api/graphql/documents/fragments.d.ts +1 -1
- package/dist/types/src/api/graphql/documents/fragments.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/types/src/api/graphql/generated/types.d.ts +12 -0
- package/dist/types/src/api/graphql/generated/types.d.ts.map +1 -1
- package/dist/types/src/api/react.d.ts +3 -1
- package/dist/types/src/api/react.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Button/Button.d.ts +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/Checkbox/index.d.ts +1 -1
- package/dist/types/src/components/page/Page.d.ts.map +1 -1
- package/dist/types/src/controls/icon-radio-group.d.ts +1 -1
- package/dist/types/src/controls/icon-radio-group.d.ts.map +1 -1
- package/dist/types/src/controls/link.d.ts +1 -1
- package/dist/types/src/controls/link.d.ts.map +1 -1
- package/dist/types/src/controls/select.d.ts +1 -1
- package/dist/types/src/controls/select.d.ts.map +1 -1
- package/dist/types/src/controls/typography.d.ts +1 -1
- 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 +11 -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/runtimes/react/controls/rich-text-v2/ReadOnlyTextV2.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/style-v2.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/typography.d.ts +2 -2
- package/dist/types/src/runtimes/react/controls/typography.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/index.d.ts.map +1 -1
- package/dist/types/src/slate/BlockPlugin/index.d.ts.map +1 -1
- package/dist/types/src/slate/InlinePlugin/getValue.d.ts +1 -1
- package/dist/types/src/slate/InlinePlugin/getValue.d.ts.map +1 -1
- package/dist/types/src/slate/LinkPlugin/getValue.d.ts.map +1 -1
- package/dist/types/src/slate/TextAlignPlugin/getValue.d.ts +4 -0
- package/dist/types/src/slate/TextAlignPlugin/getValue.d.ts.map +1 -0
- package/dist/types/src/slate/TextAlignPlugin/index.d.ts.map +1 -1
- package/dist/types/src/slate/TypographyPlugin/getValue.d.ts +4 -0
- package/dist/types/src/slate/TypographyPlugin/getValue.d.ts.map +1 -0
- package/dist/types/src/slate/TypographyPlugin/index.d.ts.map +1 -1
- package/dist/types/src/slate/index.d.ts +0 -1
- package/dist/types/src/slate/index.d.ts.map +1 -1
- package/dist/types/src/slate/utils/responsive.d.ts +3 -5
- package/dist/types/src/slate/utils/responsive.d.ts.map +1 -1
- package/dist/types/src/state/actions.d.ts +7 -7
- package/dist/types/src/state/actions.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/breakpoints.d.ts +2 -0
- package/dist/types/src/state/modules/breakpoints.d.ts.map +1 -1
- package/dist/types/src/state/modules/locales.d.ts +6 -7
- package/dist/types/src/state/modules/locales.d.ts.map +1 -1
- package/dist/types/src/state/react-builder-preview.d.ts.map +1 -1
- package/dist/types/src/state/react-page.d.ts +3 -1
- package/dist/types/src/state/react-page.d.ts.map +1 -1
- package/dist/types/types/locale.d.ts +9 -0
- package/dist/types/types/locale.d.ts.map +1 -0
- package/dist/types.cjs2.js +8 -11
- package/dist/types.cjs2.js.map +1 -1
- package/dist/types.es2.js +9 -12
- 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/types/src/slate/ColorPlugin/index.d.ts +0 -10
- package/dist/types/src/slate/ColorPlugin/index.d.ts.map +0 -1
package/dist/react-page.es.js
CHANGED
|
@@ -25,9 +25,9 @@ const import_meta = {};
|
|
|
25
25
|
var _a;
|
|
26
26
|
import { combineReducers, createStore, applyMiddleware } from "redux";
|
|
27
27
|
import thunk from "redux-thunk";
|
|
28
|
-
import { A as ActionTypes } from "./actions.es.js";
|
|
28
|
+
import { A as ActionTypes, n as localeStringSchema } from "./actions.es.js";
|
|
29
29
|
import { reducer as reducer$a, getInitialState as getInitialState$9 } from "./state/breakpoints.es.js";
|
|
30
|
-
import
|
|
30
|
+
import React__default from "react";
|
|
31
31
|
import { cache } from "@emotion/css";
|
|
32
32
|
import { serializeStyles } from "@emotion/serialize";
|
|
33
33
|
import { registerStyles, insertStyles } from "@emotion/utils";
|
|
@@ -284,6 +284,13 @@ function reducer$1(state = getInitialState(), action) {
|
|
|
284
284
|
return state;
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
|
+
function parseLocalesInput(input) {
|
|
288
|
+
return {
|
|
289
|
+
locales: input.locales.map((locale) => localeStringSchema.parse(locale)),
|
|
290
|
+
defaultLocale: localeStringSchema.parse(input.defaultLocale),
|
|
291
|
+
locale: null
|
|
292
|
+
};
|
|
293
|
+
}
|
|
287
294
|
const ColorControlType = "makeswift::controls::color";
|
|
288
295
|
function Color(config = {}) {
|
|
289
296
|
return { type: ColorControlType, config };
|
|
@@ -1900,7 +1907,7 @@ function merge(definition, a, b = a, context) {
|
|
|
1900
1907
|
}
|
|
1901
1908
|
const isServer = typeof window === "undefined";
|
|
1902
1909
|
const useInsertionEffectSpecifier = "useInsertionEffect";
|
|
1903
|
-
const useInsertionEffect = (_a =
|
|
1910
|
+
const useInsertionEffect = (_a = React__default[useInsertionEffectSpecifier]) != null ? _a : React__default.useLayoutEffect;
|
|
1904
1911
|
function useStyle(style) {
|
|
1905
1912
|
const serialized = serializeStyles([style], cache.registered);
|
|
1906
1913
|
registerStyles(cache, serialized, false);
|
|
@@ -2078,6 +2085,7 @@ function richTextDTOtoDAO(data) {
|
|
|
2078
2085
|
return (_c = (_b = (_a2 = data.document) == null ? void 0 : _a2.nodes) == null ? void 0 : _b.flatMap(toNodeDAO)) != null ? _c : [];
|
|
2079
2086
|
}
|
|
2080
2087
|
function toInlineOrTextDTO(node) {
|
|
2088
|
+
var _a2;
|
|
2081
2089
|
if (isText(node)) {
|
|
2082
2090
|
return [
|
|
2083
2091
|
{
|
|
@@ -2102,7 +2110,7 @@ function toInlineOrTextDTO(node) {
|
|
|
2102
2110
|
object: ObjectType.Inline,
|
|
2103
2111
|
nodes: node.children.flatMap(toInlineOrTextDTO),
|
|
2104
2112
|
type: node.type,
|
|
2105
|
-
data: node.link
|
|
2113
|
+
data: (_a2 = node.link) != null ? _a2 : void 0
|
|
2106
2114
|
}
|
|
2107
2115
|
];
|
|
2108
2116
|
case InlineType.Code:
|
|
@@ -2439,7 +2447,7 @@ function getTypographyStyleSwatchIds(style) {
|
|
|
2439
2447
|
}).filter(isNonNullable)) != null ? _a2 : [];
|
|
2440
2448
|
}
|
|
2441
2449
|
function getSwatchIds(descriptor, prop) {
|
|
2442
|
-
var _a2;
|
|
2450
|
+
var _a2, _b;
|
|
2443
2451
|
if (prop == null)
|
|
2444
2452
|
return [];
|
|
2445
2453
|
switch (descriptor.type) {
|
|
@@ -2450,12 +2458,12 @@ function getSwatchIds(descriptor, prop) {
|
|
|
2450
2458
|
case Types.NavigationLinks: {
|
|
2451
2459
|
const value = prop;
|
|
2452
2460
|
return (_a2 = value == null ? void 0 : value.flatMap((item) => {
|
|
2453
|
-
var _a3,
|
|
2461
|
+
var _a3, _b2, _c, _d;
|
|
2454
2462
|
switch (item.type) {
|
|
2455
2463
|
case "button":
|
|
2456
2464
|
case "dropdown":
|
|
2457
2465
|
return [
|
|
2458
|
-
...(
|
|
2466
|
+
...(_b2 = (_a3 = item.payload.color) == null ? void 0 : _a3.map((override) => override.value).map((color) => color.swatchId)) != null ? _b2 : [],
|
|
2459
2467
|
...(_d = (_c = item.payload.textColor) == null ? void 0 : _c.map((override) => override.value).map((color) => color.swatchId)) != null ? _d : []
|
|
2460
2468
|
];
|
|
2461
2469
|
}
|
|
@@ -2467,20 +2475,20 @@ function getSwatchIds(descriptor, prop) {
|
|
|
2467
2475
|
return getBoxShadowsSwatchIds(prop);
|
|
2468
2476
|
case Types.RichText: {
|
|
2469
2477
|
let getNodeSwatchIds = function(node) {
|
|
2470
|
-
var _a3,
|
|
2478
|
+
var _a3, _b2, _c, _d;
|
|
2471
2479
|
switch (node.object) {
|
|
2472
2480
|
case "document":
|
|
2473
2481
|
case "block":
|
|
2474
2482
|
case "inline":
|
|
2475
|
-
return (
|
|
2483
|
+
return (_b2 = (_a3 = node.nodes) == null ? void 0 : _a3.flatMap(getNodeSwatchIds)) != null ? _b2 : [];
|
|
2476
2484
|
case "text":
|
|
2477
2485
|
return (_d = (_c = node.marks) == null ? void 0 : _c.flatMap(getMarkSwatchIds)) != null ? _d : [];
|
|
2478
2486
|
default:
|
|
2479
2487
|
return [];
|
|
2480
2488
|
}
|
|
2481
2489
|
}, getMarkSwatchIds = function(mark) {
|
|
2482
|
-
var _a3,
|
|
2483
|
-
return getTypographyStyleSwatchIds((
|
|
2490
|
+
var _a3, _b2;
|
|
2491
|
+
return getTypographyStyleSwatchIds((_b2 = (_a3 = mark.data) == null ? void 0 : _a3.value) == null ? void 0 : _b2.style);
|
|
2484
2492
|
};
|
|
2485
2493
|
const value = prop;
|
|
2486
2494
|
if (value == null || value.document == null)
|
|
@@ -2493,7 +2501,7 @@ function getSwatchIds(descriptor, prop) {
|
|
|
2493
2501
|
}
|
|
2494
2502
|
case StyleV2ControlType: {
|
|
2495
2503
|
const value = prop;
|
|
2496
|
-
return value.flatMap((value2) => getSwatchIds(descriptor.config.type, value2.value));
|
|
2504
|
+
return (_b = value == null ? void 0 : value.flatMap((value2) => getSwatchIds(descriptor.config.type, value2.value))) != null ? _b : [];
|
|
2497
2505
|
}
|
|
2498
2506
|
case RichTextV2ControlType: {
|
|
2499
2507
|
let getDescendantSwatchIds = function(descendant) {
|
|
@@ -2663,6 +2671,8 @@ function getPageIds(descriptor, prop) {
|
|
|
2663
2671
|
switch (value.type) {
|
|
2664
2672
|
case "OPEN_PAGE":
|
|
2665
2673
|
return value.payload.pageId == null ? [] : [value.payload.pageId];
|
|
2674
|
+
default:
|
|
2675
|
+
return [];
|
|
2666
2676
|
}
|
|
2667
2677
|
}
|
|
2668
2678
|
case Types.NavigationLinks: {
|
|
@@ -2919,7 +2929,10 @@ function getBreakpoints(state) {
|
|
|
2919
2929
|
return state.breakpoints;
|
|
2920
2930
|
}
|
|
2921
2931
|
function getLocales(state) {
|
|
2922
|
-
return state.locales;
|
|
2932
|
+
return state.locales.locales.map((locale) => new Intl.Locale(locale));
|
|
2933
|
+
}
|
|
2934
|
+
function getDefaultLocale(state) {
|
|
2935
|
+
return state.locales.defaultLocale ? new Intl.Locale(state.locales.defaultLocale) : null;
|
|
2923
2936
|
}
|
|
2924
2937
|
function configureStore({
|
|
2925
2938
|
rootElements,
|
|
@@ -2933,5 +2946,5 @@ function configureStore({
|
|
|
2933
2946
|
locales: getInitialState(locales != null ? locales : preloadedState == null ? void 0 : preloadedState.locales)
|
|
2934
2947
|
}), applyMiddleware(thunk));
|
|
2935
2948
|
}
|
|
2936
|
-
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,
|
|
2949
|
+
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, StyleV2Control as a$, ImageControlValueFormat as a0, isPropControllersHandle as a1, StyleControlType as a2, RichTextV2ControlType as a3, RichTextControlType as a4, SlotControlType as a5, StyleV2ControlType as a6, ListControlType as a7, ShapeControlType as a8, LinkControlType as a9, merge as aA, Image as aB, copyImageData as aC, Link as aD, copyLinkData as aE, List as aF, ListControlMessageType as aG, ListControl as aH, copyListData as aI, introspectListData as aJ, Shape as aK, ShapeControlMessageType as aL, ShapeControl as aM, copyShapeData as aN, introspectShapeData as aO, Slot as aP, SlotControlMessageType as aQ, SlotControl as aR, copySlotData as aS, mergeSlotData as aT, Style as aU, StyleControlMessageType as aV, StyleControl as aW, copyStyleData as aX, unstable_useStyleV2ClassName as aY, unstable_StyleV2 as aZ, StyleV2ControlMessageType as a_, ImageControlType as aa, ColorControlType as ab, getComponentPropControllerDescriptors as ac, getPropControllers as ad, Types as ae, BorderPropControllerFormat as af, ShadowsPropControllerFormat as ag, BorderRadiusPropControllerFormat as ah, MarginPropControllerFormat as ai, PaddingPropControllerFormat as aj, WidthPropControllerFormat as ak, configureStore as al, copyElementTree as am, getBreakpoints as an, parseLocalesInput as ao, getDocument as ap, getElementId as aq, getIsPreview as ar, getIsInBuilder as as, getReactComponent as at, getBuilderEditMode as au, getBackgroundsFileIds as av, getBackgroundsSwatchIds as aw, Color as ax, copyColorData as ay, copy as az, isElementReference as b, ObjectType as b0, RichText as b1, RichTextControlMessageType as b2, RichTextControl as b3, richTextDTOtoSelection as b4, richTextDTOtoDAO as b5, toSelectionDTO as b6, richTextDAOToDTO as b7, RichTextV2Mode as b8, createRichTextV2Plugin as b9, reducer$3 as bA, reducer$2 as bB, reducer$1 as bC, getInitialState$2 as bD, unstable_RichTextV2 as ba, RichTextV2ControlMessageType as bb, RichTextV2Control as bc, InlineType as bd, RootBlockType as be, BlockType as bf, BlockTextAlignment as bg, getInitialState$7 as bh, reducer$8 as bi, getDocument$1 as bj, getComponentsMeta as bk, getComponentPropControllerDescriptors$1 as bl, getLocales as bm, getDefaultLocale as bn, BuilderEditMode as bo, getDocumentKeysSortedByDepth as bp, getPropController as bq, getPropControllersHandle as br, getElement as bs, getElementPropControllerDescriptors as bt, createPropController as bu, reducer$7 as bv, reducer$9 as bw, reducer$6 as bx, reducer$5 as by, reducer$4 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 };
|
|
2937
2950
|
//# sourceMappingURL=react-page.es.js.map
|