@btst/stack 2.11.7 → 2.12.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.
Files changed (77) hide show
  1. package/dist/packages/stack/src/plugins/blog/client/components/pages/post-page.internal.cjs +2 -6
  2. package/dist/packages/stack/src/plugins/blog/client/components/pages/post-page.internal.mjs +5 -9
  3. package/dist/packages/stack/src/plugins/blog/client/components/shared/collapsible-tag-list.cjs +44 -0
  4. package/dist/packages/stack/src/plugins/blog/client/components/shared/collapsible-tag-list.mjs +42 -0
  5. package/dist/packages/stack/src/plugins/blog/client/components/shared/tags-list.cjs +2 -8
  6. package/dist/packages/stack/src/plugins/blog/client/components/shared/tags-list.mjs +2 -8
  7. package/dist/packages/stack/src/plugins/blog/client/localization/blog-common.cjs +3 -1
  8. package/dist/packages/stack/src/plugins/blog/client/localization/blog-common.mjs +3 -1
  9. package/dist/packages/stack/src/plugins/comments/api/query-key-defs.cjs +2 -1
  10. package/dist/packages/stack/src/plugins/comments/api/query-key-defs.mjs +2 -1
  11. package/dist/packages/stack/src/plugins/comments/client/components/comment-thread.cjs +6 -2
  12. package/dist/packages/stack/src/plugins/comments/client/components/comment-thread.mjs +6 -2
  13. package/dist/packages/stack/src/plugins/comments/client/hooks/use-comments.cjs +5 -3
  14. package/dist/packages/stack/src/plugins/comments/client/hooks/use-comments.mjs +5 -3
  15. package/dist/plugins/blog/api/index.d.cts +2 -2
  16. package/dist/plugins/blog/api/index.d.mts +2 -2
  17. package/dist/plugins/blog/api/index.d.ts +2 -2
  18. package/dist/plugins/blog/client/hooks/index.d.cts +2 -2
  19. package/dist/plugins/blog/client/hooks/index.d.mts +2 -2
  20. package/dist/plugins/blog/client/hooks/index.d.ts +2 -2
  21. package/dist/plugins/blog/client/index.d.cts +4 -2
  22. package/dist/plugins/blog/client/index.d.mts +4 -2
  23. package/dist/plugins/blog/client/index.d.ts +4 -2
  24. package/dist/plugins/blog/query-keys.d.cts +2 -2
  25. package/dist/plugins/blog/query-keys.d.mts +2 -2
  26. package/dist/plugins/blog/query-keys.d.ts +2 -2
  27. package/dist/plugins/comments/api/index.d.cts +4 -4
  28. package/dist/plugins/comments/api/index.d.mts +4 -4
  29. package/dist/plugins/comments/api/index.d.ts +4 -4
  30. package/dist/plugins/comments/client/components/index.d.cts +11 -0
  31. package/dist/plugins/comments/client/components/index.d.mts +11 -0
  32. package/dist/plugins/comments/client/components/index.d.ts +11 -0
  33. package/dist/plugins/comments/client/hooks/index.d.cts +17 -1
  34. package/dist/plugins/comments/client/hooks/index.d.mts +17 -1
  35. package/dist/plugins/comments/client/hooks/index.d.ts +17 -1
  36. package/dist/plugins/comments/client/index.d.cts +9 -0
  37. package/dist/plugins/comments/client/index.d.mts +9 -0
  38. package/dist/plugins/comments/client/index.d.ts +9 -0
  39. package/dist/plugins/comments/query-keys.cjs +1 -0
  40. package/dist/plugins/comments/query-keys.d.cts +3 -2
  41. package/dist/plugins/comments/query-keys.d.mts +3 -2
  42. package/dist/plugins/comments/query-keys.d.ts +3 -2
  43. package/dist/plugins/comments/query-keys.mjs +1 -0
  44. package/dist/plugins/kanban/api/index.d.cts +1 -1
  45. package/dist/plugins/kanban/api/index.d.mts +1 -1
  46. package/dist/plugins/kanban/api/index.d.ts +1 -1
  47. package/dist/plugins/kanban/query-keys.d.cts +1 -1
  48. package/dist/plugins/kanban/query-keys.d.mts +1 -1
  49. package/dist/plugins/kanban/query-keys.d.ts +1 -1
  50. package/dist/shared/{stack.CLWhMntf.d.cts → stack.04aMRz_W.d.cts} +5 -5
  51. package/dist/shared/{stack.CJE9sAjV.d.ts → stack.Bq3kiUaM.d.ts} +1 -1
  52. package/dist/shared/{stack.DNLuzDb3.d.cts → stack.BvuqACtA.d.cts} +3 -3
  53. package/dist/shared/{stack.C-b3Sn8j.d.cts → stack.C7KNNiJm.d.cts} +3 -1
  54. package/dist/shared/{stack.C-b3Sn8j.d.mts → stack.C7KNNiJm.d.mts} +3 -1
  55. package/dist/shared/{stack.C-b3Sn8j.d.ts → stack.C7KNNiJm.d.ts} +3 -1
  56. package/dist/shared/{stack.Dcz6636A.d.mts → stack.CCncwK6g.d.cts} +1 -1
  57. package/dist/shared/{stack.CmHRdhl8.d.cts → stack.CO1g47IS.d.mts} +1 -1
  58. package/dist/shared/{stack.Dfc44JiE.d.mts → stack.Cs8R5HxD.d.mts} +3 -3
  59. package/dist/shared/{stack.ufcExQIR.d.ts → stack.CxWEN62M.d.ts} +5 -5
  60. package/dist/shared/{stack.BnSAhKJi.d.ts → stack.DPTRuLUH.d.ts} +3 -3
  61. package/dist/shared/{stack.DiodAFAa.d.mts → stack.ueI-K4xy.d.mts} +5 -5
  62. package/package.json +1 -1
  63. package/src/plugins/blog/client/components/pages/post-page.internal.tsx +4 -21
  64. package/src/plugins/blog/client/components/shared/collapsible-tag-list.tsx +76 -0
  65. package/src/plugins/blog/client/components/shared/tags-list.tsx +2 -18
  66. package/src/plugins/blog/client/localization/blog-common.ts +2 -0
  67. package/src/plugins/comments/api/query-key-defs.ts +5 -1
  68. package/src/plugins/comments/client/components/comment-thread.tsx +15 -0
  69. package/src/plugins/comments/client/hooks/use-comments.tsx +26 -3
  70. package/src/plugins/comments/client/overrides.ts +10 -0
  71. package/src/plugins/comments/query-keys.ts +2 -0
  72. package/dist/shared/{stack.Rtcvl8sS.d.cts → stack.B6S3cgwN.d.cts} +13 -13
  73. package/dist/shared/{stack.HE_IvqV5.d.mts → stack.Bzfx-_lq.d.mts} +13 -13
  74. package/dist/shared/{stack.CuhcFsAx.d.cts → stack.DuQOcInS.d.cts} +3 -3
  75. package/dist/shared/{stack.CuhcFsAx.d.mts → stack.DuQOcInS.d.mts} +3 -3
  76. package/dist/shared/{stack.CuhcFsAx.d.ts → stack.DuQOcInS.d.ts} +3 -3
  77. package/dist/shared/{stack.D4Cea8II.d.ts → stack.j5SFLC1d.d.ts} +13 -13
@@ -1,8 +1,8 @@
1
- import { a as CommentListParamsSchema, b as CommentCountQuerySchema } from '../../../shared/stack.Dcz6636A.mjs';
2
- export { d as CommentsApiContext, C as CommentsApiRouter, e as CommentsBackendOptions, c as commentsBackendPlugin } from '../../../shared/stack.Dcz6636A.mjs';
1
+ import { a as CommentListParamsSchema, b as CommentCountQuerySchema } from '../../../shared/stack.CO1g47IS.mjs';
2
+ export { d as CommentsApiContext, C as CommentsApiRouter, e as CommentsBackendOptions, c as commentsBackendPlugin } from '../../../shared/stack.CO1g47IS.mjs';
3
3
  import { DBAdapter } from '@btst/db';
4
- import { C as CommentListResult, S as SerializedComment, d as Comment } from '../../../shared/stack.C-b3Sn8j.mjs';
5
- export { e as COMMENTS_QUERY_KEYS } from '../../../shared/stack.C-b3Sn8j.mjs';
4
+ import { C as CommentListResult, S as SerializedComment, d as Comment } from '../../../shared/stack.C7KNNiJm.mjs';
5
+ export { e as COMMENTS_QUERY_KEYS } from '../../../shared/stack.C7KNNiJm.mjs';
6
6
  import { z } from 'zod';
7
7
  import '@btst/stack/plugins/api';
8
8
  import 'better-call';
@@ -1,8 +1,8 @@
1
- import { a as CommentListParamsSchema, b as CommentCountQuerySchema } from '../../../shared/stack.CJE9sAjV.js';
2
- export { d as CommentsApiContext, C as CommentsApiRouter, e as CommentsBackendOptions, c as commentsBackendPlugin } from '../../../shared/stack.CJE9sAjV.js';
1
+ import { a as CommentListParamsSchema, b as CommentCountQuerySchema } from '../../../shared/stack.Bq3kiUaM.js';
2
+ export { d as CommentsApiContext, C as CommentsApiRouter, e as CommentsBackendOptions, c as commentsBackendPlugin } from '../../../shared/stack.Bq3kiUaM.js';
3
3
  import { DBAdapter } from '@btst/db';
4
- import { C as CommentListResult, S as SerializedComment, d as Comment } from '../../../shared/stack.C-b3Sn8j.js';
5
- export { e as COMMENTS_QUERY_KEYS } from '../../../shared/stack.C-b3Sn8j.js';
4
+ import { C as CommentListResult, S as SerializedComment, d as Comment } from '../../../shared/stack.C7KNNiJm.js';
5
+ export { e as COMMENTS_QUERY_KEYS } from '../../../shared/stack.C7KNNiJm.js';
6
6
  import { z } from 'zod';
7
7
  import '@btst/stack/plugins/api';
8
8
  import 'better-call';
@@ -59,6 +59,17 @@ interface CommentThreadProps {
59
59
  * Defaults to true.
60
60
  */
61
61
  allowEditing?: boolean;
62
+ /**
63
+ * Sort direction for top-level comments by `createdAt`.
64
+ * - `"desc"` (default): newest first.
65
+ * - `"asc"`: oldest first.
66
+ *
67
+ * Replies inside each thread always render chronologically (oldest → newest)
68
+ * and are unaffected by this prop.
69
+ *
70
+ * Overrides the global `defaultCommentSort` from `CommentsPluginOverrides`.
71
+ */
72
+ sort?: "asc" | "desc";
62
73
  }
63
74
  declare function CommentThread(props: CommentThreadProps): react_jsx_runtime.JSX.Element;
64
75
 
@@ -59,6 +59,17 @@ interface CommentThreadProps {
59
59
  * Defaults to true.
60
60
  */
61
61
  allowEditing?: boolean;
62
+ /**
63
+ * Sort direction for top-level comments by `createdAt`.
64
+ * - `"desc"` (default): newest first.
65
+ * - `"asc"`: oldest first.
66
+ *
67
+ * Replies inside each thread always render chronologically (oldest → newest)
68
+ * and are unaffected by this prop.
69
+ *
70
+ * Overrides the global `defaultCommentSort` from `CommentsPluginOverrides`.
71
+ */
72
+ sort?: "asc" | "desc";
62
73
  }
63
74
  declare function CommentThread(props: CommentThreadProps): react_jsx_runtime.JSX.Element;
64
75
 
@@ -59,6 +59,17 @@ interface CommentThreadProps {
59
59
  * Defaults to true.
60
60
  */
61
61
  allowEditing?: boolean;
62
+ /**
63
+ * Sort direction for top-level comments by `createdAt`.
64
+ * - `"desc"` (default): newest first.
65
+ * - `"asc"`: oldest first.
66
+ *
67
+ * Replies inside each thread always render chronologically (oldest → newest)
68
+ * and are unaffected by this prop.
69
+ *
70
+ * Overrides the global `defaultCommentSort` from `CommentsPluginOverrides`.
71
+ */
72
+ sort?: "asc" | "desc";
62
73
  }
63
74
  declare function CommentThread(props: CommentThreadProps): react_jsx_runtime.JSX.Element;
64
75
 
@@ -1,4 +1,4 @@
1
- import { C as CommentListResult, S as SerializedComment, a as CommentsThreadDiscriminator } from '../../../../shared/stack.C-b3Sn8j.cjs';
1
+ import { C as CommentListResult, S as SerializedComment, a as CommentsThreadDiscriminator } from '../../../../shared/stack.C7KNNiJm.cjs';
2
2
  import * as _tanstack_react_query from '@tanstack/react-query';
3
3
  import { InfiniteData } from '@tanstack/react-query';
4
4
 
@@ -81,6 +81,11 @@ declare function useInfiniteComments(config: CommentsClientConfig, params: {
81
81
  parentId?: string | null;
82
82
  status?: "pending" | "approved" | "spam";
83
83
  currentUserId?: string;
84
+ /**
85
+ * Sort direction by `createdAt`. Default: `"asc"` (oldest first) — matches
86
+ * the server-side default. Pass `"desc"` for newest-first threads.
87
+ */
88
+ sort?: "asc" | "desc";
84
89
  pageSize?: number;
85
90
  }, options?: {
86
91
  enabled?: boolean;
@@ -129,6 +134,17 @@ declare function usePostComment(config: CommentsClientConfig, params: {
129
134
  * `nextOffset` from `lastPage.limit` instead of a hardcoded fallback.
130
135
  */
131
136
  pageSize?: number;
137
+ /**
138
+ * Sort direction of the surrounding infinite thread.
139
+ * - `"asc"` (default): newest comments belong on the LAST page → optimistic
140
+ * item is appended to `pages[last].items`.
141
+ * - `"desc"`: newest comments belong on the FIRST page → optimistic item
142
+ * is prepended to `pages[0].items`.
143
+ *
144
+ * Must match the `sort` passed to `useInfiniteComments` so the optimistic
145
+ * item appears in the same position the server will place it.
146
+ */
147
+ sort?: "asc" | "desc";
132
148
  }): _tanstack_react_query.UseMutationResult<SerializedComment, Error, {
133
149
  body: string;
134
150
  parentId?: string | null;
@@ -1,4 +1,4 @@
1
- import { C as CommentListResult, S as SerializedComment, a as CommentsThreadDiscriminator } from '../../../../shared/stack.C-b3Sn8j.mjs';
1
+ import { C as CommentListResult, S as SerializedComment, a as CommentsThreadDiscriminator } from '../../../../shared/stack.C7KNNiJm.mjs';
2
2
  import * as _tanstack_react_query from '@tanstack/react-query';
3
3
  import { InfiniteData } from '@tanstack/react-query';
4
4
 
@@ -81,6 +81,11 @@ declare function useInfiniteComments(config: CommentsClientConfig, params: {
81
81
  parentId?: string | null;
82
82
  status?: "pending" | "approved" | "spam";
83
83
  currentUserId?: string;
84
+ /**
85
+ * Sort direction by `createdAt`. Default: `"asc"` (oldest first) — matches
86
+ * the server-side default. Pass `"desc"` for newest-first threads.
87
+ */
88
+ sort?: "asc" | "desc";
84
89
  pageSize?: number;
85
90
  }, options?: {
86
91
  enabled?: boolean;
@@ -129,6 +134,17 @@ declare function usePostComment(config: CommentsClientConfig, params: {
129
134
  * `nextOffset` from `lastPage.limit` instead of a hardcoded fallback.
130
135
  */
131
136
  pageSize?: number;
137
+ /**
138
+ * Sort direction of the surrounding infinite thread.
139
+ * - `"asc"` (default): newest comments belong on the LAST page → optimistic
140
+ * item is appended to `pages[last].items`.
141
+ * - `"desc"`: newest comments belong on the FIRST page → optimistic item
142
+ * is prepended to `pages[0].items`.
143
+ *
144
+ * Must match the `sort` passed to `useInfiniteComments` so the optimistic
145
+ * item appears in the same position the server will place it.
146
+ */
147
+ sort?: "asc" | "desc";
132
148
  }): _tanstack_react_query.UseMutationResult<SerializedComment, Error, {
133
149
  body: string;
134
150
  parentId?: string | null;
@@ -1,4 +1,4 @@
1
- import { C as CommentListResult, S as SerializedComment, a as CommentsThreadDiscriminator } from '../../../../shared/stack.C-b3Sn8j.js';
1
+ import { C as CommentListResult, S as SerializedComment, a as CommentsThreadDiscriminator } from '../../../../shared/stack.C7KNNiJm.js';
2
2
  import * as _tanstack_react_query from '@tanstack/react-query';
3
3
  import { InfiniteData } from '@tanstack/react-query';
4
4
 
@@ -81,6 +81,11 @@ declare function useInfiniteComments(config: CommentsClientConfig, params: {
81
81
  parentId?: string | null;
82
82
  status?: "pending" | "approved" | "spam";
83
83
  currentUserId?: string;
84
+ /**
85
+ * Sort direction by `createdAt`. Default: `"asc"` (oldest first) — matches
86
+ * the server-side default. Pass `"desc"` for newest-first threads.
87
+ */
88
+ sort?: "asc" | "desc";
84
89
  pageSize?: number;
85
90
  }, options?: {
86
91
  enabled?: boolean;
@@ -129,6 +134,17 @@ declare function usePostComment(config: CommentsClientConfig, params: {
129
134
  * `nextOffset` from `lastPage.limit` instead of a hardcoded fallback.
130
135
  */
131
136
  pageSize?: number;
137
+ /**
138
+ * Sort direction of the surrounding infinite thread.
139
+ * - `"asc"` (default): newest comments belong on the LAST page → optimistic
140
+ * item is appended to `pages[last].items`.
141
+ * - `"desc"`: newest comments belong on the FIRST page → optimistic item
142
+ * is prepended to `pages[0].items`.
143
+ *
144
+ * Must match the `sort` passed to `useInfiniteComments` so the optimistic
145
+ * item appears in the same position the server will place it.
146
+ */
147
+ sort?: "asc" | "desc";
132
148
  }): _tanstack_react_query.UseMutationResult<SerializedComment, Error, {
133
149
  body: string;
134
150
  parentId?: string | null;
@@ -197,6 +197,15 @@ interface CommentsPluginOverrides {
197
197
  * Defaults to 100 when not set.
198
198
  */
199
199
  defaultCommentPageSize?: number;
200
+ /**
201
+ * Default sort direction (by `createdAt`) for top-level comments in
202
+ * `CommentThread`.
203
+ * - `"desc"` (default): newest comments first.
204
+ * - `"asc"`: oldest comments first.
205
+ *
206
+ * Can be overridden per-instance via the `sort` prop on `CommentThread`.
207
+ */
208
+ defaultCommentSort?: "asc" | "desc";
200
209
  /**
201
210
  * When false, the comment form and reply buttons are hidden in all
202
211
  * `CommentThread` instances. Users can still read existing comments.
@@ -197,6 +197,15 @@ interface CommentsPluginOverrides {
197
197
  * Defaults to 100 when not set.
198
198
  */
199
199
  defaultCommentPageSize?: number;
200
+ /**
201
+ * Default sort direction (by `createdAt`) for top-level comments in
202
+ * `CommentThread`.
203
+ * - `"desc"` (default): newest comments first.
204
+ * - `"asc"`: oldest comments first.
205
+ *
206
+ * Can be overridden per-instance via the `sort` prop on `CommentThread`.
207
+ */
208
+ defaultCommentSort?: "asc" | "desc";
200
209
  /**
201
210
  * When false, the comment form and reply buttons are hidden in all
202
211
  * `CommentThread` instances. Users can still read existing comments.
@@ -197,6 +197,15 @@ interface CommentsPluginOverrides {
197
197
  * Defaults to 100 when not set.
198
198
  */
199
199
  defaultCommentPageSize?: number;
200
+ /**
201
+ * Default sort direction (by `createdAt`) for top-level comments in
202
+ * `CommentThread`.
203
+ * - `"desc"` (default): newest comments first.
204
+ * - `"asc"`: oldest comments first.
205
+ *
206
+ * Can be overridden per-instance via the `sort` prop on `CommentThread`.
207
+ */
208
+ defaultCommentSort?: "asc" | "desc";
200
209
  /**
201
210
  * When false, the comment form and reply buttons are hidden in all
202
211
  * `CommentThread` instances. Users can still read existing comments.
@@ -90,6 +90,7 @@ function createCommentsThreadQueries(client, headers) {
90
90
  // The server resolves the caller's identity server-side via the
91
91
  // resolveCurrentUserId hook. It is still included in the queryKey
92
92
  // above for client-side cache segregation.
93
+ sort: params?.sort,
93
94
  limit: params?.limit ?? 20,
94
95
  offset: pageParam ?? 0
95
96
  },
@@ -1,7 +1,7 @@
1
1
  import * as _tanstack_react_query from '@tanstack/react-query';
2
- import { b as CommentsListDiscriminator, C as CommentListResult, c as CommentCountDiscriminator, a as CommentsThreadDiscriminator } from '../../shared/stack.C-b3Sn8j.cjs';
2
+ import { b as CommentsListDiscriminator, C as CommentListResult, c as CommentCountDiscriminator, a as CommentsThreadDiscriminator } from '../../shared/stack.C7KNNiJm.cjs';
3
3
  import { createApiClient } from '@btst/stack/plugins/client';
4
- import { C as CommentsApiRouter } from '../../shared/stack.CmHRdhl8.cjs';
4
+ import { C as CommentsApiRouter } from '../../shared/stack.CCncwK6g.cjs';
5
5
  import '@btst/stack/plugins/api';
6
6
  import 'better-call';
7
7
  import 'zod';
@@ -56,6 +56,7 @@ declare function createCommentsQueryKeys(client: ReturnType<typeof createApiClie
56
56
  parentId?: string | null;
57
57
  status?: "pending" | "approved" | "spam";
58
58
  currentUserId?: string;
59
+ sort?: "asc" | "desc";
59
60
  limit?: number;
60
61
  } | undefined) => Omit<Omit<{
61
62
  queryKey: readonly ["commentsThread", "list", CommentsThreadDiscriminator];
@@ -1,7 +1,7 @@
1
1
  import * as _tanstack_react_query from '@tanstack/react-query';
2
- import { b as CommentsListDiscriminator, C as CommentListResult, c as CommentCountDiscriminator, a as CommentsThreadDiscriminator } from '../../shared/stack.C-b3Sn8j.mjs';
2
+ import { b as CommentsListDiscriminator, C as CommentListResult, c as CommentCountDiscriminator, a as CommentsThreadDiscriminator } from '../../shared/stack.C7KNNiJm.mjs';
3
3
  import { createApiClient } from '@btst/stack/plugins/client';
4
- import { C as CommentsApiRouter } from '../../shared/stack.Dcz6636A.mjs';
4
+ import { C as CommentsApiRouter } from '../../shared/stack.CO1g47IS.mjs';
5
5
  import '@btst/stack/plugins/api';
6
6
  import 'better-call';
7
7
  import 'zod';
@@ -56,6 +56,7 @@ declare function createCommentsQueryKeys(client: ReturnType<typeof createApiClie
56
56
  parentId?: string | null;
57
57
  status?: "pending" | "approved" | "spam";
58
58
  currentUserId?: string;
59
+ sort?: "asc" | "desc";
59
60
  limit?: number;
60
61
  } | undefined) => Omit<Omit<{
61
62
  queryKey: readonly ["commentsThread", "list", CommentsThreadDiscriminator];
@@ -1,7 +1,7 @@
1
1
  import * as _tanstack_react_query from '@tanstack/react-query';
2
- import { b as CommentsListDiscriminator, C as CommentListResult, c as CommentCountDiscriminator, a as CommentsThreadDiscriminator } from '../../shared/stack.C-b3Sn8j.js';
2
+ import { b as CommentsListDiscriminator, C as CommentListResult, c as CommentCountDiscriminator, a as CommentsThreadDiscriminator } from '../../shared/stack.C7KNNiJm.js';
3
3
  import { createApiClient } from '@btst/stack/plugins/client';
4
- import { C as CommentsApiRouter } from '../../shared/stack.CJE9sAjV.js';
4
+ import { C as CommentsApiRouter } from '../../shared/stack.Bq3kiUaM.js';
5
5
  import '@btst/stack/plugins/api';
6
6
  import 'better-call';
7
7
  import 'zod';
@@ -56,6 +56,7 @@ declare function createCommentsQueryKeys(client: ReturnType<typeof createApiClie
56
56
  parentId?: string | null;
57
57
  status?: "pending" | "approved" | "spam";
58
58
  currentUserId?: string;
59
+ sort?: "asc" | "desc";
59
60
  limit?: number;
60
61
  } | undefined) => Omit<Omit<{
61
62
  queryKey: readonly ["commentsThread", "list", CommentsThreadDiscriminator];
@@ -88,6 +88,7 @@ function createCommentsThreadQueries(client, headers) {
88
88
  // The server resolves the caller's identity server-side via the
89
89
  // resolveCurrentUserId hook. It is still included in the queryKey
90
90
  // above for client-side cache segregation.
91
+ sort: params?.sort,
91
92
  limit: params?.limit ?? 20,
92
93
  offset: pageParam ?? 0
93
94
  },
@@ -1,4 +1,4 @@
1
- export { B as BoardListResult, C as CreateKanbanTaskInput, i as KANBAN_QUERY_KEYS, b as KanbanApiContext, K as KanbanApiRouter, c as KanbanBackendHooks, a as KanbanRouteKey, e as createKanbanTask, f as findOrCreateKanbanBoard, g as getAllBoards, d as getBoardById, h as getKanbanColumnsByBoardId, k as kanbanBackendPlugin } from '../../../shared/stack.Rtcvl8sS.cjs';
1
+ export { B as BoardListResult, C as CreateKanbanTaskInput, i as KANBAN_QUERY_KEYS, b as KanbanApiContext, K as KanbanApiRouter, c as KanbanBackendHooks, a as KanbanRouteKey, e as createKanbanTask, f as findOrCreateKanbanBoard, g as getAllBoards, d as getBoardById, h as getKanbanColumnsByBoardId, k as kanbanBackendPlugin } from '../../../shared/stack.B6S3cgwN.cjs';
2
2
  import { B as BoardWithColumns, S as SerializedBoardWithColumns, C as ColumnWithTasks, a as SerializedColumn, T as Task, b as SerializedTask } from '../../../shared/stack.DJaKVY7v.cjs';
3
3
  import '@btst/stack/plugins/api';
4
4
  import '@btst/db';
@@ -1,4 +1,4 @@
1
- export { B as BoardListResult, C as CreateKanbanTaskInput, i as KANBAN_QUERY_KEYS, b as KanbanApiContext, K as KanbanApiRouter, c as KanbanBackendHooks, a as KanbanRouteKey, e as createKanbanTask, f as findOrCreateKanbanBoard, g as getAllBoards, d as getBoardById, h as getKanbanColumnsByBoardId, k as kanbanBackendPlugin } from '../../../shared/stack.HE_IvqV5.mjs';
1
+ export { B as BoardListResult, C as CreateKanbanTaskInput, i as KANBAN_QUERY_KEYS, b as KanbanApiContext, K as KanbanApiRouter, c as KanbanBackendHooks, a as KanbanRouteKey, e as createKanbanTask, f as findOrCreateKanbanBoard, g as getAllBoards, d as getBoardById, h as getKanbanColumnsByBoardId, k as kanbanBackendPlugin } from '../../../shared/stack.Bzfx-_lq.mjs';
2
2
  import { B as BoardWithColumns, S as SerializedBoardWithColumns, C as ColumnWithTasks, a as SerializedColumn, T as Task, b as SerializedTask } from '../../../shared/stack.DJaKVY7v.mjs';
3
3
  import '@btst/stack/plugins/api';
4
4
  import '@btst/db';
@@ -1,4 +1,4 @@
1
- export { B as BoardListResult, C as CreateKanbanTaskInput, i as KANBAN_QUERY_KEYS, b as KanbanApiContext, K as KanbanApiRouter, c as KanbanBackendHooks, a as KanbanRouteKey, e as createKanbanTask, f as findOrCreateKanbanBoard, g as getAllBoards, d as getBoardById, h as getKanbanColumnsByBoardId, k as kanbanBackendPlugin } from '../../../shared/stack.D4Cea8II.js';
1
+ export { B as BoardListResult, C as CreateKanbanTaskInput, i as KANBAN_QUERY_KEYS, b as KanbanApiContext, K as KanbanApiRouter, c as KanbanBackendHooks, a as KanbanRouteKey, e as createKanbanTask, f as findOrCreateKanbanBoard, g as getAllBoards, d as getBoardById, h as getKanbanColumnsByBoardId, k as kanbanBackendPlugin } from '../../../shared/stack.j5SFLC1d.js';
2
2
  import { B as BoardWithColumns, S as SerializedBoardWithColumns, C as ColumnWithTasks, a as SerializedColumn, T as Task, b as SerializedTask } from '../../../shared/stack.DJaKVY7v.js';
3
3
  import '@btst/stack/plugins/api';
4
4
  import '@btst/db';
@@ -1,5 +1,5 @@
1
1
  import * as _tanstack_react_query from '@tanstack/react-query';
2
- import { K as KanbanApiRouter, j as BoardsListDiscriminator } from '../../shared/stack.Rtcvl8sS.cjs';
2
+ import { K as KanbanApiRouter, j as BoardsListDiscriminator } from '../../shared/stack.B6S3cgwN.cjs';
3
3
  import { createApiClient } from '@btst/stack/plugins/client';
4
4
  import { S as SerializedBoardWithColumns } from '../../shared/stack.DJaKVY7v.cjs';
5
5
  import '@btst/stack/plugins/api';
@@ -1,5 +1,5 @@
1
1
  import * as _tanstack_react_query from '@tanstack/react-query';
2
- import { K as KanbanApiRouter, j as BoardsListDiscriminator } from '../../shared/stack.HE_IvqV5.mjs';
2
+ import { K as KanbanApiRouter, j as BoardsListDiscriminator } from '../../shared/stack.Bzfx-_lq.mjs';
3
3
  import { createApiClient } from '@btst/stack/plugins/client';
4
4
  import { S as SerializedBoardWithColumns } from '../../shared/stack.DJaKVY7v.mjs';
5
5
  import '@btst/stack/plugins/api';
@@ -1,5 +1,5 @@
1
1
  import * as _tanstack_react_query from '@tanstack/react-query';
2
- import { K as KanbanApiRouter, j as BoardsListDiscriminator } from '../../shared/stack.D4Cea8II.js';
2
+ import { K as KanbanApiRouter, j as BoardsListDiscriminator } from '../../shared/stack.j5SFLC1d.js';
3
3
  import { createApiClient } from '@btst/stack/plugins/client';
4
4
  import { S as SerializedBoardWithColumns } from '../../shared/stack.DJaKVY7v.js';
5
5
  import '@btst/stack/plugins/api';
@@ -6,7 +6,7 @@ import * as _btst_stack_plugins_api from '@btst/stack/plugins/api';
6
6
  import { DBAdapter } from '@btst/db';
7
7
  import * as better_call from 'better-call';
8
8
  import { z } from 'zod';
9
- import { c as createPostSchema, u as updatePostSchema } from './stack.CuhcFsAx.cjs';
9
+ import { c as createPostSchema, u as updatePostSchema } from './stack.DuQOcInS.cjs';
10
10
 
11
11
  /**
12
12
  * Parameters for filtering/paginating posts.
@@ -325,11 +325,11 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
325
325
  slug: string;
326
326
  })[] | undefined;
327
327
  slug?: string | undefined;
328
- published?: boolean | undefined;
329
- publishedAt?: unknown;
330
328
  createdAt?: unknown;
331
329
  updatedAt?: unknown;
330
+ publishedAt?: unknown;
332
331
  image?: string | undefined;
332
+ published?: boolean | undefined;
333
333
  }, {
334
334
  title: string;
335
335
  content: string;
@@ -342,11 +342,11 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
342
342
  slug: string;
343
343
  })[] | undefined;
344
344
  slug?: string | undefined;
345
- published?: boolean | undefined;
346
- publishedAt?: unknown;
347
345
  createdAt?: unknown;
348
346
  updatedAt?: unknown;
347
+ publishedAt?: unknown;
349
348
  image?: string | undefined;
349
+ published?: boolean | undefined;
350
350
  }>;
351
351
  }, Post>;
352
352
  readonly updatePost: better_call.StrictEndpoint<"/posts/:id", {} & {
@@ -1,5 +1,5 @@
1
1
  import * as _btst_stack_plugins_api from '@btst/stack/plugins/api';
2
- import { d as Comment, S as SerializedComment, C as CommentListResult } from './stack.C-b3Sn8j.js';
2
+ import { d as Comment, S as SerializedComment, C as CommentListResult } from './stack.C7KNNiJm.js';
3
3
  import * as better_call from 'better-call';
4
4
  import { z } from 'zod';
5
5
 
@@ -1,7 +1,7 @@
1
1
  import * as _tanstack_react_query from '@tanstack/react-query';
2
2
  import { S as SerializedPost, a as SerializedTag } from './stack.Dsatjh0B.cjs';
3
3
  import { z } from 'zod';
4
- import { c as createPostSchema, u as updatePostSchema } from './stack.CuhcFsAx.cjs';
4
+ import { c as createPostSchema, u as updatePostSchema } from './stack.DuQOcInS.cjs';
5
5
 
6
6
  /**
7
7
  * Options for the usePosts hook
@@ -136,14 +136,14 @@ declare function useCreatePost(): _tanstack_react_query.UseMutationResult<Serial
136
136
  name: string;
137
137
  slug: string;
138
138
  })[];
139
- published: boolean;
140
139
  title: string;
141
140
  content: string;
142
141
  excerpt: string;
142
+ published: boolean;
143
143
  slug?: string | undefined;
144
- publishedAt?: Date | undefined;
145
144
  createdAt?: Date | undefined;
146
145
  updatedAt?: Date | undefined;
146
+ publishedAt?: Date | undefined;
147
147
  image?: string | undefined;
148
148
  }, unknown>;
149
149
  /** Update an existing post by id */
@@ -90,6 +90,7 @@ interface CommentsThreadDiscriminator {
90
90
  parentId: string | null | undefined;
91
91
  status: string | undefined;
92
92
  currentUserId: string | undefined;
93
+ sort: string | undefined;
93
94
  limit: number;
94
95
  }
95
96
  /** Full query key builders — use with queryClient.setQueryData() */
@@ -125,7 +126,7 @@ declare const COMMENTS_QUERY_KEYS: {
125
126
  }) => readonly ["comments", "count", CommentCountDiscriminator];
126
127
  /**
127
128
  * Key for the infinite thread query (top-level comments, load-more).
128
- * Full key: ["commentsThread", "list", { resourceId, resourceType, parentId, status, currentUserId, limit }]
129
+ * Full key: ["commentsThread", "list", { resourceId, resourceType, parentId, status, currentUserId, sort, limit }]
129
130
  * Offset is excluded — it is driven by `pageParam`, not baked into the key.
130
131
  */
131
132
  commentsThread: (params?: {
@@ -134,6 +135,7 @@ declare const COMMENTS_QUERY_KEYS: {
134
135
  parentId?: string | null;
135
136
  status?: string;
136
137
  currentUserId?: string;
138
+ sort?: string;
137
139
  limit?: number;
138
140
  }) => readonly ["commentsThread", "list", CommentsThreadDiscriminator];
139
141
  };
@@ -90,6 +90,7 @@ interface CommentsThreadDiscriminator {
90
90
  parentId: string | null | undefined;
91
91
  status: string | undefined;
92
92
  currentUserId: string | undefined;
93
+ sort: string | undefined;
93
94
  limit: number;
94
95
  }
95
96
  /** Full query key builders — use with queryClient.setQueryData() */
@@ -125,7 +126,7 @@ declare const COMMENTS_QUERY_KEYS: {
125
126
  }) => readonly ["comments", "count", CommentCountDiscriminator];
126
127
  /**
127
128
  * Key for the infinite thread query (top-level comments, load-more).
128
- * Full key: ["commentsThread", "list", { resourceId, resourceType, parentId, status, currentUserId, limit }]
129
+ * Full key: ["commentsThread", "list", { resourceId, resourceType, parentId, status, currentUserId, sort, limit }]
129
130
  * Offset is excluded — it is driven by `pageParam`, not baked into the key.
130
131
  */
131
132
  commentsThread: (params?: {
@@ -134,6 +135,7 @@ declare const COMMENTS_QUERY_KEYS: {
134
135
  parentId?: string | null;
135
136
  status?: string;
136
137
  currentUserId?: string;
138
+ sort?: string;
137
139
  limit?: number;
138
140
  }) => readonly ["commentsThread", "list", CommentsThreadDiscriminator];
139
141
  };
@@ -90,6 +90,7 @@ interface CommentsThreadDiscriminator {
90
90
  parentId: string | null | undefined;
91
91
  status: string | undefined;
92
92
  currentUserId: string | undefined;
93
+ sort: string | undefined;
93
94
  limit: number;
94
95
  }
95
96
  /** Full query key builders — use with queryClient.setQueryData() */
@@ -125,7 +126,7 @@ declare const COMMENTS_QUERY_KEYS: {
125
126
  }) => readonly ["comments", "count", CommentCountDiscriminator];
126
127
  /**
127
128
  * Key for the infinite thread query (top-level comments, load-more).
128
- * Full key: ["commentsThread", "list", { resourceId, resourceType, parentId, status, currentUserId, limit }]
129
+ * Full key: ["commentsThread", "list", { resourceId, resourceType, parentId, status, currentUserId, sort, limit }]
129
130
  * Offset is excluded — it is driven by `pageParam`, not baked into the key.
130
131
  */
131
132
  commentsThread: (params?: {
@@ -134,6 +135,7 @@ declare const COMMENTS_QUERY_KEYS: {
134
135
  parentId?: string | null;
135
136
  status?: string;
136
137
  currentUserId?: string;
138
+ sort?: string;
137
139
  limit?: number;
138
140
  }) => readonly ["commentsThread", "list", CommentsThreadDiscriminator];
139
141
  };
@@ -1,5 +1,5 @@
1
1
  import * as _btst_stack_plugins_api from '@btst/stack/plugins/api';
2
- import { d as Comment, S as SerializedComment, C as CommentListResult } from './stack.C-b3Sn8j.mjs';
2
+ import { d as Comment, S as SerializedComment, C as CommentListResult } from './stack.C7KNNiJm.cjs';
3
3
  import * as better_call from 'better-call';
4
4
  import { z } from 'zod';
5
5
 
@@ -1,5 +1,5 @@
1
1
  import * as _btst_stack_plugins_api from '@btst/stack/plugins/api';
2
- import { d as Comment, S as SerializedComment, C as CommentListResult } from './stack.C-b3Sn8j.cjs';
2
+ import { d as Comment, S as SerializedComment, C as CommentListResult } from './stack.C7KNNiJm.mjs';
3
3
  import * as better_call from 'better-call';
4
4
  import { z } from 'zod';
5
5
 
@@ -1,7 +1,7 @@
1
1
  import * as _tanstack_react_query from '@tanstack/react-query';
2
2
  import { S as SerializedPost, a as SerializedTag } from './stack.Dsatjh0B.mjs';
3
3
  import { z } from 'zod';
4
- import { c as createPostSchema, u as updatePostSchema } from './stack.CuhcFsAx.mjs';
4
+ import { c as createPostSchema, u as updatePostSchema } from './stack.DuQOcInS.mjs';
5
5
 
6
6
  /**
7
7
  * Options for the usePosts hook
@@ -136,14 +136,14 @@ declare function useCreatePost(): _tanstack_react_query.UseMutationResult<Serial
136
136
  name: string;
137
137
  slug: string;
138
138
  })[];
139
- published: boolean;
140
139
  title: string;
141
140
  content: string;
142
141
  excerpt: string;
142
+ published: boolean;
143
143
  slug?: string | undefined;
144
- publishedAt?: Date | undefined;
145
144
  createdAt?: Date | undefined;
146
145
  updatedAt?: Date | undefined;
146
+ publishedAt?: Date | undefined;
147
147
  image?: string | undefined;
148
148
  }, unknown>;
149
149
  /** Update an existing post by id */
@@ -6,7 +6,7 @@ import * as _btst_stack_plugins_api from '@btst/stack/plugins/api';
6
6
  import { DBAdapter } from '@btst/db';
7
7
  import * as better_call from 'better-call';
8
8
  import { z } from 'zod';
9
- import { c as createPostSchema, u as updatePostSchema } from './stack.CuhcFsAx.js';
9
+ import { c as createPostSchema, u as updatePostSchema } from './stack.DuQOcInS.js';
10
10
 
11
11
  /**
12
12
  * Parameters for filtering/paginating posts.
@@ -325,11 +325,11 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
325
325
  slug: string;
326
326
  })[] | undefined;
327
327
  slug?: string | undefined;
328
- published?: boolean | undefined;
329
- publishedAt?: unknown;
330
328
  createdAt?: unknown;
331
329
  updatedAt?: unknown;
330
+ publishedAt?: unknown;
332
331
  image?: string | undefined;
332
+ published?: boolean | undefined;
333
333
  }, {
334
334
  title: string;
335
335
  content: string;
@@ -342,11 +342,11 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
342
342
  slug: string;
343
343
  })[] | undefined;
344
344
  slug?: string | undefined;
345
- published?: boolean | undefined;
346
- publishedAt?: unknown;
347
345
  createdAt?: unknown;
348
346
  updatedAt?: unknown;
347
+ publishedAt?: unknown;
349
348
  image?: string | undefined;
349
+ published?: boolean | undefined;
350
350
  }>;
351
351
  }, Post>;
352
352
  readonly updatePost: better_call.StrictEndpoint<"/posts/:id", {} & {
@@ -1,7 +1,7 @@
1
1
  import * as _tanstack_react_query from '@tanstack/react-query';
2
2
  import { S as SerializedPost, a as SerializedTag } from './stack.Dsatjh0B.js';
3
3
  import { z } from 'zod';
4
- import { c as createPostSchema, u as updatePostSchema } from './stack.CuhcFsAx.js';
4
+ import { c as createPostSchema, u as updatePostSchema } from './stack.DuQOcInS.js';
5
5
 
6
6
  /**
7
7
  * Options for the usePosts hook
@@ -136,14 +136,14 @@ declare function useCreatePost(): _tanstack_react_query.UseMutationResult<Serial
136
136
  name: string;
137
137
  slug: string;
138
138
  })[];
139
- published: boolean;
140
139
  title: string;
141
140
  content: string;
142
141
  excerpt: string;
142
+ published: boolean;
143
143
  slug?: string | undefined;
144
- publishedAt?: Date | undefined;
145
144
  createdAt?: Date | undefined;
146
145
  updatedAt?: Date | undefined;
146
+ publishedAt?: Date | undefined;
147
147
  image?: string | undefined;
148
148
  }, unknown>;
149
149
  /** Update an existing post by id */