@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260323121228 → 0.8.1-dev.20260323123345
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 +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +63 -55
- package/dist/index.mjs +45 -37
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -205,7 +205,7 @@ interface PageBodyRendererProps {
|
|
|
205
205
|
donotApplyContainerLargeClass?: boolean;
|
|
206
206
|
widgetRegistry?: Record<string, React.ComponentType<any>>;
|
|
207
207
|
serviceClient?: ServiceClientInterface;
|
|
208
|
-
resolveAssetUrl?: (
|
|
208
|
+
resolveAssetUrl?: (url: string) => string | undefined;
|
|
209
209
|
dataMap?: Record<string, any>;
|
|
210
210
|
}
|
|
211
211
|
declare const PageBodyRenderer: React.FC<PageBodyRendererProps>;
|
package/dist/index.d.ts
CHANGED
|
@@ -205,7 +205,7 @@ interface PageBodyRendererProps {
|
|
|
205
205
|
donotApplyContainerLargeClass?: boolean;
|
|
206
206
|
widgetRegistry?: Record<string, React.ComponentType<any>>;
|
|
207
207
|
serviceClient?: ServiceClientInterface;
|
|
208
|
-
resolveAssetUrl?: (
|
|
208
|
+
resolveAssetUrl?: (url: string) => string | undefined;
|
|
209
209
|
dataMap?: Record<string, any>;
|
|
210
210
|
}
|
|
211
211
|
declare const PageBodyRenderer: React.FC<PageBodyRendererProps>;
|
package/dist/index.js
CHANGED
|
@@ -2541,7 +2541,7 @@ var DataList = (props) => {
|
|
|
2541
2541
|
var DataList_default = DataList;
|
|
2542
2542
|
|
|
2543
2543
|
// src/components/pageRenderingEngine/PageBodyRenderer.tsx
|
|
2544
|
-
var
|
|
2544
|
+
var import_react53 = __toESM(require("react"));
|
|
2545
2545
|
|
|
2546
2546
|
// src/components/pageRenderingEngine/nodes/ParagraphNode.tsx
|
|
2547
2547
|
var import_react36 = __toESM(require("react"));
|
|
@@ -3032,15 +3032,23 @@ var HorizontalRuleNode = (props) => {
|
|
|
3032
3032
|
var HorizontalRuleNode_default = HorizontalRuleNode;
|
|
3033
3033
|
|
|
3034
3034
|
// src/components/pageRenderingEngine/nodes/LayoutItemNode.tsx
|
|
3035
|
-
var
|
|
3035
|
+
var import_react47 = __toESM(require("react"));
|
|
3036
3036
|
|
|
3037
3037
|
// src/components/pageRenderingEngine/nodes/ImageNode.tsx
|
|
3038
|
-
var import_react43 = __toESM(require("react"));
|
|
3039
3038
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
3040
3039
|
var ImageNode = (props) => {
|
|
3041
|
-
const { node, apiBaseUrl = "" } = props;
|
|
3042
|
-
let imageUrl
|
|
3043
|
-
|
|
3040
|
+
const { node, apiBaseUrl = "", resolveAssetUrl } = props;
|
|
3041
|
+
let imageUrl;
|
|
3042
|
+
if (!node.imageUrl) return null;
|
|
3043
|
+
if (node.imageUrl.startsWith("http")) {
|
|
3044
|
+
imageUrl = node.imageUrl;
|
|
3045
|
+
} else if (resolveAssetUrl) {
|
|
3046
|
+
imageUrl = resolveAssetUrl(node.imageUrl);
|
|
3047
|
+
} else {
|
|
3048
|
+
imageUrl = `${apiBaseUrl}/${node.imageUrl}`;
|
|
3049
|
+
}
|
|
3050
|
+
if (!imageUrl) return null;
|
|
3051
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_jsx_runtime55.Fragment, { children: node.width ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { style: { width: node.width }, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
3044
3052
|
"img",
|
|
3045
3053
|
{
|
|
3046
3054
|
loading: "lazy",
|
|
@@ -3065,7 +3073,7 @@ var ImageNode = (props) => {
|
|
|
3065
3073
|
var ImageNode_default = ImageNode;
|
|
3066
3074
|
|
|
3067
3075
|
// src/components/pageRenderingEngine/nodes/WidgetNode.tsx
|
|
3068
|
-
var
|
|
3076
|
+
var import_react43 = require("react");
|
|
3069
3077
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
3070
3078
|
var WidgetNode = (props) => {
|
|
3071
3079
|
const getWidgetParameters = () => {
|
|
@@ -3126,7 +3134,7 @@ var WidgetNode = (props) => {
|
|
|
3126
3134
|
props.node.widgetCode
|
|
3127
3135
|
] });
|
|
3128
3136
|
}
|
|
3129
|
-
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
3137
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_react43.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "container mt-2", children: "..." }), children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
3130
3138
|
SelectedWidget,
|
|
3131
3139
|
{
|
|
3132
3140
|
params: getWidgetParameters(),
|
|
@@ -3141,13 +3149,13 @@ var WidgetNode = (props) => {
|
|
|
3141
3149
|
var WidgetNode_default = WidgetNode;
|
|
3142
3150
|
|
|
3143
3151
|
// src/components/pageRenderingEngine/nodes/IframeClient.tsx
|
|
3144
|
-
var
|
|
3152
|
+
var import_react45 = __toESM(require("react"));
|
|
3145
3153
|
|
|
3146
3154
|
// src/components/IFrameLoaderView.tsx
|
|
3147
|
-
var
|
|
3155
|
+
var import_react44 = __toESM(require("react"));
|
|
3148
3156
|
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
3149
3157
|
var IFrameLoaderView = (props) => {
|
|
3150
|
-
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
3158
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_react44.default.Fragment, { children: [
|
|
3151
3159
|
props.isDataFound == null && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "mt-4 bg-gray-200 rounded-md p-4 animate-pulse", children: [
|
|
3152
3160
|
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex items-center mb-4", children: [
|
|
3153
3161
|
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "bg-gray-300 h-8 w-8 rounded-full animate-pulse" }),
|
|
@@ -3188,10 +3196,10 @@ var IFrameLoaderView_default = IFrameLoaderView;
|
|
|
3188
3196
|
// src/components/pageRenderingEngine/nodes/IframeClient.tsx
|
|
3189
3197
|
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
3190
3198
|
var IframeClient = ({ src }) => {
|
|
3191
|
-
const iframeRef = (0,
|
|
3192
|
-
const [iframeHeight, setIframeHeight] = (0,
|
|
3193
|
-
const [isDataFound, setIsDataFound] = (0,
|
|
3194
|
-
(0,
|
|
3199
|
+
const iframeRef = (0, import_react45.useRef)(null);
|
|
3200
|
+
const [iframeHeight, setIframeHeight] = (0, import_react45.useState)("100%");
|
|
3201
|
+
const [isDataFound, setIsDataFound] = (0, import_react45.useState)(null);
|
|
3202
|
+
(0, import_react45.useEffect)(() => {
|
|
3195
3203
|
const handleReceiveMessage = (event) => {
|
|
3196
3204
|
const eventName = event?.data?.eventName;
|
|
3197
3205
|
const payload = event?.data?.payload;
|
|
@@ -3206,7 +3214,7 @@ var IframeClient = ({ src }) => {
|
|
|
3206
3214
|
window.addEventListener("message", handleReceiveMessage);
|
|
3207
3215
|
return () => window.removeEventListener("message", handleReceiveMessage);
|
|
3208
3216
|
}, []);
|
|
3209
|
-
(0,
|
|
3217
|
+
(0, import_react45.useEffect)(() => {
|
|
3210
3218
|
const handleResize = () => {
|
|
3211
3219
|
if (iframeRef.current) {
|
|
3212
3220
|
iframeRef.current.contentWindow?.postMessage({ eventName: "RESIZE" }, "*");
|
|
@@ -3218,7 +3226,7 @@ var IframeClient = ({ src }) => {
|
|
|
3218
3226
|
const handleIframeLoad = () => {
|
|
3219
3227
|
setIsDataFound(true);
|
|
3220
3228
|
};
|
|
3221
|
-
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
3229
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_react45.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(IFrameLoaderView_default, { isDataFound, children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
3222
3230
|
"iframe",
|
|
3223
3231
|
{
|
|
3224
3232
|
ref: iframeRef,
|
|
@@ -3247,7 +3255,7 @@ var EmbedNode = (props) => {
|
|
|
3247
3255
|
var EmbedNode_default = EmbedNode;
|
|
3248
3256
|
|
|
3249
3257
|
// src/components/pageRenderingEngine/nodes/VideoNode.tsx
|
|
3250
|
-
var
|
|
3258
|
+
var import_react46 = __toESM(require("react"));
|
|
3251
3259
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
3252
3260
|
var VideoNode = (props) => {
|
|
3253
3261
|
let src;
|
|
@@ -3256,7 +3264,7 @@ var VideoNode = (props) => {
|
|
|
3256
3264
|
} else if (props.node.provider == "bunny") {
|
|
3257
3265
|
src = `https://iframe.mediadelivery.net/embed/${props.node.videoId}?autoplay=false&loop=false&muted=false&preload=true&responsive=true`;
|
|
3258
3266
|
}
|
|
3259
|
-
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
3267
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_react46.default.Fragment, { children: src && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("iframe", { className: "w-full aspect-video rounded", src, loading: "lazy", allow: "accelerometer;gyroscope;autoplay;encrypted-media;picture-in-picture;", allowFullScreen: true }) });
|
|
3260
3268
|
};
|
|
3261
3269
|
var VideoNode_default = VideoNode;
|
|
3262
3270
|
|
|
@@ -3322,11 +3330,11 @@ var LayoutItemNode = (props) => {
|
|
|
3322
3330
|
} else {
|
|
3323
3331
|
updatedLayout = removeParagraphsAtStartAndEnd(props.node);
|
|
3324
3332
|
}
|
|
3325
|
-
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
3333
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_react47.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "layout-item " + cssClasses, style: { ...styles }, children: updatedLayout.children.map((node, index) => {
|
|
3326
3334
|
{
|
|
3327
3335
|
}
|
|
3328
3336
|
const SelectedNode = NodeTypes2[node.type];
|
|
3329
|
-
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
3337
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_react47.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
3330
3338
|
SelectedNode,
|
|
3331
3339
|
{
|
|
3332
3340
|
node,
|
|
@@ -3470,7 +3478,7 @@ var LayoutContainerNode = (props) => {
|
|
|
3470
3478
|
var LayoutContainerNode_default = LayoutContainerNode;
|
|
3471
3479
|
|
|
3472
3480
|
// src/components/pageRenderingEngine/nodes/FormContainerNode.tsx
|
|
3473
|
-
var
|
|
3481
|
+
var import_react48 = __toESM(require("react"));
|
|
3474
3482
|
|
|
3475
3483
|
// src/components/pageRenderingEngine/nodes/InputControlNode.tsx
|
|
3476
3484
|
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
@@ -3510,13 +3518,13 @@ var FormContainerNode = (props) => {
|
|
|
3510
3518
|
["input-control"]: InputControlNode_default
|
|
3511
3519
|
};
|
|
3512
3520
|
const { node } = props;
|
|
3513
|
-
const formRef = (0,
|
|
3521
|
+
const formRef = (0, import_react48.useRef)(null);
|
|
3514
3522
|
const initialState = {
|
|
3515
3523
|
inputValues: {},
|
|
3516
3524
|
lastPropertyChanged: ""
|
|
3517
3525
|
};
|
|
3518
|
-
const [formState, dispatch] = (0,
|
|
3519
|
-
const handleInputChange = (0,
|
|
3526
|
+
const [formState, dispatch] = (0, import_react48.useReducer)(FormReducer_default, initialState);
|
|
3527
|
+
const handleInputChange = (0, import_react48.useCallback)((updatedValues) => {
|
|
3520
3528
|
dispatch({ type: FORM_INPUT_UPDATE, name: updatedValues.name, value: updatedValues.value });
|
|
3521
3529
|
}, [dispatch]);
|
|
3522
3530
|
const onValidate = async () => {
|
|
@@ -3527,7 +3535,7 @@ var FormContainerNode = (props) => {
|
|
|
3527
3535
|
return true;
|
|
3528
3536
|
}
|
|
3529
3537
|
};
|
|
3530
|
-
(0,
|
|
3538
|
+
(0, import_react48.useEffect)(() => {
|
|
3531
3539
|
const fetchInitialData = async () => {
|
|
3532
3540
|
if (!props.fetchData || !node.dataFetchApi) return;
|
|
3533
3541
|
const response = await props.fetchData(
|
|
@@ -3549,7 +3557,7 @@ var FormContainerNode = (props) => {
|
|
|
3549
3557
|
{
|
|
3550
3558
|
}
|
|
3551
3559
|
const SelectedNode = NodeTypes2[node2.type];
|
|
3552
|
-
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
3560
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_react48.default.Fragment, { children: SelectedNode && node2.type == "input-control" && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
3553
3561
|
InputControlNode_default,
|
|
3554
3562
|
{
|
|
3555
3563
|
value: formState.inputValues[node2.name],
|
|
@@ -3564,7 +3572,7 @@ var FormContainerNode = (props) => {
|
|
|
3564
3572
|
var FormContainerNode_default = FormContainerNode;
|
|
3565
3573
|
|
|
3566
3574
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
3567
|
-
var
|
|
3575
|
+
var import_react52 = __toESM(require("react"));
|
|
3568
3576
|
|
|
3569
3577
|
// src/components/utilities/AnimationUtility.tsx
|
|
3570
3578
|
var AnimationUtility = class {
|
|
@@ -3675,11 +3683,11 @@ var AnimationUtility = class {
|
|
|
3675
3683
|
var AnimationUtility_default = AnimationUtility;
|
|
3676
3684
|
|
|
3677
3685
|
// src/components/Pagination.tsx
|
|
3678
|
-
var
|
|
3686
|
+
var import_react49 = require("react");
|
|
3679
3687
|
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
3680
3688
|
var Pagination = (props) => {
|
|
3681
3689
|
const { dataset, path, query, showPageSizeSelector = false, showJumpToPage = false } = props;
|
|
3682
|
-
const builder = (0,
|
|
3690
|
+
const builder = (0, import_react49.useMemo)(() => {
|
|
3683
3691
|
const b = new OdataBuilder(path);
|
|
3684
3692
|
if (query) b.setQuery(query);
|
|
3685
3693
|
return b;
|
|
@@ -3894,11 +3902,11 @@ var PathUtility = class {
|
|
|
3894
3902
|
var PathUtility_default = new PathUtility();
|
|
3895
3903
|
|
|
3896
3904
|
// src/components/pageRenderingEngine/nodes/EnterAnimationClient.tsx
|
|
3897
|
-
var
|
|
3905
|
+
var import_react50 = __toESM(require("react"));
|
|
3898
3906
|
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
3899
3907
|
function EnterAnimationClient({ hasEnterAnimation, children }) {
|
|
3900
|
-
const ref = (0,
|
|
3901
|
-
(0,
|
|
3908
|
+
const ref = (0, import_react50.useRef)(null);
|
|
3909
|
+
(0, import_react50.useEffect)(() => {
|
|
3902
3910
|
if (!hasEnterAnimation || !ref.current) return;
|
|
3903
3911
|
const observer = new IntersectionObserver(
|
|
3904
3912
|
(entries) => {
|
|
@@ -3916,11 +3924,11 @@ function EnterAnimationClient({ hasEnterAnimation, children }) {
|
|
|
3916
3924
|
}, [hasEnterAnimation]);
|
|
3917
3925
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_jsx_runtime66.Fragment, { children: children && // enforce passing the ref to Wrapper
|
|
3918
3926
|
//@ts-ignore
|
|
3919
|
-
|
|
3927
|
+
import_react50.default.cloneElement(children, { ref }) });
|
|
3920
3928
|
}
|
|
3921
3929
|
|
|
3922
3930
|
// src/components/Slider.tsx
|
|
3923
|
-
var
|
|
3931
|
+
var import_react51 = __toESM(require("react"));
|
|
3924
3932
|
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
3925
3933
|
var Slider = ({
|
|
3926
3934
|
children,
|
|
@@ -3939,13 +3947,13 @@ var Slider = ({
|
|
|
3939
3947
|
pillStyle = "cumulative",
|
|
3940
3948
|
progressPosition = "bottom"
|
|
3941
3949
|
}) => {
|
|
3942
|
-
const [currentSlide, setCurrentSlide] = (0,
|
|
3943
|
-
const [transition, setTransition] = (0,
|
|
3944
|
-
const [slidesToShowState, setSlidesToShowState] = (0,
|
|
3950
|
+
const [currentSlide, setCurrentSlide] = (0, import_react51.useState)(0);
|
|
3951
|
+
const [transition, setTransition] = (0, import_react51.useState)(true);
|
|
3952
|
+
const [slidesToShowState, setSlidesToShowState] = (0, import_react51.useState)(
|
|
3945
3953
|
typeof slidesToShow === "number" ? slidesToShow : slidesToShow.large
|
|
3946
3954
|
);
|
|
3947
|
-
const [isPlaying, setIsPlaying] = (0,
|
|
3948
|
-
(0,
|
|
3955
|
+
const [isPlaying, setIsPlaying] = (0, import_react51.useState)(autoplay);
|
|
3956
|
+
(0, import_react51.useEffect)(() => {
|
|
3949
3957
|
if (typeof slidesToShow === "number") return;
|
|
3950
3958
|
const handleResize = () => {
|
|
3951
3959
|
if (window.innerWidth >= 1024) {
|
|
@@ -3960,7 +3968,7 @@ var Slider = ({
|
|
|
3960
3968
|
window.addEventListener("resize", handleResize);
|
|
3961
3969
|
return () => window.removeEventListener("resize", handleResize);
|
|
3962
3970
|
}, [slidesToShow]);
|
|
3963
|
-
(0,
|
|
3971
|
+
(0, import_react51.useEffect)(() => {
|
|
3964
3972
|
if (!autoplay) return;
|
|
3965
3973
|
const timer = setInterval(() => {
|
|
3966
3974
|
if (isPlaying) {
|
|
@@ -3969,7 +3977,7 @@ var Slider = ({
|
|
|
3969
3977
|
}, autoplay_speed);
|
|
3970
3978
|
return () => clearInterval(timer);
|
|
3971
3979
|
}, [autoplay, autoplay_speed, currentSlide, isPlaying]);
|
|
3972
|
-
const totalSlides =
|
|
3980
|
+
const totalSlides = import_react51.Children.count(children);
|
|
3973
3981
|
const maxSlide = totalSlides - slidesToShowState;
|
|
3974
3982
|
const nextSlide = () => {
|
|
3975
3983
|
if (currentSlide >= maxSlide) {
|
|
@@ -4014,8 +4022,8 @@ var Slider = ({
|
|
|
4014
4022
|
}
|
|
4015
4023
|
};
|
|
4016
4024
|
const translateX = -currentSlide * (100 / slidesToShowState);
|
|
4017
|
-
const slides =
|
|
4018
|
-
if (!
|
|
4025
|
+
const slides = import_react51.Children.map(children, (child, index) => {
|
|
4026
|
+
if (!import_react51.default.isValidElement(child)) return null;
|
|
4019
4027
|
const childProps = child.props;
|
|
4020
4028
|
const mergedClassName = `${childProps.className ?? ""} w-full`.trim();
|
|
4021
4029
|
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
@@ -4023,7 +4031,7 @@ var Slider = ({
|
|
|
4023
4031
|
{
|
|
4024
4032
|
className: `flex-none ${scaleOnHover ? "group hover:z-50" : ""} relative`,
|
|
4025
4033
|
style: { width: `calc(${100 / slidesToShowState}%)`, paddingRight: gap },
|
|
4026
|
-
children: (0,
|
|
4034
|
+
children: (0, import_react51.cloneElement)(child, {
|
|
4027
4035
|
className: mergedClassName
|
|
4028
4036
|
})
|
|
4029
4037
|
},
|
|
@@ -4136,13 +4144,13 @@ var ProgressPill = ({
|
|
|
4136
4144
|
currentSlide,
|
|
4137
4145
|
totalSlides
|
|
4138
4146
|
}) => {
|
|
4139
|
-
const [progress, setProgress] = (0,
|
|
4140
|
-
(0,
|
|
4147
|
+
const [progress, setProgress] = (0, import_react51.useState)(0);
|
|
4148
|
+
(0, import_react51.useEffect)(() => {
|
|
4141
4149
|
if (active) {
|
|
4142
4150
|
setProgress(0);
|
|
4143
4151
|
}
|
|
4144
4152
|
}, [active, index]);
|
|
4145
|
-
(0,
|
|
4153
|
+
(0, import_react51.useEffect)(() => {
|
|
4146
4154
|
if (!active || !isPlaying) {
|
|
4147
4155
|
if (!active) {
|
|
4148
4156
|
setProgress(0);
|
|
@@ -4434,7 +4442,7 @@ var DivContainer = async (props) => {
|
|
|
4434
4442
|
function renderNode(node, props2, dataitem, key, href) {
|
|
4435
4443
|
const SelectedNode = NodeTypes2[node.type];
|
|
4436
4444
|
if (!SelectedNode) return null;
|
|
4437
|
-
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
4445
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react52.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
4438
4446
|
SelectedNode,
|
|
4439
4447
|
{
|
|
4440
4448
|
node,
|
|
@@ -4531,9 +4539,9 @@ var DivContainer = async (props) => {
|
|
|
4531
4539
|
props.node.autoFormat && "auto-format",
|
|
4532
4540
|
props.node.bgClass
|
|
4533
4541
|
].filter(Boolean).join(" ");
|
|
4534
|
-
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
4542
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_react52.default.Fragment, { children: [
|
|
4535
4543
|
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("style", { dangerouslySetInnerHTML: { __html: cssResult.css + animationCSS } }),
|
|
4536
|
-
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(EnterAnimationClient, { hasEnterAnimation: !!props.node.enterAnimation, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
4544
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(EnterAnimationClient, { hasEnterAnimation: !!props.node.enterAnimation, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react52.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
4537
4545
|
Wrapper,
|
|
4538
4546
|
{
|
|
4539
4547
|
id: guid,
|
|
@@ -4542,7 +4550,7 @@ var DivContainer = async (props) => {
|
|
|
4542
4550
|
...wrapperProps,
|
|
4543
4551
|
children: dataToRender.map(
|
|
4544
4552
|
(item, idx) => item?.links?.view && renderLink ? renderChildren(props.node.children, props, item, idx, props.href ? void 0 : item?.links?.view)?.map(
|
|
4545
|
-
(child, i) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
4553
|
+
(child, i) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react52.default.Fragment, { children: child }, i)
|
|
4546
4554
|
) : renderChildren(props.node.children, props, item, idx)
|
|
4547
4555
|
)
|
|
4548
4556
|
}
|
|
@@ -4581,11 +4589,11 @@ var PageBodyRenderer = (props) => {
|
|
|
4581
4589
|
if (pageBodyTree && pageBodyTree.root) {
|
|
4582
4590
|
rootNode = pageBodyTree.root;
|
|
4583
4591
|
}
|
|
4584
|
-
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
4592
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react53.default.Fragment, { children: rootNode && rootNode?.children?.map((node, index) => {
|
|
4585
4593
|
{
|
|
4586
4594
|
}
|
|
4587
4595
|
const SelectedNode = NodeTypes[node.type];
|
|
4588
|
-
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
4596
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react53.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react53.default.Fragment, { children: node.type == "layout-container" ? /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react53.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
4589
4597
|
SelectedNode,
|
|
4590
4598
|
{
|
|
4591
4599
|
node,
|
|
@@ -4601,7 +4609,7 @@ var PageBodyRenderer = (props) => {
|
|
|
4601
4609
|
resolveAssetUrl: props.resolveAssetUrl,
|
|
4602
4610
|
dataMap: props.dataMap
|
|
4603
4611
|
}
|
|
4604
|
-
) }) : /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
4612
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react53.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
4605
4613
|
SelectedNode,
|
|
4606
4614
|
{
|
|
4607
4615
|
node,
|
package/dist/index.mjs
CHANGED
|
@@ -2509,7 +2509,7 @@ var DataList = (props) => {
|
|
|
2509
2509
|
var DataList_default = DataList;
|
|
2510
2510
|
|
|
2511
2511
|
// src/components/pageRenderingEngine/PageBodyRenderer.tsx
|
|
2512
|
-
import
|
|
2512
|
+
import React52 from "react";
|
|
2513
2513
|
|
|
2514
2514
|
// src/components/pageRenderingEngine/nodes/ParagraphNode.tsx
|
|
2515
2515
|
import React36 from "react";
|
|
@@ -3000,15 +3000,23 @@ var HorizontalRuleNode = (props) => {
|
|
|
3000
3000
|
var HorizontalRuleNode_default = HorizontalRuleNode;
|
|
3001
3001
|
|
|
3002
3002
|
// src/components/pageRenderingEngine/nodes/LayoutItemNode.tsx
|
|
3003
|
-
import
|
|
3003
|
+
import React46 from "react";
|
|
3004
3004
|
|
|
3005
3005
|
// src/components/pageRenderingEngine/nodes/ImageNode.tsx
|
|
3006
|
-
import
|
|
3007
|
-
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
3006
|
+
import { Fragment as Fragment6, jsx as jsx55 } from "react/jsx-runtime";
|
|
3008
3007
|
var ImageNode = (props) => {
|
|
3009
|
-
const { node, apiBaseUrl = "" } = props;
|
|
3010
|
-
let imageUrl
|
|
3011
|
-
|
|
3008
|
+
const { node, apiBaseUrl = "", resolveAssetUrl } = props;
|
|
3009
|
+
let imageUrl;
|
|
3010
|
+
if (!node.imageUrl) return null;
|
|
3011
|
+
if (node.imageUrl.startsWith("http")) {
|
|
3012
|
+
imageUrl = node.imageUrl;
|
|
3013
|
+
} else if (resolveAssetUrl) {
|
|
3014
|
+
imageUrl = resolveAssetUrl(node.imageUrl);
|
|
3015
|
+
} else {
|
|
3016
|
+
imageUrl = `${apiBaseUrl}/${node.imageUrl}`;
|
|
3017
|
+
}
|
|
3018
|
+
if (!imageUrl) return null;
|
|
3019
|
+
return /* @__PURE__ */ jsx55(Fragment6, { children: node.width ? /* @__PURE__ */ jsx55("div", { style: { width: node.width }, children: /* @__PURE__ */ jsx55(
|
|
3012
3020
|
"img",
|
|
3013
3021
|
{
|
|
3014
3022
|
loading: "lazy",
|
|
@@ -3034,7 +3042,7 @@ var ImageNode_default = ImageNode;
|
|
|
3034
3042
|
|
|
3035
3043
|
// src/components/pageRenderingEngine/nodes/WidgetNode.tsx
|
|
3036
3044
|
import { Suspense } from "react";
|
|
3037
|
-
import { Fragment as
|
|
3045
|
+
import { Fragment as Fragment7, jsx as jsx56, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
3038
3046
|
var WidgetNode = (props) => {
|
|
3039
3047
|
const getWidgetParameters = () => {
|
|
3040
3048
|
const widgetInputParameters = { ...props.routeParameters ?? {} };
|
|
@@ -3089,7 +3097,7 @@ var WidgetNode = (props) => {
|
|
|
3089
3097
|
const SelectedWidget = props.widgetRegistry?.[props.node.widgetCode];
|
|
3090
3098
|
if (!SelectedWidget) {
|
|
3091
3099
|
console.warn("Widget not found:", props.node.widgetCode);
|
|
3092
|
-
return /* @__PURE__ */ jsxs27(
|
|
3100
|
+
return /* @__PURE__ */ jsxs27(Fragment7, { children: [
|
|
3093
3101
|
"Widget not found: ",
|
|
3094
3102
|
props.node.widgetCode
|
|
3095
3103
|
] });
|
|
@@ -3109,13 +3117,13 @@ var WidgetNode = (props) => {
|
|
|
3109
3117
|
var WidgetNode_default = WidgetNode;
|
|
3110
3118
|
|
|
3111
3119
|
// src/components/pageRenderingEngine/nodes/IframeClient.tsx
|
|
3112
|
-
import
|
|
3120
|
+
import React44, { useEffect as useEffect8, useRef as useRef4, useState as useState9 } from "react";
|
|
3113
3121
|
|
|
3114
3122
|
// src/components/IFrameLoaderView.tsx
|
|
3115
|
-
import
|
|
3123
|
+
import React43 from "react";
|
|
3116
3124
|
import { jsx as jsx57, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
3117
3125
|
var IFrameLoaderView = (props) => {
|
|
3118
|
-
return /* @__PURE__ */ jsxs28(
|
|
3126
|
+
return /* @__PURE__ */ jsxs28(React43.Fragment, { children: [
|
|
3119
3127
|
props.isDataFound == null && /* @__PURE__ */ jsx57("div", { className: "", children: /* @__PURE__ */ jsxs28("div", { className: "mt-4 bg-gray-200 rounded-md p-4 animate-pulse", children: [
|
|
3120
3128
|
/* @__PURE__ */ jsxs28("div", { className: "flex items-center mb-4", children: [
|
|
3121
3129
|
/* @__PURE__ */ jsx57("div", { className: "bg-gray-300 h-8 w-8 rounded-full animate-pulse" }),
|
|
@@ -3186,7 +3194,7 @@ var IframeClient = ({ src }) => {
|
|
|
3186
3194
|
const handleIframeLoad = () => {
|
|
3187
3195
|
setIsDataFound(true);
|
|
3188
3196
|
};
|
|
3189
|
-
return /* @__PURE__ */ jsx58(
|
|
3197
|
+
return /* @__PURE__ */ jsx58(React44.Fragment, { children: /* @__PURE__ */ jsx58(IFrameLoaderView_default, { isDataFound, children: /* @__PURE__ */ jsx58(
|
|
3190
3198
|
"iframe",
|
|
3191
3199
|
{
|
|
3192
3200
|
ref: iframeRef,
|
|
@@ -3215,7 +3223,7 @@ var EmbedNode = (props) => {
|
|
|
3215
3223
|
var EmbedNode_default = EmbedNode;
|
|
3216
3224
|
|
|
3217
3225
|
// src/components/pageRenderingEngine/nodes/VideoNode.tsx
|
|
3218
|
-
import
|
|
3226
|
+
import React45 from "react";
|
|
3219
3227
|
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
3220
3228
|
var VideoNode = (props) => {
|
|
3221
3229
|
let src;
|
|
@@ -3224,7 +3232,7 @@ var VideoNode = (props) => {
|
|
|
3224
3232
|
} else if (props.node.provider == "bunny") {
|
|
3225
3233
|
src = `https://iframe.mediadelivery.net/embed/${props.node.videoId}?autoplay=false&loop=false&muted=false&preload=true&responsive=true`;
|
|
3226
3234
|
}
|
|
3227
|
-
return /* @__PURE__ */ jsx60(
|
|
3235
|
+
return /* @__PURE__ */ jsx60(React45.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 }) });
|
|
3228
3236
|
};
|
|
3229
3237
|
var VideoNode_default = VideoNode;
|
|
3230
3238
|
|
|
@@ -3290,11 +3298,11 @@ var LayoutItemNode = (props) => {
|
|
|
3290
3298
|
} else {
|
|
3291
3299
|
updatedLayout = removeParagraphsAtStartAndEnd(props.node);
|
|
3292
3300
|
}
|
|
3293
|
-
return /* @__PURE__ */ jsx61(
|
|
3301
|
+
return /* @__PURE__ */ jsx61(React46.Fragment, { children: /* @__PURE__ */ jsx61("div", { className: "layout-item " + cssClasses, style: { ...styles }, children: updatedLayout.children.map((node, index) => {
|
|
3294
3302
|
{
|
|
3295
3303
|
}
|
|
3296
3304
|
const SelectedNode = NodeTypes2[node.type];
|
|
3297
|
-
return /* @__PURE__ */ jsx61(
|
|
3305
|
+
return /* @__PURE__ */ jsx61(React46.Fragment, { children: SelectedNode && /* @__PURE__ */ jsx61(
|
|
3298
3306
|
SelectedNode,
|
|
3299
3307
|
{
|
|
3300
3308
|
node,
|
|
@@ -3324,7 +3332,7 @@ var AssetUtility = class {
|
|
|
3324
3332
|
var AssetUtility_default = AssetUtility;
|
|
3325
3333
|
|
|
3326
3334
|
// src/components/pageRenderingEngine/nodes/LayoutContainerNode.tsx
|
|
3327
|
-
import { Fragment as
|
|
3335
|
+
import { Fragment as Fragment8, jsx as jsx62, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
3328
3336
|
var LayoutContainerNode = (props) => {
|
|
3329
3337
|
const VERTICAL_ALIGNMENT_CLASSES = {
|
|
3330
3338
|
start: "items-start",
|
|
@@ -3408,7 +3416,7 @@ var LayoutContainerNode = (props) => {
|
|
|
3408
3416
|
},
|
|
3409
3417
|
index
|
|
3410
3418
|
));
|
|
3411
|
-
return /* @__PURE__ */ jsxs29(
|
|
3419
|
+
return /* @__PURE__ */ jsxs29(Fragment8, { children: [
|
|
3412
3420
|
sectionWidth === "mixed" && /* @__PURE__ */ jsx62("div", { className: cssClasses, style: styles, children: /* @__PURE__ */ jsx62("div", { className: "container", children: /* @__PURE__ */ jsx62(
|
|
3413
3421
|
"div",
|
|
3414
3422
|
{
|
|
@@ -3438,7 +3446,7 @@ var LayoutContainerNode = (props) => {
|
|
|
3438
3446
|
var LayoutContainerNode_default = LayoutContainerNode;
|
|
3439
3447
|
|
|
3440
3448
|
// src/components/pageRenderingEngine/nodes/FormContainerNode.tsx
|
|
3441
|
-
import
|
|
3449
|
+
import React47, { useRef as useRef5, useReducer as useReducer2, useCallback as useCallback3, useEffect as useEffect9 } from "react";
|
|
3442
3450
|
|
|
3443
3451
|
// src/components/pageRenderingEngine/nodes/InputControlNode.tsx
|
|
3444
3452
|
import { jsx as jsx63 } from "react/jsx-runtime";
|
|
@@ -3517,7 +3525,7 @@ var FormContainerNode = (props) => {
|
|
|
3517
3525
|
{
|
|
3518
3526
|
}
|
|
3519
3527
|
const SelectedNode = NodeTypes2[node2.type];
|
|
3520
|
-
return /* @__PURE__ */ jsx64(
|
|
3528
|
+
return /* @__PURE__ */ jsx64(React47.Fragment, { children: SelectedNode && node2.type == "input-control" && /* @__PURE__ */ jsx64(
|
|
3521
3529
|
InputControlNode_default,
|
|
3522
3530
|
{
|
|
3523
3531
|
value: formState.inputValues[node2.name],
|
|
@@ -3532,7 +3540,7 @@ var FormContainerNode = (props) => {
|
|
|
3532
3540
|
var FormContainerNode_default = FormContainerNode;
|
|
3533
3541
|
|
|
3534
3542
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
3535
|
-
import
|
|
3543
|
+
import React51 from "react";
|
|
3536
3544
|
|
|
3537
3545
|
// src/components/utilities/AnimationUtility.tsx
|
|
3538
3546
|
var AnimationUtility = class {
|
|
@@ -3862,8 +3870,8 @@ var PathUtility = class {
|
|
|
3862
3870
|
var PathUtility_default = new PathUtility();
|
|
3863
3871
|
|
|
3864
3872
|
// src/components/pageRenderingEngine/nodes/EnterAnimationClient.tsx
|
|
3865
|
-
import
|
|
3866
|
-
import { Fragment as
|
|
3873
|
+
import React49, { useEffect as useEffect10, useRef as useRef6 } from "react";
|
|
3874
|
+
import { Fragment as Fragment9, jsx as jsx66 } from "react/jsx-runtime";
|
|
3867
3875
|
function EnterAnimationClient({ hasEnterAnimation, children }) {
|
|
3868
3876
|
const ref = useRef6(null);
|
|
3869
3877
|
useEffect10(() => {
|
|
@@ -3882,14 +3890,14 @@ function EnterAnimationClient({ hasEnterAnimation, children }) {
|
|
|
3882
3890
|
observer.observe(ref.current);
|
|
3883
3891
|
return () => observer.disconnect();
|
|
3884
3892
|
}, [hasEnterAnimation]);
|
|
3885
|
-
return /* @__PURE__ */ jsx66(
|
|
3893
|
+
return /* @__PURE__ */ jsx66(Fragment9, { children: children && // enforce passing the ref to Wrapper
|
|
3886
3894
|
//@ts-ignore
|
|
3887
|
-
|
|
3895
|
+
React49.cloneElement(children, { ref }) });
|
|
3888
3896
|
}
|
|
3889
3897
|
|
|
3890
3898
|
// src/components/Slider.tsx
|
|
3891
|
-
import
|
|
3892
|
-
import { Fragment as
|
|
3899
|
+
import React50, { useState as useState11, useEffect as useEffect11, Children, cloneElement } from "react";
|
|
3900
|
+
import { Fragment as Fragment10, jsx as jsx67, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
3893
3901
|
var Slider = ({
|
|
3894
3902
|
children,
|
|
3895
3903
|
slidesToShow = 4,
|
|
@@ -3983,7 +3991,7 @@ var Slider = ({
|
|
|
3983
3991
|
};
|
|
3984
3992
|
const translateX = -currentSlide * (100 / slidesToShowState);
|
|
3985
3993
|
const slides = Children.map(children, (child, index) => {
|
|
3986
|
-
if (!
|
|
3994
|
+
if (!React50.isValidElement(child)) return null;
|
|
3987
3995
|
const childProps = child.props;
|
|
3988
3996
|
const mergedClassName = `${childProps.className ?? ""} w-full`.trim();
|
|
3989
3997
|
return /* @__PURE__ */ jsx67(
|
|
@@ -4027,7 +4035,7 @@ var Slider = ({
|
|
|
4027
4035
|
children: slides
|
|
4028
4036
|
}
|
|
4029
4037
|
),
|
|
4030
|
-
show_arrows && /* @__PURE__ */ jsxs32(
|
|
4038
|
+
show_arrows && /* @__PURE__ */ jsxs32(Fragment10, { children: [
|
|
4031
4039
|
/* @__PURE__ */ jsx67(
|
|
4032
4040
|
ArrowButton,
|
|
4033
4041
|
{
|
|
@@ -4402,7 +4410,7 @@ var DivContainer = async (props) => {
|
|
|
4402
4410
|
function renderNode(node, props2, dataitem, key, href) {
|
|
4403
4411
|
const SelectedNode = NodeTypes2[node.type];
|
|
4404
4412
|
if (!SelectedNode) return null;
|
|
4405
|
-
return /* @__PURE__ */ jsx69(
|
|
4413
|
+
return /* @__PURE__ */ jsx69(React51.Fragment, { children: /* @__PURE__ */ jsx69(
|
|
4406
4414
|
SelectedNode,
|
|
4407
4415
|
{
|
|
4408
4416
|
node,
|
|
@@ -4499,9 +4507,9 @@ var DivContainer = async (props) => {
|
|
|
4499
4507
|
props.node.autoFormat && "auto-format",
|
|
4500
4508
|
props.node.bgClass
|
|
4501
4509
|
].filter(Boolean).join(" ");
|
|
4502
|
-
return /* @__PURE__ */ jsxs34(
|
|
4510
|
+
return /* @__PURE__ */ jsxs34(React51.Fragment, { children: [
|
|
4503
4511
|
/* @__PURE__ */ jsx69("style", { dangerouslySetInnerHTML: { __html: cssResult.css + animationCSS } }),
|
|
4504
|
-
/* @__PURE__ */ jsx69(EnterAnimationClient, { hasEnterAnimation: !!props.node.enterAnimation, children: /* @__PURE__ */ jsx69(
|
|
4512
|
+
/* @__PURE__ */ jsx69(EnterAnimationClient, { hasEnterAnimation: !!props.node.enterAnimation, children: /* @__PURE__ */ jsx69(React51.Fragment, { children: /* @__PURE__ */ jsx69(
|
|
4505
4513
|
Wrapper,
|
|
4506
4514
|
{
|
|
4507
4515
|
id: guid,
|
|
@@ -4510,7 +4518,7 @@ var DivContainer = async (props) => {
|
|
|
4510
4518
|
...wrapperProps,
|
|
4511
4519
|
children: dataToRender.map(
|
|
4512
4520
|
(item, idx) => item?.links?.view && renderLink ? renderChildren(props.node.children, props, item, idx, props.href ? void 0 : item?.links?.view)?.map(
|
|
4513
|
-
(child, i) => /* @__PURE__ */ jsx69(
|
|
4521
|
+
(child, i) => /* @__PURE__ */ jsx69(React51.Fragment, { children: child }, i)
|
|
4514
4522
|
) : renderChildren(props.node.children, props, item, idx)
|
|
4515
4523
|
)
|
|
4516
4524
|
}
|
|
@@ -4549,11 +4557,11 @@ var PageBodyRenderer = (props) => {
|
|
|
4549
4557
|
if (pageBodyTree && pageBodyTree.root) {
|
|
4550
4558
|
rootNode = pageBodyTree.root;
|
|
4551
4559
|
}
|
|
4552
|
-
return /* @__PURE__ */ jsx70(
|
|
4560
|
+
return /* @__PURE__ */ jsx70(React52.Fragment, { children: rootNode && rootNode?.children?.map((node, index) => {
|
|
4553
4561
|
{
|
|
4554
4562
|
}
|
|
4555
4563
|
const SelectedNode = NodeTypes[node.type];
|
|
4556
|
-
return /* @__PURE__ */ jsx70(
|
|
4564
|
+
return /* @__PURE__ */ jsx70(React52.Fragment, { children: SelectedNode && /* @__PURE__ */ jsx70(React52.Fragment, { children: node.type == "layout-container" ? /* @__PURE__ */ jsx70(React52.Fragment, { children: /* @__PURE__ */ jsx70(
|
|
4557
4565
|
SelectedNode,
|
|
4558
4566
|
{
|
|
4559
4567
|
node,
|
|
@@ -4569,7 +4577,7 @@ var PageBodyRenderer = (props) => {
|
|
|
4569
4577
|
resolveAssetUrl: props.resolveAssetUrl,
|
|
4570
4578
|
dataMap: props.dataMap
|
|
4571
4579
|
}
|
|
4572
|
-
) }) : /* @__PURE__ */ jsx70(
|
|
4580
|
+
) }) : /* @__PURE__ */ jsx70(React52.Fragment, { children: /* @__PURE__ */ jsx70(
|
|
4573
4581
|
SelectedNode,
|
|
4574
4582
|
{
|
|
4575
4583
|
node,
|
package/package.json
CHANGED