@btst/stack 3.1.2 → 4.1.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 (129) hide show
  1. package/README.md +2 -2
  2. package/dist/packages/stack/src/plugins/ai-chat/client/components/chat-input.cjs +112 -103
  3. package/dist/packages/stack/src/plugins/ai-chat/client/components/chat-input.mjs +112 -103
  4. package/dist/packages/stack/src/plugins/ai-chat/client/components/chat-interface.cjs +5 -2
  5. package/dist/packages/stack/src/plugins/ai-chat/client/components/chat-interface.mjs +5 -2
  6. package/dist/packages/stack/src/plugins/ai-chat/client/components/chat-layout.cjs +99 -88
  7. package/dist/packages/stack/src/plugins/ai-chat/client/components/chat-layout.mjs +99 -88
  8. package/dist/packages/stack/src/plugins/ai-chat/client/components/chat-message.cjs +12 -3
  9. package/dist/packages/stack/src/plugins/ai-chat/client/components/chat-message.mjs +12 -3
  10. package/dist/packages/stack/src/plugins/ai-chat/client/components/chat-sidebar.cjs +6 -2
  11. package/dist/packages/stack/src/plugins/ai-chat/client/components/chat-sidebar.mjs +6 -2
  12. package/dist/packages/stack/src/plugins/ai-chat/client/hooks/chat-hooks.cjs +5 -5
  13. package/dist/packages/stack/src/plugins/ai-chat/client/hooks/chat-hooks.mjs +5 -5
  14. package/dist/packages/stack/src/plugins/blog/client/components/shared/page-wrapper.cjs +3 -2
  15. package/dist/packages/stack/src/plugins/blog/client/components/shared/page-wrapper.mjs +3 -2
  16. package/dist/packages/stack/src/plugins/blog/client/components/shared/post-card.cjs +81 -52
  17. package/dist/packages/stack/src/plugins/blog/client/components/shared/post-card.mjs +82 -53
  18. package/dist/packages/stack/src/plugins/blog/client/components/shared/posts-list.cjs +3 -2
  19. package/dist/packages/stack/src/plugins/blog/client/components/shared/posts-list.mjs +3 -2
  20. package/dist/packages/stack/src/plugins/cms/client/components/pages/content-list-page.internal.cjs +95 -75
  21. package/dist/packages/stack/src/plugins/cms/client/components/pages/content-list-page.internal.mjs +95 -75
  22. package/dist/packages/stack/src/plugins/cms/client/components/pages/dashboard-page.internal.cjs +16 -3
  23. package/dist/packages/stack/src/plugins/cms/client/components/pages/dashboard-page.internal.mjs +16 -3
  24. package/dist/packages/stack/src/plugins/cms/client/components/shared/page-wrapper.cjs +3 -2
  25. package/dist/packages/stack/src/plugins/cms/client/components/shared/page-wrapper.mjs +3 -2
  26. package/dist/packages/stack/src/plugins/cms/utils.cjs +6 -2
  27. package/dist/packages/stack/src/plugins/cms/utils.mjs +6 -3
  28. package/dist/packages/stack/src/plugins/form-builder/client/components/forms/form-renderer.cjs +14 -8
  29. package/dist/packages/stack/src/plugins/form-builder/client/components/forms/form-renderer.mjs +14 -8
  30. package/dist/packages/stack/src/plugins/form-builder/client/components/pages/form-list-page.internal.cjs +94 -87
  31. package/dist/packages/stack/src/plugins/form-builder/client/components/pages/form-list-page.internal.mjs +94 -87
  32. package/dist/packages/stack/src/plugins/form-builder/client/components/pages/submissions-page.internal.cjs +81 -74
  33. package/dist/packages/stack/src/plugins/form-builder/client/components/pages/submissions-page.internal.mjs +81 -74
  34. package/dist/packages/stack/src/plugins/form-builder/client/components/shared/page-wrapper.cjs +3 -2
  35. package/dist/packages/stack/src/plugins/form-builder/client/components/shared/page-wrapper.mjs +3 -2
  36. package/dist/packages/stack/src/plugins/form-builder/client/components/shared/pagination.cjs +25 -16
  37. package/dist/packages/stack/src/plugins/form-builder/client/components/shared/pagination.mjs +25 -16
  38. package/dist/packages/stack/src/plugins/form-builder/utils.cjs +6 -2
  39. package/dist/packages/stack/src/plugins/form-builder/utils.mjs +6 -3
  40. package/dist/packages/stack/src/plugins/kanban/api/getters.cjs +7 -5
  41. package/dist/packages/stack/src/plugins/kanban/api/getters.mjs +7 -5
  42. package/dist/packages/stack/src/plugins/media/client/hooks/use-media.cjs +10 -8
  43. package/dist/packages/stack/src/plugins/media/client/hooks/use-media.mjs +10 -8
  44. package/dist/plugins/ai-chat/client/components/index.d.cts +1 -1
  45. package/dist/plugins/ai-chat/client/components/index.d.mts +1 -1
  46. package/dist/plugins/ai-chat/client/components/index.d.ts +1 -1
  47. package/dist/plugins/ai-chat/client/index.d.cts +2 -2
  48. package/dist/plugins/ai-chat/client/index.d.mts +2 -2
  49. package/dist/plugins/ai-chat/client/index.d.ts +2 -2
  50. package/dist/plugins/blog/api/index.d.cts +2 -2
  51. package/dist/plugins/blog/api/index.d.mts +2 -2
  52. package/dist/plugins/blog/api/index.d.ts +2 -2
  53. package/dist/plugins/blog/client/hooks/index.d.cts +2 -2
  54. package/dist/plugins/blog/client/hooks/index.d.mts +2 -2
  55. package/dist/plugins/blog/client/hooks/index.d.ts +2 -2
  56. package/dist/plugins/blog/client/index.d.cts +20 -2
  57. package/dist/plugins/blog/client/index.d.mts +20 -2
  58. package/dist/plugins/blog/client/index.d.ts +20 -2
  59. package/dist/plugins/blog/query-keys.d.cts +2 -2
  60. package/dist/plugins/blog/query-keys.d.mts +2 -2
  61. package/dist/plugins/blog/query-keys.d.ts +2 -2
  62. package/dist/plugins/cms/api/index.d.cts +1 -1
  63. package/dist/plugins/cms/api/index.d.mts +1 -1
  64. package/dist/plugins/cms/api/index.d.ts +1 -1
  65. package/dist/plugins/cms/client/index.d.cts +18 -0
  66. package/dist/plugins/cms/client/index.d.mts +18 -0
  67. package/dist/plugins/cms/client/index.d.ts +18 -0
  68. package/dist/plugins/cms/query-keys.d.cts +1 -1
  69. package/dist/plugins/cms/query-keys.d.mts +1 -1
  70. package/dist/plugins/cms/query-keys.d.ts +1 -1
  71. package/dist/plugins/form-builder/client/index.d.cts +16 -0
  72. package/dist/plugins/form-builder/client/index.d.mts +16 -0
  73. package/dist/plugins/form-builder/client/index.d.ts +16 -0
  74. package/dist/plugins/ui-builder/client/hooks/index.d.cts +1 -1
  75. package/dist/plugins/ui-builder/client/hooks/index.d.mts +1 -1
  76. package/dist/plugins/ui-builder/client/hooks/index.d.ts +1 -1
  77. package/dist/plugins/ui-builder/client/index.d.cts +1 -1
  78. package/dist/plugins/ui-builder/client/index.d.mts +1 -1
  79. package/dist/plugins/ui-builder/client/index.d.ts +1 -1
  80. package/dist/plugins/ui-builder/query-keys.d.cts +1 -1
  81. package/dist/plugins/ui-builder/query-keys.d.mts +1 -1
  82. package/dist/plugins/ui-builder/query-keys.d.ts +1 -1
  83. package/dist/shared/{stack.BTStHVTy.d.cts → stack.BGzgFx3R.d.cts} +5 -5
  84. package/dist/shared/{stack.CtrnoQgH.d.cts → stack.BOZRaVpu.d.cts} +35 -35
  85. package/dist/shared/{stack.94kN3pEK.d.mts → stack.CjCSDfWy.d.mts} +5 -5
  86. package/dist/shared/{stack.lPKwd_v0.d.ts → stack.DlBoNqYu.d.ts} +35 -35
  87. package/dist/shared/{stack.DfrRYOIl.d.ts → stack.Dpg_JjIo.d.ts} +5 -5
  88. package/dist/shared/{stack.BggTHKlo.d.mts → stack.Dvy7FmaA.d.mts} +35 -35
  89. package/dist/shared/{stack.5_zzCejP.d.cts → stack.rVF0f509.d.cts} +20 -0
  90. package/dist/shared/{stack.5_zzCejP.d.mts → stack.rVF0f509.d.mts} +20 -0
  91. package/dist/shared/{stack.5_zzCejP.d.ts → stack.rVF0f509.d.ts} +20 -0
  92. package/package.json +11 -7
  93. package/src/__tests__/package-metadata.test.ts +4 -4
  94. package/src/plugins/ai-chat/__tests__/classnames-overrides.test.tsx +248 -0
  95. package/src/plugins/ai-chat/__tests__/hooks.test.tsx +70 -54
  96. package/src/plugins/ai-chat/client/components/chat-input.tsx +6 -1
  97. package/src/plugins/ai-chat/client/components/chat-interface.tsx +3 -0
  98. package/src/plugins/ai-chat/client/components/chat-layout.tsx +9 -2
  99. package/src/plugins/ai-chat/client/components/chat-message.tsx +13 -5
  100. package/src/plugins/ai-chat/client/components/chat-sidebar.tsx +6 -2
  101. package/src/plugins/ai-chat/client/hooks/chat-hooks.tsx +6 -9
  102. package/src/plugins/ai-chat/client/overrides.ts +21 -0
  103. package/src/plugins/blog/__tests__/classnames-overrides.test.tsx +206 -0
  104. package/src/plugins/blog/client/components/shared/page-wrapper.tsx +3 -2
  105. package/src/plugins/blog/client/components/shared/post-card.tsx +32 -12
  106. package/src/plugins/blog/client/components/shared/posts-list.tsx +3 -2
  107. package/src/plugins/blog/client/overrides.ts +18 -0
  108. package/src/plugins/cms/__tests__/classnames-overrides.test.tsx +200 -0
  109. package/src/plugins/cms/client/components/pages/content-list-page.internal.tsx +17 -4
  110. package/src/plugins/cms/client/components/pages/dashboard-page.internal.tsx +14 -3
  111. package/src/plugins/cms/client/components/shared/page-wrapper.tsx +3 -2
  112. package/src/plugins/cms/client/overrides.ts +19 -0
  113. package/src/plugins/form-builder/__tests__/classnames-overrides.test.tsx +312 -0
  114. package/src/plugins/form-builder/client/components/forms/form-renderer.tsx +14 -9
  115. package/src/plugins/form-builder/client/components/pages/form-list-page.internal.tsx +9 -5
  116. package/src/plugins/form-builder/client/components/pages/submissions-page.internal.tsx +9 -5
  117. package/src/plugins/form-builder/client/components/shared/page-wrapper.tsx +3 -2
  118. package/src/plugins/form-builder/client/components/shared/pagination.tsx +7 -1
  119. package/src/plugins/form-builder/client/overrides.ts +17 -0
  120. package/src/plugins/kanban/__tests__/getters.test.ts +14 -1
  121. package/src/plugins/kanban/api/getters.ts +9 -7
  122. package/src/plugins/kanban/types.ts +4 -6
  123. package/src/plugins/media/client/hooks/use-media.tsx +7 -8
  124. package/dist/shared/{stack.lsbdKRj7.d.mts → stack.B8PG21zX.d.mts} +16 -16
  125. package/dist/shared/{stack.CKc_Bais.d.cts → stack.Csi-4Mgz.d.cts} +7 -7
  126. package/dist/shared/{stack.CKc_Bais.d.mts → stack.Csi-4Mgz.d.mts} +7 -7
  127. package/dist/shared/{stack.CKc_Bais.d.ts → stack.Csi-4Mgz.d.ts} +7 -7
  128. package/dist/shared/{stack.BMlTZnZp.d.ts → stack.CyalJ0j6.d.ts} +16 -16
  129. package/dist/shared/{stack.BV0uNV4f.d.cts → stack.D6Pg-ufX.d.cts} +16 -16
@@ -14,14 +14,13 @@ const emptyState = require('../shared/empty-state.cjs');
14
14
  const pagination = require('../shared/pagination.cjs');
15
15
  const plugins_formBuilder_permissions = require('../../../../../../../../plugins/form-builder/permissions.cjs');
16
16
  const constants = require('../../constants.cjs');
17
+ const utils = require('../../../utils.cjs');
17
18
  const formBuilderHooks = require('../../hooks/form-builder-hooks.cjs');
18
19
 
19
20
  function SubmissionsPage({ formId }) {
20
21
  const t = context.useTranslate();
21
22
  const notify = context.useNotify();
22
- const { localization } = context.usePluginOverrides(
23
- constants.FORM_BUILDER_PLUGIN_ID
24
- );
23
+ const { localization, classNames } = context.usePluginOverrides(constants.FORM_BUILDER_PLUGIN_ID);
25
24
  const { identity } = context.useIdentity();
26
25
  const { Link: LinkComponent, resolve } = context.usePluginSiteNavigation(
27
26
  constants.FORM_BUILDER_PLUGIN_ID
@@ -75,83 +74,90 @@ function SubmissionsPage({ formId }) {
75
74
  )
76
75
  }
77
76
  ) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
78
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-lg border", children: /* @__PURE__ */ jsxRuntime.jsxs(table.Table, { children: [
79
- /* @__PURE__ */ jsxRuntime.jsx(table.TableHeader, { children: /* @__PURE__ */ jsxRuntime.jsxs(table.TableRow, { children: [
80
- /* @__PURE__ */ jsxRuntime.jsx(table.TableHead, { className: "w-24", children: localization?.FORM_BUILDER_SUBMISSIONS_COLUMN_ID ?? t("formBuilder.submissions.columnId", "ID") }),
81
- /* @__PURE__ */ jsxRuntime.jsx(table.TableHead, { children: localization?.FORM_BUILDER_SUBMISSIONS_COLUMN_SUBMITTED_AT ?? t(
82
- "formBuilder.submissions.columnSubmittedAt",
83
- "Submitted"
84
- ) }),
85
- /* @__PURE__ */ jsxRuntime.jsx(table.TableHead, { className: "w-24", children: localization?.FORM_BUILDER_SUBMISSIONS_COLUMN_ACTIONS ?? t("formBuilder.submissions.columnActions", "Actions") })
86
- ] }) }),
87
- /* @__PURE__ */ jsxRuntime.jsx(table.TableBody, { children: submissions.map((sub) => /* @__PURE__ */ jsxRuntime.jsxs(table.TableRow, { children: [
88
- /* @__PURE__ */ jsxRuntime.jsxs(table.TableCell, { className: "font-mono text-xs", children: [
89
- sub.id.slice(0, 8),
90
- "..."
91
- ] }),
92
- /* @__PURE__ */ jsxRuntime.jsx(table.TableCell, { className: "text-muted-foreground", children: new Date(sub.submittedAt).toLocaleString() }),
93
- /* @__PURE__ */ jsxRuntime.jsx(table.TableCell, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-1", children: [
94
- /* @__PURE__ */ jsxRuntime.jsx(
95
- context.PermissionAccess,
96
- {
97
- permission: plugins_formBuilder_permissions.formBuilderPermissions.submission.read({
98
- scope: "record",
99
- formId,
100
- submissionId: sub.id,
101
- exists: true,
102
- ...form?.createdBy ? { ownerId: form.createdBy } : {},
103
- ...sub.submittedBy ? { submittedBy: sub.submittedBy } : {}
104
- }),
105
- children: /* @__PURE__ */ jsxRuntime.jsxs(
106
- button.Button,
107
- {
108
- variant: "ghost",
109
- size: "icon",
110
- onClick: () => setViewSubmissionId(sub.id),
111
- children: [
112
- /* @__PURE__ */ jsxRuntime.jsx(LucideIcons.Eye, { className: "h-4 w-4" }),
113
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: localization?.FORM_BUILDER_SUBMISSIONS_ACTION_VIEW ?? t(
114
- "formBuilder.submissions.actionView",
115
- "View"
116
- ) })
117
- ]
118
- }
119
- )
120
- }
121
- ),
122
- /* @__PURE__ */ jsxRuntime.jsx(
123
- context.PermissionAccess,
124
- {
125
- permission: plugins_formBuilder_permissions.formBuilderPermissions.submission.delete(
77
+ /* @__PURE__ */ jsxRuntime.jsx(
78
+ "div",
79
+ {
80
+ className: utils.cn("rounded-lg border", classNames?.table),
81
+ "data-testid": "form-builder-submissions-table",
82
+ children: /* @__PURE__ */ jsxRuntime.jsxs(table.Table, { children: [
83
+ /* @__PURE__ */ jsxRuntime.jsx(table.TableHeader, { children: /* @__PURE__ */ jsxRuntime.jsxs(table.TableRow, { children: [
84
+ /* @__PURE__ */ jsxRuntime.jsx(table.TableHead, { className: "w-24", children: localization?.FORM_BUILDER_SUBMISSIONS_COLUMN_ID ?? t("formBuilder.submissions.columnId", "ID") }),
85
+ /* @__PURE__ */ jsxRuntime.jsx(table.TableHead, { children: localization?.FORM_BUILDER_SUBMISSIONS_COLUMN_SUBMITTED_AT ?? t(
86
+ "formBuilder.submissions.columnSubmittedAt",
87
+ "Submitted"
88
+ ) }),
89
+ /* @__PURE__ */ jsxRuntime.jsx(table.TableHead, { className: "w-24", children: localization?.FORM_BUILDER_SUBMISSIONS_COLUMN_ACTIONS ?? t("formBuilder.submissions.columnActions", "Actions") })
90
+ ] }) }),
91
+ /* @__PURE__ */ jsxRuntime.jsx(table.TableBody, { children: submissions.map((sub) => /* @__PURE__ */ jsxRuntime.jsxs(table.TableRow, { className: classNames?.tableRow, children: [
92
+ /* @__PURE__ */ jsxRuntime.jsxs(table.TableCell, { className: "font-mono text-xs", children: [
93
+ sub.id.slice(0, 8),
94
+ "..."
95
+ ] }),
96
+ /* @__PURE__ */ jsxRuntime.jsx(table.TableCell, { className: "text-muted-foreground", children: new Date(sub.submittedAt).toLocaleString() }),
97
+ /* @__PURE__ */ jsxRuntime.jsx(table.TableCell, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-1", children: [
98
+ /* @__PURE__ */ jsxRuntime.jsx(
99
+ context.PermissionAccess,
126
100
  {
127
- formId,
128
- submissionId: sub.id,
129
- exists: true,
130
- ...form?.createdBy ? { ownerId: form.createdBy } : {},
131
- ...sub.submittedBy ? { submittedBy: sub.submittedBy } : {}
101
+ permission: plugins_formBuilder_permissions.formBuilderPermissions.submission.read({
102
+ scope: "record",
103
+ formId,
104
+ submissionId: sub.id,
105
+ exists: true,
106
+ ...form?.createdBy ? { ownerId: form.createdBy } : {},
107
+ ...sub.submittedBy ? { submittedBy: sub.submittedBy } : {}
108
+ }),
109
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
110
+ button.Button,
111
+ {
112
+ variant: "ghost",
113
+ size: "icon",
114
+ onClick: () => setViewSubmissionId(sub.id),
115
+ children: [
116
+ /* @__PURE__ */ jsxRuntime.jsx(LucideIcons.Eye, { className: "h-4 w-4" }),
117
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: localization?.FORM_BUILDER_SUBMISSIONS_ACTION_VIEW ?? t(
118
+ "formBuilder.submissions.actionView",
119
+ "View"
120
+ ) })
121
+ ]
122
+ }
123
+ )
132
124
  }
133
125
  ),
134
- children: /* @__PURE__ */ jsxRuntime.jsxs(
135
- button.Button,
126
+ /* @__PURE__ */ jsxRuntime.jsx(
127
+ context.PermissionAccess,
136
128
  {
137
- variant: "ghost",
138
- size: "icon",
139
- className: "text-destructive",
140
- onClick: () => setDeleteId(sub.id),
141
- children: [
142
- /* @__PURE__ */ jsxRuntime.jsx(LucideIcons.Trash2, { className: "h-4 w-4" }),
143
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: localization?.FORM_BUILDER_SUBMISSIONS_ACTION_DELETE ?? t(
144
- "formBuilder.submissions.actionDelete",
145
- "Delete"
146
- ) })
147
- ]
129
+ permission: plugins_formBuilder_permissions.formBuilderPermissions.submission.delete(
130
+ {
131
+ formId,
132
+ submissionId: sub.id,
133
+ exists: true,
134
+ ...form?.createdBy ? { ownerId: form.createdBy } : {},
135
+ ...sub.submittedBy ? { submittedBy: sub.submittedBy } : {}
136
+ }
137
+ ),
138
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
139
+ button.Button,
140
+ {
141
+ variant: "ghost",
142
+ size: "icon",
143
+ className: "text-destructive",
144
+ onClick: () => setDeleteId(sub.id),
145
+ children: [
146
+ /* @__PURE__ */ jsxRuntime.jsx(LucideIcons.Trash2, { className: "h-4 w-4" }),
147
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: localization?.FORM_BUILDER_SUBMISSIONS_ACTION_DELETE ?? t(
148
+ "formBuilder.submissions.actionDelete",
149
+ "Delete"
150
+ ) })
151
+ ]
152
+ }
153
+ )
148
154
  }
149
155
  )
150
- }
151
- )
152
- ] }) })
153
- ] }, sub.id)) })
154
- ] }) }),
156
+ ] }) })
157
+ ] }, sub.id)) })
158
+ ] })
159
+ }
160
+ ),
155
161
  /* @__PURE__ */ jsxRuntime.jsx(
156
162
  pagination.Pagination,
157
163
  {
@@ -160,6 +166,7 @@ function SubmissionsPage({ formId }) {
160
166
  hasMore,
161
167
  isLoadingMore,
162
168
  onLoadMore: loadMore,
169
+ className: classNames?.pagination,
163
170
  labels: {
164
171
  showing: localization?.FORM_BUILDER_LIST_PAGINATION_SHOWING ?? t(
165
172
  "formBuilder.list.paginationShowing",
@@ -12,14 +12,13 @@ import { EmptyState } from '../shared/empty-state.mjs';
12
12
  import { Pagination } from '../shared/pagination.mjs';
13
13
  import { formBuilderPermissions } from '../../../../../../../../plugins/form-builder/permissions.mjs';
14
14
  import { FORM_BUILDER_PLUGIN_ID } from '../../constants.mjs';
15
+ import { cn } from '../../../utils.mjs';
15
16
  import { useSuspenseSubmissions, useDeleteSubmission, useSubmission } from '../../hooks/form-builder-hooks.mjs';
16
17
 
17
18
  function SubmissionsPage({ formId }) {
18
19
  const t = useTranslate();
19
20
  const notify = useNotify();
20
- const { localization } = usePluginOverrides(
21
- FORM_BUILDER_PLUGIN_ID
22
- );
21
+ const { localization, classNames } = usePluginOverrides(FORM_BUILDER_PLUGIN_ID);
23
22
  const { identity } = useIdentity();
24
23
  const { Link: LinkComponent, resolve } = usePluginSiteNavigation(
25
24
  FORM_BUILDER_PLUGIN_ID
@@ -73,83 +72,90 @@ function SubmissionsPage({ formId }) {
73
72
  )
74
73
  }
75
74
  ) : /* @__PURE__ */ jsxs(Fragment, { children: [
76
- /* @__PURE__ */ jsx("div", { className: "rounded-lg border", children: /* @__PURE__ */ jsxs(Table, { children: [
77
- /* @__PURE__ */ jsx(TableHeader, { children: /* @__PURE__ */ jsxs(TableRow, { children: [
78
- /* @__PURE__ */ jsx(TableHead, { className: "w-24", children: localization?.FORM_BUILDER_SUBMISSIONS_COLUMN_ID ?? t("formBuilder.submissions.columnId", "ID") }),
79
- /* @__PURE__ */ jsx(TableHead, { children: localization?.FORM_BUILDER_SUBMISSIONS_COLUMN_SUBMITTED_AT ?? t(
80
- "formBuilder.submissions.columnSubmittedAt",
81
- "Submitted"
82
- ) }),
83
- /* @__PURE__ */ jsx(TableHead, { className: "w-24", children: localization?.FORM_BUILDER_SUBMISSIONS_COLUMN_ACTIONS ?? t("formBuilder.submissions.columnActions", "Actions") })
84
- ] }) }),
85
- /* @__PURE__ */ jsx(TableBody, { children: submissions.map((sub) => /* @__PURE__ */ jsxs(TableRow, { children: [
86
- /* @__PURE__ */ jsxs(TableCell, { className: "font-mono text-xs", children: [
87
- sub.id.slice(0, 8),
88
- "..."
89
- ] }),
90
- /* @__PURE__ */ jsx(TableCell, { className: "text-muted-foreground", children: new Date(sub.submittedAt).toLocaleString() }),
91
- /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsxs("div", { className: "flex gap-1", children: [
92
- /* @__PURE__ */ jsx(
93
- PermissionAccess,
94
- {
95
- permission: formBuilderPermissions.submission.read({
96
- scope: "record",
97
- formId,
98
- submissionId: sub.id,
99
- exists: true,
100
- ...form?.createdBy ? { ownerId: form.createdBy } : {},
101
- ...sub.submittedBy ? { submittedBy: sub.submittedBy } : {}
102
- }),
103
- children: /* @__PURE__ */ jsxs(
104
- Button,
105
- {
106
- variant: "ghost",
107
- size: "icon",
108
- onClick: () => setViewSubmissionId(sub.id),
109
- children: [
110
- /* @__PURE__ */ jsx(Eye, { className: "h-4 w-4" }),
111
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: localization?.FORM_BUILDER_SUBMISSIONS_ACTION_VIEW ?? t(
112
- "formBuilder.submissions.actionView",
113
- "View"
114
- ) })
115
- ]
116
- }
117
- )
118
- }
119
- ),
120
- /* @__PURE__ */ jsx(
121
- PermissionAccess,
122
- {
123
- permission: formBuilderPermissions.submission.delete(
75
+ /* @__PURE__ */ jsx(
76
+ "div",
77
+ {
78
+ className: cn("rounded-lg border", classNames?.table),
79
+ "data-testid": "form-builder-submissions-table",
80
+ children: /* @__PURE__ */ jsxs(Table, { children: [
81
+ /* @__PURE__ */ jsx(TableHeader, { children: /* @__PURE__ */ jsxs(TableRow, { children: [
82
+ /* @__PURE__ */ jsx(TableHead, { className: "w-24", children: localization?.FORM_BUILDER_SUBMISSIONS_COLUMN_ID ?? t("formBuilder.submissions.columnId", "ID") }),
83
+ /* @__PURE__ */ jsx(TableHead, { children: localization?.FORM_BUILDER_SUBMISSIONS_COLUMN_SUBMITTED_AT ?? t(
84
+ "formBuilder.submissions.columnSubmittedAt",
85
+ "Submitted"
86
+ ) }),
87
+ /* @__PURE__ */ jsx(TableHead, { className: "w-24", children: localization?.FORM_BUILDER_SUBMISSIONS_COLUMN_ACTIONS ?? t("formBuilder.submissions.columnActions", "Actions") })
88
+ ] }) }),
89
+ /* @__PURE__ */ jsx(TableBody, { children: submissions.map((sub) => /* @__PURE__ */ jsxs(TableRow, { className: classNames?.tableRow, children: [
90
+ /* @__PURE__ */ jsxs(TableCell, { className: "font-mono text-xs", children: [
91
+ sub.id.slice(0, 8),
92
+ "..."
93
+ ] }),
94
+ /* @__PURE__ */ jsx(TableCell, { className: "text-muted-foreground", children: new Date(sub.submittedAt).toLocaleString() }),
95
+ /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsxs("div", { className: "flex gap-1", children: [
96
+ /* @__PURE__ */ jsx(
97
+ PermissionAccess,
124
98
  {
125
- formId,
126
- submissionId: sub.id,
127
- exists: true,
128
- ...form?.createdBy ? { ownerId: form.createdBy } : {},
129
- ...sub.submittedBy ? { submittedBy: sub.submittedBy } : {}
99
+ permission: formBuilderPermissions.submission.read({
100
+ scope: "record",
101
+ formId,
102
+ submissionId: sub.id,
103
+ exists: true,
104
+ ...form?.createdBy ? { ownerId: form.createdBy } : {},
105
+ ...sub.submittedBy ? { submittedBy: sub.submittedBy } : {}
106
+ }),
107
+ children: /* @__PURE__ */ jsxs(
108
+ Button,
109
+ {
110
+ variant: "ghost",
111
+ size: "icon",
112
+ onClick: () => setViewSubmissionId(sub.id),
113
+ children: [
114
+ /* @__PURE__ */ jsx(Eye, { className: "h-4 w-4" }),
115
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: localization?.FORM_BUILDER_SUBMISSIONS_ACTION_VIEW ?? t(
116
+ "formBuilder.submissions.actionView",
117
+ "View"
118
+ ) })
119
+ ]
120
+ }
121
+ )
130
122
  }
131
123
  ),
132
- children: /* @__PURE__ */ jsxs(
133
- Button,
124
+ /* @__PURE__ */ jsx(
125
+ PermissionAccess,
134
126
  {
135
- variant: "ghost",
136
- size: "icon",
137
- className: "text-destructive",
138
- onClick: () => setDeleteId(sub.id),
139
- children: [
140
- /* @__PURE__ */ jsx(Trash2, { className: "h-4 w-4" }),
141
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: localization?.FORM_BUILDER_SUBMISSIONS_ACTION_DELETE ?? t(
142
- "formBuilder.submissions.actionDelete",
143
- "Delete"
144
- ) })
145
- ]
127
+ permission: formBuilderPermissions.submission.delete(
128
+ {
129
+ formId,
130
+ submissionId: sub.id,
131
+ exists: true,
132
+ ...form?.createdBy ? { ownerId: form.createdBy } : {},
133
+ ...sub.submittedBy ? { submittedBy: sub.submittedBy } : {}
134
+ }
135
+ ),
136
+ children: /* @__PURE__ */ jsxs(
137
+ Button,
138
+ {
139
+ variant: "ghost",
140
+ size: "icon",
141
+ className: "text-destructive",
142
+ onClick: () => setDeleteId(sub.id),
143
+ children: [
144
+ /* @__PURE__ */ jsx(Trash2, { className: "h-4 w-4" }),
145
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: localization?.FORM_BUILDER_SUBMISSIONS_ACTION_DELETE ?? t(
146
+ "formBuilder.submissions.actionDelete",
147
+ "Delete"
148
+ ) })
149
+ ]
150
+ }
151
+ )
146
152
  }
147
153
  )
148
- }
149
- )
150
- ] }) })
151
- ] }, sub.id)) })
152
- ] }) }),
154
+ ] }) })
155
+ ] }, sub.id)) })
156
+ ] })
157
+ }
158
+ ),
153
159
  /* @__PURE__ */ jsx(
154
160
  Pagination,
155
161
  {
@@ -158,6 +164,7 @@ function SubmissionsPage({ formId }) {
158
164
  hasMore,
159
165
  isLoadingMore,
160
166
  onLoadMore: loadMore,
167
+ className: classNames?.pagination,
161
168
  labels: {
162
169
  showing: localization?.FORM_BUILDER_LIST_PAGINATION_SHOWING ?? t(
163
170
  "formBuilder.list.paginationShowing",
@@ -5,19 +5,20 @@ const jsxRuntime = require('react/jsx-runtime');
5
5
  const context = require('@btst/stack/context');
6
6
  const pageWrapper = require('../../../../../../../ui/src/components/page-wrapper.cjs');
7
7
  const constants = require('../../constants.cjs');
8
+ const utils = require('../../../utils.cjs');
8
9
 
9
10
  function PageWrapper({
10
11
  children,
11
12
  className,
12
13
  testId
13
14
  }) {
14
- const { showAttribution } = context.usePluginOverrides(constants.FORM_BUILDER_PLUGIN_ID, {
15
+ const { showAttribution, classNames } = context.usePluginOverrides(constants.FORM_BUILDER_PLUGIN_ID, {
15
16
  showAttribution: true
16
17
  });
17
18
  return /* @__PURE__ */ jsxRuntime.jsx(
18
19
  pageWrapper.PageWrapper,
19
20
  {
20
- className,
21
+ className: utils.cn(className, classNames?.container),
21
22
  testId,
22
23
  showAttribution,
23
24
  children
@@ -3,19 +3,20 @@ import { jsx } from 'react/jsx-runtime';
3
3
  import { usePluginOverrides } from '@btst/stack/context';
4
4
  import { PageWrapper as PageWrapper$1 } from '../../../../../../../ui/src/components/page-wrapper.mjs';
5
5
  import { FORM_BUILDER_PLUGIN_ID } from '../../constants.mjs';
6
+ import { cn } from '../../../utils.mjs';
6
7
 
7
8
  function PageWrapper({
8
9
  children,
9
10
  className,
10
11
  testId
11
12
  }) {
12
- const { showAttribution } = usePluginOverrides(FORM_BUILDER_PLUGIN_ID, {
13
+ const { showAttribution, classNames } = usePluginOverrides(FORM_BUILDER_PLUGIN_ID, {
13
14
  showAttribution: true
14
15
  });
15
16
  return /* @__PURE__ */ jsx(
16
17
  PageWrapper$1,
17
18
  {
18
- className,
19
+ className: cn(className, classNames?.container),
19
20
  testId,
20
21
  showAttribution,
21
22
  children
@@ -4,6 +4,7 @@
4
4
  const jsxRuntime = require('react/jsx-runtime');
5
5
  const button = require('../../../../../../../ui/src/components/button.cjs');
6
6
  const LucideIcons = require('lucide-react');
7
+ const utils = require('../../../utils.cjs');
7
8
 
8
9
  function Pagination({
9
10
  total,
@@ -11,6 +12,7 @@ function Pagination({
11
12
  hasMore,
12
13
  isLoadingMore,
13
14
  onLoadMore,
15
+ className,
14
16
  labels = {}
15
17
  }) {
16
18
  const {
@@ -19,22 +21,29 @@ function Pagination({
19
21
  loading = "Loading..."
20
22
  } = labels;
21
23
  const showingText = showingLabel.replace("{count}", String(showing)).replace("{total}", String(total));
22
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between py-4", children: [
23
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: showingText }),
24
- hasMore && /* @__PURE__ */ jsxRuntime.jsxs(
25
- button.Button,
26
- {
27
- variant: "outline",
28
- size: "sm",
29
- onClick: onLoadMore,
30
- disabled: isLoadingMore,
31
- children: [
32
- isLoadingMore ? loading : next,
33
- /* @__PURE__ */ jsxRuntime.jsx(LucideIcons.ChevronRight, { className: "ml-2 h-4 w-4" })
34
- ]
35
- }
36
- )
37
- ] });
24
+ return /* @__PURE__ */ jsxRuntime.jsxs(
25
+ "div",
26
+ {
27
+ className: utils.cn("flex items-center justify-between py-4", className),
28
+ "data-testid": "form-builder-pagination",
29
+ children: [
30
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: showingText }),
31
+ hasMore && /* @__PURE__ */ jsxRuntime.jsxs(
32
+ button.Button,
33
+ {
34
+ variant: "outline",
35
+ size: "sm",
36
+ onClick: onLoadMore,
37
+ disabled: isLoadingMore,
38
+ children: [
39
+ isLoadingMore ? loading : next,
40
+ /* @__PURE__ */ jsxRuntime.jsx(LucideIcons.ChevronRight, { className: "ml-2 h-4 w-4" })
41
+ ]
42
+ }
43
+ )
44
+ ]
45
+ }
46
+ );
38
47
  }
39
48
 
40
49
  exports.Pagination = Pagination;
@@ -2,6 +2,7 @@
2
2
  import { jsxs, jsx } from 'react/jsx-runtime';
3
3
  import { Button } from '../../../../../../../ui/src/components/button.mjs';
4
4
  import { ChevronRight } from 'lucide-react';
5
+ import { cn } from '../../../utils.mjs';
5
6
 
6
7
  function Pagination({
7
8
  total,
@@ -9,6 +10,7 @@ function Pagination({
9
10
  hasMore,
10
11
  isLoadingMore,
11
12
  onLoadMore,
13
+ className,
12
14
  labels = {}
13
15
  }) {
14
16
  const {
@@ -17,22 +19,29 @@ function Pagination({
17
19
  loading = "Loading..."
18
20
  } = labels;
19
21
  const showingText = showingLabel.replace("{count}", String(showing)).replace("{total}", String(total));
20
- return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between py-4", children: [
21
- /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: showingText }),
22
- hasMore && /* @__PURE__ */ jsxs(
23
- Button,
24
- {
25
- variant: "outline",
26
- size: "sm",
27
- onClick: onLoadMore,
28
- disabled: isLoadingMore,
29
- children: [
30
- isLoadingMore ? loading : next,
31
- /* @__PURE__ */ jsx(ChevronRight, { className: "ml-2 h-4 w-4" })
32
- ]
33
- }
34
- )
35
- ] });
22
+ return /* @__PURE__ */ jsxs(
23
+ "div",
24
+ {
25
+ className: cn("flex items-center justify-between py-4", className),
26
+ "data-testid": "form-builder-pagination",
27
+ children: [
28
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: showingText }),
29
+ hasMore && /* @__PURE__ */ jsxs(
30
+ Button,
31
+ {
32
+ variant: "outline",
33
+ size: "sm",
34
+ onClick: onLoadMore,
35
+ disabled: isLoadingMore,
36
+ children: [
37
+ isLoadingMore ? loading : next,
38
+ /* @__PURE__ */ jsx(ChevronRight, { className: "ml-2 h-4 w-4" })
39
+ ]
40
+ }
41
+ )
42
+ ]
43
+ }
44
+ );
36
45
  }
37
46
 
38
47
  export { Pagination };
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- require('clsx');
4
- require('tailwind-merge');
3
+ const clsx = require('clsx');
4
+ const tailwindMerge = require('tailwind-merge');
5
5
  const slug = require('slug');
6
6
 
7
7
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
@@ -11,6 +11,9 @@ const slug__default = /*#__PURE__*/_interopDefaultCompat(slug);
11
11
  function slugify(text, locale = "en") {
12
12
  return slug__default(text, { lower: true, locale });
13
13
  }
14
+ function cn(...inputs) {
15
+ return tailwindMerge.twMerge(clsx.clsx(inputs));
16
+ }
14
17
  function extractIpAddress(headers) {
15
18
  if (!headers) return void 0;
16
19
  const forwardedFor = headers.get("x-forwarded-for");
@@ -32,6 +35,7 @@ function extractUserAgent(headers) {
32
35
  return headers.get("user-agent") || void 0;
33
36
  }
34
37
 
38
+ exports.cn = cn;
35
39
  exports.extractIpAddress = extractIpAddress;
36
40
  exports.extractUserAgent = extractUserAgent;
37
41
  exports.slugify = slugify;
@@ -1,10 +1,13 @@
1
- import 'clsx';
2
- import 'tailwind-merge';
1
+ import { clsx } from 'clsx';
2
+ import { twMerge } from 'tailwind-merge';
3
3
  import slug from 'slug';
4
4
 
5
5
  function slugify(text, locale = "en") {
6
6
  return slug(text, { lower: true, locale });
7
7
  }
8
+ function cn(...inputs) {
9
+ return twMerge(clsx(inputs));
10
+ }
8
11
  function extractIpAddress(headers) {
9
12
  if (!headers) return void 0;
10
13
  const forwardedFor = headers.get("x-forwarded-for");
@@ -26,4 +29,4 @@ function extractUserAgent(headers) {
26
29
  return headers.get("user-agent") || void 0;
27
30
  }
28
31
 
29
- export { extractIpAddress, extractUserAgent, slugify };
32
+ export { cn, extractIpAddress, extractUserAgent, slugify };
@@ -35,7 +35,7 @@ async function getBoardRows(adapter, params) {
35
35
  return { items, total, limit: query.limit, offset: query.offset };
36
36
  }
37
37
  async function hydrateColumnsWithTasks(adapter, board) {
38
- const columnIds = (board.column || []).map((c) => c.id);
38
+ const columnIds = (board.kanbanColumn || []).map((c) => c.id);
39
39
  const tasksByColumn = /* @__PURE__ */ new Map();
40
40
  if (columnIds.length > 0) {
41
41
  const taskResults = await Promise.all(
@@ -57,8 +57,8 @@ async function hydrateColumnsWithTasks(adapter, board) {
57
57
  }
58
58
  }
59
59
  }
60
- const columns = (board.column || []).sort((a, b) => a.order - b.order).map((col) => ({ ...col, tasks: tasksByColumn.get(col.id) || [] }));
61
- const { column: _, ...boardWithoutJoin } = board;
60
+ const columns = (board.kanbanColumn || []).sort((a, b) => a.order - b.order).map((col) => ({ ...col, tasks: tasksByColumn.get(col.id) || [] }));
61
+ const { kanbanColumn: _, ...boardWithoutJoin } = board;
62
62
  return { ...boardWithoutJoin, columns };
63
63
  }
64
64
  async function getAllBoards(adapter, params) {
@@ -72,9 +72,11 @@ async function getBoardSummaries(adapter, params) {
72
72
  const result = await getBoardRows(adapter, params);
73
73
  return {
74
74
  ...result,
75
- items: result.items.map(({ column = [], ...board }) => ({
75
+ items: result.items.map(({ kanbanColumn = [], ...board }) => ({
76
76
  ...board,
77
- columns: [...column].sort((left, right) => left.order - right.order)
77
+ columns: [...kanbanColumn].sort(
78
+ (left, right) => left.order - right.order
79
+ )
78
80
  }))
79
81
  };
80
82
  }