@kyro-cms/admin 0.5.3 → 0.5.5
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/{EditorClient-YLCGVDXY.cjs → EditorClient-Q23UXR37.cjs} +14 -14
- package/dist/{EditorClient-XEUOVAAC.js → EditorClient-T5PASFNR.js} +2 -2
- package/dist/chunk-3BGDYKTD.cjs +348 -0
- package/dist/chunk-3BGDYKTD.cjs.map +1 -0
- package/dist/chunk-EEFXLQVT.js +3 -0
- package/dist/chunk-EEFXLQVT.js.map +1 -0
- package/dist/index.cjs +462 -1020
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +13 -0
- package/dist/index.css.map +1 -1
- package/dist/index.js +271 -829
- package/dist/index.js.map +1 -1
- package/package.json +7 -3
- package/src/components/AuditLogsPage.tsx +4 -8
- package/src/components/Dashboard.tsx +2 -1
- package/src/components/DetailView.tsx +9 -2
- package/src/components/ListView.tsx +3 -2
- package/src/components/MediaGallery.tsx +13 -6
- package/src/components/Sidebar.astro +1 -1
- package/src/components/ui/Shimmer.tsx +28 -0
- package/src/components/users/UserDetail.tsx +1 -1
- package/src/components/users/UserForm.tsx +1 -1
- package/src/components/users/UsersList.tsx +1 -1
- package/src/hooks/useAutoFormState.ts +19 -3
- package/src/integration.ts +77 -25
- package/src/layouts/AdminLayout.astro +70 -48
- package/src/lib/config.ts +6 -1
- package/src/lib/globals.ts +56 -20
- package/src/pages/index.astro +1 -1
- package/src/pages/roles/index.astro +1 -1
- package/src/pages/users/[id].astro +2 -2
- package/src/styles/main.css +17 -0
- package/dist/chunk-7KPIUCGT.js +0 -384
- package/dist/chunk-7KPIUCGT.js.map +0 -1
- package/dist/chunk-GOACG6R7.cjs +0 -473
- package/dist/chunk-GOACG6R7.cjs.map +0 -1
- /package/dist/{EditorClient-XEUOVAAC.js.map → EditorClient-Q23UXR37.cjs.map} +0 -0
- /package/dist/{EditorClient-YLCGVDXY.cjs.map → EditorClient-T5PASFNR.js.map} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk3BGDYKTD_cjs = require('./chunk-3BGDYKTD.cjs');
|
|
4
4
|
var React17 = require('react');
|
|
5
5
|
var zustand = require('zustand');
|
|
6
6
|
var middleware = require('zustand/middleware');
|
|
7
7
|
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
-
var projectConfig = require('kyro:config');
|
|
9
8
|
var templates = require('@kyro-cms/core/templates');
|
|
10
|
-
var
|
|
9
|
+
var unstorage = require('unstorage');
|
|
10
|
+
var indexedbDriver = require('unstorage/drivers/indexedb');
|
|
11
11
|
var reactDom = require('react-dom');
|
|
12
12
|
require('@portabletext/react');
|
|
13
13
|
var codemirrorThemeGithub = require('@uiw/codemirror-theme-github');
|
|
@@ -23,12 +23,15 @@ require('react-image-crop/dist/ReactCrop.css');
|
|
|
23
23
|
require('@kyro-cms/core');
|
|
24
24
|
var path = require('path');
|
|
25
25
|
var fs = require('fs');
|
|
26
|
+
var child_process = require('child_process');
|
|
27
|
+
var dotenv = require('dotenv');
|
|
28
|
+
var esbuild = require('esbuild');
|
|
26
29
|
|
|
27
30
|
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
28
31
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
29
32
|
|
|
30
33
|
var React17__default = /*#__PURE__*/_interopDefault(React17);
|
|
31
|
-
var
|
|
34
|
+
var indexedbDriver__default = /*#__PURE__*/_interopDefault(indexedbDriver);
|
|
32
35
|
var CodeMirror__default = /*#__PURE__*/_interopDefault(CodeMirror);
|
|
33
36
|
var ReactCrop__default = /*#__PURE__*/_interopDefault(ReactCrop);
|
|
34
37
|
var path__default = /*#__PURE__*/_interopDefault(path);
|
|
@@ -72,28 +75,28 @@ var paths = {
|
|
|
72
75
|
resolveAdmin,
|
|
73
76
|
resolveMedia
|
|
74
77
|
};
|
|
75
|
-
var useAuthStore = zustand.create((
|
|
78
|
+
var useAuthStore = zustand.create((set) => ({
|
|
76
79
|
user: null,
|
|
77
80
|
permissions: null,
|
|
78
81
|
isAuthenticated: false,
|
|
79
82
|
isLoading: true,
|
|
80
83
|
error: null,
|
|
81
|
-
setUser: (user, permissions = null) =>
|
|
84
|
+
setUser: (user, permissions = null) => set({
|
|
82
85
|
user,
|
|
83
86
|
permissions,
|
|
84
87
|
isAuthenticated: !!user,
|
|
85
88
|
isLoading: false,
|
|
86
89
|
error: null
|
|
87
90
|
}),
|
|
88
|
-
setLoading: (isLoading) =>
|
|
89
|
-
setError: (error) =>
|
|
91
|
+
setLoading: (isLoading) => set({ isLoading }),
|
|
92
|
+
setError: (error) => set({
|
|
90
93
|
error,
|
|
91
94
|
isLoading: false,
|
|
92
95
|
isAuthenticated: false,
|
|
93
96
|
user: null,
|
|
94
97
|
permissions: null
|
|
95
98
|
}),
|
|
96
|
-
logout: () =>
|
|
99
|
+
logout: () => set({
|
|
97
100
|
user: null,
|
|
98
101
|
permissions: null,
|
|
99
102
|
isAuthenticated: false,
|
|
@@ -101,18 +104,18 @@ var useAuthStore = zustand.create((set2) => ({
|
|
|
101
104
|
error: null
|
|
102
105
|
})
|
|
103
106
|
}));
|
|
104
|
-
var useToastStore = zustand.create((
|
|
107
|
+
var useToastStore = zustand.create((set) => ({
|
|
105
108
|
toasts: [],
|
|
106
109
|
addToast: (type, message) => {
|
|
107
110
|
const id = Math.random().toString(36).substring(7);
|
|
108
|
-
|
|
111
|
+
set((state) => ({
|
|
109
112
|
toasts: [...state.toasts, { id, type, message }]
|
|
110
113
|
}));
|
|
111
114
|
},
|
|
112
|
-
removeToast: (id) =>
|
|
115
|
+
removeToast: (id) => set((state) => ({
|
|
113
116
|
toasts: state.toasts.filter((t) => t.id !== id)
|
|
114
117
|
})),
|
|
115
|
-
clearToasts: () =>
|
|
118
|
+
clearToasts: () => set({ toasts: [] })
|
|
116
119
|
}));
|
|
117
120
|
var toast = {
|
|
118
121
|
success: (message) => useToastStore.getState().addToast("success", message),
|
|
@@ -122,89 +125,89 @@ var toast = {
|
|
|
122
125
|
};
|
|
123
126
|
zustand.create()(
|
|
124
127
|
middleware.persist(
|
|
125
|
-
(
|
|
128
|
+
(set) => ({
|
|
126
129
|
mode: "light",
|
|
127
|
-
setMode: (mode) =>
|
|
128
|
-
toggleMode: () =>
|
|
130
|
+
setMode: (mode) => set({ mode }),
|
|
131
|
+
toggleMode: () => set((state) => ({ mode: state.mode === "light" ? "dark" : "light" }))
|
|
129
132
|
}),
|
|
130
133
|
{
|
|
131
134
|
name: "kyro-theme"
|
|
132
135
|
}
|
|
133
136
|
)
|
|
134
137
|
);
|
|
135
|
-
var useUIStore = zustand.create((
|
|
138
|
+
var useUIStore = zustand.create((set) => ({
|
|
136
139
|
sidebarOpen: true,
|
|
137
|
-
toggleSidebar: () =>
|
|
138
|
-
setSidebarOpen: (open) =>
|
|
140
|
+
toggleSidebar: () => set((state) => ({ sidebarOpen: !state.sidebarOpen })),
|
|
141
|
+
setSidebarOpen: (open) => set({ sidebarOpen: open }),
|
|
139
142
|
modal: {
|
|
140
143
|
open: false,
|
|
141
144
|
config: null
|
|
142
145
|
},
|
|
143
|
-
confirm: (config) =>
|
|
146
|
+
confirm: (config) => set({
|
|
144
147
|
modal: {
|
|
145
148
|
open: true,
|
|
146
149
|
config: { ...config, variant: config.variant || "default" }
|
|
147
150
|
}
|
|
148
151
|
}),
|
|
149
|
-
alert: (config) =>
|
|
152
|
+
alert: (config) => set({
|
|
150
153
|
modal: {
|
|
151
154
|
open: true,
|
|
152
155
|
config: {
|
|
153
156
|
...config,
|
|
154
157
|
variant: config.variant || "default",
|
|
155
158
|
confirmLabel: config.confirmLabel || "OK",
|
|
156
|
-
onConfirm: () =>
|
|
159
|
+
onConfirm: () => set((s) => ({ modal: { ...s.modal, open: false } }))
|
|
157
160
|
}
|
|
158
161
|
}
|
|
159
162
|
}),
|
|
160
|
-
closeModal: () =>
|
|
163
|
+
closeModal: () => set((state) => ({
|
|
161
164
|
modal: { ...state.modal, open: false },
|
|
162
165
|
activeModal: null
|
|
163
166
|
})),
|
|
164
167
|
activeModal: null,
|
|
165
|
-
openModal: (modal) =>
|
|
168
|
+
openModal: (modal) => set({ activeModal: modal })
|
|
166
169
|
}));
|
|
167
|
-
zustand.create((
|
|
170
|
+
zustand.create((set) => ({
|
|
168
171
|
editor: null,
|
|
169
|
-
setEditor: (editor) =>
|
|
172
|
+
setEditor: (editor) => set({ editor }),
|
|
170
173
|
blockDrawerOpen: false,
|
|
171
|
-
openBlockDrawer: (options) =>
|
|
174
|
+
openBlockDrawer: (options) => set({
|
|
172
175
|
blockDrawerOpen: true,
|
|
173
176
|
pendingInsert: { pos: null, column: options?.targetColumn ?? null }
|
|
174
177
|
}),
|
|
175
|
-
closeBlockDrawer: () =>
|
|
178
|
+
closeBlockDrawer: () => set({
|
|
176
179
|
blockDrawerOpen: false,
|
|
177
180
|
pendingInsert: { pos: null, column: null }
|
|
178
181
|
}),
|
|
179
|
-
toggleBlockDrawer: () =>
|
|
182
|
+
toggleBlockDrawer: () => set((state) => ({ blockDrawerOpen: !state.blockDrawerOpen })),
|
|
180
183
|
selectedBlock: null,
|
|
181
|
-
setSelectedBlock: (block3) =>
|
|
184
|
+
setSelectedBlock: (block3) => set({ selectedBlock: block3 }),
|
|
182
185
|
pendingInsert: { pos: null, column: null },
|
|
183
|
-
setPendingInsert: (pos, column) =>
|
|
184
|
-
clearPendingInsert: () =>
|
|
186
|
+
setPendingInsert: (pos, column) => set({ pendingInsert: { pos, column: column ?? null } }),
|
|
187
|
+
clearPendingInsert: () => set({ pendingInsert: { pos: null, column: null } })
|
|
185
188
|
}));
|
|
186
|
-
zustand.create((
|
|
189
|
+
zustand.create((set, get) => ({
|
|
187
190
|
cache: {},
|
|
188
|
-
setCache: (key, data) =>
|
|
191
|
+
setCache: (key, data) => set((state) => ({
|
|
189
192
|
cache: {
|
|
190
193
|
...state.cache,
|
|
191
194
|
[key]: { data, loading: false, error: null, lastFetch: Date.now() }
|
|
192
195
|
}
|
|
193
196
|
})),
|
|
194
|
-
setLoading: (key, loading) =>
|
|
197
|
+
setLoading: (key, loading) => set((state) => ({
|
|
195
198
|
cache: {
|
|
196
199
|
...state.cache,
|
|
197
200
|
[key]: { ...state.cache[key], loading, error: null }
|
|
198
201
|
}
|
|
199
202
|
})),
|
|
200
|
-
setError: (key, error) =>
|
|
203
|
+
setError: (key, error) => set((state) => ({
|
|
201
204
|
cache: {
|
|
202
205
|
...state.cache,
|
|
203
206
|
[key]: { data: null, loading: false, error, lastFetch: null }
|
|
204
207
|
}
|
|
205
208
|
})),
|
|
206
|
-
getCache: (key) =>
|
|
207
|
-
invalidateCache: (key) =>
|
|
209
|
+
getCache: (key) => get().cache[key] || null,
|
|
210
|
+
invalidateCache: (key) => set((state) => {
|
|
208
211
|
if (key) {
|
|
209
212
|
const { [key]: _, ...rest } = state.cache;
|
|
210
213
|
return { cache: rest };
|
|
@@ -405,27 +408,23 @@ async function apiUpload(url, body, onProgress) {
|
|
|
405
408
|
xhr.send(body);
|
|
406
409
|
});
|
|
407
410
|
}
|
|
408
|
-
function
|
|
409
|
-
|
|
410
|
-
"
|
|
411
|
+
function Shimmer({ variant, count = 1, className = "" }) {
|
|
412
|
+
const variants = {
|
|
413
|
+
text: "h-3 rounded-md",
|
|
414
|
+
circle: "size-10 rounded-full",
|
|
415
|
+
rect: "h-10 rounded-xl",
|
|
416
|
+
card: "h-32 rounded-2xl",
|
|
417
|
+
"table-row": "h-14 rounded-xl",
|
|
418
|
+
"media-card": "aspect-square rounded-2xl",
|
|
419
|
+
"stat-card": "h-24 rounded-2xl"
|
|
420
|
+
};
|
|
421
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: Array.from({ length: count }).map((_, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
422
|
+
"div",
|
|
411
423
|
{
|
|
412
|
-
className: `kyro-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
"circle",
|
|
417
|
-
{
|
|
418
|
-
cx: "12",
|
|
419
|
-
cy: "12",
|
|
420
|
-
r: "10",
|
|
421
|
-
stroke: "currentColor",
|
|
422
|
-
strokeWidth: "3",
|
|
423
|
-
strokeLinecap: "round",
|
|
424
|
-
strokeDasharray: "40 20"
|
|
425
|
-
}
|
|
426
|
-
)
|
|
427
|
-
}
|
|
428
|
-
);
|
|
424
|
+
className: `kyro-shimmer ${variants[variant]} ${className}`
|
|
425
|
+
},
|
|
426
|
+
i
|
|
427
|
+
)) });
|
|
429
428
|
}
|
|
430
429
|
function PageHeader({
|
|
431
430
|
title,
|
|
@@ -781,7 +780,7 @@ function ListView({
|
|
|
781
780
|
action: canCreate ? {
|
|
782
781
|
label: `Create ${collection.singularLabel || collection.label || collectionSlug}`,
|
|
783
782
|
onClick: handleCreate,
|
|
784
|
-
icon:
|
|
783
|
+
icon: chunk3BGDYKTD_cjs.LuPlus
|
|
785
784
|
} : void 0
|
|
786
785
|
}
|
|
787
786
|
),
|
|
@@ -1063,7 +1062,7 @@ function ListView({
|
|
|
1063
1062
|
)
|
|
1064
1063
|
] })
|
|
1065
1064
|
] }),
|
|
1066
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "surface-tile overflow-hidden", children: loading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "
|
|
1065
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "surface-tile overflow-hidden", children: loading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-2 p-4", children: /* @__PURE__ */ jsxRuntime.jsx(Shimmer, { variant: "table-row", count: 8 }) }) : docs.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center py-16 px-8", children: [
|
|
1067
1066
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-16 h-16 rounded-2xl bg-[var(--kyro-surface-accent)] flex items-center justify-center mb-4", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1068
1067
|
"svg",
|
|
1069
1068
|
{
|
|
@@ -1437,674 +1436,23 @@ function createProjectAdminConfig(config) {
|
|
|
1437
1436
|
globals: toGlobalMap(projectGlobals)
|
|
1438
1437
|
};
|
|
1439
1438
|
}
|
|
1440
|
-
var
|
|
1439
|
+
var global = globalThis;
|
|
1440
|
+
var projectConfig = global.__KYRO_ADMIN_PROJECT_CONFIG__ || {};
|
|
1441
|
+
var adminConfig = createProjectAdminConfig(projectConfig);
|
|
1441
1442
|
var collections = adminConfig.collections;
|
|
1442
1443
|
var globals = adminConfig.globals;
|
|
1443
1444
|
var authCollectionSlugs = ["users", "audit_logs"];
|
|
1444
1445
|
Object.values(collections).filter(
|
|
1445
1446
|
(c) => !authCollectionSlugs.includes(c.slug)
|
|
1446
1447
|
);
|
|
1447
|
-
|
|
1448
|
-
// ../node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs
|
|
1449
|
-
var suspectProtoRx = /"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/;
|
|
1450
|
-
var suspectConstructorRx = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;
|
|
1451
|
-
var JsonSigRx = /^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;
|
|
1452
|
-
function jsonParseTransform(key, value) {
|
|
1453
|
-
if (key === "__proto__" || key === "constructor" && value && typeof value === "object" && "prototype" in value) {
|
|
1454
|
-
warnKeyDropped(key);
|
|
1455
|
-
return;
|
|
1456
|
-
}
|
|
1457
|
-
return value;
|
|
1458
|
-
}
|
|
1459
|
-
function warnKeyDropped(key) {
|
|
1460
|
-
console.warn(`[destr] Dropping "${key}" key to prevent prototype pollution.`);
|
|
1461
|
-
}
|
|
1462
|
-
function destr(value, options = {}) {
|
|
1463
|
-
if (typeof value !== "string") {
|
|
1464
|
-
return value;
|
|
1465
|
-
}
|
|
1466
|
-
if (value[0] === '"' && value[value.length - 1] === '"' && value.indexOf("\\") === -1) {
|
|
1467
|
-
return value.slice(1, -1);
|
|
1468
|
-
}
|
|
1469
|
-
const _value = value.trim();
|
|
1470
|
-
if (_value.length <= 9) {
|
|
1471
|
-
switch (_value.toLowerCase()) {
|
|
1472
|
-
case "true": {
|
|
1473
|
-
return true;
|
|
1474
|
-
}
|
|
1475
|
-
case "false": {
|
|
1476
|
-
return false;
|
|
1477
|
-
}
|
|
1478
|
-
case "undefined": {
|
|
1479
|
-
return void 0;
|
|
1480
|
-
}
|
|
1481
|
-
case "null": {
|
|
1482
|
-
return null;
|
|
1483
|
-
}
|
|
1484
|
-
case "nan": {
|
|
1485
|
-
return Number.NaN;
|
|
1486
|
-
}
|
|
1487
|
-
case "infinity": {
|
|
1488
|
-
return Number.POSITIVE_INFINITY;
|
|
1489
|
-
}
|
|
1490
|
-
case "-infinity": {
|
|
1491
|
-
return Number.NEGATIVE_INFINITY;
|
|
1492
|
-
}
|
|
1493
|
-
}
|
|
1494
|
-
}
|
|
1495
|
-
if (!JsonSigRx.test(value)) {
|
|
1496
|
-
if (options.strict) {
|
|
1497
|
-
throw new SyntaxError("[destr] Invalid JSON");
|
|
1498
|
-
}
|
|
1499
|
-
return value;
|
|
1500
|
-
}
|
|
1501
|
-
try {
|
|
1502
|
-
if (suspectProtoRx.test(value) || suspectConstructorRx.test(value)) {
|
|
1503
|
-
if (options.strict) {
|
|
1504
|
-
throw new Error("[destr] Possible prototype pollution");
|
|
1505
|
-
}
|
|
1506
|
-
return JSON.parse(value, jsonParseTransform);
|
|
1507
|
-
}
|
|
1508
|
-
return JSON.parse(value);
|
|
1509
|
-
} catch (error) {
|
|
1510
|
-
if (options.strict) {
|
|
1511
|
-
throw error;
|
|
1512
|
-
}
|
|
1513
|
-
return value;
|
|
1514
|
-
}
|
|
1515
|
-
}
|
|
1516
|
-
|
|
1517
|
-
// ../node_modules/.pnpm/unstorage@1.17.5_idb-keyval@6.2.2_ioredis@5.10.1/node_modules/unstorage/dist/shared/unstorage.zVDD2mZo.mjs
|
|
1518
|
-
function wrapToPromise(value) {
|
|
1519
|
-
if (!value || typeof value.then !== "function") {
|
|
1520
|
-
return Promise.resolve(value);
|
|
1521
|
-
}
|
|
1522
|
-
return value;
|
|
1523
|
-
}
|
|
1524
|
-
function asyncCall(function_, ...arguments_) {
|
|
1525
|
-
try {
|
|
1526
|
-
return wrapToPromise(function_(...arguments_));
|
|
1527
|
-
} catch (error) {
|
|
1528
|
-
return Promise.reject(error);
|
|
1529
|
-
}
|
|
1530
|
-
}
|
|
1531
|
-
function isPrimitive(value) {
|
|
1532
|
-
const type = typeof value;
|
|
1533
|
-
return value === null || type !== "object" && type !== "function";
|
|
1534
|
-
}
|
|
1535
|
-
function isPureObject(value) {
|
|
1536
|
-
const proto = Object.getPrototypeOf(value);
|
|
1537
|
-
return !proto || proto.isPrototypeOf(Object);
|
|
1538
|
-
}
|
|
1539
|
-
function stringify(value) {
|
|
1540
|
-
if (isPrimitive(value)) {
|
|
1541
|
-
return String(value);
|
|
1542
|
-
}
|
|
1543
|
-
if (isPureObject(value) || Array.isArray(value)) {
|
|
1544
|
-
return JSON.stringify(value);
|
|
1545
|
-
}
|
|
1546
|
-
if (typeof value.toJSON === "function") {
|
|
1547
|
-
return stringify(value.toJSON());
|
|
1548
|
-
}
|
|
1549
|
-
throw new Error("[unstorage] Cannot stringify value!");
|
|
1550
|
-
}
|
|
1551
|
-
var BASE64_PREFIX = "base64:";
|
|
1552
|
-
function serializeRaw(value) {
|
|
1553
|
-
if (typeof value === "string") {
|
|
1554
|
-
return value;
|
|
1555
|
-
}
|
|
1556
|
-
return BASE64_PREFIX + base64Encode(value);
|
|
1557
|
-
}
|
|
1558
|
-
function deserializeRaw(value) {
|
|
1559
|
-
if (typeof value !== "string") {
|
|
1560
|
-
return value;
|
|
1561
|
-
}
|
|
1562
|
-
if (!value.startsWith(BASE64_PREFIX)) {
|
|
1563
|
-
return value;
|
|
1564
|
-
}
|
|
1565
|
-
return base64Decode(value.slice(BASE64_PREFIX.length));
|
|
1566
|
-
}
|
|
1567
|
-
function base64Decode(input) {
|
|
1568
|
-
if (globalThis.Buffer) {
|
|
1569
|
-
return Buffer.from(input, "base64");
|
|
1570
|
-
}
|
|
1571
|
-
return Uint8Array.from(
|
|
1572
|
-
globalThis.atob(input),
|
|
1573
|
-
(c) => c.codePointAt(0)
|
|
1574
|
-
);
|
|
1575
|
-
}
|
|
1576
|
-
function base64Encode(input) {
|
|
1577
|
-
if (globalThis.Buffer) {
|
|
1578
|
-
return Buffer.from(input).toString("base64");
|
|
1579
|
-
}
|
|
1580
|
-
return globalThis.btoa(String.fromCodePoint(...input));
|
|
1581
|
-
}
|
|
1582
|
-
function normalizeKey(key) {
|
|
1583
|
-
if (!key) {
|
|
1584
|
-
return "";
|
|
1585
|
-
}
|
|
1586
|
-
return key.split("?")[0]?.replace(/[/\\]/g, ":").replace(/:+/g, ":").replace(/^:|:$/g, "") || "";
|
|
1587
|
-
}
|
|
1588
|
-
function joinKeys(...keys2) {
|
|
1589
|
-
return normalizeKey(keys2.join(":"));
|
|
1590
|
-
}
|
|
1591
|
-
function normalizeBaseKey(base) {
|
|
1592
|
-
base = normalizeKey(base);
|
|
1593
|
-
return base ? base + ":" : "";
|
|
1594
|
-
}
|
|
1595
|
-
function filterKeyByDepth(key, depth) {
|
|
1596
|
-
if (depth === void 0) {
|
|
1597
|
-
return true;
|
|
1598
|
-
}
|
|
1599
|
-
let substrCount = 0;
|
|
1600
|
-
let index = key.indexOf(":");
|
|
1601
|
-
while (index > -1) {
|
|
1602
|
-
substrCount++;
|
|
1603
|
-
index = key.indexOf(":", index + 1);
|
|
1604
|
-
}
|
|
1605
|
-
return substrCount <= depth;
|
|
1606
|
-
}
|
|
1607
|
-
function filterKeyByBase(key, base) {
|
|
1608
|
-
if (base) {
|
|
1609
|
-
return key.startsWith(base) && key[key.length - 1] !== "$";
|
|
1610
|
-
}
|
|
1611
|
-
return key[key.length - 1] !== "$";
|
|
1612
|
-
}
|
|
1613
|
-
|
|
1614
|
-
// ../node_modules/.pnpm/unstorage@1.17.5_idb-keyval@6.2.2_ioredis@5.10.1/node_modules/unstorage/dist/index.mjs
|
|
1615
|
-
function defineDriver(factory) {
|
|
1616
|
-
return factory;
|
|
1617
|
-
}
|
|
1618
|
-
var DRIVER_NAME = "memory";
|
|
1619
|
-
var memory = defineDriver(() => {
|
|
1620
|
-
const data = /* @__PURE__ */ new Map();
|
|
1621
|
-
return {
|
|
1622
|
-
name: DRIVER_NAME,
|
|
1623
|
-
getInstance: () => data,
|
|
1624
|
-
hasItem(key) {
|
|
1625
|
-
return data.has(key);
|
|
1626
|
-
},
|
|
1627
|
-
getItem(key) {
|
|
1628
|
-
return data.get(key) ?? null;
|
|
1629
|
-
},
|
|
1630
|
-
getItemRaw(key) {
|
|
1631
|
-
return data.get(key) ?? null;
|
|
1632
|
-
},
|
|
1633
|
-
setItem(key, value) {
|
|
1634
|
-
data.set(key, value);
|
|
1635
|
-
},
|
|
1636
|
-
setItemRaw(key, value) {
|
|
1637
|
-
data.set(key, value);
|
|
1638
|
-
},
|
|
1639
|
-
removeItem(key) {
|
|
1640
|
-
data.delete(key);
|
|
1641
|
-
},
|
|
1642
|
-
getKeys() {
|
|
1643
|
-
return [...data.keys()];
|
|
1644
|
-
},
|
|
1645
|
-
clear() {
|
|
1646
|
-
data.clear();
|
|
1647
|
-
},
|
|
1648
|
-
dispose() {
|
|
1649
|
-
data.clear();
|
|
1650
|
-
}
|
|
1651
|
-
};
|
|
1652
|
-
});
|
|
1653
|
-
function createStorage(options = {}) {
|
|
1654
|
-
const context = {
|
|
1655
|
-
mounts: { "": options.driver || memory() },
|
|
1656
|
-
mountpoints: [""],
|
|
1657
|
-
watching: false,
|
|
1658
|
-
watchListeners: [],
|
|
1659
|
-
unwatch: {}
|
|
1660
|
-
};
|
|
1661
|
-
const getMount = (key) => {
|
|
1662
|
-
for (const base of context.mountpoints) {
|
|
1663
|
-
if (key.startsWith(base)) {
|
|
1664
|
-
return {
|
|
1665
|
-
base,
|
|
1666
|
-
relativeKey: key.slice(base.length),
|
|
1667
|
-
driver: context.mounts[base]
|
|
1668
|
-
};
|
|
1669
|
-
}
|
|
1670
|
-
}
|
|
1671
|
-
return {
|
|
1672
|
-
base: "",
|
|
1673
|
-
relativeKey: key,
|
|
1674
|
-
driver: context.mounts[""]
|
|
1675
|
-
};
|
|
1676
|
-
};
|
|
1677
|
-
const getMounts = (base, includeParent) => {
|
|
1678
|
-
return context.mountpoints.filter(
|
|
1679
|
-
(mountpoint) => mountpoint.startsWith(base) || includeParent && base.startsWith(mountpoint)
|
|
1680
|
-
).map((mountpoint) => ({
|
|
1681
|
-
relativeBase: base.length > mountpoint.length ? base.slice(mountpoint.length) : void 0,
|
|
1682
|
-
mountpoint,
|
|
1683
|
-
driver: context.mounts[mountpoint]
|
|
1684
|
-
}));
|
|
1685
|
-
};
|
|
1686
|
-
const onChange = (event, key) => {
|
|
1687
|
-
if (!context.watching) {
|
|
1688
|
-
return;
|
|
1689
|
-
}
|
|
1690
|
-
key = normalizeKey(key);
|
|
1691
|
-
for (const listener of context.watchListeners) {
|
|
1692
|
-
listener(event, key);
|
|
1693
|
-
}
|
|
1694
|
-
};
|
|
1695
|
-
const startWatch = async () => {
|
|
1696
|
-
if (context.watching) {
|
|
1697
|
-
return;
|
|
1698
|
-
}
|
|
1699
|
-
context.watching = true;
|
|
1700
|
-
for (const mountpoint in context.mounts) {
|
|
1701
|
-
context.unwatch[mountpoint] = await watch(
|
|
1702
|
-
context.mounts[mountpoint],
|
|
1703
|
-
onChange,
|
|
1704
|
-
mountpoint
|
|
1705
|
-
);
|
|
1706
|
-
}
|
|
1707
|
-
};
|
|
1708
|
-
const stopWatch = async () => {
|
|
1709
|
-
if (!context.watching) {
|
|
1710
|
-
return;
|
|
1711
|
-
}
|
|
1712
|
-
for (const mountpoint in context.unwatch) {
|
|
1713
|
-
await context.unwatch[mountpoint]();
|
|
1714
|
-
}
|
|
1715
|
-
context.unwatch = {};
|
|
1716
|
-
context.watching = false;
|
|
1717
|
-
};
|
|
1718
|
-
const runBatch = (items, commonOptions, cb) => {
|
|
1719
|
-
const batches = /* @__PURE__ */ new Map();
|
|
1720
|
-
const getBatch = (mount) => {
|
|
1721
|
-
let batch = batches.get(mount.base);
|
|
1722
|
-
if (!batch) {
|
|
1723
|
-
batch = {
|
|
1724
|
-
driver: mount.driver,
|
|
1725
|
-
base: mount.base,
|
|
1726
|
-
items: []
|
|
1727
|
-
};
|
|
1728
|
-
batches.set(mount.base, batch);
|
|
1729
|
-
}
|
|
1730
|
-
return batch;
|
|
1731
|
-
};
|
|
1732
|
-
for (const item of items) {
|
|
1733
|
-
const isStringItem = typeof item === "string";
|
|
1734
|
-
const key = normalizeKey(isStringItem ? item : item.key);
|
|
1735
|
-
const value = isStringItem ? void 0 : item.value;
|
|
1736
|
-
const options2 = isStringItem || !item.options ? commonOptions : { ...commonOptions, ...item.options };
|
|
1737
|
-
const mount = getMount(key);
|
|
1738
|
-
getBatch(mount).items.push({
|
|
1739
|
-
key,
|
|
1740
|
-
value,
|
|
1741
|
-
relativeKey: mount.relativeKey,
|
|
1742
|
-
options: options2
|
|
1743
|
-
});
|
|
1744
|
-
}
|
|
1745
|
-
return Promise.all([...batches.values()].map((batch) => cb(batch))).then(
|
|
1746
|
-
(r) => r.flat()
|
|
1747
|
-
);
|
|
1748
|
-
};
|
|
1749
|
-
const storage = {
|
|
1750
|
-
// Item
|
|
1751
|
-
hasItem(key, opts = {}) {
|
|
1752
|
-
key = normalizeKey(key);
|
|
1753
|
-
const { relativeKey, driver } = getMount(key);
|
|
1754
|
-
return asyncCall(driver.hasItem, relativeKey, opts);
|
|
1755
|
-
},
|
|
1756
|
-
getItem(key, opts = {}) {
|
|
1757
|
-
key = normalizeKey(key);
|
|
1758
|
-
const { relativeKey, driver } = getMount(key);
|
|
1759
|
-
return asyncCall(driver.getItem, relativeKey, opts).then(
|
|
1760
|
-
(value) => destr(value)
|
|
1761
|
-
);
|
|
1762
|
-
},
|
|
1763
|
-
getItems(items, commonOptions = {}) {
|
|
1764
|
-
return runBatch(items, commonOptions, (batch) => {
|
|
1765
|
-
if (batch.driver.getItems) {
|
|
1766
|
-
return asyncCall(
|
|
1767
|
-
batch.driver.getItems,
|
|
1768
|
-
batch.items.map((item) => ({
|
|
1769
|
-
key: item.relativeKey,
|
|
1770
|
-
options: item.options
|
|
1771
|
-
})),
|
|
1772
|
-
commonOptions
|
|
1773
|
-
).then(
|
|
1774
|
-
(r) => r.map((item) => ({
|
|
1775
|
-
key: joinKeys(batch.base, item.key),
|
|
1776
|
-
value: destr(item.value)
|
|
1777
|
-
}))
|
|
1778
|
-
);
|
|
1779
|
-
}
|
|
1780
|
-
return Promise.all(
|
|
1781
|
-
batch.items.map((item) => {
|
|
1782
|
-
return asyncCall(
|
|
1783
|
-
batch.driver.getItem,
|
|
1784
|
-
item.relativeKey,
|
|
1785
|
-
item.options
|
|
1786
|
-
).then((value) => ({
|
|
1787
|
-
key: item.key,
|
|
1788
|
-
value: destr(value)
|
|
1789
|
-
}));
|
|
1790
|
-
})
|
|
1791
|
-
);
|
|
1792
|
-
});
|
|
1793
|
-
},
|
|
1794
|
-
getItemRaw(key, opts = {}) {
|
|
1795
|
-
key = normalizeKey(key);
|
|
1796
|
-
const { relativeKey, driver } = getMount(key);
|
|
1797
|
-
if (driver.getItemRaw) {
|
|
1798
|
-
return asyncCall(driver.getItemRaw, relativeKey, opts);
|
|
1799
|
-
}
|
|
1800
|
-
return asyncCall(driver.getItem, relativeKey, opts).then(
|
|
1801
|
-
(value) => deserializeRaw(value)
|
|
1802
|
-
);
|
|
1803
|
-
},
|
|
1804
|
-
async setItem(key, value, opts = {}) {
|
|
1805
|
-
if (value === void 0) {
|
|
1806
|
-
return storage.removeItem(key);
|
|
1807
|
-
}
|
|
1808
|
-
key = normalizeKey(key);
|
|
1809
|
-
const { relativeKey, driver } = getMount(key);
|
|
1810
|
-
if (!driver.setItem) {
|
|
1811
|
-
return;
|
|
1812
|
-
}
|
|
1813
|
-
await asyncCall(driver.setItem, relativeKey, stringify(value), opts);
|
|
1814
|
-
if (!driver.watch) {
|
|
1815
|
-
onChange("update", key);
|
|
1816
|
-
}
|
|
1817
|
-
},
|
|
1818
|
-
async setItems(items, commonOptions) {
|
|
1819
|
-
await runBatch(items, commonOptions, async (batch) => {
|
|
1820
|
-
if (batch.driver.setItems) {
|
|
1821
|
-
return asyncCall(
|
|
1822
|
-
batch.driver.setItems,
|
|
1823
|
-
batch.items.map((item) => ({
|
|
1824
|
-
key: item.relativeKey,
|
|
1825
|
-
value: stringify(item.value),
|
|
1826
|
-
options: item.options
|
|
1827
|
-
})),
|
|
1828
|
-
commonOptions
|
|
1829
|
-
);
|
|
1830
|
-
}
|
|
1831
|
-
if (!batch.driver.setItem) {
|
|
1832
|
-
return;
|
|
1833
|
-
}
|
|
1834
|
-
await Promise.all(
|
|
1835
|
-
batch.items.map((item) => {
|
|
1836
|
-
return asyncCall(
|
|
1837
|
-
batch.driver.setItem,
|
|
1838
|
-
item.relativeKey,
|
|
1839
|
-
stringify(item.value),
|
|
1840
|
-
item.options
|
|
1841
|
-
);
|
|
1842
|
-
})
|
|
1843
|
-
);
|
|
1844
|
-
});
|
|
1845
|
-
},
|
|
1846
|
-
async setItemRaw(key, value, opts = {}) {
|
|
1847
|
-
if (value === void 0) {
|
|
1848
|
-
return storage.removeItem(key, opts);
|
|
1849
|
-
}
|
|
1850
|
-
key = normalizeKey(key);
|
|
1851
|
-
const { relativeKey, driver } = getMount(key);
|
|
1852
|
-
if (driver.setItemRaw) {
|
|
1853
|
-
await asyncCall(driver.setItemRaw, relativeKey, value, opts);
|
|
1854
|
-
} else if (driver.setItem) {
|
|
1855
|
-
await asyncCall(driver.setItem, relativeKey, serializeRaw(value), opts);
|
|
1856
|
-
} else {
|
|
1857
|
-
return;
|
|
1858
|
-
}
|
|
1859
|
-
if (!driver.watch) {
|
|
1860
|
-
onChange("update", key);
|
|
1861
|
-
}
|
|
1862
|
-
},
|
|
1863
|
-
async removeItem(key, opts = {}) {
|
|
1864
|
-
if (typeof opts === "boolean") {
|
|
1865
|
-
opts = { removeMeta: opts };
|
|
1866
|
-
}
|
|
1867
|
-
key = normalizeKey(key);
|
|
1868
|
-
const { relativeKey, driver } = getMount(key);
|
|
1869
|
-
if (!driver.removeItem) {
|
|
1870
|
-
return;
|
|
1871
|
-
}
|
|
1872
|
-
await asyncCall(driver.removeItem, relativeKey, opts);
|
|
1873
|
-
if (opts.removeMeta || opts.removeMata) {
|
|
1874
|
-
await asyncCall(driver.removeItem, relativeKey + "$", opts);
|
|
1875
|
-
}
|
|
1876
|
-
if (!driver.watch) {
|
|
1877
|
-
onChange("remove", key);
|
|
1878
|
-
}
|
|
1879
|
-
},
|
|
1880
|
-
// Meta
|
|
1881
|
-
async getMeta(key, opts = {}) {
|
|
1882
|
-
if (typeof opts === "boolean") {
|
|
1883
|
-
opts = { nativeOnly: opts };
|
|
1884
|
-
}
|
|
1885
|
-
key = normalizeKey(key);
|
|
1886
|
-
const { relativeKey, driver } = getMount(key);
|
|
1887
|
-
const meta = /* @__PURE__ */ Object.create(null);
|
|
1888
|
-
if (driver.getMeta) {
|
|
1889
|
-
Object.assign(meta, await asyncCall(driver.getMeta, relativeKey, opts));
|
|
1890
|
-
}
|
|
1891
|
-
if (!opts.nativeOnly) {
|
|
1892
|
-
const value = await asyncCall(
|
|
1893
|
-
driver.getItem,
|
|
1894
|
-
relativeKey + "$",
|
|
1895
|
-
opts
|
|
1896
|
-
).then((value_) => destr(value_));
|
|
1897
|
-
if (value && typeof value === "object") {
|
|
1898
|
-
if (typeof value.atime === "string") {
|
|
1899
|
-
value.atime = new Date(value.atime);
|
|
1900
|
-
}
|
|
1901
|
-
if (typeof value.mtime === "string") {
|
|
1902
|
-
value.mtime = new Date(value.mtime);
|
|
1903
|
-
}
|
|
1904
|
-
Object.assign(meta, value);
|
|
1905
|
-
}
|
|
1906
|
-
}
|
|
1907
|
-
return meta;
|
|
1908
|
-
},
|
|
1909
|
-
setMeta(key, value, opts = {}) {
|
|
1910
|
-
return this.setItem(key + "$", value, opts);
|
|
1911
|
-
},
|
|
1912
|
-
removeMeta(key, opts = {}) {
|
|
1913
|
-
return this.removeItem(key + "$", opts);
|
|
1914
|
-
},
|
|
1915
|
-
// Keys
|
|
1916
|
-
async getKeys(base, opts = {}) {
|
|
1917
|
-
base = normalizeBaseKey(base);
|
|
1918
|
-
const mounts = getMounts(base, true);
|
|
1919
|
-
let maskedMounts = [];
|
|
1920
|
-
const allKeys = [];
|
|
1921
|
-
let allMountsSupportMaxDepth = true;
|
|
1922
|
-
for (const mount of mounts) {
|
|
1923
|
-
if (!mount.driver.flags?.maxDepth) {
|
|
1924
|
-
allMountsSupportMaxDepth = false;
|
|
1925
|
-
}
|
|
1926
|
-
const rawKeys = await asyncCall(
|
|
1927
|
-
mount.driver.getKeys,
|
|
1928
|
-
mount.relativeBase,
|
|
1929
|
-
opts
|
|
1930
|
-
);
|
|
1931
|
-
for (const key of rawKeys) {
|
|
1932
|
-
const fullKey = mount.mountpoint + normalizeKey(key);
|
|
1933
|
-
if (!maskedMounts.some((p) => fullKey.startsWith(p))) {
|
|
1934
|
-
allKeys.push(fullKey);
|
|
1935
|
-
}
|
|
1936
|
-
}
|
|
1937
|
-
maskedMounts = [
|
|
1938
|
-
mount.mountpoint,
|
|
1939
|
-
...maskedMounts.filter((p) => !p.startsWith(mount.mountpoint))
|
|
1940
|
-
];
|
|
1941
|
-
}
|
|
1942
|
-
const shouldFilterByDepth = opts.maxDepth !== void 0 && !allMountsSupportMaxDepth;
|
|
1943
|
-
return allKeys.filter(
|
|
1944
|
-
(key) => (!shouldFilterByDepth || filterKeyByDepth(key, opts.maxDepth)) && filterKeyByBase(key, base)
|
|
1945
|
-
);
|
|
1946
|
-
},
|
|
1947
|
-
// Utils
|
|
1948
|
-
async clear(base, opts = {}) {
|
|
1949
|
-
base = normalizeBaseKey(base);
|
|
1950
|
-
await Promise.all(
|
|
1951
|
-
getMounts(base, false).map(async (m) => {
|
|
1952
|
-
if (m.driver.clear) {
|
|
1953
|
-
return asyncCall(m.driver.clear, m.relativeBase, opts);
|
|
1954
|
-
}
|
|
1955
|
-
if (m.driver.removeItem) {
|
|
1956
|
-
const keys2 = await m.driver.getKeys(m.relativeBase || "", opts);
|
|
1957
|
-
return Promise.all(
|
|
1958
|
-
keys2.map((key) => m.driver.removeItem(key, opts))
|
|
1959
|
-
);
|
|
1960
|
-
}
|
|
1961
|
-
})
|
|
1962
|
-
);
|
|
1963
|
-
},
|
|
1964
|
-
async dispose() {
|
|
1965
|
-
await Promise.all(
|
|
1966
|
-
Object.values(context.mounts).map((driver) => dispose(driver))
|
|
1967
|
-
);
|
|
1968
|
-
},
|
|
1969
|
-
async watch(callback) {
|
|
1970
|
-
await startWatch();
|
|
1971
|
-
context.watchListeners.push(callback);
|
|
1972
|
-
return async () => {
|
|
1973
|
-
context.watchListeners = context.watchListeners.filter(
|
|
1974
|
-
(listener) => listener !== callback
|
|
1975
|
-
);
|
|
1976
|
-
if (context.watchListeners.length === 0) {
|
|
1977
|
-
await stopWatch();
|
|
1978
|
-
}
|
|
1979
|
-
};
|
|
1980
|
-
},
|
|
1981
|
-
async unwatch() {
|
|
1982
|
-
context.watchListeners = [];
|
|
1983
|
-
await stopWatch();
|
|
1984
|
-
},
|
|
1985
|
-
// Mount
|
|
1986
|
-
mount(base, driver) {
|
|
1987
|
-
base = normalizeBaseKey(base);
|
|
1988
|
-
if (base && context.mounts[base]) {
|
|
1989
|
-
throw new Error(`already mounted at ${base}`);
|
|
1990
|
-
}
|
|
1991
|
-
if (base) {
|
|
1992
|
-
context.mountpoints.push(base);
|
|
1993
|
-
context.mountpoints.sort((a, b) => b.length - a.length);
|
|
1994
|
-
}
|
|
1995
|
-
context.mounts[base] = driver;
|
|
1996
|
-
if (context.watching) {
|
|
1997
|
-
Promise.resolve(watch(driver, onChange, base)).then((unwatcher) => {
|
|
1998
|
-
context.unwatch[base] = unwatcher;
|
|
1999
|
-
}).catch(console.error);
|
|
2000
|
-
}
|
|
2001
|
-
return storage;
|
|
2002
|
-
},
|
|
2003
|
-
async unmount(base, _dispose = true) {
|
|
2004
|
-
base = normalizeBaseKey(base);
|
|
2005
|
-
if (!base || !context.mounts[base]) {
|
|
2006
|
-
return;
|
|
2007
|
-
}
|
|
2008
|
-
if (context.watching && base in context.unwatch) {
|
|
2009
|
-
context.unwatch[base]?.();
|
|
2010
|
-
delete context.unwatch[base];
|
|
2011
|
-
}
|
|
2012
|
-
if (_dispose) {
|
|
2013
|
-
await dispose(context.mounts[base]);
|
|
2014
|
-
}
|
|
2015
|
-
context.mountpoints = context.mountpoints.filter((key) => key !== base);
|
|
2016
|
-
delete context.mounts[base];
|
|
2017
|
-
},
|
|
2018
|
-
getMount(key = "") {
|
|
2019
|
-
key = normalizeKey(key) + ":";
|
|
2020
|
-
const m = getMount(key);
|
|
2021
|
-
return {
|
|
2022
|
-
driver: m.driver,
|
|
2023
|
-
base: m.base
|
|
2024
|
-
};
|
|
2025
|
-
},
|
|
2026
|
-
getMounts(base = "", opts = {}) {
|
|
2027
|
-
base = normalizeKey(base);
|
|
2028
|
-
const mounts = getMounts(base, opts.parents);
|
|
2029
|
-
return mounts.map((m) => ({
|
|
2030
|
-
driver: m.driver,
|
|
2031
|
-
base: m.mountpoint
|
|
2032
|
-
}));
|
|
2033
|
-
},
|
|
2034
|
-
// Aliases
|
|
2035
|
-
keys: (base, opts = {}) => storage.getKeys(base, opts),
|
|
2036
|
-
get: (key, opts = {}) => storage.getItem(key, opts),
|
|
2037
|
-
set: (key, value, opts = {}) => storage.setItem(key, value, opts),
|
|
2038
|
-
has: (key, opts = {}) => storage.hasItem(key, opts),
|
|
2039
|
-
del: (key, opts = {}) => storage.removeItem(key, opts),
|
|
2040
|
-
remove: (key, opts = {}) => storage.removeItem(key, opts)
|
|
2041
|
-
};
|
|
2042
|
-
return storage;
|
|
2043
|
-
}
|
|
2044
|
-
function watch(driver, onChange, base) {
|
|
2045
|
-
return driver.watch ? driver.watch((event, key) => onChange(event, base + key)) : () => {
|
|
2046
|
-
};
|
|
2047
|
-
}
|
|
2048
|
-
async function dispose(driver) {
|
|
2049
|
-
if (typeof driver.dispose === "function") {
|
|
2050
|
-
await asyncCall(driver.dispose);
|
|
2051
|
-
}
|
|
2052
|
-
}
|
|
2053
|
-
|
|
2054
|
-
// ../node_modules/.pnpm/unstorage@1.17.5_idb-keyval@6.2.2_ioredis@5.10.1/node_modules/unstorage/drivers/utils/index.mjs
|
|
2055
|
-
function defineDriver2(factory) {
|
|
2056
|
-
return factory;
|
|
2057
|
-
}
|
|
2058
|
-
var DRIVER_NAME2 = "idb-keyval";
|
|
2059
|
-
var indexedb_default = defineDriver2((opts = {}) => {
|
|
2060
|
-
const base = opts.base && opts.base.length > 0 ? `${opts.base}:` : "";
|
|
2061
|
-
const makeKey = (key) => base + key;
|
|
2062
|
-
let customStore;
|
|
2063
|
-
if (opts.dbName && opts.storeName) {
|
|
2064
|
-
customStore = idbKeyval.createStore(opts.dbName, opts.storeName);
|
|
2065
|
-
}
|
|
2066
|
-
return {
|
|
2067
|
-
name: DRIVER_NAME2,
|
|
2068
|
-
options: opts,
|
|
2069
|
-
async hasItem(key) {
|
|
2070
|
-
const item = await idbKeyval.get(makeKey(key), customStore);
|
|
2071
|
-
return item === void 0 ? false : true;
|
|
2072
|
-
},
|
|
2073
|
-
async getItem(key) {
|
|
2074
|
-
const item = await idbKeyval.get(makeKey(key), customStore);
|
|
2075
|
-
return item ?? null;
|
|
2076
|
-
},
|
|
2077
|
-
async getItemRaw(key) {
|
|
2078
|
-
const item = await idbKeyval.get(makeKey(key), customStore);
|
|
2079
|
-
return item ?? null;
|
|
2080
|
-
},
|
|
2081
|
-
setItem(key, value) {
|
|
2082
|
-
return idbKeyval.set(makeKey(key), value, customStore);
|
|
2083
|
-
},
|
|
2084
|
-
setItemRaw(key, value) {
|
|
2085
|
-
return idbKeyval.set(makeKey(key), value, customStore);
|
|
2086
|
-
},
|
|
2087
|
-
removeItem(key) {
|
|
2088
|
-
return idbKeyval.del(makeKey(key), customStore);
|
|
2089
|
-
},
|
|
2090
|
-
getKeys() {
|
|
2091
|
-
return idbKeyval.keys(customStore);
|
|
2092
|
-
},
|
|
2093
|
-
clear() {
|
|
2094
|
-
return idbKeyval.clear(customStore);
|
|
2095
|
-
}
|
|
2096
|
-
};
|
|
2097
|
-
});
|
|
2098
|
-
|
|
2099
|
-
// src/lib/autoform-store.ts
|
|
2100
1448
|
var storageInstance = null;
|
|
2101
1449
|
var storageReady = false;
|
|
2102
1450
|
var getStorage = async () => {
|
|
2103
1451
|
if (storageInstance && storageReady) {
|
|
2104
1452
|
return storageInstance;
|
|
2105
1453
|
}
|
|
2106
|
-
storageInstance = createStorage({
|
|
2107
|
-
driver:
|
|
1454
|
+
storageInstance = unstorage.createStorage({
|
|
1455
|
+
driver: indexedbDriver__default.default({
|
|
2108
1456
|
dbName: "kyro-autosave",
|
|
2109
1457
|
storeName: "autosave"
|
|
2110
1458
|
})
|
|
@@ -2155,7 +1503,7 @@ var createAutoFormStorage = () => {
|
|
|
2155
1503
|
};
|
|
2156
1504
|
var useAutoFormStore = zustand.create()(
|
|
2157
1505
|
middleware.persist(
|
|
2158
|
-
(
|
|
1506
|
+
(set, get) => ({
|
|
2159
1507
|
// Initial persisted state
|
|
2160
1508
|
formData: {},
|
|
2161
1509
|
lastSavedData: {},
|
|
@@ -2187,7 +1535,7 @@ var useAutoFormStore = zustand.create()(
|
|
|
2187
1535
|
if (field3 === "blocks") {
|
|
2188
1536
|
console.log("autoform setField blocks: value=", value);
|
|
2189
1537
|
}
|
|
2190
|
-
|
|
1538
|
+
set((state) => ({
|
|
2191
1539
|
formData: {
|
|
2192
1540
|
...state.formData,
|
|
2193
1541
|
[field3]: value
|
|
@@ -2195,85 +1543,85 @@ var useAutoFormStore = zustand.create()(
|
|
|
2195
1543
|
}));
|
|
2196
1544
|
},
|
|
2197
1545
|
setFormData: (data) => {
|
|
2198
|
-
|
|
1546
|
+
set({ formData: data });
|
|
2199
1547
|
},
|
|
2200
1548
|
setNestedField: (path2, value) => {
|
|
2201
|
-
|
|
2202
|
-
const
|
|
1549
|
+
set((state) => {
|
|
1550
|
+
const keys = path2.split(".");
|
|
2203
1551
|
const newFormData = { ...state.formData };
|
|
2204
1552
|
let current = newFormData;
|
|
2205
|
-
for (let i = 0; i <
|
|
2206
|
-
if (current[
|
|
2207
|
-
current[
|
|
1553
|
+
for (let i = 0; i < keys.length - 1; i++) {
|
|
1554
|
+
if (current[keys[i]] === void 0) {
|
|
1555
|
+
current[keys[i]] = {};
|
|
2208
1556
|
}
|
|
2209
|
-
current[
|
|
2210
|
-
current = current[
|
|
1557
|
+
current[keys[i]] = { ...current[keys[i]] };
|
|
1558
|
+
current = current[keys[i]];
|
|
2211
1559
|
}
|
|
2212
|
-
current[
|
|
1560
|
+
current[keys[keys.length - 1]] = value;
|
|
2213
1561
|
return { formData: newFormData };
|
|
2214
1562
|
});
|
|
2215
1563
|
},
|
|
2216
1564
|
// UI state actions
|
|
2217
|
-
setActiveTab: (tab) =>
|
|
2218
|
-
setIsSlugLocked: (locked) =>
|
|
1565
|
+
setActiveTab: (tab) => set({ activeTab: tab }),
|
|
1566
|
+
setIsSlugLocked: (locked) => set((state) => ({
|
|
2219
1567
|
isSlugLocked: typeof locked === "function" ? locked(state.isSlugLocked) : locked
|
|
2220
1568
|
})),
|
|
2221
|
-
setView: (view) =>
|
|
2222
|
-
setIsDropdownOpen: (open) =>
|
|
1569
|
+
setView: (view) => set({ view }),
|
|
1570
|
+
setIsDropdownOpen: (open) => set((state) => ({
|
|
2223
1571
|
isDropdownOpen: typeof open === "function" ? open(state.isDropdownOpen) : open
|
|
2224
1572
|
})),
|
|
2225
|
-
setVersions: (versions) =>
|
|
2226
|
-
setLoadingVersions: (loading) =>
|
|
2227
|
-
setShowPreview: (show) =>
|
|
1573
|
+
setVersions: (versions) => set({ versions }),
|
|
1574
|
+
setLoadingVersions: (loading) => set({ loadingVersions: loading }),
|
|
1575
|
+
setShowPreview: (show) => set((state) => ({
|
|
2228
1576
|
showPreview: typeof show === "function" ? show(state.showPreview) : show
|
|
2229
1577
|
})),
|
|
2230
|
-
setIsMenuOpen: (open) =>
|
|
1578
|
+
setIsMenuOpen: (open) => set((state) => ({
|
|
2231
1579
|
isMenuOpen: typeof open === "function" ? open(state.isMenuOpen) : open
|
|
2232
1580
|
})),
|
|
2233
|
-
setHasUnsavedChanges: (hasChanges) =>
|
|
2234
|
-
setLoadingFields: (fields2) =>
|
|
1581
|
+
setHasUnsavedChanges: (hasChanges) => set({ hasUnsavedChanges: hasChanges }),
|
|
1582
|
+
setLoadingFields: (fields2) => set((state) => ({
|
|
2235
1583
|
loadingFields: typeof fields2 === "function" ? fields2(state.loadingFields) : fields2
|
|
2236
1584
|
})),
|
|
2237
|
-
updateLoadingField: (field3, loading) =>
|
|
1585
|
+
updateLoadingField: (field3, loading) => set((state) => ({
|
|
2238
1586
|
loadingFields: { ...state.loadingFields, [field3]: loading }
|
|
2239
1587
|
})),
|
|
2240
|
-
setCompareMode: (mode) =>
|
|
2241
|
-
setCompareSelected: (selected) =>
|
|
1588
|
+
setCompareMode: (mode) => set({ compareMode: mode }),
|
|
1589
|
+
setCompareSelected: (selected) => set((state) => ({
|
|
2242
1590
|
compareSelected: typeof selected === "function" ? selected(state.compareSelected) : selected
|
|
2243
1591
|
})),
|
|
2244
|
-
setCompareDiffs: (diffs) =>
|
|
2245
|
-
setLoadingDiffs: (loading) =>
|
|
2246
|
-
setIsAutoSaving: (saving) =>
|
|
2247
|
-
setAutoSaveStatus: (status) =>
|
|
2248
|
-
setSidebarCollapsed: (collapsed) =>
|
|
1592
|
+
setCompareDiffs: (diffs) => set({ compareDiffs: diffs }),
|
|
1593
|
+
setLoadingDiffs: (loading) => set({ loadingDiffs: loading }),
|
|
1594
|
+
setIsAutoSaving: (saving) => set({ isAutoSaving: saving }),
|
|
1595
|
+
setAutoSaveStatus: (status) => set({ autoSaveStatus: status }),
|
|
1596
|
+
setSidebarCollapsed: (collapsed) => set({ sidebarCollapsed: collapsed }),
|
|
2249
1597
|
// Auto-save actions
|
|
2250
|
-
setAutoSaveSkip: (skip) =>
|
|
2251
|
-
setLastAutoSaveTime: (time) =>
|
|
1598
|
+
setAutoSaveSkip: (skip) => set({ autoSaveSkip: skip }),
|
|
1599
|
+
setLastAutoSaveTime: (time) => set({ lastAutoSaveTime: time }),
|
|
2252
1600
|
startAutoSaveTimer: (callback, delay) => {
|
|
2253
|
-
const { autoSaveTimer } =
|
|
1601
|
+
const { autoSaveTimer } = get();
|
|
2254
1602
|
if (autoSaveTimer) {
|
|
2255
1603
|
clearTimeout(autoSaveTimer);
|
|
2256
1604
|
}
|
|
2257
1605
|
const timer = setTimeout(callback, delay);
|
|
2258
|
-
|
|
1606
|
+
set({ autoSaveTimer: timer });
|
|
2259
1607
|
},
|
|
2260
1608
|
clearAutoSaveTimer: () => {
|
|
2261
|
-
const { autoSaveTimer } =
|
|
1609
|
+
const { autoSaveTimer } = get();
|
|
2262
1610
|
if (autoSaveTimer) {
|
|
2263
1611
|
clearTimeout(autoSaveTimer);
|
|
2264
|
-
|
|
1612
|
+
set({ autoSaveTimer: null });
|
|
2265
1613
|
}
|
|
2266
1614
|
},
|
|
2267
1615
|
// Data management
|
|
2268
1616
|
markSaved: () => {
|
|
2269
|
-
const { formData } =
|
|
2270
|
-
|
|
1617
|
+
const { formData } = get();
|
|
1618
|
+
set({ lastSavedData: formData, hasUnsavedChanges: false });
|
|
2271
1619
|
},
|
|
2272
1620
|
setLastSavedData: (data) => {
|
|
2273
|
-
|
|
1621
|
+
set({ lastSavedData: data });
|
|
2274
1622
|
},
|
|
2275
1623
|
resetForm: () => {
|
|
2276
|
-
|
|
1624
|
+
set({
|
|
2277
1625
|
formData: {},
|
|
2278
1626
|
lastSavedData: {},
|
|
2279
1627
|
hasUnsavedChanges: false,
|
|
@@ -2281,14 +1629,14 @@ var useAutoFormStore = zustand.create()(
|
|
|
2281
1629
|
});
|
|
2282
1630
|
},
|
|
2283
1631
|
loadDocument: (data, lastSaved) => {
|
|
2284
|
-
|
|
1632
|
+
set({
|
|
2285
1633
|
formData: data,
|
|
2286
1634
|
lastSavedData: lastSaved || data,
|
|
2287
1635
|
hasUnsavedChanges: false
|
|
2288
1636
|
});
|
|
2289
1637
|
},
|
|
2290
1638
|
updateTabData: (tabName, newTabData) => {
|
|
2291
|
-
const { formData } =
|
|
1639
|
+
const { formData } = get();
|
|
2292
1640
|
const tabData = formData[tabName] || {};
|
|
2293
1641
|
let updatedTab;
|
|
2294
1642
|
if (Array.isArray(newTabData)) {
|
|
@@ -2298,7 +1646,7 @@ var useAutoFormStore = zustand.create()(
|
|
|
2298
1646
|
} else {
|
|
2299
1647
|
updatedTab = newTabData;
|
|
2300
1648
|
}
|
|
2301
|
-
|
|
1649
|
+
set((state) => ({
|
|
2302
1650
|
formData: {
|
|
2303
1651
|
...state.formData,
|
|
2304
1652
|
[tabName]: updatedTab
|
|
@@ -2307,12 +1655,12 @@ var useAutoFormStore = zustand.create()(
|
|
|
2307
1655
|
},
|
|
2308
1656
|
// Computed values
|
|
2309
1657
|
getField: (field3) => {
|
|
2310
|
-
return
|
|
1658
|
+
return get().formData[field3];
|
|
2311
1659
|
},
|
|
2312
1660
|
getNestedField: (path2) => {
|
|
2313
|
-
const
|
|
2314
|
-
let current =
|
|
2315
|
-
for (const key of
|
|
1661
|
+
const keys = path2.split(".");
|
|
1662
|
+
let current = get().formData;
|
|
1663
|
+
for (const key of keys) {
|
|
2316
1664
|
if (current === void 0 || current === null)
|
|
2317
1665
|
return void 0;
|
|
2318
1666
|
current = current[key];
|
|
@@ -2320,17 +1668,17 @@ var useAutoFormStore = zustand.create()(
|
|
|
2320
1668
|
return current;
|
|
2321
1669
|
},
|
|
2322
1670
|
getHasChanges: () => {
|
|
2323
|
-
const { formData, lastSavedData } =
|
|
1671
|
+
const { formData, lastSavedData } = get();
|
|
2324
1672
|
return JSON.stringify(formData) !== JSON.stringify(lastSavedData);
|
|
2325
1673
|
},
|
|
2326
|
-
setDraftCache: (documentKey, draft) =>
|
|
1674
|
+
setDraftCache: (documentKey, draft) => set((state) => ({
|
|
2327
1675
|
draftCache: {
|
|
2328
1676
|
...state.draftCache,
|
|
2329
1677
|
[documentKey]: draft
|
|
2330
1678
|
}
|
|
2331
1679
|
})),
|
|
2332
|
-
getDraftCache: (documentKey) =>
|
|
2333
|
-
clearDraftCache: (documentKey) =>
|
|
1680
|
+
getDraftCache: (documentKey) => get().draftCache[documentKey] || null,
|
|
1681
|
+
clearDraftCache: (documentKey) => set((state) => {
|
|
2334
1682
|
const next = { ...state.draftCache };
|
|
2335
1683
|
delete next[documentKey];
|
|
2336
1684
|
return { draftCache: next };
|
|
@@ -2671,10 +2019,27 @@ function useAutoFormState({
|
|
|
2671
2019
|
onActionSuccess,
|
|
2672
2020
|
setFormData
|
|
2673
2021
|
]);
|
|
2022
|
+
function findFieldDeep(fields2, name) {
|
|
2023
|
+
for (const f of fields2) {
|
|
2024
|
+
if (f.name === name && f.admin?.autoGenerate === "title")
|
|
2025
|
+
return f;
|
|
2026
|
+
if (f.type === "tabs" && "tabs" in f) {
|
|
2027
|
+
for (const tab of f.tabs) {
|
|
2028
|
+
const found = findFieldDeep(tab.fields, name);
|
|
2029
|
+
if (found)
|
|
2030
|
+
return found;
|
|
2031
|
+
}
|
|
2032
|
+
}
|
|
2033
|
+
if ((f.type === "group" || f.type === "collapsible") && "fields" in f) {
|
|
2034
|
+
const found = findFieldDeep(f.fields, name);
|
|
2035
|
+
if (found)
|
|
2036
|
+
return found;
|
|
2037
|
+
}
|
|
2038
|
+
}
|
|
2039
|
+
return void 0;
|
|
2040
|
+
}
|
|
2674
2041
|
React17.useEffect(() => {
|
|
2675
|
-
const metaTitleField = config.fields
|
|
2676
|
-
(f) => f.name === "metaTitle" && f.admin?.autoGenerate === "title"
|
|
2677
|
-
);
|
|
2042
|
+
const metaTitleField = findFieldDeep(config.fields, "metaTitle");
|
|
2678
2043
|
if (!metaTitleField)
|
|
2679
2044
|
return;
|
|
2680
2045
|
let titleValue = "";
|
|
@@ -2882,7 +2247,7 @@ var RelationshipBlockField = ({
|
|
|
2882
2247
|
] }),
|
|
2883
2248
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
2884
2249
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
2885
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2250
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuSearch, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-[var(--kyro-text-muted)]" }),
|
|
2886
2251
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2887
2252
|
"input",
|
|
2888
2253
|
{
|
|
@@ -2898,7 +2263,7 @@ var RelationshipBlockField = ({
|
|
|
2898
2263
|
className: `${inputClass} pl-9`
|
|
2899
2264
|
}
|
|
2900
2265
|
),
|
|
2901
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute right-3 top-1/2 -translate-y-1/2", children: loading && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2266
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute right-3 top-1/2 -translate-y-1/2", children: loading && /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuLoaderCircle, { className: "w-4 h-4 text-[var(--kyro-text-muted)] animate-spin" }) })
|
|
2902
2267
|
] }),
|
|
2903
2268
|
isOpen && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute z-20 w-full mt-1 border border-[var(--kyro-border)] rounded-lg shadow-lg bg-[var(--kyro-surface)] max-h-48 overflow-auto", children: loading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-3 text-center text-sm text-[var(--kyro-text-muted)]", children: "Loading..." }) : options.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-3 text-center text-sm text-[var(--kyro-text-muted)]", children: "No results found" }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "py-1", children: options.map((opt) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2904
2269
|
"button",
|
|
@@ -2940,7 +2305,7 @@ var RelationshipBlockField = ({
|
|
|
2940
2305
|
}
|
|
2941
2306
|
},
|
|
2942
2307
|
className: "hover:opacity-70",
|
|
2943
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2308
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuX, { className: "w-3 h-3" })
|
|
2944
2309
|
}
|
|
2945
2310
|
)
|
|
2946
2311
|
]
|
|
@@ -2975,16 +2340,16 @@ var FileIcon = ({
|
|
|
2975
2340
|
}) => {
|
|
2976
2341
|
switch (type) {
|
|
2977
2342
|
case "image":
|
|
2978
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2343
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuImage, { className });
|
|
2979
2344
|
case "video":
|
|
2980
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2345
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuFilm, { className });
|
|
2981
2346
|
case "audio":
|
|
2982
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2347
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuMusic, { className });
|
|
2983
2348
|
case "pdf":
|
|
2984
2349
|
case "document":
|
|
2985
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2350
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuFileText, { className });
|
|
2986
2351
|
default:
|
|
2987
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2352
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuFile, { className });
|
|
2988
2353
|
}
|
|
2989
2354
|
};
|
|
2990
2355
|
function UploadField({
|
|
@@ -3190,7 +2555,7 @@ function UploadField({
|
|
|
3190
2555
|
onClick: () => index !== void 0 ? removeImage(index) : onChange(null),
|
|
3191
2556
|
disabled,
|
|
3192
2557
|
className: "p-1.5 rounded-md text-[var(--kyro-text-muted)] hover:text-[var(--kyro-error)] hover:bg-[var(--kyro-danger-bg)] transition-all opacity-0 group-hover:opacity-100",
|
|
3193
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2558
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuX, { className: "w-4 h-4" })
|
|
3194
2559
|
}
|
|
3195
2560
|
)
|
|
3196
2561
|
]
|
|
@@ -3499,7 +2864,7 @@ function MediaPickerContent({
|
|
|
3499
2864
|
}
|
|
3500
2865
|
);
|
|
3501
2866
|
}
|
|
3502
|
-
var EditorLazy = React17.lazy(() => import('./EditorClient-
|
|
2867
|
+
var EditorLazy = React17.lazy(() => import('./EditorClient-Q23UXR37.cjs'));
|
|
3503
2868
|
function toPortableTextArray(value) {
|
|
3504
2869
|
if (Array.isArray(value)) {
|
|
3505
2870
|
if (value.length > 0 && value[0] && typeof value[0] === "object" && "_type" in value[0]) {
|
|
@@ -4650,7 +4015,7 @@ function RelationshipField({
|
|
|
4650
4015
|
}
|
|
4651
4016
|
},
|
|
4652
4017
|
className: "hover:opacity-70",
|
|
4653
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4018
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuX, { className: "w-3 h-3" })
|
|
4654
4019
|
}
|
|
4655
4020
|
)
|
|
4656
4021
|
]
|
|
@@ -4666,7 +4031,7 @@ function RelationshipField({
|
|
|
4666
4031
|
] }),
|
|
4667
4032
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { ref: containerRef, className: "relative", children: [
|
|
4668
4033
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
4669
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4034
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuSearch, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-[var(--kyro-text-muted)]" }),
|
|
4670
4035
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4671
4036
|
"input",
|
|
4672
4037
|
{
|
|
@@ -4683,8 +4048,8 @@ function RelationshipField({
|
|
|
4683
4048
|
className: "w-full pl-9 pr-10 py-2 border border-[var(--kyro-border)] rounded-lg bg-[var(--kyro-bg-secondary)] text-sm text-[var(--kyro-text-primary)] focus:outline-none focus:ring-1 focus:ring-[var(--kyro-sidebar-active)] focus:border-transparent disabled:opacity-50"
|
|
4684
4049
|
}
|
|
4685
4050
|
),
|
|
4686
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute right-3 top-1/2 -translate-y-1/2", children: loading ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4687
|
-
|
|
4051
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute right-3 top-1/2 -translate-y-1/2", children: loading ? /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuLoaderCircle, { className: "w-4 h-4 text-[var(--kyro-text-muted)] animate-spin" }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
4052
|
+
chunk3BGDYKTD_cjs.LuChevronDown,
|
|
4688
4053
|
{
|
|
4689
4054
|
className: `w-4 h-4 text-[var(--kyro-text-muted)] transition-transform ${isOpen ? "rotate-180" : ""}`
|
|
4690
4055
|
}
|
|
@@ -4715,30 +4080,30 @@ function RelationshipField({
|
|
|
4715
4080
|
var RelationshipField_default = RelationshipField;
|
|
4716
4081
|
var BlocksContext = React17.createContext(null);
|
|
4717
4082
|
function createBlocksStore() {
|
|
4718
|
-
return vanilla.createStore((
|
|
4083
|
+
return vanilla.createStore((set, get) => ({
|
|
4719
4084
|
blocks: [],
|
|
4720
4085
|
setBlocks: (blocks2) => {
|
|
4721
4086
|
const ensuredBlocks = ensureIds(blocks2 || []);
|
|
4722
|
-
|
|
4087
|
+
set({ blocks: ensuredBlocks });
|
|
4723
4088
|
},
|
|
4724
4089
|
onBlocksChange: null,
|
|
4725
|
-
setOnBlocksChange: (cb) =>
|
|
4090
|
+
setOnBlocksChange: (cb) => set({ onBlocksChange: cb }),
|
|
4726
4091
|
addBlock: (type, index) => {
|
|
4727
4092
|
const newBlock = createNewBlock(type);
|
|
4728
|
-
const { blocks: blocks2 } =
|
|
4093
|
+
const { blocks: blocks2 } = get();
|
|
4729
4094
|
const newBlocks = [...blocks2];
|
|
4730
4095
|
if (index !== void 0) {
|
|
4731
4096
|
newBlocks.splice(index, 0, newBlock);
|
|
4732
4097
|
} else {
|
|
4733
4098
|
newBlocks.push(newBlock);
|
|
4734
4099
|
}
|
|
4735
|
-
|
|
4736
|
-
const { onBlocksChange } =
|
|
4100
|
+
set({ blocks: newBlocks });
|
|
4101
|
+
const { onBlocksChange } = get();
|
|
4737
4102
|
if (onBlocksChange)
|
|
4738
4103
|
onBlocksChange();
|
|
4739
4104
|
},
|
|
4740
4105
|
updateBlock: (id, data) => {
|
|
4741
|
-
const { blocks: blocks2 } =
|
|
4106
|
+
const { blocks: blocks2 } = get();
|
|
4742
4107
|
const newBlocks = traverseBlocks(blocks2, (blocksList) => {
|
|
4743
4108
|
const index = blocksList.findIndex((b) => b.id === id);
|
|
4744
4109
|
if (index !== -1) {
|
|
@@ -4749,8 +4114,8 @@ function createBlocksStore() {
|
|
|
4749
4114
|
return { newList: blocksList, found: false };
|
|
4750
4115
|
});
|
|
4751
4116
|
if (newBlocks !== blocks2) {
|
|
4752
|
-
|
|
4753
|
-
const { onBlocksChange } =
|
|
4117
|
+
set({ blocks: newBlocks });
|
|
4118
|
+
const { onBlocksChange } = get();
|
|
4754
4119
|
if (onBlocksChange)
|
|
4755
4120
|
onBlocksChange();
|
|
4756
4121
|
}
|
|
@@ -4758,7 +4123,7 @@ function createBlocksStore() {
|
|
|
4758
4123
|
removeBlock: (id) => {
|
|
4759
4124
|
if (!id)
|
|
4760
4125
|
return;
|
|
4761
|
-
const { blocks: blocks2 } =
|
|
4126
|
+
const { blocks: blocks2 } = get();
|
|
4762
4127
|
const newBlocks = traverseBlocks(blocks2, (blocksList) => {
|
|
4763
4128
|
const filtered = blocksList.filter((b) => b.id !== id);
|
|
4764
4129
|
if (filtered.length !== blocksList.length) {
|
|
@@ -4767,14 +4132,14 @@ function createBlocksStore() {
|
|
|
4767
4132
|
return { newList: blocksList, found: false };
|
|
4768
4133
|
});
|
|
4769
4134
|
if (newBlocks !== blocks2) {
|
|
4770
|
-
|
|
4771
|
-
const { onBlocksChange } =
|
|
4135
|
+
set({ blocks: newBlocks });
|
|
4136
|
+
const { onBlocksChange } = get();
|
|
4772
4137
|
if (onBlocksChange)
|
|
4773
4138
|
onBlocksChange();
|
|
4774
4139
|
}
|
|
4775
4140
|
},
|
|
4776
4141
|
moveBlock: (id, direction) => {
|
|
4777
|
-
const { blocks: blocks2 } =
|
|
4142
|
+
const { blocks: blocks2 } = get();
|
|
4778
4143
|
const newBlocks = traverseBlocks(blocks2, (blocksList) => {
|
|
4779
4144
|
const index = blocksList.findIndex((b) => b.id === id);
|
|
4780
4145
|
if (index !== -1) {
|
|
@@ -4791,8 +4156,8 @@ function createBlocksStore() {
|
|
|
4791
4156
|
return { newList: blocksList, found: false };
|
|
4792
4157
|
});
|
|
4793
4158
|
if (newBlocks !== blocks2) {
|
|
4794
|
-
|
|
4795
|
-
const { onBlocksChange } =
|
|
4159
|
+
set({ blocks: newBlocks });
|
|
4160
|
+
const { onBlocksChange } = get();
|
|
4796
4161
|
if (onBlocksChange)
|
|
4797
4162
|
onBlocksChange();
|
|
4798
4163
|
}
|
|
@@ -5227,7 +4592,7 @@ var BlockEditModal = ({
|
|
|
5227
4592
|
]
|
|
5228
4593
|
}
|
|
5229
4594
|
),
|
|
5230
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none text-[var(--kyro-text-muted)]", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4595
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none text-[var(--kyro-text-muted)]", children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuChevronRight, { className: "w-4 h-4 rotate-90" }) })
|
|
5231
4596
|
] })
|
|
5232
4597
|
] }) })
|
|
5233
4598
|
] });
|
|
@@ -5465,7 +4830,7 @@ var ChildBlocksTree = ({
|
|
|
5465
4830
|
toggleExpand(child.id);
|
|
5466
4831
|
},
|
|
5467
4832
|
className: "p-0.5 hover:bg-[var(--kyro-surface-accent)] rounded",
|
|
5468
|
-
children: isExpanded ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4833
|
+
children: isExpanded ? /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuChevronDown, { className: "w-3 h-3 text-[var(--kyro-text-muted)]" }) : /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuChevronRight, { className: "w-3 h-3 text-[var(--kyro-text-muted)]" })
|
|
5469
4834
|
}
|
|
5470
4835
|
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "w-4" }),
|
|
5471
4836
|
blockIcons[child.type] && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[var(--kyro-text-secondary)]", children: blockIcons[child.type] }),
|
|
@@ -5517,7 +4882,7 @@ var ChildBlocksTree = ({
|
|
|
5517
4882
|
setConfirmDeleteId(child.id);
|
|
5518
4883
|
},
|
|
5519
4884
|
className: "p-1.5 rounded-md transition-opacity cursor-pointer hover:bg-red-50",
|
|
5520
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4885
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuX, { className: "w-3.5 h-3.5 text-red-500 invisible group-hover/column:visible" })
|
|
5521
4886
|
}
|
|
5522
4887
|
)
|
|
5523
4888
|
]
|
|
@@ -5552,7 +4917,7 @@ var ChildBlocksTree = ({
|
|
|
5552
4917
|
onClick: () => setShowAddModal(true),
|
|
5553
4918
|
className: "flex items-center gap-1 px-2 py-1 text-xs font-medium text-[var(--kyro-primary)] hover:bg-[var(--kyro-surface-accent)] rounded transition-colors",
|
|
5554
4919
|
children: [
|
|
5555
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4920
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuPlus, { className: "w-3 h-3" }),
|
|
5556
4921
|
"Add Block"
|
|
5557
4922
|
]
|
|
5558
4923
|
}
|
|
@@ -5680,7 +5045,7 @@ var NestedChildBlocks = ({
|
|
|
5680
5045
|
toggleExpand(child.id);
|
|
5681
5046
|
},
|
|
5682
5047
|
className: "p-0.5 hover:bg-[var(--kyro-surface-accent)] rounded",
|
|
5683
|
-
children: isExpanded ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
5048
|
+
children: isExpanded ? /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuChevronDown, { className: "w-3 h-3 text-[var(--kyro-text-muted)]" }) : /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuChevronRight, { className: "w-3 h-3 text-[var(--kyro-text-muted)]" })
|
|
5684
5049
|
}
|
|
5685
5050
|
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "w-4" }),
|
|
5686
5051
|
blockIcons[child.type] && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[var(--kyro-text-secondary)]", children: blockIcons[child.type] }),
|
|
@@ -5732,7 +5097,7 @@ var NestedChildBlocks = ({
|
|
|
5732
5097
|
setConfirmDeleteId(child.id);
|
|
5733
5098
|
},
|
|
5734
5099
|
className: "p-1.5 rounded-md invisible group-hover:visible transition-opacity cursor-pointer hover:bg-red-50",
|
|
5735
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5100
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuX, { className: "w-3.5 h-3.5 text-red-500" })
|
|
5736
5101
|
}
|
|
5737
5102
|
)
|
|
5738
5103
|
]
|
|
@@ -5767,7 +5132,7 @@ var NestedChildBlocks = ({
|
|
|
5767
5132
|
onClick: () => setShowAddModal(true),
|
|
5768
5133
|
className: "flex items-center gap-1 px-2 py-1 text-xs font-medium text-[var(--kyro-primary)] hover:bg-[var(--kyro-surface-accent)] rounded transition-colors",
|
|
5769
5134
|
children: [
|
|
5770
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5135
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuPlus, { className: "w-3 h-3" }),
|
|
5771
5136
|
"Add Block"
|
|
5772
5137
|
]
|
|
5773
5138
|
}
|
|
@@ -5948,7 +5313,7 @@ var BlockWrapper = ({
|
|
|
5948
5313
|
onClick: () => moveBlock(id, "up"),
|
|
5949
5314
|
className: "p-1 hover:bg-[var(--kyro-surface-accent)] rounded text-[var(--kyro-text-muted)] hover:text-[var(--kyro-primary)]",
|
|
5950
5315
|
title: "Move up",
|
|
5951
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5316
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuChevronRight, { className: "w-3 h-3 rotate-90" })
|
|
5952
5317
|
}
|
|
5953
5318
|
),
|
|
5954
5319
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -5958,7 +5323,7 @@ var BlockWrapper = ({
|
|
|
5958
5323
|
onClick: () => moveBlock(id, "down"),
|
|
5959
5324
|
className: "p-1 hover:bg-[var(--kyro-surface-accent)] rounded text-[var(--kyro-text-muted)] hover:text-[var(--kyro-primary)]",
|
|
5960
5325
|
title: "Move down",
|
|
5961
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5326
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuChevronRight, { className: "w-3 h-3" })
|
|
5962
5327
|
}
|
|
5963
5328
|
),
|
|
5964
5329
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -5968,7 +5333,7 @@ var BlockWrapper = ({
|
|
|
5968
5333
|
onClick: () => removeBlock(id),
|
|
5969
5334
|
className: "p-1 hover:bg-[var(--kyro-error)]/10 rounded text-[var(--kyro-error)]",
|
|
5970
5335
|
title: "Remove",
|
|
5971
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5336
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuX, { className: "w-3 h-3" })
|
|
5972
5337
|
}
|
|
5973
5338
|
)
|
|
5974
5339
|
] })
|
|
@@ -6084,7 +5449,7 @@ var DividerBlock = ({
|
|
|
6084
5449
|
onClick: () => moveBlock(block3.id, "up"),
|
|
6085
5450
|
className: "p-1 hover:bg-[var(--kyro-surface-accent)] rounded",
|
|
6086
5451
|
title: "Move up",
|
|
6087
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5452
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuChevronRight, { className: "w-3 h-3 rotate-90" })
|
|
6088
5453
|
}
|
|
6089
5454
|
),
|
|
6090
5455
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6094,7 +5459,7 @@ var DividerBlock = ({
|
|
|
6094
5459
|
onClick: () => removeBlock(block3.id),
|
|
6095
5460
|
className: "p-1 hover:bg-[var(--kyro-surface-accent)] rounded",
|
|
6096
5461
|
title: "Remove",
|
|
6097
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5462
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuX, { className: "w-3 h-3" })
|
|
6098
5463
|
}
|
|
6099
5464
|
)
|
|
6100
5465
|
] })
|
|
@@ -6122,7 +5487,7 @@ var ImageBlock = ({
|
|
|
6122
5487
|
onClick: () => moveBlock(block3.id, "up"),
|
|
6123
5488
|
className: "p-1 hover:bg-[var(--kyro-surface-accent)] rounded",
|
|
6124
5489
|
title: "Move up",
|
|
6125
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5490
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuChevronRight, { className: "w-3 h-3 rotate-90" })
|
|
6126
5491
|
}
|
|
6127
5492
|
),
|
|
6128
5493
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6132,7 +5497,7 @@ var ImageBlock = ({
|
|
|
6132
5497
|
onClick: () => removeBlock(block3.id),
|
|
6133
5498
|
className: "p-1 hover:bg-[var(--kyro-surface-accent)] rounded",
|
|
6134
5499
|
title: "Remove",
|
|
6135
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5500
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuX, { className: "w-3 h-3" })
|
|
6136
5501
|
}
|
|
6137
5502
|
)
|
|
6138
5503
|
] })
|
|
@@ -6263,7 +5628,7 @@ var VideoBlock = ({
|
|
|
6263
5628
|
onClick: () => moveBlock(block3.id, "up"),
|
|
6264
5629
|
className: "p-1 hover:bg-[var(--kyro-surface-accent)] rounded",
|
|
6265
5630
|
title: "Move up",
|
|
6266
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5631
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuChevronRight, { className: "w-3 h-3 rotate-90" })
|
|
6267
5632
|
}
|
|
6268
5633
|
),
|
|
6269
5634
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6273,7 +5638,7 @@ var VideoBlock = ({
|
|
|
6273
5638
|
onClick: () => moveBlock(block3.id, "down"),
|
|
6274
5639
|
className: "p-1 hover:bg-[var(--kyro-surface-accent)] rounded",
|
|
6275
5640
|
title: "Move down",
|
|
6276
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5641
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuChevronRight, { className: "w-3 h-3" })
|
|
6277
5642
|
}
|
|
6278
5643
|
),
|
|
6279
5644
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6283,7 +5648,7 @@ var VideoBlock = ({
|
|
|
6283
5648
|
onClick: () => removeBlock(block3.id),
|
|
6284
5649
|
className: "p-1 hover:bg-red-50 rounded text-red-500",
|
|
6285
5650
|
title: "Remove",
|
|
6286
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5651
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuX, { className: "w-3 h-3" })
|
|
6287
5652
|
}
|
|
6288
5653
|
)
|
|
6289
5654
|
] })
|
|
@@ -6373,7 +5738,7 @@ var ListBlock = ({
|
|
|
6373
5738
|
onClick: () => moveBlock(block3.id, "up"),
|
|
6374
5739
|
className: "p-1 hover:bg-[var(--kyro-surface-accent)] rounded",
|
|
6375
5740
|
title: "Move up",
|
|
6376
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5741
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuChevronRight, { className: "w-3 h-3 rotate-90" })
|
|
6377
5742
|
}
|
|
6378
5743
|
),
|
|
6379
5744
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6383,7 +5748,7 @@ var ListBlock = ({
|
|
|
6383
5748
|
onClick: () => moveBlock(block3.id, "down"),
|
|
6384
5749
|
className: "p-1 hover:bg-[var(--kyro-surface-accent)] rounded",
|
|
6385
5750
|
title: "Move down",
|
|
6386
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5751
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuChevronRight, { className: "w-3 h-3" })
|
|
6387
5752
|
}
|
|
6388
5753
|
),
|
|
6389
5754
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6393,7 +5758,7 @@ var ListBlock = ({
|
|
|
6393
5758
|
onClick: () => removeBlock(block3.id),
|
|
6394
5759
|
className: "p-1 hover:bg-red-50 rounded text-red-500",
|
|
6395
5760
|
title: "Remove",
|
|
6396
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5761
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuX, { className: "w-3 h-3" })
|
|
6397
5762
|
}
|
|
6398
5763
|
)
|
|
6399
5764
|
] })
|
|
@@ -6414,7 +5779,7 @@ var CodeBlock = ({
|
|
|
6414
5779
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "group/block relative border border-[var(--kyro-border)] rounded-2xl p-6 mb-6 transition-all duration-300 bg-[var(--kyro-surface)] hover:border-[var(--kyro-primary)]/20", children: [
|
|
6415
5780
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mb-6", children: [
|
|
6416
5781
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
6417
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-9 h-9 rounded-xl bg-[var(--kyro-primary)]/10 flex items-center justify-center text-[var(--kyro-primary)] transition-transform group-hover/block:scale-110", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5782
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-9 h-9 rounded-xl bg-[var(--kyro-primary)]/10 flex items-center justify-center text-[var(--kyro-primary)] transition-transform group-hover/block:scale-110", children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuCodeXml, { className: "w-5 h-5" }) }),
|
|
6418
5783
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
6419
5784
|
/* @__PURE__ */ jsxRuntime.jsx("h4", { className: "text-sm font-bold tracking-tight text-[var(--kyro-text-primary)]", children: "Code Snippet" }),
|
|
6420
5785
|
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-[10px] font-medium text-[var(--kyro-text-muted)] tracking-widest", children: [
|
|
@@ -6431,7 +5796,7 @@ var CodeBlock = ({
|
|
|
6431
5796
|
onClick: () => moveBlock(block3.id, "up"),
|
|
6432
5797
|
className: "p-1.5 hover:bg-[var(--kyro-surface)] rounded-lg transition-all text-[var(--kyro-text-muted)] hover:text-[var(--kyro-primary)]",
|
|
6433
5798
|
title: "Move up",
|
|
6434
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5799
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuChevronRight, { className: "w-4 h-4 rotate-[-90deg]" })
|
|
6435
5800
|
}
|
|
6436
5801
|
),
|
|
6437
5802
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-px h-4 bg-[var(--kyro-border)] mx-1 self-center" }),
|
|
@@ -6442,7 +5807,7 @@ var CodeBlock = ({
|
|
|
6442
5807
|
onClick: () => removeBlock(block3.id),
|
|
6443
5808
|
className: "p-1.5 hover:bg-red-500/10 rounded-lg transition-all text-[var(--kyro-text-muted)] hover:text-red-500",
|
|
6444
5809
|
title: "Remove",
|
|
6445
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5810
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuX, { className: "w-4 h-4" })
|
|
6446
5811
|
}
|
|
6447
5812
|
)
|
|
6448
5813
|
] }) })
|
|
@@ -6485,7 +5850,7 @@ var CodeBlock = ({
|
|
|
6485
5850
|
]
|
|
6486
5851
|
}
|
|
6487
5852
|
),
|
|
6488
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none text-[var(--kyro-text-muted)]", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5853
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none text-[var(--kyro-text-muted)]", children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuChevronRight, { className: "w-4 h-4 rotate-90" }) })
|
|
6489
5854
|
] })
|
|
6490
5855
|
] }),
|
|
6491
5856
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "hidden sm:block w-px h-10 bg-[var(--kyro-border)]" }),
|
|
@@ -6536,7 +5901,7 @@ var LinkField = ({
|
|
|
6536
5901
|
rel: "noopener noreferrer",
|
|
6537
5902
|
className: "shrink-0 p-1.5 rounded text-[var(--kyro-text-muted)] hover:text-[var(--kyro-primary)] hover:bg-[var(--kyro-surface-accent)] transition-colors",
|
|
6538
5903
|
title: url,
|
|
6539
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5904
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuExternalLink, { className: "w-3.5 h-3.5" })
|
|
6540
5905
|
}
|
|
6541
5906
|
)
|
|
6542
5907
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -6568,7 +5933,7 @@ var LinkField = ({
|
|
|
6568
5933
|
rel: "noopener noreferrer",
|
|
6569
5934
|
className: "p-2 rounded-lg text-[var(--kyro-text-muted)] hover:text-[var(--kyro-primary)] hover:bg-[var(--kyro-surface-accent)] transition-colors",
|
|
6570
5935
|
title: url,
|
|
6571
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5936
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuExternalLink, { className: "w-4 h-4" })
|
|
6572
5937
|
}
|
|
6573
5938
|
)
|
|
6574
5939
|
] }) });
|
|
@@ -6602,7 +5967,7 @@ var LinkBlock = ({
|
|
|
6602
5967
|
onClick: () => moveBlock(block3.id, "up"),
|
|
6603
5968
|
className: "p-1 hover:bg-[var(--kyro-surface-accent)] rounded",
|
|
6604
5969
|
title: "Move up",
|
|
6605
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5970
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuChevronRight, { className: "w-3 h-3 rotate-90" })
|
|
6606
5971
|
}
|
|
6607
5972
|
),
|
|
6608
5973
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6612,7 +5977,7 @@ var LinkBlock = ({
|
|
|
6612
5977
|
onClick: () => moveBlock(block3.id, "down"),
|
|
6613
5978
|
className: "p-1 hover:bg-[var(--kyro-surface-accent)] rounded",
|
|
6614
5979
|
title: "Move down",
|
|
6615
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5980
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuChevronRight, { className: "w-3 h-3" })
|
|
6616
5981
|
}
|
|
6617
5982
|
),
|
|
6618
5983
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6622,7 +5987,7 @@ var LinkBlock = ({
|
|
|
6622
5987
|
onClick: () => removeBlock(block3.id),
|
|
6623
5988
|
className: "p-1 hover:bg-red-50 rounded text-red-500",
|
|
6624
5989
|
title: "Remove",
|
|
6625
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5990
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuX, { className: "w-3 h-3" })
|
|
6626
5991
|
}
|
|
6627
5992
|
)
|
|
6628
5993
|
] })
|
|
@@ -6649,7 +6014,7 @@ var FileBlock = ({
|
|
|
6649
6014
|
onClick: () => moveBlock(block3.id, "up"),
|
|
6650
6015
|
className: "p-1 hover:bg-[var(--kyro-surface-accent)] rounded",
|
|
6651
6016
|
title: "Move up",
|
|
6652
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6017
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuChevronRight, { className: "w-3 h-3 rotate-90" })
|
|
6653
6018
|
}
|
|
6654
6019
|
),
|
|
6655
6020
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6659,7 +6024,7 @@ var FileBlock = ({
|
|
|
6659
6024
|
onClick: () => moveBlock(block3.id, "down"),
|
|
6660
6025
|
className: "p-1 hover:bg-[var(--kyro-surface-accent)] rounded",
|
|
6661
6026
|
title: "Move down",
|
|
6662
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6027
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuChevronRight, { className: "w-3 h-3" })
|
|
6663
6028
|
}
|
|
6664
6029
|
),
|
|
6665
6030
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6669,7 +6034,7 @@ var FileBlock = ({
|
|
|
6669
6034
|
onClick: () => removeBlock(block3.id),
|
|
6670
6035
|
className: "p-1 hover:bg-red-50 rounded text-red-500",
|
|
6671
6036
|
title: "Remove",
|
|
6672
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6037
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuX, { className: "w-3 h-3" })
|
|
6673
6038
|
}
|
|
6674
6039
|
)
|
|
6675
6040
|
] })
|
|
@@ -6771,7 +6136,7 @@ var ButtonField = ({
|
|
|
6771
6136
|
rel: "noopener noreferrer",
|
|
6772
6137
|
className: `shrink-0 ${compact ? "p-1.5" : "p-2"} rounded text-[var(--kyro-text-muted)] hover:text-[var(--kyro-primary)] hover:bg-[var(--kyro-surface-accent)] transition-colors`,
|
|
6773
6138
|
title: url,
|
|
6774
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6139
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuExternalLink, { className: compact ? "w-3.5 h-3.5" : "w-4 h-4" })
|
|
6775
6140
|
}
|
|
6776
6141
|
)
|
|
6777
6142
|
] });
|
|
@@ -6797,7 +6162,7 @@ var ButtonBlock = ({
|
|
|
6797
6162
|
onClick: () => moveBlock(block3.id, "up"),
|
|
6798
6163
|
className: "p-1 hover:bg-[var(--kyro-surface-accent)] rounded",
|
|
6799
6164
|
title: "Move up",
|
|
6800
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6165
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuChevronRight, { className: "w-3 h-3 rotate-90" })
|
|
6801
6166
|
}
|
|
6802
6167
|
),
|
|
6803
6168
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6807,7 +6172,7 @@ var ButtonBlock = ({
|
|
|
6807
6172
|
onClick: () => moveBlock(block3.id, "down"),
|
|
6808
6173
|
className: "p-1 hover:bg-[var(--kyro-surface-accent)] rounded",
|
|
6809
6174
|
title: "Move down",
|
|
6810
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6175
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuChevronRight, { className: "w-3 h-3" })
|
|
6811
6176
|
}
|
|
6812
6177
|
),
|
|
6813
6178
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6817,7 +6182,7 @@ var ButtonBlock = ({
|
|
|
6817
6182
|
onClick: () => removeBlock(block3.id),
|
|
6818
6183
|
className: "p-1 hover:bg-red-50 rounded text-red-500",
|
|
6819
6184
|
title: "Remove",
|
|
6820
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6185
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuX, { className: "w-3 h-3" })
|
|
6821
6186
|
}
|
|
6822
6187
|
)
|
|
6823
6188
|
] })
|
|
@@ -6891,10 +6256,10 @@ var AccordionField = ({
|
|
|
6891
6256
|
},
|
|
6892
6257
|
className: "opacity-0 group-hover:opacity-100 p-1 hover:bg-[var(--kyro-danger-bg)] rounded text-[var(--kyro-error)] transition-opacity",
|
|
6893
6258
|
title: "Remove",
|
|
6894
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6259
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuX, { className: "w-3.5 h-3.5" })
|
|
6895
6260
|
}
|
|
6896
6261
|
),
|
|
6897
|
-
isOpen ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
6262
|
+
isOpen ? /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuChevronUp, { className: "w-4 h-4 text-[var(--kyro-text-muted)]" }) : /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuChevronDown, { className: "w-4 h-4 text-[var(--kyro-text-muted)]" })
|
|
6898
6263
|
] })
|
|
6899
6264
|
]
|
|
6900
6265
|
}
|
|
@@ -6934,7 +6299,7 @@ var AccordionField = ({
|
|
|
6934
6299
|
onClick: handleAdd,
|
|
6935
6300
|
className: "flex items-center justify-center gap-1.5 w-full px-3 py-2 text-xs font-medium rounded-lg border border-dashed border-[var(--kyro-border)] bg-[var(--kyro-surface-accent)] text-[var(--kyro-text-secondary)] hover:border-[var(--kyro-sidebar-active)] hover:text-[var(--kyro-text-primary)] transition-colors",
|
|
6936
6301
|
children: [
|
|
6937
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6302
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuPlus, { className: "w-3.5 h-3.5" }),
|
|
6938
6303
|
"Add Item"
|
|
6939
6304
|
]
|
|
6940
6305
|
}
|
|
@@ -6968,10 +6333,10 @@ var AccordionField = ({
|
|
|
6968
6333
|
},
|
|
6969
6334
|
className: "opacity-0 group-hover:opacity-100 p-1.5 hover:bg-[var(--kyro-danger-bg)] rounded text-[var(--kyro-error)] transition-opacity",
|
|
6970
6335
|
title: "Remove",
|
|
6971
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6336
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuX, { className: "w-4 h-4" })
|
|
6972
6337
|
}
|
|
6973
6338
|
),
|
|
6974
|
-
isOpen ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
6339
|
+
isOpen ? /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuChevronUp, { className: "w-4 h-4 text-[var(--kyro-text-muted)]" }) : /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuChevronDown, { className: "w-4 h-4 text-[var(--kyro-text-muted)]" })
|
|
6975
6340
|
] })
|
|
6976
6341
|
]
|
|
6977
6342
|
}
|
|
@@ -7009,7 +6374,7 @@ var AccordionField = ({
|
|
|
7009
6374
|
onClick: handleAdd,
|
|
7010
6375
|
className: "flex items-center justify-center gap-1.5 w-full px-3 py-2 text-xs font-medium rounded-lg border border-dashed border-[var(--kyro-border)] bg-[var(--kyro-surface-accent)] text-[var(--kyro-text-secondary)] hover:border-[var(--kyro-sidebar-active)] hover:text-[var(--kyro-text-primary)] transition-colors",
|
|
7011
6376
|
children: [
|
|
7012
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6377
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuPlus, { className: "w-3.5 h-3.5" }),
|
|
7013
6378
|
"Add Item"
|
|
7014
6379
|
]
|
|
7015
6380
|
}
|
|
@@ -7045,7 +6410,7 @@ var AccordionBlock = ({
|
|
|
7045
6410
|
onClick: () => moveBlock(block3.id, "up"),
|
|
7046
6411
|
className: "p-1 hover:bg-[var(--kyro-surface-accent)] rounded",
|
|
7047
6412
|
title: "Move up",
|
|
7048
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6413
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuChevronRight, { className: "w-3 h-3 rotate-90" })
|
|
7049
6414
|
}
|
|
7050
6415
|
),
|
|
7051
6416
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -7055,7 +6420,7 @@ var AccordionBlock = ({
|
|
|
7055
6420
|
onClick: () => moveBlock(block3.id, "down"),
|
|
7056
6421
|
className: "p-1 hover:bg-[var(--kyro-surface-accent)] rounded",
|
|
7057
6422
|
title: "Move down",
|
|
7058
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6423
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuChevronRight, { className: "w-3 h-3" })
|
|
7059
6424
|
}
|
|
7060
6425
|
),
|
|
7061
6426
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -7065,7 +6430,7 @@ var AccordionBlock = ({
|
|
|
7065
6430
|
onClick: () => removeBlock(block3.id),
|
|
7066
6431
|
className: "p-1 hover:bg-red-50 rounded text-red-500",
|
|
7067
6432
|
title: "Remove",
|
|
7068
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6433
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuX, { className: "w-3 h-3" })
|
|
7069
6434
|
}
|
|
7070
6435
|
)
|
|
7071
6436
|
] })
|
|
@@ -7086,7 +6451,7 @@ var RichTextBlock = ({
|
|
|
7086
6451
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "block-richtext border border-[var(--kyro-border)] rounded-md p-3 mb-2 relative group", children: [
|
|
7087
6452
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mb-2", children: [
|
|
7088
6453
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
7089
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6454
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuAlignLeft, { className: "w-3.5 h-3.5 text-[var(--kyro-primary)]" }),
|
|
7090
6455
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-semibold text-[var(--kyro-text-muted)] ", children: "Rich Text" })
|
|
7091
6456
|
] }),
|
|
7092
6457
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity", children: [
|
|
@@ -7097,7 +6462,7 @@ var RichTextBlock = ({
|
|
|
7097
6462
|
onClick: () => moveBlock(block3.id, "up"),
|
|
7098
6463
|
className: "p-1 hover:bg-[var(--kyro-surface-accent)] rounded",
|
|
7099
6464
|
title: "Move up",
|
|
7100
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6465
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuChevronRight, { className: "w-3 h-3 rotate-90" })
|
|
7101
6466
|
}
|
|
7102
6467
|
),
|
|
7103
6468
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -7107,7 +6472,7 @@ var RichTextBlock = ({
|
|
|
7107
6472
|
onClick: () => moveBlock(block3.id, "down"),
|
|
7108
6473
|
className: "p-1 hover:bg-[var(--kyro-surface-accent)] rounded",
|
|
7109
6474
|
title: "Move down",
|
|
7110
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6475
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuChevronRight, { className: "w-3 h-3" })
|
|
7111
6476
|
}
|
|
7112
6477
|
),
|
|
7113
6478
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -7117,7 +6482,7 @@ var RichTextBlock = ({
|
|
|
7117
6482
|
onClick: () => removeBlock(block3.id),
|
|
7118
6483
|
className: "p-1 hover:bg-red-50 rounded text-red-500",
|
|
7119
6484
|
title: "Remove",
|
|
7120
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6485
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuX, { className: "w-3 h-3" })
|
|
7121
6486
|
}
|
|
7122
6487
|
)
|
|
7123
6488
|
] })
|
|
@@ -7255,7 +6620,7 @@ var HeroBlock = ({
|
|
|
7255
6620
|
onClick: () => moveBlock(block3.id, "up"),
|
|
7256
6621
|
className: "p-1 hover:bg-[var(--kyro-surface-accent)] rounded",
|
|
7257
6622
|
title: "Move up",
|
|
7258
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6623
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuChevronRight, { className: "w-3 h-3 rotate-90" })
|
|
7259
6624
|
}
|
|
7260
6625
|
),
|
|
7261
6626
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -7265,7 +6630,7 @@ var HeroBlock = ({
|
|
|
7265
6630
|
onClick: () => moveBlock(block3.id, "down"),
|
|
7266
6631
|
className: "p-1 hover:bg-[var(--kyro-surface-accent)] rounded",
|
|
7267
6632
|
title: "Move down",
|
|
7268
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6633
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuChevronRight, { className: "w-3 h-3" })
|
|
7269
6634
|
}
|
|
7270
6635
|
),
|
|
7271
6636
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -7275,7 +6640,7 @@ var HeroBlock = ({
|
|
|
7275
6640
|
onClick: () => removeBlock(block3.id),
|
|
7276
6641
|
className: "p-1 hover:bg-red-50 rounded text-red-500",
|
|
7277
6642
|
title: "Remove",
|
|
7278
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6643
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuX, { className: "w-3 h-3" })
|
|
7279
6644
|
}
|
|
7280
6645
|
)
|
|
7281
6646
|
] })
|
|
@@ -7388,10 +6753,10 @@ var ArrayField = ({
|
|
|
7388
6753
|
},
|
|
7389
6754
|
className: "opacity-0 group-hover:opacity-100 p-1 hover:bg-[var(--kyro-danger-bg)] rounded text-[var(--kyro-error)] transition-opacity",
|
|
7390
6755
|
title: "Remove",
|
|
7391
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6756
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuX, { className: "w-3.5 h-3.5" })
|
|
7392
6757
|
}
|
|
7393
6758
|
),
|
|
7394
|
-
isOpen ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
6759
|
+
isOpen ? /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuChevronUp, { className: "w-4 h-4 text-[var(--kyro-text-muted)]" }) : /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuChevronDown, { className: "w-4 h-4 text-[var(--kyro-text-muted)]" })
|
|
7395
6760
|
] })
|
|
7396
6761
|
]
|
|
7397
6762
|
}
|
|
@@ -7430,7 +6795,7 @@ var ArrayField = ({
|
|
|
7430
6795
|
onClick: handleAdd,
|
|
7431
6796
|
className: "flex items-center justify-center gap-1.5 w-full px-3 py-2 text-xs font-medium rounded-lg border border-dashed border-[var(--kyro-border)] bg-[var(--kyro-surface-accent)] text-[var(--kyro-text-secondary)] hover:border-[var(--kyro-sidebar-active)] hover:text-[var(--kyro-text-primary)] transition-colors",
|
|
7432
6797
|
children: [
|
|
7433
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6798
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuPlus, { className: "w-3.5 h-3.5" }),
|
|
7434
6799
|
"Add Item"
|
|
7435
6800
|
]
|
|
7436
6801
|
}
|
|
@@ -7465,10 +6830,10 @@ var ArrayField = ({
|
|
|
7465
6830
|
},
|
|
7466
6831
|
className: "opacity-0 group-hover:opacity-100 p-1.5 hover:bg-[var(--kyro-danger-bg)] rounded text-[var(--kyro-error)] transition-opacity",
|
|
7467
6832
|
title: "Remove",
|
|
7468
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6833
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuX, { className: "w-4 h-4" })
|
|
7469
6834
|
}
|
|
7470
6835
|
),
|
|
7471
|
-
isOpen ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
6836
|
+
isOpen ? /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuChevronUp, { className: "w-4 h-4 text-[var(--kyro-text-muted)]" }) : /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuChevronDown, { className: "w-4 h-4 text-[var(--kyro-text-muted)]" })
|
|
7472
6837
|
] })
|
|
7473
6838
|
]
|
|
7474
6839
|
}
|
|
@@ -7505,7 +6870,7 @@ var ArrayField = ({
|
|
|
7505
6870
|
onClick: handleAdd,
|
|
7506
6871
|
className: "flex items-center justify-center gap-1.5 w-full px-3 py-2 text-xs font-medium rounded-lg border border-dashed border-[var(--kyro-border)] bg-[var(--kyro-surface-accent)] text-[var(--kyro-text-secondary)] hover:border-[var(--kyro-sidebar-active)] hover:text-[var(--kyro-text-primary)] transition-colors",
|
|
7507
6872
|
children: [
|
|
7508
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6873
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuPlus, { className: "w-3.5 h-3.5" }),
|
|
7509
6874
|
"Add Item"
|
|
7510
6875
|
]
|
|
7511
6876
|
}
|
|
@@ -7539,7 +6904,7 @@ var ArrayBlock = ({
|
|
|
7539
6904
|
onClick: () => moveBlock(block3.id, "up"),
|
|
7540
6905
|
className: "p-1 hover:bg-[var(--kyro-surface-accent)] rounded",
|
|
7541
6906
|
title: "Move up",
|
|
7542
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6907
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuChevronRight, { className: "w-3 h-3 rotate-90" })
|
|
7543
6908
|
}
|
|
7544
6909
|
),
|
|
7545
6910
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -7549,7 +6914,7 @@ var ArrayBlock = ({
|
|
|
7549
6914
|
onClick: () => moveBlock(block3.id, "down"),
|
|
7550
6915
|
className: "p-1 hover:bg-[var(--kyro-surface-accent)] rounded",
|
|
7551
6916
|
title: "Move down",
|
|
7552
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6917
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuChevronRight, { className: "w-3 h-3" })
|
|
7553
6918
|
}
|
|
7554
6919
|
),
|
|
7555
6920
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -7559,7 +6924,7 @@ var ArrayBlock = ({
|
|
|
7559
6924
|
onClick: () => removeBlock(block3.id),
|
|
7560
6925
|
className: "p-1 hover:bg-red-50 rounded text-red-500",
|
|
7561
6926
|
title: "Remove",
|
|
7562
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6927
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuX, { className: "w-3 h-3" })
|
|
7563
6928
|
}
|
|
7564
6929
|
)
|
|
7565
6930
|
] })
|
|
@@ -7618,7 +6983,7 @@ var RelationshipBlock = ({
|
|
|
7618
6983
|
onClick: () => moveBlock(block3.id, "up"),
|
|
7619
6984
|
className: "p-1 hover:bg-[var(--kyro-surface-accent)] rounded",
|
|
7620
6985
|
title: "Move up",
|
|
7621
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6986
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuChevronRight, { className: "w-3 h-3 rotate-90" })
|
|
7622
6987
|
}
|
|
7623
6988
|
),
|
|
7624
6989
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -7628,7 +6993,7 @@ var RelationshipBlock = ({
|
|
|
7628
6993
|
onClick: () => moveBlock(block3.id, "down"),
|
|
7629
6994
|
className: "p-1 hover:bg-[var(--kyro-surface-accent)] rounded",
|
|
7630
6995
|
title: "Move down",
|
|
7631
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6996
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuChevronRight, { className: "w-3 h-3" })
|
|
7632
6997
|
}
|
|
7633
6998
|
),
|
|
7634
6999
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -7638,7 +7003,7 @@ var RelationshipBlock = ({
|
|
|
7638
7003
|
onClick: () => removeBlock(block3.id),
|
|
7639
7004
|
className: "p-1 hover:bg-red-50 rounded text-red-500",
|
|
7640
7005
|
title: "Remove",
|
|
7641
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7006
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuX, { className: "w-3 h-3" })
|
|
7642
7007
|
}
|
|
7643
7008
|
)
|
|
7644
7009
|
] })
|
|
@@ -7677,23 +7042,23 @@ var BLOCK_COMPONENTS = {
|
|
|
7677
7042
|
relationship: RelationshipBlock
|
|
7678
7043
|
};
|
|
7679
7044
|
var blockIcons = {
|
|
7680
|
-
columns: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7681
|
-
heading: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7682
|
-
paragraph: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7683
|
-
divider: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7684
|
-
image: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7685
|
-
video: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7686
|
-
list: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7687
|
-
code: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7688
|
-
link: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7689
|
-
file: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7690
|
-
vstack: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7691
|
-
button: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7692
|
-
accordion: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7693
|
-
richtext: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7694
|
-
hero: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7695
|
-
array: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7696
|
-
relationship: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7045
|
+
columns: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuColumns3, { className: "w-4 h-4" }),
|
|
7046
|
+
heading: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuHeading1, { className: "w-4 h-4" }),
|
|
7047
|
+
paragraph: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuAlignLeft, { className: "w-4 h-4" }),
|
|
7048
|
+
divider: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuMinus, { className: "w-4 h-4" }),
|
|
7049
|
+
image: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuImage, { className: "w-4 h-4" }),
|
|
7050
|
+
video: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuVideo, { className: "w-4 h-4" }),
|
|
7051
|
+
list: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuList, { className: "w-4 h-4" }),
|
|
7052
|
+
code: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuCode, { className: "w-4 h-4" }),
|
|
7053
|
+
link: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuLink, { className: "w-4 h-4" }),
|
|
7054
|
+
file: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuFile, { className: "w-4 h-4" }),
|
|
7055
|
+
vstack: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuArrowDown, { className: "w-4 h-4" }),
|
|
7056
|
+
button: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuMousePointerClick, { className: "w-4 h-4" }),
|
|
7057
|
+
accordion: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuChevronDown, { className: "w-4 h-4" }),
|
|
7058
|
+
richtext: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuAlignLeft, { className: "w-4 h-4" }),
|
|
7059
|
+
hero: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuStar, { className: "w-4 h-4" }),
|
|
7060
|
+
array: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuListOrdered, { className: "w-4 h-4" }),
|
|
7061
|
+
relationship: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuLink2, { className: "w-4 h-4" })
|
|
7697
7062
|
};
|
|
7698
7063
|
function getBlockComponent(type) {
|
|
7699
7064
|
return BLOCK_COMPONENTS[type];
|
|
@@ -7857,12 +7222,12 @@ var SortableBlockComponent = ({
|
|
|
7857
7222
|
attributes,
|
|
7858
7223
|
listeners,
|
|
7859
7224
|
setNodeRef,
|
|
7860
|
-
transform,
|
|
7225
|
+
transform: transform2,
|
|
7861
7226
|
transition,
|
|
7862
7227
|
isDragging
|
|
7863
7228
|
} = sortable.useSortable({ id: block3.id });
|
|
7864
7229
|
const style = {
|
|
7865
|
-
transform: utilities.CSS.Transform.toString(
|
|
7230
|
+
transform: utilities.CSS.Transform.toString(transform2),
|
|
7866
7231
|
transition,
|
|
7867
7232
|
zIndex: isDragging ? 10 : 1,
|
|
7868
7233
|
opacity: isDragging ? 0.8 : 1
|
|
@@ -7875,7 +7240,7 @@ var SortableBlockComponent = ({
|
|
|
7875
7240
|
className: "absolute left-0 top-1/2 -translate-y-1/2 p-1.5 cursor-grab active:cursor-grabbing text-[var(--kyro-text-muted)] opacity-0 group-hover:opacity-100 transition-opacity hover:bg-[var(--kyro-surface-accent)] rounded",
|
|
7876
7241
|
...attributes,
|
|
7877
7242
|
...listeners,
|
|
7878
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7243
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuGripVertical, { className: "w-4 h-4" })
|
|
7879
7244
|
}
|
|
7880
7245
|
),
|
|
7881
7246
|
Component ? /* @__PURE__ */ jsxRuntime.jsx(Component, { block: block3, index }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-4 border border-[var(--kyro-border)] rounded-md", children: [
|
|
@@ -8024,7 +7389,7 @@ var BlocksField = ({
|
|
|
8024
7389
|
disabled,
|
|
8025
7390
|
className: "flex items-center gap-2 px-3 py-2 text-sm text-[var(--kyro-primary)] hover:bg-[var(--kyro-surface-accent)]/30 rounded-md transition-colors disabled:opacity-50 font-semibold",
|
|
8026
7391
|
children: [
|
|
8027
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7392
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuPlus, { className: "w-4 h-4" }),
|
|
8028
7393
|
"Add Block"
|
|
8029
7394
|
]
|
|
8030
7395
|
}
|
|
@@ -8042,7 +7407,7 @@ var BlocksField = ({
|
|
|
8042
7407
|
{
|
|
8043
7408
|
block: block3,
|
|
8044
7409
|
onSelect: handleAddBlock,
|
|
8045
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-6 h-6 flex items-center justify-center rounded group-hover:bg-[var(--kyro-primary)]/10 group-hover:text-[var(--kyro-primary)] transition-all duration-300", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[var(--kyro-text-muted)]", children: blockIcons[block3.icon] || /* @__PURE__ */ jsxRuntime.jsx(
|
|
7410
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-6 h-6 flex items-center justify-center rounded group-hover:bg-[var(--kyro-primary)]/10 group-hover:text-[var(--kyro-primary)] transition-all duration-300", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[var(--kyro-text-muted)]", children: blockIcons[block3.icon] || /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuBox, { className: "w-4 h-4" }) }) })
|
|
8046
7411
|
},
|
|
8047
7412
|
block3.type
|
|
8048
7413
|
)) })
|
|
@@ -9784,6 +9149,28 @@ function DropdownItem({
|
|
|
9784
9149
|
function DropdownSeparator() {
|
|
9785
9150
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "my-1 border-t border-[var(--kyro-border)] opacity-50" });
|
|
9786
9151
|
}
|
|
9152
|
+
function Spinner({ size = "md", className = "" }) {
|
|
9153
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9154
|
+
"svg",
|
|
9155
|
+
{
|
|
9156
|
+
className: `kyro-spinner kyro-spinner-${size} ${className}`,
|
|
9157
|
+
viewBox: "0 0 24 24",
|
|
9158
|
+
fill: "none",
|
|
9159
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9160
|
+
"circle",
|
|
9161
|
+
{
|
|
9162
|
+
cx: "12",
|
|
9163
|
+
cy: "12",
|
|
9164
|
+
r: "10",
|
|
9165
|
+
stroke: "currentColor",
|
|
9166
|
+
strokeWidth: "3",
|
|
9167
|
+
strokeLinecap: "round",
|
|
9168
|
+
strokeDasharray: "40 20"
|
|
9169
|
+
}
|
|
9170
|
+
)
|
|
9171
|
+
}
|
|
9172
|
+
);
|
|
9173
|
+
}
|
|
9787
9174
|
function ActionBar({
|
|
9788
9175
|
status,
|
|
9789
9176
|
saveStatus,
|
|
@@ -10119,10 +9506,10 @@ function Toast({ type, message, onClose }) {
|
|
|
10119
9506
|
return clearTimer;
|
|
10120
9507
|
}, [isPaused, onClose]);
|
|
10121
9508
|
const Icon = {
|
|
10122
|
-
success:
|
|
10123
|
-
error:
|
|
10124
|
-
warning:
|
|
10125
|
-
info:
|
|
9509
|
+
success: chunk3BGDYKTD_cjs.LuCircleCheck,
|
|
9510
|
+
error: chunk3BGDYKTD_cjs.LuShieldAlert,
|
|
9511
|
+
warning: chunk3BGDYKTD_cjs.LuTriangleAlert,
|
|
9512
|
+
info: chunk3BGDYKTD_cjs.LuInfo
|
|
10126
9513
|
}[type];
|
|
10127
9514
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10128
9515
|
"div",
|
|
@@ -10140,7 +9527,7 @@ function Toast({ type, message, onClose }) {
|
|
|
10140
9527
|
type: "button",
|
|
10141
9528
|
className: "kyro-toast-close group-hover:opacity-100 opacity-40 transition-opacity",
|
|
10142
9529
|
onClick: onClose,
|
|
10143
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9530
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuX, { className: "w-3.5 h-3.5" })
|
|
10144
9531
|
}
|
|
10145
9532
|
)
|
|
10146
9533
|
]
|
|
@@ -10190,7 +9577,7 @@ function CountBadge({ count, max = 99 }) {
|
|
|
10190
9577
|
function DetailView({
|
|
10191
9578
|
config,
|
|
10192
9579
|
collection,
|
|
10193
|
-
global,
|
|
9580
|
+
global: global2,
|
|
10194
9581
|
documentId,
|
|
10195
9582
|
onBack,
|
|
10196
9583
|
onSave,
|
|
@@ -10211,9 +9598,9 @@ function DetailView({
|
|
|
10211
9598
|
const [updatedAt, setUpdatedAt] = React17.useState(null);
|
|
10212
9599
|
const [publishedAt, setPublishedAt] = React17.useState(null);
|
|
10213
9600
|
const [justSaved, setJustSaved] = React17.useState(false);
|
|
10214
|
-
const fields2 =
|
|
10215
|
-
const label =
|
|
10216
|
-
const slug =
|
|
9601
|
+
const fields2 = global2?.fields || collection?.fields || [];
|
|
9602
|
+
const label = global2?.label || collection?.label || "Document";
|
|
9603
|
+
const slug = global2?.slug || collection?.slug || "";
|
|
10217
9604
|
const hasChanges = JSON.stringify(data) !== JSON.stringify(originalData);
|
|
10218
9605
|
React17.useEffect(() => {
|
|
10219
9606
|
if (hasChanges && status === "published") {
|
|
@@ -10356,7 +9743,13 @@ function DetailView({
|
|
|
10356
9743
|
});
|
|
10357
9744
|
};
|
|
10358
9745
|
if (loading) {
|
|
10359
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "kyro-detail", children: /* @__PURE__ */ jsxRuntime.
|
|
9746
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "kyro-detail", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6 p-4", children: [
|
|
9747
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
9748
|
+
/* @__PURE__ */ jsxRuntime.jsx(Shimmer, { variant: "text", className: "w-1/3" }),
|
|
9749
|
+
/* @__PURE__ */ jsxRuntime.jsx(Shimmer, { variant: "text", className: "w-2/3" })
|
|
9750
|
+
] }),
|
|
9751
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-4", children: /* @__PURE__ */ jsxRuntime.jsx(Shimmer, { variant: "rect", count: 4 }) })
|
|
9752
|
+
] }) });
|
|
10360
9753
|
}
|
|
10361
9754
|
const isSingleLayout = mode === "global" || collection?.admin?.layout === "single";
|
|
10362
9755
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kyro-detail", children: [
|
|
@@ -10824,7 +10217,7 @@ function Dashboard({ collections: collections2, onNavigate, user }) {
|
|
|
10824
10217
|
action: collectionList.length > 0 && permissions?.collections?.[collectionList[0]?.[0]]?.create !== false ? {
|
|
10825
10218
|
label: "New Document",
|
|
10826
10219
|
onClick: () => onNavigate("create", collectionList[0]?.[0]),
|
|
10827
|
-
icon:
|
|
10220
|
+
icon: chunk3BGDYKTD_cjs.LuPlus
|
|
10828
10221
|
} : void 0
|
|
10829
10222
|
}
|
|
10830
10223
|
),
|
|
@@ -10832,25 +10225,25 @@ function Dashboard({ collections: collections2, onNavigate, user }) {
|
|
|
10832
10225
|
{
|
|
10833
10226
|
label: "Total Content",
|
|
10834
10227
|
value: stats.totalDocs,
|
|
10835
|
-
icon:
|
|
10228
|
+
icon: chunk3BGDYKTD_cjs.LuFileText,
|
|
10836
10229
|
color: "text-blue-500"
|
|
10837
10230
|
},
|
|
10838
10231
|
{
|
|
10839
10232
|
label: "Media Assets",
|
|
10840
10233
|
value: stats.totalMedia,
|
|
10841
|
-
icon:
|
|
10234
|
+
icon: chunk3BGDYKTD_cjs.LuImage,
|
|
10842
10235
|
color: "text-purple-500"
|
|
10843
10236
|
},
|
|
10844
10237
|
{
|
|
10845
10238
|
label: "Active Users",
|
|
10846
10239
|
value: stats.totalUsers,
|
|
10847
|
-
icon:
|
|
10240
|
+
icon: chunk3BGDYKTD_cjs.LuUsers,
|
|
10848
10241
|
color: "text-green-500"
|
|
10849
10242
|
},
|
|
10850
10243
|
{
|
|
10851
10244
|
label: "System Health",
|
|
10852
10245
|
value: "100%",
|
|
10853
|
-
icon:
|
|
10246
|
+
icon: chunk3BGDYKTD_cjs.LuActivity,
|
|
10854
10247
|
color: "text-amber-500"
|
|
10855
10248
|
}
|
|
10856
10249
|
].map((stat, i) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -10860,7 +10253,7 @@ function Dashboard({ collections: collections2, onNavigate, user }) {
|
|
|
10860
10253
|
children: [
|
|
10861
10254
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
10862
10255
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[10px] font-bold tracking-[0.2em] opacity-40 mb-1", children: stat.label }),
|
|
10863
|
-
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-3xl font-bold tracking-tighter", children: loading ? "
|
|
10256
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-3xl font-bold tracking-tighter", children: loading ? /* @__PURE__ */ jsxRuntime.jsx(Shimmer, { variant: "text", className: "w-16" }) : stat.value })
|
|
10864
10257
|
] }),
|
|
10865
10258
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10866
10259
|
"div",
|
|
@@ -10877,7 +10270,7 @@ function Dashboard({ collections: collections2, onNavigate, user }) {
|
|
|
10877
10270
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-8 min-w-0", children: [
|
|
10878
10271
|
/* @__PURE__ */ jsxRuntime.jsxs("section", { className: "surface-tile p-8", children: [
|
|
10879
10272
|
/* @__PURE__ */ jsxRuntime.jsxs("h2", { className: "text-xl font-bold mb-1 tracking-tight flex items-center gap-2", children: [
|
|
10880
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10273
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuLayoutDashboard, { className: "w-5 h-5 opacity-40" }),
|
|
10881
10274
|
"Content Growth"
|
|
10882
10275
|
] }),
|
|
10883
10276
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[10px] font-bold tracking-widest opacity-40 mb-8", children: "Snapshot of document velocity over the last 7 days" }),
|
|
@@ -10958,7 +10351,7 @@ function Dashboard({ collections: collections2, onNavigate, user }) {
|
|
|
10958
10351
|
children: [
|
|
10959
10352
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mb-2", children: [
|
|
10960
10353
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-bold text-lg tracking-tight group-hover:text-[var(--kyro-primary)] transition-colors", children: config.label || slug }),
|
|
10961
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10354
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuArrowUpRight, { className: "w-4 h-4 opacity-0 group-hover:opacity-100 transition-all" })
|
|
10962
10355
|
] }),
|
|
10963
10356
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-1 bg-[var(--kyro-bg-secondary)] rounded-full mb-3 overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10964
10357
|
"div",
|
|
@@ -10976,7 +10369,7 @@ function Dashboard({ collections: collections2, onNavigate, user }) {
|
|
|
10976
10369
|
/* @__PURE__ */ jsxRuntime.jsxs("section", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
|
|
10977
10370
|
/* @__PURE__ */ jsxRuntime.jsxs("section", { className: "surface-tile p-6 border border-[var(--kyro-border)] hover:border-[var(--kyro-primary)] transition-all cursor-pointer group", children: [
|
|
10978
10371
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-between mb-4", children: /* @__PURE__ */ jsxRuntime.jsxs("h3", { className: "text-xl font-bold tracking-tight group-hover:text-[var(--kyro-primary)] transition-colors flex items-center gap-2", children: [
|
|
10979
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10372
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuPlus, { className: "w-5 h-5" }),
|
|
10980
10373
|
"Quick Links"
|
|
10981
10374
|
] }) }),
|
|
10982
10375
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
|
|
@@ -10991,7 +10384,7 @@ function Dashboard({ collections: collections2, onNavigate, user }) {
|
|
|
10991
10384
|
"New ",
|
|
10992
10385
|
collections2[slug]?.singularLabel || collections2[slug]?.label || slug
|
|
10993
10386
|
] }),
|
|
10994
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10387
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuPlus, { className: "w-4 h-4 text-[var(--kyro-text-secondary)] group-hover/btn:text-[var(--kyro-primary)]" })
|
|
10995
10388
|
]
|
|
10996
10389
|
},
|
|
10997
10390
|
slug
|
|
@@ -11006,17 +10399,17 @@ function Dashboard({ collections: collections2, onNavigate, user }) {
|
|
|
11006
10399
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 font-bold text-xs tracking-widest text-blue-400", children: [
|
|
11007
10400
|
"Open Assets",
|
|
11008
10401
|
" ",
|
|
11009
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10402
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuArrowRight, { className: "w-4 h-4 group-hover:translate-x-1 transition-transform" })
|
|
11010
10403
|
] })
|
|
11011
10404
|
] }),
|
|
11012
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10405
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuImage, { className: "absolute bottom-[-20px] right-[-20px] w-48 h-48 opacity-10 rotate-12 group-hover:scale-110 transition-transform duration-1000" })
|
|
11013
10406
|
] })
|
|
11014
10407
|
] })
|
|
11015
10408
|
] }),
|
|
11016
10409
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
|
|
11017
10410
|
/* @__PURE__ */ jsxRuntime.jsxs("section", { className: "surface-tile p-8", children: [
|
|
11018
10411
|
/* @__PURE__ */ jsxRuntime.jsxs("h2", { className: "text-xl font-bold mb-6 tracking-tight flex items-center gap-2", children: [
|
|
11019
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10412
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuClock, { className: "w-5 h-5 opacity-40" }),
|
|
11020
10413
|
"Recent Activity"
|
|
11021
10414
|
] }),
|
|
11022
10415
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-6", children: stats.recentActivity.map((act) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-4 group", children: [
|
|
@@ -11043,7 +10436,7 @@ function Dashboard({ collections: collections2, onNavigate, user }) {
|
|
|
11043
10436
|
] }),
|
|
11044
10437
|
/* @__PURE__ */ jsxRuntime.jsxs("section", { className: "surface-tile p-8", children: [
|
|
11045
10438
|
/* @__PURE__ */ jsxRuntime.jsxs("h2", { className: "text-xl font-bold mb-6 tracking-tight flex items-center gap-2", children: [
|
|
11046
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10439
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuActivity, { className: "w-5 h-5 opacity-40" }),
|
|
11047
10440
|
"System Status"
|
|
11048
10441
|
] }),
|
|
11049
10442
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-4", children: [
|
|
@@ -11151,18 +10544,18 @@ function UserManagement() {
|
|
|
11151
10544
|
{
|
|
11152
10545
|
title: "Identity & Access",
|
|
11153
10546
|
description: "Manage the core administrative team and security permissions.",
|
|
11154
|
-
icon:
|
|
10547
|
+
icon: chunk3BGDYKTD_cjs.LuUsers,
|
|
11155
10548
|
action: {
|
|
11156
10549
|
label: "New User",
|
|
11157
10550
|
onClick: () => {
|
|
11158
10551
|
},
|
|
11159
|
-
icon:
|
|
10552
|
+
icon: chunk3BGDYKTD_cjs.LuUserPlus
|
|
11160
10553
|
}
|
|
11161
10554
|
}
|
|
11162
10555
|
),
|
|
11163
10556
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col md:flex-row gap-3", children: [
|
|
11164
10557
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex-1 group", children: [
|
|
11165
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10558
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuSearch, { className: "absolute left-3.5 top-1/2 -translate-y-1/2 w-4 h-4 text-[var(--kyro-text-secondary)] opacity-40 group-focus-within:opacity-100 transition-opacity" }),
|
|
11166
10559
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11167
10560
|
"input",
|
|
11168
10561
|
{
|
|
@@ -11200,12 +10593,12 @@ function UserManagement() {
|
|
|
11200
10593
|
] })
|
|
11201
10594
|
] }) }),
|
|
11202
10595
|
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-6 py-3.5", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
11203
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10596
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuShield, { className: "w-3.5 h-3.5 opacity-30" }),
|
|
11204
10597
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] font-bold tracking-widest uppercase opacity-70", children: user.role })
|
|
11205
10598
|
] }) }),
|
|
11206
10599
|
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-6 py-3.5", children: /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: user.locked ? "danger" : "success", dot: true, className: "text-[8px] font-bold uppercase tracking-widest", children: user.locked ? "Restricted" : "Authorized" }) }),
|
|
11207
10600
|
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-6 py-3.5", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 text-[10px] font-bold text-[var(--kyro-text-secondary)] opacity-50 uppercase tabular-nums", children: [
|
|
11208
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10601
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuClock, { className: "w-3 h-3" }),
|
|
11209
10602
|
user.lastLogin ? new Date(user.lastLogin).toLocaleDateString() : "Never"
|
|
11210
10603
|
] }) }),
|
|
11211
10604
|
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-6 py-3.5 text-right", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-end gap-1 opacity-0 group-hover:opacity-100 transition-all", children: [
|
|
@@ -11215,7 +10608,7 @@ function UserManagement() {
|
|
|
11215
10608
|
onClick: () => handleToggleLock(user),
|
|
11216
10609
|
className: `p-1.5 rounded-lg border transition-all ${user.locked ? "bg-green-500/10 text-green-500 border-green-500/20 hover:bg-green-500/20" : "bg-amber-500/10 text-amber-500 border-amber-500/20 hover:bg-amber-500/20"}`,
|
|
11217
10610
|
title: user.locked ? "Restore Access" : "Restrict Access",
|
|
11218
|
-
children: user.locked ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
10611
|
+
children: user.locked ? /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuLockOpen, { className: "w-3.5 h-3.5" }) : /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuLock, { className: "w-3.5 h-3.5" })
|
|
11219
10612
|
}
|
|
11220
10613
|
),
|
|
11221
10614
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -11224,10 +10617,10 @@ function UserManagement() {
|
|
|
11224
10617
|
onClick: () => handleDelete(user),
|
|
11225
10618
|
className: "p-1.5 rounded-lg border border-red-500/20 bg-red-500/10 text-red-500 hover:bg-red-500/20 transition-all",
|
|
11226
10619
|
title: "Delete User",
|
|
11227
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10620
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuTrash2, { className: "w-3.5 h-3.5" })
|
|
11228
10621
|
}
|
|
11229
10622
|
),
|
|
11230
|
-
/* @__PURE__ */ jsxRuntime.jsx("button", { className: "p-1.5 rounded-lg border border-[var(--kyro-border)] bg-[var(--kyro-surface-accent)] text-[var(--kyro-text-secondary)] hover:bg-[var(--kyro-surface)] transition-all", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10623
|
+
/* @__PURE__ */ jsxRuntime.jsx("button", { className: "p-1.5 rounded-lg border border-[var(--kyro-border)] bg-[var(--kyro-surface-accent)] text-[var(--kyro-text-secondary)] hover:bg-[var(--kyro-surface)] transition-all", children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuEllipsisVertical, { className: "w-3.5 h-3.5" }) })
|
|
11231
10624
|
] }) })
|
|
11232
10625
|
] }, user.id)) })
|
|
11233
10626
|
] }) })
|
|
@@ -11309,7 +10702,7 @@ function BrandingHub() {
|
|
|
11309
10702
|
disabled: saving,
|
|
11310
10703
|
className: `flex items-center gap-2 px-8 py-3 rounded-2xl font-bold text-sm shadow-xl transition-all active:scale-95 ${saved ? "bg-green-500 text-white" : "bg-[var(--kyro-primary)] text-white hover:shadow-[var(--kyro-primary)]"}`,
|
|
11311
10704
|
children: [
|
|
11312
|
-
saving ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
10705
|
+
saving ? /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuRefreshCcw, { className: "w-4 h-4 animate-spin" }) : saved ? /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuCheck, { className: "w-4 h-4" }) : /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuSave, { className: "w-4 h-4" }),
|
|
11313
10706
|
saving ? "Saving..." : saved ? "Identity Updated" : "Publish Branding"
|
|
11314
10707
|
]
|
|
11315
10708
|
}
|
|
@@ -11318,7 +10711,7 @@ function BrandingHub() {
|
|
|
11318
10711
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-8", children: [
|
|
11319
10712
|
/* @__PURE__ */ jsxRuntime.jsxs("section", { className: "surface-tile p-8 space-y-8", children: [
|
|
11320
10713
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 mb-2", children: [
|
|
11321
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10714
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuTag, { className: "w-5 h-5 text-[var(--kyro-primary)]" }),
|
|
11322
10715
|
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-xl font-bold tracking-tight", children: "Core Identity" })
|
|
11323
10716
|
] }),
|
|
11324
10717
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
|
|
@@ -11365,7 +10758,7 @@ function BrandingHub() {
|
|
|
11365
10758
|
] }),
|
|
11366
10759
|
/* @__PURE__ */ jsxRuntime.jsxs("section", { className: "surface-tile p-8 space-y-8", children: [
|
|
11367
10760
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 mb-2", children: [
|
|
11368
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10761
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuPalette, { className: "w-5 h-5 text-[var(--kyro-primary)]" }),
|
|
11369
10762
|
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-xl font-bold tracking-tight", children: "Visual Aesthetic" })
|
|
11370
10763
|
] }),
|
|
11371
10764
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-8", children: [
|
|
@@ -11387,7 +10780,7 @@ function BrandingHub() {
|
|
|
11387
10780
|
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-[10px] font-bold tracking-[0.2em] opacity-40", children: "Project Logo (SVG/PNG)" }),
|
|
11388
10781
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-6", children: [
|
|
11389
10782
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-20 h-20 rounded-2xl bg-[var(--kyro-bg-secondary)] border-2 border-dashed border-[var(--kyro-border)] flex flex-col items-center justify-center text-[var(--kyro-text-secondary)] hover:border-[var(--kyro-primary)] hover:text-[var(--kyro-primary)] cursor-pointer transition-all", children: [
|
|
11390
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10783
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuImage, { className: "w-6 h-6 mb-1 opacity-40" }),
|
|
11391
10784
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[8px] font-bold ", children: "Upload" })
|
|
11392
10785
|
] }),
|
|
11393
10786
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1", children: [
|
|
@@ -11400,7 +10793,7 @@ function BrandingHub() {
|
|
|
11400
10793
|
] }),
|
|
11401
10794
|
/* @__PURE__ */ jsxRuntime.jsxs("section", { className: "lg:col-span-2 surface-tile p-8 overflow-hidden relative group", children: [
|
|
11402
10795
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute top-0 right-0 p-8 flex items-center gap-2 text-[var(--kyro-primary)]", children: [
|
|
11403
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10796
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuSparkles, { className: "w-4 h-4" }),
|
|
11404
10797
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] font-bold tracking-widest", children: "Live Preview" })
|
|
11405
10798
|
] }),
|
|
11406
10799
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "max-w-2xl mx-auto py-12 text-center space-y-6", children: [
|
|
@@ -11565,7 +10958,7 @@ function ConfirmModal({
|
|
|
11565
10958
|
}
|
|
11566
10959
|
var API_BASE2 = typeof __KYRO_API_PATH__ !== "undefined" ? __KYRO_API_PATH__ : "/api";
|
|
11567
10960
|
function DeveloperCenter({ collections: collections2 }) {
|
|
11568
|
-
const [
|
|
10961
|
+
const [keys, setKeys] = React17.useState([]);
|
|
11569
10962
|
React17.useState(false);
|
|
11570
10963
|
const [showKey, setShowKey] = React17.useState(null);
|
|
11571
10964
|
const [testEndpoint, setTestEndpoint] = React17.useState("");
|
|
@@ -11640,12 +11033,12 @@ function DeveloperCenter({ collections: collections2 }) {
|
|
|
11640
11033
|
{
|
|
11641
11034
|
title: "Developer Center",
|
|
11642
11035
|
description: "Provision access keys and explore the headless API ecosystem.",
|
|
11643
|
-
icon:
|
|
11036
|
+
icon: chunk3BGDYKTD_cjs.LuCodeXml,
|
|
11644
11037
|
actions: [
|
|
11645
11038
|
{
|
|
11646
11039
|
label: "Generate Key",
|
|
11647
11040
|
onClick: handleGenerateKey,
|
|
11648
|
-
icon:
|
|
11041
|
+
icon: chunk3BGDYKTD_cjs.LuKey
|
|
11649
11042
|
}
|
|
11650
11043
|
]
|
|
11651
11044
|
}
|
|
@@ -11656,17 +11049,17 @@ function DeveloperCenter({ collections: collections2 }) {
|
|
|
11656
11049
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-1 h-4 bg-[var(--kyro-primary)] rounded-full" }),
|
|
11657
11050
|
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-sm font-medium tracking-[0.2em] opacity-40 uppercase", children: "Access Credentials" })
|
|
11658
11051
|
] }),
|
|
11659
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-4", children:
|
|
11660
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11052
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-4", children: keys.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-12 text-center rounded-[2rem] border-2 border-dashed border-[var(--kyro-border)] bg-[var(--kyro-surface-accent)]/30", children: [
|
|
11053
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuLock, { className: "w-10 h-10 mx-auto mb-4 opacity-20" }),
|
|
11661
11054
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-[var(--kyro-text-secondary)] opacity-50", children: "No API keys found. Generate one to get started." })
|
|
11662
|
-
] }) :
|
|
11055
|
+
] }) : keys.map((key) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
11663
11056
|
"div",
|
|
11664
11057
|
{
|
|
11665
11058
|
className: "group relative overflow-hidden bg-[var(--kyro-surface)] border border-[var(--kyro-border)] rounded-3xl p-6 hover:border-[var(--kyro-primary)]/50 transition-all duration-300",
|
|
11666
11059
|
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col md:flex-row md:items-center justify-between gap-6 relative z-10", children: [
|
|
11667
11060
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
11668
11061
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 mb-4", children: [
|
|
11669
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-2.5 bg-[var(--kyro-surface-accent)] rounded-xl group-hover:bg-[var(--kyro-primary)]/10 transition-colors", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11062
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-2.5 bg-[var(--kyro-surface-accent)] rounded-xl group-hover:bg-[var(--kyro-primary)]/10 transition-colors", children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuKey, { className: "w-5 h-5 text-[var(--kyro-text-secondary)] group-hover:text-[var(--kyro-primary)] transition-colors" }) }),
|
|
11670
11063
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-lg font-bold group-hover:text-[var(--kyro-primary)] transition-colors truncate", children: key.name })
|
|
11671
11064
|
] }),
|
|
11672
11065
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 bg-[var(--kyro-bg)] border border-[var(--kyro-border)] rounded-2xl px-4 py-3 flex items-center justify-between group/key overflow-hidden", children: [
|
|
@@ -11678,7 +11071,7 @@ function DeveloperCenter({ collections: collections2 }) {
|
|
|
11678
11071
|
type: "button",
|
|
11679
11072
|
onClick: () => setShowKey(showKey === key.id ? null : key.id),
|
|
11680
11073
|
className: "p-1.5 hover:bg-[var(--kyro-surface-accent)] rounded-lg transition-all text-[var(--kyro-text-secondary)]",
|
|
11681
|
-
children: showKey === key.id ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
11074
|
+
children: showKey === key.id ? /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuEyeOff, { className: "w-4 h-4" }) : /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuEye, { className: "w-4 h-4" })
|
|
11682
11075
|
}
|
|
11683
11076
|
),
|
|
11684
11077
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -11690,7 +11083,7 @@ function DeveloperCenter({ collections: collections2 }) {
|
|
|
11690
11083
|
navigator.clipboard.writeText(key.key);
|
|
11691
11084
|
alert({ title: "Success", message: "API key copied to clipboard" });
|
|
11692
11085
|
},
|
|
11693
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11086
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuCopy, { className: "w-4 h-4" })
|
|
11694
11087
|
}
|
|
11695
11088
|
)
|
|
11696
11089
|
] })
|
|
@@ -11713,7 +11106,7 @@ function DeveloperCenter({ collections: collections2 }) {
|
|
|
11713
11106
|
onClick: () => handleRevokeKey(key.id),
|
|
11714
11107
|
className: "p-3.5 bg-red-500/5 text-red-500 rounded-2xl hover:bg-red-500/10 transition-all border border-transparent hover:border-red-500/30 self-start md:self-center",
|
|
11715
11108
|
title: "Revoke Key",
|
|
11716
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11109
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuTrash2, { className: "w-5 h-5" })
|
|
11717
11110
|
}
|
|
11718
11111
|
)
|
|
11719
11112
|
] })
|
|
@@ -11723,9 +11116,9 @@ function DeveloperCenter({ collections: collections2 }) {
|
|
|
11723
11116
|
] }),
|
|
11724
11117
|
/* @__PURE__ */ jsxRuntime.jsxs("section", { className: "space-y-6", children: [
|
|
11725
11118
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative overflow-hidden rounded-[2.5rem] border border-[var(--kyro-border)] bg-gradient-to-br from-[var(--kyro-primary)] to-[var(--kyro-primary)]/80 p-8 group shadow-2xl shadow-[var(--kyro-primary)]/20", children: [
|
|
11726
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-0 right-0 p-8 opacity-[0.1] pointer-events-none group-hover:scale-110 transition-transform duration-700", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11119
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-0 right-0 p-8 opacity-[0.1] pointer-events-none group-hover:scale-110 transition-transform duration-700", children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuTerminal, { className: "w-48 h-48 rotate-12" }) }),
|
|
11727
11120
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative z-10", children: [
|
|
11728
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-12 h-12 bg-white/20 backdrop-blur-md rounded-2xl flex items-center justify-center mb-6", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11121
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-12 h-12 bg-white/20 backdrop-blur-md rounded-2xl flex items-center justify-center mb-6", children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuTerminal, { className: "w-6 h-6 text-white" }) }),
|
|
11729
11122
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-white text-2xl font-bold tracking-tight mb-3", children: "Endpoint Hub" }),
|
|
11730
11123
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-white/80 text-sm font-medium leading-relaxed mb-8", children: "Kyro CMS is built for high-performance content delivery. Use these endpoints to power your headless frontends." }),
|
|
11731
11124
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -11735,7 +11128,7 @@ function DeveloperCenter({ collections: collections2 }) {
|
|
|
11735
11128
|
className: "w-full py-4 bg-white text-[var(--kyro-primary)] rounded-[1.2rem] font-bold text-xs uppercase tracking-widest hover:shadow-xl transition-all flex items-center justify-center gap-2 active:scale-[0.98]",
|
|
11736
11129
|
children: [
|
|
11737
11130
|
"Full API Documentation",
|
|
11738
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11131
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuExternalLink, { className: "w-3.5 h-3.5" })
|
|
11739
11132
|
]
|
|
11740
11133
|
}
|
|
11741
11134
|
)
|
|
@@ -11753,7 +11146,7 @@ function DeveloperCenter({ collections: collections2 }) {
|
|
|
11753
11146
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute -inset-0.5 bg-gradient-to-r from-[var(--kyro-primary)]/30 to-transparent rounded-xl blur opacity-0 group-hover:opacity-100 transition-all" }),
|
|
11754
11147
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative bg-[var(--kyro-bg)] p-3.5 rounded-xl border border-[var(--kyro-border)] flex items-center justify-between", children: [
|
|
11755
11148
|
/* @__PURE__ */ jsxRuntime.jsx("code", { className: "text-[10px] font-mono opacity-60", children: "https://api.kyro.io/v1" }),
|
|
11756
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11149
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuCopy, { className: "w-3.5 h-3.5 opacity-0 group-hover:opacity-40 cursor-pointer transition-opacity", onClick: () => navigator.clipboard.writeText("https://api.kyro.io/v1") })
|
|
11757
11150
|
] })
|
|
11758
11151
|
] })
|
|
11759
11152
|
] }),
|
|
@@ -11766,7 +11159,7 @@ function DeveloperCenter({ collections: collections2 }) {
|
|
|
11766
11159
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute -inset-0.5 bg-gradient-to-r from-amber-500/30 to-transparent rounded-xl blur opacity-0 group-hover:opacity-100 transition-all" }),
|
|
11767
11160
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative bg-[var(--kyro-bg)] p-3.5 rounded-xl border border-[var(--kyro-border)] flex items-center justify-between", children: [
|
|
11768
11161
|
/* @__PURE__ */ jsxRuntime.jsx("code", { className: "text-[10px] font-mono opacity-60", children: "https://preview.kyro.io/v1" }),
|
|
11769
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11162
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuCopy, { className: "w-3.5 h-3.5 opacity-0 group-hover:opacity-40 cursor-pointer transition-opacity", onClick: () => navigator.clipboard.writeText("https://preview.kyro.io/v1") })
|
|
11770
11163
|
] })
|
|
11771
11164
|
] })
|
|
11772
11165
|
] })
|
|
@@ -11774,11 +11167,11 @@ function DeveloperCenter({ collections: collections2 }) {
|
|
|
11774
11167
|
] })
|
|
11775
11168
|
] }),
|
|
11776
11169
|
/* @__PURE__ */ jsxRuntime.jsxs("section", { className: "xl:col-span-3 rounded-[3rem] border border-[var(--kyro-border)] bg-[var(--kyro-surface)]/50 p-10 space-y-10 overflow-hidden relative", children: [
|
|
11777
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-0 right-0 p-20 opacity-[0.02] pointer-events-none", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11170
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-0 right-0 p-20 opacity-[0.02] pointer-events-none", children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuCirclePlay, { className: "w-96 h-96" }) }),
|
|
11778
11171
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col lg:flex-row lg:items-center justify-between gap-10 relative z-10", children: [
|
|
11779
11172
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "max-w-xl", children: [
|
|
11780
11173
|
/* @__PURE__ */ jsxRuntime.jsxs("h2", { className: "text-3xl font-bold tracking-tighter flex items-center gap-4 mb-3", children: [
|
|
11781
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-12 h-12 bg-[var(--kyro-primary)]/10 rounded-2xl flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11174
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-12 h-12 bg-[var(--kyro-primary)]/10 rounded-2xl flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuCirclePlay, { className: "w-7 h-7 text-[var(--kyro-primary)]" }) }),
|
|
11782
11175
|
"API ",
|
|
11783
11176
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[var(--kyro-primary)]", children: "Explorer" })
|
|
11784
11177
|
] }),
|
|
@@ -11810,7 +11203,7 @@ function DeveloperCenter({ collections: collections2 }) {
|
|
|
11810
11203
|
disabled: exploring || !testEndpoint,
|
|
11811
11204
|
className: "px-8 py-4 bg-[var(--kyro-primary)] text-white rounded-[1.5rem] font-bold text-sm shadow-xl disabled:opacity-50 disabled:cursor-not-allowed hover:scale-[1.02] transition-all flex items-center gap-3 shrink-0",
|
|
11812
11205
|
children: [
|
|
11813
|
-
exploring ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
11206
|
+
exploring ? /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuRefreshCcw, { className: "w-4 h-4 animate-spin" }) : /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuChevronRight, { className: "w-5 h-5" }),
|
|
11814
11207
|
"Run Query"
|
|
11815
11208
|
]
|
|
11816
11209
|
}
|
|
@@ -11844,7 +11237,7 @@ function DeveloperCenter({ collections: collections2 }) {
|
|
|
11844
11237
|
)
|
|
11845
11238
|
] })
|
|
11846
11239
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "h-80 rounded-[3rem] border-2 border-dashed border-[var(--kyro-border)] flex flex-col items-center justify-center bg-[var(--kyro-surface-accent)]/20 transition-all duration-700", children: [
|
|
11847
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-20 h-20 bg-[var(--kyro-surface)] rounded-3xl flex items-center justify-center shadow-lg border border-[var(--kyro-border)] mb-6 opacity-20", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11240
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-20 h-20 bg-[var(--kyro-surface)] rounded-3xl flex items-center justify-center shadow-lg border border-[var(--kyro-border)] mb-6 opacity-20", children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuCodeXml, { className: "w-10 h-10" }) }),
|
|
11848
11241
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-bold text-sm opacity-30 uppercase tracking-[0.2em]", children: "Awaiting request dispatch..." })
|
|
11849
11242
|
] })
|
|
11850
11243
|
] })
|
|
@@ -12072,7 +11465,7 @@ function WebhookManager() {
|
|
|
12072
11465
|
{
|
|
12073
11466
|
title: "Webhooks",
|
|
12074
11467
|
description: "Receive real-time notifications when your content changes.",
|
|
12075
|
-
icon:
|
|
11468
|
+
icon: chunk3BGDYKTD_cjs.LuWebhook,
|
|
12076
11469
|
actions: [
|
|
12077
11470
|
{
|
|
12078
11471
|
label: "Create Webhook",
|
|
@@ -12086,21 +11479,21 @@ function WebhookManager() {
|
|
|
12086
11479
|
setCreateError("");
|
|
12087
11480
|
setShowCreateModal(true);
|
|
12088
11481
|
},
|
|
12089
|
-
icon:
|
|
11482
|
+
icon: chunk3BGDYKTD_cjs.LuPlus
|
|
12090
11483
|
},
|
|
12091
11484
|
{
|
|
12092
11485
|
label: "Guide",
|
|
12093
11486
|
onClick: () => setShowHelpModal(true),
|
|
12094
|
-
icon:
|
|
11487
|
+
icon: chunk3BGDYKTD_cjs.LuInfo,
|
|
12095
11488
|
variant: "outline"
|
|
12096
11489
|
}
|
|
12097
11490
|
]
|
|
12098
11491
|
}
|
|
12099
11492
|
),
|
|
12100
11493
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative overflow-hidden rounded-[2rem] border border-[var(--kyro-border)] bg-gradient-to-br from-[var(--kyro-surface)] to-[var(--kyro-surface-accent)] p-8", children: [
|
|
12101
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-0 right-0 p-8 opacity-[0.03] pointer-events-none", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11494
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-0 right-0 p-8 opacity-[0.03] pointer-events-none", children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuZap, { className: "w-64 h-64 rotate-12" }) }),
|
|
12102
11495
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col md:flex-row items-center gap-8 relative z-10", children: [
|
|
12103
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-5 bg-gradient-to-br from-[var(--kyro-primary)] to-[var(--kyro-primary)]/50 rounded-[1.5rem] shadow-xl shadow-[var(--kyro-primary)]/20", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11496
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-5 bg-gradient-to-br from-[var(--kyro-primary)] to-[var(--kyro-primary)]/50 rounded-[1.5rem] shadow-xl shadow-[var(--kyro-primary)]/20", children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuZap, { className: "w-8 h-8 text-white" }) }),
|
|
12104
11497
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 text-center md:text-left", children: [
|
|
12105
11498
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-xl font-bold mb-2", children: "Real-time Event Synchronization" }),
|
|
12106
11499
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-[var(--kyro-text-secondary)] opacity-70 max-w-2xl leading-relaxed", children: "Webhooks allow your application to receive instant HTTP notifications when events happen in your CMS. Eliminate polling and build responsive, event-driven architectures with ease." })
|
|
@@ -12130,7 +11523,7 @@ function WebhookManager() {
|
|
|
12130
11523
|
] })
|
|
12131
11524
|
] }),
|
|
12132
11525
|
loading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center p-20 surface-tile rounded-3xl opacity-50 italic", children: "Connecting to dispatcher..." }) : webhooks.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-16 text-center rounded-[3rem] border-2 border-dashed border-[var(--kyro-border)] bg-[var(--kyro-surface-accent)]/30", children: [
|
|
12133
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-20 h-20 mx-auto mb-6 bg-gradient-to-tr from-[var(--kyro-surface)] to-[var(--kyro-surface-accent)] rounded-3xl flex items-center justify-center shadow-xl border border-[var(--kyro-border)]", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11526
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-20 h-20 mx-auto mb-6 bg-gradient-to-tr from-[var(--kyro-surface)] to-[var(--kyro-surface-accent)] rounded-3xl flex items-center justify-center shadow-xl border border-[var(--kyro-border)]", children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuWebhook, { className: "w-10 h-10 text-[var(--kyro-primary)]" }) }),
|
|
12134
11527
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-2xl font-bold mb-3", children: "No Webhooks Found" }),
|
|
12135
11528
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-[var(--kyro-text-secondary)] opacity-60 mb-8 max-w-sm mx-auto", children: "Your CMS is currently silent. Create a webhook to start broadcasting events to your external services." }),
|
|
12136
11529
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -12140,7 +11533,7 @@ function WebhookManager() {
|
|
|
12140
11533
|
onClick: () => setShowCreateModal(true),
|
|
12141
11534
|
className: "inline-flex items-center gap-3 px-8 py-4 bg-[var(--kyro-primary)] text-white rounded-2xl font-bold hover:scale-[1.05] transition-all shadow-xl shadow-[var(--kyro-primary)]/10",
|
|
12142
11535
|
children: [
|
|
12143
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11536
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuPlus, { className: "w-5 h-5" }),
|
|
12144
11537
|
"Configure Webhook"
|
|
12145
11538
|
]
|
|
12146
11539
|
}
|
|
@@ -12152,7 +11545,7 @@ function WebhookManager() {
|
|
|
12152
11545
|
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col lg:flex-row lg:items-center justify-between gap-6 relative z-10", children: [
|
|
12153
11546
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1", children: [
|
|
12154
11547
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 mb-4", children: [
|
|
12155
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-2.5 bg-[var(--kyro-surface-accent)] rounded-xl group-hover:bg-[var(--kyro-primary)]/10 transition-colors", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11548
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-2.5 bg-[var(--kyro-surface-accent)] rounded-xl group-hover:bg-[var(--kyro-primary)]/10 transition-colors", children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuWebhook, { className: "w-5 h-5 text-[var(--kyro-text-secondary)] group-hover:text-[var(--kyro-primary)] transition-colors" }) }),
|
|
12156
11549
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
12157
11550
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-lg font-bold group-hover:text-[var(--kyro-primary)] transition-colors", children: webhook.name }),
|
|
12158
11551
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mt-0.5", children: [
|
|
@@ -12180,7 +11573,7 @@ function WebhookManager() {
|
|
|
12180
11573
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1 border-l border-[var(--kyro-border)] pl-6", children: [
|
|
12181
11574
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[9px] font-bold uppercase tracking-widest opacity-30", children: "Activity" }),
|
|
12182
11575
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-[10px] font-bold opacity-60 flex items-center gap-1.5", children: [
|
|
12183
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11576
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuClock, { className: "w-3 h-3" }),
|
|
12184
11577
|
webhook.lastTriggered ? `Last triggered: ${new Date(webhook.lastTriggered).toLocaleDateString()}` : "Never triggered"
|
|
12185
11578
|
] })
|
|
12186
11579
|
] })
|
|
@@ -12195,7 +11588,7 @@ function WebhookManager() {
|
|
|
12195
11588
|
className: "flex-1 lg:flex-none p-3 bg-[var(--kyro-surface)] border border-[var(--kyro-border)] rounded-xl hover:border-[var(--kyro-primary)] transition-all flex items-center justify-center gap-2",
|
|
12196
11589
|
title: "Send test request",
|
|
12197
11590
|
children: [
|
|
12198
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11591
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuSend, { className: "w-4 h-4" }),
|
|
12199
11592
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-bold", children: "Test" })
|
|
12200
11593
|
]
|
|
12201
11594
|
}
|
|
@@ -12208,7 +11601,7 @@ function WebhookManager() {
|
|
|
12208
11601
|
onClick: () => toggleStatus(webhook.id, webhook.status),
|
|
12209
11602
|
className: `p-3 bg-[var(--kyro-surface)] border border-[var(--kyro-border)] rounded-xl hover:border-[var(--kyro-primary)] transition-all group/toggle ${webhook.status === "active" ? "text-amber-500/50 hover:text-amber-500" : "text-green-500/50 hover:text-green-500"}`,
|
|
12210
11603
|
title: webhook.status === "active" ? "Pause webhook" : "Activate webhook",
|
|
12211
|
-
children: webhook.status === "active" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
11604
|
+
children: webhook.status === "active" ? /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuPause, { className: "w-4 h-4" }) : /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuPlay, { className: "w-4 h-4" })
|
|
12212
11605
|
}
|
|
12213
11606
|
),
|
|
12214
11607
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -12218,7 +11611,7 @@ function WebhookManager() {
|
|
|
12218
11611
|
onClick: () => remove(webhook.id, "Webhook"),
|
|
12219
11612
|
className: "p-3 bg-red-500/5 border border-red-500/10 rounded-xl hover:bg-red-500/10 hover:border-red-500/30 transition-all group/delete",
|
|
12220
11613
|
title: "Delete webhook",
|
|
12221
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11614
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuTrash2, { className: "w-4 h-4 text-red-500/50 group-hover/delete:text-red-500" })
|
|
12222
11615
|
}
|
|
12223
11616
|
)
|
|
12224
11617
|
] })
|
|
@@ -12290,7 +11683,7 @@ function WebhookManager() {
|
|
|
12290
11683
|
},
|
|
12291
11684
|
className: `flex items-center gap-3 p-3 rounded-lg border transition-all text-left ${formData.events.includes(opt.value) ? "bg-[var(--kyro-primary)]/5 border-[var(--kyro-primary)]/30 text-[var(--kyro-primary)]" : "bg-[var(--kyro-surface-accent)]/50 border-[var(--kyro-border)] hover:border-[var(--kyro-primary)]/30"}`,
|
|
12292
11685
|
children: [
|
|
12293
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: `w-4 h-4 rounded flex items-center justify-center border transition-all ${formData.events.includes(opt.value) ? "bg-[var(--kyro-primary)] border-[var(--kyro-primary)]" : "border-[var(--kyro-border)]"}`, children: formData.events.includes(opt.value) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
11686
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: `w-4 h-4 rounded flex items-center justify-center border transition-all ${formData.events.includes(opt.value) ? "bg-[var(--kyro-primary)] border-[var(--kyro-primary)]" : "border-[var(--kyro-border)]"}`, children: formData.events.includes(opt.value) && /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuCircleCheck, { className: "w-3 h-3 text-white" }) }),
|
|
12294
11687
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
12295
11688
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs font-bold", children: opt.label }),
|
|
12296
11689
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-[10px] opacity-50", children: opt.description })
|
|
@@ -12302,7 +11695,7 @@ function WebhookManager() {
|
|
|
12302
11695
|
] })
|
|
12303
11696
|
] }),
|
|
12304
11697
|
createError && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-3 bg-red-500/10 border border-red-500/20 rounded-xl flex items-center gap-2 text-red-500 text-xs font-bold", children: [
|
|
12305
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11698
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuTriangleAlert, { className: "w-4 h-4" }),
|
|
12306
11699
|
createError
|
|
12307
11700
|
] })
|
|
12308
11701
|
] }) }),
|
|
@@ -12337,13 +11730,13 @@ function WebhookManager() {
|
|
|
12337
11730
|
title: "Webhook Test Dispatcher",
|
|
12338
11731
|
children: [
|
|
12339
11732
|
/* @__PURE__ */ jsxRuntime.jsx(ModalContent, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-8 rounded-[2rem] bg-[var(--kyro-surface-accent)]/30 border border-[var(--kyro-border)] text-center", children: testResult ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
|
|
12340
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: `w-16 h-16 mx-auto rounded-2xl flex items-center justify-center shadow-xl ${testResult.success ? "bg-green-500/10 text-green-500" : "bg-red-500/10 text-red-500"}`, children: testResult.success ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
11733
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: `w-16 h-16 mx-auto rounded-2xl flex items-center justify-center shadow-xl ${testResult.success ? "bg-green-500/10 text-green-500" : "bg-red-500/10 text-red-500"}`, children: testResult.success ? /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuCircleCheck, { className: "w-8 h-8" }) : /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuTriangleAlert, { className: "w-8 h-8" }) }),
|
|
12341
11734
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
12342
11735
|
/* @__PURE__ */ jsxRuntime.jsx("h4", { className: "text-xl font-bold mb-2", children: testResult.success ? "Dispatch Successful" : "Dispatch Failed" }),
|
|
12343
11736
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-[var(--kyro-text-secondary)] opacity-70", children: testResult.message })
|
|
12344
11737
|
] })
|
|
12345
11738
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6 py-4", children: [
|
|
12346
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11739
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuRefreshCw, { className: "w-12 h-12 text-[var(--kyro-primary)] animate-spin mx-auto opacity-50" }),
|
|
12347
11740
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
12348
11741
|
/* @__PURE__ */ jsxRuntime.jsx("h4", { className: "text-xl font-bold mb-1", children: "Synthesizing Payload" }),
|
|
12349
11742
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-[var(--kyro-text-secondary)] opacity-50 italic", children: "Dispatching to remote endpoint..." })
|
|
@@ -12373,7 +11766,7 @@ function WebhookManager() {
|
|
|
12373
11766
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 gap-6", children: [
|
|
12374
11767
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-6 rounded-3xl bg-[var(--kyro-surface-accent)]/50 border border-[var(--kyro-border)]", children: [
|
|
12375
11768
|
/* @__PURE__ */ jsxRuntime.jsxs("h4", { className: "font-bold mb-3 flex items-center gap-2", children: [
|
|
12376
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11769
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuExternalLink, { className: "w-4 h-4 text-[var(--kyro-primary)]" }),
|
|
12377
11770
|
"Request Context"
|
|
12378
11771
|
] }),
|
|
12379
11772
|
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-sm text-[var(--kyro-text-secondary)] leading-relaxed", children: [
|
|
@@ -12384,7 +11777,7 @@ function WebhookManager() {
|
|
|
12384
11777
|
] }),
|
|
12385
11778
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-6 rounded-3xl bg-[var(--kyro-surface-accent)]/50 border border-[var(--kyro-border)]", children: [
|
|
12386
11779
|
/* @__PURE__ */ jsxRuntime.jsxs("h4", { className: "font-bold mb-3 flex items-center gap-2", children: [
|
|
12387
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11780
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuShield, { className: "w-4 h-4 text-[var(--kyro-primary)]" }),
|
|
12388
11781
|
"Security Verification"
|
|
12389
11782
|
] }),
|
|
12390
11783
|
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-sm text-[var(--kyro-text-secondary)] leading-relaxed", children: [
|
|
@@ -12601,9 +11994,8 @@ function MediaGallery({
|
|
|
12601
11994
|
{}
|
|
12602
11995
|
);
|
|
12603
11996
|
const [showNewFolderModal, setShowNewFolderModal] = React17.useState(false);
|
|
12604
|
-
const [storageConfigured, setStorageConfigured] = React17.useState(
|
|
12605
|
-
|
|
12606
|
-
);
|
|
11997
|
+
const [storageConfigured, setStorageConfigured] = React17.useState(null);
|
|
11998
|
+
const [storageChecked, setStorageChecked] = React17.useState(false);
|
|
12607
11999
|
const [showStorageConfigModal, setShowStorageConfigModal] = React17.useState(false);
|
|
12608
12000
|
const [page, setPage] = React17.useState(1);
|
|
12609
12001
|
const [total, setTotal] = React17.useState(0);
|
|
@@ -12661,6 +12053,12 @@ function MediaGallery({
|
|
|
12661
12053
|
React17.useEffect(() => {
|
|
12662
12054
|
checkStorage();
|
|
12663
12055
|
}, [checkStorage]);
|
|
12056
|
+
React17.useEffect(() => {
|
|
12057
|
+
if (storageConfigured === false && !storageChecked) {
|
|
12058
|
+
setStorageChecked(true);
|
|
12059
|
+
setShowStorageConfigModal(true);
|
|
12060
|
+
}
|
|
12061
|
+
}, [storageConfigured, storageChecked]);
|
|
12664
12062
|
React17.useEffect(() => {
|
|
12665
12063
|
loadMedia();
|
|
12666
12064
|
}, [loadMedia]);
|
|
@@ -12905,7 +12303,7 @@ function MediaGallery({
|
|
|
12905
12303
|
{
|
|
12906
12304
|
onClick: () => setView("grid"),
|
|
12907
12305
|
className: `p-2 rounded-lg transition-all ${view === "grid" ? "bg-[var(--kyro-surface)] shadow-sm text-[var(--kyro-text-primary)]" : "text-[var(--kyro-text-secondary)] opacity-50 hover:opacity-100"}`,
|
|
12908
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12306
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuGrid3X3, { className: "w-4 h-4" })
|
|
12909
12307
|
}
|
|
12910
12308
|
),
|
|
12911
12309
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -12913,7 +12311,7 @@ function MediaGallery({
|
|
|
12913
12311
|
{
|
|
12914
12312
|
onClick: () => setView("list"),
|
|
12915
12313
|
className: `p-2 rounded-lg transition-all ${view === "list" ? "bg-[var(--kyro-surface)] shadow-sm text-[var(--kyro-text-primary)]" : "text-[var(--kyro-text-secondary)] opacity-50 hover:opacity-100"}`,
|
|
12916
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12314
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuFile2, { className: "w-4 h-4" })
|
|
12917
12315
|
}
|
|
12918
12316
|
)
|
|
12919
12317
|
] }),
|
|
@@ -12923,7 +12321,7 @@ function MediaGallery({
|
|
|
12923
12321
|
onClick: () => fileInputRef.current?.click(),
|
|
12924
12322
|
className: "flex items-center gap-2 px-6 py-2.5 bg-[var(--kyro-sidebar-active)] text-[var(--kyro-sidebar-text-active)] rounded-xl font-bold text-xs shadow-lg active:scale-95 transition-all",
|
|
12925
12323
|
children: [
|
|
12926
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12324
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuMaximize2, { className: "w-4 h-4" }),
|
|
12927
12325
|
"Upload"
|
|
12928
12326
|
]
|
|
12929
12327
|
}
|
|
@@ -12967,7 +12365,7 @@ function MediaGallery({
|
|
|
12967
12365
|
{
|
|
12968
12366
|
onClick: () => setShowNewFolderModal(true),
|
|
12969
12367
|
className: "p-1.5 hover:bg-[var(--kyro-surface-accent)] rounded-lg transition-colors text-[var(--kyro-text-primary)]",
|
|
12970
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12368
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuFolderPlus, { className: "w-4 h-4" })
|
|
12971
12369
|
}
|
|
12972
12370
|
)
|
|
12973
12371
|
] }),
|
|
@@ -12978,7 +12376,7 @@ function MediaGallery({
|
|
|
12978
12376
|
onClick: () => setCurrentFolder(""),
|
|
12979
12377
|
className: `w-full flex items-center gap-3 px-4 py-2.5 rounded-xl text-xs font-bold transition-all ${currentFolder === "" ? "bg-[var(--kyro-sidebar-active)] text-[var(--kyro-sidebar-text-active)] shadow-md" : "text-[var(--kyro-text-secondary)] hover:bg-[var(--kyro-surface-accent)] hover:text-[var(--kyro-text-primary)]"}`,
|
|
12980
12378
|
children: [
|
|
12981
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12379
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuFolderInput, { className: "w-4 h-4 opacity-70" }),
|
|
12982
12380
|
"All Assets"
|
|
12983
12381
|
]
|
|
12984
12382
|
}
|
|
@@ -12990,7 +12388,7 @@ function MediaGallery({
|
|
|
12990
12388
|
onClick: () => setCurrentFolder(folder),
|
|
12991
12389
|
className: `w-full flex items-center gap-3 px-4 py-2.5 rounded-xl text-xs font-bold transition-all ${currentFolder === folder ? "bg-[var(--kyro-sidebar-active)] text-[var(--kyro-sidebar-text-active)] shadow-md" : "text-[var(--kyro-text-secondary)] hover:bg-[var(--kyro-surface-accent)] hover:text-[var(--kyro-text-primary)]"}`,
|
|
12992
12390
|
children: [
|
|
12993
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-4 h-4 flex items-center justify-center opacity-70", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12391
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-4 h-4 flex items-center justify-center opacity-70", children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuFolder, { fill: currentFolder === folder ? "currentColor" : "none" }) }),
|
|
12994
12392
|
folder
|
|
12995
12393
|
]
|
|
12996
12394
|
}
|
|
@@ -13003,7 +12401,7 @@ function MediaGallery({
|
|
|
13003
12401
|
handleDeleteFolder(folder);
|
|
13004
12402
|
},
|
|
13005
12403
|
className: "absolute right-2 top-1/2 -translate-y-1/2 p-1.5 text-red-500 opacity-0 group-hover:opacity-100 transition-all hover:bg-red-50 rounded-lg",
|
|
13006
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12404
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuTrash2, { className: "w-3.5 h-3.5" })
|
|
13007
12405
|
}
|
|
13008
12406
|
)
|
|
13009
12407
|
] }, folder))
|
|
@@ -13011,8 +12409,8 @@ function MediaGallery({
|
|
|
13011
12409
|
] })
|
|
13012
12410
|
] }) }),
|
|
13013
12411
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 flex flex-col min-h-0 bg-[var(--kyro-bg)]", children: [
|
|
13014
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 overflow-y-auto py-8 px-4 custom-scrollbar", children: loading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "
|
|
13015
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-24 h-24 rounded-[2rem] bg-[var(--kyro-surface-accent)] flex items-center justify-center mb-8 rotate-12 group-hover:rotate-0 transition-transform duration-500", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12412
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 overflow-y-auto py-8 px-4 custom-scrollbar", children: loading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5", children: /* @__PURE__ */ jsxRuntime.jsx(Shimmer, { variant: "media-card", count: 12 }) }) : items.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center py-32 text-center", children: [
|
|
12413
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-24 h-24 rounded-[2rem] bg-[var(--kyro-surface-accent)] flex items-center justify-center mb-8 rotate-12 group-hover:rotate-0 transition-transform duration-500", children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuGrid3X3, { className: "w-10 h-10 text-[var(--kyro-text-muted)] opacity-30" }) }),
|
|
13016
12414
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-xl font-bold text-[var(--kyro-text-primary)] tracking-tight", children: "No assets found" }),
|
|
13017
12415
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[var(--kyro-text-secondary)] mt-2 max-w-xs mx-auto text-sm font-medium leading-relaxed", children: "Upload your first file or create a folder to organize your media assets." }),
|
|
13018
12416
|
canUpload && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -13042,7 +12440,7 @@ function MediaGallery({
|
|
|
13042
12440
|
loading: "lazy"
|
|
13043
12441
|
}
|
|
13044
12442
|
) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full h-full flex flex-col items-center justify-center p-6 gap-4", children: [
|
|
13045
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 rounded-2xl bg-[var(--kyro-surface)] shadow-inner text-[var(--kyro-text-secondary)] group-hover:scale-110 transition-transform duration-500", children: item.type === "video" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
12443
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 rounded-2xl bg-[var(--kyro-surface)] shadow-inner text-[var(--kyro-text-secondary)] group-hover:scale-110 transition-transform duration-500", children: item.type === "video" ? /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuFilm, { className: "w-8 h-8" }) : item.type === "audio" ? /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuMusic, { className: "w-8 h-8" }) : item.type === "document" ? /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuFileText, { className: "w-8 h-8" }) : item.type === "archive" ? /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuArchive, { className: "w-8 h-8" }) : /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuFile2, { className: "w-8 h-8" }) }),
|
|
13046
12444
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] font-bold tracking-widest text-[var(--kyro-text-secondary)] opacity-50 text-center px-4 line-clamp-2", children: item.title })
|
|
13047
12445
|
] }),
|
|
13048
12446
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 bg-gradient-to-t from-black/80 via-black/20 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300 flex flex-col justify-end p-4", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
@@ -13146,7 +12544,7 @@ function MediaGallery({
|
|
|
13146
12544
|
alt: "",
|
|
13147
12545
|
className: "w-full h-full object-cover"
|
|
13148
12546
|
}
|
|
13149
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
12547
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuFile2, { className: "w-5 h-5 text-[var(--kyro-text-secondary)] opacity-50" }) }),
|
|
13150
12548
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col min-w-0", children: [
|
|
13151
12549
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-bold text-xs text-[var(--kyro-text-primary)] truncate max-w-[200px]", children: item.title || item.filename }),
|
|
13152
12550
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-[var(--kyro-text-secondary)] opacity-50 truncate", children: item.filename })
|
|
@@ -13163,7 +12561,7 @@ function MediaGallery({
|
|
|
13163
12561
|
handleSelectOne(item.id, e);
|
|
13164
12562
|
},
|
|
13165
12563
|
className: `p-2 rounded-lg transition-all ${selectedIds.has(item.id) ? "bg-[var(--kyro-primary)] text-white" : "text-[var(--kyro-text-secondary)] hover:bg-[var(--kyro-surface-accent)] opacity-0 group-hover:opacity-100"}`,
|
|
13166
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12564
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuGrid3X3, { className: "w-4 h-4" })
|
|
13167
12565
|
}
|
|
13168
12566
|
) })
|
|
13169
12567
|
]
|
|
@@ -13230,7 +12628,7 @@ function MediaGallery({
|
|
|
13230
12628
|
] }, name)) })
|
|
13231
12629
|
] }) }),
|
|
13232
12630
|
selectedIds.size > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "fixed bottom-12 left-1/2 -translate-x-1/2 z-[60] bg-[var(--kyro-surface)] border border-[var(--kyro-border)] rounded-full shadow-2xl px-2 py-2 flex items-center gap-12 animate-in slide-in-from-bottom-12 duration-700 ring-1 ring-white/10 backdrop-blur-xl", children: [
|
|
13233
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-5 border-r border-[var(--kyro-border)]
|
|
12631
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-5 border-r border-[var(--kyro-border)] ", children: [
|
|
13234
12632
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-12 h-12 rounded-full bg-[var(--kyro-sidebar-active)] text-[var(--kyro-sidebar-text-active)] flex items-center justify-center text-lg font-bold shadow-inner", children: selectedIds.size }),
|
|
13235
12633
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
13236
12634
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[11px] font-bold tracking-[0.2em] text-[var(--kyro-text-primary)]", children: "Selected" }),
|
|
@@ -13261,7 +12659,7 @@ function MediaGallery({
|
|
|
13261
12659
|
{
|
|
13262
12660
|
onClick: handleBulkDelete,
|
|
13263
12661
|
className: "p-3 bg-red-500/10 text-red-500 hover:bg-red-500 hover:text-white rounded-full transition-all active:scale-90",
|
|
13264
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12662
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuTrash2, { className: "w-5 h-5" })
|
|
13265
12663
|
}
|
|
13266
12664
|
)
|
|
13267
12665
|
] })
|
|
@@ -13290,7 +12688,7 @@ function MediaGallery({
|
|
|
13290
12688
|
className: "w-full h-full"
|
|
13291
12689
|
}
|
|
13292
12690
|
) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full h-full flex flex-col items-center justify-center p-12 gap-6", children: [
|
|
13293
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-20 h-20 rounded-[2rem] bg-[var(--kyro-surface-accent)] flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12691
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-20 h-20 rounded-[2rem] bg-[var(--kyro-surface-accent)] flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuFile2, { className: "w-10 h-10 text-[var(--kyro-text-secondary)]" }) }),
|
|
13294
12692
|
/* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "outline", className: "text-xs font-bold", children: panelItem.mimeType })
|
|
13295
12693
|
] }),
|
|
13296
12694
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-4 right-4 flex gap-2 opacity-0 group-hover:opacity-100 transition-opacity", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -13298,7 +12696,7 @@ function MediaGallery({
|
|
|
13298
12696
|
{
|
|
13299
12697
|
onClick: () => setShowPreview(true),
|
|
13300
12698
|
className: "p-2.5 bg-black/50 backdrop-blur-md text-white rounded-xl hover:bg-black/70 transition-all",
|
|
13301
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12699
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuMaximize2, { className: "w-4 h-4" })
|
|
13302
12700
|
}
|
|
13303
12701
|
) })
|
|
13304
12702
|
] }),
|
|
@@ -13336,7 +12734,7 @@ function MediaGallery({
|
|
|
13336
12734
|
alert({ title: "Copied", message: "URL copied to clipboard" });
|
|
13337
12735
|
},
|
|
13338
12736
|
className: "p-3 bg-[var(--kyro-surface-accent)] hover:bg-[var(--kyro-border)] border border-[var(--kyro-border)] rounded-xl transition-all",
|
|
13339
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12737
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuLink, { className: "w-4 h-4 text-[var(--kyro-text-primary)]" })
|
|
13340
12738
|
}
|
|
13341
12739
|
)
|
|
13342
12740
|
] })
|
|
@@ -13383,7 +12781,7 @@ function MediaGallery({
|
|
|
13383
12781
|
},
|
|
13384
12782
|
className: "flex-1 flex items-center justify-center gap-2 px-6 py-3 bg-[var(--kyro-sidebar-active)] text-[var(--kyro-sidebar-text-active)] rounded-xl font-bold text-xs shadow-lg hover:opacity-90 transition-all",
|
|
13385
12783
|
children: [
|
|
13386
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12784
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuDownload, { className: "w-4 h-4" }),
|
|
13387
12785
|
"Download"
|
|
13388
12786
|
]
|
|
13389
12787
|
}
|
|
@@ -13393,7 +12791,7 @@ function MediaGallery({
|
|
|
13393
12791
|
{
|
|
13394
12792
|
onClick: () => setShowCrop(true),
|
|
13395
12793
|
className: "p-3 border border-[var(--kyro-border)] rounded-xl text-[var(--kyro-text-primary)] hover:bg-[var(--kyro-surface-accent)] transition-all",
|
|
13396
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12794
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuCrop, { className: "w-4 h-4" })
|
|
13397
12795
|
}
|
|
13398
12796
|
),
|
|
13399
12797
|
canDelete && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -13417,7 +12815,7 @@ function MediaGallery({
|
|
|
13417
12815
|
});
|
|
13418
12816
|
},
|
|
13419
12817
|
className: "p-3 border border-red-100 text-red-500 rounded-xl hover:bg-red-50 transition-all",
|
|
13420
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12818
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuTrash2, { className: "w-4 h-4" })
|
|
13421
12819
|
}
|
|
13422
12820
|
)
|
|
13423
12821
|
] })
|
|
@@ -13440,7 +12838,7 @@ function MediaGallery({
|
|
|
13440
12838
|
{
|
|
13441
12839
|
onClick: () => setShowPreview(false),
|
|
13442
12840
|
className: "p-3 bg-white/10 hover:bg-white/20 text-white rounded-2xl transition-all active:scale-90",
|
|
13443
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12841
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuX, { className: "w-6 h-6" })
|
|
13444
12842
|
}
|
|
13445
12843
|
)
|
|
13446
12844
|
] }),
|
|
@@ -13460,7 +12858,7 @@ function MediaGallery({
|
|
|
13460
12858
|
className: "max-h-full max-w-full rounded-lg shadow-2xl"
|
|
13461
12859
|
}
|
|
13462
12860
|
) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-white text-center", children: [
|
|
13463
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12861
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuFile2, { className: "w-24 h-24 mx-auto mb-6 opacity-20" }),
|
|
13464
12862
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xl font-bold opacity-50", children: "Preview not available for this file type" })
|
|
13465
12863
|
] }) })
|
|
13466
12864
|
] }),
|
|
@@ -13655,14 +13053,14 @@ function CommandPalette({
|
|
|
13655
13053
|
label: config.label || slug,
|
|
13656
13054
|
type: "collection",
|
|
13657
13055
|
slug,
|
|
13658
|
-
icon:
|
|
13056
|
+
icon: chunk3BGDYKTD_cjs.LuFileText
|
|
13659
13057
|
}));
|
|
13660
13058
|
const globalItems = Object.entries(globals2).filter(([slug]) => permissions?.globals?.[slug]?.read !== false).map(([slug, config]) => ({
|
|
13661
13059
|
id: `global-${slug}`,
|
|
13662
13060
|
label: config.label || slug,
|
|
13663
13061
|
type: "global",
|
|
13664
13062
|
slug,
|
|
13665
|
-
icon:
|
|
13063
|
+
icon: chunk3BGDYKTD_cjs.LuSettings
|
|
13666
13064
|
}));
|
|
13667
13065
|
const isDark = typeof document !== "undefined" && document.documentElement.classList.contains("dark");
|
|
13668
13066
|
const isAdmin = user?.role === "admin";
|
|
@@ -13672,7 +13070,7 @@ function CommandPalette({
|
|
|
13672
13070
|
label: "Media Gallery",
|
|
13673
13071
|
type: "action",
|
|
13674
13072
|
view: "media",
|
|
13675
|
-
icon:
|
|
13073
|
+
icon: chunk3BGDYKTD_cjs.LuImage,
|
|
13676
13074
|
visible: permissions?.collections?.media?.read !== false
|
|
13677
13075
|
},
|
|
13678
13076
|
{
|
|
@@ -13680,7 +13078,7 @@ function CommandPalette({
|
|
|
13680
13078
|
label: "Team Management",
|
|
13681
13079
|
type: "action",
|
|
13682
13080
|
view: "users",
|
|
13683
|
-
icon:
|
|
13081
|
+
icon: chunk3BGDYKTD_cjs.LuClock,
|
|
13684
13082
|
visible: isAdmin
|
|
13685
13083
|
},
|
|
13686
13084
|
{
|
|
@@ -13688,7 +13086,7 @@ function CommandPalette({
|
|
|
13688
13086
|
label: "Audit Logs",
|
|
13689
13087
|
type: "action",
|
|
13690
13088
|
view: "audit",
|
|
13691
|
-
icon:
|
|
13089
|
+
icon: chunk3BGDYKTD_cjs.LuFile,
|
|
13692
13090
|
visible: isAdmin
|
|
13693
13091
|
},
|
|
13694
13092
|
{
|
|
@@ -13696,7 +13094,7 @@ function CommandPalette({
|
|
|
13696
13094
|
label: "Roles & Permissions",
|
|
13697
13095
|
type: "action",
|
|
13698
13096
|
view: "roles",
|
|
13699
|
-
icon:
|
|
13097
|
+
icon: chunk3BGDYKTD_cjs.LuShield,
|
|
13700
13098
|
visible: isAdmin
|
|
13701
13099
|
},
|
|
13702
13100
|
{
|
|
@@ -13704,7 +13102,7 @@ function CommandPalette({
|
|
|
13704
13102
|
label: "REST API Explorer",
|
|
13705
13103
|
type: "action",
|
|
13706
13104
|
view: "api-explorer",
|
|
13707
|
-
icon:
|
|
13105
|
+
icon: chunk3BGDYKTD_cjs.LuDatabase,
|
|
13708
13106
|
visible: isAdmin
|
|
13709
13107
|
},
|
|
13710
13108
|
{
|
|
@@ -13712,7 +13110,7 @@ function CommandPalette({
|
|
|
13712
13110
|
label: "GraphQL Playground",
|
|
13713
13111
|
type: "action",
|
|
13714
13112
|
view: "graphql",
|
|
13715
|
-
icon:
|
|
13113
|
+
icon: chunk3BGDYKTD_cjs.LuHexagon,
|
|
13716
13114
|
visible: isAdmin
|
|
13717
13115
|
},
|
|
13718
13116
|
{
|
|
@@ -13720,7 +13118,7 @@ function CommandPalette({
|
|
|
13720
13118
|
label: "REST Playground",
|
|
13721
13119
|
type: "action",
|
|
13722
13120
|
view: "rest",
|
|
13723
|
-
icon:
|
|
13121
|
+
icon: chunk3BGDYKTD_cjs.LuNetwork,
|
|
13724
13122
|
visible: isAdmin
|
|
13725
13123
|
},
|
|
13726
13124
|
{
|
|
@@ -13728,7 +13126,7 @@ function CommandPalette({
|
|
|
13728
13126
|
label: isDark ? "Switch to Light Mode" : "Switch to Dark Mode",
|
|
13729
13127
|
type: "action",
|
|
13730
13128
|
view: "theme",
|
|
13731
|
-
icon: isDark ?
|
|
13129
|
+
icon: isDark ? chunk3BGDYKTD_cjs.LuSun : chunk3BGDYKTD_cjs.LuMoon,
|
|
13732
13130
|
visible: true
|
|
13733
13131
|
},
|
|
13734
13132
|
{
|
|
@@ -13736,7 +13134,7 @@ function CommandPalette({
|
|
|
13736
13134
|
label: "Sign Out",
|
|
13737
13135
|
type: "action",
|
|
13738
13136
|
view: "logout",
|
|
13739
|
-
icon:
|
|
13137
|
+
icon: chunk3BGDYKTD_cjs.LuLogOut,
|
|
13740
13138
|
visible: true
|
|
13741
13139
|
}
|
|
13742
13140
|
].filter((a) => a.visible);
|
|
@@ -13747,7 +13145,7 @@ function CommandPalette({
|
|
|
13747
13145
|
collection: result.collection,
|
|
13748
13146
|
label2: result.label,
|
|
13749
13147
|
docId: result.id,
|
|
13750
|
-
icon:
|
|
13148
|
+
icon: chunk3BGDYKTD_cjs.LuFile,
|
|
13751
13149
|
doc: result.doc
|
|
13752
13150
|
}));
|
|
13753
13151
|
const allItems = query.length >= 2 ? [...actionItems, ...collectionItems, ...globalItems, ...docResultItems] : [...actionItems, ...collectionItems, ...globalItems];
|
|
@@ -13816,7 +13214,7 @@ function CommandPalette({
|
|
|
13816
13214
|
),
|
|
13817
13215
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative w-full max-w-2xl bg-[var(--kyro-surface)] rounded-3xl shadow-2xl overflow-hidden animate-in zoom-in-95 fade-in duration-300 ring-1 ring-white/10 border border-white/5", children: [
|
|
13818
13216
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center px-6 py-5 border-b border-[var(--kyro-border)]", children: [
|
|
13819
|
-
loading ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
13217
|
+
loading ? /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuLoaderCircle, { className: "w-5 h-5 text-[var(--kyro-text-secondary)] opacity-50 mr-4 animate-spin" }) : /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuSearch, { className: "w-5 h-5 text-[var(--kyro-text-secondary)] opacity-50 mr-4" }),
|
|
13820
13218
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13821
13219
|
"input",
|
|
13822
13220
|
{
|
|
@@ -13866,7 +13264,7 @@ function CommandPalette({
|
|
|
13866
13264
|
children: item.type
|
|
13867
13265
|
}
|
|
13868
13266
|
),
|
|
13869
|
-
index === selectedIndex && /* @__PURE__ */ jsxRuntime.jsx(
|
|
13267
|
+
index === selectedIndex && /* @__PURE__ */ jsxRuntime.jsx(chunk3BGDYKTD_cjs.LuArrowRight, { className: "w-4 h-4 mr-2" })
|
|
13870
13268
|
] })
|
|
13871
13269
|
]
|
|
13872
13270
|
},
|
|
@@ -14698,7 +14096,7 @@ function kyroAdmin(options = {}) {
|
|
|
14698
14096
|
return {
|
|
14699
14097
|
name: "@kyro-cms/admin",
|
|
14700
14098
|
hooks: {
|
|
14701
|
-
"astro:config:setup": ({ config, updateConfig, injectRoute, logger }) => {
|
|
14099
|
+
"astro:config:setup": async ({ config, updateConfig, injectRoute, logger }) => {
|
|
14702
14100
|
logger.info(`Kyro Admin mounted at ${basePath} (API: ${apiPath2})`);
|
|
14703
14101
|
const fallbackConfig = path__default.default.resolve(
|
|
14704
14102
|
new URL(".", (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('out.js', document.baseURI).href))).pathname,
|
|
@@ -14712,17 +14110,74 @@ function kyroAdmin(options = {}) {
|
|
|
14712
14110
|
} else {
|
|
14713
14111
|
logger.warn(`Config file not found. Using defaults.`);
|
|
14714
14112
|
}
|
|
14715
|
-
|
|
14716
|
-
|
|
14717
|
-
|
|
14718
|
-
|
|
14719
|
-
|
|
14720
|
-
|
|
14721
|
-
|
|
14722
|
-
|
|
14723
|
-
|
|
14113
|
+
let tmpFile = "";
|
|
14114
|
+
try {
|
|
14115
|
+
const envPath = path__default.default.join(path__default.default.dirname(resolvedConfig), ".env");
|
|
14116
|
+
if (fs__default.default.existsSync(envPath)) {
|
|
14117
|
+
dotenv.config({ path: envPath });
|
|
14118
|
+
}
|
|
14119
|
+
const configContent = fs__default.default.readFileSync(resolvedConfig, "utf8");
|
|
14120
|
+
const result = await esbuild.transform(configContent, {
|
|
14121
|
+
loader: "ts",
|
|
14122
|
+
format: "esm",
|
|
14123
|
+
target: "es2022",
|
|
14124
|
+
sourcemap: false
|
|
14724
14125
|
});
|
|
14126
|
+
tmpFile = resolvedConfig.replace(/\.ts$/, ".admin.mjs");
|
|
14127
|
+
fs__default.default.writeFileSync(tmpFile, result.code, "utf8");
|
|
14128
|
+
const entryFile = tmpFile.replace(/\.admin\.mjs$/, ".admin-entry.mjs");
|
|
14129
|
+
const resultFile = tmpFile.replace(/\.admin\.mjs$/, ".admin-result.json");
|
|
14130
|
+
fs__default.default.writeFileSync(entryFile, `
|
|
14131
|
+
import cfg from './${path__default.default.basename(tmpFile)}';
|
|
14132
|
+
import fs from 'fs';
|
|
14133
|
+
const data = { collections: cfg.default?.collections || cfg?.collections || [], globals: cfg.default?.globals || cfg?.globals || [] };
|
|
14134
|
+
fs.writeFileSync('${path__default.default.basename(resultFile)}', JSON.stringify(data));
|
|
14135
|
+
`, "utf8");
|
|
14136
|
+
child_process.execSync(
|
|
14137
|
+
`npx tsx "${entryFile}"`,
|
|
14138
|
+
{ cwd: path__default.default.dirname(resolvedConfig), encoding: "utf8", timeout: 15e3, stdio: "pipe" }
|
|
14139
|
+
);
|
|
14140
|
+
const resultContent = fs__default.default.readFileSync(resultFile, "utf8");
|
|
14141
|
+
const configModule = JSON.parse(resultContent);
|
|
14142
|
+
try {
|
|
14143
|
+
fs__default.default.unlinkSync(resultFile);
|
|
14144
|
+
} catch {
|
|
14145
|
+
}
|
|
14146
|
+
if (configModule.error) {
|
|
14147
|
+
throw new Error(configModule.error);
|
|
14148
|
+
}
|
|
14149
|
+
globalThis.__KYRO_ADMIN_PROJECT_CONFIG__ = {
|
|
14150
|
+
collections: configModule.collections,
|
|
14151
|
+
globals: configModule.globals,
|
|
14152
|
+
adapter: configModule.adapter || null
|
|
14153
|
+
};
|
|
14154
|
+
logger.info("Project config loaded for admin");
|
|
14155
|
+
} catch (e) {
|
|
14156
|
+
logger.warn(`Could not load project config: ${e.message}`);
|
|
14157
|
+
} finally {
|
|
14158
|
+
for (const suffix of [".admin.mjs", ".admin-entry.mjs", ".admin-result.json"]) {
|
|
14159
|
+
const f = resolvedConfig.replace(/\.ts$/, suffix);
|
|
14160
|
+
if (fs__default.default.existsSync(f)) {
|
|
14161
|
+
try {
|
|
14162
|
+
fs__default.default.unlinkSync(f);
|
|
14163
|
+
} catch {
|
|
14164
|
+
}
|
|
14165
|
+
}
|
|
14166
|
+
}
|
|
14725
14167
|
}
|
|
14168
|
+
updateConfig({
|
|
14169
|
+
vite: {
|
|
14170
|
+
resolve: {
|
|
14171
|
+
alias: {
|
|
14172
|
+
"kyro:config": resolvedConfig
|
|
14173
|
+
}
|
|
14174
|
+
},
|
|
14175
|
+
define: {
|
|
14176
|
+
__KYRO_ADMIN_PATH__: JSON.stringify(basePath),
|
|
14177
|
+
__KYRO_API_PATH__: JSON.stringify(apiPath2)
|
|
14178
|
+
}
|
|
14179
|
+
}
|
|
14180
|
+
});
|
|
14726
14181
|
const pages = [
|
|
14727
14182
|
{ pattern: "", entrypoint: "./pages/index.astro" },
|
|
14728
14183
|
{ pattern: "/login", entrypoint: "./pages/auth/login.astro" },
|
|
@@ -14770,19 +14225,6 @@ function kyroAdmin(options = {}) {
|
|
|
14770
14225
|
)
|
|
14771
14226
|
});
|
|
14772
14227
|
}
|
|
14773
|
-
updateConfig({
|
|
14774
|
-
vite: {
|
|
14775
|
-
resolve: {
|
|
14776
|
-
alias: {
|
|
14777
|
-
"kyro:config": resolvedConfig
|
|
14778
|
-
}
|
|
14779
|
-
},
|
|
14780
|
-
define: {
|
|
14781
|
-
__KYRO_ADMIN_PATH__: JSON.stringify(basePath),
|
|
14782
|
-
__KYRO_API_PATH__: JSON.stringify(apiPath2)
|
|
14783
|
-
}
|
|
14784
|
-
}
|
|
14785
|
-
});
|
|
14786
14228
|
},
|
|
14787
14229
|
"astro:build:done": ({ logger }) => {
|
|
14788
14230
|
logger.info("Kyro Admin build complete");
|