@btst/stack 1.11.0 → 1.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 (163) hide show
  1. package/dist/node_modules/.pnpm/@dnd-kit_core@6.3.1_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@dnd-kit/core/dist/core.esm.cjs +1 -1
  2. package/dist/node_modules/.pnpm/@dnd-kit_core@6.3.1_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@dnd-kit/core/dist/core.esm.mjs +1 -1
  3. package/dist/node_modules/.pnpm/@dnd-kit_sortable@10.0.0_@dnd-kit_core@6.3.1_react-dom@19.2.0_react@19.2.0__react@19.2.0__react@19.2.0/node_modules/@dnd-kit/sortable/dist/sortable.esm.cjs +77 -0
  4. package/dist/node_modules/.pnpm/@dnd-kit_sortable@10.0.0_@dnd-kit_core@6.3.1_react-dom@19.2.0_react@19.2.0__react@19.2.0__react@19.2.0/node_modules/@dnd-kit/sortable/dist/sortable.esm.mjs +79 -3
  5. package/dist/node_modules/.pnpm/@radix-ui_react-avatar@1.1.11_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react_850cfbef1935a6e49a6ad6c93c7ca70d/node_modules/@radix-ui/react-avatar/dist/index.cjs +140 -0
  6. package/dist/node_modules/.pnpm/@radix-ui_react-avatar@1.1.11_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react_850cfbef1935a6e49a6ad6c93c7ca70d/node_modules/@radix-ui/react-avatar/dist/index.mjs +119 -0
  7. package/dist/node_modules/.pnpm/@radix-ui_react-context@1.1.3_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-context/dist/index.cjs +80 -0
  8. package/dist/node_modules/.pnpm/@radix-ui_react-context@1.1.3_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-context/dist/index.mjs +64 -0
  9. package/dist/node_modules/.pnpm/@radix-ui_react-use-is-hydrated@0.1.0_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-use-is-hydrated/dist/index.cjs +18 -0
  10. package/dist/node_modules/.pnpm/@radix-ui_react-use-is-hydrated@0.1.0_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-use-is-hydrated/dist/index.mjs +16 -0
  11. package/dist/packages/better-stack/src/plugins/kanban/api/plugin.cjs +846 -0
  12. package/dist/packages/better-stack/src/plugins/kanban/api/plugin.mjs +844 -0
  13. package/dist/packages/better-stack/src/plugins/kanban/client/components/forms/board-form.cjs +85 -0
  14. package/dist/packages/better-stack/src/plugins/kanban/client/components/forms/board-form.mjs +83 -0
  15. package/dist/packages/better-stack/src/plugins/kanban/client/components/forms/column-form.cjs +72 -0
  16. package/dist/packages/better-stack/src/plugins/kanban/client/components/forms/column-form.mjs +70 -0
  17. package/dist/packages/better-stack/src/plugins/kanban/client/components/forms/task-form.cjs +200 -0
  18. package/dist/packages/better-stack/src/plugins/kanban/client/components/forms/task-form.mjs +198 -0
  19. package/dist/packages/better-stack/src/plugins/kanban/client/components/loading/board-skeleton.cjs +47 -0
  20. package/dist/packages/better-stack/src/plugins/kanban/client/components/loading/board-skeleton.mjs +45 -0
  21. package/dist/packages/better-stack/src/plugins/kanban/client/components/loading/boards-list-skeleton.cjs +30 -0
  22. package/dist/packages/better-stack/src/plugins/kanban/client/components/loading/boards-list-skeleton.mjs +28 -0
  23. package/dist/packages/better-stack/src/plugins/kanban/client/components/pages/404-page.cjs +27 -0
  24. package/dist/packages/better-stack/src/plugins/kanban/client/components/pages/404-page.mjs +25 -0
  25. package/dist/packages/better-stack/src/plugins/kanban/client/components/pages/board-page.cjs +31 -0
  26. package/dist/packages/better-stack/src/plugins/kanban/client/components/pages/board-page.internal.cjs +458 -0
  27. package/dist/packages/better-stack/src/plugins/kanban/client/components/pages/board-page.internal.mjs +456 -0
  28. package/dist/packages/better-stack/src/plugins/kanban/client/components/pages/board-page.mjs +29 -0
  29. package/dist/packages/better-stack/src/plugins/kanban/client/components/pages/boards-list-page.cjs +30 -0
  30. package/dist/packages/better-stack/src/plugins/kanban/client/components/pages/boards-list-page.internal.cjs +72 -0
  31. package/dist/packages/better-stack/src/plugins/kanban/client/components/pages/boards-list-page.internal.mjs +70 -0
  32. package/dist/packages/better-stack/src/plugins/kanban/client/components/pages/boards-list-page.mjs +28 -0
  33. package/dist/packages/better-stack/src/plugins/kanban/client/components/pages/new-board-page.cjs +30 -0
  34. package/dist/packages/better-stack/src/plugins/kanban/client/components/pages/new-board-page.internal.cjs +51 -0
  35. package/dist/packages/better-stack/src/plugins/kanban/client/components/pages/new-board-page.internal.mjs +49 -0
  36. package/dist/packages/better-stack/src/plugins/kanban/client/components/pages/new-board-page.mjs +28 -0
  37. package/dist/packages/better-stack/src/plugins/kanban/client/components/shared/column-content.cjs +76 -0
  38. package/dist/packages/better-stack/src/plugins/kanban/client/components/shared/column-content.mjs +74 -0
  39. package/dist/packages/better-stack/src/plugins/kanban/client/components/shared/default-error.cjs +27 -0
  40. package/dist/packages/better-stack/src/plugins/kanban/client/components/shared/default-error.mjs +25 -0
  41. package/dist/packages/better-stack/src/plugins/kanban/client/components/shared/empty-state.cjs +32 -0
  42. package/dist/packages/better-stack/src/plugins/kanban/client/components/shared/empty-state.mjs +30 -0
  43. package/dist/packages/better-stack/src/plugins/kanban/client/components/shared/kanban-board.cjs +78 -0
  44. package/dist/packages/better-stack/src/plugins/kanban/client/components/shared/kanban-board.mjs +76 -0
  45. package/dist/packages/better-stack/src/plugins/kanban/client/components/shared/page-wrapper.cjs +15 -0
  46. package/dist/packages/better-stack/src/plugins/kanban/client/components/shared/page-wrapper.mjs +13 -0
  47. package/dist/packages/better-stack/src/plugins/kanban/client/components/shared/task-card.cjs +68 -0
  48. package/dist/packages/better-stack/src/plugins/kanban/client/components/shared/task-card.mjs +66 -0
  49. package/dist/packages/better-stack/src/plugins/kanban/client/components/shared/user-avatar.cjs +32 -0
  50. package/dist/packages/better-stack/src/plugins/kanban/client/components/shared/user-avatar.mjs +30 -0
  51. package/dist/packages/better-stack/src/plugins/kanban/client/hooks/kanban-hooks.cjs +391 -0
  52. package/dist/packages/better-stack/src/plugins/kanban/client/hooks/kanban-hooks.mjs +381 -0
  53. package/dist/packages/better-stack/src/plugins/kanban/client/plugin.cjs +290 -0
  54. package/dist/packages/better-stack/src/plugins/kanban/client/plugin.mjs +288 -0
  55. package/dist/packages/better-stack/src/plugins/kanban/db.cjs +125 -0
  56. package/dist/packages/better-stack/src/plugins/kanban/db.mjs +123 -0
  57. package/dist/packages/better-stack/src/plugins/kanban/schemas.cjs +117 -0
  58. package/dist/packages/better-stack/src/plugins/kanban/schemas.mjs +102 -0
  59. package/dist/packages/better-stack/src/plugins/kanban/utils.cjs +49 -0
  60. package/dist/packages/better-stack/src/plugins/kanban/utils.mjs +45 -0
  61. package/dist/packages/ui/src/components/avatar.cjs +58 -0
  62. package/dist/packages/ui/src/components/avatar.mjs +54 -0
  63. package/dist/packages/ui/src/components/command.cjs +3 -3
  64. package/dist/packages/ui/src/components/command.mjs +3 -3
  65. package/dist/packages/ui/src/components/form-builder/index.mjs +2 -2
  66. package/dist/packages/ui/src/components/kanban.cjs +835 -0
  67. package/dist/packages/ui/src/components/kanban.mjs +805 -0
  68. package/dist/packages/ui/src/components/popover.cjs +8 -3
  69. package/dist/packages/ui/src/components/popover.mjs +9 -4
  70. package/dist/packages/ui/src/components/search-select.cjs +75 -0
  71. package/dist/packages/ui/src/components/search-select.mjs +73 -0
  72. package/dist/packages/ui/src/lib/compose-refs.cjs +56 -0
  73. package/dist/packages/ui/src/lib/compose-refs.mjs +39 -0
  74. package/dist/plugins/blog/api/index.d.cts +1 -1
  75. package/dist/plugins/blog/api/index.d.mts +1 -1
  76. package/dist/plugins/blog/api/index.d.ts +1 -1
  77. package/dist/plugins/blog/client/hooks/index.d.cts +2 -2
  78. package/dist/plugins/blog/client/hooks/index.d.mts +2 -2
  79. package/dist/plugins/blog/client/hooks/index.d.ts +2 -2
  80. package/dist/plugins/blog/client/index.d.cts +1 -1
  81. package/dist/plugins/blog/client/index.d.mts +1 -1
  82. package/dist/plugins/blog/client/index.d.ts +1 -1
  83. package/dist/plugins/blog/query-keys.d.cts +2 -2
  84. package/dist/plugins/blog/query-keys.d.mts +2 -2
  85. package/dist/plugins/blog/query-keys.d.ts +2 -2
  86. package/dist/plugins/kanban/api/index.cjs +7 -0
  87. package/dist/plugins/kanban/api/index.d.cts +403 -0
  88. package/dist/plugins/kanban/api/index.d.mts +403 -0
  89. package/dist/plugins/kanban/api/index.d.ts +403 -0
  90. package/dist/plugins/kanban/api/index.mjs +1 -0
  91. package/dist/plugins/kanban/client/components/index.cjs +35 -0
  92. package/dist/plugins/kanban/client/components/index.d.cts +102 -0
  93. package/dist/plugins/kanban/client/components/index.d.mts +102 -0
  94. package/dist/plugins/kanban/client/components/index.d.ts +102 -0
  95. package/dist/plugins/kanban/client/components/index.mjs +15 -0
  96. package/dist/plugins/kanban/client/hooks/index.cjs +15 -0
  97. package/dist/plugins/kanban/client/hooks/index.d.cts +143 -0
  98. package/dist/plugins/kanban/client/hooks/index.d.mts +143 -0
  99. package/dist/plugins/kanban/client/hooks/index.d.ts +143 -0
  100. package/dist/plugins/kanban/client/hooks/index.mjs +1 -0
  101. package/dist/plugins/kanban/client/index.cjs +7 -0
  102. package/dist/plugins/kanban/client/index.d.cts +196 -0
  103. package/dist/plugins/kanban/client/index.d.mts +196 -0
  104. package/dist/plugins/kanban/client/index.d.ts +196 -0
  105. package/dist/plugins/kanban/client/index.mjs +1 -0
  106. package/dist/plugins/kanban/client.css +68 -0
  107. package/dist/plugins/kanban/query-keys.cjs +105 -0
  108. package/dist/plugins/kanban/query-keys.d.cts +59 -0
  109. package/dist/plugins/kanban/query-keys.d.mts +59 -0
  110. package/dist/plugins/kanban/query-keys.d.ts +59 -0
  111. package/dist/plugins/kanban/query-keys.mjs +103 -0
  112. package/dist/plugins/kanban/style.css +7 -0
  113. package/dist/plugins/ui-builder/style.css +6 -0
  114. package/dist/shared/stack.DKDMI-QO.d.cts +70 -0
  115. package/dist/shared/stack.DKDMI-QO.d.mts +70 -0
  116. package/dist/shared/stack.DKDMI-QO.d.ts +70 -0
  117. package/dist/shared/stack.FeaWkglm.d.cts +190 -0
  118. package/dist/shared/stack.FeaWkglm.d.mts +190 -0
  119. package/dist/shared/stack.FeaWkglm.d.ts +190 -0
  120. package/package.json +56 -2
  121. package/src/plugins/kanban/api/index.ts +6 -0
  122. package/src/plugins/kanban/api/plugin.ts +1245 -0
  123. package/src/plugins/kanban/client/components/forms/board-form.tsx +108 -0
  124. package/src/plugins/kanban/client/components/forms/column-form.tsx +97 -0
  125. package/src/plugins/kanban/client/components/forms/task-form.tsx +274 -0
  126. package/src/plugins/kanban/client/components/index.tsx +21 -0
  127. package/src/plugins/kanban/client/components/loading/board-skeleton.tsx +49 -0
  128. package/src/plugins/kanban/client/components/loading/boards-list-skeleton.tsx +34 -0
  129. package/src/plugins/kanban/client/components/loading/index.tsx +2 -0
  130. package/src/plugins/kanban/client/components/pages/404-page.tsx +28 -0
  131. package/src/plugins/kanban/client/components/pages/board-page.internal.tsx +575 -0
  132. package/src/plugins/kanban/client/components/pages/board-page.tsx +31 -0
  133. package/src/plugins/kanban/client/components/pages/boards-list-page.internal.tsx +101 -0
  134. package/src/plugins/kanban/client/components/pages/boards-list-page.tsx +26 -0
  135. package/src/plugins/kanban/client/components/pages/new-board-page.internal.tsx +65 -0
  136. package/src/plugins/kanban/client/components/pages/new-board-page.tsx +26 -0
  137. package/src/plugins/kanban/client/components/shared/column-content.tsx +108 -0
  138. package/src/plugins/kanban/client/components/shared/default-error.tsx +32 -0
  139. package/src/plugins/kanban/client/components/shared/empty-state.tsx +37 -0
  140. package/src/plugins/kanban/client/components/shared/kanban-board.tsx +87 -0
  141. package/src/plugins/kanban/client/components/shared/page-wrapper.tsx +20 -0
  142. package/src/plugins/kanban/client/components/shared/task-card.tsx +79 -0
  143. package/src/plugins/kanban/client/components/shared/user-avatar.tsx +63 -0
  144. package/src/plugins/kanban/client/hooks/index.tsx +11 -0
  145. package/src/plugins/kanban/client/hooks/kanban-hooks.tsx +560 -0
  146. package/src/plugins/kanban/client/index.ts +8 -0
  147. package/src/plugins/kanban/client/localization/index.ts +28 -0
  148. package/src/plugins/kanban/client/localization/kanban-common.ts +69 -0
  149. package/src/plugins/kanban/client/localization/kanban-forms.ts +70 -0
  150. package/src/plugins/kanban/client/localization/kanban-list.ts +36 -0
  151. package/src/plugins/kanban/client/overrides.ts +145 -0
  152. package/src/plugins/kanban/client/plugin.tsx +463 -0
  153. package/src/plugins/kanban/client.css +68 -0
  154. package/src/plugins/kanban/db.ts +125 -0
  155. package/src/plugins/kanban/query-keys.ts +154 -0
  156. package/src/plugins/kanban/schemas.ts +143 -0
  157. package/src/plugins/kanban/style.css +7 -0
  158. package/src/plugins/kanban/types.ts +106 -0
  159. package/src/plugins/kanban/utils.ts +107 -0
  160. package/src/plugins/ui-builder/style.css +6 -0
  161. package/dist/shared/{stack.DLhzx1-D.d.cts → stack.CcI4sYJP.d.cts} +1 -1
  162. package/dist/shared/{stack.DLhzx1-D.d.mts → stack.CcI4sYJP.d.mts} +1 -1
  163. package/dist/shared/{stack.DLhzx1-D.d.ts → stack.CcI4sYJP.d.ts} +1 -1
@@ -0,0 +1,105 @@
1
+ 'use strict';
2
+
3
+ const queryKeyFactory = require('@lukemorales/query-key-factory');
4
+
5
+ function isErrorResponse(response) {
6
+ return typeof response === "object" && response !== null && "error" in response && response.error !== null && response.error !== void 0;
7
+ }
8
+ function toError(error) {
9
+ if (error instanceof Error) {
10
+ return error;
11
+ }
12
+ if (typeof error === "object" && error !== null) {
13
+ const errorObj = error;
14
+ const message = (typeof errorObj.message === "string" ? errorObj.message : null) || (typeof errorObj.error === "string" ? errorObj.error : null) || JSON.stringify(error);
15
+ const err = new Error(message);
16
+ Object.assign(err, error);
17
+ return err;
18
+ }
19
+ return new Error(String(error));
20
+ }
21
+ function createKanbanQueryKeys(client, headers) {
22
+ const boards = createBoardsQueries(client, headers);
23
+ return queryKeyFactory.mergeQueryKeys(boards);
24
+ }
25
+ function createBoardsQueries(client, headers) {
26
+ return queryKeyFactory.createQueryKeys("boards", {
27
+ list: (params) => ({
28
+ queryKey: [
29
+ {
30
+ slug: params?.slug,
31
+ ownerId: params?.ownerId,
32
+ organizationId: params?.organizationId,
33
+ limit: params?.limit ?? 50,
34
+ offset: params?.offset ?? 0
35
+ }
36
+ ],
37
+ queryFn: async () => {
38
+ try {
39
+ const response = await client("/boards", {
40
+ method: "GET",
41
+ query: {
42
+ slug: params?.slug,
43
+ ownerId: params?.ownerId,
44
+ organizationId: params?.organizationId,
45
+ limit: params?.limit ?? 50,
46
+ offset: params?.offset ?? 0
47
+ },
48
+ headers
49
+ });
50
+ if (isErrorResponse(response)) {
51
+ const errorResponse = response;
52
+ throw toError(errorResponse.error);
53
+ }
54
+ return response.data ?? [];
55
+ } catch (error) {
56
+ throw error;
57
+ }
58
+ }
59
+ }),
60
+ detail: (boardId) => ({
61
+ queryKey: [boardId],
62
+ queryFn: async () => {
63
+ if (!boardId) return null;
64
+ try {
65
+ const response = await client("/boards/:id", {
66
+ method: "GET",
67
+ params: { id: boardId },
68
+ headers
69
+ });
70
+ if (isErrorResponse(response)) {
71
+ const errorResponse = response;
72
+ throw toError(errorResponse.error);
73
+ }
74
+ return response.data ?? null;
75
+ } catch (error) {
76
+ throw error;
77
+ }
78
+ }
79
+ }),
80
+ // Get board by slug
81
+ bySlug: (slug) => ({
82
+ queryKey: ["slug", slug],
83
+ queryFn: async () => {
84
+ if (!slug) return null;
85
+ try {
86
+ const response = await client("/boards", {
87
+ method: "GET",
88
+ query: { slug, limit: 1 },
89
+ headers
90
+ });
91
+ if (isErrorResponse(response)) {
92
+ const errorResponse = response;
93
+ throw toError(errorResponse.error);
94
+ }
95
+ const boards = response.data ?? [];
96
+ return boards[0] ?? null;
97
+ } catch (error) {
98
+ throw error;
99
+ }
100
+ }
101
+ })
102
+ });
103
+ }
104
+
105
+ exports.createKanbanQueryKeys = createKanbanQueryKeys;
@@ -0,0 +1,59 @@
1
+ import * as _tanstack_react_query from '@tanstack/react-query';
2
+ import { createApiClient } from '@btst/stack/plugins/client';
3
+ import { S as SerializedBoardWithColumns } from '../../shared/stack.DKDMI-QO.cjs';
4
+ import { KanbanApiRouter } from './api/index.cjs';
5
+ import '@btst/stack/plugins/api';
6
+ import 'better-call';
7
+ import 'zod';
8
+
9
+ interface BoardsListParams {
10
+ slug?: string;
11
+ ownerId?: string;
12
+ organizationId?: string;
13
+ limit?: number;
14
+ offset?: number;
15
+ }
16
+ declare function createKanbanQueryKeys(client: ReturnType<typeof createApiClient<KanbanApiRouter>>, headers?: HeadersInit): {
17
+ boards: {
18
+ _def: readonly ["boards"];
19
+ } & {
20
+ list: ((params?: BoardsListParams | undefined) => Omit<{
21
+ queryKey: readonly ["boards", "list", {
22
+ slug: string | undefined;
23
+ ownerId: string | undefined;
24
+ organizationId: string | undefined;
25
+ limit: number;
26
+ offset: number;
27
+ }];
28
+ queryFn: _tanstack_react_query.QueryFunction<SerializedBoardWithColumns[], readonly ["boards", "list", {
29
+ slug: string | undefined;
30
+ ownerId: string | undefined;
31
+ organizationId: string | undefined;
32
+ limit: number;
33
+ offset: number;
34
+ }]>;
35
+ } & {
36
+ _def: readonly ["boards", "list"];
37
+ }, "_def">) & {
38
+ _def: readonly ["boards", "list"];
39
+ };
40
+ detail: ((boardId: string) => Omit<{
41
+ queryKey: readonly ["boards", "detail", string];
42
+ queryFn: _tanstack_react_query.QueryFunction<SerializedBoardWithColumns | null, readonly ["boards", "detail", string]>;
43
+ } & {
44
+ _def: readonly ["boards", "detail"];
45
+ }, "_def">) & {
46
+ _def: readonly ["boards", "detail"];
47
+ };
48
+ bySlug: ((slug: string) => Omit<{
49
+ queryKey: readonly ["boards", "bySlug", string, string];
50
+ queryFn: _tanstack_react_query.QueryFunction<SerializedBoardWithColumns | null, readonly ["boards", "bySlug", string, string]>;
51
+ } & {
52
+ _def: readonly ["boards", "bySlug"];
53
+ }, "_def">) & {
54
+ _def: readonly ["boards", "bySlug"];
55
+ };
56
+ };
57
+ };
58
+
59
+ export { createKanbanQueryKeys };
@@ -0,0 +1,59 @@
1
+ import * as _tanstack_react_query from '@tanstack/react-query';
2
+ import { createApiClient } from '@btst/stack/plugins/client';
3
+ import { S as SerializedBoardWithColumns } from '../../shared/stack.DKDMI-QO.mjs';
4
+ import { KanbanApiRouter } from './api/index.mjs';
5
+ import '@btst/stack/plugins/api';
6
+ import 'better-call';
7
+ import 'zod';
8
+
9
+ interface BoardsListParams {
10
+ slug?: string;
11
+ ownerId?: string;
12
+ organizationId?: string;
13
+ limit?: number;
14
+ offset?: number;
15
+ }
16
+ declare function createKanbanQueryKeys(client: ReturnType<typeof createApiClient<KanbanApiRouter>>, headers?: HeadersInit): {
17
+ boards: {
18
+ _def: readonly ["boards"];
19
+ } & {
20
+ list: ((params?: BoardsListParams | undefined) => Omit<{
21
+ queryKey: readonly ["boards", "list", {
22
+ slug: string | undefined;
23
+ ownerId: string | undefined;
24
+ organizationId: string | undefined;
25
+ limit: number;
26
+ offset: number;
27
+ }];
28
+ queryFn: _tanstack_react_query.QueryFunction<SerializedBoardWithColumns[], readonly ["boards", "list", {
29
+ slug: string | undefined;
30
+ ownerId: string | undefined;
31
+ organizationId: string | undefined;
32
+ limit: number;
33
+ offset: number;
34
+ }]>;
35
+ } & {
36
+ _def: readonly ["boards", "list"];
37
+ }, "_def">) & {
38
+ _def: readonly ["boards", "list"];
39
+ };
40
+ detail: ((boardId: string) => Omit<{
41
+ queryKey: readonly ["boards", "detail", string];
42
+ queryFn: _tanstack_react_query.QueryFunction<SerializedBoardWithColumns | null, readonly ["boards", "detail", string]>;
43
+ } & {
44
+ _def: readonly ["boards", "detail"];
45
+ }, "_def">) & {
46
+ _def: readonly ["boards", "detail"];
47
+ };
48
+ bySlug: ((slug: string) => Omit<{
49
+ queryKey: readonly ["boards", "bySlug", string, string];
50
+ queryFn: _tanstack_react_query.QueryFunction<SerializedBoardWithColumns | null, readonly ["boards", "bySlug", string, string]>;
51
+ } & {
52
+ _def: readonly ["boards", "bySlug"];
53
+ }, "_def">) & {
54
+ _def: readonly ["boards", "bySlug"];
55
+ };
56
+ };
57
+ };
58
+
59
+ export { createKanbanQueryKeys };
@@ -0,0 +1,59 @@
1
+ import * as _tanstack_react_query from '@tanstack/react-query';
2
+ import { createApiClient } from '@btst/stack/plugins/client';
3
+ import { S as SerializedBoardWithColumns } from '../../shared/stack.DKDMI-QO.js';
4
+ import { KanbanApiRouter } from './api/index.js';
5
+ import '@btst/stack/plugins/api';
6
+ import 'better-call';
7
+ import 'zod';
8
+
9
+ interface BoardsListParams {
10
+ slug?: string;
11
+ ownerId?: string;
12
+ organizationId?: string;
13
+ limit?: number;
14
+ offset?: number;
15
+ }
16
+ declare function createKanbanQueryKeys(client: ReturnType<typeof createApiClient<KanbanApiRouter>>, headers?: HeadersInit): {
17
+ boards: {
18
+ _def: readonly ["boards"];
19
+ } & {
20
+ list: ((params?: BoardsListParams | undefined) => Omit<{
21
+ queryKey: readonly ["boards", "list", {
22
+ slug: string | undefined;
23
+ ownerId: string | undefined;
24
+ organizationId: string | undefined;
25
+ limit: number;
26
+ offset: number;
27
+ }];
28
+ queryFn: _tanstack_react_query.QueryFunction<SerializedBoardWithColumns[], readonly ["boards", "list", {
29
+ slug: string | undefined;
30
+ ownerId: string | undefined;
31
+ organizationId: string | undefined;
32
+ limit: number;
33
+ offset: number;
34
+ }]>;
35
+ } & {
36
+ _def: readonly ["boards", "list"];
37
+ }, "_def">) & {
38
+ _def: readonly ["boards", "list"];
39
+ };
40
+ detail: ((boardId: string) => Omit<{
41
+ queryKey: readonly ["boards", "detail", string];
42
+ queryFn: _tanstack_react_query.QueryFunction<SerializedBoardWithColumns | null, readonly ["boards", "detail", string]>;
43
+ } & {
44
+ _def: readonly ["boards", "detail"];
45
+ }, "_def">) & {
46
+ _def: readonly ["boards", "detail"];
47
+ };
48
+ bySlug: ((slug: string) => Omit<{
49
+ queryKey: readonly ["boards", "bySlug", string, string];
50
+ queryFn: _tanstack_react_query.QueryFunction<SerializedBoardWithColumns | null, readonly ["boards", "bySlug", string, string]>;
51
+ } & {
52
+ _def: readonly ["boards", "bySlug"];
53
+ }, "_def">) & {
54
+ _def: readonly ["boards", "bySlug"];
55
+ };
56
+ };
57
+ };
58
+
59
+ export { createKanbanQueryKeys };
@@ -0,0 +1,103 @@
1
+ import { mergeQueryKeys, createQueryKeys } from '@lukemorales/query-key-factory';
2
+
3
+ function isErrorResponse(response) {
4
+ return typeof response === "object" && response !== null && "error" in response && response.error !== null && response.error !== void 0;
5
+ }
6
+ function toError(error) {
7
+ if (error instanceof Error) {
8
+ return error;
9
+ }
10
+ if (typeof error === "object" && error !== null) {
11
+ const errorObj = error;
12
+ const message = (typeof errorObj.message === "string" ? errorObj.message : null) || (typeof errorObj.error === "string" ? errorObj.error : null) || JSON.stringify(error);
13
+ const err = new Error(message);
14
+ Object.assign(err, error);
15
+ return err;
16
+ }
17
+ return new Error(String(error));
18
+ }
19
+ function createKanbanQueryKeys(client, headers) {
20
+ const boards = createBoardsQueries(client, headers);
21
+ return mergeQueryKeys(boards);
22
+ }
23
+ function createBoardsQueries(client, headers) {
24
+ return createQueryKeys("boards", {
25
+ list: (params) => ({
26
+ queryKey: [
27
+ {
28
+ slug: params?.slug,
29
+ ownerId: params?.ownerId,
30
+ organizationId: params?.organizationId,
31
+ limit: params?.limit ?? 50,
32
+ offset: params?.offset ?? 0
33
+ }
34
+ ],
35
+ queryFn: async () => {
36
+ try {
37
+ const response = await client("/boards", {
38
+ method: "GET",
39
+ query: {
40
+ slug: params?.slug,
41
+ ownerId: params?.ownerId,
42
+ organizationId: params?.organizationId,
43
+ limit: params?.limit ?? 50,
44
+ offset: params?.offset ?? 0
45
+ },
46
+ headers
47
+ });
48
+ if (isErrorResponse(response)) {
49
+ const errorResponse = response;
50
+ throw toError(errorResponse.error);
51
+ }
52
+ return response.data ?? [];
53
+ } catch (error) {
54
+ throw error;
55
+ }
56
+ }
57
+ }),
58
+ detail: (boardId) => ({
59
+ queryKey: [boardId],
60
+ queryFn: async () => {
61
+ if (!boardId) return null;
62
+ try {
63
+ const response = await client("/boards/:id", {
64
+ method: "GET",
65
+ params: { id: boardId },
66
+ headers
67
+ });
68
+ if (isErrorResponse(response)) {
69
+ const errorResponse = response;
70
+ throw toError(errorResponse.error);
71
+ }
72
+ return response.data ?? null;
73
+ } catch (error) {
74
+ throw error;
75
+ }
76
+ }
77
+ }),
78
+ // Get board by slug
79
+ bySlug: (slug) => ({
80
+ queryKey: ["slug", slug],
81
+ queryFn: async () => {
82
+ if (!slug) return null;
83
+ try {
84
+ const response = await client("/boards", {
85
+ method: "GET",
86
+ query: { slug, limit: 1 },
87
+ headers
88
+ });
89
+ if (isErrorResponse(response)) {
90
+ const errorResponse = response;
91
+ throw toError(errorResponse.error);
92
+ }
93
+ const boards = response.data ?? [];
94
+ return boards[0] ?? null;
95
+ } catch (error) {
96
+ throw error;
97
+ }
98
+ }
99
+ })
100
+ });
101
+ }
102
+
103
+ export { createKanbanQueryKeys };
@@ -0,0 +1,7 @@
1
+ /* Kanban Plugin Full Styles */
2
+ /* This file includes Tailwind directives for consumers who need the full stylesheet */
3
+
4
+ @import "./client.css";
5
+
6
+ /* Import minimal-tiptap styles for rich text editor in task forms */
7
+ @import "@workspace/ui/components/minimal-tiptap/styles.css";
@@ -1,5 +1,11 @@
1
1
  @import "./client.css";
2
2
 
3
+ /* Import minimal-tiptap styles for rich text editor in form field overrides */
4
+ @import "@workspace/ui/components/minimal-tiptap/styles.css";
5
+
6
+ /* Load Tailwind Typography plugin for prose classes used by Markdown component */
7
+ @plugin "@tailwindcss/typography";
8
+
3
9
  /*
4
10
  * UI Builder Plugin CSS - Includes Tailwind class scanning
5
11
  *
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Priority levels for tasks
3
+ */
4
+ type Priority = "LOW" | "MEDIUM" | "HIGH" | "URGENT";
5
+ /**
6
+ * Kanban Board
7
+ */
8
+ type Board = {
9
+ id: string;
10
+ name: string;
11
+ slug: string;
12
+ description?: string;
13
+ ownerId?: string;
14
+ organizationId?: string;
15
+ createdAt: Date;
16
+ updatedAt: Date;
17
+ };
18
+ /**
19
+ * Kanban Column
20
+ */
21
+ type Column = {
22
+ id: string;
23
+ title: string;
24
+ order: number;
25
+ boardId: string;
26
+ createdAt: Date;
27
+ updatedAt: Date;
28
+ };
29
+ /**
30
+ * Kanban Task
31
+ */
32
+ type Task = {
33
+ id: string;
34
+ title: string;
35
+ description?: string;
36
+ priority: Priority;
37
+ order: number;
38
+ columnId: string;
39
+ assigneeId?: string;
40
+ completedAt?: Date;
41
+ isArchived: boolean;
42
+ createdAt: Date;
43
+ updatedAt: Date;
44
+ };
45
+ /**
46
+ * Column with its tasks
47
+ */
48
+ type ColumnWithTasks = Column & {
49
+ tasks: Task[];
50
+ };
51
+ interface SerializedTask extends Omit<Task, "createdAt" | "updatedAt" | "completedAt"> {
52
+ completedAt?: string;
53
+ createdAt: string;
54
+ updatedAt: string;
55
+ }
56
+ interface SerializedColumn extends Omit<Column, "createdAt" | "updatedAt"> {
57
+ createdAt: string;
58
+ updatedAt: string;
59
+ tasks?: SerializedTask[];
60
+ }
61
+ interface SerializedBoard extends Omit<Board, "createdAt" | "updatedAt"> {
62
+ createdAt: string;
63
+ updatedAt: string;
64
+ columns?: SerializedColumn[];
65
+ }
66
+ interface SerializedBoardWithColumns extends SerializedBoard {
67
+ columns: SerializedColumn[];
68
+ }
69
+
70
+ export type { Board as B, Column as C, Priority as P, SerializedBoardWithColumns as S, Task as T, SerializedBoard as a, SerializedColumn as b, SerializedTask as c, ColumnWithTasks as d };
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Priority levels for tasks
3
+ */
4
+ type Priority = "LOW" | "MEDIUM" | "HIGH" | "URGENT";
5
+ /**
6
+ * Kanban Board
7
+ */
8
+ type Board = {
9
+ id: string;
10
+ name: string;
11
+ slug: string;
12
+ description?: string;
13
+ ownerId?: string;
14
+ organizationId?: string;
15
+ createdAt: Date;
16
+ updatedAt: Date;
17
+ };
18
+ /**
19
+ * Kanban Column
20
+ */
21
+ type Column = {
22
+ id: string;
23
+ title: string;
24
+ order: number;
25
+ boardId: string;
26
+ createdAt: Date;
27
+ updatedAt: Date;
28
+ };
29
+ /**
30
+ * Kanban Task
31
+ */
32
+ type Task = {
33
+ id: string;
34
+ title: string;
35
+ description?: string;
36
+ priority: Priority;
37
+ order: number;
38
+ columnId: string;
39
+ assigneeId?: string;
40
+ completedAt?: Date;
41
+ isArchived: boolean;
42
+ createdAt: Date;
43
+ updatedAt: Date;
44
+ };
45
+ /**
46
+ * Column with its tasks
47
+ */
48
+ type ColumnWithTasks = Column & {
49
+ tasks: Task[];
50
+ };
51
+ interface SerializedTask extends Omit<Task, "createdAt" | "updatedAt" | "completedAt"> {
52
+ completedAt?: string;
53
+ createdAt: string;
54
+ updatedAt: string;
55
+ }
56
+ interface SerializedColumn extends Omit<Column, "createdAt" | "updatedAt"> {
57
+ createdAt: string;
58
+ updatedAt: string;
59
+ tasks?: SerializedTask[];
60
+ }
61
+ interface SerializedBoard extends Omit<Board, "createdAt" | "updatedAt"> {
62
+ createdAt: string;
63
+ updatedAt: string;
64
+ columns?: SerializedColumn[];
65
+ }
66
+ interface SerializedBoardWithColumns extends SerializedBoard {
67
+ columns: SerializedColumn[];
68
+ }
69
+
70
+ export type { Board as B, Column as C, Priority as P, SerializedBoardWithColumns as S, Task as T, SerializedBoard as a, SerializedColumn as b, SerializedTask as c, ColumnWithTasks as d };
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Priority levels for tasks
3
+ */
4
+ type Priority = "LOW" | "MEDIUM" | "HIGH" | "URGENT";
5
+ /**
6
+ * Kanban Board
7
+ */
8
+ type Board = {
9
+ id: string;
10
+ name: string;
11
+ slug: string;
12
+ description?: string;
13
+ ownerId?: string;
14
+ organizationId?: string;
15
+ createdAt: Date;
16
+ updatedAt: Date;
17
+ };
18
+ /**
19
+ * Kanban Column
20
+ */
21
+ type Column = {
22
+ id: string;
23
+ title: string;
24
+ order: number;
25
+ boardId: string;
26
+ createdAt: Date;
27
+ updatedAt: Date;
28
+ };
29
+ /**
30
+ * Kanban Task
31
+ */
32
+ type Task = {
33
+ id: string;
34
+ title: string;
35
+ description?: string;
36
+ priority: Priority;
37
+ order: number;
38
+ columnId: string;
39
+ assigneeId?: string;
40
+ completedAt?: Date;
41
+ isArchived: boolean;
42
+ createdAt: Date;
43
+ updatedAt: Date;
44
+ };
45
+ /**
46
+ * Column with its tasks
47
+ */
48
+ type ColumnWithTasks = Column & {
49
+ tasks: Task[];
50
+ };
51
+ interface SerializedTask extends Omit<Task, "createdAt" | "updatedAt" | "completedAt"> {
52
+ completedAt?: string;
53
+ createdAt: string;
54
+ updatedAt: string;
55
+ }
56
+ interface SerializedColumn extends Omit<Column, "createdAt" | "updatedAt"> {
57
+ createdAt: string;
58
+ updatedAt: string;
59
+ tasks?: SerializedTask[];
60
+ }
61
+ interface SerializedBoard extends Omit<Board, "createdAt" | "updatedAt"> {
62
+ createdAt: string;
63
+ updatedAt: string;
64
+ columns?: SerializedColumn[];
65
+ }
66
+ interface SerializedBoardWithColumns extends SerializedBoard {
67
+ columns: SerializedColumn[];
68
+ }
69
+
70
+ export type { Board as B, Column as C, Priority as P, SerializedBoardWithColumns as S, Task as T, SerializedBoard as a, SerializedColumn as b, SerializedTask as c, ColumnWithTasks as d };