@carlonicora/nextjs-jsonapi 5.4.0 → 5.6.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-4YCAIEPT.js → BlockNoteEditor-AE3ZTEEH.js} +20 -20
- package/dist/{BlockNoteEditor-4YCAIEPT.js.map → BlockNoteEditor-AE3ZTEEH.js.map} +1 -1
- package/dist/{BlockNoteEditor-YQL2SGFR.mjs → BlockNoteEditor-NEYG5L6W.mjs} +5 -5
- package/dist/{BlockNoteViewer-AEJKJ27Q.mjs → BlockNoteViewer-3OUT5UFY.mjs} +3 -3
- package/dist/{BlockNoteViewer-YL3J7J2Y.js → BlockNoteViewer-4CFKQM7U.js} +4 -4
- package/dist/{BlockNoteViewer-YL3J7J2Y.js.map → BlockNoteViewer-4CFKQM7U.js.map} +1 -1
- package/dist/billing/index.d.mts +186 -25
- package/dist/billing/index.d.ts +186 -25
- package/dist/billing/index.js +1149 -588
- package/dist/billing/index.js.map +1 -1
- package/dist/billing/index.mjs +786 -225
- package/dist/billing/index.mjs.map +1 -1
- package/dist/{chunk-5PPG6PL7.js → chunk-3I5AAJXV.js} +3 -3
- package/dist/{chunk-5PPG6PL7.js.map → chunk-3I5AAJXV.js.map} +1 -1
- package/dist/{chunk-YW4ZCEWB.js → chunk-53BAULDP.js} +4 -4
- package/dist/{chunk-YW4ZCEWB.js.map → chunk-53BAULDP.js.map} +1 -1
- package/dist/{chunk-XCHSX3VC.mjs → chunk-BTPUYUQ3.mjs} +2 -2
- package/dist/{chunk-WC63PJSC.mjs → chunk-EYA2F6AN.mjs} +756 -24
- package/dist/chunk-EYA2F6AN.mjs.map +1 -0
- package/dist/{chunk-NFBOSPNJ.js → chunk-HKZAESS6.js} +954 -222
- package/dist/chunk-HKZAESS6.js.map +1 -0
- package/dist/{chunk-6DC2WVVB.mjs → chunk-KQHBONL4.mjs} +2 -2
- package/dist/{chunk-3NLAXVIN.js → chunk-LQ4DK4JF.js} +1988 -1089
- package/dist/chunk-LQ4DK4JF.js.map +1 -0
- package/dist/{chunk-YNCQSWQW.js → chunk-RL3PL3KV.js} +8 -8
- package/dist/{chunk-YNCQSWQW.js.map → chunk-RL3PL3KV.js.map} +1 -1
- package/dist/{chunk-EUKTBOI2.mjs → chunk-SFYPXCK4.mjs} +3382 -2483
- package/dist/chunk-SFYPXCK4.mjs.map +1 -0
- package/dist/{chunk-QMYQRPQC.mjs → chunk-Y7RR57EW.mjs} +2 -2
- package/dist/client/index.js +5 -5
- package/dist/client/index.js.map +1 -1
- package/dist/client/index.mjs +4 -4
- package/dist/components/editors/server.d.mts +15 -0
- package/dist/components/editors/server.d.ts +15 -0
- package/dist/components/editors/server.js +38 -0
- package/dist/components/editors/server.js.map +1 -0
- package/dist/components/editors/server.mjs +38 -0
- package/dist/components/editors/server.mjs.map +1 -0
- package/dist/components/index.d.mts +33 -10
- package/dist/components/index.d.ts +33 -10
- package/dist/components/index.js +7 -5
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +8 -6
- package/dist/contexts/index.d.mts +9 -1
- package/dist/contexts/index.d.ts +9 -1
- package/dist/contexts/index.js +5 -5
- package/dist/contexts/index.mjs +4 -4
- package/dist/core/index.d.mts +242 -3
- package/dist/core/index.d.ts +242 -3
- package/dist/core/index.js +36 -4
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +35 -3
- package/dist/email-automations/index.d.mts +3 -0
- package/dist/email-automations/index.d.ts +3 -0
- package/dist/email-automations/index.js +99 -95
- package/dist/email-automations/index.js.map +1 -1
- package/dist/email-automations/index.mjs +30 -26
- package/dist/email-automations/index.mjs.map +1 -1
- package/dist/features/analytics/index.d.mts +11 -4
- package/dist/features/analytics/index.d.ts +11 -4
- package/dist/features/analytics/index.js +127 -135
- package/dist/features/analytics/index.js.map +1 -1
- package/dist/features/analytics/index.mjs +16 -24
- package/dist/features/analytics/index.mjs.map +1 -1
- package/dist/features/analytics/server.d.mts +5 -2
- package/dist/features/analytics/server.d.ts +5 -2
- package/dist/features/analytics/server.js +7 -7
- package/dist/features/analytics/server.js.map +1 -1
- package/dist/features/analytics/server.mjs +5 -5
- package/dist/features/analytics/server.mjs.map +1 -1
- package/dist/features/blog/index.d.mts +12 -2
- package/dist/features/blog/index.d.ts +12 -2
- package/dist/features/blog/index.js +206 -195
- package/dist/features/blog/index.js.map +1 -1
- package/dist/features/blog/index.mjs +71 -60
- package/dist/features/blog/index.mjs.map +1 -1
- package/dist/features/blog/server.d.mts +4 -1
- package/dist/features/blog/server.d.ts +4 -1
- package/dist/features/blog/server.js +49 -21
- package/dist/features/blog/server.js.map +1 -1
- package/dist/features/blog/server.mjs +36 -8
- package/dist/features/blog/server.mjs.map +1 -1
- package/dist/features/help/index.js +38 -38
- package/dist/features/help/index.mjs +4 -4
- package/dist/features/tokenusage/index.d.mts +1 -3
- package/dist/features/tokenusage/index.d.ts +1 -3
- package/dist/features/tokenusage/index.js +127 -135
- package/dist/features/tokenusage/index.js.map +1 -1
- package/dist/features/tokenusage/index.mjs +10 -18
- package/dist/features/tokenusage/index.mjs.map +1 -1
- package/dist/{stripe-promotion-code.interface-C3qqh3mi.d.ts → format-options-BtX3o0Yu.d.ts} +104 -1
- package/dist/{stripe-promotion-code.interface-ClZ7DxS9.d.mts → format-options-D6c7FNDi.d.mts} +104 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +37 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +36 -4
- package/dist/server/index.js +4 -4
- package/dist/server/index.mjs +3 -3
- package/messages/en.json +125 -3
- package/messages/it.json +125 -3
- package/package.json +9 -1
- package/scripts/validate-messages.mjs +1 -0
- package/src/billing/index.ts +1 -0
- package/src/client/index.ts +4 -0
- package/src/components/editors/server/BlockNoteServerContent.tsx +28 -0
- package/src/components/editors/server/__tests__/renderBlockNoteHTML.spec.ts +44 -0
- package/src/components/editors/server/renderBlockNoteHTML.ts +26 -0
- package/src/components/editors/server-entry.ts +7 -0
- package/src/components/index.ts +1 -0
- package/src/components/viewers/BlockNoteStaticViewer.tsx +44 -0
- package/src/core/index.ts +1 -0
- package/src/core/registry/ModuleRegistry.ts +3 -0
- package/src/features/administration/components/AdminIndexContainer.tsx +61 -33
- package/src/features/administration/components/__tests__/AdminIndexContainer.spec.tsx +61 -1
- package/src/features/administration/components/index.ts +2 -1
- package/src/features/administration/contexts/AdministrationContext.tsx +11 -3
- package/src/features/administration/contexts/__tests__/AdministrationContext.spec.tsx +40 -0
- package/src/features/ai-connection/ai-connection.module.ts +2 -0
- package/src/features/ai-connection/contexts/AiConnectionsContext.tsx +3 -16
- package/src/features/ai-connection/contexts/__tests__/AiConnectionsContext.spec.tsx +33 -0
- package/src/features/analytics/__tests__/server-entry.spec.tsx +2 -1
- package/src/features/analytics/analytics.modules.ts +22 -5
- package/src/features/analytics/components/AnalyticsAdminContainer.tsx +4 -3
- package/src/features/analytics/components/AnalyticsAdminPageContainer.tsx +6 -3
- package/src/features/analytics/components/AnalyticsJourneyContainer.tsx +4 -3
- package/src/features/analytics/components/__tests__/AnalyticsJourneyContainer.spec.tsx +11 -0
- package/src/features/analytics/components/__tests__/AnalyticsPageContainers.spec.tsx +12 -1
- package/src/features/analytics/components/server/AnalyticsAdminPage.tsx +6 -3
- package/src/features/analytics/contexts/AnalyticsAdminContext.tsx +8 -17
- package/src/features/analytics/contexts/__tests__/AnalyticsAdminContext.spec.tsx +17 -0
- package/src/features/billing/components/cards/InvoicesSummaryCard.tsx +3 -2
- package/src/features/billing/components/cards/SubscriptionSummaryCard.tsx +4 -3
- package/src/features/billing/components/containers/BillingDashboardContainer.tsx +22 -5
- package/src/features/billing/components/utils/__tests__/discount.spec.ts +59 -0
- package/src/features/billing/components/utils/__tests__/url.spec.ts +32 -0
- package/src/features/billing/components/utils/discount.ts +38 -0
- package/src/features/billing/components/utils/index.ts +2 -0
- package/src/features/billing/components/utils/url.ts +12 -0
- package/src/features/billing/contexts/CouponContext.tsx +211 -0
- package/src/features/billing/contexts/index.ts +1 -0
- package/src/features/billing/i18n-keys.ts +79 -0
- package/src/features/billing/stripe-coupon/components/containers/CouponContainer.tsx +38 -0
- package/src/features/billing/stripe-coupon/components/containers/index.ts +1 -0
- package/src/features/billing/stripe-coupon/components/details/CouponDetails.tsx +69 -0
- package/src/features/billing/stripe-coupon/components/details/index.ts +1 -0
- package/src/features/billing/stripe-coupon/components/forms/CouponCodeEditor.tsx +79 -0
- package/src/features/billing/stripe-coupon/components/forms/CouponCodeFields.tsx +192 -0
- package/src/features/billing/stripe-coupon/components/forms/CouponEditor.tsx +333 -0
- package/src/features/billing/stripe-coupon/components/forms/CouponRefresher.tsx +45 -0
- package/src/features/billing/stripe-coupon/components/forms/index.ts +6 -0
- package/src/features/billing/stripe-coupon/components/index.ts +5 -0
- package/src/features/billing/stripe-coupon/components/lists/CouponCodesList.tsx +61 -0
- package/src/features/billing/stripe-coupon/components/lists/CouponsList.tsx +67 -0
- package/src/features/billing/stripe-coupon/components/lists/index.ts +2 -0
- package/src/features/billing/stripe-coupon/components/widgets/CouponCodeActions.tsx +80 -0
- package/src/features/billing/stripe-coupon/components/widgets/index.ts +1 -0
- package/src/features/billing/stripe-coupon/data/__tests__/stripe-coupon-models.spec.ts +114 -0
- package/src/features/billing/stripe-coupon/data/index.ts +10 -0
- package/src/features/billing/stripe-coupon/data/stripe-coupon-code.fields.ts +8 -0
- package/src/features/billing/stripe-coupon/data/stripe-coupon-code.interface.ts +44 -0
- package/src/features/billing/stripe-coupon/data/stripe-coupon-code.service.ts +92 -0
- package/src/features/billing/stripe-coupon/data/stripe-coupon-code.ts +132 -0
- package/src/features/billing/stripe-coupon/data/stripe-coupon-offer.interface.ts +17 -0
- package/src/features/billing/stripe-coupon/data/stripe-coupon-offer.ts +70 -0
- package/src/features/billing/stripe-coupon/data/stripe-coupon.fields.ts +7 -0
- package/src/features/billing/stripe-coupon/data/stripe-coupon.interface.ts +51 -0
- package/src/features/billing/stripe-coupon/data/stripe-coupon.service.ts +93 -0
- package/src/features/billing/stripe-coupon/data/stripe-coupon.ts +165 -0
- package/src/features/billing/stripe-coupon/hooks/useStripeCouponCodeTableStructure.tsx +154 -0
- package/src/features/billing/stripe-coupon/hooks/useStripeCouponTableStructure.tsx +113 -0
- package/src/features/billing/stripe-coupon/index.ts +5 -0
- package/src/features/billing/stripe-coupon/stripe-coupon-code.module.ts +14 -0
- package/src/features/billing/stripe-coupon/stripe-coupon-offer.module.ts +10 -0
- package/src/features/billing/stripe-coupon/stripe-coupon.module.ts +18 -0
- package/src/features/billing/stripe-coupon/utils/__tests__/coupon-places.spec.ts +19 -0
- package/src/features/billing/stripe-coupon/utils/__tests__/to-promotion-code-result.spec.ts +41 -0
- package/src/features/billing/stripe-coupon/utils/coupon-places.ts +23 -0
- package/src/features/billing/stripe-coupon/utils/format-coupon-discount.ts +36 -0
- package/src/features/billing/stripe-coupon/utils/index.ts +3 -0
- package/src/features/billing/stripe-coupon/utils/to-promotion-code-result.ts +23 -0
- package/src/features/billing/stripe-customer/components/forms/PaymentMethodForm.tsx +24 -8
- package/src/features/billing/stripe-price/stripe-price.module.ts +2 -0
- package/src/features/billing/stripe-product/components/containers/ProductsListContainer.tsx +21 -6
- package/src/features/billing/stripe-product/stripe-product.module.ts +2 -0
- package/src/features/billing/stripe-promotion-code/components/PromoCodeInput.tsx +60 -19
- package/src/features/billing/stripe-promotion-code/data/stripe-promotion-code.interface.ts +2 -0
- package/src/features/billing/stripe-subscription/components/containers/SubscriptionsContainer.tsx +24 -5
- package/src/features/billing/stripe-subscription/components/lists/SubscriptionsList.tsx +21 -2
- package/src/features/billing/stripe-subscription/components/wizards/SubscriptionWizard.tsx +1 -1
- package/src/features/billing/stripe-subscription/components/wizards/WizardStepPaymentMethod.tsx +1 -1
- package/src/features/billing/stripe-subscription/components/wizards/WizardStepReview.tsx +60 -49
- package/src/features/billing/stripe-subscription/components/wizards/__tests__/review-card.spec.ts +34 -0
- package/src/features/billing/stripe-subscription/components/wizards/review-card.ts +24 -0
- package/src/features/billing/stripe-subscription/data/__tests__/stripe-subscription.discount.spec.ts +67 -0
- package/src/features/billing/stripe-subscription/data/stripe-subscription.interface.ts +14 -0
- package/src/features/billing/stripe-subscription/data/stripe-subscription.service.ts +39 -0
- package/src/features/billing/stripe-subscription/data/stripe-subscription.ts +21 -0
- package/src/features/billing/stripe-subscription/hooks/__tests__/wizard-payment.spec.ts +48 -0
- package/src/features/billing/stripe-subscription/hooks/__tests__/wizard-promotion.spec.ts +132 -0
- package/src/features/billing/stripe-subscription/hooks/useSubscriptionWizard.ts +138 -12
- package/src/features/billing/stripe-subscription/hooks/wizard-payment.ts +30 -0
- package/src/features/billing/stripe-subscription/hooks/wizard-promotion.ts +54 -0
- package/src/features/blog/components/admin/BlogAdminContainer.tsx +13 -6
- package/src/features/blog/components/admin/BlogCategoriesList.tsx +1 -1
- package/src/features/blog/components/admin/BlogCoverImageField.tsx +1 -1
- package/src/features/blog/components/admin/BlogPostContainer.tsx +0 -1
- package/src/features/blog/components/admin/BlogPostEditor.tsx +42 -33
- package/src/features/blog/components/admin/BlogPostTranslationEditor.tsx +12 -4
- package/src/features/blog/components/admin/BlogPostsList.tsx +1 -1
- package/src/features/blog/components/public/BlogPostCard.tsx +2 -9
- package/src/features/blog/components/public/BlogPostMeta.tsx +2 -2
- package/src/features/blog/components/public/BlogPostView.tsx +9 -3
- package/src/features/blog/components/public/__tests__/BlogList.spec.tsx +2 -0
- package/src/features/blog/components/public/__tests__/BlogPostView.spec.tsx +17 -11
- package/src/features/blog/server/fetchers.ts +57 -8
- package/src/features/email-automation/components/containers/EmailAutomationsListContainer.tsx +12 -3
- package/src/features/rbac/contexts/RbacContext.tsx +4 -7
- package/src/features/rbac/contexts/__tests__/RbacContext.spec.tsx +42 -0
- package/src/features/tokenusage/components/TokenUsageAdminContainer.tsx +4 -3
- package/src/features/tokenusage/contexts/TokenUsageAdminContext.tsx +3 -18
- package/src/features/tokenusage/contexts/__tests__/TokenUsageAdminContext.spec.tsx +17 -0
- package/src/features/tokenusage/tokenusage-admin.module.ts +4 -3
- package/src/features/tokenusage/tokenusage.modules.ts +12 -2
- package/src/features/user/contexts/CurrentUserContext.tsx +25 -0
- package/src/features/user/contexts/UserContext.tsx +18 -3
- package/src/features/user/contexts/__tests__/CurrentUserContext.spec.tsx +121 -2
- package/src/features/user/contexts/__tests__/UserContext.spec.tsx +95 -0
- package/dist/chunk-3NLAXVIN.js.map +0 -1
- package/dist/chunk-EUKTBOI2.mjs.map +0 -1
- package/dist/chunk-NFBOSPNJ.js.map +0 -1
- package/dist/chunk-WC63PJSC.mjs.map +0 -1
- /package/dist/{BlockNoteEditor-YQL2SGFR.mjs.map → BlockNoteEditor-NEYG5L6W.mjs.map} +0 -0
- /package/dist/{BlockNoteViewer-AEJKJ27Q.mjs.map → BlockNoteViewer-3OUT5UFY.mjs.map} +0 -0
- /package/dist/{chunk-XCHSX3VC.mjs.map → chunk-BTPUYUQ3.mjs.map} +0 -0
- /package/dist/{chunk-6DC2WVVB.mjs.map → chunk-KQHBONL4.mjs.map} +0 -0
- /package/dist/{chunk-QMYQRPQC.mjs.map → chunk-Y7RR57EW.mjs.map} +0 -0
|
@@ -37,9 +37,8 @@
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
require('../../chunk-YNCQSWQW.js');
|
|
40
|
+
var _chunkLQ4DK4JFjs = require('../../chunk-LQ4DK4JF.js');
|
|
41
|
+
require('../../chunk-RL3PL3KV.js');
|
|
43
42
|
require('../../chunk-G4JR3SFV.js');
|
|
44
43
|
|
|
45
44
|
|
|
@@ -65,10 +64,10 @@ require('../../chunk-G4JR3SFV.js');
|
|
|
65
64
|
|
|
66
65
|
|
|
67
66
|
|
|
68
|
-
var
|
|
67
|
+
var _chunkHKZAESS6js = require('../../chunk-HKZAESS6.js');
|
|
68
|
+
require('../../chunk-GHE4VT2R.js');
|
|
69
69
|
require('../../chunk-LXKSUWAV.js');
|
|
70
70
|
require('../../chunk-JTPRJNT2.js');
|
|
71
|
-
require('../../chunk-GHE4VT2R.js');
|
|
72
71
|
require('../../chunk-3EPNHTMH.js');
|
|
73
72
|
|
|
74
73
|
|
|
@@ -109,7 +108,7 @@ var dropzone = {
|
|
|
109
108
|
};
|
|
110
109
|
async function uploadBlogImage(params) {
|
|
111
110
|
if (!params.selection || !params.key) return;
|
|
112
|
-
await
|
|
111
|
+
await _chunkHKZAESS6js.S3Service.upload({
|
|
113
112
|
key: params.key,
|
|
114
113
|
contentType: params.selection.contentType,
|
|
115
114
|
file: params.selection.file,
|
|
@@ -139,8 +138,8 @@ function BlogCoverImageField({
|
|
|
139
138
|
};
|
|
140
139
|
}, [previewUrl]);
|
|
141
140
|
const src = _nullishCoalesce(previewUrl, () => ( currentUrl));
|
|
142
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
143
|
-
|
|
141
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.FormFieldWrapper, { form, name: id, label, children: (field) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
142
|
+
_chunkLQ4DK4JFjs.FileUploader,
|
|
144
143
|
{
|
|
145
144
|
value: files,
|
|
146
145
|
onValueChange: (value) => {
|
|
@@ -153,15 +152,15 @@ function BlogCoverImageField({
|
|
|
153
152
|
},
|
|
154
153
|
dropzoneOptions: dropzone,
|
|
155
154
|
className: "w-full",
|
|
156
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
155
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.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,
|
|
157
156
|
_image2.default,
|
|
158
157
|
{
|
|
159
158
|
src,
|
|
160
159
|
alt: _nullishCoalesce(alt, () => ( label)),
|
|
161
160
|
width: 320,
|
|
162
161
|
height: 180,
|
|
163
|
-
className: "h-auto max-h-48 w-auto rounded-md object-cover",
|
|
164
|
-
unoptimized:
|
|
162
|
+
className: "h-auto max-h-48 w-auto max-w-full rounded-md object-cover",
|
|
163
|
+
unoptimized: _chunkHKZAESS6js.isRemoteImageSrc.call(void 0, previewUrl ? void 0 : currentUrl)
|
|
165
164
|
}
|
|
166
165
|
) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
167
166
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.UploadIcon, { className: "my-4 h-8 w-8" }),
|
|
@@ -187,7 +186,7 @@ function blogCategoryAdminName(category) {
|
|
|
187
186
|
}
|
|
188
187
|
_chunk7QVYU63Ejs.__name.call(void 0, blogCategoryAdminName, "blogCategoryAdminName");
|
|
189
188
|
function useBlogLanguageName() {
|
|
190
|
-
const locale =
|
|
189
|
+
const locale = _chunkHKZAESS6js.useI18nLocale.call(void 0, );
|
|
191
190
|
const names = _react.useMemo.call(void 0, () => {
|
|
192
191
|
try {
|
|
193
192
|
return new Intl.DisplayNames([locale], { type: "language" });
|
|
@@ -206,7 +205,7 @@ function useBlogLanguageName() {
|
|
|
206
205
|
}
|
|
207
206
|
_chunk7QVYU63Ejs.__name.call(void 0, useBlogLanguageName, "useBlogLanguageName");
|
|
208
207
|
function useBlogDateFormatter() {
|
|
209
|
-
const locale =
|
|
208
|
+
const locale = _chunkHKZAESS6js.useI18nLocale.call(void 0, );
|
|
210
209
|
return _react.useCallback.call(void 0, (date) => date ? date.toLocaleDateString(locale, { dateStyle: "medium" }) : "", [locale]);
|
|
211
210
|
}
|
|
212
211
|
_chunk7QVYU63Ejs.__name.call(void 0, useBlogDateFormatter, "useBlogDateFormatter");
|
|
@@ -215,7 +214,7 @@ function BlogTranslationStatus({ aiStatus, onRetranslate }) {
|
|
|
215
214
|
const [isRetrying, setIsRetrying] = _react.useState.call(void 0, false);
|
|
216
215
|
if (aiStatus === "completed") return null;
|
|
217
216
|
if (aiStatus === "pending" || aiStatus === "in_progress") {
|
|
218
|
-
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, _chunkLQ4DK4JFjs.Badge, { variant: "softBlue", children: [
|
|
219
218
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.LoaderCircleIcon, { className: "animate-spin" }),
|
|
220
219
|
aiStatus === "pending" ? t("blog.translation.pending") : t("blog.translation.translating")
|
|
221
220
|
] }) });
|
|
@@ -226,14 +225,14 @@ function BlogTranslationStatus({ aiStatus, onRetranslate }) {
|
|
|
226
225
|
try {
|
|
227
226
|
await onRetranslate();
|
|
228
227
|
} catch (error) {
|
|
229
|
-
|
|
228
|
+
_chunkLQ4DK4JFjs.errorToast.call(void 0, { title: t("common.errors.error"), error });
|
|
230
229
|
} finally {
|
|
231
230
|
setIsRetrying(false);
|
|
232
231
|
}
|
|
233
232
|
}, "retranslate");
|
|
234
233
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-2", children: [
|
|
235
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
236
|
-
onRetranslate && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
234
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.Badge, { variant: "softRed", children: t("blog.translation.failed") }),
|
|
235
|
+
onRetranslate && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkLQ4DK4JFjs.Button, { type: "button", size: "sm", variant: "outline", onClick: () => void retranslate(), disabled: isRetrying, children: [
|
|
237
236
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.RotateCcwIcon, {}),
|
|
238
237
|
t("blog.actions.translateAgain")
|
|
239
238
|
] })
|
|
@@ -262,10 +261,10 @@ var sameTranslation = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (a, b
|
|
|
262
261
|
function BlogCategoryEditor({ category, trigger, onSuccess }) {
|
|
263
262
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
264
263
|
const formSchema = _react.useMemo.call(void 0, () => buildFormSchema(t), [t]);
|
|
265
|
-
const locale =
|
|
264
|
+
const locale = _chunkHKZAESS6js.useI18nLocale.call(void 0, );
|
|
266
265
|
const languageName = useBlogLanguageName();
|
|
267
266
|
const [image, setImage] = _react.useState.call(void 0, null);
|
|
268
|
-
const languages = _react.useMemo.call(void 0, () =>
|
|
267
|
+
const languages = _react.useMemo.call(void 0, () => _chunkHKZAESS6js.getI18nSupportedLocales.call(void 0, ), []);
|
|
269
268
|
const original = _optionalChain([category, 'optionalAccess', _6 => _6.original]);
|
|
270
269
|
const translations = _react.useMemo.call(void 0,
|
|
271
270
|
() => (_nullishCoalesce(_optionalChain([category, 'optionalAccess', _7 => _7.translations]), () => ( []))).filter((translation) => !translation.isOriginal),
|
|
@@ -294,20 +293,20 @@ function BlogCategoryEditor({ category, trigger, onSuccess }) {
|
|
|
294
293
|
defaultValues: getDefaultValues()
|
|
295
294
|
});
|
|
296
295
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
297
|
-
|
|
296
|
+
_chunkLQ4DK4JFjs.EditorSheet,
|
|
298
297
|
{
|
|
299
298
|
form,
|
|
300
299
|
entityType: t("blog.entities.category"),
|
|
301
300
|
entityName: _nullishCoalesce(_optionalChain([original, 'optionalAccess', _14 => _14.name]), () => ( _optionalChain([category, 'optionalAccess', _15 => _15.name]))),
|
|
302
301
|
title: category ? t("blog.admin.editCategory") : t("blog.admin.newCategory"),
|
|
303
302
|
isEdit: !!category,
|
|
304
|
-
module:
|
|
303
|
+
module: _chunkHKZAESS6js.Modules.BlogCategory,
|
|
305
304
|
size: "md",
|
|
306
305
|
onSubmit: async (values) => {
|
|
307
306
|
if (values.image && image) await uploadBlogImage({ key: values.image, selection: image });
|
|
308
307
|
const imageKey = values.image && image ? values.image : void 0;
|
|
309
308
|
if (!category) {
|
|
310
|
-
return
|
|
309
|
+
return _chunkHKZAESS6js.BlogCategoryService.create({
|
|
311
310
|
id: values.id,
|
|
312
311
|
originalLanguage: values.originalLanguage,
|
|
313
312
|
name: values.name,
|
|
@@ -321,7 +320,7 @@ function BlogCategoryEditor({ category, trigger, onSuccess }) {
|
|
|
321
320
|
{ id: defaults.id, name: defaults.name, slug: defaults.slug, description: defaults.description }
|
|
322
321
|
);
|
|
323
322
|
if (originalChanged) {
|
|
324
|
-
await
|
|
323
|
+
await _chunkHKZAESS6js.BlogCategoryService.update({
|
|
325
324
|
id: values.id,
|
|
326
325
|
originalLanguage: _optionalChain([category, 'optionalAccess', _16 => _16.originalLanguage]),
|
|
327
326
|
name: values.name,
|
|
@@ -333,7 +332,7 @@ function BlogCategoryEditor({ category, trigger, onSuccess }) {
|
|
|
333
332
|
for (const translation of values.translations) {
|
|
334
333
|
const before = defaults.translations.find((candidate) => candidate.id === translation.id);
|
|
335
334
|
if (sameTranslation(translation, before)) continue;
|
|
336
|
-
await
|
|
335
|
+
await _chunkHKZAESS6js.BlogCategoryTranslationService.update({
|
|
337
336
|
id: translation.id,
|
|
338
337
|
name: translation.name,
|
|
339
338
|
slug: translation.slug || void 0,
|
|
@@ -351,7 +350,7 @@ function BlogCategoryEditor({ category, trigger, onSuccess }) {
|
|
|
351
350
|
trigger,
|
|
352
351
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
353
352
|
!category && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
354
|
-
|
|
353
|
+
_chunkLQ4DK4JFjs.FormSelect,
|
|
355
354
|
{
|
|
356
355
|
form,
|
|
357
356
|
id: "originalLanguage",
|
|
@@ -360,16 +359,16 @@ function BlogCategoryEditor({ category, trigger, onSuccess }) {
|
|
|
360
359
|
isRequired: true
|
|
361
360
|
}
|
|
362
361
|
),
|
|
363
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
364
|
-
category && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
365
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
362
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.FormInput, { form, id: "name", name: t("blog.fields.name"), isRequired: true }),
|
|
363
|
+
category && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.FormInput, { form, id: "slug", name: t("blog.fields.slug"), description: t("blog.fields.slugHelp") }),
|
|
364
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.FormTextarea, { form, id: "description", name: t("blog.fields.description") }),
|
|
366
365
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
367
366
|
BlogCoverImageField,
|
|
368
367
|
{
|
|
369
368
|
form,
|
|
370
369
|
id: "image",
|
|
371
370
|
label: t("blog.fields.image"),
|
|
372
|
-
keyPrefix:
|
|
371
|
+
keyPrefix: _chunkHKZAESS6js.BLOG_CATEGORY_UPLOAD_PREFIX,
|
|
373
372
|
entityId: form.getValues("id"),
|
|
374
373
|
currentUrl: _optionalChain([category, 'optionalAccess', _17 => _17.image]),
|
|
375
374
|
selection: image,
|
|
@@ -377,29 +376,29 @@ function BlogCategoryEditor({ category, trigger, onSuccess }) {
|
|
|
377
376
|
}
|
|
378
377
|
),
|
|
379
378
|
translations.length > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-y-2", children: [
|
|
380
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
381
|
-
translations.map((translation, index) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
382
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
379
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.SectionHeader, { className: "mt-2", children: t("blog.fields.languages") }),
|
|
380
|
+
translations.map((translation, index) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkLQ4DK4JFjs.Collapsible, { className: "rounded-md border", children: [
|
|
381
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkLQ4DK4JFjs.CollapsibleTrigger, { className: "flex w-full items-center justify-between gap-x-2 px-3 py-2 text-start", children: [
|
|
383
382
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex items-center gap-x-2 text-sm font-medium", children: [
|
|
384
383
|
languageName(translation.language),
|
|
385
384
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, BlogTranslationStatus, { aiStatus: translation.aiStatus })
|
|
386
385
|
] }),
|
|
387
386
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ChevronDownIcon, { className: "text-muted-foreground size-4" })
|
|
388
387
|
] }),
|
|
389
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
388
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkLQ4DK4JFjs.CollapsibleContent, { className: "flex flex-col gap-y-4 border-t p-3", children: [
|
|
390
389
|
translation.aiStatus === "failed" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
391
390
|
BlogTranslationStatus,
|
|
392
391
|
{
|
|
393
392
|
aiStatus: translation.aiStatus,
|
|
394
393
|
onRetranslate: async () => {
|
|
395
|
-
await
|
|
394
|
+
await _chunkHKZAESS6js.BlogCategoryTranslationService.retranslate({ id: translation.id });
|
|
396
395
|
await _optionalChain([onSuccess, 'optionalCall', _18 => _18()]);
|
|
397
396
|
}
|
|
398
397
|
}
|
|
399
398
|
),
|
|
400
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
399
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.FormInput, { form, id: `translations.${index}.name`, name: t("blog.fields.name"), isRequired: true }),
|
|
401
400
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
402
|
-
|
|
401
|
+
_chunkLQ4DK4JFjs.FormInput,
|
|
403
402
|
{
|
|
404
403
|
form,
|
|
405
404
|
id: `translations.${index}.slug`,
|
|
@@ -408,7 +407,7 @@ function BlogCategoryEditor({ category, trigger, onSuccess }) {
|
|
|
408
407
|
}
|
|
409
408
|
),
|
|
410
409
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
411
|
-
|
|
410
|
+
_chunkLQ4DK4JFjs.FormTextarea,
|
|
412
411
|
{
|
|
413
412
|
form,
|
|
414
413
|
id: `translations.${index}.description`,
|
|
@@ -481,37 +480,37 @@ var useBlogCategoryTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call
|
|
|
481
480
|
}, [params.fields, fieldColumnMap, t, refresh]);
|
|
482
481
|
return _react.useMemo.call(void 0, () => ({ data: tableData, columns }), [tableData, columns]);
|
|
483
482
|
}, "useBlogCategoryTableStructure");
|
|
484
|
-
|
|
483
|
+
_chunkLQ4DK4JFjs.registerTableGenerator.call(void 0, "blog-categories", useBlogCategoryTableStructure);
|
|
485
484
|
|
|
486
485
|
// src/features/blog/components/admin/BlogCategoriesList.tsx
|
|
487
486
|
|
|
488
487
|
function BlogCategoriesList({ fullWidth } = {}) {
|
|
489
488
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
490
|
-
const data =
|
|
491
|
-
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) =>
|
|
489
|
+
const data = _chunkLQ4DK4JFjs.useDataListRetriever.call(void 0, {
|
|
490
|
+
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkHKZAESS6js.BlogCategoryService.findMany(params), "retriever"),
|
|
492
491
|
retrieverParams: {},
|
|
493
|
-
module:
|
|
492
|
+
module: _chunkHKZAESS6js.Modules.BlogCategory
|
|
494
493
|
});
|
|
495
494
|
const functions = [
|
|
496
495
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
497
496
|
BlogCategoryEditor,
|
|
498
497
|
{
|
|
499
498
|
onSuccess: data.refresh,
|
|
500
|
-
trigger: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
499
|
+
trigger: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.Button, { render: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", {}), nativeButton: false, size: "sm", variant: "outline", children: t("blog.admin.newCategory") })
|
|
501
500
|
},
|
|
502
501
|
"create-blog-category"
|
|
503
502
|
)
|
|
504
503
|
];
|
|
505
504
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
506
|
-
|
|
505
|
+
_chunkLQ4DK4JFjs.ContentListTable,
|
|
507
506
|
{
|
|
508
507
|
data,
|
|
509
508
|
fields: ["name" /* name */, "languages" /* languages */],
|
|
510
|
-
tableGeneratorType:
|
|
509
|
+
tableGeneratorType: _chunkHKZAESS6js.Modules.BlogCategory,
|
|
511
510
|
functions,
|
|
512
511
|
fullWidth,
|
|
513
512
|
title: t("blog.entities.categories"),
|
|
514
|
-
emptyState: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
513
|
+
emptyState: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.EmptyState, { icon: _lucidereact.TagIcon, title: t("blog.admin.emptyCategories") })
|
|
515
514
|
}
|
|
516
515
|
);
|
|
517
516
|
}
|
|
@@ -527,7 +526,7 @@ function BlogLayoutSetting() {
|
|
|
527
526
|
const [saving, setSaving] = _react.useState.call(void 0, false);
|
|
528
527
|
_react.useEffect.call(void 0, () => {
|
|
529
528
|
let active = true;
|
|
530
|
-
|
|
529
|
+
_chunkHKZAESS6js.BlogSettingsService.get().then((settings) => {
|
|
531
530
|
if (active) setLayout(_nullishCoalesce(_optionalChain([settings, 'optionalAccess', _23 => _23.listLayout]), () => ( "featured")));
|
|
532
531
|
}).catch(() => {
|
|
533
532
|
if (active) setLayout("featured");
|
|
@@ -546,19 +545,19 @@ function BlogLayoutSetting() {
|
|
|
546
545
|
setLayout(next);
|
|
547
546
|
setSaving(true);
|
|
548
547
|
try {
|
|
549
|
-
await
|
|
550
|
-
|
|
548
|
+
await _chunkHKZAESS6js.BlogSettingsService.save({ id: _chunkHKZAESS6js.BLOG_SETTINGS_ID, listLayout: next });
|
|
549
|
+
_chunkHKZAESS6js.showToast.call(void 0, t("blog.layout.saved"));
|
|
551
550
|
} catch (error) {
|
|
552
551
|
setLayout(previous);
|
|
553
|
-
|
|
552
|
+
_chunkLQ4DK4JFjs.errorToast.call(void 0, { title: t("common.errors.error"), error });
|
|
554
553
|
} finally {
|
|
555
554
|
setSaving(false);
|
|
556
555
|
}
|
|
557
556
|
}, "save");
|
|
558
557
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full max-w-3xl flex-col gap-y-4 p-4", children: [
|
|
559
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
558
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.SectionHeader, { children: t("blog.layout.title") }),
|
|
560
559
|
layout && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
561
|
-
|
|
560
|
+
_chunkLQ4DK4JFjs.RadioGroup,
|
|
562
561
|
{
|
|
563
562
|
value: layout,
|
|
564
563
|
onValueChange: (value) => {
|
|
@@ -567,13 +566,13 @@ function BlogLayoutSetting() {
|
|
|
567
566
|
},
|
|
568
567
|
disabled: saving,
|
|
569
568
|
className: "grid grid-cols-1 gap-3 md:grid-cols-3",
|
|
570
|
-
children:
|
|
569
|
+
children: _chunkHKZAESS6js.BLOG_LIST_LAYOUTS.map((option) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
571
570
|
"label",
|
|
572
571
|
{
|
|
573
572
|
htmlFor: `blog-layout-${option}`,
|
|
574
573
|
className: "has-data-checked:border-primary flex cursor-pointer items-start gap-x-3 rounded-lg border p-4",
|
|
575
574
|
children: [
|
|
576
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
575
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.RadioGroupItem, { value: option, id: `blog-layout-${option}`, className: "mt-0.5" }),
|
|
577
576
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex flex-col gap-y-1", children: [
|
|
578
577
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-medium", children: options[option].label }),
|
|
579
578
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs/relaxed", children: options[option].description })
|
|
@@ -602,7 +601,7 @@ function useBlogCategoryNames() {
|
|
|
602
601
|
const [names, setNames] = _react.useState.call(void 0, {});
|
|
603
602
|
_react.useEffect.call(void 0, () => {
|
|
604
603
|
let cancelled = false;
|
|
605
|
-
|
|
604
|
+
_chunkHKZAESS6js.BlogCategoryService.findMany({ fetchAll: true }).then((categories) => {
|
|
606
605
|
if (cancelled) return;
|
|
607
606
|
setNames(Object.fromEntries(categories.map((category) => [category.id, blogCategoryAdminName(category)])));
|
|
608
607
|
}).catch(() => {
|
|
@@ -619,8 +618,8 @@ _chunk7QVYU63Ejs.__name.call(void 0, useBlogCategoryNames, "useBlogCategoryNames
|
|
|
619
618
|
|
|
620
619
|
var useBlogPostTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => {
|
|
621
620
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
622
|
-
const locale =
|
|
623
|
-
const generateUrl =
|
|
621
|
+
const locale = _chunkHKZAESS6js.useI18nLocale.call(void 0, );
|
|
622
|
+
const generateUrl = _chunkLQ4DK4JFjs.usePageUrlGenerator.call(void 0, );
|
|
624
623
|
const categoryName = useBlogCategoryNames();
|
|
625
624
|
const tableData = _react.useMemo.call(void 0, () => {
|
|
626
625
|
return params.data.map((post) => {
|
|
@@ -638,7 +637,7 @@ var useBlogPostTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(voi
|
|
|
638
637
|
header: t("blog.fields.title"),
|
|
639
638
|
cell: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ row }) => {
|
|
640
639
|
const post = row.original.jsonApiData;
|
|
641
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
640
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.Link, { href: generateUrl({ page: _chunkHKZAESS6js.Modules.BlogPost, id: post.id }), children: _nullishCoalesce(_nullishCoalesce(_optionalChain([post, 'access', _24 => _24.original, 'optionalAccess', _25 => _25.title]), () => ( post.title)), () => ( post.id)) });
|
|
642
641
|
}, "cell"),
|
|
643
642
|
enableSorting: false,
|
|
644
643
|
enableHiding: false
|
|
@@ -654,7 +653,7 @@ var useBlogPostTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(voi
|
|
|
654
653
|
published: t("blog.status.published"),
|
|
655
654
|
unpublished: t("blog.status.unpublished")
|
|
656
655
|
}[post.status];
|
|
657
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
656
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.Badge, { variant: _nullishCoalesce(BLOG_STATUS_BADGE[post.status], () => ( "softGray")), children: _nullishCoalesce(label, () => ( post.status)) });
|
|
658
657
|
}, "cell"),
|
|
659
658
|
enableSorting: false,
|
|
660
659
|
enableHiding: false
|
|
@@ -708,7 +707,7 @@ var useBlogPostTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(voi
|
|
|
708
707
|
}, [params.fields, fieldColumnMap, t, generateUrl, locale, categoryName]);
|
|
709
708
|
return _react.useMemo.call(void 0, () => ({ data: tableData, columns }), [tableData, columns]);
|
|
710
709
|
}, "useBlogPostTableStructure");
|
|
711
|
-
|
|
710
|
+
_chunkLQ4DK4JFjs.registerTableGenerator.call(void 0, "blog-posts", useBlogPostTableStructure);
|
|
712
711
|
|
|
713
712
|
// src/features/blog/components/admin/BlogPostEditor.tsx
|
|
714
713
|
|
|
@@ -722,13 +721,13 @@ var isBodyEmpty = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (body) =>
|
|
|
722
721
|
function BlogPostEditor({ post, trigger, onSuccess }) {
|
|
723
722
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
724
723
|
const categoryName = useBlogCategoryNames();
|
|
725
|
-
const router =
|
|
726
|
-
const locale =
|
|
724
|
+
const router = _chunkHKZAESS6js.useI18nRouter.call(void 0, );
|
|
725
|
+
const locale = _chunkHKZAESS6js.useI18nLocale.call(void 0, );
|
|
727
726
|
const languageName = useBlogLanguageName();
|
|
728
727
|
const original = _optionalChain([post, 'optionalAccess', _28 => _28.original]);
|
|
729
728
|
const [cover, setCover] = _react.useState.call(void 0, null);
|
|
730
729
|
const [isBodyEmptyState, setIsBodyEmptyState] = _react.useState.call(void 0, isBodyEmpty(_optionalChain([original, 'optionalAccess', _29 => _29.body])));
|
|
731
|
-
const languages = _react.useMemo.call(void 0, () =>
|
|
730
|
+
const languages = _react.useMemo.call(void 0, () => _chunkHKZAESS6js.getI18nSupportedLocales.call(void 0, ), []);
|
|
732
731
|
const formSchema = _react.useMemo.call(void 0,
|
|
733
732
|
() => _zod3.z.object({
|
|
734
733
|
id: _zod3.z.string().uuid(),
|
|
@@ -773,14 +772,14 @@ function BlogPostEditor({ post, trigger, onSuccess }) {
|
|
|
773
772
|
return Object.keys(dirty).length > 0;
|
|
774
773
|
}, [dirtyFields, isBodyEmptyState]);
|
|
775
774
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
776
|
-
|
|
775
|
+
_chunkLQ4DK4JFjs.EditorSheet,
|
|
777
776
|
{
|
|
778
777
|
form,
|
|
779
778
|
entityType: t("blog.entities.post"),
|
|
780
779
|
entityName: _optionalChain([original, 'optionalAccess', _38 => _38.title]),
|
|
781
780
|
title: post ? t("blog.admin.editPost") : t("blog.admin.newPost"),
|
|
782
781
|
isEdit: !!post,
|
|
783
|
-
module:
|
|
782
|
+
module: _chunkHKZAESS6js.Modules.BlogPost,
|
|
784
783
|
size: "lg",
|
|
785
784
|
isFormDirty,
|
|
786
785
|
onSubmit: async (values) => {
|
|
@@ -797,13 +796,13 @@ function BlogPostEditor({ post, trigger, onSuccess }) {
|
|
|
797
796
|
categoryIds: values.categories.map((category) => category.id)
|
|
798
797
|
};
|
|
799
798
|
if (post) {
|
|
800
|
-
return
|
|
799
|
+
return _chunkHKZAESS6js.BlogPostService.update({
|
|
801
800
|
...payload,
|
|
802
801
|
originalLanguage: post.originalLanguage,
|
|
803
802
|
slug: values.slug || void 0
|
|
804
803
|
});
|
|
805
804
|
}
|
|
806
|
-
return
|
|
805
|
+
return _chunkHKZAESS6js.BlogPostService.create({ ...payload, originalLanguage: values.originalLanguage });
|
|
807
806
|
},
|
|
808
807
|
onReset: () => {
|
|
809
808
|
setCover(null);
|
|
@@ -813,9 +812,9 @@ function BlogPostEditor({ post, trigger, onSuccess }) {
|
|
|
813
812
|
onSuccess,
|
|
814
813
|
onNavigate: (url) => router.push(url),
|
|
815
814
|
trigger,
|
|
816
|
-
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
815
|
+
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex h-full min-h-0 w-full flex-col gap-y-4", children: [
|
|
817
816
|
!post && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
818
|
-
|
|
817
|
+
_chunkLQ4DK4JFjs.FormSelect,
|
|
819
818
|
{
|
|
820
819
|
form,
|
|
821
820
|
id: "originalLanguage",
|
|
@@ -824,53 +823,62 @@ function BlogPostEditor({ post, trigger, onSuccess }) {
|
|
|
824
823
|
isRequired: true
|
|
825
824
|
}
|
|
826
825
|
),
|
|
827
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
828
|
-
|
|
826
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.FormInput, { form, id: "title", name: t("blog.fields.title"), isRequired: true }),
|
|
827
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
|
|
828
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-y-4", children: [
|
|
829
|
+
post && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.FormInput, { form, id: "slug", name: t("blog.fields.slug"), description: t("blog.fields.slugHelp") }),
|
|
830
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
831
|
+
_chunkLQ4DK4JFjs.EntityMultiSelector,
|
|
832
|
+
{
|
|
833
|
+
id: "categories",
|
|
834
|
+
form,
|
|
835
|
+
label: t("blog.fields.categories"),
|
|
836
|
+
retriever: (params) => _chunkHKZAESS6js.BlogCategoryService.findMany(params),
|
|
837
|
+
module: _chunkHKZAESS6js.Modules.BlogCategory,
|
|
838
|
+
getLabel: blogCategoryAdminName,
|
|
839
|
+
getFormValueLabel: (value) => value.name || categoryName(value.id)
|
|
840
|
+
}
|
|
841
|
+
),
|
|
842
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
843
|
+
_chunkLQ4DK4JFjs.FormTextarea,
|
|
844
|
+
{
|
|
845
|
+
form,
|
|
846
|
+
id: "summary",
|
|
847
|
+
name: t("blog.fields.summary"),
|
|
848
|
+
description: t("blog.fields.summaryHelp"),
|
|
849
|
+
className: "min-h-24"
|
|
850
|
+
}
|
|
851
|
+
)
|
|
852
|
+
] }),
|
|
853
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-y-4", children: [
|
|
854
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
855
|
+
BlogCoverImageField,
|
|
856
|
+
{
|
|
857
|
+
form,
|
|
858
|
+
id: "coverImage",
|
|
859
|
+
label: t("blog.fields.coverImage"),
|
|
860
|
+
keyPrefix: _chunkHKZAESS6js.BLOG_POST_UPLOAD_PREFIX,
|
|
861
|
+
entityId: form.getValues("id"),
|
|
862
|
+
currentUrl: _optionalChain([post, 'optionalAccess', _40 => _40.coverImage]),
|
|
863
|
+
alt: _optionalChain([original, 'optionalAccess', _41 => _41.coverImageAlt]),
|
|
864
|
+
selection: cover,
|
|
865
|
+
onSelectionChange: setCover
|
|
866
|
+
}
|
|
867
|
+
),
|
|
868
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.FormInput, { form, id: "coverImageAlt", name: t("blog.fields.coverImageAlt") })
|
|
869
|
+
] })
|
|
870
|
+
] }),
|
|
829
871
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
830
|
-
|
|
872
|
+
_chunkLQ4DK4JFjs.FormBlockNote,
|
|
831
873
|
{
|
|
832
|
-
|
|
833
|
-
id: "summary",
|
|
834
|
-
name: t("blog.fields.summary"),
|
|
835
|
-
description: t("blog.fields.summaryHelp")
|
|
836
|
-
}
|
|
837
|
-
),
|
|
838
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
839
|
-
BlogCoverImageField,
|
|
840
|
-
{
|
|
841
|
-
form,
|
|
842
|
-
id: "coverImage",
|
|
843
|
-
label: t("blog.fields.coverImage"),
|
|
844
|
-
keyPrefix: _chunkNFBOSPNJjs.BLOG_POST_UPLOAD_PREFIX,
|
|
845
|
-
entityId: form.getValues("id"),
|
|
846
|
-
currentUrl: _optionalChain([post, 'optionalAccess', _40 => _40.coverImage]),
|
|
847
|
-
alt: _optionalChain([original, 'optionalAccess', _41 => _41.coverImageAlt]),
|
|
848
|
-
selection: cover,
|
|
849
|
-
onSelectionChange: setCover
|
|
850
|
-
}
|
|
851
|
-
),
|
|
852
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3NLAXVINjs.FormInput, { form, id: "coverImageAlt", name: t("blog.fields.coverImageAlt") }),
|
|
853
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
854
|
-
_chunk3NLAXVINjs.EntityMultiSelector,
|
|
855
|
-
{
|
|
856
|
-
id: "categories",
|
|
857
|
-
form,
|
|
858
|
-
label: t("blog.fields.categories"),
|
|
859
|
-
retriever: (params) => _chunkNFBOSPNJjs.BlogCategoryService.findMany(params),
|
|
860
|
-
module: _chunkNFBOSPNJjs.Modules.BlogCategory,
|
|
861
|
-
getLabel: blogCategoryAdminName,
|
|
862
|
-
getFormValueLabel: (value) => value.name || categoryName(value.id)
|
|
863
|
-
}
|
|
864
|
-
),
|
|
865
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
866
|
-
_chunk3NLAXVINjs.FormBlockNote,
|
|
867
|
-
{
|
|
868
|
-
uploadKeyPrefix: _chunkNFBOSPNJjs.BLOG_POST_UPLOAD_PREFIX,
|
|
874
|
+
uploadKeyPrefix: _chunkHKZAESS6js.BLOG_POST_UPLOAD_PREFIX,
|
|
869
875
|
form,
|
|
870
876
|
id: "body",
|
|
871
877
|
name: t("blog.fields.body"),
|
|
872
878
|
type: "blog-post",
|
|
873
879
|
isRequired: true,
|
|
880
|
+
stretch: true,
|
|
881
|
+
className: "min-h-96",
|
|
874
882
|
onEmptyChange: setIsBodyEmptyState
|
|
875
883
|
}
|
|
876
884
|
)
|
|
@@ -884,22 +892,22 @@ _chunk7QVYU63Ejs.__name.call(void 0, BlogPostEditor, "BlogPostEditor");
|
|
|
884
892
|
|
|
885
893
|
function BlogPostsList({ fullWidth } = {}) {
|
|
886
894
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
887
|
-
const data =
|
|
888
|
-
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) =>
|
|
895
|
+
const data = _chunkLQ4DK4JFjs.useDataListRetriever.call(void 0, {
|
|
896
|
+
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkHKZAESS6js.BlogPostService.findMany(params), "retriever"),
|
|
889
897
|
retrieverParams: {},
|
|
890
|
-
module:
|
|
898
|
+
module: _chunkHKZAESS6js.Modules.BlogPost
|
|
891
899
|
});
|
|
892
900
|
const functions = [
|
|
893
901
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
894
902
|
BlogPostEditor,
|
|
895
903
|
{
|
|
896
|
-
trigger: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
904
|
+
trigger: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.Button, { render: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", {}), nativeButton: false, size: "sm", variant: "outline", children: t("blog.admin.newPost") })
|
|
897
905
|
},
|
|
898
906
|
"create-blog-post"
|
|
899
907
|
)
|
|
900
908
|
];
|
|
901
909
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
902
|
-
|
|
910
|
+
_chunkLQ4DK4JFjs.ContentListTable,
|
|
903
911
|
{
|
|
904
912
|
data,
|
|
905
913
|
fields: [
|
|
@@ -909,11 +917,11 @@ function BlogPostsList({ fullWidth } = {}) {
|
|
|
909
917
|
"publishedAt" /* publishedAt */,
|
|
910
918
|
"languages" /* languages */
|
|
911
919
|
],
|
|
912
|
-
tableGeneratorType:
|
|
920
|
+
tableGeneratorType: _chunkHKZAESS6js.Modules.BlogPost,
|
|
913
921
|
functions,
|
|
914
922
|
fullWidth,
|
|
915
923
|
title: t("blog.entities.posts"),
|
|
916
|
-
emptyState: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
924
|
+
emptyState: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.EmptyState, { icon: _lucidereact.NewspaperIcon, title: t("blog.admin.empty") })
|
|
917
925
|
}
|
|
918
926
|
);
|
|
919
927
|
}
|
|
@@ -923,14 +931,14 @@ _chunk7QVYU63Ejs.__name.call(void 0, BlogPostsList, "BlogPostsList");
|
|
|
923
931
|
|
|
924
932
|
function BlogAdminContainer() {
|
|
925
933
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
926
|
-
|
|
927
|
-
|
|
934
|
+
const breadcrumbs = [{ name: t("blog.admin.title") }];
|
|
935
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.SharedProvider, { value: { breadcrumbs, title: { type: t("blog.admin.title") } }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
936
|
+
_chunkLQ4DK4JFjs.RoundPageContainer,
|
|
928
937
|
{
|
|
929
|
-
module:
|
|
930
|
-
fullWidth: true,
|
|
938
|
+
module: _chunkHKZAESS6js.Modules.BlogPost,
|
|
931
939
|
tabs: [
|
|
932
|
-
{ sectionKey: "posts", label: t("blog.tabs.posts"), content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BlogPostsList, {
|
|
933
|
-
{ sectionKey: "categories", label: t("blog.tabs.categories"), content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BlogCategoriesList, {
|
|
940
|
+
{ sectionKey: "posts", label: t("blog.tabs.posts"), content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BlogPostsList, {}) },
|
|
941
|
+
{ sectionKey: "categories", label: t("blog.tabs.categories"), content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BlogCategoriesList, {}) },
|
|
934
942
|
{ sectionKey: "layout", label: t("blog.tabs.layout"), content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BlogLayoutSetting, {}) }
|
|
935
943
|
]
|
|
936
944
|
}
|
|
@@ -950,7 +958,7 @@ var BlogPostContext = _react.createContext.call(void 0, void 0);
|
|
|
950
958
|
var BlogPostProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ postId, children }) => {
|
|
951
959
|
const [post, setPost] = _react.useState.call(void 0, void 0);
|
|
952
960
|
const reload = _react.useCallback.call(void 0, async () => {
|
|
953
|
-
const loaded = await
|
|
961
|
+
const loaded = await _chunkHKZAESS6js.BlogPostService.findOne({ id: postId });
|
|
954
962
|
setPost(loaded);
|
|
955
963
|
}, [postId]);
|
|
956
964
|
_react.useEffect.call(void 0, () => {
|
|
@@ -986,19 +994,19 @@ var useBlogPost = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
|
|
|
986
994
|
|
|
987
995
|
function BlogPostDeleter() {
|
|
988
996
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
989
|
-
const generateUrl =
|
|
997
|
+
const generateUrl = _chunkLQ4DK4JFjs.usePageUrlGenerator.call(void 0, );
|
|
990
998
|
const { post } = useBlogPost();
|
|
991
999
|
if (!post) return null;
|
|
992
1000
|
const type = t("blog.entities.post");
|
|
993
1001
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
994
|
-
|
|
1002
|
+
_chunkLQ4DK4JFjs.CommonDeleter,
|
|
995
1003
|
{
|
|
996
1004
|
title: t("common.delete.title", { type }),
|
|
997
1005
|
subtitle: t("common.delete.subtitle", { type }),
|
|
998
1006
|
description: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-destructive p-4 text-sm", children: t("common.delete.description", { type }) }),
|
|
999
1007
|
showLabel: true,
|
|
1000
|
-
deleteFunction: () =>
|
|
1001
|
-
redirectTo: generateUrl({ page:
|
|
1008
|
+
deleteFunction: () => _chunkHKZAESS6js.BlogPostService.delete({ id: post.id }),
|
|
1009
|
+
redirectTo: generateUrl({ page: _chunkHKZAESS6js.Modules.BlogPost })
|
|
1002
1010
|
}
|
|
1003
1011
|
);
|
|
1004
1012
|
}
|
|
@@ -1018,17 +1026,17 @@ function BlogPostPublishButton() {
|
|
|
1018
1026
|
const toggle = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
|
|
1019
1027
|
setSaving(true);
|
|
1020
1028
|
try {
|
|
1021
|
-
if (isPublished) await
|
|
1022
|
-
else await
|
|
1029
|
+
if (isPublished) await _chunkHKZAESS6js.BlogPostService.unpublish({ id: post.id });
|
|
1030
|
+
else await _chunkHKZAESS6js.BlogPostService.publish({ id: post.id });
|
|
1023
1031
|
await reload();
|
|
1024
1032
|
} catch (error) {
|
|
1025
|
-
|
|
1033
|
+
_chunkLQ4DK4JFjs.errorToast.call(void 0, { title: t("common.errors.error"), error });
|
|
1026
1034
|
} finally {
|
|
1027
1035
|
setSaving(false);
|
|
1028
1036
|
}
|
|
1029
1037
|
}, "toggle");
|
|
1030
1038
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1031
|
-
|
|
1039
|
+
_chunkLQ4DK4JFjs.Button,
|
|
1032
1040
|
{
|
|
1033
1041
|
type: "button",
|
|
1034
1042
|
size: "sm",
|
|
@@ -1056,11 +1064,11 @@ _chunk7QVYU63Ejs.__name.call(void 0, BlogPostPublishButton, "BlogPostPublishButt
|
|
|
1056
1064
|
function BlogPostTranslationFields({ translation }) {
|
|
1057
1065
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1058
1066
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-y-4", children: [
|
|
1059
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1060
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1061
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1062
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1063
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1067
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.DetailField, { label: t("blog.fields.title"), value: translation.title }),
|
|
1068
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.DetailField, { label: t("blog.fields.slug"), value: translation.slug }),
|
|
1069
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.DetailField, { label: t("blog.fields.summary"), value: translation.summary }),
|
|
1070
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.DetailField, { label: t("blog.fields.coverImageAlt"), value: translation.coverImageAlt }),
|
|
1071
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.DetailField, { label: t("blog.fields.body"), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.BlockNoteEditorContainer, { id: translation.id, type: "blog-post", initialContent: translation.body }) })
|
|
1064
1072
|
] });
|
|
1065
1073
|
}
|
|
1066
1074
|
_chunk7QVYU63Ejs.__name.call(void 0, BlogPostTranslationFields, "BlogPostTranslationFields");
|
|
@@ -1070,15 +1078,15 @@ function BlogPostComparison({ original, translation }) {
|
|
|
1070
1078
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
|
|
1071
1079
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "bg-muted/40 flex flex-col gap-y-4 rounded-lg border p-4", children: [
|
|
1072
1080
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-2", children: [
|
|
1073
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1074
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1081
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.MicroLabel, { as: "h3", children: languageName(original.language) }),
|
|
1082
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.Badge, { variant: "softGray", children: t("blog.translation.original") })
|
|
1075
1083
|
] }),
|
|
1076
1084
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, BlogPostTranslationFields, { translation: original })
|
|
1077
1085
|
] }),
|
|
1078
1086
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-y-4 rounded-lg border p-4", children: [
|
|
1079
1087
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-2", children: [
|
|
1080
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1081
|
-
translation.source === "manual" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1088
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.MicroLabel, { as: "h3", children: languageName(translation.language) }),
|
|
1089
|
+
translation.source === "manual" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.Badge, { variant: "softAmber", children: t("blog.translation.editedByHand") })
|
|
1082
1090
|
] }),
|
|
1083
1091
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, BlogPostTranslationFields, { translation })
|
|
1084
1092
|
] })
|
|
@@ -1129,17 +1137,17 @@ function BlogPostTranslationEditor({ translation, trigger, onSuccess }) {
|
|
|
1129
1137
|
return Object.keys(dirty).length > 0;
|
|
1130
1138
|
}, [dirtyFields, isBodyEmptyState]);
|
|
1131
1139
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1132
|
-
|
|
1140
|
+
_chunkLQ4DK4JFjs.EditorSheet,
|
|
1133
1141
|
{
|
|
1134
1142
|
form,
|
|
1135
1143
|
entityType: t("blog.entities.post"),
|
|
1136
1144
|
entityName: translation.title,
|
|
1137
1145
|
title: `${t("blog.admin.editPost")} \xB7 ${languageName(translation.language)}`,
|
|
1138
1146
|
isEdit: true,
|
|
1139
|
-
module:
|
|
1147
|
+
module: _chunkHKZAESS6js.Modules.BlogPostTranslation,
|
|
1140
1148
|
size: "lg",
|
|
1141
1149
|
isFormDirty,
|
|
1142
|
-
onSubmit: async (values) =>
|
|
1150
|
+
onSubmit: async (values) => _chunkHKZAESS6js.BlogPostTranslationService.update({
|
|
1143
1151
|
id: values.id,
|
|
1144
1152
|
title: values.title,
|
|
1145
1153
|
slug: values.slug || void 0,
|
|
@@ -1154,20 +1162,26 @@ function BlogPostTranslationEditor({ translation, trigger, onSuccess }) {
|
|
|
1154
1162
|
onSuccess: _nullishCoalesce(onSuccess, () => ( (() => {
|
|
1155
1163
|
}))),
|
|
1156
1164
|
trigger,
|
|
1157
|
-
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
1158
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1159
|
-
/* @__PURE__ */ _jsxruntime.
|
|
1160
|
-
|
|
1161
|
-
|
|
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, _chunkLQ4DK4JFjs.FormInput, { form, id: "title", name: t("blog.fields.title"), isRequired: true }),
|
|
1167
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
|
|
1168
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-y-4", children: [
|
|
1169
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.FormInput, { form, id: "slug", name: t("blog.fields.slug"), description: t("blog.fields.slugHelp") }),
|
|
1170
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.FormTextarea, { form, id: "summary", name: t("blog.fields.summary"), className: "min-h-24" })
|
|
1171
|
+
] }),
|
|
1172
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex flex-col gap-y-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.FormInput, { form, id: "coverImageAlt", name: t("blog.fields.coverImageAlt") }) })
|
|
1173
|
+
] }),
|
|
1162
1174
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1163
|
-
|
|
1175
|
+
_chunkLQ4DK4JFjs.FormBlockNote,
|
|
1164
1176
|
{
|
|
1165
|
-
uploadKeyPrefix:
|
|
1177
|
+
uploadKeyPrefix: _chunkHKZAESS6js.BLOG_POST_UPLOAD_PREFIX,
|
|
1166
1178
|
form,
|
|
1167
1179
|
id: "body",
|
|
1168
1180
|
name: t("blog.fields.body"),
|
|
1169
1181
|
type: "blog-post",
|
|
1170
1182
|
isRequired: true,
|
|
1183
|
+
stretch: true,
|
|
1184
|
+
className: "min-h-96",
|
|
1171
1185
|
onEmptyChange: setIsBodyEmptyState
|
|
1172
1186
|
}
|
|
1173
1187
|
)
|
|
@@ -1188,7 +1202,7 @@ function BlogPostTranslationPanel({ post, translation, onChanged }) {
|
|
|
1188
1202
|
const original = post.original;
|
|
1189
1203
|
const reload = _nullishCoalesce(onChanged, () => ( (async () => {
|
|
1190
1204
|
})));
|
|
1191
|
-
const editTrigger = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1205
|
+
const editTrigger = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkLQ4DK4JFjs.Button, { render: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", {}), nativeButton: false, size: "sm", variant: "outline", children: [
|
|
1192
1206
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.PencilIcon, {}),
|
|
1193
1207
|
t("blog.actions.edit")
|
|
1194
1208
|
] });
|
|
@@ -1200,7 +1214,7 @@ function BlogPostTranslationPanel({ post, translation, onChanged }) {
|
|
|
1200
1214
|
}[post.status];
|
|
1201
1215
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-6 p-4", children: [
|
|
1202
1216
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center justify-between gap-x-4", children: [
|
|
1203
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1217
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.Badge, { variant: "softGray", children: t("blog.translation.original") }),
|
|
1204
1218
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, BlogPostEditor, { post, trigger: editTrigger, onSuccess: reload })
|
|
1205
1219
|
] }),
|
|
1206
1220
|
post.coverImage && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1211,14 +1225,14 @@ function BlogPostTranslationPanel({ post, translation, onChanged }) {
|
|
|
1211
1225
|
width: 640,
|
|
1212
1226
|
height: 360,
|
|
1213
1227
|
className: "h-auto max-h-72 w-auto rounded-lg object-cover",
|
|
1214
|
-
unoptimized:
|
|
1228
|
+
unoptimized: _chunkHKZAESS6js.isRemoteImageSrc.call(void 0, post.coverImage)
|
|
1215
1229
|
}
|
|
1216
1230
|
),
|
|
1217
1231
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-1 gap-4 md:grid-cols-3", children: [
|
|
1218
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1219
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1232
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.DetailField, { label: t("blog.fields.status"), value: statusLabel }),
|
|
1233
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.DetailField, { label: t("blog.fields.publishedAt"), value: formatDate(post.publishedAt) || "\u2014" }),
|
|
1220
1234
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1221
|
-
|
|
1235
|
+
_chunkLQ4DK4JFjs.DetailField,
|
|
1222
1236
|
{
|
|
1223
1237
|
label: t("blog.fields.categories"),
|
|
1224
1238
|
value: post.categories.map((category) => categoryName(category.id)).filter(Boolean).join(", ") || "\u2014"
|
|
@@ -1230,16 +1244,16 @@ function BlogPostTranslationPanel({ post, translation, onChanged }) {
|
|
|
1230
1244
|
}
|
|
1231
1245
|
const isWorking = translation.aiStatus === "pending" || translation.aiStatus === "in_progress";
|
|
1232
1246
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-6 p-4", children: [
|
|
1233
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1247
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.Alert, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkLQ4DK4JFjs.AlertDescription, { className: "flex flex-col gap-y-2", children: [
|
|
1234
1248
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
1235
|
-
translation.source === "manual" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1249
|
+
translation.source === "manual" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.Badge, { variant: "softAmber", children: t("blog.translation.editedByHand") }),
|
|
1236
1250
|
original && translation.translatedAt && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: t("blog.translation.translatedFrom", {
|
|
1237
1251
|
language: languageName(original.language),
|
|
1238
1252
|
date: formatDate(translation.translatedAt)
|
|
1239
1253
|
}) })
|
|
1240
1254
|
] }),
|
|
1241
1255
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: t("blog.translation.overwriteWarning") }),
|
|
1242
|
-
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, _chunkLQ4DK4JFjs.Button, { type: "button", size: "sm", variant: "ghost", onClick: () => setIsComparing((value) => !value), children: isComparing ? t("blog.actions.hideComparison") : t("blog.actions.compareWithOriginal") }) })
|
|
1243
1257
|
] }) }),
|
|
1244
1258
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center justify-between gap-x-4", children: [
|
|
1245
1259
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1247,7 +1261,7 @@ function BlogPostTranslationPanel({ post, translation, onChanged }) {
|
|
|
1247
1261
|
{
|
|
1248
1262
|
aiStatus: translation.aiStatus,
|
|
1249
1263
|
onRetranslate: async () => {
|
|
1250
|
-
await
|
|
1264
|
+
await _chunkHKZAESS6js.BlogPostTranslationService.retranslate({ id: translation.id });
|
|
1251
1265
|
await reload();
|
|
1252
1266
|
}
|
|
1253
1267
|
}
|
|
@@ -1267,7 +1281,7 @@ function BlogPostContainer({ postId }) {
|
|
|
1267
1281
|
_chunk7QVYU63Ejs.__name.call(void 0, BlogPostContainer, "BlogPostContainer");
|
|
1268
1282
|
function BlogPostShell() {
|
|
1269
1283
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1270
|
-
const generateUrl =
|
|
1284
|
+
const generateUrl = _chunkLQ4DK4JFjs.usePageUrlGenerator.call(void 0, );
|
|
1271
1285
|
const languageName = useBlogLanguageName();
|
|
1272
1286
|
const { post, reload } = useBlogPost();
|
|
1273
1287
|
const translations = _react.useMemo.call(void 0, () => {
|
|
@@ -1280,7 +1294,7 @@ function BlogPostShell() {
|
|
|
1280
1294
|
if (!post) return null;
|
|
1281
1295
|
const title = _nullishCoalesce(_nullishCoalesce(_optionalChain([post, 'access', _44 => _44.original, 'optionalAccess', _45 => _45.title]), () => ( post.title)), () => ( ""));
|
|
1282
1296
|
const breadcrumbs = [
|
|
1283
|
-
{ name: t("blog.admin.title"), href: generateUrl({ page:
|
|
1297
|
+
{ name: t("blog.admin.title"), href: generateUrl({ page: _chunkHKZAESS6js.Modules.BlogPost }) },
|
|
1284
1298
|
{ name: title }
|
|
1285
1299
|
];
|
|
1286
1300
|
const statusLabel = {
|
|
@@ -1297,7 +1311,7 @@ function BlogPostShell() {
|
|
|
1297
1311
|
return parts.join(" \xB7 ");
|
|
1298
1312
|
}, "tabLabel");
|
|
1299
1313
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1300
|
-
|
|
1314
|
+
_chunkLQ4DK4JFjs.SharedProvider,
|
|
1301
1315
|
{
|
|
1302
1316
|
value: {
|
|
1303
1317
|
breadcrumbs,
|
|
@@ -1305,18 +1319,17 @@ function BlogPostShell() {
|
|
|
1305
1319
|
type: t("blog.admin.title"),
|
|
1306
1320
|
element: title,
|
|
1307
1321
|
functions: [
|
|
1308
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1322
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.Badge, { variant: BLOG_STATUS_BADGE[post.status], children: statusLabel }, "blogPostStatus"),
|
|
1309
1323
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, BlogPostPublishButton, {}, "blogPostPublish"),
|
|
1310
1324
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, BlogPostDeleter, {}, "blogPostDeleter")
|
|
1311
1325
|
]
|
|
1312
1326
|
}
|
|
1313
1327
|
},
|
|
1314
1328
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1315
|
-
|
|
1329
|
+
_chunkLQ4DK4JFjs.RoundPageContainer,
|
|
1316
1330
|
{
|
|
1317
|
-
module:
|
|
1331
|
+
module: _chunkHKZAESS6js.Modules.BlogPost,
|
|
1318
1332
|
id: post.id,
|
|
1319
|
-
fullWidth: true,
|
|
1320
1333
|
forceHeader: true,
|
|
1321
1334
|
tabs: translations.map((translation) => ({
|
|
1322
1335
|
sectionKey: translation.language,
|
|
@@ -1377,10 +1390,10 @@ function BlogCategoryChips(props) {
|
|
|
1377
1390
|
];
|
|
1378
1391
|
const inactiveVariant = variant === "chips" ? "outline" : "ghost";
|
|
1379
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,
|
|
1380
|
-
|
|
1393
|
+
_chunkLQ4DK4JFjs.Badge,
|
|
1381
1394
|
{
|
|
1382
1395
|
variant: item.active ? "default" : inactiveVariant,
|
|
1383
|
-
render: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1396
|
+
render: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.Link, { href: item.href, "aria-current": item.active ? "page" : void 0 }),
|
|
1384
1397
|
children: item.label
|
|
1385
1398
|
}
|
|
1386
1399
|
) }, item.key)) }) });
|
|
@@ -1395,12 +1408,12 @@ function BlogListHeader(props) {
|
|
|
1395
1408
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1396
1409
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "header", { className: align === "center" ? "text-center" : void 0, children: [
|
|
1397
1410
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1398
|
-
|
|
1411
|
+
_chunkLQ4DK4JFjs.ContentTitle,
|
|
1399
1412
|
{
|
|
1400
1413
|
type: t("blog.public.eyebrow"),
|
|
1401
1414
|
element: t("blog.public.title"),
|
|
1402
1415
|
headingLevel: 1,
|
|
1403
|
-
className:
|
|
1416
|
+
className: _chunkHKZAESS6js.cn.call(void 0, "mb-0", align === "center" && "[&_div]:justify-center")
|
|
1404
1417
|
}
|
|
1405
1418
|
),
|
|
1406
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
|
|
@@ -1409,18 +1422,18 @@ function BlogListHeader(props) {
|
|
|
1409
1422
|
_chunk7QVYU63Ejs.__name.call(void 0, BlogListHeader, "BlogListHeader");
|
|
1410
1423
|
function BlogListEmpty(props) {
|
|
1411
1424
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1412
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className:
|
|
1425
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: _chunkHKZAESS6js.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") });
|
|
1413
1426
|
}
|
|
1414
1427
|
_chunk7QVYU63Ejs.__name.call(void 0, BlogListEmpty, "BlogListEmpty");
|
|
1415
1428
|
function BlogLoadMore(props) {
|
|
1416
1429
|
const { basePath, page, activeCategorySlug, query, className } = props;
|
|
1417
1430
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1418
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className:
|
|
1419
|
-
|
|
1431
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: _chunkHKZAESS6js.cn.call(void 0, "flex justify-center", className), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1432
|
+
_chunkLQ4DK4JFjs.Link,
|
|
1420
1433
|
{
|
|
1421
1434
|
href: blogListHref(basePath, { category: activeCategorySlug, q: query, page: page + 1 }),
|
|
1422
1435
|
scroll: false,
|
|
1423
|
-
className:
|
|
1436
|
+
className: _chunkLQ4DK4JFjs.buttonVariants.call(void 0, { variant: "outline" }),
|
|
1424
1437
|
children: t("blog.public.loadMore")
|
|
1425
1438
|
}
|
|
1426
1439
|
) });
|
|
@@ -1430,7 +1443,6 @@ _chunk7QVYU63Ejs.__name.call(void 0, BlogLoadMore, "BlogLoadMore");
|
|
|
1430
1443
|
// src/features/blog/components/public/BlogPostCard.tsx
|
|
1431
1444
|
|
|
1432
1445
|
|
|
1433
|
-
|
|
1434
1446
|
// src/features/blog/components/public/BlogPostMeta.tsx
|
|
1435
1447
|
|
|
1436
1448
|
|
|
@@ -1448,7 +1460,7 @@ function BlogPostMeta(props) {
|
|
|
1448
1460
|
parts.push(t("blog.public.updated", { date: format.dateTime(new Date(post.updatedAt), { dateStyle: "medium" }) }));
|
|
1449
1461
|
}
|
|
1450
1462
|
parts.push(t("blog.public.readingTime", { minutes: post.readingMinutes }));
|
|
1451
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className:
|
|
1463
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: _chunkHKZAESS6js.cn.call(void 0, "text-muted-foreground text-xs", className), children: parts.map((part, index) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { children: [
|
|
1452
1464
|
index > 0 ? " \xB7 " : null,
|
|
1453
1465
|
part
|
|
1454
1466
|
] }, index)) });
|
|
@@ -1459,7 +1471,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, BlogPostMeta, "BlogPostMeta");
|
|
|
1459
1471
|
|
|
1460
1472
|
function BlogPostCover(props) {
|
|
1461
1473
|
const { src, alt, sizes, priority, className } = props;
|
|
1462
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className:
|
|
1474
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: _chunkHKZAESS6js.cn.call(void 0, "border-border bg-primary/10 relative overflow-hidden rounded-lg border", className), children: src ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1463
1475
|
_image2.default,
|
|
1464
1476
|
{
|
|
1465
1477
|
src,
|
|
@@ -1468,22 +1480,21 @@ function BlogPostCover(props) {
|
|
|
1468
1480
|
sizes,
|
|
1469
1481
|
priority,
|
|
1470
1482
|
className: "object-cover",
|
|
1471
|
-
unoptimized:
|
|
1483
|
+
unoptimized: _chunkHKZAESS6js.isRemoteImageSrc.call(void 0, src)
|
|
1472
1484
|
}
|
|
1473
1485
|
) : null });
|
|
1474
1486
|
}
|
|
1475
1487
|
_chunk7QVYU63Ejs.__name.call(void 0, BlogPostCover, "BlogPostCover");
|
|
1476
1488
|
function BlogPostCard(props) {
|
|
1477
1489
|
const { post, categories, basePath, variant = "card", priority, headingLevel = "h2" } = props;
|
|
1478
|
-
const format = _nextintl.useFormatter.call(void 0, );
|
|
1479
1490
|
const category = resolvePostCategory(post, categories);
|
|
1480
1491
|
const isProminent = variant === "hero" || variant === "large";
|
|
1481
|
-
const eyebrow =
|
|
1492
|
+
const eyebrow = _optionalChain([category, 'optionalAccess', _46 => _46.name]);
|
|
1482
1493
|
const text = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex min-w-0 flex-col", children: [
|
|
1483
|
-
eyebrow ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1484
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1494
|
+
eyebrow ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.MicroLabel, { as: "span", children: eyebrow }) : null,
|
|
1495
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.SectionHeader, { level: headingLevel === "h3" ? 3 : 2, className: "mt-1.5", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.Link, { href: blogPostHref(basePath, post.slug), className: "after:absolute after:inset-0", children: post.title }) }),
|
|
1485
1496
|
post.summary ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground mt-2 text-sm leading-relaxed", children: post.summary }) : null,
|
|
1486
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, BlogPostMeta, { post, showAuthor: isProminent,
|
|
1497
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, BlogPostMeta, { post, showAuthor: isProminent, className: "mt-3" })
|
|
1487
1498
|
] });
|
|
1488
1499
|
if (variant === "hero") {
|
|
1489
1500
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "article", { className: "group relative grid items-center gap-6 md:grid-cols-[1.4fr_1fr] md:gap-10", children: [
|
|
@@ -1539,7 +1550,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, BlogPostCard, "BlogPostCard");
|
|
|
1539
1550
|
function BlogSearchBox(props) {
|
|
1540
1551
|
const { basePath, query, activeCategorySlug, className } = props;
|
|
1541
1552
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1542
|
-
const router =
|
|
1553
|
+
const router = _chunkHKZAESS6js.useI18nRouter.call(void 0, );
|
|
1543
1554
|
const [value, setValue] = _react.useState.call(void 0, _nullishCoalesce(query, () => ( "")));
|
|
1544
1555
|
_react.useEffect.call(void 0, () => setValue(_nullishCoalesce(query, () => ( ""))), [query]);
|
|
1545
1556
|
const onSubmit = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (event) => {
|
|
@@ -1547,10 +1558,10 @@ function BlogSearchBox(props) {
|
|
|
1547
1558
|
const q = value.trim();
|
|
1548
1559
|
router.push(blogListHref(basePath, { category: activeCategorySlug, q: q || void 0 }));
|
|
1549
1560
|
}, "onSubmit");
|
|
1550
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "form", { role: "search", onSubmit, className, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1551
|
-
/* @__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, _chunkLQ4DK4JFjs.InputGroup, { children: [
|
|
1562
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.InputGroupAddon, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.SearchIcon, {}) }),
|
|
1552
1563
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1553
|
-
|
|
1564
|
+
_chunkLQ4DK4JFjs.InputGroupInput,
|
|
1554
1565
|
{
|
|
1555
1566
|
type: "search",
|
|
1556
1567
|
name: "q",
|
|
@@ -1662,7 +1673,7 @@ function BlogListRail(props) {
|
|
|
1662
1673
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, BlogListHeader, { showSubtitle: false }),
|
|
1663
1674
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, BlogSearchBox, { basePath, query, activeCategorySlug }),
|
|
1664
1675
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
|
|
1665
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1676
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.MicroLabel, { as: "span", className: "block", children: t("blog.entities.categories") }),
|
|
1666
1677
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1667
1678
|
BlogCategoryChips,
|
|
1668
1679
|
{
|
|
@@ -1714,20 +1725,20 @@ _chunk7QVYU63Ejs.__name.call(void 0, BlogList, "BlogList");
|
|
|
1714
1725
|
|
|
1715
1726
|
|
|
1716
1727
|
function BlogPostView(props) {
|
|
1717
|
-
const { post, categories, related, basePath } = props;
|
|
1728
|
+
const { post, categories, related, basePath, body } = props;
|
|
1718
1729
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1719
1730
|
const category = resolvePostCategory(post, categories);
|
|
1720
1731
|
const more = related.slice(0, 3);
|
|
1721
1732
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "article", { className: "px-4 pt-12 pb-20 md:pt-16", children: [
|
|
1722
1733
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mx-auto max-w-3xl", children: [
|
|
1723
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1734
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkLQ4DK4JFjs.Link, { href: basePath, className: "inline-flex items-center gap-1.5", children: [
|
|
1724
1735
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ArrowLeftIcon, { className: "size-4 rtl:rotate-180" }),
|
|
1725
1736
|
t("blog.public.back")
|
|
1726
1737
|
] }),
|
|
1727
1738
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "header", { className: "mt-8", children: [
|
|
1728
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1739
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.ContentTitle, { type: _optionalChain([category, 'optionalAccess', _47 => _47.name]), element: post.title, headingLevel: 1, className: "mb-0" }),
|
|
1729
1740
|
post.summary ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground mt-3 text-sm leading-relaxed", children: post.summary }) : null,
|
|
1730
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, BlogPostMeta, { post, showAuthor: true,
|
|
1741
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, BlogPostMeta, { post, showAuthor: true, className: "mt-4" })
|
|
1731
1742
|
] }),
|
|
1732
1743
|
post.coverImage ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1733
1744
|
BlogPostCover,
|
|
@@ -1739,10 +1750,10 @@ function BlogPostView(props) {
|
|
|
1739
1750
|
className: "mt-8 aspect-[16/9]"
|
|
1740
1751
|
}
|
|
1741
1752
|
) : null,
|
|
1742
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mt-8", children: /* @__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, _chunkLQ4DK4JFjs.BlockNoteEditorContainer, { id: post.id, type: "blog-post", initialContent: post.body }))) })
|
|
1743
1754
|
] }),
|
|
1744
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: [
|
|
1745
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1756
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLQ4DK4JFjs.SectionHeader, { level: 2, children: t("blog.public.moreIn", { category: _nullishCoalesce(_optionalChain([category, 'optionalAccess', _48 => _48.name]), () => ( "")) }) }),
|
|
1746
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,
|
|
1747
1758
|
BlogPostCard,
|
|
1748
1759
|
{
|
|
@@ -1795,5 +1806,5 @@ _chunk7QVYU63Ejs.__name.call(void 0, BlogPostView, "BlogPostView");
|
|
|
1795
1806
|
|
|
1796
1807
|
|
|
1797
1808
|
|
|
1798
|
-
exports.BLOG_ACTION =
|
|
1809
|
+
exports.BLOG_ACTION = _chunkHKZAESS6js.BLOG_ACTION; exports.BLOG_CATEGORY_UPLOAD_PREFIX = _chunkHKZAESS6js.BLOG_CATEGORY_UPLOAD_PREFIX; exports.BLOG_LIST_LAYOUTS = _chunkHKZAESS6js.BLOG_LIST_LAYOUTS; exports.BLOG_MODULE_ID = _chunkHKZAESS6js.BLOG_MODULE_ID; exports.BLOG_POST_STATUSES = _chunkHKZAESS6js.BLOG_POST_STATUSES; exports.BLOG_POST_UPLOAD_PREFIX = _chunkHKZAESS6js.BLOG_POST_UPLOAD_PREFIX; exports.BLOG_PUBLIC_PREFIX = _chunkHKZAESS6js.BLOG_PUBLIC_PREFIX; exports.BLOG_SETTINGS_ID = _chunkHKZAESS6js.BLOG_SETTINGS_ID; exports.BLOG_STATUS_BADGE = BLOG_STATUS_BADGE; exports.BLOG_TRANSLATION_SOURCES = _chunkHKZAESS6js.BLOG_TRANSLATION_SOURCES; exports.BLOG_UPLOAD_ROOT = _chunkHKZAESS6js.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;
|
|
1799
1810
|
//# sourceMappingURL=index.js.map
|