@antelopejs/dms 0.21.4-next.1007.gae3a8da → 0.21.4-next.1009.gbc3beff

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.
@@ -9,6 +9,7 @@ import {
9
9
  import CommandPaletteAssistantAnswer from "../../build/components/layout/CommandPaletteAssistantAnswer.vue";
10
10
  import { ASSISTANT_MODE_KEY } from "../../build/composables/command-palette/assistantGroups";
11
11
  import { useCommandPaletteAssistantMode } from "../../build/composables/command-palette/useCommandPaletteAssistantMode";
12
+ import { SHORTCUTS_PAGE_SHORTCUT } from "#dms-ui/app/entries/composables/global/shortcuts";
12
13
 
13
14
  const { t } = useI18n();
14
15
  const appConfig = useDmsAppConfig();
@@ -61,6 +62,15 @@ function close(): void {
61
62
  isOpen.value = false;
62
63
  }
63
64
 
65
+ /** The page "?" opens: the keyboard shortcuts, in the user's settings. */
66
+ const SHORTCUTS_PAGE_PATH = "/settings/user/shortcuts";
67
+
68
+ defineShortcuts({
69
+ [SHORTCUTS_PAGE_SHORTCUT]: () => {
70
+ void navigateDms(SHORTCUTS_PAGE_PATH);
71
+ },
72
+ });
73
+
64
74
  /**
65
75
  * Set on `<html>` while the palette is mounted, which is while its ⌘ K /
66
76
  * Ctrl K shortcut listens. The palette renders nothing until opened and
@@ -10,6 +10,7 @@ interface Props {
10
10
  targetTree: ResolvedComponentInfo;
11
11
  pageId: string;
12
12
  componentId: string;
13
+ routeParams?: Record<string, string>;
13
14
  }
14
15
 
15
16
  defineProps<Props>();
@@ -23,5 +24,6 @@ const attrs = useAttrs();
23
24
  :page-id="pageId"
24
25
  :component-id="componentId"
25
26
  :root-props="attrs"
27
+ :route-params="routeParams"
26
28
  />
27
29
  </template>
@@ -12,6 +12,7 @@ import {
12
12
  type WrittenRecord,
13
13
  } from "../table-view/utils/recordLink";
14
14
  import { fillRowChildren, fillRowOptions } from "./rowComponentOptions";
15
+ import { currentPageUrlValues } from "../page/pageUrlValues";
15
16
  import { resolveComponentChildren } from "../../../utils/componentTree";
16
17
  import TargetComponentTree from "../../components/containers/TargetComponentTree.vue";
17
18
  import { resolveConfirmText } from "../confirm/confirmDialogTexts";
@@ -87,7 +88,10 @@ export function createTargetRows(config: ActionTargetsConfig) {
87
88
  const id = rowIdOf(row);
88
89
  const tokens = row && id !== undefined ? { ...row, id } : row;
89
90
  const declared = component?.options ?? {};
90
- const options = tokens ? fillRowOptions(declared, tokens) : declared;
91
+ const options = {
92
+ ...(tokens ? fillRowOptions(declared, tokens) : declared),
93
+ routeParams: currentPageUrlValues().routeParams,
94
+ };
91
95
  const children = component?.children;
92
96
  if (!component?.componentName || !children?.length) return options;
93
97
  const targetTree: ResolvedComponentInfo = {
@@ -121,19 +121,29 @@ export function useMockupViewerShortcuts(
121
121
  return matchShortcuts(event, view.value).some((id) => actions[id]());
122
122
  }
123
123
 
124
- /** Whether the viewer takes a key: one pressed outside a field, or an Escape a field of the inspector left, with a block selected to step back from. */
125
- function takesKey(event: KeyboardEvent): boolean {
126
- if (!isFieldKey(event.target)) return true;
127
- return editing.selection.value !== undefined && isInspectorEscape(event);
124
+ /** A key pressed outside a field, seen before the page's other listeners: once a shortcut acts, none of them sees it. */
125
+ function onKeydown(event: KeyboardEvent): void {
126
+ if (isFieldKey(event.target) || !run(event)) return;
127
+ event.preventDefault();
128
+ event.stopPropagation();
128
129
  }
129
130
 
130
- function onKeydown(event: KeyboardEvent): void {
131
- if (!takesKey(event)) return;
132
- if (run(event)) event.preventDefault();
131
+ /** An Escape a field of the inspector left, with a block selected to step back from, once the field had its turn. */
132
+ function onFieldEscape(event: KeyboardEvent): void {
133
+ if (!isFieldKey(event.target) || editing.selection.value === undefined) {
134
+ return;
135
+ }
136
+ if (isInspectorEscape(event) && run(event)) event.preventDefault();
133
137
  }
134
138
 
135
- onMounted(() => window.addEventListener("keydown", onKeydown));
136
- onBeforeUnmount(() => window.removeEventListener("keydown", onKeydown));
139
+ onMounted(() => {
140
+ window.addEventListener("keydown", onKeydown, true);
141
+ window.addEventListener("keydown", onFieldEscape);
142
+ });
143
+ onBeforeUnmount(() => {
144
+ window.removeEventListener("keydown", onKeydown, true);
145
+ window.removeEventListener("keydown", onFieldEscape);
146
+ });
137
147
 
138
148
  return { undo, redo, run };
139
149
  }
@@ -12,6 +12,19 @@ export const GLOBAL_META_K_METADATA: ShortcutMetadata = {
12
12
  component: GLOBAL_COMPONENT,
13
13
  };
14
14
 
15
+ /** The key that opens the keyboard shortcuts page. */
16
+ export const SHORTCUTS_PAGE_SHORTCUT = "?";
17
+
18
+ /** Opens the keyboard shortcuts page from anywhere outside a text field. */
19
+ export const GLOBAL_QUESTION_MARK_METADATA: ShortcutMetadata = {
20
+ key: [SHORTCUTS_PAGE_SHORTCUT],
21
+ descriptionKey: "$dms.shortcuts.global.question_mark.description",
22
+ component: GLOBAL_COMPONENT,
23
+ condition: {
24
+ descriptionKey: "$dms.shortcuts.global.question_mark.condition",
25
+ },
26
+ };
27
+
15
28
  /** Closes the topmost dialog, menu or the command palette. */
16
29
  export const GLOBAL_ESCAPE_METADATA: ShortcutMetadata = {
17
30
  key: ["$keyboard.escape"],
@@ -27,5 +40,6 @@ export const GLOBAL_SHORTCUTS_METADATA = [
27
40
  GLOBAL_META_K_METADATA,
28
41
  GLOBAL_SLASH_METADATA,
29
42
  GLOBAL_META_SLASH_METADATA,
43
+ GLOBAL_QUESTION_MARK_METADATA,
30
44
  GLOBAL_ESCAPE_METADATA,
31
45
  ];
@@ -0,0 +1 @@
1
+ export * from "../../../build/composables/global/shortcuts";
@@ -526,6 +526,10 @@
526
526
  "description": "Focus the page's own search",
527
527
  "condition": "Settings pages with a search of their own, such as this one"
528
528
  },
529
+ "question_mark": {
530
+ "description": "Open the keyboard shortcuts page",
531
+ "condition": "Outside a text field"
532
+ },
529
533
  "escape": {
530
534
  "description": "Close dialogs, menus and the palette"
531
535
  }
@@ -526,6 +526,10 @@
526
526
  "description": "Aller à la recherche propre à la page",
527
527
  "condition": "Pages de paramètres qui ont leur propre recherche, comme celle-ci"
528
528
  },
529
+ "question_mark": {
530
+ "description": "Ouvrir la page des raccourcis clavier",
531
+ "condition": "En dehors d'un champ de texte"
532
+ },
529
533
  "escape": {
530
534
  "description": "Fermer les dialogues, les menus et la palette"
531
535
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antelopejs/dms",
3
- "version": "0.21.4-next.1007.gae3a8da",
3
+ "version": "0.21.4-next.1009.gbc3beff",
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",
@@ -89,7 +89,7 @@
89
89
  "@antelopejs/interface-data-api": ">=0.8.0 <0.9.0",
90
90
  "@antelopejs/interface-database": ">=0.4.0 <0.5.0",
91
91
  "@antelopejs/interface-database-decorators": ">=0.5.2 <0.6.0",
92
- "@antelopejs/interface-dms": "0.14.7-next.1006.g63d3e11",
92
+ "@antelopejs/interface-dms": "0.14.7-next.1008.g198383f",
93
93
  "@antelopejs/interface-dms-builder": "0.6.2-next.987.gb437fd0",
94
94
  "@antelopejs/interface-email": ">=0.2.1 <0.3.0",
95
95
  "@antelopejs/interface-file-storage": ">=0.1.4 <0.2.0",
@@ -213,7 +213,7 @@
213
213
  "optional": true
214
214
  }
215
215
  },
216
- "gitHead": "ae3a8daf5284e30df23c1b58d30e0bdb2952a4e7",
216
+ "gitHead": "bc3beffb99d5432a8106262a578b63f29956064c",
217
217
  "scripts": {
218
218
  "build": "pnpm --filter @antelopejs/interface-dms --filter @antelopejs/interface-dms-builder build && rimraf dist && antelopejs-tsc && tsc-alias && tsc -p e2e/tsconfig.types.json",
219
219
  "dev": "ajs project run --inspect -w -p playground",