@olonjs/react 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +84 -0
- package/dist/olonjs-react.js +588 -525
- package/dist/olonjs-react.umd.cjs +11 -11
- package/package.json +3 -3
package/dist/olonjs-react.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import Ie, { Component as
|
|
2
|
-
import { Link as
|
|
3
|
-
import { buildThemeVariableMap as Ye, resolveRuntimeConfig as
|
|
4
|
-
import { buildThemeVariableMap as
|
|
5
|
-
var
|
|
1
|
+
import Ie, { Component as Ce, useContext as ne, createContext as oe, useMemo as K, useState as J, useEffect as $, forwardRef as je, createElement as ce, useRef as he, useLayoutEffect as De } from "react";
|
|
2
|
+
import { Link as Le, createRoutesFromElements as Me, createBrowserRouter as Fe, RouterProvider as $e, ScrollRestoration as Ue, Outlet as ze, useLocation as He, Route as M } from "react-router-dom";
|
|
3
|
+
import { buildThemeVariableMap as Ye, resolveRuntimeConfig as we, normalizeBasePath as Je, ensureWebMcpRuntime as Be, cn as de, shouldRenderSiteGlobalHeader as Ve, resolveSectionMenuItems as Q, STUDIO_EVENTS as L, resolveHeaderMenuItems as We, buildSelectionPath as ge, resolveSlugFromPathname as qe, resolvePageMatchFromRegistry as Ge, resolveCollectionContext as Ke, syncHeadLink as ve, buildPageManifestHref as Xe, buildPageContractHref as Qe, syncWebMcpJsonLd as Ze } from "@olonjs/core";
|
|
4
|
+
import { buildThemeVariableMap as Jt } from "@olonjs/core";
|
|
5
|
+
var Z = { exports: {} }, q = {};
|
|
6
6
|
/**
|
|
7
7
|
* @license React
|
|
8
8
|
* react-jsx-runtime.production.js
|
|
@@ -12,27 +12,27 @@ var K = { exports: {} }, V = {};
|
|
|
12
12
|
* This source code is licensed under the MIT license found in the
|
|
13
13
|
* LICENSE file in the root directory of this source tree.
|
|
14
14
|
*/
|
|
15
|
-
var
|
|
16
|
-
function
|
|
17
|
-
if (
|
|
18
|
-
|
|
15
|
+
var be;
|
|
16
|
+
function et() {
|
|
17
|
+
if (be) return q;
|
|
18
|
+
be = 1;
|
|
19
19
|
var e = Symbol.for("react.transitional.element"), n = Symbol.for("react.fragment");
|
|
20
|
-
function
|
|
21
|
-
var
|
|
22
|
-
if (
|
|
23
|
-
|
|
24
|
-
for (var
|
|
25
|
-
|
|
26
|
-
} else
|
|
27
|
-
return
|
|
20
|
+
function o(a, s, i) {
|
|
21
|
+
var l = null;
|
|
22
|
+
if (i !== void 0 && (l = "" + i), s.key !== void 0 && (l = "" + s.key), "key" in s) {
|
|
23
|
+
i = {};
|
|
24
|
+
for (var v in s)
|
|
25
|
+
v !== "key" && (i[v] = s[v]);
|
|
26
|
+
} else i = s;
|
|
27
|
+
return s = i.ref, {
|
|
28
28
|
$$typeof: e,
|
|
29
29
|
type: a,
|
|
30
|
-
key:
|
|
31
|
-
ref:
|
|
32
|
-
props:
|
|
30
|
+
key: l,
|
|
31
|
+
ref: s !== void 0 ? s : null,
|
|
32
|
+
props: i
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
-
return
|
|
35
|
+
return q.Fragment = n, q.jsx = o, q.jsxs = o, q;
|
|
36
36
|
}
|
|
37
37
|
var G = {};
|
|
38
38
|
/**
|
|
@@ -44,9 +44,9 @@ var G = {};
|
|
|
44
44
|
* This source code is licensed under the MIT license found in the
|
|
45
45
|
* LICENSE file in the root directory of this source tree.
|
|
46
46
|
*/
|
|
47
|
-
var
|
|
48
|
-
function
|
|
49
|
-
return
|
|
47
|
+
var ye;
|
|
48
|
+
function tt() {
|
|
49
|
+
return ye || (ye = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
50
50
|
function e(t) {
|
|
51
51
|
if (t == null) return null;
|
|
52
52
|
if (typeof t == "function")
|
|
@@ -57,34 +57,34 @@ function et() {
|
|
|
57
57
|
return "Fragment";
|
|
58
58
|
case A:
|
|
59
59
|
return "Profiler";
|
|
60
|
-
case
|
|
60
|
+
case C:
|
|
61
61
|
return "StrictMode";
|
|
62
62
|
case w:
|
|
63
63
|
return "Suspense";
|
|
64
64
|
case k:
|
|
65
65
|
return "SuspenseList";
|
|
66
|
-
case
|
|
66
|
+
case I:
|
|
67
67
|
return "Activity";
|
|
68
68
|
}
|
|
69
69
|
if (typeof t == "object")
|
|
70
70
|
switch (typeof t.tag == "number" && console.error(
|
|
71
71
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
72
72
|
), t.$$typeof) {
|
|
73
|
-
case
|
|
73
|
+
case S:
|
|
74
74
|
return "Portal";
|
|
75
75
|
case g:
|
|
76
76
|
return t.displayName || "Context";
|
|
77
|
-
case
|
|
77
|
+
case b:
|
|
78
78
|
return (t._context.displayName || "Context") + ".Consumer";
|
|
79
|
-
case
|
|
80
|
-
var
|
|
81
|
-
return t = t.displayName, t || (t =
|
|
79
|
+
case m:
|
|
80
|
+
var u = t.render;
|
|
81
|
+
return t = t.displayName, t || (t = u.displayName || u.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
|
|
82
82
|
case T:
|
|
83
|
-
return
|
|
83
|
+
return u = t.displayName || null, u !== null ? u : e(t.type) || "Memo";
|
|
84
84
|
case P:
|
|
85
|
-
|
|
85
|
+
u = t._payload, t = t._init;
|
|
86
86
|
try {
|
|
87
|
-
return e(t(
|
|
87
|
+
return e(t(u));
|
|
88
88
|
} catch {
|
|
89
89
|
}
|
|
90
90
|
}
|
|
@@ -93,20 +93,20 @@ function et() {
|
|
|
93
93
|
function n(t) {
|
|
94
94
|
return "" + t;
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function o(t) {
|
|
97
97
|
try {
|
|
98
98
|
n(t);
|
|
99
|
-
var
|
|
99
|
+
var u = !1;
|
|
100
100
|
} catch {
|
|
101
|
-
|
|
101
|
+
u = !0;
|
|
102
102
|
}
|
|
103
|
-
if (
|
|
104
|
-
|
|
105
|
-
var
|
|
106
|
-
return
|
|
107
|
-
|
|
103
|
+
if (u) {
|
|
104
|
+
u = console;
|
|
105
|
+
var j = u.error, _ = typeof Symbol == "function" && Symbol.toStringTag && t[Symbol.toStringTag] || t.constructor.name || "Object";
|
|
106
|
+
return j.call(
|
|
107
|
+
u,
|
|
108
108
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
109
|
-
|
|
109
|
+
_
|
|
110
110
|
), n(t);
|
|
111
111
|
}
|
|
112
112
|
}
|
|
@@ -115,55 +115,55 @@ function et() {
|
|
|
115
115
|
if (typeof t == "object" && t !== null && t.$$typeof === P)
|
|
116
116
|
return "<...>";
|
|
117
117
|
try {
|
|
118
|
-
var
|
|
119
|
-
return
|
|
118
|
+
var u = e(t);
|
|
119
|
+
return u ? "<" + u + ">" : "<...>";
|
|
120
120
|
} catch {
|
|
121
121
|
return "<...>";
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
|
-
function
|
|
125
|
-
var t =
|
|
124
|
+
function s() {
|
|
125
|
+
var t = U.A;
|
|
126
126
|
return t === null ? null : t.getOwner();
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function i() {
|
|
129
129
|
return Error("react-stack-top-frame");
|
|
130
130
|
}
|
|
131
|
-
function
|
|
132
|
-
if (
|
|
133
|
-
var
|
|
134
|
-
if (
|
|
131
|
+
function l(t) {
|
|
132
|
+
if (Y.call(t, "key")) {
|
|
133
|
+
var u = Object.getOwnPropertyDescriptor(t, "key").get;
|
|
134
|
+
if (u && u.isReactWarning) return !1;
|
|
135
135
|
}
|
|
136
136
|
return t.key !== void 0;
|
|
137
137
|
}
|
|
138
|
-
function
|
|
139
|
-
function
|
|
138
|
+
function v(t, u) {
|
|
139
|
+
function j() {
|
|
140
140
|
F || (F = !0, console.error(
|
|
141
141
|
"%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)",
|
|
142
|
-
|
|
142
|
+
u
|
|
143
143
|
));
|
|
144
144
|
}
|
|
145
|
-
|
|
146
|
-
get:
|
|
145
|
+
j.isReactWarning = !0, Object.defineProperty(t, "key", {
|
|
146
|
+
get: j,
|
|
147
147
|
configurable: !0
|
|
148
148
|
});
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function x() {
|
|
151
151
|
var t = e(this.type);
|
|
152
|
-
return
|
|
152
|
+
return O[t] || (O[t] = !0, console.error(
|
|
153
153
|
"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."
|
|
154
154
|
)), t = this.props.ref, t !== void 0 ? t : null;
|
|
155
155
|
}
|
|
156
|
-
function
|
|
157
|
-
var
|
|
156
|
+
function y(t, u, j, _, X, se) {
|
|
157
|
+
var R = j.ref;
|
|
158
158
|
return t = {
|
|
159
|
-
$$typeof:
|
|
159
|
+
$$typeof: d,
|
|
160
160
|
type: t,
|
|
161
|
-
key:
|
|
162
|
-
props:
|
|
163
|
-
_owner:
|
|
164
|
-
}, (
|
|
161
|
+
key: u,
|
|
162
|
+
props: j,
|
|
163
|
+
_owner: _
|
|
164
|
+
}, (R !== void 0 ? R : null) !== null ? Object.defineProperty(t, "ref", {
|
|
165
165
|
enumerable: !1,
|
|
166
|
-
get:
|
|
166
|
+
get: x
|
|
167
167
|
}) : Object.defineProperty(t, "ref", { enumerable: !1, value: null }), t._store = {}, Object.defineProperty(t._store, "validated", {
|
|
168
168
|
configurable: !1,
|
|
169
169
|
enumerable: !1,
|
|
@@ -178,117 +178,117 @@ function et() {
|
|
|
178
178
|
configurable: !1,
|
|
179
179
|
enumerable: !1,
|
|
180
180
|
writable: !0,
|
|
181
|
-
value:
|
|
181
|
+
value: X
|
|
182
182
|
}), Object.defineProperty(t, "_debugTask", {
|
|
183
183
|
configurable: !1,
|
|
184
184
|
enumerable: !1,
|
|
185
185
|
writable: !0,
|
|
186
|
-
value:
|
|
186
|
+
value: se
|
|
187
187
|
}), Object.freeze && (Object.freeze(t.props), Object.freeze(t)), t;
|
|
188
188
|
}
|
|
189
|
-
function
|
|
190
|
-
var
|
|
191
|
-
if (
|
|
192
|
-
if (
|
|
193
|
-
if (
|
|
194
|
-
for (
|
|
195
|
-
|
|
196
|
-
Object.freeze && Object.freeze(
|
|
189
|
+
function p(t, u, j, _, X, se) {
|
|
190
|
+
var R = u.children;
|
|
191
|
+
if (R !== void 0)
|
|
192
|
+
if (_)
|
|
193
|
+
if (B(R)) {
|
|
194
|
+
for (_ = 0; _ < R.length; _++)
|
|
195
|
+
E(R[_]);
|
|
196
|
+
Object.freeze && Object.freeze(R);
|
|
197
197
|
} else
|
|
198
198
|
console.error(
|
|
199
199
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
200
200
|
);
|
|
201
|
-
else
|
|
202
|
-
if (
|
|
203
|
-
|
|
204
|
-
var
|
|
205
|
-
return
|
|
201
|
+
else E(R);
|
|
202
|
+
if (Y.call(u, "key")) {
|
|
203
|
+
R = e(t);
|
|
204
|
+
var V = Object.keys(u).filter(function(Oe) {
|
|
205
|
+
return Oe !== "key";
|
|
206
206
|
});
|
|
207
|
-
|
|
207
|
+
_ = 0 < V.length ? "{key: someKey, " + V.join(": ..., ") + ": ...}" : "{key: someKey}", W[R + _] || (V = 0 < V.length ? "{" + V.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
208
208
|
`A props object containing a "key" prop is being spread into JSX:
|
|
209
209
|
let props = %s;
|
|
210
210
|
<%s {...props} />
|
|
211
211
|
React keys must be passed directly to JSX without using spread:
|
|
212
212
|
let props = %s;
|
|
213
213
|
<%s key={someKey} {...props} />`,
|
|
214
|
-
R,
|
|
215
214
|
_,
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
215
|
+
R,
|
|
216
|
+
V,
|
|
217
|
+
R
|
|
218
|
+
), W[R + _] = !0);
|
|
219
219
|
}
|
|
220
|
-
if (
|
|
221
|
-
|
|
222
|
-
for (var
|
|
223
|
-
|
|
224
|
-
} else
|
|
225
|
-
return
|
|
226
|
-
|
|
220
|
+
if (R = null, j !== void 0 && (o(j), R = "" + j), l(u) && (o(u.key), R = "" + u.key), "key" in u) {
|
|
221
|
+
j = {};
|
|
222
|
+
for (var ae in u)
|
|
223
|
+
ae !== "key" && (j[ae] = u[ae]);
|
|
224
|
+
} else j = u;
|
|
225
|
+
return R && v(
|
|
226
|
+
j,
|
|
227
227
|
typeof t == "function" ? t.displayName || t.name || "Unknown" : t
|
|
228
|
-
),
|
|
228
|
+
), y(
|
|
229
229
|
t,
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
230
|
+
R,
|
|
231
|
+
j,
|
|
232
|
+
s(),
|
|
233
|
+
X,
|
|
234
|
+
se
|
|
235
235
|
);
|
|
236
236
|
}
|
|
237
|
-
function
|
|
238
|
-
|
|
237
|
+
function E(t) {
|
|
238
|
+
f(t) ? t._store && (t._store.validated = 1) : typeof t == "object" && t !== null && t.$$typeof === P && (t._payload.status === "fulfilled" ? f(t._payload.value) && t._payload.value._store && (t._payload.value._store.validated = 1) : t._store && (t._store.validated = 1));
|
|
239
239
|
}
|
|
240
|
-
function
|
|
241
|
-
return typeof t == "object" && t !== null && t.$$typeof ===
|
|
240
|
+
function f(t) {
|
|
241
|
+
return typeof t == "object" && t !== null && t.$$typeof === d;
|
|
242
242
|
}
|
|
243
|
-
var
|
|
243
|
+
var c = Ie, d = Symbol.for("react.transitional.element"), S = Symbol.for("react.portal"), h = Symbol.for("react.fragment"), C = Symbol.for("react.strict_mode"), A = Symbol.for("react.profiler"), b = Symbol.for("react.consumer"), g = Symbol.for("react.context"), m = Symbol.for("react.forward_ref"), w = Symbol.for("react.suspense"), k = Symbol.for("react.suspense_list"), T = Symbol.for("react.memo"), P = Symbol.for("react.lazy"), I = Symbol.for("react.activity"), D = Symbol.for("react.client.reference"), U = c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Y = Object.prototype.hasOwnProperty, B = Array.isArray, z = console.createTask ? console.createTask : function() {
|
|
244
244
|
return null;
|
|
245
245
|
};
|
|
246
|
-
|
|
246
|
+
c = {
|
|
247
247
|
react_stack_bottom_frame: function(t) {
|
|
248
248
|
return t();
|
|
249
249
|
}
|
|
250
250
|
};
|
|
251
|
-
var F,
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
)(),
|
|
255
|
-
G.Fragment = h, G.jsx = function(t,
|
|
256
|
-
var
|
|
257
|
-
return
|
|
251
|
+
var F, O = {}, N = c.react_stack_bottom_frame.bind(
|
|
252
|
+
c,
|
|
253
|
+
i
|
|
254
|
+
)(), H = z(a(i)), W = {};
|
|
255
|
+
G.Fragment = h, G.jsx = function(t, u, j) {
|
|
256
|
+
var _ = 1e4 > U.recentlyCreatedOwnerStacks++;
|
|
257
|
+
return p(
|
|
258
258
|
t,
|
|
259
|
-
|
|
260
|
-
|
|
259
|
+
u,
|
|
260
|
+
j,
|
|
261
261
|
!1,
|
|
262
|
-
|
|
263
|
-
|
|
262
|
+
_ ? Error("react-stack-top-frame") : N,
|
|
263
|
+
_ ? z(a(t)) : H
|
|
264
264
|
);
|
|
265
|
-
}, G.jsxs = function(t,
|
|
266
|
-
var
|
|
267
|
-
return
|
|
265
|
+
}, G.jsxs = function(t, u, j) {
|
|
266
|
+
var _ = 1e4 > U.recentlyCreatedOwnerStacks++;
|
|
267
|
+
return p(
|
|
268
268
|
t,
|
|
269
|
-
|
|
270
|
-
|
|
269
|
+
u,
|
|
270
|
+
j,
|
|
271
271
|
!0,
|
|
272
|
-
|
|
273
|
-
|
|
272
|
+
_ ? Error("react-stack-top-frame") : N,
|
|
273
|
+
_ ? z(a(t)) : H
|
|
274
274
|
);
|
|
275
275
|
};
|
|
276
276
|
})()), G;
|
|
277
277
|
}
|
|
278
|
-
var
|
|
279
|
-
function
|
|
280
|
-
return
|
|
278
|
+
var Ee;
|
|
279
|
+
function rt() {
|
|
280
|
+
return Ee || (Ee = 1, process.env.NODE_ENV === "production" ? Z.exports = et() : Z.exports = tt()), Z.exports;
|
|
281
281
|
}
|
|
282
|
-
var r =
|
|
283
|
-
class
|
|
282
|
+
var r = rt();
|
|
283
|
+
class nt extends Ce {
|
|
284
284
|
constructor(n) {
|
|
285
285
|
super(n), this.state = { hasError: !1, error: null };
|
|
286
286
|
}
|
|
287
287
|
static getDerivedStateFromError(n) {
|
|
288
288
|
return { hasError: !0, error: n };
|
|
289
289
|
}
|
|
290
|
-
componentDidCatch(n,
|
|
291
|
-
console.error("[JsonPages Engine]", n,
|
|
290
|
+
componentDidCatch(n, o) {
|
|
291
|
+
console.error("[JsonPages Engine]", n, o);
|
|
292
292
|
}
|
|
293
293
|
render() {
|
|
294
294
|
return this.state.hasError && this.state.error ? /* @__PURE__ */ r.jsxs(
|
|
@@ -327,7 +327,7 @@ class rt extends je {
|
|
|
327
327
|
) : this.props.children;
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
|
-
const
|
|
330
|
+
const ot = () => /* @__PURE__ */ r.jsxs(
|
|
331
331
|
"div",
|
|
332
332
|
{
|
|
333
333
|
style: {
|
|
@@ -342,7 +342,7 @@ const nt = () => /* @__PURE__ */ r.jsxs(
|
|
|
342
342
|
/* @__PURE__ */ r.jsx("h1", { className: "text-6xl font-bold text-[var(--local-text)] mb-4", children: "404" }),
|
|
343
343
|
/* @__PURE__ */ r.jsx("p", { className: "text-xl text-[var(--local-text-muted)] mb-8", children: "Page not found" }),
|
|
344
344
|
/* @__PURE__ */ r.jsx(
|
|
345
|
-
|
|
345
|
+
Le,
|
|
346
346
|
{
|
|
347
347
|
to: "/",
|
|
348
348
|
className: "inline-flex items-center gap-2 px-6 py-3 rounded-[var(--local-radius-md)] bg-[var(--local-primary)] text-[var(--local-bg)] font-semibold text-sm hover:opacity-90 transition-opacity",
|
|
@@ -351,8 +351,8 @@ const nt = () => /* @__PURE__ */ r.jsxs(
|
|
|
351
351
|
)
|
|
352
352
|
]
|
|
353
353
|
}
|
|
354
|
-
),
|
|
355
|
-
|
|
354
|
+
), Te = oe(void 0), st = ({ config: e, children: n }) => /* @__PURE__ */ r.jsx(
|
|
355
|
+
Te.Provider,
|
|
356
356
|
{
|
|
357
357
|
value: {
|
|
358
358
|
registry: e.registry,
|
|
@@ -365,129 +365,129 @@ const nt = () => /* @__PURE__ */ r.jsxs(
|
|
|
365
365
|
children: n
|
|
366
366
|
}
|
|
367
367
|
);
|
|
368
|
-
function
|
|
369
|
-
const e =
|
|
368
|
+
function at() {
|
|
369
|
+
const e = ne(Te);
|
|
370
370
|
if (e === void 0)
|
|
371
371
|
throw new Error("useConfig must be used within ConfigProvider");
|
|
372
372
|
return e;
|
|
373
373
|
}
|
|
374
|
-
const
|
|
374
|
+
const ie = /* @__PURE__ */ new Set(), ue = {
|
|
375
375
|
setTheme: (e) => {
|
|
376
|
-
const n = document.documentElement,
|
|
377
|
-
|
|
376
|
+
const n = document.documentElement, o = Ye(e);
|
|
377
|
+
ie.forEach((a) => {
|
|
378
378
|
n.style.removeProperty(a);
|
|
379
|
-
}),
|
|
380
|
-
n.style.setProperty(a,
|
|
379
|
+
}), ie.clear(), Object.entries(o).forEach(([a, s]) => {
|
|
380
|
+
n.style.setProperty(a, s), ie.add(a);
|
|
381
381
|
});
|
|
382
382
|
}
|
|
383
|
-
},
|
|
383
|
+
}, _e = oe({}), It = () => ne(_e);
|
|
384
384
|
function Re() {
|
|
385
385
|
return /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
386
|
-
/* @__PURE__ */ r.jsx(
|
|
387
|
-
/* @__PURE__ */ r.jsx(
|
|
386
|
+
/* @__PURE__ */ r.jsx(Ue, {}),
|
|
387
|
+
/* @__PURE__ */ r.jsx(ze, {})
|
|
388
388
|
] });
|
|
389
389
|
}
|
|
390
|
-
function
|
|
391
|
-
var
|
|
390
|
+
function ke({ config: e, routesBuilder: n, adminCss: o = "" }) {
|
|
391
|
+
var I, D, U, Y, B, z, F;
|
|
392
392
|
const {
|
|
393
393
|
registry: a = {},
|
|
394
|
-
schemas:
|
|
395
|
-
basePath:
|
|
396
|
-
pages:
|
|
397
|
-
siteConfig:
|
|
398
|
-
themeConfig:
|
|
399
|
-
menuConfig:
|
|
400
|
-
collections:
|
|
401
|
-
collectionSchemas:
|
|
402
|
-
refDocuments:
|
|
403
|
-
themeCss:
|
|
404
|
-
addSection:
|
|
405
|
-
NotFoundComponent:
|
|
406
|
-
} = e, h = (
|
|
407
|
-
saveToFile: (
|
|
394
|
+
schemas: s = {},
|
|
395
|
+
basePath: i = "/",
|
|
396
|
+
pages: l = {},
|
|
397
|
+
siteConfig: v,
|
|
398
|
+
themeConfig: x,
|
|
399
|
+
menuConfig: y,
|
|
400
|
+
collections: p,
|
|
401
|
+
collectionSchemas: E,
|
|
402
|
+
refDocuments: f,
|
|
403
|
+
themeCss: c,
|
|
404
|
+
addSection: d,
|
|
405
|
+
NotFoundComponent: S = ot
|
|
406
|
+
} = e, h = (d == null ? void 0 : d.addableSectionTypes) ?? Object.keys(s).filter((O) => O !== "header" && O !== "footer"), C = {
|
|
407
|
+
saveToFile: (I = e.persistence) == null ? void 0 : I.saveToFile,
|
|
408
408
|
hotSave: (D = e.persistence) == null ? void 0 : D.hotSave,
|
|
409
|
-
coldSave: (
|
|
410
|
-
showLocalSave: ((
|
|
411
|
-
showHotSave: ((
|
|
412
|
-
showColdSave: ((
|
|
413
|
-
}, A = typeof (
|
|
414
|
-
() =>
|
|
415
|
-
pages:
|
|
416
|
-
siteConfig:
|
|
417
|
-
themeConfig:
|
|
418
|
-
menuConfig:
|
|
419
|
-
collections:
|
|
420
|
-
collectionSchemas:
|
|
421
|
-
refDocuments:
|
|
409
|
+
coldSave: (U = e.persistence) == null ? void 0 : U.coldSave,
|
|
410
|
+
showLocalSave: ((Y = e.persistence) == null ? void 0 : Y.showLocalSave) ?? !0,
|
|
411
|
+
showHotSave: ((B = e.persistence) == null ? void 0 : B.showHotSave) ?? !1,
|
|
412
|
+
showColdSave: ((z = e.persistence) == null ? void 0 : z.showColdSave) ?? !1
|
|
413
|
+
}, A = typeof (c == null ? void 0 : c.tenant) == "string" ? c.tenant : "", b = typeof (c == null ? void 0 : c.admin) == "string" ? c.admin : o, g = K(
|
|
414
|
+
() => we({
|
|
415
|
+
pages: l,
|
|
416
|
+
siteConfig: v,
|
|
417
|
+
themeConfig: x,
|
|
418
|
+
menuConfig: y,
|
|
419
|
+
collections: p,
|
|
420
|
+
collectionSchemas: E,
|
|
421
|
+
refDocuments: f
|
|
422
422
|
}),
|
|
423
|
-
[
|
|
424
|
-
), [
|
|
425
|
-
|
|
426
|
-
var
|
|
423
|
+
[l, v, x, y, p, E, f]
|
|
424
|
+
), [m, w] = J(!1), k = Je(i);
|
|
425
|
+
$(() => {
|
|
426
|
+
var O, N;
|
|
427
427
|
try {
|
|
428
|
-
(
|
|
429
|
-
} catch (
|
|
430
|
-
console.warn("[JsonPages] setTheme failed",
|
|
428
|
+
(O = g.themeConfig) != null && O.tokens && ue.setTheme(g.themeConfig);
|
|
429
|
+
} catch (H) {
|
|
430
|
+
console.warn("[JsonPages] setTheme failed", H);
|
|
431
431
|
}
|
|
432
|
-
(N = e.webmcp) != null && N.enabled &&
|
|
432
|
+
(N = e.webmcp) != null && N.enabled && Be(), w(!0);
|
|
433
433
|
}, [g.themeConfig, (F = e.webmcp) == null ? void 0 : F.enabled]);
|
|
434
434
|
const T = {
|
|
435
435
|
registry: a,
|
|
436
|
-
schemas:
|
|
437
|
-
pageRegistry:
|
|
438
|
-
siteConfig:
|
|
439
|
-
menuConfig:
|
|
436
|
+
schemas: s,
|
|
437
|
+
pageRegistry: l,
|
|
438
|
+
siteConfig: v,
|
|
439
|
+
menuConfig: y,
|
|
440
440
|
themeConfig: g.themeConfig,
|
|
441
|
-
collections:
|
|
442
|
-
collectionSchemas:
|
|
443
|
-
refDocuments:
|
|
444
|
-
addSectionConfig:
|
|
441
|
+
collections: p,
|
|
442
|
+
collectionSchemas: E,
|
|
443
|
+
refDocuments: f,
|
|
444
|
+
addSectionConfig: d,
|
|
445
445
|
addableSectionTypes: h,
|
|
446
446
|
webmcp: e.webmcp,
|
|
447
|
-
persistence:
|
|
447
|
+
persistence: C,
|
|
448
448
|
routerBasePath: k,
|
|
449
449
|
tenantCss: A,
|
|
450
|
-
adminCss:
|
|
451
|
-
NotFoundComponent:
|
|
452
|
-
}, P =
|
|
453
|
-
const
|
|
454
|
-
return
|
|
450
|
+
adminCss: b,
|
|
451
|
+
NotFoundComponent: S
|
|
452
|
+
}, P = K(() => {
|
|
453
|
+
const O = Me(n(T));
|
|
454
|
+
return Fe(O, { basename: k });
|
|
455
455
|
}, [
|
|
456
|
-
|
|
457
|
-
|
|
456
|
+
S,
|
|
457
|
+
d,
|
|
458
458
|
h,
|
|
459
|
-
v,
|
|
460
|
-
g.themeConfig,
|
|
461
459
|
b,
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
m,
|
|
465
|
-
j.coldSave,
|
|
466
|
-
j.hotSave,
|
|
467
|
-
j.saveToFile,
|
|
468
|
-
j.showColdSave,
|
|
469
|
-
j.showHotSave,
|
|
470
|
-
j.showLocalSave,
|
|
460
|
+
g.themeConfig,
|
|
461
|
+
y,
|
|
471
462
|
p,
|
|
463
|
+
E,
|
|
464
|
+
l,
|
|
465
|
+
C.coldSave,
|
|
466
|
+
C.hotSave,
|
|
467
|
+
C.saveToFile,
|
|
468
|
+
C.showColdSave,
|
|
469
|
+
C.showHotSave,
|
|
470
|
+
C.showLocalSave,
|
|
471
|
+
f,
|
|
472
472
|
k,
|
|
473
|
-
|
|
474
|
-
|
|
473
|
+
s,
|
|
474
|
+
v,
|
|
475
475
|
A,
|
|
476
476
|
e.webmcp,
|
|
477
477
|
n
|
|
478
478
|
]);
|
|
479
|
-
return
|
|
480
|
-
|
|
479
|
+
return m ? /* @__PURE__ */ r.jsx(nt, { children: /* @__PURE__ */ r.jsx(_e.Provider, { value: e.iconRegistry ?? {}, children: /* @__PURE__ */ r.jsx(
|
|
480
|
+
st,
|
|
481
481
|
{
|
|
482
482
|
config: {
|
|
483
483
|
registry: a,
|
|
484
|
-
schemas:
|
|
484
|
+
schemas: s,
|
|
485
485
|
tenantId: e.tenantId ?? "default",
|
|
486
486
|
basePath: k,
|
|
487
487
|
assets: e.assets,
|
|
488
488
|
overlayDisabledSectionTypes: e.overlayDisabledSectionTypes
|
|
489
489
|
},
|
|
490
|
-
children: /* @__PURE__ */ r.jsx(
|
|
490
|
+
children: /* @__PURE__ */ r.jsx($e, { router: P })
|
|
491
491
|
}
|
|
492
492
|
) }) }) : /* @__PURE__ */ r.jsx(
|
|
493
493
|
"div",
|
|
@@ -506,18 +506,18 @@ function _e({ config: e, routesBuilder: n, adminCss: s = "" }) {
|
|
|
506
506
|
}
|
|
507
507
|
);
|
|
508
508
|
}
|
|
509
|
-
const
|
|
509
|
+
const Ne = oe(void 0), me = ({ mode: e, children: n }) => ($(() => {
|
|
510
510
|
if (e !== "studio") return;
|
|
511
|
-
const
|
|
512
|
-
a.forEach((
|
|
513
|
-
|
|
514
|
-
|
|
511
|
+
const o = new MutationObserver((a) => {
|
|
512
|
+
a.forEach((s) => {
|
|
513
|
+
s.addedNodes.forEach((i) => {
|
|
514
|
+
i instanceof HTMLElement && i.hasAttribute("data-radix-portal") && i.setAttribute("data-jp-studio-portal", "true");
|
|
515
515
|
});
|
|
516
516
|
});
|
|
517
517
|
});
|
|
518
|
-
return
|
|
519
|
-
}, [e]), /* @__PURE__ */ r.jsx(
|
|
520
|
-
const e =
|
|
518
|
+
return o.observe(document.body, { childList: !0 }), () => o.disconnect();
|
|
519
|
+
}, [e]), /* @__PURE__ */ r.jsx(Ne.Provider, { value: { mode: e }, children: n })), it = () => {
|
|
520
|
+
const e = ne(Ne);
|
|
521
521
|
if (e === void 0)
|
|
522
522
|
throw new Error("useStudio must be used within a StudioProvider");
|
|
523
523
|
return e;
|
|
@@ -528,14 +528,14 @@ const ke = ne(void 0), ue = ({ mode: e, children: n }) => (z(() => {
|
|
|
528
528
|
* This source code is licensed under the ISC license.
|
|
529
529
|
* See the LICENSE file in the root directory of this source tree.
|
|
530
530
|
*/
|
|
531
|
-
const
|
|
531
|
+
const lt = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Pe = (...e) => e.filter((n, o, a) => !!n && n.trim() !== "" && a.indexOf(n) === o).join(" ").trim();
|
|
532
532
|
/**
|
|
533
533
|
* @license lucide-react v0.474.0 - ISC
|
|
534
534
|
*
|
|
535
535
|
* This source code is licensed under the ISC license.
|
|
536
536
|
* See the LICENSE file in the root directory of this source tree.
|
|
537
537
|
*/
|
|
538
|
-
var
|
|
538
|
+
var ct = {
|
|
539
539
|
xmlns: "http://www.w3.org/2000/svg",
|
|
540
540
|
width: 24,
|
|
541
541
|
height: 24,
|
|
@@ -552,31 +552,31 @@ var lt = {
|
|
|
552
552
|
* This source code is licensed under the ISC license.
|
|
553
553
|
* See the LICENSE file in the root directory of this source tree.
|
|
554
554
|
*/
|
|
555
|
-
const
|
|
555
|
+
const dt = je(
|
|
556
556
|
({
|
|
557
557
|
color: e = "currentColor",
|
|
558
558
|
size: n = 24,
|
|
559
|
-
strokeWidth:
|
|
559
|
+
strokeWidth: o = 2,
|
|
560
560
|
absoluteStrokeWidth: a,
|
|
561
|
-
className:
|
|
562
|
-
children:
|
|
563
|
-
iconNode:
|
|
564
|
-
...
|
|
565
|
-
},
|
|
561
|
+
className: s = "",
|
|
562
|
+
children: i,
|
|
563
|
+
iconNode: l,
|
|
564
|
+
...v
|
|
565
|
+
}, x) => ce(
|
|
566
566
|
"svg",
|
|
567
567
|
{
|
|
568
|
-
ref:
|
|
569
|
-
...
|
|
568
|
+
ref: x,
|
|
569
|
+
...ct,
|
|
570
570
|
width: n,
|
|
571
571
|
height: n,
|
|
572
572
|
stroke: e,
|
|
573
|
-
strokeWidth: a ? Number(
|
|
574
|
-
className:
|
|
575
|
-
...
|
|
573
|
+
strokeWidth: a ? Number(o) * 24 / Number(n) : o,
|
|
574
|
+
className: Pe("lucide", s),
|
|
575
|
+
...v
|
|
576
576
|
},
|
|
577
577
|
[
|
|
578
|
-
...
|
|
579
|
-
...Array.isArray(
|
|
578
|
+
...l.map(([y, p]) => ce(y, p)),
|
|
579
|
+
...Array.isArray(i) ? i : [i]
|
|
580
580
|
]
|
|
581
581
|
)
|
|
582
582
|
);
|
|
@@ -586,16 +586,16 @@ const ct = Se(
|
|
|
586
586
|
* This source code is licensed under the ISC license.
|
|
587
587
|
* See the LICENSE file in the root directory of this source tree.
|
|
588
588
|
*/
|
|
589
|
-
const
|
|
590
|
-
const
|
|
591
|
-
({ className: a, ...
|
|
592
|
-
ref:
|
|
589
|
+
const pe = (e, n) => {
|
|
590
|
+
const o = je(
|
|
591
|
+
({ className: a, ...s }, i) => ce(dt, {
|
|
592
|
+
ref: i,
|
|
593
593
|
iconNode: n,
|
|
594
|
-
className:
|
|
595
|
-
...
|
|
594
|
+
className: Pe(`lucide-${lt(e)}`, a),
|
|
595
|
+
...s
|
|
596
596
|
})
|
|
597
597
|
);
|
|
598
|
-
return
|
|
598
|
+
return o.displayName = `${e}`, o;
|
|
599
599
|
};
|
|
600
600
|
/**
|
|
601
601
|
* @license lucide-react v0.474.0 - ISC
|
|
@@ -603,21 +603,21 @@ const me = (e, n) => {
|
|
|
603
603
|
* This source code is licensed under the ISC license.
|
|
604
604
|
* See the LICENSE file in the root directory of this source tree.
|
|
605
605
|
*/
|
|
606
|
-
const
|
|
606
|
+
const ut = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], mt = pe("ChevronDown", ut);
|
|
607
607
|
/**
|
|
608
608
|
* @license lucide-react v0.474.0 - ISC
|
|
609
609
|
*
|
|
610
610
|
* This source code is licensed under the ISC license.
|
|
611
611
|
* See the LICENSE file in the root directory of this source tree.
|
|
612
612
|
*/
|
|
613
|
-
const
|
|
613
|
+
const pt = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]], ft = pe("ChevronUp", pt);
|
|
614
614
|
/**
|
|
615
615
|
* @license lucide-react v0.474.0 - ISC
|
|
616
616
|
*
|
|
617
617
|
* This source code is licensed under the ISC license.
|
|
618
618
|
* See the LICENSE file in the root directory of this source tree.
|
|
619
619
|
*/
|
|
620
|
-
const
|
|
620
|
+
const ht = [
|
|
621
621
|
[
|
|
622
622
|
"path",
|
|
623
623
|
{
|
|
@@ -627,20 +627,20 @@ const ft = [
|
|
|
627
627
|
],
|
|
628
628
|
["path", { d: "M12 9v4", key: "juzpu7" }],
|
|
629
629
|
["path", { d: "M12 17h.01", key: "p32p05" }]
|
|
630
|
-
],
|
|
631
|
-
class
|
|
630
|
+
], gt = pe("TriangleAlert", ht);
|
|
631
|
+
class vt extends Ce {
|
|
632
632
|
constructor(n) {
|
|
633
633
|
super(n), this.state = { hasError: !1 };
|
|
634
634
|
}
|
|
635
635
|
static getDerivedStateFromError() {
|
|
636
636
|
return { hasError: !0 };
|
|
637
637
|
}
|
|
638
|
-
componentDidCatch(n,
|
|
639
|
-
console.error(`[JsonPages] Component Crash [${this.props.type}]:`, n,
|
|
638
|
+
componentDidCatch(n, o) {
|
|
639
|
+
console.error(`[JsonPages] Component Crash [${this.props.type}]:`, n, o);
|
|
640
640
|
}
|
|
641
641
|
render() {
|
|
642
642
|
return this.state.hasError ? /* @__PURE__ */ r.jsxs("div", { className: "p-8 m-4 bg-amber-500/5 border-2 border-dashed border-amber-500/20 rounded-xl flex flex-col items-center text-center gap-3", children: [
|
|
643
|
-
/* @__PURE__ */ r.jsx(
|
|
643
|
+
/* @__PURE__ */ r.jsx(gt, { className: "text-amber-500", size: 32 }),
|
|
644
644
|
/* @__PURE__ */ r.jsxs("div", { className: "space-y-1", children: [
|
|
645
645
|
/* @__PURE__ */ r.jsx("h4", { className: "text-sm font-bold text-amber-200 uppercase tracking-tight", children: "Component Error" }),
|
|
646
646
|
/* @__PURE__ */ r.jsxs("p", { className: "text-xs text-amber-500/70 font-mono", children: [
|
|
@@ -652,54 +652,54 @@ class gt extends je {
|
|
|
652
652
|
] }) : this.props.children;
|
|
653
653
|
}
|
|
654
654
|
}
|
|
655
|
-
const
|
|
656
|
-
const
|
|
655
|
+
const bt = ({ type: e, scope: n, isSelected: o, sectionId: a, sectionIndex: s = 0, totalSections: i = 0, onReorder: l }) => {
|
|
656
|
+
const v = typeof s == "number" && s > 0 && l, x = typeof s == "number" && s < i - 1 && l;
|
|
657
657
|
return /* @__PURE__ */ r.jsx(
|
|
658
658
|
"div",
|
|
659
659
|
{
|
|
660
660
|
"data-jp-section-overlay": !0,
|
|
661
661
|
"aria-hidden": !0,
|
|
662
|
-
className:
|
|
662
|
+
className: de(
|
|
663
663
|
"absolute inset-0 pointer-events-none transition-all duration-200 z-[50]",
|
|
664
664
|
"border-2 border-transparent group-hover:border-blue-400/50 group-hover:border-dashed",
|
|
665
|
-
|
|
665
|
+
o && "border-2 border-blue-600 border-solid bg-blue-500/5"
|
|
666
666
|
),
|
|
667
667
|
children: /* @__PURE__ */ r.jsxs(
|
|
668
668
|
"div",
|
|
669
669
|
{
|
|
670
|
-
className:
|
|
670
|
+
className: de(
|
|
671
671
|
"absolute top-0 right-0 flex flex-nowrap items-center gap-1 pl-1 pr-2 py-1 text-[9px] font-black uppercase tracking-widest transition-opacity pointer-events-auto",
|
|
672
672
|
"bg-blue-600 text-white",
|
|
673
|
-
|
|
673
|
+
o || "group-hover:opacity-100 opacity-0"
|
|
674
674
|
),
|
|
675
675
|
children: [
|
|
676
|
-
|
|
676
|
+
l && a != null && /* @__PURE__ */ r.jsxs("span", { className: "shrink-0 flex items-center gap-0.5", children: [
|
|
677
677
|
/* @__PURE__ */ r.jsx(
|
|
678
678
|
"button",
|
|
679
679
|
{
|
|
680
680
|
type: "button",
|
|
681
|
-
onClick: (
|
|
682
|
-
|
|
681
|
+
onClick: (y) => {
|
|
682
|
+
y.stopPropagation(), v && l(a, s - 1);
|
|
683
683
|
},
|
|
684
|
-
disabled: !
|
|
684
|
+
disabled: !v,
|
|
685
685
|
className: "inline-flex items-center justify-center min-w-[18px] min-h-[18px] rounded bg-white/20 hover:bg-white/30 disabled:opacity-30 disabled:pointer-events-none",
|
|
686
686
|
title: "Move section up",
|
|
687
687
|
"aria-label": "Move section up",
|
|
688
|
-
children: /* @__PURE__ */ r.jsx(
|
|
688
|
+
children: /* @__PURE__ */ r.jsx(ft, { size: 12, strokeWidth: 2.5 })
|
|
689
689
|
}
|
|
690
690
|
),
|
|
691
691
|
/* @__PURE__ */ r.jsx(
|
|
692
692
|
"button",
|
|
693
693
|
{
|
|
694
694
|
type: "button",
|
|
695
|
-
onClick: (
|
|
696
|
-
|
|
695
|
+
onClick: (y) => {
|
|
696
|
+
y.stopPropagation(), x && l(a, s + 2);
|
|
697
697
|
},
|
|
698
|
-
disabled: !
|
|
698
|
+
disabled: !x,
|
|
699
699
|
className: "inline-flex items-center justify-center min-w-[18px] min-h-[18px] rounded bg-white/20 hover:bg-white/30 disabled:opacity-30 disabled:pointer-events-none",
|
|
700
700
|
title: "Move section down",
|
|
701
701
|
"aria-label": "Move section down",
|
|
702
|
-
children: /* @__PURE__ */ r.jsx(
|
|
702
|
+
children: /* @__PURE__ */ r.jsx(mt, { size: 12, strokeWidth: 2.5 })
|
|
703
703
|
}
|
|
704
704
|
)
|
|
705
705
|
] }),
|
|
@@ -714,93 +714,93 @@ const vt = ({ type: e, scope: n, isSelected: s, sectionId: a, sectionIndex: o =
|
|
|
714
714
|
}, ee = ({
|
|
715
715
|
section: e,
|
|
716
716
|
menu: n,
|
|
717
|
-
selectedId:
|
|
717
|
+
selectedId: o,
|
|
718
718
|
reorderable: a,
|
|
719
|
-
sectionIndex:
|
|
720
|
-
totalSections:
|
|
721
|
-
onReorder:
|
|
719
|
+
sectionIndex: s,
|
|
720
|
+
totalSections: i,
|
|
721
|
+
onReorder: l
|
|
722
722
|
}) => {
|
|
723
|
-
const { mode:
|
|
724
|
-
if (!
|
|
723
|
+
const { mode: v } = it(), { registry: x, overlayDisabledSectionTypes: y } = at(), p = v === "studio", E = p && o === e.id, f = x[e.type], c = e.type === "header" || e.type === "footer" ? "global" : "local", d = Array.isArray(y) ? y.includes(e.type) : !1, S = e.type === "header" && typeof e.settings == "object" && e.settings !== null && "sticky" in e.settings && !!e.settings.sticky;
|
|
724
|
+
if (!f)
|
|
725
725
|
return /* @__PURE__ */ r.jsxs("div", { className: "p-6 m-4 bg-red-500/10 text-red-400 border border-red-500/20 rounded-lg text-sm font-mono", children: [
|
|
726
726
|
/* @__PURE__ */ r.jsx("strong", { children: "Missing Component:" }),
|
|
727
727
|
" ",
|
|
728
728
|
e.type
|
|
729
729
|
] });
|
|
730
730
|
const h = () => {
|
|
731
|
-
const A =
|
|
731
|
+
const A = f;
|
|
732
732
|
return n ? /* @__PURE__ */ r.jsx(A, { data: e.data, settings: e.settings, menu: n }) : /* @__PURE__ */ r.jsx(A, { data: e.data, settings: e.settings });
|
|
733
|
-
},
|
|
733
|
+
}, C = typeof e.data == "object" && e.data !== null && "anchorId" in e.data ? String(e.data.anchorId ?? "") : void 0;
|
|
734
734
|
return /* @__PURE__ */ r.jsxs(
|
|
735
735
|
"div",
|
|
736
736
|
{
|
|
737
|
-
id:
|
|
738
|
-
"data-section-id":
|
|
739
|
-
"data-section-type":
|
|
740
|
-
"data-section-scope":
|
|
741
|
-
...
|
|
742
|
-
className:
|
|
737
|
+
id: C || void 0,
|
|
738
|
+
"data-section-id": p ? e.id : void 0,
|
|
739
|
+
"data-section-type": p ? e.type : void 0,
|
|
740
|
+
"data-section-scope": p ? c : void 0,
|
|
741
|
+
...p && E ? { "data-jp-selected": !0 } : {},
|
|
742
|
+
className: de(
|
|
743
743
|
"relative w-full",
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
744
|
+
p && !d && "group cursor-pointer",
|
|
745
|
+
p && S ? "sticky top-0 z-[60]" : e.type === "header" ? "relative" : "relative z-0",
|
|
746
|
+
E && "z-[70]"
|
|
747
747
|
),
|
|
748
748
|
children: [
|
|
749
|
-
/* @__PURE__ */ r.jsx("div", { className: e.type === "header" ? "relative" : "relative z-0", children: /* @__PURE__ */ r.jsx(
|
|
750
|
-
|
|
751
|
-
|
|
749
|
+
/* @__PURE__ */ r.jsx("div", { className: e.type === "header" ? "relative" : "relative z-0", children: /* @__PURE__ */ r.jsx(vt, { type: e.type, children: h() }) }),
|
|
750
|
+
p && !d && /* @__PURE__ */ r.jsx(
|
|
751
|
+
bt,
|
|
752
752
|
{
|
|
753
753
|
type: e.type,
|
|
754
|
-
scope:
|
|
755
|
-
isSelected: !!
|
|
756
|
-
sectionId: a &&
|
|
757
|
-
sectionIndex: a &&
|
|
758
|
-
totalSections: a &&
|
|
759
|
-
onReorder: a &&
|
|
754
|
+
scope: c,
|
|
755
|
+
isSelected: !!E,
|
|
756
|
+
sectionId: a && c === "local" ? e.id : void 0,
|
|
757
|
+
sectionIndex: a && c === "local" ? s : void 0,
|
|
758
|
+
totalSections: a && c === "local" ? i : void 0,
|
|
759
|
+
onReorder: a && c === "local" ? l : void 0
|
|
760
760
|
}
|
|
761
761
|
)
|
|
762
762
|
]
|
|
763
763
|
}
|
|
764
764
|
);
|
|
765
|
-
},
|
|
766
|
-
|
|
765
|
+
}, yt = (e) => {
|
|
766
|
+
$(() => {
|
|
767
767
|
document.title = e.title;
|
|
768
768
|
let n = document.querySelector('meta[name="description"]');
|
|
769
769
|
n || (n = document.createElement("meta"), n.setAttribute("name", "description"), document.head.appendChild(n)), n.setAttribute("content", e.description);
|
|
770
770
|
}, [e.title, e.description]);
|
|
771
|
-
},
|
|
771
|
+
}, Et = "application/json", Ae = ({
|
|
772
772
|
pageConfig: e,
|
|
773
773
|
siteConfig: n,
|
|
774
|
-
menuConfig:
|
|
774
|
+
menuConfig: o,
|
|
775
775
|
selectedId: a,
|
|
776
|
-
onReorder:
|
|
777
|
-
scrollToSectionId:
|
|
778
|
-
onActiveSectionChange:
|
|
776
|
+
onReorder: s,
|
|
777
|
+
scrollToSectionId: i,
|
|
778
|
+
onActiveSectionChange: l
|
|
779
779
|
}) => {
|
|
780
|
-
|
|
781
|
-
const [
|
|
782
|
-
|
|
783
|
-
const
|
|
780
|
+
yt(e.meta);
|
|
781
|
+
const [v, x] = J(null), y = he({}), p = he(l);
|
|
782
|
+
p.current = l;
|
|
783
|
+
const E = Ve(e, n), f = E ? n.header ?? null : null, c = n.footer ?? null, d = (b) => {
|
|
784
784
|
var g;
|
|
785
|
-
(g =
|
|
785
|
+
(g = p.current) == null || g.call(p, b);
|
|
786
786
|
};
|
|
787
|
-
|
|
788
|
-
if (!
|
|
789
|
-
const
|
|
790
|
-
|
|
791
|
-
}, [
|
|
792
|
-
if (!
|
|
787
|
+
$(() => {
|
|
788
|
+
if (!i) return;
|
|
789
|
+
const b = y.current[i];
|
|
790
|
+
b && b.scrollIntoView({ behavior: "smooth", block: "center" });
|
|
791
|
+
}, [i]), $(() => {
|
|
792
|
+
if (!p.current) return;
|
|
793
793
|
const g = [
|
|
794
|
-
...
|
|
794
|
+
...f ? [f.id] : [],
|
|
795
795
|
...e.sections.map((T) => T.id),
|
|
796
|
-
...
|
|
797
|
-
],
|
|
796
|
+
...c ? [c.id] : []
|
|
797
|
+
], m = new IntersectionObserver(
|
|
798
798
|
(T) => {
|
|
799
799
|
T.forEach((P) => {
|
|
800
|
-
var
|
|
800
|
+
var I;
|
|
801
801
|
if (P.isIntersecting && P.intersectionRatio > 0.5) {
|
|
802
802
|
const D = P.target.getAttribute("data-section-id");
|
|
803
|
-
D && ((
|
|
803
|
+
D && ((I = p.current) == null || I.call(p, D));
|
|
804
804
|
}
|
|
805
805
|
});
|
|
806
806
|
},
|
|
@@ -809,37 +809,37 @@ const vt = ({ type: e, scope: n, isSelected: s, sectionId: a, sectionIndex: o =
|
|
|
809
809
|
let w = !1;
|
|
810
810
|
const k = requestAnimationFrame(() => {
|
|
811
811
|
w || g.forEach((T) => {
|
|
812
|
-
const P =
|
|
813
|
-
P &&
|
|
812
|
+
const P = y.current[T];
|
|
813
|
+
P && m.observe(P);
|
|
814
814
|
});
|
|
815
815
|
});
|
|
816
816
|
return () => {
|
|
817
|
-
w = !0, cancelAnimationFrame(k),
|
|
817
|
+
w = !0, cancelAnimationFrame(k), m.disconnect();
|
|
818
818
|
};
|
|
819
|
-
}, [
|
|
820
|
-
const
|
|
821
|
-
|
|
819
|
+
}, [c, f, e.sections, e["global-header"], E]);
|
|
820
|
+
const S = (b, g) => {
|
|
821
|
+
b.preventDefault(), b.dataTransfer.dropEffect = "move", x(g);
|
|
822
822
|
}, h = () => {
|
|
823
|
-
|
|
824
|
-
},
|
|
825
|
-
if (
|
|
823
|
+
x(null);
|
|
824
|
+
}, C = (b, g) => {
|
|
825
|
+
if (b.preventDefault(), x(null), !!s)
|
|
826
826
|
try {
|
|
827
|
-
const
|
|
828
|
-
typeof w == "string" &&
|
|
827
|
+
const m = b.dataTransfer.getData(Et), { sectionId: w } = JSON.parse(m);
|
|
828
|
+
typeof w == "string" && s(w, g);
|
|
829
829
|
} catch {
|
|
830
830
|
}
|
|
831
831
|
}, A = () => {
|
|
832
|
-
const
|
|
833
|
-
const k =
|
|
834
|
-
return
|
|
832
|
+
const b = typeof s == "function", g = e.sections.map((m, w) => {
|
|
833
|
+
const k = v === w;
|
|
834
|
+
return b ? /* @__PURE__ */ r.jsxs(
|
|
835
835
|
"div",
|
|
836
836
|
{
|
|
837
837
|
ref: (T) => {
|
|
838
|
-
|
|
838
|
+
y.current[m.id] = T;
|
|
839
839
|
},
|
|
840
|
-
"data-section-id":
|
|
840
|
+
"data-section-id": m.id,
|
|
841
841
|
style: { position: "relative" },
|
|
842
|
-
onMouseEnter: () =>
|
|
842
|
+
onMouseEnter: () => d(m.id),
|
|
843
843
|
children: [
|
|
844
844
|
/* @__PURE__ */ r.jsx(
|
|
845
845
|
"div",
|
|
@@ -856,48 +856,48 @@ const vt = ({ type: e, scope: n, isSelected: s, sectionId: a, sectionIndex: o =
|
|
|
856
856
|
backgroundColor: k ? "rgba(59, 130, 246, 0.4)" : "transparent",
|
|
857
857
|
borderTop: k ? "2px solid rgb(96, 165, 250)" : "2px solid transparent"
|
|
858
858
|
},
|
|
859
|
-
onDragOver: (T) =>
|
|
859
|
+
onDragOver: (T) => S(T, w),
|
|
860
860
|
onDragLeave: h,
|
|
861
|
-
onDrop: (T) =>
|
|
861
|
+
onDrop: (T) => C(T, w)
|
|
862
862
|
}
|
|
863
863
|
),
|
|
864
864
|
/* @__PURE__ */ r.jsx(
|
|
865
865
|
ee,
|
|
866
866
|
{
|
|
867
|
-
section:
|
|
868
|
-
menu:
|
|
867
|
+
section: m,
|
|
868
|
+
menu: Q(m, o.main ?? []),
|
|
869
869
|
selectedId: a,
|
|
870
870
|
reorderable: !0,
|
|
871
871
|
sectionIndex: w,
|
|
872
872
|
totalSections: e.sections.length,
|
|
873
|
-
onReorder:
|
|
873
|
+
onReorder: s
|
|
874
874
|
}
|
|
875
875
|
)
|
|
876
876
|
]
|
|
877
877
|
},
|
|
878
|
-
|
|
878
|
+
m.id
|
|
879
879
|
) : /* @__PURE__ */ r.jsx(
|
|
880
880
|
"div",
|
|
881
881
|
{
|
|
882
882
|
ref: (T) => {
|
|
883
|
-
|
|
883
|
+
y.current[m.id] = T;
|
|
884
884
|
},
|
|
885
|
-
"data-section-id":
|
|
886
|
-
onMouseEnter: () =>
|
|
885
|
+
"data-section-id": m.id,
|
|
886
|
+
onMouseEnter: () => d(m.id),
|
|
887
887
|
children: /* @__PURE__ */ r.jsx(
|
|
888
888
|
ee,
|
|
889
889
|
{
|
|
890
|
-
section:
|
|
891
|
-
menu:
|
|
890
|
+
section: m,
|
|
891
|
+
menu: Q(m, o.main ?? []),
|
|
892
892
|
selectedId: a
|
|
893
893
|
}
|
|
894
894
|
)
|
|
895
895
|
},
|
|
896
|
-
|
|
896
|
+
m.id
|
|
897
897
|
);
|
|
898
898
|
});
|
|
899
|
-
if (
|
|
900
|
-
const
|
|
899
|
+
if (b && g.length > 0) {
|
|
900
|
+
const m = e.sections.length, w = v === m;
|
|
901
901
|
g.push(
|
|
902
902
|
/* @__PURE__ */ r.jsx(
|
|
903
903
|
"div",
|
|
@@ -914,9 +914,9 @@ const vt = ({ type: e, scope: n, isSelected: s, sectionId: a, sectionIndex: o =
|
|
|
914
914
|
backgroundColor: w ? "rgba(59, 130, 246, 0.4)" : "transparent",
|
|
915
915
|
borderTop: w ? "2px solid rgb(96, 165, 250)" : "2px solid transparent"
|
|
916
916
|
},
|
|
917
|
-
onDragOver: (k) =>
|
|
917
|
+
onDragOver: (k) => S(k, m),
|
|
918
918
|
onDragLeave: h,
|
|
919
|
-
onDrop: (k) =>
|
|
919
|
+
onDrop: (k) => C(k, m)
|
|
920
920
|
},
|
|
921
921
|
"jp-drop-after-last"
|
|
922
922
|
)
|
|
@@ -925,219 +925,219 @@ const vt = ({ type: e, scope: n, isSelected: s, sectionId: a, sectionIndex: o =
|
|
|
925
925
|
return g;
|
|
926
926
|
};
|
|
927
927
|
return /* @__PURE__ */ r.jsxs("div", { className: "min-h-screen flex flex-col bg-[var(--color-background)]", children: [
|
|
928
|
-
|
|
928
|
+
f != null && /* @__PURE__ */ r.jsx(
|
|
929
929
|
"div",
|
|
930
930
|
{
|
|
931
|
-
ref: (
|
|
932
|
-
|
|
931
|
+
ref: (b) => {
|
|
932
|
+
y.current[f.id] = b;
|
|
933
933
|
},
|
|
934
|
-
"data-section-id":
|
|
935
|
-
onMouseEnter: () =>
|
|
934
|
+
"data-section-id": f.id,
|
|
935
|
+
onMouseEnter: () => d(f.id),
|
|
936
936
|
children: /* @__PURE__ */ r.jsx(
|
|
937
937
|
ee,
|
|
938
938
|
{
|
|
939
|
-
section:
|
|
940
|
-
menu:
|
|
939
|
+
section: f,
|
|
940
|
+
menu: Q(f, o.main ?? []),
|
|
941
941
|
selectedId: a
|
|
942
942
|
}
|
|
943
943
|
)
|
|
944
944
|
}
|
|
945
945
|
),
|
|
946
946
|
/* @__PURE__ */ r.jsx("main", { className: "flex-1", children: A() }),
|
|
947
|
-
|
|
947
|
+
c != null && /* @__PURE__ */ r.jsx(
|
|
948
948
|
"div",
|
|
949
949
|
{
|
|
950
|
-
ref: (
|
|
951
|
-
|
|
950
|
+
ref: (b) => {
|
|
951
|
+
y.current[c.id] = b;
|
|
952
952
|
},
|
|
953
|
-
"data-section-id":
|
|
954
|
-
onMouseEnter: () =>
|
|
953
|
+
"data-section-id": c.id,
|
|
954
|
+
onMouseEnter: () => d(c.id),
|
|
955
955
|
children: /* @__PURE__ */ r.jsx(
|
|
956
956
|
ee,
|
|
957
957
|
{
|
|
958
|
-
section:
|
|
959
|
-
menu:
|
|
958
|
+
section: c,
|
|
959
|
+
menu: Q(c, o.main ?? []),
|
|
960
960
|
selectedId: a
|
|
961
961
|
}
|
|
962
962
|
)
|
|
963
963
|
}
|
|
964
964
|
)
|
|
965
965
|
] });
|
|
966
|
-
}, xt = '[data-jp-ignore-select="true"],[data-jp-interactive="true"],.ProseMirror,[contenteditable="true"],button,input,textarea,select,[role="button"],[role="menuitem"]',
|
|
967
|
-
var
|
|
968
|
-
const [e, n] = J(null), [
|
|
969
|
-
if (
|
|
970
|
-
const
|
|
971
|
-
if (!(
|
|
972
|
-
const
|
|
973
|
-
window.dispatchEvent(new CustomEvent(
|
|
966
|
+
}, xt = '[data-jp-ignore-select="true"],[data-jp-interactive="true"],.ProseMirror,[contenteditable="true"],button,input,textarea,select,[role="button"],[role="menuitem"]', St = "[data-jp-field],[data-jp-item-id],[data-jp-item-field]", Ct = () => {
|
|
967
|
+
var f;
|
|
968
|
+
const [e, n] = J(null), [o, a] = J(null), [s, i] = J({ main: [] }), [l, v] = J(null), [x, y] = J(null);
|
|
969
|
+
if ($(() => {
|
|
970
|
+
const c = (d) => {
|
|
971
|
+
if (!(d.origin !== window.location.origin || d.source !== window.parent) && (d.data.type === L.UPDATE_DRAFTS && (n(d.data.draft), a(d.data.globalDraft), d.data.menuConfig && i(d.data.menuConfig), d.data.themeConfig && ue.setTheme(d.data.themeConfig)), d.data.type === L.SYNC_SELECTION && v(d.data.selectedId), d.data.type === L.REQUEST_SCROLL_TO_SECTION && y(d.data.sectionId ?? null), d.data.type === L.REQUEST_INLINE_FLUSH)) {
|
|
972
|
+
const S = typeof d.data.requestId == "string" ? d.data.requestId : null;
|
|
973
|
+
window.dispatchEvent(new CustomEvent(L.REQUEST_INLINE_FLUSH, { detail: { requestId: S } })), setTimeout(() => {
|
|
974
974
|
window.parent.postMessage(
|
|
975
|
-
{ type:
|
|
975
|
+
{ type: L.INLINE_FLUSHED, requestId: S },
|
|
976
976
|
window.location.origin
|
|
977
977
|
);
|
|
978
978
|
}, 0);
|
|
979
979
|
}
|
|
980
980
|
};
|
|
981
|
-
return window.addEventListener("message",
|
|
982
|
-
}, []),
|
|
983
|
-
const
|
|
984
|
-
var
|
|
985
|
-
const
|
|
986
|
-
if (
|
|
987
|
-
|
|
981
|
+
return window.addEventListener("message", c), window.parent.postMessage({ type: L.STAGE_READY }, "*"), () => window.removeEventListener("message", c);
|
|
982
|
+
}, []), $(() => {
|
|
983
|
+
const c = (h) => !!h.closest(St), d = (h) => !!(h.closest('[data-jp-ignore-select="true"]') || h.closest(xt) && !c(h) || h.closest("a[href]") && !c(h)), S = (h) => {
|
|
984
|
+
var Y, B, z;
|
|
985
|
+
const C = h.target;
|
|
986
|
+
if (d(C)) {
|
|
987
|
+
C.closest("a[href]") && h.preventDefault();
|
|
988
988
|
return;
|
|
989
989
|
}
|
|
990
|
-
const A = h.clientX,
|
|
991
|
-
let g = null,
|
|
992
|
-
for (;
|
|
993
|
-
const F = (
|
|
994
|
-
if (F &&
|
|
995
|
-
g =
|
|
990
|
+
const A = h.clientX, b = h.clientY;
|
|
991
|
+
let g = null, m = C;
|
|
992
|
+
for (; m && m !== document.body; ) {
|
|
993
|
+
const F = (Y = m.getAttribute) == null ? void 0 : Y.call(m, "data-section-id"), O = (B = m.getAttribute) == null ? void 0 : B.call(m, "data-section-type"), N = (z = m.getAttribute) == null ? void 0 : z.call(m, "data-section-scope");
|
|
994
|
+
if (F && O && N) {
|
|
995
|
+
g = m;
|
|
996
996
|
break;
|
|
997
997
|
}
|
|
998
|
-
|
|
998
|
+
m = m.parentElement;
|
|
999
999
|
}
|
|
1000
1000
|
if (!g) return;
|
|
1001
1001
|
h.preventDefault(), h.stopPropagation();
|
|
1002
1002
|
const w = g.getAttribute("data-section-id"), k = g.getAttribute("data-section-type"), T = g.getAttribute("data-section-scope");
|
|
1003
1003
|
if (!w || !k || !T) return;
|
|
1004
1004
|
const P = { id: w, type: k, scope: T };
|
|
1005
|
-
if (
|
|
1006
|
-
window.parent.postMessage({ type:
|
|
1005
|
+
if (C === g) {
|
|
1006
|
+
window.parent.postMessage({ type: L.SECTION_SELECT, section: P }, "*");
|
|
1007
1007
|
return;
|
|
1008
1008
|
}
|
|
1009
|
-
const
|
|
1010
|
-
if (!
|
|
1011
|
-
window.parent.postMessage({ type:
|
|
1009
|
+
const I = document.elementFromPoint(A, b) ?? C;
|
|
1010
|
+
if (!I || !g.contains(I)) {
|
|
1011
|
+
window.parent.postMessage({ type: L.SECTION_SELECT, section: P }, "*");
|
|
1012
1012
|
return;
|
|
1013
1013
|
}
|
|
1014
|
-
if (
|
|
1015
|
-
window.parent.postMessage({ type:
|
|
1014
|
+
if (I === g) {
|
|
1015
|
+
window.parent.postMessage({ type: L.SECTION_SELECT, section: P }, "*");
|
|
1016
1016
|
return;
|
|
1017
1017
|
}
|
|
1018
|
-
let D =
|
|
1019
|
-
if (D.length === 0 &&
|
|
1018
|
+
let D = ge(I, g);
|
|
1019
|
+
if (D.length === 0 && I) {
|
|
1020
1020
|
let F = null;
|
|
1021
|
-
const
|
|
1022
|
-
var
|
|
1023
|
-
const
|
|
1024
|
-
if (
|
|
1025
|
-
for (let
|
|
1026
|
-
((
|
|
1021
|
+
const O = (N) => {
|
|
1022
|
+
var W, t;
|
|
1023
|
+
const H = N.getBoundingClientRect();
|
|
1024
|
+
if (H.left <= A && A <= H.right && H.top <= b && b <= H.bottom) {
|
|
1025
|
+
for (let u = 0; u < N.children.length; u++) O(N.children[u]);
|
|
1026
|
+
((W = N.getAttribute) != null && W.call(N, "data-jp-item-id") || (t = N.getAttribute) != null && t.call(N, "data-jp-field")) && (F = N);
|
|
1027
1027
|
}
|
|
1028
1028
|
};
|
|
1029
|
-
I
|
|
1029
|
+
O(I), F && (D = ge(F, g));
|
|
1030
1030
|
}
|
|
1031
|
-
const
|
|
1032
|
-
D.length > 0 && (
|
|
1031
|
+
const U = { type: L.SECTION_SELECT, section: P };
|
|
1032
|
+
D.length > 0 && (U.itemPath = D), window.parent.postMessage(U, "*");
|
|
1033
1033
|
};
|
|
1034
|
-
return document.addEventListener("click",
|
|
1035
|
-
}, []),
|
|
1036
|
-
if (!
|
|
1037
|
-
const
|
|
1038
|
-
return () => clearTimeout(
|
|
1039
|
-
}, [
|
|
1034
|
+
return document.addEventListener("click", S, !0), () => document.removeEventListener("click", S, !0);
|
|
1035
|
+
}, []), $(() => {
|
|
1036
|
+
if (!x) return;
|
|
1037
|
+
const c = setTimeout(() => y(null), 600);
|
|
1038
|
+
return () => clearTimeout(c);
|
|
1039
|
+
}, [x]), !e || !o)
|
|
1040
1040
|
return /* @__PURE__ */ r.jsx("div", { className: "flex items-center justify-center h-screen w-full bg-zinc-950 text-zinc-500 font-mono text-xs uppercase tracking-widest animate-pulse", children: "Waiting for Studio Signal..." });
|
|
1041
|
-
const
|
|
1042
|
-
...
|
|
1043
|
-
main:
|
|
1044
|
-
},
|
|
1041
|
+
const p = {
|
|
1042
|
+
...s,
|
|
1043
|
+
main: We((f = o.header) == null ? void 0 : f.data, s.main ?? [])
|
|
1044
|
+
}, E = (c) => {
|
|
1045
1045
|
window.parent.postMessage({
|
|
1046
|
-
type:
|
|
1047
|
-
activeSectionId:
|
|
1046
|
+
type: L.ACTIVE_SECTION_CHANGED,
|
|
1047
|
+
activeSectionId: c
|
|
1048
1048
|
}, "*");
|
|
1049
1049
|
};
|
|
1050
|
-
return /* @__PURE__ */ r.jsx(
|
|
1051
|
-
|
|
1050
|
+
return /* @__PURE__ */ r.jsx(me, { mode: "studio", children: /* @__PURE__ */ r.jsx("div", { className: "jp-ice-active", children: /* @__PURE__ */ r.jsx(
|
|
1051
|
+
Ae,
|
|
1052
1052
|
{
|
|
1053
1053
|
pageConfig: e,
|
|
1054
|
-
siteConfig:
|
|
1055
|
-
menuConfig:
|
|
1056
|
-
selectedId:
|
|
1057
|
-
scrollToSectionId:
|
|
1058
|
-
onActiveSectionChange:
|
|
1054
|
+
siteConfig: o,
|
|
1055
|
+
menuConfig: p,
|
|
1056
|
+
selectedId: l,
|
|
1057
|
+
scrollToSectionId: x,
|
|
1058
|
+
onActiveSectionChange: E
|
|
1059
1059
|
}
|
|
1060
1060
|
) }) });
|
|
1061
|
-
},
|
|
1062
|
-
const
|
|
1063
|
-
if (!document.getElementById(
|
|
1064
|
-
const
|
|
1065
|
-
|
|
1061
|
+
}, fe = ({ mode: e, tenantCss: n, adminCss: o, children: a }) => (De(() => {
|
|
1062
|
+
const s = `jp-theme-${e}`, i = e === "tenant" ? n : o;
|
|
1063
|
+
if (!document.getElementById(s) && i) {
|
|
1064
|
+
const l = document.createElement("style");
|
|
1065
|
+
l.id = s, l.innerHTML = i, document.head.appendChild(l);
|
|
1066
1066
|
}
|
|
1067
1067
|
return () => {
|
|
1068
|
-
const
|
|
1069
|
-
|
|
1068
|
+
const l = document.getElementById(s);
|
|
1069
|
+
l && l.remove();
|
|
1070
1070
|
};
|
|
1071
|
-
}, [e, n,
|
|
1072
|
-
let
|
|
1073
|
-
function
|
|
1074
|
-
return
|
|
1071
|
+
}, [e, n, o]), /* @__PURE__ */ r.jsx(r.Fragment, { children: a })), xe = ({ tenantCss: e, adminCss: n }) => /* @__PURE__ */ r.jsx(fe, { mode: "tenant", tenantCss: e, adminCss: n, children: /* @__PURE__ */ r.jsx(Ct, {}) });
|
|
1072
|
+
let le = null;
|
|
1073
|
+
function jt() {
|
|
1074
|
+
return le || (le = import("@olonjs/studio")), le;
|
|
1075
1075
|
}
|
|
1076
|
-
const
|
|
1077
|
-
const [a,
|
|
1078
|
-
|
|
1079
|
-
let
|
|
1080
|
-
return
|
|
1081
|
-
|
|
1076
|
+
const Se = ({ tenantCss: e, adminCss: n, ...o }) => {
|
|
1077
|
+
const [a, s] = J(null);
|
|
1078
|
+
$(() => {
|
|
1079
|
+
let l = !1;
|
|
1080
|
+
return jt().then((v) => {
|
|
1081
|
+
l || s(v);
|
|
1082
1082
|
}), () => {
|
|
1083
|
-
|
|
1083
|
+
l = !0;
|
|
1084
1084
|
};
|
|
1085
1085
|
}, []);
|
|
1086
|
-
const
|
|
1087
|
-
return /* @__PURE__ */ r.jsx(
|
|
1088
|
-
},
|
|
1086
|
+
const i = n || (a == null ? void 0 : a.adminSkinCss) || "";
|
|
1087
|
+
return /* @__PURE__ */ r.jsx(fe, { mode: "admin", tenantCss: e, adminCss: i, children: /* @__PURE__ */ r.jsx(me, { mode: "studio", children: a ? /* @__PURE__ */ r.jsx(a.StudioRouteBody, { ...o }) : /* @__PURE__ */ r.jsx("div", { className: "flex items-center justify-center h-screen w-screen bg-zinc-950 text-zinc-500 font-mono text-xs uppercase tracking-widest animate-pulse", children: "Loading Studio..." }) }) });
|
|
1088
|
+
}, re = ({
|
|
1089
1089
|
pageRegistry: e,
|
|
1090
1090
|
siteConfig: n,
|
|
1091
|
-
menuConfig:
|
|
1091
|
+
menuConfig: o,
|
|
1092
1092
|
themeConfig: a,
|
|
1093
|
-
collections:
|
|
1094
|
-
collectionSchemas:
|
|
1095
|
-
refDocuments:
|
|
1096
|
-
tenantCss:
|
|
1097
|
-
adminCss:
|
|
1098
|
-
NotFoundComponent:
|
|
1093
|
+
collections: s,
|
|
1094
|
+
collectionSchemas: i,
|
|
1095
|
+
refDocuments: l,
|
|
1096
|
+
tenantCss: v,
|
|
1097
|
+
adminCss: x,
|
|
1098
|
+
NotFoundComponent: y
|
|
1099
1099
|
}) => {
|
|
1100
|
-
const
|
|
1101
|
-
() =>
|
|
1102
|
-
[e,
|
|
1103
|
-
),
|
|
1104
|
-
() =>
|
|
1105
|
-
[
|
|
1106
|
-
),
|
|
1107
|
-
() =>
|
|
1108
|
-
pages:
|
|
1100
|
+
const p = He(), E = qe(p.pathname), f = K(
|
|
1101
|
+
() => Ge(e, E),
|
|
1102
|
+
[e, E]
|
|
1103
|
+
), c = K(
|
|
1104
|
+
() => f ? Ke(f.page, f.params, s) : null,
|
|
1105
|
+
[s, f]
|
|
1106
|
+
), d = K(
|
|
1107
|
+
() => we({
|
|
1108
|
+
pages: f ? { [f.registrySlug]: f.page } : {},
|
|
1109
1109
|
siteConfig: n,
|
|
1110
1110
|
themeConfig: a,
|
|
1111
|
-
menuConfig:
|
|
1112
|
-
collections:
|
|
1113
|
-
collectionSchemas:
|
|
1114
|
-
collectionContext:
|
|
1115
|
-
refDocuments:
|
|
1111
|
+
menuConfig: o,
|
|
1112
|
+
collections: s,
|
|
1113
|
+
collectionSchemas: i,
|
|
1114
|
+
collectionContext: c,
|
|
1115
|
+
refDocuments: l
|
|
1116
1116
|
}),
|
|
1117
|
-
[
|
|
1118
|
-
),
|
|
1119
|
-
return
|
|
1117
|
+
[f, n, a, o, s, i, c, l]
|
|
1118
|
+
), S = f ? d.pages[f.registrySlug] : void 0;
|
|
1119
|
+
return $(() => {
|
|
1120
1120
|
var h;
|
|
1121
1121
|
try {
|
|
1122
|
-
(h =
|
|
1123
|
-
} catch (
|
|
1124
|
-
console.warn("[JsonPages] visitor theme resolution failed",
|
|
1122
|
+
(h = d.themeConfig) != null && h.tokens && ue.setTheme(d.themeConfig);
|
|
1123
|
+
} catch (C) {
|
|
1124
|
+
console.warn("[JsonPages] visitor theme resolution failed", C);
|
|
1125
1125
|
}
|
|
1126
|
-
}, [
|
|
1127
|
-
var A,
|
|
1128
|
-
if (!
|
|
1129
|
-
const h = typeof ((A =
|
|
1130
|
-
|
|
1131
|
-
}, [
|
|
1132
|
-
|
|
1126
|
+
}, [d.themeConfig]), $(() => {
|
|
1127
|
+
var A, b;
|
|
1128
|
+
if (!S) return;
|
|
1129
|
+
const h = typeof ((A = S.meta) == null ? void 0 : A.title) == "string" ? S.meta.title : E, C = typeof ((b = S.meta) == null ? void 0 : b.description) == "string" ? S.meta.description : "";
|
|
1130
|
+
ve("mcp-manifest", Xe(E)), ve("olon-contract", Qe(E)), Ze(h, C, E === "home" ? "/" : `/${E}`);
|
|
1131
|
+
}, [S, E]), S ? /* @__PURE__ */ r.jsx(fe, { mode: "tenant", tenantCss: v, adminCss: x, children: /* @__PURE__ */ r.jsx(me, { mode: "visitor", children: /* @__PURE__ */ r.jsx(
|
|
1132
|
+
Ae,
|
|
1133
1133
|
{
|
|
1134
|
-
pageConfig:
|
|
1135
|
-
siteConfig:
|
|
1136
|
-
menuConfig:
|
|
1134
|
+
pageConfig: S,
|
|
1135
|
+
siteConfig: d.siteConfig,
|
|
1136
|
+
menuConfig: d.menuConfig
|
|
1137
1137
|
}
|
|
1138
|
-
) }) }) : /* @__PURE__ */ r.jsx(
|
|
1138
|
+
) }) }) : /* @__PURE__ */ r.jsx(y, {});
|
|
1139
1139
|
};
|
|
1140
|
-
function
|
|
1140
|
+
function wt(e) {
|
|
1141
1141
|
const n = {
|
|
1142
1142
|
pageRegistry: e.pageRegistry,
|
|
1143
1143
|
siteConfig: e.siteConfig,
|
|
@@ -1149,7 +1149,7 @@ function Ct(e) {
|
|
|
1149
1149
|
tenantCss: e.tenantCss,
|
|
1150
1150
|
adminCss: e.adminCss,
|
|
1151
1151
|
NotFoundComponent: e.NotFoundComponent
|
|
1152
|
-
},
|
|
1152
|
+
}, o = {
|
|
1153
1153
|
pageRegistry: e.pageRegistry,
|
|
1154
1154
|
schemas: e.schemas,
|
|
1155
1155
|
siteConfig: e.siteConfig,
|
|
@@ -1170,32 +1170,32 @@ function Ct(e) {
|
|
|
1170
1170
|
showHotSave: e.persistence.showHotSave,
|
|
1171
1171
|
showColdSave: e.persistence.showColdSave
|
|
1172
1172
|
};
|
|
1173
|
-
return /* @__PURE__ */ r.jsxs(
|
|
1174
|
-
/* @__PURE__ */ r.jsx(
|
|
1175
|
-
/* @__PURE__ */ r.jsx(
|
|
1176
|
-
/* @__PURE__ */ r.jsx(
|
|
1177
|
-
/* @__PURE__ */ r.jsx(
|
|
1173
|
+
return /* @__PURE__ */ r.jsxs(M, { element: /* @__PURE__ */ r.jsx(Re, {}), children: [
|
|
1174
|
+
/* @__PURE__ */ r.jsx(M, { path: "/", element: /* @__PURE__ */ r.jsx(re, { ...n }) }),
|
|
1175
|
+
/* @__PURE__ */ r.jsx(M, { path: "/*", element: /* @__PURE__ */ r.jsx(re, { ...n }) }),
|
|
1176
|
+
/* @__PURE__ */ r.jsx(M, { path: "/admin", element: /* @__PURE__ */ r.jsx(Se, { ...o }) }),
|
|
1177
|
+
/* @__PURE__ */ r.jsx(M, { path: "/admin/*", element: /* @__PURE__ */ r.jsx(Se, { ...o }) }),
|
|
1178
1178
|
/* @__PURE__ */ r.jsx(
|
|
1179
|
-
|
|
1179
|
+
M,
|
|
1180
1180
|
{
|
|
1181
1181
|
path: "/admin/preview",
|
|
1182
1182
|
element: /* @__PURE__ */ r.jsx(xe, { tenantCss: e.tenantCss, adminCss: e.adminCss })
|
|
1183
1183
|
}
|
|
1184
1184
|
),
|
|
1185
1185
|
/* @__PURE__ */ r.jsx(
|
|
1186
|
-
|
|
1186
|
+
M,
|
|
1187
1187
|
{
|
|
1188
1188
|
path: "/admin/preview/*",
|
|
1189
1189
|
element: /* @__PURE__ */ r.jsx(xe, { tenantCss: e.tenantCss, adminCss: e.adminCss })
|
|
1190
1190
|
}
|
|
1191
1191
|
),
|
|
1192
|
-
/* @__PURE__ */ r.jsx(
|
|
1192
|
+
/* @__PURE__ */ r.jsx(M, { path: "*", element: /* @__PURE__ */ r.jsx(e.NotFoundComponent, {}) })
|
|
1193
1193
|
] });
|
|
1194
1194
|
}
|
|
1195
|
-
function
|
|
1196
|
-
return /* @__PURE__ */ r.jsx(
|
|
1195
|
+
function Dt({ config: e }) {
|
|
1196
|
+
return /* @__PURE__ */ r.jsx(ke, { config: e, routesBuilder: wt });
|
|
1197
1197
|
}
|
|
1198
|
-
function
|
|
1198
|
+
function Tt(e) {
|
|
1199
1199
|
const n = {
|
|
1200
1200
|
pageRegistry: e.pageRegistry,
|
|
1201
1201
|
siteConfig: e.siteConfig,
|
|
@@ -1209,40 +1209,103 @@ function wt(e) {
|
|
|
1209
1209
|
// empty string at the Core level for runtime; ignored by ThemeLoader in tenant mode
|
|
1210
1210
|
NotFoundComponent: e.NotFoundComponent
|
|
1211
1211
|
};
|
|
1212
|
-
return /* @__PURE__ */ r.jsxs(
|
|
1213
|
-
/* @__PURE__ */ r.jsx(
|
|
1214
|
-
/* @__PURE__ */ r.jsx(
|
|
1215
|
-
/* @__PURE__ */ r.jsx(
|
|
1212
|
+
return /* @__PURE__ */ r.jsxs(M, { element: /* @__PURE__ */ r.jsx(Re, {}), children: [
|
|
1213
|
+
/* @__PURE__ */ r.jsx(M, { path: "/", element: /* @__PURE__ */ r.jsx(re, { ...n }) }),
|
|
1214
|
+
/* @__PURE__ */ r.jsx(M, { path: "/*", element: /* @__PURE__ */ r.jsx(re, { ...n }) }),
|
|
1215
|
+
/* @__PURE__ */ r.jsx(M, { path: "*", element: /* @__PURE__ */ r.jsx(e.NotFoundComponent, {}) })
|
|
1216
1216
|
] });
|
|
1217
1217
|
}
|
|
1218
|
-
function
|
|
1219
|
-
return /* @__PURE__ */ r.jsx(
|
|
1218
|
+
function Lt({ config: e }) {
|
|
1219
|
+
return /* @__PURE__ */ r.jsx(ke, { config: e, routesBuilder: Tt });
|
|
1220
|
+
}
|
|
1221
|
+
const _t = { status: "idle", message: "" }, Rt = oe({});
|
|
1222
|
+
function Mt(e) {
|
|
1223
|
+
return ne(Rt)[e] ?? _t;
|
|
1220
1224
|
}
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1225
|
+
function kt(e, n) {
|
|
1226
|
+
return !!(e && n);
|
|
1227
|
+
}
|
|
1228
|
+
function Ft(e) {
|
|
1229
|
+
const n = e.apiUrl.trim(), o = e.apiKey.trim(), a = kt(n, o), s = a && e.save2RepoFlag, i = a;
|
|
1230
|
+
let l = "local";
|
|
1231
|
+
return a && (l = s ? "static" : "live"), {
|
|
1232
|
+
isCloudMode: a,
|
|
1233
|
+
bootSource: l,
|
|
1234
|
+
hotSaveEnabled: i,
|
|
1235
|
+
save2RepoEnabled: s,
|
|
1236
|
+
showLocalSave: !a,
|
|
1237
|
+
showHotSave: i,
|
|
1238
|
+
showColdSave: s,
|
|
1239
|
+
apiUrl: n,
|
|
1240
|
+
apiKey: o
|
|
1241
|
+
};
|
|
1242
|
+
}
|
|
1243
|
+
function te(e, n) {
|
|
1244
|
+
const o = e[n];
|
|
1245
|
+
return typeof o == "string" ? o.trim() : "";
|
|
1246
|
+
}
|
|
1247
|
+
function $t(e) {
|
|
1248
|
+
const n = te(e, "VITE_OLONJS_CLOUD_URL") || te(e, "VITE_JSONPAGES_CLOUD_URL"), o = te(e, "VITE_OLONJS_API_KEY") || te(e, "VITE_JSONPAGES_API_KEY"), a = e.VITE_SAVE2REPO === "true";
|
|
1249
|
+
return { apiUrl: n, apiKey: o, save2RepoFlag: a };
|
|
1250
|
+
}
|
|
1251
|
+
function Nt(e) {
|
|
1252
|
+
return e.trim().replace(/\/+$/, "");
|
|
1253
|
+
}
|
|
1254
|
+
function Ut(e) {
|
|
1255
|
+
const n = Nt(e);
|
|
1256
|
+
if (!n) return [];
|
|
1257
|
+
const o = /\/api\/v1$/i.test(n) ? n : `${n}/api/v1`;
|
|
1258
|
+
return Array.from(/* @__PURE__ */ new Set([o, n]));
|
|
1259
|
+
}
|
|
1260
|
+
function zt(e) {
|
|
1261
|
+
const { apiUrl: n, apiKey: o, fetchImpl: a = fetch, onSuccess: s } = e;
|
|
1262
|
+
return async (i, l) => {
|
|
1263
|
+
const v = n.trim(), x = o.trim();
|
|
1264
|
+
if (!v || !x)
|
|
1265
|
+
throw new Error("Cloud mode is not configured for hot save.");
|
|
1266
|
+
const y = v.replace(/\/+$/, ""), p = await a(`${y}/hotSave`, {
|
|
1267
|
+
method: "POST",
|
|
1268
|
+
headers: {
|
|
1269
|
+
"Content-Type": "application/json",
|
|
1270
|
+
Authorization: `Bearer ${x}`
|
|
1271
|
+
},
|
|
1272
|
+
body: JSON.stringify({
|
|
1273
|
+
slug: l,
|
|
1274
|
+
page: i.page,
|
|
1275
|
+
siteConfig: i.site,
|
|
1276
|
+
collections: i.collections
|
|
1277
|
+
})
|
|
1278
|
+
}), E = await p.json().catch(() => ({}));
|
|
1279
|
+
if (!p.ok)
|
|
1280
|
+
throw new Error(E.error || E.code || `Hot save failed: ${p.status}`);
|
|
1281
|
+
await (s == null ? void 0 : s({ state: i, slug: l, apiUrl: v, apiKey: x }));
|
|
1282
|
+
};
|
|
1224
1283
|
}
|
|
1225
1284
|
export {
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1285
|
+
st as ConfigProvider,
|
|
1286
|
+
ot as DefaultNotFound,
|
|
1287
|
+
nt as EngineErrorBoundary,
|
|
1288
|
+
_e as IconRegistryContext,
|
|
1289
|
+
Dt as JsonPagesEngine,
|
|
1231
1290
|
Rt as OlonFormsContext,
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1291
|
+
Lt as OlonJSEngine,
|
|
1292
|
+
Ae as PageRenderer,
|
|
1293
|
+
Ct as PreviewEntry,
|
|
1235
1294
|
xe as PreviewRoute,
|
|
1236
1295
|
ee as SectionRenderer,
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
at as
|
|
1296
|
+
me as StudioProvider,
|
|
1297
|
+
Se as StudioRoute,
|
|
1298
|
+
fe as ThemeLoader,
|
|
1299
|
+
re as VisitorRoute,
|
|
1300
|
+
Ut as buildApiCandidates,
|
|
1301
|
+
Jt as buildThemeVariableMap,
|
|
1302
|
+
zt as createHotSaveHandler,
|
|
1303
|
+
$t as readCloudEnvFromVite,
|
|
1304
|
+
Ft as resolveCloudPolicy,
|
|
1305
|
+
ue as themeManager,
|
|
1306
|
+
at as useConfig,
|
|
1307
|
+
yt as useDocumentMeta,
|
|
1308
|
+
Mt as useFormState,
|
|
1309
|
+
It as useIconRegistry,
|
|
1310
|
+
it as useStudio
|
|
1248
1311
|
};
|