@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
|
@@ -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(
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
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
|
-
|
|
135
|
-
|
|
126
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
127
|
+
context.PermissionAccess,
|
|
136
128
|
{
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
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
|
-
|
|
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(
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
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
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
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
|
-
|
|
133
|
-
|
|
124
|
+
/* @__PURE__ */ jsx(
|
|
125
|
+
PermissionAccess,
|
|
134
126
|
{
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
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
|
-
|
|
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",
|
package/dist/packages/stack/src/plugins/form-builder/client/components/shared/page-wrapper.cjs
CHANGED
|
@@ -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
|
package/dist/packages/stack/src/plugins/form-builder/client/components/shared/page-wrapper.mjs
CHANGED
|
@@ -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
|
package/dist/packages/stack/src/plugins/form-builder/client/components/shared/pagination.cjs
CHANGED
|
@@ -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(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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;
|
package/dist/packages/stack/src/plugins/form-builder/client/components/shared/pagination.mjs
CHANGED
|
@@ -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(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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 };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { j as ChatInput, C as ChatInterface, f as ChatLayout, g as ChatLayoutProps, i as ChatMessage, h as ChatSidebar, k as ToolCallDisplay } from '../../../../shared/stack.
|
|
1
|
+
export { j as ChatInput, C as ChatInterface, f as ChatLayout, g as ChatLayoutProps, i as ChatMessage, h as ChatSidebar, k as ToolCallDisplay } from '../../../../shared/stack.rVF0f509.cjs';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
import { FallbackProps } from 'react-error-boundary';
|
|
4
4
|
import 'ai';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { j as ChatInput, C as ChatInterface, f as ChatLayout, g as ChatLayoutProps, i as ChatMessage, h as ChatSidebar, k as ToolCallDisplay } from '../../../../shared/stack.
|
|
1
|
+
export { j as ChatInput, C as ChatInterface, f as ChatLayout, g as ChatLayoutProps, i as ChatMessage, h as ChatSidebar, k as ToolCallDisplay } from '../../../../shared/stack.rVF0f509.mjs';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
import { FallbackProps } from 'react-error-boundary';
|
|
4
4
|
import 'ai';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { j as ChatInput, C as ChatInterface, f as ChatLayout, g as ChatLayoutProps, i as ChatMessage, h as ChatSidebar, k as ToolCallDisplay } from '../../../../shared/stack.
|
|
1
|
+
export { j as ChatInput, C as ChatInterface, f as ChatLayout, g as ChatLayoutProps, i as ChatMessage, h as ChatSidebar, k as ToolCallDisplay } from '../../../../shared/stack.rVF0f509.js';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
import { FallbackProps } from 'react-error-boundary';
|
|
4
4
|
import 'ai';
|
|
@@ -3,8 +3,8 @@ import * as _btst_yar from '@btst/yar';
|
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import { ComponentType } from 'react';
|
|
5
5
|
import { S as SerializedConversation, a as SerializedMessage, A as AiChatIdentityPartition } from '../../../shared/stack.C4oVW2qK.cjs';
|
|
6
|
-
import { A as AiChatMode, a as AiChatPluginOverrides } from '../../../shared/stack.
|
|
7
|
-
export { b as AiChatProviderConfig, c as AllowedFileType, j as ChatInput, C as ChatInterface, f as ChatLayout, g as ChatLayoutProps, i as ChatMessage, h as ChatSidebar, D as DEFAULT_ALLOWED_FILE_TYPES, k as ToolCallDisplay, T as ToolCallProps, e as ToolCallRenderer, d as ToolCallState } from '../../../shared/stack.
|
|
6
|
+
import { A as AiChatMode, a as AiChatPluginOverrides } from '../../../shared/stack.rVF0f509.cjs';
|
|
7
|
+
export { b as AiChatProviderConfig, c as AllowedFileType, j as ChatInput, C as ChatInterface, f as ChatLayout, g as ChatLayoutProps, i as ChatMessage, h as ChatSidebar, D as DEFAULT_ALLOWED_FILE_TYPES, k as ToolCallDisplay, T as ToolCallProps, e as ToolCallRenderer, d as ToolCallState } from '../../../shared/stack.rVF0f509.cjs';
|
|
8
8
|
export { UIMessage } from 'ai';
|
|
9
9
|
import '@btst/stack/plugins/api';
|
|
10
10
|
import '@btst/stack/authorization';
|