@embedpdf/react 3.0.0-next.12 → 3.0.0-next.13

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.
@@ -1,9 +1,10 @@
1
- import { shallowArray, useCapability, usePage, useSelector } from "./runtime.js";
1
+ import { shallowArray, useCapability, useOptionalCapability, useOptionalSelector, usePage, useSelector } from "./runtime.js";
2
2
  import { t as useAnnotationSelected } from "./annotation-hooks-Df8EmzDO.js";
3
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
4
  import { useCallback, useEffect, useMemo, useRef, useState } from "react";
5
5
  import { InteractionToken } from "@embedpdf/plugin-interaction/contract";
6
6
  import { FormToken } from "@embedpdf/plugin-form";
7
+ import { SignatureToken } from "@embedpdf/plugin-signature/contract";
7
8
  //#region src/form-focus-ring.tsx
8
9
  /**
9
10
  * Paint the form focus indicator above baked PDF appearances and transparent
@@ -221,8 +222,68 @@ function FormWidget({ item, page, appearance }) {
221
222
  page,
222
223
  appearance
223
224
  });
225
+ case "signature": return /* @__PURE__ */ jsx(SignatureWidget, {
226
+ fill,
227
+ item,
228
+ page,
229
+ appearance
230
+ });
224
231
  }
225
232
  }
233
+ /** The form plugin's field key → the engine ref (the inverse of `fieldKeyOf`). */
234
+ const fieldRefOfKey = (key) => key.startsWith("obj:") ? {
235
+ kind: "objectNumber",
236
+ fieldObjectNumber: Number(key.slice(4))
237
+ } : {
238
+ kind: "fqn",
239
+ name: key.slice(4)
240
+ };
241
+ /**
242
+ * A signature field's widget: the picture (the mark drawn into it, once
243
+ * there is one) with a click target on top. Unsigned → "sign here": the
244
+ * field becomes the signature plugin's TARGET, so the next mark picked
245
+ * from a signatures panel goes into it. Signed → `inspect`: the chrome shows
246
+ * what the signature says. Without the signature plugin the widget is
247
+ * picture only — the field plane has no fill control of its own here.
248
+ */
249
+ function SignatureWidget({ fill, item, page, appearance }) {
250
+ const signature = useOptionalCapability(SignatureToken);
251
+ const wrap = useIsolated();
252
+ const events = useWidgetEvents(fill.key, item.ref);
253
+ const b = viewBox(item.box, page);
254
+ const ref = fieldRefOfKey(fill.key);
255
+ const signed = useOptionalSelector(SignatureToken, (c) => c.signatureOf(ref)?.signed ?? fill.signed, fill.signed);
256
+ const actionable = signature != null && (signed || !fill.disabled);
257
+ return /* @__PURE__ */ jsxs("div", {
258
+ ref: wrap,
259
+ ...events,
260
+ style: {
261
+ position: "absolute",
262
+ left: b.left,
263
+ top: b.top,
264
+ width: b.width,
265
+ height: b.height
266
+ },
267
+ children: [/* @__PURE__ */ jsx(Picture, {
268
+ page,
269
+ appearance,
270
+ apBox: item.apBox,
271
+ frame: b
272
+ }), actionable ? /* @__PURE__ */ jsx("button", {
273
+ type: "button",
274
+ "aria-label": fill.label,
275
+ "data-signed": signed ? "" : void 0,
276
+ onClick: () => signed ? signature.inspect(ref) : signature.setTarget(ref),
277
+ style: {
278
+ ...fillControl,
279
+ padding: 0,
280
+ border: 0,
281
+ background: "transparent",
282
+ cursor: "pointer"
283
+ }
284
+ }) : null]
285
+ });
286
+ }
226
287
  function ButtonWidget({ fill, item, page, appearance }) {
227
288
  const form = useCapability(FormToken);
228
289
  const wrap = useIsolated();
@@ -738,6 +799,32 @@ function FillButton({ item, page }) {
738
799
  })
739
800
  });
740
801
  }
802
+ /** The standalone layer's signature control: the same target/inspect
803
+ * hand-off as {@link SignatureWidget}, over the page raster. */
804
+ function FillSignature({ item, page }) {
805
+ const signature = useOptionalCapability(SignatureToken);
806
+ const ref = fieldRefOfKey(item.key);
807
+ const signed = useOptionalSelector(SignatureToken, (c) => c.signatureOf(ref)?.signed ?? item.signed, item.signed);
808
+ const actionable = signature != null && (signed || !item.disabled);
809
+ return /* @__PURE__ */ jsx(FillEventBox, {
810
+ item,
811
+ page,
812
+ cursor: actionable ? "pointer" : "default",
813
+ children: actionable ? /* @__PURE__ */ jsx("button", {
814
+ type: "button",
815
+ "aria-label": item.label,
816
+ "data-signed": signed ? "" : void 0,
817
+ onClick: () => signed ? signature.inspect(ref) : signature.setTarget(ref),
818
+ style: {
819
+ ...fillControl,
820
+ padding: 0,
821
+ border: 0,
822
+ background: "transparent",
823
+ cursor: "inherit"
824
+ }
825
+ }) : null
826
+ });
827
+ }
741
828
  /**
742
829
  * Fill-mode form controls for one page, positioned from the form model's own
743
830
  * widget geometry — the ANNOTATION-LESS path (a fill-only viewer whose page
@@ -776,6 +863,9 @@ function FormLayer() {
776
863
  }, `${item.key}:${item.annotObjectNumber}`) : item.control === "button" ? /* @__PURE__ */ jsx(FillButton, {
777
864
  item,
778
865
  page
866
+ }, `${item.key}:${item.annotObjectNumber}`) : item.control === "signature" ? /* @__PURE__ */ jsx(FillSignature, {
867
+ item,
868
+ page
779
869
  }, `${item.key}:${item.annotObjectNumber}`) : null)
780
870
  });
781
871
  }
@@ -802,4 +892,4 @@ function useFormField() {
802
892
  //#endregion
803
893
  export { useFormSnapshot as a, useFormField as i, formWidgetRenderer as n, useForm as r, FormLayer as t };
804
894
 
805
- //# sourceMappingURL=form-BwrLFpKN.js.map
895
+ //# sourceMappingURL=form-CK3mp99m.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form-CK3mp99m.js","names":[],"sources":["../src/form-focus-ring.tsx","../src/form-listbox.tsx","../src/form.tsx"],"sourcesContent":["import * as React from 'react';\n\nexport interface FormFocusRingProps {\n visible: boolean;\n}\n\n/**\n * Paint the form focus indicator above baked PDF appearances and transparent\n * native controls. Putting an inset outline on the widget wrapper lets an\n * opaque child cover it, which makes rectangular checkboxes and combo boxes\n * appear unfocused even though they are active in the native Tab order.\n */\nexport function FormFocusRing({ visible }: FormFocusRingProps) {\n if (!visible) return null;\n return (\n <span\n aria-hidden=\"true\"\n data-embedpdf-form-focus-ring=\"\"\n style={{\n position: 'absolute',\n inset: 0,\n zIndex: 1,\n boxSizing: 'border-box',\n outline: '2px solid rgba(66, 133, 244, 0.8)',\n outlineOffset: -2,\n pointerEvents: 'none',\n }}\n />\n );\n}\n","import * as React from 'react';\nimport { useEffect, useRef, useState } from 'react';\n\nexport interface NativeListBoxOption {\n label: string;\n value: string;\n}\n\nexport interface NativeListBoxProps {\n ariaLabel: string;\n disabled: boolean;\n multi: boolean;\n options: NativeListBoxOption[];\n selected: string[];\n onSelect(values: string[]): void | Promise<void>;\n onFocus?: React.FocusEventHandler<HTMLSelectElement>;\n onBlur?: React.FocusEventHandler<HTMLSelectElement>;\n style?: React.CSSProperties;\n}\n\n/**\n * A PDF list box needs one owner for pixels, hit-testing, and scrolling. A\n * baked /AP picture with an invisible native select cannot provide that: the\n * browser and PDF each keep an independent top-visible row. This visible\n * native control keeps a local optimistic selection while the engine write is\n * pending and synchronizes when engine truth changes, without remounting the\n * DOM node or resetting its scroll position.\n */\nexport function NativeListBox({\n ariaLabel,\n disabled,\n multi,\n options,\n selected,\n onSelect,\n onFocus,\n onBlur,\n style,\n}: NativeListBoxProps) {\n const [draft, setDraft] = useState<string[]>(() => [...selected]);\n const controlRef = useRef<HTMLSelectElement>(null);\n const selectedRef = useRef(selected);\n selectedRef.current = selected;\n const selectedSignature = JSON.stringify(selected);\n\n useEffect(() => {\n const control = controlRef.current;\n if (!control) return;\n // The Stage's ambient wheel handler lives on an ancestor and\n // preventDefault()s to pan/zoom the page. Stop at the list box so the\n // browser can apply the same wheel event to this control's own scroll box.\n const isolateWheel = (event: WheelEvent) => event.stopPropagation();\n control.addEventListener('wheel', isolateWheel);\n return () => control.removeEventListener('wheel', isolateWheel);\n }, []);\n\n useEffect(() => {\n setDraft([...selectedRef.current]);\n }, [selectedSignature]);\n\n const rollback = () => setDraft([...selectedRef.current]);\n const choose = (values: string[]) => {\n setDraft(values);\n try {\n const result = onSelect(values);\n if (result) void result.catch(rollback);\n } catch {\n rollback();\n }\n };\n\n return (\n <select\n ref={controlRef}\n aria-label={ariaLabel}\n multiple={multi}\n size={Math.max(2, options.length)}\n disabled={disabled}\n value={multi ? draft : (draft[0] ?? '')}\n onFocus={onFocus}\n onBlur={onBlur}\n onChange={(event) =>\n choose(Array.from(event.currentTarget.selectedOptions).map((option) => option.value))\n }\n style={style}\n >\n {options.map((option, index) => (\n <option key={index} value={option.value}>\n {option.label}\n </option>\n ))}\n </select>\n );\n}\n","/**\n * The React view of @embedpdf/plugin-form.\n *\n * TWO fill surfaces, one plugin:\n *\n * 1. `formWidgetRenderer` — the full-viewer path. Widgets are annotations,\n * so the fill controls plug into the annotation stack:\n * `<AnnotationLayer renderers={[formWidgetRenderer]} />` routes every\n * ENGAGED widget here with its live box and its baked /AP raster. The\n * picture IS the resting control (the engine's own rendering of value,\n * check state, borders, fonts); these components add exactly the\n * interaction skin on top:\n *\n * text → picture at rest; click swaps in an <input>/<textarea> (the\n * focused element IS the draft store — the plugin model only\n * learns a value on commit); blur/Enter commits, the engine\n * re-bakes the /AP, the refreshed picture replaces the editor.\n * toggle → the picture is the whole control; click writes the toggled\n * value; the re-baked appearance shows the new check state.\n * combo → an invisible native <select> over the picture: the browser\n * owns the dropdown, the engine owns the resting pixels.\n * list → a visible native <select>: one surface owns pixels, row\n * hit-testing, keyboard selection, and scrolling.\n * button → native keyboard/click target over the picture; activation is\n * delegated to the form plugin's isolated scripting pipeline.\n *\n * 2. `<FormLayer />` — the annotation-less path (fill-only viewers with no\n * annotation plugin): synthetic HTML controls positioned from the form\n * model's own widget geometry. Do NOT mount it next to an AnnotationLayer\n * wired with `formWidgetRenderer` — the controls would double up.\n *\n * Every control isolates its pointerdown from the interaction hub with a\n * NATIVE listener (the FreeText precedent): the Stage listens natively on an\n * ancestor, so React's synthetic events would run too late.\n */\n\n// One-line-per-feature (ADAPTERS.md): registration travels with the UI.\nexport * from '@embedpdf/plugin-form';\nimport * as React from 'react';\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport type { PdfAnnotationEventKind } from '@embedpdf/plugin-actions/contract';\nimport type { AnnotationRef } from '@embedpdf/plugin-annotation/contract';\nimport { FormToken } from '@embedpdf/plugin-form';\nimport { SignatureToken } from '@embedpdf/plugin-signature/contract';\nimport type { FormFieldRef, FillItem, FormFieldDTO } from '@embedpdf/plugin-form';\nimport { InteractionToken } from '@embedpdf/plugin-interaction/contract';\nimport { StageToken } from '@embedpdf/plugin-stage/contract';\nimport type { Rect } from '@embedpdf/core-annotation';\n\nimport { useAnnotationSelected } from './annotation-hooks';\nimport type { AnnotationRenderer, AnnotationRendererProps } from './annotation';\nimport {\n shallowArray,\n useCapability,\n useOptionalCapability,\n useOptionalSelector,\n usePage,\n useSelector,\n} from './runtime';\nimport type { PageContextValue } from './runtime';\nimport { FormFocusRing } from './form-focus-ring';\nimport { NativeListBox } from './form-listbox';\n\n/** Content rect → a view-px box (the page wrapper's own coordinate space). */\nfunction viewBox(r: Rect, page: PageContextValue) {\n const tl = page.transform.toPixels({ x: r.x, y: r.y });\n const br = page.transform.toPixels({ x: r.x + r.width, y: r.y + r.height });\n return { left: tl.x, top: tl.y, width: br.x - tl.x, height: br.y - tl.y };\n}\n\n/**\n * Keep the interaction hub out of gestures that begin inside a fill control.\n * Native listener (not React's) so it runs during real DOM bubbling, before\n * the Stage's own native listener on an ancestor — same trick as FreeText.\n */\nfunction useIsolated<T extends HTMLElement>() {\n const ref = useRef<T>(null);\n useEffect(() => {\n const el = ref.current;\n if (!el) return;\n const stop = (e: Event) => e.stopPropagation();\n el.addEventListener('pointerdown', stop);\n return () => el.removeEventListener('pointerdown', stop);\n }, []);\n return ref;\n}\n\n/**\n * The widget DOM-event feed (Phase 2): wire one widget surface's pointer and\n * focus events to `form.notifyWidgetEvent` — the `/AA` E/X/D/U/Fo/Bl trigger\n * door. Handlers live on the ALWAYS-ACTIVE event surface, never the inner\n * control: \"may edit this field\" and \"may receive PDF action events\" are\n * different rights, and a read-only session (no `doc.forms.fill`) must still\n * see hover tooltips (session Hide needs no write authority).\n */\nfunction useWidgetEvents(\n key: string,\n annotationRef: AnnotationRef | null,\n): Pick<\n React.DOMAttributes<HTMLElement>,\n 'onPointerEnter' | 'onPointerLeave' | 'onPointerDown' | 'onPointerUp' | 'onFocus' | 'onBlur'\n> {\n const form = useCapability(FormToken);\n const refBox = useRef(annotationRef);\n refBox.current = annotationRef;\n return useMemo(() => {\n const notify = (event: PdfAnnotationEventKind) => {\n const target = refBox.current;\n if (target) form.notifyWidgetEvent(key, target, event);\n };\n return {\n onPointerEnter: () => notify('cursorEnter'),\n onPointerLeave: () => notify('cursorExit'),\n onPointerDown: () => notify('mouseDown'),\n onPointerUp: () => notify('mouseUp'),\n // React focus/blur bubble (focusin semantics), so the inner control's\n // focus reaches this surface; blur fires AFTER the control's own\n // commit handler, so a /Bl script always sees the committed value.\n onFocus: () => notify('focus'),\n onBlur: () => notify('blur'),\n };\n }, [form, key]);\n}\n\n/**\n * Widget ACTIVATION: a click on ANY widget runs its `/A`. ISO puts the\n * activate action on the annotation dictionary — any subtype, any field\n * type — so activation is a WIDGET behavior, not a push-button behavior:\n * real-world producers ship \"buttons\" as read-only text fields carrying an\n * `/A` (the Test Lab's Reset/Next/Hide controls), and Acrobat runs them.\n * A widget without an `/A` resolves inert — dispatching is the cheap,\n * honest way to ask (the dispatcher owns `/A`-vs-`/AA U` precedence).\n * Push buttons keep their own gated door: `disabled` still blocks\n * activation there — unchanged shipped semantics.\n */\nfunction useWidgetActivation(key: string, annotationRef: AnnotationRef | null): () => void {\n const form = useCapability(FormToken);\n const refBox = useRef(annotationRef);\n refBox.current = annotationRef;\n return useCallback(() => {\n const target = refBox.current;\n if (target) void form.activateWidget(key, target);\n }, [form, key]);\n}\n\n/* ══════════════════════════ behavior widgets ══════════════════════════ */\n\n/** The baked /AP raster, blitted by its OWN box (exactly like BakedImage). */\nfunction Picture({\n page,\n appearance,\n apBox,\n frame,\n hidden,\n}: {\n page: PageContextValue;\n appearance: { url: string; box: Rect } | null;\n /** The item's live AP box — wins over the fetched box when present. */\n apBox?: Rect;\n /** The positioned wrapper this renders INSIDE (its view box) — the blit is\n * page-frame, so subtract the wrapper's origin. Omit when rendering\n * directly in the layer container. */\n frame?: { left: number; top: number };\n hidden?: boolean;\n}) {\n if (!appearance) return null;\n const b = viewBox(apBox ?? appearance.box, page);\n return (\n <img\n src={appearance.url}\n alt=\"\"\n draggable={false}\n style={{\n position: 'absolute',\n left: b.left - (frame?.left ?? 0),\n top: b.top - (frame?.top ?? 0),\n width: b.width,\n height: b.height,\n // Content-unit sizing; a global `img { max-width: 100% }` reset would\n // otherwise clamp it to the containing block and distort the blit.\n maxWidth: 'none',\n pointerEvents: 'none',\n visibility: hidden ? 'hidden' : 'visible',\n }}\n />\n );\n}\n\ninterface WidgetProps<C extends FillItem['control']> {\n fill: Extract<FillItem, { control: C }>;\n item: AnnotationRendererProps['item'];\n page: PageContextValue;\n appearance: AnnotationRendererProps['appearance'];\n}\n\n/**\n * Dispatch one engaged widget to its fill control. The FIELD plane (value,\n * behavior, disabled) comes from the form plugin's single-widget projection;\n * the WIDGET plane (live box, /DA font, baked raster) rides in on the\n * renderer props — no geometry is read from the form model here.\n */\nfunction FormWidget({ item, page, appearance }: AnnotationRendererProps) {\n const annot = item.ref?.kind === 'objectNumber' ? item.ref.annotObjectNumber : 0;\n // Reference-stable per model change, so the default Object.is equality holds.\n const fill = useSelector(FormToken, (c) => (annot > 0 ? c.fillItem(annot) : null));\n // Field plane not loaded (or no fill control for this family) → picture only.\n if (!fill) return <Picture page={page} appearance={appearance} apBox={item.apBox} />;\n switch (fill.control) {\n case 'text':\n return <TextWidget fill={fill} item={item} page={page} appearance={appearance} />;\n case 'toggle':\n return <ToggleWidget fill={fill} item={item} page={page} appearance={appearance} />;\n case 'choice':\n return <ChoiceWidget fill={fill} item={item} page={page} appearance={appearance} />;\n case 'button':\n return <ButtonWidget fill={fill} item={item} page={page} appearance={appearance} />;\n case 'signature':\n return <SignatureWidget fill={fill} item={item} page={page} appearance={appearance} />;\n }\n}\n\n/** The form plugin's field key → the engine ref (the inverse of `fieldKeyOf`). */\nconst fieldRefOfKey = (key: string): FormFieldRef =>\n key.startsWith('obj:')\n ? { kind: 'objectNumber', fieldObjectNumber: Number(key.slice(4)) }\n : { kind: 'fqn', name: key.slice(4) };\n\n/**\n * A signature field's widget: the picture (the mark drawn into it, once\n * there is one) with a click target on top. Unsigned → \"sign here\": the\n * field becomes the signature plugin's TARGET, so the next mark picked\n * from a signatures panel goes into it. Signed → `inspect`: the chrome shows\n * what the signature says. Without the signature plugin the widget is\n * picture only — the field plane has no fill control of its own here.\n */\nfunction SignatureWidget({ fill, item, page, appearance }: WidgetProps<'signature'>) {\n const signature = useOptionalCapability(SignatureToken);\n const wrap = useIsolated<HTMLDivElement>();\n const events = useWidgetEvents(fill.key, item.ref);\n const b = viewBox(item.box, page);\n const ref = fieldRefOfKey(fill.key);\n // The signature plugin's snapshot is the authority on signed-ness (it\n // re-reads on every new version); the field plane's /V is the fallback.\n const signed = useOptionalSelector(\n SignatureToken,\n (c) => c.signatureOf(ref)?.signed ?? fill.signed,\n fill.signed,\n );\n const actionable = signature != null && (signed || !fill.disabled);\n return (\n <div\n ref={wrap}\n {...events}\n style={{ position: 'absolute', left: b.left, top: b.top, width: b.width, height: b.height }}\n >\n <Picture page={page} appearance={appearance} apBox={item.apBox} frame={b} />\n {actionable ? (\n <button\n type=\"button\"\n aria-label={fill.label}\n data-signed={signed ? '' : undefined}\n onClick={() => (signed ? signature.inspect(ref) : signature.setTarget(ref))}\n style={{\n ...fillControl,\n padding: 0,\n border: 0,\n background: 'transparent',\n cursor: 'pointer',\n }}\n />\n ) : null}\n </div>\n );\n}\n\nfunction ButtonWidget({ fill, item, page, appearance }: WidgetProps<'button'>) {\n const form = useCapability(FormToken);\n const wrap = useIsolated<HTMLDivElement>();\n const events = useWidgetEvents(fill.key, item.ref);\n const b = viewBox(item.box, page);\n // The OUTER div is the event surface — always pointer-active so /AA hover\n // and pointer triggers fire even for a disabled/read-only button; the\n // inner button keeps `disabled` as the ACTIVATION gate only.\n return (\n <div\n ref={wrap}\n {...events}\n style={{\n position: 'absolute',\n left: b.left,\n top: b.top,\n width: b.width,\n height: b.height,\n cursor: fill.disabled ? 'default' : 'pointer',\n pointerEvents: 'auto',\n }}\n >\n <button\n type=\"button\"\n aria-label={fill.label}\n disabled={fill.disabled}\n onClick={() => {\n if (item.ref) void form.activateWidget(fill.key, item.ref);\n }}\n style={{\n position: 'absolute',\n inset: 0,\n width: '100%',\n height: '100%',\n boxSizing: 'border-box',\n padding: 0,\n border: 0,\n background: 'transparent',\n cursor: 'inherit',\n // The event surface is the wrapper; a disabled button must not\n // swallow the pointer stream before it bubbles.\n pointerEvents: fill.disabled ? 'none' : 'auto',\n }}\n >\n <Picture page={page} appearance={appearance} apBox={item.apBox} frame={b} />\n </button>\n </div>\n );\n}\n\nfunction TextWidget({ fill, item, page, appearance }: WidgetProps<'text'>) {\n const form = useCapability(FormToken);\n const wrap = useIsolated<HTMLDivElement>();\n const events = useWidgetEvents(fill.key, item.ref);\n const activate = useWidgetActivation(fill.key, item.ref);\n // The editor is ALWAYS MOUNTED (v2's pattern): transparent over the picture\n // at rest, visible while focused. That makes the DOM the focus manager —\n // native Tab order reaches every field, focus enters edit, blur commits —\n // with zero focus machinery of our own. The focused element holds the\n // draft; the plugin model only learns a value on commit (see model.ts).\n const [focused, setFocused] = useState(false);\n const [draft, setDraft] = useState(fill.value);\n const cancelled = useRef(false);\n // Adopt engine truth whenever it changes under us — but never mid-edit.\n useEffect(() => {\n if (!focused) setDraft(fill.value);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [fill.value, focused]);\n\n const b = viewBox(item.box, page);\n const scale = item.box.width > 0 ? b.width / item.box.width : 1;\n\n // /DA font, scaled to view px. Size 0 means \"auto\" in PDF: approximate with\n // the box height for a single line, Acrobat's 12pt default for multiline.\n const fontSize =\n item.text && item.text.fontSize > 0\n ? item.text.fontSize * scale\n : fill.multiline\n ? 12 * scale\n : Math.max(6, b.height * 0.72);\n const editorStyle: React.CSSProperties = {\n position: 'absolute',\n inset: 0,\n width: '100%',\n height: '100%',\n boxSizing: 'border-box',\n border: 'none',\n outline: focused ? '2px solid rgba(66, 133, 244, 0.8)' : 'none',\n outlineOffset: -2,\n padding: '0 2px',\n margin: 0,\n background: item.style.interiorColor ?? '#fff',\n color: item.text?.fontColor ?? '#000',\n fontFamily: item.text?.fontFamily ?? 'Helvetica, Arial, sans-serif',\n fontSize,\n textAlign: item.text?.textAlign ?? 'left',\n resize: 'none',\n cursor: 'text',\n opacity: focused ? 1 : 0, // rest: the engine's picture IS the field\n // A DISABLED control suppresses click events entirely — it must not\n // swallow the stream before it reaches the wrapper, which owns /A\n // activation (the read-only \"fake button\" pattern) and the /AA feed.\n ...(fill.disabled ? { pointerEvents: 'none' as const } : {}),\n };\n const editorProps = {\n value: draft,\n maxLength: fill.maxLength ?? undefined,\n 'aria-label': fill.label,\n disabled: fill.disabled,\n onFocus: () => setFocused(true),\n onChange: (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) =>\n setDraft(e.target.value),\n onBlur: () => {\n setFocused(false);\n if (cancelled.current) {\n cancelled.current = false;\n setDraft(fill.value);\n return;\n }\n if (draft !== fill.value) void form.setText(fill.key, draft);\n },\n style: editorStyle,\n };\n const onKeys = (e: React.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n if (e.key === 'Escape') {\n cancelled.current = true;\n e.currentTarget.blur();\n }\n if (e.key === 'Enter' && !fill.multiline) e.currentTarget.blur(); // blur commits\n };\n\n return (\n <div\n ref={wrap}\n {...events}\n // ANY widget click runs its /A (see useWidgetActivation): an editable\n // field's focus click bubbles here (Acrobat runs /A on that click\n // too); a read-only field's click lands here directly (the disabled\n // editor is pointer-transparent) — the fake-button pattern.\n onClick={activate}\n style={{\n position: 'absolute',\n left: b.left,\n top: b.top,\n width: b.width,\n height: b.height,\n // Always the event surface (see useWidgetEvents); the editor's own\n // `disabled` keeps read-only fields uneditable and unfocusable.\n pointerEvents: 'auto',\n }}\n >\n <Picture page={page} appearance={appearance} apBox={item.apBox} frame={b} hidden={focused} />\n {fill.multiline ? (\n <textarea {...editorProps} onKeyDown={onKeys} />\n ) : (\n <input {...editorProps} type={fill.password ? 'password' : 'text'} onKeyDown={onKeys} />\n )}\n </div>\n );\n}\n\nfunction ToggleWidget({ fill, item, page, appearance }: WidgetProps<'toggle'>) {\n const form = useCapability(FormToken);\n const wrap = useIsolated<HTMLDivElement>();\n const events = useWidgetEvents(fill.key, item.ref);\n const activate = useWidgetActivation(fill.key, item.ref);\n const [focused, setFocused] = useState(false);\n const b = viewBox(item.box, page);\n const press = () => {\n // Checkbox: click toggles on/off (null clears). Radio: click always\n // selects its own on-state — no untoggle, per PDF/Acrobat convention.\n // Acrobat's order: the VALUE change first, THEN the /A — so an /A\n // script reads the post-toggle state. A read-only toggle still\n // activates (it just doesn't flip).\n const flipped = fill.disabled\n ? undefined\n : form.toggle(fill.key, fill.kind === 'checkbox' && fill.checked ? null : fill.onState);\n void Promise.resolve(flipped).then(activate, activate);\n };\n return (\n <div\n ref={wrap}\n role={fill.kind === 'checkbox' ? 'checkbox' : 'radio'}\n aria-checked={fill.checked}\n aria-label={fill.label}\n tabIndex={fill.disabled ? -1 : 0}\n {...events}\n onClick={press}\n onFocus={(e) => {\n setFocused(true);\n events.onFocus?.(e);\n }}\n onBlur={(e) => {\n setFocused(false);\n events.onBlur?.(e);\n }}\n onKeyDown={(e) => {\n if (e.key === ' ' || e.key === 'Enter') {\n e.preventDefault();\n press();\n }\n }}\n style={{\n position: 'absolute',\n left: b.left,\n top: b.top,\n width: b.width,\n height: b.height,\n cursor: fill.disabled ? 'default' : 'pointer',\n pointerEvents: 'auto', // always the event surface; toggle() self-gates\n outline: 'none', // the top-layer FormFocusRing owns focus indication\n }}\n >\n <Picture page={page} appearance={appearance} apBox={item.apBox} frame={b} />\n <FormFocusRing visible={focused} />\n </div>\n );\n}\n\nfunction ChoiceWidget(props: WidgetProps<'choice'>) {\n return props.fill.kind === 'list' ? <ListBoxWidget {...props} /> : <ComboBoxWidget {...props} />;\n}\n\nfunction ChoiceFrame({\n fill,\n item,\n page,\n focused,\n innerRef,\n children,\n}: Pick<WidgetProps<'choice'>, 'fill' | 'item' | 'page'> & {\n focused: boolean;\n innerRef: React.RefObject<HTMLDivElement>;\n children: React.ReactNode;\n}) {\n const events = useWidgetEvents(fill.key, item.ref);\n const activate = useWidgetActivation(fill.key, item.ref);\n const b = viewBox(item.box, page);\n return (\n <div\n ref={innerRef}\n {...events}\n onClick={activate}\n style={{\n position: 'absolute',\n left: b.left,\n top: b.top,\n width: b.width,\n height: b.height,\n pointerEvents: 'auto',\n outline: 'none', // the top-layer FormFocusRing owns focus indication\n }}\n >\n {children}\n <FormFocusRing visible={focused} />\n </div>\n );\n}\n\nfunction ComboBoxWidget({ fill, item, page, appearance }: WidgetProps<'choice'>) {\n const form = useCapability(FormToken);\n const wrap = useIsolated<HTMLDivElement>();\n const [focused, setFocused] = useState(false);\n const b = viewBox(item.box, page);\n return (\n <ChoiceFrame fill={fill} item={item} page={page} focused={focused} innerRef={wrap}>\n <Picture page={page} appearance={appearance} apBox={item.apBox} frame={b} />\n {/* A combo's popup is separate from its resting box, so the baked\n appearance and transparent native trigger do not maintain competing\n in-place row geometry or scroll state. */}\n <select\n key={fill.selected.join('\\0')}\n defaultValue={fill.selected[0] ?? ''}\n aria-label={fill.label}\n disabled={fill.disabled}\n onFocus={() => setFocused(true)}\n onBlur={() => setFocused(false)}\n onChange={(e) => {\n const values = Array.from(e.currentTarget.selectedOptions).map((o) => o.value);\n void form.choose(fill.key, values);\n }}\n style={{\n position: 'absolute',\n inset: 0,\n width: '100%',\n height: '100%',\n opacity: 0,\n cursor: fill.disabled ? 'default' : 'pointer',\n // A disabled control suppresses clicks — the frame owns /A\n // activation and must still receive them.\n ...(fill.disabled ? { pointerEvents: 'none' as const } : {}),\n }}\n >\n {fill.options.map((o, i) => (\n <option key={i} value={o.value}>\n {o.label}\n </option>\n ))}\n </select>\n </ChoiceFrame>\n );\n}\n\nfunction ListBoxWidget({ fill, item, page }: WidgetProps<'choice'>) {\n const form = useCapability(FormToken);\n const wrap = useIsolated<HTMLDivElement>();\n const [focused, setFocused] = useState(false);\n const b = viewBox(item.box, page);\n const scale = item.box.width > 0 ? b.width / item.box.width : 1;\n const strokeWidth = item.style.strokeWidth * scale;\n const borderStyle = item.style.border.kind === 'dashed' ? 'dashed' : 'solid';\n return (\n <ChoiceFrame fill={fill} item={item} page={page} focused={focused} innerRef={wrap}>\n <NativeListBox\n ariaLabel={fill.label}\n disabled={fill.disabled}\n multi={fill.multi}\n options={fill.options}\n selected={fill.selected}\n onFocus={() => setFocused(true)}\n onBlur={() => setFocused(false)}\n onSelect={(values) => form.choose(fill.key, values)}\n style={{\n position: 'absolute',\n inset: 0,\n width: '100%',\n height: '100%',\n boxSizing: 'border-box',\n margin: 0,\n padding: 0,\n borderWidth: strokeWidth,\n borderStyle,\n borderColor: item.style.color,\n borderRadius: 0,\n outline: 'none',\n background: item.style.interiorColor ?? '#fff',\n color: item.text?.fontColor ?? '#000',\n fontFamily: item.text?.fontFamily ?? 'Helvetica, Arial, sans-serif',\n fontSize: (item.text?.fontSize || 12) * scale,\n textAlign: item.text?.textAlign ?? 'left',\n cursor: fill.disabled ? 'default' : 'pointer',\n // A disabled control suppresses clicks — the frame owns /A\n // activation and must still receive them.\n ...(fill.disabled ? { pointerEvents: 'none' as const } : {}),\n }}\n />\n </ChoiceFrame>\n );\n}\n\n/**\n * The form plugin's renderer entry, ready for\n * `<AnnotationLayer renderers={[formWidgetRenderer]} />`. It answers for the\n * PLUGIN-registered 'form-widgets' Behavior — the form plugin decides when\n * widgets are fill controls vs. editable annotations, never the app.\n */\nexport const formWidgetRenderer: AnnotationRenderer = {\n behavior: 'form-widgets',\n component: FormWidget,\n};\n\n/* ══════════════════════ standalone layer (no annotations) ══════════════════ */\n\nconst controlBase: React.CSSProperties = {\n position: 'absolute',\n boxSizing: 'border-box',\n border: '1px solid rgba(56, 88, 233, 0.55)',\n background: 'rgba(255, 255, 255, 0.92)',\n borderRadius: 2,\n font: 'inherit',\n};\n\nconst fillBox = (item: FillItem, page: PageContextValue) => viewBox(item.box, page);\n\n/** The standalone layer's event surface: positions ONE control's box and\n * carries the /AA DOM-event feed — always pointer-active (see\n * useWidgetEvents); the control inside fills it and self-gates edits.\n * With `activate`, a click on the box runs the widget's /A (see\n * useWidgetActivation — activation is a WIDGET behavior); push buttons\n * keep their own gated inner door and do NOT set it. */\nfunction FillEventBox({\n item,\n page,\n cursor,\n activate,\n children,\n}: {\n item: FillItem;\n page: PageContextValue;\n cursor?: string;\n activate?: boolean;\n children: React.ReactNode;\n}) {\n const events = useWidgetEvents(item.key, {\n kind: 'objectNumber',\n pageObjectNumber: page.pon,\n annotObjectNumber: item.annotObjectNumber,\n });\n const onActivate = useWidgetActivation(item.key, {\n kind: 'objectNumber',\n pageObjectNumber: page.pon,\n annotObjectNumber: item.annotObjectNumber,\n });\n const css = fillBox(item, page);\n return (\n <div\n {...events}\n onClick={activate ? onActivate : undefined}\n style={{ position: 'absolute', ...css, pointerEvents: 'auto', ...(cursor ? { cursor } : {}) }}\n >\n {children}\n </div>\n );\n}\n\nconst fillControl: React.CSSProperties = {\n position: 'absolute',\n inset: 0,\n width: '100%',\n height: '100%',\n};\n\n/** Text control: keystrokes stay LOCAL (the input is the draft store);\n * the engine write happens on blur or Enter. */\nfunction FillText({\n item,\n page,\n}: {\n item: Extract<FillItem, { control: 'text' }>;\n page: PageContextValue;\n}) {\n const form = useCapability(FormToken);\n const [draft, setDraft] = useState(item.value);\n // Adopt engine truth whenever it changes under us (remote edit, reset).\n useEffect(() => setDraft(item.value), [item.value]);\n\n const css = fillBox(item, page);\n const fontSize = Math.max(9, Math.min(css.height * 0.62, 24));\n const commit = () => {\n if (draft !== item.value) void form.setText(item.key, draft).catch(() => setDraft(item.value));\n };\n const shared: React.CSSProperties = {\n ...controlBase,\n ...fillControl,\n fontSize,\n padding: '0 3px',\n ...(item.comb ? { letterSpacing: css.width / Math.max(1, item.maxLength ?? 1) / 2 } : {}),\n };\n // A disabled control suppresses clicks — the box owns /A activation and\n // must still receive them (the read-only \"fake button\" pattern).\n const editorGate = item.disabled ? ({ pointerEvents: 'none' } as const) : {};\n return (\n <FillEventBox item={item} page={page} activate>\n {item.multiline ? (\n <textarea\n aria-label={item.label}\n value={draft}\n disabled={item.disabled}\n onChange={(e) => setDraft(e.target.value)}\n onBlur={commit}\n style={{ ...shared, resize: 'none', ...editorGate }}\n />\n ) : (\n <input\n aria-label={item.label}\n type={item.password ? 'password' : 'text'}\n value={draft}\n maxLength={item.maxLength ?? undefined}\n disabled={item.disabled}\n onChange={(e) => setDraft(e.target.value)}\n onBlur={commit}\n onKeyDown={(e) => {\n if (e.key === 'Enter') (e.target as HTMLInputElement).blur();\n }}\n style={{ ...shared, ...editorGate }}\n />\n )}\n </FillEventBox>\n );\n}\n\nfunction FillToggle({\n item,\n page,\n}: {\n item: Extract<FillItem, { control: 'toggle' }>;\n page: PageContextValue;\n}) {\n const form = useCapability(FormToken);\n const activate = useWidgetActivation(item.key, {\n kind: 'objectNumber',\n pageObjectNumber: page.pon,\n annotObjectNumber: item.annotObjectNumber,\n });\n const css = fillBox(item, page);\n const glyphSize = Math.min(css.width, css.height) * 0.72;\n return (\n // `activate` covers the DISABLED path (pointer-transparent button → the\n // box click activates without toggling — a read-only toggle's /A still\n // runs); the enabled button below chains toggle-then-/A itself and\n // stops propagation so the click never double-activates.\n <FillEventBox item={item} page={page} cursor={item.disabled ? 'default' : 'pointer'} activate>\n <button\n role={item.kind}\n aria-checked={item.checked}\n aria-label={item.label}\n disabled={item.disabled}\n onClick={(e) => {\n e.stopPropagation();\n // Checkbox re-click clears; radio click always selects its state.\n // Acrobat's order: the VALUE change first, THEN the /A.\n void Promise.resolve(\n form.toggle(item.key, item.kind === 'checkbox' && item.checked ? null : item.onState),\n ).then(activate, activate);\n }}\n style={{\n ...controlBase,\n ...fillControl,\n cursor: 'inherit',\n display: 'grid',\n placeItems: 'center',\n padding: 0,\n borderRadius: item.kind === 'radio' ? '50%' : 2,\n fontSize: glyphSize,\n lineHeight: 1,\n color: '#1f2a44',\n // A disabled control suppresses clicks — the box must receive them.\n ...(item.disabled ? { pointerEvents: 'none' as const } : {}),\n }}\n >\n {item.checked ? (item.kind === 'radio' ? '●' : '✓') : ''}\n </button>\n </FillEventBox>\n );\n}\n\nfunction FillChoice({\n item,\n page,\n}: {\n item: Extract<FillItem, { control: 'choice' }>;\n page: PageContextValue;\n}) {\n const form = useCapability(FormToken);\n const css = fillBox(item, page);\n // A disabled control suppresses clicks — the box owns /A activation and\n // must still receive them.\n const controlGate = item.disabled ? ({ pointerEvents: 'none' } as const) : {};\n if (item.kind === 'list') {\n return (\n <FillEventBox item={item} page={page} activate>\n <NativeListBox\n ariaLabel={item.label}\n disabled={item.disabled}\n multi={item.multi}\n options={item.options}\n selected={item.selected}\n onSelect={(values) => form.choose(item.key, values)}\n style={{\n ...controlBase,\n ...fillControl,\n fontSize: Math.max(9, Math.min(css.height * 0.55, 18)),\n ...controlGate,\n }}\n />\n </FillEventBox>\n );\n }\n return (\n <FillEventBox item={item} page={page} activate>\n <select\n aria-label={item.label}\n disabled={item.disabled}\n value={item.selected[0] ?? ''}\n onChange={(e) => void form.choose(item.key, [e.target.value])}\n style={{\n ...controlBase,\n ...fillControl,\n fontSize: Math.max(9, Math.min(css.height * 0.55, 18)),\n ...controlGate,\n }}\n >\n {item.selected.length === 0 && <option value=\"\" />}\n {item.options.map((o) => (\n <option key={o.value} value={o.value}>\n {o.label}\n </option>\n ))}\n </select>\n </FillEventBox>\n );\n}\n\nfunction FillButton({\n item,\n page,\n}: {\n item: Extract<FillItem, { control: 'button' }>;\n page: PageContextValue;\n}) {\n const form = useCapability(FormToken);\n return (\n <FillEventBox item={item} page={page} cursor={item.disabled ? 'default' : 'pointer'}>\n <button\n type=\"button\"\n aria-label={item.label}\n disabled={item.disabled}\n onClick={() =>\n void form.activateWidget(item.key, {\n kind: 'objectNumber',\n pageObjectNumber: page.pon,\n annotObjectNumber: item.annotObjectNumber,\n })\n }\n style={{\n ...controlBase,\n ...fillControl,\n padding: 0,\n border: 0,\n background: 'transparent',\n cursor: 'inherit',\n // Events live on the box; a disabled button must not swallow them.\n pointerEvents: item.disabled ? 'none' : 'auto',\n }}\n />\n </FillEventBox>\n );\n}\n\n/** The standalone layer's signature control: the same target/inspect\n * hand-off as {@link SignatureWidget}, over the page raster. */\nfunction FillSignature({\n item,\n page,\n}: {\n item: Extract<FillItem, { control: 'signature' }>;\n page: PageContextValue;\n}) {\n const signature = useOptionalCapability(SignatureToken);\n const ref = fieldRefOfKey(item.key);\n const signed = useOptionalSelector(\n SignatureToken,\n (c) => c.signatureOf(ref)?.signed ?? item.signed,\n item.signed,\n );\n const actionable = signature != null && (signed || !item.disabled);\n return (\n <FillEventBox item={item} page={page} cursor={actionable ? 'pointer' : 'default'}>\n {actionable ? (\n <button\n type=\"button\"\n aria-label={item.label}\n data-signed={signed ? '' : undefined}\n onClick={() => (signed ? signature.inspect(ref) : signature.setTarget(ref))}\n style={{\n ...fillControl,\n padding: 0,\n border: 0,\n background: 'transparent',\n cursor: 'inherit',\n }}\n />\n ) : null}\n </FillEventBox>\n );\n}\n\n/**\n * Fill-mode form controls for one page, positioned from the form model's own\n * widget geometry — the ANNOTATION-LESS path (a fill-only viewer whose page\n * pixels come from an annotated RenderLayer raster). Active whenever the\n * active tool carries the 'form-fill' tag (the built-in pointer/pan tools\n * do); any other tool stands the controls down. Do not mount next to an\n * AnnotationLayer wired with `formWidgetBehaviors`.\n */\nexport function FormLayer() {\n const page = usePage();\n const form = useCapability(FormToken);\n const active = useSelector(InteractionToken, (c) => c.activeTool().enables.has('form-fill'));\n\n useEffect(() => {\n if (active) form.ensureGeom(page.pon);\n }, [active, form, page.pon]);\n\n const items = useSelector(FormToken, (c) => c.fillItems(page.pon), shallowArray);\n if (!active) return null;\n\n return (\n <div style={{ position: 'absolute', inset: 0 }}>\n {items.map((item) =>\n item.control === 'text' ? (\n <FillText key={`${item.key}:${item.annotObjectNumber}`} item={item} page={page} />\n ) : item.control === 'toggle' ? (\n <FillToggle key={`${item.key}:${item.annotObjectNumber}`} item={item} page={page} />\n ) : item.control === 'choice' ? (\n <FillChoice key={`${item.key}:${item.annotObjectNumber}`} item={item} page={page} />\n ) : item.control === 'button' ? (\n <FillButton key={`${item.key}:${item.annotObjectNumber}`} item={item} page={page} />\n ) : item.control === 'signature' ? (\n <FillSignature key={`${item.key}:${item.annotObjectNumber}`} item={item} page={page} />\n ) : null,\n )}\n </div>\n );\n}\n\n/* ═══════════════════════════════ hooks ═══════════════════════════════ */\n\n/** The form capability — values, interchange, design-mode verbs. */\nexport function useForm() {\n return useCapability(FormToken);\n}\n\n/** The reconciled form snapshot (null until the first load lands),\n * re-rendering on every form model change. */\nexport function useFormSnapshot() {\n return useSelector(FormToken, (c) => c.snapshot());\n}\n\n/**\n * The FIELD behind the currently selected widget annotation (single\n * selection), or null. The design-mode join: widget selection lives in the\n * annotation plane, field properties live here.\n */\nexport function useFormField(): FormFieldDTO | null {\n const selected = useAnnotationSelected();\n const widget = selected.length === 1 && selected[0]!.subtype === 'widget' ? selected[0]! : null;\n const objnum = widget && widget.ref.kind === 'objectNumber' ? widget.ref.annotObjectNumber : 0;\n return useSelector(FormToken, (c) => (objnum > 0 ? c.fieldForWidget(objnum) : null));\n}\n"],"mappings":";;;;;;;;;;;;;;AAYA,SAAgB,cAAc,EAAE,WAA+B;CAC7D,IAAI,CAAC,SAAS,OAAO;CACrB,OACE,oBAAC,QAAD;EACE,eAAY;EACZ,iCAA8B;EAC9B,OAAO;GACL,UAAU;GACV,OAAO;GACP,QAAQ;GACR,WAAW;GACX,SAAS;GACT,eAAe;GACf,eAAe;EACjB;CACD,CAAA;AAEL;;;;;;;;;;;ACDA,SAAgB,cAAc,EAC5B,WACA,UACA,OACA,SACA,UACA,UACA,SACA,QACA,SACqB;CACrB,MAAM,CAAC,OAAO,YAAY,eAAyB,CAAC,GAAG,QAAQ,CAAC;CAChE,MAAM,aAAa,OAA0B,IAAI;CACjD,MAAM,cAAc,OAAO,QAAQ;CACnC,YAAY,UAAU;CACt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AsB;CACvC,MAAM,SAAS,SAAS,WAAW,KAAK,SAAS,EAAE,CAAE,YAAY,WAAW,SAAS,KAAM;CAC3F,MAAM,SAAS,UAAU,OAAO,IAAI,SAAS,iBAAiB,OAAO,IAAI,oBAAoB;CAC7F,OAAO,YAAY,YAAY,MAAO,SAAS,IAAI,EAAE,eAAe,MAAM,IAAI,IAAK;AACrF"}
package/dist/form.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  require("./runtime.cjs");
3
- const require_form = require("./form-D-ZSfGmB.cjs");
3
+ const require_form = require("./form-BVumS7up.cjs");
4
4
  exports.FormLayer = require_form.FormLayer;
5
5
  exports.formWidgetRenderer = require_form.formWidgetRenderer;
6
6
  exports.useForm = require_form.useForm;
package/dist/form.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { o as AnnotationRenderer } from "./annotation-BCED_p9H.cjs";
2
- import { t as FormSnapshot } from "./AnnotationListSnapshot-x6tKulNV-B799rYyi.cjs";
2
+ import { t as FormSnapshot } from "./AnnotationListSnapshot-D3mFut1e-C_GMpK25.cjs";
3
3
  import { FormFieldDTO } from "@embedpdf/plugin-form";
4
4
  export * from "@embedpdf/plugin-form";
5
5
  //#region src/form.d.ts
package/dist/form.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { o as AnnotationRenderer } from "./annotation-k38KDlIZ.js";
2
- import { t as FormSnapshot } from "./AnnotationListSnapshot-x6tKulNV-B799rYyi.js";
2
+ import { t as FormSnapshot } from "./AnnotationListSnapshot-D3mFut1e-C_GMpK25.js";
3
3
  import { FormFieldDTO } from "@embedpdf/plugin-form";
4
4
  export * from "@embedpdf/plugin-form";
5
5
  //#region src/form.d.ts
package/dist/form.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import "./runtime.js";
2
- import { a as useFormSnapshot, i as useFormField, n as formWidgetRenderer, r as useForm, t as FormLayer } from "./form-BwrLFpKN.js";
2
+ import { a as useFormSnapshot, i as useFormField, n as formWidgetRenderer, r as useForm, t as FormLayer } from "./form-CK3mp99m.js";
3
3
  export * from "@embedpdf/plugin-form";
4
4
  export { FormLayer, formWidgetRenderer, useForm, useFormField, useFormSnapshot };
package/dist/index.cjs CHANGED
@@ -18,9 +18,10 @@ const require_views = require("./views.cjs");
18
18
  const require_page_edit = require("./page-edit.cjs");
19
19
  const require_metadata = require("./metadata.cjs");
20
20
  const require_redaction = require("./redaction.cjs");
21
- const require_form = require("./form-D-ZSfGmB.cjs");
22
- const require_search = require("./search.cjs");
23
21
  const require_stamp = require("./stamp.cjs");
22
+ const require_signature = require("./signature.cjs");
23
+ const require_form = require("./form-BVumS7up.cjs");
24
+ const require_search = require("./search.cjs");
24
25
  const require_i18n = require("./i18n.cjs");
25
26
  const require_commands = require("./commands.cjs");
26
27
  const require_shell = require("./shell.cjs");
@@ -87,6 +88,7 @@ exports.useCommentThreads = require_annotation.useCommentThreads;
87
88
  exports.useComments = require_annotation.useComments;
88
89
  exports.useCommentsHydration = require_annotation.useCommentsHydration;
89
90
  exports.useDocumentId = require_runtime.useDocumentId;
91
+ exports.useDocumentProtection = require_signature.useDocumentProtection;
90
92
  exports.useDocumentStatus = require_runtime.useDocumentStatus;
91
93
  exports.useDocuments = require_runtime.useDocuments;
92
94
  exports.useFilePickerProvider = require_annotation.useFilePickerProvider;
@@ -117,6 +119,12 @@ exports.useSelectionFlags = require_annotation.useSelectionFlags;
117
119
  exports.useSelectionProps = require_annotation.useSelectionProps;
118
120
  exports.useSelector = require_runtime.useSelector;
119
121
  exports.useShell = require_shell.useShell;
122
+ exports.useSignature = require_signature.useSignature;
123
+ exports.useSignatureEvent = require_signature.useSignatureEvent;
124
+ exports.useSignatureSnapshot = require_signature.useSignatureSnapshot;
125
+ exports.useSignatureTarget = require_signature.useSignatureTarget;
126
+ exports.useSignatureVerdicts = require_signature.useSignatureVerdicts;
127
+ exports.useSignerRows = require_signature.useSignerRows;
120
128
  exports.useStage = require_stage.useStage;
121
129
  exports.useStageSettings = require_stage.useStageSettings;
122
130
  exports.useStamp = require_stamp.useStamp;
@@ -241,6 +249,15 @@ Object.keys(_embedpdf_plugin_redaction).forEach(function(k) {
241
249
  }
242
250
  });
243
251
  });
252
+ var _embedpdf_plugin_signature = require("@embedpdf/plugin-signature");
253
+ Object.keys(_embedpdf_plugin_signature).forEach(function(k) {
254
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
255
+ enumerable: true,
256
+ get: function() {
257
+ return _embedpdf_plugin_signature[k];
258
+ }
259
+ });
260
+ });
244
261
  var _embedpdf_plugin_stamp = require("@embedpdf/plugin-stamp");
245
262
  Object.keys(_embedpdf_plugin_stamp).forEach(function(k) {
246
263
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
package/dist/index.d.cts CHANGED
@@ -17,6 +17,7 @@ import { UseViews, useViews } from "./views.cjs";
17
17
  import { usePageEditor } from "./page-edit.cjs";
18
18
  import { useMetadata } from "./metadata.cjs";
19
19
  import { usePendingRedactions, useRedaction } from "./redaction.cjs";
20
+ import { SignerRow, useDocumentProtection, useSignature, useSignatureEvent, useSignatureSnapshot, useSignatureTarget, useSignatureVerdicts, useSignerRows } from "./signature.cjs";
20
21
  import { SearchLayer, useSearch, useSearchState } from "./search.cjs";
21
22
  import { ByteStore, indexedDbByteStore, useArmStampAsset, useStamp, useStampAssetPreviewUrl, useStampAssets, useStampLibraries } from "./stamp.cjs";
22
23
  import { MenusHandle, SurfaceHandle, useMenus, useShell, useSurface } from "./shell.cjs";
@@ -33,12 +34,13 @@ export * from "@embedpdf/plugin-view-manager";
33
34
  export * from "@embedpdf/plugin-page-edit";
34
35
  export * from "@embedpdf/plugin-metadata";
35
36
  export * from "@embedpdf/plugin-redaction";
37
+ export * from "@embedpdf/plugin-signature";
36
38
  export * from "@embedpdf/plugin-stamp";
37
39
  export * from "@embedpdf/plugin-shell";
38
40
  export * from "@embedpdf/core-ui";
39
41
  declare namespace index_d_exports {
40
- export { ActionsUiHandlers, AnchorTarget, Anchored, AnchoredPlacement, AnchoredProps, AnnotationDraftMenu, AnnotationDraftMenuProps, AnnotationFlags, AnnotationLayer, AnnotationLayerProps, AnnotationMenu, AnnotationMenuProps, AnnotationProps, AnnotationPropsPatch, AnnotationRenderer, AnnotationRendererProps, Border, ByteStore, CollapsedGroupView, CommentThreadView, CreationDraftAnchor, CustomSlotCtx, DocumentGate, DocumentGateProps, DocumentScope, DocumentScopeProps, EmbedPDF, FormLayer, Geom, GroupDisclosureView, LineEnding, LineEndings, LinkLayer, LinkLayerProps, MenusHandle, OverflowMenuView, PageContextValue, PagePointerSource, PageProvider, PageView, PageViewProps, ProjectorBinding, ProjectorProvider, PropKey, PropSpec, RenderItem, RenderLayer, RenderLayerProps, Scrollbar, ScrollbarAxis, ScrollbarProps, SearchLayer, SelectionAnchor, SelectionClipboard, SelectionClipboardProps, SelectionFlags, SelectionHandles, SelectionHandlesProps, SelectionLayer, SelectionLayerProps, SelectionMenu, SelectionMenuProps, SelectionProps, Stage, StageProps, StageTokenProp, StripView, StripViewGroup, Style, SurfaceHandle, TextAlign, TextStyle, ToolCursorImage, ToolCursorSpec, Toolbar, ToolbarProps, UseViews, ViewProjector, Viewer, ViewerProps, copySelection, createClickCounter, enrichCommentThreads, filePickerProvider, indexedDbByteStore, isMacPlatform, makePageContext, openLinkTarget, sameAnchor, sameCreationDraftAnchor, shallowArray, useActionsUiAdapter, useActiveDocumentId, useAnnotation, useAnnotationDefaults, useAnnotationSelected, useAnnotationSelection, useArmStampAsset, useCapability, useCapabilityEvent, useCommand, useCommandShortcuts, useCommands, useCommentThread, useCommentThreads, useComments, useCommentsHydration, useDocumentId, useDocumentStatus, useDocuments, useFilePickerProvider, useForm, useFormField, useI18n, useKernel, useKernelValue, useLayout, useLink, useLocale, useMenus, useMetadata, useOptionalCapability, useOptionalSelector, usePage, usePageEditor, usePageList, usePages, usePendingRedactions, useProjectorBinding, useRedaction, useScrollMetrics, useSearch, useSearchState, useSelection, useSelectionFlags, useSelectionProps, useSelector, useShell, useStage, useStageSettings, useStamp, useStampAssetPreviewUrl, useStampAssets, useStampLibraries, useStripView, useSurface, useT, useTool, useToolCursor, useViews, useZoom, vibrationFeedback, wkFeedback };
42
+ export { ActionsUiHandlers, AnchorTarget, Anchored, AnchoredPlacement, AnchoredProps, AnnotationDraftMenu, AnnotationDraftMenuProps, AnnotationFlags, AnnotationLayer, AnnotationLayerProps, AnnotationMenu, AnnotationMenuProps, AnnotationProps, AnnotationPropsPatch, AnnotationRenderer, AnnotationRendererProps, Border, ByteStore, CollapsedGroupView, CommentThreadView, CreationDraftAnchor, CustomSlotCtx, DocumentGate, DocumentGateProps, DocumentScope, DocumentScopeProps, EmbedPDF, FormLayer, Geom, GroupDisclosureView, LineEnding, LineEndings, LinkLayer, LinkLayerProps, MenusHandle, OverflowMenuView, PageContextValue, PagePointerSource, PageProvider, PageView, PageViewProps, ProjectorBinding, ProjectorProvider, PropKey, PropSpec, RenderItem, RenderLayer, RenderLayerProps, Scrollbar, ScrollbarAxis, ScrollbarProps, SearchLayer, SelectionAnchor, SelectionClipboard, SelectionClipboardProps, SelectionFlags, SelectionHandles, SelectionHandlesProps, SelectionLayer, SelectionLayerProps, SelectionMenu, SelectionMenuProps, SelectionProps, SignerRow, Stage, StageProps, StageTokenProp, StripView, StripViewGroup, Style, SurfaceHandle, TextAlign, TextStyle, ToolCursorImage, ToolCursorSpec, Toolbar, ToolbarProps, UseViews, ViewProjector, Viewer, ViewerProps, copySelection, createClickCounter, enrichCommentThreads, filePickerProvider, indexedDbByteStore, isMacPlatform, makePageContext, openLinkTarget, sameAnchor, sameCreationDraftAnchor, shallowArray, useActionsUiAdapter, useActiveDocumentId, useAnnotation, useAnnotationDefaults, useAnnotationSelected, useAnnotationSelection, useArmStampAsset, useCapability, useCapabilityEvent, useCommand, useCommandShortcuts, useCommands, useCommentThread, useCommentThreads, useComments, useCommentsHydration, useDocumentId, useDocumentProtection, useDocumentStatus, useDocuments, useFilePickerProvider, useForm, useFormField, useI18n, useKernel, useKernelValue, useLayout, useLink, useLocale, useMenus, useMetadata, useOptionalCapability, useOptionalSelector, usePage, usePageEditor, usePageList, usePages, usePendingRedactions, useProjectorBinding, useRedaction, useScrollMetrics, useSearch, useSearchState, useSelection, useSelectionFlags, useSelectionProps, useSelector, useShell, useSignature, useSignatureEvent, useSignatureSnapshot, useSignatureTarget, useSignatureVerdicts, useSignerRows, useStage, useStageSettings, useStamp, useStampAssetPreviewUrl, useStampAssets, useStampLibraries, useStripView, useSurface, useT, useTool, useToolCursor, useViews, useZoom, vibrationFeedback, wkFeedback };
41
43
  }
42
44
  //#endregion
43
- export { type ActionsUiHandlers, type AnchorTarget, Anchored, type AnchoredPlacement, AnchoredProps, AnnotationDraftMenu, AnnotationDraftMenuProps, type AnnotationFlags, AnnotationLayer, AnnotationLayerProps, AnnotationMenu, AnnotationMenuProps, type AnnotationProps, type AnnotationPropsPatch, AnnotationRenderer, AnnotationRendererProps, type Border, type ByteStore, CollapsedGroupView, CommentThreadView, type CreationDraftAnchor, CustomSlotCtx, DocumentGate, DocumentGateProps, DocumentScope, DocumentScopeProps, EmbedPDF, FormLayer, type Geom, GroupDisclosureView, type LineEnding, type LineEndings, LinkLayer, LinkLayerProps, MenusHandle, OverflowMenuView, PageContextValue, PagePointerSource, PageProvider, PageView, PageViewProps, ProjectorBinding, ProjectorProvider, type PropKey, type PropSpec, type RenderItem, RenderLayer, RenderLayerProps, Scrollbar, ScrollbarAxis, ScrollbarProps, SearchLayer, type SelectionAnchor, SelectionClipboard, SelectionClipboardProps, type SelectionFlags, SelectionHandles, SelectionHandlesProps, SelectionLayer, SelectionLayerProps, SelectionMenu, SelectionMenuProps, type SelectionProps, Stage, StageProps, StageTokenProp, StripView, StripViewGroup, type Style, SurfaceHandle, type TextAlign, type TextStyle, ToolCursorImage, ToolCursorSpec, Toolbar, ToolbarProps, UseViews, type ViewProjector, Viewer, ViewerProps, copySelection, createClickCounter, enrichCommentThreads, filePickerProvider, indexedDbByteStore, isMacPlatform, makePageContext, openLinkTarget, sameAnchor, sameCreationDraftAnchor, shallowArray, useActionsUiAdapter, useActiveDocumentId, useAnnotation, useAnnotationDefaults, useAnnotationSelected, useAnnotationSelection, useArmStampAsset, useCapability, useCapabilityEvent, useCommand, useCommandShortcuts, useCommands, useCommentThread, useCommentThreads, useComments, useCommentsHydration, useDocumentId, useDocumentStatus, useDocuments, useFilePickerProvider, useForm, useFormField, useI18n, useKernel, useKernelValue, useLayout, useLink, useLocale, useMenus, useMetadata, useOptionalCapability, useOptionalSelector, usePage, usePageEditor, usePageList, usePages, usePendingRedactions, useProjectorBinding, useRedaction, useScrollMetrics, useSearch, useSearchState, useSelection, useSelectionFlags, useSelectionProps, useSelector, useShell, useStage, useStageSettings, useStamp, useStampAssetPreviewUrl, useStampAssets, useStampLibraries, useStripView, useSurface, useT, useTool, useToolCursor, useViews, useZoom, vibrationFeedback, wkFeedback };
45
+ export { type ActionsUiHandlers, type AnchorTarget, Anchored, type AnchoredPlacement, AnchoredProps, AnnotationDraftMenu, AnnotationDraftMenuProps, type AnnotationFlags, AnnotationLayer, AnnotationLayerProps, AnnotationMenu, AnnotationMenuProps, type AnnotationProps, type AnnotationPropsPatch, AnnotationRenderer, AnnotationRendererProps, type Border, type ByteStore, CollapsedGroupView, CommentThreadView, type CreationDraftAnchor, CustomSlotCtx, DocumentGate, DocumentGateProps, DocumentScope, DocumentScopeProps, EmbedPDF, FormLayer, type Geom, GroupDisclosureView, type LineEnding, type LineEndings, LinkLayer, LinkLayerProps, MenusHandle, OverflowMenuView, PageContextValue, PagePointerSource, PageProvider, PageView, PageViewProps, ProjectorBinding, ProjectorProvider, type PropKey, type PropSpec, type RenderItem, RenderLayer, RenderLayerProps, Scrollbar, ScrollbarAxis, ScrollbarProps, SearchLayer, type SelectionAnchor, SelectionClipboard, SelectionClipboardProps, type SelectionFlags, SelectionHandles, SelectionHandlesProps, SelectionLayer, SelectionLayerProps, SelectionMenu, SelectionMenuProps, type SelectionProps, SignerRow, Stage, StageProps, StageTokenProp, StripView, StripViewGroup, type Style, SurfaceHandle, type TextAlign, type TextStyle, ToolCursorImage, ToolCursorSpec, Toolbar, ToolbarProps, UseViews, type ViewProjector, Viewer, ViewerProps, copySelection, createClickCounter, enrichCommentThreads, filePickerProvider, indexedDbByteStore, isMacPlatform, makePageContext, openLinkTarget, sameAnchor, sameCreationDraftAnchor, shallowArray, useActionsUiAdapter, useActiveDocumentId, useAnnotation, useAnnotationDefaults, useAnnotationSelected, useAnnotationSelection, useArmStampAsset, useCapability, useCapabilityEvent, useCommand, useCommandShortcuts, useCommands, useCommentThread, useCommentThreads, useComments, useCommentsHydration, useDocumentId, useDocumentProtection, useDocumentStatus, useDocuments, useFilePickerProvider, useForm, useFormField, useI18n, useKernel, useKernelValue, useLayout, useLink, useLocale, useMenus, useMetadata, useOptionalCapability, useOptionalSelector, usePage, usePageEditor, usePageList, usePages, usePendingRedactions, useProjectorBinding, useRedaction, useScrollMetrics, useSearch, useSearchState, useSelection, useSelectionFlags, useSelectionProps, useSelector, useShell, useSignature, useSignatureEvent, useSignatureSnapshot, useSignatureTarget, useSignatureVerdicts, useSignerRows, useStage, useStageSettings, useStamp, useStampAssetPreviewUrl, useStampAssets, useStampLibraries, useStripView, useSurface, useT, useTool, useToolCursor, useViews, useZoom, vibrationFeedback, wkFeedback };
44
46
  //# sourceMappingURL=index.d.cts.map
package/dist/index.d.ts CHANGED
@@ -17,6 +17,7 @@ import { UseViews, useViews } from "./views.js";
17
17
  import { usePageEditor } from "./page-edit.js";
18
18
  import { useMetadata } from "./metadata.js";
19
19
  import { usePendingRedactions, useRedaction } from "./redaction.js";
20
+ import { SignerRow, useDocumentProtection, useSignature, useSignatureEvent, useSignatureSnapshot, useSignatureTarget, useSignatureVerdicts, useSignerRows } from "./signature.js";
20
21
  import { SearchLayer, useSearch, useSearchState } from "./search.js";
21
22
  import { ByteStore, indexedDbByteStore, useArmStampAsset, useStamp, useStampAssetPreviewUrl, useStampAssets, useStampLibraries } from "./stamp.js";
22
23
  import { MenusHandle, SurfaceHandle, useMenus, useShell, useSurface } from "./shell.js";
@@ -32,13 +33,14 @@ export * from "@embedpdf/plugin-view-manager";
32
33
  export * from "@embedpdf/plugin-page-edit";
33
34
  export * from "@embedpdf/plugin-metadata";
34
35
  export * from "@embedpdf/plugin-redaction";
36
+ export * from "@embedpdf/plugin-signature";
35
37
  export * from "@embedpdf/plugin-stamp";
36
38
  export * from "@embedpdf/plugin-commands";
37
39
  export * from "@embedpdf/plugin-shell";
38
40
  export * from "@embedpdf/core-ui";
39
41
  declare namespace index_d_exports {
40
- export { ActionsUiHandlers, AnchorTarget, Anchored, AnchoredPlacement, AnchoredProps, AnnotationDraftMenu, AnnotationDraftMenuProps, AnnotationFlags, AnnotationLayer, AnnotationLayerProps, AnnotationMenu, AnnotationMenuProps, AnnotationProps, AnnotationPropsPatch, AnnotationRenderer, AnnotationRendererProps, Border, ByteStore, CollapsedGroupView, CommentThreadView, CreationDraftAnchor, CustomSlotCtx, DocumentGate, DocumentGateProps, DocumentScope, DocumentScopeProps, EmbedPDF, FormLayer, Geom, GroupDisclosureView, LineEnding, LineEndings, LinkLayer, LinkLayerProps, MenusHandle, OverflowMenuView, PageContextValue, PagePointerSource, PageProvider, PageView, PageViewProps, ProjectorBinding, ProjectorProvider, PropKey, PropSpec, RenderItem, RenderLayer, RenderLayerProps, Scrollbar, ScrollbarAxis, ScrollbarProps, SearchLayer, SelectionAnchor, SelectionClipboard, SelectionClipboardProps, SelectionFlags, SelectionHandles, SelectionHandlesProps, SelectionLayer, SelectionLayerProps, SelectionMenu, SelectionMenuProps, SelectionProps, Stage, StageProps, StageTokenProp, StripView, StripViewGroup, Style, SurfaceHandle, TextAlign, TextStyle, ToolCursorImage, ToolCursorSpec, Toolbar, ToolbarProps, UseViews, ViewProjector, Viewer, ViewerProps, copySelection, createClickCounter, enrichCommentThreads, filePickerProvider, indexedDbByteStore, isMacPlatform, makePageContext, openLinkTarget, sameAnchor, sameCreationDraftAnchor, shallowArray, useActionsUiAdapter, useActiveDocumentId, useAnnotation, useAnnotationDefaults, useAnnotationSelected, useAnnotationSelection, useArmStampAsset, useCapability, useCapabilityEvent, useCommand, useCommandShortcuts, useCommands, useCommentThread, useCommentThreads, useComments, useCommentsHydration, useDocumentId, useDocumentStatus, useDocuments, useFilePickerProvider, useForm, useFormField, useI18n, useKernel, useKernelValue, useLayout, useLink, useLocale, useMenus, useMetadata, useOptionalCapability, useOptionalSelector, usePage, usePageEditor, usePageList, usePages, usePendingRedactions, useProjectorBinding, useRedaction, useScrollMetrics, useSearch, useSearchState, useSelection, useSelectionFlags, useSelectionProps, useSelector, useShell, useStage, useStageSettings, useStamp, useStampAssetPreviewUrl, useStampAssets, useStampLibraries, useStripView, useSurface, useT, useTool, useToolCursor, useViews, useZoom, vibrationFeedback, wkFeedback };
42
+ export { ActionsUiHandlers, AnchorTarget, Anchored, AnchoredPlacement, AnchoredProps, AnnotationDraftMenu, AnnotationDraftMenuProps, AnnotationFlags, AnnotationLayer, AnnotationLayerProps, AnnotationMenu, AnnotationMenuProps, AnnotationProps, AnnotationPropsPatch, AnnotationRenderer, AnnotationRendererProps, Border, ByteStore, CollapsedGroupView, CommentThreadView, CreationDraftAnchor, CustomSlotCtx, DocumentGate, DocumentGateProps, DocumentScope, DocumentScopeProps, EmbedPDF, FormLayer, Geom, GroupDisclosureView, LineEnding, LineEndings, LinkLayer, LinkLayerProps, MenusHandle, OverflowMenuView, PageContextValue, PagePointerSource, PageProvider, PageView, PageViewProps, ProjectorBinding, ProjectorProvider, PropKey, PropSpec, RenderItem, RenderLayer, RenderLayerProps, Scrollbar, ScrollbarAxis, ScrollbarProps, SearchLayer, SelectionAnchor, SelectionClipboard, SelectionClipboardProps, SelectionFlags, SelectionHandles, SelectionHandlesProps, SelectionLayer, SelectionLayerProps, SelectionMenu, SelectionMenuProps, SelectionProps, SignerRow, Stage, StageProps, StageTokenProp, StripView, StripViewGroup, Style, SurfaceHandle, TextAlign, TextStyle, ToolCursorImage, ToolCursorSpec, Toolbar, ToolbarProps, UseViews, ViewProjector, Viewer, ViewerProps, copySelection, createClickCounter, enrichCommentThreads, filePickerProvider, indexedDbByteStore, isMacPlatform, makePageContext, openLinkTarget, sameAnchor, sameCreationDraftAnchor, shallowArray, useActionsUiAdapter, useActiveDocumentId, useAnnotation, useAnnotationDefaults, useAnnotationSelected, useAnnotationSelection, useArmStampAsset, useCapability, useCapabilityEvent, useCommand, useCommandShortcuts, useCommands, useCommentThread, useCommentThreads, useComments, useCommentsHydration, useDocumentId, useDocumentProtection, useDocumentStatus, useDocuments, useFilePickerProvider, useForm, useFormField, useI18n, useKernel, useKernelValue, useLayout, useLink, useLocale, useMenus, useMetadata, useOptionalCapability, useOptionalSelector, usePage, usePageEditor, usePageList, usePages, usePendingRedactions, useProjectorBinding, useRedaction, useScrollMetrics, useSearch, useSearchState, useSelection, useSelectionFlags, useSelectionProps, useSelector, useShell, useSignature, useSignatureEvent, useSignatureSnapshot, useSignatureTarget, useSignatureVerdicts, useSignerRows, useStage, useStageSettings, useStamp, useStampAssetPreviewUrl, useStampAssets, useStampLibraries, useStripView, useSurface, useT, useTool, useToolCursor, useViews, useZoom, vibrationFeedback, wkFeedback };
41
43
  }
42
44
  //#endregion
43
- export { type ActionsUiHandlers, type AnchorTarget, Anchored, type AnchoredPlacement, AnchoredProps, AnnotationDraftMenu, AnnotationDraftMenuProps, type AnnotationFlags, AnnotationLayer, AnnotationLayerProps, AnnotationMenu, AnnotationMenuProps, type AnnotationProps, type AnnotationPropsPatch, AnnotationRenderer, AnnotationRendererProps, type Border, type ByteStore, CollapsedGroupView, CommentThreadView, type CreationDraftAnchor, CustomSlotCtx, DocumentGate, DocumentGateProps, DocumentScope, DocumentScopeProps, EmbedPDF, FormLayer, type Geom, GroupDisclosureView, type LineEnding, type LineEndings, LinkLayer, LinkLayerProps, MenusHandle, OverflowMenuView, PageContextValue, PagePointerSource, PageProvider, PageView, PageViewProps, ProjectorBinding, ProjectorProvider, type PropKey, type PropSpec, type RenderItem, RenderLayer, RenderLayerProps, Scrollbar, ScrollbarAxis, ScrollbarProps, SearchLayer, type SelectionAnchor, SelectionClipboard, SelectionClipboardProps, type SelectionFlags, SelectionHandles, SelectionHandlesProps, SelectionLayer, SelectionLayerProps, SelectionMenu, SelectionMenuProps, type SelectionProps, Stage, StageProps, StageTokenProp, StripView, StripViewGroup, type Style, SurfaceHandle, type TextAlign, type TextStyle, ToolCursorImage, ToolCursorSpec, Toolbar, ToolbarProps, UseViews, type ViewProjector, Viewer, ViewerProps, copySelection, createClickCounter, enrichCommentThreads, filePickerProvider, indexedDbByteStore, isMacPlatform, makePageContext, openLinkTarget, sameAnchor, sameCreationDraftAnchor, shallowArray, useActionsUiAdapter, useActiveDocumentId, useAnnotation, useAnnotationDefaults, useAnnotationSelected, useAnnotationSelection, useArmStampAsset, useCapability, useCapabilityEvent, useCommand, useCommandShortcuts, useCommands, useCommentThread, useCommentThreads, useComments, useCommentsHydration, useDocumentId, useDocumentStatus, useDocuments, useFilePickerProvider, useForm, useFormField, useI18n, useKernel, useKernelValue, useLayout, useLink, useLocale, useMenus, useMetadata, useOptionalCapability, useOptionalSelector, usePage, usePageEditor, usePageList, usePages, usePendingRedactions, useProjectorBinding, useRedaction, useScrollMetrics, useSearch, useSearchState, useSelection, useSelectionFlags, useSelectionProps, useSelector, useShell, useStage, useStageSettings, useStamp, useStampAssetPreviewUrl, useStampAssets, useStampLibraries, useStripView, useSurface, useT, useTool, useToolCursor, useViews, useZoom, vibrationFeedback, wkFeedback };
45
+ export { type ActionsUiHandlers, type AnchorTarget, Anchored, type AnchoredPlacement, AnchoredProps, AnnotationDraftMenu, AnnotationDraftMenuProps, type AnnotationFlags, AnnotationLayer, AnnotationLayerProps, AnnotationMenu, AnnotationMenuProps, type AnnotationProps, type AnnotationPropsPatch, AnnotationRenderer, AnnotationRendererProps, type Border, type ByteStore, CollapsedGroupView, CommentThreadView, type CreationDraftAnchor, CustomSlotCtx, DocumentGate, DocumentGateProps, DocumentScope, DocumentScopeProps, EmbedPDF, FormLayer, type Geom, GroupDisclosureView, type LineEnding, type LineEndings, LinkLayer, LinkLayerProps, MenusHandle, OverflowMenuView, PageContextValue, PagePointerSource, PageProvider, PageView, PageViewProps, ProjectorBinding, ProjectorProvider, type PropKey, type PropSpec, type RenderItem, RenderLayer, RenderLayerProps, Scrollbar, ScrollbarAxis, ScrollbarProps, SearchLayer, type SelectionAnchor, SelectionClipboard, SelectionClipboardProps, type SelectionFlags, SelectionHandles, SelectionHandlesProps, SelectionLayer, SelectionLayerProps, SelectionMenu, SelectionMenuProps, type SelectionProps, SignerRow, Stage, StageProps, StageTokenProp, StripView, StripViewGroup, type Style, SurfaceHandle, type TextAlign, type TextStyle, ToolCursorImage, ToolCursorSpec, Toolbar, ToolbarProps, UseViews, type ViewProjector, Viewer, ViewerProps, copySelection, createClickCounter, enrichCommentThreads, filePickerProvider, indexedDbByteStore, isMacPlatform, makePageContext, openLinkTarget, sameAnchor, sameCreationDraftAnchor, shallowArray, useActionsUiAdapter, useActiveDocumentId, useAnnotation, useAnnotationDefaults, useAnnotationSelected, useAnnotationSelection, useArmStampAsset, useCapability, useCapabilityEvent, useCommand, useCommandShortcuts, useCommands, useCommentThread, useCommentThreads, useComments, useCommentsHydration, useDocumentId, useDocumentProtection, useDocumentStatus, useDocuments, useFilePickerProvider, useForm, useFormField, useI18n, useKernel, useKernelValue, useLayout, useLink, useLocale, useMenus, useMetadata, useOptionalCapability, useOptionalSelector, usePage, usePageEditor, usePageList, usePages, usePendingRedactions, useProjectorBinding, useRedaction, useScrollMetrics, useSearch, useSearchState, useSelection, useSelectionFlags, useSelectionProps, useSelector, useShell, useSignature, useSignatureEvent, useSignatureSnapshot, useSignatureTarget, useSignatureVerdicts, useSignerRows, useStage, useStageSettings, useStamp, useStampAssetPreviewUrl, useStampAssets, useStampLibraries, useStripView, useSurface, useT, useTool, useToolCursor, useViews, useZoom, vibrationFeedback, wkFeedback };
44
46
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -17,9 +17,10 @@ import { useViews } from "./views.js";
17
17
  import { usePageEditor } from "./page-edit.js";
18
18
  import { useMetadata } from "./metadata.js";
19
19
  import { usePendingRedactions, useRedaction } from "./redaction.js";
20
- import { i as useFormField, r as useForm, t as FormLayer } from "./form-BwrLFpKN.js";
21
- import { SearchLayer, useSearch, useSearchState } from "./search.js";
22
20
  import { indexedDbByteStore, useArmStampAsset, useStamp, useStampAssetPreviewUrl, useStampAssets, useStampLibraries } from "./stamp.js";
21
+ import { useDocumentProtection, useSignature, useSignatureEvent, useSignatureSnapshot, useSignatureTarget, useSignatureVerdicts, useSignerRows } from "./signature.js";
22
+ import { i as useFormField, r as useForm, t as FormLayer } from "./form-CK3mp99m.js";
23
+ import { SearchLayer, useSearch, useSearchState } from "./search.js";
23
24
  import { useI18n, useLocale, useT } from "./i18n.js";
24
25
  import { isMacPlatform, useCommand, useCommandShortcuts, useCommands } from "./commands.js";
25
26
  import { useMenus, useShell, useSurface } from "./shell.js";
@@ -35,8 +36,9 @@ export * from "@embedpdf/plugin-view-manager";
35
36
  export * from "@embedpdf/plugin-page-edit";
36
37
  export * from "@embedpdf/plugin-metadata";
37
38
  export * from "@embedpdf/plugin-redaction";
39
+ export * from "@embedpdf/plugin-signature";
38
40
  export * from "@embedpdf/plugin-stamp";
39
41
  export * from "@embedpdf/plugin-commands";
40
42
  export * from "@embedpdf/plugin-shell";
41
43
  export * from "@embedpdf/core-ui";
42
- export { Anchored, AnnotationDraftMenu, AnnotationLayer, AnnotationMenu, DocumentGate, DocumentScope, EmbedPDF, FormLayer, LinkLayer, PagePointerSource, PageProvider, PageView, ProjectorProvider, RenderLayer, Scrollbar, SearchLayer, SelectionClipboard, SelectionHandles, SelectionLayer, SelectionMenu, Stage, Toolbar, Viewer, copySelection, createClickCounter, enrichCommentThreads, filePickerProvider, indexedDbByteStore, isMacPlatform, makePageContext, openLinkTarget, sameAnchor, sameCreationDraftAnchor, shallowArray, useActionsUiAdapter, useActiveDocumentId, useAnnotation, useAnnotationDefaults, useAnnotationSelected, useAnnotationSelection, useArmStampAsset, useCapability, useCapabilityEvent, useCommand, useCommandShortcuts, useCommands, useCommentThread, useCommentThreads, useComments, useCommentsHydration, useDocumentId, useDocumentStatus, useDocuments, useFilePickerProvider, useForm, useFormField, useI18n, useKernel, useKernelValue, useLayout, useLink, useLocale, useMenus, useMetadata, useOptionalCapability, useOptionalSelector, usePage, usePageEditor, usePageList, usePages, usePendingRedactions, useProjectorBinding, useRedaction, useScrollMetrics, useSearch, useSearchState, useSelection, useSelectionFlags, useSelectionProps, useSelector, useShell, useStage, useStageSettings, useStamp, useStampAssetPreviewUrl, useStampAssets, useStampLibraries, useStripView, useSurface, useT, useTool, useToolCursor, useViews, useZoom, vibrationFeedback, wkFeedback };
44
+ export { Anchored, AnnotationDraftMenu, AnnotationLayer, AnnotationMenu, DocumentGate, DocumentScope, EmbedPDF, FormLayer, LinkLayer, PagePointerSource, PageProvider, PageView, ProjectorProvider, RenderLayer, Scrollbar, SearchLayer, SelectionClipboard, SelectionHandles, SelectionLayer, SelectionMenu, Stage, Toolbar, Viewer, copySelection, createClickCounter, enrichCommentThreads, filePickerProvider, indexedDbByteStore, isMacPlatform, makePageContext, openLinkTarget, sameAnchor, sameCreationDraftAnchor, shallowArray, useActionsUiAdapter, useActiveDocumentId, useAnnotation, useAnnotationDefaults, useAnnotationSelected, useAnnotationSelection, useArmStampAsset, useCapability, useCapabilityEvent, useCommand, useCommandShortcuts, useCommands, useCommentThread, useCommentThreads, useComments, useCommentsHydration, useDocumentId, useDocumentProtection, useDocumentStatus, useDocuments, useFilePickerProvider, useForm, useFormField, useI18n, useKernel, useKernelValue, useLayout, useLink, useLocale, useMenus, useMetadata, useOptionalCapability, useOptionalSelector, usePage, usePageEditor, usePageList, usePages, usePendingRedactions, useProjectorBinding, useRedaction, useScrollMetrics, useSearch, useSearchState, useSelection, useSelectionFlags, useSelectionProps, useSelector, useShell, useSignature, useSignatureEvent, useSignatureSnapshot, useSignatureTarget, useSignatureVerdicts, useSignerRows, useStage, useStageSettings, useStamp, useStampAssetPreviewUrl, useStampAssets, useStampLibraries, useStripView, useSurface, useT, useTool, useToolCursor, useViews, useZoom, vibrationFeedback, wkFeedback };
package/dist/search.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { n as SearchQuery } from "./AnnotationListSnapshot-x6tKulNV-B799rYyi.cjs";
1
+ import { n as SearchQuery } from "./AnnotationListSnapshot-D3mFut1e-C_GMpK25.cjs";
2
2
  import * as React from "react";
3
3
  export * from "@embedpdf/plugin-search";
4
4
  //#region src/search.d.ts
package/dist/search.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { n as SearchQuery } from "./AnnotationListSnapshot-x6tKulNV-B799rYyi.js";
1
+ import { n as SearchQuery } from "./AnnotationListSnapshot-D3mFut1e-C_GMpK25.js";
2
2
  import * as React from "react";
3
3
  export * from "@embedpdf/plugin-search";
4
4
  //#region src/search.d.ts
@@ -0,0 +1,81 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ require("./rolldown-runtime-DDXJien1.cjs");
3
+ const require_runtime = require("./runtime.cjs");
4
+ const require_stamp = require("./stamp.cjs");
5
+ let react = require("react");
6
+ let _embedpdf_plugin_signature = require("@embedpdf/plugin-signature");
7
+ let _embedpdf_plugin_stamp_contract = require("@embedpdf/plugin-stamp/contract");
8
+ //#region src/signature.tsx
9
+ /**
10
+ * The React view of @embedpdf/plugin-signature: the act of signing for the
11
+ * surrounding `DocumentScope`, its live facts (snapshot, verdicts,
12
+ * protection, target), and the one derivation a signatures panel needs —
13
+ * the people (libraries of kind `signatures`) with their marks.
14
+ *
15
+ * const signature = useSignature();
16
+ * await signature.placeMark({ assetId }, { field: target }); // sign / fill / ask, by mode
17
+ */
18
+ /** The signature capability for the surrounding document. */
19
+ function useSignature() {
20
+ return require_runtime.useCapability(_embedpdf_plugin_signature.SignatureToken);
21
+ }
22
+ /** The last signature snapshot (null until the first read lands). */
23
+ function useSignatureSnapshot() {
24
+ return require_runtime.useSelector(_embedpdf_plugin_signature.SignatureToken, (c) => c.snapshot());
25
+ }
26
+ /** The last validation (null until one ran). */
27
+ function useSignatureVerdicts() {
28
+ return require_runtime.useSelector(_embedpdf_plugin_signature.SignatureToken, (c) => c.verdicts());
29
+ }
30
+ /** What the document's signatures forbid (null when nothing is signed or not yet read). */
31
+ function useDocumentProtection() {
32
+ return require_runtime.useSelector(_embedpdf_plugin_signature.SignatureToken, (c) => c.protection());
33
+ }
34
+ /** The field the next picked mark goes to, and whether a sign/fill is in flight. */
35
+ function useSignatureTarget() {
36
+ return {
37
+ target: require_runtime.useSelector(_embedpdf_plugin_signature.SignatureToken, (c) => c.target()),
38
+ busy: require_runtime.useSelector(_embedpdf_plugin_signature.SignatureToken, (c) => c.busy())
39
+ };
40
+ }
41
+ /** Subscribe to the plugin's change events (signed / filled / ask / inspect / target / validated …). */
42
+ function useSignatureEvent(handler) {
43
+ require_runtime.useCapabilityEvent(_embedpdf_plugin_signature.SignatureToken, (c) => c.onChanged, handler);
44
+ }
45
+ /**
46
+ * The people whose marks this browser holds — one row per library of kind
47
+ * `signatures`. Purely derived from the stamp plugin: rename, delete, and
48
+ * export are the library verbs; nothing is stored beyond the file.
49
+ */
50
+ function useSignerRows() {
51
+ const libraries = require_stamp.useStampLibraries({ kind: _embedpdf_plugin_signature.SIGNATURES_LIBRARY_KIND });
52
+ const assets = require_runtime.useSelector(_embedpdf_plugin_stamp_contract.StampToken, (c) => c.assets(), require_runtime.shallowArray);
53
+ return (0, react.useMemo)(() => libraries.map((library) => {
54
+ const own = assets.filter((asset) => asset.libraryId === library.id);
55
+ return {
56
+ libraryId: library.id,
57
+ name: library.name,
58
+ library,
59
+ signatures: own.filter((asset) => (0, _embedpdf_plugin_signature.markRoleOf)(asset) === "signature"),
60
+ initials: own.find((asset) => (0, _embedpdf_plugin_signature.markRoleOf)(asset) === "initials") ?? null
61
+ };
62
+ }), [libraries, assets]);
63
+ }
64
+ //#endregion
65
+ exports.useDocumentProtection = useDocumentProtection;
66
+ exports.useSignature = useSignature;
67
+ exports.useSignatureEvent = useSignatureEvent;
68
+ exports.useSignatureSnapshot = useSignatureSnapshot;
69
+ exports.useSignatureTarget = useSignatureTarget;
70
+ exports.useSignatureVerdicts = useSignatureVerdicts;
71
+ exports.useSignerRows = useSignerRows;
72
+ Object.keys(_embedpdf_plugin_signature).forEach(function(k) {
73
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
74
+ enumerable: true,
75
+ get: function() {
76
+ return _embedpdf_plugin_signature[k];
77
+ }
78
+ });
79
+ });
80
+
81
+ //# sourceMappingURL=signature.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signature.cjs","names":["useCapability","SignatureToken","useSelector","useStampLibraries","SIGNATURES_LIBRARY_KIND","StampToken","shallowArray"],"sources":["../src/signature.tsx"],"sourcesContent":["/**\n * The React view of @embedpdf/plugin-signature: the act of signing for the\n * surrounding `DocumentScope`, its live facts (snapshot, verdicts,\n * protection, target), and the one derivation a signatures panel needs —\n * the people (libraries of kind `signatures`) with their marks.\n *\n * const signature = useSignature();\n * await signature.placeMark({ assetId }, { field: target }); // sign / fill / ask, by mode\n */\nimport { useMemo } from 'react';\nimport {\n markRoleOf,\n SIGNATURES_LIBRARY_KIND,\n SignatureToken,\n type DocumentProtection,\n type FormFieldRef,\n type SignatureCapability,\n type SignatureChange,\n type SignatureSnapshot,\n type SignatureVerdict,\n} from '@embedpdf/plugin-signature';\nimport { StampToken, type StampAsset, type StampLibrary } from '@embedpdf/plugin-stamp/contract';\n\nimport { shallowArray, useCapability, useCapabilityEvent, useSelector } from './runtime';\nimport { useStampLibraries } from './stamp';\n\n// One-line-per-feature: registration travels with the UI.\nexport * from '@embedpdf/plugin-signature';\n\n/** The signature capability for the surrounding document. */\nexport function useSignature(): SignatureCapability {\n return useCapability(SignatureToken);\n}\n\n/** The last signature snapshot (null until the first read lands). */\nexport function useSignatureSnapshot(): SignatureSnapshot | null {\n return useSelector(SignatureToken, (c) => c.snapshot());\n}\n\n/** The last validation (null until one ran). */\nexport function useSignatureVerdicts(): SignatureVerdict[] | null {\n return useSelector(SignatureToken, (c) => c.verdicts());\n}\n\n/** What the document's signatures forbid (null when nothing is signed or not yet read). */\nexport function useDocumentProtection(): DocumentProtection | null {\n return useSelector(SignatureToken, (c) => c.protection());\n}\n\n/** The field the next picked mark goes to, and whether a sign/fill is in flight. */\nexport function useSignatureTarget(): { target: FormFieldRef | null; busy: boolean } {\n const target = useSelector(SignatureToken, (c) => c.target());\n const busy = useSelector(SignatureToken, (c) => c.busy());\n return { target, busy };\n}\n\n/** Subscribe to the plugin's change events (signed / filled / ask / inspect / target / validated …). */\nexport function useSignatureEvent(handler: (event: SignatureChange) => void): void {\n useCapabilityEvent(SignatureToken, (c) => c.onChanged, handler);\n}\n\n/** One person: a library of kind `signatures` with its marks split by role. */\nexport interface SignerRow {\n libraryId: string;\n name: string;\n library: StampLibrary;\n signatures: StampAsset[];\n initials: StampAsset | null;\n}\n\n/**\n * The people whose marks this browser holds — one row per library of kind\n * `signatures`. Purely derived from the stamp plugin: rename, delete, and\n * export are the library verbs; nothing is stored beyond the file.\n */\nexport function useSignerRows(): SignerRow[] {\n const libraries = useStampLibraries({ kind: SIGNATURES_LIBRARY_KIND });\n const assets = useSelector(StampToken, (c) => c.assets(), shallowArray);\n return useMemo(\n () =>\n libraries.map((library) => {\n const own = assets.filter((asset) => asset.libraryId === library.id);\n return {\n libraryId: library.id,\n name: library.name,\n library,\n signatures: own.filter((asset) => markRoleOf(asset) === 'signature'),\n initials: own.find((asset) => markRoleOf(asset) === 'initials') ?? null,\n };\n }),\n [libraries, assets],\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AA8BA,SAAgB,eAAoC;CAClD,OAAOA,gBAAAA,cAAcC,2B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Change, SignatureSnapshot, SignatureVerdict } from "@embedpdf/plugin-signature";
2
+ import { StampAsset, StampLibrary } from "@embedpdf/plugin-stamp/contract";
3
+ export * from "@embedpdf/plugin-signature";
4
+ //#region src/signature.d.ts
5
+ /** The signature capability for the surrounding document. */
6
+ declare function useSignature(): SignatureCapability;
7
+ /** The last signature snapshot (null until the first read lands). */
8
+ declare function useSignatureSnapshot(): SignatureSnapshot | null;
9
+ /** The last validation (null until one ran). */
10
+ declare function useSignatureVerdicts(): SignatureVerdict[] | null;
11
+ /** What the document's signatures forbid (null when nothing is signed or not yet read). */
12
+ declare function useDocumentProtection(): DocumentProtection | null;
13
+ /** The field the next picked mark goes to, and whether a sign/fill is in flight. */
14
+ declare function useSignatureTarget(): {
15
+ target: FormFieldRef | null;
16
+ busy: boolean;
17
+ };
18
+ /** Subscribe to the plugin's change events (signed / filled / ask / inspect / target / validated …). */
19
+ declare function useSignatureEvent(handler: (event: SignatureChange) => void): void;
20
+ /** One person: a library of kind `signatures` with its marks split by role. */
21
+ interface SignerRow {
22
+ libraryId: string;
23
+ name: string;
24
+ library: StampLibrary;
25
+ signatures: StampAsset[];
26
+ initials: StampAsset | null;
27
+ }
28
+ /**
29
+ * The people whose marks this browser holds — one row per library of kind
30
+ * `signatures`. Purely derived from the stamp plugin: rename, delete, and
31
+ * export are the library verbs; nothing is stored beyond the file.
32
+ */
33
+ declare function useSignerRows(): SignerRow[];
34
+ //#endregion
35
+ export { SignerRow, useDocumentProtection, useSignature, useSignatureEvent, useSignatureSnapshot, useSignatureTarget, useSignatureVerdicts, useSignerRows };
36
+ //# sourceMappingURL=signature.d.cts.map