@carlonicora/nextjs-jsonapi 6.8.0 → 6.9.0
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/{BlockNoteEditor-D3LDTJCP.mjs → BlockNoteEditor-WN73IHXR.mjs} +4 -4
- package/dist/{BlockNoteEditor-FB6FQFRF.js → BlockNoteEditor-XXH3VBZ7.js} +19 -19
- package/dist/{BlockNoteEditor-FB6FQFRF.js.map → BlockNoteEditor-XXH3VBZ7.js.map} +1 -1
- package/dist/{BlockNoteViewer-LGFMGTYX.js → BlockNoteViewer-EKAWVLIR.js} +3 -3
- package/dist/{BlockNoteViewer-LGFMGTYX.js.map → BlockNoteViewer-EKAWVLIR.js.map} +1 -1
- package/dist/{BlockNoteViewer-YSPYUDZE.mjs → BlockNoteViewer-RWRI3QO2.mjs} +2 -2
- package/dist/{HandbookSectionInterface-BYsmnPEz.d.mts → HandbookSectionInterface-BPgqqwgw.d.mts} +20 -1
- package/dist/{HandbookSectionInterface-OePKPbqN.d.ts → HandbookSectionInterface-_51oA3om.d.ts} +20 -1
- package/dist/billing/index.js +492 -492
- package/dist/billing/index.mjs +3 -3
- package/dist/{chunk-D44UDP4G.mjs → chunk-3TNGKMJU.mjs} +2 -2
- package/dist/{chunk-VT5HRZH7.mjs → chunk-6HFRXEF5.mjs} +326 -3
- package/dist/chunk-6HFRXEF5.mjs.map +1 -0
- package/dist/{chunk-5HBFQEYU.mjs → chunk-AWLTSKMM.mjs} +2 -2
- package/dist/{chunk-TL5O7EGW.mjs → chunk-DPAM7BCE.mjs} +2 -2
- package/dist/{chunk-PSLT5JLE.js → chunk-G3YKDIAL.js} +3 -3
- package/dist/{chunk-PSLT5JLE.js.map → chunk-G3YKDIAL.js.map} +1 -1
- package/dist/{chunk-ZXK2OMCC.js → chunk-KRQRJA4J.js} +8 -8
- package/dist/{chunk-ZXK2OMCC.js.map → chunk-KRQRJA4J.js.map} +1 -1
- package/dist/{chunk-5HTX4RDA.mjs → chunk-Q4XLE3QO.mjs} +1737 -1307
- package/dist/chunk-Q4XLE3QO.mjs.map +1 -0
- package/dist/{chunk-JHT32ODN.js → chunk-RNZ3IK5J.js} +4 -4
- package/dist/{chunk-JHT32ODN.js.map → chunk-RNZ3IK5J.js.map} +1 -1
- package/dist/{chunk-UZP7KRAV.js → chunk-SQTXJPRE.js} +500 -177
- package/dist/chunk-SQTXJPRE.js.map +1 -0
- package/dist/{chunk-UT4GVYJE.js → chunk-ZCM4JLM7.js} +1380 -950
- package/dist/chunk-ZCM4JLM7.js.map +1 -0
- package/dist/client/index.js +4 -4
- package/dist/client/index.mjs +3 -3
- package/dist/components/index.d.mts +57 -3
- package/dist/components/index.d.ts +57 -3
- package/dist/components/index.js +14 -4
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +13 -3
- package/dist/contexts/index.js +4 -4
- package/dist/contexts/index.mjs +3 -3
- package/dist/core/index.d.mts +134 -3
- package/dist/core/index.d.ts +134 -3
- package/dist/core/index.js +24 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +23 -1
- package/dist/email-automations/index.d.mts +6 -1
- package/dist/email-automations/index.d.ts +6 -1
- package/dist/email-automations/index.js +101 -94
- package/dist/email-automations/index.js.map +1 -1
- package/dist/email-automations/index.mjs +12 -5
- package/dist/email-automations/index.mjs.map +1 -1
- package/dist/features/analytics/index.js +121 -121
- package/dist/features/analytics/index.mjs +4 -4
- package/dist/features/analytics/server.js +4 -4
- package/dist/features/analytics/server.mjs +2 -2
- package/dist/features/blog/index.js +150 -150
- package/dist/features/blog/index.mjs +3 -3
- package/dist/features/blog/server.js +16 -16
- package/dist/features/blog/server.mjs +1 -1
- package/dist/features/help/index.js +37 -37
- package/dist/features/help/index.mjs +3 -3
- package/dist/features/tokenusage/index.js +127 -127
- package/dist/features/tokenusage/index.mjs +4 -4
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +25 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +24 -2
- package/dist/server/index.js +3 -3
- package/dist/server/index.mjs +2 -2
- package/messages/en.json +62 -0
- package/messages/it.json +62 -0
- package/package.json +1 -1
- package/src/components/index.ts +1 -0
- package/src/core/index.ts +3 -0
- package/src/core/registry/ModuleRegistry.ts +4 -0
- package/src/features/email-automation/components/unsubscribe/EmailUnsubscribe.tsx +14 -2
- package/src/features/email-blast/EmailBlastAudienceModule.ts +12 -0
- package/src/features/email-blast/EmailBlastDeliveryModule.ts +12 -0
- package/src/features/email-blast/EmailBlastModule.ts +28 -0
- package/src/features/email-blast/components/containers/EmailBlastContainer.tsx +145 -0
- package/src/features/email-blast/components/containers/EmailBlastsListContainer.tsx +36 -0
- package/src/features/email-blast/components/forms/EmailBlastEditor.tsx +132 -0
- package/src/features/email-blast/components/forms/EmailBlastSendDialog.tsx +104 -0
- package/src/features/email-blast/components/index.ts +5 -0
- package/src/features/email-blast/components/lists/EmailBlastsList.tsx +57 -0
- package/src/features/email-blast/data/EmailBlast.ts +89 -0
- package/src/features/email-blast/data/EmailBlastAudience.ts +22 -0
- package/src/features/email-blast/data/EmailBlastAudienceInterface.ts +5 -0
- package/src/features/email-blast/data/EmailBlastDelivery.ts +36 -0
- package/src/features/email-blast/data/EmailBlastDeliveryInterface.ts +7 -0
- package/src/features/email-blast/data/EmailBlastDeliveryService.ts +25 -0
- package/src/features/email-blast/data/EmailBlastInterface.ts +22 -0
- package/src/features/email-blast/data/EmailBlastService.ts +101 -0
- package/src/features/email-blast/data/__tests__/EmailBlast.spec.ts +73 -0
- package/src/features/email-blast/data/email-blast.fields.ts +8 -0
- package/src/features/email-blast/data/email-blast.segments.ts +10 -0
- package/src/features/email-blast/data/index.ts +10 -0
- package/src/features/email-blast/hooks/useEmailBlastTableStructure.tsx +104 -0
- package/src/features/email-blast/index.ts +4 -0
- package/src/features/index.ts +1 -0
- package/dist/chunk-5HTX4RDA.mjs.map +0 -1
- package/dist/chunk-UT4GVYJE.js.map +0 -1
- package/dist/chunk-UZP7KRAV.js.map +0 -1
- package/dist/chunk-VT5HRZH7.mjs.map +0 -1
- /package/dist/{BlockNoteEditor-D3LDTJCP.mjs.map → BlockNoteEditor-WN73IHXR.mjs.map} +0 -0
- /package/dist/{BlockNoteViewer-YSPYUDZE.mjs.map → BlockNoteViewer-RWRI3QO2.mjs.map} +0 -0
- /package/dist/{chunk-D44UDP4G.mjs.map → chunk-3TNGKMJU.mjs.map} +0 -0
- /package/dist/{chunk-5HBFQEYU.mjs.map → chunk-AWLTSKMM.mjs.map} +0 -0
- /package/dist/{chunk-TL5O7EGW.mjs.map → chunk-DPAM7BCE.mjs.map} +0 -0
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
|
|
40
|
-
var
|
|
41
|
-
require('../../chunk-
|
|
40
|
+
var _chunkZCM4JLM7js = require('../../chunk-ZCM4JLM7.js');
|
|
41
|
+
require('../../chunk-KRQRJA4J.js');
|
|
42
42
|
require('../../chunk-G4JR3SFV.js');
|
|
43
43
|
|
|
44
44
|
|
|
@@ -64,7 +64,7 @@ require('../../chunk-G4JR3SFV.js');
|
|
|
64
64
|
|
|
65
65
|
|
|
66
66
|
|
|
67
|
-
var
|
|
67
|
+
var _chunkSQTXJPREjs = require('../../chunk-SQTXJPRE.js');
|
|
68
68
|
require('../../chunk-GHE4VT2R.js');
|
|
69
69
|
require('../../chunk-LXKSUWAV.js');
|
|
70
70
|
require('../../chunk-JTPRJNT2.js');
|
|
@@ -108,7 +108,7 @@ var dropzone = {
|
|
|
108
108
|
};
|
|
109
109
|
async function uploadBlogImage(params) {
|
|
110
110
|
if (!params.selection || !params.key) return;
|
|
111
|
-
await
|
|
111
|
+
await _chunkSQTXJPREjs.S3Service.upload({
|
|
112
112
|
key: params.key,
|
|
113
113
|
contentType: params.selection.contentType,
|
|
114
114
|
file: params.selection.file,
|
|
@@ -138,8 +138,8 @@ function BlogCoverImageField({
|
|
|
138
138
|
};
|
|
139
139
|
}, [previewUrl]);
|
|
140
140
|
const src = _nullishCoalesce(previewUrl, () => ( currentUrl));
|
|
141
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
142
|
-
|
|
141
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.FormFieldWrapper, { form, name: id, label, children: (field) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
142
|
+
_chunkZCM4JLM7js.FileUploader,
|
|
143
143
|
{
|
|
144
144
|
value: files,
|
|
145
145
|
onValueChange: (value) => {
|
|
@@ -152,7 +152,7 @@ function BlogCoverImageField({
|
|
|
152
152
|
},
|
|
153
153
|
dropzoneOptions: dropzone,
|
|
154
154
|
className: "w-full",
|
|
155
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
155
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.FileInput, { className: "text-muted-foreground/50 rounded-lg outline-1 outline-dashed", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex w-full flex-col items-center justify-center p-4", children: src ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
156
156
|
_image2.default,
|
|
157
157
|
{
|
|
158
158
|
src,
|
|
@@ -160,7 +160,7 @@ function BlogCoverImageField({
|
|
|
160
160
|
width: 320,
|
|
161
161
|
height: 180,
|
|
162
162
|
className: "h-auto max-h-48 w-auto max-w-full rounded-md object-cover",
|
|
163
|
-
unoptimized:
|
|
163
|
+
unoptimized: _chunkSQTXJPREjs.isRemoteImageSrc.call(void 0, previewUrl ? void 0 : currentUrl)
|
|
164
164
|
}
|
|
165
165
|
) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
166
166
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.UploadIcon, { className: "my-4 h-8 w-8" }),
|
|
@@ -186,7 +186,7 @@ function blogCategoryAdminName(category) {
|
|
|
186
186
|
}
|
|
187
187
|
_chunk7QVYU63Ejs.__name.call(void 0, blogCategoryAdminName, "blogCategoryAdminName");
|
|
188
188
|
function useBlogLanguageName() {
|
|
189
|
-
const locale =
|
|
189
|
+
const locale = _chunkSQTXJPREjs.useI18nLocale.call(void 0, );
|
|
190
190
|
const names = _react.useMemo.call(void 0, () => {
|
|
191
191
|
try {
|
|
192
192
|
return new Intl.DisplayNames([locale], { type: "language" });
|
|
@@ -205,7 +205,7 @@ function useBlogLanguageName() {
|
|
|
205
205
|
}
|
|
206
206
|
_chunk7QVYU63Ejs.__name.call(void 0, useBlogLanguageName, "useBlogLanguageName");
|
|
207
207
|
function useBlogDateFormatter() {
|
|
208
|
-
const locale =
|
|
208
|
+
const locale = _chunkSQTXJPREjs.useI18nLocale.call(void 0, );
|
|
209
209
|
return _react.useCallback.call(void 0, (date) => date ? date.toLocaleDateString(locale, { dateStyle: "medium" }) : "", [locale]);
|
|
210
210
|
}
|
|
211
211
|
_chunk7QVYU63Ejs.__name.call(void 0, useBlogDateFormatter, "useBlogDateFormatter");
|
|
@@ -214,7 +214,7 @@ function BlogTranslationStatus({ aiStatus, onRetranslate }) {
|
|
|
214
214
|
const [isRetrying, setIsRetrying] = _react.useState.call(void 0, false);
|
|
215
215
|
if (aiStatus === "completed") return null;
|
|
216
216
|
if (aiStatus === "pending" || aiStatus === "in_progress") {
|
|
217
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex items-center gap-x-2", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
217
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex items-center gap-x-2", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.Badge, { variant: "softBlue", children: [
|
|
218
218
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.LoaderCircleIcon, { className: "animate-spin" }),
|
|
219
219
|
aiStatus === "pending" ? t("blog.translation.pending") : t("blog.translation.translating")
|
|
220
220
|
] }) });
|
|
@@ -225,14 +225,14 @@ function BlogTranslationStatus({ aiStatus, onRetranslate }) {
|
|
|
225
225
|
try {
|
|
226
226
|
await onRetranslate();
|
|
227
227
|
} catch (error) {
|
|
228
|
-
|
|
228
|
+
_chunkZCM4JLM7js.errorToast.call(void 0, { title: t("common.errors.error"), error });
|
|
229
229
|
} finally {
|
|
230
230
|
setIsRetrying(false);
|
|
231
231
|
}
|
|
232
232
|
}, "retranslate");
|
|
233
233
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-2", children: [
|
|
234
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
235
|
-
onRetranslate && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
234
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Badge, { variant: "softRed", children: t("blog.translation.failed") }),
|
|
235
|
+
onRetranslate && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.Button, { type: "button", size: "sm", variant: "outline", onClick: () => void retranslate(), disabled: isRetrying, children: [
|
|
236
236
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.RotateCcwIcon, {}),
|
|
237
237
|
t("blog.actions.translateAgain")
|
|
238
238
|
] })
|
|
@@ -261,10 +261,10 @@ var sameTranslation = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (a, b
|
|
|
261
261
|
function BlogCategoryEditor({ category, trigger, onSuccess }) {
|
|
262
262
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
263
263
|
const formSchema = _react.useMemo.call(void 0, () => buildFormSchema(t), [t]);
|
|
264
|
-
const locale =
|
|
264
|
+
const locale = _chunkSQTXJPREjs.useI18nLocale.call(void 0, );
|
|
265
265
|
const languageName = useBlogLanguageName();
|
|
266
266
|
const [image, setImage] = _react.useState.call(void 0, null);
|
|
267
|
-
const languages = _react.useMemo.call(void 0, () =>
|
|
267
|
+
const languages = _react.useMemo.call(void 0, () => _chunkSQTXJPREjs.getI18nSupportedLocales.call(void 0, ), []);
|
|
268
268
|
const original = _optionalChain([category, 'optionalAccess', _6 => _6.original]);
|
|
269
269
|
const translations = _react.useMemo.call(void 0,
|
|
270
270
|
() => (_nullishCoalesce(_optionalChain([category, 'optionalAccess', _7 => _7.translations]), () => ( []))).filter((translation) => !translation.isOriginal),
|
|
@@ -293,20 +293,20 @@ function BlogCategoryEditor({ category, trigger, onSuccess }) {
|
|
|
293
293
|
defaultValues: getDefaultValues()
|
|
294
294
|
});
|
|
295
295
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
296
|
-
|
|
296
|
+
_chunkZCM4JLM7js.EditorSheet,
|
|
297
297
|
{
|
|
298
298
|
form,
|
|
299
299
|
entityType: t("blog.entities.category"),
|
|
300
300
|
entityName: _nullishCoalesce(_optionalChain([original, 'optionalAccess', _14 => _14.name]), () => ( _optionalChain([category, 'optionalAccess', _15 => _15.name]))),
|
|
301
301
|
title: category ? t("blog.admin.editCategory") : t("blog.admin.newCategory"),
|
|
302
302
|
isEdit: !!category,
|
|
303
|
-
module:
|
|
303
|
+
module: _chunkSQTXJPREjs.Modules.BlogCategory,
|
|
304
304
|
size: "md",
|
|
305
305
|
onSubmit: async (values) => {
|
|
306
306
|
if (values.image && image) await uploadBlogImage({ key: values.image, selection: image });
|
|
307
307
|
const imageKey = values.image && image ? values.image : void 0;
|
|
308
308
|
if (!category) {
|
|
309
|
-
return
|
|
309
|
+
return _chunkSQTXJPREjs.BlogCategoryService.create({
|
|
310
310
|
id: values.id,
|
|
311
311
|
originalLanguage: values.originalLanguage,
|
|
312
312
|
name: values.name,
|
|
@@ -320,7 +320,7 @@ function BlogCategoryEditor({ category, trigger, onSuccess }) {
|
|
|
320
320
|
{ id: defaults.id, name: defaults.name, slug: defaults.slug, description: defaults.description }
|
|
321
321
|
);
|
|
322
322
|
if (originalChanged) {
|
|
323
|
-
await
|
|
323
|
+
await _chunkSQTXJPREjs.BlogCategoryService.update({
|
|
324
324
|
id: values.id,
|
|
325
325
|
originalLanguage: _optionalChain([category, 'optionalAccess', _16 => _16.originalLanguage]),
|
|
326
326
|
name: values.name,
|
|
@@ -332,7 +332,7 @@ function BlogCategoryEditor({ category, trigger, onSuccess }) {
|
|
|
332
332
|
for (const translation of values.translations) {
|
|
333
333
|
const before = defaults.translations.find((candidate) => candidate.id === translation.id);
|
|
334
334
|
if (sameTranslation(translation, before)) continue;
|
|
335
|
-
await
|
|
335
|
+
await _chunkSQTXJPREjs.BlogCategoryTranslationService.update({
|
|
336
336
|
id: translation.id,
|
|
337
337
|
name: translation.name,
|
|
338
338
|
slug: translation.slug || void 0,
|
|
@@ -350,7 +350,7 @@ function BlogCategoryEditor({ category, trigger, onSuccess }) {
|
|
|
350
350
|
trigger,
|
|
351
351
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
352
352
|
!category && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
353
|
-
|
|
353
|
+
_chunkZCM4JLM7js.FormSelect,
|
|
354
354
|
{
|
|
355
355
|
form,
|
|
356
356
|
id: "originalLanguage",
|
|
@@ -359,16 +359,16 @@ function BlogCategoryEditor({ category, trigger, onSuccess }) {
|
|
|
359
359
|
isRequired: true
|
|
360
360
|
}
|
|
361
361
|
),
|
|
362
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
363
|
-
category && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
364
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
362
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.FormInput, { form, id: "name", name: t("blog.fields.name"), isRequired: true }),
|
|
363
|
+
category && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.FormInput, { form, id: "slug", name: t("blog.fields.slug"), description: t("blog.fields.slugHelp") }),
|
|
364
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.FormTextarea, { form, id: "description", name: t("blog.fields.description") }),
|
|
365
365
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
366
366
|
BlogCoverImageField,
|
|
367
367
|
{
|
|
368
368
|
form,
|
|
369
369
|
id: "image",
|
|
370
370
|
label: t("blog.fields.image"),
|
|
371
|
-
keyPrefix:
|
|
371
|
+
keyPrefix: _chunkSQTXJPREjs.BLOG_CATEGORY_UPLOAD_PREFIX,
|
|
372
372
|
entityId: form.getValues("id"),
|
|
373
373
|
currentUrl: _optionalChain([category, 'optionalAccess', _17 => _17.image]),
|
|
374
374
|
selection: image,
|
|
@@ -376,29 +376,29 @@ function BlogCategoryEditor({ category, trigger, onSuccess }) {
|
|
|
376
376
|
}
|
|
377
377
|
),
|
|
378
378
|
translations.length > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-y-2", children: [
|
|
379
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
380
|
-
translations.map((translation, index) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
381
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
379
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.SectionHeader, { className: "mt-2", children: t("blog.fields.languages") }),
|
|
380
|
+
translations.map((translation, index) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.Collapsible, { className: "rounded-md border", children: [
|
|
381
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.CollapsibleTrigger, { className: "flex w-full items-center justify-between gap-x-2 px-3 py-2 text-start", children: [
|
|
382
382
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex items-center gap-x-2 text-sm font-medium", children: [
|
|
383
383
|
languageName(translation.language),
|
|
384
384
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, BlogTranslationStatus, { aiStatus: translation.aiStatus })
|
|
385
385
|
] }),
|
|
386
386
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ChevronDownIcon, { className: "text-muted-foreground size-4" })
|
|
387
387
|
] }),
|
|
388
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
388
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.CollapsibleContent, { className: "flex flex-col gap-y-4 border-t p-3", children: [
|
|
389
389
|
translation.aiStatus === "failed" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
390
390
|
BlogTranslationStatus,
|
|
391
391
|
{
|
|
392
392
|
aiStatus: translation.aiStatus,
|
|
393
393
|
onRetranslate: async () => {
|
|
394
|
-
await
|
|
394
|
+
await _chunkSQTXJPREjs.BlogCategoryTranslationService.retranslate({ id: translation.id });
|
|
395
395
|
await _optionalChain([onSuccess, 'optionalCall', _18 => _18()]);
|
|
396
396
|
}
|
|
397
397
|
}
|
|
398
398
|
),
|
|
399
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
399
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.FormInput, { form, id: `translations.${index}.name`, name: t("blog.fields.name"), isRequired: true }),
|
|
400
400
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
401
|
-
|
|
401
|
+
_chunkZCM4JLM7js.FormInput,
|
|
402
402
|
{
|
|
403
403
|
form,
|
|
404
404
|
id: `translations.${index}.slug`,
|
|
@@ -407,7 +407,7 @@ function BlogCategoryEditor({ category, trigger, onSuccess }) {
|
|
|
407
407
|
}
|
|
408
408
|
),
|
|
409
409
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
410
|
-
|
|
410
|
+
_chunkZCM4JLM7js.FormTextarea,
|
|
411
411
|
{
|
|
412
412
|
form,
|
|
413
413
|
id: `translations.${index}.description`,
|
|
@@ -480,37 +480,37 @@ var useBlogCategoryTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call
|
|
|
480
480
|
}, [params.fields, fieldColumnMap, t, refresh]);
|
|
481
481
|
return _react.useMemo.call(void 0, () => ({ data: tableData, columns }), [tableData, columns]);
|
|
482
482
|
}, "useBlogCategoryTableStructure");
|
|
483
|
-
|
|
483
|
+
_chunkZCM4JLM7js.registerTableGenerator.call(void 0, "blog-categories", useBlogCategoryTableStructure);
|
|
484
484
|
|
|
485
485
|
// src/features/blog/components/admin/BlogCategoriesList.tsx
|
|
486
486
|
|
|
487
487
|
function BlogCategoriesList({ fullWidth } = {}) {
|
|
488
488
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
489
|
-
const data =
|
|
490
|
-
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) =>
|
|
489
|
+
const data = _chunkZCM4JLM7js.useDataListRetriever.call(void 0, {
|
|
490
|
+
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkSQTXJPREjs.BlogCategoryService.findMany(params), "retriever"),
|
|
491
491
|
retrieverParams: {},
|
|
492
|
-
module:
|
|
492
|
+
module: _chunkSQTXJPREjs.Modules.BlogCategory
|
|
493
493
|
});
|
|
494
494
|
const functions = [
|
|
495
495
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
496
496
|
BlogCategoryEditor,
|
|
497
497
|
{
|
|
498
498
|
onSuccess: data.refresh,
|
|
499
|
-
trigger: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
499
|
+
trigger: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Button, { render: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", {}), nativeButton: false, size: "sm", variant: "outline", children: t("blog.admin.newCategory") })
|
|
500
500
|
},
|
|
501
501
|
"create-blog-category"
|
|
502
502
|
)
|
|
503
503
|
];
|
|
504
504
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
505
|
-
|
|
505
|
+
_chunkZCM4JLM7js.ContentListTable,
|
|
506
506
|
{
|
|
507
507
|
data,
|
|
508
508
|
fields: ["name" /* name */, "languages" /* languages */],
|
|
509
|
-
tableGeneratorType:
|
|
509
|
+
tableGeneratorType: _chunkSQTXJPREjs.Modules.BlogCategory,
|
|
510
510
|
functions,
|
|
511
511
|
fullWidth,
|
|
512
512
|
title: t("blog.entities.categories"),
|
|
513
|
-
emptyState: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
513
|
+
emptyState: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.EmptyState, { icon: _lucidereact.TagIcon, title: t("blog.admin.emptyCategories") })
|
|
514
514
|
}
|
|
515
515
|
);
|
|
516
516
|
}
|
|
@@ -526,7 +526,7 @@ function BlogLayoutSetting() {
|
|
|
526
526
|
const [saving, setSaving] = _react.useState.call(void 0, false);
|
|
527
527
|
_react.useEffect.call(void 0, () => {
|
|
528
528
|
let active = true;
|
|
529
|
-
|
|
529
|
+
_chunkSQTXJPREjs.BlogSettingsService.get().then((settings) => {
|
|
530
530
|
if (active) setLayout(_nullishCoalesce(_optionalChain([settings, 'optionalAccess', _23 => _23.listLayout]), () => ( "featured")));
|
|
531
531
|
}).catch(() => {
|
|
532
532
|
if (active) setLayout("featured");
|
|
@@ -545,19 +545,19 @@ function BlogLayoutSetting() {
|
|
|
545
545
|
setLayout(next);
|
|
546
546
|
setSaving(true);
|
|
547
547
|
try {
|
|
548
|
-
await
|
|
549
|
-
|
|
548
|
+
await _chunkSQTXJPREjs.BlogSettingsService.save({ id: _chunkSQTXJPREjs.BLOG_SETTINGS_ID, listLayout: next });
|
|
549
|
+
_chunkSQTXJPREjs.showToast.call(void 0, t("blog.layout.saved"));
|
|
550
550
|
} catch (error) {
|
|
551
551
|
setLayout(previous);
|
|
552
|
-
|
|
552
|
+
_chunkZCM4JLM7js.errorToast.call(void 0, { title: t("common.errors.error"), error });
|
|
553
553
|
} finally {
|
|
554
554
|
setSaving(false);
|
|
555
555
|
}
|
|
556
556
|
}, "save");
|
|
557
557
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full max-w-3xl flex-col gap-y-4 p-4", children: [
|
|
558
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
558
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.SectionHeader, { children: t("blog.layout.title") }),
|
|
559
559
|
layout && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
560
|
-
|
|
560
|
+
_chunkZCM4JLM7js.RadioGroup,
|
|
561
561
|
{
|
|
562
562
|
value: layout,
|
|
563
563
|
onValueChange: (value) => {
|
|
@@ -566,13 +566,13 @@ function BlogLayoutSetting() {
|
|
|
566
566
|
},
|
|
567
567
|
disabled: saving,
|
|
568
568
|
className: "grid grid-cols-1 gap-3 md:grid-cols-3",
|
|
569
|
-
children:
|
|
569
|
+
children: _chunkSQTXJPREjs.BLOG_LIST_LAYOUTS.map((option) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
570
570
|
"label",
|
|
571
571
|
{
|
|
572
572
|
htmlFor: `blog-layout-${option}`,
|
|
573
573
|
className: "has-data-checked:border-primary flex cursor-pointer items-start gap-x-3 rounded-lg border p-4",
|
|
574
574
|
children: [
|
|
575
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
575
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.RadioGroupItem, { value: option, id: `blog-layout-${option}`, className: "mt-0.5" }),
|
|
576
576
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex flex-col gap-y-1", children: [
|
|
577
577
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-medium", children: options[option].label }),
|
|
578
578
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs/relaxed", children: options[option].description })
|
|
@@ -601,7 +601,7 @@ function useBlogCategoryNames() {
|
|
|
601
601
|
const [names, setNames] = _react.useState.call(void 0, {});
|
|
602
602
|
_react.useEffect.call(void 0, () => {
|
|
603
603
|
let cancelled = false;
|
|
604
|
-
|
|
604
|
+
_chunkSQTXJPREjs.BlogCategoryService.findMany({ fetchAll: true }).then((categories) => {
|
|
605
605
|
if (cancelled) return;
|
|
606
606
|
setNames(Object.fromEntries(categories.map((category) => [category.id, blogCategoryAdminName(category)])));
|
|
607
607
|
}).catch(() => {
|
|
@@ -618,8 +618,8 @@ _chunk7QVYU63Ejs.__name.call(void 0, useBlogCategoryNames, "useBlogCategoryNames
|
|
|
618
618
|
|
|
619
619
|
var useBlogPostTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => {
|
|
620
620
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
621
|
-
const locale =
|
|
622
|
-
const generateUrl =
|
|
621
|
+
const locale = _chunkSQTXJPREjs.useI18nLocale.call(void 0, );
|
|
622
|
+
const generateUrl = _chunkZCM4JLM7js.usePageUrlGenerator.call(void 0, );
|
|
623
623
|
const categoryName = useBlogCategoryNames();
|
|
624
624
|
const tableData = _react.useMemo.call(void 0, () => {
|
|
625
625
|
return params.data.map((post) => {
|
|
@@ -637,7 +637,7 @@ var useBlogPostTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(voi
|
|
|
637
637
|
header: t("blog.fields.title"),
|
|
638
638
|
cell: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ row }) => {
|
|
639
639
|
const post = row.original.jsonApiData;
|
|
640
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
640
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Link, { href: generateUrl({ page: _chunkSQTXJPREjs.Modules.BlogPost, id: post.id }), children: _nullishCoalesce(_nullishCoalesce(_optionalChain([post, 'access', _24 => _24.original, 'optionalAccess', _25 => _25.title]), () => ( post.title)), () => ( post.id)) });
|
|
641
641
|
}, "cell"),
|
|
642
642
|
enableSorting: false,
|
|
643
643
|
enableHiding: false
|
|
@@ -653,7 +653,7 @@ var useBlogPostTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(voi
|
|
|
653
653
|
published: t("blog.status.published"),
|
|
654
654
|
unpublished: t("blog.status.unpublished")
|
|
655
655
|
}[post.status];
|
|
656
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
656
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Badge, { variant: _nullishCoalesce(BLOG_STATUS_BADGE[post.status], () => ( "softGray")), children: _nullishCoalesce(label, () => ( post.status)) });
|
|
657
657
|
}, "cell"),
|
|
658
658
|
enableSorting: false,
|
|
659
659
|
enableHiding: false
|
|
@@ -707,7 +707,7 @@ var useBlogPostTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(voi
|
|
|
707
707
|
}, [params.fields, fieldColumnMap, t, generateUrl, locale, categoryName]);
|
|
708
708
|
return _react.useMemo.call(void 0, () => ({ data: tableData, columns }), [tableData, columns]);
|
|
709
709
|
}, "useBlogPostTableStructure");
|
|
710
|
-
|
|
710
|
+
_chunkZCM4JLM7js.registerTableGenerator.call(void 0, "blog-posts", useBlogPostTableStructure);
|
|
711
711
|
|
|
712
712
|
// src/features/blog/components/admin/BlogPostEditor.tsx
|
|
713
713
|
|
|
@@ -721,13 +721,13 @@ var isBodyEmpty = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (body) =>
|
|
|
721
721
|
function BlogPostEditor({ post, trigger, onSuccess }) {
|
|
722
722
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
723
723
|
const categoryName = useBlogCategoryNames();
|
|
724
|
-
const router =
|
|
725
|
-
const locale =
|
|
724
|
+
const router = _chunkSQTXJPREjs.useI18nRouter.call(void 0, );
|
|
725
|
+
const locale = _chunkSQTXJPREjs.useI18nLocale.call(void 0, );
|
|
726
726
|
const languageName = useBlogLanguageName();
|
|
727
727
|
const original = _optionalChain([post, 'optionalAccess', _28 => _28.original]);
|
|
728
728
|
const [cover, setCover] = _react.useState.call(void 0, null);
|
|
729
729
|
const [isBodyEmptyState, setIsBodyEmptyState] = _react.useState.call(void 0, isBodyEmpty(_optionalChain([original, 'optionalAccess', _29 => _29.body])));
|
|
730
|
-
const languages = _react.useMemo.call(void 0, () =>
|
|
730
|
+
const languages = _react.useMemo.call(void 0, () => _chunkSQTXJPREjs.getI18nSupportedLocales.call(void 0, ), []);
|
|
731
731
|
const formSchema = _react.useMemo.call(void 0,
|
|
732
732
|
() => _zod3.z.object({
|
|
733
733
|
id: _zod3.z.string().uuid(),
|
|
@@ -772,14 +772,14 @@ function BlogPostEditor({ post, trigger, onSuccess }) {
|
|
|
772
772
|
return Object.keys(dirty).length > 0;
|
|
773
773
|
}, [dirtyFields, isBodyEmptyState]);
|
|
774
774
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
775
|
-
|
|
775
|
+
_chunkZCM4JLM7js.EditorSheet,
|
|
776
776
|
{
|
|
777
777
|
form,
|
|
778
778
|
entityType: t("blog.entities.post"),
|
|
779
779
|
entityName: _optionalChain([original, 'optionalAccess', _38 => _38.title]),
|
|
780
780
|
title: post ? t("blog.admin.editPost") : t("blog.admin.newPost"),
|
|
781
781
|
isEdit: !!post,
|
|
782
|
-
module:
|
|
782
|
+
module: _chunkSQTXJPREjs.Modules.BlogPost,
|
|
783
783
|
size: "lg",
|
|
784
784
|
isFormDirty,
|
|
785
785
|
onSubmit: async (values) => {
|
|
@@ -796,13 +796,13 @@ function BlogPostEditor({ post, trigger, onSuccess }) {
|
|
|
796
796
|
categoryIds: values.categories.map((category) => category.id)
|
|
797
797
|
};
|
|
798
798
|
if (post) {
|
|
799
|
-
return
|
|
799
|
+
return _chunkSQTXJPREjs.BlogPostService.update({
|
|
800
800
|
...payload,
|
|
801
801
|
originalLanguage: post.originalLanguage,
|
|
802
802
|
slug: values.slug || void 0
|
|
803
803
|
});
|
|
804
804
|
}
|
|
805
|
-
return
|
|
805
|
+
return _chunkSQTXJPREjs.BlogPostService.create({ ...payload, originalLanguage: values.originalLanguage });
|
|
806
806
|
},
|
|
807
807
|
onReset: () => {
|
|
808
808
|
setCover(null);
|
|
@@ -814,7 +814,7 @@ function BlogPostEditor({ post, trigger, onSuccess }) {
|
|
|
814
814
|
trigger,
|
|
815
815
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex h-full min-h-0 w-full flex-col gap-y-4", children: [
|
|
816
816
|
!post && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
817
|
-
|
|
817
|
+
_chunkZCM4JLM7js.FormSelect,
|
|
818
818
|
{
|
|
819
819
|
form,
|
|
820
820
|
id: "originalLanguage",
|
|
@@ -823,24 +823,24 @@ function BlogPostEditor({ post, trigger, onSuccess }) {
|
|
|
823
823
|
isRequired: true
|
|
824
824
|
}
|
|
825
825
|
),
|
|
826
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
826
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.FormInput, { form, id: "title", name: t("blog.fields.title"), isRequired: true }),
|
|
827
827
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
|
|
828
828
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-y-4", children: [
|
|
829
|
-
post && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
829
|
+
post && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.FormInput, { form, id: "slug", name: t("blog.fields.slug"), description: t("blog.fields.slugHelp") }),
|
|
830
830
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
831
|
-
|
|
831
|
+
_chunkZCM4JLM7js.EntityMultiSelector,
|
|
832
832
|
{
|
|
833
833
|
id: "categories",
|
|
834
834
|
form,
|
|
835
835
|
label: t("blog.fields.categories"),
|
|
836
|
-
retriever: (params) =>
|
|
837
|
-
module:
|
|
836
|
+
retriever: (params) => _chunkSQTXJPREjs.BlogCategoryService.findMany(params),
|
|
837
|
+
module: _chunkSQTXJPREjs.Modules.BlogCategory,
|
|
838
838
|
getLabel: blogCategoryAdminName,
|
|
839
839
|
getFormValueLabel: (value) => value.name || categoryName(value.id)
|
|
840
840
|
}
|
|
841
841
|
),
|
|
842
842
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
843
|
-
|
|
843
|
+
_chunkZCM4JLM7js.FormTextarea,
|
|
844
844
|
{
|
|
845
845
|
form,
|
|
846
846
|
id: "summary",
|
|
@@ -857,7 +857,7 @@ function BlogPostEditor({ post, trigger, onSuccess }) {
|
|
|
857
857
|
form,
|
|
858
858
|
id: "coverImage",
|
|
859
859
|
label: t("blog.fields.coverImage"),
|
|
860
|
-
keyPrefix:
|
|
860
|
+
keyPrefix: _chunkSQTXJPREjs.BLOG_POST_UPLOAD_PREFIX,
|
|
861
861
|
entityId: form.getValues("id"),
|
|
862
862
|
currentUrl: _optionalChain([post, 'optionalAccess', _40 => _40.coverImage]),
|
|
863
863
|
alt: _optionalChain([original, 'optionalAccess', _41 => _41.coverImageAlt]),
|
|
@@ -865,13 +865,13 @@ function BlogPostEditor({ post, trigger, onSuccess }) {
|
|
|
865
865
|
onSelectionChange: setCover
|
|
866
866
|
}
|
|
867
867
|
),
|
|
868
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
868
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.FormInput, { form, id: "coverImageAlt", name: t("blog.fields.coverImageAlt") })
|
|
869
869
|
] })
|
|
870
870
|
] }),
|
|
871
871
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
872
|
-
|
|
872
|
+
_chunkZCM4JLM7js.FormBlockNote,
|
|
873
873
|
{
|
|
874
|
-
uploadKeyPrefix:
|
|
874
|
+
uploadKeyPrefix: _chunkSQTXJPREjs.BLOG_POST_UPLOAD_PREFIX,
|
|
875
875
|
form,
|
|
876
876
|
id: "body",
|
|
877
877
|
name: t("blog.fields.body"),
|
|
@@ -892,22 +892,22 @@ _chunk7QVYU63Ejs.__name.call(void 0, BlogPostEditor, "BlogPostEditor");
|
|
|
892
892
|
|
|
893
893
|
function BlogPostsList({ fullWidth } = {}) {
|
|
894
894
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
895
|
-
const data =
|
|
896
|
-
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) =>
|
|
895
|
+
const data = _chunkZCM4JLM7js.useDataListRetriever.call(void 0, {
|
|
896
|
+
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkSQTXJPREjs.BlogPostService.findMany(params), "retriever"),
|
|
897
897
|
retrieverParams: {},
|
|
898
|
-
module:
|
|
898
|
+
module: _chunkSQTXJPREjs.Modules.BlogPost
|
|
899
899
|
});
|
|
900
900
|
const functions = [
|
|
901
901
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
902
902
|
BlogPostEditor,
|
|
903
903
|
{
|
|
904
|
-
trigger: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
904
|
+
trigger: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Button, { render: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", {}), nativeButton: false, size: "sm", variant: "outline", children: t("blog.admin.newPost") })
|
|
905
905
|
},
|
|
906
906
|
"create-blog-post"
|
|
907
907
|
)
|
|
908
908
|
];
|
|
909
909
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
910
|
-
|
|
910
|
+
_chunkZCM4JLM7js.ContentListTable,
|
|
911
911
|
{
|
|
912
912
|
data,
|
|
913
913
|
fields: [
|
|
@@ -917,11 +917,11 @@ function BlogPostsList({ fullWidth } = {}) {
|
|
|
917
917
|
"publishedAt" /* publishedAt */,
|
|
918
918
|
"languages" /* languages */
|
|
919
919
|
],
|
|
920
|
-
tableGeneratorType:
|
|
920
|
+
tableGeneratorType: _chunkSQTXJPREjs.Modules.BlogPost,
|
|
921
921
|
functions,
|
|
922
922
|
fullWidth,
|
|
923
923
|
title: t("blog.entities.posts"),
|
|
924
|
-
emptyState: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
924
|
+
emptyState: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.EmptyState, { icon: _lucidereact.NewspaperIcon, title: t("blog.admin.empty") })
|
|
925
925
|
}
|
|
926
926
|
);
|
|
927
927
|
}
|
|
@@ -932,10 +932,10 @@ _chunk7QVYU63Ejs.__name.call(void 0, BlogPostsList, "BlogPostsList");
|
|
|
932
932
|
function BlogAdminContainer() {
|
|
933
933
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
934
934
|
const breadcrumbs = [{ name: t("blog.admin.title") }];
|
|
935
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
936
|
-
|
|
935
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.SharedProvider, { value: { breadcrumbs, title: { type: t("blog.admin.title") } }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
936
|
+
_chunkZCM4JLM7js.RoundPageContainer,
|
|
937
937
|
{
|
|
938
|
-
module:
|
|
938
|
+
module: _chunkSQTXJPREjs.Modules.BlogPost,
|
|
939
939
|
tabs: [
|
|
940
940
|
{ sectionKey: "posts", label: t("blog.tabs.posts"), content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BlogPostsList, {}) },
|
|
941
941
|
{ sectionKey: "categories", label: t("blog.tabs.categories"), content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BlogCategoriesList, {}) },
|
|
@@ -958,7 +958,7 @@ var BlogPostContext = _react.createContext.call(void 0, void 0);
|
|
|
958
958
|
var BlogPostProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ postId, children }) => {
|
|
959
959
|
const [post, setPost] = _react.useState.call(void 0, void 0);
|
|
960
960
|
const reload = _react.useCallback.call(void 0, async () => {
|
|
961
|
-
const loaded = await
|
|
961
|
+
const loaded = await _chunkSQTXJPREjs.BlogPostService.findOne({ id: postId });
|
|
962
962
|
setPost(loaded);
|
|
963
963
|
}, [postId]);
|
|
964
964
|
_react.useEffect.call(void 0, () => {
|
|
@@ -994,19 +994,19 @@ var useBlogPost = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
|
|
|
994
994
|
|
|
995
995
|
function BlogPostDeleter() {
|
|
996
996
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
997
|
-
const generateUrl =
|
|
997
|
+
const generateUrl = _chunkZCM4JLM7js.usePageUrlGenerator.call(void 0, );
|
|
998
998
|
const { post } = useBlogPost();
|
|
999
999
|
if (!post) return null;
|
|
1000
1000
|
const type = t("blog.entities.post");
|
|
1001
1001
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1002
|
-
|
|
1002
|
+
_chunkZCM4JLM7js.CommonDeleter,
|
|
1003
1003
|
{
|
|
1004
1004
|
title: t("common.delete.title", { type }),
|
|
1005
1005
|
subtitle: t("common.delete.subtitle", { type }),
|
|
1006
1006
|
description: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-destructive p-4 text-sm", children: t("common.delete.description", { type }) }),
|
|
1007
1007
|
showLabel: true,
|
|
1008
|
-
deleteFunction: () =>
|
|
1009
|
-
redirectTo: generateUrl({ page:
|
|
1008
|
+
deleteFunction: () => _chunkSQTXJPREjs.BlogPostService.delete({ id: post.id }),
|
|
1009
|
+
redirectTo: generateUrl({ page: _chunkSQTXJPREjs.Modules.BlogPost })
|
|
1010
1010
|
}
|
|
1011
1011
|
);
|
|
1012
1012
|
}
|
|
@@ -1026,17 +1026,17 @@ function BlogPostPublishButton() {
|
|
|
1026
1026
|
const toggle = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
|
|
1027
1027
|
setSaving(true);
|
|
1028
1028
|
try {
|
|
1029
|
-
if (isPublished) await
|
|
1030
|
-
else await
|
|
1029
|
+
if (isPublished) await _chunkSQTXJPREjs.BlogPostService.unpublish({ id: post.id });
|
|
1030
|
+
else await _chunkSQTXJPREjs.BlogPostService.publish({ id: post.id });
|
|
1031
1031
|
await reload();
|
|
1032
1032
|
} catch (error) {
|
|
1033
|
-
|
|
1033
|
+
_chunkZCM4JLM7js.errorToast.call(void 0, { title: t("common.errors.error"), error });
|
|
1034
1034
|
} finally {
|
|
1035
1035
|
setSaving(false);
|
|
1036
1036
|
}
|
|
1037
1037
|
}, "toggle");
|
|
1038
1038
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1039
|
-
|
|
1039
|
+
_chunkZCM4JLM7js.Button,
|
|
1040
1040
|
{
|
|
1041
1041
|
type: "button",
|
|
1042
1042
|
size: "sm",
|
|
@@ -1064,11 +1064,11 @@ _chunk7QVYU63Ejs.__name.call(void 0, BlogPostPublishButton, "BlogPostPublishButt
|
|
|
1064
1064
|
function BlogPostTranslationFields({ translation }) {
|
|
1065
1065
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1066
1066
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-y-4", children: [
|
|
1067
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1068
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1069
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1070
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1071
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1067
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.DetailField, { label: t("blog.fields.title"), value: translation.title }),
|
|
1068
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.DetailField, { label: t("blog.fields.slug"), value: translation.slug }),
|
|
1069
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.DetailField, { label: t("blog.fields.summary"), value: translation.summary }),
|
|
1070
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.DetailField, { label: t("blog.fields.coverImageAlt"), value: translation.coverImageAlt }),
|
|
1071
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.DetailField, { label: t("blog.fields.body"), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.BlockNoteEditorContainer, { id: translation.id, type: "blog-post", initialContent: translation.body }) })
|
|
1072
1072
|
] });
|
|
1073
1073
|
}
|
|
1074
1074
|
_chunk7QVYU63Ejs.__name.call(void 0, BlogPostTranslationFields, "BlogPostTranslationFields");
|
|
@@ -1078,15 +1078,15 @@ function BlogPostComparison({ original, translation }) {
|
|
|
1078
1078
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
|
|
1079
1079
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "bg-muted/40 flex flex-col gap-y-4 rounded-lg border p-4", children: [
|
|
1080
1080
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-2", children: [
|
|
1081
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1082
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1081
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.MicroLabel, { as: "h3", children: languageName(original.language) }),
|
|
1082
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Badge, { variant: "softGray", children: t("blog.translation.original") })
|
|
1083
1083
|
] }),
|
|
1084
1084
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, BlogPostTranslationFields, { translation: original })
|
|
1085
1085
|
] }),
|
|
1086
1086
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-y-4 rounded-lg border p-4", children: [
|
|
1087
1087
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-2", children: [
|
|
1088
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1089
|
-
translation.source === "manual" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1088
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.MicroLabel, { as: "h3", children: languageName(translation.language) }),
|
|
1089
|
+
translation.source === "manual" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Badge, { variant: "softAmber", children: t("blog.translation.editedByHand") })
|
|
1090
1090
|
] }),
|
|
1091
1091
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, BlogPostTranslationFields, { translation })
|
|
1092
1092
|
] })
|
|
@@ -1137,17 +1137,17 @@ function BlogPostTranslationEditor({ translation, trigger, onSuccess }) {
|
|
|
1137
1137
|
return Object.keys(dirty).length > 0;
|
|
1138
1138
|
}, [dirtyFields, isBodyEmptyState]);
|
|
1139
1139
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1140
|
-
|
|
1140
|
+
_chunkZCM4JLM7js.EditorSheet,
|
|
1141
1141
|
{
|
|
1142
1142
|
form,
|
|
1143
1143
|
entityType: t("blog.entities.post"),
|
|
1144
1144
|
entityName: translation.title,
|
|
1145
1145
|
title: `${t("blog.admin.editPost")} \xB7 ${languageName(translation.language)}`,
|
|
1146
1146
|
isEdit: true,
|
|
1147
|
-
module:
|
|
1147
|
+
module: _chunkSQTXJPREjs.Modules.BlogPostTranslation,
|
|
1148
1148
|
size: "lg",
|
|
1149
1149
|
isFormDirty,
|
|
1150
|
-
onSubmit: async (values) =>
|
|
1150
|
+
onSubmit: async (values) => _chunkSQTXJPREjs.BlogPostTranslationService.update({
|
|
1151
1151
|
id: values.id,
|
|
1152
1152
|
title: values.title,
|
|
1153
1153
|
slug: values.slug || void 0,
|
|
@@ -1163,18 +1163,18 @@ function BlogPostTranslationEditor({ translation, trigger, onSuccess }) {
|
|
|
1163
1163
|
}))),
|
|
1164
1164
|
trigger,
|
|
1165
1165
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex h-full min-h-0 w-full flex-col gap-y-4", children: [
|
|
1166
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1166
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.FormInput, { form, id: "title", name: t("blog.fields.title"), isRequired: true }),
|
|
1167
1167
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
|
|
1168
1168
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-y-4", children: [
|
|
1169
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1170
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1169
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.FormInput, { form, id: "slug", name: t("blog.fields.slug"), description: t("blog.fields.slugHelp") }),
|
|
1170
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.FormTextarea, { form, id: "summary", name: t("blog.fields.summary"), className: "min-h-24" })
|
|
1171
1171
|
] }),
|
|
1172
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex flex-col gap-y-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1172
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex flex-col gap-y-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.FormInput, { form, id: "coverImageAlt", name: t("blog.fields.coverImageAlt") }) })
|
|
1173
1173
|
] }),
|
|
1174
1174
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1175
|
-
|
|
1175
|
+
_chunkZCM4JLM7js.FormBlockNote,
|
|
1176
1176
|
{
|
|
1177
|
-
uploadKeyPrefix:
|
|
1177
|
+
uploadKeyPrefix: _chunkSQTXJPREjs.BLOG_POST_UPLOAD_PREFIX,
|
|
1178
1178
|
form,
|
|
1179
1179
|
id: "body",
|
|
1180
1180
|
name: t("blog.fields.body"),
|
|
@@ -1202,7 +1202,7 @@ function BlogPostTranslationPanel({ post, translation, onChanged }) {
|
|
|
1202
1202
|
const original = post.original;
|
|
1203
1203
|
const reload = _nullishCoalesce(onChanged, () => ( (async () => {
|
|
1204
1204
|
})));
|
|
1205
|
-
const editTrigger = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1205
|
+
const editTrigger = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.Button, { render: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", {}), nativeButton: false, size: "sm", variant: "outline", children: [
|
|
1206
1206
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.PencilIcon, {}),
|
|
1207
1207
|
t("blog.actions.edit")
|
|
1208
1208
|
] });
|
|
@@ -1214,7 +1214,7 @@ function BlogPostTranslationPanel({ post, translation, onChanged }) {
|
|
|
1214
1214
|
}[post.status];
|
|
1215
1215
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-6 p-4", children: [
|
|
1216
1216
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center justify-between gap-x-4", children: [
|
|
1217
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1217
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Badge, { variant: "softGray", children: t("blog.translation.original") }),
|
|
1218
1218
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, BlogPostEditor, { post, trigger: editTrigger, onSuccess: reload })
|
|
1219
1219
|
] }),
|
|
1220
1220
|
post.coverImage && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1225,14 +1225,14 @@ function BlogPostTranslationPanel({ post, translation, onChanged }) {
|
|
|
1225
1225
|
width: 640,
|
|
1226
1226
|
height: 360,
|
|
1227
1227
|
className: "h-auto max-h-72 w-auto rounded-lg object-cover",
|
|
1228
|
-
unoptimized:
|
|
1228
|
+
unoptimized: _chunkSQTXJPREjs.isRemoteImageSrc.call(void 0, post.coverImage)
|
|
1229
1229
|
}
|
|
1230
1230
|
),
|
|
1231
1231
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-1 gap-4 md:grid-cols-3", children: [
|
|
1232
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1233
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1232
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.DetailField, { label: t("blog.fields.status"), value: statusLabel }),
|
|
1233
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.DetailField, { label: t("blog.fields.publishedAt"), value: formatDate(post.publishedAt) || "\u2014" }),
|
|
1234
1234
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1235
|
-
|
|
1235
|
+
_chunkZCM4JLM7js.DetailField,
|
|
1236
1236
|
{
|
|
1237
1237
|
label: t("blog.fields.categories"),
|
|
1238
1238
|
value: post.categories.map((category) => categoryName(category.id)).filter(Boolean).join(", ") || "\u2014"
|
|
@@ -1244,16 +1244,16 @@ function BlogPostTranslationPanel({ post, translation, onChanged }) {
|
|
|
1244
1244
|
}
|
|
1245
1245
|
const isWorking = translation.aiStatus === "pending" || translation.aiStatus === "in_progress";
|
|
1246
1246
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-6 p-4", children: [
|
|
1247
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1247
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Alert, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.AlertDescription, { className: "flex flex-col gap-y-2", children: [
|
|
1248
1248
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
1249
|
-
translation.source === "manual" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1249
|
+
translation.source === "manual" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Badge, { variant: "softAmber", children: t("blog.translation.editedByHand") }),
|
|
1250
1250
|
original && translation.translatedAt && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: t("blog.translation.translatedFrom", {
|
|
1251
1251
|
language: languageName(original.language),
|
|
1252
1252
|
date: formatDate(translation.translatedAt)
|
|
1253
1253
|
}) })
|
|
1254
1254
|
] }),
|
|
1255
1255
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: t("blog.translation.overwriteWarning") }),
|
|
1256
|
-
original && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1256
|
+
original && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Button, { type: "button", size: "sm", variant: "ghost", onClick: () => setIsComparing((value) => !value), children: isComparing ? t("blog.actions.hideComparison") : t("blog.actions.compareWithOriginal") }) })
|
|
1257
1257
|
] }) }),
|
|
1258
1258
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center justify-between gap-x-4", children: [
|
|
1259
1259
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1261,7 +1261,7 @@ function BlogPostTranslationPanel({ post, translation, onChanged }) {
|
|
|
1261
1261
|
{
|
|
1262
1262
|
aiStatus: translation.aiStatus,
|
|
1263
1263
|
onRetranslate: async () => {
|
|
1264
|
-
await
|
|
1264
|
+
await _chunkSQTXJPREjs.BlogPostTranslationService.retranslate({ id: translation.id });
|
|
1265
1265
|
await reload();
|
|
1266
1266
|
}
|
|
1267
1267
|
}
|
|
@@ -1281,7 +1281,7 @@ function BlogPostContainer({ postId }) {
|
|
|
1281
1281
|
_chunk7QVYU63Ejs.__name.call(void 0, BlogPostContainer, "BlogPostContainer");
|
|
1282
1282
|
function BlogPostShell() {
|
|
1283
1283
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1284
|
-
const generateUrl =
|
|
1284
|
+
const generateUrl = _chunkZCM4JLM7js.usePageUrlGenerator.call(void 0, );
|
|
1285
1285
|
const languageName = useBlogLanguageName();
|
|
1286
1286
|
const { post, reload } = useBlogPost();
|
|
1287
1287
|
const translations = _react.useMemo.call(void 0, () => {
|
|
@@ -1294,7 +1294,7 @@ function BlogPostShell() {
|
|
|
1294
1294
|
if (!post) return null;
|
|
1295
1295
|
const title = _nullishCoalesce(_nullishCoalesce(_optionalChain([post, 'access', _44 => _44.original, 'optionalAccess', _45 => _45.title]), () => ( post.title)), () => ( ""));
|
|
1296
1296
|
const breadcrumbs = [
|
|
1297
|
-
{ name: t("blog.admin.title"), href: generateUrl({ page:
|
|
1297
|
+
{ name: t("blog.admin.title"), href: generateUrl({ page: _chunkSQTXJPREjs.Modules.BlogPost }) },
|
|
1298
1298
|
{ name: title }
|
|
1299
1299
|
];
|
|
1300
1300
|
const statusLabel = {
|
|
@@ -1311,7 +1311,7 @@ function BlogPostShell() {
|
|
|
1311
1311
|
return parts.join(" \xB7 ");
|
|
1312
1312
|
}, "tabLabel");
|
|
1313
1313
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1314
|
-
|
|
1314
|
+
_chunkZCM4JLM7js.SharedProvider,
|
|
1315
1315
|
{
|
|
1316
1316
|
value: {
|
|
1317
1317
|
breadcrumbs,
|
|
@@ -1319,16 +1319,16 @@ function BlogPostShell() {
|
|
|
1319
1319
|
type: t("blog.admin.title"),
|
|
1320
1320
|
element: title,
|
|
1321
1321
|
functions: [
|
|
1322
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1322
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Badge, { variant: BLOG_STATUS_BADGE[post.status], children: statusLabel }, "blogPostStatus"),
|
|
1323
1323
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, BlogPostPublishButton, {}, "blogPostPublish"),
|
|
1324
1324
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, BlogPostDeleter, {}, "blogPostDeleter")
|
|
1325
1325
|
]
|
|
1326
1326
|
}
|
|
1327
1327
|
},
|
|
1328
1328
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1329
|
-
|
|
1329
|
+
_chunkZCM4JLM7js.RoundPageContainer,
|
|
1330
1330
|
{
|
|
1331
|
-
module:
|
|
1331
|
+
module: _chunkSQTXJPREjs.Modules.BlogPost,
|
|
1332
1332
|
id: post.id,
|
|
1333
1333
|
forceHeader: true,
|
|
1334
1334
|
tabs: translations.map((translation) => ({
|
|
@@ -1390,10 +1390,10 @@ function BlogCategoryChips(props) {
|
|
|
1390
1390
|
];
|
|
1391
1391
|
const inactiveVariant = variant === "chips" ? "outline" : "ghost";
|
|
1392
1392
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "nav", { "aria-label": t("blog.entities.categories"), className, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "ul", { className: variant === "chips" ? "flex flex-wrap items-center gap-2" : "flex flex-col items-start gap-2", children: items.map((item) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "li", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1393
|
-
|
|
1393
|
+
_chunkZCM4JLM7js.Badge,
|
|
1394
1394
|
{
|
|
1395
1395
|
variant: item.active ? "default" : inactiveVariant,
|
|
1396
|
-
render: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1396
|
+
render: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Link, { href: item.href, "aria-current": item.active ? "page" : void 0 }),
|
|
1397
1397
|
children: item.label
|
|
1398
1398
|
}
|
|
1399
1399
|
) }, item.key)) }) });
|
|
@@ -1408,12 +1408,12 @@ function BlogListHeader(props) {
|
|
|
1408
1408
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1409
1409
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "header", { className: align === "center" ? "text-center" : void 0, children: [
|
|
1410
1410
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1411
|
-
|
|
1411
|
+
_chunkZCM4JLM7js.ContentTitle,
|
|
1412
1412
|
{
|
|
1413
1413
|
type: t("blog.public.eyebrow"),
|
|
1414
1414
|
element: t("blog.public.title"),
|
|
1415
1415
|
headingLevel: 1,
|
|
1416
|
-
className:
|
|
1416
|
+
className: _chunkSQTXJPREjs.cn.call(void 0, "mb-0", align === "center" && "[&_div]:justify-center")
|
|
1417
1417
|
}
|
|
1418
1418
|
),
|
|
1419
1419
|
showSubtitle ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground mt-3 text-sm leading-relaxed", children: t("blog.public.subtitle") }) : null
|
|
@@ -1422,18 +1422,18 @@ function BlogListHeader(props) {
|
|
|
1422
1422
|
_chunk7QVYU63Ejs.__name.call(void 0, BlogListHeader, "BlogListHeader");
|
|
1423
1423
|
function BlogListEmpty(props) {
|
|
1424
1424
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1425
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className:
|
|
1425
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: _chunkSQTXJPREjs.cn.call(void 0, "text-muted-foreground py-12 text-center text-sm", props.className), children: props.query ? t("blog.public.noResults") : t("blog.public.empty") });
|
|
1426
1426
|
}
|
|
1427
1427
|
_chunk7QVYU63Ejs.__name.call(void 0, BlogListEmpty, "BlogListEmpty");
|
|
1428
1428
|
function BlogLoadMore(props) {
|
|
1429
1429
|
const { basePath, page, activeCategorySlug, query, className } = props;
|
|
1430
1430
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1431
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className:
|
|
1432
|
-
|
|
1431
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: _chunkSQTXJPREjs.cn.call(void 0, "flex justify-center", className), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1432
|
+
_chunkZCM4JLM7js.Link,
|
|
1433
1433
|
{
|
|
1434
1434
|
href: blogListHref(basePath, { category: activeCategorySlug, q: query, page: page + 1 }),
|
|
1435
1435
|
scroll: false,
|
|
1436
|
-
className:
|
|
1436
|
+
className: _chunkZCM4JLM7js.buttonVariants.call(void 0, { variant: "outline" }),
|
|
1437
1437
|
children: t("blog.public.loadMore")
|
|
1438
1438
|
}
|
|
1439
1439
|
) });
|
|
@@ -1460,7 +1460,7 @@ function BlogPostMeta(props) {
|
|
|
1460
1460
|
parts.push(t("blog.public.updated", { date: format.dateTime(new Date(post.updatedAt), { dateStyle: "medium" }) }));
|
|
1461
1461
|
}
|
|
1462
1462
|
parts.push(t("blog.public.readingTime", { minutes: post.readingMinutes }));
|
|
1463
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className:
|
|
1463
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: _chunkSQTXJPREjs.cn.call(void 0, "text-muted-foreground text-xs", className), children: parts.map((part, index) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { children: [
|
|
1464
1464
|
index > 0 ? " \xB7 " : null,
|
|
1465
1465
|
part
|
|
1466
1466
|
] }, index)) });
|
|
@@ -1471,7 +1471,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, BlogPostMeta, "BlogPostMeta");
|
|
|
1471
1471
|
|
|
1472
1472
|
function BlogPostCover(props) {
|
|
1473
1473
|
const { src, alt, sizes, priority, className } = props;
|
|
1474
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className:
|
|
1474
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: _chunkSQTXJPREjs.cn.call(void 0, "border-border bg-primary/10 relative overflow-hidden rounded-lg border", className), children: src ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1475
1475
|
_image2.default,
|
|
1476
1476
|
{
|
|
1477
1477
|
src,
|
|
@@ -1480,7 +1480,7 @@ function BlogPostCover(props) {
|
|
|
1480
1480
|
sizes,
|
|
1481
1481
|
priority,
|
|
1482
1482
|
className: "object-cover",
|
|
1483
|
-
unoptimized:
|
|
1483
|
+
unoptimized: _chunkSQTXJPREjs.isRemoteImageSrc.call(void 0, src)
|
|
1484
1484
|
}
|
|
1485
1485
|
) : null });
|
|
1486
1486
|
}
|
|
@@ -1491,8 +1491,8 @@ function BlogPostCard(props) {
|
|
|
1491
1491
|
const isProminent = variant === "hero" || variant === "large";
|
|
1492
1492
|
const eyebrow = _optionalChain([category, 'optionalAccess', _46 => _46.name]);
|
|
1493
1493
|
const text = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex min-w-0 flex-col", children: [
|
|
1494
|
-
eyebrow ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1495
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1494
|
+
eyebrow ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.MicroLabel, { as: "span", children: eyebrow }) : null,
|
|
1495
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.SectionHeader, { level: headingLevel === "h3" ? 3 : 2, className: "mt-1.5", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Link, { href: blogPostHref(basePath, post.slug), className: "after:absolute after:inset-0", children: post.title }) }),
|
|
1496
1496
|
post.summary ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground mt-2 text-sm leading-relaxed", children: post.summary }) : null,
|
|
1497
1497
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, BlogPostMeta, { post, showAuthor: isProminent, className: "mt-3" })
|
|
1498
1498
|
] });
|
|
@@ -1550,7 +1550,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, BlogPostCard, "BlogPostCard");
|
|
|
1550
1550
|
function BlogSearchBox(props) {
|
|
1551
1551
|
const { basePath, query, activeCategorySlug, className } = props;
|
|
1552
1552
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1553
|
-
const router =
|
|
1553
|
+
const router = _chunkSQTXJPREjs.useI18nRouter.call(void 0, );
|
|
1554
1554
|
const [value, setValue] = _react.useState.call(void 0, _nullishCoalesce(query, () => ( "")));
|
|
1555
1555
|
_react.useEffect.call(void 0, () => setValue(_nullishCoalesce(query, () => ( ""))), [query]);
|
|
1556
1556
|
const onSubmit = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (event) => {
|
|
@@ -1558,10 +1558,10 @@ function BlogSearchBox(props) {
|
|
|
1558
1558
|
const q = value.trim();
|
|
1559
1559
|
router.push(blogListHref(basePath, { category: activeCategorySlug, q: q || void 0 }));
|
|
1560
1560
|
}, "onSubmit");
|
|
1561
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "form", { role: "search", onSubmit, className, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1562
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1561
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "form", { role: "search", onSubmit, className, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.InputGroup, { children: [
|
|
1562
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.InputGroupAddon, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.SearchIcon, {}) }),
|
|
1563
1563
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1564
|
-
|
|
1564
|
+
_chunkZCM4JLM7js.InputGroupInput,
|
|
1565
1565
|
{
|
|
1566
1566
|
type: "search",
|
|
1567
1567
|
name: "q",
|
|
@@ -1673,7 +1673,7 @@ function BlogListRail(props) {
|
|
|
1673
1673
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, BlogListHeader, { showSubtitle: false }),
|
|
1674
1674
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, BlogSearchBox, { basePath, query, activeCategorySlug }),
|
|
1675
1675
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
|
|
1676
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1676
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.MicroLabel, { as: "span", className: "block", children: t("blog.entities.categories") }),
|
|
1677
1677
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1678
1678
|
BlogCategoryChips,
|
|
1679
1679
|
{
|
|
@@ -1731,12 +1731,12 @@ function BlogPostView(props) {
|
|
|
1731
1731
|
const more = related.slice(0, 3);
|
|
1732
1732
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "article", { className: "px-4 pt-12 pb-20 md:pt-16", children: [
|
|
1733
1733
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mx-auto max-w-3xl", children: [
|
|
1734
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1734
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.Link, { href: basePath, className: "inline-flex items-center gap-1.5", children: [
|
|
1735
1735
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ArrowLeftIcon, { className: "size-4 rtl:rotate-180" }),
|
|
1736
1736
|
t("blog.public.back")
|
|
1737
1737
|
] }),
|
|
1738
1738
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "header", { className: "mt-8", children: [
|
|
1739
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1739
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.ContentTitle, { type: _optionalChain([category, 'optionalAccess', _47 => _47.name]), element: post.title, headingLevel: 1, className: "mb-0" }),
|
|
1740
1740
|
post.summary ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground mt-3 text-sm leading-relaxed", children: post.summary }) : null,
|
|
1741
1741
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, BlogPostMeta, { post, showAuthor: true, className: "mt-4" })
|
|
1742
1742
|
] }),
|
|
@@ -1750,10 +1750,10 @@ function BlogPostView(props) {
|
|
|
1750
1750
|
className: "mt-8 aspect-[16/9]"
|
|
1751
1751
|
}
|
|
1752
1752
|
) : null,
|
|
1753
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mt-8", children: _nullishCoalesce(body, () => ( /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1753
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mt-8", children: _nullishCoalesce(body, () => ( /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.BlockNoteEditorContainer, { id: post.id, type: "blog-post", initialContent: post.body }))) })
|
|
1754
1754
|
] }),
|
|
1755
1755
|
more.length > 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "section", { className: "mx-auto mt-16 max-w-5xl", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "border-border border-t pt-10", children: [
|
|
1756
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1756
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.SectionHeader, { level: 2, children: t("blog.public.moreIn", { category: _nullishCoalesce(_optionalChain([category, 'optionalAccess', _48 => _48.name]), () => ( "")) }) }),
|
|
1757
1757
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mt-6 grid gap-x-6 gap-y-10 sm:grid-cols-2 lg:grid-cols-3", children: more.map((relatedPost) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1758
1758
|
BlogPostCard,
|
|
1759
1759
|
{
|
|
@@ -1806,5 +1806,5 @@ _chunk7QVYU63Ejs.__name.call(void 0, BlogPostView, "BlogPostView");
|
|
|
1806
1806
|
|
|
1807
1807
|
|
|
1808
1808
|
|
|
1809
|
-
exports.BLOG_ACTION =
|
|
1809
|
+
exports.BLOG_ACTION = _chunkSQTXJPREjs.BLOG_ACTION; exports.BLOG_CATEGORY_UPLOAD_PREFIX = _chunkSQTXJPREjs.BLOG_CATEGORY_UPLOAD_PREFIX; exports.BLOG_LIST_LAYOUTS = _chunkSQTXJPREjs.BLOG_LIST_LAYOUTS; exports.BLOG_MODULE_ID = _chunkSQTXJPREjs.BLOG_MODULE_ID; exports.BLOG_POST_STATUSES = _chunkSQTXJPREjs.BLOG_POST_STATUSES; exports.BLOG_POST_UPLOAD_PREFIX = _chunkSQTXJPREjs.BLOG_POST_UPLOAD_PREFIX; exports.BLOG_PUBLIC_PREFIX = _chunkSQTXJPREjs.BLOG_PUBLIC_PREFIX; exports.BLOG_SETTINGS_ID = _chunkSQTXJPREjs.BLOG_SETTINGS_ID; exports.BLOG_STATUS_BADGE = BLOG_STATUS_BADGE; exports.BLOG_TRANSLATION_SOURCES = _chunkSQTXJPREjs.BLOG_TRANSLATION_SOURCES; exports.BLOG_UPLOAD_ROOT = _chunkSQTXJPREjs.BLOG_UPLOAD_ROOT; exports.BlogAdminContainer = BlogAdminContainer; exports.BlogCategoriesList = BlogCategoriesList; exports.BlogCategoryEditor = BlogCategoryEditor; exports.BlogCoverImageField = BlogCoverImageField; exports.BlogLayoutSetting = BlogLayoutSetting; exports.BlogList = BlogList; exports.BlogPostComparison = BlogPostComparison; exports.BlogPostContainer = BlogPostContainer; exports.BlogPostDeleter = BlogPostDeleter; exports.BlogPostEditor = BlogPostEditor; exports.BlogPostProvider = BlogPostProvider; exports.BlogPostPublishButton = BlogPostPublishButton; exports.BlogPostTranslationEditor = BlogPostTranslationEditor; exports.BlogPostTranslationFields = BlogPostTranslationFields; exports.BlogPostTranslationPanel = BlogPostTranslationPanel; exports.BlogPostView = BlogPostView; exports.BlogPostsList = BlogPostsList; exports.BlogTranslationStatus = BlogTranslationStatus; exports.blogCategoryAdminName = blogCategoryAdminName; exports.uploadBlogImage = uploadBlogImage; exports.useBlogCategoryNames = useBlogCategoryNames; exports.useBlogCategoryTableStructure = useBlogCategoryTableStructure; exports.useBlogDateFormatter = useBlogDateFormatter; exports.useBlogLanguageName = useBlogLanguageName; exports.useBlogPost = useBlogPost; exports.useBlogPostTableStructure = useBlogPostTableStructure;
|
|
1810
1810
|
//# sourceMappingURL=index.js.map
|