@reacteditor/core 0.0.17 → 0.0.19
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-RY6D73N6.mjs → Editor-GVYZ7S5L.mjs} +6 -6
- package/dist/{Editor-4LPVLYSU.css → Editor-IRCQF4VT.css} +10 -16
- package/dist/{chunk-2A2HBRLV.mjs → chunk-BORTMJJZ.mjs} +3 -3
- package/dist/{chunk-C5G7WUBQ.mjs → chunk-DKFLK64M.mjs} +1 -1
- package/dist/{chunk-AXB6UJ2P.mjs → chunk-HWYAMQID.mjs} +57 -44
- package/dist/{chunk-CUGSM3PC.mjs → chunk-M36T7BWB.mjs} +1 -1
- package/dist/{chunk-NUBRSWFJ.mjs → chunk-MUBFR675.mjs} +18 -1
- package/dist/{chunk-OAOKQORI.mjs → chunk-MVJENRGK.mjs} +129 -28
- package/dist/{chunk-ESU6AYGB.mjs → chunk-PGSQPCM6.mjs} +1 -1
- package/dist/{full-7ABPY2WA.css → full-B5V3G4IY.css} +10 -16
- package/dist/{full-35622JEC.mjs → full-QWTPWHXQ.mjs} +5 -5
- package/dist/{index-BZRpxcwy.d.mts → index-DET4zR84.d.mts} +25 -1
- package/dist/{index-B_21fGrq.d.ts → index-YRgZBGas.d.ts} +25 -1
- package/dist/index.css +10 -16
- package/dist/index.d.mts +35 -20
- package/dist/index.d.ts +35 -20
- package/dist/index.js +183 -53
- package/dist/index.mjs +7 -7
- package/dist/internal.d.mts +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/{loaded-I7V7FYES.mjs → loaded-BHRFTTT2.mjs} +2 -2
- package/dist/{loaded-GJMTZ3M5.mjs → loaded-HIFB4G2Q.mjs} +2 -2
- package/dist/{loaded-HGQBTPJQ.mjs → loaded-XKFARPER.mjs} +2 -2
- package/dist/no-external.css +10 -16
- package/dist/no-external.d.mts +2 -2
- package/dist/no-external.d.ts +2 -2
- package/dist/no-external.js +183 -53
- package/dist/no-external.mjs +7 -7
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -3255,7 +3255,24 @@ var init_store = __esm({
|
|
|
3255
3255
|
metadata: {},
|
|
3256
3256
|
fieldTransforms: {},
|
|
3257
3257
|
scrollToComponent: () => {
|
|
3258
|
-
}
|
|
3258
|
+
},
|
|
3259
|
+
route: null,
|
|
3260
|
+
isPublishing: false,
|
|
3261
|
+
publish: () => __async(null, null, function* () {
|
|
3262
|
+
const { onPublish, state, route } = get();
|
|
3263
|
+
if (!onPublish) return;
|
|
3264
|
+
const { root, content, globals } = state.data;
|
|
3265
|
+
const data = __spreadValues({
|
|
3266
|
+
root,
|
|
3267
|
+
content
|
|
3268
|
+
}, globals !== void 0 ? { globals } : {});
|
|
3269
|
+
set({ isPublishing: true });
|
|
3270
|
+
try {
|
|
3271
|
+
yield onPublish(data, route);
|
|
3272
|
+
} finally {
|
|
3273
|
+
set({ isPublishing: false });
|
|
3274
|
+
}
|
|
3275
|
+
})
|
|
3259
3276
|
}, initialAppStore), {
|
|
3260
3277
|
fields: createFieldsSlice(set, get),
|
|
3261
3278
|
history: createHistorySlice(set, get),
|
|
@@ -3600,12 +3617,12 @@ var init_styles_module2 = __esm({
|
|
|
3600
3617
|
"use strict";
|
|
3601
3618
|
init_react_import();
|
|
3602
3619
|
init_css_module_data3();
|
|
3603
|
-
styles_module_default4 = { "Loader": "
|
|
3620
|
+
styles_module_default4 = { "Loader": "_Loader_6933g_10", "loader-spin": "_loader-spin_6933g_1" };
|
|
3604
3621
|
}
|
|
3605
3622
|
});
|
|
3606
3623
|
|
|
3607
3624
|
// components/Loader/index.tsx
|
|
3608
|
-
var import_jsx_runtime3, getClassName2, Loader;
|
|
3625
|
+
var import_jsx_runtime3, getClassName2, LoaderIcon, Loader;
|
|
3609
3626
|
var init_Loader = __esm({
|
|
3610
3627
|
"components/Loader/index.tsx"() {
|
|
3611
3628
|
"use strict";
|
|
@@ -3614,25 +3631,125 @@ var init_Loader = __esm({
|
|
|
3614
3631
|
init_styles_module2();
|
|
3615
3632
|
import_jsx_runtime3 = require("react/jsx-runtime");
|
|
3616
3633
|
getClassName2 = get_class_name_factory_default("Loader", styles_module_default4);
|
|
3634
|
+
LoaderIcon = ({ size = 16 }) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
3635
|
+
"svg",
|
|
3636
|
+
{
|
|
3637
|
+
height: size,
|
|
3638
|
+
strokeLinejoin: "round",
|
|
3639
|
+
style: { color: "currentcolor" },
|
|
3640
|
+
viewBox: "0 0 16 16",
|
|
3641
|
+
width: size,
|
|
3642
|
+
"aria-hidden": "true",
|
|
3643
|
+
children: [
|
|
3644
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("g", { clipPath: "url(#editor-loader-clip)", children: [
|
|
3645
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "M8 0V4", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
3646
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3647
|
+
"path",
|
|
3648
|
+
{
|
|
3649
|
+
d: "M8 16V12",
|
|
3650
|
+
opacity: "0.5",
|
|
3651
|
+
stroke: "currentColor",
|
|
3652
|
+
strokeWidth: "1.5"
|
|
3653
|
+
}
|
|
3654
|
+
),
|
|
3655
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3656
|
+
"path",
|
|
3657
|
+
{
|
|
3658
|
+
d: "M3.29773 1.52783L5.64887 4.7639",
|
|
3659
|
+
opacity: "0.9",
|
|
3660
|
+
stroke: "currentColor",
|
|
3661
|
+
strokeWidth: "1.5"
|
|
3662
|
+
}
|
|
3663
|
+
),
|
|
3664
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3665
|
+
"path",
|
|
3666
|
+
{
|
|
3667
|
+
d: "M12.7023 1.52783L10.3511 4.7639",
|
|
3668
|
+
opacity: "0.1",
|
|
3669
|
+
stroke: "currentColor",
|
|
3670
|
+
strokeWidth: "1.5"
|
|
3671
|
+
}
|
|
3672
|
+
),
|
|
3673
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3674
|
+
"path",
|
|
3675
|
+
{
|
|
3676
|
+
d: "M12.7023 14.472L10.3511 11.236",
|
|
3677
|
+
opacity: "0.4",
|
|
3678
|
+
stroke: "currentColor",
|
|
3679
|
+
strokeWidth: "1.5"
|
|
3680
|
+
}
|
|
3681
|
+
),
|
|
3682
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3683
|
+
"path",
|
|
3684
|
+
{
|
|
3685
|
+
d: "M3.29773 14.472L5.64887 11.236",
|
|
3686
|
+
opacity: "0.6",
|
|
3687
|
+
stroke: "currentColor",
|
|
3688
|
+
strokeWidth: "1.5"
|
|
3689
|
+
}
|
|
3690
|
+
),
|
|
3691
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3692
|
+
"path",
|
|
3693
|
+
{
|
|
3694
|
+
d: "M15.6085 5.52783L11.8043 6.7639",
|
|
3695
|
+
opacity: "0.2",
|
|
3696
|
+
stroke: "currentColor",
|
|
3697
|
+
strokeWidth: "1.5"
|
|
3698
|
+
}
|
|
3699
|
+
),
|
|
3700
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3701
|
+
"path",
|
|
3702
|
+
{
|
|
3703
|
+
d: "M0.391602 10.472L4.19583 9.23598",
|
|
3704
|
+
opacity: "0.7",
|
|
3705
|
+
stroke: "currentColor",
|
|
3706
|
+
strokeWidth: "1.5"
|
|
3707
|
+
}
|
|
3708
|
+
),
|
|
3709
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3710
|
+
"path",
|
|
3711
|
+
{
|
|
3712
|
+
d: "M15.6085 10.4722L11.8043 9.2361",
|
|
3713
|
+
opacity: "0.3",
|
|
3714
|
+
stroke: "currentColor",
|
|
3715
|
+
strokeWidth: "1.5"
|
|
3716
|
+
}
|
|
3717
|
+
),
|
|
3718
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3719
|
+
"path",
|
|
3720
|
+
{
|
|
3721
|
+
d: "M0.391602 5.52783L4.19583 6.7639",
|
|
3722
|
+
opacity: "0.8",
|
|
3723
|
+
stroke: "currentColor",
|
|
3724
|
+
strokeWidth: "1.5"
|
|
3725
|
+
}
|
|
3726
|
+
)
|
|
3727
|
+
] }),
|
|
3728
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("clipPath", { id: "editor-loader-clip", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("rect", { fill: "white", height: "16", width: "16" }) }) })
|
|
3729
|
+
]
|
|
3730
|
+
}
|
|
3731
|
+
);
|
|
3617
3732
|
Loader = (_a) => {
|
|
3618
3733
|
var _b = _a, {
|
|
3619
3734
|
color,
|
|
3620
|
-
size = 16
|
|
3735
|
+
size = 16,
|
|
3736
|
+
className,
|
|
3737
|
+
style
|
|
3621
3738
|
} = _b, props = __objRest(_b, [
|
|
3622
3739
|
"color",
|
|
3623
|
-
"size"
|
|
3740
|
+
"size",
|
|
3741
|
+
"className",
|
|
3742
|
+
"style"
|
|
3624
3743
|
]);
|
|
3625
3744
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3626
|
-
"
|
|
3627
|
-
__spreadValues({
|
|
3628
|
-
className: getClassName2(),
|
|
3629
|
-
style: {
|
|
3630
|
-
width: size,
|
|
3631
|
-
height: size,
|
|
3632
|
-
color
|
|
3633
|
-
},
|
|
3745
|
+
"div",
|
|
3746
|
+
__spreadProps(__spreadValues({
|
|
3747
|
+
className: [getClassName2(), className].filter(Boolean).join(" "),
|
|
3748
|
+
style: __spreadValues({ color }, style),
|
|
3634
3749
|
"aria-label": "loading"
|
|
3635
|
-
}, props)
|
|
3750
|
+
}, props), {
|
|
3751
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(LoaderIcon, { size })
|
|
3752
|
+
})
|
|
3636
3753
|
);
|
|
3637
3754
|
};
|
|
3638
3755
|
}
|
|
@@ -6956,9 +7073,8 @@ var Button = (_a) => {
|
|
|
6956
7073
|
href
|
|
6957
7074
|
}, dataAttrs), {
|
|
6958
7075
|
children: [
|
|
6959
|
-
icon && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: getClassName10("icon"), children: icon }),
|
|
6960
|
-
children
|
|
6961
|
-
loading && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: getClassName10("spinner"), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Loader, { size: 14 }) })
|
|
7076
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: getClassName10("spinner"), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Loader, { size: 14 }) }) : icon && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: getClassName10("icon"), children: icon }),
|
|
7077
|
+
children
|
|
6962
7078
|
]
|
|
6963
7079
|
})
|
|
6964
7080
|
);
|
|
@@ -12807,6 +12923,9 @@ var createEditorCommands = (appStore) => {
|
|
|
12807
12923
|
ui: { itemSelector: { index: sel.index, zone: sel.zone } }
|
|
12808
12924
|
});
|
|
12809
12925
|
};
|
|
12926
|
+
const publish = () => {
|
|
12927
|
+
void getState().publish();
|
|
12928
|
+
};
|
|
12810
12929
|
return {
|
|
12811
12930
|
insertComponent: insertComponent2,
|
|
12812
12931
|
removeComponent,
|
|
@@ -12816,7 +12935,8 @@ var createEditorCommands = (appStore) => {
|
|
|
12816
12935
|
updateProps,
|
|
12817
12936
|
updateRoot,
|
|
12818
12937
|
selectComponent,
|
|
12819
|
-
scrollToComponent
|
|
12938
|
+
scrollToComponent,
|
|
12939
|
+
publish
|
|
12820
12940
|
};
|
|
12821
12941
|
};
|
|
12822
12942
|
|
|
@@ -12835,6 +12955,8 @@ var generateUseEditor = (store, getState, commands) => {
|
|
|
12835
12955
|
const storeData = __spreadProps(__spreadValues({}, commands), {
|
|
12836
12956
|
appState: makeStatePublic(store.state),
|
|
12837
12957
|
config: store.config,
|
|
12958
|
+
route: store.route,
|
|
12959
|
+
isPublishing: store.isPublishing,
|
|
12838
12960
|
dispatch: store.dispatch,
|
|
12839
12961
|
getPermissions: store.permissions.getPermissions,
|
|
12840
12962
|
refreshPermissions: store.permissions.refreshPermissions,
|
|
@@ -12869,7 +12991,9 @@ var convertToPickedStore = (store) => {
|
|
|
12869
12991
|
dispatch: store.dispatch,
|
|
12870
12992
|
permissions: store.permissions,
|
|
12871
12993
|
history: store.history,
|
|
12872
|
-
selectedItem: store.selectedItem
|
|
12994
|
+
selectedItem: store.selectedItem,
|
|
12995
|
+
route: store.route,
|
|
12996
|
+
isPublishing: store.isPublishing
|
|
12873
12997
|
};
|
|
12874
12998
|
};
|
|
12875
12999
|
var useRegisterUseEditorStore = (appStore) => {
|
|
@@ -13311,18 +13435,19 @@ var DEVICE_VIEWPORTS = {
|
|
|
13311
13435
|
mobile: { width: 360, height: "auto", icon: "Smartphone", label: "Mobile" }
|
|
13312
13436
|
};
|
|
13313
13437
|
var UrlBar = () => {
|
|
13314
|
-
const { routes,
|
|
13438
|
+
const { routes, route, onRouteChange } = usePropsContext();
|
|
13315
13439
|
const chrome = useChromeConfig();
|
|
13316
|
-
const
|
|
13317
|
-
const
|
|
13318
|
-
const
|
|
13319
|
-
|
|
13320
|
-
|
|
13321
|
-
|
|
13440
|
+
const currentKey = route == null ? void 0 : route.key;
|
|
13441
|
+
const showRoutePicker = !!routes && currentKey !== void 0 && !!onRouteChange;
|
|
13442
|
+
const [inputValue, setInputValue] = (0, import_react87.useState)(currentKey != null ? currentKey : "");
|
|
13443
|
+
const lastSyncedPath = (0, import_react87.useRef)(currentKey);
|
|
13444
|
+
if (lastSyncedPath.current !== currentKey) {
|
|
13445
|
+
lastSyncedPath.current = currentKey;
|
|
13446
|
+
setInputValue(currentKey != null ? currentKey : "");
|
|
13322
13447
|
}
|
|
13323
13448
|
const submit = (raw) => {
|
|
13324
13449
|
const next = normalizeRoute(raw);
|
|
13325
|
-
if (!next || next ===
|
|
13450
|
+
if (!next || next === currentKey) return;
|
|
13326
13451
|
void (onRouteChange == null ? void 0 : onRouteChange(next));
|
|
13327
13452
|
};
|
|
13328
13453
|
if (!chrome.showUrlBar) return null;
|
|
@@ -13331,7 +13456,7 @@ var UrlBar = () => {
|
|
|
13331
13456
|
Combobox,
|
|
13332
13457
|
{
|
|
13333
13458
|
items: routes,
|
|
13334
|
-
value:
|
|
13459
|
+
value: currentKey,
|
|
13335
13460
|
onValueChange: (next) => {
|
|
13336
13461
|
if (typeof next === "string") submit(next);
|
|
13337
13462
|
},
|
|
@@ -14165,12 +14290,12 @@ var TopHeader = ({
|
|
|
14165
14290
|
pluginItems
|
|
14166
14291
|
}) => {
|
|
14167
14292
|
const appStore = useAppStoreApi();
|
|
14168
|
-
const { onPublish, currentRoute } = usePropsContext();
|
|
14169
14293
|
const chrome = useChromeConfig();
|
|
14170
14294
|
const back = useAppStore((s) => s.history.back);
|
|
14171
14295
|
const forward = useAppStore((s) => s.history.forward);
|
|
14172
14296
|
const hasFuture = useAppStore((s) => s.history.hasFuture());
|
|
14173
14297
|
const hasPast = useAppStore((s) => s.history.hasPast());
|
|
14298
|
+
const isPublishing = useAppStore((s) => s.isPublishing);
|
|
14174
14299
|
const CustomHeaderActions = useAppStore(
|
|
14175
14300
|
(s) => s.overrides.headerActions || DefaultOverride
|
|
14176
14301
|
);
|
|
@@ -14222,11 +14347,8 @@ var TopHeader = ({
|
|
|
14222
14347
|
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(CustomHeaderActions, { children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
14223
14348
|
Button,
|
|
14224
14349
|
{
|
|
14225
|
-
onClick: () =>
|
|
14226
|
-
|
|
14227
|
-
onPublish && onPublish(data, currentRoute);
|
|
14228
|
-
},
|
|
14229
|
-
children: "Publish"
|
|
14350
|
+
onClick: () => appStore.getState().publish(),
|
|
14351
|
+
children: isPublishing ? "Publishing\u2026" : "Publish"
|
|
14230
14352
|
}
|
|
14231
14353
|
) })
|
|
14232
14354
|
] })
|
|
@@ -14648,6 +14770,7 @@ function EditorProvider({ children }) {
|
|
|
14648
14770
|
data: initialData,
|
|
14649
14771
|
ui: initialUi,
|
|
14650
14772
|
onChange,
|
|
14773
|
+
onPublish,
|
|
14651
14774
|
permissions = {},
|
|
14652
14775
|
plugins,
|
|
14653
14776
|
overrides,
|
|
@@ -14658,7 +14781,8 @@ function EditorProvider({ children }) {
|
|
|
14658
14781
|
onAction,
|
|
14659
14782
|
fieldTransforms,
|
|
14660
14783
|
fullScreenCanvas,
|
|
14661
|
-
_experimentalVirtualization
|
|
14784
|
+
_experimentalVirtualization,
|
|
14785
|
+
route
|
|
14662
14786
|
} = usePropsContext();
|
|
14663
14787
|
const iframe = (0, import_react95.useMemo)(
|
|
14664
14788
|
() => __spreadValues({
|
|
@@ -14768,7 +14892,9 @@ function EditorProvider({ children }) {
|
|
|
14768
14892
|
_experimentalVirtualization: !!_experimentalVirtualization,
|
|
14769
14893
|
onAction,
|
|
14770
14894
|
metadata,
|
|
14771
|
-
fieldTransforms: loadedFieldTransforms
|
|
14895
|
+
fieldTransforms: loadedFieldTransforms,
|
|
14896
|
+
route: route != null ? route : null,
|
|
14897
|
+
onPublish
|
|
14772
14898
|
};
|
|
14773
14899
|
},
|
|
14774
14900
|
[
|
|
@@ -14783,7 +14909,9 @@ function EditorProvider({ children }) {
|
|
|
14783
14909
|
_experimentalVirtualization,
|
|
14784
14910
|
onAction,
|
|
14785
14911
|
metadata,
|
|
14786
|
-
loadedFieldTransforms
|
|
14912
|
+
loadedFieldTransforms,
|
|
14913
|
+
route,
|
|
14914
|
+
onPublish
|
|
14787
14915
|
]
|
|
14788
14916
|
);
|
|
14789
14917
|
const [appStore] = (0, import_react95.useState)(
|
|
@@ -14876,34 +15004,31 @@ var useApp = () => {
|
|
|
14876
15004
|
const rrNavigate = (0, import_react_router.useNavigate)();
|
|
14877
15005
|
const currentPath = location.pathname || "/";
|
|
14878
15006
|
const isEditing = cfg.editorPath !== null && (currentPath === cfg.editorPath || currentPath.startsWith(`${cfg.editorPath}/`));
|
|
14879
|
-
const
|
|
14880
|
-
const
|
|
15007
|
+
const pagePath = isEditing ? stripPrefix(currentPath, cfg.editorPath) : currentPath;
|
|
15008
|
+
const route = (0, import_react97.useMemo)(() => {
|
|
14881
15009
|
const routeKeys = Object.keys(cfg.pages);
|
|
14882
15010
|
if (routeKeys.length === 0) return null;
|
|
14883
15011
|
const matches = (0, import_react_router.matchRoutes)(
|
|
14884
15012
|
routeKeys.map((path) => ({ path })),
|
|
14885
|
-
|
|
15013
|
+
pagePath
|
|
14886
15014
|
);
|
|
14887
15015
|
if (!matches || matches.length === 0) return null;
|
|
14888
15016
|
const last = matches[matches.length - 1];
|
|
14889
|
-
const key = last.route.path;
|
|
14890
15017
|
return {
|
|
14891
|
-
|
|
14892
|
-
|
|
14893
|
-
|
|
15018
|
+
key: last.route.path,
|
|
15019
|
+
path: pagePath,
|
|
15020
|
+
params: last.params
|
|
14894
15021
|
};
|
|
14895
|
-
}, [cfg.pages,
|
|
15022
|
+
}, [cfg.pages, pagePath]);
|
|
14896
15023
|
const routes = (0, import_react97.useMemo)(() => Object.keys(cfg.pages), [cfg.pages]);
|
|
14897
|
-
const navigate = (
|
|
14898
|
-
const
|
|
14899
|
-
rrNavigate(
|
|
15024
|
+
const navigate = (target) => {
|
|
15025
|
+
const next = isEditing && cfg.editorPath ? `${cfg.editorPath}${target === "/" ? "" : target}` || "/" : target;
|
|
15026
|
+
rrNavigate(next || "/");
|
|
14900
15027
|
};
|
|
14901
15028
|
return __spreadProps(__spreadValues({}, cfg), {
|
|
14902
15029
|
routes,
|
|
14903
|
-
currentPath,
|
|
14904
15030
|
isEditing,
|
|
14905
|
-
|
|
14906
|
-
matched,
|
|
15031
|
+
route,
|
|
14907
15032
|
navigate
|
|
14908
15033
|
});
|
|
14909
15034
|
};
|
|
@@ -14987,9 +15112,14 @@ function EditorForKey({
|
|
|
14987
15112
|
editorProps,
|
|
14988
15113
|
children
|
|
14989
15114
|
}) {
|
|
14990
|
-
const { config, pages, routes, navigate } = useApp();
|
|
15115
|
+
const { config, pages, routes, navigate, route } = useApp();
|
|
14991
15116
|
const data = pages[routeKey];
|
|
14992
15117
|
if (!data) return null;
|
|
15118
|
+
const editorRoute = {
|
|
15119
|
+
key: routeKey,
|
|
15120
|
+
path: (route == null ? void 0 : route.key) === routeKey ? route.path : routeKey,
|
|
15121
|
+
params: (route == null ? void 0 : route.key) === routeKey ? route.params : {}
|
|
15122
|
+
};
|
|
14993
15123
|
return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
14994
15124
|
Editor4,
|
|
14995
15125
|
{
|
|
@@ -15016,7 +15146,7 @@ function EditorForKey({
|
|
|
15016
15146
|
disableZoomControls: editorProps.disableZoomControls,
|
|
15017
15147
|
_experimentalVirtualization: editorProps._experimentalVirtualization,
|
|
15018
15148
|
routes,
|
|
15019
|
-
|
|
15149
|
+
route: editorRoute,
|
|
15020
15150
|
onRouteChange: (next) => navigate(next),
|
|
15021
15151
|
children
|
|
15022
15152
|
},
|
package/dist/index.mjs
CHANGED
|
@@ -25,8 +25,8 @@ import {
|
|
|
25
25
|
usePropsContext,
|
|
26
26
|
useRouteParams,
|
|
27
27
|
useStableValue
|
|
28
|
-
} from "./chunk-
|
|
29
|
-
import "./chunk-
|
|
28
|
+
} from "./chunk-HWYAMQID.mjs";
|
|
29
|
+
import "./chunk-BORTMJJZ.mjs";
|
|
30
30
|
import {
|
|
31
31
|
Action,
|
|
32
32
|
ActionBar,
|
|
@@ -35,8 +35,8 @@ import {
|
|
|
35
35
|
Label,
|
|
36
36
|
RichTextMenu,
|
|
37
37
|
Separator
|
|
38
|
-
} from "./chunk-
|
|
39
|
-
import "./chunk-
|
|
38
|
+
} from "./chunk-MVJENRGK.mjs";
|
|
39
|
+
import "./chunk-M36T7BWB.mjs";
|
|
40
40
|
import {
|
|
41
41
|
getRouteProps,
|
|
42
42
|
migrate,
|
|
@@ -45,9 +45,9 @@ import {
|
|
|
45
45
|
transformProps
|
|
46
46
|
} from "./chunk-AD67LVXW.mjs";
|
|
47
47
|
import "./chunk-6QJ2HF4O.mjs";
|
|
48
|
-
import "./chunk-
|
|
49
|
-
import "./chunk-
|
|
50
|
-
import "./chunk-
|
|
48
|
+
import "./chunk-PGSQPCM6.mjs";
|
|
49
|
+
import "./chunk-DKFLK64M.mjs";
|
|
50
|
+
import "./chunk-MUBFR675.mjs";
|
|
51
51
|
import "./chunk-M4JDRFYB.mjs";
|
|
52
52
|
import "./chunk-FTVOCMGV.mjs";
|
|
53
53
|
import "./chunk-DQU3HIP4.mjs";
|
package/dist/internal.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Reducer } from 'react';
|
|
2
2
|
import { D as Data, A as AppState, O as OnAction, P as PrivateAppState, E as EditorAction } from './actions-BxLinRKD.mjs';
|
|
3
|
-
import { A as AppStore } from './index-
|
|
3
|
+
import { A as AppStore } from './index-DET4zR84.mjs';
|
|
4
4
|
import '@tiptap/react';
|
|
5
5
|
import '@tiptap/extension-blockquote';
|
|
6
6
|
import '@tiptap/extension-bold';
|
package/dist/internal.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Reducer } from 'react';
|
|
2
2
|
import { D as Data, A as AppState, O as OnAction, P as PrivateAppState, E as EditorAction } from './actions-BxLinRKD.js';
|
|
3
|
-
import { A as AppStore } from './index-
|
|
3
|
+
import { A as AppStore } from './index-YRgZBGas.js';
|
|
4
4
|
import '@tiptap/react';
|
|
5
5
|
import '@tiptap/extension-blockquote';
|
|
6
6
|
import '@tiptap/extension-bold';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useHeadingOptions
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DKFLK64M.mjs";
|
|
4
4
|
import {
|
|
5
5
|
Heading,
|
|
6
6
|
SelectControl,
|
|
7
7
|
useControlContext
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-MUBFR675.mjs";
|
|
9
9
|
import "./chunk-M4JDRFYB.mjs";
|
|
10
10
|
import "./chunk-FTVOCMGV.mjs";
|
|
11
11
|
import "./chunk-DQU3HIP4.mjs";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useListOptions
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-M36T7BWB.mjs";
|
|
4
4
|
import {
|
|
5
5
|
List,
|
|
6
6
|
SelectControl,
|
|
7
7
|
useControlContext
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-MUBFR675.mjs";
|
|
9
9
|
import "./chunk-M4JDRFYB.mjs";
|
|
10
10
|
import "./chunk-FTVOCMGV.mjs";
|
|
11
11
|
import "./chunk-DQU3HIP4.mjs";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useAlignOptions
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-PGSQPCM6.mjs";
|
|
4
4
|
import {
|
|
5
5
|
AlignLeft,
|
|
6
6
|
SelectControl,
|
|
7
7
|
useControlContext
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-MUBFR675.mjs";
|
|
9
9
|
import "./chunk-M4JDRFYB.mjs";
|
|
10
10
|
import "./chunk-FTVOCMGV.mjs";
|
|
11
11
|
import "./chunk-DQU3HIP4.mjs";
|
package/dist/no-external.css
CHANGED
|
@@ -704,25 +704,19 @@ textarea._Input-input_zwh6e_27 {
|
|
|
704
704
|
}
|
|
705
705
|
|
|
706
706
|
/* css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Loader/styles.module.css/#css-module-data */
|
|
707
|
-
@keyframes _loader-
|
|
708
|
-
|
|
709
|
-
transform: rotate(0deg)
|
|
707
|
+
@keyframes _loader-spin_6933g_1 {
|
|
708
|
+
from {
|
|
709
|
+
transform: rotate(0deg);
|
|
710
710
|
}
|
|
711
|
-
|
|
712
|
-
transform: rotate(
|
|
713
|
-
}
|
|
714
|
-
100% {
|
|
715
|
-
transform: rotate(360deg) scale(1);
|
|
711
|
+
to {
|
|
712
|
+
transform: rotate(360deg);
|
|
716
713
|
}
|
|
717
714
|
}
|
|
718
|
-
.
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
display: inline-block;
|
|
724
|
-
animation: _loader-animation_nacdm_1 1s 0s infinite linear;
|
|
725
|
-
animation-fill-mode: both;
|
|
715
|
+
._Loader_6933g_10 {
|
|
716
|
+
display: inline-flex;
|
|
717
|
+
align-items: center;
|
|
718
|
+
justify-content: center;
|
|
719
|
+
animation: _loader-spin_6933g_1 1s linear infinite;
|
|
726
720
|
}
|
|
727
721
|
|
|
728
722
|
/* css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/DragIcon/styles.module.css/#css-module-data */
|
package/dist/no-external.d.mts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { u as Adaptor, A as AppState, v as ArrayField, w as ArrayState, x as AsFieldProps, B as BaseData, y as BaseField, z as CacheOpts, G as ColorField, g as ComponentConfig, J as ComponentConfigExtensions, K as ComponentConfigParams, b as ComponentData, L as ComponentDataMap, N as ComponentDataOptionalId, Q as ComponentMetadata, C as Config, S as ConfigParams, j as Content, T as CustomField, X as CustomFieldRender, D as Data, l as DefaultComponentProps, k as DefaultComponents, m as DefaultRootFieldProps, Y as DefaultRootProps, Z as DefaultRootRenderProps, _ as Direction, $ as DragAxis, E as EditorAction, q as EditorChromeConfig, a0 as EditorComponent, a1 as EditorContext, a2 as EditorMetadata, a3 as ExternalField, a4 as ExternalFieldWithAdaptor, a5 as ExtractConfigParams, a6 as ExtractField, o as Field, a7 as FieldMetadata, p as FieldProps, a8 as FieldRenderFunctions, a9 as FieldTransformFn, aa as FieldTransformFnParams, h as FieldTransforms, F as Fields, H as History, I as IframeConfig, r as InitialHistory, ab as ItemWithId, ac as MappedItem, M as Metadata, ad as NumberField, ae as ObjectField, O as OnAction, af as OverrideKey, e as Overrides, a as Permissions, d as Plugin, ag as RadioField, c as ResolveDataTrigger, ah as RichText, i as RichtextField, ai as RootConfig, n as RootData, R as RootDataWithProps, aj as RootDataWithoutProps, ak as SelectField, al as Slot, am as SlotComponent, an as SlotField, ao as TextField, ap as TextareaField, f as UiState, U as UserGenerics, aq as Viewport, V as Viewports, ar as WithChildren, as as WithEditorProps, W as WithId, at as WithSlotProps, au as overrideKeys } from './actions-BxLinRKD.mjs';
|
|
2
|
-
export { Action, ActionBar, App, AppContextValue, AppEditorProps,
|
|
2
|
+
export { Action, ActionBar, App, AppContextValue, AppEditorProps, AppProps, AppProvider, AppProviderProps, AppRenderProps, AppRoute, AppRouterVariant, AutoField, Button, ComponentList, Drawer, Editor, EditorApi, EditorCommands, FieldLabel, GlobalsMap, Group, IconButton, InsertComponentArgs, Label, MoveDestination, PageMetadata, Parent, Render, RichTextMenu, Route, RouteKey, Separator, UseEditorData, appConfigContext, blocksPlugin, createUseEditor, fieldsPlugin, legacySideBarPlugin, outlinePlugin, pageMetadata, registerOverlayPortal, renderContext, setDeep, useApp, useEditor, useGetEditor, usePropsContext, useRouteParams, useStableValue } from './index.mjs';
|
|
3
3
|
export { G as GetRoutePropsOptions, g as getRouteProps, m as migrate, r as resolveAllData, a as resolveRouteFromString, t as transformProps, w as walkTree } from './walk-tree-BvYigWFL.mjs';
|
|
4
|
+
export { E as EditorRoute, O as OnPublish } from './index-DET4zR84.mjs';
|
|
4
5
|
import 'react';
|
|
5
6
|
import '@tiptap/react';
|
|
6
7
|
import '@tiptap/extension-blockquote';
|
|
@@ -18,4 +19,3 @@ import '@tiptap/extension-strike';
|
|
|
18
19
|
import '@tiptap/extension-text-align';
|
|
19
20
|
import '@tiptap/extension-underline';
|
|
20
21
|
import 'react/jsx-runtime';
|
|
21
|
-
import './index-BZRpxcwy.mjs';
|
package/dist/no-external.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { u as Adaptor, A as AppState, v as ArrayField, w as ArrayState, x as AsFieldProps, B as BaseData, y as BaseField, z as CacheOpts, G as ColorField, g as ComponentConfig, J as ComponentConfigExtensions, K as ComponentConfigParams, b as ComponentData, L as ComponentDataMap, N as ComponentDataOptionalId, Q as ComponentMetadata, C as Config, S as ConfigParams, j as Content, T as CustomField, X as CustomFieldRender, D as Data, l as DefaultComponentProps, k as DefaultComponents, m as DefaultRootFieldProps, Y as DefaultRootProps, Z as DefaultRootRenderProps, _ as Direction, $ as DragAxis, E as EditorAction, q as EditorChromeConfig, a0 as EditorComponent, a1 as EditorContext, a2 as EditorMetadata, a3 as ExternalField, a4 as ExternalFieldWithAdaptor, a5 as ExtractConfigParams, a6 as ExtractField, o as Field, a7 as FieldMetadata, p as FieldProps, a8 as FieldRenderFunctions, a9 as FieldTransformFn, aa as FieldTransformFnParams, h as FieldTransforms, F as Fields, H as History, I as IframeConfig, r as InitialHistory, ab as ItemWithId, ac as MappedItem, M as Metadata, ad as NumberField, ae as ObjectField, O as OnAction, af as OverrideKey, e as Overrides, a as Permissions, d as Plugin, ag as RadioField, c as ResolveDataTrigger, ah as RichText, i as RichtextField, ai as RootConfig, n as RootData, R as RootDataWithProps, aj as RootDataWithoutProps, ak as SelectField, al as Slot, am as SlotComponent, an as SlotField, ao as TextField, ap as TextareaField, f as UiState, U as UserGenerics, aq as Viewport, V as Viewports, ar as WithChildren, as as WithEditorProps, W as WithId, at as WithSlotProps, au as overrideKeys } from './actions-BxLinRKD.js';
|
|
2
|
-
export { Action, ActionBar, App, AppContextValue, AppEditorProps,
|
|
2
|
+
export { Action, ActionBar, App, AppContextValue, AppEditorProps, AppProps, AppProvider, AppProviderProps, AppRenderProps, AppRoute, AppRouterVariant, AutoField, Button, ComponentList, Drawer, Editor, EditorApi, EditorCommands, FieldLabel, GlobalsMap, Group, IconButton, InsertComponentArgs, Label, MoveDestination, PageMetadata, Parent, Render, RichTextMenu, Route, RouteKey, Separator, UseEditorData, appConfigContext, blocksPlugin, createUseEditor, fieldsPlugin, legacySideBarPlugin, outlinePlugin, pageMetadata, registerOverlayPortal, renderContext, setDeep, useApp, useEditor, useGetEditor, usePropsContext, useRouteParams, useStableValue } from './index.js';
|
|
3
3
|
export { G as GetRoutePropsOptions, g as getRouteProps, m as migrate, r as resolveAllData, a as resolveRouteFromString, t as transformProps, w as walkTree } from './walk-tree-Clklc1Ql.js';
|
|
4
|
+
export { E as EditorRoute, O as OnPublish } from './index-YRgZBGas.js';
|
|
4
5
|
import 'react';
|
|
5
6
|
import '@tiptap/react';
|
|
6
7
|
import '@tiptap/extension-blockquote';
|
|
@@ -18,4 +19,3 @@ import '@tiptap/extension-strike';
|
|
|
18
19
|
import '@tiptap/extension-text-align';
|
|
19
20
|
import '@tiptap/extension-underline';
|
|
20
21
|
import 'react/jsx-runtime';
|
|
21
|
-
import './index-B_21fGrq.js';
|