@questpie/admin 3.2.1 → 3.2.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/client/blocks/block-renderer.d.mts +2 -2
- package/dist/client/components/preview/live-preview-mode.mjs +172 -163
- package/dist/client/contexts/focus-context.d.mts +5 -1
- package/dist/client/contexts/focus-context.mjs +39 -4
- package/dist/client/views/auth/accept-invite-form.d.mts +2 -2
- package/dist/client/views/auth/auth-layout.d.mts +3 -3
- package/dist/client/views/auth/login-form.d.mts +2 -2
- package/dist/client/views/auth/reset-password-form.d.mts +2 -2
- package/dist/client/views/auth/setup-form.d.mts +2 -2
- package/dist/client/views/pages/accept-invite-page.d.mts +2 -2
- package/dist/client/views/pages/dashboard-page.d.mts +2 -2
- package/dist/client/views/pages/forgot-password-page.d.mts +2 -2
- package/dist/client/views/pages/reset-password-page.d.mts +2 -2
- package/dist/client/views/pages/setup-page.d.mts +2 -2
- package/dist/components/rich-text/rich-text-renderer.d.mts +2 -2
- package/dist/server/modules/admin/collections/account.d.mts +50 -50
- package/dist/server/modules/admin/collections/admin-locks.d.mts +54 -54
- package/dist/server/modules/admin/collections/admin-preferences.d.mts +39 -39
- package/dist/server/modules/admin/collections/admin-saved-views.d.mts +47 -47
- package/dist/server/modules/admin/collections/apikey.d.mts +67 -67
- package/dist/server/modules/admin/collections/assets.d.mts +34 -34
- package/dist/server/modules/admin/collections/session.d.mts +42 -42
- package/dist/server/modules/admin/collections/user.d.mts +53 -53
- package/dist/server/modules/admin/collections/verification.d.mts +32 -32
- package/dist/server/modules/admin/routes/admin-config.d.mts +2 -2
- package/dist/server/modules/admin/routes/execute-action.d.mts +9 -9
- package/dist/server/modules/admin/routes/locales.d.mts +2 -2
- package/dist/server/modules/admin/routes/preview.d.mts +11 -11
- package/dist/server/modules/admin/routes/setup.d.mts +7 -7
- package/dist/server/modules/admin/routes/translations.d.mts +4 -4
- package/dist/server/modules/admin/routes/widget-data.d.mts +5 -5
- package/dist/server/modules/admin-preferences/collections/saved-views.d.mts +27 -27
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BlockContent } from "./types.mjs";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime17 from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region src/client/blocks/block-renderer.d.ts
|
|
6
6
|
|
|
@@ -50,6 +50,6 @@ declare function BlockRenderer({
|
|
|
50
50
|
onBlockClick,
|
|
51
51
|
onBlockInsert,
|
|
52
52
|
className
|
|
53
|
-
}: BlockRendererProps):
|
|
53
|
+
}: BlockRendererProps): react_jsx_runtime17.JSX.Element | null;
|
|
54
54
|
//#endregion
|
|
55
55
|
export { BlockRenderer, BlockRendererProps };
|
|
@@ -4,7 +4,7 @@ import { useTranslation } from "../../i18n/hooks.mjs";
|
|
|
4
4
|
import { cn } from "../../lib/utils.mjs";
|
|
5
5
|
import { Button } from "../ui/button.mjs";
|
|
6
6
|
import { Tabs, TabsList, TabsTrigger } from "../ui/tabs.mjs";
|
|
7
|
-
import { FocusProvider, parsePreviewFieldPath,
|
|
7
|
+
import { FocusProvider, parsePreviewFieldPath, scheduleScrollFieldIntoView, useFocus } from "../../contexts/focus-context.mjs";
|
|
8
8
|
import { useIsMobile } from "../../hooks/use-media-query.mjs";
|
|
9
9
|
import { PreviewPane } from "./preview-pane.mjs";
|
|
10
10
|
import { c } from "react/compiler-runtime";
|
|
@@ -22,6 +22,11 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
22
22
|
* Mobile: Tabs to switch between form and preview
|
|
23
23
|
*/
|
|
24
24
|
const DEV_TELEMETRY = process.env.NODE_ENV === "development";
|
|
25
|
+
function getFocusStatePath(state) {
|
|
26
|
+
if (state.type === "field" || state.type === "relation") return state.fieldPath;
|
|
27
|
+
if (state.type === "block") return state.fieldPath ? `content._values.${state.blockId}.${state.fieldPath}` : `content._values.${state.blockId}`;
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
25
30
|
function useResizablePane(t0, t1, t2) {
|
|
26
31
|
const $ = c(9);
|
|
27
32
|
const defaultSize = t0 === void 0 ? 50 : t0;
|
|
@@ -126,7 +131,7 @@ function useLivePreviewRenderTelemetry(t0) {
|
|
|
126
131
|
React.useEffect(t1);
|
|
127
132
|
}
|
|
128
133
|
function LivePreviewContent(t0) {
|
|
129
|
-
const $ = c(
|
|
134
|
+
const $ = c(79);
|
|
130
135
|
const { open, children, previewUrl, previewRef, onFieldValueEdited, onPatchApplied, onResyncRequest, defaultSize: t1, minSize: t2 } = t0;
|
|
131
136
|
const defaultSize = t1 === void 0 ? 50 : t1;
|
|
132
137
|
const minSize = t2 === void 0 ? 30 : t2;
|
|
@@ -149,29 +154,40 @@ function LivePreviewContent(t0) {
|
|
|
149
154
|
const { previewPercent, containerRef, handleMouseDown } = useResizablePane(defaultSize, minSize, open && !isMobile);
|
|
150
155
|
const focusContext = useFocus();
|
|
151
156
|
const focusState = focusContext.state;
|
|
152
|
-
const handleExitPreview = _temp;
|
|
153
157
|
let t4;
|
|
158
|
+
if ($[4] !== focusContext) {
|
|
159
|
+
t4 = (state) => {
|
|
160
|
+
if (state.type === "field") focusContext.focusField(state.fieldPath);
|
|
161
|
+
else if (state.type === "block") focusContext.focusBlock(state.blockId, state.fieldPath);
|
|
162
|
+
else if (state.type === "relation") focusContext.focusRelation(state.fieldPath, state.targetCollection);
|
|
163
|
+
};
|
|
164
|
+
$[4] = focusContext;
|
|
165
|
+
$[5] = t4;
|
|
166
|
+
} else t4 = $[5];
|
|
167
|
+
const applyFocusState = t4;
|
|
168
|
+
const handleExitPreview = _temp;
|
|
154
169
|
let t5;
|
|
155
|
-
|
|
156
|
-
|
|
170
|
+
let t6;
|
|
171
|
+
if ($[6] !== open) {
|
|
172
|
+
t5 = () => {
|
|
157
173
|
if (!open) setActiveTab("form");
|
|
158
174
|
};
|
|
159
|
-
|
|
160
|
-
$[
|
|
161
|
-
$[
|
|
162
|
-
$[
|
|
175
|
+
t6 = [open];
|
|
176
|
+
$[6] = open;
|
|
177
|
+
$[7] = t5;
|
|
178
|
+
$[8] = t6;
|
|
163
179
|
} else {
|
|
164
|
-
|
|
165
|
-
|
|
180
|
+
t5 = $[7];
|
|
181
|
+
t6 = $[8];
|
|
166
182
|
}
|
|
167
|
-
React.useEffect(
|
|
168
|
-
let t6;
|
|
183
|
+
React.useEffect(t5, t6);
|
|
169
184
|
let t7;
|
|
170
|
-
|
|
171
|
-
|
|
185
|
+
let t8;
|
|
186
|
+
if ($[9] !== focusState || $[10] !== open || $[11] !== previewRef) {
|
|
187
|
+
t7 = () => {
|
|
172
188
|
if (!open) return;
|
|
173
189
|
if (!previewRef.current) return;
|
|
174
|
-
if (focusState.type === "field") previewRef.current.sendFocusToPreview(focusState.fieldPath);
|
|
190
|
+
if (focusState.type === "field" || focusState.type === "relation") previewRef.current.sendFocusToPreview(focusState.fieldPath);
|
|
175
191
|
else if (focusState.type === "block") if (focusState.fieldPath) {
|
|
176
192
|
const fullPath = `content._values.${focusState.blockId}.${focusState.fieldPath}`;
|
|
177
193
|
previewRef.current.sendFocusToPreview(fullPath);
|
|
@@ -180,25 +196,25 @@ function LivePreviewContent(t0) {
|
|
|
180
196
|
previewRef.current.sendFocusToPreview(fullPath_0);
|
|
181
197
|
}
|
|
182
198
|
};
|
|
183
|
-
|
|
199
|
+
t8 = [
|
|
184
200
|
focusState,
|
|
185
201
|
previewRef,
|
|
186
202
|
open
|
|
187
203
|
];
|
|
188
|
-
$[
|
|
189
|
-
$[
|
|
190
|
-
$[
|
|
191
|
-
$[
|
|
192
|
-
$[
|
|
204
|
+
$[9] = focusState;
|
|
205
|
+
$[10] = open;
|
|
206
|
+
$[11] = previewRef;
|
|
207
|
+
$[12] = t7;
|
|
208
|
+
$[13] = t8;
|
|
193
209
|
} else {
|
|
194
|
-
|
|
195
|
-
|
|
210
|
+
t7 = $[12];
|
|
211
|
+
t8 = $[13];
|
|
196
212
|
}
|
|
197
|
-
React.useEffect(
|
|
198
|
-
let
|
|
213
|
+
React.useEffect(t7, t8);
|
|
214
|
+
let t10;
|
|
199
215
|
let t9;
|
|
200
|
-
if ($[
|
|
201
|
-
|
|
216
|
+
if ($[14] !== applyFocusState || $[15] !== focusState || $[16] !== open) {
|
|
217
|
+
t9 = () => {
|
|
202
218
|
if (!open) return;
|
|
203
219
|
const handleKeyDown = (e) => {
|
|
204
220
|
if (e.key !== "Tab") return;
|
|
@@ -208,66 +224,63 @@ function LivePreviewContent(t0) {
|
|
|
208
224
|
if (fields.length === 0) return;
|
|
209
225
|
if (!formScope.contains(document.activeElement)) return;
|
|
210
226
|
e.preventDefault();
|
|
211
|
-
const currentPath = focusState
|
|
227
|
+
const currentPath = getFocusStatePath(focusState);
|
|
212
228
|
const currentIdx = currentPath ? fields.findIndex((el) => el.getAttribute("data-field-path") === currentPath) : -1;
|
|
213
229
|
let nextIdx;
|
|
214
230
|
if (e.shiftKey) nextIdx = currentIdx <= 0 ? fields.length - 1 : currentIdx - 1;
|
|
215
231
|
else nextIdx = currentIdx >= fields.length - 1 ? 0 : currentIdx + 1;
|
|
216
232
|
const nextPath = fields[nextIdx]?.getAttribute("data-field-path");
|
|
217
|
-
if (nextPath)
|
|
233
|
+
if (nextPath) applyFocusState(parsePreviewFieldPath(nextPath));
|
|
218
234
|
};
|
|
219
235
|
window.addEventListener("keydown", handleKeyDown);
|
|
220
236
|
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
221
237
|
};
|
|
222
|
-
|
|
238
|
+
t10 = [
|
|
223
239
|
focusState,
|
|
224
|
-
|
|
240
|
+
applyFocusState,
|
|
225
241
|
open
|
|
226
242
|
];
|
|
227
|
-
$[
|
|
228
|
-
$[
|
|
229
|
-
$[
|
|
230
|
-
$[
|
|
231
|
-
$[
|
|
243
|
+
$[14] = applyFocusState;
|
|
244
|
+
$[15] = focusState;
|
|
245
|
+
$[16] = open;
|
|
246
|
+
$[17] = t10;
|
|
247
|
+
$[18] = t9;
|
|
232
248
|
} else {
|
|
233
|
-
|
|
234
|
-
t9 = $[
|
|
249
|
+
t10 = $[17];
|
|
250
|
+
t9 = $[18];
|
|
235
251
|
}
|
|
236
|
-
React.useEffect(
|
|
237
|
-
let t10;
|
|
238
|
-
if ($[17] !== focusContext) {
|
|
239
|
-
t10 = (fieldPath, context) => {
|
|
240
|
-
const state = parsePreviewFieldPath(fieldPath, context);
|
|
241
|
-
if (state.type === "field") focusContext.focusField(state.fieldPath);
|
|
242
|
-
else if (state.type === "block") focusContext.focusBlock(state.blockId, state.fieldPath);
|
|
243
|
-
else if (state.type === "relation") focusContext.focusRelation(state.fieldPath, state.targetCollection);
|
|
244
|
-
};
|
|
245
|
-
$[17] = focusContext;
|
|
246
|
-
$[18] = t10;
|
|
247
|
-
} else t10 = $[18];
|
|
248
|
-
const handlePreviewFieldClick = t10;
|
|
252
|
+
React.useEffect(t9, t10);
|
|
249
253
|
let t11;
|
|
250
|
-
if ($[19] !==
|
|
251
|
-
t11 = (
|
|
252
|
-
|
|
254
|
+
if ($[19] !== applyFocusState) {
|
|
255
|
+
t11 = (fieldPath, context) => {
|
|
256
|
+
applyFocusState(parsePreviewFieldPath(fieldPath, context));
|
|
253
257
|
};
|
|
254
|
-
$[19] =
|
|
258
|
+
$[19] = applyFocusState;
|
|
255
259
|
$[20] = t11;
|
|
256
260
|
} else t11 = $[20];
|
|
257
|
-
const
|
|
261
|
+
const handlePreviewFieldClick = t11;
|
|
258
262
|
let t12;
|
|
259
263
|
if ($[21] !== focusContext) {
|
|
260
|
-
t12 = (
|
|
261
|
-
focusContext.
|
|
264
|
+
t12 = (blockId) => {
|
|
265
|
+
focusContext.focusBlock(blockId);
|
|
262
266
|
};
|
|
263
267
|
$[21] = focusContext;
|
|
264
268
|
$[22] = t12;
|
|
265
269
|
} else t12 = $[22];
|
|
266
|
-
const
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
270
|
+
const handlePreviewBlockClick = t12;
|
|
271
|
+
let t13;
|
|
272
|
+
if ($[23] !== focusContext) {
|
|
273
|
+
t13 = (message) => {
|
|
274
|
+
focusContext.requestBlockInsert(message.position, message.referenceBlockId);
|
|
275
|
+
};
|
|
276
|
+
$[23] = focusContext;
|
|
277
|
+
$[24] = t13;
|
|
278
|
+
} else t13 = $[24];
|
|
279
|
+
const handlePreviewBlockInsertRequest = t13;
|
|
280
|
+
const t14 = open ? "bg-background fixed inset-0 z-50 flex flex-col" : "w-full";
|
|
281
|
+
let t15;
|
|
282
|
+
if ($[25] !== activeTab || $[26] !== isMobile || $[27] !== open || $[28] !== t) {
|
|
283
|
+
t15 = open && /* @__PURE__ */ jsxs("div", {
|
|
271
284
|
className: "flex shrink-0 items-center justify-between border-b px-4 py-2",
|
|
272
285
|
children: [
|
|
273
286
|
/* @__PURE__ */ jsxs("div", {
|
|
@@ -316,46 +329,46 @@ function LivePreviewContent(t0) {
|
|
|
316
329
|
})
|
|
317
330
|
]
|
|
318
331
|
});
|
|
319
|
-
$[
|
|
320
|
-
$[
|
|
321
|
-
$[
|
|
322
|
-
$[
|
|
323
|
-
$[
|
|
324
|
-
} else
|
|
325
|
-
const
|
|
326
|
-
const
|
|
327
|
-
let t17;
|
|
328
|
-
if ($[28] !== activeTab || $[29] !== isMobile || $[30] !== open) {
|
|
329
|
-
t17 = open ? isMobile ? cn("h-full overflow-y-auto p-6", activeTab !== "form" && "hidden") : "bg-background h-full overflow-y-auto border-r p-6" : "w-full";
|
|
330
|
-
$[28] = activeTab;
|
|
331
|
-
$[29] = isMobile;
|
|
332
|
-
$[30] = open;
|
|
333
|
-
$[31] = t17;
|
|
334
|
-
} else t17 = $[31];
|
|
332
|
+
$[25] = activeTab;
|
|
333
|
+
$[26] = isMobile;
|
|
334
|
+
$[27] = open;
|
|
335
|
+
$[28] = t;
|
|
336
|
+
$[29] = t15;
|
|
337
|
+
} else t15 = $[29];
|
|
338
|
+
const t16 = open && !isMobile ? containerRef : void 0;
|
|
339
|
+
const t17 = open ? isMobile ? "min-h-0 flex-1" : "flex min-h-0 flex-1" : "w-full";
|
|
335
340
|
let t18;
|
|
336
|
-
if ($[
|
|
337
|
-
t18 = open
|
|
338
|
-
$[
|
|
339
|
-
$[
|
|
340
|
-
$[
|
|
341
|
-
$[
|
|
342
|
-
} else t18 = $[
|
|
341
|
+
if ($[30] !== activeTab || $[31] !== isMobile || $[32] !== open) {
|
|
342
|
+
t18 = open ? isMobile ? cn("h-full overflow-y-auto p-6", activeTab !== "form" && "hidden") : "bg-background h-full overflow-y-auto border-r p-6" : "w-full";
|
|
343
|
+
$[30] = activeTab;
|
|
344
|
+
$[31] = isMobile;
|
|
345
|
+
$[32] = open;
|
|
346
|
+
$[33] = t18;
|
|
347
|
+
} else t18 = $[33];
|
|
343
348
|
let t19;
|
|
344
|
-
if ($[
|
|
345
|
-
t19 =
|
|
349
|
+
if ($[34] !== isMobile || $[35] !== open || $[36] !== previewPercent) {
|
|
350
|
+
t19 = open && !isMobile ? { width: `${100 - previewPercent}%` } : void 0;
|
|
351
|
+
$[34] = isMobile;
|
|
352
|
+
$[35] = open;
|
|
353
|
+
$[36] = previewPercent;
|
|
354
|
+
$[37] = t19;
|
|
355
|
+
} else t19 = $[37];
|
|
356
|
+
let t20;
|
|
357
|
+
if ($[38] !== children || $[39] !== t18 || $[40] !== t19) {
|
|
358
|
+
t20 = /* @__PURE__ */ jsx("div", {
|
|
346
359
|
"data-preview-form-scope": true,
|
|
347
|
-
className:
|
|
348
|
-
style:
|
|
360
|
+
className: t18,
|
|
361
|
+
style: t19,
|
|
349
362
|
children
|
|
350
363
|
});
|
|
351
|
-
$[
|
|
352
|
-
$[
|
|
353
|
-
$[
|
|
354
|
-
$[
|
|
355
|
-
} else
|
|
356
|
-
let
|
|
357
|
-
if ($[
|
|
358
|
-
|
|
364
|
+
$[38] = children;
|
|
365
|
+
$[39] = t18;
|
|
366
|
+
$[40] = t19;
|
|
367
|
+
$[41] = t20;
|
|
368
|
+
} else t20 = $[41];
|
|
369
|
+
let t21;
|
|
370
|
+
if ($[42] !== activeTab || $[43] !== handlePreviewBlockClick || $[44] !== handlePreviewBlockInsertRequest || $[45] !== handlePreviewFieldClick || $[46] !== isMobile || $[47] !== onFieldValueEdited || $[48] !== onPatchApplied || $[49] !== onResyncRequest || $[50] !== open || $[51] !== previewRef || $[52] !== previewUrl || $[53] !== t) {
|
|
371
|
+
t21 = open && isMobile && /* @__PURE__ */ jsx("div", {
|
|
359
372
|
className: activeTab === "preview" ? "h-full" : "hidden",
|
|
360
373
|
children: previewUrl ? /* @__PURE__ */ jsx(PreviewPane, {
|
|
361
374
|
ref: previewRef,
|
|
@@ -377,23 +390,23 @@ function LivePreviewContent(t0) {
|
|
|
377
390
|
})]
|
|
378
391
|
})
|
|
379
392
|
});
|
|
380
|
-
$[
|
|
381
|
-
$[
|
|
382
|
-
$[
|
|
383
|
-
$[
|
|
384
|
-
$[
|
|
385
|
-
$[
|
|
386
|
-
$[
|
|
387
|
-
$[
|
|
388
|
-
$[
|
|
389
|
-
$[
|
|
390
|
-
$[
|
|
391
|
-
$[
|
|
392
|
-
$[
|
|
393
|
-
} else
|
|
394
|
-
let
|
|
395
|
-
if ($[
|
|
396
|
-
|
|
393
|
+
$[42] = activeTab;
|
|
394
|
+
$[43] = handlePreviewBlockClick;
|
|
395
|
+
$[44] = handlePreviewBlockInsertRequest;
|
|
396
|
+
$[45] = handlePreviewFieldClick;
|
|
397
|
+
$[46] = isMobile;
|
|
398
|
+
$[47] = onFieldValueEdited;
|
|
399
|
+
$[48] = onPatchApplied;
|
|
400
|
+
$[49] = onResyncRequest;
|
|
401
|
+
$[50] = open;
|
|
402
|
+
$[51] = previewRef;
|
|
403
|
+
$[52] = previewUrl;
|
|
404
|
+
$[53] = t;
|
|
405
|
+
$[54] = t21;
|
|
406
|
+
} else t21 = $[54];
|
|
407
|
+
let t22;
|
|
408
|
+
if ($[55] !== handleMouseDown || $[56] !== handlePreviewBlockClick || $[57] !== handlePreviewBlockInsertRequest || $[58] !== handlePreviewFieldClick || $[59] !== isMobile || $[60] !== onFieldValueEdited || $[61] !== onPatchApplied || $[62] !== onResyncRequest || $[63] !== open || $[64] !== previewPercent || $[65] !== previewRef || $[66] !== previewUrl || $[67] !== t) {
|
|
409
|
+
t22 = open && !isMobile && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("button", {
|
|
397
410
|
type: "button",
|
|
398
411
|
"aria-label": "Resize preview pane",
|
|
399
412
|
onMouseDown: handleMouseDown,
|
|
@@ -422,51 +435,51 @@ function LivePreviewContent(t0) {
|
|
|
422
435
|
})]
|
|
423
436
|
})
|
|
424
437
|
})] });
|
|
425
|
-
$[
|
|
426
|
-
$[
|
|
427
|
-
$[
|
|
428
|
-
$[
|
|
429
|
-
$[
|
|
430
|
-
$[
|
|
431
|
-
$[
|
|
432
|
-
$[
|
|
433
|
-
$[
|
|
434
|
-
$[
|
|
435
|
-
$[
|
|
436
|
-
$[
|
|
437
|
-
$[
|
|
438
|
-
$[
|
|
439
|
-
} else
|
|
440
|
-
let
|
|
441
|
-
if ($[
|
|
442
|
-
|
|
443
|
-
ref:
|
|
444
|
-
className:
|
|
438
|
+
$[55] = handleMouseDown;
|
|
439
|
+
$[56] = handlePreviewBlockClick;
|
|
440
|
+
$[57] = handlePreviewBlockInsertRequest;
|
|
441
|
+
$[58] = handlePreviewFieldClick;
|
|
442
|
+
$[59] = isMobile;
|
|
443
|
+
$[60] = onFieldValueEdited;
|
|
444
|
+
$[61] = onPatchApplied;
|
|
445
|
+
$[62] = onResyncRequest;
|
|
446
|
+
$[63] = open;
|
|
447
|
+
$[64] = previewPercent;
|
|
448
|
+
$[65] = previewRef;
|
|
449
|
+
$[66] = previewUrl;
|
|
450
|
+
$[67] = t;
|
|
451
|
+
$[68] = t22;
|
|
452
|
+
} else t22 = $[68];
|
|
453
|
+
let t23;
|
|
454
|
+
if ($[69] !== t16 || $[70] !== t17 || $[71] !== t20 || $[72] !== t21 || $[73] !== t22) {
|
|
455
|
+
t23 = /* @__PURE__ */ jsxs("div", {
|
|
456
|
+
ref: t16,
|
|
457
|
+
className: t17,
|
|
445
458
|
children: [
|
|
446
|
-
t19,
|
|
447
459
|
t20,
|
|
448
|
-
t21
|
|
460
|
+
t21,
|
|
461
|
+
t22
|
|
449
462
|
]
|
|
450
463
|
});
|
|
451
|
-
$[
|
|
452
|
-
$[
|
|
453
|
-
$[
|
|
454
|
-
$[
|
|
455
|
-
$[
|
|
456
|
-
$[
|
|
457
|
-
} else
|
|
458
|
-
let
|
|
459
|
-
if ($[
|
|
460
|
-
|
|
461
|
-
className:
|
|
462
|
-
children: [
|
|
464
|
+
$[69] = t16;
|
|
465
|
+
$[70] = t17;
|
|
466
|
+
$[71] = t20;
|
|
467
|
+
$[72] = t21;
|
|
468
|
+
$[73] = t22;
|
|
469
|
+
$[74] = t23;
|
|
470
|
+
} else t23 = $[74];
|
|
471
|
+
let t24;
|
|
472
|
+
if ($[75] !== t14 || $[76] !== t15 || $[77] !== t23) {
|
|
473
|
+
t24 = /* @__PURE__ */ jsxs("div", {
|
|
474
|
+
className: t14,
|
|
475
|
+
children: [t15, t23]
|
|
463
476
|
});
|
|
464
|
-
$[
|
|
465
|
-
$[
|
|
466
|
-
$[
|
|
467
|
-
$[
|
|
468
|
-
} else
|
|
469
|
-
return
|
|
477
|
+
$[75] = t14;
|
|
478
|
+
$[76] = t15;
|
|
479
|
+
$[77] = t23;
|
|
480
|
+
$[78] = t24;
|
|
481
|
+
} else t24 = $[78];
|
|
482
|
+
return t24;
|
|
470
483
|
}
|
|
471
484
|
function _temp2(e_0) {
|
|
472
485
|
return e_0.preventDefault();
|
|
@@ -512,16 +525,12 @@ function LivePreviewMode(t0) {
|
|
|
512
525
|
return t1;
|
|
513
526
|
}
|
|
514
527
|
function _temp3(state) {
|
|
515
|
-
if (state.type === "field")
|
|
516
|
-
else if (state.type === "block")
|
|
517
|
-
scrollFieldIntoView(state.fieldPath ? `content._values.${state.blockId}.${state.fieldPath}` : `content._values.${state.blockId}`);
|
|
518
|
-
}, 150);
|
|
528
|
+
if (state.type === "field" || state.type === "relation") scheduleScrollFieldIntoView(state.fieldPath);
|
|
529
|
+
else if (state.type === "block") scheduleScrollFieldIntoView(state.fieldPath ? `content._values.${state.blockId}.${state.fieldPath}` : `content._values.${state.blockId}`, { fallbackToBlock: true });
|
|
519
530
|
else if (state.type === "block-insert") {
|
|
520
531
|
const targetBlockId = state.referenceBlockId ?? state.position.parentId;
|
|
521
532
|
if (!targetBlockId) return;
|
|
522
|
-
|
|
523
|
-
scrollFieldIntoView(`content._values.${targetBlockId}`);
|
|
524
|
-
}, 150);
|
|
533
|
+
scheduleScrollFieldIntoView(`content._values.${targetBlockId}`, { fallbackToBlock: true });
|
|
525
534
|
}
|
|
526
535
|
}
|
|
527
536
|
|
|
@@ -89,10 +89,14 @@ declare function parsePreviewFieldPath(path: string, context?: {
|
|
|
89
89
|
fieldType?: "regular" | "block" | "relation";
|
|
90
90
|
targetCollection?: string;
|
|
91
91
|
}): FocusState;
|
|
92
|
+
type ScrollFieldIntoViewOptions = {
|
|
93
|
+
/** Scroll the owning block card if a nested block field is not rendered yet. */
|
|
94
|
+
fallbackToBlock?: boolean;
|
|
95
|
+
};
|
|
92
96
|
/**
|
|
93
97
|
* Scroll a field into view and focus it.
|
|
94
98
|
* Finds the field wrapper by data-field-path within the preview form scope.
|
|
95
99
|
*/
|
|
96
|
-
declare function scrollFieldIntoView(fieldPath: string):
|
|
100
|
+
declare function scrollFieldIntoView(fieldPath: string, options?: ScrollFieldIntoViewOptions): boolean;
|
|
97
101
|
//#endregion
|
|
98
102
|
export { FocusContextValue, FocusProvider, FocusProviderProps, FocusState, parsePreviewFieldPath, scrollFieldIntoView, useFocus, useFocusOptional, useIsBlockFocused, useIsFieldFocused };
|
|
@@ -243,13 +243,35 @@ function extractRelativeField(path, blockId) {
|
|
|
243
243
|
if (path.startsWith(prefix)) return path.slice(prefix.length);
|
|
244
244
|
return path;
|
|
245
245
|
}
|
|
246
|
+
function getPreviewFormSearchRoot() {
|
|
247
|
+
return document.querySelector("[data-preview-form-scope]") ?? document;
|
|
248
|
+
}
|
|
249
|
+
function findExactFieldWrapper(searchRoot, fieldPath) {
|
|
250
|
+
for (const element of searchRoot.querySelectorAll("[data-field-path]")) if (element.getAttribute("data-field-path") === fieldPath) return element;
|
|
251
|
+
return null;
|
|
252
|
+
}
|
|
253
|
+
function getOwningBlockFieldPath(fieldPath) {
|
|
254
|
+
const blockMatch = fieldPath.match(/^content\._values\.([^.]+)/);
|
|
255
|
+
if (!blockMatch) return null;
|
|
256
|
+
return `content._values.${blockMatch[1]}`;
|
|
257
|
+
}
|
|
258
|
+
function findFieldWrapper(fieldPath, options) {
|
|
259
|
+
const searchRoot = getPreviewFormSearchRoot();
|
|
260
|
+
const exactWrapper = findExactFieldWrapper(searchRoot, fieldPath);
|
|
261
|
+
if (exactWrapper) return exactWrapper;
|
|
262
|
+
if (!options.fallbackToBlock) return null;
|
|
263
|
+
const owningBlockPath = getOwningBlockFieldPath(fieldPath);
|
|
264
|
+
if (!owningBlockPath) return null;
|
|
265
|
+
return findExactFieldWrapper(searchRoot, owningBlockPath);
|
|
266
|
+
}
|
|
246
267
|
/**
|
|
247
268
|
* Scroll a field into view and focus it.
|
|
248
269
|
* Finds the field wrapper by data-field-path within the preview form scope.
|
|
249
270
|
*/
|
|
250
|
-
function scrollFieldIntoView(fieldPath) {
|
|
251
|
-
|
|
252
|
-
|
|
271
|
+
function scrollFieldIntoView(fieldPath, options = {}) {
|
|
272
|
+
if (typeof document === "undefined") return false;
|
|
273
|
+
const wrapper = findFieldWrapper(fieldPath, options);
|
|
274
|
+
if (!wrapper) return false;
|
|
253
275
|
const focusable = wrapper.querySelector("input:not([type=\"hidden\"]), textarea, button, select, [tabindex]:not([tabindex=\"-1\"]), [contenteditable=\"true\"]");
|
|
254
276
|
(focusable ?? wrapper).scrollIntoView({
|
|
255
277
|
behavior: "smooth",
|
|
@@ -261,7 +283,20 @@ function scrollFieldIntoView(fieldPath) {
|
|
|
261
283
|
window.focus();
|
|
262
284
|
focusable.focus();
|
|
263
285
|
});
|
|
286
|
+
return true;
|
|
287
|
+
}
|
|
288
|
+
function scheduleScrollFieldIntoView(fieldPath, options = {}) {
|
|
289
|
+
if (typeof window === "undefined") return;
|
|
290
|
+
const { attempts = 12, delayMs = 80, fallbackToBlock = false } = options;
|
|
291
|
+
let attempt = 0;
|
|
292
|
+
const tryScroll = () => {
|
|
293
|
+
attempt += 1;
|
|
294
|
+
const isLastAttempt = attempt >= attempts;
|
|
295
|
+
if (scrollFieldIntoView(fieldPath, { fallbackToBlock: fallbackToBlock && isLastAttempt }) || isLastAttempt) return;
|
|
296
|
+
window.setTimeout(tryScroll, delayMs);
|
|
297
|
+
};
|
|
298
|
+
tryScroll();
|
|
264
299
|
}
|
|
265
300
|
|
|
266
301
|
//#endregion
|
|
267
|
-
export { FocusProvider, parsePreviewFieldPath, scrollFieldIntoView, useFocus, useFocusOptional, useIsBlockFocused, useIsFieldFocused };
|
|
302
|
+
export { FocusProvider, parsePreviewFieldPath, scheduleScrollFieldIntoView, scrollFieldIntoView, useFocus, useFocusOptional, useIsBlockFocused, useIsFieldFocused };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime2 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/client/views/auth/accept-invite-form.d.ts
|
|
4
4
|
/**
|
|
@@ -67,6 +67,6 @@ declare function AcceptInviteForm({
|
|
|
67
67
|
className,
|
|
68
68
|
error,
|
|
69
69
|
minPasswordLength
|
|
70
|
-
}: AcceptInviteFormProps):
|
|
70
|
+
}: AcceptInviteFormProps): react_jsx_runtime2.JSX.Element;
|
|
71
71
|
//#endregion
|
|
72
72
|
export { AcceptInviteForm };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/client/views/auth/auth-layout.d.ts
|
|
5
5
|
|
|
@@ -26,7 +26,7 @@ declare function AuthDefaultLogo({
|
|
|
26
26
|
brandName
|
|
27
27
|
}: {
|
|
28
28
|
brandName: string;
|
|
29
|
-
}):
|
|
29
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
30
30
|
/**
|
|
31
31
|
* Minimal split layout for authentication pages (login, register, forgot password, etc.)
|
|
32
32
|
*
|
|
@@ -50,6 +50,6 @@ declare function AuthDefaultLogo({
|
|
|
50
50
|
* </AuthLayout>
|
|
51
51
|
* ```
|
|
52
52
|
*/
|
|
53
|
-
declare function AuthLayout(props: AuthLayoutProps):
|
|
53
|
+
declare function AuthLayout(props: AuthLayoutProps): react_jsx_runtime0.JSX.Element;
|
|
54
54
|
//#endregion
|
|
55
55
|
export { AuthDefaultLogo, AuthLayout, AuthLayoutProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime5 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/client/views/auth/login-form.d.ts
|
|
4
4
|
/**
|
|
@@ -70,6 +70,6 @@ declare function LoginForm({
|
|
|
70
70
|
className,
|
|
71
71
|
error,
|
|
72
72
|
minPasswordLength
|
|
73
|
-
}: LoginFormProps):
|
|
73
|
+
}: LoginFormProps): react_jsx_runtime5.JSX.Element;
|
|
74
74
|
//#endregion
|
|
75
75
|
export { LoginForm };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime4 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/client/views/auth/reset-password-form.d.ts
|
|
4
4
|
/**
|
|
@@ -60,6 +60,6 @@ declare function ResetPasswordForm({
|
|
|
60
60
|
minPasswordLength,
|
|
61
61
|
className,
|
|
62
62
|
error
|
|
63
|
-
}: ResetPasswordFormProps):
|
|
63
|
+
}: ResetPasswordFormProps): react_jsx_runtime4.JSX.Element;
|
|
64
64
|
//#endregion
|
|
65
65
|
export { ResetPasswordForm };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime7 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/client/views/auth/setup-form.d.ts
|
|
4
4
|
/**
|
|
@@ -55,6 +55,6 @@ declare function SetupForm({
|
|
|
55
55
|
className,
|
|
56
56
|
error,
|
|
57
57
|
minPasswordLength
|
|
58
|
-
}: SetupFormProps):
|
|
58
|
+
}: SetupFormProps): react_jsx_runtime7.JSX.Element;
|
|
59
59
|
//#endregion
|
|
60
60
|
export { SetupForm, SetupFormValues };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime8 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/client/views/pages/accept-invite-page.d.ts
|
|
5
5
|
|
|
@@ -61,6 +61,6 @@ declare function AcceptInvitePage({
|
|
|
61
61
|
redirectTo,
|
|
62
62
|
loginPath,
|
|
63
63
|
minPasswordLength
|
|
64
|
-
}: AcceptInvitePageProps):
|
|
64
|
+
}: AcceptInvitePageProps): react_jsx_runtime8.JSX.Element;
|
|
65
65
|
//#endregion
|
|
66
66
|
export { AcceptInvitePage };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime9 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/client/views/pages/dashboard-page.d.ts
|
|
4
4
|
|
|
@@ -38,6 +38,6 @@ declare function DashboardPage({
|
|
|
38
38
|
title,
|
|
39
39
|
description,
|
|
40
40
|
className
|
|
41
|
-
}: DashboardPageProps):
|
|
41
|
+
}: DashboardPageProps): react_jsx_runtime9.JSX.Element;
|
|
42
42
|
//#endregion
|
|
43
43
|
export { DashboardPage };
|