@makeswift/runtime 0.10.1 → 0.10.3
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/Button.cjs.js +1 -1
- package/dist/Button.es.js +1 -1
- package/dist/Carousel.cjs.js +1 -1
- package/dist/Carousel.es.js +1 -1
- package/dist/Countdown.cjs.js +2 -2
- package/dist/Countdown.es.js +2 -2
- package/dist/Divider.cjs.js +1 -1
- package/dist/Divider.es.js +1 -1
- package/dist/Embed.cjs.js +2 -1
- package/dist/Embed.cjs.js.map +1 -1
- package/dist/Embed.es.js +2 -1
- package/dist/Embed.es.js.map +1 -1
- package/dist/Form.cjs.js +2 -2
- package/dist/Form.es.js +2 -2
- package/dist/Image.cjs.js +1 -1
- package/dist/Image.es.js +1 -1
- package/dist/LiveProvider.cjs.js +1 -1
- package/dist/LiveProvider.es.js +1 -1
- package/dist/Navigation.cjs.js +1 -1
- package/dist/Navigation.es.js +1 -1
- 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 +1 -1
- package/dist/SocialLinks.cjs.js +1 -1
- package/dist/SocialLinks.es.js +1 -1
- package/dist/Video.cjs.js +2 -1
- package/dist/Video.cjs.js.map +1 -1
- package/dist/Video.es.js +2 -1
- package/dist/Video.es.js.map +1 -1
- package/dist/builder.cjs.js +2 -1
- package/dist/builder.cjs.js.map +1 -1
- package/dist/builder.es.js +2 -1
- 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 +4 -1
- package/dist/controls.cjs.js.map +1 -1
- package/dist/controls.es.js +3 -2
- package/dist/controls.es.js.map +1 -1
- package/dist/index.cjs.js +2 -2
- package/dist/index.cjs2.js +1 -0
- package/dist/index.cjs2.js.map +1 -1
- package/dist/index.cjs7.js +1 -1
- package/dist/index.cjs8.js +1 -1
- package/dist/index.es.js +2 -2
- package/dist/index.es2.js +1 -0
- package/dist/index.es2.js.map +1 -1
- package/dist/index.es5.js +1 -1
- package/dist/index.es7.js +2 -2
- package/dist/index.es8.js +2 -2
- package/dist/main.cjs.js +2 -1
- package/dist/main.cjs.js.map +1 -1
- package/dist/main.es.js +2 -1
- package/dist/main.es.js.map +1 -1
- package/dist/next.cjs.js +2 -2
- package/dist/next.es.js +2 -2
- package/dist/prop-controllers.cjs.js +2 -1
- package/dist/prop-controllers.cjs.js.map +1 -1
- package/dist/prop-controllers.es.js +2 -1
- package/dist/prop-controllers.es.js.map +1 -1
- package/dist/react-page.cjs.js +473 -308
- package/dist/react-page.cjs.js.map +1 -1
- package/dist/react-page.es.js +473 -309
- package/dist/react-page.es.js.map +1 -1
- package/dist/react.cjs.js +2 -2
- package/dist/react.es.js +2 -2
- package/dist/slate.cjs.js +2 -2
- package/dist/slate.es.js +3 -3
- package/dist/types/src/controls/control.d.ts +1 -1
- package/dist/types/src/controls/control.d.ts.map +1 -1
- package/dist/types/src/controls/rich-text/__test__/copy.test.d.ts +2 -0
- package/dist/types/src/controls/rich-text/__test__/copy.test.d.ts.map +1 -0
- package/dist/types/src/controls/rich-text/__test__/introspection.test.d.ts.map +1 -0
- package/dist/types/src/controls/rich-text/__test__/translation.test.d.ts.map +1 -0
- package/dist/types/src/controls/rich-text/copy.d.ts +4 -0
- package/dist/types/src/controls/rich-text/copy.d.ts.map +1 -0
- package/dist/types/src/controls/rich-text/index.d.ts +1 -0
- package/dist/types/src/controls/rich-text/index.d.ts.map +1 -1
- package/dist/types/src/controls/rich-text-v2/__test__/copy.test.d.ts +2 -0
- package/dist/types/src/controls/rich-text-v2/__test__/copy.test.d.ts.map +1 -0
- package/dist/types/src/controls/rich-text-v2/__test__/introspection.test.d.ts.map +1 -0
- package/dist/types/src/controls/rich-text-v2/copy.d.ts +4 -0
- package/dist/types/src/controls/rich-text-v2/copy.d.ts.map +1 -0
- 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/translation.d.ts +1 -1
- package/dist/types/src/controls/rich-text-v2/translation.d.ts.map +1 -1
- package/dist/types/src/slate/InlinePlugin/index.d.ts +2 -2
- package/dist/types/src/slate/TextAlignPlugin/index.d.ts +3 -3
- package/dist/types/src/slate/TypographyPlugin/index.d.ts +3 -3
- package/package.json +1 -1
- package/dist/types/src/controls/rich-text/introspection.test.d.ts.map +0 -1
- package/dist/types/src/controls/rich-text/translation.test.d.ts.map +0 -1
- package/dist/types/src/controls/rich-text-v2/introspection.test.d.ts.map +0 -1
- /package/dist/types/src/controls/rich-text/{introspection.test.d.ts → __test__/introspection.test.d.ts} +0 -0
- /package/dist/types/src/controls/rich-text/{translation.test.d.ts → __test__/translation.test.d.ts} +0 -0
- /package/dist/types/src/controls/rich-text-v2/{introspection.test.d.ts → __test__/introspection.test.d.ts} +0 -0
package/dist/react-page.es.js
CHANGED
|
@@ -34,16 +34,17 @@ var __publicField = (obj, key, value) => {
|
|
|
34
34
|
return value;
|
|
35
35
|
};
|
|
36
36
|
const import_meta = {};
|
|
37
|
-
var
|
|
37
|
+
var _c;
|
|
38
38
|
import { combineReducers, createStore, applyMiddleware } from "redux";
|
|
39
39
|
import thunk from "redux-thunk";
|
|
40
40
|
import { A as ActionTypes, n as localeStringSchema } from "./actions.es.js";
|
|
41
41
|
import { findBreakpointOverride, reducer as reducer$a, getInitialState as getInitialState$9 } from "./state/breakpoints.es.js";
|
|
42
|
+
import { Element, Range, Editor, Text, Path, Transforms, Node, Point } from "slate";
|
|
43
|
+
import { v4 } from "uuid";
|
|
42
44
|
import React__default from "react";
|
|
43
45
|
import { cache, cx } from "@emotion/css";
|
|
44
46
|
import { serializeStyles } from "@emotion/serialize";
|
|
45
47
|
import { registerStyles, insertStyles } from "@emotion/utils";
|
|
46
|
-
import { Element, Range, Editor, Text, Path, Transforms, Node, Point } from "slate";
|
|
47
48
|
import { jsx, Fragment } from "react/jsx-runtime";
|
|
48
49
|
import isHotkey from "is-hotkey";
|
|
49
50
|
const ComponentIcon = {
|
|
@@ -113,8 +114,8 @@ function getDocuments(state) {
|
|
|
113
114
|
return state;
|
|
114
115
|
}
|
|
115
116
|
function getDocument$1(state, documentKey) {
|
|
116
|
-
var
|
|
117
|
-
return (
|
|
117
|
+
var _a;
|
|
118
|
+
return (_a = getDocuments(state).get(documentKey)) != null ? _a : null;
|
|
118
119
|
}
|
|
119
120
|
function reducer$8(state = getInitialState$7(), action) {
|
|
120
121
|
switch (action.type) {
|
|
@@ -138,8 +139,8 @@ function getReactComponents(state) {
|
|
|
138
139
|
return state;
|
|
139
140
|
}
|
|
140
141
|
function getReactComponent$1(state, type) {
|
|
141
|
-
var
|
|
142
|
-
return (
|
|
142
|
+
var _a;
|
|
143
|
+
return (_a = getReactComponents(state).get(type)) != null ? _a : null;
|
|
143
144
|
}
|
|
144
145
|
function reducer$7(state = getInitialState$6(), action) {
|
|
145
146
|
switch (action.type) {
|
|
@@ -163,8 +164,8 @@ function getPropControllerDescriptors$1(state) {
|
|
|
163
164
|
return state;
|
|
164
165
|
}
|
|
165
166
|
function getComponentPropControllerDescriptors$1(state, componentType) {
|
|
166
|
-
var
|
|
167
|
-
return (
|
|
167
|
+
var _a;
|
|
168
|
+
return (_a = getPropControllerDescriptors$1(state).get(componentType)) != null ? _a : null;
|
|
168
169
|
}
|
|
169
170
|
function reducer$6(state = getInitialState$5(), action) {
|
|
170
171
|
switch (action.type) {
|
|
@@ -189,24 +190,24 @@ function getInitialState$4() {
|
|
|
189
190
|
return { handles: /* @__PURE__ */ new Map(), instances: /* @__PURE__ */ new Map() };
|
|
190
191
|
}
|
|
191
192
|
function getPropControllersHandle(state, documentKey, elementKey) {
|
|
192
|
-
var
|
|
193
|
-
return (_b = (
|
|
193
|
+
var _a, _b;
|
|
194
|
+
return (_b = (_a = state.handles.get(documentKey)) == null ? void 0 : _a.get(elementKey)) != null ? _b : null;
|
|
194
195
|
}
|
|
195
196
|
function getPropControllers$1(state, documentKey, elementKey) {
|
|
196
|
-
var
|
|
197
|
-
return (_b = (
|
|
197
|
+
var _a, _b;
|
|
198
|
+
return (_b = (_a = state.instances.get(documentKey)) == null ? void 0 : _a.get(elementKey)) != null ? _b : null;
|
|
198
199
|
}
|
|
199
200
|
function getPropController(state, documentKey, elementKey, propName) {
|
|
200
|
-
var
|
|
201
|
-
return (_b = (
|
|
201
|
+
var _a, _b;
|
|
202
|
+
return (_b = (_a = getPropControllers$1(state, documentKey, elementKey)) == null ? void 0 : _a[propName]) != null ? _b : null;
|
|
202
203
|
}
|
|
203
204
|
function reducer$5(state = getInitialState$4(), action) {
|
|
204
|
-
var
|
|
205
|
+
var _a, _b, _c2, _d;
|
|
205
206
|
switch (action.type) {
|
|
206
207
|
case ActionTypes.REGISTER_PROP_CONTROLLERS_HANDLE: {
|
|
207
208
|
const { documentKey, elementKey, handle } = action.payload;
|
|
208
209
|
return __spreadProps(__spreadValues({}, state), {
|
|
209
|
-
handles: new Map(state.handles).set(documentKey, new Map((
|
|
210
|
+
handles: new Map(state.handles).set(documentKey, new Map((_a = state.handles.get(documentKey)) != null ? _a : []).set(elementKey, handle))
|
|
210
211
|
});
|
|
211
212
|
}
|
|
212
213
|
case ActionTypes.UNREGISTER_PROP_CONTROLLERS_HANDLE: {
|
|
@@ -218,7 +219,7 @@ function reducer$5(state = getInitialState$4(), action) {
|
|
|
218
219
|
case ActionTypes.REGISTER_PROP_CONTROLLERS: {
|
|
219
220
|
const { documentKey, elementKey, propControllers } = action.payload;
|
|
220
221
|
return __spreadProps(__spreadValues({}, state), {
|
|
221
|
-
instances: new Map(state.instances).set(documentKey, new Map((
|
|
222
|
+
instances: new Map(state.instances).set(documentKey, new Map((_c2 = state.instances.get(documentKey)) != null ? _c2 : []).set(elementKey, propControllers))
|
|
222
223
|
});
|
|
223
224
|
}
|
|
224
225
|
case ActionTypes.UNREGISTER_PROP_CONTROLLERS: {
|
|
@@ -271,11 +272,11 @@ function reducer$2(state = getInitialState$1(), action) {
|
|
|
271
272
|
}
|
|
272
273
|
}
|
|
273
274
|
function getInitialState(initialState) {
|
|
274
|
-
var
|
|
275
|
+
var _a, _b, _c2;
|
|
275
276
|
return {
|
|
276
|
-
locales: (
|
|
277
|
+
locales: (_a = initialState == null ? void 0 : initialState.locales) != null ? _a : [],
|
|
277
278
|
locale: (_b = initialState == null ? void 0 : initialState.locale) != null ? _b : null,
|
|
278
|
-
defaultLocale: (
|
|
279
|
+
defaultLocale: (_c2 = initialState == null ? void 0 : initialState.defaultLocale) != null ? _c2 : null
|
|
279
280
|
};
|
|
280
281
|
}
|
|
281
282
|
function reducer$1(state = getInitialState(), action) {
|
|
@@ -316,11 +317,11 @@ function Color(config = {}) {
|
|
|
316
317
|
return { type: ColorControlType, config };
|
|
317
318
|
}
|
|
318
319
|
function copyColorData(value, context) {
|
|
319
|
-
var
|
|
320
|
+
var _a;
|
|
320
321
|
if (value == null)
|
|
321
322
|
return value;
|
|
322
323
|
return __spreadProps(__spreadValues({}, value), {
|
|
323
|
-
swatchId: (
|
|
324
|
+
swatchId: (_a = context.replacementContext.swatchIds.get(value.swatchId)) != null ? _a : value.swatchId
|
|
324
325
|
});
|
|
325
326
|
}
|
|
326
327
|
class PropController {
|
|
@@ -351,10 +352,10 @@ const AllStyleControlProperties = [
|
|
|
351
352
|
StyleControlProperty.TextStyle
|
|
352
353
|
];
|
|
353
354
|
function Style(params) {
|
|
354
|
-
var
|
|
355
|
+
var _a;
|
|
355
356
|
return {
|
|
356
357
|
type: StyleControlType,
|
|
357
|
-
config: { properties: (
|
|
358
|
+
config: { properties: (_a = params == null ? void 0 : params.properties) != null ? _a : StyleControlDefaultProperties }
|
|
358
359
|
};
|
|
359
360
|
}
|
|
360
361
|
Style.Default = StyleControlDefaultProperties;
|
|
@@ -808,10 +809,10 @@ function Image(config = {}) {
|
|
|
808
809
|
}
|
|
809
810
|
Image.Format = ImageControlValueFormat;
|
|
810
811
|
function copyImageData(value, context) {
|
|
811
|
-
var
|
|
812
|
+
var _a;
|
|
812
813
|
if (value == null)
|
|
813
814
|
return value;
|
|
814
|
-
return (
|
|
815
|
+
return (_a = context.replacementContext.fileIds.get(value)) != null ? _a : value;
|
|
815
816
|
}
|
|
816
817
|
if (import_meta.vitest) {
|
|
817
818
|
const { describe, test, expect } = import_meta.vitest;
|
|
@@ -844,7 +845,7 @@ function Link(config = {}) {
|
|
|
844
845
|
return { type: LinkControlType, config };
|
|
845
846
|
}
|
|
846
847
|
function copyLinkData(value, context) {
|
|
847
|
-
var
|
|
848
|
+
var _a;
|
|
848
849
|
if (value == null)
|
|
849
850
|
return value;
|
|
850
851
|
if (value.type === "OPEN_PAGE") {
|
|
@@ -852,7 +853,7 @@ function copyLinkData(value, context) {
|
|
|
852
853
|
if (pageId != null) {
|
|
853
854
|
return __spreadProps(__spreadValues({}, value), {
|
|
854
855
|
payload: __spreadProps(__spreadValues({}, value.payload), {
|
|
855
|
-
pageId: (
|
|
856
|
+
pageId: (_a = context.replacementContext.pageIds.get(pageId)) != null ? _a : pageId
|
|
856
857
|
})
|
|
857
858
|
});
|
|
858
859
|
}
|
|
@@ -1206,22 +1207,22 @@ function copy$e(value, context) {
|
|
|
1206
1207
|
return value;
|
|
1207
1208
|
return value.map((override) => __spreadProps(__spreadValues({}, override), {
|
|
1208
1209
|
value: override.value.map((backgroundItem) => {
|
|
1209
|
-
var
|
|
1210
|
+
var _a, _b;
|
|
1210
1211
|
switch (backgroundItem.type) {
|
|
1211
1212
|
case "color":
|
|
1212
1213
|
return __spreadProps(__spreadValues({}, backgroundItem), {
|
|
1213
1214
|
payload: backgroundItem.payload === null ? null : __spreadProps(__spreadValues({}, backgroundItem.payload), {
|
|
1214
|
-
swatchId: (
|
|
1215
|
+
swatchId: (_a = context.replacementContext.swatchIds.get(backgroundItem.payload.swatchId)) != null ? _a : backgroundItem.payload.swatchId
|
|
1215
1216
|
})
|
|
1216
1217
|
});
|
|
1217
1218
|
case "gradient":
|
|
1218
1219
|
return __spreadProps(__spreadValues({}, backgroundItem), {
|
|
1219
1220
|
payload: __spreadProps(__spreadValues({}, backgroundItem.payload), {
|
|
1220
1221
|
stops: backgroundItem.payload.stops.map((stop) => {
|
|
1221
|
-
var
|
|
1222
|
+
var _a2;
|
|
1222
1223
|
return __spreadProps(__spreadValues({}, stop), {
|
|
1223
1224
|
color: stop.color == null ? null : __spreadProps(__spreadValues({}, stop.color), {
|
|
1224
|
-
swatchId: (
|
|
1225
|
+
swatchId: (_a2 = context.replacementContext.swatchIds.get(stop.color.swatchId)) != null ? _a2 : stop.color.swatchId
|
|
1225
1226
|
})
|
|
1226
1227
|
});
|
|
1227
1228
|
})
|
|
@@ -1247,7 +1248,7 @@ function copy$d(value, context) {
|
|
|
1247
1248
|
});
|
|
1248
1249
|
}
|
|
1249
1250
|
function copy$c(value, context) {
|
|
1250
|
-
var
|
|
1251
|
+
var _a, _b;
|
|
1251
1252
|
if (value == null)
|
|
1252
1253
|
return value;
|
|
1253
1254
|
switch (value.type) {
|
|
@@ -1257,7 +1258,7 @@ function copy$c(value, context) {
|
|
|
1257
1258
|
return value;
|
|
1258
1259
|
return __spreadProps(__spreadValues({}, value), {
|
|
1259
1260
|
payload: __spreadProps(__spreadValues({}, value.payload), {
|
|
1260
|
-
pageId: (
|
|
1261
|
+
pageId: (_a = context.replacementContext.pageIds.get(pageId)) != null ? _a : pageId
|
|
1261
1262
|
})
|
|
1262
1263
|
});
|
|
1263
1264
|
}
|
|
@@ -1290,10 +1291,10 @@ function copy$b(value, context) {
|
|
|
1290
1291
|
payload: __spreadProps(__spreadValues({}, item.payload), {
|
|
1291
1292
|
link: link != null ? copy$c(link, context) : void 0,
|
|
1292
1293
|
color: color != null ? color.map((override) => {
|
|
1293
|
-
var
|
|
1294
|
+
var _a;
|
|
1294
1295
|
return __spreadProps(__spreadValues({}, override), {
|
|
1295
1296
|
value: __spreadProps(__spreadValues({}, override.value), {
|
|
1296
|
-
swatchId: (
|
|
1297
|
+
swatchId: (_a = context.replacementContext.swatchIds.get(override.value.swatchId)) != null ? _a : override.value.swatchId
|
|
1297
1298
|
})
|
|
1298
1299
|
});
|
|
1299
1300
|
}) : void 0
|
|
@@ -1351,14 +1352,14 @@ function copy$a(value, context) {
|
|
|
1351
1352
|
return value;
|
|
1352
1353
|
return value.map((override) => __spreadProps(__spreadValues({}, override), { value: override.value.map(copyShadowItem) }));
|
|
1353
1354
|
function copyShadowItem(item) {
|
|
1354
|
-
var
|
|
1355
|
+
var _a;
|
|
1355
1356
|
const { color } = item.payload;
|
|
1356
1357
|
if (color == null)
|
|
1357
1358
|
return item;
|
|
1358
1359
|
return __spreadProps(__spreadValues({}, item), {
|
|
1359
1360
|
payload: __spreadProps(__spreadValues({}, item.payload), {
|
|
1360
1361
|
color: __spreadProps(__spreadValues({}, color), {
|
|
1361
|
-
swatchId: (
|
|
1362
|
+
swatchId: (_a = context.replacementContext.swatchIds.get(color.swatchId)) != null ? _a : color.swatchId
|
|
1362
1363
|
})
|
|
1363
1364
|
})
|
|
1364
1365
|
});
|
|
@@ -1412,10 +1413,10 @@ if (import_meta.vitest) {
|
|
|
1412
1413
|
});
|
|
1413
1414
|
}
|
|
1414
1415
|
function copy$9(value, context) {
|
|
1415
|
-
var
|
|
1416
|
+
var _a;
|
|
1416
1417
|
if (value == null)
|
|
1417
1418
|
return value;
|
|
1418
|
-
return (
|
|
1419
|
+
return (_a = context.replacementContext.fileIds.get(value)) != null ? _a : value;
|
|
1419
1420
|
}
|
|
1420
1421
|
if (import_meta.vitest) {
|
|
1421
1422
|
const { describe, test, expect } = import_meta.vitest;
|
|
@@ -1448,13 +1449,13 @@ function copy$8(value, context) {
|
|
|
1448
1449
|
return value;
|
|
1449
1450
|
return value.map(copyImagesPanelItem);
|
|
1450
1451
|
function copyImagesPanelItem(imagesPanelItem) {
|
|
1451
|
-
var
|
|
1452
|
+
var _a;
|
|
1452
1453
|
const { file } = imagesPanelItem.props;
|
|
1453
1454
|
if (file == null)
|
|
1454
1455
|
return imagesPanelItem;
|
|
1455
1456
|
return __spreadProps(__spreadValues({}, imagesPanelItem), {
|
|
1456
1457
|
props: __spreadProps(__spreadValues({}, imagesPanelItem.props), {
|
|
1457
|
-
file: (
|
|
1458
|
+
file: (_a = context.replacementContext.fileIds.get(file)) != null ? _a : file
|
|
1458
1459
|
})
|
|
1459
1460
|
});
|
|
1460
1461
|
}
|
|
@@ -1503,9 +1504,9 @@ function copy$7(value, context) {
|
|
|
1503
1504
|
return value;
|
|
1504
1505
|
return value.map((override) => __spreadProps(__spreadValues({}, override), { value: copyColorValue(override.value) }));
|
|
1505
1506
|
function copyColorValue(colorValue) {
|
|
1506
|
-
var
|
|
1507
|
+
var _a;
|
|
1507
1508
|
return __spreadProps(__spreadValues({}, colorValue), {
|
|
1508
|
-
swatchId: (
|
|
1509
|
+
swatchId: (_a = context.replacementContext.swatchIds.get(colorValue.swatchId)) != null ? _a : colorValue.swatchId
|
|
1509
1510
|
});
|
|
1510
1511
|
}
|
|
1511
1512
|
}
|
|
@@ -1514,9 +1515,9 @@ function copy$6(value, context) {
|
|
|
1514
1515
|
return value;
|
|
1515
1516
|
return __spreadProps(__spreadValues({}, value), { fields: value.fields.map(copyFormFieldsPanelItem) });
|
|
1516
1517
|
function copyFormFieldsPanelItem(item) {
|
|
1517
|
-
var
|
|
1518
|
+
var _a;
|
|
1518
1519
|
return __spreadProps(__spreadValues({}, item), {
|
|
1519
|
-
tableColumnId: (
|
|
1520
|
+
tableColumnId: (_a = context.replacementContext.tableColumnIds.get(item.tableColumnId)) != null ? _a : item.tableColumnId
|
|
1520
1521
|
});
|
|
1521
1522
|
}
|
|
1522
1523
|
}
|
|
@@ -1570,10 +1571,10 @@ if (import_meta.vitest) {
|
|
|
1570
1571
|
});
|
|
1571
1572
|
}
|
|
1572
1573
|
function copy$5(value, context) {
|
|
1573
|
-
var
|
|
1574
|
+
var _a;
|
|
1574
1575
|
if (value == null)
|
|
1575
1576
|
return value;
|
|
1576
|
-
return (
|
|
1577
|
+
return (_a = context.replacementContext.tableIds.get(value)) != null ? _a : value;
|
|
1577
1578
|
}
|
|
1578
1579
|
if (import_meta.vitest) {
|
|
1579
1580
|
const { describe, test, expect } = import_meta.vitest;
|
|
@@ -1615,13 +1616,13 @@ function copy$4(value, context) {
|
|
|
1615
1616
|
};
|
|
1616
1617
|
}
|
|
1617
1618
|
function copyBorderSide(borderSide) {
|
|
1618
|
-
var
|
|
1619
|
+
var _a;
|
|
1619
1620
|
const { color } = borderSide;
|
|
1620
1621
|
if (color == null)
|
|
1621
1622
|
return borderSide;
|
|
1622
1623
|
return __spreadProps(__spreadValues({}, borderSide), {
|
|
1623
1624
|
color: __spreadProps(__spreadValues({}, color), {
|
|
1624
|
-
swatchId: (
|
|
1625
|
+
swatchId: (_a = context.replacementContext.swatchIds.get(color.swatchId)) != null ? _a : color.swatchId
|
|
1625
1626
|
})
|
|
1626
1627
|
});
|
|
1627
1628
|
}
|
|
@@ -1735,24 +1736,24 @@ function copy$3(value, context) {
|
|
|
1735
1736
|
return value;
|
|
1736
1737
|
return __spreadProps(__spreadValues({}, value), { document: value.document ? copyNode(value.document) : value.document });
|
|
1737
1738
|
function copyNode(node) {
|
|
1738
|
-
var
|
|
1739
|
+
var _a;
|
|
1739
1740
|
switch (node.object) {
|
|
1740
1741
|
case "document":
|
|
1741
1742
|
case "block":
|
|
1742
1743
|
case "inline":
|
|
1743
1744
|
return copyInline(node);
|
|
1744
1745
|
case "text":
|
|
1745
|
-
return __spreadProps(__spreadValues({}, node), { marks: (
|
|
1746
|
+
return __spreadProps(__spreadValues({}, node), { marks: (_a = node.marks) == null ? void 0 : _a.map(copyMark) });
|
|
1746
1747
|
default:
|
|
1747
1748
|
return node;
|
|
1748
1749
|
}
|
|
1749
1750
|
}
|
|
1750
1751
|
function copyInline(inline) {
|
|
1751
|
-
var
|
|
1752
|
+
var _a, _b;
|
|
1752
1753
|
switch (inline.type) {
|
|
1753
1754
|
case "link":
|
|
1754
1755
|
return __spreadProps(__spreadValues({}, inline), {
|
|
1755
|
-
nodes: (
|
|
1756
|
+
nodes: (_a = inline.nodes) == null ? void 0 : _a.map(copyNode),
|
|
1756
1757
|
data: inline.data ? copyLinkData2(inline.data) : inline.data
|
|
1757
1758
|
});
|
|
1758
1759
|
default:
|
|
@@ -1760,7 +1761,7 @@ function copy$3(value, context) {
|
|
|
1760
1761
|
}
|
|
1761
1762
|
}
|
|
1762
1763
|
function copyLinkData2(data) {
|
|
1763
|
-
var
|
|
1764
|
+
var _a, _b;
|
|
1764
1765
|
switch (data.type) {
|
|
1765
1766
|
case "OPEN_PAGE": {
|
|
1766
1767
|
const pageId = data.payload.pageId;
|
|
@@ -1768,7 +1769,7 @@ function copy$3(value, context) {
|
|
|
1768
1769
|
return data;
|
|
1769
1770
|
return __spreadProps(__spreadValues({}, data), {
|
|
1770
1771
|
payload: __spreadProps(__spreadValues({}, data.payload), {
|
|
1771
|
-
pageId: (
|
|
1772
|
+
pageId: (_a = context.replacementContext.pageIds.get(pageId)) != null ? _a : data.payload.pageId
|
|
1772
1773
|
})
|
|
1773
1774
|
});
|
|
1774
1775
|
}
|
|
@@ -1789,20 +1790,20 @@ function copy$3(value, context) {
|
|
|
1789
1790
|
}
|
|
1790
1791
|
}
|
|
1791
1792
|
function copyMark(mark) {
|
|
1792
|
-
var
|
|
1793
|
+
var _a, _b, _c2, _d;
|
|
1793
1794
|
switch (mark.type) {
|
|
1794
1795
|
case "typography": {
|
|
1795
|
-
const typographyId = (
|
|
1796
|
+
const typographyId = (_a = mark.data) == null ? void 0 : _a.value.id;
|
|
1796
1797
|
return __spreadProps(__spreadValues({}, mark), {
|
|
1797
1798
|
data: __spreadProps(__spreadValues({}, mark.data), {
|
|
1798
1799
|
value: __spreadProps(__spreadValues({}, (_b = mark.data) == null ? void 0 : _b.value), {
|
|
1799
|
-
id: (
|
|
1800
|
+
id: (_c2 = context.replacementContext.typographyIds.get(typographyId)) != null ? _c2 : typographyId,
|
|
1800
1801
|
style: (_d = mark.data) == null ? void 0 : _d.value.style.map((override) => {
|
|
1801
|
-
var
|
|
1802
|
+
var _a2, _b2, _c3;
|
|
1802
1803
|
return __spreadProps(__spreadValues({}, override), {
|
|
1803
1804
|
value: __spreadProps(__spreadValues({}, override.value), {
|
|
1804
1805
|
color: override.value.color == null ? override.value.color : __spreadProps(__spreadValues({}, override.value.color), {
|
|
1805
|
-
swatchId: (
|
|
1806
|
+
swatchId: (_c3 = context.replacementContext.swatchIds.get((_a2 = override.value.color) == null ? void 0 : _a2.swatchId)) != null ? _c3 : (_b2 = override.value.color) == null ? void 0 : _b2.swatchId
|
|
1806
1807
|
})
|
|
1807
1808
|
})
|
|
1808
1809
|
});
|
|
@@ -1953,110 +1954,89 @@ function copy$1(descriptor, value, context) {
|
|
|
1953
1954
|
function copyElementReference(value, context) {
|
|
1954
1955
|
return context.replacementContext.globalElementIds.get(value) || value;
|
|
1955
1956
|
}
|
|
1956
|
-
function
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
case ColorControlType:
|
|
1973
|
-
return copyColorData(value, context);
|
|
1974
|
-
case ImageControlType:
|
|
1975
|
-
return copyImageData(value, context);
|
|
1976
|
-
case LinkControlType:
|
|
1977
|
-
return copyLinkData(value, context);
|
|
1978
|
-
case ShapeControlType:
|
|
1979
|
-
return copyShapeData(definition2, value, context);
|
|
1980
|
-
case ListControlType:
|
|
1981
|
-
return copyListData(definition2, value, context);
|
|
1982
|
-
case StyleControlType:
|
|
1983
|
-
return copyStyleData(value, context);
|
|
1984
|
-
case SlotControlType:
|
|
1985
|
-
return copySlotData(value, context);
|
|
1986
|
-
default:
|
|
1987
|
-
return value;
|
|
1988
|
-
}
|
|
1989
|
-
}
|
|
1990
|
-
function merge(definition2, a, b = a, context) {
|
|
1991
|
-
switch (definition2.type) {
|
|
1992
|
-
case SlotControlType:
|
|
1993
|
-
return mergeSlotData(a, b, context);
|
|
1994
|
-
default:
|
|
1995
|
-
return b;
|
|
1957
|
+
function copyRichTextData(value, context) {
|
|
1958
|
+
if (value == null)
|
|
1959
|
+
return value;
|
|
1960
|
+
return __spreadProps(__spreadValues({}, value), { document: value.document ? copyNode(value.document) : value.document });
|
|
1961
|
+
function copyNode(node) {
|
|
1962
|
+
var _a;
|
|
1963
|
+
switch (node.object) {
|
|
1964
|
+
case "document":
|
|
1965
|
+
case "block":
|
|
1966
|
+
case "inline":
|
|
1967
|
+
return copyInline(node);
|
|
1968
|
+
case "text":
|
|
1969
|
+
return __spreadProps(__spreadValues({}, node), { marks: (_a = node.marks) == null ? void 0 : _a.map(copyMark) });
|
|
1970
|
+
default:
|
|
1971
|
+
return node;
|
|
1972
|
+
}
|
|
1996
1973
|
}
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
};
|
|
2007
|
-
|
|
2008
|
-
function unstable_IconRadioGroup(config) {
|
|
2009
|
-
return { type: IconRadioGroupControlType, config };
|
|
2010
|
-
}
|
|
2011
|
-
const SelectControlType = "makeswift::controls::select";
|
|
2012
|
-
function Select(config) {
|
|
2013
|
-
return { type: SelectControlType, config };
|
|
2014
|
-
}
|
|
2015
|
-
const isServer = typeof window === "undefined";
|
|
2016
|
-
const useInsertionEffectSpecifier = "useInsertionEffect";
|
|
2017
|
-
const useInsertionEffect = (_a = React__default[useInsertionEffectSpecifier]) != null ? _a : React__default.useLayoutEffect;
|
|
2018
|
-
function useStyle(style) {
|
|
2019
|
-
const serialized = serializeStyles([style], cache.registered);
|
|
2020
|
-
registerStyles(cache, serialized, false);
|
|
2021
|
-
useInsertionEffect(() => {
|
|
2022
|
-
insertStyles(cache, serialized, false);
|
|
2023
|
-
});
|
|
2024
|
-
if (isServer)
|
|
2025
|
-
insertStyles(cache, serialized, false);
|
|
2026
|
-
return `${cache.key}-${serialized.name}`;
|
|
2027
|
-
}
|
|
2028
|
-
const StyleV2ControlType = "makeswift::controls::style-v2";
|
|
2029
|
-
const unstable_useStyleV2ClassName = useStyle;
|
|
2030
|
-
function unstable_StyleV2(config) {
|
|
2031
|
-
return { type: StyleV2ControlType, config };
|
|
2032
|
-
}
|
|
2033
|
-
const StyleV2ControlMessageType = {
|
|
2034
|
-
CHANGE_BOX_MODEL: "makeswift::controls::style::message::change-box-model",
|
|
2035
|
-
STYLE_V2_CONTROL_CHILD_CONTROL_MESSAGE: "makeswift::controls::style-v2::message::child-control-message"
|
|
2036
|
-
};
|
|
2037
|
-
class StyleV2Control extends PropController {
|
|
2038
|
-
constructor(send, descriptor) {
|
|
2039
|
-
super(send);
|
|
2040
|
-
__publicField(this, "control");
|
|
2041
|
-
this.control = createPropController(descriptor.config.type, (message) => {
|
|
2042
|
-
this.send({
|
|
2043
|
-
type: StyleV2ControlMessageType.STYLE_V2_CONTROL_CHILD_CONTROL_MESSAGE,
|
|
2044
|
-
payload: { message }
|
|
2045
|
-
});
|
|
2046
|
-
});
|
|
1974
|
+
function copyInline(inline) {
|
|
1975
|
+
var _a, _b;
|
|
1976
|
+
switch (inline.type) {
|
|
1977
|
+
case "link":
|
|
1978
|
+
return __spreadProps(__spreadValues({}, inline), {
|
|
1979
|
+
nodes: (_a = inline.nodes) == null ? void 0 : _a.map(copyNode),
|
|
1980
|
+
data: inline.data ? copyLinkData2(inline.data) : inline.data
|
|
1981
|
+
});
|
|
1982
|
+
default:
|
|
1983
|
+
return __spreadProps(__spreadValues({}, inline), { nodes: (_b = inline.nodes) == null ? void 0 : _b.map(copyNode) });
|
|
1984
|
+
}
|
|
2047
1985
|
}
|
|
2048
|
-
|
|
2049
|
-
|
|
1986
|
+
function copyLinkData2(data) {
|
|
1987
|
+
var _a, _b;
|
|
1988
|
+
switch (data.type) {
|
|
1989
|
+
case "OPEN_PAGE": {
|
|
1990
|
+
const pageId = data.payload.pageId;
|
|
1991
|
+
if (pageId == null)
|
|
1992
|
+
return data;
|
|
1993
|
+
return __spreadProps(__spreadValues({}, data), {
|
|
1994
|
+
payload: __spreadProps(__spreadValues({}, data.payload), {
|
|
1995
|
+
pageId: (_a = context.replacementContext.pageIds.get(pageId)) != null ? _a : data.payload.pageId
|
|
1996
|
+
})
|
|
1997
|
+
});
|
|
1998
|
+
}
|
|
1999
|
+
case "SCROLL_TO_ELEMENT": {
|
|
2000
|
+
const elementIdConfig = data.payload.elementIdConfig;
|
|
2001
|
+
if (elementIdConfig == null)
|
|
2002
|
+
return data;
|
|
2003
|
+
return __spreadProps(__spreadValues({}, data), {
|
|
2004
|
+
payload: __spreadProps(__spreadValues({}, data.payload), {
|
|
2005
|
+
elementIdConfig: __spreadProps(__spreadValues({}, elementIdConfig), {
|
|
2006
|
+
elementKey: (_b = context.replacementContext.elementKeys.get(elementIdConfig.elementKey)) != null ? _b : elementIdConfig.elementKey
|
|
2007
|
+
})
|
|
2008
|
+
})
|
|
2009
|
+
});
|
|
2010
|
+
}
|
|
2011
|
+
default:
|
|
2012
|
+
return data;
|
|
2013
|
+
}
|
|
2050
2014
|
}
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2015
|
+
function copyMark(mark) {
|
|
2016
|
+
var _a, _b, _c2, _d;
|
|
2017
|
+
switch (mark.type) {
|
|
2018
|
+
case "typography": {
|
|
2019
|
+
const typographyId = (_a = mark.data) == null ? void 0 : _a.value.id;
|
|
2020
|
+
return __spreadProps(__spreadValues({}, mark), {
|
|
2021
|
+
data: __spreadProps(__spreadValues({}, mark.data), {
|
|
2022
|
+
value: __spreadProps(__spreadValues({}, (_b = mark.data) == null ? void 0 : _b.value), {
|
|
2023
|
+
id: (_c2 = context.replacementContext.typographyIds.get(typographyId)) != null ? _c2 : typographyId,
|
|
2024
|
+
style: (_d = mark.data) == null ? void 0 : _d.value.style.map((override) => {
|
|
2025
|
+
var _a2, _b2, _c3;
|
|
2026
|
+
return __spreadProps(__spreadValues({}, override), {
|
|
2027
|
+
value: __spreadProps(__spreadValues({}, override.value), {
|
|
2028
|
+
color: override.value.color == null ? override.value.color : __spreadProps(__spreadValues({}, override.value.color), {
|
|
2029
|
+
swatchId: (_c3 = context.replacementContext.swatchIds.get((_a2 = override.value.color) == null ? void 0 : _a2.swatchId)) != null ? _c3 : (_b2 = override.value.color) == null ? void 0 : _b2.swatchId
|
|
2030
|
+
})
|
|
2031
|
+
})
|
|
2032
|
+
});
|
|
2033
|
+
})
|
|
2034
|
+
})
|
|
2035
|
+
})
|
|
2036
|
+
});
|
|
2059
2037
|
}
|
|
2038
|
+
default:
|
|
2039
|
+
return mark;
|
|
2060
2040
|
}
|
|
2061
2041
|
}
|
|
2062
2042
|
}
|
|
@@ -2110,22 +2090,22 @@ function isText(node) {
|
|
|
2110
2090
|
return false;
|
|
2111
2091
|
}
|
|
2112
2092
|
function toTextDAO(node) {
|
|
2113
|
-
var
|
|
2114
|
-
const typographyMark = (
|
|
2093
|
+
var _a, _b, _c2, _d;
|
|
2094
|
+
const typographyMark = (_a = node.marks) == null ? void 0 : _a.find((mark) => mark.type === "typography");
|
|
2115
2095
|
return [
|
|
2116
2096
|
{
|
|
2117
2097
|
text: (_b = node.text) != null ? _b : "",
|
|
2118
|
-
typography: (_d = (
|
|
2098
|
+
typography: (_d = (_c2 = typographyMark == null ? void 0 : typographyMark.data) == null ? void 0 : _c2.value) != null ? _d : void 0
|
|
2119
2099
|
}
|
|
2120
2100
|
];
|
|
2121
2101
|
}
|
|
2122
2102
|
function toInlineDAO(node) {
|
|
2123
|
-
var
|
|
2103
|
+
var _a, _b, _c2, _d;
|
|
2124
2104
|
switch (node.type) {
|
|
2125
2105
|
case InlineType.Link:
|
|
2126
2106
|
return [
|
|
2127
2107
|
{
|
|
2128
|
-
children: (_b = (
|
|
2108
|
+
children: (_b = (_a = node.nodes) == null ? void 0 : _a.flatMap(toInlineOrTextDAO)) != null ? _b : [],
|
|
2129
2109
|
[node.type]: node.data,
|
|
2130
2110
|
type: node.type
|
|
2131
2111
|
}
|
|
@@ -2135,7 +2115,7 @@ function toInlineDAO(node) {
|
|
|
2135
2115
|
case InlineType.SuperScript:
|
|
2136
2116
|
return [
|
|
2137
2117
|
{
|
|
2138
|
-
children: (_d = (
|
|
2118
|
+
children: (_d = (_c2 = node.nodes) == null ? void 0 : _c2.flatMap(toInlineOrTextDAO)) != null ? _d : [],
|
|
2139
2119
|
type: node.type
|
|
2140
2120
|
}
|
|
2141
2121
|
];
|
|
@@ -2171,8 +2151,8 @@ function toNodeDAO(node) {
|
|
|
2171
2151
|
}
|
|
2172
2152
|
}
|
|
2173
2153
|
function richTextDTOtoSelection(data) {
|
|
2174
|
-
var
|
|
2175
|
-
if (((_b = (
|
|
2154
|
+
var _a, _b, _c2, _d;
|
|
2155
|
+
if (((_b = (_a = data.selection) == null ? void 0 : _a.anchor) == null ? void 0 : _b.offset) != null && data.selection.anchor.path != null && ((_d = (_c2 = data.selection) == null ? void 0 : _c2.focus) == null ? void 0 : _d.offset) != null && data.selection.focus.path != null)
|
|
2176
2156
|
return {
|
|
2177
2157
|
anchor: {
|
|
2178
2158
|
offset: data.selection.anchor.offset,
|
|
@@ -2186,11 +2166,11 @@ function richTextDTOtoSelection(data) {
|
|
|
2186
2166
|
return null;
|
|
2187
2167
|
}
|
|
2188
2168
|
function richTextDTOtoDAO(data) {
|
|
2189
|
-
var
|
|
2190
|
-
return (
|
|
2169
|
+
var _a, _b, _c2;
|
|
2170
|
+
return (_c2 = (_b = (_a = data.document) == null ? void 0 : _a.nodes) == null ? void 0 : _b.flatMap(toNodeDAO)) != null ? _c2 : [];
|
|
2191
2171
|
}
|
|
2192
2172
|
function toInlineOrTextDTO(node) {
|
|
2193
|
-
var
|
|
2173
|
+
var _a;
|
|
2194
2174
|
if (isText(node)) {
|
|
2195
2175
|
return [
|
|
2196
2176
|
{
|
|
@@ -2215,7 +2195,7 @@ function toInlineOrTextDTO(node) {
|
|
|
2215
2195
|
object: ObjectType.Inline,
|
|
2216
2196
|
nodes: node.children.flatMap(toInlineOrTextDTO),
|
|
2217
2197
|
type: node.type,
|
|
2218
|
-
data: (
|
|
2198
|
+
data: (_a = node.link) != null ? _a : void 0
|
|
2219
2199
|
}
|
|
2220
2200
|
];
|
|
2221
2201
|
case InlineType.Code:
|
|
@@ -2232,7 +2212,7 @@ function toInlineOrTextDTO(node) {
|
|
|
2232
2212
|
}
|
|
2233
2213
|
}
|
|
2234
2214
|
function toNodeDTO(node) {
|
|
2235
|
-
var
|
|
2215
|
+
var _a, _b;
|
|
2236
2216
|
if (isText(node))
|
|
2237
2217
|
return toInlineOrTextDTO(node);
|
|
2238
2218
|
switch (node.type) {
|
|
@@ -2261,7 +2241,7 @@ function toNodeDTO(node) {
|
|
|
2261
2241
|
textAlign: node.textAlign
|
|
2262
2242
|
} : {},
|
|
2263
2243
|
object: "block",
|
|
2264
|
-
nodes: (_b = (
|
|
2244
|
+
nodes: (_b = (_a = node.children) == null ? void 0 : _a.flatMap(toNodeDTO)) != null ? _b : []
|
|
2265
2245
|
}
|
|
2266
2246
|
];
|
|
2267
2247
|
default:
|
|
@@ -2367,17 +2347,6 @@ class RichTextControl extends PropController {
|
|
|
2367
2347
|
this.send({ type: RichTextControlMessageType.CHANGE_BOX_MODEL, payload: { boxModel } });
|
|
2368
2348
|
}
|
|
2369
2349
|
}
|
|
2370
|
-
function richTextV2DataToDescendents(data) {
|
|
2371
|
-
return data.descendants;
|
|
2372
|
-
}
|
|
2373
|
-
function richTextV2DescendentsToData(descendants, key) {
|
|
2374
|
-
return {
|
|
2375
|
-
type: RichTextV2ControlType,
|
|
2376
|
-
version: 2,
|
|
2377
|
-
descendants,
|
|
2378
|
-
key
|
|
2379
|
-
};
|
|
2380
|
-
}
|
|
2381
2350
|
function createRichTextV2Plugin({
|
|
2382
2351
|
control,
|
|
2383
2352
|
withPlugin,
|
|
@@ -2524,9 +2493,9 @@ function getBlocksInSelection(editor) {
|
|
|
2524
2493
|
})).filter((entry) => ElementUtils.isRootBlock(entry[0]));
|
|
2525
2494
|
}
|
|
2526
2495
|
function getActiveBlockType(editor) {
|
|
2527
|
-
var
|
|
2496
|
+
var _a;
|
|
2528
2497
|
const rootBlocks = getBlocksInSelection(editor).map(([node]) => node.type);
|
|
2529
|
-
return rootBlocks.reduce((a, b) => a === b ? b : null, (
|
|
2498
|
+
return rootBlocks.reduce((a, b) => a === b ? b : null, (_a = rootBlocks.at(0)) != null ? _a : null);
|
|
2530
2499
|
}
|
|
2531
2500
|
function unwrapInline(editor, type) {
|
|
2532
2501
|
Transforms.unwrapNodes(editor, {
|
|
@@ -2552,13 +2521,13 @@ function getLinksAndTextInSelection(editor) {
|
|
|
2552
2521
|
}));
|
|
2553
2522
|
}
|
|
2554
2523
|
const getValue$3 = (editor) => {
|
|
2555
|
-
var
|
|
2524
|
+
var _a;
|
|
2556
2525
|
const roots = filterForSubtreeRoots(getLinksAndTextInSelection(editor));
|
|
2557
2526
|
const areAllRootsLinks = roots.every(([root]) => isLinkElement(root) || Text.isText(root));
|
|
2558
2527
|
if (!areAllRootsLinks)
|
|
2559
2528
|
return void 0;
|
|
2560
2529
|
const matchingValues = roots.map(([node]) => node).filter(isLinkElement);
|
|
2561
|
-
const match = matchingValues.reduce((a, b) => deepEqual(a == null ? void 0 : a.link, b == null ? void 0 : b.link) ? b : null, (
|
|
2530
|
+
const match = matchingValues.reduce((a, b) => deepEqual(a == null ? void 0 : a.link, b == null ? void 0 : b.link) ? b : null, (_a = matchingValues.at(0)) != null ? _a : void 0);
|
|
2562
2531
|
return match == null ? match : match.link;
|
|
2563
2532
|
};
|
|
2564
2533
|
const onChange$1 = (editor, value) => {
|
|
@@ -2589,6 +2558,19 @@ function LinkPlugin() {
|
|
|
2589
2558
|
}
|
|
2590
2559
|
});
|
|
2591
2560
|
}
|
|
2561
|
+
const unstable_IconRadioGroupIcon = {
|
|
2562
|
+
TextAlignCenter: "TextAlignCenter",
|
|
2563
|
+
TextAlignJustify: "TextAlignJustify",
|
|
2564
|
+
TextAlignLeft: "TextAlignLeft",
|
|
2565
|
+
TextAlignRight: "TextAlignRight",
|
|
2566
|
+
Superscript: "Superscript16",
|
|
2567
|
+
Subscript: "Subscript16",
|
|
2568
|
+
Code: "Code16"
|
|
2569
|
+
};
|
|
2570
|
+
const IconRadioGroupControlType = "makeswift::controls::icon-radio-group";
|
|
2571
|
+
function unstable_IconRadioGroup(config) {
|
|
2572
|
+
return { type: IconRadioGroupControlType, config };
|
|
2573
|
+
}
|
|
2592
2574
|
const supportedInlineOptions = [
|
|
2593
2575
|
{
|
|
2594
2576
|
icon: unstable_IconRadioGroupIcon.Superscript,
|
|
@@ -2620,13 +2602,13 @@ function getSupportedInlinesAndTextInSelection(editor) {
|
|
|
2620
2602
|
}));
|
|
2621
2603
|
}
|
|
2622
2604
|
const getValue$2 = (editor) => {
|
|
2623
|
-
var
|
|
2605
|
+
var _a;
|
|
2624
2606
|
const roots = filterForSubtreeRoots(getSupportedInlinesAndTextInSelection(editor));
|
|
2625
2607
|
const areAllRootsSupportedInlineTypesOrText = roots.every((entry) => isSupportedInlineEntry(entry) || Text.isText(entry[0]));
|
|
2626
2608
|
if (!areAllRootsSupportedInlineTypesOrText)
|
|
2627
2609
|
return void 0;
|
|
2628
2610
|
const matchingValues = roots.filter(isSupportedInlineEntry).map(([node]) => node);
|
|
2629
|
-
const match = matchingValues.reduce((a, b) => (a == null ? void 0 : a.type) === (b == null ? void 0 : b.type) ? b : null, (
|
|
2611
|
+
const match = matchingValues.reduce((a, b) => (a == null ? void 0 : a.type) === (b == null ? void 0 : b.type) ? b : null, (_a = matchingValues.at(0)) != null ? _a : void 0);
|
|
2630
2612
|
return match == null ? match : match.type;
|
|
2631
2613
|
};
|
|
2632
2614
|
const onChange = (editor, value) => {
|
|
@@ -2682,10 +2664,10 @@ function InlinePlugin() {
|
|
|
2682
2664
|
}
|
|
2683
2665
|
});
|
|
2684
2666
|
}
|
|
2685
|
-
function InlinePluginComponent(
|
|
2686
|
-
var
|
|
2667
|
+
function InlinePluginComponent(_a) {
|
|
2668
|
+
var _b = _a, {
|
|
2687
2669
|
renderElement
|
|
2688
|
-
} =
|
|
2670
|
+
} = _b, props = __objRest(_b, [
|
|
2689
2671
|
"renderElement"
|
|
2690
2672
|
]);
|
|
2691
2673
|
switch (props.element.type) {
|
|
@@ -2845,8 +2827,8 @@ function TextAlignPlugin() {
|
|
|
2845
2827
|
});
|
|
2846
2828
|
}
|
|
2847
2829
|
function setBlockKeyForDevice(editor, breakpoints, deviceId, key, value, options) {
|
|
2848
|
-
var
|
|
2849
|
-
const at = (
|
|
2830
|
+
var _a, _b;
|
|
2831
|
+
const at = (_a = options == null ? void 0 : options.at) != null ? _a : editor.selection;
|
|
2850
2832
|
if (!at)
|
|
2851
2833
|
return;
|
|
2852
2834
|
const rootElements = getBlocksInSelection(editor);
|
|
@@ -2865,17 +2847,21 @@ function setBlockKeyForDevice(editor, breakpoints, deviceId, key, value, options
|
|
|
2865
2847
|
}
|
|
2866
2848
|
}
|
|
2867
2849
|
function clearBlockKeyForDevice(editor, deviceId, key) {
|
|
2868
|
-
var
|
|
2850
|
+
var _a;
|
|
2869
2851
|
const rootElements = getBlocksInSelection(editor);
|
|
2870
2852
|
for (const [node, path] of rootElements) {
|
|
2871
2853
|
if (ElementUtils.isBlock(node)) {
|
|
2872
|
-
const deviceOverrides = (
|
|
2854
|
+
const deviceOverrides = (_a = node[key]) != null ? _a : [];
|
|
2873
2855
|
Transforms.setNodes(editor, {
|
|
2874
2856
|
[key]: deviceOverrides.filter((v) => v.deviceId !== deviceId)
|
|
2875
2857
|
}, { at: path });
|
|
2876
2858
|
}
|
|
2877
2859
|
}
|
|
2878
2860
|
}
|
|
2861
|
+
const SelectControlType = "makeswift::controls::select";
|
|
2862
|
+
function Select(config) {
|
|
2863
|
+
return { type: SelectControlType, config };
|
|
2864
|
+
}
|
|
2879
2865
|
const EditorUtils = {
|
|
2880
2866
|
getFirstAncestorList(editor, path) {
|
|
2881
2867
|
try {
|
|
@@ -2925,8 +2911,8 @@ function unwrapPath(editor, listItemPath) {
|
|
|
2925
2911
|
});
|
|
2926
2912
|
}
|
|
2927
2913
|
function unwrapList(editor, options) {
|
|
2928
|
-
var
|
|
2929
|
-
const at = (
|
|
2914
|
+
var _a;
|
|
2915
|
+
const at = (_a = options == null ? void 0 : options.at) != null ? _a : editor.selection;
|
|
2930
2916
|
if (!at)
|
|
2931
2917
|
return;
|
|
2932
2918
|
const listItems = Array.from(Editor.nodes(editor, {
|
|
@@ -2945,8 +2931,8 @@ function unwrapList(editor, options) {
|
|
|
2945
2931
|
});
|
|
2946
2932
|
}
|
|
2947
2933
|
function wrapList(editor, options = { type: BlockType.UnorderedList }) {
|
|
2948
|
-
var
|
|
2949
|
-
const at = (
|
|
2934
|
+
var _a;
|
|
2935
|
+
const at = (_a = options.at) != null ? _a : editor.selection;
|
|
2950
2936
|
if (!at)
|
|
2951
2937
|
return;
|
|
2952
2938
|
const nonListEntries = Array.from(Editor.nodes(editor, {
|
|
@@ -2985,7 +2971,7 @@ const LocationUtils = {
|
|
|
2985
2971
|
}
|
|
2986
2972
|
};
|
|
2987
2973
|
function getSelectedListItems(editor) {
|
|
2988
|
-
var
|
|
2974
|
+
var _a, _b;
|
|
2989
2975
|
if (!editor.selection)
|
|
2990
2976
|
return [];
|
|
2991
2977
|
const start = LocationUtils.getStartPath(editor.selection);
|
|
@@ -2993,7 +2979,7 @@ function getSelectedListItems(editor) {
|
|
|
2993
2979
|
at: editor.selection,
|
|
2994
2980
|
match: (node) => ElementUtils.isListItem(node)
|
|
2995
2981
|
});
|
|
2996
|
-
const firstAncestorPath = (_b = (
|
|
2982
|
+
const firstAncestorPath = (_b = (_a = EditorUtils.getFirstAncestorListItem(editor, start)) == null ? void 0 : _a[1]) != null ? _b : [];
|
|
2997
2983
|
return Array.from(listItems).filter((node) => Path.isDescendant(start, node[1]) ? Path.equals(node[1], firstAncestorPath) : !Path.isAfter(start, node[1]));
|
|
2998
2984
|
}
|
|
2999
2985
|
function indentPath(editor, path) {
|
|
@@ -3070,8 +3056,8 @@ function dedent(editor) {
|
|
|
3070
3056
|
});
|
|
3071
3057
|
}
|
|
3072
3058
|
function toggleList(editor, options = { type: BlockType.UnorderedList }) {
|
|
3073
|
-
var
|
|
3074
|
-
const at = (
|
|
3059
|
+
var _a;
|
|
3060
|
+
const at = (_a = options.at) != null ? _a : editor.selection;
|
|
3075
3061
|
if (at == null)
|
|
3076
3062
|
return;
|
|
3077
3063
|
const start = LocationUtils.getStartPath(at);
|
|
@@ -3088,6 +3074,19 @@ function toggleList(editor, options = { type: BlockType.UnorderedList }) {
|
|
|
3088
3074
|
Transforms.setNodes(editor, { type: options.type }, { at: ancestorPath });
|
|
3089
3075
|
}
|
|
3090
3076
|
}
|
|
3077
|
+
const isServer = typeof window === "undefined";
|
|
3078
|
+
const useInsertionEffectSpecifier = "useInsertionEffect";
|
|
3079
|
+
const useInsertionEffect = (_c = React__default[useInsertionEffectSpecifier]) != null ? _c : React__default.useLayoutEffect;
|
|
3080
|
+
function useStyle(style) {
|
|
3081
|
+
const serialized = serializeStyles([style], cache.registered);
|
|
3082
|
+
registerStyles(cache, serialized, false);
|
|
3083
|
+
useInsertionEffect(() => {
|
|
3084
|
+
insertStyles(cache, serialized, false);
|
|
3085
|
+
});
|
|
3086
|
+
if (isServer)
|
|
3087
|
+
insertStyles(cache, serialized, false);
|
|
3088
|
+
return `${cache.key}-${serialized.name}`;
|
|
3089
|
+
}
|
|
3091
3090
|
const BlockActions = {
|
|
3092
3091
|
setBlockKeyForDevice,
|
|
3093
3092
|
clearBlockKeyForDevice,
|
|
@@ -3169,9 +3168,9 @@ function withBlock(editor) {
|
|
|
3169
3168
|
return ElementUtils.isInline(entry);
|
|
3170
3169
|
};
|
|
3171
3170
|
editor.normalizeNode = (entry) => {
|
|
3172
|
-
var
|
|
3171
|
+
var _a;
|
|
3173
3172
|
const [normalizationNode, normalizationPath] = entry;
|
|
3174
|
-
if (ElementUtils.isBlock(normalizationNode) && ((
|
|
3173
|
+
if (ElementUtils.isBlock(normalizationNode) && ((_a = normalizationNode == null ? void 0 : normalizationNode.textAlign) == null ? void 0 : _a.length) == 0) {
|
|
3175
3174
|
Transforms.unsetNodes(editor, "textAlign", {
|
|
3176
3175
|
at: normalizationPath
|
|
3177
3176
|
});
|
|
@@ -3412,8 +3411,8 @@ function BlockPluginComponent(_d) {
|
|
|
3412
3411
|
}
|
|
3413
3412
|
function clearActiveTypographyStyle(editor, options) {
|
|
3414
3413
|
Editor.withoutNormalizing(editor, () => {
|
|
3415
|
-
var
|
|
3416
|
-
const at = (
|
|
3414
|
+
var _a;
|
|
3415
|
+
const at = (_a = options == null ? void 0 : options.at) != null ? _a : editor.selection;
|
|
3417
3416
|
if (!at)
|
|
3418
3417
|
return;
|
|
3419
3418
|
const atRef = Editor.rangeRef(editor, at);
|
|
@@ -3447,8 +3446,8 @@ function clearActiveTypographyStyle(editor, options) {
|
|
|
3447
3446
|
}
|
|
3448
3447
|
function clearDeviceActiveTypography(editor, currentDeviceId, options) {
|
|
3449
3448
|
Editor.withoutNormalizing(editor, () => {
|
|
3450
|
-
var
|
|
3451
|
-
const at = (
|
|
3449
|
+
var _a, _b, _c2;
|
|
3450
|
+
const at = (_a = options == null ? void 0 : options.at) != null ? _a : editor.selection;
|
|
3452
3451
|
if (!at)
|
|
3453
3452
|
return;
|
|
3454
3453
|
const atRef = Editor.rangeRef(editor, at);
|
|
@@ -3469,7 +3468,7 @@ function clearDeviceActiveTypography(editor, currentDeviceId, options) {
|
|
|
3469
3468
|
for (const [node, path] of textNodes) {
|
|
3470
3469
|
if (Text.isText(node)) {
|
|
3471
3470
|
const typography = __spreadProps(__spreadValues({}, node.typography), {
|
|
3472
|
-
style: (
|
|
3471
|
+
style: (_c2 = (_b = node == null ? void 0 : node.typography) == null ? void 0 : _b.style.filter(({ deviceId }) => deviceId !== currentDeviceId)) != null ? _c2 : []
|
|
3473
3472
|
});
|
|
3474
3473
|
Transforms.setNodes(editor, {
|
|
3475
3474
|
typography
|
|
@@ -3482,8 +3481,8 @@ function clearDeviceActiveTypography(editor, currentDeviceId, options) {
|
|
|
3482
3481
|
}
|
|
3483
3482
|
function detachActiveTypography(editor, value, options) {
|
|
3484
3483
|
Editor.withoutNormalizing(editor, () => {
|
|
3485
|
-
var
|
|
3486
|
-
const at = (
|
|
3484
|
+
var _a;
|
|
3485
|
+
const at = (_a = options == null ? void 0 : options.at) != null ? _a : editor.selection;
|
|
3487
3486
|
if (!at)
|
|
3488
3487
|
return;
|
|
3489
3488
|
const atRef = Editor.rangeRef(editor, at);
|
|
@@ -3515,8 +3514,8 @@ function detachActiveTypography(editor, value, options) {
|
|
|
3515
3514
|
});
|
|
3516
3515
|
}
|
|
3517
3516
|
function setActiveTypographyId(editor, id, options) {
|
|
3518
|
-
var
|
|
3519
|
-
const at = (
|
|
3517
|
+
var _a;
|
|
3518
|
+
const at = (_a = options == null ? void 0 : options.at) != null ? _a : editor.selection;
|
|
3520
3519
|
if (!at)
|
|
3521
3520
|
return;
|
|
3522
3521
|
Transforms.setNodes(editor, {
|
|
@@ -3532,8 +3531,8 @@ function setActiveTypographyId(editor, id, options) {
|
|
|
3532
3531
|
}
|
|
3533
3532
|
function setActiveTypographyStyle(editor, breakpoints, deviceId, prop, value, options) {
|
|
3534
3533
|
Editor.withoutNormalizing(editor, () => {
|
|
3535
|
-
var
|
|
3536
|
-
const at = (
|
|
3534
|
+
var _a, _b, _c2;
|
|
3535
|
+
const at = (_a = options == null ? void 0 : options.at) != null ? _a : editor.selection;
|
|
3537
3536
|
if (!at)
|
|
3538
3537
|
return;
|
|
3539
3538
|
const atRef = Editor.rangeRef(editor, at);
|
|
@@ -3553,7 +3552,7 @@ function setActiveTypographyStyle(editor, breakpoints, deviceId, prop, value, op
|
|
|
3553
3552
|
}));
|
|
3554
3553
|
for (const [node, path] of textNodes) {
|
|
3555
3554
|
if (Text.isText(node)) {
|
|
3556
|
-
const deviceOverrides = (
|
|
3555
|
+
const deviceOverrides = (_c2 = (_b = node == null ? void 0 : node.typography) == null ? void 0 : _b.style) != null ? _c2 : [];
|
|
3557
3556
|
const deviceStyle = findBreakpointOverride(breakpoints, deviceOverrides, deviceId, (v) => v) || {
|
|
3558
3557
|
value: {}
|
|
3559
3558
|
};
|
|
@@ -3591,9 +3590,9 @@ const TYPOGRAPHY_KEY = "typography";
|
|
|
3591
3590
|
function withTypography(editor) {
|
|
3592
3591
|
const { normalizeNode } = editor;
|
|
3593
3592
|
editor.normalizeNode = (entry) => {
|
|
3594
|
-
var
|
|
3593
|
+
var _a, _b;
|
|
3595
3594
|
const [normalizationNode, normalizationPath] = entry;
|
|
3596
|
-
if (Text.isText(normalizationNode) && ((
|
|
3595
|
+
if (Text.isText(normalizationNode) && ((_a = normalizationNode == null ? void 0 : normalizationNode.typography) == null ? void 0 : _a.id) == null && ((_b = normalizationNode == null ? void 0 : normalizationNode.typography) == null ? void 0 : _b.style.length) === 0) {
|
|
3597
3596
|
Transforms.unsetNodes(editor, TYPOGRAPHY_KEY, { at: normalizationPath });
|
|
3598
3597
|
return;
|
|
3599
3598
|
}
|
|
@@ -3746,7 +3745,7 @@ class RichTextV2Control extends PropController {
|
|
|
3746
3745
|
__publicField(this, "defaultValue", null);
|
|
3747
3746
|
__publicField(this, "descriptor");
|
|
3748
3747
|
__publicField(this, "recv", (message) => {
|
|
3749
|
-
var
|
|
3748
|
+
var _a, _b, _c2;
|
|
3750
3749
|
if (!this.editor)
|
|
3751
3750
|
return;
|
|
3752
3751
|
switch (message.type) {
|
|
@@ -3764,7 +3763,7 @@ class RichTextV2Control extends PropController {
|
|
|
3764
3763
|
break;
|
|
3765
3764
|
}
|
|
3766
3765
|
case RichTextV2ControlMessageType.RUN_PLUGIN_CONTROL_ACTION: {
|
|
3767
|
-
(
|
|
3766
|
+
(_c2 = (_b = (_a = this.descriptor.config.plugins) == null ? void 0 : _a.at(message.pluginIndex)) == null ? void 0 : _b.control) == null ? void 0 : _c2.onChange(this.editor, message.value);
|
|
3768
3767
|
break;
|
|
3769
3768
|
}
|
|
3770
3769
|
}
|
|
@@ -3773,14 +3772,14 @@ class RichTextV2Control extends PropController {
|
|
|
3773
3772
|
this.send = send;
|
|
3774
3773
|
}
|
|
3775
3774
|
setEditor(editor) {
|
|
3776
|
-
var
|
|
3775
|
+
var _a, _b, _c2;
|
|
3777
3776
|
this.editor = editor;
|
|
3778
3777
|
this.send({
|
|
3779
3778
|
type: RichTextV2ControlMessageType.SET_PLUGIN_CONTROL_VALUE,
|
|
3780
|
-
value: (
|
|
3781
|
-
var
|
|
3782
|
-
return (
|
|
3783
|
-
})) != null ?
|
|
3779
|
+
value: (_c2 = (_b = (_a = this.descriptor.config) == null ? void 0 : _a.plugins) == null ? void 0 : _b.map((plugin) => {
|
|
3780
|
+
var _a2;
|
|
3781
|
+
return (_a2 = plugin == null ? void 0 : plugin.control) == null ? void 0 : _a2.getValue(editor);
|
|
3782
|
+
})) != null ? _c2 : []
|
|
3784
3783
|
});
|
|
3785
3784
|
const _onChange = editor.onChange;
|
|
3786
3785
|
this.editor.onChange = (options) => {
|
|
@@ -3807,16 +3806,16 @@ class RichTextV2Control extends PropController {
|
|
|
3807
3806
|
});
|
|
3808
3807
|
}
|
|
3809
3808
|
updatePluginValues() {
|
|
3810
|
-
var
|
|
3809
|
+
var _a, _b, _c2;
|
|
3811
3810
|
const editor = this.editor;
|
|
3812
3811
|
if (editor == null)
|
|
3813
3812
|
return;
|
|
3814
3813
|
this.send({
|
|
3815
3814
|
type: RichTextV2ControlMessageType.SET_PLUGIN_CONTROL_VALUE,
|
|
3816
|
-
value: (
|
|
3817
|
-
var
|
|
3818
|
-
return (
|
|
3819
|
-
})) != null ?
|
|
3815
|
+
value: (_c2 = (_b = (_a = this.descriptor.config) == null ? void 0 : _a.plugins) == null ? void 0 : _b.map((plugin) => {
|
|
3816
|
+
var _a2;
|
|
3817
|
+
return (_a2 = plugin == null ? void 0 : plugin.control) == null ? void 0 : _a2.getValue(editor);
|
|
3818
|
+
})) != null ? _c2 : []
|
|
3820
3819
|
});
|
|
3821
3820
|
}
|
|
3822
3821
|
select() {
|
|
@@ -3838,6 +3837,171 @@ class RichTextV2Control extends PropController {
|
|
|
3838
3837
|
function isRichTextV1Data(value) {
|
|
3839
3838
|
return value !== void 0 && typeof value === "object" && !Array.isArray(value) && "document" in value;
|
|
3840
3839
|
}
|
|
3840
|
+
function richTextV2DataToDescendents(data) {
|
|
3841
|
+
return data.descendants;
|
|
3842
|
+
}
|
|
3843
|
+
function richTextV2DescendentsToData(descendants, key) {
|
|
3844
|
+
return {
|
|
3845
|
+
type: RichTextV2ControlType,
|
|
3846
|
+
version: 2,
|
|
3847
|
+
descendants,
|
|
3848
|
+
key: key != null ? key : v4()
|
|
3849
|
+
};
|
|
3850
|
+
}
|
|
3851
|
+
function copyRichTextV2Data(data, context) {
|
|
3852
|
+
var _a;
|
|
3853
|
+
if (data == null)
|
|
3854
|
+
return data;
|
|
3855
|
+
return richTextV2DescendentsToData((_a = data.descendants) == null ? void 0 : _a.flatMap((d) => copyNode(d)));
|
|
3856
|
+
function copyNode(descendant) {
|
|
3857
|
+
if (Element.isElement(descendant) && ElementUtils.isInline(descendant)) {
|
|
3858
|
+
return copyLinkData2(descendant);
|
|
3859
|
+
}
|
|
3860
|
+
if (Text.isText(descendant)) {
|
|
3861
|
+
return copyTypographyData(descendant);
|
|
3862
|
+
}
|
|
3863
|
+
return __spreadProps(__spreadValues({}, descendant), { children: descendant.children.map(copyNode) });
|
|
3864
|
+
}
|
|
3865
|
+
function copyLinkData2(descendant) {
|
|
3866
|
+
var _a2, _b;
|
|
3867
|
+
if (descendant.type !== "link") {
|
|
3868
|
+
return __spreadProps(__spreadValues({}, descendant), { children: descendant.children.map(copyNode) });
|
|
3869
|
+
}
|
|
3870
|
+
if (descendant.link == null)
|
|
3871
|
+
return descendant;
|
|
3872
|
+
switch (descendant.link.type) {
|
|
3873
|
+
case "OPEN_PAGE": {
|
|
3874
|
+
const pageId = descendant.link.payload.pageId;
|
|
3875
|
+
if (pageId == null)
|
|
3876
|
+
return descendant;
|
|
3877
|
+
return __spreadProps(__spreadValues({}, descendant), {
|
|
3878
|
+
link: __spreadProps(__spreadValues({}, descendant.link), {
|
|
3879
|
+
payload: __spreadProps(__spreadValues({}, descendant.link.payload), {
|
|
3880
|
+
pageId: (_a2 = context.replacementContext.pageIds.get(pageId)) != null ? _a2 : descendant.link.payload.pageId
|
|
3881
|
+
})
|
|
3882
|
+
}),
|
|
3883
|
+
children: descendant.children.map(copyNode)
|
|
3884
|
+
});
|
|
3885
|
+
}
|
|
3886
|
+
case "SCROLL_TO_ELEMENT": {
|
|
3887
|
+
const elementIdConfig = descendant.link.payload.elementIdConfig;
|
|
3888
|
+
if (elementIdConfig == null)
|
|
3889
|
+
return descendant;
|
|
3890
|
+
return __spreadProps(__spreadValues({}, descendant), {
|
|
3891
|
+
link: __spreadProps(__spreadValues({}, descendant.link), {
|
|
3892
|
+
payload: __spreadProps(__spreadValues({}, descendant.link.payload), {
|
|
3893
|
+
elementIdConfig: __spreadProps(__spreadValues({}, elementIdConfig), {
|
|
3894
|
+
elementKey: (_b = context.replacementContext.elementKeys.get(elementIdConfig.elementKey)) != null ? _b : elementIdConfig.elementKey
|
|
3895
|
+
})
|
|
3896
|
+
})
|
|
3897
|
+
}),
|
|
3898
|
+
children: descendant.children.map(copyNode)
|
|
3899
|
+
});
|
|
3900
|
+
}
|
|
3901
|
+
default:
|
|
3902
|
+
return descendant;
|
|
3903
|
+
}
|
|
3904
|
+
}
|
|
3905
|
+
function copyTypographyData(descendant) {
|
|
3906
|
+
var _a2, _b, _c2, _d, _e;
|
|
3907
|
+
return __spreadValues(__spreadValues({}, descendant), descendant.typography == null ? {} : {
|
|
3908
|
+
typography: {
|
|
3909
|
+
id: (_d = context.replacementContext.typographyIds.get((_b = (_a2 = descendant.typography) == null ? void 0 : _a2.id) != null ? _b : "")) != null ? _d : (_c2 = descendant.typography) == null ? void 0 : _c2.id,
|
|
3910
|
+
style: (_e = descendant.typography) == null ? void 0 : _e.style.map((override) => {
|
|
3911
|
+
var _a3, _b2, _c3, _d2;
|
|
3912
|
+
return __spreadProps(__spreadValues({}, override), {
|
|
3913
|
+
value: __spreadValues(__spreadValues({}, override.value), override.value.color == null ? {} : {
|
|
3914
|
+
color: __spreadProps(__spreadValues({}, override.value.color), {
|
|
3915
|
+
swatchId: (_d2 = context.replacementContext.swatchIds.get((_b2 = (_a3 = override.value.color) == null ? void 0 : _a3.swatchId) != null ? _b2 : "")) != null ? _d2 : (_c3 = override.value.color) == null ? void 0 : _c3.swatchId
|
|
3916
|
+
})
|
|
3917
|
+
})
|
|
3918
|
+
});
|
|
3919
|
+
})
|
|
3920
|
+
}
|
|
3921
|
+
});
|
|
3922
|
+
}
|
|
3923
|
+
}
|
|
3924
|
+
function copy(definition2, value, context) {
|
|
3925
|
+
switch (definition2.type) {
|
|
3926
|
+
case Types.Backgrounds:
|
|
3927
|
+
case Types.Grid:
|
|
3928
|
+
case Types.NavigationLinks:
|
|
3929
|
+
case Types.Link:
|
|
3930
|
+
case Types.Shadows:
|
|
3931
|
+
case Types.Image:
|
|
3932
|
+
case Types.Images:
|
|
3933
|
+
case Types.ResponsiveColor:
|
|
3934
|
+
case Types.TableFormFields:
|
|
3935
|
+
case Types.Table:
|
|
3936
|
+
case Types.Border:
|
|
3937
|
+
case Types.RichText:
|
|
3938
|
+
case Types.ElementID:
|
|
3939
|
+
return copy$1(definition2, value, context);
|
|
3940
|
+
case RichTextControlType:
|
|
3941
|
+
return copyRichTextData(value, context);
|
|
3942
|
+
case RichTextV2ControlType:
|
|
3943
|
+
return copyRichTextV2Data(isRichTextV1Data(value) ? richTextV2DescendentsToData(richTextDTOtoDAO(value)) : value, context);
|
|
3944
|
+
case ColorControlType:
|
|
3945
|
+
return copyColorData(value, context);
|
|
3946
|
+
case ImageControlType:
|
|
3947
|
+
return copyImageData(value, context);
|
|
3948
|
+
case LinkControlType:
|
|
3949
|
+
return copyLinkData(value, context);
|
|
3950
|
+
case ShapeControlType:
|
|
3951
|
+
return copyShapeData(definition2, value, context);
|
|
3952
|
+
case ListControlType:
|
|
3953
|
+
return copyListData(definition2, value, context);
|
|
3954
|
+
case StyleControlType:
|
|
3955
|
+
return copyStyleData(value, context);
|
|
3956
|
+
case SlotControlType:
|
|
3957
|
+
return copySlotData(value, context);
|
|
3958
|
+
default:
|
|
3959
|
+
return value;
|
|
3960
|
+
}
|
|
3961
|
+
}
|
|
3962
|
+
function merge(definition2, a, b = a, context) {
|
|
3963
|
+
switch (definition2.type) {
|
|
3964
|
+
case SlotControlType:
|
|
3965
|
+
return mergeSlotData(a, b, context);
|
|
3966
|
+
default:
|
|
3967
|
+
return b;
|
|
3968
|
+
}
|
|
3969
|
+
}
|
|
3970
|
+
const StyleV2ControlType = "makeswift::controls::style-v2";
|
|
3971
|
+
const unstable_useStyleV2ClassName = useStyle;
|
|
3972
|
+
function unstable_StyleV2(config) {
|
|
3973
|
+
return { type: StyleV2ControlType, config };
|
|
3974
|
+
}
|
|
3975
|
+
const StyleV2ControlMessageType = {
|
|
3976
|
+
CHANGE_BOX_MODEL: "makeswift::controls::style::message::change-box-model",
|
|
3977
|
+
STYLE_V2_CONTROL_CHILD_CONTROL_MESSAGE: "makeswift::controls::style-v2::message::child-control-message"
|
|
3978
|
+
};
|
|
3979
|
+
class StyleV2Control extends PropController {
|
|
3980
|
+
constructor(send, descriptor) {
|
|
3981
|
+
super(send);
|
|
3982
|
+
__publicField(this, "control");
|
|
3983
|
+
this.control = createPropController(descriptor.config.type, (message) => {
|
|
3984
|
+
this.send({
|
|
3985
|
+
type: StyleV2ControlMessageType.STYLE_V2_CONTROL_CHILD_CONTROL_MESSAGE,
|
|
3986
|
+
payload: { message }
|
|
3987
|
+
});
|
|
3988
|
+
});
|
|
3989
|
+
}
|
|
3990
|
+
changeBoxModel(boxModel) {
|
|
3991
|
+
this.send({ type: StyleV2ControlMessageType.CHANGE_BOX_MODEL, payload: { boxModel } });
|
|
3992
|
+
}
|
|
3993
|
+
recv(message) {
|
|
3994
|
+
switch (message.type) {
|
|
3995
|
+
case StyleV2ControlMessageType.STYLE_V2_CONTROL_CHILD_CONTROL_MESSAGE: {
|
|
3996
|
+
const control = this.control;
|
|
3997
|
+
if (control == null)
|
|
3998
|
+
return;
|
|
3999
|
+
const recv = control.recv;
|
|
4000
|
+
recv(message.payload.message);
|
|
4001
|
+
}
|
|
4002
|
+
}
|
|
4003
|
+
}
|
|
4004
|
+
}
|
|
3841
4005
|
const TypographyControlType = "makeswift::controls::typography";
|
|
3842
4006
|
function unstable_Typography() {
|
|
3843
4007
|
return {
|
|
@@ -3845,11 +4009,11 @@ function unstable_Typography() {
|
|
|
3845
4009
|
};
|
|
3846
4010
|
}
|
|
3847
4011
|
function getTypographySwatchIds(value) {
|
|
3848
|
-
var
|
|
3849
|
-
return (
|
|
3850
|
-
var
|
|
3851
|
-
return (_b = (
|
|
3852
|
-
}).filter(isNonNullable)) != null ?
|
|
4012
|
+
var _a;
|
|
4013
|
+
return (_a = value == null ? void 0 : value.style.flatMap((style) => {
|
|
4014
|
+
var _a2, _b;
|
|
4015
|
+
return (_b = (_a2 = style.value.color) == null ? void 0 : _a2.swatchId) != null ? _b : [];
|
|
4016
|
+
}).filter(isNonNullable)) != null ? _a : [];
|
|
3853
4017
|
}
|
|
3854
4018
|
function getTypographyTypographyIds(value) {
|
|
3855
4019
|
return [value == null ? void 0 : value.id].filter(isNonNullable);
|
|
@@ -3859,28 +4023,28 @@ function getRichTextSwatchIds(value) {
|
|
|
3859
4023
|
return [];
|
|
3860
4024
|
return getNodeSwatchIds(value.document);
|
|
3861
4025
|
function getNodeSwatchIds(node) {
|
|
3862
|
-
var
|
|
4026
|
+
var _a, _b, _c2, _d;
|
|
3863
4027
|
switch (node.object) {
|
|
3864
4028
|
case "document":
|
|
3865
4029
|
case "block":
|
|
3866
4030
|
case "inline":
|
|
3867
|
-
return (_b = (
|
|
4031
|
+
return (_b = (_a = node.nodes) == null ? void 0 : _a.flatMap(getNodeSwatchIds)) != null ? _b : [];
|
|
3868
4032
|
case "text":
|
|
3869
|
-
return (_d = (
|
|
4033
|
+
return (_d = (_c2 = node.marks) == null ? void 0 : _c2.flatMap(getMarkSwatchIds)) != null ? _d : [];
|
|
3870
4034
|
default:
|
|
3871
4035
|
return [];
|
|
3872
4036
|
}
|
|
3873
4037
|
}
|
|
3874
4038
|
function getTypographyStyleSwatchIds(style) {
|
|
3875
|
-
var
|
|
3876
|
-
return (
|
|
3877
|
-
var
|
|
3878
|
-
return (
|
|
3879
|
-
}).filter(isNonNullable)) != null ?
|
|
4039
|
+
var _a;
|
|
4040
|
+
return (_a = style == null ? void 0 : style.map((override) => override.value).flatMap((typographyStyle) => {
|
|
4041
|
+
var _a2;
|
|
4042
|
+
return (_a2 = typographyStyle.color) == null ? void 0 : _a2.swatchId;
|
|
4043
|
+
}).filter(isNonNullable)) != null ? _a : [];
|
|
3880
4044
|
}
|
|
3881
4045
|
function getMarkSwatchIds(mark) {
|
|
3882
|
-
var
|
|
3883
|
-
return getTypographyStyleSwatchIds((_b = (
|
|
4046
|
+
var _a, _b;
|
|
4047
|
+
return getTypographyStyleSwatchIds((_b = (_a = mark.data) == null ? void 0 : _a.value) == null ? void 0 : _b.style);
|
|
3884
4048
|
}
|
|
3885
4049
|
}
|
|
3886
4050
|
function getRichTextTypographyIds(value) {
|
|
@@ -3888,21 +4052,21 @@ function getRichTextTypographyIds(value) {
|
|
|
3888
4052
|
return [];
|
|
3889
4053
|
return getNodeSwatchIds(value.document);
|
|
3890
4054
|
function getNodeSwatchIds(node) {
|
|
3891
|
-
var
|
|
4055
|
+
var _a, _b, _c2, _d;
|
|
3892
4056
|
switch (node.object) {
|
|
3893
4057
|
case "document":
|
|
3894
4058
|
case "block":
|
|
3895
4059
|
case "inline":
|
|
3896
|
-
return (_b = (
|
|
4060
|
+
return (_b = (_a = node.nodes) == null ? void 0 : _a.flatMap(getNodeSwatchIds)) != null ? _b : [];
|
|
3897
4061
|
case "text":
|
|
3898
|
-
return (_d = (
|
|
4062
|
+
return (_d = (_c2 = node.marks) == null ? void 0 : _c2.flatMap(getMarkSwatchIds)) != null ? _d : [];
|
|
3899
4063
|
default:
|
|
3900
4064
|
return [];
|
|
3901
4065
|
}
|
|
3902
4066
|
}
|
|
3903
4067
|
function getMarkSwatchIds(mark) {
|
|
3904
|
-
var
|
|
3905
|
-
return [(_b = (
|
|
4068
|
+
var _a, _b;
|
|
4069
|
+
return [(_b = (_a = mark.data) == null ? void 0 : _a.value) == null ? void 0 : _b.id].filter(isNonNullable);
|
|
3906
4070
|
}
|
|
3907
4071
|
}
|
|
3908
4072
|
function getRichTextPageIds(value) {
|
|
@@ -3910,11 +4074,11 @@ function getRichTextPageIds(value) {
|
|
|
3910
4074
|
return [];
|
|
3911
4075
|
return getNodePageIds(value.document);
|
|
3912
4076
|
function getNodePageIds(node) {
|
|
3913
|
-
var
|
|
4077
|
+
var _a, _b;
|
|
3914
4078
|
switch (node.object) {
|
|
3915
4079
|
case "document":
|
|
3916
4080
|
case "block":
|
|
3917
|
-
return (_b = (
|
|
4081
|
+
return (_b = (_a = node.nodes) == null ? void 0 : _a.flatMap(getNodePageIds)) != null ? _b : [];
|
|
3918
4082
|
case "inline":
|
|
3919
4083
|
return getInlinePageIds(node);
|
|
3920
4084
|
default:
|
|
@@ -3922,15 +4086,15 @@ function getRichTextPageIds(value) {
|
|
|
3922
4086
|
}
|
|
3923
4087
|
}
|
|
3924
4088
|
function getInlinePageIds(inline) {
|
|
3925
|
-
var
|
|
4089
|
+
var _a, _b, _c2, _d;
|
|
3926
4090
|
switch (inline.type) {
|
|
3927
4091
|
case "link": {
|
|
3928
|
-
const nodePageIds = (_b = (
|
|
4092
|
+
const nodePageIds = (_b = (_a = inline.nodes) == null ? void 0 : _a.flatMap(getNodePageIds)) != null ? _b : [];
|
|
3929
4093
|
const dataPageIds = inline.data ? getLinkDataPageIds(inline.data) : [];
|
|
3930
4094
|
return [...nodePageIds, ...dataPageIds];
|
|
3931
4095
|
}
|
|
3932
4096
|
default:
|
|
3933
|
-
return (_d = (
|
|
4097
|
+
return (_d = (_c2 = inline.nodes) == null ? void 0 : _c2.flatMap(getNodePageIds)) != null ? _d : [];
|
|
3934
4098
|
}
|
|
3935
4099
|
}
|
|
3936
4100
|
function getLinkDataPageIds(link) {
|
|
@@ -3958,18 +4122,18 @@ function introspectRichTextV2Data(definition2, data, func) {
|
|
|
3958
4122
|
return [];
|
|
3959
4123
|
}
|
|
3960
4124
|
function getElementTypographyIds(descendant) {
|
|
3961
|
-
var
|
|
3962
|
-
return (
|
|
3963
|
-
var
|
|
3964
|
-
return ((
|
|
3965
|
-
})) != null ?
|
|
4125
|
+
var _a;
|
|
4126
|
+
return (_a = plugins == null ? void 0 : plugins.flatMap((plugin) => {
|
|
4127
|
+
var _a2;
|
|
4128
|
+
return ((_a2 = plugin.control) == null ? void 0 : _a2.definition) && plugin.control.getElementValue ? func(plugin.control.definition, plugin.control.getElementValue(descendant)) : [];
|
|
4129
|
+
})) != null ? _a : [];
|
|
3966
4130
|
}
|
|
3967
4131
|
function getTextTypographyIds(text) {
|
|
3968
|
-
var
|
|
3969
|
-
return (
|
|
3970
|
-
var
|
|
3971
|
-
return ((
|
|
3972
|
-
})) != null ?
|
|
4132
|
+
var _a;
|
|
4133
|
+
return (_a = plugins == null ? void 0 : plugins.flatMap((plugin) => {
|
|
4134
|
+
var _a2;
|
|
4135
|
+
return ((_a2 = plugin.control) == null ? void 0 : _a2.definition) && plugin.control.getLeafValue ? func(plugin.control.definition, plugin.control.getLeafValue(text)) : [];
|
|
4136
|
+
})) != null ? _a : [];
|
|
3973
4137
|
}
|
|
3974
4138
|
}
|
|
3975
4139
|
function getRichTextV2SwatchIds(definition2, data) {
|
|
@@ -4018,44 +4182,44 @@ function getElementId$1(descriptor, prop) {
|
|
|
4018
4182
|
}
|
|
4019
4183
|
}
|
|
4020
4184
|
function getBackgroundsSwatchIds(value) {
|
|
4021
|
-
var
|
|
4022
|
-
return (
|
|
4023
|
-
var
|
|
4185
|
+
var _a;
|
|
4186
|
+
return (_a = value == null ? void 0 : value.flatMap((override) => override.value).flatMap((backgroundItem) => {
|
|
4187
|
+
var _a2;
|
|
4024
4188
|
switch (backgroundItem.type) {
|
|
4025
4189
|
case "color":
|
|
4026
|
-
return ((
|
|
4190
|
+
return ((_a2 = backgroundItem.payload) == null ? void 0 : _a2.swatchId) == null ? [] : [backgroundItem.payload.swatchId];
|
|
4027
4191
|
case "gradient":
|
|
4028
4192
|
return backgroundItem.payload.stops.flatMap((stop) => stop.color == null ? [] : stop.color.swatchId);
|
|
4029
4193
|
default:
|
|
4030
4194
|
return [];
|
|
4031
4195
|
}
|
|
4032
|
-
})) != null ?
|
|
4196
|
+
})) != null ? _a : [];
|
|
4033
4197
|
}
|
|
4034
4198
|
function getBorderSwatchIds(value) {
|
|
4035
|
-
var
|
|
4036
|
-
return (
|
|
4037
|
-
var
|
|
4199
|
+
var _a;
|
|
4200
|
+
return (_a = value == null ? void 0 : value.flatMap((override) => override.value).flatMap((borderValue) => {
|
|
4201
|
+
var _a2, _b, _c2, _d, _e, _f, _g, _h;
|
|
4038
4202
|
return [
|
|
4039
|
-
(_b = (
|
|
4040
|
-
(_d = (
|
|
4203
|
+
(_b = (_a2 = borderValue.borderTop) == null ? void 0 : _a2.color) == null ? void 0 : _b.swatchId,
|
|
4204
|
+
(_d = (_c2 = borderValue.borderRight) == null ? void 0 : _c2.color) == null ? void 0 : _d.swatchId,
|
|
4041
4205
|
(_f = (_e = borderValue.borderBottom) == null ? void 0 : _e.color) == null ? void 0 : _f.swatchId,
|
|
4042
4206
|
(_h = (_g = borderValue.borderLeft) == null ? void 0 : _g.color) == null ? void 0 : _h.swatchId
|
|
4043
4207
|
].filter((swatchId) => swatchId != null);
|
|
4044
|
-
})) != null ?
|
|
4208
|
+
})) != null ? _a : [];
|
|
4045
4209
|
}
|
|
4046
4210
|
function getBoxShadowsSwatchIds(value) {
|
|
4047
|
-
var
|
|
4048
|
-
return (
|
|
4049
|
-
var
|
|
4050
|
-
return (
|
|
4051
|
-
}).filter((swatchId) => swatchId != null)) != null ?
|
|
4211
|
+
var _a;
|
|
4212
|
+
return (_a = value == null ? void 0 : value.flatMap((override) => override.value).map((item) => {
|
|
4213
|
+
var _a2;
|
|
4214
|
+
return (_a2 = item.payload.color) == null ? void 0 : _a2.swatchId;
|
|
4215
|
+
}).filter((swatchId) => swatchId != null)) != null ? _a : [];
|
|
4052
4216
|
}
|
|
4053
4217
|
function getResponsiveColorSwatchIds(value) {
|
|
4054
|
-
var
|
|
4055
|
-
return (
|
|
4218
|
+
var _a;
|
|
4219
|
+
return (_a = value == null ? void 0 : value.map((override) => override.value).map((color) => color.swatchId)) != null ? _a : [];
|
|
4056
4220
|
}
|
|
4057
4221
|
function getSwatchIds(descriptor, prop) {
|
|
4058
|
-
var
|
|
4222
|
+
var _a, _b;
|
|
4059
4223
|
if (prop == null)
|
|
4060
4224
|
return [];
|
|
4061
4225
|
switch (descriptor.type) {
|
|
@@ -4065,17 +4229,17 @@ function getSwatchIds(descriptor, prop) {
|
|
|
4065
4229
|
return getBorderSwatchIds(prop);
|
|
4066
4230
|
case Types.NavigationLinks: {
|
|
4067
4231
|
const value = prop;
|
|
4068
|
-
return (
|
|
4069
|
-
var
|
|
4232
|
+
return (_a = value == null ? void 0 : value.flatMap((item) => {
|
|
4233
|
+
var _a2, _b2, _c2, _d;
|
|
4070
4234
|
switch (item.type) {
|
|
4071
4235
|
case "button":
|
|
4072
4236
|
case "dropdown":
|
|
4073
4237
|
return [
|
|
4074
|
-
...(_b2 = (
|
|
4075
|
-
...(_d = (
|
|
4238
|
+
...(_b2 = (_a2 = item.payload.color) == null ? void 0 : _a2.map((override) => override.value).map((color) => color.swatchId)) != null ? _b2 : [],
|
|
4239
|
+
...(_d = (_c2 = item.payload.textColor) == null ? void 0 : _c2.map((override) => override.value).map((color) => color.swatchId)) != null ? _d : []
|
|
4076
4240
|
];
|
|
4077
4241
|
}
|
|
4078
|
-
})) != null ?
|
|
4242
|
+
})) != null ? _a : [];
|
|
4079
4243
|
}
|
|
4080
4244
|
case Types.ResponsiveColor:
|
|
4081
4245
|
return getResponsiveColorSwatchIds(prop);
|
|
@@ -4119,18 +4283,18 @@ function getSwatchIds(descriptor, prop) {
|
|
|
4119
4283
|
}
|
|
4120
4284
|
}
|
|
4121
4285
|
function getBackgroundsFileIds(value) {
|
|
4122
|
-
var
|
|
4123
|
-
return (
|
|
4286
|
+
var _a;
|
|
4287
|
+
return (_a = value == null ? void 0 : value.flatMap((override) => override.value).flatMap((backgroundItem) => {
|
|
4124
4288
|
switch (backgroundItem.type) {
|
|
4125
4289
|
case "image":
|
|
4126
4290
|
return [backgroundItem.payload.imageId];
|
|
4127
4291
|
default:
|
|
4128
4292
|
return [];
|
|
4129
4293
|
}
|
|
4130
|
-
})) != null ?
|
|
4294
|
+
})) != null ? _a : [];
|
|
4131
4295
|
}
|
|
4132
4296
|
function getFileIds(descriptor, prop) {
|
|
4133
|
-
var
|
|
4297
|
+
var _a;
|
|
4134
4298
|
if (prop == null)
|
|
4135
4299
|
return [];
|
|
4136
4300
|
switch (descriptor.type) {
|
|
@@ -4142,7 +4306,7 @@ function getFileIds(descriptor, prop) {
|
|
|
4142
4306
|
}
|
|
4143
4307
|
case Types.Images: {
|
|
4144
4308
|
const value = prop;
|
|
4145
|
-
return (
|
|
4309
|
+
return (_a = value == null ? void 0 : value.flatMap((item) => item.props.file == null ? [] : [item.props.file])) != null ? _a : [];
|
|
4146
4310
|
}
|
|
4147
4311
|
case ImageControlType: {
|
|
4148
4312
|
const value = prop;
|
|
@@ -4210,7 +4374,7 @@ function getTableIds(descriptor, prop) {
|
|
|
4210
4374
|
}
|
|
4211
4375
|
}
|
|
4212
4376
|
function getPageIds(descriptor, prop) {
|
|
4213
|
-
var
|
|
4377
|
+
var _a;
|
|
4214
4378
|
if (prop == null)
|
|
4215
4379
|
return [];
|
|
4216
4380
|
switch (descriptor.type) {
|
|
@@ -4240,8 +4404,8 @@ function getPageIds(descriptor, prop) {
|
|
|
4240
4404
|
const value = prop;
|
|
4241
4405
|
if (value == null)
|
|
4242
4406
|
return [];
|
|
4243
|
-
return (
|
|
4244
|
-
var
|
|
4407
|
+
return (_a = value == null ? void 0 : value.flatMap((item) => {
|
|
4408
|
+
var _a2, _b;
|
|
4245
4409
|
switch (item.type) {
|
|
4246
4410
|
case "button": {
|
|
4247
4411
|
if (item.payload.link == null)
|
|
@@ -4254,7 +4418,7 @@ function getPageIds(descriptor, prop) {
|
|
|
4254
4418
|
}
|
|
4255
4419
|
}
|
|
4256
4420
|
case "dropdown": {
|
|
4257
|
-
return (_b = (
|
|
4421
|
+
return (_b = (_a2 = item.payload.links) == null ? void 0 : _a2.flatMap((link) => {
|
|
4258
4422
|
if (link.payload.link == null)
|
|
4259
4423
|
return [];
|
|
4260
4424
|
switch (link.payload.link.type) {
|
|
@@ -4266,7 +4430,7 @@ function getPageIds(descriptor, prop) {
|
|
|
4266
4430
|
})) != null ? _b : [];
|
|
4267
4431
|
}
|
|
4268
4432
|
}
|
|
4269
|
-
})) != null ?
|
|
4433
|
+
})) != null ? _a : [];
|
|
4270
4434
|
}
|
|
4271
4435
|
case RichTextControlType:
|
|
4272
4436
|
case Types.RichText: {
|
|
@@ -4384,14 +4548,14 @@ function getDocumentKeysSortedByDepth(state) {
|
|
|
4384
4548
|
elements.set(key, getDocumentElements(state, key));
|
|
4385
4549
|
});
|
|
4386
4550
|
keys.sort((a, b) => {
|
|
4387
|
-
var
|
|
4388
|
-
return ((
|
|
4551
|
+
var _a;
|
|
4552
|
+
return ((_a = elements.get(a)) == null ? void 0 : _a.has(b)) ? -1 : 1;
|
|
4389
4553
|
});
|
|
4390
4554
|
return keys;
|
|
4391
4555
|
}
|
|
4392
4556
|
function getElement(state, documentKey, elementKey) {
|
|
4393
|
-
var
|
|
4394
|
-
return (
|
|
4557
|
+
var _a;
|
|
4558
|
+
return (_a = getDocumentElements(state, documentKey).get(elementKey)) != null ? _a : null;
|
|
4395
4559
|
}
|
|
4396
4560
|
function getElementPropControllerDescriptors(state, documentKey, elementKey) {
|
|
4397
4561
|
const element = getElement(state, documentKey, elementKey);
|
|
@@ -4480,5 +4644,5 @@ function configureStore({
|
|
|
4480
4644
|
locales: getInitialState(locales != null ? locales : preloadedState == null ? void 0 : preloadedState.locales)
|
|
4481
4645
|
}), applyMiddleware(thunk));
|
|
4482
4646
|
}
|
|
4483
|
-
export { getBorderSwatchIds as $, ResponsiveLength as A, Backgrounds as B, ComponentIcon as C, Date as D, ElementID as E, Font as F, GapY as G, TextArea as H, Images as I, Table as J, TableFormFields as K, Link$1 as L, Margin as M, Number as N, Image$1 as O, Padding as P, ResponsiveOpacity as Q, RichTextPropControllerMessageType as R, Shadows as S, TableFormFieldsMessageType as T, NavigationLinks as U, SocialLinks as V, Width as W, RichText as X, BlockType as Y, Video as Z, useStyle as _, deepEqual as a, ShapeControl as a$, getBoxShadowsSwatchIds as a0, getResponsiveColorSwatchIds as a1, StyleControlProperty as a2, ImageControlValueFormat as a3, isPropControllersHandle as a4, isRichTextV1Data as a5, isNonNullable as a6, TypographyControlType as a7, StyleControlType as a8, RichTextV2ControlType as a9, getIsInBuilder as aA, getBuilderEditMode as aB, getIsPreview as aC, getBackgroundsFileIds as aD, getBackgroundsSwatchIds as aE, Color as aF, copyColorData as aG, copy as aH, merge as aI, unstable_IconRadioGroupIcon as aJ, unstable_IconRadioGroup as aK, Image as aL, copyImageData as aM, Link as aN, copyLinkData as aO, List as aP, ListControlMessageType as aQ, ListControl as aR, copyListData as aS, getListElementChildren as aT, getListSwatchIds as aU, getListFileIds as aV, getListTypographyIds as aW, getListPageIds as aX, Select as aY, Shape as aZ, ShapeControlMessageType as a_, RichTextControlType as aa, SlotControlType as ab, StyleV2ControlType as ac, ListControlType as ad, ShapeControlType as ae, LinkControlType as af, ImageControlType as ag, IconRadioGroupControlType as ah, ColorControlType as ai, SelectControlType as aj, getComponentPropControllerDescriptors as ak, getPropControllers as al, Types as am, BorderPropControllerFormat as an, ShadowsPropControllerFormat as ao, BorderRadiusPropControllerFormat as ap, MarginPropControllerFormat as aq, PaddingPropControllerFormat as ar, WidthPropControllerFormat as as, configureStore as at, copyElementTree as au, getBreakpoints as av, parseLocalesInput as aw, getElementId as ax, getReactComponent as ay, getDocument as az, createDocumentReference as b,
|
|
4647
|
+
export { getBorderSwatchIds as $, ResponsiveLength as A, Backgrounds as B, ComponentIcon as C, Date as D, ElementID as E, Font as F, GapY as G, TextArea as H, Images as I, Table as J, TableFormFields as K, Link$1 as L, Margin as M, Number as N, Image$1 as O, Padding as P, ResponsiveOpacity as Q, RichTextPropControllerMessageType as R, Shadows as S, TableFormFieldsMessageType as T, NavigationLinks as U, SocialLinks as V, Width as W, RichText as X, BlockType as Y, Video as Z, useStyle as _, deepEqual as a, ShapeControl as a$, getBoxShadowsSwatchIds as a0, getResponsiveColorSwatchIds as a1, StyleControlProperty as a2, ImageControlValueFormat as a3, isPropControllersHandle as a4, isRichTextV1Data as a5, isNonNullable as a6, TypographyControlType as a7, StyleControlType as a8, RichTextV2ControlType as a9, getIsInBuilder as aA, getBuilderEditMode as aB, getIsPreview as aC, getBackgroundsFileIds as aD, getBackgroundsSwatchIds as aE, Color as aF, copyColorData as aG, copy as aH, merge as aI, unstable_IconRadioGroupIcon as aJ, unstable_IconRadioGroup as aK, Image as aL, copyImageData as aM, Link as aN, copyLinkData as aO, List as aP, ListControlMessageType as aQ, ListControl as aR, copyListData as aS, getListElementChildren as aT, getListSwatchIds as aU, getListFileIds as aV, getListTypographyIds as aW, getListPageIds as aX, Select as aY, Shape as aZ, ShapeControlMessageType as a_, RichTextControlType as aa, SlotControlType as ab, StyleV2ControlType as ac, ListControlType as ad, ShapeControlType as ae, LinkControlType as af, ImageControlType as ag, IconRadioGroupControlType as ah, ColorControlType as ai, SelectControlType as aj, getComponentPropControllerDescriptors as ak, getPropControllers as al, Types as am, BorderPropControllerFormat as an, ShadowsPropControllerFormat as ao, BorderRadiusPropControllerFormat as ap, MarginPropControllerFormat as aq, PaddingPropControllerFormat as ar, WidthPropControllerFormat as as, configureStore as at, copyElementTree as au, getBreakpoints as av, parseLocalesInput as aw, getElementId as ax, getReactComponent as ay, getDocument as az, createDocumentReference as b, BuilderEditMode as b$, copyShapeData as b0, getShapeElementChildren as b1, getShapeSwatchIds as b2, getShapeTypographyIds as b3, getShapePageIds as b4, getShapeFileIds as b5, Slot as b6, SlotControlMessageType as b7, SlotControl as b8, copySlotData as b9, TypographyActions as bA, TYPOGRAPHY_KEY as bB, withTypography as bC, TypographyPlugin as bD, BlockActions as bE, ListActions as bF, onKeyDown as bG, withBlock as bH, BlockPlugin as bI, withInlineMode as bJ, InlineModePlugin as bK, withTextAlign as bL, TextAlignPlugin as bM, RootBlockType as bN, InlineType as bO, BlockTextAlignment as bP, withInline as bQ, InlinePlugin as bR, ElementUtils as bS, onChange$1 as bT, getValue$3 as bU, isLinkElement as bV, getInitialState$7 as bW, reducer$8 as bX, getDocument$1 as bY, getComponentsMeta as bZ, getComponentPropControllerDescriptors$1 as b_, mergeSlotData as ba, Style as bb, StyleControlMessageType as bc, StyleControl as bd, copyStyleData as be, unstable_useStyleV2ClassName as bf, unstable_StyleV2 as bg, StyleV2ControlMessageType as bh, StyleV2Control as bi, copyRichTextData as bj, ObjectType as bk, RichTextControlMessageType as bl, RichTextControl as bm, richTextDTOtoSelection as bn, richTextDTOtoDAO as bo, toSelectionDTO as bp, richTextDAOToDTO as bq, RichTextV2Mode as br, RichTextV2ControlMessageType as bs, RichTextV2Control as bt, richTextV2DataToDescendents as bu, richTextV2DescendentsToData as bv, createRichTextV2Plugin as bw, unstable_Typography as bx, getTypographySwatchIds as by, getTypographyTypographyIds as bz, createDocument as c, getDocumentKeysSortedByDepth as c0, getPropController as c1, getPropControllersHandle as c2, getElement as c3, getElementPropControllerDescriptors as c4, createPropController as c5, reducer$7 as c6, reducer$9 as c7, reducer$6 as c8, reducer$5 as c9, reducer$4 as ca, reducer$3 as cb, reducer$2 as cc, reducer$1 as cd, getInitialState$2 as ce, descriptors as d, isElementReference as e, getDefaultLocale as f, getPropControllerDescriptors as g, getLocales as h, introspection as i, getSwatchIds as j, getFileIds as k, getTypographyIds as l, getTableIds as m, getPageIds as n, getElementChildren as o, ResponsiveIconRadioGroup as p, Border as q, BorderRadius as r, GapX as s, ResponsiveSelect as t, ResponsiveNumber as u, Checkbox as v, Grid as w, TextInput as x, ResponsiveColor as y, TextStyle as z };
|
|
4484
4648
|
//# sourceMappingURL=react-page.es.js.map
|