@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260326083242 → 0.8.1-dev.20260326105727
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/LinkNodeButton-KBSXOEHS.mjs +169 -0
- package/dist/chunk-3IDT4246.mjs +400 -0
- package/dist/index.js +1527 -1217
- package/dist/index.mjs +864 -1178
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -30,65 +30,229 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
30
30
|
));
|
|
31
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
32
|
|
|
33
|
-
// src/components/
|
|
34
|
-
var
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
// src/components/ToastService.tsx
|
|
34
|
+
var ToastService, ToastService_default;
|
|
35
|
+
var init_ToastService = __esm({
|
|
36
|
+
"src/components/ToastService.tsx"() {
|
|
37
|
+
"use strict";
|
|
38
|
+
ToastService = class _ToastService {
|
|
39
|
+
static initialize(showToast, closeToast) {
|
|
40
|
+
_ToastService.showToast = showToast;
|
|
41
|
+
_ToastService.closeToast = closeToast;
|
|
42
|
+
}
|
|
43
|
+
static showError(message) {
|
|
44
|
+
if (_ToastService.showToast) {
|
|
45
|
+
_ToastService.showToast(message, "error");
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
static showInfo(message) {
|
|
49
|
+
if (_ToastService.showToast) {
|
|
50
|
+
_ToastService.showToast(message, "info");
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
static close() {
|
|
54
|
+
if (_ToastService.closeToast) {
|
|
55
|
+
_ToastService.closeToast();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
ToastService_default = ToastService;
|
|
60
|
+
}
|
|
37
61
|
});
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
62
|
+
|
|
63
|
+
// src/components/StyleTypes.tsx
|
|
64
|
+
var buttonClasses, progressClasses;
|
|
65
|
+
var init_StyleTypes = __esm({
|
|
66
|
+
"src/components/StyleTypes.tsx"() {
|
|
67
|
+
"use strict";
|
|
68
|
+
buttonClasses = /* @__PURE__ */ new Map([
|
|
69
|
+
["Primary" /* Solid */, "btn-solid"],
|
|
70
|
+
["PrimaryHollow" /* Hollow */, "btn-hollow"],
|
|
71
|
+
["Link" /* Link */, "btn-link"]
|
|
72
|
+
]);
|
|
73
|
+
progressClasses = /* @__PURE__ */ new Map([
|
|
74
|
+
["Primary" /* Solid */, ""],
|
|
75
|
+
["PrimaryHollow" /* Hollow */, ""],
|
|
76
|
+
["Link" /* Link */, ""]
|
|
77
|
+
]);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
// src/components/ClientButton.tsx
|
|
82
|
+
var import_react22, import_jsx_runtime23, ClientButton, ClientButton_default;
|
|
83
|
+
var init_ClientButton = __esm({
|
|
84
|
+
"src/components/ClientButton.tsx"() {
|
|
85
|
+
"use strict";
|
|
86
|
+
"use client";
|
|
87
|
+
import_react22 = __toESM(require("react"));
|
|
88
|
+
init_ToastService();
|
|
89
|
+
init_StyleTypes();
|
|
90
|
+
import_jsx_runtime23 = require("react/jsx-runtime");
|
|
91
|
+
ClientButton = (props) => {
|
|
92
|
+
const execute = async (event) => {
|
|
93
|
+
if (props.onClick !== void 0) {
|
|
94
|
+
props.onClick();
|
|
95
|
+
} else {
|
|
96
|
+
ToastService_default.showError("No action defined.");
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
let buttonClass = props.ButtonType ? buttonClasses.get(props.ButtonType) : buttonClasses.get("Primary" /* Solid */);
|
|
100
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react22.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
101
|
+
"button",
|
|
102
|
+
{
|
|
103
|
+
type: "button",
|
|
104
|
+
onClick: execute,
|
|
105
|
+
className: buttonClass + " " + props.className,
|
|
106
|
+
children: props.children
|
|
107
|
+
}
|
|
108
|
+
) });
|
|
44
109
|
};
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
110
|
+
ClientButton_default = ClientButton;
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
// src/components/Confirm.tsx
|
|
115
|
+
var import_react23, import_jsx_runtime24, Confirm, Confirm_default;
|
|
116
|
+
var init_Confirm = __esm({
|
|
117
|
+
"src/components/Confirm.tsx"() {
|
|
118
|
+
"use strict";
|
|
119
|
+
"use client";
|
|
120
|
+
import_react23 = require("react");
|
|
121
|
+
init_ClientButton();
|
|
122
|
+
init_StyleTypes();
|
|
123
|
+
import_jsx_runtime24 = require("react/jsx-runtime");
|
|
124
|
+
Confirm = ({ message, onConfirm, onCancel }) => {
|
|
125
|
+
const [showModal, setShowModal] = (0, import_react23.useState)(true);
|
|
126
|
+
const handleConfirmAction = () => {
|
|
127
|
+
setShowModal(false);
|
|
128
|
+
if (onConfirm) {
|
|
129
|
+
onConfirm();
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
const handleCancelAction = () => {
|
|
133
|
+
setShowModal(false);
|
|
134
|
+
if (onCancel) {
|
|
135
|
+
onCancel();
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_jsx_runtime24.Fragment, { children: showModal && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "fixed inset-0 flex items-center justify-center z-50", children: [
|
|
139
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "absolute inset-0 bg-black opacity-70" }),
|
|
140
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "bg-white rounded-md p-6 w-2/6 shadow border z-50", children: [
|
|
141
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-xl font-medium mb-4", children: "Confirmation" }),
|
|
142
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "mb-4", children: message }),
|
|
143
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex justify-end gap-8", children: [
|
|
144
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
145
|
+
ClientButton_default,
|
|
72
146
|
{
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
147
|
+
onClick: handleCancelAction,
|
|
148
|
+
ButtonType: "PrimaryHollow" /* Hollow */,
|
|
149
|
+
children: "Cancel"
|
|
150
|
+
}
|
|
151
|
+
),
|
|
152
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
153
|
+
ClientButton_default,
|
|
154
|
+
{
|
|
155
|
+
onClick: handleConfirmAction,
|
|
156
|
+
children: "Confirm"
|
|
76
157
|
}
|
|
77
158
|
)
|
|
78
|
-
}
|
|
79
|
-
)
|
|
80
|
-
|
|
81
|
-
|
|
159
|
+
] })
|
|
160
|
+
] })
|
|
161
|
+
] }) });
|
|
162
|
+
};
|
|
163
|
+
Confirm_default = Confirm;
|
|
164
|
+
{
|
|
82
165
|
}
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
// src/components/Button.tsx
|
|
170
|
+
var import_react24, import_jsx_runtime25, Button, Button_default;
|
|
171
|
+
var init_Button = __esm({
|
|
172
|
+
"src/components/Button.tsx"() {
|
|
88
173
|
"use strict";
|
|
89
174
|
"use client";
|
|
90
|
-
|
|
91
|
-
|
|
175
|
+
import_react24 = __toESM(require("react"));
|
|
176
|
+
init_ToastService();
|
|
177
|
+
init_StyleTypes();
|
|
178
|
+
init_Confirm();
|
|
179
|
+
import_jsx_runtime25 = require("react/jsx-runtime");
|
|
180
|
+
Button = (props) => {
|
|
181
|
+
const [inProgress, setInProgress] = (0, import_react24.useState)(false);
|
|
182
|
+
const [isActionPerformed, setIsActionPerformed] = (0, import_react24.useState)(false);
|
|
183
|
+
const [responseMessage, setResponseMessage] = (0, import_react24.useState)(null);
|
|
184
|
+
const [showModal, setShowModal] = (0, import_react24.useState)(null);
|
|
185
|
+
const execute = async (event) => {
|
|
186
|
+
event.preventDefault();
|
|
187
|
+
event.stopPropagation();
|
|
188
|
+
if (props.confirm) {
|
|
189
|
+
const confirmed = await showConfirmation("Are you sure you want to delete this item?");
|
|
190
|
+
setShowModal(null);
|
|
191
|
+
if (!confirmed) {
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
if (props.oneTimeAction && isActionPerformed) {
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
setInProgress(true);
|
|
199
|
+
let isValid = true;
|
|
200
|
+
if (props.onValidate !== void 0) {
|
|
201
|
+
isValid = await props.onValidate();
|
|
202
|
+
if (!isValid) {
|
|
203
|
+
setInProgress(false);
|
|
204
|
+
ToastService_default.showError("There are errors in the form. Please fix them before proceeding.");
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
if (props.onClick !== void 0) {
|
|
209
|
+
let response = await props.onClick();
|
|
210
|
+
if (response.isSuccessful) {
|
|
211
|
+
setIsActionPerformed(true);
|
|
212
|
+
setResponseMessage(response.message);
|
|
213
|
+
if (props.showToast) {
|
|
214
|
+
ToastService_default.showInfo(response.message || "");
|
|
215
|
+
}
|
|
216
|
+
} else {
|
|
217
|
+
ToastService_default.showError(response.message || "");
|
|
218
|
+
}
|
|
219
|
+
} else {
|
|
220
|
+
ToastService_default.showError("No action defined.");
|
|
221
|
+
}
|
|
222
|
+
setInProgress(false);
|
|
223
|
+
};
|
|
224
|
+
const showConfirmation = (message) => {
|
|
225
|
+
return new Promise((resolve) => {
|
|
226
|
+
const onConfirm = () => resolve(true);
|
|
227
|
+
const onCancel = () => resolve(false);
|
|
228
|
+
setShowModal(/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Confirm_default, { message: props.confirmationMessage, onConfirm, onCancel }));
|
|
229
|
+
});
|
|
230
|
+
};
|
|
231
|
+
let buttonClass = props.ButtonType ? buttonClasses.get(props.ButtonType) : buttonClasses.get("Primary" /* Solid */);
|
|
232
|
+
let progressClass = props.ButtonType ? progressClasses.get(props.ButtonType) : progressClasses.get("Primary" /* Solid */);
|
|
233
|
+
const isDisabled = inProgress || isActionPerformed && props.oneTimeAction;
|
|
234
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_react24.default.Fragment, { children: [
|
|
235
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
236
|
+
"button",
|
|
237
|
+
{
|
|
238
|
+
type: "submit",
|
|
239
|
+
onClick: execute,
|
|
240
|
+
disabled: props.disabled,
|
|
241
|
+
title: isDisabled ? "The button is disabled to prevent any action" : "",
|
|
242
|
+
className: buttonClass + " relative " + props.className,
|
|
243
|
+
children: [
|
|
244
|
+
isActionPerformed && props.oneTimeAction && responseMessage ? responseMessage : props.children,
|
|
245
|
+
inProgress && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react24.default.Fragment, { children: props.hideProgressIndicator === true ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "absolute bottom-0 left-0 h-0.5 bg-gray-400 rounded animate-progress" }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("svg", { className: "animate-spin ml-2 mr-3 h-5 w-5 " + progressClass, xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [
|
|
246
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
|
|
247
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })
|
|
248
|
+
] }) })
|
|
249
|
+
]
|
|
250
|
+
}
|
|
251
|
+
),
|
|
252
|
+
showModal
|
|
253
|
+
] });
|
|
254
|
+
};
|
|
255
|
+
Button_default = Button;
|
|
92
256
|
}
|
|
93
257
|
});
|
|
94
258
|
|
|
@@ -97,15 +261,15 @@ var HlsPlayer_exports = {};
|
|
|
97
261
|
__export(HlsPlayer_exports, {
|
|
98
262
|
default: () => HlsPlayer_default
|
|
99
263
|
});
|
|
100
|
-
var
|
|
264
|
+
var import_react33, import_hls, import_jsx_runtime42, HlsPlayer, HlsPlayer_default;
|
|
101
265
|
var init_HlsPlayer = __esm({
|
|
102
266
|
"src/components/HlsPlayer.tsx"() {
|
|
103
267
|
"use strict";
|
|
104
268
|
"use client";
|
|
105
|
-
|
|
269
|
+
import_react33 = __toESM(require("react"));
|
|
106
270
|
import_hls = __toESM(require("hls.js"));
|
|
107
|
-
|
|
108
|
-
HlsPlayer =
|
|
271
|
+
import_jsx_runtime42 = require("react/jsx-runtime");
|
|
272
|
+
HlsPlayer = import_react33.default.memo(
|
|
109
273
|
({
|
|
110
274
|
assetUrl,
|
|
111
275
|
posterUrl,
|
|
@@ -115,13 +279,13 @@ var init_HlsPlayer = __esm({
|
|
|
115
279
|
loop = false,
|
|
116
280
|
playOptions = "autoplay"
|
|
117
281
|
}) => {
|
|
118
|
-
const videoRef = (0,
|
|
119
|
-
const hlsRef = (0,
|
|
120
|
-
const [isPlaying, setIsPlaying] = (0,
|
|
121
|
-
const [isHovered, setIsHovered] = (0,
|
|
122
|
-
const [isMobile, setIsMobile] = (0,
|
|
123
|
-
const wasManuallyPausedRef = (0,
|
|
124
|
-
(0,
|
|
282
|
+
const videoRef = (0, import_react33.useRef)(null);
|
|
283
|
+
const hlsRef = (0, import_react33.useRef)(null);
|
|
284
|
+
const [isPlaying, setIsPlaying] = (0, import_react33.useState)(playOptions === "autoplay");
|
|
285
|
+
const [isHovered, setIsHovered] = (0, import_react33.useState)(false);
|
|
286
|
+
const [isMobile, setIsMobile] = (0, import_react33.useState)(false);
|
|
287
|
+
const wasManuallyPausedRef = (0, import_react33.useRef)(false);
|
|
288
|
+
(0, import_react33.useEffect)(() => {
|
|
125
289
|
const checkMobile = () => {
|
|
126
290
|
const hasTouch = "ontouchstart" in window || navigator.maxTouchPoints > 0;
|
|
127
291
|
const isSmallScreen = window.innerWidth <= 768;
|
|
@@ -133,7 +297,7 @@ var init_HlsPlayer = __esm({
|
|
|
133
297
|
window.addEventListener("resize", checkMobile);
|
|
134
298
|
return () => window.removeEventListener("resize", checkMobile);
|
|
135
299
|
}, []);
|
|
136
|
-
(0,
|
|
300
|
+
(0, import_react33.useEffect)(() => {
|
|
137
301
|
const v = videoRef.current;
|
|
138
302
|
if (!v || !assetUrl) return;
|
|
139
303
|
if (hlsRef.current) {
|
|
@@ -154,7 +318,7 @@ var init_HlsPlayer = __esm({
|
|
|
154
318
|
v.src = assetUrl;
|
|
155
319
|
}
|
|
156
320
|
}, [assetUrl, isPlaying]);
|
|
157
|
-
const handlePlayPause = (0,
|
|
321
|
+
const handlePlayPause = (0, import_react33.useCallback)(() => {
|
|
158
322
|
const v = videoRef.current;
|
|
159
323
|
if (!v) return;
|
|
160
324
|
if (v.paused) {
|
|
@@ -166,14 +330,14 @@ var init_HlsPlayer = __esm({
|
|
|
166
330
|
setIsPlaying(false);
|
|
167
331
|
}
|
|
168
332
|
}, []);
|
|
169
|
-
const handleMouseEnter = (0,
|
|
333
|
+
const handleMouseEnter = (0, import_react33.useCallback)(() => {
|
|
170
334
|
if (isMobile) return;
|
|
171
335
|
setIsHovered(true);
|
|
172
336
|
if (playOptions === "playOnHover" && videoRef.current && !wasManuallyPausedRef.current) {
|
|
173
337
|
videoRef.current.play().then(() => setIsPlaying(true));
|
|
174
338
|
}
|
|
175
339
|
}, [playOptions, isMobile]);
|
|
176
|
-
const handleMouseLeave = (0,
|
|
340
|
+
const handleMouseLeave = (0, import_react33.useCallback)(() => {
|
|
177
341
|
if (isMobile) return;
|
|
178
342
|
setIsHovered(false);
|
|
179
343
|
if (playOptions === "playOnHover" && videoRef.current) {
|
|
@@ -182,14 +346,14 @@ var init_HlsPlayer = __esm({
|
|
|
182
346
|
setIsPlaying(false);
|
|
183
347
|
}
|
|
184
348
|
}, [playOptions, isMobile]);
|
|
185
|
-
return /* @__PURE__ */ (0,
|
|
349
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
186
350
|
"div",
|
|
187
351
|
{
|
|
188
352
|
className: "relative w-full aspect-video bg-black",
|
|
189
353
|
onMouseEnter: handleMouseEnter,
|
|
190
354
|
onMouseLeave: handleMouseLeave,
|
|
191
355
|
children: [
|
|
192
|
-
/* @__PURE__ */ (0,
|
|
356
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
193
357
|
"video",
|
|
194
358
|
{
|
|
195
359
|
ref: videoRef,
|
|
@@ -203,7 +367,7 @@ var init_HlsPlayer = __esm({
|
|
|
203
367
|
onClick: !isMobile && !isPlaying ? handlePlayPause : void 0
|
|
204
368
|
}
|
|
205
369
|
),
|
|
206
|
-
!isMobile && playOptions === "playOnHover" && posterUrl && /* @__PURE__ */ (0,
|
|
370
|
+
!isMobile && playOptions === "playOnHover" && posterUrl && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
207
371
|
"img",
|
|
208
372
|
{
|
|
209
373
|
src: posterUrl,
|
|
@@ -213,7 +377,7 @@ var init_HlsPlayer = __esm({
|
|
|
213
377
|
className: `absolute inset-0 object-cover transition-opacity ${isHovered ? "opacity-0" : "opacity-100"}`
|
|
214
378
|
}
|
|
215
379
|
),
|
|
216
|
-
!isMobile && !isPlaying && /* @__PURE__ */ (0,
|
|
380
|
+
!isMobile && !isPlaying && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
217
381
|
"div",
|
|
218
382
|
{
|
|
219
383
|
className: "absolute inset-0 flex items-center justify-center cursor-pointer",
|
|
@@ -231,129 +395,583 @@ var init_HlsPlayer = __esm({
|
|
|
231
395
|
}
|
|
232
396
|
});
|
|
233
397
|
|
|
234
|
-
// src/
|
|
235
|
-
var
|
|
236
|
-
var
|
|
237
|
-
"src/
|
|
398
|
+
// src/clients/CacheManage.tsx
|
|
399
|
+
var import_node_cache, CacheManager;
|
|
400
|
+
var init_CacheManage = __esm({
|
|
401
|
+
"src/clients/CacheManage.tsx"() {
|
|
238
402
|
"use strict";
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
] }),
|
|
266
|
-
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "animate-pulse", children: [
|
|
267
|
-
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
268
|
-
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
269
|
-
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
270
|
-
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
271
|
-
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
272
|
-
] })
|
|
273
|
-
] })
|
|
274
|
-
] }) }),
|
|
275
|
-
props.children
|
|
276
|
-
] });
|
|
403
|
+
import_node_cache = __toESM(require("node-cache"));
|
|
404
|
+
CacheManager = class _CacheManager {
|
|
405
|
+
constructor() {
|
|
406
|
+
this.maxCacheSize = 1e3;
|
|
407
|
+
this.cache = new import_node_cache.default({ stdTTL: 0, checkperiod: 300 });
|
|
408
|
+
}
|
|
409
|
+
static getInstance() {
|
|
410
|
+
if (!_CacheManager.instance) {
|
|
411
|
+
_CacheManager.instance = new _CacheManager();
|
|
412
|
+
}
|
|
413
|
+
return _CacheManager.instance;
|
|
414
|
+
}
|
|
415
|
+
get(key) {
|
|
416
|
+
return null;
|
|
417
|
+
}
|
|
418
|
+
set(key, data, ttl) {
|
|
419
|
+
}
|
|
420
|
+
clear() {
|
|
421
|
+
this.cache.flushAll();
|
|
422
|
+
}
|
|
423
|
+
size() {
|
|
424
|
+
return this.cache.keys().length;
|
|
425
|
+
}
|
|
426
|
+
destroy() {
|
|
427
|
+
this.cache.close();
|
|
428
|
+
}
|
|
277
429
|
};
|
|
278
|
-
IFrameLoaderView_default = IFrameLoaderView;
|
|
279
430
|
}
|
|
280
431
|
});
|
|
281
432
|
|
|
282
|
-
// src/
|
|
283
|
-
var
|
|
284
|
-
|
|
285
|
-
|
|
433
|
+
// src/clients/ServiceClient.tsx
|
|
434
|
+
var ServerApiError, ServiceClient, ServiceClient_default;
|
|
435
|
+
var init_ServiceClient = __esm({
|
|
436
|
+
"src/clients/ServiceClient.tsx"() {
|
|
437
|
+
"use strict";
|
|
438
|
+
init_CacheManage();
|
|
439
|
+
ServerApiError = class extends Error {
|
|
440
|
+
constructor(data, status) {
|
|
441
|
+
super(data.message || "---");
|
|
442
|
+
this.status = status;
|
|
443
|
+
this.data = data;
|
|
444
|
+
this.data.isSuccessful = false;
|
|
445
|
+
}
|
|
446
|
+
};
|
|
447
|
+
ServiceClient = class {
|
|
448
|
+
constructor(apiBaseUrl, session) {
|
|
449
|
+
this.cacheManager = CacheManager.getInstance();
|
|
450
|
+
this.baseUrl = apiBaseUrl;
|
|
451
|
+
this.session = session;
|
|
452
|
+
}
|
|
453
|
+
buildFullPath(path, params) {
|
|
454
|
+
let updatedPath = path;
|
|
455
|
+
if (params) {
|
|
456
|
+
Object.keys(params).forEach((key) => {
|
|
457
|
+
updatedPath = updatedPath.replace(
|
|
458
|
+
`{${key}}`,
|
|
459
|
+
String(params[key])
|
|
460
|
+
);
|
|
461
|
+
});
|
|
462
|
+
}
|
|
463
|
+
return this.baseUrl + updatedPath;
|
|
464
|
+
}
|
|
465
|
+
getConfig() {
|
|
466
|
+
const config = { headers: {} };
|
|
467
|
+
if (this.session) {
|
|
468
|
+
if (this.session.oAuthToken) {
|
|
469
|
+
config.headers["Authorization"] = "Bearer " + this.session.oAuthToken;
|
|
470
|
+
}
|
|
471
|
+
config.headers["cid"] = this.session.cid || "";
|
|
472
|
+
config.headers["UserCurrencyCode"] = this.session.userCurrencyCode || "INR";
|
|
473
|
+
config.headers["MarketCode"] = this.session?.marketCode || "IND";
|
|
474
|
+
}
|
|
475
|
+
return config;
|
|
476
|
+
}
|
|
477
|
+
handleFetchError(error) {
|
|
478
|
+
console.log(error);
|
|
479
|
+
const serverApiError = error;
|
|
480
|
+
if (serverApiError) {
|
|
481
|
+
return serverApiError.data;
|
|
482
|
+
}
|
|
483
|
+
return {
|
|
484
|
+
message: "There is some error. Please try after sometime.",
|
|
485
|
+
isSuccessful: false
|
|
486
|
+
};
|
|
487
|
+
}
|
|
488
|
+
async fetchJsonWithCache(fullPath, config) {
|
|
489
|
+
const cacheKey = fullPath + "--" + (this.session?.marketCode || "IND");
|
|
490
|
+
const cachedData = this.cacheManager.get(cacheKey);
|
|
491
|
+
if (cachedData) {
|
|
492
|
+
return cachedData;
|
|
493
|
+
}
|
|
494
|
+
console.log("*****************CALLING API:", cacheKey, (/* @__PURE__ */ new Date()).toISOString());
|
|
495
|
+
const response = await fetch(fullPath, { headers: config.headers });
|
|
496
|
+
if (!response.ok) {
|
|
497
|
+
const apiErrorData = await response.json();
|
|
498
|
+
throw new ServerApiError(apiErrorData, response.status);
|
|
499
|
+
}
|
|
500
|
+
const cacheControl = response.headers.get("Cache-Control");
|
|
501
|
+
let revalidate = null;
|
|
502
|
+
if (cacheControl) {
|
|
503
|
+
const maxAgeMatch = cacheControl.match(/max-age=(\d+)/);
|
|
504
|
+
if (maxAgeMatch && maxAgeMatch[1]) {
|
|
505
|
+
const maxAge = parseInt(maxAgeMatch[1], 10);
|
|
506
|
+
revalidate = maxAge * 1e3;
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
const data = await response.json();
|
|
510
|
+
data.isSuccessful = true;
|
|
511
|
+
if (revalidate !== null && revalidate > 0) {
|
|
512
|
+
console.log("revalidate............I am caching:" + revalidate);
|
|
513
|
+
this.cacheManager.set(cacheKey, data, revalidate);
|
|
514
|
+
}
|
|
515
|
+
return data;
|
|
516
|
+
}
|
|
517
|
+
// private async refreshToken(): Promise<void> {
|
|
518
|
+
// console.log("*******************calling refresh token***********************");
|
|
519
|
+
// try {
|
|
520
|
+
// const response = await fetch(this.baseUrl + "/auth/storefront/login/refreshToken", {
|
|
521
|
+
// method: 'POST',
|
|
522
|
+
// headers: {
|
|
523
|
+
// 'Content-Type': 'application/json'
|
|
524
|
+
// },
|
|
525
|
+
// body: JSON.stringify({ refreshToken: this.session.refreshToken })
|
|
526
|
+
// });
|
|
527
|
+
// if (!response.ok) {
|
|
528
|
+
// throw new Error("Failed to refresh token");
|
|
529
|
+
// }
|
|
530
|
+
// const responseData = await response.json();
|
|
531
|
+
// this.session.oAuthToken = responseData.result.accessToken;
|
|
532
|
+
// if (typeof window === "undefined") {
|
|
533
|
+
// // Running on the server
|
|
534
|
+
// } else {
|
|
535
|
+
// await fetch("/api/login", {
|
|
536
|
+
// method: "post",
|
|
537
|
+
// headers: {
|
|
538
|
+
// "Content-Type": "application/json",
|
|
539
|
+
// },
|
|
540
|
+
// body: JSON.stringify({ session: this.session }),
|
|
541
|
+
// });
|
|
542
|
+
// }
|
|
543
|
+
// } catch (error: any) {
|
|
544
|
+
// throw new Error("Failed to refresh token");
|
|
545
|
+
// }
|
|
546
|
+
// }
|
|
547
|
+
async handleRequest(request) {
|
|
548
|
+
try {
|
|
549
|
+
return await request();
|
|
550
|
+
} catch (error) {
|
|
551
|
+
throw error;
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
async post(path, data) {
|
|
555
|
+
const request = async () => {
|
|
556
|
+
const fullPath = this.baseUrl + path;
|
|
557
|
+
const config = this.getConfig();
|
|
558
|
+
const response = await fetch(fullPath, {
|
|
559
|
+
method: "POST",
|
|
560
|
+
headers: {
|
|
561
|
+
...config.headers,
|
|
562
|
+
"Content-Type": "application/json"
|
|
563
|
+
},
|
|
564
|
+
body: JSON.stringify(data)
|
|
565
|
+
});
|
|
566
|
+
if (!response.ok) {
|
|
567
|
+
const apiErrorData = await response.json();
|
|
568
|
+
throw new ServerApiError(apiErrorData, response.status);
|
|
569
|
+
}
|
|
570
|
+
const responseData = await response.json();
|
|
571
|
+
responseData.isSuccessful = true;
|
|
572
|
+
return responseData;
|
|
573
|
+
};
|
|
574
|
+
try {
|
|
575
|
+
return await this.handleRequest(request);
|
|
576
|
+
} catch (error) {
|
|
577
|
+
return this.handleFetchError(error);
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
async getSingle(path, params) {
|
|
581
|
+
const request = async () => {
|
|
582
|
+
const sanitizedParams = params ? Object.fromEntries(
|
|
583
|
+
Object.entries(params).map(([k, v]) => [k, String(v)])
|
|
584
|
+
) : void 0;
|
|
585
|
+
const fullPath = this.buildFullPath(path, sanitizedParams);
|
|
586
|
+
const config = this.getConfig();
|
|
587
|
+
return await this.fetchJsonWithCache(fullPath, config);
|
|
588
|
+
};
|
|
589
|
+
try {
|
|
590
|
+
return await this.handleRequest(request);
|
|
591
|
+
} catch (error) {
|
|
592
|
+
return this.handleFetchError(error);
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
async get(path, params) {
|
|
596
|
+
const request = async () => {
|
|
597
|
+
const sanitizedParams = params ? Object.fromEntries(
|
|
598
|
+
Object.entries(params).map(([k, v]) => [k, String(v)])
|
|
599
|
+
) : void 0;
|
|
600
|
+
const fullPath = this.buildFullPath(path, sanitizedParams);
|
|
601
|
+
const config = this.getConfig();
|
|
602
|
+
console.log(fullPath);
|
|
603
|
+
return await this.fetchJsonWithCache(fullPath, config);
|
|
604
|
+
};
|
|
605
|
+
try {
|
|
606
|
+
return await this.handleRequest(request);
|
|
607
|
+
} catch (error) {
|
|
608
|
+
return this.handleFetchError(error);
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
};
|
|
612
|
+
ServiceClient_default = ServiceClient;
|
|
613
|
+
}
|
|
286
614
|
});
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
615
|
+
|
|
616
|
+
// src/components/pageRenderingEngine/nodes/LinkNodeButton.tsx
|
|
617
|
+
var LinkNodeButton_exports = {};
|
|
618
|
+
__export(LinkNodeButton_exports, {
|
|
619
|
+
default: () => LinkNodeButton_default
|
|
620
|
+
});
|
|
621
|
+
var import_react35, import_jsx_runtime45, LinkNodeButton, LinkNodeButton_default;
|
|
622
|
+
var init_LinkNodeButton = __esm({
|
|
623
|
+
"src/components/pageRenderingEngine/nodes/LinkNodeButton.tsx"() {
|
|
290
624
|
"use strict";
|
|
291
625
|
"use client";
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
const
|
|
298
|
-
const [
|
|
299
|
-
(0,
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
626
|
+
import_react35 = require("react");
|
|
627
|
+
init_Button();
|
|
628
|
+
init_ServiceClient();
|
|
629
|
+
import_jsx_runtime45 = require("react/jsx-runtime");
|
|
630
|
+
LinkNodeButton = (props) => {
|
|
631
|
+
const { node, dataitem, children, linkText, linkType, linkUrl } = props;
|
|
632
|
+
const [isLoading, setIsLoading] = (0, import_react35.useState)(false);
|
|
633
|
+
const [error, setError] = (0, import_react35.useState)(null);
|
|
634
|
+
const extractFieldNames = (0, import_react35.useCallback)((template) => {
|
|
635
|
+
if (!template) return [];
|
|
636
|
+
const regex = /\{(\{\})?([a-zA-Z_$][a-zA-Z0-9_$]*)(?:\}\})?\}/g;
|
|
637
|
+
const matches = Array.from(template.matchAll(regex));
|
|
638
|
+
const fieldNames = matches.map((match) => match[2] || match[1]).filter((name, index, self) => self.indexOf(name) === index);
|
|
639
|
+
return fieldNames;
|
|
640
|
+
}, []);
|
|
641
|
+
const replaceTemplateVariables = (0, import_react35.useCallback)((template, responseData) => {
|
|
642
|
+
if (!template) return template;
|
|
643
|
+
let result = template;
|
|
644
|
+
const fieldNames = extractFieldNames(template);
|
|
645
|
+
if (responseData) {
|
|
646
|
+
fieldNames.forEach((fieldName) => {
|
|
647
|
+
const value = getNestedValue3(responseData, fieldName);
|
|
648
|
+
if (value !== void 0) {
|
|
649
|
+
const regex1 = new RegExp(`\\{${fieldName}\\}`, "g");
|
|
650
|
+
const regex2 = new RegExp(`\\{\\{${fieldName}\\}\\}`, "g");
|
|
651
|
+
result = result.replace(regex1, String(value));
|
|
652
|
+
result = result.replace(regex2, String(value));
|
|
307
653
|
}
|
|
308
|
-
|
|
654
|
+
});
|
|
655
|
+
}
|
|
656
|
+
if (props.routeParameters) {
|
|
657
|
+
Object.entries(props.routeParameters).forEach(([key, value]) => {
|
|
658
|
+
const regex = new RegExp(`\\{\\{${key}\\}\\}`, "g");
|
|
659
|
+
result = result.replace(regex, String(value));
|
|
660
|
+
});
|
|
661
|
+
}
|
|
662
|
+
if (dataitem) {
|
|
663
|
+
Object.entries(dataitem).forEach(([key, value]) => {
|
|
664
|
+
const regex = new RegExp(`\\{\\{${key}\\}\\}`, "g");
|
|
665
|
+
result = result.replace(regex, String(value));
|
|
666
|
+
});
|
|
667
|
+
}
|
|
668
|
+
return result;
|
|
669
|
+
}, [props.routeParameters, dataitem, extractFieldNames]);
|
|
670
|
+
const getNestedValue3 = (0, import_react35.useCallback)((obj, path) => {
|
|
671
|
+
if (!obj || !path) return void 0;
|
|
672
|
+
if (obj[path] !== void 0) {
|
|
673
|
+
return obj[path];
|
|
674
|
+
}
|
|
675
|
+
const keys = path.split(".");
|
|
676
|
+
let current = obj;
|
|
677
|
+
for (const key of keys) {
|
|
678
|
+
if (current[key] === void 0) {
|
|
679
|
+
return void 0;
|
|
309
680
|
}
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
return
|
|
681
|
+
current = current[key];
|
|
682
|
+
}
|
|
683
|
+
return current;
|
|
313
684
|
}, []);
|
|
314
|
-
(0,
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
685
|
+
const onClick = (0, import_react35.useCallback)(async (e) => {
|
|
686
|
+
if (!node.postUrl) {
|
|
687
|
+
setError("No POST URL configured for this button");
|
|
688
|
+
return;
|
|
689
|
+
}
|
|
690
|
+
setIsLoading(true);
|
|
691
|
+
setError(null);
|
|
692
|
+
try {
|
|
693
|
+
const resolvedPostUrl = replaceTemplateVariables(node.postUrl);
|
|
694
|
+
let parsedPayload = {};
|
|
695
|
+
if (node.payload) {
|
|
696
|
+
try {
|
|
697
|
+
const payloadStr = replaceTemplateVariables(node.payload);
|
|
698
|
+
parsedPayload = JSON.parse(payloadStr);
|
|
699
|
+
console.log("Parsed payload:", parsedPayload);
|
|
700
|
+
} catch (err) {
|
|
701
|
+
console.error("Failed to parse payload JSON:", err);
|
|
702
|
+
parsedPayload = { error: "Invalid payload JSON" };
|
|
703
|
+
}
|
|
318
704
|
}
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
705
|
+
const serviceClient = new ServiceClient_default(props.apiBaseUrl, props.session);
|
|
706
|
+
const response = await serviceClient.post(resolvedPostUrl, parsedPayload);
|
|
707
|
+
console.log("API Response:", response);
|
|
708
|
+
if (response && !response.isSuccessful) {
|
|
709
|
+
const errorMessage = response.message || "API request failed";
|
|
710
|
+
setError(errorMessage);
|
|
711
|
+
setIsLoading(false);
|
|
712
|
+
return { isSuccessful: false, message: errorMessage };
|
|
713
|
+
}
|
|
714
|
+
if (response && node.redirectUrl) {
|
|
715
|
+
const fieldNames = extractFieldNames(node.redirectUrl);
|
|
716
|
+
console.log("Field names in redirect URL:", fieldNames);
|
|
717
|
+
const fieldValueMap = {};
|
|
718
|
+
fieldNames.forEach((fieldName) => {
|
|
719
|
+
const value = getNestedValue3(response, fieldName);
|
|
720
|
+
if (value !== void 0) {
|
|
721
|
+
fieldValueMap[fieldName] = String(value);
|
|
722
|
+
} else {
|
|
723
|
+
const resultValue = getNestedValue3(response, `result.${fieldName}`);
|
|
724
|
+
if (resultValue !== void 0) {
|
|
725
|
+
fieldValueMap[fieldName] = String(resultValue);
|
|
726
|
+
} else {
|
|
727
|
+
const dataValue = getNestedValue3(response, `data.${fieldName}`);
|
|
728
|
+
if (dataValue !== void 0) {
|
|
729
|
+
fieldValueMap[fieldName] = String(dataValue);
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
});
|
|
734
|
+
console.log("Field value map:", fieldValueMap);
|
|
735
|
+
const missingFields = fieldNames.filter((fieldName) => !fieldValueMap[fieldName]);
|
|
736
|
+
if (missingFields.length > 0) {
|
|
737
|
+
console.warn(`Missing field values for: ${missingFields.join(", ")}`);
|
|
738
|
+
}
|
|
739
|
+
let resolvedRedirectUrl = node.redirectUrl;
|
|
740
|
+
Object.entries(fieldValueMap).forEach(([fieldName, value]) => {
|
|
741
|
+
const regex1 = new RegExp(`\\{${fieldName}\\}`, "g");
|
|
742
|
+
const regex2 = new RegExp(`\\{\\{${fieldName}\\}\\}`, "g");
|
|
743
|
+
resolvedRedirectUrl = resolvedRedirectUrl.replace(regex1, value);
|
|
744
|
+
resolvedRedirectUrl = resolvedRedirectUrl.replace(regex2, value);
|
|
745
|
+
});
|
|
746
|
+
resolvedRedirectUrl = replaceTemplateVariables(resolvedRedirectUrl, response);
|
|
747
|
+
console.log("Final redirect URL:", resolvedRedirectUrl);
|
|
748
|
+
if (resolvedRedirectUrl && !resolvedRedirectUrl.includes("{")) {
|
|
749
|
+
window.location.href = resolvedRedirectUrl;
|
|
750
|
+
}
|
|
751
|
+
} else if (response && !response.result && response.message) {
|
|
752
|
+
setError(response.message);
|
|
753
|
+
throw new Error(response.message);
|
|
754
|
+
} else if (!response) {
|
|
755
|
+
setError("No response from server");
|
|
756
|
+
}
|
|
757
|
+
setIsLoading(false);
|
|
758
|
+
return { isSuccessful: true, response };
|
|
759
|
+
} catch (err) {
|
|
760
|
+
console.error("Button API call failed:", err);
|
|
761
|
+
setError(err.message || "An unexpected error occurred");
|
|
762
|
+
setIsLoading(false);
|
|
763
|
+
return { isSuccessful: false, message: err.message };
|
|
764
|
+
}
|
|
765
|
+
}, [node.postUrl, node.payload, node.redirectUrl, replaceTemplateVariables, extractFieldNames, getNestedValue3, props.apiBaseUrl, props.session]);
|
|
766
|
+
const renderButtonContent = () => {
|
|
767
|
+
if (children) {
|
|
768
|
+
return children;
|
|
769
|
+
}
|
|
770
|
+
if (linkText) {
|
|
771
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { children: linkText });
|
|
772
|
+
}
|
|
773
|
+
return node.title || "Button";
|
|
325
774
|
};
|
|
326
|
-
return /* @__PURE__ */ (0,
|
|
327
|
-
|
|
775
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "link-button-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
776
|
+
Button_default,
|
|
328
777
|
{
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
onLoad: handleIframeLoad
|
|
778
|
+
ButtonType: linkType,
|
|
779
|
+
onClick,
|
|
780
|
+
disabled: isLoading,
|
|
781
|
+
className: "w-full",
|
|
782
|
+
children: renderButtonContent()
|
|
335
783
|
}
|
|
336
|
-
) })
|
|
784
|
+
) });
|
|
337
785
|
};
|
|
338
|
-
|
|
786
|
+
LinkNodeButton_default = LinkNodeButton;
|
|
339
787
|
}
|
|
340
788
|
});
|
|
341
789
|
|
|
342
|
-
// src/
|
|
343
|
-
var
|
|
344
|
-
__export(
|
|
345
|
-
|
|
346
|
-
InputControl: () => InputControl_default,
|
|
347
|
-
InputControlType: () => InputControlType_default,
|
|
348
|
-
PageBodyRenderer: () => PageBodyRenderer_default,
|
|
349
|
-
ViewControl: () => ViewControl_default,
|
|
350
|
-
ViewControlTypes: () => ViewControlTypes_default,
|
|
351
|
-
getWidget: () => getWidget,
|
|
352
|
-
registerWidgets: () => registerWidgets
|
|
790
|
+
// src/components/CopyButton.tsx
|
|
791
|
+
var CopyButton_exports = {};
|
|
792
|
+
__export(CopyButton_exports, {
|
|
793
|
+
default: () => CopyButton
|
|
353
794
|
});
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
795
|
+
function CopyButton({ text }) {
|
|
796
|
+
const [copied, setCopied] = (0, import_react42.useState)(false);
|
|
797
|
+
const timeoutRef = (0, import_react42.useRef)(null);
|
|
798
|
+
(0, import_react42.useEffect)(() => {
|
|
799
|
+
return () => {
|
|
800
|
+
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
801
|
+
};
|
|
802
|
+
}, []);
|
|
803
|
+
const handleCopy = async () => {
|
|
804
|
+
try {
|
|
805
|
+
await navigator.clipboard.writeText(text);
|
|
806
|
+
setCopied(true);
|
|
807
|
+
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
808
|
+
timeoutRef.current = setTimeout(() => setCopied(false), 2e3);
|
|
809
|
+
} catch (err) {
|
|
810
|
+
console.error("Failed to copy: ", err);
|
|
811
|
+
}
|
|
812
|
+
};
|
|
813
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
814
|
+
"button",
|
|
815
|
+
{
|
|
816
|
+
onClick: handleCopy,
|
|
817
|
+
className: "flex gap-1 items-center hover:text-white transition",
|
|
818
|
+
children: [
|
|
819
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
820
|
+
"svg",
|
|
821
|
+
{
|
|
822
|
+
width: "16",
|
|
823
|
+
height: "16",
|
|
824
|
+
viewBox: "0 0 24 24",
|
|
825
|
+
className: "w-4 h-4",
|
|
826
|
+
fill: "currentColor",
|
|
827
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
828
|
+
"path",
|
|
829
|
+
{
|
|
830
|
+
fillRule: "evenodd",
|
|
831
|
+
clipRule: "evenodd",
|
|
832
|
+
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"
|
|
833
|
+
}
|
|
834
|
+
)
|
|
835
|
+
}
|
|
836
|
+
),
|
|
837
|
+
copied ? "Copied!" : "Copy code"
|
|
838
|
+
]
|
|
839
|
+
}
|
|
840
|
+
);
|
|
841
|
+
}
|
|
842
|
+
var import_react42, import_jsx_runtime55;
|
|
843
|
+
var init_CopyButton = __esm({
|
|
844
|
+
"src/components/CopyButton.tsx"() {
|
|
845
|
+
"use strict";
|
|
846
|
+
"use client";
|
|
847
|
+
import_react42 = require("react");
|
|
848
|
+
import_jsx_runtime55 = require("react/jsx-runtime");
|
|
849
|
+
}
|
|
850
|
+
});
|
|
851
|
+
|
|
852
|
+
// src/components/IFrameLoaderView.tsx
|
|
853
|
+
var import_react45, import_jsx_runtime61, IFrameLoaderView, IFrameLoaderView_default;
|
|
854
|
+
var init_IFrameLoaderView = __esm({
|
|
855
|
+
"src/components/IFrameLoaderView.tsx"() {
|
|
856
|
+
"use strict";
|
|
857
|
+
import_react45 = __toESM(require("react"));
|
|
858
|
+
import_jsx_runtime61 = require("react/jsx-runtime");
|
|
859
|
+
IFrameLoaderView = (props) => {
|
|
860
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_react45.default.Fragment, { children: [
|
|
861
|
+
props.isDataFound == null && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "mt-4 bg-gray-200 rounded-md p-4 animate-pulse", children: [
|
|
862
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex items-center mb-4", children: [
|
|
863
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 h-8 w-8 rounded-full animate-pulse" }),
|
|
864
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "ml-2", children: [
|
|
865
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 h-3 w-16 animate-pulse" }),
|
|
866
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 h-2 w-12 animate-pulse" })
|
|
867
|
+
] })
|
|
868
|
+
] }),
|
|
869
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "grid grid-cols-3 gap-4 mt-6", children: [
|
|
870
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "animate-pulse", children: [
|
|
871
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
872
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
873
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
874
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
875
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
876
|
+
] }),
|
|
877
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "animate-pulse", children: [
|
|
878
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
879
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
880
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
881
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
882
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
883
|
+
] }),
|
|
884
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "animate-pulse", children: [
|
|
885
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
886
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
887
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
888
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
889
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
890
|
+
] })
|
|
891
|
+
] })
|
|
892
|
+
] }) }),
|
|
893
|
+
props.children
|
|
894
|
+
] });
|
|
895
|
+
};
|
|
896
|
+
IFrameLoaderView_default = IFrameLoaderView;
|
|
897
|
+
}
|
|
898
|
+
});
|
|
899
|
+
|
|
900
|
+
// src/components/pageRenderingEngine/nodes/IframeClient.tsx
|
|
901
|
+
var IframeClient_exports = {};
|
|
902
|
+
__export(IframeClient_exports, {
|
|
903
|
+
default: () => IframeClient_default
|
|
904
|
+
});
|
|
905
|
+
var import_react46, import_jsx_runtime62, IframeClient, IframeClient_default;
|
|
906
|
+
var init_IframeClient = __esm({
|
|
907
|
+
"src/components/pageRenderingEngine/nodes/IframeClient.tsx"() {
|
|
908
|
+
"use strict";
|
|
909
|
+
"use client";
|
|
910
|
+
import_react46 = __toESM(require("react"));
|
|
911
|
+
init_IFrameLoaderView();
|
|
912
|
+
import_jsx_runtime62 = require("react/jsx-runtime");
|
|
913
|
+
IframeClient = ({ src }) => {
|
|
914
|
+
const iframeRef = (0, import_react46.useRef)(null);
|
|
915
|
+
const [iframeHeight, setIframeHeight] = (0, import_react46.useState)("100%");
|
|
916
|
+
const [isDataFound, setIsDataFound] = (0, import_react46.useState)(null);
|
|
917
|
+
(0, import_react46.useEffect)(() => {
|
|
918
|
+
const handleReceiveMessage = (event) => {
|
|
919
|
+
const eventName = event?.data?.eventName;
|
|
920
|
+
const payload = event?.data?.payload;
|
|
921
|
+
if (eventName === "SET_HEIGHT" && payload?.height) {
|
|
922
|
+
let height = 500;
|
|
923
|
+
if (payload.height > 500) {
|
|
924
|
+
height = payload.height + 50;
|
|
925
|
+
}
|
|
926
|
+
setIframeHeight(`${height}px`);
|
|
927
|
+
}
|
|
928
|
+
};
|
|
929
|
+
window.addEventListener("message", handleReceiveMessage);
|
|
930
|
+
return () => window.removeEventListener("message", handleReceiveMessage);
|
|
931
|
+
}, []);
|
|
932
|
+
(0, import_react46.useEffect)(() => {
|
|
933
|
+
const handleResize = () => {
|
|
934
|
+
if (iframeRef.current) {
|
|
935
|
+
iframeRef.current.contentWindow?.postMessage({ eventName: "RESIZE" }, "*");
|
|
936
|
+
}
|
|
937
|
+
};
|
|
938
|
+
window.addEventListener("resize", handleResize);
|
|
939
|
+
return () => window.removeEventListener("resize", handleResize);
|
|
940
|
+
}, []);
|
|
941
|
+
const handleIframeLoad = () => {
|
|
942
|
+
setIsDataFound(true);
|
|
943
|
+
};
|
|
944
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_react46.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(IFrameLoaderView_default, { isDataFound, children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
945
|
+
"iframe",
|
|
946
|
+
{
|
|
947
|
+
ref: iframeRef,
|
|
948
|
+
src,
|
|
949
|
+
className: "w-full h-full border-none",
|
|
950
|
+
scrolling: "no",
|
|
951
|
+
style: { height: iframeHeight },
|
|
952
|
+
onLoad: handleIframeLoad
|
|
953
|
+
}
|
|
954
|
+
) }) });
|
|
955
|
+
};
|
|
956
|
+
IframeClient_default = IframeClient;
|
|
957
|
+
}
|
|
958
|
+
});
|
|
959
|
+
|
|
960
|
+
// src/index.ts
|
|
961
|
+
var index_exports = {};
|
|
962
|
+
__export(index_exports, {
|
|
963
|
+
DataList: () => DataList_default,
|
|
964
|
+
InputControl: () => InputControl_default,
|
|
965
|
+
InputControlType: () => InputControlType_default,
|
|
966
|
+
PageBodyRenderer: () => PageBodyRenderer_default,
|
|
967
|
+
ViewControl: () => ViewControl_default,
|
|
968
|
+
ViewControlTypes: () => ViewControlTypes_default,
|
|
969
|
+
getWidget: () => getWidget,
|
|
970
|
+
registerWidgets: () => registerWidgets
|
|
971
|
+
});
|
|
972
|
+
module.exports = __toCommonJS(index_exports);
|
|
973
|
+
|
|
974
|
+
// src/components/pageRenderingEngine/nodes/WidgetRegistry.tsx
|
|
357
975
|
var registry = {};
|
|
358
976
|
function registerWidgets(widgets) {
|
|
359
977
|
Object.assign(registry, widgets);
|
|
@@ -1561,212 +2179,8 @@ var SelectWithSearchInput = (props) => {
|
|
|
1561
2179
|
};
|
|
1562
2180
|
var SelectWithSearchInput_default = SelectWithSearchInput;
|
|
1563
2181
|
|
|
1564
|
-
// src/components/Button.tsx
|
|
1565
|
-
var import_react24 = __toESM(require("react"));
|
|
1566
|
-
|
|
1567
|
-
// src/components/ToastService.tsx
|
|
1568
|
-
var ToastService = class _ToastService {
|
|
1569
|
-
static initialize(showToast, closeToast) {
|
|
1570
|
-
_ToastService.showToast = showToast;
|
|
1571
|
-
_ToastService.closeToast = closeToast;
|
|
1572
|
-
}
|
|
1573
|
-
static showError(message) {
|
|
1574
|
-
if (_ToastService.showToast) {
|
|
1575
|
-
_ToastService.showToast(message, "error");
|
|
1576
|
-
}
|
|
1577
|
-
}
|
|
1578
|
-
static showInfo(message) {
|
|
1579
|
-
if (_ToastService.showToast) {
|
|
1580
|
-
_ToastService.showToast(message, "info");
|
|
1581
|
-
}
|
|
1582
|
-
}
|
|
1583
|
-
static close() {
|
|
1584
|
-
if (_ToastService.closeToast) {
|
|
1585
|
-
_ToastService.closeToast();
|
|
1586
|
-
}
|
|
1587
|
-
}
|
|
1588
|
-
};
|
|
1589
|
-
var ToastService_default = ToastService;
|
|
1590
|
-
|
|
1591
|
-
// src/components/StyleTypes.tsx
|
|
1592
|
-
var buttonClasses = /* @__PURE__ */ new Map([
|
|
1593
|
-
["Primary" /* Solid */, "btn-solid"],
|
|
1594
|
-
["PrimaryHollow" /* Hollow */, "btn-hollow"],
|
|
1595
|
-
["Link" /* Link */, "btn-link"]
|
|
1596
|
-
// [StyleTypes.Solid, "relative inline-flex items-center justify-center bg-gradient-to-b from-secondary to-secondary-strong rounded px-4 py-3 lg:py-2 font-medium shadow-sm hover:shadow-lg focus:outline-none active:scale-95 disabled:opacity-50 disabled:cursor-not-allowed transition duration-150 ease-in-out text-body hover:bg-secondary-strong"],
|
|
1597
|
-
// [StyleTypes.Solid, "relative inline-flex items-center justify-center bg-neutral-strong rounded px-4 py-3 lg:py-2 font-medium shadow-sm hover:shadow-lg focus:outline-none active:scale-95 disabled:opacity-50 disabled:cursor-not-allowed transition duration-150 ease-in-out text-body hover:bg-neutral-stronger"],
|
|
1598
|
-
// [StyleTypes.Hollow, "inline-flex font-medium items-center justify-center px-4 py-3 lg:py-2 transparent border-primary border text-primary rounded hover:shadow-md focus:outline-none transition duration-150 ease-in-out active:scale-95"],
|
|
1599
|
-
// [StyleTypes.Hollow, "inline-flex font-medium items-center justify-center px-4 py-3 lg:py-2 transparent border-secondary border text-secondary rounded hover:shadow-md focus:outline-none transition duration-150 ease-in-out active:scale-95"],
|
|
1600
|
-
// [StyleTypes.Hollow, "inline-flex font-medium items-center justify-center px-4 py-3 lg:py-2 transparent border-neutral border text-neutral rounded hover:shadow-md focus:outline-none transition duration-150 ease-in-out active:scale-95"],
|
|
1601
|
-
// [StyleTypes.Ripple, "px-3 py-1.5 inline-flex items-center text-sm font-medium rounded border-[1.5px] border-primary ripple btn-bg-primary btn-primary-text"],
|
|
1602
|
-
// [StyleTypes.Danger, "inline-flex text-sm font-medium items-center justify-center px-4 py-2 border border-alert bg-alert text-white rounded hover:bg-alert-600 hover:border-alert-600 focus:outline-none active:ring-1 active:ring-alert"],
|
|
1603
|
-
// [StyleTypes.Link, ""],
|
|
1604
|
-
// [StyleTypes.Light, "inline-flex items-center justify-center rounded bg-white border px-4 py-2 leading-6 text-primary shadow-sm hover:shadow focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary disabled:opacity-50 disabled:cursor-not-allowed"],
|
|
1605
|
-
]);
|
|
1606
|
-
var progressClasses = /* @__PURE__ */ new Map([
|
|
1607
|
-
["Primary" /* Solid */, ""],
|
|
1608
|
-
["PrimaryHollow" /* Hollow */, ""],
|
|
1609
|
-
// [StyleTypes.Solid, ""],
|
|
1610
|
-
// [StyleTypes.Hollow, ""],
|
|
1611
|
-
// [StyleTypes.Solid, ""],
|
|
1612
|
-
// [StyleTypes.Hollow, ""],
|
|
1613
|
-
// [StyleTypes.Ripple, ""],
|
|
1614
|
-
// [StyleTypes.Danger, ""],
|
|
1615
|
-
["Link" /* Link */, ""]
|
|
1616
|
-
]);
|
|
1617
|
-
|
|
1618
|
-
// src/components/Confirm.tsx
|
|
1619
|
-
var import_react23 = require("react");
|
|
1620
|
-
|
|
1621
|
-
// src/components/ClientButton.tsx
|
|
1622
|
-
var import_react22 = __toESM(require("react"));
|
|
1623
|
-
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1624
|
-
var ClientButton = (props) => {
|
|
1625
|
-
const execute = async (event) => {
|
|
1626
|
-
if (props.onClick !== void 0) {
|
|
1627
|
-
props.onClick();
|
|
1628
|
-
} else {
|
|
1629
|
-
ToastService_default.showError("No action defined.");
|
|
1630
|
-
}
|
|
1631
|
-
};
|
|
1632
|
-
let buttonClass = props.ButtonType ? buttonClasses.get(props.ButtonType) : buttonClasses.get("Primary" /* Solid */);
|
|
1633
|
-
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react22.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1634
|
-
"button",
|
|
1635
|
-
{
|
|
1636
|
-
type: "button",
|
|
1637
|
-
onClick: execute,
|
|
1638
|
-
className: buttonClass + " " + props.className,
|
|
1639
|
-
children: props.children
|
|
1640
|
-
}
|
|
1641
|
-
) });
|
|
1642
|
-
};
|
|
1643
|
-
var ClientButton_default = ClientButton;
|
|
1644
|
-
|
|
1645
|
-
// src/components/Confirm.tsx
|
|
1646
|
-
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1647
|
-
var Confirm = ({ message, onConfirm, onCancel }) => {
|
|
1648
|
-
const [showModal, setShowModal] = (0, import_react23.useState)(true);
|
|
1649
|
-
const handleConfirmAction = () => {
|
|
1650
|
-
setShowModal(false);
|
|
1651
|
-
if (onConfirm) {
|
|
1652
|
-
onConfirm();
|
|
1653
|
-
}
|
|
1654
|
-
};
|
|
1655
|
-
const handleCancelAction = () => {
|
|
1656
|
-
setShowModal(false);
|
|
1657
|
-
if (onCancel) {
|
|
1658
|
-
onCancel();
|
|
1659
|
-
}
|
|
1660
|
-
};
|
|
1661
|
-
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_jsx_runtime24.Fragment, { children: showModal && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "fixed inset-0 flex items-center justify-center z-50", children: [
|
|
1662
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "absolute inset-0 bg-black opacity-70" }),
|
|
1663
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "bg-white rounded-md p-6 w-2/6 shadow border z-50", children: [
|
|
1664
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-xl font-medium mb-4", children: "Confirmation" }),
|
|
1665
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "mb-4", children: message }),
|
|
1666
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex justify-end gap-8", children: [
|
|
1667
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1668
|
-
ClientButton_default,
|
|
1669
|
-
{
|
|
1670
|
-
onClick: handleCancelAction,
|
|
1671
|
-
ButtonType: "PrimaryHollow" /* Hollow */,
|
|
1672
|
-
children: "Cancel"
|
|
1673
|
-
}
|
|
1674
|
-
),
|
|
1675
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1676
|
-
ClientButton_default,
|
|
1677
|
-
{
|
|
1678
|
-
onClick: handleConfirmAction,
|
|
1679
|
-
children: "Confirm"
|
|
1680
|
-
}
|
|
1681
|
-
)
|
|
1682
|
-
] })
|
|
1683
|
-
] })
|
|
1684
|
-
] }) });
|
|
1685
|
-
};
|
|
1686
|
-
var Confirm_default = Confirm;
|
|
1687
|
-
{
|
|
1688
|
-
}
|
|
1689
|
-
|
|
1690
|
-
// src/components/Button.tsx
|
|
1691
|
-
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1692
|
-
var Button = (props) => {
|
|
1693
|
-
const [inProgress, setInProgress] = (0, import_react24.useState)(false);
|
|
1694
|
-
const [isActionPerformed, setIsActionPerformed] = (0, import_react24.useState)(false);
|
|
1695
|
-
const [responseMessage, setResponseMessage] = (0, import_react24.useState)(null);
|
|
1696
|
-
const [showModal, setShowModal] = (0, import_react24.useState)(null);
|
|
1697
|
-
const execute = async (event) => {
|
|
1698
|
-
event.preventDefault();
|
|
1699
|
-
event.stopPropagation();
|
|
1700
|
-
if (props.confirm) {
|
|
1701
|
-
const confirmed = await showConfirmation("Are you sure you want to delete this item?");
|
|
1702
|
-
setShowModal(null);
|
|
1703
|
-
if (!confirmed) {
|
|
1704
|
-
return;
|
|
1705
|
-
}
|
|
1706
|
-
}
|
|
1707
|
-
if (props.oneTimeAction && isActionPerformed) {
|
|
1708
|
-
return;
|
|
1709
|
-
}
|
|
1710
|
-
setInProgress(true);
|
|
1711
|
-
let isValid = true;
|
|
1712
|
-
if (props.onValidate !== void 0) {
|
|
1713
|
-
isValid = await props.onValidate();
|
|
1714
|
-
if (!isValid) {
|
|
1715
|
-
setInProgress(false);
|
|
1716
|
-
ToastService_default.showError("There are errors in the form. Please fix them before proceeding.");
|
|
1717
|
-
return;
|
|
1718
|
-
}
|
|
1719
|
-
}
|
|
1720
|
-
if (props.onClick !== void 0) {
|
|
1721
|
-
let response = await props.onClick();
|
|
1722
|
-
if (response.isSuccessful) {
|
|
1723
|
-
setIsActionPerformed(true);
|
|
1724
|
-
setResponseMessage(response.message);
|
|
1725
|
-
if (props.showToast) {
|
|
1726
|
-
ToastService_default.showInfo(response.message || "");
|
|
1727
|
-
}
|
|
1728
|
-
} else {
|
|
1729
|
-
ToastService_default.showError(response.message || "");
|
|
1730
|
-
}
|
|
1731
|
-
} else {
|
|
1732
|
-
ToastService_default.showError("No action defined.");
|
|
1733
|
-
}
|
|
1734
|
-
setInProgress(false);
|
|
1735
|
-
};
|
|
1736
|
-
const showConfirmation = (message) => {
|
|
1737
|
-
return new Promise((resolve) => {
|
|
1738
|
-
const onConfirm = () => resolve(true);
|
|
1739
|
-
const onCancel = () => resolve(false);
|
|
1740
|
-
setShowModal(/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Confirm_default, { message: props.confirmationMessage, onConfirm, onCancel }));
|
|
1741
|
-
});
|
|
1742
|
-
};
|
|
1743
|
-
let buttonClass = props.ButtonType ? buttonClasses.get(props.ButtonType) : buttonClasses.get("Primary" /* Solid */);
|
|
1744
|
-
let progressClass = props.ButtonType ? progressClasses.get(props.ButtonType) : progressClasses.get("Primary" /* Solid */);
|
|
1745
|
-
const isDisabled = inProgress || isActionPerformed && props.oneTimeAction;
|
|
1746
|
-
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_react24.default.Fragment, { children: [
|
|
1747
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
1748
|
-
"button",
|
|
1749
|
-
{
|
|
1750
|
-
type: "submit",
|
|
1751
|
-
onClick: execute,
|
|
1752
|
-
disabled: props.disabled,
|
|
1753
|
-
title: isDisabled ? "The button is disabled to prevent any action" : "",
|
|
1754
|
-
className: buttonClass + " relative " + props.className,
|
|
1755
|
-
children: [
|
|
1756
|
-
isActionPerformed && props.oneTimeAction && responseMessage ? responseMessage : props.children,
|
|
1757
|
-
inProgress && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react24.default.Fragment, { children: props.hideProgressIndicator === true ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "absolute bottom-0 left-0 h-0.5 bg-gray-400 rounded animate-progress" }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("svg", { className: "animate-spin ml-2 mr-3 h-5 w-5 " + progressClass, xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [
|
|
1758
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
|
|
1759
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })
|
|
1760
|
-
] }) })
|
|
1761
|
-
]
|
|
1762
|
-
}
|
|
1763
|
-
),
|
|
1764
|
-
showModal
|
|
1765
|
-
] });
|
|
1766
|
-
};
|
|
1767
|
-
var Button_default = Button;
|
|
1768
|
-
|
|
1769
2182
|
// src/components/controls/edit/SelectWithSearchPanel.tsx
|
|
2183
|
+
init_Button();
|
|
1770
2184
|
var import_react25 = __toESM(require("react"));
|
|
1771
2185
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1772
2186
|
var SelectWithSearchPanel = (props) => {
|
|
@@ -2268,6 +2682,7 @@ var ContentView_default = ContentView;
|
|
|
2268
2682
|
|
|
2269
2683
|
// src/components/dataForm/Hyperlink.tsx
|
|
2270
2684
|
var import_link = __toESM(require("next/link"));
|
|
2685
|
+
init_StyleTypes();
|
|
2271
2686
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
2272
2687
|
function Hyperlink(props) {
|
|
2273
2688
|
let linkClass = props.linkType ? buttonClasses.get(props.linkType) : "";
|
|
@@ -2289,6 +2704,9 @@ function Hyperlink(props) {
|
|
|
2289
2704
|
) : props.isHeading ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("h5", { className: props.className + "inline-block", children: props.children }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: props.className, children: props.children }) });
|
|
2290
2705
|
}
|
|
2291
2706
|
|
|
2707
|
+
// src/components/dataForm/DataList.tsx
|
|
2708
|
+
init_StyleTypes();
|
|
2709
|
+
|
|
2292
2710
|
// src/clients/OdataBuilder.tsx
|
|
2293
2711
|
var OdataBuilder = class {
|
|
2294
2712
|
constructor(url) {
|
|
@@ -2990,10 +3408,10 @@ var DataList = (props) => {
|
|
|
2990
3408
|
var DataList_default = DataList;
|
|
2991
3409
|
|
|
2992
3410
|
// src/components/pageRenderingEngine/PageBodyRenderer.tsx
|
|
2993
|
-
var
|
|
3411
|
+
var import_react50 = __toESM(require("react"));
|
|
2994
3412
|
|
|
2995
3413
|
// src/components/pageRenderingEngine/nodes/ParagraphNode.tsx
|
|
2996
|
-
var
|
|
3414
|
+
var import_react37 = __toESM(require("react"));
|
|
2997
3415
|
|
|
2998
3416
|
// src/components/pageRenderingEngine/nodes/TextNode.tsx
|
|
2999
3417
|
var import_jsx_runtime40 = (
|
|
@@ -3069,423 +3487,38 @@ var LineBreakNode = () => {
|
|
|
3069
3487
|
var LineBreakNode_default = LineBreakNode;
|
|
3070
3488
|
|
|
3071
3489
|
// src/components/pageRenderingEngine/nodes/LinkNode.tsx
|
|
3072
|
-
var
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
var
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
{
|
|
3490
|
+
var import_react36 = __toESM(require("react"));
|
|
3491
|
+
|
|
3492
|
+
// src/components/pageRenderingEngine/nodes/ImageNode.tsx
|
|
3493
|
+
var import_react34 = __toESM(require("react"));
|
|
3494
|
+
|
|
3495
|
+
// src/components/utilities/AssetUtility.tsx
|
|
3496
|
+
var AssetUtility = class {
|
|
3497
|
+
constructor() {
|
|
3498
|
+
}
|
|
3499
|
+
static resolveUrl(assetBaseUrl, url) {
|
|
3500
|
+
if (!url) return void 0;
|
|
3501
|
+
if (url.startsWith("http")) return url;
|
|
3502
|
+
if (!assetBaseUrl) return url;
|
|
3503
|
+
return `${assetBaseUrl}/${url}`;
|
|
3504
|
+
}
|
|
3505
|
+
// static getAssetUrl(apiBaseUrl: string) {
|
|
3506
|
+
// let domainName = apiBaseUrl.replace("https://", "");
|
|
3507
|
+
// return `https://cdn.g-assets.com/${domainName}`;
|
|
3508
|
+
// }
|
|
3509
|
+
static getAssetFullPath(apiBaseUrl, relativePath) {
|
|
3510
|
+
const domainName = apiBaseUrl.replace("https://", "");
|
|
3511
|
+
return `https://cdn.g-assets.com/${domainName}/${relativePath}`;
|
|
3080
3512
|
}
|
|
3081
|
-
let formatClasses = props.node.cssClass || "";
|
|
3082
|
-
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_link2.default, { className: formatClasses, href: props.node.url, title: props.node.title, children: [
|
|
3083
|
-
props.node.children && props.node.children.map((node, index) => {
|
|
3084
|
-
const SelectedNode = NodeTypes2[node.type];
|
|
3085
|
-
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react33.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(SelectedNode, { node }) }, index);
|
|
3086
|
-
}),
|
|
3087
|
-
props.node.children.length == 0 && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("br", {})
|
|
3088
|
-
] });
|
|
3089
3513
|
};
|
|
3090
|
-
var
|
|
3514
|
+
var AssetUtility_default = AssetUtility;
|
|
3091
3515
|
|
|
3092
|
-
// src/components/pageRenderingEngine/nodes/
|
|
3516
|
+
// src/components/pageRenderingEngine/nodes/ImageNode.tsx
|
|
3517
|
+
var import_dynamic = __toESM(require("next/dynamic"));
|
|
3518
|
+
|
|
3519
|
+
// src/components/DeviceAssetSelector.tsx
|
|
3520
|
+
init_HlsPlayer();
|
|
3093
3521
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
3094
|
-
var SVGIconNode = ({ node }) => {
|
|
3095
|
-
if (!node?.svgCode) return null;
|
|
3096
|
-
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
3097
|
-
"span",
|
|
3098
|
-
{
|
|
3099
|
-
style: {
|
|
3100
|
-
display: "inline-flex",
|
|
3101
|
-
width: node.width,
|
|
3102
|
-
height: node.height,
|
|
3103
|
-
color: node.color
|
|
3104
|
-
},
|
|
3105
|
-
dangerouslySetInnerHTML: { __html: node.svgCode }
|
|
3106
|
-
}
|
|
3107
|
-
);
|
|
3108
|
-
};
|
|
3109
|
-
var SVGIconNode_default = SVGIconNode;
|
|
3110
|
-
|
|
3111
|
-
// src/components/pageRenderingEngine/nodes/EquationNode.tsx
|
|
3112
|
-
var import_katex = __toESM(require("katex"));
|
|
3113
|
-
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
3114
|
-
var EquationNode = ({ node }) => {
|
|
3115
|
-
const { equation, inline } = node;
|
|
3116
|
-
let html = "";
|
|
3117
|
-
try {
|
|
3118
|
-
html = import_katex.default.renderToString(equation, {
|
|
3119
|
-
displayMode: !inline,
|
|
3120
|
-
throwOnError: false
|
|
3121
|
-
});
|
|
3122
|
-
} catch (error) {
|
|
3123
|
-
html = import_katex.default.renderToString(`\\text{Invalid equation}`, {
|
|
3124
|
-
throwOnError: false
|
|
3125
|
-
});
|
|
3126
|
-
}
|
|
3127
|
-
if (inline) {
|
|
3128
|
-
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3129
|
-
"span",
|
|
3130
|
-
{
|
|
3131
|
-
className: "katex-inline",
|
|
3132
|
-
dangerouslySetInnerHTML: { __html: html }
|
|
3133
|
-
}
|
|
3134
|
-
);
|
|
3135
|
-
}
|
|
3136
|
-
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3137
|
-
"div",
|
|
3138
|
-
{
|
|
3139
|
-
className: "katex-block my-3 text-center",
|
|
3140
|
-
dangerouslySetInnerHTML: { __html: html }
|
|
3141
|
-
}
|
|
3142
|
-
);
|
|
3143
|
-
};
|
|
3144
|
-
var EquationNode_default = EquationNode;
|
|
3145
|
-
|
|
3146
|
-
// src/components/pageRenderingEngine/nodes/DatafieldNode.tsx
|
|
3147
|
-
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
3148
|
-
function getNestedProperty(obj, path) {
|
|
3149
|
-
if (!obj || !path) return null;
|
|
3150
|
-
if (path.includes(".")) {
|
|
3151
|
-
return path.split(".").reduce((prev, curr) => {
|
|
3152
|
-
if (prev && typeof prev === "object") {
|
|
3153
|
-
return prev[curr];
|
|
3154
|
-
}
|
|
3155
|
-
return null;
|
|
3156
|
-
}, obj);
|
|
3157
|
-
}
|
|
3158
|
-
const value = obj[path];
|
|
3159
|
-
if (Array.isArray(value)) {
|
|
3160
|
-
return value.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { children: String(item) }, index));
|
|
3161
|
-
}
|
|
3162
|
-
return value;
|
|
3163
|
-
}
|
|
3164
|
-
var DatafieldNode = (props) => {
|
|
3165
|
-
function cssStringToJson(cssString) {
|
|
3166
|
-
const styleObject = {};
|
|
3167
|
-
const matches = cssString?.match(/([\w-]+)\s*:\s*([^;]+)\s*;/g);
|
|
3168
|
-
if (matches) {
|
|
3169
|
-
matches.forEach((match) => {
|
|
3170
|
-
const parts = match.match(/([\w-]+)\s*:\s*([^;]+)\s*;/);
|
|
3171
|
-
if (parts && parts.length === 3) {
|
|
3172
|
-
styleObject[parts[1].trim()] = parts[2].trim();
|
|
3173
|
-
}
|
|
3174
|
-
});
|
|
3175
|
-
}
|
|
3176
|
-
return styleObject;
|
|
3177
|
-
}
|
|
3178
|
-
function toCamelCase2(str) {
|
|
3179
|
-
return str.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
3180
|
-
}
|
|
3181
|
-
function convertKeysToCamelCase2(obj) {
|
|
3182
|
-
return Object.fromEntries(
|
|
3183
|
-
Object.entries(obj).map(([key, value2]) => [
|
|
3184
|
-
toCamelCase2(key),
|
|
3185
|
-
value2
|
|
3186
|
-
])
|
|
3187
|
-
);
|
|
3188
|
-
}
|
|
3189
|
-
const Formats = [
|
|
3190
|
-
"",
|
|
3191
|
-
"font-medium",
|
|
3192
|
-
"italic",
|
|
3193
|
-
"font-medium italic",
|
|
3194
|
-
"",
|
|
3195
|
-
"",
|
|
3196
|
-
"",
|
|
3197
|
-
"",
|
|
3198
|
-
"underline",
|
|
3199
|
-
"font-medium underline",
|
|
3200
|
-
"italic underline",
|
|
3201
|
-
"italic underline font-medium"
|
|
3202
|
-
];
|
|
3203
|
-
const styles = convertKeysToCamelCase2(
|
|
3204
|
-
cssStringToJson(props.node.style)
|
|
3205
|
-
);
|
|
3206
|
-
const fieldName = props.node.fieldName ?? "";
|
|
3207
|
-
const value = props.dataitem ? getNestedProperty(props.dataitem, fieldName) : null;
|
|
3208
|
-
const isEmptyValue = value === null || value === void 0 || value === "" || Array.isArray(value) && value.length === 0 || typeof value === "object" && value !== null && Object.keys(value).length === 0;
|
|
3209
|
-
const maxLines = props.node.maxLines;
|
|
3210
|
-
if (maxLines && Number(maxLines) > 0) {
|
|
3211
|
-
Object.assign(styles, {
|
|
3212
|
-
display: "-webkit-box",
|
|
3213
|
-
overflow: "hidden",
|
|
3214
|
-
WebkitBoxOrient: "vertical",
|
|
3215
|
-
WebkitLineClamp: String(maxLines)
|
|
3216
|
-
});
|
|
3217
|
-
}
|
|
3218
|
-
const dataType = props.node.dataType;
|
|
3219
|
-
if (isEmptyValue) return null;
|
|
3220
|
-
if (dataType === "rawContent") {
|
|
3221
|
-
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3222
|
-
PageBodyRenderer_default,
|
|
3223
|
-
{
|
|
3224
|
-
rawBody: String(value ?? `@databound[${fieldName}]`),
|
|
3225
|
-
routeParameters: props.routeParameters,
|
|
3226
|
-
query: props.query,
|
|
3227
|
-
session: props.session,
|
|
3228
|
-
host: props.host,
|
|
3229
|
-
path: props.path,
|
|
3230
|
-
apiBaseUrl: props.apiBaseUrl,
|
|
3231
|
-
breadcrumb: props.breadcrumb,
|
|
3232
|
-
donotApplyContainerClass: true
|
|
3233
|
-
}
|
|
3234
|
-
);
|
|
3235
|
-
}
|
|
3236
|
-
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3237
|
-
"span",
|
|
3238
|
-
{
|
|
3239
|
-
className: `datafield-node ${props.node.format < Formats.length ? Formats[props.node.format] : ""}`,
|
|
3240
|
-
style: styles,
|
|
3241
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3242
|
-
ViewControl_default,
|
|
3243
|
-
{
|
|
3244
|
-
controlType: dataType,
|
|
3245
|
-
value: value ?? `@databound[${fieldName}]`
|
|
3246
|
-
}
|
|
3247
|
-
)
|
|
3248
|
-
}
|
|
3249
|
-
);
|
|
3250
|
-
};
|
|
3251
|
-
var DatafieldNode_default = DatafieldNode;
|
|
3252
|
-
|
|
3253
|
-
// src/components/pageRenderingEngine/nodes/ParagraphNode.tsx
|
|
3254
|
-
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
3255
|
-
var ParagraphNode = (props) => {
|
|
3256
|
-
const NodeTypes2 = {
|
|
3257
|
-
["text"]: TextNode_default,
|
|
3258
|
-
["linebreak"]: LineBreakNode_default,
|
|
3259
|
-
["link"]: LinkNode_default,
|
|
3260
|
-
["datafield"]: DatafieldNode_default,
|
|
3261
|
-
["equation"]: EquationNode_default,
|
|
3262
|
-
["svg-icon"]: SVGIconNode_default
|
|
3263
|
-
};
|
|
3264
|
-
const FormatClass = {
|
|
3265
|
-
"center": "text-center",
|
|
3266
|
-
"right": "text-right"
|
|
3267
|
-
};
|
|
3268
|
-
{
|
|
3269
|
-
}
|
|
3270
|
-
const formatClasses = FormatClass[props.node.format] || "";
|
|
3271
|
-
const isInlineOnlyParent = props.parentTag === "summary";
|
|
3272
|
-
const hasChildren = props.node.children && props.node.children.length > 0;
|
|
3273
|
-
if (isInlineOnlyParent) {
|
|
3274
|
-
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_jsx_runtime46.Fragment, { children: hasChildren && props.node.children.map((node, index) => {
|
|
3275
|
-
const SelectedNode = NodeTypes2[node.type];
|
|
3276
|
-
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_react34.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3277
|
-
SelectedNode,
|
|
3278
|
-
{
|
|
3279
|
-
node,
|
|
3280
|
-
dataitem: props.dataitem,
|
|
3281
|
-
session: props.session,
|
|
3282
|
-
apiBaseUrl: props.apiBaseUrl,
|
|
3283
|
-
routeParameters: props.routeParameters
|
|
3284
|
-
}
|
|
3285
|
-
) }, index);
|
|
3286
|
-
}) });
|
|
3287
|
-
}
|
|
3288
|
-
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: " " + formatClasses, children: [
|
|
3289
|
-
hasChildren && props.node.children.map((node, index) => {
|
|
3290
|
-
const SelectedNode = NodeTypes2[node.type];
|
|
3291
|
-
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_react34.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3292
|
-
SelectedNode,
|
|
3293
|
-
{
|
|
3294
|
-
node,
|
|
3295
|
-
dataitem: props.dataitem,
|
|
3296
|
-
session: props.session,
|
|
3297
|
-
apiBaseUrl: props.apiBaseUrl,
|
|
3298
|
-
routeParameters: props.routeParameters
|
|
3299
|
-
}
|
|
3300
|
-
) }, index);
|
|
3301
|
-
}),
|
|
3302
|
-
!hasChildren && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "py-1.5 lg:py-2" })
|
|
3303
|
-
] });
|
|
3304
|
-
};
|
|
3305
|
-
var ParagraphNode_default = ParagraphNode;
|
|
3306
|
-
|
|
3307
|
-
// src/components/pageRenderingEngine/nodes/HeadingNode.tsx
|
|
3308
|
-
var import_react35 = __toESM(require("react"));
|
|
3309
|
-
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
3310
|
-
var HeadingNode = (props) => {
|
|
3311
|
-
const NodeTypes2 = {
|
|
3312
|
-
["text"]: TextNode_default,
|
|
3313
|
-
["link"]: LinkNode_default,
|
|
3314
|
-
["svg-icon"]: SVGIconNode_default,
|
|
3315
|
-
["linebreak"]: LineBreakNode_default,
|
|
3316
|
-
["datafield"]: DatafieldNode_default
|
|
3317
|
-
};
|
|
3318
|
-
const HeadingTag = `${props.node.tag}`;
|
|
3319
|
-
const FormatClass = {
|
|
3320
|
-
"center": "text-center"
|
|
3321
|
-
};
|
|
3322
|
-
{
|
|
3323
|
-
}
|
|
3324
|
-
const formatClasses = FormatClass[props.node.format] || "";
|
|
3325
|
-
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_jsx_runtime47.Fragment, { children: import_react35.default.createElement(
|
|
3326
|
-
HeadingTag,
|
|
3327
|
-
{ className: formatClasses },
|
|
3328
|
-
props.node.children && props.node.children.map((childNode, index) => {
|
|
3329
|
-
const SelectedNode = NodeTypes2[childNode.type];
|
|
3330
|
-
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_react35.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(SelectedNode, { node: childNode, dataitem: props.dataitem, session: props.session, apiBaseUrl: props.apiBaseUrl, routeParameters: props.routeParameters }) }, index);
|
|
3331
|
-
})
|
|
3332
|
-
) });
|
|
3333
|
-
};
|
|
3334
|
-
var HeadingNode_default = HeadingNode;
|
|
3335
|
-
|
|
3336
|
-
// src/components/pageRenderingEngine/nodes/ListNode.tsx
|
|
3337
|
-
var import_react37 = __toESM(require("react"));
|
|
3338
|
-
|
|
3339
|
-
// src/components/pageRenderingEngine/nodes/ListItemNode.tsx
|
|
3340
|
-
var import_react36 = __toESM(require("react"));
|
|
3341
|
-
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
3342
|
-
var ListItemNode = (props) => {
|
|
3343
|
-
const NodeTypes2 = {
|
|
3344
|
-
text: TextNode_default,
|
|
3345
|
-
linebreak: LineBreakNode_default,
|
|
3346
|
-
link: LinkNode_default,
|
|
3347
|
-
list: ListNode_default
|
|
3348
|
-
};
|
|
3349
|
-
let foundFirstBreak = false;
|
|
3350
|
-
const firstTextChild = props.node.children?.find((c) => c.type === "text");
|
|
3351
|
-
let liStyle = {};
|
|
3352
|
-
if (firstTextChild?.style) {
|
|
3353
|
-
const match = firstTextChild.style.match(/font-size\s*:\s*([^;]+);?/);
|
|
3354
|
-
if (match) {
|
|
3355
|
-
liStyle.fontSize = match[1].trim();
|
|
3356
|
-
}
|
|
3357
|
-
}
|
|
3358
|
-
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("li", { style: liStyle, children: props.node.children && props.node.children.map((node, index) => {
|
|
3359
|
-
const SelectedNode = NodeTypes2[node.type];
|
|
3360
|
-
if (node.type === "linebreak") {
|
|
3361
|
-
if (!foundFirstBreak) {
|
|
3362
|
-
foundFirstBreak = true;
|
|
3363
|
-
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", {}, index);
|
|
3364
|
-
} else {
|
|
3365
|
-
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "py-1 lg:py-2" }, index);
|
|
3366
|
-
}
|
|
3367
|
-
} else {
|
|
3368
|
-
foundFirstBreak = false;
|
|
3369
|
-
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_react36.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SelectedNode, { node, dataitem: props.dataitem, routeParameters: props.routeParameters }) }, index);
|
|
3370
|
-
}
|
|
3371
|
-
}) });
|
|
3372
|
-
};
|
|
3373
|
-
var ListItemNode_default = ListItemNode;
|
|
3374
|
-
|
|
3375
|
-
// src/components/pageRenderingEngine/nodes/ListNode.tsx
|
|
3376
|
-
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
3377
|
-
var ListNode = (props) => {
|
|
3378
|
-
const NodeTypes2 = {
|
|
3379
|
-
listitem: ListItemNode_default
|
|
3380
|
-
};
|
|
3381
|
-
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_react37.default.Fragment, { children: [
|
|
3382
|
-
props.node.listType == "bullet" && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("ul", { children: props.node.children && props.node.children.map((node, index) => {
|
|
3383
|
-
const SelectedNode = NodeTypes2[node.type];
|
|
3384
|
-
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_react37.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(SelectedNode, { node, dataitem: props.dataitem, routeParameters: props.routeParameters }) }, index);
|
|
3385
|
-
}) }),
|
|
3386
|
-
props.node.listType == "number" && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("ol", { children: props.node.children && props.node.children.map((node, index) => {
|
|
3387
|
-
const SelectedNode = NodeTypes2[node.type];
|
|
3388
|
-
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_react37.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(SelectedNode, { node, dataitem: props.dataitem, routeParameters: props.routeParameters }) }, index);
|
|
3389
|
-
}) })
|
|
3390
|
-
] });
|
|
3391
|
-
};
|
|
3392
|
-
var ListNode_default = ListNode;
|
|
3393
|
-
|
|
3394
|
-
// src/components/pageRenderingEngine/nodes/QuoteNode.tsx
|
|
3395
|
-
var import_react38 = __toESM(require("react"));
|
|
3396
|
-
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
3397
|
-
var QuoteNode = (props) => {
|
|
3398
|
-
const NodeTypes2 = {
|
|
3399
|
-
["text"]: TextNode_default,
|
|
3400
|
-
["linebreak"]: LineBreakNode_default,
|
|
3401
|
-
["link"]: LinkNode_default
|
|
3402
|
-
};
|
|
3403
|
-
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("blockquote", { children: props.node.children && props.node.children.map((node, index) => {
|
|
3404
|
-
const SelectedNode = NodeTypes2[node.type];
|
|
3405
|
-
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_react38.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(SelectedNode, { node, session: props.session, apiBaseUrl: props.apiBaseUrl, routeParameters: props.routeParameters }) }, index);
|
|
3406
|
-
}) });
|
|
3407
|
-
};
|
|
3408
|
-
var QuoteNode_default = QuoteNode;
|
|
3409
|
-
|
|
3410
|
-
// src/components/pageRenderingEngine/nodes/CodeNode.tsx
|
|
3411
|
-
var import_react40 = __toESM(require("react"));
|
|
3412
|
-
var import_dynamic = __toESM(require("next/dynamic"));
|
|
3413
|
-
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
3414
|
-
var CopyButton2 = (0, import_dynamic.default)(() => Promise.resolve().then(() => (init_CopyButton(), CopyButton_exports)), {
|
|
3415
|
-
ssr: false,
|
|
3416
|
-
// optional: fallback UI while loading
|
|
3417
|
-
loading: () => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "text-gray-400 text-xs", children: "Copy" })
|
|
3418
|
-
});
|
|
3419
|
-
var CodeNode = (props) => {
|
|
3420
|
-
const NodeTypes2 = {
|
|
3421
|
-
text: TextNode_default,
|
|
3422
|
-
linebreak: LineBreakNode_default,
|
|
3423
|
-
link: LinkNode_default
|
|
3424
|
-
};
|
|
3425
|
-
const textContent = props.node?.children?.map((node) => {
|
|
3426
|
-
if (node.type === "text") return node.text || "";
|
|
3427
|
-
if (node.type === "linebreak") return "\n";
|
|
3428
|
-
if (node.type === "link") return node.text || node.url || "";
|
|
3429
|
-
return "";
|
|
3430
|
-
}).join("") ?? "";
|
|
3431
|
-
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { children: [
|
|
3432
|
-
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "flex items-center relative bg-neutral-strong px-4 py-3 text-xs font-sans justify-between rounded-t-md ", children: [
|
|
3433
|
-
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { children: "Code Snippet" }),
|
|
3434
|
-
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(CopyButton2, { text: textContent })
|
|
3435
|
-
] }),
|
|
3436
|
-
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("code", { className: "bg-neutral-soft p-4 text-sm whitespace-pre-wrap border border-2 block", children: props.node.children && props.node.children.map((node, index) => {
|
|
3437
|
-
const SelectedNode = NodeTypes2[node.type];
|
|
3438
|
-
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react40.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
3439
|
-
SelectedNode,
|
|
3440
|
-
{
|
|
3441
|
-
node,
|
|
3442
|
-
session: props.session,
|
|
3443
|
-
apiBaseUrl: props.apiBaseUrl,
|
|
3444
|
-
routeParameters: props.routeParameters
|
|
3445
|
-
}
|
|
3446
|
-
) }, index);
|
|
3447
|
-
}) })
|
|
3448
|
-
] });
|
|
3449
|
-
};
|
|
3450
|
-
var CodeNode_default = CodeNode;
|
|
3451
|
-
|
|
3452
|
-
// src/components/pageRenderingEngine/nodes/HorizontalRuleNode.tsx
|
|
3453
|
-
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
3454
|
-
var HorizontalRuleNode = () => {
|
|
3455
|
-
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("hr", {});
|
|
3456
|
-
};
|
|
3457
|
-
var HorizontalRuleNode_default = HorizontalRuleNode;
|
|
3458
|
-
|
|
3459
|
-
// src/components/pageRenderingEngine/nodes/ImageNode.tsx
|
|
3460
|
-
var import_react42 = __toESM(require("react"));
|
|
3461
|
-
|
|
3462
|
-
// src/components/utilities/AssetUtility.tsx
|
|
3463
|
-
var AssetUtility = class {
|
|
3464
|
-
constructor() {
|
|
3465
|
-
}
|
|
3466
|
-
static resolveUrl(assetBaseUrl, url) {
|
|
3467
|
-
if (!url) return void 0;
|
|
3468
|
-
if (url.startsWith("http")) return url;
|
|
3469
|
-
if (!assetBaseUrl) return url;
|
|
3470
|
-
return `${assetBaseUrl}/${url}`;
|
|
3471
|
-
}
|
|
3472
|
-
// static getAssetUrl(apiBaseUrl: string) {
|
|
3473
|
-
// let domainName = apiBaseUrl.replace("https://", "");
|
|
3474
|
-
// return `https://cdn.g-assets.com/${domainName}`;
|
|
3475
|
-
// }
|
|
3476
|
-
static getAssetFullPath(apiBaseUrl, relativePath) {
|
|
3477
|
-
const domainName = apiBaseUrl.replace("https://", "");
|
|
3478
|
-
return `https://cdn.g-assets.com/${domainName}/${relativePath}`;
|
|
3479
|
-
}
|
|
3480
|
-
};
|
|
3481
|
-
var AssetUtility_default = AssetUtility;
|
|
3482
|
-
|
|
3483
|
-
// src/components/pageRenderingEngine/nodes/ImageNode.tsx
|
|
3484
|
-
var import_dynamic2 = __toESM(require("next/dynamic"));
|
|
3485
|
-
|
|
3486
|
-
// src/components/DeviceAssetSelector.tsx
|
|
3487
|
-
init_HlsPlayer();
|
|
3488
|
-
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
3489
3522
|
var DeviceAssetSelector = ({
|
|
3490
3523
|
assets,
|
|
3491
3524
|
assetBaseUrl,
|
|
@@ -3560,7 +3593,7 @@ var DeviceAssetSelector = ({
|
|
|
3560
3593
|
const formatClasses = FormatClass[nodeProps?.format || ""] || "";
|
|
3561
3594
|
const renderMedia = () => {
|
|
3562
3595
|
if (isHls) {
|
|
3563
|
-
return /* @__PURE__ */ (0,
|
|
3596
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
3564
3597
|
HlsPlayer_default,
|
|
3565
3598
|
{
|
|
3566
3599
|
assetUrl: resolvedAssetUrl,
|
|
@@ -3577,7 +3610,7 @@ var DeviceAssetSelector = ({
|
|
|
3577
3610
|
} else {
|
|
3578
3611
|
return (
|
|
3579
3612
|
/* eslint-disable-next-line @next/next/no-img-element */
|
|
3580
|
-
/* @__PURE__ */ (0,
|
|
3613
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
3581
3614
|
"img",
|
|
3582
3615
|
{
|
|
3583
3616
|
style: styles,
|
|
@@ -3591,148 +3624,625 @@ var DeviceAssetSelector = ({
|
|
|
3591
3624
|
)
|
|
3592
3625
|
);
|
|
3593
3626
|
}
|
|
3594
|
-
};
|
|
3595
|
-
if (width) {
|
|
3596
|
-
return /* @__PURE__ */ (0,
|
|
3627
|
+
};
|
|
3628
|
+
if (width) {
|
|
3629
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { style: { width }, children: renderMedia() });
|
|
3630
|
+
}
|
|
3631
|
+
if (nodeProps?.format) {
|
|
3632
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: `flex ${formatClasses}`, children: renderMedia() });
|
|
3633
|
+
}
|
|
3634
|
+
return renderMedia();
|
|
3635
|
+
};
|
|
3636
|
+
var DeviceAssetSelector_default = DeviceAssetSelector;
|
|
3637
|
+
|
|
3638
|
+
// src/components/pageRenderingEngine/nodes/ImageNode.tsx
|
|
3639
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
3640
|
+
var HlsPlayer2 = (0, import_dynamic.default)(() => Promise.resolve().then(() => (init_HlsPlayer(), HlsPlayer_exports)), {
|
|
3641
|
+
ssr: false
|
|
3642
|
+
});
|
|
3643
|
+
var getNestedValue = (obj, path) => {
|
|
3644
|
+
if (!obj || !path) return void 0;
|
|
3645
|
+
return path.split(".").reduce((current, key) => {
|
|
3646
|
+
return current && current[key] !== void 0 ? current[key] : void 0;
|
|
3647
|
+
}, obj);
|
|
3648
|
+
};
|
|
3649
|
+
var ImageNode = (props) => {
|
|
3650
|
+
let assets;
|
|
3651
|
+
let imageUrl;
|
|
3652
|
+
let posterUrl;
|
|
3653
|
+
const currentDevice = props.device;
|
|
3654
|
+
if (props.node.device) {
|
|
3655
|
+
const nodeDevice = props.node.device;
|
|
3656
|
+
if (nodeDevice !== currentDevice) {
|
|
3657
|
+
return null;
|
|
3658
|
+
}
|
|
3659
|
+
}
|
|
3660
|
+
console.log("ImageNode device / currentDevice:", props.node.device, currentDevice);
|
|
3661
|
+
if (props.node.imageUrl.startsWith("http")) {
|
|
3662
|
+
imageUrl = props.node.imageUrl;
|
|
3663
|
+
posterUrl = AssetUtility_default.resolveUrl(
|
|
3664
|
+
props.assetBaseUrl,
|
|
3665
|
+
props.node.posterUrl
|
|
3666
|
+
);
|
|
3667
|
+
} else if (props.dataitem && props.node.datafield) {
|
|
3668
|
+
const image = getNestedValue(props.dataitem, props.node.datafield);
|
|
3669
|
+
console.log("ImageNode Datafield Image:", image);
|
|
3670
|
+
try {
|
|
3671
|
+
if (typeof image === "string") {
|
|
3672
|
+
assets = JSON.parse(image);
|
|
3673
|
+
} else if (Array.isArray(image)) {
|
|
3674
|
+
assets = image;
|
|
3675
|
+
} else if (image && typeof image === "object") {
|
|
3676
|
+
assets = [image];
|
|
3677
|
+
}
|
|
3678
|
+
} catch (error) {
|
|
3679
|
+
console.error("Error parsing assets in ImageNode:", error);
|
|
3680
|
+
}
|
|
3681
|
+
if (assets && assets.length > 0) {
|
|
3682
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_jsx_runtime44.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3683
|
+
DeviceAssetSelector_default,
|
|
3684
|
+
{
|
|
3685
|
+
device: props.device,
|
|
3686
|
+
assets,
|
|
3687
|
+
assetBaseUrl: props.assetBaseUrl,
|
|
3688
|
+
session: props.session,
|
|
3689
|
+
nodeProps: {
|
|
3690
|
+
title: props.node.title,
|
|
3691
|
+
showControls: props.node.showControls,
|
|
3692
|
+
loop: props.node.loop,
|
|
3693
|
+
playOptions: props.node.playOptions,
|
|
3694
|
+
borderRadius: props.node.borderRadius,
|
|
3695
|
+
width: props.node.width,
|
|
3696
|
+
height: props.node.height,
|
|
3697
|
+
format: props.node.format,
|
|
3698
|
+
tag: props.node.tag,
|
|
3699
|
+
// Add tag to ImageNode if needed
|
|
3700
|
+
placementCode: props.node.placementCode
|
|
3701
|
+
}
|
|
3702
|
+
}
|
|
3703
|
+
) });
|
|
3704
|
+
} else {
|
|
3705
|
+
imageUrl = AssetUtility_default.resolveUrl(props.assetBaseUrl, props.node.imageUrl);
|
|
3706
|
+
posterUrl = AssetUtility_default.resolveUrl(props.assetBaseUrl, props.node.posterUrl);
|
|
3707
|
+
}
|
|
3708
|
+
} else {
|
|
3709
|
+
imageUrl = AssetUtility_default.resolveUrl(props.assetBaseUrl, props.node.imageUrl);
|
|
3710
|
+
posterUrl = AssetUtility_default.resolveUrl(props.assetBaseUrl, props.node.posterUrl);
|
|
3711
|
+
}
|
|
3712
|
+
console.log("ImageNode Assets:", assets);
|
|
3713
|
+
if (!imageUrl) {
|
|
3714
|
+
return null;
|
|
3715
|
+
}
|
|
3716
|
+
const styles = {};
|
|
3717
|
+
if (props.node.height) styles.height = props.node.height;
|
|
3718
|
+
if (props.node.borderRadius) styles.borderRadius = props.node.borderRadius;
|
|
3719
|
+
if (props.node.width) styles.width = props.node.width;
|
|
3720
|
+
const FormatClass = {
|
|
3721
|
+
"center": "justify-center",
|
|
3722
|
+
"left": "justify-start",
|
|
3723
|
+
"right": "justify-end"
|
|
3724
|
+
};
|
|
3725
|
+
{
|
|
3726
|
+
}
|
|
3727
|
+
const formatClasses = FormatClass[props.node.format] || "";
|
|
3728
|
+
const isHls = imageUrl?.endsWith(".m3u8");
|
|
3729
|
+
const renderMedia = () => {
|
|
3730
|
+
if (isHls) {
|
|
3731
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3732
|
+
HlsPlayer2,
|
|
3733
|
+
{
|
|
3734
|
+
assetUrl: imageUrl,
|
|
3735
|
+
posterUrl,
|
|
3736
|
+
intrinsicWidth: props.node.intrinsicWidth,
|
|
3737
|
+
intrinsicHeight: props.node.intrinsicHeight,
|
|
3738
|
+
showControls: props.node.showControls === "true",
|
|
3739
|
+
loop: props.node.loop === "true",
|
|
3740
|
+
playOptions: props.node.playOptions,
|
|
3741
|
+
apiBaseUrl: props.apiBaseUrl,
|
|
3742
|
+
session: props.session
|
|
3743
|
+
}
|
|
3744
|
+
);
|
|
3745
|
+
} else {
|
|
3746
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react34.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3747
|
+
"img",
|
|
3748
|
+
{
|
|
3749
|
+
style: styles,
|
|
3750
|
+
loading: "lazy",
|
|
3751
|
+
className: "object-cover",
|
|
3752
|
+
src: imageUrl,
|
|
3753
|
+
width: props.node.intrinsicWidth,
|
|
3754
|
+
alt: props.node.title,
|
|
3755
|
+
height: props.node.intrinsicHeight
|
|
3756
|
+
}
|
|
3757
|
+
) });
|
|
3758
|
+
}
|
|
3759
|
+
};
|
|
3760
|
+
if (props.node.width) {
|
|
3761
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: `flex ${formatClasses}`, children: renderMedia() });
|
|
3762
|
+
}
|
|
3763
|
+
return renderMedia();
|
|
3764
|
+
};
|
|
3765
|
+
var ImageNode_default = ImageNode;
|
|
3766
|
+
|
|
3767
|
+
// src/components/pageRenderingEngine/nodes/LinkNode.tsx
|
|
3768
|
+
init_StyleTypes();
|
|
3769
|
+
var import_dynamic2 = __toESM(require("next/dynamic"));
|
|
3770
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
3771
|
+
var LinkNodeButton2 = (0, import_dynamic2.default)(() => Promise.resolve().then(() => (init_LinkNodeButton(), LinkNodeButton_exports)), {
|
|
3772
|
+
ssr: false
|
|
3773
|
+
});
|
|
3774
|
+
var LinkNode = (props) => {
|
|
3775
|
+
const NodeTypes2 = {
|
|
3776
|
+
text: TextNode_default,
|
|
3777
|
+
image: ImageNode_default
|
|
3778
|
+
};
|
|
3779
|
+
const { node, dataitem } = props;
|
|
3780
|
+
let linkUrl = node.url;
|
|
3781
|
+
if (node.datafield_link_url && dataitem) {
|
|
3782
|
+
const dynamicUrl = dataitem[node.datafield_link_url];
|
|
3783
|
+
if (dynamicUrl && typeof dynamicUrl === "string") {
|
|
3784
|
+
linkUrl = dynamicUrl;
|
|
3785
|
+
}
|
|
3786
|
+
}
|
|
3787
|
+
if (props.routeParameters && linkUrl && linkUrl.includes("{")) {
|
|
3788
|
+
Object.keys(props.routeParameters).forEach((param) => {
|
|
3789
|
+
const value = props.routeParameters[param];
|
|
3790
|
+
if (value !== void 0 && value !== null) {
|
|
3791
|
+
linkUrl = linkUrl.replace(
|
|
3792
|
+
new RegExp(`\\{${param}\\}`, "gi"),
|
|
3793
|
+
encodeURIComponent(String(value))
|
|
3794
|
+
);
|
|
3795
|
+
}
|
|
3796
|
+
});
|
|
3797
|
+
}
|
|
3798
|
+
let linkText = null;
|
|
3799
|
+
if (node.datafield_link_text && dataitem) {
|
|
3800
|
+
const dynamicText = dataitem[node.datafield_link_text];
|
|
3801
|
+
if (dynamicText && typeof dynamicText === "string") {
|
|
3802
|
+
linkText = dynamicText;
|
|
3803
|
+
}
|
|
3804
|
+
}
|
|
3805
|
+
const getLinkTypeFromCssClass = (cssClass) => {
|
|
3806
|
+
const classToTypeMap = {
|
|
3807
|
+
Primary: "Primary" /* Solid */,
|
|
3808
|
+
PrimaryHollow: "PrimaryHollow" /* Hollow */,
|
|
3809
|
+
Link: "Link" /* Link */
|
|
3810
|
+
};
|
|
3811
|
+
return classToTypeMap[cssClass];
|
|
3812
|
+
};
|
|
3813
|
+
const linkType = node.cssClass ? getLinkTypeFromCssClass(node.cssClass) : void 0;
|
|
3814
|
+
const isButton = node.isButton === true;
|
|
3815
|
+
const renderChildren = () => {
|
|
3816
|
+
if (!node.children || node.children.length === 0) return null;
|
|
3817
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_jsx_runtime46.Fragment, { children: node.children.map((childNode, index) => {
|
|
3818
|
+
const SelectedNode = NodeTypes2[childNode.type];
|
|
3819
|
+
if (!SelectedNode) {
|
|
3820
|
+
console.warn("Unknown node type:", childNode.type);
|
|
3821
|
+
return null;
|
|
3822
|
+
}
|
|
3823
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_react36.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3824
|
+
SelectedNode,
|
|
3825
|
+
{
|
|
3826
|
+
node: childNode,
|
|
3827
|
+
dataitem,
|
|
3828
|
+
linkText,
|
|
3829
|
+
routeParameters: props.routeParameters
|
|
3830
|
+
}
|
|
3831
|
+
) }, index);
|
|
3832
|
+
}) });
|
|
3833
|
+
};
|
|
3834
|
+
const renderFallback = () => {
|
|
3835
|
+
if ((!node.children || node.children.length === 0) && linkText) {
|
|
3836
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { children: linkText });
|
|
3837
|
+
}
|
|
3838
|
+
if ((!node.children || node.children.length === 0) && !linkText) {
|
|
3839
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("br", {});
|
|
3840
|
+
}
|
|
3841
|
+
return null;
|
|
3842
|
+
};
|
|
3843
|
+
if (isButton) {
|
|
3844
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
3845
|
+
LinkNodeButton2,
|
|
3846
|
+
{
|
|
3847
|
+
node,
|
|
3848
|
+
dataitem,
|
|
3849
|
+
routeParameters: props.routeParameters,
|
|
3850
|
+
session: props.session,
|
|
3851
|
+
apiBaseUrl: props.apiBaseUrl || "",
|
|
3852
|
+
linkText,
|
|
3853
|
+
linkType,
|
|
3854
|
+
linkUrl,
|
|
3855
|
+
children: [
|
|
3856
|
+
renderChildren(),
|
|
3857
|
+
renderFallback()
|
|
3858
|
+
]
|
|
3859
|
+
}
|
|
3860
|
+
);
|
|
3861
|
+
}
|
|
3862
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
3863
|
+
Hyperlink,
|
|
3864
|
+
{
|
|
3865
|
+
href: linkUrl || "#",
|
|
3866
|
+
linkType,
|
|
3867
|
+
alt: linkText || node.title || "",
|
|
3868
|
+
children: [
|
|
3869
|
+
renderChildren(),
|
|
3870
|
+
renderFallback()
|
|
3871
|
+
]
|
|
3872
|
+
}
|
|
3873
|
+
);
|
|
3874
|
+
};
|
|
3875
|
+
var LinkNode_default = LinkNode;
|
|
3876
|
+
|
|
3877
|
+
// src/components/pageRenderingEngine/nodes/SVGIconNode.tsx
|
|
3878
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
3879
|
+
var SVGIconNode = ({ node }) => {
|
|
3880
|
+
if (!node?.svgCode) return null;
|
|
3881
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
3882
|
+
"span",
|
|
3883
|
+
{
|
|
3884
|
+
style: {
|
|
3885
|
+
display: "inline-flex",
|
|
3886
|
+
width: node.width,
|
|
3887
|
+
height: node.height,
|
|
3888
|
+
color: node.color
|
|
3889
|
+
},
|
|
3890
|
+
dangerouslySetInnerHTML: { __html: node.svgCode }
|
|
3891
|
+
}
|
|
3892
|
+
);
|
|
3893
|
+
};
|
|
3894
|
+
var SVGIconNode_default = SVGIconNode;
|
|
3895
|
+
|
|
3896
|
+
// src/components/pageRenderingEngine/nodes/EquationNode.tsx
|
|
3897
|
+
var import_katex = __toESM(require("katex"));
|
|
3898
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
3899
|
+
var EquationNode = ({ node }) => {
|
|
3900
|
+
const { equation, inline } = node;
|
|
3901
|
+
let html = "";
|
|
3902
|
+
try {
|
|
3903
|
+
html = import_katex.default.renderToString(equation, {
|
|
3904
|
+
displayMode: !inline,
|
|
3905
|
+
throwOnError: false
|
|
3906
|
+
});
|
|
3907
|
+
} catch (error) {
|
|
3908
|
+
html = import_katex.default.renderToString(`\\text{Invalid equation}`, {
|
|
3909
|
+
throwOnError: false
|
|
3910
|
+
});
|
|
3597
3911
|
}
|
|
3598
|
-
if (
|
|
3599
|
-
return /* @__PURE__ */ (0,
|
|
3912
|
+
if (inline) {
|
|
3913
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
3914
|
+
"span",
|
|
3915
|
+
{
|
|
3916
|
+
className: "katex-inline",
|
|
3917
|
+
dangerouslySetInnerHTML: { __html: html }
|
|
3918
|
+
}
|
|
3919
|
+
);
|
|
3600
3920
|
}
|
|
3601
|
-
return
|
|
3921
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
3922
|
+
"div",
|
|
3923
|
+
{
|
|
3924
|
+
className: "katex-block my-3 text-center",
|
|
3925
|
+
dangerouslySetInnerHTML: { __html: html }
|
|
3926
|
+
}
|
|
3927
|
+
);
|
|
3602
3928
|
};
|
|
3603
|
-
var
|
|
3929
|
+
var EquationNode_default = EquationNode;
|
|
3604
3930
|
|
|
3605
|
-
// src/components/pageRenderingEngine/nodes/
|
|
3606
|
-
var
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
}, obj);
|
|
3615
|
-
};
|
|
3616
|
-
var ImageNode = (props) => {
|
|
3617
|
-
let assets;
|
|
3618
|
-
let imageUrl;
|
|
3619
|
-
let posterUrl;
|
|
3620
|
-
const currentDevice = props.device;
|
|
3621
|
-
if (props.node.device) {
|
|
3622
|
-
const nodeDevice = props.node.device;
|
|
3623
|
-
if (nodeDevice !== currentDevice) {
|
|
3931
|
+
// src/components/pageRenderingEngine/nodes/DatafieldNode.tsx
|
|
3932
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
3933
|
+
function getNestedProperty(obj, path) {
|
|
3934
|
+
if (!obj || !path) return null;
|
|
3935
|
+
if (path.includes(".")) {
|
|
3936
|
+
return path.split(".").reduce((prev, curr) => {
|
|
3937
|
+
if (prev && typeof prev === "object") {
|
|
3938
|
+
return prev[curr];
|
|
3939
|
+
}
|
|
3624
3940
|
return null;
|
|
3941
|
+
}, obj);
|
|
3942
|
+
}
|
|
3943
|
+
const value = obj[path];
|
|
3944
|
+
if (Array.isArray(value)) {
|
|
3945
|
+
return value.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { children: String(item) }, index));
|
|
3946
|
+
}
|
|
3947
|
+
return value;
|
|
3948
|
+
}
|
|
3949
|
+
var DatafieldNode = (props) => {
|
|
3950
|
+
function cssStringToJson(cssString) {
|
|
3951
|
+
const styleObject = {};
|
|
3952
|
+
const matches = cssString?.match(/([\w-]+)\s*:\s*([^;]+)\s*;/g);
|
|
3953
|
+
if (matches) {
|
|
3954
|
+
matches.forEach((match) => {
|
|
3955
|
+
const parts = match.match(/([\w-]+)\s*:\s*([^;]+)\s*;/);
|
|
3956
|
+
if (parts && parts.length === 3) {
|
|
3957
|
+
styleObject[parts[1].trim()] = parts[2].trim();
|
|
3958
|
+
}
|
|
3959
|
+
});
|
|
3625
3960
|
}
|
|
3961
|
+
return styleObject;
|
|
3626
3962
|
}
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3963
|
+
function toCamelCase2(str) {
|
|
3964
|
+
return str.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
3965
|
+
}
|
|
3966
|
+
function convertKeysToCamelCase2(obj) {
|
|
3967
|
+
return Object.fromEntries(
|
|
3968
|
+
Object.entries(obj).map(([key, value2]) => [
|
|
3969
|
+
toCamelCase2(key),
|
|
3970
|
+
value2
|
|
3971
|
+
])
|
|
3633
3972
|
);
|
|
3634
|
-
}
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3973
|
+
}
|
|
3974
|
+
const Formats = [
|
|
3975
|
+
"",
|
|
3976
|
+
"font-medium",
|
|
3977
|
+
"italic",
|
|
3978
|
+
"font-medium italic",
|
|
3979
|
+
"",
|
|
3980
|
+
"",
|
|
3981
|
+
"",
|
|
3982
|
+
"",
|
|
3983
|
+
"underline",
|
|
3984
|
+
"font-medium underline",
|
|
3985
|
+
"italic underline",
|
|
3986
|
+
"italic underline font-medium"
|
|
3987
|
+
];
|
|
3988
|
+
const styles = convertKeysToCamelCase2(
|
|
3989
|
+
cssStringToJson(props.node.style)
|
|
3990
|
+
);
|
|
3991
|
+
const fieldName = props.node.fieldName ?? "";
|
|
3992
|
+
const value = props.dataitem ? getNestedProperty(props.dataitem, fieldName) : null;
|
|
3993
|
+
const isEmptyValue = value === null || value === void 0 || value === "" || Array.isArray(value) && value.length === 0 || typeof value === "object" && value !== null && Object.keys(value).length === 0;
|
|
3994
|
+
const maxLines = props.node.maxLines;
|
|
3995
|
+
if (maxLines && Number(maxLines) > 0) {
|
|
3996
|
+
Object.assign(styles, {
|
|
3997
|
+
display: "-webkit-box",
|
|
3998
|
+
overflow: "hidden",
|
|
3999
|
+
WebkitBoxOrient: "vertical",
|
|
4000
|
+
WebkitLineClamp: String(maxLines)
|
|
4001
|
+
});
|
|
4002
|
+
}
|
|
4003
|
+
const dataType = props.node.dataType;
|
|
4004
|
+
if (isEmptyValue) return null;
|
|
4005
|
+
if (dataType === "rawContent") {
|
|
4006
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
4007
|
+
PageBodyRenderer_default,
|
|
4008
|
+
{
|
|
4009
|
+
rawBody: String(value ?? `@databound[${fieldName}]`),
|
|
4010
|
+
routeParameters: props.routeParameters,
|
|
4011
|
+
query: props.query,
|
|
4012
|
+
session: props.session,
|
|
4013
|
+
host: props.host,
|
|
4014
|
+
path: props.path,
|
|
4015
|
+
apiBaseUrl: props.apiBaseUrl,
|
|
4016
|
+
breadcrumb: props.breadcrumb,
|
|
4017
|
+
donotApplyContainerClass: true
|
|
3644
4018
|
}
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
4019
|
+
);
|
|
4020
|
+
}
|
|
4021
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
4022
|
+
"span",
|
|
4023
|
+
{
|
|
4024
|
+
className: `datafield-node ${props.node.format < Formats.length ? Formats[props.node.format] : ""}`,
|
|
4025
|
+
style: styles,
|
|
4026
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
4027
|
+
ViewControl_default,
|
|
3651
4028
|
{
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
assetBaseUrl: props.assetBaseUrl,
|
|
3655
|
-
session: props.session,
|
|
3656
|
-
nodeProps: {
|
|
3657
|
-
title: props.node.title,
|
|
3658
|
-
showControls: props.node.showControls,
|
|
3659
|
-
loop: props.node.loop,
|
|
3660
|
-
playOptions: props.node.playOptions,
|
|
3661
|
-
borderRadius: props.node.borderRadius,
|
|
3662
|
-
width: props.node.width,
|
|
3663
|
-
height: props.node.height,
|
|
3664
|
-
format: props.node.format,
|
|
3665
|
-
tag: props.node.tag,
|
|
3666
|
-
// Add tag to ImageNode if needed
|
|
3667
|
-
placementCode: props.node.placementCode
|
|
3668
|
-
}
|
|
4029
|
+
controlType: dataType,
|
|
4030
|
+
value: value ?? `@databound[${fieldName}]`
|
|
3669
4031
|
}
|
|
3670
|
-
)
|
|
3671
|
-
} else {
|
|
3672
|
-
imageUrl = AssetUtility_default.resolveUrl(props.assetBaseUrl, props.node.imageUrl);
|
|
3673
|
-
posterUrl = AssetUtility_default.resolveUrl(props.assetBaseUrl, props.node.posterUrl);
|
|
4032
|
+
)
|
|
3674
4033
|
}
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
4034
|
+
);
|
|
4035
|
+
};
|
|
4036
|
+
var DatafieldNode_default = DatafieldNode;
|
|
4037
|
+
|
|
4038
|
+
// src/components/pageRenderingEngine/nodes/ParagraphNode.tsx
|
|
4039
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
4040
|
+
var ParagraphNode = (props) => {
|
|
4041
|
+
const NodeTypes2 = {
|
|
4042
|
+
["text"]: TextNode_default,
|
|
4043
|
+
["linebreak"]: LineBreakNode_default,
|
|
4044
|
+
["link"]: LinkNode_default,
|
|
4045
|
+
["datafield"]: DatafieldNode_default,
|
|
4046
|
+
["equation"]: EquationNode_default,
|
|
4047
|
+
["svg-icon"]: SVGIconNode_default
|
|
4048
|
+
};
|
|
4049
|
+
const FormatClass = {
|
|
4050
|
+
"center": "text-center",
|
|
4051
|
+
"right": "text-right"
|
|
4052
|
+
};
|
|
4053
|
+
{
|
|
3678
4054
|
}
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
4055
|
+
const formatClasses = FormatClass[props.node.format] || "";
|
|
4056
|
+
const isInlineOnlyParent = props.parentTag === "summary";
|
|
4057
|
+
const hasChildren = props.node.children && props.node.children.length > 0;
|
|
4058
|
+
if (isInlineOnlyParent) {
|
|
4059
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_jsx_runtime50.Fragment, { children: hasChildren && props.node.children.map((node, index) => {
|
|
4060
|
+
const SelectedNode = NodeTypes2[node.type];
|
|
4061
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_react37.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
4062
|
+
SelectedNode,
|
|
4063
|
+
{
|
|
4064
|
+
node,
|
|
4065
|
+
dataitem: props.dataitem,
|
|
4066
|
+
session: props.session,
|
|
4067
|
+
apiBaseUrl: props.apiBaseUrl,
|
|
4068
|
+
routeParameters: props.routeParameters
|
|
4069
|
+
}
|
|
4070
|
+
) }, index);
|
|
4071
|
+
}) });
|
|
3682
4072
|
}
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
4073
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: " " + formatClasses, children: [
|
|
4074
|
+
hasChildren && props.node.children.map((node, index) => {
|
|
4075
|
+
const SelectedNode = NodeTypes2[node.type];
|
|
4076
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_react37.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
4077
|
+
SelectedNode,
|
|
4078
|
+
{
|
|
4079
|
+
node,
|
|
4080
|
+
dataitem: props.dataitem,
|
|
4081
|
+
session: props.session,
|
|
4082
|
+
apiBaseUrl: props.apiBaseUrl,
|
|
4083
|
+
routeParameters: props.routeParameters
|
|
4084
|
+
}
|
|
4085
|
+
) }, index);
|
|
4086
|
+
}),
|
|
4087
|
+
!hasChildren && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "py-1.5 lg:py-2" })
|
|
4088
|
+
] });
|
|
4089
|
+
};
|
|
4090
|
+
var ParagraphNode_default = ParagraphNode;
|
|
4091
|
+
|
|
4092
|
+
// src/components/pageRenderingEngine/nodes/HeadingNode.tsx
|
|
4093
|
+
var import_react38 = __toESM(require("react"));
|
|
4094
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
4095
|
+
var HeadingNode = (props) => {
|
|
4096
|
+
const NodeTypes2 = {
|
|
4097
|
+
["text"]: TextNode_default,
|
|
4098
|
+
["link"]: LinkNode_default,
|
|
4099
|
+
["svg-icon"]: SVGIconNode_default,
|
|
4100
|
+
["linebreak"]: LineBreakNode_default,
|
|
4101
|
+
["datafield"]: DatafieldNode_default
|
|
4102
|
+
};
|
|
4103
|
+
const HeadingTag = `${props.node.tag}`;
|
|
3687
4104
|
const FormatClass = {
|
|
3688
|
-
"center": "
|
|
3689
|
-
"left": "justify-start",
|
|
3690
|
-
"right": "justify-end"
|
|
4105
|
+
"center": "text-center"
|
|
3691
4106
|
};
|
|
3692
4107
|
{
|
|
3693
4108
|
}
|
|
3694
4109
|
const formatClasses = FormatClass[props.node.format] || "";
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
4110
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx_runtime51.Fragment, { children: import_react38.default.createElement(
|
|
4111
|
+
HeadingTag,
|
|
4112
|
+
{ className: formatClasses },
|
|
4113
|
+
props.node.children && props.node.children.map((childNode, index) => {
|
|
4114
|
+
const SelectedNode = NodeTypes2[childNode.type];
|
|
4115
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react38.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(SelectedNode, { node: childNode, dataitem: props.dataitem, session: props.session, apiBaseUrl: props.apiBaseUrl, routeParameters: props.routeParameters }) }, index);
|
|
4116
|
+
})
|
|
4117
|
+
) });
|
|
4118
|
+
};
|
|
4119
|
+
var HeadingNode_default = HeadingNode;
|
|
4120
|
+
|
|
4121
|
+
// src/components/pageRenderingEngine/nodes/ListNode.tsx
|
|
4122
|
+
var import_react40 = __toESM(require("react"));
|
|
4123
|
+
|
|
4124
|
+
// src/components/pageRenderingEngine/nodes/ListItemNode.tsx
|
|
4125
|
+
var import_react39 = __toESM(require("react"));
|
|
4126
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
4127
|
+
var ListItemNode = (props) => {
|
|
4128
|
+
const NodeTypes2 = {
|
|
4129
|
+
text: TextNode_default,
|
|
4130
|
+
linebreak: LineBreakNode_default,
|
|
4131
|
+
link: LinkNode_default,
|
|
4132
|
+
list: ListNode_default
|
|
4133
|
+
};
|
|
4134
|
+
let foundFirstBreak = false;
|
|
4135
|
+
const firstTextChild = props.node.children?.find((c) => c.type === "text");
|
|
4136
|
+
let liStyle = {};
|
|
4137
|
+
if (firstTextChild?.style) {
|
|
4138
|
+
const match = firstTextChild.style.match(/font-size\s*:\s*([^;]+);?/);
|
|
4139
|
+
if (match) {
|
|
4140
|
+
liStyle.fontSize = match[1].trim();
|
|
4141
|
+
}
|
|
4142
|
+
}
|
|
4143
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("li", { style: liStyle, children: props.node.children && props.node.children.map((node, index) => {
|
|
4144
|
+
const SelectedNode = NodeTypes2[node.type];
|
|
4145
|
+
if (node.type === "linebreak") {
|
|
4146
|
+
if (!foundFirstBreak) {
|
|
4147
|
+
foundFirstBreak = true;
|
|
4148
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", {}, index);
|
|
4149
|
+
} else {
|
|
4150
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "py-1 lg:py-2" }, index);
|
|
4151
|
+
}
|
|
3712
4152
|
} else {
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
{
|
|
3716
|
-
style: styles,
|
|
3717
|
-
loading: "lazy",
|
|
3718
|
-
className: "object-cover",
|
|
3719
|
-
src: imageUrl,
|
|
3720
|
-
width: props.node.intrinsicWidth,
|
|
3721
|
-
alt: props.node.title,
|
|
3722
|
-
height: props.node.intrinsicHeight
|
|
3723
|
-
}
|
|
3724
|
-
) });
|
|
4153
|
+
foundFirstBreak = false;
|
|
4154
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react39.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(SelectedNode, { node, dataitem: props.dataitem, routeParameters: props.routeParameters }) }, index);
|
|
3725
4155
|
}
|
|
4156
|
+
}) });
|
|
4157
|
+
};
|
|
4158
|
+
var ListItemNode_default = ListItemNode;
|
|
4159
|
+
|
|
4160
|
+
// src/components/pageRenderingEngine/nodes/ListNode.tsx
|
|
4161
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
4162
|
+
var ListNode = (props) => {
|
|
4163
|
+
const NodeTypes2 = {
|
|
4164
|
+
listitem: ListItemNode_default
|
|
3726
4165
|
};
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
4166
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_react40.default.Fragment, { children: [
|
|
4167
|
+
props.node.listType == "bullet" && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("ul", { children: props.node.children && props.node.children.map((node, index) => {
|
|
4168
|
+
const SelectedNode = NodeTypes2[node.type];
|
|
4169
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_react40.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(SelectedNode, { node, dataitem: props.dataitem, routeParameters: props.routeParameters }) }, index);
|
|
4170
|
+
}) }),
|
|
4171
|
+
props.node.listType == "number" && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("ol", { children: props.node.children && props.node.children.map((node, index) => {
|
|
4172
|
+
const SelectedNode = NodeTypes2[node.type];
|
|
4173
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_react40.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(SelectedNode, { node, dataitem: props.dataitem, routeParameters: props.routeParameters }) }, index);
|
|
4174
|
+
}) })
|
|
4175
|
+
] });
|
|
3731
4176
|
};
|
|
3732
|
-
var
|
|
4177
|
+
var ListNode_default = ListNode;
|
|
3733
4178
|
|
|
3734
|
-
// src/components/pageRenderingEngine/nodes/
|
|
4179
|
+
// src/components/pageRenderingEngine/nodes/QuoteNode.tsx
|
|
4180
|
+
var import_react41 = __toESM(require("react"));
|
|
4181
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
4182
|
+
var QuoteNode = (props) => {
|
|
4183
|
+
const NodeTypes2 = {
|
|
4184
|
+
["text"]: TextNode_default,
|
|
4185
|
+
["linebreak"]: LineBreakNode_default,
|
|
4186
|
+
["link"]: LinkNode_default
|
|
4187
|
+
};
|
|
4188
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("blockquote", { children: props.node.children && props.node.children.map((node, index) => {
|
|
4189
|
+
const SelectedNode = NodeTypes2[node.type];
|
|
4190
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_react41.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectedNode, { node, session: props.session, apiBaseUrl: props.apiBaseUrl, routeParameters: props.routeParameters }) }, index);
|
|
4191
|
+
}) });
|
|
4192
|
+
};
|
|
4193
|
+
var QuoteNode_default = QuoteNode;
|
|
4194
|
+
|
|
4195
|
+
// src/components/pageRenderingEngine/nodes/CodeNode.tsx
|
|
4196
|
+
var import_react43 = __toESM(require("react"));
|
|
4197
|
+
var import_dynamic3 = __toESM(require("next/dynamic"));
|
|
4198
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
4199
|
+
var CopyButton2 = (0, import_dynamic3.default)(() => Promise.resolve().then(() => (init_CopyButton(), CopyButton_exports)), {
|
|
4200
|
+
ssr: false,
|
|
4201
|
+
// optional: fallback UI while loading
|
|
4202
|
+
loading: () => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "text-gray-400 text-xs", children: "Copy" })
|
|
4203
|
+
});
|
|
4204
|
+
var CodeNode = (props) => {
|
|
4205
|
+
const NodeTypes2 = {
|
|
4206
|
+
text: TextNode_default,
|
|
4207
|
+
linebreak: LineBreakNode_default,
|
|
4208
|
+
link: LinkNode_default
|
|
4209
|
+
};
|
|
4210
|
+
const textContent = props.node?.children?.map((node) => {
|
|
4211
|
+
if (node.type === "text") return node.text || "";
|
|
4212
|
+
if (node.type === "linebreak") return "\n";
|
|
4213
|
+
if (node.type === "link") return node.text || node.url || "";
|
|
4214
|
+
return "";
|
|
4215
|
+
}).join("") ?? "";
|
|
4216
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { children: [
|
|
4217
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex items-center relative bg-neutral-strong px-4 py-3 text-xs font-sans justify-between rounded-t-md ", children: [
|
|
4218
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { children: "Code Snippet" }),
|
|
4219
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(CopyButton2, { text: textContent })
|
|
4220
|
+
] }),
|
|
4221
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("code", { className: "bg-neutral-soft p-4 text-sm whitespace-pre-wrap border border-2 block", children: props.node.children && props.node.children.map((node, index) => {
|
|
4222
|
+
const SelectedNode = NodeTypes2[node.type];
|
|
4223
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_react43.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
4224
|
+
SelectedNode,
|
|
4225
|
+
{
|
|
4226
|
+
node,
|
|
4227
|
+
session: props.session,
|
|
4228
|
+
apiBaseUrl: props.apiBaseUrl,
|
|
4229
|
+
routeParameters: props.routeParameters
|
|
4230
|
+
}
|
|
4231
|
+
) }, index);
|
|
4232
|
+
}) })
|
|
4233
|
+
] });
|
|
4234
|
+
};
|
|
4235
|
+
var CodeNode_default = CodeNode;
|
|
4236
|
+
|
|
4237
|
+
// src/components/pageRenderingEngine/nodes/HorizontalRuleNode.tsx
|
|
3735
4238
|
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
4239
|
+
var HorizontalRuleNode = () => {
|
|
4240
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("hr", {});
|
|
4241
|
+
};
|
|
4242
|
+
var HorizontalRuleNode_default = HorizontalRuleNode;
|
|
4243
|
+
|
|
4244
|
+
// src/components/pageRenderingEngine/nodes/WidgetNode.tsx
|
|
4245
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
3736
4246
|
var WidgetNode = (props) => {
|
|
3737
4247
|
const getWidgetParameters = () => {
|
|
3738
4248
|
const widgetInputParameters = {
|
|
@@ -3789,14 +4299,14 @@ var WidgetNode = (props) => {
|
|
|
3789
4299
|
};
|
|
3790
4300
|
const widgetCode = props.node?.widgetCode;
|
|
3791
4301
|
if (!widgetCode) {
|
|
3792
|
-
return /* @__PURE__ */ (0,
|
|
4302
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_jsx_runtime58.Fragment, { children: "Invalid widget" });
|
|
3793
4303
|
}
|
|
3794
4304
|
const SelectedWidget = getWidget(widgetCode);
|
|
3795
4305
|
if (!SelectedWidget) {
|
|
3796
4306
|
if (process.env.NODE_ENV !== "production") {
|
|
3797
4307
|
console.warn("Widget not found:", widgetCode);
|
|
3798
4308
|
}
|
|
3799
|
-
return /* @__PURE__ */ (0,
|
|
4309
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_jsx_runtime58.Fragment, { children: [
|
|
3800
4310
|
"Widget not found: ",
|
|
3801
4311
|
widgetCode
|
|
3802
4312
|
] });
|
|
@@ -3804,7 +4314,7 @@ var WidgetNode = (props) => {
|
|
|
3804
4314
|
const widgetParams = getWidgetParameters();
|
|
3805
4315
|
return (
|
|
3806
4316
|
// eslint-disable-next-line react-hooks/static-components
|
|
3807
|
-
/* @__PURE__ */ (0,
|
|
4317
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
3808
4318
|
SelectedWidget,
|
|
3809
4319
|
{
|
|
3810
4320
|
params: widgetParams,
|
|
@@ -3820,12 +4330,12 @@ var WidgetNode = (props) => {
|
|
|
3820
4330
|
var WidgetNode_default = WidgetNode;
|
|
3821
4331
|
|
|
3822
4332
|
// src/components/pageRenderingEngine/nodes/FormContainerNode.tsx
|
|
3823
|
-
var
|
|
4333
|
+
var import_react44 = __toESM(require("react"));
|
|
3824
4334
|
|
|
3825
4335
|
// src/components/pageRenderingEngine/nodes/InputControlNode.tsx
|
|
3826
|
-
var
|
|
4336
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
3827
4337
|
var InputControlNode = (props) => {
|
|
3828
|
-
return /* @__PURE__ */ (0,
|
|
4338
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
3829
4339
|
InputControl_default,
|
|
3830
4340
|
{
|
|
3831
4341
|
name: props.node.name,
|
|
@@ -3853,228 +4363,24 @@ var InputControlNode = (props) => {
|
|
|
3853
4363
|
};
|
|
3854
4364
|
var InputControlNode_default = InputControlNode;
|
|
3855
4365
|
|
|
3856
|
-
// src/clients/CacheManage.tsx
|
|
3857
|
-
var import_node_cache = __toESM(require("node-cache"));
|
|
3858
|
-
var CacheManager = class _CacheManager {
|
|
3859
|
-
constructor() {
|
|
3860
|
-
this.maxCacheSize = 1e3;
|
|
3861
|
-
this.cache = new import_node_cache.default({ stdTTL: 0, checkperiod: 300 });
|
|
3862
|
-
}
|
|
3863
|
-
static getInstance() {
|
|
3864
|
-
if (!_CacheManager.instance) {
|
|
3865
|
-
_CacheManager.instance = new _CacheManager();
|
|
3866
|
-
}
|
|
3867
|
-
return _CacheManager.instance;
|
|
3868
|
-
}
|
|
3869
|
-
get(key) {
|
|
3870
|
-
return null;
|
|
3871
|
-
}
|
|
3872
|
-
set(key, data, ttl) {
|
|
3873
|
-
}
|
|
3874
|
-
clear() {
|
|
3875
|
-
this.cache.flushAll();
|
|
3876
|
-
}
|
|
3877
|
-
size() {
|
|
3878
|
-
return this.cache.keys().length;
|
|
3879
|
-
}
|
|
3880
|
-
destroy() {
|
|
3881
|
-
this.cache.close();
|
|
3882
|
-
}
|
|
3883
|
-
};
|
|
3884
|
-
|
|
3885
|
-
// src/clients/ServiceClient.tsx
|
|
3886
|
-
var ServerApiError = class extends Error {
|
|
3887
|
-
constructor(data, status) {
|
|
3888
|
-
super(data.message || "---");
|
|
3889
|
-
this.status = status;
|
|
3890
|
-
this.data = data;
|
|
3891
|
-
this.data.isSuccessful = false;
|
|
3892
|
-
}
|
|
3893
|
-
};
|
|
3894
|
-
var ServiceClient = class {
|
|
3895
|
-
constructor(apiBaseUrl, session) {
|
|
3896
|
-
this.cacheManager = CacheManager.getInstance();
|
|
3897
|
-
this.baseUrl = apiBaseUrl;
|
|
3898
|
-
this.session = session;
|
|
3899
|
-
}
|
|
3900
|
-
buildFullPath(path, params) {
|
|
3901
|
-
let updatedPath = path;
|
|
3902
|
-
if (params) {
|
|
3903
|
-
Object.keys(params).forEach((key) => {
|
|
3904
|
-
updatedPath = updatedPath.replace(
|
|
3905
|
-
`{${key}}`,
|
|
3906
|
-
String(params[key])
|
|
3907
|
-
);
|
|
3908
|
-
});
|
|
3909
|
-
}
|
|
3910
|
-
return this.baseUrl + updatedPath;
|
|
3911
|
-
}
|
|
3912
|
-
getConfig() {
|
|
3913
|
-
const config = { headers: {} };
|
|
3914
|
-
if (this.session) {
|
|
3915
|
-
if (this.session.oAuthToken) {
|
|
3916
|
-
config.headers["Authorization"] = "Bearer " + this.session.oAuthToken;
|
|
3917
|
-
}
|
|
3918
|
-
config.headers["cid"] = this.session.cid || "";
|
|
3919
|
-
config.headers["UserCurrencyCode"] = this.session.userCurrencyCode || "INR";
|
|
3920
|
-
config.headers["MarketCode"] = this.session?.marketCode || "IND";
|
|
3921
|
-
}
|
|
3922
|
-
return config;
|
|
3923
|
-
}
|
|
3924
|
-
handleFetchError(error) {
|
|
3925
|
-
console.log(error);
|
|
3926
|
-
const serverApiError = error;
|
|
3927
|
-
if (serverApiError) {
|
|
3928
|
-
return serverApiError.data;
|
|
3929
|
-
}
|
|
3930
|
-
return {
|
|
3931
|
-
message: "There is some error. Please try after sometime.",
|
|
3932
|
-
isSuccessful: false
|
|
3933
|
-
};
|
|
3934
|
-
}
|
|
3935
|
-
async fetchJsonWithCache(fullPath, config) {
|
|
3936
|
-
const cacheKey = fullPath + "--" + (this.session?.marketCode || "IND");
|
|
3937
|
-
const cachedData = this.cacheManager.get(cacheKey);
|
|
3938
|
-
if (cachedData) {
|
|
3939
|
-
return cachedData;
|
|
3940
|
-
}
|
|
3941
|
-
console.log("*****************CALLING API:", cacheKey, (/* @__PURE__ */ new Date()).toISOString());
|
|
3942
|
-
const response = await fetch(fullPath, { headers: config.headers });
|
|
3943
|
-
if (!response.ok) {
|
|
3944
|
-
const apiErrorData = await response.json();
|
|
3945
|
-
throw new ServerApiError(apiErrorData, response.status);
|
|
3946
|
-
}
|
|
3947
|
-
const cacheControl = response.headers.get("Cache-Control");
|
|
3948
|
-
let revalidate = null;
|
|
3949
|
-
if (cacheControl) {
|
|
3950
|
-
const maxAgeMatch = cacheControl.match(/max-age=(\d+)/);
|
|
3951
|
-
if (maxAgeMatch && maxAgeMatch[1]) {
|
|
3952
|
-
const maxAge = parseInt(maxAgeMatch[1], 10);
|
|
3953
|
-
revalidate = maxAge * 1e3;
|
|
3954
|
-
}
|
|
3955
|
-
}
|
|
3956
|
-
const data = await response.json();
|
|
3957
|
-
data.isSuccessful = true;
|
|
3958
|
-
if (revalidate !== null && revalidate > 0) {
|
|
3959
|
-
console.log("revalidate............I am caching:" + revalidate);
|
|
3960
|
-
this.cacheManager.set(cacheKey, data, revalidate);
|
|
3961
|
-
}
|
|
3962
|
-
return data;
|
|
3963
|
-
}
|
|
3964
|
-
// private async refreshToken(): Promise<void> {
|
|
3965
|
-
// console.log("*******************calling refresh token***********************");
|
|
3966
|
-
// try {
|
|
3967
|
-
// const response = await fetch(this.baseUrl + "/auth/storefront/login/refreshToken", {
|
|
3968
|
-
// method: 'POST',
|
|
3969
|
-
// headers: {
|
|
3970
|
-
// 'Content-Type': 'application/json'
|
|
3971
|
-
// },
|
|
3972
|
-
// body: JSON.stringify({ refreshToken: this.session.refreshToken })
|
|
3973
|
-
// });
|
|
3974
|
-
// if (!response.ok) {
|
|
3975
|
-
// throw new Error("Failed to refresh token");
|
|
3976
|
-
// }
|
|
3977
|
-
// const responseData = await response.json();
|
|
3978
|
-
// this.session.oAuthToken = responseData.result.accessToken;
|
|
3979
|
-
// if (typeof window === "undefined") {
|
|
3980
|
-
// // Running on the server
|
|
3981
|
-
// } else {
|
|
3982
|
-
// await fetch("/api/login", {
|
|
3983
|
-
// method: "post",
|
|
3984
|
-
// headers: {
|
|
3985
|
-
// "Content-Type": "application/json",
|
|
3986
|
-
// },
|
|
3987
|
-
// body: JSON.stringify({ session: this.session }),
|
|
3988
|
-
// });
|
|
3989
|
-
// }
|
|
3990
|
-
// } catch (error: any) {
|
|
3991
|
-
// throw new Error("Failed to refresh token");
|
|
3992
|
-
// }
|
|
3993
|
-
// }
|
|
3994
|
-
async handleRequest(request) {
|
|
3995
|
-
try {
|
|
3996
|
-
return await request();
|
|
3997
|
-
} catch (error) {
|
|
3998
|
-
throw error;
|
|
3999
|
-
}
|
|
4000
|
-
}
|
|
4001
|
-
async post(path, data) {
|
|
4002
|
-
const request = async () => {
|
|
4003
|
-
const fullPath = this.baseUrl + path;
|
|
4004
|
-
const config = this.getConfig();
|
|
4005
|
-
const response = await fetch(fullPath, {
|
|
4006
|
-
method: "POST",
|
|
4007
|
-
headers: {
|
|
4008
|
-
...config.headers,
|
|
4009
|
-
"Content-Type": "application/json"
|
|
4010
|
-
},
|
|
4011
|
-
body: JSON.stringify(data)
|
|
4012
|
-
});
|
|
4013
|
-
if (!response.ok) {
|
|
4014
|
-
const apiErrorData = await response.json();
|
|
4015
|
-
throw new ServerApiError(apiErrorData, response.status);
|
|
4016
|
-
}
|
|
4017
|
-
const responseData = await response.json();
|
|
4018
|
-
responseData.isSuccessful = true;
|
|
4019
|
-
return responseData;
|
|
4020
|
-
};
|
|
4021
|
-
try {
|
|
4022
|
-
return await this.handleRequest(request);
|
|
4023
|
-
} catch (error) {
|
|
4024
|
-
return this.handleFetchError(error);
|
|
4025
|
-
}
|
|
4026
|
-
}
|
|
4027
|
-
async getSingle(path, params) {
|
|
4028
|
-
const request = async () => {
|
|
4029
|
-
const sanitizedParams = params ? Object.fromEntries(
|
|
4030
|
-
Object.entries(params).map(([k, v]) => [k, String(v)])
|
|
4031
|
-
) : void 0;
|
|
4032
|
-
const fullPath = this.buildFullPath(path, sanitizedParams);
|
|
4033
|
-
const config = this.getConfig();
|
|
4034
|
-
return await this.fetchJsonWithCache(fullPath, config);
|
|
4035
|
-
};
|
|
4036
|
-
try {
|
|
4037
|
-
return await this.handleRequest(request);
|
|
4038
|
-
} catch (error) {
|
|
4039
|
-
return this.handleFetchError(error);
|
|
4040
|
-
}
|
|
4041
|
-
}
|
|
4042
|
-
async get(path, params) {
|
|
4043
|
-
const request = async () => {
|
|
4044
|
-
const sanitizedParams = params ? Object.fromEntries(
|
|
4045
|
-
Object.entries(params).map(([k, v]) => [k, String(v)])
|
|
4046
|
-
) : void 0;
|
|
4047
|
-
const fullPath = this.buildFullPath(path, sanitizedParams);
|
|
4048
|
-
const config = this.getConfig();
|
|
4049
|
-
console.log(fullPath);
|
|
4050
|
-
return await this.fetchJsonWithCache(fullPath, config);
|
|
4051
|
-
};
|
|
4052
|
-
try {
|
|
4053
|
-
return await this.handleRequest(request);
|
|
4054
|
-
} catch (error) {
|
|
4055
|
-
return this.handleFetchError(error);
|
|
4056
|
-
}
|
|
4057
|
-
}
|
|
4058
|
-
};
|
|
4059
|
-
var ServiceClient_default = ServiceClient;
|
|
4060
|
-
|
|
4061
4366
|
// src/components/pageRenderingEngine/nodes/FormContainerNode.tsx
|
|
4062
|
-
|
|
4367
|
+
init_ServiceClient();
|
|
4368
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
4063
4369
|
var FormContainerNode = (props) => {
|
|
4064
4370
|
const NodeTypes2 = {
|
|
4065
4371
|
["input-control"]: InputControlNode_default
|
|
4066
4372
|
};
|
|
4067
4373
|
const { node } = props;
|
|
4068
|
-
const formRef = (0,
|
|
4374
|
+
const formRef = (0, import_react44.useRef)(null);
|
|
4069
4375
|
const initialState = {
|
|
4070
4376
|
inputValues: {},
|
|
4071
4377
|
lastPropertyChanged: ""
|
|
4072
4378
|
};
|
|
4073
|
-
const [formState, dispatch] = (0,
|
|
4074
|
-
const handleInputChange = (0,
|
|
4379
|
+
const [formState, dispatch] = (0, import_react44.useReducer)(FormReducer_default, initialState);
|
|
4380
|
+
const handleInputChange = (0, import_react44.useCallback)((updatedValues) => {
|
|
4075
4381
|
dispatch({ type: FORM_INPUT_UPDATE, name: updatedValues.name, value: updatedValues.value });
|
|
4076
4382
|
}, [dispatch]);
|
|
4077
|
-
(0,
|
|
4383
|
+
(0, import_react44.useEffect)(() => {
|
|
4078
4384
|
const fetchInitialData = async () => {
|
|
4079
4385
|
const client = new ServiceClient_default(props.apiBaseUrl, props.session);
|
|
4080
4386
|
const response = await client.getSingle(props.node.dataFetchApi, props.routeParameters);
|
|
@@ -4089,12 +4395,12 @@ var FormContainerNode = (props) => {
|
|
|
4089
4395
|
};
|
|
4090
4396
|
fetchInitialData();
|
|
4091
4397
|
}, [props.apiBaseUrl, props.node, props.session, props.routeParameters]);
|
|
4092
|
-
return /* @__PURE__ */ (0,
|
|
4398
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("form", { className: "group space-y-6 pb-6 overflow-y-auto", noValidate: true, ref: formRef, children: [
|
|
4093
4399
|
node.children && node.children.map((node2, index) => {
|
|
4094
4400
|
{
|
|
4095
4401
|
}
|
|
4096
4402
|
const SelectedNode = NodeTypes2[node2.type];
|
|
4097
|
-
return /* @__PURE__ */ (0,
|
|
4403
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_react44.default.Fragment, { children: SelectedNode && node2.type == "input-control" && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
4098
4404
|
InputControlNode_default,
|
|
4099
4405
|
{
|
|
4100
4406
|
value: formState.inputValues[node2.name],
|
|
@@ -4103,18 +4409,18 @@ var FormContainerNode = (props) => {
|
|
|
4103
4409
|
}
|
|
4104
4410
|
) }, index);
|
|
4105
4411
|
}),
|
|
4106
|
-
node.children.length == 0 && /* @__PURE__ */ (0,
|
|
4412
|
+
node.children.length == 0 && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "py-0.5 lg:py-1.5" })
|
|
4107
4413
|
] });
|
|
4108
4414
|
};
|
|
4109
4415
|
var FormContainerNode_default = FormContainerNode;
|
|
4110
4416
|
|
|
4111
4417
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
4112
|
-
var
|
|
4418
|
+
var import_react49 = __toESM(require("react"));
|
|
4113
4419
|
|
|
4114
4420
|
// src/components/pageRenderingEngine/nodes/EmbedNode.tsx
|
|
4115
|
-
var
|
|
4116
|
-
var
|
|
4117
|
-
var IframeClient2 = (0,
|
|
4421
|
+
var import_dynamic4 = __toESM(require("next/dynamic"));
|
|
4422
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
4423
|
+
var IframeClient2 = (0, import_dynamic4.default)(() => Promise.resolve().then(() => (init_IframeClient(), IframeClient_exports)), {
|
|
4118
4424
|
ssr: false
|
|
4119
4425
|
});
|
|
4120
4426
|
var EmbedNode = (props) => {
|
|
@@ -4126,13 +4432,16 @@ var EmbedNode = (props) => {
|
|
|
4126
4432
|
} else {
|
|
4127
4433
|
src = props.node.embedSrc;
|
|
4128
4434
|
}
|
|
4129
|
-
return /* @__PURE__ */ (0,
|
|
4435
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "aspect-video", children: src && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(IframeClient2, { src }) });
|
|
4130
4436
|
};
|
|
4131
4437
|
var EmbedNode_default = EmbedNode;
|
|
4132
4438
|
|
|
4439
|
+
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
4440
|
+
init_ServiceClient();
|
|
4441
|
+
|
|
4133
4442
|
// src/components/Slider.tsx
|
|
4134
|
-
var
|
|
4135
|
-
var
|
|
4443
|
+
var import_react47 = __toESM(require("react"));
|
|
4444
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
4136
4445
|
var Slider = ({
|
|
4137
4446
|
children,
|
|
4138
4447
|
slidesToShow = 4,
|
|
@@ -4150,13 +4459,13 @@ var Slider = ({
|
|
|
4150
4459
|
pillStyle = "cumulative",
|
|
4151
4460
|
progressPosition = "bottom"
|
|
4152
4461
|
}) => {
|
|
4153
|
-
const [currentSlide, setCurrentSlide] = (0,
|
|
4154
|
-
const [transition, setTransition] = (0,
|
|
4155
|
-
const [slidesToShowState, setSlidesToShowState] = (0,
|
|
4462
|
+
const [currentSlide, setCurrentSlide] = (0, import_react47.useState)(0);
|
|
4463
|
+
const [transition, setTransition] = (0, import_react47.useState)(true);
|
|
4464
|
+
const [slidesToShowState, setSlidesToShowState] = (0, import_react47.useState)(
|
|
4156
4465
|
typeof slidesToShow === "number" ? slidesToShow : slidesToShow.large
|
|
4157
4466
|
);
|
|
4158
|
-
const [isPlaying, setIsPlaying] = (0,
|
|
4159
|
-
(0,
|
|
4467
|
+
const [isPlaying, setIsPlaying] = (0, import_react47.useState)(autoplay);
|
|
4468
|
+
(0, import_react47.useEffect)(() => {
|
|
4160
4469
|
if (typeof slidesToShow === "number") return;
|
|
4161
4470
|
const handleResize = () => {
|
|
4162
4471
|
if (window.innerWidth >= 1024) {
|
|
@@ -4171,7 +4480,7 @@ var Slider = ({
|
|
|
4171
4480
|
window.addEventListener("resize", handleResize);
|
|
4172
4481
|
return () => window.removeEventListener("resize", handleResize);
|
|
4173
4482
|
}, [slidesToShow]);
|
|
4174
|
-
(0,
|
|
4483
|
+
(0, import_react47.useEffect)(() => {
|
|
4175
4484
|
if (!autoplay) return;
|
|
4176
4485
|
const timer = setInterval(() => {
|
|
4177
4486
|
if (isPlaying) {
|
|
@@ -4180,7 +4489,7 @@ var Slider = ({
|
|
|
4180
4489
|
}, autoplay_speed);
|
|
4181
4490
|
return () => clearInterval(timer);
|
|
4182
4491
|
}, [autoplay, autoplay_speed, currentSlide, isPlaying]);
|
|
4183
|
-
const totalSlides =
|
|
4492
|
+
const totalSlides = import_react47.Children.count(children);
|
|
4184
4493
|
const maxSlide = totalSlides - slidesToShowState;
|
|
4185
4494
|
const nextSlide = () => {
|
|
4186
4495
|
if (currentSlide >= maxSlide) {
|
|
@@ -4225,16 +4534,16 @@ var Slider = ({
|
|
|
4225
4534
|
}
|
|
4226
4535
|
};
|
|
4227
4536
|
const translateX = -currentSlide * (100 / slidesToShowState);
|
|
4228
|
-
const slides =
|
|
4229
|
-
if (!
|
|
4537
|
+
const slides = import_react47.Children.map(children, (child, index) => {
|
|
4538
|
+
if (!import_react47.default.isValidElement(child)) return null;
|
|
4230
4539
|
const childProps = child.props;
|
|
4231
4540
|
const mergedClassName = `${childProps.className ?? ""} w-full`.trim();
|
|
4232
|
-
return /* @__PURE__ */ (0,
|
|
4541
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
4233
4542
|
"div",
|
|
4234
4543
|
{
|
|
4235
4544
|
className: `flex-none ${scaleOnHover ? "group hover:z-50" : ""} relative`,
|
|
4236
4545
|
style: { width: `calc(${100 / slidesToShowState}%)`, paddingRight: gap },
|
|
4237
|
-
children: (0,
|
|
4546
|
+
children: (0, import_react47.cloneElement)(child, {
|
|
4238
4547
|
className: mergedClassName
|
|
4239
4548
|
})
|
|
4240
4549
|
},
|
|
@@ -4252,14 +4561,14 @@ var Slider = ({
|
|
|
4252
4561
|
return "bottom-4";
|
|
4253
4562
|
}
|
|
4254
4563
|
};
|
|
4255
|
-
return /* @__PURE__ */ (0,
|
|
4564
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
|
|
4256
4565
|
"div",
|
|
4257
4566
|
{
|
|
4258
4567
|
className: `relative w-full overflow-hidden ${className}`,
|
|
4259
4568
|
onMouseEnter: handleMouseEnter,
|
|
4260
4569
|
onMouseLeave: handleMouseLeave,
|
|
4261
4570
|
children: [
|
|
4262
|
-
/* @__PURE__ */ (0,
|
|
4571
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
4263
4572
|
"div",
|
|
4264
4573
|
{
|
|
4265
4574
|
className: "flex h-full",
|
|
@@ -4270,18 +4579,18 @@ var Slider = ({
|
|
|
4270
4579
|
children: slides
|
|
4271
4580
|
}
|
|
4272
4581
|
),
|
|
4273
|
-
show_arrows && /* @__PURE__ */ (0,
|
|
4274
|
-
/* @__PURE__ */ (0,
|
|
4582
|
+
show_arrows && /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_jsx_runtime64.Fragment, { children: [
|
|
4583
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
4275
4584
|
ArrowButton,
|
|
4276
4585
|
{
|
|
4277
4586
|
direction: "left",
|
|
4278
4587
|
onClick: prevSlide,
|
|
4279
4588
|
visible: infinite_scroll || currentSlide > 0,
|
|
4280
4589
|
className: arrowClassName,
|
|
4281
|
-
children: /* @__PURE__ */ (0,
|
|
4590
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: "w-6 h-6", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15.75 19.5 8.25 12l7.5-7.5" }) })
|
|
4282
4591
|
}
|
|
4283
4592
|
),
|
|
4284
|
-
/* @__PURE__ */ (0,
|
|
4593
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
|
|
4285
4594
|
ArrowButton,
|
|
4286
4595
|
{
|
|
4287
4596
|
direction: "right",
|
|
@@ -4289,13 +4598,13 @@ var Slider = ({
|
|
|
4289
4598
|
visible: infinite_scroll || currentSlide < maxSlide,
|
|
4290
4599
|
className: arrowClassName,
|
|
4291
4600
|
children: [
|
|
4292
|
-
/* @__PURE__ */ (0,
|
|
4601
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: "w-6 h-6", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "m8.25 4.5 7.5 7.5-7.5 7.5" }) }),
|
|
4293
4602
|
" "
|
|
4294
4603
|
]
|
|
4295
4604
|
}
|
|
4296
4605
|
)
|
|
4297
4606
|
] }),
|
|
4298
|
-
show_dots && /* @__PURE__ */ (0,
|
|
4607
|
+
show_dots && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: `absolute left-1/2 -translate-x-1/2 flex justify-center space-x-1.5 ${getProgressPositionClass()}`, children: Array.from({ length: totalSlides }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
4299
4608
|
ProgressPill,
|
|
4300
4609
|
{
|
|
4301
4610
|
active: index === currentSlide,
|
|
@@ -4321,7 +4630,7 @@ var ArrowButton = ({
|
|
|
4321
4630
|
visible,
|
|
4322
4631
|
children,
|
|
4323
4632
|
className = ""
|
|
4324
|
-
}) => /* @__PURE__ */ (0,
|
|
4633
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
4325
4634
|
"button",
|
|
4326
4635
|
{
|
|
4327
4636
|
className: `
|
|
@@ -4347,13 +4656,13 @@ var ProgressPill = ({
|
|
|
4347
4656
|
currentSlide,
|
|
4348
4657
|
totalSlides
|
|
4349
4658
|
}) => {
|
|
4350
|
-
const [progress, setProgress] = (0,
|
|
4351
|
-
(0,
|
|
4659
|
+
const [progress, setProgress] = (0, import_react47.useState)(0);
|
|
4660
|
+
(0, import_react47.useEffect)(() => {
|
|
4352
4661
|
if (active) {
|
|
4353
4662
|
setProgress(0);
|
|
4354
4663
|
}
|
|
4355
4664
|
}, [active, index]);
|
|
4356
|
-
(0,
|
|
4665
|
+
(0, import_react47.useEffect)(() => {
|
|
4357
4666
|
if (!active || !isPlaying) {
|
|
4358
4667
|
if (!active) {
|
|
4359
4668
|
setProgress(0);
|
|
@@ -4408,7 +4717,7 @@ var ProgressPill = ({
|
|
|
4408
4717
|
const renderProgressBar = () => {
|
|
4409
4718
|
if (style === "modern" && isActive || style === "cumulative" && shouldShowProgress) {
|
|
4410
4719
|
const displayProgress = style === "cumulative" && isFilled ? 100 : progress;
|
|
4411
|
-
return /* @__PURE__ */ (0,
|
|
4720
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
4412
4721
|
"div",
|
|
4413
4722
|
{
|
|
4414
4723
|
className: `absolute top-0 left-0 h-full rounded-full ${style === "cumulative" && isFilled ? activeClassName || "bg-white" : activeClassName || "bg-white"} transition-all duration-50 ease-linear`,
|
|
@@ -4420,7 +4729,7 @@ var ProgressPill = ({
|
|
|
4420
4729
|
};
|
|
4421
4730
|
const renderCumulativeFill = () => {
|
|
4422
4731
|
if (style === "cumulative" && isFilled && !isActive) {
|
|
4423
|
-
return /* @__PURE__ */ (0,
|
|
4732
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
4424
4733
|
"div",
|
|
4425
4734
|
{
|
|
4426
4735
|
className: `absolute top-0 left-0 h-full rounded-full ${activeClassName || "bg-white"} transition-all duration-300`,
|
|
@@ -4430,7 +4739,7 @@ var ProgressPill = ({
|
|
|
4430
4739
|
}
|
|
4431
4740
|
return null;
|
|
4432
4741
|
};
|
|
4433
|
-
return /* @__PURE__ */ (0,
|
|
4742
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
|
|
4434
4743
|
"button",
|
|
4435
4744
|
{
|
|
4436
4745
|
className: `${baseClasses} ${getStyleClasses()}`,
|
|
@@ -4606,10 +4915,10 @@ var PathUtility = class {
|
|
|
4606
4915
|
var PathUtility_default = new PathUtility();
|
|
4607
4916
|
|
|
4608
4917
|
// src/components/NoDataFound.tsx
|
|
4609
|
-
var
|
|
4918
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
4610
4919
|
var NoDataFound = () => {
|
|
4611
|
-
return /* @__PURE__ */ (0,
|
|
4612
|
-
/* @__PURE__ */ (0,
|
|
4920
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex flex-col items-center justify-center py-12 px-4 text-center bg-neutral-weak", children: [
|
|
4921
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "mb-5", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "mx-auto w-20 h-20 rounded-full flex items-center justify-center bg-neutral-soft", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4613
4922
|
"svg",
|
|
4614
4923
|
{
|
|
4615
4924
|
className: "w-10 h-10",
|
|
@@ -4617,7 +4926,7 @@ var NoDataFound = () => {
|
|
|
4617
4926
|
stroke: "currentColor",
|
|
4618
4927
|
viewBox: "0 0 24 24",
|
|
4619
4928
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4620
|
-
children: /* @__PURE__ */ (0,
|
|
4929
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4621
4930
|
"path",
|
|
4622
4931
|
{
|
|
4623
4932
|
strokeLinecap: "round",
|
|
@@ -4628,18 +4937,19 @@ var NoDataFound = () => {
|
|
|
4628
4937
|
)
|
|
4629
4938
|
}
|
|
4630
4939
|
) }) }),
|
|
4631
|
-
/* @__PURE__ */ (0,
|
|
4632
|
-
/* @__PURE__ */ (0,
|
|
4940
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("h3", { className: "text-lg font-medium mb-2", children: "No data available" }),
|
|
4941
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("p", { className: " max-w-sm mb-0", children: "No records found. Data may be empty or not available at the moment." })
|
|
4633
4942
|
] });
|
|
4634
4943
|
};
|
|
4635
4944
|
var NoDataFound_default = NoDataFound;
|
|
4636
4945
|
|
|
4637
4946
|
// src/components/Pagination.tsx
|
|
4638
|
-
var
|
|
4639
|
-
|
|
4947
|
+
var import_react48 = require("react");
|
|
4948
|
+
init_StyleTypes();
|
|
4949
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
4640
4950
|
var Pagination = (props) => {
|
|
4641
4951
|
const { dataset, path, query, showPageSizeSelector = false, showJumpToPage = false } = props;
|
|
4642
|
-
const builder = (0,
|
|
4952
|
+
const builder = (0, import_react48.useMemo)(() => {
|
|
4643
4953
|
const b = new OdataBuilder(path);
|
|
4644
4954
|
if (query) b.setQuery(query);
|
|
4645
4955
|
return b;
|
|
@@ -4680,7 +4990,7 @@ var Pagination = (props) => {
|
|
|
4680
4990
|
return range;
|
|
4681
4991
|
};
|
|
4682
4992
|
const paginationRange = getPaginationRange();
|
|
4683
|
-
const PageButton = ({ page, children }) => /* @__PURE__ */ (0,
|
|
4993
|
+
const PageButton = ({ page, children }) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
4684
4994
|
Hyperlink,
|
|
4685
4995
|
{
|
|
4686
4996
|
linkType: "Link" /* Link */,
|
|
@@ -4695,9 +5005,9 @@ var Pagination = (props) => {
|
|
|
4695
5005
|
);
|
|
4696
5006
|
const NavigationButton = ({ page, disabled, children }) => {
|
|
4697
5007
|
if (disabled) {
|
|
4698
|
-
return /* @__PURE__ */ (0,
|
|
5008
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "min-w-[20px] md:min-w-[40px] h-10 flex items-center justify-center px-2 md:px-3 border bg-neutral-base cursor-not-allowed", children });
|
|
4699
5009
|
}
|
|
4700
|
-
return /* @__PURE__ */ (0,
|
|
5010
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
4701
5011
|
Hyperlink,
|
|
4702
5012
|
{
|
|
4703
5013
|
className: "min-w-[20px] md:min-w-[40px] h-10 flex items-center justify-center px-2 md:px-3 border transition-colors duration-150",
|
|
@@ -4707,35 +5017,35 @@ var Pagination = (props) => {
|
|
|
4707
5017
|
);
|
|
4708
5018
|
};
|
|
4709
5019
|
if (totalPages <= 1 && totalItems === 0) return null;
|
|
4710
|
-
return /* @__PURE__ */ (0,
|
|
4711
|
-
/* @__PURE__ */ (0,
|
|
4712
|
-
/* @__PURE__ */ (0,
|
|
5020
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "py-6 border-t bg-default", children: [
|
|
5021
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex flex-col sm:flex-row items-center justify-between gap-4", children: [
|
|
5022
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "text-sm", children: [
|
|
4713
5023
|
"Showing ",
|
|
4714
|
-
/* @__PURE__ */ (0,
|
|
5024
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("span", { className: "font-semibold", children: [
|
|
4715
5025
|
startItem,
|
|
4716
5026
|
"-",
|
|
4717
5027
|
endItem
|
|
4718
5028
|
] }),
|
|
4719
5029
|
" ",
|
|
4720
5030
|
"out of ",
|
|
4721
|
-
/* @__PURE__ */ (0,
|
|
5031
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "font-semibold", children: totalItems.toLocaleString() }),
|
|
4722
5032
|
" results"
|
|
4723
5033
|
] }),
|
|
4724
|
-
totalPages > 1 && /* @__PURE__ */ (0,
|
|
4725
|
-
/* @__PURE__ */ (0,
|
|
5034
|
+
totalPages > 1 && /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex items-center space-x-1", children: [
|
|
5035
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
4726
5036
|
NavigationButton,
|
|
4727
5037
|
{
|
|
4728
5038
|
page: activePageNumber - 1,
|
|
4729
5039
|
disabled: activePageNumber === 1,
|
|
4730
5040
|
children: [
|
|
4731
|
-
/* @__PURE__ */ (0,
|
|
4732
|
-
/* @__PURE__ */ (0,
|
|
5041
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Icon_default, { name: "chevronLeft", className: "w-4 h-4 mr-1" }) }),
|
|
5042
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "text-sm", children: "Prev" })
|
|
4733
5043
|
]
|
|
4734
5044
|
}
|
|
4735
5045
|
),
|
|
4736
5046
|
paginationRange.map((item, index) => {
|
|
4737
5047
|
if (item === "...") {
|
|
4738
|
-
return /* @__PURE__ */ (0,
|
|
5048
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
4739
5049
|
"span",
|
|
4740
5050
|
{
|
|
4741
5051
|
className: "min-w-[20px] md:min-w-[40px] h-10 flex items-center justify-center text-gray-500",
|
|
@@ -4745,23 +5055,23 @@ var Pagination = (props) => {
|
|
|
4745
5055
|
);
|
|
4746
5056
|
}
|
|
4747
5057
|
const page = item;
|
|
4748
|
-
return /* @__PURE__ */ (0,
|
|
5058
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(PageButton, { page, children: page }, page);
|
|
4749
5059
|
}),
|
|
4750
|
-
/* @__PURE__ */ (0,
|
|
5060
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
4751
5061
|
NavigationButton,
|
|
4752
5062
|
{
|
|
4753
5063
|
page: activePageNumber + 1,
|
|
4754
5064
|
disabled: activePageNumber === totalPages,
|
|
4755
5065
|
children: [
|
|
4756
|
-
/* @__PURE__ */ (0,
|
|
4757
|
-
/* @__PURE__ */ (0,
|
|
5066
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "text-sm", children: "Next" }),
|
|
5067
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Icon_default, { name: "chevronRight", className: "w-4 h-4 ml-1" }) })
|
|
4758
5068
|
]
|
|
4759
5069
|
}
|
|
4760
5070
|
)
|
|
4761
5071
|
] }),
|
|
4762
|
-
showJumpToPage && totalPages > 5 && /* @__PURE__ */ (0,
|
|
4763
|
-
/* @__PURE__ */ (0,
|
|
4764
|
-
/* @__PURE__ */ (0,
|
|
5072
|
+
showJumpToPage && totalPages > 5 && /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex items-center space-x-2", children: [
|
|
5073
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "text-sm", children: "Go to:" }),
|
|
5074
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
4765
5075
|
"input",
|
|
4766
5076
|
{
|
|
4767
5077
|
type: "number",
|
|
@@ -4782,9 +5092,9 @@ var Pagination = (props) => {
|
|
|
4782
5092
|
) })
|
|
4783
5093
|
] })
|
|
4784
5094
|
] }),
|
|
4785
|
-
showPageSizeSelector && /* @__PURE__ */ (0,
|
|
4786
|
-
/* @__PURE__ */ (0,
|
|
4787
|
-
/* @__PURE__ */ (0,
|
|
5095
|
+
showPageSizeSelector && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "mt-4 pt-4 border-t bg-default", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex items-center justify-center space-x-2", children: [
|
|
5096
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "text-sm", children: "Show:" }),
|
|
5097
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "flex space-x-1", children: [10, 25, 50, 100].map((size) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
4788
5098
|
Hyperlink,
|
|
4789
5099
|
{
|
|
4790
5100
|
className: `
|
|
@@ -4796,16 +5106,16 @@ var Pagination = (props) => {
|
|
|
4796
5106
|
},
|
|
4797
5107
|
size
|
|
4798
5108
|
)) }),
|
|
4799
|
-
/* @__PURE__ */ (0,
|
|
5109
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "text-sm", children: "per page" })
|
|
4800
5110
|
] }) })
|
|
4801
5111
|
] });
|
|
4802
5112
|
};
|
|
4803
5113
|
var Pagination_default = Pagination;
|
|
4804
5114
|
|
|
4805
5115
|
// src/components/pageRenderingEngine/nodes/ImageGalleryNode.tsx
|
|
4806
|
-
var
|
|
4807
|
-
var
|
|
4808
|
-
var HlsPlayer1 = (0,
|
|
5116
|
+
var import_dynamic5 = __toESM(require("next/dynamic"));
|
|
5117
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
5118
|
+
var HlsPlayer1 = (0, import_dynamic5.default)(() => Promise.resolve().then(() => (init_HlsPlayer(), HlsPlayer_exports)), {
|
|
4809
5119
|
ssr: false
|
|
4810
5120
|
});
|
|
4811
5121
|
var parseMaybeNumber = (value) => {
|
|
@@ -4841,7 +5151,7 @@ var ImageGalleryNode = (props) => {
|
|
|
4841
5151
|
right: "justify-end"
|
|
4842
5152
|
};
|
|
4843
5153
|
const formatClasses = FormatClass[props.node.format || ""] || "";
|
|
4844
|
-
return /* @__PURE__ */ (0,
|
|
5154
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: `flex flex-wrap gap-4 ${formatClasses}`, children: visibleImages.map((img, idx) => {
|
|
4845
5155
|
const imageUrl = resolveImageUrl(img.imageUrl);
|
|
4846
5156
|
if (!imageUrl) return null;
|
|
4847
5157
|
const posterUrl = resolvePosterUrl(img.posterUrl);
|
|
@@ -4849,7 +5159,7 @@ var ImageGalleryNode = (props) => {
|
|
|
4849
5159
|
const intrinsicHeight = parseMaybeNumber(img.intrinsicHeight);
|
|
4850
5160
|
const isHls = imageUrl.endsWith(".m3u8");
|
|
4851
5161
|
const alt = img.title || "Gallery image";
|
|
4852
|
-
return /* @__PURE__ */ (0,
|
|
5162
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "max-w-full", children: isHls ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
4853
5163
|
HlsPlayer1,
|
|
4854
5164
|
{
|
|
4855
5165
|
assetUrl: imageUrl,
|
|
@@ -4864,7 +5174,7 @@ var ImageGalleryNode = (props) => {
|
|
|
4864
5174
|
}
|
|
4865
5175
|
) : (
|
|
4866
5176
|
/* eslint-disable-next-line @next/next/no-img-element */
|
|
4867
|
-
/* @__PURE__ */ (0,
|
|
5177
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
4868
5178
|
"img",
|
|
4869
5179
|
{
|
|
4870
5180
|
loading: "lazy",
|
|
@@ -4881,8 +5191,8 @@ var ImageGalleryNode = (props) => {
|
|
|
4881
5191
|
var ImageGalleryNode_default = ImageGalleryNode;
|
|
4882
5192
|
|
|
4883
5193
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
4884
|
-
var
|
|
4885
|
-
var
|
|
5194
|
+
var import_link2 = __toESM(require("next/link"));
|
|
5195
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
4886
5196
|
function toCamelCase(str) {
|
|
4887
5197
|
return str.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
4888
5198
|
}
|
|
@@ -5065,7 +5375,7 @@ var DivContainer = async (props) => {
|
|
|
5065
5375
|
response = await serviceClient.get(endpoint);
|
|
5066
5376
|
result = response?.result;
|
|
5067
5377
|
if (dataBindingProperties.showNoResultsMessage && (result === void 0 || result.length == 0)) {
|
|
5068
|
-
return /* @__PURE__ */ (0,
|
|
5378
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(NoDataFound_default, {});
|
|
5069
5379
|
}
|
|
5070
5380
|
if (dataBindingProperties.childCollectionName && props.dataitem) {
|
|
5071
5381
|
childCollectionData = getNestedValue2(props.dataitem, dataBindingProperties.childCollectionName);
|
|
@@ -5077,7 +5387,7 @@ var DivContainer = async (props) => {
|
|
|
5077
5387
|
}
|
|
5078
5388
|
const SelectedNode = NodeTypes2[node.type];
|
|
5079
5389
|
if (!SelectedNode) return null;
|
|
5080
|
-
return /* @__PURE__ */ (0,
|
|
5390
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_react49.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5081
5391
|
SelectedNode,
|
|
5082
5392
|
{
|
|
5083
5393
|
node,
|
|
@@ -5145,7 +5455,7 @@ var DivContainer = async (props) => {
|
|
|
5145
5455
|
wrapperProps = { ...props.node.componentProperties, "slidesToShow": slidesToShow };
|
|
5146
5456
|
break;
|
|
5147
5457
|
case !!(props.node.href || props.href):
|
|
5148
|
-
Wrapper =
|
|
5458
|
+
Wrapper = import_link2.default;
|
|
5149
5459
|
let href = props.node.href || props.href;
|
|
5150
5460
|
if (href?.includes("{")) {
|
|
5151
5461
|
href = resolveHrefTemplate(href, props.dataitem);
|
|
@@ -5177,9 +5487,9 @@ var DivContainer = async (props) => {
|
|
|
5177
5487
|
props.node.autoFormat && "auto-format",
|
|
5178
5488
|
props.node.bgClass
|
|
5179
5489
|
].filter(Boolean).join(" ");
|
|
5180
|
-
return /* @__PURE__ */ (0,
|
|
5181
|
-
/* @__PURE__ */ (0,
|
|
5182
|
-
/* @__PURE__ */ (0,
|
|
5490
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_react49.default.Fragment, { children: [
|
|
5491
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("style", { dangerouslySetInnerHTML: { __html: cssResult.css + animationCSS } }),
|
|
5492
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_react49.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5183
5493
|
Wrapper,
|
|
5184
5494
|
{
|
|
5185
5495
|
id: guid,
|
|
@@ -5188,18 +5498,18 @@ var DivContainer = async (props) => {
|
|
|
5188
5498
|
...wrapperProps,
|
|
5189
5499
|
children: dataToRender.map(
|
|
5190
5500
|
(item, idx) => item?.links?.view && renderLink ? renderChildren(props.node.children, props, item, idx, props.href ? void 0 : item?.links?.view)?.map(
|
|
5191
|
-
(child, i) => /* @__PURE__ */ (0,
|
|
5501
|
+
(child, i) => /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_react49.default.Fragment, { children: child }, i)
|
|
5192
5502
|
) : renderChildren(props.node.children, props, item, idx)
|
|
5193
5503
|
)
|
|
5194
5504
|
}
|
|
5195
5505
|
) }),
|
|
5196
|
-
dataBindingProperties && props.node.dataBinding.enablePagination && /* @__PURE__ */ (0,
|
|
5506
|
+
dataBindingProperties && props.node.dataBinding.enablePagination && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Pagination_default, { path: props.path, query: props.query, dataset: response }) })
|
|
5197
5507
|
] });
|
|
5198
5508
|
};
|
|
5199
5509
|
var DivContainer_default = DivContainer;
|
|
5200
5510
|
|
|
5201
5511
|
// src/components/pageRenderingEngine/PageBodyRenderer.tsx
|
|
5202
|
-
var
|
|
5512
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
5203
5513
|
var NodeTypes = {
|
|
5204
5514
|
["paragraph"]: ParagraphNode_default,
|
|
5205
5515
|
["heading"]: HeadingNode_default,
|
|
@@ -5227,11 +5537,11 @@ var PageBodyRenderer = (props) => {
|
|
|
5227
5537
|
if (pageBodyTree && pageBodyTree.root) {
|
|
5228
5538
|
rootNode = pageBodyTree.root;
|
|
5229
5539
|
}
|
|
5230
|
-
return /* @__PURE__ */ (0,
|
|
5540
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react50.default.Fragment, { children: rootNode && rootNode?.children?.map((node, index) => {
|
|
5231
5541
|
{
|
|
5232
5542
|
}
|
|
5233
5543
|
const SelectedNode = NodeTypes[node.type];
|
|
5234
|
-
return /* @__PURE__ */ (0,
|
|
5544
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react50.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react50.default.Fragment, { children: node.type == "layout-container" ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react50.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5235
5545
|
SelectedNode,
|
|
5236
5546
|
{
|
|
5237
5547
|
node,
|
|
@@ -5246,7 +5556,7 @@ var PageBodyRenderer = (props) => {
|
|
|
5246
5556
|
assetBaseUrl: props.assetBaseUrl,
|
|
5247
5557
|
device: props.device
|
|
5248
5558
|
}
|
|
5249
|
-
) }) : /* @__PURE__ */ (0,
|
|
5559
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react50.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5250
5560
|
SelectedNode,
|
|
5251
5561
|
{
|
|
5252
5562
|
node,
|