@mecorelabs/free-pdf-sdk 0.2.2 → 0.2.4

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/NOTICE CHANGED
@@ -8,7 +8,7 @@ Based on pdfcraft
8
8
  Free PDF SDK is based on pdfcraft by the ArtCraft Team and the PdfCraft contributors
9
9
  (https://github.com/storytold/pdfcraft), used as a Cargo dependency pinned to commit
10
10
 
11
- 0dc77fe4ed8810b9e9f25b9dd050afae662c062a (pdfcraft 0.13.0)
11
+ 3109bb2359759e24ef490e1cdbdba00722b20972 (pdfcraft 0.15.0)
12
12
 
13
13
  with Free PDF SDK modifications to pdfcraft's interface crate (pdfcraft-ui-egui): opt-in hooks
14
14
  for white-label branding and for hiding features. The exact modified commit is in Cargo.lock
@@ -19,7 +19,7 @@
19
19
  * @packageDocumentation
20
20
  */
21
21
  /** The SDK version this wrapper belongs to. */
22
- export declare const SDK_VERSION = "0.2.2";
22
+ export declare const SDK_VERSION = "0.2.4";
23
23
  /** The postMessage protocol version this wrapper speaks. */
24
24
  export declare const PROTOCOL_VERSION = 1;
25
25
  /** Every mode, in documentation order. */
@@ -58,13 +58,13 @@ export interface UiOptions {
58
58
  zoomControls?: boolean;
59
59
  /** Page navigation on the rail (default true). */
60
60
  pageNavigation?: boolean;
61
- /** The main menu button (default true). */
61
+ /** The menu bar (default true). */
62
62
  menu?: boolean;
63
63
  /** The "Find tools and commands" box (default true; needs the `palette` feature). */
64
64
  searchBox?: boolean;
65
65
  /** Show (true) or hide (false) right-hand panels; unlisted panels show when their feature is on. */
66
66
  panels?: Partial<Record<PanelName, boolean>>;
67
- /** Panels can't be moved, floated or closed from their tabs (default false). */
67
+ /** Hides the Reset side panels command (panels are docked: they can't be moved or floated anyway) (default false). */
68
68
  lockLayout?: boolean;
69
69
  /** Also list tools that are planned but not available yet (default false). */
70
70
  showPlannedTools?: boolean;
@@ -348,6 +348,6 @@ export declare const FreePdf: {
348
348
  /** See {@link init}. */
349
349
  readonly init: typeof init;
350
350
  /** The wrapper's version. */
351
- readonly version: "0.2.2";
351
+ readonly version: "0.2.4";
352
352
  };
353
353
  export default FreePdf;
@@ -19,7 +19,7 @@
19
19
  * @packageDocumentation
20
20
  */
21
21
  /** The SDK version this wrapper belongs to. */
22
- export const SDK_VERSION = "0.2.2";
22
+ export const SDK_VERSION = "0.2.4";
23
23
  /** The postMessage protocol version this wrapper speaks. */
24
24
  export const PROTOCOL_VERSION = 1;
25
25
  /** Every mode, in documentation order. */
@@ -1 +1 @@
1
- {"version":3,"file":"free-pdf-sdk.js","sourceRoot":"","sources":["../src/free-pdf-sdk.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,+CAA+C;AAC/C,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC;AAEnC,4DAA4D;AAC5D,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAElC,0CAA0C;AAC1C,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,CAAU,CAAC;AAWzG,6CAA6C;AAC7C,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,UAAU;IACV,QAAQ;IACR,QAAQ;IACR,KAAK;IACL,QAAQ;IACR,aAAa;IACb,UAAU;IACV,UAAU;IACV,YAAY;IACZ,mBAAmB;IACnB,gBAAgB;IAChB,OAAO;IACP,WAAW;IACX,aAAa;IACb,SAAS;IACT,WAAW;IACX,eAAe;IACf,WAAW;IACX,YAAY;IACZ,UAAU;IACV,SAAS;IACT,MAAM;IACN,UAAU;IACV,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,MAAM;IACN,cAAc;IACd,MAAM;IACN,SAAS;IACT,aAAa;CACL,CAAC;AAgRX,4DAA4D;AAC5D,MAAM,OAAO,YAAa,SAAQ,KAAK;IAIrC;;;OAGG;I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: an embeddable PDF viewer and annotator for the web, based on pdfcraft.\n *\n * ```ts\n * import { FreePdf } from \"@mecorelabs/free-pdf-sdk\";\n * const viewer = await FreePdf.init(document.getElementById(\"viewer\")!, {\n * baseUrl: \"/free-pdf-sdk/\",\n * mode: \"annotate\",\n * theme: \"system\",\n * document: { url: \"/files/artwork.pdf\" },\n * });\n * viewer.on(\"annotationsChanged\", ({ count }) => console.log(count));\n * ```\n *\n * Each viewer is an iframe on the host's own origin (the SDK folder must be served from the same\n * origin as the page). The wrapper talks to it over a versioned postMessage protocol; see\n * docs/api.md and docs/architecture.md.\n *\n * @packageDocumentation\n */\n\n/** The SDK version this wrapper belongs to. */\nexport const SDK_VERSION = \"0.2.2\";\n\n/** The postMessage protocol version this wrapper speaks. */\nexport const PROTOCOL_VERSION = 1;\n\n/** Every mode, in documentation order. */\nexport const MODES = [\"view\", \"review\", \"annotate\", \"fill\", \"sign\", \"organize\", \"edit\", \"full\"] as const;\n\n/**\n * Viewer mode: a preset of {@link Feature | features}. `view` is read-only; `review` adds notes\n * and text markup; `annotate` every kind of annotation and Fill & Sign; `fill` form filling and\n * Fill & Sign; `sign` adds digital signatures; `organize` pages and bookmarks; `edit` full\n * authoring without security, redaction, digital signatures or JavaScript; `full` everything\n * except JavaScript. Fine-tune any mode with {@link InitOptions.features}.\n */\nexport type Mode = (typeof MODES)[number];\n\n/** Every feature, in documentation order. */\nexport const FEATURES = [\n \"comments\",\n \"markup\",\n \"shapes\",\n \"ink\",\n \"stamps\",\n \"measurement\",\n \"fillSign\",\n \"formFill\",\n \"formDesign\",\n \"digitalSignatures\",\n \"signaturePanel\",\n \"pages\",\n \"bookmarks\",\n \"editContent\",\n \"flatten\",\n \"redaction\",\n \"accessibility\",\n \"standards\",\n \"javascript\",\n \"security\",\n \"history\",\n \"save\",\n \"download\",\n \"export\",\n \"print\",\n \"search\",\n \"copy\",\n \"documentInfo\",\n \"help\",\n \"palette\",\n \"preferences\",\n] as const;\n\n/**\n * Something the viewer can offer. A feature that is off is hidden everywhere in the viewer\n * (menus, toolbars, panels, context menus, shortcuts) and refused if reached anyway. The docs'\n * configuration page describes each one.\n */\nexport type Feature = (typeof FEATURES)[number];\n\n/** Feature switches, applied on top of the mode's features. */\nexport type FeatureFlags = Partial<Record<Feature, boolean>>;\n\n/** Right-hand panels {@link UiOptions.panels} accepts. */\nexport type PanelName = \"comments\" | \"bookmarks\" | \"pages\" | \"fields\" | \"layers\" | \"attachments\" | \"signatures\" | \"accessibility\" | \"tags\" | \"search\";\n\n/** Parts of the viewer's interface to show or hide (unset options keep their current value). */\nexport interface UiOptions {\n /** The Tools panel on the left, listing the tool groups of the enabled features (default true). */\n toolsPanel?: boolean;\n /** A slim rail that brings the Tools panel back once it is closed (default true). */\n toolsRail?: boolean;\n /** The floating tool bar beside the page (default true). */\n quickToolbar?: boolean;\n /** The right-hand rail: panel buttons, page navigation and zoom (default true). */\n rightRail?: boolean;\n /** Zoom and page display controls on the rail (default true). */\n zoomControls?: boolean;\n /** Page navigation on the rail (default true). */\n pageNavigation?: boolean;\n /** The main menu button (default true). */\n menu?: boolean;\n /** The \"Find tools and commands\" box (default true; needs the `palette` feature). */\n searchBox?: boolean;\n /** Show (true) or hide (false) right-hand panels; unlisted panels show when their feature is on. */\n panels?: Partial<Record<PanelName, boolean>>;\n /** Panels can't be moved, floated or closed from their tabs (default false). */\n lockLayout?: boolean;\n /** Also list tools that are planned but not available yet (default false). */\n showPlannedTools?: boolean;\n /** Links to web pages in documents may open, after a prompt (default true). */\n externalLinks?: boolean;\n}\n\n/** The viewer's configuration, as {@link FreePdfViewer.getConfig} reports it. */\nexport interface ViewerConfig {\n /** The mode. */\n mode: Mode;\n /** Every feature, on or off (the mode's preset with your overrides applied). */\n features: Record<Feature, boolean>;\n /** Interface options. */\n ui: Required<Omit<UiOptions, \"panels\">> & { panels: Partial<Record<PanelName, boolean>> };\n /** Hidden elements. */\n disabledElements: ElementId[];\n /** No feature that changes the document is on. */\n readOnly: boolean;\n}\n\n/** Colour theme; `system` follows the browser's preference. */\nexport type Theme = \"light\" | \"dark\" | \"system\";\n\n/** Zoom: a percentage (10–6400) or a fit. */\nexport type Zoom = number | \"fit-width\" | \"fit-page\";\n\n/**\n * Ids accepted by `disabledElements` and {@link FreePdfViewer.setDisabledElements}.\n * docs/api.md lists what each one hides.\n */\nexport type ElementId =\n | \"download\"\n | \"save\"\n | \"print\"\n | \"open\"\n | \"flatten\"\n | \"settings\"\n | \"import\"\n | \"tool:note\"\n | \"tool:freetext\"\n | \"tool:callout\"\n | \"tool:highlight\"\n | \"tool:underline\"\n | \"tool:strikeout\"\n | \"tool:squiggly\"\n | \"tool:caret\"\n | \"tool:replace\"\n | \"tool:ink\"\n | \"tool:line\"\n | \"tool:arrow\"\n | \"tool:square\"\n | \"tool:circle\"\n | \"tool:polygon\"\n | \"tool:polyline\"\n | \"tool:cloud\"\n | \"tool:attach\"\n | \"tool:stamp\"\n | \"tool:image\"\n | \"tool:link\"\n | \"tool:measure\"\n | \"tool:fillsign\"\n | \"tool:signature\";\n\n/** A PDF to open: fetched from a URL, or given as bytes. */\nexport type DocumentSource =\n | {\n /** URL of the PDF (same-origin, or CORS-enabled such as a Firebase Storage download URL). */\n url: string;\n /** File name shown in the viewer; defaults to the URL's last path segment. */\n name?: string;\n /** Options for `fetch` (headers, credentials). */\n fetchInit?: RequestInit;\n }\n | {\n /** The PDF's bytes. They are copied, never detached from the caller. */\n data: ArrayBuffer | Uint8Array | Blob;\n /** File name shown in the viewer; defaults to the Blob's name or `document.pdf`. */\n name?: string;\n };\n\n/**\n * The loading animation shown over the viewer while it starts and while a document opens.\n * Give one of `src` or `svg`; with neither, the built-in spinner is shown.\n */\nexport interface LoaderOptions {\n /** URL of an image: an SVG, GIF, animated WebP or PNG, or a `data:` URL. */\n src?: string;\n /** Inline SVG markup. It is shown as an image, so scripts in it never run. */\n svg?: string;\n /** Width of the image as a CSS length (default `48px`); the height follows its aspect ratio. */\n size?: string;\n /** Background behind it as a CSS colour (default: the viewer's background for the theme). */\n background?: string;\n /** What screen readers announce (default `Loading`). */\n label?: string;\n}\n\n/** A loader: a URL of an image (shorthand for `{ src }`), or {@link LoaderOptions}. */\nexport type Loader = string | LoaderOptions;\n\n/** Options for {@link FreePdf.init}. */\nexport interface InitOptions {\n /** URL of the SDK folder (the one holding `viewer/` and `version.json`), on the page's origin. */\n baseUrl: string;\n /** A document to open once the viewer is ready. */\n document?: DocumentSource;\n /** A preset of features (default `view`, read-only). */\n mode?: Mode;\n /** Turn individual features on or off, on top of the mode's preset. */\n features?: FeatureFlags;\n /** Show or hide parts of the interface. */\n ui?: UiOptions;\n /** Author of new comments; it wins over a name saved in the viewer's settings. */\n author?: string;\n /** Colour theme (default `system`). */\n theme?: Theme;\n /** Password: opens a document that needs one, and lifts owner restrictions (as {@link FreePdfViewer.unlock}). */\n password?: string;\n /** Parts of the interface to hide. */\n disabledElements?: ElementId[];\n /** Interface language, such as `en`, `de` or `zh-Hans` (closest available; English otherwise). */\n locale?: string;\n /**\n * Loading animation shown while the viewer starts and while a document opens (default: a\n * built-in spinner; `false`: none). Read once, when the viewer mounts.\n */\n loader?: Loader | false;\n /** Milliseconds to wait for a reply before rejecting with `TIMEOUT` (default 60000; loads get twice that). */\n timeoutMs?: number;\n /**\n * Listeners attached before the viewer starts, so they also hear events fired while `init`\n * is still running (`ready`, the first `documentLoaded`). `ready` also reaches listeners\n * added later with `on`.\n */\n listeners?: { [K in EventName]?: Listener<K> };\n}\n\n/** What the open document's security allows. */\nexport interface Permissions {\n /** Comments may be added, changed, deleted and imported. */\n canAnnotate: boolean;\n /** The document may be printed. */\n canPrint: boolean;\n /** Text and images may be copied. */\n canCopy: boolean;\n /** The document is encrypted. */\n isEncrypted: boolean;\n /** An owner password would lift restrictions ({@link FreePdfViewer.unlock}). */\n canUnlock: boolean;\n}\n\n/** A reply in a comment thread. */\nexport interface AnnotationReply {\n /** The reply's id (XFDF `name`). */\n id: string;\n /** Author (XFDF `title`). */\n author: string | null;\n /** Text. */\n contents: string | null;\n /** Last modified, ISO 8601. */\n date: string | null;\n}\n\n/** A comment, as {@link FreePdfViewer.getAnnotations} lists it. */\nexport interface Annotation {\n /** The annotation's id (XFDF `name`). */\n id: string;\n /** The PDF subtype in lowercase: `text` (note), `freetext`, `square`, `circle`, `line`, `ink`, `polygon`, `polyline`, `highlight`, `underline`, `squiggly`, `strikeout`, `stamp`, `caret`, `fileattachment`, `sound`, `redact`. */\n type: string;\n /** Author (XFDF `title`). */\n author: string | null;\n /** Subject. */\n subject: string | null;\n /** Text. */\n contents: string | null;\n /** Last modified (else created), ISO 8601. */\n date: string | null;\n /** 0-based page index. */\n pageIndex: number;\n /** Colour, `#RRGGBB`. */\n color: string | null;\n /** Replies, oldest first. */\n replies: AnnotationReply[];\n}\n\n/** A newly opened document. */\nexport interface DocumentInfo {\n /** Number of pages. */\n pageCount: number;\n /** What its security allows. */\n permissions: Permissions;\n}\n\n/** The result of {@link FreePdfViewer.load}. */\nexport interface LoadResult extends DocumentInfo {\n /** The `password` lifted owner restrictions. */\n unlocked: boolean;\n}\n\n/** Versions of the SDK and of pdfcraft. */\nexport interface VersionInfo {\n /** The SDK version (semver). */\n sdk: string;\n /** The pdfcraft commit the viewer was built from. */\n pdfcraftRev: string;\n}\n\n/** Error codes. `TIMEOUT`, `DESTROYED` and `FETCH_FAILED` come from the wrapper; the rest from the viewer. */\nexport type ErrorCode =\n | \"BAD_REQUEST\"\n | \"UNKNOWN_METHOD\"\n | \"UNSUPPORTED_PROTOCOL\"\n | \"NOT_READY\"\n | \"NO_DOCUMENT\"\n | \"LOAD_FAILED\"\n | \"NEEDS_PASSWORD\"\n | \"WRONG_PASSWORD\"\n | \"NOT_PERMITTED\"\n | \"READ_ONLY\"\n | \"XFDF_INVALID\"\n | \"TOO_LARGE\"\n | \"BUSY\"\n | \"INTERNAL\"\n | \"TIMEOUT\"\n | \"DESTROYED\"\n | \"FETCH_FAILED\";\n\n/** An error as data: what events carry. */\nexport interface ErrorInfo {\n /** Machine-readable code. */\n code: ErrorCode;\n /** Human-readable message (English). */\n message: string;\n}\n\n/** Every failure of the SDK: a typed code and a message. */\nexport class FreePdfError extends Error implements ErrorInfo {\n /** Machine-readable code. */\n readonly code: ErrorCode;\n\n /**\n * @param code - Machine-readable code.\n * @param message - Human-readable message.\n */\n constructor(code: ErrorCode, message: string) {\n super(message);\n this.name = \"FreePdfError\";\n this.code = code;\n }\n}\n\n/** Events and the data each one carries. */\nexport interface EventMap {\n /** The viewer is configured and ready for requests. */\n ready: VersionInfo;\n /** A document opened. */\n documentLoaded: DocumentInfo;\n /** A document could not be opened. */\n documentError: ErrorInfo;\n /** Comments were added, changed or removed (by the user or the API). */\n annotationsChanged: { count: number };\n /** The document gained or lost unsaved changes. */\n dirtyChanged: { dirty: boolean };\n /** Something failed outside a request (for example a wrong `password` at load). */\n error: ErrorInfo;\n /** The user pressed Save in the viewer: here is the saved PDF. The viewer treats it as saved. */\n saveRequested: { name: string; saveAs: boolean; data: Uint8Array };\n}\n\n/** An event name. */\nexport type EventName = keyof EventMap;\n\n/** A listener for event `K`. */\nexport type Listener<K extends EventName> = (data: EventMap[K]) => void;\n\n/** A mounted viewer. Every method is async and rejects with {@link FreePdfError}. */\nexport interface FreePdfViewer {\n /** Opens a document, replacing the one shown. */\n load(document: DocumentSource, options?: { password?: string }): Promise<LoadResult>;\n /** Lifts owner restrictions with the owner password; resolves to the new permissions. */\n unlock(password: string): Promise<Permissions>;\n /** What the open document's security allows. */\n getPermissions(): Promise<Permissions>;\n /** Imports comments from standard XFDF; `replace` deletes the existing ones first. Resolves to the number imported. */\n importXfdf(xfdf: string | Blob, options?: { replace?: boolean }): Promise<number>;\n /** The document's comments as XFDF (author in `title`). */\n exportXfdf(): Promise<string>;\n /** The document's comments with their replies; the length is the exact count. */\n getAnnotations(): Promise<Annotation[]>;\n /** Deletes every comment (one undo step per comment); resolves to how many there were. */\n deleteAllAnnotations(): Promise<number>;\n /** Sets the author of new comments. */\n setAuthor(author: string): Promise<void>;\n /** Sets the colour theme. */\n setTheme(theme: Theme): Promise<void>;\n /** Switches mode; your feature overrides still apply on top of it. */\n setMode(mode: Mode): Promise<void>;\n /** Replaces the feature overrides (relative to the mode). Pass `{}` to use the mode's features as they are. */\n setFeatures(features: FeatureFlags): Promise<void>;\n /** Changes interface options; options you leave out keep their value. */\n setUi(ui: UiOptions): Promise<void>;\n /** The resolved configuration: mode, every feature on or off, interface options. */\n getConfig(): Promise<ViewerConfig>;\n /** Hides parts of the interface (replaces the previous list). */\n setDisabledElements(ids: ElementId[]): Promise<void>;\n /** Sets the interface language; resolves to the language used. */\n setLocale(locale: string): Promise<string>;\n /** Number of pages. */\n getPageCount(): Promise<number>;\n /** Shows page `page` (1-based). */\n goToPage(page: number): Promise<void>;\n /** Sets the zoom: a percentage, `fit-width` or `fit-page`. */\n setZoom(zoom: Zoom): Promise<void>;\n /** Whether there are unsaved changes. */\n isDirty(): Promise<boolean>;\n /** The PDF with every change (comments included); the viewer then treats it as saved. */\n save(): Promise<Uint8Array>;\n /** Versions of the SDK and pdfcraft. */\n version(): Promise<VersionInfo>;\n /** Removes the viewer; pending requests reject with `DESTROYED`. Safe to call twice. */\n destroy(): Promise<void>;\n /** Adds a listener. */\n on<K extends EventName>(name: K, listener: Listener<K>): void;\n /** Removes a listener. */\n off<K extends EventName>(name: K, listener: Listener<K>): void;\n /** The iframe holding the viewer. */\n readonly iframe: HTMLIFrameElement;\n}\n\nconst HELLO_TIMEOUT_MS = 30_000;\nconst DEFAULT_TIMEOUT_MS = 60_000;\n\ninterface Pending {\n resolve: (value: unknown) => void;\n reject: (error: FreePdfError) => void;\n timer: ReturnType<typeof setTimeout>;\n}\n\ntype AnyListener = (data: never) => void;\n\nfunction isRecord(v: unknown): v is Record<string, unknown> {\n return typeof v === \"object\" && v !== null;\n}\n\nfunction asErrorInfo(v: unknown): ErrorInfo {\n if (isRecord(v) && typeof v.code === \"string\" && typeof v.message === \"string\") {\n return { code: v.code as ErrorCode, message: v.message };\n }\n return { code: \"INTERNAL\", message: \"malformed error from the viewer\" };\n}\n\n/** A plain copy of interface options (a reactive proxy can't be posted to the iframe). */\nfunction plainUi(ui: UiOptions): Record<string, unknown> {\n const out: Record<string, unknown> = { ...ui };\n if (ui.panels) out.panels = { ...ui.panels };\n return out;\n}\n\nfunction channelId(): string {\n const bytes = new Uint8Array(16);\n crypto.getRandomValues(bytes);\n return Array.from(bytes, (b) => b.toString(16).padStart(2, \"0\")).join(\"\");\n}\n\nfunction nameFromUrl(url: string): string {\n try {\n const last = new URL(url, location.href).pathname.split(\"/\").filter(Boolean).pop();\n return last ? decodeURIComponent(last) : \"document.pdf\";\n } catch {\n return \"document.pdf\";\n }\n}\n\n/** Copies the document's bytes into a fresh ArrayBuffer (safe to transfer). A URL is fetched within `timeoutMs`. */\nasync function readDocument(source: DocumentSource, timeoutMs: number): Promise<{ name: string; bytes: ArrayBuffer }> {\n if (\"url\" in source) {\n const controller = new AbortController();\n const timer = setTimeout(() => controller.abort(), timeoutMs);\n const callerSignal = source.fetchInit?.signal;\n const onAbort = (): void => controller.abort();\n callerSignal?.addEventListener(\"abort\", onAbort, { once: true });\n if (callerSignal?.aborted) controller.abort();\n try {\n const response = await fetch(source.url, { ...source.fetchInit, signal: controller.signal });\n if (!response.ok) throw new FreePdfError(\"FETCH_FAILED\", `could not fetch the document: HTTP ${response.status}`);\n return { name: source.name ?? nameFromUrl(source.url), bytes: await response.arrayBuffer() };\n } catch (e) {\n if (e instanceof FreePdfError) throw e;\n const why = controller.signal.aborted && !callerSignal?.aborted ? `no response in ${timeoutMs} ms` : String(e);\n throw new FreePdfError(\"FETCH_FAILED\", `could not fetch the document: ${why}`);\n } finally {\n clearTimeout(timer);\n callerSignal?.removeEventListener(\"abort\", onAbort);\n }\n }\n const data = source.data;\n if (data instanceof Blob) {\n const fileName = typeof File !== \"undefined\" && data instanceof File ? data.name : undefined;\n return { name: source.name ?? fileName ?? \"document.pdf\", bytes: await data.arrayBuffer() };\n }\n if (data instanceof ArrayBuffer) return { name: source.name ?? \"document.pdf\", bytes: data.slice(0) };\n if (data instanceof Uint8Array) {\n const copy = new Uint8Array(data.byteLength);\n copy.set(data);\n return { name: source.name ?? \"document.pdf\", bytes: copy.buffer };\n }\n throw new FreePdfError(\"BAD_REQUEST\", \"document needs a url or data (ArrayBuffer, Uint8Array or Blob)\");\n}\n\n/** The built-in loader: a ring that turns (slower when the user asks for reduced motion). */\nconst DEFAULT_LOADER_SVG =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 0 48 48\"><style>' +\n \"circle{fill:none;stroke-width:4;stroke-linecap:round}.t{stroke:rgba(128,128,136,.25)}\" +\n \".a{stroke:rgb(128,128,136);stroke-dasharray:30 200;transform-origin:24px 24px;animation:s .9s linear infinite}\" +\n \"@keyframes s{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.a{animation-duration:3s}}\" +\n '</style><circle class=\"t\" cx=\"24\" cy=\"24\" r=\"18\"/><circle class=\"a\" cx=\"24\" cy=\"24\" r=\"18\"/></svg>';\n\n/** Inline SVG markup is at most this long. */\nconst MAX_LOADER_SVG = 1024 * 1024;\n\n/** The loader as a plain, checked description (throws `BAD_REQUEST`), or `null` for none. */\nfunction loaderOptions(loader: Loader | false | undefined): LoaderOptions | null {\n if (loader === false) return null;\n if (loader === undefined) return { svg: DEFAULT_LOADER_SVG };\n if (typeof loader === \"string\") return { src: loader };\n if (!isRecord(loader)) throw new FreePdfError(\"BAD_REQUEST\", \"loader must be a URL, an object or false\");\n const out: LoaderOptions = {};\n for (const key of [\"src\", \"svg\", \"size\", \"background\", \"label\"] as const) {\n const v = loader[key];\n if (v === undefined) continue;\n if (typeof v !== \"string\") throw new FreePdfError(\"BAD_REQUEST\", `loader.${key} must be a string`);\n out[key] = v;\n }\n if (out.svg !== undefined && out.svg.length > MAX_LOADER_SVG) throw new FreePdfError(\"TOO_LARGE\", \"loader.svg is over 1 MiB\");\n if (out.src === undefined && out.svg === undefined) out.svg = DEFAULT_LOADER_SVG;\n return out;\n}\n\n/** The viewer's own background before it paints, so the loader matches it. */\nfunction themeBackground(theme: Theme): string {\n const dark = theme === \"dark\" || (theme === \"system\" && typeof matchMedia === \"function\" && matchMedia(\"(prefers-color-scheme: dark)\").matches);\n return dark ? \"#19191c\" : \"#f1f1f3\";\n}\n\n/** Builds the loader overlay (visible). */\nfunction loaderElement(options: LoaderOptions, theme: Theme): HTMLDivElement {\n const overlay = document.createElement(\"div\");\n overlay.setAttribute(\"role\", \"status\");\n overlay.dataset.fpsLoader = \"\";\n overlay.style.cssText = \"position:absolute;inset:0;display:flex;align-items:center;justify-content:center;transition:opacity .2s ease;\";\n overlay.style.background = options.background ?? themeBackground(theme);\n const img = document.createElement(\"img\");\n // An <img>: an SVG shown this way can't run scripts or load other resources.\n img.src = options.src ?? `data:image/svg+xml;charset=utf-8,${encodeURIComponent(options.svg ?? DEFAULT_LOADER_SVG)}`;\n img.alt = options.label ?? \"Loading\";\n img.decoding = \"async\";\n img.style.cssText = \"display:block;height:auto;max-width:80%;max-height:80%;\";\n img.style.width = options.size ?? \"48px\";\n overlay.appendChild(img);\n return overlay;\n}\n\nclass Viewer implements FreePdfViewer {\n readonly iframe: HTMLIFrameElement;\n /** Holds the iframe and the loader; what the viewer adds to the host's element. */\n private readonly root: HTMLDivElement;\n private readonly loader: HTMLDivElement | null;\n /** Work the loader is shown for (starting counts as one). */\n private busy = 1;\n private readonly origin: string;\n private readonly channel = channelId();\n private readonly pending = new Map<number, Pending>();\n private readonly listeners = new Map<EventName, Set<AnyListener>>();\n private readonly timeoutMs: number;\n private nextId = 1;\n private destroyed = false;\n private hello: { resolve: (info: VersionInfo) => void; reject: (e: FreePdfError) => void } | null = null;\n private readyInfo: VersionInfo | null = null;\n private readonly onMessage = (event: MessageEvent): void => this.receive(event);\n\n constructor(element: HTMLElement, baseUrl: URL, timeoutMs: number, loader: LoaderOptions | null, theme: Theme) {\n this.origin = baseUrl.origin;\n this.timeoutMs = timeoutMs;\n this.root = document.createElement(\"div\");\n this.root.style.cssText = \"position:relative;width:100%;height:100%;\";\n this.iframe = document.createElement(\"iframe\");\n this.iframe.src = new URL(`viewer/index.html#ch=${this.channel}`, baseUrl).href;\n this.iframe.title = \"PDF viewer\";\n this.iframe.setAttribute(\"allow\", \"clipboard-read; clipboard-write; fullscreen\");\n this.iframe.style.cssText = \"display:block;width:100%;height:100%;border:0;\";\n this.root.appendChild(this.iframe);\n this.loader = loader ? loaderElement(loader, theme) : null;\n if (this.loader) this.root.appendChild(this.loader);\n window.addEventListener(\"message\", this.onMessage);\n element.appendChild(this.root);\n }\n\n /** Shows the loader for a piece of work; pair with {@link idle}. */\n busyStart(): void {\n this.busy++;\n if (this.loader) {\n this.loader.hidden = false;\n this.loader.style.opacity = \"1\";\n this.loader.style.pointerEvents = \"\";\n }\n }\n\n /** Ends a piece of work; the loader fades out when none is left. */\n idle(): void {\n this.busy = Math.max(0, this.busy - 1);\n const loader = this.loader;\n if (!loader || this.busy > 0) return;\n // Clicks reach the viewer at once, not only when the fade is over.\n loader.style.opacity = \"0\";\n loader.style.pointerEvents = \"none\";\n setTimeout(() => {\n if (this.busy === 0) loader.hidden = true;\n }, 200);\n }\n\n /** Waits for the viewer's hello. */\n started(): Promise<VersionInfo> {\n return new Promise<VersionInfo>((resolve, reject) => {\n const timer = setTimeout(() => {\n this.hello = null;\n reject(new FreePdfError(\"TIMEOUT\", \"the viewer did not start (is baseUrl right, and WebGL available?)\"));\n }, HELLO_TIMEOUT_MS);\n this.hello = {\n resolve: (info) => {\n clearTimeout(timer);\n resolve(info);\n },\n reject: (e) => {\n clearTimeout(timer);\n reject(e);\n },\n };\n });\n }\n\n private receive(event: MessageEvent): void {\n if (event.origin !== this.origin || event.source !== this.iframe.contentWindow) return;\n const msg: unknown = event.data;\n if (!isRecord(msg) || msg.ch !== this.channel) return;\n if (msg.fps !== PROTOCOL_VERSION) {\n // Another protocol version: fail what is waiting for it now, not after a timeout.\n const err = new FreePdfError(\"UNSUPPORTED_PROTOCOL\", `the viewer speaks protocol ${String(msg.fps)}; this wrapper speaks ${PROTOCOL_VERSION}`);\n if (msg.kind === \"hello\" && this.hello) {\n this.hello.reject(err);\n this.hello = null;\n return;\n }\n const p = msg.kind === \"res\" && typeof msg.id === \"number\" ? this.pending.get(msg.id) : undefined;\n if (p && typeof msg.id === \"number\") {\n this.pending.delete(msg.id);\n clearTimeout(p.timer);\n p.reject(err);\n return;\n }\n this.emit(\"error\", { code: err.code, message: err.message });\n return;\n }\n switch (msg.kind) {\n case \"hello\": {\n const info = isRecord(msg.info) ? msg.info : {};\n const version: VersionInfo = { sdk: String(info.sdk ?? \"\"), pdfcraftRev: String(info.pdfcraftRev ?? \"\") };\n if (version.sdk !== SDK_VERSION) {\n console.warn(`Free PDF SDK: the wrapper is ${SDK_VERSION} but the viewer is ${version.sdk}; serve matching files`);\n }\n this.hello?.resolve(version);\n this.hello = null;\n return;\n }\n case \"res\": {\n if (typeof msg.id !== \"number\") return;\n const p = this.pending.get(msg.id);\n if (!p) return;\n this.pending.delete(msg.id);\n clearTimeout(p.timer);\n if (msg.ok === true) p.resolve(msg.result);\n else {\n const e = asErrorInfo(msg.error);\n p.reject(new FreePdfError(e.code, e.message));\n }\n return;\n }\n case \"evt\": {\n if (typeof msg.name !== \"string\") return;\n if (msg.name === \"error\" && this.hello) {\n const e = asErrorInfo(msg.data);\n this.hello.reject(new FreePdfError(e.code, e.message));\n this.hello = null;\n return;\n }\n if (msg.name === \"documentError\" || msg.name === \"error\") {\n this.emit(msg.name, asErrorInfo(msg.data));\n } else if (this.listeners.has(msg.name as EventName)) {\n this.emit(msg.name as EventName, msg.data as never);\n }\n return;\n }\n default:\n return;\n }\n }\n\n emit<K extends EventName>(name: K, data: EventMap[K]): void {\n if (name === \"ready\") this.readyInfo = data as VersionInfo;\n for (const listener of [...(this.listeners.get(name) ?? [])]) {\n try {\n (listener as Listener<K>)(data);\n } catch (e) {\n console.error(`Free PDF SDK: a ${name} listener threw`, e);\n }\n }\n }\n\n request<T>(method: string, params?: Record<string, unknown>, transfer: Transferable[] = [], timeoutMs = this.timeoutMs): Promise<T> {\n if (this.destroyed) return Promise.reject(new FreePdfError(\"DESTROYED\", \"the viewer was destroyed\"));\n const contentWindow = this.iframe.contentWindow;\n if (!contentWindow) return Promise.reject(new FreePdfError(\"NOT_READY\", \"the viewer is not attached to the page\"));\n const id = this.nextId;\n this.nextId = this.nextId >= 0x7fffffff ? 1 : this.nextId + 1;\n return new Promise<T>((resolve, reject) => {\n const timer = setTimeout(() => {\n this.pending.delete(id);\n reject(new FreePdfError(\"TIMEOUT\", `${method} got no reply in ${timeoutMs} ms`));\n }, timeoutMs);\n this.pending.set(id, { resolve: resolve as (v: unknown) => void, reject, timer });\n // The viewer drops the request once the deadline has passed, so a request that timed out\n // here never takes effect later (frames stall in background tabs).\n const deadline = Date.now() + timeoutMs;\n try {\n contentWindow.postMessage({ fps: PROTOCOL_VERSION, ch: this.channel, kind: \"req\", id, method, params: params ?? {}, deadline }, this.origin, transfer);\n } catch (e) {\n clearTimeout(timer);\n this.pending.delete(id);\n reject(new FreePdfError(\"BAD_REQUEST\", `${method} could not be sent: ${e instanceof Error ? e.message : String(e)}`));\n }\n });\n }\n\n async load(source: DocumentSource, options?: { password?: string }): Promise<LoadResult> {\n if (this.destroyed) throw new FreePdfError(\"DESTROYED\", \"the viewer was destroyed\");\n this.busyStart();\n try {\n let doc: { name: string; bytes: ArrayBuffer };\n try {\n doc = await readDocument(source, this.timeoutMs * 2);\n } catch (e) {\n // The viewer reports its own load failures; a fetch that failed never reached it.\n const err = e instanceof FreePdfError ? e : new FreePdfError(\"FETCH_FAILED\", String(e));\n this.emit(\"documentError\", { code: err.code, message: err.message });\n throw err;\n }\n const { name, bytes } = doc;\n const params: Record<string, unknown> = { name, data: bytes };\n if (options?.password !== undefined) params.password = options.password;\n return await this.request<LoadResult>(\"load\", params, [bytes], this.timeoutMs * 2);\n } finally {\n this.idle();\n }\n }\n\n async unlock(password: string): Promise<Permissions> {\n const r = await this.request<{ permissions: Permissions }>(\"unlock\", { password });\n return r.permissions;\n }\n\n getPermissions(): Promise<Permissions> {\n return this.request<Permissions>(\"getPermissions\");\n }\n\n async importXfdf(xfdf: string | Blob, options?: { replace?: boolean }): Promise<number> {\n const text = typeof xfdf === \"string\" ? xfdf : await xfdf.text();\n return this.request<number>(\"importXfdf\", { xfdf: text, replace: options?.replace ?? false });\n }\n\n exportXfdf(): Promise<string> {\n return this.request<string>(\"exportXfdf\");\n }\n\n getAnnotations(): Promise<Annotation[]> {\n return this.request<Annotation[]>(\"getAnnotations\");\n }\n\n deleteAllAnnotations(): Promise<number> {\n return this.request<number>(\"deleteAllAnnotations\");\n }\n\n async setAuthor(author: string): Promise<void> {\n await this.request(\"setAuthor\", { author });\n }\n\n async setTheme(theme: Theme): Promise<void> {\n await this.request(\"setTheme\", { theme });\n }\n\n async setMode(mode: Mode): Promise<void> {\n await this.request(\"setMode\", { mode });\n }\n\n async setFeatures(features: FeatureFlags): Promise<void> {\n await this.request(\"setFeatures\", { features: { ...features } });\n }\n\n async setUi(ui: UiOptions): Promise<void> {\n await this.request(\"setUi\", { ui: plainUi(ui) });\n }\n\n getConfig(): Promise<ViewerConfig> {\n return this.request<ViewerConfig>(\"getConfig\");\n }\n\n async setDisabledElements(ids: ElementId[]): Promise<void> {\n await this.request(\"setDisabledElements\", { ids: [...ids] });\n }\n\n async setLocale(locale: string): Promise<string> {\n const r = await this.request<{ locale: string }>(\"setLocale\", { locale });\n return r.locale;\n }\n\n getPageCount(): Promise<number> {\n return this.request<number>(\"getPageCount\");\n }\n\n async goToPage(page: number): Promise<void> {\n await this.request(\"goToPage\", { page });\n }\n\n async setZoom(zoom: Zoom): Promise<void> {\n await this.request(\"setZoom\", { zoom });\n }\n\n isDirty(): Promise<boolean> {\n return this.request<boolean>(\"isDirty\");\n }\n\n async save(): Promise<Uint8Array> {\n return this.request<Uint8Array>(\"save\", undefined, [], this.timeoutMs * 2);\n }\n\n version(): Promise<VersionInfo> {\n return this.request<VersionInfo>(\"version\");\n }\n\n async destroy(): Promise<void> {\n if (this.destroyed) return;\n this.destroyed = true;\n window.removeEventListener(\"message\", this.onMessage);\n const error = new FreePdfError(\"DESTROYED\", \"the viewer was destroyed\");\n for (const p of this.pending.values()) {\n clearTimeout(p.timer);\n p.reject(error);\n }\n this.pending.clear();\n this.hello?.reject(error);\n this.hello = null;\n this.listeners.clear();\n this.root.remove();\n }\n\n on<K extends EventName>(name: K, listener: Listener<K>): void {\n let set = this.listeners.get(name);\n if (!set) {\n set = new Set();\n this.listeners.set(name, set);\n }\n set.add(listener as AnyListener);\n if (name === \"ready\" && this.readyInfo) {\n const info = this.readyInfo;\n queueMicrotask(() => {\n if (this.listeners.get(name)?.has(listener as AnyListener)) (listener as Listener<\"ready\">)(info);\n });\n }\n }\n\n off<K extends EventName>(name: K, listener: Listener<K>): void {\n this.listeners.get(name)?.delete(listener as AnyListener);\n }\n}\n\n/**\n * Mounts a viewer in `element` (which it fills) and resolves once it is ready and, if\n * `options.document` is given, once that document is open. Rejects with {@link FreePdfError}\n * (and removes the iframe) when the viewer cannot start or the document cannot be opened.\n *\n * @param element - The element to mount the viewer in; give it a size.\n * @param options - Where the SDK is hosted, and how the viewer starts.\n */\nexport async function init(element: HTMLElement, options: InitOptions): Promise<FreePdfViewer> {\n if (!(element instanceof HTMLElement)) throw new FreePdfError(\"BAD_REQUEST\", \"init needs an element to mount the viewer in\");\n if (!options || typeof options.baseUrl !== \"string\") throw new FreePdfError(\"BAD_REQUEST\", \"init needs options.baseUrl\");\n const base = new URL(options.baseUrl.endsWith(\"/\") ? options.baseUrl : `${options.baseUrl}/`, document.baseURI);\n if (base.origin !== location.origin) {\n throw new FreePdfError(\"BAD_REQUEST\", `the SDK must be served from this page's origin (${location.origin}), not ${base.origin}`);\n }\n const theme = options.theme ?? \"system\";\n const viewer = new Viewer(element, base, options.timeoutMs ?? DEFAULT_TIMEOUT_MS, loaderOptions(options.loader), theme);\n for (const [name, listener] of Object.entries(options.listeners ?? {})) {\n if (typeof listener === \"function\") viewer.on(name as EventName, listener as Listener<EventName>);\n }\n try {\n const info = await viewer.started();\n // Plain copies: a reactive proxy (Vue) can't be posted to the iframe.\n const config: Record<string, unknown> = {\n mode: options.mode ?? \"view\",\n theme,\n disabledElements: [...(options.disabledElements ?? [])],\n };\n if (options.features !== undefined) config.features = { ...options.features };\n if (options.ui !== undefined) config.ui = plainUi(options.ui);\n if (options.author !== undefined) config.author = options.author;\n if (options.locale !== undefined) config.locale = options.locale;\n await viewer.request(\"configure\", config);\n viewer.emit(\"ready\", info);\n if (options.document) {\n await viewer.load(options.document, options.password === undefined ? undefined : { password: options.password });\n }\n viewer.idle();\n return viewer;\n } catch (e) {\n await viewer.destroy();\n throw e instanceof FreePdfError ? e : new FreePdfError(\"INTERNAL\", String(e));\n }\n}\n\n/** The SDK entry point. */\nexport const FreePdf = {\n /** See {@link init}. */\n init,\n /** The wrapper's version. */\n version: SDK_VERSION,\n} as const;\n\nexport default FreePdf;\n"]}
1
+ {"version":3,"file":"free-pdf-sdk.js","sourceRoot":"","sources":["../src/free-pdf-sdk.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,+CAA+C;AAC/C,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC;AAEnC,4DAA4D;AAC5D,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAElC,0CAA0C;AAC1C,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,CAAU,CAAC;AAWzG,6CAA6C;AAC7C,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,UAAU;IACV,QAAQ;IACR,QAAQ;IACR,KAAK;IACL,QAAQ;IACR,aAAa;IACb,UAAU;IACV,UAAU;IACV,YAAY;IACZ,mBAA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YAAY,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAChF,CAAC;AACH,CAAC;AAED,2BAA2B;AAC3B,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,wBAAwB;IACxB,IAAI;IACJ,6BAA6B;IAC7B,OAAO,EAAE,WAAW;CACZ,CAAC;AAEX,eAAe,OAAO,CAAC","sourcesContent":["/**\n * Free PDF SDK: an embeddable PDF viewer and annotator for the web, based on pdfcraft.\n *\n * ```ts\n * import { FreePdf } from \"@mecorelabs/free-pdf-sdk\";\n * const viewer = await FreePdf.init(document.getElementById(\"viewer\")!, {\n * baseUrl: \"/free-pdf-sdk/\",\n * mode: \"annotate\",\n * theme: \"system\",\n * document: { url: \"/files/artwork.pdf\" },\n * });\n * viewer.on(\"annotationsChanged\", ({ count }) => console.log(count));\n * ```\n *\n * Each viewer is an iframe on the host's own origin (the SDK folder must be served from the same\n * origin as the page). The wrapper talks to it over a versioned postMessage protocol; see\n * docs/api.md and docs/architecture.md.\n *\n * @packageDocumentation\n */\n\n/** The SDK version this wrapper belongs to. */\nexport const SDK_VERSION = \"0.2.4\";\n\n/** The postMessage protocol version this wrapper speaks. */\nexport const PROTOCOL_VERSION = 1;\n\n/** Every mode, in documentation order. */\nexport const MODES = [\"view\", \"review\", \"annotate\", \"fill\", \"sign\", \"organize\", \"edit\", \"full\"] as const;\n\n/**\n * Viewer mode: a preset of {@link Feature | features}. `view` is read-only; `review` adds notes\n * and text markup; `annotate` every kind of annotation and Fill & Sign; `fill` form filling and\n * Fill & Sign; `sign` adds digital signatures; `organize` pages and bookmarks; `edit` full\n * authoring without security, redaction, digital signatures or JavaScript; `full` everything\n * except JavaScript. Fine-tune any mode with {@link InitOptions.features}.\n */\nexport type Mode = (typeof MODES)[number];\n\n/** Every feature, in documentation order. */\nexport const FEATURES = [\n \"comments\",\n \"markup\",\n \"shapes\",\n \"ink\",\n \"stamps\",\n \"measurement\",\n \"fillSign\",\n \"formFill\",\n \"formDesign\",\n \"digitalSignatures\",\n \"signaturePanel\",\n \"pages\",\n \"bookmarks\",\n \"editContent\",\n \"flatten\",\n \"redaction\",\n \"accessibility\",\n \"standards\",\n \"javascript\",\n \"security\",\n \"history\",\n \"save\",\n \"download\",\n \"export\",\n \"print\",\n \"search\",\n \"copy\",\n \"documentInfo\",\n \"help\",\n \"palette\",\n \"preferences\",\n] as const;\n\n/**\n * Something the viewer can offer. A feature that is off is hidden everywhere in the viewer\n * (menus, toolbars, panels, context menus, shortcuts) and refused if reached anyway. The docs'\n * configuration page describes each one.\n */\nexport type Feature = (typeof FEATURES)[number];\n\n/** Feature switches, applied on top of the mode's features. */\nexport type FeatureFlags = Partial<Record<Feature, boolean>>;\n\n/** Right-hand panels {@link UiOptions.panels} accepts. */\nexport type PanelName = \"comments\" | \"bookmarks\" | \"pages\" | \"fields\" | \"layers\" | \"attachments\" | \"signatures\" | \"accessibility\" | \"tags\" | \"search\";\n\n/** Parts of the viewer's interface to show or hide (unset options keep their current value). */\nexport interface UiOptions {\n /** The Tools panel on the left, listing the tool groups of the enabled features (default true). */\n toolsPanel?: boolean;\n /** A slim rail that brings the Tools panel back once it is closed (default true). */\n toolsRail?: boolean;\n /** The floating tool bar beside the page (default true). */\n quickToolbar?: boolean;\n /** The right-hand rail: panel buttons, page navigation and zoom (default true). */\n rightRail?: boolean;\n /** Zoom and page display controls on the rail (default true). */\n zoomControls?: boolean;\n /** Page navigation on the rail (default true). */\n pageNavigation?: boolean;\n /** The menu bar (default true). */\n menu?: boolean;\n /** The \"Find tools and commands\" box (default true; needs the `palette` feature). */\n searchBox?: boolean;\n /** Show (true) or hide (false) right-hand panels; unlisted panels show when their feature is on. */\n panels?: Partial<Record<PanelName, boolean>>;\n /** Hides the Reset side panels command (panels are docked: they can't be moved or floated anyway) (default false). */\n lockLayout?: boolean;\n /** Also list tools that are planned but not available yet (default false). */\n showPlannedTools?: boolean;\n /** Links to web pages in documents may open, after a prompt (default true). */\n externalLinks?: boolean;\n}\n\n/** The viewer's configuration, as {@link FreePdfViewer.getConfig} reports it. */\nexport interface ViewerConfig {\n /** The mode. */\n mode: Mode;\n /** Every feature, on or off (the mode's preset with your overrides applied). */\n features: Record<Feature, boolean>;\n /** Interface options. */\n ui: Required<Omit<UiOptions, \"panels\">> & { panels: Partial<Record<PanelName, boolean>> };\n /** Hidden elements. */\n disabledElements: ElementId[];\n /** No feature that changes the document is on. */\n readOnly: boolean;\n}\n\n/** Colour theme; `system` follows the browser's preference. */\nexport type Theme = \"light\" | \"dark\" | \"system\";\n\n/** Zoom: a percentage (10–6400) or a fit. */\nexport type Zoom = number | \"fit-width\" | \"fit-page\";\n\n/**\n * Ids accepted by `disabledElements` and {@link FreePdfViewer.setDisabledElements}.\n * docs/api.md lists what each one hides.\n */\nexport type ElementId =\n | \"download\"\n | \"save\"\n | \"print\"\n | \"open\"\n | \"flatten\"\n | \"settings\"\n | \"import\"\n | \"tool:note\"\n | \"tool:freetext\"\n | \"tool:callout\"\n | \"tool:highlight\"\n | \"tool:underline\"\n | \"tool:strikeout\"\n | \"tool:squiggly\"\n | \"tool:caret\"\n | \"tool:replace\"\n | \"tool:ink\"\n | \"tool:line\"\n | \"tool:arrow\"\n | \"tool:square\"\n | \"tool:circle\"\n | \"tool:polygon\"\n | \"tool:polyline\"\n | \"tool:cloud\"\n | \"tool:attach\"\n | \"tool:stamp\"\n | \"tool:image\"\n | \"tool:link\"\n | \"tool:measure\"\n | \"tool:fillsign\"\n | \"tool:signature\";\n\n/** A PDF to open: fetched from a URL, or given as bytes. */\nexport type DocumentSource =\n | {\n /** URL of the PDF (same-origin, or CORS-enabled such as a Firebase Storage download URL). */\n url: string;\n /** File name shown in the viewer; defaults to the URL's last path segment. */\n name?: string;\n /** Options for `fetch` (headers, credentials). */\n fetchInit?: RequestInit;\n }\n | {\n /** The PDF's bytes. They are copied, never detached from the caller. */\n data: ArrayBuffer | Uint8Array | Blob;\n /** File name shown in the viewer; defaults to the Blob's name or `document.pdf`. */\n name?: string;\n };\n\n/**\n * The loading animation shown over the viewer while it starts and while a document opens.\n * Give one of `src` or `svg`; with neither, the built-in spinner is shown.\n */\nexport interface LoaderOptions {\n /** URL of an image: an SVG, GIF, animated WebP or PNG, or a `data:` URL. */\n src?: string;\n /** Inline SVG markup. It is shown as an image, so scripts in it never run. */\n svg?: string;\n /** Width of the image as a CSS length (default `48px`); the height follows its aspect ratio. */\n size?: string;\n /** Background behind it as a CSS colour (default: the viewer's background for the theme). */\n background?: string;\n /** What screen readers announce (default `Loading`). */\n label?: string;\n}\n\n/** A loader: a URL of an image (shorthand for `{ src }`), or {@link LoaderOptions}. */\nexport type Loader = string | LoaderOptions;\n\n/** Options for {@link FreePdf.init}. */\nexport interface InitOptions {\n /** URL of the SDK folder (the one holding `viewer/` and `version.json`), on the page's origin. */\n baseUrl: string;\n /** A document to open once the viewer is ready. */\n document?: DocumentSource;\n /** A preset of features (default `view`, read-only). */\n mode?: Mode;\n /** Turn individual features on or off, on top of the mode's preset. */\n features?: FeatureFlags;\n /** Show or hide parts of the interface. */\n ui?: UiOptions;\n /** Author of new comments; it wins over a name saved in the viewer's settings. */\n author?: string;\n /** Colour theme (default `system`). */\n theme?: Theme;\n /** Password: opens a document that needs one, and lifts owner restrictions (as {@link FreePdfViewer.unlock}). */\n password?: string;\n /** Parts of the interface to hide. */\n disabledElements?: ElementId[];\n /** Interface language, such as `en`, `de` or `zh-Hans` (closest available; English otherwise). */\n locale?: string;\n /**\n * Loading animation shown while the viewer starts and while a document opens (default: a\n * built-in spinner; `false`: none). Read once, when the viewer mounts.\n */\n loader?: Loader | false;\n /** Milliseconds to wait for a reply before rejecting with `TIMEOUT` (default 60000; loads get twice that). */\n timeoutMs?: number;\n /**\n * Listeners attached before the viewer starts, so they also hear events fired while `init`\n * is still running (`ready`, the first `documentLoaded`). `ready` also reaches listeners\n * added later with `on`.\n */\n listeners?: { [K in EventName]?: Listener<K> };\n}\n\n/** What the open document's security allows. */\nexport interface Permissions {\n /** Comments may be added, changed, deleted and imported. */\n canAnnotate: boolean;\n /** The document may be printed. */\n canPrint: boolean;\n /** Text and images may be copied. */\n canCopy: boolean;\n /** The document is encrypted. */\n isEncrypted: boolean;\n /** An owner password would lift restrictions ({@link FreePdfViewer.unlock}). */\n canUnlock: boolean;\n}\n\n/** A reply in a comment thread. */\nexport interface AnnotationReply {\n /** The reply's id (XFDF `name`). */\n id: string;\n /** Author (XFDF `title`). */\n author: string | null;\n /** Text. */\n contents: string | null;\n /** Last modified, ISO 8601. */\n date: string | null;\n}\n\n/** A comment, as {@link FreePdfViewer.getAnnotations} lists it. */\nexport interface Annotation {\n /** The annotation's id (XFDF `name`). */\n id: string;\n /** The PDF subtype in lowercase: `text` (note), `freetext`, `square`, `circle`, `line`, `ink`, `polygon`, `polyline`, `highlight`, `underline`, `squiggly`, `strikeout`, `stamp`, `caret`, `fileattachment`, `sound`, `redact`. */\n type: string;\n /** Author (XFDF `title`). */\n author: string | null;\n /** Subject. */\n subject: string | null;\n /** Text. */\n contents: string | null;\n /** Last modified (else created), ISO 8601. */\n date: string | null;\n /** 0-based page index. */\n pageIndex: number;\n /** Colour, `#RRGGBB`. */\n color: string | null;\n /** Replies, oldest first. */\n replies: AnnotationReply[];\n}\n\n/** A newly opened document. */\nexport interface DocumentInfo {\n /** Number of pages. */\n pageCount: number;\n /** What its security allows. */\n permissions: Permissions;\n}\n\n/** The result of {@link FreePdfViewer.load}. */\nexport interface LoadResult extends DocumentInfo {\n /** The `password` lifted owner restrictions. */\n unlocked: boolean;\n}\n\n/** Versions of the SDK and of pdfcraft. */\nexport interface VersionInfo {\n /** The SDK version (semver). */\n sdk: string;\n /** The pdfcraft commit the viewer was built from. */\n pdfcraftRev: string;\n}\n\n/** Error codes. `TIMEOUT`, `DESTROYED` and `FETCH_FAILED` come from the wrapper; the rest from the viewer. */\nexport type ErrorCode =\n | \"BAD_REQUEST\"\n | \"UNKNOWN_METHOD\"\n | \"UNSUPPORTED_PROTOCOL\"\n | \"NOT_READY\"\n | \"NO_DOCUMENT\"\n | \"LOAD_FAILED\"\n | \"NEEDS_PASSWORD\"\n | \"WRONG_PASSWORD\"\n | \"NOT_PERMITTED\"\n | \"READ_ONLY\"\n | \"XFDF_INVALID\"\n | \"TOO_LARGE\"\n | \"BUSY\"\n | \"INTERNAL\"\n | \"TIMEOUT\"\n | \"DESTROYED\"\n | \"FETCH_FAILED\";\n\n/** An error as data: what events carry. */\nexport interface ErrorInfo {\n /** Machine-readable code. */\n code: ErrorCode;\n /** Human-readable message (English). */\n message: string;\n}\n\n/** Every failure of the SDK: a typed code and a message. */\nexport class FreePdfError extends Error implements ErrorInfo {\n /** Machine-readable code. */\n readonly code: ErrorCode;\n\n /**\n * @param code - Machine-readable code.\n * @param message - Human-readable message.\n */\n constructor(code: ErrorCode, message: string) {\n super(message);\n this.name = \"FreePdfError\";\n this.code = code;\n }\n}\n\n/** Events and the data each one carries. */\nexport interface EventMap {\n /** The viewer is configured and ready for requests. */\n ready: VersionInfo;\n /** A document opened. */\n documentLoaded: DocumentInfo;\n /** A document could not be opened. */\n documentError: ErrorInfo;\n /** Comments were added, changed or removed (by the user or the API). */\n annotationsChanged: { count: number };\n /** The document gained or lost unsaved changes. */\n dirtyChanged: { dirty: boolean };\n /** Something failed outside a request (for example a wrong `password` at load). */\n error: ErrorInfo;\n /** The user pressed Save in the viewer: here is the saved PDF. The viewer treats it as saved. */\n saveRequested: { name: string; saveAs: boolean; data: Uint8Array };\n}\n\n/** An event name. */\nexport type EventName = keyof EventMap;\n\n/** A listener for event `K`. */\nexport type Listener<K extends EventName> = (data: EventMap[K]) => void;\n\n/** A mounted viewer. Every method is async and rejects with {@link FreePdfError}. */\nexport interface FreePdfViewer {\n /** Opens a document, replacing the one shown. */\n load(document: DocumentSource, options?: { password?: string }): Promise<LoadResult>;\n /** Lifts owner restrictions with the owner password; resolves to the new permissions. */\n unlock(password: string): Promise<Permissions>;\n /** What the open document's security allows. */\n getPermissions(): Promise<Permissions>;\n /** Imports comments from standard XFDF; `replace` deletes the existing ones first. Resolves to the number imported. */\n importXfdf(xfdf: string | Blob, options?: { replace?: boolean }): Promise<number>;\n /** The document's comments as XFDF (author in `title`). */\n exportXfdf(): Promise<string>;\n /** The document's comments with their replies; the length is the exact count. */\n getAnnotations(): Promise<Annotation[]>;\n /** Deletes every comment (one undo step per comment); resolves to how many there were. */\n deleteAllAnnotations(): Promise<number>;\n /** Sets the author of new comments. */\n setAuthor(author: string): Promise<void>;\n /** Sets the colour theme. */\n setTheme(theme: Theme): Promise<void>;\n /** Switches mode; your feature overrides still apply on top of it. */\n setMode(mode: Mode): Promise<void>;\n /** Replaces the feature overrides (relative to the mode). Pass `{}` to use the mode's features as they are. */\n setFeatures(features: FeatureFlags): Promise<void>;\n /** Changes interface options; options you leave out keep their value. */\n setUi(ui: UiOptions): Promise<void>;\n /** The resolved configuration: mode, every feature on or off, interface options. */\n getConfig(): Promise<ViewerConfig>;\n /** Hides parts of the interface (replaces the previous list). */\n setDisabledElements(ids: ElementId[]): Promise<void>;\n /** Sets the interface language; resolves to the language used. */\n setLocale(locale: string): Promise<string>;\n /** Number of pages. */\n getPageCount(): Promise<number>;\n /** Shows page `page` (1-based). */\n goToPage(page: number): Promise<void>;\n /** Sets the zoom: a percentage, `fit-width` or `fit-page`. */\n setZoom(zoom: Zoom): Promise<void>;\n /** Whether there are unsaved changes. */\n isDirty(): Promise<boolean>;\n /** The PDF with every change (comments included); the viewer then treats it as saved. */\n save(): Promise<Uint8Array>;\n /** Versions of the SDK and pdfcraft. */\n version(): Promise<VersionInfo>;\n /** Removes the viewer; pending requests reject with `DESTROYED`. Safe to call twice. */\n destroy(): Promise<void>;\n /** Adds a listener. */\n on<K extends EventName>(name: K, listener: Listener<K>): void;\n /** Removes a listener. */\n off<K extends EventName>(name: K, listener: Listener<K>): void;\n /** The iframe holding the viewer. */\n readonly iframe: HTMLIFrameElement;\n}\n\nconst HELLO_TIMEOUT_MS = 30_000;\nconst DEFAULT_TIMEOUT_MS = 60_000;\n\ninterface Pending {\n resolve: (value: unknown) => void;\n reject: (error: FreePdfError) => void;\n timer: ReturnType<typeof setTimeout>;\n}\n\ntype AnyListener = (data: never) => void;\n\nfunction isRecord(v: unknown): v is Record<string, unknown> {\n return typeof v === \"object\" && v !== null;\n}\n\nfunction asErrorInfo(v: unknown): ErrorInfo {\n if (isRecord(v) && typeof v.code === \"string\" && typeof v.message === \"string\") {\n return { code: v.code as ErrorCode, message: v.message };\n }\n return { code: \"INTERNAL\", message: \"malformed error from the viewer\" };\n}\n\n/** A plain copy of interface options (a reactive proxy can't be posted to the iframe). */\nfunction plainUi(ui: UiOptions): Record<string, unknown> {\n const out: Record<string, unknown> = { ...ui };\n if (ui.panels) out.panels = { ...ui.panels };\n return out;\n}\n\nfunction channelId(): string {\n const bytes = new Uint8Array(16);\n crypto.getRandomValues(bytes);\n return Array.from(bytes, (b) => b.toString(16).padStart(2, \"0\")).join(\"\");\n}\n\nfunction nameFromUrl(url: string): string {\n try {\n const last = new URL(url, location.href).pathname.split(\"/\").filter(Boolean).pop();\n return last ? decodeURIComponent(last) : \"document.pdf\";\n } catch {\n return \"document.pdf\";\n }\n}\n\n/** Copies the document's bytes into a fresh ArrayBuffer (safe to transfer). A URL is fetched within `timeoutMs`. */\nasync function readDocument(source: DocumentSource, timeoutMs: number): Promise<{ name: string; bytes: ArrayBuffer }> {\n if (\"url\" in source) {\n const controller = new AbortController();\n const timer = setTimeout(() => controller.abort(), timeoutMs);\n const callerSignal = source.fetchInit?.signal;\n const onAbort = (): void => controller.abort();\n callerSignal?.addEventListener(\"abort\", onAbort, { once: true });\n if (callerSignal?.aborted) controller.abort();\n try {\n const response = await fetch(source.url, { ...source.fetchInit, signal: controller.signal });\n if (!response.ok) throw new FreePdfError(\"FETCH_FAILED\", `could not fetch the document: HTTP ${response.status}`);\n return { name: source.name ?? nameFromUrl(source.url), bytes: await response.arrayBuffer() };\n } catch (e) {\n if (e instanceof FreePdfError) throw e;\n const why = controller.signal.aborted && !callerSignal?.aborted ? `no response in ${timeoutMs} ms` : String(e);\n throw new FreePdfError(\"FETCH_FAILED\", `could not fetch the document: ${why}`);\n } finally {\n clearTimeout(timer);\n callerSignal?.removeEventListener(\"abort\", onAbort);\n }\n }\n const data = source.data;\n if (data instanceof Blob) {\n const fileName = typeof File !== \"undefined\" && data instanceof File ? data.name : undefined;\n return { name: source.name ?? fileName ?? \"document.pdf\", bytes: await data.arrayBuffer() };\n }\n if (data instanceof ArrayBuffer) return { name: source.name ?? \"document.pdf\", bytes: data.slice(0) };\n if (data instanceof Uint8Array) {\n const copy = new Uint8Array(data.byteLength);\n copy.set(data);\n return { name: source.name ?? \"document.pdf\", bytes: copy.buffer };\n }\n throw new FreePdfError(\"BAD_REQUEST\", \"document needs a url or data (ArrayBuffer, Uint8Array or Blob)\");\n}\n\n/** The built-in loader: a ring that turns (slower when the user asks for reduced motion). */\nconst DEFAULT_LOADER_SVG =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 0 48 48\"><style>' +\n \"circle{fill:none;stroke-width:4;stroke-linecap:round}.t{stroke:rgba(128,128,136,.25)}\" +\n \".a{stroke:rgb(128,128,136);stroke-dasharray:30 200;transform-origin:24px 24px;animation:s .9s linear infinite}\" +\n \"@keyframes s{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.a{animation-duration:3s}}\" +\n '</style><circle class=\"t\" cx=\"24\" cy=\"24\" r=\"18\"/><circle class=\"a\" cx=\"24\" cy=\"24\" r=\"18\"/></svg>';\n\n/** Inline SVG markup is at most this long. */\nconst MAX_LOADER_SVG = 1024 * 1024;\n\n/** The loader as a plain, checked description (throws `BAD_REQUEST`), or `null` for none. */\nfunction loaderOptions(loader: Loader | false | undefined): LoaderOptions | null {\n if (loader === false) return null;\n if (loader === undefined) return { svg: DEFAULT_LOADER_SVG };\n if (typeof loader === \"string\") return { src: loader };\n if (!isRecord(loader)) throw new FreePdfError(\"BAD_REQUEST\", \"loader must be a URL, an object or false\");\n const out: LoaderOptions = {};\n for (const key of [\"src\", \"svg\", \"size\", \"background\", \"label\"] as const) {\n const v = loader[key];\n if (v === undefined) continue;\n if (typeof v !== \"string\") throw new FreePdfError(\"BAD_REQUEST\", `loader.${key} must be a string`);\n out[key] = v;\n }\n if (out.svg !== undefined && out.svg.length > MAX_LOADER_SVG) throw new FreePdfError(\"TOO_LARGE\", \"loader.svg is over 1 MiB\");\n if (out.src === undefined && out.svg === undefined) out.svg = DEFAULT_LOADER_SVG;\n return out;\n}\n\n/** The viewer's own background before it paints, so the loader matches it. */\nfunction themeBackground(theme: Theme): string {\n const dark = theme === \"dark\" || (theme === \"system\" && typeof matchMedia === \"function\" && matchMedia(\"(prefers-color-scheme: dark)\").matches);\n return dark ? \"#19191c\" : \"#f1f1f3\";\n}\n\n/** Builds the loader overlay (visible). */\nfunction loaderElement(options: LoaderOptions, theme: Theme): HTMLDivElement {\n const overlay = document.createElement(\"div\");\n overlay.setAttribute(\"role\", \"status\");\n overlay.dataset.fpsLoader = \"\";\n overlay.style.cssText = \"position:absolute;inset:0;display:flex;align-items:center;justify-content:center;transition:opacity .2s ease;\";\n overlay.style.background = options.background ?? themeBackground(theme);\n const img = document.createElement(\"img\");\n // An <img>: an SVG shown this way can't run scripts or load other resources.\n img.src = options.src ?? `data:image/svg+xml;charset=utf-8,${encodeURIComponent(options.svg ?? DEFAULT_LOADER_SVG)}`;\n img.alt = options.label ?? \"Loading\";\n img.decoding = \"async\";\n img.style.cssText = \"display:block;height:auto;max-width:80%;max-height:80%;\";\n img.style.width = options.size ?? \"48px\";\n overlay.appendChild(img);\n return overlay;\n}\n\nclass Viewer implements FreePdfViewer {\n readonly iframe: HTMLIFrameElement;\n /** Holds the iframe and the loader; what the viewer adds to the host's element. */\n private readonly root: HTMLDivElement;\n private readonly loader: HTMLDivElement | null;\n /** Work the loader is shown for (starting counts as one). */\n private busy = 1;\n private readonly origin: string;\n private readonly channel = channelId();\n private readonly pending = new Map<number, Pending>();\n private readonly listeners = new Map<EventName, Set<AnyListener>>();\n private readonly timeoutMs: number;\n private nextId = 1;\n private destroyed = false;\n private hello: { resolve: (info: VersionInfo) => void; reject: (e: FreePdfError) => void } | null = null;\n private readyInfo: VersionInfo | null = null;\n private readonly onMessage = (event: MessageEvent): void => this.receive(event);\n\n constructor(element: HTMLElement, baseUrl: URL, timeoutMs: number, loader: LoaderOptions | null, theme: Theme) {\n this.origin = baseUrl.origin;\n this.timeoutMs = timeoutMs;\n this.root = document.createElement(\"div\");\n this.root.style.cssText = \"position:relative;width:100%;height:100%;\";\n this.iframe = document.createElement(\"iframe\");\n this.iframe.src = new URL(`viewer/index.html#ch=${this.channel}`, baseUrl).href;\n this.iframe.title = \"PDF viewer\";\n this.iframe.setAttribute(\"allow\", \"clipboard-read; clipboard-write; fullscreen\");\n this.iframe.style.cssText = \"display:block;width:100%;height:100%;border:0;\";\n this.root.appendChild(this.iframe);\n this.loader = loader ? loaderElement(loader, theme) : null;\n if (this.loader) this.root.appendChild(this.loader);\n window.addEventListener(\"message\", this.onMessage);\n element.appendChild(this.root);\n }\n\n /** Shows the loader for a piece of work; pair with {@link idle}. */\n busyStart(): void {\n this.busy++;\n if (this.loader) {\n this.loader.hidden = false;\n this.loader.style.opacity = \"1\";\n this.loader.style.pointerEvents = \"\";\n }\n }\n\n /** Ends a piece of work; the loader fades out when none is left. */\n idle(): void {\n this.busy = Math.max(0, this.busy - 1);\n const loader = this.loader;\n if (!loader || this.busy > 0) return;\n // Clicks reach the viewer at once, not only when the fade is over.\n loader.style.opacity = \"0\";\n loader.style.pointerEvents = \"none\";\n setTimeout(() => {\n if (this.busy === 0) loader.hidden = true;\n }, 200);\n }\n\n /** Waits for the viewer's hello. */\n started(): Promise<VersionInfo> {\n return new Promise<VersionInfo>((resolve, reject) => {\n const timer = setTimeout(() => {\n this.hello = null;\n reject(new FreePdfError(\"TIMEOUT\", \"the viewer did not start (is baseUrl right, and WebGL available?)\"));\n }, HELLO_TIMEOUT_MS);\n this.hello = {\n resolve: (info) => {\n clearTimeout(timer);\n resolve(info);\n },\n reject: (e) => {\n clearTimeout(timer);\n reject(e);\n },\n };\n });\n }\n\n private receive(event: MessageEvent): void {\n if (event.origin !== this.origin || event.source !== this.iframe.contentWindow) return;\n const msg: unknown = event.data;\n if (!isRecord(msg) || msg.ch !== this.channel) return;\n if (msg.fps !== PROTOCOL_VERSION) {\n // Another protocol version: fail what is waiting for it now, not after a timeout.\n const err = new FreePdfError(\"UNSUPPORTED_PROTOCOL\", `the viewer speaks protocol ${String(msg.fps)}; this wrapper speaks ${PROTOCOL_VERSION}`);\n if (msg.kind === \"hello\" && this.hello) {\n this.hello.reject(err);\n this.hello = null;\n return;\n }\n const p = msg.kind === \"res\" && typeof msg.id === \"number\" ? this.pending.get(msg.id) : undefined;\n if (p && typeof msg.id === \"number\") {\n this.pending.delete(msg.id);\n clearTimeout(p.timer);\n p.reject(err);\n return;\n }\n this.emit(\"error\", { code: err.code, message: err.message });\n return;\n }\n switch (msg.kind) {\n case \"hello\": {\n const info = isRecord(msg.info) ? msg.info : {};\n const version: VersionInfo = { sdk: String(info.sdk ?? \"\"), pdfcraftRev: String(info.pdfcraftRev ?? \"\") };\n if (version.sdk !== SDK_VERSION) {\n console.warn(`Free PDF SDK: the wrapper is ${SDK_VERSION} but the viewer is ${version.sdk}; serve matching files`);\n }\n this.hello?.resolve(version);\n this.hello = null;\n return;\n }\n case \"res\": {\n if (typeof msg.id !== \"number\") return;\n const p = this.pending.get(msg.id);\n if (!p) return;\n this.pending.delete(msg.id);\n clearTimeout(p.timer);\n if (msg.ok === true) p.resolve(msg.result);\n else {\n const e = asErrorInfo(msg.error);\n p.reject(new FreePdfError(e.code, e.message));\n }\n return;\n }\n case \"evt\": {\n if (typeof msg.name !== \"string\") return;\n if (msg.name === \"error\" && this.hello) {\n const e = asErrorInfo(msg.data);\n this.hello.reject(new FreePdfError(e.code, e.message));\n this.hello = null;\n return;\n }\n if (msg.name === \"documentError\" || msg.name === \"error\") {\n this.emit(msg.name, asErrorInfo(msg.data));\n } else if (this.listeners.has(msg.name as EventName)) {\n this.emit(msg.name as EventName, msg.data as never);\n }\n return;\n }\n default:\n return;\n }\n }\n\n emit<K extends EventName>(name: K, data: EventMap[K]): void {\n if (name === \"ready\") this.readyInfo = data as VersionInfo;\n for (const listener of [...(this.listeners.get(name) ?? [])]) {\n try {\n (listener as Listener<K>)(data);\n } catch (e) {\n console.error(`Free PDF SDK: a ${name} listener threw`, e);\n }\n }\n }\n\n request<T>(method: string, params?: Record<string, unknown>, transfer: Transferable[] = [], timeoutMs = this.timeoutMs): Promise<T> {\n if (this.destroyed) return Promise.reject(new FreePdfError(\"DESTROYED\", \"the viewer was destroyed\"));\n const contentWindow = this.iframe.contentWindow;\n if (!contentWindow) return Promise.reject(new FreePdfError(\"NOT_READY\", \"the viewer is not attached to the page\"));\n const id = this.nextId;\n this.nextId = this.nextId >= 0x7fffffff ? 1 : this.nextId + 1;\n return new Promise<T>((resolve, reject) => {\n const timer = setTimeout(() => {\n this.pending.delete(id);\n reject(new FreePdfError(\"TIMEOUT\", `${method} got no reply in ${timeoutMs} ms`));\n }, timeoutMs);\n this.pending.set(id, { resolve: resolve as (v: unknown) => void, reject, timer });\n // The viewer drops the request once the deadline has passed, so a request that timed out\n // here never takes effect later (frames stall in background tabs).\n const deadline = Date.now() + timeoutMs;\n try {\n contentWindow.postMessage({ fps: PROTOCOL_VERSION, ch: this.channel, kind: \"req\", id, method, params: params ?? {}, deadline }, this.origin, transfer);\n } catch (e) {\n clearTimeout(timer);\n this.pending.delete(id);\n reject(new FreePdfError(\"BAD_REQUEST\", `${method} could not be sent: ${e instanceof Error ? e.message : String(e)}`));\n }\n });\n }\n\n async load(source: DocumentSource, options?: { password?: string }): Promise<LoadResult> {\n if (this.destroyed) throw new FreePdfError(\"DESTROYED\", \"the viewer was destroyed\");\n this.busyStart();\n try {\n let doc: { name: string; bytes: ArrayBuffer };\n try {\n doc = await readDocument(source, this.timeoutMs * 2);\n } catch (e) {\n // The viewer reports its own load failures; a fetch that failed never reached it.\n const err = e instanceof FreePdfError ? e : new FreePdfError(\"FETCH_FAILED\", String(e));\n this.emit(\"documentError\", { code: err.code, message: err.message });\n throw err;\n }\n const { name, bytes } = doc;\n const params: Record<string, unknown> = { name, data: bytes };\n if (options?.password !== undefined) params.password = options.password;\n return await this.request<LoadResult>(\"load\", params, [bytes], this.timeoutMs * 2);\n } finally {\n this.idle();\n }\n }\n\n async unlock(password: string): Promise<Permissions> {\n const r = await this.request<{ permissions: Permissions }>(\"unlock\", { password });\n return r.permissions;\n }\n\n getPermissions(): Promise<Permissions> {\n return this.request<Permissions>(\"getPermissions\");\n }\n\n async importXfdf(xfdf: string | Blob, options?: { replace?: boolean }): Promise<number> {\n const text = typeof xfdf === \"string\" ? xfdf : await xfdf.text();\n return this.request<number>(\"importXfdf\", { xfdf: text, replace: options?.replace ?? false });\n }\n\n exportXfdf(): Promise<string> {\n return this.request<string>(\"exportXfdf\");\n }\n\n getAnnotations(): Promise<Annotation[]> {\n return this.request<Annotation[]>(\"getAnnotations\");\n }\n\n deleteAllAnnotations(): Promise<number> {\n return this.request<number>(\"deleteAllAnnotations\");\n }\n\n async setAuthor(author: string): Promise<void> {\n await this.request(\"setAuthor\", { author });\n }\n\n async setTheme(theme: Theme): Promise<void> {\n await this.request(\"setTheme\", { theme });\n }\n\n async setMode(mode: Mode): Promise<void> {\n await this.request(\"setMode\", { mode });\n }\n\n async setFeatures(features: FeatureFlags): Promise<void> {\n await this.request(\"setFeatures\", { features: { ...features } });\n }\n\n async setUi(ui: UiOptions): Promise<void> {\n await this.request(\"setUi\", { ui: plainUi(ui) });\n }\n\n getConfig(): Promise<ViewerConfig> {\n return this.request<ViewerConfig>(\"getConfig\");\n }\n\n async setDisabledElements(ids: ElementId[]): Promise<void> {\n await this.request(\"setDisabledElements\", { ids: [...ids] });\n }\n\n async setLocale(locale: string): Promise<string> {\n const r = await this.request<{ locale: string }>(\"setLocale\", { locale });\n return r.locale;\n }\n\n getPageCount(): Promise<number> {\n return this.request<number>(\"getPageCount\");\n }\n\n async goToPage(page: number): Promise<void> {\n await this.request(\"goToPage\", { page });\n }\n\n async setZoom(zoom: Zoom): Promise<void> {\n await this.request(\"setZoom\", { zoom });\n }\n\n isDirty(): Promise<boolean> {\n return this.request<boolean>(\"isDirty\");\n }\n\n async save(): Promise<Uint8Array> {\n return this.request<Uint8Array>(\"save\", undefined, [], this.timeoutMs * 2);\n }\n\n version(): Promise<VersionInfo> {\n return this.request<VersionInfo>(\"version\");\n }\n\n async destroy(): Promise<void> {\n if (this.destroyed) return;\n this.destroyed = true;\n window.removeEventListener(\"message\", this.onMessage);\n const error = new FreePdfError(\"DESTROYED\", \"the viewer was destroyed\");\n for (const p of this.pending.values()) {\n clearTimeout(p.timer);\n p.reject(error);\n }\n this.pending.clear();\n this.hello?.reject(error);\n this.hello = null;\n this.listeners.clear();\n this.root.remove();\n }\n\n on<K extends EventName>(name: K, listener: Listener<K>): void {\n let set = this.listeners.get(name);\n if (!set) {\n set = new Set();\n this.listeners.set(name, set);\n }\n set.add(listener as AnyListener);\n if (name === \"ready\" && this.readyInfo) {\n const info = this.readyInfo;\n queueMicrotask(() => {\n if (this.listeners.get(name)?.has(listener as AnyListener)) (listener as Listener<\"ready\">)(info);\n });\n }\n }\n\n off<K extends EventName>(name: K, listener: Listener<K>): void {\n this.listeners.get(name)?.delete(listener as AnyListener);\n }\n}\n\n/**\n * Mounts a viewer in `element` (which it fills) and resolves once it is ready and, if\n * `options.document` is given, once that document is open. Rejects with {@link FreePdfError}\n * (and removes the iframe) when the viewer cannot start or the document cannot be opened.\n *\n * @param element - The element to mount the viewer in; give it a size.\n * @param options - Where the SDK is hosted, and how the viewer starts.\n */\nexport async function init(element: HTMLElement, options: InitOptions): Promise<FreePdfViewer> {\n if (!(element instanceof HTMLElement)) throw new FreePdfError(\"BAD_REQUEST\", \"init needs an element to mount the viewer in\");\n if (!options || typeof options.baseUrl !== \"string\") throw new FreePdfError(\"BAD_REQUEST\", \"init needs options.baseUrl\");\n const base = new URL(options.baseUrl.endsWith(\"/\") ? options.baseUrl : `${options.baseUrl}/`, document.baseURI);\n if (base.origin !== location.origin) {\n throw new FreePdfError(\"BAD_REQUEST\", `the SDK must be served from this page's origin (${location.origin}), not ${base.origin}`);\n }\n const theme = options.theme ?? \"system\";\n const viewer = new Viewer(element, base, options.timeoutMs ?? DEFAULT_TIMEOUT_MS, loaderOptions(options.loader), theme);\n for (const [name, listener] of Object.entries(options.listeners ?? {})) {\n if (typeof listener === \"function\") viewer.on(name as EventName, listener as Listener<EventName>);\n }\n try {\n const info = await viewer.started();\n // Plain copies: a reactive proxy (Vue) can't be posted to the iframe.\n const config: Record<string, unknown> = {\n mode: options.mode ?? \"view\",\n theme,\n disabledElements: [...(options.disabledElements ?? [])],\n };\n if (options.features !== undefined) config.features = { ...options.features };\n if (options.ui !== undefined) config.ui = plainUi(options.ui);\n if (options.author !== undefined) config.author = options.author;\n if (options.locale !== undefined) config.locale = options.locale;\n await viewer.request(\"configure\", config);\n viewer.emit(\"ready\", info);\n if (options.document) {\n await viewer.load(options.document, options.password === undefined ? undefined : { password: options.password });\n }\n viewer.idle();\n return viewer;\n } catch (e) {\n await viewer.destroy();\n throw e instanceof FreePdfError ? e : new FreePdfError(\"INTERNAL\", String(e));\n }\n}\n\n/** The SDK entry point. */\nexport const FreePdf = {\n /** See {@link init}. */\n init,\n /** The wrapper's version. */\n version: SDK_VERSION,\n} as const;\n\nexport default FreePdf;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mecorelabs/free-pdf-sdk",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "Free PDF SDK: an embeddable, white-label PDF viewer, annotator and editor for the web, with React, Vue, Svelte, Angular and Web Component integrations",
5
5
  "license": "MIT OR Apache-2.0",
6
6
  "homepage": "https://freepdfsdk.mecorelabs.com",
@@ -1,9 +1,9 @@
1
1
  # Third-party notices
2
2
 
3
3
  Free PDF SDK is built on [pdfcraft](https://github.com/storytold/pdfcraft) by the ArtCraft Team
4
- and the PdfCraft contributors (MIT OR Apache-2.0), at upstream commit `0dc77fe4ed8810b9e9f25b9dd050afae662c062a`.
4
+ and the PdfCraft contributors (MIT OR Apache-2.0), at upstream commit `3109bb2359759e24ef490e1cdbdba00722b20972`.
5
5
  Free PDF SDK modifies pdfcraft's interface crate (pdfcraft-ui-egui) with opt-in hooks for
6
- white-label branding and for hiding features; the modified build is `9109e4f0c4ddc30e4c130180138aee28756f8201`
6
+ white-label branding and for hiding features; the modified build is `5729cb86d20086c2b104c997728c1abf58a68c57`
7
7
  (`pdfcraftRev` in `version.json`). The viewer's .wasm embeds the material below; each
8
8
  licence is in this folder. Generated by `scripts/collect-notices.mjs` — do not edit by hand.
9
9
 
@@ -4,7 +4,7 @@ Generated by `scripts/collect-notices.mjs` from Cargo.lock (wasm32 target).
4
4
 
5
5
  | Crate | Version | Licence |
6
6
  |---|---|---|
7
- | accesskit | 0.24.1 | MIT OR Apache-2.0 |
7
+ | accesskit | 0.25.2 | MIT OR Apache-2.0 |
8
8
  | adler2 | 2.0.1 | 0BSD OR MIT OR Apache-2.0 |
9
9
  | aes | 0.9.3 | MIT OR Apache-2.0 |
10
10
  | ahash | 0.8.12 | MIT OR Apache-2.0 |
@@ -18,6 +18,7 @@ Generated by `scripts/collect-notices.mjs` from Cargo.lock (wasm32 target).
18
18
  | async-channel | 2.5.0 | Apache-2.0 OR MIT |
19
19
  | base16ct | 1.0.0 | Apache-2.0 OR MIT |
20
20
  | base64 | 0.22.1 | MIT OR Apache-2.0 |
21
+ | base64 | 0.23.1 | MIT OR Apache-2.0 |
21
22
  | base64ct | 1.8.3 | Apache-2.0 OR MIT |
22
23
  | bit-set | 0.10.0 | Apache-2.0 OR MIT |
23
24
  | bit-vec | 0.9.1 | Apache-2.0 OR MIT |
@@ -46,6 +47,7 @@ Generated by `scripts/collect-notices.mjs` from Cargo.lock (wasm32 target).
46
47
  | chrono | 0.4.45 | MIT OR Apache-2.0 |
47
48
  | cipher | 0.5.2 | MIT OR Apache-2.0 |
48
49
  | cmov | 0.5.4 | Apache-2.0 OR MIT |
50
+ | cobs | 0.3.0 | MIT OR Apache-2.0 |
49
51
  | codespan-reporting | 0.13.1 | Apache-2.0 |
50
52
  | color | 0.3.3 | Apache-2.0 OR MIT |
51
53
  | color_quant | 1.1.0 | MIT |
@@ -54,17 +56,22 @@ Generated by `scripts/collect-notices.mjs` from Cargo.lock (wasm32 target).
54
56
  | cow-utils | 0.1.3 | MIT |
55
57
  | cpubits | 0.1.1 | MIT OR Apache-2.0 |
56
58
  | craft-docpath | 0.1.0 | MIT OR Apache-2.0 |
59
+ | craft-fonts-build | 0.1.0 | MIT OR Apache-2.0 |
60
+ | craft-i18n | 0.1.0 | MIT OR Apache-2.0 |
61
+ | craft-keymap | 0.1.0 | MIT OR Apache-2.0 |
62
+ | craft-menu | 0.1.0 | MIT OR Apache-2.0 |
57
63
  | craft-print | 0.1.0 | MIT OR Apache-2.0 |
58
64
  | craft-quit | 0.1.0 | MIT OR Apache-2.0 |
59
65
  | craft-ui | 0.1.0 | MIT OR Apache-2.0 |
66
+ | craft-winprint-gdi | 0.1.0 | MIT OR Apache-2.0 |
60
67
  | crc32fast | 1.5.2 | MIT OR Apache-2.0 |
61
68
  | crossbeam-deque | 0.8.8 | MIT OR Apache-2.0 |
62
69
  | crossbeam-epoch | 0.9.21 | MIT OR Apache-2.0 |
63
70
  | crossbeam-utils | 0.8.23 | MIT OR Apache-2.0 |
64
- | crypto-bigint | 0.7.5 | Apache-2.0 OR MIT |
71
+ | crypto-bigint | 0.7.6 | Apache-2.0 OR MIT |
65
72
  | crypto-common | 0.2.2 | MIT OR Apache-2.0 |
66
73
  | crypto-primes | 0.7.2 | Apache-2.0 OR MIT |
67
- | ctutils | 0.4.2 | Apache-2.0 OR MIT |
74
+ | ctutils | 0.4.5 | Apache-2.0 OR MIT |
68
75
  | cursor-icon | 1.2.0 | MIT OR Apache-2.0 OR Zlib |
69
76
  | curve25519-dalek | 5.0.0 | BSD-3-Clause |
70
77
  | dashmap | 6.2.1 | MIT |
@@ -80,23 +87,23 @@ Generated by `scripts/collect-notices.mjs` from Cargo.lock (wasm32 target).
80
87
  | dynify-macros | 0.1.2 | MIT OR Apache-2.0 |
81
88
  | ecb | 0.2.1 | MIT OR Apache-2.0 |
82
89
  | ecdsa | 0.17.0 | Apache-2.0 OR MIT |
83
- | ecolor | 0.36.2 | MIT OR Apache-2.0 |
90
+ | ecolor | 0.37.0 | MIT OR Apache-2.0 |
84
91
  | ed25519 | 3.0.0 | Apache-2.0 OR MIT |
85
92
  | ed25519-dalek | 3.0.0 | BSD-3-Clause |
86
- | eframe | 0.36.2 | MIT OR Apache-2.0 |
87
- | egui | 0.36.2 | MIT OR Apache-2.0 |
88
- | egui-wgpu | 0.36.2 | MIT OR Apache-2.0 |
89
- | egui_extras | 0.36.2 | MIT OR Apache-2.0 |
90
- | egui_glow | 0.36.2 | MIT OR Apache-2.0 |
93
+ | eframe | 0.37.0 | MIT OR Apache-2.0 |
94
+ | egui | 0.37.0 | MIT OR Apache-2.0 |
95
+ | egui-wgpu | 0.37.0 | MIT OR Apache-2.0 |
96
+ | egui_extras | 0.37.0 | MIT OR Apache-2.0 |
97
+ | egui_glow | 0.37.0 | MIT OR Apache-2.0 |
91
98
  | either | 1.18.0 | MIT OR Apache-2.0 |
92
99
  | elliptic-curve | 0.14.1 | Apache-2.0 OR MIT |
93
- | emath | 0.36.2 | MIT OR Apache-2.0 |
100
+ | emath | 0.37.0 | MIT OR Apache-2.0 |
94
101
  | encoding_rs | 0.8.42 | (Apache-2.0 OR MIT) AND BSD-3-Clause |
95
- | enum-map | 2.7.3 | MIT OR Apache-2.0 |
96
- | enum-map-derive | 0.17.0 | MIT OR Apache-2.0 |
102
+ | enum-map | 3.1.0 | MIT OR Apache-2.0 |
103
+ | enum-map-derive | 1.0.1 | MIT OR Apache-2.0 |
97
104
  | enumn | 0.1.14 | MIT OR Apache-2.0 |
98
- | epaint | 0.36.2 | MIT OR Apache-2.0 |
99
- | epaint_default_fonts | 0.36.2 | (MIT OR Apache-2.0) AND OFL-1.1 AND Ubuntu-font-1.0 |
105
+ | epaint | 0.37.0 | MIT OR Apache-2.0 |
106
+ | epaint_default_fonts | 0.37.0 | (MIT OR Apache-2.0) AND OFL-1.1 AND Ubuntu-font-1.0 |
100
107
  | equator | 0.4.2 | MIT |
101
108
  | equator-macro | 0.4.2 | MIT |
102
109
  | equivalent | 1.0.2 | Apache-2.0 OR MIT |
@@ -109,6 +116,7 @@ Generated by `scripts/collect-notices.mjs` from Cargo.lock (wasm32 target).
109
116
  | fdeflate | 0.3.7 | MIT OR Apache-2.0 |
110
117
  | fearless_simd | 0.4.1 | Apache-2.0 OR MIT |
111
118
  | ff | 0.14.0 | MIT/Apache-2.0 |
119
+ | fixed_decimal | 0.7.3 | Unicode-3.0 |
112
120
  | fixedbitset | 0.5.7 | MIT OR Apache-2.0 |
113
121
  | flatbuffers | 24.12.23 | Apache-2.0 |
114
122
  | flate2 | 1.1.10 | MIT OR Apache-2.0 |
@@ -129,7 +137,7 @@ Generated by `scripts/collect-notices.mjs` from Cargo.lock (wasm32 target).
129
137
  | getrandom | 0.4.3 | MIT OR Apache-2.0 |
130
138
  | gif | 0.14.2 | MIT OR Apache-2.0 |
131
139
  | glifo | 0.1.1 | Apache-2.0 OR MIT |
132
- | glifo | 0.2.0 | Apache-2.0 OR MIT |
140
+ | glifo | 0.3.0 | Apache-2.0 OR MIT |
133
141
  | glow | 0.17.0 | MIT OR Apache-2.0 OR Zlib |
134
142
  | group | 0.14.0 | MIT/Apache-2.0 |
135
143
  | guillotiere | 0.7.0 | MIT/Apache-2.0 |
@@ -149,12 +157,19 @@ Generated by `scripts/collect-notices.mjs` from Cargo.lock (wasm32 target).
149
157
  | hmac | 0.13.0 | MIT OR Apache-2.0 |
150
158
  | hybrid-array | 0.4.15 | MIT OR Apache-2.0 |
151
159
  | icu_collections | 2.3.0 | Unicode-3.0 |
160
+ | icu_decimal | 2.3.0 | Unicode-3.0 |
152
161
  | icu_locale_core | 2.3.0 | Unicode-3.0 |
162
+ | icu_locale_fallback | 2.3.0 | Unicode-3.0 |
163
+ | icu_locale_fallback_data | 2.3.0 | Unicode-3.0 |
153
164
  | icu_normalizer | 2.3.0 | Unicode-3.0 |
154
165
  | icu_normalizer_data | 2.3.0 | Unicode-3.0 |
166
+ | icu_pattern | 0.5.1 | Unicode-3.0 |
167
+ | icu_plurals | 2.3.0 | Unicode-3.0 |
155
168
  | icu_properties | 2.3.0 | Unicode-3.0 |
156
169
  | icu_properties_data | 2.3.0 | Unicode-3.0 |
157
170
  | icu_provider | 2.3.1 | Unicode-3.0 |
171
+ | icu_provider_adapters | 2.3.0 | Unicode-3.0 |
172
+ | icu_provider_blob | 2.3.0 | Unicode-3.0 |
158
173
  | idna | 1.1.0 | MIT OR Apache-2.0 |
159
174
  | idna_adapter | 1.2.2 | Apache-2.0 OR MIT |
160
175
  | image | 0.25.10 | MIT OR Apache-2.0 |
@@ -205,36 +220,36 @@ Generated by `scripts/collect-notices.mjs` from Cargo.lock (wasm32 target).
205
220
  | parking_lot_core | 0.9.12 | MIT OR Apache-2.0 |
206
221
  | pastey | 0.2.3 | MIT OR Apache-2.0 |
207
222
  | pbkdf2 | 0.13.0 | MIT OR Apache-2.0 |
208
- | pdfcraft-a11y | 0.13.0 | MIT OR Apache-2.0 |
209
- | pdfcraft-annot | 0.13.0 | MIT OR Apache-2.0 |
210
- | pdfcraft-audit | 0.13.0 | MIT OR Apache-2.0 |
211
- | pdfcraft-compare | 0.13.0 | MIT OR Apache-2.0 |
212
- | pdfcraft-content | 0.13.0 | MIT OR Apache-2.0 |
213
- | pdfcraft-cos | 0.13.0 | MIT OR Apache-2.0 |
214
- | pdfcraft-create | 0.13.0 | MIT OR Apache-2.0 |
215
- | pdfcraft-crypt | 0.13.0 | MIT OR Apache-2.0 |
216
- | pdfcraft-edit | 0.13.0 | MIT OR Apache-2.0 |
217
- | pdfcraft-engine | 0.13.0 | MIT OR Apache-2.0 |
218
- | pdfcraft-export | 0.13.0 | MIT OR Apache-2.0 |
219
- | pdfcraft-filters | 0.13.0 | MIT OR Apache-2.0 |
220
- | pdfcraft-fonts | 0.13.0 | MIT OR Apache-2.0 |
221
- | pdfcraft-forms | 0.13.0 | MIT OR Apache-2.0 |
222
- | pdfcraft-geom | 0.13.0 | MIT OR Apache-2.0 |
223
- | pdfcraft-js | 0.13.0 | MIT OR Apache-2.0 |
224
- | pdfcraft-measure | 0.13.0 | MIT OR Apache-2.0 |
225
- | pdfcraft-model | 0.13.0 | MIT OR Apache-2.0 |
226
- | pdfcraft-ocr | 0.13.0 | MIT OR Apache-2.0 |
227
- | pdfcraft-optimize | 0.13.0 | MIT OR Apache-2.0 |
228
- | pdfcraft-organize | 0.13.0 | MIT OR Apache-2.0 |
229
- | pdfcraft-platform | 0.13.0 | MIT OR Apache-2.0 |
230
- | pdfcraft-preflight | 0.13.0 | MIT OR Apache-2.0 |
231
- | pdfcraft-print | 0.13.0 | MIT OR Apache-2.0 |
232
- | pdfcraft-redact | 0.13.0 | MIT OR Apache-2.0 |
233
- | pdfcraft-render | 0.13.0 | MIT OR Apache-2.0 |
234
- | pdfcraft-sign | 0.13.0 | MIT OR Apache-2.0 |
235
- | pdfcraft-ui-egui | 0.13.0 | MIT OR Apache-2.0 |
236
- | pdfcraft-xfa | 0.13.0 | MIT OR Apache-2.0 |
237
- | pdfcraft-xfdf | 0.13.0 | MIT OR Apache-2.0 |
223
+ | pdfcraft-a11y | 0.15.0 | MIT OR Apache-2.0 |
224
+ | pdfcraft-annot | 0.15.0 | MIT OR Apache-2.0 |
225
+ | pdfcraft-audit | 0.15.0 | MIT OR Apache-2.0 |
226
+ | pdfcraft-compare | 0.15.0 | MIT OR Apache-2.0 |
227
+ | pdfcraft-content | 0.15.0 | MIT OR Apache-2.0 |
228
+ | pdfcraft-cos | 0.15.0 | MIT OR Apache-2.0 |
229
+ | pdfcraft-create | 0.15.0 | MIT OR Apache-2.0 |
230
+ | pdfcraft-crypt | 0.15.0 | MIT OR Apache-2.0 |
231
+ | pdfcraft-edit | 0.15.0 | MIT OR Apache-2.0 |
232
+ | pdfcraft-engine | 0.15.0 | MIT OR Apache-2.0 |
233
+ | pdfcraft-export | 0.15.0 | MIT OR Apache-2.0 |
234
+ | pdfcraft-filters | 0.15.0 | MIT OR Apache-2.0 |
235
+ | pdfcraft-fonts | 0.15.0 | MIT OR Apache-2.0 |
236
+ | pdfcraft-forms | 0.15.0 | MIT OR Apache-2.0 |
237
+ | pdfcraft-geom | 0.15.0 | MIT OR Apache-2.0 |
238
+ | pdfcraft-js | 0.15.0 | MIT OR Apache-2.0 |
239
+ | pdfcraft-measure | 0.15.0 | MIT OR Apache-2.0 |
240
+ | pdfcraft-model | 0.15.0 | MIT OR Apache-2.0 |
241
+ | pdfcraft-ocr | 0.15.0 | MIT OR Apache-2.0 |
242
+ | pdfcraft-optimize | 0.15.0 | MIT OR Apache-2.0 |
243
+ | pdfcraft-organize | 0.15.0 | MIT OR Apache-2.0 |
244
+ | pdfcraft-platform | 0.15.0 | MIT OR Apache-2.0 |
245
+ | pdfcraft-preflight | 0.15.0 | MIT OR Apache-2.0 |
246
+ | pdfcraft-print | 0.15.0 | MIT OR Apache-2.0 |
247
+ | pdfcraft-redact | 0.15.0 | MIT OR Apache-2.0 |
248
+ | pdfcraft-render | 0.15.0 | MIT OR Apache-2.0 |
249
+ | pdfcraft-sign | 0.15.0 | MIT OR Apache-2.0 |
250
+ | pdfcraft-ui-egui | 0.15.0 | MIT OR Apache-2.0 |
251
+ | pdfcraft-xfa | 0.15.0 | MIT OR Apache-2.0 |
252
+ | pdfcraft-xfdf | 0.15.0 | MIT OR Apache-2.0 |
238
253
  | pem-rfc7468 | 1.0.0 | Apache-2.0 OR MIT |
239
254
  | peniko | 0.6.1 | Apache-2.0 OR MIT |
240
255
  | percent-encoding | 2.3.2 | MIT OR Apache-2.0 |
@@ -257,6 +272,7 @@ Generated by `scripts/collect-notices.mjs` from Cargo.lock (wasm32 target).
257
272
  | png | 0.18.1 | MIT OR Apache-2.0 |
258
273
  | polycool | 0.4.0 | MIT OR Apache-2.0 |
259
274
  | portable-atomic | 1.15.0 | Apache-2.0 OR MIT |
275
+ | postcard | 1.1.3 | MIT OR Apache-2.0 |
260
276
  | potential_utf | 0.1.6 | Unicode-3.0 |
261
277
  | powerfmt | 0.2.0 | MIT OR Apache-2.0 |
262
278
  | primefield | 0.14.0 | Apache-2.0 OR MIT |
@@ -291,6 +307,7 @@ Generated by `scripts/collect-notices.mjs` from Cargo.lock (wasm32 target).
291
307
  | rten-gemm | 0.26.0 | MIT OR Apache-2.0 |
292
308
  | rten-imageproc | 0.26.0 | MIT OR Apache-2.0 |
293
309
  | rten-model-file | 0.26.0 | MIT OR Apache-2.0 |
310
+ | rten-onnx | 0.26.0 | MIT OR Apache-2.0 |
294
311
  | rten-parallel | 0.26.0 | MIT OR Apache-2.0 |
295
312
  | rten-shape-inference | 0.26.0 | MIT OR Apache-2.0 |
296
313
  | rten-simd | 0.26.0 | MIT OR Apache-2.0 |
@@ -303,6 +320,7 @@ Generated by `scripts/collect-notices.mjs` from Cargo.lock (wasm32 target).
303
320
  | scopeguard | 1.2.0 | MIT OR Apache-2.0 |
304
321
  | sec1 | 0.8.1 | Apache-2.0 OR MIT |
305
322
  | self_cell | 1.3.0 | Apache-2.0 OR GPL-2.0-only |
323
+ | send_wrapper | 0.6.0 | MIT/Apache-2.0 |
306
324
  | serde | 1.0.229 | MIT OR Apache-2.0 |
307
325
  | serde_core | 1.0.229 | MIT OR Apache-2.0 |
308
326
  | serde_derive | 1.0.229 | MIT OR Apache-2.0 |
@@ -337,6 +355,7 @@ Generated by `scripts/collect-notices.mjs` from Cargo.lock (wasm32 target).
337
355
  | syn | 2.0.119 | MIT OR Apache-2.0 |
338
356
  | syn | 3.0.6 | MIT OR Apache-2.0 |
339
357
  | synstructure | 0.14.0 | MIT |
358
+ | sys-locale | 0.3.2 | MIT OR Apache-2.0 |
340
359
  | tag_ptr | 0.1.0 | Unlicense OR MIT |
341
360
  | tap | 1.0.1 | MIT |
342
361
  | termcolor | 1.4.1 | Unlicense OR MIT |
@@ -374,9 +393,9 @@ Generated by `scripts/collect-notices.mjs` from Cargo.lock (wasm32 target).
374
393
  | uuid | 1.26.1 | Apache-2.0 OR MIT |
375
394
  | vello_common | 0.0.8 | Apache-2.0 OR MIT |
376
395
  | vello_common | 0.0.9 | Apache-2.0 OR MIT |
377
- | vello_common | 0.1.0 | Apache-2.0 OR MIT |
396
+ | vello_common | 0.2.0 | Apache-2.0 OR MIT |
378
397
  | vello_cpu | 0.0.8 | Apache-2.0 OR MIT |
379
- | vello_cpu | 0.1.0 | Apache-2.0 OR MIT |
398
+ | vello_cpu | 0.2.0 | Apache-2.0 OR MIT |
380
399
  | wasm-bindgen | 0.2.129 | MIT OR Apache-2.0 |
381
400
  | wasm-bindgen-futures | 0.4.79 | MIT OR Apache-2.0 |
382
401
  | wasm-bindgen-macro | 0.2.129 | MIT OR Apache-2.0 |
@@ -398,7 +417,7 @@ Generated by `scripts/collect-notices.mjs` from Cargo.lock (wasm32 target).
398
417
  | write16 | 1.0.0 | Apache-2.0 OR MIT |
399
418
  | writeable | 0.6.4 | Unicode-3.0 |
400
419
  | xmlwriter | 0.1.0 | MIT |
401
- | yoke | 0.8.3 | Unicode-3.0 |
420
+ | yoke | 0.8.4 | Unicode-3.0 |
402
421
  | yoke-derive | 0.8.4 | Unicode-3.0 |
403
422
  | zerocopy | 0.8.59 | BSD-2-Clause OR Apache-2.0 OR MIT |
404
423
  | zerocopy-derive | 0.8.59 | BSD-2-Clause OR Apache-2.0 OR MIT |
@@ -407,8 +426,8 @@ Generated by `scripts/collect-notices.mjs` from Cargo.lock (wasm32 target).
407
426
  | zeroize | 1.9.0 | Apache-2.0 OR MIT |
408
427
  | zeroize_derive | 1.5.0 | Apache-2.0 OR MIT |
409
428
  | zerotrie | 0.2.5 | Unicode-3.0 |
410
- | zerovec | 0.11.8 | Unicode-3.0 |
411
- | zerovec-derive | 0.11.6 | Unicode-3.0 |
429
+ | zerovec | 0.11.9 | Unicode-3.0 |
430
+ | zerovec-derive | 0.11.7 | Unicode-3.0 |
412
431
  | zlib-rs | 0.6.8 | Zlib |
413
432
  | zmij | 1.0.23 | MIT |
414
433
  | zune-core | 0.5.3 | MIT OR Apache-2.0 OR Zlib |