@embedpdf/plugin-redaction 2.4.1 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/preact/index.cjs +1 -1
- package/dist/preact/index.cjs.map +1 -1
- package/dist/preact/index.js +6 -2
- package/dist/preact/index.js.map +1 -1
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +6 -2
- package/dist/react/index.js.map +1 -1
- package/dist/svelte/index.cjs +1 -1
- package/dist/svelte/index.cjs.map +1 -1
- package/dist/svelte/index.js +9 -2
- package/dist/svelte/index.js.map +1 -1
- package/dist/vue/index.cjs +1 -1
- package/dist/vue/index.cjs.map +1 -1
- package/dist/vue/index.js +8 -2
- package/dist/vue/index.js.map +1 -1
- package/package.json +13 -13
package/dist/vue/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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 @touchstart=\"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 | TouchEvent) => 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, actualScale],\n ([plugin, docId, pageIdx, scale], _, onCleanup) => {\n if (!plugin || !docId) return;\n\n const unregister = plugin.registerMarqueeOnPage({\n documentId: docId,\n pageIndex: pageIdx,\n scale,\n callback: {\n onPreview: (newRect) => {\n rect.value = newRect;\n },\n },\n });\n\n onCleanup(unregister);\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 @touchstart=\"(e: TouchEvent) => 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 | TouchEvent) => 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 | TouchEvent, 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);\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 return documentState.value?.rotation ?? Rotation.Degree0;\n});\n</script>\n","<template>\n <div\n @mouseenter=\"isHovered = true\"\n @mouseleave=\"isHovered = false\"\n :style=\"{ position: 'absolute', inset: 0 }\"\n >\n <div\n v-for=\"(b, i) in segmentRects\"\n :key=\"i\"\n @pointerdown=\"onClick\"\n @touchstart=\"onClick\"\n :style=\"getSegmentStyle(b)\"\n >\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 standardFontCss,\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 fontFamily: standardFontCss(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 @touchstart=\"\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 standardFontCss,\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 fontFamily: standardFontCss(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 }),\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 }),\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","onTouchstart","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","registerMarqueeOnPage","callback","onPreview","newRect","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","actualRotation","Rotation","Degree0","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","standardFontCss","textAlignmentToCss","whiteSpace","textOverflow","lineHeight","onMouseenter","onMouseleave","inset","containerStyle","isSelected","textStyle","padding","redactRenderers","createRenderer","matches","a","PdfAnnotationSubtype","REDACT","component","RedactHighlight","RedactArea","useRegisterRenderers","RedactionPluginPackage","createPluginPackage","BaseRedactionPackage","addUtility","RedactRendererRegistration","build","state","initialDocumentState","toValue","providesValue","scope","onStateChange","newState","scopedProvides"],"mappings":"oeAoCA,MAOMA,EAPQC,EAOaC,mBA1CzBC,aAAA,GAAAC,EAAAA,mBAmBEC,EAAAA,SAAA,KAAAC,EAAAA,WAlBoBL,EAAAM,MAAK,CAAjBL,EAAMM,KADhBL,cAAAC,qBAmBE,MAnBFK,EAAAA,WAmBE,CAjBCC,IAAKF,EACLG,cAAWC,EAAA,KAAAA,EAAA,WAAEX,EAAAY,SAAAZ,EAAAY,W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AF,EAAAzB,EAAgBsE,SAAU,GAAK,GAClCyE,UAAWC,IAEbN,iBAAoC,CAClCtJ,GAAI,aACJuJ,QAAUC,UACR,QAAAA,EAAE/E,OAASgF,EAAAA,qBAAqBC,QAC7B,iBAAkBF,IAAQ,OAAA5I,EAAA4I,EAAEnH,mBAAF,EAAAzB,EAAgBsE,UAC/CyE,UAAWE,0EChBfC,EAAAA,qBAAqBT,UAInBxD,aAAQC,EAAAC,OAAA,cCFGgE,EAAyBC,EAAAA,oBAAoBC,EAAAA,wBACvDC,WAAWC,GACXC,uSTKD5J,IAKA,MAAMmC,SAAEA,GAAa1C,IACfoK,EAAQ5J,EAAAA,IAA4B6J,wBAE1CrJ,EAAAA,MACE,CAAC0B,EAAU,IAAM4H,UAAQ/J,IACzB,EAAEgK,EAAerJ,GAAQE,EAAGC,KAC1B,IAAKkJ,EAEH,YADAH,EAAMxJ,MAAQyJ,EAAAA,sBAIhB,MAAMG,EAAQD,EAAcvH,YAAY9B,GAGxC,IACEkJ,EAAMxJ,MAAQ4J,EAAMtH,UACtB,OAASc,GAEPoG,EAAMxJ,MAAQyJ,EAAAA,oBAChB,CAOAhJ,EAJoBmJ,EAAMC,cAAeC,IACvCN,EAAMxJ,MAAQ8J,MAKlB,CAAEhJ,WAAW,IAGf,MAAMiJ,EAAiBjK,EAAAA,SAAS,WAC9B,MAAMQ,EAAQoJ,EAAAA,QAAQ/J,GACtB,OAAO,OAAAI,EAAA+B,EAAS9B,YAAT,EAAAD,EAAgBqC,YAAY9B,KAAU,OAG/C,MAAO,CACLkJ,QACA1H,SAAUiI"}
|
|
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 @touchstart=\"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 | TouchEvent) => 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, actualScale],\n ([plugin, docId, pageIdx, scale], _, onCleanup) => {\n if (!plugin || !docId) return;\n\n const unregister = plugin.registerMarqueeOnPage({\n documentId: docId,\n pageIndex: pageIdx,\n scale,\n callback: {\n onPreview: (newRect) => {\n rect.value = newRect;\n },\n },\n });\n\n onCleanup(unregister);\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 @touchstart=\"(e: TouchEvent) => 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 | TouchEvent) => 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 | TouchEvent, 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\n v-for=\"(b, i) in segmentRects\"\n :key=\"i\"\n @pointerdown=\"onClick\"\n @touchstart=\"onClick\"\n :style=\"getSegmentStyle(b)\"\n >\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 standardFontCss,\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 fontFamily: standardFontCss(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 @touchstart=\"\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 standardFontCss,\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 fontFamily: standardFontCss(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 }),\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 }),\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","onTouchstart","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","registerMarqueeOnPage","callback","onPreview","newRect","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","standardFontCss","textAlignmentToCss","whiteSpace","textOverflow","lineHeight","onMouseenter","onMouseleave","inset","containerStyle","isSelected","textStyle","padding","redactRenderers","createRenderer","matches","a","PdfAnnotationSubtype","REDACT","component","RedactHighlight","RedactArea","useRegisterRenderers","RedactionPluginPackage","createPluginPackage","BaseRedactionPackage","addUtility","RedactRendererRegistration","build","state","initialDocumentState","toValue","providesValue","scope","onStateChange","newState","scopedProvides"],"mappings":"oeAoCA,MAOMA,EAPQC,EAOaC,mBA1CzBC,aAAA,GAAAC,EAAAA,mBAmBEC,EAAAA,SAAA,KAAAC,EAAAA,WAlBoBL,EAAAM,MAAK,CAAjBL,EAAMM,KADhBL,cAAAC,qBAmBE,MAnBFK,EAAAA,WAmBE,CAjBCC,IAAKF,EACLG,cAAWC,EAAA,KAAAA,EAAA,WAAEX,EAAAY,SAAAZ,EAAAY,WAAAC,IACbC,aAAUH,EAAA,KAAAA,EAAA,WAAEX,EAAAY,SAAAZ,EAAAY,WAAAC,IACZE,MAAK,4BAAsCf,EAAAgB,OAAwBC,MAAAC,QAAAnB,GAAeE,EAAKkB,OAAOC,EAAIF,EAAAA,MAAAnB,GAAaoB,OAAOC,EAAInB,EAAKkB,OAAOC,GAAKpB,EAAAqB,MAAxE,KAAkGC,KAAAJ,QAAAnB,GAAeE,EAAKkB,OAAOI,EAAIL,EAAAA,MAAAnB,GAAaoB,OAAOI,EAAItB,EAAKkB,OAAOI,GAAKvB,EAAAqB,MAAxE,KAAmGG,MAAAvB,EAAKwB,KAAKD,MAAQxB,EAAAqB,MAAlB,KAA8CK,OAAAzB,EAAKwB,KAAKC,OAAS1B,EAAAqB,MAAnB,gBAAgDrB,EAAA2B,cAAsB3B,EAAA4B,sBAA8B5B,EAAAY,QAAO,OAAA,cAAkCZ,EAAAY,QAAO,UAAA,UAAwCiB,OAAA7B,EAAAY,eAAc,iBAazfkB,EAAAA,QAAM,KAAA,eCVLC,EAAqB,IAAMC,YAA2BC,EAAAA,gBAAg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AQjK,IACzB,EAAEkK,EAAevJ,GAAQE,EAAGC,KAC1B,IAAKoJ,EAEH,YADAH,EAAM1J,MAAQ2J,EAAAA,sBAIhB,MAAMG,EAAQD,EAAczH,YAAY9B,GAGxC,IACEoJ,EAAM1J,MAAQ8J,EAAMxH,UACtB,OAASc,GAEPsG,EAAM1J,MAAQ2J,EAAAA,oBAChB,CAOAlJ,EAJoBqJ,EAAMC,cAAeC,IACvCN,EAAM1J,MAAQgK,MAKlB,CAAElJ,WAAW,IAGf,MAAMmJ,EAAiBnK,EAAAA,SAAS,WAC9B,MAAMQ,EAAQsJ,EAAAA,QAAQjK,GACtB,OAAO,OAAAI,EAAA+B,EAAS9B,YAAT,EAAAD,EAAgBqC,YAAY9B,KAAU,OAG/C,MAAO,CACLoJ,QACA5H,SAAUmI"}
|
package/dist/vue/index.js
CHANGED
|
@@ -389,15 +389,21 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
389
389
|
setup(__props) {
|
|
390
390
|
const props = __props;
|
|
391
391
|
const documentState = useDocumentState(() => props.documentId);
|
|
392
|
+
const page = computed(() => {
|
|
393
|
+
var _a, _b, _c;
|
|
394
|
+
return (_c = (_b = (_a = documentState.value) == null ? void 0 : _a.document) == null ? void 0 : _b.pages) == null ? void 0 : _c[props.pageIndex];
|
|
395
|
+
});
|
|
392
396
|
const actualScale = computed(() => {
|
|
393
397
|
var _a;
|
|
394
398
|
if (props.scale !== void 0) return props.scale;
|
|
395
399
|
return ((_a = documentState.value) == null ? void 0 : _a.scale) ?? 1;
|
|
396
400
|
});
|
|
397
401
|
const actualRotation = computed(() => {
|
|
398
|
-
var _a;
|
|
402
|
+
var _a, _b;
|
|
399
403
|
if (props.rotation !== void 0) return props.rotation;
|
|
400
|
-
|
|
404
|
+
const pageRotation = ((_a = page.value) == null ? void 0 : _a.rotation) ?? 0;
|
|
405
|
+
const docRotation = ((_b = documentState.value) == null ? void 0 : _b.rotation) ?? 0;
|
|
406
|
+
return (pageRotation + docRotation) % 4;
|
|
401
407
|
});
|
|
402
408
|
return (_ctx, _cache) => {
|
|
403
409
|
return openBlock(), createElementBlock(Fragment, null, [
|
package/dist/vue/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","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 @touchstart=\"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 | TouchEvent) => 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, actualScale],\n ([plugin, docId, pageIdx, scale], _, onCleanup) => {\n if (!plugin || !docId) return;\n\n const unregister = plugin.registerMarqueeOnPage({\n documentId: docId,\n pageIndex: pageIdx,\n scale,\n callback: {\n onPreview: (newRect) => {\n rect.value = newRect;\n },\n },\n });\n\n onCleanup(unregister);\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 @touchstart=\"(e: TouchEvent) => 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 | TouchEvent) => 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 | TouchEvent, 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);\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 return documentState.value?.rotation ?? Rotation.Degree0;\n});\n</script>\n","<template>\n <div\n @mouseenter=\"isHovered = true\"\n @mouseleave=\"isHovered = false\"\n :style=\"{ position: 'absolute', inset: 0 }\"\n >\n <div\n v-for=\"(b, i) in segmentRects\"\n :key=\"i\"\n @pointerdown=\"onClick\"\n @touchstart=\"onClick\"\n :style=\"getSegmentStyle(b)\"\n >\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 standardFontCss,\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 fontFamily: standardFontCss(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 @touchstart=\"\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 standardFontCss,\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 fontFamily: standardFontCss(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 }),\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 }),\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":["_openBlock","_createElementBlock","_Fragment","_renderList","_mergeProps","_unref","$attrs","_normalizeStyle","_hoisted_1","_createVNode","Highlight","_createElementVNode","_createBlock","_withCtx","_resolveDynamicComponent","_renderSlot","PendingRedactions","MarqueeRedact","SelectionRedact","RedactHighlight","RedactArea","BaseRedactionPackage","RedactRendererRegistration"],"mappings":";;;;;;;;;;;;;;;;;;;;AAoCA,UAAM,QAAQ;AAOd,UAAM,eAAe,MAAM;;AA1CzB,aAAAA,UAAA,IAAA,GAAAC,mBAmBEC,UAAA,MAAAC,WAlBoB,QAAA,OAAK,CAAjB,MAAM,MAAC;AADjB,eAAAH,UAAA,GAAAC,mBAmBE,OAnBFG,WAmBE;AAAA,UAjBC,KAAK;AAAA,UACL,eAAW,OAAA,CAAA,MAAA,OAAA,CAAA;AAAA,uBAAE,QAAA,WAAA,QAAA,QAAA,GAAA,IAAA;AAAA,UACb,cAAU,OAAA,CAAA,MAAA,OAAA,CAAA;AAAA,uBAAE,QAAA,WAAA,QAAA,QAAA,GAAA,IAAA;AAAA,UACZ,OAAK;AAAA;oBAAsC,QAAA;AAAA,YAAwB,MAAA,IAAAC,MAAA,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AC;AAAA;QAK9D,oDAAY,UAAA,QAAS;AAAA,QACrB,oDAAY,UAAA,QAAS;AAAA,QACrB,sBAAO,eAAA,KAAc;AAAA,MAAA;QAEV,UAAA,SAAa,YAAA,sBAAzBA,mBAEO,QAAA;AAAA;UAFgC,sBAAO,UAAA,KAAS;AAAA,QAAA,mBAClD,oBAAA,KAAmB,GAAA,CAAA;;;;;ACPrB,MAAM,kBAA6C;AAAA,EACxD,eAAoC;AAAA,IAClC,IAAI;AAAA,IACJ,SAAS,CAAC,MAAA;;AACR,eAAE,SAAS,qBAAqB,UAChC,kBAAkB,QACjB,OAAE,iBAAF,mBAAgB,WAAU,KAAK;AAAA;AAAA,IAClC,WAAWkB;AAAAA,EAAA,CACZ;AAAA,EACD,eAAoC;AAAA,IAClC,IAAI;AAAA,IACJ,SAAS,CAAC,MAAA;;AACR,eAAE,SAAS,qBAAqB,WAC/B,EAAE,kBAAkB,MAAM,IAAE,OAAE,iBAAF,mBAAgB,WAAU;AAAA;AAAA,IACzD,WAAWC;AAAAA,EAAA,CACZ;AACH;;;;AClBA,yBAAqB,eAAe;;aAIlCL,WAAQ,KAAA,QAAA,SAAA;AAAA;;;ACFH,MAAM,yBAAyB,oBAAoBM,wBAAoB,EAC3E,WAAWC,SAA0B,EACrC,MAAA;"}
|
|
1
|
+
{"version":3,"file":"index.js","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 @touchstart=\"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 | TouchEvent) => 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, actualScale],\n ([plugin, docId, pageIdx, scale], _, onCleanup) => {\n if (!plugin || !docId) return;\n\n const unregister = plugin.registerMarqueeOnPage({\n documentId: docId,\n pageIndex: pageIdx,\n scale,\n callback: {\n onPreview: (newRect) => {\n rect.value = newRect;\n },\n },\n });\n\n onCleanup(unregister);\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 @touchstart=\"(e: TouchEvent) => 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 | TouchEvent) => 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 | TouchEvent, 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\n v-for=\"(b, i) in segmentRects\"\n :key=\"i\"\n @pointerdown=\"onClick\"\n @touchstart=\"onClick\"\n :style=\"getSegmentStyle(b)\"\n >\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 standardFontCss,\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 fontFamily: standardFontCss(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 @touchstart=\"\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 standardFontCss,\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 fontFamily: standardFontCss(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 }),\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 }),\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":["_openBlock","_createElementBlock","_Fragment","_renderList","_mergeProps","_unref","$attrs","_normalizeStyle","_hoisted_1","_createVNode","Highlight","_createElementVNode","_createBlock","_withCtx","_resolveDynamicComponent","_renderSlot","PendingRedactions","MarqueeRedact","SelectionRedact","RedactHighlight","RedactArea","BaseRedactionPackage","RedactRendererRegistration"],"mappings":";;;;;;;;;;;;;;;;;;;;AAoCA,UAAM,QAAQ;AAOd,UAAM,eAAe,MAAM;;AA1CzB,aAAAA,UAAA,IAAA,GAAAC,mBAmBEC,UAAA,MAAAC,WAlBoB,QAAA,OAAK,CAAjB,MAAM,MAAC;AADjB,eAAAH,UAAA,GAAAC,mBAmBE,OAnBFG,WAmBE;AAAA,UAjBC,KAAK;AAAA,UACL,eAAW,OAAA,CAAA,MAAA,OAAA,CAAA;AAAA,uBAAE,QAAA,WAAA,QAAA,QAAA,GAAA,IAAA;AAAA,UACb,cAAU,OAAA,CAAA,MAAA,OAAA,CAAA;AAAA,uBAAE,QAAA,WAAA,QAAA,QAAA,GAAA,IAAA;AAAA,UACZ,OAAK;AAAA;oBAAsC,QAAA;AAAA,YAAwB,MAAA,IAAAC,MAAA,YAAA,IAAe,KAAK,OAAO,IAAIA,MAAA,YAAA,EAAa,OAAO,IAAI,KAAK,OAAO,KAAK,QAAA,KAAK;AAAA,YAAqB,KAAA,IAAAA,MAAA,YAAA,IAAe,KAAK,OAAO,IAAIA,MAAA,YAAA,EAAa,OAAO,IAAI,KAAK,OAAO,KAAK,QAAA,KAAK;AAAA,YAAsB,OAAA,GAAA,KAAK,KAAK,QAAQ,QAAA,KAAK;AAAA,YAAuB,QAAA,GAAA,KAAK,KAAK,SAAS,QAAA,KAAK;AAAA,wBAAwB,QAAA;AAAA,qBAAsB,QAAA;AAAA,2BAA8B,QAAA,UAAO,SAAA;AAAA,oBAAkC,QAAA,UAAO,YAAA;AAAA,YAAwC,Q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EACxD,eAAoC;AAAA,IAClC,IAAI;AAAA,IACJ,SAAS,CAAC,MAAA;;AACR,eAAE,SAAS,qBAAqB,UAChC,kBAAkB,QACjB,OAAE,iBAAF,mBAAgB,WAAU,KAAK;AAAA;AAAA,IAClC,WAAWkB;AAAAA,EAAA,CACZ;AAAA,EACD,eAAoC;AAAA,IAClC,IAAI;AAAA,IACJ,SAAS,CAAC,MAAA;;AACR,eAAE,SAAS,qBAAqB,WAC/B,EAAE,kBAAkB,MAAM,IAAE,OAAE,iBAAF,mBAAgB,WAAU;AAAA;AAAA,IACzD,WAAWC;AAAAA,EAAA,CACZ;AACH;;;;AClBA,yBAAqB,eAAe;;aAIlCL,WAAQ,KAAA,QAAA,SAAA;AAAA;;;ACFH,MAAM,yBAAyB,oBAAoBM,wBAAoB,EAC3E,WAAWC,SAA0B,EACrC,MAAA;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@embedpdf/plugin-redaction",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -35,18 +35,18 @@
|
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@embedpdf/models": "2.
|
|
39
|
-
"@embedpdf/utils": "2.
|
|
38
|
+
"@embedpdf/models": "2.5.0",
|
|
39
|
+
"@embedpdf/utils": "2.5.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@types/react": "^18.2.0",
|
|
43
43
|
"typescript": "^5.0.0",
|
|
44
44
|
"@embedpdf/build": "1.1.0",
|
|
45
|
-
"@embedpdf/plugin-annotation": "2.
|
|
46
|
-
"@embedpdf/plugin-
|
|
47
|
-
"@embedpdf/core": "2.
|
|
48
|
-
"@embedpdf/plugin-
|
|
49
|
-
"@embedpdf/plugin-history": "2.
|
|
45
|
+
"@embedpdf/plugin-annotation": "2.5.0",
|
|
46
|
+
"@embedpdf/plugin-interaction-manager": "2.5.0",
|
|
47
|
+
"@embedpdf/core": "2.5.0",
|
|
48
|
+
"@embedpdf/plugin-selection": "2.5.0",
|
|
49
|
+
"@embedpdf/plugin-history": "2.5.0"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"preact": "^10.26.4",
|
|
@@ -54,11 +54,11 @@
|
|
|
54
54
|
"react-dom": ">=16.8.0",
|
|
55
55
|
"vue": ">=3.2.0",
|
|
56
56
|
"svelte": ">=5 <6",
|
|
57
|
-
"@embedpdf/core": "2.
|
|
58
|
-
"@embedpdf/plugin-
|
|
59
|
-
"@embedpdf/plugin-
|
|
60
|
-
"@embedpdf/plugin-
|
|
61
|
-
"@embedpdf/plugin-interaction-manager": "2.
|
|
57
|
+
"@embedpdf/core": "2.5.0",
|
|
58
|
+
"@embedpdf/plugin-annotation": "2.5.0",
|
|
59
|
+
"@embedpdf/plugin-selection": "2.5.0",
|
|
60
|
+
"@embedpdf/plugin-history": "2.5.0",
|
|
61
|
+
"@embedpdf/plugin-interaction-manager": "2.5.0"
|
|
62
62
|
},
|
|
63
63
|
"files": [
|
|
64
64
|
"dist",
|