@questpie/admin 3.3.0 → 3.4.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 (76) hide show
  1. package/README.md +4 -6
  2. package/dist/client/blocks/block-renderer.d.mts +2 -2
  3. package/dist/client/builder/admin-types.d.mts +3 -3
  4. package/dist/client/builder/types/action-types.d.mts +1 -1
  5. package/dist/client/builder/types/collection-types.d.mts +59 -2
  6. package/dist/client/modules/admin.d.mts +3 -0
  7. package/dist/client/modules/admin.mjs +3 -0
  8. package/dist/client/preview/block-scope-context.d.mts +2 -2
  9. package/dist/client/preview/preview-banner.d.mts +2 -2
  10. package/dist/client/preview/preview-field.d.mts +4 -4
  11. package/dist/client/views/collection/list-view.mjs +830 -0
  12. package/dist/client/views/collection/outline.mjs +363 -0
  13. package/dist/client/views/collection/table-view.mjs +6 -3
  14. package/dist/client/views/layout/admin-layout.d.mts +15 -1
  15. package/dist/client/views/layout/admin-layout.mjs +95 -31
  16. package/dist/client.d.mts +6 -6
  17. package/dist/components/rich-text/rich-text-renderer.d.mts +2 -2
  18. package/dist/factories.d.mts +19 -0
  19. package/dist/factories.mjs +11 -0
  20. package/dist/fields.d.mts +4 -0
  21. package/dist/fields.mjs +5 -0
  22. package/dist/index.d.mts +6 -6
  23. package/dist/modules/admin.d.mts +10 -0
  24. package/dist/modules/admin.mjs +9 -0
  25. package/dist/modules/audit.d.mts +5 -0
  26. package/dist/modules/audit.mjs +5 -0
  27. package/dist/server/augmentation/form-layout.d.mts +57 -2
  28. package/dist/server/augmentation/index.d.mts +3 -1
  29. package/dist/server/augmentation/shell.d.mts +48 -0
  30. package/dist/server/augmentation.d.mts +2 -1
  31. package/dist/server/codegen/admin-client-template.mjs +11 -4
  32. package/dist/server/fields/blocks.d.mts +9 -2
  33. package/dist/server/fields/blocks.mjs +1 -1
  34. package/dist/server/fields/index.d.mts +2 -2
  35. package/dist/server/fields/index.mjs +2 -2
  36. package/dist/server/fields/rich-text.d.mts +9 -2
  37. package/dist/server/fields/rich-text.mjs +1 -1
  38. package/dist/server/modules/admin/.generated/module.d.mts +24 -19
  39. package/dist/server/modules/admin/.generated/module.mjs +5 -1
  40. package/dist/server/modules/admin/.generated/registries.d.mts +6 -4
  41. package/dist/server/modules/admin/client/.generated/module.d.mts +70 -70
  42. package/dist/server/modules/admin/client/.generated/module.mjs +3 -1
  43. package/dist/server/modules/admin/client/views/collection-form.d.mts +6 -0
  44. package/dist/server/modules/admin/client/views/collection-table.d.mts +6 -0
  45. package/dist/server/modules/admin/client/views/global-form.d.mts +6 -0
  46. package/dist/server/modules/admin/client/views/list-view.d.mts +6 -0
  47. package/dist/server/modules/admin/client/views/list-view.mjs +10 -0
  48. package/dist/server/modules/admin/collections/account.d.mts +46 -46
  49. package/dist/server/modules/admin/collections/admin-locks.d.mts +54 -54
  50. package/dist/server/modules/admin/collections/admin-preferences.d.mts +34 -34
  51. package/dist/server/modules/admin/collections/admin-saved-views.d.mts +47 -47
  52. package/dist/server/modules/admin/collections/apikey.d.mts +68 -68
  53. package/dist/server/modules/admin/collections/assets.d.mts +34 -34
  54. package/dist/server/modules/admin/collections/session.d.mts +38 -38
  55. package/dist/server/modules/admin/dto/admin-config.dto.mjs +17 -0
  56. package/dist/server/modules/admin/index.d.mts +30 -31
  57. package/dist/server/modules/admin/routes/admin-config.d.mts +0 -15
  58. package/dist/server/modules/admin/routes/admin-config.mjs +21 -5
  59. package/dist/server/modules/admin/routes/execute-action.d.mts +9 -9
  60. package/dist/server/modules/admin/routes/execute-action.mjs +18 -12
  61. package/dist/server/modules/admin/routes/i18n-helpers.d.mts +4 -0
  62. package/dist/server/modules/admin/routes/preview.d.mts +11 -11
  63. package/dist/server/modules/admin/routes/reactive.d.mts +9 -9
  64. package/dist/server/modules/admin/routes/route-helpers.mjs +36 -1
  65. package/dist/server/modules/admin/routes/setup.d.mts +7 -14
  66. package/dist/server/modules/admin/routes/setup.mjs +16 -3
  67. package/dist/server/modules/admin/routes/widget-data.d.mts +5 -5
  68. package/dist/server/modules/admin/views/list-view.d.mts +8 -0
  69. package/dist/server/modules/admin/views/list-view.mjs +7 -0
  70. package/dist/server/modules/audit/collections/audit-log.d.mts +7 -2
  71. package/dist/server/modules/audit/index.d.mts +1 -1
  72. package/dist/server/plugin.d.mts +1 -1
  73. package/dist/server/plugin.mjs +28 -28
  74. package/dist/server.d.mts +5 -4
  75. package/dist/server.mjs +7 -7
  76. package/package.json +13 -3
package/README.md CHANGED
@@ -23,8 +23,7 @@ Add the admin module to `modules.ts`:
23
23
 
24
24
  ```ts
25
25
  // questpie.config.ts
26
- import { runtimeConfig } from "questpie";
27
-
26
+ import { runtimeConfig } from "questpie/app";
28
27
  export default runtimeConfig({
29
28
  app: { url: process.env.APP_URL! },
30
29
  db: { url: process.env.DATABASE_URL! },
@@ -34,8 +33,7 @@ export default runtimeConfig({
34
33
 
35
34
  ```ts
36
35
  // modules.ts
37
- import { adminModule } from "@questpie/admin/server";
38
-
36
+ import { adminModule } from "@questpie/admin/modules/admin";
39
37
  export default [adminModule] as const;
40
38
  ```
41
39
 
@@ -477,8 +475,8 @@ import {
477
475
  } from "@questpie/admin/client";
478
476
 
479
477
  // Server (admin module + server factories/config)
480
- import { adminModule, auditModule } from "@questpie/admin/server";
481
-
478
+ import { adminModule } from "@questpie/admin/modules/admin";
479
+ import { auditModule } from "@questpie/admin/modules/audit";
482
480
  // Styles
483
481
  import "@questpie/admin/client/styles/index.css";
484
482
  ```
@@ -1,6 +1,6 @@
1
1
  import { BlockContent } from "./types.mjs";
2
2
  import * as React from "react";
3
- import * as react_jsx_runtime19 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime20 from "react/jsx-runtime";
4
4
 
5
5
  //#region src/client/blocks/block-renderer.d.ts
6
6
 
@@ -50,6 +50,6 @@ declare function BlockRenderer({
50
50
  onBlockClick,
51
51
  onBlockInsert,
52
52
  className
53
- }: BlockRendererProps): react_jsx_runtime19.JSX.Element | null;
53
+ }: BlockRendererProps): react_jsx_runtime20.JSX.Element | null;
54
54
  //#endregion
55
55
  export { BlockRenderer, BlockRendererProps };
@@ -1,10 +1,10 @@
1
- import { SimpleMessages } from "../i18n/simple.mjs";
2
1
  import { MaybeLazyComponent } from "./types/common.mjs";
2
+ import { ViewDefinition } from "./view/view.mjs";
3
3
  import { FieldDefinition } from "./field/field.mjs";
4
4
  import { PageDefinition } from "./page/page.mjs";
5
- import { LocaleConfig } from "./types/ui-config.mjs";
6
- import { ViewDefinition } from "./view/view.mjs";
7
5
  import { WidgetDefinition } from "./widget/widget.mjs";
6
+ import { SimpleMessages } from "../i18n/simple.mjs";
7
+ import { LocaleConfig } from "./types/ui-config.mjs";
8
8
 
9
9
  //#region src/client/builder/admin-types.d.ts
10
10
 
@@ -1,8 +1,8 @@
1
1
  import { I18nText } from "../../i18n/types.mjs";
2
2
  import { IconComponent, MaybeLazyComponent } from "./common.mjs";
3
- import { FieldInstance } from "../field/field.mjs";
4
3
  import { ComponentReference } from "../../../server/augmentation/common.mjs";
5
4
  import "../../../server/augmentation.mjs";
5
+ import { FieldInstance } from "../field/field.mjs";
6
6
 
7
7
  //#region src/client/builder/types/action-types.d.ts
8
8
 
@@ -1,7 +1,7 @@
1
1
  import "../../i18n/types.mjs";
2
2
  import { MaybeLazyComponent } from "./common.mjs";
3
- import "../field/field.mjs";
4
3
  import "../../../server/augmentation.mjs";
4
+ import "../field/field.mjs";
5
5
  import "../admin.mjs";
6
6
  import { ActionsConfig } from "./action-types.mjs";
7
7
 
@@ -60,6 +60,51 @@ interface ColumnConfigObject<TFieldNames extends string = string> {
60
60
  */
61
61
  align?: "left" | "center" | "right";
62
62
  }
63
+ interface ListViewLayoutConfig<TFieldNames extends string = string> {
64
+ density?: "compact" | "comfortable";
65
+ titleField?: TFieldNames;
66
+ subtitleField?: TFieldNames;
67
+ leadingFields?: TFieldNames[];
68
+ badgeFields?: TFieldNames[];
69
+ metaFields?: TFieldNames[];
70
+ }
71
+ type ListViewOutlineLevel<TFieldNames extends string = string> = {
72
+ kind: "field";
73
+ field: TFieldNames;
74
+ labelField?: TFieldNames;
75
+ order?: "asc" | "desc" | string[];
76
+ } | {
77
+ kind: "relation-field";
78
+ relation: TFieldNames;
79
+ field?: string;
80
+ labelField?: string;
81
+ order?: "asc" | "desc" | string[];
82
+ } | {
83
+ kind: "edge";
84
+ collection: string;
85
+ parentField: string;
86
+ childField: string;
87
+ where?: Record<string, unknown>;
88
+ groupByEdgeField?: string;
89
+ repeat?: boolean | {
90
+ maxDepth?: number;
91
+ };
92
+ } | {
93
+ kind: "path";
94
+ field: TFieldNames;
95
+ separator?: string;
96
+ syntheticFolders?: boolean;
97
+ repeat?: boolean | {
98
+ maxDepth?: number;
99
+ };
100
+ };
101
+ interface ListViewOutlineConfig<TFieldNames extends string = string> {
102
+ levels: ListViewOutlineLevel<TFieldNames>[];
103
+ defaultExpanded?: boolean | "roots";
104
+ maxDepth?: number;
105
+ showCounts?: boolean;
106
+ preserveMatchingBranches?: boolean;
107
+ }
63
108
  /**
64
109
  * List view configuration
65
110
  */
@@ -91,11 +136,15 @@ interface ListViewConfig<TFieldNames extends string = string> {
91
136
  * Enable search
92
137
  * @default true
93
138
  */
94
- searchable?: boolean;
139
+ searchable?: boolean | TFieldNames[];
95
140
  /**
96
141
  * Searchable fields (defaults to all text-like fields)
97
142
  */
98
143
  searchFields?: TFieldNames[];
144
+ /**
145
+ * Filterable fields exposed by schema-driven list views.
146
+ */
147
+ filterable?: TFieldNames[];
99
148
  /**
100
149
  * Enable row selection
101
150
  * @default false
@@ -131,6 +180,14 @@ interface ListViewConfig<TFieldNames extends string = string> {
131
180
  defaultCollapsed?: boolean;
132
181
  showCounts?: boolean;
133
182
  };
183
+ /**
184
+ * Dense list row layout hints used by list-like renderers.
185
+ */
186
+ layout?: ListViewLayoutConfig<TFieldNames>;
187
+ /**
188
+ * Renderer-agnostic multi-level outline/grouping configuration.
189
+ */
190
+ outline?: ListViewOutlineConfig<TFieldNames>;
134
191
  /**
135
192
  * Actions configuration for list view
136
193
  */
@@ -0,0 +1,3 @@
1
+ import { AdminModule, _module } from "../../server/modules/admin/client/.generated/module.mjs";
2
+ import "../../server/modules/admin/client/index.mjs";
3
+ export { type AdminModule as AdminClientModule, _module as adminClientModule };
@@ -0,0 +1,3 @@
1
+ import module_default from "../../server/modules/admin/client/.generated/module.mjs";
2
+
3
+ export { module_default as adminClientModule };
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import * as react_jsx_runtime25 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime21 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/client/preview/block-scope-context.d.ts
5
5
 
@@ -35,7 +35,7 @@ declare function BlockScopeProvider({
35
35
  blockId,
36
36
  basePath,
37
37
  children
38
- }: BlockScopeProviderProps): react_jsx_runtime25.JSX.Element;
38
+ }: BlockScopeProviderProps): react_jsx_runtime21.JSX.Element;
39
39
  /**
40
40
  * Get current block scope context.
41
41
  *
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime24 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime22 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/client/preview/preview-banner.d.ts
4
4
 
@@ -40,6 +40,6 @@ declare function PreviewBanner({
40
40
  isPreviewMode,
41
41
  className,
42
42
  exitPreviewUrl
43
- }: PreviewBannerProps): react_jsx_runtime24.JSX.Element | null;
43
+ }: PreviewBannerProps): react_jsx_runtime22.JSX.Element | null;
44
44
  //#endregion
45
45
  export { PreviewBanner, PreviewBannerProps };
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import * as react_jsx_runtime21 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime23 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/client/preview/preview-field.d.ts
5
5
 
@@ -68,7 +68,7 @@ declare function PreviewProvider({
68
68
  }) => void;
69
69
  onFieldValueEdited?: (payload: PreviewFieldValueEditedPayload) => void;
70
70
  children: React.ReactNode;
71
- }): react_jsx_runtime21.JSX.Element;
71
+ }): react_jsx_runtime23.JSX.Element;
72
72
  /**
73
73
  * Hook to access preview context.
74
74
  */
@@ -107,7 +107,7 @@ declare function PreviewField({
107
107
  style,
108
108
  onClick,
109
109
  onValueCommit
110
- }: PreviewFieldProps): react_jsx_runtime21.JSX.Element;
110
+ }: PreviewFieldProps): react_jsx_runtime23.JSX.Element;
111
111
  /**
112
112
  * Standalone PreviewField that works without context.
113
113
  * Useful when you can't use PreviewProvider.
@@ -131,6 +131,6 @@ declare function StandalonePreviewField({
131
131
  blockId?: string;
132
132
  fieldType?: "regular" | "block" | "relation";
133
133
  }) => void;
134
- }): react_jsx_runtime21.JSX.Element;
134
+ }): react_jsx_runtime23.JSX.Element;
135
135
  //#endregion
136
136
  export { PreviewField, PreviewFieldProps, PreviewProvider, StandalonePreviewField, usePreviewContext };