@btst/stack 4.0.0 → 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.
- package/README.md +2 -2
- package/dist/packages/stack/src/plugins/ai-chat/client/components/chat-input.cjs +112 -103
- package/dist/packages/stack/src/plugins/ai-chat/client/components/chat-input.mjs +112 -103
- package/dist/packages/stack/src/plugins/ai-chat/client/components/chat-interface.cjs +5 -2
- package/dist/packages/stack/src/plugins/ai-chat/client/components/chat-interface.mjs +5 -2
- package/dist/packages/stack/src/plugins/ai-chat/client/components/chat-layout.cjs +99 -88
- package/dist/packages/stack/src/plugins/ai-chat/client/components/chat-layout.mjs +99 -88
- package/dist/packages/stack/src/plugins/ai-chat/client/components/chat-message.cjs +12 -3
- package/dist/packages/stack/src/plugins/ai-chat/client/components/chat-message.mjs +12 -3
- package/dist/packages/stack/src/plugins/ai-chat/client/components/chat-sidebar.cjs +6 -2
- package/dist/packages/stack/src/plugins/ai-chat/client/components/chat-sidebar.mjs +6 -2
- package/dist/packages/stack/src/plugins/blog/client/components/shared/page-wrapper.cjs +3 -2
- package/dist/packages/stack/src/plugins/blog/client/components/shared/page-wrapper.mjs +3 -2
- package/dist/packages/stack/src/plugins/blog/client/components/shared/post-card.cjs +81 -52
- package/dist/packages/stack/src/plugins/blog/client/components/shared/post-card.mjs +82 -53
- package/dist/packages/stack/src/plugins/blog/client/components/shared/posts-list.cjs +3 -2
- package/dist/packages/stack/src/plugins/blog/client/components/shared/posts-list.mjs +3 -2
- package/dist/packages/stack/src/plugins/cms/client/components/pages/content-list-page.internal.cjs +95 -75
- package/dist/packages/stack/src/plugins/cms/client/components/pages/content-list-page.internal.mjs +95 -75
- package/dist/packages/stack/src/plugins/cms/client/components/pages/dashboard-page.internal.cjs +16 -3
- package/dist/packages/stack/src/plugins/cms/client/components/pages/dashboard-page.internal.mjs +16 -3
- package/dist/packages/stack/src/plugins/cms/client/components/shared/page-wrapper.cjs +3 -2
- package/dist/packages/stack/src/plugins/cms/client/components/shared/page-wrapper.mjs +3 -2
- package/dist/packages/stack/src/plugins/cms/utils.cjs +6 -2
- package/dist/packages/stack/src/plugins/cms/utils.mjs +6 -3
- package/dist/packages/stack/src/plugins/form-builder/client/components/forms/form-renderer.cjs +14 -8
- package/dist/packages/stack/src/plugins/form-builder/client/components/forms/form-renderer.mjs +14 -8
- package/dist/packages/stack/src/plugins/form-builder/client/components/pages/form-list-page.internal.cjs +94 -87
- package/dist/packages/stack/src/plugins/form-builder/client/components/pages/form-list-page.internal.mjs +94 -87
- package/dist/packages/stack/src/plugins/form-builder/client/components/pages/submissions-page.internal.cjs +81 -74
- package/dist/packages/stack/src/plugins/form-builder/client/components/pages/submissions-page.internal.mjs +81 -74
- package/dist/packages/stack/src/plugins/form-builder/client/components/shared/page-wrapper.cjs +3 -2
- package/dist/packages/stack/src/plugins/form-builder/client/components/shared/page-wrapper.mjs +3 -2
- package/dist/packages/stack/src/plugins/form-builder/client/components/shared/pagination.cjs +25 -16
- package/dist/packages/stack/src/plugins/form-builder/client/components/shared/pagination.mjs +25 -16
- package/dist/packages/stack/src/plugins/form-builder/utils.cjs +6 -2
- package/dist/packages/stack/src/plugins/form-builder/utils.mjs +6 -3
- package/dist/plugins/ai-chat/client/components/index.d.cts +1 -1
- package/dist/plugins/ai-chat/client/components/index.d.mts +1 -1
- package/dist/plugins/ai-chat/client/components/index.d.ts +1 -1
- package/dist/plugins/ai-chat/client/index.d.cts +2 -2
- package/dist/plugins/ai-chat/client/index.d.mts +2 -2
- package/dist/plugins/ai-chat/client/index.d.ts +2 -2
- package/dist/plugins/blog/client/index.d.cts +18 -0
- package/dist/plugins/blog/client/index.d.mts +18 -0
- package/dist/plugins/blog/client/index.d.ts +18 -0
- package/dist/plugins/cms/client/index.d.cts +18 -0
- package/dist/plugins/cms/client/index.d.mts +18 -0
- package/dist/plugins/cms/client/index.d.ts +18 -0
- package/dist/plugins/form-builder/api/index.d.cts +1 -1
- package/dist/plugins/form-builder/api/index.d.mts +1 -1
- package/dist/plugins/form-builder/api/index.d.ts +1 -1
- package/dist/plugins/form-builder/client/hooks/index.d.cts +1 -1
- package/dist/plugins/form-builder/client/hooks/index.d.mts +1 -1
- package/dist/plugins/form-builder/client/hooks/index.d.ts +1 -1
- package/dist/plugins/form-builder/client/index.d.cts +16 -0
- package/dist/plugins/form-builder/client/index.d.mts +16 -0
- package/dist/plugins/form-builder/client/index.d.ts +16 -0
- package/dist/plugins/form-builder/query-keys.d.cts +1 -1
- package/dist/plugins/form-builder/query-keys.d.mts +1 -1
- package/dist/plugins/form-builder/query-keys.d.ts +1 -1
- package/dist/shared/{stack.5_zzCejP.d.cts → stack.rVF0f509.d.cts} +20 -0
- package/dist/shared/{stack.5_zzCejP.d.mts → stack.rVF0f509.d.mts} +20 -0
- package/dist/shared/{stack.5_zzCejP.d.ts → stack.rVF0f509.d.ts} +20 -0
- package/package.json +1 -1
- package/src/plugins/ai-chat/__tests__/classnames-overrides.test.tsx +248 -0
- package/src/plugins/ai-chat/client/components/chat-input.tsx +6 -1
- package/src/plugins/ai-chat/client/components/chat-interface.tsx +3 -0
- package/src/plugins/ai-chat/client/components/chat-layout.tsx +9 -2
- package/src/plugins/ai-chat/client/components/chat-message.tsx +13 -5
- package/src/plugins/ai-chat/client/components/chat-sidebar.tsx +6 -2
- package/src/plugins/ai-chat/client/overrides.ts +21 -0
- package/src/plugins/blog/__tests__/classnames-overrides.test.tsx +206 -0
- package/src/plugins/blog/client/components/shared/page-wrapper.tsx +3 -2
- package/src/plugins/blog/client/components/shared/post-card.tsx +32 -12
- package/src/plugins/blog/client/components/shared/posts-list.tsx +3 -2
- package/src/plugins/blog/client/overrides.ts +18 -0
- package/src/plugins/cms/__tests__/classnames-overrides.test.tsx +200 -0
- package/src/plugins/cms/client/components/pages/content-list-page.internal.tsx +17 -4
- package/src/plugins/cms/client/components/pages/dashboard-page.internal.tsx +14 -3
- package/src/plugins/cms/client/components/shared/page-wrapper.tsx +3 -2
- package/src/plugins/cms/client/overrides.ts +19 -0
- package/src/plugins/form-builder/__tests__/classnames-overrides.test.tsx +312 -0
- package/src/plugins/form-builder/client/components/forms/form-renderer.tsx +14 -9
- package/src/plugins/form-builder/client/components/pages/form-list-page.internal.tsx +9 -5
- package/src/plugins/form-builder/client/components/pages/submissions-page.internal.tsx +9 -5
- package/src/plugins/form-builder/client/components/shared/page-wrapper.tsx +3 -2
- package/src/plugins/form-builder/client/components/shared/pagination.tsx +7 -1
- package/src/plugins/form-builder/client/overrides.ts +17 -0
- package/dist/shared/{stack.BuxUQqL8.d.ts → stack.CGmh-Lpe.d.ts} +12 -12
- package/dist/shared/{stack.Egr3RWhA.d.mts → stack.Doy2_wgl.d.mts} +12 -12
- package/dist/shared/{stack.CX83YNuS.d.cts → stack.zch70Loj.d.cts} +12 -12
|
@@ -16,6 +16,7 @@ const emptyState = require('../shared/empty-state.cjs');
|
|
|
16
16
|
const pagination = require('../shared/pagination.cjs');
|
|
17
17
|
const plugins_formBuilder_permissions = require('../../../../../../../../plugins/form-builder/permissions.cjs');
|
|
18
18
|
const constants = require('../../constants.cjs');
|
|
19
|
+
const utils = require('../../../utils.cjs');
|
|
19
20
|
const formBuilderHooks = require('../../hooks/form-builder-hooks.cjs');
|
|
20
21
|
|
|
21
22
|
const LIST_STATE_SCHEMA = {
|
|
@@ -25,9 +26,7 @@ const SEARCH_DEBOUNCE_MS = 300;
|
|
|
25
26
|
function FormListPage() {
|
|
26
27
|
const t = context.useTranslate();
|
|
27
28
|
const notify = context.useNotify();
|
|
28
|
-
const { localization } = context.usePluginOverrides(
|
|
29
|
-
constants.FORM_BUILDER_PLUGIN_ID
|
|
30
|
-
);
|
|
29
|
+
const { localization, classNames } = context.usePluginOverrides(constants.FORM_BUILDER_PLUGIN_ID);
|
|
31
30
|
const { Link, navigate, resolve } = context.usePluginSiteNavigation(
|
|
32
31
|
constants.FORM_BUILDER_PLUGIN_ID
|
|
33
32
|
);
|
|
@@ -136,99 +135,106 @@ function FormListPage() {
|
|
|
136
135
|
action: newFormButton
|
|
137
136
|
}
|
|
138
137
|
) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
139
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
/* @__PURE__ */ jsxRuntime.
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
/* @__PURE__ */ jsxRuntime.jsx(table.TableCell, { className: "text-muted-foreground", children: new Date(form.createdAt).toLocaleDateString() }),
|
|
152
|
-
/* @__PURE__ */ jsxRuntime.jsx(table.TableCell, { children: /* @__PURE__ */ jsxRuntime.jsxs(dropdownMenu.DropdownMenu, { children: [
|
|
153
|
-
/* @__PURE__ */ jsxRuntime.jsx(dropdownMenu.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(button.Button, { variant: "ghost", size: "icon", children: [
|
|
154
|
-
/* @__PURE__ */ jsxRuntime.jsx(LucideIcons.MoreHorizontal, { className: "h-4 w-4" }),
|
|
155
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: localization?.FORM_BUILDER_LIST_COLUMN_ACTIONS ?? t(
|
|
156
|
-
"formBuilder.list.columnActions",
|
|
157
|
-
"Actions"
|
|
158
|
-
) })
|
|
138
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
139
|
+
"div",
|
|
140
|
+
{
|
|
141
|
+
className: utils.cn("rounded-lg border", classNames?.table),
|
|
142
|
+
"data-testid": "form-builder-list-table",
|
|
143
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(table.Table, { children: [
|
|
144
|
+
/* @__PURE__ */ jsxRuntime.jsx(table.TableHeader, { children: /* @__PURE__ */ jsxRuntime.jsxs(table.TableRow, { children: [
|
|
145
|
+
/* @__PURE__ */ jsxRuntime.jsx(table.TableHead, { children: localization?.FORM_BUILDER_LIST_COLUMN_NAME ?? t("formBuilder.list.columnName", "Name") }),
|
|
146
|
+
/* @__PURE__ */ jsxRuntime.jsx(table.TableHead, { children: localization?.FORM_BUILDER_LIST_COLUMN_SLUG ?? t("formBuilder.list.columnSlug", "Slug") }),
|
|
147
|
+
/* @__PURE__ */ jsxRuntime.jsx(table.TableHead, { children: localization?.FORM_BUILDER_LIST_COLUMN_STATUS ?? t("formBuilder.list.columnStatus", "Status") }),
|
|
148
|
+
/* @__PURE__ */ jsxRuntime.jsx(table.TableHead, { children: localization?.FORM_BUILDER_LIST_COLUMN_CREATED ?? t("formBuilder.list.columnCreated", "Created") }),
|
|
149
|
+
/* @__PURE__ */ jsxRuntime.jsx(table.TableHead, { className: "w-12", children: localization?.FORM_BUILDER_LIST_COLUMN_ACTIONS ?? t("formBuilder.list.columnActions", "Actions") })
|
|
159
150
|
] }) }),
|
|
160
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
161
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
151
|
+
/* @__PURE__ */ jsxRuntime.jsx(table.TableBody, { children: forms.map((form) => /* @__PURE__ */ jsxRuntime.jsxs(table.TableRow, { className: classNames?.tableRow, children: [
|
|
152
|
+
/* @__PURE__ */ jsxRuntime.jsx(table.TableCell, { className: "font-medium", children: form.name }),
|
|
153
|
+
/* @__PURE__ */ jsxRuntime.jsx(table.TableCell, { className: "text-muted-foreground font-mono text-sm", children: form.slug }),
|
|
154
|
+
/* @__PURE__ */ jsxRuntime.jsx(table.TableCell, { children: getStatusBadge(form.status) }),
|
|
155
|
+
/* @__PURE__ */ jsxRuntime.jsx(table.TableCell, { className: "text-muted-foreground", children: new Date(form.createdAt).toLocaleDateString() }),
|
|
156
|
+
/* @__PURE__ */ jsxRuntime.jsx(table.TableCell, { children: /* @__PURE__ */ jsxRuntime.jsxs(dropdownMenu.DropdownMenu, { children: [
|
|
157
|
+
/* @__PURE__ */ jsxRuntime.jsx(dropdownMenu.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(button.Button, { variant: "ghost", size: "icon", children: [
|
|
158
|
+
/* @__PURE__ */ jsxRuntime.jsx(LucideIcons.MoreHorizontal, { className: "h-4 w-4" }),
|
|
159
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: localization?.FORM_BUILDER_LIST_COLUMN_ACTIONS ?? t(
|
|
160
|
+
"formBuilder.list.columnActions",
|
|
161
|
+
"Actions"
|
|
162
|
+
) })
|
|
163
|
+
] }) }),
|
|
164
|
+
/* @__PURE__ */ jsxRuntime.jsxs(dropdownMenu.DropdownMenuContent, { align: "end", children: [
|
|
165
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
166
|
+
context.PermissionAccess,
|
|
171
167
|
{
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
formId: form.id,
|
|
188
|
-
formExists: true,
|
|
189
|
-
...form.createdBy ? { ownerId: form.createdBy } : {}
|
|
168
|
+
permission: plugins_formBuilder_permissions.formBuilderPermissions.form.update({
|
|
169
|
+
formId: form.id,
|
|
170
|
+
...form.createdBy ? { ownerId: form.createdBy } : {},
|
|
171
|
+
status: form.status
|
|
172
|
+
}),
|
|
173
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
174
|
+
dropdownMenu.DropdownMenuItem,
|
|
175
|
+
{
|
|
176
|
+
onClick: () => navigate("forms", form.id, "edit"),
|
|
177
|
+
children: [
|
|
178
|
+
/* @__PURE__ */ jsxRuntime.jsx(LucideIcons.Pencil, { className: "mr-2 h-4 w-4" }),
|
|
179
|
+
localization?.FORM_BUILDER_LIST_ACTION_EDIT ?? t("formBuilder.list.actionEdit", "Edit")
|
|
180
|
+
]
|
|
181
|
+
}
|
|
182
|
+
)
|
|
190
183
|
}
|
|
191
184
|
),
|
|
192
|
-
|
|
193
|
-
|
|
185
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
186
|
+
context.PermissionAccess,
|
|
194
187
|
{
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
188
|
+
permission: plugins_formBuilder_permissions.formBuilderPermissions.submission.read(
|
|
189
|
+
{
|
|
190
|
+
scope: "collection",
|
|
191
|
+
formId: form.id,
|
|
192
|
+
formExists: true,
|
|
193
|
+
...form.createdBy ? { ownerId: form.createdBy } : {}
|
|
194
|
+
}
|
|
195
|
+
),
|
|
196
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
197
|
+
dropdownMenu.DropdownMenuItem,
|
|
198
|
+
{
|
|
199
|
+
onClick: () => navigate("forms", form.id, "submissions"),
|
|
200
|
+
children: [
|
|
201
|
+
/* @__PURE__ */ jsxRuntime.jsx(LucideIcons.FileText, { className: "mr-2 h-4 w-4" }),
|
|
202
|
+
localization?.FORM_BUILDER_LIST_ACTION_SUBMISSIONS ?? t(
|
|
203
|
+
"formBuilder.list.actionSubmissions",
|
|
204
|
+
"Submissions"
|
|
205
|
+
)
|
|
206
|
+
]
|
|
207
|
+
}
|
|
208
|
+
)
|
|
203
209
|
}
|
|
204
|
-
)
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
208
|
-
context.PermissionAccess,
|
|
209
|
-
{
|
|
210
|
-
permission: plugins_formBuilder_permissions.formBuilderPermissions.form.delete({
|
|
211
|
-
formId: form.id,
|
|
212
|
-
...form.createdBy ? { ownerId: form.createdBy } : {},
|
|
213
|
-
status: form.status
|
|
214
|
-
}),
|
|
215
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
216
|
-
dropdownMenu.DropdownMenuItem,
|
|
210
|
+
),
|
|
211
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
212
|
+
context.PermissionAccess,
|
|
217
213
|
{
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
214
|
+
permission: plugins_formBuilder_permissions.formBuilderPermissions.form.delete({
|
|
215
|
+
formId: form.id,
|
|
216
|
+
...form.createdBy ? { ownerId: form.createdBy } : {},
|
|
217
|
+
status: form.status
|
|
218
|
+
}),
|
|
219
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
220
|
+
dropdownMenu.DropdownMenuItem,
|
|
221
|
+
{
|
|
222
|
+
className: "text-destructive",
|
|
223
|
+
onClick: () => setDeleteId(form.id),
|
|
224
|
+
children: [
|
|
225
|
+
/* @__PURE__ */ jsxRuntime.jsx(LucideIcons.Trash2, { className: "mr-2 h-4 w-4" }),
|
|
226
|
+
localization?.FORM_BUILDER_LIST_ACTION_DELETE ?? t("formBuilder.list.actionDelete", "Delete")
|
|
227
|
+
]
|
|
228
|
+
}
|
|
229
|
+
)
|
|
224
230
|
}
|
|
225
231
|
)
|
|
226
|
-
}
|
|
227
|
-
)
|
|
228
|
-
] })
|
|
229
|
-
] })
|
|
230
|
-
|
|
231
|
-
|
|
232
|
+
] })
|
|
233
|
+
] }) })
|
|
234
|
+
] }, form.id)) })
|
|
235
|
+
] })
|
|
236
|
+
}
|
|
237
|
+
),
|
|
232
238
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
233
239
|
pagination.Pagination,
|
|
234
240
|
{
|
|
@@ -237,6 +243,7 @@ function FormListPage() {
|
|
|
237
243
|
hasMore,
|
|
238
244
|
isLoadingMore,
|
|
239
245
|
onLoadMore: loadMore,
|
|
246
|
+
className: classNames?.pagination,
|
|
240
247
|
labels: {
|
|
241
248
|
showing: localization?.FORM_BUILDER_LIST_PAGINATION_SHOWING ?? t(
|
|
242
249
|
"formBuilder.list.paginationShowing",
|
|
@@ -14,6 +14,7 @@ import { EmptyState } from '../shared/empty-state.mjs';
|
|
|
14
14
|
import { Pagination } from '../shared/pagination.mjs';
|
|
15
15
|
import { formBuilderPermissions } from '../../../../../../../../plugins/form-builder/permissions.mjs';
|
|
16
16
|
import { FORM_BUILDER_PLUGIN_ID } from '../../constants.mjs';
|
|
17
|
+
import { cn } from '../../../utils.mjs';
|
|
17
18
|
import { useSuspenseForms, useForms, useDeleteForm } from '../../hooks/form-builder-hooks.mjs';
|
|
18
19
|
|
|
19
20
|
const LIST_STATE_SCHEMA = {
|
|
@@ -23,9 +24,7 @@ const SEARCH_DEBOUNCE_MS = 300;
|
|
|
23
24
|
function FormListPage() {
|
|
24
25
|
const t = useTranslate();
|
|
25
26
|
const notify = useNotify();
|
|
26
|
-
const { localization } = usePluginOverrides(
|
|
27
|
-
FORM_BUILDER_PLUGIN_ID
|
|
28
|
-
);
|
|
27
|
+
const { localization, classNames } = usePluginOverrides(FORM_BUILDER_PLUGIN_ID);
|
|
29
28
|
const { Link, navigate, resolve } = usePluginSiteNavigation(
|
|
30
29
|
FORM_BUILDER_PLUGIN_ID
|
|
31
30
|
);
|
|
@@ -134,99 +133,106 @@ function FormListPage() {
|
|
|
134
133
|
action: newFormButton
|
|
135
134
|
}
|
|
136
135
|
) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
137
|
-
/* @__PURE__ */ jsx(
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
/* @__PURE__ */
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
/* @__PURE__ */ jsx(TableCell, { className: "text-muted-foreground", children: new Date(form.createdAt).toLocaleDateString() }),
|
|
150
|
-
/* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
151
|
-
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { variant: "ghost", size: "icon", children: [
|
|
152
|
-
/* @__PURE__ */ jsx(MoreHorizontal, { className: "h-4 w-4" }),
|
|
153
|
-
/* @__PURE__ */ jsx("span", { className: "sr-only", children: localization?.FORM_BUILDER_LIST_COLUMN_ACTIONS ?? t(
|
|
154
|
-
"formBuilder.list.columnActions",
|
|
155
|
-
"Actions"
|
|
156
|
-
) })
|
|
136
|
+
/* @__PURE__ */ jsx(
|
|
137
|
+
"div",
|
|
138
|
+
{
|
|
139
|
+
className: cn("rounded-lg border", classNames?.table),
|
|
140
|
+
"data-testid": "form-builder-list-table",
|
|
141
|
+
children: /* @__PURE__ */ jsxs(Table, { children: [
|
|
142
|
+
/* @__PURE__ */ jsx(TableHeader, { children: /* @__PURE__ */ jsxs(TableRow, { children: [
|
|
143
|
+
/* @__PURE__ */ jsx(TableHead, { children: localization?.FORM_BUILDER_LIST_COLUMN_NAME ?? t("formBuilder.list.columnName", "Name") }),
|
|
144
|
+
/* @__PURE__ */ jsx(TableHead, { children: localization?.FORM_BUILDER_LIST_COLUMN_SLUG ?? t("formBuilder.list.columnSlug", "Slug") }),
|
|
145
|
+
/* @__PURE__ */ jsx(TableHead, { children: localization?.FORM_BUILDER_LIST_COLUMN_STATUS ?? t("formBuilder.list.columnStatus", "Status") }),
|
|
146
|
+
/* @__PURE__ */ jsx(TableHead, { children: localization?.FORM_BUILDER_LIST_COLUMN_CREATED ?? t("formBuilder.list.columnCreated", "Created") }),
|
|
147
|
+
/* @__PURE__ */ jsx(TableHead, { className: "w-12", children: localization?.FORM_BUILDER_LIST_COLUMN_ACTIONS ?? t("formBuilder.list.columnActions", "Actions") })
|
|
157
148
|
] }) }),
|
|
158
|
-
/* @__PURE__ */ jsxs(
|
|
159
|
-
/* @__PURE__ */ jsx(
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
149
|
+
/* @__PURE__ */ jsx(TableBody, { children: forms.map((form) => /* @__PURE__ */ jsxs(TableRow, { className: classNames?.tableRow, children: [
|
|
150
|
+
/* @__PURE__ */ jsx(TableCell, { className: "font-medium", children: form.name }),
|
|
151
|
+
/* @__PURE__ */ jsx(TableCell, { className: "text-muted-foreground font-mono text-sm", children: form.slug }),
|
|
152
|
+
/* @__PURE__ */ jsx(TableCell, { children: getStatusBadge(form.status) }),
|
|
153
|
+
/* @__PURE__ */ jsx(TableCell, { className: "text-muted-foreground", children: new Date(form.createdAt).toLocaleDateString() }),
|
|
154
|
+
/* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
155
|
+
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { variant: "ghost", size: "icon", children: [
|
|
156
|
+
/* @__PURE__ */ jsx(MoreHorizontal, { className: "h-4 w-4" }),
|
|
157
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: localization?.FORM_BUILDER_LIST_COLUMN_ACTIONS ?? t(
|
|
158
|
+
"formBuilder.list.columnActions",
|
|
159
|
+
"Actions"
|
|
160
|
+
) })
|
|
161
|
+
] }) }),
|
|
162
|
+
/* @__PURE__ */ jsxs(DropdownMenuContent, { align: "end", children: [
|
|
163
|
+
/* @__PURE__ */ jsx(
|
|
164
|
+
PermissionAccess,
|
|
169
165
|
{
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
formId: form.id,
|
|
186
|
-
formExists: true,
|
|
187
|
-
...form.createdBy ? { ownerId: form.createdBy } : {}
|
|
166
|
+
permission: formBuilderPermissions.form.update({
|
|
167
|
+
formId: form.id,
|
|
168
|
+
...form.createdBy ? { ownerId: form.createdBy } : {},
|
|
169
|
+
status: form.status
|
|
170
|
+
}),
|
|
171
|
+
children: /* @__PURE__ */ jsxs(
|
|
172
|
+
DropdownMenuItem,
|
|
173
|
+
{
|
|
174
|
+
onClick: () => navigate("forms", form.id, "edit"),
|
|
175
|
+
children: [
|
|
176
|
+
/* @__PURE__ */ jsx(Pencil, { className: "mr-2 h-4 w-4" }),
|
|
177
|
+
localization?.FORM_BUILDER_LIST_ACTION_EDIT ?? t("formBuilder.list.actionEdit", "Edit")
|
|
178
|
+
]
|
|
179
|
+
}
|
|
180
|
+
)
|
|
188
181
|
}
|
|
189
182
|
),
|
|
190
|
-
|
|
191
|
-
|
|
183
|
+
/* @__PURE__ */ jsx(
|
|
184
|
+
PermissionAccess,
|
|
192
185
|
{
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
186
|
+
permission: formBuilderPermissions.submission.read(
|
|
187
|
+
{
|
|
188
|
+
scope: "collection",
|
|
189
|
+
formId: form.id,
|
|
190
|
+
formExists: true,
|
|
191
|
+
...form.createdBy ? { ownerId: form.createdBy } : {}
|
|
192
|
+
}
|
|
193
|
+
),
|
|
194
|
+
children: /* @__PURE__ */ jsxs(
|
|
195
|
+
DropdownMenuItem,
|
|
196
|
+
{
|
|
197
|
+
onClick: () => navigate("forms", form.id, "submissions"),
|
|
198
|
+
children: [
|
|
199
|
+
/* @__PURE__ */ jsx(FileText, { className: "mr-2 h-4 w-4" }),
|
|
200
|
+
localization?.FORM_BUILDER_LIST_ACTION_SUBMISSIONS ?? t(
|
|
201
|
+
"formBuilder.list.actionSubmissions",
|
|
202
|
+
"Submissions"
|
|
203
|
+
)
|
|
204
|
+
]
|
|
205
|
+
}
|
|
206
|
+
)
|
|
201
207
|
}
|
|
202
|
-
)
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
/* @__PURE__ */ jsx(
|
|
206
|
-
PermissionAccess,
|
|
207
|
-
{
|
|
208
|
-
permission: formBuilderPermissions.form.delete({
|
|
209
|
-
formId: form.id,
|
|
210
|
-
...form.createdBy ? { ownerId: form.createdBy } : {},
|
|
211
|
-
status: form.status
|
|
212
|
-
}),
|
|
213
|
-
children: /* @__PURE__ */ jsxs(
|
|
214
|
-
DropdownMenuItem,
|
|
208
|
+
),
|
|
209
|
+
/* @__PURE__ */ jsx(
|
|
210
|
+
PermissionAccess,
|
|
215
211
|
{
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
212
|
+
permission: formBuilderPermissions.form.delete({
|
|
213
|
+
formId: form.id,
|
|
214
|
+
...form.createdBy ? { ownerId: form.createdBy } : {},
|
|
215
|
+
status: form.status
|
|
216
|
+
}),
|
|
217
|
+
children: /* @__PURE__ */ jsxs(
|
|
218
|
+
DropdownMenuItem,
|
|
219
|
+
{
|
|
220
|
+
className: "text-destructive",
|
|
221
|
+
onClick: () => setDeleteId(form.id),
|
|
222
|
+
children: [
|
|
223
|
+
/* @__PURE__ */ jsx(Trash2, { className: "mr-2 h-4 w-4" }),
|
|
224
|
+
localization?.FORM_BUILDER_LIST_ACTION_DELETE ?? t("formBuilder.list.actionDelete", "Delete")
|
|
225
|
+
]
|
|
226
|
+
}
|
|
227
|
+
)
|
|
222
228
|
}
|
|
223
229
|
)
|
|
224
|
-
}
|
|
225
|
-
)
|
|
226
|
-
] })
|
|
227
|
-
] })
|
|
228
|
-
|
|
229
|
-
|
|
230
|
+
] })
|
|
231
|
+
] }) })
|
|
232
|
+
] }, form.id)) })
|
|
233
|
+
] })
|
|
234
|
+
}
|
|
235
|
+
),
|
|
230
236
|
/* @__PURE__ */ jsx(
|
|
231
237
|
Pagination,
|
|
232
238
|
{
|
|
@@ -235,6 +241,7 @@ function FormListPage() {
|
|
|
235
241
|
hasMore,
|
|
236
242
|
isLoadingMore,
|
|
237
243
|
onLoadMore: loadMore,
|
|
244
|
+
className: classNames?.pagination,
|
|
238
245
|
labels: {
|
|
239
246
|
showing: localization?.FORM_BUILDER_LIST_PAGINATION_SHOWING ?? t(
|
|
240
247
|
"formBuilder.list.paginationShowing",
|