@crediblemark/build 0.24.5 → 0.24.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ArrayField-2QLVE7PT.mjs +19 -0
- package/dist/{ArrayField-ZD5UTLNU.css → ArrayField-LGEHKPX7.css} +50 -33
- package/dist/{Editor-HOZVZZIZ.mjs → Editor-3EPLDK4J.mjs} +7 -7
- package/dist/{ObjectField-SQKROKJM.css → ObjectField-XRKCCMPB.css} +50 -33
- package/dist/ObjectField-XXOU2VP4.mjs +19 -0
- package/dist/{chunk-VBNE6GK2.mjs → chunk-5JSNFZKX.mjs} +7 -7
- package/dist/{chunk-5VWWS4RS.mjs → chunk-AMHAYK37.mjs} +736 -372
- package/dist/{chunk-WKMRHPOM.mjs → chunk-KUWVOWUV.mjs} +1 -1
- package/dist/{chunk-LBMMY5IM.mjs → chunk-MFTVX2ME.mjs} +1 -1
- package/dist/{ArrayField-F7OLZF6U.mjs → chunk-QBCQ7LDT.mjs} +364 -45
- package/dist/chunk-TE6MUUVZ.mjs +92 -0
- package/dist/{chunk-5OK3IPVN.mjs → chunk-VE6BIQKS.mjs} +1 -1
- package/dist/{chunk-H2LU4EW3.mjs → chunk-WDTSUNWU.mjs} +209 -156
- package/dist/{chunk-2VS2BST6.mjs → chunk-WH3A7FAR.mjs} +1 -1
- package/dist/{chunk-GIUKL443.mjs → chunk-XLNVCM4Q.mjs} +30 -30
- package/dist/{chunk-6RPYD5IO.mjs → chunk-YE4FXNJW.mjs} +2 -2
- package/dist/{full-65U7W6EN.mjs → full-SYDEKGLJ.mjs} +5 -5
- package/dist/index.css +50 -33
- package/dist/index.d.mts +37 -1
- package/dist/index.d.ts +37 -1
- package/dist/index.js +1095 -696
- package/dist/index.mjs +17 -10
- package/dist/{loaded-3NNC6Q35.mjs → loaded-5JH76RZT.mjs} +2 -2
- package/dist/{loaded-2CPFB62H.mjs → loaded-NHGZU7V3.mjs} +2 -2
- package/dist/{loaded-GYA4OMNE.mjs → loaded-ON5OAY2P.mjs} +2 -2
- package/dist/no-external.css +50 -33
- package/dist/no-external.d.mts +1 -1
- package/dist/no-external.d.ts +1 -1
- package/dist/no-external.js +1095 -696
- package/dist/no-external.mjs +17 -10
- package/package.json +1 -1
- package/dist/ObjectField-4SN4ZYFF.mjs +0 -87
- package/dist/chunk-BQW2NTNG.mjs +0 -339
- package/dist/chunk-IRJS3HWQ.mjs +0 -60
package/dist/no-external.js
CHANGED
|
@@ -159,7 +159,7 @@ var init_styles_module2 = __esm({
|
|
|
159
159
|
"use strict";
|
|
160
160
|
init_react_import();
|
|
161
161
|
init_css_module_data2();
|
|
162
|
-
styles_module_default2 = { "InputWrapper": "
|
|
162
|
+
styles_module_default2 = { "InputWrapper": "_InputWrapper_1mz7o_1", "Input-label": "_Input-label_1mz7o_5", "Input-label--noChildren": "_Input-label--noChildren_1mz7o_14", "Input-labelIcon": "_Input-labelIcon_1mz7o_18", "Input-disabledIcon": "_Input-disabledIcon_1mz7o_25", "Input-input": "_Input-input_1mz7o_30", "Input": "_Input_1mz7o_1", "Input--readOnly": "_Input--readOnly_1mz7o_86", "Input-radioGroupItems": "_Input-radioGroupItems_1mz7o_97", "Input-radio": "_Input-radio_1mz7o_97", "Input-radioInner": "_Input-radioInner_1mz7o_114", "Input-radioInput": "_Input-radioInput_1mz7o_159" };
|
|
163
163
|
}
|
|
164
164
|
});
|
|
165
165
|
|
|
@@ -3860,7 +3860,7 @@ var init_FieldLabel = __esm({
|
|
|
3860
3860
|
}) => {
|
|
3861
3861
|
const El = el;
|
|
3862
3862
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(El, { className, children: [
|
|
3863
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: getClassName2("label")
|
|
3863
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: `${getClassName2("label")} ${!children ? styles_module_default2["Input-label--noChildren"] : ""}`, children: [
|
|
3864
3864
|
icon ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: getClassName2("labelIcon"), children: icon }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, {}),
|
|
3865
3865
|
label,
|
|
3866
3866
|
readOnly && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: getClassName2("disabledIcon"), title: "Read-only", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Lock, { size: "12" }) })
|
|
@@ -7999,7 +7999,7 @@ var init_styles_module13 = __esm({
|
|
|
7999
7999
|
"use strict";
|
|
8000
8000
|
init_react_import();
|
|
8001
8001
|
init_css_module_data15();
|
|
8002
|
-
styles_module_default13 = { "ObjectField": "
|
|
8002
|
+
styles_module_default13 = { "ObjectField": "_ObjectField_1vrf5_1", "ObjectField--isOpen": "_ObjectField--isOpen_1vrf5_12", "ObjectField-content": "_ObjectField-content_1vrf5_17", "ObjectField-fieldset": "_ObjectField-fieldset_1vrf5_22" };
|
|
8003
8003
|
}
|
|
8004
8004
|
});
|
|
8005
8005
|
|
|
@@ -8008,7 +8008,7 @@ var ObjectField_exports = {};
|
|
|
8008
8008
|
__export(ObjectField_exports, {
|
|
8009
8009
|
ObjectField: () => ObjectField
|
|
8010
8010
|
});
|
|
8011
|
-
var import_jsx_runtime53, getClassName19, ObjectField;
|
|
8011
|
+
var import_react49, import_jsx_runtime53, getClassName19, ObjectField;
|
|
8012
8012
|
var init_ObjectField = __esm({
|
|
8013
8013
|
"components/AutoField/fields/ObjectField/index.tsx"() {
|
|
8014
8014
|
"use strict";
|
|
@@ -8021,6 +8021,7 @@ var init_ObjectField = __esm({
|
|
|
8021
8021
|
init_get_deep();
|
|
8022
8022
|
init_subfield();
|
|
8023
8023
|
init_store();
|
|
8024
|
+
import_react49 = require("react");
|
|
8024
8025
|
import_jsx_runtime53 = require("react/jsx-runtime");
|
|
8025
8026
|
getClassName19 = get_class_name_factory_default("ObjectField", styles_module_default13);
|
|
8026
8027
|
ObjectField = ({
|
|
@@ -8034,6 +8035,7 @@ var init_ObjectField = __esm({
|
|
|
8034
8035
|
readOnly
|
|
8035
8036
|
}) => {
|
|
8036
8037
|
const { localName = name } = useNestedFieldContext();
|
|
8038
|
+
const [isOpen, setIsOpen] = (0, import_react49.useState)(false);
|
|
8037
8039
|
const fieldStore = useFieldStoreApi();
|
|
8038
8040
|
const canEdit = useAppStore(
|
|
8039
8041
|
(s) => s.permissions.getPermissions({ item: s.selectedItem }).edit
|
|
@@ -8042,38 +8044,50 @@ var init_ObjectField = __esm({
|
|
|
8042
8044
|
if (field.type !== "object" || !field.objectFields) {
|
|
8043
8045
|
return null;
|
|
8044
8046
|
}
|
|
8045
|
-
return /* @__PURE__ */ (0, import_jsx_runtime53.
|
|
8046
|
-
|
|
8047
|
-
|
|
8048
|
-
|
|
8049
|
-
|
|
8050
|
-
|
|
8051
|
-
|
|
8052
|
-
|
|
8053
|
-
const subField = field.objectFields[subName];
|
|
8054
|
-
const subPath = `${localName}.${subName}`;
|
|
8055
|
-
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
8056
|
-
SubField,
|
|
8047
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: getClassName19({ isOpen }), children: [
|
|
8048
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
8049
|
+
"div",
|
|
8050
|
+
{
|
|
8051
|
+
onClick: () => setIsOpen(!isOpen),
|
|
8052
|
+
style: { cursor: "pointer" },
|
|
8053
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
8054
|
+
Label2,
|
|
8057
8055
|
{
|
|
8058
|
-
|
|
8059
|
-
|
|
8060
|
-
|
|
8061
|
-
|
|
8062
|
-
|
|
8063
|
-
|
|
8064
|
-
|
|
8065
|
-
|
|
8066
|
-
|
|
8067
|
-
|
|
8068
|
-
|
|
8069
|
-
|
|
8056
|
+
label: label || name,
|
|
8057
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [
|
|
8058
|
+
isOpen ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ChevronDown, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ChevronRight, { size: 14 }),
|
|
8059
|
+
labelIcon || /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(EllipsisVertical, { size: 16 })
|
|
8060
|
+
] }),
|
|
8061
|
+
el: "div",
|
|
8062
|
+
readOnly
|
|
8063
|
+
}
|
|
8064
|
+
)
|
|
8065
|
+
}
|
|
8066
|
+
),
|
|
8067
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: getClassName19("content"), children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("fieldset", { className: getClassName19("fieldset"), children: Object.keys(field.objectFields).map((subName) => {
|
|
8068
|
+
const subField = field.objectFields[subName];
|
|
8069
|
+
const subPath = `${localName}.${subName}`;
|
|
8070
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
8071
|
+
SubField,
|
|
8072
|
+
{
|
|
8073
|
+
id: `${id}_${subName}`,
|
|
8074
|
+
name,
|
|
8075
|
+
subName,
|
|
8076
|
+
localName,
|
|
8077
|
+
field: subField,
|
|
8078
|
+
forceReadOnly: !canEdit,
|
|
8079
|
+
onChange: (subValue, ui, subName2) => {
|
|
8080
|
+
const value = getValue();
|
|
8081
|
+
if (value[subName2] === subValue) {
|
|
8082
|
+
return;
|
|
8070
8083
|
}
|
|
8071
|
-
|
|
8072
|
-
|
|
8073
|
-
|
|
8074
|
-
|
|
8075
|
-
|
|
8076
|
-
|
|
8084
|
+
onChange({ ...value, [subName2]: subValue }, ui);
|
|
8085
|
+
}
|
|
8086
|
+
},
|
|
8087
|
+
subPath
|
|
8088
|
+
);
|
|
8089
|
+
}) }) })
|
|
8090
|
+
] });
|
|
8077
8091
|
};
|
|
8078
8092
|
}
|
|
8079
8093
|
});
|
|
@@ -8083,14 +8097,14 @@ function AutoFieldInternal(props) {
|
|
|
8083
8097
|
const dispatch = useAppStore((s) => s.dispatch);
|
|
8084
8098
|
const overrides = useAppStore((s) => s.overrides);
|
|
8085
8099
|
const readOnly = useAppStore((0, import_shallow3.useShallow)((s) => s.selectedItem?.readOnly));
|
|
8086
|
-
const nestedFieldContext = (0,
|
|
8100
|
+
const nestedFieldContext = (0, import_react50.useContext)(NestedFieldContext);
|
|
8087
8101
|
const { id, Label: Label2 = FieldLabelInternal } = props;
|
|
8088
8102
|
const field = props.field;
|
|
8089
8103
|
const label = field.label;
|
|
8090
8104
|
const labelIcon = field.labelIcon;
|
|
8091
8105
|
const defaultId = useSafeId();
|
|
8092
8106
|
const resolvedId = id || defaultId;
|
|
8093
|
-
const render = (0,
|
|
8107
|
+
const render = (0, import_react50.useMemo)(
|
|
8094
8108
|
() => ({
|
|
8095
8109
|
...overrides.fieldTypes,
|
|
8096
8110
|
custom: overrides.fieldTypes?.custom,
|
|
@@ -8111,7 +8125,7 @@ function AutoFieldInternal(props) {
|
|
|
8111
8125
|
return getDeep(s, props.name ?? resolvedId);
|
|
8112
8126
|
}
|
|
8113
8127
|
});
|
|
8114
|
-
const mergedProps = (0,
|
|
8128
|
+
const mergedProps = (0, import_react50.useMemo)(
|
|
8115
8129
|
() => ({
|
|
8116
8130
|
...props,
|
|
8117
8131
|
field,
|
|
@@ -8123,7 +8137,7 @@ function AutoFieldInternal(props) {
|
|
|
8123
8137
|
}),
|
|
8124
8138
|
[props, field, label, labelIcon, Label2, resolvedId, fieldValue]
|
|
8125
8139
|
);
|
|
8126
|
-
const onFocus = (0,
|
|
8140
|
+
const onFocus = (0, import_react50.useCallback)(
|
|
8127
8141
|
(e) => {
|
|
8128
8142
|
if (mergedProps.name && (e.target.nodeName === "INPUT" || e.target.nodeName === "TEXTAREA")) {
|
|
8129
8143
|
e.stopPropagation();
|
|
@@ -8137,7 +8151,7 @@ function AutoFieldInternal(props) {
|
|
|
8137
8151
|
},
|
|
8138
8152
|
[dispatch, mergedProps.name]
|
|
8139
8153
|
);
|
|
8140
|
-
const onBlur = (0,
|
|
8154
|
+
const onBlur = (0, import_react50.useCallback)((e) => {
|
|
8141
8155
|
if ("name" in e.target) {
|
|
8142
8156
|
dispatch({
|
|
8143
8157
|
type: "setUi",
|
|
@@ -8147,7 +8161,7 @@ function AutoFieldInternal(props) {
|
|
|
8147
8161
|
});
|
|
8148
8162
|
}
|
|
8149
8163
|
}, [dispatch]);
|
|
8150
|
-
let Children = (0,
|
|
8164
|
+
let Children = (0, import_react50.useMemo)(() => {
|
|
8151
8165
|
if (field.type !== "custom" && field.type !== "slot") {
|
|
8152
8166
|
return defaultFields[field.type];
|
|
8153
8167
|
}
|
|
@@ -8155,7 +8169,7 @@ function AutoFieldInternal(props) {
|
|
|
8155
8169
|
}, [field.type]);
|
|
8156
8170
|
const fieldKey = field.type === "custom" ? field.key : void 0;
|
|
8157
8171
|
const fieldRender = field.render;
|
|
8158
|
-
let FieldComponent = (0,
|
|
8172
|
+
let FieldComponent = (0, import_react50.useMemo)(() => {
|
|
8159
8173
|
if (field.type === "custom" && !render[field.type]) {
|
|
8160
8174
|
if (!fieldRender) {
|
|
8161
8175
|
return null;
|
|
@@ -8191,7 +8205,7 @@ function AutoFieldInternal(props) {
|
|
|
8191
8205
|
onClick: (e) => {
|
|
8192
8206
|
e.stopPropagation();
|
|
8193
8207
|
},
|
|
8194
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
8208
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_react50.Suspense, { fallback: null, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(FieldComponent, { ...mergedProps, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Children, { ...mergedProps }) }) })
|
|
8195
8209
|
}
|
|
8196
8210
|
)
|
|
8197
8211
|
}
|
|
@@ -8200,19 +8214,19 @@ function AutoFieldInternal(props) {
|
|
|
8200
8214
|
function AutoFieldPrivate2(props) {
|
|
8201
8215
|
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(AutoFieldInternal, { ...props });
|
|
8202
8216
|
}
|
|
8203
|
-
var
|
|
8217
|
+
var import_react50, import_shallow3, import_react51, import_jsx_runtime54, ArrayField2, ObjectField2, getClassNameWrapper, defaultFields;
|
|
8204
8218
|
var init_AutoFieldInternal = __esm({
|
|
8205
8219
|
"components/AutoField/AutoFieldInternal.tsx"() {
|
|
8206
8220
|
"use strict";
|
|
8207
8221
|
init_react_import();
|
|
8208
|
-
|
|
8222
|
+
import_react50 = require("react");
|
|
8209
8223
|
init_store2();
|
|
8210
8224
|
import_shallow3 = require("zustand/react/shallow");
|
|
8211
8225
|
init_get_deep();
|
|
8212
8226
|
init_FieldLabel();
|
|
8213
8227
|
init_store();
|
|
8214
8228
|
init_context();
|
|
8215
|
-
|
|
8229
|
+
import_react51 = require("react");
|
|
8216
8230
|
init_RadioField();
|
|
8217
8231
|
init_SelectField();
|
|
8218
8232
|
init_ExternalField();
|
|
@@ -8223,8 +8237,8 @@ var init_AutoFieldInternal = __esm({
|
|
|
8223
8237
|
init_get_class_name_factory();
|
|
8224
8238
|
init_styles_module2();
|
|
8225
8239
|
import_jsx_runtime54 = require("react/jsx-runtime");
|
|
8226
|
-
ArrayField2 = (0,
|
|
8227
|
-
ObjectField2 = (0,
|
|
8240
|
+
ArrayField2 = (0, import_react51.lazy)(() => Promise.resolve().then(() => (init_ArrayField(), ArrayField_exports)).then((m) => ({ default: m.ArrayField })));
|
|
8241
|
+
ObjectField2 = (0, import_react51.lazy)(() => Promise.resolve().then(() => (init_ObjectField(), ObjectField_exports)).then((m) => ({ default: m.ObjectField })));
|
|
8228
8242
|
getClassNameWrapper = get_class_name_factory_default("InputWrapper", styles_module_default2);
|
|
8229
8243
|
defaultFields = {
|
|
8230
8244
|
array: ArrayField2,
|
|
@@ -8242,7 +8256,7 @@ var init_AutoFieldInternal = __esm({
|
|
|
8242
8256
|
|
|
8243
8257
|
// components/AutoField/index.tsx
|
|
8244
8258
|
function AutoFieldPublicInternal({ value, ...props }) {
|
|
8245
|
-
const DefaultLabel = (0,
|
|
8259
|
+
const DefaultLabel = (0, import_react52.useMemo)(() => {
|
|
8246
8260
|
const DefaultLabel2 = (labelProps) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
8247
8261
|
"div",
|
|
8248
8262
|
{
|
|
@@ -8254,7 +8268,7 @@ function AutoFieldPublicInternal({ value, ...props }) {
|
|
|
8254
8268
|
}, [props.readOnly]);
|
|
8255
8269
|
const fieldStore = useFieldStoreApi();
|
|
8256
8270
|
const { id: propsId, onChange: propsOnChange } = props;
|
|
8257
|
-
const onChange = (0,
|
|
8271
|
+
const onChange = (0, import_react52.useCallback)(
|
|
8258
8272
|
(value2) => {
|
|
8259
8273
|
if (!propsId) return;
|
|
8260
8274
|
fieldStore.setState({ [propsId]: value2 });
|
|
@@ -8262,7 +8276,7 @@ function AutoFieldPublicInternal({ value, ...props }) {
|
|
|
8262
8276
|
},
|
|
8263
8277
|
[fieldStore, propsOnChange, propsId]
|
|
8264
8278
|
);
|
|
8265
|
-
(0,
|
|
8279
|
+
(0, import_react52.useEffect)(() => {
|
|
8266
8280
|
if (!props.id) return;
|
|
8267
8281
|
fieldStore.setState({ [props.id]: value });
|
|
8268
8282
|
}, [props.id, value, fieldStore]);
|
|
@@ -8280,17 +8294,17 @@ function AutoField(props) {
|
|
|
8280
8294
|
if (props.field.type === "slot") {
|
|
8281
8295
|
return null;
|
|
8282
8296
|
}
|
|
8283
|
-
const providerValue = (0,
|
|
8297
|
+
const providerValue = (0, import_react52.useMemo)(() => ({ [id]: props.value }), [id, props.value]);
|
|
8284
8298
|
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(fieldContextStore.Provider, { value: providerValue, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(AutoFieldPublicInternal, { ...props, id }) });
|
|
8285
8299
|
}
|
|
8286
|
-
var
|
|
8300
|
+
var import_react52, import_jsx_runtime55, getClassName20, getClassNameWrapper2;
|
|
8287
8301
|
var init_AutoField = __esm({
|
|
8288
8302
|
"components/AutoField/index.tsx"() {
|
|
8289
8303
|
"use strict";
|
|
8290
8304
|
init_react_import();
|
|
8291
8305
|
init_get_class_name_factory();
|
|
8292
8306
|
init_styles_module2();
|
|
8293
|
-
|
|
8307
|
+
import_react52 = require("react");
|
|
8294
8308
|
init_use_safe_id();
|
|
8295
8309
|
init_store();
|
|
8296
8310
|
init_FieldLabel();
|
|
@@ -8312,11 +8326,11 @@ function RichTextRender({
|
|
|
8312
8326
|
}) {
|
|
8313
8327
|
const { tiptap = {}, options } = field;
|
|
8314
8328
|
const { extensions = [] } = tiptap;
|
|
8315
|
-
const loadedExtensions = (0,
|
|
8329
|
+
const loadedExtensions = (0, import_react67.useMemo)(
|
|
8316
8330
|
() => [CredBuildRichText.configure(options), ...extensions],
|
|
8317
8331
|
[extensions, options]
|
|
8318
8332
|
);
|
|
8319
|
-
const normalized = (0,
|
|
8333
|
+
const normalized = (0, import_react67.useMemo)(() => {
|
|
8320
8334
|
if (typeof content === "object" && content?.type === "doc") {
|
|
8321
8335
|
return content;
|
|
8322
8336
|
}
|
|
@@ -8334,22 +8348,22 @@ function RichTextRender({
|
|
|
8334
8348
|
}
|
|
8335
8349
|
return { type: "doc", content: [] };
|
|
8336
8350
|
}, [content, loadedExtensions]);
|
|
8337
|
-
const html = (0,
|
|
8351
|
+
const html = (0, import_react67.useMemo)(() => {
|
|
8338
8352
|
return (0, import_html.generateHTML)(normalized, loadedExtensions);
|
|
8339
8353
|
}, [normalized, loadedExtensions]);
|
|
8340
|
-
return /* @__PURE__ */ (0,
|
|
8354
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: getClassName24(), children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "rich-text", dangerouslySetInnerHTML: { __html: html } }) });
|
|
8341
8355
|
}
|
|
8342
|
-
var import_html,
|
|
8356
|
+
var import_html, import_react67, import_jsx_runtime63, getClassName24;
|
|
8343
8357
|
var init_Render = __esm({
|
|
8344
8358
|
"components/RichTextEditor/components/Render.tsx"() {
|
|
8345
8359
|
"use strict";
|
|
8346
8360
|
init_react_import();
|
|
8347
8361
|
import_html = require("@tiptap/html");
|
|
8348
|
-
|
|
8362
|
+
import_react67 = require("react");
|
|
8349
8363
|
init_get_class_name_factory();
|
|
8350
8364
|
init_styles_module10();
|
|
8351
8365
|
init_extension();
|
|
8352
|
-
|
|
8366
|
+
import_jsx_runtime63 = require("react/jsx-runtime");
|
|
8353
8367
|
getClassName24 = get_class_name_factory_default("RichTextEditor", styles_module_default10);
|
|
8354
8368
|
}
|
|
8355
8369
|
});
|
|
@@ -8361,6 +8375,7 @@ __export(no_external_exports, {
|
|
|
8361
8375
|
ActionBar: () => ActionBar,
|
|
8362
8376
|
AutoField: () => AutoField,
|
|
8363
8377
|
Button: () => Button,
|
|
8378
|
+
ColorPickerField: () => ColorPickerField,
|
|
8364
8379
|
CredBuild: () => CredBuild,
|
|
8365
8380
|
Drawer: () => Drawer,
|
|
8366
8381
|
DropZone: () => DropZone,
|
|
@@ -8369,8 +8384,10 @@ __export(no_external_exports, {
|
|
|
8369
8384
|
IconButton: () => IconButton,
|
|
8370
8385
|
Label: () => Label,
|
|
8371
8386
|
Render: () => Render,
|
|
8387
|
+
ResponsiveSliderField: () => ResponsiveSliderField,
|
|
8372
8388
|
RichTextMenu: () => RichTextMenu,
|
|
8373
8389
|
Separator: () => Separator,
|
|
8390
|
+
SliderField: () => SliderField,
|
|
8374
8391
|
blocksPlugin: () => blocksPlugin,
|
|
8375
8392
|
createUseCredBuild: () => createUseCredBuild,
|
|
8376
8393
|
fieldsPlugin: () => fieldsPlugin,
|
|
@@ -8443,6 +8460,385 @@ init_react_import();
|
|
|
8443
8460
|
// bundle/core.ts
|
|
8444
8461
|
init_ActionBar();
|
|
8445
8462
|
init_AutoField();
|
|
8463
|
+
|
|
8464
|
+
// components/AutoField/fields/index.tsx
|
|
8465
|
+
init_react_import();
|
|
8466
|
+
init_ArrayField();
|
|
8467
|
+
init_DefaultField();
|
|
8468
|
+
init_ExternalField();
|
|
8469
|
+
init_RadioField();
|
|
8470
|
+
init_SelectField();
|
|
8471
|
+
init_TextareaField();
|
|
8472
|
+
init_RichtextField();
|
|
8473
|
+
|
|
8474
|
+
// components/AutoField/fields/SliderField/index.tsx
|
|
8475
|
+
init_react_import();
|
|
8476
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
8477
|
+
var SliderField = ({
|
|
8478
|
+
value,
|
|
8479
|
+
onChange,
|
|
8480
|
+
min = 0,
|
|
8481
|
+
max = 100,
|
|
8482
|
+
step = 1,
|
|
8483
|
+
unit = "px",
|
|
8484
|
+
defaultValue = 0,
|
|
8485
|
+
useUnits = true
|
|
8486
|
+
}) => {
|
|
8487
|
+
const parseValue = (val) => {
|
|
8488
|
+
if (typeof val === "number") return val;
|
|
8489
|
+
if (typeof val === "string") return parseFloat(val);
|
|
8490
|
+
return 0;
|
|
8491
|
+
};
|
|
8492
|
+
const inputValue = value !== void 0 && value !== null ? value : defaultValue;
|
|
8493
|
+
const numericValue = parseValue(inputValue);
|
|
8494
|
+
const extractUnit = (val) => {
|
|
8495
|
+
if (!useUnits) return "";
|
|
8496
|
+
if (typeof val === "string") {
|
|
8497
|
+
const match = val.replace(/[0-9.-]/g, "");
|
|
8498
|
+
return match || unit;
|
|
8499
|
+
}
|
|
8500
|
+
return unit;
|
|
8501
|
+
};
|
|
8502
|
+
const currentUnit = extractUnit(inputValue);
|
|
8503
|
+
const handleChange = (e) => {
|
|
8504
|
+
const newVal = parseFloat(e.target.value);
|
|
8505
|
+
if (isNaN(newVal)) return;
|
|
8506
|
+
if (useUnits) {
|
|
8507
|
+
onChange(`${newVal}${currentUnit}`);
|
|
8508
|
+
} else {
|
|
8509
|
+
onChange(newVal);
|
|
8510
|
+
}
|
|
8511
|
+
};
|
|
8512
|
+
const handleUnitChange = (e) => {
|
|
8513
|
+
const newUnit = e.target.value;
|
|
8514
|
+
onChange(`${numericValue}${newUnit}`);
|
|
8515
|
+
};
|
|
8516
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { style: { padding: "8px 0" }, children: [
|
|
8517
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("style", { dangerouslySetInnerHTML: { __html: `
|
|
8518
|
+
.cb-slider-input {
|
|
8519
|
+
-webkit-appearance: none;
|
|
8520
|
+
width: 100%;
|
|
8521
|
+
height: 3px;
|
|
8522
|
+
background: var(--cb-border, #e2e8f0);
|
|
8523
|
+
border-radius: 2px;
|
|
8524
|
+
outline: none;
|
|
8525
|
+
margin: 8px 0;
|
|
8526
|
+
}
|
|
8527
|
+
.cb-slider-input::-webkit-slider-thumb {
|
|
8528
|
+
-webkit-appearance: none;
|
|
8529
|
+
appearance: none;
|
|
8530
|
+
width: 12px;
|
|
8531
|
+
height: 12px;
|
|
8532
|
+
background: var(--cb-gold, #d97706);
|
|
8533
|
+
cursor: pointer;
|
|
8534
|
+
border-radius: 50%;
|
|
8535
|
+
border: 2px solid var(--cb-bg-surface, #fff);
|
|
8536
|
+
box-shadow: 0 1px 2px rgba(0,0,0,0.1);
|
|
8537
|
+
transition: all 0.2s ease;
|
|
8538
|
+
}
|
|
8539
|
+
.cb-slider-input::-webkit-slider-thumb:hover {
|
|
8540
|
+
transform: scale(1.15);
|
|
8541
|
+
}
|
|
8542
|
+
.cb-number-input:focus, .cb-select-input:focus {
|
|
8543
|
+
border-color: var(--cb-gold) !important;
|
|
8544
|
+
outline: none !important;
|
|
8545
|
+
}
|
|
8546
|
+
` } }),
|
|
8547
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "6px" }, children: [
|
|
8548
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8549
|
+
"input",
|
|
8550
|
+
{
|
|
8551
|
+
type: "range",
|
|
8552
|
+
min,
|
|
8553
|
+
max,
|
|
8554
|
+
step,
|
|
8555
|
+
value: numericValue,
|
|
8556
|
+
onChange: handleChange,
|
|
8557
|
+
className: "cb-slider-input",
|
|
8558
|
+
style: { flex: 1, cursor: "pointer" }
|
|
8559
|
+
}
|
|
8560
|
+
),
|
|
8561
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { style: { display: "flex", gap: "2px" }, children: [
|
|
8562
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8563
|
+
"input",
|
|
8564
|
+
{
|
|
8565
|
+
type: "number",
|
|
8566
|
+
min,
|
|
8567
|
+
max,
|
|
8568
|
+
step,
|
|
8569
|
+
value: numericValue,
|
|
8570
|
+
onChange: handleChange,
|
|
8571
|
+
className: "cb-number-input",
|
|
8572
|
+
style: {
|
|
8573
|
+
width: "48px",
|
|
8574
|
+
padding: "3px 4px",
|
|
8575
|
+
borderRadius: "3px",
|
|
8576
|
+
border: "1px solid var(--cb-border, #e2e8f0)",
|
|
8577
|
+
background: "var(--cb-bg-base, #f8fafc)",
|
|
8578
|
+
color: "var(--cb-silver, #0f172a)",
|
|
8579
|
+
fontSize: "10px",
|
|
8580
|
+
fontWeight: "500",
|
|
8581
|
+
textAlign: "center",
|
|
8582
|
+
transition: "all 0.2s ease"
|
|
8583
|
+
}
|
|
8584
|
+
}
|
|
8585
|
+
),
|
|
8586
|
+
useUnits && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
8587
|
+
"select",
|
|
8588
|
+
{
|
|
8589
|
+
value: currentUnit,
|
|
8590
|
+
onChange: handleUnitChange,
|
|
8591
|
+
className: "cb-select-input",
|
|
8592
|
+
style: {
|
|
8593
|
+
width: "42px",
|
|
8594
|
+
padding: "2px",
|
|
8595
|
+
borderRadius: "3px",
|
|
8596
|
+
border: "1px solid var(--cb-border, #e2e8f0)",
|
|
8597
|
+
background: "var(--cb-bg-base, #f8fafc)",
|
|
8598
|
+
color: "var(--cb-silver, #0f172a)",
|
|
8599
|
+
fontSize: "9px",
|
|
8600
|
+
fontWeight: "500",
|
|
8601
|
+
cursor: "pointer",
|
|
8602
|
+
transition: "all 0.2s ease"
|
|
8603
|
+
},
|
|
8604
|
+
children: [
|
|
8605
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("option", { value: "px", children: "px" }),
|
|
8606
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("option", { value: "%", children: "%" }),
|
|
8607
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("option", { value: "vh", children: "vh" }),
|
|
8608
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("option", { value: "vw", children: "vw" }),
|
|
8609
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("option", { value: "em", children: "em" }),
|
|
8610
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("option", { value: "rem", children: "rem" })
|
|
8611
|
+
]
|
|
8612
|
+
}
|
|
8613
|
+
)
|
|
8614
|
+
] })
|
|
8615
|
+
] })
|
|
8616
|
+
] });
|
|
8617
|
+
};
|
|
8618
|
+
|
|
8619
|
+
// components/AutoField/fields/ResponsiveSliderField/index.tsx
|
|
8620
|
+
init_react_import();
|
|
8621
|
+
var import_react53 = require("react");
|
|
8622
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
8623
|
+
var DesktopIcon = () => /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
8624
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("rect", { x: "2", y: "3", width: "20", height: "14", rx: "2", ry: "2" }),
|
|
8625
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("line", { x1: "8", y1: "21", x2: "16", y2: "21" }),
|
|
8626
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("line", { x1: "12", y1: "17", x2: "12", y2: "21" })
|
|
8627
|
+
] });
|
|
8628
|
+
var TabletIcon = () => /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
8629
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("rect", { x: "4", y: "2", width: "16", height: "20", rx: "2", ry: "2" }),
|
|
8630
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("line", { x1: "12", y1: "18", x2: "12.01", y2: "18" })
|
|
8631
|
+
] });
|
|
8632
|
+
var MobileIcon = () => /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
8633
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("rect", { x: "5", y: "2", width: "14", height: "20", rx: "2", ry: "2" }),
|
|
8634
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("line", { x1: "12", y1: "18", x2: "12.01", y2: "18" })
|
|
8635
|
+
] });
|
|
8636
|
+
var ResponsiveSliderField = ({
|
|
8637
|
+
value = {},
|
|
8638
|
+
onChange,
|
|
8639
|
+
label,
|
|
8640
|
+
unit = "px",
|
|
8641
|
+
max = 100,
|
|
8642
|
+
min = 0,
|
|
8643
|
+
step = 1,
|
|
8644
|
+
defaultValue = 0
|
|
8645
|
+
}) => {
|
|
8646
|
+
const [mode, setMode] = (0, import_react53.useState)("desktop");
|
|
8647
|
+
const getCurrentValue = () => {
|
|
8648
|
+
const val = value?.[mode];
|
|
8649
|
+
if (val !== void 0 && val !== null) {
|
|
8650
|
+
return val;
|
|
8651
|
+
}
|
|
8652
|
+
if (mode === "tablet" && value?.desktop !== void 0) return value.desktop;
|
|
8653
|
+
if (mode === "mobile") {
|
|
8654
|
+
if (value?.tablet !== void 0) return value.tablet;
|
|
8655
|
+
if (value?.desktop !== void 0) return value.desktop;
|
|
8656
|
+
}
|
|
8657
|
+
if (typeof defaultValue === "number") return defaultValue;
|
|
8658
|
+
const def = defaultValue;
|
|
8659
|
+
const defVal = def?.[mode];
|
|
8660
|
+
if (defVal !== void 0) return defVal;
|
|
8661
|
+
if (mode === "tablet" && def?.desktop !== void 0) return def.desktop;
|
|
8662
|
+
if (mode === "mobile") {
|
|
8663
|
+
if (def?.tablet !== void 0) return def.tablet;
|
|
8664
|
+
if (def?.desktop !== void 0) return def.desktop;
|
|
8665
|
+
}
|
|
8666
|
+
return 0;
|
|
8667
|
+
};
|
|
8668
|
+
const handleChange = (newVal) => {
|
|
8669
|
+
onChange({
|
|
8670
|
+
...value,
|
|
8671
|
+
[mode]: newVal
|
|
8672
|
+
});
|
|
8673
|
+
};
|
|
8674
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: "2px" }, children: [
|
|
8675
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: "0px" }, children: [
|
|
8676
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("label", { style: {
|
|
8677
|
+
fontSize: "10px",
|
|
8678
|
+
fontWeight: 500,
|
|
8679
|
+
color: "var(--cb-silver-muted, #71717a)",
|
|
8680
|
+
display: "flex",
|
|
8681
|
+
alignItems: "center",
|
|
8682
|
+
gap: "4px"
|
|
8683
|
+
}, children: [
|
|
8684
|
+
label,
|
|
8685
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("span", { style: { fontSize: "9px", opacity: 0.5, fontWeight: "400" }, children: [
|
|
8686
|
+
"(",
|
|
8687
|
+
mode,
|
|
8688
|
+
")"
|
|
8689
|
+
] })
|
|
8690
|
+
] }),
|
|
8691
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { style: {
|
|
8692
|
+
display: "flex",
|
|
8693
|
+
backgroundColor: "var(--cb-bg-panel, #f1f5f9)",
|
|
8694
|
+
borderRadius: "4px",
|
|
8695
|
+
padding: "1px",
|
|
8696
|
+
border: "1px solid var(--cb-border, #e2e8f0)"
|
|
8697
|
+
}, children: [
|
|
8698
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
8699
|
+
"button",
|
|
8700
|
+
{
|
|
8701
|
+
onClick: () => setMode("desktop"),
|
|
8702
|
+
style: {
|
|
8703
|
+
padding: "2px 5px",
|
|
8704
|
+
border: "none",
|
|
8705
|
+
background: mode === "desktop" ? "var(--cb-bg-surface, #fff)" : "transparent",
|
|
8706
|
+
boxShadow: mode === "desktop" ? "0 1px 2px rgba(0,0,0,0.05)" : "none",
|
|
8707
|
+
borderRadius: "3px",
|
|
8708
|
+
cursor: "pointer",
|
|
8709
|
+
color: mode === "desktop" ? "var(--cb-gold, #d97706)" : "var(--cb-silver-muted, #a1a1aa)",
|
|
8710
|
+
display: "flex",
|
|
8711
|
+
alignItems: "center",
|
|
8712
|
+
transition: "all 0.1s ease"
|
|
8713
|
+
},
|
|
8714
|
+
title: "Desktop",
|
|
8715
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(DesktopIcon, {})
|
|
8716
|
+
}
|
|
8717
|
+
),
|
|
8718
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
8719
|
+
"button",
|
|
8720
|
+
{
|
|
8721
|
+
onClick: () => setMode("tablet"),
|
|
8722
|
+
style: {
|
|
8723
|
+
padding: "2px 5px",
|
|
8724
|
+
border: "none",
|
|
8725
|
+
background: mode === "tablet" ? "var(--cb-bg-surface, #fff)" : "transparent",
|
|
8726
|
+
boxShadow: mode === "tablet" ? "0 1px 2px rgba(0,0,0,0.05)" : "none",
|
|
8727
|
+
borderRadius: "3px",
|
|
8728
|
+
cursor: "pointer",
|
|
8729
|
+
color: mode === "tablet" ? "var(--cb-gold, #d97706)" : "var(--cb-silver-muted, #a1a1aa)",
|
|
8730
|
+
display: "flex",
|
|
8731
|
+
alignItems: "center",
|
|
8732
|
+
transition: "all 0.1s ease"
|
|
8733
|
+
},
|
|
8734
|
+
title: "Tablet",
|
|
8735
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(TabletIcon, {})
|
|
8736
|
+
}
|
|
8737
|
+
),
|
|
8738
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
8739
|
+
"button",
|
|
8740
|
+
{
|
|
8741
|
+
onClick: () => setMode("mobile"),
|
|
8742
|
+
style: {
|
|
8743
|
+
padding: "2px 5px",
|
|
8744
|
+
border: "none",
|
|
8745
|
+
background: mode === "mobile" ? "var(--cb-bg-surface, #fff)" : "transparent",
|
|
8746
|
+
boxShadow: mode === "mobile" ? "0 1px 2px rgba(0,0,0,0.05)" : "none",
|
|
8747
|
+
borderRadius: "3px",
|
|
8748
|
+
cursor: "pointer",
|
|
8749
|
+
color: mode === "mobile" ? "var(--cb-gold, #d97706)" : "var(--cb-silver-muted, #a1a1aa)",
|
|
8750
|
+
display: "flex",
|
|
8751
|
+
alignItems: "center",
|
|
8752
|
+
transition: "all 0.1s ease"
|
|
8753
|
+
},
|
|
8754
|
+
title: "Mobile",
|
|
8755
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(MobileIcon, {})
|
|
8756
|
+
}
|
|
8757
|
+
)
|
|
8758
|
+
] })
|
|
8759
|
+
] }),
|
|
8760
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
8761
|
+
SliderField,
|
|
8762
|
+
{
|
|
8763
|
+
value: getCurrentValue(),
|
|
8764
|
+
onChange: handleChange,
|
|
8765
|
+
unit,
|
|
8766
|
+
max,
|
|
8767
|
+
min,
|
|
8768
|
+
step,
|
|
8769
|
+
useUnits: false
|
|
8770
|
+
}
|
|
8771
|
+
)
|
|
8772
|
+
] });
|
|
8773
|
+
};
|
|
8774
|
+
|
|
8775
|
+
// components/AutoField/fields/ColorPickerField/index.tsx
|
|
8776
|
+
init_react_import();
|
|
8777
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
8778
|
+
var ColorPickerField = ({ value, onChange }) => {
|
|
8779
|
+
const safeValue = value || "#ffffff";
|
|
8780
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { style: { padding: "4px 0", display: "flex", gap: "6px", alignItems: "center" }, children: [
|
|
8781
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { style: {
|
|
8782
|
+
position: "relative",
|
|
8783
|
+
width: "28px",
|
|
8784
|
+
height: "28px",
|
|
8785
|
+
borderRadius: "3px",
|
|
8786
|
+
border: "1px solid var(--cb-border, #e2e8f0)",
|
|
8787
|
+
overflow: "hidden",
|
|
8788
|
+
flexShrink: 0,
|
|
8789
|
+
background: "var(--cb-bg-base, #f8fafc)"
|
|
8790
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
8791
|
+
"input",
|
|
8792
|
+
{
|
|
8793
|
+
type: "color",
|
|
8794
|
+
value: safeValue.startsWith("#") ? safeValue : "#000000",
|
|
8795
|
+
onChange: (e) => {
|
|
8796
|
+
if (e.target.value !== value) {
|
|
8797
|
+
onChange(e.target.value);
|
|
8798
|
+
}
|
|
8799
|
+
},
|
|
8800
|
+
style: {
|
|
8801
|
+
position: "absolute",
|
|
8802
|
+
top: "-50%",
|
|
8803
|
+
left: "-50%",
|
|
8804
|
+
width: "200%",
|
|
8805
|
+
height: "200%",
|
|
8806
|
+
cursor: "pointer",
|
|
8807
|
+
border: "none",
|
|
8808
|
+
padding: 0,
|
|
8809
|
+
margin: 0
|
|
8810
|
+
}
|
|
8811
|
+
}
|
|
8812
|
+
) }),
|
|
8813
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
8814
|
+
"input",
|
|
8815
|
+
{
|
|
8816
|
+
type: "text",
|
|
8817
|
+
value: value || "",
|
|
8818
|
+
placeholder: "#RRGGBB",
|
|
8819
|
+
onChange: (e) => onChange(e.target.value),
|
|
8820
|
+
style: {
|
|
8821
|
+
flex: 1,
|
|
8822
|
+
padding: "4px 8px",
|
|
8823
|
+
borderRadius: "3px",
|
|
8824
|
+
border: "1px solid var(--cb-border, #e2e8f0)",
|
|
8825
|
+
background: "var(--cb-bg-base, #f8fafc)",
|
|
8826
|
+
color: "var(--cb-silver, #0f172a)",
|
|
8827
|
+
fontSize: "11px",
|
|
8828
|
+
fontFamily: "var(--cb-font-mono, 'JetBrains Mono', monospace)",
|
|
8829
|
+
fontWeight: "500",
|
|
8830
|
+
height: "28px",
|
|
8831
|
+
transition: "all 0.1s ease"
|
|
8832
|
+
}
|
|
8833
|
+
}
|
|
8834
|
+
)
|
|
8835
|
+
] });
|
|
8836
|
+
};
|
|
8837
|
+
|
|
8838
|
+
// components/AutoField/fields/index.tsx
|
|
8839
|
+
init_ObjectField();
|
|
8840
|
+
|
|
8841
|
+
// bundle/core.ts
|
|
8446
8842
|
init_Button2();
|
|
8447
8843
|
|
|
8448
8844
|
// components/Drawer/index.tsx
|
|
@@ -8455,23 +8851,23 @@ var styles_module_default14 = { "Drawer": "_Drawer_e1509_1", "Drawer-draggable":
|
|
|
8455
8851
|
// components/Drawer/index.tsx
|
|
8456
8852
|
init_get_class_name_factory();
|
|
8457
8853
|
init_DragIcon();
|
|
8458
|
-
var
|
|
8854
|
+
var import_react55 = require("react");
|
|
8459
8855
|
init_generate_id();
|
|
8460
8856
|
|
|
8461
8857
|
// components/DragDropContext/context.tsx
|
|
8462
8858
|
init_react_import();
|
|
8463
|
-
var
|
|
8464
|
-
var dragListenerContext = (0,
|
|
8859
|
+
var import_react54 = require("react");
|
|
8860
|
+
var dragListenerContext = (0, import_react54.createContext)({
|
|
8465
8861
|
dragListeners: {}
|
|
8466
8862
|
});
|
|
8467
8863
|
function useDragListener(type, fn, deps = []) {
|
|
8468
|
-
const { setDragListeners } = (0,
|
|
8469
|
-
const id = (0,
|
|
8470
|
-
const fnRef = (0,
|
|
8471
|
-
(0,
|
|
8864
|
+
const { setDragListeners } = (0, import_react54.useContext)(dragListenerContext);
|
|
8865
|
+
const id = (0, import_react54.useId)();
|
|
8866
|
+
const fnRef = (0, import_react54.useRef)(fn);
|
|
8867
|
+
(0, import_react54.useEffect)(() => {
|
|
8472
8868
|
fnRef.current = fn;
|
|
8473
8869
|
}, [fn]);
|
|
8474
|
-
(0,
|
|
8870
|
+
(0, import_react54.useEffect)(() => {
|
|
8475
8871
|
if (setDragListeners) {
|
|
8476
8872
|
const wrappedFn = ((...args) => {
|
|
8477
8873
|
return fnRef.current(...args);
|
|
@@ -8492,8 +8888,8 @@ function useDragListener(type, fn, deps = []) {
|
|
|
8492
8888
|
|
|
8493
8889
|
// components/Drawer/index.tsx
|
|
8494
8890
|
init_use_safe_id();
|
|
8495
|
-
var
|
|
8496
|
-
var
|
|
8891
|
+
var import_react56 = require("@dnd-kit/react");
|
|
8892
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
8497
8893
|
var getClassName21 = get_class_name_factory_default("Drawer", styles_module_default14);
|
|
8498
8894
|
var getClassNameItem2 = get_class_name_factory_default("DrawerItem", styles_module_default14);
|
|
8499
8895
|
var DrawerItemInner = ({
|
|
@@ -8503,11 +8899,11 @@ var DrawerItemInner = ({
|
|
|
8503
8899
|
dragRef,
|
|
8504
8900
|
isDragDisabled
|
|
8505
8901
|
}) => {
|
|
8506
|
-
const CustomInner = (0,
|
|
8507
|
-
() => children || (({ children: children2 }) => /* @__PURE__ */ (0,
|
|
8902
|
+
const CustomInner = (0, import_react55.useMemo)(
|
|
8903
|
+
() => children || (({ children: children2 }) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: getClassNameItem2("default"), children: children2 })),
|
|
8508
8904
|
[children]
|
|
8509
8905
|
);
|
|
8510
|
-
return /* @__PURE__ */ (0,
|
|
8906
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
8511
8907
|
"div",
|
|
8512
8908
|
{
|
|
8513
8909
|
className: getClassNameItem2({ disabled: isDragDisabled }),
|
|
@@ -8515,9 +8911,9 @@ var DrawerItemInner = ({
|
|
|
8515
8911
|
onMouseDown: (e) => e.preventDefault(),
|
|
8516
8912
|
"data-testid": dragRef ? `drawer-item:${name}` : "",
|
|
8517
8913
|
"data-credbuild-drawer-item": true,
|
|
8518
|
-
children: /* @__PURE__ */ (0,
|
|
8519
|
-
/* @__PURE__ */ (0,
|
|
8520
|
-
/* @__PURE__ */ (0,
|
|
8914
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(CustomInner, { name, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: getClassNameItem2("draggableWrapper"), children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: getClassNameItem2("draggable"), children: [
|
|
8915
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: getClassNameItem2("name"), children: label ?? name }),
|
|
8916
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: getClassNameItem2("icon"), children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(DragIcon, {}) })
|
|
8521
8917
|
] }) }) })
|
|
8522
8918
|
}
|
|
8523
8919
|
);
|
|
@@ -8529,15 +8925,15 @@ var DrawerItemDraggable = ({
|
|
|
8529
8925
|
id,
|
|
8530
8926
|
isDragDisabled
|
|
8531
8927
|
}) => {
|
|
8532
|
-
const { ref } = (0,
|
|
8928
|
+
const { ref } = (0, import_react56.useDraggable)({
|
|
8533
8929
|
id,
|
|
8534
8930
|
data: { componentType: name },
|
|
8535
8931
|
disabled: isDragDisabled,
|
|
8536
8932
|
type: "drawer"
|
|
8537
8933
|
});
|
|
8538
|
-
return /* @__PURE__ */ (0,
|
|
8539
|
-
/* @__PURE__ */ (0,
|
|
8540
|
-
/* @__PURE__ */ (0,
|
|
8934
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: getClassName21("draggable"), children: [
|
|
8935
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: getClassName21("draggableBg"), children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(DrawerItemInner, { name, label, children }) }),
|
|
8936
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: getClassName21("draggableFg"), children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
8541
8937
|
DrawerItemInner,
|
|
8542
8938
|
{
|
|
8543
8939
|
name,
|
|
@@ -8558,7 +8954,7 @@ var DrawerItem = ({
|
|
|
8558
8954
|
isDragDisabled
|
|
8559
8955
|
}) => {
|
|
8560
8956
|
const resolvedId = id || name;
|
|
8561
|
-
const [dynamicId, setDynamicId] = (0,
|
|
8957
|
+
const [dynamicId, setDynamicId] = (0, import_react55.useState)(generateId(resolvedId));
|
|
8562
8958
|
if (typeof index !== "undefined") {
|
|
8563
8959
|
console.error(
|
|
8564
8960
|
"Warning: The `index` prop on Drawer.Item is deprecated and no longer required."
|
|
@@ -8571,7 +8967,7 @@ var DrawerItem = ({
|
|
|
8571
8967
|
},
|
|
8572
8968
|
[resolvedId]
|
|
8573
8969
|
);
|
|
8574
|
-
return /* @__PURE__ */ (0,
|
|
8970
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
8575
8971
|
DrawerItemDraggable,
|
|
8576
8972
|
{
|
|
8577
8973
|
name,
|
|
@@ -8598,13 +8994,13 @@ var Drawer = ({
|
|
|
8598
8994
|
);
|
|
8599
8995
|
}
|
|
8600
8996
|
const id = useSafeId();
|
|
8601
|
-
const { ref } = (0,
|
|
8997
|
+
const { ref } = (0, import_react56.useDroppable)({
|
|
8602
8998
|
id,
|
|
8603
8999
|
type: "void",
|
|
8604
9000
|
collisionPriority: 0
|
|
8605
9001
|
// Never collide with this, but we use it so NestedDroppablePlugin respects the Drawer
|
|
8606
9002
|
});
|
|
8607
|
-
return /* @__PURE__ */ (0,
|
|
9003
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
8608
9004
|
"div",
|
|
8609
9005
|
{
|
|
8610
9006
|
className: getClassName21(),
|
|
@@ -8620,11 +9016,11 @@ Drawer.Item = DrawerItem;
|
|
|
8620
9016
|
|
|
8621
9017
|
// components/DropZone/index.tsx
|
|
8622
9018
|
init_react_import();
|
|
8623
|
-
var
|
|
9019
|
+
var import_react75 = require("react");
|
|
8624
9020
|
|
|
8625
9021
|
// components/DraggableComponent/index.tsx
|
|
8626
9022
|
init_react_import();
|
|
8627
|
-
var
|
|
9023
|
+
var import_react59 = require("react");
|
|
8628
9024
|
|
|
8629
9025
|
// css-module:/home/crediblemark/Project/Credibuild/components/DraggableComponent/styles.module.css#css-module
|
|
8630
9026
|
init_react_import();
|
|
@@ -8640,12 +9036,12 @@ var import_react_dom2 = require("react-dom");
|
|
|
8640
9036
|
|
|
8641
9037
|
// components/DropZone/context.tsx
|
|
8642
9038
|
init_react_import();
|
|
8643
|
-
var
|
|
9039
|
+
var import_react57 = require("react");
|
|
8644
9040
|
init_store2();
|
|
8645
9041
|
var import_zustand5 = require("zustand");
|
|
8646
|
-
var
|
|
8647
|
-
var dropZoneContext = (0,
|
|
8648
|
-
var ZoneStoreContext = (0,
|
|
9042
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
9043
|
+
var dropZoneContext = (0, import_react57.createContext)(null);
|
|
9044
|
+
var ZoneStoreContext = (0, import_react57.createContext)(
|
|
8649
9045
|
(0, import_zustand5.createStore)(() => ({
|
|
8650
9046
|
zoneDepthIndex: {},
|
|
8651
9047
|
nextZoneDepthIndex: {},
|
|
@@ -8666,14 +9062,14 @@ var ZoneStoreProvider = ({
|
|
|
8666
9062
|
children,
|
|
8667
9063
|
store
|
|
8668
9064
|
}) => {
|
|
8669
|
-
return /* @__PURE__ */ (0,
|
|
9065
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(ZoneStoreContext.Provider, { value: store, children });
|
|
8670
9066
|
};
|
|
8671
9067
|
var DropZoneProvider = ({
|
|
8672
9068
|
children,
|
|
8673
9069
|
value
|
|
8674
9070
|
}) => {
|
|
8675
9071
|
const dispatch = useAppStore((s) => s.dispatch);
|
|
8676
|
-
const registerZone = (0,
|
|
9072
|
+
const registerZone = (0, import_react57.useCallback)(
|
|
8677
9073
|
(zoneCompound) => {
|
|
8678
9074
|
dispatch({
|
|
8679
9075
|
type: "registerZone",
|
|
@@ -8682,14 +9078,14 @@ var DropZoneProvider = ({
|
|
|
8682
9078
|
},
|
|
8683
9079
|
[dispatch]
|
|
8684
9080
|
);
|
|
8685
|
-
const memoValue = (0,
|
|
9081
|
+
const memoValue = (0, import_react57.useMemo)(
|
|
8686
9082
|
() => ({
|
|
8687
9083
|
registerZone,
|
|
8688
9084
|
...value
|
|
8689
9085
|
}),
|
|
8690
9086
|
[value, registerZone]
|
|
8691
9087
|
);
|
|
8692
|
-
return /* @__PURE__ */ (0,
|
|
9088
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_jsx_runtime60.Fragment, { children: memoValue && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(dropZoneContext.Provider, { value: memoValue, children }) });
|
|
8693
9089
|
};
|
|
8694
9090
|
|
|
8695
9091
|
// components/DraggableComponent/index.tsx
|
|
@@ -8722,11 +9118,11 @@ init_use_context_store();
|
|
|
8722
9118
|
|
|
8723
9119
|
// lib/dnd/use-on-drag-finished.ts
|
|
8724
9120
|
init_react_import();
|
|
8725
|
-
var
|
|
9121
|
+
var import_react58 = require("react");
|
|
8726
9122
|
init_store2();
|
|
8727
9123
|
var useOnDragFinished = (cb, _deps = []) => {
|
|
8728
9124
|
const appStore = useAppStoreApi();
|
|
8729
|
-
return (0,
|
|
9125
|
+
return (0, import_react58.useCallback)(() => {
|
|
8730
9126
|
let dispose = () => {
|
|
8731
9127
|
};
|
|
8732
9128
|
const processDragging = (isDragging2) => {
|
|
@@ -8772,7 +9168,7 @@ function assignRefs(refs, node) {
|
|
|
8772
9168
|
}
|
|
8773
9169
|
|
|
8774
9170
|
// components/DraggableComponent/index.tsx
|
|
8775
|
-
var
|
|
9171
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
8776
9172
|
var getClassName22 = get_class_name_factory_default("DraggableComponent", styles_module_default15);
|
|
8777
9173
|
var DEBUG2 = false;
|
|
8778
9174
|
var MEASURE_EVERY_MS = 100;
|
|
@@ -8784,16 +9180,16 @@ var DefaultActionBar = ({
|
|
|
8784
9180
|
label,
|
|
8785
9181
|
children,
|
|
8786
9182
|
parentAction
|
|
8787
|
-
}) => /* @__PURE__ */ (0,
|
|
8788
|
-
/* @__PURE__ */ (0,
|
|
9183
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(ActionBar, { children: [
|
|
9184
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(ActionBar.Group, { children: [
|
|
8789
9185
|
parentAction,
|
|
8790
|
-
label && /* @__PURE__ */ (0,
|
|
9186
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(ActionBar.Label, { label })
|
|
8791
9187
|
] }),
|
|
8792
|
-
/* @__PURE__ */ (0,
|
|
9188
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(ActionBar.Group, { children })
|
|
8793
9189
|
] });
|
|
8794
9190
|
var DefaultOverlay = ({
|
|
8795
9191
|
children
|
|
8796
|
-
}) => /* @__PURE__ */ (0,
|
|
9192
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_jsx_runtime61.Fragment, { children });
|
|
8797
9193
|
var DraggableComponent = ({
|
|
8798
9194
|
children,
|
|
8799
9195
|
depth,
|
|
@@ -8819,10 +9215,10 @@ var DraggableComponent = ({
|
|
|
8819
9215
|
const overrides = useAppStore((s) => s.overrides);
|
|
8820
9216
|
const dispatch = useAppStore((s) => s.dispatch);
|
|
8821
9217
|
const iframe = useAppStore((s) => s.iframe);
|
|
8822
|
-
const lastMeasureRef = (0,
|
|
8823
|
-
const ctx = (0,
|
|
8824
|
-
const [localZones, setLocalZones] = (0,
|
|
8825
|
-
const registerLocalZone = (0,
|
|
9218
|
+
const lastMeasureRef = (0, import_react59.useRef)(0);
|
|
9219
|
+
const ctx = (0, import_react59.useContext)(dropZoneContext);
|
|
9220
|
+
const [localZones, setLocalZones] = (0, import_react59.useState)({});
|
|
9221
|
+
const registerLocalZone = (0, import_react59.useCallback)(
|
|
8826
9222
|
(zoneCompound2, active) => {
|
|
8827
9223
|
ctx?.registerLocalZone?.(zoneCompound2, active);
|
|
8828
9224
|
setLocalZones((obj) => ({
|
|
@@ -8832,7 +9228,7 @@ var DraggableComponent = ({
|
|
|
8832
9228
|
},
|
|
8833
9229
|
[setLocalZones, ctx]
|
|
8834
9230
|
);
|
|
8835
|
-
const unregisterLocalZone = (0,
|
|
9231
|
+
const unregisterLocalZone = (0, import_react59.useCallback)(
|
|
8836
9232
|
(zoneCompound2) => {
|
|
8837
9233
|
ctx?.unregisterLocalZone?.(zoneCompound2);
|
|
8838
9234
|
setLocalZones((obj) => {
|
|
@@ -8853,9 +9249,9 @@ var DraggableComponent = ({
|
|
|
8853
9249
|
return s.permissions.getPermissions({ item });
|
|
8854
9250
|
})
|
|
8855
9251
|
);
|
|
8856
|
-
const zoneStore = (0,
|
|
8857
|
-
const [dragAxis, setDragAxis] = (0,
|
|
8858
|
-
const dynamicCollisionDetector = (0,
|
|
9252
|
+
const zoneStore = (0, import_react59.useContext)(ZoneStoreContext);
|
|
9253
|
+
const [dragAxis, setDragAxis] = (0, import_react59.useState)(userDragAxis || autoDragAxis);
|
|
9254
|
+
const dynamicCollisionDetector = (0, import_react59.useMemo)(
|
|
8859
9255
|
() => createDynamicCollisionDetector(dragAxis),
|
|
8860
9256
|
[dragAxis]
|
|
8861
9257
|
);
|
|
@@ -8887,7 +9283,7 @@ var DraggableComponent = ({
|
|
|
8887
9283
|
},
|
|
8888
9284
|
feedback: "clone"
|
|
8889
9285
|
});
|
|
8890
|
-
(0,
|
|
9286
|
+
(0, import_react59.useEffect)(() => {
|
|
8891
9287
|
const isEnabled = zoneStore.getState().enabledIndex[zoneCompound];
|
|
8892
9288
|
sortable.droppable.disabled = !isEnabled;
|
|
8893
9289
|
sortable.draggable.disabled = !permissions.drag;
|
|
@@ -8903,9 +9299,9 @@ var DraggableComponent = ({
|
|
|
8903
9299
|
}
|
|
8904
9300
|
return cleanup;
|
|
8905
9301
|
}, [permissions.drag, zoneCompound, sortable.draggable, sortable.droppable, zoneStore]);
|
|
8906
|
-
const [, setRerender] = (0,
|
|
8907
|
-
const ref = (0,
|
|
8908
|
-
const refSetter = (0,
|
|
9302
|
+
const [, setRerender] = (0, import_react59.useState)(0);
|
|
9303
|
+
const ref = (0, import_react59.useRef)(null);
|
|
9304
|
+
const refSetter = (0, import_react59.useCallback)(
|
|
8909
9305
|
(el) => {
|
|
8910
9306
|
sortableRef(el);
|
|
8911
9307
|
if (ref.current !== el) {
|
|
@@ -8918,13 +9314,13 @@ var DraggableComponent = ({
|
|
|
8918
9314
|
},
|
|
8919
9315
|
[itemRef, sortableRef]
|
|
8920
9316
|
);
|
|
8921
|
-
const [portalEl, setPortalEl] = (0,
|
|
8922
|
-
(0,
|
|
9317
|
+
const [portalEl, setPortalEl] = (0, import_react59.useState)();
|
|
9318
|
+
(0, import_react59.useEffect)(() => {
|
|
8923
9319
|
setPortalEl(
|
|
8924
9320
|
iframe.enabled ? ref.current?.ownerDocument.body : ref.current?.closest("[data-credbuild-preview]") ?? document.body
|
|
8925
9321
|
);
|
|
8926
9322
|
}, [iframe.enabled]);
|
|
8927
|
-
const getStyle = (0,
|
|
9323
|
+
const getStyle = (0, import_react59.useCallback)(() => {
|
|
8928
9324
|
if (!ref.current) return;
|
|
8929
9325
|
const el = ref.current;
|
|
8930
9326
|
const rect = el.getBoundingClientRect();
|
|
@@ -8955,23 +9351,23 @@ var DraggableComponent = ({
|
|
|
8955
9351
|
};
|
|
8956
9352
|
return style2;
|
|
8957
9353
|
}, [iframe.enabled]);
|
|
8958
|
-
const [style, setStyle] = (0,
|
|
8959
|
-
const lastRectRef = (0,
|
|
8960
|
-
const syncRafRef = (0,
|
|
8961
|
-
const sync = (0,
|
|
9354
|
+
const [style, setStyle] = (0, import_react59.useState)();
|
|
9355
|
+
const lastRectRef = (0, import_react59.useRef)(null);
|
|
9356
|
+
const syncRafRef = (0, import_react59.useRef)(null);
|
|
9357
|
+
const sync = (0, import_react59.useCallback)(() => {
|
|
8962
9358
|
setStyle(getStyle());
|
|
8963
9359
|
if (itemRef) {
|
|
8964
9360
|
assignRefs([itemRef], ref.current);
|
|
8965
9361
|
}
|
|
8966
9362
|
}, [getStyle, itemRef]);
|
|
8967
|
-
const scheduleSync = (0,
|
|
9363
|
+
const scheduleSync = (0, import_react59.useCallback)(() => {
|
|
8968
9364
|
if (syncRafRef.current != null) return;
|
|
8969
9365
|
syncRafRef.current = requestAnimationFrame(() => {
|
|
8970
9366
|
syncRafRef.current = null;
|
|
8971
9367
|
sync();
|
|
8972
9368
|
});
|
|
8973
9369
|
}, [sync]);
|
|
8974
|
-
(0,
|
|
9370
|
+
(0, import_react59.useEffect)(() => {
|
|
8975
9371
|
return () => {
|
|
8976
9372
|
if (syncRafRef.current != null) {
|
|
8977
9373
|
cancelAnimationFrame(syncRafRef.current);
|
|
@@ -8979,7 +9375,7 @@ var DraggableComponent = ({
|
|
|
8979
9375
|
}
|
|
8980
9376
|
};
|
|
8981
9377
|
}, []);
|
|
8982
|
-
(0,
|
|
9378
|
+
(0, import_react59.useEffect)(() => {
|
|
8983
9379
|
if (ref.current) {
|
|
8984
9380
|
const observer = new ResizeObserver(() => {
|
|
8985
9381
|
scheduleSync();
|
|
@@ -8992,37 +9388,37 @@ var DraggableComponent = ({
|
|
|
8992
9388
|
}, [scheduleSync, itemRef]);
|
|
8993
9389
|
const registerNode = useAppStore((s) => s.nodes.registerNode);
|
|
8994
9390
|
const unregisterNode = useAppStore((s) => s.nodes.unregisterNode);
|
|
8995
|
-
const hideOverlay = (0,
|
|
9391
|
+
const hideOverlay = (0, import_react59.useCallback)(() => {
|
|
8996
9392
|
setIsVisible(false);
|
|
8997
9393
|
}, []);
|
|
8998
|
-
const showOverlay = (0,
|
|
9394
|
+
const showOverlay = (0, import_react59.useCallback)(() => {
|
|
8999
9395
|
setIsVisible(true);
|
|
9000
9396
|
}, []);
|
|
9001
|
-
const nodeHandleRef = (0,
|
|
9397
|
+
const nodeHandleRef = (0, import_react59.useRef)({
|
|
9002
9398
|
sync: () => null,
|
|
9003
9399
|
hideOverlay: () => null,
|
|
9004
9400
|
showOverlay: () => null
|
|
9005
9401
|
});
|
|
9006
|
-
(0,
|
|
9402
|
+
(0, import_react59.useLayoutEffect)(() => {
|
|
9007
9403
|
nodeHandleRef.current.sync = sync;
|
|
9008
9404
|
nodeHandleRef.current.hideOverlay = hideOverlay;
|
|
9009
9405
|
nodeHandleRef.current.showOverlay = showOverlay;
|
|
9010
9406
|
}, [hideOverlay, showOverlay, sync]);
|
|
9011
|
-
(0,
|
|
9407
|
+
(0, import_react59.useEffect)(() => {
|
|
9012
9408
|
registerNode(id, nodeHandleRef.current);
|
|
9013
9409
|
return () => {
|
|
9014
9410
|
unregisterNode(id);
|
|
9015
9411
|
};
|
|
9016
9412
|
}, [id, registerNode, unregisterNode]);
|
|
9017
|
-
const CustomActionBar = (0,
|
|
9413
|
+
const CustomActionBar = (0, import_react59.useMemo)(
|
|
9018
9414
|
() => overrides.actionBar || DefaultActionBar,
|
|
9019
9415
|
[overrides.actionBar]
|
|
9020
9416
|
);
|
|
9021
|
-
const CustomOverlay = (0,
|
|
9417
|
+
const CustomOverlay = (0, import_react59.useMemo)(
|
|
9022
9418
|
() => overrides.componentOverlay || DefaultOverlay,
|
|
9023
9419
|
[overrides.componentOverlay]
|
|
9024
9420
|
);
|
|
9025
|
-
const onClick = (0,
|
|
9421
|
+
const onClick = (0, import_react59.useCallback)(
|
|
9026
9422
|
(e) => {
|
|
9027
9423
|
const userIsDragging = !!zoneStore.getState().draggedItem;
|
|
9028
9424
|
if (userIsDragging) {
|
|
@@ -9051,7 +9447,7 @@ var DraggableComponent = ({
|
|
|
9051
9447
|
[index, zoneCompound, isSelected, _experimentalFullScreenCanvas, dispatch, zoneStore]
|
|
9052
9448
|
);
|
|
9053
9449
|
const appStore = useAppStoreApi();
|
|
9054
|
-
const onSelectParent = (0,
|
|
9450
|
+
const onSelectParent = (0, import_react59.useCallback)(() => {
|
|
9055
9451
|
const { nodes, zones } = appStore.getState().state.indexes;
|
|
9056
9452
|
const node = nodes[id];
|
|
9057
9453
|
const parentNode = node?.parentId ? nodes[node?.parentId] : null;
|
|
@@ -9072,26 +9468,26 @@ var DraggableComponent = ({
|
|
|
9072
9468
|
}
|
|
9073
9469
|
});
|
|
9074
9470
|
}, [appStore, dispatch, id]);
|
|
9075
|
-
const onDuplicate = (0,
|
|
9471
|
+
const onDuplicate = (0, import_react59.useCallback)(() => {
|
|
9076
9472
|
dispatch({
|
|
9077
9473
|
type: "duplicate",
|
|
9078
9474
|
sourceIndex: index,
|
|
9079
9475
|
sourceZone: zoneCompound
|
|
9080
9476
|
});
|
|
9081
9477
|
}, [index, zoneCompound, dispatch]);
|
|
9082
|
-
const onDelete = (0,
|
|
9478
|
+
const onDelete = (0, import_react59.useCallback)(() => {
|
|
9083
9479
|
dispatch({
|
|
9084
9480
|
type: "remove",
|
|
9085
9481
|
index,
|
|
9086
9482
|
zone: zoneCompound
|
|
9087
9483
|
});
|
|
9088
9484
|
}, [index, zoneCompound, dispatch]);
|
|
9089
|
-
const [hover, setHover] = (0,
|
|
9485
|
+
const [hover, setHover] = (0, import_react59.useState)(false);
|
|
9090
9486
|
const indicativeHover = useContextStore(
|
|
9091
9487
|
ZoneStoreContext,
|
|
9092
9488
|
(s) => s.hoveringComponent === id
|
|
9093
9489
|
);
|
|
9094
|
-
(0,
|
|
9490
|
+
(0, import_react59.useEffect)(() => {
|
|
9095
9491
|
if (!ref.current) {
|
|
9096
9492
|
return;
|
|
9097
9493
|
}
|
|
@@ -9138,10 +9534,10 @@ var DraggableComponent = ({
|
|
|
9138
9534
|
zoneStore,
|
|
9139
9535
|
id
|
|
9140
9536
|
]);
|
|
9141
|
-
const [isVisible, setIsVisible] = (0,
|
|
9142
|
-
const [dragFinished, setDragFinished] = (0,
|
|
9143
|
-
const [_, startTransition] = (0,
|
|
9144
|
-
(0,
|
|
9537
|
+
const [isVisible, setIsVisible] = (0, import_react59.useState)(false);
|
|
9538
|
+
const [dragFinished, setDragFinished] = (0, import_react59.useState)(true);
|
|
9539
|
+
const [_, startTransition] = (0, import_react59.useTransition)();
|
|
9540
|
+
(0, import_react59.useEffect)(() => {
|
|
9145
9541
|
startTransition(() => {
|
|
9146
9542
|
if (hover || indicativeHover || isSelected) {
|
|
9147
9543
|
scheduleSync();
|
|
@@ -9152,9 +9548,9 @@ var DraggableComponent = ({
|
|
|
9152
9548
|
}
|
|
9153
9549
|
});
|
|
9154
9550
|
}, [hover, indicativeHover, isSelected, iframe, scheduleSync]);
|
|
9155
|
-
const [thisWasDragging, setThisWasDragging] = (0,
|
|
9551
|
+
const [thisWasDragging, setThisWasDragging] = (0, import_react59.useState)(false);
|
|
9156
9552
|
const onDragFinished = useOnDragFinished(
|
|
9157
|
-
(0,
|
|
9553
|
+
(0, import_react59.useCallback)(
|
|
9158
9554
|
(finished) => {
|
|
9159
9555
|
if (finished) {
|
|
9160
9556
|
startTransition(() => {
|
|
@@ -9168,15 +9564,15 @@ var DraggableComponent = ({
|
|
|
9168
9564
|
[sync, startTransition]
|
|
9169
9565
|
)
|
|
9170
9566
|
);
|
|
9171
|
-
(0,
|
|
9567
|
+
(0, import_react59.useEffect)(() => {
|
|
9172
9568
|
if (thisIsDragging) {
|
|
9173
9569
|
setThisWasDragging(true);
|
|
9174
9570
|
}
|
|
9175
9571
|
}, [thisIsDragging]);
|
|
9176
|
-
(0,
|
|
9572
|
+
(0, import_react59.useEffect)(() => {
|
|
9177
9573
|
if (thisWasDragging) return onDragFinished();
|
|
9178
9574
|
}, [thisWasDragging, onDragFinished]);
|
|
9179
|
-
(0,
|
|
9575
|
+
(0, import_react59.useEffect)(() => {
|
|
9180
9576
|
if (!dragFinished || !(isSelected || thisIsDragging)) return;
|
|
9181
9577
|
const el = ref.current;
|
|
9182
9578
|
if (!el) return;
|
|
@@ -9213,7 +9609,7 @@ var DraggableComponent = ({
|
|
|
9213
9609
|
cancelAnimationFrame(frame);
|
|
9214
9610
|
};
|
|
9215
9611
|
}, [dragFinished, isSelected, thisIsDragging, scheduleSync]);
|
|
9216
|
-
const syncActionsPosition = (0,
|
|
9612
|
+
const syncActionsPosition = (0, import_react59.useCallback)(
|
|
9217
9613
|
(el) => {
|
|
9218
9614
|
if (el) {
|
|
9219
9615
|
const view = el.ownerDocument.defaultView;
|
|
@@ -9238,7 +9634,7 @@ var DraggableComponent = ({
|
|
|
9238
9634
|
},
|
|
9239
9635
|
[]
|
|
9240
9636
|
);
|
|
9241
|
-
(0,
|
|
9637
|
+
(0, import_react59.useEffect)(() => {
|
|
9242
9638
|
if (userDragAxis) {
|
|
9243
9639
|
setDragAxis(userDragAxis);
|
|
9244
9640
|
return;
|
|
@@ -9252,11 +9648,11 @@ var DraggableComponent = ({
|
|
|
9252
9648
|
}
|
|
9253
9649
|
setDragAxis(autoDragAxis);
|
|
9254
9650
|
}, [ref, userDragAxis, autoDragAxis]);
|
|
9255
|
-
const parentAction = (0,
|
|
9256
|
-
() => ctx?.areaId && ctx?.areaId !== "root" && /* @__PURE__ */ (0,
|
|
9651
|
+
const parentAction = (0, import_react59.useMemo)(
|
|
9652
|
+
() => ctx?.areaId && ctx?.areaId !== "root" && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(ActionBar.Action, { onClick: onSelectParent, label: "Select parent", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(CornerLeftUp, { size: 16 }) }),
|
|
9257
9653
|
[ctx?.areaId, onSelectParent]
|
|
9258
9654
|
);
|
|
9259
|
-
const nextContextValue = (0,
|
|
9655
|
+
const nextContextValue = (0, import_react59.useMemo)(
|
|
9260
9656
|
() => ({
|
|
9261
9657
|
...ctx,
|
|
9262
9658
|
areaId: id,
|
|
@@ -9280,9 +9676,9 @@ var DraggableComponent = ({
|
|
|
9280
9676
|
(s) => s.currentRichText?.inlineComponentId === id ? s.currentRichText : null
|
|
9281
9677
|
);
|
|
9282
9678
|
const hasNormalActions = permissions.duplicate || permissions.delete;
|
|
9283
|
-
return /* @__PURE__ */ (0,
|
|
9679
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(DropZoneProvider, { value: nextContextValue, children: [
|
|
9284
9680
|
dragFinished && isVisible && (0, import_react_dom2.createPortal)(
|
|
9285
|
-
/* @__PURE__ */ (0,
|
|
9681
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
9286
9682
|
"div",
|
|
9287
9683
|
{
|
|
9288
9684
|
className: getClassName22({
|
|
@@ -9294,15 +9690,15 @@ var DraggableComponent = ({
|
|
|
9294
9690
|
"data-credbuild-overlay": true,
|
|
9295
9691
|
children: [
|
|
9296
9692
|
debug,
|
|
9297
|
-
isLoading && /* @__PURE__ */ (0,
|
|
9298
|
-
/* @__PURE__ */ (0,
|
|
9693
|
+
isLoading && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: getClassName22("loadingOverlay"), children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Loader, {}) }),
|
|
9694
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9299
9695
|
"div",
|
|
9300
9696
|
{
|
|
9301
9697
|
className: getClassName22("actionsOverlay"),
|
|
9302
9698
|
style: {
|
|
9303
9699
|
top: actionsOverlayTop / zoom
|
|
9304
9700
|
},
|
|
9305
|
-
children: /* @__PURE__ */ (0,
|
|
9701
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9306
9702
|
"div",
|
|
9307
9703
|
{
|
|
9308
9704
|
className: getClassName22("actions"),
|
|
@@ -9314,14 +9710,14 @@ var DraggableComponent = ({
|
|
|
9314
9710
|
paddingRight: actionsSide
|
|
9315
9711
|
},
|
|
9316
9712
|
ref: syncActionsPosition,
|
|
9317
|
-
children: /* @__PURE__ */ (0,
|
|
9713
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
9318
9714
|
CustomActionBar,
|
|
9319
9715
|
{
|
|
9320
9716
|
parentAction,
|
|
9321
9717
|
label: DEBUG2 ? id : label,
|
|
9322
9718
|
children: [
|
|
9323
|
-
richText && /* @__PURE__ */ (0,
|
|
9324
|
-
/* @__PURE__ */ (0,
|
|
9719
|
+
richText && /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_jsx_runtime61.Fragment, { children: [
|
|
9720
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9325
9721
|
LoadedRichTextMenu,
|
|
9326
9722
|
{
|
|
9327
9723
|
editor: richText.editor,
|
|
@@ -9330,10 +9726,10 @@ var DraggableComponent = ({
|
|
|
9330
9726
|
readOnly: false
|
|
9331
9727
|
}
|
|
9332
9728
|
),
|
|
9333
|
-
hasNormalActions && /* @__PURE__ */ (0,
|
|
9729
|
+
hasNormalActions && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(ActionBar.Separator, {})
|
|
9334
9730
|
] }),
|
|
9335
|
-
permissions.duplicate && /* @__PURE__ */ (0,
|
|
9336
|
-
permissions.delete && /* @__PURE__ */ (0,
|
|
9731
|
+
permissions.duplicate && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(ActionBar.Action, { onClick: onDuplicate, label: "Duplicate", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Copy, { size: 16 }) }),
|
|
9732
|
+
permissions.delete && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(ActionBar.Action, { onClick: onDelete, label: "Delete", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Trash, { size: 16 }) })
|
|
9337
9733
|
]
|
|
9338
9734
|
}
|
|
9339
9735
|
)
|
|
@@ -9341,14 +9737,14 @@ var DraggableComponent = ({
|
|
|
9341
9737
|
)
|
|
9342
9738
|
}
|
|
9343
9739
|
),
|
|
9344
|
-
/* @__PURE__ */ (0,
|
|
9740
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: getClassName22("overlayWrapper"), children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9345
9741
|
CustomOverlay,
|
|
9346
9742
|
{
|
|
9347
9743
|
componentId: id,
|
|
9348
9744
|
componentType,
|
|
9349
9745
|
hover,
|
|
9350
9746
|
isSelected,
|
|
9351
|
-
children: /* @__PURE__ */ (0,
|
|
9747
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: getClassName22("overlay") })
|
|
9352
9748
|
}
|
|
9353
9749
|
) })
|
|
9354
9750
|
]
|
|
@@ -9371,12 +9767,12 @@ var styles_module_default16 = { "DropZone": "_DropZone_1vmgt_1", "DropZone--hasC
|
|
|
9371
9767
|
|
|
9372
9768
|
// components/DropZone/index.tsx
|
|
9373
9769
|
init_store2();
|
|
9374
|
-
var
|
|
9770
|
+
var import_react76 = require("@dnd-kit/react");
|
|
9375
9771
|
var import_collision2 = require("@dnd-kit/collision");
|
|
9376
9772
|
|
|
9377
9773
|
// components/DropZone/lib/use-min-empty-height.ts
|
|
9378
9774
|
init_react_import();
|
|
9379
|
-
var
|
|
9775
|
+
var import_react60 = require("react");
|
|
9380
9776
|
init_use_context_store();
|
|
9381
9777
|
init_store2();
|
|
9382
9778
|
var getNumItems = (appStore, zoneCompound) => appStore.getState().state.indexes.zones[zoneCompound].contentIds.length;
|
|
@@ -9386,17 +9782,17 @@ var useMinEmptyHeight = ({
|
|
|
9386
9782
|
ref
|
|
9387
9783
|
}) => {
|
|
9388
9784
|
const appStore = useAppStoreApi();
|
|
9389
|
-
const [prevHeight, setPrevHeight] = (0,
|
|
9390
|
-
const [isAnimating, setIsAnimating] = (0,
|
|
9785
|
+
const [prevHeight, setPrevHeight] = (0, import_react60.useState)(0);
|
|
9786
|
+
const [isAnimating, setIsAnimating] = (0, import_react60.useState)(false);
|
|
9391
9787
|
const { draggedItem, isZone } = useContextStore(ZoneStoreContext, (s) => {
|
|
9392
9788
|
return {
|
|
9393
9789
|
draggedItem: s.draggedItem?.data.zone === zoneCompound ? s.draggedItem : null,
|
|
9394
9790
|
isZone: s.draggedItem?.data.zone === zoneCompound
|
|
9395
9791
|
};
|
|
9396
9792
|
});
|
|
9397
|
-
const numItems = (0,
|
|
9793
|
+
const numItems = (0, import_react60.useRef)(0);
|
|
9398
9794
|
const onDragFinished = useOnDragFinished(
|
|
9399
|
-
(0,
|
|
9795
|
+
(0, import_react60.useCallback)(
|
|
9400
9796
|
(finished) => {
|
|
9401
9797
|
if (finished) {
|
|
9402
9798
|
const newNumItems = getNumItems(appStore, zoneCompound);
|
|
@@ -9425,7 +9821,7 @@ var useMinEmptyHeight = ({
|
|
|
9425
9821
|
[appStore, zoneCompound]
|
|
9426
9822
|
)
|
|
9427
9823
|
);
|
|
9428
|
-
(0,
|
|
9824
|
+
(0, import_react60.useEffect)(() => {
|
|
9429
9825
|
if (draggedItem && ref.current) {
|
|
9430
9826
|
if (isZone) {
|
|
9431
9827
|
const rect = ref.current.getBoundingClientRect();
|
|
@@ -9442,15 +9838,15 @@ var useMinEmptyHeight = ({
|
|
|
9442
9838
|
|
|
9443
9839
|
// components/DropZone/lib/use-content-with-preview.ts
|
|
9444
9840
|
init_react_import();
|
|
9445
|
-
var
|
|
9841
|
+
var import_react63 = require("react");
|
|
9446
9842
|
|
|
9447
9843
|
// lib/dnd/use-rendered-callback.ts
|
|
9448
9844
|
init_react_import();
|
|
9449
|
-
var
|
|
9450
|
-
var
|
|
9845
|
+
var import_react61 = require("@dnd-kit/react");
|
|
9846
|
+
var import_react62 = require("react");
|
|
9451
9847
|
function useRenderedCallback(callback, _deps = []) {
|
|
9452
|
-
const manager = (0,
|
|
9453
|
-
return (0,
|
|
9848
|
+
const manager = (0, import_react61.useDragDropManager)();
|
|
9849
|
+
return (0, import_react62.useCallback)(
|
|
9454
9850
|
async (...args) => {
|
|
9455
9851
|
await manager?.renderer.rendering;
|
|
9456
9852
|
return callback(...args);
|
|
@@ -9464,18 +9860,18 @@ init_insert();
|
|
|
9464
9860
|
init_use_context_store();
|
|
9465
9861
|
init_store2();
|
|
9466
9862
|
var useContentIdsWithPreview = (contentIds, zoneCompound) => {
|
|
9467
|
-
const zoneStore = (0,
|
|
9863
|
+
const zoneStore = (0, import_react63.useContext)(ZoneStoreContext);
|
|
9468
9864
|
const preview = useContextStore(
|
|
9469
9865
|
ZoneStoreContext,
|
|
9470
9866
|
(s) => s.previewIndex[zoneCompound]
|
|
9471
9867
|
);
|
|
9472
9868
|
const isDragging = useAppStore((s) => s.state.ui.isDragging);
|
|
9473
|
-
const [contentIdsWithPreview, setContentIdsWithPreview] = (0,
|
|
9474
|
-
const [localPreview, setLocalPreview] = (0,
|
|
9869
|
+
const [contentIdsWithPreview, setContentIdsWithPreview] = (0, import_react63.useState)(contentIds);
|
|
9870
|
+
const [localPreview, setLocalPreview] = (0, import_react63.useState)(
|
|
9475
9871
|
preview
|
|
9476
9872
|
);
|
|
9477
9873
|
const updateContent = useRenderedCallback(
|
|
9478
|
-
(0,
|
|
9874
|
+
(0, import_react63.useCallback)(
|
|
9479
9875
|
(contentIds2, preview2, isDragging2, draggedItemId, previewExists) => {
|
|
9480
9876
|
if (isDragging2 && !previewExists) {
|
|
9481
9877
|
return;
|
|
@@ -9508,7 +9904,7 @@ var useContentIdsWithPreview = (contentIds, zoneCompound) => {
|
|
|
9508
9904
|
[]
|
|
9509
9905
|
)
|
|
9510
9906
|
);
|
|
9511
|
-
(0,
|
|
9907
|
+
(0, import_react63.useEffect)(() => {
|
|
9512
9908
|
const s = zoneStore.getState();
|
|
9513
9909
|
const draggedItemId = s.draggedItem?.id;
|
|
9514
9910
|
const previewExists = Object.keys(s.previewIndex || {}).length > 0;
|
|
@@ -9525,17 +9921,17 @@ var useContentIdsWithPreview = (contentIds, zoneCompound) => {
|
|
|
9525
9921
|
|
|
9526
9922
|
// components/DropZone/lib/use-drag-axis.ts
|
|
9527
9923
|
init_react_import();
|
|
9528
|
-
var
|
|
9924
|
+
var import_react64 = require("react");
|
|
9529
9925
|
init_store2();
|
|
9530
9926
|
var GRID_DRAG_AXIS = "dynamic";
|
|
9531
9927
|
var FLEX_ROW_DRAG_AXIS = "x";
|
|
9532
9928
|
var DEFAULT_DRAG_AXIS = "y";
|
|
9533
9929
|
var useDragAxis = (ref, collisionAxis) => {
|
|
9534
9930
|
const status = useAppStore((s) => s.status);
|
|
9535
|
-
const [dragAxis, setDragAxis] = (0,
|
|
9931
|
+
const [dragAxis, setDragAxis] = (0, import_react64.useState)(
|
|
9536
9932
|
collisionAxis || DEFAULT_DRAG_AXIS
|
|
9537
9933
|
);
|
|
9538
|
-
const calculateDragAxis = (0,
|
|
9934
|
+
const calculateDragAxis = (0, import_react64.useCallback)(() => {
|
|
9539
9935
|
if (ref.current) {
|
|
9540
9936
|
const computedStyle = window.getComputedStyle(ref.current);
|
|
9541
9937
|
if (computedStyle.display === "grid") {
|
|
@@ -9547,7 +9943,7 @@ var useDragAxis = (ref, collisionAxis) => {
|
|
|
9547
9943
|
}
|
|
9548
9944
|
}
|
|
9549
9945
|
}, [ref]);
|
|
9550
|
-
(0,
|
|
9946
|
+
(0, import_react64.useEffect)(() => {
|
|
9551
9947
|
const onViewportChange = () => {
|
|
9552
9948
|
calculateDragAxis();
|
|
9553
9949
|
};
|
|
@@ -9556,7 +9952,7 @@ var useDragAxis = (ref, collisionAxis) => {
|
|
|
9556
9952
|
window.removeEventListener("viewportchange", onViewportChange);
|
|
9557
9953
|
};
|
|
9558
9954
|
}, [calculateDragAxis]);
|
|
9559
|
-
(0,
|
|
9955
|
+
(0, import_react64.useEffect)(calculateDragAxis, [status, collisionAxis, calculateDragAxis]);
|
|
9560
9956
|
return [dragAxis, calculateDragAxis];
|
|
9561
9957
|
};
|
|
9562
9958
|
|
|
@@ -9566,8 +9962,8 @@ var import_shallow6 = require("zustand/react/shallow");
|
|
|
9566
9962
|
|
|
9567
9963
|
// components/Render/context.tsx
|
|
9568
9964
|
init_react_import();
|
|
9569
|
-
var
|
|
9570
|
-
var renderContext =
|
|
9965
|
+
var import_react65 = __toESM(require("react"));
|
|
9966
|
+
var renderContext = import_react65.default.createContext({
|
|
9571
9967
|
config: { components: {} },
|
|
9572
9968
|
data: { root: {}, content: [] },
|
|
9573
9969
|
metadata: {}
|
|
@@ -9578,7 +9974,7 @@ init_react_import();
|
|
|
9578
9974
|
|
|
9579
9975
|
// lib/field-transforms/use-field-transforms.tsx
|
|
9580
9976
|
init_react_import();
|
|
9581
|
-
var
|
|
9977
|
+
var import_react66 = require("react");
|
|
9582
9978
|
init_map_fields();
|
|
9583
9979
|
|
|
9584
9980
|
// lib/field-transforms/build-mappers.ts
|
|
@@ -9607,14 +10003,14 @@ function buildMappers(transforms, readOnly, forceReadOnly) {
|
|
|
9607
10003
|
|
|
9608
10004
|
// lib/field-transforms/use-field-transforms.tsx
|
|
9609
10005
|
function useFieldTransforms(config, item, transforms, readOnly, forceReadOnly) {
|
|
9610
|
-
const mappers = (0,
|
|
10006
|
+
const mappers = (0, import_react66.useMemo)(
|
|
9611
10007
|
() => buildMappers(transforms, readOnly, forceReadOnly),
|
|
9612
10008
|
[transforms, readOnly, forceReadOnly]
|
|
9613
10009
|
);
|
|
9614
|
-
const transformedProps = (0,
|
|
10010
|
+
const transformedProps = (0, import_react66.useMemo)(() => {
|
|
9615
10011
|
return mapFields(item, mappers, config).props;
|
|
9616
10012
|
}, [config, item, mappers]);
|
|
9617
|
-
const mergedProps = (0,
|
|
10013
|
+
const mergedProps = (0, import_react66.useMemo)(
|
|
9618
10014
|
() => ({ ...item.props, ...transformedProps }),
|
|
9619
10015
|
[item.props, transformedProps]
|
|
9620
10016
|
);
|
|
@@ -9655,20 +10051,20 @@ init_store2();
|
|
|
9655
10051
|
|
|
9656
10052
|
// components/SlotRender/server.tsx
|
|
9657
10053
|
init_react_import();
|
|
9658
|
-
var
|
|
10054
|
+
var import_react69 = require("react");
|
|
9659
10055
|
|
|
9660
10056
|
// components/RichTextEditor/lib/use-richtext-props.tsx
|
|
9661
10057
|
init_react_import();
|
|
9662
|
-
var
|
|
10058
|
+
var import_react68 = require("react");
|
|
9663
10059
|
|
|
9664
10060
|
// components/RichTextEditor/components/RenderFallback.tsx
|
|
9665
10061
|
init_react_import();
|
|
9666
10062
|
init_get_class_name_factory();
|
|
9667
10063
|
init_styles_module10();
|
|
9668
|
-
var
|
|
10064
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
9669
10065
|
var getClassName23 = get_class_name_factory_default("RichTextEditor", styles_module_default10);
|
|
9670
10066
|
function RichTextRenderFallback({ content }) {
|
|
9671
|
-
return /* @__PURE__ */ (0,
|
|
10067
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: getClassName23(), children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
9672
10068
|
"div",
|
|
9673
10069
|
{
|
|
9674
10070
|
className: "rich-text",
|
|
@@ -9700,7 +10096,7 @@ var mapDeep = (source, path, render) => {
|
|
|
9700
10096
|
};
|
|
9701
10097
|
|
|
9702
10098
|
// components/RichTextEditor/lib/use-richtext-props.tsx
|
|
9703
|
-
var
|
|
10099
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
9704
10100
|
var findAllRichtextKeys = (fields, path = []) => {
|
|
9705
10101
|
if (!fields) return [];
|
|
9706
10102
|
const result = [];
|
|
@@ -9722,21 +10118,21 @@ var findAllRichtextKeys = (fields, path = []) => {
|
|
|
9722
10118
|
return result;
|
|
9723
10119
|
};
|
|
9724
10120
|
function useRichtextProps(fields, props) {
|
|
9725
|
-
const richtextKeys = (0,
|
|
9726
|
-
const richtextProps = (0,
|
|
10121
|
+
const richtextKeys = (0, import_react68.useMemo)(() => findAllRichtextKeys(fields), [fields]);
|
|
10122
|
+
const richtextProps = (0, import_react68.useMemo)(() => {
|
|
9727
10123
|
if (!richtextKeys?.length) return {};
|
|
9728
|
-
const RichTextRender3 = (0,
|
|
10124
|
+
const RichTextRender3 = (0, import_react68.lazy)(
|
|
9729
10125
|
() => Promise.resolve().then(() => (init_Render(), Render_exports)).then((m) => ({
|
|
9730
10126
|
default: m.RichTextRender
|
|
9731
10127
|
}))
|
|
9732
10128
|
);
|
|
9733
10129
|
let result = { ...props };
|
|
9734
10130
|
for (const { path, field } of richtextKeys) {
|
|
9735
|
-
result = mapDeep(result, path, (content) => /* @__PURE__ */ (0,
|
|
9736
|
-
|
|
10131
|
+
result = mapDeep(result, path, (content) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
10132
|
+
import_react68.Suspense,
|
|
9737
10133
|
{
|
|
9738
|
-
fallback: /* @__PURE__ */ (0,
|
|
9739
|
-
children: /* @__PURE__ */ (0,
|
|
10134
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(RichTextRenderFallback, { content }),
|
|
10135
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(RichTextRender3, { content, field })
|
|
9740
10136
|
},
|
|
9741
10137
|
generateId()
|
|
9742
10138
|
));
|
|
@@ -9747,17 +10143,17 @@ function useRichtextProps(fields, props) {
|
|
|
9747
10143
|
}
|
|
9748
10144
|
|
|
9749
10145
|
// components/SlotRender/server.tsx
|
|
9750
|
-
var
|
|
9751
|
-
var SlotRenderPure = (props) => /* @__PURE__ */ (0,
|
|
10146
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
10147
|
+
var SlotRenderPure = (props) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(SlotRender, { ...props });
|
|
9752
10148
|
var Item2 = ({
|
|
9753
10149
|
config,
|
|
9754
10150
|
item,
|
|
9755
10151
|
metadata
|
|
9756
10152
|
}) => {
|
|
9757
10153
|
const Component = config.components[item.type];
|
|
9758
|
-
const props = useSlots(config, item, (slotProps) => /* @__PURE__ */ (0,
|
|
10154
|
+
const props = useSlots(config, item, (slotProps) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(SlotRenderPure, { ...slotProps, config, metadata }));
|
|
9759
10155
|
const richtextProps = useRichtextProps(Component.fields, props);
|
|
9760
|
-
return /* @__PURE__ */ (0,
|
|
10156
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
9761
10157
|
Component.render,
|
|
9762
10158
|
{
|
|
9763
10159
|
...props,
|
|
@@ -9769,14 +10165,14 @@ var Item2 = ({
|
|
|
9769
10165
|
}
|
|
9770
10166
|
);
|
|
9771
10167
|
};
|
|
9772
|
-
var SlotRender = (0,
|
|
10168
|
+
var SlotRender = (0, import_react69.forwardRef)(
|
|
9773
10169
|
function SlotRenderInternal({ className, style, content, config, metadata, as }, ref) {
|
|
9774
10170
|
const El = as ?? "div";
|
|
9775
|
-
return /* @__PURE__ */ (0,
|
|
10171
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(El, { className, style, ref, children: content.map((item) => {
|
|
9776
10172
|
if (!config.components[item.type]) {
|
|
9777
10173
|
return null;
|
|
9778
10174
|
}
|
|
9779
|
-
return /* @__PURE__ */ (0,
|
|
10175
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
9780
10176
|
Item2,
|
|
9781
10177
|
{
|
|
9782
10178
|
config,
|
|
@@ -9790,7 +10186,7 @@ var SlotRender = (0, import_react67.forwardRef)(
|
|
|
9790
10186
|
);
|
|
9791
10187
|
|
|
9792
10188
|
// components/SlotRender/index.tsx
|
|
9793
|
-
var
|
|
10189
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
9794
10190
|
var ContextSlotRender = ({
|
|
9795
10191
|
componentId,
|
|
9796
10192
|
zone
|
|
@@ -9804,7 +10200,7 @@ var ContextSlotRender = ({
|
|
|
9804
10200
|
return contentIds.map((contentId) => indexes.nodes[contentId].flatData);
|
|
9805
10201
|
})
|
|
9806
10202
|
);
|
|
9807
|
-
return /* @__PURE__ */ (0,
|
|
10203
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
9808
10204
|
SlotRenderPure,
|
|
9809
10205
|
{
|
|
9810
10206
|
content: slotContent,
|
|
@@ -9820,16 +10216,16 @@ init_flatten_node();
|
|
|
9820
10216
|
|
|
9821
10217
|
// lib/field-transforms/use-field-transforms-tracked.tsx
|
|
9822
10218
|
init_react_import();
|
|
9823
|
-
var
|
|
10219
|
+
var import_react70 = require("react");
|
|
9824
10220
|
init_map_fields();
|
|
9825
10221
|
function useFieldTransformsTracked(config, item, transforms, readOnly, forceReadOnly) {
|
|
9826
|
-
const prevProps = (0,
|
|
9827
|
-
const prevResult = (0,
|
|
9828
|
-
const mappers = (0,
|
|
10222
|
+
const prevProps = (0, import_react70.useRef)(null);
|
|
10223
|
+
const prevResult = (0, import_react70.useRef)(item.props);
|
|
10224
|
+
const mappers = (0, import_react70.useMemo)(
|
|
9829
10225
|
() => buildMappers(transforms, readOnly, forceReadOnly),
|
|
9830
10226
|
[transforms, readOnly, forceReadOnly]
|
|
9831
10227
|
);
|
|
9832
|
-
const transformedProps = (0,
|
|
10228
|
+
const transformedProps = (0, import_react70.useMemo)(() => {
|
|
9833
10229
|
const changedProps = {};
|
|
9834
10230
|
const componentConfig = item.type === "root" ? config.root : config.components?.[item.type];
|
|
9835
10231
|
let changeIncludesSlot = false;
|
|
@@ -9854,7 +10250,7 @@ function useFieldTransformsTracked(config, item, transforms, readOnly, forceRead
|
|
|
9854
10250
|
prevResult.current = { ...prevResult.current, ...mapped };
|
|
9855
10251
|
return prevResult.current;
|
|
9856
10252
|
}, [config, item, mappers]);
|
|
9857
|
-
const mergedProps = (0,
|
|
10253
|
+
const mergedProps = (0, import_react70.useMemo)(
|
|
9858
10254
|
() => ({ ...item.props, ...transformedProps }),
|
|
9859
10255
|
[item.props, transformedProps]
|
|
9860
10256
|
);
|
|
@@ -9866,7 +10262,7 @@ init_react_import();
|
|
|
9866
10262
|
|
|
9867
10263
|
// components/InlineTextField/index.tsx
|
|
9868
10264
|
init_react_import();
|
|
9869
|
-
var
|
|
10265
|
+
var import_react71 = require("react");
|
|
9870
10266
|
|
|
9871
10267
|
// lib/overlay-portal/index.tsx
|
|
9872
10268
|
init_react_import();
|
|
@@ -9938,7 +10334,7 @@ var getSelectorForId = (state, id) => {
|
|
|
9938
10334
|
};
|
|
9939
10335
|
|
|
9940
10336
|
// components/InlineTextField/index.tsx
|
|
9941
|
-
var
|
|
10337
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
9942
10338
|
var getClassName25 = get_class_name_factory_default("InlineTextField", styles_module_default17);
|
|
9943
10339
|
var InlineTextFieldInternal = ({
|
|
9944
10340
|
propPath,
|
|
@@ -9947,10 +10343,10 @@ var InlineTextFieldInternal = ({
|
|
|
9947
10343
|
isReadOnly,
|
|
9948
10344
|
opts = {}
|
|
9949
10345
|
}) => {
|
|
9950
|
-
const ref = (0,
|
|
10346
|
+
const ref = (0, import_react71.useRef)(null);
|
|
9951
10347
|
const appStoreApi = useAppStoreApi();
|
|
9952
10348
|
const disableLineBreaks = opts.disableLineBreaks ?? false;
|
|
9953
|
-
(0,
|
|
10349
|
+
(0, import_react71.useEffect)(() => {
|
|
9954
10350
|
const appStore = appStoreApi.getState();
|
|
9955
10351
|
const data = appStore.state.indexes.nodes[componentId].data;
|
|
9956
10352
|
const componentConfig = appStore.getComponentConfig(data.type);
|
|
@@ -9995,9 +10391,9 @@ var InlineTextFieldInternal = ({
|
|
|
9995
10391
|
};
|
|
9996
10392
|
}
|
|
9997
10393
|
}, [appStoreApi, ref, value, disableLineBreaks, componentId, propPath]);
|
|
9998
|
-
const [isHovering, setIsHovering] = (0,
|
|
9999
|
-
const [isFocused, setIsFocused] = (0,
|
|
10000
|
-
return /* @__PURE__ */ (0,
|
|
10394
|
+
const [isHovering, setIsHovering] = (0, import_react71.useState)(false);
|
|
10395
|
+
const [isFocused, setIsFocused] = (0, import_react71.useState)(false);
|
|
10396
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
10001
10397
|
"span",
|
|
10002
10398
|
{
|
|
10003
10399
|
className: getClassName25(),
|
|
@@ -10033,14 +10429,14 @@ var InlineTextFieldInternal = ({
|
|
|
10033
10429
|
}
|
|
10034
10430
|
);
|
|
10035
10431
|
};
|
|
10036
|
-
var InlineTextField = (0,
|
|
10432
|
+
var InlineTextField = (0, import_react71.memo)(InlineTextFieldInternal);
|
|
10037
10433
|
|
|
10038
10434
|
// lib/field-transforms/default-transforms/inline-text-transform.tsx
|
|
10039
|
-
var
|
|
10435
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
10040
10436
|
var getInlineTextTransform = () => ({
|
|
10041
10437
|
text: ({ value, componentId, field, propPath, isReadOnly }) => {
|
|
10042
10438
|
if (field.contentEditable) {
|
|
10043
|
-
return /* @__PURE__ */ (0,
|
|
10439
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
10044
10440
|
InlineTextField,
|
|
10045
10441
|
{
|
|
10046
10442
|
propPath,
|
|
@@ -10055,7 +10451,7 @@ var getInlineTextTransform = () => ({
|
|
|
10055
10451
|
},
|
|
10056
10452
|
textarea: ({ value, componentId, field, propPath, isReadOnly }) => {
|
|
10057
10453
|
if (field.contentEditable) {
|
|
10058
|
-
return /* @__PURE__ */ (0,
|
|
10454
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
10059
10455
|
InlineTextField,
|
|
10060
10456
|
{
|
|
10061
10457
|
propPath,
|
|
@@ -10069,7 +10465,7 @@ var getInlineTextTransform = () => ({
|
|
|
10069
10465
|
},
|
|
10070
10466
|
custom: ({ value, componentId, field, propPath, isReadOnly }) => {
|
|
10071
10467
|
if (field.contentEditable && typeof value === "string") {
|
|
10072
|
-
return /* @__PURE__ */ (0,
|
|
10468
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
10073
10469
|
InlineTextField,
|
|
10074
10470
|
{
|
|
10075
10471
|
propPath,
|
|
@@ -10088,19 +10484,19 @@ init_react_import();
|
|
|
10088
10484
|
init_EditorFallback();
|
|
10089
10485
|
init_store2();
|
|
10090
10486
|
init_set_deep();
|
|
10091
|
-
var
|
|
10092
|
-
var
|
|
10093
|
-
var Editor3 = (0,
|
|
10487
|
+
var import_react72 = require("react");
|
|
10488
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
10489
|
+
var Editor3 = (0, import_react72.lazy)(
|
|
10094
10490
|
() => Promise.resolve().then(() => (init_Editor(), Editor_exports)).then((m) => ({
|
|
10095
10491
|
default: m.Editor
|
|
10096
10492
|
}))
|
|
10097
10493
|
);
|
|
10098
|
-
var RichTextRender2 = (0,
|
|
10494
|
+
var RichTextRender2 = (0, import_react72.lazy)(
|
|
10099
10495
|
() => Promise.resolve().then(() => (init_Render(), Render_exports)).then((m) => ({
|
|
10100
10496
|
default: m.RichTextRender
|
|
10101
10497
|
}))
|
|
10102
10498
|
);
|
|
10103
|
-
var InlineEditorWrapper = (0,
|
|
10499
|
+
var InlineEditorWrapper = (0, import_react72.memo)(
|
|
10104
10500
|
({
|
|
10105
10501
|
value,
|
|
10106
10502
|
componentId,
|
|
@@ -10108,7 +10504,7 @@ var InlineEditorWrapper = (0, import_react70.memo)(
|
|
|
10108
10504
|
field,
|
|
10109
10505
|
id
|
|
10110
10506
|
}) => {
|
|
10111
|
-
const portalRef = (0,
|
|
10507
|
+
const portalRef = (0, import_react72.useRef)(null);
|
|
10112
10508
|
const appStoreApi = useAppStoreApi();
|
|
10113
10509
|
const onClickHandler = (e) => {
|
|
10114
10510
|
e.preventDefault();
|
|
@@ -10123,14 +10519,14 @@ var InlineEditorWrapper = (0, import_react70.memo)(
|
|
|
10123
10519
|
);
|
|
10124
10520
|
appStoreApi.getState().setUi({ itemSelector });
|
|
10125
10521
|
};
|
|
10126
|
-
(0,
|
|
10522
|
+
(0, import_react72.useEffect)(() => {
|
|
10127
10523
|
if (!portalRef.current) return;
|
|
10128
10524
|
const cleanup = registerOverlayPortal(portalRef.current, {
|
|
10129
10525
|
disableDragOnFocus: true
|
|
10130
10526
|
});
|
|
10131
10527
|
return () => cleanup?.();
|
|
10132
10528
|
}, []);
|
|
10133
|
-
const handleChange = (0,
|
|
10529
|
+
const handleChange = (0, import_react72.useCallback)(
|
|
10134
10530
|
async (content, ui) => {
|
|
10135
10531
|
const appStore = appStoreApi.getState();
|
|
10136
10532
|
const node = appStore.state.indexes.nodes[componentId];
|
|
@@ -10153,7 +10549,7 @@ var InlineEditorWrapper = (0, import_react70.memo)(
|
|
|
10153
10549
|
},
|
|
10154
10550
|
[appStoreApi, componentId, propPath]
|
|
10155
10551
|
);
|
|
10156
|
-
const handleFocus = (0,
|
|
10552
|
+
const handleFocus = (0, import_react72.useCallback)(
|
|
10157
10553
|
(editor) => {
|
|
10158
10554
|
appStoreApi.setState({
|
|
10159
10555
|
currentRichText: {
|
|
@@ -10168,7 +10564,7 @@ var InlineEditorWrapper = (0, import_react70.memo)(
|
|
|
10168
10564
|
[field, componentId, appStoreApi, id]
|
|
10169
10565
|
);
|
|
10170
10566
|
if (!field.contentEditable)
|
|
10171
|
-
return /* @__PURE__ */ (0,
|
|
10567
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react72.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(RichTextRenderFallback, { content: value }), children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(RichTextRender2, { content: value, field }) });
|
|
10172
10568
|
const editorProps = {
|
|
10173
10569
|
content: value,
|
|
10174
10570
|
onChange: handleChange,
|
|
@@ -10178,13 +10574,13 @@ var InlineEditorWrapper = (0, import_react70.memo)(
|
|
|
10178
10574
|
id,
|
|
10179
10575
|
name: propPath
|
|
10180
10576
|
};
|
|
10181
|
-
return /* @__PURE__ */ (0,
|
|
10577
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
10182
10578
|
"div",
|
|
10183
10579
|
{
|
|
10184
10580
|
ref: portalRef,
|
|
10185
10581
|
onClick: onClickHandler,
|
|
10186
10582
|
onClickCapture: onClickCaptureHandler,
|
|
10187
|
-
children: /* @__PURE__ */ (0,
|
|
10583
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react72.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(EditorFallback, { ...editorProps }), children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Editor3, { ...editorProps }) })
|
|
10188
10584
|
}
|
|
10189
10585
|
);
|
|
10190
10586
|
}
|
|
@@ -10194,10 +10590,10 @@ var getRichTextTransform = () => ({
|
|
|
10194
10590
|
richtext: ({ value, componentId, field, propPath, isReadOnly }) => {
|
|
10195
10591
|
const { contentEditable = true, tiptap } = field;
|
|
10196
10592
|
if (contentEditable === false || isReadOnly) {
|
|
10197
|
-
return /* @__PURE__ */ (0,
|
|
10593
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(RichTextRender2, { content: value, field });
|
|
10198
10594
|
}
|
|
10199
10595
|
const id = `${componentId}_${field.type}_${propPath}`;
|
|
10200
|
-
return /* @__PURE__ */ (0,
|
|
10596
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
10201
10597
|
InlineEditorWrapper,
|
|
10202
10598
|
{
|
|
10203
10599
|
value,
|
|
@@ -10214,7 +10610,7 @@ var getRichTextTransform = () => ({
|
|
|
10214
10610
|
// components/MemoizeComponent/index.tsx
|
|
10215
10611
|
init_react_import();
|
|
10216
10612
|
var import_fast_equals3 = require("fast-equals");
|
|
10217
|
-
var
|
|
10613
|
+
var import_react73 = require("react");
|
|
10218
10614
|
|
|
10219
10615
|
// lib/shallow-equal.ts
|
|
10220
10616
|
init_react_import();
|
|
@@ -10241,14 +10637,14 @@ function shallowEqual(obj1, obj2, keysToIgnore = []) {
|
|
|
10241
10637
|
}
|
|
10242
10638
|
|
|
10243
10639
|
// components/MemoizeComponent/index.tsx
|
|
10244
|
-
var
|
|
10640
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
10245
10641
|
var RenderComponent = ({
|
|
10246
10642
|
Component,
|
|
10247
10643
|
componentProps: renderProps
|
|
10248
10644
|
}) => {
|
|
10249
|
-
return /* @__PURE__ */ (0,
|
|
10645
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(Component, { ...renderProps });
|
|
10250
10646
|
};
|
|
10251
|
-
var MemoizeComponent = (0,
|
|
10647
|
+
var MemoizeComponent = (0, import_react73.memo)(RenderComponent, (prev, next) => {
|
|
10252
10648
|
let credbuildEquals = true;
|
|
10253
10649
|
if ("credbuild" in prev.componentProps && "credbuild" in next.componentProps) {
|
|
10254
10650
|
credbuildEquals = (0, import_fast_equals3.deepEqual)(prev.componentProps.credbuild, next.componentProps.credbuild);
|
|
@@ -10258,7 +10654,7 @@ var MemoizeComponent = (0, import_react71.memo)(RenderComponent, (prev, next) =>
|
|
|
10258
10654
|
|
|
10259
10655
|
// components/DropZone/VirtualizedDropZone.tsx
|
|
10260
10656
|
init_react_import();
|
|
10261
|
-
var
|
|
10657
|
+
var import_react74 = require("react");
|
|
10262
10658
|
init_store2();
|
|
10263
10659
|
var import_react_virtual = require("@tanstack/react-virtual");
|
|
10264
10660
|
init_use_context_store();
|
|
@@ -10275,7 +10671,7 @@ var getFrame = () => {
|
|
|
10275
10671
|
};
|
|
10276
10672
|
|
|
10277
10673
|
// components/DropZone/VirtualizedDropZone.tsx
|
|
10278
|
-
var
|
|
10674
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
10279
10675
|
var ROOT_ZONE_VIRTUALIZATION_OVERSCAN = 5;
|
|
10280
10676
|
var DEFAULT_VIRTUALIZED_ITEM_HEIGHT = 320;
|
|
10281
10677
|
var measuredItemHeights = /* @__PURE__ */ new Map();
|
|
@@ -10293,7 +10689,7 @@ var VirtualizedDropZone = ({
|
|
|
10293
10689
|
}) => {
|
|
10294
10690
|
const selectedId = useAppStore((s) => s.selectedItem?.props.id ?? null);
|
|
10295
10691
|
const frame = getFrame();
|
|
10296
|
-
const zoneStore = (0,
|
|
10692
|
+
const zoneStore = (0, import_react74.useContext)(ZoneStoreContext);
|
|
10297
10693
|
const draggedItemId = useContextStore(ZoneStoreContext, (s) => {
|
|
10298
10694
|
const draggedId = s.draggedItem?.id;
|
|
10299
10695
|
return draggedId ? String(draggedId) : null;
|
|
@@ -10306,9 +10702,9 @@ var VirtualizedDropZone = ({
|
|
|
10306
10702
|
return null;
|
|
10307
10703
|
});
|
|
10308
10704
|
const iframeWindow = frame?.defaultView;
|
|
10309
|
-
const measureRefsRef = (0,
|
|
10705
|
+
const measureRefsRef = (0, import_react74.useRef)(/* @__PURE__ */ new Map());
|
|
10310
10706
|
const appStoreApi = useAppStoreApi();
|
|
10311
|
-
const resolveIndex = (0,
|
|
10707
|
+
const resolveIndex = (0, import_react74.useCallback)(
|
|
10312
10708
|
(targetId) => {
|
|
10313
10709
|
if (!targetId || targetId === "root") {
|
|
10314
10710
|
return -1;
|
|
@@ -10332,7 +10728,7 @@ var VirtualizedDropZone = ({
|
|
|
10332
10728
|
},
|
|
10333
10729
|
[appStoreApi, contentIds]
|
|
10334
10730
|
);
|
|
10335
|
-
const pinnedIndexes = (0,
|
|
10731
|
+
const pinnedIndexes = (0, import_react74.useMemo)(() => {
|
|
10336
10732
|
const nextPinnedIndexes = /* @__PURE__ */ new Set();
|
|
10337
10733
|
[selectedId, draggedItemId, dragTargetParentId].forEach((targetId) => {
|
|
10338
10734
|
const currentIndex = resolveIndex(targetId);
|
|
@@ -10342,7 +10738,7 @@ var VirtualizedDropZone = ({
|
|
|
10342
10738
|
});
|
|
10343
10739
|
return Array.from(nextPinnedIndexes).sort((a, b) => a - b);
|
|
10344
10740
|
}, [dragTargetParentId, draggedItemId, resolveIndex, selectedId]);
|
|
10345
|
-
const rangeExtractor = (0,
|
|
10741
|
+
const rangeExtractor = (0, import_react74.useCallback)(
|
|
10346
10742
|
(range) => {
|
|
10347
10743
|
const indexes = (0, import_react_virtual.defaultRangeExtractor)(range);
|
|
10348
10744
|
pinnedIndexes.forEach((index) => {
|
|
@@ -10367,7 +10763,7 @@ var VirtualizedDropZone = ({
|
|
|
10367
10763
|
rangeExtractor,
|
|
10368
10764
|
initialOffset: () => iframeWindow ? iframeWindow.scrollY : 0
|
|
10369
10765
|
});
|
|
10370
|
-
(0,
|
|
10766
|
+
(0, import_react74.useEffect)(() => {
|
|
10371
10767
|
zoneStore.getState().registerRootVirtualizer(zoneCompound, {
|
|
10372
10768
|
resolveIndex: (targetId) => resolveIndex(targetId),
|
|
10373
10769
|
virtualizer
|
|
@@ -10376,7 +10772,7 @@ var VirtualizedDropZone = ({
|
|
|
10376
10772
|
zoneStore.getState().unregisterRootVirtualizer(zoneCompound);
|
|
10377
10773
|
};
|
|
10378
10774
|
}, [resolveIndex, virtualizer, zoneCompound, zoneStore]);
|
|
10379
|
-
const getMeasureRef = (0,
|
|
10775
|
+
const getMeasureRef = (0, import_react74.useCallback)((componentId) => {
|
|
10380
10776
|
const cachedRef = measureRefsRef.current.get(componentId);
|
|
10381
10777
|
if (cachedRef) {
|
|
10382
10778
|
return cachedRef;
|
|
@@ -10393,7 +10789,7 @@ var VirtualizedDropZone = ({
|
|
|
10393
10789
|
measureRefsRef.current.set(componentId, measureRef);
|
|
10394
10790
|
return measureRef;
|
|
10395
10791
|
}, []);
|
|
10396
|
-
(0,
|
|
10792
|
+
(0, import_react74.useEffect)(() => {
|
|
10397
10793
|
const validIds = new Set(contentIds);
|
|
10398
10794
|
Array.from(measureRefsRef.current.keys()).forEach((componentId) => {
|
|
10399
10795
|
if (!validIds.has(componentId)) {
|
|
@@ -10403,7 +10799,7 @@ var VirtualizedDropZone = ({
|
|
|
10403
10799
|
}, [contentIds]);
|
|
10404
10800
|
const virtualItems = virtualizer.getVirtualItems();
|
|
10405
10801
|
const totalSize = virtualizer.getTotalSize();
|
|
10406
|
-
const renderedItems = (0,
|
|
10802
|
+
const renderedItems = (0, import_react74.useMemo)(() => {
|
|
10407
10803
|
const items = [];
|
|
10408
10804
|
let previousEnd = 0;
|
|
10409
10805
|
let previousIndex = -1;
|
|
@@ -10413,7 +10809,7 @@ var VirtualizedDropZone = ({
|
|
|
10413
10809
|
const gapSize = Math.max(virtualItem.start - previousEnd, 0);
|
|
10414
10810
|
if (gapSize > 0) {
|
|
10415
10811
|
items.push(
|
|
10416
|
-
/* @__PURE__ */ (0,
|
|
10812
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
10417
10813
|
"div",
|
|
10418
10814
|
{
|
|
10419
10815
|
style: { height: `${gapSize}px` }
|
|
@@ -10435,7 +10831,7 @@ var VirtualizedDropZone = ({
|
|
|
10435
10831
|
const trailingGap = Math.max(totalSize - previousEnd, 0);
|
|
10436
10832
|
if (trailingGap > 0) {
|
|
10437
10833
|
items.push(
|
|
10438
|
-
/* @__PURE__ */ (0,
|
|
10834
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
10439
10835
|
"div",
|
|
10440
10836
|
{
|
|
10441
10837
|
style: { height: `${trailingGap}px` }
|
|
@@ -10446,11 +10842,11 @@ var VirtualizedDropZone = ({
|
|
|
10446
10842
|
}
|
|
10447
10843
|
return items;
|
|
10448
10844
|
}, [totalSize, virtualItems, getMeasureRef, contentIds, renderItem]);
|
|
10449
|
-
return /* @__PURE__ */ (0,
|
|
10845
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_jsx_runtime71.Fragment, { children: renderedItems });
|
|
10450
10846
|
};
|
|
10451
10847
|
|
|
10452
10848
|
// components/DropZone/index.tsx
|
|
10453
|
-
var
|
|
10849
|
+
var import_jsx_runtime72 = (
|
|
10454
10850
|
// Safe to use this since the HTML is set by the user
|
|
10455
10851
|
require("react/jsx-runtime")
|
|
10456
10852
|
);
|
|
@@ -10463,11 +10859,11 @@ var InsertPreview = ({
|
|
|
10463
10859
|
override
|
|
10464
10860
|
}) => {
|
|
10465
10861
|
if (element) {
|
|
10466
|
-
return /* @__PURE__ */ (0,
|
|
10862
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { dangerouslySetInnerHTML: { __html: element.outerHTML } });
|
|
10467
10863
|
}
|
|
10468
|
-
return /* @__PURE__ */ (0,
|
|
10864
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(DrawerItemInner, { name: label, children: override });
|
|
10469
10865
|
};
|
|
10470
|
-
var DropZoneEditPure = (props) => /* @__PURE__ */ (0,
|
|
10866
|
+
var DropZoneEditPure = (props) => /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(DropZoneEdit, { ...props });
|
|
10471
10867
|
var DropZoneChild = ({
|
|
10472
10868
|
zoneCompound,
|
|
10473
10869
|
componentId,
|
|
@@ -10478,9 +10874,9 @@ var DropZoneChild = ({
|
|
|
10478
10874
|
itemRef
|
|
10479
10875
|
}) => {
|
|
10480
10876
|
const metadata = useAppStore((s) => s.metadata);
|
|
10481
|
-
const ctx = (0,
|
|
10877
|
+
const ctx = (0, import_react75.useContext)(dropZoneContext);
|
|
10482
10878
|
const { depth = 1 } = ctx ?? {};
|
|
10483
|
-
const zoneStore = (0,
|
|
10879
|
+
const zoneStore = (0, import_react75.useContext)(ZoneStoreContext);
|
|
10484
10880
|
const nodeProps = useAppStore(
|
|
10485
10881
|
(0, import_shallow6.useShallow)((s) => {
|
|
10486
10882
|
return s.state.indexes.nodes[componentId]?.flatData.props;
|
|
@@ -10493,7 +10889,7 @@ var DropZoneChild = ({
|
|
|
10493
10889
|
(0, import_shallow6.useShallow)((s) => s.state.indexes.nodes[componentId]?.data.readOnly)
|
|
10494
10890
|
);
|
|
10495
10891
|
const appStore = useAppStoreApi();
|
|
10496
|
-
const item = (0,
|
|
10892
|
+
const item = (0, import_react75.useMemo)(() => {
|
|
10497
10893
|
if (nodeProps) {
|
|
10498
10894
|
const expanded = expandNode({
|
|
10499
10895
|
type: nodeType,
|
|
@@ -10515,7 +10911,7 @@ var DropZoneChild = ({
|
|
|
10515
10911
|
const componentConfig = useAppStore(
|
|
10516
10912
|
(s) => item?.type ? s.config.components[item.type] : null
|
|
10517
10913
|
);
|
|
10518
|
-
const credbuildProps = (0,
|
|
10914
|
+
const credbuildProps = (0, import_react75.useMemo)(
|
|
10519
10915
|
() => ({
|
|
10520
10916
|
renderDropZone: DropZoneEditPure,
|
|
10521
10917
|
isEditing: true,
|
|
@@ -10532,7 +10928,7 @@ var DropZoneChild = ({
|
|
|
10532
10928
|
(s) => s.selectedItem?.props.id === componentId || false
|
|
10533
10929
|
);
|
|
10534
10930
|
let label = componentConfig?.label ?? item?.type.toString() ?? "Component";
|
|
10535
|
-
const defaultsProps = (0,
|
|
10931
|
+
const defaultsProps = (0, import_react75.useMemo)(
|
|
10536
10932
|
() => ({
|
|
10537
10933
|
...componentConfig?.defaultProps,
|
|
10538
10934
|
...item?.props,
|
|
@@ -10542,16 +10938,16 @@ var DropZoneChild = ({
|
|
|
10542
10938
|
}),
|
|
10543
10939
|
[componentConfig?.defaultProps, item?.props, credbuildProps]
|
|
10544
10940
|
);
|
|
10545
|
-
const defaultedNode = (0,
|
|
10941
|
+
const defaultedNode = (0, import_react75.useMemo)(
|
|
10546
10942
|
() => ({ type: item?.type ?? nodeType, props: defaultsProps }),
|
|
10547
10943
|
[item?.type, nodeType, defaultsProps]
|
|
10548
10944
|
);
|
|
10549
10945
|
const config = useAppStore((s) => s.config);
|
|
10550
10946
|
const plugins = useAppStore((s) => s.plugins);
|
|
10551
10947
|
const userFieldTransforms = useAppStore((s) => s.fieldTransforms);
|
|
10552
|
-
const combinedFieldTransforms = (0,
|
|
10948
|
+
const combinedFieldTransforms = (0, import_react75.useMemo)(
|
|
10553
10949
|
() => ({
|
|
10554
|
-
...getSlotTransform(DropZoneEditPure, (slotProps) => /* @__PURE__ */ (0,
|
|
10950
|
+
...getSlotTransform(DropZoneEditPure, (slotProps) => /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(ContextSlotRender, { componentId, zone: slotProps.zone })),
|
|
10555
10951
|
...getInlineTextTransform(),
|
|
10556
10952
|
...getRichTextTransform(),
|
|
10557
10953
|
...plugins.reduce(
|
|
@@ -10570,13 +10966,13 @@ var DropZoneChild = ({
|
|
|
10570
10966
|
isLoading
|
|
10571
10967
|
);
|
|
10572
10968
|
if (!item) return;
|
|
10573
|
-
const Render2 = componentConfig ? componentConfig.render : () => /* @__PURE__ */ (0,
|
|
10969
|
+
const Render2 = componentConfig ? componentConfig.render : () => /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { style: { padding: 48, textAlign: "center" }, children: [
|
|
10574
10970
|
"No configuration for ",
|
|
10575
10971
|
item.type
|
|
10576
10972
|
] });
|
|
10577
10973
|
let componentType = item.type;
|
|
10578
10974
|
const isInserting = "previewType" in item ? item.previewType === "insert" : false;
|
|
10579
|
-
return /* @__PURE__ */ (0,
|
|
10975
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
10580
10976
|
DraggableComponent,
|
|
10581
10977
|
{
|
|
10582
10978
|
id: componentId,
|
|
@@ -10593,7 +10989,7 @@ var DropZoneChild = ({
|
|
|
10593
10989
|
itemRef,
|
|
10594
10990
|
children: (dragRef) => {
|
|
10595
10991
|
if (componentConfig?.inline && !isInserting) {
|
|
10596
|
-
return /* @__PURE__ */ (0,
|
|
10992
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
10597
10993
|
MemoizeComponent,
|
|
10598
10994
|
{
|
|
10599
10995
|
Component: Render2,
|
|
@@ -10604,14 +11000,14 @@ var DropZoneChild = ({
|
|
|
10604
11000
|
}
|
|
10605
11001
|
);
|
|
10606
11002
|
}
|
|
10607
|
-
return /* @__PURE__ */ (0,
|
|
11003
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { ref: dragRef, children: isInserting ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
10608
11004
|
InsertPreview,
|
|
10609
11005
|
{
|
|
10610
11006
|
label,
|
|
10611
11007
|
override: overrides.componentItem ?? overrides.drawerItem,
|
|
10612
11008
|
element: "element" in item && item.element ? item.element : void 0
|
|
10613
11009
|
}
|
|
10614
|
-
) : /* @__PURE__ */ (0,
|
|
11010
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
10615
11011
|
MemoizeComponent,
|
|
10616
11012
|
{
|
|
10617
11013
|
Component: Render2,
|
|
@@ -10622,8 +11018,8 @@ var DropZoneChild = ({
|
|
|
10622
11018
|
}
|
|
10623
11019
|
);
|
|
10624
11020
|
};
|
|
10625
|
-
var DropZoneChildMemo = (0,
|
|
10626
|
-
var DropZoneEdit = (0,
|
|
11021
|
+
var DropZoneChildMemo = (0, import_react75.memo)(DropZoneChild);
|
|
11022
|
+
var DropZoneEdit = (0, import_react75.forwardRef)(
|
|
10627
11023
|
function DropZoneEditInternal({
|
|
10628
11024
|
zone,
|
|
10629
11025
|
allow,
|
|
@@ -10634,7 +11030,7 @@ var DropZoneEdit = (0, import_react73.forwardRef)(
|
|
|
10634
11030
|
collisionAxis,
|
|
10635
11031
|
as
|
|
10636
11032
|
}, userRef) {
|
|
10637
|
-
const ctx = (0,
|
|
11033
|
+
const ctx = (0, import_react75.useContext)(dropZoneContext);
|
|
10638
11034
|
const appStoreApi = useAppStoreApi();
|
|
10639
11035
|
const {
|
|
10640
11036
|
// These all need setting via context
|
|
@@ -10667,14 +11063,14 @@ var DropZoneEdit = (0, import_react73.forwardRef)(
|
|
|
10667
11063
|
return s.state.indexes.zones[zoneCompound]?.type;
|
|
10668
11064
|
})
|
|
10669
11065
|
);
|
|
10670
|
-
(0,
|
|
11066
|
+
(0, import_react75.useEffect)(() => {
|
|
10671
11067
|
if (!zoneType || zoneType === "dropzone") {
|
|
10672
11068
|
if (ctx?.registerZone) {
|
|
10673
11069
|
ctx?.registerZone(zoneCompound);
|
|
10674
11070
|
}
|
|
10675
11071
|
}
|
|
10676
11072
|
}, [zoneType, appStoreApi, ctx, zoneCompound]);
|
|
10677
|
-
(0,
|
|
11073
|
+
(0, import_react75.useEffect)(() => {
|
|
10678
11074
|
if (zoneType === "dropzone") {
|
|
10679
11075
|
if (zoneCompound !== rootDroppableId) {
|
|
10680
11076
|
console.warn(
|
|
@@ -10683,11 +11079,11 @@ var DropZoneEdit = (0, import_react73.forwardRef)(
|
|
|
10683
11079
|
}
|
|
10684
11080
|
}
|
|
10685
11081
|
}, [zoneType, zoneCompound]);
|
|
10686
|
-
const contentIds = (0,
|
|
11082
|
+
const contentIds = (0, import_react75.useMemo)(() => {
|
|
10687
11083
|
return zoneContentIds || [];
|
|
10688
11084
|
}, [zoneContentIds]);
|
|
10689
|
-
const ref = (0,
|
|
10690
|
-
const acceptsTarget = (0,
|
|
11085
|
+
const ref = (0, import_react75.useRef)(null);
|
|
11086
|
+
const acceptsTarget = (0, import_react75.useCallback)(
|
|
10691
11087
|
(componentType) => {
|
|
10692
11088
|
if (!componentType) {
|
|
10693
11089
|
return true;
|
|
@@ -10723,7 +11119,7 @@ var DropZoneEdit = (0, import_react73.forwardRef)(
|
|
|
10723
11119
|
}
|
|
10724
11120
|
return _isEnabled;
|
|
10725
11121
|
});
|
|
10726
|
-
(0,
|
|
11122
|
+
(0, import_react75.useEffect)(() => {
|
|
10727
11123
|
if (registerLocalZone) {
|
|
10728
11124
|
registerLocalZone(zoneCompound, targetAccepted || isEnabled);
|
|
10729
11125
|
}
|
|
@@ -10738,8 +11134,8 @@ var DropZoneEdit = (0, import_react73.forwardRef)(
|
|
|
10738
11134
|
zoneCompound
|
|
10739
11135
|
);
|
|
10740
11136
|
const isDropEnabled = isEnabled && (preview ? contentIdsWithPreview.length === 1 : contentIdsWithPreview.length === 0);
|
|
10741
|
-
const zoneStore = (0,
|
|
10742
|
-
(0,
|
|
11137
|
+
const zoneStore = (0, import_react75.useContext)(ZoneStoreContext);
|
|
11138
|
+
(0, import_react75.useEffect)(() => {
|
|
10743
11139
|
const { enabledIndex } = zoneStore.getState();
|
|
10744
11140
|
zoneStore.setState({
|
|
10745
11141
|
enabledIndex: { ...enabledIndex, [zoneCompound]: isEnabled }
|
|
@@ -10758,7 +11154,7 @@ var DropZoneEdit = (0, import_react73.forwardRef)(
|
|
|
10758
11154
|
path: path || []
|
|
10759
11155
|
}
|
|
10760
11156
|
};
|
|
10761
|
-
const { ref: dropRef } = (0,
|
|
11157
|
+
const { ref: dropRef } = (0, import_react76.useDroppable)(droppableConfig);
|
|
10762
11158
|
const isAreaSelected = useAppStore(
|
|
10763
11159
|
(s) => s?.selectedItem && areaId === s?.selectedItem.props.id
|
|
10764
11160
|
);
|
|
@@ -10768,7 +11164,7 @@ var DropZoneEdit = (0, import_react73.forwardRef)(
|
|
|
10768
11164
|
userMinEmptyHeight,
|
|
10769
11165
|
ref
|
|
10770
11166
|
});
|
|
10771
|
-
const setRefs = (0,
|
|
11167
|
+
const setRefs = (0, import_react75.useCallback)(
|
|
10772
11168
|
(node) => {
|
|
10773
11169
|
assignRefs([ref, dropRef, userRef], node);
|
|
10774
11170
|
},
|
|
@@ -10780,7 +11176,7 @@ var DropZoneEdit = (0, import_react73.forwardRef)(
|
|
|
10780
11176
|
const El = as ?? "div";
|
|
10781
11177
|
const isRootAreaZone = (areaId ?? rootAreaId) === rootAreaId && depth === 0;
|
|
10782
11178
|
const shouldVirtualizeItems = _experimentalVirtualization && isRootAreaZone;
|
|
10783
|
-
return /* @__PURE__ */ (0,
|
|
11179
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
10784
11180
|
El,
|
|
10785
11181
|
{
|
|
10786
11182
|
className: `${getClassName26({
|
|
@@ -10799,12 +11195,12 @@ var DropZoneEdit = (0, import_react73.forwardRef)(
|
|
|
10799
11195
|
"--min-empty-height": minEmptyHeight,
|
|
10800
11196
|
backgroundColor: RENDER_DEBUG ? getRandomColor() : style?.backgroundColor
|
|
10801
11197
|
},
|
|
10802
|
-
children: shouldVirtualizeItems ? /* @__PURE__ */ (0,
|
|
11198
|
+
children: shouldVirtualizeItems ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
10803
11199
|
VirtualizedDropZone,
|
|
10804
11200
|
{
|
|
10805
11201
|
contentIds: contentIdsWithPreview,
|
|
10806
11202
|
zoneCompound,
|
|
10807
|
-
renderItem: (props) => /* @__PURE__ */ (0,
|
|
11203
|
+
renderItem: (props) => /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
10808
11204
|
DropZoneChildMemo,
|
|
10809
11205
|
{
|
|
10810
11206
|
zoneCompound,
|
|
@@ -10818,7 +11214,7 @@ var DropZoneEdit = (0, import_react73.forwardRef)(
|
|
|
10818
11214
|
props.componentId
|
|
10819
11215
|
)
|
|
10820
11216
|
}
|
|
10821
|
-
) : contentIdsWithPreview.map((componentId, i) => /* @__PURE__ */ (0,
|
|
11217
|
+
) : contentIdsWithPreview.map((componentId, i) => /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
10822
11218
|
DropZoneChildMemo,
|
|
10823
11219
|
{
|
|
10824
11220
|
zoneCompound,
|
|
@@ -10840,8 +11236,8 @@ var DropZoneRenderItem = ({
|
|
|
10840
11236
|
metadata
|
|
10841
11237
|
}) => {
|
|
10842
11238
|
const Component = config.components[item.type];
|
|
10843
|
-
const props = useSlots(config, item, (slotProps) => /* @__PURE__ */ (0,
|
|
10844
|
-
const nextContextValue = (0,
|
|
11239
|
+
const props = useSlots(config, item, (slotProps) => /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(SlotRenderPure, { ...slotProps, config, metadata }));
|
|
11240
|
+
const nextContextValue = (0, import_react75.useMemo)(
|
|
10845
11241
|
() => ({
|
|
10846
11242
|
areaId: props.id,
|
|
10847
11243
|
depth: 1
|
|
@@ -10849,7 +11245,7 @@ var DropZoneRenderItem = ({
|
|
|
10849
11245
|
[props]
|
|
10850
11246
|
);
|
|
10851
11247
|
const richtextProps = useRichtextProps(Component.fields, props);
|
|
10852
|
-
return /* @__PURE__ */ (0,
|
|
11248
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(DropZoneProvider, { value: nextContextValue, children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
10853
11249
|
Component.render,
|
|
10854
11250
|
{
|
|
10855
11251
|
...props,
|
|
@@ -10862,20 +11258,20 @@ var DropZoneRenderItem = ({
|
|
|
10862
11258
|
}
|
|
10863
11259
|
) }, props.id);
|
|
10864
11260
|
};
|
|
10865
|
-
var DropZoneRenderPure = (props) => /* @__PURE__ */ (0,
|
|
10866
|
-
var DropZoneRender = (0,
|
|
11261
|
+
var DropZoneRenderPure = (props) => /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(DropZoneRender, { ...props });
|
|
11262
|
+
var DropZoneRender = (0, import_react75.forwardRef)(
|
|
10867
11263
|
function DropZoneRenderInternal({ className, style, zone, as }, ref) {
|
|
10868
|
-
const ctx = (0,
|
|
11264
|
+
const ctx = (0, import_react75.useContext)(dropZoneContext);
|
|
10869
11265
|
const { areaId = "root" } = ctx || {};
|
|
10870
|
-
const { config, data, metadata } = (0,
|
|
11266
|
+
const { config, data, metadata } = (0, import_react75.useContext)(renderContext);
|
|
10871
11267
|
let zoneCompound = `${areaId}:${zone}`;
|
|
10872
|
-
const content = (0,
|
|
11268
|
+
const content = (0, import_react75.useMemo)(() => {
|
|
10873
11269
|
if (zoneCompound !== rootDroppableId) {
|
|
10874
11270
|
return setupZone(data, zoneCompound).zones[zoneCompound];
|
|
10875
11271
|
}
|
|
10876
11272
|
return data?.content || [];
|
|
10877
11273
|
}, [data, zoneCompound]);
|
|
10878
|
-
(0,
|
|
11274
|
+
(0, import_react75.useEffect)(() => {
|
|
10879
11275
|
if (!content) {
|
|
10880
11276
|
if (ctx?.registerZone) {
|
|
10881
11277
|
ctx?.registerZone(zoneCompound);
|
|
@@ -10886,10 +11282,10 @@ var DropZoneRender = (0, import_react73.forwardRef)(
|
|
|
10886
11282
|
if (!data || !config) {
|
|
10887
11283
|
return null;
|
|
10888
11284
|
}
|
|
10889
|
-
return /* @__PURE__ */ (0,
|
|
11285
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(El, { className, style, ref, children: content.map((item) => {
|
|
10890
11286
|
const Component = config.components[item.type];
|
|
10891
11287
|
if (Component) {
|
|
10892
|
-
return /* @__PURE__ */ (0,
|
|
11288
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
10893
11289
|
DropZoneRenderItem,
|
|
10894
11290
|
{
|
|
10895
11291
|
config,
|
|
@@ -10903,14 +11299,14 @@ var DropZoneRender = (0, import_react73.forwardRef)(
|
|
|
10903
11299
|
}) });
|
|
10904
11300
|
}
|
|
10905
11301
|
);
|
|
10906
|
-
var DropZonePure = (props) => /* @__PURE__ */ (0,
|
|
10907
|
-
var DropZone = (0,
|
|
11302
|
+
var DropZonePure = (props) => /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(DropZone, { ...props });
|
|
11303
|
+
var DropZone = (0, import_react75.forwardRef)(
|
|
10908
11304
|
function DropZone2(props, ref) {
|
|
10909
|
-
const ctx = (0,
|
|
11305
|
+
const ctx = (0, import_react75.useContext)(dropZoneContext);
|
|
10910
11306
|
if (ctx?.mode === "edit") {
|
|
10911
|
-
return /* @__PURE__ */ (0,
|
|
11307
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_jsx_runtime72.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(DropZoneEdit, { ...props, ref }) });
|
|
10912
11308
|
}
|
|
10913
|
-
return /* @__PURE__ */ (0,
|
|
11309
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_jsx_runtime72.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(DropZoneRender, { ...props, ref }) });
|
|
10914
11310
|
}
|
|
10915
11311
|
);
|
|
10916
11312
|
|
|
@@ -10919,7 +11315,7 @@ init_IconButton2();
|
|
|
10919
11315
|
|
|
10920
11316
|
// components/CredBuild/index.tsx
|
|
10921
11317
|
init_react_import();
|
|
10922
|
-
var
|
|
11318
|
+
var import_react102 = require("react");
|
|
10923
11319
|
init_store2();
|
|
10924
11320
|
|
|
10925
11321
|
// components/CredBuild/components/Fields/index.tsx
|
|
@@ -10936,15 +11332,15 @@ var styles_module_default18 = { "CredBuildFields": "_CredBuildFields_slc6y_1", "
|
|
|
10936
11332
|
|
|
10937
11333
|
// components/CredBuild/components/Fields/index.tsx
|
|
10938
11334
|
init_lib();
|
|
10939
|
-
var
|
|
11335
|
+
var import_react77 = require("react");
|
|
10940
11336
|
init_fields();
|
|
10941
11337
|
var import_shallow7 = require("zustand/react/shallow");
|
|
10942
|
-
var
|
|
11338
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
10943
11339
|
var getClassName27 = get_class_name_factory_default("CredBuildFields", styles_module_default18);
|
|
10944
11340
|
var DefaultFields = ({
|
|
10945
11341
|
children
|
|
10946
11342
|
}) => {
|
|
10947
|
-
return /* @__PURE__ */ (0,
|
|
11343
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_jsx_runtime73.Fragment, { children });
|
|
10948
11344
|
};
|
|
10949
11345
|
var createOnChange = (fieldName, appStore) => async (value, updatedUi) => {
|
|
10950
11346
|
const { dispatch, state, selectedItem, resolveComponentData: resolveComponentData2 } = appStore.getState();
|
|
@@ -11005,15 +11401,15 @@ var FieldsChildInner = ({ fieldName }) => {
|
|
|
11005
11401
|
})
|
|
11006
11402
|
);
|
|
11007
11403
|
const appStore = useAppStoreApi();
|
|
11008
|
-
const onChange = (0,
|
|
11404
|
+
const onChange = (0, import_react77.useCallback)(
|
|
11009
11405
|
async (value, updatedUi) => {
|
|
11010
11406
|
createOnChange(fieldName, appStore)(value, updatedUi);
|
|
11011
11407
|
},
|
|
11012
11408
|
[fieldName, appStore]
|
|
11013
11409
|
);
|
|
11014
11410
|
const { visible = true } = field ?? {};
|
|
11015
|
-
const fieldStore = (0,
|
|
11016
|
-
(0,
|
|
11411
|
+
const fieldStore = (0, import_react77.useContext)(fieldContextStore.ctx);
|
|
11412
|
+
(0, import_react77.useEffect)(() => {
|
|
11017
11413
|
return appStore.subscribe(
|
|
11018
11414
|
(s) => {
|
|
11019
11415
|
const data = s.getCurrentData();
|
|
@@ -11026,7 +11422,7 @@ var FieldsChildInner = ({ fieldName }) => {
|
|
|
11026
11422
|
}, [appStore, fieldStore, fieldName]);
|
|
11027
11423
|
if (!field || !id || !visible) return null;
|
|
11028
11424
|
if (field.type === "slot") return null;
|
|
11029
|
-
return /* @__PURE__ */ (0,
|
|
11425
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: getClassName27("field"), children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
11030
11426
|
AutoFieldPrivate2,
|
|
11031
11427
|
{
|
|
11032
11428
|
field,
|
|
@@ -11039,13 +11435,13 @@ var FieldsChildInner = ({ fieldName }) => {
|
|
|
11039
11435
|
};
|
|
11040
11436
|
var FieldsChild = ({ fieldName }) => {
|
|
11041
11437
|
const appStore = useAppStoreApi();
|
|
11042
|
-
const initialValue = (0,
|
|
11438
|
+
const initialValue = (0, import_react77.useMemo)(() => {
|
|
11043
11439
|
const value = appStore.getState().getCurrentData().props?.[fieldName];
|
|
11044
11440
|
return { [fieldName]: value };
|
|
11045
11441
|
}, [appStore, fieldName]);
|
|
11046
|
-
return /* @__PURE__ */ (0,
|
|
11442
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(fieldContextStore.Provider, { value: initialValue, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(FieldsChildInner, { fieldName }) });
|
|
11047
11443
|
};
|
|
11048
|
-
var FieldsChildMemo = (0,
|
|
11444
|
+
var FieldsChildMemo = (0, import_react77.memo)(FieldsChild);
|
|
11049
11445
|
var FieldsInternal = ({ wrapFields = true }) => {
|
|
11050
11446
|
const overrides = useAppStore((s) => s.overrides);
|
|
11051
11447
|
const componentResolving = useAppStore((s) => {
|
|
@@ -11066,8 +11462,8 @@ var FieldsInternal = ({ wrapFields = true }) => {
|
|
|
11066
11462
|
})
|
|
11067
11463
|
);
|
|
11068
11464
|
const isLoading = fieldsLoading || componentResolving;
|
|
11069
|
-
const Wrapper = (0,
|
|
11070
|
-
return /* @__PURE__ */ (0,
|
|
11465
|
+
const Wrapper = (0, import_react77.useMemo)(() => overrides.fields || DefaultFields, [overrides]);
|
|
11466
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(
|
|
11071
11467
|
"form",
|
|
11072
11468
|
{
|
|
11073
11469
|
className: getClassName27({ wrapFields }),
|
|
@@ -11075,20 +11471,20 @@ var FieldsInternal = ({ wrapFields = true }) => {
|
|
|
11075
11471
|
e.preventDefault();
|
|
11076
11472
|
},
|
|
11077
11473
|
children: [
|
|
11078
|
-
/* @__PURE__ */ (0,
|
|
11079
|
-
isLoading && /* @__PURE__ */ (0,
|
|
11474
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Wrapper, { isLoading, itemSelector, children: fieldNames.map((fieldName) => /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(FieldsChildMemo, { fieldName }, fieldName)) }),
|
|
11475
|
+
isLoading && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: getClassName27("loadingOverlay"), children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: getClassName27("loadingOverlayInner"), children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Loader, { size: 16 }) }) })
|
|
11080
11476
|
]
|
|
11081
11477
|
}
|
|
11082
11478
|
);
|
|
11083
11479
|
};
|
|
11084
|
-
var Fields = (0,
|
|
11480
|
+
var Fields = (0, import_react77.memo)(FieldsInternal);
|
|
11085
11481
|
|
|
11086
11482
|
// components/CredBuild/components/Components/index.tsx
|
|
11087
11483
|
init_react_import();
|
|
11088
11484
|
|
|
11089
11485
|
// lib/use-component-list.tsx
|
|
11090
11486
|
init_react_import();
|
|
11091
|
-
var
|
|
11487
|
+
var import_react79 = require("react");
|
|
11092
11488
|
|
|
11093
11489
|
// components/ComponentList/index.tsx
|
|
11094
11490
|
init_react_import();
|
|
@@ -11099,11 +11495,11 @@ var styles_module_default19 = { "ComponentList": "_ComponentList_1jl8i_1", "Comp
|
|
|
11099
11495
|
|
|
11100
11496
|
// components/ComponentList/index.tsx
|
|
11101
11497
|
init_get_class_name_factory();
|
|
11102
|
-
var
|
|
11498
|
+
var import_react78 = require("react");
|
|
11103
11499
|
init_store2();
|
|
11104
11500
|
init_lucide_react();
|
|
11105
11501
|
var import_react_virtual2 = require("@tanstack/react-virtual");
|
|
11106
|
-
var
|
|
11502
|
+
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
11107
11503
|
var getClassName28 = get_class_name_factory_default("ComponentList", styles_module_default19);
|
|
11108
11504
|
var ComponentListItem = ({
|
|
11109
11505
|
name,
|
|
@@ -11115,14 +11511,14 @@ var ComponentListItem = ({
|
|
|
11115
11511
|
type: name
|
|
11116
11512
|
}).insert
|
|
11117
11513
|
);
|
|
11118
|
-
(0,
|
|
11514
|
+
(0, import_react78.useEffect)(() => {
|
|
11119
11515
|
if (overrides.componentItem) {
|
|
11120
11516
|
console.warn(
|
|
11121
11517
|
"The `componentItem` override has been deprecated and renamed to `drawerItem`"
|
|
11122
11518
|
);
|
|
11123
11519
|
}
|
|
11124
11520
|
}, [overrides]);
|
|
11125
|
-
return /* @__PURE__ */ (0,
|
|
11521
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Drawer.Item, { label, name, isDragDisabled: !canInsert, children: overrides.componentItem ?? overrides.drawerItem });
|
|
11126
11522
|
};
|
|
11127
11523
|
var ComponentList = ({
|
|
11128
11524
|
children,
|
|
@@ -11132,7 +11528,7 @@ var ComponentList = ({
|
|
|
11132
11528
|
const config = useAppStore((s) => s.config);
|
|
11133
11529
|
const setUi = useAppStore((s) => s.setUi);
|
|
11134
11530
|
const componentList = useAppStore((s) => s.state.ui.componentList);
|
|
11135
|
-
const parentRef = (0,
|
|
11531
|
+
const parentRef = (0, import_react78.useRef)(null);
|
|
11136
11532
|
const { expanded = true } = componentList[id] || {};
|
|
11137
11533
|
const components = Object.keys(config.components);
|
|
11138
11534
|
const virtualizer = (0, import_react_virtual2.useVirtualizer)({
|
|
@@ -11142,8 +11538,8 @@ var ComponentList = ({
|
|
|
11142
11538
|
// Estimated height of each item
|
|
11143
11539
|
overscan: 5
|
|
11144
11540
|
});
|
|
11145
|
-
return /* @__PURE__ */ (0,
|
|
11146
|
-
title && /* @__PURE__ */ (0,
|
|
11541
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: getClassName28({ isExpanded: expanded }), children: [
|
|
11542
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(
|
|
11147
11543
|
"button",
|
|
11148
11544
|
{
|
|
11149
11545
|
type: "button",
|
|
@@ -11158,20 +11554,20 @@ var ComponentList = ({
|
|
|
11158
11554
|
}
|
|
11159
11555
|
}),
|
|
11160
11556
|
children: [
|
|
11161
|
-
/* @__PURE__ */ (0,
|
|
11162
|
-
id.toLowerCase().includes("hero") && /* @__PURE__ */ (0,
|
|
11163
|
-
id.toLowerCase().includes("content") && /* @__PURE__ */ (0,
|
|
11164
|
-
id.toLowerCase().includes("marketing") && /* @__PURE__ */ (0,
|
|
11165
|
-
id.toLowerCase().includes("layout") && /* @__PURE__ */ (0,
|
|
11166
|
-
id.toLowerCase().includes("basic") && /* @__PURE__ */ (0,
|
|
11167
|
-
id === "other" && /* @__PURE__ */ (0,
|
|
11168
|
-
/* @__PURE__ */ (0,
|
|
11557
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
|
|
11558
|
+
id.toLowerCase().includes("hero") && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(LayoutTemplate, { size: 12, strokeWidth: 2.5 }),
|
|
11559
|
+
id.toLowerCase().includes("content") && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(FileText, { size: 12, strokeWidth: 2.5 }),
|
|
11560
|
+
id.toLowerCase().includes("marketing") && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Megaphone, { size: 12, strokeWidth: 2.5 }),
|
|
11561
|
+
id.toLowerCase().includes("layout") && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Box, { size: 12, strokeWidth: 2.5 }),
|
|
11562
|
+
id.toLowerCase().includes("basic") && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Settings, { size: 12, strokeWidth: 2.5 }),
|
|
11563
|
+
id === "other" && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Layers, { size: 12, strokeWidth: 2.5 }),
|
|
11564
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { children: title?.replace(/[\u2600-\u27BF]|[\uD83C][\uDF00-\uDFFF]|[\uD83D][\uDC00-\uDE4F]|[\uD83D][\uDE80-\uDEFF]/g, "").trim() })
|
|
11169
11565
|
] }),
|
|
11170
|
-
/* @__PURE__ */ (0,
|
|
11566
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: getClassName28("titleIcon"), children: expanded ? /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(ChevronUp, { size: 12 }) : /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(ChevronDown, { size: 12 }) })
|
|
11171
11567
|
]
|
|
11172
11568
|
}
|
|
11173
11569
|
),
|
|
11174
|
-
/* @__PURE__ */ (0,
|
|
11570
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
11175
11571
|
"div",
|
|
11176
11572
|
{
|
|
11177
11573
|
ref: parentRef,
|
|
@@ -11181,7 +11577,7 @@ var ComponentList = ({
|
|
|
11181
11577
|
overflowY: "auto",
|
|
11182
11578
|
transition: "max-height 0.3s ease-in-out"
|
|
11183
11579
|
},
|
|
11184
|
-
children: /* @__PURE__ */ (0,
|
|
11580
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
11185
11581
|
"div",
|
|
11186
11582
|
{
|
|
11187
11583
|
style: {
|
|
@@ -11189,9 +11585,9 @@ var ComponentList = ({
|
|
|
11189
11585
|
width: "100%",
|
|
11190
11586
|
position: "relative"
|
|
11191
11587
|
},
|
|
11192
|
-
children: /* @__PURE__ */ (0,
|
|
11588
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Drawer, { children: children || virtualizer.getVirtualItems().map((virtualItem) => {
|
|
11193
11589
|
const componentKey = components[virtualItem.index];
|
|
11194
|
-
return /* @__PURE__ */ (0,
|
|
11590
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
11195
11591
|
"div",
|
|
11196
11592
|
{
|
|
11197
11593
|
style: {
|
|
@@ -11202,7 +11598,7 @@ var ComponentList = ({
|
|
|
11202
11598
|
height: `${virtualItem.size}px`,
|
|
11203
11599
|
transform: `translateY(${virtualItem.start}px)`
|
|
11204
11600
|
},
|
|
11205
|
-
children: /* @__PURE__ */ (0,
|
|
11601
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
11206
11602
|
ComponentListItem,
|
|
11207
11603
|
{
|
|
11208
11604
|
label: config.components[componentKey]["label"] ?? componentKey,
|
|
@@ -11223,12 +11619,12 @@ ComponentList.Item = ComponentListItem;
|
|
|
11223
11619
|
|
|
11224
11620
|
// lib/use-component-list.tsx
|
|
11225
11621
|
init_store2();
|
|
11226
|
-
var
|
|
11622
|
+
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
11227
11623
|
var useComponentList = () => {
|
|
11228
|
-
const [componentList, setComponentList] = (0,
|
|
11624
|
+
const [componentList, setComponentList] = (0, import_react79.useState)();
|
|
11229
11625
|
const config = useAppStore((s) => s.config);
|
|
11230
11626
|
const uiComponentList = useAppStore((s) => s.state.ui.componentList);
|
|
11231
|
-
(0,
|
|
11627
|
+
(0, import_react79.useEffect)(() => {
|
|
11232
11628
|
if (Object.keys(uiComponentList).length > 0) {
|
|
11233
11629
|
const matchedComponents = [];
|
|
11234
11630
|
let _componentList;
|
|
@@ -11243,14 +11639,14 @@ var useComponentList = () => {
|
|
|
11243
11639
|
if (category.visible === false) {
|
|
11244
11640
|
return null;
|
|
11245
11641
|
}
|
|
11246
|
-
return /* @__PURE__ */ (0,
|
|
11642
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
11247
11643
|
ComponentList,
|
|
11248
11644
|
{
|
|
11249
11645
|
id: categoryKey,
|
|
11250
11646
|
title: category.title || categoryKey,
|
|
11251
11647
|
children: category.components.map((componentName, i) => {
|
|
11252
11648
|
const componentConf = config.components[componentName] || {};
|
|
11253
|
-
return /* @__PURE__ */ (0,
|
|
11649
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
11254
11650
|
ComponentList.Item,
|
|
11255
11651
|
{
|
|
11256
11652
|
label: componentConf["label"] ?? componentName,
|
|
@@ -11270,14 +11666,14 @@ var useComponentList = () => {
|
|
|
11270
11666
|
);
|
|
11271
11667
|
if (remainingComponents.length > 0 && !uiComponentList.other?.components && uiComponentList.other?.visible !== false) {
|
|
11272
11668
|
_componentList.push(
|
|
11273
|
-
/* @__PURE__ */ (0,
|
|
11669
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
11274
11670
|
ComponentList,
|
|
11275
11671
|
{
|
|
11276
11672
|
id: "other",
|
|
11277
11673
|
title: uiComponentList.other?.title || "Other",
|
|
11278
11674
|
children: remainingComponents.map((componentName, i) => {
|
|
11279
11675
|
const componentConf = config.components[componentName] || {};
|
|
11280
|
-
return /* @__PURE__ */ (0,
|
|
11676
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
11281
11677
|
ComponentList.Item,
|
|
11282
11678
|
{
|
|
11283
11679
|
name: componentName,
|
|
@@ -11300,12 +11696,12 @@ var useComponentList = () => {
|
|
|
11300
11696
|
|
|
11301
11697
|
// components/CredBuild/components/Components/index.tsx
|
|
11302
11698
|
init_store2();
|
|
11303
|
-
var
|
|
11304
|
-
var
|
|
11699
|
+
var import_react80 = require("react");
|
|
11700
|
+
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
11305
11701
|
var Components = () => {
|
|
11306
11702
|
const overrides = useAppStore((s) => s.overrides);
|
|
11307
11703
|
const componentList = useComponentList();
|
|
11308
|
-
const Wrapper = (0,
|
|
11704
|
+
const Wrapper = (0, import_react80.useMemo)(() => {
|
|
11309
11705
|
if (overrides.components) {
|
|
11310
11706
|
console.warn(
|
|
11311
11707
|
"The `components` override has been deprecated and renamed to `drawer`"
|
|
@@ -11313,21 +11709,21 @@ var Components = () => {
|
|
|
11313
11709
|
}
|
|
11314
11710
|
return overrides.components || overrides.drawer || "div";
|
|
11315
11711
|
}, [overrides]);
|
|
11316
|
-
return /* @__PURE__ */ (0,
|
|
11712
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Wrapper, { children: componentList ? componentList : /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(ComponentList, { id: "all" }) });
|
|
11317
11713
|
};
|
|
11318
11714
|
|
|
11319
11715
|
// components/CredBuild/components/Preview/index.tsx
|
|
11320
11716
|
init_react_import();
|
|
11321
11717
|
init_root_droppable_id();
|
|
11322
|
-
var
|
|
11718
|
+
var import_react83 = require("react");
|
|
11323
11719
|
init_store2();
|
|
11324
11720
|
|
|
11325
11721
|
// components/AutoFrame/index.tsx
|
|
11326
11722
|
init_react_import();
|
|
11327
|
-
var
|
|
11723
|
+
var import_react81 = require("react");
|
|
11328
11724
|
var import_object_hash = __toESM(require("object-hash"));
|
|
11329
11725
|
var import_react_dom3 = require("react-dom");
|
|
11330
|
-
var
|
|
11726
|
+
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
11331
11727
|
var styleSelector = 'style, link[rel="stylesheet"]';
|
|
11332
11728
|
var collectStyles = (doc) => {
|
|
11333
11729
|
const collected = [];
|
|
@@ -11377,7 +11773,7 @@ var CopyHostStyles = ({
|
|
|
11377
11773
|
onStylesLoaded = () => null
|
|
11378
11774
|
}) => {
|
|
11379
11775
|
const { document: doc, window: win } = useFrame();
|
|
11380
|
-
(0,
|
|
11776
|
+
(0, import_react81.useEffect)(() => {
|
|
11381
11777
|
if (!win || !doc) {
|
|
11382
11778
|
return () => {
|
|
11383
11779
|
};
|
|
@@ -11541,10 +11937,10 @@ var CopyHostStyles = ({
|
|
|
11541
11937
|
observer.disconnect();
|
|
11542
11938
|
};
|
|
11543
11939
|
}, [debug, doc, onStylesLoaded, win]);
|
|
11544
|
-
return /* @__PURE__ */ (0,
|
|
11940
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_jsx_runtime77.Fragment, { children });
|
|
11545
11941
|
};
|
|
11546
|
-
var autoFrameContext = (0,
|
|
11547
|
-
var useFrame = () => (0,
|
|
11942
|
+
var autoFrameContext = (0, import_react81.createContext)({});
|
|
11943
|
+
var useFrame = () => (0, import_react81.useContext)(autoFrameContext);
|
|
11548
11944
|
function AutoFrame({
|
|
11549
11945
|
children,
|
|
11550
11946
|
className,
|
|
@@ -11557,20 +11953,20 @@ function AutoFrame({
|
|
|
11557
11953
|
frameRef,
|
|
11558
11954
|
...props
|
|
11559
11955
|
}) {
|
|
11560
|
-
const [loaded, setLoaded] = (0,
|
|
11561
|
-
const [ctx, setCtx] = (0,
|
|
11562
|
-
const [mountTarget, setMountTarget] = (0,
|
|
11563
|
-
const [stylesLoaded, setStylesLoaded] = (0,
|
|
11564
|
-
const handleStylesLoaded = (0,
|
|
11956
|
+
const [loaded, setLoaded] = (0, import_react81.useState)(false);
|
|
11957
|
+
const [ctx, setCtx] = (0, import_react81.useState)({});
|
|
11958
|
+
const [mountTarget, setMountTarget] = (0, import_react81.useState)();
|
|
11959
|
+
const [stylesLoaded, setStylesLoaded] = (0, import_react81.useState)(false);
|
|
11960
|
+
const handleStylesLoaded = (0, import_react81.useCallback)(() => {
|
|
11565
11961
|
setStylesLoaded(true);
|
|
11566
11962
|
}, []);
|
|
11567
|
-
const onReadyRef = (0,
|
|
11568
|
-
const onNotReadyRef = (0,
|
|
11569
|
-
(0,
|
|
11963
|
+
const onReadyRef = (0, import_react81.useRef)(onReady);
|
|
11964
|
+
const onNotReadyRef = (0, import_react81.useRef)(onNotReady);
|
|
11965
|
+
(0, import_react81.useEffect)(() => {
|
|
11570
11966
|
onReadyRef.current = onReady;
|
|
11571
11967
|
onNotReadyRef.current = onNotReady;
|
|
11572
11968
|
}, [onReady, onNotReady]);
|
|
11573
|
-
(0,
|
|
11969
|
+
(0, import_react81.useEffect)(() => {
|
|
11574
11970
|
if (frameRef.current) {
|
|
11575
11971
|
const doc = frameRef.current.contentDocument;
|
|
11576
11972
|
const win = frameRef.current.contentWindow;
|
|
@@ -11591,7 +11987,7 @@ function AutoFrame({
|
|
|
11591
11987
|
}
|
|
11592
11988
|
}
|
|
11593
11989
|
}, [frameRef, loaded, stylesLoaded]);
|
|
11594
|
-
return /* @__PURE__ */ (0,
|
|
11990
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
11595
11991
|
"iframe",
|
|
11596
11992
|
{
|
|
11597
11993
|
...props,
|
|
@@ -11602,7 +11998,7 @@ function AutoFrame({
|
|
|
11602
11998
|
onLoad: () => {
|
|
11603
11999
|
setLoaded(true);
|
|
11604
12000
|
},
|
|
11605
|
-
children: /* @__PURE__ */ (0,
|
|
12001
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(autoFrameContext.Provider, { value: ctx, children: loaded && mountTarget && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
11606
12002
|
CopyHostStyles,
|
|
11607
12003
|
{
|
|
11608
12004
|
debug,
|
|
@@ -11626,8 +12022,8 @@ init_lib();
|
|
|
11626
12022
|
// components/Render/index.tsx
|
|
11627
12023
|
init_react_import();
|
|
11628
12024
|
init_root_droppable_id();
|
|
11629
|
-
var
|
|
11630
|
-
var
|
|
12025
|
+
var import_react82 = require("react");
|
|
12026
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
11631
12027
|
function Render({
|
|
11632
12028
|
config,
|
|
11633
12029
|
data,
|
|
@@ -11655,10 +12051,10 @@ function Render({
|
|
|
11655
12051
|
const propsWithSlots = useSlots(
|
|
11656
12052
|
config,
|
|
11657
12053
|
{ type: "root", props: pageProps },
|
|
11658
|
-
(props) => /* @__PURE__ */ (0,
|
|
12054
|
+
(props) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(SlotRender, { ...props, config, metadata })
|
|
11659
12055
|
);
|
|
11660
12056
|
const richtextProps = useRichtextProps(config.root?.fields, pageProps);
|
|
11661
|
-
const nextContextValue = (0,
|
|
12057
|
+
const nextContextValue = (0, import_react82.useMemo)(
|
|
11662
12058
|
() => ({
|
|
11663
12059
|
mode: "render",
|
|
11664
12060
|
depth: 0
|
|
@@ -11666,9 +12062,9 @@ function Render({
|
|
|
11666
12062
|
[]
|
|
11667
12063
|
);
|
|
11668
12064
|
if (config.root?.render) {
|
|
11669
|
-
return /* @__PURE__ */ (0,
|
|
12065
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(renderContext.Provider, { value: { config, data: defaultedData, metadata }, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(DropZoneProvider, { value: nextContextValue, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(config.root.render, { ...propsWithSlots, ...richtextProps, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(DropZoneRenderPure, { zone: rootZone }) }) }) });
|
|
11670
12066
|
}
|
|
11671
|
-
return /* @__PURE__ */ (0,
|
|
12067
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(renderContext.Provider, { value: { config, data: defaultedData, metadata }, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(DropZoneProvider, { value: nextContextValue, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(DropZoneRenderPure, { zone: rootZone }) }) });
|
|
11672
12068
|
}
|
|
11673
12069
|
|
|
11674
12070
|
// lib/bubble-pointer-event.ts
|
|
@@ -11691,11 +12087,11 @@ var BubbledPointerEvent = class extends BaseEvent {
|
|
|
11691
12087
|
};
|
|
11692
12088
|
|
|
11693
12089
|
// components/CredBuild/components/Preview/index.tsx
|
|
11694
|
-
var
|
|
12090
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
11695
12091
|
var getClassName29 = get_class_name_factory_default("CredBuildPreview", styles_module_default20);
|
|
11696
12092
|
var useBubbleIframeEvents = (ref) => {
|
|
11697
12093
|
const status = useAppStore((s) => s.status);
|
|
11698
|
-
(0,
|
|
12094
|
+
(0, import_react83.useEffect)(() => {
|
|
11699
12095
|
if (ref.current && status === "READY") {
|
|
11700
12096
|
const iframe = ref.current;
|
|
11701
12097
|
const handlePointerMove = (event) => {
|
|
@@ -11743,7 +12139,7 @@ var Preview = ({ id = "credbuild-preview" }) => {
|
|
|
11743
12139
|
const renderData = useAppStore(
|
|
11744
12140
|
(s) => s.state.ui.previewMode === "edit" ? null : s.state.data
|
|
11745
12141
|
);
|
|
11746
|
-
const Page = (0,
|
|
12142
|
+
const Page = (0, import_react83.useCallback)(
|
|
11747
12143
|
(pageProps) => {
|
|
11748
12144
|
const propsWithSlots = useSlots(
|
|
11749
12145
|
config,
|
|
@@ -11758,15 +12154,15 @@ var Preview = ({ id = "credbuild-preview" }) => {
|
|
|
11758
12154
|
id: "credbuild-root",
|
|
11759
12155
|
...propsWithSlots,
|
|
11760
12156
|
...richtextProps
|
|
11761
|
-
}) : /* @__PURE__ */ (0,
|
|
12157
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_jsx_runtime79.Fragment, { children: propsWithSlots.children });
|
|
11762
12158
|
},
|
|
11763
12159
|
[config]
|
|
11764
12160
|
);
|
|
11765
|
-
const Frame = (0,
|
|
12161
|
+
const Frame = (0, import_react83.useMemo)(() => overrides.iframe, [overrides]);
|
|
11766
12162
|
const rootProps = root.props || root;
|
|
11767
|
-
const ref = (0,
|
|
12163
|
+
const ref = (0, import_react83.useRef)(null);
|
|
11768
12164
|
useBubbleIframeEvents(ref);
|
|
11769
|
-
const inner = !renderData ? /* @__PURE__ */ (0,
|
|
12165
|
+
const inner = !renderData ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
11770
12166
|
Page,
|
|
11771
12167
|
{
|
|
11772
12168
|
...rootProps,
|
|
@@ -11777,15 +12173,15 @@ var Preview = ({ id = "credbuild-preview" }) => {
|
|
|
11777
12173
|
metadata
|
|
11778
12174
|
},
|
|
11779
12175
|
editMode: true,
|
|
11780
|
-
children: /* @__PURE__ */ (0,
|
|
12176
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(DropZonePure, { zone: rootDroppableId })
|
|
11781
12177
|
}
|
|
11782
|
-
) : /* @__PURE__ */ (0,
|
|
11783
|
-
(0,
|
|
12178
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Render, { data: renderData, config, metadata });
|
|
12179
|
+
(0, import_react83.useEffect)(() => {
|
|
11784
12180
|
if (!iframe.enabled) {
|
|
11785
12181
|
setStatus("READY");
|
|
11786
12182
|
}
|
|
11787
12183
|
}, [iframe.enabled, setStatus]);
|
|
11788
|
-
return /* @__PURE__ */ (0,
|
|
12184
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
11789
12185
|
"div",
|
|
11790
12186
|
{
|
|
11791
12187
|
className: getClassName29(),
|
|
@@ -11797,7 +12193,7 @@ var Preview = ({ id = "credbuild-preview" }) => {
|
|
|
11797
12193
|
dispatch({ type: "setUi", ui: { itemSelector: null } });
|
|
11798
12194
|
}
|
|
11799
12195
|
},
|
|
11800
|
-
children: iframe.enabled ? /* @__PURE__ */ (0,
|
|
12196
|
+
children: iframe.enabled ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
11801
12197
|
AutoFrame_default,
|
|
11802
12198
|
{
|
|
11803
12199
|
id: "preview-frame",
|
|
@@ -11810,14 +12206,14 @@ var Preview = ({ id = "credbuild-preview" }) => {
|
|
|
11810
12206
|
setStatus("MOUNTED");
|
|
11811
12207
|
},
|
|
11812
12208
|
frameRef: ref,
|
|
11813
|
-
children: /* @__PURE__ */ (0,
|
|
12209
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(autoFrameContext.Consumer, { children: ({ document: document2 }) => {
|
|
11814
12210
|
if (Frame) {
|
|
11815
|
-
return /* @__PURE__ */ (0,
|
|
12211
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Frame, { document: document2, children: inner });
|
|
11816
12212
|
}
|
|
11817
12213
|
return inner;
|
|
11818
12214
|
} })
|
|
11819
12215
|
}
|
|
11820
|
-
) : /* @__PURE__ */ (0,
|
|
12216
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
11821
12217
|
"div",
|
|
11822
12218
|
{
|
|
11823
12219
|
id: "preview-frame",
|
|
@@ -11845,11 +12241,11 @@ var styles_module_default21 = { "LayerTree": "_LayerTree_nus40_1", "LayerTree-zo
|
|
|
11845
12241
|
init_get_class_name_factory();
|
|
11846
12242
|
init_lucide_react();
|
|
11847
12243
|
init_root_droppable_id();
|
|
11848
|
-
var
|
|
12244
|
+
var import_react84 = require("react");
|
|
11849
12245
|
init_store2();
|
|
11850
12246
|
init_use_context_store();
|
|
11851
12247
|
var import_react_virtual3 = require("@tanstack/react-virtual");
|
|
11852
|
-
var
|
|
12248
|
+
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
11853
12249
|
var getClassName30 = get_class_name_factory_default("LayerTree", styles_module_default21);
|
|
11854
12250
|
var getClassNameLayer = get_class_name_factory_default("Layer", styles_module_default21);
|
|
11855
12251
|
var DEFAULT_LAYER_ROW_HEIGHT = 32;
|
|
@@ -11948,7 +12344,7 @@ var getScrollParent = (el) => {
|
|
|
11948
12344
|
}
|
|
11949
12345
|
return null;
|
|
11950
12346
|
};
|
|
11951
|
-
var Layer = (0,
|
|
12347
|
+
var Layer = (0, import_react84.forwardRef)(function Layer2({
|
|
11952
12348
|
childIsSelected,
|
|
11953
12349
|
dataIndex,
|
|
11954
12350
|
depth,
|
|
@@ -11958,13 +12354,13 @@ var Layer = (0, import_react82.forwardRef)(function Layer2({
|
|
|
11958
12354
|
selectedPathIds
|
|
11959
12355
|
}, ref) {
|
|
11960
12356
|
const dispatch = useAppStore((s) => s.dispatch);
|
|
11961
|
-
const zoneStore = (0,
|
|
12357
|
+
const zoneStore = (0, import_react84.useContext)(ZoneStoreContext);
|
|
11962
12358
|
const isHovering = useContextStore(
|
|
11963
12359
|
ZoneStoreContext,
|
|
11964
12360
|
(s) => s.hoveringComponent === node.itemId
|
|
11965
12361
|
);
|
|
11966
12362
|
const containsZone = node.childZones.length > 0;
|
|
11967
|
-
const setItemSelector = (0,
|
|
12363
|
+
const setItemSelector = (0, import_react84.useCallback)(
|
|
11968
12364
|
(itemSelector) => {
|
|
11969
12365
|
dispatch({ type: "setUi", ui: { itemSelector } });
|
|
11970
12366
|
},
|
|
@@ -11973,19 +12369,19 @@ var Layer = (0, import_react82.forwardRef)(function Layer2({
|
|
|
11973
12369
|
const shouldRenderChildren = isSelected || childIsSelected;
|
|
11974
12370
|
const getLayerIcon = (type) => {
|
|
11975
12371
|
const t = type.toLowerCase();
|
|
11976
|
-
if (t === "text" || t === "heading" || t.includes("heading")) return /* @__PURE__ */ (0,
|
|
11977
|
-
if (t.includes("hero")) return /* @__PURE__ */ (0,
|
|
11978
|
-
if (t.includes("pricing")) return /* @__PURE__ */ (0,
|
|
11979
|
-
if (t.includes("stats")) return /* @__PURE__ */ (0,
|
|
11980
|
-
if (t.includes("testimonials")) return /* @__PURE__ */ (0,
|
|
11981
|
-
if (t.includes("about") || t.includes("info")) return /* @__PURE__ */ (0,
|
|
11982
|
-
if (t.includes("gallery") || t.includes("image")) return /* @__PURE__ */ (0,
|
|
11983
|
-
if (t.includes("marketing") || t.includes("cta")) return /* @__PURE__ */ (0,
|
|
11984
|
-
if (t.includes("content") || t.includes("blog")) return /* @__PURE__ */ (0,
|
|
11985
|
-
if (t.includes("container") || t.includes("layout") || t.includes("flex")) return /* @__PURE__ */ (0,
|
|
11986
|
-
return /* @__PURE__ */ (0,
|
|
12372
|
+
if (t === "text" || t === "heading" || t.includes("heading")) return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Type, { size: "14", strokeWidth: 2.5 });
|
|
12373
|
+
if (t.includes("hero")) return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(LayoutTemplate, { size: "14", strokeWidth: 2.5 });
|
|
12374
|
+
if (t.includes("pricing")) return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(CreditCard, { size: "14", strokeWidth: 2.5 });
|
|
12375
|
+
if (t.includes("stats")) return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(ChartColumn, { size: "14", strokeWidth: 2.5 });
|
|
12376
|
+
if (t.includes("testimonials")) return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Quote, { size: "14", strokeWidth: 2.5 });
|
|
12377
|
+
if (t.includes("about") || t.includes("info")) return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Info, { size: "14", strokeWidth: 2.5 });
|
|
12378
|
+
if (t.includes("gallery") || t.includes("image")) return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Image, { size: "14", strokeWidth: 2.5 });
|
|
12379
|
+
if (t.includes("marketing") || t.includes("cta")) return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Megaphone, { size: "14", strokeWidth: 2.5 });
|
|
12380
|
+
if (t.includes("content") || t.includes("blog")) return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(FileText, { size: "14", strokeWidth: 2.5 });
|
|
12381
|
+
if (t.includes("container") || t.includes("layout") || t.includes("flex")) return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Box, { size: "14", strokeWidth: 2.5 });
|
|
12382
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(LayoutGrid, { size: "14", strokeWidth: 2.5 });
|
|
11987
12383
|
};
|
|
11988
|
-
return /* @__PURE__ */ (0,
|
|
12384
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(
|
|
11989
12385
|
"li",
|
|
11990
12386
|
{
|
|
11991
12387
|
ref,
|
|
@@ -11998,7 +12394,7 @@ var Layer = (0, import_react82.forwardRef)(function Layer2({
|
|
|
11998
12394
|
"data-index": dataIndex,
|
|
11999
12395
|
"data-credbuild-layer-tree-id": node.itemId,
|
|
12000
12396
|
children: [
|
|
12001
|
-
/* @__PURE__ */ (0,
|
|
12397
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: getClassNameLayer("inner"), children: /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(
|
|
12002
12398
|
"button",
|
|
12003
12399
|
{
|
|
12004
12400
|
type: "button",
|
|
@@ -12023,26 +12419,26 @@ var Layer = (0, import_react82.forwardRef)(function Layer2({
|
|
|
12023
12419
|
zoneStore.setState({ hoveringComponent: null });
|
|
12024
12420
|
},
|
|
12025
12421
|
children: [
|
|
12026
|
-
containsZone && /* @__PURE__ */ (0,
|
|
12422
|
+
containsZone && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
12027
12423
|
"div",
|
|
12028
12424
|
{
|
|
12029
12425
|
className: getClassNameLayer("chevron"),
|
|
12030
12426
|
title: isSelected ? "Collapse" : "Expand",
|
|
12031
|
-
children: /* @__PURE__ */ (0,
|
|
12427
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(ChevronDown, { size: "12" })
|
|
12032
12428
|
}
|
|
12033
12429
|
),
|
|
12034
|
-
/* @__PURE__ */ (0,
|
|
12035
|
-
/* @__PURE__ */ (0,
|
|
12036
|
-
/* @__PURE__ */ (0,
|
|
12430
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: getClassNameLayer("title"), children: [
|
|
12431
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: getClassNameLayer("icon"), children: getLayerIcon(node.componentType) }),
|
|
12432
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: getClassNameLayer("name"), children: node.label })
|
|
12037
12433
|
] })
|
|
12038
12434
|
]
|
|
12039
12435
|
}
|
|
12040
12436
|
) }),
|
|
12041
|
-
containsZone && shouldRenderChildren && node.childZones.map((childZone) => /* @__PURE__ */ (0,
|
|
12437
|
+
containsZone && shouldRenderChildren && node.childZones.map((childZone) => /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
12042
12438
|
"div",
|
|
12043
12439
|
{
|
|
12044
12440
|
className: getClassNameLayer("zones"),
|
|
12045
|
-
children: /* @__PURE__ */ (0,
|
|
12441
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
12046
12442
|
LayerTreeZone,
|
|
12047
12443
|
{
|
|
12048
12444
|
depth: depth + 1,
|
|
@@ -12065,12 +12461,12 @@ var LayerTreeZone = ({
|
|
|
12065
12461
|
tree
|
|
12066
12462
|
}) => {
|
|
12067
12463
|
const shouldVirtualize = depth === 0 && tree.items.length >= MIN_VIRTUALIZED_LAYER_COUNT;
|
|
12068
|
-
return /* @__PURE__ */ (0,
|
|
12069
|
-
tree.label && /* @__PURE__ */ (0,
|
|
12070
|
-
/* @__PURE__ */ (0,
|
|
12464
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(import_jsx_runtime80.Fragment, { children: [
|
|
12465
|
+
tree.label && /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: getClassName30("zoneTitle"), children: [
|
|
12466
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: getClassName30("zoneIcon"), children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Layers, { size: "16" }) }),
|
|
12071
12467
|
tree.label
|
|
12072
12468
|
] }),
|
|
12073
|
-
shouldVirtualize ? /* @__PURE__ */ (0,
|
|
12469
|
+
shouldVirtualize ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
12074
12470
|
VirtualizedLayerTreeItems,
|
|
12075
12471
|
{
|
|
12076
12472
|
depth,
|
|
@@ -12078,7 +12474,7 @@ var LayerTreeZone = ({
|
|
|
12078
12474
|
selectedPathIds,
|
|
12079
12475
|
tree
|
|
12080
12476
|
}
|
|
12081
|
-
) : /* @__PURE__ */ (0,
|
|
12477
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
12082
12478
|
StaticLayerTreeItems,
|
|
12083
12479
|
{
|
|
12084
12480
|
depth,
|
|
@@ -12095,9 +12491,9 @@ var StaticLayerTreeItems = ({
|
|
|
12095
12491
|
selectedPathIds,
|
|
12096
12492
|
tree
|
|
12097
12493
|
}) => {
|
|
12098
|
-
return /* @__PURE__ */ (0,
|
|
12099
|
-
tree.items.length === 0 && /* @__PURE__ */ (0,
|
|
12100
|
-
tree.items.map((node) => /* @__PURE__ */ (0,
|
|
12494
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("ul", { className: getClassName30(), children: [
|
|
12495
|
+
tree.items.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: getClassName30("helper"), children: "No items" }),
|
|
12496
|
+
tree.items.map((node) => /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
12101
12497
|
Layer,
|
|
12102
12498
|
{
|
|
12103
12499
|
childIsSelected: selectedPathIds.has(node.itemId),
|
|
@@ -12117,7 +12513,7 @@ var VirtualizedLayerTreeItems = ({
|
|
|
12117
12513
|
selectedPathIds,
|
|
12118
12514
|
tree
|
|
12119
12515
|
}) => {
|
|
12120
|
-
const listRef = (0,
|
|
12516
|
+
const listRef = (0, import_react84.useRef)(null);
|
|
12121
12517
|
const virtualizer = (0, import_react_virtual3.useVirtualizer)({
|
|
12122
12518
|
count: tree.items.length,
|
|
12123
12519
|
estimateSize: (index) => getEstimatedRowHeight(tree.items[index].itemId),
|
|
@@ -12143,7 +12539,7 @@ var VirtualizedLayerTreeItems = ({
|
|
|
12143
12539
|
const gapSize = Math.max(virtualItem.start - previousEnd, 0);
|
|
12144
12540
|
if (gapSize > 0) {
|
|
12145
12541
|
renderedItems.push(
|
|
12146
|
-
/* @__PURE__ */ (0,
|
|
12542
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
12147
12543
|
"li",
|
|
12148
12544
|
{
|
|
12149
12545
|
"aria-hidden": "true",
|
|
@@ -12154,7 +12550,7 @@ var VirtualizedLayerTreeItems = ({
|
|
|
12154
12550
|
);
|
|
12155
12551
|
}
|
|
12156
12552
|
renderedItems.push(
|
|
12157
|
-
/* @__PURE__ */ (0,
|
|
12553
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
12158
12554
|
Layer,
|
|
12159
12555
|
{
|
|
12160
12556
|
childIsSelected: selectedPathIds.has(node.itemId),
|
|
@@ -12175,7 +12571,7 @@ var VirtualizedLayerTreeItems = ({
|
|
|
12175
12571
|
const trailingGap = Math.max(totalSize - previousEnd, 0);
|
|
12176
12572
|
if (trailingGap > 0) {
|
|
12177
12573
|
renderedItems.push(
|
|
12178
|
-
/* @__PURE__ */ (0,
|
|
12574
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
12179
12575
|
"li",
|
|
12180
12576
|
{
|
|
12181
12577
|
"aria-hidden": "true",
|
|
@@ -12185,8 +12581,8 @@ var VirtualizedLayerTreeItems = ({
|
|
|
12185
12581
|
)
|
|
12186
12582
|
);
|
|
12187
12583
|
}
|
|
12188
|
-
return /* @__PURE__ */ (0,
|
|
12189
|
-
tree.items.length === 0 && /* @__PURE__ */ (0,
|
|
12584
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("ul", { className: getClassName30(), ref: listRef, children: [
|
|
12585
|
+
tree.items.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: getClassName30("helper"), children: "No items" }),
|
|
12190
12586
|
renderedItems
|
|
12191
12587
|
] });
|
|
12192
12588
|
};
|
|
@@ -12195,7 +12591,7 @@ var LayerTree = ({
|
|
|
12195
12591
|
selectedPathIds,
|
|
12196
12592
|
trees
|
|
12197
12593
|
}) => {
|
|
12198
|
-
return /* @__PURE__ */ (0,
|
|
12594
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_jsx_runtime80.Fragment, { children: trees.map((tree) => /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
12199
12595
|
LayerTreeZone,
|
|
12200
12596
|
{
|
|
12201
12597
|
depth: 0,
|
|
@@ -12209,7 +12605,7 @@ var LayerTree = ({
|
|
|
12209
12605
|
|
|
12210
12606
|
// components/CredBuild/components/Outline/index.tsx
|
|
12211
12607
|
init_store2();
|
|
12212
|
-
var
|
|
12608
|
+
var import_react85 = require("react");
|
|
12213
12609
|
|
|
12214
12610
|
// lib/data/find-zones-for-area.ts
|
|
12215
12611
|
init_react_import();
|
|
@@ -12221,7 +12617,7 @@ var findZonesForArea = (state, area) => {
|
|
|
12221
12617
|
|
|
12222
12618
|
// components/CredBuild/components/Outline/index.tsx
|
|
12223
12619
|
var import_shallow8 = require("zustand/react/shallow");
|
|
12224
|
-
var
|
|
12620
|
+
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
12225
12621
|
var Outline = () => {
|
|
12226
12622
|
const outlineOverride = useAppStore((s) => s.overrides.outline);
|
|
12227
12623
|
const config = useAppStore((s) => s.config);
|
|
@@ -12231,13 +12627,13 @@ var Outline = () => {
|
|
|
12231
12627
|
const rootZones = useAppStore(
|
|
12232
12628
|
(0, import_shallow8.useShallow)((s) => findZonesForArea(s.state, "root"))
|
|
12233
12629
|
);
|
|
12234
|
-
const selectedPathIds = (0,
|
|
12630
|
+
const selectedPathIds = (0, import_react85.useMemo)(() => {
|
|
12235
12631
|
const selectedPath = selectedId ? nodes[selectedId]?.path : null;
|
|
12236
12632
|
return new Set(
|
|
12237
12633
|
selectedPath?.map((candidate) => candidate.split(":")[0]).filter(Boolean) || []
|
|
12238
12634
|
);
|
|
12239
12635
|
}, [nodes, selectedId]);
|
|
12240
|
-
const trees = (0,
|
|
12636
|
+
const trees = (0, import_react85.useMemo)(
|
|
12241
12637
|
() => rootZones.map(
|
|
12242
12638
|
(zoneCompound) => buildLayerTree({
|
|
12243
12639
|
config,
|
|
@@ -12249,8 +12645,8 @@ var Outline = () => {
|
|
|
12249
12645
|
),
|
|
12250
12646
|
[config, nodes, rootZones, zones]
|
|
12251
12647
|
);
|
|
12252
|
-
const Wrapper = (0,
|
|
12253
|
-
return /* @__PURE__ */ (0,
|
|
12648
|
+
const Wrapper = (0, import_react85.useMemo)(() => outlineOverride || "div", [outlineOverride]);
|
|
12649
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(Wrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
12254
12650
|
LayerTree,
|
|
12255
12651
|
{
|
|
12256
12652
|
selectedId,
|
|
@@ -12265,7 +12661,7 @@ init_default_viewports();
|
|
|
12265
12661
|
|
|
12266
12662
|
// lib/use-loaded-overrides.ts
|
|
12267
12663
|
init_react_import();
|
|
12268
|
-
var
|
|
12664
|
+
var import_react86 = require("react");
|
|
12269
12665
|
|
|
12270
12666
|
// lib/load-overrides.ts
|
|
12271
12667
|
init_react_import();
|
|
@@ -12308,7 +12704,7 @@ var useLoadedOverrides = ({
|
|
|
12308
12704
|
overrides,
|
|
12309
12705
|
plugins
|
|
12310
12706
|
}) => {
|
|
12311
|
-
return (0,
|
|
12707
|
+
return (0, import_react86.useMemo)(() => {
|
|
12312
12708
|
return loadOverrides({ overrides, plugins });
|
|
12313
12709
|
}, [plugins, overrides]);
|
|
12314
12710
|
};
|
|
@@ -12319,7 +12715,7 @@ init_permissions();
|
|
|
12319
12715
|
|
|
12320
12716
|
// lib/use-credbuild.ts
|
|
12321
12717
|
init_react_import();
|
|
12322
|
-
var
|
|
12718
|
+
var import_react87 = require("react");
|
|
12323
12719
|
var import_zustand6 = require("zustand");
|
|
12324
12720
|
init_make_state_public();
|
|
12325
12721
|
init_get_item();
|
|
@@ -12423,7 +12819,7 @@ var generateUseCredBuild = (store, getState) => {
|
|
|
12423
12819
|
};
|
|
12424
12820
|
return storeData;
|
|
12425
12821
|
};
|
|
12426
|
-
var UseCredBuildStoreContext = (0,
|
|
12822
|
+
var UseCredBuildStoreContext = (0, import_react87.createContext)(
|
|
12427
12823
|
null
|
|
12428
12824
|
);
|
|
12429
12825
|
var convertToPickedStore = (store) => {
|
|
@@ -12437,7 +12833,7 @@ var convertToPickedStore = (store) => {
|
|
|
12437
12833
|
};
|
|
12438
12834
|
};
|
|
12439
12835
|
var useRegisterUseCredBuildStore = (appStore) => {
|
|
12440
|
-
const [useCredBuildStore] = (0,
|
|
12836
|
+
const [useCredBuildStore] = (0, import_react87.useState)(
|
|
12441
12837
|
() => (0, import_zustand6.createStore)(
|
|
12442
12838
|
() => generateUseCredBuild(
|
|
12443
12839
|
convertToPickedStore(appStore.getState()),
|
|
@@ -12445,7 +12841,7 @@ var useRegisterUseCredBuildStore = (appStore) => {
|
|
|
12445
12841
|
)
|
|
12446
12842
|
)
|
|
12447
12843
|
);
|
|
12448
|
-
(0,
|
|
12844
|
+
(0, import_react87.useEffect)(() => {
|
|
12449
12845
|
return appStore.subscribe(
|
|
12450
12846
|
(store) => convertToPickedStore(store),
|
|
12451
12847
|
(pickedStore) => {
|
|
@@ -12459,7 +12855,7 @@ var useRegisterUseCredBuildStore = (appStore) => {
|
|
|
12459
12855
|
};
|
|
12460
12856
|
function createUseCredBuild() {
|
|
12461
12857
|
return function useCredBuild2(selector) {
|
|
12462
|
-
const useCredBuildApi = (0,
|
|
12858
|
+
const useCredBuildApi = (0, import_react87.useContext)(UseCredBuildStoreContext);
|
|
12463
12859
|
if (!useCredBuildApi) {
|
|
12464
12860
|
throw new Error("useCredBuild must be used inside <CredBuild>.");
|
|
12465
12861
|
}
|
|
@@ -12471,7 +12867,7 @@ function createUseCredBuild() {
|
|
|
12471
12867
|
};
|
|
12472
12868
|
}
|
|
12473
12869
|
function useCredBuild() {
|
|
12474
|
-
(0,
|
|
12870
|
+
(0, import_react87.useEffect)(() => {
|
|
12475
12871
|
console.warn(
|
|
12476
12872
|
"You're using the `useCredBuild` method without a selector, which may cause unnecessary re-renders. Replace with `createUseCredBuild` and provide a selector for improved performance."
|
|
12477
12873
|
);
|
|
@@ -12479,7 +12875,7 @@ function useCredBuild() {
|
|
|
12479
12875
|
return createUseCredBuild()((s) => s);
|
|
12480
12876
|
}
|
|
12481
12877
|
function useGetCredBuild() {
|
|
12482
|
-
const useCredBuildApi = (0,
|
|
12878
|
+
const useCredBuildApi = (0, import_react87.useContext)(UseCredBuildStoreContext);
|
|
12483
12879
|
if (!useCredBuildApi) {
|
|
12484
12880
|
throw new Error("useCredBuildGet must be used inside <CredBuild>.");
|
|
12485
12881
|
}
|
|
@@ -12494,18 +12890,18 @@ init_to_component();
|
|
|
12494
12890
|
|
|
12495
12891
|
// components/CredBuild/components/Layout/index.tsx
|
|
12496
12892
|
init_react_import();
|
|
12497
|
-
var
|
|
12893
|
+
var import_react101 = require("react");
|
|
12498
12894
|
init_lib();
|
|
12499
12895
|
|
|
12500
12896
|
// components/CredBuild/context.tsx
|
|
12501
12897
|
init_react_import();
|
|
12502
|
-
var
|
|
12503
|
-
var
|
|
12504
|
-
var propsContext = (0,
|
|
12898
|
+
var import_react88 = require("react");
|
|
12899
|
+
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
12900
|
+
var propsContext = (0, import_react88.createContext)({});
|
|
12505
12901
|
function PropsProvider(props) {
|
|
12506
|
-
return /* @__PURE__ */ (0,
|
|
12902
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(propsContext.Provider, { value: props, children: props.children });
|
|
12507
12903
|
}
|
|
12508
|
-
var usePropsContext = () => (0,
|
|
12904
|
+
var usePropsContext = () => (0, import_react88.useContext)(propsContext);
|
|
12509
12905
|
|
|
12510
12906
|
// css-module:/home/crediblemark/Project/Credibuild/components/CredBuild/components/Layout/styles.module.css#css-module
|
|
12511
12907
|
init_react_import();
|
|
@@ -12513,14 +12909,14 @@ var styles_module_default22 = { "CredBuildLayout": "_CredBuildLayout_14aaz_1", "
|
|
|
12513
12909
|
|
|
12514
12910
|
// lib/use-inject-css.ts
|
|
12515
12911
|
init_react_import();
|
|
12516
|
-
var
|
|
12912
|
+
var import_react89 = require("react");
|
|
12517
12913
|
var styles = ``;
|
|
12518
12914
|
var useInjectStyleSheet = (initialStyles, iframeEnabled) => {
|
|
12519
|
-
const [el, setEl] = (0,
|
|
12520
|
-
(0,
|
|
12915
|
+
const [el, setEl] = (0, import_react89.useState)();
|
|
12916
|
+
(0, import_react89.useEffect)(() => {
|
|
12521
12917
|
setEl(document.createElement("style"));
|
|
12522
12918
|
}, []);
|
|
12523
|
-
(0,
|
|
12919
|
+
(0, import_react89.useEffect)(() => {
|
|
12524
12920
|
if (!el || typeof window === "undefined") {
|
|
12525
12921
|
return;
|
|
12526
12922
|
}
|
|
@@ -12542,20 +12938,20 @@ init_store2();
|
|
|
12542
12938
|
|
|
12543
12939
|
// components/DefaultOverride/index.tsx
|
|
12544
12940
|
init_react_import();
|
|
12545
|
-
var
|
|
12546
|
-
var DefaultOverride = ({ children }) => /* @__PURE__ */ (0,
|
|
12941
|
+
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
12942
|
+
var DefaultOverride = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_jsx_runtime83.Fragment, { children });
|
|
12547
12943
|
|
|
12548
12944
|
// components/CredBuild/components/Layout/index.tsx
|
|
12549
12945
|
init_use_hotkey();
|
|
12550
12946
|
|
|
12551
12947
|
// lib/use-preview-mode-hotkeys.ts
|
|
12552
12948
|
init_react_import();
|
|
12553
|
-
var
|
|
12949
|
+
var import_react90 = require("react");
|
|
12554
12950
|
init_use_hotkey();
|
|
12555
12951
|
init_store2();
|
|
12556
12952
|
var usePreviewModeHotkeys = () => {
|
|
12557
12953
|
const appStore = useAppStoreApi();
|
|
12558
|
-
const toggleInteractive = (0,
|
|
12954
|
+
const toggleInteractive = (0, import_react90.useCallback)(() => {
|
|
12559
12955
|
const dispatch = appStore.getState().dispatch;
|
|
12560
12956
|
dispatch({
|
|
12561
12957
|
type: "setUi",
|
|
@@ -12570,9 +12966,9 @@ var usePreviewModeHotkeys = () => {
|
|
|
12570
12966
|
|
|
12571
12967
|
// components/DragDropContext/index.tsx
|
|
12572
12968
|
init_react_import();
|
|
12573
|
-
var
|
|
12969
|
+
var import_react91 = require("@dnd-kit/react");
|
|
12574
12970
|
init_store2();
|
|
12575
|
-
var
|
|
12971
|
+
var import_react92 = require("react");
|
|
12576
12972
|
var import_dom = require("@dnd-kit/dom");
|
|
12577
12973
|
init_get_item();
|
|
12578
12974
|
|
|
@@ -12915,12 +13311,12 @@ function getDeepDir(el) {
|
|
|
12915
13311
|
// components/DragDropContext/index.tsx
|
|
12916
13312
|
init_use_sensors();
|
|
12917
13313
|
var import_state = require("@dnd-kit/state");
|
|
12918
|
-
var
|
|
13314
|
+
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
12919
13315
|
var DEBUG3 = false;
|
|
12920
13316
|
var AREA_CHANGE_DEBOUNCE_MS = 100;
|
|
12921
13317
|
var useTempDisableFallback = (timeout3) => {
|
|
12922
|
-
const lastFallbackDisable = (0,
|
|
12923
|
-
return (0,
|
|
13318
|
+
const lastFallbackDisable = (0, import_react92.useRef)(null);
|
|
13319
|
+
return (0, import_react92.useCallback)((manager) => {
|
|
12924
13320
|
collisionStore.setState({ fallbackEnabled: false });
|
|
12925
13321
|
const fallbackId = generateId();
|
|
12926
13322
|
lastFallbackDisable.current = fallbackId;
|
|
@@ -12939,9 +13335,9 @@ var DragDropContextClient = ({
|
|
|
12939
13335
|
const dispatch = useAppStore((s) => s.dispatch);
|
|
12940
13336
|
const instanceId = useAppStore((s) => s.instanceId);
|
|
12941
13337
|
const appStore = useAppStoreApi();
|
|
12942
|
-
const debouncedParamsRef = (0,
|
|
13338
|
+
const debouncedParamsRef = (0, import_react92.useRef)(null);
|
|
12943
13339
|
const tempDisableFallback = useTempDisableFallback(100);
|
|
12944
|
-
const [zoneStore] = (0,
|
|
13340
|
+
const [zoneStore] = (0, import_react92.useState)(() => {
|
|
12945
13341
|
const rootVirtualizers = /* @__PURE__ */ new Map();
|
|
12946
13342
|
return (0, import_zustand7.createStore)(() => ({
|
|
12947
13343
|
zoneDepthIndex: {},
|
|
@@ -12980,7 +13376,7 @@ var DragDropContextClient = ({
|
|
|
12980
13376
|
}
|
|
12981
13377
|
}));
|
|
12982
13378
|
});
|
|
12983
|
-
const getChanged2 = (0,
|
|
13379
|
+
const getChanged2 = (0, import_react92.useCallback)(
|
|
12984
13380
|
(params) => {
|
|
12985
13381
|
const { zoneDepthIndex = {}, areaDepthIndex = {} } = zoneStore.getState() || {};
|
|
12986
13382
|
const stateHasZone = Object.keys(zoneDepthIndex).length > 0;
|
|
@@ -13001,7 +13397,7 @@ var DragDropContextClient = ({
|
|
|
13001
13397
|
},
|
|
13002
13398
|
[zoneStore]
|
|
13003
13399
|
);
|
|
13004
|
-
const setDeepestAndCollide = (0,
|
|
13400
|
+
const setDeepestAndCollide = (0, import_react92.useCallback)(
|
|
13005
13401
|
(params, manager) => {
|
|
13006
13402
|
const { zoneChanged, areaChanged } = getChanged2(params);
|
|
13007
13403
|
if (!zoneChanged && !areaChanged) return;
|
|
@@ -13025,7 +13421,7 @@ var DragDropContextClient = ({
|
|
|
13025
13421
|
setDeepestDb.cancel();
|
|
13026
13422
|
debouncedParamsRef.current = null;
|
|
13027
13423
|
};
|
|
13028
|
-
(0,
|
|
13424
|
+
(0, import_react92.useEffect)(() => {
|
|
13029
13425
|
if (DEBUG3) {
|
|
13030
13426
|
return zoneStore.subscribe(
|
|
13031
13427
|
(s) => console.log(
|
|
@@ -13036,7 +13432,7 @@ var DragDropContextClient = ({
|
|
|
13036
13432
|
);
|
|
13037
13433
|
}
|
|
13038
13434
|
}, [zoneStore]);
|
|
13039
|
-
const [plugins] = (0,
|
|
13435
|
+
const [plugins] = (0, import_react92.useState)(() => [
|
|
13040
13436
|
...disableAutoScroll ? import_dom.defaultPreset.plugins.filter((plugin) => plugin !== import_dom.AutoScroller) : import_dom.defaultPreset.plugins,
|
|
13041
13437
|
createNestedDroppablePlugin(
|
|
13042
13438
|
{
|
|
@@ -13084,10 +13480,10 @@ var DragDropContextClient = ({
|
|
|
13084
13480
|
)
|
|
13085
13481
|
]);
|
|
13086
13482
|
const sensors = useSensors();
|
|
13087
|
-
const [dragListeners, setDragListeners] = (0,
|
|
13088
|
-
const dragMode = (0,
|
|
13089
|
-
const initialSelector = (0,
|
|
13090
|
-
const nextContextValue = (0,
|
|
13483
|
+
const [dragListeners, setDragListeners] = (0, import_react92.useState)({});
|
|
13484
|
+
const dragMode = (0, import_react92.useRef)(null);
|
|
13485
|
+
const initialSelector = (0, import_react92.useRef)(void 0);
|
|
13486
|
+
const nextContextValue = (0, import_react92.useMemo)(
|
|
13091
13487
|
() => ({
|
|
13092
13488
|
mode: "edit",
|
|
13093
13489
|
areaId: "root",
|
|
@@ -13095,15 +13491,15 @@ var DragDropContextClient = ({
|
|
|
13095
13491
|
}),
|
|
13096
13492
|
[]
|
|
13097
13493
|
);
|
|
13098
|
-
return /* @__PURE__ */ (0,
|
|
13494
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
13099
13495
|
dragListenerContext.Provider,
|
|
13100
13496
|
{
|
|
13101
13497
|
value: {
|
|
13102
13498
|
dragListeners,
|
|
13103
13499
|
setDragListeners
|
|
13104
13500
|
},
|
|
13105
|
-
children: /* @__PURE__ */ (0,
|
|
13106
|
-
|
|
13501
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
13502
|
+
import_react91.DragDropProvider,
|
|
13107
13503
|
{
|
|
13108
13504
|
plugins,
|
|
13109
13505
|
sensors,
|
|
@@ -13324,7 +13720,7 @@ var DragDropContextClient = ({
|
|
|
13324
13720
|
const entryEl = getFrame()?.querySelector("[data-credbuild-entry]");
|
|
13325
13721
|
entryEl?.setAttribute("data-credbuild-dragging", "true");
|
|
13326
13722
|
},
|
|
13327
|
-
children: /* @__PURE__ */ (0,
|
|
13723
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(ZoneStoreProvider, { store: zoneStore, children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(DropZoneProvider, { value: nextContextValue, children }) })
|
|
13328
13724
|
}
|
|
13329
13725
|
)
|
|
13330
13726
|
}
|
|
@@ -13338,12 +13734,12 @@ var DragDropContext = ({
|
|
|
13338
13734
|
if (status === "LOADING") {
|
|
13339
13735
|
return children;
|
|
13340
13736
|
}
|
|
13341
|
-
return /* @__PURE__ */ (0,
|
|
13737
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(DragDropContextClient, { disableAutoScroll, children });
|
|
13342
13738
|
};
|
|
13343
13739
|
|
|
13344
13740
|
// components/CredBuild/components/Header/index.tsx
|
|
13345
13741
|
init_react_import();
|
|
13346
|
-
var
|
|
13742
|
+
var import_react95 = require("react");
|
|
13347
13743
|
init_store2();
|
|
13348
13744
|
init_lucide_react();
|
|
13349
13745
|
init_Heading();
|
|
@@ -13361,7 +13757,7 @@ var styles_module_default23 = { "MenuBar": "_MenuBar_1m2ld_1", "MenuBar--menuOpe
|
|
|
13361
13757
|
|
|
13362
13758
|
// components/MenuBar/index.tsx
|
|
13363
13759
|
init_store2();
|
|
13364
|
-
var
|
|
13760
|
+
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
13365
13761
|
var getClassName31 = get_class_name_factory_default("MenuBar", styles_module_default23);
|
|
13366
13762
|
function MenuBar({
|
|
13367
13763
|
menuOpen = false,
|
|
@@ -13372,7 +13768,7 @@ function MenuBar({
|
|
|
13372
13768
|
const forward = useAppStore((s) => s.history.forward);
|
|
13373
13769
|
const hasFuture = useAppStore((s) => s.history.hasFuture());
|
|
13374
13770
|
const hasPast = useAppStore((s) => s.history.hasPast());
|
|
13375
|
-
return /* @__PURE__ */ (0,
|
|
13771
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
13376
13772
|
"div",
|
|
13377
13773
|
{
|
|
13378
13774
|
className: getClassName31({ menuOpen }),
|
|
@@ -13385,30 +13781,30 @@ function MenuBar({
|
|
|
13385
13781
|
setMenuOpen(false);
|
|
13386
13782
|
}
|
|
13387
13783
|
},
|
|
13388
|
-
children: /* @__PURE__ */ (0,
|
|
13389
|
-
/* @__PURE__ */ (0,
|
|
13390
|
-
/* @__PURE__ */ (0,
|
|
13784
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: getClassName31("inner"), children: [
|
|
13785
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: getClassName31("history"), children: [
|
|
13786
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
13391
13787
|
IconButton,
|
|
13392
13788
|
{
|
|
13393
13789
|
type: "button",
|
|
13394
13790
|
title: "undo",
|
|
13395
13791
|
disabled: !hasPast,
|
|
13396
13792
|
onClick: back,
|
|
13397
|
-
children: /* @__PURE__ */ (0,
|
|
13793
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Undo2, { size: 21 })
|
|
13398
13794
|
}
|
|
13399
13795
|
),
|
|
13400
|
-
/* @__PURE__ */ (0,
|
|
13796
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
13401
13797
|
IconButton,
|
|
13402
13798
|
{
|
|
13403
13799
|
type: "button",
|
|
13404
13800
|
title: "redo",
|
|
13405
13801
|
disabled: !hasFuture,
|
|
13406
13802
|
onClick: forward,
|
|
13407
|
-
children: /* @__PURE__ */ (0,
|
|
13803
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Redo2, { size: 21 })
|
|
13408
13804
|
}
|
|
13409
13805
|
)
|
|
13410
13806
|
] }),
|
|
13411
|
-
/* @__PURE__ */ (0,
|
|
13807
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_jsx_runtime85.Fragment, { children: renderHeaderActions && renderHeaderActions() })
|
|
13412
13808
|
] })
|
|
13413
13809
|
}
|
|
13414
13810
|
);
|
|
@@ -13423,7 +13819,7 @@ init_react_import();
|
|
|
13423
13819
|
init_lucide_react();
|
|
13424
13820
|
init_IconButton2();
|
|
13425
13821
|
init_store2();
|
|
13426
|
-
var
|
|
13822
|
+
var import_react93 = require("react");
|
|
13427
13823
|
init_lib();
|
|
13428
13824
|
|
|
13429
13825
|
// css-module:/home/crediblemark/Project/Credibuild/components/ViewportControls/styles.module.css#css-module
|
|
@@ -13431,12 +13827,12 @@ init_react_import();
|
|
|
13431
13827
|
var styles_module_default24 = { "ViewportControls": "_ViewportControls_1e0ai_1", "ViewportControls--fullScreen": "_ViewportControls--fullScreen_1e0ai_5", "ViewportControls-toggleButton": "_ViewportControls-toggleButton_1e0ai_14", "ViewportControls--isExpanded": "_ViewportControls--isExpanded_1e0ai_38", "ViewportControls-actions": "_ViewportControls-actions_1e0ai_42", "ViewportControls-actionsInner": "_ViewportControls-actionsInner_1e0ai_46", "ViewportControls-divider": "_ViewportControls-divider_1e0ai_75", "ViewportControls-zoomSelect": "_ViewportControls-zoomSelect_1e0ai_81", "ViewportControls-zoom": "_ViewportControls-zoom_1e0ai_81", "ViewportButton-inner": "_ViewportButton-inner_1e0ai_111", "ViewportButton--isActive": "_ViewportButton--isActive_1e0ai_119" };
|
|
13432
13828
|
|
|
13433
13829
|
// components/ViewportControls/index.tsx
|
|
13434
|
-
var
|
|
13830
|
+
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
13435
13831
|
var icons = {
|
|
13436
|
-
Smartphone: /* @__PURE__ */ (0,
|
|
13437
|
-
Tablet: /* @__PURE__ */ (0,
|
|
13438
|
-
Monitor: /* @__PURE__ */ (0,
|
|
13439
|
-
FullWidth: /* @__PURE__ */ (0,
|
|
13832
|
+
Smartphone: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(Smartphone, { size: 16 }),
|
|
13833
|
+
Tablet: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(Tablet, { size: 16 }),
|
|
13834
|
+
Monitor: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(Monitor, { size: 16 }),
|
|
13835
|
+
FullWidth: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(Expand, { size: 16 })
|
|
13440
13836
|
};
|
|
13441
13837
|
var getClassName32 = get_class_name_factory_default("ViewportControls", styles_module_default24);
|
|
13442
13838
|
var getClassNameButton = get_class_name_factory_default("ViewportButton", styles_module_default24);
|
|
@@ -13447,7 +13843,7 @@ var ActionButton = ({
|
|
|
13447
13843
|
isActive,
|
|
13448
13844
|
disabled
|
|
13449
13845
|
}) => {
|
|
13450
|
-
return /* @__PURE__ */ (0,
|
|
13846
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("span", { className: getClassNameButton({ isActive }), suppressHydrationWarning: true, children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
13451
13847
|
IconButton,
|
|
13452
13848
|
{
|
|
13453
13849
|
type: "button",
|
|
@@ -13455,7 +13851,7 @@ var ActionButton = ({
|
|
|
13455
13851
|
disabled: disabled || isActive,
|
|
13456
13852
|
onClick,
|
|
13457
13853
|
suppressHydrationWarning: true,
|
|
13458
|
-
children: /* @__PURE__ */ (0,
|
|
13854
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("span", { className: getClassNameButton("inner"), children })
|
|
13459
13855
|
}
|
|
13460
13856
|
) });
|
|
13461
13857
|
};
|
|
@@ -13480,7 +13876,7 @@ var ViewportControls = ({
|
|
|
13480
13876
|
const defaultsContainAutoZoom = defaultZoomOptions.find(
|
|
13481
13877
|
(option) => option.value === autoZoom
|
|
13482
13878
|
);
|
|
13483
|
-
const zoomOptions = (0,
|
|
13879
|
+
const zoomOptions = (0, import_react93.useMemo)(() => {
|
|
13484
13880
|
const options = [
|
|
13485
13881
|
...defaultZoomOptions,
|
|
13486
13882
|
...defaultsContainAutoZoom || isNaN(autoZoom) ? [] : [
|
|
@@ -13492,21 +13888,21 @@ var ViewportControls = ({
|
|
|
13492
13888
|
].filter((a) => a.value <= (autoZoom || 1)).sort((a, b) => a.value > b.value ? 1 : -1);
|
|
13493
13889
|
return options.length > 0 ? options : defaultZoomOptions;
|
|
13494
13890
|
}, [autoZoom, defaultsContainAutoZoom]);
|
|
13495
|
-
const [activeViewport, setActiveViewport] = (0,
|
|
13891
|
+
const [activeViewport, setActiveViewport] = (0, import_react93.useState)(
|
|
13496
13892
|
uiViewports.current.width
|
|
13497
13893
|
);
|
|
13498
|
-
(0,
|
|
13894
|
+
(0, import_react93.useEffect)(() => {
|
|
13499
13895
|
setActiveViewport(uiViewports.current.width);
|
|
13500
13896
|
}, [uiViewports.current.width, uiViewports]);
|
|
13501
|
-
const [isExpanded, setIsExpanded] = (0,
|
|
13502
|
-
return /* @__PURE__ */ (0,
|
|
13897
|
+
const [isExpanded, setIsExpanded] = (0, import_react93.useState)(false);
|
|
13898
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(
|
|
13503
13899
|
"div",
|
|
13504
13900
|
{
|
|
13505
13901
|
className: getClassName32({ isExpanded, fullScreen }),
|
|
13506
13902
|
suppressHydrationWarning: true,
|
|
13507
13903
|
children: [
|
|
13508
|
-
/* @__PURE__ */ (0,
|
|
13509
|
-
viewports.map((viewport, i) => /* @__PURE__ */ (0,
|
|
13904
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: getClassName32("actions"), children: /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: getClassName32("actionsInner"), children: [
|
|
13905
|
+
viewports.map((viewport, i) => /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
13510
13906
|
ActionButton,
|
|
13511
13907
|
{
|
|
13512
13908
|
title: viewport.label ? `Switch to ${viewport.label} viewport` : "Switch viewport",
|
|
@@ -13519,8 +13915,8 @@ var ViewportControls = ({
|
|
|
13519
13915
|
},
|
|
13520
13916
|
i
|
|
13521
13917
|
)),
|
|
13522
|
-
/* @__PURE__ */ (0,
|
|
13523
|
-
/* @__PURE__ */ (0,
|
|
13918
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: getClassName32("divider") }),
|
|
13919
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
13524
13920
|
ActionButton,
|
|
13525
13921
|
{
|
|
13526
13922
|
title: "Zoom viewport out",
|
|
@@ -13534,10 +13930,10 @@ var ViewportControls = ({
|
|
|
13534
13930
|
);
|
|
13535
13931
|
onZoom(zoomOptions[nextIndex]?.value || 1);
|
|
13536
13932
|
},
|
|
13537
|
-
children: /* @__PURE__ */ (0,
|
|
13933
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(ZoomOut, { size: 16 })
|
|
13538
13934
|
}
|
|
13539
13935
|
),
|
|
13540
|
-
/* @__PURE__ */ (0,
|
|
13936
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
13541
13937
|
ActionButton,
|
|
13542
13938
|
{
|
|
13543
13939
|
title: "Zoom viewport in",
|
|
@@ -13551,12 +13947,12 @@ var ViewportControls = ({
|
|
|
13551
13947
|
);
|
|
13552
13948
|
onZoom(zoomOptions[nextIndex]?.value || 1);
|
|
13553
13949
|
},
|
|
13554
|
-
children: /* @__PURE__ */ (0,
|
|
13950
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(ZoomIn, { size: 16 })
|
|
13555
13951
|
}
|
|
13556
13952
|
),
|
|
13557
|
-
/* @__PURE__ */ (0,
|
|
13558
|
-
/* @__PURE__ */ (0,
|
|
13559
|
-
/* @__PURE__ */ (0,
|
|
13953
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: getClassName32("zoom"), children: [
|
|
13954
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: getClassName32("divider") }),
|
|
13955
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
13560
13956
|
"select",
|
|
13561
13957
|
{
|
|
13562
13958
|
className: getClassName32("zoomSelect"),
|
|
@@ -13567,7 +13963,7 @@ var ViewportControls = ({
|
|
|
13567
13963
|
onChange: (e) => {
|
|
13568
13964
|
onZoom(parseFloat(e.currentTarget.value));
|
|
13569
13965
|
},
|
|
13570
|
-
children: zoomOptions.map((option) => /* @__PURE__ */ (0,
|
|
13966
|
+
children: zoomOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
13571
13967
|
"option",
|
|
13572
13968
|
{
|
|
13573
13969
|
value: option.value,
|
|
@@ -13579,13 +13975,13 @@ var ViewportControls = ({
|
|
|
13579
13975
|
)
|
|
13580
13976
|
] })
|
|
13581
13977
|
] }) }),
|
|
13582
|
-
/* @__PURE__ */ (0,
|
|
13978
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
13583
13979
|
"button",
|
|
13584
13980
|
{
|
|
13585
13981
|
className: getClassName32("toggleButton"),
|
|
13586
13982
|
title: "Toggle viewport menu",
|
|
13587
13983
|
onClick: () => setIsExpanded((s) => !s),
|
|
13588
|
-
children: isExpanded ? /* @__PURE__ */ (0,
|
|
13984
|
+
children: isExpanded ? /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(X, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(Monitor, { size: 16 })
|
|
13589
13985
|
}
|
|
13590
13986
|
)
|
|
13591
13987
|
]
|
|
@@ -13598,23 +13994,23 @@ var import_shallow9 = require("zustand/react/shallow");
|
|
|
13598
13994
|
|
|
13599
13995
|
// lib/frame-context.tsx
|
|
13600
13996
|
init_react_import();
|
|
13601
|
-
var
|
|
13602
|
-
var
|
|
13603
|
-
var FrameContext = (0,
|
|
13997
|
+
var import_react94 = require("react");
|
|
13998
|
+
var import_jsx_runtime87 = require("react/jsx-runtime");
|
|
13999
|
+
var FrameContext = (0, import_react94.createContext)(null);
|
|
13604
14000
|
var FrameProvider = ({
|
|
13605
14001
|
children
|
|
13606
14002
|
}) => {
|
|
13607
|
-
const frameRef = (0,
|
|
13608
|
-
const value = (0,
|
|
14003
|
+
const frameRef = (0, import_react94.useRef)(null);
|
|
14004
|
+
const value = (0, import_react94.useMemo)(
|
|
13609
14005
|
() => ({
|
|
13610
14006
|
frameRef
|
|
13611
14007
|
}),
|
|
13612
14008
|
[]
|
|
13613
14009
|
);
|
|
13614
|
-
return /* @__PURE__ */ (0,
|
|
14010
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(FrameContext.Provider, { value, children });
|
|
13615
14011
|
};
|
|
13616
14012
|
var useCanvasFrame = () => {
|
|
13617
|
-
const context = (0,
|
|
14013
|
+
const context = (0, import_react94.useContext)(FrameContext);
|
|
13618
14014
|
if (context === null) {
|
|
13619
14015
|
throw new Error("useCanvasFrame must be used within a FrameProvider");
|
|
13620
14016
|
}
|
|
@@ -13626,7 +14022,7 @@ init_react_import();
|
|
|
13626
14022
|
var styles_module_default25 = { "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" };
|
|
13627
14023
|
|
|
13628
14024
|
// components/CredBuild/components/Header/index.tsx
|
|
13629
|
-
var
|
|
14025
|
+
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
13630
14026
|
var getClassName33 = get_class_name_factory_default("CredBuildHeader", styles_module_default25);
|
|
13631
14027
|
var HeaderInner = ({
|
|
13632
14028
|
hidePlugins,
|
|
@@ -13642,7 +14038,7 @@ var HeaderInner = ({
|
|
|
13642
14038
|
} = usePropsContext();
|
|
13643
14039
|
const dispatch = useAppStore((s) => s.dispatch);
|
|
13644
14040
|
const appStore = useAppStoreApi();
|
|
13645
|
-
const defaultHeaderRender = (0,
|
|
14041
|
+
const defaultHeaderRender = (0, import_react95.useMemo)(() => {
|
|
13646
14042
|
if (renderHeader) {
|
|
13647
14043
|
console.warn(
|
|
13648
14044
|
"`renderHeader` is deprecated. Please use `overrides.header` and the `useCredBuild` hook instead"
|
|
@@ -13650,13 +14046,13 @@ var HeaderInner = ({
|
|
|
13650
14046
|
const RenderHeader = ({ actions, ...props }) => {
|
|
13651
14047
|
const Comp = renderHeader;
|
|
13652
14048
|
const appState = useAppStore((s) => s.state);
|
|
13653
|
-
return /* @__PURE__ */ (0,
|
|
14049
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Comp, { ...props, dispatch, state: appState, children: actions });
|
|
13654
14050
|
};
|
|
13655
14051
|
return RenderHeader;
|
|
13656
14052
|
}
|
|
13657
14053
|
return DefaultOverride;
|
|
13658
14054
|
}, [renderHeader, dispatch]);
|
|
13659
|
-
const defaultHeaderActionsRender = (0,
|
|
14055
|
+
const defaultHeaderActionsRender = (0, import_react95.useMemo)(() => {
|
|
13660
14056
|
if (renderHeaderActions) {
|
|
13661
14057
|
console.warn(
|
|
13662
14058
|
"`renderHeaderActions` is deprecated. Please use `overrides.headerActions` and the `useCredBuild` hook instead."
|
|
@@ -13664,7 +14060,7 @@ var HeaderInner = ({
|
|
|
13664
14060
|
const RenderHeader = (props) => {
|
|
13665
14061
|
const Comp = renderHeaderActions;
|
|
13666
14062
|
const appState = useAppStore((s) => s.state);
|
|
13667
|
-
return /* @__PURE__ */ (0,
|
|
14063
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Comp, { ...props, dispatch, state: appState });
|
|
13668
14064
|
};
|
|
13669
14065
|
return RenderHeader;
|
|
13670
14066
|
}
|
|
@@ -13676,7 +14072,7 @@ var HeaderInner = ({
|
|
|
13676
14072
|
const CustomHeaderActions = useAppStore(
|
|
13677
14073
|
(s) => s.overrides.headerActions || defaultHeaderActionsRender
|
|
13678
14074
|
);
|
|
13679
|
-
const [menuOpen, setMenuOpen] = (0,
|
|
14075
|
+
const [menuOpen, setMenuOpen] = (0, import_react95.useState)(false);
|
|
13680
14076
|
const rootTitle = useAppStore((s) => {
|
|
13681
14077
|
const rootData = s.state.indexes.nodes["root"]?.data;
|
|
13682
14078
|
return rootData.props.title ?? "";
|
|
@@ -13705,7 +14101,7 @@ var HeaderInner = ({
|
|
|
13705
14101
|
);
|
|
13706
14102
|
const { frameRef } = useCanvasFrame();
|
|
13707
14103
|
const resetAutoZoom = useResetAutoZoom(frameRef);
|
|
13708
|
-
const toggleSidebars = (0,
|
|
14104
|
+
const toggleSidebars = (0, import_react95.useCallback)(
|
|
13709
14105
|
(sidebar) => {
|
|
13710
14106
|
const widerViewport = window.matchMedia("(min-width: 638px)").matches;
|
|
13711
14107
|
const sideBarVisible = sidebar === "left" ? leftSideBarVisible : rightSideBarVisible;
|
|
@@ -13720,33 +14116,33 @@ var HeaderInner = ({
|
|
|
13720
14116
|
},
|
|
13721
14117
|
[dispatch, leftSideBarVisible, rightSideBarVisible]
|
|
13722
14118
|
);
|
|
13723
|
-
return /* @__PURE__ */ (0,
|
|
14119
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
13724
14120
|
CustomHeader,
|
|
13725
14121
|
{
|
|
13726
|
-
actions: /* @__PURE__ */ (0,
|
|
13727
|
-
/* @__PURE__ */ (0,
|
|
14122
|
+
actions: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_jsx_runtime88.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(CustomHeaderActions, { children: [
|
|
14123
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
13728
14124
|
Button,
|
|
13729
14125
|
{
|
|
13730
14126
|
href: headerPath || "/",
|
|
13731
14127
|
newTab: true,
|
|
13732
14128
|
variant: "secondary",
|
|
13733
|
-
icon: /* @__PURE__ */ (0,
|
|
14129
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(ExternalLink, { size: 14 }),
|
|
13734
14130
|
children: "View Web"
|
|
13735
14131
|
}
|
|
13736
14132
|
),
|
|
13737
|
-
/* @__PURE__ */ (0,
|
|
14133
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
13738
14134
|
Button,
|
|
13739
14135
|
{
|
|
13740
14136
|
onClick: () => {
|
|
13741
14137
|
const data = appStore.getState().state.data;
|
|
13742
14138
|
onPublish && onPublish(data);
|
|
13743
14139
|
},
|
|
13744
|
-
icon: /* @__PURE__ */ (0,
|
|
14140
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Globe, { size: 14 }),
|
|
13745
14141
|
children: "Publish"
|
|
13746
14142
|
}
|
|
13747
14143
|
)
|
|
13748
14144
|
] }) }),
|
|
13749
|
-
children: /* @__PURE__ */ (0,
|
|
14145
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
13750
14146
|
"header",
|
|
13751
14147
|
{
|
|
13752
14148
|
className: getClassName33({
|
|
@@ -13754,20 +14150,20 @@ var HeaderInner = ({
|
|
|
13754
14150
|
rightSideBarVisible,
|
|
13755
14151
|
hidePlugins
|
|
13756
14152
|
}),
|
|
13757
|
-
children: /* @__PURE__ */ (0,
|
|
13758
|
-
/* @__PURE__ */ (0,
|
|
13759
|
-
/* @__PURE__ */ (0,
|
|
13760
|
-
/* @__PURE__ */ (0,
|
|
14153
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: getClassName33("inner"), children: [
|
|
14154
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: getClassName33("leftActions"), children: [
|
|
14155
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { style: { marginRight: "8px", display: "flex", gap: "8px", alignItems: "center" }, children: [
|
|
14156
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
13761
14157
|
Button,
|
|
13762
14158
|
{
|
|
13763
14159
|
href: "/dashboard",
|
|
13764
14160
|
variant: "secondary",
|
|
13765
14161
|
size: "medium",
|
|
13766
|
-
icon: /* @__PURE__ */ (0,
|
|
14162
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(LayoutDashboard, { size: 14 }),
|
|
13767
14163
|
children: "Dashboard"
|
|
13768
14164
|
}
|
|
13769
14165
|
),
|
|
13770
|
-
/* @__PURE__ */ (0,
|
|
14166
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
13771
14167
|
IconButton,
|
|
13772
14168
|
{
|
|
13773
14169
|
type: "button",
|
|
@@ -13785,12 +14181,12 @@ var HeaderInner = ({
|
|
|
13785
14181
|
window.dispatchEvent(new CustomEvent("credbuild-theme-change", { detail: newTheme }));
|
|
13786
14182
|
},
|
|
13787
14183
|
title: "Toggle Theme",
|
|
13788
|
-
children: theme === "dark" ? /* @__PURE__ */ (0,
|
|
14184
|
+
children: theme === "dark" ? /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Sun, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Moon, { size: 16 })
|
|
13789
14185
|
}
|
|
13790
14186
|
)
|
|
13791
14187
|
] }),
|
|
13792
|
-
/* @__PURE__ */ (0,
|
|
13793
|
-
/* @__PURE__ */ (0,
|
|
14188
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: getClassName33("toggle"), children: [
|
|
14189
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: getClassName33("leftSideBarToggle"), children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
13794
14190
|
IconButton,
|
|
13795
14191
|
{
|
|
13796
14192
|
type: "button",
|
|
@@ -13798,10 +14194,10 @@ var HeaderInner = ({
|
|
|
13798
14194
|
toggleSidebars("left");
|
|
13799
14195
|
},
|
|
13800
14196
|
title: "Toggle left sidebar",
|
|
13801
|
-
children: /* @__PURE__ */ (0,
|
|
14197
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(PanelLeft, { size: 16, focusable: "false" })
|
|
13802
14198
|
}
|
|
13803
14199
|
) }),
|
|
13804
|
-
/* @__PURE__ */ (0,
|
|
14200
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: getClassName33("rightSideBarToggle"), children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
13805
14201
|
IconButton,
|
|
13806
14202
|
{
|
|
13807
14203
|
type: "button",
|
|
@@ -13809,16 +14205,16 @@ var HeaderInner = ({
|
|
|
13809
14205
|
toggleSidebars("right");
|
|
13810
14206
|
},
|
|
13811
14207
|
title: "Toggle right sidebar",
|
|
13812
|
-
children: /* @__PURE__ */ (0,
|
|
14208
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(PanelRight, { size: 16, focusable: "false" })
|
|
13813
14209
|
}
|
|
13814
14210
|
) })
|
|
13815
14211
|
] }),
|
|
13816
|
-
/* @__PURE__ */ (0,
|
|
13817
|
-
/* @__PURE__ */ (0,
|
|
13818
|
-
headerPath && /* @__PURE__ */ (0,
|
|
14212
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: getClassName33("title"), children: /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(Heading7, { rank: "2", size: "xs", children: [
|
|
14213
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { style: { fontSize: "11px", textTransform: "uppercase", letterSpacing: "0.08em", fontWeight: 600 }, children: headerTitle || rootTitle || "Page" }),
|
|
14214
|
+
headerPath && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_jsx_runtime88.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("code", { className: getClassName33("path"), style: { fontSize: "10px", opacity: 0.6, marginLeft: "8px" }, children: headerPath }) })
|
|
13819
14215
|
] }) })
|
|
13820
14216
|
] }),
|
|
13821
|
-
/* @__PURE__ */ (0,
|
|
14217
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: getClassName33("viewportTools"), children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
13822
14218
|
ViewportControls,
|
|
13823
14219
|
{
|
|
13824
14220
|
fullScreen: _experimentalFullScreenCanvas,
|
|
@@ -13844,8 +14240,8 @@ var HeaderInner = ({
|
|
|
13844
14240
|
}
|
|
13845
14241
|
}
|
|
13846
14242
|
) }),
|
|
13847
|
-
/* @__PURE__ */ (0,
|
|
13848
|
-
/* @__PURE__ */ (0,
|
|
14243
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: getClassName33("tools"), children: [
|
|
14244
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: getClassName33("menuButton"), children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
13849
14245
|
IconButton,
|
|
13850
14246
|
{
|
|
13851
14247
|
type: "button",
|
|
@@ -13853,34 +14249,34 @@ var HeaderInner = ({
|
|
|
13853
14249
|
return setMenuOpen(!menuOpen);
|
|
13854
14250
|
},
|
|
13855
14251
|
title: "Toggle menu bar",
|
|
13856
|
-
children: menuOpen ? /* @__PURE__ */ (0,
|
|
14252
|
+
children: menuOpen ? /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(ChevronUp, { size: 16, focusable: "false" }) : /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(ChevronDown, { size: 16, focusable: "false" })
|
|
13857
14253
|
}
|
|
13858
14254
|
) }),
|
|
13859
|
-
/* @__PURE__ */ (0,
|
|
14255
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
13860
14256
|
MenuBar,
|
|
13861
14257
|
{
|
|
13862
14258
|
dispatch,
|
|
13863
14259
|
onPublish,
|
|
13864
14260
|
menuOpen,
|
|
13865
|
-
renderHeaderActions: () => /* @__PURE__ */ (0,
|
|
13866
|
-
/* @__PURE__ */ (0,
|
|
14261
|
+
renderHeaderActions: () => /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(CustomHeaderActions, { children: [
|
|
14262
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
13867
14263
|
Button,
|
|
13868
14264
|
{
|
|
13869
14265
|
href: headerPath || "/",
|
|
13870
14266
|
newTab: true,
|
|
13871
14267
|
variant: "secondary",
|
|
13872
|
-
icon: /* @__PURE__ */ (0,
|
|
14268
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(ExternalLink, { size: 14 }),
|
|
13873
14269
|
children: "View Web"
|
|
13874
14270
|
}
|
|
13875
14271
|
),
|
|
13876
|
-
/* @__PURE__ */ (0,
|
|
14272
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
13877
14273
|
Button,
|
|
13878
14274
|
{
|
|
13879
14275
|
onClick: () => {
|
|
13880
14276
|
const data = appStore.getState().state.data;
|
|
13881
14277
|
onPublish && onPublish(data);
|
|
13882
14278
|
},
|
|
13883
|
-
icon: /* @__PURE__ */ (0,
|
|
14279
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Globe, { size: 14 }),
|
|
13884
14280
|
children: "Publish"
|
|
13885
14281
|
}
|
|
13886
14282
|
)
|
|
@@ -13895,7 +14291,7 @@ var HeaderInner = ({
|
|
|
13895
14291
|
}
|
|
13896
14292
|
);
|
|
13897
14293
|
};
|
|
13898
|
-
var Header = (0,
|
|
14294
|
+
var Header = (0, import_react95.memo)(HeaderInner);
|
|
13899
14295
|
|
|
13900
14296
|
// components/SidebarSection/index.tsx
|
|
13901
14297
|
init_react_import();
|
|
@@ -13922,14 +14318,14 @@ init_lucide_react();
|
|
|
13922
14318
|
|
|
13923
14319
|
// lib/use-breadcrumbs.ts
|
|
13924
14320
|
init_react_import();
|
|
13925
|
-
var
|
|
14321
|
+
var import_react96 = require("react");
|
|
13926
14322
|
init_store2();
|
|
13927
14323
|
var useBreadcrumbs = (renderCount) => {
|
|
13928
14324
|
const selectedId = useAppStore((s) => s.selectedItem?.props.id);
|
|
13929
14325
|
const config = useAppStore((s) => s.config);
|
|
13930
14326
|
const path = useAppStore((s) => s.state.indexes.nodes[selectedId]?.path);
|
|
13931
14327
|
const appStore = useAppStoreApi();
|
|
13932
|
-
return (0,
|
|
14328
|
+
return (0, import_react96.useMemo)(() => {
|
|
13933
14329
|
const breadcrumbs = path?.map((zoneCompound) => {
|
|
13934
14330
|
const [componentId] = zoneCompound.split(":");
|
|
13935
14331
|
if (componentId === "root") {
|
|
@@ -13960,7 +14356,7 @@ var useBreadcrumbs = (renderCount) => {
|
|
|
13960
14356
|
|
|
13961
14357
|
// components/Breadcrumbs/index.tsx
|
|
13962
14358
|
init_store2();
|
|
13963
|
-
var
|
|
14359
|
+
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
13964
14360
|
var getClassName34 = get_class_name_factory_default("Breadcrumbs", styles_module_default27);
|
|
13965
14361
|
var Breadcrumbs = ({
|
|
13966
14362
|
children,
|
|
@@ -13968,9 +14364,9 @@ var Breadcrumbs = ({
|
|
|
13968
14364
|
}) => {
|
|
13969
14365
|
const setUi = useAppStore((s) => s.setUi);
|
|
13970
14366
|
const breadcrumbs = useBreadcrumbs(numParents);
|
|
13971
|
-
return /* @__PURE__ */ (0,
|
|
13972
|
-
breadcrumbs.map((breadcrumb, i) => /* @__PURE__ */ (0,
|
|
13973
|
-
/* @__PURE__ */ (0,
|
|
14367
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: getClassName34(), children: [
|
|
14368
|
+
breadcrumbs.map((breadcrumb, i) => /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: getClassName34("breadcrumb"), children: [
|
|
14369
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
13974
14370
|
"button",
|
|
13975
14371
|
{
|
|
13976
14372
|
type: "button",
|
|
@@ -13979,14 +14375,14 @@ var Breadcrumbs = ({
|
|
|
13979
14375
|
children: breadcrumb.label
|
|
13980
14376
|
}
|
|
13981
14377
|
),
|
|
13982
|
-
/* @__PURE__ */ (0,
|
|
14378
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(ChevronRight, { size: 16 })
|
|
13983
14379
|
] }, i)),
|
|
13984
14380
|
children
|
|
13985
14381
|
] });
|
|
13986
14382
|
};
|
|
13987
14383
|
|
|
13988
14384
|
// components/SidebarSection/index.tsx
|
|
13989
|
-
var
|
|
14385
|
+
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
13990
14386
|
var getClassName35 = get_class_name_factory_default("SidebarSection", styles_module_default26);
|
|
13991
14387
|
var SidebarSection = ({
|
|
13992
14388
|
children,
|
|
@@ -13996,20 +14392,20 @@ var SidebarSection = ({
|
|
|
13996
14392
|
noBorderTop,
|
|
13997
14393
|
isLoading
|
|
13998
14394
|
}) => {
|
|
13999
|
-
return /* @__PURE__ */ (0,
|
|
14000
|
-
/* @__PURE__ */ (0,
|
|
14001
|
-
showBreadcrumbs && /* @__PURE__ */ (0,
|
|
14002
|
-
/* @__PURE__ */ (0,
|
|
14395
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: getClassName35({ noBorderTop }), style: { background }, children: [
|
|
14396
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: getClassName35("title"), children: /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: getClassName35("breadcrumbs"), children: [
|
|
14397
|
+
showBreadcrumbs && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Breadcrumbs, {}),
|
|
14398
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: getClassName35("heading"), children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Heading7, { rank: "2", size: "xs", children: title }) })
|
|
14003
14399
|
] }) }),
|
|
14004
|
-
/* @__PURE__ */ (0,
|
|
14005
|
-
isLoading && /* @__PURE__ */ (0,
|
|
14400
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: getClassName35("content"), children }),
|
|
14401
|
+
isLoading && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: getClassName35("loadingOverlay"), children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Loader, { size: 32 }) })
|
|
14006
14402
|
] });
|
|
14007
14403
|
};
|
|
14008
14404
|
|
|
14009
14405
|
// components/CredBuild/components/Canvas/index.tsx
|
|
14010
14406
|
init_react_import();
|
|
14011
14407
|
init_css_box_model_esm();
|
|
14012
|
-
var
|
|
14408
|
+
var import_react97 = require("react");
|
|
14013
14409
|
init_store2();
|
|
14014
14410
|
|
|
14015
14411
|
// css-module:/home/crediblemark/Project/Credibuild/components/CredBuild/components/Canvas/styles.module.css#css-module
|
|
@@ -14021,7 +14417,7 @@ init_lib();
|
|
|
14021
14417
|
init_Loader();
|
|
14022
14418
|
var import_shallow10 = require("zustand/react/shallow");
|
|
14023
14419
|
init_default_viewports();
|
|
14024
|
-
var
|
|
14420
|
+
var import_jsx_runtime91 = require("react/jsx-runtime");
|
|
14025
14421
|
var getClassName36 = get_class_name_factory_default("CredBuildCanvas", styles_module_default28);
|
|
14026
14422
|
var ZOOM_ON_CHANGE = true;
|
|
14027
14423
|
var TRANSITION_DURATION = 150;
|
|
@@ -14065,17 +14461,17 @@ var Canvas = () => {
|
|
|
14065
14461
|
viewports: s.state.ui.viewports
|
|
14066
14462
|
}))
|
|
14067
14463
|
);
|
|
14068
|
-
const [showTransition, setShowTransition] = (0,
|
|
14069
|
-
const isResizingRef = (0,
|
|
14070
|
-
const defaultRender = (0,
|
|
14071
|
-
const CredBuildDefault = ({ children }) => /* @__PURE__ */ (0,
|
|
14464
|
+
const [showTransition, setShowTransition] = (0, import_react97.useState)(false);
|
|
14465
|
+
const isResizingRef = (0, import_react97.useRef)(false);
|
|
14466
|
+
const defaultRender = (0, import_react97.useMemo)(() => {
|
|
14467
|
+
const CredBuildDefault = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_jsx_runtime91.Fragment, { children });
|
|
14072
14468
|
return CredBuildDefault;
|
|
14073
14469
|
}, []);
|
|
14074
|
-
const CustomPreview = (0,
|
|
14470
|
+
const CustomPreview = (0, import_react97.useMemo)(
|
|
14075
14471
|
() => overrides.preview || defaultRender,
|
|
14076
14472
|
[overrides, defaultRender]
|
|
14077
14473
|
);
|
|
14078
|
-
const getFrameDimensions = (0,
|
|
14474
|
+
const getFrameDimensions = (0, import_react97.useCallback)(() => {
|
|
14079
14475
|
if (frameRef.current) {
|
|
14080
14476
|
const frame = frameRef.current;
|
|
14081
14477
|
const box = getBox(frame);
|
|
@@ -14083,7 +14479,7 @@ var Canvas = () => {
|
|
|
14083
14479
|
}
|
|
14084
14480
|
return { width: 0, height: 0 };
|
|
14085
14481
|
}, [frameRef]);
|
|
14086
|
-
(0,
|
|
14482
|
+
(0, import_react97.useEffect)(() => {
|
|
14087
14483
|
resetAutoZoom();
|
|
14088
14484
|
}, [
|
|
14089
14485
|
frameRef,
|
|
@@ -14093,7 +14489,7 @@ var Canvas = () => {
|
|
|
14093
14489
|
viewports,
|
|
14094
14490
|
resetAutoZoom
|
|
14095
14491
|
]);
|
|
14096
|
-
(0,
|
|
14492
|
+
(0, import_react97.useEffect)(() => {
|
|
14097
14493
|
const { height: frameHeight } = getFrameDimensions();
|
|
14098
14494
|
if (viewports.current.height === "auto") {
|
|
14099
14495
|
const newRootHeight = frameHeight / zoomConfig.zoom;
|
|
@@ -14111,12 +14507,12 @@ var Canvas = () => {
|
|
|
14111
14507
|
viewports,
|
|
14112
14508
|
zoomConfig.rootHeight
|
|
14113
14509
|
]);
|
|
14114
|
-
(0,
|
|
14510
|
+
(0, import_react97.useEffect)(() => {
|
|
14115
14511
|
if (ZOOM_ON_CHANGE) {
|
|
14116
14512
|
resetAutoZoom();
|
|
14117
14513
|
}
|
|
14118
14514
|
}, [viewports.current.width, viewports, resetAutoZoom]);
|
|
14119
|
-
(0,
|
|
14515
|
+
(0, import_react97.useEffect)(() => {
|
|
14120
14516
|
if (!frameRef.current) return;
|
|
14121
14517
|
const resizeObserver = new ResizeObserver(() => {
|
|
14122
14518
|
if (!isResizingRef.current) {
|
|
@@ -14128,14 +14524,14 @@ var Canvas = () => {
|
|
|
14128
14524
|
resizeObserver.disconnect();
|
|
14129
14525
|
};
|
|
14130
14526
|
}, [frameRef, resetAutoZoom]);
|
|
14131
|
-
const [showLoader, setShowLoader] = (0,
|
|
14132
|
-
(0,
|
|
14527
|
+
const [showLoader, setShowLoader] = (0, import_react97.useState)(false);
|
|
14528
|
+
(0, import_react97.useEffect)(() => {
|
|
14133
14529
|
setTimeout(() => {
|
|
14134
14530
|
setShowLoader(true);
|
|
14135
14531
|
}, 500);
|
|
14136
14532
|
}, []);
|
|
14137
14533
|
const appStoreApi = useAppStoreApi();
|
|
14138
|
-
(0,
|
|
14534
|
+
(0, import_react97.useEffect)(() => {
|
|
14139
14535
|
if (typeof window === "undefined") return;
|
|
14140
14536
|
if (uiProp?.viewports?.current) return;
|
|
14141
14537
|
const viewportWidth = window.innerWidth;
|
|
@@ -14189,7 +14585,7 @@ var Canvas = () => {
|
|
|
14189
14585
|
uiProp?.viewports,
|
|
14190
14586
|
frameRef
|
|
14191
14587
|
]);
|
|
14192
|
-
return /* @__PURE__ */ (0,
|
|
14588
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
14193
14589
|
"div",
|
|
14194
14590
|
{
|
|
14195
14591
|
className: getClassName36({
|
|
@@ -14207,8 +14603,8 @@ var Canvas = () => {
|
|
|
14207
14603
|
});
|
|
14208
14604
|
}
|
|
14209
14605
|
},
|
|
14210
|
-
children: /* @__PURE__ */ (0,
|
|
14211
|
-
/* @__PURE__ */ (0,
|
|
14606
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: getClassName36("inner"), ref: frameRef, children: [
|
|
14607
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
14212
14608
|
"div",
|
|
14213
14609
|
{
|
|
14214
14610
|
className: getClassName36("root"),
|
|
@@ -14226,10 +14622,10 @@ var Canvas = () => {
|
|
|
14226
14622
|
setShowTransition(false);
|
|
14227
14623
|
isResizingRef.current = false;
|
|
14228
14624
|
},
|
|
14229
|
-
children: /* @__PURE__ */ (0,
|
|
14625
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(CustomPreview, { children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Preview, {}) })
|
|
14230
14626
|
}
|
|
14231
14627
|
),
|
|
14232
|
-
/* @__PURE__ */ (0,
|
|
14628
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: getClassName36("loader"), children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Loader, { size: 24 }) })
|
|
14233
14629
|
] })
|
|
14234
14630
|
}
|
|
14235
14631
|
);
|
|
@@ -14237,15 +14633,15 @@ var Canvas = () => {
|
|
|
14237
14633
|
|
|
14238
14634
|
// lib/use-sidebar-resize.ts
|
|
14239
14635
|
init_react_import();
|
|
14240
|
-
var
|
|
14636
|
+
var import_react98 = require("react");
|
|
14241
14637
|
init_store2();
|
|
14242
14638
|
function useSidebarResize(position, dispatch) {
|
|
14243
|
-
const [width, setWidth] = (0,
|
|
14244
|
-
const sidebarRef = (0,
|
|
14639
|
+
const [width, setWidth] = (0, import_react98.useState)(null);
|
|
14640
|
+
const sidebarRef = (0, import_react98.useRef)(null);
|
|
14245
14641
|
const storeWidth = useAppStore(
|
|
14246
14642
|
(s) => position === "left" ? s.state.ui.leftSideBarWidth : s.state.ui.rightSideBarWidth
|
|
14247
14643
|
);
|
|
14248
|
-
(0,
|
|
14644
|
+
(0, import_react98.useEffect)(() => {
|
|
14249
14645
|
if (typeof window !== "undefined" && !storeWidth) {
|
|
14250
14646
|
try {
|
|
14251
14647
|
const savedWidths = localStorage.getItem("credbuild-sidebar-widths");
|
|
@@ -14270,12 +14666,12 @@ function useSidebarResize(position, dispatch) {
|
|
|
14270
14666
|
}
|
|
14271
14667
|
}
|
|
14272
14668
|
}, [dispatch, position, storeWidth]);
|
|
14273
|
-
(0,
|
|
14669
|
+
(0, import_react98.useEffect)(() => {
|
|
14274
14670
|
if (storeWidth !== void 0) {
|
|
14275
14671
|
setWidth(storeWidth);
|
|
14276
14672
|
}
|
|
14277
14673
|
}, [storeWidth]);
|
|
14278
|
-
const handleResizeEnd = (0,
|
|
14674
|
+
const handleResizeEnd = (0, import_react98.useCallback)(
|
|
14279
14675
|
(width2) => {
|
|
14280
14676
|
dispatch({
|
|
14281
14677
|
type: "setUi",
|
|
@@ -14323,7 +14719,7 @@ init_react_import();
|
|
|
14323
14719
|
|
|
14324
14720
|
// components/CredBuild/components/ResizeHandle/index.tsx
|
|
14325
14721
|
init_react_import();
|
|
14326
|
-
var
|
|
14722
|
+
var import_react99 = require("react");
|
|
14327
14723
|
init_get_class_name_factory();
|
|
14328
14724
|
|
|
14329
14725
|
// css-module:/home/crediblemark/Project/Credibuild/components/CredBuild/components/ResizeHandle/styles.module.css#css-module
|
|
@@ -14332,7 +14728,7 @@ var styles_module_default29 = { "ResizeHandle": "_ResizeHandle_144bf_2", "Resize
|
|
|
14332
14728
|
|
|
14333
14729
|
// components/CredBuild/components/ResizeHandle/index.tsx
|
|
14334
14730
|
init_lib();
|
|
14335
|
-
var
|
|
14731
|
+
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
14336
14732
|
var getClassName37 = get_class_name_factory_default("ResizeHandle", styles_module_default29);
|
|
14337
14733
|
var ResizeHandle = ({
|
|
14338
14734
|
position,
|
|
@@ -14342,11 +14738,11 @@ var ResizeHandle = ({
|
|
|
14342
14738
|
}) => {
|
|
14343
14739
|
const { frameRef } = useCanvasFrame();
|
|
14344
14740
|
const resetAutoZoom = useResetAutoZoom(frameRef);
|
|
14345
|
-
const handleRef = (0,
|
|
14346
|
-
const isDragging = (0,
|
|
14347
|
-
const startX = (0,
|
|
14348
|
-
const startWidth = (0,
|
|
14349
|
-
const handleMouseMove = (0,
|
|
14741
|
+
const handleRef = (0, import_react99.useRef)(null);
|
|
14742
|
+
const isDragging = (0, import_react99.useRef)(false);
|
|
14743
|
+
const startX = (0, import_react99.useRef)(0);
|
|
14744
|
+
const startWidth = (0, import_react99.useRef)(0);
|
|
14745
|
+
const handleMouseMove = (0, import_react99.useCallback)(
|
|
14350
14746
|
(e) => {
|
|
14351
14747
|
if (!isDragging.current) return;
|
|
14352
14748
|
const delta = e.clientX - startX.current;
|
|
@@ -14357,7 +14753,7 @@ var ResizeHandle = ({
|
|
|
14357
14753
|
},
|
|
14358
14754
|
[onResize, position]
|
|
14359
14755
|
);
|
|
14360
|
-
const handleMouseUp = (0,
|
|
14756
|
+
const handleMouseUp = (0, import_react99.useCallback)(() => {
|
|
14361
14757
|
if (!isDragging.current) return;
|
|
14362
14758
|
isDragging.current = false;
|
|
14363
14759
|
document.body.style.cursor = "";
|
|
@@ -14372,7 +14768,7 @@ var ResizeHandle = ({
|
|
|
14372
14768
|
onResizeEnd(finalWidth);
|
|
14373
14769
|
resetAutoZoom();
|
|
14374
14770
|
}, [onResizeEnd, handleMouseMove, resetAutoZoom, sidebarRef]);
|
|
14375
|
-
const handleMouseDown = (0,
|
|
14771
|
+
const handleMouseDown = (0, import_react99.useCallback)(
|
|
14376
14772
|
(e) => {
|
|
14377
14773
|
isDragging.current = true;
|
|
14378
14774
|
startX.current = e.clientX;
|
|
@@ -14389,7 +14785,7 @@ var ResizeHandle = ({
|
|
|
14389
14785
|
},
|
|
14390
14786
|
[handleMouseMove, handleMouseUp, sidebarRef]
|
|
14391
14787
|
);
|
|
14392
|
-
return /* @__PURE__ */ (0,
|
|
14788
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
14393
14789
|
"div",
|
|
14394
14790
|
{
|
|
14395
14791
|
ref: handleRef,
|
|
@@ -14407,7 +14803,7 @@ init_react_import();
|
|
|
14407
14803
|
var styles_module_default30 = { "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" };
|
|
14408
14804
|
|
|
14409
14805
|
// components/CredBuild/components/Sidebar/index.tsx
|
|
14410
|
-
var
|
|
14806
|
+
var import_jsx_runtime93 = require("react/jsx-runtime");
|
|
14411
14807
|
var getClassName38 = get_class_name_factory_default("Sidebar", styles_module_default30);
|
|
14412
14808
|
var Sidebar = ({
|
|
14413
14809
|
position,
|
|
@@ -14417,8 +14813,8 @@ var Sidebar = ({
|
|
|
14417
14813
|
onResizeEnd,
|
|
14418
14814
|
children
|
|
14419
14815
|
}) => {
|
|
14420
|
-
return /* @__PURE__ */ (0,
|
|
14421
|
-
/* @__PURE__ */ (0,
|
|
14816
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(import_jsx_runtime93.Fragment, { children: [
|
|
14817
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
14422
14818
|
"div",
|
|
14423
14819
|
{
|
|
14424
14820
|
ref: sidebarRef,
|
|
@@ -14426,7 +14822,7 @@ var Sidebar = ({
|
|
|
14426
14822
|
children
|
|
14427
14823
|
}
|
|
14428
14824
|
),
|
|
14429
|
-
/* @__PURE__ */ (0,
|
|
14825
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: `${getClassName38("resizeHandle")}`, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
14430
14826
|
ResizeHandle,
|
|
14431
14827
|
{
|
|
14432
14828
|
position,
|
|
@@ -14440,7 +14836,7 @@ var Sidebar = ({
|
|
|
14440
14836
|
|
|
14441
14837
|
// lib/use-delete-hotkeys.ts
|
|
14442
14838
|
init_react_import();
|
|
14443
|
-
var
|
|
14839
|
+
var import_react100 = require("react");
|
|
14444
14840
|
init_use_hotkey();
|
|
14445
14841
|
init_store2();
|
|
14446
14842
|
var isElementVisible = (element) => {
|
|
@@ -14476,7 +14872,7 @@ var shouldBlockDeleteHotkey = (e) => {
|
|
|
14476
14872
|
};
|
|
14477
14873
|
var useDeleteHotkeys = () => {
|
|
14478
14874
|
const appStore = useAppStoreApi();
|
|
14479
|
-
const deleteSelectedComponent = (0,
|
|
14875
|
+
const deleteSelectedComponent = (0, import_react100.useCallback)(
|
|
14480
14876
|
(e) => {
|
|
14481
14877
|
if (shouldBlockDeleteHotkey(e)) {
|
|
14482
14878
|
return false;
|
|
@@ -14508,7 +14904,7 @@ var styles_module_default31 = { "Nav": "_Nav_wbh7e_1", "Nav-list": "_Nav-list_wb
|
|
|
14508
14904
|
|
|
14509
14905
|
// components/CredBuild/components/Nav/index.tsx
|
|
14510
14906
|
init_lib();
|
|
14511
|
-
var
|
|
14907
|
+
var import_jsx_runtime94 = require("react/jsx-runtime");
|
|
14512
14908
|
var getClassName39 = get_class_name_factory_default("Nav", styles_module_default31);
|
|
14513
14909
|
var getClassNameItem3 = get_class_name_factory_default("NavItem", styles_module_default31);
|
|
14514
14910
|
var MenuItem = ({
|
|
@@ -14519,7 +14915,7 @@ var MenuItem = ({
|
|
|
14519
14915
|
mobileOnly,
|
|
14520
14916
|
desktopOnly
|
|
14521
14917
|
}) => {
|
|
14522
|
-
return /* @__PURE__ */ (0,
|
|
14918
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
14523
14919
|
"li",
|
|
14524
14920
|
{
|
|
14525
14921
|
className: getClassNameItem3({
|
|
@@ -14527,9 +14923,9 @@ var MenuItem = ({
|
|
|
14527
14923
|
mobileOnly,
|
|
14528
14924
|
desktopOnly
|
|
14529
14925
|
}),
|
|
14530
|
-
children: onClick && /* @__PURE__ */ (0,
|
|
14531
|
-
icon && /* @__PURE__ */ (0,
|
|
14532
|
-
/* @__PURE__ */ (0,
|
|
14926
|
+
children: onClick && /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: getClassNameItem3("link"), onClick, children: [
|
|
14927
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("span", { className: getClassNameItem3("linkIcon"), children: icon }),
|
|
14928
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("span", { className: getClassNameItem3("linkLabel"), children: label })
|
|
14533
14929
|
] })
|
|
14534
14930
|
}
|
|
14535
14931
|
);
|
|
@@ -14538,9 +14934,9 @@ var Nav = ({
|
|
|
14538
14934
|
items,
|
|
14539
14935
|
mobileActions
|
|
14540
14936
|
}) => {
|
|
14541
|
-
return /* @__PURE__ */ (0,
|
|
14542
|
-
/* @__PURE__ */ (0,
|
|
14543
|
-
mobileActions && /* @__PURE__ */ (0,
|
|
14937
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("nav", { className: getClassName39(), children: [
|
|
14938
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("ul", { className: getClassName39("list"), children: Object.entries(items).map(([key, item]) => /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(MenuItem, { ...item }, key)) }),
|
|
14939
|
+
mobileActions && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: getClassName39("mobileActions"), children: mobileActions })
|
|
14544
14940
|
] });
|
|
14545
14941
|
};
|
|
14546
14942
|
|
|
@@ -14558,13 +14954,13 @@ var styles_module_default32 = { "BlocksPlugin": "_BlocksPlugin_1ey1i_1" };
|
|
|
14558
14954
|
|
|
14559
14955
|
// plugins/blocks/index.tsx
|
|
14560
14956
|
init_lib();
|
|
14561
|
-
var
|
|
14957
|
+
var import_jsx_runtime95 = require("react/jsx-runtime");
|
|
14562
14958
|
var getClassName40 = get_class_name_factory_default("BlocksPlugin", styles_module_default32);
|
|
14563
14959
|
var blocksPlugin = () => ({
|
|
14564
14960
|
name: "blocks",
|
|
14565
14961
|
label: "Blocks",
|
|
14566
|
-
render: () => /* @__PURE__ */ (0,
|
|
14567
|
-
icon: /* @__PURE__ */ (0,
|
|
14962
|
+
render: () => /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: getClassName40(), children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Components, {}) }),
|
|
14963
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Shapes, {})
|
|
14568
14964
|
});
|
|
14569
14965
|
|
|
14570
14966
|
// plugins/outline/index.tsx
|
|
@@ -14577,13 +14973,13 @@ var styles_module_default33 = { "OutlinePlugin": "_OutlinePlugin_q92j6_1" };
|
|
|
14577
14973
|
|
|
14578
14974
|
// plugins/outline/index.tsx
|
|
14579
14975
|
init_lib();
|
|
14580
|
-
var
|
|
14976
|
+
var import_jsx_runtime96 = require("react/jsx-runtime");
|
|
14581
14977
|
var getClassName41 = get_class_name_factory_default("OutlinePlugin", styles_module_default33);
|
|
14582
14978
|
var outlinePlugin = () => ({
|
|
14583
14979
|
name: "outline",
|
|
14584
14980
|
label: "Outline",
|
|
14585
|
-
render: () => /* @__PURE__ */ (0,
|
|
14586
|
-
icon: /* @__PURE__ */ (0,
|
|
14981
|
+
render: () => /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { className: getClassName41(), children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Outline, {}) }),
|
|
14982
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(List, {})
|
|
14587
14983
|
});
|
|
14588
14984
|
|
|
14589
14985
|
// plugins/fields/index.tsx
|
|
@@ -14597,7 +14993,7 @@ var styles_module_default34 = { "FieldsPlugin": "_FieldsPlugin_6as57_1", "Fields
|
|
|
14597
14993
|
|
|
14598
14994
|
// plugins/fields/index.tsx
|
|
14599
14995
|
init_lib();
|
|
14600
|
-
var
|
|
14996
|
+
var import_jsx_runtime97 = require("react/jsx-runtime");
|
|
14601
14997
|
var getClassName42 = get_class_name_factory_default("FieldsPlugin", styles_module_default34);
|
|
14602
14998
|
var CurrentTitle = () => {
|
|
14603
14999
|
const label = useAppStore((s) => {
|
|
@@ -14609,16 +15005,16 @@ var CurrentTitle = () => {
|
|
|
14609
15005
|
var fieldsPlugin = ({ desktopSideBar = "right" } = {}) => ({
|
|
14610
15006
|
name: "fields",
|
|
14611
15007
|
label: "Fields",
|
|
14612
|
-
render: () => /* @__PURE__ */ (0,
|
|
14613
|
-
/* @__PURE__ */ (0,
|
|
14614
|
-
/* @__PURE__ */ (0,
|
|
15008
|
+
render: () => /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: getClassName42(), children: [
|
|
15009
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: getClassName42("header"), children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Breadcrumbs, { numParents: 2, children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(CurrentTitle, {}) }) }),
|
|
15010
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Fields, {})
|
|
14615
15011
|
] }),
|
|
14616
|
-
icon: /* @__PURE__ */ (0,
|
|
15012
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(RectangleEllipsis, {}),
|
|
14617
15013
|
mobileOnly: desktopSideBar === "right"
|
|
14618
15014
|
});
|
|
14619
15015
|
|
|
14620
15016
|
// components/CredBuild/components/Layout/index.tsx
|
|
14621
|
-
var
|
|
15017
|
+
var import_jsx_runtime98 = require("react/jsx-runtime");
|
|
14622
15018
|
var getClassName43 = get_class_name_factory_default("CredBuild", styles_module_default22);
|
|
14623
15019
|
var getLayoutClassName = get_class_name_factory_default("CredBuildLayout", styles_module_default22);
|
|
14624
15020
|
var getPluginTabClassName = get_class_name_factory_default("CredBuildPluginTab", styles_module_default22);
|
|
@@ -14626,14 +15022,14 @@ var FieldSideBar = () => {
|
|
|
14626
15022
|
const title = useAppStore(
|
|
14627
15023
|
(s) => s.selectedItem ? s.config.components[s.selectedItem.type]?.["label"] ?? s.selectedItem.type.toString() : s.config.root?.label || "Page"
|
|
14628
15024
|
);
|
|
14629
|
-
return /* @__PURE__ */ (0,
|
|
15025
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(SidebarSection, { noBorderTop: true, showBreadcrumbs: true, title, children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(Fields, {}) });
|
|
14630
15026
|
};
|
|
14631
15027
|
var PluginTab = ({
|
|
14632
15028
|
children,
|
|
14633
15029
|
visible,
|
|
14634
15030
|
mobileOnly
|
|
14635
15031
|
}) => {
|
|
14636
|
-
return /* @__PURE__ */ (0,
|
|
15032
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: getPluginTabClassName({ visible, mobileOnly }), children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: getPluginTabClassName("body"), children }) });
|
|
14637
15033
|
};
|
|
14638
15034
|
var Layout = ({ children }) => {
|
|
14639
15035
|
const {
|
|
@@ -14643,7 +15039,7 @@ var Layout = ({ children }) => {
|
|
|
14643
15039
|
plugins,
|
|
14644
15040
|
height
|
|
14645
15041
|
} = usePropsContext();
|
|
14646
|
-
const iframe = (0,
|
|
15042
|
+
const iframe = (0, import_react101.useMemo)(
|
|
14647
15043
|
() => ({
|
|
14648
15044
|
enabled: true,
|
|
14649
15045
|
waitForStyles: true,
|
|
@@ -14670,7 +15066,7 @@ var Layout = ({ children }) => {
|
|
|
14670
15066
|
sidebarRef: rightSidebarRef,
|
|
14671
15067
|
handleResizeEnd: handleRightSidebarResizeEnd
|
|
14672
15068
|
} = useSidebarResize("right", dispatch);
|
|
14673
|
-
(0,
|
|
15069
|
+
(0, import_react101.useEffect)(() => {
|
|
14674
15070
|
if (!window.matchMedia("(min-width: 638px)").matches) {
|
|
14675
15071
|
dispatch({
|
|
14676
15072
|
type: "setUi",
|
|
@@ -14697,13 +15093,13 @@ var Layout = ({ children }) => {
|
|
|
14697
15093
|
};
|
|
14698
15094
|
}, [dispatch]);
|
|
14699
15095
|
const overrides = useAppStore((s) => s.overrides);
|
|
14700
|
-
const CustomCredBuild = (0,
|
|
15096
|
+
const CustomCredBuild = (0, import_react101.useMemo)(
|
|
14701
15097
|
() => overrides.credbuild || DefaultOverride,
|
|
14702
15098
|
[overrides]
|
|
14703
15099
|
);
|
|
14704
|
-
const [mounted, setMounted] = (0,
|
|
14705
|
-
const [theme, setTheme] = (0,
|
|
14706
|
-
(0,
|
|
15100
|
+
const [mounted, setMounted] = (0, import_react101.useState)(false);
|
|
15101
|
+
const [theme, setTheme] = (0, import_react101.useState)("dark");
|
|
15102
|
+
(0, import_react101.useEffect)(() => {
|
|
14707
15103
|
setMounted(true);
|
|
14708
15104
|
const savedTheme = localStorage.getItem("credbuild-theme");
|
|
14709
15105
|
if (savedTheme) {
|
|
@@ -14722,7 +15118,7 @@ var Layout = ({ children }) => {
|
|
|
14722
15118
|
}, []);
|
|
14723
15119
|
const ready = useAppStore((s) => s.status === "READY");
|
|
14724
15120
|
useMonitorHotkeys();
|
|
14725
|
-
(0,
|
|
15121
|
+
(0, import_react101.useEffect)(() => {
|
|
14726
15122
|
if (ready && iframe.enabled) {
|
|
14727
15123
|
const frameDoc = getFrame();
|
|
14728
15124
|
if (frameDoc) {
|
|
@@ -14742,12 +15138,12 @@ var Layout = ({ children }) => {
|
|
|
14742
15138
|
const setUi = useAppStore((s) => s.setUi);
|
|
14743
15139
|
const currentPlugin = useAppStore((s) => s.state.ui.plugin?.current);
|
|
14744
15140
|
const appStoreApi = useAppStoreApi();
|
|
14745
|
-
const [mobilePanelHeightMode, setMobilePanelHeightMode] = (0,
|
|
14746
|
-
const hasLegacySideBarPlugin = (0,
|
|
15141
|
+
const [mobilePanelHeightMode, setMobilePanelHeightMode] = (0, import_react101.useState)("toggle");
|
|
15142
|
+
const hasLegacySideBarPlugin = (0, import_react101.useMemo)(
|
|
14747
15143
|
() => !!plugins?.find((p) => p.name === "legacy-side-bar"),
|
|
14748
15144
|
[plugins]
|
|
14749
15145
|
);
|
|
14750
|
-
const pluginItems = (0,
|
|
15146
|
+
const pluginItems = (0, import_react101.useMemo)(() => {
|
|
14751
15147
|
const details = {};
|
|
14752
15148
|
const defaultPlugins = [blocksPlugin(), outlinePlugin()];
|
|
14753
15149
|
const isLegacy = (plugin) => plugin.name === "legacy-side-bar" ? -1 : 0;
|
|
@@ -14765,7 +15161,7 @@ var Layout = ({ children }) => {
|
|
|
14765
15161
|
}
|
|
14766
15162
|
details[plugin.name] = {
|
|
14767
15163
|
label: plugin.label ?? plugin.name,
|
|
14768
|
-
icon: plugin.icon ?? /* @__PURE__ */ (0,
|
|
15164
|
+
icon: plugin.icon ?? /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(ToyBrick, {}),
|
|
14769
15165
|
onClick: () => {
|
|
14770
15166
|
setMobilePanelHeightMode(plugin.mobilePanelHeight ?? "toggle");
|
|
14771
15167
|
if (plugin.name === currentPlugin) {
|
|
@@ -14792,7 +15188,7 @@ var Layout = ({ children }) => {
|
|
|
14792
15188
|
});
|
|
14793
15189
|
return details;
|
|
14794
15190
|
}, [plugins, currentPlugin, leftSideBarVisible, hasLegacySideBarPlugin, setUi]);
|
|
14795
|
-
(0,
|
|
15191
|
+
(0, import_react101.useEffect)(() => {
|
|
14796
15192
|
if (!currentPlugin) {
|
|
14797
15193
|
const names = Object.keys(pluginItems);
|
|
14798
15194
|
setUi({ plugin: { current: names[0] } });
|
|
@@ -14802,7 +15198,7 @@ var Layout = ({ children }) => {
|
|
|
14802
15198
|
const mobilePanelExpanded = useAppStore(
|
|
14803
15199
|
(s) => s.state.ui.mobilePanelExpanded ?? false
|
|
14804
15200
|
);
|
|
14805
|
-
return /* @__PURE__ */ (0,
|
|
15201
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(
|
|
14806
15202
|
"div",
|
|
14807
15203
|
{
|
|
14808
15204
|
className: `CredBuild ${theme === "dark" ? "dark" : ""} ${getClassName43({
|
|
@@ -14812,7 +15208,7 @@ var Layout = ({ children }) => {
|
|
|
14812
15208
|
id: instanceId,
|
|
14813
15209
|
style: { height: typeof height === "number" && isNaN(height) ? void 0 : height },
|
|
14814
15210
|
children: [
|
|
14815
|
-
/* @__PURE__ */ (0,
|
|
15211
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(DragDropContext, { disableAutoScroll: dnd?.disableAutoScroll, children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(CustomCredBuild, { children: children || /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(FrameProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
14816
15212
|
"div",
|
|
14817
15213
|
{
|
|
14818
15214
|
className: getLayoutClassName({
|
|
@@ -14824,14 +15220,14 @@ var Layout = ({ children }) => {
|
|
|
14824
15220
|
mobilePanelHeightMinContent: mobilePanelHeightMode === "min-content"
|
|
14825
15221
|
}),
|
|
14826
15222
|
style: { height: typeof height === "number" && isNaN(height) ? void 0 : height },
|
|
14827
|
-
children: /* @__PURE__ */ (0,
|
|
15223
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(
|
|
14828
15224
|
"div",
|
|
14829
15225
|
{
|
|
14830
15226
|
className: getLayoutClassName("inner"),
|
|
14831
15227
|
style: layoutOptions,
|
|
14832
15228
|
children: [
|
|
14833
|
-
/* @__PURE__ */ (0,
|
|
14834
|
-
/* @__PURE__ */ (0,
|
|
15229
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: getLayoutClassName("header"), children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(Header, { theme, hidePlugins: hasLegacySideBarPlugin }) }),
|
|
15230
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(
|
|
14835
15231
|
Sidebar,
|
|
14836
15232
|
{
|
|
14837
15233
|
position: "left",
|
|
@@ -14840,11 +15236,11 @@ var Layout = ({ children }) => {
|
|
|
14840
15236
|
onResize: setLeftWidth,
|
|
14841
15237
|
onResizeEnd: handleLeftSidebarResizeEnd,
|
|
14842
15238
|
children: [
|
|
14843
|
-
/* @__PURE__ */ (0,
|
|
15239
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: getLayoutClassName("nav"), children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
14844
15240
|
Nav,
|
|
14845
15241
|
{
|
|
14846
15242
|
items: pluginItems,
|
|
14847
|
-
mobileActions: typeof window !== "undefined" && !window.matchMedia("(min-width: 638px)").matches && leftSideBarVisible && mobilePanelHeightMode === "toggle" && /* @__PURE__ */ (0,
|
|
15243
|
+
mobileActions: typeof window !== "undefined" && !window.matchMedia("(min-width: 638px)").matches && leftSideBarVisible && mobilePanelHeightMode === "toggle" && /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
14848
15244
|
IconButton,
|
|
14849
15245
|
{
|
|
14850
15246
|
type: "button",
|
|
@@ -14854,18 +15250,18 @@ var Layout = ({ children }) => {
|
|
|
14854
15250
|
mobilePanelExpanded: !mobilePanelExpanded
|
|
14855
15251
|
});
|
|
14856
15252
|
},
|
|
14857
|
-
children: mobilePanelExpanded ? /* @__PURE__ */ (0,
|
|
15253
|
+
children: mobilePanelExpanded ? /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(Minimize2, { size: 21 }) : /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(Maximize2, { size: 21 })
|
|
14858
15254
|
}
|
|
14859
15255
|
)
|
|
14860
15256
|
}
|
|
14861
15257
|
) }),
|
|
14862
15258
|
Object.entries(pluginItems).map(
|
|
14863
|
-
([id, { mobileOnly, render: Render2, label }]) => /* @__PURE__ */ (0,
|
|
15259
|
+
([id, { mobileOnly, render: Render2, label }]) => /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
14864
15260
|
PluginTab,
|
|
14865
15261
|
{
|
|
14866
15262
|
visible: currentPlugin === id,
|
|
14867
15263
|
mobileOnly,
|
|
14868
|
-
children: /* @__PURE__ */ (0,
|
|
15264
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(Render2, {})
|
|
14869
15265
|
},
|
|
14870
15266
|
id
|
|
14871
15267
|
)
|
|
@@ -14873,8 +15269,8 @@ var Layout = ({ children }) => {
|
|
|
14873
15269
|
]
|
|
14874
15270
|
}
|
|
14875
15271
|
),
|
|
14876
|
-
/* @__PURE__ */ (0,
|
|
14877
|
-
!hasDesktopFieldsPlugin && /* @__PURE__ */ (0,
|
|
15272
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(Canvas, {}),
|
|
15273
|
+
!hasDesktopFieldsPlugin && /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
14878
15274
|
Sidebar,
|
|
14879
15275
|
{
|
|
14880
15276
|
position: "right",
|
|
@@ -14882,7 +15278,7 @@ var Layout = ({ children }) => {
|
|
|
14882
15278
|
isVisible: rightSideBarVisible,
|
|
14883
15279
|
onResize: setRightWidth,
|
|
14884
15280
|
onResizeEnd: handleRightSidebarResizeEnd,
|
|
14885
|
-
children: /* @__PURE__ */ (0,
|
|
15281
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(FieldSideBar, {})
|
|
14886
15282
|
}
|
|
14887
15283
|
)
|
|
14888
15284
|
]
|
|
@@ -14890,7 +15286,7 @@ var Layout = ({ children }) => {
|
|
|
14890
15286
|
)
|
|
14891
15287
|
}
|
|
14892
15288
|
) }) }) }),
|
|
14893
|
-
/* @__PURE__ */ (0,
|
|
15289
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { id: "credbuild-portal-root", className: getClassName43("portal") })
|
|
14894
15290
|
]
|
|
14895
15291
|
}
|
|
14896
15292
|
);
|
|
@@ -14898,7 +15294,7 @@ var Layout = ({ children }) => {
|
|
|
14898
15294
|
|
|
14899
15295
|
// components/CredBuild/index.tsx
|
|
14900
15296
|
init_use_safe_id();
|
|
14901
|
-
var
|
|
15297
|
+
var import_jsx_runtime99 = require("react/jsx-runtime");
|
|
14902
15298
|
function CredBuildProvider({ children }) {
|
|
14903
15299
|
const {
|
|
14904
15300
|
config,
|
|
@@ -14917,7 +15313,7 @@ function CredBuildProvider({ children }) {
|
|
|
14917
15313
|
_experimentalFullScreenCanvas,
|
|
14918
15314
|
_experimentalVirtualization
|
|
14919
15315
|
} = usePropsContext();
|
|
14920
|
-
const iframe = (0,
|
|
15316
|
+
const iframe = (0, import_react102.useMemo)(
|
|
14921
15317
|
() => ({
|
|
14922
15318
|
enabled: true,
|
|
14923
15319
|
waitForStyles: true,
|
|
@@ -14925,7 +15321,7 @@ function CredBuildProvider({ children }) {
|
|
|
14925
15321
|
}),
|
|
14926
15322
|
[_iframe]
|
|
14927
15323
|
);
|
|
14928
|
-
const [generatedAppState] = (0,
|
|
15324
|
+
const [generatedAppState] = (0, import_react102.useState)(() => {
|
|
14929
15325
|
const initial = { ...defaultAppState.ui, ...initialUi };
|
|
14930
15326
|
let clientUiState = {};
|
|
14931
15327
|
if (Object.keys(initialData?.root || {}).length > 0 && !initialData?.root?.props) {
|
|
@@ -14972,7 +15368,7 @@ function CredBuildProvider({ children }) {
|
|
|
14972
15368
|
return walkAppState(newAppState, config);
|
|
14973
15369
|
});
|
|
14974
15370
|
const { appendData = true } = _initialHistory || {};
|
|
14975
|
-
const [blendedHistories] = (0,
|
|
15371
|
+
const [blendedHistories] = (0, import_react102.useState)(
|
|
14976
15372
|
[
|
|
14977
15373
|
..._initialHistory?.histories || [],
|
|
14978
15374
|
...appendData ? [{ state: generatedAppState }] : []
|
|
@@ -14987,7 +15383,7 @@ function CredBuildProvider({ children }) {
|
|
|
14987
15383
|
};
|
|
14988
15384
|
})
|
|
14989
15385
|
);
|
|
14990
|
-
const initialHistoryIndex = (0,
|
|
15386
|
+
const initialHistoryIndex = (0, import_react102.useMemo)(() => {
|
|
14991
15387
|
if (_initialHistory?.index !== void 0 && _initialHistory?.index >= 0 && _initialHistory?.index < blendedHistories.length) {
|
|
14992
15388
|
return _initialHistory?.index;
|
|
14993
15389
|
}
|
|
@@ -14998,7 +15394,7 @@ function CredBuildProvider({ children }) {
|
|
|
14998
15394
|
overrides,
|
|
14999
15395
|
plugins
|
|
15000
15396
|
});
|
|
15001
|
-
const loadedFieldTransforms = (0,
|
|
15397
|
+
const loadedFieldTransforms = (0, import_react102.useMemo)(() => {
|
|
15002
15398
|
const _plugins = plugins || [];
|
|
15003
15399
|
const pluginFieldTransforms = _plugins.reduce(
|
|
15004
15400
|
(acc, plugin) => ({ ...acc, ...plugin.fieldTransforms }),
|
|
@@ -15010,7 +15406,7 @@ function CredBuildProvider({ children }) {
|
|
|
15010
15406
|
};
|
|
15011
15407
|
}, [fieldTransforms, plugins]);
|
|
15012
15408
|
const instanceId = useSafeId();
|
|
15013
|
-
const generateAppStore = (0,
|
|
15409
|
+
const generateAppStore = (0, import_react102.useCallback)(
|
|
15014
15410
|
(state) => {
|
|
15015
15411
|
return {
|
|
15016
15412
|
instanceId,
|
|
@@ -15041,15 +15437,15 @@ function CredBuildProvider({ children }) {
|
|
|
15041
15437
|
loadedFieldTransforms
|
|
15042
15438
|
]
|
|
15043
15439
|
);
|
|
15044
|
-
const [appStore] = (0,
|
|
15440
|
+
const [appStore] = (0, import_react102.useState)(
|
|
15045
15441
|
() => createAppStore(generateAppStore(initialAppState))
|
|
15046
15442
|
);
|
|
15047
|
-
(0,
|
|
15443
|
+
(0, import_react102.useEffect)(() => {
|
|
15048
15444
|
if (process.env.NODE_ENV !== "production") {
|
|
15049
15445
|
window.__CREDBUILD_INTERNAL_DO_NOT_USE = { appStore };
|
|
15050
15446
|
}
|
|
15051
15447
|
}, [appStore]);
|
|
15052
|
-
(0,
|
|
15448
|
+
(0, import_react102.useEffect)(() => {
|
|
15053
15449
|
const state = appStore.getState().state;
|
|
15054
15450
|
appStore.setState({
|
|
15055
15451
|
...generateAppStore(state)
|
|
@@ -15060,8 +15456,8 @@ function CredBuildProvider({ children }) {
|
|
|
15060
15456
|
index: initialHistoryIndex,
|
|
15061
15457
|
initialAppState
|
|
15062
15458
|
});
|
|
15063
|
-
const previousData = (0,
|
|
15064
|
-
(0,
|
|
15459
|
+
const previousData = (0, import_react102.useRef)(null);
|
|
15460
|
+
(0, import_react102.useEffect)(() => {
|
|
15065
15461
|
return appStore.subscribe(
|
|
15066
15462
|
(s) => s.state.data,
|
|
15067
15463
|
(data) => {
|
|
@@ -15075,16 +15471,16 @@ function CredBuildProvider({ children }) {
|
|
|
15075
15471
|
}, [onChange, appStore]);
|
|
15076
15472
|
useRegisterPermissionsSlice(appStore, permissions);
|
|
15077
15473
|
const uCredBuildStore = useRegisterUseCredBuildStore(appStore);
|
|
15078
|
-
(0,
|
|
15474
|
+
(0, import_react102.useEffect)(() => {
|
|
15079
15475
|
const { resolveAndCommitData } = appStore.getState();
|
|
15080
15476
|
setTimeout(() => {
|
|
15081
15477
|
resolveAndCommitData();
|
|
15082
15478
|
}, 0);
|
|
15083
15479
|
}, [appStore]);
|
|
15084
|
-
return /* @__PURE__ */ (0,
|
|
15480
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(appStoreContext.Provider, { value: appStore, children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(UseCredBuildStoreContext.Provider, { value: uCredBuildStore, children }) });
|
|
15085
15481
|
}
|
|
15086
15482
|
function CredBuild(props) {
|
|
15087
|
-
return /* @__PURE__ */ (0,
|
|
15483
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(PropsProvider, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(CredBuildProvider, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(Layout, { children: props.children }) }) });
|
|
15088
15484
|
}
|
|
15089
15485
|
CredBuild.Components = Components;
|
|
15090
15486
|
CredBuild.Fields = Fields;
|
|
@@ -15348,12 +15744,12 @@ init_walk_tree();
|
|
|
15348
15744
|
|
|
15349
15745
|
// plugins/legacy-side-bar/index.tsx
|
|
15350
15746
|
init_react_import();
|
|
15351
|
-
var
|
|
15747
|
+
var import_jsx_runtime100 = require("react/jsx-runtime");
|
|
15352
15748
|
var legacySideBarPlugin = () => ({
|
|
15353
15749
|
name: "legacy-side-bar",
|
|
15354
|
-
render: () => /* @__PURE__ */ (0,
|
|
15355
|
-
/* @__PURE__ */ (0,
|
|
15356
|
-
/* @__PURE__ */ (0,
|
|
15750
|
+
render: () => /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { style: { overflowY: "auto" }, children: [
|
|
15751
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(SidebarSection, { title: "Components", noBorderTop: true, children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Components, {}) }),
|
|
15752
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(SidebarSection, { title: "Outline", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Outline, {}) })
|
|
15357
15753
|
] })
|
|
15358
15754
|
});
|
|
15359
15755
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -15362,6 +15758,7 @@ var legacySideBarPlugin = () => ({
|
|
|
15362
15758
|
ActionBar,
|
|
15363
15759
|
AutoField,
|
|
15364
15760
|
Button,
|
|
15761
|
+
ColorPickerField,
|
|
15365
15762
|
CredBuild,
|
|
15366
15763
|
Drawer,
|
|
15367
15764
|
DropZone,
|
|
@@ -15370,8 +15767,10 @@ var legacySideBarPlugin = () => ({
|
|
|
15370
15767
|
IconButton,
|
|
15371
15768
|
Label,
|
|
15372
15769
|
Render,
|
|
15770
|
+
ResponsiveSliderField,
|
|
15373
15771
|
RichTextMenu,
|
|
15374
15772
|
Separator,
|
|
15773
|
+
SliderField,
|
|
15375
15774
|
blocksPlugin,
|
|
15376
15775
|
createUseCredBuild,
|
|
15377
15776
|
fieldsPlugin,
|