@vitrinka/web 0.1.2 → 0.1.3

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,13 @@
1
1
  # @vitrinka/web
2
2
 
3
+ ## 0.1.3
4
+
5
+ - **A throw over a page link or image lands.** Grabbing the HUD where the
6
+ page has a link or image underneath could start the browser's native drag
7
+ of that element. The browser then cancelled the pointer, and the HUD snapped
8
+ back to its spot. A press on the capsule, the puck or the tab now blocks
9
+ native drags until it ends.
10
+
3
11
  ## 0.1.2
4
12
 
5
13
  - **A HUD that is barely there.** Idle, it is a 28px glass puck (a hollow
@@ -89,6 +89,19 @@ export function useDock(onMoveStart) {
89
89
  ro.observe(el);
90
90
  return () => ro.disconnect();
91
91
  }, []);
92
+ // A press on a handle (capsule, puck or tab) belongs to the HUD alone. On
93
+ // the first move the browser hit-tests the press point again for a native
94
+ // drag source. By then the dock has moved off that point, so a link or image
95
+ // of the page underneath would start a native drag, which cancels the
96
+ // pointer and drops the throw. Cancel any dragstart while a press is live.
97
+ useEffect(() => {
98
+ const guard = (e) => {
99
+ if (press.current)
100
+ e.preventDefault();
101
+ };
102
+ document.addEventListener('dragstart', guard, true);
103
+ return () => document.removeEventListener('dragstart', guard, true);
104
+ }, []);
92
105
  const release = useCallback((e, cancelled) => {
93
106
  const p = press.current;
94
107
  press.current = null;
@@ -17,8 +17,8 @@ import { type SessionState } from './queue';
17
17
  export { currentRoute, notify, subscribe } from './state';
18
18
  export type { SessionDone } from '../protocol';
19
19
  /** Sent as `meta.recorder`; bumped with the package version. */
20
- export declare const RECORDER_VERSION = "0.1.2";
21
- export declare const RECORDER_ID = "web/0.1.2";
20
+ export declare const RECORDER_VERSION = "0.1.3";
21
+ export declare const RECORDER_ID = "web/0.1.3";
22
22
  /** What `POST /api/v1/sessions` answers (the fields this recorder keeps). */
23
23
  export interface SessionOut {
24
24
  id: string;
@@ -5,7 +5,7 @@ import { armReconcile, capturesSettled, disarmReconcile, drainBuffer, getState,
5
5
  import { currentRoute, notify } from './state';
6
6
  export { currentRoute, notify, subscribe } from './state';
7
7
  /** Sent as `meta.recorder`; bumped with the package version. */
8
- export const RECORDER_VERSION = '0.1.2';
8
+ export const RECORDER_VERSION = '0.1.3';
9
9
  export const RECORDER_ID = `web/${RECORDER_VERSION}`;
10
10
  /**
11
11
  * Re-apply a RECOVERED session's redaction policy after a reload — and
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitrinka/web",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "vitrinka toolkit for React DOM apps — the journey recorder: capture manual-testing sessions (rrweb DOM stream, clicks, navigation, network, console, notes) straight into vitrinka boards.",
5
5
  "license": "Elastic-2.0",
6
6
  "repository": {