@embedpdf/plugin-link 3.0.0-next.13 → 3.0.0-next.15
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/dist/contract/host.cjs +9 -0
- package/dist/contract/host.cjs.map +1 -0
- package/dist/contract/host.d.cts +3 -0
- package/dist/contract/host.d.ts +3 -0
- package/dist/contract/host.js +9 -0
- package/dist/contract/host.js.map +1 -0
- package/dist/contract-BL4jWtGT.d.ts +136 -0
- package/dist/contract-C8by3cQG.d.cts +136 -0
- package/dist/contract-CaaMtYBR.cjs +19 -0
- package/dist/contract-CaaMtYBR.cjs.map +1 -0
- package/dist/contract-D0k-EtjB.js +15 -0
- package/dist/contract-D0k-EtjB.js.map +1 -0
- package/dist/contract.cjs +1 -1
- package/dist/contract.d.cts +2 -2
- package/dist/contract.d.ts +2 -2
- package/dist/contract.js +1 -1
- package/dist/host-contract-BEEpcMUN.d.ts +23 -0
- package/dist/host-contract-WJZHqcPp.d.cts +23 -0
- package/dist/index.cjs +233 -174
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -10
- package/dist/index.d.ts +7 -10
- package/dist/index.js +234 -175
- package/dist/index.js.map +1 -1
- package/package.json +13 -9
- package/dist/contract-B8bEMeH8.d.ts +0 -92
- package/dist/contract-DGKEPl11.cjs +0 -11
- package/dist/contract-DGKEPl11.cjs.map +0 -1
- package/dist/contract-DO3vDsAV.d.cts +0 -92
- package/dist/contract-HRggERzU.js +0 -7
- package/dist/contract-HRggERzU.js.map +0 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_contract = require("../contract-CaaMtYBR.cjs");
|
|
3
|
+
//#region src/host-contract.ts
|
|
4
|
+
/** @embedpdf/plugin-link/contract/host: the host lens, the public capability plus what a framework binding supplies. */
|
|
5
|
+
const LinkToken = (0, require("@embedpdf/core").createHostToken)(require_contract.LinkToken);
|
|
6
|
+
//#endregion
|
|
7
|
+
exports.LinkToken = LinkToken;
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=host.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host.cjs","names":["PublicLinkToken"],"sources":["../../src/host-contract.ts"],"sourcesContent":["/** @embedpdf/plugin-link/contract/host: the host lens, the public capability plus what a framework binding supplies. */\nimport { createHostToken, type Unsubscribe } from '@embedpdf/core';\n\nimport type { LinkCapability } from './contract';\nimport { LinkToken as PublicLinkToken } from './token';\n\nexport * from './contract';\n\n/**\n * Opens a website for `activate()`, in the user's gesture. Returns whether it\n * opened: false for an address it won't open (a `javascript:` or `file:`\n * URI), which activation then reports.\n */\nexport type UriOpener = (uri: string) => boolean;\n\nexport interface LinkHostCapability extends LinkCapability {\n /** Does the active tool navigate links (the layer paints anchors only then)? */\n isNavigationEngaged(): boolean;\n /**\n * Register the framework's website opener. The plugin never touches the\n * DOM: without an opener, a website link activates as `{ outcome: 'uri' }`\n * for the caller to open. The latest registration wins until it is removed.\n */\n registerUriOpener(opener: UriOpener): Unsubscribe;\n}\n\nexport const LinkToken = createHostToken<LinkHostCapability>(PublicLinkToken);\n"],"mappings":";;;;AA0BA,MAAa,aAAA,2BAAA,CAAA,CAAA,gBAAA,CAAgDA,iBAAAA,SAAe"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { a as LinkCapability, c as PageDestination, i as LinkActivation, l as PdfLinkTarget, n as LinkActivateContext, o as LinkLoadedEvent, r as LinkActivatedEvent, s as LinkResolution, t as Link } from "../contract-C8by3cQG.cjs";
|
|
2
|
+
import { n as LinkToken, r as UriOpener, t as LinkHostCapability } from "../host-contract-WJZHqcPp.cjs";
|
|
3
|
+
export { Link, LinkActivateContext, LinkActivatedEvent, LinkActivation, LinkCapability, LinkHostCapability, LinkLoadedEvent, LinkResolution, LinkToken, type PageDestination, type PdfLinkTarget, UriOpener };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { a as LinkCapability, c as PageDestination, i as LinkActivation, l as PdfLinkTarget, n as LinkActivateContext, o as LinkLoadedEvent, r as LinkActivatedEvent, s as LinkResolution, t as Link } from "../contract-BL4jWtGT.js";
|
|
2
|
+
import { n as LinkToken, r as UriOpener, t as LinkHostCapability } from "../host-contract-BEEpcMUN.js";
|
|
3
|
+
export { Link, LinkActivateContext, LinkActivatedEvent, LinkActivation, LinkCapability, LinkHostCapability, LinkLoadedEvent, LinkResolution, LinkToken, type PageDestination, type PdfLinkTarget, UriOpener };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { t as LinkToken$1 } from "../contract-D0k-EtjB.js";
|
|
2
|
+
import { createHostToken } from "@embedpdf/core";
|
|
3
|
+
//#region src/host-contract.ts
|
|
4
|
+
/** @embedpdf/plugin-link/contract/host: the host lens, the public capability plus what a framework binding supplies. */
|
|
5
|
+
const LinkToken = createHostToken(LinkToken$1);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { LinkToken };
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=host.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host.js","names":["PublicLinkToken"],"sources":["../../src/host-contract.ts"],"sourcesContent":["/** @embedpdf/plugin-link/contract/host: the host lens, the public capability plus what a framework binding supplies. */\nimport { createHostToken, type Unsubscribe } from '@embedpdf/core';\n\nimport type { LinkCapability } from './contract';\nimport { LinkToken as PublicLinkToken } from './token';\n\nexport * from './contract';\n\n/**\n * Opens a website for `activate()`, in the user's gesture. Returns whether it\n * opened: false for an address it won't open (a `javascript:` or `file:`\n * URI), which activation then reports.\n */\nexport type UriOpener = (uri: string) => boolean;\n\nexport interface LinkHostCapability extends LinkCapability {\n /** Does the active tool navigate links (the layer paints anchors only then)? */\n isNavigationEngaged(): boolean;\n /**\n * Register the framework's website opener. The plugin never touches the\n * DOM: without an opener, a website link activates as `{ outcome: 'uri' }`\n * for the caller to open. The latest registration wins until it is removed.\n */\n registerUriOpener(opener: UriOpener): Unsubscribe;\n}\n\nexport const LinkToken = createHostToken<LinkHostCapability>(PublicLinkToken);\n"],"mappings":";;;;AA0BA,MAAa,YAAY,gBAAoCA,WAAe"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { EventHook, OperationOptions, PageRef, ResourceStatus } from "@embedpdf/core";
|
|
2
|
+
import { ActionDispatchResult } from "@embedpdf/plugin-actions/contract";
|
|
3
|
+
import { LinkNavItem } from "@embedpdf/plugin-annotation/contract";
|
|
4
|
+
import { StageCapability } from "@embedpdf/plugin-stage/contract";
|
|
5
|
+
import { AnnotationRef, PageDestination, PdfActionTree, PdfLinkTarget } from "@embedpdf/engine-core/runtime";
|
|
6
|
+
import { Point } from "@embedpdf/core-geometry";
|
|
7
|
+
//#region src/token.d.ts
|
|
8
|
+
declare const LinkToken: import("@embedpdf/core").CapabilityToken<LinkCapability>;
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region src/contract.d.ts
|
|
11
|
+
/**
|
|
12
|
+
* A clickable link area: page-space `bounds`, its target, and its annotation
|
|
13
|
+
* (when it is one). The target and `/A` tree are as the annotation holds
|
|
14
|
+
* them, their destinations in page space.
|
|
15
|
+
*/
|
|
16
|
+
type Link = LinkNavItem;
|
|
17
|
+
/**
|
|
18
|
+
* What activation did: `revealed` (the view went to a page), `uri` (a website
|
|
19
|
+
* opened), `dispatched` (the actions plugin runs the link's action), or
|
|
20
|
+
* `reported` (a link it won't follow). `destination`, `named` and a `uri`
|
|
21
|
+
* with no framework to open it are handed to the caller to perform.
|
|
22
|
+
*/
|
|
23
|
+
type LinkActivation = {
|
|
24
|
+
outcome: 'revealed';
|
|
25
|
+
} | {
|
|
26
|
+
outcome: 'destination';
|
|
27
|
+
destination: PageDestination;
|
|
28
|
+
} | {
|
|
29
|
+
outcome: 'uri';
|
|
30
|
+
uri: string;
|
|
31
|
+
} | {
|
|
32
|
+
outcome: 'named';
|
|
33
|
+
name: string;
|
|
34
|
+
} | {
|
|
35
|
+
outcome: 'reported';
|
|
36
|
+
target: PdfLinkTarget;
|
|
37
|
+
} | {
|
|
38
|
+
outcome: 'dispatched';
|
|
39
|
+
dispatch: Promise<ActionDispatchResult>;
|
|
40
|
+
} | {
|
|
41
|
+
outcome: 'none';
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* What activating a target would do, with no side effect. A `goto` to a page
|
|
45
|
+
* of this document is its destination, ready for `stage.goToDestination`;
|
|
46
|
+
* one to a page the document doesn't have is reported.
|
|
47
|
+
*/
|
|
48
|
+
type LinkResolution = {
|
|
49
|
+
kind: 'destination';
|
|
50
|
+
destination: PageDestination;
|
|
51
|
+
} | {
|
|
52
|
+
kind: 'uri';
|
|
53
|
+
uri: string;
|
|
54
|
+
} | {
|
|
55
|
+
kind: 'named';
|
|
56
|
+
name: string;
|
|
57
|
+
} | {
|
|
58
|
+
kind: 'reported';
|
|
59
|
+
target: PdfLinkTarget;
|
|
60
|
+
};
|
|
61
|
+
interface LinkActivateContext {
|
|
62
|
+
/** The link's `/A` tree when it has one; the actions plugin runs it instead of the target. */
|
|
63
|
+
activate?: PdfActionTree;
|
|
64
|
+
ref?: AnnotationRef;
|
|
65
|
+
page?: PageRef;
|
|
66
|
+
/**
|
|
67
|
+
* The view the link was followed in: a page destination moves this Stage.
|
|
68
|
+
* Defaults to the main view.
|
|
69
|
+
*/
|
|
70
|
+
stage?: StageCapability;
|
|
71
|
+
}
|
|
72
|
+
/** A link target was activated through this capability. */
|
|
73
|
+
interface LinkActivatedEvent {
|
|
74
|
+
readonly target: PdfLinkTarget;
|
|
75
|
+
readonly activation: LinkActivation;
|
|
76
|
+
}
|
|
77
|
+
/** A page's links were read from the engine. */
|
|
78
|
+
interface LinkLoadedEvent {
|
|
79
|
+
readonly page: PageRef;
|
|
80
|
+
}
|
|
81
|
+
interface LinkCapability {
|
|
82
|
+
/**
|
|
83
|
+
* Clickable areas on a page (its ref or its index), page space.
|
|
84
|
+
* Reference-stable per page while unchanged; empty for a page that isn't in
|
|
85
|
+
* the document.
|
|
86
|
+
*/
|
|
87
|
+
listLinks(page: PageRef | number): readonly Link[];
|
|
88
|
+
/** One link by its stable id, or null. */
|
|
89
|
+
getLink(page: PageRef | number, linkId: string): Link | null;
|
|
90
|
+
/** The topmost (smallest) link under a page point, or null. */
|
|
91
|
+
getLinkAt(page: PageRef | number, point: Point): Link | null;
|
|
92
|
+
/**
|
|
93
|
+
* Every link in the document; loads pages as needed. Rejects when a page's
|
|
94
|
+
* read fails, and `operation-cancelled` when `signal` fires.
|
|
95
|
+
*/
|
|
96
|
+
listAllLinks(options?: OperationOptions): Promise<readonly Link[]>;
|
|
97
|
+
/**
|
|
98
|
+
* Load a page's links. Resolves at once when the annotation plugin owns
|
|
99
|
+
* them; rejects when the read fails, which `getStatus(page)` then reports,
|
|
100
|
+
* `not-found` for a page that isn't in the document, and
|
|
101
|
+
* `operation-cancelled` when `signal` fires.
|
|
102
|
+
*/
|
|
103
|
+
ensureLoaded(page: PageRef | number, options?: OperationOptions): Promise<void>;
|
|
104
|
+
/** The page's links were read and are current. Always true with the annotation plugin. */
|
|
105
|
+
isLoaded(page: PageRef | number): boolean;
|
|
106
|
+
/** Load state of a page's links: `idle`, `loading`, `ready`, `error` or `forbidden`. */
|
|
107
|
+
getStatus(page: PageRef | number): ResourceStatus;
|
|
108
|
+
/** What activation would do, with no side effect. */
|
|
109
|
+
resolve(target: PdfLinkTarget): LinkResolution;
|
|
110
|
+
/**
|
|
111
|
+
* Follow a link, or a link's target, as a click does, and return what
|
|
112
|
+
* happened at once (the user's gesture is still on the stack, so a website
|
|
113
|
+
* can open in a new tab). A `goto` moves the Stage, by its `scrollBehavior`
|
|
114
|
+
* setting; a website opens through the framework (an `http`, `https`,
|
|
115
|
+
* `mailto` or `tel` address only); a link with an `/A` tree dispatches
|
|
116
|
+
* through the actions plugin. Fires `onActivated`.
|
|
117
|
+
*/
|
|
118
|
+
activate(target: PdfLinkTarget | Link, context?: LinkActivateContext): LinkActivation;
|
|
119
|
+
/**
|
|
120
|
+
* Hit test, then activate. Null when no link is there; throws `not-found`
|
|
121
|
+
* for a page that isn't in the document.
|
|
122
|
+
*/
|
|
123
|
+
activateAt(page: PageRef | number, point: Point, context?: LinkActivateContext): LinkActivation | null;
|
|
124
|
+
/** A human label for tooltips. */
|
|
125
|
+
getLabel(link: Link | PdfLinkTarget): string;
|
|
126
|
+
/** After the built-in handling of any activation. */
|
|
127
|
+
readonly onActivated: EventHook<LinkActivatedEvent>;
|
|
128
|
+
/**
|
|
129
|
+
* A page's links were read, first or again after an annotation change on
|
|
130
|
+
* it. Never fires for a failed read, nor while the annotation plugin owns the links.
|
|
131
|
+
*/
|
|
132
|
+
readonly onLoaded: EventHook<LinkLoadedEvent>;
|
|
133
|
+
}
|
|
134
|
+
//#endregion
|
|
135
|
+
export { LinkCapability as a, PageDestination as c, LinkActivation as i, PdfLinkTarget as l, LinkActivateContext as n, LinkLoadedEvent as o, LinkActivatedEvent as r, LinkResolution as s, Link as t, LinkToken as u };
|
|
136
|
+
//# sourceMappingURL=contract-BL4jWtGT.d.ts.map
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { EventHook, OperationOptions, PageRef, ResourceStatus } from "@embedpdf/core";
|
|
2
|
+
import { Point } from "@embedpdf/core-geometry";
|
|
3
|
+
import { AnnotationRef, PageDestination, PdfActionTree, PdfLinkTarget } from "@embedpdf/engine-core/runtime";
|
|
4
|
+
import { ActionDispatchResult } from "@embedpdf/plugin-actions/contract";
|
|
5
|
+
import { LinkNavItem } from "@embedpdf/plugin-annotation/contract";
|
|
6
|
+
import { StageCapability } from "@embedpdf/plugin-stage/contract";
|
|
7
|
+
//#region src/token.d.ts
|
|
8
|
+
declare const LinkToken: import("@embedpdf/core").CapabilityToken<LinkCapability>;
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region src/contract.d.ts
|
|
11
|
+
/**
|
|
12
|
+
* A clickable link area: page-space `bounds`, its target, and its annotation
|
|
13
|
+
* (when it is one). The target and `/A` tree are as the annotation holds
|
|
14
|
+
* them, their destinations in page space.
|
|
15
|
+
*/
|
|
16
|
+
type Link = LinkNavItem;
|
|
17
|
+
/**
|
|
18
|
+
* What activation did: `revealed` (the view went to a page), `uri` (a website
|
|
19
|
+
* opened), `dispatched` (the actions plugin runs the link's action), or
|
|
20
|
+
* `reported` (a link it won't follow). `destination`, `named` and a `uri`
|
|
21
|
+
* with no framework to open it are handed to the caller to perform.
|
|
22
|
+
*/
|
|
23
|
+
type LinkActivation = {
|
|
24
|
+
outcome: 'revealed';
|
|
25
|
+
} | {
|
|
26
|
+
outcome: 'destination';
|
|
27
|
+
destination: PageDestination;
|
|
28
|
+
} | {
|
|
29
|
+
outcome: 'uri';
|
|
30
|
+
uri: string;
|
|
31
|
+
} | {
|
|
32
|
+
outcome: 'named';
|
|
33
|
+
name: string;
|
|
34
|
+
} | {
|
|
35
|
+
outcome: 'reported';
|
|
36
|
+
target: PdfLinkTarget;
|
|
37
|
+
} | {
|
|
38
|
+
outcome: 'dispatched';
|
|
39
|
+
dispatch: Promise<ActionDispatchResult>;
|
|
40
|
+
} | {
|
|
41
|
+
outcome: 'none';
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* What activating a target would do, with no side effect. A `goto` to a page
|
|
45
|
+
* of this document is its destination, ready for `stage.goToDestination`;
|
|
46
|
+
* one to a page the document doesn't have is reported.
|
|
47
|
+
*/
|
|
48
|
+
type LinkResolution = {
|
|
49
|
+
kind: 'destination';
|
|
50
|
+
destination: PageDestination;
|
|
51
|
+
} | {
|
|
52
|
+
kind: 'uri';
|
|
53
|
+
uri: string;
|
|
54
|
+
} | {
|
|
55
|
+
kind: 'named';
|
|
56
|
+
name: string;
|
|
57
|
+
} | {
|
|
58
|
+
kind: 'reported';
|
|
59
|
+
target: PdfLinkTarget;
|
|
60
|
+
};
|
|
61
|
+
interface LinkActivateContext {
|
|
62
|
+
/** The link's `/A` tree when it has one; the actions plugin runs it instead of the target. */
|
|
63
|
+
activate?: PdfActionTree;
|
|
64
|
+
ref?: AnnotationRef;
|
|
65
|
+
page?: PageRef;
|
|
66
|
+
/**
|
|
67
|
+
* The view the link was followed in: a page destination moves this Stage.
|
|
68
|
+
* Defaults to the main view.
|
|
69
|
+
*/
|
|
70
|
+
stage?: StageCapability;
|
|
71
|
+
}
|
|
72
|
+
/** A link target was activated through this capability. */
|
|
73
|
+
interface LinkActivatedEvent {
|
|
74
|
+
readonly target: PdfLinkTarget;
|
|
75
|
+
readonly activation: LinkActivation;
|
|
76
|
+
}
|
|
77
|
+
/** A page's links were read from the engine. */
|
|
78
|
+
interface LinkLoadedEvent {
|
|
79
|
+
readonly page: PageRef;
|
|
80
|
+
}
|
|
81
|
+
interface LinkCapability {
|
|
82
|
+
/**
|
|
83
|
+
* Clickable areas on a page (its ref or its index), page space.
|
|
84
|
+
* Reference-stable per page while unchanged; empty for a page that isn't in
|
|
85
|
+
* the document.
|
|
86
|
+
*/
|
|
87
|
+
listLinks(page: PageRef | number): readonly Link[];
|
|
88
|
+
/** One link by its stable id, or null. */
|
|
89
|
+
getLink(page: PageRef | number, linkId: string): Link | null;
|
|
90
|
+
/** The topmost (smallest) link under a page point, or null. */
|
|
91
|
+
getLinkAt(page: PageRef | number, point: Point): Link | null;
|
|
92
|
+
/**
|
|
93
|
+
* Every link in the document; loads pages as needed. Rejects when a page's
|
|
94
|
+
* read fails, and `operation-cancelled` when `signal` fires.
|
|
95
|
+
*/
|
|
96
|
+
listAllLinks(options?: OperationOptions): Promise<readonly Link[]>;
|
|
97
|
+
/**
|
|
98
|
+
* Load a page's links. Resolves at once when the annotation plugin owns
|
|
99
|
+
* them; rejects when the read fails, which `getStatus(page)` then reports,
|
|
100
|
+
* `not-found` for a page that isn't in the document, and
|
|
101
|
+
* `operation-cancelled` when `signal` fires.
|
|
102
|
+
*/
|
|
103
|
+
ensureLoaded(page: PageRef | number, options?: OperationOptions): Promise<void>;
|
|
104
|
+
/** The page's links were read and are current. Always true with the annotation plugin. */
|
|
105
|
+
isLoaded(page: PageRef | number): boolean;
|
|
106
|
+
/** Load state of a page's links: `idle`, `loading`, `ready`, `error` or `forbidden`. */
|
|
107
|
+
getStatus(page: PageRef | number): ResourceStatus;
|
|
108
|
+
/** What activation would do, with no side effect. */
|
|
109
|
+
resolve(target: PdfLinkTarget): LinkResolution;
|
|
110
|
+
/**
|
|
111
|
+
* Follow a link, or a link's target, as a click does, and return what
|
|
112
|
+
* happened at once (the user's gesture is still on the stack, so a website
|
|
113
|
+
* can open in a new tab). A `goto` moves the Stage, by its `scrollBehavior`
|
|
114
|
+
* setting; a website opens through the framework (an `http`, `https`,
|
|
115
|
+
* `mailto` or `tel` address only); a link with an `/A` tree dispatches
|
|
116
|
+
* through the actions plugin. Fires `onActivated`.
|
|
117
|
+
*/
|
|
118
|
+
activate(target: PdfLinkTarget | Link, context?: LinkActivateContext): LinkActivation;
|
|
119
|
+
/**
|
|
120
|
+
* Hit test, then activate. Null when no link is there; throws `not-found`
|
|
121
|
+
* for a page that isn't in the document.
|
|
122
|
+
*/
|
|
123
|
+
activateAt(page: PageRef | number, point: Point, context?: LinkActivateContext): LinkActivation | null;
|
|
124
|
+
/** A human label for tooltips. */
|
|
125
|
+
getLabel(link: Link | PdfLinkTarget): string;
|
|
126
|
+
/** After the built-in handling of any activation. */
|
|
127
|
+
readonly onActivated: EventHook<LinkActivatedEvent>;
|
|
128
|
+
/**
|
|
129
|
+
* A page's links were read, first or again after an annotation change on
|
|
130
|
+
* it. Never fires for a failed read, nor while the annotation plugin owns the links.
|
|
131
|
+
*/
|
|
132
|
+
readonly onLoaded: EventHook<LinkLoadedEvent>;
|
|
133
|
+
}
|
|
134
|
+
//#endregion
|
|
135
|
+
export { LinkCapability as a, PageDestination as c, LinkActivation as i, PdfLinkTarget as l, LinkActivateContext as n, LinkLoadedEvent as o, LinkActivatedEvent as r, LinkResolution as s, Link as t, LinkToken as u };
|
|
136
|
+
//# sourceMappingURL=contract-C8by3cQG.d.cts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/token.ts
|
|
2
|
+
/** The package token, created once here: `contract.ts` re-exports it and
|
|
3
|
+
* `host-contract.ts` widens it to the host capability. */
|
|
4
|
+
const LinkToken = (0, require("@embedpdf/core").createCapabilityToken)("link", {
|
|
5
|
+
hint: `add linkPlugin() from '@embedpdf/plugin-link' to your plugins list`,
|
|
6
|
+
promises: {
|
|
7
|
+
listAllLinks: true,
|
|
8
|
+
ensureLoaded: true
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
//#endregion
|
|
12
|
+
Object.defineProperty(exports, "LinkToken", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function() {
|
|
15
|
+
return LinkToken;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=contract-CaaMtYBR.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract-CaaMtYBR.cjs","names":[],"sources":["../src/token.ts"],"sourcesContent":["/** The package token, created once here: `contract.ts` re-exports it and\n * `host-contract.ts` widens it to the host capability. */\nimport { createCapabilityToken } from '@embedpdf/core';\n\nimport type { LinkCapability } from './contract';\n\nexport const LinkToken = createCapabilityToken<LinkCapability>('link', {\n hint: `add linkPlugin() from '@embedpdf/plugin-link' to your plugins list`,\n // Without a document, an adapter's stand-in rejects these with `not-ready`, as the\n // capability would; the type asks for every member that returns a promise.\n promises: {\n listAllLinks: true,\n ensureLoaded: true,\n },\n});\n"],"mappings":";;;AAMA,MAAa,aAAA,2BAAA,CAAA,CAAA,sBAAA,CAAkD,QAAQ;CACrE,MAAM;CAGN,UAAU;EACR,cAAc;EACd,cAAc;CAChB;AACF,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createCapabilityToken } from "@embedpdf/core";
|
|
2
|
+
//#region src/token.ts
|
|
3
|
+
/** The package token, created once here: `contract.ts` re-exports it and
|
|
4
|
+
* `host-contract.ts` widens it to the host capability. */
|
|
5
|
+
const LinkToken = createCapabilityToken("link", {
|
|
6
|
+
hint: `add linkPlugin() from '@embedpdf/plugin-link' to your plugins list`,
|
|
7
|
+
promises: {
|
|
8
|
+
listAllLinks: true,
|
|
9
|
+
ensureLoaded: true
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
//#endregion
|
|
13
|
+
export { LinkToken as t };
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=contract-D0k-EtjB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract-D0k-EtjB.js","names":[],"sources":["../src/token.ts"],"sourcesContent":["/** The package token, created once here: `contract.ts` re-exports it and\n * `host-contract.ts` widens it to the host capability. */\nimport { createCapabilityToken } from '@embedpdf/core';\n\nimport type { LinkCapability } from './contract';\n\nexport const LinkToken = createCapabilityToken<LinkCapability>('link', {\n hint: `add linkPlugin() from '@embedpdf/plugin-link' to your plugins list`,\n // Without a document, an adapter's stand-in rejects these with `not-ready`, as the\n // capability would; the type asks for every member that returns a promise.\n promises: {\n listAllLinks: true,\n ensureLoaded: true,\n },\n});\n"],"mappings":";;;;AAMA,MAAa,YAAY,sBAAsC,QAAQ;CACrE,MAAM;CAGN,UAAU;EACR,cAAc;EACd,cAAc;CAChB;AACF,CAAC"}
|
package/dist/contract.cjs
CHANGED
package/dist/contract.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as LinkCapability, c as
|
|
2
|
-
export {
|
|
1
|
+
import { a as LinkCapability, c as PageDestination, i as LinkActivation, l as PdfLinkTarget, n as LinkActivateContext, o as LinkLoadedEvent, r as LinkActivatedEvent, s as LinkResolution, t as Link, u as LinkToken } from "./contract-C8by3cQG.cjs";
|
|
2
|
+
export { Link, LinkActivateContext, LinkActivatedEvent, LinkActivation, LinkCapability, LinkLoadedEvent, LinkResolution, LinkToken, type PageDestination, type PdfLinkTarget };
|
package/dist/contract.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as LinkCapability, c as
|
|
2
|
-
export {
|
|
1
|
+
import { a as LinkCapability, c as PageDestination, i as LinkActivation, l as PdfLinkTarget, n as LinkActivateContext, o as LinkLoadedEvent, r as LinkActivatedEvent, s as LinkResolution, t as Link, u as LinkToken } from "./contract-BL4jWtGT.js";
|
|
2
|
+
export { Link, LinkActivateContext, LinkActivatedEvent, LinkActivation, LinkCapability, LinkLoadedEvent, LinkResolution, LinkToken, type PageDestination, type PdfLinkTarget };
|
package/dist/contract.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as LinkToken } from "./contract-
|
|
1
|
+
import { t as LinkToken } from "./contract-D0k-EtjB.js";
|
|
2
2
|
export { LinkToken };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { a as LinkCapability } from "./contract-BL4jWtGT.js";
|
|
2
|
+
import { Unsubscribe } from "@embedpdf/core";
|
|
3
|
+
//#region src/host-contract.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Opens a website for `activate()`, in the user's gesture. Returns whether it
|
|
6
|
+
* opened: false for an address it won't open (a `javascript:` or `file:`
|
|
7
|
+
* URI), which activation then reports.
|
|
8
|
+
*/
|
|
9
|
+
type UriOpener = (uri: string) => boolean;
|
|
10
|
+
interface LinkHostCapability extends LinkCapability {
|
|
11
|
+
/** Does the active tool navigate links (the layer paints anchors only then)? */
|
|
12
|
+
isNavigationEngaged(): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Register the framework's website opener. The plugin never touches the
|
|
15
|
+
* DOM: without an opener, a website link activates as `{ outcome: 'uri' }`
|
|
16
|
+
* for the caller to open. The latest registration wins until it is removed.
|
|
17
|
+
*/
|
|
18
|
+
registerUriOpener(opener: UriOpener): Unsubscribe;
|
|
19
|
+
}
|
|
20
|
+
declare const LinkToken: import("@embedpdf/core").CapabilityToken<LinkHostCapability>;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { LinkToken as n, UriOpener as r, LinkHostCapability as t };
|
|
23
|
+
//# sourceMappingURL=host-contract-BEEpcMUN.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { a as LinkCapability } from "./contract-C8by3cQG.cjs";
|
|
2
|
+
import { Unsubscribe } from "@embedpdf/core";
|
|
3
|
+
//#region src/host-contract.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Opens a website for `activate()`, in the user's gesture. Returns whether it
|
|
6
|
+
* opened: false for an address it won't open (a `javascript:` or `file:`
|
|
7
|
+
* URI), which activation then reports.
|
|
8
|
+
*/
|
|
9
|
+
type UriOpener = (uri: string) => boolean;
|
|
10
|
+
interface LinkHostCapability extends LinkCapability {
|
|
11
|
+
/** Does the active tool navigate links (the layer paints anchors only then)? */
|
|
12
|
+
isNavigationEngaged(): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Register the framework's website opener. The plugin never touches the
|
|
15
|
+
* DOM: without an opener, a website link activates as `{ outcome: 'uri' }`
|
|
16
|
+
* for the caller to open. The latest registration wins until it is removed.
|
|
17
|
+
*/
|
|
18
|
+
registerUriOpener(opener: UriOpener): Unsubscribe;
|
|
19
|
+
}
|
|
20
|
+
declare const LinkToken: import("@embedpdf/core").CapabilityToken<LinkHostCapability>;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { LinkToken as n, UriOpener as r, LinkHostCapability as t };
|
|
23
|
+
//# sourceMappingURL=host-contract-WJZHqcPp.d.cts.map
|