@btst/stack 2.5.6 → 2.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -0
- package/dist/client/components/index.d.cts +9 -9
- package/dist/client/components/index.d.mts +9 -9
- package/dist/client/components/index.d.ts +9 -9
- package/dist/components/auto-form/index.cjs +8 -0
- package/dist/components/auto-form/index.d.cts +26 -0
- package/dist/components/auto-form/index.d.mts +26 -0
- package/dist/components/auto-form/index.d.ts +26 -0
- package/dist/components/auto-form/index.mjs +1 -0
- package/dist/components/empty/index.cjs +12 -0
- package/dist/components/empty/index.d.cts +15 -0
- package/dist/components/empty/index.d.mts +15 -0
- package/dist/components/empty/index.d.ts +15 -0
- package/dist/components/empty/index.mjs +1 -0
- package/dist/components/form-builder/index.cjs +16 -0
- package/dist/components/form-builder/index.d.cts +385 -0
- package/dist/components/form-builder/index.d.mts +385 -0
- package/dist/components/form-builder/index.d.ts +385 -0
- package/dist/components/form-builder/index.mjs +4 -0
- package/dist/components/markdown/index.cjs +9 -0
- package/dist/components/markdown/index.d.cts +30 -0
- package/dist/components/markdown/index.d.mts +30 -0
- package/dist/components/markdown/index.d.ts +30 -0
- package/dist/components/markdown/index.mjs +2 -0
- package/dist/components/markdown/style.css +394 -0
- package/dist/components/minimal-tiptap/style.css +548 -0
- package/dist/components/multi-select/index.cjs +7 -0
- package/dist/components/multi-select/index.d.cts +78 -0
- package/dist/components/multi-select/index.d.mts +78 -0
- package/dist/components/multi-select/index.d.ts +78 -0
- package/dist/components/multi-select/index.mjs +1 -0
- package/dist/components/search-select/index.cjs +7 -0
- package/dist/components/search-select/index.d.cts +15 -0
- package/dist/components/search-select/index.d.mts +15 -0
- package/dist/components/search-select/index.d.ts +15 -0
- package/dist/components/search-select/index.mjs +1 -0
- package/dist/components/stepped-auto-form/index.cjs +7 -0
- package/dist/components/stepped-auto-form/index.d.cts +37 -0
- package/dist/components/stepped-auto-form/index.d.mts +37 -0
- package/dist/components/stepped-auto-form/index.d.ts +37 -0
- package/dist/components/stepped-auto-form/index.mjs +1 -0
- package/dist/components/ui-builder/style.css +552 -0
- package/dist/node_modules/.pnpm/@dnd-kit_core@6.3.1_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@dnd-kit/core/dist/core.esm.cjs +1 -1
- package/dist/node_modules/.pnpm/@dnd-kit_core@6.3.1_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@dnd-kit/core/dist/core.esm.mjs +1 -1
- package/dist/node_modules/.pnpm/@dnd-kit_sortable@10.0.0_@dnd-kit_core@6.3.1_react-dom@19.2.0_react@19.2.0__react@19.2.0__react@19.2.0/node_modules/@dnd-kit/sortable/dist/sortable.esm.mjs +2 -2
- package/dist/node_modules/.pnpm/@floating-ui_core@1.7.3/node_modules/@floating-ui/core/dist/floating-ui.core.mjs +1 -1
- package/dist/node_modules/.pnpm/@floating-ui_dom@1.7.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs +3 -3
- package/dist/node_modules/.pnpm/@floating-ui_react-dom@2.1.6_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs +1 -1
- package/dist/packages/stack/src/plugins/ai-chat/client/components/shared/default-error.cjs +1 -1
- package/dist/packages/stack/src/plugins/ai-chat/client/components/shared/default-error.mjs +1 -1
- package/dist/packages/stack/src/plugins/ai-chat/client/plugin.cjs +44 -35
- package/dist/packages/stack/src/plugins/ai-chat/client/plugin.mjs +44 -35
- package/dist/packages/stack/src/plugins/blog/client/components/forms/markdown-editor-with-overrides.cjs +23 -0
- package/dist/packages/stack/src/plugins/blog/client/components/forms/markdown-editor-with-overrides.mjs +21 -0
- package/dist/packages/stack/src/plugins/blog/client/components/forms/markdown-editor.cjs +11 -12
- package/dist/packages/stack/src/plugins/blog/client/components/forms/markdown-editor.mjs +11 -12
- package/dist/packages/stack/src/plugins/blog/client/components/forms/post-forms.cjs +2 -2
- package/dist/packages/stack/src/plugins/blog/client/components/forms/post-forms.mjs +2 -2
- package/dist/packages/stack/src/plugins/blog/client/components/shared/default-error.cjs +1 -1
- package/dist/packages/stack/src/plugins/blog/client/components/shared/default-error.mjs +1 -1
- package/dist/packages/stack/src/plugins/blog/client/components/shared/search-input.cjs +0 -3
- package/dist/packages/stack/src/plugins/blog/client/components/shared/search-input.mjs +1 -1
- package/dist/packages/stack/src/plugins/blog/client/components/shared/search-modal.cjs +0 -3
- package/dist/packages/stack/src/plugins/blog/client/components/shared/search-modal.mjs +1 -1
- package/dist/packages/stack/src/plugins/blog/client/hooks/use-debounce.cjs +22 -0
- package/dist/packages/stack/src/plugins/blog/client/hooks/use-debounce.mjs +23 -2
- package/dist/packages/stack/src/plugins/blog/client/plugin.cjs +12 -6
- package/dist/packages/stack/src/plugins/blog/client/plugin.mjs +12 -6
- package/dist/packages/stack/src/plugins/cms/client/components/shared/default-error.cjs +1 -1
- package/dist/packages/stack/src/plugins/cms/client/components/shared/default-error.mjs +1 -1
- package/dist/packages/stack/src/plugins/cms/client/plugin.cjs +38 -26
- package/dist/packages/stack/src/plugins/cms/client/plugin.mjs +38 -26
- package/dist/packages/stack/src/plugins/form-builder/client/components/shared/default-error.cjs +1 -1
- package/dist/packages/stack/src/plugins/form-builder/client/components/shared/default-error.mjs +1 -1
- package/dist/packages/stack/src/plugins/form-builder/client/plugin.cjs +32 -20
- package/dist/packages/stack/src/plugins/form-builder/client/plugin.mjs +32 -20
- package/dist/packages/stack/src/plugins/kanban/client/components/shared/default-error.cjs +1 -1
- package/dist/packages/stack/src/plugins/kanban/client/components/shared/default-error.mjs +1 -1
- package/dist/packages/stack/src/plugins/kanban/client/plugin.cjs +6 -3
- package/dist/packages/stack/src/plugins/kanban/client/plugin.mjs +6 -3
- package/dist/packages/stack/src/plugins/ui-builder/client/components/page-renderer.cjs +1 -1
- package/dist/packages/stack/src/plugins/ui-builder/client/components/page-renderer.mjs +1 -1
- package/dist/packages/stack/src/plugins/ui-builder/client/components/shared/default-error.cjs +1 -1
- package/dist/packages/stack/src/plugins/ui-builder/client/components/shared/default-error.mjs +1 -1
- package/dist/packages/stack/src/plugins/ui-builder/client/plugin.cjs +24 -15
- package/dist/packages/stack/src/plugins/ui-builder/client/plugin.mjs +24 -15
- package/dist/packages/ui/src/components/auto-form/index.cjs +12 -2
- package/dist/packages/ui/src/components/auto-form/index.mjs +9 -2
- package/dist/packages/ui/src/components/auto-form/stepped-auto-form.cjs +2 -2
- package/dist/packages/ui/src/components/empty.cjs +28 -0
- package/dist/packages/ui/src/components/empty.mjs +27 -1
- package/dist/packages/ui/src/components/form-builder/components/index.mjs +2 -2
- package/dist/packages/ui/src/components/form-builder/edit-field-dialog.cjs +1 -1
- package/dist/packages/ui/src/components/form-builder/index.mjs +2 -2
- package/dist/packages/ui/src/components/form.mjs +1 -1
- package/dist/packages/ui/src/components/kanban.mjs +1 -1
- package/dist/packages/ui/src/components/multi-select.mjs +2 -2
- package/dist/packages/ui/src/components/search-select.cjs +13 -3
- package/dist/packages/ui/src/components/search-select.mjs +14 -4
- package/dist/packages/ui/src/components/ui-builder/internal/config-panel.cjs +1 -1
- package/dist/packages/ui/src/components/ui-builder/internal/props-panel.cjs +1 -1
- package/dist/plugins/ai-chat/client/index.d.cts +17 -4
- package/dist/plugins/ai-chat/client/index.d.mts +17 -4
- package/dist/plugins/ai-chat/client/index.d.ts +17 -4
- package/dist/plugins/blog/api/index.d.cts +2 -2
- package/dist/plugins/blog/api/index.d.mts +2 -2
- package/dist/plugins/blog/api/index.d.ts +2 -2
- package/dist/plugins/blog/client/hooks/index.cjs +3 -0
- package/dist/plugins/blog/client/hooks/index.d.cts +7 -226
- package/dist/plugins/blog/client/hooks/index.d.mts +7 -226
- package/dist/plugins/blog/client/hooks/index.d.ts +7 -226
- package/dist/plugins/blog/client/hooks/index.mjs +1 -0
- package/dist/plugins/blog/client/index.d.cts +46 -22
- package/dist/plugins/blog/client/index.d.mts +46 -22
- package/dist/plugins/blog/client/index.d.ts +46 -22
- package/dist/plugins/blog/query-keys.d.cts +2 -2
- package/dist/plugins/blog/query-keys.d.mts +2 -2
- package/dist/plugins/blog/query-keys.d.ts +2 -2
- package/dist/plugins/cms/client/index.d.cts +36 -15
- package/dist/plugins/cms/client/index.d.mts +36 -15
- package/dist/plugins/cms/client/index.d.ts +36 -15
- package/dist/plugins/form-builder/client/components/index.d.cts +2 -2
- package/dist/plugins/form-builder/client/components/index.d.mts +2 -2
- package/dist/plugins/form-builder/client/components/index.d.ts +2 -2
- package/dist/plugins/form-builder/client/index.d.cts +33 -15
- package/dist/plugins/form-builder/client/index.d.mts +33 -15
- package/dist/plugins/form-builder/client/index.d.ts +33 -15
- package/dist/plugins/kanban/api/index.d.cts +1 -1
- package/dist/plugins/kanban/api/index.d.mts +1 -1
- package/dist/plugins/kanban/api/index.d.ts +1 -1
- package/dist/plugins/kanban/client/components/index.d.cts +5 -5
- package/dist/plugins/kanban/client/components/index.d.mts +5 -5
- package/dist/plugins/kanban/client/components/index.d.ts +5 -5
- package/dist/plugins/kanban/client/index.d.cts +25 -10
- package/dist/plugins/kanban/client/index.d.mts +25 -10
- package/dist/plugins/kanban/client/index.d.ts +25 -10
- package/dist/plugins/kanban/query-keys.d.cts +1 -1
- package/dist/plugins/kanban/query-keys.d.mts +1 -1
- package/dist/plugins/kanban/query-keys.d.ts +1 -1
- package/dist/plugins/route-docs/client/index.d.cts +4 -4
- package/dist/plugins/route-docs/client/index.d.mts +4 -4
- package/dist/plugins/route-docs/client/index.d.ts +4 -4
- package/dist/plugins/ui-builder/client/components/index.d.cts +3 -3
- package/dist/plugins/ui-builder/client/components/index.d.mts +3 -3
- package/dist/plugins/ui-builder/client/components/index.d.ts +3 -3
- package/dist/plugins/ui-builder/client/hooks/index.d.cts +3 -3
- package/dist/plugins/ui-builder/client/hooks/index.d.mts +3 -3
- package/dist/plugins/ui-builder/client/hooks/index.d.ts +3 -3
- package/dist/plugins/ui-builder/client/index.d.cts +32 -18
- package/dist/plugins/ui-builder/client/index.d.mts +32 -18
- package/dist/plugins/ui-builder/client/index.d.ts +32 -18
- package/dist/plugins/ui-builder/index.d.cts +3 -3
- package/dist/plugins/ui-builder/index.d.mts +3 -3
- package/dist/plugins/ui-builder/index.d.ts +3 -3
- package/dist/shared/{stack.B2DwzF3r.d.ts → stack.ASwEoINr.d.ts} +1 -1
- package/dist/shared/{stack.C5ZSOJGJ.d.cts → stack.B1srlBud.d.mts} +1 -1
- package/dist/shared/stack.B8vT-Yt4.d.mts +228 -0
- package/dist/shared/stack.BAT540yW.d.ts +228 -0
- package/dist/shared/{stack.D0QupDcQ.d.ts → stack.BK9Z2dcL.d.ts} +1 -1
- package/dist/shared/stack.BwA7trxA.d.cts +228 -0
- package/dist/shared/{stack.Cl7ok_cY.d.cts → stack.CFECM0ew.d.cts} +1 -1
- package/dist/shared/stack.CZMWR72v.d.cts +10 -0
- package/dist/shared/stack.CZMWR72v.d.mts +10 -0
- package/dist/shared/stack.CZMWR72v.d.ts +10 -0
- package/dist/shared/{stack.VMmQdbsJ.d.mts → stack.DVtk5CNw.d.mts} +1 -1
- package/dist/shared/{stack.B8_74ror.d.ts → stack.DXnclTG7.d.ts} +4 -4
- package/dist/shared/{stack.C21-LFX8.d.cts → stack.DaZM10cp.d.cts} +4 -4
- package/dist/shared/{stack.Dq4qVr1F.d.mts → stack.DmpPDPxA.d.cts} +1 -1
- package/dist/shared/{stack.CL4mKxe7.d.mts → stack.cfCkioTe.d.mts} +4 -4
- package/dist/shared/stack.fdi94T4S.d.cts +291 -0
- package/dist/shared/stack.fdi94T4S.d.mts +291 -0
- package/dist/shared/stack.fdi94T4S.d.ts +291 -0
- package/package.json +115 -4
- package/src/__tests__/page-component-overrides.test.tsx +147 -0
- package/src/components/auto-form/index.ts +12 -0
- package/src/components/empty/index.ts +8 -0
- package/src/components/form-builder/index.ts +23 -0
- package/src/components/kanban/index.ts +9 -0
- package/src/components/markdown/index.ts +5 -0
- package/src/components/markdown/style.css +3 -0
- package/src/components/minimal-tiptap/index.ts +5 -0
- package/src/components/minimal-tiptap/style.css +1 -0
- package/src/components/multi-select/index.ts +5 -0
- package/src/components/search-select/index.ts +1 -0
- package/src/components/stepped-auto-form/index.ts +5 -0
- package/src/components/ui-builder/index.ts +50 -0
- package/src/components/ui-builder/style.css +5 -0
- package/src/plugins/ai-chat/client/components/shared/default-error.tsx +1 -1
- package/src/plugins/ai-chat/client/plugin.tsx +60 -32
- package/src/plugins/blog/client/components/forms/markdown-editor-with-overrides.tsx +29 -0
- package/src/plugins/blog/client/components/forms/markdown-editor.tsx +24 -21
- package/src/plugins/blog/client/components/forms/post-forms.tsx +2 -2
- package/src/plugins/blog/client/components/shared/default-error.tsx +2 -1
- package/src/plugins/blog/client/components/shared/posts-list.tsx +1 -1
- package/src/plugins/blog/client/components/shared/search-input.tsx +0 -2
- package/src/plugins/blog/client/components/shared/search-modal.tsx +0 -2
- package/src/plugins/blog/client/hooks/index.tsx +1 -0
- package/src/plugins/blog/client/plugin.tsx +41 -6
- package/src/plugins/cms/client/components/shared/default-error.tsx +3 -2
- package/src/plugins/cms/client/plugin.tsx +65 -32
- package/src/plugins/form-builder/client/components/shared/default-error.tsx +3 -2
- package/src/plugins/form-builder/client/plugin.tsx +56 -23
- package/src/plugins/kanban/client/components/shared/default-error.tsx +3 -2
- package/src/plugins/kanban/client/plugin.tsx +23 -3
- package/src/plugins/ui-builder/client/components/page-renderer.tsx +5 -3
- package/src/plugins/ui-builder/client/components/shared/default-error.tsx +3 -2
- package/src/plugins/ui-builder/client/plugin.tsx +41 -15
- package/dist/shared/stack.8nldKomx.d.cts +0 -114
- package/dist/shared/stack.8nldKomx.d.mts +0 -114
- package/dist/shared/stack.8nldKomx.d.ts +0 -114
- package/dist/shared/{stack.CxNeGV2z.d.mts → stack.B8D4r97Z.d.mts} +6 -6
- package/dist/shared/{stack.BWp0hcm9.d.cts → stack.BQmuNl5p.d.cts} +3 -3
- package/dist/shared/{stack.BWp0hcm9.d.mts → stack.BQmuNl5p.d.mts} +3 -3
- package/dist/shared/{stack.BWp0hcm9.d.ts → stack.BQmuNl5p.d.ts} +3 -3
- package/dist/shared/{stack.BFcg0tDz.d.ts → stack.DgKOwl20.d.ts} +6 -6
- package/dist/shared/{stack.DSxTDZBQ.d.cts → stack.uWSqCWAb.d.cts} +6 -6
|
@@ -179,18 +179,21 @@ const aiChatClientPlugin = (config) => {
|
|
|
179
179
|
name: "ai-chat",
|
|
180
180
|
routes: () => ({
|
|
181
181
|
// Chat home - simple chat interface without history
|
|
182
|
-
chat: yar.createRoute("/chat", () =>
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
182
|
+
chat: yar.createRoute("/chat", () => {
|
|
183
|
+
const CustomChat = config.pageComponents?.chat;
|
|
184
|
+
return {
|
|
185
|
+
PageComponent: CustomChat ?? (() => /* @__PURE__ */ jsxRuntime.jsx(
|
|
186
|
+
chatLayout.ChatLayout,
|
|
187
|
+
{
|
|
188
|
+
apiBaseURL: config.apiBaseURL,
|
|
189
|
+
apiBasePath: config.apiBasePath,
|
|
190
|
+
showSidebar: false
|
|
191
|
+
}
|
|
192
|
+
)),
|
|
193
|
+
loader: createConversationsLoader(config),
|
|
194
|
+
meta: createChatHomeMeta(config)
|
|
195
|
+
};
|
|
196
|
+
})
|
|
194
197
|
}),
|
|
195
198
|
sitemap: async () => []
|
|
196
199
|
});
|
|
@@ -199,30 +202,36 @@ const aiChatClientPlugin = (config) => {
|
|
|
199
202
|
name: "ai-chat",
|
|
200
203
|
routes: () => ({
|
|
201
204
|
// Chat home - new conversation or list
|
|
202
|
-
chat: yar.createRoute("/chat", () =>
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
205
|
+
chat: yar.createRoute("/chat", () => {
|
|
206
|
+
const CustomChat = config.pageComponents?.chat;
|
|
207
|
+
return {
|
|
208
|
+
PageComponent: CustomChat ?? (() => /* @__PURE__ */ jsxRuntime.jsx(
|
|
209
|
+
chatLayout.ChatLayout,
|
|
210
|
+
{
|
|
211
|
+
apiBaseURL: config.apiBaseURL,
|
|
212
|
+
apiBasePath: config.apiBasePath
|
|
213
|
+
}
|
|
214
|
+
)),
|
|
215
|
+
loader: createConversationsLoader(config),
|
|
216
|
+
meta: createChatHomeMeta(config)
|
|
217
|
+
};
|
|
218
|
+
}),
|
|
213
219
|
// Existing conversation
|
|
214
|
-
chatConversation: yar.createRoute("/chat/:id", ({ params }) =>
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
{
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
220
|
+
chatConversation: yar.createRoute("/chat/:id", ({ params }) => {
|
|
221
|
+
const CustomConversation = config.pageComponents?.chatConversation;
|
|
222
|
+
return {
|
|
223
|
+
PageComponent: CustomConversation ? () => /* @__PURE__ */ jsxRuntime.jsx(CustomConversation, { conversationId: params.id }) : () => /* @__PURE__ */ jsxRuntime.jsx(
|
|
224
|
+
chatLayout.ChatLayout,
|
|
225
|
+
{
|
|
226
|
+
apiBaseURL: config.apiBaseURL,
|
|
227
|
+
apiBasePath: config.apiBasePath,
|
|
228
|
+
conversationId: params.id
|
|
229
|
+
}
|
|
230
|
+
),
|
|
231
|
+
loader: createConversationLoader(params.id, config),
|
|
232
|
+
meta: createConversationMeta(params.id, config)
|
|
233
|
+
};
|
|
234
|
+
})
|
|
226
235
|
}),
|
|
227
236
|
// Chat pages typically shouldn't be in sitemap, but we provide the option
|
|
228
237
|
sitemap: async () => {
|
|
@@ -177,18 +177,21 @@ const aiChatClientPlugin = (config) => {
|
|
|
177
177
|
name: "ai-chat",
|
|
178
178
|
routes: () => ({
|
|
179
179
|
// Chat home - simple chat interface without history
|
|
180
|
-
chat: createRoute("/chat", () =>
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
180
|
+
chat: createRoute("/chat", () => {
|
|
181
|
+
const CustomChat = config.pageComponents?.chat;
|
|
182
|
+
return {
|
|
183
|
+
PageComponent: CustomChat ?? (() => /* @__PURE__ */ jsx(
|
|
184
|
+
ChatLayout,
|
|
185
|
+
{
|
|
186
|
+
apiBaseURL: config.apiBaseURL,
|
|
187
|
+
apiBasePath: config.apiBasePath,
|
|
188
|
+
showSidebar: false
|
|
189
|
+
}
|
|
190
|
+
)),
|
|
191
|
+
loader: createConversationsLoader(config),
|
|
192
|
+
meta: createChatHomeMeta(config)
|
|
193
|
+
};
|
|
194
|
+
})
|
|
192
195
|
}),
|
|
193
196
|
sitemap: async () => []
|
|
194
197
|
});
|
|
@@ -197,30 +200,36 @@ const aiChatClientPlugin = (config) => {
|
|
|
197
200
|
name: "ai-chat",
|
|
198
201
|
routes: () => ({
|
|
199
202
|
// Chat home - new conversation or list
|
|
200
|
-
chat: createRoute("/chat", () =>
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
203
|
+
chat: createRoute("/chat", () => {
|
|
204
|
+
const CustomChat = config.pageComponents?.chat;
|
|
205
|
+
return {
|
|
206
|
+
PageComponent: CustomChat ?? (() => /* @__PURE__ */ jsx(
|
|
207
|
+
ChatLayout,
|
|
208
|
+
{
|
|
209
|
+
apiBaseURL: config.apiBaseURL,
|
|
210
|
+
apiBasePath: config.apiBasePath
|
|
211
|
+
}
|
|
212
|
+
)),
|
|
213
|
+
loader: createConversationsLoader(config),
|
|
214
|
+
meta: createChatHomeMeta(config)
|
|
215
|
+
};
|
|
216
|
+
}),
|
|
211
217
|
// Existing conversation
|
|
212
|
-
chatConversation: createRoute("/chat/:id", ({ params }) =>
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
{
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
218
|
+
chatConversation: createRoute("/chat/:id", ({ params }) => {
|
|
219
|
+
const CustomConversation = config.pageComponents?.chatConversation;
|
|
220
|
+
return {
|
|
221
|
+
PageComponent: CustomConversation ? () => /* @__PURE__ */ jsx(CustomConversation, { conversationId: params.id }) : () => /* @__PURE__ */ jsx(
|
|
222
|
+
ChatLayout,
|
|
223
|
+
{
|
|
224
|
+
apiBaseURL: config.apiBaseURL,
|
|
225
|
+
apiBasePath: config.apiBasePath,
|
|
226
|
+
conversationId: params.id
|
|
227
|
+
}
|
|
228
|
+
),
|
|
229
|
+
loader: createConversationLoader(params.id, config),
|
|
230
|
+
meta: createConversationMeta(params.id, config)
|
|
231
|
+
};
|
|
232
|
+
})
|
|
224
233
|
}),
|
|
225
234
|
// Chat pages typically shouldn't be in sitemap, but we provide the option
|
|
226
235
|
sitemap: async () => {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
const context = require('@btst/stack/context');
|
|
6
|
+
const index = require('../../localization/index.cjs');
|
|
7
|
+
const markdownEditor = require('./markdown-editor.cjs');
|
|
8
|
+
|
|
9
|
+
function MarkdownEditorWithOverrides(props) {
|
|
10
|
+
const { uploadImage, localization } = context.usePluginOverrides("blog", {
|
|
11
|
+
localization: index.BLOG_LOCALIZATION
|
|
12
|
+
});
|
|
13
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
14
|
+
markdownEditor.MarkdownEditor,
|
|
15
|
+
{
|
|
16
|
+
...props,
|
|
17
|
+
uploadImage,
|
|
18
|
+
placeholder: localization?.BLOG_FORMS_EDITOR_PLACEHOLDER
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
exports.MarkdownEditorWithOverrides = MarkdownEditorWithOverrides;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { usePluginOverrides } from '@btst/stack/context';
|
|
4
|
+
import { BLOG_LOCALIZATION } from '../../localization/index.mjs';
|
|
5
|
+
import { MarkdownEditor } from './markdown-editor.mjs';
|
|
6
|
+
|
|
7
|
+
function MarkdownEditorWithOverrides(props) {
|
|
8
|
+
const { uploadImage, localization } = usePluginOverrides("blog", {
|
|
9
|
+
localization: BLOG_LOCALIZATION
|
|
10
|
+
});
|
|
11
|
+
return /* @__PURE__ */ jsx(
|
|
12
|
+
MarkdownEditor,
|
|
13
|
+
{
|
|
14
|
+
...props,
|
|
15
|
+
uploadImage,
|
|
16
|
+
placeholder: localization?.BLOG_FORMS_EDITOR_PLACEHOLDER
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export { MarkdownEditorWithOverrides };
|
|
@@ -10,17 +10,14 @@ const listener = require('@milkdown/kit/plugin/listener');
|
|
|
10
10
|
const model = require('@milkdown/kit/prose/model');
|
|
11
11
|
const state = require('@milkdown/kit/prose/state');
|
|
12
12
|
const React = require('react');
|
|
13
|
-
const context = require('@btst/stack/context');
|
|
14
|
-
const index = require('../../localization/index.cjs');
|
|
15
13
|
|
|
16
14
|
function MarkdownEditor({
|
|
17
15
|
value,
|
|
18
16
|
onChange,
|
|
19
|
-
className
|
|
17
|
+
className,
|
|
18
|
+
uploadImage,
|
|
19
|
+
placeholder = "Write something..."
|
|
20
20
|
}) {
|
|
21
|
-
const { uploadImage, localization } = context.usePluginOverrides("blog", {
|
|
22
|
-
localization: index.BLOG_LOCALIZATION
|
|
23
|
-
});
|
|
24
21
|
const containerRef = React.useRef(null);
|
|
25
22
|
const crepeRef = React.useRef(null);
|
|
26
23
|
const isReadyRef = React.useRef(false);
|
|
@@ -38,14 +35,16 @@ function MarkdownEditor({
|
|
|
38
35
|
defaultValue: initialValueRef.current,
|
|
39
36
|
featureConfigs: {
|
|
40
37
|
[crepe.CrepeFeature.Placeholder]: {
|
|
41
|
-
text:
|
|
38
|
+
text: placeholder
|
|
42
39
|
},
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
40
|
+
...uploadImage ? {
|
|
41
|
+
[crepe.CrepeFeature.ImageBlock]: {
|
|
42
|
+
onUpload: async (file) => {
|
|
43
|
+
const url = await uploadImage(file);
|
|
44
|
+
return url;
|
|
45
|
+
}
|
|
47
46
|
}
|
|
48
|
-
}
|
|
47
|
+
} : {}
|
|
49
48
|
}
|
|
50
49
|
});
|
|
51
50
|
throttledOnChangeRef.current = utils.throttle((markdown) => {
|
|
@@ -8,17 +8,14 @@ import { listenerCtx, listener } from '@milkdown/kit/plugin/listener';
|
|
|
8
8
|
import { Slice } from '@milkdown/kit/prose/model';
|
|
9
9
|
import { Selection } from '@milkdown/kit/prose/state';
|
|
10
10
|
import { useRef, useState, useLayoutEffect } from 'react';
|
|
11
|
-
import { usePluginOverrides } from '@btst/stack/context';
|
|
12
|
-
import { BLOG_LOCALIZATION } from '../../localization/index.mjs';
|
|
13
11
|
|
|
14
12
|
function MarkdownEditor({
|
|
15
13
|
value,
|
|
16
14
|
onChange,
|
|
17
|
-
className
|
|
15
|
+
className,
|
|
16
|
+
uploadImage,
|
|
17
|
+
placeholder = "Write something..."
|
|
18
18
|
}) {
|
|
19
|
-
const { uploadImage, localization } = usePluginOverrides("blog", {
|
|
20
|
-
localization: BLOG_LOCALIZATION
|
|
21
|
-
});
|
|
22
19
|
const containerRef = useRef(null);
|
|
23
20
|
const crepeRef = useRef(null);
|
|
24
21
|
const isReadyRef = useRef(false);
|
|
@@ -36,14 +33,16 @@ function MarkdownEditor({
|
|
|
36
33
|
defaultValue: initialValueRef.current,
|
|
37
34
|
featureConfigs: {
|
|
38
35
|
[CrepeFeature.Placeholder]: {
|
|
39
|
-
text:
|
|
36
|
+
text: placeholder
|
|
40
37
|
},
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
...uploadImage ? {
|
|
39
|
+
[CrepeFeature.ImageBlock]: {
|
|
40
|
+
onUpload: async (file) => {
|
|
41
|
+
const url = await uploadImage(file);
|
|
42
|
+
return url;
|
|
43
|
+
}
|
|
45
44
|
}
|
|
46
|
-
}
|
|
45
|
+
} : {}
|
|
47
46
|
}
|
|
48
47
|
});
|
|
49
48
|
throttledOnChangeRef.current = throttle((markdown) => {
|
|
@@ -23,8 +23,8 @@ const emptyList = require('../shared/empty-list.cjs');
|
|
|
23
23
|
const tagsMultiselect = require('./tags-multiselect.cjs');
|
|
24
24
|
|
|
25
25
|
const MarkdownEditor = React.lazy(
|
|
26
|
-
() => import('./markdown-editor.cjs').then((module) => ({
|
|
27
|
-
default: module.
|
|
26
|
+
() => import('./markdown-editor-with-overrides.cjs').then((module) => ({
|
|
27
|
+
default: module.MarkdownEditorWithOverrides
|
|
28
28
|
}))
|
|
29
29
|
);
|
|
30
30
|
function PostFormBody({
|
|
@@ -21,8 +21,8 @@ import { EmptyList } from '../shared/empty-list.mjs';
|
|
|
21
21
|
import { TagsMultiSelect } from './tags-multiselect.mjs';
|
|
22
22
|
|
|
23
23
|
const MarkdownEditor = lazy(
|
|
24
|
-
() => import('./markdown-editor.mjs').then((module) => ({
|
|
25
|
-
default: module.
|
|
24
|
+
() => import('./markdown-editor-with-overrides.mjs').then((module) => ({
|
|
25
|
+
default: module.MarkdownEditorWithOverrides
|
|
26
26
|
}))
|
|
27
27
|
);
|
|
28
28
|
function PostFormBody({
|
|
@@ -11,7 +11,7 @@ function DefaultError({ error }) {
|
|
|
11
11
|
localization: index.BLOG_LOCALIZATION
|
|
12
12
|
});
|
|
13
13
|
const title = localization.BLOG_GENERIC_ERROR_TITLE;
|
|
14
|
-
const message = process.env.NODE_ENV === "production" ? localization.BLOG_GENERIC_ERROR_MESSAGE : error
|
|
14
|
+
const message = process.env.NODE_ENV === "production" ? localization.BLOG_GENERIC_ERROR_MESSAGE : (error instanceof Error ? error.message : void 0) ?? localization.BLOG_GENERIC_ERROR_MESSAGE;
|
|
15
15
|
return /* @__PURE__ */ jsxRuntime.jsx(errorPlaceholder.ErrorPlaceholder, { title, message });
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -9,7 +9,7 @@ function DefaultError({ error }) {
|
|
|
9
9
|
localization: BLOG_LOCALIZATION
|
|
10
10
|
});
|
|
11
11
|
const title = localization.BLOG_GENERIC_ERROR_TITLE;
|
|
12
|
-
const message = process.env.NODE_ENV === "production" ? localization.BLOG_GENERIC_ERROR_MESSAGE : error
|
|
12
|
+
const message = process.env.NODE_ENV === "production" ? localization.BLOG_GENERIC_ERROR_MESSAGE : (error instanceof Error ? error.message : void 0) ?? localization.BLOG_GENERIC_ERROR_MESSAGE;
|
|
13
13
|
return /* @__PURE__ */ jsx(ErrorPlaceholder, { title, message });
|
|
14
14
|
}
|
|
15
15
|
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
-
|
|
6
4
|
const jsxRuntime = require('react/jsx-runtime');
|
|
7
5
|
const React = require('react');
|
|
8
6
|
const blogHooks = require('../../hooks/blog-hooks.cjs');
|
|
@@ -133,4 +131,3 @@ function SearchInput({
|
|
|
133
131
|
}
|
|
134
132
|
|
|
135
133
|
exports.SearchInput = SearchInput;
|
|
136
|
-
exports.default = SearchInput;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
-
|
|
6
4
|
const jsxRuntime = require('react/jsx-runtime');
|
|
7
5
|
const LucideIcons = require('lucide-react');
|
|
8
6
|
const React = require('react');
|
|
@@ -132,4 +130,3 @@ function SearchModal({
|
|
|
132
130
|
}
|
|
133
131
|
|
|
134
132
|
exports.SearchModal = SearchModal;
|
|
135
|
-
exports.default = SearchModal;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
const utils = require('../../utils.cjs');
|
|
3
4
|
const React = require('react');
|
|
4
5
|
|
|
5
6
|
function useDebounce(value, delay) {
|
|
@@ -12,5 +13,26 @@ function useDebounce(value, delay) {
|
|
|
12
13
|
}, [value, delay]);
|
|
13
14
|
return debouncedValue;
|
|
14
15
|
}
|
|
16
|
+
function useThrottle(value, wait) {
|
|
17
|
+
const [throttledValue, setThrottledValue] = React.useState(value);
|
|
18
|
+
const valueRef = React.useRef(value);
|
|
19
|
+
valueRef.current = value;
|
|
20
|
+
const throttledSetter = React.useMemo(() => {
|
|
21
|
+
return utils.throttle((next) => {
|
|
22
|
+
setThrottledValue(next);
|
|
23
|
+
}, wait ?? 500);
|
|
24
|
+
}, [wait]);
|
|
25
|
+
React.useEffect(() => {
|
|
26
|
+
throttledSetter(valueRef.current);
|
|
27
|
+
return () => {
|
|
28
|
+
throttledSetter.cancel();
|
|
29
|
+
};
|
|
30
|
+
}, [throttledSetter]);
|
|
31
|
+
React.useEffect(() => {
|
|
32
|
+
throttledSetter(value);
|
|
33
|
+
}, [value, throttledSetter]);
|
|
34
|
+
return throttledValue;
|
|
35
|
+
}
|
|
15
36
|
|
|
16
37
|
exports.useDebounce = useDebounce;
|
|
38
|
+
exports.useThrottle = useThrottle;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { throttle } from '../../utils.mjs';
|
|
2
|
+
import { useState, useEffect, useRef, useMemo } from 'react';
|
|
2
3
|
|
|
3
4
|
function useDebounce(value, delay) {
|
|
4
5
|
const [debouncedValue, setDebouncedValue] = useState(value);
|
|
@@ -10,5 +11,25 @@ function useDebounce(value, delay) {
|
|
|
10
11
|
}, [value, delay]);
|
|
11
12
|
return debouncedValue;
|
|
12
13
|
}
|
|
14
|
+
function useThrottle(value, wait) {
|
|
15
|
+
const [throttledValue, setThrottledValue] = useState(value);
|
|
16
|
+
const valueRef = useRef(value);
|
|
17
|
+
valueRef.current = value;
|
|
18
|
+
const throttledSetter = useMemo(() => {
|
|
19
|
+
return throttle((next) => {
|
|
20
|
+
setThrottledValue(next);
|
|
21
|
+
}, wait ?? 500);
|
|
22
|
+
}, [wait]);
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
throttledSetter(valueRef.current);
|
|
25
|
+
return () => {
|
|
26
|
+
throttledSetter.cancel();
|
|
27
|
+
};
|
|
28
|
+
}, [throttledSetter]);
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
throttledSetter(value);
|
|
31
|
+
}, [value, throttledSetter]);
|
|
32
|
+
return throttledValue;
|
|
33
|
+
}
|
|
13
34
|
|
|
14
|
-
export { useDebounce };
|
|
35
|
+
export { useDebounce, useThrottle };
|
|
@@ -422,43 +422,49 @@ const blogClientPlugin = (config) => client.defineClientPlugin({
|
|
|
422
422
|
name: "blog",
|
|
423
423
|
routes: () => ({
|
|
424
424
|
posts: yar.createRoute("/blog", () => {
|
|
425
|
+
const CustomPosts = config.pageComponents?.posts;
|
|
425
426
|
return {
|
|
426
|
-
PageComponent: () => /* @__PURE__ */ jsxRuntime.jsx(homePage.HomePageComponent, { published: true }),
|
|
427
|
+
PageComponent: CustomPosts ?? (() => /* @__PURE__ */ jsxRuntime.jsx(homePage.HomePageComponent, { published: true })),
|
|
427
428
|
loader: createPostsLoader(true, config),
|
|
428
429
|
meta: createPostsListMeta(true, config)
|
|
429
430
|
};
|
|
430
431
|
}),
|
|
431
432
|
drafts: yar.createRoute("/blog/drafts", () => {
|
|
433
|
+
const CustomDrafts = config.pageComponents?.drafts;
|
|
432
434
|
return {
|
|
433
|
-
PageComponent: () => /* @__PURE__ */ jsxRuntime.jsx(homePage.HomePageComponent, { published: false }),
|
|
435
|
+
PageComponent: CustomDrafts ?? (() => /* @__PURE__ */ jsxRuntime.jsx(homePage.HomePageComponent, { published: false })),
|
|
434
436
|
loader: createPostsLoader(false, config),
|
|
435
437
|
meta: createPostsListMeta(false, config)
|
|
436
438
|
};
|
|
437
439
|
}),
|
|
438
440
|
newPost: yar.createRoute("/blog/new", () => {
|
|
441
|
+
const CustomNewPost = config.pageComponents?.newPost;
|
|
439
442
|
return {
|
|
440
|
-
PageComponent: newPostPage.NewPostPageComponent,
|
|
443
|
+
PageComponent: CustomNewPost ?? newPostPage.NewPostPageComponent,
|
|
441
444
|
loader: createNewPostLoader(config),
|
|
442
445
|
meta: createNewPostMeta(config)
|
|
443
446
|
};
|
|
444
447
|
}),
|
|
445
448
|
editPost: yar.createRoute("/blog/:slug/edit", ({ params: { slug } }) => {
|
|
449
|
+
const CustomEditPost = config.pageComponents?.editPost;
|
|
446
450
|
return {
|
|
447
|
-
PageComponent: () => /* @__PURE__ */ jsxRuntime.jsx(editPostPage.EditPostPageComponent, { slug }),
|
|
451
|
+
PageComponent: CustomEditPost ? () => /* @__PURE__ */ jsxRuntime.jsx(CustomEditPost, { slug }) : () => /* @__PURE__ */ jsxRuntime.jsx(editPostPage.EditPostPageComponent, { slug }),
|
|
448
452
|
loader: createPostLoader(slug, config, `/blog/${slug}/edit`),
|
|
449
453
|
meta: createEditPostMeta(slug, config)
|
|
450
454
|
};
|
|
451
455
|
}),
|
|
452
456
|
tag: yar.createRoute("/blog/tag/:tagSlug", ({ params: { tagSlug } }) => {
|
|
457
|
+
const CustomTag = config.pageComponents?.tag;
|
|
453
458
|
return {
|
|
454
|
-
PageComponent: () => /* @__PURE__ */ jsxRuntime.jsx(tagPage.TagPageComponent, { tagSlug }),
|
|
459
|
+
PageComponent: CustomTag ? () => /* @__PURE__ */ jsxRuntime.jsx(CustomTag, { tagSlug }) : () => /* @__PURE__ */ jsxRuntime.jsx(tagPage.TagPageComponent, { tagSlug }),
|
|
455
460
|
loader: createTagLoader(tagSlug, config),
|
|
456
461
|
meta: createTagMeta(tagSlug, config)
|
|
457
462
|
};
|
|
458
463
|
}),
|
|
459
464
|
post: yar.createRoute("/blog/:slug", ({ params: { slug } }) => {
|
|
465
|
+
const CustomPost = config.pageComponents?.post;
|
|
460
466
|
return {
|
|
461
|
-
PageComponent: () => /* @__PURE__ */ jsxRuntime.jsx(postPage.PostPageComponent, { slug }),
|
|
467
|
+
PageComponent: CustomPost ? () => /* @__PURE__ */ jsxRuntime.jsx(CustomPost, { slug }) : () => /* @__PURE__ */ jsxRuntime.jsx(postPage.PostPageComponent, { slug }),
|
|
462
468
|
loader: createPostLoader(slug, config),
|
|
463
469
|
meta: createPostMeta(slug, config)
|
|
464
470
|
};
|
|
@@ -420,43 +420,49 @@ const blogClientPlugin = (config) => defineClientPlugin({
|
|
|
420
420
|
name: "blog",
|
|
421
421
|
routes: () => ({
|
|
422
422
|
posts: createRoute("/blog", () => {
|
|
423
|
+
const CustomPosts = config.pageComponents?.posts;
|
|
423
424
|
return {
|
|
424
|
-
PageComponent: () => /* @__PURE__ */ jsx(HomePageComponent, { published: true }),
|
|
425
|
+
PageComponent: CustomPosts ?? (() => /* @__PURE__ */ jsx(HomePageComponent, { published: true })),
|
|
425
426
|
loader: createPostsLoader(true, config),
|
|
426
427
|
meta: createPostsListMeta(true, config)
|
|
427
428
|
};
|
|
428
429
|
}),
|
|
429
430
|
drafts: createRoute("/blog/drafts", () => {
|
|
431
|
+
const CustomDrafts = config.pageComponents?.drafts;
|
|
430
432
|
return {
|
|
431
|
-
PageComponent: () => /* @__PURE__ */ jsx(HomePageComponent, { published: false }),
|
|
433
|
+
PageComponent: CustomDrafts ?? (() => /* @__PURE__ */ jsx(HomePageComponent, { published: false })),
|
|
432
434
|
loader: createPostsLoader(false, config),
|
|
433
435
|
meta: createPostsListMeta(false, config)
|
|
434
436
|
};
|
|
435
437
|
}),
|
|
436
438
|
newPost: createRoute("/blog/new", () => {
|
|
439
|
+
const CustomNewPost = config.pageComponents?.newPost;
|
|
437
440
|
return {
|
|
438
|
-
PageComponent: NewPostPageComponent,
|
|
441
|
+
PageComponent: CustomNewPost ?? NewPostPageComponent,
|
|
439
442
|
loader: createNewPostLoader(config),
|
|
440
443
|
meta: createNewPostMeta(config)
|
|
441
444
|
};
|
|
442
445
|
}),
|
|
443
446
|
editPost: createRoute("/blog/:slug/edit", ({ params: { slug } }) => {
|
|
447
|
+
const CustomEditPost = config.pageComponents?.editPost;
|
|
444
448
|
return {
|
|
445
|
-
PageComponent: () => /* @__PURE__ */ jsx(EditPostPageComponent, { slug }),
|
|
449
|
+
PageComponent: CustomEditPost ? () => /* @__PURE__ */ jsx(CustomEditPost, { slug }) : () => /* @__PURE__ */ jsx(EditPostPageComponent, { slug }),
|
|
446
450
|
loader: createPostLoader(slug, config, `/blog/${slug}/edit`),
|
|
447
451
|
meta: createEditPostMeta(slug, config)
|
|
448
452
|
};
|
|
449
453
|
}),
|
|
450
454
|
tag: createRoute("/blog/tag/:tagSlug", ({ params: { tagSlug } }) => {
|
|
455
|
+
const CustomTag = config.pageComponents?.tag;
|
|
451
456
|
return {
|
|
452
|
-
PageComponent: () => /* @__PURE__ */ jsx(TagPageComponent, { tagSlug }),
|
|
457
|
+
PageComponent: CustomTag ? () => /* @__PURE__ */ jsx(CustomTag, { tagSlug }) : () => /* @__PURE__ */ jsx(TagPageComponent, { tagSlug }),
|
|
453
458
|
loader: createTagLoader(tagSlug, config),
|
|
454
459
|
meta: createTagMeta(tagSlug, config)
|
|
455
460
|
};
|
|
456
461
|
}),
|
|
457
462
|
post: createRoute("/blog/:slug", ({ params: { slug } }) => {
|
|
463
|
+
const CustomPost = config.pageComponents?.post;
|
|
458
464
|
return {
|
|
459
|
-
PageComponent: () => /* @__PURE__ */ jsx(PostPageComponent, { slug }),
|
|
465
|
+
PageComponent: CustomPost ? () => /* @__PURE__ */ jsx(CustomPost, { slug }) : () => /* @__PURE__ */ jsx(PostPageComponent, { slug }),
|
|
460
466
|
loader: createPostLoader(slug, config),
|
|
461
467
|
meta: createPostMeta(slug, config)
|
|
462
468
|
};
|
|
@@ -9,7 +9,7 @@ function DefaultError({ error, resetErrorBoundary }) {
|
|
|
9
9
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center py-12 px-4 text-center", children: [
|
|
10
10
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-full bg-destructive/10 p-4 mb-4", children: /* @__PURE__ */ jsxRuntime.jsx(LucideIcons.AlertCircle, { className: "h-8 w-8 text-destructive" }) }),
|
|
11
11
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-lg font-medium text-foreground mb-2", children: "Something went wrong" }),
|
|
12
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground mb-4 max-w-sm", children: error.message || "An unexpected error occurred" }),
|
|
12
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground mb-4 max-w-sm", children: (error instanceof Error ? error.message : void 0) || "An unexpected error occurred" }),
|
|
13
13
|
resetErrorBoundary && /* @__PURE__ */ jsxRuntime.jsx(button.Button, { variant: "outline", onClick: resetErrorBoundary, children: "Try again" })
|
|
14
14
|
] });
|
|
15
15
|
}
|
|
@@ -7,7 +7,7 @@ function DefaultError({ error, resetErrorBoundary }) {
|
|
|
7
7
|
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center py-12 px-4 text-center", children: [
|
|
8
8
|
/* @__PURE__ */ jsx("div", { className: "rounded-full bg-destructive/10 p-4 mb-4", children: /* @__PURE__ */ jsx(AlertCircle, { className: "h-8 w-8 text-destructive" }) }),
|
|
9
9
|
/* @__PURE__ */ jsx("h3", { className: "text-lg font-medium text-foreground mb-2", children: "Something went wrong" }),
|
|
10
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mb-4 max-w-sm", children: error.message || "An unexpected error occurred" }),
|
|
10
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mb-4 max-w-sm", children: (error instanceof Error ? error.message : void 0) || "An unexpected error occurred" }),
|
|
11
11
|
resetErrorBoundary && /* @__PURE__ */ jsx(Button, { variant: "outline", onClick: resetErrorBoundary, children: "Try again" })
|
|
12
12
|
] });
|
|
13
13
|
}
|