@questpie/admin 3.0.5 → 3.0.6

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 (64) hide show
  1. package/README.md +99 -1
  2. package/dist/client/builder/types/field-types.d.mts +11 -0
  3. package/dist/client/components/brand-logo.d.mts +25 -0
  4. package/dist/client/components/brand-logo.mjs +174 -0
  5. package/dist/client/create-admin-client.d.mts +7 -0
  6. package/dist/client/create-admin-client.mjs +25 -0
  7. package/dist/client/hooks/use-brand.d.mts +22 -0
  8. package/dist/client/hooks/use-brand.mjs +52 -0
  9. package/dist/client/runtime/index.mjs +1 -1
  10. package/dist/client/runtime/provider.d.mts +4 -0
  11. package/dist/client/runtime/provider.mjs +38 -8
  12. package/dist/client/styles/base.css +4 -0
  13. package/dist/client/types/admin-config.d.mts +24 -0
  14. package/dist/client/views/auth/accept-invite-form.d.mts +2 -2
  15. package/dist/client/views/auth/auth-layout.d.mts +8 -3
  16. package/dist/client/views/auth/auth-layout.mjs +116 -102
  17. package/dist/client/views/auth/forgot-password-form.d.mts +2 -2
  18. package/dist/client/views/auth/login-form.d.mts +2 -2
  19. package/dist/client/views/auth/reset-password-form.d.mts +2 -2
  20. package/dist/client/views/auth/setup-form.d.mts +2 -2
  21. package/dist/client/views/collection/auto-form-fields.mjs +2 -0
  22. package/dist/client/views/collection/field-renderer.mjs +3 -2
  23. package/dist/client/views/globals/global-form-view.mjs +908 -863
  24. package/dist/client/views/layout/admin-sidebar.mjs +153 -141
  25. package/dist/client/views/pages/accept-invite-page.mjs +122 -144
  26. package/dist/client/views/pages/forgot-password-page.mjs +22 -30
  27. package/dist/client/views/pages/invite-page.mjs +24 -33
  28. package/dist/client/views/pages/login-page.d.mts +2 -2
  29. package/dist/client/views/pages/login-page.mjs +24 -32
  30. package/dist/client/views/pages/reset-password-page.d.mts +2 -2
  31. package/dist/client/views/pages/reset-password-page.mjs +77 -92
  32. package/dist/client/views/pages/setup-page.mjs +31 -39
  33. package/dist/client.d.mts +6 -2
  34. package/dist/client.mjs +5 -2
  35. package/dist/index.d.mts +6 -2
  36. package/dist/index.mjs +5 -2
  37. package/dist/server/augmentation/dashboard.d.mts +23 -5
  38. package/dist/server/augmentation/form-layout.d.mts +10 -0
  39. package/dist/server/augmentation/index.d.mts +1 -1
  40. package/dist/server/augmentation.d.mts +1 -1
  41. package/dist/server/modules/admin/collections/account.d.mts +46 -46
  42. package/dist/server/modules/admin/collections/admin-locks.d.mts +54 -54
  43. package/dist/server/modules/admin/collections/admin-preferences.d.mts +39 -39
  44. package/dist/server/modules/admin/collections/admin-saved-views.d.mts +47 -47
  45. package/dist/server/modules/admin/collections/apikey.d.mts +68 -68
  46. package/dist/server/modules/admin/collections/assets.d.mts +20 -20
  47. package/dist/server/modules/admin/collections/session.d.mts +42 -42
  48. package/dist/server/modules/admin/collections/user.d.mts +32 -32
  49. package/dist/server/modules/admin/collections/verification.d.mts +32 -32
  50. package/dist/server/modules/admin/dto/admin-config.dto.mjs +19 -1
  51. package/dist/server/modules/admin/routes/admin-config.d.mts +2 -2
  52. package/dist/server/modules/admin/routes/execute-action.d.mts +9 -9
  53. package/dist/server/modules/admin/routes/locales.d.mts +2 -2
  54. package/dist/server/modules/admin/routes/preview.d.mts +11 -11
  55. package/dist/server/modules/admin/routes/preview.mjs +1 -1
  56. package/dist/server/modules/admin/routes/reactive.d.mts +9 -9
  57. package/dist/server/modules/admin/routes/translations.d.mts +4 -4
  58. package/dist/server/modules/admin-preferences/collections/saved-views.d.mts +27 -27
  59. package/dist/server.d.mts +4 -4
  60. package/dist/shared/preview-utils.d.mts +34 -1
  61. package/dist/shared/preview-utils.mjs +79 -1
  62. package/dist/shared.d.mts +2 -2
  63. package/dist/shared.mjs +2 -2
  64. package/package.json +3 -3
@@ -2,7 +2,9 @@ import { cn } from "../../lib/utils.mjs";
2
2
  import { useAdminStoreRaw } from "../../runtime/provider.mjs";
3
3
  import { Card, CardContent } from "../../components/ui/card.mjs";
4
4
  import { useLazyComponent } from "../../utils/use-lazy-component.mjs";
5
+ import { BrandLogoMark } from "../../components/brand-logo.mjs";
5
6
  import { useHasManagedAdminTheme, useManagedAdminTheme } from "../layout/admin-theme.mjs";
7
+ import { useBrand } from "../../hooks/use-brand.mjs";
6
8
  import { c } from "react/compiler-runtime";
7
9
  import * as React from "react";
8
10
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -20,77 +22,68 @@ import { jsx, jsxs } from "react/jsx-runtime";
20
22
  * `adminAuthLayout` override can replace the built-in layout.
21
23
  */
22
24
  function AuthBrandMark(t0) {
23
- const $ = c(9);
24
- const { className, decorative: t1 } = t0;
25
- const decorative = t1 === void 0 ? false : t1;
26
- let t2;
25
+ const $ = c(7);
26
+ const { className } = t0;
27
+ let t1;
27
28
  if ($[0] !== className) {
28
- t2 = cn("text-foreground size-16 shrink-0", className);
29
+ t1 = cn("text-foreground size-16 shrink-0", className);
29
30
  $[0] = className;
30
- $[1] = t2;
31
- } else t2 = $[1];
32
- const t3 = decorative ? true : void 0;
33
- const t4 = decorative ? void 0 : "QUESTPIE";
34
- let t5;
35
- let t6;
36
- let t7;
31
+ $[1] = t1;
32
+ } else t1 = $[1];
33
+ let t2;
34
+ let t3;
35
+ let t4;
37
36
  if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
38
- t5 = /* @__PURE__ */ jsx("path", {
37
+ t2 = /* @__PURE__ */ jsx("path", {
39
38
  d: "M2 2H22V10",
40
39
  stroke: "currentColor",
41
40
  strokeWidth: "2",
42
41
  strokeLinecap: "square"
43
42
  });
44
- t6 = /* @__PURE__ */ jsx("path", {
43
+ t3 = /* @__PURE__ */ jsx("path", {
45
44
  d: "M2 2V22H10",
46
45
  stroke: "currentColor",
47
46
  strokeWidth: "2",
48
47
  strokeLinecap: "square"
49
48
  });
50
- t7 = /* @__PURE__ */ jsx("path", {
49
+ t4 = /* @__PURE__ */ jsx("path", {
51
50
  d: "M23 13H13V23H23V13Z",
52
51
  fill: "currentColor",
53
52
  opacity: "0.72"
54
53
  });
55
- $[2] = t5;
56
- $[3] = t6;
57
- $[4] = t7;
54
+ $[2] = t2;
55
+ $[3] = t3;
56
+ $[4] = t4;
58
57
  } else {
59
- t5 = $[2];
60
- t6 = $[3];
61
- t7 = $[4];
58
+ t2 = $[2];
59
+ t3 = $[3];
60
+ t4 = $[4];
62
61
  }
63
- let t8;
64
- if ($[5] !== t2 || $[6] !== t3 || $[7] !== t4) {
65
- t8 = /* @__PURE__ */ jsxs("svg", {
62
+ let t5;
63
+ if ($[5] !== t1) {
64
+ t5 = /* @__PURE__ */ jsxs("svg", {
66
65
  xmlns: "http://www.w3.org/2000/svg",
67
66
  viewBox: "0 0 24 24",
68
67
  fill: "none",
69
- className: t2,
70
- "aria-hidden": t3,
71
- "aria-label": t4,
68
+ className: t1,
69
+ "aria-hidden": true,
72
70
  children: [
73
- t5,
74
- t6,
75
- t7
71
+ t2,
72
+ t3,
73
+ t4
76
74
  ]
77
75
  });
78
- $[5] = t2;
79
- $[6] = t3;
80
- $[7] = t4;
81
- $[8] = t8;
82
- } else t8 = $[8];
83
- return t8;
76
+ $[5] = t1;
77
+ $[6] = t5;
78
+ } else t5 = $[6];
79
+ return t5;
84
80
  }
85
81
  function AuthDefaultLogo(t0) {
86
82
  const $ = c(3);
87
83
  const { brandName } = t0;
88
84
  let t1;
89
85
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
90
- t1 = /* @__PURE__ */ jsx(AuthBrandMark, {
91
- className: "size-9",
92
- decorative: true
93
- });
86
+ t1 = /* @__PURE__ */ jsx(AuthBrandMark, { className: "size-9" });
94
87
  $[0] = t1;
95
88
  } else t1 = $[0];
96
89
  let t2;
@@ -111,36 +104,53 @@ function AuthDefaultLogo(t0) {
111
104
  return t2;
112
105
  }
113
106
  function AuthLogo(t0) {
114
- const $ = c(7);
107
+ const $ = c(8);
115
108
  const { logo, className } = t0;
109
+ const brand = useBrand();
116
110
  let t1;
117
- if ($[0] !== className) {
118
- t1 = cn("qa-auth-layout__logo flex min-w-0 items-center justify-start text-left", className);
119
- $[0] = className;
120
- $[1] = t1;
121
- } else t1 = $[1];
111
+ if ($[0] !== brand || $[1] !== logo) {
112
+ t1 = logo ?? (brand.logo ? /* @__PURE__ */ jsxs("div", {
113
+ className: "qa-auth-layout__default-logo flex max-w-full min-w-0 items-center gap-3 text-left",
114
+ children: [/* @__PURE__ */ jsx(BrandLogoMark, {
115
+ logo: brand.logo,
116
+ alt: brand.name,
117
+ className: "size-9"
118
+ }), /* @__PURE__ */ jsx("div", {
119
+ className: "min-w-0",
120
+ children: /* @__PURE__ */ jsx("div", {
121
+ className: "text-foreground truncate text-sm font-semibold tracking-tight",
122
+ children: brand.name
123
+ })
124
+ })]
125
+ }) : /* @__PURE__ */ jsx(AuthDefaultLogo, { brandName: brand.name }));
126
+ $[0] = brand;
127
+ $[1] = logo;
128
+ $[2] = t1;
129
+ } else t1 = $[2];
130
+ const resolved = t1;
122
131
  let t2;
123
- if ($[2] !== logo) {
124
- t2 = logo ?? /* @__PURE__ */ jsx(AuthDefaultLogo, { brandName: "QUESTPIE" });
125
- $[2] = logo;
126
- $[3] = t2;
127
- } else t2 = $[3];
132
+ if ($[3] !== className) {
133
+ t2 = cn("qa-auth-layout__logo flex min-w-0 items-center justify-start text-left", className);
134
+ $[3] = className;
135
+ $[4] = t2;
136
+ } else t2 = $[4];
128
137
  let t3;
129
- if ($[4] !== t1 || $[5] !== t2) {
138
+ if ($[5] !== resolved || $[6] !== t2) {
130
139
  t3 = /* @__PURE__ */ jsx("div", {
131
- className: t1,
132
- children: t2
140
+ className: t2,
141
+ children: resolved
133
142
  });
134
- $[4] = t1;
135
- $[5] = t2;
136
- $[6] = t3;
137
- } else t3 = $[6];
143
+ $[5] = resolved;
144
+ $[6] = t2;
145
+ $[7] = t3;
146
+ } else t3 = $[7];
138
147
  return t3;
139
148
  }
140
149
  /** Built-in minimal split layout (fallback when no override is registered). */
141
150
  function AuthLayoutBuiltIn(t0) {
142
- const $ = c(21);
151
+ const $ = c(25);
143
152
  const { logo, footer, children, className } = t0;
153
+ const { tagline } = useBrand();
144
154
  let t1;
145
155
  if ($[0] !== logo) {
146
156
  t1 = /* @__PURE__ */ jsx(AuthLogo, {
@@ -151,66 +161,69 @@ function AuthLayoutBuiltIn(t0) {
151
161
  $[1] = t1;
152
162
  } else t1 = $[1];
153
163
  let t2;
154
- if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
155
- t2 = /* @__PURE__ */ jsx("p", {
156
- className: "text-muted-foreground hidden text-xs tracking-[0.14em] uppercase lg:block",
157
- children: "Built with QUESTPIE"
164
+ if ($[2] !== tagline) {
165
+ t2 = tagline && /* @__PURE__ */ jsx("p", {
166
+ className: "qa-auth-layout__tagline text-muted-foreground hidden text-xs tracking-[0.14em] uppercase lg:block",
167
+ children: tagline
158
168
  });
159
- $[2] = t2;
160
- } else t2 = $[2];
169
+ $[2] = tagline;
170
+ $[3] = t2;
171
+ } else t2 = $[3];
161
172
  let t3;
162
- if ($[3] !== t1) {
173
+ if ($[4] !== t1 || $[5] !== t2) {
163
174
  t3 = /* @__PURE__ */ jsxs("aside", {
164
175
  className: "qa-auth-layout__brand flex flex-col items-center justify-center gap-8",
165
176
  children: [t1, t2]
166
177
  });
167
- $[3] = t1;
168
- $[4] = t3;
169
- } else t3 = $[4];
178
+ $[4] = t1;
179
+ $[5] = t2;
180
+ $[6] = t3;
181
+ } else t3 = $[6];
170
182
  let t4;
171
- if ($[5] !== className) {
183
+ if ($[7] !== className) {
172
184
  t4 = cn("qa-auth-layout__card border-border-subtle w-full shadow-none", className);
173
- $[5] = className;
174
- $[6] = t4;
175
- } else t4 = $[6];
185
+ $[7] = className;
186
+ $[8] = t4;
187
+ } else t4 = $[8];
176
188
  let t5;
177
- if ($[7] !== children) {
189
+ if ($[9] !== children) {
178
190
  t5 = /* @__PURE__ */ jsx(CardContent, {
179
191
  className: "qa-auth-layout__card-content",
180
192
  children
181
193
  });
182
- $[7] = children;
183
- $[8] = t5;
184
- } else t5 = $[8];
194
+ $[9] = children;
195
+ $[10] = t5;
196
+ } else t5 = $[10];
185
197
  let t6;
186
- if ($[9] !== t4 || $[10] !== t5) {
198
+ if ($[11] !== t4 || $[12] !== t5) {
187
199
  t6 = /* @__PURE__ */ jsx(Card, {
188
200
  className: t4,
189
201
  children: t5
190
202
  });
191
- $[9] = t4;
192
- $[10] = t5;
193
- $[11] = t6;
194
- } else t6 = $[11];
203
+ $[11] = t4;
204
+ $[12] = t5;
205
+ $[13] = t6;
206
+ } else t6 = $[13];
195
207
  let t7;
196
- if ($[12] !== footer) {
208
+ if ($[14] !== footer) {
197
209
  t7 = footer && /* @__PURE__ */ jsx("div", {
198
210
  className: "qa-auth-layout__footer text-muted-foreground text-center text-xs",
199
211
  children: footer
200
212
  });
201
- $[12] = footer;
202
- $[13] = t7;
203
- } else t7 = $[13];
213
+ $[14] = footer;
214
+ $[15] = t7;
215
+ } else t7 = $[15];
204
216
  let t8;
205
- if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
206
- t8 = /* @__PURE__ */ jsx("div", {
207
- className: "text-muted-foreground text-center text-[11px] tracking-[0.14em] uppercase lg:hidden",
208
- children: "Built with QUESTPIE"
217
+ if ($[16] !== tagline) {
218
+ t8 = tagline && /* @__PURE__ */ jsx("div", {
219
+ className: "qa-auth-layout__tagline qa-auth-layout__tagline--mobile text-muted-foreground text-center text-[11px] tracking-[0.14em] uppercase lg:hidden",
220
+ children: tagline
209
221
  });
210
- $[14] = t8;
211
- } else t8 = $[14];
222
+ $[16] = tagline;
223
+ $[17] = t8;
224
+ } else t8 = $[17];
212
225
  let t9;
213
- if ($[15] !== t6 || $[16] !== t7) {
226
+ if ($[18] !== t6 || $[19] !== t7 || $[20] !== t8) {
214
227
  t9 = /* @__PURE__ */ jsx("main", {
215
228
  className: "qa-auth-layout__form-panel flex items-center justify-center",
216
229
  children: /* @__PURE__ */ jsxs("div", {
@@ -222,12 +235,13 @@ function AuthLayoutBuiltIn(t0) {
222
235
  ]
223
236
  })
224
237
  });
225
- $[15] = t6;
226
- $[16] = t7;
227
- $[17] = t9;
228
- } else t9 = $[17];
238
+ $[18] = t6;
239
+ $[19] = t7;
240
+ $[20] = t8;
241
+ $[21] = t9;
242
+ } else t9 = $[21];
229
243
  let t10;
230
- if ($[18] !== t3 || $[19] !== t9) {
244
+ if ($[22] !== t3 || $[23] !== t9) {
231
245
  t10 = /* @__PURE__ */ jsx("div", {
232
246
  className: "qa-auth-layout bg-background text-foreground relative flex min-h-screen items-center justify-center overflow-hidden px-5 py-8 sm:px-8",
233
247
  children: /* @__PURE__ */ jsxs("div", {
@@ -235,10 +249,10 @@ function AuthLayoutBuiltIn(t0) {
235
249
  children: [t3, t9]
236
250
  })
237
251
  });
238
- $[18] = t3;
239
- $[19] = t9;
240
- $[20] = t10;
241
- } else t10 = $[20];
252
+ $[22] = t3;
253
+ $[23] = t9;
254
+ $[24] = t10;
255
+ } else t10 = $[24];
242
256
  return t10;
243
257
  }
244
258
  /**
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime4 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime3 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/client/views/auth/forgot-password-form.d.ts
4
4
  /**
@@ -53,6 +53,6 @@ declare function ForgotPasswordForm({
53
53
  defaultValues,
54
54
  className,
55
55
  error
56
- }: ForgotPasswordFormProps): react_jsx_runtime4.JSX.Element;
56
+ }: ForgotPasswordFormProps): react_jsx_runtime3.JSX.Element;
57
57
  //#endregion
58
58
  export { ForgotPasswordForm };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime3 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime4 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/client/views/auth/login-form.d.ts
4
4
  /**
@@ -70,6 +70,6 @@ declare function LoginForm({
70
70
  className,
71
71
  error,
72
72
  minPasswordLength
73
- }: LoginFormProps): react_jsx_runtime3.JSX.Element;
73
+ }: LoginFormProps): react_jsx_runtime4.JSX.Element;
74
74
  //#endregion
75
75
  export { LoginForm };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime6 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime5 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/client/views/auth/reset-password-form.d.ts
4
4
  /**
@@ -60,6 +60,6 @@ declare function ResetPasswordForm({
60
60
  minPasswordLength,
61
61
  className,
62
62
  error
63
- }: ResetPasswordFormProps): react_jsx_runtime6.JSX.Element;
63
+ }: ResetPasswordFormProps): react_jsx_runtime5.JSX.Element;
64
64
  //#endregion
65
65
  export { ResetPasswordForm };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime5 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime6 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/client/views/auth/setup-form.d.ts
4
4
  /**
@@ -55,6 +55,6 @@ declare function SetupForm({
55
55
  className,
56
56
  error,
57
57
  minPasswordLength
58
- }: SetupFormProps): react_jsx_runtime5.JSX.Element;
58
+ }: SetupFormProps): react_jsx_runtime6.JSX.Element;
59
59
  //#endregion
60
60
  export { SetupForm, SetupFormValues };
@@ -84,6 +84,7 @@ function renderFields({ fieldItems, fields, collection, mode = "collection", reg
84
84
  allCollectionsConfig,
85
85
  entityMeta,
86
86
  className: cn(item.className, spanClass),
87
+ extraProps: item.props,
87
88
  renderEmbeddedFields: ({ embeddedCollection, embeddedCollectionConfig, fullFieldName, index: embeddedIndex }) => /* @__PURE__ */ jsx(AutoFormFields, {
88
89
  collection: embeddedCollection,
89
90
  mode: "collection",
@@ -149,6 +150,7 @@ function FieldLayoutItems(t0) {
149
150
  allCollectionsConfig,
150
151
  entityMeta,
151
152
  className: typeof item === "object" && "className" in item ? item.className : void 0,
153
+ extraProps: typeof item === "object" && "props" in item ? item.props : void 0,
152
154
  renderEmbeddedFields: (t4) => {
153
155
  const { embeddedCollection, embeddedCollectionConfig, fullFieldName, index: embeddedIndex } = t4;
154
156
  return /* @__PURE__ */ jsx(AutoFormFields, {
@@ -144,7 +144,7 @@ function renderEmbeddedField({ context, registry, allCollectionsConfig, componen
144
144
  */
145
145
  function FieldRenderer(t0) {
146
146
  const $ = c(31);
147
- const { fieldName, fieldDef, collection, mode: t1, registry, fieldPrefix, allCollectionsConfig, renderEmbeddedFields, className, entityMeta: entityMetaProp } = t0;
147
+ const { fieldName, fieldDef, collection, mode: t1, registry, fieldPrefix, allCollectionsConfig, renderEmbeddedFields, className, entityMeta: entityMetaProp, extraProps } = t0;
148
148
  const mode = t1 === void 0 ? "collection" : t1;
149
149
  const form = useFormContext();
150
150
  const { locale } = useScopedLocale();
@@ -271,7 +271,8 @@ function FieldRenderer(t0) {
271
271
  readOnly: rawComponentProps.readOnly || isComputed,
272
272
  label: resolveText(rawComponentProps.label, "", formValues),
273
273
  description: resolveText(rawComponentProps.description, "", formValues),
274
- placeholder: resolveText(rawComponentProps.placeholder, "", formValues)
274
+ placeholder: resolveText(rawComponentProps.placeholder, "", formValues),
275
+ ...extraProps ?? {}
275
276
  };
276
277
  let content = null;
277
278
  if (context.type === "embedded") content = renderEmbeddedField({