@encatch/ws-react 0.0.13 → 0.0.15
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/ws-react.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import C, { useState as $, useEffect as U, useCallback as ne } from "react";
|
|
2
|
-
var
|
|
2
|
+
var k = { exports: {} }, h = {};
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
5
5
|
* react-jsx-runtime.production.js
|
|
@@ -14,24 +14,24 @@ function oe() {
|
|
|
14
14
|
if (q) return h;
|
|
15
15
|
q = 1;
|
|
16
16
|
var t = Symbol.for("react.transitional.element"), l = Symbol.for("react.fragment");
|
|
17
|
-
function f(d, c,
|
|
17
|
+
function f(d, c, u) {
|
|
18
18
|
var m = null;
|
|
19
|
-
if (
|
|
20
|
-
|
|
21
|
-
for (var
|
|
22
|
-
|
|
23
|
-
} else
|
|
24
|
-
return c =
|
|
19
|
+
if (u !== void 0 && (m = "" + u), c.key !== void 0 && (m = "" + c.key), "key" in c) {
|
|
20
|
+
u = {};
|
|
21
|
+
for (var R in c)
|
|
22
|
+
R !== "key" && (u[R] = c[R]);
|
|
23
|
+
} else u = c;
|
|
24
|
+
return c = u.ref, {
|
|
25
25
|
$$typeof: t,
|
|
26
26
|
type: d,
|
|
27
27
|
key: m,
|
|
28
28
|
ref: c !== void 0 ? c : null,
|
|
29
|
-
props:
|
|
29
|
+
props: u
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
return h.Fragment = l, h.jsx = f, h.jsxs = f, h;
|
|
33
33
|
}
|
|
34
|
-
var
|
|
34
|
+
var g = {};
|
|
35
35
|
/**
|
|
36
36
|
* @license React
|
|
37
37
|
* react-jsx-runtime.development.js
|
|
@@ -60,7 +60,7 @@ function ae() {
|
|
|
60
60
|
return "Suspense";
|
|
61
61
|
case Q:
|
|
62
62
|
return "SuspenseList";
|
|
63
|
-
case
|
|
63
|
+
case D:
|
|
64
64
|
return "Activity";
|
|
65
65
|
}
|
|
66
66
|
if (typeof e == "object")
|
|
@@ -76,7 +76,7 @@ function ae() {
|
|
|
76
76
|
case H:
|
|
77
77
|
var r = e.render;
|
|
78
78
|
return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
79
|
-
case
|
|
79
|
+
case K:
|
|
80
80
|
return r = e.displayName || null, r !== null ? r : t(e.type) || "Memo";
|
|
81
81
|
case x:
|
|
82
82
|
r = e._payload, e = e._init;
|
|
@@ -119,10 +119,10 @@ function ae() {
|
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
function c() {
|
|
122
|
-
var e =
|
|
122
|
+
var e = S.A;
|
|
123
123
|
return e === null ? null : e.getOwner();
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function u() {
|
|
126
126
|
return Error("react-stack-top-frame");
|
|
127
127
|
}
|
|
128
128
|
function m(e) {
|
|
@@ -132,7 +132,7 @@ function ae() {
|
|
|
132
132
|
}
|
|
133
133
|
return e.key !== void 0;
|
|
134
134
|
}
|
|
135
|
-
function
|
|
135
|
+
function R(e, r) {
|
|
136
136
|
function o() {
|
|
137
137
|
I || (I = !0, console.error(
|
|
138
138
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
@@ -144,22 +144,22 @@ function ae() {
|
|
|
144
144
|
configurable: !0
|
|
145
145
|
});
|
|
146
146
|
}
|
|
147
|
-
function
|
|
147
|
+
function p() {
|
|
148
148
|
var e = t(this.type);
|
|
149
149
|
return Y[e] || (Y[e] = !0, console.error(
|
|
150
150
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
151
151
|
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
152
152
|
}
|
|
153
|
-
function
|
|
154
|
-
return o =
|
|
153
|
+
function v(e, r, o, a, E, i, O, A) {
|
|
154
|
+
return o = i.ref, e = {
|
|
155
155
|
$$typeof: j,
|
|
156
156
|
type: e,
|
|
157
157
|
key: r,
|
|
158
|
-
props:
|
|
158
|
+
props: i,
|
|
159
159
|
_owner: E
|
|
160
160
|
}, (o !== void 0 ? o : null) !== null ? Object.defineProperty(e, "ref", {
|
|
161
161
|
enumerable: !1,
|
|
162
|
-
get:
|
|
162
|
+
get: p
|
|
163
163
|
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
164
164
|
configurable: !1,
|
|
165
165
|
enumerable: !1,
|
|
@@ -182,7 +182,7 @@ function ae() {
|
|
|
182
182
|
value: A
|
|
183
183
|
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
184
184
|
}
|
|
185
|
-
function
|
|
185
|
+
function T(e, r, o, a, E, i, O, A) {
|
|
186
186
|
var s = r.children;
|
|
187
187
|
if (s !== void 0)
|
|
188
188
|
if (a)
|
|
@@ -218,13 +218,13 @@ React keys must be passed directly to JSX without using spread:
|
|
|
218
218
|
for (var y in r)
|
|
219
219
|
y !== "key" && (o[y] = r[y]);
|
|
220
220
|
} else o = r;
|
|
221
|
-
return s &&
|
|
221
|
+
return s && R(
|
|
222
222
|
o,
|
|
223
223
|
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
224
|
-
),
|
|
224
|
+
), v(
|
|
225
225
|
e,
|
|
226
226
|
s,
|
|
227
|
-
|
|
227
|
+
i,
|
|
228
228
|
E,
|
|
229
229
|
c(),
|
|
230
230
|
o,
|
|
@@ -235,7 +235,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
235
235
|
function n(e) {
|
|
236
236
|
typeof e == "object" && e !== null && e.$$typeof === j && e._store && (e._store.validated = 1);
|
|
237
237
|
}
|
|
238
|
-
var b = C, j = Symbol.for("react.transitional.element"), z = Symbol.for("react.portal"), P = Symbol.for("react.fragment"), V = Symbol.for("react.strict_mode"), G = Symbol.for("react.profiler"), X = Symbol.for("react.consumer"), B = Symbol.for("react.context"), H = Symbol.for("react.forward_ref"), Z = Symbol.for("react.suspense"), Q = Symbol.for("react.suspense_list"),
|
|
238
|
+
var b = C, j = Symbol.for("react.transitional.element"), z = Symbol.for("react.portal"), P = Symbol.for("react.fragment"), V = Symbol.for("react.strict_mode"), G = Symbol.for("react.profiler"), X = Symbol.for("react.consumer"), B = Symbol.for("react.context"), H = Symbol.for("react.forward_ref"), Z = Symbol.for("react.suspense"), Q = Symbol.for("react.suspense_list"), K = Symbol.for("react.memo"), x = Symbol.for("react.lazy"), D = Symbol.for("react.activity"), ee = Symbol.for("react.client.reference"), S = b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, N = Object.prototype.hasOwnProperty, re = Array.isArray, w = console.createTask ? console.createTask : function() {
|
|
239
239
|
return null;
|
|
240
240
|
};
|
|
241
241
|
b = {
|
|
@@ -243,56 +243,56 @@ React keys must be passed directly to JSX without using spread:
|
|
|
243
243
|
return e();
|
|
244
244
|
}
|
|
245
245
|
};
|
|
246
|
-
var I, Y = {},
|
|
246
|
+
var I, Y = {}, L = b.react_stack_bottom_frame.bind(
|
|
247
247
|
b,
|
|
248
|
-
|
|
249
|
-
)(),
|
|
250
|
-
|
|
251
|
-
var
|
|
252
|
-
return
|
|
248
|
+
u
|
|
249
|
+
)(), M = w(d(u)), F = {};
|
|
250
|
+
g.Fragment = P, g.jsx = function(e, r, o, a, E) {
|
|
251
|
+
var i = 1e4 > S.recentlyCreatedOwnerStacks++;
|
|
252
|
+
return T(
|
|
253
253
|
e,
|
|
254
254
|
r,
|
|
255
255
|
o,
|
|
256
256
|
!1,
|
|
257
257
|
a,
|
|
258
258
|
E,
|
|
259
|
-
|
|
260
|
-
|
|
259
|
+
i ? Error("react-stack-top-frame") : L,
|
|
260
|
+
i ? w(d(e)) : M
|
|
261
261
|
);
|
|
262
|
-
},
|
|
263
|
-
var
|
|
264
|
-
return
|
|
262
|
+
}, g.jsxs = function(e, r, o, a, E) {
|
|
263
|
+
var i = 1e4 > S.recentlyCreatedOwnerStacks++;
|
|
264
|
+
return T(
|
|
265
265
|
e,
|
|
266
266
|
r,
|
|
267
267
|
o,
|
|
268
268
|
!0,
|
|
269
269
|
a,
|
|
270
270
|
E,
|
|
271
|
-
|
|
272
|
-
|
|
271
|
+
i ? Error("react-stack-top-frame") : L,
|
|
272
|
+
i ? w(d(e)) : M
|
|
273
273
|
);
|
|
274
274
|
};
|
|
275
|
-
})()),
|
|
275
|
+
})()), g;
|
|
276
276
|
}
|
|
277
277
|
var J;
|
|
278
278
|
function se() {
|
|
279
|
-
return J || (J = 1, process.env.NODE_ENV === "production" ?
|
|
279
|
+
return J || (J = 1, process.env.NODE_ENV === "production" ? k.exports = oe() : k.exports = ae()), k.exports;
|
|
280
280
|
}
|
|
281
281
|
var ce = se();
|
|
282
|
-
typeof window < "u" && import("./web-form-engine-core.umd-
|
|
282
|
+
typeof window < "u" && import("./web-form-engine-core.umd-B1xHitkx.js").then((t) => t.w).then(({ EncatchAppElement: t }) => {
|
|
283
283
|
try {
|
|
284
284
|
customElements.get("encatch-app") || customElements.define("encatch-app", t);
|
|
285
285
|
} catch (l) {
|
|
286
286
|
console.debug("Custom element registration:", l);
|
|
287
287
|
}
|
|
288
288
|
});
|
|
289
|
-
const
|
|
289
|
+
const ie = ({
|
|
290
290
|
formData: t,
|
|
291
291
|
cssLink: l,
|
|
292
292
|
scale: f = 100,
|
|
293
293
|
persistMode: d = "none"
|
|
294
294
|
}) => {
|
|
295
|
-
const [c,
|
|
295
|
+
const [c, u] = $(!1), [m, R] = $(!0), p = C.useRef(null), v = C.useRef(
|
|
296
296
|
null
|
|
297
297
|
);
|
|
298
298
|
U(() => {
|
|
@@ -302,25 +302,22 @@ const ue = ({
|
|
|
302
302
|
} catch (b) {
|
|
303
303
|
return console.error("[EncatchPreview] Error during data validation:", b), !1;
|
|
304
304
|
}
|
|
305
|
-
})() ? (
|
|
305
|
+
})() ? u(!0) : console.warn(
|
|
306
306
|
"[EncatchPreview] Data validation failed, retrying in 100ms..."
|
|
307
307
|
);
|
|
308
308
|
}, [t]);
|
|
309
|
-
const
|
|
310
|
-
|
|
309
|
+
const T = ne(() => {
|
|
310
|
+
t.onClose && t.onClose(), R(!1);
|
|
311
311
|
}, [t.onClose]);
|
|
312
312
|
return U(() => {
|
|
313
|
-
if (!c || !
|
|
313
|
+
if (!c || !p.current)
|
|
314
314
|
return;
|
|
315
|
-
console.log(
|
|
316
|
-
"[EncatchPreview] Creating web component imperatively with properties"
|
|
317
|
-
);
|
|
318
315
|
const n = document.createElement("encatch-app");
|
|
319
|
-
return n.theme = t.theme, n.currentMode = t.currentMode, n.currentLanguage = t.currentLanguage, n.questions = t.questions, n.questionLanguages = t.questionLanguages, n.otherConfigurationProperties = t.otherConfigurationProperties, n.welcomeScreenProperties = t.welcomeScreenProperties, n.endScreenProperties = t.endScreenProperties, n.translations = t.translations, n.sections = t.sections, n.themeSettings = t.themeSettings, n.onClose =
|
|
320
|
-
|
|
316
|
+
return n.theme = t.theme, n.currentMode = t.currentMode, n.currentLanguage = t.currentLanguage, n.questions = t.questions, n.questionLanguages = t.questionLanguages, n.otherConfigurationProperties = t.otherConfigurationProperties, n.welcomeScreenProperties = t.welcomeScreenProperties, n.endScreenProperties = t.endScreenProperties, n.translations = t.translations, n.sections = t.sections, n.themeSettings = t.themeSettings, n.onClose = T, n.onSectionChange = t.onSectionChange, n.apiKey = t.apiKey, n.hostUrl = t.hostUrl, n.feedbackConfigId = t.feedbackConfigId, n.identifier = t.identifier, n.cssLink = l, n.scale = f, n.persistMode = d, v.current = n, p.current.appendChild(n), () => {
|
|
317
|
+
p.current && v.current && p.current.removeChild(v.current), v.current = null;
|
|
321
318
|
};
|
|
322
|
-
}, [c, t, l, f,
|
|
319
|
+
}, [c, t, l, f, T, d]), m ? /* @__PURE__ */ ce.jsx("div", { ref: p }) : null;
|
|
323
320
|
};
|
|
324
321
|
export {
|
|
325
|
-
|
|
322
|
+
ie as EncatchPreview
|
|
326
323
|
};
|