@antelopejs/dms 0.24.2 → 0.24.3-next.1066.g4f2d355

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 (130) hide show
  1. package/README.md +2 -2
  2. package/dist/attachments/constraints.d.ts +13 -1
  3. package/dist/attachments/constraints.js +9 -3
  4. package/dist/attachments/constraints.js.map +1 -1
  5. package/dist/attachments/file-not-found.d.ts +1 -0
  6. package/dist/attachments/file-not-found.js +8 -0
  7. package/dist/attachments/file-not-found.js.map +1 -0
  8. package/dist/attachments/read.js +3 -2
  9. package/dist/attachments/read.js.map +1 -1
  10. package/dist/attachments/registry.js +1 -1
  11. package/dist/attachments/registry.js.map +1 -1
  12. package/dist/attachments/save.js +7 -4
  13. package/dist/attachments/save.js.map +1 -1
  14. package/dist/config/internal/state.js.map +1 -1
  15. package/dist/e2e/json.d.mts +0 -5
  16. package/dist/implementations/dms/guards.d.ts +1 -1
  17. package/dist/implementations/dms/guards.js +7 -2
  18. package/dist/implementations/dms/guards.js.map +1 -1
  19. package/dist/implementations/dms/page/preview-pages.js +1 -1
  20. package/dist/implementations/dms/page/preview-pages.js.map +1 -1
  21. package/dist/implementations/dms/page/public-layout.js +2 -2
  22. package/dist/implementations/dms/page/public-layout.js.map +1 -1
  23. package/dist/implementations/dms/page/registry.js +3 -2
  24. package/dist/implementations/dms/page/registry.js.map +1 -1
  25. package/dist/implementations/dms/permission-preview.js +2 -2
  26. package/dist/implementations/dms/permission-preview.js.map +1 -1
  27. package/dist/implementations/dms-auth/index.js +5 -5
  28. package/dist/implementations/dms-auth/index.js.map +1 -1
  29. package/dist/implementations/dms-base/bulk-selection.js +9 -2
  30. package/dist/implementations/dms-base/bulk-selection.js.map +1 -1
  31. package/dist/implementations/dms-base/footer-summary.js.map +1 -1
  32. package/dist/implementations/dms-base/search-route.js +1 -1
  33. package/dist/implementations/dms-base/search-route.js.map +1 -1
  34. package/dist/implementations/dms-builder/engine/compose-page.js +1 -1
  35. package/dist/implementations/dms-builder/engine/compose-page.js.map +1 -1
  36. package/dist/implementations/dms-builder/engine/driver-packages.js +49 -35
  37. package/dist/implementations/dms-builder/engine/driver-packages.js.map +1 -1
  38. package/dist/implementations/dms-builder/engine/driver-probe.js +7 -7
  39. package/dist/implementations/dms-builder/engine/driver-probe.js.map +1 -1
  40. package/dist/implementations/dms-builder/engine/map-resources-repairs.js.map +1 -1
  41. package/dist/implementations/dms-builder/engine/page-draft-validation.js +2 -2
  42. package/dist/implementations/dms-builder/engine/page-draft-validation.js.map +1 -1
  43. package/dist/implementations/dms-builder/engine/preview.js +2 -2
  44. package/dist/implementations/dms-builder/engine/preview.js.map +1 -1
  45. package/dist/implementations/dms-builder/engine/project.js.map +1 -1
  46. package/dist/implementations/dms-builder/engine/theme-app-config.js +2 -4
  47. package/dist/implementations/dms-builder/engine/theme-app-config.js.map +1 -1
  48. package/dist/implementations/dms-builder/engine/theme-svg.js.map +1 -1
  49. package/dist/mcp/access.js +2 -1
  50. package/dist/mcp/access.js.map +1 -1
  51. package/dist/mockup/history-routes.js +11 -14
  52. package/dist/mockup/history-routes.js.map +1 -1
  53. package/dist/mockup/manage-routes.js +6 -7
  54. package/dist/mockup/manage-routes.js.map +1 -1
  55. package/dist/mockup/presence-routes.js +12 -14
  56. package/dist/mockup/presence-routes.js.map +1 -1
  57. package/dist/mockup/refusals.d.ts +18 -0
  58. package/dist/mockup/refusals.js +23 -0
  59. package/dist/mockup/refusals.js.map +1 -0
  60. package/dist/mockup/routes.js +21 -24
  61. package/dist/mockup/routes.js.map +1 -1
  62. package/dist/mockup/source-routes.js +7 -9
  63. package/dist/mockup/source-routes.js.map +1 -1
  64. package/dist/pages/settings/users/account-activity-feed.js +2 -2
  65. package/dist/pages/settings/users/account-activity-feed.js.map +1 -1
  66. package/dist/pages/settings/users/member-invite-batch.js +1 -1
  67. package/dist/pages/settings/users/member-invite-batch.js.map +1 -1
  68. package/dist/routes/files.js +2 -2
  69. package/dist/routes/files.js.map +1 -1
  70. package/dist/store/interfaces.js +1 -1
  71. package/dist/store/interfaces.js.map +1 -1
  72. package/dist/store/operations.js +3 -2
  73. package/dist/store/operations.js.map +1 -1
  74. package/dist/utils/export-jobs-run.js +5 -4
  75. package/dist/utils/export-jobs-run.js.map +1 -1
  76. package/dist/utils/page-access.js +1 -1
  77. package/dist/utils/page-access.js.map +1 -1
  78. package/e2e/json.mjs +0 -6
  79. package/frontend-vue/layers/dms-auth/server/accounts.ts +0 -8
  80. package/frontend-vue/layers/dms-core/app/build/composables/user/preferencesCookie.ts +2 -2
  81. package/frontend-vue/layers/dms-core/app/build/utils/crossTab.ts +16 -18
  82. package/frontend-vue/layers/dms-core/app/build/utils/permission-preview.ts +3 -1
  83. package/frontend-vue/layers/dms-core/app/build/utils/sharedRealtimeConnection.ts +6 -8
  84. package/frontend-vue/layers/dms-core/app/composables/period/compareResolvers.ts +16 -16
  85. package/frontend-vue/layers/dms-core/app/composables/period/presetResolvers.ts +1 -0
  86. package/frontend-vue/layers/dms-core/app/composables/useFieldErrors.ts +7 -9
  87. package/frontend-vue/layers/dms-core/app/composables/useFormValidation.ts +0 -6
  88. package/frontend-vue/layers/dms-core/app/composables/user/usePreferences.ts +1 -1
  89. package/frontend-vue/layers/dms-core/app/utils/row-action-rule-evaluator.ts +2 -2
  90. package/frontend-vue/layers/dms-core/app/utils/stringTypeParser.ts +8 -11
  91. package/frontend-vue/layers/dms-core/i18n/locales/core-en-GB.json +81 -0
  92. package/frontend-vue/layers/dms-core/i18n/locales/core-fr-FR.json +81 -0
  93. package/frontend-vue/layers/dms-core/shared/types/runtime-config.d.ts +2 -2
  94. package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/members/MemberRolePicker.vue +6 -7
  95. package/frontend-vue/layers/dms-layout/app/build/composables/dev-reload/useDevReloadHolder.ts +0 -9
  96. package/frontend-vue/layers/dms-layout/app/components/navigation/NavigationMenu.vue +19 -16
  97. package/frontend-vue/layers/dms-layout/app/emails/components/email-logo.ts +5 -7
  98. package/frontend-vue/layers/dms-layout/app/theme/actions.ts +11 -11
  99. package/frontend-vue/layers/dms-layout/app/theme/data.ts +9 -11
  100. package/frontend-vue/layers/dms-layout/app/theme/form-controls.ts +8 -15
  101. package/frontend-vue/layers/dms-layout/app/theme/navigation.ts +12 -12
  102. package/frontend-vue/layers/dms-ui/app/build/composables/containers/drawerSize.ts +4 -1
  103. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultIdentityCells.ts +1 -1
  104. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/metricCells.ts +3 -1
  105. package/frontend-vue/layers/dms-ui/app/build/composables/form/formValidation.ts +12 -14
  106. package/frontend-vue/layers/dms-ui/app/build/composables/form/useFormModel.ts +1 -1
  107. package/frontend-vue/layers/dms-ui/app/build/composables/layout/sidePanelState.ts +3 -1
  108. package/frontend-vue/layers/dms-ui/app/build/composables/table/tableColumnHeaders.ts +6 -6
  109. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/registerDefaultFunctions.ts +1 -1
  110. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/groupedRows.ts +1 -0
  111. package/frontend-vue/layers/dms-ui/app/build/composables/unsaved-changes/formValue.ts +4 -6
  112. package/frontend-vue/layers/dms-ui/app/build/composables/unsaved-changes/registry.ts +0 -10
  113. package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewMessages.ts +0 -6
  114. package/frontend-vue/layers/dms-ui/app/build/utils/codeHighlight.ts +1 -1
  115. package/frontend-vue/layers/dms-ui/app/build/utils/codeLanguages.ts +10 -2
  116. package/frontend-vue/layers/dms-ui/app/build/utils/mockup.ts +0 -5
  117. package/frontend-vue/layers/dms-ui/app/build/utils/mockupCatalog.ts +0 -5
  118. package/frontend-vue/layers/dms-ui/app/build/utils/mockupSections.ts +4 -6
  119. package/frontend-vue/layers/dms-ui/app/build/utils/mockupSpec.ts +7 -7
  120. package/frontend-vue/layers/dms-ui/app/build/utils/sketch.ts +5 -1
  121. package/frontend-vue/layers/dms-ui/app/build/utils/tone.ts +3 -1
  122. package/frontend-vue/layers/dms-ui/app/build/utils/urlVariables.ts +5 -2
  123. package/frontend-vue/layers/dms-ui/app/components/block-preview/MockupViewer.vue +0 -9
  124. package/frontend-vue/layers/dms-ui/app/composables/chart/formatValue.ts +3 -1
  125. package/frontend-vue/layers/dms-ui/app/composables/chart/useChartTheme.ts +5 -1
  126. package/frontend-vue/layers/dms-ui/app/composables/containers/useDrawer.ts +3 -1
  127. package/frontend-vue/layers/dms-ui/app/composables/form/useForm.ts +2 -2
  128. package/frontend-vue/package.json +1 -1
  129. package/frontend-vue/scripts/check-invariants.mjs +21 -0
  130. package/package.json +8 -8
@@ -195,7 +195,10 @@ function sideDrawerWidthBounds(
195
195
  ),
196
196
  );
197
197
  const minSize = Math.min(MIN_SIDE_DRAWER_WIDTH, maxSize);
198
- const preferred = size ? DRAWER_SIZE_WIDTHS[size] : DEFAULT_SIDE_DRAWER_WIDTH;
198
+ const preferred =
199
+ size && Object.hasOwn(DRAWER_SIZE_WIDTHS, size)
200
+ ? DRAWER_SIZE_WIDTHS[size]
201
+ : DEFAULT_SIDE_DRAWER_WIDTH;
199
202
  return {
200
203
  defaultSize: Math.min(maxSize, Math.max(minSize, preferred)),
201
204
  minSize,
@@ -147,7 +147,7 @@ const pillVariantOf = (variant: PillItem["variant"]): StatusPillVariant =>
147
147
  const DEFAULT_PILL_TONE = "neutral";
148
148
 
149
149
  const isPillItem = (item: unknown, labelKey: string): item is PillItem =>
150
- isObject(item) && isString(item.label) && !(labelKey in item);
150
+ isObject(item) && isString(item.label) && !Object.hasOwn(item, labelKey);
151
151
 
152
152
  /**
153
153
  * The pills of a list. A bare id is skipped next to the related rows it
@@ -59,7 +59,9 @@ function statusPillTone(
59
59
  ) {
60
60
  return (
61
61
  readRowTone(row, opts.toneField) ??
62
- opts.tones?.[key] ??
62
+ (opts.tones && Object.hasOwn(opts.tones, key)
63
+ ? opts.tones[key]
64
+ : undefined) ??
63
65
  item?.textColor ??
64
66
  item?.iconColor ??
65
67
  "neutral"
@@ -2,20 +2,6 @@ import type { z } from "zod";
2
2
  import { isBlankValue } from "#dms-core/app/composables/useFormValidation";
3
3
  import { isObject } from "#dms-core/app/utils/type-check";
4
4
 
5
- /**
6
- * How the generic form validates its state on top of the schema the backend
7
- * sends: one rule for every field type of what "left empty" means.
8
- *
9
- * The schema alone cannot say it. It travels as JSON Schema, so a required
10
- * date that is still unpicked fails as "not a valid value" (its union of
11
- * string formats rejects `undefined`), an empty rich-text document
12
- * (`<p></p>`) or an address of empty parts passes or fails part by part, and
13
- * an optional email cleared to `""` is refused although nothing was entered.
14
- *
15
- * What counts as empty is `isBlankValue` (dms-core), the rule the hand-built
16
- * forms of the dashboard follow too.
17
- */
18
-
19
5
  /** A field as the validation sees it. */
20
6
  export interface FormValidationField {
21
7
  id: string;
@@ -135,6 +121,18 @@ function emptyValueOf(field: FormValidationField): false | null {
135
121
  }
136
122
 
137
123
  /**
124
+ * How the generic form validates its state on top of the schema the backend
125
+ * sends: one rule for every field type of what "left empty" means.
126
+ *
127
+ * The schema alone cannot say it. It travels as JSON Schema, so a required
128
+ * date that is still unpicked fails as "not a valid value" (its union of
129
+ * string formats rejects `undefined`), an empty rich-text document
130
+ * (`<p></p>`) or an address of empty parts passes or fails part by part, and
131
+ * an optional email cleared to `""` is refused although nothing was entered.
132
+ *
133
+ * What counts as empty is `isBlankValue` (dms-core), the rule the hand-built
134
+ * forms of the dashboard follow too.
135
+ *
138
136
  * Validates a form state: the schema's issues, except that a required field
139
137
  * left empty gets the one "required" issue (and none of its type's), and a
140
138
  * field left empty in a shape its type refuses (`""` for an optional email,
@@ -345,7 +345,7 @@ export function fieldValuesOfSubmitDefaults(
345
345
  const values: FormData = {};
346
346
  if (!submitDefaults) return values;
347
347
  for (const { id } of fields) {
348
- if (id in submitDefaults) {
348
+ if (Object.hasOwn(submitDefaults, id)) {
349
349
  values[id] = submitDefaults[id];
350
350
  }
351
351
  }
@@ -159,7 +159,9 @@ export function storedSidePanelWidth(
159
159
  bounds: SidePanelWidthBounds,
160
160
  ): number {
161
161
  return clampSidePanelWidth(
162
- preferences.widths[id] ?? bounds.defaultWidth,
162
+ (Object.hasOwn(preferences.widths, id)
163
+ ? preferences.widths[id]
164
+ : undefined) ?? bounds.defaultWidth,
163
165
  bounds,
164
166
  );
165
167
  }
@@ -22,10 +22,10 @@ import {
22
22
 
23
23
  import type { TableColumnContext } from "./tableColumnTypes";
24
24
 
25
- const SORT_DIRECTION_ICON: Record<SortDirection, string> = {
26
- asc: "i-ph-arrow-up",
27
- desc: "i-ph-arrow-down",
28
- };
25
+ const SORT_DIRECTION_ICON: ReadonlyMap<SortDirection, string> = new Map([
26
+ ["asc", "i-ph-arrow-up"],
27
+ ["desc", "i-ph-arrow-down"],
28
+ ]);
29
29
 
30
30
  const SORTABLE_LABEL_CLASS =
31
31
  "group/sort -mx-1.5 inline-flex min-w-0 cursor-pointer items-center gap-1 rounded-[5px] px-1.5 py-[3px] uppercase transition-colors hover:bg-elevated hover:text-default";
@@ -147,7 +147,7 @@ const renderSortIcon = <T extends Data>(
147
147
 
148
148
  if (cue === "active" && isSorted) {
149
149
  return h(Icon, {
150
- name: SORT_DIRECTION_ICON[isSorted],
150
+ name: SORT_DIRECTION_ICON.get(isSorted),
151
151
  class: config.ui.value.columnActiveSortIcon(),
152
152
  });
153
153
  }
@@ -157,7 +157,7 @@ const renderSortIcon = <T extends Data>(
157
157
  { class: SORT_ICON_BOX_CLASS, title: t("dms.sort.default_sort") },
158
158
  [
159
159
  h(Icon, {
160
- name: SORT_DIRECTION_ICON[isSorted],
160
+ name: SORT_DIRECTION_ICON.get(isSorted),
161
161
  class: SORT_DEFAULT_ICON_CLASS,
162
162
  }),
163
163
  ],
@@ -38,7 +38,7 @@ export function resolveFormSuccessTarget(
38
38
 
39
39
  const query: RouteQuery = {};
40
40
  for (const key of preserveQuery ?? []) {
41
- if (route.query[key] !== undefined) {
41
+ if (Object.hasOwn(route.query, key) && route.query[key] !== undefined) {
42
42
  query[key] = route.query[key];
43
43
  }
44
44
  }
@@ -88,6 +88,7 @@ export function rowGroupKey(
88
88
  by: TableViewGroupBy,
89
89
  locale: string,
90
90
  ): string {
91
+ if (!Object.hasOwn(GROUP_KEY_READERS, by)) return NO_GROUP_KEY;
91
92
  return GROUP_KEY_READERS[by](value, locale);
92
93
  }
93
94
 
@@ -3,12 +3,6 @@ import {
3
3
  isObject,
4
4
  isNumber,
5
5
  } from "../../../../../dms-core/app/utils/type-check";
6
- /**
7
- * Value comparison behind the "unsaved changes" state of every form: a form
8
- * is dirty when what it holds differs, by value, from what it loaded (or last
9
- * saved). Typing a value then putting the original back makes it clean again.
10
- */
11
-
12
6
  /** What a form field holds: the value a data type's mapper takes. */
13
7
  type FormValue = Parameters<BeforeStateMapper>[0];
14
8
 
@@ -40,6 +34,10 @@ export function isEmptyFormValue(value: FormValue): boolean {
40
34
  }
41
35
 
42
36
  /**
37
+ * Value comparison behind the "unsaved changes" state of every form: a form
38
+ * is dirty when what it holds differs, by value, from what it loaded (or last
39
+ * saved). Typing a value then putting the original back makes it clean again.
40
+ *
43
41
  * Whether two form values are the same, compared deeply by value: lists item
44
42
  * by item (order counts), objects key by key (whatever their order), dates by
45
43
  * their time; any two empty values are the same (see {@link isEmptyFormValue}).
@@ -1,15 +1,5 @@
1
1
  import { isFunction } from "#dms-core/app/utils/type-check";
2
2
 
3
- /**
4
- * Every form holding unsaved changes, wherever it is (a page, a drawer, a
5
- * modal, a settings panel), and the one confirmation asked before leaving
6
- * them: closing their container, navigating away, switching the tab they sit
7
- * in, going back in the browser or reloading the page.
8
- *
9
- * Plain TypeScript (no Vue context): `useUnsavedChanges` registers the forms
10
- * and hands over the dialog to show.
11
- */
12
-
13
3
  /** Asks the user whether to throw the changes away; `true` to leave. */
14
4
  export type DiscardPrompt = () => Promise<boolean>;
15
5
 
@@ -18,12 +18,6 @@ import {
18
18
  import type { MockupSectionEdit } from "./mockupSections";
19
19
  import { parseSectionEdit } from "./mockupSectionEdits";
20
20
 
21
- /**
22
- * The `postMessage` protocol between `/dms-preview` and the page embedding
23
- * it: what the parent asks the preview to draw, and what the preview reports
24
- * back.
25
- */
26
-
27
21
  export const PREVIEW_CHANNEL = "dms-preview";
28
22
 
29
23
  /** One entry of the sidebar the preview draws around the blocks. */
@@ -85,7 +85,7 @@ const plain: CodeHighlighter = (code) => [{ text: code }];
85
85
  export async function loadCodeHighlighter(
86
86
  language: string,
87
87
  ): Promise<CodeHighlighter> {
88
- const load = READERS[language];
88
+ const load = Object.hasOwn(READERS, language) ? READERS[language] : undefined;
89
89
  if (!load) return plain;
90
90
  const read = await load();
91
91
  return (code) => tokensOf(code, read);
@@ -28,10 +28,18 @@ const CODE_LANGUAGE_LABELS: Record<
28
28
  /** The language an alias (`bash`, `ts`, `plain`) stands for; `text` when unset. */
29
29
  export function resolveCodeLanguage(language: string | undefined): string {
30
30
  const name = language?.trim().toLowerCase() || PLAIN_CODE_LANGUAGE;
31
- return LANGUAGE_ALIASES[name] ?? name;
31
+ return (
32
+ (Object.hasOwn(LANGUAGE_ALIASES, name)
33
+ ? LANGUAGE_ALIASES[name]
34
+ : undefined) ?? name
35
+ );
32
36
  }
33
37
 
34
38
  /** The label of a language; an unknown one is shown as written. */
35
39
  export function codeLanguageLabel(language: string): string {
36
- return CODE_LANGUAGE_LABELS[language] ?? language;
40
+ return (
41
+ (Object.hasOwn(CODE_LANGUAGE_LABELS, language)
42
+ ? CODE_LANGUAGE_LABELS[language]
43
+ : undefined) ?? language
44
+ );
37
45
  }
@@ -9,11 +9,6 @@ import {
9
9
  type PreviewHeaderAction,
10
10
  } from "./blockPreviewMessages";
11
11
 
12
- /**
13
- * The dev-only mockup API the viewer reads (`/api/mockup`): the compiled state
14
- * of a spec file, its annotations, and the list of specs.
15
- */
16
-
17
12
  /** A problem in `spec.json`, at a JSON pointer into it (`""` is the whole file). */
18
13
  export interface MockupIssue {
19
14
  path: string;
@@ -12,11 +12,6 @@ import {
12
12
  } from "./json";
13
13
  import type { MockupSpecNode } from "./mockupSpec";
14
14
 
15
- /**
16
- * The block catalog `GET /api/mockup/schema/blocks` answers, as the editor
17
- * reads it: a mirror of the part of `BlockTypeDescriptor` it uses.
18
- */
19
-
20
15
  /** Presentation hints of one option (`BlockOptionUi`). */
21
16
  export interface MockupOptionUi {
22
17
  label?: string;
@@ -9,12 +9,6 @@ import {
9
9
  type MockupSpecPage,
10
10
  } from "./mockupSpec";
11
11
 
12
- /**
13
- * The sidebar's sections, as the categories of the dashboard's menu group its
14
- * pages: the default section, which holds the pages without a category, then
15
- * each category of the spec in the menu's order.
16
- */
17
-
18
12
  /** Its pages go to the default section. */
19
13
  type RemoveCategoryEdit = { kind: "removeCategory"; category: string };
20
14
 
@@ -54,6 +48,10 @@ export interface MockupSection<Page> {
54
48
  const CATEGORY_ID_FALLBACK = "section";
55
49
 
56
50
  /**
51
+ * The sidebar's sections, as the categories of the dashboard's menu group its
52
+ * pages: the default section, which holds the pages without a category, then
53
+ * each category of the spec in the menu's order.
54
+ *
57
55
  * The pages under their sections: the default section first, then each
58
56
  * category in order, each holding its pages in the order given. A page that
59
57
  * names no category given is in the default section.
@@ -10,12 +10,6 @@ import {
10
10
  type JsonWritable,
11
11
  } from "./json";
12
12
 
13
- /**
14
- * `mockups/<name>/spec.json` as the editor reads and writes it: the spec as
15
- * written, `fixture:` references and every field the editor does not know
16
- * kept as they are.
17
- */
18
-
19
13
  /** A node of a page tree, as written. */
20
14
  export interface MockupSpecNode {
21
15
  type?: string;
@@ -36,7 +30,13 @@ export interface MockupSpecPage {
36
30
  [field: string]: JsonValue | MockupSpecNode[];
37
31
  }
38
32
 
39
- /** The whole spec, as written. */
33
+ /**
34
+ * `mockups/<name>/spec.json` as the editor reads and writes it: the spec as
35
+ * written, `fixture:` references and every field the editor does not know
36
+ * kept as they are.
37
+ *
38
+ * The whole spec, as written.
39
+ */
40
40
  export interface MockupSpecDocument {
41
41
  pages: MockupSpecPage[];
42
42
  [field: string]: JsonValue | MockupSpecPage[];
@@ -51,7 +51,11 @@ export function resolveSketchLinks(
51
51
  ): string {
52
52
  return html.replace(EVERY_PAGE_LINK, (_link, path: string) => {
53
53
  const filled = path.replace(ROUTE_TOKEN, (_token, name: string) =>
54
- encodeURIComponent(links.params?.[name] ?? ""),
54
+ encodeURIComponent(
55
+ (links.params && Object.hasOwn(links.params, name)
56
+ ? links.params[name]
57
+ : undefined) ?? "",
58
+ ),
55
59
  );
56
60
  return `<a href="${links.origin}${filled}" target="_top"`;
57
61
  });
@@ -78,7 +78,9 @@ export const DMS_TONE_OUTLINE: Record<Tone, string> = {
78
78
  * for a value that is no tone.
79
79
  */
80
80
  export function toneTextClass(tone: string | undefined): string {
81
- return tone && isDmsTone(tone) ? DMS_TONE_TEXT[tone] : "";
81
+ return tone && isDmsTone(tone) && Object.hasOwn(DMS_TONE_TEXT, tone)
82
+ ? DMS_TONE_TEXT[tone]
83
+ : "";
82
84
  }
83
85
 
84
86
  /**
@@ -53,8 +53,11 @@ function fillRouteTokens(
53
53
  encoding: TokenEncoding,
54
54
  ): string {
55
55
  return text
56
- .replace(PARAM_TOKEN, (match, key) => {
57
- const value = context.routeParams?.[key];
56
+ .replace(PARAM_TOKEN, (match, key: string) => {
57
+ const value =
58
+ context.routeParams && Object.hasOwn(context.routeParams, key)
59
+ ? context.routeParams[key]
60
+ : undefined;
58
61
  return value ? encoding.param(value) : match;
59
62
  })
60
63
  .replace(QUERY_TOKEN, (match, key) => {
@@ -7,15 +7,6 @@ import {
7
7
  readQueryValue,
8
8
  } from "../../build/utils/mockup";
9
9
 
10
- /**
11
- * The dev-only `/mockup` page. `?name=` picks a mockup, which it draws live
12
- * on its Overview, or on the page `?page=` names, with `?width=desktop|mobile`
13
- * and `?data=real|sample` choosing the frame width and whether a converted
14
- * page reads its live routes; without a name it lists the mockups the
15
- * backend holds. Either way it marks itself as a surface the dashboard's side
16
- * panel docks beside; its layout keeps the room for that panel.
17
- */
18
-
19
10
  const route = useDmsRoute();
20
11
 
21
12
  const name = readQueryValue(route.query.name);
@@ -55,7 +55,9 @@ const NUMBER_FORMAT_CONFIGS: Record<ValueFormat, NumberFormatConfig> = {
55
55
  };
56
56
 
57
57
  function resolveConfig(format: ValueFormat): NumberFormatConfig {
58
- return NUMBER_FORMAT_CONFIGS[format] ?? NUMBER_FORMAT_CONFIGS.number;
58
+ return Object.hasOwn(NUMBER_FORMAT_CONFIGS, format)
59
+ ? NUMBER_FORMAT_CONFIGS[format]
60
+ : NUMBER_FORMAT_CONFIGS.number;
59
61
  }
60
62
 
61
63
  function precisionOptions(
@@ -122,7 +122,11 @@ function colorVariable(value: string): string | undefined {
122
122
  const variable = CSS_VARIABLE_FUNCTION.exec(value);
123
123
  if (variable) return variable[1];
124
124
  const token = SHADE_TOKEN.exec(value);
125
- if (!token) return COLOR_NAME_TO_VAR[value];
125
+ if (!token) {
126
+ return Object.hasOwn(COLOR_NAME_TO_VAR, value)
127
+ ? COLOR_NAME_TO_VAR[value]
128
+ : undefined;
129
+ }
126
130
  const scale = token[1] === "accent" ? "primary" : token[1];
127
131
  return `--ui-color-${scale}-${token[2]}`;
128
132
  }
@@ -43,7 +43,9 @@ export function useDrawer() {
43
43
  const drawerOptions: DrawerOptions & DrawerCallerContext = {
44
44
  ...containerOptions,
45
45
 
46
- callerProvides: DMS_OWN_DRAWER in options ? undefined : caller?.provides,
46
+ callerProvides: Object.hasOwn(options, DMS_OWN_DRAWER)
47
+ ? undefined
48
+ : caller?.provides,
47
49
  ...(rowHeader && {
48
50
  headerComponent: DmsRowHeader,
49
51
  headerComponentOptions: headerProps(),
@@ -441,8 +441,8 @@ function createFormActions(context: ReturnType<typeof createFormSubmission>) {
441
441
  showUnresolvedTargetToast();
442
442
  throw new Error(`Form submit target: missing ${target.missing}`);
443
443
  }
444
- const changedFields = allFields.value.filter(
445
- (field) => field.id in changes,
444
+ const changedFields = allFields.value.filter((field) =>
445
+ Object.hasOwn(changes, field.id),
446
446
  );
447
447
  const body = collectSubmitData(changes, changedFields, {
448
448
  initialValues: initialValues.value,
@@ -80,7 +80,7 @@
80
80
  "devDependencies": {
81
81
  "@antelopejs/core": "~1.24.5",
82
82
  "@antelopejs/dms-frontend": ">=0.11.11 <0.12.0",
83
- "@antelopejs/tooling-configs": ">=0.10.1 <0.11.0",
83
+ "@antelopejs/tooling-configs": ">=0.10.4 <0.11.0",
84
84
  "@inertiajs/vue3": "^3.7.0",
85
85
  "@nuxt/eslint-config": "^1.17.0",
86
86
  "@nuxt/ui": "4.10.0",
@@ -411,6 +411,26 @@ function checkGeistNarrowSpace() {
411
411
  }
412
412
  }
413
413
 
414
+ /** Every `@vitest-environment` pragma is its own comment, outside any doc block. */
415
+ function checkVitestPragmas() {
416
+ const misplaced = [
417
+ ...sources,
418
+ ...collectSources(join(ROOT, "tests")).map((file) => ({
419
+ file,
420
+ source: readFileSync(file, "utf8"),
421
+ })),
422
+ ].flatMap(({ file, source }) =>
423
+ [...source.matchAll(/\/\*\*[\s\S]*?\*\//g)]
424
+ .filter((match) => match[0].includes("@vitest-environment"))
425
+ .map(() => relative(ROOT, file)),
426
+ );
427
+ assert.deepEqual(
428
+ misplaced,
429
+ [],
430
+ "Write @vitest-environment as its own `//` comment on the first line, outside any doc block",
431
+ );
432
+ }
433
+
414
434
  /** @type {[string, () => unknown][]} */
415
435
  const CHECKS = [
416
436
  ["API error presentation", () => assertApiErrorPresentation([LAYERS_DIR])],
@@ -429,6 +449,7 @@ const CHECKS = [
429
449
  ["Geist narrow no-break spaces", checkGeistNarrowSpace],
430
450
  ["font asset URLs", checkFontAssetUrls],
431
451
  ["onboarding page meta", checkOnboardingPageMeta],
452
+ ["vitest environment pragmas", checkVitestPragmas],
432
453
  ];
433
454
 
434
455
  for (const [name, check] of CHECKS) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antelopejs/dms",
3
- "version": "0.24.2",
3
+ "version": "0.24.3-next.1066.g4f2d355",
4
4
  "description": "AntelopeJS DMS. Plug in your PostgreSQL, MySQL, MariaDB, MongoDB or RethinkDB database and your coding agent builds a back office and analytics dashboard as typed TypeScript. Real-time updates on the data the DMS manages.",
5
5
  "keywords": [
6
6
  "antelopejs",
@@ -82,12 +82,14 @@
82
82
  },
83
83
  "dependencies": {
84
84
  "2fa": "^0.1.2",
85
- "@antelopejs/interface-api": ">=0.3.4 <0.4.0",
85
+ "@antelopejs/interface-api": ">=0.3.5 <0.4.0",
86
86
  "@antelopejs/interface-api-util": ">=0.3.3 <0.4.0",
87
87
  "@antelopejs/interface-core": ">=0.5.2 <0.6.0",
88
88
  "@antelopejs/interface-data-api": ">=0.8.2 <0.9.0",
89
89
  "@antelopejs/interface-database": ">=0.4.3 <0.5.0",
90
90
  "@antelopejs/interface-database-decorators": ">=0.5.4 <0.6.0",
91
+ "@antelopejs/interface-dms": "0.17.2-next.1066.g4f2d355",
92
+ "@antelopejs/interface-dms-builder": "0.6.4-next.1064.gb3934da",
91
93
  "@antelopejs/interface-email": ">=0.2.1 <0.3.0",
92
94
  "@antelopejs/interface-file-storage": ">=0.1.4 <0.2.0",
93
95
  "@csstools/css-tokenizer": "^4.0.3",
@@ -109,18 +111,16 @@
109
111
  "striptags": "^3.2.0",
110
112
  "ts-morph": "^28.0.0",
111
113
  "ua-parser-js": "^2.0.9",
112
- "zod": "^4.5.0",
113
- "@antelopejs/interface-dms": "^0.17.1",
114
- "@antelopejs/interface-dms-builder": "^0.6.3"
114
+ "zod": "^4.5.0"
115
115
  },
116
116
  "devDependencies": {
117
- "@antelopejs/api": "~1.7.8",
117
+ "@antelopejs/api": "~1.7.9",
118
118
  "@antelopejs/core": "~1.24.5",
119
119
  "@antelopejs/mongodb": ">=1.8.13 <1.9.0",
120
120
  "@antelopejs/mysql": ">=0.2.7 <0.3.0",
121
121
  "@antelopejs/postgres": ">=0.4.3 <0.5.0",
122
122
  "@antelopejs/rethinkdb": "~1.10.6",
123
- "@antelopejs/tooling-configs": ">=0.10.1 <0.11.0",
123
+ "@antelopejs/tooling-configs": ">=0.10.4 <0.11.0",
124
124
  "@playwright/test": "~1.65.0",
125
125
  "@types/archiver": "^6.0.4",
126
126
  "@types/chai": "^4.3.20",
@@ -211,7 +211,7 @@
211
211
  "optional": true
212
212
  }
213
213
  },
214
- "gitHead": "a8c2af13faad10e04fd08e082a22f7e7f327f98c",
214
+ "gitHead": "4f2d35515b5a6ae865afbf69c387ded8234aa812",
215
215
  "scripts": {
216
216
  "build": "pnpm --filter @antelopejs/interface-dms --filter @antelopejs/interface-dms-builder build && rimraf dist && antelopejs-tsc && tsc-alias && tsc -p e2e/tsconfig.types.json",
217
217
  "dev": "ajs project run --inspect -w -p playground",