litecms 0.2.2 → 0.2.3
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/README.md +25 -0
- package/dist/admin/exports.js +467 -467
- package/dist/components/index.js +55 -55
- package/dist/index-xscpb89q.js +4422 -0
- package/dist/index.js +1 -1
- package/package.json +2 -2
package/dist/admin/exports.js
CHANGED
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
useCmsLanguage,
|
|
19
19
|
useCmsLanguageOptional,
|
|
20
20
|
useForm
|
|
21
|
-
} from "../index-
|
|
21
|
+
} from "../index-xscpb89q.js";
|
|
22
22
|
import"../index-wmd953zf.js";
|
|
23
23
|
import {
|
|
24
24
|
createCmsConfig,
|
|
@@ -34,33 +34,33 @@ import * as React from "react";
|
|
|
34
34
|
import { usePathname } from "next/navigation";
|
|
35
35
|
|
|
36
36
|
// src/components/CmsNavSection.tsx
|
|
37
|
-
import {
|
|
37
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
38
38
|
function NavSection({
|
|
39
39
|
group,
|
|
40
40
|
basePath,
|
|
41
41
|
currentSlug
|
|
42
42
|
}) {
|
|
43
|
-
return /* @__PURE__ */
|
|
43
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
44
44
|
children: [
|
|
45
|
-
/* @__PURE__ */
|
|
45
|
+
/* @__PURE__ */ jsx("div", {
|
|
46
46
|
className: "text-[10px] font-medium uppercase tracking-widest text-neutral-400 mb-4",
|
|
47
47
|
children: group.name ?? "Pages"
|
|
48
|
-
}
|
|
49
|
-
/* @__PURE__ */
|
|
48
|
+
}),
|
|
49
|
+
/* @__PURE__ */ jsx("div", {
|
|
50
50
|
className: "space-y-1",
|
|
51
|
-
children: group.pages.map((page) => /* @__PURE__ */
|
|
51
|
+
children: group.pages.map((page) => /* @__PURE__ */ jsx("a", {
|
|
52
52
|
href: `${basePath}/${page.slug}`,
|
|
53
53
|
className: `block py-1.5 text-sm transition-colors ${currentSlug === page.slug ? "text-neutral-900" : "text-neutral-400 hover:text-neutral-900"}`,
|
|
54
54
|
"aria-current": currentSlug === page.slug ? "page" : undefined,
|
|
55
55
|
children: page.title
|
|
56
|
-
}, page.slug
|
|
57
|
-
}
|
|
56
|
+
}, page.slug))
|
|
57
|
+
})
|
|
58
58
|
]
|
|
59
|
-
}
|
|
59
|
+
});
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
// src/admin/CmsAdminLayout.tsx
|
|
63
|
-
import {
|
|
63
|
+
import { jsx as jsx2, jsxs as jsxs2, Fragment } from "react/jsx-runtime";
|
|
64
64
|
function CmsAdminLayoutInner({
|
|
65
65
|
adminTitle = "Content",
|
|
66
66
|
siteName,
|
|
@@ -108,137 +108,137 @@ function CmsAdminLayoutInner({
|
|
|
108
108
|
};
|
|
109
109
|
return fallback[key] ?? key;
|
|
110
110
|
});
|
|
111
|
-
return /* @__PURE__ */
|
|
111
|
+
return /* @__PURE__ */ jsxs2("div", {
|
|
112
112
|
className: "min-h-screen font-sans antialiased bg-neutral-50 text-neutral-900 selection:bg-neutral-200 selection:text-neutral-900 [--cms-accent:#171717] [--cms-accent-subtle:rgba(23,23,23,0.08)]",
|
|
113
113
|
children: [
|
|
114
|
-
/* @__PURE__ */
|
|
114
|
+
/* @__PURE__ */ jsxs2("aside", {
|
|
115
115
|
className: "fixed inset-y-0 left-0 z-50 hidden w-56 flex-col border-r border-neutral-200 bg-white md:flex",
|
|
116
116
|
children: [
|
|
117
|
-
/* @__PURE__ */
|
|
117
|
+
/* @__PURE__ */ jsx2("div", {
|
|
118
118
|
className: "flex h-16 items-center px-6 border-b border-neutral-200",
|
|
119
|
-
children: /* @__PURE__ */
|
|
119
|
+
children: /* @__PURE__ */ jsx2("a", {
|
|
120
120
|
href: basePath,
|
|
121
121
|
className: "text-xs tracking-widest uppercase text-neutral-900 hover:text-neutral-600 transition-colors",
|
|
122
122
|
children: adminTitle
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
/* @__PURE__ */
|
|
123
|
+
})
|
|
124
|
+
}),
|
|
125
|
+
/* @__PURE__ */ jsxs2("nav", {
|
|
126
126
|
className: "flex-1 overflow-y-auto px-6 py-8 space-y-8",
|
|
127
127
|
children: [
|
|
128
|
-
modules && modules.length > 0 && /* @__PURE__ */
|
|
128
|
+
modules && modules.length > 0 && /* @__PURE__ */ jsx2("div", {
|
|
129
129
|
className: "space-y-2",
|
|
130
130
|
children: modules.map((module) => {
|
|
131
131
|
const isActive = currentModuleId === module.id;
|
|
132
|
-
return /* @__PURE__ */
|
|
132
|
+
return /* @__PURE__ */ jsxs2("a", {
|
|
133
133
|
href: module.href,
|
|
134
134
|
className: `flex items-center gap-3 py-2 text-sm transition-colors ${isActive ? "text-neutral-900 font-medium" : "text-neutral-500 hover:text-neutral-900"}`,
|
|
135
135
|
children: [
|
|
136
|
-
module.icon && /* @__PURE__ */
|
|
136
|
+
module.icon && /* @__PURE__ */ jsx2("span", {
|
|
137
137
|
className: isActive ? "text-neutral-900" : "text-neutral-400",
|
|
138
138
|
children: module.icon
|
|
139
|
-
}
|
|
139
|
+
}),
|
|
140
140
|
module.title
|
|
141
141
|
]
|
|
142
|
-
}, module.id
|
|
142
|
+
}, module.id);
|
|
143
143
|
})
|
|
144
|
-
}
|
|
145
|
-
(!modules || modules.length === 0) && groupedPages.length > 0 && /* @__PURE__ */
|
|
146
|
-
children: groupedPages.map((group) => /* @__PURE__ */
|
|
144
|
+
}),
|
|
145
|
+
(!modules || modules.length === 0) && groupedPages.length > 0 && /* @__PURE__ */ jsx2(Fragment, {
|
|
146
|
+
children: groupedPages.map((group) => /* @__PURE__ */ jsx2(NavSection, {
|
|
147
147
|
group,
|
|
148
148
|
basePath,
|
|
149
149
|
currentSlug
|
|
150
|
-
}, group.name ?? "__default"
|
|
151
|
-
}
|
|
152
|
-
modules && modules.length > 0 && currentModuleId === "content" && groupedPages.length > 0 && /* @__PURE__ */
|
|
150
|
+
}, group.name ?? "__default"))
|
|
151
|
+
}),
|
|
152
|
+
modules && modules.length > 0 && currentModuleId === "content" && groupedPages.length > 0 && /* @__PURE__ */ jsx2("div", {
|
|
153
153
|
className: "pt-4 border-t border-neutral-100",
|
|
154
|
-
children: groupedPages.map((group) => /* @__PURE__ */
|
|
154
|
+
children: groupedPages.map((group) => /* @__PURE__ */ jsx2(NavSection, {
|
|
155
155
|
group,
|
|
156
156
|
basePath,
|
|
157
157
|
currentSlug
|
|
158
|
-
}, group.name ?? "__default"
|
|
159
|
-
}
|
|
158
|
+
}, group.name ?? "__default"))
|
|
159
|
+
})
|
|
160
160
|
]
|
|
161
|
-
}
|
|
162
|
-
/* @__PURE__ */
|
|
161
|
+
}),
|
|
162
|
+
/* @__PURE__ */ jsxs2("div", {
|
|
163
163
|
className: "border-t border-neutral-200 px-6 py-4 space-y-3",
|
|
164
164
|
children: [
|
|
165
|
-
langContext && /* @__PURE__ */
|
|
166
|
-
publicSiteUrl && /* @__PURE__ */
|
|
165
|
+
langContext && /* @__PURE__ */ jsx2(CmsLanguageSelector, {}),
|
|
166
|
+
publicSiteUrl && /* @__PURE__ */ jsxs2("a", {
|
|
167
167
|
href: publicSiteUrl,
|
|
168
168
|
className: "flex items-center gap-2 text-xs tracking-wide text-neutral-400 hover:text-neutral-900 transition-colors",
|
|
169
169
|
target: "_blank",
|
|
170
170
|
rel: "noopener noreferrer",
|
|
171
171
|
children: [
|
|
172
|
-
/* @__PURE__ */
|
|
172
|
+
/* @__PURE__ */ jsx2("span", {
|
|
173
173
|
children: t("viewSite")
|
|
174
|
-
}
|
|
175
|
-
/* @__PURE__ */
|
|
174
|
+
}),
|
|
175
|
+
/* @__PURE__ */ jsx2("svg", {
|
|
176
176
|
className: "h-3 w-3",
|
|
177
177
|
viewBox: "0 0 24 24",
|
|
178
178
|
fill: "none",
|
|
179
179
|
stroke: "currentColor",
|
|
180
180
|
strokeWidth: "1.5",
|
|
181
|
-
children: /* @__PURE__ */
|
|
181
|
+
children: /* @__PURE__ */ jsx2("path", {
|
|
182
182
|
strokeLinecap: "round",
|
|
183
183
|
strokeLinejoin: "round",
|
|
184
184
|
d: "M4.5 19.5l15-15m0 0H8.25m11.25 0v11.25"
|
|
185
|
-
}
|
|
186
|
-
}
|
|
185
|
+
})
|
|
186
|
+
})
|
|
187
187
|
]
|
|
188
|
-
}
|
|
189
|
-
onLogout && /* @__PURE__ */
|
|
188
|
+
}),
|
|
189
|
+
onLogout && /* @__PURE__ */ jsx2("button", {
|
|
190
190
|
onClick: onLogout,
|
|
191
191
|
className: "text-xs tracking-wide text-neutral-400 hover:text-neutral-900 transition-colors cursor-pointer",
|
|
192
192
|
children: t("signOut")
|
|
193
|
-
}
|
|
193
|
+
})
|
|
194
194
|
]
|
|
195
|
-
}
|
|
195
|
+
})
|
|
196
196
|
]
|
|
197
|
-
}
|
|
198
|
-
/* @__PURE__ */
|
|
197
|
+
}),
|
|
198
|
+
/* @__PURE__ */ jsx2("header", {
|
|
199
199
|
className: "sticky top-0 z-40 flex h-14 items-center gap-4 px-4 bg-white border-b border-neutral-200 md:hidden",
|
|
200
|
-
children: /* @__PURE__ */
|
|
200
|
+
children: /* @__PURE__ */ jsx2("a", {
|
|
201
201
|
href: basePath,
|
|
202
202
|
className: "text-xs tracking-widest uppercase text-neutral-900",
|
|
203
203
|
children: adminTitle
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
/* @__PURE__ */
|
|
204
|
+
})
|
|
205
|
+
}),
|
|
206
|
+
/* @__PURE__ */ jsx2("nav", {
|
|
207
207
|
className: "flex gap-4 overflow-x-auto px-4 py-3 bg-white border-b border-neutral-200 md:hidden",
|
|
208
|
-
children: modules && modules.length > 0 ? modules.map((module) => /* @__PURE__ */
|
|
208
|
+
children: modules && modules.length > 0 ? modules.map((module) => /* @__PURE__ */ jsx2("a", {
|
|
209
209
|
href: module.href,
|
|
210
210
|
className: `shrink-0 text-sm transition-colors ${currentModuleId === module.id ? "text-neutral-900 border-b border-neutral-900 pb-1" : "text-neutral-400 hover:text-neutral-900"}`,
|
|
211
211
|
children: module.title
|
|
212
|
-
}, module.id
|
|
212
|
+
}, module.id)) : pages.map((page) => /* @__PURE__ */ jsx2("a", {
|
|
213
213
|
href: `${basePath}/${page.slug}`,
|
|
214
214
|
className: `shrink-0 text-sm transition-colors ${currentSlug === page.slug ? "text-neutral-900 border-b border-neutral-900 pb-1" : "text-neutral-400 hover:text-neutral-900"}`,
|
|
215
215
|
children: page.title
|
|
216
|
-
}, page.slug
|
|
217
|
-
}
|
|
218
|
-
/* @__PURE__ */
|
|
216
|
+
}, page.slug))
|
|
217
|
+
}),
|
|
218
|
+
/* @__PURE__ */ jsx2("main", {
|
|
219
219
|
className: "md:ml-56 min-h-screen bg-white",
|
|
220
|
-
children: /* @__PURE__ */
|
|
220
|
+
children: /* @__PURE__ */ jsx2("div", {
|
|
221
221
|
className: "mx-auto h-full",
|
|
222
222
|
children
|
|
223
|
-
}
|
|
224
|
-
}
|
|
223
|
+
})
|
|
224
|
+
})
|
|
225
225
|
]
|
|
226
|
-
}
|
|
226
|
+
});
|
|
227
227
|
}
|
|
228
228
|
function CmsAdminLayout({
|
|
229
229
|
languageEndpoint,
|
|
230
230
|
...props
|
|
231
231
|
}) {
|
|
232
|
-
return /* @__PURE__ */
|
|
232
|
+
return /* @__PURE__ */ jsx2(CmsLanguageProvider, {
|
|
233
233
|
languageEndpoint,
|
|
234
|
-
children: /* @__PURE__ */
|
|
234
|
+
children: /* @__PURE__ */ jsx2(CmsAdminLayoutInner, {
|
|
235
235
|
...props
|
|
236
|
-
}
|
|
237
|
-
}
|
|
236
|
+
})
|
|
237
|
+
});
|
|
238
238
|
}
|
|
239
239
|
// src/components/CmsSimpleForm.tsx
|
|
240
240
|
import * as React2 from "react";
|
|
241
|
-
import {
|
|
241
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
242
242
|
function CmsSimpleForm({
|
|
243
243
|
fields,
|
|
244
244
|
action,
|
|
@@ -334,73 +334,73 @@ function CmsSimpleForm({
|
|
|
334
334
|
}
|
|
335
335
|
};
|
|
336
336
|
const groupedFields = groupFields(fields);
|
|
337
|
-
return /* @__PURE__ */
|
|
337
|
+
return /* @__PURE__ */ jsx3(FormProvider, {
|
|
338
338
|
...form,
|
|
339
|
-
children: /* @__PURE__ */
|
|
339
|
+
children: /* @__PURE__ */ jsxs3("form", {
|
|
340
340
|
onSubmit: handleSubmit,
|
|
341
341
|
children: [
|
|
342
|
-
hiddenFieldEntries.map(([name, value]) => /* @__PURE__ */
|
|
342
|
+
hiddenFieldEntries.map(([name, value]) => /* @__PURE__ */ jsx3("input", {
|
|
343
343
|
type: "hidden",
|
|
344
344
|
name,
|
|
345
345
|
value
|
|
346
|
-
}, name
|
|
347
|
-
/* @__PURE__ */
|
|
346
|
+
}, name)),
|
|
347
|
+
/* @__PURE__ */ jsxs3("div", {
|
|
348
348
|
className: styles.wrapper ?? "",
|
|
349
349
|
children: [
|
|
350
|
-
/* @__PURE__ */
|
|
350
|
+
/* @__PURE__ */ jsx3("div", {
|
|
351
351
|
className: "space-y-16",
|
|
352
|
-
children: groupedFields.map((group, groupIndex) => /* @__PURE__ */
|
|
352
|
+
children: groupedFields.map((group, groupIndex) => /* @__PURE__ */ jsx3(FieldGroup, {
|
|
353
353
|
group,
|
|
354
354
|
styles,
|
|
355
355
|
storage
|
|
356
|
-
}, group.name ?? `__ungrouped-${groupIndex}
|
|
357
|
-
}
|
|
358
|
-
state.errors?.formError && /* @__PURE__ */
|
|
356
|
+
}, group.name ?? `__ungrouped-${groupIndex}`))
|
|
357
|
+
}),
|
|
358
|
+
state.errors?.formError && /* @__PURE__ */ jsx3("div", {
|
|
359
359
|
className: "mt-12 py-4 px-5 border border-red-200 bg-red-50 text-red-900 text-sm",
|
|
360
360
|
children: state.errors.formError
|
|
361
|
-
}
|
|
362
|
-
showSuccess && /* @__PURE__ */
|
|
361
|
+
}),
|
|
362
|
+
showSuccess && /* @__PURE__ */ jsx3("div", {
|
|
363
363
|
className: "mt-12 py-4 px-5 border border-green-200 bg-green-50 text-green-900 text-sm",
|
|
364
364
|
children: resolvedSuccessMessage
|
|
365
|
-
}
|
|
366
|
-
/* @__PURE__ */
|
|
365
|
+
}),
|
|
366
|
+
/* @__PURE__ */ jsxs3("div", {
|
|
367
367
|
className: "mt-16 pt-8 border-t border-neutral-200 flex items-center justify-between",
|
|
368
368
|
children: [
|
|
369
|
-
/* @__PURE__ */
|
|
369
|
+
/* @__PURE__ */ jsx3("button", {
|
|
370
370
|
type: "button",
|
|
371
371
|
className: "text-sm text-neutral-400 hover:text-neutral-900 transition-colors cursor-pointer",
|
|
372
372
|
onClick: () => form.reset(),
|
|
373
373
|
disabled: isPending,
|
|
374
374
|
children: t("reset")
|
|
375
|
-
}
|
|
376
|
-
/* @__PURE__ */
|
|
375
|
+
}),
|
|
376
|
+
/* @__PURE__ */ jsxs3("button", {
|
|
377
377
|
type: "submit",
|
|
378
378
|
disabled: isPending,
|
|
379
379
|
className: styles.submitButton ?? "inline-flex items-center gap-2 text-sm tracking-wide text-neutral-900 border-b border-neutral-900 pb-1 hover:pb-1.5 transition-all disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer",
|
|
380
380
|
children: [
|
|
381
|
-
isPending && /* @__PURE__ */
|
|
381
|
+
isPending && /* @__PURE__ */ jsx3("svg", {
|
|
382
382
|
className: "h-3.5 w-3.5 animate-spin",
|
|
383
383
|
viewBox: "0 0 24 24",
|
|
384
384
|
fill: "none",
|
|
385
385
|
stroke: "currentColor",
|
|
386
386
|
strokeWidth: "2",
|
|
387
|
-
children: /* @__PURE__ */
|
|
387
|
+
children: /* @__PURE__ */ jsx3("path", {
|
|
388
388
|
d: "M21 12a9 9 0 1 1-6.219-8.56"
|
|
389
|
-
}
|
|
390
|
-
}
|
|
389
|
+
})
|
|
390
|
+
}),
|
|
391
391
|
isPending ? resolvedSubmitPendingText : resolvedSubmitText,
|
|
392
|
-
!isPending && /* @__PURE__ */
|
|
392
|
+
!isPending && /* @__PURE__ */ jsx3("span", {
|
|
393
393
|
children: "→"
|
|
394
|
-
}
|
|
394
|
+
})
|
|
395
395
|
]
|
|
396
|
-
}
|
|
396
|
+
})
|
|
397
397
|
]
|
|
398
|
-
}
|
|
398
|
+
})
|
|
399
399
|
]
|
|
400
|
-
}
|
|
400
|
+
})
|
|
401
401
|
]
|
|
402
|
-
}
|
|
403
|
-
}
|
|
402
|
+
})
|
|
403
|
+
});
|
|
404
404
|
}
|
|
405
405
|
function FieldGroup({
|
|
406
406
|
group,
|
|
@@ -408,32 +408,32 @@ function FieldGroup({
|
|
|
408
408
|
storage
|
|
409
409
|
}) {
|
|
410
410
|
if (group.name) {
|
|
411
|
-
return /* @__PURE__ */
|
|
411
|
+
return /* @__PURE__ */ jsxs3("fieldset", {
|
|
412
412
|
className: "space-y-8",
|
|
413
413
|
children: [
|
|
414
|
-
/* @__PURE__ */
|
|
414
|
+
/* @__PURE__ */ jsx3("legend", {
|
|
415
415
|
className: "text-xs font-medium uppercase tracking-widest text-neutral-400 pb-4 border-b border-neutral-200 w-full",
|
|
416
416
|
children: group.name
|
|
417
|
-
}
|
|
418
|
-
/* @__PURE__ */
|
|
417
|
+
}),
|
|
418
|
+
/* @__PURE__ */ jsx3("div", {
|
|
419
419
|
className: "grid grid-cols-1 md:grid-cols-2 gap-8",
|
|
420
|
-
children: group.fields.map((field) => /* @__PURE__ */
|
|
420
|
+
children: group.fields.map((field) => /* @__PURE__ */ jsx3(AutoField, {
|
|
421
421
|
field,
|
|
422
422
|
styles,
|
|
423
423
|
storage
|
|
424
|
-
}, field.name
|
|
425
|
-
}
|
|
424
|
+
}, field.name))
|
|
425
|
+
})
|
|
426
426
|
]
|
|
427
|
-
}
|
|
427
|
+
});
|
|
428
428
|
}
|
|
429
|
-
return /* @__PURE__ */
|
|
429
|
+
return /* @__PURE__ */ jsx3("div", {
|
|
430
430
|
className: "grid grid-cols-1 md:grid-cols-2 gap-8",
|
|
431
|
-
children: group.fields.map((field) => /* @__PURE__ */
|
|
431
|
+
children: group.fields.map((field) => /* @__PURE__ */ jsx3(AutoField, {
|
|
432
432
|
field,
|
|
433
433
|
styles,
|
|
434
434
|
storage
|
|
435
|
-
}, field.name
|
|
436
|
-
}
|
|
435
|
+
}, field.name))
|
|
436
|
+
});
|
|
437
437
|
}
|
|
438
438
|
function AutoField({
|
|
439
439
|
field,
|
|
@@ -444,9 +444,9 @@ function AutoField({
|
|
|
444
444
|
const isFullWidth = meta.type === "textarea" || meta.type === "image";
|
|
445
445
|
const colSpan = isFullWidth ? "col-span-1 md:col-span-2" : "col-span-1";
|
|
446
446
|
if (meta.type === "checkbox") {
|
|
447
|
-
return /* @__PURE__ */
|
|
447
|
+
return /* @__PURE__ */ jsx3("div", {
|
|
448
448
|
className: colSpan,
|
|
449
|
-
children: /* @__PURE__ */
|
|
449
|
+
children: /* @__PURE__ */ jsx3(CmsCheckbox, {
|
|
450
450
|
name,
|
|
451
451
|
label: meta.label,
|
|
452
452
|
helpText: meta.helpText,
|
|
@@ -455,13 +455,13 @@ function AutoField({
|
|
|
455
455
|
inputClassName: styles.input,
|
|
456
456
|
errorClassName: styles.error,
|
|
457
457
|
helpClassName: styles.help
|
|
458
|
-
}
|
|
459
|
-
}
|
|
458
|
+
})
|
|
459
|
+
});
|
|
460
460
|
}
|
|
461
461
|
if (meta.type === "image") {
|
|
462
|
-
return /* @__PURE__ */
|
|
462
|
+
return /* @__PURE__ */ jsx3("div", {
|
|
463
463
|
className: colSpan,
|
|
464
|
-
children: /* @__PURE__ */
|
|
464
|
+
children: /* @__PURE__ */ jsx3(CmsImageField, {
|
|
465
465
|
name,
|
|
466
466
|
label: meta.label,
|
|
467
467
|
helpText: meta.helpText,
|
|
@@ -472,12 +472,12 @@ function AutoField({
|
|
|
472
472
|
errorClassName: styles.error,
|
|
473
473
|
helpClassName: styles.help,
|
|
474
474
|
storage
|
|
475
|
-
}
|
|
476
|
-
}
|
|
475
|
+
})
|
|
476
|
+
});
|
|
477
477
|
}
|
|
478
|
-
return /* @__PURE__ */
|
|
478
|
+
return /* @__PURE__ */ jsx3("div", {
|
|
479
479
|
className: colSpan,
|
|
480
|
-
children: /* @__PURE__ */
|
|
480
|
+
children: /* @__PURE__ */ jsx3(CmsField, {
|
|
481
481
|
name,
|
|
482
482
|
label: meta.label,
|
|
483
483
|
type: meta.type ?? "text",
|
|
@@ -491,12 +491,12 @@ function AutoField({
|
|
|
491
491
|
inputClassName: styles.input,
|
|
492
492
|
errorClassName: styles.error,
|
|
493
493
|
helpClassName: styles.help
|
|
494
|
-
}
|
|
495
|
-
}
|
|
494
|
+
})
|
|
495
|
+
});
|
|
496
496
|
}
|
|
497
497
|
|
|
498
498
|
// src/admin/CmsAdminPage.tsx
|
|
499
|
-
import {
|
|
499
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
500
500
|
function CmsAdminPage({
|
|
501
501
|
title,
|
|
502
502
|
description,
|
|
@@ -508,25 +508,25 @@ function CmsAdminPage({
|
|
|
508
508
|
submitText,
|
|
509
509
|
storage
|
|
510
510
|
}) {
|
|
511
|
-
return /* @__PURE__ */
|
|
511
|
+
return /* @__PURE__ */ jsxs4("div", {
|
|
512
512
|
className: "space-y-12",
|
|
513
513
|
children: [
|
|
514
|
-
/* @__PURE__ */
|
|
514
|
+
/* @__PURE__ */ jsxs4("header", {
|
|
515
515
|
className: "border-b border-neutral-200 h-16 px-8 flex items-center justify-between",
|
|
516
516
|
children: [
|
|
517
|
-
/* @__PURE__ */
|
|
517
|
+
/* @__PURE__ */ jsx4("h1", {
|
|
518
518
|
className: "text-2xl font-light tracking-tight text-neutral-900",
|
|
519
519
|
children: title
|
|
520
|
-
}
|
|
521
|
-
description && /* @__PURE__ */
|
|
520
|
+
}),
|
|
521
|
+
description && /* @__PURE__ */ jsx4("p", {
|
|
522
522
|
className: "mt-3 text-sm text-neutral-500 max-w-xl leading-relaxed",
|
|
523
523
|
children: description
|
|
524
|
-
}
|
|
524
|
+
})
|
|
525
525
|
]
|
|
526
|
-
}
|
|
527
|
-
/* @__PURE__ */
|
|
526
|
+
}),
|
|
527
|
+
/* @__PURE__ */ jsx4("div", {
|
|
528
528
|
className: "px-8 pb-12",
|
|
529
|
-
children: /* @__PURE__ */
|
|
529
|
+
children: /* @__PURE__ */ jsx4(CmsSimpleForm, {
|
|
530
530
|
fields,
|
|
531
531
|
action,
|
|
532
532
|
values,
|
|
@@ -534,92 +534,92 @@ function CmsAdminPage({
|
|
|
534
534
|
successMessage,
|
|
535
535
|
submitText,
|
|
536
536
|
storage
|
|
537
|
-
}
|
|
538
|
-
}
|
|
537
|
+
})
|
|
538
|
+
})
|
|
539
539
|
]
|
|
540
|
-
}
|
|
540
|
+
});
|
|
541
541
|
}
|
|
542
542
|
// src/admin/CmsAdminLanding.tsx
|
|
543
|
-
import {
|
|
543
|
+
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
544
544
|
function EmptyState({ t }) {
|
|
545
|
-
return /* @__PURE__ */
|
|
545
|
+
return /* @__PURE__ */ jsxs5("div", {
|
|
546
546
|
className: "py-16 px-8 text-center flex flex-col items-center",
|
|
547
547
|
children: [
|
|
548
|
-
/* @__PURE__ */
|
|
548
|
+
/* @__PURE__ */ jsx5("div", {
|
|
549
549
|
className: "w-12 h-12 rounded-lg flex items-center justify-center mb-4 bg-neutral-100",
|
|
550
|
-
children: /* @__PURE__ */
|
|
550
|
+
children: /* @__PURE__ */ jsx5("svg", {
|
|
551
551
|
className: "w-6 h-6 text-neutral-400",
|
|
552
552
|
viewBox: "0 0 24 24",
|
|
553
553
|
fill: "none",
|
|
554
554
|
stroke: "currentColor",
|
|
555
555
|
strokeWidth: "1.5",
|
|
556
|
-
children: /* @__PURE__ */
|
|
556
|
+
children: /* @__PURE__ */ jsx5("path", {
|
|
557
557
|
strokeLinecap: "round",
|
|
558
558
|
strokeLinejoin: "round",
|
|
559
559
|
d: "M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"
|
|
560
|
-
}
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
|
-
/* @__PURE__ */
|
|
560
|
+
})
|
|
561
|
+
})
|
|
562
|
+
}),
|
|
563
|
+
/* @__PURE__ */ jsx5("h2", {
|
|
564
564
|
className: "text-base font-medium mb-1 text-neutral-900",
|
|
565
565
|
children: t("cmsNotConfigured")
|
|
566
|
-
}
|
|
567
|
-
/* @__PURE__ */
|
|
566
|
+
}),
|
|
567
|
+
/* @__PURE__ */ jsx5("p", {
|
|
568
568
|
className: "text-sm max-w-sm leading-relaxed text-neutral-500",
|
|
569
569
|
children: t("cmsNotConfiguredDesc")
|
|
570
|
-
}
|
|
570
|
+
})
|
|
571
571
|
]
|
|
572
|
-
}
|
|
572
|
+
});
|
|
573
573
|
}
|
|
574
574
|
var CmsModuleIcons = {
|
|
575
|
-
pages: /* @__PURE__ */
|
|
575
|
+
pages: /* @__PURE__ */ jsx5("svg", {
|
|
576
576
|
className: "w-5 h-5",
|
|
577
577
|
viewBox: "0 0 24 24",
|
|
578
578
|
fill: "none",
|
|
579
579
|
stroke: "currentColor",
|
|
580
580
|
strokeWidth: "1.5",
|
|
581
|
-
children: /* @__PURE__ */
|
|
581
|
+
children: /* @__PURE__ */ jsx5("path", {
|
|
582
582
|
strokeLinecap: "round",
|
|
583
583
|
strokeLinejoin: "round",
|
|
584
584
|
d: "M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"
|
|
585
|
-
}
|
|
586
|
-
}
|
|
587
|
-
blog: /* @__PURE__ */
|
|
585
|
+
})
|
|
586
|
+
}),
|
|
587
|
+
blog: /* @__PURE__ */ jsx5("svg", {
|
|
588
588
|
className: "w-5 h-5",
|
|
589
589
|
viewBox: "0 0 24 24",
|
|
590
590
|
fill: "none",
|
|
591
591
|
stroke: "currentColor",
|
|
592
592
|
strokeWidth: "1.5",
|
|
593
|
-
children: /* @__PURE__ */
|
|
593
|
+
children: /* @__PURE__ */ jsx5("path", {
|
|
594
594
|
strokeLinecap: "round",
|
|
595
595
|
strokeLinejoin: "round",
|
|
596
596
|
d: "M12 7.5h1.5m-1.5 3h1.5m-7.5 3h7.5m-7.5 3h7.5m3-9h3.375c.621 0 1.125.504 1.125 1.125V18a2.25 2.25 0 01-2.25 2.25M16.5 7.5V18a2.25 2.25 0 002.25 2.25M16.5 7.5V4.875c0-.621-.504-1.125-1.125-1.125H4.125C3.504 3.75 3 4.254 3 4.875V18a2.25 2.25 0 002.25 2.25h13.5M6 7.5h3v3H6v-3z"
|
|
597
|
-
}
|
|
598
|
-
}
|
|
599
|
-
email: /* @__PURE__ */
|
|
597
|
+
})
|
|
598
|
+
}),
|
|
599
|
+
email: /* @__PURE__ */ jsx5("svg", {
|
|
600
600
|
className: "w-5 h-5",
|
|
601
601
|
viewBox: "0 0 24 24",
|
|
602
602
|
fill: "none",
|
|
603
603
|
stroke: "currentColor",
|
|
604
604
|
strokeWidth: "1.5",
|
|
605
|
-
children: /* @__PURE__ */
|
|
605
|
+
children: /* @__PURE__ */ jsx5("path", {
|
|
606
606
|
strokeLinecap: "round",
|
|
607
607
|
strokeLinejoin: "round",
|
|
608
608
|
d: "M21.75 6.75v10.5a2.25 2.25 0 01-2.25 2.25h-15a2.25 2.25 0 01-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25m19.5 0v.243a2.25 2.25 0 01-1.07 1.916l-7.5 4.615a2.25 2.25 0 01-2.36 0L3.32 8.91a2.25 2.25 0 01-1.07-1.916V6.75"
|
|
609
|
-
}
|
|
610
|
-
}
|
|
611
|
-
analytics: /* @__PURE__ */
|
|
609
|
+
})
|
|
610
|
+
}),
|
|
611
|
+
analytics: /* @__PURE__ */ jsx5("svg", {
|
|
612
612
|
className: "w-5 h-5",
|
|
613
613
|
viewBox: "0 0 24 24",
|
|
614
614
|
fill: "none",
|
|
615
615
|
stroke: "currentColor",
|
|
616
616
|
strokeWidth: "1.5",
|
|
617
|
-
children: /* @__PURE__ */
|
|
617
|
+
children: /* @__PURE__ */ jsx5("path", {
|
|
618
618
|
strokeLinecap: "round",
|
|
619
619
|
strokeLinejoin: "round",
|
|
620
620
|
d: "M3 13.125C3 12.504 3.504 12 4.125 12h2.25c.621 0 1.125.504 1.125 1.125v6.75C7.5 20.496 6.996 21 6.375 21h-2.25A1.125 1.125 0 013 19.875v-6.75zM9.75 8.625c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125v11.25c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 01-1.125-1.125V8.625zM16.5 4.125c0-.621.504-1.125 1.125-1.125h2.25C20.496 3 21 3.504 21 4.125v15.75c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 01-1.125-1.125V4.125z"
|
|
621
|
-
}
|
|
622
|
-
}
|
|
621
|
+
})
|
|
622
|
+
})
|
|
623
623
|
};
|
|
624
624
|
function ModuleCard({
|
|
625
625
|
title,
|
|
@@ -629,60 +629,60 @@ function ModuleCard({
|
|
|
629
629
|
disabled = false,
|
|
630
630
|
badge
|
|
631
631
|
}) {
|
|
632
|
-
const content = /* @__PURE__ */
|
|
632
|
+
const content = /* @__PURE__ */ jsxs5("div", {
|
|
633
633
|
className: "flex items-start gap-4",
|
|
634
634
|
children: [
|
|
635
|
-
/* @__PURE__ */
|
|
635
|
+
/* @__PURE__ */ jsx5("div", {
|
|
636
636
|
className: `w-10 h-10 flex items-center justify-center shrink-0 transition-colors ${disabled ? "bg-neutral-50 text-neutral-300" : "bg-neutral-100 text-neutral-500 group-hover:bg-neutral-200"}`,
|
|
637
637
|
children: icon
|
|
638
|
-
}
|
|
639
|
-
/* @__PURE__ */
|
|
638
|
+
}),
|
|
639
|
+
/* @__PURE__ */ jsxs5("div", {
|
|
640
640
|
className: "flex-1 min-w-0",
|
|
641
641
|
children: [
|
|
642
|
-
/* @__PURE__ */
|
|
642
|
+
/* @__PURE__ */ jsxs5("div", {
|
|
643
643
|
className: "flex items-center gap-2",
|
|
644
644
|
children: [
|
|
645
|
-
/* @__PURE__ */
|
|
645
|
+
/* @__PURE__ */ jsx5("h3", {
|
|
646
646
|
className: `text-base font-medium transition-colors ${disabled ? "text-neutral-400" : "text-neutral-900 group-hover:text-neutral-700"}`,
|
|
647
647
|
children: title
|
|
648
|
-
}
|
|
649
|
-
badge && /* @__PURE__ */
|
|
648
|
+
}),
|
|
649
|
+
badge && /* @__PURE__ */ jsx5("span", {
|
|
650
650
|
className: "px-1.5 py-0.5 text-xs rounded bg-neutral-100 text-neutral-400",
|
|
651
651
|
children: badge
|
|
652
|
-
}
|
|
652
|
+
})
|
|
653
653
|
]
|
|
654
|
-
}
|
|
655
|
-
/* @__PURE__ */
|
|
654
|
+
}),
|
|
655
|
+
/* @__PURE__ */ jsx5("p", {
|
|
656
656
|
className: `mt-0.5 text-sm ${disabled ? "text-neutral-300" : "text-neutral-500"}`,
|
|
657
657
|
children: description
|
|
658
|
-
}
|
|
658
|
+
})
|
|
659
659
|
]
|
|
660
|
-
}
|
|
661
|
-
!disabled && /* @__PURE__ */
|
|
660
|
+
}),
|
|
661
|
+
!disabled && /* @__PURE__ */ jsx5("svg", {
|
|
662
662
|
className: "w-5 h-5 text-neutral-300 group-hover:text-neutral-500 group-hover:translate-x-0.5 transition-all shrink-0",
|
|
663
663
|
viewBox: "0 0 24 24",
|
|
664
664
|
fill: "none",
|
|
665
665
|
stroke: "currentColor",
|
|
666
666
|
strokeWidth: "1.5",
|
|
667
|
-
children: /* @__PURE__ */
|
|
667
|
+
children: /* @__PURE__ */ jsx5("path", {
|
|
668
668
|
strokeLinecap: "round",
|
|
669
669
|
strokeLinejoin: "round",
|
|
670
670
|
d: "M8.25 4.5l7.5 7.5-7.5 7.5"
|
|
671
|
-
}
|
|
672
|
-
}
|
|
671
|
+
})
|
|
672
|
+
})
|
|
673
673
|
]
|
|
674
|
-
}
|
|
674
|
+
});
|
|
675
675
|
if (disabled) {
|
|
676
|
-
return /* @__PURE__ */
|
|
676
|
+
return /* @__PURE__ */ jsx5("div", {
|
|
677
677
|
className: "block p-5 bg-neutral-50 border border-neutral-100 cursor-not-allowed",
|
|
678
678
|
children: content
|
|
679
|
-
}
|
|
679
|
+
});
|
|
680
680
|
}
|
|
681
|
-
return /* @__PURE__ */
|
|
681
|
+
return /* @__PURE__ */ jsx5("a", {
|
|
682
682
|
href,
|
|
683
683
|
className: "group block p-5 bg-white border border-neutral-200 hover:border-neutral-300 transition-colors",
|
|
684
684
|
children: content
|
|
685
|
-
}
|
|
685
|
+
});
|
|
686
686
|
}
|
|
687
687
|
function CmsAdminLanding({
|
|
688
688
|
basePath = "/admin",
|
|
@@ -701,52 +701,52 @@ function CmsAdminLanding({
|
|
|
701
701
|
return fallback[key] ?? key;
|
|
702
702
|
});
|
|
703
703
|
if (pages.length === 0 && modules.length === 0) {
|
|
704
|
-
return /* @__PURE__ */
|
|
704
|
+
return /* @__PURE__ */ jsx5(EmptyState, {
|
|
705
705
|
t
|
|
706
|
-
}
|
|
706
|
+
});
|
|
707
707
|
}
|
|
708
708
|
const firstPageSlug = pages[0]?.slug;
|
|
709
|
-
return /* @__PURE__ */
|
|
709
|
+
return /* @__PURE__ */ jsxs5("div", {
|
|
710
710
|
className: "space-y-8",
|
|
711
711
|
children: [
|
|
712
|
-
/* @__PURE__ */
|
|
712
|
+
/* @__PURE__ */ jsx5("header", {
|
|
713
713
|
className: "border-b border-neutral-200 h-16 px-8 flex items-center",
|
|
714
|
-
children: /* @__PURE__ */
|
|
714
|
+
children: /* @__PURE__ */ jsx5("h1", {
|
|
715
715
|
className: "text-2xl font-light tracking-tight text-neutral-900",
|
|
716
716
|
children: t("dashboard")
|
|
717
|
-
}
|
|
718
|
-
}
|
|
719
|
-
/* @__PURE__ */
|
|
717
|
+
})
|
|
718
|
+
}),
|
|
719
|
+
/* @__PURE__ */ jsx5("div", {
|
|
720
720
|
className: "px-8 pb-12",
|
|
721
|
-
children: /* @__PURE__ */
|
|
721
|
+
children: /* @__PURE__ */ jsxs5("div", {
|
|
722
722
|
className: "grid gap-4 xl:grid-cols-2",
|
|
723
723
|
children: [
|
|
724
|
-
pages.length > 0 && /* @__PURE__ */
|
|
724
|
+
pages.length > 0 && /* @__PURE__ */ jsx5(ModuleCard, {
|
|
725
725
|
title: t("modulePages"),
|
|
726
726
|
description: t("modulePagesDesc"),
|
|
727
727
|
icon: CmsModuleIcons.pages,
|
|
728
728
|
href: firstPageSlug ? `${basePath}/${firstPageSlug}` : undefined,
|
|
729
729
|
disabled: !firstPageSlug
|
|
730
|
-
}
|
|
731
|
-
modules.map((module) => /* @__PURE__ */
|
|
730
|
+
}),
|
|
731
|
+
modules.map((module) => /* @__PURE__ */ jsx5(ModuleCard, {
|
|
732
732
|
title: module.title,
|
|
733
733
|
description: module.description,
|
|
734
734
|
icon: module.icon,
|
|
735
735
|
href: module.href,
|
|
736
736
|
disabled: module.disabled,
|
|
737
737
|
badge: module.badge
|
|
738
|
-
}, module.id
|
|
738
|
+
}, module.id))
|
|
739
739
|
]
|
|
740
|
-
}
|
|
741
|
-
}
|
|
740
|
+
})
|
|
741
|
+
})
|
|
742
742
|
]
|
|
743
|
-
}
|
|
743
|
+
});
|
|
744
744
|
}
|
|
745
745
|
// src/admin/CmsBlogAdmin.tsx
|
|
746
746
|
import * as React3 from "react";
|
|
747
747
|
import ReactMarkdown from "react-markdown";
|
|
748
748
|
import remarkGfm from "remark-gfm";
|
|
749
|
-
import {
|
|
749
|
+
import { jsx as jsx6, jsxs as jsxs6, Fragment as Fragment2 } from "react/jsx-runtime";
|
|
750
750
|
function generateId() {
|
|
751
751
|
return crypto.randomUUID();
|
|
752
752
|
}
|
|
@@ -761,328 +761,328 @@ function formatDate(dateString) {
|
|
|
761
761
|
});
|
|
762
762
|
}
|
|
763
763
|
var Icons = {
|
|
764
|
-
back: /* @__PURE__ */
|
|
764
|
+
back: /* @__PURE__ */ jsx6("svg", {
|
|
765
765
|
className: "w-4 h-4",
|
|
766
766
|
viewBox: "0 0 24 24",
|
|
767
767
|
fill: "none",
|
|
768
768
|
stroke: "currentColor",
|
|
769
769
|
strokeWidth: "2",
|
|
770
|
-
children: /* @__PURE__ */
|
|
770
|
+
children: /* @__PURE__ */ jsx6("path", {
|
|
771
771
|
strokeLinecap: "round",
|
|
772
772
|
strokeLinejoin: "round",
|
|
773
773
|
d: "M15.75 19.5L8.25 12l7.5-7.5"
|
|
774
|
-
}
|
|
775
|
-
}
|
|
776
|
-
plus: /* @__PURE__ */
|
|
774
|
+
})
|
|
775
|
+
}),
|
|
776
|
+
plus: /* @__PURE__ */ jsxs6("svg", {
|
|
777
777
|
className: "w-4 h-4",
|
|
778
778
|
viewBox: "0 0 24 24",
|
|
779
779
|
fill: "none",
|
|
780
780
|
stroke: "currentColor",
|
|
781
781
|
strokeWidth: "2",
|
|
782
782
|
children: [
|
|
783
|
-
/* @__PURE__ */
|
|
783
|
+
/* @__PURE__ */ jsx6("line", {
|
|
784
784
|
x1: "12",
|
|
785
785
|
y1: "5",
|
|
786
786
|
x2: "12",
|
|
787
787
|
y2: "19"
|
|
788
|
-
}
|
|
789
|
-
/* @__PURE__ */
|
|
788
|
+
}),
|
|
789
|
+
/* @__PURE__ */ jsx6("line", {
|
|
790
790
|
x1: "5",
|
|
791
791
|
y1: "12",
|
|
792
792
|
x2: "19",
|
|
793
793
|
y2: "12"
|
|
794
|
-
}
|
|
794
|
+
})
|
|
795
795
|
]
|
|
796
|
-
}
|
|
797
|
-
image: /* @__PURE__ */
|
|
796
|
+
}),
|
|
797
|
+
image: /* @__PURE__ */ jsxs6("svg", {
|
|
798
798
|
className: "w-4 h-4",
|
|
799
799
|
viewBox: "0 0 24 24",
|
|
800
800
|
fill: "none",
|
|
801
801
|
stroke: "currentColor",
|
|
802
802
|
strokeWidth: "2",
|
|
803
803
|
children: [
|
|
804
|
-
/* @__PURE__ */
|
|
804
|
+
/* @__PURE__ */ jsx6("rect", {
|
|
805
805
|
x: "3",
|
|
806
806
|
y: "3",
|
|
807
807
|
width: "18",
|
|
808
808
|
height: "18",
|
|
809
809
|
rx: "2",
|
|
810
810
|
ry: "2"
|
|
811
|
-
}
|
|
812
|
-
/* @__PURE__ */
|
|
811
|
+
}),
|
|
812
|
+
/* @__PURE__ */ jsx6("circle", {
|
|
813
813
|
cx: "8.5",
|
|
814
814
|
cy: "8.5",
|
|
815
815
|
r: "1.5"
|
|
816
|
-
}
|
|
817
|
-
/* @__PURE__ */
|
|
816
|
+
}),
|
|
817
|
+
/* @__PURE__ */ jsx6("polyline", {
|
|
818
818
|
points: "21,15 16,10 5,21"
|
|
819
|
-
}
|
|
819
|
+
})
|
|
820
820
|
]
|
|
821
|
-
}
|
|
822
|
-
bold: /* @__PURE__ */
|
|
821
|
+
}),
|
|
822
|
+
bold: /* @__PURE__ */ jsxs6("svg", {
|
|
823
823
|
className: "w-4 h-4",
|
|
824
824
|
viewBox: "0 0 24 24",
|
|
825
825
|
fill: "none",
|
|
826
826
|
stroke: "currentColor",
|
|
827
827
|
strokeWidth: "2",
|
|
828
828
|
children: [
|
|
829
|
-
/* @__PURE__ */
|
|
829
|
+
/* @__PURE__ */ jsx6("path", {
|
|
830
830
|
d: "M6 4h8a4 4 0 0 1 4 4 4 4 0 0 1-4 4H6z"
|
|
831
|
-
}
|
|
832
|
-
/* @__PURE__ */
|
|
831
|
+
}),
|
|
832
|
+
/* @__PURE__ */ jsx6("path", {
|
|
833
833
|
d: "M6 12h9a4 4 0 0 1 4 4 4 4 0 0 1-4 4H6z"
|
|
834
|
-
}
|
|
834
|
+
})
|
|
835
835
|
]
|
|
836
|
-
}
|
|
837
|
-
italic: /* @__PURE__ */
|
|
836
|
+
}),
|
|
837
|
+
italic: /* @__PURE__ */ jsxs6("svg", {
|
|
838
838
|
className: "w-4 h-4",
|
|
839
839
|
viewBox: "0 0 24 24",
|
|
840
840
|
fill: "none",
|
|
841
841
|
stroke: "currentColor",
|
|
842
842
|
strokeWidth: "2",
|
|
843
843
|
children: [
|
|
844
|
-
/* @__PURE__ */
|
|
844
|
+
/* @__PURE__ */ jsx6("line", {
|
|
845
845
|
x1: "19",
|
|
846
846
|
y1: "4",
|
|
847
847
|
x2: "10",
|
|
848
848
|
y2: "4"
|
|
849
|
-
}
|
|
850
|
-
/* @__PURE__ */
|
|
849
|
+
}),
|
|
850
|
+
/* @__PURE__ */ jsx6("line", {
|
|
851
851
|
x1: "14",
|
|
852
852
|
y1: "20",
|
|
853
853
|
x2: "5",
|
|
854
854
|
y2: "20"
|
|
855
|
-
}
|
|
856
|
-
/* @__PURE__ */
|
|
855
|
+
}),
|
|
856
|
+
/* @__PURE__ */ jsx6("line", {
|
|
857
857
|
x1: "15",
|
|
858
858
|
y1: "4",
|
|
859
859
|
x2: "9",
|
|
860
860
|
y2: "20"
|
|
861
|
-
}
|
|
861
|
+
})
|
|
862
862
|
]
|
|
863
|
-
}
|
|
864
|
-
heading: /* @__PURE__ */
|
|
863
|
+
}),
|
|
864
|
+
heading: /* @__PURE__ */ jsxs6("svg", {
|
|
865
865
|
className: "w-4 h-4",
|
|
866
866
|
viewBox: "0 0 24 24",
|
|
867
867
|
fill: "none",
|
|
868
868
|
stroke: "currentColor",
|
|
869
869
|
strokeWidth: "2",
|
|
870
870
|
children: [
|
|
871
|
-
/* @__PURE__ */
|
|
871
|
+
/* @__PURE__ */ jsx6("path", {
|
|
872
872
|
d: "M4 12h8"
|
|
873
|
-
}
|
|
874
|
-
/* @__PURE__ */
|
|
873
|
+
}),
|
|
874
|
+
/* @__PURE__ */ jsx6("path", {
|
|
875
875
|
d: "M4 18V6"
|
|
876
|
-
}
|
|
877
|
-
/* @__PURE__ */
|
|
876
|
+
}),
|
|
877
|
+
/* @__PURE__ */ jsx6("path", {
|
|
878
878
|
d: "M12 18V6"
|
|
879
|
-
}
|
|
880
|
-
/* @__PURE__ */
|
|
879
|
+
}),
|
|
880
|
+
/* @__PURE__ */ jsx6("path", {
|
|
881
881
|
d: "M17 10v4h4"
|
|
882
|
-
}
|
|
883
|
-
/* @__PURE__ */
|
|
882
|
+
}),
|
|
883
|
+
/* @__PURE__ */ jsx6("path", {
|
|
884
884
|
d: "M21 10v8"
|
|
885
|
-
}
|
|
885
|
+
})
|
|
886
886
|
]
|
|
887
|
-
}
|
|
888
|
-
list: /* @__PURE__ */
|
|
887
|
+
}),
|
|
888
|
+
list: /* @__PURE__ */ jsxs6("svg", {
|
|
889
889
|
className: "w-4 h-4",
|
|
890
890
|
viewBox: "0 0 24 24",
|
|
891
891
|
fill: "none",
|
|
892
892
|
stroke: "currentColor",
|
|
893
893
|
strokeWidth: "2",
|
|
894
894
|
children: [
|
|
895
|
-
/* @__PURE__ */
|
|
895
|
+
/* @__PURE__ */ jsx6("line", {
|
|
896
896
|
x1: "8",
|
|
897
897
|
y1: "6",
|
|
898
898
|
x2: "21",
|
|
899
899
|
y2: "6"
|
|
900
|
-
}
|
|
901
|
-
/* @__PURE__ */
|
|
900
|
+
}),
|
|
901
|
+
/* @__PURE__ */ jsx6("line", {
|
|
902
902
|
x1: "8",
|
|
903
903
|
y1: "12",
|
|
904
904
|
x2: "21",
|
|
905
905
|
y2: "12"
|
|
906
|
-
}
|
|
907
|
-
/* @__PURE__ */
|
|
906
|
+
}),
|
|
907
|
+
/* @__PURE__ */ jsx6("line", {
|
|
908
908
|
x1: "8",
|
|
909
909
|
y1: "18",
|
|
910
910
|
x2: "21",
|
|
911
911
|
y2: "18"
|
|
912
|
-
}
|
|
913
|
-
/* @__PURE__ */
|
|
912
|
+
}),
|
|
913
|
+
/* @__PURE__ */ jsx6("line", {
|
|
914
914
|
x1: "3",
|
|
915
915
|
y1: "6",
|
|
916
916
|
x2: "3.01",
|
|
917
917
|
y2: "6"
|
|
918
|
-
}
|
|
919
|
-
/* @__PURE__ */
|
|
918
|
+
}),
|
|
919
|
+
/* @__PURE__ */ jsx6("line", {
|
|
920
920
|
x1: "3",
|
|
921
921
|
y1: "12",
|
|
922
922
|
x2: "3.01",
|
|
923
923
|
y2: "12"
|
|
924
|
-
}
|
|
925
|
-
/* @__PURE__ */
|
|
924
|
+
}),
|
|
925
|
+
/* @__PURE__ */ jsx6("line", {
|
|
926
926
|
x1: "3",
|
|
927
927
|
y1: "18",
|
|
928
928
|
x2: "3.01",
|
|
929
929
|
y2: "18"
|
|
930
|
-
}
|
|
930
|
+
})
|
|
931
931
|
]
|
|
932
|
-
}
|
|
933
|
-
link: /* @__PURE__ */
|
|
932
|
+
}),
|
|
933
|
+
link: /* @__PURE__ */ jsxs6("svg", {
|
|
934
934
|
className: "w-4 h-4",
|
|
935
935
|
viewBox: "0 0 24 24",
|
|
936
936
|
fill: "none",
|
|
937
937
|
stroke: "currentColor",
|
|
938
938
|
strokeWidth: "2",
|
|
939
939
|
children: [
|
|
940
|
-
/* @__PURE__ */
|
|
940
|
+
/* @__PURE__ */ jsx6("path", {
|
|
941
941
|
d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"
|
|
942
|
-
}
|
|
943
|
-
/* @__PURE__ */
|
|
942
|
+
}),
|
|
943
|
+
/* @__PURE__ */ jsx6("path", {
|
|
944
944
|
d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"
|
|
945
|
-
}
|
|
945
|
+
})
|
|
946
946
|
]
|
|
947
|
-
}
|
|
948
|
-
code: /* @__PURE__ */
|
|
947
|
+
}),
|
|
948
|
+
code: /* @__PURE__ */ jsxs6("svg", {
|
|
949
949
|
className: "w-4 h-4",
|
|
950
950
|
viewBox: "0 0 24 24",
|
|
951
951
|
fill: "none",
|
|
952
952
|
stroke: "currentColor",
|
|
953
953
|
strokeWidth: "2",
|
|
954
954
|
children: [
|
|
955
|
-
/* @__PURE__ */
|
|
955
|
+
/* @__PURE__ */ jsx6("polyline", {
|
|
956
956
|
points: "16,18 22,12 16,6"
|
|
957
|
-
}
|
|
958
|
-
/* @__PURE__ */
|
|
957
|
+
}),
|
|
958
|
+
/* @__PURE__ */ jsx6("polyline", {
|
|
959
959
|
points: "8,6 2,12 8,18"
|
|
960
|
-
}
|
|
960
|
+
})
|
|
961
961
|
]
|
|
962
|
-
}
|
|
963
|
-
quote: /* @__PURE__ */
|
|
962
|
+
}),
|
|
963
|
+
quote: /* @__PURE__ */ jsxs6("svg", {
|
|
964
964
|
className: "w-4 h-4",
|
|
965
965
|
viewBox: "0 0 24 24",
|
|
966
966
|
fill: "none",
|
|
967
967
|
stroke: "currentColor",
|
|
968
968
|
strokeWidth: "2",
|
|
969
969
|
children: [
|
|
970
|
-
/* @__PURE__ */
|
|
970
|
+
/* @__PURE__ */ jsx6("path", {
|
|
971
971
|
d: "M3 21c3 0 7-1 7-8V5c0-1.25-.756-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V21z"
|
|
972
|
-
}
|
|
973
|
-
/* @__PURE__ */
|
|
972
|
+
}),
|
|
973
|
+
/* @__PURE__ */ jsx6("path", {
|
|
974
974
|
d: "M15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V21z"
|
|
975
|
-
}
|
|
975
|
+
})
|
|
976
976
|
]
|
|
977
|
-
}
|
|
978
|
-
document: /* @__PURE__ */
|
|
977
|
+
}),
|
|
978
|
+
document: /* @__PURE__ */ jsx6("svg", {
|
|
979
979
|
className: "w-5 h-5",
|
|
980
980
|
viewBox: "0 0 24 24",
|
|
981
981
|
fill: "none",
|
|
982
982
|
stroke: "currentColor",
|
|
983
983
|
strokeWidth: "1.5",
|
|
984
|
-
children: /* @__PURE__ */
|
|
984
|
+
children: /* @__PURE__ */ jsx6("path", {
|
|
985
985
|
strokeLinecap: "round",
|
|
986
986
|
strokeLinejoin: "round",
|
|
987
987
|
d: "M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"
|
|
988
|
-
}
|
|
989
|
-
}
|
|
988
|
+
})
|
|
989
|
+
})
|
|
990
990
|
};
|
|
991
991
|
function PostCard({
|
|
992
992
|
post,
|
|
993
993
|
onClick,
|
|
994
994
|
t
|
|
995
995
|
}) {
|
|
996
|
-
return /* @__PURE__ */
|
|
996
|
+
return /* @__PURE__ */ jsx6("button", {
|
|
997
997
|
onClick,
|
|
998
998
|
className: "w-full text-left p-4 bg-white border border-neutral-200 hover:border-neutral-300 transition-colors group",
|
|
999
|
-
children: /* @__PURE__ */
|
|
999
|
+
children: /* @__PURE__ */ jsxs6("div", {
|
|
1000
1000
|
className: "flex items-start gap-4",
|
|
1001
1001
|
children: [
|
|
1002
|
-
post.coverImage ? /* @__PURE__ */
|
|
1002
|
+
post.coverImage ? /* @__PURE__ */ jsx6("img", {
|
|
1003
1003
|
src: post.coverImage,
|
|
1004
1004
|
alt: "",
|
|
1005
1005
|
className: "w-20 h-20 object-cover shrink-0"
|
|
1006
|
-
}
|
|
1006
|
+
}) : /* @__PURE__ */ jsx6("div", {
|
|
1007
1007
|
className: "w-20 h-20 bg-neutral-100 flex items-center justify-center shrink-0",
|
|
1008
1008
|
children: Icons.document
|
|
1009
|
-
}
|
|
1010
|
-
/* @__PURE__ */
|
|
1009
|
+
}),
|
|
1010
|
+
/* @__PURE__ */ jsxs6("div", {
|
|
1011
1011
|
className: "flex-1 min-w-0",
|
|
1012
1012
|
children: [
|
|
1013
|
-
/* @__PURE__ */
|
|
1013
|
+
/* @__PURE__ */ jsxs6("div", {
|
|
1014
1014
|
className: "flex items-center gap-2 mb-1",
|
|
1015
1015
|
children: [
|
|
1016
|
-
/* @__PURE__ */
|
|
1016
|
+
/* @__PURE__ */ jsx6("h3", {
|
|
1017
1017
|
className: "text-sm font-medium text-neutral-900 truncate group-hover:text-neutral-600 transition-colors",
|
|
1018
1018
|
children: post.title || t("blogUntitled")
|
|
1019
|
-
}
|
|
1020
|
-
/* @__PURE__ */
|
|
1019
|
+
}),
|
|
1020
|
+
/* @__PURE__ */ jsx6("span", {
|
|
1021
1021
|
className: `shrink-0 px-1.5 py-0.5 text-xs rounded ${post.status === "published" ? "bg-green-100 text-green-700" : "bg-neutral-100 text-neutral-500"}`,
|
|
1022
1022
|
children: post.status === "published" ? t("blogPublished") : t("blogDraft")
|
|
1023
|
-
}
|
|
1023
|
+
})
|
|
1024
1024
|
]
|
|
1025
|
-
}
|
|
1026
|
-
/* @__PURE__ */
|
|
1025
|
+
}),
|
|
1026
|
+
/* @__PURE__ */ jsxs6("p", {
|
|
1027
1027
|
className: "text-xs text-neutral-500 mb-2",
|
|
1028
1028
|
children: [
|
|
1029
1029
|
post.authorName,
|
|
1030
1030
|
" · ",
|
|
1031
1031
|
formatDate(post.updatedAt)
|
|
1032
1032
|
]
|
|
1033
|
-
}
|
|
1034
|
-
post.excerpt && /* @__PURE__ */
|
|
1033
|
+
}),
|
|
1034
|
+
post.excerpt && /* @__PURE__ */ jsx6("p", {
|
|
1035
1035
|
className: "text-sm text-neutral-600 line-clamp-2",
|
|
1036
1036
|
children: post.excerpt
|
|
1037
|
-
}
|
|
1037
|
+
})
|
|
1038
1038
|
]
|
|
1039
|
-
}
|
|
1039
|
+
})
|
|
1040
1040
|
]
|
|
1041
|
-
}
|
|
1042
|
-
}
|
|
1041
|
+
})
|
|
1042
|
+
});
|
|
1043
1043
|
}
|
|
1044
1044
|
function EmptyState2({
|
|
1045
1045
|
t,
|
|
1046
1046
|
onCreate
|
|
1047
1047
|
}) {
|
|
1048
|
-
return /* @__PURE__ */
|
|
1048
|
+
return /* @__PURE__ */ jsxs6("div", {
|
|
1049
1049
|
className: "flex flex-col items-center justify-center py-24 text-center",
|
|
1050
1050
|
children: [
|
|
1051
|
-
/* @__PURE__ */
|
|
1051
|
+
/* @__PURE__ */ jsx6("div", {
|
|
1052
1052
|
className: "w-16 h-16 rounded-lg flex items-center justify-center mb-4 bg-neutral-100",
|
|
1053
1053
|
children: Icons.document
|
|
1054
|
-
}
|
|
1055
|
-
/* @__PURE__ */
|
|
1054
|
+
}),
|
|
1055
|
+
/* @__PURE__ */ jsx6("h3", {
|
|
1056
1056
|
className: "text-lg font-medium text-neutral-900 mb-2",
|
|
1057
1057
|
children: t("blogNoPostsYet")
|
|
1058
|
-
}
|
|
1059
|
-
/* @__PURE__ */
|
|
1058
|
+
}),
|
|
1059
|
+
/* @__PURE__ */ jsx6("p", {
|
|
1060
1060
|
className: "text-sm text-neutral-500 mb-6 max-w-sm",
|
|
1061
1061
|
children: t("blogCreateFirstPost")
|
|
1062
|
-
}
|
|
1063
|
-
/* @__PURE__ */
|
|
1062
|
+
}),
|
|
1063
|
+
/* @__PURE__ */ jsxs6("button", {
|
|
1064
1064
|
onClick: onCreate,
|
|
1065
1065
|
className: "inline-flex items-center gap-2 px-4 py-2 text-sm bg-neutral-900 text-white rounded hover:bg-neutral-800 transition-colors",
|
|
1066
1066
|
children: [
|
|
1067
1067
|
Icons.plus,
|
|
1068
1068
|
t("blogNewPost")
|
|
1069
1069
|
]
|
|
1070
|
-
}
|
|
1070
|
+
})
|
|
1071
1071
|
]
|
|
1072
|
-
}
|
|
1072
|
+
});
|
|
1073
1073
|
}
|
|
1074
1074
|
function MarkdownPreview({
|
|
1075
1075
|
content,
|
|
1076
1076
|
t
|
|
1077
1077
|
}) {
|
|
1078
1078
|
if (!content.trim()) {
|
|
1079
|
-
return /* @__PURE__ */
|
|
1079
|
+
return /* @__PURE__ */ jsx6("div", {
|
|
1080
1080
|
className: "h-full flex items-center justify-center text-neutral-400 text-sm",
|
|
1081
1081
|
children: t("blogPreviewPlaceholder")
|
|
1082
|
-
}
|
|
1082
|
+
});
|
|
1083
1083
|
}
|
|
1084
1084
|
const markdownComponents = {
|
|
1085
|
-
h1: ({ children, ...props }) => /* @__PURE__ */
|
|
1085
|
+
h1: ({ children, ...props }) => /* @__PURE__ */ jsx6("h1", {
|
|
1086
1086
|
...props,
|
|
1087
1087
|
className: "text-2xl font-semibold text-neutral-900 mt-6 mb-3",
|
|
1088
1088
|
style: {
|
|
@@ -1091,8 +1091,8 @@ function MarkdownPreview({
|
|
|
1091
1091
|
lineHeight: "2rem"
|
|
1092
1092
|
},
|
|
1093
1093
|
children
|
|
1094
|
-
}
|
|
1095
|
-
h2: ({ children, ...props }) => /* @__PURE__ */
|
|
1094
|
+
}),
|
|
1095
|
+
h2: ({ children, ...props }) => /* @__PURE__ */ jsx6("h2", {
|
|
1096
1096
|
...props,
|
|
1097
1097
|
className: "text-xl font-semibold text-neutral-900 mt-5 mb-3",
|
|
1098
1098
|
style: {
|
|
@@ -1101,8 +1101,8 @@ function MarkdownPreview({
|
|
|
1101
1101
|
lineHeight: "1.75rem"
|
|
1102
1102
|
},
|
|
1103
1103
|
children
|
|
1104
|
-
}
|
|
1105
|
-
h3: ({ children, ...props }) => /* @__PURE__ */
|
|
1104
|
+
}),
|
|
1105
|
+
h3: ({ children, ...props }) => /* @__PURE__ */ jsx6("h3", {
|
|
1106
1106
|
...props,
|
|
1107
1107
|
className: "text-lg font-semibold text-neutral-900 mt-4 mb-2",
|
|
1108
1108
|
style: {
|
|
@@ -1111,8 +1111,8 @@ function MarkdownPreview({
|
|
|
1111
1111
|
lineHeight: "1.5rem"
|
|
1112
1112
|
},
|
|
1113
1113
|
children
|
|
1114
|
-
}
|
|
1115
|
-
h4: ({ children, ...props }) => /* @__PURE__ */
|
|
1114
|
+
}),
|
|
1115
|
+
h4: ({ children, ...props }) => /* @__PURE__ */ jsx6("h4", {
|
|
1116
1116
|
...props,
|
|
1117
1117
|
className: "text-base font-semibold text-neutral-900 mt-4 mb-2",
|
|
1118
1118
|
style: {
|
|
@@ -1121,61 +1121,61 @@ function MarkdownPreview({
|
|
|
1121
1121
|
lineHeight: "1.5rem"
|
|
1122
1122
|
},
|
|
1123
1123
|
children
|
|
1124
|
-
}
|
|
1125
|
-
p: ({ children, ...props }) => /* @__PURE__ */
|
|
1124
|
+
}),
|
|
1125
|
+
p: ({ children, ...props }) => /* @__PURE__ */ jsx6("p", {
|
|
1126
1126
|
...props,
|
|
1127
1127
|
className: "text-sm text-neutral-700 leading-6 mb-3",
|
|
1128
1128
|
children
|
|
1129
|
-
}
|
|
1130
|
-
a: ({ children, ...props }) => /* @__PURE__ */
|
|
1129
|
+
}),
|
|
1130
|
+
a: ({ children, ...props }) => /* @__PURE__ */ jsx6("a", {
|
|
1131
1131
|
...props,
|
|
1132
1132
|
className: "text-blue-600 hover:text-blue-700 underline underline-offset-2",
|
|
1133
1133
|
children
|
|
1134
|
-
}
|
|
1135
|
-
ul: ({ children, ...props }) => /* @__PURE__ */
|
|
1134
|
+
}),
|
|
1135
|
+
ul: ({ children, ...props }) => /* @__PURE__ */ jsx6("ul", {
|
|
1136
1136
|
...props,
|
|
1137
1137
|
className: "list-disc pl-5 text-sm text-neutral-700 mb-3",
|
|
1138
1138
|
children
|
|
1139
|
-
}
|
|
1140
|
-
ol: ({ children, ...props }) => /* @__PURE__ */
|
|
1139
|
+
}),
|
|
1140
|
+
ol: ({ children, ...props }) => /* @__PURE__ */ jsx6("ol", {
|
|
1141
1141
|
...props,
|
|
1142
1142
|
className: "list-decimal pl-5 text-sm text-neutral-700 mb-3",
|
|
1143
1143
|
children
|
|
1144
|
-
}
|
|
1145
|
-
li: ({ children, ...props }) => /* @__PURE__ */
|
|
1144
|
+
}),
|
|
1145
|
+
li: ({ children, ...props }) => /* @__PURE__ */ jsx6("li", {
|
|
1146
1146
|
...props,
|
|
1147
1147
|
className: "mb-1",
|
|
1148
1148
|
children
|
|
1149
|
-
}
|
|
1149
|
+
}),
|
|
1150
1150
|
blockquote: ({
|
|
1151
1151
|
children,
|
|
1152
1152
|
...props
|
|
1153
|
-
}) => /* @__PURE__ */
|
|
1153
|
+
}) => /* @__PURE__ */ jsx6("blockquote", {
|
|
1154
1154
|
...props,
|
|
1155
1155
|
className: "border-l-4 border-neutral-200 pl-4 italic text-neutral-600 my-4",
|
|
1156
1156
|
children
|
|
1157
|
-
}
|
|
1157
|
+
}),
|
|
1158
1158
|
code: (props) => {
|
|
1159
1159
|
const { children, inline, ...rest } = props;
|
|
1160
|
-
return inline ? /* @__PURE__ */
|
|
1160
|
+
return inline ? /* @__PURE__ */ jsx6("code", {
|
|
1161
1161
|
...rest,
|
|
1162
1162
|
className: "px-1 py-0.5 rounded bg-neutral-100 text-neutral-800 font-mono text-xs",
|
|
1163
1163
|
children
|
|
1164
|
-
}
|
|
1164
|
+
}) : /* @__PURE__ */ jsx6("code", {
|
|
1165
1165
|
...rest,
|
|
1166
1166
|
className: "block w-full overflow-x-auto rounded bg-neutral-900 text-neutral-100 p-3 text-xs font-mono",
|
|
1167
1167
|
children
|
|
1168
|
-
}
|
|
1168
|
+
});
|
|
1169
1169
|
}
|
|
1170
1170
|
};
|
|
1171
|
-
return /* @__PURE__ */
|
|
1171
|
+
return /* @__PURE__ */ jsx6("div", {
|
|
1172
1172
|
className: "max-w-none p-6",
|
|
1173
|
-
children: /* @__PURE__ */
|
|
1173
|
+
children: /* @__PURE__ */ jsx6(ReactMarkdown, {
|
|
1174
1174
|
remarkPlugins: [remarkGfm],
|
|
1175
1175
|
components: markdownComponents,
|
|
1176
1176
|
children: content
|
|
1177
|
-
}
|
|
1178
|
-
}
|
|
1177
|
+
})
|
|
1178
|
+
});
|
|
1179
1179
|
}
|
|
1180
1180
|
function MarkdownToolbar({
|
|
1181
1181
|
textareaRef,
|
|
@@ -1242,16 +1242,16 @@ function MarkdownToolbar({
|
|
|
1242
1242
|
title: t("blogInsertImage")
|
|
1243
1243
|
}
|
|
1244
1244
|
];
|
|
1245
|
-
return /* @__PURE__ */
|
|
1245
|
+
return /* @__PURE__ */ jsx6("div", {
|
|
1246
1246
|
className: "flex items-center gap-1 px-2 py-1.5 border-b border-neutral-200 bg-neutral-50",
|
|
1247
|
-
children: buttons.map((btn, i) => /* @__PURE__ */
|
|
1247
|
+
children: buttons.map((btn, i) => /* @__PURE__ */ jsx6("button", {
|
|
1248
1248
|
type: "button",
|
|
1249
1249
|
onClick: btn.action,
|
|
1250
1250
|
title: btn.title,
|
|
1251
1251
|
className: "p-1.5 text-neutral-500 hover:text-neutral-900 hover:bg-neutral-200 rounded transition-colors",
|
|
1252
1252
|
children: btn.icon
|
|
1253
|
-
}, i
|
|
1254
|
-
}
|
|
1253
|
+
}, i))
|
|
1254
|
+
});
|
|
1255
1255
|
}
|
|
1256
1256
|
function BlogListView({
|
|
1257
1257
|
posts,
|
|
@@ -1260,48 +1260,48 @@ function BlogListView({
|
|
|
1260
1260
|
onNewPost,
|
|
1261
1261
|
t
|
|
1262
1262
|
}) {
|
|
1263
|
-
return /* @__PURE__ */
|
|
1263
|
+
return /* @__PURE__ */ jsxs6("div", {
|
|
1264
1264
|
className: "h-full flex flex-col",
|
|
1265
1265
|
children: [
|
|
1266
|
-
/* @__PURE__ */
|
|
1266
|
+
/* @__PURE__ */ jsxs6("header", {
|
|
1267
1267
|
className: "border-b border-neutral-200 h-16 px-8 flex items-center justify-between shrink-0",
|
|
1268
1268
|
children: [
|
|
1269
|
-
/* @__PURE__ */
|
|
1269
|
+
/* @__PURE__ */ jsx6("h1", {
|
|
1270
1270
|
className: "text-2xl font-light tracking-tight text-neutral-900",
|
|
1271
1271
|
children: t("blogPosts")
|
|
1272
|
-
}
|
|
1273
|
-
/* @__PURE__ */
|
|
1272
|
+
}),
|
|
1273
|
+
/* @__PURE__ */ jsxs6("button", {
|
|
1274
1274
|
onClick: onNewPost,
|
|
1275
1275
|
className: "inline-flex items-center gap-2 px-3 py-1.5 text-sm bg-neutral-900 text-white rounded hover:bg-neutral-800 transition-colors",
|
|
1276
1276
|
children: [
|
|
1277
1277
|
Icons.plus,
|
|
1278
1278
|
t("blogNewPost")
|
|
1279
1279
|
]
|
|
1280
|
-
}
|
|
1280
|
+
})
|
|
1281
1281
|
]
|
|
1282
|
-
}
|
|
1283
|
-
/* @__PURE__ */
|
|
1282
|
+
}),
|
|
1283
|
+
/* @__PURE__ */ jsx6("div", {
|
|
1284
1284
|
className: "flex-1 overflow-y-auto p-8",
|
|
1285
|
-
children: isLoading ? /* @__PURE__ */
|
|
1285
|
+
children: isLoading ? /* @__PURE__ */ jsx6("div", {
|
|
1286
1286
|
className: "flex items-center justify-center py-24",
|
|
1287
|
-
children: /* @__PURE__ */
|
|
1287
|
+
children: /* @__PURE__ */ jsx6("div", {
|
|
1288
1288
|
className: "text-neutral-500 text-sm",
|
|
1289
1289
|
children: t("loading")
|
|
1290
|
-
}
|
|
1291
|
-
}
|
|
1290
|
+
})
|
|
1291
|
+
}) : posts.length === 0 ? /* @__PURE__ */ jsx6(EmptyState2, {
|
|
1292
1292
|
t,
|
|
1293
1293
|
onCreate: onNewPost
|
|
1294
|
-
}
|
|
1294
|
+
}) : /* @__PURE__ */ jsx6("div", {
|
|
1295
1295
|
className: "grid gap-4 max-w-4xl",
|
|
1296
|
-
children: posts.map((post) => /* @__PURE__ */
|
|
1296
|
+
children: posts.map((post) => /* @__PURE__ */ jsx6(PostCard, {
|
|
1297
1297
|
post,
|
|
1298
1298
|
onClick: () => onSelectPost(post),
|
|
1299
1299
|
t
|
|
1300
|
-
}, post.id
|
|
1301
|
-
}
|
|
1302
|
-
}
|
|
1300
|
+
}, post.id))
|
|
1301
|
+
})
|
|
1302
|
+
})
|
|
1303
1303
|
]
|
|
1304
|
-
}
|
|
1304
|
+
});
|
|
1305
1305
|
}
|
|
1306
1306
|
function BlogEditorView({
|
|
1307
1307
|
post,
|
|
@@ -1445,262 +1445,262 @@ function BlogEditorView({
|
|
|
1445
1445
|
console.error("[litecms] Drop upload failed:", err);
|
|
1446
1446
|
}
|
|
1447
1447
|
}
|
|
1448
|
-
return /* @__PURE__ */
|
|
1448
|
+
return /* @__PURE__ */ jsxs6("div", {
|
|
1449
1449
|
className: "h-full flex flex-col",
|
|
1450
1450
|
children: [
|
|
1451
|
-
/* @__PURE__ */
|
|
1451
|
+
/* @__PURE__ */ jsxs6("header", {
|
|
1452
1452
|
className: "border-b border-neutral-200 h-16 px-8 flex items-center justify-between shrink-0",
|
|
1453
1453
|
children: [
|
|
1454
|
-
/* @__PURE__ */
|
|
1454
|
+
/* @__PURE__ */ jsxs6("button", {
|
|
1455
1455
|
onClick: onBack,
|
|
1456
1456
|
className: "inline-flex items-center gap-2 text-sm text-neutral-500 hover:text-neutral-900 transition-colors",
|
|
1457
1457
|
children: [
|
|
1458
1458
|
Icons.back,
|
|
1459
1459
|
t("blogBackToList")
|
|
1460
1460
|
]
|
|
1461
|
-
}
|
|
1462
|
-
/* @__PURE__ */
|
|
1461
|
+
}),
|
|
1462
|
+
/* @__PURE__ */ jsxs6("div", {
|
|
1463
1463
|
className: "flex items-center gap-2",
|
|
1464
1464
|
children: [
|
|
1465
|
-
/* @__PURE__ */
|
|
1465
|
+
/* @__PURE__ */ jsx6("button", {
|
|
1466
1466
|
onClick: () => handleSave(false),
|
|
1467
1467
|
disabled: isSaving || isDeleting,
|
|
1468
1468
|
className: "px-3 py-1.5 text-sm border border-neutral-200 rounded hover:bg-neutral-50 transition-colors disabled:opacity-50",
|
|
1469
1469
|
children: isSaving ? t("blogSaving") : t("blogSaveDraft")
|
|
1470
|
-
}
|
|
1471
|
-
status === "published" ? /* @__PURE__ */
|
|
1470
|
+
}),
|
|
1471
|
+
status === "published" ? /* @__PURE__ */ jsx6("button", {
|
|
1472
1472
|
onClick: () => handleSave(false),
|
|
1473
1473
|
disabled: isSaving || isDeleting,
|
|
1474
1474
|
className: "px-3 py-1.5 text-sm bg-neutral-900 text-white rounded hover:bg-neutral-800 transition-colors disabled:opacity-50",
|
|
1475
1475
|
children: t("blogUpdate")
|
|
1476
|
-
}
|
|
1476
|
+
}) : /* @__PURE__ */ jsx6("button", {
|
|
1477
1477
|
onClick: () => handleSave(true),
|
|
1478
1478
|
disabled: isSaving || isDeleting,
|
|
1479
1479
|
className: "px-3 py-1.5 text-sm bg-neutral-900 text-white rounded hover:bg-neutral-800 transition-colors disabled:opacity-50",
|
|
1480
1480
|
children: t("blogPublish")
|
|
1481
|
-
}
|
|
1481
|
+
})
|
|
1482
1482
|
]
|
|
1483
|
-
}
|
|
1483
|
+
})
|
|
1484
1484
|
]
|
|
1485
|
-
}
|
|
1486
|
-
error && /* @__PURE__ */
|
|
1485
|
+
}),
|
|
1486
|
+
error && /* @__PURE__ */ jsx6("div", {
|
|
1487
1487
|
className: "px-8 py-2 bg-red-50 text-red-600 text-sm",
|
|
1488
1488
|
children: error
|
|
1489
|
-
}
|
|
1490
|
-
/* @__PURE__ */
|
|
1489
|
+
}),
|
|
1490
|
+
/* @__PURE__ */ jsxs6("div", {
|
|
1491
1491
|
className: "flex-1 flex min-h-0",
|
|
1492
1492
|
children: [
|
|
1493
|
-
/* @__PURE__ */
|
|
1493
|
+
/* @__PURE__ */ jsxs6("div", {
|
|
1494
1494
|
className: "w-1/2 flex flex-col border-r border-neutral-200 overflow-hidden",
|
|
1495
1495
|
children: [
|
|
1496
|
-
/* @__PURE__ */
|
|
1496
|
+
/* @__PURE__ */ jsx6("div", {
|
|
1497
1497
|
className: "px-4 py-2 border-b border-neutral-100 text-xs font-medium text-neutral-500 uppercase tracking-wider",
|
|
1498
1498
|
children: t("blogEditor")
|
|
1499
|
-
}
|
|
1500
|
-
/* @__PURE__ */
|
|
1499
|
+
}),
|
|
1500
|
+
/* @__PURE__ */ jsxs6("div", {
|
|
1501
1501
|
className: "flex-1 overflow-y-auto p-4 space-y-4",
|
|
1502
1502
|
children: [
|
|
1503
|
-
/* @__PURE__ */
|
|
1503
|
+
/* @__PURE__ */ jsxs6("div", {
|
|
1504
1504
|
children: [
|
|
1505
|
-
/* @__PURE__ */
|
|
1505
|
+
/* @__PURE__ */ jsx6("label", {
|
|
1506
1506
|
className: "block text-sm font-medium text-neutral-700 mb-1",
|
|
1507
1507
|
children: t("blogTitle")
|
|
1508
|
-
}
|
|
1509
|
-
/* @__PURE__ */
|
|
1508
|
+
}),
|
|
1509
|
+
/* @__PURE__ */ jsx6("input", {
|
|
1510
1510
|
type: "text",
|
|
1511
1511
|
value: title,
|
|
1512
1512
|
onChange: (e) => setTitle(e.target.value),
|
|
1513
1513
|
className: "w-full px-3 py-2 border border-neutral-200 rounded text-sm focus:outline-none focus:border-neutral-400",
|
|
1514
1514
|
placeholder: "Post title..."
|
|
1515
|
-
}
|
|
1515
|
+
})
|
|
1516
1516
|
]
|
|
1517
|
-
}
|
|
1518
|
-
/* @__PURE__ */
|
|
1517
|
+
}),
|
|
1518
|
+
/* @__PURE__ */ jsxs6("div", {
|
|
1519
1519
|
children: [
|
|
1520
|
-
/* @__PURE__ */
|
|
1520
|
+
/* @__PURE__ */ jsx6("label", {
|
|
1521
1521
|
className: "block text-sm font-medium text-neutral-700 mb-1",
|
|
1522
1522
|
children: t("blogSlug")
|
|
1523
|
-
}
|
|
1524
|
-
/* @__PURE__ */
|
|
1523
|
+
}),
|
|
1524
|
+
/* @__PURE__ */ jsx6("input", {
|
|
1525
1525
|
type: "text",
|
|
1526
1526
|
value: slug,
|
|
1527
1527
|
onChange: (e) => setSlug(e.target.value),
|
|
1528
1528
|
className: "w-full px-3 py-2 border border-neutral-200 rounded text-sm focus:outline-none focus:border-neutral-400",
|
|
1529
1529
|
placeholder: "post-slug"
|
|
1530
|
-
}
|
|
1530
|
+
})
|
|
1531
1531
|
]
|
|
1532
|
-
}
|
|
1533
|
-
/* @__PURE__ */
|
|
1532
|
+
}),
|
|
1533
|
+
/* @__PURE__ */ jsxs6("div", {
|
|
1534
1534
|
children: [
|
|
1535
|
-
/* @__PURE__ */
|
|
1535
|
+
/* @__PURE__ */ jsx6("label", {
|
|
1536
1536
|
className: "block text-sm font-medium text-neutral-700 mb-1",
|
|
1537
1537
|
children: t("blogAuthor")
|
|
1538
|
-
}
|
|
1539
|
-
/* @__PURE__ */
|
|
1538
|
+
}),
|
|
1539
|
+
/* @__PURE__ */ jsx6("input", {
|
|
1540
1540
|
type: "text",
|
|
1541
1541
|
value: authorName,
|
|
1542
1542
|
onChange: (e) => setAuthorName(e.target.value),
|
|
1543
1543
|
className: "w-full px-3 py-2 border border-neutral-200 rounded text-sm focus:outline-none focus:border-neutral-400"
|
|
1544
|
-
}
|
|
1544
|
+
})
|
|
1545
1545
|
]
|
|
1546
|
-
}
|
|
1547
|
-
/* @__PURE__ */
|
|
1546
|
+
}),
|
|
1547
|
+
/* @__PURE__ */ jsxs6("div", {
|
|
1548
1548
|
children: [
|
|
1549
|
-
/* @__PURE__ */
|
|
1549
|
+
/* @__PURE__ */ jsx6("label", {
|
|
1550
1550
|
className: "block text-sm font-medium text-neutral-700 mb-1",
|
|
1551
1551
|
children: t("blogExcerpt")
|
|
1552
|
-
}
|
|
1553
|
-
/* @__PURE__ */
|
|
1552
|
+
}),
|
|
1553
|
+
/* @__PURE__ */ jsx6("textarea", {
|
|
1554
1554
|
value: excerpt,
|
|
1555
1555
|
onChange: (e) => setExcerpt(e.target.value),
|
|
1556
1556
|
rows: 2,
|
|
1557
1557
|
className: "w-full px-3 py-2 border border-neutral-200 rounded text-sm focus:outline-none focus:border-neutral-400 resize-none",
|
|
1558
1558
|
placeholder: "Brief summary..."
|
|
1559
|
-
}
|
|
1559
|
+
})
|
|
1560
1560
|
]
|
|
1561
|
-
}
|
|
1562
|
-
/* @__PURE__ */
|
|
1561
|
+
}),
|
|
1562
|
+
/* @__PURE__ */ jsxs6("div", {
|
|
1563
1563
|
children: [
|
|
1564
|
-
/* @__PURE__ */
|
|
1564
|
+
/* @__PURE__ */ jsx6("label", {
|
|
1565
1565
|
className: "block text-sm font-medium text-neutral-700 mb-1",
|
|
1566
1566
|
children: t("blogTags")
|
|
1567
|
-
}
|
|
1568
|
-
/* @__PURE__ */
|
|
1567
|
+
}),
|
|
1568
|
+
/* @__PURE__ */ jsx6("input", {
|
|
1569
1569
|
type: "text",
|
|
1570
1570
|
value: tagsInput,
|
|
1571
1571
|
onChange: (e) => setTagsInput(e.target.value),
|
|
1572
1572
|
className: "w-full px-3 py-2 border border-neutral-200 rounded text-sm focus:outline-none focus:border-neutral-400",
|
|
1573
1573
|
placeholder: "tag1, tag2, tag3"
|
|
1574
|
-
}
|
|
1575
|
-
/* @__PURE__ */
|
|
1574
|
+
}),
|
|
1575
|
+
/* @__PURE__ */ jsx6("p", {
|
|
1576
1576
|
className: "text-xs text-neutral-400 mt-1",
|
|
1577
1577
|
children: t("blogTagsHelp")
|
|
1578
|
-
}
|
|
1578
|
+
})
|
|
1579
1579
|
]
|
|
1580
|
-
}
|
|
1581
|
-
/* @__PURE__ */
|
|
1580
|
+
}),
|
|
1581
|
+
/* @__PURE__ */ jsxs6("div", {
|
|
1582
1582
|
children: [
|
|
1583
|
-
/* @__PURE__ */
|
|
1583
|
+
/* @__PURE__ */ jsx6("label", {
|
|
1584
1584
|
className: "block text-sm font-medium text-neutral-700 mb-1",
|
|
1585
1585
|
children: t("blogCoverImage")
|
|
1586
|
-
}
|
|
1587
|
-
coverImage ? /* @__PURE__ */
|
|
1586
|
+
}),
|
|
1587
|
+
coverImage ? /* @__PURE__ */ jsxs6("div", {
|
|
1588
1588
|
className: "relative group",
|
|
1589
1589
|
children: [
|
|
1590
|
-
/* @__PURE__ */
|
|
1590
|
+
/* @__PURE__ */ jsx6("img", {
|
|
1591
1591
|
src: coverImage,
|
|
1592
1592
|
alt: "Cover",
|
|
1593
1593
|
className: "w-full h-32 object-cover border border-neutral-200"
|
|
1594
|
-
}
|
|
1595
|
-
/* @__PURE__ */
|
|
1594
|
+
}),
|
|
1595
|
+
/* @__PURE__ */ jsxs6("div", {
|
|
1596
1596
|
className: "absolute inset-0 flex items-center justify-center gap-4 opacity-0 group-hover:opacity-100 transition-opacity bg-black/50",
|
|
1597
1597
|
children: [
|
|
1598
|
-
/* @__PURE__ */
|
|
1598
|
+
/* @__PURE__ */ jsx6("button", {
|
|
1599
1599
|
type: "button",
|
|
1600
1600
|
onClick: openImagePickerForCover,
|
|
1601
1601
|
className: "text-xs text-white border-b border-white",
|
|
1602
1602
|
children: t("replace")
|
|
1603
|
-
}
|
|
1604
|
-
/* @__PURE__ */
|
|
1603
|
+
}),
|
|
1604
|
+
/* @__PURE__ */ jsx6("button", {
|
|
1605
1605
|
type: "button",
|
|
1606
1606
|
onClick: () => setCoverImage(""),
|
|
1607
1607
|
className: "text-xs text-white/70 hover:text-white",
|
|
1608
1608
|
children: t("remove")
|
|
1609
|
-
}
|
|
1609
|
+
})
|
|
1610
1610
|
]
|
|
1611
|
-
}
|
|
1611
|
+
})
|
|
1612
1612
|
]
|
|
1613
|
-
}
|
|
1613
|
+
}) : /* @__PURE__ */ jsx6("button", {
|
|
1614
1614
|
type: "button",
|
|
1615
1615
|
onClick: openImagePickerForCover,
|
|
1616
1616
|
className: "w-full h-24 border border-dashed border-neutral-200 flex items-center justify-center text-neutral-400 text-sm hover:bg-neutral-50 transition-colors",
|
|
1617
1617
|
children: t("clickToSelectImage")
|
|
1618
|
-
}
|
|
1618
|
+
})
|
|
1619
1619
|
]
|
|
1620
|
-
}
|
|
1621
|
-
/* @__PURE__ */
|
|
1620
|
+
}),
|
|
1621
|
+
/* @__PURE__ */ jsxs6("div", {
|
|
1622
1622
|
className: "flex-1",
|
|
1623
1623
|
children: [
|
|
1624
|
-
/* @__PURE__ */
|
|
1624
|
+
/* @__PURE__ */ jsx6("label", {
|
|
1625
1625
|
className: "block text-sm font-medium text-neutral-700 mb-1",
|
|
1626
1626
|
children: t("blogContent")
|
|
1627
|
-
}
|
|
1628
|
-
/* @__PURE__ */
|
|
1627
|
+
}),
|
|
1628
|
+
/* @__PURE__ */ jsxs6("div", {
|
|
1629
1629
|
className: `border rounded overflow-hidden transition-colors ${isDragging ? "border-blue-400 bg-blue-50" : "border-neutral-200"}`,
|
|
1630
1630
|
onDragOver: handleDragOver,
|
|
1631
1631
|
onDragLeave: handleDragLeave,
|
|
1632
1632
|
onDrop: handleDrop,
|
|
1633
1633
|
children: [
|
|
1634
|
-
/* @__PURE__ */
|
|
1634
|
+
/* @__PURE__ */ jsx6(MarkdownToolbar, {
|
|
1635
1635
|
textareaRef: contentTextareaRef,
|
|
1636
1636
|
content,
|
|
1637
1637
|
setContent,
|
|
1638
1638
|
onImageClick: openImagePickerForContent,
|
|
1639
1639
|
t
|
|
1640
|
-
}
|
|
1641
|
-
/* @__PURE__ */
|
|
1640
|
+
}),
|
|
1641
|
+
/* @__PURE__ */ jsxs6("div", {
|
|
1642
1642
|
className: "relative",
|
|
1643
1643
|
children: [
|
|
1644
|
-
/* @__PURE__ */
|
|
1644
|
+
/* @__PURE__ */ jsx6("textarea", {
|
|
1645
1645
|
ref: contentTextareaRef,
|
|
1646
1646
|
value: content,
|
|
1647
1647
|
onChange: (e) => setContent(e.target.value),
|
|
1648
1648
|
rows: 12,
|
|
1649
1649
|
className: "w-full px-3 py-2 text-sm font-mono focus:outline-none resize-none border-0",
|
|
1650
1650
|
placeholder: "Write your post in Markdown..."
|
|
1651
|
-
}
|
|
1652
|
-
isDragging && /* @__PURE__ */
|
|
1651
|
+
}),
|
|
1652
|
+
isDragging && /* @__PURE__ */ jsx6("div", {
|
|
1653
1653
|
className: "absolute inset-0 flex items-center justify-center bg-blue-50/90 pointer-events-none",
|
|
1654
|
-
children: /* @__PURE__ */
|
|
1654
|
+
children: /* @__PURE__ */ jsx6("div", {
|
|
1655
1655
|
className: "text-blue-600 text-sm font-medium",
|
|
1656
1656
|
children: t("blogDropImageHere")
|
|
1657
|
-
}
|
|
1658
|
-
}
|
|
1657
|
+
})
|
|
1658
|
+
})
|
|
1659
1659
|
]
|
|
1660
|
-
}
|
|
1660
|
+
})
|
|
1661
1661
|
]
|
|
1662
|
-
}
|
|
1662
|
+
})
|
|
1663
1663
|
]
|
|
1664
|
-
}
|
|
1665
|
-
post && /* @__PURE__ */
|
|
1664
|
+
}),
|
|
1665
|
+
post && /* @__PURE__ */ jsx6("div", {
|
|
1666
1666
|
className: "pt-4 border-t border-neutral-200",
|
|
1667
|
-
children: /* @__PURE__ */
|
|
1667
|
+
children: /* @__PURE__ */ jsx6("button", {
|
|
1668
1668
|
onClick: handleDelete,
|
|
1669
1669
|
disabled: isSaving || isDeleting,
|
|
1670
1670
|
className: "text-sm text-red-600 hover:text-red-700 disabled:opacity-50",
|
|
1671
1671
|
children: isDeleting ? t("blogDeleting") : t("blogDelete")
|
|
1672
|
-
}
|
|
1673
|
-
}
|
|
1672
|
+
})
|
|
1673
|
+
})
|
|
1674
1674
|
]
|
|
1675
|
-
}
|
|
1675
|
+
})
|
|
1676
1676
|
]
|
|
1677
|
-
}
|
|
1678
|
-
/* @__PURE__ */
|
|
1677
|
+
}),
|
|
1678
|
+
/* @__PURE__ */ jsxs6("div", {
|
|
1679
1679
|
className: "w-1/2 flex flex-col bg-neutral-50 overflow-hidden",
|
|
1680
1680
|
children: [
|
|
1681
|
-
/* @__PURE__ */
|
|
1681
|
+
/* @__PURE__ */ jsx6("div", {
|
|
1682
1682
|
className: "px-4 py-2 border-b border-neutral-100 text-xs font-medium text-neutral-500 uppercase tracking-wider",
|
|
1683
1683
|
children: t("blogPreview")
|
|
1684
|
-
}
|
|
1685
|
-
/* @__PURE__ */
|
|
1684
|
+
}),
|
|
1685
|
+
/* @__PURE__ */ jsx6("div", {
|
|
1686
1686
|
className: "flex-1 overflow-y-auto",
|
|
1687
|
-
children: /* @__PURE__ */
|
|
1687
|
+
children: /* @__PURE__ */ jsx6(MarkdownPreview, {
|
|
1688
1688
|
content,
|
|
1689
1689
|
t
|
|
1690
|
-
}
|
|
1691
|
-
}
|
|
1690
|
+
})
|
|
1691
|
+
})
|
|
1692
1692
|
]
|
|
1693
|
-
}
|
|
1693
|
+
})
|
|
1694
1694
|
]
|
|
1695
|
-
}
|
|
1696
|
-
showImagePicker && /* @__PURE__ */
|
|
1695
|
+
}),
|
|
1696
|
+
showImagePicker && /* @__PURE__ */ jsx6(CmsImagePickerModal, {
|
|
1697
1697
|
storage,
|
|
1698
1698
|
onSelect: handleImageSelect,
|
|
1699
1699
|
onClose: () => setShowImagePicker(false),
|
|
1700
1700
|
currentValue: imagePickerTarget === "cover" ? coverImage : undefined
|
|
1701
|
-
}
|
|
1701
|
+
})
|
|
1702
1702
|
]
|
|
1703
|
-
}
|
|
1703
|
+
});
|
|
1704
1704
|
}
|
|
1705
1705
|
function CmsBlogAdmin({
|
|
1706
1706
|
postsEndpoint = "/api/admin/blog/posts",
|
|
@@ -1842,7 +1842,7 @@ function CmsBlogAdmin({
|
|
|
1842
1842
|
}
|
|
1843
1843
|
}
|
|
1844
1844
|
if (isEditorOpen) {
|
|
1845
|
-
return /* @__PURE__ */
|
|
1845
|
+
return /* @__PURE__ */ jsx6(BlogEditorView, {
|
|
1846
1846
|
post: selectedPost,
|
|
1847
1847
|
onBack: handleBack,
|
|
1848
1848
|
onSave: handleSave,
|
|
@@ -1850,23 +1850,23 @@ function CmsBlogAdmin({
|
|
|
1850
1850
|
storage,
|
|
1851
1851
|
defaultAuthorName,
|
|
1852
1852
|
t
|
|
1853
|
-
}
|
|
1853
|
+
});
|
|
1854
1854
|
}
|
|
1855
|
-
return /* @__PURE__ */
|
|
1855
|
+
return /* @__PURE__ */ jsxs6(Fragment2, {
|
|
1856
1856
|
children: [
|
|
1857
|
-
error && /* @__PURE__ */
|
|
1857
|
+
error && /* @__PURE__ */ jsx6("div", {
|
|
1858
1858
|
className: "px-8 py-2 bg-red-50 text-red-600 text-sm",
|
|
1859
1859
|
children: error
|
|
1860
|
-
}
|
|
1861
|
-
/* @__PURE__ */
|
|
1860
|
+
}),
|
|
1861
|
+
/* @__PURE__ */ jsx6(BlogListView, {
|
|
1862
1862
|
posts,
|
|
1863
1863
|
isLoading,
|
|
1864
1864
|
onSelectPost: handleSelectPost,
|
|
1865
1865
|
onNewPost: handleNewPost,
|
|
1866
1866
|
t
|
|
1867
|
-
}
|
|
1867
|
+
})
|
|
1868
1868
|
]
|
|
1869
|
-
}
|
|
1869
|
+
});
|
|
1870
1870
|
}
|
|
1871
1871
|
|
|
1872
1872
|
// src/admin/exports.ts
|