@reacteditor/core 0.0.3 → 0.0.5
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-2TYODRQT.mjs → Editor-POJT3RA2.mjs} +8 -8
- package/dist/{Editor-GBV2O5RD.css → Editor-WYZZDKT3.css} +7 -7
- package/dist/{Render-VDC7AEQK.mjs → Render-JNABKPAF.mjs} +1 -1
- package/dist/{Render-EFT7YD2C.css → Render-WBTAN6PO.css} +1 -1
- 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-6Q6A3BQH.mjs → chunk-43G2QHSV.mjs} +12 -12
- package/dist/{chunk-HMTHZBH6.mjs → chunk-5N6RK26Z.mjs} +1 -1
- package/dist/{chunk-ZHNRSSMW.mjs → chunk-DCL4UC2H.mjs} +1 -1
- package/dist/{chunk-2LVYDXZS.mjs → chunk-IUOWXGYR.mjs} +2 -2
- package/dist/{chunk-M2RKJTNY.mjs → chunk-JEDWXGVP.mjs} +1 -1
- package/dist/{chunk-MFI3RDA4.mjs → chunk-KC727YFW.mjs} +1 -1
- package/dist/{chunk-QX2COKIL.mjs → chunk-QB3US7UE.mjs} +235 -266
- package/dist/{chunk-VUEM62JF.mjs → chunk-UB2DES2O.mjs} +17 -6
- package/dist/{chunk-TCVU3WEN.mjs → chunk-X7IRHSQN.mjs} +4 -4
- package/dist/{chunk-VD3EVRUF.mjs → chunk-YFRH22NT.mjs} +2 -2
- package/dist/{full-ELX6RALJ.css → full-5442HPZH.css} +6 -6
- package/dist/{full-7KJICNR5.mjs → full-HZMEMWCN.mjs} +6 -6
- 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 +93 -92
- package/dist/index.d.mts +11 -20
- package/dist/index.d.ts +11 -20
- package/dist/index.js +269 -296
- 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-IJNA4SY5.mjs → loaded-35JQLXSA.mjs} +3 -3
- package/dist/{loaded-TBSVRJPY.css → loaded-KZZU4RNL.css} +1 -1
- package/dist/{loaded-CBJRWD4Z.mjs → loaded-QJMKRN35.mjs} +3 -3
- package/dist/{loaded-DGSPK47E.mjs → loaded-U6ZILQXM.mjs} +3 -3
- package/dist/no-external.css +93 -92
- package/dist/no-external.d.mts +4 -4
- package/dist/no-external.d.ts +4 -4
- package/dist/no-external.js +269 -296
- package/dist/no-external.mjs +10 -10
- package/dist/rsc.css +1 -1
- package/dist/rsc.d.mts +2 -2
- package/dist/rsc.d.ts +2 -2
- package/dist/rsc.js +4 -4
- 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 +8 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
EditorInner,
|
|
3
3
|
LoadedRichTextMenu
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-X7IRHSQN.mjs";
|
|
5
5
|
import {
|
|
6
6
|
RichTextRenderFallback,
|
|
7
7
|
SlotRender,
|
|
@@ -10,13 +10,13 @@ import {
|
|
|
10
10
|
getSlotTransform,
|
|
11
11
|
useRichtextProps,
|
|
12
12
|
useSlots
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-YFRH22NT.mjs";
|
|
14
14
|
import {
|
|
15
15
|
ActionBar,
|
|
16
16
|
IconButton,
|
|
17
17
|
LoadedRichTextMenuInner,
|
|
18
18
|
Loader
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-43G2QHSV.mjs";
|
|
20
20
|
import {
|
|
21
21
|
Check,
|
|
22
22
|
ChevronDown,
|
|
@@ -60,14 +60,14 @@ import {
|
|
|
60
60
|
useRegisterFieldsSlice,
|
|
61
61
|
useRegisterHistorySlice,
|
|
62
62
|
useRegisterPermissionsSlice
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-IUOWXGYR.mjs";
|
|
64
64
|
import {
|
|
65
65
|
getItem,
|
|
66
66
|
insert,
|
|
67
67
|
insertAction,
|
|
68
68
|
makeStatePublic,
|
|
69
69
|
populateIds
|
|
70
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-UB2DES2O.mjs";
|
|
71
71
|
import {
|
|
72
72
|
defaultAppState,
|
|
73
73
|
defaultViewports
|
|
@@ -149,7 +149,7 @@ function setDeep(node, path, newVal) {
|
|
|
149
149
|
init_react_import();
|
|
150
150
|
import { useEffect, useState } from "react";
|
|
151
151
|
|
|
152
|
-
// css-module:/Users/rami/Documents/apps/
|
|
152
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Button/Button.module.css#css-module
|
|
153
153
|
init_react_import();
|
|
154
154
|
var Button_module_default = { "Button": "_Button_1g3xu_1", "Button--medium": "_Button--medium_1g3xu_31", "Button--large": "_Button--large_1g3xu_39", "Button-icon": "_Button-icon_1g3xu_46", "Button--primary": "_Button--primary_1g3xu_50", "Button--secondary": "_Button--secondary_1g3xu_71", "Button--flush": "_Button--flush_1g3xu_88", "Button--disabled": "_Button--disabled_1g3xu_92", "Button--fullWidth": "_Button--fullWidth_1g3xu_100", "Button-spinner": "_Button-spinner_1g3xu_105" };
|
|
155
155
|
|
|
@@ -238,7 +238,7 @@ var Button = (_a) => {
|
|
|
238
238
|
// components/AutoField/FieldLabel.tsx
|
|
239
239
|
init_react_import();
|
|
240
240
|
|
|
241
|
-
// css-module:/Users/rami/Documents/apps/
|
|
241
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/AutoField/styles.module.css#css-module
|
|
242
242
|
init_react_import();
|
|
243
243
|
var styles_module_default = { "InputWrapper": "_InputWrapper_yqqgz_1", "Input-label": "_Input-label_yqqgz_5", "Input-labelIcon": "_Input-labelIcon_yqqgz_15", "Input-disabledIcon": "_Input-disabledIcon_yqqgz_22", "Input-input": "_Input-input_yqqgz_27", "Input": "_Input_yqqgz_1", "Input--readOnly": "_Input--readOnly_yqqgz_87", "Input-radioGroupItems": "_Input-radioGroupItems_yqqgz_98", "Input-radio": "_Input-radio_yqqgz_98", "Input-radioInner": "_Input-radioInner_yqqgz_115", "Input-radioInput": "_Input-radioInput_yqqgz_147" };
|
|
244
244
|
|
|
@@ -306,7 +306,7 @@ init_react_import();
|
|
|
306
306
|
// components/AutoField/fields/ArrayField/index.tsx
|
|
307
307
|
init_react_import();
|
|
308
308
|
|
|
309
|
-
// css-module:/Users/rami/Documents/apps/
|
|
309
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/AutoField/fields/ArrayField/styles.module.css#css-module
|
|
310
310
|
init_react_import();
|
|
311
311
|
var styles_module_default2 = { "ArrayField": "_ArrayField_13xcf_5", "ArrayField--isDraggingFrom": "_ArrayField--isDraggingFrom_13xcf_14", "ArrayField-addButton": "_ArrayField-addButton_13xcf_19", "ArrayField--hasItems": "_ArrayField--hasItems_13xcf_35", "ArrayField-inner": "_ArrayField-inner_13xcf_61", "ArrayFieldItem": "_ArrayFieldItem_13xcf_69", "ArrayFieldItem--isDragging": "_ArrayFieldItem--isDragging_13xcf_78", "ArrayFieldItem--isExpanded": "_ArrayFieldItem--isExpanded_13xcf_82", "ArrayFieldItem-summary": "_ArrayFieldItem-summary_13xcf_97", "ArrayFieldItem--noFields": "_ArrayFieldItem--noFields_13xcf_118", "ArrayFieldItem-body": "_ArrayFieldItem-body_13xcf_147", "ArrayFieldItem-fieldset": "_ArrayFieldItem-fieldset_13xcf_156", "ArrayFieldItem-rhs": "_ArrayFieldItem-rhs_13xcf_164", "ArrayFieldItem-actions": "_ArrayFieldItem-actions_13xcf_170" };
|
|
312
312
|
|
|
@@ -374,7 +374,7 @@ import {
|
|
|
374
374
|
// components/DragIcon/index.tsx
|
|
375
375
|
init_react_import();
|
|
376
376
|
|
|
377
|
-
// css-module:/Users/rami/Documents/apps/
|
|
377
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/DragIcon/styles.module.css#css-module
|
|
378
378
|
init_react_import();
|
|
379
379
|
var styles_module_default3 = { "DragIcon": "_DragIcon_53afe_1", "DragIcon--disabled": "_DragIcon--disabled_53afe_8" };
|
|
380
380
|
|
|
@@ -392,11 +392,14 @@ init_react_import();
|
|
|
392
392
|
import { useState as useState3 } from "react";
|
|
393
393
|
import { PointerSensor } from "@dnd-kit/react";
|
|
394
394
|
import { isElement } from "@dnd-kit/dom/utilities";
|
|
395
|
-
|
|
396
|
-
var
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
395
|
+
import { PointerActivationConstraints } from "@dnd-kit/dom";
|
|
396
|
+
var touchDefault = [
|
|
397
|
+
new PointerActivationConstraints.Delay({ value: 200, tolerance: 10 })
|
|
398
|
+
];
|
|
399
|
+
var otherDefault = [
|
|
400
|
+
new PointerActivationConstraints.Delay({ value: 200, tolerance: 10 }),
|
|
401
|
+
new PointerActivationConstraints.Distance({ value: 5 })
|
|
402
|
+
];
|
|
400
403
|
var useSensors = ({
|
|
401
404
|
other = otherDefault,
|
|
402
405
|
mouse,
|
|
@@ -426,8 +429,8 @@ var useSensors = ({
|
|
|
426
429
|
// lib/dnd/collision/dynamic/index.ts
|
|
427
430
|
init_react_import();
|
|
428
431
|
import {
|
|
429
|
-
CollisionPriority
|
|
430
|
-
CollisionType as
|
|
432
|
+
CollisionPriority,
|
|
433
|
+
CollisionType as CollisionType2
|
|
431
434
|
} from "@dnd-kit/abstract";
|
|
432
435
|
|
|
433
436
|
// lib/dnd/collision/directional/index.ts
|
|
@@ -573,70 +576,8 @@ var trackMovementInterval = (point, dragAxis = "dynamic") => {
|
|
|
573
576
|
return intervalCache;
|
|
574
577
|
};
|
|
575
578
|
|
|
576
|
-
//
|
|
577
|
-
|
|
578
|
-
import { CollisionPriority, CollisionType as CollisionType2 } from "@dnd-kit/abstract";
|
|
579
|
-
import { Point as Point2 } from "@dnd-kit/geometry";
|
|
580
|
-
import { CollisionPriority as CollisionPriority2, CollisionType as CollisionType22 } from "@dnd-kit/abstract";
|
|
581
|
-
import { Point as Point22 } from "@dnd-kit/geometry";
|
|
582
|
-
import { CollisionPriority as CollisionPriority3, CollisionType as CollisionType3 } from "@dnd-kit/abstract";
|
|
583
|
-
import { Point as Point3, Rectangle } from "@dnd-kit/geometry";
|
|
584
|
-
import { CollisionPriority as CollisionPriority4, CollisionType as CollisionType4 } from "@dnd-kit/abstract";
|
|
585
|
-
import { Point as Point4 } from "@dnd-kit/geometry";
|
|
586
|
-
import { CollisionPriority as CollisionPriority5, CollisionType as CollisionType5 } from "@dnd-kit/abstract";
|
|
587
|
-
import { Point as Point5 } from "@dnd-kit/geometry";
|
|
588
|
-
import { CollisionPriority as CollisionPriority6, CollisionType as CollisionType6 } from "@dnd-kit/abstract";
|
|
589
|
-
import { Point as Point6 } from "@dnd-kit/geometry";
|
|
590
|
-
var pointerIntersection = ({
|
|
591
|
-
dragOperation,
|
|
592
|
-
droppable
|
|
593
|
-
}) => {
|
|
594
|
-
const pointerCoordinates = dragOperation.position.current;
|
|
595
|
-
if (!pointerCoordinates) {
|
|
596
|
-
return null;
|
|
597
|
-
}
|
|
598
|
-
const { id } = droppable;
|
|
599
|
-
if (!droppable.shape) {
|
|
600
|
-
return null;
|
|
601
|
-
}
|
|
602
|
-
if (droppable.shape.containsPoint(pointerCoordinates)) {
|
|
603
|
-
const distance = Point2.distance(droppable.shape.center, pointerCoordinates);
|
|
604
|
-
return {
|
|
605
|
-
id,
|
|
606
|
-
value: 1 / distance,
|
|
607
|
-
type: CollisionType2.PointerIntersection,
|
|
608
|
-
priority: CollisionPriority.High
|
|
609
|
-
};
|
|
610
|
-
}
|
|
611
|
-
return null;
|
|
612
|
-
};
|
|
613
|
-
var closestCorners = (input) => {
|
|
614
|
-
const { dragOperation, droppable } = input;
|
|
615
|
-
const { shape, position } = dragOperation;
|
|
616
|
-
if (!droppable.shape) {
|
|
617
|
-
return null;
|
|
618
|
-
}
|
|
619
|
-
const shapeCorners = shape ? Rectangle.from(shape.current.boundingRectangle).corners : void 0;
|
|
620
|
-
const distance = Rectangle.from(
|
|
621
|
-
droppable.shape.boundingRectangle
|
|
622
|
-
).corners.reduce(
|
|
623
|
-
(acc, corner, index) => {
|
|
624
|
-
var _a;
|
|
625
|
-
return acc + Point3.distance(
|
|
626
|
-
Point3.from(corner),
|
|
627
|
-
(_a = shapeCorners == null ? void 0 : shapeCorners[index]) != null ? _a : position.current
|
|
628
|
-
);
|
|
629
|
-
},
|
|
630
|
-
0
|
|
631
|
-
);
|
|
632
|
-
const value = distance / 4;
|
|
633
|
-
return {
|
|
634
|
-
id: droppable.id,
|
|
635
|
-
value: 1 / value,
|
|
636
|
-
type: CollisionType3.Collision,
|
|
637
|
-
priority: CollisionPriority3.Normal
|
|
638
|
-
};
|
|
639
|
-
};
|
|
579
|
+
// lib/dnd/collision/dynamic/index.ts
|
|
580
|
+
import { closestCorners } from "@dnd-kit/collision";
|
|
640
581
|
|
|
641
582
|
// lib/dnd/collision/dynamic/store.ts
|
|
642
583
|
init_react_import();
|
|
@@ -674,7 +615,7 @@ var createDynamicCollisionDetector = (dragAxis, midpointOffset = 0.05) => ((inpu
|
|
|
674
615
|
collisionDebug(dragCenter, dropCenter, droppable.id.toString(), "yellow");
|
|
675
616
|
if (collision) {
|
|
676
617
|
return __spreadProps(__spreadValues({}, collision), {
|
|
677
|
-
priority:
|
|
618
|
+
priority: CollisionPriority.Highest,
|
|
678
619
|
data
|
|
679
620
|
});
|
|
680
621
|
}
|
|
@@ -692,8 +633,8 @@ var createDynamicCollisionDetector = (dragAxis, midpointOffset = 0.05) => ((inpu
|
|
|
692
633
|
const collision = {
|
|
693
634
|
id: droppable.id,
|
|
694
635
|
value: intersectionRatio,
|
|
695
|
-
priority:
|
|
696
|
-
type:
|
|
636
|
+
priority: CollisionPriority.High,
|
|
637
|
+
type: CollisionType2.Collision
|
|
697
638
|
};
|
|
698
639
|
const shouldFlushId = flushNext === droppable.id;
|
|
699
640
|
flushNext = "";
|
|
@@ -720,7 +661,7 @@ var createDynamicCollisionDetector = (dragAxis, midpointOffset = 0.05) => ((inpu
|
|
|
720
661
|
);
|
|
721
662
|
flushNext = droppable.id;
|
|
722
663
|
return __spreadProps(__spreadValues({}, fallbackCollision), {
|
|
723
|
-
priority:
|
|
664
|
+
priority: CollisionPriority.Low,
|
|
724
665
|
data
|
|
725
666
|
});
|
|
726
667
|
}
|
|
@@ -732,7 +673,7 @@ var createDynamicCollisionDetector = (dragAxis, midpointOffset = 0.05) => ((inpu
|
|
|
732
673
|
direction || ""
|
|
733
674
|
);
|
|
734
675
|
return __spreadProps(__spreadValues({}, fallbackCollision), {
|
|
735
|
-
priority:
|
|
676
|
+
priority: CollisionPriority.Lowest,
|
|
736
677
|
data
|
|
737
678
|
});
|
|
738
679
|
}
|
|
@@ -744,6 +685,7 @@ var createDynamicCollisionDetector = (dragAxis, midpointOffset = 0.05) => ((inpu
|
|
|
744
685
|
|
|
745
686
|
// components/Sortable/index.tsx
|
|
746
687
|
import { useSortable } from "@dnd-kit/react/sortable";
|
|
688
|
+
import { PointerActivationConstraints as PointerActivationConstraints2 } from "@dnd-kit/dom";
|
|
747
689
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
748
690
|
var SortableProvider = ({
|
|
749
691
|
children,
|
|
@@ -752,7 +694,7 @@ var SortableProvider = ({
|
|
|
752
694
|
onMove
|
|
753
695
|
}) => {
|
|
754
696
|
const sensors = useSensors({
|
|
755
|
-
mouse:
|
|
697
|
+
mouse: [new PointerActivationConstraints2.Distance({ value: 5 })]
|
|
756
698
|
});
|
|
757
699
|
return /* @__PURE__ */ jsx5(
|
|
758
700
|
DragDropProvider,
|
|
@@ -1444,7 +1386,7 @@ import {
|
|
|
1444
1386
|
isValidElement
|
|
1445
1387
|
} from "react";
|
|
1446
1388
|
|
|
1447
|
-
// css-module:/Users/rami/Documents/apps/
|
|
1389
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/ExternalInput/styles.module.css#css-module
|
|
1448
1390
|
init_react_import();
|
|
1449
1391
|
var styles_module_default4 = { "ExternalInput-actions": "_ExternalInput-actions_3fhqq_1", "ExternalInput-button": "_ExternalInput-button_3fhqq_5", "ExternalInput--dataSelected": "_ExternalInput--dataSelected_3fhqq_25", "ExternalInput--readOnly": "_ExternalInput--readOnly_3fhqq_32", "ExternalInput-detachButton": "_ExternalInput-detachButton_3fhqq_36", "ExternalInput": "_ExternalInput_3fhqq_1", "ExternalInputModal": "_ExternalInputModal_3fhqq_82", "ExternalInputModal-grid": "_ExternalInputModal-grid_3fhqq_92", "ExternalInputModal--filtersToggled": "_ExternalInputModal--filtersToggled_3fhqq_103", "ExternalInputModal-filters": "_ExternalInputModal-filters_3fhqq_108", "ExternalInputModal-masthead": "_ExternalInputModal-masthead_3fhqq_127", "ExternalInputModal-tableWrapper": "_ExternalInputModal-tableWrapper_3fhqq_136", "ExternalInputModal-table": "_ExternalInputModal-table_3fhqq_136", "ExternalInputModal-thead": "_ExternalInputModal-thead_3fhqq_152", "ExternalInputModal-th": "_ExternalInputModal-th_3fhqq_152", "ExternalInputModal-td": "_ExternalInputModal-td_3fhqq_167", "ExternalInputModal-tr": "_ExternalInputModal-tr_3fhqq_172", "ExternalInputModal-tbody": "_ExternalInputModal-tbody_3fhqq_179", "ExternalInputModal--hasData": "_ExternalInputModal--hasData_3fhqq_205", "ExternalInputModal-loadingBanner": "_ExternalInputModal-loadingBanner_3fhqq_209", "ExternalInputModal--isLoading": "_ExternalInputModal--isLoading_3fhqq_226", "ExternalInputModal-searchForm": "_ExternalInputModal-searchForm_3fhqq_230", "ExternalInputModal-search": "_ExternalInputModal-search_3fhqq_230", "ExternalInputModal-searchIcon": "_ExternalInputModal-searchIcon_3fhqq_267", "ExternalInputModal-searchIconText": "_ExternalInputModal-searchIconText_3fhqq_292", "ExternalInputModal-searchInput": "_ExternalInputModal-searchInput_3fhqq_302", "ExternalInputModal-searchActions": "_ExternalInputModal-searchActions_3fhqq_316", "ExternalInputModal-searchActionIcon": "_ExternalInputModal-searchActionIcon_3fhqq_329", "ExternalInputModal-footerContainer": "_ExternalInputModal-footerContainer_3fhqq_333", "ExternalInputModal-footer": "_ExternalInputModal-footer_3fhqq_333", "ExternalInputModal-field": "_ExternalInputModal-field_3fhqq_346" };
|
|
1450
1392
|
|
|
@@ -1452,7 +1394,7 @@ var styles_module_default4 = { "ExternalInput-actions": "_ExternalInput-actions_
|
|
|
1452
1394
|
init_react_import();
|
|
1453
1395
|
import { useEffect as useEffect4, useState as useState6 } from "react";
|
|
1454
1396
|
|
|
1455
|
-
// css-module:/Users/rami/Documents/apps/
|
|
1397
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Modal/styles.module.css#css-module
|
|
1456
1398
|
init_react_import();
|
|
1457
1399
|
var styles_module_default5 = { "Modal": "_Modal_1qmqa_1", "Modal--isOpen": "_Modal--isOpen_1qmqa_15", "Modal-inner": "_Modal-inner_1qmqa_19" };
|
|
1458
1400
|
|
|
@@ -1488,7 +1430,7 @@ var Modal = ({
|
|
|
1488
1430
|
// components/Heading/index.tsx
|
|
1489
1431
|
init_react_import();
|
|
1490
1432
|
|
|
1491
|
-
// css-module:/Users/rami/Documents/apps/
|
|
1433
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Heading/styles.module.css#css-module
|
|
1492
1434
|
init_react_import();
|
|
1493
1435
|
var styles_module_default6 = { "Heading": "_Heading_crcfw_1", "Heading--xxxxl": "_Heading--xxxxl_crcfw_13", "Heading--xxxl": "_Heading--xxxl_crcfw_19", "Heading--xxl": "_Heading--xxl_crcfw_23", "Heading--xl": "_Heading--xl_crcfw_27", "Heading--l": "_Heading--l_crcfw_31", "Heading--m": "_Heading--m_crcfw_35", "Heading--s": "_Heading--s_crcfw_39", "Heading--xs": "_Heading--xs_crcfw_43" };
|
|
1494
1436
|
|
|
@@ -1855,7 +1797,7 @@ init_react_import();
|
|
|
1855
1797
|
init_react_import();
|
|
1856
1798
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
1857
1799
|
|
|
1858
|
-
// css-module:/Users/rami/Documents/apps/
|
|
1800
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/ui/Select/styles.module.css#css-module
|
|
1859
1801
|
init_react_import();
|
|
1860
1802
|
var styles_module_default7 = { "FeSelect-trigger": "_FeSelect-trigger_13era_3", "FeSelect-triggerIcon": "_FeSelect-triggerIcon_13era_54", "FeSelect-content": "_FeSelect-content_13era_61", "FeSelect-viewport": "_FeSelect-viewport_13era_84", "FeSelect-item": "_FeSelect-item_13era_93", "FeSelect-itemIndicator": "_FeSelect-itemIndicator_13era_119", "FeSelect-group": "_FeSelect-group_13era_131", "FeSelect-label": "_FeSelect-label_13era_135", "FeSelect-separator": "_FeSelect-separator_13era_144", "FeSelect-scrollButton": "_FeSelect-scrollButton_13era_152" };
|
|
1861
1803
|
|
|
@@ -2105,7 +2047,7 @@ EditorFallback.displayName = "EditorFallback";
|
|
|
2105
2047
|
// components/AutoField/fields/RichtextField/index.tsx
|
|
2106
2048
|
import { Fragment as Fragment3, jsx as jsx19 } from "react/jsx-runtime";
|
|
2107
2049
|
var Editor = lazy(
|
|
2108
|
-
() => import("./Editor-
|
|
2050
|
+
() => import("./Editor-POJT3RA2.mjs").then((m) => ({
|
|
2109
2051
|
default: m.Editor
|
|
2110
2052
|
}))
|
|
2111
2053
|
);
|
|
@@ -2143,7 +2085,7 @@ var RichtextField = ({
|
|
|
2143
2085
|
// components/AutoField/fields/ObjectField/index.tsx
|
|
2144
2086
|
init_react_import();
|
|
2145
2087
|
|
|
2146
|
-
// css-module:/Users/rami/Documents/apps/
|
|
2088
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/AutoField/fields/ObjectField/styles.module.css#css-module
|
|
2147
2089
|
init_react_import();
|
|
2148
2090
|
var styles_module_default8 = { "ObjectField": "_ObjectField_1o8gv_5", "ObjectField-fieldset": "_ObjectField-fieldset_1o8gv_13" };
|
|
2149
2091
|
|
|
@@ -2427,7 +2369,7 @@ import {
|
|
|
2427
2369
|
useTransition
|
|
2428
2370
|
} from "react";
|
|
2429
2371
|
|
|
2430
|
-
// css-module:/Users/rami/Documents/apps/
|
|
2372
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/DraggableComponent/styles.module.css#css-module
|
|
2431
2373
|
init_react_import();
|
|
2432
2374
|
var styles_module_default9 = { "DraggableComponent": "_DraggableComponent_d90mv_1", "DraggableComponent-overlayWrapper": "_DraggableComponent-overlayWrapper_d90mv_12", "DraggableComponent-overlay": "_DraggableComponent-overlay_d90mv_12", "DraggableComponent-loadingOverlay": "_DraggableComponent-loadingOverlay_d90mv_36", "DraggableComponent--hover": "_DraggableComponent--hover_d90mv_53", "DraggableComponent--isSelected": "_DraggableComponent--isSelected_d90mv_60", "DraggableComponent--isGlobal": "_DraggableComponent--isGlobal_d90mv_69", "DraggableComponent-actionsOverlay": "_DraggableComponent-actionsOverlay_d90mv_105", "DraggableComponent-actions": "_DraggableComponent-actions_d90mv_105" };
|
|
2433
2375
|
|
|
@@ -2512,6 +2454,7 @@ var DropZoneProvider = ({
|
|
|
2512
2454
|
// components/DraggableComponent/index.tsx
|
|
2513
2455
|
import { useShallow as useShallow4 } from "zustand/react/shallow";
|
|
2514
2456
|
import { useSortable as useSortable2 } from "@dnd-kit/react/sortable";
|
|
2457
|
+
import { Feedback } from "@dnd-kit/dom";
|
|
2515
2458
|
|
|
2516
2459
|
// lib/dnd/use-on-drag-finished.ts
|
|
2517
2460
|
init_react_import();
|
|
@@ -2657,6 +2600,13 @@ var DraggableComponent = ({
|
|
|
2657
2600
|
() => createDynamicCollisionDetector(dragAxis),
|
|
2658
2601
|
[dragAxis]
|
|
2659
2602
|
);
|
|
2603
|
+
const sortablePlugins = useMemo7(
|
|
2604
|
+
() => (defaults) => [
|
|
2605
|
+
...defaults,
|
|
2606
|
+
Feedback.configure({ feedback: "clone" })
|
|
2607
|
+
],
|
|
2608
|
+
[]
|
|
2609
|
+
);
|
|
2660
2610
|
const {
|
|
2661
2611
|
ref: sortableRef,
|
|
2662
2612
|
isDragging: thisIsDragging,
|
|
@@ -2682,8 +2632,7 @@ var DraggableComponent = ({
|
|
|
2682
2632
|
transition: {
|
|
2683
2633
|
duration: 200,
|
|
2684
2634
|
easing: "cubic-bezier(0.2, 0, 0, 1)"
|
|
2685
|
-
}
|
|
2686
|
-
feedback: "clone"
|
|
2635
|
+
}
|
|
2687
2636
|
});
|
|
2688
2637
|
useEffect8(() => {
|
|
2689
2638
|
const isEnabled = zoneStore.getState().enabledIndex[zoneCompound];
|
|
@@ -3157,7 +3106,7 @@ var DraggableComponent = ({
|
|
|
3157
3106
|
] });
|
|
3158
3107
|
};
|
|
3159
3108
|
|
|
3160
|
-
// css-module:/Users/rami/Documents/apps/
|
|
3109
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/DropZone/styles.module.css#css-module
|
|
3161
3110
|
init_react_import();
|
|
3162
3111
|
var styles_module_default10 = { "DropZone": "_DropZone_q9qsx_1", "DropZone--hasChildren": "_DropZone--hasChildren_q9qsx_11", "DropZone--isAreaSelected": "_DropZone--isAreaSelected_q9qsx_24", "DropZone--hoveringOverArea": "_DropZone--hoveringOverArea_q9qsx_25", "DropZone--isRootZone": "_DropZone--isRootZone_q9qsx_25", "DropZone--isDestination": "_DropZone--isDestination_q9qsx_39", "DropZone-item": "_DropZone-item_q9qsx_48", "DropZone-hitbox": "_DropZone-hitbox_q9qsx_52", "DropZone--isEnabled": "_DropZone--isEnabled_q9qsx_60", "DropZone--isAnimating": "_DropZone--isAnimating_q9qsx_70" };
|
|
3163
3112
|
|
|
@@ -3167,7 +3116,7 @@ import { useDroppable as useDroppable2 } from "@dnd-kit/react";
|
|
|
3167
3116
|
// components/Drawer/index.tsx
|
|
3168
3117
|
init_react_import();
|
|
3169
3118
|
|
|
3170
|
-
// css-module:/Users/rami/Documents/apps/
|
|
3119
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Drawer/styles.module.css#css-module
|
|
3171
3120
|
init_react_import();
|
|
3172
3121
|
var styles_module_default11 = { "Drawer": "_Drawer_rcm43_1", "Drawer--tile": "_Drawer--tile_rcm43_8", "Drawer-draggable": "_Drawer-draggable_rcm43_19", "Drawer-draggableBg": "_Drawer-draggableBg_rcm43_23", "DrawerItem-draggable": "_DrawerItem-draggable_rcm43_33", "DrawerItem-icon": "_DrawerItem-icon_rcm43_50", "DrawerItem--disabled": "_DrawerItem--disabled_rcm43_56", "DrawerItem": "_DrawerItem_rcm43_33", "Drawer--isDraggingFrom": "_Drawer--isDraggingFrom_rcm43_66", "DrawerItem-name": "_DrawerItem-name_rcm43_91" };
|
|
3173
3122
|
|
|
@@ -3186,11 +3135,17 @@ import {
|
|
|
3186
3135
|
useRef as useRef3,
|
|
3187
3136
|
useState as useState10
|
|
3188
3137
|
} from "react";
|
|
3189
|
-
import {
|
|
3138
|
+
import {
|
|
3139
|
+
AutoScroller,
|
|
3140
|
+
defaultPreset,
|
|
3141
|
+
ScrollListener,
|
|
3142
|
+
Scroller
|
|
3143
|
+
} from "@dnd-kit/dom";
|
|
3190
3144
|
|
|
3191
3145
|
// lib/dnd/NestedDroppablePlugin.ts
|
|
3192
3146
|
init_react_import();
|
|
3193
3147
|
import { Plugin } from "@dnd-kit/abstract";
|
|
3148
|
+
import { getDocuments } from "@dnd-kit/dom/utilities";
|
|
3194
3149
|
|
|
3195
3150
|
// lib/throttle.ts
|
|
3196
3151
|
init_react_import();
|
|
@@ -3271,25 +3226,6 @@ var GlobalPosition = class {
|
|
|
3271
3226
|
}
|
|
3272
3227
|
};
|
|
3273
3228
|
|
|
3274
|
-
// lib/bubble-pointer-event.ts
|
|
3275
|
-
init_react_import();
|
|
3276
|
-
var BaseEvent = typeof PointerEvent !== "undefined" ? PointerEvent : Event;
|
|
3277
|
-
var BubbledPointerEvent = class extends BaseEvent {
|
|
3278
|
-
constructor(type, data) {
|
|
3279
|
-
super(type, data);
|
|
3280
|
-
this._originalTarget = null;
|
|
3281
|
-
this.originalTarget = data.originalTarget;
|
|
3282
|
-
}
|
|
3283
|
-
// Necessary for Firefox
|
|
3284
|
-
set originalTarget(target) {
|
|
3285
|
-
this._originalTarget = target;
|
|
3286
|
-
}
|
|
3287
|
-
// Necessary for Firefox
|
|
3288
|
-
get originalTarget() {
|
|
3289
|
-
return this._originalTarget;
|
|
3290
|
-
}
|
|
3291
|
-
};
|
|
3292
|
-
|
|
3293
3229
|
// lib/dnd/NestedDroppablePlugin.ts
|
|
3294
3230
|
var depthSort = (candidates) => {
|
|
3295
3231
|
return candidates.sort((a, b) => {
|
|
@@ -3432,7 +3368,7 @@ var createNestedDroppablePlugin = ({ onChange }, id) => class NestedDroppablePlu
|
|
|
3432
3368
|
}
|
|
3433
3369
|
this.registerEffect(() => {
|
|
3434
3370
|
const handleMove = (event) => {
|
|
3435
|
-
const target = event
|
|
3371
|
+
const target = event.target;
|
|
3436
3372
|
const position = new GlobalPosition(target, {
|
|
3437
3373
|
x: event.clientX,
|
|
3438
3374
|
y: event.clientY
|
|
@@ -3450,15 +3386,55 @@ var createNestedDroppablePlugin = ({ onChange }, id) => class NestedDroppablePlu
|
|
|
3450
3386
|
const handlePointerMove = (event) => {
|
|
3451
3387
|
handleMoveThrottled(event);
|
|
3452
3388
|
};
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
document.body.removeEventListener("pointermove", handlePointerMove, {
|
|
3389
|
+
const bound = /* @__PURE__ */ new Set();
|
|
3390
|
+
const bind = (doc) => {
|
|
3391
|
+
if (bound.has(doc)) return;
|
|
3392
|
+
bound.add(doc);
|
|
3393
|
+
doc.addEventListener("pointermove", handlePointerMove, {
|
|
3459
3394
|
capture: true
|
|
3395
|
+
// dndkit's PointerSensor prevents propagation during drag
|
|
3460
3396
|
});
|
|
3461
3397
|
};
|
|
3398
|
+
const bindAll = () => {
|
|
3399
|
+
for (const doc of getDocuments()) bind(doc);
|
|
3400
|
+
};
|
|
3401
|
+
bindAll();
|
|
3402
|
+
const onIframeLoad = () => bindAll();
|
|
3403
|
+
const observed = /* @__PURE__ */ new Set();
|
|
3404
|
+
const observeFrame = (el) => {
|
|
3405
|
+
if (observed.has(el)) return;
|
|
3406
|
+
observed.add(el);
|
|
3407
|
+
el.addEventListener("load", onIframeLoad);
|
|
3408
|
+
};
|
|
3409
|
+
for (const el of Array.from(
|
|
3410
|
+
document.querySelectorAll(
|
|
3411
|
+
"iframe, frame"
|
|
3412
|
+
)
|
|
3413
|
+
)) {
|
|
3414
|
+
observeFrame(el);
|
|
3415
|
+
}
|
|
3416
|
+
const observer = new MutationObserver((mutations) => {
|
|
3417
|
+
for (const m of mutations) {
|
|
3418
|
+
for (const node of Array.from(m.addedNodes)) {
|
|
3419
|
+
if (node instanceof HTMLIFrameElement || typeof HTMLFrameElement !== "undefined" && node instanceof HTMLFrameElement) {
|
|
3420
|
+
observeFrame(node);
|
|
3421
|
+
}
|
|
3422
|
+
}
|
|
3423
|
+
}
|
|
3424
|
+
bindAll();
|
|
3425
|
+
});
|
|
3426
|
+
observer.observe(document.body, { childList: true, subtree: true });
|
|
3427
|
+
const cleanup = () => {
|
|
3428
|
+
observer.disconnect();
|
|
3429
|
+
for (const el of observed) {
|
|
3430
|
+
el.removeEventListener("load", onIframeLoad);
|
|
3431
|
+
}
|
|
3432
|
+
for (const doc of bound) {
|
|
3433
|
+
doc.removeEventListener("pointermove", handlePointerMove, {
|
|
3434
|
+
capture: true
|
|
3435
|
+
});
|
|
3436
|
+
}
|
|
3437
|
+
};
|
|
3462
3438
|
return cleanup;
|
|
3463
3439
|
});
|
|
3464
3440
|
}
|
|
@@ -3701,6 +3677,8 @@ var DragDropContextClient = ({
|
|
|
3701
3677
|
}
|
|
3702
3678
|
}, []);
|
|
3703
3679
|
const [plugins] = useState10(() => [
|
|
3680
|
+
ScrollListener,
|
|
3681
|
+
Scroller,
|
|
3704
3682
|
...disableAutoScroll ? defaultPreset.plugins.filter((plugin) => plugin !== AutoScroller) : defaultPreset.plugins,
|
|
3705
3683
|
createNestedDroppablePlugin(
|
|
3706
3684
|
{
|
|
@@ -4132,6 +4110,9 @@ var Drawer = ({
|
|
|
4132
4110
|
};
|
|
4133
4111
|
Drawer.Item = DrawerItem;
|
|
4134
4112
|
|
|
4113
|
+
// components/DropZone/index.tsx
|
|
4114
|
+
import { pointerIntersection } from "@dnd-kit/collision";
|
|
4115
|
+
|
|
4135
4116
|
// components/DropZone/lib/use-min-empty-height.ts
|
|
4136
4117
|
init_react_import();
|
|
4137
4118
|
import { useEffect as useEffect10, useRef as useRef4, useState as useState12 } from "react";
|
|
@@ -4441,7 +4422,7 @@ var registerOverlayPortal = (el, opts = {}) => {
|
|
|
4441
4422
|
};
|
|
4442
4423
|
};
|
|
4443
4424
|
|
|
4444
|
-
// css-module:/Users/rami/Documents/apps/
|
|
4425
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/InlineTextField/styles.module.css#css-module
|
|
4445
4426
|
init_react_import();
|
|
4446
4427
|
var styles_module_default12 = { "InlineTextField": "_InlineTextField_104qp_1" };
|
|
4447
4428
|
|
|
@@ -4605,12 +4586,12 @@ import {
|
|
|
4605
4586
|
} from "react";
|
|
4606
4587
|
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
4607
4588
|
var Editor2 = lazy2(
|
|
4608
|
-
() => import("./Editor-
|
|
4589
|
+
() => import("./Editor-POJT3RA2.mjs").then((m) => ({
|
|
4609
4590
|
default: m.Editor
|
|
4610
4591
|
}))
|
|
4611
4592
|
);
|
|
4612
4593
|
var RichTextRender = lazy2(
|
|
4613
|
-
() => import("./Render-
|
|
4594
|
+
() => import("./Render-JNABKPAF.mjs").then((m) => ({
|
|
4614
4595
|
default: m.RichTextRender
|
|
4615
4596
|
}))
|
|
4616
4597
|
);
|
|
@@ -5453,49 +5434,49 @@ import React3, { useMemo as useMemo13 } from "react";
|
|
|
5453
5434
|
|
|
5454
5435
|
// lib/resolve-globals.ts
|
|
5455
5436
|
init_react_import();
|
|
5456
|
-
function resolveItem(item,
|
|
5457
|
-
var _a, _b, _c, _d
|
|
5437
|
+
function resolveItem(item, globals, config, visitedTypes) {
|
|
5438
|
+
var _a, _b, _c, _d;
|
|
5458
5439
|
const type = item.type;
|
|
5459
5440
|
const componentConfig = config.components[type];
|
|
5460
|
-
const globalEntry =
|
|
5461
|
-
const isUnlinked = ((_a = item.props) == null ? void 0 : _a.__synced) === false;
|
|
5441
|
+
const globalEntry = globals[type];
|
|
5462
5442
|
const shouldApplyGlobal = Boolean(
|
|
5463
|
-
(componentConfig == null ? void 0 : componentConfig.global) && globalEntry && !visitedTypes.has(type)
|
|
5443
|
+
(componentConfig == null ? void 0 : componentConfig.global) && item.synced && globalEntry && !visitedTypes.has(type)
|
|
5464
5444
|
);
|
|
5465
5445
|
let mergedProps;
|
|
5466
5446
|
if (shouldApplyGlobal) {
|
|
5467
5447
|
mergedProps = __spreadProps(__spreadValues({}, globalEntry.props), {
|
|
5468
|
-
children: (
|
|
5469
|
-
id: (
|
|
5448
|
+
children: (_a = item.props) == null ? void 0 : _a.children,
|
|
5449
|
+
id: (_b = item.props) == null ? void 0 : _b.id
|
|
5470
5450
|
});
|
|
5471
5451
|
} else {
|
|
5472
|
-
if ((componentConfig == null ? void 0 : componentConfig.global) && globalEntry && visitedTypes.has(type) && typeof process !== "undefined" && process.env.NODE_ENV !== "production") {
|
|
5452
|
+
if ((componentConfig == null ? void 0 : componentConfig.global) && item.synced && globalEntry && visitedTypes.has(type) && typeof process !== "undefined" && process.env.NODE_ENV !== "production") {
|
|
5473
5453
|
console.warn(
|
|
5474
5454
|
`[resolveGlobals] cycle detected while resolving global "${type}" \u2014 leaving reference unresolved`
|
|
5475
5455
|
);
|
|
5476
5456
|
}
|
|
5477
|
-
mergedProps = __spreadValues({}, (
|
|
5457
|
+
mergedProps = __spreadValues({}, (_c = item.props) != null ? _c : {});
|
|
5478
5458
|
}
|
|
5479
|
-
const fields = (
|
|
5459
|
+
const fields = (_d = componentConfig == null ? void 0 : componentConfig.fields) != null ? _d : {};
|
|
5480
5460
|
const nextVisited = shouldApplyGlobal ? /* @__PURE__ */ new Set([...visitedTypes, type]) : visitedTypes;
|
|
5481
5461
|
for (const [fieldName, fieldDef] of Object.entries(fields)) {
|
|
5482
5462
|
if ((fieldDef == null ? void 0 : fieldDef.type) === "slot") {
|
|
5483
5463
|
const slotValue = mergedProps[fieldName];
|
|
5484
5464
|
if (Array.isArray(slotValue)) {
|
|
5485
5465
|
mergedProps[fieldName] = slotValue.map(
|
|
5486
|
-
(child) => child && typeof child === "object" && "type" in child && "props" in child ? resolveItem(child,
|
|
5466
|
+
(child) => child && typeof child === "object" && "type" in child && "props" in child ? resolveItem(child, globals, config, nextVisited) : child
|
|
5487
5467
|
);
|
|
5488
5468
|
}
|
|
5489
5469
|
}
|
|
5490
5470
|
}
|
|
5491
5471
|
return __spreadProps(__spreadValues({}, item), { props: mergedProps });
|
|
5492
5472
|
}
|
|
5493
|
-
function resolveGlobals(data,
|
|
5473
|
+
function resolveGlobals(data, config) {
|
|
5494
5474
|
var _a;
|
|
5495
|
-
|
|
5475
|
+
const globals = data.globals;
|
|
5476
|
+
if (!globals || Object.keys(globals).length === 0) return data;
|
|
5496
5477
|
const visited = /* @__PURE__ */ new Set();
|
|
5497
5478
|
const content = ((_a = data.content) != null ? _a : []).map(
|
|
5498
|
-
(item) => resolveItem(item,
|
|
5479
|
+
(item) => resolveItem(item, globals, config, visited)
|
|
5499
5480
|
);
|
|
5500
5481
|
return __spreadProps(__spreadValues({}, data), { content });
|
|
5501
5482
|
}
|
|
@@ -5510,7 +5491,6 @@ var renderContext = React3.createContext({
|
|
|
5510
5491
|
function Render({
|
|
5511
5492
|
config,
|
|
5512
5493
|
data,
|
|
5513
|
-
globalData,
|
|
5514
5494
|
metadata = {}
|
|
5515
5495
|
}) {
|
|
5516
5496
|
var _a, _b;
|
|
@@ -5519,8 +5499,8 @@ function Render({
|
|
|
5519
5499
|
root: data.root || {},
|
|
5520
5500
|
content: data.content || []
|
|
5521
5501
|
});
|
|
5522
|
-
return resolveGlobals(base,
|
|
5523
|
-
}, [data,
|
|
5502
|
+
return resolveGlobals(base, config);
|
|
5503
|
+
}, [data, config]);
|
|
5524
5504
|
const rootProps = "props" in defaultedData.root ? defaultedData.root.props : defaultedData.root;
|
|
5525
5505
|
const title = (rootProps == null ? void 0 : rootProps.title) || "";
|
|
5526
5506
|
const pageProps = __spreadProps(__spreadValues({}, rootProps), {
|
|
@@ -5556,7 +5536,7 @@ function Render({
|
|
|
5556
5536
|
// components/ComponentList/index.tsx
|
|
5557
5537
|
init_react_import();
|
|
5558
5538
|
|
|
5559
|
-
// css-module:/Users/rami/Documents/apps/
|
|
5539
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/ComponentList/styles.module.css#css-module
|
|
5560
5540
|
init_react_import();
|
|
5561
5541
|
var styles_module_default13 = { "ComponentList": "_ComponentList_apsvr_1", "ComponentList--isExpanded": "_ComponentList--isExpanded_apsvr_5", "ComponentList-content": "_ComponentList-content_apsvr_9", "ComponentList-title": "_ComponentList-title_apsvr_17", "ComponentList-titleIcon": "_ComponentList-titleIcon_apsvr_54" };
|
|
5562
5542
|
|
|
@@ -5806,7 +5786,7 @@ init_react_import();
|
|
|
5806
5786
|
init_react_import();
|
|
5807
5787
|
import { useMemo as useMemo14, useState as useState17 } from "react";
|
|
5808
5788
|
|
|
5809
|
-
// css-module:/Users/rami/Documents/apps/
|
|
5789
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Editor/components/Components/styles.module.css#css-module
|
|
5810
5790
|
init_react_import();
|
|
5811
5791
|
var styles_module_default14 = { "Components-search": "_Components-search_4hb2y_1", "Components-searchIcon": "_Components-searchIcon_4hb2y_8", "Components-searchInput": "_Components-searchInput_4hb2y_16", "Components-empty": "_Components-empty_4hb2y_39" };
|
|
5812
5792
|
|
|
@@ -5900,7 +5880,7 @@ var Components = () => {
|
|
|
5900
5880
|
] });
|
|
5901
5881
|
};
|
|
5902
5882
|
|
|
5903
|
-
// css-module:/Users/rami/Documents/apps/
|
|
5883
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/plugins/blocks/styles.module.css#css-module
|
|
5904
5884
|
init_react_import();
|
|
5905
5885
|
var styles_module_default15 = { "BlocksPlugin": "_BlocksPlugin_15ud0_1" };
|
|
5906
5886
|
|
|
@@ -5923,9 +5903,9 @@ init_react_import();
|
|
|
5923
5903
|
// components/LayerTree/index.tsx
|
|
5924
5904
|
init_react_import();
|
|
5925
5905
|
|
|
5926
|
-
// css-module:/Users/rami/Documents/apps/
|
|
5906
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/LayerTree/styles.module.css#css-module
|
|
5927
5907
|
init_react_import();
|
|
5928
|
-
var styles_module_default16 = { "LayerTree": "
|
|
5908
|
+
var styles_module_default16 = { "LayerTree": "_LayerTree_1wyf0_1", "LayerTree-zoneTitle": "_LayerTree-zoneTitle_1wyf0_11", "LayerTree-helper": "_LayerTree-helper_1wyf0_17", "Layer": "_Layer_1wyf0_1", "Layer-inner": "_Layer-inner_1wyf0_34", "Layer--containsZone": "_Layer--containsZone_1wyf0_42", "Layer-clickable": "_Layer-clickable_1wyf0_46", "Layer--isSelected": "_Layer--isSelected_1wyf0_68", "Layer-icon": "_Layer-icon_1wyf0_80", "Layer-zoneIcon": "_Layer-zoneIcon_1wyf0_81", "Layer-chevron": "_Layer-chevron_1wyf0_85", "Layer--childIsSelected": "_Layer--childIsSelected_1wyf0_97", "Layer-zones": "_Layer-zones_1wyf0_101", "Layer-title": "_Layer-title_1wyf0_117", "Layer-name": "_Layer-name_1wyf0_130", "Layer--isGlobal": "_Layer--isGlobal_1wyf0_150", "Layer--isUnlinked": "_Layer--isUnlinked_1wyf0_171", "Layer-unlinkedGlyph": "_Layer-unlinkedGlyph_1wyf0_175" };
|
|
5929
5909
|
|
|
5930
5910
|
// components/LayerTree/index.tsx
|
|
5931
5911
|
import {
|
|
@@ -6064,8 +6044,8 @@ var Layer = forwardRef2(function Layer2({
|
|
|
6064
6044
|
);
|
|
6065
6045
|
const isUnlinked = useAppStore(
|
|
6066
6046
|
(s) => {
|
|
6067
|
-
var _a, _b
|
|
6068
|
-
return ((
|
|
6047
|
+
var _a, _b;
|
|
6048
|
+
return ((_b = (_a = s.state.indexes.nodes[node.itemId]) == null ? void 0 : _a.data) == null ? void 0 : _b.synced) === false;
|
|
6069
6049
|
}
|
|
6070
6050
|
);
|
|
6071
6051
|
const containsZone = node.childZones.length > 0;
|
|
@@ -6361,7 +6341,7 @@ var Outline = () => {
|
|
|
6361
6341
|
) });
|
|
6362
6342
|
};
|
|
6363
6343
|
|
|
6364
|
-
// css-module:/Users/rami/Documents/apps/
|
|
6344
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/plugins/outline/styles.module.css#css-module
|
|
6365
6345
|
init_react_import();
|
|
6366
6346
|
var styles_module_default17 = { "OutlinePlugin": "_OutlinePlugin_q92j6_1" };
|
|
6367
6347
|
|
|
@@ -6381,7 +6361,7 @@ init_react_import();
|
|
|
6381
6361
|
// components/Breadcrumbs/index.tsx
|
|
6382
6362
|
init_react_import();
|
|
6383
6363
|
|
|
6384
|
-
// css-module:/Users/rami/Documents/apps/
|
|
6364
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Breadcrumbs/styles.module.css#css-module
|
|
6385
6365
|
init_react_import();
|
|
6386
6366
|
var styles_module_default18 = { "Breadcrumbs": "_Breadcrumbs_cvmoz_1", "Breadcrumbs-breadcrumb": "_Breadcrumbs-breadcrumb_cvmoz_10", "Breadcrumbs-breadcrumbLabel": "_Breadcrumbs-breadcrumbLabel_cvmoz_17" };
|
|
6387
6367
|
|
|
@@ -6458,7 +6438,7 @@ var Breadcrumbs = ({
|
|
|
6458
6438
|
// components/Editor/components/Fields/index.tsx
|
|
6459
6439
|
init_react_import();
|
|
6460
6440
|
|
|
6461
|
-
// css-module:/Users/rami/Documents/apps/
|
|
6441
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Editor/components/Fields/styles.module.css#css-module
|
|
6462
6442
|
init_react_import();
|
|
6463
6443
|
var styles_module_default19 = { "EditorFields": "_EditorFields_1di93_1", "EditorFields--isLoading": "_EditorFields--isLoading_1di93_6", "EditorFields-loadingOverlay": "_EditorFields-loadingOverlay_1di93_10", "EditorFields-loadingOverlayInner": "_EditorFields-loadingOverlayInner_1di93_25", "EditorFields-field": "_EditorFields-field_1di93_32", "EditorFields--wrapFields": "_EditorFields--wrapFields_1di93_36", "EditorFields-syncButton": "_EditorFields-syncButton_1di93_46", "EditorFields-syncButton--unlinked": "_EditorFields-syncButton--unlinked_1di93_78" };
|
|
6464
6444
|
|
|
@@ -6578,29 +6558,22 @@ var FieldsChild = ({ fieldName }) => {
|
|
|
6578
6558
|
};
|
|
6579
6559
|
var FieldsChildMemo = memo8(FieldsChild);
|
|
6580
6560
|
var GlobalSyncButton = () => {
|
|
6581
|
-
var _a;
|
|
6582
6561
|
const appStore = useAppStoreApi();
|
|
6583
6562
|
const selectedItem = useAppStore((s) => s.selectedItem);
|
|
6584
6563
|
const isGlobalType = useAppStore(
|
|
6585
6564
|
(s) => {
|
|
6586
|
-
var
|
|
6587
|
-
return selectedItem ? ((
|
|
6565
|
+
var _a;
|
|
6566
|
+
return selectedItem ? ((_a = s.config.components[selectedItem.type]) == null ? void 0 : _a.global) === true : false;
|
|
6588
6567
|
}
|
|
6589
6568
|
);
|
|
6590
6569
|
if (!selectedItem || !isGlobalType) return null;
|
|
6591
|
-
const isUnlinked =
|
|
6570
|
+
const isUnlinked = selectedItem.synced === false;
|
|
6592
6571
|
const onClick = () => __async(null, null, function* () {
|
|
6593
6572
|
const { dispatch, state, resolveComponentData } = appStore.getState();
|
|
6594
|
-
const newProps = __spreadValues({}, selectedItem.props);
|
|
6595
|
-
if (isUnlinked) {
|
|
6596
|
-
delete newProps.__synced;
|
|
6597
|
-
} else {
|
|
6598
|
-
newProps.__synced = false;
|
|
6599
|
-
}
|
|
6600
6573
|
const latestSelector = getSelectorForId(state, selectedItem.props.id);
|
|
6601
6574
|
if (!latestSelector) return;
|
|
6602
6575
|
const resolved = yield resolveComponentData(
|
|
6603
|
-
__spreadProps(__spreadValues({}, selectedItem), {
|
|
6576
|
+
__spreadProps(__spreadValues({}, selectedItem), { synced: isUnlinked ? true : false }),
|
|
6604
6577
|
"replace"
|
|
6605
6578
|
);
|
|
6606
6579
|
dispatch({
|
|
@@ -6663,7 +6636,7 @@ var FieldsInternal = ({ wrapFields = true }) => {
|
|
|
6663
6636
|
};
|
|
6664
6637
|
var Fields = memo8(FieldsInternal);
|
|
6665
6638
|
|
|
6666
|
-
// css-module:/Users/rami/Documents/apps/
|
|
6639
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/plugins/fields/styles.module.css#css-module
|
|
6667
6640
|
init_react_import();
|
|
6668
6641
|
var styles_module_default20 = { "FieldsPlugin": "_FieldsPlugin_l8h4q_1", "FieldsPlugin-header": "_FieldsPlugin-header_l8h4q_7" };
|
|
6669
6642
|
|
|
@@ -7003,51 +6976,13 @@ function AutoFrame(_a) {
|
|
|
7003
6976
|
AutoFrame.displayName = "AutoFrame";
|
|
7004
6977
|
var AutoFrame_default = AutoFrame;
|
|
7005
6978
|
|
|
7006
|
-
// css-module:/Users/rami/Documents/apps/
|
|
6979
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Editor/components/Preview/styles.module.css#css-module
|
|
7007
6980
|
init_react_import();
|
|
7008
6981
|
var styles_module_default21 = { "EditorPreview": "_EditorPreview_xou64_1", "EditorPreview-frame": "_EditorPreview-frame_xou64_6" };
|
|
7009
6982
|
|
|
7010
6983
|
// components/Editor/components/Preview/index.tsx
|
|
7011
6984
|
import { Fragment as Fragment11, jsx as jsx44 } from "react/jsx-runtime";
|
|
7012
6985
|
var getClassName26 = get_class_name_factory_default("EditorPreview", styles_module_default21);
|
|
7013
|
-
var useBubbleIframeEvents = (ref) => {
|
|
7014
|
-
const status = useAppStore((s) => s.status);
|
|
7015
|
-
useEffect21(() => {
|
|
7016
|
-
if (ref.current && status === "READY") {
|
|
7017
|
-
const iframe = ref.current;
|
|
7018
|
-
const handlePointerMove = (event) => {
|
|
7019
|
-
const evt = new BubbledPointerEvent("pointermove", __spreadProps(__spreadValues({}, event), {
|
|
7020
|
-
bubbles: true,
|
|
7021
|
-
cancelable: false,
|
|
7022
|
-
clientX: event.clientX,
|
|
7023
|
-
clientY: event.clientY,
|
|
7024
|
-
originalTarget: event.target
|
|
7025
|
-
}));
|
|
7026
|
-
iframe.dispatchEvent(evt);
|
|
7027
|
-
};
|
|
7028
|
-
const register = () => {
|
|
7029
|
-
var _a;
|
|
7030
|
-
unregister();
|
|
7031
|
-
(_a = iframe.contentDocument) == null ? void 0 : _a.addEventListener(
|
|
7032
|
-
"pointermove",
|
|
7033
|
-
handlePointerMove,
|
|
7034
|
-
{ capture: true }
|
|
7035
|
-
);
|
|
7036
|
-
};
|
|
7037
|
-
const unregister = () => {
|
|
7038
|
-
var _a;
|
|
7039
|
-
(_a = iframe.contentDocument) == null ? void 0 : _a.removeEventListener(
|
|
7040
|
-
"pointermove",
|
|
7041
|
-
handlePointerMove
|
|
7042
|
-
);
|
|
7043
|
-
};
|
|
7044
|
-
register();
|
|
7045
|
-
return () => {
|
|
7046
|
-
unregister();
|
|
7047
|
-
};
|
|
7048
|
-
}
|
|
7049
|
-
}, [status]);
|
|
7050
|
-
};
|
|
7051
6986
|
var Preview2 = ({ id = "editor-preview" }) => {
|
|
7052
6987
|
const dispatch = useAppStore((s) => s.dispatch);
|
|
7053
6988
|
const root = useAppStore((s) => s.state.data.root);
|
|
@@ -7080,7 +7015,6 @@ var Preview2 = ({ id = "editor-preview" }) => {
|
|
|
7080
7015
|
const Frame = useMemo18(() => overrides.iframe, [overrides]);
|
|
7081
7016
|
const rootProps = root.props || root;
|
|
7082
7017
|
const ref = useRef11(null);
|
|
7083
|
-
useBubbleIframeEvents(ref);
|
|
7084
7018
|
const inner = !renderData ? /* @__PURE__ */ jsx44(
|
|
7085
7019
|
Page,
|
|
7086
7020
|
__spreadProps(__spreadValues({}, rootProps), {
|
|
@@ -7199,16 +7133,16 @@ import { deepEqual as deepEqual2 } from "fast-equals";
|
|
|
7199
7133
|
|
|
7200
7134
|
// lib/split-global-data.ts
|
|
7201
7135
|
init_react_import();
|
|
7202
|
-
function
|
|
7203
|
-
var _a;
|
|
7204
|
-
const extracted = {};
|
|
7136
|
+
function splitGlobals(data, config) {
|
|
7137
|
+
var _a, _b;
|
|
7138
|
+
const extracted = __spreadValues({}, (_a = data.globals) != null ? _a : {});
|
|
7205
7139
|
function visit(node) {
|
|
7206
|
-
var _a2,
|
|
7140
|
+
var _a2, _b2;
|
|
7207
7141
|
const type = node.type;
|
|
7208
7142
|
const componentConfig = config.components[type];
|
|
7209
7143
|
const fields = (_a2 = componentConfig == null ? void 0 : componentConfig.fields) != null ? _a2 : {};
|
|
7210
|
-
const
|
|
7211
|
-
const processedProps = __spreadValues({}, (
|
|
7144
|
+
const isGlobalType = (componentConfig == null ? void 0 : componentConfig.global) === true;
|
|
7145
|
+
const processedProps = __spreadValues({}, (_b2 = node.props) != null ? _b2 : {});
|
|
7212
7146
|
for (const [fieldName, fieldDef] of Object.entries(fields)) {
|
|
7213
7147
|
if ((fieldDef == null ? void 0 : fieldDef.type) === "slot") {
|
|
7214
7148
|
const slotValue = processedProps[fieldName];
|
|
@@ -7219,27 +7153,25 @@ function splitGlobalData(data, config) {
|
|
|
7219
7153
|
}
|
|
7220
7154
|
}
|
|
7221
7155
|
}
|
|
7222
|
-
if (!
|
|
7223
|
-
return __spreadProps(__spreadValues({}, node), { props: processedProps });
|
|
7224
|
-
}
|
|
7225
|
-
if (processedProps.__synced === false) {
|
|
7156
|
+
if (!isGlobalType || !node.synced) {
|
|
7226
7157
|
return __spreadProps(__spreadValues({}, node), { props: processedProps });
|
|
7227
7158
|
}
|
|
7228
7159
|
const _c = processedProps, { children, id } = _c, sharedProps = __objRest(_c, ["children", "id"]);
|
|
7229
|
-
|
|
7230
|
-
extracted[type] = { props: sharedProps };
|
|
7231
|
-
}
|
|
7160
|
+
extracted[type] = { props: sharedProps };
|
|
7232
7161
|
const instanceProps = { id };
|
|
7233
7162
|
if (children !== void 0) instanceProps.children = children;
|
|
7234
|
-
return __spreadProps(__spreadValues({}, node), {
|
|
7163
|
+
return __spreadProps(__spreadValues({}, node), {
|
|
7164
|
+
props: instanceProps,
|
|
7165
|
+
synced: true
|
|
7166
|
+
});
|
|
7235
7167
|
}
|
|
7236
|
-
const strippedContent = ((
|
|
7168
|
+
const strippedContent = ((_b = data.content) != null ? _b : []).map(
|
|
7237
7169
|
(item) => visit(item)
|
|
7238
7170
|
);
|
|
7239
|
-
return {
|
|
7240
|
-
|
|
7241
|
-
|
|
7242
|
-
};
|
|
7171
|
+
return __spreadProps(__spreadValues({}, data), {
|
|
7172
|
+
content: strippedContent,
|
|
7173
|
+
globals: extracted
|
|
7174
|
+
});
|
|
7243
7175
|
}
|
|
7244
7176
|
|
|
7245
7177
|
// components/Editor/components/Layout/index.tsx
|
|
@@ -7252,7 +7184,7 @@ import {
|
|
|
7252
7184
|
useState as useState22
|
|
7253
7185
|
} from "react";
|
|
7254
7186
|
|
|
7255
|
-
// css-module:/Users/rami/Documents/apps/
|
|
7187
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Editor/components/Layout/styles.module.css#css-module
|
|
7256
7188
|
init_react_import();
|
|
7257
7189
|
var styles_module_default22 = { "Editor": "_Editor_17yd6_19", "Editor-portal": "_Editor-portal_17yd6_32", "EditorLayout": "_EditorLayout_17yd6_37", "EditorLayout-inner": "_EditorLayout-inner_17yd6_41", "Editor--hidePlugins": "_Editor--hidePlugins_17yd6_73", "EditorLayout--mounted": "_EditorLayout--mounted_17yd6_78", "EditorLayout--mobilePanelHeightToggle": "_EditorLayout--mobilePanelHeightToggle_17yd6_82", "EditorLayout--leftSideBarVisible": "_EditorLayout--leftSideBarVisible_17yd6_82", "EditorLayout--mobilePanelCustomHeight": "_EditorLayout--mobilePanelCustomHeight_17yd6_87", "EditorLayout--mobilePanelHeightMinContent": "_EditorLayout--mobilePanelHeightMinContent_17yd6_105", "EditorLayout--rightSideBarVisible": "_EditorLayout--rightSideBarVisible_17yd6_127", "EditorLayout-mounted": "_EditorLayout-mounted_17yd6_146", "EditorLayout-nav": "_EditorLayout-nav_17yd6_187", "Editor-fieldSideBarToolbar": "_Editor-fieldSideBarToolbar_17yd6_203", "Editor-fieldSideBarHistory": "_Editor-fieldSideBarHistory_17yd6_213", "Editor-fieldSideBarActions": "_Editor-fieldSideBarActions_17yd6_219", "EditorLayout-mobilePanel": "_EditorLayout-mobilePanel_17yd6_225", "EditorLayout-mobilePanelContent": "_EditorLayout-mobilePanelContent_17yd6_245", "EditorLayout-mobileDragHandle": "_EditorLayout-mobileDragHandle_17yd6_252", "EditorLayout-mobileDragHandlePill": "_EditorLayout-mobileDragHandlePill_17yd6_266", "EditorPluginTab": "_EditorPluginTab_17yd6_273", "EditorPluginTab--visible": "_EditorPluginTab--visible_17yd6_279", "EditorPluginTab-body": "_EditorPluginTab-body_17yd6_284" };
|
|
7258
7190
|
|
|
@@ -7309,7 +7241,7 @@ var usePreviewModeHotkeys = () => {
|
|
|
7309
7241
|
// components/SidebarSection/index.tsx
|
|
7310
7242
|
init_react_import();
|
|
7311
7243
|
|
|
7312
|
-
// css-module:/Users/rami/Documents/apps/
|
|
7244
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/SidebarSection/styles.module.css#css-module
|
|
7313
7245
|
init_react_import();
|
|
7314
7246
|
var styles_module_default23 = { "SidebarSection": "_SidebarSection_1jefg_1", "SidebarSection-title": "_SidebarSection-title_1jefg_12", "SidebarSection--noBorderTop": "_SidebarSection--noBorderTop_1jefg_20", "SidebarSection-content": "_SidebarSection-content_1jefg_24", "SidebarSection-breadcrumbLabel": "_SidebarSection-breadcrumbLabel_1jefg_33", "SidebarSection-breadcrumbs": "_SidebarSection-breadcrumbs_1jefg_62", "SidebarSection-breadcrumb": "_SidebarSection-breadcrumb_1jefg_33", "SidebarSection-heading": "_SidebarSection-heading_1jefg_74", "SidebarSection-loadingOverlay": "_SidebarSection-loadingOverlay_1jefg_88" };
|
|
7315
7247
|
|
|
@@ -7348,7 +7280,7 @@ import {
|
|
|
7348
7280
|
init_react_import();
|
|
7349
7281
|
import { useMemo as useMemo20 } from "react";
|
|
7350
7282
|
|
|
7351
|
-
// css-module:/Users/rami/Documents/apps/
|
|
7283
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/BrowserBar/styles.module.css#css-module
|
|
7352
7284
|
init_react_import();
|
|
7353
7285
|
var styles_module_default24 = { "BrowserBar": "_BrowserBar_oz0sq_1", "BrowserBar-urlTrigger": "_BrowserBar-urlTrigger_oz0sq_16", "BrowserBar-urlIcon": "_BrowserBar-urlIcon_oz0sq_47", "BrowserBar-urlText": "_BrowserBar-urlText_oz0sq_52", "BrowserBar-urlPath": "_BrowserBar-urlPath_oz0sq_64", "BrowserBar-urlTitle": "_BrowserBar-urlTitle_oz0sq_69", "BrowserBar-actions": "_BrowserBar-actions_oz0sq_82", "BrowserBar-deviceIcon": "_BrowserBar-deviceIcon_oz0sq_89" };
|
|
7354
7286
|
|
|
@@ -7440,9 +7372,9 @@ var BrowserBar = ({
|
|
|
7440
7372
|
] });
|
|
7441
7373
|
};
|
|
7442
7374
|
|
|
7443
|
-
// css-module:/Users/rami/Documents/apps/
|
|
7375
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Editor/components/Canvas/styles.module.css#css-module
|
|
7444
7376
|
init_react_import();
|
|
7445
|
-
var styles_module_default25 = { "EditorCanvas": "
|
|
7377
|
+
var styles_module_default25 = { "EditorCanvas": "_EditorCanvas_k9klu_1", "EditorCanvas-controls": "_EditorCanvas-controls_k9klu_17", "EditorCanvas--fullScreen": "_EditorCanvas--fullScreen_k9klu_22", "EditorCanvas-inner": "_EditorCanvas-inner_k9klu_33", "EditorCanvas-rootColumn": "_EditorCanvas-rootColumn_k9klu_46", "EditorCanvas-root": "_EditorCanvas-root_k9klu_46", "EditorCanvas--ready": "_EditorCanvas--ready_k9klu_83", "EditorCanvas-loader": "_EditorCanvas-loader_k9klu_88", "EditorCanvas--showLoader": "_EditorCanvas--showLoader_k9klu_100", "EditorCanvas-browserBar": "_EditorCanvas-browserBar_k9klu_109", "EditorCanvas-zoomControls": "_EditorCanvas-zoomControls_k9klu_114" };
|
|
7446
7378
|
|
|
7447
7379
|
// components/Editor/components/Canvas/index.tsx
|
|
7448
7380
|
import { useShallow as useShallow9 } from "zustand/react/shallow";
|
|
@@ -7485,7 +7417,7 @@ var MIN_ZOOM = 0.25;
|
|
|
7485
7417
|
var MAX_ZOOM = 3;
|
|
7486
7418
|
var TRANSITION_DURATION = 150;
|
|
7487
7419
|
var Canvas = () => {
|
|
7488
|
-
var _a;
|
|
7420
|
+
var _a, _b;
|
|
7489
7421
|
const { frameRef } = useCanvasFrame();
|
|
7490
7422
|
const {
|
|
7491
7423
|
viewports: viewportOptions = defaultViewports,
|
|
@@ -7549,19 +7481,18 @@ var Canvas = () => {
|
|
|
7549
7481
|
}, 500);
|
|
7550
7482
|
}, []);
|
|
7551
7483
|
const appStoreApi = useAppStoreApi();
|
|
7552
|
-
|
|
7553
|
-
|
|
7554
|
-
|
|
7555
|
-
if (
|
|
7484
|
+
const autoSelectingRef = useRef13(true);
|
|
7485
|
+
const pickClosestViewport = useCallback18(() => {
|
|
7486
|
+
var _a2, _b2;
|
|
7487
|
+
if (typeof window === "undefined") return null;
|
|
7556
7488
|
const viewportWidth = window.innerWidth;
|
|
7557
|
-
const frameWidth = (
|
|
7558
|
-
if (!viewportWidth) return;
|
|
7559
|
-
if (!frameWidth) return;
|
|
7560
|
-
if (viewportOptions.length === 0) return;
|
|
7489
|
+
const frameWidth = (_a2 = frameRef.current) == null ? void 0 : _a2.getBoundingClientRect().width;
|
|
7490
|
+
if (!viewportWidth) return null;
|
|
7491
|
+
if (!frameWidth) return null;
|
|
7492
|
+
if (viewportOptions.length === 0) return null;
|
|
7561
7493
|
const fullWidthViewport = Object.values(viewportOptions).find(
|
|
7562
7494
|
(v) => v.width === "100%"
|
|
7563
7495
|
);
|
|
7564
|
-
const containsFullWidthViewport = !!fullWidthViewport;
|
|
7565
7496
|
const viewportDifferences = Object.entries(viewportOptions).filter(([_, value]) => value.width !== "100%").map(([key, value]) => ({
|
|
7566
7497
|
key,
|
|
7567
7498
|
diff: Math.abs(
|
|
@@ -7569,10 +7500,19 @@ var Canvas = () => {
|
|
|
7569
7500
|
),
|
|
7570
7501
|
value
|
|
7571
7502
|
})).sort((a, b) => a.diff > b.diff ? 1 : -1);
|
|
7572
|
-
let closestViewport = viewportDifferences[0].value;
|
|
7573
|
-
if (closestViewport
|
|
7503
|
+
let closestViewport = (_b2 = viewportDifferences[0]) == null ? void 0 : _b2.value;
|
|
7504
|
+
if (!closestViewport) return null;
|
|
7505
|
+
if (closestViewport.width < frameWidth && fullWidthViewport) {
|
|
7574
7506
|
closestViewport = fullWidthViewport;
|
|
7575
7507
|
}
|
|
7508
|
+
return closestViewport;
|
|
7509
|
+
}, [viewportOptions, frameRef]);
|
|
7510
|
+
useEffect23(() => {
|
|
7511
|
+
var _a2;
|
|
7512
|
+
if (typeof window === "undefined") return;
|
|
7513
|
+
if ((_a2 = uiProp == null ? void 0 : uiProp.viewports) == null ? void 0 : _a2.current) return;
|
|
7514
|
+
const closestViewport = pickClosestViewport();
|
|
7515
|
+
if (!closestViewport) return;
|
|
7576
7516
|
if (iframe.enabled) {
|
|
7577
7517
|
const s = appStoreApi.getState();
|
|
7578
7518
|
const appState = {
|
|
@@ -7594,12 +7534,47 @@ var Canvas = () => {
|
|
|
7594
7534
|
appStoreApi.setState(__spreadProps(__spreadValues({}, appState), { history }));
|
|
7595
7535
|
}
|
|
7596
7536
|
}, [
|
|
7597
|
-
|
|
7537
|
+
pickClosestViewport,
|
|
7598
7538
|
frameRef.current,
|
|
7599
7539
|
iframe,
|
|
7600
7540
|
appStoreApi,
|
|
7601
7541
|
(_a = uiProp == null ? void 0 : uiProp.viewports) == null ? void 0 : _a.current
|
|
7602
7542
|
]);
|
|
7543
|
+
useEffect23(() => {
|
|
7544
|
+
var _a2;
|
|
7545
|
+
if (typeof window === "undefined") return;
|
|
7546
|
+
if (!iframe.enabled) return;
|
|
7547
|
+
if ((_a2 = uiProp == null ? void 0 : uiProp.viewports) == null ? void 0 : _a2.current) return;
|
|
7548
|
+
const target = frameRef.current;
|
|
7549
|
+
if (!target) return;
|
|
7550
|
+
const observer = new ResizeObserver(() => {
|
|
7551
|
+
if (!autoSelectingRef.current) return;
|
|
7552
|
+
const closestViewport = pickClosestViewport();
|
|
7553
|
+
if (!closestViewport) return;
|
|
7554
|
+
const s = appStoreApi.getState();
|
|
7555
|
+
const current = s.state.ui.viewports.current;
|
|
7556
|
+
if (current.width === closestViewport.width && current.height === (closestViewport.height || "auto")) {
|
|
7557
|
+
return;
|
|
7558
|
+
}
|
|
7559
|
+
setUi({
|
|
7560
|
+
viewports: __spreadProps(__spreadValues({}, s.state.ui.viewports), {
|
|
7561
|
+
current: __spreadProps(__spreadValues({}, current), {
|
|
7562
|
+
width: closestViewport.width,
|
|
7563
|
+
height: closestViewport.height || "auto"
|
|
7564
|
+
})
|
|
7565
|
+
})
|
|
7566
|
+
});
|
|
7567
|
+
});
|
|
7568
|
+
observer.observe(target);
|
|
7569
|
+
return () => observer.disconnect();
|
|
7570
|
+
}, [
|
|
7571
|
+
pickClosestViewport,
|
|
7572
|
+
frameRef,
|
|
7573
|
+
iframe.enabled,
|
|
7574
|
+
(_b = uiProp == null ? void 0 : uiProp.viewports) == null ? void 0 : _b.current,
|
|
7575
|
+
appStoreApi,
|
|
7576
|
+
setUi
|
|
7577
|
+
]);
|
|
7603
7578
|
return /* @__PURE__ */ jsx49(
|
|
7604
7579
|
"div",
|
|
7605
7580
|
{
|
|
@@ -7639,6 +7614,7 @@ var Canvas = () => {
|
|
|
7639
7614
|
BrowserBar,
|
|
7640
7615
|
{
|
|
7641
7616
|
onViewportChange: (viewport) => {
|
|
7617
|
+
autoSelectingRef.current = false;
|
|
7642
7618
|
setShowTransition(true);
|
|
7643
7619
|
isResizingRef.current = true;
|
|
7644
7620
|
const uiViewport = __spreadProps(__spreadValues({}, viewport), {
|
|
@@ -7761,7 +7737,7 @@ init_react_import();
|
|
|
7761
7737
|
init_react_import();
|
|
7762
7738
|
import { useCallback as useCallback20, useRef as useRef15 } from "react";
|
|
7763
7739
|
|
|
7764
|
-
// css-module:/Users/rami/Documents/apps/
|
|
7740
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Editor/components/ResizeHandle/styles.module.css#css-module
|
|
7765
7741
|
init_react_import();
|
|
7766
7742
|
var styles_module_default26 = { "ResizeHandle": "_ResizeHandle_s0ymy_2", "ResizeHandle--left": "_ResizeHandle--left_s0ymy_16", "ResizeHandle--right": "_ResizeHandle--right_s0ymy_20" };
|
|
7767
7743
|
|
|
@@ -7832,7 +7808,7 @@ var ResizeHandle = ({
|
|
|
7832
7808
|
);
|
|
7833
7809
|
};
|
|
7834
7810
|
|
|
7835
|
-
// css-module:/Users/rami/Documents/apps/
|
|
7811
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Editor/components/Sidebar/styles.module.css#css-module
|
|
7836
7812
|
init_react_import();
|
|
7837
7813
|
var styles_module_default27 = { "Sidebar": "_Sidebar_6tp4l_1", "Sidebar--isVisible": "_Sidebar--isVisible_6tp4l_9", "Sidebar--left": "_Sidebar--left_6tp4l_13", "Sidebar--right": "_Sidebar--right_6tp4l_25", "Sidebar-resizeHandle": "_Sidebar-resizeHandle_6tp4l_37" };
|
|
7838
7814
|
|
|
@@ -7932,7 +7908,7 @@ var useDeleteHotkeys = () => {
|
|
|
7932
7908
|
// components/Editor/components/Nav/index.tsx
|
|
7933
7909
|
init_react_import();
|
|
7934
7910
|
|
|
7935
|
-
// css-module:/Users/rami/Documents/apps/
|
|
7911
|
+
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Editor/components/Nav/styles.module.css#css-module
|
|
7936
7912
|
init_react_import();
|
|
7937
7913
|
var styles_module_default28 = { "Nav": "_Nav_kjoi9_1", "Nav-list": "_Nav-list_kjoi9_18", "Nav-footer": "_Nav-footer_kjoi9_42", "NavItem-link": "_NavItem-link_kjoi9_55", "NavItem-linkLabel": "_NavItem-linkLabel_kjoi9_83", "NavItem": "_NavItem_kjoi9_55", "NavItem-linkIcon": "_NavItem-linkIcon_kjoi9_108", "NavItem--active": "_NavItem--active_kjoi9_121", "NavItem--mobileOnly": "_NavItem--mobileOnly_kjoi9_132", "NavItem--desktopOnly": "_NavItem--desktopOnly_kjoi9_137" };
|
|
7938
7914
|
|
|
@@ -8408,10 +8384,8 @@ function EditorProvider({ children }) {
|
|
|
8408
8384
|
const {
|
|
8409
8385
|
config,
|
|
8410
8386
|
data: initialData,
|
|
8411
|
-
globalData: initialGlobalData,
|
|
8412
8387
|
ui: initialUi,
|
|
8413
8388
|
onChange,
|
|
8414
|
-
onGlobalsChange,
|
|
8415
8389
|
permissions = {},
|
|
8416
8390
|
plugins,
|
|
8417
8391
|
overrides,
|
|
@@ -8432,7 +8406,7 @@ function EditorProvider({ children }) {
|
|
|
8432
8406
|
[_iframe]
|
|
8433
8407
|
);
|
|
8434
8408
|
const [generatedAppState] = useState23(() => {
|
|
8435
|
-
var _a, _b, _c, _d, _e;
|
|
8409
|
+
var _a, _b, _c, _d, _e, _f;
|
|
8436
8410
|
const initial = __spreadValues(__spreadValues({}, defaultAppState.ui), initialUi);
|
|
8437
8411
|
let clientUiState = {};
|
|
8438
8412
|
if (Object.keys((initialData == null ? void 0 : initialData.root) || {}).length > 0 && !((_a = initialData == null ? void 0 : initialData.root) == null ? void 0 : _a.props)) {
|
|
@@ -8446,20 +8420,20 @@ function EditorProvider({ children }) {
|
|
|
8446
8420
|
toComponent(__spreadProps(__spreadValues({}, initialData == null ? void 0 : initialData.root), { props: defaultedRootProps })),
|
|
8447
8421
|
config
|
|
8448
8422
|
);
|
|
8449
|
-
const
|
|
8450
|
-
for (const [type, comp] of Object.entries((
|
|
8451
|
-
if ((comp == null ? void 0 : comp.global) && !
|
|
8452
|
-
|
|
8453
|
-
props: __spreadValues({}, (
|
|
8423
|
+
const seededGlobals = __spreadValues({}, (_d = initialData == null ? void 0 : initialData.globals) != null ? _d : {});
|
|
8424
|
+
for (const [type, comp] of Object.entries((_e = config.components) != null ? _e : {})) {
|
|
8425
|
+
if ((comp == null ? void 0 : comp.global) && !seededGlobals[type]) {
|
|
8426
|
+
seededGlobals[type] = {
|
|
8427
|
+
props: __spreadValues({}, (_f = comp == null ? void 0 : comp.defaultProps) != null ? _f : {})
|
|
8454
8428
|
};
|
|
8455
8429
|
}
|
|
8456
8430
|
}
|
|
8457
8431
|
const composedData = resolveGlobals(
|
|
8458
8432
|
__spreadProps(__spreadValues({}, initialData), {
|
|
8459
8433
|
root: __spreadProps(__spreadValues({}, initialData == null ? void 0 : initialData.root), { props: root.props }),
|
|
8460
|
-
content: initialData.content || []
|
|
8434
|
+
content: initialData.content || [],
|
|
8435
|
+
globals: seededGlobals
|
|
8461
8436
|
}),
|
|
8462
|
-
seededGlobalData,
|
|
8463
8437
|
config
|
|
8464
8438
|
);
|
|
8465
8439
|
const newAppState = __spreadProps(__spreadValues({}, defaultAppState), {
|
|
@@ -8567,23 +8541,18 @@ function EditorProvider({ children }) {
|
|
|
8567
8541
|
initialAppState
|
|
8568
8542
|
});
|
|
8569
8543
|
const previousData = useRef17(null);
|
|
8570
|
-
const previousGlobalData = useRef17(null);
|
|
8571
8544
|
useEffect26(() => {
|
|
8572
8545
|
return appStore.subscribe(
|
|
8573
8546
|
(s) => s.state.data,
|
|
8574
8547
|
(data) => {
|
|
8575
|
-
const split =
|
|
8576
|
-
if (onChange && !deepEqual2(split
|
|
8577
|
-
onChange(split
|
|
8578
|
-
previousData.current = split
|
|
8579
|
-
}
|
|
8580
|
-
if (onGlobalsChange && !deepEqual2(split.globalData, previousGlobalData.current)) {
|
|
8581
|
-
onGlobalsChange(split.globalData);
|
|
8582
|
-
previousGlobalData.current = split.globalData;
|
|
8548
|
+
const split = splitGlobals(data, config);
|
|
8549
|
+
if (onChange && !deepEqual2(split, previousData.current)) {
|
|
8550
|
+
onChange(split);
|
|
8551
|
+
previousData.current = split;
|
|
8583
8552
|
}
|
|
8584
8553
|
}
|
|
8585
8554
|
);
|
|
8586
|
-
}, [onChange,
|
|
8555
|
+
}, [onChange, config]);
|
|
8587
8556
|
useRegisterPermissionsSlice(appStore, permissions);
|
|
8588
8557
|
const uEditorStore = useRegisterUseEditorStore(appStore);
|
|
8589
8558
|
useEffect26(() => {
|