@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260320043430 → 0.8.1-dev.20260320070922
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/index.d.mts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +656 -257
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +651 -252
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2068,7 +2068,7 @@ var DataList = (props) => {
|
|
|
2068
2068
|
}
|
|
2069
2069
|
}
|
|
2070
2070
|
}, [props.dataset]);
|
|
2071
|
-
function
|
|
2071
|
+
function getNestedProperty2(obj, path) {
|
|
2072
2072
|
if (path.includes(".")) {
|
|
2073
2073
|
return path.split(".").reduce((prev, curr) => prev ? prev[curr] : null, obj);
|
|
2074
2074
|
} else if (Array.isArray(obj[path])) {
|
|
@@ -2352,7 +2352,7 @@ var DataList = (props) => {
|
|
|
2352
2352
|
/* @__PURE__ */ jsx40("tbody", { className: "divide-y divide-gray-200 ", children: props.dataset?.result?.map((dataitem, index) => {
|
|
2353
2353
|
let validityClass = "";
|
|
2354
2354
|
console.log("dataitem", dataitem);
|
|
2355
|
-
if (props.recordValidityColumnName &&
|
|
2355
|
+
if (props.recordValidityColumnName && getNestedProperty2(dataitem, props.recordValidityColumnName) == false) {
|
|
2356
2356
|
validityClass = "bg-alert-200";
|
|
2357
2357
|
}
|
|
2358
2358
|
return /* @__PURE__ */ jsx40("tr", { className: validityClass, children: props?.columns?.map((column, colindex) => {
|
|
@@ -2370,7 +2370,7 @@ var DataList = (props) => {
|
|
|
2370
2370
|
ViewControl_default,
|
|
2371
2371
|
{
|
|
2372
2372
|
controlType: column.controlType,
|
|
2373
|
-
value:
|
|
2373
|
+
value: getNestedProperty2(
|
|
2374
2374
|
dataitem,
|
|
2375
2375
|
column.name
|
|
2376
2376
|
),
|
|
@@ -2387,7 +2387,7 @@ var DataList = (props) => {
|
|
|
2387
2387
|
ViewControl_default,
|
|
2388
2388
|
{
|
|
2389
2389
|
controlType: column.controlType,
|
|
2390
|
-
value:
|
|
2390
|
+
value: getNestedProperty2(dataitem, column.name) || column.emptyValueLabel,
|
|
2391
2391
|
format: column.format,
|
|
2392
2392
|
customProps: column.customProps
|
|
2393
2393
|
}
|
|
@@ -2397,7 +2397,7 @@ var DataList = (props) => {
|
|
|
2397
2397
|
ViewControl_default,
|
|
2398
2398
|
{
|
|
2399
2399
|
controlType: column.controlType,
|
|
2400
|
-
value:
|
|
2400
|
+
value: getNestedProperty2(dataitem, column.name),
|
|
2401
2401
|
format: column.format,
|
|
2402
2402
|
customProps: column.customProps
|
|
2403
2403
|
}
|
|
@@ -2502,7 +2502,7 @@ var DataList = (props) => {
|
|
|
2502
2502
|
var DataList_default = DataList;
|
|
2503
2503
|
|
|
2504
2504
|
// src/components/pageRenderingEngine/PageBodyRenderer.tsx
|
|
2505
|
-
import
|
|
2505
|
+
import React51 from "react";
|
|
2506
2506
|
|
|
2507
2507
|
// src/components/pageRenderingEngine/nodes/ParagraphNode.tsx
|
|
2508
2508
|
import React37 from "react";
|
|
@@ -2515,19 +2515,57 @@ var TextNode = (props) => {
|
|
|
2515
2515
|
};
|
|
2516
2516
|
function cssStringToJson(cssString) {
|
|
2517
2517
|
const styleObject = {};
|
|
2518
|
-
const matches = cssString
|
|
2519
|
-
if (matches
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2518
|
+
const matches = cssString?.match(/([\w-]+)\s*:\s*([^;]+)\s*;/g);
|
|
2519
|
+
if (matches) {
|
|
2520
|
+
matches.forEach((match) => {
|
|
2521
|
+
const parts = match.match(/([\w-]+)\s*:\s*([^;]+)\s*;/);
|
|
2522
|
+
if (parts && parts.length === 3) {
|
|
2523
|
+
const property = parts[1].trim();
|
|
2524
|
+
const value = parts[2].trim();
|
|
2525
|
+
styleObject[property] = value;
|
|
2526
|
+
}
|
|
2527
|
+
});
|
|
2525
2528
|
}
|
|
2526
2529
|
return styleObject;
|
|
2527
2530
|
}
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
+
function toCamelCase(str) {
|
|
2532
|
+
return str.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
2533
|
+
}
|
|
2534
|
+
function convertKeysToCamelCase(obj) {
|
|
2535
|
+
if (Array.isArray(obj)) {
|
|
2536
|
+
return obj.map(convertKeysToCamelCase);
|
|
2537
|
+
} else if (obj !== null && typeof obj === "object") {
|
|
2538
|
+
return Object.fromEntries(
|
|
2539
|
+
Object.entries(obj).filter(([_, value]) => value !== "").map(([key, value]) => [
|
|
2540
|
+
toCamelCase(key),
|
|
2541
|
+
convertKeysToCamelCase(value)
|
|
2542
|
+
])
|
|
2543
|
+
);
|
|
2544
|
+
}
|
|
2545
|
+
return obj;
|
|
2546
|
+
}
|
|
2547
|
+
function getFormatClass(format) {
|
|
2548
|
+
const classes = [];
|
|
2549
|
+
if (format === 1) classes.push("font-medium");
|
|
2550
|
+
if (format === 2) classes.push("italic");
|
|
2551
|
+
if (format === 3) classes.push("font-medium italic");
|
|
2552
|
+
if (format === 8) classes.push("underline");
|
|
2553
|
+
if (format === 9) classes.push("font-medium underline");
|
|
2554
|
+
if (format === 10) classes.push("italic underline");
|
|
2555
|
+
if (format === 11) classes.push("font-medium italic underline");
|
|
2556
|
+
if (format === 256) classes.push("lowercase");
|
|
2557
|
+
if (format === 512) classes.push("uppercase");
|
|
2558
|
+
if (format === 1024) classes.push("capitalize");
|
|
2559
|
+
return classes.join(" ");
|
|
2560
|
+
}
|
|
2561
|
+
const styles = convertKeysToCamelCase(cssStringToJson(props.node.style));
|
|
2562
|
+
function replacePlaceholders(template, dataItem) {
|
|
2563
|
+
return template.replace(/{(\w+)}/g, (_, key) => {
|
|
2564
|
+
return key in dataItem ? dataItem[key] : `{${key}}`;
|
|
2565
|
+
});
|
|
2566
|
+
}
|
|
2567
|
+
const displayText = props.linkText ? props.linkText : props.node.text;
|
|
2568
|
+
return /* @__PURE__ */ jsx41("span", { style: { ...styles }, className: getFormatClass(props.node.format), children: props.dataitem && props.linkText ? displayText : props.dataitem ? replacePlaceholders(props.node.text, props.dataitem) : props.node.text });
|
|
2531
2569
|
};
|
|
2532
2570
|
var TextNode_default = TextNode;
|
|
2533
2571
|
|
|
@@ -2567,7 +2605,7 @@ var SVGIconNode = ({ node }) => {
|
|
|
2567
2605
|
"span",
|
|
2568
2606
|
{
|
|
2569
2607
|
style: {
|
|
2570
|
-
display: "flex",
|
|
2608
|
+
display: "inline-flex",
|
|
2571
2609
|
width: node.width,
|
|
2572
2610
|
height: node.height,
|
|
2573
2611
|
color: node.color
|
|
@@ -2613,39 +2651,172 @@ var EquationNode = ({ node }) => {
|
|
|
2613
2651
|
};
|
|
2614
2652
|
var EquationNode_default = EquationNode;
|
|
2615
2653
|
|
|
2654
|
+
// src/components/pageRenderingEngine/nodes/DatafieldNode.tsx
|
|
2655
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
2656
|
+
function getNestedProperty(obj, path) {
|
|
2657
|
+
if (!obj || !path) return null;
|
|
2658
|
+
if (path.includes(".")) {
|
|
2659
|
+
return path.split(".").reduce((prev, curr) => prev ? prev[curr] : null, obj);
|
|
2660
|
+
} else if (Array.isArray(obj[path])) {
|
|
2661
|
+
return obj[path].map((item, index) => /* @__PURE__ */ jsx46("div", { children: item }, index));
|
|
2662
|
+
} else {
|
|
2663
|
+
return obj[path];
|
|
2664
|
+
}
|
|
2665
|
+
}
|
|
2666
|
+
var DatafieldNode = (props) => {
|
|
2667
|
+
function cssStringToJson(cssString) {
|
|
2668
|
+
const styleObject = {};
|
|
2669
|
+
const matches = cssString?.match(/([\w-]+)\s*:\s*([^;]+)\s*;/g);
|
|
2670
|
+
if (matches) {
|
|
2671
|
+
matches.forEach((match) => {
|
|
2672
|
+
const parts = match.match(/([\w-]+)\s*:\s*([^;]+)\s*;/);
|
|
2673
|
+
if (parts && parts.length === 3) {
|
|
2674
|
+
const property = parts[1].trim();
|
|
2675
|
+
const value2 = parts[2].trim();
|
|
2676
|
+
styleObject[property] = value2;
|
|
2677
|
+
}
|
|
2678
|
+
});
|
|
2679
|
+
}
|
|
2680
|
+
return styleObject;
|
|
2681
|
+
}
|
|
2682
|
+
function toCamelCase(str) {
|
|
2683
|
+
return str.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
2684
|
+
}
|
|
2685
|
+
function convertKeysToCamelCase(obj) {
|
|
2686
|
+
if (!obj || typeof obj !== "object") return obj;
|
|
2687
|
+
return Object.fromEntries(
|
|
2688
|
+
Object.entries(obj).map(([key, value2]) => [toCamelCase(key), value2])
|
|
2689
|
+
);
|
|
2690
|
+
}
|
|
2691
|
+
const Formats = [
|
|
2692
|
+
"",
|
|
2693
|
+
"font-medium",
|
|
2694
|
+
"italic",
|
|
2695
|
+
"font-medium italic",
|
|
2696
|
+
"",
|
|
2697
|
+
"",
|
|
2698
|
+
"",
|
|
2699
|
+
"",
|
|
2700
|
+
"underline",
|
|
2701
|
+
"font-medium underline",
|
|
2702
|
+
"italic underline",
|
|
2703
|
+
"italic underline font-medium"
|
|
2704
|
+
];
|
|
2705
|
+
const styles = convertKeysToCamelCase(cssStringToJson(props.node.style));
|
|
2706
|
+
const fieldName = props.node.fieldName;
|
|
2707
|
+
const value = props.dataitem ? getNestedProperty(props.dataitem, fieldName) : null;
|
|
2708
|
+
console.log(fieldName, value, "haha");
|
|
2709
|
+
const isEmptyValue = value === null || value === void 0 || value === "" || Array.isArray(value) && value.length === 0 || typeof value === "object" && Object.keys(value).length === 0;
|
|
2710
|
+
const maxLines = props.node.maxLines;
|
|
2711
|
+
if (maxLines && Number(maxLines) > 0) {
|
|
2712
|
+
Object.assign(styles, {
|
|
2713
|
+
display: "-webkit-box",
|
|
2714
|
+
overflow: "hidden",
|
|
2715
|
+
WebkitBoxOrient: "vertical",
|
|
2716
|
+
WebkitLineClamp: String(maxLines)
|
|
2717
|
+
});
|
|
2718
|
+
}
|
|
2719
|
+
const dataType = props.node.dataType;
|
|
2720
|
+
if (isEmptyValue) {
|
|
2721
|
+
return null;
|
|
2722
|
+
}
|
|
2723
|
+
if (dataType == "rawContent") {
|
|
2724
|
+
return /* @__PURE__ */ jsx46(
|
|
2725
|
+
PageBodyRenderer_default,
|
|
2726
|
+
{
|
|
2727
|
+
rawBody: value ?? `@databound[${fieldName}]`,
|
|
2728
|
+
routeParameters: props.routeParameters,
|
|
2729
|
+
query: props.query,
|
|
2730
|
+
session: props.session,
|
|
2731
|
+
host: props.host,
|
|
2732
|
+
path: props.path,
|
|
2733
|
+
apiBaseUrl: props.apiBaseUrl,
|
|
2734
|
+
breadcrumb: props.breadcrumb,
|
|
2735
|
+
donotApplyContainerClass: true
|
|
2736
|
+
}
|
|
2737
|
+
);
|
|
2738
|
+
}
|
|
2739
|
+
return /* @__PURE__ */ jsx46(
|
|
2740
|
+
"span",
|
|
2741
|
+
{
|
|
2742
|
+
className: `datafield-node ${props.node.format < Formats.length ? Formats[props.node.format] : ""}`,
|
|
2743
|
+
style: styles,
|
|
2744
|
+
children: /* @__PURE__ */ jsx46(
|
|
2745
|
+
ViewControl_default,
|
|
2746
|
+
{
|
|
2747
|
+
controlType: dataType,
|
|
2748
|
+
value: value ?? `@databound[${fieldName}]`
|
|
2749
|
+
}
|
|
2750
|
+
)
|
|
2751
|
+
}
|
|
2752
|
+
);
|
|
2753
|
+
};
|
|
2754
|
+
var DatafieldNode_default = DatafieldNode;
|
|
2755
|
+
|
|
2616
2756
|
// src/components/pageRenderingEngine/nodes/ParagraphNode.tsx
|
|
2617
|
-
import { jsx as
|
|
2757
|
+
import { Fragment as Fragment3, jsx as jsx47, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2618
2758
|
var ParagraphNode = (props) => {
|
|
2619
2759
|
const NodeTypes2 = {
|
|
2620
2760
|
["text"]: TextNode_default,
|
|
2621
2761
|
["linebreak"]: LineBreakNode_default,
|
|
2622
2762
|
["link"]: LinkNode_default,
|
|
2763
|
+
["datafield"]: DatafieldNode_default,
|
|
2623
2764
|
["equation"]: EquationNode_default,
|
|
2624
2765
|
["svg-icon"]: SVGIconNode_default
|
|
2625
2766
|
};
|
|
2626
2767
|
const FormatClass = {
|
|
2627
|
-
"center": "text-center"
|
|
2768
|
+
"center": "text-center",
|
|
2769
|
+
"right": "text-right"
|
|
2628
2770
|
};
|
|
2629
2771
|
{
|
|
2630
2772
|
}
|
|
2631
2773
|
let formatClasses = FormatClass[props.node.format] || "";
|
|
2632
|
-
|
|
2633
|
-
|
|
2774
|
+
const isInlineOnlyParent = props.parentTag === "summary";
|
|
2775
|
+
const hasChildren = props.node.children && props.node.children.length > 0;
|
|
2776
|
+
if (isInlineOnlyParent) {
|
|
2777
|
+
return /* @__PURE__ */ jsx47(Fragment3, { children: hasChildren && props.node.children.map((node, index) => {
|
|
2634
2778
|
const SelectedNode = NodeTypes2[node.type];
|
|
2635
|
-
return /* @__PURE__ */
|
|
2779
|
+
return /* @__PURE__ */ jsx47(React37.Fragment, { children: SelectedNode && /* @__PURE__ */ jsx47(
|
|
2780
|
+
SelectedNode,
|
|
2781
|
+
{
|
|
2782
|
+
node,
|
|
2783
|
+
dataitem: props.dataitem,
|
|
2784
|
+
session: props.session,
|
|
2785
|
+
apiBaseUrl: props.apiBaseUrl,
|
|
2786
|
+
routeParameters: props.routeParameters
|
|
2787
|
+
}
|
|
2788
|
+
) }, index);
|
|
2789
|
+
}) });
|
|
2790
|
+
}
|
|
2791
|
+
return /* @__PURE__ */ jsxs24("div", { className: " " + formatClasses, children: [
|
|
2792
|
+
hasChildren && props.node.children.map((node, index) => {
|
|
2793
|
+
const SelectedNode = NodeTypes2[node.type];
|
|
2794
|
+
return /* @__PURE__ */ jsx47(React37.Fragment, { children: SelectedNode && /* @__PURE__ */ jsx47(
|
|
2795
|
+
SelectedNode,
|
|
2796
|
+
{
|
|
2797
|
+
node,
|
|
2798
|
+
dataitem: props.dataitem,
|
|
2799
|
+
session: props.session,
|
|
2800
|
+
apiBaseUrl: props.apiBaseUrl,
|
|
2801
|
+
routeParameters: props.routeParameters
|
|
2802
|
+
}
|
|
2803
|
+
) }, index);
|
|
2636
2804
|
}),
|
|
2637
|
-
|
|
2805
|
+
!hasChildren && /* @__PURE__ */ jsx47("div", { className: "py-1.5 lg:py-2" })
|
|
2638
2806
|
] });
|
|
2639
2807
|
};
|
|
2640
2808
|
var ParagraphNode_default = ParagraphNode;
|
|
2641
2809
|
|
|
2642
2810
|
// src/components/pageRenderingEngine/nodes/HeadingNode.tsx
|
|
2643
2811
|
import React38 from "react";
|
|
2644
|
-
import { Fragment as
|
|
2812
|
+
import { Fragment as Fragment4, jsx as jsx48 } from "react/jsx-runtime";
|
|
2645
2813
|
var HeadingNode = (props) => {
|
|
2646
2814
|
const NodeTypes2 = {
|
|
2647
2815
|
["text"]: TextNode_default,
|
|
2648
|
-
["link"]: LinkNode_default
|
|
2816
|
+
["link"]: LinkNode_default,
|
|
2817
|
+
["svg-icon"]: SVGIconNode_default,
|
|
2818
|
+
// ["linebreak"]: LineBreakNodeNew,
|
|
2819
|
+
["datafield"]: DatafieldNode_default
|
|
2649
2820
|
};
|
|
2650
2821
|
const HeadingTag = `${props.node.tag}`;
|
|
2651
2822
|
const FormatClass = {
|
|
@@ -2654,12 +2825,12 @@ var HeadingNode = (props) => {
|
|
|
2654
2825
|
{
|
|
2655
2826
|
}
|
|
2656
2827
|
let formatClasses = FormatClass[props.node.format] || "";
|
|
2657
|
-
return /* @__PURE__ */
|
|
2828
|
+
return /* @__PURE__ */ jsx48(Fragment4, { children: React38.createElement(
|
|
2658
2829
|
HeadingTag,
|
|
2659
2830
|
{ className: formatClasses },
|
|
2660
2831
|
props.node.children && props.node.children.map((childNode, index) => {
|
|
2661
2832
|
const SelectedNode = NodeTypes2[childNode.type];
|
|
2662
|
-
return /* @__PURE__ */
|
|
2833
|
+
return /* @__PURE__ */ jsx48(React38.Fragment, { children: SelectedNode && /* @__PURE__ */ jsx48(SelectedNode, { node: childNode, dataitem: props.dataitem, session: props.session, apiBaseUrl: props.apiBaseUrl, routeParameters: props.routeParameters }) }, index);
|
|
2663
2834
|
})
|
|
2664
2835
|
) });
|
|
2665
2836
|
};
|
|
@@ -2670,34 +2841,54 @@ import React40 from "react";
|
|
|
2670
2841
|
|
|
2671
2842
|
// src/components/pageRenderingEngine/nodes/ListItemNode.tsx
|
|
2672
2843
|
import React39 from "react";
|
|
2673
|
-
import { jsx as
|
|
2844
|
+
import { jsx as jsx49 } from "react/jsx-runtime";
|
|
2674
2845
|
var ListItemNode = (props) => {
|
|
2675
2846
|
const NodeTypes2 = {
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2847
|
+
text: TextNode_default,
|
|
2848
|
+
linebreak: LineBreakNode_default,
|
|
2849
|
+
link: LinkNode_default,
|
|
2850
|
+
list: ListNode_default
|
|
2679
2851
|
};
|
|
2680
|
-
|
|
2852
|
+
let foundFirstBreak = false;
|
|
2853
|
+
const firstTextChild = props.node.children?.find((c) => c.type === "text");
|
|
2854
|
+
let liStyle = {};
|
|
2855
|
+
if (firstTextChild?.style) {
|
|
2856
|
+
const match = firstTextChild.style.match(/font-size\s*:\s*([^;]+);?/);
|
|
2857
|
+
if (match) {
|
|
2858
|
+
liStyle.fontSize = match[1].trim();
|
|
2859
|
+
}
|
|
2860
|
+
}
|
|
2861
|
+
return /* @__PURE__ */ jsx49("li", { style: liStyle, children: props.node.children && props.node.children.map((node, index) => {
|
|
2681
2862
|
const SelectedNode = NodeTypes2[node.type];
|
|
2682
|
-
|
|
2863
|
+
if (node.type === "linebreak") {
|
|
2864
|
+
if (!foundFirstBreak) {
|
|
2865
|
+
foundFirstBreak = true;
|
|
2866
|
+
return /* @__PURE__ */ jsx49("div", {}, index);
|
|
2867
|
+
} else {
|
|
2868
|
+
return /* @__PURE__ */ jsx49("div", { className: "py-1 lg:py-2" }, index);
|
|
2869
|
+
}
|
|
2870
|
+
} else {
|
|
2871
|
+
foundFirstBreak = false;
|
|
2872
|
+
return /* @__PURE__ */ jsx49(React39.Fragment, { children: SelectedNode && /* @__PURE__ */ jsx49(SelectedNode, { node, dataitem: props.dataitem, routeParameters: props.routeParameters }) }, index);
|
|
2873
|
+
}
|
|
2683
2874
|
}) });
|
|
2684
2875
|
};
|
|
2685
2876
|
var ListItemNode_default = ListItemNode;
|
|
2686
2877
|
|
|
2687
2878
|
// src/components/pageRenderingEngine/nodes/ListNode.tsx
|
|
2688
|
-
import { jsx as
|
|
2879
|
+
import { jsx as jsx50, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2689
2880
|
var ListNode = (props) => {
|
|
2690
2881
|
const NodeTypes2 = {
|
|
2691
2882
|
listitem: ListItemNode_default
|
|
2692
2883
|
};
|
|
2693
2884
|
return /* @__PURE__ */ jsxs25(React40.Fragment, { children: [
|
|
2694
|
-
props.node.listType == "bullet" && /* @__PURE__ */
|
|
2885
|
+
props.node.listType == "bullet" && /* @__PURE__ */ jsx50("ul", { children: props.node.children && props.node.children.map((node, index) => {
|
|
2695
2886
|
const SelectedNode = NodeTypes2[node.type];
|
|
2696
|
-
return /* @__PURE__ */
|
|
2887
|
+
return /* @__PURE__ */ jsx50(React40.Fragment, { children: SelectedNode && /* @__PURE__ */ jsx50(SelectedNode, { node, dataitem: props.dataitem, routeParameters: props.routeParameters }) }, index);
|
|
2697
2888
|
}) }),
|
|
2698
|
-
props.node.listType == "number" && /* @__PURE__ */
|
|
2889
|
+
props.node.listType == "number" && /* @__PURE__ */ jsx50("ol", { children: props.node.children && props.node.children.map((node, index) => {
|
|
2699
2890
|
const SelectedNode = NodeTypes2[node.type];
|
|
2700
|
-
return /* @__PURE__ */
|
|
2891
|
+
return /* @__PURE__ */ jsx50(React40.Fragment, { children: SelectedNode && /* @__PURE__ */ jsx50(SelectedNode, { node, dataitem: props.dataitem, routeParameters: props.routeParameters }) }, index);
|
|
2701
2892
|
}) })
|
|
2702
2893
|
] });
|
|
2703
2894
|
};
|
|
@@ -2705,56 +2896,118 @@ var ListNode_default = ListNode;
|
|
|
2705
2896
|
|
|
2706
2897
|
// src/components/pageRenderingEngine/nodes/QuoteNode.tsx
|
|
2707
2898
|
import React41 from "react";
|
|
2708
|
-
import { jsx as
|
|
2899
|
+
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
2709
2900
|
var QuoteNode = (props) => {
|
|
2710
2901
|
const NodeTypes2 = {
|
|
2711
2902
|
["text"]: TextNode_default,
|
|
2712
2903
|
["linebreak"]: LineBreakNode_default,
|
|
2713
2904
|
["link"]: LinkNode_default
|
|
2714
2905
|
};
|
|
2715
|
-
return /* @__PURE__ */
|
|
2906
|
+
return /* @__PURE__ */ jsx51("blockquote", { children: props.node.children && props.node.children.map((node, index) => {
|
|
2716
2907
|
const SelectedNode = NodeTypes2[node.type];
|
|
2717
|
-
return /* @__PURE__ */
|
|
2908
|
+
return /* @__PURE__ */ jsx51(React41.Fragment, { children: SelectedNode && /* @__PURE__ */ jsx51(SelectedNode, { node, session: props.session, apiBaseUrl: props.apiBaseUrl, routeParameters: props.routeParameters }) }, index);
|
|
2718
2909
|
}) });
|
|
2719
2910
|
};
|
|
2720
2911
|
var QuoteNode_default = QuoteNode;
|
|
2721
2912
|
|
|
2722
2913
|
// src/components/pageRenderingEngine/nodes/CodeNode.tsx
|
|
2723
2914
|
import React42 from "react";
|
|
2724
|
-
|
|
2915
|
+
|
|
2916
|
+
// src/components/CopyButton.tsx
|
|
2917
|
+
import { useState as useState8, useRef as useRef3, useEffect as useEffect7 } from "react";
|
|
2918
|
+
import { jsx as jsx52, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2919
|
+
function CopyButton({ text }) {
|
|
2920
|
+
const [copied, setCopied] = useState8(false);
|
|
2921
|
+
const timeoutRef = useRef3(null);
|
|
2922
|
+
useEffect7(() => {
|
|
2923
|
+
return () => {
|
|
2924
|
+
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
2925
|
+
};
|
|
2926
|
+
}, []);
|
|
2927
|
+
const handleCopy = async () => {
|
|
2928
|
+
try {
|
|
2929
|
+
await navigator.clipboard.writeText(text);
|
|
2930
|
+
setCopied(true);
|
|
2931
|
+
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
2932
|
+
timeoutRef.current = setTimeout(() => setCopied(false), 2e3);
|
|
2933
|
+
} catch (err) {
|
|
2934
|
+
console.error("Failed to copy: ", err);
|
|
2935
|
+
}
|
|
2936
|
+
};
|
|
2937
|
+
return /* @__PURE__ */ jsxs26(
|
|
2938
|
+
"button",
|
|
2939
|
+
{
|
|
2940
|
+
onClick: handleCopy,
|
|
2941
|
+
className: "flex gap-1 items-center hover:text-white transition",
|
|
2942
|
+
children: [
|
|
2943
|
+
/* @__PURE__ */ jsx52(
|
|
2944
|
+
"svg",
|
|
2945
|
+
{
|
|
2946
|
+
width: "16",
|
|
2947
|
+
height: "16",
|
|
2948
|
+
viewBox: "0 0 24 24",
|
|
2949
|
+
className: "w-4 h-4",
|
|
2950
|
+
fill: "currentColor",
|
|
2951
|
+
children: /* @__PURE__ */ jsx52(
|
|
2952
|
+
"path",
|
|
2953
|
+
{
|
|
2954
|
+
fillRule: "evenodd",
|
|
2955
|
+
clipRule: "evenodd",
|
|
2956
|
+
d: "M12 4C10.8954 4 10 4.89543 10 6H14C14 4.89543 13.1046 4 12 4ZM8.53513 4C9.22675 2.8044 10.5194 2 12 2C13.4806 2 14.7733 2.8044 15.4649 4H17C18.6569 4 20 5.34315 20 7V19C20 20.6569 18.6569 22 17 22H7C5.34315 22 4 20.6569 4 19V7C4 5.34315 5.34315 4 7 4H8.53513ZM8 6H7C6.44772 6 6 6.44772 6 7V19C6 19.5523 6.44772 20 7 20H17C17.5523 20 18 19.5523 18 19V7C18 6.44772 17.5523 6 17 6H16C16 7.10457 15.1046 8 14 8H10C8.89543 8 8 7.10457 8 6Z"
|
|
2957
|
+
}
|
|
2958
|
+
)
|
|
2959
|
+
}
|
|
2960
|
+
),
|
|
2961
|
+
copied ? "Copied!" : "Copy code"
|
|
2962
|
+
]
|
|
2963
|
+
}
|
|
2964
|
+
);
|
|
2965
|
+
}
|
|
2966
|
+
|
|
2967
|
+
// src/components/pageRenderingEngine/nodes/CodeNode.tsx
|
|
2968
|
+
import { jsx as jsx53, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2725
2969
|
var CodeNode = (props) => {
|
|
2726
2970
|
const NodeTypes2 = {
|
|
2727
2971
|
["text"]: TextNode_default,
|
|
2728
2972
|
["linebreak"]: LineBreakNode_default,
|
|
2729
2973
|
["link"]: LinkNode_default
|
|
2730
2974
|
};
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2975
|
+
const textContent = props.node?.children?.map((node) => {
|
|
2976
|
+
if (node.type === "text") return node.text || "";
|
|
2977
|
+
if (node.type === "linebreak") return "\n";
|
|
2978
|
+
if (node.type === "link") return node.text || node.url || "";
|
|
2979
|
+
return "";
|
|
2980
|
+
}).join("") ?? "";
|
|
2981
|
+
return /* @__PURE__ */ jsxs27("div", { className: "code-block", children: [
|
|
2982
|
+
/* @__PURE__ */ jsxs27("div", { className: "flex items-center relative text-gray-200 bg-gray-800 px-4 py-2.5 text-xs font-sans justify-between rounded-t-md", children: [
|
|
2983
|
+
/* @__PURE__ */ jsx53("span", { children: "Code Snippet" }),
|
|
2984
|
+
/* @__PURE__ */ jsx53(CopyButton, { text: textContent })
|
|
2985
|
+
] }),
|
|
2986
|
+
/* @__PURE__ */ jsx53("code", { className: "block bg-gray-900 text-gray-100 p-4 rounded-b-md text-sm whitespace-pre-wrap", children: props.node.children && props.node.children.map((node, index) => {
|
|
2987
|
+
const SelectedNode = NodeTypes2[node.type];
|
|
2988
|
+
return /* @__PURE__ */ jsx53(React42.Fragment, { children: SelectedNode && /* @__PURE__ */ jsx53(SelectedNode, { node, session: props.session, apiBaseUrl: props.apiBaseUrl, routeParameters: props.routeParameters }) }, index);
|
|
2989
|
+
}) })
|
|
2990
|
+
] });
|
|
2735
2991
|
};
|
|
2736
2992
|
var CodeNode_default = CodeNode;
|
|
2737
2993
|
|
|
2738
2994
|
// src/components/pageRenderingEngine/nodes/HorizontalRuleNode.tsx
|
|
2739
|
-
import { jsx as
|
|
2995
|
+
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
2740
2996
|
var HorizontalRuleNode = (props) => {
|
|
2741
|
-
return /* @__PURE__ */
|
|
2997
|
+
return /* @__PURE__ */ jsx54("hr", {});
|
|
2742
2998
|
};
|
|
2743
2999
|
var HorizontalRuleNode_default = HorizontalRuleNode;
|
|
2744
3000
|
|
|
2745
|
-
// src/components/pageRenderingEngine/nodes/LayoutContainerNode.tsx
|
|
2746
|
-
import React45 from "react";
|
|
2747
|
-
|
|
2748
3001
|
// src/components/pageRenderingEngine/nodes/LayoutItemNode.tsx
|
|
2749
|
-
import
|
|
3002
|
+
import React48 from "react";
|
|
2750
3003
|
|
|
2751
3004
|
// src/components/pageRenderingEngine/nodes/ImageNode.tsx
|
|
2752
3005
|
import React43 from "react";
|
|
2753
|
-
import { jsx as
|
|
3006
|
+
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
2754
3007
|
var ImageNode = (props) => {
|
|
2755
3008
|
const { node, apiBaseUrl = "" } = props;
|
|
2756
3009
|
let imageUrl = node.imageUrl.startsWith("http") ? node.imageUrl : `${apiBaseUrl}/digitalassets/storefront/${node.imageUrl}`;
|
|
2757
|
-
return /* @__PURE__ */
|
|
3010
|
+
return /* @__PURE__ */ jsx55(React43.Fragment, { children: node.width ? /* @__PURE__ */ jsx55("div", { style: { width: node.width }, children: /* @__PURE__ */ jsx55(
|
|
2758
3011
|
"img",
|
|
2759
3012
|
{
|
|
2760
3013
|
loading: "lazy",
|
|
@@ -2764,7 +3017,7 @@ var ImageNode = (props) => {
|
|
|
2764
3017
|
height: node.intrinsicHeight,
|
|
2765
3018
|
alt: node.title
|
|
2766
3019
|
}
|
|
2767
|
-
) }) : /* @__PURE__ */
|
|
3020
|
+
) }) : /* @__PURE__ */ jsx55(
|
|
2768
3021
|
"img",
|
|
2769
3022
|
{
|
|
2770
3023
|
loading: "lazy",
|
|
@@ -2778,8 +3031,204 @@ var ImageNode = (props) => {
|
|
|
2778
3031
|
};
|
|
2779
3032
|
var ImageNode_default = ImageNode;
|
|
2780
3033
|
|
|
3034
|
+
// src/components/pageRenderingEngine/nodes/WidgetNode.tsx
|
|
3035
|
+
import { Suspense } from "react";
|
|
3036
|
+
import { Fragment as Fragment5, jsx as jsx56, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
3037
|
+
var WidgetNode = (props) => {
|
|
3038
|
+
const getWidgetParameters = () => {
|
|
3039
|
+
const widgetInputParameters = { ...props.routeParameters ?? {} };
|
|
3040
|
+
const rawWidgetParams = props.node?.widgetParameters ?? props.node?.widgetParams;
|
|
3041
|
+
let widgetParameters = {};
|
|
3042
|
+
const isJSON = (str) => {
|
|
3043
|
+
if (typeof str !== "string") return false;
|
|
3044
|
+
str = str.trim();
|
|
3045
|
+
return str.startsWith("{") && str.endsWith("}") || str.startsWith("[") && str.endsWith("]");
|
|
3046
|
+
};
|
|
3047
|
+
if (rawWidgetParams) {
|
|
3048
|
+
if (typeof rawWidgetParams === "string" && isJSON(rawWidgetParams)) {
|
|
3049
|
+
widgetParameters = JSON.parse(rawWidgetParams);
|
|
3050
|
+
} else if (typeof rawWidgetParams === "object") {
|
|
3051
|
+
widgetParameters = rawWidgetParams;
|
|
3052
|
+
}
|
|
3053
|
+
}
|
|
3054
|
+
const resolveValue = (val) => {
|
|
3055
|
+
if (typeof val === "string") {
|
|
3056
|
+
const m = /^\{(.+)\}$/.exec(val);
|
|
3057
|
+
if (m) {
|
|
3058
|
+
const actualKey = m[1];
|
|
3059
|
+
return props.routeParameters?.[actualKey] ?? val;
|
|
3060
|
+
}
|
|
3061
|
+
return val;
|
|
3062
|
+
} else if (Array.isArray(val)) {
|
|
3063
|
+
return val.map(resolveValue);
|
|
3064
|
+
} else if (val && typeof val === "object") {
|
|
3065
|
+
const out = {};
|
|
3066
|
+
for (const k of Object.keys(val)) {
|
|
3067
|
+
out[k] = resolveValue(val[k]);
|
|
3068
|
+
}
|
|
3069
|
+
return out;
|
|
3070
|
+
}
|
|
3071
|
+
return val;
|
|
3072
|
+
};
|
|
3073
|
+
Object.keys(widgetParameters).forEach((key) => {
|
|
3074
|
+
const rawVal = widgetParameters[key];
|
|
3075
|
+
if (rawVal === "route") {
|
|
3076
|
+
if (key === "itemPath") {
|
|
3077
|
+
widgetInputParameters[key] = props.path;
|
|
3078
|
+
} else {
|
|
3079
|
+
widgetInputParameters[key] = widgetInputParameters[key] ?? null;
|
|
3080
|
+
}
|
|
3081
|
+
} else {
|
|
3082
|
+
widgetInputParameters[key] = resolveValue(rawVal);
|
|
3083
|
+
}
|
|
3084
|
+
});
|
|
3085
|
+
widgetInputParameters["widgetTitle"] = props.node?.widgetTitle;
|
|
3086
|
+
return widgetInputParameters;
|
|
3087
|
+
};
|
|
3088
|
+
const SelectedWidget = props.widgetRegistry?.[props.node.widgetCode];
|
|
3089
|
+
if (!SelectedWidget) {
|
|
3090
|
+
console.warn("Widget not found:", props.node.widgetCode);
|
|
3091
|
+
return /* @__PURE__ */ jsxs28(Fragment5, { children: [
|
|
3092
|
+
"Widget not found: ",
|
|
3093
|
+
props.node.widgetCode
|
|
3094
|
+
] });
|
|
3095
|
+
}
|
|
3096
|
+
return /* @__PURE__ */ jsx56(Suspense, { fallback: /* @__PURE__ */ jsx56("div", { className: "container mt-2", children: "..." }), children: /* @__PURE__ */ jsx56(
|
|
3097
|
+
SelectedWidget,
|
|
3098
|
+
{
|
|
3099
|
+
params: getWidgetParameters(),
|
|
3100
|
+
query: props.query,
|
|
3101
|
+
session: props.session,
|
|
3102
|
+
host: props.host,
|
|
3103
|
+
path: props.path,
|
|
3104
|
+
apiBaseUrl: props.apiBaseUrl
|
|
3105
|
+
}
|
|
3106
|
+
) });
|
|
3107
|
+
};
|
|
3108
|
+
var WidgetNode_default = WidgetNode;
|
|
3109
|
+
|
|
3110
|
+
// src/components/pageRenderingEngine/nodes/IframeClient.tsx
|
|
3111
|
+
import React46, { useEffect as useEffect8, useRef as useRef4, useState as useState9 } from "react";
|
|
3112
|
+
|
|
3113
|
+
// src/components/IFrameLoaderView.tsx
|
|
3114
|
+
import React45 from "react";
|
|
3115
|
+
import { jsx as jsx57, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
3116
|
+
var IFrameLoaderView = (props) => {
|
|
3117
|
+
return /* @__PURE__ */ jsxs29(React45.Fragment, { children: [
|
|
3118
|
+
props.isDataFound == null && /* @__PURE__ */ jsx57("div", { className: "", children: /* @__PURE__ */ jsxs29("div", { className: "mt-4 bg-gray-200 rounded-md p-4 animate-pulse", children: [
|
|
3119
|
+
/* @__PURE__ */ jsxs29("div", { className: "flex items-center mb-4", children: [
|
|
3120
|
+
/* @__PURE__ */ jsx57("div", { className: "bg-gray-300 h-8 w-8 rounded-full animate-pulse" }),
|
|
3121
|
+
/* @__PURE__ */ jsxs29("div", { className: "ml-2", children: [
|
|
3122
|
+
/* @__PURE__ */ jsx57("div", { className: "bg-gray-300 h-3 w-16 animate-pulse" }),
|
|
3123
|
+
/* @__PURE__ */ jsx57("div", { className: "bg-gray-300 h-2 w-12 animate-pulse" })
|
|
3124
|
+
] })
|
|
3125
|
+
] }),
|
|
3126
|
+
/* @__PURE__ */ jsxs29("div", { className: "grid grid-cols-3 gap-4 mt-6", children: [
|
|
3127
|
+
/* @__PURE__ */ jsxs29("div", { className: "animate-pulse", children: [
|
|
3128
|
+
/* @__PURE__ */ jsx57("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
3129
|
+
/* @__PURE__ */ jsx57("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
3130
|
+
/* @__PURE__ */ jsx57("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
3131
|
+
/* @__PURE__ */ jsx57("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
3132
|
+
/* @__PURE__ */ jsx57("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
3133
|
+
] }),
|
|
3134
|
+
/* @__PURE__ */ jsxs29("div", { className: "animate-pulse", children: [
|
|
3135
|
+
/* @__PURE__ */ jsx57("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
3136
|
+
/* @__PURE__ */ jsx57("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
3137
|
+
/* @__PURE__ */ jsx57("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
3138
|
+
/* @__PURE__ */ jsx57("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
3139
|
+
/* @__PURE__ */ jsx57("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
3140
|
+
] }),
|
|
3141
|
+
/* @__PURE__ */ jsxs29("div", { className: "animate-pulse", children: [
|
|
3142
|
+
/* @__PURE__ */ jsx57("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
3143
|
+
/* @__PURE__ */ jsx57("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
3144
|
+
/* @__PURE__ */ jsx57("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
3145
|
+
/* @__PURE__ */ jsx57("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
3146
|
+
/* @__PURE__ */ jsx57("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
3147
|
+
] })
|
|
3148
|
+
] })
|
|
3149
|
+
] }) }),
|
|
3150
|
+
props.children
|
|
3151
|
+
] });
|
|
3152
|
+
};
|
|
3153
|
+
var IFrameLoaderView_default = IFrameLoaderView;
|
|
3154
|
+
|
|
3155
|
+
// src/components/pageRenderingEngine/nodes/IframeClient.tsx
|
|
3156
|
+
import { jsx as jsx58 } from "react/jsx-runtime";
|
|
3157
|
+
var IframeClient = ({ src }) => {
|
|
3158
|
+
const iframeRef = useRef4(null);
|
|
3159
|
+
const [iframeHeight, setIframeHeight] = useState9("100%");
|
|
3160
|
+
const [isDataFound, setIsDataFound] = useState9(null);
|
|
3161
|
+
useEffect8(() => {
|
|
3162
|
+
const handleReceiveMessage = (event) => {
|
|
3163
|
+
const eventName = event?.data?.eventName;
|
|
3164
|
+
const payload = event?.data?.payload;
|
|
3165
|
+
if (eventName === "SET_HEIGHT" && payload?.height) {
|
|
3166
|
+
let height = 500;
|
|
3167
|
+
if (payload.height > 500) {
|
|
3168
|
+
height = payload.height + 50;
|
|
3169
|
+
}
|
|
3170
|
+
setIframeHeight(`${height}px`);
|
|
3171
|
+
}
|
|
3172
|
+
};
|
|
3173
|
+
window.addEventListener("message", handleReceiveMessage);
|
|
3174
|
+
return () => window.removeEventListener("message", handleReceiveMessage);
|
|
3175
|
+
}, []);
|
|
3176
|
+
useEffect8(() => {
|
|
3177
|
+
const handleResize = () => {
|
|
3178
|
+
if (iframeRef.current) {
|
|
3179
|
+
iframeRef.current.contentWindow?.postMessage({ eventName: "RESIZE" }, "*");
|
|
3180
|
+
}
|
|
3181
|
+
};
|
|
3182
|
+
window.addEventListener("resize", handleResize);
|
|
3183
|
+
return () => window.removeEventListener("resize", handleResize);
|
|
3184
|
+
}, []);
|
|
3185
|
+
const handleIframeLoad = () => {
|
|
3186
|
+
setIsDataFound(true);
|
|
3187
|
+
};
|
|
3188
|
+
return /* @__PURE__ */ jsx58(React46.Fragment, { children: /* @__PURE__ */ jsx58(IFrameLoaderView_default, { isDataFound, children: /* @__PURE__ */ jsx58(
|
|
3189
|
+
"iframe",
|
|
3190
|
+
{
|
|
3191
|
+
ref: iframeRef,
|
|
3192
|
+
src,
|
|
3193
|
+
className: "w-full h-full border-none",
|
|
3194
|
+
scrolling: "no",
|
|
3195
|
+
onLoad: handleIframeLoad
|
|
3196
|
+
}
|
|
3197
|
+
) }) });
|
|
3198
|
+
};
|
|
3199
|
+
var IframeClient_default = IframeClient;
|
|
3200
|
+
|
|
3201
|
+
// src/components/pageRenderingEngine/nodes/EmbedNode.tsx
|
|
3202
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
3203
|
+
var EmbedNode = (props) => {
|
|
3204
|
+
let src;
|
|
3205
|
+
if (props.node.provider == "youtube") {
|
|
3206
|
+
src = `https://www.youtube-nocookie.com/embed/${props.node.embedSrc}`;
|
|
3207
|
+
} else if (props.node.provider == "bunny") {
|
|
3208
|
+
src = `https://iframe.mediadelivery.net/embed/${props.node.embedSrc}?autoplay=false&loop=false&muted=false&preload=true&responsive=true`;
|
|
3209
|
+
} else {
|
|
3210
|
+
src = props.node.embedSrc;
|
|
3211
|
+
}
|
|
3212
|
+
return /* @__PURE__ */ jsx59("div", { className: "aspect-video", children: src && /* @__PURE__ */ jsx59(IframeClient_default, { src }) });
|
|
3213
|
+
};
|
|
3214
|
+
var EmbedNode_default = EmbedNode;
|
|
3215
|
+
|
|
3216
|
+
// src/components/pageRenderingEngine/nodes/VideoNode.tsx
|
|
3217
|
+
import React47 from "react";
|
|
3218
|
+
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
3219
|
+
var VideoNode = (props) => {
|
|
3220
|
+
let src;
|
|
3221
|
+
if (props.node.provider == "youtube") {
|
|
3222
|
+
src = `https://www.youtube-nocookie.com/embed/${props.node.videoId}`;
|
|
3223
|
+
} else if (props.node.provider == "bunny") {
|
|
3224
|
+
src = `https://iframe.mediadelivery.net/embed/${props.node.videoId}?autoplay=false&loop=false&muted=false&preload=true&responsive=true`;
|
|
3225
|
+
}
|
|
3226
|
+
return /* @__PURE__ */ jsx60(React47.Fragment, { children: src && /* @__PURE__ */ jsx60("iframe", { className: "w-full aspect-video rounded", src, loading: "lazy", allow: "accelerometer;gyroscope;autoplay;encrypted-media;picture-in-picture;", allowFullScreen: true }) });
|
|
3227
|
+
};
|
|
3228
|
+
var VideoNode_default = VideoNode;
|
|
3229
|
+
|
|
2781
3230
|
// src/components/pageRenderingEngine/nodes/LayoutItemNode.tsx
|
|
2782
|
-
import { jsx as
|
|
3231
|
+
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
2783
3232
|
var LayoutItemNode = (props) => {
|
|
2784
3233
|
const NodeTypes2 = {
|
|
2785
3234
|
["paragraph"]: ParagraphNode_default,
|
|
@@ -2790,7 +3239,11 @@ var LayoutItemNode = (props) => {
|
|
|
2790
3239
|
["horizontalrule"]: HorizontalRuleNode_default,
|
|
2791
3240
|
["image"]: ImageNode_default,
|
|
2792
3241
|
["layout-container"]: LayoutContainerNode_default,
|
|
2793
|
-
["link"]: LinkNode_default
|
|
3242
|
+
["link"]: LinkNode_default,
|
|
3243
|
+
["widget"]: WidgetNode_default,
|
|
3244
|
+
["youtube"]: VideoNode_default,
|
|
3245
|
+
["video"]: VideoNode_default,
|
|
3246
|
+
["embed"]: EmbedNode_default
|
|
2794
3247
|
};
|
|
2795
3248
|
let cssClasses = "";
|
|
2796
3249
|
if (props.order) {
|
|
@@ -2808,6 +3261,7 @@ var LayoutItemNode = (props) => {
|
|
|
2808
3261
|
}
|
|
2809
3262
|
if (props.node.itemBorderRadius) {
|
|
2810
3263
|
styles.borderRadius = props.node.itemBorderRadius;
|
|
3264
|
+
styles.overflow = "hidden";
|
|
2811
3265
|
}
|
|
2812
3266
|
function removeParagraphsAtStartAndEnd(layoutItem) {
|
|
2813
3267
|
let startIndex = 0;
|
|
@@ -2824,6 +3278,8 @@ var LayoutItemNode = (props) => {
|
|
|
2824
3278
|
}
|
|
2825
3279
|
if (startIndex <= endIndex) {
|
|
2826
3280
|
layoutItem.children = layoutItem.children.slice(startIndex, endIndex + 1);
|
|
3281
|
+
} else {
|
|
3282
|
+
layoutItem.children = [];
|
|
2827
3283
|
}
|
|
2828
3284
|
return layoutItem;
|
|
2829
3285
|
}
|
|
@@ -2833,201 +3289,160 @@ var LayoutItemNode = (props) => {
|
|
|
2833
3289
|
} else {
|
|
2834
3290
|
updatedLayout = removeParagraphsAtStartAndEnd(props.node);
|
|
2835
3291
|
}
|
|
2836
|
-
return /* @__PURE__ */
|
|
3292
|
+
return /* @__PURE__ */ jsx61(React48.Fragment, { children: /* @__PURE__ */ jsx61("div", { className: "layout-item " + cssClasses, style: { ...styles }, children: updatedLayout.children.map((node, index) => {
|
|
2837
3293
|
{
|
|
2838
3294
|
}
|
|
2839
3295
|
const SelectedNode = NodeTypes2[node.type];
|
|
2840
|
-
return /* @__PURE__ */
|
|
2841
|
-
|
|
3296
|
+
return /* @__PURE__ */ jsx61(React48.Fragment, { children: SelectedNode && /* @__PURE__ */ jsx61(
|
|
3297
|
+
SelectedNode,
|
|
3298
|
+
{
|
|
3299
|
+
node,
|
|
3300
|
+
routeParameters: props.routeParameters,
|
|
3301
|
+
query: props.query,
|
|
3302
|
+
session: props.session,
|
|
3303
|
+
host: props.host,
|
|
3304
|
+
path: props.path,
|
|
3305
|
+
apiBaseUrl: props.apiBaseUrl
|
|
3306
|
+
}
|
|
3307
|
+
) }, index);
|
|
3308
|
+
}) }) });
|
|
2842
3309
|
};
|
|
2843
3310
|
var LayoutItemNode_default = LayoutItemNode;
|
|
2844
3311
|
|
|
2845
|
-
// src/components/
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
}
|
|
2854
|
-
|
|
2855
|
-
"1fr": "layout-grid-col-1",
|
|
2856
|
-
"1fr 1fr": "layout-grid-col-2-equal",
|
|
2857
|
-
"1fr 2fr": "layout-grid-col-2-widths-33-67",
|
|
2858
|
-
"2fr 1fr": "layout-grid-col-2-widths-67-33",
|
|
2859
|
-
"3fr 2fr": "layout-grid-col-2-widths-60-40",
|
|
2860
|
-
"3fr 1fr": "layout-grid-col-2-widths-75-25",
|
|
2861
|
-
"1fr 1fr 1fr": "layout-grid-col-3-equal",
|
|
2862
|
-
"1fr 2fr 1fr": "layout-grid-col-3-widths-25-50-25",
|
|
2863
|
-
"1fr 6fr 1fr": "layout-grid-col-3-widths-15-70-15",
|
|
2864
|
-
"1fr 1fr 1fr 1fr": "layout-grid-col-4-equal"
|
|
3312
|
+
// src/components/utilities/AssetUtility.tsx
|
|
3313
|
+
var AssetUtility = class {
|
|
3314
|
+
constructor() {
|
|
3315
|
+
}
|
|
3316
|
+
static resolveUrl(apiBaseUrl, url) {
|
|
3317
|
+
if (!url) return void 0;
|
|
3318
|
+
if (url.startsWith("http")) return url;
|
|
3319
|
+
if (!apiBaseUrl) return url;
|
|
3320
|
+
return `${apiBaseUrl}/digitalassets-management/${url}`;
|
|
3321
|
+
}
|
|
2865
3322
|
};
|
|
3323
|
+
var AssetUtility_default = AssetUtility;
|
|
3324
|
+
|
|
3325
|
+
// src/components/pageRenderingEngine/nodes/LayoutContainerNode.tsx
|
|
3326
|
+
import { Fragment as Fragment6, jsx as jsx62, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
2866
3327
|
var LayoutContainerNode = (props) => {
|
|
2867
|
-
const
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
}
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
3328
|
+
const VERTICAL_ALIGNMENT_CLASSES = {
|
|
3329
|
+
start: "items-start",
|
|
3330
|
+
center: "items-center place-content-center",
|
|
3331
|
+
end: "items-end",
|
|
3332
|
+
stretch: "items-stretch",
|
|
3333
|
+
baseline: "items-baseline"
|
|
3334
|
+
};
|
|
3335
|
+
const LAYOUTGRID_COLS_CLASSES = {
|
|
3336
|
+
"1fr": "layout-grid-col-1",
|
|
3337
|
+
"1fr 1fr": "layout-grid-col-2-equal",
|
|
3338
|
+
"1fr 2fr": "layout-grid-col-2-widths-33-67",
|
|
3339
|
+
"2fr 1fr": "layout-grid-col-2-widths-67-33",
|
|
3340
|
+
"3fr 2fr": "layout-grid-col-2-widths-60-40",
|
|
3341
|
+
"3fr 1fr": "layout-grid-col-2-widths-75-25",
|
|
3342
|
+
"1fr 1fr 1fr": "layout-grid-col-3-equal",
|
|
3343
|
+
"1fr 2fr 1fr": "layout-grid-col-3-widths-25-50-25",
|
|
3344
|
+
"1fr 6fr 1fr": "layout-grid-col-3-widths-15-70-15",
|
|
3345
|
+
"1fr 1fr 1fr 1fr": "layout-grid-col-4-equal"
|
|
3346
|
+
};
|
|
3347
|
+
const sectionWidth = props.node.sectionWidth || "fixed";
|
|
3348
|
+
let gridCssClasses = LAYOUTGRID_COLS_CLASSES[props.node.templateColumns] || "";
|
|
3349
|
+
if (props.node.contentVerticalAlignment) {
|
|
3350
|
+
gridCssClasses += " " + (VERTICAL_ALIGNMENT_CLASSES[props.node.contentVerticalAlignment] || "");
|
|
2877
3351
|
}
|
|
3352
|
+
const columnGap = props.node.columnGap || "0.5rem";
|
|
2878
3353
|
const styles = {};
|
|
2879
|
-
|
|
2880
|
-
styles.backgroundColor = node.backgroundColor;
|
|
2881
|
-
}
|
|
2882
|
-
let cssClasses = "layout_grid ";
|
|
3354
|
+
let cssClasses = "layout_grid";
|
|
2883
3355
|
let addPadding = false;
|
|
2884
|
-
if (node.
|
|
2885
|
-
|
|
2886
|
-
}
|
|
2887
|
-
cssClasses = cssClasses + " " + (node.boxShadow || "");
|
|
2888
|
-
addPadding = true;
|
|
3356
|
+
if (props.node.backgroundColor) {
|
|
3357
|
+
styles.backgroundColor = props.node.backgroundColor;
|
|
2889
3358
|
}
|
|
2890
|
-
if (node.borderWidth) {
|
|
2891
|
-
styles.borderWidth = node.borderWidth;
|
|
3359
|
+
if (props.node.borderWidth) {
|
|
3360
|
+
styles.borderWidth = props.node.borderWidth;
|
|
2892
3361
|
addPadding = true;
|
|
2893
3362
|
}
|
|
2894
|
-
if (node.borderRadius) {
|
|
2895
|
-
styles.borderRadius = node.borderRadius;
|
|
2896
|
-
}
|
|
2897
|
-
let backgroundStyle = "";
|
|
2898
|
-
if (node.backgroundImage) {
|
|
2899
|
-
let resolvedPath = node.backgroundImage;
|
|
2900
|
-
if (!resolvedPath.startsWith("http")) {
|
|
2901
|
-
resolvedPath = `${apiBaseUrl}/digitalassets/storefront/${resolvedPath}`;
|
|
2902
|
-
}
|
|
2903
|
-
backgroundStyle = `url('${resolvedPath}'),`;
|
|
3363
|
+
if (props.node.borderRadius) {
|
|
3364
|
+
styles.borderRadius = props.node.borderRadius;
|
|
2904
3365
|
}
|
|
2905
|
-
if (node.
|
|
2906
|
-
|
|
3366
|
+
if (props.node.boxShadow && props.node.boxShadow !== "shadow-none") {
|
|
3367
|
+
cssClasses += " " + props.node.boxShadow;
|
|
3368
|
+
addPadding = true;
|
|
2907
3369
|
}
|
|
2908
|
-
|
|
2909
|
-
|
|
3370
|
+
const backgroundLayers = [];
|
|
3371
|
+
if (props.node.backgroundImage) {
|
|
3372
|
+
const resolved = AssetUtility_default.resolveUrl(
|
|
3373
|
+
props.apiBaseUrl,
|
|
3374
|
+
props.node.backgroundImage
|
|
3375
|
+
);
|
|
3376
|
+
if (resolved) {
|
|
3377
|
+
backgroundLayers.push(`url('${resolved}')`);
|
|
3378
|
+
addPadding = true;
|
|
3379
|
+
}
|
|
2910
3380
|
}
|
|
2911
|
-
if (
|
|
2912
|
-
|
|
2913
|
-
|
|
3381
|
+
if (props.node.gradientColor1 && props.node.gradientColor2) {
|
|
3382
|
+
backgroundLayers.push(
|
|
3383
|
+
`linear-gradient(to bottom, ${props.node.gradientColor1}, ${props.node.gradientColor2})`
|
|
3384
|
+
);
|
|
3385
|
+
addPadding = true;
|
|
3386
|
+
} else if (props.node.gradientColor1) {
|
|
3387
|
+
backgroundLayers.push(props.node.gradientColor1);
|
|
3388
|
+
addPadding = true;
|
|
3389
|
+
} else if (props.node.gradientColor2) {
|
|
3390
|
+
backgroundLayers.push(props.node.gradientColor2);
|
|
2914
3391
|
addPadding = true;
|
|
2915
3392
|
}
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
sectionWidth = node.sectionWidth;
|
|
3393
|
+
if (backgroundLayers.length) {
|
|
3394
|
+
styles.background = backgroundLayers.join(", ");
|
|
2919
3395
|
}
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
3396
|
+
const renderChildren = () => props.node.children?.map((node, index) => /* @__PURE__ */ jsx62(
|
|
3397
|
+
LayoutItemNode_default,
|
|
3398
|
+
{
|
|
3399
|
+
node,
|
|
3400
|
+
order: props.node.smOrder === "reverse" ? props.node.children.length - index : index,
|
|
3401
|
+
routeParameters: props.routeParameters,
|
|
3402
|
+
query: props.query,
|
|
3403
|
+
session: props.session,
|
|
3404
|
+
host: props.host,
|
|
3405
|
+
path: props.path,
|
|
3406
|
+
apiBaseUrl: props.apiBaseUrl
|
|
3407
|
+
},
|
|
3408
|
+
index
|
|
3409
|
+
));
|
|
3410
|
+
return /* @__PURE__ */ jsxs30(Fragment6, { children: [
|
|
3411
|
+
sectionWidth === "mixed" && /* @__PURE__ */ jsx62("div", { className: cssClasses, style: styles, children: /* @__PURE__ */ jsx62("div", { className: "container", children: /* @__PURE__ */ jsx62(
|
|
2925
3412
|
"div",
|
|
2926
3413
|
{
|
|
2927
|
-
className:
|
|
3414
|
+
className: `grid gap-y-4 lg:gap-y-0 ${gridCssClasses} ${addPadding ? "py-8 lg:py-6" : ""}`,
|
|
3415
|
+
style: { columnGap, minHeight: props.node.height },
|
|
3416
|
+
children: renderChildren()
|
|
3417
|
+
}
|
|
3418
|
+
) }) }),
|
|
3419
|
+
sectionWidth === "full" && /* @__PURE__ */ jsx62(
|
|
3420
|
+
"div",
|
|
3421
|
+
{
|
|
3422
|
+
className: `grid gap-y-4 lg:gap-y-0 ${cssClasses} ${gridCssClasses} ${addPadding ? "p-8 lg:p-0" : ""}`,
|
|
2928
3423
|
style: { columnGap, ...styles },
|
|
2929
|
-
children:
|
|
2930
|
-
return /* @__PURE__ */ jsx55(React45.Fragment, { children: /* @__PURE__ */ jsx55(LayoutItemNode_default, { node: node2, order: props.node.smOrder == "reverse" ? node2.children.length - index : index }) }, index);
|
|
2931
|
-
})
|
|
3424
|
+
children: renderChildren()
|
|
2932
3425
|
}
|
|
2933
3426
|
),
|
|
2934
|
-
sectionWidth
|
|
3427
|
+
sectionWidth === "fixed" && /* @__PURE__ */ jsx62("div", { className: "container", children: /* @__PURE__ */ jsx62(
|
|
2935
3428
|
"div",
|
|
2936
3429
|
{
|
|
2937
|
-
className:
|
|
3430
|
+
className: `grid gap-y-4 lg:gap-y-0 ${cssClasses} ${gridCssClasses} ${addPadding ? "px-8 py-6 lg:px-6 lg:py-6" : ""}`,
|
|
2938
3431
|
style: { columnGap, ...styles },
|
|
2939
|
-
children:
|
|
2940
|
-
return /* @__PURE__ */ jsx55(React45.Fragment, { children: /* @__PURE__ */ jsx55(LayoutItemNode_default, { node: node2, order: props.node.smOrder == "reverse" ? node2.children.length - index : index }) }, index);
|
|
2941
|
-
})
|
|
3432
|
+
children: renderChildren()
|
|
2942
3433
|
}
|
|
2943
3434
|
) })
|
|
2944
3435
|
] });
|
|
2945
3436
|
};
|
|
2946
3437
|
var LayoutContainerNode_default = LayoutContainerNode;
|
|
2947
3438
|
|
|
2948
|
-
// src/components/pageRenderingEngine/nodes/WidgetNode.tsx
|
|
2949
|
-
import { Suspense } from "react";
|
|
2950
|
-
import { Fragment as Fragment4, jsx as jsx56, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2951
|
-
var WidgetNode = (props) => {
|
|
2952
|
-
const getWidgetParameters = () => {
|
|
2953
|
-
const widgetInputParameters = { ...props.routeParameters ?? {} };
|
|
2954
|
-
const rawWidgetParams = props.node?.widgetParameters ?? props.node?.widgetParams;
|
|
2955
|
-
let widgetParameters = {};
|
|
2956
|
-
const isJSON = (str) => {
|
|
2957
|
-
if (typeof str !== "string") return false;
|
|
2958
|
-
str = str.trim();
|
|
2959
|
-
return str.startsWith("{") && str.endsWith("}") || str.startsWith("[") && str.endsWith("]");
|
|
2960
|
-
};
|
|
2961
|
-
if (rawWidgetParams) {
|
|
2962
|
-
if (typeof rawWidgetParams === "string" && isJSON(rawWidgetParams)) {
|
|
2963
|
-
widgetParameters = JSON.parse(rawWidgetParams);
|
|
2964
|
-
} else if (typeof rawWidgetParams === "object") {
|
|
2965
|
-
widgetParameters = rawWidgetParams;
|
|
2966
|
-
}
|
|
2967
|
-
}
|
|
2968
|
-
const resolveValue = (val) => {
|
|
2969
|
-
if (typeof val === "string") {
|
|
2970
|
-
const m = /^\{(.+)\}$/.exec(val);
|
|
2971
|
-
if (m) {
|
|
2972
|
-
const actualKey = m[1];
|
|
2973
|
-
return props.routeParameters?.[actualKey] ?? val;
|
|
2974
|
-
}
|
|
2975
|
-
return val;
|
|
2976
|
-
} else if (Array.isArray(val)) {
|
|
2977
|
-
return val.map(resolveValue);
|
|
2978
|
-
} else if (val && typeof val === "object") {
|
|
2979
|
-
const out = {};
|
|
2980
|
-
for (const k of Object.keys(val)) {
|
|
2981
|
-
out[k] = resolveValue(val[k]);
|
|
2982
|
-
}
|
|
2983
|
-
return out;
|
|
2984
|
-
}
|
|
2985
|
-
return val;
|
|
2986
|
-
};
|
|
2987
|
-
Object.keys(widgetParameters).forEach((key) => {
|
|
2988
|
-
const rawVal = widgetParameters[key];
|
|
2989
|
-
if (rawVal === "route") {
|
|
2990
|
-
if (key === "itemPath") {
|
|
2991
|
-
widgetInputParameters[key] = props.path;
|
|
2992
|
-
} else {
|
|
2993
|
-
widgetInputParameters[key] = widgetInputParameters[key] ?? null;
|
|
2994
|
-
}
|
|
2995
|
-
} else {
|
|
2996
|
-
widgetInputParameters[key] = resolveValue(rawVal);
|
|
2997
|
-
}
|
|
2998
|
-
});
|
|
2999
|
-
widgetInputParameters["widgetTitle"] = props.node?.widgetTitle;
|
|
3000
|
-
return widgetInputParameters;
|
|
3001
|
-
};
|
|
3002
|
-
const SelectedWidget = props.widgetRegistry?.[props.node.widgetCode];
|
|
3003
|
-
if (!SelectedWidget) {
|
|
3004
|
-
console.warn("Widget not found:", props.node.widgetCode);
|
|
3005
|
-
return /* @__PURE__ */ jsxs27(Fragment4, { children: [
|
|
3006
|
-
"Widget not found: ",
|
|
3007
|
-
props.node.widgetCode
|
|
3008
|
-
] });
|
|
3009
|
-
}
|
|
3010
|
-
return /* @__PURE__ */ jsx56(Suspense, { fallback: /* @__PURE__ */ jsx56("div", { className: "container mt-2", children: "..." }), children: /* @__PURE__ */ jsx56(
|
|
3011
|
-
SelectedWidget,
|
|
3012
|
-
{
|
|
3013
|
-
params: getWidgetParameters(),
|
|
3014
|
-
query: props.query,
|
|
3015
|
-
session: props.session,
|
|
3016
|
-
host: props.host,
|
|
3017
|
-
path: props.path,
|
|
3018
|
-
apiBaseUrl: props.apiBaseUrl
|
|
3019
|
-
}
|
|
3020
|
-
) });
|
|
3021
|
-
};
|
|
3022
|
-
var WidgetNode_default = WidgetNode;
|
|
3023
|
-
|
|
3024
3439
|
// src/components/pageRenderingEngine/nodes/FormContainerNode.tsx
|
|
3025
|
-
import
|
|
3440
|
+
import React49, { useRef as useRef5, useReducer as useReducer2, useCallback as useCallback3, useEffect as useEffect9 } from "react";
|
|
3026
3441
|
|
|
3027
3442
|
// src/components/pageRenderingEngine/nodes/InputControlNode.tsx
|
|
3028
|
-
import { jsx as
|
|
3443
|
+
import { jsx as jsx63 } from "react/jsx-runtime";
|
|
3029
3444
|
var InputControlNode = (props) => {
|
|
3030
|
-
return /* @__PURE__ */
|
|
3445
|
+
return /* @__PURE__ */ jsx63("div", { children: /* @__PURE__ */ jsx63(
|
|
3031
3446
|
InputControl_default,
|
|
3032
3447
|
{
|
|
3033
3448
|
name: props.node.name,
|
|
@@ -3056,13 +3471,13 @@ var InputControlNode = (props) => {
|
|
|
3056
3471
|
var InputControlNode_default = InputControlNode;
|
|
3057
3472
|
|
|
3058
3473
|
// src/components/pageRenderingEngine/nodes/FormContainerNode.tsx
|
|
3059
|
-
import { jsx as
|
|
3474
|
+
import { jsx as jsx64, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
3060
3475
|
var FormContainerNode = (props) => {
|
|
3061
3476
|
const NodeTypes2 = {
|
|
3062
3477
|
["input-control"]: InputControlNode_default
|
|
3063
3478
|
};
|
|
3064
3479
|
const { node } = props;
|
|
3065
|
-
const formRef =
|
|
3480
|
+
const formRef = useRef5(null);
|
|
3066
3481
|
const initialState = {
|
|
3067
3482
|
inputValues: {},
|
|
3068
3483
|
lastPropertyChanged: ""
|
|
@@ -3079,7 +3494,7 @@ var FormContainerNode = (props) => {
|
|
|
3079
3494
|
return true;
|
|
3080
3495
|
}
|
|
3081
3496
|
};
|
|
3082
|
-
|
|
3497
|
+
useEffect9(() => {
|
|
3083
3498
|
const fetchInitialData = async () => {
|
|
3084
3499
|
if (!props.fetchData || !node.dataFetchApi) return;
|
|
3085
3500
|
const response = await props.fetchData(
|
|
@@ -3096,12 +3511,12 @@ var FormContainerNode = (props) => {
|
|
|
3096
3511
|
};
|
|
3097
3512
|
fetchInitialData();
|
|
3098
3513
|
}, [props.fetchData, node.dataFetchApi, props.routeParameters]);
|
|
3099
|
-
return /* @__PURE__ */
|
|
3514
|
+
return /* @__PURE__ */ jsxs31("form", { className: "group space-y-6 pb-6 overflow-y-auto", noValidate: true, ref: formRef, children: [
|
|
3100
3515
|
node.children && node.children.map((node2, index) => {
|
|
3101
3516
|
{
|
|
3102
3517
|
}
|
|
3103
3518
|
const SelectedNode = NodeTypes2[node2.type];
|
|
3104
|
-
return /* @__PURE__ */
|
|
3519
|
+
return /* @__PURE__ */ jsx64(React49.Fragment, { children: SelectedNode && node2.type == "input-control" && /* @__PURE__ */ jsx64(
|
|
3105
3520
|
InputControlNode_default,
|
|
3106
3521
|
{
|
|
3107
3522
|
value: formState.inputValues[node2.name],
|
|
@@ -3110,34 +3525,15 @@ var FormContainerNode = (props) => {
|
|
|
3110
3525
|
}
|
|
3111
3526
|
) }, index);
|
|
3112
3527
|
}),
|
|
3113
|
-
node.children.length == 0 && /* @__PURE__ */
|
|
3528
|
+
node.children.length == 0 && /* @__PURE__ */ jsx64("div", { className: "py-0.5 lg:py-1.5" })
|
|
3114
3529
|
] });
|
|
3115
3530
|
};
|
|
3116
3531
|
var FormContainerNode_default = FormContainerNode;
|
|
3117
3532
|
|
|
3118
3533
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
3119
|
-
import
|
|
3534
|
+
import React50 from "react";
|
|
3120
3535
|
import Link3 from "next/link";
|
|
3121
|
-
|
|
3122
|
-
// src/components/utilities/AssetUtility.tsx
|
|
3123
|
-
var AssetUtility = class {
|
|
3124
|
-
constructor() {
|
|
3125
|
-
}
|
|
3126
|
-
static resolveUrl(apiBaseUrl, url) {
|
|
3127
|
-
if (url) {
|
|
3128
|
-
if (url.startsWith("http")) {
|
|
3129
|
-
return url;
|
|
3130
|
-
} else {
|
|
3131
|
-
return `${apiBaseUrl}/digitalassets-management/${url}`;
|
|
3132
|
-
}
|
|
3133
|
-
}
|
|
3134
|
-
return void 0;
|
|
3135
|
-
}
|
|
3136
|
-
};
|
|
3137
|
-
var AssetUtility_default = AssetUtility;
|
|
3138
|
-
|
|
3139
|
-
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
3140
|
-
import { jsx as jsx59, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
3536
|
+
import { jsx as jsx65, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
3141
3537
|
var DivContainer = (props) => {
|
|
3142
3538
|
const { cssProperties: styles, hoverCssProperties: hoverStyles, mobileCssProperties: mobileStyles } = props.node;
|
|
3143
3539
|
const updatedStyles = convertKeysToCamelCase(styles);
|
|
@@ -3151,8 +3547,10 @@ var DivContainer = (props) => {
|
|
|
3151
3547
|
["horizontalrule"]: HorizontalRuleNode_default,
|
|
3152
3548
|
["layout-container"]: LayoutContainerNode_default,
|
|
3153
3549
|
["widget"]: WidgetNode_default,
|
|
3550
|
+
["embed"]: EmbedNode_default,
|
|
3154
3551
|
["div-container"]: DivContainer,
|
|
3155
3552
|
["text"]: TextNode_default,
|
|
3553
|
+
["datafield"]: DatafieldNode_default,
|
|
3156
3554
|
["svg-icon"]: SVGIconNode_default
|
|
3157
3555
|
};
|
|
3158
3556
|
function toCamelCase(str) {
|
|
@@ -3254,9 +3652,9 @@ ${mobileCssRules.join("\n")}
|
|
|
3254
3652
|
return css2;
|
|
3255
3653
|
};
|
|
3256
3654
|
const css = generateCssString(updatedStyle, hoverStyles, mobileStyles);
|
|
3257
|
-
return /* @__PURE__ */
|
|
3258
|
-
/* @__PURE__ */
|
|
3259
|
-
props.node.href && props.node.href !== "" ? /* @__PURE__ */
|
|
3655
|
+
return /* @__PURE__ */ jsxs32(React50.Fragment, { children: [
|
|
3656
|
+
/* @__PURE__ */ jsx65("style", { dangerouslySetInnerHTML: { __html: css } }),
|
|
3657
|
+
props.node.href && props.node.href !== "" ? /* @__PURE__ */ jsx65(Link3, { href: props.node.href, className: "block", children: /* @__PURE__ */ jsx65(
|
|
3260
3658
|
"div",
|
|
3261
3659
|
{
|
|
3262
3660
|
id: guid,
|
|
@@ -3264,7 +3662,7 @@ ${mobileCssRules.join("\n")}
|
|
|
3264
3662
|
className: containerPaddingClass,
|
|
3265
3663
|
children: props.node.children?.map((node, index) => {
|
|
3266
3664
|
const SelectedNode = NodeTypes2[node.type];
|
|
3267
|
-
return /* @__PURE__ */
|
|
3665
|
+
return /* @__PURE__ */ jsx65(React50.Fragment, { children: SelectedNode && /* @__PURE__ */ jsx65(
|
|
3268
3666
|
SelectedNode,
|
|
3269
3667
|
{
|
|
3270
3668
|
node,
|
|
@@ -3279,9 +3677,9 @@ ${mobileCssRules.join("\n")}
|
|
|
3279
3677
|
) }, index);
|
|
3280
3678
|
})
|
|
3281
3679
|
}
|
|
3282
|
-
) }) : /* @__PURE__ */
|
|
3680
|
+
) }) : /* @__PURE__ */ jsx65("div", { id: guid, style: { ...backgroundStyle }, className: containerPaddingClass, children: props.node.children && props.node.children.map((node, index) => {
|
|
3283
3681
|
const SelectedNode = NodeTypes2[node.type];
|
|
3284
|
-
return /* @__PURE__ */
|
|
3682
|
+
return /* @__PURE__ */ jsx65(React50.Fragment, { children: SelectedNode && /* @__PURE__ */ jsx65(
|
|
3285
3683
|
SelectedNode,
|
|
3286
3684
|
{
|
|
3287
3685
|
node,
|
|
@@ -3300,7 +3698,7 @@ ${mobileCssRules.join("\n")}
|
|
|
3300
3698
|
var DivContainer_default = DivContainer;
|
|
3301
3699
|
|
|
3302
3700
|
// src/components/pageRenderingEngine/PageBodyRenderer.tsx
|
|
3303
|
-
import { jsx as
|
|
3701
|
+
import { jsx as jsx66 } from "react/jsx-runtime";
|
|
3304
3702
|
var NodeTypes = {
|
|
3305
3703
|
["paragraph"]: ParagraphNode_default,
|
|
3306
3704
|
["heading"]: HeadingNode_default,
|
|
@@ -3313,7 +3711,8 @@ var NodeTypes = {
|
|
|
3313
3711
|
["widget"]: WidgetNode_default,
|
|
3314
3712
|
["form-container"]: FormContainerNode_default,
|
|
3315
3713
|
["div-container"]: DivContainer_default,
|
|
3316
|
-
["svg-icon"]: SVGIconNode_default
|
|
3714
|
+
["svg-icon"]: SVGIconNode_default,
|
|
3715
|
+
["embed"]: EmbedNode_default
|
|
3317
3716
|
};
|
|
3318
3717
|
var PageBodyRenderer = (props) => {
|
|
3319
3718
|
let pageBodyTree;
|
|
@@ -3327,11 +3726,11 @@ var PageBodyRenderer = (props) => {
|
|
|
3327
3726
|
if (pageBodyTree && pageBodyTree.root) {
|
|
3328
3727
|
rootNode = pageBodyTree.root;
|
|
3329
3728
|
}
|
|
3330
|
-
return /* @__PURE__ */
|
|
3729
|
+
return /* @__PURE__ */ jsx66(React51.Fragment, { children: rootNode && rootNode?.children?.map((node, index) => {
|
|
3331
3730
|
{
|
|
3332
3731
|
}
|
|
3333
3732
|
const SelectedNode = NodeTypes[node.type];
|
|
3334
|
-
return /* @__PURE__ */
|
|
3733
|
+
return /* @__PURE__ */ jsx66(React51.Fragment, { children: SelectedNode && /* @__PURE__ */ jsx66(React51.Fragment, { children: node.type == "layout-container" ? /* @__PURE__ */ jsx66(React51.Fragment, { children: /* @__PURE__ */ jsx66(
|
|
3335
3734
|
SelectedNode,
|
|
3336
3735
|
{
|
|
3337
3736
|
node,
|
|
@@ -3344,7 +3743,7 @@ var PageBodyRenderer = (props) => {
|
|
|
3344
3743
|
apiBaseUrl: props.apiBaseUrl,
|
|
3345
3744
|
widgetRegistry: props.widgetRegistry
|
|
3346
3745
|
}
|
|
3347
|
-
) }) : /* @__PURE__ */
|
|
3746
|
+
) }) : /* @__PURE__ */ jsx66(React51.Fragment, { children: /* @__PURE__ */ jsx66(
|
|
3348
3747
|
SelectedNode,
|
|
3349
3748
|
{
|
|
3350
3749
|
node,
|