@embedpdf/plugin-selection 1.0.11 → 1.0.12
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/index.cjs +2 -450
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -210
- package/dist/index.js +27 -53
- package/dist/index.js.map +1 -1
- package/dist/lib/actions.d.ts +57 -0
- package/dist/lib/index.d.ts +9 -0
- package/dist/lib/manifest.d.ts +4 -0
- package/dist/lib/reducer.d.ts +4 -0
- package/dist/lib/selection-plugin.d.ts +29 -0
- package/dist/lib/selectors.d.ts +14 -0
- package/dist/lib/types.d.ts +63 -0
- package/dist/lib/utils.d.ts +70 -0
- package/dist/preact/adapter.d.ts +4 -0
- package/dist/preact/core.d.ts +1 -0
- package/dist/preact/index.cjs +2 -170
- package/dist/preact/index.cjs.map +1 -1
- package/dist/preact/index.d.ts +1 -25
- package/dist/preact/index.js +10 -20
- package/dist/preact/index.js.map +1 -1
- package/dist/preact/interaction-manager.d.ts +1 -0
- package/dist/react/adapter.d.ts +2 -0
- package/dist/react/core.d.ts +1 -0
- package/dist/react/index.cjs +2 -170
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.ts +1 -25
- package/dist/react/index.js +9 -20
- package/dist/react/index.js.map +1 -1
- package/dist/react/interaction-manager.d.ts +1 -0
- package/dist/shared-preact/components/copy-to-clipboard.d.ts +1 -0
- package/dist/shared-preact/components/index.d.ts +2 -0
- package/dist/shared-preact/components/selection-layer.d.ts +7 -0
- package/dist/shared-preact/hooks/index.d.ts +1 -0
- package/dist/shared-preact/hooks/use-selection.d.ts +11 -0
- package/dist/shared-preact/index.d.ts +2 -0
- package/dist/shared-react/components/copy-to-clipboard.d.ts +1 -0
- package/dist/shared-react/components/index.d.ts +2 -0
- package/dist/shared-react/components/selection-layer.d.ts +7 -0
- package/dist/shared-react/hooks/index.d.ts +1 -0
- package/dist/shared-react/hooks/use-selection.d.ts +11 -0
- package/dist/shared-react/index.d.ts +2 -0
- package/dist/vue/components/copy-to-clipboard.vue.d.ts +2 -0
- package/dist/vue/components/index.d.ts +2 -0
- package/dist/vue/components/selection-layer.vue.d.ts +9 -0
- package/dist/vue/hooks/index.d.ts +1 -0
- package/dist/vue/hooks/use-selection.d.ts +11 -0
- package/dist/vue/index.cjs +2 -0
- package/dist/vue/index.cjs.map +1 -0
- package/dist/vue/index.d.ts +2 -0
- package/dist/vue/index.js +145 -0
- package/dist/vue/index.js.map +1 -0
- package/package.json +23 -14
- package/dist/index.d.cts +0 -210
- package/dist/preact/index.d.cts +0 -25
- package/dist/react/index.d.cts +0 -25
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { BasePluginConfig, EventHook } from '@embedpdf/core';
|
|
2
|
+
import { PdfPageGeometry, PdfTask, Rect } from '@embedpdf/models';
|
|
3
|
+
export interface SelectionPluginConfig extends BasePluginConfig {
|
|
4
|
+
}
|
|
5
|
+
export interface GlyphPointer {
|
|
6
|
+
page: number;
|
|
7
|
+
index: number;
|
|
8
|
+
}
|
|
9
|
+
export interface SelectionRangeX {
|
|
10
|
+
start: GlyphPointer;
|
|
11
|
+
end: GlyphPointer;
|
|
12
|
+
}
|
|
13
|
+
export interface SelectionState {
|
|
14
|
+
/** page → geometry cache */
|
|
15
|
+
geometry: Record<number, PdfPageGeometry>;
|
|
16
|
+
/** current selection or null */
|
|
17
|
+
rects: Record<number, Rect[]>;
|
|
18
|
+
selection: SelectionRangeX | null;
|
|
19
|
+
slices: Record<number, {
|
|
20
|
+
start: number;
|
|
21
|
+
count: number;
|
|
22
|
+
}>;
|
|
23
|
+
active: boolean;
|
|
24
|
+
selecting: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface FormattedSelection {
|
|
27
|
+
pageIndex: number;
|
|
28
|
+
rect: Rect;
|
|
29
|
+
segmentRects: Rect[];
|
|
30
|
+
}
|
|
31
|
+
export interface SelectionCapability {
|
|
32
|
+
getGeometry(page: number): PdfTask<PdfPageGeometry>;
|
|
33
|
+
getFormattedSelection(): FormattedSelection[];
|
|
34
|
+
getFormattedSelectionForPage(page: number): FormattedSelection | null;
|
|
35
|
+
getHighlightRectsForPage(page: number): Rect[];
|
|
36
|
+
getHighlightRects(): Record<number, Rect[]>;
|
|
37
|
+
getBoundingRectForPage(page: number): Rect | null;
|
|
38
|
+
getBoundingRects(): {
|
|
39
|
+
page: number;
|
|
40
|
+
rect: Rect;
|
|
41
|
+
}[];
|
|
42
|
+
getSelectedText(): PdfTask<string[]>;
|
|
43
|
+
copyToClipboard(): void;
|
|
44
|
+
begin(page: number, glyphIdx: number): void;
|
|
45
|
+
update(page: number, glyphIdx: number): void;
|
|
46
|
+
end(): void;
|
|
47
|
+
clear(): void;
|
|
48
|
+
onSelectionChange: EventHook<SelectionRangeX | null>;
|
|
49
|
+
onTextRetrieved: EventHook<string[]>;
|
|
50
|
+
onCopyToClipboard: EventHook<string>;
|
|
51
|
+
onBeginSelection: EventHook<{
|
|
52
|
+
page: number;
|
|
53
|
+
index: number;
|
|
54
|
+
}>;
|
|
55
|
+
onEndSelection: EventHook<void>;
|
|
56
|
+
/** Tell the selection plugin that text selection should stay
|
|
57
|
+
enabled while <modeId> is active. */
|
|
58
|
+
enableForMode(modeId: string): void;
|
|
59
|
+
/** Quick check used by SelectionLayer during pointer events. */
|
|
60
|
+
isEnabledForMode(modeId: string): boolean;
|
|
61
|
+
/** Get the current state of the selection plugin. */
|
|
62
|
+
getState(): SelectionState;
|
|
63
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { PdfPageGeometry, Position, Rect } from '@embedpdf/models';
|
|
2
|
+
import { SelectionRangeX } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Hit-test helper using runs
|
|
5
|
+
* @param geo - page geometry
|
|
6
|
+
* @param pt - point
|
|
7
|
+
* @returns glyph index
|
|
8
|
+
*/
|
|
9
|
+
export declare function glyphAt(geo: PdfPageGeometry, pt: Position): number;
|
|
10
|
+
/**
|
|
11
|
+
* Helper: min/max glyph indices on `page` for current sel
|
|
12
|
+
* @param sel - selection range
|
|
13
|
+
* @param geo - page geometry
|
|
14
|
+
* @param page - page index
|
|
15
|
+
* @returns { from: number; to: number } | null
|
|
16
|
+
*/
|
|
17
|
+
export declare function sliceBounds(sel: SelectionRangeX | null, geo: PdfPageGeometry | undefined, page: number): {
|
|
18
|
+
from: number;
|
|
19
|
+
to: number;
|
|
20
|
+
} | null;
|
|
21
|
+
/**
|
|
22
|
+
* Helper: build rects for a slice of the page
|
|
23
|
+
* @param geo - page geometry
|
|
24
|
+
* @param from - from index
|
|
25
|
+
* @param to - to index
|
|
26
|
+
* @param merge - whether to merge adjacent rects (default: true)
|
|
27
|
+
* @returns rects
|
|
28
|
+
*/
|
|
29
|
+
export declare function rectsWithinSlice(geo: PdfPageGeometry, from: number, to: number, merge?: boolean): Rect[];
|
|
30
|
+
/**
|
|
31
|
+
* ============================================================================
|
|
32
|
+
* Rectangle Merging Algorithm
|
|
33
|
+
* ============================================================================
|
|
34
|
+
*
|
|
35
|
+
* The following code is adapted from Chromium's PDF text selection implementation.
|
|
36
|
+
*
|
|
37
|
+
* Copyright 2010 The Chromium Authors
|
|
38
|
+
* Use of this source code is governed by a BSD-style license that can be
|
|
39
|
+
* found in the LICENSE file: https://source.chromium.org/chromium/chromium/src/+/main:LICENSE
|
|
40
|
+
*
|
|
41
|
+
* Original source:
|
|
42
|
+
* https://source.chromium.org/chromium/chromium/src/+/main:pdf/pdfium/pdfium_range.cc
|
|
43
|
+
*
|
|
44
|
+
* Adapted for TypeScript and this project's Rect/geometry types.
|
|
45
|
+
*/
|
|
46
|
+
/**
|
|
47
|
+
* Text run info for rect merging (similar to Chromium's ScreenRectTextRunInfo)
|
|
48
|
+
*/
|
|
49
|
+
export interface TextRunInfo {
|
|
50
|
+
rect: Rect;
|
|
51
|
+
charCount: number;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Helper functions for Rect operations
|
|
55
|
+
*/
|
|
56
|
+
export declare function rectUnion(rect1: Rect, rect2: Rect): Rect;
|
|
57
|
+
export declare function rectIntersect(rect1: Rect, rect2: Rect): Rect;
|
|
58
|
+
export declare function rectIsEmpty(rect: Rect): boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Returns a ratio between [0, 1] representing vertical overlap
|
|
61
|
+
*/
|
|
62
|
+
export declare function getVerticalOverlap(rect1: Rect, rect2: Rect): number;
|
|
63
|
+
/**
|
|
64
|
+
* Returns true if there is sufficient horizontal and vertical overlap
|
|
65
|
+
*/
|
|
66
|
+
export declare function shouldMergeHorizontalRects(textRun1: TextRunInfo, textRun2: TextRunInfo): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Merge adjacent rectangles based on proximity and overlap (similar to Chromium's algorithm)
|
|
69
|
+
*/
|
|
70
|
+
export declare function mergeAdjacentRects(textRuns: TextRunInfo[]): Rect[];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { Fragment } from 'preact';
|
|
2
|
+
export { useEffect, useRef, useState, useCallback, useMemo } from 'preact/hooks';
|
|
3
|
+
export type { ComponentChildren as ReactNode } from 'preact';
|
|
4
|
+
export type HTMLAttributes<T = any> = import('preact').JSX.HTMLAttributes<T extends EventTarget ? T : never>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@embedpdf/core/preact';
|
package/dist/preact/index.cjs
CHANGED
|
@@ -1,170 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/preact/index.ts
|
|
21
|
-
var preact_exports = {};
|
|
22
|
-
__export(preact_exports, {
|
|
23
|
-
CopyToClipboard: () => CopyToClipboard,
|
|
24
|
-
SelectionLayer: () => SelectionLayer,
|
|
25
|
-
useSelectionCapability: () => useSelectionCapability,
|
|
26
|
-
useSelectionPlugin: () => useSelectionPlugin
|
|
27
|
-
});
|
|
28
|
-
module.exports = __toCommonJS(preact_exports);
|
|
29
|
-
|
|
30
|
-
// src/preact/hooks/use-selection.ts
|
|
31
|
-
var import_preact = require("@embedpdf/core/preact");
|
|
32
|
-
var import_plugin_selection = require("@embedpdf/plugin-selection");
|
|
33
|
-
var useSelectionCapability = () => (0, import_preact.useCapability)(import_plugin_selection.SelectionPlugin.id);
|
|
34
|
-
var useSelectionPlugin = () => (0, import_preact.usePlugin)(import_plugin_selection.SelectionPlugin.id);
|
|
35
|
-
|
|
36
|
-
// src/preact/components/selection-layer.tsx
|
|
37
|
-
var import_hooks = require("preact/hooks");
|
|
38
|
-
var import_models = require("@embedpdf/models");
|
|
39
|
-
var import_preact2 = require("@embedpdf/plugin-interaction-manager/preact");
|
|
40
|
-
var import_plugin_selection2 = require("@embedpdf/plugin-selection");
|
|
41
|
-
var import_jsx_runtime = require("preact/jsx-runtime");
|
|
42
|
-
function SelectionLayer({ pageIndex, scale, background = "rgba(33,150,243)" }) {
|
|
43
|
-
const { provides: sel } = useSelectionCapability();
|
|
44
|
-
const { provides: im } = (0, import_preact2.useInteractionManagerCapability)();
|
|
45
|
-
const { register } = (0, import_preact2.usePointerHandlers)({ pageIndex });
|
|
46
|
-
const [rects, setRects] = (0, import_hooks.useState)([]);
|
|
47
|
-
const [boundingRect, setBoundingRect] = (0, import_hooks.useState)(null);
|
|
48
|
-
const { setCursor, removeCursor } = (0, import_preact2.useCursor)();
|
|
49
|
-
const geoCacheRef = (0, import_hooks.useRef)(null);
|
|
50
|
-
(0, import_hooks.useEffect)(() => {
|
|
51
|
-
if (!sel) return;
|
|
52
|
-
return sel.onSelectionChange(() => {
|
|
53
|
-
const mode = im?.getActiveMode();
|
|
54
|
-
if (mode === "default") {
|
|
55
|
-
setRects(sel.getHighlightRectsForPage(pageIndex));
|
|
56
|
-
setBoundingRect(sel.getBoundingRectForPage(pageIndex));
|
|
57
|
-
} else {
|
|
58
|
-
setRects([]);
|
|
59
|
-
setBoundingRect(null);
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
}, [sel, pageIndex]);
|
|
63
|
-
const cachedGlyphAt = (0, import_hooks.useCallback)((pt) => {
|
|
64
|
-
const geo = geoCacheRef.current;
|
|
65
|
-
return geo ? (0, import_plugin_selection2.glyphAt)(geo, pt) : -1;
|
|
66
|
-
}, []);
|
|
67
|
-
(0, import_hooks.useEffect)(() => {
|
|
68
|
-
if (!sel) return;
|
|
69
|
-
const task = sel.getGeometry(pageIndex);
|
|
70
|
-
task.wait((g) => geoCacheRef.current = g, import_models.ignore);
|
|
71
|
-
return () => {
|
|
72
|
-
task.abort({
|
|
73
|
-
code: import_models.PdfErrorCode.Cancelled,
|
|
74
|
-
message: "Cancelled"
|
|
75
|
-
});
|
|
76
|
-
geoCacheRef.current = null;
|
|
77
|
-
};
|
|
78
|
-
}, [sel, pageIndex]);
|
|
79
|
-
const handlers = (0, import_hooks.useMemo)(
|
|
80
|
-
() => ({
|
|
81
|
-
onPointerDown: (point, _evt, modeId) => {
|
|
82
|
-
if (!sel) return;
|
|
83
|
-
if (!sel.isEnabledForMode(modeId)) return;
|
|
84
|
-
sel.clear();
|
|
85
|
-
const task = sel.getGeometry(pageIndex);
|
|
86
|
-
task.wait((geo) => {
|
|
87
|
-
const g = (0, import_plugin_selection2.glyphAt)(geo, point);
|
|
88
|
-
if (g !== -1) sel.begin(pageIndex, g);
|
|
89
|
-
}, import_models.ignore);
|
|
90
|
-
},
|
|
91
|
-
onPointerMove: (point, _evt, modeId) => {
|
|
92
|
-
if (!sel) return;
|
|
93
|
-
if (!sel.isEnabledForMode(modeId)) return;
|
|
94
|
-
const g = cachedGlyphAt(point);
|
|
95
|
-
if (g !== -1) {
|
|
96
|
-
setCursor("selection-text", "text", 10);
|
|
97
|
-
} else {
|
|
98
|
-
removeCursor("selection-text");
|
|
99
|
-
}
|
|
100
|
-
if (g !== -1) sel.update(pageIndex, g);
|
|
101
|
-
},
|
|
102
|
-
onPointerUp: (_point, _evt, modeId) => {
|
|
103
|
-
if (!sel) return;
|
|
104
|
-
if (!sel.isEnabledForMode(modeId)) return;
|
|
105
|
-
sel.end();
|
|
106
|
-
},
|
|
107
|
-
onHandlerActiveEnd(modeId) {
|
|
108
|
-
if (!sel) return;
|
|
109
|
-
if (!sel.isEnabledForMode(modeId)) return;
|
|
110
|
-
sel.clear();
|
|
111
|
-
}
|
|
112
|
-
}),
|
|
113
|
-
[sel, pageIndex, cachedGlyphAt]
|
|
114
|
-
);
|
|
115
|
-
(0, import_hooks.useEffect)(() => {
|
|
116
|
-
if (!register) return;
|
|
117
|
-
return register(handlers);
|
|
118
|
-
}, [register, handlers]);
|
|
119
|
-
if (!boundingRect) return null;
|
|
120
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
121
|
-
"div",
|
|
122
|
-
{
|
|
123
|
-
style: {
|
|
124
|
-
position: "absolute",
|
|
125
|
-
left: boundingRect.origin.x * scale,
|
|
126
|
-
top: boundingRect.origin.y * scale,
|
|
127
|
-
width: boundingRect.size.width * scale,
|
|
128
|
-
height: boundingRect.size.height * scale,
|
|
129
|
-
mixBlendMode: "multiply",
|
|
130
|
-
isolation: "isolate"
|
|
131
|
-
},
|
|
132
|
-
children: rects.map((b, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
133
|
-
"div",
|
|
134
|
-
{
|
|
135
|
-
style: {
|
|
136
|
-
position: "absolute",
|
|
137
|
-
left: (b.origin.x - boundingRect.origin.x) * scale,
|
|
138
|
-
top: (b.origin.y - boundingRect.origin.y) * scale,
|
|
139
|
-
width: b.size.width * scale,
|
|
140
|
-
height: b.size.height * scale,
|
|
141
|
-
background,
|
|
142
|
-
pointerEvents: "none"
|
|
143
|
-
}
|
|
144
|
-
},
|
|
145
|
-
i
|
|
146
|
-
))
|
|
147
|
-
}
|
|
148
|
-
);
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
// src/preact/components/copy-to-clipboard.tsx
|
|
152
|
-
var import_hooks3 = require("preact/hooks");
|
|
153
|
-
function CopyToClipboard() {
|
|
154
|
-
const { provides: sel } = useSelectionCapability();
|
|
155
|
-
(0, import_hooks3.useEffect)(() => {
|
|
156
|
-
if (!sel) return;
|
|
157
|
-
return sel.onCopyToClipboard((text) => {
|
|
158
|
-
navigator.clipboard.writeText(text);
|
|
159
|
-
});
|
|
160
|
-
}, [sel]);
|
|
161
|
-
return null;
|
|
162
|
-
}
|
|
163
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
164
|
-
0 && (module.exports = {
|
|
165
|
-
CopyToClipboard,
|
|
166
|
-
SelectionLayer,
|
|
167
|
-
useSelectionCapability,
|
|
168
|
-
useSelectionPlugin
|
|
169
|
-
});
|
|
170
|
-
//# sourceMappingURL=index.cjs.map
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@embedpdf/core/preact"),t=require("@embedpdf/plugin-selection"),r=require("preact/jsx-runtime");require("preact");const i=require("preact/hooks"),n=require("@embedpdf/models"),o=require("@embedpdf/plugin-interaction-manager/preact"),s=()=>e.useCapability(t.SelectionPlugin.id);exports.CopyToClipboard=function(){const{provides:e}=s();return i.useEffect((()=>{if(e)return e.onCopyToClipboard((e=>{navigator.clipboard.writeText(e)}))}),[e]),null},exports.SelectionLayer=function({pageIndex:e,scale:l,background:u="rgba(33,150,243)"}){const{provides:a}=s(),{provides:d}=o.useInteractionManagerCapability(),{register:c}=o.usePointerHandlers({pageIndex:e}),[g,p]=i.useState([]),[f,b]=i.useState(null),{setCursor:h,removeCursor:x}=o.useCursor(),y=i.useRef(null);i.useEffect((()=>{if(a)return a.onSelectionChange((()=>{"default"===(null==d?void 0:d.getActiveMode())?(p(a.getHighlightRectsForPage(e)),b(a.getBoundingRectForPage(e))):(p([]),b(null))}))}),[a,e]);const m=i.useCallback((e=>{const r=y.current;return r?t.glyphAt(r,e):-1}),[]);i.useEffect((()=>{if(!a)return;const t=a.getGeometry(e);return t.wait((e=>y.current=e),n.ignore),()=>{t.abort({code:n.PdfErrorCode.Cancelled,message:"Cancelled"}),y.current=null}}),[a,e]);const C=i.useMemo((()=>({onPointerDown:(r,i,o)=>{if(!a)return;if(!a.isEnabledForMode(o))return;a.clear();a.getGeometry(e).wait((i=>{const n=t.glyphAt(i,r);-1!==n&&a.begin(e,n)}),n.ignore)},onPointerMove:(t,r,i)=>{if(!a)return;if(!a.isEnabledForMode(i))return;const n=m(t);-1!==n?h("selection-text","text",10):x("selection-text"),-1!==n&&a.update(e,n)},onPointerUp:(e,t,r)=>{a&&a.isEnabledForMode(r)&&a.end()},onHandlerActiveEnd(e){a&&a.isEnabledForMode(e)&&a.clear()}})),[a,e,m]);return i.useEffect((()=>{if(c)return c(C)}),[c,C]),f?r.jsx("div",{style:{position:"absolute",left:f.origin.x*l,top:f.origin.y*l,width:f.size.width*l,height:f.size.height*l,mixBlendMode:"multiply",isolation:"isolate"},children:g.map(((e,t)=>r.jsx("div",{style:{position:"absolute",left:(e.origin.x-f.origin.x)*l,top:(e.origin.y-f.origin.y)*l,width:e.size.width*l,height:e.size.height*l,background:u,pointerEvents:"none"}},t)))}):null},exports.useSelectionCapability=s,exports.useSelectionPlugin=()=>e.usePlugin(t.SelectionPlugin.id);
|
|
2
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/shared/hooks/use-selection.ts","../../src/shared/components/copy-to-clipboard.tsx","../../src/shared/components/selection-layer.tsx"],"sourcesContent":["import { useCapability, usePlugin } from '@embedpdf/core/@framework';\nimport { SelectionPlugin } from '@embedpdf/plugin-selection';\n\nexport const useSelectionCapability = () => useCapability<SelectionPlugin>(SelectionPlugin.id);\nexport const useSelectionPlugin = () => usePlugin<SelectionPlugin>(SelectionPlugin.id);\n","import { useEffect } from '@framework';\n\nimport { useSelectionCapability } from '../hooks';\n\nexport function CopyToClipboard() {\n const { provides: sel } = useSelectionCapability();\n\n useEffect(() => {\n if (!sel) return;\n return sel.onCopyToClipboard((text) => {\n navigator.clipboard.writeText(text);\n });\n }, [sel]);\n\n return null;\n}\n","import { useCallback, useEffect, useMemo, useRef, useState } from '@framework';\nimport { ignore, PdfErrorCode, PdfPageGeometry, Position, Rect } from '@embedpdf/models';\nimport {\n useCursor,\n useInteractionManagerCapability,\n usePointerHandlers,\n} from '@embedpdf/plugin-interaction-manager/@framework';\nimport { PointerEventHandlersWithLifecycle } from '@embedpdf/plugin-interaction-manager';\nimport { glyphAt } from '@embedpdf/plugin-selection';\n\nimport { useSelectionCapability } from '../hooks';\n\ntype Props = {\n pageIndex: number;\n scale: number;\n background?: string;\n};\n\nexport function SelectionLayer({ pageIndex, scale, background = 'rgba(33,150,243)' }: Props) {\n const { provides: sel } = useSelectionCapability();\n const { provides: im } = useInteractionManagerCapability();\n const { register } = usePointerHandlers({ pageIndex });\n const [rects, setRects] = useState<Array<Rect>>([]);\n const [boundingRect, setBoundingRect] = useState<Rect | null>(null);\n const { setCursor, removeCursor } = useCursor();\n const geoCacheRef = useRef<PdfPageGeometry | null>(null);\n\n /* subscribe to rect updates */\n useEffect(() => {\n if (!sel) return;\n return sel.onSelectionChange(() => {\n const mode = im?.getActiveMode();\n if (mode === 'default') {\n setRects(sel.getHighlightRectsForPage(pageIndex));\n setBoundingRect(sel.getBoundingRectForPage(pageIndex));\n } else {\n setRects([]);\n setBoundingRect(null);\n }\n });\n }, [sel, pageIndex]);\n\n /* cheap glyphAt cache for the active page */\n const cachedGlyphAt = useCallback((pt: Position) => {\n const geo = geoCacheRef.current;\n return geo ? glyphAt(geo, pt) : -1;\n }, []);\n\n // Initialize geometry cache\n useEffect(() => {\n if (!sel) return;\n const task = sel.getGeometry(pageIndex);\n task.wait((g) => (geoCacheRef.current = g), ignore);\n\n return () => {\n task.abort({\n code: PdfErrorCode.Cancelled,\n message: 'Cancelled',\n });\n geoCacheRef.current = null;\n };\n }, [sel, pageIndex]);\n\n const handlers = useMemo(\n (): PointerEventHandlersWithLifecycle<PointerEvent> => ({\n onPointerDown: (point, _evt, modeId) => {\n if (!sel) return;\n if (!sel.isEnabledForMode(modeId)) return;\n // clear the selection\n sel.clear();\n const task = sel.getGeometry(pageIndex);\n task.wait((geo) => {\n const g = glyphAt(geo, point);\n if (g !== -1) sel.begin(pageIndex, g);\n }, ignore);\n },\n onPointerMove: (point, _evt, modeId) => {\n if (!sel) return;\n if (!sel.isEnabledForMode(modeId)) return;\n const g = cachedGlyphAt(point);\n if (g !== -1) {\n setCursor('selection-text', 'text', 10);\n } else {\n removeCursor('selection-text');\n }\n if (g !== -1) sel.update(pageIndex, g);\n },\n onPointerUp: (_point, _evt, modeId) => {\n if (!sel) return;\n if (!sel.isEnabledForMode(modeId)) return;\n sel.end();\n },\n onHandlerActiveEnd(modeId) {\n if (!sel) return;\n if (!sel.isEnabledForMode(modeId)) return;\n\n sel.clear();\n },\n }),\n [sel, pageIndex, cachedGlyphAt],\n );\n\n useEffect(() => {\n if (!register) return;\n return register(handlers);\n }, [register, handlers]);\n\n if (!boundingRect) return null;\n\n return (\n <div\n style={{\n position: 'absolute',\n left: boundingRect.origin.x * scale,\n top: boundingRect.origin.y * scale,\n width: boundingRect.size.width * scale,\n height: boundingRect.size.height * scale,\n mixBlendMode: 'multiply',\n isolation: 'isolate',\n }}\n >\n {rects.map((b, i) => (\n <div\n key={i}\n style={{\n position: 'absolute',\n left: (b.origin.x - boundingRect.origin.x) * scale,\n top: (b.origin.y - boundingRect.origin.y) * scale,\n width: b.size.width * scale,\n height: b.size.height * scale,\n background,\n pointerEvents: 'none',\n }}\n />\n ))}\n </div>\n );\n}\n"],"names":["useSelectionCapability","useCapability","SelectionPlugin","id","provides","sel","useEffect","onCopyToClipboard","text","navigator","clipboard","writeText","pageIndex","scale","background","im","useInteractionManagerCapability","register","usePointerHandlers","rects","setRects","useState","boundingRect","setBoundingRect","setCursor","removeCursor","useCursor","geoCacheRef","useRef","onSelectionChange","getActiveMode","getHighlightRectsForPage","getBoundingRectForPage","cachedGlyphAt","useCallback","pt","geo","current","glyphAt","task","getGeometry","wait","g","ignore","abort","code","PdfErrorCode","Cancelled","message","handlers","useMemo","onPointerDown","point","_evt","modeId","isEnabledForMode","clear","begin","onPointerMove","update","onPointerUp","_point","end","onHandlerActiveEnd","jsxRuntime","jsx","style","position","left","origin","x","top","y","width","size","height","mixBlendMode","isolation","children","map","b","i","pointerEvents","usePlugin"],"mappings":"0UAGaA,EAAyB,IAAMC,gBAA+BC,EAAAA,gBAAgBC,4BCCpF,WACL,MAAQC,SAAUC,GAAQL,IASnB,OAPPM,EAAAA,WAAU,KACR,GAAKD,EACE,OAAAA,EAAIE,mBAAmBC,IAClBC,UAAAC,UAAUC,UAAUH,EAAI,GACnC,GACA,CAACH,IAEG,IACT,yBCGO,UAAwBO,UAAEA,EAAAC,MAAWA,EAAOC,WAAAA,EAAa,qBAC9D,MAAQV,SAAUC,GAAQL,KAClBI,SAAUW,GAAOC,qCACnBC,SAAEA,GAAaC,qBAAmB,CAAEN,eACnCO,EAAOC,GAAYC,EAAAA,SAAsB,KACzCC,EAAcC,GAAmBF,EAAAA,SAAsB,OACxDG,UAAEA,EAAAC,aAAWA,GAA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1BjD,EAAIyD,KAAI,EAEV,kBAAAC,CAAmBT,GACZjD,GACAA,EAAIkD,iBAAiBD,IAE1BjD,EAAImD,OAAM,KAGd,CAACnD,EAAKO,EAAWqB,IAQf,OALJ3B,EAAAA,WAAU,KACR,GAAKW,EACL,OAAOA,EAASgC,EAAQ,GACvB,CAAChC,EAAUgC,IAET3B,EAGH0C,EAAAC,IAAC,MAAA,CACCC,MAAO,CACLC,SAAU,WACVC,KAAM9C,EAAa+C,OAAOC,EAAIzD,EAC9B0D,IAAKjD,EAAa+C,OAAOG,EAAI3D,EAC7B4D,MAAOnD,EAAaoD,KAAKD,MAAQ5D,EACjC8D,OAAQrD,EAAaoD,KAAKC,OAAS9D,EACnC+D,aAAc,WACdC,UAAW,WAGZC,SAAM3D,EAAA4D,KAAI,CAACC,EAAGC,IACbjB,EAAAC,IAAC,MAAA,CAECC,MAAO,CACLC,SAAU,WACVC,MAAOY,EAAEX,OAAOC,EAAIhD,EAAa+C,OAAOC,GAAKzD,EAC7C0D,KAAMS,EAAEX,OAAOG,EAAIlD,EAAa+C,OAAOG,GAAK3D,EAC5C4D,MAAOO,EAAEN,KAAKD,MAAQ5D,EACtB8D,OAAQK,EAAEN,KAAKC,OAAS9D,EACxBC,aACAoE,cAAe,SARZD,OAhBa,IA8B5B,8DFrIkC,IAAME,YAA2BjF,EAAAA,gBAAgBC"}
|
package/dist/preact/index.d.ts
CHANGED
|
@@ -1,25 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { SelectionPlugin } from '@embedpdf/plugin-selection';
|
|
3
|
-
import * as preact from 'preact';
|
|
4
|
-
|
|
5
|
-
declare const useSelectionCapability: () => {
|
|
6
|
-
provides: Readonly<_embedpdf_plugin_selection.SelectionCapability> | null;
|
|
7
|
-
isLoading: boolean;
|
|
8
|
-
ready: Promise<void>;
|
|
9
|
-
};
|
|
10
|
-
declare const useSelectionPlugin: () => {
|
|
11
|
-
plugin: SelectionPlugin | null;
|
|
12
|
-
isLoading: boolean;
|
|
13
|
-
ready: Promise<void>;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
type Props = {
|
|
17
|
-
pageIndex: number;
|
|
18
|
-
scale: number;
|
|
19
|
-
background?: string;
|
|
20
|
-
};
|
|
21
|
-
declare function SelectionLayer({ pageIndex, scale, background }: Props): preact.JSX.Element | null;
|
|
22
|
-
|
|
23
|
-
declare function CopyToClipboard(): null;
|
|
24
|
-
|
|
25
|
-
export { CopyToClipboard, SelectionLayer, useSelectionCapability, useSelectionPlugin };
|
|
1
|
+
export * from '../shared-preact';
|
package/dist/preact/index.js
CHANGED
|
@@ -1,19 +1,12 @@
|
|
|
1
|
-
// src/preact/hooks/use-selection.ts
|
|
2
1
|
import { useCapability, usePlugin } from "@embedpdf/core/preact";
|
|
3
|
-
import { SelectionPlugin } from "@embedpdf/plugin-selection";
|
|
4
|
-
var useSelectionCapability = () => useCapability(SelectionPlugin.id);
|
|
5
|
-
var useSelectionPlugin = () => usePlugin(SelectionPlugin.id);
|
|
6
|
-
|
|
7
|
-
// src/preact/components/selection-layer.tsx
|
|
8
|
-
import { useCallback, useEffect, useMemo, useRef, useState } from "preact/hooks";
|
|
9
|
-
import { ignore, PdfErrorCode } from "@embedpdf/models";
|
|
10
|
-
import {
|
|
11
|
-
useCursor,
|
|
12
|
-
useInteractionManagerCapability,
|
|
13
|
-
usePointerHandlers
|
|
14
|
-
} from "@embedpdf/plugin-interaction-manager/preact";
|
|
15
|
-
import { glyphAt } from "@embedpdf/plugin-selection";
|
|
2
|
+
import { SelectionPlugin, glyphAt } from "@embedpdf/plugin-selection";
|
|
16
3
|
import { jsx } from "preact/jsx-runtime";
|
|
4
|
+
import "preact";
|
|
5
|
+
import { useState, useRef, useEffect, useCallback, useMemo } from "preact/hooks";
|
|
6
|
+
import { ignore, PdfErrorCode } from "@embedpdf/models";
|
|
7
|
+
import { useInteractionManagerCapability, usePointerHandlers, useCursor } from "@embedpdf/plugin-interaction-manager/preact";
|
|
8
|
+
const useSelectionCapability = () => useCapability(SelectionPlugin.id);
|
|
9
|
+
const useSelectionPlugin = () => usePlugin(SelectionPlugin.id);
|
|
17
10
|
function SelectionLayer({ pageIndex, scale, background = "rgba(33,150,243)" }) {
|
|
18
11
|
const { provides: sel } = useSelectionCapability();
|
|
19
12
|
const { provides: im } = useInteractionManagerCapability();
|
|
@@ -25,7 +18,7 @@ function SelectionLayer({ pageIndex, scale, background = "rgba(33,150,243)" }) {
|
|
|
25
18
|
useEffect(() => {
|
|
26
19
|
if (!sel) return;
|
|
27
20
|
return sel.onSelectionChange(() => {
|
|
28
|
-
const mode = im
|
|
21
|
+
const mode = im == null ? void 0 : im.getActiveMode();
|
|
29
22
|
if (mode === "default") {
|
|
30
23
|
setRects(sel.getHighlightRectsForPage(pageIndex));
|
|
31
24
|
setBoundingRect(sel.getBoundingRectForPage(pageIndex));
|
|
@@ -122,12 +115,9 @@ function SelectionLayer({ pageIndex, scale, background = "rgba(33,150,243)" }) {
|
|
|
122
115
|
}
|
|
123
116
|
);
|
|
124
117
|
}
|
|
125
|
-
|
|
126
|
-
// src/preact/components/copy-to-clipboard.tsx
|
|
127
|
-
import { useEffect as useEffect2 } from "preact/hooks";
|
|
128
118
|
function CopyToClipboard() {
|
|
129
119
|
const { provides: sel } = useSelectionCapability();
|
|
130
|
-
|
|
120
|
+
useEffect(() => {
|
|
131
121
|
if (!sel) return;
|
|
132
122
|
return sel.onCopyToClipboard((text) => {
|
|
133
123
|
navigator.clipboard.writeText(text);
|
|
@@ -141,4 +131,4 @@ export {
|
|
|
141
131
|
useSelectionCapability,
|
|
142
132
|
useSelectionPlugin
|
|
143
133
|
};
|
|
144
|
-
//# sourceMappingURL=index.js.map
|
|
134
|
+
//# sourceMappingURL=index.js.map
|
package/dist/preact/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/shared/hooks/use-selection.ts","../../src/shared/components/selection-layer.tsx","../../src/shared/components/copy-to-clipboard.tsx"],"sourcesContent":["import { useCapability, usePlugin } from '@embedpdf/core/@framework';\nimport { SelectionPlugin } from '@embedpdf/plugin-selection';\n\nexport const useSelectionCapability = () => useCapability<SelectionPlugin>(SelectionPlugin.id);\nexport const useSelectionPlugin = () => usePlugin<SelectionPlugin>(SelectionPlugin.id);\n","import { useCallback, useEffect, useMemo, useRef, useState } from '@framework';\nimport { ignore, PdfErrorCode, PdfPageGeometry, Position, Rect } from '@embedpdf/models';\nimport {\n useCursor,\n useInteractionManagerCapability,\n usePointerHandlers,\n} from '@embedpdf/plugin-interaction-manager/@framework';\nimport { PointerEventHandlersWithLifecycle } from '@embedpdf/plugin-interaction-manager';\nimport { glyphAt } from '@embedpdf/plugin-selection';\n\nimport { useSelectionCapability } from '../hooks';\n\ntype Props = {\n pageIndex: number;\n scale: number;\n background?: string;\n};\n\nexport function SelectionLayer({ pageIndex, scale, background = 'rgba(33,150,243)' }: Props) {\n const { provides: sel } = useSelectionCapability();\n const { provides: im } = useInteractionManagerCapability();\n const { register } = usePointerHandlers({ pageIndex });\n const [rects, setRects] = useState<Array<Rect>>([]);\n const [boundingRect, setBoundingRect] = useState<Rect | null>(null);\n const { setCursor, removeCursor } = useCursor();\n const geoCacheRef = useRef<PdfPageGeometry | null>(null);\n\n /* subscribe to rect updates */\n useEffect(() => {\n if (!sel) return;\n return sel.onSelectionChange(() => {\n const mode = im?.getActiveMode();\n if (mode === 'default') {\n setRects(sel.getHighlightRectsForPage(pageIndex));\n setBoundingRect(sel.getBoundingRectForPage(pageIndex));\n } else {\n setRects([]);\n setBoundingRect(null);\n }\n });\n }, [sel, pageIndex]);\n\n /* cheap glyphAt cache for the active page */\n const cachedGlyphAt = useCallback((pt: Position) => {\n const geo = geoCacheRef.current;\n return geo ? glyphAt(geo, pt) : -1;\n }, []);\n\n // Initialize geometry cache\n useEffect(() => {\n if (!sel) return;\n const task = sel.getGeometry(pageIndex);\n task.wait((g) => (geoCacheRef.current = g), ignore);\n\n return () => {\n task.abort({\n code: PdfErrorCode.Cancelled,\n message: 'Cancelled',\n });\n geoCacheRef.current = null;\n };\n }, [sel, pageIndex]);\n\n const handlers = useMemo(\n (): PointerEventHandlersWithLifecycle<PointerEvent> => ({\n onPointerDown: (point, _evt, modeId) => {\n if (!sel) return;\n if (!sel.isEnabledForMode(modeId)) return;\n // clear the selection\n sel.clear();\n const task = sel.getGeometry(pageIndex);\n task.wait((geo) => {\n const g = glyphAt(geo, point);\n if (g !== -1) sel.begin(pageIndex, g);\n }, ignore);\n },\n onPointerMove: (point, _evt, modeId) => {\n if (!sel) return;\n if (!sel.isEnabledForMode(modeId)) return;\n const g = cachedGlyphAt(point);\n if (g !== -1) {\n setCursor('selection-text', 'text', 10);\n } else {\n removeCursor('selection-text');\n }\n if (g !== -1) sel.update(pageIndex, g);\n },\n onPointerUp: (_point, _evt, modeId) => {\n if (!sel) return;\n if (!sel.isEnabledForMode(modeId)) return;\n sel.end();\n },\n onHandlerActiveEnd(modeId) {\n if (!sel) return;\n if (!sel.isEnabledForMode(modeId)) return;\n\n sel.clear();\n },\n }),\n [sel, pageIndex, cachedGlyphAt],\n );\n\n useEffect(() => {\n if (!register) return;\n return register(handlers);\n }, [register, handlers]);\n\n if (!boundingRect) return null;\n\n return (\n <div\n style={{\n position: 'absolute',\n left: boundingRect.origin.x * scale,\n top: boundingRect.origin.y * scale,\n width: boundingRect.size.width * scale,\n height: boundingRect.size.height * scale,\n mixBlendMode: 'multiply',\n isolation: 'isolate',\n }}\n >\n {rects.map((b, i) => (\n <div\n key={i}\n style={{\n position: 'absolute',\n left: (b.origin.x - boundingRect.origin.x) * scale,\n top: (b.origin.y - boundingRect.origin.y) * scale,\n width: b.size.width * scale,\n height: b.size.height * scale,\n background,\n pointerEvents: 'none',\n }}\n />\n ))}\n </div>\n );\n}\n","import { useEffect } from '@framework';\n\nimport { useSelectionCapability } from '../hooks';\n\nexport function CopyToClipboard() {\n const { provides: sel } = useSelectionCapability();\n\n useEffect(() => {\n if (!sel) return;\n return sel.onCopyToClipboard((text) => {\n navigator.clipboard.writeText(text);\n });\n }, [sel]);\n\n return null;\n}\n"],"names":[],"mappings":";;;;;;;AAGO,MAAM,yBAAyB,MAAM,cAA+B,gBAAgB,EAAE;AACtF,MAAM,qBAAqB,MAAM,UAA2B,gBAAgB,EAAE;ACc9E,SAAS,eAAe,EAAE,WAAW,OAAO,aAAa,sBAA6B;AAC3F,QAAM,EAAE,UAAU,IAAI,IAAI,uBAAuB;AACjD,QAAM,EAAE,UAAU,GAAG,IAAI,gCAAgC;AACzD,QAAM,EAAE,SAAS,IAAI,mBAAmB,EAAE,WAAW;AACrD,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAsB,CAAA,CAAE;AAClD,QAAM,CAAC,cAAc,eAAe,IAAI,SAAsB,IAAI;AAClE,QAAM,EAAE,WAAW,aAAa,IAAI,UAAU;AACxC,QAAA,cAAc,OAA+B,IAAI;AAGvD,YAAU,MAAM;AACd,QAAI,CAAC,IAAK;AACH,WAAA,IAAI,kBAAkB,MAAM;AAC3B,YAAA,OAAO,yBAAI;AACjB,UAAI,SAAS,WAAW;AACb,iBAAA,IAAI,yBAAyB,SAAS,CAAC;AAChC,wBAAA,IAAI,uBAAuB,SAAS,CAAC;AAAA,MAAA,OAChD;AACL,iBAAS,CAAA,CAAE;AACX,wBAAgB,IAAI;AAAA,MAAA;AAAA,IACtB,CACD;AAAA,EAAA,GACA,CAAC,KAAK,SAAS,CAAC;AAGb,QAAA,gBAAgB,YAAY,CAAC,OAAiB;AAClD,UAAM,MAAM,YAAY;AACxB,WAAO,MAAM,QAAQ,KAAK,EAAE,IAAI;AAAA,EAClC,GAAG,EAAE;AAGL,YAAU,MAAM;AACd,QAAI,CAAC,IAAK;AACJ,UAAA,OAAO,IAAI,YAAY,SAAS;AACtC,SAAK,KAAK,CAAC,MAAO,YAAY,UAAU,GAAI,MAAM;AAElD,WAAO,MAAM;AACX,WAAK,MAAM;AAAA,QACT,MAAM,aAA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