@puckeditor/core 0.22.1 → 0.22.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/{Editor-MXSH3OSX.mjs → Editor-MLHOIEVM.mjs} +9 -9
- package/dist/{chunk-73XKHVBN.mjs → chunk-25O24MZR.mjs} +7 -7
- package/dist/{chunk-HRNJ42TO.mjs → chunk-25QAPMLH.mjs} +1 -1
- package/dist/{chunk-DATOBXTJ.mjs → chunk-4I2WN43X.mjs} +1 -1
- package/dist/{chunk-BVKXFA4V.mjs → chunk-C2H4WQP2.mjs} +1 -1
- package/dist/{chunk-FKYOVZNF.mjs → chunk-JNJJ2M57.mjs} +2 -2
- package/dist/{chunk-54LFCIWQ.mjs → chunk-KJQTOPIV.mjs} +3 -3
- package/dist/{chunk-2AATV7NG.mjs → chunk-NKDMBWQC.mjs} +1 -1
- package/dist/{chunk-VOB4L2BJ.mjs → chunk-PRZEIT36.mjs} +3 -3
- package/dist/{chunk-74HKFKJU.mjs → chunk-QHQD3BMI.mjs} +7 -5
- package/dist/{chunk-6PIQFZBM.mjs → chunk-WH6PO5ND.mjs} +48 -31
- package/dist/{chunk-GR7NLT4T.mjs → chunk-WUO7D6OQ.mjs} +1 -1
- package/dist/{full-7JVAMOPS.mjs → full-YXSOFDYM.mjs} +8 -8
- package/dist/index.js +46 -27
- package/dist/index.mjs +11 -11
- package/dist/internal.js +7 -5
- package/dist/internal.mjs +2 -2
- package/dist/{loaded-HECCGJKO.mjs → loaded-IFFZACEG.mjs} +5 -5
- package/dist/{loaded-EFZRGV2Y.mjs → loaded-LMF4JLYG.mjs} +5 -5
- package/dist/{loaded-B7563MDT.mjs → loaded-SJJPEREQ.mjs} +5 -5
- package/dist/no-external.js +46 -27
- package/dist/no-external.mjs +11 -11
- package/dist/rsc.js +7 -5
- package/dist/rsc.mjs +3 -3
- package/package.json +1 -1
|
@@ -4,20 +4,20 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
EditorInner,
|
|
6
6
|
LoadedRichTextMenu
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-PRZEIT36.mjs";
|
|
8
8
|
import "./chunk-H635BA2V.mjs";
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-25O24MZR.mjs";
|
|
10
|
+
import "./chunk-NKDMBWQC.mjs";
|
|
11
|
+
import "./chunk-C2H4WQP2.mjs";
|
|
12
|
+
import "./chunk-4I2WN43X.mjs";
|
|
13
13
|
import {
|
|
14
14
|
useAppStore,
|
|
15
15
|
useAppStoreApi
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-KJQTOPIV.mjs";
|
|
17
|
+
import "./chunk-25QAPMLH.mjs";
|
|
18
|
+
import "./chunk-WUO7D6OQ.mjs";
|
|
19
19
|
import "./chunk-Y2EFNT5P.mjs";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-QHQD3BMI.mjs";
|
|
21
21
|
import {
|
|
22
22
|
__spreadProps,
|
|
23
23
|
__spreadValues,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useAlignOptions
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NKDMBWQC.mjs";
|
|
4
4
|
import {
|
|
5
5
|
useHeadingOptions
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-C2H4WQP2.mjs";
|
|
7
7
|
import {
|
|
8
8
|
useListOptions
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-4I2WN43X.mjs";
|
|
10
10
|
import {
|
|
11
11
|
Action,
|
|
12
12
|
AlignCenter,
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
Strikethrough,
|
|
29
29
|
Underline,
|
|
30
30
|
useControlContext
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-KJQTOPIV.mjs";
|
|
32
32
|
import {
|
|
33
33
|
get_class_name_factory_default
|
|
34
34
|
} from "./chunk-Y2EFNT5P.mjs";
|
|
@@ -199,7 +199,7 @@ function AlignSelectFallback() {
|
|
|
199
199
|
// components/RichTextMenu/controls/AlignSelect/index.tsx
|
|
200
200
|
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
201
201
|
var AlignSelectLoaded = lazy(
|
|
202
|
-
() => import("./loaded-
|
|
202
|
+
() => import("./loaded-LMF4JLYG.mjs").then((m) => ({
|
|
203
203
|
default: m.AlignSelectLoaded
|
|
204
204
|
}))
|
|
205
205
|
);
|
|
@@ -430,7 +430,7 @@ function HeadingSelectFallback() {
|
|
|
430
430
|
// components/RichTextMenu/controls/HeadingSelect/index.tsx
|
|
431
431
|
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
432
432
|
var HeadingSelectLoaded = lazy2(
|
|
433
|
-
() => import("./loaded-
|
|
433
|
+
() => import("./loaded-SJJPEREQ.mjs").then((m) => ({
|
|
434
434
|
default: m.HeadingSelectLoaded
|
|
435
435
|
}))
|
|
436
436
|
);
|
|
@@ -462,7 +462,7 @@ function ListSelectFallback() {
|
|
|
462
462
|
// components/RichTextMenu/controls/ListSelect/index.tsx
|
|
463
463
|
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
464
464
|
var ListSelectLoaded = lazy3(
|
|
465
|
-
() => import("./loaded-
|
|
465
|
+
() => import("./loaded-IFFZACEG.mjs").then((m) => ({
|
|
466
466
|
default: m.ListSelectLoaded
|
|
467
467
|
}))
|
|
468
468
|
);
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
defaultAppState,
|
|
6
6
|
resolveComponentData
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-WUO7D6OQ.mjs";
|
|
8
8
|
import {
|
|
9
9
|
get_class_name_factory_default
|
|
10
10
|
} from "./chunk-Y2EFNT5P.mjs";
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
toComponent,
|
|
15
15
|
walkAppState,
|
|
16
16
|
walkTree
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-QHQD3BMI.mjs";
|
|
18
18
|
import {
|
|
19
19
|
__async,
|
|
20
20
|
__objRest,
|
|
@@ -3,19 +3,19 @@ import {
|
|
|
3
3
|
generateId,
|
|
4
4
|
getItem,
|
|
5
5
|
makeStatePublic
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-25QAPMLH.mjs";
|
|
7
7
|
import {
|
|
8
8
|
defaultAppState,
|
|
9
9
|
defaultViewports,
|
|
10
10
|
getChanged,
|
|
11
11
|
resolveComponentData
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-WUO7D6OQ.mjs";
|
|
13
13
|
import {
|
|
14
14
|
get_class_name_factory_default
|
|
15
15
|
} from "./chunk-Y2EFNT5P.mjs";
|
|
16
16
|
import {
|
|
17
17
|
walkAppState
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-QHQD3BMI.mjs";
|
|
19
19
|
import {
|
|
20
20
|
__async,
|
|
21
21
|
__objRest,
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
} from "./chunk-H635BA2V.mjs";
|
|
4
4
|
import {
|
|
5
5
|
LoadedRichTextMenuInner
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-25O24MZR.mjs";
|
|
7
7
|
import {
|
|
8
8
|
useAppStore,
|
|
9
9
|
useAppStoreApi
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-KJQTOPIV.mjs";
|
|
11
11
|
import {
|
|
12
12
|
get_class_name_factory_default
|
|
13
13
|
} from "./chunk-Y2EFNT5P.mjs";
|
|
@@ -100,7 +100,7 @@ init_react_import();
|
|
|
100
100
|
import { lazy, Suspense } from "react";
|
|
101
101
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
102
102
|
var LoadedRichTextMenuFull = lazy(
|
|
103
|
-
() => import("./full-
|
|
103
|
+
() => import("./full-YXSOFDYM.mjs").then((m) => ({
|
|
104
104
|
default: m.LoadedRichTextMenuFull
|
|
105
105
|
}))
|
|
106
106
|
);
|
|
@@ -108,10 +108,11 @@ var walkObject = ({
|
|
|
108
108
|
getPropPath,
|
|
109
109
|
config,
|
|
110
110
|
recurseSlots,
|
|
111
|
-
ownedFields
|
|
111
|
+
ownedFields,
|
|
112
|
+
keysToWalk: providedKeys
|
|
112
113
|
}) => {
|
|
113
|
-
const keys = Object.keys(value);
|
|
114
|
-
if (ownedFields) {
|
|
114
|
+
const keys = providedKeys != null ? providedKeys : Object.keys(value);
|
|
115
|
+
if (!providedKeys && ownedFields) {
|
|
115
116
|
for (const fieldName in fields) {
|
|
116
117
|
const fieldType = fields[fieldName].type;
|
|
117
118
|
if (fieldType !== "slot" && mappers[fieldType] && !(fieldName in value)) {
|
|
@@ -145,7 +146,7 @@ var walkObject = ({
|
|
|
145
146
|
}
|
|
146
147
|
return flatten(newProps);
|
|
147
148
|
};
|
|
148
|
-
function mapFields(item, mappers, config, recurseSlots = false, shouldDefaultSlots = true) {
|
|
149
|
+
function mapFields(item, mappers, config, recurseSlots = false, shouldDefaultSlots = true, fieldsToMap) {
|
|
149
150
|
var _a, _b, _c, _d, _e;
|
|
150
151
|
const itemType = "type" in item ? item.type : "root";
|
|
151
152
|
const componentConfig = itemType === "root" ? config.root : (_a = config.components) == null ? void 0 : _a[itemType];
|
|
@@ -157,7 +158,8 @@ function mapFields(item, mappers, config, recurseSlots = false, shouldDefaultSlo
|
|
|
157
158
|
getPropPath: (k) => k,
|
|
158
159
|
config,
|
|
159
160
|
recurseSlots,
|
|
160
|
-
ownedFields: true
|
|
161
|
+
ownedFields: true,
|
|
162
|
+
keysToWalk: fieldsToMap
|
|
161
163
|
});
|
|
162
164
|
if (isPromise(newProps)) {
|
|
163
165
|
return newProps.then((resolvedProps) => __spreadProps(__spreadValues({}, item), {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
EditorInner,
|
|
3
3
|
LoadedRichTextMenu
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-PRZEIT36.mjs";
|
|
5
5
|
import {
|
|
6
6
|
RichTextRenderFallback,
|
|
7
7
|
SlotRender,
|
|
@@ -10,10 +10,10 @@ import {
|
|
|
10
10
|
getSlotTransform,
|
|
11
11
|
useRichtextProps,
|
|
12
12
|
useSlots
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-JNJJ2M57.mjs";
|
|
14
14
|
import {
|
|
15
15
|
LoadedRichTextMenuInner
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-25O24MZR.mjs";
|
|
17
17
|
import {
|
|
18
18
|
ActionBar,
|
|
19
19
|
ChevronDown,
|
|
@@ -68,7 +68,7 @@ import {
|
|
|
68
68
|
useRegisterHistorySlice,
|
|
69
69
|
useRegisterPermissionsSlice,
|
|
70
70
|
useResetAutoZoom
|
|
71
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-KJQTOPIV.mjs";
|
|
72
72
|
import {
|
|
73
73
|
generateId,
|
|
74
74
|
getItem,
|
|
@@ -76,11 +76,11 @@ import {
|
|
|
76
76
|
insertAction,
|
|
77
77
|
makeStatePublic,
|
|
78
78
|
populateIds
|
|
79
|
-
} from "./chunk-
|
|
79
|
+
} from "./chunk-25QAPMLH.mjs";
|
|
80
80
|
import {
|
|
81
81
|
defaultAppState,
|
|
82
82
|
defaultViewports
|
|
83
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-WUO7D6OQ.mjs";
|
|
84
84
|
import {
|
|
85
85
|
get_class_name_factory_default
|
|
86
86
|
} from "./chunk-Y2EFNT5P.mjs";
|
|
@@ -95,7 +95,7 @@ import {
|
|
|
95
95
|
toComponent,
|
|
96
96
|
walkAppState,
|
|
97
97
|
walkField
|
|
98
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-QHQD3BMI.mjs";
|
|
99
99
|
import {
|
|
100
100
|
__async,
|
|
101
101
|
__objRest,
|
|
@@ -1999,7 +1999,7 @@ EditorFallback.displayName = "EditorFallback";
|
|
|
1999
1999
|
// components/AutoField/fields/RichtextField/index.tsx
|
|
2000
2000
|
import { Fragment as Fragment5, jsx as jsx18 } from "react/jsx-runtime";
|
|
2001
2001
|
var Editor = lazy(
|
|
2002
|
-
() => import("./Editor-
|
|
2002
|
+
() => import("./Editor-MLHOIEVM.mjs").then((m) => ({
|
|
2003
2003
|
default: m.Editor
|
|
2004
2004
|
}))
|
|
2005
2005
|
);
|
|
@@ -4240,6 +4240,7 @@ var ContextSlotRender = ({
|
|
|
4240
4240
|
init_react_import();
|
|
4241
4241
|
import { useMemo as useMemo10, useRef as useRef5 } from "react";
|
|
4242
4242
|
function useFieldTransformsTracked(config, item, transforms, readOnly, forceReadOnly) {
|
|
4243
|
+
const prevMappers = useRef5(null);
|
|
4243
4244
|
const prevProps = useRef5(null);
|
|
4244
4245
|
const prevResult = useRef5(item.props);
|
|
4245
4246
|
const mappers = useMemo10(
|
|
@@ -4247,29 +4248,44 @@ function useFieldTransformsTracked(config, item, transforms, readOnly, forceRead
|
|
|
4247
4248
|
[transforms, readOnly, forceReadOnly]
|
|
4248
4249
|
);
|
|
4249
4250
|
const transformedProps = useMemo10(() => {
|
|
4250
|
-
var _a, _b, _c;
|
|
4251
|
-
const changedProps = {};
|
|
4251
|
+
var _a, _b, _c, _d;
|
|
4252
4252
|
const componentConfig = item.type === "root" ? config.root : (_a = config.components) == null ? void 0 : _a[item.type];
|
|
4253
|
+
const componentFields = (_b = componentConfig == null ? void 0 : componentConfig.fields) != null ? _b : {};
|
|
4254
|
+
const fullRemap = prevMappers.current !== mappers;
|
|
4255
|
+
let changedFields;
|
|
4253
4256
|
let changeIncludesSlot = false;
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
changedProps[fieldName] = item.props[fieldName];
|
|
4258
|
-
if (fieldType === "slot") {
|
|
4257
|
+
if (!prevProps.current || fullRemap) {
|
|
4258
|
+
for (const fieldName in item.props) {
|
|
4259
|
+
if (((_c = componentFields[fieldName]) == null ? void 0 : _c.type) === "slot") {
|
|
4259
4260
|
changeIncludesSlot = true;
|
|
4260
4261
|
}
|
|
4261
4262
|
}
|
|
4263
|
+
} else {
|
|
4264
|
+
changedFields = ["id"];
|
|
4265
|
+
const allFieldNames = /* @__PURE__ */ new Set([
|
|
4266
|
+
...Object.keys(item.props),
|
|
4267
|
+
...Object.keys(prevProps.current)
|
|
4268
|
+
]);
|
|
4269
|
+
for (const fieldName of allFieldNames) {
|
|
4270
|
+
if (item.props[fieldName] !== prevProps.current[fieldName]) {
|
|
4271
|
+
changedFields.push(fieldName);
|
|
4272
|
+
if (((_d = componentFields[fieldName]) == null ? void 0 : _d.type) === "slot") {
|
|
4273
|
+
changeIncludesSlot = true;
|
|
4274
|
+
}
|
|
4275
|
+
}
|
|
4276
|
+
}
|
|
4262
4277
|
}
|
|
4263
|
-
changedProps.id = item.props.id;
|
|
4264
|
-
prevProps.current = item.props;
|
|
4265
4278
|
const mapped = mapFields(
|
|
4266
|
-
|
|
4279
|
+
item,
|
|
4267
4280
|
mappers,
|
|
4268
4281
|
config,
|
|
4269
4282
|
false,
|
|
4270
|
-
changeIncludesSlot
|
|
4283
|
+
changeIncludesSlot,
|
|
4284
|
+
changedFields
|
|
4271
4285
|
).props;
|
|
4272
|
-
|
|
4286
|
+
prevProps.current = item.props;
|
|
4287
|
+
prevMappers.current = mappers;
|
|
4288
|
+
prevResult.current = changedFields ? __spreadValues(__spreadValues({}, prevResult.current), mapped) : mapped;
|
|
4273
4289
|
return prevResult.current;
|
|
4274
4290
|
}, [config, item, mappers]);
|
|
4275
4291
|
const mergedProps = useMemo10(
|
|
@@ -4499,7 +4515,7 @@ import {
|
|
|
4499
4515
|
} from "react";
|
|
4500
4516
|
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
4501
4517
|
var Editor2 = lazy2(
|
|
4502
|
-
() => import("./Editor-
|
|
4518
|
+
() => import("./Editor-MLHOIEVM.mjs").then((m) => ({
|
|
4503
4519
|
default: m.Editor
|
|
4504
4520
|
}))
|
|
4505
4521
|
);
|
|
@@ -11023,6 +11039,7 @@ var PluginTab = ({
|
|
|
11023
11039
|
return /* @__PURE__ */ jsx55("div", { className: getPluginTabClassName({ visible, mobileOnly }), children: /* @__PURE__ */ jsx55("div", { className: getPluginTabClassName("body"), children }) });
|
|
11024
11040
|
};
|
|
11025
11041
|
var Layout = ({ children }) => {
|
|
11042
|
+
var _a, _b;
|
|
11026
11043
|
const {
|
|
11027
11044
|
iframe: _iframe,
|
|
11028
11045
|
dnd,
|
|
@@ -11106,11 +11123,10 @@ var Layout = ({ children }) => {
|
|
|
11106
11123
|
}
|
|
11107
11124
|
const setUi = useAppStore((s) => s.setUi);
|
|
11108
11125
|
const currentPlugin = useAppStore((s) => {
|
|
11109
|
-
var
|
|
11110
|
-
return (
|
|
11126
|
+
var _a2;
|
|
11127
|
+
return (_a2 = s.state.ui.plugin) == null ? void 0 : _a2.current;
|
|
11111
11128
|
});
|
|
11112
11129
|
const appStoreApi = useAppStoreApi();
|
|
11113
|
-
const [mobilePanelHeightMode, setMobilePanelHeightMode] = useState23("toggle");
|
|
11114
11130
|
const hasLegacySideBarPlugin = useMemo24(
|
|
11115
11131
|
() => !!(plugins == null ? void 0 : plugins.find((p) => p.name === "legacy-side-bar")),
|
|
11116
11132
|
[plugins]
|
|
@@ -11127,17 +11143,15 @@ var Layout = ({ children }) => {
|
|
|
11127
11143
|
combinedPlugins.push(fieldsPlugin());
|
|
11128
11144
|
}
|
|
11129
11145
|
combinedPlugins == null ? void 0 : combinedPlugins.forEach((plugin) => {
|
|
11130
|
-
var
|
|
11146
|
+
var _a2, _b2, _c;
|
|
11131
11147
|
if (plugin.name && plugin.render) {
|
|
11132
11148
|
if (details[plugin.name]) {
|
|
11133
11149
|
delete details[plugin.name];
|
|
11134
11150
|
}
|
|
11135
11151
|
details[plugin.name] = {
|
|
11136
|
-
label: (
|
|
11137
|
-
icon: (
|
|
11152
|
+
label: (_a2 = plugin.label) != null ? _a2 : plugin.name,
|
|
11153
|
+
icon: (_b2 = plugin.icon) != null ? _b2 : /* @__PURE__ */ jsx55(ToyBrick, {}),
|
|
11138
11154
|
onClick: () => {
|
|
11139
|
-
var _a2;
|
|
11140
|
-
setMobilePanelHeightMode((_a2 = plugin.mobilePanelHeight) != null ? _a2 : "toggle");
|
|
11141
11155
|
if (plugin.name === currentPlugin) {
|
|
11142
11156
|
if (leftSideBarVisible) {
|
|
11143
11157
|
setUi({ leftSideBarVisible: false });
|
|
@@ -11155,6 +11169,7 @@ var Layout = ({ children }) => {
|
|
|
11155
11169
|
},
|
|
11156
11170
|
isActive: leftSideBarVisible && currentPlugin === plugin.name,
|
|
11157
11171
|
render: plugin.render,
|
|
11172
|
+
mobilePanelHeight: (_c = plugin.mobilePanelHeight) != null ? _c : "toggle",
|
|
11158
11173
|
mobileOnly: hasLegacySideBarPlugin || plugin.mobileOnly,
|
|
11159
11174
|
desktopOnly: plugin.name === "legacy-side-bar" || plugin.desktopOnly
|
|
11160
11175
|
};
|
|
@@ -11162,6 +11177,8 @@ var Layout = ({ children }) => {
|
|
|
11162
11177
|
});
|
|
11163
11178
|
return details;
|
|
11164
11179
|
}, [plugins, currentPlugin, appStoreApi, leftSideBarVisible]);
|
|
11180
|
+
const activePlugin = currentPlugin != null ? currentPlugin : Object.keys(pluginItems)[0];
|
|
11181
|
+
const mobilePanelHeightMode = (_b = (_a = pluginItems[activePlugin]) == null ? void 0 : _a.mobilePanelHeight) != null ? _b : "toggle";
|
|
11165
11182
|
useEffect28(() => {
|
|
11166
11183
|
if (!currentPlugin) {
|
|
11167
11184
|
const names = Object.keys(pluginItems);
|
|
@@ -11171,8 +11188,8 @@ var Layout = ({ children }) => {
|
|
|
11171
11188
|
const hasDesktopFieldsPlugin = pluginItems["fields"] && pluginItems["fields"].mobileOnly === false;
|
|
11172
11189
|
const mobilePanelExpanded = useAppStore(
|
|
11173
11190
|
(s) => {
|
|
11174
|
-
var
|
|
11175
|
-
return (
|
|
11191
|
+
var _a2;
|
|
11192
|
+
return (_a2 = s.state.ui.mobilePanelExpanded) != null ? _a2 : false;
|
|
11176
11193
|
}
|
|
11177
11194
|
);
|
|
11178
11195
|
return /* @__PURE__ */ jsxs23(
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
LoadedRichTextMenuInner
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-25O24MZR.mjs";
|
|
4
|
+
import "./chunk-NKDMBWQC.mjs";
|
|
5
|
+
import "./chunk-C2H4WQP2.mjs";
|
|
6
|
+
import "./chunk-4I2WN43X.mjs";
|
|
7
|
+
import "./chunk-KJQTOPIV.mjs";
|
|
8
|
+
import "./chunk-25QAPMLH.mjs";
|
|
9
|
+
import "./chunk-WUO7D6OQ.mjs";
|
|
10
10
|
import "./chunk-Y2EFNT5P.mjs";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-QHQD3BMI.mjs";
|
|
12
12
|
import {
|
|
13
13
|
__spreadValues,
|
|
14
14
|
init_react_import
|
package/dist/index.js
CHANGED
|
@@ -1427,7 +1427,7 @@ var init_default_slots = __esm({
|
|
|
1427
1427
|
});
|
|
1428
1428
|
|
|
1429
1429
|
// lib/data/map-fields.ts
|
|
1430
|
-
function mapFields(item, mappers, config, recurseSlots = false, shouldDefaultSlots = true) {
|
|
1430
|
+
function mapFields(item, mappers, config, recurseSlots = false, shouldDefaultSlots = true, fieldsToMap) {
|
|
1431
1431
|
var _a, _b, _c, _d, _e;
|
|
1432
1432
|
const itemType = "type" in item ? item.type : "root";
|
|
1433
1433
|
const componentConfig = itemType === "root" ? config.root : (_a = config.components) == null ? void 0 : _a[itemType];
|
|
@@ -1439,7 +1439,8 @@ function mapFields(item, mappers, config, recurseSlots = false, shouldDefaultSlo
|
|
|
1439
1439
|
getPropPath: (k) => k,
|
|
1440
1440
|
config,
|
|
1441
1441
|
recurseSlots,
|
|
1442
|
-
ownedFields: true
|
|
1442
|
+
ownedFields: true,
|
|
1443
|
+
keysToWalk: fieldsToMap
|
|
1443
1444
|
});
|
|
1444
1445
|
if (isPromise(newProps)) {
|
|
1445
1446
|
return newProps.then((resolvedProps) => __spreadProps(__spreadValues({}, item), {
|
|
@@ -1546,10 +1547,11 @@ var init_map_fields = __esm({
|
|
|
1546
1547
|
getPropPath,
|
|
1547
1548
|
config,
|
|
1548
1549
|
recurseSlots,
|
|
1549
|
-
ownedFields
|
|
1550
|
+
ownedFields,
|
|
1551
|
+
keysToWalk: providedKeys
|
|
1550
1552
|
}) => {
|
|
1551
|
-
const keys = Object.keys(value);
|
|
1552
|
-
if (ownedFields) {
|
|
1553
|
+
const keys = providedKeys != null ? providedKeys : Object.keys(value);
|
|
1554
|
+
if (!providedKeys && ownedFields) {
|
|
1553
1555
|
for (const fieldName in fields) {
|
|
1554
1556
|
const fieldType = fields[fieldName].type;
|
|
1555
1557
|
if (fieldType !== "slot" && mappers[fieldType] && !(fieldName in value)) {
|
|
@@ -9235,6 +9237,7 @@ init_react_import();
|
|
|
9235
9237
|
var import_react63 = require("react");
|
|
9236
9238
|
init_map_fields();
|
|
9237
9239
|
function useFieldTransformsTracked(config, item, transforms, readOnly, forceReadOnly) {
|
|
9240
|
+
const prevMappers = (0, import_react63.useRef)(null);
|
|
9238
9241
|
const prevProps = (0, import_react63.useRef)(null);
|
|
9239
9242
|
const prevResult = (0, import_react63.useRef)(item.props);
|
|
9240
9243
|
const mappers = (0, import_react63.useMemo)(
|
|
@@ -9242,29 +9245,44 @@ function useFieldTransformsTracked(config, item, transforms, readOnly, forceRead
|
|
|
9242
9245
|
[transforms, readOnly, forceReadOnly]
|
|
9243
9246
|
);
|
|
9244
9247
|
const transformedProps = (0, import_react63.useMemo)(() => {
|
|
9245
|
-
var _a, _b, _c;
|
|
9246
|
-
const changedProps = {};
|
|
9248
|
+
var _a, _b, _c, _d;
|
|
9247
9249
|
const componentConfig = item.type === "root" ? config.root : (_a = config.components) == null ? void 0 : _a[item.type];
|
|
9250
|
+
const componentFields = (_b = componentConfig == null ? void 0 : componentConfig.fields) != null ? _b : {};
|
|
9251
|
+
const fullRemap = prevMappers.current !== mappers;
|
|
9252
|
+
let changedFields;
|
|
9248
9253
|
let changeIncludesSlot = false;
|
|
9249
|
-
|
|
9250
|
-
|
|
9251
|
-
|
|
9252
|
-
changedProps[fieldName] = item.props[fieldName];
|
|
9253
|
-
if (fieldType === "slot") {
|
|
9254
|
+
if (!prevProps.current || fullRemap) {
|
|
9255
|
+
for (const fieldName in item.props) {
|
|
9256
|
+
if (((_c = componentFields[fieldName]) == null ? void 0 : _c.type) === "slot") {
|
|
9254
9257
|
changeIncludesSlot = true;
|
|
9255
9258
|
}
|
|
9256
9259
|
}
|
|
9260
|
+
} else {
|
|
9261
|
+
changedFields = ["id"];
|
|
9262
|
+
const allFieldNames = /* @__PURE__ */ new Set([
|
|
9263
|
+
...Object.keys(item.props),
|
|
9264
|
+
...Object.keys(prevProps.current)
|
|
9265
|
+
]);
|
|
9266
|
+
for (const fieldName of allFieldNames) {
|
|
9267
|
+
if (item.props[fieldName] !== prevProps.current[fieldName]) {
|
|
9268
|
+
changedFields.push(fieldName);
|
|
9269
|
+
if (((_d = componentFields[fieldName]) == null ? void 0 : _d.type) === "slot") {
|
|
9270
|
+
changeIncludesSlot = true;
|
|
9271
|
+
}
|
|
9272
|
+
}
|
|
9273
|
+
}
|
|
9257
9274
|
}
|
|
9258
|
-
changedProps.id = item.props.id;
|
|
9259
|
-
prevProps.current = item.props;
|
|
9260
9275
|
const mapped = mapFields(
|
|
9261
|
-
|
|
9276
|
+
item,
|
|
9262
9277
|
mappers,
|
|
9263
9278
|
config,
|
|
9264
9279
|
false,
|
|
9265
|
-
changeIncludesSlot
|
|
9280
|
+
changeIncludesSlot,
|
|
9281
|
+
changedFields
|
|
9266
9282
|
).props;
|
|
9267
|
-
|
|
9283
|
+
prevProps.current = item.props;
|
|
9284
|
+
prevMappers.current = mappers;
|
|
9285
|
+
prevResult.current = changedFields ? __spreadValues(__spreadValues({}, prevResult.current), mapped) : mapped;
|
|
9268
9286
|
return prevResult.current;
|
|
9269
9287
|
}, [config, item, mappers]);
|
|
9270
9288
|
const mergedProps = (0, import_react63.useMemo)(
|
|
@@ -16955,6 +16973,7 @@ var PluginTab = ({
|
|
|
16955
16973
|
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: getPluginTabClassName({ visible, mobileOnly }), children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: getPluginTabClassName("body"), children }) });
|
|
16956
16974
|
};
|
|
16957
16975
|
var Layout = ({ children }) => {
|
|
16976
|
+
var _a, _b;
|
|
16958
16977
|
const {
|
|
16959
16978
|
iframe: _iframe,
|
|
16960
16979
|
dnd,
|
|
@@ -17038,11 +17057,10 @@ var Layout = ({ children }) => {
|
|
|
17038
17057
|
}
|
|
17039
17058
|
const setUi = useAppStore((s) => s.setUi);
|
|
17040
17059
|
const currentPlugin = useAppStore((s) => {
|
|
17041
|
-
var
|
|
17042
|
-
return (
|
|
17060
|
+
var _a2;
|
|
17061
|
+
return (_a2 = s.state.ui.plugin) == null ? void 0 : _a2.current;
|
|
17043
17062
|
});
|
|
17044
17063
|
const appStoreApi = useAppStoreApi();
|
|
17045
|
-
const [mobilePanelHeightMode, setMobilePanelHeightMode] = (0, import_react94.useState)("toggle");
|
|
17046
17064
|
const hasLegacySideBarPlugin = (0, import_react94.useMemo)(
|
|
17047
17065
|
() => !!(plugins == null ? void 0 : plugins.find((p) => p.name === "legacy-side-bar")),
|
|
17048
17066
|
[plugins]
|
|
@@ -17059,17 +17077,15 @@ var Layout = ({ children }) => {
|
|
|
17059
17077
|
combinedPlugins.push(fieldsPlugin());
|
|
17060
17078
|
}
|
|
17061
17079
|
combinedPlugins == null ? void 0 : combinedPlugins.forEach((plugin) => {
|
|
17062
|
-
var
|
|
17080
|
+
var _a2, _b2, _c;
|
|
17063
17081
|
if (plugin.name && plugin.render) {
|
|
17064
17082
|
if (details[plugin.name]) {
|
|
17065
17083
|
delete details[plugin.name];
|
|
17066
17084
|
}
|
|
17067
17085
|
details[plugin.name] = {
|
|
17068
|
-
label: (
|
|
17069
|
-
icon: (
|
|
17086
|
+
label: (_a2 = plugin.label) != null ? _a2 : plugin.name,
|
|
17087
|
+
icon: (_b2 = plugin.icon) != null ? _b2 : /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(ToyBrick, {}),
|
|
17070
17088
|
onClick: () => {
|
|
17071
|
-
var _a2;
|
|
17072
|
-
setMobilePanelHeightMode((_a2 = plugin.mobilePanelHeight) != null ? _a2 : "toggle");
|
|
17073
17089
|
if (plugin.name === currentPlugin) {
|
|
17074
17090
|
if (leftSideBarVisible) {
|
|
17075
17091
|
setUi({ leftSideBarVisible: false });
|
|
@@ -17087,6 +17103,7 @@ var Layout = ({ children }) => {
|
|
|
17087
17103
|
},
|
|
17088
17104
|
isActive: leftSideBarVisible && currentPlugin === plugin.name,
|
|
17089
17105
|
render: plugin.render,
|
|
17106
|
+
mobilePanelHeight: (_c = plugin.mobilePanelHeight) != null ? _c : "toggle",
|
|
17090
17107
|
mobileOnly: hasLegacySideBarPlugin || plugin.mobileOnly,
|
|
17091
17108
|
desktopOnly: plugin.name === "legacy-side-bar" || plugin.desktopOnly
|
|
17092
17109
|
};
|
|
@@ -17094,6 +17111,8 @@ var Layout = ({ children }) => {
|
|
|
17094
17111
|
});
|
|
17095
17112
|
return details;
|
|
17096
17113
|
}, [plugins, currentPlugin, appStoreApi, leftSideBarVisible]);
|
|
17114
|
+
const activePlugin = currentPlugin != null ? currentPlugin : Object.keys(pluginItems)[0];
|
|
17115
|
+
const mobilePanelHeightMode = (_b = (_a = pluginItems[activePlugin]) == null ? void 0 : _a.mobilePanelHeight) != null ? _b : "toggle";
|
|
17097
17116
|
(0, import_react94.useEffect)(() => {
|
|
17098
17117
|
if (!currentPlugin) {
|
|
17099
17118
|
const names = Object.keys(pluginItems);
|
|
@@ -17103,8 +17122,8 @@ var Layout = ({ children }) => {
|
|
|
17103
17122
|
const hasDesktopFieldsPlugin = pluginItems["fields"] && pluginItems["fields"].mobileOnly === false;
|
|
17104
17123
|
const mobilePanelExpanded = useAppStore(
|
|
17105
17124
|
(s) => {
|
|
17106
|
-
var
|
|
17107
|
-
return (
|
|
17125
|
+
var _a2;
|
|
17126
|
+
return (_a2 = s.state.ui.mobilePanelExpanded) != null ? _a2 : false;
|
|
17108
17127
|
}
|
|
17109
17128
|
);
|
|
17110
17129
|
return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(
|
package/dist/index.mjs
CHANGED
|
@@ -17,20 +17,20 @@ import {
|
|
|
17
17
|
setDeep,
|
|
18
18
|
useGetPuck,
|
|
19
19
|
usePuck
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-WH6PO5ND.mjs";
|
|
21
|
+
import "./chunk-PRZEIT36.mjs";
|
|
22
22
|
import {
|
|
23
23
|
migrate,
|
|
24
24
|
resolveAllData,
|
|
25
25
|
transformProps
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-JNJJ2M57.mjs";
|
|
27
27
|
import "./chunk-H635BA2V.mjs";
|
|
28
28
|
import {
|
|
29
29
|
RichTextMenu
|
|
30
|
-
} from "./chunk-
|
|
31
|
-
import "./chunk-
|
|
32
|
-
import "./chunk-
|
|
33
|
-
import "./chunk-
|
|
30
|
+
} from "./chunk-25O24MZR.mjs";
|
|
31
|
+
import "./chunk-NKDMBWQC.mjs";
|
|
32
|
+
import "./chunk-C2H4WQP2.mjs";
|
|
33
|
+
import "./chunk-4I2WN43X.mjs";
|
|
34
34
|
import {
|
|
35
35
|
Action,
|
|
36
36
|
ActionBar,
|
|
@@ -38,13 +38,13 @@ import {
|
|
|
38
38
|
IconButton,
|
|
39
39
|
Label,
|
|
40
40
|
Separator
|
|
41
|
-
} from "./chunk-
|
|
42
|
-
import "./chunk-
|
|
43
|
-
import "./chunk-
|
|
41
|
+
} from "./chunk-KJQTOPIV.mjs";
|
|
42
|
+
import "./chunk-25QAPMLH.mjs";
|
|
43
|
+
import "./chunk-WUO7D6OQ.mjs";
|
|
44
44
|
import "./chunk-Y2EFNT5P.mjs";
|
|
45
45
|
import {
|
|
46
46
|
walkTree
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-QHQD3BMI.mjs";
|
|
48
48
|
import {
|
|
49
49
|
init_react_import
|
|
50
50
|
} from "./chunk-M6W7YEVX.mjs";
|
package/dist/internal.js
CHANGED
|
@@ -177,10 +177,11 @@ var walkObject = ({
|
|
|
177
177
|
getPropPath,
|
|
178
178
|
config,
|
|
179
179
|
recurseSlots,
|
|
180
|
-
ownedFields
|
|
180
|
+
ownedFields,
|
|
181
|
+
keysToWalk: providedKeys
|
|
181
182
|
}) => {
|
|
182
|
-
const keys = Object.keys(value);
|
|
183
|
-
if (ownedFields) {
|
|
183
|
+
const keys = providedKeys != null ? providedKeys : Object.keys(value);
|
|
184
|
+
if (!providedKeys && ownedFields) {
|
|
184
185
|
for (const fieldName in fields) {
|
|
185
186
|
const fieldType = fields[fieldName].type;
|
|
186
187
|
if (fieldType !== "slot" && mappers[fieldType] && !(fieldName in value)) {
|
|
@@ -214,7 +215,7 @@ var walkObject = ({
|
|
|
214
215
|
}
|
|
215
216
|
return flatten(newProps);
|
|
216
217
|
};
|
|
217
|
-
function mapFields(item, mappers, config, recurseSlots = false, shouldDefaultSlots = true) {
|
|
218
|
+
function mapFields(item, mappers, config, recurseSlots = false, shouldDefaultSlots = true, fieldsToMap) {
|
|
218
219
|
var _a, _b, _c, _d, _e;
|
|
219
220
|
const itemType = "type" in item ? item.type : "root";
|
|
220
221
|
const componentConfig = itemType === "root" ? config.root : (_a = config.components) == null ? void 0 : _a[itemType];
|
|
@@ -226,7 +227,8 @@ function mapFields(item, mappers, config, recurseSlots = false, shouldDefaultSlo
|
|
|
226
227
|
getPropPath: (k) => k,
|
|
227
228
|
config,
|
|
228
229
|
recurseSlots,
|
|
229
|
-
ownedFields: true
|
|
230
|
+
ownedFields: true,
|
|
231
|
+
keysToWalk: fieldsToMap
|
|
230
232
|
});
|
|
231
233
|
if (isPromise(newProps)) {
|
|
232
234
|
return newProps.then((resolvedProps) => __spreadProps(__spreadValues({}, item), {
|
package/dist/internal.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useListOptions
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4I2WN43X.mjs";
|
|
4
4
|
import {
|
|
5
5
|
List,
|
|
6
6
|
SelectControl,
|
|
7
7
|
useControlContext
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-KJQTOPIV.mjs";
|
|
9
|
+
import "./chunk-25QAPMLH.mjs";
|
|
10
|
+
import "./chunk-WUO7D6OQ.mjs";
|
|
11
11
|
import "./chunk-Y2EFNT5P.mjs";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-QHQD3BMI.mjs";
|
|
13
13
|
import {
|
|
14
14
|
init_react_import
|
|
15
15
|
} from "./chunk-M6W7YEVX.mjs";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useAlignOptions
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NKDMBWQC.mjs";
|
|
4
4
|
import {
|
|
5
5
|
AlignLeft,
|
|
6
6
|
SelectControl,
|
|
7
7
|
useControlContext
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-KJQTOPIV.mjs";
|
|
9
|
+
import "./chunk-25QAPMLH.mjs";
|
|
10
|
+
import "./chunk-WUO7D6OQ.mjs";
|
|
11
11
|
import "./chunk-Y2EFNT5P.mjs";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-QHQD3BMI.mjs";
|
|
13
13
|
import {
|
|
14
14
|
init_react_import
|
|
15
15
|
} from "./chunk-M6W7YEVX.mjs";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useHeadingOptions
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-C2H4WQP2.mjs";
|
|
4
4
|
import {
|
|
5
5
|
Heading,
|
|
6
6
|
SelectControl,
|
|
7
7
|
useControlContext
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-KJQTOPIV.mjs";
|
|
9
|
+
import "./chunk-25QAPMLH.mjs";
|
|
10
|
+
import "./chunk-WUO7D6OQ.mjs";
|
|
11
11
|
import "./chunk-Y2EFNT5P.mjs";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-QHQD3BMI.mjs";
|
|
13
13
|
import {
|
|
14
14
|
init_react_import
|
|
15
15
|
} from "./chunk-M6W7YEVX.mjs";
|
package/dist/no-external.js
CHANGED
|
@@ -1427,7 +1427,7 @@ var init_default_slots = __esm({
|
|
|
1427
1427
|
});
|
|
1428
1428
|
|
|
1429
1429
|
// lib/data/map-fields.ts
|
|
1430
|
-
function mapFields(item, mappers, config, recurseSlots = false, shouldDefaultSlots = true) {
|
|
1430
|
+
function mapFields(item, mappers, config, recurseSlots = false, shouldDefaultSlots = true, fieldsToMap) {
|
|
1431
1431
|
var _a, _b, _c, _d, _e;
|
|
1432
1432
|
const itemType = "type" in item ? item.type : "root";
|
|
1433
1433
|
const componentConfig = itemType === "root" ? config.root : (_a = config.components) == null ? void 0 : _a[itemType];
|
|
@@ -1439,7 +1439,8 @@ function mapFields(item, mappers, config, recurseSlots = false, shouldDefaultSlo
|
|
|
1439
1439
|
getPropPath: (k) => k,
|
|
1440
1440
|
config,
|
|
1441
1441
|
recurseSlots,
|
|
1442
|
-
ownedFields: true
|
|
1442
|
+
ownedFields: true,
|
|
1443
|
+
keysToWalk: fieldsToMap
|
|
1443
1444
|
});
|
|
1444
1445
|
if (isPromise(newProps)) {
|
|
1445
1446
|
return newProps.then((resolvedProps) => __spreadProps(__spreadValues({}, item), {
|
|
@@ -1546,10 +1547,11 @@ var init_map_fields = __esm({
|
|
|
1546
1547
|
getPropPath,
|
|
1547
1548
|
config,
|
|
1548
1549
|
recurseSlots,
|
|
1549
|
-
ownedFields
|
|
1550
|
+
ownedFields,
|
|
1551
|
+
keysToWalk: providedKeys
|
|
1550
1552
|
}) => {
|
|
1551
|
-
const keys = Object.keys(value);
|
|
1552
|
-
if (ownedFields) {
|
|
1553
|
+
const keys = providedKeys != null ? providedKeys : Object.keys(value);
|
|
1554
|
+
if (!providedKeys && ownedFields) {
|
|
1553
1555
|
for (const fieldName in fields) {
|
|
1554
1556
|
const fieldType = fields[fieldName].type;
|
|
1555
1557
|
if (fieldType !== "slot" && mappers[fieldType] && !(fieldName in value)) {
|
|
@@ -9235,6 +9237,7 @@ init_react_import();
|
|
|
9235
9237
|
var import_react63 = require("react");
|
|
9236
9238
|
init_map_fields();
|
|
9237
9239
|
function useFieldTransformsTracked(config, item, transforms, readOnly, forceReadOnly) {
|
|
9240
|
+
const prevMappers = (0, import_react63.useRef)(null);
|
|
9238
9241
|
const prevProps = (0, import_react63.useRef)(null);
|
|
9239
9242
|
const prevResult = (0, import_react63.useRef)(item.props);
|
|
9240
9243
|
const mappers = (0, import_react63.useMemo)(
|
|
@@ -9242,29 +9245,44 @@ function useFieldTransformsTracked(config, item, transforms, readOnly, forceRead
|
|
|
9242
9245
|
[transforms, readOnly, forceReadOnly]
|
|
9243
9246
|
);
|
|
9244
9247
|
const transformedProps = (0, import_react63.useMemo)(() => {
|
|
9245
|
-
var _a, _b, _c;
|
|
9246
|
-
const changedProps = {};
|
|
9248
|
+
var _a, _b, _c, _d;
|
|
9247
9249
|
const componentConfig = item.type === "root" ? config.root : (_a = config.components) == null ? void 0 : _a[item.type];
|
|
9250
|
+
const componentFields = (_b = componentConfig == null ? void 0 : componentConfig.fields) != null ? _b : {};
|
|
9251
|
+
const fullRemap = prevMappers.current !== mappers;
|
|
9252
|
+
let changedFields;
|
|
9248
9253
|
let changeIncludesSlot = false;
|
|
9249
|
-
|
|
9250
|
-
|
|
9251
|
-
|
|
9252
|
-
changedProps[fieldName] = item.props[fieldName];
|
|
9253
|
-
if (fieldType === "slot") {
|
|
9254
|
+
if (!prevProps.current || fullRemap) {
|
|
9255
|
+
for (const fieldName in item.props) {
|
|
9256
|
+
if (((_c = componentFields[fieldName]) == null ? void 0 : _c.type) === "slot") {
|
|
9254
9257
|
changeIncludesSlot = true;
|
|
9255
9258
|
}
|
|
9256
9259
|
}
|
|
9260
|
+
} else {
|
|
9261
|
+
changedFields = ["id"];
|
|
9262
|
+
const allFieldNames = /* @__PURE__ */ new Set([
|
|
9263
|
+
...Object.keys(item.props),
|
|
9264
|
+
...Object.keys(prevProps.current)
|
|
9265
|
+
]);
|
|
9266
|
+
for (const fieldName of allFieldNames) {
|
|
9267
|
+
if (item.props[fieldName] !== prevProps.current[fieldName]) {
|
|
9268
|
+
changedFields.push(fieldName);
|
|
9269
|
+
if (((_d = componentFields[fieldName]) == null ? void 0 : _d.type) === "slot") {
|
|
9270
|
+
changeIncludesSlot = true;
|
|
9271
|
+
}
|
|
9272
|
+
}
|
|
9273
|
+
}
|
|
9257
9274
|
}
|
|
9258
|
-
changedProps.id = item.props.id;
|
|
9259
|
-
prevProps.current = item.props;
|
|
9260
9275
|
const mapped = mapFields(
|
|
9261
|
-
|
|
9276
|
+
item,
|
|
9262
9277
|
mappers,
|
|
9263
9278
|
config,
|
|
9264
9279
|
false,
|
|
9265
|
-
changeIncludesSlot
|
|
9280
|
+
changeIncludesSlot,
|
|
9281
|
+
changedFields
|
|
9266
9282
|
).props;
|
|
9267
|
-
|
|
9283
|
+
prevProps.current = item.props;
|
|
9284
|
+
prevMappers.current = mappers;
|
|
9285
|
+
prevResult.current = changedFields ? __spreadValues(__spreadValues({}, prevResult.current), mapped) : mapped;
|
|
9268
9286
|
return prevResult.current;
|
|
9269
9287
|
}, [config, item, mappers]);
|
|
9270
9288
|
const mergedProps = (0, import_react63.useMemo)(
|
|
@@ -16955,6 +16973,7 @@ var PluginTab = ({
|
|
|
16955
16973
|
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: getPluginTabClassName({ visible, mobileOnly }), children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: getPluginTabClassName("body"), children }) });
|
|
16956
16974
|
};
|
|
16957
16975
|
var Layout = ({ children }) => {
|
|
16976
|
+
var _a, _b;
|
|
16958
16977
|
const {
|
|
16959
16978
|
iframe: _iframe,
|
|
16960
16979
|
dnd,
|
|
@@ -17038,11 +17057,10 @@ var Layout = ({ children }) => {
|
|
|
17038
17057
|
}
|
|
17039
17058
|
const setUi = useAppStore((s) => s.setUi);
|
|
17040
17059
|
const currentPlugin = useAppStore((s) => {
|
|
17041
|
-
var
|
|
17042
|
-
return (
|
|
17060
|
+
var _a2;
|
|
17061
|
+
return (_a2 = s.state.ui.plugin) == null ? void 0 : _a2.current;
|
|
17043
17062
|
});
|
|
17044
17063
|
const appStoreApi = useAppStoreApi();
|
|
17045
|
-
const [mobilePanelHeightMode, setMobilePanelHeightMode] = (0, import_react94.useState)("toggle");
|
|
17046
17064
|
const hasLegacySideBarPlugin = (0, import_react94.useMemo)(
|
|
17047
17065
|
() => !!(plugins == null ? void 0 : plugins.find((p) => p.name === "legacy-side-bar")),
|
|
17048
17066
|
[plugins]
|
|
@@ -17059,17 +17077,15 @@ var Layout = ({ children }) => {
|
|
|
17059
17077
|
combinedPlugins.push(fieldsPlugin());
|
|
17060
17078
|
}
|
|
17061
17079
|
combinedPlugins == null ? void 0 : combinedPlugins.forEach((plugin) => {
|
|
17062
|
-
var
|
|
17080
|
+
var _a2, _b2, _c;
|
|
17063
17081
|
if (plugin.name && plugin.render) {
|
|
17064
17082
|
if (details[plugin.name]) {
|
|
17065
17083
|
delete details[plugin.name];
|
|
17066
17084
|
}
|
|
17067
17085
|
details[plugin.name] = {
|
|
17068
|
-
label: (
|
|
17069
|
-
icon: (
|
|
17086
|
+
label: (_a2 = plugin.label) != null ? _a2 : plugin.name,
|
|
17087
|
+
icon: (_b2 = plugin.icon) != null ? _b2 : /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(ToyBrick, {}),
|
|
17070
17088
|
onClick: () => {
|
|
17071
|
-
var _a2;
|
|
17072
|
-
setMobilePanelHeightMode((_a2 = plugin.mobilePanelHeight) != null ? _a2 : "toggle");
|
|
17073
17089
|
if (plugin.name === currentPlugin) {
|
|
17074
17090
|
if (leftSideBarVisible) {
|
|
17075
17091
|
setUi({ leftSideBarVisible: false });
|
|
@@ -17087,6 +17103,7 @@ var Layout = ({ children }) => {
|
|
|
17087
17103
|
},
|
|
17088
17104
|
isActive: leftSideBarVisible && currentPlugin === plugin.name,
|
|
17089
17105
|
render: plugin.render,
|
|
17106
|
+
mobilePanelHeight: (_c = plugin.mobilePanelHeight) != null ? _c : "toggle",
|
|
17090
17107
|
mobileOnly: hasLegacySideBarPlugin || plugin.mobileOnly,
|
|
17091
17108
|
desktopOnly: plugin.name === "legacy-side-bar" || plugin.desktopOnly
|
|
17092
17109
|
};
|
|
@@ -17094,6 +17111,8 @@ var Layout = ({ children }) => {
|
|
|
17094
17111
|
});
|
|
17095
17112
|
return details;
|
|
17096
17113
|
}, [plugins, currentPlugin, appStoreApi, leftSideBarVisible]);
|
|
17114
|
+
const activePlugin = currentPlugin != null ? currentPlugin : Object.keys(pluginItems)[0];
|
|
17115
|
+
const mobilePanelHeightMode = (_b = (_a = pluginItems[activePlugin]) == null ? void 0 : _a.mobilePanelHeight) != null ? _b : "toggle";
|
|
17097
17116
|
(0, import_react94.useEffect)(() => {
|
|
17098
17117
|
if (!currentPlugin) {
|
|
17099
17118
|
const names = Object.keys(pluginItems);
|
|
@@ -17103,8 +17122,8 @@ var Layout = ({ children }) => {
|
|
|
17103
17122
|
const hasDesktopFieldsPlugin = pluginItems["fields"] && pluginItems["fields"].mobileOnly === false;
|
|
17104
17123
|
const mobilePanelExpanded = useAppStore(
|
|
17105
17124
|
(s) => {
|
|
17106
|
-
var
|
|
17107
|
-
return (
|
|
17125
|
+
var _a2;
|
|
17126
|
+
return (_a2 = s.state.ui.mobilePanelExpanded) != null ? _a2 : false;
|
|
17108
17127
|
}
|
|
17109
17128
|
);
|
|
17110
17129
|
return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(
|
package/dist/no-external.mjs
CHANGED
|
@@ -17,20 +17,20 @@ import {
|
|
|
17
17
|
setDeep,
|
|
18
18
|
useGetPuck,
|
|
19
19
|
usePuck
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-WH6PO5ND.mjs";
|
|
21
|
+
import "./chunk-PRZEIT36.mjs";
|
|
22
22
|
import {
|
|
23
23
|
migrate,
|
|
24
24
|
resolveAllData,
|
|
25
25
|
transformProps
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-JNJJ2M57.mjs";
|
|
27
27
|
import "./chunk-H635BA2V.mjs";
|
|
28
28
|
import {
|
|
29
29
|
RichTextMenu
|
|
30
|
-
} from "./chunk-
|
|
31
|
-
import "./chunk-
|
|
32
|
-
import "./chunk-
|
|
33
|
-
import "./chunk-
|
|
30
|
+
} from "./chunk-25O24MZR.mjs";
|
|
31
|
+
import "./chunk-NKDMBWQC.mjs";
|
|
32
|
+
import "./chunk-C2H4WQP2.mjs";
|
|
33
|
+
import "./chunk-4I2WN43X.mjs";
|
|
34
34
|
import {
|
|
35
35
|
Action,
|
|
36
36
|
ActionBar,
|
|
@@ -38,13 +38,13 @@ import {
|
|
|
38
38
|
IconButton,
|
|
39
39
|
Label,
|
|
40
40
|
Separator
|
|
41
|
-
} from "./chunk-
|
|
42
|
-
import "./chunk-
|
|
43
|
-
import "./chunk-
|
|
41
|
+
} from "./chunk-KJQTOPIV.mjs";
|
|
42
|
+
import "./chunk-25QAPMLH.mjs";
|
|
43
|
+
import "./chunk-WUO7D6OQ.mjs";
|
|
44
44
|
import "./chunk-Y2EFNT5P.mjs";
|
|
45
45
|
import {
|
|
46
46
|
walkTree
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-QHQD3BMI.mjs";
|
|
48
48
|
import {
|
|
49
49
|
init_react_import
|
|
50
50
|
} from "./chunk-M6W7YEVX.mjs";
|
package/dist/rsc.js
CHANGED
|
@@ -497,10 +497,11 @@ var walkObject = ({
|
|
|
497
497
|
getPropPath,
|
|
498
498
|
config,
|
|
499
499
|
recurseSlots,
|
|
500
|
-
ownedFields
|
|
500
|
+
ownedFields,
|
|
501
|
+
keysToWalk: providedKeys
|
|
501
502
|
}) => {
|
|
502
|
-
const keys = Object.keys(value);
|
|
503
|
-
if (ownedFields) {
|
|
503
|
+
const keys = providedKeys != null ? providedKeys : Object.keys(value);
|
|
504
|
+
if (!providedKeys && ownedFields) {
|
|
504
505
|
for (const fieldName in fields) {
|
|
505
506
|
const fieldType = fields[fieldName].type;
|
|
506
507
|
if (fieldType !== "slot" && mappers[fieldType] && !(fieldName in value)) {
|
|
@@ -534,7 +535,7 @@ var walkObject = ({
|
|
|
534
535
|
}
|
|
535
536
|
return flatten(newProps);
|
|
536
537
|
};
|
|
537
|
-
function mapFields(item, mappers, config, recurseSlots = false, shouldDefaultSlots = true) {
|
|
538
|
+
function mapFields(item, mappers, config, recurseSlots = false, shouldDefaultSlots = true, fieldsToMap) {
|
|
538
539
|
var _a, _b, _c, _d, _e;
|
|
539
540
|
const itemType = "type" in item ? item.type : "root";
|
|
540
541
|
const componentConfig = itemType === "root" ? config.root : (_a = config.components) == null ? void 0 : _a[itemType];
|
|
@@ -546,7 +547,8 @@ function mapFields(item, mappers, config, recurseSlots = false, shouldDefaultSlo
|
|
|
546
547
|
getPropPath: (k) => k,
|
|
547
548
|
config,
|
|
548
549
|
recurseSlots,
|
|
549
|
-
ownedFields: true
|
|
550
|
+
ownedFields: true,
|
|
551
|
+
keysToWalk: fieldsToMap
|
|
550
552
|
});
|
|
551
553
|
if (isPromise(newProps)) {
|
|
552
554
|
return newProps.then((resolvedProps) => __spreadProps(__spreadValues({}, item), {
|
package/dist/rsc.mjs
CHANGED
|
@@ -5,9 +5,9 @@ import {
|
|
|
5
5
|
transformProps,
|
|
6
6
|
useRichtextProps,
|
|
7
7
|
useSlots
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-JNJJ2M57.mjs";
|
|
9
9
|
import "./chunk-H635BA2V.mjs";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-WUO7D6OQ.mjs";
|
|
11
11
|
import "./chunk-Y2EFNT5P.mjs";
|
|
12
12
|
import {
|
|
13
13
|
rootAreaId,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
rootZone,
|
|
16
16
|
setupZone,
|
|
17
17
|
walkTree
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-QHQD3BMI.mjs";
|
|
19
19
|
import {
|
|
20
20
|
__spreadProps,
|
|
21
21
|
__spreadValues,
|