annotation-kit 0.0.0-stage → 0.1.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 +21 -0
- package/NOTICE +75 -0
- package/README.md +114 -2
- package/README.zh-CN.md +112 -0
- package/dist/annotation-kit.css +157 -0
- package/dist/chunks/references-ukB-tSle.js +1126 -0
- package/dist/chunks/references-ukB-tSle.js.map +1 -0
- package/dist/electron/element-context.cjs +72 -0
- package/dist/electron/guest-preload.cjs +327 -0
- package/dist/electron.js +394 -0
- package/dist/electron.js.map +1 -0
- package/dist/index.js +910 -0
- package/dist/index.js.map +1 -0
- package/dist/react.js +2256 -0
- package/dist/react.js.map +1 -0
- package/dist/styles.d.ts +2 -0
- package/dist/types/address.d.ts +53 -0
- package/dist/types/address.d.ts.map +1 -0
- package/dist/types/client/Workbench.d.ts +11 -0
- package/dist/types/client/Workbench.d.ts.map +1 -0
- package/dist/types/client/composer/PacketPreview.d.ts +12 -0
- package/dist/types/client/composer/PacketPreview.d.ts.map +1 -0
- package/dist/types/client/composer/ReferenceCard.d.ts +12 -0
- package/dist/types/client/composer/ReferenceCard.d.ts.map +1 -0
- package/dist/types/client/composer/attachments.d.ts +10 -0
- package/dist/types/client/composer/attachments.d.ts.map +1 -0
- package/dist/types/client/composer/commit.d.ts +4 -0
- package/dist/types/client/composer/commit.d.ts.map +1 -0
- package/dist/types/client/composer/packets.d.ts +53 -0
- package/dist/types/client/composer/packets.d.ts.map +1 -0
- package/dist/types/client/composer/reference-presentation.d.ts +4 -0
- package/dist/types/client/composer/reference-presentation.d.ts.map +1 -0
- package/dist/types/client/error-copy.d.ts +69 -0
- package/dist/types/client/error-copy.d.ts.map +1 -0
- package/dist/types/client/errors.d.ts +10 -0
- package/dist/types/client/errors.d.ts.map +1 -0
- package/dist/types/client/files/FileSelectionAction.d.ts +7 -0
- package/dist/types/client/files/FileSelectionAction.d.ts.map +1 -0
- package/dist/types/client/files/SelectionCard.d.ts +14 -0
- package/dist/types/client/files/SelectionCard.d.ts.map +1 -0
- package/dist/types/client/files/document-workflow.d.ts +34 -0
- package/dist/types/client/files/document-workflow.d.ts.map +1 -0
- package/dist/types/client/files/pages/DocumentChrome.d.ts +30 -0
- package/dist/types/client/files/pages/DocumentChrome.d.ts.map +1 -0
- package/dist/types/client/files/pages/PageSelectionAction.d.ts +7 -0
- package/dist/types/client/files/pages/PageSelectionAction.d.ts.map +1 -0
- package/dist/types/client/files/pages/batches.d.ts +21 -0
- package/dist/types/client/files/pages/batches.d.ts.map +1 -0
- package/dist/types/client/files/pages/geometry.d.ts +16 -0
- package/dist/types/client/files/pages/geometry.d.ts.map +1 -0
- package/dist/types/client/files/pages/image-store.d.ts +8 -0
- package/dist/types/client/files/pages/image-store.d.ts.map +1 -0
- package/dist/types/client/files/pages/images.d.ts +41 -0
- package/dist/types/client/files/pages/images.d.ts.map +1 -0
- package/dist/types/client/files/pages/interaction.d.ts +55 -0
- package/dist/types/client/files/pages/interaction.d.ts.map +1 -0
- package/dist/types/client/files/pages/selection.d.ts +25 -0
- package/dist/types/client/files/pages/selection.d.ts.map +1 -0
- package/dist/types/client/files/pages/snapshot.d.ts +31 -0
- package/dist/types/client/files/pages/snapshot.d.ts.map +1 -0
- package/dist/types/client/files/references.d.ts +80 -0
- package/dist/types/client/files/references.d.ts.map +1 -0
- package/dist/types/client/files/selection.d.ts +11 -0
- package/dist/types/client/files/selection.d.ts.map +1 -0
- package/dist/types/client/files/sheets/SheetRecovery.d.ts +12 -0
- package/dist/types/client/files/sheets/SheetRecovery.d.ts.map +1 -0
- package/dist/types/client/files/sheets/SheetSurface.d.ts +27 -0
- package/dist/types/client/files/sheets/SheetSurface.d.ts.map +1 -0
- package/dist/types/client/files/sheets/geometry.d.ts +30 -0
- package/dist/types/client/files/sheets/geometry.d.ts.map +1 -0
- package/dist/types/client/files/sheets/navigation.d.ts +4 -0
- package/dist/types/client/files/sheets/navigation.d.ts.map +1 -0
- package/dist/types/client/files/sheets/snapshot.d.ts +45 -0
- package/dist/types/client/files/sheets/snapshot.d.ts.map +1 -0
- package/dist/types/client/locales.d.ts +148 -0
- package/dist/types/client/locales.d.ts.map +1 -0
- package/dist/types/client/messages/SentAnnotations.d.ts +18 -0
- package/dist/types/client/messages/SentAnnotations.d.ts.map +1 -0
- package/dist/types/client/messages/presentation.d.ts +39 -0
- package/dist/types/client/messages/presentation.d.ts.map +1 -0
- package/dist/types/client/model.d.ts +68 -0
- package/dist/types/client/model.d.ts.map +1 -0
- package/dist/types/client/quoted-context.d.ts +3 -0
- package/dist/types/client/quoted-context.d.ts.map +1 -0
- package/dist/types/client/responses/ResponseCard.d.ts +12 -0
- package/dist/types/client/responses/ResponseCard.d.ts.map +1 -0
- package/dist/types/client/responses/ResponseOverlay.d.ts +7 -0
- package/dist/types/client/responses/ResponseOverlay.d.ts.map +1 -0
- package/dist/types/client/responses/composer.d.ts +11 -0
- package/dist/types/client/responses/composer.d.ts.map +1 -0
- package/dist/types/client/responses/controller.d.ts +39 -0
- package/dist/types/client/responses/controller.d.ts.map +1 -0
- package/dist/types/client/responses/references.d.ts +62 -0
- package/dist/types/client/responses/references.d.ts.map +1 -0
- package/dist/types/client/responses/selection.d.ts +43 -0
- package/dist/types/client/responses/selection.d.ts.map +1 -0
- package/dist/types/electron/bridge.d.mts +45 -0
- package/dist/types/electron/bridge.d.mts.map +1 -0
- package/dist/types/electron/build-preload.d.mts +4 -0
- package/dist/types/electron/build-preload.d.mts.map +1 -0
- package/dist/types/electron/element-context.d.cts +7 -0
- package/dist/types/electron/element-context.d.cts.map +1 -0
- package/dist/types/electron/guest-preload.d.cts +2 -0
- package/dist/types/electron/guest-preload.d.cts.map +1 -0
- package/dist/types/electron/index.d.ts +5 -0
- package/dist/types/electron/index.d.ts.map +1 -0
- package/dist/types/host-contracts.d.ts +104 -0
- package/dist/types/host-contracts.d.ts.map +1 -0
- package/dist/types/index.d.ts +32 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/react.d.ts +14 -0
- package/dist/types/react.d.ts.map +1 -0
- package/dist/types/shared/desktop.d.ts +75 -0
- package/dist/types/shared/desktop.d.ts.map +1 -0
- package/dist/types/shared/surface.d.ts +11 -0
- package/dist/types/shared/surface.d.ts.map +1 -0
- package/dist/types/ui/icons.d.ts +11 -0
- package/dist/types/ui/icons.d.ts.map +1 -0
- package/dist/types/ui/regions.d.ts +28 -0
- package/dist/types/ui/regions.d.ts.map +1 -0
- package/package.json +82 -3
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ResponseTextAnchor, ResponseAnnotationSnapshot } from './references.ts';
|
|
2
|
+
export interface ResponseSource {
|
|
3
|
+
readonly sessionId: string;
|
|
4
|
+
readonly nodeKey: string;
|
|
5
|
+
readonly nodeId: string;
|
|
6
|
+
readonly turn: number;
|
|
7
|
+
readonly step: number;
|
|
8
|
+
readonly seq: number;
|
|
9
|
+
readonly blockIndex: number;
|
|
10
|
+
readonly text: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ResponseSurface {
|
|
13
|
+
readonly root: HTMLElement;
|
|
14
|
+
readonly source: ResponseSource;
|
|
15
|
+
readonly reveal: () => void;
|
|
16
|
+
}
|
|
17
|
+
interface TextSegment {
|
|
18
|
+
readonly node: Text;
|
|
19
|
+
readonly start: number;
|
|
20
|
+
readonly end: number;
|
|
21
|
+
}
|
|
22
|
+
export interface TextProjection {
|
|
23
|
+
readonly text: string;
|
|
24
|
+
readonly segments: readonly TextSegment[];
|
|
25
|
+
}
|
|
26
|
+
/** A deterministic visible-text coordinate plane; formatting separators are explicit. */
|
|
27
|
+
export declare function projectResponseText(root: HTMLElement): TextProjection;
|
|
28
|
+
export declare function prefixHash(text: string): string;
|
|
29
|
+
export interface ResponseSelection {
|
|
30
|
+
readonly snapshot: ResponseAnnotationSnapshot;
|
|
31
|
+
readonly ranges: readonly Range[];
|
|
32
|
+
readonly sources: readonly {
|
|
33
|
+
readonly surface: ResponseSurface;
|
|
34
|
+
readonly text: string;
|
|
35
|
+
}[];
|
|
36
|
+
}
|
|
37
|
+
/** Both boundaries must belong to registered text blocks of the same assistant node. */
|
|
38
|
+
export declare function readResponseSelection(range: Range, surfaces: readonly ResponseSurface[], sessionId: string): ResponseSelection | undefined;
|
|
39
|
+
/** Reuse saved positions only while the original prefix and selection still agree. */
|
|
40
|
+
export declare function rangesForAnchor(projection: TextProjection, anchor: ResponseTextAnchor): Range[];
|
|
41
|
+
export declare function selectionCurrent(selection: ResponseSelection): boolean;
|
|
42
|
+
export {};
|
|
43
|
+
//# sourceMappingURL=selection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selection.d.ts","sourceRoot":"","sources":["../../../../src/client/responses/selection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAA;AAErF,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CACtB;AACD,MAAM,WAAW,eAAe;IAAG,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,IAAI,CAAA;CAAE;AAC7H,UAAU,WAAW;IAAG,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE;AAC3F,MAAM,WAAW,cAAc;IAAG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,SAAS,WAAW,EAAE,CAAA;CAAE;AAIpG,yFAAyF;AACzF,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,WAAW,GAAG,cAAc,CAsBrE;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAI/C;AAWD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,QAAQ,EAAE,0BAA0B,CAAA;IAC7C,QAAQ,CAAC,MAAM,EAAE,SAAS,KAAK,EAAE,CAAA;IACjC,QAAQ,CAAC,OAAO,EAAE,SAAS;QAAE,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAC1F;AAED,wFAAwF;AACxF,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,eAAe,EAAE,EAAE,SAAS,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS,CA0B1I;AAED,sFAAsF;AACtF,wBAAgB,eAAe,CAAC,UAAU,EAAE,cAAc,EAAE,MAAM,EAAE,kBAAkB,GAAG,KAAK,EAAE,CAW/F;AAED,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,iBAAiB,GAAG,OAAO,CAMtE"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/** Native side of the annotation bridge. No visited page receives this API. */
|
|
2
|
+
export function createAnnotationChannels(prefix?: string): Readonly<{
|
|
3
|
+
setMode: `${string}:annotation-set-mode`;
|
|
4
|
+
capture: `${string}:annotation-capture`;
|
|
5
|
+
event: `${string}:annotation-event`;
|
|
6
|
+
guestSelection: `${string}:annotation-guest-selection`;
|
|
7
|
+
guestPainted: `${string}:annotation-guest-painted`;
|
|
8
|
+
guestCommand: `${string}:annotation-guest-command`;
|
|
9
|
+
}>;
|
|
10
|
+
/**
|
|
11
|
+
* @template {{ id: string, owner: any, guest?: any, annotation?: any }} L
|
|
12
|
+
* @param {{ leases: ReadonlyMap<string, L>, owners: ReadonlySet<any>, ownsApplicationFrame(event: any): boolean }} policy
|
|
13
|
+
* @param {any} ipcMain Electron's IpcMain, supplied by the owning application.
|
|
14
|
+
* @param {() => string} randomUUID
|
|
15
|
+
* @param {{ channelPrefix?: string, sourceOf?: (lease: L) => string, identitySource?: string, isSourceReady?: (lease: L) => boolean }} [options]
|
|
16
|
+
*/
|
|
17
|
+
export function installDesktopAnnotations<L extends {
|
|
18
|
+
id: string;
|
|
19
|
+
owner: any;
|
|
20
|
+
guest?: any;
|
|
21
|
+
annotation?: any;
|
|
22
|
+
}>(policy: {
|
|
23
|
+
leases: ReadonlyMap<string, L>;
|
|
24
|
+
owners: ReadonlySet<any>;
|
|
25
|
+
ownsApplicationFrame(event: any): boolean;
|
|
26
|
+
}, ipcMain: any, randomUUID: () => string, options?: {
|
|
27
|
+
channelPrefix?: string;
|
|
28
|
+
sourceOf?: (lease: L) => string;
|
|
29
|
+
identitySource?: string;
|
|
30
|
+
isSourceReady?: (lease: L) => boolean;
|
|
31
|
+
}): {
|
|
32
|
+
attached(lease: any): void;
|
|
33
|
+
navigation(lease: any): void;
|
|
34
|
+
disposed(lease: any): void;
|
|
35
|
+
identityCleared(): void;
|
|
36
|
+
};
|
|
37
|
+
export const ANNOTATION_IPC: Readonly<{
|
|
38
|
+
setMode: `${string}:annotation-set-mode`;
|
|
39
|
+
capture: `${string}:annotation-capture`;
|
|
40
|
+
event: `${string}:annotation-event`;
|
|
41
|
+
guestSelection: `${string}:annotation-guest-selection`;
|
|
42
|
+
guestPainted: `${string}:annotation-guest-painted`;
|
|
43
|
+
guestCommand: `${string}:annotation-guest-command`;
|
|
44
|
+
}>;
|
|
45
|
+
//# sourceMappingURL=bridge.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridge.d.mts","sourceRoot":"","sources":["../../../src/electron/bridge.mjs"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E;;;;;;;GAMC;AAwDD;;;;;;GAMG;AACH,0CANyE,CAAC,SAA7D;IAAG,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,GAAG,CAAC;IAAC,KAAK,CAAC,EAAE,GAAG,CAAC;IAAC,UAAU,CAAC,EAAE,GAAG,CAAA;CAAG,UAC7D;IAAE,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAAC,MAAM,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC;IAAC,oBAAoB,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAAA;CAAE,WACvG,GAAG,cACH,MAAM,MAAM,YACZ;IAAE,aAAa,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,CAAA;CAAE;;;;;EA4LrI;AAxPD;;;;;;;GAAwD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-preload.d.mts","sourceRoot":"","sources":["../../../src/electron/build-preload.mjs"],"names":[],"mappings":"AASA;;WA4CC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {Element} element
|
|
3
|
+
* @param {string} [frame]
|
|
4
|
+
* @returns {import('../shared/desktop.ts').BrowserAnnotationElement}
|
|
5
|
+
*/
|
|
6
|
+
export function elementContext(element: Element, frame?: string): import("../shared/desktop.ts").BrowserAnnotationElement;
|
|
7
|
+
//# sourceMappingURL=element-context.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"element-context.d.cts","sourceRoot":"","sources":["../../../src/electron/element-context.cjs"],"names":[],"mappings":"AA4CA;;;;GAIG;AACH,wCAJW,OAAO,UACP,MAAM,GACJ,OAAO,sBAAsB,EAAE,wBAAwB,CAsBnE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guest-preload.d.cts","sourceRoot":"","sources":["../../../src/electron/guest-preload.cjs"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { ANNOTATION_IPC, createAnnotationChannels, installDesktopAnnotations } from './bridge.mjs';
|
|
2
|
+
export { renderAnnotationGuestPreload } from './build-preload.mjs';
|
|
3
|
+
export { elementContext } from './element-context.cjs';
|
|
4
|
+
export type { DesktopAnnotations, DesktopAnnotationEvent, BrowserAnnotationSelection } from '../shared/desktop.ts';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/electron/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAA;AAClG,OAAO,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAA;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,YAAY,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAA"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import type { AnnotationEntry } from './client/composer/packets.ts';
|
|
2
|
+
import type { FileSnapshot, DocumentAnnotationSnapshot } from './client/files/references.ts';
|
|
3
|
+
import type { ResponseAnnotationSnapshot } from './client/responses/references.ts';
|
|
4
|
+
import type { ResponseComposer } from './client/responses/composer.ts';
|
|
5
|
+
import type { AnnotationKey } from './client/locales.ts';
|
|
6
|
+
/** Host ids remain opaque; no application or editor runtime is imported. */
|
|
7
|
+
export type SessionId = string;
|
|
8
|
+
export type DraftAttachmentId = string;
|
|
9
|
+
export interface TokenSpan {
|
|
10
|
+
readonly start: number;
|
|
11
|
+
readonly end: number;
|
|
12
|
+
readonly draftRev: number;
|
|
13
|
+
}
|
|
14
|
+
export interface ReferenceInsert {
|
|
15
|
+
readonly source: string;
|
|
16
|
+
readonly ref: string;
|
|
17
|
+
readonly label: string;
|
|
18
|
+
readonly clipboardText: string;
|
|
19
|
+
}
|
|
20
|
+
export interface ReferenceOccurrence {
|
|
21
|
+
readonly id?: string;
|
|
22
|
+
readonly source: string;
|
|
23
|
+
readonly ref: string;
|
|
24
|
+
readonly offset: number;
|
|
25
|
+
readonly length: number;
|
|
26
|
+
readonly label?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface InputState {
|
|
29
|
+
readonly phase: string;
|
|
30
|
+
readonly draft: string;
|
|
31
|
+
readonly draftRev: number;
|
|
32
|
+
readonly attachmentIds: readonly DraftAttachmentId[];
|
|
33
|
+
readonly occurrences: readonly ReferenceOccurrence[];
|
|
34
|
+
}
|
|
35
|
+
export interface InputActions {
|
|
36
|
+
captureInsertion(): TokenSpan;
|
|
37
|
+
addAttachments(ids: readonly DraftAttachmentId[]): boolean;
|
|
38
|
+
removeAttachment(id: DraftAttachmentId): unknown;
|
|
39
|
+
insertText(text: string, span?: TokenSpan): boolean;
|
|
40
|
+
}
|
|
41
|
+
export interface ComposerAttachment {
|
|
42
|
+
readonly id: DraftAttachmentId;
|
|
43
|
+
readonly kind: string;
|
|
44
|
+
readonly file: File;
|
|
45
|
+
}
|
|
46
|
+
export interface PageSendRequest {
|
|
47
|
+
readonly items: readonly DocumentAnnotationSnapshot[];
|
|
48
|
+
readonly images: readonly File[];
|
|
49
|
+
readonly expectedTarget: string;
|
|
50
|
+
readonly signal: AbortSignal;
|
|
51
|
+
}
|
|
52
|
+
export interface ComposerAddRequest {
|
|
53
|
+
readonly text: string;
|
|
54
|
+
readonly images?: readonly File[];
|
|
55
|
+
readonly annotations?: readonly AnnotationEntry[];
|
|
56
|
+
readonly fileSelection?: FileSnapshot;
|
|
57
|
+
readonly responseSelection?: ResponseAnnotationSnapshot;
|
|
58
|
+
readonly signal?: AbortSignal;
|
|
59
|
+
readonly expectedTarget?: string;
|
|
60
|
+
readonly focus?: boolean;
|
|
61
|
+
}
|
|
62
|
+
export interface ComposerBridge {
|
|
63
|
+
readonly responses?: ResponseComposer;
|
|
64
|
+
sendPages?(request: PageSendRequest): Promise<void>;
|
|
65
|
+
annotationControls?(): {
|
|
66
|
+
count: number;
|
|
67
|
+
entries: readonly AnnotationEntry[];
|
|
68
|
+
edit(id: number): void;
|
|
69
|
+
remove(id: number): void;
|
|
70
|
+
review(): void;
|
|
71
|
+
clear(): void;
|
|
72
|
+
send(): void;
|
|
73
|
+
};
|
|
74
|
+
editAnnotation?: (entry: AnnotationEntry, commit: (comment: string) => void) => boolean;
|
|
75
|
+
add(request: ComposerAddRequest): Promise<void>;
|
|
76
|
+
hasTarget(): boolean;
|
|
77
|
+
targetKey(): string | undefined;
|
|
78
|
+
subscribe(listener: () => void): () => void;
|
|
79
|
+
dispose(): void;
|
|
80
|
+
}
|
|
81
|
+
export interface PropsLocale<N extends string = 'annotations'> {
|
|
82
|
+
t(key: N extends 'annotations' ? AnnotationKey : string, values?: Record<string, string | number>): string;
|
|
83
|
+
}
|
|
84
|
+
export interface FileActionProps {
|
|
85
|
+
readonly content: {
|
|
86
|
+
readonly kind: string;
|
|
87
|
+
readonly text?: string;
|
|
88
|
+
readonly data?: Uint8Array;
|
|
89
|
+
readonly eof?: boolean;
|
|
90
|
+
};
|
|
91
|
+
useTabInfo(): {
|
|
92
|
+
readonly tab: {
|
|
93
|
+
readonly id: string;
|
|
94
|
+
readonly contentId: string;
|
|
95
|
+
readonly signal: AbortSignal;
|
|
96
|
+
readonly navigation: {
|
|
97
|
+
readonly params?: {
|
|
98
|
+
readonly url?: string;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=host-contracts.d.ts.map
|
|
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,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC;QAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,CAAA;KAAE,CAAA;IACvH,UAAU,IAAI;QAAE,QAAQ,CAAC,GAAG,EAAE;YAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;YAAC,QAAQ,CAAC,UAAU,EAAE;gBAAE,QAAQ,CAAC,MAAM,CAAC,EAAE;oBAAE,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;iBAAE,CAAA;aAAE,CAAA;SAAE,CAAA;KAAE,CAAA;CACxL"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export { type AnnotationRect, type BrowserAnnotationSelection, type BrowserAnnotationControl, type BrowserAnnotationElement, type DesktopAnnotationEvent, type DesktopAnnotations } from './shared/desktop.ts';
|
|
2
|
+
export { type BrowserSurfaceHandle } from './shared/surface.ts';
|
|
3
|
+
export { errorCopy, type AnnotationErrorKey, errorZh, errorEn } from './client/error-copy.ts';
|
|
4
|
+
export { AnnotationError, type AnnotationFailure, annotationFailure, annotationErrorText } from './client/errors.ts';
|
|
5
|
+
export { zh, en, type AnnotationKey } from './client/locales.ts';
|
|
6
|
+
export { quotedContext } from './client/quoted-context.ts';
|
|
7
|
+
export { type AnnotationDraft, type AnnotationState, AnnotationsModel } from './client/model.ts';
|
|
8
|
+
export { type DraftFactory, draftFactory, imageDrafts } from './client/composer/attachments.ts';
|
|
9
|
+
export { commitToComposer } from './client/composer/commit.ts';
|
|
10
|
+
export { ANNOTATION_SOURCE, type AnnotationEntry, type AnnotationPacket, formatAnnotations, packetSpan, AnnotationPackets } from './client/composer/packets.ts';
|
|
11
|
+
export { bindReferencePresentation } from './client/composer/reference-presentation.ts';
|
|
12
|
+
export { type DocumentAnnotationBridge, type DocumentScope, type DocumentCommit, DocumentWorkflow } from './client/files/document-workflow.ts';
|
|
13
|
+
export { FILE_SELECTION_SOURCE, MAX_SELECTION_BYTES, type TextSnapshot, type DocumentAnnotationSnapshot, type FileSnapshot, decodeFileReference, fileLocation, filePath, fileLabel, fileReference, assertFileDraftCapacity, serializeFileReference, readSentFile, selectedFiles } from './client/files/references.ts';
|
|
14
|
+
export { type FileKind, type FileSelection, readFileSelection } from './client/files/selection.ts';
|
|
15
|
+
export { PageBatches } from './client/files/pages/batches.ts';
|
|
16
|
+
export { type Box as PageBox, type Anchor, normalizeRect, pageBounds, rangeAnchors, projectAnchors, enclosing } from './client/files/pages/geometry.ts';
|
|
17
|
+
export { type PageImageStore, pageImageStore } from './client/files/pages/image-store.ts';
|
|
18
|
+
export { PageImages } from './client/files/pages/images.ts';
|
|
19
|
+
export { type PageInteraction, type PageInteractionEvent, pageInteraction } from './client/files/pages/interaction.ts';
|
|
20
|
+
export { readPageText, pageRegion, capturePageRegion } from './client/files/pages/selection.ts';
|
|
21
|
+
export { type PageRect, type PageSnapshot, isPageSnapshot, validPageRect } from './client/files/pages/snapshot.ts';
|
|
22
|
+
export { type Box as SheetBox, clip, union, PaintedCells } from './client/files/sheets/geometry.ts';
|
|
23
|
+
export { registerSpreadsheet, revealSpreadsheet } from './client/files/sheets/navigation.ts';
|
|
24
|
+
export { type CellValue, type SheetRange, type SheetCell, type SheetMerge, type SpreadsheetSnapshot, columnName, rangeName, readRange, spreadsheetSnapshot, readSpreadsheetSnapshot } from './client/files/sheets/snapshot.ts';
|
|
25
|
+
export { ANNOTATION_PRESENTATION, type SentAnnotation, type AnnotationPresentation, type SerializedAnnotation, annotationPresentation, readAnnotation } from './client/messages/presentation.ts';
|
|
26
|
+
export { type ResponseComposer } from './client/responses/composer.ts';
|
|
27
|
+
export { type ResponseEditor, ResponseController } from './client/responses/controller.ts';
|
|
28
|
+
export { RESPONSE_SOURCE, RESPONSE_SELECTION_BYTES, type ResponseTextAnchor, type ResponseAnnotationSnapshot, readResponseSnapshot, decodeResponseReference, responseReference, responseSelections, assertResponseCapacity, serializeResponseReference, readSentResponse } from './client/responses/references.ts';
|
|
29
|
+
export { type ResponseSource, type ResponseSurface, type TextProjection, projectResponseText, prefixHash, type ResponseSelection, readResponseSelection, rangesForAnchor, selectionCurrent } from './client/responses/selection.ts';
|
|
30
|
+
export { type SessionId, type DraftAttachmentId, type TokenSpan, type ReferenceInsert, type ReferenceOccurrence, type InputState, type InputActions, type ComposerAttachment, type PageSendRequest, type ComposerAddRequest, type ComposerBridge, type PropsLocale, type FileActionProps } from './host-contracts.ts';
|
|
31
|
+
export { type FileAddress, sessionFileAddress, absoluteFileAddress, parseFileAddress } from './address.ts';
|
|
32
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,0BAA0B,EAAE,KAAK,wBAAwB,EAAE,KAAK,wBAAwB,EAAE,KAAK,sBAAsB,EAAE,KAAK,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAC9M,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,EAAE,SAAS,EAAE,KAAK,kBAAkB,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAC7F,OAAO,EAAE,eAAe,EAAE,KAAK,iBAAiB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACpH,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC1D,OAAO,EAAE,KAAK,eAA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,SAAS,EAAE,KAAK,iBAAiB,EAAE,KAAK,SAAS,EAAE,KAAK,eAAe,EAAE,KAAK,mBAAmB,EAAE,KAAK,UAAU,EAAE,KAAK,YAAY,EAAE,KAAK,kBAAkB,EAAE,KAAK,eAAe,EAAE,KAAK,kBAAkB,EAAE,KAAK,cAAc,EAAE,KAAK,WAAW,EAAE,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrT,OAAO,EAAE,KAAK,WAAW,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { type AnnotationProps, AnnotationButton, AnnotationOverlay } from './client/Workbench.tsx';
|
|
2
|
+
export { PacketPreview } from './client/composer/PacketPreview.tsx';
|
|
3
|
+
export { ReferenceCard } from './client/composer/ReferenceCard.tsx';
|
|
4
|
+
export { SelectionCard } from './client/files/SelectionCard.tsx';
|
|
5
|
+
export { RequestIcon, CommentEditor, BatchControls } from './client/files/pages/DocumentChrome.tsx';
|
|
6
|
+
export { pageActionComponent } from './client/files/pages/PageSelectionAction.tsx';
|
|
7
|
+
export { failedSheetPreview, sheetRecoveryComponent } from './client/files/sheets/SheetRecovery.tsx';
|
|
8
|
+
export { ResponseCard } from './client/responses/ResponseCard.tsx';
|
|
9
|
+
export { ResponseOverlay } from './client/responses/ResponseOverlay.tsx';
|
|
10
|
+
export { actionComponent } from './client/files/FileSelectionAction.tsx';
|
|
11
|
+
export { SheetSurface } from './client/files/sheets/SheetSurface.tsx';
|
|
12
|
+
export { type WindowOverlayStyle, type WindowOverlayProps, type AnnotationUiRegions, AnnotationUiProvider, useInteractiveWindowRegion, WindowOverlay } from './ui/regions.tsx';
|
|
13
|
+
export { SentAnnotations, type SentAnnotationsProps } from './client/messages/SentAnnotations.tsx';
|
|
14
|
+
//# sourceMappingURL=react.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../src/react.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAClG,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAA;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAA;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAA;AAChE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAA;AACnG,OAAO,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAA;AAClF,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAA;AACpG,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAA;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAA;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAA;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAA;AACrE,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,kBAAkB,EAAE,KAAK,mBAAmB,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAC9K,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,uCAAuC,CAAA"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/** Capabilities exposed only to the host's trusted application renderer. */
|
|
2
|
+
export interface AnnotationRect {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
}
|
|
8
|
+
export interface BrowserAnnotationSelection {
|
|
9
|
+
kind: 'element' | 'region';
|
|
10
|
+
selector?: string;
|
|
11
|
+
text?: string;
|
|
12
|
+
element?: BrowserAnnotationElement;
|
|
13
|
+
rect: AnnotationRect;
|
|
14
|
+
viewport: {
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
};
|
|
18
|
+
scroll: {
|
|
19
|
+
x: number;
|
|
20
|
+
y: number;
|
|
21
|
+
};
|
|
22
|
+
url: string;
|
|
23
|
+
title: string;
|
|
24
|
+
anchor?: {
|
|
25
|
+
x: number;
|
|
26
|
+
y: number;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export interface BrowserAnnotationControl {
|
|
30
|
+
tagName: string;
|
|
31
|
+
role?: string;
|
|
32
|
+
attributes: Readonly<Record<string, string>>;
|
|
33
|
+
}
|
|
34
|
+
export interface BrowserAnnotationElement extends BrowserAnnotationControl {
|
|
35
|
+
path: string;
|
|
36
|
+
frame: string;
|
|
37
|
+
controls?: readonly BrowserAnnotationControl[];
|
|
38
|
+
}
|
|
39
|
+
export type DesktopAnnotationEvent = {
|
|
40
|
+
lease: string;
|
|
41
|
+
documentEpoch: string;
|
|
42
|
+
kind: 'selection';
|
|
43
|
+
source: string;
|
|
44
|
+
selection: BrowserAnnotationSelection;
|
|
45
|
+
} | {
|
|
46
|
+
lease: string;
|
|
47
|
+
documentEpoch: string;
|
|
48
|
+
kind: 'navigation' | 'disposed';
|
|
49
|
+
source: string;
|
|
50
|
+
} | {
|
|
51
|
+
lease: string;
|
|
52
|
+
documentEpoch: string;
|
|
53
|
+
kind: 'selection-cleared' | 'mode-ended';
|
|
54
|
+
source: string;
|
|
55
|
+
} | {
|
|
56
|
+
lease: '';
|
|
57
|
+
documentEpoch: '';
|
|
58
|
+
kind: 'identity-cleared';
|
|
59
|
+
source: string;
|
|
60
|
+
};
|
|
61
|
+
export interface DesktopAnnotations {
|
|
62
|
+
readonly protocolVersion: 1;
|
|
63
|
+
subscribe(listener: (event: DesktopAnnotationEvent) => void): () => void;
|
|
64
|
+
setMode(lease: string, mode: 'off' | 'element' | 'region'): Promise<{
|
|
65
|
+
documentEpoch: string;
|
|
66
|
+
}>;
|
|
67
|
+
capture(lease: string, documentEpoch: string, selection: BrowserAnnotationSelection, number: number): Promise<{
|
|
68
|
+
png: Uint8Array;
|
|
69
|
+
width: number;
|
|
70
|
+
height: number;
|
|
71
|
+
viewportWidth: number;
|
|
72
|
+
viewportHeight: number;
|
|
73
|
+
}>;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=desktop.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"desktop.d.ts","sourceRoot":"","sources":["../../../src/shared/desktop.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,MAAM,WAAW,cAAc;IAC7B,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,SAAS,GAAG,QAAQ,CAAA;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,wBAAwB,CAAA;IAClC,IAAI,EAAE,cAAc,CAAA;IACpB,QAAQ,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;IAC3C,MAAM,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IAChC,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAClC;AAED,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;CAC7C;AAED,MAAM,WA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AE,UAAU,CAAA;QACf,KAAK,EAAE,MAAM,CAAA;QACb,MAAM,EAAE,MAAM,CAAA;QACd,aAAa,EAAE,MAAM,CAAA;QACrB,cAAc,EAAE,MAAM,CAAA;KACvB,CAAC,CAAA;CACH"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** One browser occurrence. The native bridge verifies the guest lease separately. */
|
|
2
|
+
export interface BrowserSurfaceHandle {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
readonly source: string;
|
|
5
|
+
readonly viewportId: string;
|
|
6
|
+
readonly title: string;
|
|
7
|
+
readonly url?: string;
|
|
8
|
+
readonly enabled: boolean;
|
|
9
|
+
readonly signal?: AbortSignal;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=surface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"surface.d.ts","sourceRoot":"","sources":["../../../src/shared/surface.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAA;CAC9B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { SVGProps } from 'react';
|
|
2
|
+
type IconProps = SVGProps<SVGSVGElement>;
|
|
3
|
+
export declare const Chat: ({ width, height, ...props }: IconProps) => import("react").JSX.Element;
|
|
4
|
+
export declare const ChatFilled: ({ width, height, ...props }: IconProps) => import("react").JSX.Element;
|
|
5
|
+
export declare const X: ({ width, height, ...props }: IconProps) => import("react").JSX.Element;
|
|
6
|
+
export declare const Trash: ({ width, height, ...props }: IconProps) => import("react").JSX.Element;
|
|
7
|
+
export declare const Pencil: ({ width, height, ...props }: IconProps) => import("react").JSX.Element;
|
|
8
|
+
export declare const EditPencil: ({ width, height, ...props }: IconProps) => import("react").JSX.Element;
|
|
9
|
+
export declare const SettingsSlider: ({ width, height, ...props }: IconProps) => import("react").JSX.Element;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=icons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../src/ui/icons.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACrC,KAAK,SAAS,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAA;AAMxC,eAAO,MAAM,IAAI,gCAJ6C,SAAS,gCAIM,CAAA;AAC7E,eAAO,MAAM,UAAU,gCALuC,SAAS,gCAKqB,CAAA;AAC5F,eAAO,MAAM,CAAC,gCANgD,SAAS,gCAM1B,CAAA;AAC7C,eAAO,MAAM,KAAK,gCAP4C,SAAS,gCAOQ,CAAA;AAC/E,eAAO,MAAM,MAAM,gCAR2C,SAAS,gCAQI,CAAA;AAC3E,eAAO,MAAM,UAAU,gCATuC,SAAS,gCASvC,CAAA;AAChC,eAAO,MAAM,cAAc,gCAVmC,SAAS,gCAUI,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type CSSProperties, type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
export type WindowOverlayStyle = Omit<CSSProperties, 'position' | 'inset' | 'pointerEvents'> & {
|
|
3
|
+
readonly position?: never;
|
|
4
|
+
readonly inset?: never;
|
|
5
|
+
readonly pointerEvents?: never;
|
|
6
|
+
readonly WebkitAppRegion?: never;
|
|
7
|
+
readonly appRegion?: never;
|
|
8
|
+
};
|
|
9
|
+
export type WindowOverlayProps = Omit<HTMLAttributes<HTMLDivElement>, 'style'> & {
|
|
10
|
+
readonly style?: WindowOverlayStyle;
|
|
11
|
+
};
|
|
12
|
+
declare const DefaultOverlay: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "style"> & {
|
|
13
|
+
readonly style?: WindowOverlayStyle;
|
|
14
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
15
|
+
export interface AnnotationUiRegions {
|
|
16
|
+
readonly Overlay: typeof DefaultOverlay;
|
|
17
|
+
readonly interactiveWindowRegion: Readonly<Record<string, string>>;
|
|
18
|
+
}
|
|
19
|
+
export declare function AnnotationUiProvider({ value, children }: {
|
|
20
|
+
readonly value: AnnotationUiRegions;
|
|
21
|
+
readonly children: ReactNode;
|
|
22
|
+
}): import("react").JSX.Element;
|
|
23
|
+
export declare function useInteractiveWindowRegion(): Readonly<Record<string, string>>;
|
|
24
|
+
export declare const WindowOverlay: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "style"> & {
|
|
25
|
+
readonly style?: WindowOverlayStyle;
|
|
26
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=regions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"regions.d.ts","sourceRoot":"","sources":["../../../src/ui/regions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAyC,KAAK,aAAa,EAAE,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAItH,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,aAAa,EAAE,UAAU,GAAG,OAAO,GAAG,eAAe,CAAC,GAAG;IAC7F,QAAQ,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAA;IACzB,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,CAAA;IACtB,QAAQ,CAAC,aAAa,CAAC,EAAE,KAAK,CAAA;IAC9B,QAAQ,CAAC,eAAe,CAAC,EAAE,KAAK,CAAA;IAChC,QAAQ,CAAC,SAAS,CAAC,EAAE,KAAK,CAAA;CAC3B,CAAA;AACD,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC,GAAG;IAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,kBAAkB,CAAA;CAAE,CAAA;AACxH,QAAA,MAAM,cAAc;qBADgF,kBAAkB;kDAIpH,CAAA;AAKF,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,OAAO,EAAE,OAAO,cAAc,CAAA;IACvC,QAAQ,CAAC,uBAAuB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;CACnE;AAED,wBAAgB,oBAAoB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,CAAC,KAAK,EAAE,mBAAmB,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAA;CAAE,+BAE9H;AACD,wBAAgB,0BAA0B,qCAAyD;AACnG,eAAO,MAAM,aAAa;qBAlB0E,kBAAkB;kDAqBpH,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,85 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "annotation-kit",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Host-independent annotations for web pages, documents, spreadsheets and conversation text",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "leung-alex",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/leung-alex/annotation-kit.git"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://github.com/leung-alex/annotation-kit#readme",
|
|
13
|
+
"bugs": "https://github.com/leung-alex/annotation-kit/issues",
|
|
14
|
+
"engines": {
|
|
15
|
+
"node": ">=22.19.0"
|
|
16
|
+
},
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./dist/types/index.d.ts",
|
|
20
|
+
"import": "./dist/index.js"
|
|
21
|
+
},
|
|
22
|
+
"./react": {
|
|
23
|
+
"types": "./dist/types/react.d.ts",
|
|
24
|
+
"import": "./dist/react.js"
|
|
25
|
+
},
|
|
26
|
+
"./electron": {
|
|
27
|
+
"types": "./dist/types/electron/index.d.ts",
|
|
28
|
+
"import": "./dist/electron.js"
|
|
29
|
+
},
|
|
30
|
+
"./styles.css": {
|
|
31
|
+
"types": "./dist/styles.d.ts",
|
|
32
|
+
"default": "./dist/annotation-kit.css"
|
|
33
|
+
},
|
|
34
|
+
"./package.json": "./package.json"
|
|
35
|
+
},
|
|
36
|
+
"files": [
|
|
37
|
+
"dist",
|
|
38
|
+
"LICENSE",
|
|
39
|
+
"NOTICE",
|
|
40
|
+
"README.md",
|
|
41
|
+
"README.zh-CN.md"
|
|
42
|
+
],
|
|
43
|
+
"sideEffects": [
|
|
44
|
+
"**/*.css"
|
|
45
|
+
],
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"react": "^18.2.0",
|
|
48
|
+
"react-dom": "^18.2.0"
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"@fortune-sheet/core": "1.0.4",
|
|
52
|
+
"@fortune-sheet/react": "1.0.4",
|
|
53
|
+
"react-grab": "0.2.0"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@playwright/test": "1.61.1",
|
|
57
|
+
"@testing-library/react": "16.3.1",
|
|
58
|
+
"@types/node": "22.19.7",
|
|
59
|
+
"@types/react": "18.3.31",
|
|
60
|
+
"@types/react-dom": "18.3.7",
|
|
61
|
+
"html2canvas": "1.4.1",
|
|
62
|
+
"jsdom": "29.1.1",
|
|
63
|
+
"react": "18.3.1",
|
|
64
|
+
"react-dom": "18.3.1",
|
|
65
|
+
"typescript": "6.0.3",
|
|
66
|
+
"vite": "6.4.3",
|
|
67
|
+
"vitest": "4.1.8"
|
|
68
|
+
},
|
|
69
|
+
"scripts": {
|
|
70
|
+
"build": "vite build && tsc -p tsconfig.build.json && node scripts/copy-assets.mjs",
|
|
71
|
+
"typecheck": "tsc --noEmit",
|
|
72
|
+
"test": "vitest run",
|
|
73
|
+
"verify": "pnpm typecheck && pnpm test && pnpm build && node scripts/check-package.mjs",
|
|
74
|
+
"dev": "vite --config examples/react/vite.config.ts",
|
|
75
|
+
"build:demo": "vite build --config examples/react/vite.config.ts",
|
|
76
|
+
"check:package": "node scripts/check-package.mjs",
|
|
77
|
+
"dsh:prepare": "node examples/dsh/manage.mjs prepare",
|
|
78
|
+
"dsh:build": "node examples/dsh/manage.mjs build",
|
|
79
|
+
"dsh:start": "node examples/dsh/manage.mjs start",
|
|
80
|
+
"dsh:check": "node examples/dsh/manage.mjs check",
|
|
81
|
+
"dsh:revert": "node examples/dsh/manage.mjs revert",
|
|
82
|
+
"test:demo": "node scripts/verify-demo.mjs",
|
|
83
|
+
"fixtures:serve": "node scripts/fixtures-server.mjs"
|
|
84
|
+
}
|
|
6
85
|
}
|