@embedpdf/svelte 0.0.0-stage → 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/LICENSE +192 -0
- package/README.md +312 -2
- package/dist/actions/readers.svelte.d.ts +29 -0
- package/dist/actions/readers.svelte.js +55 -0
- package/dist/actions.d.ts +13 -0
- package/dist/actions.js +13 -0
- package/dist/anchored/Anchored.svelte +24 -0
- package/dist/anchored/Anchored.svelte.d.ts +4 -0
- package/dist/anchored/PlacedAnchored.svelte +97 -0
- package/dist/anchored/PlacedAnchored.svelte.d.ts +4 -0
- package/dist/anchored/context.d.ts +31 -0
- package/dist/anchored/context.js +36 -0
- package/dist/anchored/props.d.ts +29 -0
- package/dist/anchored/props.js +1 -0
- package/dist/anchored.d.ts +12 -0
- package/dist/anchored.js +2 -0
- package/dist/annotation/AnnotationChrome.svelte +173 -0
- package/dist/annotation/AnnotationChrome.svelte.d.ts +11 -0
- package/dist/annotation/AnnotationDraftMenu.svelte +27 -0
- package/dist/annotation/AnnotationDraftMenu.svelte.d.ts +4 -0
- package/dist/annotation/AnnotationFrame.svelte +46 -0
- package/dist/annotation/AnnotationFrame.svelte.d.ts +15 -0
- package/dist/annotation/AnnotationLayer.svelte +241 -0
- package/dist/annotation/AnnotationLayer.svelte.d.ts +4 -0
- package/dist/annotation/AnnotationLook.svelte +67 -0
- package/dist/annotation/AnnotationLook.svelte.d.ts +21 -0
- package/dist/annotation/AnnotationMenu.svelte +47 -0
- package/dist/annotation/AnnotationMenu.svelte.d.ts +4 -0
- package/dist/annotation/AnnotationRotationBadge.svelte +52 -0
- package/dist/annotation/AnnotationRotationBadge.svelte.d.ts +4 -0
- package/dist/annotation/AnnotationScene.svelte +27 -0
- package/dist/annotation/AnnotationScene.svelte.d.ts +7 -0
- package/dist/annotation/FreeTextBox.svelte +55 -0
- package/dist/annotation/FreeTextBox.svelte.d.ts +9 -0
- package/dist/annotation/NativeDrawing.svelte +61 -0
- package/dist/annotation/NativeDrawing.svelte.d.ts +10 -0
- package/dist/annotation/StampGhost.svelte +79 -0
- package/dist/annotation/StampGhost.svelte.d.ts +7 -0
- package/dist/annotation/chrome-paint.svelte.d.ts +30 -0
- package/dist/annotation/chrome-paint.svelte.js +27 -0
- package/dist/annotation/props.d.ts +181 -0
- package/dist/annotation/props.js +1 -0
- package/dist/annotation/readers.svelte.d.ts +59 -0
- package/dist/annotation/readers.svelte.js +136 -0
- package/dist/annotation/state.d.ts +18 -0
- package/dist/annotation/state.js +20 -0
- package/dist/annotation/text-box.svelte.d.ts +27 -0
- package/dist/annotation/text-box.svelte.js +94 -0
- package/dist/annotation.d.ts +32 -0
- package/dist/annotation.js +31 -0
- package/dist/commands/readers.svelte.d.ts +50 -0
- package/dist/commands/readers.svelte.js +83 -0
- package/dist/commands.d.ts +9 -0
- package/dist/commands.js +9 -0
- package/dist/form/ButtonControl.svelte +38 -0
- package/dist/form/ButtonControl.svelte.d.ts +11 -0
- package/dist/form/ComboControl.svelte +52 -0
- package/dist/form/ComboControl.svelte.d.ts +11 -0
- package/dist/form/FieldPictures.svelte +145 -0
- package/dist/form/FieldPictures.svelte.d.ts +3 -0
- package/dist/form/FormFocusRing.svelte +25 -0
- package/dist/form/FormFocusRing.svelte.d.ts +8 -0
- package/dist/form/FormLayer.svelte +98 -0
- package/dist/form/FormLayer.svelte.d.ts +3 -0
- package/dist/form/ListControl.svelte +49 -0
- package/dist/form/ListControl.svelte.d.ts +11 -0
- package/dist/form/NativeListBox.svelte +57 -0
- package/dist/form/NativeListBox.svelte.d.ts +4 -0
- package/dist/form/SignatureControl.svelte +53 -0
- package/dist/form/SignatureControl.svelte.d.ts +11 -0
- package/dist/form/TextControl.svelte +107 -0
- package/dist/form/TextControl.svelte.d.ts +11 -0
- package/dist/form/ToggleControl.svelte +50 -0
- package/dist/form/ToggleControl.svelte.d.ts +11 -0
- package/dist/form/WidgetBox.svelte +82 -0
- package/dist/form/WidgetBox.svelte.d.ts +15 -0
- package/dist/form/props.d.ts +21 -0
- package/dist/form/props.js +1 -0
- package/dist/form/readers.svelte.d.ts +46 -0
- package/dist/form/readers.svelte.js +52 -0
- package/dist/form/widget.d.ts +16 -0
- package/dist/form/widget.js +20 -0
- package/dist/form.d.ts +11 -0
- package/dist/form.js +12 -0
- package/dist/history/readers.d.ts +22 -0
- package/dist/history/readers.js +21 -0
- package/dist/history.d.ts +10 -0
- package/dist/history.js +11 -0
- package/dist/i18n/readers.svelte.d.ts +32 -0
- package/dist/i18n/readers.svelte.js +30 -0
- package/dist/i18n.d.ts +8 -0
- package/dist/i18n.js +9 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.js +28 -0
- package/dist/interaction/PagePointerSource.svelte +37 -0
- package/dist/interaction/PagePointerSource.svelte.d.ts +3 -0
- package/dist/interaction/readers.svelte.d.ts +26 -0
- package/dist/interaction/readers.svelte.js +47 -0
- package/dist/interaction.d.ts +11 -0
- package/dist/interaction.js +13 -0
- package/dist/link/LinkLayer.svelte +164 -0
- package/dist/link/LinkLayer.svelte.d.ts +4 -0
- package/dist/link/props.d.ts +17 -0
- package/dist/link/props.js +1 -0
- package/dist/link/readers.svelte.d.ts +18 -0
- package/dist/link/readers.svelte.js +38 -0
- package/dist/link.d.ts +11 -0
- package/dist/link.js +11 -0
- package/dist/measurement/readers.d.ts +44 -0
- package/dist/measurement/readers.js +46 -0
- package/dist/measurement.d.ts +12 -0
- package/dist/measurement.js +13 -0
- package/dist/metadata/readers.d.ts +22 -0
- package/dist/metadata/readers.js +22 -0
- package/dist/metadata.d.ts +12 -0
- package/dist/metadata.js +13 -0
- package/dist/page-edit/readers.d.ts +7 -0
- package/dist/page-edit/readers.js +11 -0
- package/dist/page-edit.d.ts +12 -0
- package/dist/page-edit.js +13 -0
- package/dist/page-view/PageView.svelte +192 -0
- package/dist/page-view/PageView.svelte.d.ts +4 -0
- package/dist/page-view/props.d.ts +32 -0
- package/dist/page-view/props.js +1 -0
- package/dist/page-view.d.ts +8 -0
- package/dist/page-view.js +7 -0
- package/dist/redaction/readers.d.ts +37 -0
- package/dist/redaction/readers.js +38 -0
- package/dist/redaction.d.ts +12 -0
- package/dist/redaction.js +13 -0
- package/dist/render/RenderLayer.svelte +116 -0
- package/dist/render/RenderLayer.svelte.d.ts +4 -0
- package/dist/render/TileImage.svelte +65 -0
- package/dist/render/TileImage.svelte.d.ts +11 -0
- package/dist/render/TilePlane.svelte +88 -0
- package/dist/render/TilePlane.svelte.d.ts +7 -0
- package/dist/render/props.d.ts +16 -0
- package/dist/render/props.js +1 -0
- package/dist/render/readers.svelte.d.ts +9 -0
- package/dist/render/readers.svelte.js +13 -0
- package/dist/render.d.ts +10 -0
- package/dist/render.js +10 -0
- package/dist/runtime/DocumentGate.svelte +26 -0
- package/dist/runtime/DocumentGate.svelte.d.ts +4 -0
- package/dist/runtime/DocumentScope.svelte +14 -0
- package/dist/runtime/DocumentScope.svelte.d.ts +4 -0
- package/dist/runtime/KernelProvider.svelte +33 -0
- package/dist/runtime/KernelProvider.svelte.d.ts +4 -0
- package/dist/runtime/SvgShapes.svelte +30 -0
- package/dist/runtime/SvgShapes.svelte.d.ts +8 -0
- package/dist/runtime/Viewer.svelte +124 -0
- package/dist/runtime/Viewer.svelte.d.ts +4 -0
- package/dist/runtime/binding.svelte.d.ts +33 -0
- package/dist/runtime/binding.svelte.js +71 -0
- package/dist/runtime/capability-handle.d.ts +6 -0
- package/dist/runtime/capability-handle.js +71 -0
- package/dist/runtime/dev.d.ts +10 -0
- package/dist/runtime/dev.js +23 -0
- package/dist/runtime/documents.svelte.d.ts +34 -0
- package/dist/runtime/documents.svelte.js +49 -0
- package/dist/runtime/page-layers.svelte.d.ts +20 -0
- package/dist/runtime/page-layers.svelte.js +40 -0
- package/dist/runtime/page.d.ts +10 -0
- package/dist/runtime/page.js +23 -0
- package/dist/runtime/props.d.ts +63 -0
- package/dist/runtime/props.js +1 -0
- package/dist/runtime/readers.svelte.d.ts +47 -0
- package/dist/runtime/readers.svelte.js +122 -0
- package/dist/runtime/state.svelte.d.ts +35 -0
- package/dist/runtime/state.svelte.js +90 -0
- package/dist/runtime/theme.d.ts +12 -0
- package/dist/runtime/theme.js +15 -0
- package/dist/runtime/values.svelte.d.ts +28 -0
- package/dist/runtime/values.svelte.js +51 -0
- package/dist/runtime.d.ts +26 -0
- package/dist/runtime.js +25 -0
- package/dist/search/SearchLayer.svelte +94 -0
- package/dist/search/SearchLayer.svelte.d.ts +4 -0
- package/dist/search/props.d.ts +11 -0
- package/dist/search/props.js +1 -0
- package/dist/search/readers.svelte.d.ts +41 -0
- package/dist/search/readers.svelte.js +40 -0
- package/dist/search.d.ts +11 -0
- package/dist/search.js +11 -0
- package/dist/selection/SelectionClipboard.svelte +35 -0
- package/dist/selection/SelectionClipboard.svelte.d.ts +4 -0
- package/dist/selection/SelectionHandles.svelte +192 -0
- package/dist/selection/SelectionHandles.svelte.d.ts +4 -0
- package/dist/selection/SelectionLayer.svelte +67 -0
- package/dist/selection/SelectionLayer.svelte.d.ts +3 -0
- package/dist/selection/SelectionMenu.svelte +36 -0
- package/dist/selection/SelectionMenu.svelte.d.ts +4 -0
- package/dist/selection/props.d.ts +26 -0
- package/dist/selection/props.js +1 -0
- package/dist/selection/readers.svelte.d.ts +31 -0
- package/dist/selection/readers.svelte.js +26 -0
- package/dist/selection.d.ts +16 -0
- package/dist/selection.js +18 -0
- package/dist/shell/readers.svelte.d.ts +40 -0
- package/dist/shell/readers.svelte.js +40 -0
- package/dist/shell/surface-focus.svelte.d.ts +16 -0
- package/dist/shell/surface-focus.svelte.js +33 -0
- package/dist/shell.d.ts +12 -0
- package/dist/shell.js +11 -0
- package/dist/signature/readers.svelte.d.ts +43 -0
- package/dist/signature/readers.svelte.js +46 -0
- package/dist/signature.d.ts +15 -0
- package/dist/signature.js +16 -0
- package/dist/stage/PageSurface.svelte +126 -0
- package/dist/stage/PageSurface.svelte.d.ts +18 -0
- package/dist/stage/Scrollbar.svelte +148 -0
- package/dist/stage/Scrollbar.svelte.d.ts +4 -0
- package/dist/stage/Stage.svelte +181 -0
- package/dist/stage/Stage.svelte.d.ts +4 -0
- package/dist/stage/StageScope.svelte +14 -0
- package/dist/stage/StageScope.svelte.d.ts +9 -0
- package/dist/stage/props.d.ts +71 -0
- package/dist/stage/props.js +1 -0
- package/dist/stage/readers.svelte.d.ts +39 -0
- package/dist/stage/readers.svelte.js +84 -0
- package/dist/stage/stage-scope.d.ts +18 -0
- package/dist/stage/stage-scope.js +35 -0
- package/dist/stage/two-way.svelte.d.ts +13 -0
- package/dist/stage/two-way.svelte.js +26 -0
- package/dist/stage.d.ts +17 -0
- package/dist/stage.js +15 -0
- package/dist/stamp/readers.svelte.d.ts +50 -0
- package/dist/stamp/readers.svelte.js +76 -0
- package/dist/stamp.d.ts +16 -0
- package/dist/stamp.js +18 -0
- package/dist/toolbar/DefaultCollapsed.svelte +39 -0
- package/dist/toolbar/DefaultCollapsed.svelte.d.ts +9 -0
- package/dist/toolbar/DefaultCommand.svelte +33 -0
- package/dist/toolbar/DefaultCommand.svelte.d.ts +8 -0
- package/dist/toolbar/DefaultGroupTrigger.svelte +39 -0
- package/dist/toolbar/DefaultGroupTrigger.svelte.d.ts +9 -0
- package/dist/toolbar/DefaultOverflowMenu.svelte +106 -0
- package/dist/toolbar/DefaultOverflowMenu.svelte.d.ts +9 -0
- package/dist/toolbar/DefaultOverflowTrigger.svelte +25 -0
- package/dist/toolbar/DefaultOverflowTrigger.svelte.d.ts +7 -0
- package/dist/toolbar/Measured.svelte +46 -0
- package/dist/toolbar/Measured.svelte.d.ts +11 -0
- package/dist/toolbar/NativeSlotSocket.svelte +43 -0
- package/dist/toolbar/NativeSlotSocket.svelte.d.ts +11 -0
- package/dist/toolbar/Toolbar.svelte +314 -0
- package/dist/toolbar/Toolbar.svelte.d.ts +4 -0
- package/dist/toolbar/paint.d.ts +3 -0
- package/dist/toolbar/paint.js +9 -0
- package/dist/toolbar/props.d.ts +48 -0
- package/dist/toolbar/props.js +1 -0
- package/dist/toolbar/strip.svelte.d.ts +14 -0
- package/dist/toolbar/strip.svelte.js +35 -0
- package/dist/toolbar/views.d.ts +14 -0
- package/dist/toolbar/views.js +1 -0
- package/dist/toolbar.d.ts +16 -0
- package/dist/toolbar.js +12 -0
- package/dist/view-manager/readers.d.ts +19 -0
- package/dist/view-manager/readers.js +17 -0
- package/dist/view-manager.d.ts +11 -0
- package/dist/view-manager.js +12 -0
- package/package.json +195 -3
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `useStripView(bar)`: a bar projected through the command registry, live and unmeasured.
|
|
3
|
+
* `<Toolbar>`'s sibling, for a contextual strip (a chrome schema's `strips`) that has no width to
|
|
4
|
+
* fit into.
|
|
5
|
+
*/
|
|
6
|
+
import { normalizeBar, sameStripGroups, stripGroupsOf } from '@embedpdf/core-ui';
|
|
7
|
+
import { CommandsToken } from '@embedpdf/plugin-commands/contract/host';
|
|
8
|
+
import { resolvedCommandsEqual } from '@embedpdf/plugin-commands/contract';
|
|
9
|
+
import { useCapability, useDocumentId, useKernelValue } from '../runtime/readers.svelte.js';
|
|
10
|
+
import { currentOf, derivedValue, valueOf, } from '../runtime/values.svelte.js';
|
|
11
|
+
const sameGroups = (left, right) => sameStripGroups(left, right, resolvedCommandsEqual);
|
|
12
|
+
const NO_GROUPS = Object.freeze([]);
|
|
13
|
+
/**
|
|
14
|
+
* The strip a bar shows now, as `{ current }`: the schema says what could appear, each command's
|
|
15
|
+
* `visible` decides what does. `null` while nothing applies, so `{#if strip.current}` is all the
|
|
16
|
+
* show-and-hide logic a strip needs. `current` changes only when a command in it changes. Pass a
|
|
17
|
+
* function for a bar that changes.
|
|
18
|
+
*/
|
|
19
|
+
export function useStripView(bar) {
|
|
20
|
+
const commands = useCapability(CommandsToken);
|
|
21
|
+
const documentId = useDocumentId();
|
|
22
|
+
const normalized = $derived.by(() => {
|
|
23
|
+
const schema = valueOf(bar);
|
|
24
|
+
return schema ? normalizeBar(schema) : null;
|
|
25
|
+
});
|
|
26
|
+
const groups = useKernelValue(() => normalized
|
|
27
|
+
? stripGroupsOf(normalized, (id) => commands.resolveCommand(id, documentId.current ?? undefined))
|
|
28
|
+
: NO_GROUPS, sameGroups);
|
|
29
|
+
return currentOf(derivedValue(() => groups.current.length === 0
|
|
30
|
+
? null
|
|
31
|
+
: {
|
|
32
|
+
groups: groups.current,
|
|
33
|
+
execute: (id) => void commands.execute(id, { documentId: documentId.current ?? undefined }),
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The views `<Toolbar>`'s snippets receive and the parts it draws: core-ui's (`layoutToolbar`,
|
|
3
|
+
* `groupMenuView`), over the commands plugin's resolved command.
|
|
4
|
+
*/
|
|
5
|
+
import type { CollapsedGroupView as CollapsedGroupViewOf, GroupDisclosureView as GroupDisclosureViewOf, OverflowMenuView as OverflowMenuViewOf, ToolbarPart as ToolbarPartOf } from '@embedpdf/core-ui';
|
|
6
|
+
import type { ResolvedCommand } from '@embedpdf/plugin-commands/contract';
|
|
7
|
+
/** What the `collapsed` snippet draws: a group folded into one control. */
|
|
8
|
+
export type CollapsedGroupView = CollapsedGroupViewOf<ResolvedCommand>;
|
|
9
|
+
/** What the `groupTrigger` snippet draws: the button inside a group that shed some of its items. */
|
|
10
|
+
export type GroupDisclosureView = GroupDisclosureViewOf<ResolvedCommand>;
|
|
11
|
+
/** What the `overflowMenu` snippet draws: the "More" menu. */
|
|
12
|
+
export type OverflowMenuView = OverflowMenuViewOf<ResolvedCommand>;
|
|
13
|
+
/** One thing in the toolbar, as `<Toolbar>` draws it. */
|
|
14
|
+
export type ToolbarPart = ToolbarPartOf<ResolvedCommand>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @embedpdf/svelte/toolbar — a toolbar that fits the room it has.
|
|
3
|
+
*
|
|
4
|
+
* `<Toolbar>` fits a bar of commands into its width, or its height when it's vertical (labels
|
|
5
|
+
* become icons, groups fold, the rest goes into a "More" menu), is one tab stop with arrow keys
|
|
6
|
+
* along it, and lets you draw every part with snippets; `useStripView()` is a strip that doesn't
|
|
7
|
+
* fit itself; and the schema a bar is written in comes from here too.
|
|
8
|
+
*/
|
|
9
|
+
export { DEFAULT_IMPORTANCE, PINNED, custom, group, item } from '@embedpdf/core-ui';
|
|
10
|
+
export type { BarChild, BarGroup, BarItem, BarSchema, BarSections, CustomItem, Importance, OverflowRow, OverflowSection, Variant, } from '@embedpdf/core-ui';
|
|
11
|
+
export { default as Toolbar } from './toolbar/Toolbar.svelte';
|
|
12
|
+
export type { ToolbarProps } from './toolbar/props.js';
|
|
13
|
+
export type { CustomSlotCtx } from '@embedpdf/core-ui';
|
|
14
|
+
export type { CollapsedGroupView, GroupDisclosureView, OverflowMenuView } from './toolbar/views.js';
|
|
15
|
+
export { useStripView } from './toolbar/strip.svelte.js';
|
|
16
|
+
export type { StripView, StripViewGroup } from './toolbar/strip.svelte.js';
|
package/dist/toolbar.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @embedpdf/svelte/toolbar — a toolbar that fits the room it has.
|
|
3
|
+
*
|
|
4
|
+
* `<Toolbar>` fits a bar of commands into its width, or its height when it's vertical (labels
|
|
5
|
+
* become icons, groups fold, the rest goes into a "More" menu), is one tab stop with arrow keys
|
|
6
|
+
* along it, and lets you draw every part with snippets; `useStripView()` is a strip that doesn't
|
|
7
|
+
* fit itself; and the schema a bar is written in comes from here too.
|
|
8
|
+
*/
|
|
9
|
+
// The toolbar's vocabulary: the schema a bar is written in.
|
|
10
|
+
export { DEFAULT_IMPORTANCE, PINNED, custom, group, item } from '@embedpdf/core-ui';
|
|
11
|
+
export { default as Toolbar } from './toolbar/Toolbar.svelte';
|
|
12
|
+
export { useStripView } from './toolbar/strip.svelte.js';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The view manager's readers: the API, the panes as a reactive object, and its events. The view
|
|
3
|
+
* manager is a workspace plugin, so all three work before any document opens.
|
|
4
|
+
*/
|
|
5
|
+
import type { EventHook } from '@embedpdf/core';
|
|
6
|
+
import type { ViewManagerCapability } from '@embedpdf/plugin-view-manager';
|
|
7
|
+
/** The view manager's API (panes and their tabs), for app code. */
|
|
8
|
+
export declare function useViewManager(): ViewManagerCapability;
|
|
9
|
+
/**
|
|
10
|
+
* The panes, in order, and the focused one's id (the page's State table, declared once in
|
|
11
|
+
* `viewManagerState`), as a reactive object: `state.panes`. With a selector, the value it picks as
|
|
12
|
+
* `{ current }`, which changes only when that value does.
|
|
13
|
+
*/
|
|
14
|
+
export declare const useViewManagerState: import("../index.js").StateReader<{
|
|
15
|
+
panes: readonly import("@embedpdf/plugin-view-manager").PaneInfo[];
|
|
16
|
+
focusedPaneId: string | null;
|
|
17
|
+
}>;
|
|
18
|
+
/** Subscribe to one view-manager event while the component lives: `useViewManagerEvent((viewManager) => viewManager.onDocumentMoved, handler)`. */
|
|
19
|
+
export declare function useViewManagerEvent<T>(select: (viewManager: ViewManagerCapability) => EventHook<T>, handler: (event: T) => void): void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ViewManagerToken, viewManagerState } from '@embedpdf/plugin-view-manager';
|
|
2
|
+
import { useCapability, useCapabilityEvent } from '../runtime/readers.svelte.js';
|
|
3
|
+
import { stateReader } from '../runtime/state.svelte.js';
|
|
4
|
+
/** The view manager's API (panes and their tabs), for app code. */
|
|
5
|
+
export function useViewManager() {
|
|
6
|
+
return useCapability(ViewManagerToken);
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The panes, in order, and the focused one's id (the page's State table, declared once in
|
|
10
|
+
* `viewManagerState`), as a reactive object: `state.panes`. With a selector, the value it picks as
|
|
11
|
+
* `{ current }`, which changes only when that value does.
|
|
12
|
+
*/
|
|
13
|
+
export const useViewManagerState = stateReader(viewManagerState);
|
|
14
|
+
/** Subscribe to one view-manager event while the component lives: `useViewManagerEvent((viewManager) => viewManager.onDocumentMoved, handler)`. */
|
|
15
|
+
export function useViewManagerEvent(select, handler) {
|
|
16
|
+
useCapabilityEvent(ViewManagerToken, select, handler);
|
|
17
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @embedpdf/svelte/view-manager — panes, each with its own tabs.
|
|
3
|
+
*
|
|
4
|
+
* It stays headless: it gives you the panes, and you lay them out (split, grid, stacked), draw
|
|
5
|
+
* each pane's tab strip over `pane.documentIds`, and wrap its body in
|
|
6
|
+
* `<DocumentScope id={pane.activeDocumentId}>` so its Stage shows that pane's document. The
|
|
7
|
+
* readers are the plugin's: `useViewManager()` (the API), `useViewManagerState()` and
|
|
8
|
+
* `useViewManagerEvent()`.
|
|
9
|
+
*/
|
|
10
|
+
export * from '@embedpdf/plugin-view-manager';
|
|
11
|
+
export { useViewManager, useViewManagerEvent, useViewManagerState, } from './view-manager/readers.js';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @embedpdf/svelte/view-manager — panes, each with its own tabs.
|
|
3
|
+
*
|
|
4
|
+
* It stays headless: it gives you the panes, and you lay them out (split, grid, stacked), draw
|
|
5
|
+
* each pane's tab strip over `pane.documentIds`, and wrap its body in
|
|
6
|
+
* `<DocumentScope id={pane.activeDocumentId}>` so its Stage shows that pane's document. The
|
|
7
|
+
* readers are the plugin's: `useViewManager()` (the API), `useViewManagerState()` and
|
|
8
|
+
* `useViewManagerEvent()`.
|
|
9
|
+
*/
|
|
10
|
+
// Registration travels with the UI.
|
|
11
|
+
export * from '@embedpdf/plugin-view-manager';
|
|
12
|
+
export { useViewManager, useViewManagerEvent, useViewManagerState, } from './view-manager/readers.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,198 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@embedpdf/svelte",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
3
|
+
"version": "3.0.0-next.15",
|
|
4
|
+
"private": false,
|
|
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
|
+
"type": "module",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"license": "Apache-2.0",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/embedpdf/embed-pdf-viewer.git",
|
|
12
|
+
"directory": "packages/framework/svelte"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist"
|
|
16
|
+
],
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"svelte": "./dist/index.js",
|
|
22
|
+
"default": "./dist/index.js"
|
|
23
|
+
},
|
|
24
|
+
"./actions": {
|
|
25
|
+
"types": "./dist/actions.d.ts",
|
|
26
|
+
"svelte": "./dist/actions.js",
|
|
27
|
+
"default": "./dist/actions.js"
|
|
28
|
+
},
|
|
29
|
+
"./metadata": {
|
|
30
|
+
"types": "./dist/metadata.d.ts",
|
|
31
|
+
"svelte": "./dist/metadata.js",
|
|
32
|
+
"default": "./dist/metadata.js"
|
|
33
|
+
},
|
|
34
|
+
"./history": {
|
|
35
|
+
"types": "./dist/history.d.ts",
|
|
36
|
+
"svelte": "./dist/history.js",
|
|
37
|
+
"default": "./dist/history.js"
|
|
38
|
+
},
|
|
39
|
+
"./page-edit": {
|
|
40
|
+
"types": "./dist/page-edit.d.ts",
|
|
41
|
+
"svelte": "./dist/page-edit.js",
|
|
42
|
+
"default": "./dist/page-edit.js"
|
|
43
|
+
},
|
|
44
|
+
"./view-manager": {
|
|
45
|
+
"types": "./dist/view-manager.d.ts",
|
|
46
|
+
"svelte": "./dist/view-manager.js",
|
|
47
|
+
"default": "./dist/view-manager.js"
|
|
48
|
+
},
|
|
49
|
+
"./link": {
|
|
50
|
+
"types": "./dist/link.d.ts",
|
|
51
|
+
"svelte": "./dist/link.js",
|
|
52
|
+
"default": "./dist/link.js"
|
|
53
|
+
},
|
|
54
|
+
"./page-view": {
|
|
55
|
+
"types": "./dist/page-view.d.ts",
|
|
56
|
+
"svelte": "./dist/page-view.js",
|
|
57
|
+
"default": "./dist/page-view.js"
|
|
58
|
+
},
|
|
59
|
+
"./search": {
|
|
60
|
+
"types": "./dist/search.d.ts",
|
|
61
|
+
"svelte": "./dist/search.js",
|
|
62
|
+
"default": "./dist/search.js"
|
|
63
|
+
},
|
|
64
|
+
"./selection": {
|
|
65
|
+
"types": "./dist/selection.d.ts",
|
|
66
|
+
"svelte": "./dist/selection.js",
|
|
67
|
+
"default": "./dist/selection.js"
|
|
68
|
+
},
|
|
69
|
+
"./anchored": {
|
|
70
|
+
"types": "./dist/anchored.d.ts",
|
|
71
|
+
"svelte": "./dist/anchored.js",
|
|
72
|
+
"default": "./dist/anchored.js"
|
|
73
|
+
},
|
|
74
|
+
"./interaction": {
|
|
75
|
+
"types": "./dist/interaction.d.ts",
|
|
76
|
+
"svelte": "./dist/interaction.js",
|
|
77
|
+
"default": "./dist/interaction.js"
|
|
78
|
+
},
|
|
79
|
+
"./render": {
|
|
80
|
+
"types": "./dist/render.d.ts",
|
|
81
|
+
"svelte": "./dist/render.js",
|
|
82
|
+
"default": "./dist/render.js"
|
|
83
|
+
},
|
|
84
|
+
"./runtime": {
|
|
85
|
+
"types": "./dist/runtime.d.ts",
|
|
86
|
+
"svelte": "./dist/runtime.js",
|
|
87
|
+
"default": "./dist/runtime.js"
|
|
88
|
+
},
|
|
89
|
+
"./stage": {
|
|
90
|
+
"types": "./dist/stage.d.ts",
|
|
91
|
+
"svelte": "./dist/stage.js",
|
|
92
|
+
"default": "./dist/stage.js"
|
|
93
|
+
},
|
|
94
|
+
"./commands": {
|
|
95
|
+
"types": "./dist/commands.d.ts",
|
|
96
|
+
"svelte": "./dist/commands.js",
|
|
97
|
+
"default": "./dist/commands.js"
|
|
98
|
+
},
|
|
99
|
+
"./toolbar": {
|
|
100
|
+
"types": "./dist/toolbar.d.ts",
|
|
101
|
+
"svelte": "./dist/toolbar.js",
|
|
102
|
+
"default": "./dist/toolbar.js"
|
|
103
|
+
},
|
|
104
|
+
"./shell": {
|
|
105
|
+
"types": "./dist/shell.d.ts",
|
|
106
|
+
"svelte": "./dist/shell.js",
|
|
107
|
+
"default": "./dist/shell.js"
|
|
108
|
+
},
|
|
109
|
+
"./i18n": {
|
|
110
|
+
"types": "./dist/i18n.d.ts",
|
|
111
|
+
"svelte": "./dist/i18n.js",
|
|
112
|
+
"default": "./dist/i18n.js"
|
|
113
|
+
},
|
|
114
|
+
"./annotation": {
|
|
115
|
+
"types": "./dist/annotation.d.ts",
|
|
116
|
+
"svelte": "./dist/annotation.js",
|
|
117
|
+
"default": "./dist/annotation.js"
|
|
118
|
+
},
|
|
119
|
+
"./stamp": {
|
|
120
|
+
"types": "./dist/stamp.d.ts",
|
|
121
|
+
"svelte": "./dist/stamp.js",
|
|
122
|
+
"default": "./dist/stamp.js"
|
|
123
|
+
},
|
|
124
|
+
"./measurement": {
|
|
125
|
+
"types": "./dist/measurement.d.ts",
|
|
126
|
+
"svelte": "./dist/measurement.js",
|
|
127
|
+
"default": "./dist/measurement.js"
|
|
128
|
+
},
|
|
129
|
+
"./redaction": {
|
|
130
|
+
"types": "./dist/redaction.d.ts",
|
|
131
|
+
"svelte": "./dist/redaction.js",
|
|
132
|
+
"default": "./dist/redaction.js"
|
|
133
|
+
},
|
|
134
|
+
"./form": {
|
|
135
|
+
"types": "./dist/form.d.ts",
|
|
136
|
+
"svelte": "./dist/form.js",
|
|
137
|
+
"default": "./dist/form.js"
|
|
138
|
+
},
|
|
139
|
+
"./signature": {
|
|
140
|
+
"types": "./dist/signature.d.ts",
|
|
141
|
+
"svelte": "./dist/signature.js",
|
|
142
|
+
"default": "./dist/signature.js"
|
|
143
|
+
},
|
|
144
|
+
"./package.json": "./package.json"
|
|
145
|
+
},
|
|
146
|
+
"dependencies": {
|
|
147
|
+
"esm-env": "^1.2.2",
|
|
148
|
+
"@embedpdf/core": "3.0.0-next.15",
|
|
149
|
+
"@embedpdf/core-geometry": "3.0.0-next.15",
|
|
150
|
+
"@embedpdf/plugin-annotation": "3.0.0-next.15",
|
|
151
|
+
"@embedpdf/plugin-commands": "3.0.0-next.15",
|
|
152
|
+
"@embedpdf/plugin-form": "3.0.0-next.15",
|
|
153
|
+
"@embedpdf/plugin-i18n": "3.0.0-next.15",
|
|
154
|
+
"@embedpdf/core-annotation": "3.0.0-next.15",
|
|
155
|
+
"@embedpdf/plugin-interaction": "3.0.0-next.15",
|
|
156
|
+
"@embedpdf/plugin-metadata": "3.0.0-next.15",
|
|
157
|
+
"@embedpdf/plugin-link": "3.0.0-next.15",
|
|
158
|
+
"@embedpdf/plugin-history": "3.0.0-next.15",
|
|
159
|
+
"@embedpdf/plugin-page-edit": "3.0.0-next.15",
|
|
160
|
+
"@embedpdf/plugin-redaction": "3.0.0-next.15",
|
|
161
|
+
"@embedpdf/plugin-render": "3.0.0-next.15",
|
|
162
|
+
"@embedpdf/plugin-search": "3.0.0-next.15",
|
|
163
|
+
"@embedpdf/plugin-selection": "3.0.0-next.15",
|
|
164
|
+
"@embedpdf/plugin-shell": "3.0.0-next.15",
|
|
165
|
+
"@embedpdf/plugin-stage": "3.0.0-next.15",
|
|
166
|
+
"@embedpdf/plugin-stamp": "3.0.0-next.15",
|
|
167
|
+
"@embedpdf/plugin-signature": "3.0.0-next.15",
|
|
168
|
+
"@embedpdf/core-signature": "3.0.0-next.15",
|
|
169
|
+
"@embedpdf/plugin-view-manager": "3.0.0-next.15",
|
|
170
|
+
"@embedpdf/core-stage": "3.0.0-next.15",
|
|
171
|
+
"@embedpdf/core-ui": "3.0.0-next.15",
|
|
172
|
+
"@embedpdf/web": "3.0.0-next.15",
|
|
173
|
+
"@embedpdf/plugin-actions": "3.0.0-next.15",
|
|
174
|
+
"@embedpdf/plugin-measurement": "3.0.0-next.15"
|
|
175
|
+
},
|
|
176
|
+
"peerDependencies": {
|
|
177
|
+
"svelte": "^5.29.0"
|
|
178
|
+
},
|
|
179
|
+
"devDependencies": {
|
|
180
|
+
"@sveltejs/package": "^2.5.0",
|
|
181
|
+
"@sveltejs/vite-plugin-svelte": "^6.0.0",
|
|
182
|
+
"@testing-library/svelte": "^5.2.0",
|
|
183
|
+
"happy-dom": "^20.11.0",
|
|
184
|
+
"svelte": "^5.39.5",
|
|
185
|
+
"svelte-check": "^4.3.0",
|
|
186
|
+
"typescript": "~5.8.3",
|
|
187
|
+
"vite": "^6.3.5",
|
|
188
|
+
"vitest": "^2.1.9",
|
|
189
|
+
"@embedpdf/tooling-build": "0.0.0",
|
|
190
|
+
"@embedpdf/engine": "3.0.0-next.15"
|
|
191
|
+
},
|
|
192
|
+
"scripts": {
|
|
193
|
+
"build": "svelte-package --input src --output dist && node ../../../tooling/build/src/fully-specify-imports.mjs && node ../../../tooling/build/src/check-framework-package.mjs",
|
|
194
|
+
"clean": "rimraf dist",
|
|
195
|
+
"typecheck": "svelte-check --tsconfig ./tsconfig.json --threshold error",
|
|
196
|
+
"test": "vitest run"
|
|
197
|
+
}
|
|
6
198
|
}
|