@reacteditor/core 0.0.4 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Editor-4LPVLYSU.css +415 -0
- package/dist/{Editor-2TYODRQT.mjs → Editor-YNFB7B6Z.mjs} +8 -8
- package/dist/{Render-VDC7AEQK.mjs → Render-STFB5CNO.mjs} +1 -1
- package/dist/Render-ZTUTUUAH.css +103 -0
- package/dist/{actions-BCDhqbeL.d.mts → actions-CQmL3wwa.d.mts} +11 -6
- package/dist/{actions-BCDhqbeL.d.ts → actions-CQmL3wwa.d.ts} +11 -6
- package/dist/{chunk-VD3EVRUF.mjs → chunk-275EJPEB.mjs} +2 -2
- package/dist/{chunk-ZHNRSSMW.mjs → chunk-6LG4Q4HO.mjs} +1 -1
- package/dist/chunk-6QJ2HF4O.mjs +11 -0
- package/dist/{chunk-6Q6A3BQH.mjs → chunk-BRDUM7MJ.mjs} +15 -15
- package/dist/{chunk-2LVYDXZS.mjs → chunk-CRF2GWQA.mjs} +3 -3
- package/dist/{chunk-TCVU3WEN.mjs → chunk-DB4R5IWG.mjs} +4 -4
- package/dist/{chunk-D2RG73WI.mjs → chunk-HCFEY5Y7.mjs} +475 -288
- package/dist/{chunk-VUEM62JF.mjs → chunk-UB2DES2O.mjs} +17 -6
- package/dist/{chunk-M2RKJTNY.mjs → chunk-WGPCLAZR.mjs} +1 -1
- package/dist/{chunk-HMTHZBH6.mjs → chunk-Z6IIVDFY.mjs} +1 -1
- package/dist/{full-7KJICNR5.mjs → full-24FOTNTB.mjs} +6 -6
- package/dist/full-7ABPY2WA.css +311 -0
- package/dist/{index-DVwiIwYU.d.mts → index-BOP2qNVA.d.mts} +1 -1
- package/dist/{index-ComBHfdn.d.ts → index-_G46lHpL.d.ts} +1 -1
- package/dist/index.css +1307 -1203
- package/dist/index.d.mts +11 -20
- package/dist/index.d.ts +11 -20
- package/dist/index.js +572 -372
- package/dist/index.mjs +10 -10
- package/dist/internal.d.mts +2 -2
- package/dist/internal.d.ts +2 -2
- package/dist/internal.js +17 -6
- package/dist/internal.mjs +1 -1
- package/dist/{loaded-DGSPK47E.mjs → loaded-6IBSSOXD.mjs} +3 -3
- package/dist/{loaded-IJNA4SY5.mjs → loaded-6NPDD7SF.mjs} +3 -3
- package/dist/{loaded-CBJRWD4Z.mjs → loaded-BQVZGQG2.mjs} +3 -3
- package/dist/loaded-N4KWL7FV.css +90 -0
- package/dist/no-external.css +1307 -1203
- package/dist/no-external.d.mts +4 -4
- package/dist/no-external.d.ts +4 -4
- package/dist/no-external.js +572 -372
- package/dist/no-external.mjs +10 -10
- package/dist/rsc.css +41 -41
- package/dist/rsc.d.mts +2 -2
- package/dist/rsc.d.ts +2 -2
- package/dist/rsc.js +5 -5
- package/dist/rsc.mjs +2 -2
- package/dist/{walk-tree-BPIigVTF.d.mts → walk-tree-Dwv3c_9M.d.mts} +1 -1
- package/dist/{walk-tree-BZq1CPCH.d.ts → walk-tree-DxSkPLnl.d.ts} +1 -1
- package/package.json +2 -1
- package/dist/Editor-GBV2O5RD.css +0 -415
- package/dist/Render-EFT7YD2C.css +0 -103
- package/dist/chunk-MFI3RDA4.mjs +0 -11
- package/dist/full-ELX6RALJ.css +0 -311
- package/dist/loaded-TBSVRJPY.css +0 -90
package/dist/index.js
CHANGED
|
@@ -186,20 +186,20 @@ var init_get_class_name_factory = __esm({
|
|
|
186
186
|
}
|
|
187
187
|
});
|
|
188
188
|
|
|
189
|
-
// css-module:/Users/rami/Documents/apps/
|
|
189
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/ActionBar/styles.module.css/#css-module-data
|
|
190
190
|
var init_css_module_data = __esm({
|
|
191
|
-
"css-module:/Users/rami/Documents/apps/
|
|
191
|
+
"css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/ActionBar/styles.module.css/#css-module-data"() {
|
|
192
192
|
}
|
|
193
193
|
});
|
|
194
194
|
|
|
195
|
-
// css-module:/Users/rami/Documents/apps/
|
|
195
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/ActionBar/styles.module.css#css-module
|
|
196
196
|
var styles_module_default;
|
|
197
197
|
var init_styles_module = __esm({
|
|
198
|
-
"css-module:/Users/rami/Documents/apps/
|
|
198
|
+
"css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/ActionBar/styles.module.css#css-module"() {
|
|
199
199
|
"use strict";
|
|
200
200
|
init_react_import();
|
|
201
201
|
init_css_module_data();
|
|
202
|
-
styles_module_default = { "ActionBar": "
|
|
202
|
+
styles_module_default = { "ActionBar": "_ActionBar_15hub_1", "ActionBar-label": "_ActionBar-label_15hub_19", "ActionBarAction": "_ActionBarAction_15hub_32", "ActionBar-group": "_ActionBar-group_15hub_40", "ActionBarAction--disabled": "_ActionBarAction--disabled_15hub_75", "ActionBarAction--active": "_ActionBarAction--active_15hub_98", "ActionBar-separator": "_ActionBar-separator_15hub_108" };
|
|
203
203
|
}
|
|
204
204
|
});
|
|
205
205
|
|
|
@@ -1214,20 +1214,20 @@ var init_lucide_react = __esm({
|
|
|
1214
1214
|
}
|
|
1215
1215
|
});
|
|
1216
1216
|
|
|
1217
|
-
// css-module:/Users/rami/Documents/apps/
|
|
1217
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/IconButton/IconButton.module.css/#css-module-data
|
|
1218
1218
|
var init_css_module_data2 = __esm({
|
|
1219
|
-
"css-module:/Users/rami/Documents/apps/
|
|
1219
|
+
"css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/IconButton/IconButton.module.css/#css-module-data"() {
|
|
1220
1220
|
}
|
|
1221
1221
|
});
|
|
1222
1222
|
|
|
1223
|
-
// css-module:/Users/rami/Documents/apps/
|
|
1223
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/IconButton/IconButton.module.css#css-module
|
|
1224
1224
|
var IconButton_module_default;
|
|
1225
1225
|
var init_IconButton_module = __esm({
|
|
1226
|
-
"css-module:/Users/rami/Documents/apps/
|
|
1226
|
+
"css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/IconButton/IconButton.module.css#css-module"() {
|
|
1227
1227
|
"use strict";
|
|
1228
1228
|
init_react_import();
|
|
1229
1229
|
init_css_module_data2();
|
|
1230
|
-
IconButton_module_default = { "IconButton": "
|
|
1230
|
+
IconButton_module_default = { "IconButton": "_IconButton_3u943_1", "IconButton--active": "_IconButton--active_3u943_15", "IconButton--disabled": "_IconButton--disabled_3u943_26", "IconButton-title": "_IconButton-title_3u943_39" };
|
|
1231
1231
|
}
|
|
1232
1232
|
});
|
|
1233
1233
|
|
|
@@ -1841,20 +1841,31 @@ var init_populate_ids = __esm({
|
|
|
1841
1841
|
|
|
1842
1842
|
// reducer/actions/insert.ts
|
|
1843
1843
|
function insertAction(state, action, appStore) {
|
|
1844
|
+
var _a, _b;
|
|
1844
1845
|
const id = action.id || generateId(action.componentType);
|
|
1846
|
+
const componentConfig = appStore.config.components[action.componentType];
|
|
1847
|
+
const isGlobalType = (componentConfig == null ? void 0 : componentConfig.global) === true;
|
|
1848
|
+
const defaultProps = (componentConfig == null ? void 0 : componentConfig.defaultProps) || {};
|
|
1845
1849
|
const emptyComponentData = populateIds(
|
|
1846
|
-
{
|
|
1850
|
+
__spreadValues({
|
|
1847
1851
|
type: action.componentType,
|
|
1848
|
-
props: __spreadProps(__spreadValues({},
|
|
1849
|
-
|
|
1850
|
-
})
|
|
1851
|
-
},
|
|
1852
|
+
props: __spreadProps(__spreadValues({}, defaultProps), { id })
|
|
1853
|
+
}, isGlobalType ? { synced: true } : {}),
|
|
1852
1854
|
appStore.config
|
|
1853
1855
|
);
|
|
1854
1856
|
const [parentId] = action.destinationZone.split(":");
|
|
1855
1857
|
const idsInPath = getIdsForParent(action.destinationZone, state);
|
|
1858
|
+
let nextData = state.data;
|
|
1859
|
+
if (isGlobalType && !((_a = nextData.globals) != null ? _a : {})[action.componentType]) {
|
|
1860
|
+
nextData = __spreadProps(__spreadValues({}, nextData), {
|
|
1861
|
+
globals: __spreadProps(__spreadValues({}, (_b = nextData.globals) != null ? _b : {}), {
|
|
1862
|
+
[action.componentType]: { props: __spreadValues({}, defaultProps) }
|
|
1863
|
+
})
|
|
1864
|
+
});
|
|
1865
|
+
}
|
|
1866
|
+
const seededState = nextData === state.data ? state : __spreadProps(__spreadValues({}, state), { data: nextData });
|
|
1856
1867
|
return walkAppState(
|
|
1857
|
-
|
|
1868
|
+
seededState,
|
|
1858
1869
|
appStore.config,
|
|
1859
1870
|
(content, zoneCompound) => {
|
|
1860
1871
|
if (zoneCompound === action.destinationZone) {
|
|
@@ -3561,16 +3572,16 @@ var init_lib = __esm({
|
|
|
3561
3572
|
}
|
|
3562
3573
|
});
|
|
3563
3574
|
|
|
3564
|
-
// css-module:/Users/rami/Documents/apps/
|
|
3575
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Loader/styles.module.css/#css-module-data
|
|
3565
3576
|
var init_css_module_data3 = __esm({
|
|
3566
|
-
"css-module:/Users/rami/Documents/apps/
|
|
3577
|
+
"css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Loader/styles.module.css/#css-module-data"() {
|
|
3567
3578
|
}
|
|
3568
3579
|
});
|
|
3569
3580
|
|
|
3570
|
-
// css-module:/Users/rami/Documents/apps/
|
|
3581
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Loader/styles.module.css#css-module
|
|
3571
3582
|
var styles_module_default4;
|
|
3572
3583
|
var init_styles_module2 = __esm({
|
|
3573
|
-
"css-module:/Users/rami/Documents/apps/
|
|
3584
|
+
"css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Loader/styles.module.css#css-module"() {
|
|
3574
3585
|
"use strict";
|
|
3575
3586
|
init_react_import();
|
|
3576
3587
|
init_css_module_data3();
|
|
@@ -3686,33 +3697,33 @@ var init_IconButton2 = __esm({
|
|
|
3686
3697
|
}
|
|
3687
3698
|
});
|
|
3688
3699
|
|
|
3689
|
-
// css-module:/Users/rami/Documents/apps/
|
|
3700
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/RichTextMenu/styles.module.css/#css-module-data
|
|
3690
3701
|
var init_css_module_data4 = __esm({
|
|
3691
|
-
"css-module:/Users/rami/Documents/apps/
|
|
3702
|
+
"css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/RichTextMenu/styles.module.css/#css-module-data"() {
|
|
3692
3703
|
}
|
|
3693
3704
|
});
|
|
3694
3705
|
|
|
3695
|
-
// css-module:/Users/rami/Documents/apps/
|
|
3706
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/RichTextMenu/styles.module.css#css-module
|
|
3696
3707
|
var styles_module_default10;
|
|
3697
3708
|
var init_styles_module3 = __esm({
|
|
3698
|
-
"css-module:/Users/rami/Documents/apps/
|
|
3709
|
+
"css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/RichTextMenu/styles.module.css#css-module"() {
|
|
3699
3710
|
"use strict";
|
|
3700
3711
|
init_react_import();
|
|
3701
3712
|
init_css_module_data4();
|
|
3702
|
-
styles_module_default10 = { "RichTextMenu": "
|
|
3713
|
+
styles_module_default10 = { "RichTextMenu": "_RichTextMenu_1l3cr_1", "RichTextMenu--form": "_RichTextMenu--form_1l3cr_7", "RichTextMenu-group": "_RichTextMenu-group_1l3cr_17", "RichTextMenu--inline": "_RichTextMenu--inline_1l3cr_35" };
|
|
3703
3714
|
}
|
|
3704
3715
|
});
|
|
3705
3716
|
|
|
3706
|
-
// css-module:/Users/rami/Documents/apps/
|
|
3717
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/RichTextMenu/components/Control/styles.module.css/#css-module-data
|
|
3707
3718
|
var init_css_module_data5 = __esm({
|
|
3708
|
-
"css-module:/Users/rami/Documents/apps/
|
|
3719
|
+
"css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/RichTextMenu/components/Control/styles.module.css/#css-module-data"() {
|
|
3709
3720
|
}
|
|
3710
3721
|
});
|
|
3711
3722
|
|
|
3712
|
-
// css-module:/Users/rami/Documents/apps/
|
|
3723
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/RichTextMenu/components/Control/styles.module.css#css-module
|
|
3713
3724
|
var styles_module_default11;
|
|
3714
3725
|
var init_styles_module4 = __esm({
|
|
3715
|
-
"css-module:/Users/rami/Documents/apps/
|
|
3726
|
+
"css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/RichTextMenu/components/Control/styles.module.css#css-module"() {
|
|
3716
3727
|
"use strict";
|
|
3717
3728
|
init_react_import();
|
|
3718
3729
|
init_css_module_data5();
|
|
@@ -3897,20 +3908,20 @@ var init_AlignJustify = __esm({
|
|
|
3897
3908
|
}
|
|
3898
3909
|
});
|
|
3899
3910
|
|
|
3900
|
-
// css-module:/Users/rami/Documents/apps/
|
|
3911
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Select/styles.module.css/#css-module-data
|
|
3901
3912
|
var init_css_module_data6 = __esm({
|
|
3902
|
-
"css-module:/Users/rami/Documents/apps/
|
|
3913
|
+
"css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Select/styles.module.css/#css-module-data"() {
|
|
3903
3914
|
}
|
|
3904
3915
|
});
|
|
3905
3916
|
|
|
3906
|
-
// css-module:/Users/rami/Documents/apps/
|
|
3917
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Select/styles.module.css#css-module
|
|
3907
3918
|
var styles_module_default12;
|
|
3908
3919
|
var init_styles_module5 = __esm({
|
|
3909
|
-
"css-module:/Users/rami/Documents/apps/
|
|
3920
|
+
"css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Select/styles.module.css#css-module"() {
|
|
3910
3921
|
"use strict";
|
|
3911
3922
|
init_react_import();
|
|
3912
3923
|
init_css_module_data6();
|
|
3913
|
-
styles_module_default12 = { "Select": "
|
|
3924
|
+
styles_module_default12 = { "Select": "_Select_1hzg4_1", "Select-button": "_Select-button_1hzg4_6", "Select--hasOptions": "_Select--hasOptions_1hzg4_21", "Select--disabled": "_Select--disabled_1hzg4_25", "Select-buttonIcon": "_Select-buttonIcon_1hzg4_29", "Select--standalone": "_Select--standalone_1hzg4_35", "Select--actionBar": "_Select--actionBar_1hzg4_40", "Select--hasValue": "_Select--hasValue_1hzg4_46", "Select-items": "_Select-items_1hzg4_63", "SelectItem": "_SelectItem_1hzg4_75", "SelectItem--isSelected": "_SelectItem--isSelected_1hzg4_92", "SelectItem-icon": "_SelectItem-icon_1hzg4_98" };
|
|
3914
3925
|
}
|
|
3915
3926
|
});
|
|
3916
3927
|
|
|
@@ -4871,20 +4882,20 @@ var init_inner = __esm({
|
|
|
4871
4882
|
}
|
|
4872
4883
|
});
|
|
4873
4884
|
|
|
4874
|
-
// css-module:/Users/rami/Documents/apps/
|
|
4885
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/RichTextEditor/styles.module.css/#css-module-data
|
|
4875
4886
|
var init_css_module_data7 = __esm({
|
|
4876
|
-
"css-module:/Users/rami/Documents/apps/
|
|
4887
|
+
"css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/RichTextEditor/styles.module.css/#css-module-data"() {
|
|
4877
4888
|
}
|
|
4878
4889
|
});
|
|
4879
4890
|
|
|
4880
|
-
// css-module:/Users/rami/Documents/apps/
|
|
4891
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/RichTextEditor/styles.module.css#css-module
|
|
4881
4892
|
var styles_module_default13;
|
|
4882
4893
|
var init_styles_module6 = __esm({
|
|
4883
|
-
"css-module:/Users/rami/Documents/apps/
|
|
4894
|
+
"css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/RichTextEditor/styles.module.css#css-module"() {
|
|
4884
4895
|
"use strict";
|
|
4885
4896
|
init_react_import();
|
|
4886
4897
|
init_css_module_data7();
|
|
4887
|
-
styles_module_default13 = { "RichTextEditor": "
|
|
4898
|
+
styles_module_default13 = { "RichTextEditor": "_RichTextEditor_150ed_1", "RichTextEditor--editor": "_RichTextEditor--editor_150ed_50", "RichTextEditor--disabled": "_RichTextEditor--disabled_150ed_109", "RichTextEditor--isActive": "_RichTextEditor--isActive_150ed_113", "RichTextEditor-menu": "_RichTextEditor-menu_150ed_119" };
|
|
4888
4899
|
}
|
|
4889
4900
|
});
|
|
4890
4901
|
|
|
@@ -5531,9 +5542,9 @@ init_ActionBar();
|
|
|
5531
5542
|
init_react_import();
|
|
5532
5543
|
init_get_class_name_factory();
|
|
5533
5544
|
|
|
5534
|
-
// css-module:/Users/rami/Documents/apps/
|
|
5545
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/AutoField/styles.module.css#css-module
|
|
5535
5546
|
init_react_import();
|
|
5536
|
-
var styles_module_default2 = { "InputWrapper": "
|
|
5547
|
+
var styles_module_default2 = { "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" };
|
|
5537
5548
|
|
|
5538
5549
|
// components/AutoField/index.tsx
|
|
5539
5550
|
var import_react48 = require("react");
|
|
@@ -5545,9 +5556,9 @@ init_react_import();
|
|
|
5545
5556
|
init_react_import();
|
|
5546
5557
|
init_get_class_name_factory();
|
|
5547
5558
|
|
|
5548
|
-
// css-module:/Users/rami/Documents/apps/
|
|
5559
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/AutoField/fields/ArrayField/styles.module.css#css-module
|
|
5549
5560
|
init_react_import();
|
|
5550
|
-
var styles_module_default3 = { "ArrayField": "
|
|
5561
|
+
var styles_module_default3 = { "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" };
|
|
5551
5562
|
|
|
5552
5563
|
// components/AutoField/fields/ArrayField/index.tsx
|
|
5553
5564
|
init_lucide_react();
|
|
@@ -5612,9 +5623,9 @@ var import_react17 = require("react");
|
|
|
5612
5623
|
init_react_import();
|
|
5613
5624
|
init_lib();
|
|
5614
5625
|
|
|
5615
|
-
// css-module:/Users/rami/Documents/apps/
|
|
5626
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/DragIcon/styles.module.css#css-module
|
|
5616
5627
|
init_react_import();
|
|
5617
|
-
var styles_module_default5 = { "DragIcon": "
|
|
5628
|
+
var styles_module_default5 = { "DragIcon": "_DragIcon_eapcz_1", "DragIcon--disabled": "_DragIcon--disabled_eapcz_8" };
|
|
5618
5629
|
|
|
5619
5630
|
// components/DragIcon/index.tsx
|
|
5620
5631
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
@@ -6659,9 +6670,9 @@ var import_react22 = require("react");
|
|
|
6659
6670
|
init_react_import();
|
|
6660
6671
|
var import_react21 = require("react");
|
|
6661
6672
|
|
|
6662
|
-
// css-module:/Users/rami/Documents/apps/
|
|
6673
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/ExternalInput/styles.module.css#css-module
|
|
6663
6674
|
init_react_import();
|
|
6664
|
-
var styles_module_default6 = { "ExternalInput-actions": "_ExternalInput-
|
|
6675
|
+
var styles_module_default6 = { "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" };
|
|
6665
6676
|
|
|
6666
6677
|
// components/ExternalInput/index.tsx
|
|
6667
6678
|
init_get_class_name_factory();
|
|
@@ -6672,9 +6683,9 @@ init_react_import();
|
|
|
6672
6683
|
var import_react19 = require("react");
|
|
6673
6684
|
init_get_class_name_factory();
|
|
6674
6685
|
|
|
6675
|
-
// css-module:/Users/rami/Documents/apps/
|
|
6686
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Modal/styles.module.css#css-module
|
|
6676
6687
|
init_react_import();
|
|
6677
|
-
var styles_module_default7 = { "Modal": "
|
|
6688
|
+
var styles_module_default7 = { "Modal": "_Modal_vim19_1", "Modal--isOpen": "_Modal--isOpen_vim19_15", "Modal-inner": "_Modal-inner_vim19_19" };
|
|
6678
6689
|
|
|
6679
6690
|
// components/Modal/index.tsx
|
|
6680
6691
|
var import_react_dom = require("react-dom");
|
|
@@ -6708,9 +6719,9 @@ var Modal = ({
|
|
|
6708
6719
|
// components/Heading/index.tsx
|
|
6709
6720
|
init_react_import();
|
|
6710
6721
|
|
|
6711
|
-
// css-module:/Users/rami/Documents/apps/
|
|
6722
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Heading/styles.module.css#css-module
|
|
6712
6723
|
init_react_import();
|
|
6713
|
-
var styles_module_default8 = { "Heading": "
|
|
6724
|
+
var styles_module_default8 = { "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" };
|
|
6714
6725
|
|
|
6715
6726
|
// components/Heading/index.tsx
|
|
6716
6727
|
init_get_class_name_factory();
|
|
@@ -6739,9 +6750,9 @@ init_react_import();
|
|
|
6739
6750
|
init_react_import();
|
|
6740
6751
|
var import_react20 = require("react");
|
|
6741
6752
|
|
|
6742
|
-
// css-module:/Users/rami/Documents/apps/
|
|
6753
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Button/Button.module.css#css-module
|
|
6743
6754
|
init_react_import();
|
|
6744
|
-
var Button_module_default = { "Button": "
|
|
6755
|
+
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" };
|
|
6745
6756
|
|
|
6746
6757
|
// components/Button/Button.tsx
|
|
6747
6758
|
init_get_class_name_factory();
|
|
@@ -7177,13 +7188,13 @@ var SelectPrimitive = __toESM(require("@radix-ui/react-select"));
|
|
|
7177
7188
|
init_lucide_react();
|
|
7178
7189
|
init_lib();
|
|
7179
7190
|
|
|
7180
|
-
// css-module:/Users/rami/Documents/apps/
|
|
7191
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/ui/Select/styles.module.css#css-module
|
|
7181
7192
|
init_react_import();
|
|
7182
|
-
var styles_module_default9 = { "
|
|
7193
|
+
var styles_module_default9 = { "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" };
|
|
7183
7194
|
|
|
7184
7195
|
// components/ui/Select/index.tsx
|
|
7185
7196
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
7186
|
-
var getClassName12 = get_class_name_factory_default("
|
|
7197
|
+
var getClassName12 = get_class_name_factory_default("EditorSelect", styles_module_default9);
|
|
7187
7198
|
var joinClassNames = (...values) => values.filter(Boolean).join(" ");
|
|
7188
7199
|
function Select(_a) {
|
|
7189
7200
|
var props = __objRest(_a, []);
|
|
@@ -7469,9 +7480,9 @@ var RichtextField = ({
|
|
|
7469
7480
|
init_react_import();
|
|
7470
7481
|
init_get_class_name_factory();
|
|
7471
7482
|
|
|
7472
|
-
// css-module:/Users/rami/Documents/apps/
|
|
7483
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/AutoField/fields/ObjectField/styles.module.css#css-module
|
|
7473
7484
|
init_react_import();
|
|
7474
|
-
var styles_module_default14 = { "ObjectField": "
|
|
7485
|
+
var styles_module_default14 = { "ObjectField": "_ObjectField_1byjv_5", "ObjectField-fieldset": "_ObjectField-fieldset_1byjv_13" };
|
|
7475
7486
|
|
|
7476
7487
|
// components/AutoField/fields/ObjectField/index.tsx
|
|
7477
7488
|
init_store();
|
|
@@ -7788,9 +7799,9 @@ function AutoField(props) {
|
|
|
7788
7799
|
// components/ComponentList/index.tsx
|
|
7789
7800
|
init_react_import();
|
|
7790
7801
|
|
|
7791
|
-
// css-module:/Users/rami/Documents/apps/
|
|
7802
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/ComponentList/styles.module.css#css-module
|
|
7792
7803
|
init_react_import();
|
|
7793
|
-
var styles_module_default15 = { "ComponentList": "
|
|
7804
|
+
var styles_module_default15 = { "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" };
|
|
7794
7805
|
|
|
7795
7806
|
// components/ComponentList/index.tsx
|
|
7796
7807
|
init_get_class_name_factory();
|
|
@@ -7801,9 +7812,9 @@ init_store();
|
|
|
7801
7812
|
// components/Drawer/index.tsx
|
|
7802
7813
|
init_react_import();
|
|
7803
7814
|
|
|
7804
|
-
// css-module:/Users/rami/Documents/apps/
|
|
7815
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Drawer/styles.module.css#css-module
|
|
7805
7816
|
init_react_import();
|
|
7806
|
-
var styles_module_default16 = { "Drawer": "
|
|
7817
|
+
var styles_module_default16 = { "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" };
|
|
7807
7818
|
|
|
7808
7819
|
// components/Drawer/index.tsx
|
|
7809
7820
|
init_get_class_name_factory();
|
|
@@ -7825,9 +7836,9 @@ var import_react67 = require("react");
|
|
|
7825
7836
|
init_react_import();
|
|
7826
7837
|
var import_react51 = require("react");
|
|
7827
7838
|
|
|
7828
|
-
// css-module:/Users/rami/Documents/apps/
|
|
7839
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/DraggableComponent/styles.module.css#css-module
|
|
7829
7840
|
init_react_import();
|
|
7830
|
-
var styles_module_default17 = { "DraggableComponent": "
|
|
7841
|
+
var styles_module_default17 = { "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" };
|
|
7831
7842
|
|
|
7832
7843
|
// components/DraggableComponent/index.tsx
|
|
7833
7844
|
init_get_class_name_factory();
|
|
@@ -8574,9 +8585,9 @@ init_setup_zone();
|
|
|
8574
8585
|
init_root_droppable_id();
|
|
8575
8586
|
init_lib();
|
|
8576
8587
|
|
|
8577
|
-
// css-module:/Users/rami/Documents/apps/
|
|
8588
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/DropZone/styles.module.css#css-module
|
|
8578
8589
|
init_react_import();
|
|
8579
|
-
var styles_module_default18 = { "DropZone": "
|
|
8590
|
+
var styles_module_default18 = { "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" };
|
|
8580
8591
|
|
|
8581
8592
|
// components/DropZone/index.tsx
|
|
8582
8593
|
init_store();
|
|
@@ -9017,49 +9028,49 @@ var ContextSlotRender = ({
|
|
|
9017
9028
|
|
|
9018
9029
|
// lib/resolve-globals.ts
|
|
9019
9030
|
init_react_import();
|
|
9020
|
-
function resolveItem(item,
|
|
9021
|
-
var _a, _b, _c, _d
|
|
9031
|
+
function resolveItem(item, globals, config, visitedTypes) {
|
|
9032
|
+
var _a, _b, _c, _d;
|
|
9022
9033
|
const type = item.type;
|
|
9023
9034
|
const componentConfig = config.components[type];
|
|
9024
|
-
const globalEntry =
|
|
9025
|
-
const isUnlinked = ((_a = item.props) == null ? void 0 : _a.__synced) === false;
|
|
9035
|
+
const globalEntry = globals[type];
|
|
9026
9036
|
const shouldApplyGlobal = Boolean(
|
|
9027
|
-
(componentConfig == null ? void 0 : componentConfig.global) && globalEntry && !visitedTypes.has(type)
|
|
9037
|
+
(componentConfig == null ? void 0 : componentConfig.global) && item.synced && globalEntry && !visitedTypes.has(type)
|
|
9028
9038
|
);
|
|
9029
9039
|
let mergedProps;
|
|
9030
9040
|
if (shouldApplyGlobal) {
|
|
9031
9041
|
mergedProps = __spreadProps(__spreadValues({}, globalEntry.props), {
|
|
9032
|
-
children: (
|
|
9033
|
-
id: (
|
|
9042
|
+
children: (_a = item.props) == null ? void 0 : _a.children,
|
|
9043
|
+
id: (_b = item.props) == null ? void 0 : _b.id
|
|
9034
9044
|
});
|
|
9035
9045
|
} else {
|
|
9036
|
-
if ((componentConfig == null ? void 0 : componentConfig.global) && globalEntry && visitedTypes.has(type) && typeof process !== "undefined" && process.env.NODE_ENV !== "production") {
|
|
9046
|
+
if ((componentConfig == null ? void 0 : componentConfig.global) && item.synced && globalEntry && visitedTypes.has(type) && typeof process !== "undefined" && process.env.NODE_ENV !== "production") {
|
|
9037
9047
|
console.warn(
|
|
9038
9048
|
`[resolveGlobals] cycle detected while resolving global "${type}" \u2014 leaving reference unresolved`
|
|
9039
9049
|
);
|
|
9040
9050
|
}
|
|
9041
|
-
mergedProps = __spreadValues({}, (
|
|
9051
|
+
mergedProps = __spreadValues({}, (_c = item.props) != null ? _c : {});
|
|
9042
9052
|
}
|
|
9043
|
-
const fields = (
|
|
9053
|
+
const fields = (_d = componentConfig == null ? void 0 : componentConfig.fields) != null ? _d : {};
|
|
9044
9054
|
const nextVisited = shouldApplyGlobal ? /* @__PURE__ */ new Set([...visitedTypes, type]) : visitedTypes;
|
|
9045
9055
|
for (const [fieldName, fieldDef] of Object.entries(fields)) {
|
|
9046
9056
|
if ((fieldDef == null ? void 0 : fieldDef.type) === "slot") {
|
|
9047
9057
|
const slotValue = mergedProps[fieldName];
|
|
9048
9058
|
if (Array.isArray(slotValue)) {
|
|
9049
9059
|
mergedProps[fieldName] = slotValue.map(
|
|
9050
|
-
(child) => child && typeof child === "object" && "type" in child && "props" in child ? resolveItem(child,
|
|
9060
|
+
(child) => child && typeof child === "object" && "type" in child && "props" in child ? resolveItem(child, globals, config, nextVisited) : child
|
|
9051
9061
|
);
|
|
9052
9062
|
}
|
|
9053
9063
|
}
|
|
9054
9064
|
}
|
|
9055
9065
|
return __spreadProps(__spreadValues({}, item), { props: mergedProps });
|
|
9056
9066
|
}
|
|
9057
|
-
function resolveGlobals(data,
|
|
9067
|
+
function resolveGlobals(data, config) {
|
|
9058
9068
|
var _a;
|
|
9059
|
-
|
|
9069
|
+
const globals = data.globals;
|
|
9070
|
+
if (!globals || Object.keys(globals).length === 0) return data;
|
|
9060
9071
|
const visited = /* @__PURE__ */ new Set();
|
|
9061
9072
|
const content = ((_a = data.content) != null ? _a : []).map(
|
|
9062
|
-
(item) => resolveItem(item,
|
|
9073
|
+
(item) => resolveItem(item, globals, config, visited)
|
|
9063
9074
|
);
|
|
9064
9075
|
return __spreadProps(__spreadValues({}, data), { content });
|
|
9065
9076
|
}
|
|
@@ -9074,7 +9085,6 @@ var renderContext = import_react61.default.createContext({
|
|
|
9074
9085
|
function Render({
|
|
9075
9086
|
config,
|
|
9076
9087
|
data,
|
|
9077
|
-
globalData,
|
|
9078
9088
|
metadata = {}
|
|
9079
9089
|
}) {
|
|
9080
9090
|
var _a, _b;
|
|
@@ -9083,8 +9093,8 @@ function Render({
|
|
|
9083
9093
|
root: data.root || {},
|
|
9084
9094
|
content: data.content || []
|
|
9085
9095
|
});
|
|
9086
|
-
return resolveGlobals(base,
|
|
9087
|
-
}, [data,
|
|
9096
|
+
return resolveGlobals(base, config);
|
|
9097
|
+
}, [data, config]);
|
|
9088
9098
|
const rootProps = "props" in defaultedData.root ? defaultedData.root.props : defaultedData.root;
|
|
9089
9099
|
const title = (rootProps == null ? void 0 : rootProps.title) || "";
|
|
9090
9100
|
const pageProps = __spreadProps(__spreadValues({}, rootProps), {
|
|
@@ -9222,7 +9232,7 @@ var registerOverlayPortal = (el, opts = {}) => {
|
|
|
9222
9232
|
// components/InlineTextField/index.tsx
|
|
9223
9233
|
init_store();
|
|
9224
9234
|
|
|
9225
|
-
// css-module:/Users/rami/Documents/apps/
|
|
9235
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/InlineTextField/styles.module.css#css-module
|
|
9226
9236
|
init_react_import();
|
|
9227
9237
|
var styles_module_default19 = { "InlineTextField": "_InlineTextField_104qp_1" };
|
|
9228
9238
|
|
|
@@ -11264,7 +11274,7 @@ init_IconButton2();
|
|
|
11264
11274
|
|
|
11265
11275
|
// components/Editor/index.tsx
|
|
11266
11276
|
init_react_import();
|
|
11267
|
-
var
|
|
11277
|
+
var import_react93 = require("react");
|
|
11268
11278
|
init_store();
|
|
11269
11279
|
|
|
11270
11280
|
// components/Editor/components/Fields/index.tsx
|
|
@@ -11273,9 +11283,9 @@ init_Loader();
|
|
|
11273
11283
|
init_root_droppable_id();
|
|
11274
11284
|
init_store();
|
|
11275
11285
|
|
|
11276
|
-
// css-module:/Users/rami/Documents/apps/
|
|
11286
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Editor/components/Fields/styles.module.css#css-module
|
|
11277
11287
|
init_react_import();
|
|
11278
|
-
var styles_module_default20 = { "EditorFields": "
|
|
11288
|
+
var styles_module_default20 = { "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" };
|
|
11279
11289
|
|
|
11280
11290
|
// components/Editor/components/Fields/index.tsx
|
|
11281
11291
|
init_lib();
|
|
@@ -11390,29 +11400,22 @@ var FieldsChild = ({ fieldName }) => {
|
|
|
11390
11400
|
};
|
|
11391
11401
|
var FieldsChildMemo = (0, import_react74.memo)(FieldsChild);
|
|
11392
11402
|
var GlobalSyncButton = () => {
|
|
11393
|
-
var _a;
|
|
11394
11403
|
const appStore = useAppStoreApi();
|
|
11395
11404
|
const selectedItem = useAppStore((s) => s.selectedItem);
|
|
11396
11405
|
const isGlobalType = useAppStore(
|
|
11397
11406
|
(s) => {
|
|
11398
|
-
var
|
|
11399
|
-
return selectedItem ? ((
|
|
11407
|
+
var _a;
|
|
11408
|
+
return selectedItem ? ((_a = s.config.components[selectedItem.type]) == null ? void 0 : _a.global) === true : false;
|
|
11400
11409
|
}
|
|
11401
11410
|
);
|
|
11402
11411
|
if (!selectedItem || !isGlobalType) return null;
|
|
11403
|
-
const isUnlinked =
|
|
11412
|
+
const isUnlinked = selectedItem.synced === false;
|
|
11404
11413
|
const onClick = () => __async(null, null, function* () {
|
|
11405
11414
|
const { dispatch, state, resolveComponentData: resolveComponentData2 } = appStore.getState();
|
|
11406
|
-
const newProps = __spreadValues({}, selectedItem.props);
|
|
11407
|
-
if (isUnlinked) {
|
|
11408
|
-
delete newProps.__synced;
|
|
11409
|
-
} else {
|
|
11410
|
-
newProps.__synced = false;
|
|
11411
|
-
}
|
|
11412
11415
|
const latestSelector = getSelectorForId(state, selectedItem.props.id);
|
|
11413
11416
|
if (!latestSelector) return;
|
|
11414
11417
|
const resolved = yield resolveComponentData2(
|
|
11415
|
-
__spreadProps(__spreadValues({}, selectedItem), {
|
|
11418
|
+
__spreadProps(__spreadValues({}, selectedItem), { synced: isUnlinked ? true : false }),
|
|
11416
11419
|
"replace"
|
|
11417
11420
|
);
|
|
11418
11421
|
dispatch({
|
|
@@ -11481,9 +11484,9 @@ init_store();
|
|
|
11481
11484
|
var import_react75 = require("react");
|
|
11482
11485
|
init_lucide_react();
|
|
11483
11486
|
|
|
11484
|
-
// css-module:/Users/rami/Documents/apps/
|
|
11487
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Editor/components/Components/styles.module.css#css-module
|
|
11485
11488
|
init_react_import();
|
|
11486
|
-
var styles_module_default21 = { "Components-search": "_Components-
|
|
11489
|
+
var styles_module_default21 = { "Components-search": "_Components-search_recer_1", "Components-searchIcon": "_Components-searchIcon_recer_8", "Components-searchInput": "_Components-searchInput_recer_16", "Components-empty": "_Components-empty_recer_39" };
|
|
11487
11490
|
|
|
11488
11491
|
// components/Editor/components/Components/index.tsx
|
|
11489
11492
|
init_get_class_name_factory();
|
|
@@ -11875,7 +11878,7 @@ function AutoFrame(_a) {
|
|
|
11875
11878
|
AutoFrame.displayName = "AutoFrame";
|
|
11876
11879
|
var AutoFrame_default = AutoFrame;
|
|
11877
11880
|
|
|
11878
|
-
// css-module:/Users/rami/Documents/apps/
|
|
11881
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Editor/components/Preview/styles.module.css#css-module
|
|
11879
11882
|
init_react_import();
|
|
11880
11883
|
var styles_module_default22 = { "EditorPreview": "_EditorPreview_xou64_1", "EditorPreview-frame": "_EditorPreview-frame_xou64_6" };
|
|
11881
11884
|
|
|
@@ -11985,9 +11988,9 @@ init_react_import();
|
|
|
11985
11988
|
// components/LayerTree/index.tsx
|
|
11986
11989
|
init_react_import();
|
|
11987
11990
|
|
|
11988
|
-
// css-module:/Users/rami/Documents/apps/
|
|
11991
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/LayerTree/styles.module.css#css-module
|
|
11989
11992
|
init_react_import();
|
|
11990
|
-
var styles_module_default23 = { "LayerTree": "
|
|
11993
|
+
var styles_module_default23 = { "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" };
|
|
11991
11994
|
|
|
11992
11995
|
// components/LayerTree/index.tsx
|
|
11993
11996
|
init_get_class_name_factory();
|
|
@@ -12125,8 +12128,8 @@ var Layer = (0, import_react78.forwardRef)(function Layer2({
|
|
|
12125
12128
|
);
|
|
12126
12129
|
const isUnlinked = useAppStore(
|
|
12127
12130
|
(s) => {
|
|
12128
|
-
var _a, _b
|
|
12129
|
-
return ((
|
|
12131
|
+
var _a, _b;
|
|
12132
|
+
return ((_b = (_a = s.state.indexes.nodes[node.itemId]) == null ? void 0 : _a.data) == null ? void 0 : _b.synced) === false;
|
|
12130
12133
|
}
|
|
12131
12134
|
);
|
|
12132
12135
|
const containsZone = node.childZones.length > 0;
|
|
@@ -12659,16 +12662,16 @@ init_populate_ids();
|
|
|
12659
12662
|
|
|
12660
12663
|
// lib/split-global-data.ts
|
|
12661
12664
|
init_react_import();
|
|
12662
|
-
function
|
|
12663
|
-
var _a;
|
|
12664
|
-
const extracted = {};
|
|
12665
|
+
function splitGlobals(data, config) {
|
|
12666
|
+
var _a, _b;
|
|
12667
|
+
const extracted = __spreadValues({}, (_a = data.globals) != null ? _a : {});
|
|
12665
12668
|
function visit(node) {
|
|
12666
|
-
var _a2,
|
|
12669
|
+
var _a2, _b2;
|
|
12667
12670
|
const type = node.type;
|
|
12668
12671
|
const componentConfig = config.components[type];
|
|
12669
12672
|
const fields = (_a2 = componentConfig == null ? void 0 : componentConfig.fields) != null ? _a2 : {};
|
|
12670
|
-
const
|
|
12671
|
-
const processedProps = __spreadValues({}, (
|
|
12673
|
+
const isGlobalType = (componentConfig == null ? void 0 : componentConfig.global) === true;
|
|
12674
|
+
const processedProps = __spreadValues({}, (_b2 = node.props) != null ? _b2 : {});
|
|
12672
12675
|
for (const [fieldName, fieldDef] of Object.entries(fields)) {
|
|
12673
12676
|
if ((fieldDef == null ? void 0 : fieldDef.type) === "slot") {
|
|
12674
12677
|
const slotValue = processedProps[fieldName];
|
|
@@ -12679,27 +12682,25 @@ function splitGlobalData(data, config) {
|
|
|
12679
12682
|
}
|
|
12680
12683
|
}
|
|
12681
12684
|
}
|
|
12682
|
-
if (!
|
|
12683
|
-
return __spreadProps(__spreadValues({}, node), { props: processedProps });
|
|
12684
|
-
}
|
|
12685
|
-
if (processedProps.__synced === false) {
|
|
12685
|
+
if (!isGlobalType || !node.synced) {
|
|
12686
12686
|
return __spreadProps(__spreadValues({}, node), { props: processedProps });
|
|
12687
12687
|
}
|
|
12688
12688
|
const _c = processedProps, { children, id } = _c, sharedProps = __objRest(_c, ["children", "id"]);
|
|
12689
|
-
|
|
12690
|
-
extracted[type] = { props: sharedProps };
|
|
12691
|
-
}
|
|
12689
|
+
extracted[type] = { props: sharedProps };
|
|
12692
12690
|
const instanceProps = { id };
|
|
12693
12691
|
if (children !== void 0) instanceProps.children = children;
|
|
12694
|
-
return __spreadProps(__spreadValues({}, node), {
|
|
12692
|
+
return __spreadProps(__spreadValues({}, node), {
|
|
12693
|
+
props: instanceProps,
|
|
12694
|
+
synced: true
|
|
12695
|
+
});
|
|
12695
12696
|
}
|
|
12696
|
-
const strippedContent = ((
|
|
12697
|
+
const strippedContent = ((_b = data.content) != null ? _b : []).map(
|
|
12697
12698
|
(item) => visit(item)
|
|
12698
12699
|
);
|
|
12699
|
-
return {
|
|
12700
|
-
|
|
12701
|
-
|
|
12702
|
-
};
|
|
12700
|
+
return __spreadProps(__spreadValues({}, data), {
|
|
12701
|
+
content: strippedContent,
|
|
12702
|
+
globals: extracted
|
|
12703
|
+
});
|
|
12703
12704
|
}
|
|
12704
12705
|
|
|
12705
12706
|
// components/Editor/index.tsx
|
|
@@ -12707,12 +12708,12 @@ init_to_component();
|
|
|
12707
12708
|
|
|
12708
12709
|
// components/Editor/components/Layout/index.tsx
|
|
12709
12710
|
init_react_import();
|
|
12710
|
-
var
|
|
12711
|
+
var import_react92 = require("react");
|
|
12711
12712
|
init_lib();
|
|
12712
12713
|
|
|
12713
|
-
// css-module:/Users/rami/Documents/apps/
|
|
12714
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Editor/components/Layout/styles.module.css#css-module
|
|
12714
12715
|
init_react_import();
|
|
12715
|
-
var styles_module_default24 = { "Editor": "
|
|
12716
|
+
var styles_module_default24 = { "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" };
|
|
12716
12717
|
|
|
12717
12718
|
// lib/use-inject-css.ts
|
|
12718
12719
|
init_react_import();
|
|
@@ -12775,9 +12776,9 @@ var usePreviewModeHotkeys = () => {
|
|
|
12775
12776
|
// components/SidebarSection/index.tsx
|
|
12776
12777
|
init_react_import();
|
|
12777
12778
|
|
|
12778
|
-
// css-module:/Users/rami/Documents/apps/
|
|
12779
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/SidebarSection/styles.module.css#css-module
|
|
12779
12780
|
init_react_import();
|
|
12780
|
-
var styles_module_default25 = { "SidebarSection": "
|
|
12781
|
+
var styles_module_default25 = { "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" };
|
|
12781
12782
|
|
|
12782
12783
|
// components/SidebarSection/index.tsx
|
|
12783
12784
|
init_get_class_name_factory();
|
|
@@ -12786,9 +12787,9 @@ init_Loader();
|
|
|
12786
12787
|
// components/Breadcrumbs/index.tsx
|
|
12787
12788
|
init_react_import();
|
|
12788
12789
|
|
|
12789
|
-
// css-module:/Users/rami/Documents/apps/
|
|
12790
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Breadcrumbs/styles.module.css#css-module
|
|
12790
12791
|
init_react_import();
|
|
12791
|
-
var styles_module_default26 = { "Breadcrumbs": "
|
|
12792
|
+
var styles_module_default26 = { "Breadcrumbs": "_Breadcrumbs_1cjxk_1", "Breadcrumbs-breadcrumb": "_Breadcrumbs-breadcrumb_1cjxk_10", "Breadcrumbs-breadcrumbLabel": "_Breadcrumbs-breadcrumbLabel_1cjxk_17" };
|
|
12792
12793
|
|
|
12793
12794
|
// components/Breadcrumbs/index.tsx
|
|
12794
12795
|
init_get_class_name_factory();
|
|
@@ -12890,25 +12891,152 @@ var SidebarSection = ({
|
|
|
12890
12891
|
// components/Editor/components/Canvas/index.tsx
|
|
12891
12892
|
init_react_import();
|
|
12892
12893
|
init_css_box_model_esm();
|
|
12893
|
-
var
|
|
12894
|
+
var import_react88 = require("react");
|
|
12894
12895
|
init_lucide_react();
|
|
12895
12896
|
init_store();
|
|
12896
12897
|
|
|
12897
12898
|
// components/BrowserBar/index.tsx
|
|
12898
12899
|
init_react_import();
|
|
12899
12900
|
init_lucide_react();
|
|
12900
|
-
var
|
|
12901
|
+
var import_react86 = require("react");
|
|
12901
12902
|
init_store();
|
|
12902
12903
|
init_lib();
|
|
12903
12904
|
init_IconButton2();
|
|
12904
12905
|
|
|
12905
|
-
//
|
|
12906
|
+
// components/ui/Combobox/index.tsx
|
|
12906
12907
|
init_react_import();
|
|
12907
|
-
var
|
|
12908
|
+
var import_react85 = require("@base-ui/react");
|
|
12909
|
+
init_lucide_react();
|
|
12910
|
+
init_lib();
|
|
12908
12911
|
|
|
12909
|
-
// components/
|
|
12912
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/ui/Combobox/styles.module.css#css-module
|
|
12913
|
+
init_react_import();
|
|
12914
|
+
var styles_module_default27 = { "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" };
|
|
12915
|
+
|
|
12916
|
+
// components/ui/Combobox/index.tsx
|
|
12910
12917
|
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
12911
|
-
var getClassName34 = get_class_name_factory_default("
|
|
12918
|
+
var getClassName34 = get_class_name_factory_default("EditorCombobox", styles_module_default27);
|
|
12919
|
+
var join = (...values) => values.filter(Boolean).join(" ");
|
|
12920
|
+
var mergeClassName = (base, override) => {
|
|
12921
|
+
if (!override) return base;
|
|
12922
|
+
if (typeof override === "function") {
|
|
12923
|
+
return (state) => join(base, override(state));
|
|
12924
|
+
}
|
|
12925
|
+
return join(base, override);
|
|
12926
|
+
};
|
|
12927
|
+
var Combobox = import_react85.Combobox.Root;
|
|
12928
|
+
function ComboboxInput(_a) {
|
|
12929
|
+
var _b = _a, {
|
|
12930
|
+
className
|
|
12931
|
+
} = _b, props = __objRest(_b, [
|
|
12932
|
+
"className"
|
|
12933
|
+
]);
|
|
12934
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
12935
|
+
import_react85.Combobox.Input,
|
|
12936
|
+
__spreadValues({
|
|
12937
|
+
"data-slot": "combobox-input",
|
|
12938
|
+
className: mergeClassName(getClassName34("input"), className)
|
|
12939
|
+
}, props)
|
|
12940
|
+
);
|
|
12941
|
+
}
|
|
12942
|
+
function ComboboxContent(_a) {
|
|
12943
|
+
var _b = _a, {
|
|
12944
|
+
className,
|
|
12945
|
+
side = "bottom",
|
|
12946
|
+
sideOffset = 4,
|
|
12947
|
+
align = "start",
|
|
12948
|
+
alignOffset = 0,
|
|
12949
|
+
children
|
|
12950
|
+
} = _b, props = __objRest(_b, [
|
|
12951
|
+
"className",
|
|
12952
|
+
"side",
|
|
12953
|
+
"sideOffset",
|
|
12954
|
+
"align",
|
|
12955
|
+
"alignOffset",
|
|
12956
|
+
"children"
|
|
12957
|
+
]);
|
|
12958
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_react85.Combobox.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
12959
|
+
import_react85.Combobox.Positioner,
|
|
12960
|
+
{
|
|
12961
|
+
side,
|
|
12962
|
+
sideOffset,
|
|
12963
|
+
align,
|
|
12964
|
+
alignOffset,
|
|
12965
|
+
className: getClassName34("positioner"),
|
|
12966
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
12967
|
+
import_react85.Combobox.Popup,
|
|
12968
|
+
__spreadProps(__spreadValues({
|
|
12969
|
+
"data-slot": "combobox-content",
|
|
12970
|
+
className: mergeClassName(getClassName34("content"), className)
|
|
12971
|
+
}, props), {
|
|
12972
|
+
children
|
|
12973
|
+
})
|
|
12974
|
+
)
|
|
12975
|
+
}
|
|
12976
|
+
) });
|
|
12977
|
+
}
|
|
12978
|
+
function ComboboxList(_a) {
|
|
12979
|
+
var _b = _a, {
|
|
12980
|
+
className
|
|
12981
|
+
} = _b, props = __objRest(_b, [
|
|
12982
|
+
"className"
|
|
12983
|
+
]);
|
|
12984
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
12985
|
+
import_react85.Combobox.List,
|
|
12986
|
+
__spreadValues({
|
|
12987
|
+
"data-slot": "combobox-list",
|
|
12988
|
+
className: mergeClassName(getClassName34("list"), className)
|
|
12989
|
+
}, props)
|
|
12990
|
+
);
|
|
12991
|
+
}
|
|
12992
|
+
function ComboboxItem(_a) {
|
|
12993
|
+
var _b = _a, {
|
|
12994
|
+
className,
|
|
12995
|
+
children
|
|
12996
|
+
} = _b, props = __objRest(_b, [
|
|
12997
|
+
"className",
|
|
12998
|
+
"children"
|
|
12999
|
+
]);
|
|
13000
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(
|
|
13001
|
+
import_react85.Combobox.Item,
|
|
13002
|
+
__spreadProps(__spreadValues({
|
|
13003
|
+
"data-slot": "combobox-item",
|
|
13004
|
+
className: mergeClassName(getClassName34("item"), className)
|
|
13005
|
+
}, props), {
|
|
13006
|
+
children: [
|
|
13007
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("span", { className: getClassName34("itemIndicator"), children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_react85.Combobox.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Check, { size: 14 }) }) }),
|
|
13008
|
+
children
|
|
13009
|
+
]
|
|
13010
|
+
})
|
|
13011
|
+
);
|
|
13012
|
+
}
|
|
13013
|
+
function ComboboxEmpty(_a) {
|
|
13014
|
+
var _b = _a, {
|
|
13015
|
+
className
|
|
13016
|
+
} = _b, props = __objRest(_b, [
|
|
13017
|
+
"className"
|
|
13018
|
+
]);
|
|
13019
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
13020
|
+
import_react85.Combobox.Empty,
|
|
13021
|
+
__spreadValues({
|
|
13022
|
+
"data-slot": "combobox-empty",
|
|
13023
|
+
className: mergeClassName(getClassName34("empty"), className)
|
|
13024
|
+
}, props)
|
|
13025
|
+
);
|
|
13026
|
+
}
|
|
13027
|
+
|
|
13028
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/BrowserBar/styles.module.css#css-module
|
|
13029
|
+
init_react_import();
|
|
13030
|
+
var styles_module_default28 = { "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" };
|
|
13031
|
+
|
|
13032
|
+
// components/BrowserBar/index.tsx
|
|
13033
|
+
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
13034
|
+
var normalizeRoute = (raw) => {
|
|
13035
|
+
const trimmed = raw.trim();
|
|
13036
|
+
if (!trimmed) return trimmed;
|
|
13037
|
+
return trimmed.startsWith("/") ? trimmed : `/${trimmed}`;
|
|
13038
|
+
};
|
|
13039
|
+
var getClassName35 = get_class_name_factory_default("BrowserBar", styles_module_default28);
|
|
12912
13040
|
var DEVICE_VIEWPORTS = {
|
|
12913
13041
|
desktop: { width: "100%", height: "auto", icon: "Monitor", label: "Desktop" },
|
|
12914
13042
|
mobile: { width: 360, height: "auto", icon: "Smartphone", label: "Mobile" }
|
|
@@ -12916,7 +13044,6 @@ var DEVICE_VIEWPORTS = {
|
|
|
12916
13044
|
var BrowserBar = ({
|
|
12917
13045
|
onViewportChange
|
|
12918
13046
|
}) => {
|
|
12919
|
-
var _a;
|
|
12920
13047
|
const { routes, currentPath, onRouteChange } = usePropsContext();
|
|
12921
13048
|
const viewports = useAppStore((s) => s.state.ui.viewports);
|
|
12922
13049
|
const dispatch = useAppStore((s) => s.dispatch);
|
|
@@ -12935,7 +13062,7 @@ var BrowserBar = ({
|
|
|
12935
13062
|
}
|
|
12936
13063
|
});
|
|
12937
13064
|
};
|
|
12938
|
-
const activeDevice = (0,
|
|
13065
|
+
const activeDevice = (0, import_react86.useMemo)(() => {
|
|
12939
13066
|
const w = viewports.current.width;
|
|
12940
13067
|
if (typeof w === "number" && w <= 640) return "mobile";
|
|
12941
13068
|
return "desktop";
|
|
@@ -12944,59 +13071,95 @@ var BrowserBar = ({
|
|
|
12944
13071
|
onViewportChange == null ? void 0 : onViewportChange(DEVICE_VIEWPORTS[device]);
|
|
12945
13072
|
};
|
|
12946
13073
|
const showRoutePicker = !!routes && currentPath !== void 0 && !!onRouteChange;
|
|
12947
|
-
const
|
|
12948
|
-
|
|
12949
|
-
|
|
12950
|
-
|
|
13074
|
+
const [inputValue, setInputValue] = (0, import_react86.useState)(currentPath != null ? currentPath : "");
|
|
13075
|
+
const lastSyncedPath = (0, import_react86.useRef)(currentPath);
|
|
13076
|
+
if (lastSyncedPath.current !== currentPath) {
|
|
13077
|
+
lastSyncedPath.current = currentPath;
|
|
13078
|
+
setInputValue(currentPath != null ? currentPath : "");
|
|
13079
|
+
}
|
|
13080
|
+
const submit = (raw) => {
|
|
13081
|
+
const next = normalizeRoute(raw);
|
|
13082
|
+
if (!next || next === currentPath) return;
|
|
13083
|
+
void (onRouteChange == null ? void 0 : onRouteChange(next));
|
|
13084
|
+
};
|
|
13085
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("div", { className: getClassName35(), children: [
|
|
13086
|
+
showRoutePicker ? /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(
|
|
13087
|
+
Combobox,
|
|
12951
13088
|
{
|
|
13089
|
+
items: routes.map((r) => r.path),
|
|
12952
13090
|
value: currentPath,
|
|
12953
13091
|
onValueChange: (next) => {
|
|
12954
|
-
|
|
13092
|
+
if (typeof next === "string") submit(next);
|
|
12955
13093
|
},
|
|
13094
|
+
inputValue,
|
|
13095
|
+
onInputValueChange: (next) => setInputValue(next),
|
|
13096
|
+
autoHighlight: false,
|
|
12956
13097
|
children: [
|
|
12957
|
-
/* @__PURE__ */ (0,
|
|
12958
|
-
|
|
12959
|
-
|
|
12960
|
-
|
|
12961
|
-
|
|
12962
|
-
|
|
12963
|
-
|
|
12964
|
-
|
|
12965
|
-
|
|
12966
|
-
|
|
13098
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(
|
|
13099
|
+
"form",
|
|
13100
|
+
{
|
|
13101
|
+
className: getClassName35("urlTrigger"),
|
|
13102
|
+
onSubmit: (event) => {
|
|
13103
|
+
event.preventDefault();
|
|
13104
|
+
submit(inputValue);
|
|
13105
|
+
},
|
|
13106
|
+
children: [
|
|
13107
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Globe, { className: getClassName35("urlIcon"), size: 14 }),
|
|
13108
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
13109
|
+
ComboboxInput,
|
|
13110
|
+
{
|
|
13111
|
+
className: getClassName35("urlInput"),
|
|
13112
|
+
placeholder: "/",
|
|
13113
|
+
spellCheck: false,
|
|
13114
|
+
autoCorrect: "off",
|
|
13115
|
+
autoCapitalize: "off"
|
|
13116
|
+
}
|
|
13117
|
+
)
|
|
13118
|
+
]
|
|
13119
|
+
}
|
|
13120
|
+
),
|
|
13121
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(ComboboxContent, { children: [
|
|
13122
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(ComboboxEmpty, { children: "Press Enter to go to this path" }),
|
|
13123
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(ComboboxList, { children: (path) => {
|
|
13124
|
+
const route = routes.find((r) => r.path === path);
|
|
13125
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(ComboboxItem, { value: path, children: [
|
|
13126
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)("span", { className: getClassName35("itemPath"), children: path }),
|
|
13127
|
+
(route == null ? void 0 : route.title) ? /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("span", { className: getClassName35("itemTitle"), children: route.title }) : null
|
|
13128
|
+
] }, path);
|
|
13129
|
+
} })
|
|
12967
13130
|
] })
|
|
12968
13131
|
]
|
|
12969
13132
|
}
|
|
12970
|
-
) : /* @__PURE__ */ (0,
|
|
12971
|
-
/* @__PURE__ */ (0,
|
|
12972
|
-
/* @__PURE__ */ (0,
|
|
13133
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("div", { className: getClassName35("urlTrigger"), children: [
|
|
13134
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Globe, { className: getClassName35("urlIcon"), size: 14 }),
|
|
13135
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)("span", { className: getClassName35("urlText"), children: "/" })
|
|
12973
13136
|
] }),
|
|
12974
|
-
/* @__PURE__ */ (0,
|
|
12975
|
-
/* @__PURE__ */ (0,
|
|
13137
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("div", { className: getClassName35("actions"), children: [
|
|
13138
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
12976
13139
|
IconButton,
|
|
12977
13140
|
{
|
|
12978
13141
|
type: "button",
|
|
12979
13142
|
title: activeDevice === "desktop" ? "Switch to mobile viewport" : "Switch to desktop viewport",
|
|
12980
13143
|
onClick: () => setDevice(activeDevice === "desktop" ? "mobile" : "desktop"),
|
|
12981
|
-
children: /* @__PURE__ */ (0,
|
|
13144
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("span", { className: getClassName35("deviceIcon"), children: activeDevice === "desktop" ? /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Monitor, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Smartphone, { size: 16 }) })
|
|
12982
13145
|
}
|
|
12983
13146
|
),
|
|
12984
|
-
/* @__PURE__ */ (0,
|
|
13147
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
12985
13148
|
IconButton,
|
|
12986
13149
|
{
|
|
12987
13150
|
type: "button",
|
|
12988
13151
|
title: isFullScreen ? "Exit full screen" : "Enter full screen",
|
|
12989
13152
|
onClick: toggleFullScreen,
|
|
12990
|
-
children: /* @__PURE__ */ (0,
|
|
13153
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("span", { className: getClassName35("deviceIcon"), children: isFullScreen ? /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Minimize, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Maximize, { size: 16 }) })
|
|
12991
13154
|
}
|
|
12992
13155
|
)
|
|
12993
13156
|
] })
|
|
12994
13157
|
] });
|
|
12995
13158
|
};
|
|
12996
13159
|
|
|
12997
|
-
// css-module:/Users/rami/Documents/apps/
|
|
13160
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Editor/components/Canvas/styles.module.css#css-module
|
|
12998
13161
|
init_react_import();
|
|
12999
|
-
var
|
|
13162
|
+
var styles_module_default29 = { "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" };
|
|
13000
13163
|
|
|
13001
13164
|
// components/Editor/components/Canvas/index.tsx
|
|
13002
13165
|
init_lib();
|
|
@@ -13006,23 +13169,23 @@ var import_shallow9 = require("zustand/react/shallow");
|
|
|
13006
13169
|
|
|
13007
13170
|
// lib/frame-context.tsx
|
|
13008
13171
|
init_react_import();
|
|
13009
|
-
var
|
|
13010
|
-
var
|
|
13011
|
-
var FrameContext = (0,
|
|
13172
|
+
var import_react87 = require("react");
|
|
13173
|
+
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
13174
|
+
var FrameContext = (0, import_react87.createContext)(null);
|
|
13012
13175
|
var FrameProvider = ({
|
|
13013
13176
|
children
|
|
13014
13177
|
}) => {
|
|
13015
|
-
const frameRef = (0,
|
|
13016
|
-
const value = (0,
|
|
13178
|
+
const frameRef = (0, import_react87.useRef)(null);
|
|
13179
|
+
const value = (0, import_react87.useMemo)(
|
|
13017
13180
|
() => ({
|
|
13018
13181
|
frameRef
|
|
13019
13182
|
}),
|
|
13020
13183
|
[]
|
|
13021
13184
|
);
|
|
13022
|
-
return /* @__PURE__ */ (0,
|
|
13185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(FrameContext.Provider, { value, children });
|
|
13023
13186
|
};
|
|
13024
13187
|
var useCanvasFrame = () => {
|
|
13025
|
-
const context = (0,
|
|
13188
|
+
const context = (0, import_react87.useContext)(FrameContext);
|
|
13026
13189
|
if (context === null) {
|
|
13027
13190
|
throw new Error("useCanvasFrame must be used within a FrameProvider");
|
|
13028
13191
|
}
|
|
@@ -13031,14 +13194,14 @@ var useCanvasFrame = () => {
|
|
|
13031
13194
|
|
|
13032
13195
|
// components/Editor/components/Canvas/index.tsx
|
|
13033
13196
|
init_default_viewports();
|
|
13034
|
-
var
|
|
13035
|
-
var
|
|
13197
|
+
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
13198
|
+
var getClassName36 = get_class_name_factory_default("EditorCanvas", styles_module_default29);
|
|
13036
13199
|
var ZOOM_STEP = 0.15;
|
|
13037
13200
|
var MIN_ZOOM = 0.25;
|
|
13038
13201
|
var MAX_ZOOM = 3;
|
|
13039
13202
|
var TRANSITION_DURATION = 150;
|
|
13040
13203
|
var Canvas = () => {
|
|
13041
|
-
var _a;
|
|
13204
|
+
var _a, _b;
|
|
13042
13205
|
const { frameRef } = useCanvasFrame();
|
|
13043
13206
|
const {
|
|
13044
13207
|
viewports: viewportOptions = defaultViewports,
|
|
@@ -13067,21 +13230,21 @@ var Canvas = () => {
|
|
|
13067
13230
|
}))
|
|
13068
13231
|
);
|
|
13069
13232
|
const viewports = useAppStore((s) => s.state.ui.viewports);
|
|
13070
|
-
const [canvasZoom, setCanvasZoom] = (0,
|
|
13233
|
+
const [canvasZoom, setCanvasZoom] = (0, import_react88.useState)(1);
|
|
13071
13234
|
const zoomIn = () => setCanvasZoom((z) => Math.min(z + ZOOM_STEP, MAX_ZOOM));
|
|
13072
13235
|
const zoomOut = () => setCanvasZoom((z) => Math.max(z - ZOOM_STEP, MIN_ZOOM));
|
|
13073
13236
|
const resetZoom = () => setCanvasZoom(1);
|
|
13074
|
-
const [showTransition, setShowTransition] = (0,
|
|
13075
|
-
const isResizingRef = (0,
|
|
13076
|
-
const defaultRender = (0,
|
|
13077
|
-
const EditorDefault = ({ children }) => /* @__PURE__ */ (0,
|
|
13237
|
+
const [showTransition, setShowTransition] = (0, import_react88.useState)(false);
|
|
13238
|
+
const isResizingRef = (0, import_react88.useRef)(false);
|
|
13239
|
+
const defaultRender = (0, import_react88.useMemo)(() => {
|
|
13240
|
+
const EditorDefault = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_jsx_runtime85.Fragment, { children });
|
|
13078
13241
|
return EditorDefault;
|
|
13079
13242
|
}, []);
|
|
13080
|
-
const CustomPreview = (0,
|
|
13243
|
+
const CustomPreview = (0, import_react88.useMemo)(
|
|
13081
13244
|
() => overrides.preview || defaultRender,
|
|
13082
13245
|
[overrides]
|
|
13083
13246
|
);
|
|
13084
|
-
const getFrameDimensions = (0,
|
|
13247
|
+
const getFrameDimensions = (0, import_react88.useCallback)(() => {
|
|
13085
13248
|
if (frameRef.current) {
|
|
13086
13249
|
const frame = frameRef.current;
|
|
13087
13250
|
const box = getBox(frame);
|
|
@@ -13089,32 +13252,31 @@ var Canvas = () => {
|
|
|
13089
13252
|
}
|
|
13090
13253
|
return { width: 0, height: 0 };
|
|
13091
13254
|
}, [frameRef]);
|
|
13092
|
-
(0,
|
|
13255
|
+
(0, import_react88.useEffect)(() => {
|
|
13093
13256
|
const { height: frameHeight } = getFrameDimensions();
|
|
13094
13257
|
if (viewports.current.height === "auto") {
|
|
13095
13258
|
setZoomConfig(__spreadProps(__spreadValues({}, zoomConfig), { zoom: 1, rootHeight: frameHeight }));
|
|
13096
13259
|
}
|
|
13097
13260
|
}, [getFrameDimensions, setZoomConfig, viewports.current.height]);
|
|
13098
|
-
const [showLoader, setShowLoader] = (0,
|
|
13099
|
-
(0,
|
|
13261
|
+
const [showLoader, setShowLoader] = (0, import_react88.useState)(false);
|
|
13262
|
+
(0, import_react88.useEffect)(() => {
|
|
13100
13263
|
setTimeout(() => {
|
|
13101
13264
|
setShowLoader(true);
|
|
13102
13265
|
}, 500);
|
|
13103
13266
|
}, []);
|
|
13104
13267
|
const appStoreApi = useAppStoreApi();
|
|
13105
|
-
(0,
|
|
13106
|
-
|
|
13107
|
-
|
|
13108
|
-
if (
|
|
13268
|
+
const autoSelectingRef = (0, import_react88.useRef)(true);
|
|
13269
|
+
const pickClosestViewport = (0, import_react88.useCallback)(() => {
|
|
13270
|
+
var _a2, _b2;
|
|
13271
|
+
if (typeof window === "undefined") return null;
|
|
13109
13272
|
const viewportWidth = window.innerWidth;
|
|
13110
|
-
const frameWidth = (
|
|
13111
|
-
if (!viewportWidth) return;
|
|
13112
|
-
if (!frameWidth) return;
|
|
13113
|
-
if (viewportOptions.length === 0) return;
|
|
13273
|
+
const frameWidth = (_a2 = frameRef.current) == null ? void 0 : _a2.getBoundingClientRect().width;
|
|
13274
|
+
if (!viewportWidth) return null;
|
|
13275
|
+
if (!frameWidth) return null;
|
|
13276
|
+
if (viewportOptions.length === 0) return null;
|
|
13114
13277
|
const fullWidthViewport = Object.values(viewportOptions).find(
|
|
13115
13278
|
(v) => v.width === "100%"
|
|
13116
13279
|
);
|
|
13117
|
-
const containsFullWidthViewport = !!fullWidthViewport;
|
|
13118
13280
|
const viewportDifferences = Object.entries(viewportOptions).filter(([_, value]) => value.width !== "100%").map(([key, value]) => ({
|
|
13119
13281
|
key,
|
|
13120
13282
|
diff: Math.abs(
|
|
@@ -13122,10 +13284,19 @@ var Canvas = () => {
|
|
|
13122
13284
|
),
|
|
13123
13285
|
value
|
|
13124
13286
|
})).sort((a, b) => a.diff > b.diff ? 1 : -1);
|
|
13125
|
-
let closestViewport = viewportDifferences[0].value;
|
|
13126
|
-
if (closestViewport
|
|
13287
|
+
let closestViewport = (_b2 = viewportDifferences[0]) == null ? void 0 : _b2.value;
|
|
13288
|
+
if (!closestViewport) return null;
|
|
13289
|
+
if (closestViewport.width < frameWidth && fullWidthViewport) {
|
|
13127
13290
|
closestViewport = fullWidthViewport;
|
|
13128
13291
|
}
|
|
13292
|
+
return closestViewport;
|
|
13293
|
+
}, [viewportOptions, frameRef]);
|
|
13294
|
+
(0, import_react88.useEffect)(() => {
|
|
13295
|
+
var _a2;
|
|
13296
|
+
if (typeof window === "undefined") return;
|
|
13297
|
+
if ((_a2 = uiProp == null ? void 0 : uiProp.viewports) == null ? void 0 : _a2.current) return;
|
|
13298
|
+
const closestViewport = pickClosestViewport();
|
|
13299
|
+
if (!closestViewport) return;
|
|
13129
13300
|
if (iframe.enabled) {
|
|
13130
13301
|
const s = appStoreApi.getState();
|
|
13131
13302
|
const appState = {
|
|
@@ -13147,16 +13318,51 @@ var Canvas = () => {
|
|
|
13147
13318
|
appStoreApi.setState(__spreadProps(__spreadValues({}, appState), { history }));
|
|
13148
13319
|
}
|
|
13149
13320
|
}, [
|
|
13150
|
-
|
|
13321
|
+
pickClosestViewport,
|
|
13151
13322
|
frameRef.current,
|
|
13152
13323
|
iframe,
|
|
13153
13324
|
appStoreApi,
|
|
13154
13325
|
(_a = uiProp == null ? void 0 : uiProp.viewports) == null ? void 0 : _a.current
|
|
13155
13326
|
]);
|
|
13156
|
-
|
|
13327
|
+
(0, import_react88.useEffect)(() => {
|
|
13328
|
+
var _a2;
|
|
13329
|
+
if (typeof window === "undefined") return;
|
|
13330
|
+
if (!iframe.enabled) return;
|
|
13331
|
+
if ((_a2 = uiProp == null ? void 0 : uiProp.viewports) == null ? void 0 : _a2.current) return;
|
|
13332
|
+
const target = frameRef.current;
|
|
13333
|
+
if (!target) return;
|
|
13334
|
+
const observer = new ResizeObserver(() => {
|
|
13335
|
+
if (!autoSelectingRef.current) return;
|
|
13336
|
+
const closestViewport = pickClosestViewport();
|
|
13337
|
+
if (!closestViewport) return;
|
|
13338
|
+
const s = appStoreApi.getState();
|
|
13339
|
+
const current = s.state.ui.viewports.current;
|
|
13340
|
+
if (current.width === closestViewport.width && current.height === (closestViewport.height || "auto")) {
|
|
13341
|
+
return;
|
|
13342
|
+
}
|
|
13343
|
+
setUi({
|
|
13344
|
+
viewports: __spreadProps(__spreadValues({}, s.state.ui.viewports), {
|
|
13345
|
+
current: __spreadProps(__spreadValues({}, current), {
|
|
13346
|
+
width: closestViewport.width,
|
|
13347
|
+
height: closestViewport.height || "auto"
|
|
13348
|
+
})
|
|
13349
|
+
})
|
|
13350
|
+
});
|
|
13351
|
+
});
|
|
13352
|
+
observer.observe(target);
|
|
13353
|
+
return () => observer.disconnect();
|
|
13354
|
+
}, [
|
|
13355
|
+
pickClosestViewport,
|
|
13356
|
+
frameRef,
|
|
13357
|
+
iframe.enabled,
|
|
13358
|
+
(_b = uiProp == null ? void 0 : uiProp.viewports) == null ? void 0 : _b.current,
|
|
13359
|
+
appStoreApi,
|
|
13360
|
+
setUi
|
|
13361
|
+
]);
|
|
13362
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
13157
13363
|
"div",
|
|
13158
13364
|
{
|
|
13159
|
-
className:
|
|
13365
|
+
className: getClassName36({
|
|
13160
13366
|
ready: status === "READY" || !iframe.enabled || !iframe.waitForStyles,
|
|
13161
13367
|
showLoader,
|
|
13162
13368
|
fullScreen: fullScreenCanvas
|
|
@@ -13171,16 +13377,16 @@ var Canvas = () => {
|
|
|
13171
13377
|
});
|
|
13172
13378
|
}
|
|
13173
13379
|
},
|
|
13174
|
-
children: /* @__PURE__ */ (0,
|
|
13175
|
-
!disableZoomControls && /* @__PURE__ */ (0,
|
|
13176
|
-
/* @__PURE__ */ (0,
|
|
13177
|
-
/* @__PURE__ */ (0,
|
|
13178
|
-
/* @__PURE__ */ (0,
|
|
13380
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: getClassName36("inner"), ref: frameRef, children: [
|
|
13381
|
+
!disableZoomControls && /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: getClassName36("zoomControls"), children: [
|
|
13382
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(IconButton, { type: "button", title: "Zoom out", onClick: zoomOut, children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Minus, { size: 14 }) }),
|
|
13383
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(IconButton, { type: "button", title: "Reset zoom", onClick: resetZoom, children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(RotateCcw, { size: 14 }) }),
|
|
13384
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(IconButton, { type: "button", title: "Zoom in", onClick: zoomIn, children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Plus, { size: 14 }) })
|
|
13179
13385
|
] }),
|
|
13180
|
-
/* @__PURE__ */ (0,
|
|
13386
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
|
|
13181
13387
|
"div",
|
|
13182
13388
|
{
|
|
13183
|
-
className:
|
|
13389
|
+
className: getClassName36("rootColumn"),
|
|
13184
13390
|
style: {
|
|
13185
13391
|
width: iframe.enabled ? viewports.current.width : "100%",
|
|
13186
13392
|
transform: disableZoomControls ? void 0 : `scale(${canvasZoom})`,
|
|
@@ -13188,10 +13394,11 @@ var Canvas = () => {
|
|
|
13188
13394
|
transition: showTransition ? `width ${TRANSITION_DURATION}ms ease-out, transform ${TRANSITION_DURATION}ms ease-out` : disableZoomControls ? void 0 : "transform 150ms ease-out"
|
|
13189
13395
|
},
|
|
13190
13396
|
children: [
|
|
13191
|
-
iframe.enabled && /* @__PURE__ */ (0,
|
|
13397
|
+
iframe.enabled && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: getClassName36("browserBar"), children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
13192
13398
|
BrowserBar,
|
|
13193
13399
|
{
|
|
13194
13400
|
onViewportChange: (viewport) => {
|
|
13401
|
+
autoSelectingRef.current = false;
|
|
13195
13402
|
setShowTransition(true);
|
|
13196
13403
|
isResizingRef.current = true;
|
|
13197
13404
|
const uiViewport = __spreadProps(__spreadValues({}, viewport), {
|
|
@@ -13204,23 +13411,23 @@ var Canvas = () => {
|
|
|
13204
13411
|
}
|
|
13205
13412
|
}
|
|
13206
13413
|
) }),
|
|
13207
|
-
/* @__PURE__ */ (0,
|
|
13414
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
13208
13415
|
"div",
|
|
13209
13416
|
{
|
|
13210
|
-
className:
|
|
13417
|
+
className: getClassName36("root"),
|
|
13211
13418
|
suppressHydrationWarning: true,
|
|
13212
13419
|
id: "editor-canvas-root",
|
|
13213
13420
|
onTransitionEnd: () => {
|
|
13214
13421
|
setShowTransition(false);
|
|
13215
13422
|
isResizingRef.current = false;
|
|
13216
13423
|
},
|
|
13217
|
-
children: /* @__PURE__ */ (0,
|
|
13424
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(CustomPreview, { children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Preview2, {}) })
|
|
13218
13425
|
}
|
|
13219
13426
|
)
|
|
13220
13427
|
]
|
|
13221
13428
|
}
|
|
13222
13429
|
),
|
|
13223
|
-
/* @__PURE__ */ (0,
|
|
13430
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: getClassName36("loader"), children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Loader, { size: 24 }) })
|
|
13224
13431
|
] })
|
|
13225
13432
|
}
|
|
13226
13433
|
);
|
|
@@ -13228,15 +13435,15 @@ var Canvas = () => {
|
|
|
13228
13435
|
|
|
13229
13436
|
// lib/use-sidebar-resize.ts
|
|
13230
13437
|
init_react_import();
|
|
13231
|
-
var
|
|
13438
|
+
var import_react89 = require("react");
|
|
13232
13439
|
init_store();
|
|
13233
13440
|
function useSidebarResize(position, dispatch) {
|
|
13234
|
-
const [width, setWidth] = (0,
|
|
13235
|
-
const sidebarRef = (0,
|
|
13441
|
+
const [width, setWidth] = (0, import_react89.useState)(null);
|
|
13442
|
+
const sidebarRef = (0, import_react89.useRef)(null);
|
|
13236
13443
|
const storeWidth = useAppStore(
|
|
13237
13444
|
(s) => position === "left" ? s.state.ui.leftSideBarWidth : s.state.ui.rightSideBarWidth
|
|
13238
13445
|
);
|
|
13239
|
-
(0,
|
|
13446
|
+
(0, import_react89.useEffect)(() => {
|
|
13240
13447
|
if (typeof window !== "undefined" && !storeWidth) {
|
|
13241
13448
|
try {
|
|
13242
13449
|
const savedWidths = localStorage.getItem("editor-sidebar-widths");
|
|
@@ -13261,12 +13468,12 @@ function useSidebarResize(position, dispatch) {
|
|
|
13261
13468
|
}
|
|
13262
13469
|
}
|
|
13263
13470
|
}, [dispatch, position, storeWidth]);
|
|
13264
|
-
(0,
|
|
13471
|
+
(0, import_react89.useEffect)(() => {
|
|
13265
13472
|
if (storeWidth !== void 0) {
|
|
13266
13473
|
setWidth(storeWidth);
|
|
13267
13474
|
}
|
|
13268
13475
|
}, [storeWidth]);
|
|
13269
|
-
const handleResizeEnd = (0,
|
|
13476
|
+
const handleResizeEnd = (0, import_react89.useCallback)(
|
|
13270
13477
|
(width2) => {
|
|
13271
13478
|
dispatch({
|
|
13272
13479
|
type: "setUi",
|
|
@@ -13313,27 +13520,27 @@ init_react_import();
|
|
|
13313
13520
|
|
|
13314
13521
|
// components/Editor/components/ResizeHandle/index.tsx
|
|
13315
13522
|
init_react_import();
|
|
13316
|
-
var
|
|
13523
|
+
var import_react90 = require("react");
|
|
13317
13524
|
init_get_class_name_factory();
|
|
13318
13525
|
|
|
13319
|
-
// css-module:/Users/rami/Documents/apps/
|
|
13526
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Editor/components/ResizeHandle/styles.module.css#css-module
|
|
13320
13527
|
init_react_import();
|
|
13321
|
-
var
|
|
13528
|
+
var styles_module_default30 = { "ResizeHandle": "_ResizeHandle_1u3rv_2", "ResizeHandle--left": "_ResizeHandle--left_1u3rv_16", "ResizeHandle--right": "_ResizeHandle--right_1u3rv_20" };
|
|
13322
13529
|
|
|
13323
13530
|
// components/Editor/components/ResizeHandle/index.tsx
|
|
13324
|
-
var
|
|
13325
|
-
var
|
|
13531
|
+
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
13532
|
+
var getClassName37 = get_class_name_factory_default("ResizeHandle", styles_module_default30);
|
|
13326
13533
|
var ResizeHandle = ({
|
|
13327
13534
|
position,
|
|
13328
13535
|
sidebarRef,
|
|
13329
13536
|
onResize,
|
|
13330
13537
|
onResizeEnd
|
|
13331
13538
|
}) => {
|
|
13332
|
-
const handleRef = (0,
|
|
13333
|
-
const isDragging = (0,
|
|
13334
|
-
const startX = (0,
|
|
13335
|
-
const startWidth = (0,
|
|
13336
|
-
const handleMouseMove = (0,
|
|
13539
|
+
const handleRef = (0, import_react90.useRef)(null);
|
|
13540
|
+
const isDragging = (0, import_react90.useRef)(false);
|
|
13541
|
+
const startX = (0, import_react90.useRef)(0);
|
|
13542
|
+
const startWidth = (0, import_react90.useRef)(0);
|
|
13543
|
+
const handleMouseMove = (0, import_react90.useCallback)(
|
|
13337
13544
|
(e) => {
|
|
13338
13545
|
if (!isDragging.current) return;
|
|
13339
13546
|
const delta = e.clientX - startX.current;
|
|
@@ -13344,7 +13551,7 @@ var ResizeHandle = ({
|
|
|
13344
13551
|
},
|
|
13345
13552
|
[onResize, position]
|
|
13346
13553
|
);
|
|
13347
|
-
const handleMouseUp = (0,
|
|
13554
|
+
const handleMouseUp = (0, import_react90.useCallback)(() => {
|
|
13348
13555
|
var _a;
|
|
13349
13556
|
if (!isDragging.current) return;
|
|
13350
13557
|
isDragging.current = false;
|
|
@@ -13359,7 +13566,7 @@ var ResizeHandle = ({
|
|
|
13359
13566
|
const finalWidth = ((_a = sidebarRef.current) == null ? void 0 : _a.getBoundingClientRect().width) || 0;
|
|
13360
13567
|
onResizeEnd(finalWidth);
|
|
13361
13568
|
}, [onResizeEnd]);
|
|
13362
|
-
const handleMouseDown = (0,
|
|
13569
|
+
const handleMouseDown = (0, import_react90.useCallback)(
|
|
13363
13570
|
(e) => {
|
|
13364
13571
|
var _a;
|
|
13365
13572
|
isDragging.current = true;
|
|
@@ -13377,11 +13584,11 @@ var ResizeHandle = ({
|
|
|
13377
13584
|
},
|
|
13378
13585
|
[position, handleMouseMove, handleMouseUp]
|
|
13379
13586
|
);
|
|
13380
|
-
return /* @__PURE__ */ (0,
|
|
13587
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
13381
13588
|
"div",
|
|
13382
13589
|
{
|
|
13383
13590
|
ref: handleRef,
|
|
13384
|
-
className:
|
|
13591
|
+
className: getClassName37({ [position]: true }),
|
|
13385
13592
|
onMouseDown: handleMouseDown
|
|
13386
13593
|
}
|
|
13387
13594
|
);
|
|
@@ -13390,13 +13597,13 @@ var ResizeHandle = ({
|
|
|
13390
13597
|
// components/Editor/components/Sidebar/index.tsx
|
|
13391
13598
|
init_get_class_name_factory();
|
|
13392
13599
|
|
|
13393
|
-
// css-module:/Users/rami/Documents/apps/
|
|
13600
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Editor/components/Sidebar/styles.module.css#css-module
|
|
13394
13601
|
init_react_import();
|
|
13395
|
-
var
|
|
13602
|
+
var styles_module_default31 = { "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" };
|
|
13396
13603
|
|
|
13397
13604
|
// components/Editor/components/Sidebar/index.tsx
|
|
13398
|
-
var
|
|
13399
|
-
var
|
|
13605
|
+
var import_jsx_runtime87 = require("react/jsx-runtime");
|
|
13606
|
+
var getClassName38 = get_class_name_factory_default("Sidebar", styles_module_default31);
|
|
13400
13607
|
var Sidebar = ({
|
|
13401
13608
|
position,
|
|
13402
13609
|
sidebarRef,
|
|
@@ -13405,16 +13612,16 @@ var Sidebar = ({
|
|
|
13405
13612
|
onResizeEnd,
|
|
13406
13613
|
children
|
|
13407
13614
|
}) => {
|
|
13408
|
-
return /* @__PURE__ */ (0,
|
|
13409
|
-
/* @__PURE__ */ (0,
|
|
13615
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(import_jsx_runtime87.Fragment, { children: [
|
|
13616
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
13410
13617
|
"div",
|
|
13411
13618
|
{
|
|
13412
13619
|
ref: sidebarRef,
|
|
13413
|
-
className:
|
|
13620
|
+
className: getClassName38({ [position]: true, isVisible }),
|
|
13414
13621
|
children
|
|
13415
13622
|
}
|
|
13416
13623
|
),
|
|
13417
|
-
/* @__PURE__ */ (0,
|
|
13624
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: `${getClassName38("resizeHandle")}`, children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
13418
13625
|
ResizeHandle,
|
|
13419
13626
|
{
|
|
13420
13627
|
position,
|
|
@@ -13428,7 +13635,7 @@ var Sidebar = ({
|
|
|
13428
13635
|
|
|
13429
13636
|
// lib/use-delete-hotkeys.ts
|
|
13430
13637
|
init_react_import();
|
|
13431
|
-
var
|
|
13638
|
+
var import_react91 = require("react");
|
|
13432
13639
|
init_use_hotkey();
|
|
13433
13640
|
init_store();
|
|
13434
13641
|
var isElementVisible = (element) => {
|
|
@@ -13465,7 +13672,7 @@ var shouldBlockDeleteHotkey = (e) => {
|
|
|
13465
13672
|
};
|
|
13466
13673
|
var useDeleteHotkeys = () => {
|
|
13467
13674
|
const appStore = useAppStoreApi();
|
|
13468
|
-
const deleteSelectedComponent = (0,
|
|
13675
|
+
const deleteSelectedComponent = (0, import_react91.useCallback)(
|
|
13469
13676
|
(e) => {
|
|
13470
13677
|
var _a;
|
|
13471
13678
|
if (shouldBlockDeleteHotkey(e)) {
|
|
@@ -13492,15 +13699,15 @@ var useDeleteHotkeys = () => {
|
|
|
13492
13699
|
// components/Editor/components/Nav/index.tsx
|
|
13493
13700
|
init_react_import();
|
|
13494
13701
|
|
|
13495
|
-
// css-module:/Users/rami/Documents/apps/
|
|
13702
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Editor/components/Nav/styles.module.css#css-module
|
|
13496
13703
|
init_react_import();
|
|
13497
|
-
var
|
|
13704
|
+
var styles_module_default32 = { "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" };
|
|
13498
13705
|
|
|
13499
13706
|
// components/Editor/components/Nav/index.tsx
|
|
13500
13707
|
init_lib();
|
|
13501
|
-
var
|
|
13502
|
-
var
|
|
13503
|
-
var getClassNameItem3 = get_class_name_factory_default("NavItem",
|
|
13708
|
+
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
13709
|
+
var getClassName39 = get_class_name_factory_default("Nav", styles_module_default32);
|
|
13710
|
+
var getClassNameItem3 = get_class_name_factory_default("NavItem", styles_module_default32);
|
|
13504
13711
|
var MenuItem = ({
|
|
13505
13712
|
label,
|
|
13506
13713
|
icon,
|
|
@@ -13509,7 +13716,7 @@ var MenuItem = ({
|
|
|
13509
13716
|
mobileOnly,
|
|
13510
13717
|
desktopOnly
|
|
13511
13718
|
}) => {
|
|
13512
|
-
return /* @__PURE__ */ (0,
|
|
13719
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
13513
13720
|
"li",
|
|
13514
13721
|
{
|
|
13515
13722
|
className: getClassNameItem3({
|
|
@@ -13517,9 +13724,9 @@ var MenuItem = ({
|
|
|
13517
13724
|
mobileOnly,
|
|
13518
13725
|
desktopOnly
|
|
13519
13726
|
}),
|
|
13520
|
-
children: onClick && /* @__PURE__ */ (0,
|
|
13521
|
-
icon && /* @__PURE__ */ (0,
|
|
13522
|
-
/* @__PURE__ */ (0,
|
|
13727
|
+
children: onClick && /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: getClassNameItem3("link"), onClick, children: [
|
|
13728
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { className: getClassNameItem3("linkIcon"), children: icon }),
|
|
13729
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { className: getClassNameItem3("linkLabel"), children: label })
|
|
13523
13730
|
] })
|
|
13524
13731
|
}
|
|
13525
13732
|
);
|
|
@@ -13528,9 +13735,9 @@ var Nav = ({
|
|
|
13528
13735
|
items,
|
|
13529
13736
|
footer
|
|
13530
13737
|
}) => {
|
|
13531
|
-
return /* @__PURE__ */ (0,
|
|
13532
|
-
/* @__PURE__ */ (0,
|
|
13533
|
-
footer && /* @__PURE__ */ (0,
|
|
13738
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("nav", { className: getClassName39(), children: [
|
|
13739
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("ul", { className: getClassName39("list"), children: Object.entries(items).map(([key, item]) => /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(MenuItem, __spreadValues({}, item), key)) }),
|
|
13740
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: getClassName39("footer"), children: footer })
|
|
13534
13741
|
] });
|
|
13535
13742
|
};
|
|
13536
13743
|
|
|
@@ -13542,38 +13749,38 @@ init_lucide_react();
|
|
|
13542
13749
|
init_react_import();
|
|
13543
13750
|
init_lucide_react();
|
|
13544
13751
|
|
|
13545
|
-
// css-module:/Users/rami/Documents/apps/
|
|
13752
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/plugins/blocks/styles.module.css#css-module
|
|
13546
13753
|
init_react_import();
|
|
13547
|
-
var
|
|
13754
|
+
var styles_module_default33 = { "BlocksPlugin": "_BlocksPlugin_15ud0_1" };
|
|
13548
13755
|
|
|
13549
13756
|
// plugins/blocks/index.tsx
|
|
13550
13757
|
init_lib();
|
|
13551
|
-
var
|
|
13552
|
-
var
|
|
13758
|
+
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
13759
|
+
var getClassName40 = get_class_name_factory_default("BlocksPlugin", styles_module_default33);
|
|
13553
13760
|
var blocksPlugin = () => ({
|
|
13554
13761
|
name: "blocks",
|
|
13555
13762
|
label: "Blocks",
|
|
13556
|
-
render: () => /* @__PURE__ */ (0,
|
|
13557
|
-
icon: /* @__PURE__ */ (0,
|
|
13763
|
+
render: () => /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: getClassName40(), children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(Components, {}) }),
|
|
13764
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(Plus, {})
|
|
13558
13765
|
});
|
|
13559
13766
|
|
|
13560
13767
|
// plugins/outline/index.tsx
|
|
13561
13768
|
init_react_import();
|
|
13562
13769
|
init_lucide_react();
|
|
13563
13770
|
|
|
13564
|
-
// css-module:/Users/rami/Documents/apps/
|
|
13771
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/plugins/outline/styles.module.css#css-module
|
|
13565
13772
|
init_react_import();
|
|
13566
|
-
var
|
|
13773
|
+
var styles_module_default34 = { "OutlinePlugin": "_OutlinePlugin_q92j6_1" };
|
|
13567
13774
|
|
|
13568
13775
|
// plugins/outline/index.tsx
|
|
13569
13776
|
init_lib();
|
|
13570
|
-
var
|
|
13571
|
-
var
|
|
13777
|
+
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
13778
|
+
var getClassName41 = get_class_name_factory_default("OutlinePlugin", styles_module_default34);
|
|
13572
13779
|
var outlinePlugin = () => ({
|
|
13573
13780
|
name: "outline",
|
|
13574
13781
|
label: "Outline",
|
|
13575
|
-
render: () => /* @__PURE__ */ (0,
|
|
13576
|
-
icon: /* @__PURE__ */ (0,
|
|
13782
|
+
render: () => /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: getClassName41(), children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Outline, {}) }),
|
|
13783
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Layers, {})
|
|
13577
13784
|
});
|
|
13578
13785
|
|
|
13579
13786
|
// plugins/fields/index.tsx
|
|
@@ -13581,14 +13788,14 @@ init_react_import();
|
|
|
13581
13788
|
init_lucide_react();
|
|
13582
13789
|
init_store();
|
|
13583
13790
|
|
|
13584
|
-
// css-module:/Users/rami/Documents/apps/
|
|
13791
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/plugins/fields/styles.module.css#css-module
|
|
13585
13792
|
init_react_import();
|
|
13586
|
-
var
|
|
13793
|
+
var styles_module_default35 = { "FieldsPlugin": "_FieldsPlugin_262zt_1", "FieldsPlugin-header": "_FieldsPlugin-header_262zt_7" };
|
|
13587
13794
|
|
|
13588
13795
|
// plugins/fields/index.tsx
|
|
13589
13796
|
init_lib();
|
|
13590
|
-
var
|
|
13591
|
-
var
|
|
13797
|
+
var import_jsx_runtime91 = require("react/jsx-runtime");
|
|
13798
|
+
var getClassName42 = get_class_name_factory_default("FieldsPlugin", styles_module_default35);
|
|
13592
13799
|
var CurrentTitle = () => {
|
|
13593
13800
|
const label = useAppStore((s) => {
|
|
13594
13801
|
var _a, _b;
|
|
@@ -13600,17 +13807,17 @@ var CurrentTitle = () => {
|
|
|
13600
13807
|
var fieldsPlugin = ({ desktopSideBar = "right" } = {}) => ({
|
|
13601
13808
|
name: "fields",
|
|
13602
13809
|
label: "Fields",
|
|
13603
|
-
render: () => /* @__PURE__ */ (0,
|
|
13604
|
-
/* @__PURE__ */ (0,
|
|
13605
|
-
/* @__PURE__ */ (0,
|
|
13810
|
+
render: () => /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: getClassName42(), children: [
|
|
13811
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: getClassName42("header"), children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Breadcrumbs, { numParents: 2, children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(CurrentTitle, {}) }) }),
|
|
13812
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Fields, {})
|
|
13606
13813
|
] }),
|
|
13607
|
-
icon: /* @__PURE__ */ (0,
|
|
13814
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(RectangleEllipsis, {}),
|
|
13608
13815
|
mobileOnly: desktopSideBar === "right"
|
|
13609
13816
|
});
|
|
13610
13817
|
|
|
13611
13818
|
// components/Editor/components/Layout/index.tsx
|
|
13612
|
-
var
|
|
13613
|
-
var
|
|
13819
|
+
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
13820
|
+
var getClassName43 = get_class_name_factory_default("Editor", styles_module_default24);
|
|
13614
13821
|
var getLayoutClassName = get_class_name_factory_default("EditorLayout", styles_module_default24);
|
|
13615
13822
|
var getPluginTabClassName = get_class_name_factory_default("EditorPluginTab", styles_module_default24);
|
|
13616
13823
|
var FieldSideBarToolbar = () => {
|
|
@@ -13623,30 +13830,30 @@ var FieldSideBarToolbar = () => {
|
|
|
13623
13830
|
const CustomHeaderActions = useAppStore(
|
|
13624
13831
|
(s) => s.overrides.headerActions || DefaultOverride
|
|
13625
13832
|
);
|
|
13626
|
-
return /* @__PURE__ */ (0,
|
|
13627
|
-
/* @__PURE__ */ (0,
|
|
13628
|
-
/* @__PURE__ */ (0,
|
|
13833
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { className: getClassName43("fieldSideBarToolbar"), children: [
|
|
13834
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { className: getClassName43("fieldSideBarHistory"), children: [
|
|
13835
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
13629
13836
|
IconButton,
|
|
13630
13837
|
{
|
|
13631
13838
|
type: "button",
|
|
13632
13839
|
title: "undo",
|
|
13633
13840
|
disabled: !hasPast,
|
|
13634
13841
|
onClick: back,
|
|
13635
|
-
children: /* @__PURE__ */ (0,
|
|
13842
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Undo2, { size: 18 })
|
|
13636
13843
|
}
|
|
13637
13844
|
),
|
|
13638
|
-
/* @__PURE__ */ (0,
|
|
13845
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
13639
13846
|
IconButton,
|
|
13640
13847
|
{
|
|
13641
13848
|
type: "button",
|
|
13642
13849
|
title: "redo",
|
|
13643
13850
|
disabled: !hasFuture,
|
|
13644
13851
|
onClick: forward,
|
|
13645
|
-
children: /* @__PURE__ */ (0,
|
|
13852
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Redo2, { size: 18 })
|
|
13646
13853
|
}
|
|
13647
13854
|
)
|
|
13648
13855
|
] }),
|
|
13649
|
-
/* @__PURE__ */ (0,
|
|
13856
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { className: getClassName43("fieldSideBarActions"), children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(CustomHeaderActions, { children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
13650
13857
|
Button,
|
|
13651
13858
|
{
|
|
13652
13859
|
onClick: () => {
|
|
@@ -13665,9 +13872,9 @@ var FieldSideBar = () => {
|
|
|
13665
13872
|
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";
|
|
13666
13873
|
}
|
|
13667
13874
|
);
|
|
13668
|
-
return /* @__PURE__ */ (0,
|
|
13669
|
-
/* @__PURE__ */ (0,
|
|
13670
|
-
/* @__PURE__ */ (0,
|
|
13875
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(import_jsx_runtime92.Fragment, { children: [
|
|
13876
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)(FieldSideBarToolbar, {}),
|
|
13877
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)(SidebarSection, { noBorderTop: true, showBreadcrumbs: true, title, children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Fields, {}) })
|
|
13671
13878
|
] });
|
|
13672
13879
|
};
|
|
13673
13880
|
var PluginTab = ({
|
|
@@ -13675,7 +13882,7 @@ var PluginTab = ({
|
|
|
13675
13882
|
visible,
|
|
13676
13883
|
mobileOnly
|
|
13677
13884
|
}) => {
|
|
13678
|
-
return /* @__PURE__ */ (0,
|
|
13885
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { className: getPluginTabClassName({ visible, mobileOnly }), children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { className: getPluginTabClassName("body"), children }) });
|
|
13679
13886
|
};
|
|
13680
13887
|
var Layout = ({ children }) => {
|
|
13681
13888
|
const {
|
|
@@ -13685,7 +13892,7 @@ var Layout = ({ children }) => {
|
|
|
13685
13892
|
plugins,
|
|
13686
13893
|
height
|
|
13687
13894
|
} = usePropsContext();
|
|
13688
|
-
const iframe = (0,
|
|
13895
|
+
const iframe = (0, import_react92.useMemo)(
|
|
13689
13896
|
() => __spreadValues({
|
|
13690
13897
|
enabled: true,
|
|
13691
13898
|
waitForStyles: true
|
|
@@ -13711,7 +13918,7 @@ var Layout = ({ children }) => {
|
|
|
13711
13918
|
sidebarRef: rightSidebarRef,
|
|
13712
13919
|
handleResizeEnd: handleRightSidebarResizeEnd
|
|
13713
13920
|
} = useSidebarResize("right", dispatch);
|
|
13714
|
-
(0,
|
|
13921
|
+
(0, import_react92.useEffect)(() => {
|
|
13715
13922
|
if (!window.matchMedia("(min-width: 638px)").matches) {
|
|
13716
13923
|
dispatch({
|
|
13717
13924
|
type: "setUi",
|
|
@@ -13735,17 +13942,17 @@ var Layout = ({ children }) => {
|
|
|
13735
13942
|
};
|
|
13736
13943
|
}, []);
|
|
13737
13944
|
const overrides = useAppStore((s) => s.overrides);
|
|
13738
|
-
const CustomEditor = (0,
|
|
13945
|
+
const CustomEditor = (0, import_react92.useMemo)(
|
|
13739
13946
|
() => overrides.editor || DefaultOverride,
|
|
13740
13947
|
[overrides]
|
|
13741
13948
|
);
|
|
13742
|
-
const [mounted, setMounted] = (0,
|
|
13743
|
-
(0,
|
|
13949
|
+
const [mounted, setMounted] = (0, import_react92.useState)(false);
|
|
13950
|
+
(0, import_react92.useEffect)(() => {
|
|
13744
13951
|
setMounted(true);
|
|
13745
13952
|
}, []);
|
|
13746
13953
|
const ready = useAppStore((s) => s.status === "READY");
|
|
13747
13954
|
useMonitorHotkeys();
|
|
13748
|
-
(0,
|
|
13955
|
+
(0, import_react92.useEffect)(() => {
|
|
13749
13956
|
if (ready && iframe.enabled) {
|
|
13750
13957
|
const frameDoc = getFrame();
|
|
13751
13958
|
if (frameDoc) {
|
|
@@ -13757,10 +13964,10 @@ var Layout = ({ children }) => {
|
|
|
13757
13964
|
useDeleteHotkeys();
|
|
13758
13965
|
const layoutOptions = {};
|
|
13759
13966
|
if (leftWidth) {
|
|
13760
|
-
layoutOptions["--
|
|
13967
|
+
layoutOptions["--editor-user-left-side-bar-width"] = `${leftWidth}px`;
|
|
13761
13968
|
}
|
|
13762
13969
|
if (rightWidth) {
|
|
13763
|
-
layoutOptions["--
|
|
13970
|
+
layoutOptions["--editor-user-right-side-bar-width"] = `${rightWidth}px`;
|
|
13764
13971
|
}
|
|
13765
13972
|
const setUi = useAppStore((s) => s.setUi);
|
|
13766
13973
|
const currentPlugin = useAppStore((s) => {
|
|
@@ -13768,15 +13975,15 @@ var Layout = ({ children }) => {
|
|
|
13768
13975
|
return (_a = s.state.ui.plugin) == null ? void 0 : _a.current;
|
|
13769
13976
|
});
|
|
13770
13977
|
const appStoreApi = useAppStoreApi();
|
|
13771
|
-
const [mobilePanelHeightMode, setMobilePanelHeightMode] = (0,
|
|
13772
|
-
const [mobilePanelHeight, setMobilePanelHeight] = (0,
|
|
13978
|
+
const [mobilePanelHeightMode, setMobilePanelHeightMode] = (0, import_react92.useState)("toggle");
|
|
13979
|
+
const [mobilePanelHeight, setMobilePanelHeight] = (0, import_react92.useState)(
|
|
13773
13980
|
null
|
|
13774
13981
|
);
|
|
13775
|
-
const mobilePanelRef = (0,
|
|
13776
|
-
const isDraggingMobile = (0,
|
|
13777
|
-
const dragStartY = (0,
|
|
13778
|
-
const dragStartHeight = (0,
|
|
13779
|
-
const handleMobileDragStart = (0,
|
|
13982
|
+
const mobilePanelRef = (0, import_react92.useRef)(null);
|
|
13983
|
+
const isDraggingMobile = (0, import_react92.useRef)(false);
|
|
13984
|
+
const dragStartY = (0, import_react92.useRef)(0);
|
|
13985
|
+
const dragStartHeight = (0, import_react92.useRef)(0);
|
|
13986
|
+
const handleMobileDragStart = (0, import_react92.useCallback)(
|
|
13780
13987
|
(clientY) => {
|
|
13781
13988
|
isDraggingMobile.current = true;
|
|
13782
13989
|
dragStartY.current = clientY;
|
|
@@ -13787,7 +13994,7 @@ var Layout = ({ children }) => {
|
|
|
13787
13994
|
},
|
|
13788
13995
|
[]
|
|
13789
13996
|
);
|
|
13790
|
-
const handleMobileDragMove = (0,
|
|
13997
|
+
const handleMobileDragMove = (0, import_react92.useCallback)((clientY) => {
|
|
13791
13998
|
if (!isDraggingMobile.current) return;
|
|
13792
13999
|
const delta = dragStartY.current - clientY;
|
|
13793
14000
|
const viewportHeight = window.innerHeight;
|
|
@@ -13796,13 +14003,13 @@ var Layout = ({ children }) => {
|
|
|
13796
14003
|
const newH = Math.min(maxH, Math.max(minH, dragStartHeight.current + delta));
|
|
13797
14004
|
setMobilePanelHeight(newH);
|
|
13798
14005
|
}, []);
|
|
13799
|
-
const handleMobileDragEnd = (0,
|
|
14006
|
+
const handleMobileDragEnd = (0, import_react92.useCallback)(() => {
|
|
13800
14007
|
if (!isDraggingMobile.current) return;
|
|
13801
14008
|
isDraggingMobile.current = false;
|
|
13802
14009
|
document.body.style.userSelect = "";
|
|
13803
14010
|
document.body.style.touchAction = "";
|
|
13804
14011
|
}, []);
|
|
13805
|
-
(0,
|
|
14012
|
+
(0, import_react92.useEffect)(() => {
|
|
13806
14013
|
const onTouchMove = (e) => {
|
|
13807
14014
|
if (isDraggingMobile.current) {
|
|
13808
14015
|
e.preventDefault();
|
|
@@ -13828,26 +14035,26 @@ var Layout = ({ children }) => {
|
|
|
13828
14035
|
document.removeEventListener("mouseup", onMouseUp);
|
|
13829
14036
|
};
|
|
13830
14037
|
}, [handleMobileDragMove, handleMobileDragEnd]);
|
|
13831
|
-
const [theme, setTheme] = (0,
|
|
14038
|
+
const [theme, setTheme] = (0, import_react92.useState)(() => {
|
|
13832
14039
|
if (typeof window === "undefined") return "light";
|
|
13833
14040
|
const stored = window.localStorage.getItem("editor-theme");
|
|
13834
14041
|
if (stored === "light" || stored === "dark") return stored;
|
|
13835
14042
|
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
13836
14043
|
});
|
|
13837
|
-
(0,
|
|
14044
|
+
(0, import_react92.useEffect)(() => {
|
|
13838
14045
|
if (typeof window === "undefined") return;
|
|
13839
14046
|
window.localStorage.setItem("editor-theme", theme);
|
|
13840
14047
|
}, [theme]);
|
|
13841
14048
|
const toggleTheme = () => {
|
|
13842
14049
|
setTheme((t) => t === "dark" ? "light" : "dark");
|
|
13843
14050
|
};
|
|
13844
|
-
const themeIcon = theme === "dark" ? /* @__PURE__ */ (0,
|
|
14051
|
+
const themeIcon = theme === "dark" ? /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Sun, { size: 18 }) : /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Moon, { size: 18 });
|
|
13845
14052
|
const themeLabel = theme === "dark" ? "Switch to light mode" : "Switch to dark mode";
|
|
13846
|
-
const hasLegacySideBarPlugin = (0,
|
|
14053
|
+
const hasLegacySideBarPlugin = (0, import_react92.useMemo)(
|
|
13847
14054
|
() => !!(plugins == null ? void 0 : plugins.find((p) => p.name === "legacy-side-bar")),
|
|
13848
14055
|
[plugins]
|
|
13849
14056
|
);
|
|
13850
|
-
const pluginItems = (0,
|
|
14057
|
+
const pluginItems = (0, import_react92.useMemo)(() => {
|
|
13851
14058
|
const details = {};
|
|
13852
14059
|
const defaultPlugins = [blocksPlugin(), outlinePlugin()];
|
|
13853
14060
|
const isLegacy = (plugin) => plugin.name === "legacy-side-bar" ? -1 : 0;
|
|
@@ -13866,7 +14073,7 @@ var Layout = ({ children }) => {
|
|
|
13866
14073
|
}
|
|
13867
14074
|
details[plugin.name] = {
|
|
13868
14075
|
label: (_a = plugin.label) != null ? _a : plugin.name,
|
|
13869
|
-
icon: (_b = plugin.icon) != null ? _b : /* @__PURE__ */ (0,
|
|
14076
|
+
icon: (_b = plugin.icon) != null ? _b : /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(ToyBrick, {}),
|
|
13870
14077
|
onClick: () => {
|
|
13871
14078
|
var _a2;
|
|
13872
14079
|
setMobilePanelHeightMode((_a2 = plugin.mobilePanelHeight) != null ? _a2 : "toggle");
|
|
@@ -13894,7 +14101,7 @@ var Layout = ({ children }) => {
|
|
|
13894
14101
|
});
|
|
13895
14102
|
return details;
|
|
13896
14103
|
}, [plugins, currentPlugin, appStoreApi, leftSideBarVisible]);
|
|
13897
|
-
(0,
|
|
14104
|
+
(0, import_react92.useEffect)(() => {
|
|
13898
14105
|
if (!currentPlugin) {
|
|
13899
14106
|
const names = Object.keys(pluginItems);
|
|
13900
14107
|
setUi({ plugin: { current: names[0] } });
|
|
@@ -13903,19 +14110,19 @@ var Layout = ({ children }) => {
|
|
|
13903
14110
|
const hasDesktopFieldsPlugin = pluginItems["fields"] && pluginItems["fields"].mobileOnly === false;
|
|
13904
14111
|
const mobilePanelStyle = {};
|
|
13905
14112
|
if (mobilePanelHeight && leftSideBarVisible) {
|
|
13906
|
-
mobilePanelStyle["--
|
|
14113
|
+
mobilePanelStyle["--editor-mobile-panel-height"] = `${mobilePanelHeight}px`;
|
|
13907
14114
|
}
|
|
13908
|
-
return /* @__PURE__ */ (0,
|
|
14115
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(
|
|
13909
14116
|
"div",
|
|
13910
14117
|
{
|
|
13911
|
-
className: `Editor ${
|
|
14118
|
+
className: `Editor ${getClassName43({
|
|
13912
14119
|
hidePlugins: hasLegacySideBarPlugin
|
|
13913
14120
|
})}`,
|
|
13914
14121
|
id: instanceId,
|
|
13915
14122
|
"data-theme": theme,
|
|
13916
14123
|
style: { height },
|
|
13917
14124
|
children: [
|
|
13918
|
-
/* @__PURE__ */ (0,
|
|
14125
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)(DragDropContext, { disableAutoScroll: dnd == null ? void 0 : dnd.disableAutoScroll, children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(CustomEditor, { children: children || /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(FrameProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
13919
14126
|
"div",
|
|
13920
14127
|
{
|
|
13921
14128
|
className: getLayoutClassName({
|
|
@@ -13927,17 +14134,17 @@ var Layout = ({ children }) => {
|
|
|
13927
14134
|
mobilePanelCustomHeight: mobilePanelHeight !== null && leftSideBarVisible
|
|
13928
14135
|
}),
|
|
13929
14136
|
style: { height },
|
|
13930
|
-
children: /* @__PURE__ */ (0,
|
|
14137
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(
|
|
13931
14138
|
"div",
|
|
13932
14139
|
{
|
|
13933
14140
|
className: getLayoutClassName("inner"),
|
|
13934
14141
|
style: __spreadValues(__spreadValues({}, layoutOptions), mobilePanelStyle),
|
|
13935
14142
|
children: [
|
|
13936
|
-
/* @__PURE__ */ (0,
|
|
14143
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { className: getLayoutClassName("nav"), children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
13937
14144
|
Nav,
|
|
13938
14145
|
{
|
|
13939
14146
|
items: pluginItems,
|
|
13940
|
-
footer: /* @__PURE__ */ (0,
|
|
14147
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
13941
14148
|
IconButton,
|
|
13942
14149
|
{
|
|
13943
14150
|
type: "button",
|
|
@@ -13948,19 +14155,19 @@ var Layout = ({ children }) => {
|
|
|
13948
14155
|
)
|
|
13949
14156
|
}
|
|
13950
14157
|
) }),
|
|
13951
|
-
/* @__PURE__ */ (0,
|
|
14158
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(
|
|
13952
14159
|
"div",
|
|
13953
14160
|
{
|
|
13954
14161
|
ref: mobilePanelRef,
|
|
13955
14162
|
className: getLayoutClassName("mobilePanel"),
|
|
13956
14163
|
children: [
|
|
13957
|
-
/* @__PURE__ */ (0,
|
|
14164
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
13958
14165
|
"div",
|
|
13959
14166
|
{
|
|
13960
14167
|
className: getLayoutClassName("mobileDragHandle"),
|
|
13961
14168
|
onTouchStart: (e) => handleMobileDragStart(e.touches[0].clientY),
|
|
13962
14169
|
onMouseDown: (e) => handleMobileDragStart(e.clientY),
|
|
13963
|
-
children: /* @__PURE__ */ (0,
|
|
14170
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
13964
14171
|
"div",
|
|
13965
14172
|
{
|
|
13966
14173
|
className: getLayoutClassName("mobileDragHandlePill")
|
|
@@ -13968,17 +14175,17 @@ var Layout = ({ children }) => {
|
|
|
13968
14175
|
)
|
|
13969
14176
|
}
|
|
13970
14177
|
),
|
|
13971
|
-
/* @__PURE__ */ (0,
|
|
14178
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
13972
14179
|
"div",
|
|
13973
14180
|
{
|
|
13974
14181
|
className: getLayoutClassName("mobilePanelContent"),
|
|
13975
14182
|
children: Object.entries(pluginItems).map(
|
|
13976
|
-
([id, { mobileOnly, render: Render2 }]) => /* @__PURE__ */ (0,
|
|
14183
|
+
([id, { mobileOnly, render: Render2 }]) => /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
13977
14184
|
PluginTab,
|
|
13978
14185
|
{
|
|
13979
14186
|
visible: currentPlugin === id,
|
|
13980
14187
|
mobileOnly,
|
|
13981
|
-
children: /* @__PURE__ */ (0,
|
|
14188
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Render2, {})
|
|
13982
14189
|
},
|
|
13983
14190
|
id
|
|
13984
14191
|
)
|
|
@@ -13988,7 +14195,7 @@ var Layout = ({ children }) => {
|
|
|
13988
14195
|
]
|
|
13989
14196
|
}
|
|
13990
14197
|
),
|
|
13991
|
-
/* @__PURE__ */ (0,
|
|
14198
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
13992
14199
|
Sidebar,
|
|
13993
14200
|
{
|
|
13994
14201
|
position: "left",
|
|
@@ -13997,20 +14204,20 @@ var Layout = ({ children }) => {
|
|
|
13997
14204
|
onResize: setLeftWidth,
|
|
13998
14205
|
onResizeEnd: handleLeftSidebarResizeEnd,
|
|
13999
14206
|
children: Object.entries(pluginItems).map(
|
|
14000
|
-
([id, { mobileOnly, render: Render2, label }]) => /* @__PURE__ */ (0,
|
|
14207
|
+
([id, { mobileOnly, render: Render2, label }]) => /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
14001
14208
|
PluginTab,
|
|
14002
14209
|
{
|
|
14003
14210
|
visible: currentPlugin === id,
|
|
14004
14211
|
mobileOnly,
|
|
14005
|
-
children: /* @__PURE__ */ (0,
|
|
14212
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Render2, {})
|
|
14006
14213
|
},
|
|
14007
14214
|
id
|
|
14008
14215
|
)
|
|
14009
14216
|
)
|
|
14010
14217
|
}
|
|
14011
14218
|
),
|
|
14012
|
-
/* @__PURE__ */ (0,
|
|
14013
|
-
!hasDesktopFieldsPlugin && /* @__PURE__ */ (0,
|
|
14219
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Canvas, {}),
|
|
14220
|
+
!hasDesktopFieldsPlugin && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
14014
14221
|
Sidebar,
|
|
14015
14222
|
{
|
|
14016
14223
|
position: "right",
|
|
@@ -14018,7 +14225,7 @@ var Layout = ({ children }) => {
|
|
|
14018
14225
|
isVisible: rightSideBarVisible,
|
|
14019
14226
|
onResize: setRightWidth,
|
|
14020
14227
|
onResizeEnd: handleRightSidebarResizeEnd,
|
|
14021
|
-
children: /* @__PURE__ */ (0,
|
|
14228
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(FieldSideBar, {})
|
|
14022
14229
|
}
|
|
14023
14230
|
)
|
|
14024
14231
|
]
|
|
@@ -14026,27 +14233,25 @@ var Layout = ({ children }) => {
|
|
|
14026
14233
|
)
|
|
14027
14234
|
}
|
|
14028
14235
|
) }) }) }),
|
|
14029
|
-
/* @__PURE__ */ (0,
|
|
14236
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { id: "editor-portal-root", className: getClassName43("portal") })
|
|
14030
14237
|
]
|
|
14031
14238
|
}
|
|
14032
14239
|
);
|
|
14033
14240
|
};
|
|
14034
14241
|
|
|
14035
14242
|
// components/Editor/index.tsx
|
|
14036
|
-
var
|
|
14037
|
-
var propsContext = (0,
|
|
14243
|
+
var import_jsx_runtime93 = require("react/jsx-runtime");
|
|
14244
|
+
var propsContext = (0, import_react93.createContext)({});
|
|
14038
14245
|
function PropsProvider(props) {
|
|
14039
|
-
return /* @__PURE__ */ (0,
|
|
14246
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(propsContext.Provider, { value: props, children: props.children });
|
|
14040
14247
|
}
|
|
14041
|
-
var usePropsContext = () => (0,
|
|
14248
|
+
var usePropsContext = () => (0, import_react93.useContext)(propsContext);
|
|
14042
14249
|
function EditorProvider({ children }) {
|
|
14043
14250
|
const {
|
|
14044
14251
|
config,
|
|
14045
14252
|
data: initialData,
|
|
14046
|
-
globalData: initialGlobalData,
|
|
14047
14253
|
ui: initialUi,
|
|
14048
14254
|
onChange,
|
|
14049
|
-
onGlobalsChange,
|
|
14050
14255
|
permissions = {},
|
|
14051
14256
|
plugins,
|
|
14052
14257
|
overrides,
|
|
@@ -14059,15 +14264,15 @@ function EditorProvider({ children }) {
|
|
|
14059
14264
|
fullScreenCanvas,
|
|
14060
14265
|
_experimentalVirtualization
|
|
14061
14266
|
} = usePropsContext();
|
|
14062
|
-
const iframe = (0,
|
|
14267
|
+
const iframe = (0, import_react93.useMemo)(
|
|
14063
14268
|
() => __spreadValues({
|
|
14064
14269
|
enabled: true,
|
|
14065
14270
|
waitForStyles: true
|
|
14066
14271
|
}, _iframe),
|
|
14067
14272
|
[_iframe]
|
|
14068
14273
|
);
|
|
14069
|
-
const [generatedAppState] = (0,
|
|
14070
|
-
var _a, _b, _c, _d, _e;
|
|
14274
|
+
const [generatedAppState] = (0, import_react93.useState)(() => {
|
|
14275
|
+
var _a, _b, _c, _d, _e, _f;
|
|
14071
14276
|
const initial = __spreadValues(__spreadValues({}, defaultAppState.ui), initialUi);
|
|
14072
14277
|
let clientUiState = {};
|
|
14073
14278
|
if (Object.keys((initialData == null ? void 0 : initialData.root) || {}).length > 0 && !((_a = initialData == null ? void 0 : initialData.root) == null ? void 0 : _a.props)) {
|
|
@@ -14081,20 +14286,20 @@ function EditorProvider({ children }) {
|
|
|
14081
14286
|
toComponent(__spreadProps(__spreadValues({}, initialData == null ? void 0 : initialData.root), { props: defaultedRootProps })),
|
|
14082
14287
|
config
|
|
14083
14288
|
);
|
|
14084
|
-
const
|
|
14085
|
-
for (const [type, comp] of Object.entries((
|
|
14086
|
-
if ((comp == null ? void 0 : comp.global) && !
|
|
14087
|
-
|
|
14088
|
-
props: __spreadValues({}, (
|
|
14289
|
+
const seededGlobals = __spreadValues({}, (_d = initialData == null ? void 0 : initialData.globals) != null ? _d : {});
|
|
14290
|
+
for (const [type, comp] of Object.entries((_e = config.components) != null ? _e : {})) {
|
|
14291
|
+
if ((comp == null ? void 0 : comp.global) && !seededGlobals[type]) {
|
|
14292
|
+
seededGlobals[type] = {
|
|
14293
|
+
props: __spreadValues({}, (_f = comp == null ? void 0 : comp.defaultProps) != null ? _f : {})
|
|
14089
14294
|
};
|
|
14090
14295
|
}
|
|
14091
14296
|
}
|
|
14092
14297
|
const composedData = resolveGlobals(
|
|
14093
14298
|
__spreadProps(__spreadValues({}, initialData), {
|
|
14094
14299
|
root: __spreadProps(__spreadValues({}, initialData == null ? void 0 : initialData.root), { props: root.props }),
|
|
14095
|
-
content: initialData.content || []
|
|
14300
|
+
content: initialData.content || [],
|
|
14301
|
+
globals: seededGlobals
|
|
14096
14302
|
}),
|
|
14097
|
-
seededGlobalData,
|
|
14098
14303
|
config
|
|
14099
14304
|
);
|
|
14100
14305
|
const newAppState = __spreadProps(__spreadValues({}, defaultAppState), {
|
|
@@ -14118,7 +14323,7 @@ function EditorProvider({ children }) {
|
|
|
14118
14323
|
return walkAppState(newAppState, config);
|
|
14119
14324
|
});
|
|
14120
14325
|
const { appendData = true } = _initialHistory || {};
|
|
14121
|
-
const [blendedHistories] = (0,
|
|
14326
|
+
const [blendedHistories] = (0, import_react93.useState)(
|
|
14122
14327
|
[
|
|
14123
14328
|
...(_initialHistory == null ? void 0 : _initialHistory.histories) || [],
|
|
14124
14329
|
...appendData ? [{ state: generatedAppState }] : []
|
|
@@ -14132,7 +14337,7 @@ function EditorProvider({ children }) {
|
|
|
14132
14337
|
});
|
|
14133
14338
|
})
|
|
14134
14339
|
);
|
|
14135
|
-
const initialHistoryIndex = (0,
|
|
14340
|
+
const initialHistoryIndex = (0, import_react93.useMemo)(() => {
|
|
14136
14341
|
if ((_initialHistory == null ? void 0 : _initialHistory.index) !== void 0 && (_initialHistory == null ? void 0 : _initialHistory.index) >= 0 && (_initialHistory == null ? void 0 : _initialHistory.index) < blendedHistories.length) {
|
|
14137
14342
|
return _initialHistory == null ? void 0 : _initialHistory.index;
|
|
14138
14343
|
}
|
|
@@ -14143,7 +14348,7 @@ function EditorProvider({ children }) {
|
|
|
14143
14348
|
overrides,
|
|
14144
14349
|
plugins
|
|
14145
14350
|
});
|
|
14146
|
-
const loadedFieldTransforms = (0,
|
|
14351
|
+
const loadedFieldTransforms = (0, import_react93.useMemo)(() => {
|
|
14147
14352
|
const _plugins = plugins || [];
|
|
14148
14353
|
const pluginFieldTransforms = _plugins.reduce(
|
|
14149
14354
|
(acc, plugin) => __spreadValues(__spreadValues({}, acc), plugin.fieldTransforms),
|
|
@@ -14152,7 +14357,7 @@ function EditorProvider({ children }) {
|
|
|
14152
14357
|
return __spreadValues(__spreadValues({}, pluginFieldTransforms), fieldTransforms);
|
|
14153
14358
|
}, [fieldTransforms, plugins]);
|
|
14154
14359
|
const instanceId = useSafeId();
|
|
14155
|
-
const generateAppStore = (0,
|
|
14360
|
+
const generateAppStore = (0, import_react93.useCallback)(
|
|
14156
14361
|
(state) => {
|
|
14157
14362
|
return {
|
|
14158
14363
|
instanceId,
|
|
@@ -14184,15 +14389,15 @@ function EditorProvider({ children }) {
|
|
|
14184
14389
|
loadedFieldTransforms
|
|
14185
14390
|
]
|
|
14186
14391
|
);
|
|
14187
|
-
const [appStore] = (0,
|
|
14392
|
+
const [appStore] = (0, import_react93.useState)(
|
|
14188
14393
|
() => createAppStore(generateAppStore(initialAppState))
|
|
14189
14394
|
);
|
|
14190
|
-
(0,
|
|
14395
|
+
(0, import_react93.useEffect)(() => {
|
|
14191
14396
|
if (process.env.NODE_ENV !== "production") {
|
|
14192
14397
|
window.__PUCK_INTERNAL_DO_NOT_USE = { appStore };
|
|
14193
14398
|
}
|
|
14194
14399
|
}, [appStore]);
|
|
14195
|
-
(0,
|
|
14400
|
+
(0, import_react93.useEffect)(() => {
|
|
14196
14401
|
const state = appStore.getState().state;
|
|
14197
14402
|
appStore.setState(__spreadValues({}, generateAppStore(state)));
|
|
14198
14403
|
}, [generateAppStore]);
|
|
@@ -14201,36 +14406,31 @@ function EditorProvider({ children }) {
|
|
|
14201
14406
|
index: initialHistoryIndex,
|
|
14202
14407
|
initialAppState
|
|
14203
14408
|
});
|
|
14204
|
-
const previousData = (0,
|
|
14205
|
-
|
|
14206
|
-
(0, import_react92.useEffect)(() => {
|
|
14409
|
+
const previousData = (0, import_react93.useRef)(null);
|
|
14410
|
+
(0, import_react93.useEffect)(() => {
|
|
14207
14411
|
return appStore.subscribe(
|
|
14208
14412
|
(s) => s.state.data,
|
|
14209
14413
|
(data) => {
|
|
14210
|
-
const split =
|
|
14211
|
-
if (onChange && !(0, import_fast_equals4.deepEqual)(split
|
|
14212
|
-
onChange(split
|
|
14213
|
-
previousData.current = split
|
|
14214
|
-
}
|
|
14215
|
-
if (onGlobalsChange && !(0, import_fast_equals4.deepEqual)(split.globalData, previousGlobalData.current)) {
|
|
14216
|
-
onGlobalsChange(split.globalData);
|
|
14217
|
-
previousGlobalData.current = split.globalData;
|
|
14414
|
+
const split = splitGlobals(data, config);
|
|
14415
|
+
if (onChange && !(0, import_fast_equals4.deepEqual)(split, previousData.current)) {
|
|
14416
|
+
onChange(split);
|
|
14417
|
+
previousData.current = split;
|
|
14218
14418
|
}
|
|
14219
14419
|
}
|
|
14220
14420
|
);
|
|
14221
|
-
}, [onChange,
|
|
14421
|
+
}, [onChange, config]);
|
|
14222
14422
|
useRegisterPermissionsSlice(appStore, permissions);
|
|
14223
14423
|
const uEditorStore = useRegisterUseEditorStore(appStore);
|
|
14224
|
-
(0,
|
|
14424
|
+
(0, import_react93.useEffect)(() => {
|
|
14225
14425
|
const { resolveAndCommitData } = appStore.getState();
|
|
14226
14426
|
setTimeout(() => {
|
|
14227
14427
|
resolveAndCommitData();
|
|
14228
14428
|
}, 0);
|
|
14229
14429
|
}, []);
|
|
14230
|
-
return /* @__PURE__ */ (0,
|
|
14430
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(appStoreContext.Provider, { value: appStore, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(UseEditorStoreContext.Provider, { value: uEditorStore, children }) });
|
|
14231
14431
|
}
|
|
14232
14432
|
function Editor4(props) {
|
|
14233
|
-
return /* @__PURE__ */ (0,
|
|
14433
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(PropsProvider, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(EditorProvider, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Layout, { children: props.children }) })) }));
|
|
14234
14434
|
}
|
|
14235
14435
|
Editor4.Components = Components;
|
|
14236
14436
|
Editor4.Fields = Fields;
|
|
@@ -14516,12 +14716,12 @@ init_walk_tree();
|
|
|
14516
14716
|
|
|
14517
14717
|
// plugins/legacy-side-bar/index.tsx
|
|
14518
14718
|
init_react_import();
|
|
14519
|
-
var
|
|
14719
|
+
var import_jsx_runtime94 = require("react/jsx-runtime");
|
|
14520
14720
|
var legacySideBarPlugin = () => ({
|
|
14521
14721
|
name: "legacy-side-bar",
|
|
14522
|
-
render: () => /* @__PURE__ */ (0,
|
|
14523
|
-
/* @__PURE__ */ (0,
|
|
14524
|
-
/* @__PURE__ */ (0,
|
|
14722
|
+
render: () => /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { style: { overflowY: "auto" }, children: [
|
|
14723
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(SidebarSection, { title: "Components", noBorderTop: true, children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Components, {}) }),
|
|
14724
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(SidebarSection, { title: "Outline", children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Outline, {}) })
|
|
14525
14725
|
] })
|
|
14526
14726
|
});
|
|
14527
14727
|
// Annotate the CommonJS export names for ESM import in node:
|