@embedpdf/svelte 3.0.0-next.15 → 3.0.0-next.16
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/annotation/FreeTextBox.svelte +27 -31
- package/dist/annotation/text-box.svelte.d.ts +2 -1
- package/dist/annotation/text-box.svelte.js +11 -18
- package/dist/attachment/readers.d.ts +23 -0
- package/dist/attachment/readers.js +21 -0
- package/dist/attachment.d.ts +13 -0
- package/dist/attachment.js +14 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/outline/readers.d.ts +26 -0
- package/dist/outline/readers.js +22 -0
- package/dist/outline.d.ts +12 -0
- package/dist/outline.js +13 -0
- package/dist/page-edit/readers.d.ts +10 -0
- package/dist/page-edit/readers.js +9 -2
- package/dist/page-edit.d.ts +2 -2
- package/dist/page-edit.js +2 -2
- package/dist/runtime/Viewer.svelte +8 -2
- package/package.json +41 -29
|
@@ -7,49 +7,45 @@
|
|
|
7
7
|
-->
|
|
8
8
|
<script lang="ts">
|
|
9
9
|
import type { TextItem } from '@embedpdf/plugin-annotation';
|
|
10
|
-
import {
|
|
10
|
+
import { freeTextBoxOf } from '@embedpdf/web';
|
|
11
11
|
import type { PageContextValue } from '../runtime/page.js';
|
|
12
12
|
import { useChromePaint } from './chrome-paint.svelte.js';
|
|
13
13
|
import { textBoxEditor } from './text-box.svelte.js';
|
|
14
14
|
|
|
15
15
|
let { item, page }: { item: TextItem; page: PageContextValue } = $props();
|
|
16
16
|
|
|
17
|
-
const plate = $derived(textPlateInPixels(item, page.transform));
|
|
18
|
-
const text = $derived(textBoxStyleOf(item.css, plate.scale));
|
|
19
17
|
const paint = useChromePaint();
|
|
18
|
+
// On the engine's text plate (the box inset by its padding), laid out at a legible size.
|
|
19
|
+
const box = $derived(freeTextBoxOf(item, page.transform, paint.css.textOutline));
|
|
20
20
|
const editor = textBoxEditor(
|
|
21
21
|
() => item,
|
|
22
|
-
() =>
|
|
22
|
+
() => box.scale,
|
|
23
23
|
);
|
|
24
24
|
</script>
|
|
25
25
|
|
|
26
|
-
<!-- Fixed to the plate: the box never grows with its text; it scrolls while typing and clips
|
|
27
|
-
otherwise, where the baked appearance clips. Its fill and border are the scene's, under this
|
|
28
|
-
layer. A plain text box turns about its centre, as the baked appearance does. Not typing,
|
|
29
|
-
presses fall through to the shapes (select, move, resize). -->
|
|
30
26
|
<div
|
|
31
27
|
{@attach editor}
|
|
32
|
-
style:position=
|
|
33
|
-
style:left=
|
|
34
|
-
style:top=
|
|
35
|
-
style:width=
|
|
36
|
-
style:height=
|
|
37
|
-
style:font-family={
|
|
38
|
-
style:font-size={
|
|
39
|
-
style:color={
|
|
40
|
-
style:font-weight={
|
|
41
|
-
style:font-style={
|
|
42
|
-
style:text-decoration={
|
|
43
|
-
style:text-align={
|
|
44
|
-
style:box-sizing=
|
|
45
|
-
style:background=
|
|
46
|
-
style:white-space=
|
|
47
|
-
style:overflow-wrap=
|
|
48
|
-
style:overflow-
|
|
49
|
-
style:overflow-
|
|
50
|
-
style:outline={
|
|
51
|
-
style:cursor={
|
|
52
|
-
style:transform={
|
|
53
|
-
style:transform-origin={
|
|
54
|
-
style:pointer-events={
|
|
28
|
+
style:position={box.style.position}
|
|
29
|
+
style:left={box.style.left}
|
|
30
|
+
style:top={box.style.top}
|
|
31
|
+
style:width={box.style.width}
|
|
32
|
+
style:height={box.style.height}
|
|
33
|
+
style:font-family={box.style.fontFamily}
|
|
34
|
+
style:font-size={box.style.fontSize}
|
|
35
|
+
style:color={box.style.color}
|
|
36
|
+
style:font-weight={box.style.fontWeight}
|
|
37
|
+
style:font-style={box.style.fontStyle}
|
|
38
|
+
style:text-decoration={box.style.textDecoration}
|
|
39
|
+
style:text-align={box.style.textAlign}
|
|
40
|
+
style:box-sizing={box.style.boxSizing}
|
|
41
|
+
style:background={box.style.background}
|
|
42
|
+
style:white-space={box.style.whiteSpace}
|
|
43
|
+
style:overflow-wrap={box.style.overflowWrap}
|
|
44
|
+
style:overflow-x={box.style.overflowX}
|
|
45
|
+
style:overflow-y={box.style.overflowY}
|
|
46
|
+
style:outline={box.style.outline}
|
|
47
|
+
style:cursor={box.style.cursor}
|
|
48
|
+
style:transform={box.style.transform}
|
|
49
|
+
style:transform-origin={box.style.transformOrigin}
|
|
50
|
+
style:pointer-events={box.style.pointerEvents}
|
|
55
51
|
></div>
|
|
@@ -22,6 +22,7 @@ export declare function setLookScale(scale: () => number): void;
|
|
|
22
22
|
* ```
|
|
23
23
|
*
|
|
24
24
|
* `attach` goes on your element (render nothing inside it: the editor owns what's in it); `style`
|
|
25
|
-
* and `editing` follow the box.
|
|
25
|
+
* and `editing` follow the box. `style` fills the element's parent at a legible size: draw the
|
|
26
|
+
* box's frame on the parent.
|
|
26
27
|
*/
|
|
27
28
|
export declare function useRichTextEditor(annotation: MaybeGetter<Annotation>): RichTextEditor;
|
|
@@ -7,10 +7,9 @@
|
|
|
7
7
|
* that draws its text box itself.
|
|
8
8
|
*/
|
|
9
9
|
import { getContext, hasContext, setContext, untrack } from 'svelte';
|
|
10
|
-
import { annotationKey } from '@embedpdf/core';
|
|
11
10
|
// Typing reaches the plugin through its host lens (drafts, the text selection).
|
|
12
11
|
import { AnnotationToken as AnnotationHostToken } from '@embedpdf/plugin-annotation/contract/host';
|
|
13
|
-
import { createTextBoxEditorFollower, cssText,
|
|
12
|
+
import { createTextBoxEditorFollower, cssText, ownTextBoxOf, textBoxEditorScaleOf, } from '@embedpdf/web';
|
|
14
13
|
import { usePage } from '../runtime/page.js';
|
|
15
14
|
import { useOptionalCapability, useOptionalSelector } from '../runtime/readers.svelte.js';
|
|
16
15
|
import { valueOf } from '../runtime/values.svelte.js';
|
|
@@ -56,32 +55,26 @@ function lookScaleOf() {
|
|
|
56
55
|
* ```
|
|
57
56
|
*
|
|
58
57
|
* `attach` goes on your element (render nothing inside it: the editor owns what's in it); `style`
|
|
59
|
-
* and `editing` follow the box.
|
|
58
|
+
* and `editing` follow the box. `style` fills the element's parent at a legible size: draw the
|
|
59
|
+
* box's frame on the parent.
|
|
60
60
|
*/
|
|
61
61
|
export function useRichTextEditor(annotation) {
|
|
62
62
|
const page = usePage();
|
|
63
63
|
const lookScale = lookScaleOf();
|
|
64
|
+
// Saved and idle too: your element draws its text, no engine picture does.
|
|
64
65
|
const item = useOptionalSelector(AnnotationHostToken, (host) => {
|
|
65
|
-
const key = annotationKey(valueOf(annotation).ref);
|
|
66
66
|
const { transform } = page;
|
|
67
|
-
return (
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
return host.getTextItem(valueOf(annotation).ref, {
|
|
68
|
+
zoom: transform.zoom,
|
|
69
|
+
rotation: transform.rotation,
|
|
70
|
+
});
|
|
70
71
|
}, null);
|
|
71
72
|
// Pixels per point where the element is: inside a scaled look, at the annotation's 100% size;
|
|
72
73
|
// the look's scale does the rest.
|
|
73
74
|
const scale = $derived(textBoxEditorScaleOf(item.current, page.transform, lookScale()));
|
|
74
|
-
|
|
75
|
-
const style = $derived
|
|
76
|
-
|
|
77
|
-
if (!text)
|
|
78
|
-
return '';
|
|
79
|
-
return cssText({
|
|
80
|
-
...textBoxStyleOf(text.css, scale),
|
|
81
|
-
...(text.editing ? { pointerEvents: 'auto' } : {}),
|
|
82
|
-
});
|
|
83
|
-
});
|
|
84
|
-
const attach = textBoxEditor(() => item.current, () => scale);
|
|
75
|
+
const own = $derived(item.current ? ownTextBoxOf(item.current, scale) : null);
|
|
76
|
+
const style = $derived(own ? cssText(own.style) : '');
|
|
77
|
+
const attach = textBoxEditor(() => item.current, () => own?.scale ?? scale);
|
|
85
78
|
return {
|
|
86
79
|
attach,
|
|
87
80
|
get style() {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** The attachments' readers: the API, the state declared once in `attachmentState`, and its events. */
|
|
2
|
+
import type { EventHook } from '@embedpdf/core';
|
|
3
|
+
import type { AttachmentCapability } from '@embedpdf/plugin-attachment';
|
|
4
|
+
/**
|
|
5
|
+
* The attachment API (add, remove, download, reveal) of the nearest `<DocumentScope>`'s document,
|
|
6
|
+
* else the active one. Outside a ready document, every method throws `not-ready`. `canAdd()` is a
|
|
7
|
+
* read, so `disabled={!attachment.canAdd()}` updates by itself.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useAttachment(): AttachmentCapability;
|
|
10
|
+
/**
|
|
11
|
+
* The files the document carries, the load state, and whether you may add and save files (the
|
|
12
|
+
* page's State table, declared once in `attachmentState`), as a reactive object: `state.files`.
|
|
13
|
+
* With a selector, the value it picks as `{ current }`, which changes only when that value does.
|
|
14
|
+
*/
|
|
15
|
+
export declare const useAttachmentState: import("../index.js").StateReader<{
|
|
16
|
+
files: readonly import("@embedpdf/plugin-attachment").AttachedFile[];
|
|
17
|
+
selected: readonly import("@embedpdf/plugin-attachment").AttachedFile[];
|
|
18
|
+
status: import("@embedpdf/core").ResourceStatus;
|
|
19
|
+
canAdd: boolean;
|
|
20
|
+
canDownload: boolean;
|
|
21
|
+
}>;
|
|
22
|
+
/** Subscribe to one attachment event while the component lives: `useAttachmentEvent((attachment) => attachment.onChanged, handler)`. */
|
|
23
|
+
export declare function useAttachmentEvent<T>(select: (attachment: AttachmentCapability) => EventHook<T>, handler: (event: T) => void): void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { AttachmentToken, attachmentState } from '@embedpdf/plugin-attachment';
|
|
2
|
+
import { useCapability, useCapabilityEvent } from '../runtime/readers.svelte.js';
|
|
3
|
+
import { stateReader } from '../runtime/state.svelte.js';
|
|
4
|
+
/**
|
|
5
|
+
* The attachment API (add, remove, download, reveal) of the nearest `<DocumentScope>`'s document,
|
|
6
|
+
* else the active one. Outside a ready document, every method throws `not-ready`. `canAdd()` is a
|
|
7
|
+
* read, so `disabled={!attachment.canAdd()}` updates by itself.
|
|
8
|
+
*/
|
|
9
|
+
export function useAttachment() {
|
|
10
|
+
return useCapability(AttachmentToken);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The files the document carries, the load state, and whether you may add and save files (the
|
|
14
|
+
* page's State table, declared once in `attachmentState`), as a reactive object: `state.files`.
|
|
15
|
+
* With a selector, the value it picks as `{ current }`, which changes only when that value does.
|
|
16
|
+
*/
|
|
17
|
+
export const useAttachmentState = stateReader(attachmentState);
|
|
18
|
+
/** Subscribe to one attachment event while the component lives: `useAttachmentEvent((attachment) => attachment.onChanged, handler)`. */
|
|
19
|
+
export function useAttachmentEvent(select, handler) {
|
|
20
|
+
useCapabilityEvent(AttachmentToken, select, handler);
|
|
21
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @embedpdf/svelte/attachment — the files a document carries.
|
|
3
|
+
*
|
|
4
|
+
* Reading the state reads the document's attachments; the plugin keeps them live off the
|
|
5
|
+
* document's event stream, lists the pages' files with them, and shows your own adds and removes
|
|
6
|
+
* at once:
|
|
7
|
+
*
|
|
8
|
+
* const attachment = useAttachment();
|
|
9
|
+
* const state = useAttachmentState(); // state.files, state.canAdd
|
|
10
|
+
* const { bytes, name, mimeType } = await attachment.download(file);
|
|
11
|
+
*/
|
|
12
|
+
export * from '@embedpdf/plugin-attachment';
|
|
13
|
+
export { useAttachment, useAttachmentEvent, useAttachmentState } from './attachment/readers.js';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @embedpdf/svelte/attachment — the files a document carries.
|
|
3
|
+
*
|
|
4
|
+
* Reading the state reads the document's attachments; the plugin keeps them live off the
|
|
5
|
+
* document's event stream, lists the pages' files with them, and shows your own adds and removes
|
|
6
|
+
* at once:
|
|
7
|
+
*
|
|
8
|
+
* const attachment = useAttachment();
|
|
9
|
+
* const state = useAttachmentState(); // state.files, state.canAdd
|
|
10
|
+
* const { bytes, name, mimeType } = await attachment.download(file);
|
|
11
|
+
*/
|
|
12
|
+
// Registration travels with the UI.
|
|
13
|
+
export * from '@embedpdf/plugin-attachment';
|
|
14
|
+
export { useAttachment, useAttachmentEvent, useAttachmentState } from './attachment/readers.js';
|
package/dist/index.d.ts
CHANGED
|
@@ -19,6 +19,8 @@ export * from './actions.js';
|
|
|
19
19
|
export * from './view-manager.js';
|
|
20
20
|
export * from './page-edit.js';
|
|
21
21
|
export * from './metadata.js';
|
|
22
|
+
export * from './outline.js';
|
|
23
|
+
export * from './attachment.js';
|
|
22
24
|
export * from './history.js';
|
|
23
25
|
export * from './annotation.js';
|
|
24
26
|
export * from './redaction.js';
|
package/dist/index.js
CHANGED
|
@@ -19,6 +19,8 @@ export * from './actions.js';
|
|
|
19
19
|
export * from './view-manager.js';
|
|
20
20
|
export * from './page-edit.js';
|
|
21
21
|
export * from './metadata.js';
|
|
22
|
+
export * from './outline.js';
|
|
23
|
+
export * from './attachment.js';
|
|
22
24
|
export * from './history.js';
|
|
23
25
|
export * from './annotation.js';
|
|
24
26
|
export * from './redaction.js';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** The outline's readers: the API, the state declared once in `outlineState`, and its events. */
|
|
2
|
+
import type { EventHook } from '@embedpdf/core';
|
|
3
|
+
import type { OutlineCapability } from '@embedpdf/plugin-outline';
|
|
4
|
+
/**
|
|
5
|
+
* The outline API (expand, select, activate, create, update, move, delete) of the nearest
|
|
6
|
+
* `<DocumentScope>`'s document, else the active one. Outside a ready document, every method
|
|
7
|
+
* throws `not-ready`. `canEdit()` is a read, so `disabled={!outline.canEdit()}` updates by itself.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useOutline(): OutlineCapability;
|
|
10
|
+
/**
|
|
11
|
+
* The outline's items, the rows a tree view shows, the item for where the view is reading, the
|
|
12
|
+
* selection, the load state and whether you may edit it (the page's State table, declared once in
|
|
13
|
+
* `outlineState`), as a reactive object: `state.rows`. With a selector, the value it picks as
|
|
14
|
+
* `{ current }`, which changes only when that value does.
|
|
15
|
+
*/
|
|
16
|
+
export declare const useOutlineState: import("../index.js").StateReader<{
|
|
17
|
+
items: readonly import("@embedpdf/plugin-outline").OutlineItem<import("@embedpdf/core").PageDestination>[];
|
|
18
|
+
rows: readonly import("@embedpdf/plugin-outline").OutlineRow[];
|
|
19
|
+
current: import("@embedpdf/plugin-outline").OutlineItemRef | null;
|
|
20
|
+
selected: readonly import("@embedpdf/plugin-outline").OutlineItemRef[];
|
|
21
|
+
status: import("@embedpdf/core").ResourceStatus;
|
|
22
|
+
incomplete: boolean;
|
|
23
|
+
canEdit: boolean;
|
|
24
|
+
}>;
|
|
25
|
+
/** Subscribe to one outline event while the component lives: `useOutlineEvent((outline) => outline.onChanged, handler)`. */
|
|
26
|
+
export declare function useOutlineEvent<T>(select: (outline: OutlineCapability) => EventHook<T>, handler: (event: T) => void): void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { OutlineToken, outlineState } from '@embedpdf/plugin-outline';
|
|
2
|
+
import { useCapability, useCapabilityEvent } from '../runtime/readers.svelte.js';
|
|
3
|
+
import { stateReader } from '../runtime/state.svelte.js';
|
|
4
|
+
/**
|
|
5
|
+
* The outline API (expand, select, activate, create, update, move, delete) of the nearest
|
|
6
|
+
* `<DocumentScope>`'s document, else the active one. Outside a ready document, every method
|
|
7
|
+
* throws `not-ready`. `canEdit()` is a read, so `disabled={!outline.canEdit()}` updates by itself.
|
|
8
|
+
*/
|
|
9
|
+
export function useOutline() {
|
|
10
|
+
return useCapability(OutlineToken);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The outline's items, the rows a tree view shows, the item for where the view is reading, the
|
|
14
|
+
* selection, the load state and whether you may edit it (the page's State table, declared once in
|
|
15
|
+
* `outlineState`), as a reactive object: `state.rows`. With a selector, the value it picks as
|
|
16
|
+
* `{ current }`, which changes only when that value does.
|
|
17
|
+
*/
|
|
18
|
+
export const useOutlineState = stateReader(outlineState);
|
|
19
|
+
/** Subscribe to one outline event while the component lives: `useOutlineEvent((outline) => outline.onChanged, handler)`. */
|
|
20
|
+
export function useOutlineEvent(select, handler) {
|
|
21
|
+
useCapabilityEvent(OutlineToken, select, handler);
|
|
22
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @embedpdf/svelte/outline — the document's outline (its bookmarks).
|
|
3
|
+
*
|
|
4
|
+
* Reading the state reads the outline; the plugin keeps it live off the document's event stream,
|
|
5
|
+
* and shows your own edits at once:
|
|
6
|
+
*
|
|
7
|
+
* const outline = useOutline();
|
|
8
|
+
* const state = useOutlineState(); // state.rows, state.current, state.canEdit
|
|
9
|
+
* outline.activate(row.item.ref); // goes where the item goes, as a click does
|
|
10
|
+
*/
|
|
11
|
+
export * from '@embedpdf/plugin-outline';
|
|
12
|
+
export { useOutline, useOutlineEvent, useOutlineState } from './outline/readers.js';
|
package/dist/outline.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @embedpdf/svelte/outline — the document's outline (its bookmarks).
|
|
3
|
+
*
|
|
4
|
+
* Reading the state reads the outline; the plugin keeps it live off the document's event stream,
|
|
5
|
+
* and shows your own edits at once:
|
|
6
|
+
*
|
|
7
|
+
* const outline = useOutline();
|
|
8
|
+
* const state = useOutlineState(); // state.rows, state.current, state.canEdit
|
|
9
|
+
* outline.activate(row.item.ref); // goes where the item goes, as a click does
|
|
10
|
+
*/
|
|
11
|
+
// Registration travels with the UI.
|
|
12
|
+
export * from '@embedpdf/plugin-outline';
|
|
13
|
+
export { useOutline, useOutlineEvent, useOutlineState } from './outline/readers.js';
|
|
@@ -5,3 +5,13 @@ import type { PageEditCapability } from '@embedpdf/plugin-page-edit';
|
|
|
5
5
|
* `disabled={!pageEdit.canEdit()}` updates by itself.
|
|
6
6
|
*/
|
|
7
7
|
export declare function usePageEdit(): PageEditCapability;
|
|
8
|
+
/**
|
|
9
|
+
* The selected pages and whether you may edit and copy pages (the page's State table, declared
|
|
10
|
+
* once in `pageEditState`), as a reactive object: `state.selected`. With a selector, the value it
|
|
11
|
+
* picks as `{ current }`, which changes only when that value does.
|
|
12
|
+
*/
|
|
13
|
+
export declare const usePageEditState: import("../index.js").StateReader<{
|
|
14
|
+
selected: readonly import("@embedpdf/core").PageRef[];
|
|
15
|
+
canEdit: boolean;
|
|
16
|
+
canExtract: boolean;
|
|
17
|
+
}>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
/** The page edits'
|
|
2
|
-
import { PageEditToken } from '@embedpdf/plugin-page-edit';
|
|
1
|
+
/** The page edits' readers: the API, and the state declared once in `pageEditState`. The pages are the document's. */
|
|
2
|
+
import { PageEditToken, pageEditState } from '@embedpdf/plugin-page-edit';
|
|
3
3
|
import { useCapability } from '../runtime/readers.svelte.js';
|
|
4
|
+
import { stateReader } from '../runtime/state.svelte.js';
|
|
4
5
|
/**
|
|
5
6
|
* The page edits of the nearest `<DocumentScope>`'s document, else the active one. Outside a
|
|
6
7
|
* ready document, every method throws `not-ready`. `canEdit()` and `canExtract()` are reads, so
|
|
@@ -9,3 +10,9 @@ import { useCapability } from '../runtime/readers.svelte.js';
|
|
|
9
10
|
export function usePageEdit() {
|
|
10
11
|
return useCapability(PageEditToken);
|
|
11
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* The selected pages and whether you may edit and copy pages (the page's State table, declared
|
|
15
|
+
* once in `pageEditState`), as a reactive object: `state.selected`. With a selector, the value it
|
|
16
|
+
* picks as `{ current }`, which changes only when that value does.
|
|
17
|
+
*/
|
|
18
|
+
export const usePageEditState = stateReader(pageEditState);
|
package/dist/page-edit.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @embedpdf/svelte/page-edit — rotate, move, insert, delete and extract pages.
|
|
3
3
|
*
|
|
4
|
-
* The plugin turns a page relative to its rotation and resolves
|
|
4
|
+
* The plugin turns a page relative to its rotation and resolves positions, so this is binding
|
|
5
5
|
* only. The pages themselves come from `usePageList()` (`@embedpdf/svelte/runtime`), which
|
|
6
6
|
* follows every edit:
|
|
7
7
|
*
|
|
@@ -9,4 +9,4 @@
|
|
|
9
9
|
* await pageEdit.rotateBy([page.ref], 90);
|
|
10
10
|
*/
|
|
11
11
|
export * from '@embedpdf/plugin-page-edit';
|
|
12
|
-
export { usePageEdit } from './page-edit/readers.js';
|
|
12
|
+
export { usePageEdit, usePageEditState } from './page-edit/readers.js';
|
package/dist/page-edit.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @embedpdf/svelte/page-edit — rotate, move, insert, delete and extract pages.
|
|
3
3
|
*
|
|
4
|
-
* The plugin turns a page relative to its rotation and resolves
|
|
4
|
+
* The plugin turns a page relative to its rotation and resolves positions, so this is binding
|
|
5
5
|
* only. The pages themselves come from `usePageList()` (`@embedpdf/svelte/runtime`), which
|
|
6
6
|
* follows every edit:
|
|
7
7
|
*
|
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
*/
|
|
11
11
|
// Registration travels with the UI.
|
|
12
12
|
export * from '@embedpdf/plugin-page-edit';
|
|
13
|
-
export { usePageEdit } from './page-edit/readers.js';
|
|
13
|
+
export { usePageEdit, usePageEditState } from './page-edit/readers.js';
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
import { untrack } from 'svelte';
|
|
15
15
|
import { createKernel, isLocalEngine, viewerSettingsOf } from '@embedpdf/core';
|
|
16
16
|
import type { Engine, EngineFactory, Kernel, ViewerSettings } from '@embedpdf/core';
|
|
17
|
-
import { browserClock } from '@embedpdf/web';
|
|
17
|
+
import { browserClock, browserPrinter } from '@embedpdf/web';
|
|
18
18
|
import { KernelBinding, setKernelHolder } from './binding.svelte.js';
|
|
19
19
|
import { isDev } from './dev.js';
|
|
20
20
|
import type { ViewerProps } from './props.js';
|
|
@@ -57,7 +57,13 @@
|
|
|
57
57
|
if (isLocalEngine(created)) created.warmup();
|
|
58
58
|
let kernel: Kernel;
|
|
59
59
|
try {
|
|
60
|
-
kernel = createKernel({
|
|
60
|
+
kernel = createKernel({
|
|
61
|
+
engine: created,
|
|
62
|
+
plugins,
|
|
63
|
+
settings,
|
|
64
|
+
clock: browserClock(),
|
|
65
|
+
printer: browserPrinter(),
|
|
66
|
+
});
|
|
61
67
|
} catch (error) {
|
|
62
68
|
// A plugin graph that can't be built shows `error`, not an exception mid-render.
|
|
63
69
|
boot = { phase: 'error', error };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@embedpdf/svelte",
|
|
3
|
-
"version": "3.0.0-next.
|
|
3
|
+
"version": "3.0.0-next.16",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Svelte 5 adapter for EmbedPDF v3: rune-based functions, components with bind: and snippets, headless layers. The whole framework surface, one entry point per feature.",
|
|
6
6
|
"type": "module",
|
|
@@ -31,6 +31,11 @@
|
|
|
31
31
|
"svelte": "./dist/metadata.js",
|
|
32
32
|
"default": "./dist/metadata.js"
|
|
33
33
|
},
|
|
34
|
+
"./outline": {
|
|
35
|
+
"types": "./dist/outline.d.ts",
|
|
36
|
+
"svelte": "./dist/outline.js",
|
|
37
|
+
"default": "./dist/outline.js"
|
|
38
|
+
},
|
|
34
39
|
"./history": {
|
|
35
40
|
"types": "./dist/history.d.ts",
|
|
36
41
|
"svelte": "./dist/history.js",
|
|
@@ -116,6 +121,11 @@
|
|
|
116
121
|
"svelte": "./dist/annotation.js",
|
|
117
122
|
"default": "./dist/annotation.js"
|
|
118
123
|
},
|
|
124
|
+
"./attachment": {
|
|
125
|
+
"types": "./dist/attachment.d.ts",
|
|
126
|
+
"svelte": "./dist/attachment.js",
|
|
127
|
+
"default": "./dist/attachment.js"
|
|
128
|
+
},
|
|
119
129
|
"./stamp": {
|
|
120
130
|
"types": "./dist/stamp.d.ts",
|
|
121
131
|
"svelte": "./dist/stamp.js",
|
|
@@ -145,33 +155,35 @@
|
|
|
145
155
|
},
|
|
146
156
|
"dependencies": {
|
|
147
157
|
"esm-env": "^1.2.2",
|
|
148
|
-
"@embedpdf/core": "3.0.0-next.
|
|
149
|
-
"@embedpdf/core-geometry": "3.0.0-next.
|
|
150
|
-
"@embedpdf/plugin-
|
|
151
|
-
"@embedpdf/plugin-
|
|
152
|
-
"@embedpdf/
|
|
153
|
-
"@embedpdf/plugin-i18n": "3.0.0-next.
|
|
154
|
-
"@embedpdf/
|
|
155
|
-
"@embedpdf/plugin-interaction": "3.0.0-next.
|
|
156
|
-
"@embedpdf/plugin-
|
|
157
|
-
"@embedpdf/plugin-
|
|
158
|
-
"@embedpdf/plugin-
|
|
159
|
-
"@embedpdf/plugin-
|
|
160
|
-
"@embedpdf/plugin-
|
|
161
|
-
"@embedpdf/plugin-
|
|
162
|
-
"@embedpdf/plugin-
|
|
163
|
-
"@embedpdf/plugin-
|
|
164
|
-
"@embedpdf/plugin-
|
|
165
|
-
"@embedpdf/plugin-
|
|
166
|
-
"@embedpdf/plugin-
|
|
167
|
-
"@embedpdf/plugin-signature": "3.0.0-next.
|
|
168
|
-
"@embedpdf/
|
|
169
|
-
"@embedpdf/plugin-
|
|
170
|
-
"@embedpdf/
|
|
171
|
-
"@embedpdf/core-
|
|
172
|
-
"@embedpdf/
|
|
173
|
-
"@embedpdf/
|
|
174
|
-
"@embedpdf/
|
|
158
|
+
"@embedpdf/core-annotation": "3.0.0-next.16",
|
|
159
|
+
"@embedpdf/core-geometry": "3.0.0-next.16",
|
|
160
|
+
"@embedpdf/plugin-commands": "3.0.0-next.16",
|
|
161
|
+
"@embedpdf/plugin-attachment": "3.0.0-next.16",
|
|
162
|
+
"@embedpdf/core": "3.0.0-next.16",
|
|
163
|
+
"@embedpdf/plugin-i18n": "3.0.0-next.16",
|
|
164
|
+
"@embedpdf/plugin-form": "3.0.0-next.16",
|
|
165
|
+
"@embedpdf/plugin-interaction": "3.0.0-next.16",
|
|
166
|
+
"@embedpdf/plugin-link": "3.0.0-next.16",
|
|
167
|
+
"@embedpdf/plugin-annotation": "3.0.0-next.16",
|
|
168
|
+
"@embedpdf/plugin-metadata": "3.0.0-next.16",
|
|
169
|
+
"@embedpdf/plugin-redaction": "3.0.0-next.16",
|
|
170
|
+
"@embedpdf/plugin-page-edit": "3.0.0-next.16",
|
|
171
|
+
"@embedpdf/plugin-history": "3.0.0-next.16",
|
|
172
|
+
"@embedpdf/plugin-render": "3.0.0-next.16",
|
|
173
|
+
"@embedpdf/plugin-search": "3.0.0-next.16",
|
|
174
|
+
"@embedpdf/plugin-outline": "3.0.0-next.16",
|
|
175
|
+
"@embedpdf/plugin-shell": "3.0.0-next.16",
|
|
176
|
+
"@embedpdf/plugin-selection": "3.0.0-next.16",
|
|
177
|
+
"@embedpdf/plugin-signature": "3.0.0-next.16",
|
|
178
|
+
"@embedpdf/plugin-stage": "3.0.0-next.16",
|
|
179
|
+
"@embedpdf/plugin-stamp": "3.0.0-next.16",
|
|
180
|
+
"@embedpdf/plugin-view-manager": "3.0.0-next.16",
|
|
181
|
+
"@embedpdf/core-stage": "3.0.0-next.16",
|
|
182
|
+
"@embedpdf/core-signature": "3.0.0-next.16",
|
|
183
|
+
"@embedpdf/web": "3.0.0-next.16",
|
|
184
|
+
"@embedpdf/core-ui": "3.0.0-next.16",
|
|
185
|
+
"@embedpdf/plugin-actions": "3.0.0-next.16",
|
|
186
|
+
"@embedpdf/plugin-measurement": "3.0.0-next.16"
|
|
175
187
|
},
|
|
176
188
|
"peerDependencies": {
|
|
177
189
|
"svelte": "^5.29.0"
|
|
@@ -187,7 +199,7 @@
|
|
|
187
199
|
"vite": "^6.3.5",
|
|
188
200
|
"vitest": "^2.1.9",
|
|
189
201
|
"@embedpdf/tooling-build": "0.0.0",
|
|
190
|
-
"@embedpdf/engine": "3.0.0-next.
|
|
202
|
+
"@embedpdf/engine": "3.0.0-next.16"
|
|
191
203
|
},
|
|
192
204
|
"scripts": {
|
|
193
205
|
"build": "svelte-package --input src --output dist && node ../../../tooling/build/src/fully-specify-imports.mjs && node ../../../tooling/build/src/check-framework-package.mjs",
|