@crediblemark/build 0.25.19 → 0.25.21
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/ArrayField-5NGEZXWU.mjs +18 -0
- package/dist/{ObjectField-VE3JKAWT.css → ArrayField-ELOHWNCP.css} +291 -291
- package/dist/{Editor-7JTCMSHZ.mjs → Editor-I3NGZND5.mjs} +8 -8
- package/dist/{Editor-6U6G5YLU.css → Editor-YW4RWTY3.css} +7 -7
- package/dist/{ArrayField-QVQ36K6O.css → ObjectField-AN37XVFT.css} +283 -283
- package/dist/ObjectField-TK4CLEHL.mjs +18 -0
- package/dist/{Render-HVM2KISU.css → Render-G6FCHISC.css} +1 -1
- package/dist/{Render-5WYR4VZX.mjs → Render-YPURU4ZF.mjs} +5 -3
- package/dist/{chunk-U7AIA2UJ.mjs → chunk-3UVVSIWJ.mjs} +2 -2
- package/dist/{chunk-LBXFITWQ.mjs → chunk-5A7FLZ3B.mjs} +2 -2
- package/dist/{chunk-5GWBGJC4.mjs → chunk-5ASR74IZ.mjs} +216 -102
- package/dist/{chunk-H6RPI3T6.mjs → chunk-HH537E6Q.mjs} +1 -1
- package/dist/{chunk-TOU7Y6T4.mjs → chunk-J3I5GT3E.mjs} +1 -1
- package/dist/{chunk-J4ZMH6JZ.mjs → chunk-KAL2OHVB.mjs} +1 -1
- package/dist/{chunk-D7HE7E2A.mjs → chunk-LGPNWN5U.mjs} +32 -16
- package/dist/{chunk-GEYNLWCZ.mjs → chunk-MQINT3WW.mjs} +1 -1
- package/dist/{chunk-ARM3KXOM.mjs → chunk-N4PD57DO.mjs} +19 -15
- package/dist/{chunk-D4WFZ3K2.mjs → chunk-NFUQAIKA.mjs} +31 -10
- package/dist/{chunk-U4NHUPA4.mjs → chunk-QJ3POSBT.mjs} +5 -5
- package/dist/{chunk-SOAJKHLV.mjs → chunk-S65FGP6E.mjs} +3 -3
- package/dist/chunk-TFAYWP2C.mjs +16 -0
- package/dist/{chunk-VEQIM5ZE.mjs → chunk-WADDTBOG.mjs} +20 -17
- package/dist/{full-2LSQUWEM.css → full-PJWYWS5O.css} +6 -6
- package/dist/{full-B3RS4LV3.mjs → full-YJS7XBEW.mjs} +5 -5
- package/dist/index.css +38 -38
- package/dist/index.js +297 -116
- package/dist/index.mjs +14 -13
- package/dist/{loaded-FY2TCG5Y.css → loaded-GB62SDMW.css} +1 -1
- package/dist/{loaded-JIR6E6RO.mjs → loaded-ICFOKFPH.mjs} +4 -3
- package/dist/{loaded-XEI7CJSF.mjs → loaded-LU4R6WMV.mjs} +4 -3
- package/dist/{loaded-VCMCWG55.mjs → loaded-VDUTUHUM.mjs} +4 -3
- package/dist/no-external.css +38 -38
- package/dist/no-external.js +297 -116
- package/dist/no-external.mjs +14 -13
- package/dist/rsc.css +19 -19
- package/dist/rsc.js +161 -91
- package/dist/rsc.mjs +13 -12
- package/package.json +1 -1
- package/dist/ArrayField-LRIG75HP.mjs +0 -17
- package/dist/ObjectField-M2VTKEXM.mjs +0 -17
|
@@ -13,11 +13,11 @@ import {
|
|
|
13
13
|
renderContext,
|
|
14
14
|
useRichtextProps,
|
|
15
15
|
useSlots
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-WADDTBOG.mjs";
|
|
17
17
|
import {
|
|
18
18
|
collisionStore,
|
|
19
19
|
useSensors
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-QJ3POSBT.mjs";
|
|
21
21
|
import {
|
|
22
22
|
AutoFieldPrivate,
|
|
23
23
|
Button,
|
|
@@ -25,11 +25,11 @@ import {
|
|
|
25
25
|
fieldContextStore,
|
|
26
26
|
useContextStore,
|
|
27
27
|
useSafeId
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-N4PD57DO.mjs";
|
|
29
29
|
import {
|
|
30
30
|
IconButton,
|
|
31
31
|
Loader
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-LGPNWN5U.mjs";
|
|
33
33
|
import {
|
|
34
34
|
Box,
|
|
35
35
|
ChartColumn,
|
|
@@ -90,7 +90,7 @@ import {
|
|
|
90
90
|
useRegisterHistorySlice,
|
|
91
91
|
useRegisterPermissionsSlice,
|
|
92
92
|
useResetAutoZoom
|
|
93
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-NFUQAIKA.mjs";
|
|
94
94
|
import {
|
|
95
95
|
get_class_name_factory_default
|
|
96
96
|
} from "./chunk-BFHV72KK.mjs";
|
|
@@ -280,8 +280,13 @@ function Render({
|
|
|
280
280
|
};
|
|
281
281
|
const rootProps = "props" in defaultedData.root ? defaultedData.root.props : defaultedData.root;
|
|
282
282
|
const title = rootProps?.title || "";
|
|
283
|
+
const renderContextValue = useMemo(() => ({
|
|
284
|
+
config,
|
|
285
|
+
data: defaultedData,
|
|
286
|
+
metadata
|
|
287
|
+
}), [config, defaultedData, metadata]);
|
|
283
288
|
if (rootProps?.mode === "html") {
|
|
284
|
-
return /* @__PURE__ */ jsx2(renderContext.Provider, { value:
|
|
289
|
+
return /* @__PURE__ */ jsx2(renderContext.Provider, { value: renderContextValue, children: /* @__PURE__ */ jsx2(HtmlModeRender, { htmlCode: rootProps.htmlCode, isEditing: false }) });
|
|
285
290
|
}
|
|
286
291
|
const pageProps = {
|
|
287
292
|
...rootProps,
|
|
@@ -309,9 +314,9 @@ function Render({
|
|
|
309
314
|
[]
|
|
310
315
|
);
|
|
311
316
|
if (config.root?.render) {
|
|
312
|
-
return /* @__PURE__ */ jsx2(renderContext.Provider, { value:
|
|
317
|
+
return /* @__PURE__ */ jsx2(renderContext.Provider, { value: renderContextValue, children: /* @__PURE__ */ jsx2(DropZoneProvider, { value: nextContextValue, children: /* @__PURE__ */ jsx2(config.root.render, { ...propsWithSlots, ...richtextProps, children: /* @__PURE__ */ jsx2(DropZoneRenderPure, { zone: rootZone }) }) }) });
|
|
313
318
|
}
|
|
314
|
-
return /* @__PURE__ */ jsx2(renderContext.Provider, { value:
|
|
319
|
+
return /* @__PURE__ */ jsx2(renderContext.Provider, { value: renderContextValue, children: /* @__PURE__ */ jsx2(DropZoneProvider, { value: nextContextValue, children: /* @__PURE__ */ jsx2(DropZoneRenderPure, { zone: rootZone }) }) });
|
|
315
320
|
}
|
|
316
321
|
|
|
317
322
|
// lib/use-credbuild.ts
|
|
@@ -475,7 +480,7 @@ function useGetCredBuild() {
|
|
|
475
480
|
// lib/use-component-list.tsx
|
|
476
481
|
import { useEffect as useEffect4, useState as useState3 } from "react";
|
|
477
482
|
|
|
478
|
-
// css-module:/
|
|
483
|
+
// css-module:/home/rasyiqi/PROJECT/Credbuild/credbuild/components/ComponentList/styles.module.css#css-module
|
|
479
484
|
var styles_module_default = { "ComponentList": "_ComponentList_1dcib_1", "ComponentList--isExpanded": "_ComponentList--isExpanded_1dcib_5", "ComponentList-content": "_ComponentList-content_1dcib_9", "ComponentList-title": "_ComponentList-title_1dcib_17", "ComponentList-titleIcon": "_ComponentList-titleIcon_1dcib_53" };
|
|
480
485
|
|
|
481
486
|
// components/ComponentList/index.tsx
|
|
@@ -649,7 +654,7 @@ var useComponentList = () => {
|
|
|
649
654
|
// components/CredBuild/components/Components/index.tsx
|
|
650
655
|
import { useMemo as useMemo2, useState as useState4 } from "react";
|
|
651
656
|
|
|
652
|
-
// css-module:/
|
|
657
|
+
// css-module:/home/rasyiqi/PROJECT/Credbuild/credbuild/components/CredBuild/components/Components/styles.module.css#css-module
|
|
653
658
|
var styles_module_default2 = { "CredBuildComponents": "_CredBuildComponents_lxrzy_1", "CredBuildComponents-searchContainer": "_CredBuildComponents-searchContainer_lxrzy_7", "CredBuildComponents-searchWrapper": "_CredBuildComponents-searchWrapper_lxrzy_16", "CredBuildComponents-searchInput": "_CredBuildComponents-searchInput_lxrzy_23", "CredBuildComponents-searchIcon": "_CredBuildComponents-searchIcon_lxrzy_42", "CredBuildComponents-clearButton": "_CredBuildComponents-clearButton_lxrzy_54", "CredBuildComponents-listContainer": "_CredBuildComponents-listContainer_lxrzy_74", "CredBuildComponents-noResults": "_CredBuildComponents-noResults_lxrzy_79" };
|
|
654
659
|
|
|
655
660
|
// components/CredBuild/components/Components/index.tsx
|
|
@@ -744,7 +749,7 @@ var Components = () => {
|
|
|
744
749
|
] });
|
|
745
750
|
};
|
|
746
751
|
|
|
747
|
-
// css-module:/
|
|
752
|
+
// css-module:/home/rasyiqi/PROJECT/Credbuild/credbuild/plugins/blocks/styles.module.css#css-module
|
|
748
753
|
var styles_module_default3 = { "BlocksPlugin": "_BlocksPlugin_1q0b2_1" };
|
|
749
754
|
|
|
750
755
|
// plugins/blocks/index.tsx
|
|
@@ -757,7 +762,7 @@ var blocksPlugin = () => ({
|
|
|
757
762
|
icon: /* @__PURE__ */ jsx6(Shapes, {})
|
|
758
763
|
});
|
|
759
764
|
|
|
760
|
-
// css-module:/
|
|
765
|
+
// css-module:/home/rasyiqi/PROJECT/Credbuild/credbuild/components/LayerTree/styles.module.css#css-module
|
|
761
766
|
var styles_module_default4 = { "LayerTree": "_LayerTree_nus40_1", "LayerTree-zoneTitle": "_LayerTree-zoneTitle_nus40_11", "LayerTree-helper": "_LayerTree-helper_nus40_17", "Layer": "_Layer_nus40_1", "Layer-inner": "_Layer-inner_nus40_29", "Layer--containsZone": "_Layer--containsZone_nus40_35", "Layer-clickable": "_Layer-clickable_nus40_39", "Layer--isSelected": "_Layer--isSelected_nus40_58", "Layer-chevron": "_Layer-chevron_nus40_79", "Layer--childIsSelected": "_Layer--childIsSelected_nus40_80", "Layer-zones": "_Layer-zones_nus40_84", "Layer-title": "_Layer-title_nus40_98", "Layer-name": "_Layer-name_nus40_107", "Layer-icon": "_Layer-icon_nus40_113", "Layer-zoneIcon": "_Layer-zoneIcon_nus40_118" };
|
|
762
767
|
|
|
763
768
|
// components/LayerTree/index.tsx
|
|
@@ -766,7 +771,10 @@ import {
|
|
|
766
771
|
useCallback,
|
|
767
772
|
useContext as useContext2,
|
|
768
773
|
useRef,
|
|
769
|
-
memo as memo2
|
|
774
|
+
memo as memo2,
|
|
775
|
+
createContext as createContext2,
|
|
776
|
+
useState as useState5,
|
|
777
|
+
useMemo as useMemo3
|
|
770
778
|
} from "react";
|
|
771
779
|
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
772
780
|
import { Fragment, jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
@@ -776,6 +784,7 @@ var DEFAULT_LAYER_ROW_HEIGHT = 32;
|
|
|
776
784
|
var LAYER_TREE_VIRTUALIZATION_OVERSCAN = 8;
|
|
777
785
|
var MIN_VIRTUALIZED_LAYER_COUNT = 25;
|
|
778
786
|
var measuredRowHeights = /* @__PURE__ */ new Map();
|
|
787
|
+
var DragContext = createContext2(null);
|
|
779
788
|
var getZonesByParent = (zones) => {
|
|
780
789
|
return Object.keys(zones).reduce((acc, zone) => {
|
|
781
790
|
const [parentId] = zone.split(":");
|
|
@@ -878,7 +887,9 @@ var Layer = memo2(forwardRef(function Layer2({
|
|
|
878
887
|
selectedPathIds
|
|
879
888
|
}, ref) {
|
|
880
889
|
const dispatch = useAppStore((s) => s.dispatch);
|
|
890
|
+
const appStoreApi = useAppStoreApi();
|
|
881
891
|
const zoneStore = useContext2(ZoneStoreContext);
|
|
892
|
+
const dragCtx = useContext2(DragContext);
|
|
882
893
|
const isHovering = useContextStore(
|
|
883
894
|
ZoneStoreContext,
|
|
884
895
|
(s) => s.hoveringComponent === node.itemId
|
|
@@ -917,12 +928,98 @@ var Layer = memo2(forwardRef(function Layer2({
|
|
|
917
928
|
}),
|
|
918
929
|
"data-index": dataIndex,
|
|
919
930
|
"data-credbuild-layer-tree-id": node.itemId,
|
|
931
|
+
draggable: true,
|
|
932
|
+
onDragStart: (e) => {
|
|
933
|
+
dragCtx?.setDraggedItem({
|
|
934
|
+
itemId: node.itemId,
|
|
935
|
+
index: node.index,
|
|
936
|
+
zoneCompound: node.zoneCompound
|
|
937
|
+
});
|
|
938
|
+
e.dataTransfer.effectAllowed = "move";
|
|
939
|
+
},
|
|
940
|
+
onDragOver: (e) => {
|
|
941
|
+
e.preventDefault();
|
|
942
|
+
if (!dragCtx || !dragCtx.draggedItem || dragCtx.draggedItem.itemId === node.itemId) return;
|
|
943
|
+
const targetNodeIndex = appStoreApi.getState().state.indexes.nodes[node.itemId];
|
|
944
|
+
if (targetNodeIndex?.path.some((p) => p.split(":")[0] === dragCtx.draggedItem?.itemId)) {
|
|
945
|
+
return;
|
|
946
|
+
}
|
|
947
|
+
const rect = e.currentTarget.getBoundingClientRect();
|
|
948
|
+
const hoverClientY = e.clientY - rect.top;
|
|
949
|
+
const threshold = rect.height / 2;
|
|
950
|
+
const position = hoverClientY < threshold ? "before" : "after";
|
|
951
|
+
dragCtx.setHoveredItemId(node.itemId);
|
|
952
|
+
dragCtx.setHoverPosition(position);
|
|
953
|
+
},
|
|
954
|
+
onDragLeave: () => {
|
|
955
|
+
if (dragCtx?.hoveredItemId === node.itemId) {
|
|
956
|
+
dragCtx.setHoveredItemId(null);
|
|
957
|
+
dragCtx.setHoverPosition(null);
|
|
958
|
+
}
|
|
959
|
+
},
|
|
960
|
+
onDrop: (e) => {
|
|
961
|
+
e.preventDefault();
|
|
962
|
+
if (!dragCtx || !dragCtx.draggedItem || dragCtx.draggedItem.itemId === node.itemId) return;
|
|
963
|
+
let destIndex = node.index;
|
|
964
|
+
if (dragCtx.draggedItem.zoneCompound === node.zoneCompound) {
|
|
965
|
+
if (dragCtx.hoverPosition === "before") {
|
|
966
|
+
destIndex = dragCtx.draggedItem.index > node.index ? node.index : node.index - 1;
|
|
967
|
+
} else {
|
|
968
|
+
destIndex = dragCtx.draggedItem.index > node.index ? node.index + 1 : node.index;
|
|
969
|
+
}
|
|
970
|
+
} else {
|
|
971
|
+
destIndex = dragCtx.hoverPosition === "before" ? node.index : node.index + 1;
|
|
972
|
+
}
|
|
973
|
+
dispatch({
|
|
974
|
+
type: "move",
|
|
975
|
+
sourceIndex: dragCtx.draggedItem.index,
|
|
976
|
+
sourceZone: dragCtx.draggedItem.zoneCompound,
|
|
977
|
+
destinationIndex: destIndex,
|
|
978
|
+
destinationZone: node.zoneCompound
|
|
979
|
+
});
|
|
980
|
+
dispatch({
|
|
981
|
+
type: "setUi",
|
|
982
|
+
ui: {
|
|
983
|
+
itemSelector: {
|
|
984
|
+
index: destIndex,
|
|
985
|
+
zone: node.zoneCompound
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
});
|
|
989
|
+
dragCtx.setDraggedItem(null);
|
|
990
|
+
dragCtx.setHoveredItemId(null);
|
|
991
|
+
dragCtx.setHoverPosition(null);
|
|
992
|
+
},
|
|
993
|
+
onDragEnd: () => {
|
|
994
|
+
dragCtx?.setDraggedItem(null);
|
|
995
|
+
dragCtx?.setHoveredItemId(null);
|
|
996
|
+
dragCtx?.setHoverPosition(null);
|
|
997
|
+
},
|
|
998
|
+
style: {
|
|
999
|
+
opacity: dragCtx?.draggedItem?.itemId === node.itemId ? 0.4 : 1,
|
|
1000
|
+
position: "relative"
|
|
1001
|
+
},
|
|
920
1002
|
children: [
|
|
1003
|
+
dragCtx?.hoveredItemId === node.itemId && dragCtx?.hoverPosition && /* @__PURE__ */ jsx7(
|
|
1004
|
+
"div",
|
|
1005
|
+
{
|
|
1006
|
+
style: {
|
|
1007
|
+
position: "absolute",
|
|
1008
|
+
left: 0,
|
|
1009
|
+
right: 0,
|
|
1010
|
+
height: "2px",
|
|
1011
|
+
background: "linear-gradient(to right, var(--cb-gold, #d4af37), #f3e5ab)",
|
|
1012
|
+
zIndex: 10,
|
|
1013
|
+
...dragCtx.hoverPosition === "before" ? { top: 0 } : { bottom: 0 }
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
),
|
|
921
1017
|
/* @__PURE__ */ jsx7("div", { className: getClassNameLayer("inner"), children: /* @__PURE__ */ jsxs3(
|
|
922
1018
|
"button",
|
|
923
1019
|
{
|
|
924
1020
|
type: "button",
|
|
925
1021
|
className: getClassNameLayer("clickable"),
|
|
1022
|
+
"aria-expanded": containsZone ? shouldRenderChildren : void 0,
|
|
926
1023
|
onClick: () => {
|
|
927
1024
|
if (isSelected) {
|
|
928
1025
|
setItemSelector(null);
|
|
@@ -1115,7 +1212,18 @@ var LayerTree = memo2(({
|
|
|
1115
1212
|
selectedPathIds,
|
|
1116
1213
|
trees
|
|
1117
1214
|
}) => {
|
|
1118
|
-
|
|
1215
|
+
const [draggedItem, setDraggedItem] = useState5(null);
|
|
1216
|
+
const [hoveredItemId, setHoveredItemId] = useState5(null);
|
|
1217
|
+
const [hoverPosition, setHoverPosition] = useState5(null);
|
|
1218
|
+
const dragContextValue = useMemo3(() => ({
|
|
1219
|
+
draggedItem,
|
|
1220
|
+
setDraggedItem,
|
|
1221
|
+
hoveredItemId,
|
|
1222
|
+
setHoveredItemId,
|
|
1223
|
+
hoverPosition,
|
|
1224
|
+
setHoverPosition
|
|
1225
|
+
}), [draggedItem, hoveredItemId, hoverPosition]);
|
|
1226
|
+
return /* @__PURE__ */ jsx7(DragContext.Provider, { value: dragContextValue, children: trees.map((tree) => /* @__PURE__ */ jsx7(
|
|
1119
1227
|
LayerTreeZone,
|
|
1120
1228
|
{
|
|
1121
1229
|
depth: 0,
|
|
@@ -1128,7 +1236,7 @@ var LayerTree = memo2(({
|
|
|
1128
1236
|
});
|
|
1129
1237
|
|
|
1130
1238
|
// components/CredBuild/components/Outline/index.tsx
|
|
1131
|
-
import { useMemo as
|
|
1239
|
+
import { useMemo as useMemo4, memo as memo3 } from "react";
|
|
1132
1240
|
|
|
1133
1241
|
// lib/data/find-zones-for-area.ts
|
|
1134
1242
|
var findZonesForArea = (state, area) => {
|
|
@@ -1149,13 +1257,13 @@ var Outline = memo3(() => {
|
|
|
1149
1257
|
const rootZones = useAppStore(
|
|
1150
1258
|
useShallow((s) => findZonesForArea(s.state, "root"))
|
|
1151
1259
|
);
|
|
1152
|
-
const
|
|
1153
|
-
|
|
1260
|
+
const selectedPath = selectedId ? nodes[selectedId]?.path : null;
|
|
1261
|
+
const selectedPathIds = useMemo4(() => {
|
|
1154
1262
|
return new Set(
|
|
1155
1263
|
selectedPath?.map((candidate) => candidate.split(":")[0]).filter(Boolean) || []
|
|
1156
1264
|
);
|
|
1157
|
-
}, [
|
|
1158
|
-
const trees =
|
|
1265
|
+
}, [selectedPath]);
|
|
1266
|
+
const trees = useMemo4(
|
|
1159
1267
|
() => rootZones.map(
|
|
1160
1268
|
(zoneCompound) => buildLayerTree({
|
|
1161
1269
|
config,
|
|
@@ -1167,7 +1275,7 @@ var Outline = memo3(() => {
|
|
|
1167
1275
|
),
|
|
1168
1276
|
[config, nodes, rootZones, zones]
|
|
1169
1277
|
);
|
|
1170
|
-
const Wrapper =
|
|
1278
|
+
const Wrapper = useMemo4(() => outlineOverride || "div", [outlineOverride]);
|
|
1171
1279
|
return /* @__PURE__ */ jsx8(Wrapper, { children: /* @__PURE__ */ jsx8(
|
|
1172
1280
|
LayerTree,
|
|
1173
1281
|
{
|
|
@@ -1178,7 +1286,7 @@ var Outline = memo3(() => {
|
|
|
1178
1286
|
) });
|
|
1179
1287
|
});
|
|
1180
1288
|
|
|
1181
|
-
// css-module:/
|
|
1289
|
+
// css-module:/home/rasyiqi/PROJECT/Credbuild/credbuild/plugins/outline/styles.module.css#css-module
|
|
1182
1290
|
var styles_module_default5 = { "OutlinePlugin": "_OutlinePlugin_q92j6_1" };
|
|
1183
1291
|
|
|
1184
1292
|
// plugins/outline/index.tsx
|
|
@@ -1191,17 +1299,17 @@ var outlinePlugin = () => ({
|
|
|
1191
1299
|
icon: /* @__PURE__ */ jsx9(List, {})
|
|
1192
1300
|
});
|
|
1193
1301
|
|
|
1194
|
-
// css-module:/
|
|
1302
|
+
// css-module:/home/rasyiqi/PROJECT/Credbuild/credbuild/components/Breadcrumbs/styles.module.css#css-module
|
|
1195
1303
|
var styles_module_default6 = { "Breadcrumbs": "_Breadcrumbs_1e0gb_1", "Breadcrumbs-breadcrumbLabel": "_Breadcrumbs-breadcrumbLabel_1e0gb_7", "Breadcrumbs-breadcrumb": "_Breadcrumbs-breadcrumb_1e0gb_7" };
|
|
1196
1304
|
|
|
1197
1305
|
// lib/use-breadcrumbs.ts
|
|
1198
|
-
import { useMemo as
|
|
1306
|
+
import { useMemo as useMemo5 } from "react";
|
|
1199
1307
|
var useBreadcrumbs = (renderCount) => {
|
|
1200
1308
|
const selectedId = useAppStore((s) => s.selectedItem?.props.id);
|
|
1201
1309
|
const config = useAppStore((s) => s.config);
|
|
1202
1310
|
const path = useAppStore((s) => s.state.indexes.nodes[selectedId]?.path);
|
|
1203
1311
|
const appStore = useAppStoreApi();
|
|
1204
|
-
return
|
|
1312
|
+
return useMemo5(() => {
|
|
1205
1313
|
const breadcrumbs = path?.map((zoneCompound) => {
|
|
1206
1314
|
const [componentId] = zoneCompound.split(":");
|
|
1207
1315
|
if (componentId === "root") {
|
|
@@ -1256,7 +1364,7 @@ var Breadcrumbs = ({
|
|
|
1256
1364
|
] });
|
|
1257
1365
|
};
|
|
1258
1366
|
|
|
1259
|
-
// css-module:/
|
|
1367
|
+
// css-module:/home/rasyiqi/PROJECT/Credbuild/credbuild/components/CredBuild/components/Fields/styles.module.css#css-module
|
|
1260
1368
|
var styles_module_default7 = { "CredBuildFields": "_CredBuildFields_53gu7_1", "CredBuildFields--isLoading": "_CredBuildFields--isLoading_53gu7_6", "CredBuildFields-loadingOverlay": "_CredBuildFields-loadingOverlay_53gu7_10", "CredBuildFields-loadingOverlayInner": "_CredBuildFields-loadingOverlayInner_53gu7_25", "CredBuildFields-field": "_CredBuildFields-field_53gu7_32", "CredBuildFields--wrapFields": "_CredBuildFields--wrapFields_53gu7_36" };
|
|
1261
1369
|
|
|
1262
1370
|
// components/CredBuild/components/Fields/index.tsx
|
|
@@ -1265,7 +1373,7 @@ import {
|
|
|
1265
1373
|
useCallback as useCallback2,
|
|
1266
1374
|
useContext as useContext3,
|
|
1267
1375
|
useEffect as useEffect5,
|
|
1268
|
-
useMemo as
|
|
1376
|
+
useMemo as useMemo6
|
|
1269
1377
|
} from "react";
|
|
1270
1378
|
import { useShallow as useShallow2 } from "zustand/react/shallow";
|
|
1271
1379
|
import { Fragment as Fragment2, jsx as jsx11, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
@@ -1368,7 +1476,7 @@ var FieldsChildInner = ({ fieldName }) => {
|
|
|
1368
1476
|
};
|
|
1369
1477
|
var FieldsChild = ({ fieldName }) => {
|
|
1370
1478
|
const appStore = useAppStoreApi();
|
|
1371
|
-
const initialValue =
|
|
1479
|
+
const initialValue = useMemo6(() => {
|
|
1372
1480
|
const value = appStore.getState().getCurrentData().props?.[fieldName];
|
|
1373
1481
|
return { [fieldName]: value };
|
|
1374
1482
|
}, [appStore, fieldName]);
|
|
@@ -1395,7 +1503,7 @@ var FieldsInternal = ({ wrapFields = true }) => {
|
|
|
1395
1503
|
})
|
|
1396
1504
|
);
|
|
1397
1505
|
const isLoading = fieldsLoading || componentResolving;
|
|
1398
|
-
const Wrapper =
|
|
1506
|
+
const Wrapper = useMemo6(() => overrides.fields || DefaultFields, [overrides]);
|
|
1399
1507
|
return /* @__PURE__ */ jsxs5(
|
|
1400
1508
|
"form",
|
|
1401
1509
|
{
|
|
@@ -1412,7 +1520,7 @@ var FieldsInternal = ({ wrapFields = true }) => {
|
|
|
1412
1520
|
};
|
|
1413
1521
|
var Fields = memo4(FieldsInternal);
|
|
1414
1522
|
|
|
1415
|
-
// css-module:/
|
|
1523
|
+
// css-module:/home/rasyiqi/PROJECT/Credbuild/credbuild/plugins/fields/styles.module.css#css-module
|
|
1416
1524
|
var styles_module_default8 = { "FieldsPlugin": "_FieldsPlugin_6as57_1", "FieldsPlugin-header": "_FieldsPlugin-header_6as57_7" };
|
|
1417
1525
|
|
|
1418
1526
|
// plugins/fields/index.tsx
|
|
@@ -1437,18 +1545,18 @@ var fieldsPlugin = ({ desktopSideBar = "right" } = {}) => ({
|
|
|
1437
1545
|
});
|
|
1438
1546
|
|
|
1439
1547
|
// plugins/code/CodePanel.tsx
|
|
1440
|
-
import { useState as
|
|
1548
|
+
import { useState as useState6 } from "react";
|
|
1441
1549
|
|
|
1442
|
-
// css-module:/
|
|
1550
|
+
// css-module:/home/rasyiqi/PROJECT/Credbuild/credbuild/plugins/code/styles.module.css#css-module
|
|
1443
1551
|
var styles_module_default9 = { "CodePlugin": "_CodePlugin_77s8n_1", "CodePanel": "_CodePanel_77s8n_9", "CodePanel-title": "_CodePanel-title_77s8n_18", "CodePanel-textarea": "_CodePanel-textarea_77s8n_27", "CodePanel-optionsSection": "_CodePanel-optionsSection_77s8n_49", "CodePanel-optionTitle": "_CodePanel-optionTitle_77s8n_53", "CodePanel-radioGroup": "_CodePanel-radioGroup_77s8n_62", "CodePanel-radioLabel": "_CodePanel-radioLabel_77s8n_68", "CodePanel-radioInput": "_CodePanel-radioInput_77s8n_77", "CodePanel-button": "_CodePanel-button_77s8n_87", "CodePanel-error": "_CodePanel-error_77s8n_120", "CodePanel-success": "_CodePanel-success_77s8n_131", "CodePanel-promptSection": "_CodePanel-promptSection_77s8n_142", "CodePanel-promptHeader": "_CodePanel-promptHeader_77s8n_148", "CodePanel-promptText": "_CodePanel-promptText_77s8n_155", "CodePanel-copyBtn": "_CodePanel-copyBtn_77s8n_169", "CodePanel-copyBtn--copied": "_CodePanel-copyBtn--copied_77s8n_193" };
|
|
1444
1552
|
|
|
1445
1553
|
// plugins/code/CodePanel.tsx
|
|
1446
1554
|
import { Fragment as Fragment3, jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1447
1555
|
var getClassName9 = get_class_name_factory_default("CodePanel", styles_module_default9);
|
|
1448
1556
|
var CodePanel = () => {
|
|
1449
|
-
const [copied, setCopied] =
|
|
1450
|
-
const [topic, setTopic] =
|
|
1451
|
-
const [promptType, setPromptType] =
|
|
1557
|
+
const [copied, setCopied] = useState6(false);
|
|
1558
|
+
const [topic, setTopic] = useState6("");
|
|
1559
|
+
const [promptType, setPromptType] = useState6("header-footer");
|
|
1452
1560
|
const dispatch = useAppStore((s) => s.dispatch);
|
|
1453
1561
|
const root = useAppStore((s) => s.state.data.root);
|
|
1454
1562
|
const rootProps = root?.props || root;
|
|
@@ -1688,22 +1796,22 @@ var codePlugin = () => ({
|
|
|
1688
1796
|
import {
|
|
1689
1797
|
useCallback as useCallback12,
|
|
1690
1798
|
useEffect as useEffect15,
|
|
1691
|
-
useMemo as
|
|
1799
|
+
useMemo as useMemo16,
|
|
1692
1800
|
useRef as useRef9,
|
|
1693
|
-
useState as
|
|
1801
|
+
useState as useState16
|
|
1694
1802
|
} from "react";
|
|
1695
1803
|
|
|
1696
1804
|
// components/CredBuild/components/Preview/index.tsx
|
|
1697
|
-
import { useCallback as useCallback4, useEffect as useEffect7, useRef as useRef3, useMemo as
|
|
1805
|
+
import { useCallback as useCallback4, useEffect as useEffect7, useRef as useRef3, useMemo as useMemo8, useState as useState8 } from "react";
|
|
1698
1806
|
|
|
1699
1807
|
// components/AutoFrame/index.tsx
|
|
1700
1808
|
import {
|
|
1701
|
-
createContext as
|
|
1809
|
+
createContext as createContext3,
|
|
1702
1810
|
useCallback as useCallback3,
|
|
1703
1811
|
useContext as useContext4,
|
|
1704
1812
|
useEffect as useEffect6,
|
|
1705
1813
|
useRef as useRef2,
|
|
1706
|
-
useState as
|
|
1814
|
+
useState as useState7
|
|
1707
1815
|
} from "react";
|
|
1708
1816
|
import hash from "object-hash";
|
|
1709
1817
|
import { createPortal } from "react-dom";
|
|
@@ -1923,7 +2031,7 @@ var CopyHostStyles = ({
|
|
|
1923
2031
|
}, [debug, doc, onStylesLoaded, win]);
|
|
1924
2032
|
return /* @__PURE__ */ jsx15(Fragment4, { children });
|
|
1925
2033
|
};
|
|
1926
|
-
var autoFrameContext =
|
|
2034
|
+
var autoFrameContext = createContext3({});
|
|
1927
2035
|
var useFrame = () => useContext4(autoFrameContext);
|
|
1928
2036
|
function AutoFrame({
|
|
1929
2037
|
children,
|
|
@@ -1937,10 +2045,10 @@ function AutoFrame({
|
|
|
1937
2045
|
frameRef,
|
|
1938
2046
|
...props
|
|
1939
2047
|
}) {
|
|
1940
|
-
const [loaded, setLoaded] =
|
|
1941
|
-
const [ctx, setCtx] =
|
|
1942
|
-
const [mountTarget, setMountTarget] =
|
|
1943
|
-
const [stylesLoaded, setStylesLoaded] =
|
|
2048
|
+
const [loaded, setLoaded] = useState7(false);
|
|
2049
|
+
const [ctx, setCtx] = useState7({});
|
|
2050
|
+
const [mountTarget, setMountTarget] = useState7();
|
|
2051
|
+
const [stylesLoaded, setStylesLoaded] = useState7(false);
|
|
1944
2052
|
const handleStylesLoaded = useCallback3(() => {
|
|
1945
2053
|
setStylesLoaded(true);
|
|
1946
2054
|
}, []);
|
|
@@ -1996,7 +2104,7 @@ function AutoFrame({
|
|
|
1996
2104
|
AutoFrame.displayName = "AutoFrame";
|
|
1997
2105
|
var AutoFrame_default = AutoFrame;
|
|
1998
2106
|
|
|
1999
|
-
// css-module:/
|
|
2107
|
+
// css-module:/home/rasyiqi/PROJECT/Credbuild/credbuild/components/CredBuild/components/Preview/styles.module.css#css-module
|
|
2000
2108
|
var styles_module_default10 = { "CredBuildPreview": "_CredBuildPreview_17c6o_1", "CredBuildPreview-frame": "_CredBuildPreview-frame_17c6o_6", "CredBuildPreview-htmlEditor": "_CredBuildPreview-htmlEditor_17c6o_12", "CredBuildPreview-htmlTextarea": "_CredBuildPreview-htmlTextarea_17c6o_23" };
|
|
2001
2109
|
|
|
2002
2110
|
// lib/bubble-pointer-event.ts
|
|
@@ -2089,14 +2197,14 @@ var Preview = ({ id = "credbuild-preview" }) => {
|
|
|
2089
2197
|
},
|
|
2090
2198
|
[config]
|
|
2091
2199
|
);
|
|
2092
|
-
const Frame =
|
|
2200
|
+
const Frame = useMemo8(() => overrides.iframe, [overrides]);
|
|
2093
2201
|
const rootProps = root.props || root;
|
|
2094
2202
|
const isHtmlMode = rootProps?.mode === "html";
|
|
2095
2203
|
const htmlViewMode = rootProps?.htmlViewMode || (rootProps?.htmlCode ? "preview" : "code");
|
|
2096
2204
|
const htmlCode = rootProps?.htmlCode || "";
|
|
2097
2205
|
const ref = useRef3(null);
|
|
2098
2206
|
useBubbleIframeEvents(ref);
|
|
2099
|
-
const [localCode, setLocalCode] =
|
|
2207
|
+
const [localCode, setLocalCode] = useState8(htmlCode);
|
|
2100
2208
|
useEffect7(() => {
|
|
2101
2209
|
setLocalCode(htmlCode);
|
|
2102
2210
|
}, [htmlCode]);
|
|
@@ -2274,7 +2382,7 @@ var Preview = ({ id = "credbuild-preview" }) => {
|
|
|
2274
2382
|
};
|
|
2275
2383
|
|
|
2276
2384
|
// lib/use-loaded-overrides.ts
|
|
2277
|
-
import { useMemo as
|
|
2385
|
+
import { useMemo as useMemo9 } from "react";
|
|
2278
2386
|
|
|
2279
2387
|
// lib/load-overrides.ts
|
|
2280
2388
|
var loadOverrides = ({
|
|
@@ -2316,7 +2424,7 @@ var useLoadedOverrides = ({
|
|
|
2316
2424
|
overrides,
|
|
2317
2425
|
plugins
|
|
2318
2426
|
}) => {
|
|
2319
|
-
return
|
|
2427
|
+
return useMemo9(() => {
|
|
2320
2428
|
return loadOverrides({ overrides, plugins });
|
|
2321
2429
|
}, [plugins, overrides]);
|
|
2322
2430
|
};
|
|
@@ -2325,28 +2433,28 @@ var useLoadedOverrides = ({
|
|
|
2325
2433
|
import { deepEqual } from "fast-equals";
|
|
2326
2434
|
|
|
2327
2435
|
// components/CredBuild/components/Layout/index.tsx
|
|
2328
|
-
import { useEffect as useEffect14, useMemo as
|
|
2436
|
+
import { useEffect as useEffect14, useMemo as useMemo15, useState as useState15 } from "react";
|
|
2329
2437
|
|
|
2330
2438
|
// components/CredBuild/context.tsx
|
|
2331
2439
|
import {
|
|
2332
|
-
createContext as
|
|
2440
|
+
createContext as createContext4,
|
|
2333
2441
|
useContext as useContext5
|
|
2334
2442
|
} from "react";
|
|
2335
2443
|
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
2336
|
-
var propsContext =
|
|
2444
|
+
var propsContext = createContext4({});
|
|
2337
2445
|
function PropsProvider(props) {
|
|
2338
2446
|
return /* @__PURE__ */ jsx17(propsContext.Provider, { value: props, children: props.children });
|
|
2339
2447
|
}
|
|
2340
2448
|
var usePropsContext = () => useContext5(propsContext);
|
|
2341
2449
|
|
|
2342
|
-
// css-module:/
|
|
2450
|
+
// css-module:/home/rasyiqi/PROJECT/Credbuild/credbuild/components/CredBuild/components/Layout/styles.module.css#css-module
|
|
2343
2451
|
var styles_module_default11 = { "CredBuildLayout": "_CredBuildLayout_14aaz_1", "CredBuildLayout-inner": "_CredBuildLayout-inner_14aaz_8", "CredBuildLayout--leftSideBarVisible": "_CredBuildLayout--leftSideBarVisible_14aaz_29", "CredBuildLayout--rightSideBarVisible": "_CredBuildLayout--rightSideBarVisible_14aaz_33", "CredBuild--hidePlugins": "_CredBuild--hidePlugins_14aaz_37", "CredBuildLayout-item": "_CredBuildLayout-item_14aaz_43", "CredBuildLayout-header": "_CredBuildLayout-header_14aaz_49", "CredBuildLayout-left": "_CredBuildLayout-left_14aaz_54", "CredBuildLayout-editor": "_CredBuildLayout-editor_14aaz_67", "CredBuildLayout-right": "_CredBuildLayout-right_14aaz_75", "CredBuildLayout-sidebar": "_CredBuildLayout-sidebar_14aaz_92", "CredBuildPluginTab": "_CredBuildPluginTab_14aaz_107", "CredBuildPluginTab--visible": "_CredBuildPluginTab--visible_14aaz_114", "CredBuildPluginTab-body": "_CredBuildPluginTab-body_14aaz_118", "CredBuildLayout--mounted": "_CredBuildLayout--mounted_14aaz_134" };
|
|
2344
2452
|
|
|
2345
2453
|
// lib/use-inject-css.ts
|
|
2346
|
-
import { useEffect as useEffect8, useState as
|
|
2454
|
+
import { useEffect as useEffect8, useState as useState9 } from "react";
|
|
2347
2455
|
var styles = ``;
|
|
2348
2456
|
var useInjectStyleSheet = (initialStyles, iframeEnabled) => {
|
|
2349
|
-
const [el, setEl] =
|
|
2457
|
+
const [el, setEl] = useState9();
|
|
2350
2458
|
useEffect8(() => {
|
|
2351
2459
|
setEl(document.createElement("style"));
|
|
2352
2460
|
}, []);
|
|
@@ -2393,9 +2501,9 @@ import { DragDropProvider } from "@dnd-kit/react";
|
|
|
2393
2501
|
import {
|
|
2394
2502
|
useCallback as useCallback6,
|
|
2395
2503
|
useEffect as useEffect9,
|
|
2396
|
-
useMemo as
|
|
2504
|
+
useMemo as useMemo10,
|
|
2397
2505
|
useRef as useRef4,
|
|
2398
|
-
useState as
|
|
2506
|
+
useState as useState10
|
|
2399
2507
|
} from "react";
|
|
2400
2508
|
import { AutoScroller, defaultPreset } from "@dnd-kit/dom";
|
|
2401
2509
|
|
|
@@ -2750,7 +2858,7 @@ var DragDropContextClient = ({
|
|
|
2750
2858
|
const appStore = useAppStoreApi();
|
|
2751
2859
|
const debouncedParamsRef = useRef4(null);
|
|
2752
2860
|
const tempDisableFallback = useTempDisableFallback(100);
|
|
2753
|
-
const [zoneStore] =
|
|
2861
|
+
const [zoneStore] = useState10(() => {
|
|
2754
2862
|
const rootVirtualizers = /* @__PURE__ */ new Map();
|
|
2755
2863
|
return createStore2(() => ({
|
|
2756
2864
|
zoneDepthIndex: {},
|
|
@@ -2845,7 +2953,7 @@ var DragDropContextClient = ({
|
|
|
2845
2953
|
);
|
|
2846
2954
|
}
|
|
2847
2955
|
}, [zoneStore]);
|
|
2848
|
-
const [plugins] =
|
|
2956
|
+
const [plugins] = useState10(() => [
|
|
2849
2957
|
...disableAutoScroll ? defaultPreset.plugins.filter((plugin) => plugin !== AutoScroller) : defaultPreset.plugins,
|
|
2850
2958
|
createNestedDroppablePlugin(
|
|
2851
2959
|
{
|
|
@@ -2893,10 +3001,10 @@ var DragDropContextClient = ({
|
|
|
2893
3001
|
)
|
|
2894
3002
|
]);
|
|
2895
3003
|
const sensors = useSensors();
|
|
2896
|
-
const [dragListeners, setDragListeners] =
|
|
3004
|
+
const [dragListeners, setDragListeners] = useState10({});
|
|
2897
3005
|
const dragMode = useRef4(null);
|
|
2898
3006
|
const initialSelector = useRef4(void 0);
|
|
2899
|
-
const nextContextValue =
|
|
3007
|
+
const nextContextValue = useMemo10(
|
|
2900
3008
|
() => ({
|
|
2901
3009
|
mode: "edit",
|
|
2902
3010
|
areaId: "root",
|
|
@@ -3151,9 +3259,9 @@ var DragDropContext = ({
|
|
|
3151
3259
|
};
|
|
3152
3260
|
|
|
3153
3261
|
// components/CredBuild/components/Header/index.tsx
|
|
3154
|
-
import { memo as memo5, useCallback as useCallback7, useMemo as
|
|
3262
|
+
import { memo as memo5, useCallback as useCallback7, useMemo as useMemo13, useState as useState12 } from "react";
|
|
3155
3263
|
|
|
3156
|
-
// css-module:/
|
|
3264
|
+
// css-module:/home/rasyiqi/PROJECT/Credbuild/credbuild/components/MenuBar/styles.module.css#css-module
|
|
3157
3265
|
var styles_module_default12 = { "MenuBar": "_MenuBar_1m2ld_1", "MenuBar--menuOpen": "_MenuBar--menuOpen_1m2ld_14", "MenuBar-inner": "_MenuBar-inner_1m2ld_29", "MenuBar-history": "_MenuBar-history_1m2ld_45" };
|
|
3158
3266
|
|
|
3159
3267
|
// components/MenuBar/index.tsx
|
|
@@ -3211,9 +3319,9 @@ function MenuBar({
|
|
|
3211
3319
|
}
|
|
3212
3320
|
|
|
3213
3321
|
// components/ViewportControls/index.tsx
|
|
3214
|
-
import { useEffect as useEffect10, useMemo as
|
|
3322
|
+
import { useEffect as useEffect10, useMemo as useMemo11, useState as useState11 } from "react";
|
|
3215
3323
|
|
|
3216
|
-
// css-module:/
|
|
3324
|
+
// css-module:/home/rasyiqi/PROJECT/Credbuild/credbuild/components/ViewportControls/styles.module.css#css-module
|
|
3217
3325
|
var styles_module_default13 = { "ViewportControls": "_ViewportControls_gefvg_1", "ViewportControls--fullScreen": "_ViewportControls--fullScreen_gefvg_5", "ViewportControls-toggleButton": "_ViewportControls-toggleButton_gefvg_14", "ViewportControls--isExpanded": "_ViewportControls--isExpanded_gefvg_38", "ViewportControls-actions": "_ViewportControls-actions_gefvg_42", "ViewportControls-actionsInner": "_ViewportControls-actionsInner_gefvg_46", "ViewportControls-divider": "_ViewportControls-divider_gefvg_76", "ViewportControls-zoomSelect": "_ViewportControls-zoomSelect_gefvg_83", "ViewportControls-zoom": "_ViewportControls-zoom_gefvg_83", "ViewportButton-inner": "_ViewportButton-inner_gefvg_114", "ViewportButton--isActive": "_ViewportButton--isActive_gefvg_122" };
|
|
3218
3326
|
|
|
3219
3327
|
// components/ViewportControls/index.tsx
|
|
@@ -3266,7 +3374,7 @@ var ViewportControls = ({
|
|
|
3266
3374
|
const defaultsContainAutoZoom = defaultZoomOptions.find(
|
|
3267
3375
|
(option) => option.value === autoZoom
|
|
3268
3376
|
);
|
|
3269
|
-
const zoomOptions =
|
|
3377
|
+
const zoomOptions = useMemo11(() => {
|
|
3270
3378
|
const options = [
|
|
3271
3379
|
...defaultZoomOptions,
|
|
3272
3380
|
...defaultsContainAutoZoom || isNaN(autoZoom) ? [] : [
|
|
@@ -3278,13 +3386,13 @@ var ViewportControls = ({
|
|
|
3278
3386
|
].filter((a) => a.value <= (autoZoom || 1)).sort((a, b) => a.value > b.value ? 1 : -1);
|
|
3279
3387
|
return options.length > 0 ? options : defaultZoomOptions;
|
|
3280
3388
|
}, [autoZoom, defaultsContainAutoZoom]);
|
|
3281
|
-
const [activeViewport, setActiveViewport] =
|
|
3389
|
+
const [activeViewport, setActiveViewport] = useState11(
|
|
3282
3390
|
uiViewports.current.width
|
|
3283
3391
|
);
|
|
3284
3392
|
useEffect10(() => {
|
|
3285
3393
|
setActiveViewport(uiViewports.current.width);
|
|
3286
3394
|
}, [uiViewports.current.width, uiViewports]);
|
|
3287
|
-
const [isExpanded, setIsExpanded] =
|
|
3395
|
+
const [isExpanded, setIsExpanded] = useState11(false);
|
|
3288
3396
|
return /* @__PURE__ */ jsxs9(
|
|
3289
3397
|
"div",
|
|
3290
3398
|
{
|
|
@@ -3345,6 +3453,8 @@ var ViewportControls = ({
|
|
|
3345
3453
|
/* @__PURE__ */ jsx21(
|
|
3346
3454
|
"select",
|
|
3347
3455
|
{
|
|
3456
|
+
"aria-label": "Zoom level",
|
|
3457
|
+
title: "Zoom level",
|
|
3348
3458
|
className: getClassName13("zoomSelect"),
|
|
3349
3459
|
value: zoom.toString(),
|
|
3350
3460
|
onClick: (e) => {
|
|
@@ -3368,8 +3478,10 @@ var ViewportControls = ({
|
|
|
3368
3478
|
/* @__PURE__ */ jsx21(
|
|
3369
3479
|
"button",
|
|
3370
3480
|
{
|
|
3481
|
+
type: "button",
|
|
3371
3482
|
className: getClassName13("toggleButton"),
|
|
3372
3483
|
title: "Toggle viewport menu",
|
|
3484
|
+
"aria-label": "Toggle viewport menu",
|
|
3373
3485
|
"aria-expanded": isExpanded,
|
|
3374
3486
|
onClick: () => setIsExpanded((s) => !s),
|
|
3375
3487
|
children: isExpanded ? /* @__PURE__ */ jsx21(X, { size: 16 }) : /* @__PURE__ */ jsx21(Monitor, { size: 16 })
|
|
@@ -3385,18 +3497,18 @@ import { useShallow as useShallow3 } from "zustand/react/shallow";
|
|
|
3385
3497
|
|
|
3386
3498
|
// lib/frame-context.tsx
|
|
3387
3499
|
import {
|
|
3388
|
-
createContext as
|
|
3500
|
+
createContext as createContext6,
|
|
3389
3501
|
useContext as useContext7,
|
|
3390
3502
|
useRef as useRef5,
|
|
3391
|
-
useMemo as
|
|
3503
|
+
useMemo as useMemo12
|
|
3392
3504
|
} from "react";
|
|
3393
3505
|
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
3394
|
-
var FrameContext =
|
|
3506
|
+
var FrameContext = createContext6(null);
|
|
3395
3507
|
var FrameProvider = ({
|
|
3396
3508
|
children
|
|
3397
3509
|
}) => {
|
|
3398
3510
|
const frameRef = useRef5(null);
|
|
3399
|
-
const value =
|
|
3511
|
+
const value = useMemo12(
|
|
3400
3512
|
() => ({
|
|
3401
3513
|
frameRef
|
|
3402
3514
|
}),
|
|
@@ -3412,7 +3524,7 @@ var useCanvasFrame = () => {
|
|
|
3412
3524
|
return context;
|
|
3413
3525
|
};
|
|
3414
3526
|
|
|
3415
|
-
// css-module:/
|
|
3527
|
+
// css-module:/home/rasyiqi/PROJECT/Credbuild/credbuild/components/CredBuild/components/Header/styles.module.css#css-module
|
|
3416
3528
|
var styles_module_default14 = { "CredBuildHeader": "_CredBuildHeader_qzv5u_1", "CredBuildHeader-inner": "_CredBuildHeader-inner_qzv5u_20", "CredBuildHeader-viewportTools": "_CredBuildHeader-viewportTools_qzv5u_28", "CredBuildHeader-leftActions": "_CredBuildHeader-leftActions_qzv5u_35", "CredBuildHeader-toggle": "_CredBuildHeader-toggle_qzv5u_41", "CredBuildHeader-leftSideBarToggle": "_CredBuildHeader-leftSideBarToggle_qzv5u_47", "CredBuildHeader-rightSideBarToggle": "_CredBuildHeader-rightSideBarToggle_qzv5u_48", "CredBuildHeader-title": "_CredBuildHeader-title_qzv5u_52", "CredBuildHeader-path": "_CredBuildHeader-path_qzv5u_57", "CredBuildHeader-tools": "_CredBuildHeader-tools_qzv5u_68", "CredBuildHeader-menuButton": "_CredBuildHeader-menuButton_qzv5u_75" };
|
|
3417
3529
|
|
|
3418
3530
|
// components/CredBuild/components/Header/index.tsx
|
|
@@ -3432,7 +3544,7 @@ var HeaderInner = ({
|
|
|
3432
3544
|
} = usePropsContext();
|
|
3433
3545
|
const dispatch = useAppStore((s) => s.dispatch);
|
|
3434
3546
|
const appStore = useAppStoreApi();
|
|
3435
|
-
const defaultHeaderRender =
|
|
3547
|
+
const defaultHeaderRender = useMemo13(() => {
|
|
3436
3548
|
if (renderHeader) {
|
|
3437
3549
|
console.warn(
|
|
3438
3550
|
"`renderHeader` is deprecated. Please use `overrides.header` and the `useCredBuild` hook instead"
|
|
@@ -3446,7 +3558,7 @@ var HeaderInner = ({
|
|
|
3446
3558
|
}
|
|
3447
3559
|
return DefaultOverride;
|
|
3448
3560
|
}, [renderHeader, dispatch]);
|
|
3449
|
-
const defaultHeaderActionsRender =
|
|
3561
|
+
const defaultHeaderActionsRender = useMemo13(() => {
|
|
3450
3562
|
if (renderHeaderActions) {
|
|
3451
3563
|
console.warn(
|
|
3452
3564
|
"`renderHeaderActions` is deprecated. Please use `overrides.headerActions` and the `useCredBuild` hook instead."
|
|
@@ -3466,7 +3578,7 @@ var HeaderInner = ({
|
|
|
3466
3578
|
const CustomHeaderActions = useAppStore(
|
|
3467
3579
|
(s) => s.overrides.headerActions || defaultHeaderActionsRender
|
|
3468
3580
|
);
|
|
3469
|
-
const [menuOpen, setMenuOpen] =
|
|
3581
|
+
const [menuOpen, setMenuOpen] = useState12(false);
|
|
3470
3582
|
const rootTitle = useAppStore((s) => {
|
|
3471
3583
|
const rootData = s.state.indexes.nodes["root"]?.data;
|
|
3472
3584
|
return rootData.props.title ?? "";
|
|
@@ -3665,6 +3777,7 @@ var HeaderInner = ({
|
|
|
3665
3777
|
{
|
|
3666
3778
|
type: "button",
|
|
3667
3779
|
onClick: () => handleSetViewMode("code"),
|
|
3780
|
+
"aria-pressed": htmlViewMode === "code",
|
|
3668
3781
|
style: {
|
|
3669
3782
|
display: "flex",
|
|
3670
3783
|
alignItems: "center",
|
|
@@ -3692,6 +3805,7 @@ var HeaderInner = ({
|
|
|
3692
3805
|
{
|
|
3693
3806
|
type: "button",
|
|
3694
3807
|
onClick: () => handleSetViewMode("preview"),
|
|
3808
|
+
"aria-pressed": htmlViewMode === "preview",
|
|
3695
3809
|
style: {
|
|
3696
3810
|
display: "flex",
|
|
3697
3811
|
alignItems: "center",
|
|
@@ -3809,7 +3923,7 @@ var HeaderInner = ({
|
|
|
3809
3923
|
};
|
|
3810
3924
|
var Header = memo5(HeaderInner);
|
|
3811
3925
|
|
|
3812
|
-
// css-module:/
|
|
3926
|
+
// css-module:/home/rasyiqi/PROJECT/Credbuild/credbuild/components/SidebarSection/styles.module.css#css-module
|
|
3813
3927
|
var styles_module_default15 = { "SidebarSection": "_SidebarSection_bv89x_1", "SidebarSection-title": "_SidebarSection-title_bv89x_12", "SidebarSection--noBorderTop": "_SidebarSection--noBorderTop_bv89x_37", "SidebarSection-content": "_SidebarSection-content_bv89x_41", "SidebarSection-breadcrumbLabel": "_SidebarSection-breadcrumbLabel_bv89x_50", "SidebarSection-breadcrumbs": "_SidebarSection-breadcrumbs_bv89x_79", "SidebarSection-breadcrumb": "_SidebarSection-breadcrumb_bv89x_50", "SidebarSection-heading": "_SidebarSection-heading_bv89x_91", "SidebarSection-loadingOverlay": "_SidebarSection-loadingOverlay_bv89x_95" };
|
|
3814
3928
|
|
|
3815
3929
|
// components/SidebarSection/index.tsx
|
|
@@ -3837,12 +3951,12 @@ var SidebarSection = ({
|
|
|
3837
3951
|
import {
|
|
3838
3952
|
useCallback as useCallback8,
|
|
3839
3953
|
useEffect as useEffect11,
|
|
3840
|
-
useMemo as
|
|
3954
|
+
useMemo as useMemo14,
|
|
3841
3955
|
useRef as useRef6,
|
|
3842
|
-
useState as
|
|
3956
|
+
useState as useState13
|
|
3843
3957
|
} from "react";
|
|
3844
3958
|
|
|
3845
|
-
// css-module:/
|
|
3959
|
+
// css-module:/home/rasyiqi/PROJECT/Credbuild/credbuild/components/CredBuild/components/Canvas/styles.module.css#css-module
|
|
3846
3960
|
var styles_module_default16 = { "CredBuildCanvas": "_CredBuildCanvas_1ivia_1", "CredBuildCanvas--fullScreen": "_CredBuildCanvas--fullScreen_1ivia_22", "CredBuildCanvas-inner": "_CredBuildCanvas-inner_1ivia_33", "CredBuildCanvas-root": "_CredBuildCanvas-root_1ivia_42", "CredBuildCanvas--ready": "_CredBuildCanvas--ready_1ivia_67", "CredBuildCanvas-loader": "_CredBuildCanvas-loader_1ivia_72", "CredBuildCanvas--showLoader": "_CredBuildCanvas--showLoader_1ivia_82" };
|
|
3847
3961
|
|
|
3848
3962
|
// components/CredBuild/components/Canvas/index.tsx
|
|
@@ -3899,13 +4013,13 @@ var Canvas = () => {
|
|
|
3899
4013
|
const isHtmlCodeEditActive = isHtmlMode && htmlViewMode === "code";
|
|
3900
4014
|
const isNonFullWidth = viewports.current.width !== "100%";
|
|
3901
4015
|
const shouldApplyViewport = true;
|
|
3902
|
-
const [showTransition, setShowTransition] =
|
|
4016
|
+
const [showTransition, setShowTransition] = useState13(false);
|
|
3903
4017
|
const isResizingRef = useRef6(false);
|
|
3904
|
-
const defaultRender =
|
|
4018
|
+
const defaultRender = useMemo14(() => {
|
|
3905
4019
|
const CredBuildDefault = ({ children }) => /* @__PURE__ */ jsx25(Fragment9, { children });
|
|
3906
4020
|
return CredBuildDefault;
|
|
3907
4021
|
}, []);
|
|
3908
|
-
const CustomPreview =
|
|
4022
|
+
const CustomPreview = useMemo14(
|
|
3909
4023
|
() => overrides.preview || defaultRender,
|
|
3910
4024
|
[overrides, defaultRender]
|
|
3911
4025
|
);
|
|
@@ -4013,7 +4127,7 @@ var Canvas = () => {
|
|
|
4013
4127
|
resizeObserver.disconnect();
|
|
4014
4128
|
};
|
|
4015
4129
|
}, [frameRef, resetAutoZoom]);
|
|
4016
|
-
const [showLoader, setShowLoader] =
|
|
4130
|
+
const [showLoader, setShowLoader] = useState13(false);
|
|
4017
4131
|
useEffect11(() => {
|
|
4018
4132
|
setTimeout(() => {
|
|
4019
4133
|
setShowLoader(true);
|
|
@@ -4133,9 +4247,9 @@ var Canvas = () => {
|
|
|
4133
4247
|
};
|
|
4134
4248
|
|
|
4135
4249
|
// lib/use-sidebar-resize.ts
|
|
4136
|
-
import { useCallback as useCallback9, useEffect as useEffect12, useRef as useRef7, useState as
|
|
4250
|
+
import { useCallback as useCallback9, useEffect as useEffect12, useRef as useRef7, useState as useState14 } from "react";
|
|
4137
4251
|
function useSidebarResize(position, dispatch) {
|
|
4138
|
-
const [width, setWidth] =
|
|
4252
|
+
const [width, setWidth] = useState14(null);
|
|
4139
4253
|
const sidebarRef = useRef7(null);
|
|
4140
4254
|
const storeWidth = useAppStore(
|
|
4141
4255
|
(s) => position === "left" ? s.state.ui.leftSideBarWidth : s.state.ui.rightSideBarWidth
|
|
@@ -4216,7 +4330,7 @@ function useSidebarResize(position, dispatch) {
|
|
|
4216
4330
|
// components/CredBuild/components/ResizeHandle/index.tsx
|
|
4217
4331
|
import { useCallback as useCallback10, useRef as useRef8 } from "react";
|
|
4218
4332
|
|
|
4219
|
-
// css-module:/
|
|
4333
|
+
// css-module:/home/rasyiqi/PROJECT/Credbuild/credbuild/components/CredBuild/components/ResizeHandle/styles.module.css#css-module
|
|
4220
4334
|
var styles_module_default17 = { "ResizeHandle": "_ResizeHandle_144bf_2", "ResizeHandle--left": "_ResizeHandle--left_144bf_16", "ResizeHandle--right": "_ResizeHandle--right_144bf_20" };
|
|
4221
4335
|
|
|
4222
4336
|
// components/CredBuild/components/ResizeHandle/index.tsx
|
|
@@ -4287,7 +4401,7 @@ var ResizeHandle = ({
|
|
|
4287
4401
|
);
|
|
4288
4402
|
};
|
|
4289
4403
|
|
|
4290
|
-
// css-module:/
|
|
4404
|
+
// css-module:/home/rasyiqi/PROJECT/Credbuild/credbuild/components/CredBuild/components/Sidebar/styles.module.css#css-module
|
|
4291
4405
|
var styles_module_default18 = { "Sidebar": "_Sidebar_1kcif_1", "Sidebar--isVisible": "_Sidebar--isVisible_1kcif_13", "Sidebar--left": "_Sidebar--left_1kcif_17", "Sidebar--right": "_Sidebar--right_1kcif_29", "Sidebar-resizeHandle": "_Sidebar-resizeHandle_1kcif_42" };
|
|
4292
4406
|
|
|
4293
4407
|
// components/CredBuild/components/Sidebar/index.tsx
|
|
@@ -4380,7 +4494,7 @@ var useDeleteHotkeys = () => {
|
|
|
4380
4494
|
useHotkey({ backspace: true }, deleteSelectedComponent);
|
|
4381
4495
|
};
|
|
4382
4496
|
|
|
4383
|
-
// css-module:/
|
|
4497
|
+
// css-module:/home/rasyiqi/PROJECT/Credbuild/credbuild/components/CredBuild/components/Nav/styles.module.css#css-module
|
|
4384
4498
|
var styles_module_default19 = { "Nav": "_Nav_wbh7e_1", "Nav-list": "_Nav-list_wbh7e_9", "CredBuildHeader-path": "_CredBuildHeader-path_wbh7e_20", "NavItem": "_NavItem_wbh7e_38", "NavItem-link": "_NavItem-link_wbh7e_43", "NavItem-linkIcon": "_NavItem-linkIcon_wbh7e_64", "NavItem--active": "_NavItem--active_wbh7e_77", "NavItem--mobileOnly": "_NavItem--mobileOnly_wbh7e_90", "NavItem--desktopOnly": "_NavItem--desktopOnly_wbh7e_95" };
|
|
4385
4499
|
|
|
4386
4500
|
// components/CredBuild/components/Nav/index.tsx
|
|
@@ -4443,7 +4557,7 @@ var Layout = ({ children }) => {
|
|
|
4443
4557
|
plugins,
|
|
4444
4558
|
height
|
|
4445
4559
|
} = usePropsContext();
|
|
4446
|
-
const iframe =
|
|
4560
|
+
const iframe = useMemo15(
|
|
4447
4561
|
() => ({
|
|
4448
4562
|
enabled: true,
|
|
4449
4563
|
waitForStyles: true,
|
|
@@ -4497,12 +4611,12 @@ var Layout = ({ children }) => {
|
|
|
4497
4611
|
};
|
|
4498
4612
|
}, [dispatch]);
|
|
4499
4613
|
const overrides = useAppStore((s) => s.overrides);
|
|
4500
|
-
const CustomCredBuild =
|
|
4614
|
+
const CustomCredBuild = useMemo15(
|
|
4501
4615
|
() => overrides.credbuild || DefaultOverride,
|
|
4502
4616
|
[overrides]
|
|
4503
4617
|
);
|
|
4504
|
-
const [mounted, setMounted] =
|
|
4505
|
-
const [theme, setTheme] =
|
|
4618
|
+
const [mounted, setMounted] = useState15(false);
|
|
4619
|
+
const [theme, setTheme] = useState15("dark");
|
|
4506
4620
|
useEffect14(() => {
|
|
4507
4621
|
setMounted(true);
|
|
4508
4622
|
const savedTheme = localStorage.getItem("credbuild-theme");
|
|
@@ -4542,12 +4656,12 @@ var Layout = ({ children }) => {
|
|
|
4542
4656
|
const setUi = useAppStore((s) => s.setUi);
|
|
4543
4657
|
const currentPlugin = useAppStore((s) => s.state.ui.plugin?.current);
|
|
4544
4658
|
const appStoreApi = useAppStoreApi();
|
|
4545
|
-
const [mobilePanelHeightMode, setMobilePanelHeightMode] =
|
|
4546
|
-
const hasLegacySideBarPlugin =
|
|
4659
|
+
const [mobilePanelHeightMode, setMobilePanelHeightMode] = useState15("toggle");
|
|
4660
|
+
const hasLegacySideBarPlugin = useMemo15(
|
|
4547
4661
|
() => !!plugins?.find((p) => p.name === "legacy-side-bar"),
|
|
4548
4662
|
[plugins]
|
|
4549
4663
|
);
|
|
4550
|
-
const pluginItems =
|
|
4664
|
+
const pluginItems = useMemo15(() => {
|
|
4551
4665
|
const details = {};
|
|
4552
4666
|
const defaultPlugins = [
|
|
4553
4667
|
blocksPlugin(),
|
|
@@ -4720,7 +4834,7 @@ function CredBuildProvider({ children }) {
|
|
|
4720
4834
|
_experimentalFullScreenCanvas,
|
|
4721
4835
|
_experimentalVirtualization
|
|
4722
4836
|
} = usePropsContext();
|
|
4723
|
-
const iframe =
|
|
4837
|
+
const iframe = useMemo16(
|
|
4724
4838
|
() => ({
|
|
4725
4839
|
enabled: true,
|
|
4726
4840
|
waitForStyles: true,
|
|
@@ -4728,7 +4842,7 @@ function CredBuildProvider({ children }) {
|
|
|
4728
4842
|
}),
|
|
4729
4843
|
[_iframe]
|
|
4730
4844
|
);
|
|
4731
|
-
const [generatedAppState] =
|
|
4845
|
+
const [generatedAppState] = useState16(() => {
|
|
4732
4846
|
const initial = { ...defaultAppState.ui, ...initialUi };
|
|
4733
4847
|
let clientUiState = {};
|
|
4734
4848
|
if (Object.keys(initialData?.root || {}).length > 0 && !initialData?.root?.props) {
|
|
@@ -4775,7 +4889,7 @@ function CredBuildProvider({ children }) {
|
|
|
4775
4889
|
return walkAppState(newAppState, config);
|
|
4776
4890
|
});
|
|
4777
4891
|
const { appendData = true } = _initialHistory || {};
|
|
4778
|
-
const [blendedHistories] =
|
|
4892
|
+
const [blendedHistories] = useState16(
|
|
4779
4893
|
[
|
|
4780
4894
|
..._initialHistory?.histories || [],
|
|
4781
4895
|
...appendData ? [{ state: generatedAppState }] : []
|
|
@@ -4790,7 +4904,7 @@ function CredBuildProvider({ children }) {
|
|
|
4790
4904
|
};
|
|
4791
4905
|
})
|
|
4792
4906
|
);
|
|
4793
|
-
const initialHistoryIndex =
|
|
4907
|
+
const initialHistoryIndex = useMemo16(() => {
|
|
4794
4908
|
if (_initialHistory?.index !== void 0 && _initialHistory?.index >= 0 && _initialHistory?.index < blendedHistories.length) {
|
|
4795
4909
|
return _initialHistory?.index;
|
|
4796
4910
|
}
|
|
@@ -4801,7 +4915,7 @@ function CredBuildProvider({ children }) {
|
|
|
4801
4915
|
overrides,
|
|
4802
4916
|
plugins
|
|
4803
4917
|
});
|
|
4804
|
-
const loadedFieldTransforms =
|
|
4918
|
+
const loadedFieldTransforms = useMemo16(() => {
|
|
4805
4919
|
const _plugins = plugins || [];
|
|
4806
4920
|
const pluginFieldTransforms = _plugins.reduce(
|
|
4807
4921
|
(acc, plugin) => ({ ...acc, ...plugin.fieldTransforms }),
|
|
@@ -4844,7 +4958,7 @@ function CredBuildProvider({ children }) {
|
|
|
4844
4958
|
loadedFieldTransforms
|
|
4845
4959
|
]
|
|
4846
4960
|
);
|
|
4847
|
-
const [appStore] =
|
|
4961
|
+
const [appStore] = useState16(
|
|
4848
4962
|
() => createAppStore(generateAppStore(initialAppState))
|
|
4849
4963
|
);
|
|
4850
4964
|
useEffect15(() => {
|