@heypointerhq/sdk 0.0.0-stage → 0.2.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/LICENSE +202 -0
- package/NOTICE +5 -0
- package/README.md +127 -2
- package/dist/author/capture.d.ts +53 -0
- package/dist/author/draft.d.ts +81 -0
- package/dist/author/flow.d.ts +31 -0
- package/dist/author/global.d.ts +1 -0
- package/dist/author/index.d.ts +49 -0
- package/dist/author/labels.d.ts +73 -0
- package/dist/author/panel.d.ts +61 -0
- package/dist/author/policy.d.ts +21 -0
- package/dist/author-import.d.ts +1 -0
- package/dist/author-import.iife.d.ts +1 -0
- package/dist/author-loader.d.ts +17 -0
- package/dist/author.js +750 -0
- package/dist/chunk-element.js +896 -0
- package/dist/chunk-theme.js +319 -0
- package/dist/client.d.ts +32 -0
- package/dist/contrast.d.ts +5 -0
- package/dist/element.d.ts +43 -0
- package/dist/element.js +1 -0
- package/dist/global.d.ts +2 -0
- package/dist/heypointer.author.js +2 -0
- package/dist/heypointer.global.js +2 -0
- package/dist/highlight.d.ts +21 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +3 -0
- package/dist/labels.d.ts +81 -0
- package/dist/player.d.ts +193 -0
- package/dist/recorder.d.ts +12 -0
- package/dist/spotlight.d.ts +28 -0
- package/dist/targeting/index.d.ts +26 -0
- package/dist/targeting/watch.d.ts +6 -0
- package/dist/theme.d.ts +32 -0
- package/dist/types.d.ts +5 -0
- package/dist/validate.d.ts +6 -0
- package/package.json +58 -4
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { type ResolvedAuthorLabels } from './labels';
|
|
2
|
+
import { type DraftStore } from './draft';
|
|
3
|
+
export type Mode = 'idle' | 'recording' | 'paused' | 'review';
|
|
4
|
+
/** What the panel needs from the controller. The panel holds no state of its own beyond what it draws. */
|
|
5
|
+
export interface PanelApi {
|
|
6
|
+
store: DraftStore;
|
|
7
|
+
mode(): Mode;
|
|
8
|
+
recordRows(): boolean;
|
|
9
|
+
setRecordRows(on: boolean): void;
|
|
10
|
+
record(): void;
|
|
11
|
+
pause(): void;
|
|
12
|
+
stop(): void;
|
|
13
|
+
keepRecording(): void;
|
|
14
|
+
discard(): void;
|
|
15
|
+
/** End author mode and remove the panel (asks first when a draft exists). */
|
|
16
|
+
close(): void;
|
|
17
|
+
/** The author changed a step's sentence: re-read the control name and check it again. */
|
|
18
|
+
edited(id: number): void;
|
|
19
|
+
recheckAll(): void;
|
|
20
|
+
addContext(id: number): void;
|
|
21
|
+
}
|
|
22
|
+
export declare class Panel {
|
|
23
|
+
private readonly api;
|
|
24
|
+
private labels;
|
|
25
|
+
readonly host: HTMLElement;
|
|
26
|
+
private readonly root;
|
|
27
|
+
private readonly panel;
|
|
28
|
+
private readonly live;
|
|
29
|
+
private minimized;
|
|
30
|
+
private side;
|
|
31
|
+
private stepsOpen;
|
|
32
|
+
private copiedNote;
|
|
33
|
+
private unsub;
|
|
34
|
+
private pendingFocus;
|
|
35
|
+
private readonly onKey;
|
|
36
|
+
constructor(api: PanelApi, labels: ResolvedAuthorLabels, opts: {
|
|
37
|
+
mountTo?: HTMLElement;
|
|
38
|
+
dir?: string;
|
|
39
|
+
lang?: string;
|
|
40
|
+
scheme?: string;
|
|
41
|
+
themeVars?: Record<string, string>;
|
|
42
|
+
});
|
|
43
|
+
setLabels(labels: ResolvedAuthorLabels): void;
|
|
44
|
+
destroy(): void;
|
|
45
|
+
/** Move focus into the panel (the Alt+Shift+G shortcut, and after a review step). */
|
|
46
|
+
focus(key: string): void;
|
|
47
|
+
private t;
|
|
48
|
+
private applyFocus;
|
|
49
|
+
private announce;
|
|
50
|
+
render(): void;
|
|
51
|
+
private button;
|
|
52
|
+
private titleField;
|
|
53
|
+
private editView;
|
|
54
|
+
private list;
|
|
55
|
+
private noteItem;
|
|
56
|
+
private chips;
|
|
57
|
+
private stepItem;
|
|
58
|
+
private reviewView;
|
|
59
|
+
private copy;
|
|
60
|
+
private download;
|
|
61
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { clean } from './flow';
|
|
2
|
+
/** Tag name, lower case. `instanceof HTMLInputElement` is false for an element from an iframe (another realm), so tags are compared instead. */
|
|
3
|
+
export declare const tagOf: (n: Node | null | undefined) => string;
|
|
4
|
+
export declare const typeOf: (el: Element) => string;
|
|
5
|
+
export declare function isSensitiveField(el: Element): boolean;
|
|
6
|
+
/**
|
|
7
|
+
* The text a recorded step quotes. Same source as the resolver (aria-label, then the labels, then the text),
|
|
8
|
+
* except that a form control without a label gives nothing: its own text is option lists or typed content.
|
|
9
|
+
*/
|
|
10
|
+
export declare function controlName(el: HTMLElement): string;
|
|
11
|
+
/** Does this control text look like a person's data rather than the name of a control? */
|
|
12
|
+
export declare function looksLikePageData(text: string, el?: Element): boolean;
|
|
13
|
+
/** Elements a click is "on a control" for. A plain container is not. */
|
|
14
|
+
export declare const CLICKABLE: string;
|
|
15
|
+
export declare const isDisabled: (el: Element) => boolean;
|
|
16
|
+
/** A control a person can see and reach, not the author panel's own. */
|
|
17
|
+
export declare const isRecordable: (el: HTMLElement) => boolean;
|
|
18
|
+
export declare const isTextEntry: (el: Element) => boolean;
|
|
19
|
+
/** The nearest landmark's name, for "Save in the Billing dialog". Never text typed by the user. */
|
|
20
|
+
export declare function contextOf(el: Element): string;
|
|
21
|
+
export { clean };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const importAuthor: () => Promise<typeof import("./author/index")>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const importAuthor: () => Promise<null>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { AuthorOptions, AuthorSession } from './author/index';
|
|
2
|
+
/**
|
|
3
|
+
* Author mode (record steps) is opt-in and lazy. Nothing of it is in this bundle: the npm build imports it as its own
|
|
4
|
+
* chunk, the script-tag build loads `heypointer.author.js` from the folder the main script came from.
|
|
5
|
+
*/
|
|
6
|
+
export interface AuthorApi {
|
|
7
|
+
startAuthoring(opts?: AuthorOptions): AuthorSession;
|
|
8
|
+
}
|
|
9
|
+
export declare const AUTHOR_PARAM = "heypointer-author";
|
|
10
|
+
/** The script-tag bundle tells the loader where it was loaded from. */
|
|
11
|
+
export declare const rememberScript: (src: string) => void;
|
|
12
|
+
/** Explicit opt-in only: `author: true`, or the URL param when the host allowed it (and its resume after a page load). */
|
|
13
|
+
export declare function authorRequested(o: {
|
|
14
|
+
author?: boolean;
|
|
15
|
+
allowAuthorParam?: boolean;
|
|
16
|
+
}): boolean;
|
|
17
|
+
export declare function loadAuthor(): Promise<AuthorApi | null>;
|