@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260324172014 → 0.8.1-dev.20260325084305

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.
@@ -0,0 +1,55 @@
1
+ "use client";
2
+
3
+ // src/components/CopyButton.tsx
4
+ import { useState, useRef, useEffect } from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ function CopyButton({ text }) {
7
+ const [copied, setCopied] = useState(false);
8
+ const timeoutRef = useRef(null);
9
+ useEffect(() => {
10
+ return () => {
11
+ if (timeoutRef.current) clearTimeout(timeoutRef.current);
12
+ };
13
+ }, []);
14
+ const handleCopy = async () => {
15
+ try {
16
+ await navigator.clipboard.writeText(text);
17
+ setCopied(true);
18
+ if (timeoutRef.current) clearTimeout(timeoutRef.current);
19
+ timeoutRef.current = setTimeout(() => setCopied(false), 2e3);
20
+ } catch (err) {
21
+ console.error("Failed to copy: ", err);
22
+ }
23
+ };
24
+ return /* @__PURE__ */ jsxs(
25
+ "button",
26
+ {
27
+ onClick: handleCopy,
28
+ className: "flex gap-1 items-center hover:text-white transition",
29
+ children: [
30
+ /* @__PURE__ */ jsx(
31
+ "svg",
32
+ {
33
+ width: "16",
34
+ height: "16",
35
+ viewBox: "0 0 24 24",
36
+ className: "w-4 h-4",
37
+ fill: "currentColor",
38
+ children: /* @__PURE__ */ jsx(
39
+ "path",
40
+ {
41
+ fillRule: "evenodd",
42
+ clipRule: "evenodd",
43
+ 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"
44
+ }
45
+ )
46
+ }
47
+ ),
48
+ copied ? "Copied!" : "Copy code"
49
+ ]
50
+ }
51
+ );
52
+ }
53
+ export {
54
+ CopyButton as default
55
+ };
@@ -0,0 +1,96 @@
1
+ "use client";
2
+
3
+ // src/components/pageRenderingEngine/nodes/IframeClient.tsx
4
+ import React2, { useEffect, useRef, useState } from "react";
5
+
6
+ // src/components/IFrameLoaderView.tsx
7
+ import React from "react";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
9
+ var IFrameLoaderView = (props) => {
10
+ return /* @__PURE__ */ jsxs(React.Fragment, { children: [
11
+ props.isDataFound == null && /* @__PURE__ */ jsx("div", { className: "", children: /* @__PURE__ */ jsxs("div", { className: "mt-4 bg-gray-200 rounded-md p-4 animate-pulse", children: [
12
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center mb-4", children: [
13
+ /* @__PURE__ */ jsx("div", { className: "bg-gray-300 h-8 w-8 rounded-full animate-pulse" }),
14
+ /* @__PURE__ */ jsxs("div", { className: "ml-2", children: [
15
+ /* @__PURE__ */ jsx("div", { className: "bg-gray-300 h-3 w-16 animate-pulse" }),
16
+ /* @__PURE__ */ jsx("div", { className: "bg-gray-300 h-2 w-12 animate-pulse" })
17
+ ] })
18
+ ] }),
19
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-3 gap-4 mt-6", children: [
20
+ /* @__PURE__ */ jsxs("div", { className: "animate-pulse", children: [
21
+ /* @__PURE__ */ jsx("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
22
+ /* @__PURE__ */ jsx("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
23
+ /* @__PURE__ */ jsx("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
24
+ /* @__PURE__ */ jsx("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
25
+ /* @__PURE__ */ jsx("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
26
+ ] }),
27
+ /* @__PURE__ */ jsxs("div", { className: "animate-pulse", children: [
28
+ /* @__PURE__ */ jsx("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
29
+ /* @__PURE__ */ jsx("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
30
+ /* @__PURE__ */ jsx("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
31
+ /* @__PURE__ */ jsx("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
32
+ /* @__PURE__ */ jsx("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
33
+ ] }),
34
+ /* @__PURE__ */ jsxs("div", { className: "animate-pulse", children: [
35
+ /* @__PURE__ */ jsx("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
36
+ /* @__PURE__ */ jsx("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
37
+ /* @__PURE__ */ jsx("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
38
+ /* @__PURE__ */ jsx("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
39
+ /* @__PURE__ */ jsx("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
40
+ ] })
41
+ ] })
42
+ ] }) }),
43
+ props.children
44
+ ] });
45
+ };
46
+ var IFrameLoaderView_default = IFrameLoaderView;
47
+
48
+ // src/components/pageRenderingEngine/nodes/IframeClient.tsx
49
+ import { jsx as jsx2 } from "react/jsx-runtime";
50
+ var IframeClient = ({ src }) => {
51
+ const iframeRef = useRef(null);
52
+ const [iframeHeight, setIframeHeight] = useState("100%");
53
+ const [isDataFound, setIsDataFound] = useState(null);
54
+ useEffect(() => {
55
+ const handleReceiveMessage = (event) => {
56
+ const eventName = event?.data?.eventName;
57
+ const payload = event?.data?.payload;
58
+ if (eventName === "SET_HEIGHT" && payload?.height) {
59
+ let height = 500;
60
+ if (payload.height > 500) {
61
+ height = payload.height + 50;
62
+ }
63
+ setIframeHeight(`${height}px`);
64
+ }
65
+ };
66
+ window.addEventListener("message", handleReceiveMessage);
67
+ return () => window.removeEventListener("message", handleReceiveMessage);
68
+ }, []);
69
+ useEffect(() => {
70
+ const handleResize = () => {
71
+ if (iframeRef.current) {
72
+ iframeRef.current.contentWindow?.postMessage({ eventName: "RESIZE" }, "*");
73
+ }
74
+ };
75
+ window.addEventListener("resize", handleResize);
76
+ return () => window.removeEventListener("resize", handleResize);
77
+ }, []);
78
+ const handleIframeLoad = () => {
79
+ setIsDataFound(true);
80
+ };
81
+ return /* @__PURE__ */ jsx2(React2.Fragment, { children: /* @__PURE__ */ jsx2(IFrameLoaderView_default, { isDataFound, children: /* @__PURE__ */ jsx2(
82
+ "iframe",
83
+ {
84
+ ref: iframeRef,
85
+ src,
86
+ className: "w-full h-full border-none",
87
+ scrolling: "no",
88
+ style: { height: iframeHeight },
89
+ onLoad: handleIframeLoad
90
+ }
91
+ ) }) });
92
+ };
93
+ var IframeClient_default = IframeClient;
94
+ export {
95
+ IframeClient_default as default
96
+ };
package/dist/index.js CHANGED
@@ -5,6 +5,9 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __esm = (fn, res) => function __init() {
9
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
10
+ };
8
11
  var __export = (target, all) => {
9
12
  for (var name in all)
10
13
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -27,6 +30,176 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
27
30
  ));
28
31
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
32
 
33
+ // src/components/CopyButton.tsx
34
+ var CopyButton_exports = {};
35
+ __export(CopyButton_exports, {
36
+ default: () => CopyButton
37
+ });
38
+ function CopyButton({ text }) {
39
+ const [copied, setCopied] = (0, import_react41.useState)(false);
40
+ const timeoutRef = (0, import_react41.useRef)(null);
41
+ (0, import_react41.useEffect)(() => {
42
+ return () => {
43
+ if (timeoutRef.current) clearTimeout(timeoutRef.current);
44
+ };
45
+ }, []);
46
+ const handleCopy = async () => {
47
+ try {
48
+ await navigator.clipboard.writeText(text);
49
+ setCopied(true);
50
+ if (timeoutRef.current) clearTimeout(timeoutRef.current);
51
+ timeoutRef.current = setTimeout(() => setCopied(false), 2e3);
52
+ } catch (err) {
53
+ console.error("Failed to copy: ", err);
54
+ }
55
+ };
56
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
57
+ "button",
58
+ {
59
+ onClick: handleCopy,
60
+ className: "flex gap-1 items-center hover:text-white transition",
61
+ children: [
62
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
63
+ "svg",
64
+ {
65
+ width: "16",
66
+ height: "16",
67
+ viewBox: "0 0 24 24",
68
+ className: "w-4 h-4",
69
+ fill: "currentColor",
70
+ children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
71
+ "path",
72
+ {
73
+ fillRule: "evenodd",
74
+ clipRule: "evenodd",
75
+ 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"
76
+ }
77
+ )
78
+ }
79
+ ),
80
+ copied ? "Copied!" : "Copy code"
81
+ ]
82
+ }
83
+ );
84
+ }
85
+ var import_react41, import_jsx_runtime52;
86
+ var init_CopyButton = __esm({
87
+ "src/components/CopyButton.tsx"() {
88
+ "use strict";
89
+ "use client";
90
+ import_react41 = require("react");
91
+ import_jsx_runtime52 = require("react/jsx-runtime");
92
+ }
93
+ });
94
+
95
+ // src/components/IFrameLoaderView.tsx
96
+ var import_react46, import_jsx_runtime61, IFrameLoaderView, IFrameLoaderView_default;
97
+ var init_IFrameLoaderView = __esm({
98
+ "src/components/IFrameLoaderView.tsx"() {
99
+ "use strict";
100
+ import_react46 = __toESM(require("react"));
101
+ import_jsx_runtime61 = require("react/jsx-runtime");
102
+ IFrameLoaderView = (props) => {
103
+ return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_react46.default.Fragment, { children: [
104
+ 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: [
105
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex items-center mb-4", children: [
106
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 h-8 w-8 rounded-full animate-pulse" }),
107
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "ml-2", children: [
108
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 h-3 w-16 animate-pulse" }),
109
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 h-2 w-12 animate-pulse" })
110
+ ] })
111
+ ] }),
112
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "grid grid-cols-3 gap-4 mt-6", children: [
113
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "animate-pulse", children: [
114
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
115
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
116
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
117
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
118
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
119
+ ] }),
120
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "animate-pulse", children: [
121
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
122
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
123
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
124
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
125
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
126
+ ] }),
127
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "animate-pulse", children: [
128
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
129
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
130
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
131
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
132
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
133
+ ] })
134
+ ] })
135
+ ] }) }),
136
+ props.children
137
+ ] });
138
+ };
139
+ IFrameLoaderView_default = IFrameLoaderView;
140
+ }
141
+ });
142
+
143
+ // src/components/pageRenderingEngine/nodes/IframeClient.tsx
144
+ var IframeClient_exports = {};
145
+ __export(IframeClient_exports, {
146
+ default: () => IframeClient_default
147
+ });
148
+ var import_react47, import_jsx_runtime62, IframeClient, IframeClient_default;
149
+ var init_IframeClient = __esm({
150
+ "src/components/pageRenderingEngine/nodes/IframeClient.tsx"() {
151
+ "use strict";
152
+ "use client";
153
+ import_react47 = __toESM(require("react"));
154
+ init_IFrameLoaderView();
155
+ import_jsx_runtime62 = require("react/jsx-runtime");
156
+ IframeClient = ({ src }) => {
157
+ const iframeRef = (0, import_react47.useRef)(null);
158
+ const [iframeHeight, setIframeHeight] = (0, import_react47.useState)("100%");
159
+ const [isDataFound, setIsDataFound] = (0, import_react47.useState)(null);
160
+ (0, import_react47.useEffect)(() => {
161
+ const handleReceiveMessage = (event) => {
162
+ const eventName = event?.data?.eventName;
163
+ const payload = event?.data?.payload;
164
+ if (eventName === "SET_HEIGHT" && payload?.height) {
165
+ let height = 500;
166
+ if (payload.height > 500) {
167
+ height = payload.height + 50;
168
+ }
169
+ setIframeHeight(`${height}px`);
170
+ }
171
+ };
172
+ window.addEventListener("message", handleReceiveMessage);
173
+ return () => window.removeEventListener("message", handleReceiveMessage);
174
+ }, []);
175
+ (0, import_react47.useEffect)(() => {
176
+ const handleResize = () => {
177
+ if (iframeRef.current) {
178
+ iframeRef.current.contentWindow?.postMessage({ eventName: "RESIZE" }, "*");
179
+ }
180
+ };
181
+ window.addEventListener("resize", handleResize);
182
+ return () => window.removeEventListener("resize", handleResize);
183
+ }, []);
184
+ const handleIframeLoad = () => {
185
+ setIsDataFound(true);
186
+ };
187
+ return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_react47.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(IFrameLoaderView_default, { isDataFound, children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
188
+ "iframe",
189
+ {
190
+ ref: iframeRef,
191
+ src,
192
+ className: "w-full h-full border-none",
193
+ scrolling: "no",
194
+ style: { height: iframeHeight },
195
+ onLoad: handleIframeLoad
196
+ }
197
+ ) }) });
198
+ };
199
+ IframeClient_default = IframeClient;
200
+ }
201
+ });
202
+
30
203
  // src/index.ts
31
204
  var index_exports = {};
32
205
  __export(index_exports, {
@@ -2878,6 +3051,7 @@ var HeadingNode = (props) => {
2878
3051
  ["text"]: TextNode_default,
2879
3052
  ["link"]: LinkNode_default,
2880
3053
  ["svg-icon"]: SVGIconNode_default,
3054
+ ["linebreak"]: LineBreakNode_default,
2881
3055
  ["datafield"]: DatafieldNode_default
2882
3056
  };
2883
3057
  const HeadingTag = `${props.node.tag}`;
@@ -2974,67 +3148,18 @@ var QuoteNode_default = QuoteNode;
2974
3148
 
2975
3149
  // src/components/pageRenderingEngine/nodes/CodeNode.tsx
2976
3150
  var import_react42 = __toESM(require("react"));
2977
-
2978
- // src/components/CopyButton.tsx
2979
- var import_react41 = require("react");
2980
- var import_jsx_runtime52 = require("react/jsx-runtime");
2981
- function CopyButton({ text }) {
2982
- const [copied, setCopied] = (0, import_react41.useState)(false);
2983
- const timeoutRef = (0, import_react41.useRef)(null);
2984
- (0, import_react41.useEffect)(() => {
2985
- return () => {
2986
- if (timeoutRef.current) clearTimeout(timeoutRef.current);
2987
- };
2988
- }, []);
2989
- const handleCopy = async () => {
2990
- try {
2991
- await navigator.clipboard.writeText(text);
2992
- setCopied(true);
2993
- if (timeoutRef.current) clearTimeout(timeoutRef.current);
2994
- timeoutRef.current = setTimeout(() => setCopied(false), 2e3);
2995
- } catch (err) {
2996
- console.error("Failed to copy: ", err);
2997
- }
2998
- };
2999
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
3000
- "button",
3001
- {
3002
- onClick: handleCopy,
3003
- className: "flex gap-1 items-center hover:text-white transition",
3004
- children: [
3005
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
3006
- "svg",
3007
- {
3008
- width: "16",
3009
- height: "16",
3010
- viewBox: "0 0 24 24",
3011
- className: "w-4 h-4",
3012
- fill: "currentColor",
3013
- children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
3014
- "path",
3015
- {
3016
- fillRule: "evenodd",
3017
- clipRule: "evenodd",
3018
- 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"
3019
- }
3020
- )
3021
- }
3022
- ),
3023
- copied ? "Copied!" : "Copy code"
3024
- ]
3025
- }
3026
- );
3027
- }
3028
-
3029
- // src/components/pageRenderingEngine/nodes/CodeNode.tsx
3151
+ var import_dynamic = __toESM(require("next/dynamic"));
3030
3152
  var import_jsx_runtime53 = require("react/jsx-runtime");
3153
+ var CopyButton2 = (0, import_dynamic.default)(() => Promise.resolve().then(() => (init_CopyButton(), CopyButton_exports)), {
3154
+ ssr: false,
3155
+ // optional: fallback UI while loading
3156
+ loading: () => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "text-gray-400 text-xs", children: "Copy" })
3157
+ });
3031
3158
  var CodeNode = (props) => {
3032
3159
  const NodeTypes2 = {
3033
- // @ts-expect-error custom code
3034
- ["text"]: TextNode_default,
3035
- ["linebreak"]: LineBreakNode_default,
3036
- // @ts-expect-error custom code
3037
- ["link"]: LinkNode_default
3160
+ text: TextNode_default,
3161
+ linebreak: LineBreakNode_default,
3162
+ link: LinkNode_default
3038
3163
  };
3039
3164
  const textContent = props.node?.children?.map((node) => {
3040
3165
  if (node.type === "text") return node.text || "";
@@ -3045,11 +3170,19 @@ var CodeNode = (props) => {
3045
3170
  return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "code-block", children: [
3046
3171
  /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex items-center relative text-gray-200 bg-gray-800 px-4 py-2.5 text-xs font-sans justify-between rounded-t-md", children: [
3047
3172
  /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { children: "Code Snippet" }),
3048
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(CopyButton, { text: textContent })
3173
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(CopyButton2, { text: textContent })
3049
3174
  ] }),
3050
3175
  /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("code", { className: "block bg-gray-900 text-gray-100 p-4 rounded-b-md text-sm whitespace-pre-wrap", children: props.node.children && props.node.children.map((node, index) => {
3051
3176
  const SelectedNode = NodeTypes2[node.type];
3052
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_react42.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(SelectedNode, { node, session: props.session, apiBaseUrl: props.apiBaseUrl, routeParameters: props.routeParameters }) }, index);
3177
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_react42.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
3178
+ SelectedNode,
3179
+ {
3180
+ node,
3181
+ session: props.session,
3182
+ apiBaseUrl: props.apiBaseUrl,
3183
+ routeParameters: props.routeParameters
3184
+ }
3185
+ ) }, index);
3053
3186
  }) })
3054
3187
  ] });
3055
3188
  };
@@ -3826,100 +3959,12 @@ var FormContainerNode_default = FormContainerNode;
3826
3959
  // src/components/pageRenderingEngine/nodes/DivContainer.tsx
3827
3960
  var import_react50 = __toESM(require("react"));
3828
3961
 
3829
- // src/components/pageRenderingEngine/nodes/IframeClient.tsx
3830
- var import_react47 = __toESM(require("react"));
3831
-
3832
- // src/components/IFrameLoaderView.tsx
3833
- var import_react46 = __toESM(require("react"));
3834
- var import_jsx_runtime61 = require("react/jsx-runtime");
3835
- var IFrameLoaderView = (props) => {
3836
- return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_react46.default.Fragment, { children: [
3837
- 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: [
3838
- /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex items-center mb-4", children: [
3839
- /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 h-8 w-8 rounded-full animate-pulse" }),
3840
- /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "ml-2", children: [
3841
- /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 h-3 w-16 animate-pulse" }),
3842
- /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 h-2 w-12 animate-pulse" })
3843
- ] })
3844
- ] }),
3845
- /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "grid grid-cols-3 gap-4 mt-6", children: [
3846
- /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "animate-pulse", children: [
3847
- /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
3848
- /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
3849
- /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
3850
- /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
3851
- /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
3852
- ] }),
3853
- /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "animate-pulse", children: [
3854
- /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
3855
- /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
3856
- /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
3857
- /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
3858
- /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
3859
- ] }),
3860
- /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "animate-pulse", children: [
3861
- /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
3862
- /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
3863
- /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
3864
- /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
3865
- /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
3866
- ] })
3867
- ] })
3868
- ] }) }),
3869
- props.children
3870
- ] });
3871
- };
3872
- var IFrameLoaderView_default = IFrameLoaderView;
3873
-
3874
- // src/components/pageRenderingEngine/nodes/IframeClient.tsx
3875
- var import_jsx_runtime62 = require("react/jsx-runtime");
3876
- var IframeClient = ({ src }) => {
3877
- const iframeRef = (0, import_react47.useRef)(null);
3878
- const [iframeHeight, setIframeHeight] = (0, import_react47.useState)("100%");
3879
- const [isDataFound, setIsDataFound] = (0, import_react47.useState)(null);
3880
- (0, import_react47.useEffect)(() => {
3881
- const handleReceiveMessage = (event) => {
3882
- const eventName = event?.data?.eventName;
3883
- const payload = event?.data?.payload;
3884
- if (eventName === "SET_HEIGHT" && payload?.height) {
3885
- let height = 500;
3886
- if (payload.height > 500) {
3887
- height = payload.height + 50;
3888
- }
3889
- setIframeHeight(`${height}px`);
3890
- }
3891
- };
3892
- window.addEventListener("message", handleReceiveMessage);
3893
- return () => window.removeEventListener("message", handleReceiveMessage);
3894
- }, []);
3895
- (0, import_react47.useEffect)(() => {
3896
- const handleResize = () => {
3897
- if (iframeRef.current) {
3898
- iframeRef.current.contentWindow?.postMessage({ eventName: "RESIZE" }, "*");
3899
- }
3900
- };
3901
- window.addEventListener("resize", handleResize);
3902
- return () => window.removeEventListener("resize", handleResize);
3903
- }, []);
3904
- const handleIframeLoad = () => {
3905
- setIsDataFound(true);
3906
- };
3907
- return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_react47.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(IFrameLoaderView_default, { isDataFound, children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
3908
- "iframe",
3909
- {
3910
- ref: iframeRef,
3911
- src,
3912
- className: "w-full h-full border-none",
3913
- scrolling: "no",
3914
- style: { height: iframeHeight },
3915
- onLoad: handleIframeLoad
3916
- }
3917
- ) }) });
3918
- };
3919
- var IframeClient_default = IframeClient;
3920
-
3921
3962
  // src/components/pageRenderingEngine/nodes/EmbedNode.tsx
3963
+ var import_dynamic2 = __toESM(require("next/dynamic"));
3922
3964
  var import_jsx_runtime63 = require("react/jsx-runtime");
3965
+ var IframeClient2 = (0, import_dynamic2.default)(() => Promise.resolve().then(() => (init_IframeClient(), IframeClient_exports)), {
3966
+ ssr: false
3967
+ });
3923
3968
  var EmbedNode = (props) => {
3924
3969
  let src;
3925
3970
  if (props.node.provider == "youtube") {
@@ -3929,7 +3974,7 @@ var EmbedNode = (props) => {
3929
3974
  } else {
3930
3975
  src = props.node.embedSrc;
3931
3976
  }
3932
- return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "aspect-video", children: src && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(IframeClient_default, { src }) });
3977
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "aspect-video", children: src && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(IframeClient2, { src }) });
3933
3978
  };
3934
3979
  var EmbedNode_default = EmbedNode;
3935
3980