@carlonicora/nextjs-jsonapi 6.12.1 → 6.13.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/{ApiData-DPKNfY-9.d.mts → ApiData-Be8yxCOX.d.mts} +2 -0
- package/dist/{ApiData-DPKNfY-9.d.ts → ApiData-Be8yxCOX.d.ts} +2 -0
- package/dist/{BlockNoteEditor-N2NBYCPC.mjs → BlockNoteEditor-22Q4DJBU.mjs} +20 -8
- package/dist/BlockNoteEditor-22Q4DJBU.mjs.map +1 -0
- package/dist/{BlockNoteEditor-CBYKEXAQ.js → BlockNoteEditor-2VLPSEKS.js} +34 -22
- package/dist/BlockNoteEditor-2VLPSEKS.js.map +1 -0
- package/dist/{BlockNoteViewer-WGCDB7IJ.js → BlockNoteViewer-2XYASA5Y.js} +8 -5
- package/dist/BlockNoteViewer-2XYASA5Y.js.map +1 -0
- package/dist/{BlockNoteViewer-MTGS6YJV.mjs → BlockNoteViewer-NBW2H6LC.mjs} +7 -4
- package/dist/{BlockNoteViewer-MTGS6YJV.mjs.map → BlockNoteViewer-NBW2H6LC.mjs.map} +1 -1
- package/dist/{JsonApiRequest-A66XK5WT.mjs → JsonApiRequest-F6TMJ42G.mjs} +2 -2
- package/dist/JsonApiRequest-WISJZSDE.js +26 -0
- package/dist/{JsonApiRequest-FZGPLNUF.js.map → JsonApiRequest-WISJZSDE.js.map} +1 -1
- package/dist/billing/index.js +499 -494
- package/dist/billing/index.js.map +1 -1
- package/dist/billing/index.mjs +13 -8
- package/dist/billing/index.mjs.map +1 -1
- package/dist/chunk-27LQDGNP.mjs +317 -0
- package/dist/chunk-27LQDGNP.mjs.map +1 -0
- package/dist/{chunk-6NZKWIOR.js → chunk-2H342HNN.js} +956 -929
- package/dist/chunk-2H342HNN.js.map +1 -0
- package/dist/{chunk-KSYQEKJX.js → chunk-2SV4SS6N.js} +14 -14
- package/dist/{chunk-KSYQEKJX.js.map → chunk-2SV4SS6N.js.map} +1 -1
- package/dist/{chunk-4FNGWALA.mjs → chunk-47BBY5KA.mjs} +6 -4
- package/dist/{chunk-4FNGWALA.mjs.map → chunk-47BBY5KA.mjs.map} +1 -1
- package/dist/chunk-6JUCIWDC.mjs +570 -0
- package/dist/chunk-6JUCIWDC.mjs.map +1 -0
- package/dist/chunk-7DBJTNSU.mjs +1049 -0
- package/dist/chunk-7DBJTNSU.mjs.map +1 -0
- package/dist/chunk-7JZHPMGW.mjs +704 -0
- package/dist/chunk-7JZHPMGW.mjs.map +1 -0
- package/dist/{chunk-L6PYFQTO.js → chunk-7ZHTPFFT.js} +16 -14
- package/dist/chunk-7ZHTPFFT.js.map +1 -0
- package/dist/chunk-B6JGKDP2.js +214 -0
- package/dist/chunk-B6JGKDP2.js.map +1 -0
- package/dist/{chunk-3YW35YHQ.mjs → chunk-BH6JWIKI.mjs} +5 -5
- package/dist/chunk-BZ5J2FIV.js +570 -0
- package/dist/chunk-BZ5J2FIV.js.map +1 -0
- package/dist/{chunk-V5MI7RNB.mjs → chunk-DGWOVYEC.mjs} +2 -2
- package/dist/chunk-DOCIFE6A.mjs +212 -0
- package/dist/chunk-DOCIFE6A.mjs.map +1 -0
- package/dist/chunk-GB6DBFYY.js +25 -0
- package/dist/chunk-GB6DBFYY.js.map +1 -0
- package/dist/{chunk-6XJOQFCP.mjs → chunk-H4NLDX5G.mjs} +59 -32
- package/dist/chunk-H4NLDX5G.mjs.map +1 -0
- package/dist/{chunk-EWCY6QJA.mjs → chunk-JJMMT24D.mjs} +37 -3
- package/dist/chunk-JJMMT24D.mjs.map +1 -0
- package/dist/{chunk-JTPRJNT2.js → chunk-KMW7UNL2.js} +38 -3
- package/dist/chunk-KMW7UNL2.js.map +1 -0
- package/dist/chunk-MHB36MYE.js +317 -0
- package/dist/chunk-MHB36MYE.js.map +1 -0
- package/dist/{chunk-FF4EIQ6H.js → chunk-MOGEGWXW.js} +1039 -1680
- package/dist/chunk-MOGEGWXW.js.map +1 -0
- package/dist/{chunk-AA52ORW2.mjs → chunk-P445QGOC.mjs} +61 -702
- package/dist/chunk-P445QGOC.mjs.map +1 -0
- package/dist/chunk-PV4Z5W6V.js +212 -0
- package/dist/chunk-PV4Z5W6V.js.map +1 -0
- package/dist/chunk-PXDUJ47N.js +1049 -0
- package/dist/chunk-PXDUJ47N.js.map +1 -0
- package/dist/{chunk-GHE4VT2R.js → chunk-QKNGZDSQ.js} +2 -2
- package/dist/{chunk-GHE4VT2R.js.map → chunk-QKNGZDSQ.js.map} +1 -1
- package/dist/chunk-W62MHDWM.js +704 -0
- package/dist/chunk-W62MHDWM.js.map +1 -0
- package/dist/chunk-XXP3TQHF.mjs +25 -0
- package/dist/chunk-XXP3TQHF.mjs.map +1 -0
- package/dist/chunk-YRKIFYOE.mjs +214 -0
- package/dist/chunk-YRKIFYOE.mjs.map +1 -0
- package/dist/{chunk-O3PDL2CV.js → chunk-Z4POQWFG.js} +40 -6
- package/dist/chunk-Z4POQWFG.js.map +1 -0
- package/dist/{chunk-PI56A4DG.mjs → chunk-ZLTOUZN2.mjs} +37 -2
- package/dist/chunk-ZLTOUZN2.mjs.map +1 -0
- package/dist/client/index.d.mts +2 -2
- package/dist/client/index.d.ts +2 -2
- package/dist/client/index.js +14 -9
- package/dist/client/index.js.map +1 -1
- package/dist/client/index.mjs +24 -19
- package/dist/components/index.d.mts +7 -1
- package/dist/components/index.d.ts +7 -1
- package/dist/components/index.js +11 -7
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +10 -6
- package/dist/contexts/index.d.mts +1 -1
- package/dist/contexts/index.d.ts +1 -1
- package/dist/contexts/index.js +11 -7
- package/dist/contexts/index.js.map +1 -1
- package/dist/contexts/index.mjs +10 -6
- package/dist/core/index.d.mts +128 -2
- package/dist/core/index.d.ts +128 -2
- package/dist/core/index.js +17 -4
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +22 -9
- package/dist/email-automations/index.js +101 -96
- package/dist/email-automations/index.js.map +1 -1
- package/dist/email-automations/index.mjs +13 -8
- package/dist/email-automations/index.mjs.map +1 -1
- package/dist/features/analytics/index.js +128 -123
- package/dist/features/analytics/index.js.map +1 -1
- package/dist/features/analytics/index.mjs +13 -8
- package/dist/features/analytics/index.mjs.map +1 -1
- package/dist/features/analytics/server.js +11 -8
- package/dist/features/analytics/server.js.map +1 -1
- package/dist/features/analytics/server.mjs +9 -6
- package/dist/features/analytics/server.mjs.map +1 -1
- package/dist/features/blog/index.js +158 -153
- package/dist/features/blog/index.js.map +1 -1
- package/dist/features/blog/index.mjs +14 -9
- package/dist/features/blog/index.mjs.map +1 -1
- package/dist/features/blog/server.js +30 -26
- package/dist/features/blog/server.js.map +1 -1
- package/dist/features/blog/server.mjs +10 -6
- package/dist/features/blog/server.mjs.map +1 -1
- package/dist/features/help/index.js +44 -40
- package/dist/features/help/index.js.map +1 -1
- package/dist/features/help/index.mjs +10 -6
- package/dist/features/help/index.mjs.map +1 -1
- package/dist/features/tokenusage/index.js +134 -129
- package/dist/features/tokenusage/index.js.map +1 -1
- package/dist/features/tokenusage/index.mjs +13 -8
- package/dist/features/tokenusage/index.mjs.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +18 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +24 -11
- package/dist/lifecycle-4GUOTB46.js +23 -0
- package/dist/lifecycle-4GUOTB46.js.map +1 -0
- package/dist/lifecycle-LKGPRBS7.mjs +23 -0
- package/dist/local-transport-7H3SPZSA.js +15 -0
- package/dist/local-transport-7H3SPZSA.js.map +1 -0
- package/dist/local-transport-QYFKA6AN.mjs +15 -0
- package/dist/local-transport-QYFKA6AN.mjs.map +1 -0
- package/dist/offline/index.d.mts +607 -0
- package/dist/offline/index.d.ts +607 -0
- package/dist/offline/index.js +1052 -0
- package/dist/offline/index.js.map +1 -0
- package/dist/offline/index.mjs +1052 -0
- package/dist/offline/index.mjs.map +1 -0
- package/dist/offline/sqlite/device-worker.mjs +62 -0
- package/dist/offline/sqlite/index.mjs +17392 -0
- package/dist/offline/sqlite/sqlite3-opfs-async-proxy.js +881 -0
- package/dist/offline/sqlite/sqlite3.wasm +0 -0
- package/dist/request-KTBV6HHH.js +10 -0
- package/dist/request-KTBV6HHH.js.map +1 -0
- package/dist/request-SQOUNWZ4.mjs +10 -0
- package/dist/request-SQOUNWZ4.mjs.map +1 -0
- package/dist/server/cachedGet.d.mts +1 -1
- package/dist/server/cachedGet.d.ts +1 -1
- package/dist/server/cachedGet.stub.d.mts +1 -1
- package/dist/server/cachedGet.stub.d.ts +1 -1
- package/dist/server/index.d.mts +28 -2
- package/dist/server/index.d.ts +28 -2
- package/dist/server/index.js +18 -8
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +18 -8
- package/dist/{useSocket-IRHtk2xc.d.ts → useSocket-Bo9M0t0J.d.ts} +3 -1
- package/dist/{useSocket-C8fqU4od.d.mts → useSocket-J5qanQPN.d.mts} +3 -1
- package/dist/write-through-FDQ7N4YI.js +15 -0
- package/dist/write-through-FDQ7N4YI.js.map +1 -0
- package/dist/write-through-R25VQMH6.mjs +15 -0
- package/dist/write-through-R25VQMH6.mjs.map +1 -0
- package/package.json +7 -1
- package/pwa/sw.js +277 -26
- package/src/client/request.ts +37 -0
- package/src/components/containers/RoundPageContainer.tsx +8 -8
- package/src/components/editors/BlockNoteEditor.tsx +14 -0
- package/src/components/editors/__tests__/BlockNoteEditor.empty-change.spec.tsx +205 -0
- package/src/contexts/SocketContext.tsx +7 -1
- package/src/contexts/__tests__/SocketContext.session.spec.tsx +52 -5
- package/src/core/factories/RehydrationFactory.ts +28 -8
- package/src/core/factories/__tests__/RehydrationFactory.spec.ts +33 -0
- package/src/core/index.ts +3 -0
- package/src/core/interfaces/ApiData.ts +2 -0
- package/src/core/registry/ModuleRegistry.ts +3 -0
- package/src/features/auth/components/forms/Logout.tsx +8 -1
- package/src/features/auth/components/forms/__tests__/Logout.spec.tsx +62 -0
- package/src/hooks/__tests__/useSocket.pause.spec.ts +39 -0
- package/src/hooks/useSocket.ts +20 -1
- package/src/offline/__tests__/answer-builders.spec.ts +176 -0
- package/src/offline/__tests__/device-switch.spec.ts +179 -0
- package/src/offline/__tests__/generic-answers.spec.ts +380 -0
- package/src/offline/__tests__/local-transport.spec.ts +150 -0
- package/src/offline/__tests__/logout.spec.ts +122 -0
- package/src/offline/__tests__/offline-fixtures.ts +89 -0
- package/src/offline/__tests__/router.spec.ts +56 -0
- package/src/offline/__tests__/state.spec.ts +62 -0
- package/src/offline/__tests__/write-through.spec.ts +137 -0
- package/src/offline/config.ts +229 -0
- package/src/offline/configure.ts +14 -0
- package/src/offline/device-switch.ts +75 -0
- package/src/offline/generic-answers.ts +706 -0
- package/src/offline/index.ts +67 -0
- package/src/offline/local-transport.ts +189 -0
- package/src/offline/logout.ts +41 -0
- package/src/offline/router.ts +41 -0
- package/src/offline/server/__tests__/build-offline-manifest.spec.ts +76 -0
- package/src/offline/server/build-offline-manifest.ts +49 -0
- package/src/offline/state-hooks.ts +10 -0
- package/src/offline/state.ts +143 -0
- package/src/offline/store/DeviceStore.ts +112 -0
- package/src/offline/store/__tests__/device-store-lifecycle.spec.ts +343 -0
- package/src/offline/store/__tests__/shared-database.spec.ts +151 -0
- package/src/offline/store/__tests__/sql-device-store.spec.ts +399 -0
- package/src/offline/store/lifecycle.ts +315 -0
- package/src/offline/store/schema.ts +101 -0
- package/src/offline/store/shared-database.ts +321 -0
- package/src/offline/store/sql-device-store.ts +469 -0
- package/src/offline/store/worker-client.ts +71 -0
- package/src/offline/store/worker.ts +87 -0
- package/src/offline/sync/__tests__/conflicts.spec.ts +185 -0
- package/src/offline/sync/__tests__/queue-drain.spec.ts +364 -0
- package/src/offline/sync/__tests__/runtime.spec.ts +337 -0
- package/src/offline/sync/__tests__/sync-fixtures.ts +103 -0
- package/src/offline/sync/__tests__/sync-root.spec.ts +727 -0
- package/src/offline/sync/artwork-cache.ts +67 -0
- package/src/offline/sync/conflicts.ts +211 -0
- package/src/offline/sync/counts.ts +39 -0
- package/src/offline/sync/drain-queue.ts +246 -0
- package/src/offline/sync/known-roots.ts +37 -0
- package/src/offline/sync/models/OfflineChangeSet.ts +34 -0
- package/src/offline/sync/models/OfflineChangeSetInterface.ts +54 -0
- package/src/offline/sync/models/RootSync.ts +68 -0
- package/src/offline/sync/models/RootSyncInterface.ts +20 -0
- package/src/offline/sync/models/__tests__/OfflineChangeSet.spec.ts +47 -0
- package/src/offline/sync/models/__tests__/RootSync.spec.ts +54 -0
- package/src/offline/sync/models/index.ts +5 -0
- package/src/offline/sync/models/offline.modules.ts +14 -0
- package/src/offline/sync/runtime.ts +226 -0
- package/src/offline/sync/session-refresh.ts +32 -0
- package/src/offline/sync/sync-root.ts +336 -0
- package/src/offline/sync/waiting.ts +40 -0
- package/src/offline/types.ts +115 -0
- package/src/offline/write-through.ts +189 -0
- package/src/pwa/__tests__/sw.spec.ts +358 -1
- package/src/server/index.ts +5 -0
- package/src/unified/__tests__/JsonApiRequest.offline.spec.ts +243 -0
- package/dist/BlockNoteEditor-CBYKEXAQ.js.map +0 -1
- package/dist/BlockNoteEditor-N2NBYCPC.mjs.map +0 -1
- package/dist/BlockNoteViewer-WGCDB7IJ.js.map +0 -1
- package/dist/JsonApiRequest-FZGPLNUF.js +0 -26
- package/dist/chunk-6NZKWIOR.js.map +0 -1
- package/dist/chunk-6XJOQFCP.mjs.map +0 -1
- package/dist/chunk-AA52ORW2.mjs.map +0 -1
- package/dist/chunk-EWCY6QJA.mjs.map +0 -1
- package/dist/chunk-FF4EIQ6H.js.map +0 -1
- package/dist/chunk-JTPRJNT2.js.map +0 -1
- package/dist/chunk-L6PYFQTO.js.map +0 -1
- package/dist/chunk-O3PDL2CV.js.map +0 -1
- package/dist/chunk-PI56A4DG.mjs.map +0 -1
- package/dist/request-5RLK2AM3.mjs +0 -9
- package/dist/request-EUGTI3BE.js +0 -9
- package/dist/request-EUGTI3BE.js.map +0 -1
- /package/dist/{JsonApiRequest-A66XK5WT.mjs.map → JsonApiRequest-F6TMJ42G.mjs.map} +0 -0
- /package/dist/{chunk-3YW35YHQ.mjs.map → chunk-BH6JWIKI.mjs.map} +0 -0
- /package/dist/{chunk-V5MI7RNB.mjs.map → chunk-DGWOVYEC.mjs.map} +0 -0
- /package/dist/{request-5RLK2AM3.mjs.map → lifecycle-LKGPRBS7.mjs.map} +0 -0
|
@@ -37,8 +37,9 @@
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
|
|
40
|
-
var
|
|
41
|
-
require('../../chunk-
|
|
40
|
+
var _chunk2H342HNNjs = require('../../chunk-2H342HNN.js');
|
|
41
|
+
require('../../chunk-3EPNHTMH.js');
|
|
42
|
+
require('../../chunk-7ZHTPFFT.js');
|
|
42
43
|
require('../../chunk-G4JR3SFV.js');
|
|
43
44
|
|
|
44
45
|
|
|
@@ -60,15 +61,19 @@ require('../../chunk-G4JR3SFV.js');
|
|
|
60
61
|
|
|
61
62
|
|
|
62
63
|
|
|
64
|
+
var _chunkMOGEGWXWjs = require('../../chunk-MOGEGWXW.js');
|
|
65
|
+
require('../../chunk-GB6DBFYY.js');
|
|
66
|
+
|
|
63
67
|
|
|
64
68
|
|
|
65
69
|
|
|
66
70
|
|
|
67
|
-
var
|
|
68
|
-
require('../../chunk-
|
|
71
|
+
var _chunkBZ5J2FIVjs = require('../../chunk-BZ5J2FIV.js');
|
|
72
|
+
require('../../chunk-PV4Z5W6V.js');
|
|
73
|
+
require('../../chunk-KMW7UNL2.js');
|
|
74
|
+
require('../../chunk-MHB36MYE.js');
|
|
75
|
+
require('../../chunk-QKNGZDSQ.js');
|
|
69
76
|
require('../../chunk-LXKSUWAV.js');
|
|
70
|
-
require('../../chunk-JTPRJNT2.js');
|
|
71
|
-
require('../../chunk-3EPNHTMH.js');
|
|
72
77
|
|
|
73
78
|
|
|
74
79
|
var _chunk7QVYU63Ejs = require('../../chunk-7QVYU63E.js');
|
|
@@ -108,7 +113,7 @@ var dropzone = {
|
|
|
108
113
|
};
|
|
109
114
|
async function uploadBlogImage(params) {
|
|
110
115
|
if (!params.selection || !params.key) return;
|
|
111
|
-
await
|
|
116
|
+
await _chunkMOGEGWXWjs.S3Service.upload({
|
|
112
117
|
key: params.key,
|
|
113
118
|
contentType: params.selection.contentType,
|
|
114
119
|
file: params.selection.file,
|
|
@@ -138,8 +143,8 @@ function BlogCoverImageField({
|
|
|
138
143
|
};
|
|
139
144
|
}, [previewUrl]);
|
|
140
145
|
const src = _nullishCoalesce(previewUrl, () => ( currentUrl));
|
|
141
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
142
|
-
|
|
146
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.FormFieldWrapper, { form, name: id, label, children: (field) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
147
|
+
_chunk2H342HNNjs.FileUploader,
|
|
143
148
|
{
|
|
144
149
|
value: files,
|
|
145
150
|
onValueChange: (value) => {
|
|
@@ -152,7 +157,7 @@ function BlogCoverImageField({
|
|
|
152
157
|
},
|
|
153
158
|
dropzoneOptions: dropzone,
|
|
154
159
|
className: "w-full",
|
|
155
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
160
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.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
161
|
_image2.default,
|
|
157
162
|
{
|
|
158
163
|
src,
|
|
@@ -160,7 +165,7 @@ function BlogCoverImageField({
|
|
|
160
165
|
width: 320,
|
|
161
166
|
height: 180,
|
|
162
167
|
className: "h-auto max-h-48 w-auto max-w-full rounded-md object-cover",
|
|
163
|
-
unoptimized:
|
|
168
|
+
unoptimized: _chunkMOGEGWXWjs.isRemoteImageSrc.call(void 0, previewUrl ? void 0 : currentUrl)
|
|
164
169
|
}
|
|
165
170
|
) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
166
171
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.UploadIcon, { className: "my-4 h-8 w-8" }),
|
|
@@ -186,7 +191,7 @@ function blogCategoryAdminName(category) {
|
|
|
186
191
|
}
|
|
187
192
|
_chunk7QVYU63Ejs.__name.call(void 0, blogCategoryAdminName, "blogCategoryAdminName");
|
|
188
193
|
function useBlogLanguageName() {
|
|
189
|
-
const locale =
|
|
194
|
+
const locale = _chunkBZ5J2FIVjs.useI18nLocale.call(void 0, );
|
|
190
195
|
const names = _react.useMemo.call(void 0, () => {
|
|
191
196
|
try {
|
|
192
197
|
return new Intl.DisplayNames([locale], { type: "language" });
|
|
@@ -205,7 +210,7 @@ function useBlogLanguageName() {
|
|
|
205
210
|
}
|
|
206
211
|
_chunk7QVYU63Ejs.__name.call(void 0, useBlogLanguageName, "useBlogLanguageName");
|
|
207
212
|
function useBlogDateFormatter() {
|
|
208
|
-
const locale =
|
|
213
|
+
const locale = _chunkBZ5J2FIVjs.useI18nLocale.call(void 0, );
|
|
209
214
|
return _react.useCallback.call(void 0, (date) => date ? date.toLocaleDateString(locale, { dateStyle: "medium" }) : "", [locale]);
|
|
210
215
|
}
|
|
211
216
|
_chunk7QVYU63Ejs.__name.call(void 0, useBlogDateFormatter, "useBlogDateFormatter");
|
|
@@ -214,7 +219,7 @@ function BlogTranslationStatus({ aiStatus, onRetranslate }) {
|
|
|
214
219
|
const [isRetrying, setIsRetrying] = _react.useState.call(void 0, false);
|
|
215
220
|
if (aiStatus === "completed") return null;
|
|
216
221
|
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,
|
|
222
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex items-center gap-x-2", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2H342HNNjs.Badge, { variant: "softBlue", children: [
|
|
218
223
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.LoaderCircleIcon, { className: "animate-spin" }),
|
|
219
224
|
aiStatus === "pending" ? t("blog.translation.pending") : t("blog.translation.translating")
|
|
220
225
|
] }) });
|
|
@@ -225,14 +230,14 @@ function BlogTranslationStatus({ aiStatus, onRetranslate }) {
|
|
|
225
230
|
try {
|
|
226
231
|
await onRetranslate();
|
|
227
232
|
} catch (error) {
|
|
228
|
-
|
|
233
|
+
_chunk2H342HNNjs.errorToast.call(void 0, { title: t("common.errors.error"), error });
|
|
229
234
|
} finally {
|
|
230
235
|
setIsRetrying(false);
|
|
231
236
|
}
|
|
232
237
|
}, "retranslate");
|
|
233
238
|
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,
|
|
239
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.Badge, { variant: "softRed", children: t("blog.translation.failed") }),
|
|
240
|
+
onRetranslate && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2H342HNNjs.Button, { type: "button", size: "sm", variant: "outline", onClick: () => void retranslate(), disabled: isRetrying, children: [
|
|
236
241
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.RotateCcwIcon, {}),
|
|
237
242
|
t("blog.actions.translateAgain")
|
|
238
243
|
] })
|
|
@@ -261,10 +266,10 @@ var sameTranslation = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (a, b
|
|
|
261
266
|
function BlogCategoryEditor({ category, trigger, onSuccess }) {
|
|
262
267
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
263
268
|
const formSchema = _react.useMemo.call(void 0, () => buildFormSchema(t), [t]);
|
|
264
|
-
const locale =
|
|
269
|
+
const locale = _chunkBZ5J2FIVjs.useI18nLocale.call(void 0, );
|
|
265
270
|
const languageName = useBlogLanguageName();
|
|
266
271
|
const [image, setImage] = _react.useState.call(void 0, null);
|
|
267
|
-
const languages = _react.useMemo.call(void 0, () =>
|
|
272
|
+
const languages = _react.useMemo.call(void 0, () => _chunkBZ5J2FIVjs.getI18nSupportedLocales.call(void 0, ), []);
|
|
268
273
|
const original = _optionalChain([category, 'optionalAccess', _6 => _6.original]);
|
|
269
274
|
const translations = _react.useMemo.call(void 0,
|
|
270
275
|
() => (_nullishCoalesce(_optionalChain([category, 'optionalAccess', _7 => _7.translations]), () => ( []))).filter((translation) => !translation.isOriginal),
|
|
@@ -293,20 +298,20 @@ function BlogCategoryEditor({ category, trigger, onSuccess }) {
|
|
|
293
298
|
defaultValues: getDefaultValues()
|
|
294
299
|
});
|
|
295
300
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
296
|
-
|
|
301
|
+
_chunk2H342HNNjs.EditorSheet,
|
|
297
302
|
{
|
|
298
303
|
form,
|
|
299
304
|
entityType: t("blog.entities.category"),
|
|
300
305
|
entityName: _nullishCoalesce(_optionalChain([original, 'optionalAccess', _14 => _14.name]), () => ( _optionalChain([category, 'optionalAccess', _15 => _15.name]))),
|
|
301
306
|
title: category ? t("blog.admin.editCategory") : t("blog.admin.newCategory"),
|
|
302
307
|
isEdit: !!category,
|
|
303
|
-
module:
|
|
308
|
+
module: _chunkBZ5J2FIVjs.Modules.BlogCategory,
|
|
304
309
|
size: "md",
|
|
305
310
|
onSubmit: async (values) => {
|
|
306
311
|
if (values.image && image) await uploadBlogImage({ key: values.image, selection: image });
|
|
307
312
|
const imageKey = values.image && image ? values.image : void 0;
|
|
308
313
|
if (!category) {
|
|
309
|
-
return
|
|
314
|
+
return _chunkMOGEGWXWjs.BlogCategoryService.create({
|
|
310
315
|
id: values.id,
|
|
311
316
|
originalLanguage: values.originalLanguage,
|
|
312
317
|
name: values.name,
|
|
@@ -320,7 +325,7 @@ function BlogCategoryEditor({ category, trigger, onSuccess }) {
|
|
|
320
325
|
{ id: defaults.id, name: defaults.name, slug: defaults.slug, description: defaults.description }
|
|
321
326
|
);
|
|
322
327
|
if (originalChanged) {
|
|
323
|
-
await
|
|
328
|
+
await _chunkMOGEGWXWjs.BlogCategoryService.update({
|
|
324
329
|
id: values.id,
|
|
325
330
|
originalLanguage: _optionalChain([category, 'optionalAccess', _16 => _16.originalLanguage]),
|
|
326
331
|
name: values.name,
|
|
@@ -332,7 +337,7 @@ function BlogCategoryEditor({ category, trigger, onSuccess }) {
|
|
|
332
337
|
for (const translation of values.translations) {
|
|
333
338
|
const before = defaults.translations.find((candidate) => candidate.id === translation.id);
|
|
334
339
|
if (sameTranslation(translation, before)) continue;
|
|
335
|
-
await
|
|
340
|
+
await _chunkMOGEGWXWjs.BlogCategoryTranslationService.update({
|
|
336
341
|
id: translation.id,
|
|
337
342
|
name: translation.name,
|
|
338
343
|
slug: translation.slug || void 0,
|
|
@@ -350,7 +355,7 @@ function BlogCategoryEditor({ category, trigger, onSuccess }) {
|
|
|
350
355
|
trigger,
|
|
351
356
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
352
357
|
!category && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
353
|
-
|
|
358
|
+
_chunk2H342HNNjs.FormSelect,
|
|
354
359
|
{
|
|
355
360
|
form,
|
|
356
361
|
id: "originalLanguage",
|
|
@@ -359,16 +364,16 @@ function BlogCategoryEditor({ category, trigger, onSuccess }) {
|
|
|
359
364
|
isRequired: true
|
|
360
365
|
}
|
|
361
366
|
),
|
|
362
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
363
|
-
category && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
364
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
367
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.FormInput, { form, id: "name", name: t("blog.fields.name"), isRequired: true }),
|
|
368
|
+
category && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.FormInput, { form, id: "slug", name: t("blog.fields.slug"), description: t("blog.fields.slugHelp") }),
|
|
369
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.FormTextarea, { form, id: "description", name: t("blog.fields.description") }),
|
|
365
370
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
366
371
|
BlogCoverImageField,
|
|
367
372
|
{
|
|
368
373
|
form,
|
|
369
374
|
id: "image",
|
|
370
375
|
label: t("blog.fields.image"),
|
|
371
|
-
keyPrefix:
|
|
376
|
+
keyPrefix: _chunkMOGEGWXWjs.BLOG_CATEGORY_UPLOAD_PREFIX,
|
|
372
377
|
entityId: form.getValues("id"),
|
|
373
378
|
currentUrl: _optionalChain([category, 'optionalAccess', _17 => _17.image]),
|
|
374
379
|
selection: image,
|
|
@@ -376,29 +381,29 @@ function BlogCategoryEditor({ category, trigger, onSuccess }) {
|
|
|
376
381
|
}
|
|
377
382
|
),
|
|
378
383
|
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,
|
|
384
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.SectionHeader, { className: "mt-2", children: t("blog.fields.languages") }),
|
|
385
|
+
translations.map((translation, index) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2H342HNNjs.Collapsible, { className: "rounded-md border", children: [
|
|
386
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2H342HNNjs.CollapsibleTrigger, { className: "flex w-full items-center justify-between gap-x-2 px-3 py-2 text-start", children: [
|
|
382
387
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex items-center gap-x-2 text-sm font-medium", children: [
|
|
383
388
|
languageName(translation.language),
|
|
384
389
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, BlogTranslationStatus, { aiStatus: translation.aiStatus })
|
|
385
390
|
] }),
|
|
386
391
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ChevronDownIcon, { className: "text-muted-foreground size-4" })
|
|
387
392
|
] }),
|
|
388
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
393
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2H342HNNjs.CollapsibleContent, { className: "flex flex-col gap-y-4 border-t p-3", children: [
|
|
389
394
|
translation.aiStatus === "failed" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
390
395
|
BlogTranslationStatus,
|
|
391
396
|
{
|
|
392
397
|
aiStatus: translation.aiStatus,
|
|
393
398
|
onRetranslate: async () => {
|
|
394
|
-
await
|
|
399
|
+
await _chunkMOGEGWXWjs.BlogCategoryTranslationService.retranslate({ id: translation.id });
|
|
395
400
|
await _optionalChain([onSuccess, 'optionalCall', _18 => _18()]);
|
|
396
401
|
}
|
|
397
402
|
}
|
|
398
403
|
),
|
|
399
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
404
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.FormInput, { form, id: `translations.${index}.name`, name: t("blog.fields.name"), isRequired: true }),
|
|
400
405
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
401
|
-
|
|
406
|
+
_chunk2H342HNNjs.FormInput,
|
|
402
407
|
{
|
|
403
408
|
form,
|
|
404
409
|
id: `translations.${index}.slug`,
|
|
@@ -407,7 +412,7 @@ function BlogCategoryEditor({ category, trigger, onSuccess }) {
|
|
|
407
412
|
}
|
|
408
413
|
),
|
|
409
414
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
410
|
-
|
|
415
|
+
_chunk2H342HNNjs.FormTextarea,
|
|
411
416
|
{
|
|
412
417
|
form,
|
|
413
418
|
id: `translations.${index}.description`,
|
|
@@ -480,37 +485,37 @@ var useBlogCategoryTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call
|
|
|
480
485
|
}, [params.fields, fieldColumnMap, t, refresh]);
|
|
481
486
|
return _react.useMemo.call(void 0, () => ({ data: tableData, columns }), [tableData, columns]);
|
|
482
487
|
}, "useBlogCategoryTableStructure");
|
|
483
|
-
|
|
488
|
+
_chunk2H342HNNjs.registerTableGenerator.call(void 0, "blog-categories", useBlogCategoryTableStructure);
|
|
484
489
|
|
|
485
490
|
// src/features/blog/components/admin/BlogCategoriesList.tsx
|
|
486
491
|
|
|
487
492
|
function BlogCategoriesList({ fullWidth } = {}) {
|
|
488
493
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
489
|
-
const data =
|
|
490
|
-
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) =>
|
|
494
|
+
const data = _chunk2H342HNNjs.useDataListRetriever.call(void 0, {
|
|
495
|
+
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkMOGEGWXWjs.BlogCategoryService.findMany(params), "retriever"),
|
|
491
496
|
retrieverParams: {},
|
|
492
|
-
module:
|
|
497
|
+
module: _chunkBZ5J2FIVjs.Modules.BlogCategory
|
|
493
498
|
});
|
|
494
499
|
const functions = [
|
|
495
500
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
496
501
|
BlogCategoryEditor,
|
|
497
502
|
{
|
|
498
503
|
onSuccess: data.refresh,
|
|
499
|
-
trigger: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
504
|
+
trigger: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.Button, { render: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", {}), nativeButton: false, size: "sm", variant: "outline", children: t("blog.admin.newCategory") })
|
|
500
505
|
},
|
|
501
506
|
"create-blog-category"
|
|
502
507
|
)
|
|
503
508
|
];
|
|
504
509
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
505
|
-
|
|
510
|
+
_chunk2H342HNNjs.ContentListTable,
|
|
506
511
|
{
|
|
507
512
|
data,
|
|
508
513
|
fields: ["name" /* name */, "languages" /* languages */],
|
|
509
|
-
tableGeneratorType:
|
|
514
|
+
tableGeneratorType: _chunkBZ5J2FIVjs.Modules.BlogCategory,
|
|
510
515
|
functions,
|
|
511
516
|
fullWidth,
|
|
512
517
|
title: t("blog.entities.categories"),
|
|
513
|
-
emptyState: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
518
|
+
emptyState: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.EmptyState, { icon: _lucidereact.TagIcon, title: t("blog.admin.emptyCategories") })
|
|
514
519
|
}
|
|
515
520
|
);
|
|
516
521
|
}
|
|
@@ -526,7 +531,7 @@ function BlogLayoutSetting() {
|
|
|
526
531
|
const [saving, setSaving] = _react.useState.call(void 0, false);
|
|
527
532
|
_react.useEffect.call(void 0, () => {
|
|
528
533
|
let active = true;
|
|
529
|
-
|
|
534
|
+
_chunkMOGEGWXWjs.BlogSettingsService.get().then((settings) => {
|
|
530
535
|
if (active) setLayout(_nullishCoalesce(_optionalChain([settings, 'optionalAccess', _23 => _23.listLayout]), () => ( "featured")));
|
|
531
536
|
}).catch(() => {
|
|
532
537
|
if (active) setLayout("featured");
|
|
@@ -545,19 +550,19 @@ function BlogLayoutSetting() {
|
|
|
545
550
|
setLayout(next);
|
|
546
551
|
setSaving(true);
|
|
547
552
|
try {
|
|
548
|
-
await
|
|
549
|
-
|
|
553
|
+
await _chunkMOGEGWXWjs.BlogSettingsService.save({ id: _chunkMOGEGWXWjs.BLOG_SETTINGS_ID, listLayout: next });
|
|
554
|
+
_chunkMOGEGWXWjs.showToast.call(void 0, t("blog.layout.saved"));
|
|
550
555
|
} catch (error) {
|
|
551
556
|
setLayout(previous);
|
|
552
|
-
|
|
557
|
+
_chunk2H342HNNjs.errorToast.call(void 0, { title: t("common.errors.error"), error });
|
|
553
558
|
} finally {
|
|
554
559
|
setSaving(false);
|
|
555
560
|
}
|
|
556
561
|
}, "save");
|
|
557
562
|
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,
|
|
563
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.SectionHeader, { children: t("blog.layout.title") }),
|
|
559
564
|
layout && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
560
|
-
|
|
565
|
+
_chunk2H342HNNjs.RadioGroup,
|
|
561
566
|
{
|
|
562
567
|
value: layout,
|
|
563
568
|
onValueChange: (value) => {
|
|
@@ -566,13 +571,13 @@ function BlogLayoutSetting() {
|
|
|
566
571
|
},
|
|
567
572
|
disabled: saving,
|
|
568
573
|
className: "grid grid-cols-1 gap-3 md:grid-cols-3",
|
|
569
|
-
children:
|
|
574
|
+
children: _chunkMOGEGWXWjs.BLOG_LIST_LAYOUTS.map((option) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
570
575
|
"label",
|
|
571
576
|
{
|
|
572
577
|
htmlFor: `blog-layout-${option}`,
|
|
573
578
|
className: "has-data-checked:border-primary flex cursor-pointer items-start gap-x-3 rounded-lg border p-4",
|
|
574
579
|
children: [
|
|
575
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
580
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.RadioGroupItem, { value: option, id: `blog-layout-${option}`, className: "mt-0.5" }),
|
|
576
581
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex flex-col gap-y-1", children: [
|
|
577
582
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-medium", children: options[option].label }),
|
|
578
583
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs/relaxed", children: options[option].description })
|
|
@@ -601,7 +606,7 @@ function useBlogCategoryNames() {
|
|
|
601
606
|
const [names, setNames] = _react.useState.call(void 0, {});
|
|
602
607
|
_react.useEffect.call(void 0, () => {
|
|
603
608
|
let cancelled = false;
|
|
604
|
-
|
|
609
|
+
_chunkMOGEGWXWjs.BlogCategoryService.findMany({ fetchAll: true }).then((categories) => {
|
|
605
610
|
if (cancelled) return;
|
|
606
611
|
setNames(Object.fromEntries(categories.map((category) => [category.id, blogCategoryAdminName(category)])));
|
|
607
612
|
}).catch(() => {
|
|
@@ -618,8 +623,8 @@ _chunk7QVYU63Ejs.__name.call(void 0, useBlogCategoryNames, "useBlogCategoryNames
|
|
|
618
623
|
|
|
619
624
|
var useBlogPostTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => {
|
|
620
625
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
621
|
-
const locale =
|
|
622
|
-
const generateUrl =
|
|
626
|
+
const locale = _chunkBZ5J2FIVjs.useI18nLocale.call(void 0, );
|
|
627
|
+
const generateUrl = _chunk2H342HNNjs.usePageUrlGenerator.call(void 0, );
|
|
623
628
|
const categoryName = useBlogCategoryNames();
|
|
624
629
|
const tableData = _react.useMemo.call(void 0, () => {
|
|
625
630
|
return params.data.map((post) => {
|
|
@@ -637,7 +642,7 @@ var useBlogPostTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(voi
|
|
|
637
642
|
header: t("blog.fields.title"),
|
|
638
643
|
cell: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ row }) => {
|
|
639
644
|
const post = row.original.jsonApiData;
|
|
640
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
645
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.Link, { href: generateUrl({ page: _chunkBZ5J2FIVjs.Modules.BlogPost, id: post.id }), children: _nullishCoalesce(_nullishCoalesce(_optionalChain([post, 'access', _24 => _24.original, 'optionalAccess', _25 => _25.title]), () => ( post.title)), () => ( post.id)) });
|
|
641
646
|
}, "cell"),
|
|
642
647
|
enableSorting: false,
|
|
643
648
|
enableHiding: false
|
|
@@ -653,7 +658,7 @@ var useBlogPostTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(voi
|
|
|
653
658
|
published: t("blog.status.published"),
|
|
654
659
|
unpublished: t("blog.status.unpublished")
|
|
655
660
|
}[post.status];
|
|
656
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
661
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.Badge, { variant: _nullishCoalesce(BLOG_STATUS_BADGE[post.status], () => ( "softGray")), children: _nullishCoalesce(label, () => ( post.status)) });
|
|
657
662
|
}, "cell"),
|
|
658
663
|
enableSorting: false,
|
|
659
664
|
enableHiding: false
|
|
@@ -707,7 +712,7 @@ var useBlogPostTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(voi
|
|
|
707
712
|
}, [params.fields, fieldColumnMap, t, generateUrl, locale, categoryName]);
|
|
708
713
|
return _react.useMemo.call(void 0, () => ({ data: tableData, columns }), [tableData, columns]);
|
|
709
714
|
}, "useBlogPostTableStructure");
|
|
710
|
-
|
|
715
|
+
_chunk2H342HNNjs.registerTableGenerator.call(void 0, "blog-posts", useBlogPostTableStructure);
|
|
711
716
|
|
|
712
717
|
// src/features/blog/components/admin/BlogPostEditor.tsx
|
|
713
718
|
|
|
@@ -721,13 +726,13 @@ var isBodyEmpty = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (body) =>
|
|
|
721
726
|
function BlogPostEditor({ post, trigger, onSuccess }) {
|
|
722
727
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
723
728
|
const categoryName = useBlogCategoryNames();
|
|
724
|
-
const router =
|
|
725
|
-
const locale =
|
|
729
|
+
const router = _chunkBZ5J2FIVjs.useI18nRouter.call(void 0, );
|
|
730
|
+
const locale = _chunkBZ5J2FIVjs.useI18nLocale.call(void 0, );
|
|
726
731
|
const languageName = useBlogLanguageName();
|
|
727
732
|
const original = _optionalChain([post, 'optionalAccess', _28 => _28.original]);
|
|
728
733
|
const [cover, setCover] = _react.useState.call(void 0, null);
|
|
729
734
|
const [isBodyEmptyState, setIsBodyEmptyState] = _react.useState.call(void 0, isBodyEmpty(_optionalChain([original, 'optionalAccess', _29 => _29.body])));
|
|
730
|
-
const languages = _react.useMemo.call(void 0, () =>
|
|
735
|
+
const languages = _react.useMemo.call(void 0, () => _chunkBZ5J2FIVjs.getI18nSupportedLocales.call(void 0, ), []);
|
|
731
736
|
const formSchema = _react.useMemo.call(void 0,
|
|
732
737
|
() => _zod3.z.object({
|
|
733
738
|
id: _zod3.z.string().uuid(),
|
|
@@ -772,14 +777,14 @@ function BlogPostEditor({ post, trigger, onSuccess }) {
|
|
|
772
777
|
return Object.keys(dirty).length > 0;
|
|
773
778
|
}, [dirtyFields, isBodyEmptyState]);
|
|
774
779
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
775
|
-
|
|
780
|
+
_chunk2H342HNNjs.EditorSheet,
|
|
776
781
|
{
|
|
777
782
|
form,
|
|
778
783
|
entityType: t("blog.entities.post"),
|
|
779
784
|
entityName: _optionalChain([original, 'optionalAccess', _38 => _38.title]),
|
|
780
785
|
title: post ? t("blog.admin.editPost") : t("blog.admin.newPost"),
|
|
781
786
|
isEdit: !!post,
|
|
782
|
-
module:
|
|
787
|
+
module: _chunkBZ5J2FIVjs.Modules.BlogPost,
|
|
783
788
|
size: "lg",
|
|
784
789
|
isFormDirty,
|
|
785
790
|
onSubmit: async (values) => {
|
|
@@ -796,13 +801,13 @@ function BlogPostEditor({ post, trigger, onSuccess }) {
|
|
|
796
801
|
categoryIds: values.categories.map((category) => category.id)
|
|
797
802
|
};
|
|
798
803
|
if (post) {
|
|
799
|
-
return
|
|
804
|
+
return _chunkMOGEGWXWjs.BlogPostService.update({
|
|
800
805
|
...payload,
|
|
801
806
|
originalLanguage: post.originalLanguage,
|
|
802
807
|
slug: values.slug || void 0
|
|
803
808
|
});
|
|
804
809
|
}
|
|
805
|
-
return
|
|
810
|
+
return _chunkMOGEGWXWjs.BlogPostService.create({ ...payload, originalLanguage: values.originalLanguage });
|
|
806
811
|
},
|
|
807
812
|
onReset: () => {
|
|
808
813
|
setCover(null);
|
|
@@ -814,7 +819,7 @@ function BlogPostEditor({ post, trigger, onSuccess }) {
|
|
|
814
819
|
trigger,
|
|
815
820
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex h-full min-h-0 w-full flex-col gap-y-4", children: [
|
|
816
821
|
!post && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
817
|
-
|
|
822
|
+
_chunk2H342HNNjs.FormSelect,
|
|
818
823
|
{
|
|
819
824
|
form,
|
|
820
825
|
id: "originalLanguage",
|
|
@@ -823,24 +828,24 @@ function BlogPostEditor({ post, trigger, onSuccess }) {
|
|
|
823
828
|
isRequired: true
|
|
824
829
|
}
|
|
825
830
|
),
|
|
826
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
831
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.FormInput, { form, id: "title", name: t("blog.fields.title"), isRequired: true }),
|
|
827
832
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
|
|
828
833
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-y-4", children: [
|
|
829
|
-
post && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
834
|
+
post && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.FormInput, { form, id: "slug", name: t("blog.fields.slug"), description: t("blog.fields.slugHelp") }),
|
|
830
835
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
831
|
-
|
|
836
|
+
_chunk2H342HNNjs.EntityMultiSelector,
|
|
832
837
|
{
|
|
833
838
|
id: "categories",
|
|
834
839
|
form,
|
|
835
840
|
label: t("blog.fields.categories"),
|
|
836
|
-
retriever: (params) =>
|
|
837
|
-
module:
|
|
841
|
+
retriever: (params) => _chunkMOGEGWXWjs.BlogCategoryService.findMany(params),
|
|
842
|
+
module: _chunkBZ5J2FIVjs.Modules.BlogCategory,
|
|
838
843
|
getLabel: blogCategoryAdminName,
|
|
839
844
|
getFormValueLabel: (value) => value.name || categoryName(value.id)
|
|
840
845
|
}
|
|
841
846
|
),
|
|
842
847
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
843
|
-
|
|
848
|
+
_chunk2H342HNNjs.FormTextarea,
|
|
844
849
|
{
|
|
845
850
|
form,
|
|
846
851
|
id: "summary",
|
|
@@ -857,7 +862,7 @@ function BlogPostEditor({ post, trigger, onSuccess }) {
|
|
|
857
862
|
form,
|
|
858
863
|
id: "coverImage",
|
|
859
864
|
label: t("blog.fields.coverImage"),
|
|
860
|
-
keyPrefix:
|
|
865
|
+
keyPrefix: _chunkMOGEGWXWjs.BLOG_POST_UPLOAD_PREFIX,
|
|
861
866
|
entityId: form.getValues("id"),
|
|
862
867
|
currentUrl: _optionalChain([post, 'optionalAccess', _40 => _40.coverImage]),
|
|
863
868
|
alt: _optionalChain([original, 'optionalAccess', _41 => _41.coverImageAlt]),
|
|
@@ -865,13 +870,13 @@ function BlogPostEditor({ post, trigger, onSuccess }) {
|
|
|
865
870
|
onSelectionChange: setCover
|
|
866
871
|
}
|
|
867
872
|
),
|
|
868
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
873
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.FormInput, { form, id: "coverImageAlt", name: t("blog.fields.coverImageAlt") })
|
|
869
874
|
] })
|
|
870
875
|
] }),
|
|
871
876
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
872
|
-
|
|
877
|
+
_chunk2H342HNNjs.FormBlockNote,
|
|
873
878
|
{
|
|
874
|
-
uploadKeyPrefix:
|
|
879
|
+
uploadKeyPrefix: _chunkMOGEGWXWjs.BLOG_POST_UPLOAD_PREFIX,
|
|
875
880
|
form,
|
|
876
881
|
id: "body",
|
|
877
882
|
name: t("blog.fields.body"),
|
|
@@ -892,22 +897,22 @@ _chunk7QVYU63Ejs.__name.call(void 0, BlogPostEditor, "BlogPostEditor");
|
|
|
892
897
|
|
|
893
898
|
function BlogPostsList({ fullWidth } = {}) {
|
|
894
899
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
895
|
-
const data =
|
|
896
|
-
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) =>
|
|
900
|
+
const data = _chunk2H342HNNjs.useDataListRetriever.call(void 0, {
|
|
901
|
+
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkMOGEGWXWjs.BlogPostService.findMany(params), "retriever"),
|
|
897
902
|
retrieverParams: {},
|
|
898
|
-
module:
|
|
903
|
+
module: _chunkBZ5J2FIVjs.Modules.BlogPost
|
|
899
904
|
});
|
|
900
905
|
const functions = [
|
|
901
906
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
902
907
|
BlogPostEditor,
|
|
903
908
|
{
|
|
904
|
-
trigger: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
909
|
+
trigger: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.Button, { render: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", {}), nativeButton: false, size: "sm", variant: "outline", children: t("blog.admin.newPost") })
|
|
905
910
|
},
|
|
906
911
|
"create-blog-post"
|
|
907
912
|
)
|
|
908
913
|
];
|
|
909
914
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
910
|
-
|
|
915
|
+
_chunk2H342HNNjs.ContentListTable,
|
|
911
916
|
{
|
|
912
917
|
data,
|
|
913
918
|
fields: [
|
|
@@ -917,11 +922,11 @@ function BlogPostsList({ fullWidth } = {}) {
|
|
|
917
922
|
"publishedAt" /* publishedAt */,
|
|
918
923
|
"languages" /* languages */
|
|
919
924
|
],
|
|
920
|
-
tableGeneratorType:
|
|
925
|
+
tableGeneratorType: _chunkBZ5J2FIVjs.Modules.BlogPost,
|
|
921
926
|
functions,
|
|
922
927
|
fullWidth,
|
|
923
928
|
title: t("blog.entities.posts"),
|
|
924
|
-
emptyState: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
929
|
+
emptyState: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.EmptyState, { icon: _lucidereact.NewspaperIcon, title: t("blog.admin.empty") })
|
|
925
930
|
}
|
|
926
931
|
);
|
|
927
932
|
}
|
|
@@ -932,10 +937,10 @@ _chunk7QVYU63Ejs.__name.call(void 0, BlogPostsList, "BlogPostsList");
|
|
|
932
937
|
function BlogAdminContainer() {
|
|
933
938
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
934
939
|
const breadcrumbs = [{ name: t("blog.admin.title") }];
|
|
935
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
936
|
-
|
|
940
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.SharedProvider, { value: { breadcrumbs, title: { type: t("blog.admin.title") } }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
941
|
+
_chunk2H342HNNjs.RoundPageContainer,
|
|
937
942
|
{
|
|
938
|
-
module:
|
|
943
|
+
module: _chunkBZ5J2FIVjs.Modules.BlogPost,
|
|
939
944
|
tabs: [
|
|
940
945
|
{ sectionKey: "posts", label: t("blog.tabs.posts"), content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BlogPostsList, {}) },
|
|
941
946
|
{ sectionKey: "categories", label: t("blog.tabs.categories"), content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BlogCategoriesList, {}) },
|
|
@@ -958,7 +963,7 @@ var BlogPostContext = _react.createContext.call(void 0, void 0);
|
|
|
958
963
|
var BlogPostProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ postId, children }) => {
|
|
959
964
|
const [post, setPost] = _react.useState.call(void 0, void 0);
|
|
960
965
|
const reload = _react.useCallback.call(void 0, async () => {
|
|
961
|
-
const loaded = await
|
|
966
|
+
const loaded = await _chunkMOGEGWXWjs.BlogPostService.findOne({ id: postId });
|
|
962
967
|
setPost(loaded);
|
|
963
968
|
}, [postId]);
|
|
964
969
|
_react.useEffect.call(void 0, () => {
|
|
@@ -994,19 +999,19 @@ var useBlogPost = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
|
|
|
994
999
|
|
|
995
1000
|
function BlogPostDeleter() {
|
|
996
1001
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
997
|
-
const generateUrl =
|
|
1002
|
+
const generateUrl = _chunk2H342HNNjs.usePageUrlGenerator.call(void 0, );
|
|
998
1003
|
const { post } = useBlogPost();
|
|
999
1004
|
if (!post) return null;
|
|
1000
1005
|
const type = t("blog.entities.post");
|
|
1001
1006
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1002
|
-
|
|
1007
|
+
_chunk2H342HNNjs.CommonDeleter,
|
|
1003
1008
|
{
|
|
1004
1009
|
title: t("common.delete.title", { type }),
|
|
1005
1010
|
subtitle: t("common.delete.subtitle", { type }),
|
|
1006
1011
|
description: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-destructive p-4 text-sm", children: t("common.delete.description", { type }) }),
|
|
1007
1012
|
showLabel: true,
|
|
1008
|
-
deleteFunction: () =>
|
|
1009
|
-
redirectTo: generateUrl({ page:
|
|
1013
|
+
deleteFunction: () => _chunkMOGEGWXWjs.BlogPostService.delete({ id: post.id }),
|
|
1014
|
+
redirectTo: generateUrl({ page: _chunkBZ5J2FIVjs.Modules.BlogPost })
|
|
1010
1015
|
}
|
|
1011
1016
|
);
|
|
1012
1017
|
}
|
|
@@ -1026,17 +1031,17 @@ function BlogPostPublishButton() {
|
|
|
1026
1031
|
const toggle = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
|
|
1027
1032
|
setSaving(true);
|
|
1028
1033
|
try {
|
|
1029
|
-
if (isPublished) await
|
|
1030
|
-
else await
|
|
1034
|
+
if (isPublished) await _chunkMOGEGWXWjs.BlogPostService.unpublish({ id: post.id });
|
|
1035
|
+
else await _chunkMOGEGWXWjs.BlogPostService.publish({ id: post.id });
|
|
1031
1036
|
await reload();
|
|
1032
1037
|
} catch (error) {
|
|
1033
|
-
|
|
1038
|
+
_chunk2H342HNNjs.errorToast.call(void 0, { title: t("common.errors.error"), error });
|
|
1034
1039
|
} finally {
|
|
1035
1040
|
setSaving(false);
|
|
1036
1041
|
}
|
|
1037
1042
|
}, "toggle");
|
|
1038
1043
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1039
|
-
|
|
1044
|
+
_chunk2H342HNNjs.Button,
|
|
1040
1045
|
{
|
|
1041
1046
|
type: "button",
|
|
1042
1047
|
size: "sm",
|
|
@@ -1064,11 +1069,11 @@ _chunk7QVYU63Ejs.__name.call(void 0, BlogPostPublishButton, "BlogPostPublishButt
|
|
|
1064
1069
|
function BlogPostTranslationFields({ translation }) {
|
|
1065
1070
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1066
1071
|
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,
|
|
1072
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.DetailField, { label: t("blog.fields.title"), value: translation.title }),
|
|
1073
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.DetailField, { label: t("blog.fields.slug"), value: translation.slug }),
|
|
1074
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.DetailField, { label: t("blog.fields.summary"), value: translation.summary }),
|
|
1075
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.DetailField, { label: t("blog.fields.coverImageAlt"), value: translation.coverImageAlt }),
|
|
1076
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.DetailField, { label: t("blog.fields.body"), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.BlockNoteEditorContainer, { id: translation.id, type: "blog-post", initialContent: translation.body }) })
|
|
1072
1077
|
] });
|
|
1073
1078
|
}
|
|
1074
1079
|
_chunk7QVYU63Ejs.__name.call(void 0, BlogPostTranslationFields, "BlogPostTranslationFields");
|
|
@@ -1078,15 +1083,15 @@ function BlogPostComparison({ original, translation }) {
|
|
|
1078
1083
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
|
|
1079
1084
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "bg-muted/40 flex flex-col gap-y-4 rounded-lg border p-4", children: [
|
|
1080
1085
|
/* @__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,
|
|
1086
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.MicroLabel, { as: "h3", children: languageName(original.language) }),
|
|
1087
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.Badge, { variant: "softGray", children: t("blog.translation.original") })
|
|
1083
1088
|
] }),
|
|
1084
1089
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, BlogPostTranslationFields, { translation: original })
|
|
1085
1090
|
] }),
|
|
1086
1091
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-y-4 rounded-lg border p-4", children: [
|
|
1087
1092
|
/* @__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,
|
|
1093
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.MicroLabel, { as: "h3", children: languageName(translation.language) }),
|
|
1094
|
+
translation.source === "manual" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.Badge, { variant: "softAmber", children: t("blog.translation.editedByHand") })
|
|
1090
1095
|
] }),
|
|
1091
1096
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, BlogPostTranslationFields, { translation })
|
|
1092
1097
|
] })
|
|
@@ -1137,17 +1142,17 @@ function BlogPostTranslationEditor({ translation, trigger, onSuccess }) {
|
|
|
1137
1142
|
return Object.keys(dirty).length > 0;
|
|
1138
1143
|
}, [dirtyFields, isBodyEmptyState]);
|
|
1139
1144
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1140
|
-
|
|
1145
|
+
_chunk2H342HNNjs.EditorSheet,
|
|
1141
1146
|
{
|
|
1142
1147
|
form,
|
|
1143
1148
|
entityType: t("blog.entities.post"),
|
|
1144
1149
|
entityName: translation.title,
|
|
1145
1150
|
title: `${t("blog.admin.editPost")} \xB7 ${languageName(translation.language)}`,
|
|
1146
1151
|
isEdit: true,
|
|
1147
|
-
module:
|
|
1152
|
+
module: _chunkBZ5J2FIVjs.Modules.BlogPostTranslation,
|
|
1148
1153
|
size: "lg",
|
|
1149
1154
|
isFormDirty,
|
|
1150
|
-
onSubmit: async (values) =>
|
|
1155
|
+
onSubmit: async (values) => _chunkMOGEGWXWjs.BlogPostTranslationService.update({
|
|
1151
1156
|
id: values.id,
|
|
1152
1157
|
title: values.title,
|
|
1153
1158
|
slug: values.slug || void 0,
|
|
@@ -1163,18 +1168,18 @@ function BlogPostTranslationEditor({ translation, trigger, onSuccess }) {
|
|
|
1163
1168
|
}))),
|
|
1164
1169
|
trigger,
|
|
1165
1170
|
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,
|
|
1171
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.FormInput, { form, id: "title", name: t("blog.fields.title"), isRequired: true }),
|
|
1167
1172
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
|
|
1168
1173
|
/* @__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,
|
|
1174
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.FormInput, { form, id: "slug", name: t("blog.fields.slug"), description: t("blog.fields.slugHelp") }),
|
|
1175
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.FormTextarea, { form, id: "summary", name: t("blog.fields.summary"), className: "min-h-24" })
|
|
1171
1176
|
] }),
|
|
1172
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex flex-col gap-y-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1177
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex flex-col gap-y-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.FormInput, { form, id: "coverImageAlt", name: t("blog.fields.coverImageAlt") }) })
|
|
1173
1178
|
] }),
|
|
1174
1179
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1175
|
-
|
|
1180
|
+
_chunk2H342HNNjs.FormBlockNote,
|
|
1176
1181
|
{
|
|
1177
|
-
uploadKeyPrefix:
|
|
1182
|
+
uploadKeyPrefix: _chunkMOGEGWXWjs.BLOG_POST_UPLOAD_PREFIX,
|
|
1178
1183
|
form,
|
|
1179
1184
|
id: "body",
|
|
1180
1185
|
name: t("blog.fields.body"),
|
|
@@ -1202,7 +1207,7 @@ function BlogPostTranslationPanel({ post, translation, onChanged }) {
|
|
|
1202
1207
|
const original = post.original;
|
|
1203
1208
|
const reload = _nullishCoalesce(onChanged, () => ( (async () => {
|
|
1204
1209
|
})));
|
|
1205
|
-
const editTrigger = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1210
|
+
const editTrigger = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2H342HNNjs.Button, { render: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", {}), nativeButton: false, size: "sm", variant: "outline", children: [
|
|
1206
1211
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.PencilIcon, {}),
|
|
1207
1212
|
t("blog.actions.edit")
|
|
1208
1213
|
] });
|
|
@@ -1214,7 +1219,7 @@ function BlogPostTranslationPanel({ post, translation, onChanged }) {
|
|
|
1214
1219
|
}[post.status];
|
|
1215
1220
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-6 p-4", children: [
|
|
1216
1221
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center justify-between gap-x-4", children: [
|
|
1217
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1222
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.Badge, { variant: "softGray", children: t("blog.translation.original") }),
|
|
1218
1223
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, BlogPostEditor, { post, trigger: editTrigger, onSuccess: reload })
|
|
1219
1224
|
] }),
|
|
1220
1225
|
post.coverImage && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1225,14 +1230,14 @@ function BlogPostTranslationPanel({ post, translation, onChanged }) {
|
|
|
1225
1230
|
width: 640,
|
|
1226
1231
|
height: 360,
|
|
1227
1232
|
className: "h-auto max-h-72 w-auto rounded-lg object-cover",
|
|
1228
|
-
unoptimized:
|
|
1233
|
+
unoptimized: _chunkMOGEGWXWjs.isRemoteImageSrc.call(void 0, post.coverImage)
|
|
1229
1234
|
}
|
|
1230
1235
|
),
|
|
1231
1236
|
/* @__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,
|
|
1237
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.DetailField, { label: t("blog.fields.status"), value: statusLabel }),
|
|
1238
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.DetailField, { label: t("blog.fields.publishedAt"), value: formatDate(post.publishedAt) || "\u2014" }),
|
|
1234
1239
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1235
|
-
|
|
1240
|
+
_chunk2H342HNNjs.DetailField,
|
|
1236
1241
|
{
|
|
1237
1242
|
label: t("blog.fields.categories"),
|
|
1238
1243
|
value: post.categories.map((category) => categoryName(category.id)).filter(Boolean).join(", ") || "\u2014"
|
|
@@ -1244,16 +1249,16 @@ function BlogPostTranslationPanel({ post, translation, onChanged }) {
|
|
|
1244
1249
|
}
|
|
1245
1250
|
const isWorking = translation.aiStatus === "pending" || translation.aiStatus === "in_progress";
|
|
1246
1251
|
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,
|
|
1252
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.Alert, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2H342HNNjs.AlertDescription, { className: "flex flex-col gap-y-2", children: [
|
|
1248
1253
|
/* @__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,
|
|
1254
|
+
translation.source === "manual" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.Badge, { variant: "softAmber", children: t("blog.translation.editedByHand") }),
|
|
1250
1255
|
original && translation.translatedAt && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: t("blog.translation.translatedFrom", {
|
|
1251
1256
|
language: languageName(original.language),
|
|
1252
1257
|
date: formatDate(translation.translatedAt)
|
|
1253
1258
|
}) })
|
|
1254
1259
|
] }),
|
|
1255
1260
|
/* @__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,
|
|
1261
|
+
original && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.Button, { type: "button", size: "sm", variant: "ghost", onClick: () => setIsComparing((value) => !value), children: isComparing ? t("blog.actions.hideComparison") : t("blog.actions.compareWithOriginal") }) })
|
|
1257
1262
|
] }) }),
|
|
1258
1263
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center justify-between gap-x-4", children: [
|
|
1259
1264
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1261,7 +1266,7 @@ function BlogPostTranslationPanel({ post, translation, onChanged }) {
|
|
|
1261
1266
|
{
|
|
1262
1267
|
aiStatus: translation.aiStatus,
|
|
1263
1268
|
onRetranslate: async () => {
|
|
1264
|
-
await
|
|
1269
|
+
await _chunkMOGEGWXWjs.BlogPostTranslationService.retranslate({ id: translation.id });
|
|
1265
1270
|
await reload();
|
|
1266
1271
|
}
|
|
1267
1272
|
}
|
|
@@ -1281,7 +1286,7 @@ function BlogPostContainer({ postId }) {
|
|
|
1281
1286
|
_chunk7QVYU63Ejs.__name.call(void 0, BlogPostContainer, "BlogPostContainer");
|
|
1282
1287
|
function BlogPostShell() {
|
|
1283
1288
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1284
|
-
const generateUrl =
|
|
1289
|
+
const generateUrl = _chunk2H342HNNjs.usePageUrlGenerator.call(void 0, );
|
|
1285
1290
|
const languageName = useBlogLanguageName();
|
|
1286
1291
|
const { post, reload } = useBlogPost();
|
|
1287
1292
|
const translations = _react.useMemo.call(void 0, () => {
|
|
@@ -1294,7 +1299,7 @@ function BlogPostShell() {
|
|
|
1294
1299
|
if (!post) return null;
|
|
1295
1300
|
const title = _nullishCoalesce(_nullishCoalesce(_optionalChain([post, 'access', _44 => _44.original, 'optionalAccess', _45 => _45.title]), () => ( post.title)), () => ( ""));
|
|
1296
1301
|
const breadcrumbs = [
|
|
1297
|
-
{ name: t("blog.admin.title"), href: generateUrl({ page:
|
|
1302
|
+
{ name: t("blog.admin.title"), href: generateUrl({ page: _chunkBZ5J2FIVjs.Modules.BlogPost }) },
|
|
1298
1303
|
{ name: title }
|
|
1299
1304
|
];
|
|
1300
1305
|
const statusLabel = {
|
|
@@ -1311,7 +1316,7 @@ function BlogPostShell() {
|
|
|
1311
1316
|
return parts.join(" \xB7 ");
|
|
1312
1317
|
}, "tabLabel");
|
|
1313
1318
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1314
|
-
|
|
1319
|
+
_chunk2H342HNNjs.SharedProvider,
|
|
1315
1320
|
{
|
|
1316
1321
|
value: {
|
|
1317
1322
|
breadcrumbs,
|
|
@@ -1319,16 +1324,16 @@ function BlogPostShell() {
|
|
|
1319
1324
|
type: t("blog.admin.title"),
|
|
1320
1325
|
element: title,
|
|
1321
1326
|
functions: [
|
|
1322
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1327
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.Badge, { variant: BLOG_STATUS_BADGE[post.status], children: statusLabel }, "blogPostStatus"),
|
|
1323
1328
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, BlogPostPublishButton, {}, "blogPostPublish"),
|
|
1324
1329
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, BlogPostDeleter, {}, "blogPostDeleter")
|
|
1325
1330
|
]
|
|
1326
1331
|
}
|
|
1327
1332
|
},
|
|
1328
1333
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1329
|
-
|
|
1334
|
+
_chunk2H342HNNjs.RoundPageContainer,
|
|
1330
1335
|
{
|
|
1331
|
-
module:
|
|
1336
|
+
module: _chunkBZ5J2FIVjs.Modules.BlogPost,
|
|
1332
1337
|
id: post.id,
|
|
1333
1338
|
forceHeader: true,
|
|
1334
1339
|
tabs: translations.map((translation) => ({
|
|
@@ -1390,10 +1395,10 @@ function BlogCategoryChips(props) {
|
|
|
1390
1395
|
];
|
|
1391
1396
|
const inactiveVariant = variant === "chips" ? "outline" : "ghost";
|
|
1392
1397
|
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
|
-
|
|
1398
|
+
_chunk2H342HNNjs.Badge,
|
|
1394
1399
|
{
|
|
1395
1400
|
variant: item.active ? "default" : inactiveVariant,
|
|
1396
|
-
render: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1401
|
+
render: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.Link, { href: item.href, "aria-current": item.active ? "page" : void 0 }),
|
|
1397
1402
|
children: item.label
|
|
1398
1403
|
}
|
|
1399
1404
|
) }, item.key)) }) });
|
|
@@ -1408,12 +1413,12 @@ function BlogListHeader(props) {
|
|
|
1408
1413
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1409
1414
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "header", { className: align === "center" ? "text-center" : void 0, children: [
|
|
1410
1415
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1411
|
-
|
|
1416
|
+
_chunk2H342HNNjs.ContentTitle,
|
|
1412
1417
|
{
|
|
1413
1418
|
type: t("blog.public.eyebrow"),
|
|
1414
1419
|
element: t("blog.public.title"),
|
|
1415
1420
|
headingLevel: 1,
|
|
1416
|
-
className:
|
|
1421
|
+
className: _chunkMOGEGWXWjs.cn.call(void 0, "mb-0", align === "center" && "[&_div]:justify-center")
|
|
1417
1422
|
}
|
|
1418
1423
|
),
|
|
1419
1424
|
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 +1427,18 @@ function BlogListHeader(props) {
|
|
|
1422
1427
|
_chunk7QVYU63Ejs.__name.call(void 0, BlogListHeader, "BlogListHeader");
|
|
1423
1428
|
function BlogListEmpty(props) {
|
|
1424
1429
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1425
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className:
|
|
1430
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: _chunkMOGEGWXWjs.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
1431
|
}
|
|
1427
1432
|
_chunk7QVYU63Ejs.__name.call(void 0, BlogListEmpty, "BlogListEmpty");
|
|
1428
1433
|
function BlogLoadMore(props) {
|
|
1429
1434
|
const { basePath, page, activeCategorySlug, query, className } = props;
|
|
1430
1435
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1431
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className:
|
|
1432
|
-
|
|
1436
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: _chunkMOGEGWXWjs.cn.call(void 0, "flex justify-center", className), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1437
|
+
_chunk2H342HNNjs.Link,
|
|
1433
1438
|
{
|
|
1434
1439
|
href: blogListHref(basePath, { category: activeCategorySlug, q: query, page: page + 1 }),
|
|
1435
1440
|
scroll: false,
|
|
1436
|
-
className:
|
|
1441
|
+
className: _chunk2H342HNNjs.buttonVariants.call(void 0, { variant: "outline" }),
|
|
1437
1442
|
children: t("blog.public.loadMore")
|
|
1438
1443
|
}
|
|
1439
1444
|
) });
|
|
@@ -1460,7 +1465,7 @@ function BlogPostMeta(props) {
|
|
|
1460
1465
|
parts.push(t("blog.public.updated", { date: format.dateTime(new Date(post.updatedAt), { dateStyle: "medium" }) }));
|
|
1461
1466
|
}
|
|
1462
1467
|
parts.push(t("blog.public.readingTime", { minutes: post.readingMinutes }));
|
|
1463
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className:
|
|
1468
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: _chunkMOGEGWXWjs.cn.call(void 0, "text-muted-foreground text-xs", className), children: parts.map((part, index) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { children: [
|
|
1464
1469
|
index > 0 ? " \xB7 " : null,
|
|
1465
1470
|
part
|
|
1466
1471
|
] }, index)) });
|
|
@@ -1471,7 +1476,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, BlogPostMeta, "BlogPostMeta");
|
|
|
1471
1476
|
|
|
1472
1477
|
function BlogPostCover(props) {
|
|
1473
1478
|
const { src, alt, sizes, priority, className } = props;
|
|
1474
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className:
|
|
1479
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: _chunkMOGEGWXWjs.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
1480
|
_image2.default,
|
|
1476
1481
|
{
|
|
1477
1482
|
src,
|
|
@@ -1480,7 +1485,7 @@ function BlogPostCover(props) {
|
|
|
1480
1485
|
sizes,
|
|
1481
1486
|
priority,
|
|
1482
1487
|
className: "object-cover",
|
|
1483
|
-
unoptimized:
|
|
1488
|
+
unoptimized: _chunkMOGEGWXWjs.isRemoteImageSrc.call(void 0, src)
|
|
1484
1489
|
}
|
|
1485
1490
|
) : null });
|
|
1486
1491
|
}
|
|
@@ -1491,8 +1496,8 @@ function BlogPostCard(props) {
|
|
|
1491
1496
|
const isProminent = variant === "hero" || variant === "large";
|
|
1492
1497
|
const eyebrow = _optionalChain([category, 'optionalAccess', _46 => _46.name]);
|
|
1493
1498
|
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,
|
|
1499
|
+
eyebrow ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.MicroLabel, { as: "span", children: eyebrow }) : null,
|
|
1500
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.SectionHeader, { level: headingLevel === "h3" ? 3 : 2, className: "mt-1.5", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.Link, { href: blogPostHref(basePath, post.slug), className: "after:absolute after:inset-0", children: post.title }) }),
|
|
1496
1501
|
post.summary ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground mt-2 text-sm leading-relaxed", children: post.summary }) : null,
|
|
1497
1502
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, BlogPostMeta, { post, showAuthor: isProminent, className: "mt-3" })
|
|
1498
1503
|
] });
|
|
@@ -1550,7 +1555,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, BlogPostCard, "BlogPostCard");
|
|
|
1550
1555
|
function BlogSearchBox(props) {
|
|
1551
1556
|
const { basePath, query, activeCategorySlug, className } = props;
|
|
1552
1557
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1553
|
-
const router =
|
|
1558
|
+
const router = _chunkBZ5J2FIVjs.useI18nRouter.call(void 0, );
|
|
1554
1559
|
const [value, setValue] = _react.useState.call(void 0, _nullishCoalesce(query, () => ( "")));
|
|
1555
1560
|
_react.useEffect.call(void 0, () => setValue(_nullishCoalesce(query, () => ( ""))), [query]);
|
|
1556
1561
|
const onSubmit = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (event) => {
|
|
@@ -1558,10 +1563,10 @@ function BlogSearchBox(props) {
|
|
|
1558
1563
|
const q = value.trim();
|
|
1559
1564
|
router.push(blogListHref(basePath, { category: activeCategorySlug, q: q || void 0 }));
|
|
1560
1565
|
}, "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,
|
|
1566
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "form", { role: "search", onSubmit, className, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2H342HNNjs.InputGroup, { children: [
|
|
1567
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.InputGroupAddon, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.SearchIcon, {}) }),
|
|
1563
1568
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1564
|
-
|
|
1569
|
+
_chunk2H342HNNjs.InputGroupInput,
|
|
1565
1570
|
{
|
|
1566
1571
|
type: "search",
|
|
1567
1572
|
name: "q",
|
|
@@ -1673,7 +1678,7 @@ function BlogListRail(props) {
|
|
|
1673
1678
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, BlogListHeader, { showSubtitle: false }),
|
|
1674
1679
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, BlogSearchBox, { basePath, query, activeCategorySlug }),
|
|
1675
1680
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
|
|
1676
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1681
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.MicroLabel, { as: "span", className: "block", children: t("blog.entities.categories") }),
|
|
1677
1682
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1678
1683
|
BlogCategoryChips,
|
|
1679
1684
|
{
|
|
@@ -1731,12 +1736,12 @@ function BlogPostView(props) {
|
|
|
1731
1736
|
const more = related.slice(0, 3);
|
|
1732
1737
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "article", { className: "px-4 pt-12 pb-20 md:pt-16", children: [
|
|
1733
1738
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mx-auto max-w-3xl", children: [
|
|
1734
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1739
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk2H342HNNjs.Link, { href: basePath, className: "inline-flex items-center gap-1.5", children: [
|
|
1735
1740
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ArrowLeftIcon, { className: "size-4 rtl:rotate-180" }),
|
|
1736
1741
|
t("blog.public.back")
|
|
1737
1742
|
] }),
|
|
1738
1743
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "header", { className: "mt-8", children: [
|
|
1739
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1744
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.ContentTitle, { type: _optionalChain([category, 'optionalAccess', _47 => _47.name]), element: post.title, headingLevel: 1, className: "mb-0" }),
|
|
1740
1745
|
post.summary ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground mt-3 text-sm leading-relaxed", children: post.summary }) : null,
|
|
1741
1746
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, BlogPostMeta, { post, showAuthor: true, className: "mt-4" })
|
|
1742
1747
|
] }),
|
|
@@ -1750,10 +1755,10 @@ function BlogPostView(props) {
|
|
|
1750
1755
|
className: "mt-8 aspect-[16/9]"
|
|
1751
1756
|
}
|
|
1752
1757
|
) : null,
|
|
1753
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mt-8", children: _nullishCoalesce(body, () => ( /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1758
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mt-8", children: _nullishCoalesce(body, () => ( /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.BlockNoteEditorContainer, { id: post.id, type: "blog-post", initialContent: post.body }))) })
|
|
1754
1759
|
] }),
|
|
1755
1760
|
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,
|
|
1761
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2H342HNNjs.SectionHeader, { level: 2, children: t("blog.public.moreIn", { category: _nullishCoalesce(_optionalChain([category, 'optionalAccess', _48 => _48.name]), () => ( "")) }) }),
|
|
1757
1762
|
/* @__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
1763
|
BlogPostCard,
|
|
1759
1764
|
{
|
|
@@ -1806,5 +1811,5 @@ _chunk7QVYU63Ejs.__name.call(void 0, BlogPostView, "BlogPostView");
|
|
|
1806
1811
|
|
|
1807
1812
|
|
|
1808
1813
|
|
|
1809
|
-
exports.BLOG_ACTION =
|
|
1814
|
+
exports.BLOG_ACTION = _chunkMOGEGWXWjs.BLOG_ACTION; exports.BLOG_CATEGORY_UPLOAD_PREFIX = _chunkMOGEGWXWjs.BLOG_CATEGORY_UPLOAD_PREFIX; exports.BLOG_LIST_LAYOUTS = _chunkMOGEGWXWjs.BLOG_LIST_LAYOUTS; exports.BLOG_MODULE_ID = _chunkMOGEGWXWjs.BLOG_MODULE_ID; exports.BLOG_POST_STATUSES = _chunkMOGEGWXWjs.BLOG_POST_STATUSES; exports.BLOG_POST_UPLOAD_PREFIX = _chunkMOGEGWXWjs.BLOG_POST_UPLOAD_PREFIX; exports.BLOG_PUBLIC_PREFIX = _chunkMOGEGWXWjs.BLOG_PUBLIC_PREFIX; exports.BLOG_SETTINGS_ID = _chunkMOGEGWXWjs.BLOG_SETTINGS_ID; exports.BLOG_STATUS_BADGE = BLOG_STATUS_BADGE; exports.BLOG_TRANSLATION_SOURCES = _chunkMOGEGWXWjs.BLOG_TRANSLATION_SOURCES; exports.BLOG_UPLOAD_ROOT = _chunkMOGEGWXWjs.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
1815
|
//# sourceMappingURL=index.js.map
|