@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
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const COMMENTS_THREAD = {
|
|
2
|
+
COMMENTS_TITLE: "Comments",
|
|
3
|
+
COMMENTS_EMPTY: "Be the first to comment.",
|
|
4
|
+
COMMENTS_EDITED_BADGE: "(edited)",
|
|
5
|
+
COMMENTS_PENDING_BADGE: "Pending approval",
|
|
6
|
+
COMMENTS_LIKE_ARIA: "Like",
|
|
7
|
+
COMMENTS_UNLIKE_ARIA: "Unlike",
|
|
8
|
+
COMMENTS_REPLY_BUTTON: "Reply",
|
|
9
|
+
COMMENTS_EDIT_BUTTON: "Edit",
|
|
10
|
+
COMMENTS_DELETE_BUTTON: "Delete",
|
|
11
|
+
COMMENTS_SAVE_EDIT: "Save",
|
|
12
|
+
COMMENTS_REPLIES_SINGULAR: "reply",
|
|
13
|
+
COMMENTS_REPLIES_PLURAL: "replies",
|
|
14
|
+
COMMENTS_HIDE_REPLIES: "Hide replies",
|
|
15
|
+
COMMENTS_DELETE_CONFIRM: "Delete this comment?",
|
|
16
|
+
COMMENTS_LOGIN_PROMPT: "Please sign in to leave a comment.",
|
|
17
|
+
COMMENTS_LOGIN_LINK: "Sign in",
|
|
18
|
+
COMMENTS_FORM_PLACEHOLDER: "Write a comment\u2026",
|
|
19
|
+
COMMENTS_FORM_CANCEL: "Cancel",
|
|
20
|
+
COMMENTS_FORM_POST_COMMENT: "Post comment",
|
|
21
|
+
COMMENTS_FORM_POST_REPLY: "Post reply",
|
|
22
|
+
COMMENTS_FORM_POSTING: "Posting\u2026",
|
|
23
|
+
COMMENTS_FORM_SUBMIT_ERROR: "Failed to submit comment",
|
|
24
|
+
COMMENTS_LOAD_MORE: "Load more comments",
|
|
25
|
+
COMMENTS_LOADING_MORE: "Loading\u2026"
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export { COMMENTS_THREAD };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const commentsThread = require('./comments-thread.cjs');
|
|
4
|
+
const commentsModeration = require('./comments-moderation.cjs');
|
|
5
|
+
const commentsMy = require('./comments-my.cjs');
|
|
6
|
+
|
|
7
|
+
const COMMENTS_LOCALIZATION = {
|
|
8
|
+
...commentsThread.COMMENTS_THREAD,
|
|
9
|
+
...commentsModeration.COMMENTS_MODERATION,
|
|
10
|
+
...commentsMy.COMMENTS_MY
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
exports.COMMENTS_LOCALIZATION = COMMENTS_LOCALIZATION;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { COMMENTS_THREAD } from './comments-thread.mjs';
|
|
2
|
+
import { COMMENTS_MODERATION } from './comments-moderation.mjs';
|
|
3
|
+
import { COMMENTS_MY } from './comments-my.mjs';
|
|
4
|
+
|
|
5
|
+
const COMMENTS_LOCALIZATION = {
|
|
6
|
+
...COMMENTS_THREAD,
|
|
7
|
+
...COMMENTS_MODERATION,
|
|
8
|
+
...COMMENTS_MY
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { COMMENTS_LOCALIZATION };
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const React = require('react');
|
|
4
|
+
const client = require('@btst/stack/plugins/client');
|
|
5
|
+
const yar = require('@btst/yar');
|
|
6
|
+
|
|
7
|
+
const ModerationPageComponent = React.lazy(
|
|
8
|
+
() => import('./components/pages/moderation-page.cjs').then((m) => ({
|
|
9
|
+
default: m.ModerationPageComponent
|
|
10
|
+
}))
|
|
11
|
+
);
|
|
12
|
+
const UserCommentsPageComponent = React.lazy(
|
|
13
|
+
() => import('./components/pages/my-comments-page.cjs').then((m) => ({
|
|
14
|
+
default: m.UserCommentsPageComponent
|
|
15
|
+
}))
|
|
16
|
+
);
|
|
17
|
+
function createModerationLoader(config) {
|
|
18
|
+
return async () => {
|
|
19
|
+
if (typeof window === "undefined") {
|
|
20
|
+
const { apiBasePath, apiBaseURL, headers, hooks } = config;
|
|
21
|
+
const context = {
|
|
22
|
+
path: "/comments/moderation",
|
|
23
|
+
isSSR: true,
|
|
24
|
+
apiBaseURL,
|
|
25
|
+
apiBasePath,
|
|
26
|
+
headers
|
|
27
|
+
};
|
|
28
|
+
try {
|
|
29
|
+
if (hooks?.beforeLoadModeration) {
|
|
30
|
+
await hooks.beforeLoadModeration(context);
|
|
31
|
+
}
|
|
32
|
+
} catch (error) {
|
|
33
|
+
if (client.isConnectionError(error)) {
|
|
34
|
+
console.warn(
|
|
35
|
+
"[btst/comments] route.loader() failed \u2014 no server running at build time."
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
if (hooks?.onLoadError) {
|
|
39
|
+
await hooks.onLoadError(error, context);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function createUserCommentsLoader(config) {
|
|
46
|
+
return async () => {
|
|
47
|
+
if (typeof window === "undefined") {
|
|
48
|
+
const { apiBasePath, apiBaseURL, headers, hooks } = config;
|
|
49
|
+
const context = {
|
|
50
|
+
path: "/comments",
|
|
51
|
+
isSSR: true,
|
|
52
|
+
apiBaseURL,
|
|
53
|
+
apiBasePath,
|
|
54
|
+
headers
|
|
55
|
+
};
|
|
56
|
+
try {
|
|
57
|
+
if (hooks?.beforeLoadUserComments) {
|
|
58
|
+
await hooks.beforeLoadUserComments(context);
|
|
59
|
+
}
|
|
60
|
+
} catch (error) {
|
|
61
|
+
if (client.isConnectionError(error)) {
|
|
62
|
+
console.warn(
|
|
63
|
+
"[btst/comments] route.loader() failed \u2014 no server running at build time."
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
if (hooks?.onLoadError) {
|
|
67
|
+
await hooks.onLoadError(error, context);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
function createCommentsRouteMeta(config, path, title, description) {
|
|
74
|
+
return () => {
|
|
75
|
+
const fullUrl = `${config.siteBaseURL}${config.siteBasePath}${path}`;
|
|
76
|
+
return [
|
|
77
|
+
{ title },
|
|
78
|
+
{ name: "title", content: title },
|
|
79
|
+
{ name: "description", content: description },
|
|
80
|
+
{ name: "robots", content: "noindex, nofollow" },
|
|
81
|
+
{ property: "og:title", content: title },
|
|
82
|
+
{ property: "og:description", content: description },
|
|
83
|
+
{ property: "og:url", content: fullUrl },
|
|
84
|
+
{ name: "twitter:card", content: "summary" },
|
|
85
|
+
{ name: "twitter:title", content: title },
|
|
86
|
+
{ name: "twitter:description", content: description }
|
|
87
|
+
];
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
const commentsClientPlugin = (config) => client.defineClientPlugin({
|
|
91
|
+
name: "comments",
|
|
92
|
+
routes: () => ({
|
|
93
|
+
moderation: yar.createRoute("/comments/moderation", () => ({
|
|
94
|
+
PageComponent: ModerationPageComponent,
|
|
95
|
+
loader: createModerationLoader(config),
|
|
96
|
+
meta: createCommentsRouteMeta(
|
|
97
|
+
config,
|
|
98
|
+
"/comments/moderation",
|
|
99
|
+
"Comment Moderation",
|
|
100
|
+
"Review and manage comments across all resources."
|
|
101
|
+
)
|
|
102
|
+
})),
|
|
103
|
+
userComments: yar.createRoute("/comments", () => ({
|
|
104
|
+
PageComponent: UserCommentsPageComponent,
|
|
105
|
+
loader: createUserCommentsLoader(config),
|
|
106
|
+
meta: createCommentsRouteMeta(
|
|
107
|
+
config,
|
|
108
|
+
"/comments",
|
|
109
|
+
"User Comments",
|
|
110
|
+
"View and manage your comments across resources."
|
|
111
|
+
)
|
|
112
|
+
}))
|
|
113
|
+
})
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
exports.commentsClientPlugin = commentsClientPlugin;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { lazy } from 'react';
|
|
2
|
+
import { defineClientPlugin, isConnectionError } from '@btst/stack/plugins/client';
|
|
3
|
+
import { createRoute } from '@btst/yar';
|
|
4
|
+
|
|
5
|
+
const ModerationPageComponent = lazy(
|
|
6
|
+
() => import('./components/pages/moderation-page.mjs').then((m) => ({
|
|
7
|
+
default: m.ModerationPageComponent
|
|
8
|
+
}))
|
|
9
|
+
);
|
|
10
|
+
const UserCommentsPageComponent = lazy(
|
|
11
|
+
() => import('./components/pages/my-comments-page.mjs').then((m) => ({
|
|
12
|
+
default: m.UserCommentsPageComponent
|
|
13
|
+
}))
|
|
14
|
+
);
|
|
15
|
+
function createModerationLoader(config) {
|
|
16
|
+
return async () => {
|
|
17
|
+
if (typeof window === "undefined") {
|
|
18
|
+
const { apiBasePath, apiBaseURL, headers, hooks } = config;
|
|
19
|
+
const context = {
|
|
20
|
+
path: "/comments/moderation",
|
|
21
|
+
isSSR: true,
|
|
22
|
+
apiBaseURL,
|
|
23
|
+
apiBasePath,
|
|
24
|
+
headers
|
|
25
|
+
};
|
|
26
|
+
try {
|
|
27
|
+
if (hooks?.beforeLoadModeration) {
|
|
28
|
+
await hooks.beforeLoadModeration(context);
|
|
29
|
+
}
|
|
30
|
+
} catch (error) {
|
|
31
|
+
if (isConnectionError(error)) {
|
|
32
|
+
console.warn(
|
|
33
|
+
"[btst/comments] route.loader() failed \u2014 no server running at build time."
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
if (hooks?.onLoadError) {
|
|
37
|
+
await hooks.onLoadError(error, context);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function createUserCommentsLoader(config) {
|
|
44
|
+
return async () => {
|
|
45
|
+
if (typeof window === "undefined") {
|
|
46
|
+
const { apiBasePath, apiBaseURL, headers, hooks } = config;
|
|
47
|
+
const context = {
|
|
48
|
+
path: "/comments",
|
|
49
|
+
isSSR: true,
|
|
50
|
+
apiBaseURL,
|
|
51
|
+
apiBasePath,
|
|
52
|
+
headers
|
|
53
|
+
};
|
|
54
|
+
try {
|
|
55
|
+
if (hooks?.beforeLoadUserComments) {
|
|
56
|
+
await hooks.beforeLoadUserComments(context);
|
|
57
|
+
}
|
|
58
|
+
} catch (error) {
|
|
59
|
+
if (isConnectionError(error)) {
|
|
60
|
+
console.warn(
|
|
61
|
+
"[btst/comments] route.loader() failed \u2014 no server running at build time."
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
if (hooks?.onLoadError) {
|
|
65
|
+
await hooks.onLoadError(error, context);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function createCommentsRouteMeta(config, path, title, description) {
|
|
72
|
+
return () => {
|
|
73
|
+
const fullUrl = `${config.siteBaseURL}${config.siteBasePath}${path}`;
|
|
74
|
+
return [
|
|
75
|
+
{ title },
|
|
76
|
+
{ name: "title", content: title },
|
|
77
|
+
{ name: "description", content: description },
|
|
78
|
+
{ name: "robots", content: "noindex, nofollow" },
|
|
79
|
+
{ property: "og:title", content: title },
|
|
80
|
+
{ property: "og:description", content: description },
|
|
81
|
+
{ property: "og:url", content: fullUrl },
|
|
82
|
+
{ name: "twitter:card", content: "summary" },
|
|
83
|
+
{ name: "twitter:title", content: title },
|
|
84
|
+
{ name: "twitter:description", content: description }
|
|
85
|
+
];
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
const commentsClientPlugin = (config) => defineClientPlugin({
|
|
89
|
+
name: "comments",
|
|
90
|
+
routes: () => ({
|
|
91
|
+
moderation: createRoute("/comments/moderation", () => ({
|
|
92
|
+
PageComponent: ModerationPageComponent,
|
|
93
|
+
loader: createModerationLoader(config),
|
|
94
|
+
meta: createCommentsRouteMeta(
|
|
95
|
+
config,
|
|
96
|
+
"/comments/moderation",
|
|
97
|
+
"Comment Moderation",
|
|
98
|
+
"Review and manage comments across all resources."
|
|
99
|
+
)
|
|
100
|
+
})),
|
|
101
|
+
userComments: createRoute("/comments", () => ({
|
|
102
|
+
PageComponent: UserCommentsPageComponent,
|
|
103
|
+
loader: createUserCommentsLoader(config),
|
|
104
|
+
meta: createCommentsRouteMeta(
|
|
105
|
+
config,
|
|
106
|
+
"/comments",
|
|
107
|
+
"User Comments",
|
|
108
|
+
"View and manage your comments across resources."
|
|
109
|
+
)
|
|
110
|
+
}))
|
|
111
|
+
})
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
export { commentsClientPlugin };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const React = require('react');
|
|
4
|
+
|
|
5
|
+
function useResolvedCurrentUserId(raw) {
|
|
6
|
+
const [resolved, setResolved] = React.useState(
|
|
7
|
+
typeof raw === "string" ? raw : void 0
|
|
8
|
+
);
|
|
9
|
+
React.useEffect(() => {
|
|
10
|
+
if (typeof raw === "function") {
|
|
11
|
+
void Promise.resolve(raw()).then((id) => setResolved(id ?? void 0)).catch((err) => {
|
|
12
|
+
console.error(
|
|
13
|
+
"[btst/comments] Failed to resolve currentUserId:",
|
|
14
|
+
err
|
|
15
|
+
);
|
|
16
|
+
});
|
|
17
|
+
} else {
|
|
18
|
+
setResolved(raw ?? void 0);
|
|
19
|
+
}
|
|
20
|
+
}, [raw]);
|
|
21
|
+
return resolved;
|
|
22
|
+
}
|
|
23
|
+
function toError(error) {
|
|
24
|
+
if (error instanceof Error) return error;
|
|
25
|
+
if (typeof error === "object" && error !== null) {
|
|
26
|
+
const obj = error;
|
|
27
|
+
const message = (typeof obj.message === "string" ? obj.message : null) || (typeof obj.error === "string" ? obj.error : null) || JSON.stringify(error);
|
|
28
|
+
const err = new Error(message);
|
|
29
|
+
Object.assign(err, error);
|
|
30
|
+
return err;
|
|
31
|
+
}
|
|
32
|
+
return new Error(String(error));
|
|
33
|
+
}
|
|
34
|
+
function getInitials(name) {
|
|
35
|
+
if (!name) return "?";
|
|
36
|
+
return name.split(" ").filter(Boolean).slice(0, 2).map((n) => n[0]).join("").toUpperCase();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
exports.getInitials = getInitials;
|
|
40
|
+
exports.toError = toError;
|
|
41
|
+
exports.useResolvedCurrentUserId = useResolvedCurrentUserId;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
|
+
|
|
3
|
+
function useResolvedCurrentUserId(raw) {
|
|
4
|
+
const [resolved, setResolved] = useState(
|
|
5
|
+
typeof raw === "string" ? raw : void 0
|
|
6
|
+
);
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
if (typeof raw === "function") {
|
|
9
|
+
void Promise.resolve(raw()).then((id) => setResolved(id ?? void 0)).catch((err) => {
|
|
10
|
+
console.error(
|
|
11
|
+
"[btst/comments] Failed to resolve currentUserId:",
|
|
12
|
+
err
|
|
13
|
+
);
|
|
14
|
+
});
|
|
15
|
+
} else {
|
|
16
|
+
setResolved(raw ?? void 0);
|
|
17
|
+
}
|
|
18
|
+
}, [raw]);
|
|
19
|
+
return resolved;
|
|
20
|
+
}
|
|
21
|
+
function toError(error) {
|
|
22
|
+
if (error instanceof Error) return error;
|
|
23
|
+
if (typeof error === "object" && error !== null) {
|
|
24
|
+
const obj = error;
|
|
25
|
+
const message = (typeof obj.message === "string" ? obj.message : null) || (typeof obj.error === "string" ? obj.error : null) || JSON.stringify(error);
|
|
26
|
+
const err = new Error(message);
|
|
27
|
+
Object.assign(err, error);
|
|
28
|
+
return err;
|
|
29
|
+
}
|
|
30
|
+
return new Error(String(error));
|
|
31
|
+
}
|
|
32
|
+
function getInitials(name) {
|
|
33
|
+
if (!name) return "?";
|
|
34
|
+
return name.split(" ").filter(Boolean).slice(0, 2).map((n) => n[0]).join("").toUpperCase();
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export { getInitials, toError, useResolvedCurrentUserId };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const db = require('@btst/db');
|
|
4
|
+
|
|
5
|
+
const commentsSchema = db.createDbPlugin("comments", {
|
|
6
|
+
comment: {
|
|
7
|
+
modelName: "comment",
|
|
8
|
+
fields: {
|
|
9
|
+
resourceId: {
|
|
10
|
+
type: "string",
|
|
11
|
+
required: true
|
|
12
|
+
},
|
|
13
|
+
resourceType: {
|
|
14
|
+
type: "string",
|
|
15
|
+
required: true
|
|
16
|
+
},
|
|
17
|
+
parentId: {
|
|
18
|
+
type: "string",
|
|
19
|
+
required: false
|
|
20
|
+
},
|
|
21
|
+
authorId: {
|
|
22
|
+
type: "string",
|
|
23
|
+
required: true
|
|
24
|
+
},
|
|
25
|
+
body: {
|
|
26
|
+
type: "string",
|
|
27
|
+
required: true
|
|
28
|
+
},
|
|
29
|
+
status: {
|
|
30
|
+
type: "string",
|
|
31
|
+
defaultValue: "pending"
|
|
32
|
+
},
|
|
33
|
+
likes: {
|
|
34
|
+
type: "number",
|
|
35
|
+
defaultValue: 0
|
|
36
|
+
},
|
|
37
|
+
editedAt: {
|
|
38
|
+
type: "date",
|
|
39
|
+
required: false
|
|
40
|
+
},
|
|
41
|
+
createdAt: {
|
|
42
|
+
type: "date",
|
|
43
|
+
defaultValue: () => /* @__PURE__ */ new Date()
|
|
44
|
+
},
|
|
45
|
+
updatedAt: {
|
|
46
|
+
type: "date",
|
|
47
|
+
defaultValue: () => /* @__PURE__ */ new Date()
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
commentLike: {
|
|
52
|
+
modelName: "commentLike",
|
|
53
|
+
fields: {
|
|
54
|
+
commentId: {
|
|
55
|
+
type: "string",
|
|
56
|
+
required: true,
|
|
57
|
+
references: {
|
|
58
|
+
model: "comment",
|
|
59
|
+
field: "id",
|
|
60
|
+
onDelete: "cascade"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
authorId: {
|
|
64
|
+
type: "string",
|
|
65
|
+
required: true
|
|
66
|
+
},
|
|
67
|
+
createdAt: {
|
|
68
|
+
type: "date",
|
|
69
|
+
defaultValue: () => /* @__PURE__ */ new Date()
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
exports.commentsSchema = commentsSchema;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { createDbPlugin } from '@btst/db';
|
|
2
|
+
|
|
3
|
+
const commentsSchema = createDbPlugin("comments", {
|
|
4
|
+
comment: {
|
|
5
|
+
modelName: "comment",
|
|
6
|
+
fields: {
|
|
7
|
+
resourceId: {
|
|
8
|
+
type: "string",
|
|
9
|
+
required: true
|
|
10
|
+
},
|
|
11
|
+
resourceType: {
|
|
12
|
+
type: "string",
|
|
13
|
+
required: true
|
|
14
|
+
},
|
|
15
|
+
parentId: {
|
|
16
|
+
type: "string",
|
|
17
|
+
required: false
|
|
18
|
+
},
|
|
19
|
+
authorId: {
|
|
20
|
+
type: "string",
|
|
21
|
+
required: true
|
|
22
|
+
},
|
|
23
|
+
body: {
|
|
24
|
+
type: "string",
|
|
25
|
+
required: true
|
|
26
|
+
},
|
|
27
|
+
status: {
|
|
28
|
+
type: "string",
|
|
29
|
+
defaultValue: "pending"
|
|
30
|
+
},
|
|
31
|
+
likes: {
|
|
32
|
+
type: "number",
|
|
33
|
+
defaultValue: 0
|
|
34
|
+
},
|
|
35
|
+
editedAt: {
|
|
36
|
+
type: "date",
|
|
37
|
+
required: false
|
|
38
|
+
},
|
|
39
|
+
createdAt: {
|
|
40
|
+
type: "date",
|
|
41
|
+
defaultValue: () => /* @__PURE__ */ new Date()
|
|
42
|
+
},
|
|
43
|
+
updatedAt: {
|
|
44
|
+
type: "date",
|
|
45
|
+
defaultValue: () => /* @__PURE__ */ new Date()
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
commentLike: {
|
|
50
|
+
modelName: "commentLike",
|
|
51
|
+
fields: {
|
|
52
|
+
commentId: {
|
|
53
|
+
type: "string",
|
|
54
|
+
required: true,
|
|
55
|
+
references: {
|
|
56
|
+
model: "comment",
|
|
57
|
+
field: "id",
|
|
58
|
+
onDelete: "cascade"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
authorId: {
|
|
62
|
+
type: "string",
|
|
63
|
+
required: true
|
|
64
|
+
},
|
|
65
|
+
createdAt: {
|
|
66
|
+
type: "date",
|
|
67
|
+
defaultValue: () => /* @__PURE__ */ new Date()
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
export { commentsSchema };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const z = require('zod');
|
|
4
|
+
|
|
5
|
+
const CommentStatusSchema = z.z.enum(["pending", "approved", "spam"]);
|
|
6
|
+
const createCommentSchema = z.z.object({
|
|
7
|
+
resourceId: z.z.string().min(1, "Resource ID is required"),
|
|
8
|
+
resourceType: z.z.string().min(1, "Resource type is required"),
|
|
9
|
+
parentId: z.z.string().optional().nullable(),
|
|
10
|
+
body: z.z.string().min(1, "Body is required").max(1e4, "Comment too long")
|
|
11
|
+
});
|
|
12
|
+
createCommentSchema.extend({
|
|
13
|
+
authorId: z.z.string().min(1, "Author ID is required")
|
|
14
|
+
});
|
|
15
|
+
const updateCommentSchema = z.z.object({
|
|
16
|
+
body: z.z.string().min(1, "Body is required").max(1e4, "Comment too long")
|
|
17
|
+
});
|
|
18
|
+
const updateCommentStatusSchema = z.z.object({
|
|
19
|
+
status: CommentStatusSchema
|
|
20
|
+
});
|
|
21
|
+
const CommentListQuerySchema = z.z.object({
|
|
22
|
+
resourceId: z.z.string().optional(),
|
|
23
|
+
resourceType: z.z.string().optional(),
|
|
24
|
+
parentId: z.z.string().optional().nullable(),
|
|
25
|
+
status: CommentStatusSchema.optional(),
|
|
26
|
+
authorId: z.z.string().optional(),
|
|
27
|
+
sort: z.z.enum(["asc", "desc"]).optional(),
|
|
28
|
+
limit: z.z.coerce.number().int().min(1).max(100).optional(),
|
|
29
|
+
offset: z.z.coerce.number().int().min(0).optional()
|
|
30
|
+
});
|
|
31
|
+
CommentListQuerySchema.extend({
|
|
32
|
+
currentUserId: z.z.string().optional()
|
|
33
|
+
});
|
|
34
|
+
const CommentCountQuerySchema = z.z.object({
|
|
35
|
+
resourceId: z.z.string().min(1),
|
|
36
|
+
resourceType: z.z.string().min(1),
|
|
37
|
+
status: CommentStatusSchema.optional()
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
exports.CommentCountQuerySchema = CommentCountQuerySchema;
|
|
41
|
+
exports.CommentListQuerySchema = CommentListQuerySchema;
|
|
42
|
+
exports.CommentStatusSchema = CommentStatusSchema;
|
|
43
|
+
exports.createCommentSchema = createCommentSchema;
|
|
44
|
+
exports.updateCommentSchema = updateCommentSchema;
|
|
45
|
+
exports.updateCommentStatusSchema = updateCommentStatusSchema;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
const CommentStatusSchema = z.enum(["pending", "approved", "spam"]);
|
|
4
|
+
const createCommentSchema = z.object({
|
|
5
|
+
resourceId: z.string().min(1, "Resource ID is required"),
|
|
6
|
+
resourceType: z.string().min(1, "Resource type is required"),
|
|
7
|
+
parentId: z.string().optional().nullable(),
|
|
8
|
+
body: z.string().min(1, "Body is required").max(1e4, "Comment too long")
|
|
9
|
+
});
|
|
10
|
+
createCommentSchema.extend({
|
|
11
|
+
authorId: z.string().min(1, "Author ID is required")
|
|
12
|
+
});
|
|
13
|
+
const updateCommentSchema = z.object({
|
|
14
|
+
body: z.string().min(1, "Body is required").max(1e4, "Comment too long")
|
|
15
|
+
});
|
|
16
|
+
const updateCommentStatusSchema = z.object({
|
|
17
|
+
status: CommentStatusSchema
|
|
18
|
+
});
|
|
19
|
+
const CommentListQuerySchema = z.object({
|
|
20
|
+
resourceId: z.string().optional(),
|
|
21
|
+
resourceType: z.string().optional(),
|
|
22
|
+
parentId: z.string().optional().nullable(),
|
|
23
|
+
status: CommentStatusSchema.optional(),
|
|
24
|
+
authorId: z.string().optional(),
|
|
25
|
+
sort: z.enum(["asc", "desc"]).optional(),
|
|
26
|
+
limit: z.coerce.number().int().min(1).max(100).optional(),
|
|
27
|
+
offset: z.coerce.number().int().min(0).optional()
|
|
28
|
+
});
|
|
29
|
+
CommentListQuerySchema.extend({
|
|
30
|
+
currentUserId: z.string().optional()
|
|
31
|
+
});
|
|
32
|
+
const CommentCountQuerySchema = z.object({
|
|
33
|
+
resourceId: z.string().min(1),
|
|
34
|
+
resourceType: z.string().min(1),
|
|
35
|
+
status: CommentStatusSchema.optional()
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export { CommentCountQuerySchema, CommentListQuerySchema, CommentStatusSchema, createCommentSchema, updateCommentSchema, updateCommentStatusSchema };
|
|
@@ -139,7 +139,7 @@ const kanbanBackendPlugin = (hooks) => api.defineBackendPlugin({
|
|
|
139
139
|
let newBoard;
|
|
140
140
|
const createdColumns = [];
|
|
141
141
|
await adapter.transaction(async (tx) => {
|
|
142
|
-
|
|
142
|
+
const createdBoard = await tx.create({
|
|
143
143
|
model: "kanbanBoard",
|
|
144
144
|
data: {
|
|
145
145
|
...boardData,
|
|
@@ -148,10 +148,11 @@ const kanbanBackendPlugin = (hooks) => api.defineBackendPlugin({
|
|
|
148
148
|
updatedAt: /* @__PURE__ */ new Date()
|
|
149
149
|
}
|
|
150
150
|
});
|
|
151
|
+
newBoard = createdBoard;
|
|
151
152
|
const defaultColumns = [
|
|
152
|
-
{ title: "To Do", order: 0, boardId:
|
|
153
|
-
{ title: "In Progress", order: 1, boardId:
|
|
154
|
-
{ title: "Done", order: 2, boardId:
|
|
153
|
+
{ title: "To Do", order: 0, boardId: createdBoard.id },
|
|
154
|
+
{ title: "In Progress", order: 1, boardId: createdBoard.id },
|
|
155
|
+
{ title: "Done", order: 2, boardId: createdBoard.id }
|
|
155
156
|
];
|
|
156
157
|
for (const colData of defaultColumns) {
|
|
157
158
|
const col = await tx.create({
|
|
@@ -137,7 +137,7 @@ const kanbanBackendPlugin = (hooks) => defineBackendPlugin({
|
|
|
137
137
|
let newBoard;
|
|
138
138
|
const createdColumns = [];
|
|
139
139
|
await adapter.transaction(async (tx) => {
|
|
140
|
-
|
|
140
|
+
const createdBoard = await tx.create({
|
|
141
141
|
model: "kanbanBoard",
|
|
142
142
|
data: {
|
|
143
143
|
...boardData,
|
|
@@ -146,10 +146,11 @@ const kanbanBackendPlugin = (hooks) => defineBackendPlugin({
|
|
|
146
146
|
updatedAt: /* @__PURE__ */ new Date()
|
|
147
147
|
}
|
|
148
148
|
});
|
|
149
|
+
newBoard = createdBoard;
|
|
149
150
|
const defaultColumns = [
|
|
150
|
-
{ title: "To Do", order: 0, boardId:
|
|
151
|
-
{ title: "In Progress", order: 1, boardId:
|
|
152
|
-
{ title: "Done", order: 2, boardId:
|
|
151
|
+
{ title: "To Do", order: 0, boardId: createdBoard.id },
|
|
152
|
+
{ title: "In Progress", order: 1, boardId: createdBoard.id },
|
|
153
|
+
{ title: "Done", order: 2, boardId: createdBoard.id }
|
|
153
154
|
];
|
|
154
155
|
for (const colData of defaultColumns) {
|
|
155
156
|
const col = await tx.create({
|