@reacteditor/core 0.0.5 → 0.0.7
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-4LPVLYSU.css +415 -0
- package/dist/{Editor-POJT3RA2.mjs → Editor-OSAG52QF.mjs} +10 -10
- package/dist/{Render-JNABKPAF.mjs → Render-STFB5CNO.mjs} +1 -1
- package/dist/Render-ZTUTUUAH.css +103 -0
- package/dist/{actions-CQmL3wwa.d.mts → actions-BDMhAtxP.d.mts} +2 -1
- package/dist/{actions-CQmL3wwa.d.ts → actions-BDMhAtxP.d.ts} +2 -1
- package/dist/{chunk-KC727YFW.mjs → chunk-6QJ2HF4O.mjs} +1 -1
- package/dist/{chunk-IUOWXGYR.mjs → chunk-AAK2555H.mjs} +4 -4
- package/dist/{chunk-DCL4UC2H.mjs → chunk-EEQGJ6FH.mjs} +1 -1
- package/dist/{chunk-VOLQMQPK.mjs → chunk-IIRJMJFU.mjs} +1 -1
- package/dist/{chunk-43G2QHSV.mjs → chunk-JUC25FB7.mjs} +10 -10
- package/dist/{chunk-UB2DES2O.mjs → chunk-M4JDRFYB.mjs} +8 -6
- package/dist/{chunk-X7IRHSQN.mjs → chunk-RNRHREWH.mjs} +4 -4
- package/dist/{chunk-YFRH22NT.mjs → chunk-TI3KC54Y.mjs} +20 -20
- package/dist/{chunk-QB3US7UE.mjs → chunk-W5I2Z7QS.mjs} +580 -195
- package/dist/{chunk-5N6RK26Z.mjs → chunk-XI7YTBCP.mjs} +1 -1
- package/dist/{chunk-JEDWXGVP.mjs → chunk-ZLSPSBV3.mjs} +1 -1
- package/dist/full-7ABPY2WA.css +311 -0
- package/dist/{full-HZMEMWCN.mjs → full-IHV5BO2L.mjs} +8 -8
- package/dist/{index-BOP2qNVA.d.mts → index-BwLKseT7.d.mts} +1 -1
- package/dist/{index-_G46lHpL.d.ts → index-DkYXZRPz.d.ts} +1 -1
- package/dist/index.css +1268 -1165
- package/dist/index.d.mts +35 -8
- package/dist/index.d.ts +35 -8
- package/dist/index.js +640 -246
- package/dist/index.mjs +15 -15
- package/dist/internal.d.mts +2 -2
- package/dist/internal.d.ts +2 -2
- package/dist/internal.js +7 -5
- package/dist/internal.mjs +2 -2
- package/dist/{loaded-35JQLXSA.mjs → loaded-3NPQWYKN.mjs} +5 -5
- package/dist/{loaded-QJMKRN35.mjs → loaded-FTSXIONQ.mjs} +5 -5
- package/dist/loaded-N4KWL7FV.css +90 -0
- package/dist/{loaded-U6ZILQXM.mjs → loaded-YTQOQIUU.mjs} +5 -5
- package/dist/no-external.css +1268 -1165
- package/dist/no-external.d.mts +4 -4
- package/dist/no-external.d.ts +4 -4
- package/dist/no-external.js +640 -246
- package/dist/no-external.mjs +15 -15
- package/dist/rsc.css +40 -40
- package/dist/rsc.d.mts +2 -2
- package/dist/rsc.d.ts +2 -2
- package/dist/rsc.js +1 -1
- package/dist/rsc.mjs +4 -4
- package/dist/{walk-tree-DxSkPLnl.d.ts → walk-tree-BweEZ37Y.d.ts} +1 -1
- package/dist/{walk-tree-Dwv3c_9M.d.mts → walk-tree-LcQXXDqe.d.mts} +1 -1
- package/package.json +2 -1
- package/dist/Editor-WYZZDKT3.css +0 -415
- package/dist/Render-WBTAN6PO.css +0 -103
- package/dist/full-5442HPZH.css +0 -311
- package/dist/loaded-KZZU4RNL.css +0 -90
- package/dist/{chunk-GAUBBDIR.mjs → chunk-JIXMPJZA.mjs} +37 -37
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
EditorInner,
|
|
3
3
|
LoadedRichTextMenu
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-RNRHREWH.mjs";
|
|
5
5
|
import {
|
|
6
6
|
RichTextRenderFallback,
|
|
7
7
|
SlotRender,
|
|
@@ -10,13 +10,13 @@ import {
|
|
|
10
10
|
getSlotTransform,
|
|
11
11
|
useRichtextProps,
|
|
12
12
|
useSlots
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-TI3KC54Y.mjs";
|
|
14
14
|
import {
|
|
15
15
|
ActionBar,
|
|
16
16
|
IconButton,
|
|
17
17
|
LoadedRichTextMenuInner,
|
|
18
18
|
Loader
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-JUC25FB7.mjs";
|
|
20
20
|
import {
|
|
21
21
|
Check,
|
|
22
22
|
ChevronDown,
|
|
@@ -60,18 +60,18 @@ import {
|
|
|
60
60
|
useRegisterFieldsSlice,
|
|
61
61
|
useRegisterHistorySlice,
|
|
62
62
|
useRegisterPermissionsSlice
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-AAK2555H.mjs";
|
|
64
64
|
import {
|
|
65
65
|
getItem,
|
|
66
66
|
insert,
|
|
67
67
|
insertAction,
|
|
68
68
|
makeStatePublic,
|
|
69
69
|
populateIds
|
|
70
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-M4JDRFYB.mjs";
|
|
71
71
|
import {
|
|
72
72
|
defaultAppState,
|
|
73
73
|
defaultViewports
|
|
74
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-IIRJMJFU.mjs";
|
|
75
75
|
import {
|
|
76
76
|
get_class_name_factory_default
|
|
77
77
|
} from "./chunk-Y2EFNT5P.mjs";
|
|
@@ -87,7 +87,7 @@ import {
|
|
|
87
87
|
toComponent,
|
|
88
88
|
walkAppState,
|
|
89
89
|
walkField
|
|
90
|
-
} from "./chunk-
|
|
90
|
+
} from "./chunk-JIXMPJZA.mjs";
|
|
91
91
|
import {
|
|
92
92
|
__async,
|
|
93
93
|
__objRest,
|
|
@@ -151,7 +151,7 @@ import { useEffect, useState } from "react";
|
|
|
151
151
|
|
|
152
152
|
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Button/Button.module.css#css-module
|
|
153
153
|
init_react_import();
|
|
154
|
-
var Button_module_default = { "Button": "
|
|
154
|
+
var Button_module_default = { "Button": "_Button_rj9nn_1", "Button--medium": "_Button--medium_rj9nn_31", "Button--large": "_Button--large_rj9nn_39", "Button-icon": "_Button-icon_rj9nn_46", "Button--primary": "_Button--primary_rj9nn_50", "Button--secondary": "_Button--secondary_rj9nn_71", "Button--flush": "_Button--flush_rj9nn_88", "Button--disabled": "_Button--disabled_rj9nn_92", "Button--fullWidth": "_Button--fullWidth_rj9nn_100", "Button-spinner": "_Button-spinner_rj9nn_105" };
|
|
155
155
|
|
|
156
156
|
// lib/filter-data-attrs.ts
|
|
157
157
|
init_react_import();
|
|
@@ -240,7 +240,7 @@ init_react_import();
|
|
|
240
240
|
|
|
241
241
|
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/AutoField/styles.module.css#css-module
|
|
242
242
|
init_react_import();
|
|
243
|
-
var styles_module_default = { "InputWrapper": "
|
|
243
|
+
var styles_module_default = { "InputWrapper": "_InputWrapper_1hd99_1", "Input-label": "_Input-label_1hd99_5", "Input-labelIcon": "_Input-labelIcon_1hd99_15", "Input-disabledIcon": "_Input-disabledIcon_1hd99_22", "Input-input": "_Input-input_1hd99_27", "Input": "_Input_1hd99_1", "Input--readOnly": "_Input--readOnly_1hd99_87", "Input-radioGroupItems": "_Input-radioGroupItems_1hd99_98", "Input-radio": "_Input-radio_1hd99_98", "Input-radioInner": "_Input-radioInner_1hd99_115", "Input-radioInput": "_Input-radioInput_1hd99_147" };
|
|
244
244
|
|
|
245
245
|
// components/AutoField/FieldLabel.tsx
|
|
246
246
|
import { useMemo } from "react";
|
|
@@ -308,7 +308,7 @@ init_react_import();
|
|
|
308
308
|
|
|
309
309
|
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/AutoField/fields/ArrayField/styles.module.css#css-module
|
|
310
310
|
init_react_import();
|
|
311
|
-
var styles_module_default2 = { "ArrayField": "
|
|
311
|
+
var styles_module_default2 = { "ArrayField": "_ArrayField_1tth0_5", "ArrayField--isDraggingFrom": "_ArrayField--isDraggingFrom_1tth0_14", "ArrayField-addButton": "_ArrayField-addButton_1tth0_19", "ArrayField--hasItems": "_ArrayField--hasItems_1tth0_35", "ArrayField-inner": "_ArrayField-inner_1tth0_61", "ArrayFieldItem": "_ArrayFieldItem_1tth0_69", "ArrayFieldItem--isDragging": "_ArrayFieldItem--isDragging_1tth0_78", "ArrayFieldItem--isExpanded": "_ArrayFieldItem--isExpanded_1tth0_82", "ArrayFieldItem-summary": "_ArrayFieldItem-summary_1tth0_97", "ArrayFieldItem--noFields": "_ArrayFieldItem--noFields_1tth0_118", "ArrayFieldItem-body": "_ArrayFieldItem-body_1tth0_147", "ArrayFieldItem-fieldset": "_ArrayFieldItem-fieldset_1tth0_156", "ArrayFieldItem-rhs": "_ArrayFieldItem-rhs_1tth0_164", "ArrayFieldItem-actions": "_ArrayFieldItem-actions_1tth0_170" };
|
|
312
312
|
|
|
313
313
|
// components/AutoField/store.ts
|
|
314
314
|
init_react_import();
|
|
@@ -376,7 +376,7 @@ init_react_import();
|
|
|
376
376
|
|
|
377
377
|
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/DragIcon/styles.module.css#css-module
|
|
378
378
|
init_react_import();
|
|
379
|
-
var styles_module_default3 = { "DragIcon": "
|
|
379
|
+
var styles_module_default3 = { "DragIcon": "_DragIcon_eapcz_1", "DragIcon--disabled": "_DragIcon--disabled_eapcz_8" };
|
|
380
380
|
|
|
381
381
|
// components/DragIcon/index.tsx
|
|
382
382
|
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
@@ -1388,7 +1388,7 @@ import {
|
|
|
1388
1388
|
|
|
1389
1389
|
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/ExternalInput/styles.module.css#css-module
|
|
1390
1390
|
init_react_import();
|
|
1391
|
-
var styles_module_default4 = { "ExternalInput-actions": "_ExternalInput-
|
|
1391
|
+
var styles_module_default4 = { "ExternalInput-actions": "_ExternalInput-actions_142hz_1", "ExternalInput-button": "_ExternalInput-button_142hz_5", "ExternalInput--dataSelected": "_ExternalInput--dataSelected_142hz_25", "ExternalInput--readOnly": "_ExternalInput--readOnly_142hz_32", "ExternalInput-detachButton": "_ExternalInput-detachButton_142hz_36", "ExternalInput": "_ExternalInput_142hz_1", "ExternalInputModal": "_ExternalInputModal_142hz_82", "ExternalInputModal-grid": "_ExternalInputModal-grid_142hz_92", "ExternalInputModal--filtersToggled": "_ExternalInputModal--filtersToggled_142hz_103", "ExternalInputModal-filters": "_ExternalInputModal-filters_142hz_108", "ExternalInputModal-masthead": "_ExternalInputModal-masthead_142hz_127", "ExternalInputModal-tableWrapper": "_ExternalInputModal-tableWrapper_142hz_136", "ExternalInputModal-table": "_ExternalInputModal-table_142hz_136", "ExternalInputModal-thead": "_ExternalInputModal-thead_142hz_152", "ExternalInputModal-th": "_ExternalInputModal-th_142hz_152", "ExternalInputModal-td": "_ExternalInputModal-td_142hz_167", "ExternalInputModal-tr": "_ExternalInputModal-tr_142hz_172", "ExternalInputModal-tbody": "_ExternalInputModal-tbody_142hz_179", "ExternalInputModal--hasData": "_ExternalInputModal--hasData_142hz_205", "ExternalInputModal-loadingBanner": "_ExternalInputModal-loadingBanner_142hz_209", "ExternalInputModal--isLoading": "_ExternalInputModal--isLoading_142hz_226", "ExternalInputModal-searchForm": "_ExternalInputModal-searchForm_142hz_230", "ExternalInputModal-search": "_ExternalInputModal-search_142hz_230", "ExternalInputModal-searchIcon": "_ExternalInputModal-searchIcon_142hz_267", "ExternalInputModal-searchIconText": "_ExternalInputModal-searchIconText_142hz_292", "ExternalInputModal-searchInput": "_ExternalInputModal-searchInput_142hz_302", "ExternalInputModal-searchActions": "_ExternalInputModal-searchActions_142hz_316", "ExternalInputModal-searchActionIcon": "_ExternalInputModal-searchActionIcon_142hz_329", "ExternalInputModal-footerContainer": "_ExternalInputModal-footerContainer_142hz_333", "ExternalInputModal-footer": "_ExternalInputModal-footer_142hz_333", "ExternalInputModal-field": "_ExternalInputModal-field_142hz_346" };
|
|
1392
1392
|
|
|
1393
1393
|
// components/Modal/index.tsx
|
|
1394
1394
|
init_react_import();
|
|
@@ -1396,7 +1396,7 @@ import { useEffect as useEffect4, useState as useState6 } from "react";
|
|
|
1396
1396
|
|
|
1397
1397
|
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Modal/styles.module.css#css-module
|
|
1398
1398
|
init_react_import();
|
|
1399
|
-
var styles_module_default5 = { "Modal": "
|
|
1399
|
+
var styles_module_default5 = { "Modal": "_Modal_vim19_1", "Modal--isOpen": "_Modal--isOpen_vim19_15", "Modal-inner": "_Modal-inner_vim19_19" };
|
|
1400
1400
|
|
|
1401
1401
|
// components/Modal/index.tsx
|
|
1402
1402
|
import { createPortal } from "react-dom";
|
|
@@ -1432,7 +1432,7 @@ init_react_import();
|
|
|
1432
1432
|
|
|
1433
1433
|
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Heading/styles.module.css#css-module
|
|
1434
1434
|
init_react_import();
|
|
1435
|
-
var styles_module_default6 = { "Heading": "
|
|
1435
|
+
var styles_module_default6 = { "Heading": "_Heading_1537i_1", "Heading--xxxxl": "_Heading--xxxxl_1537i_13", "Heading--xxxl": "_Heading--xxxl_1537i_19", "Heading--xxl": "_Heading--xxl_1537i_23", "Heading--xl": "_Heading--xl_1537i_27", "Heading--l": "_Heading--l_1537i_31", "Heading--m": "_Heading--m_1537i_35", "Heading--s": "_Heading--s_1537i_39", "Heading--xs": "_Heading--xs_1537i_43" };
|
|
1436
1436
|
|
|
1437
1437
|
// components/Heading/index.tsx
|
|
1438
1438
|
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
@@ -1799,11 +1799,11 @@ import * as SelectPrimitive from "@radix-ui/react-select";
|
|
|
1799
1799
|
|
|
1800
1800
|
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/ui/Select/styles.module.css#css-module
|
|
1801
1801
|
init_react_import();
|
|
1802
|
-
var styles_module_default7 = { "
|
|
1802
|
+
var styles_module_default7 = { "EditorSelect-trigger": "_EditorSelect-trigger_13s1k_3", "EditorSelect-triggerIcon": "_EditorSelect-triggerIcon_13s1k_54", "EditorSelect-content": "_EditorSelect-content_13s1k_61", "EditorSelect-viewport": "_EditorSelect-viewport_13s1k_84", "EditorSelect-item": "_EditorSelect-item_13s1k_93", "EditorSelect-itemIndicator": "_EditorSelect-itemIndicator_13s1k_119", "EditorSelect-group": "_EditorSelect-group_13s1k_131", "EditorSelect-label": "_EditorSelect-label_13s1k_135", "EditorSelect-separator": "_EditorSelect-separator_13s1k_144", "EditorSelect-scrollButton": "_EditorSelect-scrollButton_13s1k_152" };
|
|
1803
1803
|
|
|
1804
1804
|
// components/ui/Select/index.tsx
|
|
1805
1805
|
import { jsx as jsx15, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1806
|
-
var getClassName10 = get_class_name_factory_default("
|
|
1806
|
+
var getClassName10 = get_class_name_factory_default("EditorSelect", styles_module_default7);
|
|
1807
1807
|
var joinClassNames = (...values) => values.filter(Boolean).join(" ");
|
|
1808
1808
|
function Select(_a) {
|
|
1809
1809
|
var props = __objRest(_a, []);
|
|
@@ -2047,7 +2047,7 @@ EditorFallback.displayName = "EditorFallback";
|
|
|
2047
2047
|
// components/AutoField/fields/RichtextField/index.tsx
|
|
2048
2048
|
import { Fragment as Fragment3, jsx as jsx19 } from "react/jsx-runtime";
|
|
2049
2049
|
var Editor = lazy(
|
|
2050
|
-
() => import("./Editor-
|
|
2050
|
+
() => import("./Editor-OSAG52QF.mjs").then((m) => ({
|
|
2051
2051
|
default: m.Editor
|
|
2052
2052
|
}))
|
|
2053
2053
|
);
|
|
@@ -2087,7 +2087,7 @@ init_react_import();
|
|
|
2087
2087
|
|
|
2088
2088
|
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/AutoField/fields/ObjectField/styles.module.css#css-module
|
|
2089
2089
|
init_react_import();
|
|
2090
|
-
var styles_module_default8 = { "ObjectField": "
|
|
2090
|
+
var styles_module_default8 = { "ObjectField": "_ObjectField_1byjv_5", "ObjectField-fieldset": "_ObjectField-fieldset_1byjv_13" };
|
|
2091
2091
|
|
|
2092
2092
|
// components/AutoField/fields/ObjectField/index.tsx
|
|
2093
2093
|
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
@@ -2371,7 +2371,7 @@ import {
|
|
|
2371
2371
|
|
|
2372
2372
|
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/DraggableComponent/styles.module.css#css-module
|
|
2373
2373
|
init_react_import();
|
|
2374
|
-
var styles_module_default9 = { "DraggableComponent": "
|
|
2374
|
+
var styles_module_default9 = { "DraggableComponent": "_DraggableComponent_ie0on_1", "DraggableComponent-overlayWrapper": "_DraggableComponent-overlayWrapper_ie0on_12", "DraggableComponent-overlay": "_DraggableComponent-overlay_ie0on_12", "DraggableComponent-loadingOverlay": "_DraggableComponent-loadingOverlay_ie0on_36", "DraggableComponent--hover": "_DraggableComponent--hover_ie0on_53", "DraggableComponent--isSelected": "_DraggableComponent--isSelected_ie0on_60", "DraggableComponent--isGlobal": "_DraggableComponent--isGlobal_ie0on_69", "DraggableComponent-actionsOverlay": "_DraggableComponent-actionsOverlay_ie0on_105", "DraggableComponent-actions": "_DraggableComponent-actions_ie0on_105" };
|
|
2375
2375
|
|
|
2376
2376
|
// components/DraggableComponent/index.tsx
|
|
2377
2377
|
import { createPortal as createPortal2 } from "react-dom";
|
|
@@ -3108,7 +3108,7 @@ var DraggableComponent = ({
|
|
|
3108
3108
|
|
|
3109
3109
|
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/DropZone/styles.module.css#css-module
|
|
3110
3110
|
init_react_import();
|
|
3111
|
-
var styles_module_default10 = { "DropZone": "
|
|
3111
|
+
var styles_module_default10 = { "DropZone": "_DropZone_1h108_1", "DropZone--hasChildren": "_DropZone--hasChildren_1h108_11", "DropZone--isAreaSelected": "_DropZone--isAreaSelected_1h108_24", "DropZone--hoveringOverArea": "_DropZone--hoveringOverArea_1h108_25", "DropZone--isRootZone": "_DropZone--isRootZone_1h108_25", "DropZone--isDestination": "_DropZone--isDestination_1h108_39", "DropZone-item": "_DropZone-item_1h108_48", "DropZone-hitbox": "_DropZone-hitbox_1h108_52", "DropZone--isEnabled": "_DropZone--isEnabled_1h108_60", "DropZone--isAnimating": "_DropZone--isAnimating_1h108_70" };
|
|
3112
3112
|
|
|
3113
3113
|
// components/DropZone/index.tsx
|
|
3114
3114
|
import { useDroppable as useDroppable2 } from "@dnd-kit/react";
|
|
@@ -3118,7 +3118,7 @@ init_react_import();
|
|
|
3118
3118
|
|
|
3119
3119
|
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Drawer/styles.module.css#css-module
|
|
3120
3120
|
init_react_import();
|
|
3121
|
-
var styles_module_default11 = { "Drawer": "
|
|
3121
|
+
var styles_module_default11 = { "Drawer": "_Drawer_146py_1", "Drawer--tile": "_Drawer--tile_146py_8", "Drawer-draggable": "_Drawer-draggable_146py_19", "Drawer-draggableBg": "_Drawer-draggableBg_146py_23", "DrawerItem-draggable": "_DrawerItem-draggable_146py_33", "DrawerItem-icon": "_DrawerItem-icon_146py_50", "DrawerItem--disabled": "_DrawerItem--disabled_146py_56", "DrawerItem": "_DrawerItem_146py_33", "Drawer--isDraggingFrom": "_Drawer--isDraggingFrom_146py_66", "DrawerItem-name": "_DrawerItem-name_146py_91" };
|
|
3122
3122
|
|
|
3123
3123
|
// components/Drawer/index.tsx
|
|
3124
3124
|
import { useMemo as useMemo9, useState as useState11 } from "react";
|
|
@@ -4586,12 +4586,12 @@ import {
|
|
|
4586
4586
|
} from "react";
|
|
4587
4587
|
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
4588
4588
|
var Editor2 = lazy2(
|
|
4589
|
-
() => import("./Editor-
|
|
4589
|
+
() => import("./Editor-OSAG52QF.mjs").then((m) => ({
|
|
4590
4590
|
default: m.Editor
|
|
4591
4591
|
}))
|
|
4592
4592
|
);
|
|
4593
4593
|
var RichTextRender = lazy2(
|
|
4594
|
-
() => import("./Render-
|
|
4594
|
+
() => import("./Render-STFB5CNO.mjs").then((m) => ({
|
|
4595
4595
|
default: m.RichTextRender
|
|
4596
4596
|
}))
|
|
4597
4597
|
);
|
|
@@ -5538,7 +5538,7 @@ init_react_import();
|
|
|
5538
5538
|
|
|
5539
5539
|
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/ComponentList/styles.module.css#css-module
|
|
5540
5540
|
init_react_import();
|
|
5541
|
-
var styles_module_default13 = { "ComponentList": "
|
|
5541
|
+
var styles_module_default13 = { "ComponentList": "_ComponentList_1mlcu_1", "ComponentList--isExpanded": "_ComponentList--isExpanded_1mlcu_5", "ComponentList-content": "_ComponentList-content_1mlcu_9", "ComponentList-title": "_ComponentList-title_1mlcu_17", "ComponentList-titleIcon": "_ComponentList-titleIcon_1mlcu_54" };
|
|
5542
5542
|
|
|
5543
5543
|
// components/ComponentList/index.tsx
|
|
5544
5544
|
import { useEffect as useEffect17 } from "react";
|
|
@@ -5679,8 +5679,131 @@ function resolveDataBySelector(selector, getState, trigger) {
|
|
|
5679
5679
|
});
|
|
5680
5680
|
}
|
|
5681
5681
|
|
|
5682
|
+
// lib/editor-commands.ts
|
|
5683
|
+
init_react_import();
|
|
5684
|
+
var parentToZone = (parent) => parent ? `${parent.id}:${parent.slot}` : rootDroppableId;
|
|
5685
|
+
var createEditorCommands = (appStore) => {
|
|
5686
|
+
const { getState } = appStore;
|
|
5687
|
+
const getZoneLength = (zone) => {
|
|
5688
|
+
var _a, _b;
|
|
5689
|
+
return (_b = (_a = getState().state.indexes.zones[zone]) == null ? void 0 : _a.contentIds.length) != null ? _b : 0;
|
|
5690
|
+
};
|
|
5691
|
+
const insertComponent2 = ({
|
|
5692
|
+
type,
|
|
5693
|
+
parent,
|
|
5694
|
+
index,
|
|
5695
|
+
data,
|
|
5696
|
+
select = true
|
|
5697
|
+
}) => {
|
|
5698
|
+
var _a;
|
|
5699
|
+
const id = (_a = data == null ? void 0 : data.props.id) != null ? _a : generateId(type);
|
|
5700
|
+
const zone = parentToZone(parent);
|
|
5701
|
+
const destIndex = index != null ? index : getZoneLength(zone);
|
|
5702
|
+
const dispatch = getState().dispatch;
|
|
5703
|
+
dispatch(__spreadValues({
|
|
5704
|
+
type: "insert",
|
|
5705
|
+
componentType: type,
|
|
5706
|
+
destinationIndex: destIndex,
|
|
5707
|
+
destinationZone: zone,
|
|
5708
|
+
id
|
|
5709
|
+
}, data ? { data: __spreadProps(__spreadValues({}, data), { props: __spreadProps(__spreadValues({}, data.props), { id }) }) } : {}));
|
|
5710
|
+
if (select) {
|
|
5711
|
+
dispatch({
|
|
5712
|
+
type: "setUi",
|
|
5713
|
+
ui: { itemSelector: { index: destIndex, zone } }
|
|
5714
|
+
});
|
|
5715
|
+
}
|
|
5716
|
+
return { id };
|
|
5717
|
+
};
|
|
5718
|
+
const removeComponent = (id) => {
|
|
5719
|
+
const sel = getSelectorForId(getState().state, id);
|
|
5720
|
+
if (!(sel == null ? void 0 : sel.zone)) return;
|
|
5721
|
+
getState().dispatch({ type: "remove", index: sel.index, zone: sel.zone });
|
|
5722
|
+
};
|
|
5723
|
+
const duplicateComponent = (id) => {
|
|
5724
|
+
const sel = getSelectorForId(getState().state, id);
|
|
5725
|
+
if (!(sel == null ? void 0 : sel.zone)) return;
|
|
5726
|
+
getState().dispatch({
|
|
5727
|
+
type: "duplicate",
|
|
5728
|
+
sourceIndex: sel.index,
|
|
5729
|
+
sourceZone: sel.zone
|
|
5730
|
+
});
|
|
5731
|
+
};
|
|
5732
|
+
const moveComponent2 = (id, to) => {
|
|
5733
|
+
const sel = getSelectorForId(getState().state, id);
|
|
5734
|
+
if (!(sel == null ? void 0 : sel.zone)) return;
|
|
5735
|
+
getState().dispatch({
|
|
5736
|
+
type: "move",
|
|
5737
|
+
sourceIndex: sel.index,
|
|
5738
|
+
sourceZone: sel.zone,
|
|
5739
|
+
destinationIndex: to.index,
|
|
5740
|
+
destinationZone: parentToZone(to.parent)
|
|
5741
|
+
});
|
|
5742
|
+
};
|
|
5743
|
+
const replaceComponent = (id, data) => {
|
|
5744
|
+
const sel = getSelectorForId(getState().state, id);
|
|
5745
|
+
if (!(sel == null ? void 0 : sel.zone)) return;
|
|
5746
|
+
const existing = getItem(sel, getState().state);
|
|
5747
|
+
if (!existing) return;
|
|
5748
|
+
getState().dispatch({
|
|
5749
|
+
type: "replace",
|
|
5750
|
+
destinationIndex: sel.index,
|
|
5751
|
+
destinationZone: sel.zone,
|
|
5752
|
+
data: __spreadProps(__spreadValues({}, data), { props: __spreadProps(__spreadValues({}, data.props), { id: existing.props.id }) })
|
|
5753
|
+
});
|
|
5754
|
+
};
|
|
5755
|
+
const updateProps = (id, updater) => {
|
|
5756
|
+
const sel = getSelectorForId(getState().state, id);
|
|
5757
|
+
if (!sel) return;
|
|
5758
|
+
const existing = getItem(sel, getState().state);
|
|
5759
|
+
if (!existing) return;
|
|
5760
|
+
const patch = typeof updater === "function" ? updater(existing.props) : updater;
|
|
5761
|
+
getState().dispatch({
|
|
5762
|
+
type: "replace",
|
|
5763
|
+
destinationIndex: sel.index,
|
|
5764
|
+
destinationZone: sel.zone,
|
|
5765
|
+
data: __spreadProps(__spreadValues({}, existing), {
|
|
5766
|
+
props: __spreadProps(__spreadValues(__spreadValues({}, existing.props), patch), { id: existing.props.id })
|
|
5767
|
+
})
|
|
5768
|
+
});
|
|
5769
|
+
};
|
|
5770
|
+
const updateRoot = (updater) => {
|
|
5771
|
+
var _a, _b;
|
|
5772
|
+
const root = (_a = getState().state.data.root) != null ? _a : { props: {} };
|
|
5773
|
+
const prevProps = (_b = root.props) != null ? _b : {};
|
|
5774
|
+
const patch = typeof updater === "function" ? updater(prevProps) : updater;
|
|
5775
|
+
getState().dispatch({
|
|
5776
|
+
type: "replaceRoot",
|
|
5777
|
+
root: __spreadProps(__spreadValues({}, root), { props: __spreadValues(__spreadValues({}, prevProps), patch) })
|
|
5778
|
+
});
|
|
5779
|
+
};
|
|
5780
|
+
const selectComponent = (id) => {
|
|
5781
|
+
const dispatch = getState().dispatch;
|
|
5782
|
+
if (id === null) {
|
|
5783
|
+
dispatch({ type: "setUi", ui: { itemSelector: null } });
|
|
5784
|
+
return;
|
|
5785
|
+
}
|
|
5786
|
+
const sel = getSelectorForId(getState().state, id);
|
|
5787
|
+
if (!(sel == null ? void 0 : sel.zone)) return;
|
|
5788
|
+
dispatch({
|
|
5789
|
+
type: "setUi",
|
|
5790
|
+
ui: { itemSelector: { index: sel.index, zone: sel.zone } }
|
|
5791
|
+
});
|
|
5792
|
+
};
|
|
5793
|
+
return {
|
|
5794
|
+
insertComponent: insertComponent2,
|
|
5795
|
+
removeComponent,
|
|
5796
|
+
duplicateComponent,
|
|
5797
|
+
moveComponent: moveComponent2,
|
|
5798
|
+
replaceComponent,
|
|
5799
|
+
updateProps,
|
|
5800
|
+
updateRoot,
|
|
5801
|
+
selectComponent
|
|
5802
|
+
};
|
|
5803
|
+
};
|
|
5804
|
+
|
|
5682
5805
|
// lib/use-editor.ts
|
|
5683
|
-
var generateUseEditor = (store, getState) => {
|
|
5806
|
+
var generateUseEditor = (store, getState, commands) => {
|
|
5684
5807
|
const history = {
|
|
5685
5808
|
back: store.history.back,
|
|
5686
5809
|
forward: store.history.forward,
|
|
@@ -5691,7 +5814,7 @@ var generateUseEditor = (store, getState) => {
|
|
|
5691
5814
|
histories: store.history.histories,
|
|
5692
5815
|
index: store.history.index
|
|
5693
5816
|
};
|
|
5694
|
-
const storeData = {
|
|
5817
|
+
const storeData = __spreadProps(__spreadValues({}, commands), {
|
|
5695
5818
|
appState: makeStatePublic(store.state),
|
|
5696
5819
|
config: store.config,
|
|
5697
5820
|
dispatch: store.dispatch,
|
|
@@ -5712,7 +5835,7 @@ var generateUseEditor = (store, getState) => {
|
|
|
5712
5835
|
if (!parentNode) return;
|
|
5713
5836
|
return parentNode.data;
|
|
5714
5837
|
}
|
|
5715
|
-
};
|
|
5838
|
+
});
|
|
5716
5839
|
storeData.__private = {
|
|
5717
5840
|
appState: store.state
|
|
5718
5841
|
};
|
|
@@ -5732,11 +5855,13 @@ var convertToPickedStore = (store) => {
|
|
|
5732
5855
|
};
|
|
5733
5856
|
};
|
|
5734
5857
|
var useRegisterUseEditorStore = (appStore) => {
|
|
5858
|
+
const [commands] = useState16(() => createEditorCommands(appStore));
|
|
5735
5859
|
const [useEditorStore] = useState16(
|
|
5736
5860
|
() => createStore5(
|
|
5737
5861
|
() => generateUseEditor(
|
|
5738
5862
|
convertToPickedStore(appStore.getState()),
|
|
5739
|
-
appStore.getState
|
|
5863
|
+
appStore.getState,
|
|
5864
|
+
commands
|
|
5740
5865
|
)
|
|
5741
5866
|
)
|
|
5742
5867
|
);
|
|
@@ -5744,10 +5869,12 @@ var useRegisterUseEditorStore = (appStore) => {
|
|
|
5744
5869
|
return appStore.subscribe(
|
|
5745
5870
|
(store) => convertToPickedStore(store),
|
|
5746
5871
|
(pickedStore) => {
|
|
5747
|
-
useEditorStore.setState(
|
|
5872
|
+
useEditorStore.setState(
|
|
5873
|
+
generateUseEditor(pickedStore, appStore.getState, commands)
|
|
5874
|
+
);
|
|
5748
5875
|
}
|
|
5749
5876
|
);
|
|
5750
|
-
}, []);
|
|
5877
|
+
}, [commands]);
|
|
5751
5878
|
return useEditorStore;
|
|
5752
5879
|
};
|
|
5753
5880
|
function createUseEditor() {
|
|
@@ -5788,7 +5915,7 @@ import { useMemo as useMemo14, useState as useState17 } from "react";
|
|
|
5788
5915
|
|
|
5789
5916
|
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Editor/components/Components/styles.module.css#css-module
|
|
5790
5917
|
init_react_import();
|
|
5791
|
-
var styles_module_default14 = { "Components-search": "_Components-
|
|
5918
|
+
var styles_module_default14 = { "Components-search": "_Components-search_recer_1", "Components-searchIcon": "_Components-searchIcon_recer_8", "Components-searchInput": "_Components-searchInput_recer_16", "Components-empty": "_Components-empty_recer_39" };
|
|
5792
5919
|
|
|
5793
5920
|
// components/Editor/components/Components/index.tsx
|
|
5794
5921
|
import { jsx as jsx35, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
@@ -5905,7 +6032,7 @@ init_react_import();
|
|
|
5905
6032
|
|
|
5906
6033
|
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/LayerTree/styles.module.css#css-module
|
|
5907
6034
|
init_react_import();
|
|
5908
|
-
var styles_module_default16 = { "LayerTree": "
|
|
6035
|
+
var styles_module_default16 = { "LayerTree": "_LayerTree_3eixb_1", "LayerTree-zoneTitle": "_LayerTree-zoneTitle_3eixb_11", "LayerTree-helper": "_LayerTree-helper_3eixb_17", "Layer": "_Layer_3eixb_1", "Layer-inner": "_Layer-inner_3eixb_34", "Layer--containsZone": "_Layer--containsZone_3eixb_42", "Layer-clickable": "_Layer-clickable_3eixb_46", "Layer--isSelected": "_Layer--isSelected_3eixb_68", "Layer-icon": "_Layer-icon_3eixb_80", "Layer-zoneIcon": "_Layer-zoneIcon_3eixb_81", "Layer-chevron": "_Layer-chevron_3eixb_85", "Layer--childIsSelected": "_Layer--childIsSelected_3eixb_97", "Layer-zones": "_Layer-zones_3eixb_101", "Layer-title": "_Layer-title_3eixb_117", "Layer-name": "_Layer-name_3eixb_130", "Layer--isGlobal": "_Layer--isGlobal_3eixb_150", "Layer--isUnlinked": "_Layer--isUnlinked_3eixb_171", "Layer-unlinkedGlyph": "_Layer-unlinkedGlyph_3eixb_175" };
|
|
5909
6036
|
|
|
5910
6037
|
// components/LayerTree/index.tsx
|
|
5911
6038
|
import {
|
|
@@ -6363,7 +6490,7 @@ init_react_import();
|
|
|
6363
6490
|
|
|
6364
6491
|
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Breadcrumbs/styles.module.css#css-module
|
|
6365
6492
|
init_react_import();
|
|
6366
|
-
var styles_module_default18 = { "Breadcrumbs": "
|
|
6493
|
+
var styles_module_default18 = { "Breadcrumbs": "_Breadcrumbs_1cjxk_1", "Breadcrumbs-breadcrumb": "_Breadcrumbs-breadcrumb_1cjxk_10", "Breadcrumbs-breadcrumbLabel": "_Breadcrumbs-breadcrumbLabel_1cjxk_17" };
|
|
6367
6494
|
|
|
6368
6495
|
// lib/use-breadcrumbs.ts
|
|
6369
6496
|
init_react_import();
|
|
@@ -6440,7 +6567,7 @@ init_react_import();
|
|
|
6440
6567
|
|
|
6441
6568
|
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Editor/components/Fields/styles.module.css#css-module
|
|
6442
6569
|
init_react_import();
|
|
6443
|
-
var styles_module_default19 = { "EditorFields": "
|
|
6570
|
+
var styles_module_default19 = { "EditorFields": "_EditorFields_3dnua_1", "EditorFields--isLoading": "_EditorFields--isLoading_3dnua_6", "EditorFields-loadingOverlay": "_EditorFields-loadingOverlay_3dnua_10", "EditorFields-loadingOverlayInner": "_EditorFields-loadingOverlayInner_3dnua_25", "EditorFields-field": "_EditorFields-field_3dnua_32", "EditorFields--wrapFields": "_EditorFields--wrapFields_3dnua_36", "EditorFields-syncButton": "_EditorFields-syncButton_3dnua_46", "EditorFields-syncButton--unlinked": "_EditorFields-syncButton--unlinked_3dnua_78" };
|
|
6444
6571
|
|
|
6445
6572
|
// components/Editor/components/Fields/index.tsx
|
|
6446
6573
|
import {
|
|
@@ -6638,7 +6765,7 @@ var Fields = memo8(FieldsInternal);
|
|
|
6638
6765
|
|
|
6639
6766
|
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/plugins/fields/styles.module.css#css-module
|
|
6640
6767
|
init_react_import();
|
|
6641
|
-
var styles_module_default20 = { "FieldsPlugin": "
|
|
6768
|
+
var styles_module_default20 = { "FieldsPlugin": "_FieldsPlugin_262zt_1", "FieldsPlugin-header": "_FieldsPlugin-header_262zt_7" };
|
|
6642
6769
|
|
|
6643
6770
|
// plugins/fields/index.tsx
|
|
6644
6771
|
import { jsx as jsx42, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
@@ -6666,12 +6793,12 @@ var fieldsPlugin = ({ desktopSideBar = "right" } = {}) => ({
|
|
|
6666
6793
|
init_react_import();
|
|
6667
6794
|
import {
|
|
6668
6795
|
createContext as createContext8,
|
|
6669
|
-
useCallback as
|
|
6796
|
+
useCallback as useCallback24,
|
|
6670
6797
|
useContext as useContext15,
|
|
6671
6798
|
useEffect as useEffect26,
|
|
6672
6799
|
useMemo as useMemo24,
|
|
6673
|
-
useRef as
|
|
6674
|
-
useState as
|
|
6800
|
+
useRef as useRef18,
|
|
6801
|
+
useState as useState24
|
|
6675
6802
|
} from "react";
|
|
6676
6803
|
|
|
6677
6804
|
// components/Editor/components/Preview/index.tsx
|
|
@@ -7177,16 +7304,16 @@ function splitGlobals(data, config) {
|
|
|
7177
7304
|
// components/Editor/components/Layout/index.tsx
|
|
7178
7305
|
init_react_import();
|
|
7179
7306
|
import {
|
|
7180
|
-
useCallback as
|
|
7307
|
+
useCallback as useCallback23,
|
|
7181
7308
|
useEffect as useEffect25,
|
|
7182
7309
|
useMemo as useMemo23,
|
|
7183
|
-
useRef as
|
|
7184
|
-
useState as
|
|
7310
|
+
useRef as useRef17,
|
|
7311
|
+
useState as useState23
|
|
7185
7312
|
} from "react";
|
|
7186
7313
|
|
|
7187
7314
|
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Editor/components/Layout/styles.module.css#css-module
|
|
7188
7315
|
init_react_import();
|
|
7189
|
-
var styles_module_default22 = { "Editor": "
|
|
7316
|
+
var styles_module_default22 = { "Editor": "_Editor_1ty8s_19", "Editor-portal": "_Editor-portal_1ty8s_32", "EditorLayout": "_EditorLayout_1ty8s_37", "EditorLayout-inner": "_EditorLayout-inner_1ty8s_41", "Editor--hidePlugins": "_Editor--hidePlugins_1ty8s_73", "EditorLayout--mounted": "_EditorLayout--mounted_1ty8s_78", "EditorLayout--mobilePanelHeightToggle": "_EditorLayout--mobilePanelHeightToggle_1ty8s_82", "EditorLayout--leftSideBarVisible": "_EditorLayout--leftSideBarVisible_1ty8s_82", "EditorLayout--mobilePanelCustomHeight": "_EditorLayout--mobilePanelCustomHeight_1ty8s_87", "EditorLayout--mobilePanelHeightMinContent": "_EditorLayout--mobilePanelHeightMinContent_1ty8s_105", "EditorLayout--rightSideBarVisible": "_EditorLayout--rightSideBarVisible_1ty8s_127", "EditorLayout-mounted": "_EditorLayout-mounted_1ty8s_146", "EditorLayout-nav": "_EditorLayout-nav_1ty8s_187", "Editor-fieldSideBarToolbar": "_Editor-fieldSideBarToolbar_1ty8s_203", "Editor-fieldSideBarHistory": "_Editor-fieldSideBarHistory_1ty8s_213", "Editor-fieldSideBarActions": "_Editor-fieldSideBarActions_1ty8s_219", "EditorLayout-mobilePanel": "_EditorLayout-mobilePanel_1ty8s_225", "EditorLayout-mobilePanelContent": "_EditorLayout-mobilePanelContent_1ty8s_245", "EditorLayout-mobileDragHandle": "_EditorLayout-mobileDragHandle_1ty8s_252", "EditorLayout-mobileDragHandlePill": "_EditorLayout-mobileDragHandlePill_1ty8s_266", "EditorPluginTab": "_EditorPluginTab_1ty8s_273", "EditorPluginTab--visible": "_EditorPluginTab--visible_1ty8s_279", "EditorPluginTab-body": "_EditorPluginTab-body_1ty8s_284" };
|
|
7190
7317
|
|
|
7191
7318
|
// lib/use-inject-css.ts
|
|
7192
7319
|
init_react_import();
|
|
@@ -7243,7 +7370,7 @@ init_react_import();
|
|
|
7243
7370
|
|
|
7244
7371
|
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/SidebarSection/styles.module.css#css-module
|
|
7245
7372
|
init_react_import();
|
|
7246
|
-
var styles_module_default23 = { "SidebarSection": "
|
|
7373
|
+
var styles_module_default23 = { "SidebarSection": "_SidebarSection_tt2oy_1", "SidebarSection-title": "_SidebarSection-title_tt2oy_12", "SidebarSection--noBorderTop": "_SidebarSection--noBorderTop_tt2oy_20", "SidebarSection-content": "_SidebarSection-content_tt2oy_24", "SidebarSection-breadcrumbLabel": "_SidebarSection-breadcrumbLabel_tt2oy_33", "SidebarSection-breadcrumbs": "_SidebarSection-breadcrumbs_tt2oy_62", "SidebarSection-breadcrumb": "_SidebarSection-breadcrumb_tt2oy_33", "SidebarSection-heading": "_SidebarSection-heading_tt2oy_74", "SidebarSection-loadingOverlay": "_SidebarSection-loadingOverlay_tt2oy_88" };
|
|
7247
7374
|
|
|
7248
7375
|
// components/SidebarSection/index.tsx
|
|
7249
7376
|
import { jsx as jsx46, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
@@ -7272,21 +7399,146 @@ import {
|
|
|
7272
7399
|
useCallback as useCallback18,
|
|
7273
7400
|
useEffect as useEffect23,
|
|
7274
7401
|
useMemo as useMemo22,
|
|
7275
|
-
useRef as
|
|
7276
|
-
useState as
|
|
7402
|
+
useRef as useRef14,
|
|
7403
|
+
useState as useState21
|
|
7277
7404
|
} from "react";
|
|
7278
7405
|
|
|
7279
7406
|
// components/BrowserBar/index.tsx
|
|
7280
7407
|
init_react_import();
|
|
7281
|
-
import { useMemo as useMemo20 } from "react";
|
|
7408
|
+
import { useMemo as useMemo20, useRef as useRef12, useState as useState20 } from "react";
|
|
7409
|
+
|
|
7410
|
+
// components/ui/Combobox/index.tsx
|
|
7411
|
+
init_react_import();
|
|
7412
|
+
import { Combobox as ComboboxPrimitive } from "@base-ui/react";
|
|
7413
|
+
|
|
7414
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/ui/Combobox/styles.module.css#css-module
|
|
7415
|
+
init_react_import();
|
|
7416
|
+
var styles_module_default24 = { "EditorCombobox-input": "_EditorCombobox-input_12a2a_4", "EditorCombobox-trigger": "_EditorCombobox-trigger_12a2a_21", "EditorCombobox-triggerIcon": "_EditorCombobox-triggerIcon_12a2a_42", "EditorCombobox-positioner": "_EditorCombobox-positioner_12a2a_46", "EditorCombobox-content": "_EditorCombobox-content_12a2a_50", "EditorCombobox-list": "_EditorCombobox-list_12a2a_65", "EditorCombobox-item": "_EditorCombobox-item_12a2a_71", "EditorCombobox-itemIndicator": "_EditorCombobox-itemIndicator_12a2a_97", "EditorCombobox-empty": "_EditorCombobox-empty_12a2a_110" };
|
|
7417
|
+
|
|
7418
|
+
// components/ui/Combobox/index.tsx
|
|
7419
|
+
import { jsx as jsx47, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
7420
|
+
var getClassName28 = get_class_name_factory_default("EditorCombobox", styles_module_default24);
|
|
7421
|
+
var join = (...values) => values.filter(Boolean).join(" ");
|
|
7422
|
+
var mergeClassName = (base, override) => {
|
|
7423
|
+
if (!override) return base;
|
|
7424
|
+
if (typeof override === "function") {
|
|
7425
|
+
return (state) => join(base, override(state));
|
|
7426
|
+
}
|
|
7427
|
+
return join(base, override);
|
|
7428
|
+
};
|
|
7429
|
+
var Combobox = ComboboxPrimitive.Root;
|
|
7430
|
+
function ComboboxInput(_a) {
|
|
7431
|
+
var _b = _a, {
|
|
7432
|
+
className
|
|
7433
|
+
} = _b, props = __objRest(_b, [
|
|
7434
|
+
"className"
|
|
7435
|
+
]);
|
|
7436
|
+
return /* @__PURE__ */ jsx47(
|
|
7437
|
+
ComboboxPrimitive.Input,
|
|
7438
|
+
__spreadValues({
|
|
7439
|
+
"data-slot": "combobox-input",
|
|
7440
|
+
className: mergeClassName(getClassName28("input"), className)
|
|
7441
|
+
}, props)
|
|
7442
|
+
);
|
|
7443
|
+
}
|
|
7444
|
+
function ComboboxContent(_a) {
|
|
7445
|
+
var _b = _a, {
|
|
7446
|
+
className,
|
|
7447
|
+
side = "bottom",
|
|
7448
|
+
sideOffset = 4,
|
|
7449
|
+
align = "start",
|
|
7450
|
+
alignOffset = 0,
|
|
7451
|
+
children
|
|
7452
|
+
} = _b, props = __objRest(_b, [
|
|
7453
|
+
"className",
|
|
7454
|
+
"side",
|
|
7455
|
+
"sideOffset",
|
|
7456
|
+
"align",
|
|
7457
|
+
"alignOffset",
|
|
7458
|
+
"children"
|
|
7459
|
+
]);
|
|
7460
|
+
return /* @__PURE__ */ jsx47(ComboboxPrimitive.Portal, { children: /* @__PURE__ */ jsx47(
|
|
7461
|
+
ComboboxPrimitive.Positioner,
|
|
7462
|
+
{
|
|
7463
|
+
side,
|
|
7464
|
+
sideOffset,
|
|
7465
|
+
align,
|
|
7466
|
+
alignOffset,
|
|
7467
|
+
className: getClassName28("positioner"),
|
|
7468
|
+
children: /* @__PURE__ */ jsx47(
|
|
7469
|
+
ComboboxPrimitive.Popup,
|
|
7470
|
+
__spreadProps(__spreadValues({
|
|
7471
|
+
"data-slot": "combobox-content",
|
|
7472
|
+
className: mergeClassName(getClassName28("content"), className)
|
|
7473
|
+
}, props), {
|
|
7474
|
+
children
|
|
7475
|
+
})
|
|
7476
|
+
)
|
|
7477
|
+
}
|
|
7478
|
+
) });
|
|
7479
|
+
}
|
|
7480
|
+
function ComboboxList(_a) {
|
|
7481
|
+
var _b = _a, {
|
|
7482
|
+
className
|
|
7483
|
+
} = _b, props = __objRest(_b, [
|
|
7484
|
+
"className"
|
|
7485
|
+
]);
|
|
7486
|
+
return /* @__PURE__ */ jsx47(
|
|
7487
|
+
ComboboxPrimitive.List,
|
|
7488
|
+
__spreadValues({
|
|
7489
|
+
"data-slot": "combobox-list",
|
|
7490
|
+
className: mergeClassName(getClassName28("list"), className)
|
|
7491
|
+
}, props)
|
|
7492
|
+
);
|
|
7493
|
+
}
|
|
7494
|
+
function ComboboxItem(_a) {
|
|
7495
|
+
var _b = _a, {
|
|
7496
|
+
className,
|
|
7497
|
+
children
|
|
7498
|
+
} = _b, props = __objRest(_b, [
|
|
7499
|
+
"className",
|
|
7500
|
+
"children"
|
|
7501
|
+
]);
|
|
7502
|
+
return /* @__PURE__ */ jsxs18(
|
|
7503
|
+
ComboboxPrimitive.Item,
|
|
7504
|
+
__spreadProps(__spreadValues({
|
|
7505
|
+
"data-slot": "combobox-item",
|
|
7506
|
+
className: mergeClassName(getClassName28("item"), className)
|
|
7507
|
+
}, props), {
|
|
7508
|
+
children: [
|
|
7509
|
+
/* @__PURE__ */ jsx47("span", { className: getClassName28("itemIndicator"), children: /* @__PURE__ */ jsx47(ComboboxPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx47(Check, { size: 14 }) }) }),
|
|
7510
|
+
children
|
|
7511
|
+
]
|
|
7512
|
+
})
|
|
7513
|
+
);
|
|
7514
|
+
}
|
|
7515
|
+
function ComboboxEmpty(_a) {
|
|
7516
|
+
var _b = _a, {
|
|
7517
|
+
className
|
|
7518
|
+
} = _b, props = __objRest(_b, [
|
|
7519
|
+
"className"
|
|
7520
|
+
]);
|
|
7521
|
+
return /* @__PURE__ */ jsx47(
|
|
7522
|
+
ComboboxPrimitive.Empty,
|
|
7523
|
+
__spreadValues({
|
|
7524
|
+
"data-slot": "combobox-empty",
|
|
7525
|
+
className: mergeClassName(getClassName28("empty"), className)
|
|
7526
|
+
}, props)
|
|
7527
|
+
);
|
|
7528
|
+
}
|
|
7282
7529
|
|
|
7283
7530
|
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/BrowserBar/styles.module.css#css-module
|
|
7284
7531
|
init_react_import();
|
|
7285
|
-
var
|
|
7532
|
+
var styles_module_default25 = { "BrowserBar": "_BrowserBar_x10eb_1", "BrowserBar-urlTrigger": "_BrowserBar-urlTrigger_x10eb_16", "BrowserBar-urlIcon": "_BrowserBar-urlIcon_x10eb_46", "BrowserBar-urlText": "_BrowserBar-urlText_x10eb_51", "BrowserBar-urlInput": "_BrowserBar-urlInput_x10eb_63", "BrowserBar-itemPath": "_BrowserBar-itemPath_x10eb_69", "BrowserBar-itemTitle": "_BrowserBar-itemTitle_x10eb_74", "BrowserBar-actions": "_BrowserBar-actions_x10eb_82", "BrowserBar-deviceIcon": "_BrowserBar-deviceIcon_x10eb_89" };
|
|
7286
7533
|
|
|
7287
7534
|
// components/BrowserBar/index.tsx
|
|
7288
|
-
import { jsx as
|
|
7289
|
-
var
|
|
7535
|
+
import { jsx as jsx48, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
7536
|
+
var normalizeRoute = (raw) => {
|
|
7537
|
+
const trimmed = raw.trim();
|
|
7538
|
+
if (!trimmed) return trimmed;
|
|
7539
|
+
return trimmed.startsWith("/") ? trimmed : `/${trimmed}`;
|
|
7540
|
+
};
|
|
7541
|
+
var getClassName29 = get_class_name_factory_default("BrowserBar", styles_module_default25);
|
|
7290
7542
|
var DEVICE_VIEWPORTS = {
|
|
7291
7543
|
desktop: { width: "100%", height: "auto", icon: "Monitor", label: "Desktop" },
|
|
7292
7544
|
mobile: { width: 360, height: "auto", icon: "Smartphone", label: "Mobile" }
|
|
@@ -7294,7 +7546,6 @@ var DEVICE_VIEWPORTS = {
|
|
|
7294
7546
|
var BrowserBar = ({
|
|
7295
7547
|
onViewportChange
|
|
7296
7548
|
}) => {
|
|
7297
|
-
var _a;
|
|
7298
7549
|
const { routes, currentPath, onRouteChange } = usePropsContext();
|
|
7299
7550
|
const viewports = useAppStore((s) => s.state.ui.viewports);
|
|
7300
7551
|
const dispatch = useAppStore((s) => s.dispatch);
|
|
@@ -7322,50 +7573,86 @@ var BrowserBar = ({
|
|
|
7322
7573
|
onViewportChange == null ? void 0 : onViewportChange(DEVICE_VIEWPORTS[device]);
|
|
7323
7574
|
};
|
|
7324
7575
|
const showRoutePicker = !!routes && currentPath !== void 0 && !!onRouteChange;
|
|
7325
|
-
const
|
|
7326
|
-
|
|
7327
|
-
|
|
7328
|
-
|
|
7576
|
+
const [inputValue, setInputValue] = useState20(currentPath != null ? currentPath : "");
|
|
7577
|
+
const lastSyncedPath = useRef12(currentPath);
|
|
7578
|
+
if (lastSyncedPath.current !== currentPath) {
|
|
7579
|
+
lastSyncedPath.current = currentPath;
|
|
7580
|
+
setInputValue(currentPath != null ? currentPath : "");
|
|
7581
|
+
}
|
|
7582
|
+
const submit = (raw) => {
|
|
7583
|
+
const next = normalizeRoute(raw);
|
|
7584
|
+
if (!next || next === currentPath) return;
|
|
7585
|
+
void (onRouteChange == null ? void 0 : onRouteChange(next));
|
|
7586
|
+
};
|
|
7587
|
+
return /* @__PURE__ */ jsxs19("div", { className: getClassName29(), children: [
|
|
7588
|
+
showRoutePicker ? /* @__PURE__ */ jsxs19(
|
|
7589
|
+
Combobox,
|
|
7329
7590
|
{
|
|
7591
|
+
items: routes.map((r) => r.path),
|
|
7330
7592
|
value: currentPath,
|
|
7331
7593
|
onValueChange: (next) => {
|
|
7332
|
-
|
|
7594
|
+
if (typeof next === "string") submit(next);
|
|
7333
7595
|
},
|
|
7596
|
+
inputValue,
|
|
7597
|
+
onInputValueChange: (next) => setInputValue(next),
|
|
7598
|
+
autoHighlight: false,
|
|
7334
7599
|
children: [
|
|
7335
|
-
/* @__PURE__ */
|
|
7336
|
-
|
|
7337
|
-
|
|
7338
|
-
|
|
7339
|
-
|
|
7340
|
-
|
|
7341
|
-
|
|
7342
|
-
|
|
7343
|
-
|
|
7344
|
-
|
|
7600
|
+
/* @__PURE__ */ jsxs19(
|
|
7601
|
+
"form",
|
|
7602
|
+
{
|
|
7603
|
+
className: getClassName29("urlTrigger"),
|
|
7604
|
+
onSubmit: (event) => {
|
|
7605
|
+
event.preventDefault();
|
|
7606
|
+
submit(inputValue);
|
|
7607
|
+
},
|
|
7608
|
+
children: [
|
|
7609
|
+
/* @__PURE__ */ jsx48(Globe, { className: getClassName29("urlIcon"), size: 14 }),
|
|
7610
|
+
/* @__PURE__ */ jsx48(
|
|
7611
|
+
ComboboxInput,
|
|
7612
|
+
{
|
|
7613
|
+
className: getClassName29("urlInput"),
|
|
7614
|
+
placeholder: "/",
|
|
7615
|
+
spellCheck: false,
|
|
7616
|
+
autoCorrect: "off",
|
|
7617
|
+
autoCapitalize: "off"
|
|
7618
|
+
}
|
|
7619
|
+
)
|
|
7620
|
+
]
|
|
7621
|
+
}
|
|
7622
|
+
),
|
|
7623
|
+
/* @__PURE__ */ jsxs19(ComboboxContent, { children: [
|
|
7624
|
+
/* @__PURE__ */ jsx48(ComboboxEmpty, { children: "Press Enter to go to this path" }),
|
|
7625
|
+
/* @__PURE__ */ jsx48(ComboboxList, { children: (path) => {
|
|
7626
|
+
const route = routes.find((r) => r.path === path);
|
|
7627
|
+
return /* @__PURE__ */ jsxs19(ComboboxItem, { value: path, children: [
|
|
7628
|
+
/* @__PURE__ */ jsx48("span", { className: getClassName29("itemPath"), children: path }),
|
|
7629
|
+
(route == null ? void 0 : route.title) ? /* @__PURE__ */ jsx48("span", { className: getClassName29("itemTitle"), children: route.title }) : null
|
|
7630
|
+
] }, path);
|
|
7631
|
+
} })
|
|
7345
7632
|
] })
|
|
7346
7633
|
]
|
|
7347
7634
|
}
|
|
7348
|
-
) : /* @__PURE__ */
|
|
7349
|
-
/* @__PURE__ */
|
|
7350
|
-
/* @__PURE__ */
|
|
7635
|
+
) : /* @__PURE__ */ jsxs19("div", { className: getClassName29("urlTrigger"), children: [
|
|
7636
|
+
/* @__PURE__ */ jsx48(Globe, { className: getClassName29("urlIcon"), size: 14 }),
|
|
7637
|
+
/* @__PURE__ */ jsx48("span", { className: getClassName29("urlText"), children: "/" })
|
|
7351
7638
|
] }),
|
|
7352
|
-
/* @__PURE__ */
|
|
7353
|
-
/* @__PURE__ */
|
|
7639
|
+
/* @__PURE__ */ jsxs19("div", { className: getClassName29("actions"), children: [
|
|
7640
|
+
/* @__PURE__ */ jsx48(
|
|
7354
7641
|
IconButton,
|
|
7355
7642
|
{
|
|
7356
7643
|
type: "button",
|
|
7357
7644
|
title: activeDevice === "desktop" ? "Switch to mobile viewport" : "Switch to desktop viewport",
|
|
7358
7645
|
onClick: () => setDevice(activeDevice === "desktop" ? "mobile" : "desktop"),
|
|
7359
|
-
children: /* @__PURE__ */
|
|
7646
|
+
children: /* @__PURE__ */ jsx48("span", { className: getClassName29("deviceIcon"), children: activeDevice === "desktop" ? /* @__PURE__ */ jsx48(Monitor, { size: 16 }) : /* @__PURE__ */ jsx48(Smartphone, { size: 16 }) })
|
|
7360
7647
|
}
|
|
7361
7648
|
),
|
|
7362
|
-
/* @__PURE__ */
|
|
7649
|
+
/* @__PURE__ */ jsx48(
|
|
7363
7650
|
IconButton,
|
|
7364
7651
|
{
|
|
7365
7652
|
type: "button",
|
|
7366
7653
|
title: isFullScreen ? "Exit full screen" : "Enter full screen",
|
|
7367
7654
|
onClick: toggleFullScreen,
|
|
7368
|
-
children: /* @__PURE__ */
|
|
7655
|
+
children: /* @__PURE__ */ jsx48("span", { className: getClassName29("deviceIcon"), children: isFullScreen ? /* @__PURE__ */ jsx48(Minimize, { size: 16 }) : /* @__PURE__ */ jsx48(Maximize, { size: 16 }) })
|
|
7369
7656
|
}
|
|
7370
7657
|
)
|
|
7371
7658
|
] })
|
|
@@ -7374,7 +7661,7 @@ var BrowserBar = ({
|
|
|
7374
7661
|
|
|
7375
7662
|
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Editor/components/Canvas/styles.module.css#css-module
|
|
7376
7663
|
init_react_import();
|
|
7377
|
-
var
|
|
7664
|
+
var styles_module_default26 = { "EditorCanvas": "_EditorCanvas_es8bv_1", "EditorCanvas-controls": "_EditorCanvas-controls_es8bv_17", "EditorCanvas--fullScreen": "_EditorCanvas--fullScreen_es8bv_22", "EditorCanvas-inner": "_EditorCanvas-inner_es8bv_33", "EditorCanvas-rootColumn": "_EditorCanvas-rootColumn_es8bv_46", "EditorCanvas-root": "_EditorCanvas-root_es8bv_46", "EditorCanvas--ready": "_EditorCanvas--ready_es8bv_83", "EditorCanvas-loader": "_EditorCanvas-loader_es8bv_88", "EditorCanvas--showLoader": "_EditorCanvas--showLoader_es8bv_100", "EditorCanvas-browserBar": "_EditorCanvas-browserBar_es8bv_109", "EditorCanvas-zoomControls": "_EditorCanvas-zoomControls_es8bv_114" };
|
|
7378
7665
|
|
|
7379
7666
|
// components/Editor/components/Canvas/index.tsx
|
|
7380
7667
|
import { useShallow as useShallow9 } from "zustand/react/shallow";
|
|
@@ -7384,22 +7671,22 @@ init_react_import();
|
|
|
7384
7671
|
import {
|
|
7385
7672
|
createContext as createContext7,
|
|
7386
7673
|
useContext as useContext14,
|
|
7387
|
-
useRef as
|
|
7674
|
+
useRef as useRef13,
|
|
7388
7675
|
useMemo as useMemo21
|
|
7389
7676
|
} from "react";
|
|
7390
|
-
import { jsx as
|
|
7677
|
+
import { jsx as jsx49 } from "react/jsx-runtime";
|
|
7391
7678
|
var FrameContext = createContext7(null);
|
|
7392
7679
|
var FrameProvider = ({
|
|
7393
7680
|
children
|
|
7394
7681
|
}) => {
|
|
7395
|
-
const frameRef =
|
|
7682
|
+
const frameRef = useRef13(null);
|
|
7396
7683
|
const value = useMemo21(
|
|
7397
7684
|
() => ({
|
|
7398
7685
|
frameRef
|
|
7399
7686
|
}),
|
|
7400
7687
|
[]
|
|
7401
7688
|
);
|
|
7402
|
-
return /* @__PURE__ */
|
|
7689
|
+
return /* @__PURE__ */ jsx49(FrameContext.Provider, { value, children });
|
|
7403
7690
|
};
|
|
7404
7691
|
var useCanvasFrame = () => {
|
|
7405
7692
|
const context = useContext14(FrameContext);
|
|
@@ -7410,8 +7697,8 @@ var useCanvasFrame = () => {
|
|
|
7410
7697
|
};
|
|
7411
7698
|
|
|
7412
7699
|
// components/Editor/components/Canvas/index.tsx
|
|
7413
|
-
import { Fragment as Fragment13, jsx as
|
|
7414
|
-
var
|
|
7700
|
+
import { Fragment as Fragment13, jsx as jsx50, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
7701
|
+
var getClassName30 = get_class_name_factory_default("EditorCanvas", styles_module_default26);
|
|
7415
7702
|
var ZOOM_STEP = 0.15;
|
|
7416
7703
|
var MIN_ZOOM = 0.25;
|
|
7417
7704
|
var MAX_ZOOM = 3;
|
|
@@ -7446,14 +7733,14 @@ var Canvas = () => {
|
|
|
7446
7733
|
}))
|
|
7447
7734
|
);
|
|
7448
7735
|
const viewports = useAppStore((s) => s.state.ui.viewports);
|
|
7449
|
-
const [canvasZoom, setCanvasZoom] =
|
|
7736
|
+
const [canvasZoom, setCanvasZoom] = useState21(1);
|
|
7450
7737
|
const zoomIn = () => setCanvasZoom((z) => Math.min(z + ZOOM_STEP, MAX_ZOOM));
|
|
7451
7738
|
const zoomOut = () => setCanvasZoom((z) => Math.max(z - ZOOM_STEP, MIN_ZOOM));
|
|
7452
7739
|
const resetZoom = () => setCanvasZoom(1);
|
|
7453
|
-
const [showTransition, setShowTransition] =
|
|
7454
|
-
const isResizingRef =
|
|
7740
|
+
const [showTransition, setShowTransition] = useState21(false);
|
|
7741
|
+
const isResizingRef = useRef14(false);
|
|
7455
7742
|
const defaultRender = useMemo22(() => {
|
|
7456
|
-
const EditorDefault = ({ children }) => /* @__PURE__ */
|
|
7743
|
+
const EditorDefault = ({ children }) => /* @__PURE__ */ jsx50(Fragment13, { children });
|
|
7457
7744
|
return EditorDefault;
|
|
7458
7745
|
}, []);
|
|
7459
7746
|
const CustomPreview = useMemo22(
|
|
@@ -7474,14 +7761,14 @@ var Canvas = () => {
|
|
|
7474
7761
|
setZoomConfig(__spreadProps(__spreadValues({}, zoomConfig), { zoom: 1, rootHeight: frameHeight }));
|
|
7475
7762
|
}
|
|
7476
7763
|
}, [getFrameDimensions, setZoomConfig, viewports.current.height]);
|
|
7477
|
-
const [showLoader, setShowLoader] =
|
|
7764
|
+
const [showLoader, setShowLoader] = useState21(false);
|
|
7478
7765
|
useEffect23(() => {
|
|
7479
7766
|
setTimeout(() => {
|
|
7480
7767
|
setShowLoader(true);
|
|
7481
7768
|
}, 500);
|
|
7482
7769
|
}, []);
|
|
7483
7770
|
const appStoreApi = useAppStoreApi();
|
|
7484
|
-
const autoSelectingRef =
|
|
7771
|
+
const autoSelectingRef = useRef14(true);
|
|
7485
7772
|
const pickClosestViewport = useCallback18(() => {
|
|
7486
7773
|
var _a2, _b2;
|
|
7487
7774
|
if (typeof window === "undefined") return null;
|
|
@@ -7575,10 +7862,10 @@ var Canvas = () => {
|
|
|
7575
7862
|
appStoreApi,
|
|
7576
7863
|
setUi
|
|
7577
7864
|
]);
|
|
7578
|
-
return /* @__PURE__ */
|
|
7865
|
+
return /* @__PURE__ */ jsx50(
|
|
7579
7866
|
"div",
|
|
7580
7867
|
{
|
|
7581
|
-
className:
|
|
7868
|
+
className: getClassName30({
|
|
7582
7869
|
ready: status === "READY" || !iframe.enabled || !iframe.waitForStyles,
|
|
7583
7870
|
showLoader,
|
|
7584
7871
|
fullScreen: fullScreenCanvas
|
|
@@ -7593,16 +7880,16 @@ var Canvas = () => {
|
|
|
7593
7880
|
});
|
|
7594
7881
|
}
|
|
7595
7882
|
},
|
|
7596
|
-
children: /* @__PURE__ */
|
|
7597
|
-
!disableZoomControls && /* @__PURE__ */
|
|
7598
|
-
/* @__PURE__ */
|
|
7599
|
-
/* @__PURE__ */
|
|
7600
|
-
/* @__PURE__ */
|
|
7883
|
+
children: /* @__PURE__ */ jsxs20("div", { className: getClassName30("inner"), ref: frameRef, children: [
|
|
7884
|
+
!disableZoomControls && /* @__PURE__ */ jsxs20("div", { className: getClassName30("zoomControls"), children: [
|
|
7885
|
+
/* @__PURE__ */ jsx50(IconButton, { type: "button", title: "Zoom out", onClick: zoomOut, children: /* @__PURE__ */ jsx50(Minus, { size: 14 }) }),
|
|
7886
|
+
/* @__PURE__ */ jsx50(IconButton, { type: "button", title: "Reset zoom", onClick: resetZoom, children: /* @__PURE__ */ jsx50(RotateCcw, { size: 14 }) }),
|
|
7887
|
+
/* @__PURE__ */ jsx50(IconButton, { type: "button", title: "Zoom in", onClick: zoomIn, children: /* @__PURE__ */ jsx50(Plus, { size: 14 }) })
|
|
7601
7888
|
] }),
|
|
7602
|
-
/* @__PURE__ */
|
|
7889
|
+
/* @__PURE__ */ jsxs20(
|
|
7603
7890
|
"div",
|
|
7604
7891
|
{
|
|
7605
|
-
className:
|
|
7892
|
+
className: getClassName30("rootColumn"),
|
|
7606
7893
|
style: {
|
|
7607
7894
|
width: iframe.enabled ? viewports.current.width : "100%",
|
|
7608
7895
|
transform: disableZoomControls ? void 0 : `scale(${canvasZoom})`,
|
|
@@ -7610,7 +7897,7 @@ var Canvas = () => {
|
|
|
7610
7897
|
transition: showTransition ? `width ${TRANSITION_DURATION}ms ease-out, transform ${TRANSITION_DURATION}ms ease-out` : disableZoomControls ? void 0 : "transform 150ms ease-out"
|
|
7611
7898
|
},
|
|
7612
7899
|
children: [
|
|
7613
|
-
iframe.enabled && /* @__PURE__ */
|
|
7900
|
+
iframe.enabled && /* @__PURE__ */ jsx50("div", { className: getClassName30("browserBar"), children: /* @__PURE__ */ jsx50(
|
|
7614
7901
|
BrowserBar,
|
|
7615
7902
|
{
|
|
7616
7903
|
onViewportChange: (viewport) => {
|
|
@@ -7627,23 +7914,23 @@ var Canvas = () => {
|
|
|
7627
7914
|
}
|
|
7628
7915
|
}
|
|
7629
7916
|
) }),
|
|
7630
|
-
/* @__PURE__ */
|
|
7917
|
+
/* @__PURE__ */ jsx50(
|
|
7631
7918
|
"div",
|
|
7632
7919
|
{
|
|
7633
|
-
className:
|
|
7920
|
+
className: getClassName30("root"),
|
|
7634
7921
|
suppressHydrationWarning: true,
|
|
7635
7922
|
id: "editor-canvas-root",
|
|
7636
7923
|
onTransitionEnd: () => {
|
|
7637
7924
|
setShowTransition(false);
|
|
7638
7925
|
isResizingRef.current = false;
|
|
7639
7926
|
},
|
|
7640
|
-
children: /* @__PURE__ */
|
|
7927
|
+
children: /* @__PURE__ */ jsx50(CustomPreview, { children: /* @__PURE__ */ jsx50(Preview2, {}) })
|
|
7641
7928
|
}
|
|
7642
7929
|
)
|
|
7643
7930
|
]
|
|
7644
7931
|
}
|
|
7645
7932
|
),
|
|
7646
|
-
/* @__PURE__ */
|
|
7933
|
+
/* @__PURE__ */ jsx50("div", { className: getClassName30("loader"), children: /* @__PURE__ */ jsx50(Loader, { size: 24 }) })
|
|
7647
7934
|
] })
|
|
7648
7935
|
}
|
|
7649
7936
|
);
|
|
@@ -7651,10 +7938,10 @@ var Canvas = () => {
|
|
|
7651
7938
|
|
|
7652
7939
|
// lib/use-sidebar-resize.ts
|
|
7653
7940
|
init_react_import();
|
|
7654
|
-
import { useCallback as useCallback19, useEffect as useEffect24, useRef as
|
|
7941
|
+
import { useCallback as useCallback19, useEffect as useEffect24, useRef as useRef15, useState as useState22 } from "react";
|
|
7655
7942
|
function useSidebarResize(position, dispatch) {
|
|
7656
|
-
const [width, setWidth] =
|
|
7657
|
-
const sidebarRef =
|
|
7943
|
+
const [width, setWidth] = useState22(null);
|
|
7944
|
+
const sidebarRef = useRef15(null);
|
|
7658
7945
|
const storeWidth = useAppStore(
|
|
7659
7946
|
(s) => position === "left" ? s.state.ui.leftSideBarWidth : s.state.ui.rightSideBarWidth
|
|
7660
7947
|
);
|
|
@@ -7735,25 +8022,25 @@ init_react_import();
|
|
|
7735
8022
|
|
|
7736
8023
|
// components/Editor/components/ResizeHandle/index.tsx
|
|
7737
8024
|
init_react_import();
|
|
7738
|
-
import { useCallback as useCallback20, useRef as
|
|
8025
|
+
import { useCallback as useCallback20, useRef as useRef16 } from "react";
|
|
7739
8026
|
|
|
7740
8027
|
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Editor/components/ResizeHandle/styles.module.css#css-module
|
|
7741
8028
|
init_react_import();
|
|
7742
|
-
var
|
|
8029
|
+
var styles_module_default27 = { "ResizeHandle": "_ResizeHandle_1u3rv_2", "ResizeHandle--left": "_ResizeHandle--left_1u3rv_16", "ResizeHandle--right": "_ResizeHandle--right_1u3rv_20" };
|
|
7743
8030
|
|
|
7744
8031
|
// components/Editor/components/ResizeHandle/index.tsx
|
|
7745
|
-
import { jsx as
|
|
7746
|
-
var
|
|
8032
|
+
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
8033
|
+
var getClassName31 = get_class_name_factory_default("ResizeHandle", styles_module_default27);
|
|
7747
8034
|
var ResizeHandle = ({
|
|
7748
8035
|
position,
|
|
7749
8036
|
sidebarRef,
|
|
7750
8037
|
onResize,
|
|
7751
8038
|
onResizeEnd
|
|
7752
8039
|
}) => {
|
|
7753
|
-
const handleRef =
|
|
7754
|
-
const isDragging =
|
|
7755
|
-
const startX =
|
|
7756
|
-
const startWidth =
|
|
8040
|
+
const handleRef = useRef16(null);
|
|
8041
|
+
const isDragging = useRef16(false);
|
|
8042
|
+
const startX = useRef16(0);
|
|
8043
|
+
const startWidth = useRef16(0);
|
|
7757
8044
|
const handleMouseMove = useCallback20(
|
|
7758
8045
|
(e) => {
|
|
7759
8046
|
if (!isDragging.current) return;
|
|
@@ -7798,11 +8085,11 @@ var ResizeHandle = ({
|
|
|
7798
8085
|
},
|
|
7799
8086
|
[position, handleMouseMove, handleMouseUp]
|
|
7800
8087
|
);
|
|
7801
|
-
return /* @__PURE__ */
|
|
8088
|
+
return /* @__PURE__ */ jsx51(
|
|
7802
8089
|
"div",
|
|
7803
8090
|
{
|
|
7804
8091
|
ref: handleRef,
|
|
7805
|
-
className:
|
|
8092
|
+
className: getClassName31({ [position]: true }),
|
|
7806
8093
|
onMouseDown: handleMouseDown
|
|
7807
8094
|
}
|
|
7808
8095
|
);
|
|
@@ -7810,11 +8097,11 @@ var ResizeHandle = ({
|
|
|
7810
8097
|
|
|
7811
8098
|
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Editor/components/Sidebar/styles.module.css#css-module
|
|
7812
8099
|
init_react_import();
|
|
7813
|
-
var
|
|
8100
|
+
var styles_module_default28 = { "Sidebar": "_Sidebar_14k7q_1", "Sidebar--isVisible": "_Sidebar--isVisible_14k7q_9", "Sidebar--left": "_Sidebar--left_14k7q_13", "Sidebar--right": "_Sidebar--right_14k7q_25", "Sidebar-resizeHandle": "_Sidebar-resizeHandle_14k7q_37" };
|
|
7814
8101
|
|
|
7815
8102
|
// components/Editor/components/Sidebar/index.tsx
|
|
7816
|
-
import { Fragment as Fragment14, jsx as
|
|
7817
|
-
var
|
|
8103
|
+
import { Fragment as Fragment14, jsx as jsx52, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
8104
|
+
var getClassName32 = get_class_name_factory_default("Sidebar", styles_module_default28);
|
|
7818
8105
|
var Sidebar = ({
|
|
7819
8106
|
position,
|
|
7820
8107
|
sidebarRef,
|
|
@@ -7823,16 +8110,16 @@ var Sidebar = ({
|
|
|
7823
8110
|
onResizeEnd,
|
|
7824
8111
|
children
|
|
7825
8112
|
}) => {
|
|
7826
|
-
return /* @__PURE__ */
|
|
7827
|
-
/* @__PURE__ */
|
|
8113
|
+
return /* @__PURE__ */ jsxs21(Fragment14, { children: [
|
|
8114
|
+
/* @__PURE__ */ jsx52(
|
|
7828
8115
|
"div",
|
|
7829
8116
|
{
|
|
7830
8117
|
ref: sidebarRef,
|
|
7831
|
-
className:
|
|
8118
|
+
className: getClassName32({ [position]: true, isVisible }),
|
|
7832
8119
|
children
|
|
7833
8120
|
}
|
|
7834
8121
|
),
|
|
7835
|
-
/* @__PURE__ */
|
|
8122
|
+
/* @__PURE__ */ jsx52("div", { className: `${getClassName32("resizeHandle")}`, children: /* @__PURE__ */ jsx52(
|
|
7836
8123
|
ResizeHandle,
|
|
7837
8124
|
{
|
|
7838
8125
|
position,
|
|
@@ -7847,6 +8134,9 @@ var Sidebar = ({
|
|
|
7847
8134
|
// lib/use-delete-hotkeys.ts
|
|
7848
8135
|
init_react_import();
|
|
7849
8136
|
import { useCallback as useCallback21 } from "react";
|
|
8137
|
+
|
|
8138
|
+
// lib/should-block-editing-hotkey.ts
|
|
8139
|
+
init_react_import();
|
|
7850
8140
|
var isElementVisible = (element) => {
|
|
7851
8141
|
let current = element;
|
|
7852
8142
|
while (current && current !== document.body) {
|
|
@@ -7858,7 +8148,7 @@ var isElementVisible = (element) => {
|
|
|
7858
8148
|
}
|
|
7859
8149
|
return true;
|
|
7860
8150
|
};
|
|
7861
|
-
var
|
|
8151
|
+
var shouldBlockEditingHotkey = (e) => {
|
|
7862
8152
|
var _a;
|
|
7863
8153
|
if (e == null ? void 0 : e.defaultPrevented) return true;
|
|
7864
8154
|
const origin = ((_a = e == null ? void 0 : e.composedPath) == null ? void 0 : _a.call(e)[0]) || (e == null ? void 0 : e.target) || document.activeElement;
|
|
@@ -7879,12 +8169,14 @@ var shouldBlockDeleteHotkey = (e) => {
|
|
|
7879
8169
|
}
|
|
7880
8170
|
return false;
|
|
7881
8171
|
};
|
|
8172
|
+
|
|
8173
|
+
// lib/use-delete-hotkeys.ts
|
|
7882
8174
|
var useDeleteHotkeys = () => {
|
|
7883
8175
|
const appStore = useAppStoreApi();
|
|
7884
8176
|
const deleteSelectedComponent = useCallback21(
|
|
7885
8177
|
(e) => {
|
|
7886
8178
|
var _a;
|
|
7887
|
-
if (
|
|
8179
|
+
if (shouldBlockEditingHotkey(e)) {
|
|
7888
8180
|
return false;
|
|
7889
8181
|
}
|
|
7890
8182
|
const { state, dispatch, permissions, selectedItem } = appStore.getState();
|
|
@@ -7905,17 +8197,109 @@ var useDeleteHotkeys = () => {
|
|
|
7905
8197
|
useHotkey({ backspace: true }, deleteSelectedComponent);
|
|
7906
8198
|
};
|
|
7907
8199
|
|
|
8200
|
+
// lib/use-clipboard-hotkeys.ts
|
|
8201
|
+
init_react_import();
|
|
8202
|
+
import { useCallback as useCallback22 } from "react";
|
|
8203
|
+
var CLIPBOARD_MARKER = "reacteditor/component";
|
|
8204
|
+
var isComponentData = (value) => {
|
|
8205
|
+
var _a;
|
|
8206
|
+
if (!value || typeof value !== "object") return false;
|
|
8207
|
+
const v = value;
|
|
8208
|
+
return typeof v.type === "string" && typeof ((_a = v.props) == null ? void 0 : _a.id) === "string";
|
|
8209
|
+
};
|
|
8210
|
+
var parsePayload = (text) => {
|
|
8211
|
+
try {
|
|
8212
|
+
const parsed = JSON.parse(text);
|
|
8213
|
+
if (parsed && typeof parsed === "object" && parsed.__reactEditor === CLIPBOARD_MARKER && isComponentData(parsed.data)) {
|
|
8214
|
+
return parsed.data;
|
|
8215
|
+
}
|
|
8216
|
+
} catch (e) {
|
|
8217
|
+
}
|
|
8218
|
+
return null;
|
|
8219
|
+
};
|
|
8220
|
+
var useClipboardHotkeys = () => {
|
|
8221
|
+
const appStore = useAppStoreApi();
|
|
8222
|
+
const writeSelectionToClipboard = useCallback22(() => {
|
|
8223
|
+
var _a;
|
|
8224
|
+
const { selectedItem } = appStore.getState();
|
|
8225
|
+
if (!selectedItem) return false;
|
|
8226
|
+
const payload = {
|
|
8227
|
+
__reactEditor: CLIPBOARD_MARKER,
|
|
8228
|
+
data: selectedItem
|
|
8229
|
+
};
|
|
8230
|
+
(_a = navigator.clipboard) == null ? void 0 : _a.writeText(JSON.stringify(payload)).catch(() => {
|
|
8231
|
+
});
|
|
8232
|
+
return true;
|
|
8233
|
+
}, [appStore]);
|
|
8234
|
+
const copySelectedComponent = useCallback22(
|
|
8235
|
+
(e) => {
|
|
8236
|
+
if (shouldBlockEditingHotkey(e)) return false;
|
|
8237
|
+
return writeSelectionToClipboard();
|
|
8238
|
+
},
|
|
8239
|
+
[writeSelectionToClipboard]
|
|
8240
|
+
);
|
|
8241
|
+
const cutSelectedComponent = useCallback22(
|
|
8242
|
+
(e) => {
|
|
8243
|
+
var _a;
|
|
8244
|
+
if (shouldBlockEditingHotkey(e)) return false;
|
|
8245
|
+
const { state, dispatch, permissions, selectedItem } = appStore.getState();
|
|
8246
|
+
const sel = (_a = state.ui) == null ? void 0 : _a.itemSelector;
|
|
8247
|
+
if (!(sel == null ? void 0 : sel.zone) || !selectedItem) return false;
|
|
8248
|
+
if (!permissions.getPermissions({ item: selectedItem }).delete)
|
|
8249
|
+
return true;
|
|
8250
|
+
if (!writeSelectionToClipboard()) return false;
|
|
8251
|
+
dispatch({
|
|
8252
|
+
type: "remove",
|
|
8253
|
+
index: sel.index,
|
|
8254
|
+
zone: sel.zone
|
|
8255
|
+
});
|
|
8256
|
+
return true;
|
|
8257
|
+
},
|
|
8258
|
+
[appStore, writeSelectionToClipboard]
|
|
8259
|
+
);
|
|
8260
|
+
const pasteComponent = useCallback22(
|
|
8261
|
+
(e) => {
|
|
8262
|
+
var _a, _b;
|
|
8263
|
+
if (shouldBlockEditingHotkey(e)) return false;
|
|
8264
|
+
const { state, dispatch, config } = appStore.getState();
|
|
8265
|
+
const sel = (_a = state.ui) == null ? void 0 : _a.itemSelector;
|
|
8266
|
+
if (!(sel == null ? void 0 : sel.zone)) return false;
|
|
8267
|
+
(_b = navigator.clipboard) == null ? void 0 : _b.readText().then((text) => {
|
|
8268
|
+
const data = parsePayload(text);
|
|
8269
|
+
if (!data) return;
|
|
8270
|
+
if (!config.components[data.type]) return;
|
|
8271
|
+
dispatch({
|
|
8272
|
+
type: "insert",
|
|
8273
|
+
componentType: data.type,
|
|
8274
|
+
destinationIndex: sel.index + 1,
|
|
8275
|
+
destinationZone: sel.zone,
|
|
8276
|
+
data
|
|
8277
|
+
});
|
|
8278
|
+
}).catch(() => {
|
|
8279
|
+
});
|
|
8280
|
+
return true;
|
|
8281
|
+
},
|
|
8282
|
+
[appStore]
|
|
8283
|
+
);
|
|
8284
|
+
useHotkey({ meta: true, c: true }, copySelectedComponent);
|
|
8285
|
+
useHotkey({ ctrl: true, c: true }, copySelectedComponent);
|
|
8286
|
+
useHotkey({ meta: true, v: true }, pasteComponent);
|
|
8287
|
+
useHotkey({ ctrl: true, v: true }, pasteComponent);
|
|
8288
|
+
useHotkey({ meta: true, x: true }, cutSelectedComponent);
|
|
8289
|
+
useHotkey({ ctrl: true, x: true }, cutSelectedComponent);
|
|
8290
|
+
};
|
|
8291
|
+
|
|
7908
8292
|
// components/Editor/components/Nav/index.tsx
|
|
7909
8293
|
init_react_import();
|
|
7910
8294
|
|
|
7911
8295
|
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Editor/components/Nav/styles.module.css#css-module
|
|
7912
8296
|
init_react_import();
|
|
7913
|
-
var
|
|
8297
|
+
var styles_module_default29 = { "Nav": "_Nav_1g4tk_1", "Nav-list": "_Nav-list_1g4tk_18", "Nav-footer": "_Nav-footer_1g4tk_42", "NavItem-link": "_NavItem-link_1g4tk_55", "NavItem-linkLabel": "_NavItem-linkLabel_1g4tk_83", "NavItem": "_NavItem_1g4tk_55", "NavItem-linkIcon": "_NavItem-linkIcon_1g4tk_108", "NavItem--active": "_NavItem--active_1g4tk_121", "NavItem--mobileOnly": "_NavItem--mobileOnly_1g4tk_132", "NavItem--desktopOnly": "_NavItem--desktopOnly_1g4tk_137" };
|
|
7914
8298
|
|
|
7915
8299
|
// components/Editor/components/Nav/index.tsx
|
|
7916
|
-
import { jsx as
|
|
7917
|
-
var
|
|
7918
|
-
var getClassNameItem3 = get_class_name_factory_default("NavItem",
|
|
8300
|
+
import { jsx as jsx53, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
8301
|
+
var getClassName33 = get_class_name_factory_default("Nav", styles_module_default29);
|
|
8302
|
+
var getClassNameItem3 = get_class_name_factory_default("NavItem", styles_module_default29);
|
|
7919
8303
|
var MenuItem = ({
|
|
7920
8304
|
label,
|
|
7921
8305
|
icon,
|
|
@@ -7924,7 +8308,7 @@ var MenuItem = ({
|
|
|
7924
8308
|
mobileOnly,
|
|
7925
8309
|
desktopOnly
|
|
7926
8310
|
}) => {
|
|
7927
|
-
return /* @__PURE__ */
|
|
8311
|
+
return /* @__PURE__ */ jsx53(
|
|
7928
8312
|
"li",
|
|
7929
8313
|
{
|
|
7930
8314
|
className: getClassNameItem3({
|
|
@@ -7932,9 +8316,9 @@ var MenuItem = ({
|
|
|
7932
8316
|
mobileOnly,
|
|
7933
8317
|
desktopOnly
|
|
7934
8318
|
}),
|
|
7935
|
-
children: onClick && /* @__PURE__ */
|
|
7936
|
-
icon && /* @__PURE__ */
|
|
7937
|
-
/* @__PURE__ */
|
|
8319
|
+
children: onClick && /* @__PURE__ */ jsxs22("div", { className: getClassNameItem3("link"), onClick, children: [
|
|
8320
|
+
icon && /* @__PURE__ */ jsx53("span", { className: getClassNameItem3("linkIcon"), children: icon }),
|
|
8321
|
+
/* @__PURE__ */ jsx53("span", { className: getClassNameItem3("linkLabel"), children: label })
|
|
7938
8322
|
] })
|
|
7939
8323
|
}
|
|
7940
8324
|
);
|
|
@@ -7943,15 +8327,15 @@ var Nav = ({
|
|
|
7943
8327
|
items,
|
|
7944
8328
|
footer
|
|
7945
8329
|
}) => {
|
|
7946
|
-
return /* @__PURE__ */
|
|
7947
|
-
/* @__PURE__ */
|
|
7948
|
-
footer && /* @__PURE__ */
|
|
8330
|
+
return /* @__PURE__ */ jsxs22("nav", { className: getClassName33(), children: [
|
|
8331
|
+
/* @__PURE__ */ jsx53("ul", { className: getClassName33("list"), children: Object.entries(items).map(([key, item]) => /* @__PURE__ */ jsx53(MenuItem, __spreadValues({}, item), key)) }),
|
|
8332
|
+
footer && /* @__PURE__ */ jsx53("div", { className: getClassName33("footer"), children: footer })
|
|
7949
8333
|
] });
|
|
7950
8334
|
};
|
|
7951
8335
|
|
|
7952
8336
|
// components/Editor/components/Layout/index.tsx
|
|
7953
|
-
import { Fragment as Fragment15, jsx as
|
|
7954
|
-
var
|
|
8337
|
+
import { Fragment as Fragment15, jsx as jsx54, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
8338
|
+
var getClassName34 = get_class_name_factory_default("Editor", styles_module_default22);
|
|
7955
8339
|
var getLayoutClassName = get_class_name_factory_default("EditorLayout", styles_module_default22);
|
|
7956
8340
|
var getPluginTabClassName = get_class_name_factory_default("EditorPluginTab", styles_module_default22);
|
|
7957
8341
|
var FieldSideBarToolbar = () => {
|
|
@@ -7964,30 +8348,30 @@ var FieldSideBarToolbar = () => {
|
|
|
7964
8348
|
const CustomHeaderActions = useAppStore(
|
|
7965
8349
|
(s) => s.overrides.headerActions || DefaultOverride
|
|
7966
8350
|
);
|
|
7967
|
-
return /* @__PURE__ */
|
|
7968
|
-
/* @__PURE__ */
|
|
7969
|
-
/* @__PURE__ */
|
|
8351
|
+
return /* @__PURE__ */ jsxs23("div", { className: getClassName34("fieldSideBarToolbar"), children: [
|
|
8352
|
+
/* @__PURE__ */ jsxs23("div", { className: getClassName34("fieldSideBarHistory"), children: [
|
|
8353
|
+
/* @__PURE__ */ jsx54(
|
|
7970
8354
|
IconButton,
|
|
7971
8355
|
{
|
|
7972
8356
|
type: "button",
|
|
7973
8357
|
title: "undo",
|
|
7974
8358
|
disabled: !hasPast,
|
|
7975
8359
|
onClick: back,
|
|
7976
|
-
children: /* @__PURE__ */
|
|
8360
|
+
children: /* @__PURE__ */ jsx54(Undo2, { size: 18 })
|
|
7977
8361
|
}
|
|
7978
8362
|
),
|
|
7979
|
-
/* @__PURE__ */
|
|
8363
|
+
/* @__PURE__ */ jsx54(
|
|
7980
8364
|
IconButton,
|
|
7981
8365
|
{
|
|
7982
8366
|
type: "button",
|
|
7983
8367
|
title: "redo",
|
|
7984
8368
|
disabled: !hasFuture,
|
|
7985
8369
|
onClick: forward,
|
|
7986
|
-
children: /* @__PURE__ */
|
|
8370
|
+
children: /* @__PURE__ */ jsx54(Redo2, { size: 18 })
|
|
7987
8371
|
}
|
|
7988
8372
|
)
|
|
7989
8373
|
] }),
|
|
7990
|
-
/* @__PURE__ */
|
|
8374
|
+
/* @__PURE__ */ jsx54("div", { className: getClassName34("fieldSideBarActions"), children: /* @__PURE__ */ jsx54(CustomHeaderActions, { children: /* @__PURE__ */ jsx54(
|
|
7991
8375
|
Button,
|
|
7992
8376
|
{
|
|
7993
8377
|
onClick: () => {
|
|
@@ -8006,9 +8390,9 @@ var FieldSideBar = () => {
|
|
|
8006
8390
|
return s.selectedItem ? (_b = (_a = s.config.components[s.selectedItem.type]) == null ? void 0 : _a["label"]) != null ? _b : s.selectedItem.type.toString() : ((_c = s.config.root) == null ? void 0 : _c.label) || "Page";
|
|
8007
8391
|
}
|
|
8008
8392
|
);
|
|
8009
|
-
return /* @__PURE__ */
|
|
8010
|
-
/* @__PURE__ */
|
|
8011
|
-
/* @__PURE__ */
|
|
8393
|
+
return /* @__PURE__ */ jsxs23(Fragment15, { children: [
|
|
8394
|
+
/* @__PURE__ */ jsx54(FieldSideBarToolbar, {}),
|
|
8395
|
+
/* @__PURE__ */ jsx54(SidebarSection, { noBorderTop: true, showBreadcrumbs: true, title, children: /* @__PURE__ */ jsx54(Fields, {}) })
|
|
8012
8396
|
] });
|
|
8013
8397
|
};
|
|
8014
8398
|
var PluginTab = ({
|
|
@@ -8016,7 +8400,7 @@ var PluginTab = ({
|
|
|
8016
8400
|
visible,
|
|
8017
8401
|
mobileOnly
|
|
8018
8402
|
}) => {
|
|
8019
|
-
return /* @__PURE__ */
|
|
8403
|
+
return /* @__PURE__ */ jsx54("div", { className: getPluginTabClassName({ visible, mobileOnly }), children: /* @__PURE__ */ jsx54("div", { className: getPluginTabClassName("body"), children }) });
|
|
8020
8404
|
};
|
|
8021
8405
|
var Layout = ({ children }) => {
|
|
8022
8406
|
const {
|
|
@@ -8080,7 +8464,7 @@ var Layout = ({ children }) => {
|
|
|
8080
8464
|
() => overrides.editor || DefaultOverride,
|
|
8081
8465
|
[overrides]
|
|
8082
8466
|
);
|
|
8083
|
-
const [mounted, setMounted] =
|
|
8467
|
+
const [mounted, setMounted] = useState23(false);
|
|
8084
8468
|
useEffect25(() => {
|
|
8085
8469
|
setMounted(true);
|
|
8086
8470
|
}, []);
|
|
@@ -8096,12 +8480,13 @@ var Layout = ({ children }) => {
|
|
|
8096
8480
|
}, [ready, iframe.enabled]);
|
|
8097
8481
|
usePreviewModeHotkeys();
|
|
8098
8482
|
useDeleteHotkeys();
|
|
8483
|
+
useClipboardHotkeys();
|
|
8099
8484
|
const layoutOptions = {};
|
|
8100
8485
|
if (leftWidth) {
|
|
8101
|
-
layoutOptions["--
|
|
8486
|
+
layoutOptions["--editor-user-left-side-bar-width"] = `${leftWidth}px`;
|
|
8102
8487
|
}
|
|
8103
8488
|
if (rightWidth) {
|
|
8104
|
-
layoutOptions["--
|
|
8489
|
+
layoutOptions["--editor-user-right-side-bar-width"] = `${rightWidth}px`;
|
|
8105
8490
|
}
|
|
8106
8491
|
const setUi = useAppStore((s) => s.setUi);
|
|
8107
8492
|
const currentPlugin = useAppStore((s) => {
|
|
@@ -8109,15 +8494,15 @@ var Layout = ({ children }) => {
|
|
|
8109
8494
|
return (_a = s.state.ui.plugin) == null ? void 0 : _a.current;
|
|
8110
8495
|
});
|
|
8111
8496
|
const appStoreApi = useAppStoreApi();
|
|
8112
|
-
const [mobilePanelHeightMode, setMobilePanelHeightMode] =
|
|
8113
|
-
const [mobilePanelHeight, setMobilePanelHeight] =
|
|
8497
|
+
const [mobilePanelHeightMode, setMobilePanelHeightMode] = useState23("toggle");
|
|
8498
|
+
const [mobilePanelHeight, setMobilePanelHeight] = useState23(
|
|
8114
8499
|
null
|
|
8115
8500
|
);
|
|
8116
|
-
const mobilePanelRef =
|
|
8117
|
-
const isDraggingMobile =
|
|
8118
|
-
const dragStartY =
|
|
8119
|
-
const dragStartHeight =
|
|
8120
|
-
const handleMobileDragStart =
|
|
8501
|
+
const mobilePanelRef = useRef17(null);
|
|
8502
|
+
const isDraggingMobile = useRef17(false);
|
|
8503
|
+
const dragStartY = useRef17(0);
|
|
8504
|
+
const dragStartHeight = useRef17(0);
|
|
8505
|
+
const handleMobileDragStart = useCallback23(
|
|
8121
8506
|
(clientY) => {
|
|
8122
8507
|
isDraggingMobile.current = true;
|
|
8123
8508
|
dragStartY.current = clientY;
|
|
@@ -8128,7 +8513,7 @@ var Layout = ({ children }) => {
|
|
|
8128
8513
|
},
|
|
8129
8514
|
[]
|
|
8130
8515
|
);
|
|
8131
|
-
const handleMobileDragMove =
|
|
8516
|
+
const handleMobileDragMove = useCallback23((clientY) => {
|
|
8132
8517
|
if (!isDraggingMobile.current) return;
|
|
8133
8518
|
const delta = dragStartY.current - clientY;
|
|
8134
8519
|
const viewportHeight = window.innerHeight;
|
|
@@ -8137,7 +8522,7 @@ var Layout = ({ children }) => {
|
|
|
8137
8522
|
const newH = Math.min(maxH, Math.max(minH, dragStartHeight.current + delta));
|
|
8138
8523
|
setMobilePanelHeight(newH);
|
|
8139
8524
|
}, []);
|
|
8140
|
-
const handleMobileDragEnd =
|
|
8525
|
+
const handleMobileDragEnd = useCallback23(() => {
|
|
8141
8526
|
if (!isDraggingMobile.current) return;
|
|
8142
8527
|
isDraggingMobile.current = false;
|
|
8143
8528
|
document.body.style.userSelect = "";
|
|
@@ -8169,7 +8554,7 @@ var Layout = ({ children }) => {
|
|
|
8169
8554
|
document.removeEventListener("mouseup", onMouseUp);
|
|
8170
8555
|
};
|
|
8171
8556
|
}, [handleMobileDragMove, handleMobileDragEnd]);
|
|
8172
|
-
const [theme, setTheme] =
|
|
8557
|
+
const [theme, setTheme] = useState23(() => {
|
|
8173
8558
|
if (typeof window === "undefined") return "light";
|
|
8174
8559
|
const stored = window.localStorage.getItem("editor-theme");
|
|
8175
8560
|
if (stored === "light" || stored === "dark") return stored;
|
|
@@ -8182,7 +8567,7 @@ var Layout = ({ children }) => {
|
|
|
8182
8567
|
const toggleTheme = () => {
|
|
8183
8568
|
setTheme((t) => t === "dark" ? "light" : "dark");
|
|
8184
8569
|
};
|
|
8185
|
-
const themeIcon = theme === "dark" ? /* @__PURE__ */
|
|
8570
|
+
const themeIcon = theme === "dark" ? /* @__PURE__ */ jsx54(Sun, { size: 18 }) : /* @__PURE__ */ jsx54(Moon, { size: 18 });
|
|
8186
8571
|
const themeLabel = theme === "dark" ? "Switch to light mode" : "Switch to dark mode";
|
|
8187
8572
|
const hasLegacySideBarPlugin = useMemo23(
|
|
8188
8573
|
() => !!(plugins == null ? void 0 : plugins.find((p) => p.name === "legacy-side-bar")),
|
|
@@ -8207,7 +8592,7 @@ var Layout = ({ children }) => {
|
|
|
8207
8592
|
}
|
|
8208
8593
|
details[plugin.name] = {
|
|
8209
8594
|
label: (_a = plugin.label) != null ? _a : plugin.name,
|
|
8210
|
-
icon: (_b = plugin.icon) != null ? _b : /* @__PURE__ */
|
|
8595
|
+
icon: (_b = plugin.icon) != null ? _b : /* @__PURE__ */ jsx54(ToyBrick, {}),
|
|
8211
8596
|
onClick: () => {
|
|
8212
8597
|
var _a2;
|
|
8213
8598
|
setMobilePanelHeightMode((_a2 = plugin.mobilePanelHeight) != null ? _a2 : "toggle");
|
|
@@ -8244,19 +8629,19 @@ var Layout = ({ children }) => {
|
|
|
8244
8629
|
const hasDesktopFieldsPlugin = pluginItems["fields"] && pluginItems["fields"].mobileOnly === false;
|
|
8245
8630
|
const mobilePanelStyle = {};
|
|
8246
8631
|
if (mobilePanelHeight && leftSideBarVisible) {
|
|
8247
|
-
mobilePanelStyle["--
|
|
8632
|
+
mobilePanelStyle["--editor-mobile-panel-height"] = `${mobilePanelHeight}px`;
|
|
8248
8633
|
}
|
|
8249
|
-
return /* @__PURE__ */
|
|
8634
|
+
return /* @__PURE__ */ jsxs23(
|
|
8250
8635
|
"div",
|
|
8251
8636
|
{
|
|
8252
|
-
className: `Editor ${
|
|
8637
|
+
className: `Editor ${getClassName34({
|
|
8253
8638
|
hidePlugins: hasLegacySideBarPlugin
|
|
8254
8639
|
})}`,
|
|
8255
8640
|
id: instanceId,
|
|
8256
8641
|
"data-theme": theme,
|
|
8257
8642
|
style: { height },
|
|
8258
8643
|
children: [
|
|
8259
|
-
/* @__PURE__ */
|
|
8644
|
+
/* @__PURE__ */ jsx54(DragDropContext, { disableAutoScroll: dnd == null ? void 0 : dnd.disableAutoScroll, children: /* @__PURE__ */ jsx54(CustomEditor, { children: children || /* @__PURE__ */ jsx54(FrameProvider, { children: /* @__PURE__ */ jsx54(
|
|
8260
8645
|
"div",
|
|
8261
8646
|
{
|
|
8262
8647
|
className: getLayoutClassName({
|
|
@@ -8268,17 +8653,17 @@ var Layout = ({ children }) => {
|
|
|
8268
8653
|
mobilePanelCustomHeight: mobilePanelHeight !== null && leftSideBarVisible
|
|
8269
8654
|
}),
|
|
8270
8655
|
style: { height },
|
|
8271
|
-
children: /* @__PURE__ */
|
|
8656
|
+
children: /* @__PURE__ */ jsxs23(
|
|
8272
8657
|
"div",
|
|
8273
8658
|
{
|
|
8274
8659
|
className: getLayoutClassName("inner"),
|
|
8275
8660
|
style: __spreadValues(__spreadValues({}, layoutOptions), mobilePanelStyle),
|
|
8276
8661
|
children: [
|
|
8277
|
-
/* @__PURE__ */
|
|
8662
|
+
/* @__PURE__ */ jsx54("div", { className: getLayoutClassName("nav"), children: /* @__PURE__ */ jsx54(
|
|
8278
8663
|
Nav,
|
|
8279
8664
|
{
|
|
8280
8665
|
items: pluginItems,
|
|
8281
|
-
footer: /* @__PURE__ */
|
|
8666
|
+
footer: /* @__PURE__ */ jsx54(
|
|
8282
8667
|
IconButton,
|
|
8283
8668
|
{
|
|
8284
8669
|
type: "button",
|
|
@@ -8289,19 +8674,19 @@ var Layout = ({ children }) => {
|
|
|
8289
8674
|
)
|
|
8290
8675
|
}
|
|
8291
8676
|
) }),
|
|
8292
|
-
/* @__PURE__ */
|
|
8677
|
+
/* @__PURE__ */ jsxs23(
|
|
8293
8678
|
"div",
|
|
8294
8679
|
{
|
|
8295
8680
|
ref: mobilePanelRef,
|
|
8296
8681
|
className: getLayoutClassName("mobilePanel"),
|
|
8297
8682
|
children: [
|
|
8298
|
-
/* @__PURE__ */
|
|
8683
|
+
/* @__PURE__ */ jsx54(
|
|
8299
8684
|
"div",
|
|
8300
8685
|
{
|
|
8301
8686
|
className: getLayoutClassName("mobileDragHandle"),
|
|
8302
8687
|
onTouchStart: (e) => handleMobileDragStart(e.touches[0].clientY),
|
|
8303
8688
|
onMouseDown: (e) => handleMobileDragStart(e.clientY),
|
|
8304
|
-
children: /* @__PURE__ */
|
|
8689
|
+
children: /* @__PURE__ */ jsx54(
|
|
8305
8690
|
"div",
|
|
8306
8691
|
{
|
|
8307
8692
|
className: getLayoutClassName("mobileDragHandlePill")
|
|
@@ -8309,17 +8694,17 @@ var Layout = ({ children }) => {
|
|
|
8309
8694
|
)
|
|
8310
8695
|
}
|
|
8311
8696
|
),
|
|
8312
|
-
/* @__PURE__ */
|
|
8697
|
+
/* @__PURE__ */ jsx54(
|
|
8313
8698
|
"div",
|
|
8314
8699
|
{
|
|
8315
8700
|
className: getLayoutClassName("mobilePanelContent"),
|
|
8316
8701
|
children: Object.entries(pluginItems).map(
|
|
8317
|
-
([id, { mobileOnly, render: Render2 }]) => /* @__PURE__ */
|
|
8702
|
+
([id, { mobileOnly, render: Render2 }]) => /* @__PURE__ */ jsx54(
|
|
8318
8703
|
PluginTab,
|
|
8319
8704
|
{
|
|
8320
8705
|
visible: currentPlugin === id,
|
|
8321
8706
|
mobileOnly,
|
|
8322
|
-
children: /* @__PURE__ */
|
|
8707
|
+
children: /* @__PURE__ */ jsx54(Render2, {})
|
|
8323
8708
|
},
|
|
8324
8709
|
id
|
|
8325
8710
|
)
|
|
@@ -8329,7 +8714,7 @@ var Layout = ({ children }) => {
|
|
|
8329
8714
|
]
|
|
8330
8715
|
}
|
|
8331
8716
|
),
|
|
8332
|
-
/* @__PURE__ */
|
|
8717
|
+
/* @__PURE__ */ jsx54(
|
|
8333
8718
|
Sidebar,
|
|
8334
8719
|
{
|
|
8335
8720
|
position: "left",
|
|
@@ -8338,20 +8723,20 @@ var Layout = ({ children }) => {
|
|
|
8338
8723
|
onResize: setLeftWidth,
|
|
8339
8724
|
onResizeEnd: handleLeftSidebarResizeEnd,
|
|
8340
8725
|
children: Object.entries(pluginItems).map(
|
|
8341
|
-
([id, { mobileOnly, render: Render2, label }]) => /* @__PURE__ */
|
|
8726
|
+
([id, { mobileOnly, render: Render2, label }]) => /* @__PURE__ */ jsx54(
|
|
8342
8727
|
PluginTab,
|
|
8343
8728
|
{
|
|
8344
8729
|
visible: currentPlugin === id,
|
|
8345
8730
|
mobileOnly,
|
|
8346
|
-
children: /* @__PURE__ */
|
|
8731
|
+
children: /* @__PURE__ */ jsx54(Render2, {})
|
|
8347
8732
|
},
|
|
8348
8733
|
id
|
|
8349
8734
|
)
|
|
8350
8735
|
)
|
|
8351
8736
|
}
|
|
8352
8737
|
),
|
|
8353
|
-
/* @__PURE__ */
|
|
8354
|
-
!hasDesktopFieldsPlugin && /* @__PURE__ */
|
|
8738
|
+
/* @__PURE__ */ jsx54(Canvas, {}),
|
|
8739
|
+
!hasDesktopFieldsPlugin && /* @__PURE__ */ jsx54(
|
|
8355
8740
|
Sidebar,
|
|
8356
8741
|
{
|
|
8357
8742
|
position: "right",
|
|
@@ -8359,7 +8744,7 @@ var Layout = ({ children }) => {
|
|
|
8359
8744
|
isVisible: rightSideBarVisible,
|
|
8360
8745
|
onResize: setRightWidth,
|
|
8361
8746
|
onResizeEnd: handleRightSidebarResizeEnd,
|
|
8362
|
-
children: /* @__PURE__ */
|
|
8747
|
+
children: /* @__PURE__ */ jsx54(FieldSideBar, {})
|
|
8363
8748
|
}
|
|
8364
8749
|
)
|
|
8365
8750
|
]
|
|
@@ -8367,17 +8752,17 @@ var Layout = ({ children }) => {
|
|
|
8367
8752
|
)
|
|
8368
8753
|
}
|
|
8369
8754
|
) }) }) }),
|
|
8370
|
-
/* @__PURE__ */
|
|
8755
|
+
/* @__PURE__ */ jsx54("div", { id: "editor-portal-root", className: getClassName34("portal") })
|
|
8371
8756
|
]
|
|
8372
8757
|
}
|
|
8373
8758
|
);
|
|
8374
8759
|
};
|
|
8375
8760
|
|
|
8376
8761
|
// components/Editor/index.tsx
|
|
8377
|
-
import { jsx as
|
|
8762
|
+
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
8378
8763
|
var propsContext = createContext8({});
|
|
8379
8764
|
function PropsProvider(props) {
|
|
8380
|
-
return /* @__PURE__ */
|
|
8765
|
+
return /* @__PURE__ */ jsx55(propsContext.Provider, { value: props, children: props.children });
|
|
8381
8766
|
}
|
|
8382
8767
|
var usePropsContext = () => useContext15(propsContext);
|
|
8383
8768
|
function EditorProvider({ children }) {
|
|
@@ -8405,7 +8790,7 @@ function EditorProvider({ children }) {
|
|
|
8405
8790
|
}, _iframe),
|
|
8406
8791
|
[_iframe]
|
|
8407
8792
|
);
|
|
8408
|
-
const [generatedAppState] =
|
|
8793
|
+
const [generatedAppState] = useState24(() => {
|
|
8409
8794
|
var _a, _b, _c, _d, _e, _f;
|
|
8410
8795
|
const initial = __spreadValues(__spreadValues({}, defaultAppState.ui), initialUi);
|
|
8411
8796
|
let clientUiState = {};
|
|
@@ -8457,7 +8842,7 @@ function EditorProvider({ children }) {
|
|
|
8457
8842
|
return walkAppState(newAppState, config);
|
|
8458
8843
|
});
|
|
8459
8844
|
const { appendData = true } = _initialHistory || {};
|
|
8460
|
-
const [blendedHistories] =
|
|
8845
|
+
const [blendedHistories] = useState24(
|
|
8461
8846
|
[
|
|
8462
8847
|
...(_initialHistory == null ? void 0 : _initialHistory.histories) || [],
|
|
8463
8848
|
...appendData ? [{ state: generatedAppState }] : []
|
|
@@ -8491,7 +8876,7 @@ function EditorProvider({ children }) {
|
|
|
8491
8876
|
return __spreadValues(__spreadValues({}, pluginFieldTransforms), fieldTransforms);
|
|
8492
8877
|
}, [fieldTransforms, plugins]);
|
|
8493
8878
|
const instanceId = useSafeId();
|
|
8494
|
-
const generateAppStore =
|
|
8879
|
+
const generateAppStore = useCallback24(
|
|
8495
8880
|
(state) => {
|
|
8496
8881
|
return {
|
|
8497
8882
|
instanceId,
|
|
@@ -8523,7 +8908,7 @@ function EditorProvider({ children }) {
|
|
|
8523
8908
|
loadedFieldTransforms
|
|
8524
8909
|
]
|
|
8525
8910
|
);
|
|
8526
|
-
const [appStore] =
|
|
8911
|
+
const [appStore] = useState24(
|
|
8527
8912
|
() => createAppStore(generateAppStore(initialAppState))
|
|
8528
8913
|
);
|
|
8529
8914
|
useEffect26(() => {
|
|
@@ -8540,7 +8925,7 @@ function EditorProvider({ children }) {
|
|
|
8540
8925
|
index: initialHistoryIndex,
|
|
8541
8926
|
initialAppState
|
|
8542
8927
|
});
|
|
8543
|
-
const previousData =
|
|
8928
|
+
const previousData = useRef18(null);
|
|
8544
8929
|
useEffect26(() => {
|
|
8545
8930
|
return appStore.subscribe(
|
|
8546
8931
|
(s) => s.state.data,
|
|
@@ -8561,10 +8946,10 @@ function EditorProvider({ children }) {
|
|
|
8561
8946
|
resolveAndCommitData();
|
|
8562
8947
|
}, 0);
|
|
8563
8948
|
}, []);
|
|
8564
|
-
return /* @__PURE__ */
|
|
8949
|
+
return /* @__PURE__ */ jsx55(appStoreContext.Provider, { value: appStore, children: /* @__PURE__ */ jsx55(UseEditorStoreContext.Provider, { value: uEditorStore, children }) });
|
|
8565
8950
|
}
|
|
8566
8951
|
function Editor3(props) {
|
|
8567
|
-
return /* @__PURE__ */
|
|
8952
|
+
return /* @__PURE__ */ jsx55(PropsProvider, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsx55(EditorProvider, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsx55(Layout, { children: props.children }) })) }));
|
|
8568
8953
|
}
|
|
8569
8954
|
Editor3.Components = Components;
|
|
8570
8955
|
Editor3.Fields = Fields;
|
|
@@ -8597,12 +8982,12 @@ function pageMetadata(data) {
|
|
|
8597
8982
|
|
|
8598
8983
|
// plugins/legacy-side-bar/index.tsx
|
|
8599
8984
|
init_react_import();
|
|
8600
|
-
import { jsx as
|
|
8985
|
+
import { jsx as jsx56, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
8601
8986
|
var legacySideBarPlugin = () => ({
|
|
8602
8987
|
name: "legacy-side-bar",
|
|
8603
|
-
render: () => /* @__PURE__ */
|
|
8604
|
-
/* @__PURE__ */
|
|
8605
|
-
/* @__PURE__ */
|
|
8988
|
+
render: () => /* @__PURE__ */ jsxs24("div", { style: { overflowY: "auto" }, children: [
|
|
8989
|
+
/* @__PURE__ */ jsx56(SidebarSection, { title: "Components", noBorderTop: true, children: /* @__PURE__ */ jsx56(Components, {}) }),
|
|
8990
|
+
/* @__PURE__ */ jsx56(SidebarSection, { title: "Outline", children: /* @__PURE__ */ jsx56(Outline, {}) })
|
|
8606
8991
|
] })
|
|
8607
8992
|
});
|
|
8608
8993
|
|
|
@@ -8657,7 +9042,6 @@ export {
|
|
|
8657
9042
|
renderContext,
|
|
8658
9043
|
Render,
|
|
8659
9044
|
registerOverlayPortal,
|
|
8660
|
-
DropZone,
|
|
8661
9045
|
Drawer,
|
|
8662
9046
|
ComponentList,
|
|
8663
9047
|
createUseEditor,
|
|
@@ -8666,6 +9050,7 @@ export {
|
|
|
8666
9050
|
blocksPlugin,
|
|
8667
9051
|
outlinePlugin,
|
|
8668
9052
|
fieldsPlugin,
|
|
9053
|
+
usePropsContext,
|
|
8669
9054
|
Editor3 as Editor,
|
|
8670
9055
|
pageMetadata,
|
|
8671
9056
|
legacySideBarPlugin
|