@btst/stack 2.5.5 → 2.6.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 (101) hide show
  1. package/README.md +23 -0
  2. package/dist/client/components/index.d.cts +9 -9
  3. package/dist/client/components/index.d.mts +9 -9
  4. package/dist/client/components/index.d.ts +9 -9
  5. package/dist/packages/stack/src/plugins/ai-chat/client/components/shared/default-error.cjs +1 -1
  6. package/dist/packages/stack/src/plugins/ai-chat/client/components/shared/default-error.mjs +1 -1
  7. package/dist/packages/stack/src/plugins/ai-chat/client/plugin.cjs +44 -35
  8. package/dist/packages/stack/src/plugins/ai-chat/client/plugin.mjs +44 -35
  9. package/dist/packages/stack/src/plugins/blog/client/components/shared/default-error.cjs +1 -1
  10. package/dist/packages/stack/src/plugins/blog/client/components/shared/default-error.mjs +1 -1
  11. package/dist/packages/stack/src/plugins/blog/client/hooks/use-debounce.cjs +22 -0
  12. package/dist/packages/stack/src/plugins/blog/client/hooks/use-debounce.mjs +23 -2
  13. package/dist/packages/stack/src/plugins/blog/client/plugin.cjs +12 -6
  14. package/dist/packages/stack/src/plugins/blog/client/plugin.mjs +12 -6
  15. package/dist/packages/stack/src/plugins/cms/client/components/shared/default-error.cjs +1 -1
  16. package/dist/packages/stack/src/plugins/cms/client/components/shared/default-error.mjs +1 -1
  17. package/dist/packages/stack/src/plugins/cms/client/plugin.cjs +38 -26
  18. package/dist/packages/stack/src/plugins/cms/client/plugin.mjs +38 -26
  19. package/dist/packages/stack/src/plugins/form-builder/client/components/shared/default-error.cjs +1 -1
  20. package/dist/packages/stack/src/plugins/form-builder/client/components/shared/default-error.mjs +1 -1
  21. package/dist/packages/stack/src/plugins/form-builder/client/plugin.cjs +32 -20
  22. package/dist/packages/stack/src/plugins/form-builder/client/plugin.mjs +32 -20
  23. package/dist/packages/stack/src/plugins/kanban/client/components/shared/default-error.cjs +1 -1
  24. package/dist/packages/stack/src/plugins/kanban/client/components/shared/default-error.mjs +1 -1
  25. package/dist/packages/stack/src/plugins/kanban/client/plugin.cjs +6 -3
  26. package/dist/packages/stack/src/plugins/kanban/client/plugin.mjs +6 -3
  27. package/dist/packages/stack/src/plugins/ui-builder/client/components/page-renderer.cjs +1 -1
  28. package/dist/packages/stack/src/plugins/ui-builder/client/components/page-renderer.mjs +1 -1
  29. package/dist/packages/stack/src/plugins/ui-builder/client/components/pages/page-builder-page.internal.cjs +3 -1
  30. package/dist/packages/stack/src/plugins/ui-builder/client/components/pages/page-builder-page.internal.mjs +3 -1
  31. package/dist/packages/stack/src/plugins/ui-builder/client/components/shared/default-error.cjs +1 -1
  32. package/dist/packages/stack/src/plugins/ui-builder/client/components/shared/default-error.mjs +1 -1
  33. package/dist/packages/stack/src/plugins/ui-builder/client/plugin.cjs +24 -15
  34. package/dist/packages/stack/src/plugins/ui-builder/client/plugin.mjs +24 -15
  35. package/dist/packages/ui/src/components/search-select.cjs +13 -3
  36. package/dist/packages/ui/src/components/search-select.mjs +14 -4
  37. package/dist/plugins/ai-chat/client/index.d.cts +17 -4
  38. package/dist/plugins/ai-chat/client/index.d.mts +17 -4
  39. package/dist/plugins/ai-chat/client/index.d.ts +17 -4
  40. package/dist/plugins/blog/client/hooks/index.cjs +3 -0
  41. package/dist/plugins/blog/client/hooks/index.d.cts +7 -226
  42. package/dist/plugins/blog/client/hooks/index.d.mts +7 -226
  43. package/dist/plugins/blog/client/hooks/index.d.ts +7 -226
  44. package/dist/plugins/blog/client/hooks/index.mjs +1 -0
  45. package/dist/plugins/blog/client/index.d.cts +45 -21
  46. package/dist/plugins/blog/client/index.d.mts +45 -21
  47. package/dist/plugins/blog/client/index.d.ts +45 -21
  48. package/dist/plugins/cms/client/index.d.cts +35 -14
  49. package/dist/plugins/cms/client/index.d.mts +35 -14
  50. package/dist/plugins/cms/client/index.d.ts +35 -14
  51. package/dist/plugins/form-builder/client/components/index.d.cts +1 -1
  52. package/dist/plugins/form-builder/client/components/index.d.mts +1 -1
  53. package/dist/plugins/form-builder/client/components/index.d.ts +1 -1
  54. package/dist/plugins/form-builder/client/index.d.cts +32 -14
  55. package/dist/plugins/form-builder/client/index.d.mts +32 -14
  56. package/dist/plugins/form-builder/client/index.d.ts +32 -14
  57. package/dist/plugins/kanban/api/index.d.cts +1 -1
  58. package/dist/plugins/kanban/api/index.d.mts +1 -1
  59. package/dist/plugins/kanban/api/index.d.ts +1 -1
  60. package/dist/plugins/kanban/client/components/index.d.cts +5 -5
  61. package/dist/plugins/kanban/client/components/index.d.mts +5 -5
  62. package/dist/plugins/kanban/client/components/index.d.ts +5 -5
  63. package/dist/plugins/kanban/client/index.d.cts +25 -10
  64. package/dist/plugins/kanban/client/index.d.mts +25 -10
  65. package/dist/plugins/kanban/client/index.d.ts +25 -10
  66. package/dist/plugins/kanban/query-keys.d.cts +1 -1
  67. package/dist/plugins/kanban/query-keys.d.mts +1 -1
  68. package/dist/plugins/kanban/query-keys.d.ts +1 -1
  69. package/dist/plugins/route-docs/client/index.d.cts +4 -4
  70. package/dist/plugins/route-docs/client/index.d.mts +4 -4
  71. package/dist/plugins/route-docs/client/index.d.ts +4 -4
  72. package/dist/plugins/ui-builder/client/components/index.d.cts +1 -1
  73. package/dist/plugins/ui-builder/client/components/index.d.mts +1 -1
  74. package/dist/plugins/ui-builder/client/components/index.d.ts +1 -1
  75. package/dist/plugins/ui-builder/client/index.d.cts +35 -16
  76. package/dist/plugins/ui-builder/client/index.d.mts +35 -16
  77. package/dist/plugins/ui-builder/client/index.d.ts +35 -16
  78. package/dist/shared/stack.CNLHlv7r.d.mts +228 -0
  79. package/dist/shared/stack.CQAZwXhV.d.cts +228 -0
  80. package/dist/shared/stack.D3BsrpAz.d.ts +228 -0
  81. package/package.json +19 -2
  82. package/src/__tests__/page-component-overrides.test.tsx +147 -0
  83. package/src/plugins/ai-chat/client/components/shared/default-error.tsx +1 -1
  84. package/src/plugins/ai-chat/client/plugin.tsx +60 -32
  85. package/src/plugins/blog/client/components/shared/default-error.tsx +2 -1
  86. package/src/plugins/blog/client/hooks/index.tsx +1 -0
  87. package/src/plugins/blog/client/plugin.tsx +41 -6
  88. package/src/plugins/cms/client/components/shared/default-error.tsx +3 -2
  89. package/src/plugins/cms/client/plugin.tsx +65 -32
  90. package/src/plugins/form-builder/client/components/shared/default-error.tsx +3 -2
  91. package/src/plugins/form-builder/client/plugin.tsx +56 -23
  92. package/src/plugins/kanban/client/components/shared/default-error.tsx +3 -2
  93. package/src/plugins/kanban/client/plugin.tsx +23 -3
  94. package/src/plugins/ui-builder/client/components/page-renderer.tsx +5 -3
  95. package/src/plugins/ui-builder/client/components/pages/page-builder-page.internal.tsx +2 -0
  96. package/src/plugins/ui-builder/client/components/shared/default-error.tsx +3 -2
  97. package/src/plugins/ui-builder/client/overrides.ts +10 -1
  98. package/src/plugins/ui-builder/client/plugin.tsx +41 -15
  99. package/dist/shared/{stack.CxNeGV2z.d.mts → stack.Ba_Ks8qi.d.mts} +9 -9
  100. package/dist/shared/{stack.DSxTDZBQ.d.cts → stack.CFqqZUes.d.cts} +9 -9
  101. package/dist/shared/{stack.BFcg0tDz.d.ts → stack.DMobugrZ.d.ts} +9 -9
@@ -251,32 +251,44 @@ function createContentEditorMeta(typeSlug, id, config) {
251
251
  const cmsClientPlugin = (config) => client.defineClientPlugin({
252
252
  name: "cms",
253
253
  routes: () => ({
254
- dashboard: yar.createRoute("/cms", () => ({
255
- PageComponent: () => /* @__PURE__ */ jsxRuntime.jsx(DashboardPageComponent, {}),
256
- loader: createDashboardLoader(config),
257
- meta: createDashboardMeta()
258
- })),
259
- contentList: yar.createRoute("/cms/:typeSlug", ({ params }) => ({
260
- PageComponent: () => /* @__PURE__ */ jsxRuntime.jsx(ContentListPageComponent, { typeSlug: params.typeSlug }),
261
- loader: createContentListLoader(params.typeSlug, config),
262
- meta: createContentListMeta(params.typeSlug, config)
263
- })),
264
- newContent: yar.createRoute("/cms/:typeSlug/new", ({ params }) => ({
265
- PageComponent: () => /* @__PURE__ */ jsxRuntime.jsx(ContentEditorPageComponent, { typeSlug: params.typeSlug }),
266
- loader: createContentEditorLoader(params.typeSlug, void 0, config),
267
- meta: createContentEditorMeta(params.typeSlug, void 0, config)
268
- })),
269
- editContent: yar.createRoute("/cms/:typeSlug/:id", ({ params }) => ({
270
- PageComponent: () => /* @__PURE__ */ jsxRuntime.jsx(
271
- ContentEditorPageComponent,
272
- {
273
- typeSlug: params.typeSlug,
274
- id: params.id
275
- }
276
- ),
277
- loader: createContentEditorLoader(params.typeSlug, params.id, config),
278
- meta: createContentEditorMeta(params.typeSlug, params.id, config)
279
- }))
254
+ dashboard: yar.createRoute("/cms", () => {
255
+ const CustomDashboard = config.pageComponents?.dashboard;
256
+ return {
257
+ PageComponent: CustomDashboard ?? (() => /* @__PURE__ */ jsxRuntime.jsx(DashboardPageComponent, {})),
258
+ loader: createDashboardLoader(config),
259
+ meta: createDashboardMeta()
260
+ };
261
+ }),
262
+ contentList: yar.createRoute("/cms/:typeSlug", ({ params }) => {
263
+ const CustomContentList = config.pageComponents?.contentList;
264
+ return {
265
+ PageComponent: CustomContentList ? () => /* @__PURE__ */ jsxRuntime.jsx(CustomContentList, { typeSlug: params.typeSlug }) : () => /* @__PURE__ */ jsxRuntime.jsx(ContentListPageComponent, { typeSlug: params.typeSlug }),
266
+ loader: createContentListLoader(params.typeSlug, config),
267
+ meta: createContentListMeta(params.typeSlug, config)
268
+ };
269
+ }),
270
+ newContent: yar.createRoute("/cms/:typeSlug/new", ({ params }) => {
271
+ const CustomNewContent = config.pageComponents?.newContent;
272
+ return {
273
+ PageComponent: CustomNewContent ? () => /* @__PURE__ */ jsxRuntime.jsx(CustomNewContent, { typeSlug: params.typeSlug }) : () => /* @__PURE__ */ jsxRuntime.jsx(ContentEditorPageComponent, { typeSlug: params.typeSlug }),
274
+ loader: createContentEditorLoader(params.typeSlug, void 0, config),
275
+ meta: createContentEditorMeta(params.typeSlug, void 0, config)
276
+ };
277
+ }),
278
+ editContent: yar.createRoute("/cms/:typeSlug/:id", ({ params }) => {
279
+ const CustomEditContent = config.pageComponents?.editContent;
280
+ return {
281
+ PageComponent: CustomEditContent ? () => /* @__PURE__ */ jsxRuntime.jsx(CustomEditContent, { typeSlug: params.typeSlug, id: params.id }) : () => /* @__PURE__ */ jsxRuntime.jsx(
282
+ ContentEditorPageComponent,
283
+ {
284
+ typeSlug: params.typeSlug,
285
+ id: params.id
286
+ }
287
+ ),
288
+ loader: createContentEditorLoader(params.typeSlug, params.id, config),
289
+ meta: createContentEditorMeta(params.typeSlug, params.id, config)
290
+ };
291
+ })
280
292
  }),
281
293
  sitemap: async () => {
282
294
  return [];
@@ -249,32 +249,44 @@ function createContentEditorMeta(typeSlug, id, config) {
249
249
  const cmsClientPlugin = (config) => defineClientPlugin({
250
250
  name: "cms",
251
251
  routes: () => ({
252
- dashboard: createRoute("/cms", () => ({
253
- PageComponent: () => /* @__PURE__ */ jsx(DashboardPageComponent, {}),
254
- loader: createDashboardLoader(config),
255
- meta: createDashboardMeta()
256
- })),
257
- contentList: createRoute("/cms/:typeSlug", ({ params }) => ({
258
- PageComponent: () => /* @__PURE__ */ jsx(ContentListPageComponent, { typeSlug: params.typeSlug }),
259
- loader: createContentListLoader(params.typeSlug, config),
260
- meta: createContentListMeta(params.typeSlug, config)
261
- })),
262
- newContent: createRoute("/cms/:typeSlug/new", ({ params }) => ({
263
- PageComponent: () => /* @__PURE__ */ jsx(ContentEditorPageComponent, { typeSlug: params.typeSlug }),
264
- loader: createContentEditorLoader(params.typeSlug, void 0, config),
265
- meta: createContentEditorMeta(params.typeSlug, void 0, config)
266
- })),
267
- editContent: createRoute("/cms/:typeSlug/:id", ({ params }) => ({
268
- PageComponent: () => /* @__PURE__ */ jsx(
269
- ContentEditorPageComponent,
270
- {
271
- typeSlug: params.typeSlug,
272
- id: params.id
273
- }
274
- ),
275
- loader: createContentEditorLoader(params.typeSlug, params.id, config),
276
- meta: createContentEditorMeta(params.typeSlug, params.id, config)
277
- }))
252
+ dashboard: createRoute("/cms", () => {
253
+ const CustomDashboard = config.pageComponents?.dashboard;
254
+ return {
255
+ PageComponent: CustomDashboard ?? (() => /* @__PURE__ */ jsx(DashboardPageComponent, {})),
256
+ loader: createDashboardLoader(config),
257
+ meta: createDashboardMeta()
258
+ };
259
+ }),
260
+ contentList: createRoute("/cms/:typeSlug", ({ params }) => {
261
+ const CustomContentList = config.pageComponents?.contentList;
262
+ return {
263
+ PageComponent: CustomContentList ? () => /* @__PURE__ */ jsx(CustomContentList, { typeSlug: params.typeSlug }) : () => /* @__PURE__ */ jsx(ContentListPageComponent, { typeSlug: params.typeSlug }),
264
+ loader: createContentListLoader(params.typeSlug, config),
265
+ meta: createContentListMeta(params.typeSlug, config)
266
+ };
267
+ }),
268
+ newContent: createRoute("/cms/:typeSlug/new", ({ params }) => {
269
+ const CustomNewContent = config.pageComponents?.newContent;
270
+ return {
271
+ PageComponent: CustomNewContent ? () => /* @__PURE__ */ jsx(CustomNewContent, { typeSlug: params.typeSlug }) : () => /* @__PURE__ */ jsx(ContentEditorPageComponent, { typeSlug: params.typeSlug }),
272
+ loader: createContentEditorLoader(params.typeSlug, void 0, config),
273
+ meta: createContentEditorMeta(params.typeSlug, void 0, config)
274
+ };
275
+ }),
276
+ editContent: createRoute("/cms/:typeSlug/:id", ({ params }) => {
277
+ const CustomEditContent = config.pageComponents?.editContent;
278
+ return {
279
+ PageComponent: CustomEditContent ? () => /* @__PURE__ */ jsx(CustomEditContent, { typeSlug: params.typeSlug, id: params.id }) : () => /* @__PURE__ */ jsx(
280
+ ContentEditorPageComponent,
281
+ {
282
+ typeSlug: params.typeSlug,
283
+ id: params.id
284
+ }
285
+ ),
286
+ loader: createContentEditorLoader(params.typeSlug, params.id, config),
287
+ meta: createContentEditorMeta(params.typeSlug, params.id, config)
288
+ };
289
+ })
278
290
  }),
279
291
  sitemap: async () => {
280
292
  return [];
@@ -9,7 +9,7 @@ function DefaultError({ error, resetErrorBoundary }) {
9
9
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center py-12 px-4 text-center", children: [
10
10
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-full bg-destructive/10 p-4 mb-4", children: /* @__PURE__ */ jsxRuntime.jsx(LucideIcons.AlertCircle, { className: "h-8 w-8 text-destructive" }) }),
11
11
  /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-lg font-medium text-foreground mb-2", children: "Something went wrong" }),
12
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground mb-4 max-w-sm", children: error.message || "An unexpected error occurred" }),
12
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground mb-4 max-w-sm", children: (error instanceof Error ? error.message : void 0) || "An unexpected error occurred" }),
13
13
  resetErrorBoundary && /* @__PURE__ */ jsxRuntime.jsx(button.Button, { variant: "outline", onClick: resetErrorBoundary, children: "Try again" })
14
14
  ] });
15
15
  }
@@ -7,7 +7,7 @@ function DefaultError({ error, resetErrorBoundary }) {
7
7
  return /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center py-12 px-4 text-center", children: [
8
8
  /* @__PURE__ */ jsx("div", { className: "rounded-full bg-destructive/10 p-4 mb-4", children: /* @__PURE__ */ jsx(AlertCircle, { className: "h-8 w-8 text-destructive" }) }),
9
9
  /* @__PURE__ */ jsx("h3", { className: "text-lg font-medium text-foreground mb-2", children: "Something went wrong" }),
10
- /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mb-4 max-w-sm", children: error.message || "An unexpected error occurred" }),
10
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mb-4 max-w-sm", children: (error instanceof Error ? error.message : void 0) || "An unexpected error occurred" }),
11
11
  resetErrorBoundary && /* @__PURE__ */ jsx(Button, { variant: "outline", onClick: resetErrorBoundary, children: "Try again" })
12
12
  ] });
13
13
  }
@@ -264,26 +264,38 @@ function createSubmissionsMeta(formId, config) {
264
264
  const formBuilderClientPlugin = (config) => client.defineClientPlugin({
265
265
  name: "form-builder",
266
266
  routes: () => ({
267
- formList: yar.createRoute("/forms", () => ({
268
- PageComponent: () => /* @__PURE__ */ jsxRuntime.jsx(FormListPageComponent, {}),
269
- loader: createFormListLoader(config),
270
- meta: createFormListMeta()
271
- })),
272
- newForm: yar.createRoute("/forms/new", () => ({
273
- PageComponent: () => /* @__PURE__ */ jsxRuntime.jsx(FormBuilderPageComponent, {}),
274
- loader: createFormBuilderLoader(void 0, config),
275
- meta: createFormBuilderMeta(void 0, config)
276
- })),
277
- editForm: yar.createRoute("/forms/:id/edit", ({ params }) => ({
278
- PageComponent: () => /* @__PURE__ */ jsxRuntime.jsx(FormBuilderPageComponent, { id: params.id }),
279
- loader: createFormBuilderLoader(params.id, config),
280
- meta: createFormBuilderMeta(params.id, config)
281
- })),
282
- submissions: yar.createRoute("/forms/:id/submissions", ({ params }) => ({
283
- PageComponent: () => /* @__PURE__ */ jsxRuntime.jsx(SubmissionsPageComponent, { formId: params.id }),
284
- loader: createSubmissionsLoader(params.id, config),
285
- meta: createSubmissionsMeta(params.id, config)
286
- }))
267
+ formList: yar.createRoute("/forms", () => {
268
+ const CustomFormList = config.pageComponents?.formList;
269
+ return {
270
+ PageComponent: CustomFormList ?? (() => /* @__PURE__ */ jsxRuntime.jsx(FormListPageComponent, {})),
271
+ loader: createFormListLoader(config),
272
+ meta: createFormListMeta()
273
+ };
274
+ }),
275
+ newForm: yar.createRoute("/forms/new", () => {
276
+ const CustomNewForm = config.pageComponents?.newForm;
277
+ return {
278
+ PageComponent: CustomNewForm ?? (() => /* @__PURE__ */ jsxRuntime.jsx(FormBuilderPageComponent, {})),
279
+ loader: createFormBuilderLoader(void 0, config),
280
+ meta: createFormBuilderMeta(void 0, config)
281
+ };
282
+ }),
283
+ editForm: yar.createRoute("/forms/:id/edit", ({ params }) => {
284
+ const CustomEditForm = config.pageComponents?.editForm;
285
+ return {
286
+ PageComponent: CustomEditForm ? () => /* @__PURE__ */ jsxRuntime.jsx(CustomEditForm, { id: params.id }) : () => /* @__PURE__ */ jsxRuntime.jsx(FormBuilderPageComponent, { id: params.id }),
287
+ loader: createFormBuilderLoader(params.id, config),
288
+ meta: createFormBuilderMeta(params.id, config)
289
+ };
290
+ }),
291
+ submissions: yar.createRoute("/forms/:id/submissions", ({ params }) => {
292
+ const CustomSubmissions = config.pageComponents?.submissions;
293
+ return {
294
+ PageComponent: CustomSubmissions ? () => /* @__PURE__ */ jsxRuntime.jsx(CustomSubmissions, { formId: params.id }) : () => /* @__PURE__ */ jsxRuntime.jsx(SubmissionsPageComponent, { formId: params.id }),
295
+ loader: createSubmissionsLoader(params.id, config),
296
+ meta: createSubmissionsMeta(params.id, config)
297
+ };
298
+ })
287
299
  }),
288
300
  sitemap: async () => {
289
301
  return [];
@@ -262,26 +262,38 @@ function createSubmissionsMeta(formId, config) {
262
262
  const formBuilderClientPlugin = (config) => defineClientPlugin({
263
263
  name: "form-builder",
264
264
  routes: () => ({
265
- formList: createRoute("/forms", () => ({
266
- PageComponent: () => /* @__PURE__ */ jsx(FormListPageComponent, {}),
267
- loader: createFormListLoader(config),
268
- meta: createFormListMeta()
269
- })),
270
- newForm: createRoute("/forms/new", () => ({
271
- PageComponent: () => /* @__PURE__ */ jsx(FormBuilderPageComponent, {}),
272
- loader: createFormBuilderLoader(void 0, config),
273
- meta: createFormBuilderMeta(void 0, config)
274
- })),
275
- editForm: createRoute("/forms/:id/edit", ({ params }) => ({
276
- PageComponent: () => /* @__PURE__ */ jsx(FormBuilderPageComponent, { id: params.id }),
277
- loader: createFormBuilderLoader(params.id, config),
278
- meta: createFormBuilderMeta(params.id, config)
279
- })),
280
- submissions: createRoute("/forms/:id/submissions", ({ params }) => ({
281
- PageComponent: () => /* @__PURE__ */ jsx(SubmissionsPageComponent, { formId: params.id }),
282
- loader: createSubmissionsLoader(params.id, config),
283
- meta: createSubmissionsMeta(params.id, config)
284
- }))
265
+ formList: createRoute("/forms", () => {
266
+ const CustomFormList = config.pageComponents?.formList;
267
+ return {
268
+ PageComponent: CustomFormList ?? (() => /* @__PURE__ */ jsx(FormListPageComponent, {})),
269
+ loader: createFormListLoader(config),
270
+ meta: createFormListMeta()
271
+ };
272
+ }),
273
+ newForm: createRoute("/forms/new", () => {
274
+ const CustomNewForm = config.pageComponents?.newForm;
275
+ return {
276
+ PageComponent: CustomNewForm ?? (() => /* @__PURE__ */ jsx(FormBuilderPageComponent, {})),
277
+ loader: createFormBuilderLoader(void 0, config),
278
+ meta: createFormBuilderMeta(void 0, config)
279
+ };
280
+ }),
281
+ editForm: createRoute("/forms/:id/edit", ({ params }) => {
282
+ const CustomEditForm = config.pageComponents?.editForm;
283
+ return {
284
+ PageComponent: CustomEditForm ? () => /* @__PURE__ */ jsx(CustomEditForm, { id: params.id }) : () => /* @__PURE__ */ jsx(FormBuilderPageComponent, { id: params.id }),
285
+ loader: createFormBuilderLoader(params.id, config),
286
+ meta: createFormBuilderMeta(params.id, config)
287
+ };
288
+ }),
289
+ submissions: createRoute("/forms/:id/submissions", ({ params }) => {
290
+ const CustomSubmissions = config.pageComponents?.submissions;
291
+ return {
292
+ PageComponent: CustomSubmissions ? () => /* @__PURE__ */ jsx(CustomSubmissions, { formId: params.id }) : () => /* @__PURE__ */ jsx(SubmissionsPageComponent, { formId: params.id }),
293
+ loader: createSubmissionsLoader(params.id, config),
294
+ meta: createSubmissionsMeta(params.id, config)
295
+ };
296
+ })
285
297
  }),
286
298
  sitemap: async () => {
287
299
  return [];
@@ -14,7 +14,7 @@ function DefaultError({ error, reset }) {
14
14
  children: [
15
15
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-full bg-destructive/10 p-6 mb-4", children: /* @__PURE__ */ jsxRuntime.jsx(LucideIcons.AlertCircle, { className: "h-8 w-8 text-destructive" }) }),
16
16
  /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-lg font-semibold mb-2", children: "Something went wrong" }),
17
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground max-w-md mb-4", children: error?.message || "An unexpected error occurred. Please try again." }),
17
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground max-w-md mb-4", children: (error instanceof Error ? error.message : void 0) || "An unexpected error occurred. Please try again." }),
18
18
  reset && /* @__PURE__ */ jsxRuntime.jsxs(button.Button, { onClick: reset, variant: "outline", children: [
19
19
  /* @__PURE__ */ jsxRuntime.jsx(LucideIcons.RefreshCw, { className: "mr-2 h-4 w-4" }),
20
20
  "Try Again"
@@ -12,7 +12,7 @@ function DefaultError({ error, reset }) {
12
12
  children: [
13
13
  /* @__PURE__ */ jsx("div", { className: "rounded-full bg-destructive/10 p-6 mb-4", children: /* @__PURE__ */ jsx(AlertCircle, { className: "h-8 w-8 text-destructive" }) }),
14
14
  /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold mb-2", children: "Something went wrong" }),
15
- /* @__PURE__ */ jsx("p", { className: "text-muted-foreground max-w-md mb-4", children: error?.message || "An unexpected error occurred. Please try again." }),
15
+ /* @__PURE__ */ jsx("p", { className: "text-muted-foreground max-w-md mb-4", children: (error instanceof Error ? error.message : void 0) || "An unexpected error occurred. Please try again." }),
16
16
  reset && /* @__PURE__ */ jsxs(Button, { onClick: reset, variant: "outline", children: [
17
17
  /* @__PURE__ */ jsx(RefreshCw, { className: "mr-2 h-4 w-4" }),
18
18
  "Try Again"
@@ -235,22 +235,25 @@ const kanbanClientPlugin = (config) => client.defineClientPlugin({
235
235
  name: "kanban",
236
236
  routes: () => ({
237
237
  boards: yar.createRoute("/kanban", () => {
238
+ const CustomBoards = config.pageComponents?.boards;
238
239
  return {
239
- PageComponent: () => /* @__PURE__ */ jsxRuntime.jsx(boardsListPage.BoardsListPageComponent, {}),
240
+ PageComponent: CustomBoards ?? (() => /* @__PURE__ */ jsxRuntime.jsx(boardsListPage.BoardsListPageComponent, {})),
240
241
  loader: createBoardsLoader(config),
241
242
  meta: createBoardsListMeta(config)
242
243
  };
243
244
  }),
244
245
  newBoard: yar.createRoute("/kanban/new", () => {
246
+ const CustomNewBoard = config.pageComponents?.newBoard;
245
247
  return {
246
- PageComponent: newBoardPage.NewBoardPageComponent,
248
+ PageComponent: CustomNewBoard ?? newBoardPage.NewBoardPageComponent,
247
249
  loader: createNewBoardLoader(config),
248
250
  meta: createNewBoardMeta(config)
249
251
  };
250
252
  }),
251
253
  board: yar.createRoute("/kanban/:boardId", ({ params: { boardId } }) => {
254
+ const CustomBoard = config.pageComponents?.board;
252
255
  return {
253
- PageComponent: () => /* @__PURE__ */ jsxRuntime.jsx(boardPage.BoardPageComponent, { boardId }),
256
+ PageComponent: CustomBoard ? () => /* @__PURE__ */ jsxRuntime.jsx(CustomBoard, { boardId }) : () => /* @__PURE__ */ jsxRuntime.jsx(boardPage.BoardPageComponent, { boardId }),
254
257
  loader: createBoardLoader(boardId, config),
255
258
  meta: createBoardMeta(boardId, config)
256
259
  };
@@ -233,22 +233,25 @@ const kanbanClientPlugin = (config) => defineClientPlugin({
233
233
  name: "kanban",
234
234
  routes: () => ({
235
235
  boards: createRoute("/kanban", () => {
236
+ const CustomBoards = config.pageComponents?.boards;
236
237
  return {
237
- PageComponent: () => /* @__PURE__ */ jsx(BoardsListPageComponent, {}),
238
+ PageComponent: CustomBoards ?? (() => /* @__PURE__ */ jsx(BoardsListPageComponent, {})),
238
239
  loader: createBoardsLoader(config),
239
240
  meta: createBoardsListMeta(config)
240
241
  };
241
242
  }),
242
243
  newBoard: createRoute("/kanban/new", () => {
244
+ const CustomNewBoard = config.pageComponents?.newBoard;
243
245
  return {
244
- PageComponent: NewBoardPageComponent,
246
+ PageComponent: CustomNewBoard ?? NewBoardPageComponent,
245
247
  loader: createNewBoardLoader(config),
246
248
  meta: createNewBoardMeta(config)
247
249
  };
248
250
  }),
249
251
  board: createRoute("/kanban/:boardId", ({ params: { boardId } }) => {
252
+ const CustomBoard = config.pageComponents?.board;
250
253
  return {
251
- PageComponent: () => /* @__PURE__ */ jsx(BoardPageComponent, { boardId }),
254
+ PageComponent: CustomBoard ? () => /* @__PURE__ */ jsx(CustomBoard, { boardId }) : () => /* @__PURE__ */ jsx(BoardPageComponent, { boardId }),
252
255
  loader: createBoardLoader(boardId, config),
253
256
  meta: createBoardMeta(boardId, config)
254
257
  };
@@ -15,7 +15,7 @@ function DefaultLoadingComponent() {
15
15
  function DefaultErrorComponent({ error }) {
16
16
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center min-h-[200px] p-4", children: [
17
17
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-destructive font-medium", children: index.uiBuilderLocalization.pageRenderer.error }),
18
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-muted-foreground mt-2", children: error.message })
18
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-muted-foreground mt-2", children: error instanceof Error ? error.message : String(error) })
19
19
  ] });
20
20
  }
21
21
  function DefaultNotFoundComponent() {
@@ -13,7 +13,7 @@ function DefaultLoadingComponent() {
13
13
  function DefaultErrorComponent({ error }) {
14
14
  return /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center min-h-[200px] p-4", children: [
15
15
  /* @__PURE__ */ jsx("div", { className: "text-destructive font-medium", children: uiBuilderLocalization.pageRenderer.error }),
16
- /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground mt-2", children: error.message })
16
+ /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground mt-2", children: error instanceof Error ? error.message : String(error) })
17
17
  ] });
18
18
  }
19
19
  function DefaultNotFoundComponent() {
@@ -118,7 +118,8 @@ function PageBuilderPageContent({
118
118
  const {
119
119
  navigate,
120
120
  Link,
121
- componentRegistry: customRegistry
121
+ componentRegistry: customRegistry,
122
+ functionRegistry
122
123
  } = context.usePluginOverrides("ui-builder");
123
124
  const basePath = context.useBasePath();
124
125
  const createMutation = uiBuilderHooks.useCreateUIBuilderPage();
@@ -298,6 +299,7 @@ function PageBuilderPageContent({
298
299
  initialVariables: existingVariables.length > 0 ? existingVariables : void 0,
299
300
  onVariablesChange: handleVariablesChange,
300
301
  componentRegistry,
302
+ functionRegistry,
301
303
  persistLayerStore: false,
302
304
  allowVariableEditing: true,
303
305
  allowPagesCreation: false,
@@ -116,7 +116,8 @@ function PageBuilderPageContent({
116
116
  const {
117
117
  navigate,
118
118
  Link,
119
- componentRegistry: customRegistry
119
+ componentRegistry: customRegistry,
120
+ functionRegistry
120
121
  } = usePluginOverrides("ui-builder");
121
122
  const basePath = useBasePath();
122
123
  const createMutation = useCreateUIBuilderPage();
@@ -296,6 +297,7 @@ function PageBuilderPageContent({
296
297
  initialVariables: existingVariables.length > 0 ? existingVariables : void 0,
297
298
  onVariablesChange: handleVariablesChange,
298
299
  componentRegistry,
300
+ functionRegistry,
299
301
  persistLayerStore: false,
300
302
  allowVariableEditing: true,
301
303
  allowPagesCreation: false,
@@ -9,7 +9,7 @@ function DefaultError({ error, resetErrorBoundary }) {
9
9
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center py-12 px-4 text-center", children: [
10
10
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-full bg-destructive/10 p-4 mb-4", children: /* @__PURE__ */ jsxRuntime.jsx(LucideIcons.AlertCircle, { className: "h-8 w-8 text-destructive" }) }),
11
11
  /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-lg font-medium text-foreground mb-2", children: "Something went wrong" }),
12
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground mb-4 max-w-sm", children: error.message || "An unexpected error occurred" }),
12
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground mb-4 max-w-sm", children: (error instanceof Error ? error.message : void 0) || "An unexpected error occurred" }),
13
13
  resetErrorBoundary && /* @__PURE__ */ jsxRuntime.jsx(button.Button, { variant: "outline", onClick: resetErrorBoundary, children: "Try again" })
14
14
  ] });
15
15
  }
@@ -7,7 +7,7 @@ function DefaultError({ error, resetErrorBoundary }) {
7
7
  return /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center py-12 px-4 text-center", children: [
8
8
  /* @__PURE__ */ jsx("div", { className: "rounded-full bg-destructive/10 p-4 mb-4", children: /* @__PURE__ */ jsx(AlertCircle, { className: "h-8 w-8 text-destructive" }) }),
9
9
  /* @__PURE__ */ jsx("h3", { className: "text-lg font-medium text-foreground mb-2", children: "Something went wrong" }),
10
- /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mb-4 max-w-sm", children: error.message || "An unexpected error occurred" }),
10
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mb-4 max-w-sm", children: (error instanceof Error ? error.message : void 0) || "An unexpected error occurred" }),
11
11
  resetErrorBoundary && /* @__PURE__ */ jsx(Button, { variant: "outline", onClick: resetErrorBoundary, children: "Try again" })
12
12
  ] });
13
13
  }
@@ -169,21 +169,30 @@ function createPageBuilderMeta(id, config) {
169
169
  const uiBuilderClientPlugin = (config) => client.defineClientPlugin({
170
170
  name: "ui-builder",
171
171
  routes: () => ({
172
- pageList: yar.createRoute("/ui-builder", () => ({
173
- PageComponent: () => /* @__PURE__ */ jsxRuntime.jsx(PageListPageComponent, {}),
174
- loader: createPageListLoader(config),
175
- meta: createPageListMeta()
176
- })),
177
- newPage: yar.createRoute("/ui-builder/new", () => ({
178
- PageComponent: () => /* @__PURE__ */ jsxRuntime.jsx(PageBuilderPageComponent, {}),
179
- loader: createPageBuilderLoader(void 0, config),
180
- meta: createPageBuilderMeta(void 0, config)
181
- })),
182
- editPage: yar.createRoute("/ui-builder/:id/edit", ({ params }) => ({
183
- PageComponent: () => /* @__PURE__ */ jsxRuntime.jsx(PageBuilderPageComponent, { id: params.id }),
184
- loader: createPageBuilderLoader(params.id, config),
185
- meta: createPageBuilderMeta(params.id, config)
186
- }))
172
+ pageList: yar.createRoute("/ui-builder", () => {
173
+ const CustomPageList = config.pageComponents?.pageList;
174
+ return {
175
+ PageComponent: CustomPageList ?? (() => /* @__PURE__ */ jsxRuntime.jsx(PageListPageComponent, {})),
176
+ loader: createPageListLoader(config),
177
+ meta: createPageListMeta()
178
+ };
179
+ }),
180
+ newPage: yar.createRoute("/ui-builder/new", () => {
181
+ const CustomNewPage = config.pageComponents?.newPage;
182
+ return {
183
+ PageComponent: CustomNewPage ?? (() => /* @__PURE__ */ jsxRuntime.jsx(PageBuilderPageComponent, {})),
184
+ loader: createPageBuilderLoader(void 0, config),
185
+ meta: createPageBuilderMeta(void 0, config)
186
+ };
187
+ }),
188
+ editPage: yar.createRoute("/ui-builder/:id/edit", ({ params }) => {
189
+ const CustomEditPage = config.pageComponents?.editPage;
190
+ return {
191
+ PageComponent: CustomEditPage ? () => /* @__PURE__ */ jsxRuntime.jsx(CustomEditPage, { id: params.id }) : () => /* @__PURE__ */ jsxRuntime.jsx(PageBuilderPageComponent, { id: params.id }),
192
+ loader: createPageBuilderLoader(params.id, config),
193
+ meta: createPageBuilderMeta(params.id, config)
194
+ };
195
+ })
187
196
  }),
188
197
  sitemap: async () => {
189
198
  return [];
@@ -167,21 +167,30 @@ function createPageBuilderMeta(id, config) {
167
167
  const uiBuilderClientPlugin = (config) => defineClientPlugin({
168
168
  name: "ui-builder",
169
169
  routes: () => ({
170
- pageList: createRoute("/ui-builder", () => ({
171
- PageComponent: () => /* @__PURE__ */ jsx(PageListPageComponent, {}),
172
- loader: createPageListLoader(config),
173
- meta: createPageListMeta()
174
- })),
175
- newPage: createRoute("/ui-builder/new", () => ({
176
- PageComponent: () => /* @__PURE__ */ jsx(PageBuilderPageComponent, {}),
177
- loader: createPageBuilderLoader(void 0, config),
178
- meta: createPageBuilderMeta(void 0, config)
179
- })),
180
- editPage: createRoute("/ui-builder/:id/edit", ({ params }) => ({
181
- PageComponent: () => /* @__PURE__ */ jsx(PageBuilderPageComponent, { id: params.id }),
182
- loader: createPageBuilderLoader(params.id, config),
183
- meta: createPageBuilderMeta(params.id, config)
184
- }))
170
+ pageList: createRoute("/ui-builder", () => {
171
+ const CustomPageList = config.pageComponents?.pageList;
172
+ return {
173
+ PageComponent: CustomPageList ?? (() => /* @__PURE__ */ jsx(PageListPageComponent, {})),
174
+ loader: createPageListLoader(config),
175
+ meta: createPageListMeta()
176
+ };
177
+ }),
178
+ newPage: createRoute("/ui-builder/new", () => {
179
+ const CustomNewPage = config.pageComponents?.newPage;
180
+ return {
181
+ PageComponent: CustomNewPage ?? (() => /* @__PURE__ */ jsx(PageBuilderPageComponent, {})),
182
+ loader: createPageBuilderLoader(void 0, config),
183
+ meta: createPageBuilderMeta(void 0, config)
184
+ };
185
+ }),
186
+ editPage: createRoute("/ui-builder/:id/edit", ({ params }) => {
187
+ const CustomEditPage = config.pageComponents?.editPage;
188
+ return {
189
+ PageComponent: CustomEditPage ? () => /* @__PURE__ */ jsx(CustomEditPage, { id: params.id }) : () => /* @__PURE__ */ jsx(PageBuilderPageComponent, { id: params.id }),
190
+ loader: createPageBuilderLoader(params.id, config),
191
+ meta: createPageBuilderMeta(params.id, config)
192
+ };
193
+ })
185
194
  }),
186
195
  sitemap: async () => {
187
196
  return [];
@@ -3,6 +3,7 @@
3
3
 
4
4
  const jsxRuntime = require('react/jsx-runtime');
5
5
  const React = require('react');
6
+ const index = require('../../../../node_modules/.pnpm/@radix-ui_react-popover@1.1.15_@types_react-dom@19.2.3_@types_react@19.2.6__@types_reac_5c5a3ca63b34dfe7d9d23f1e8cee675c/node_modules/@radix-ui/react-popover/dist/index.cjs');
6
7
  const LucideIcons = require('lucide-react');
7
8
  const utils = require('../lib/utils.cjs');
8
9
  const button = require('./button.cjs');
@@ -41,11 +42,20 @@ function SearchSelect({
41
42
  }
42
43
  ) }),
43
44
  /* @__PURE__ */ jsxRuntime.jsx(
44
- popover.PopoverContent,
45
+ index.Content,
45
46
  {
46
- className: "border-input w-full min-w-[var(--radix-popper-anchor-width)] p-0 z-[9999]",
47
47
  align: "start",
48
- usePortal: false,
48
+ sideOffset: 4,
49
+ className: utils.cn(
50
+ "border-input bg-popover text-popover-foreground pointer-events-auto",
51
+ "data-[state=open]:animate-in data-[state=closed]:animate-out",
52
+ "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
53
+ "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
54
+ "data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2",
55
+ "data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
56
+ "z-50 w-full min-w-[var(--radix-popper-anchor-width)] origin-(--radix-popover-content-transform-origin)",
57
+ "rounded-md border p-0 shadow-md outline-hidden"
58
+ ),
49
59
  children: /* @__PURE__ */ jsxRuntime.jsxs(command.Command, { children: [
50
60
  /* @__PURE__ */ jsxRuntime.jsx(command.CommandInput, { placeholder: "Search options..." }),
51
61
  /* @__PURE__ */ jsxRuntime.jsxs(command.CommandList, { children: [
@@ -1,11 +1,12 @@
1
1
  "use client";
2
2
  import { jsxs, jsx } from 'react/jsx-runtime';
3
3
  import { useId, useState } from 'react';
4
+ import { Content as Content2 } from '../../../../node_modules/.pnpm/@radix-ui_react-popover@1.1.15_@types_react-dom@19.2.3_@types_react@19.2.6__@types_reac_5c5a3ca63b34dfe7d9d23f1e8cee675c/node_modules/@radix-ui/react-popover/dist/index.mjs';
4
5
  import { ChevronDownIcon, CheckIcon } from 'lucide-react';
5
6
  import { cn } from '../lib/utils.mjs';
6
7
  import { Button } from './button.mjs';
7
8
  import { Command, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem } from './command.mjs';
8
- import { Popover, PopoverTrigger, PopoverContent } from './popover.mjs';
9
+ import { Popover, PopoverTrigger } from './popover.mjs';
9
10
 
10
11
  function SearchSelect({
11
12
  options,
@@ -39,11 +40,20 @@ function SearchSelect({
39
40
  }
40
41
  ) }),
41
42
  /* @__PURE__ */ jsx(
42
- PopoverContent,
43
+ Content2,
43
44
  {
44
- className: "border-input w-full min-w-[var(--radix-popper-anchor-width)] p-0 z-[9999]",
45
45
  align: "start",
46
- usePortal: false,
46
+ sideOffset: 4,
47
+ className: cn(
48
+ "border-input bg-popover text-popover-foreground pointer-events-auto",
49
+ "data-[state=open]:animate-in data-[state=closed]:animate-out",
50
+ "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
51
+ "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
52
+ "data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2",
53
+ "data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
54
+ "z-50 w-full min-w-[var(--radix-popper-anchor-width)] origin-(--radix-popover-content-transform-origin)",
55
+ "rounded-md border p-0 shadow-md outline-hidden"
56
+ ),
47
57
  children: /* @__PURE__ */ jsxs(Command, { children: [
48
58
  /* @__PURE__ */ jsx(CommandInput, { placeholder: "Search options..." }),
49
59
  /* @__PURE__ */ jsxs(CommandList, { children: [