@embedpdf/plugin-redaction 2.6.2 → 2.8.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/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/tools.d.ts +2 -0
- package/dist/preact/index.cjs +1 -1
- package/dist/preact/index.cjs.map +1 -1
- package/dist/preact/index.js +25 -7
- 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 +25 -7
- package/dist/react/index.js.map +1 -1
- package/dist/shared/components/annotations/redact-area.d.ts +2 -2
- package/dist/shared/components/annotations/redact-highlight.d.ts +2 -2
- package/dist/shared/components/highlight.d.ts +2 -2
- package/dist/shared-preact/components/annotations/redact-area.d.ts +2 -2
- package/dist/shared-preact/components/annotations/redact-highlight.d.ts +2 -2
- package/dist/shared-preact/components/highlight.d.ts +2 -2
- package/dist/shared-react/components/annotations/redact-area.d.ts +2 -2
- package/dist/shared-react/components/annotations/redact-highlight.d.ts +2 -2
- package/dist/shared-react/components/highlight.d.ts +2 -2
- package/dist/svelte/components/highlight.svelte.d.ts +1 -1
- package/dist/svelte/index.cjs +1 -1
- package/dist/svelte/index.cjs.map +1 -1
- package/dist/svelte/index.js +10 -18
- package/dist/svelte/index.js.map +1 -1
- package/dist/vue/components/highlight.vue.d.ts +1 -1
- package/dist/vue/components/redaction-layer.vue.d.ts +1 -1
- package/dist/vue/index.cjs +1 -1
- package/dist/vue/index.cjs.map +1 -1
- package/dist/vue/index.js +22 -18
- package/dist/vue/index.js.map +1 -1
- package/package.json +13 -13
package/dist/vue/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@embedpdf/core"),t=require("@embedpdf/plugin-redaction"),o=require("vue"),n=require("@embedpdf/core/vue"),l=require("@embedpdf/models"),a=require("@embedpdf/utils/vue"),r=require("@embedpdf/plugin-annotation/vue"),i=o.defineComponent({__name:"highlight",props:{color:{default:"#FFFF00"},opacity:{default:1},border:{default:"1px solid red"},rects:{},rect:{},scale:{},onClick:{}},setup(e){const t=e.rect;return(n,l)=>(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.rects,(a,r)=>(o.openBlock(),o.createElementBlock("div",o.mergeProps({key:r,onPointerdown:l[0]||(l[0]=(...t)=>e.onClick&&e.onClick(...t)),onTouchstart:l[1]||(l[1]=(...t)=>e.onClick&&e.onClick(...t)),style:{position:"absolute",border:e.border,left:(o.unref(t)?a.origin.x-o.unref(t).origin.x:a.origin.x)*e.scale+"px",top:(o.unref(t)?a.origin.y-o.unref(t).origin.y:a.origin.y)*e.scale+"px",width:a.size.width*e.scale+"px",height:a.size.height*e.scale+"px",background:e.color,opacity:e.opacity,pointerEvents:e.onClick?"auto":"none",cursor:e.onClick?"pointer":"default",zIndex:e.onClick?1:void 0}},{ref_for:!0},n.$attrs),null,16))),128))}}),c=()=>n.usePlugin(t.RedactionPlugin.id),u=()=>n.useCapability(t.RedactionPlugin.id),d=o.defineComponent({__name:"marquee-redact",props:{documentId:{},pageIndex:{},scale:{},className:{},stroke:{default:"red"},fill:{default:"transparent"}},setup(e){const t=e,{plugin:l}=c(),a=n.useDocumentState(()=>t.documentId),r=o.ref(null),i=o.computed(()=>{var e;return void 0!==t.scale?t.scale:(null==(e=a.value)?void 0:e.scale)??1}),u=o.computed(()=>{var e;return t.stroke??(null==(e=l.value)?void 0:e.getPreviewStrokeColor())??"red"});return o.watch([l,()=>t.documentId,()=>t.pageIndex],([e,t,o],n,l)=>{if(!e||!t)return;l(e.onRedactionMarqueeChange(t,e=>{r.value=e.pageIndex===o?e.rect:null}))},{immediate:!0}),(t,n)=>r.value?(o.openBlock(),o.createElementBlock("div",{key:0,style:o.normalizeStyle({position:"absolute",pointerEvents:"none",left:r.value.origin.x*i.value+"px",top:r.value.origin.y*i.value+"px",width:r.value.size.width*i.value+"px",height:r.value.size.height*i.value+"px",border:`1px solid ${u.value}`,background:e.fill,boxSizing:"border-box"}),class:o.normalizeClass(e.className)},null,6)):o.createCommentVNode("",!0)}}),s={key:0,style:{mixBlendMode:"normal",pointerEvents:"none",position:"absolute",inset:0}},p=o.defineComponent({__name:"selection-redact",props:{documentId:{},pageIndex:{},scale:{}},setup(e){const t=e,{plugin:n}=c(),l=o.ref([]),a=o.ref(null),r=o.computed(()=>{var e;return(null==(e=n.value)?void 0:e.getPreviewStrokeColor())??"red"});return o.watch([n,()=>t.documentId,()=>t.pageIndex],([e,t,o],n,r)=>{if(!e)return l.value=[],void(a.value=null);r(e.onRedactionSelectionChange(t,e=>{const t=e.find(e=>e.pageIndex===o);l.value=(null==t?void 0:t.segmentRects)??[],a.value=(null==t?void 0:t.rect)??null}))},{immediate:!0}),(t,n)=>a.value?(o.openBlock(),o.createElementBlock("div",s,[o.createVNode(i,{color:"transparent",opacity:1,rects:l.value,scale:e.scale,border:`1px solid ${r.value}`},null,8,["rects","scale","border"])])):o.createCommentVNode("",!0)}}),m={key:0,style:{position:"absolute",inset:0,pointerEvents:"none"}},v=["onPointerdown","onTouchstart"],g=o.defineComponent({__name:"pending-redactions",props:{documentId:{},pageIndex:{},scale:{},rotation:{default:l.Rotation.Degree0},bboxStroke:{default:"rgba(0,0,0,0.8)"},selectionMenu:{}},setup(e){const t=e,n=o.useSlots(),{provides:l}=u(),r=o.ref([]),c=o.ref(null);o.watch([l,()=>t.documentId,()=>t.pageIndex],([e,t,o],n,l)=>{if(!e)return r.value=[],void(c.value=null);const a=e.forDocument(t),i=a.getState();r.value=(i.pending[o]??[]).filter(e=>"legacy"===e.source),c.value=i.selected&&i.selected.page===o?i.selected.id:null;const u=a.onPendingChange(e=>{r.value=(e[o]??[]).filter(e=>"legacy"===e.source)}),d=a.onSelectedChange(e=>{c.value=e&&e.page===o?e.id:null});l(()=>{null==u||u(),null==d||d()})},{immediate:!0});const d=(e,o)=>{e.stopPropagation();const n=l.value;n&&n.forDocument(t.documentId).selectPending(t.pageIndex,o)},s=e=>c.value===e&&(!!t.selectionMenu||!!n["selection-menu"]),p=e=>({type:"redaction",item:e,pageIndex:t.pageIndex}),g={suggestTop:!1,spaceAbove:0,spaceBelow:0},x=(e,o,n)=>t.selectionMenu?t.selectionMenu({rect:o,menuWrapperProps:n,selected:c.value===e.id,placement:g,context:p(e)}):null;return(t,n)=>r.value.length?(o.openBlock(),o.createElementBlock("div",m,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.value,n=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:n.id},["area"===n.kind?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createElementVNode("div",{style:o.normalizeStyle({position:"absolute",left:n.rect.origin.x*e.scale+"px",top:n.rect.origin.y*e.scale+"px",width:n.rect.size.width*e.scale+"px",height:n.rect.size.height*e.scale+"px",background:"transparent",outline:c.value===n.id?`1px solid ${e.bboxStroke}`:"none",outlineOffset:"2px",border:"1px solid red",pointerEvents:"auto",cursor:"pointer"}),onPointerdown:e=>d(e,n.id),onTouchstart:e=>d(e,n.id)},null,44,v),s(n.id)?(o.openBlock(),o.createBlock(o.unref(a.CounterRotate),{key:0,rect:{origin:{x:n.rect.origin.x*e.scale,y:n.rect.origin.y*e.scale},size:{width:n.rect.size.width*e.scale,height:n.rect.size.height*e.scale}},rotation:e.rotation},{default:o.withCtx(({rect:l,menuWrapperProps:a})=>[e.selectionMenu?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(x(n,l,a)),{key:0})):o.renderSlot(t.$slots,"selection-menu",{key:1,context:p(n),selected:c.value===n.id,rect:l,placement:g,menuWrapperProps:a})]),_:2},1032,["rect","rotation"])):o.createCommentVNode("",!0)],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createElementVNode("div",{style:o.normalizeStyle({position:"absolute",left:n.rect.origin.x*e.scale+"px",top:n.rect.origin.y*e.scale+"px",width:n.rect.size.width*e.scale+"px",height:n.rect.size.height*e.scale+"px",background:"transparent",outline:c.value===n.id?`1px solid ${e.bboxStroke}`:"none",outlineOffset:"2px",pointerEvents:"auto",cursor:c.value===n.id?"pointer":"default"})},[o.createVNode(i,{rect:n.rect,rects:n.rects,color:"transparent",border:"1px solid red",scale:e.scale,"on-click":e=>d(e,n.id)},null,8,["rect","rects","scale","on-click"])],4),s(n.id)?(o.openBlock(),o.createBlock(o.unref(a.CounterRotate),{key:0,rect:{origin:{x:n.rect.origin.x*e.scale,y:n.rect.origin.y*e.scale},size:{width:n.rect.size.width*e.scale,height:n.rect.size.height*e.scale}},rotation:e.rotation},{default:o.withCtx(({rect:l,menuWrapperProps:a})=>[e.selectionMenu?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(x(n,l,a)),{key:0})):o.renderSlot(t.$slots,"selection-menu",{key:1,context:p(n),selected:c.value===n.id,rect:l,placement:g,menuWrapperProps:a})]),_:2},1032,["rect","rotation"])):o.createCommentVNode("",!0)],64))],64))),128))])):o.createCommentVNode("",!0)}}),x=o.defineComponent({__name:"redaction-layer",props:{documentId:{},pageIndex:{},scale:{},rotation:{},bboxStroke:{default:"rgba(0,0,0,0.8)"},selectionMenu:{}},setup(e){const t=e,l=n.useDocumentState(()=>t.documentId),a=o.computed(()=>{var e,o,n;return null==(n=null==(o=null==(e=l.value)?void 0:e.document)?void 0:o.pages)?void 0:n[t.pageIndex]}),r=o.computed(()=>{var e;return void 0!==t.scale?t.scale:(null==(e=l.value)?void 0:e.scale)??1}),i=o.computed(()=>{var e,o;if(void 0!==t.rotation)return t.rotation;return(((null==(e=a.value)?void 0:e.rotation)??0)+((null==(o=l.value)?void 0:o.rotation)??0))%4});return(t,n)=>(o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createVNode(g,{"document-id":e.documentId,"page-index":e.pageIndex,scale:r.value,rotation:i.value,"bbox-stroke":e.bboxStroke,"selection-menu":e.selectionMenu},{"selection-menu":o.withCtx(e=>[o.renderSlot(t.$slots,"selection-menu",o.normalizeProps(o.guardReactiveProps(e)))]),_:3},8,["document-id","page-index","scale","rotation","bbox-stroke","selection-menu"]),o.createVNode(d,{"document-id":e.documentId,"page-index":e.pageIndex,scale:r.value},null,8,["document-id","page-index","scale"]),o.createVNode(p,{"document-id":e.documentId,"page-index":e.pageIndex,scale:r.value},null,8,["document-id","page-index","scale"])],64))}}),f=o.defineComponent({__name:"redact-highlight",props:{annotation:{},isSelected:{type:Boolean},scale:{},pageIndex:{},onClick:{type:Function}},setup(e){const t=e,n=o.ref(!1),a=o.computed(()=>t.annotation.object.segmentRects??[]),r=o.computed(()=>t.annotation.object.rect),i=o.computed(()=>t.annotation.object.strokeColor??"#FF0000"),c=o.computed(()=>t.annotation.object.color??"#000000"),u=o.computed(()=>t.annotation.object.opacity??1),d=o.computed(()=>t.annotation.object.fontColor??t.annotation.object.overlayColor??"#FFFFFF"),s=o.computed(()=>t.annotation.object.overlayText),p=o.computed(()=>t.annotation.object.overlayTextRepeat??!1),m=o.computed(()=>t.annotation.object.fontSize??12),v=o.computed(()=>t.annotation.object.fontFamily??l.PdfStandardFont.Helvetica),g=o.computed(()=>t.annotation.object.textAlign??l.PdfTextAlignment.Center),x=o.computed(()=>{if(!s.value)return"";if(!p.value)return s.value;return Array(10).fill(s.value).join(" ")}),f=e=>({position:"absolute",left:(r.value?e.origin.x-r.value.origin.x:e.origin.x)*t.scale+"px",top:(r.value?e.origin.y-r.value.origin.y:e.origin.y)*t.scale+"px",width:e.size.width*t.scale+"px",height:e.size.height*t.scale+"px",background:n.value?c.value:"transparent",border:n.value?"none":`2px solid ${i.value}`,opacity:n.value?u.value:1,boxSizing:"border-box",pointerEvents:"auto",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:g.value===l.PdfTextAlignment.Left?"flex-start":g.value===l.PdfTextAlignment.Right?"flex-end":"center",overflow:"hidden"}),k=e=>({color:d.value,fontSize:`${Math.min(m.value*t.scale,e.size.height*t.scale*.8)}px`,...l.standardFontCssProperties(v.value),textAlign:l.textAlignmentToCss(g.value),whiteSpace:p.value?"normal":"nowrap",overflow:"hidden",textOverflow:"ellipsis",lineHeight:1});return(t,l)=>(o.openBlock(),o.createElementBlock("div",{onMouseenter:l[2]||(l[2]=e=>n.value=!0),onMouseleave:l[3]||(l[3]=e=>n.value=!1),style:{position:"absolute",inset:0}},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.value,(t,a)=>(o.openBlock(),o.createElementBlock("div",{key:a,onPointerdown:l[0]||(l[0]=(...t)=>e.onClick&&e.onClick(...t)),onTouchstart:l[1]||(l[1]=(...t)=>e.onClick&&e.onClick(...t)),style:o.normalizeStyle(f(t))},[n.value&&s.value?(o.openBlock(),o.createElementBlock("span",{key:0,style:o.normalizeStyle(k(t))},o.toDisplayString(x.value),5)):o.createCommentVNode("",!0)],36))),128))],32))}}),k=o.defineComponent({__name:"redact-area",props:{annotation:{},isSelected:{type:Boolean},scale:{},pageIndex:{},onClick:{type:Function}},setup(e){const t=e,n=o.ref(!1),a=o.computed(()=>t.annotation.object.strokeColor??"#FF0000"),r=o.computed(()=>t.annotation.object.color??"#000000"),i=o.computed(()=>t.annotation.object.opacity??1),c=o.computed(()=>t.annotation.object.fontColor??t.annotation.object.overlayColor??"#FFFFFF"),u=o.computed(()=>t.annotation.object.overlayText),d=o.computed(()=>t.annotation.object.overlayTextRepeat??!1),s=o.computed(()=>t.annotation.object.fontSize??12),p=o.computed(()=>t.annotation.object.fontFamily??l.PdfStandardFont.Helvetica),m=o.computed(()=>t.annotation.object.textAlign??l.PdfTextAlignment.Center),v=o.computed(()=>{if(!u.value)return"";if(!d.value)return u.value;return Array(10).fill(u.value).join(" ")}),g=o.computed(()=>({position:"absolute",inset:0,background:n.value?r.value:"transparent",border:n.value?"none":`2px solid ${a.value}`,opacity:n.value?i.value:1,boxSizing:"border-box",pointerEvents:"auto",cursor:t.isSelected?"move":"pointer",display:"flex",alignItems:"center",justifyContent:m.value===l.PdfTextAlignment.Left?"flex-start":m.value===l.PdfTextAlignment.Right?"flex-end":"center",overflow:"hidden"})),x=o.computed(()=>({color:c.value,fontSize:s.value*t.scale+"px",...l.standardFontCssProperties(p.value),textAlign:l.textAlignmentToCss(m.value),whiteSpace:d.value?"normal":"nowrap",overflow:"hidden",textOverflow:"ellipsis",padding:"4px"}));return(t,l)=>(o.openBlock(),o.createElementBlock("div",{onPointerdown:l[0]||(l[0]=t=>{e.isSelected||e.onClick(t)}),onTouchstart:l[1]||(l[1]=t=>{e.isSelected||e.onClick(t)}),onMouseenter:l[2]||(l[2]=e=>n.value=!0),onMouseleave:l[3]||(l[3]=e=>n.value=!1),style:o.normalizeStyle(g.value)},[n.value&&u.value?(o.openBlock(),o.createElementBlock("span",{key:0,style:o.normalizeStyle(x.value)},o.toDisplayString(v.value),5)):o.createCommentVNode("",!0)],36))}}),y=[r.createRenderer({id:"redactHighlight",matches:e=>{var t;return e.type===l.PdfAnnotationSubtype.REDACT&&"segmentRects"in e&&((null==(t=e.segmentRects)?void 0:t.length)??0)>0},component:f}),r.createRenderer({id:"redactArea",matches:e=>{var t;return!(e.type!==l.PdfAnnotationSubtype.REDACT||"segmentRects"in e&&(null==(t=e.segmentRects)?void 0:t.length))},component:k})],h=o.defineComponent({__name:"redact-renderer-registration",setup:e=>(r.useRegisterRenderers(y),(e,t)=>o.renderSlot(e.$slots,"default"))}),b=e.createPluginPackage(t.RedactionPluginPackage).addUtility(h).build();exports.Highlight=i,exports.MarqueeRedact=d,exports.PendingRedactions=g,exports.RedactArea=k,exports.RedactHighlight=f,exports.RedactRendererRegistration=h,exports.RedactionLayer=x,exports.RedactionPluginPackage=b,exports.SelectionRedact=p,exports.redactRenderers=y,exports.useRedaction=e=>{const{provides:n}=u(),l=o.ref(t.initialDocumentState);o.watch([n,()=>o.toValue(e)],([e,o],n,a)=>{if(!e)return void(l.value=t.initialDocumentState);const r=e.forDocument(o);try{l.value=r.getState()}catch(i){l.value=t.initialDocumentState}a(r.onStateChange(e=>{l.value=e}))},{immediate:!0});const a=o.computed(()=>{var t;const l=o.toValue(e);return(null==(t=n.value)?void 0:t.forDocument(l))??null});return{state:l,provides:a}},exports.useRedactionCapability=u,exports.useRedactionPlugin=c,Object.keys(t).forEach(e=>{"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:()=>t[e]})});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@embedpdf/core"),t=require("@embedpdf/plugin-redaction"),o=require("vue"),n=require("@embedpdf/core/vue"),a=require("@embedpdf/models"),l=require("@embedpdf/utils/vue"),r=require("@embedpdf/plugin-annotation/vue"),i=o.defineComponent({__name:"highlight",props:{color:{default:"#FFFF00"},opacity:{default:1},border:{default:"1px solid red"},rects:{},rect:{},scale:{},onClick:{}},setup(e){const t=e.rect;return(n,a)=>(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.rects,(l,r)=>(o.openBlock(),o.createElementBlock("div",o.mergeProps({key:r,onPointerdown:a[0]||(a[0]=(...t)=>e.onClick&&e.onClick(...t)),style:{position:"absolute",border:e.border,left:(o.unref(t)?l.origin.x-o.unref(t).origin.x:l.origin.x)*e.scale+"px",top:(o.unref(t)?l.origin.y-o.unref(t).origin.y:l.origin.y)*e.scale+"px",width:l.size.width*e.scale+"px",height:l.size.height*e.scale+"px",background:e.color,opacity:e.opacity,pointerEvents:e.onClick?"auto":"none",cursor:e.onClick?"pointer":"default",zIndex:e.onClick?1:void 0}},{ref_for:!0},n.$attrs),null,16))),128))}}),c=()=>n.usePlugin(t.RedactionPlugin.id),u=()=>n.useCapability(t.RedactionPlugin.id),d=o.defineComponent({__name:"marquee-redact",props:{documentId:{},pageIndex:{},scale:{},className:{},stroke:{default:"red"},fill:{default:"transparent"}},setup(e){const t=e,{plugin:a}=c(),l=n.useDocumentState(()=>t.documentId),r=o.ref(null),i=o.computed(()=>{var e;return void 0!==t.scale?t.scale:(null==(e=l.value)?void 0:e.scale)??1}),u=o.computed(()=>{var e;return t.stroke??(null==(e=a.value)?void 0:e.getPreviewStrokeColor())??"red"});return o.watch([a,()=>t.documentId,()=>t.pageIndex],([e,t,o],n,a)=>{if(!e||!t)return;a(e.onRedactionMarqueeChange(t,e=>{r.value=e.pageIndex===o?e.rect:null}))},{immediate:!0}),(t,n)=>r.value?(o.openBlock(),o.createElementBlock("div",{key:0,style:o.normalizeStyle({position:"absolute",pointerEvents:"none",left:r.value.origin.x*i.value+"px",top:r.value.origin.y*i.value+"px",width:r.value.size.width*i.value+"px",height:r.value.size.height*i.value+"px",border:`1px solid ${u.value}`,background:e.fill,boxSizing:"border-box"}),class:o.normalizeClass(e.className)},null,6)):o.createCommentVNode("",!0)}}),s={key:0,style:{mixBlendMode:"normal",pointerEvents:"none",position:"absolute",inset:0}},p=o.defineComponent({__name:"selection-redact",props:{documentId:{},pageIndex:{},scale:{}},setup(e){const t=e,{plugin:n}=c(),a=o.ref([]),l=o.ref(null),r=o.computed(()=>{var e;return(null==(e=n.value)?void 0:e.getPreviewStrokeColor())??"red"});return o.watch([n,()=>t.documentId,()=>t.pageIndex],([e,t,o],n,r)=>{if(!e)return a.value=[],void(l.value=null);r(e.onRedactionSelectionChange(t,e=>{const t=e.find(e=>e.pageIndex===o);a.value=(null==t?void 0:t.segmentRects)??[],l.value=(null==t?void 0:t.rect)??null}))},{immediate:!0}),(t,n)=>l.value?(o.openBlock(),o.createElementBlock("div",s,[o.createVNode(i,{color:"transparent",opacity:1,rects:a.value,scale:e.scale,border:`1px solid ${r.value}`},null,8,["rects","scale","border"])])):o.createCommentVNode("",!0)}}),m={key:0,style:{position:"absolute",inset:0,pointerEvents:"none"}},v=["onPointerdown"],g=o.defineComponent({__name:"pending-redactions",props:{documentId:{},pageIndex:{},scale:{},rotation:{default:a.Rotation.Degree0},bboxStroke:{default:"rgba(0,0,0,0.8)"},selectionMenu:{}},setup(e){const t=e,n=o.useSlots(),{provides:a}=u(),r=o.ref([]),c=o.ref(null);o.watch([a,()=>t.documentId,()=>t.pageIndex],([e,t,o],n,a)=>{if(!e)return r.value=[],void(c.value=null);const l=e.forDocument(t),i=l.getState();r.value=(i.pending[o]??[]).filter(e=>"legacy"===e.source),c.value=i.selected&&i.selected.page===o?i.selected.id:null;const u=l.onPendingChange(e=>{r.value=(e[o]??[]).filter(e=>"legacy"===e.source)}),d=l.onSelectedChange(e=>{c.value=e&&e.page===o?e.id:null});a(()=>{null==u||u(),null==d||d()})},{immediate:!0});const d=(e,o)=>{e.stopPropagation();const n=a.value;n&&n.forDocument(t.documentId).selectPending(t.pageIndex,o)},s=e=>c.value===e&&(!!t.selectionMenu||!!n["selection-menu"]),p=e=>({type:"redaction",item:e,pageIndex:t.pageIndex}),g={suggestTop:!1,spaceAbove:0,spaceBelow:0},x=(e,o,n)=>t.selectionMenu?t.selectionMenu({rect:o,menuWrapperProps:n,selected:c.value===e.id,placement:g,context:p(e)}):null;return(t,n)=>r.value.length?(o.openBlock(),o.createElementBlock("div",m,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.value,n=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:n.id},["area"===n.kind?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createElementVNode("div",{style:o.normalizeStyle({position:"absolute",left:n.rect.origin.x*e.scale+"px",top:n.rect.origin.y*e.scale+"px",width:n.rect.size.width*e.scale+"px",height:n.rect.size.height*e.scale+"px",background:"transparent",outline:c.value===n.id?`1px solid ${e.bboxStroke}`:"none",outlineOffset:"2px",border:"1px solid red",pointerEvents:"auto",cursor:"pointer"}),onPointerdown:e=>d(e,n.id)},null,44,v),s(n.id)?(o.openBlock(),o.createBlock(o.unref(l.CounterRotate),{key:0,rect:{origin:{x:n.rect.origin.x*e.scale,y:n.rect.origin.y*e.scale},size:{width:n.rect.size.width*e.scale,height:n.rect.size.height*e.scale}},rotation:e.rotation},{default:o.withCtx(({rect:a,menuWrapperProps:l})=>[e.selectionMenu?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(x(n,a,l)),{key:0})):o.renderSlot(t.$slots,"selection-menu",{key:1,context:p(n),selected:c.value===n.id,rect:a,placement:g,menuWrapperProps:l})]),_:2},1032,["rect","rotation"])):o.createCommentVNode("",!0)],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createElementVNode("div",{style:o.normalizeStyle({position:"absolute",left:n.rect.origin.x*e.scale+"px",top:n.rect.origin.y*e.scale+"px",width:n.rect.size.width*e.scale+"px",height:n.rect.size.height*e.scale+"px",background:"transparent",outline:c.value===n.id?`1px solid ${e.bboxStroke}`:"none",outlineOffset:"2px",pointerEvents:"auto",cursor:c.value===n.id?"pointer":"default"})},[o.createVNode(i,{rect:n.rect,rects:n.rects,color:"transparent",border:"1px solid red",scale:e.scale,"on-click":e=>d(e,n.id)},null,8,["rect","rects","scale","on-click"])],4),s(n.id)?(o.openBlock(),o.createBlock(o.unref(l.CounterRotate),{key:0,rect:{origin:{x:n.rect.origin.x*e.scale,y:n.rect.origin.y*e.scale},size:{width:n.rect.size.width*e.scale,height:n.rect.size.height*e.scale}},rotation:e.rotation},{default:o.withCtx(({rect:a,menuWrapperProps:l})=>[e.selectionMenu?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(x(n,a,l)),{key:0})):o.renderSlot(t.$slots,"selection-menu",{key:1,context:p(n),selected:c.value===n.id,rect:a,placement:g,menuWrapperProps:l})]),_:2},1032,["rect","rotation"])):o.createCommentVNode("",!0)],64))],64))),128))])):o.createCommentVNode("",!0)}}),x=o.defineComponent({__name:"redaction-layer",props:{documentId:{},pageIndex:{},scale:{},rotation:{},bboxStroke:{default:"rgba(0,0,0,0.8)"},selectionMenu:{}},setup(e){const t=e,a=n.useDocumentState(()=>t.documentId),l=o.computed(()=>{var e,o,n;return null==(n=null==(o=null==(e=a.value)?void 0:e.document)?void 0:o.pages)?void 0:n[t.pageIndex]}),r=o.computed(()=>{var e;return void 0!==t.scale?t.scale:(null==(e=a.value)?void 0:e.scale)??1}),i=o.computed(()=>{var e,o;if(void 0!==t.rotation)return t.rotation;return(((null==(e=l.value)?void 0:e.rotation)??0)+((null==(o=a.value)?void 0:o.rotation)??0))%4});return(t,n)=>(o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createVNode(g,{"document-id":e.documentId,"page-index":e.pageIndex,scale:r.value,rotation:i.value,"bbox-stroke":e.bboxStroke,"selection-menu":e.selectionMenu},{"selection-menu":o.withCtx(e=>[o.renderSlot(t.$slots,"selection-menu",o.normalizeProps(o.guardReactiveProps(e)))]),_:3},8,["document-id","page-index","scale","rotation","bbox-stroke","selection-menu"]),o.createVNode(d,{"document-id":e.documentId,"page-index":e.pageIndex,scale:r.value},null,8,["document-id","page-index","scale"]),o.createVNode(p,{"document-id":e.documentId,"page-index":e.pageIndex,scale:r.value},null,8,["document-id","page-index","scale"])],64))}}),f=o.defineComponent({__name:"redact-highlight",props:{annotation:{},currentObject:{},isSelected:{type:Boolean},isEditing:{type:Boolean},scale:{},pageIndex:{},documentId:{},onClick:{type:Function},appearanceActive:{type:Boolean}},setup(e){const t=e,n=o.ref(!1),l=o.computed(()=>t.annotation.object.segmentRects??[]),r=o.computed(()=>t.annotation.object.rect),i=o.computed(()=>t.annotation.object.strokeColor??"#FF0000"),c=o.computed(()=>t.annotation.object.color??"#000000"),u=o.computed(()=>t.annotation.object.opacity??1),d=o.computed(()=>t.annotation.object.fontColor??t.annotation.object.overlayColor??"#FFFFFF"),s=o.computed(()=>t.annotation.object.overlayText),p=o.computed(()=>t.annotation.object.overlayTextRepeat??!1),m=o.computed(()=>t.annotation.object.fontSize??12),v=o.computed(()=>t.annotation.object.fontFamily??a.PdfStandardFont.Helvetica),g=o.computed(()=>t.annotation.object.textAlign??a.PdfTextAlignment.Center),x=o.computed(()=>{if(!s.value)return"";if(!p.value)return s.value;return Array(10).fill(s.value).join(" ")}),f=e=>({position:"absolute",left:(r.value?e.origin.x-r.value.origin.x:e.origin.x)*t.scale+"px",top:(r.value?e.origin.y-r.value.origin.y:e.origin.y)*t.scale+"px",width:e.size.width*t.scale+"px",height:e.size.height*t.scale+"px",background:n.value?c.value:"transparent",border:n.value?"none":`2px solid ${i.value}`,opacity:n.value?u.value:1,boxSizing:"border-box",pointerEvents:"auto",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:g.value===a.PdfTextAlignment.Left?"flex-start":g.value===a.PdfTextAlignment.Right?"flex-end":"center",overflow:"hidden"}),y=e=>({color:d.value,fontSize:`${Math.min(m.value*t.scale,e.size.height*t.scale*.8)}px`,...a.standardFontCssProperties(v.value),textAlign:a.textAlignmentToCss(g.value),whiteSpace:p.value?"normal":"nowrap",overflow:"hidden",textOverflow:"ellipsis",lineHeight:1});return(t,a)=>(o.openBlock(),o.createElementBlock("div",{onMouseenter:a[1]||(a[1]=e=>n.value=!0),onMouseleave:a[2]||(a[2]=e=>n.value=!1),style:{position:"absolute",inset:0}},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(l.value,(t,l)=>(o.openBlock(),o.createElementBlock("div",{key:l,onPointerdown:a[0]||(a[0]=(...t)=>e.onClick&&e.onClick(...t)),style:o.normalizeStyle(f(t))},[n.value&&s.value?(o.openBlock(),o.createElementBlock("span",{key:0,style:o.normalizeStyle(y(t))},o.toDisplayString(x.value),5)):o.createCommentVNode("",!0)],36))),128))],32))}}),y=o.defineComponent({__name:"redact-area",props:{annotation:{},currentObject:{},isSelected:{type:Boolean},isEditing:{type:Boolean},scale:{},pageIndex:{},documentId:{},onClick:{type:Function},appearanceActive:{type:Boolean}},setup(e){const t=e,n=o.ref(!1),l=o.computed(()=>t.annotation.object.strokeColor??"#FF0000"),r=o.computed(()=>t.annotation.object.color??"#000000"),i=o.computed(()=>t.annotation.object.opacity??1),c=o.computed(()=>t.annotation.object.fontColor??t.annotation.object.overlayColor??"#FFFFFF"),u=o.computed(()=>t.annotation.object.overlayText),d=o.computed(()=>t.annotation.object.overlayTextRepeat??!1),s=o.computed(()=>t.annotation.object.fontSize??12),p=o.computed(()=>t.annotation.object.fontFamily??a.PdfStandardFont.Helvetica),m=o.computed(()=>t.annotation.object.textAlign??a.PdfTextAlignment.Center),v=o.computed(()=>{if(!u.value)return"";if(!d.value)return u.value;return Array(10).fill(u.value).join(" ")}),g=o.computed(()=>({position:"absolute",inset:0,background:n.value?r.value:"transparent",border:n.value?"none":`2px solid ${l.value}`,opacity:n.value?i.value:1,boxSizing:"border-box",pointerEvents:"auto",cursor:t.isSelected?"move":"pointer",display:"flex",alignItems:"center",justifyContent:m.value===a.PdfTextAlignment.Left?"flex-start":m.value===a.PdfTextAlignment.Right?"flex-end":"center",overflow:"hidden"})),x=o.computed(()=>({color:c.value,fontSize:s.value*t.scale+"px",...a.standardFontCssProperties(p.value),textAlign:a.textAlignmentToCss(m.value),whiteSpace:d.value?"normal":"nowrap",overflow:"hidden",textOverflow:"ellipsis",padding:"4px"}));return(t,a)=>(o.openBlock(),o.createElementBlock("div",{onPointerdown:a[0]||(a[0]=t=>{e.isSelected||e.onClick(t)}),onMouseenter:a[1]||(a[1]=e=>n.value=!0),onMouseleave:a[2]||(a[2]=e=>n.value=!1),style:o.normalizeStyle(g.value)},[n.value&&u.value?(o.openBlock(),o.createElementBlock("span",{key:0,style:o.normalizeStyle(x.value)},o.toDisplayString(v.value),5)):o.createCommentVNode("",!0)],36))}}),b=[r.createRenderer({id:"redactHighlight",matches:e=>{var t;return e.type===a.PdfAnnotationSubtype.REDACT&&"segmentRects"in e&&((null==(t=e.segmentRects)?void 0:t.length)??0)>0},component:f,interactionDefaults:{isDraggable:!1,isResizable:!1,isRotatable:!1},useAppearanceStream:!1}),r.createRenderer({id:"redactArea",matches:e=>{var t;return!(e.type!==a.PdfAnnotationSubtype.REDACT||"segmentRects"in e&&(null==(t=e.segmentRects)?void 0:t.length))},component:y,interactionDefaults:{isDraggable:!1,isResizable:!1,isRotatable:!1},useAppearanceStream:!1})],k=o.defineComponent({__name:"redact-renderer-registration",setup:e=>(r.useRegisterRenderers(b),(e,t)=>o.renderSlot(e.$slots,"default"))}),h=e.createPluginPackage(t.RedactionPluginPackage).addUtility(k).build();exports.Highlight=i,exports.MarqueeRedact=d,exports.PendingRedactions=g,exports.RedactArea=y,exports.RedactHighlight=f,exports.RedactRendererRegistration=k,exports.RedactionLayer=x,exports.RedactionPluginPackage=h,exports.SelectionRedact=p,exports.redactRenderers=b,exports.useRedaction=e=>{const{provides:n}=u(),a=o.ref(t.initialDocumentState);o.watch([n,()=>o.toValue(e)],([e,o],n,l)=>{if(!e)return void(a.value=t.initialDocumentState);const r=e.forDocument(o);try{a.value=r.getState()}catch(i){a.value=t.initialDocumentState}l(r.onStateChange(e=>{a.value=e}))},{immediate:!0});const l=o.computed(()=>{var t;const a=o.toValue(e);return(null==(t=n.value)?void 0:t.forDocument(a))??null});return{state:a,provides:l}},exports.useRedactionCapability=u,exports.useRedactionPlugin=c,Object.keys(t).forEach(e=>{"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:()=>t[e]})});
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
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],\n ([plugin, docId, pageIdx], _, onCleanup) => {\n if (!plugin || !docId) return;\n\n const unsubscribe = plugin.onRedactionMarqueeChange(docId, (data) => {\n rect.value = data.pageIndex === pageIdx ? data.rect : null;\n });\n\n onCleanup(unsubscribe);\n },\n { immediate: true },\n);\n</script>\n","<template>\n <div\n v-if=\"boundingRect\"\n :style=\"{\n mixBlendMode: 'normal',\n pointerEvents: 'none',\n position: 'absolute',\n inset: 0,\n }\"\n >\n <Highlight\n :color=\"'transparent'\"\n :opacity=\"1\"\n :rects=\"rects\"\n :scale=\"scale\"\n :border=\"`1px solid ${strokeColor}`\"\n />\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, watch, computed } from 'vue';\nimport type { Rect } from '@embedpdf/models';\nimport { useRedactionPlugin } from '../hooks/use-redaction';\nimport Highlight from './highlight.vue';\n\ninterface SelectionRedactProps {\n documentId: string;\n pageIndex: number;\n scale: number;\n}\n\nconst props = defineProps<SelectionRedactProps>();\n\nconst { plugin: redactionPlugin } = useRedactionPlugin();\nconst rects = ref<Rect[]>([]);\nconst boundingRect = ref<Rect | null>(null);\n\n// Get stroke color from plugin (annotation mode uses tool defaults, legacy uses red)\nconst strokeColor = computed(() => redactionPlugin.value?.getPreviewStrokeColor() ?? 'red');\n\nwatch(\n [redactionPlugin, () => props.documentId, () => props.pageIndex],\n ([plugin, docId, pageIdx], _, onCleanup) => {\n if (!plugin) {\n rects.value = [];\n boundingRect.value = null;\n return;\n }\n\n const unsubscribe = plugin.onRedactionSelectionChange(docId, (formattedSelection) => {\n const selection = formattedSelection.find((s) => s.pageIndex === pageIdx);\n rects.value = selection?.segmentRects ?? [];\n boundingRect.value = selection?.rect ?? null;\n });\n\n onCleanup(unsubscribe);\n },\n { immediate: true },\n);\n</script>\n","<template>\n <div v-if=\"items.length\" :style=\"{ position: 'absolute', inset: 0, pointerEvents: 'none' }\">\n <template v-for=\"item in items\" :key=\"item.id\">\n <!-- Area redaction -->\n <template v-if=\"item.kind === 'area'\">\n <div\n :style=\"{\n position: 'absolute',\n left: `${item.rect.origin.x * scale}px`,\n top: `${item.rect.origin.y * scale}px`,\n width: `${item.rect.size.width * scale}px`,\n height: `${item.rect.size.height * scale}px`,\n background: 'transparent',\n outline: selectedId === item.id ? `1px solid ${bboxStroke}` : 'none',\n outlineOffset: '2px',\n border: `1px solid red`,\n pointerEvents: 'auto',\n cursor: 'pointer',\n }\"\n @pointerdown=\"(e: PointerEvent) => select(e, item.id)\"\n @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 standardFontCssProperties,\n textAlignmentToCss,\n} from '@embedpdf/models';\n\nconst props = defineProps<AnnotationRendererProps<PdfRedactAnnoObject>>();\nconst isHovered = ref(false);\n\n// Access props.annotation.object directly in computed to maintain reactivity\nconst segmentRects = computed(() => props.annotation.object.segmentRects ?? []);\nconst rect = computed(() => props.annotation.object.rect);\n\n// C - Border/stroke color\nconst strokeColor = computed(() => props.annotation.object.strokeColor ?? '#FF0000');\n// IC - Interior color (background fill when redaction is applied)\nconst color = computed(() => props.annotation.object.color ?? '#000000');\n// CA - Opacity (0-1)\nconst opacity = computed(() => props.annotation.object.opacity ?? 1);\n// OC - Overlay text color (Adobe extension), fallback to fontColor\nconst textColor = computed(\n () => props.annotation.object.fontColor ?? props.annotation.object.overlayColor ?? '#FFFFFF',\n);\n// Overlay text properties\nconst overlayText = computed(() => props.annotation.object.overlayText);\nconst overlayTextRepeat = computed(() => props.annotation.object.overlayTextRepeat ?? false);\nconst fontSize = computed(() => props.annotation.object.fontSize ?? 12);\nconst fontFamily = computed(() => props.annotation.object.fontFamily ?? PdfStandardFont.Helvetica);\nconst textAlign = computed(() => props.annotation.object.textAlign ?? PdfTextAlignment.Center);\n\n// Calculate how many times to repeat text (approximate)\nconst renderedOverlayText = computed(() => {\n if (!overlayText.value) return '';\n if (!overlayTextRepeat.value) return overlayText.value;\n // Repeat text multiple times to fill the space\n const reps = 10;\n return Array(reps).fill(overlayText.value).join(' ');\n});\n\nconst getSegmentStyle = (b: Rect): CSSProperties => ({\n position: 'absolute',\n left: `${(rect.value ? b.origin.x - rect.value.origin.x : b.origin.x) * props.scale}px`,\n top: `${(rect.value ? b.origin.y - rect.value.origin.y : b.origin.y) * props.scale}px`,\n width: `${b.size.width * props.scale}px`,\n height: `${b.size.height * props.scale}px`,\n // Default: transparent background with strokeColor (C) border\n // Hovered: color (IC) background fill, no border\n background: isHovered.value ? color.value : 'transparent',\n border: !isHovered.value ? `2px solid ${strokeColor.value}` : 'none',\n opacity: isHovered.value ? opacity.value : 1,\n boxSizing: 'border-box',\n pointerEvents: 'auto',\n cursor: 'pointer',\n display: 'flex',\n alignItems: 'center',\n justifyContent:\n textAlign.value === PdfTextAlignment.Left\n ? 'flex-start'\n : textAlign.value === PdfTextAlignment.Right\n ? 'flex-end'\n : 'center',\n overflow: 'hidden',\n});\n\nconst getTextStyle = (b: Rect): CSSProperties => ({\n color: textColor.value,\n fontSize: `${Math.min(fontSize.value * props.scale, b.size.height * props.scale * 0.8)}px`,\n ...standardFontCssProperties(fontFamily.value),\n textAlign: textAlignmentToCss(textAlign.value),\n whiteSpace: overlayTextRepeat.value ? 'normal' : 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n lineHeight: 1,\n});\n</script>\n","<template>\n <div\n @pointerdown=\"\n (e) => {\n if (!isSelected) onClick(e);\n }\n \"\n @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 standardFontCssProperties,\n textAlignmentToCss,\n} from '@embedpdf/models';\n\nconst props = defineProps<AnnotationRendererProps<PdfRedactAnnoObject>>();\nconst isHovered = ref(false);\n\n// Access props.annotation.object directly in computed to maintain reactivity\n// C - Border/stroke color\nconst strokeColor = computed(() => props.annotation.object.strokeColor ?? '#FF0000');\n// IC - Interior color (background fill when redaction is applied)\nconst color = computed(() => props.annotation.object.color ?? '#000000');\n// CA - Opacity (0-1)\nconst opacity = computed(() => props.annotation.object.opacity ?? 1);\n// OC - Overlay text color (Adobe extension), fallback to fontColor\nconst textColor = computed(\n () => props.annotation.object.fontColor ?? props.annotation.object.overlayColor ?? '#FFFFFF',\n);\n// Overlay text properties\nconst overlayText = computed(() => props.annotation.object.overlayText);\nconst overlayTextRepeat = computed(() => props.annotation.object.overlayTextRepeat ?? false);\nconst fontSize = computed(() => props.annotation.object.fontSize ?? 12);\nconst fontFamily = computed(() => props.annotation.object.fontFamily ?? PdfStandardFont.Helvetica);\nconst textAlign = computed(() => props.annotation.object.textAlign ?? PdfTextAlignment.Center);\n\n// Calculate how many times to repeat text (approximate)\nconst renderedOverlayText = computed(() => {\n if (!overlayText.value) return '';\n if (!overlayTextRepeat.value) return overlayText.value;\n // Repeat text multiple times to fill the space\n const reps = 10;\n return Array(reps).fill(overlayText.value).join(' ');\n});\n\nconst containerStyle = computed<CSSProperties>(() => ({\n position: 'absolute',\n inset: 0,\n // Default: transparent background with strokeColor (C) border\n // Hovered: color (IC) background fill, no border\n background: isHovered.value ? color.value : 'transparent',\n border: !isHovered.value ? `2px solid ${strokeColor.value}` : 'none',\n opacity: isHovered.value ? opacity.value : 1,\n boxSizing: 'border-box',\n pointerEvents: 'auto',\n cursor: props.isSelected ? 'move' : 'pointer',\n display: 'flex',\n alignItems: 'center',\n justifyContent:\n textAlign.value === PdfTextAlignment.Left\n ? 'flex-start'\n : textAlign.value === PdfTextAlignment.Right\n ? 'flex-end'\n : 'center',\n overflow: 'hidden',\n}));\n\nconst textStyle = computed<CSSProperties>(() => ({\n color: textColor.value,\n fontSize: `${fontSize.value * props.scale}px`,\n ...standardFontCssProperties(fontFamily.value),\n textAlign: textAlignmentToCss(textAlign.value),\n whiteSpace: overlayTextRepeat.value ? 'normal' : 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n padding: '4px',\n}));\n</script>\n","import { createRenderer, type BoxedAnnotationRenderer } from '@embedpdf/plugin-annotation/vue';\nimport { PdfAnnotationSubtype, type PdfRedactAnnoObject } from '@embedpdf/models';\nimport RedactHighlight from './annotations/redact-highlight.vue';\nimport RedactArea from './annotations/redact-area.vue';\n\n/**\n * Boxed annotation renderers for Redact annotations.\n * Type safety is enforced at definition time via createRenderer.\n * These are automatically registered with the annotation plugin via context.\n */\nexport const redactRenderers: BoxedAnnotationRenderer[] = [\n createRenderer<PdfRedactAnnoObject>({\n id: 'redactHighlight',\n matches: (a): a is PdfRedactAnnoObject =>\n a.type === PdfAnnotationSubtype.REDACT &&\n 'segmentRects' in a &&\n (a.segmentRects?.length ?? 0) > 0,\n component: RedactHighlight,\n }),\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","onRedactionMarqueeChange","data","immediate","_normalizeStyle","fill","class","className","onRedactionSelectionChange","formattedSelection","selection","find","s","segmentRects","_hoisted_1","_createVNode","Highlight","slots","useSlots","provides","redaction","items","selectedId","redactionValue","scoped","forDocument","currentState","getState","pending","filter","it","source","selected","page","off1","onPendingChange","map","off2","onSelectedChange","sel","select","e","stopPropagation","selectPending","shouldShowMenu","itemId","selectionMenu","buildContext","item","type","menuPlacement","suggestTop","spaceAbove","spaceBelow","renderSelectionMenu","menuWrapperProps","placement","context","length","kind","_createElementVNode","outline","bboxStroke","_createBlock","CounterRotate","rotation","default","_withCtx","_resolveDynamicComponent","_renderSlot","_ctx","$slots","_c","_b","document","pages","actualRotation","PendingRedactions","slotProps","MarqueeRedact","SelectionRedact","isHovered","annotation","object","textColor","fontColor","overlayColor","overlayText","overlayTextRepeat","fontSize","fontFamily","PdfStandardFont","Helvetica","textAlign","PdfTextAlignment","Center","renderedOverlayText","Array","join","getSegmentStyle","b","position","background","boxSizing","pointerEvents","cursor","display","alignItems","justifyContent","Left","Right","overflow","getTextStyle","Math","min","standardFontCssProperties","textAlignmentToCss","whiteSpace","textOverflow","lineHeight","onMouseenter","onMouseleave","inset","containerStyle","isSelected","textStyle","padding","redactRenderers","createRenderer","matches","a","PdfAnnotationSubtype","REDACT","component","RedactHighlight","RedactArea","useRegisterRenderers","RedactionPluginPackage","createPluginPackage","BaseRedactionPackage","addUtility","RedactRendererRegistration","build","state","initialDocumentState","toValue","providesValue","scope","onStateChange","newState","scopedProvides"],"m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J,EAAiBjK,EAAAA,SAAS,WAC9B,MAAMQ,EAAQoJ,EAAAA,QAAQ/J,GACtB,OAAO,OAAAI,EAAA6B,EAAS5B,YAAT,EAAAD,EAAgBmC,YAAY5B,KAAU,OAG/C,MAAO,CACLkJ,QACA5H,SAAUmI"}
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/vue/components/highlight.vue","../../src/vue/hooks/use-redaction.ts","../../src/vue/components/marquee-redact.vue","../../src/vue/components/selection-redact.vue","../../src/vue/components/pending-redactions.vue","../../src/vue/components/redaction-layer.vue","../../src/vue/components/annotations/redact-highlight.vue","../../src/vue/components/annotations/redact-area.vue","../../src/vue/components/redact-renderers.ts","../../src/vue/components/redact-renderer-registration.vue","../../src/vue/index.ts"],"sourcesContent":["<template>\n <div\n v-for=\"(rect, i) in rects\"\n :key=\"i\"\n @pointerdown=\"onClick\"\n :style=\"{\n position: 'absolute',\n border,\n left: `${(boundingRect ? rect.origin.x - boundingRect.origin.x : rect.origin.x) * scale}px`,\n top: `${(boundingRect ? rect.origin.y - boundingRect.origin.y : rect.origin.y) * scale}px`,\n width: `${rect.size.width * scale}px`,\n height: `${rect.size.height * scale}px`,\n background: color,\n opacity: opacity,\n pointerEvents: onClick ? 'auto' : 'none',\n cursor: onClick ? 'pointer' : 'default',\n zIndex: onClick ? 1 : undefined,\n }\"\n v-bind=\"$attrs\"\n />\n</template>\n\n<script setup lang=\"ts\">\nimport type { Rect } from '@embedpdf/models';\n\ninterface HighlightProps {\n color?: string;\n opacity?: number;\n border?: string;\n rects: Rect[];\n rect?: Rect;\n scale: number;\n onClick?: (e: PointerEvent) => void;\n}\n\nconst props = withDefaults(defineProps<HighlightProps>(), {\n color: '#FFFF00',\n opacity: 1,\n border: '1px solid red',\n});\n\n// Rename rect to boundingRect for clarity in template\nconst boundingRect = props.rect;\n</script>\n","import { ref, watch, computed, toValue, type MaybeRefOrGetter, ComputedRef, Ref } from 'vue';\nimport { useCapability, usePlugin } from '@embedpdf/core/vue';\nimport {\n RedactionPlugin,\n initialDocumentState,\n RedactionDocumentState,\n RedactionScope,\n} from '@embedpdf/plugin-redaction';\n\nexport const useRedactionPlugin = () => usePlugin<RedactionPlugin>(RedactionPlugin.id);\nexport const useRedactionCapability = () => useCapability<RedactionPlugin>(RedactionPlugin.id);\n\n/**\n * Hook for redaction state for a specific document\n * @param documentId Document ID (can be ref, computed, getter, or plain value)\n */\nexport const useRedaction = (\n documentId: MaybeRefOrGetter<string>,\n): {\n state: Readonly<Ref<RedactionDocumentState>>;\n provides: ComputedRef<RedactionScope | null>;\n} => {\n const { provides } = useRedactionCapability();\n const state = ref<RedactionDocumentState>(initialDocumentState);\n\n watch(\n [provides, () => toValue(documentId)],\n ([providesValue, docId], _, onCleanup) => {\n if (!providesValue) {\n state.value = initialDocumentState;\n return;\n }\n\n const scope = providesValue.forDocument(docId);\n\n // Set initial state\n try {\n state.value = scope.getState();\n } catch (e) {\n // Handle case where state might not be ready\n state.value = initialDocumentState;\n }\n\n // Subscribe to changes\n const unsubscribe = scope.onStateChange((newState) => {\n state.value = newState;\n });\n\n onCleanup(unsubscribe);\n },\n { immediate: true },\n );\n\n const scopedProvides = computed(() => {\n const docId = toValue(documentId);\n return provides.value?.forDocument(docId) ?? null;\n });\n\n return {\n state,\n provides: scopedProvides,\n };\n};\n","<template>\n <div\n v-if=\"rect\"\n :style=\"{\n position: 'absolute',\n pointerEvents: 'none',\n left: `${rect.origin.x * actualScale}px`,\n top: `${rect.origin.y * actualScale}px`,\n width: `${rect.size.width * actualScale}px`,\n height: `${rect.size.height * actualScale}px`,\n border: `1px solid ${strokeColor}`,\n background: fill,\n boxSizing: 'border-box',\n }\"\n :class=\"className\"\n />\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, watch, computed } from 'vue';\nimport { useDocumentState } from '@embedpdf/core/vue';\nimport type { Rect } from '@embedpdf/models';\nimport { useRedactionPlugin } from '../hooks/use-redaction';\n\ninterface MarqueeRedactProps {\n /** The ID of the document */\n documentId: string;\n /** Index of the page this layer lives on */\n pageIndex: number;\n /** Scale of the page */\n scale?: number;\n /** Optional CSS class applied to the marquee rectangle */\n className?: string;\n /** Stroke / fill colours (defaults below) */\n stroke?: string;\n fill?: string;\n}\n\nconst props = withDefaults(defineProps<MarqueeRedactProps>(), {\n stroke: 'red',\n fill: 'transparent',\n});\n\nconst { plugin: redactionPlugin } = useRedactionPlugin();\nconst documentState = useDocumentState(() => props.documentId);\nconst rect = ref<Rect | null>(null);\n\nconst actualScale = computed(() => {\n if (props.scale !== undefined) return props.scale;\n return documentState.value?.scale ?? 1;\n});\n\n// Get stroke color from plugin (annotation mode uses tool defaults, legacy uses red)\n// Allow prop override for backwards compatibility\nconst strokeColor = computed(\n () => props.stroke ?? redactionPlugin.value?.getPreviewStrokeColor() ?? 'red',\n);\n\nwatch(\n [redactionPlugin, () => props.documentId, () => props.pageIndex],\n ([plugin, docId, pageIdx], _, onCleanup) => {\n if (!plugin || !docId) return;\n\n const unsubscribe = plugin.onRedactionMarqueeChange(docId, (data) => {\n rect.value = data.pageIndex === pageIdx ? data.rect : null;\n });\n\n onCleanup(unsubscribe);\n },\n { immediate: true },\n);\n</script>\n","<template>\n <div\n v-if=\"boundingRect\"\n :style=\"{\n mixBlendMode: 'normal',\n pointerEvents: 'none',\n position: 'absolute',\n inset: 0,\n }\"\n >\n <Highlight\n :color=\"'transparent'\"\n :opacity=\"1\"\n :rects=\"rects\"\n :scale=\"scale\"\n :border=\"`1px solid ${strokeColor}`\"\n />\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, watch, computed } from 'vue';\nimport type { Rect } from '@embedpdf/models';\nimport { useRedactionPlugin } from '../hooks/use-redaction';\nimport Highlight from './highlight.vue';\n\ninterface SelectionRedactProps {\n documentId: string;\n pageIndex: number;\n scale: number;\n}\n\nconst props = defineProps<SelectionRedactProps>();\n\nconst { plugin: redactionPlugin } = useRedactionPlugin();\nconst rects = ref<Rect[]>([]);\nconst boundingRect = ref<Rect | null>(null);\n\n// Get stroke color from plugin (annotation mode uses tool defaults, legacy uses red)\nconst strokeColor = computed(() => redactionPlugin.value?.getPreviewStrokeColor() ?? 'red');\n\nwatch(\n [redactionPlugin, () => props.documentId, () => props.pageIndex],\n ([plugin, docId, pageIdx], _, onCleanup) => {\n if (!plugin) {\n rects.value = [];\n boundingRect.value = null;\n return;\n }\n\n const unsubscribe = plugin.onRedactionSelectionChange(docId, (formattedSelection) => {\n const selection = formattedSelection.find((s) => s.pageIndex === pageIdx);\n rects.value = selection?.segmentRects ?? [];\n boundingRect.value = selection?.rect ?? null;\n });\n\n onCleanup(unsubscribe);\n },\n { immediate: true },\n);\n</script>\n","<template>\n <div v-if=\"items.length\" :style=\"{ position: 'absolute', inset: 0, pointerEvents: 'none' }\">\n <template v-for=\"item in items\" :key=\"item.id\">\n <!-- Area redaction -->\n <template v-if=\"item.kind === 'area'\">\n <div\n :style=\"{\n position: 'absolute',\n left: `${item.rect.origin.x * scale}px`,\n top: `${item.rect.origin.y * scale}px`,\n width: `${item.rect.size.width * scale}px`,\n height: `${item.rect.size.height * scale}px`,\n background: 'transparent',\n outline: selectedId === item.id ? `1px solid ${bboxStroke}` : 'none',\n outlineOffset: '2px',\n border: `1px solid red`,\n pointerEvents: 'auto',\n cursor: 'pointer',\n }\"\n @pointerdown=\"(e: PointerEvent) => select(e, item.id)\"\n />\n\n <!-- Selection Menu: Supports BOTH render function and slot -->\n <CounterRotate\n v-if=\"shouldShowMenu(item.id)\"\n :rect=\"{\n origin: { x: item.rect.origin.x * scale, y: item.rect.origin.y * scale },\n size: { width: item.rect.size.width * scale, height: item.rect.size.height * scale },\n }\"\n :rotation=\"rotation\"\n >\n <template #default=\"{ rect, menuWrapperProps }\">\n <!-- Priority 1: Render function prop (schema-driven) -->\n <component\n v-if=\"selectionMenu\"\n :is=\"renderSelectionMenu(item, rect, menuWrapperProps)\"\n />\n\n <!-- Priority 2: Slot (manual customization) -->\n <slot\n v-else\n name=\"selection-menu\"\n :context=\"buildContext(item)\"\n :selected=\"selectedId === item.id\"\n :rect=\"rect\"\n :placement=\"menuPlacement\"\n :menuWrapperProps=\"menuWrapperProps\"\n />\n </template>\n </CounterRotate>\n </template>\n\n <!-- Text redaction -->\n <template v-else>\n <div\n :style=\"{\n position: 'absolute',\n left: `${item.rect.origin.x * scale}px`,\n top: `${item.rect.origin.y * scale}px`,\n width: `${item.rect.size.width * scale}px`,\n height: `${item.rect.size.height * scale}px`,\n background: 'transparent',\n outline: selectedId === item.id ? `1px solid ${bboxStroke}` : 'none',\n outlineOffset: '2px',\n pointerEvents: 'auto',\n cursor: selectedId === item.id ? 'pointer' : 'default',\n }\"\n >\n <Highlight\n :rect=\"item.rect\"\n :rects=\"item.rects\"\n color=\"transparent\"\n border=\"1px solid red\"\n :scale=\"scale\"\n :on-click=\"(e: PointerEvent) => select(e, item.id)\"\n />\n </div>\n\n <!-- Selection Menu: Supports BOTH render function and slot -->\n <CounterRotate\n v-if=\"shouldShowMenu(item.id)\"\n :rect=\"{\n origin: {\n x: item.rect.origin.x * scale,\n y: item.rect.origin.y * scale,\n },\n size: {\n width: item.rect.size.width * scale,\n height: item.rect.size.height * scale,\n },\n }\"\n :rotation=\"rotation\"\n >\n <template #default=\"{ rect, menuWrapperProps }\">\n <!-- Priority 1: Render function prop (schema-driven) -->\n <component\n v-if=\"selectionMenu\"\n :is=\"renderSelectionMenu(item, rect, menuWrapperProps)\"\n />\n\n <!-- Priority 2: Slot (manual customization) -->\n <slot\n v-else\n name=\"selection-menu\"\n :context=\"buildContext(item)\"\n :selected=\"selectedId === item.id\"\n :rect=\"rect\"\n :placement=\"menuPlacement\"\n :menuWrapperProps=\"menuWrapperProps\"\n />\n </template>\n </CounterRotate>\n </template>\n </template>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, watch, useSlots, type VNode } from 'vue';\nimport type { Rect } from '@embedpdf/models';\nimport { Rotation } from '@embedpdf/models';\nimport { CounterRotate } from '@embedpdf/utils/vue';\nimport type { MenuWrapperProps, SelectionMenuPlacement } from '@embedpdf/utils/vue';\nimport type { RedactionItem } from '@embedpdf/plugin-redaction';\nimport { useRedactionCapability } from '../hooks/use-redaction';\nimport Highlight from './highlight.vue';\nimport type { RedactionSelectionContext, RedactionSelectionMenuRenderFn } from './types';\n\ninterface PendingRedactionsProps {\n documentId: string;\n pageIndex: number;\n scale: number;\n rotation: Rotation;\n bboxStroke?: string;\n /** Render function for selection menu (schema-driven approach) */\n selectionMenu?: RedactionSelectionMenuRenderFn;\n}\n\nconst props = withDefaults(defineProps<PendingRedactionsProps>(), {\n rotation: Rotation.Degree0,\n bboxStroke: 'rgba(0,0,0,0.8)',\n});\n\nconst slots = useSlots();\nconst { provides: redaction } = useRedactionCapability();\nconst items = ref<RedactionItem[]>([]);\nconst selectedId = ref<string | null>(null);\n\nwatch(\n [redaction, () => props.documentId, () => props.pageIndex],\n ([redactionValue, docId, pageIdx], _, onCleanup) => {\n if (!redactionValue) {\n items.value = [];\n selectedId.value = null;\n return;\n }\n\n const scoped = redactionValue.forDocument(docId);\n\n // Initialize with current state - only show legacy mode items\n const currentState = scoped.getState();\n items.value = (currentState.pending[pageIdx] ?? []).filter((it) => it.source === 'legacy');\n selectedId.value =\n currentState.selected && currentState.selected.page === pageIdx\n ? currentState.selected.id\n : null;\n\n // Subscribe to future changes - only show legacy mode items\n const off1 = scoped.onPendingChange((map) => {\n items.value = (map[pageIdx] ?? []).filter((it) => it.source === 'legacy');\n });\n\n const off2 = scoped.onSelectedChange((sel) => {\n selectedId.value = sel && sel.page === pageIdx ? sel.id : null;\n });\n\n onCleanup(() => {\n off1?.();\n off2?.();\n });\n },\n { immediate: true },\n);\n\nconst select = (e: PointerEvent, id: string) => {\n e.stopPropagation();\n const redactionValue = redaction.value;\n if (!redactionValue) return;\n redactionValue.forDocument(props.documentId).selectPending(props.pageIndex, id);\n};\n\n// --- Selection Menu Logic ---\n\n// Check if we should show menu for this item\nconst shouldShowMenu = (itemId: string): boolean => {\n const isSelected = selectedId.value === itemId;\n return isSelected && (!!props.selectionMenu || !!slots['selection-menu']);\n};\n\n// Build context object for selection menu\nconst buildContext = (item: RedactionItem): RedactionSelectionContext => ({\n type: 'redaction',\n item,\n pageIndex: props.pageIndex,\n});\n\n// Placement hints (could be computed based on position)\nconst menuPlacement: SelectionMenuPlacement = {\n suggestTop: false,\n spaceAbove: 0,\n spaceBelow: 0,\n};\n\n// Render via function (for schema-driven approach)\nconst renderSelectionMenu = (\n item: RedactionItem,\n rect: Rect,\n menuWrapperProps: MenuWrapperProps,\n): VNode | null => {\n if (!props.selectionMenu) return null;\n\n return props.selectionMenu({\n rect,\n menuWrapperProps,\n selected: selectedId.value === item.id,\n placement: menuPlacement,\n context: buildContext(item),\n });\n};\n</script>\n","<template>\n <PendingRedactions\n :document-id=\"documentId\"\n :page-index=\"pageIndex\"\n :scale=\"actualScale\"\n :rotation=\"actualRotation\"\n :bbox-stroke=\"bboxStroke\"\n :selection-menu=\"selectionMenu\"\n >\n <template #selection-menu=\"slotProps\">\n <slot name=\"selection-menu\" v-bind=\"slotProps\" />\n </template>\n </PendingRedactions>\n <MarqueeRedact :document-id=\"documentId\" :page-index=\"pageIndex\" :scale=\"actualScale\" />\n <SelectionRedact :document-id=\"documentId\" :page-index=\"pageIndex\" :scale=\"actualScale\" />\n</template>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport { useDocumentState } from '@embedpdf/core/vue';\nimport { Rotation } from '@embedpdf/models';\nimport PendingRedactions from './pending-redactions.vue';\nimport MarqueeRedact from './marquee-redact.vue';\nimport SelectionRedact from './selection-redact.vue';\nimport { RedactionSelectionMenuRenderFn } from './types';\n\ninterface RedactionLayerProps {\n /** The ID of the document this layer belongs to */\n documentId: string;\n /** Index of the page this layer lives on */\n pageIndex: number;\n /** Current render scale for this page */\n scale?: number;\n /** Page rotation (for counter-rotating menus, etc.) */\n rotation?: Rotation;\n /** Optional bbox stroke color */\n bboxStroke?: string;\n /** Optional menu renderer for a selected redaction */\n selectionMenu?: RedactionSelectionMenuRenderFn;\n}\n\nconst props = withDefaults(defineProps<RedactionLayerProps>(), {\n bboxStroke: 'rgba(0,0,0,0.8)',\n});\n\nconst documentState = useDocumentState(() => props.documentId);\nconst page = computed(() => documentState.value?.document?.pages?.[props.pageIndex]);\n\nconst actualScale = computed(() => {\n if (props.scale !== undefined) return props.scale;\n return documentState.value?.scale ?? 1;\n});\n\nconst actualRotation = computed(() => {\n if (props.rotation !== undefined) return props.rotation;\n // Combine page intrinsic rotation with document rotation\n const pageRotation = page.value?.rotation ?? 0;\n const docRotation = documentState.value?.rotation ?? 0;\n return ((pageRotation + docRotation) % 4) as Rotation;\n});\n</script>\n","<template>\n <div\n @mouseenter=\"isHovered = true\"\n @mouseleave=\"isHovered = false\"\n :style=\"{ position: 'absolute', inset: 0 }\"\n >\n <div v-for=\"(b, i) in segmentRects\" :key=\"i\" @pointerdown=\"onClick\" :style=\"getSegmentStyle(b)\">\n <span v-if=\"isHovered && overlayText\" :style=\"getTextStyle(b)\">\n {{ renderedOverlayText }}\n </span>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, computed, type CSSProperties } from 'vue';\nimport type { AnnotationRendererProps } from '@embedpdf/plugin-annotation/vue';\nimport type { PdfRedactAnnoObject, Rect } from '@embedpdf/models';\nimport {\n PdfStandardFont,\n PdfTextAlignment,\n standardFontCssProperties,\n textAlignmentToCss,\n} from '@embedpdf/models';\n\nconst props = defineProps<AnnotationRendererProps<PdfRedactAnnoObject>>();\nconst isHovered = ref(false);\n\n// Access props.annotation.object directly in computed to maintain reactivity\nconst segmentRects = computed(() => props.annotation.object.segmentRects ?? []);\nconst rect = computed(() => props.annotation.object.rect);\n\n// C - Border/stroke color\nconst strokeColor = computed(() => props.annotation.object.strokeColor ?? '#FF0000');\n// IC - Interior color (background fill when redaction is applied)\nconst color = computed(() => props.annotation.object.color ?? '#000000');\n// CA - Opacity (0-1)\nconst opacity = computed(() => props.annotation.object.opacity ?? 1);\n// OC - Overlay text color (Adobe extension), fallback to fontColor\nconst textColor = computed(\n () => props.annotation.object.fontColor ?? props.annotation.object.overlayColor ?? '#FFFFFF',\n);\n// Overlay text properties\nconst overlayText = computed(() => props.annotation.object.overlayText);\nconst overlayTextRepeat = computed(() => props.annotation.object.overlayTextRepeat ?? false);\nconst fontSize = computed(() => props.annotation.object.fontSize ?? 12);\nconst fontFamily = computed(() => props.annotation.object.fontFamily ?? PdfStandardFont.Helvetica);\nconst textAlign = computed(() => props.annotation.object.textAlign ?? PdfTextAlignment.Center);\n\n// Calculate how many times to repeat text (approximate)\nconst renderedOverlayText = computed(() => {\n if (!overlayText.value) return '';\n if (!overlayTextRepeat.value) return overlayText.value;\n // Repeat text multiple times to fill the space\n const reps = 10;\n return Array(reps).fill(overlayText.value).join(' ');\n});\n\nconst getSegmentStyle = (b: Rect): CSSProperties => ({\n position: 'absolute',\n left: `${(rect.value ? b.origin.x - rect.value.origin.x : b.origin.x) * props.scale}px`,\n top: `${(rect.value ? b.origin.y - rect.value.origin.y : b.origin.y) * props.scale}px`,\n width: `${b.size.width * props.scale}px`,\n height: `${b.size.height * props.scale}px`,\n // Default: transparent background with strokeColor (C) border\n // Hovered: color (IC) background fill, no border\n background: isHovered.value ? color.value : 'transparent',\n border: !isHovered.value ? `2px solid ${strokeColor.value}` : 'none',\n opacity: isHovered.value ? opacity.value : 1,\n boxSizing: 'border-box',\n pointerEvents: 'auto',\n cursor: 'pointer',\n display: 'flex',\n alignItems: 'center',\n justifyContent:\n textAlign.value === PdfTextAlignment.Left\n ? 'flex-start'\n : textAlign.value === PdfTextAlignment.Right\n ? 'flex-end'\n : 'center',\n overflow: 'hidden',\n});\n\nconst getTextStyle = (b: Rect): CSSProperties => ({\n color: textColor.value,\n fontSize: `${Math.min(fontSize.value * props.scale, b.size.height * props.scale * 0.8)}px`,\n ...standardFontCssProperties(fontFamily.value),\n textAlign: textAlignmentToCss(textAlign.value),\n whiteSpace: overlayTextRepeat.value ? 'normal' : 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n lineHeight: 1,\n});\n</script>\n","<template>\n <div\n @pointerdown=\"\n (e) => {\n if (!isSelected) onClick(e);\n }\n \"\n @mouseenter=\"isHovered = true\"\n @mouseleave=\"isHovered = false\"\n :style=\"containerStyle\"\n >\n <span v-if=\"isHovered && overlayText\" :style=\"textStyle\">\n {{ renderedOverlayText }}\n </span>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, computed, type CSSProperties } from 'vue';\nimport type { AnnotationRendererProps } from '@embedpdf/plugin-annotation/vue';\nimport type { PdfRedactAnnoObject } from '@embedpdf/models';\nimport {\n PdfStandardFont,\n PdfTextAlignment,\n standardFontCssProperties,\n textAlignmentToCss,\n} from '@embedpdf/models';\n\nconst props = defineProps<AnnotationRendererProps<PdfRedactAnnoObject>>();\nconst isHovered = ref(false);\n\n// Access props.annotation.object directly in computed to maintain reactivity\n// C - Border/stroke color\nconst strokeColor = computed(() => props.annotation.object.strokeColor ?? '#FF0000');\n// IC - Interior color (background fill when redaction is applied)\nconst color = computed(() => props.annotation.object.color ?? '#000000');\n// CA - Opacity (0-1)\nconst opacity = computed(() => props.annotation.object.opacity ?? 1);\n// OC - Overlay text color (Adobe extension), fallback to fontColor\nconst textColor = computed(\n () => props.annotation.object.fontColor ?? props.annotation.object.overlayColor ?? '#FFFFFF',\n);\n// Overlay text properties\nconst overlayText = computed(() => props.annotation.object.overlayText);\nconst overlayTextRepeat = computed(() => props.annotation.object.overlayTextRepeat ?? false);\nconst fontSize = computed(() => props.annotation.object.fontSize ?? 12);\nconst fontFamily = computed(() => props.annotation.object.fontFamily ?? PdfStandardFont.Helvetica);\nconst textAlign = computed(() => props.annotation.object.textAlign ?? PdfTextAlignment.Center);\n\n// Calculate how many times to repeat text (approximate)\nconst renderedOverlayText = computed(() => {\n if (!overlayText.value) return '';\n if (!overlayTextRepeat.value) return overlayText.value;\n // Repeat text multiple times to fill the space\n const reps = 10;\n return Array(reps).fill(overlayText.value).join(' ');\n});\n\nconst containerStyle = computed<CSSProperties>(() => ({\n position: 'absolute',\n inset: 0,\n // Default: transparent background with strokeColor (C) border\n // Hovered: color (IC) background fill, no border\n background: isHovered.value ? color.value : 'transparent',\n border: !isHovered.value ? `2px solid ${strokeColor.value}` : 'none',\n opacity: isHovered.value ? opacity.value : 1,\n boxSizing: 'border-box',\n pointerEvents: 'auto',\n cursor: props.isSelected ? 'move' : 'pointer',\n display: 'flex',\n alignItems: 'center',\n justifyContent:\n textAlign.value === PdfTextAlignment.Left\n ? 'flex-start'\n : textAlign.value === PdfTextAlignment.Right\n ? 'flex-end'\n : 'center',\n overflow: 'hidden',\n}));\n\nconst textStyle = computed<CSSProperties>(() => ({\n color: textColor.value,\n fontSize: `${fontSize.value * props.scale}px`,\n ...standardFontCssProperties(fontFamily.value),\n textAlign: textAlignmentToCss(textAlign.value),\n whiteSpace: overlayTextRepeat.value ? 'normal' : 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n padding: '4px',\n}));\n</script>\n","import { createRenderer, type BoxedAnnotationRenderer } from '@embedpdf/plugin-annotation/vue';\nimport { PdfAnnotationSubtype, type PdfRedactAnnoObject } from '@embedpdf/models';\nimport RedactHighlight from './annotations/redact-highlight.vue';\nimport RedactArea from './annotations/redact-area.vue';\n\n/**\n * Boxed annotation renderers for Redact annotations.\n * Type safety is enforced at definition time via createRenderer.\n * These are automatically registered with the annotation plugin via context.\n */\nexport const redactRenderers: BoxedAnnotationRenderer[] = [\n createRenderer<PdfRedactAnnoObject>({\n id: 'redactHighlight',\n matches: (a): a is PdfRedactAnnoObject =>\n a.type === PdfAnnotationSubtype.REDACT &&\n 'segmentRects' in a &&\n (a.segmentRects?.length ?? 0) > 0,\n component: RedactHighlight,\n interactionDefaults: { isDraggable: false, isResizable: false, isRotatable: false },\n useAppearanceStream: false,\n }),\n createRenderer<PdfRedactAnnoObject>({\n id: 'redactArea',\n matches: (a): a is PdfRedactAnnoObject =>\n a.type === PdfAnnotationSubtype.REDACT &&\n (!('segmentRects' in a) || !(a.segmentRects?.length ?? 0)),\n component: RedactArea,\n interactionDefaults: { isDraggable: false, isResizable: false, isRotatable: false },\n useAppearanceStream: false,\n }),\n];\n","<script setup lang=\"ts\">\nimport { useRegisterRenderers } from '@embedpdf/plugin-annotation/vue';\nimport { redactRenderers } from './redact-renderers';\n\n/**\n * Utility component that registers redact renderers once at app level.\n * Added via addUtility() so it mounts once, not per-page.\n */\nuseRegisterRenderers(redactRenderers);\n</script>\n\n<template>\n <slot />\n</template>\n","import { createPluginPackage } from '@embedpdf/core';\nimport { RedactionPluginPackage as BaseRedactionPackage } from '@embedpdf/plugin-redaction';\nimport { RedactRendererRegistration } from './components';\n\nexport * from './hooks';\nexport * from './components';\nexport * from './components/types';\nexport * from '@embedpdf/plugin-redaction';\n\n// Automatically register redact renderers when plugin is loaded\nexport const RedactionPluginPackage = createPluginPackage(BaseRedactionPackage)\n .addUtility(RedactRendererRegistration)\n .build();\n"],"names":["boundingRect","__props","rect","_openBlock","_createElementBlock","_Fragment","_renderList","rects","i","_mergeProps","key","onPointerdown","_cache","onClick","args","style","border","left","_unref","origin","x","scale","top","y","width","size","height","color","opacity","zIndex","$attrs","useRedactionPlugin","usePlugin","RedactionPlugin","id","useRedactionCapability","useCapability","props","plugin","redactionPlugin","documentState","useDocumentState","documentId","ref","actualScale","computed","_a","value","strokeColor","stroke","getPreviewStrokeColor","watch","pageIndex","docId","pageIdx","_","onCleanup","onRedactionMarqueeChange","data","immediate","_normalizeStyle","fill","class","className","onRedactionSelectionChange","formattedSelection","selection","find","s","segmentRects","_hoisted_1","_createVNode","Highlight","slots","useSlots","provides","redaction","items","selectedId","redactionValue","scoped","forDocument","currentState","getState","pending","filter","it","source","selected","page","off1","onPendingChange","map","off2","onSelectedChange","sel","select","e","stopPropagation","selectPending","shouldShowMenu","itemId","selectionMenu","buildContext","item","type","menuPlacement","suggestTop","spaceAbove","spaceBelow","renderSelectionMenu","menuWrapperProps","placement","context","length","kind","_createElementVNode","outline","bboxStroke","_createBlock","CounterRotate","rotation","default","_withCtx","_resolveDynamicComponent","_renderSlot","_ctx","$slots","_c","_b","document","pages","actualRotation","PendingRedactions","slotProps","MarqueeRedact","SelectionRedact","isHovered","annotation","object","textColor","fontColor","overlayColor","overlayText","overlayTextRepeat","fontSize","fontFamily","PdfStandardFont","Helvetica","textAlign","PdfTextAlignment","Center","renderedOverlayText","Array","join","getSegmentStyle","b","position","background","boxSizing","pointerEvents","cursor","display","alignItems","justifyContent","Left","Right","overflow","getTextStyle","Math","min","standardFontCssProperties","textAlignmentToCss","whiteSpace","textOverflow","lineHeight","onMouseenter","onMouseleave","inset","containerStyle","isSelected","textStyle","padding","redactRenderers","createRenderer","matches","a","PdfAnnotationSubtype","REDACT","component","RedactHighlight","interactionDefaults","isDraggable","isResizable","isRotatable","useAppearanceStream","RedactArea","useRegisterRenderers","RedactionPluginPackage","createPluginPackage","BaseRedactionPackage","addUtility","RedactRendererRegistration","build","state","initialDocumentState","toValue","providesValue","scope","onStateChange","newState","scopedProvides"],"mappings":"oeAmCA,MAOMA,EAPQC,EAOaC,mBAzCzBC,aAAA,GAAAC,EAAAA,mBAkBEC,EAAAA,SAAA,KAAAC,EAAAA,WAjBoBL,EAAAM,MAAK,CAAjBL,EAAMM,KADhBL,cAAAC,qBAkBE,MAlBFK,EAAAA,WAkBE,CAhBCC,IAAKF,EACLG,cAAWC,EAAA,KAAAA,EAAA,WAAEX,EAAAY,SAAAZ,EAAAY,WAAAC,IACbC,MAAK,4BAAsCd,EAAAe,OAAwBC,MAAAC,QAAAlB,GAAeE,EAAKiB,OAAOC,EAAIF,EAAAA,MAAAlB,GAAamB,OAAOC,EAAIlB,EAAKiB,OAAOC,GAAKnB,EAAAoB,MAAxE,KAAkGC,KAAAJ,QAAAlB,GAAeE,EAAKiB,OAAOI,EAAIL,EAAAA,MAAAlB,GAAamB,OAAOI,EAAIrB,EAAKiB,OAAOI,GAAKtB,EAAAoB,MAAxE,KAAmGG,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CFGuE,EAAyBC,EAAAA,oBAAoBC,EAAAA,wBACvDC,WAAWC,GACXC,uSTKDjK,IAKA,MAAMiC,SAAEA,GAAaxC,IACfyK,EAAQjK,EAAAA,IAA4BkK,wBAE1C1J,EAAAA,MACE,CAACwB,EAAU,IAAMmI,UAAQpK,IACzB,EAAEqK,EAAe1J,GAAQE,EAAGC,KAC1B,IAAKuJ,EAEH,YADAH,EAAM7J,MAAQ8J,EAAAA,sBAIhB,MAAMG,EAAQD,EAAc9H,YAAY5B,GAGxC,IACEuJ,EAAM7J,MAAQiK,EAAM7H,UACtB,OAASc,GAEP2G,EAAM7J,MAAQ8J,EAAAA,oBAChB,CAOArJ,EAJoBwJ,EAAMC,cAAeC,IACvCN,EAAM7J,MAAQmK,MAKlB,CAAEvJ,WAAW,IAGf,MAAMwJ,EAAiBtK,EAAAA,SAAS,WAC9B,MAAMQ,EAAQyJ,EAAAA,QAAQpK,GACtB,OAAO,OAAAI,EAAA6B,EAAS5B,YAAT,EAAAD,EAAgBmC,YAAY5B,KAAU,OAG/C,MAAO,CACLuJ,QACAjI,SAAUwI"}
|
package/dist/vue/index.js
CHANGED
|
@@ -26,8 +26,6 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
26
26
|
key: i,
|
|
27
27
|
onPointerdown: _cache[0] || (_cache[0] = //@ts-ignore
|
|
28
28
|
(...args) => __props.onClick && __props.onClick(...args)),
|
|
29
|
-
onTouchstart: _cache[1] || (_cache[1] = //@ts-ignore
|
|
30
|
-
(...args) => __props.onClick && __props.onClick(...args)),
|
|
31
29
|
style: {
|
|
32
30
|
position: "absolute",
|
|
33
31
|
border: __props.border,
|
|
@@ -196,7 +194,7 @@ const _hoisted_1 = {
|
|
|
196
194
|
key: 0,
|
|
197
195
|
style: { position: "absolute", inset: 0, pointerEvents: "none" }
|
|
198
196
|
};
|
|
199
|
-
const _hoisted_2 = ["onPointerdown"
|
|
197
|
+
const _hoisted_2 = ["onPointerdown"];
|
|
200
198
|
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
201
199
|
__name: "pending-redactions",
|
|
202
200
|
props: {
|
|
@@ -289,8 +287,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
289
287
|
pointerEvents: "auto",
|
|
290
288
|
cursor: "pointer"
|
|
291
289
|
}),
|
|
292
|
-
onPointerdown: (e) => select(e, item.id)
|
|
293
|
-
onTouchstart: (e) => select(e, item.id)
|
|
290
|
+
onPointerdown: (e) => select(e, item.id)
|
|
294
291
|
}, null, 44, _hoisted_2),
|
|
295
292
|
shouldShowMenu(item.id) ? (openBlock(), createBlock(unref(CounterRotate), {
|
|
296
293
|
key: 0,
|
|
@@ -431,10 +428,14 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
431
428
|
__name: "redact-highlight",
|
|
432
429
|
props: {
|
|
433
430
|
annotation: {},
|
|
431
|
+
currentObject: {},
|
|
434
432
|
isSelected: { type: Boolean },
|
|
433
|
+
isEditing: { type: Boolean },
|
|
435
434
|
scale: {},
|
|
436
435
|
pageIndex: {},
|
|
437
|
-
|
|
436
|
+
documentId: {},
|
|
437
|
+
onClick: { type: Function },
|
|
438
|
+
appearanceActive: { type: Boolean }
|
|
438
439
|
},
|
|
439
440
|
setup(__props) {
|
|
440
441
|
const props = __props;
|
|
@@ -489,8 +490,8 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
489
490
|
});
|
|
490
491
|
return (_ctx, _cache) => {
|
|
491
492
|
return openBlock(), createElementBlock("div", {
|
|
492
|
-
onMouseenter: _cache[
|
|
493
|
-
onMouseleave: _cache[
|
|
493
|
+
onMouseenter: _cache[1] || (_cache[1] = ($event) => isHovered.value = true),
|
|
494
|
+
onMouseleave: _cache[2] || (_cache[2] = ($event) => isHovered.value = false),
|
|
494
495
|
style: { position: "absolute", inset: 0 }
|
|
495
496
|
}, [
|
|
496
497
|
(openBlock(true), createElementBlock(Fragment, null, renderList(segmentRects.value, (b, i) => {
|
|
@@ -498,8 +499,6 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
498
499
|
key: i,
|
|
499
500
|
onPointerdown: _cache[0] || (_cache[0] = //@ts-ignore
|
|
500
501
|
(...args) => __props.onClick && __props.onClick(...args)),
|
|
501
|
-
onTouchstart: _cache[1] || (_cache[1] = //@ts-ignore
|
|
502
|
-
(...args) => __props.onClick && __props.onClick(...args)),
|
|
503
502
|
style: normalizeStyle(getSegmentStyle(b))
|
|
504
503
|
}, [
|
|
505
504
|
isHovered.value && overlayText.value ? (openBlock(), createElementBlock("span", {
|
|
@@ -516,10 +515,14 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
516
515
|
__name: "redact-area",
|
|
517
516
|
props: {
|
|
518
517
|
annotation: {},
|
|
518
|
+
currentObject: {},
|
|
519
519
|
isSelected: { type: Boolean },
|
|
520
|
+
isEditing: { type: Boolean },
|
|
520
521
|
scale: {},
|
|
521
522
|
pageIndex: {},
|
|
522
|
-
|
|
523
|
+
documentId: {},
|
|
524
|
+
onClick: { type: Function },
|
|
525
|
+
appearanceActive: { type: Boolean }
|
|
523
526
|
},
|
|
524
527
|
setup(__props) {
|
|
525
528
|
const props = __props;
|
|
@@ -572,11 +575,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
572
575
|
onPointerdown: _cache[0] || (_cache[0] = (e) => {
|
|
573
576
|
if (!__props.isSelected) __props.onClick(e);
|
|
574
577
|
}),
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
}),
|
|
578
|
-
onMouseenter: _cache[2] || (_cache[2] = ($event) => isHovered.value = true),
|
|
579
|
-
onMouseleave: _cache[3] || (_cache[3] = ($event) => isHovered.value = false),
|
|
578
|
+
onMouseenter: _cache[1] || (_cache[1] = ($event) => isHovered.value = true),
|
|
579
|
+
onMouseleave: _cache[2] || (_cache[2] = ($event) => isHovered.value = false),
|
|
580
580
|
style: normalizeStyle(containerStyle.value)
|
|
581
581
|
}, [
|
|
582
582
|
isHovered.value && overlayText.value ? (openBlock(), createElementBlock("span", {
|
|
@@ -594,7 +594,9 @@ const redactRenderers = [
|
|
|
594
594
|
var _a;
|
|
595
595
|
return a.type === PdfAnnotationSubtype.REDACT && "segmentRects" in a && (((_a = a.segmentRects) == null ? void 0 : _a.length) ?? 0) > 0;
|
|
596
596
|
},
|
|
597
|
-
component: _sfc_main$2
|
|
597
|
+
component: _sfc_main$2,
|
|
598
|
+
interactionDefaults: { isDraggable: false, isResizable: false, isRotatable: false },
|
|
599
|
+
useAppearanceStream: false
|
|
598
600
|
}),
|
|
599
601
|
createRenderer({
|
|
600
602
|
id: "redactArea",
|
|
@@ -602,7 +604,9 @@ const redactRenderers = [
|
|
|
602
604
|
var _a;
|
|
603
605
|
return a.type === PdfAnnotationSubtype.REDACT && (!("segmentRects" in a) || !(((_a = a.segmentRects) == null ? void 0 : _a.length) ?? 0));
|
|
604
606
|
},
|
|
605
|
-
component: _sfc_main$1
|
|
607
|
+
component: _sfc_main$1,
|
|
608
|
+
interactionDefaults: { isDraggable: false, isResizable: false, isRotatable: false },
|
|
609
|
+
useAppearanceStream: false
|
|
606
610
|
})
|
|
607
611
|
];
|
|
608
612
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|