@stnd/launcher 1.6.7 → 1.7.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @stnd/launcher
2
2
 
3
+ ## 1.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Auto-bumped @stnd/launcher due to modified code.
8
+
3
9
  ## 1.6.7
4
10
 
5
11
  ### Patch Changes
package/Launcher.svelte CHANGED
@@ -158,9 +158,10 @@
158
158
  key: "Escape",
159
159
  id: "launcher-escape",
160
160
  action: () => {
161
- // Only go back if not in a modal/launcher (handled by their own listeners)
162
- // But for now, simple history back is the standard behavior
163
- window.history.back();
161
+ // A step back in the history is the default. An app can take the key instead: the
162
+ // event is cancelable, and cancelling it means the app has dealt with Esc.
163
+ const handled = !window.dispatchEvent(new CustomEvent("stnd:escape", { cancelable: true }));
164
+ if (!handled) window.history.back();
164
165
  },
165
166
  }),
166
167
  ];
package/README.md CHANGED
@@ -165,6 +165,10 @@ Switch the active view.
165
165
  - **view**: Trigger ID of the view.
166
166
  - **props**: Data to pass to the view component.
167
167
 
168
+ ## Keyboard: Esc
169
+
170
+ The launcher registers `Esc` with the keyboard module. By default it steps back in the history. Before doing so it dispatches a cancelable `stnd:escape` event on `window`: an app that wants Esc to lead somewhere else (its home page, its own panel) listens to it and calls `event.preventDefault()`, and the history is left alone. The àVélo app uses it to send Esc to its overview (`apps/ÀVélo-stat/modules/core/scripts/shortcuts.ts`).
171
+
168
172
  ## Data Attributes
169
173
 
170
174
  The UI listens for clicks on elements with specific data attributes:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stnd/launcher",
3
- "version": "1.6.7",
3
+ "version": "1.7.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },