@btst/stack 2.6.2 → 2.8.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/README.md +1 -0
- package/dist/api/index.d.cts +2 -2
- package/dist/api/index.d.mts +2 -2
- package/dist/api/index.d.ts +2 -2
- package/dist/client/index.d.cts +2 -2
- package/dist/client/index.d.mts +2 -2
- package/dist/client/index.d.ts +2 -2
- package/dist/components/auto-form/index.d.cts +2 -2
- package/dist/components/auto-form/index.d.mts +2 -2
- package/dist/components/auto-form/index.d.ts +2 -2
- package/dist/components/form-builder/index.d.cts +1 -1
- package/dist/components/form-builder/index.d.mts +1 -1
- package/dist/components/form-builder/index.d.ts +1 -1
- package/dist/components/stepped-auto-form/index.d.cts +1 -1
- package/dist/components/stepped-auto-form/index.d.mts +1 -1
- package/dist/components/stepped-auto-form/index.d.ts +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/packages/stack/src/plugins/blog/client/components/loading/post-navigation-skeleton.cjs +13 -0
- package/dist/packages/stack/src/plugins/blog/client/components/loading/post-navigation-skeleton.mjs +11 -0
- package/dist/packages/stack/src/plugins/blog/client/components/loading/recent-posts-carousel-skeleton.cjs +17 -0
- package/dist/packages/stack/src/plugins/blog/client/components/loading/recent-posts-carousel-skeleton.mjs +15 -0
- package/dist/packages/stack/src/plugins/blog/client/components/pages/post-page.internal.cjs +18 -7
- package/dist/packages/stack/src/plugins/blog/client/components/pages/post-page.internal.mjs +18 -7
- package/dist/packages/stack/src/plugins/blog/client/components/shared/post-navigation.cjs +48 -52
- package/dist/packages/stack/src/plugins/blog/client/components/shared/post-navigation.mjs +49 -53
- package/dist/packages/stack/src/plugins/blog/client/components/shared/recent-posts-carousel.cjs +34 -37
- package/dist/packages/stack/src/plugins/blog/client/components/shared/recent-posts-carousel.mjs +35 -38
- package/dist/packages/stack/src/plugins/blog/client/hooks/blog-hooks.cjs +4 -21
- package/dist/packages/stack/src/plugins/blog/client/hooks/blog-hooks.mjs +4 -21
- package/dist/packages/stack/src/plugins/comments/api/getters.cjs +284 -0
- package/dist/packages/stack/src/plugins/comments/api/getters.mjs +280 -0
- package/dist/packages/stack/src/plugins/comments/api/mutations.cjs +118 -0
- package/dist/packages/stack/src/plugins/comments/api/mutations.mjs +112 -0
- package/dist/packages/stack/src/plugins/comments/api/plugin.cjs +335 -0
- package/dist/packages/stack/src/plugins/comments/api/plugin.mjs +333 -0
- package/dist/packages/stack/src/plugins/comments/api/query-key-defs.cjs +60 -0
- package/dist/packages/stack/src/plugins/comments/api/query-key-defs.mjs +55 -0
- package/dist/packages/stack/src/plugins/comments/api/serializers.cjs +23 -0
- package/dist/packages/stack/src/plugins/comments/api/serializers.mjs +21 -0
- package/dist/packages/stack/src/plugins/comments/client/components/comment-count.cjs +46 -0
- package/dist/packages/stack/src/plugins/comments/client/components/comment-count.mjs +44 -0
- package/dist/packages/stack/src/plugins/comments/client/components/comment-form.cjs +86 -0
- package/dist/packages/stack/src/plugins/comments/client/components/comment-form.mjs +84 -0
- package/dist/packages/stack/src/plugins/comments/client/components/comment-thread.cjs +540 -0
- package/dist/packages/stack/src/plugins/comments/client/components/comment-thread.mjs +538 -0
- package/dist/packages/stack/src/plugins/comments/client/components/pages/moderation-page.cjs +64 -0
- package/dist/packages/stack/src/plugins/comments/client/components/pages/moderation-page.internal.cjs +426 -0
- package/dist/packages/stack/src/plugins/comments/client/components/pages/moderation-page.internal.mjs +424 -0
- package/dist/packages/stack/src/plugins/comments/client/components/pages/moderation-page.mjs +62 -0
- package/dist/packages/stack/src/plugins/comments/client/components/pages/my-comments-page.cjs +66 -0
- package/dist/packages/stack/src/plugins/comments/client/components/pages/my-comments-page.internal.cjs +256 -0
- package/dist/packages/stack/src/plugins/comments/client/components/pages/my-comments-page.internal.mjs +254 -0
- package/dist/packages/stack/src/plugins/comments/client/components/pages/my-comments-page.mjs +64 -0
- package/dist/packages/stack/src/plugins/comments/client/components/pages/resource-comments-page.cjs +86 -0
- package/dist/packages/stack/src/plugins/comments/client/components/pages/resource-comments-page.internal.cjs +191 -0
- package/dist/packages/stack/src/plugins/comments/client/components/pages/resource-comments-page.internal.mjs +189 -0
- package/dist/packages/stack/src/plugins/comments/client/components/pages/resource-comments-page.mjs +84 -0
- package/dist/packages/stack/src/plugins/comments/client/components/shared/page-wrapper.cjs +27 -0
- package/dist/packages/stack/src/plugins/comments/client/components/shared/page-wrapper.mjs +25 -0
- package/dist/packages/stack/src/plugins/comments/client/components/shared/pagination.cjs +37 -0
- package/dist/packages/stack/src/plugins/comments/client/components/shared/pagination.mjs +35 -0
- package/dist/packages/stack/src/plugins/comments/client/hooks/use-comments.cjs +476 -0
- package/dist/packages/stack/src/plugins/comments/client/hooks/use-comments.mjs +464 -0
- package/dist/packages/stack/src/plugins/comments/client/localization/comments-moderation.cjs +67 -0
- package/dist/packages/stack/src/plugins/comments/client/localization/comments-moderation.mjs +65 -0
- package/dist/packages/stack/src/plugins/comments/client/localization/comments-my.cjs +27 -0
- package/dist/packages/stack/src/plugins/comments/client/localization/comments-my.mjs +25 -0
- package/dist/packages/stack/src/plugins/comments/client/localization/comments-thread.cjs +30 -0
- package/dist/packages/stack/src/plugins/comments/client/localization/comments-thread.mjs +28 -0
- package/dist/packages/stack/src/plugins/comments/client/localization/index.cjs +13 -0
- package/dist/packages/stack/src/plugins/comments/client/localization/index.mjs +11 -0
- package/dist/packages/stack/src/plugins/comments/client/plugin.cjs +116 -0
- package/dist/packages/stack/src/plugins/comments/client/plugin.mjs +114 -0
- package/dist/packages/stack/src/plugins/comments/client/utils.cjs +41 -0
- package/dist/packages/stack/src/plugins/comments/client/utils.mjs +37 -0
- package/dist/packages/stack/src/plugins/comments/db.cjs +75 -0
- package/dist/packages/stack/src/plugins/comments/db.mjs +73 -0
- package/dist/packages/stack/src/plugins/comments/schemas.cjs +45 -0
- package/dist/packages/stack/src/plugins/comments/schemas.mjs +38 -0
- package/dist/packages/stack/src/plugins/kanban/api/plugin.cjs +5 -4
- package/dist/packages/stack/src/plugins/kanban/api/plugin.mjs +5 -4
- package/dist/packages/stack/src/plugins/kanban/client/components/forms/task-form.cjs +0 -1
- package/dist/packages/stack/src/plugins/kanban/client/components/forms/task-form.mjs +0 -1
- package/dist/packages/stack/src/plugins/kanban/client/components/pages/board-page.internal.cjs +39 -22
- package/dist/packages/stack/src/plugins/kanban/client/components/pages/board-page.internal.mjs +40 -23
- package/dist/packages/ui/src/components/avatar.mjs +1 -1
- package/dist/packages/ui/src/components/pagination-controls.cjs +64 -0
- package/dist/packages/ui/src/components/pagination-controls.mjs +62 -0
- package/dist/packages/ui/src/components/when-visible.cjs +39 -0
- package/dist/packages/ui/src/components/when-visible.mjs +37 -0
- package/dist/plugins/ai-chat/api/index.d.cts +4 -6
- package/dist/plugins/ai-chat/api/index.d.mts +4 -6
- package/dist/plugins/ai-chat/api/index.d.ts +4 -6
- package/dist/plugins/ai-chat/client/hooks/index.d.cts +1 -3
- package/dist/plugins/ai-chat/client/hooks/index.d.mts +1 -3
- package/dist/plugins/ai-chat/client/hooks/index.d.ts +1 -3
- package/dist/plugins/ai-chat/query-keys.d.cts +1 -3
- package/dist/plugins/ai-chat/query-keys.d.mts +1 -3
- package/dist/plugins/ai-chat/query-keys.d.ts +1 -3
- package/dist/plugins/api/index.d.cts +3 -3
- package/dist/plugins/api/index.d.mts +3 -3
- package/dist/plugins/api/index.d.ts +3 -3
- package/dist/plugins/blog/api/index.d.cts +3 -3
- package/dist/plugins/blog/api/index.d.mts +3 -3
- package/dist/plugins/blog/api/index.d.ts +3 -3
- package/dist/plugins/blog/client/hooks/index.d.cts +2 -2
- package/dist/plugins/blog/client/hooks/index.d.mts +2 -2
- package/dist/plugins/blog/client/hooks/index.d.ts +2 -2
- package/dist/plugins/blog/client/index.d.cts +25 -3
- package/dist/plugins/blog/client/index.d.mts +25 -3
- package/dist/plugins/blog/client/index.d.ts +25 -3
- package/dist/plugins/blog/query-keys.d.cts +3 -3
- package/dist/plugins/blog/query-keys.d.mts +3 -3
- package/dist/plugins/blog/query-keys.d.ts +3 -3
- package/dist/plugins/client/index.d.cts +2 -2
- package/dist/plugins/client/index.d.mts +2 -2
- package/dist/plugins/client/index.d.ts +2 -2
- package/dist/plugins/cms/api/index.d.cts +1 -1
- package/dist/plugins/cms/api/index.d.mts +1 -1
- package/dist/plugins/cms/api/index.d.ts +1 -1
- package/dist/plugins/cms/client/index.d.cts +1 -1
- package/dist/plugins/cms/client/index.d.mts +1 -1
- package/dist/plugins/cms/client/index.d.ts +1 -1
- package/dist/plugins/cms/query-keys.d.cts +1 -1
- package/dist/plugins/cms/query-keys.d.mts +1 -1
- package/dist/plugins/cms/query-keys.d.ts +1 -1
- package/dist/plugins/comments/api/index.cjs +21 -0
- package/dist/plugins/comments/api/index.d.cts +126 -0
- package/dist/plugins/comments/api/index.d.mts +126 -0
- package/dist/plugins/comments/api/index.d.ts +126 -0
- package/dist/plugins/comments/api/index.mjs +5 -0
- package/dist/plugins/comments/client/components/index.cjs +15 -0
- package/dist/plugins/comments/client/components/index.d.cts +125 -0
- package/dist/plugins/comments/client/components/index.d.mts +125 -0
- package/dist/plugins/comments/client/components/index.d.ts +125 -0
- package/dist/plugins/comments/client/components/index.mjs +5 -0
- package/dist/plugins/comments/client/hooks/index.cjs +17 -0
- package/dist/plugins/comments/client/hooks/index.d.cts +200 -0
- package/dist/plugins/comments/client/hooks/index.d.mts +200 -0
- package/dist/plugins/comments/client/hooks/index.d.ts +200 -0
- package/dist/plugins/comments/client/hooks/index.mjs +1 -0
- package/dist/plugins/comments/client/index.cjs +9 -0
- package/dist/plugins/comments/client/index.d.cts +262 -0
- package/dist/plugins/comments/client/index.d.mts +262 -0
- package/dist/plugins/comments/client/index.d.ts +262 -0
- package/dist/plugins/comments/client/index.mjs +2 -0
- package/dist/plugins/comments/client.css +2 -0
- package/dist/plugins/comments/query-keys.cjs +113 -0
- package/dist/plugins/comments/query-keys.d.cts +71 -0
- package/dist/plugins/comments/query-keys.d.mts +71 -0
- package/dist/plugins/comments/query-keys.d.ts +71 -0
- package/dist/plugins/comments/query-keys.mjs +111 -0
- package/dist/plugins/comments/style.css +15 -0
- package/dist/plugins/form-builder/api/index.d.cts +2 -2
- package/dist/plugins/form-builder/api/index.d.mts +2 -2
- package/dist/plugins/form-builder/api/index.d.ts +2 -2
- package/dist/plugins/form-builder/client/components/index.d.cts +1 -1
- package/dist/plugins/form-builder/client/components/index.d.mts +1 -1
- package/dist/plugins/form-builder/client/components/index.d.ts +1 -1
- package/dist/plugins/form-builder/client/index.d.cts +1 -1
- package/dist/plugins/form-builder/client/index.d.mts +1 -1
- package/dist/plugins/form-builder/client/index.d.ts +1 -1
- package/dist/plugins/form-builder/query-keys.d.cts +1 -1
- package/dist/plugins/form-builder/query-keys.d.mts +1 -1
- package/dist/plugins/form-builder/query-keys.d.ts +1 -1
- package/dist/plugins/kanban/api/index.d.cts +2 -2
- package/dist/plugins/kanban/api/index.d.mts +2 -2
- package/dist/plugins/kanban/api/index.d.ts +2 -2
- package/dist/plugins/kanban/client/hooks/index.d.cts +1 -1
- package/dist/plugins/kanban/client/hooks/index.d.mts +1 -1
- package/dist/plugins/kanban/client/hooks/index.d.ts +1 -1
- package/dist/plugins/kanban/client/index.d.cts +1 -1
- package/dist/plugins/kanban/client/index.d.mts +1 -1
- package/dist/plugins/kanban/client/index.d.ts +1 -1
- package/dist/plugins/kanban/query-keys.d.cts +2 -2
- package/dist/plugins/kanban/query-keys.d.mts +2 -2
- package/dist/plugins/kanban/query-keys.d.ts +2 -2
- package/dist/plugins/open-api/api/index.d.cts +3 -3
- package/dist/plugins/open-api/api/index.d.mts +3 -3
- package/dist/plugins/open-api/api/index.d.ts +3 -3
- package/dist/plugins/route-docs/client/index.d.cts +1 -1
- package/dist/plugins/route-docs/client/index.d.mts +1 -1
- package/dist/plugins/route-docs/client/index.d.ts +1 -1
- package/dist/plugins/ui-builder/client/components/index.d.cts +2 -2
- package/dist/plugins/ui-builder/client/components/index.d.mts +2 -2
- package/dist/plugins/ui-builder/client/components/index.d.ts +2 -2
- 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 +3 -3
- package/dist/plugins/ui-builder/client/index.d.mts +3 -3
- package/dist/plugins/ui-builder/client/index.d.ts +3 -3
- 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.B1srlBud.d.mts → stack.BFoBvGML.d.mts} +1 -1
- package/dist/shared/{stack.DmpPDPxA.d.cts → stack.BOCvd9HK.d.cts} +1 -1
- package/dist/shared/{stack.n1_i1p2B.d.cts → stack.BOokfhZD.d.cts} +170 -110
- package/dist/shared/{stack.DXnclTG7.d.ts → stack.BSqJrCTM.d.cts} +120 -59
- package/dist/shared/{stack.B58oHdqm.d.mts → stack.BX7MHi0J.d.mts} +90 -45
- package/dist/shared/{stack.cfCkioTe.d.mts → stack.BXxrFL9R.d.ts} +120 -59
- package/dist/shared/{stack.CSx98K5H.d.cts → stack.BYN8wCV6.d.cts} +87 -58
- package/dist/shared/{stack.FVWf2JhZ.d.mts → stack.BgQrdSlo.d.mts} +60 -45
- package/dist/shared/{stack.BK9Z2dcL.d.ts → stack.BmMB0LNC.d.ts} +1 -1
- package/dist/shared/{stack.j75TpKh2.d.ts → stack.BvCR4-9H.d.ts} +170 -110
- package/dist/shared/{stack.FeaWkglm.d.ts → stack.BxFl46lB.d.cts} +24 -1
- package/dist/shared/stack.C-b3Sn8j.d.cts +142 -0
- package/dist/shared/stack.C-b3Sn8j.d.mts +142 -0
- package/dist/shared/stack.C-b3Sn8j.d.ts +142 -0
- package/dist/shared/{stack.CFECM0ew.d.cts → stack.C1nXGBr6.d.cts} +1 -1
- package/dist/shared/{stack.C9Mg2Q46.d.cts → stack.C9zoS1TN.d.cts} +90 -45
- package/dist/shared/stack.CJE9sAjV.d.ts +335 -0
- package/dist/shared/{stack.fdi94T4S.d.mts → stack.CPsYC2-Z.d.cts} +7 -7
- package/dist/shared/{stack.fdi94T4S.d.ts → stack.CPsYC2-Z.d.mts} +7 -7
- package/dist/shared/{stack.fdi94T4S.d.cts → stack.CPsYC2-Z.d.ts} +7 -7
- package/dist/shared/{stack.7n9Y_u7N.d.cts → stack.CQnwAN7x.d.cts} +6 -6
- package/dist/shared/{stack.7n9Y_u7N.d.mts → stack.CQnwAN7x.d.mts} +6 -6
- package/dist/shared/{stack.7n9Y_u7N.d.ts → stack.CQnwAN7x.d.ts} +6 -6
- package/dist/shared/{stack.CxaFNQCV.d.mts → stack.CWxAl9K3.d.mts} +170 -110
- package/dist/shared/{stack.D-b5zbPm.d.cts → stack.Cbsrl06u.d.cts} +60 -45
- package/dist/shared/stack.CmHRdhl8.d.cts +335 -0
- package/dist/shared/{stack.BgTmujxW.d.mts → stack.D88yU4FT.d.mts} +87 -58
- package/dist/shared/{stack.DVtk5CNw.d.mts → stack.DLPa6Gzm.d.mts} +1 -1
- package/dist/shared/{stack.BAT540yW.d.ts → stack.DOZ1EXjM.d.mts} +9 -15
- package/dist/shared/{stack.FeaWkglm.d.mts → stack.DRpeDS6X.d.ts} +24 -1
- package/dist/shared/{stack.B8vT-Yt4.d.mts → stack.DX-tQ93o.d.cts} +9 -15
- package/dist/shared/stack.Dcz6636A.d.mts +335 -0
- package/dist/shared/{stack.ASwEoINr.d.ts → stack.DxJ-tHLt.d.ts} +1 -1
- package/dist/shared/{stack.DaZM10cp.d.cts → stack.DzOhpIYM.d.mts} +120 -59
- package/dist/shared/{stack.CTDVxbrA.d.ts → stack.Fl2Kl_bt.d.ts} +60 -45
- package/dist/shared/{stack.FeaWkglm.d.cts → stack.Jb0kQDJC.d.mts} +24 -1
- package/dist/shared/stack.Ldfkr5b2.d.cts +112 -0
- package/dist/shared/stack.Ldfkr5b2.d.mts +112 -0
- package/dist/shared/stack.Ldfkr5b2.d.ts +112 -0
- package/dist/shared/{stack.CLQuVdwK.d.ts → stack.RuQ9JCLo.d.ts} +87 -58
- package/dist/shared/{stack.BwA7trxA.d.cts → stack.VF6FhyZw.d.ts} +9 -15
- package/dist/shared/{stack.sO33ZDhK.d.ts → stack.fQjVhw5a.d.ts} +90 -45
- package/package.json +70 -5
- package/src/__tests__/plugins.test.tsx +5 -1
- package/src/__tests__/stack-api.test.ts +1 -1
- package/src/plugins/ai-chat/__tests__/getters.test.ts +1 -1
- package/src/plugins/ai-chat/api/getters.ts +1 -1
- package/src/plugins/ai-chat/api/plugin.ts +1 -1
- package/src/plugins/api/index.ts +5 -1
- package/src/plugins/blog/__tests__/getters.test.ts +1 -1
- package/src/plugins/blog/api/getters.ts +1 -1
- package/src/plugins/blog/api/plugin.ts +1 -1
- package/src/plugins/blog/client/components/loading/post-navigation-skeleton.tsx +10 -0
- package/src/plugins/blog/client/components/loading/recent-posts-carousel-skeleton.tsx +18 -0
- package/src/plugins/blog/client/components/pages/post-page.internal.tsx +23 -8
- package/src/plugins/blog/client/components/shared/post-navigation.tsx +0 -5
- package/src/plugins/blog/client/components/shared/recent-posts-carousel.tsx +1 -5
- package/src/plugins/blog/client/hooks/blog-hooks.tsx +8 -33
- package/src/plugins/blog/client/overrides.ts +26 -1
- package/src/plugins/cms/__tests__/getters.test.ts +1 -1
- package/src/plugins/cms/api/getters.ts +1 -1
- package/src/plugins/cms/api/mutations.ts +1 -1
- package/src/plugins/cms/api/plugin.ts +1 -1
- package/src/plugins/cms/client/components/shared/pagination.tsx +14 -42
- package/src/plugins/comments/api/getters.ts +444 -0
- package/src/plugins/comments/api/index.ts +21 -0
- package/src/plugins/comments/api/mutations.ts +206 -0
- package/src/plugins/comments/api/plugin.ts +628 -0
- package/src/plugins/comments/api/query-key-defs.ts +143 -0
- package/src/plugins/comments/api/serializers.ts +37 -0
- package/src/plugins/comments/client/components/comment-count.tsx +66 -0
- package/src/plugins/comments/client/components/comment-form.tsx +112 -0
- package/src/plugins/comments/client/components/comment-thread.tsx +799 -0
- package/src/plugins/comments/client/components/index.tsx +11 -0
- package/src/plugins/comments/client/components/pages/moderation-page.internal.tsx +550 -0
- package/src/plugins/comments/client/components/pages/moderation-page.tsx +70 -0
- package/src/plugins/comments/client/components/pages/my-comments-page.internal.tsx +367 -0
- package/src/plugins/comments/client/components/pages/my-comments-page.tsx +72 -0
- package/src/plugins/comments/client/components/pages/resource-comments-page.internal.tsx +225 -0
- package/src/plugins/comments/client/components/pages/resource-comments-page.tsx +97 -0
- package/src/plugins/comments/client/components/shared/page-wrapper.tsx +32 -0
- package/src/plugins/comments/client/components/shared/pagination.tsx +44 -0
- package/src/plugins/comments/client/hooks/index.tsx +13 -0
- package/src/plugins/comments/client/hooks/use-comments.tsx +717 -0
- package/src/plugins/comments/client/index.ts +14 -0
- package/src/plugins/comments/client/localization/comments-moderation.ts +75 -0
- package/src/plugins/comments/client/localization/comments-my.ts +32 -0
- package/src/plugins/comments/client/localization/comments-thread.ts +32 -0
- package/src/plugins/comments/client/localization/index.ts +11 -0
- package/src/plugins/comments/client/overrides.ts +164 -0
- package/src/plugins/comments/client/plugin.tsx +195 -0
- package/src/plugins/comments/client/utils.ts +67 -0
- package/src/plugins/comments/client.css +2 -0
- package/src/plugins/comments/db.ts +77 -0
- package/src/plugins/comments/query-keys.ts +189 -0
- package/src/plugins/comments/schemas.ts +72 -0
- package/src/plugins/comments/style.css +15 -0
- package/src/plugins/comments/types.ts +73 -0
- package/src/plugins/form-builder/__tests__/getters.test.ts +1 -1
- package/src/plugins/form-builder/api/getters.ts +1 -1
- package/src/plugins/form-builder/api/plugin.ts +1 -1
- package/src/plugins/kanban/__tests__/getters.test.ts +1 -1
- package/src/plugins/kanban/api/getters.ts +1 -1
- package/src/plugins/kanban/api/mutations.ts +1 -1
- package/src/plugins/kanban/api/plugin.ts +6 -5
- package/src/plugins/kanban/client/components/forms/task-form.tsx +0 -1
- package/src/plugins/kanban/client/components/pages/board-page.internal.tsx +46 -27
- package/src/plugins/kanban/client/overrides.ts +27 -1
- package/src/types.ts +5 -1
- package/dist/shared/{stack.BQmuNl5p.d.mts → stack.BWp0hcm9.d.cts} +3 -3
- package/dist/shared/{stack.BQmuNl5p.d.ts → stack.BWp0hcm9.d.mts} +3 -3
- package/dist/shared/{stack.BQmuNl5p.d.cts → stack.BWp0hcm9.d.ts} +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@btst/stack",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.0",
|
|
4
4
|
"description": "A composable, plugin-based library for building full-stack applications.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -363,6 +363,57 @@
|
|
|
363
363
|
}
|
|
364
364
|
},
|
|
365
365
|
"./plugins/kanban/css": "./dist/plugins/kanban/style.css",
|
|
366
|
+
"./plugins/comments/api": {
|
|
367
|
+
"import": {
|
|
368
|
+
"types": "./dist/plugins/comments/api/index.d.ts",
|
|
369
|
+
"default": "./dist/plugins/comments/api/index.mjs"
|
|
370
|
+
},
|
|
371
|
+
"require": {
|
|
372
|
+
"types": "./dist/plugins/comments/api/index.d.cts",
|
|
373
|
+
"default": "./dist/plugins/comments/api/index.cjs"
|
|
374
|
+
}
|
|
375
|
+
},
|
|
376
|
+
"./plugins/comments/client": {
|
|
377
|
+
"import": {
|
|
378
|
+
"types": "./dist/plugins/comments/client/index.d.ts",
|
|
379
|
+
"default": "./dist/plugins/comments/client/index.mjs"
|
|
380
|
+
},
|
|
381
|
+
"require": {
|
|
382
|
+
"types": "./dist/plugins/comments/client/index.d.cts",
|
|
383
|
+
"default": "./dist/plugins/comments/client/index.cjs"
|
|
384
|
+
}
|
|
385
|
+
},
|
|
386
|
+
"./plugins/comments/client/components": {
|
|
387
|
+
"import": {
|
|
388
|
+
"types": "./dist/plugins/comments/client/components/index.d.ts",
|
|
389
|
+
"default": "./dist/plugins/comments/client/components/index.mjs"
|
|
390
|
+
},
|
|
391
|
+
"require": {
|
|
392
|
+
"types": "./dist/plugins/comments/client/components/index.d.cts",
|
|
393
|
+
"default": "./dist/plugins/comments/client/components/index.cjs"
|
|
394
|
+
}
|
|
395
|
+
},
|
|
396
|
+
"./plugins/comments/client/hooks": {
|
|
397
|
+
"import": {
|
|
398
|
+
"types": "./dist/plugins/comments/client/hooks/index.d.ts",
|
|
399
|
+
"default": "./dist/plugins/comments/client/hooks/index.mjs"
|
|
400
|
+
},
|
|
401
|
+
"require": {
|
|
402
|
+
"types": "./dist/plugins/comments/client/hooks/index.d.cts",
|
|
403
|
+
"default": "./dist/plugins/comments/client/hooks/index.cjs"
|
|
404
|
+
}
|
|
405
|
+
},
|
|
406
|
+
"./plugins/comments/query-keys": {
|
|
407
|
+
"import": {
|
|
408
|
+
"types": "./dist/plugins/comments/query-keys.d.ts",
|
|
409
|
+
"default": "./dist/plugins/comments/query-keys.mjs"
|
|
410
|
+
},
|
|
411
|
+
"require": {
|
|
412
|
+
"types": "./dist/plugins/comments/query-keys.d.cts",
|
|
413
|
+
"default": "./dist/plugins/comments/query-keys.cjs"
|
|
414
|
+
}
|
|
415
|
+
},
|
|
416
|
+
"./plugins/comments/css": "./dist/plugins/comments/style.css",
|
|
366
417
|
"./plugins/route-docs/client": {
|
|
367
418
|
"import": {
|
|
368
419
|
"types": "./dist/plugins/route-docs/client/index.d.ts",
|
|
@@ -544,6 +595,21 @@
|
|
|
544
595
|
"plugins/kanban/client/hooks": [
|
|
545
596
|
"./dist/plugins/kanban/client/hooks/index.d.ts"
|
|
546
597
|
],
|
|
598
|
+
"plugins/comments/api": [
|
|
599
|
+
"./dist/plugins/comments/api/index.d.ts"
|
|
600
|
+
],
|
|
601
|
+
"plugins/comments/client": [
|
|
602
|
+
"./dist/plugins/comments/client/index.d.ts"
|
|
603
|
+
],
|
|
604
|
+
"plugins/comments/client/components": [
|
|
605
|
+
"./dist/plugins/comments/client/components/index.d.ts"
|
|
606
|
+
],
|
|
607
|
+
"plugins/comments/client/hooks": [
|
|
608
|
+
"./dist/plugins/comments/client/hooks/index.d.ts"
|
|
609
|
+
],
|
|
610
|
+
"plugins/comments/query-keys": [
|
|
611
|
+
"./dist/plugins/comments/query-keys.d.ts"
|
|
612
|
+
],
|
|
547
613
|
"plugins/route-docs/client": [
|
|
548
614
|
"./dist/plugins/route-docs/client/index.d.ts"
|
|
549
615
|
],
|
|
@@ -571,7 +637,7 @@
|
|
|
571
637
|
}
|
|
572
638
|
},
|
|
573
639
|
"dependencies": {
|
|
574
|
-
"@btst/db": "2.0
|
|
640
|
+
"@btst/db": "2.1.0",
|
|
575
641
|
"@lukemorales/query-key-factory": "^1.3.4",
|
|
576
642
|
"@milkdown/crepe": "^7.17.1",
|
|
577
643
|
"@milkdown/kit": "^7.17.1",
|
|
@@ -588,7 +654,7 @@
|
|
|
588
654
|
"@radix-ui/react-switch": ">=1.1.0",
|
|
589
655
|
"@tanstack/react-query": "^5.0.0",
|
|
590
656
|
"ai": ">=5.0.0",
|
|
591
|
-
"better-call": ">=1.
|
|
657
|
+
"better-call": ">=1.3.2",
|
|
592
658
|
"class-variance-authority": ">=0.7.0",
|
|
593
659
|
"clsx": ">=2.1.0",
|
|
594
660
|
"cmdk": ">=1.1.0",
|
|
@@ -600,7 +666,6 @@
|
|
|
600
666
|
"react-dom": "^18.0.0 || ^19.0.0",
|
|
601
667
|
"react-error-boundary": ">=4.0.0",
|
|
602
668
|
"react-hook-form": ">=7.55.0",
|
|
603
|
-
"react-intersection-observer": ">=9.0.0",
|
|
604
669
|
"react-markdown": ">=9.1.0",
|
|
605
670
|
"rehype-highlight": ">=7.0.0",
|
|
606
671
|
"rehype-katex": ">=7.0.0",
|
|
@@ -616,7 +681,7 @@
|
|
|
616
681
|
"devDependencies": {
|
|
617
682
|
"tsx": "catalog:",
|
|
618
683
|
"@ai-sdk/react": "^2.0.94",
|
|
619
|
-
"@btst/adapter-memory": "2.0
|
|
684
|
+
"@btst/adapter-memory": "2.1.0",
|
|
620
685
|
"@btst/yar": "1.2.0",
|
|
621
686
|
"@types/react": "^19.0.0",
|
|
622
687
|
"@types/slug": "^5.0.9",
|
|
@@ -4,7 +4,11 @@ import { createStackClient } from "../client";
|
|
|
4
4
|
import { defineBackendPlugin } from "../plugins/api";
|
|
5
5
|
import { defineClientPlugin } from "../plugins/client";
|
|
6
6
|
import type { BackendPlugin, ClientPlugin } from "../types";
|
|
7
|
-
import type {
|
|
7
|
+
import type {
|
|
8
|
+
BetterAuthDBSchema,
|
|
9
|
+
DatabaseDefinition,
|
|
10
|
+
DBAdapter as Adapter,
|
|
11
|
+
} from "@btst/db";
|
|
8
12
|
import { createDbPlugin } from "@btst/db";
|
|
9
13
|
import { createMemoryAdapter } from "@btst/adapter-memory";
|
|
10
14
|
import { createEndpoint as endpoint } from "better-call";
|
|
@@ -3,7 +3,7 @@ import { stack } from "../api";
|
|
|
3
3
|
import { defineBackendPlugin } from "../plugins/api";
|
|
4
4
|
import { createDbPlugin } from "@btst/db";
|
|
5
5
|
import { createMemoryAdapter } from "@btst/adapter-memory";
|
|
6
|
-
import type { Adapter, DatabaseDefinition } from "@btst/db";
|
|
6
|
+
import type { DBAdapter as Adapter, DatabaseDefinition } from "@btst/db";
|
|
7
7
|
import { blogBackendPlugin } from "../plugins/blog/api";
|
|
8
8
|
import { kanbanBackendPlugin } from "../plugins/kanban/api";
|
|
9
9
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { describe, it, expect, beforeEach } from "vitest";
|
|
2
2
|
import { createMemoryAdapter } from "@btst/adapter-memory";
|
|
3
3
|
import { defineDb } from "@btst/db";
|
|
4
|
-
import type { Adapter } from "@btst/db";
|
|
4
|
+
import type { DBAdapter as Adapter } from "@btst/db";
|
|
5
5
|
import { aiChatSchema } from "../db";
|
|
6
6
|
import { getAllConversations, getConversationById } from "../api/getters";
|
|
7
7
|
|
package/src/plugins/api/index.ts
CHANGED
|
@@ -18,7 +18,11 @@ export type {
|
|
|
18
18
|
ClientPlugin,
|
|
19
19
|
} from "../../types";
|
|
20
20
|
|
|
21
|
-
export type {
|
|
21
|
+
export type {
|
|
22
|
+
DBAdapter as Adapter,
|
|
23
|
+
DatabaseDefinition,
|
|
24
|
+
DbPlugin,
|
|
25
|
+
} from "@btst/db";
|
|
22
26
|
|
|
23
27
|
// Re-export Better Call functions needed for plugins
|
|
24
28
|
export type { Endpoint, Router } from "better-call";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { describe, it, expect, beforeEach } from "vitest";
|
|
2
2
|
import { createMemoryAdapter } from "@btst/adapter-memory";
|
|
3
3
|
import { defineDb } from "@btst/db";
|
|
4
|
-
import type { Adapter } from "@btst/db";
|
|
4
|
+
import type { DBAdapter as Adapter } from "@btst/db";
|
|
5
5
|
import { blogSchema } from "../db";
|
|
6
6
|
import { getAllPosts, getPostBySlug, getAllTags } from "../api/getters";
|
|
7
7
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Skeleton } from "@workspace/ui/components/skeleton";
|
|
2
|
+
|
|
3
|
+
export function PostNavigationSkeleton() {
|
|
4
|
+
return (
|
|
5
|
+
<div className="border-t mt-4 pt-4 w-full flex flex-col sm:flex-row gap-4">
|
|
6
|
+
<Skeleton className="h-14 flex-1 rounded-md" />
|
|
7
|
+
<Skeleton className="h-14 flex-1 rounded-md" />
|
|
8
|
+
</div>
|
|
9
|
+
);
|
|
10
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Skeleton } from "@workspace/ui/components/skeleton";
|
|
2
|
+
import { PostCardSkeleton } from "./post-card-skeleton";
|
|
3
|
+
|
|
4
|
+
export function RecentPostsCarouselSkeleton() {
|
|
5
|
+
return (
|
|
6
|
+
<div className="w-full mt-4 py-4 border-t">
|
|
7
|
+
<div className="flex items-center justify-between mb-4">
|
|
8
|
+
<Skeleton className="h-7 w-36" />
|
|
9
|
+
<Skeleton className="h-4 w-16" />
|
|
10
|
+
</div>
|
|
11
|
+
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
|
12
|
+
{[1, 2, 3].map((i) => (
|
|
13
|
+
<PostCardSkeleton key={i} />
|
|
14
|
+
))}
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
@@ -21,6 +21,9 @@ import { useRouteLifecycle } from "@workspace/ui/hooks/use-route-lifecycle";
|
|
|
21
21
|
import { OnThisPage, OnThisPageSelect } from "../shared/on-this-page";
|
|
22
22
|
import type { SerializedPost } from "../../../types";
|
|
23
23
|
import { useRegisterPageAIContext } from "@btst/stack/plugins/ai-chat/client/context";
|
|
24
|
+
import { WhenVisible } from "@workspace/ui/components/when-visible";
|
|
25
|
+
import { PostNavigationSkeleton } from "../loading/post-navigation-skeleton";
|
|
26
|
+
import { RecentPostsCarouselSkeleton } from "../loading/recent-posts-carousel-skeleton";
|
|
24
27
|
|
|
25
28
|
// Internal component with actual page content
|
|
26
29
|
export function PostPage({ slug }: { slug: string }) {
|
|
@@ -52,14 +55,14 @@ export function PostPage({ slug }: { slug: string }) {
|
|
|
52
55
|
|
|
53
56
|
const { post } = useSuspensePost(slug ?? "");
|
|
54
57
|
|
|
55
|
-
const { previousPost, nextPost
|
|
58
|
+
const { previousPost, nextPost } = useNextPreviousPosts(
|
|
56
59
|
post?.createdAt ?? new Date(),
|
|
57
60
|
{
|
|
58
61
|
enabled: !!post,
|
|
59
62
|
},
|
|
60
63
|
);
|
|
61
64
|
|
|
62
|
-
const { recentPosts
|
|
65
|
+
const { recentPosts } = useRecentPosts({
|
|
63
66
|
limit: 5,
|
|
64
67
|
excludeSlug: slug,
|
|
65
68
|
enabled: !!post,
|
|
@@ -120,13 +123,25 @@ export function PostPage({ slug }: { slug: string }) {
|
|
|
120
123
|
</div>
|
|
121
124
|
|
|
122
125
|
<div className="flex flex-col gap-4 w-full">
|
|
123
|
-
<
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
126
|
+
<WhenVisible
|
|
127
|
+
rootMargin="200px"
|
|
128
|
+
fallback={<PostNavigationSkeleton />}
|
|
129
|
+
>
|
|
130
|
+
<PostNavigation previousPost={previousPost} nextPost={nextPost} />
|
|
131
|
+
</WhenVisible>
|
|
128
132
|
|
|
129
|
-
<
|
|
133
|
+
<WhenVisible
|
|
134
|
+
rootMargin="200px"
|
|
135
|
+
fallback={<RecentPostsCarouselSkeleton />}
|
|
136
|
+
>
|
|
137
|
+
<RecentPostsCarousel posts={recentPosts} />
|
|
138
|
+
</WhenVisible>
|
|
139
|
+
|
|
140
|
+
{overrides.postBottomSlot && (
|
|
141
|
+
<div data-testid="post-bottom-slot">
|
|
142
|
+
{overrides.postBottomSlot(post)}
|
|
143
|
+
</div>
|
|
144
|
+
)}
|
|
130
145
|
</div>
|
|
131
146
|
</div>
|
|
132
147
|
<OnThisPage markdown={post.content} />
|
|
@@ -10,13 +10,11 @@ import type { SerializedPost } from "../../../types";
|
|
|
10
10
|
interface PostNavigationProps {
|
|
11
11
|
previousPost: SerializedPost | null;
|
|
12
12
|
nextPost: SerializedPost | null;
|
|
13
|
-
ref?: (node: Element | null) => void;
|
|
14
13
|
}
|
|
15
14
|
|
|
16
15
|
export function PostNavigation({
|
|
17
16
|
previousPost,
|
|
18
17
|
nextPost,
|
|
19
|
-
ref,
|
|
20
18
|
}: PostNavigationProps) {
|
|
21
19
|
const { Link } = usePluginOverrides<
|
|
22
20
|
BlogPluginOverrides,
|
|
@@ -29,9 +27,6 @@ export function PostNavigation({
|
|
|
29
27
|
|
|
30
28
|
return (
|
|
31
29
|
<>
|
|
32
|
-
{/* Ref div to trigger intersection observer when scrolled into view */}
|
|
33
|
-
{ref && <div ref={ref} />}
|
|
34
|
-
|
|
35
30
|
{/* Only show navigation buttons if posts are available */}
|
|
36
31
|
{(previousPost || nextPost) && (
|
|
37
32
|
<>
|
|
@@ -16,10 +16,9 @@ import { BLOG_LOCALIZATION } from "../../localization";
|
|
|
16
16
|
|
|
17
17
|
interface RecentPostsCarouselProps {
|
|
18
18
|
posts: SerializedPost[];
|
|
19
|
-
ref?: (node: Element | null) => void;
|
|
20
19
|
}
|
|
21
20
|
|
|
22
|
-
export function RecentPostsCarousel({ posts
|
|
21
|
+
export function RecentPostsCarousel({ posts }: RecentPostsCarouselProps) {
|
|
23
22
|
const { PostCard, Link, localization } = usePluginOverrides<
|
|
24
23
|
BlogPluginOverrides,
|
|
25
24
|
Partial<BlogPluginOverrides>
|
|
@@ -32,9 +31,6 @@ export function RecentPostsCarousel({ posts, ref }: RecentPostsCarouselProps) {
|
|
|
32
31
|
const basePath = useBasePath();
|
|
33
32
|
return (
|
|
34
33
|
<div className="w-full">
|
|
35
|
-
{/* Ref div to trigger intersection observer when scrolled into view */}
|
|
36
|
-
{ref && <div ref={ref} />}
|
|
37
|
-
|
|
38
34
|
{posts && posts.length > 0 && (
|
|
39
35
|
<>
|
|
40
36
|
<div className="mt-4 py-4 w-full text-start border-t">
|
|
@@ -15,7 +15,6 @@ import type { BlogApiRouter } from "../../api/plugin";
|
|
|
15
15
|
import { useDebounce } from "./use-debounce";
|
|
16
16
|
import { useEffect, useRef } from "react";
|
|
17
17
|
import { z } from "zod";
|
|
18
|
-
import { useInView } from "react-intersection-observer";
|
|
19
18
|
import { createPostSchema, updatePostSchema } from "../../schemas";
|
|
20
19
|
import { createBlogQueryKeys } from "../../query-keys";
|
|
21
20
|
import { usePluginOverrides } from "@btst/stack/context";
|
|
@@ -604,16 +603,13 @@ export interface UseNextPreviousPostsResult {
|
|
|
604
603
|
}
|
|
605
604
|
|
|
606
605
|
/**
|
|
607
|
-
* Hook for fetching previous and next posts relative to a given date
|
|
608
|
-
*
|
|
606
|
+
* Hook for fetching previous and next posts relative to a given date.
|
|
607
|
+
* Pair with `<WhenVisible>` in the render tree for lazy loading.
|
|
609
608
|
*/
|
|
610
609
|
export function useNextPreviousPosts(
|
|
611
610
|
createdAt: string | Date,
|
|
612
611
|
options: UseNextPreviousPostsOptions = {},
|
|
613
|
-
): UseNextPreviousPostsResult
|
|
614
|
-
ref: (node: Element | null) => void;
|
|
615
|
-
inView: boolean;
|
|
616
|
-
} {
|
|
612
|
+
): UseNextPreviousPostsResult {
|
|
617
613
|
const { apiBaseURL, apiBasePath, headers } =
|
|
618
614
|
usePluginOverrides<BlogPluginOverrides>("blog");
|
|
619
615
|
const client = createApiClient<BlogApiRouter>({
|
|
@@ -622,13 +618,6 @@ export function useNextPreviousPosts(
|
|
|
622
618
|
});
|
|
623
619
|
const queries = createBlogQueryKeys(client, headers);
|
|
624
620
|
|
|
625
|
-
const { ref, inView } = useInView({
|
|
626
|
-
// start a little early so the data is ready as it scrolls in
|
|
627
|
-
rootMargin: "200px 0px",
|
|
628
|
-
// run once; keep data cached after
|
|
629
|
-
triggerOnce: true,
|
|
630
|
-
});
|
|
631
|
-
|
|
632
621
|
const dateValue =
|
|
633
622
|
typeof createdAt === "string" ? new Date(createdAt) : createdAt;
|
|
634
623
|
const baseQuery = queries.posts.nextPrevious(dateValue);
|
|
@@ -641,7 +630,7 @@ export function useNextPreviousPosts(
|
|
|
641
630
|
>({
|
|
642
631
|
...baseQuery,
|
|
643
632
|
...SHARED_QUERY_CONFIG,
|
|
644
|
-
enabled: (options.enabled ?? true) &&
|
|
633
|
+
enabled: (options.enabled ?? true) && !!client,
|
|
645
634
|
});
|
|
646
635
|
|
|
647
636
|
return {
|
|
@@ -650,8 +639,6 @@ export function useNextPreviousPosts(
|
|
|
650
639
|
isLoading,
|
|
651
640
|
error,
|
|
652
641
|
refetch,
|
|
653
|
-
ref,
|
|
654
|
-
inView,
|
|
655
642
|
};
|
|
656
643
|
}
|
|
657
644
|
|
|
@@ -682,15 +669,12 @@ export interface UseRecentPostsResult {
|
|
|
682
669
|
}
|
|
683
670
|
|
|
684
671
|
/**
|
|
685
|
-
* Hook for fetching recent posts
|
|
686
|
-
*
|
|
672
|
+
* Hook for fetching recent posts.
|
|
673
|
+
* Pair with `<WhenVisible>` in the render tree for lazy loading.
|
|
687
674
|
*/
|
|
688
675
|
export function useRecentPosts(
|
|
689
676
|
options: UseRecentPostsOptions = {},
|
|
690
|
-
): UseRecentPostsResult
|
|
691
|
-
ref: (node: Element | null) => void;
|
|
692
|
-
inView: boolean;
|
|
693
|
-
} {
|
|
677
|
+
): UseRecentPostsResult {
|
|
694
678
|
const { apiBaseURL, apiBasePath, headers } =
|
|
695
679
|
usePluginOverrides<BlogPluginOverrides>("blog");
|
|
696
680
|
const client = createApiClient<BlogApiRouter>({
|
|
@@ -699,13 +683,6 @@ export function useRecentPosts(
|
|
|
699
683
|
});
|
|
700
684
|
const queries = createBlogQueryKeys(client, headers);
|
|
701
685
|
|
|
702
|
-
const { ref, inView } = useInView({
|
|
703
|
-
// start a little early so the data is ready as it scrolls in
|
|
704
|
-
rootMargin: "200px 0px",
|
|
705
|
-
// run once; keep data cached after
|
|
706
|
-
triggerOnce: true,
|
|
707
|
-
});
|
|
708
|
-
|
|
709
686
|
const baseQuery = queries.posts.recent({
|
|
710
687
|
limit: options.limit ?? 5,
|
|
711
688
|
excludeSlug: options.excludeSlug,
|
|
@@ -719,7 +696,7 @@ export function useRecentPosts(
|
|
|
719
696
|
>({
|
|
720
697
|
...baseQuery,
|
|
721
698
|
...SHARED_QUERY_CONFIG,
|
|
722
|
-
enabled: (options.enabled ?? true) &&
|
|
699
|
+
enabled: (options.enabled ?? true) && !!client,
|
|
723
700
|
});
|
|
724
701
|
|
|
725
702
|
return {
|
|
@@ -727,7 +704,5 @@ export function useRecentPosts(
|
|
|
727
704
|
isLoading,
|
|
728
705
|
error,
|
|
729
706
|
refetch,
|
|
730
|
-
ref,
|
|
731
|
-
inView,
|
|
732
707
|
};
|
|
733
708
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SerializedPost } from "../types";
|
|
2
|
-
import type { ComponentType } from "react";
|
|
2
|
+
import type { ComponentType, ReactNode } from "react";
|
|
3
3
|
import type { BlogLocalization } from "./localization";
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -134,4 +134,29 @@ export interface BlogPluginOverrides {
|
|
|
134
134
|
* @param context - Route context
|
|
135
135
|
*/
|
|
136
136
|
onBeforeDraftsPageRendered?: (context: RouteContext) => boolean;
|
|
137
|
+
|
|
138
|
+
// ============ Slot Overrides ============
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Optional slot rendered below the blog post body.
|
|
142
|
+
* Use this to inject a comment thread or any custom content without
|
|
143
|
+
* coupling the blog plugin to the comments plugin.
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* ```tsx
|
|
147
|
+
* blog: {
|
|
148
|
+
* postBottomSlot: (post) => (
|
|
149
|
+
* <CommentThread
|
|
150
|
+
* resourceId={post.slug}
|
|
151
|
+
* resourceType="blog-post"
|
|
152
|
+
* apiBaseURL={apiBaseURL}
|
|
153
|
+
* apiBasePath="/api/data"
|
|
154
|
+
* currentUserId={session?.userId}
|
|
155
|
+
* loginHref="/login"
|
|
156
|
+
* />
|
|
157
|
+
* ),
|
|
158
|
+
* }
|
|
159
|
+
* ```
|
|
160
|
+
*/
|
|
161
|
+
postBottomSlot?: (post: SerializedPost) => ReactNode;
|
|
137
162
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { describe, it, expect, beforeEach } from "vitest";
|
|
2
2
|
import { createMemoryAdapter } from "@btst/adapter-memory";
|
|
3
3
|
import { defineDb } from "@btst/db";
|
|
4
|
-
import type { Adapter } from "@btst/db";
|
|
4
|
+
import type { DBAdapter as Adapter } from "@btst/db";
|
|
5
5
|
import { cmsSchema } from "../db";
|
|
6
6
|
import {
|
|
7
7
|
getAllContentTypes,
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import { Button } from "@workspace/ui/components/button";
|
|
4
|
-
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
5
3
|
import { usePluginOverrides } from "@btst/stack/context";
|
|
6
4
|
import type { CMSPluginOverrides } from "../../overrides";
|
|
7
5
|
import { CMS_LOCALIZATION } from "../../localization";
|
|
6
|
+
import { PaginationControls } from "@workspace/ui/components/pagination-controls";
|
|
8
7
|
|
|
9
8
|
interface PaginationProps {
|
|
10
9
|
currentPage: number;
|
|
@@ -27,46 +26,19 @@ export function Pagination({
|
|
|
27
26
|
usePluginOverrides<CMSPluginOverrides>("cms");
|
|
28
27
|
const localization = { ...CMS_LOCALIZATION, ...customLocalization };
|
|
29
28
|
|
|
30
|
-
const from = offset + 1;
|
|
31
|
-
const to = Math.min(offset + limit, total);
|
|
32
|
-
|
|
33
|
-
if (totalPages <= 1) {
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
29
|
return (
|
|
38
|
-
<
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
onClick={() => onPageChange(currentPage - 1)}
|
|
52
|
-
disabled={currentPage === 1}
|
|
53
|
-
>
|
|
54
|
-
<ChevronLeft className="h-4 w-4 mr-1" />
|
|
55
|
-
{localization.CMS_LIST_PAGINATION_PREVIOUS}
|
|
56
|
-
</Button>
|
|
57
|
-
<span className="text-sm text-muted-foreground">
|
|
58
|
-
{currentPage} / {totalPages}
|
|
59
|
-
</span>
|
|
60
|
-
<Button
|
|
61
|
-
variant="outline"
|
|
62
|
-
size="sm"
|
|
63
|
-
onClick={() => onPageChange(currentPage + 1)}
|
|
64
|
-
disabled={currentPage === totalPages}
|
|
65
|
-
>
|
|
66
|
-
{localization.CMS_LIST_PAGINATION_NEXT}
|
|
67
|
-
<ChevronRight className="h-4 w-4 ml-1" />
|
|
68
|
-
</Button>
|
|
69
|
-
</div>
|
|
70
|
-
</div>
|
|
30
|
+
<PaginationControls
|
|
31
|
+
currentPage={currentPage}
|
|
32
|
+
totalPages={totalPages}
|
|
33
|
+
onPageChange={onPageChange}
|
|
34
|
+
total={total}
|
|
35
|
+
limit={limit}
|
|
36
|
+
offset={offset}
|
|
37
|
+
labels={{
|
|
38
|
+
previous: localization.CMS_LIST_PAGINATION_PREVIOUS,
|
|
39
|
+
next: localization.CMS_LIST_PAGINATION_NEXT,
|
|
40
|
+
showing: localization.CMS_LIST_PAGINATION_SHOWING,
|
|
41
|
+
}}
|
|
42
|
+
/>
|
|
71
43
|
);
|
|
72
44
|
}
|