@clyrex-digital/clyrex-controls-dev 0.8.1-dev.20260918101819 → 0.8.1-dev.20260919082926
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/{DataBindingControls-54BNRIUZ.mjs → DataBindingControls-2UETIUJJ.mjs} +1 -1
- package/dist/{DataBindingControls-AJKE3EWG.mjs → DataBindingControls-CHXAZSAC.mjs} +1 -1
- package/dist/{InputControlClient-SROI2BE2.mjs → InputControlClient-H7BLOV3P.mjs} +1 -1
- package/dist/{InputControlClient-IZXNAD2P.mjs → InputControlClient-M4D4WJVQ.mjs} +16 -3
- package/dist/{chunk-XMAYRT62.mjs → chunk-HVJZPJGV.mjs} +1 -1
- package/dist/{chunk-A5UTFK4O.mjs → chunk-OC3VBCRR.mjs} +16 -3
- package/dist/index.js +45 -33
- package/dist/index.mjs +31 -32
- package/dist/server.js +45 -33
- package/dist/server.mjs +29 -30
- package/package.json +1 -1
|
@@ -13,7 +13,7 @@ import { useRouter } from "next/navigation";
|
|
|
13
13
|
|
|
14
14
|
// src/components/controls/edit/InputControl.tsx
|
|
15
15
|
import dynamic from "next/dynamic";
|
|
16
|
-
var InputControl = dynamic(() => import("./InputControlClient-
|
|
16
|
+
var InputControl = dynamic(() => import("./InputControlClient-M4D4WJVQ.mjs"), {
|
|
17
17
|
ssr: false
|
|
18
18
|
});
|
|
19
19
|
var InputControl_default = InputControl;
|
|
@@ -635,8 +635,20 @@ var DateTimeInput_default = DateTimeInput;
|
|
|
635
635
|
// src/components/controls/edit/ColorInput.tsx
|
|
636
636
|
import React11, { useEffect as useEffect2 } from "react";
|
|
637
637
|
import { jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
638
|
+
var DEFAULT_COLOR = "#3b82f6";
|
|
638
639
|
var ColorInput = (props) => {
|
|
639
|
-
const [color, setColor] = React11.useState(
|
|
640
|
+
const [color, setColor] = React11.useState(DEFAULT_COLOR);
|
|
641
|
+
useEffect2(() => {
|
|
642
|
+
const hasValue = props.value !== void 0 && props.value !== null && props.value !== "";
|
|
643
|
+
if (!hasValue && props.callback && !props.attributes?.readOnly) {
|
|
644
|
+
props.callback({
|
|
645
|
+
name: props.name,
|
|
646
|
+
value: DEFAULT_COLOR,
|
|
647
|
+
index: props.index,
|
|
648
|
+
groupKey: props.groupKey
|
|
649
|
+
});
|
|
650
|
+
}
|
|
651
|
+
}, []);
|
|
640
652
|
useEffect2(() => {
|
|
641
653
|
if (props.value !== void 0 && props.value !== null) {
|
|
642
654
|
if (typeof props.value === "string") {
|
|
@@ -670,7 +682,8 @@ var ColorInput = (props) => {
|
|
|
670
682
|
value: color,
|
|
671
683
|
onChange: handleColorChange,
|
|
672
684
|
required: props?.attributes?.required,
|
|
673
|
-
|
|
685
|
+
disabled: props?.attributes?.readOnly,
|
|
686
|
+
className: `peer block cursor-pointer`,
|
|
674
687
|
style: {
|
|
675
688
|
width: "78px",
|
|
676
689
|
height: "33px",
|
|
@@ -685,7 +698,7 @@ var ColorInput = (props) => {
|
|
|
685
698
|
}
|
|
686
699
|
}
|
|
687
700
|
),
|
|
688
|
-
|
|
701
|
+
/* @__PURE__ */ jsx11("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
689
702
|
] });
|
|
690
703
|
};
|
|
691
704
|
var ColorInput_default = ColorInput;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
// src/components/controls/edit/InputControl.tsx
|
|
5
5
|
import dynamic from "next/dynamic";
|
|
6
|
-
var InputControl = dynamic(() => import("./InputControlClient-
|
|
6
|
+
var InputControl = dynamic(() => import("./InputControlClient-H7BLOV3P.mjs"), {
|
|
7
7
|
ssr: false
|
|
8
8
|
});
|
|
9
9
|
var InputControl_default = InputControl;
|
|
@@ -619,8 +619,20 @@ var DateTimeInput_default = DateTimeInput;
|
|
|
619
619
|
// src/components/controls/edit/ColorInput.tsx
|
|
620
620
|
import React11, { useEffect as useEffect2 } from "react";
|
|
621
621
|
import { jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
622
|
+
var DEFAULT_COLOR = "#3b82f6";
|
|
622
623
|
var ColorInput = (props) => {
|
|
623
|
-
const [color, setColor] = React11.useState(
|
|
624
|
+
const [color, setColor] = React11.useState(DEFAULT_COLOR);
|
|
625
|
+
useEffect2(() => {
|
|
626
|
+
const hasValue = props.value !== void 0 && props.value !== null && props.value !== "";
|
|
627
|
+
if (!hasValue && props.callback && !props.attributes?.readOnly) {
|
|
628
|
+
props.callback({
|
|
629
|
+
name: props.name,
|
|
630
|
+
value: DEFAULT_COLOR,
|
|
631
|
+
index: props.index,
|
|
632
|
+
groupKey: props.groupKey
|
|
633
|
+
});
|
|
634
|
+
}
|
|
635
|
+
}, []);
|
|
624
636
|
useEffect2(() => {
|
|
625
637
|
if (props.value !== void 0 && props.value !== null) {
|
|
626
638
|
if (typeof props.value === "string") {
|
|
@@ -654,7 +666,8 @@ var ColorInput = (props) => {
|
|
|
654
666
|
value: color,
|
|
655
667
|
onChange: handleColorChange,
|
|
656
668
|
required: props?.attributes?.required,
|
|
657
|
-
|
|
669
|
+
disabled: props?.attributes?.readOnly,
|
|
670
|
+
className: `peer block cursor-pointer`,
|
|
658
671
|
style: {
|
|
659
672
|
width: "78px",
|
|
660
673
|
height: "33px",
|
|
@@ -669,7 +682,7 @@ var ColorInput = (props) => {
|
|
|
669
682
|
}
|
|
670
683
|
}
|
|
671
684
|
),
|
|
672
|
-
|
|
685
|
+
/* @__PURE__ */ jsx11("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
673
686
|
] });
|
|
674
687
|
};
|
|
675
688
|
var ColorInput_default = ColorInput;
|
package/dist/index.js
CHANGED
|
@@ -2865,14 +2865,26 @@ var init_DateTimeInput = __esm({
|
|
|
2865
2865
|
});
|
|
2866
2866
|
|
|
2867
2867
|
// src/components/controls/edit/ColorInput.tsx
|
|
2868
|
-
var import_react33, import_jsx_runtime40, ColorInput, ColorInput_default;
|
|
2868
|
+
var import_react33, import_jsx_runtime40, DEFAULT_COLOR, ColorInput, ColorInput_default;
|
|
2869
2869
|
var init_ColorInput = __esm({
|
|
2870
2870
|
"src/components/controls/edit/ColorInput.tsx"() {
|
|
2871
2871
|
"use strict";
|
|
2872
2872
|
import_react33 = __toESM(require("react"));
|
|
2873
2873
|
import_jsx_runtime40 = require("react/jsx-runtime");
|
|
2874
|
+
DEFAULT_COLOR = "#3b82f6";
|
|
2874
2875
|
ColorInput = (props) => {
|
|
2875
|
-
const [color, setColor] = import_react33.default.useState(
|
|
2876
|
+
const [color, setColor] = import_react33.default.useState(DEFAULT_COLOR);
|
|
2877
|
+
(0, import_react33.useEffect)(() => {
|
|
2878
|
+
const hasValue = props.value !== void 0 && props.value !== null && props.value !== "";
|
|
2879
|
+
if (!hasValue && props.callback && !props.attributes?.readOnly) {
|
|
2880
|
+
props.callback({
|
|
2881
|
+
name: props.name,
|
|
2882
|
+
value: DEFAULT_COLOR,
|
|
2883
|
+
index: props.index,
|
|
2884
|
+
groupKey: props.groupKey
|
|
2885
|
+
});
|
|
2886
|
+
}
|
|
2887
|
+
}, []);
|
|
2876
2888
|
(0, import_react33.useEffect)(() => {
|
|
2877
2889
|
if (props.value !== void 0 && props.value !== null) {
|
|
2878
2890
|
if (typeof props.value === "string") {
|
|
@@ -2906,7 +2918,8 @@ var init_ColorInput = __esm({
|
|
|
2906
2918
|
value: color,
|
|
2907
2919
|
onChange: handleColorChange,
|
|
2908
2920
|
required: props?.attributes?.required,
|
|
2909
|
-
|
|
2921
|
+
disabled: props?.attributes?.readOnly,
|
|
2922
|
+
className: `peer block cursor-pointer`,
|
|
2910
2923
|
style: {
|
|
2911
2924
|
width: "78px",
|
|
2912
2925
|
height: "33px",
|
|
@@ -2921,7 +2934,7 @@ var init_ColorInput = __esm({
|
|
|
2921
2934
|
}
|
|
2922
2935
|
}
|
|
2923
2936
|
),
|
|
2924
|
-
|
|
2937
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
2925
2938
|
] });
|
|
2926
2939
|
};
|
|
2927
2940
|
ColorInput_default = ColorInput;
|
|
@@ -8163,6 +8176,30 @@ var getNestedValue5 = (obj, path) => {
|
|
|
8163
8176
|
return current && current[key] !== void 0 ? current[key] : void 0;
|
|
8164
8177
|
}, obj);
|
|
8165
8178
|
};
|
|
8179
|
+
var parseDocuments = (value) => {
|
|
8180
|
+
if (typeof value === "string") {
|
|
8181
|
+
const trimmed = value.trim();
|
|
8182
|
+
if (!trimmed) return [];
|
|
8183
|
+
if (trimmed.startsWith("[") || trimmed.startsWith("{")) {
|
|
8184
|
+
try {
|
|
8185
|
+
return parseDocuments(JSON.parse(trimmed));
|
|
8186
|
+
} catch {
|
|
8187
|
+
return [];
|
|
8188
|
+
}
|
|
8189
|
+
}
|
|
8190
|
+
return [{ assetUrl: trimmed }];
|
|
8191
|
+
}
|
|
8192
|
+
if (Array.isArray(value)) {
|
|
8193
|
+
return value.filter(
|
|
8194
|
+
(item) => Boolean(item && typeof item === "object" && typeof item.assetUrl === "string" && item.assetUrl.trim())
|
|
8195
|
+
);
|
|
8196
|
+
}
|
|
8197
|
+
if (value && typeof value === "object" && "assetUrl" in value) {
|
|
8198
|
+
const asset = value;
|
|
8199
|
+
return typeof asset.assetUrl === "string" && asset.assetUrl.trim() ? [asset] : [];
|
|
8200
|
+
}
|
|
8201
|
+
return [];
|
|
8202
|
+
};
|
|
8166
8203
|
var PdfIcon2 = () => /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(
|
|
8167
8204
|
"svg",
|
|
8168
8205
|
{
|
|
@@ -8473,38 +8510,13 @@ var getFileDetails2 = (url) => {
|
|
|
8473
8510
|
return { Icon: Icon2, extLabel };
|
|
8474
8511
|
};
|
|
8475
8512
|
var DocumentNode = (props) => {
|
|
8476
|
-
console.log("DocumentNode rendered");
|
|
8477
|
-
console.log("props", props);
|
|
8478
|
-
console.log("node", props.node);
|
|
8479
8513
|
let documents = [];
|
|
8480
8514
|
if (props.dataitem && props.node.documentKey) {
|
|
8481
8515
|
const docData = getNestedValue5(props.dataitem, props.node.documentKey);
|
|
8482
|
-
|
|
8483
|
-
|
|
8484
|
-
|
|
8485
|
-
|
|
8486
|
-
const parsed = JSON.parse(trimmed);
|
|
8487
|
-
if (Array.isArray(parsed)) {
|
|
8488
|
-
documents = parsed.filter(
|
|
8489
|
-
(item) => item && item.assetUrl
|
|
8490
|
-
);
|
|
8491
|
-
} else if (parsed?.assetUrl) {
|
|
8492
|
-
documents = [parsed];
|
|
8493
|
-
}
|
|
8494
|
-
} catch {
|
|
8495
|
-
}
|
|
8496
|
-
} else {
|
|
8497
|
-
documents = [
|
|
8498
|
-
{
|
|
8499
|
-
assetUrl: docData
|
|
8500
|
-
}
|
|
8501
|
-
];
|
|
8502
|
-
}
|
|
8503
|
-
} else if (Array.isArray(docData)) {
|
|
8504
|
-
documents = docData.filter((item) => item && item.assetUrl);
|
|
8505
|
-
} else if (docData && typeof docData === "object" && docData.assetUrl) {
|
|
8506
|
-
documents = [docData];
|
|
8507
|
-
}
|
|
8516
|
+
documents = parseDocuments(docData);
|
|
8517
|
+
}
|
|
8518
|
+
if (documents.length === 0 && props.node.documentAsset) {
|
|
8519
|
+
documents = parseDocuments(props.node.documentAsset);
|
|
8508
8520
|
}
|
|
8509
8521
|
if (documents.length === 0) {
|
|
8510
8522
|
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_jsx_runtime82.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "py-4 px-2 bg-neutral-weak border rounded text-center flex flex-col gap-2", children: [
|
package/dist/index.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "./chunk-SNDGEYWZ.mjs";
|
|
9
9
|
import {
|
|
10
10
|
InputControl_default
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-HVJZPJGV.mjs";
|
|
12
12
|
import "./chunk-JDX47MFV.mjs";
|
|
13
13
|
import {
|
|
14
14
|
CheckboxInput_default,
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
SelectWithSearchInput_default,
|
|
28
28
|
Select_default,
|
|
29
29
|
TimeInput_default
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-OC3VBCRR.mjs";
|
|
31
31
|
import {
|
|
32
32
|
Hyperlink,
|
|
33
33
|
Icon_default
|
|
@@ -1926,6 +1926,30 @@ var getNestedValue5 = (obj, path) => {
|
|
|
1926
1926
|
return current && current[key] !== void 0 ? current[key] : void 0;
|
|
1927
1927
|
}, obj);
|
|
1928
1928
|
};
|
|
1929
|
+
var parseDocuments = (value) => {
|
|
1930
|
+
if (typeof value === "string") {
|
|
1931
|
+
const trimmed = value.trim();
|
|
1932
|
+
if (!trimmed) return [];
|
|
1933
|
+
if (trimmed.startsWith("[") || trimmed.startsWith("{")) {
|
|
1934
|
+
try {
|
|
1935
|
+
return parseDocuments(JSON.parse(trimmed));
|
|
1936
|
+
} catch {
|
|
1937
|
+
return [];
|
|
1938
|
+
}
|
|
1939
|
+
}
|
|
1940
|
+
return [{ assetUrl: trimmed }];
|
|
1941
|
+
}
|
|
1942
|
+
if (Array.isArray(value)) {
|
|
1943
|
+
return value.filter(
|
|
1944
|
+
(item) => Boolean(item && typeof item === "object" && typeof item.assetUrl === "string" && item.assetUrl.trim())
|
|
1945
|
+
);
|
|
1946
|
+
}
|
|
1947
|
+
if (value && typeof value === "object" && "assetUrl" in value) {
|
|
1948
|
+
const asset = value;
|
|
1949
|
+
return typeof asset.assetUrl === "string" && asset.assetUrl.trim() ? [asset] : [];
|
|
1950
|
+
}
|
|
1951
|
+
return [];
|
|
1952
|
+
};
|
|
1929
1953
|
var PdfIcon = () => /* @__PURE__ */ jsxs13(
|
|
1930
1954
|
"svg",
|
|
1931
1955
|
{
|
|
@@ -2236,38 +2260,13 @@ var getFileDetails = (url) => {
|
|
|
2236
2260
|
return { Icon, extLabel };
|
|
2237
2261
|
};
|
|
2238
2262
|
var DocumentNode = (props) => {
|
|
2239
|
-
console.log("DocumentNode rendered");
|
|
2240
|
-
console.log("props", props);
|
|
2241
|
-
console.log("node", props.node);
|
|
2242
2263
|
let documents = [];
|
|
2243
2264
|
if (props.dataitem && props.node.documentKey) {
|
|
2244
2265
|
const docData = getNestedValue5(props.dataitem, props.node.documentKey);
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
const parsed = JSON.parse(trimmed);
|
|
2250
|
-
if (Array.isArray(parsed)) {
|
|
2251
|
-
documents = parsed.filter(
|
|
2252
|
-
(item) => item && item.assetUrl
|
|
2253
|
-
);
|
|
2254
|
-
} else if (parsed?.assetUrl) {
|
|
2255
|
-
documents = [parsed];
|
|
2256
|
-
}
|
|
2257
|
-
} catch {
|
|
2258
|
-
}
|
|
2259
|
-
} else {
|
|
2260
|
-
documents = [
|
|
2261
|
-
{
|
|
2262
|
-
assetUrl: docData
|
|
2263
|
-
}
|
|
2264
|
-
];
|
|
2265
|
-
}
|
|
2266
|
-
} else if (Array.isArray(docData)) {
|
|
2267
|
-
documents = docData.filter((item) => item && item.assetUrl);
|
|
2268
|
-
} else if (docData && typeof docData === "object" && docData.assetUrl) {
|
|
2269
|
-
documents = [docData];
|
|
2270
|
-
}
|
|
2266
|
+
documents = parseDocuments(docData);
|
|
2267
|
+
}
|
|
2268
|
+
if (documents.length === 0 && props.node.documentAsset) {
|
|
2269
|
+
documents = parseDocuments(props.node.documentAsset);
|
|
2271
2270
|
}
|
|
2272
2271
|
if (documents.length === 0) {
|
|
2273
2272
|
return /* @__PURE__ */ jsx34(Fragment6, { children: /* @__PURE__ */ jsxs13("div", { className: "py-4 px-2 bg-neutral-weak border rounded text-center flex flex-col gap-2", children: [
|
|
@@ -2392,7 +2391,7 @@ var GoogleMapNode_default = GoogleMapNode;
|
|
|
2392
2391
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
2393
2392
|
import { jsx as jsx36, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2394
2393
|
var Pagination = dynamic13(() => import("./Pagination-BDWRNSFB.mjs"), { ssr: true });
|
|
2395
|
-
var DataBindingControls = dynamic13(() => import("./DataBindingControls-
|
|
2394
|
+
var DataBindingControls = dynamic13(() => import("./DataBindingControls-CHXAZSAC.mjs"), {
|
|
2396
2395
|
ssr: true
|
|
2397
2396
|
});
|
|
2398
2397
|
var Slider = dynamic13(() => import("./Slider-IVPJBPE5.mjs"), {
|
package/dist/server.js
CHANGED
|
@@ -4344,14 +4344,26 @@ var init_DateTimeInput = __esm({
|
|
|
4344
4344
|
});
|
|
4345
4345
|
|
|
4346
4346
|
// src/components/controls/edit/ColorInput.tsx
|
|
4347
|
-
var import_react49, import_jsx_runtime74, ColorInput, ColorInput_default;
|
|
4347
|
+
var import_react49, import_jsx_runtime74, DEFAULT_COLOR, ColorInput, ColorInput_default;
|
|
4348
4348
|
var init_ColorInput = __esm({
|
|
4349
4349
|
"src/components/controls/edit/ColorInput.tsx"() {
|
|
4350
4350
|
"use strict";
|
|
4351
4351
|
import_react49 = __toESM(require("react"));
|
|
4352
4352
|
import_jsx_runtime74 = require("react/jsx-runtime");
|
|
4353
|
+
DEFAULT_COLOR = "#3b82f6";
|
|
4353
4354
|
ColorInput = (props) => {
|
|
4354
|
-
const [color, setColor] = import_react49.default.useState(
|
|
4355
|
+
const [color, setColor] = import_react49.default.useState(DEFAULT_COLOR);
|
|
4356
|
+
(0, import_react49.useEffect)(() => {
|
|
4357
|
+
const hasValue = props.value !== void 0 && props.value !== null && props.value !== "";
|
|
4358
|
+
if (!hasValue && props.callback && !props.attributes?.readOnly) {
|
|
4359
|
+
props.callback({
|
|
4360
|
+
name: props.name,
|
|
4361
|
+
value: DEFAULT_COLOR,
|
|
4362
|
+
index: props.index,
|
|
4363
|
+
groupKey: props.groupKey
|
|
4364
|
+
});
|
|
4365
|
+
}
|
|
4366
|
+
}, []);
|
|
4355
4367
|
(0, import_react49.useEffect)(() => {
|
|
4356
4368
|
if (props.value !== void 0 && props.value !== null) {
|
|
4357
4369
|
if (typeof props.value === "string") {
|
|
@@ -4385,7 +4397,8 @@ var init_ColorInput = __esm({
|
|
|
4385
4397
|
value: color,
|
|
4386
4398
|
onChange: handleColorChange,
|
|
4387
4399
|
required: props?.attributes?.required,
|
|
4388
|
-
|
|
4400
|
+
disabled: props?.attributes?.readOnly,
|
|
4401
|
+
className: `peer block cursor-pointer`,
|
|
4389
4402
|
style: {
|
|
4390
4403
|
width: "78px",
|
|
4391
4404
|
height: "33px",
|
|
@@ -4400,7 +4413,7 @@ var init_ColorInput = __esm({
|
|
|
4400
4413
|
}
|
|
4401
4414
|
}
|
|
4402
4415
|
),
|
|
4403
|
-
|
|
4416
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
4404
4417
|
] });
|
|
4405
4418
|
};
|
|
4406
4419
|
ColorInput_default = ColorInput;
|
|
@@ -8132,6 +8145,30 @@ var getNestedValue5 = (obj, path) => {
|
|
|
8132
8145
|
return current && current[key] !== void 0 ? current[key] : void 0;
|
|
8133
8146
|
}, obj);
|
|
8134
8147
|
};
|
|
8148
|
+
var parseDocuments = (value) => {
|
|
8149
|
+
if (typeof value === "string") {
|
|
8150
|
+
const trimmed = value.trim();
|
|
8151
|
+
if (!trimmed) return [];
|
|
8152
|
+
if (trimmed.startsWith("[") || trimmed.startsWith("{")) {
|
|
8153
|
+
try {
|
|
8154
|
+
return parseDocuments(JSON.parse(trimmed));
|
|
8155
|
+
} catch {
|
|
8156
|
+
return [];
|
|
8157
|
+
}
|
|
8158
|
+
}
|
|
8159
|
+
return [{ assetUrl: trimmed }];
|
|
8160
|
+
}
|
|
8161
|
+
if (Array.isArray(value)) {
|
|
8162
|
+
return value.filter(
|
|
8163
|
+
(item) => Boolean(item && typeof item === "object" && typeof item.assetUrl === "string" && item.assetUrl.trim())
|
|
8164
|
+
);
|
|
8165
|
+
}
|
|
8166
|
+
if (value && typeof value === "object" && "assetUrl" in value) {
|
|
8167
|
+
const asset = value;
|
|
8168
|
+
return typeof asset.assetUrl === "string" && asset.assetUrl.trim() ? [asset] : [];
|
|
8169
|
+
}
|
|
8170
|
+
return [];
|
|
8171
|
+
};
|
|
8135
8172
|
var PdfIcon2 = () => /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
8136
8173
|
"svg",
|
|
8137
8174
|
{
|
|
@@ -8442,38 +8479,13 @@ var getFileDetails2 = (url) => {
|
|
|
8442
8479
|
return { Icon: Icon2, extLabel };
|
|
8443
8480
|
};
|
|
8444
8481
|
var DocumentNode = (props) => {
|
|
8445
|
-
console.log("DocumentNode rendered");
|
|
8446
|
-
console.log("props", props);
|
|
8447
|
-
console.log("node", props.node);
|
|
8448
8482
|
let documents = [];
|
|
8449
8483
|
if (props.dataitem && props.node.documentKey) {
|
|
8450
8484
|
const docData = getNestedValue5(props.dataitem, props.node.documentKey);
|
|
8451
|
-
|
|
8452
|
-
|
|
8453
|
-
|
|
8454
|
-
|
|
8455
|
-
const parsed = JSON.parse(trimmed);
|
|
8456
|
-
if (Array.isArray(parsed)) {
|
|
8457
|
-
documents = parsed.filter(
|
|
8458
|
-
(item) => item && item.assetUrl
|
|
8459
|
-
);
|
|
8460
|
-
} else if (parsed?.assetUrl) {
|
|
8461
|
-
documents = [parsed];
|
|
8462
|
-
}
|
|
8463
|
-
} catch {
|
|
8464
|
-
}
|
|
8465
|
-
} else {
|
|
8466
|
-
documents = [
|
|
8467
|
-
{
|
|
8468
|
-
assetUrl: docData
|
|
8469
|
-
}
|
|
8470
|
-
];
|
|
8471
|
-
}
|
|
8472
|
-
} else if (Array.isArray(docData)) {
|
|
8473
|
-
documents = docData.filter((item) => item && item.assetUrl);
|
|
8474
|
-
} else if (docData && typeof docData === "object" && docData.assetUrl) {
|
|
8475
|
-
documents = [docData];
|
|
8476
|
-
}
|
|
8485
|
+
documents = parseDocuments(docData);
|
|
8486
|
+
}
|
|
8487
|
+
if (documents.length === 0 && props.node.documentAsset) {
|
|
8488
|
+
documents = parseDocuments(props.node.documentAsset);
|
|
8477
8489
|
}
|
|
8478
8490
|
if (documents.length === 0) {
|
|
8479
8491
|
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_jsx_runtime56.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "py-4 px-2 bg-neutral-weak border rounded text-center flex flex-col gap-2", children: [
|
package/dist/server.mjs
CHANGED
|
@@ -1894,6 +1894,30 @@ var getNestedValue5 = (obj, path) => {
|
|
|
1894
1894
|
return current && current[key] !== void 0 ? current[key] : void 0;
|
|
1895
1895
|
}, obj);
|
|
1896
1896
|
};
|
|
1897
|
+
var parseDocuments = (value) => {
|
|
1898
|
+
if (typeof value === "string") {
|
|
1899
|
+
const trimmed = value.trim();
|
|
1900
|
+
if (!trimmed) return [];
|
|
1901
|
+
if (trimmed.startsWith("[") || trimmed.startsWith("{")) {
|
|
1902
|
+
try {
|
|
1903
|
+
return parseDocuments(JSON.parse(trimmed));
|
|
1904
|
+
} catch {
|
|
1905
|
+
return [];
|
|
1906
|
+
}
|
|
1907
|
+
}
|
|
1908
|
+
return [{ assetUrl: trimmed }];
|
|
1909
|
+
}
|
|
1910
|
+
if (Array.isArray(value)) {
|
|
1911
|
+
return value.filter(
|
|
1912
|
+
(item) => Boolean(item && typeof item === "object" && typeof item.assetUrl === "string" && item.assetUrl.trim())
|
|
1913
|
+
);
|
|
1914
|
+
}
|
|
1915
|
+
if (value && typeof value === "object" && "assetUrl" in value) {
|
|
1916
|
+
const asset = value;
|
|
1917
|
+
return typeof asset.assetUrl === "string" && asset.assetUrl.trim() ? [asset] : [];
|
|
1918
|
+
}
|
|
1919
|
+
return [];
|
|
1920
|
+
};
|
|
1897
1921
|
var PdfIcon = () => /* @__PURE__ */ jsxs13(
|
|
1898
1922
|
"svg",
|
|
1899
1923
|
{
|
|
@@ -2204,38 +2228,13 @@ var getFileDetails = (url) => {
|
|
|
2204
2228
|
return { Icon, extLabel };
|
|
2205
2229
|
};
|
|
2206
2230
|
var DocumentNode = (props) => {
|
|
2207
|
-
console.log("DocumentNode rendered");
|
|
2208
|
-
console.log("props", props);
|
|
2209
|
-
console.log("node", props.node);
|
|
2210
2231
|
let documents = [];
|
|
2211
2232
|
if (props.dataitem && props.node.documentKey) {
|
|
2212
2233
|
const docData = getNestedValue5(props.dataitem, props.node.documentKey);
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
const parsed = JSON.parse(trimmed);
|
|
2218
|
-
if (Array.isArray(parsed)) {
|
|
2219
|
-
documents = parsed.filter(
|
|
2220
|
-
(item) => item && item.assetUrl
|
|
2221
|
-
);
|
|
2222
|
-
} else if (parsed?.assetUrl) {
|
|
2223
|
-
documents = [parsed];
|
|
2224
|
-
}
|
|
2225
|
-
} catch {
|
|
2226
|
-
}
|
|
2227
|
-
} else {
|
|
2228
|
-
documents = [
|
|
2229
|
-
{
|
|
2230
|
-
assetUrl: docData
|
|
2231
|
-
}
|
|
2232
|
-
];
|
|
2233
|
-
}
|
|
2234
|
-
} else if (Array.isArray(docData)) {
|
|
2235
|
-
documents = docData.filter((item) => item && item.assetUrl);
|
|
2236
|
-
} else if (docData && typeof docData === "object" && docData.assetUrl) {
|
|
2237
|
-
documents = [docData];
|
|
2238
|
-
}
|
|
2234
|
+
documents = parseDocuments(docData);
|
|
2235
|
+
}
|
|
2236
|
+
if (documents.length === 0 && props.node.documentAsset) {
|
|
2237
|
+
documents = parseDocuments(props.node.documentAsset);
|
|
2239
2238
|
}
|
|
2240
2239
|
if (documents.length === 0) {
|
|
2241
2240
|
return /* @__PURE__ */ jsx34(Fragment6, { children: /* @__PURE__ */ jsxs13("div", { className: "py-4 px-2 bg-neutral-weak border rounded text-center flex flex-col gap-2", children: [
|
|
@@ -2360,7 +2359,7 @@ var GoogleMapNode_default = GoogleMapNode;
|
|
|
2360
2359
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
2361
2360
|
import { jsx as jsx36, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2362
2361
|
var Pagination = dynamic13(() => import("./Pagination-OSLUL7SF.mjs"), { ssr: true });
|
|
2363
|
-
var DataBindingControls = dynamic13(() => import("./DataBindingControls-
|
|
2362
|
+
var DataBindingControls = dynamic13(() => import("./DataBindingControls-2UETIUJJ.mjs"), {
|
|
2364
2363
|
ssr: true
|
|
2365
2364
|
});
|
|
2366
2365
|
var Slider = dynamic13(() => import("./Slider-QIGKP6AE.mjs"), {
|