@embedpdf/plugin-redaction 2.15.0 → 3.0.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +192 -21
- package/README.md +109 -0
- package/dist/index.cjs +227 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +89 -0
- package/dist/index.d.ts +89 -1
- package/dist/index.js +220 -1532
- package/dist/index.js.map +1 -1
- package/package.json +22 -67
- package/dist/lib/actions.d.ts +0 -113
- package/dist/lib/handlers/index.d.ts +0 -0
- package/dist/lib/index.d.ts +0 -11
- package/dist/lib/manifest.d.ts +0 -4
- package/dist/lib/redaction-plugin.d.ts +0 -153
- package/dist/lib/reducer.d.ts +0 -6
- package/dist/lib/selectors.d.ts +0 -5
- package/dist/lib/tools.d.ts +0 -64
- package/dist/lib/types.d.ts +0 -142
- package/dist/preact/adapter.d.ts +0 -10
- package/dist/preact/annotation.d.ts +0 -1
- package/dist/preact/core.d.ts +0 -1
- package/dist/preact/index.cjs +0 -2
- package/dist/preact/index.cjs.map +0 -1
- package/dist/preact/index.d.ts +0 -1
- package/dist/preact/index.js +0 -520
- package/dist/preact/index.js.map +0 -1
- package/dist/preact/utils.d.ts +0 -1
- package/dist/react/adapter.d.ts +0 -2
- package/dist/react/annotation.d.ts +0 -1
- package/dist/react/core.d.ts +0 -1
- package/dist/react/index.cjs +0 -2
- package/dist/react/index.cjs.map +0 -1
- package/dist/react/index.d.ts +0 -1
- package/dist/react/index.js +0 -519
- package/dist/react/index.js.map +0 -1
- package/dist/react/utils.d.ts +0 -1
- package/dist/shared/components/annotations/index.d.ts +0 -2
- package/dist/shared/components/annotations/redact-area.d.ts +0 -18
- package/dist/shared/components/annotations/redact-highlight.d.ts +0 -18
- package/dist/shared/components/highlight.d.ts +0 -14
- package/dist/shared/components/index.d.ts +0 -5
- package/dist/shared/components/marquee-redact.d.ts +0 -15
- package/dist/shared/components/pending-redactions.d.ts +0 -12
- package/dist/shared/components/redact-renderer-registration.d.ts +0 -5
- package/dist/shared/components/redact-renderers.d.ts +0 -7
- package/dist/shared/components/redaction-layer.d.ts +0 -16
- package/dist/shared/components/selection-redact.d.ts +0 -7
- package/dist/shared/components/types.d.ts +0 -9
- package/dist/shared/hooks/index.d.ts +0 -1
- package/dist/shared/hooks/use-redaction.d.ts +0 -15
- package/dist/shared/index.d.ts +0 -4
- package/dist/shared-preact/components/annotations/index.d.ts +0 -2
- package/dist/shared-preact/components/annotations/redact-area.d.ts +0 -18
- package/dist/shared-preact/components/annotations/redact-highlight.d.ts +0 -18
- package/dist/shared-preact/components/highlight.d.ts +0 -14
- package/dist/shared-preact/components/index.d.ts +0 -5
- package/dist/shared-preact/components/marquee-redact.d.ts +0 -15
- package/dist/shared-preact/components/pending-redactions.d.ts +0 -12
- package/dist/shared-preact/components/redact-renderer-registration.d.ts +0 -5
- package/dist/shared-preact/components/redact-renderers.d.ts +0 -7
- package/dist/shared-preact/components/redaction-layer.d.ts +0 -16
- package/dist/shared-preact/components/selection-redact.d.ts +0 -7
- package/dist/shared-preact/components/types.d.ts +0 -9
- package/dist/shared-preact/hooks/index.d.ts +0 -1
- package/dist/shared-preact/hooks/use-redaction.d.ts +0 -15
- package/dist/shared-preact/index.d.ts +0 -4
- package/dist/shared-react/components/annotations/index.d.ts +0 -2
- package/dist/shared-react/components/annotations/redact-area.d.ts +0 -18
- package/dist/shared-react/components/annotations/redact-highlight.d.ts +0 -18
- package/dist/shared-react/components/highlight.d.ts +0 -14
- package/dist/shared-react/components/index.d.ts +0 -5
- package/dist/shared-react/components/marquee-redact.d.ts +0 -15
- package/dist/shared-react/components/pending-redactions.d.ts +0 -12
- package/dist/shared-react/components/redact-renderer-registration.d.ts +0 -5
- package/dist/shared-react/components/redact-renderers.d.ts +0 -7
- package/dist/shared-react/components/redaction-layer.d.ts +0 -16
- package/dist/shared-react/components/selection-redact.d.ts +0 -7
- package/dist/shared-react/components/types.d.ts +0 -9
- package/dist/shared-react/hooks/index.d.ts +0 -1
- package/dist/shared-react/hooks/use-redaction.d.ts +0 -15
- package/dist/shared-react/index.d.ts +0 -4
- package/dist/svelte/components/RedactRendererRegistration.svelte.d.ts +0 -7
- package/dist/svelte/components/annotations/RedactArea.svelte.d.ts +0 -5
- package/dist/svelte/components/annotations/RedactHighlight.svelte.d.ts +0 -5
- package/dist/svelte/components/annotations/index.d.ts +0 -2
- package/dist/svelte/components/highlight.svelte.d.ts +0 -14
- package/dist/svelte/components/index.d.ts +0 -8
- package/dist/svelte/components/marquee-redact.svelte.d.ts +0 -16
- package/dist/svelte/components/pending-redactions.svelte.d.ts +0 -15
- package/dist/svelte/components/redact-renderers.d.ts +0 -7
- package/dist/svelte/components/redaction-layer.svelte.d.ts +0 -20
- package/dist/svelte/components/selection-redact.svelte.d.ts +0 -8
- package/dist/svelte/hooks/index.d.ts +0 -1
- package/dist/svelte/hooks/use-redaction.svelte.d.ts +0 -21
- package/dist/svelte/index.cjs +0 -2
- package/dist/svelte/index.cjs.map +0 -1
- package/dist/svelte/index.d.ts +0 -5
- package/dist/svelte/index.js +0 -801
- package/dist/svelte/index.js.map +0 -1
- package/dist/svelte/types.d.ts +0 -10
- package/dist/vue/components/annotations/index.d.ts +0 -2
- package/dist/vue/components/annotations/redact-area.vue.d.ts +0 -6
- package/dist/vue/components/annotations/redact-highlight.vue.d.ts +0 -6
- package/dist/vue/components/highlight.vue.d.ts +0 -17
- package/dist/vue/components/index.d.ts +0 -8
- package/dist/vue/components/marquee-redact.vue.d.ts +0 -19
- package/dist/vue/components/pending-redactions.vue.d.ts +0 -68
- package/dist/vue/components/redact-renderer-registration.vue.d.ts +0 -13
- package/dist/vue/components/redact-renderers.d.ts +0 -7
- package/dist/vue/components/redaction-layer.vue.d.ts +0 -50
- package/dist/vue/components/selection-redact.vue.d.ts +0 -8
- package/dist/vue/components/types.d.ts +0 -9
- package/dist/vue/hooks/index.d.ts +0 -1
- package/dist/vue/hooks/use-redaction.d.ts +0 -12
- package/dist/vue/index.cjs +0 -2
- package/dist/vue/index.cjs.map +0 -1
- package/dist/vue/index.d.ts +0 -5
- package/dist/vue/index.js +0 -638
- package/dist/vue/index.js.map +0 -1
package/dist/svelte/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/svelte/components/annotations/RedactHighlight.svelte","../../src/svelte/components/annotations/RedactArea.svelte","../../src/svelte/components/redact-renderers.ts","../../src/svelte/components/RedactRendererRegistration.svelte","../../src/svelte/hooks/use-redaction.svelte.ts","../../src/svelte/components/highlight.svelte","../../src/svelte/components/marquee-redact.svelte","../../src/svelte/components/pending-redactions.svelte","../../src/svelte/components/selection-redact.svelte","../../src/svelte/components/redaction-layer.svelte","../../src/svelte/index.ts"],"sourcesContent":["<script lang=\"ts\">\n import type { AnnotationRendererProps } from '@embedpdf/plugin-annotation/svelte';\n import type { PdfRedactAnnoObject } from '@embedpdf/models';\n import {\n PdfStandardFont,\n PdfTextAlignment,\n standardFontCssProperties,\n textAlignmentToCss,\n } from '@embedpdf/models';\n\n let { annotation, isSelected, scale, onClick }: AnnotationRendererProps<PdfRedactAnnoObject> =\n $props();\n let isHovered = $state(false);\n\n const object = $derived(annotation.object);\n\n const segmentRects = $derived(object.segmentRects ?? []);\n const rect = $derived(object.rect);\n\n // C - Border/stroke color\n const strokeColor = $derived(object.strokeColor ?? '#FF0000');\n // IC - Interior color (background fill when redaction is applied)\n const color = $derived(object.color ?? '#000000');\n // CA - Opacity (0-1)\n const opacity = $derived(object.opacity ?? 1);\n // OC - Overlay text color (Adobe extension), fallback to fontColor\n const textColor = $derived(object.fontColor ?? object.overlayColor ?? '#FFFFFF');\n // Overlay text properties\n const overlayText = $derived(object.overlayText);\n const overlayTextRepeat = $derived(object.overlayTextRepeat ?? false);\n const fontSize = $derived(object.fontSize ?? 12);\n const fontFamily = $derived(object.fontFamily ?? PdfStandardFont.Helvetica);\n const fontCss = $derived(standardFontCssProperties(fontFamily));\n const textAlign = $derived(object.textAlign ?? PdfTextAlignment.Center);\n\n // Calculate how many times to repeat text (approximate)\n function renderOverlayText(): string | null {\n if (!overlayText) return null;\n if (!overlayTextRepeat) return overlayText;\n // Repeat text multiple times to fill the space\n const reps = 10;\n return Array(reps).fill(overlayText).join(' ');\n }\n\n const justifyContent = $derived(\n textAlign === PdfTextAlignment.Left\n ? 'flex-start'\n : textAlign === PdfTextAlignment.Right\n ? 'flex-end'\n : 'center',\n );\n</script>\n\n<div\n role=\"group\"\n onmouseenter={() => (isHovered = true)}\n onmouseleave={() => (isHovered = false)}\n style:position=\"absolute\"\n style:inset=\"0\"\n>\n {#each segmentRects as b, i (i)}\n {@const left = (rect ? b.origin.x - rect.origin.x : b.origin.x) * scale}\n {@const top = (rect ? b.origin.y - rect.origin.y : b.origin.y) * scale}\n {@const width = b.size.width * scale}\n {@const height = b.size.height * scale}\n {@const scaledFontSize = Math.min(fontSize * scale, height * 0.8)}\n <div\n role=\"button\"\n tabindex=\"0\"\n onpointerdown={onClick}\n style:position=\"absolute\"\n style:left=\"{left}px\"\n style:top=\"{top}px\"\n style:width=\"{width}px\"\n style:height=\"{height}px\"\n style:background={isHovered ? color : 'transparent'}\n style:border={!isHovered ? `2px solid ${strokeColor}` : 'none'}\n style:opacity={isHovered ? opacity : 1}\n style:box-sizing=\"border-box\"\n style:pointer-events=\"auto\"\n style:cursor=\"pointer\"\n style:display=\"flex\"\n style:align-items=\"center\"\n style:justify-content={justifyContent}\n style:overflow=\"hidden\"\n >\n {#if isHovered && overlayText}\n <span\n style:color={textColor}\n style:font-size=\"{scaledFontSize}px\"\n style:font-family={fontCss.fontFamily}\n style:font-weight={fontCss.fontWeight}\n style:font-style={fontCss.fontStyle}\n style:text-align={textAlignmentToCss(textAlign)}\n style:white-space={overlayTextRepeat ? 'normal' : 'nowrap'}\n style:overflow=\"hidden\"\n style:text-overflow=\"ellipsis\"\n style:line-height=\"1\"\n >\n {renderOverlayText()}\n </span>\n {/if}\n </div>\n {/each}\n</div>\n","<script lang=\"ts\">\n import type { AnnotationRendererProps } from '@embedpdf/plugin-annotation/svelte';\n import type { PdfRedactAnnoObject } from '@embedpdf/models';\n import {\n PdfStandardFont,\n PdfTextAlignment,\n standardFontCssProperties,\n textAlignmentToCss,\n } from '@embedpdf/models';\n\n let { annotation, isSelected, scale, onClick }: AnnotationRendererProps<PdfRedactAnnoObject> =\n $props();\n let isHovered = $state(false);\n\n const object = $derived(annotation.object);\n\n // C - Border/stroke color\n const strokeColor = $derived(object.strokeColor ?? '#FF0000');\n // IC - Interior color (background fill when redaction is applied)\n const color = $derived(object.color ?? '#000000');\n // CA - Opacity (0-1)\n const opacity = $derived(object.opacity ?? 1);\n // OC - Overlay text color (Adobe extension), fallback to fontColor\n const textColor = $derived(object.fontColor ?? object.overlayColor ?? '#FFFFFF');\n // Overlay text properties\n const overlayText = $derived(object.overlayText);\n const overlayTextRepeat = $derived(object.overlayTextRepeat ?? false);\n const fontSize = $derived(object.fontSize ?? 12);\n const fontFamily = $derived(object.fontFamily ?? PdfStandardFont.Helvetica);\n const fontCss = $derived(standardFontCssProperties(fontFamily));\n const textAlign = $derived(object.textAlign ?? PdfTextAlignment.Center);\n\n // Calculate how many times to repeat text (approximate)\n function renderOverlayText(): string | null {\n if (!overlayText) return null;\n if (!overlayTextRepeat) return overlayText;\n // Repeat text multiple times to fill the space\n const reps = 10;\n return Array(reps).fill(overlayText).join(' ');\n }\n\n const justifyContent = $derived(\n textAlign === PdfTextAlignment.Left\n ? 'flex-start'\n : textAlign === PdfTextAlignment.Right\n ? 'flex-end'\n : 'center',\n );\n</script>\n\n<div\n role=\"button\"\n tabindex=\"0\"\n onpointerdown={(e) => {\n if (!isSelected) onClick?.(e);\n }}\n onmouseenter={() => (isHovered = true)}\n onmouseleave={() => (isHovered = false)}\n style:position=\"absolute\"\n style:inset=\"0\"\n style:background={isHovered ? color : 'transparent'}\n style:border={!isHovered ? `2px solid ${strokeColor}` : 'none'}\n style:opacity={isHovered ? opacity : 1}\n style:box-sizing=\"border-box\"\n style:pointer-events=\"auto\"\n style:cursor={isSelected ? 'move' : 'pointer'}\n style:display=\"flex\"\n style:align-items=\"center\"\n style:justify-content={justifyContent}\n style:overflow=\"hidden\"\n>\n {#if isHovered && overlayText}\n <span\n style:color={textColor}\n style:font-size=\"{fontSize * scale}px\"\n style:font-family={fontCss.fontFamily}\n style:font-weight={fontCss.fontWeight}\n style:font-style={fontCss.fontStyle}\n style:text-align={textAlignmentToCss(textAlign)}\n style:white-space={overlayTextRepeat ? 'normal' : 'nowrap'}\n style:overflow=\"hidden\"\n style:text-overflow=\"ellipsis\"\n style:padding=\"4px\"\n >\n {renderOverlayText()}\n </span>\n {/if}\n</div>\n","import { createRenderer, type BoxedAnnotationRenderer } from '@embedpdf/plugin-annotation/svelte';\nimport { PdfAnnotationSubtype, type PdfRedactAnnoObject } from '@embedpdf/models';\nimport RedactHighlight from './annotations/RedactHighlight.svelte';\nimport RedactArea from './annotations/RedactArea.svelte';\n\n/**\n * Boxed annotation renderers for Redact annotations.\n * Type safety is enforced at definition time via createRenderer.\n * These are automatically registered with the annotation plugin via context.\n */\nexport const redactRenderers: BoxedAnnotationRenderer[] = [\n createRenderer<PdfRedactAnnoObject>({\n id: 'redactHighlight',\n matches: (a): a is PdfRedactAnnoObject =>\n a.type === PdfAnnotationSubtype.REDACT &&\n 'segmentRects' in a &&\n (a.segmentRects?.length ?? 0) > 0,\n component: RedactHighlight,\n interactionDefaults: { isDraggable: false, isResizable: false, isRotatable: false },\n useAppearanceStream: false,\n }),\n createRenderer<PdfRedactAnnoObject>({\n id: 'redactArea',\n matches: (a): a is PdfRedactAnnoObject =>\n a.type === PdfAnnotationSubtype.REDACT &&\n (!('segmentRects' in a) || !(a.segmentRects?.length ?? 0)),\n component: RedactArea,\n interactionDefaults: { isDraggable: false, isResizable: false, isRotatable: false },\n useAppearanceStream: false,\n }),\n];\n","<script lang=\"ts\">\n import { onMount } from 'svelte';\n import { getRendererRegistry } from '@embedpdf/plugin-annotation/svelte';\n import { redactRenderers } from './redact-renderers';\n import type { Snippet } from 'svelte';\n\n let { children }: { children?: Snippet } = $props();\n\n const registry = getRendererRegistry();\n\n onMount(() => {\n if (!registry) return;\n return registry.register(redactRenderers);\n });\n</script>\n\n{#if children}\n {@render children()}\n{/if}\n","import {\n RedactionPlugin,\n initialDocumentState,\n RedactionDocumentState,\n RedactionScope,\n} from '@embedpdf/plugin-redaction';\nimport { useCapability, usePlugin } from '@embedpdf/core/svelte';\n\nexport const useRedactionPlugin = () => usePlugin<RedactionPlugin>(RedactionPlugin.id);\nexport const useRedactionCapability = () => useCapability<RedactionPlugin>(RedactionPlugin.id);\n\n// Define the return type explicitly to maintain type safety\ninterface UseRedactionReturn {\n provides: RedactionScope | null;\n state: RedactionDocumentState;\n}\n\n/**\n * Hook for redaction state for a specific document\n * @param getDocumentId Document ID getter function\n */\nexport const useRedaction = (getDocumentId: () => string | null): UseRedactionReturn => {\n const capability = useRedactionCapability();\n\n let state = $state<RedactionDocumentState>(initialDocumentState);\n\n // Reactive documentId\n const documentId = $derived(getDocumentId());\n\n // Scoped capability for current docId\n const scopedProvides = $derived(\n capability.provides && documentId ? capability.provides.forDocument(documentId) : null,\n );\n\n $effect(() => {\n const provides = capability.provides;\n const docId = documentId;\n\n if (!provides || !docId) {\n state = initialDocumentState;\n return;\n }\n\n const scope = provides.forDocument(docId);\n\n // Get initial state\n try {\n state = scope.getState();\n } catch (e) {\n // Handle case where state might not be ready\n state = initialDocumentState;\n }\n\n // Subscribe to state changes for THIS docId\n return scope.onStateChange((newState) => {\n state = newState;\n });\n });\n\n return {\n get provides() {\n return scopedProvides;\n },\n get state() {\n return state;\n },\n };\n};\n","<script lang=\"ts\">\n import type { Rect } from '@embedpdf/models';\n\n interface HighlightProps {\n color?: string;\n opacity?: number;\n border?: string;\n rects: Rect[];\n rect?: Rect;\n scale: number;\n onClick?: (e: MouseEvent) => void;\n style?: string;\n }\n\n let {\n color = '#FFFF00',\n opacity = 1,\n border = '1px solid red',\n rects,\n rect,\n scale,\n onClick,\n style = '',\n }: HighlightProps = $props();\n\n // Rename rect to boundingRect for clarity\n const boundingRect = $derived(rect);\n</script>\n\n{#each rects as b, i (i)}\n <div\n onpointerdown={onClick}\n style:position=\"absolute\"\n style:border\n style:left={`${(boundingRect ? b.origin.x - boundingRect.origin.x : b.origin.x) * scale}px`}\n style:top={`${(boundingRect ? b.origin.y - boundingRect.origin.y : b.origin.y) * scale}px`}\n style:width={`${b.size.width * scale}px`}\n style:height={`${b.size.height * scale}px`}\n style:background={color}\n style:opacity\n style:pointer-events={onClick ? 'auto' : 'none'}\n style:cursor={onClick ? 'pointer' : 'default'}\n style:z-index={onClick ? '1' : undefined}\n {style}\n ></div>\n{/each}\n","<script lang=\"ts\">\n import { useDocumentState } from '@embedpdf/core/svelte';\n import type { Rect } from '@embedpdf/models';\n import { useRedactionPlugin } from '../hooks/use-redaction.svelte';\n\n interface MarqueeRedactProps {\n /** The ID of the document */\n documentId: string;\n /** Index of the page this layer lives on */\n pageIndex: number;\n /** Scale of the page */\n scale?: number;\n /** Optional CSS class applied to the marquee rectangle */\n className?: string;\n /** Stroke / fill colours (defaults below) */\n stroke?: string;\n fill?: string;\n }\n\n let {\n documentId,\n pageIndex,\n scale: scaleOverride,\n className = '',\n stroke,\n fill = 'transparent',\n }: MarqueeRedactProps = $props();\n\n const redactionPlugin = useRedactionPlugin();\n const documentState = useDocumentState(() => documentId);\n let rect = $state<Rect | null>(null);\n\n const actualScale = $derived(\n scaleOverride !== undefined ? scaleOverride : (documentState.current?.scale ?? 1),\n );\n\n // Get stroke color from plugin (annotation mode uses tool defaults, legacy uses red)\n // Allow prop override for backwards compatibility\n const strokeColor = $derived(stroke ?? redactionPlugin.plugin?.getPreviewStrokeColor() ?? 'red');\n\n $effect(() => {\n if (!redactionPlugin.plugin || !documentId) {\n rect = null;\n return;\n }\n\n return redactionPlugin.plugin.onRedactionMarqueeChange(documentId, (data) => {\n rect = data.pageIndex === pageIndex ? data.rect : null;\n });\n });\n</script>\n\n{#if rect}\n <div\n class={className}\n style:position=\"absolute\"\n style:pointer-events=\"none\"\n style:left={`${rect.origin.x * actualScale}px`}\n style:top={`${rect.origin.y * actualScale}px`}\n style:width={`${rect.size.width * actualScale}px`}\n style:height={`${rect.size.height * actualScale}px`}\n style:border={`1px solid ${strokeColor}`}\n style:background={fill}\n style:box-sizing=\"border-box\"\n ></div>\n{/if}\n","<script lang=\"ts\">\n import type { Snippet } from 'svelte';\n import type { Rect } from '@embedpdf/models';\n import { Rotation } from '@embedpdf/models';\n import { CounterRotate } from '@embedpdf/utils/svelte';\n import type { MenuWrapperProps, SelectionMenuPlacement } from '@embedpdf/utils/svelte';\n import type { RedactionItem } from '@embedpdf/plugin-redaction';\n import { useRedactionCapability } from '../hooks/use-redaction.svelte';\n import Highlight from './highlight.svelte';\n import type {\n RedactionSelectionContext,\n RedactionSelectionMenuRenderFn,\n RedactionSelectionMenuProps,\n } from '../types';\n\n interface Props {\n documentId: string;\n pageIndex: number;\n scale: number;\n rotation?: Rotation;\n bboxStroke?: string;\n selectionMenu?: RedactionSelectionMenuRenderFn;\n selectionMenuSnippet?: Snippet<[RedactionSelectionMenuProps]>;\n }\n\n let {\n documentId,\n pageIndex,\n scale,\n rotation = Rotation.Degree0,\n bboxStroke = 'rgba(0,0,0,0.8)',\n selectionMenu,\n selectionMenuSnippet,\n }: Props = $props();\n\n const redactionCapability = useRedactionCapability();\n\n let items = $state<RedactionItem[]>([]);\n let selectedId = $state<string | null>(null);\n\n $effect(() => {\n const redactionValue = redactionCapability.provides;\n if (!redactionValue) {\n items = [];\n selectedId = null;\n return;\n }\n\n const scoped = redactionValue.forDocument(documentId);\n const currentState = scoped.getState();\n // Only show legacy mode items (not annotation-based redactions)\n items = (currentState.pending[pageIndex] ?? []).filter((it) => it.source === 'legacy');\n selectedId = currentState.selected?.page === pageIndex ? currentState.selected.id : null;\n\n const off1 = scoped.onPendingChange((map) => {\n // Only show legacy mode items (not annotation-based redactions)\n items = (map[pageIndex] ?? []).filter((it) => it.source === 'legacy');\n });\n\n const off2 = scoped.onSelectedChange((sel) => {\n selectedId = sel?.page === pageIndex ? sel.id : null;\n });\n\n return () => {\n off1?.();\n off2?.();\n };\n });\n\n function select(e: MouseEvent, id: string) {\n e.stopPropagation();\n if (!redactionCapability.provides) return;\n redactionCapability.provides.forDocument(documentId).selectPending(pageIndex, id);\n }\n\n function shouldShowMenu(itemId: string): boolean {\n const isSelected = selectedId === itemId;\n return isSelected && (!!selectionMenu || !!selectionMenuSnippet);\n }\n\n function buildContext(item: RedactionItem): RedactionSelectionContext {\n return { type: 'redaction', item, pageIndex };\n }\n\n const menuPlacement: SelectionMenuPlacement = {\n suggestTop: false,\n spaceAbove: 0,\n spaceBelow: 0,\n };\n\n function buildMenuProps(\n item: RedactionItem,\n rect: Rect,\n menuWrapperProps: MenuWrapperProps,\n ): RedactionSelectionMenuProps {\n return {\n context: buildContext(item),\n selected: selectedId === item.id,\n rect,\n placement: menuPlacement,\n menuWrapperProps,\n };\n }\n</script>\n\n{#if items.length}\n <div style=\"position: absolute; inset: 0; pointer-events: none;\">\n {#each items as item (item.id)}\n {#if item.kind === 'area'}\n <div\n style=\"\n position: absolute;\n left: {item.rect.origin.x * scale}px;\n top: {item.rect.origin.y * scale}px;\n width: {item.rect.size.width * scale}px;\n height: {item.rect.size.height * scale}px;\n background: transparent;\n outline: {selectedId === item.id ? `1px solid ${bboxStroke}` : 'none'};\n outline-offset: 2px;\n border: 1px solid red;\n pointer-events: auto;\n cursor: pointer;\n \"\n onpointerdown={(e) => select(e, item.id)}\n ></div>\n\n {#if shouldShowMenu(item.id)}\n <CounterRotate\n rect={{\n origin: { x: item.rect.origin.x * scale, y: item.rect.origin.y * scale },\n size: { width: item.rect.size.width * scale, height: item.rect.size.height * scale },\n }}\n {rotation}\n >\n {#snippet children({ rect, menuWrapperProps })}\n {@const menuProps = buildMenuProps(item, rect, menuWrapperProps)}\n {#if selectionMenu}\n {@const result = selectionMenu(menuProps)}\n {#if result}\n <result.component {...result.props} />\n {/if}\n {:else if selectionMenuSnippet}\n {@render selectionMenuSnippet(menuProps)}\n {/if}\n {/snippet}\n </CounterRotate>\n {/if}\n {:else}\n <div\n style=\"\n position: absolute;\n left: {item.rect.origin.x * scale}px;\n top: {item.rect.origin.y * scale}px;\n width: {item.rect.size.width * scale}px;\n height: {item.rect.size.height * scale}px;\n background: transparent;\n outline: {selectedId === item.id ? `1px solid ${bboxStroke}` : 'none'};\n outline-offset: 2px;\n pointer-events: auto;\n cursor: {selectedId === item.id ? 'pointer' : 'default'};\n \"\n >\n <Highlight\n rect={item.rect}\n rects={item.rects}\n color=\"transparent\"\n border=\"1px solid red\"\n {scale}\n onClick={(e) => select(e, item.id)}\n />\n </div>\n\n {#if shouldShowMenu(item.id)}\n <CounterRotate\n rect={{\n origin: { x: item.rect.origin.x * scale, y: item.rect.origin.y * scale },\n size: { width: item.rect.size.width * scale, height: item.rect.size.height * scale },\n }}\n {rotation}\n >\n {#snippet children({ rect, menuWrapperProps })}\n {@const menuProps = buildMenuProps(item, rect, menuWrapperProps)}\n {#if selectionMenu}\n {@const result = selectionMenu(menuProps)}\n {#if result}\n <result.component {...result.props} />\n {/if}\n {:else if selectionMenuSnippet}\n {@render selectionMenuSnippet(menuProps)}\n {/if}\n {/snippet}\n </CounterRotate>\n {/if}\n {/if}\n {/each}\n </div>\n{/if}\n","<script lang=\"ts\">\n import type { Rect } from '@embedpdf/models';\n import { useRedactionPlugin } from '../hooks/use-redaction.svelte';\n import Highlight from './highlight.svelte';\n\n interface SelectionRedactProps {\n documentId: string;\n pageIndex: number;\n scale: number;\n }\n\n let { documentId, pageIndex, scale }: SelectionRedactProps = $props();\n\n const redactionPlugin = useRedactionPlugin();\n let rects = $state<Rect[]>([]);\n let boundingRect = $state<Rect | null>(null);\n\n // Get stroke color from plugin (annotation mode uses tool defaults, legacy uses red)\n const strokeColor = $derived(redactionPlugin.plugin?.getPreviewStrokeColor() ?? 'red');\n\n $effect(() => {\n if (!redactionPlugin.plugin) {\n rects = [];\n boundingRect = null;\n return;\n }\n\n return redactionPlugin.plugin.onRedactionSelectionChange(documentId, (formattedSelection) => {\n const selection = formattedSelection.find((s) => s.pageIndex === pageIndex);\n rects = selection?.segmentRects ?? [];\n boundingRect = selection?.rect ?? null;\n });\n });\n</script>\n\n{#if boundingRect}\n <div\n style:mix-blend-mode=\"normal\"\n style:pointer-events=\"none\"\n style:position=\"absolute\"\n style:inset=\"0\"\n >\n <Highlight\n color=\"transparent\"\n opacity={1}\n {rects}\n {scale}\n border={`1px solid ${strokeColor}`}\n />\n </div>\n{/if}\n","<script lang=\"ts\">\n import type { Snippet } from 'svelte';\n import { useDocumentState } from '@embedpdf/core/svelte';\n import { Rotation } from '@embedpdf/models';\n import PendingRedactions from './pending-redactions.svelte';\n import MarqueeRedact from './marquee-redact.svelte';\n import SelectionRedact from './selection-redact.svelte';\n import type { RedactionSelectionMenuRenderFn, RedactionSelectionMenuProps } from '../types';\n\n interface RedactionLayerProps {\n /** The ID of the document this layer belongs to */\n documentId: string;\n /** Index of the page this layer lives on */\n pageIndex: number;\n /** Current render scale for this page */\n scale?: number;\n /** Page rotation (for counter-rotating menus, etc.) */\n rotation?: Rotation;\n /** Render function for selection menu (schema-driven approach) */\n selectionMenu?: RedactionSelectionMenuRenderFn;\n /** Snippet for custom selection menu (slot-based approach) */\n selectionMenuSnippet?: Snippet<[RedactionSelectionMenuProps]>;\n }\n\n let {\n documentId,\n pageIndex,\n scale,\n rotation,\n selectionMenu,\n selectionMenuSnippet,\n }: RedactionLayerProps = $props();\n\n const documentState = useDocumentState(() => documentId);\n const page = $derived(documentState.current?.document?.pages?.[pageIndex]);\n\n const actualScale = $derived(scale !== undefined ? scale : (documentState.current?.scale ?? 1));\n\n const actualRotation = $derived.by(() => {\n if (rotation !== undefined) return rotation;\n // Combine page intrinsic rotation with document rotation\n const pageRotation = page?.rotation ?? 0;\n const docRotation = documentState.current?.rotation ?? 0;\n return ((pageRotation + docRotation) % 4) as Rotation;\n });\n</script>\n\n<PendingRedactions\n {documentId}\n {pageIndex}\n scale={actualScale}\n rotation={actualRotation}\n {selectionMenu}\n {selectionMenuSnippet}\n/>\n<MarqueeRedact {documentId} {pageIndex} scale={actualScale} />\n<SelectionRedact {documentId} {pageIndex} scale={actualScale} />\n","import { createPluginPackage } from '@embedpdf/core';\nimport { RedactionPluginPackage as BaseRedactionPackage } from '@embedpdf/plugin-redaction';\nimport RedactRendererRegistration from './components/RedactRendererRegistration.svelte';\n\nexport * from './hooks';\nexport * from './components';\nexport * from './types';\nexport * from '@embedpdf/plugin-redaction';\n\nexport const RedactionPluginPackage = createPluginPackage(BaseRedactionPackage)\n .addUtility(RedactRendererRegistration)\n .build();\n"],"names":["root","$$anchor","root_1","PendingRedactions","MarqueeRedact","SelectionRedact","BaseRedactionPackage"],"mappings":";;;;;;;;;;;;;4CAAA;;MAYM,YAAY,EAAA,MAAO,KAAK;AAEtB,QAAA,4CAA6B,MAAM;QAEnC,eAAY,EAAA,QAAA,MAAA,EAAA,IAAY,MAAM,EAAC,gBAAY,EAAA;QAC3C,OAAI,EAAA,QAAA,MAAA,EAAA,IAAY,MAAM,EAAC,IAAI;AAG3B,QAAA,cAAW,EAAA,QAAA,MAAA,EAAA,IAAY,MAAM,EAAC,eAAe,SAAS;AAEtD,QAAA,QAAK,EAAA,QAAA,MAAA,EAAA,IAAY,MAAM,EAAC,SAAS,SAAS;AAE1C,QAAA,UAAO,EAAA,QAAA,MAAA,EAAA,IAAY,MAAM,EAAC,WAAW,CAAC;QAEtC,YAAS,EAAA,QAAA,MAAA,EAAA,IAAY,MAAM,EAAC,mBAAa,MAAM,EAAC,gBAAgB,SAAS;QAEzE,cAAW,EAAA,QAAA,MAAA,EAAA,IAAY,MAAM,EAAC,WAAW;AACzC,QAAA,oBAAiB,EAAA,QAAA,MAAA,EAAA,IAAY,MAAM,EAAC,qBAAqB,KAAK;AAC9D,QAAA,WAAQ,EAAA,QAAA,MAAA,EAAA,I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,IAAI,MAAP,mBAAS,aAAY;AACjC,UAAA,gBAAc,mBAAc,YAAd,mBAAuB,aAAY;YAC9C,eAAe,eAAe;AAAA,EACzC,CAAC;;;AAGFE,qBAAgB,MAAA;AAAA;;;;;;;mBAGR,WAAW;AAAA;;mBACR,cAAc;AAAA;;;;;;;;;AAIzBC,iBAAa,QAAA;AAAA;;;;;;;mBAAiC,WAAW;AAAA;;;AACzDC,mBAAe,QAAA;AAAA;;;;;;;mBAAiC,WAAW;AAAA;;;;AAXpD;ACpCD,MAAM,yBAAyB,oBAAoBC,wBAAoB,EAC3E,WAAW,0BAA0B,EACrC,MAAA;"}
|
package/dist/svelte/types.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { SelectionMenuPropsBase, SelectionMenuRenderFn, SelectionMenuRenderResult } from '@embedpdf/utils/svelte';
|
|
2
|
-
import { RedactionItem } from '../lib/index.ts';
|
|
3
|
-
export interface RedactionSelectionContext {
|
|
4
|
-
type: 'redaction';
|
|
5
|
-
item: RedactionItem;
|
|
6
|
-
pageIndex: number;
|
|
7
|
-
}
|
|
8
|
-
export type RedactionSelectionMenuProps = SelectionMenuPropsBase<RedactionSelectionContext>;
|
|
9
|
-
export type RedactionSelectionMenuRenderFn = SelectionMenuRenderFn<RedactionSelectionContext>;
|
|
10
|
-
export type { SelectionMenuRenderResult };
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { AnnotationRendererProps } from '@embedpdf/plugin-annotation/vue';
|
|
2
|
-
import { PdfRedactAnnoObject } from '@embedpdf/models';
|
|
3
|
-
type __VLS_Props = AnnotationRendererProps<PdfRedactAnnoObject>;
|
|
4
|
-
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
5
|
-
declare const _default: typeof __VLS_export;
|
|
6
|
-
export default _default;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { AnnotationRendererProps } from '@embedpdf/plugin-annotation/vue';
|
|
2
|
-
import { PdfRedactAnnoObject } from '@embedpdf/models';
|
|
3
|
-
type __VLS_Props = AnnotationRendererProps<PdfRedactAnnoObject>;
|
|
4
|
-
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
5
|
-
declare const _default: typeof __VLS_export;
|
|
6
|
-
export default _default;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Rect } from '@embedpdf/models';
|
|
2
|
-
interface HighlightProps {
|
|
3
|
-
color?: string;
|
|
4
|
-
opacity?: number;
|
|
5
|
-
border?: string;
|
|
6
|
-
rects: Rect[];
|
|
7
|
-
rect?: Rect;
|
|
8
|
-
scale: number;
|
|
9
|
-
onClick?: (e: PointerEvent) => void;
|
|
10
|
-
}
|
|
11
|
-
declare const __VLS_export: import('vue').DefineComponent<HighlightProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<HighlightProps> & Readonly<{}>, {
|
|
12
|
-
color: string;
|
|
13
|
-
opacity: number;
|
|
14
|
-
border: string;
|
|
15
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
16
|
-
declare const _default: typeof __VLS_export;
|
|
17
|
-
export default _default;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { default as Highlight } from './highlight.vue';
|
|
2
|
-
export { default as MarqueeRedact } from './marquee-redact.vue';
|
|
3
|
-
export { default as SelectionRedact } from './selection-redact.vue';
|
|
4
|
-
export { default as PendingRedactions } from './pending-redactions.vue';
|
|
5
|
-
export { default as RedactionLayer } from './redaction-layer.vue';
|
|
6
|
-
export { default as RedactRendererRegistration } from './redact-renderer-registration.vue';
|
|
7
|
-
export { redactRenderers } from './redact-renderers';
|
|
8
|
-
export * from './annotations';
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
interface MarqueeRedactProps {
|
|
2
|
-
/** The ID of the document */
|
|
3
|
-
documentId: string;
|
|
4
|
-
/** Index of the page this layer lives on */
|
|
5
|
-
pageIndex: number;
|
|
6
|
-
/** Scale of the page */
|
|
7
|
-
scale?: number;
|
|
8
|
-
/** Optional CSS class applied to the marquee rectangle */
|
|
9
|
-
className?: string;
|
|
10
|
-
/** Stroke / fill colours (defaults below) */
|
|
11
|
-
stroke?: string;
|
|
12
|
-
fill?: string;
|
|
13
|
-
}
|
|
14
|
-
declare const __VLS_export: import('vue').DefineComponent<MarqueeRedactProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<MarqueeRedactProps> & Readonly<{}>, {
|
|
15
|
-
fill: string;
|
|
16
|
-
stroke: string;
|
|
17
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
18
|
-
declare const _default: typeof __VLS_export;
|
|
19
|
-
export default _default;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { Rotation } from '@embedpdf/models';
|
|
2
|
-
import { SelectionMenuPlacement } from '@embedpdf/utils/vue';
|
|
3
|
-
import { RedactionSelectionContext, RedactionSelectionMenuRenderFn } from './types';
|
|
4
|
-
interface PendingRedactionsProps {
|
|
5
|
-
documentId: string;
|
|
6
|
-
pageIndex: number;
|
|
7
|
-
scale: number;
|
|
8
|
-
rotation: Rotation;
|
|
9
|
-
bboxStroke?: string;
|
|
10
|
-
/** Render function for selection menu (schema-driven approach) */
|
|
11
|
-
selectionMenu?: RedactionSelectionMenuRenderFn;
|
|
12
|
-
}
|
|
13
|
-
declare var __VLS_13: {
|
|
14
|
-
context: RedactionSelectionContext;
|
|
15
|
-
selected: boolean;
|
|
16
|
-
rect: {
|
|
17
|
-
origin: {
|
|
18
|
-
x: number;
|
|
19
|
-
y: number;
|
|
20
|
-
};
|
|
21
|
-
size: {
|
|
22
|
-
width: number;
|
|
23
|
-
height: number;
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
placement: SelectionMenuPlacement;
|
|
27
|
-
menuWrapperProps: {
|
|
28
|
-
style: import('vue').CSSProperties;
|
|
29
|
-
onPointerdown: (e: PointerEvent) => void;
|
|
30
|
-
onTouchstart: (e: TouchEvent) => void;
|
|
31
|
-
};
|
|
32
|
-
}, __VLS_32: {
|
|
33
|
-
context: RedactionSelectionContext;
|
|
34
|
-
selected: boolean;
|
|
35
|
-
rect: {
|
|
36
|
-
origin: {
|
|
37
|
-
x: number;
|
|
38
|
-
y: number;
|
|
39
|
-
};
|
|
40
|
-
size: {
|
|
41
|
-
width: number;
|
|
42
|
-
height: number;
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
placement: SelectionMenuPlacement;
|
|
46
|
-
menuWrapperProps: {
|
|
47
|
-
style: import('vue').CSSProperties;
|
|
48
|
-
onPointerdown: (e: PointerEvent) => void;
|
|
49
|
-
onTouchstart: (e: TouchEvent) => void;
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
type __VLS_Slots = {} & {
|
|
53
|
-
'selection-menu'?: (props: typeof __VLS_13) => any;
|
|
54
|
-
} & {
|
|
55
|
-
'selection-menu'?: (props: typeof __VLS_32) => any;
|
|
56
|
-
};
|
|
57
|
-
declare const __VLS_base: import('vue').DefineComponent<PendingRedactionsProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<PendingRedactionsProps> & Readonly<{}>, {
|
|
58
|
-
rotation: Rotation;
|
|
59
|
-
bboxStroke: string;
|
|
60
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
61
|
-
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
62
|
-
declare const _default: typeof __VLS_export;
|
|
63
|
-
export default _default;
|
|
64
|
-
type __VLS_WithSlots<T, S> = T & {
|
|
65
|
-
new (): {
|
|
66
|
-
$slots: S;
|
|
67
|
-
};
|
|
68
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
declare var __VLS_1: {};
|
|
2
|
-
type __VLS_Slots = {} & {
|
|
3
|
-
default?: (props: typeof __VLS_1) => any;
|
|
4
|
-
};
|
|
5
|
-
declare const __VLS_base: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
6
|
-
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
7
|
-
declare const _default: typeof __VLS_export;
|
|
8
|
-
export default _default;
|
|
9
|
-
type __VLS_WithSlots<T, S> = T & {
|
|
10
|
-
new (): {
|
|
11
|
-
$slots: S;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { BoxedAnnotationRenderer } from '@embedpdf/plugin-annotation/vue';
|
|
2
|
-
/**
|
|
3
|
-
* Boxed annotation renderers for Redact annotations.
|
|
4
|
-
* Type safety is enforced at definition time via createRenderer.
|
|
5
|
-
* These are automatically registered with the annotation plugin via context.
|
|
6
|
-
*/
|
|
7
|
-
export declare const redactRenderers: BoxedAnnotationRenderer[];
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { Rotation } from '@embedpdf/models';
|
|
2
|
-
import { RedactionSelectionMenuRenderFn } from './types';
|
|
3
|
-
interface RedactionLayerProps {
|
|
4
|
-
/** The ID of the document this layer belongs to */
|
|
5
|
-
documentId: string;
|
|
6
|
-
/** Index of the page this layer lives on */
|
|
7
|
-
pageIndex: number;
|
|
8
|
-
/** Current render scale for this page */
|
|
9
|
-
scale?: number;
|
|
10
|
-
/** Page rotation (for counter-rotating menus, etc.) */
|
|
11
|
-
rotation?: Rotation;
|
|
12
|
-
/** Optional bbox stroke color */
|
|
13
|
-
bboxStroke?: string;
|
|
14
|
-
/** Optional menu renderer for a selected redaction */
|
|
15
|
-
selectionMenu?: RedactionSelectionMenuRenderFn;
|
|
16
|
-
}
|
|
17
|
-
declare var __VLS_8: {
|
|
18
|
-
context: import('./types').RedactionSelectionContext;
|
|
19
|
-
selected: boolean;
|
|
20
|
-
rect: {
|
|
21
|
-
origin: {
|
|
22
|
-
x: number;
|
|
23
|
-
y: number;
|
|
24
|
-
};
|
|
25
|
-
size: {
|
|
26
|
-
width: number;
|
|
27
|
-
height: number;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
placement: import('@embedpdf/utils').SelectionMenuPlacement;
|
|
31
|
-
menuWrapperProps: {
|
|
32
|
-
style: import('vue').CSSProperties;
|
|
33
|
-
onPointerdown: (e: PointerEvent) => void;
|
|
34
|
-
onTouchstart: (e: TouchEvent) => void;
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
type __VLS_Slots = {} & {
|
|
38
|
-
'selection-menu'?: (props: typeof __VLS_8) => any;
|
|
39
|
-
};
|
|
40
|
-
declare const __VLS_base: import('vue').DefineComponent<RedactionLayerProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<RedactionLayerProps> & Readonly<{}>, {
|
|
41
|
-
bboxStroke: string;
|
|
42
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
43
|
-
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
44
|
-
declare const _default: typeof __VLS_export;
|
|
45
|
-
export default _default;
|
|
46
|
-
type __VLS_WithSlots<T, S> = T & {
|
|
47
|
-
new (): {
|
|
48
|
-
$slots: S;
|
|
49
|
-
};
|
|
50
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
interface SelectionRedactProps {
|
|
2
|
-
documentId: string;
|
|
3
|
-
pageIndex: number;
|
|
4
|
-
scale: number;
|
|
5
|
-
}
|
|
6
|
-
declare const __VLS_export: import('vue').DefineComponent<SelectionRedactProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<SelectionRedactProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
7
|
-
declare const _default: typeof __VLS_export;
|
|
8
|
-
export default _default;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { SelectionMenuPropsBase, SelectionMenuRenderFn } from '@embedpdf/utils/vue';
|
|
2
|
-
import { RedactionItem } from '../../lib';
|
|
3
|
-
export interface RedactionSelectionContext {
|
|
4
|
-
type: 'redaction';
|
|
5
|
-
item: RedactionItem;
|
|
6
|
-
pageIndex: number;
|
|
7
|
-
}
|
|
8
|
-
export type RedactionSelectionMenuProps = SelectionMenuPropsBase<RedactionSelectionContext>;
|
|
9
|
-
export type RedactionSelectionMenuRenderFn = SelectionMenuRenderFn<RedactionSelectionContext>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './use-redaction';
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { MaybeRefOrGetter, ComputedRef, Ref } from 'vue';
|
|
2
|
-
import { RedactionPlugin, RedactionDocumentState, RedactionScope } from '../../lib';
|
|
3
|
-
export declare const useRedactionPlugin: () => import('@embedpdf/core/vue').PluginState<RedactionPlugin>;
|
|
4
|
-
export declare const useRedactionCapability: () => import('@embedpdf/core/vue').CapabilityState<Readonly<import('../../lib').RedactionCapability>>;
|
|
5
|
-
/**
|
|
6
|
-
* Hook for redaction state for a specific document
|
|
7
|
-
* @param documentId Document ID (can be ref, computed, getter, or plain value)
|
|
8
|
-
*/
|
|
9
|
-
export declare const useRedaction: (documentId: MaybeRefOrGetter<string>) => {
|
|
10
|
-
state: Readonly<Ref<RedactionDocumentState>>;
|
|
11
|
-
provides: ComputedRef<RedactionScope | null>;
|
|
12
|
-
};
|
package/dist/vue/index.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@embedpdf/core"),t=require("@embedpdf/plugin-redaction"),o=require("vue"),n=require("@embedpdf/core/vue"),a=require("@embedpdf/models"),l=require("@embedpdf/utils/vue"),r=require("@embedpdf/plugin-annotation/vue"),i=o.defineComponent({__name:"highlight",props:{color:{default:"#FFFF00"},opacity:{default:1},border:{default:"1px solid red"},rects:{},rect:{},scale:{},onClick:{}},setup(e){const t=e.rect;return(n,a)=>(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.rects,(l,r)=>(o.openBlock(),o.createElementBlock("div",o.mergeProps({key:r,onPointerdown:a[0]||(a[0]=(...t)=>e.onClick&&e.onClick(...t)),style:{position:"absolute",border:e.border,left:(o.unref(t)?l.origin.x-o.unref(t).origin.x:l.origin.x)*e.scale+"px",top:(o.unref(t)?l.origin.y-o.unref(t).origin.y:l.origin.y)*e.scale+"px",width:l.size.width*e.scale+"px",height:l.size.height*e.scale+"px",background:e.color,opacity:e.opacity,pointerEvents:e.onClick?"auto":"none",cursor:e.onClick?"pointer":"default",zIndex:e.onClick?1:void 0}},{ref_for:!0},n.$attrs),null,16))),128))}}),c=()=>n.usePlugin(t.RedactionPlugin.id),u=()=>n.useCapability(t.RedactionPlugin.id),d=o.defineComponent({__name:"marquee-redact",props:{documentId:{},pageIndex:{},scale:{},className:{},stroke:{default:"red"},fill:{default:"transparent"}},setup(e){const t=e,{plugin:a}=c(),l=n.useDocumentState(()=>t.documentId),r=o.ref(null),i=o.computed(()=>{var e;return void 0!==t.scale?t.scale:(null==(e=l.value)?void 0:e.scale)??1}),u=o.computed(()=>{var e;return t.stroke??(null==(e=a.value)?void 0:e.getPreviewStrokeColor())??"red"});return o.watch([a,()=>t.documentId,()=>t.pageIndex],([e,t,o],n,a)=>{if(!e||!t)return;a(e.onRedactionMarqueeChange(t,e=>{r.value=e.pageIndex===o?e.rect:null}))},{immediate:!0}),(t,n)=>r.value?(o.openBlock(),o.createElementBlock("div",{key:0,style:o.normalizeStyle({position:"absolute",pointerEvents:"none",left:r.value.origin.x*i.value+"px",top:r.value.origin.y*i.value+"px",width:r.value.size.width*i.value+"px",height:r.value.size.height*i.value+"px",border:`1px solid ${u.value}`,background:e.fill,boxSizing:"border-box"}),class:o.normalizeClass(e.className)},null,6)):o.createCommentVNode("",!0)}}),s={key:0,style:{mixBlendMode:"normal",pointerEvents:"none",position:"absolute",inset:0}},p=o.defineComponent({__name:"selection-redact",props:{documentId:{},pageIndex:{},scale:{}},setup(e){const t=e,{plugin:n}=c(),a=o.ref([]),l=o.ref(null),r=o.computed(()=>{var e;return(null==(e=n.value)?void 0:e.getPreviewStrokeColor())??"red"});return o.watch([n,()=>t.documentId,()=>t.pageIndex],([e,t,o],n,r)=>{if(!e)return a.value=[],void(l.value=null);r(e.onRedactionSelectionChange(t,e=>{const t=e.find(e=>e.pageIndex===o);a.value=(null==t?void 0:t.segmentRects)??[],l.value=(null==t?void 0:t.rect)??null}))},{immediate:!0}),(t,n)=>l.value?(o.openBlock(),o.createElementBlock("div",s,[o.createVNode(i,{color:"transparent",opacity:1,rects:a.value,scale:e.scale,border:`1px solid ${r.value}`},null,8,["rects","scale","border"])])):o.createCommentVNode("",!0)}}),m={key:0,style:{position:"absolute",inset:0,pointerEvents:"none"}},v=["onPointerdown"],g=o.defineComponent({__name:"pending-redactions",props:{documentId:{},pageIndex:{},scale:{},rotation:{default:a.Rotation.Degree0},bboxStroke:{default:"rgba(0,0,0,0.8)"},selectionMenu:{}},setup(e){const t=e,n=o.useSlots(),{provides:a}=u(),r=o.ref([]),c=o.ref(null);o.watch([a,()=>t.documentId,()=>t.pageIndex],([e,t,o],n,a)=>{if(!e)return r.value=[],void(c.value=null);const l=e.forDocument(t),i=l.getState();r.value=(i.pending[o]??[]).filter(e=>"legacy"===e.source),c.value=i.selected&&i.selected.page===o?i.selected.id:null;const u=l.onPendingChange(e=>{r.value=(e[o]??[]).filter(e=>"legacy"===e.source)}),d=l.onSelectedChange(e=>{c.value=e&&e.page===o?e.id:null});a(()=>{null==u||u(),null==d||d()})},{immediate:!0});const d=(e,o)=>{e.stopPropagation();const n=a.value;n&&n.forDocument(t.documentId).selectPending(t.pageIndex,o)},s=e=>c.value===e&&(!!t.selectionMenu||!!n["selection-menu"]),p=e=>({type:"redaction",item:e,pageIndex:t.pageIndex}),g={suggestTop:!1,spaceAbove:0,spaceBelow:0},x=(e,o,n)=>t.selectionMenu?t.selectionMenu({rect:o,menuWrapperProps:n,selected:c.value===e.id,placement:g,context:p(e)}):null;return(t,n)=>r.value.length?(o.openBlock(),o.createElementBlock("div",m,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.value,n=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:n.id},["area"===n.kind?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createElementVNode("div",{style:o.normalizeStyle({position:"absolute",left:n.rect.origin.x*e.scale+"px",top:n.rect.origin.y*e.scale+"px",width:n.rect.size.width*e.scale+"px",height:n.rect.size.height*e.scale+"px",background:"transparent",outline:c.value===n.id?`1px solid ${e.bboxStroke}`:"none",outlineOffset:"2px",border:"1px solid red",pointerEvents:"auto",cursor:"pointer"}),onPointerdown:e=>d(e,n.id)},null,44,v),s(n.id)?(o.openBlock(),o.createBlock(o.unref(l.CounterRotate),{key:0,rect:{origin:{x:n.rect.origin.x*e.scale,y:n.rect.origin.y*e.scale},size:{width:n.rect.size.width*e.scale,height:n.rect.size.height*e.scale}},rotation:e.rotation},{default:o.withCtx(({rect:a,menuWrapperProps:l})=>[e.selectionMenu?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(x(n,a,l)),{key:0})):o.renderSlot(t.$slots,"selection-menu",{key:1,context:p(n),selected:c.value===n.id,rect:a,placement:g,menuWrapperProps:l})]),_:2},1032,["rect","rotation"])):o.createCommentVNode("",!0)],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createElementVNode("div",{style:o.normalizeStyle({position:"absolute",left:n.rect.origin.x*e.scale+"px",top:n.rect.origin.y*e.scale+"px",width:n.rect.size.width*e.scale+"px",height:n.rect.size.height*e.scale+"px",background:"transparent",outline:c.value===n.id?`1px solid ${e.bboxStroke}`:"none",outlineOffset:"2px",pointerEvents:"auto",cursor:c.value===n.id?"pointer":"default"})},[o.createVNode(i,{rect:n.rect,rects:n.rects,color:"transparent",border:"1px solid red",scale:e.scale,"on-click":e=>d(e,n.id)},null,8,["rect","rects","scale","on-click"])],4),s(n.id)?(o.openBlock(),o.createBlock(o.unref(l.CounterRotate),{key:0,rect:{origin:{x:n.rect.origin.x*e.scale,y:n.rect.origin.y*e.scale},size:{width:n.rect.size.width*e.scale,height:n.rect.size.height*e.scale}},rotation:e.rotation},{default:o.withCtx(({rect:a,menuWrapperProps:l})=>[e.selectionMenu?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(x(n,a,l)),{key:0})):o.renderSlot(t.$slots,"selection-menu",{key:1,context:p(n),selected:c.value===n.id,rect:a,placement:g,menuWrapperProps:l})]),_:2},1032,["rect","rotation"])):o.createCommentVNode("",!0)],64))],64))),128))])):o.createCommentVNode("",!0)}}),x=o.defineComponent({__name:"redaction-layer",props:{documentId:{},pageIndex:{},scale:{},rotation:{},bboxStroke:{default:"rgba(0,0,0,0.8)"},selectionMenu:{}},setup(e){const t=e,a=n.useDocumentState(()=>t.documentId),l=o.computed(()=>{var e,o,n;return null==(n=null==(o=null==(e=a.value)?void 0:e.document)?void 0:o.pages)?void 0:n[t.pageIndex]}),r=o.computed(()=>{var e;return void 0!==t.scale?t.scale:(null==(e=a.value)?void 0:e.scale)??1}),i=o.computed(()=>{var e,o;if(void 0!==t.rotation)return t.rotation;return(((null==(e=l.value)?void 0:e.rotation)??0)+((null==(o=a.value)?void 0:o.rotation)??0))%4});return(t,n)=>(o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createVNode(g,{"document-id":e.documentId,"page-index":e.pageIndex,scale:r.value,rotation:i.value,"bbox-stroke":e.bboxStroke,"selection-menu":e.selectionMenu},{"selection-menu":o.withCtx(e=>[o.renderSlot(t.$slots,"selection-menu",o.normalizeProps(o.guardReactiveProps(e)))]),_:3},8,["document-id","page-index","scale","rotation","bbox-stroke","selection-menu"]),o.createVNode(d,{"document-id":e.documentId,"page-index":e.pageIndex,scale:r.value},null,8,["document-id","page-index","scale"]),o.createVNode(p,{"document-id":e.documentId,"page-index":e.pageIndex,scale:r.value},null,8,["document-id","page-index","scale"])],64))}}),f=o.defineComponent({__name:"redact-highlight",props:{annotation:{},currentObject:{},isSelected:{type:Boolean},isEditing:{type:Boolean},scale:{},pageIndex:{},documentId:{},onClick:{type:Function},appearanceActive:{type:Boolean}},setup(e){const t=e,n=o.ref(!1),l=o.computed(()=>t.annotation.object.segmentRects??[]),r=o.computed(()=>t.annotation.object.rect),i=o.computed(()=>t.annotation.object.strokeColor??"#FF0000"),c=o.computed(()=>t.annotation.object.color??"#000000"),u=o.computed(()=>t.annotation.object.opacity??1),d=o.computed(()=>t.annotation.object.fontColor??t.annotation.object.overlayColor??"#FFFFFF"),s=o.computed(()=>t.annotation.object.overlayText),p=o.computed(()=>t.annotation.object.overlayTextRepeat??!1),m=o.computed(()=>t.annotation.object.fontSize??12),v=o.computed(()=>t.annotation.object.fontFamily??a.PdfStandardFont.Helvetica),g=o.computed(()=>t.annotation.object.textAlign??a.PdfTextAlignment.Center),x=o.computed(()=>{if(!s.value)return"";if(!p.value)return s.value;return Array(10).fill(s.value).join(" ")}),f=e=>({position:"absolute",left:(r.value?e.origin.x-r.value.origin.x:e.origin.x)*t.scale+"px",top:(r.value?e.origin.y-r.value.origin.y:e.origin.y)*t.scale+"px",width:e.size.width*t.scale+"px",height:e.size.height*t.scale+"px",background:n.value?c.value:"transparent",border:n.value?"none":`2px solid ${i.value}`,opacity:n.value?u.value:1,boxSizing:"border-box",pointerEvents:"auto",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:g.value===a.PdfTextAlignment.Left?"flex-start":g.value===a.PdfTextAlignment.Right?"flex-end":"center",overflow:"hidden"}),y=e=>({color:d.value,fontSize:`${Math.min(m.value*t.scale,e.size.height*t.scale*.8)}px`,...a.standardFontCssProperties(v.value),textAlign:a.textAlignmentToCss(g.value),whiteSpace:p.value?"normal":"nowrap",overflow:"hidden",textOverflow:"ellipsis",lineHeight:1});return(t,a)=>(o.openBlock(),o.createElementBlock("div",{onMouseenter:a[1]||(a[1]=e=>n.value=!0),onMouseleave:a[2]||(a[2]=e=>n.value=!1),style:{position:"absolute",inset:0}},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(l.value,(t,l)=>(o.openBlock(),o.createElementBlock("div",{key:l,onPointerdown:a[0]||(a[0]=(...t)=>e.onClick&&e.onClick(...t)),style:o.normalizeStyle(f(t))},[n.value&&s.value?(o.openBlock(),o.createElementBlock("span",{key:0,style:o.normalizeStyle(y(t))},o.toDisplayString(x.value),5)):o.createCommentVNode("",!0)],36))),128))],32))}}),y=o.defineComponent({__name:"redact-area",props:{annotation:{},currentObject:{},isSelected:{type:Boolean},isEditing:{type:Boolean},scale:{},pageIndex:{},documentId:{},onClick:{type:Function},appearanceActive:{type:Boolean}},setup(e){const t=e,n=o.ref(!1),l=o.computed(()=>t.annotation.object.strokeColor??"#FF0000"),r=o.computed(()=>t.annotation.object.color??"#000000"),i=o.computed(()=>t.annotation.object.opacity??1),c=o.computed(()=>t.annotation.object.fontColor??t.annotation.object.overlayColor??"#FFFFFF"),u=o.computed(()=>t.annotation.object.overlayText),d=o.computed(()=>t.annotation.object.overlayTextRepeat??!1),s=o.computed(()=>t.annotation.object.fontSize??12),p=o.computed(()=>t.annotation.object.fontFamily??a.PdfStandardFont.Helvetica),m=o.computed(()=>t.annotation.object.textAlign??a.PdfTextAlignment.Center),v=o.computed(()=>{if(!u.value)return"";if(!d.value)return u.value;return Array(10).fill(u.value).join(" ")}),g=o.computed(()=>({position:"absolute",inset:0,background:n.value?r.value:"transparent",border:n.value?"none":`2px solid ${l.value}`,opacity:n.value?i.value:1,boxSizing:"border-box",pointerEvents:"auto",cursor:t.isSelected?"move":"pointer",display:"flex",alignItems:"center",justifyContent:m.value===a.PdfTextAlignment.Left?"flex-start":m.value===a.PdfTextAlignment.Right?"flex-end":"center",overflow:"hidden"})),x=o.computed(()=>({color:c.value,fontSize:s.value*t.scale+"px",...a.standardFontCssProperties(p.value),textAlign:a.textAlignmentToCss(m.value),whiteSpace:d.value?"normal":"nowrap",overflow:"hidden",textOverflow:"ellipsis",padding:"4px"}));return(t,a)=>(o.openBlock(),o.createElementBlock("div",{onPointerdown:a[0]||(a[0]=t=>{var o;e.isSelected||null==(o=e.onClick)||o.call(e,t)}),onMouseenter:a[1]||(a[1]=e=>n.value=!0),onMouseleave:a[2]||(a[2]=e=>n.value=!1),style:o.normalizeStyle(g.value)},[n.value&&u.value?(o.openBlock(),o.createElementBlock("span",{key:0,style:o.normalizeStyle(x.value)},o.toDisplayString(v.value),5)):o.createCommentVNode("",!0)],36))}}),b=[r.createRenderer({id:"redactHighlight",matches:e=>{var t;return e.type===a.PdfAnnotationSubtype.REDACT&&"segmentRects"in e&&((null==(t=e.segmentRects)?void 0:t.length)??0)>0},component:f,interactionDefaults:{isDraggable:!1,isResizable:!1,isRotatable:!1},useAppearanceStream:!1}),r.createRenderer({id:"redactArea",matches:e=>{var t;return!(e.type!==a.PdfAnnotationSubtype.REDACT||"segmentRects"in e&&(null==(t=e.segmentRects)?void 0:t.length))},component:y,interactionDefaults:{isDraggable:!1,isResizable:!1,isRotatable:!1},useAppearanceStream:!1})],k=o.defineComponent({__name:"redact-renderer-registration",setup:e=>(r.useRegisterRenderers(b),(e,t)=>o.renderSlot(e.$slots,"default"))}),h=e.createPluginPackage(t.RedactionPluginPackage).addUtility(k).build();exports.Highlight=i,exports.MarqueeRedact=d,exports.PendingRedactions=g,exports.RedactArea=y,exports.RedactHighlight=f,exports.RedactRendererRegistration=k,exports.RedactionLayer=x,exports.RedactionPluginPackage=h,exports.SelectionRedact=p,exports.redactRenderers=b,exports.useRedaction=e=>{const{provides:n}=u(),a=o.ref(t.initialDocumentState);o.watch([n,()=>o.toValue(e)],([e,o],n,l)=>{if(!e)return void(a.value=t.initialDocumentState);const r=e.forDocument(o);try{a.value=r.getState()}catch(i){a.value=t.initialDocumentState}l(r.onStateChange(e=>{a.value=e}))},{immediate:!0});const l=o.computed(()=>{var t;const a=o.toValue(e);return(null==(t=n.value)?void 0:t.forDocument(a))??null});return{state:a,provides:l}},exports.useRedactionCapability=u,exports.useRedactionPlugin=c,Object.keys(t).forEach(e=>{"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:()=>t[e]})});
|
|
2
|
-
//# sourceMappingURL=index.cjs.map
|
package/dist/vue/index.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../src/vue/components/highlight.vue","../../src/vue/hooks/use-redaction.ts","../../src/vue/components/marquee-redact.vue","../../src/vue/components/selection-redact.vue","../../src/vue/components/pending-redactions.vue","../../src/vue/components/redaction-layer.vue","../../src/vue/components/annotations/redact-highlight.vue","../../src/vue/components/annotations/redact-area.vue","../../src/vue/components/redact-renderers.ts","../../src/vue/components/redact-renderer-registration.vue","../../src/vue/index.ts"],"sourcesContent":["<template>\n <div\n v-for=\"(rect, i) in rects\"\n :key=\"i\"\n @pointerdown=\"onClick\"\n :style=\"{\n position: 'absolute',\n border,\n left: `${(boundingRect ? rect.origin.x - boundingRect.origin.x : rect.origin.x) * scale}px`,\n top: `${(boundingRect ? rect.origin.y - boundingRect.origin.y : rect.origin.y) * scale}px`,\n width: `${rect.size.width * scale}px`,\n height: `${rect.size.height * scale}px`,\n background: color,\n opacity: opacity,\n pointerEvents: onClick ? 'auto' : 'none',\n cursor: onClick ? 'pointer' : 'default',\n zIndex: onClick ? 1 : undefined,\n }\"\n v-bind=\"$attrs\"\n />\n</template>\n\n<script setup lang=\"ts\">\nimport type { Rect } from '@embedpdf/models';\n\ninterface HighlightProps {\n color?: string;\n opacity?: number;\n border?: string;\n rects: Rect[];\n rect?: Rect;\n scale: number;\n onClick?: (e: PointerEvent) => void;\n}\n\nconst props = withDefaults(defineProps<HighlightProps>(), {\n color: '#FFFF00',\n opacity: 1,\n border: '1px solid red',\n});\n\n// Rename rect to boundingRect for clarity in template\nconst boundingRect = props.rect;\n</script>\n","import { ref, watch, computed, toValue, type MaybeRefOrGetter, ComputedRef, Ref } from 'vue';\nimport { useCapability, usePlugin } from '@embedpdf/core/vue';\nimport {\n RedactionPlugin,\n initialDocumentState,\n RedactionDocumentState,\n RedactionScope,\n} from '@embedpdf/plugin-redaction';\n\nexport const useRedactionPlugin = () => usePlugin<RedactionPlugin>(RedactionPlugin.id);\nexport const useRedactionCapability = () => useCapability<RedactionPlugin>(RedactionPlugin.id);\n\n/**\n * Hook for redaction state for a specific document\n * @param documentId Document ID (can be ref, computed, getter, or plain value)\n */\nexport const useRedaction = (\n documentId: MaybeRefOrGetter<string>,\n): {\n state: Readonly<Ref<RedactionDocumentState>>;\n provides: ComputedRef<RedactionScope | null>;\n} => {\n const { provides } = useRedactionCapability();\n const state = ref<RedactionDocumentState>(initialDocumentState);\n\n watch(\n [provides, () => toValue(documentId)],\n ([providesValue, docId], _, onCleanup) => {\n if (!providesValue) {\n state.value = initialDocumentState;\n return;\n }\n\n const scope = providesValue.forDocument(docId);\n\n // Set initial state\n try {\n state.value = scope.getState();\n } catch (e) {\n // Handle case where state might not be ready\n state.value = initialDocumentState;\n }\n\n // Subscribe to changes\n const unsubscribe = scope.onStateChange((newState) => {\n state.value = newState;\n });\n\n onCleanup(unsubscribe);\n },\n { immediate: true },\n );\n\n const scopedProvides = computed(() => {\n const docId = toValue(documentId);\n return provides.value?.forDocument(docId) ?? null;\n });\n\n return {\n state,\n provides: scopedProvides,\n };\n};\n","<template>\n <div\n v-if=\"rect\"\n :style=\"{\n position: 'absolute',\n pointerEvents: 'none',\n left: `${rect.origin.x * actualScale}px`,\n top: `${rect.origin.y * actualScale}px`,\n width: `${rect.size.width * actualScale}px`,\n height: `${rect.size.height * actualScale}px`,\n border: `1px solid ${strokeColor}`,\n background: fill,\n boxSizing: 'border-box',\n }\"\n :class=\"className\"\n />\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, watch, computed } from 'vue';\nimport { useDocumentState } from '@embedpdf/core/vue';\nimport type { Rect } from '@embedpdf/models';\nimport { useRedactionPlugin } from '../hooks/use-redaction';\n\ninterface MarqueeRedactProps {\n /** The ID of the document */\n documentId: string;\n /** Index of the page this layer lives on */\n pageIndex: number;\n /** Scale of the page */\n scale?: number;\n /** Optional CSS class applied to the marquee rectangle */\n className?: string;\n /** Stroke / fill colours (defaults below) */\n stroke?: string;\n fill?: string;\n}\n\nconst props = withDefaults(defineProps<MarqueeRedactProps>(), {\n stroke: 'red',\n fill: 'transparent',\n});\n\nconst { plugin: redactionPlugin } = useRedactionPlugin();\nconst documentState = useDocumentState(() => props.documentId);\nconst rect = ref<Rect | null>(null);\n\nconst actualScale = computed(() => {\n if (props.scale !== undefined) return props.scale;\n return documentState.value?.scale ?? 1;\n});\n\n// Get stroke color from plugin (annotation mode uses tool defaults, legacy uses red)\n// Allow prop override for backwards compatibility\nconst strokeColor = computed(\n () => props.stroke ?? redactionPlugin.value?.getPreviewStrokeColor() ?? 'red',\n);\n\nwatch(\n [redactionPlugin, () => props.documentId, () => props.pageIndex],\n ([plugin, docId, pageIdx], _, onCleanup) => {\n if (!plugin || !docId) return;\n\n const unsubscribe = plugin.onRedactionMarqueeChange(docId, (data) => {\n rect.value = data.pageIndex === pageIdx ? data.rect : null;\n });\n\n onCleanup(unsubscribe);\n },\n { immediate: true },\n);\n</script>\n","<template>\n <div\n v-if=\"boundingRect\"\n :style=\"{\n mixBlendMode: 'normal',\n pointerEvents: 'none',\n position: 'absolute',\n inset: 0,\n }\"\n >\n <Highlight\n :color=\"'transparent'\"\n :opacity=\"1\"\n :rects=\"rects\"\n :scale=\"scale\"\n :border=\"`1px solid ${strokeColor}`\"\n />\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, watch, computed } from 'vue';\nimport type { Rect } from '@embedpdf/models';\nimport { useRedactionPlugin } from '../hooks/use-redaction';\nimport Highlight from './highlight.vue';\n\ninterface SelectionRedactProps {\n documentId: string;\n pageIndex: number;\n scale: number;\n}\n\nconst props = defineProps<SelectionRedactProps>();\n\nconst { plugin: redactionPlugin } = useRedactionPlugin();\nconst rects = ref<Rect[]>([]);\nconst boundingRect = ref<Rect | null>(null);\n\n// Get stroke color from plugin (annotation mode uses tool defaults, legacy uses red)\nconst strokeColor = computed(() => redactionPlugin.value?.getPreviewStrokeColor() ?? 'red');\n\nwatch(\n [redactionPlugin, () => props.documentId, () => props.pageIndex],\n ([plugin, docId, pageIdx], _, onCleanup) => {\n if (!plugin) {\n rects.value = [];\n boundingRect.value = null;\n return;\n }\n\n const unsubscribe = plugin.onRedactionSelectionChange(docId, (formattedSelection) => {\n const selection = formattedSelection.find((s) => s.pageIndex === pageIdx);\n rects.value = selection?.segmentRects ?? [];\n boundingRect.value = selection?.rect ?? null;\n });\n\n onCleanup(unsubscribe);\n },\n { immediate: true },\n);\n</script>\n","<template>\n <div v-if=\"items.length\" :style=\"{ position: 'absolute', inset: 0, pointerEvents: 'none' }\">\n <template v-for=\"item in items\" :key=\"item.id\">\n <!-- Area redaction -->\n <template v-if=\"item.kind === 'area'\">\n <div\n :style=\"{\n position: 'absolute',\n left: `${item.rect.origin.x * scale}px`,\n top: `${item.rect.origin.y * scale}px`,\n width: `${item.rect.size.width * scale}px`,\n height: `${item.rect.size.height * scale}px`,\n background: 'transparent',\n outline: selectedId === item.id ? `1px solid ${bboxStroke}` : 'none',\n outlineOffset: '2px',\n border: `1px solid red`,\n pointerEvents: 'auto',\n cursor: 'pointer',\n }\"\n @pointerdown=\"(e: PointerEvent) => select(e, item.id)\"\n />\n\n <!-- Selection Menu: Supports BOTH render function and slot -->\n <CounterRotate\n v-if=\"shouldShowMenu(item.id)\"\n :rect=\"{\n origin: { x: item.rect.origin.x * scale, y: item.rect.origin.y * scale },\n size: { width: item.rect.size.width * scale, height: item.rect.size.height * scale },\n }\"\n :rotation=\"rotation\"\n >\n <template #default=\"{ rect, menuWrapperProps }\">\n <!-- Priority 1: Render function prop (schema-driven) -->\n <component\n v-if=\"selectionMenu\"\n :is=\"renderSelectionMenu(item, rect, menuWrapperProps)\"\n />\n\n <!-- Priority 2: Slot (manual customization) -->\n <slot\n v-else\n name=\"selection-menu\"\n :context=\"buildContext(item)\"\n :selected=\"selectedId === item.id\"\n :rect=\"rect\"\n :placement=\"menuPlacement\"\n :menuWrapperProps=\"menuWrapperProps\"\n />\n </template>\n </CounterRotate>\n </template>\n\n <!-- Text redaction -->\n <template v-else>\n <div\n :style=\"{\n position: 'absolute',\n left: `${item.rect.origin.x * scale}px`,\n top: `${item.rect.origin.y * scale}px`,\n width: `${item.rect.size.width * scale}px`,\n height: `${item.rect.size.height * scale}px`,\n background: 'transparent',\n outline: selectedId === item.id ? `1px solid ${bboxStroke}` : 'none',\n outlineOffset: '2px',\n pointerEvents: 'auto',\n cursor: selectedId === item.id ? 'pointer' : 'default',\n }\"\n >\n <Highlight\n :rect=\"item.rect\"\n :rects=\"item.rects\"\n color=\"transparent\"\n border=\"1px solid red\"\n :scale=\"scale\"\n :on-click=\"(e: PointerEvent) => select(e, item.id)\"\n />\n </div>\n\n <!-- Selection Menu: Supports BOTH render function and slot -->\n <CounterRotate\n v-if=\"shouldShowMenu(item.id)\"\n :rect=\"{\n origin: {\n x: item.rect.origin.x * scale,\n y: item.rect.origin.y * scale,\n },\n size: {\n width: item.rect.size.width * scale,\n height: item.rect.size.height * scale,\n },\n }\"\n :rotation=\"rotation\"\n >\n <template #default=\"{ rect, menuWrapperProps }\">\n <!-- Priority 1: Render function prop (schema-driven) -->\n <component\n v-if=\"selectionMenu\"\n :is=\"renderSelectionMenu(item, rect, menuWrapperProps)\"\n />\n\n <!-- Priority 2: Slot (manual customization) -->\n <slot\n v-else\n name=\"selection-menu\"\n :context=\"buildContext(item)\"\n :selected=\"selectedId === item.id\"\n :rect=\"rect\"\n :placement=\"menuPlacement\"\n :menuWrapperProps=\"menuWrapperProps\"\n />\n </template>\n </CounterRotate>\n </template>\n </template>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, watch, useSlots, type VNode } from 'vue';\nimport type { Rect } from '@embedpdf/models';\nimport { Rotation } from '@embedpdf/models';\nimport { CounterRotate } from '@embedpdf/utils/vue';\nimport type { MenuWrapperProps, SelectionMenuPlacement } from '@embedpdf/utils/vue';\nimport type { RedactionItem } from '@embedpdf/plugin-redaction';\nimport { useRedactionCapability } from '../hooks/use-redaction';\nimport Highlight from './highlight.vue';\nimport type { RedactionSelectionContext, RedactionSelectionMenuRenderFn } from './types';\n\ninterface PendingRedactionsProps {\n documentId: string;\n pageIndex: number;\n scale: number;\n rotation: Rotation;\n bboxStroke?: string;\n /** Render function for selection menu (schema-driven approach) */\n selectionMenu?: RedactionSelectionMenuRenderFn;\n}\n\nconst props = withDefaults(defineProps<PendingRedactionsProps>(), {\n rotation: Rotation.Degree0,\n bboxStroke: 'rgba(0,0,0,0.8)',\n});\n\nconst slots = useSlots();\nconst { provides: redaction } = useRedactionCapability();\nconst items = ref<RedactionItem[]>([]);\nconst selectedId = ref<string | null>(null);\n\nwatch(\n [redaction, () => props.documentId, () => props.pageIndex],\n ([redactionValue, docId, pageIdx], _, onCleanup) => {\n if (!redactionValue) {\n items.value = [];\n selectedId.value = null;\n return;\n }\n\n const scoped = redactionValue.forDocument(docId);\n\n // Initialize with current state - only show legacy mode items\n const currentState = scoped.getState();\n items.value = (currentState.pending[pageIdx] ?? []).filter((it) => it.source === 'legacy');\n selectedId.value =\n currentState.selected && currentState.selected.page === pageIdx\n ? currentState.selected.id\n : null;\n\n // Subscribe to future changes - only show legacy mode items\n const off1 = scoped.onPendingChange((map) => {\n items.value = (map[pageIdx] ?? []).filter((it) => it.source === 'legacy');\n });\n\n const off2 = scoped.onSelectedChange((sel) => {\n selectedId.value = sel && sel.page === pageIdx ? sel.id : null;\n });\n\n onCleanup(() => {\n off1?.();\n off2?.();\n });\n },\n { immediate: true },\n);\n\nconst select = (e: PointerEvent, id: string) => {\n e.stopPropagation();\n const redactionValue = redaction.value;\n if (!redactionValue) return;\n redactionValue.forDocument(props.documentId).selectPending(props.pageIndex, id);\n};\n\n// --- Selection Menu Logic ---\n\n// Check if we should show menu for this item\nconst shouldShowMenu = (itemId: string): boolean => {\n const isSelected = selectedId.value === itemId;\n return isSelected && (!!props.selectionMenu || !!slots['selection-menu']);\n};\n\n// Build context object for selection menu\nconst buildContext = (item: RedactionItem): RedactionSelectionContext => ({\n type: 'redaction',\n item,\n pageIndex: props.pageIndex,\n});\n\n// Placement hints (could be computed based on position)\nconst menuPlacement: SelectionMenuPlacement = {\n suggestTop: false,\n spaceAbove: 0,\n spaceBelow: 0,\n};\n\n// Render via function (for schema-driven approach)\nconst renderSelectionMenu = (\n item: RedactionItem,\n rect: Rect,\n menuWrapperProps: MenuWrapperProps,\n): VNode | null => {\n if (!props.selectionMenu) return null;\n\n return props.selectionMenu({\n rect,\n menuWrapperProps,\n selected: selectedId.value === item.id,\n placement: menuPlacement,\n context: buildContext(item),\n });\n};\n</script>\n","<template>\n <PendingRedactions\n :document-id=\"documentId\"\n :page-index=\"pageIndex\"\n :scale=\"actualScale\"\n :rotation=\"actualRotation\"\n :bbox-stroke=\"bboxStroke\"\n :selection-menu=\"selectionMenu\"\n >\n <template #selection-menu=\"slotProps\">\n <slot name=\"selection-menu\" v-bind=\"slotProps\" />\n </template>\n </PendingRedactions>\n <MarqueeRedact :document-id=\"documentId\" :page-index=\"pageIndex\" :scale=\"actualScale\" />\n <SelectionRedact :document-id=\"documentId\" :page-index=\"pageIndex\" :scale=\"actualScale\" />\n</template>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport { useDocumentState } from '@embedpdf/core/vue';\nimport { Rotation } from '@embedpdf/models';\nimport PendingRedactions from './pending-redactions.vue';\nimport MarqueeRedact from './marquee-redact.vue';\nimport SelectionRedact from './selection-redact.vue';\nimport { RedactionSelectionMenuRenderFn } from './types';\n\ninterface RedactionLayerProps {\n /** The ID of the document this layer belongs to */\n documentId: string;\n /** Index of the page this layer lives on */\n pageIndex: number;\n /** Current render scale for this page */\n scale?: number;\n /** Page rotation (for counter-rotating menus, etc.) */\n rotation?: Rotation;\n /** Optional bbox stroke color */\n bboxStroke?: string;\n /** Optional menu renderer for a selected redaction */\n selectionMenu?: RedactionSelectionMenuRenderFn;\n}\n\nconst props = withDefaults(defineProps<RedactionLayerProps>(), {\n bboxStroke: 'rgba(0,0,0,0.8)',\n});\n\nconst documentState = useDocumentState(() => props.documentId);\nconst page = computed(() => documentState.value?.document?.pages?.[props.pageIndex]);\n\nconst actualScale = computed(() => {\n if (props.scale !== undefined) return props.scale;\n return documentState.value?.scale ?? 1;\n});\n\nconst actualRotation = computed(() => {\n if (props.rotation !== undefined) return props.rotation;\n // Combine page intrinsic rotation with document rotation\n const pageRotation = page.value?.rotation ?? 0;\n const docRotation = documentState.value?.rotation ?? 0;\n return ((pageRotation + docRotation) % 4) as Rotation;\n});\n</script>\n","<template>\n <div\n @mouseenter=\"isHovered = true\"\n @mouseleave=\"isHovered = false\"\n :style=\"{ position: 'absolute', inset: 0 }\"\n >\n <div v-for=\"(b, i) in segmentRects\" :key=\"i\" @pointerdown=\"onClick\" :style=\"getSegmentStyle(b)\">\n <span v-if=\"isHovered && overlayText\" :style=\"getTextStyle(b)\">\n {{ renderedOverlayText }}\n </span>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, computed, type CSSProperties } from 'vue';\nimport type { AnnotationRendererProps } from '@embedpdf/plugin-annotation/vue';\nimport type { PdfRedactAnnoObject, Rect } from '@embedpdf/models';\nimport {\n PdfStandardFont,\n PdfTextAlignment,\n standardFontCssProperties,\n textAlignmentToCss,\n} from '@embedpdf/models';\n\nconst props = defineProps<AnnotationRendererProps<PdfRedactAnnoObject>>();\nconst isHovered = ref(false);\n\n// Access props.annotation.object directly in computed to maintain reactivity\nconst segmentRects = computed(() => props.annotation.object.segmentRects ?? []);\nconst rect = computed(() => props.annotation.object.rect);\n\n// C - Border/stroke color\nconst strokeColor = computed(() => props.annotation.object.strokeColor ?? '#FF0000');\n// IC - Interior color (background fill when redaction is applied)\nconst color = computed(() => props.annotation.object.color ?? '#000000');\n// CA - Opacity (0-1)\nconst opacity = computed(() => props.annotation.object.opacity ?? 1);\n// OC - Overlay text color (Adobe extension), fallback to fontColor\nconst textColor = computed(\n () => props.annotation.object.fontColor ?? props.annotation.object.overlayColor ?? '#FFFFFF',\n);\n// Overlay text properties\nconst overlayText = computed(() => props.annotation.object.overlayText);\nconst overlayTextRepeat = computed(() => props.annotation.object.overlayTextRepeat ?? false);\nconst fontSize = computed(() => props.annotation.object.fontSize ?? 12);\nconst fontFamily = computed(() => props.annotation.object.fontFamily ?? PdfStandardFont.Helvetica);\nconst textAlign = computed(() => props.annotation.object.textAlign ?? PdfTextAlignment.Center);\n\n// Calculate how many times to repeat text (approximate)\nconst renderedOverlayText = computed(() => {\n if (!overlayText.value) return '';\n if (!overlayTextRepeat.value) return overlayText.value;\n // Repeat text multiple times to fill the space\n const reps = 10;\n return Array(reps).fill(overlayText.value).join(' ');\n});\n\nconst getSegmentStyle = (b: Rect): CSSProperties => ({\n position: 'absolute',\n left: `${(rect.value ? b.origin.x - rect.value.origin.x : b.origin.x) * props.scale}px`,\n top: `${(rect.value ? b.origin.y - rect.value.origin.y : b.origin.y) * props.scale}px`,\n width: `${b.size.width * props.scale}px`,\n height: `${b.size.height * props.scale}px`,\n // Default: transparent background with strokeColor (C) border\n // Hovered: color (IC) background fill, no border\n background: isHovered.value ? color.value : 'transparent',\n border: !isHovered.value ? `2px solid ${strokeColor.value}` : 'none',\n opacity: isHovered.value ? opacity.value : 1,\n boxSizing: 'border-box',\n pointerEvents: 'auto',\n cursor: 'pointer',\n display: 'flex',\n alignItems: 'center',\n justifyContent:\n textAlign.value === PdfTextAlignment.Left\n ? 'flex-start'\n : textAlign.value === PdfTextAlignment.Right\n ? 'flex-end'\n : 'center',\n overflow: 'hidden',\n});\n\nconst getTextStyle = (b: Rect): CSSProperties => ({\n color: textColor.value,\n fontSize: `${Math.min(fontSize.value * props.scale, b.size.height * props.scale * 0.8)}px`,\n ...standardFontCssProperties(fontFamily.value),\n textAlign: textAlignmentToCss(textAlign.value),\n whiteSpace: overlayTextRepeat.value ? 'normal' : 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n lineHeight: 1,\n});\n</script>\n","<template>\n <div\n @pointerdown=\"\n (e) => {\n if (!isSelected) onClick?.(e);\n }\n \"\n @mouseenter=\"isHovered = true\"\n @mouseleave=\"isHovered = false\"\n :style=\"containerStyle\"\n >\n <span v-if=\"isHovered && overlayText\" :style=\"textStyle\">\n {{ renderedOverlayText }}\n </span>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, computed, type CSSProperties } from 'vue';\nimport type { AnnotationRendererProps } from '@embedpdf/plugin-annotation/vue';\nimport type { PdfRedactAnnoObject } from '@embedpdf/models';\nimport {\n PdfStandardFont,\n PdfTextAlignment,\n standardFontCssProperties,\n textAlignmentToCss,\n} from '@embedpdf/models';\n\nconst props = defineProps<AnnotationRendererProps<PdfRedactAnnoObject>>();\nconst isHovered = ref(false);\n\n// Access props.annotation.object directly in computed to maintain reactivity\n// C - Border/stroke color\nconst strokeColor = computed(() => props.annotation.object.strokeColor ?? '#FF0000');\n// IC - Interior color (background fill when redaction is applied)\nconst color = computed(() => props.annotation.object.color ?? '#000000');\n// CA - Opacity (0-1)\nconst opacity = computed(() => props.annotation.object.opacity ?? 1);\n// OC - Overlay text color (Adobe extension), fallback to fontColor\nconst textColor = computed(\n () => props.annotation.object.fontColor ?? props.annotation.object.overlayColor ?? '#FFFFFF',\n);\n// Overlay text properties\nconst overlayText = computed(() => props.annotation.object.overlayText);\nconst overlayTextRepeat = computed(() => props.annotation.object.overlayTextRepeat ?? false);\nconst fontSize = computed(() => props.annotation.object.fontSize ?? 12);\nconst fontFamily = computed(() => props.annotation.object.fontFamily ?? PdfStandardFont.Helvetica);\nconst textAlign = computed(() => props.annotation.object.textAlign ?? PdfTextAlignment.Center);\n\n// Calculate how many times to repeat text (approximate)\nconst renderedOverlayText = computed(() => {\n if (!overlayText.value) return '';\n if (!overlayTextRepeat.value) return overlayText.value;\n // Repeat text multiple times to fill the space\n const reps = 10;\n return Array(reps).fill(overlayText.value).join(' ');\n});\n\nconst containerStyle = computed<CSSProperties>(() => ({\n position: 'absolute',\n inset: 0,\n // Default: transparent background with strokeColor (C) border\n // Hovered: color (IC) background fill, no border\n background: isHovered.value ? color.value : 'transparent',\n border: !isHovered.value ? `2px solid ${strokeColor.value}` : 'none',\n opacity: isHovered.value ? opacity.value : 1,\n boxSizing: 'border-box',\n pointerEvents: 'auto',\n cursor: props.isSelected ? 'move' : 'pointer',\n display: 'flex',\n alignItems: 'center',\n justifyContent:\n textAlign.value === PdfTextAlignment.Left\n ? 'flex-start'\n : textAlign.value === PdfTextAlignment.Right\n ? 'flex-end'\n : 'center',\n overflow: 'hidden',\n}));\n\nconst textStyle = computed<CSSProperties>(() => ({\n color: textColor.value,\n fontSize: `${fontSize.value * props.scale}px`,\n ...standardFontCssProperties(fontFamily.value),\n textAlign: textAlignmentToCss(textAlign.value),\n whiteSpace: overlayTextRepeat.value ? 'normal' : 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n padding: '4px',\n}));\n</script>\n","import { createRenderer, type BoxedAnnotationRenderer } from '@embedpdf/plugin-annotation/vue';\nimport { PdfAnnotationSubtype, type PdfRedactAnnoObject } from '@embedpdf/models';\nimport RedactHighlight from './annotations/redact-highlight.vue';\nimport RedactArea from './annotations/redact-area.vue';\n\n/**\n * Boxed annotation renderers for Redact annotations.\n * Type safety is enforced at definition time via createRenderer.\n * These are automatically registered with the annotation plugin via context.\n */\nexport const redactRenderers: BoxedAnnotationRenderer[] = [\n createRenderer<PdfRedactAnnoObject>({\n id: 'redactHighlight',\n matches: (a): a is PdfRedactAnnoObject =>\n a.type === PdfAnnotationSubtype.REDACT &&\n 'segmentRects' in a &&\n (a.segmentRects?.length ?? 0) > 0,\n component: RedactHighlight,\n interactionDefaults: { isDraggable: false, isResizable: false, isRotatable: false },\n useAppearanceStream: false,\n }),\n createRenderer<PdfRedactAnnoObject>({\n id: 'redactArea',\n matches: (a): a is PdfRedactAnnoObject =>\n a.type === PdfAnnotationSubtype.REDACT &&\n (!('segmentRects' in a) || !(a.segmentRects?.length ?? 0)),\n component: RedactArea,\n interactionDefaults: { isDraggable: false, isResizable: false, isRotatable: false },\n useAppearanceStream: false,\n }),\n];\n","<script setup lang=\"ts\">\nimport { useRegisterRenderers } from '@embedpdf/plugin-annotation/vue';\nimport { redactRenderers } from './redact-renderers';\n\n/**\n * Utility component that registers redact renderers once at app level.\n * Added via addUtility() so it mounts once, not per-page.\n */\nuseRegisterRenderers(redactRenderers);\n</script>\n\n<template>\n <slot />\n</template>\n","import { createPluginPackage } from '@embedpdf/core';\nimport { RedactionPluginPackage as BaseRedactionPackage } from '@embedpdf/plugin-redaction';\nimport { RedactRendererRegistration } from './components';\n\nexport * from './hooks';\nexport * from './components';\nexport * from './components/types';\nexport * from '@embedpdf/plugin-redaction';\n\n// Automatically register redact renderers when plugin is loaded\nexport const RedactionPluginPackage = createPluginPackage(BaseRedactionPackage)\n .addUtility(RedactRendererRegistration)\n .build();\n"],"names":["boundingRect","__props","rect","_openBlock","_createElementBlock","_Fragment","_renderList","rects","i","_mergeProps","key","onPointerdown","_cache","onClick","args","style","border","left","_unref","origin","x","scale","top","y","width","size","height","color","opacity","zIndex","$attrs","useRedactionPlugin","usePlugin","RedactionPlugin","id","useRedactionCapability","useCapability","props","plugin","redactionPlugin","documentState","useDocumentState","documentId","ref","actualScale","computed","_a","value","strokeColor","stroke","getPreviewStrokeColor","watch","pageIndex","docId","pageIdx","_","onCleanup","onRedactionMarqueeChange","data","immediate","_normalizeStyle","fill","class","className","onRedactionSelectionChange","formattedSelection","selection","find","s","segmentRects","_hoisted_1","_createVNode","Highlight","slots","useSlots","provides","redaction","items","selectedId","redactionValue","scoped","forDocument","currentState","getState","pending","filter","it","source","selected","page","off1","onPendingChange","map","off2","onSelectedChange","sel","select","e","stopPropagation","selectPending","shouldShowMenu","itemId","selectionMenu","buildContext","item","type","menuPlacement","suggestTop","spaceAbove","spaceBelow","renderSelectionMenu","menuWrapperProps","placement","context","length","kind","_createElementVNode","outline","bboxStroke","_createBlock","CounterRotate","rotation","default","_withCtx","_resolveDynamicComponent","_renderSlot","_ctx","$slots","_c","_b","document","pages","actualRotation","PendingRedactions","slotProps","MarqueeRedact","SelectionRedact","isHovered","annotation","object","textColor","fontColor","overlayColor","overlayText","overlayTextRepeat","fontSize","fontFamily","PdfStandardFont","Helvetica","textAlign","PdfTextAlignment","Center","renderedOverlayText","Array","join","getSegmentStyle","b","position","background","boxSizing","pointerEvents","cursor","display","alignItems","justifyContent","Left","Right","overflow","getTextStyle","Math","min","standardFontCssProperties","textAlignmentToCss","whiteSpace","textOverflow","lineHeight","onMouseenter","onMouseleave","inset","containerStyle","isSelected","textStyle","padding","call","redactRenderers","createRenderer","matches","a","PdfAnnotationSubtype","REDACT","component","RedactHighlight","interactionDefaults","isDraggable","isResizable","isRotatable","useAppearanceStream","RedactArea","useRegisterRenderers","RedactionPluginPackage","createPluginPackage","BaseRedactionPackage","addUtility","RedactRendererRegistration","build","state","initialDocumentState","toValue","providesValue","scope","onStateChange","newState","scopedProvides"],"mappings":"oeAmCA,MAOMA,EAPQ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U,OAG/C,MAAO,CACLwJ,QACAlI,SAAUyI"}
|
package/dist/vue/index.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export * from './hooks';
|
|
2
|
-
export * from './components';
|
|
3
|
-
export * from './components/types';
|
|
4
|
-
export * from '../lib';
|
|
5
|
-
export declare const RedactionPluginPackage: import('@embedpdf/core').WithAutoMount<import('@embedpdf/core').PluginPackage<import('../lib').RedactionPlugin, import('../lib').RedactionPluginConfig, import('../lib').RedactionState, import('src/lib/actions').RedactionAction>>;
|