@embedpdf/plugin-redaction 2.7.0 → 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.
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@embedpdf/core"),t=require("@embedpdf/plugin-redaction");require("svelte/internal/disclose-version");const n=require("svelte/internal/client"),r=require("svelte"),i=require("@embedpdf/plugin-annotation/svelte"),o=require("@embedpdf/models"),d=require("@embedpdf/core/svelte"),s=require("@embedpdf/utils/svelte");function l(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const n in e)if("default"!==n){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}return t.default=e,Object.freeze(t)}const a=l(n);var c=a.from_html("<span> </span>"),g=a.from_html('<div role="button" tabindex="0"><!></div>'),p=a.from_html('<div role="group"></div>');function u(e,t){a.push(t,!0);let n=a.state(!1);const r=a.derived(()=>t.annotation.object),i=a.derived(()=>a.get(r).segmentRects??[]),d=a.derived(()=>a.get(r).rect),s=a.derived(()=>a.get(r).strokeColor??"#FF0000"),l=a.derived(()=>a.get(r).color??"#000000"),u=a.derived(()=>a.get(r).opacity??1),v=a.derived(()=>a.get(r).fontColor??a.get(r).overlayColor??"#FFFFFF"),f=a.derived(()=>a.get(r).overlayText),m=a.derived(()=>a.get(r).overlayTextRepeat??!1),h=a.derived(()=>a.get(r).fontSize??12),x=a.derived(()=>a.get(r).fontFamily??o.PdfStandardFont.Helvetica),y=a.derived(()=>o.standardFontCssProperties(a.get(x))),b=a.derived(()=>a.get(r).textAlign??o.PdfTextAlignment.Center);function _(){if(!a.get(f))return null;if(!a.get(m))return a.get(f);return Array(10).fill(a.get(f)).join(" ")}const R=a.derived(()=>a.get(b)===o.PdfTextAlignment.Left?"flex-start":a.get(b)===o.PdfTextAlignment.Right?"flex-end":"center");var w=p();a.set_style(w,"",{},{position:"absolute",inset:"0"}),a.each(w,21,()=>a.get(i),a.index,(e,r)=>{const i=a.derived(()=>(a.get(d)?a.get(r).origin.x-a.get(d).origin.x:a.get(r).origin.x)*t.scale),p=a.derived(()=>(a.get(d)?a.get(r).origin.y-a.get(d).origin.y:a.get(r).origin.y)*t.scale),x=a.derived(()=>a.get(r).size.width*t.scale),w=a.derived(()=>a.get(r).size.height*t.scale),S=a.derived(()=>Math.min(a.get(h)*t.scale,.8*a.get(w)));var P=g();let C;P.__pointerdown=function(...e){var n;null==(n=t.onClick)||n.apply(this,e)},P.__touchstart=function(...e){var n;null==(n=t.onClick)||n.apply(this,e)};var I=a.child(P),F=e=>{var t=c();let n;var r=a.child(t,!0);a.reset(t),a.template_effect((e,i)=>{n=a.set_style(t,"",n,e),a.set_text(r,i)},[()=>({color:a.get(v),"font-size":`${a.get(S)??""}px`,"font-family":a.get(y).fontFamily,"font-weight":a.get(y).fontWeight,"font-style":a.get(y).fontStyle,"text-align":o.textAlignmentToCss(a.get(b)),"white-space":a.get(m)?"normal":"nowrap",overflow:"hidden","text-overflow":"ellipsis","line-height":"1"}),_]),a.append(e,t)};a.if(I,e=>{a.get(n)&&a.get(f)&&e(F)}),a.reset(P),a.template_effect(()=>C=a.set_style(P,"",C,{position:"absolute",left:`${a.get(i)??""}px`,top:`${a.get(p)??""}px`,width:`${a.get(x)??""}px`,height:`${a.get(w)??""}px`,background:a.get(n)?a.get(l):"transparent",border:a.get(n)?"none":`2px solid ${a.get(s)}`,opacity:a.get(n)?a.get(u):1,"box-sizing":"border-box","pointer-events":"auto",cursor:"pointer",display:"flex","align-items":"center","justify-content":a.get(R),overflow:"hidden"})),a.append(e,P)}),a.reset(w),a.event("mouseenter",w,()=>a.set(n,!0)),a.event("mouseleave",w,()=>a.set(n,!1)),a.append(e,w),a.pop()}a.delegate(["pointerdown","touchstart"]);var v=a.from_html("<span> </span>"),f=a.from_html('<div role="button" tabindex="0"><!></div>');function m(e,t){a.push(t,!0);let n=a.state(!1);const r=a.derived(()=>t.annotation.object),i=a.derived(()=>a.get(r).strokeColor??"#FF0000"),d=a.derived(()=>a.get(r).color??"#000000"),s=a.derived(()=>a.get(r).opacity??1),l=a.derived(()=>a.get(r).fontColor??a.get(r).overlayColor??"#FFFFFF"),c=a.derived(()=>a.get(r).overlayText),g=a.derived(()=>a.get(r).overlayTextRepeat??!1),p=a.derived(()=>a.get(r).fontSize??12),u=a.derived(()=>a.get(r).fontFamily??o.PdfStandardFont.Helvetica),m=a.derived(()=>o.standardFontCssProperties(a.get(u))),h=a.derived(()=>a.get(r).textAlign??o.PdfTextAlignment.Center);function x(){if(!a.get(c))return null;if(!a.get(g))return a.get(c);return Array(10).fill(a.get(c)).join(" ")}const y=a.derived(()=>a.get(h)===o.PdfTextAlignment.Left?"flex-start":a.get(h)===o.PdfTextAlignment.Right?"flex-end":"center");var b=f();let _;b.__pointerdown=e=>{t.isSelected||t.onClick(e)},b.__touchstart=e=>{t.isSelected||t.onClick(e)};var R=a.child(b),w=e=>{var n=v();let r;var i=a.child(n,!0);a.reset(n),a.template_effect((e,t)=>{r=a.set_style(n,"",r,e),a.set_text(i,t)},[()=>({color:a.get(l),"font-size":a.get(p)*t.scale+"px","font-family":a.get(m).fontFamily,"font-weight":a.get(m).fontWeight,"font-style":a.get(m).fontStyle,"text-align":o.textAlignmentToCss(a.get(h)),"white-space":a.get(g)?"normal":"nowrap",overflow:"hidden","text-overflow":"ellipsis",padding:"4px"}),x]),a.append(e,n)};a.if(R,e=>{a.get(n)&&a.get(c)&&e(w)}),a.reset(b),a.template_effect(()=>_=a.set_style(b,"",_,{position:"absolute",inset:"0",background:a.get(n)?a.get(d):"transparent",border:a.get(n)?"none":`2px solid ${a.get(i)}`,opacity:a.get(n)?a.get(s):1,"box-sizing":"border-box","pointer-events":"auto",cursor:t.isSelected?"move":"pointer",display:"flex","align-items":"center","justify-content":a.get(y),overflow:"hidden"})),a.event("mouseenter",b,()=>a.set(n,!0)),a.event("mouseleave",b,()=>a.set(n,!1)),a.append(e,b),a.pop()}a.delegate(["pointerdown","touchstart"]);const h=[i.createRenderer({id:"redactHighlight",matches:e=>{var t;return e.type===o.PdfAnnotationSubtype.REDACT&&"segmentRects"in e&&((null==(t=e.segmentRects)?void 0:t.length)??0)>0},component:u,interactionDefaults:{isDraggable:!1,isResizable:!1,isRotatable:!1},useAppearanceStream:!1}),i.createRenderer({id:"redactArea",matches:e=>{var t;return!(e.type!==o.PdfAnnotationSubtype.REDACT||"segmentRects"in e&&(null==(t=e.segmentRects)?void 0:t.length))},component:m,interactionDefaults:{isDraggable:!1,isResizable:!1,isRotatable:!1},useAppearanceStream:!1})];function x(e,t){a.push(t,!0);const n=i.getRendererRegistry();r.onMount(()=>{if(n)return n.register(h)});var o=a.comment(),d=a.first_child(o),s=e=>{var n=a.comment(),r=a.first_child(n);a.snippet(r,()=>t.children),a.append(e,n)};a.if(d,e=>{t.children&&e(s)}),a.append(e,o),a.pop()}const y=()=>d.usePlugin(t.RedactionPlugin.id),b=()=>d.useCapability(t.RedactionPlugin.id);var _=a.from_html("<div></div>");function R(e,t){let n=a.prop(t,"color",3,"#FFFF00"),r=a.prop(t,"opacity",3,1),i=a.prop(t,"border",3,"1px solid red"),o=a.prop(t,"style",3,"");const d=a.derived(()=>t.rect);var s=a.comment(),l=a.first_child(s);a.each(l,17,()=>t.rects,a.index,(e,s)=>{var l=_();let c;l.__pointerdown=function(...e){var n;null==(n=t.onClick)||n.apply(this,e)},l.__touchstart=function(...e){var n;null==(n=t.onClick)||n.apply(this,e)},a.template_effect(()=>c=a.set_style(l,o(),c,{position:"absolute",border:i(),left:(a.get(d)?a.get(s).origin.x-a.get(d).origin.x:a.get(s).origin.x)*t.scale+"px",top:(a.get(d)?a.get(s).origin.y-a.get(d).origin.y:a.get(s).origin.y)*t.scale+"px",width:a.get(s).size.width*t.scale+"px",height:a.get(s).size.height*t.scale+"px",background:n(),opacity:r(),"pointer-events":t.onClick?"auto":"none",cursor:t.onClick?"pointer":"default","z-index":t.onClick?"1":void 0})),a.append(e,l)}),a.append(e,s)}a.delegate(["pointerdown","touchstart"]);var w=a.from_html("<div></div>");function S(e,t){a.push(t,!0);let n=a.prop(t,"className",3,""),r=a.prop(t,"fill",3,"transparent");const i=y(),o=d.useDocumentState(()=>t.documentId);let s=a.state(null);const l=a.derived(()=>{var e;return void 0!==t.scale?t.scale:(null==(e=o.current)?void 0:e.scale)??1}),c=a.derived(()=>{var e;return t.stroke??(null==(e=i.plugin)?void 0:e.getPreviewStrokeColor())??"red"});a.user_effect(()=>{if(i.plugin&&t.documentId)return i.plugin.onRedactionMarqueeChange(t.documentId,e=>{a.set(s,e.pageIndex===t.pageIndex?e.rect:null,!0)});a.set(s,null)});var g=a.comment(),p=a.first_child(g),u=e=>{var t=w();let i;a.template_effect(()=>{a.set_class(t,1,a.clsx(n())),i=a.set_style(t,"",i,{position:"absolute","pointer-events":"none",left:a.get(s).origin.x*a.get(l)+"px",top:a.get(s).origin.y*a.get(l)+"px",width:a.get(s).size.width*a.get(l)+"px",height:a.get(s).size.height*a.get(l)+"px",border:`1px solid ${a.get(c)}`,background:r(),"box-sizing":"border-box"})}),a.append(e,t)};a.if(p,e=>{a.get(s)&&e(u)}),a.append(e,g),a.pop()}var P=a.from_html("<div></div> <!>",1),C=a.from_html("<div><!></div> <!>",1),I=a.from_html('<div style="position: absolute; inset: 0; pointer-events: none;"></div>');function F(e,t){a.push(t,!0);let n=a.prop(t,"rotation",19,()=>o.Rotation.Degree0),r=a.prop(t,"bboxStroke",3,"rgba(0,0,0,0.8)");const i=b();let d=a.state(a.proxy([])),l=a.state(null);function c(e,n){e.stopPropagation(),i.provides&&i.provides.forDocument(t.documentId).selectPending(t.pageIndex,n)}function g(e){return a.get(l)===e&&(!!t.selectionMenu||!!t.selectionMenuSnippet)}function p(e){return{type:"redaction",item:e,pageIndex:t.pageIndex}}a.user_effect(()=>{var e;const n=i.provides;if(!n)return a.set(d,[],!0),void a.set(l,null);const r=n.forDocument(t.documentId),o=r.getState();a.set(d,(o.pending[t.pageIndex]??[]).filter(e=>"legacy"===e.source),!0),a.set(l,(null==(e=o.selected)?void 0:e.page)===t.pageIndex?o.selected.id:null,!0);const s=r.onPendingChange(e=>{a.set(d,(e[t.pageIndex]??[]).filter(e=>"legacy"===e.source),!0)}),c=r.onSelectedChange(e=>{a.set(l,(null==e?void 0:e.page)===t.pageIndex?e.id:null,!0)});return()=>{null==s||s(),null==c||c()}});const u={suggestTop:!1,spaceAbove:0,spaceBelow:0};function v(e,t,n){return{context:p(e),selected:a.get(l)===e.id,rect:t,placement:u,menuWrapperProps:n}}var f=a.comment(),m=a.first_child(f),h=e=>{var i=I();a.each(i,21,()=>a.get(d),e=>e.id,(e,i)=>{var o=a.comment(),d=a.first_child(o),p=e=>{var o=P(),d=a.first_child(o);d.__pointerdown=e=>c(e,a.get(i).id),d.__touchstart=e=>c(e,a.get(i).id);var p=a.sibling(d,2),u=e=>{{const r=(e,n)=>{const r=a.derived(()=>v(a.get(i),null==n?void 0:n().rect,null==n?void 0:n().menuWrapperProps));var o=a.comment(),d=a.first_child(o),s=e=>{const n=a.derived(()=>t.selectionMenu(a.get(r)));var i=a.comment(),o=a.first_child(i),d=e=>{var t=a.comment(),r=a.first_child(t);a.component(r,()=>a.get(n).component,(e,t)=>{t(e,a.spread_props(()=>a.get(n).props))}),a.append(e,t)};a.if(o,e=>{a.get(n)&&e(d)}),a.append(e,i)},l=e=>{var n=a.comment(),i=a.first_child(n),o=e=>{var n=a.comment(),i=a.first_child(n);a.snippet(i,()=>t.selectionMenuSnippet,()=>a.get(r)),a.append(e,n)};a.if(i,e=>{t.selectionMenuSnippet&&e(o)},!0),a.append(e,n)};a.if(d,e=>{t.selectionMenu?e(s):e(l,!1)}),a.append(e,o)};let o=a.derived(()=>({origin:{x:a.get(i).rect.origin.x*t.scale,y:a.get(i).rect.origin.y*t.scale},size:{width:a.get(i).rect.size.width*t.scale,height:a.get(i).rect.size.height*t.scale}}));s.CounterRotate(e,{get rect(){return a.get(o)},get rotation(){return n()},children:r,$$slots:{default:!0}})}};a.if(p,e=>{g(a.get(i).id)&&e(u)}),a.template_effect(()=>a.set_style(d,`\n position: absolute;\n left: ${a.get(i).rect.origin.x*t.scale}px;\n top: ${a.get(i).rect.origin.y*t.scale}px;\n width: ${a.get(i).rect.size.width*t.scale}px;\n height: ${a.get(i).rect.size.height*t.scale}px;\n background: transparent;\n outline: ${a.get(l)===a.get(i).id?`1px solid ${r()}`:"none"};\n outline-offset: 2px;\n border: 1px solid red;\n pointer-events: auto;\n cursor: pointer;\n `)),a.append(e,o)},u=e=>{var o=C(),d=a.first_child(o);R(a.child(d),{get rect(){return a.get(i).rect},get rects(){return a.get(i).rects},color:"transparent",border:"1px solid red",get scale(){return t.scale},onClick:e=>c(e,a.get(i).id)}),a.reset(d);var p=a.sibling(d,2),u=e=>{{const r=(e,n)=>{const r=a.derived(()=>v(a.get(i),null==n?void 0:n().rect,null==n?void 0:n().menuWrapperProps));var o=a.comment(),d=a.first_child(o),s=e=>{const n=a.derived(()=>t.selectionMenu(a.get(r)));var i=a.comment(),o=a.first_child(i),d=e=>{var t=a.comment(),r=a.first_child(t);a.component(r,()=>a.get(n).component,(e,t)=>{t(e,a.spread_props(()=>a.get(n).props))}),a.append(e,t)};a.if(o,e=>{a.get(n)&&e(d)}),a.append(e,i)},l=e=>{var n=a.comment(),i=a.first_child(n),o=e=>{var n=a.comment(),i=a.first_child(n);a.snippet(i,()=>t.selectionMenuSnippet,()=>a.get(r)),a.append(e,n)};a.if(i,e=>{t.selectionMenuSnippet&&e(o)},!0),a.append(e,n)};a.if(d,e=>{t.selectionMenu?e(s):e(l,!1)}),a.append(e,o)};let o=a.derived(()=>({origin:{x:a.get(i).rect.origin.x*t.scale,y:a.get(i).rect.origin.y*t.scale},size:{width:a.get(i).rect.size.width*t.scale,height:a.get(i).rect.size.height*t.scale}}));s.CounterRotate(e,{get rect(){return a.get(o)},get rotation(){return n()},children:r,$$slots:{default:!0}})}};a.if(p,e=>{g(a.get(i).id)&&e(u)}),a.template_effect(()=>a.set_style(d,`\n position: absolute;\n left: ${a.get(i).rect.origin.x*t.scale}px;\n top: ${a.get(i).rect.origin.y*t.scale}px;\n width: ${a.get(i).rect.size.width*t.scale}px;\n height: ${a.get(i).rect.size.height*t.scale}px;\n background: transparent;\n outline: ${a.get(l)===a.get(i).id?`1px solid ${r()}`:"none"};\n outline-offset: 2px;\n pointer-events: auto;\n cursor: ${a.get(l)===a.get(i).id?"pointer":"default"};\n `)),a.append(e,o)};a.if(d,e=>{"area"===a.get(i).kind?e(p):e(u,!1)}),a.append(e,o)}),a.reset(i),a.append(e,i)};a.if(m,e=>{a.get(d).length&&e(h)}),a.append(e,f),a.pop()}a.delegate(["pointerdown","touchstart"]);var k=a.from_html("<div><!></div>");function z(e,t){a.push(t,!0);const n=y();let r=a.state(a.proxy([])),i=a.state(null);const o=a.derived(()=>{var e;return(null==(e=n.plugin)?void 0:e.getPreviewStrokeColor())??"red"});a.user_effect(()=>n.plugin?n.plugin.onRedactionSelectionChange(t.documentId,e=>{const n=e.find(e=>e.pageIndex===t.pageIndex);a.set(r,(null==n?void 0:n.segmentRects)??[],!0),a.set(i,(null==n?void 0:n.rect)??null,!0)}):(a.set(r,[],!0),void a.set(i,null)));var d=a.comment(),s=a.first_child(d),l=e=>{var n=k();a.set_style(n,"",{},{"mix-blend-mode":"normal","pointer-events":"none",position:"absolute",inset:"0"});var i=a.child(n);{let e=a.derived(()=>`1px solid ${a.get(o)}`);R(i,{color:"transparent",opacity:1,get rects(){return a.get(r)},get scale(){return t.scale},get border(){return a.get(e)}})}a.reset(n),a.append(e,n)};a.if(s,e=>{a.get(i)&&e(l)}),a.append(e,d),a.pop()}var $=a.from_html("<!> <!> <!>",1);const A=e.createPluginPackage(t.RedactionPluginPackage).addUtility(x).build();exports.Highlight=R,exports.MarqueeRedact=S,exports.PendingRedactions=F,exports.RedactArea=m,exports.RedactHighlight=u,exports.RedactRendererRegistration=x,exports.RedactionLayer=function(e,t){a.push(t,!0);const n=d.useDocumentState(()=>t.documentId),r=a.derived(()=>{var e,r,i;return null==(i=null==(r=null==(e=n.current)?void 0:e.document)?void 0:r.pages)?void 0:i[t.pageIndex]}),i=a.derived(()=>{var e;return void 0!==t.scale?t.scale:(null==(e=n.current)?void 0:e.scale)??1}),o=a.derived(()=>{var e,i;if(void 0!==t.rotation)return t.rotation;return(((null==(e=a.get(r))?void 0:e.rotation)??0)+((null==(i=n.current)?void 0:i.rotation)??0))%4});var s=$(),l=a.first_child(s);F(l,{get documentId(){return t.documentId},get pageIndex(){return t.pageIndex},get scale(){return a.get(i)},get rotation(){return a.get(o)},get selectionMenu(){return t.selectionMenu},get selectionMenuSnippet(){return t.selectionMenuSnippet}});var c=a.sibling(l,2);S(c,{get documentId(){return t.documentId},get pageIndex(){return t.pageIndex},get scale(){return a.get(i)}}),z(a.sibling(c,2),{get documentId(){return t.documentId},get pageIndex(){return t.pageIndex},get scale(){return a.get(i)}}),a.append(e,s),a.pop()},exports.RedactionPluginPackage=A,exports.SelectionRedact=z,exports.redactRenderers=h,exports.useRedaction=e=>{const n=b();let r=a.state(a.proxy(t.initialDocumentState));const i=a.derived(e),o=a.derived(()=>n.provides&&a.get(i)?n.provides.forDocument(a.get(i)):null);return a.user_effect(()=>{const e=n.provides,o=a.get(i);if(!e||!o)return void a.set(r,t.initialDocumentState,!0);const d=e.forDocument(o);try{a.set(r,d.getState(),!0)}catch(s){a.set(r,t.initialDocumentState,!0)}return d.onStateChange(e=>{a.set(r,e,!0)})}),{get provides(){return a.get(o)},get state(){return a.get(r)}}},exports.useRedactionCapability=b,exports.useRedactionPlugin=y,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");require("svelte/internal/disclose-version");const n=require("svelte/internal/client"),r=require("svelte"),i=require("@embedpdf/plugin-annotation/svelte"),o=require("@embedpdf/models"),d=require("@embedpdf/core/svelte"),s=require("@embedpdf/utils/svelte");function l(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const n in e)if("default"!==n){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}return t.default=e,Object.freeze(t)}const a=l(n);var g=a.from_html("<span> </span>"),c=a.from_html('<div role="button" tabindex="0"><!></div>'),p=a.from_html('<div role="group"></div>');function u(e,t){a.push(t,!0);let n=a.state(!1);const r=a.derived(()=>t.annotation.object),i=a.derived(()=>a.get(r).segmentRects??[]),d=a.derived(()=>a.get(r).rect),s=a.derived(()=>a.get(r).strokeColor??"#FF0000"),l=a.derived(()=>a.get(r).color??"#000000"),u=a.derived(()=>a.get(r).opacity??1),v=a.derived(()=>a.get(r).fontColor??a.get(r).overlayColor??"#FFFFFF"),f=a.derived(()=>a.get(r).overlayText),m=a.derived(()=>a.get(r).overlayTextRepeat??!1),h=a.derived(()=>a.get(r).fontSize??12),x=a.derived(()=>a.get(r).fontFamily??o.PdfStandardFont.Helvetica),y=a.derived(()=>o.standardFontCssProperties(a.get(x))),b=a.derived(()=>a.get(r).textAlign??o.PdfTextAlignment.Center);function _(){if(!a.get(f))return null;if(!a.get(m))return a.get(f);return Array(10).fill(a.get(f)).join(" ")}const R=a.derived(()=>a.get(b)===o.PdfTextAlignment.Left?"flex-start":a.get(b)===o.PdfTextAlignment.Right?"flex-end":"center");var w=p();a.set_style(w,"",{},{position:"absolute",inset:"0"}),a.each(w,21,()=>a.get(i),a.index,(e,r)=>{const i=a.derived(()=>(a.get(d)?a.get(r).origin.x-a.get(d).origin.x:a.get(r).origin.x)*t.scale),p=a.derived(()=>(a.get(d)?a.get(r).origin.y-a.get(d).origin.y:a.get(r).origin.y)*t.scale),x=a.derived(()=>a.get(r).size.width*t.scale),w=a.derived(()=>a.get(r).size.height*t.scale),S=a.derived(()=>Math.min(a.get(h)*t.scale,.8*a.get(w)));var P=c();let C;P.__pointerdown=function(...e){var n;null==(n=t.onClick)||n.apply(this,e)};var I=a.child(P),F=e=>{var t=g();let n;var r=a.child(t,!0);a.reset(t),a.template_effect((e,i)=>{n=a.set_style(t,"",n,e),a.set_text(r,i)},[()=>({color:a.get(v),"font-size":`${a.get(S)??""}px`,"font-family":a.get(y).fontFamily,"font-weight":a.get(y).fontWeight,"font-style":a.get(y).fontStyle,"text-align":o.textAlignmentToCss(a.get(b)),"white-space":a.get(m)?"normal":"nowrap",overflow:"hidden","text-overflow":"ellipsis","line-height":"1"}),_]),a.append(e,t)};a.if(I,e=>{a.get(n)&&a.get(f)&&e(F)}),a.reset(P),a.template_effect(()=>C=a.set_style(P,"",C,{position:"absolute",left:`${a.get(i)??""}px`,top:`${a.get(p)??""}px`,width:`${a.get(x)??""}px`,height:`${a.get(w)??""}px`,background:a.get(n)?a.get(l):"transparent",border:a.get(n)?"none":`2px solid ${a.get(s)}`,opacity:a.get(n)?a.get(u):1,"box-sizing":"border-box","pointer-events":"auto",cursor:"pointer",display:"flex","align-items":"center","justify-content":a.get(R),overflow:"hidden"})),a.append(e,P)}),a.reset(w),a.event("mouseenter",w,()=>a.set(n,!0)),a.event("mouseleave",w,()=>a.set(n,!1)),a.append(e,w),a.pop()}a.delegate(["pointerdown"]);var v=a.from_html("<span> </span>"),f=a.from_html('<div role="button" tabindex="0"><!></div>');function m(e,t){a.push(t,!0);let n=a.state(!1);const r=a.derived(()=>t.annotation.object),i=a.derived(()=>a.get(r).strokeColor??"#FF0000"),d=a.derived(()=>a.get(r).color??"#000000"),s=a.derived(()=>a.get(r).opacity??1),l=a.derived(()=>a.get(r).fontColor??a.get(r).overlayColor??"#FFFFFF"),g=a.derived(()=>a.get(r).overlayText),c=a.derived(()=>a.get(r).overlayTextRepeat??!1),p=a.derived(()=>a.get(r).fontSize??12),u=a.derived(()=>a.get(r).fontFamily??o.PdfStandardFont.Helvetica),m=a.derived(()=>o.standardFontCssProperties(a.get(u))),h=a.derived(()=>a.get(r).textAlign??o.PdfTextAlignment.Center);function x(){if(!a.get(g))return null;if(!a.get(c))return a.get(g);return Array(10).fill(a.get(g)).join(" ")}const y=a.derived(()=>a.get(h)===o.PdfTextAlignment.Left?"flex-start":a.get(h)===o.PdfTextAlignment.Right?"flex-end":"center");var b=f();let _;b.__pointerdown=e=>{t.isSelected||t.onClick(e)};var R=a.child(b),w=e=>{var n=v();let r;var i=a.child(n,!0);a.reset(n),a.template_effect((e,t)=>{r=a.set_style(n,"",r,e),a.set_text(i,t)},[()=>({color:a.get(l),"font-size":a.get(p)*t.scale+"px","font-family":a.get(m).fontFamily,"font-weight":a.get(m).fontWeight,"font-style":a.get(m).fontStyle,"text-align":o.textAlignmentToCss(a.get(h)),"white-space":a.get(c)?"normal":"nowrap",overflow:"hidden","text-overflow":"ellipsis",padding:"4px"}),x]),a.append(e,n)};a.if(R,e=>{a.get(n)&&a.get(g)&&e(w)}),a.reset(b),a.template_effect(()=>_=a.set_style(b,"",_,{position:"absolute",inset:"0",background:a.get(n)?a.get(d):"transparent",border:a.get(n)?"none":`2px solid ${a.get(i)}`,opacity:a.get(n)?a.get(s):1,"box-sizing":"border-box","pointer-events":"auto",cursor:t.isSelected?"move":"pointer",display:"flex","align-items":"center","justify-content":a.get(y),overflow:"hidden"})),a.event("mouseenter",b,()=>a.set(n,!0)),a.event("mouseleave",b,()=>a.set(n,!1)),a.append(e,b),a.pop()}a.delegate(["pointerdown"]);const h=[i.createRenderer({id:"redactHighlight",matches:e=>{var t;return e.type===o.PdfAnnotationSubtype.REDACT&&"segmentRects"in e&&((null==(t=e.segmentRects)?void 0:t.length)??0)>0},component:u,interactionDefaults:{isDraggable:!1,isResizable:!1,isRotatable:!1},useAppearanceStream:!1}),i.createRenderer({id:"redactArea",matches:e=>{var t;return!(e.type!==o.PdfAnnotationSubtype.REDACT||"segmentRects"in e&&(null==(t=e.segmentRects)?void 0:t.length))},component:m,interactionDefaults:{isDraggable:!1,isResizable:!1,isRotatable:!1},useAppearanceStream:!1})];function x(e,t){a.push(t,!0);const n=i.getRendererRegistry();r.onMount(()=>{if(n)return n.register(h)});var o=a.comment(),d=a.first_child(o),s=e=>{var n=a.comment(),r=a.first_child(n);a.snippet(r,()=>t.children),a.append(e,n)};a.if(d,e=>{t.children&&e(s)}),a.append(e,o),a.pop()}const y=()=>d.usePlugin(t.RedactionPlugin.id),b=()=>d.useCapability(t.RedactionPlugin.id);var _=a.from_html("<div></div>");function R(e,t){let n=a.prop(t,"color",3,"#FFFF00"),r=a.prop(t,"opacity",3,1),i=a.prop(t,"border",3,"1px solid red"),o=a.prop(t,"style",3,"");const d=a.derived(()=>t.rect);var s=a.comment(),l=a.first_child(s);a.each(l,17,()=>t.rects,a.index,(e,s)=>{var l=_();let g;l.__pointerdown=function(...e){var n;null==(n=t.onClick)||n.apply(this,e)},a.template_effect(()=>g=a.set_style(l,o(),g,{position:"absolute",border:i(),left:(a.get(d)?a.get(s).origin.x-a.get(d).origin.x:a.get(s).origin.x)*t.scale+"px",top:(a.get(d)?a.get(s).origin.y-a.get(d).origin.y:a.get(s).origin.y)*t.scale+"px",width:a.get(s).size.width*t.scale+"px",height:a.get(s).size.height*t.scale+"px",background:n(),opacity:r(),"pointer-events":t.onClick?"auto":"none",cursor:t.onClick?"pointer":"default","z-index":t.onClick?"1":void 0})),a.append(e,l)}),a.append(e,s)}a.delegate(["pointerdown"]);var w=a.from_html("<div></div>");function S(e,t){a.push(t,!0);let n=a.prop(t,"className",3,""),r=a.prop(t,"fill",3,"transparent");const i=y(),o=d.useDocumentState(()=>t.documentId);let s=a.state(null);const l=a.derived(()=>{var e;return void 0!==t.scale?t.scale:(null==(e=o.current)?void 0:e.scale)??1}),g=a.derived(()=>{var e;return t.stroke??(null==(e=i.plugin)?void 0:e.getPreviewStrokeColor())??"red"});a.user_effect(()=>{if(i.plugin&&t.documentId)return i.plugin.onRedactionMarqueeChange(t.documentId,e=>{a.set(s,e.pageIndex===t.pageIndex?e.rect:null,!0)});a.set(s,null)});var c=a.comment(),p=a.first_child(c),u=e=>{var t=w();let i;a.template_effect(()=>{a.set_class(t,1,a.clsx(n())),i=a.set_style(t,"",i,{position:"absolute","pointer-events":"none",left:a.get(s).origin.x*a.get(l)+"px",top:a.get(s).origin.y*a.get(l)+"px",width:a.get(s).size.width*a.get(l)+"px",height:a.get(s).size.height*a.get(l)+"px",border:`1px solid ${a.get(g)}`,background:r(),"box-sizing":"border-box"})}),a.append(e,t)};a.if(p,e=>{a.get(s)&&e(u)}),a.append(e,c),a.pop()}var P=a.from_html("<div></div> <!>",1),C=a.from_html("<div><!></div> <!>",1),I=a.from_html('<div style="position: absolute; inset: 0; pointer-events: none;"></div>');function F(e,t){a.push(t,!0);let n=a.prop(t,"rotation",19,()=>o.Rotation.Degree0),r=a.prop(t,"bboxStroke",3,"rgba(0,0,0,0.8)");const i=b();let d=a.state(a.proxy([])),l=a.state(null);function g(e,n){e.stopPropagation(),i.provides&&i.provides.forDocument(t.documentId).selectPending(t.pageIndex,n)}function c(e){return a.get(l)===e&&(!!t.selectionMenu||!!t.selectionMenuSnippet)}function p(e){return{type:"redaction",item:e,pageIndex:t.pageIndex}}a.user_effect(()=>{var e;const n=i.provides;if(!n)return a.set(d,[],!0),void a.set(l,null);const r=n.forDocument(t.documentId),o=r.getState();a.set(d,(o.pending[t.pageIndex]??[]).filter(e=>"legacy"===e.source),!0),a.set(l,(null==(e=o.selected)?void 0:e.page)===t.pageIndex?o.selected.id:null,!0);const s=r.onPendingChange(e=>{a.set(d,(e[t.pageIndex]??[]).filter(e=>"legacy"===e.source),!0)}),g=r.onSelectedChange(e=>{a.set(l,(null==e?void 0:e.page)===t.pageIndex?e.id:null,!0)});return()=>{null==s||s(),null==g||g()}});const u={suggestTop:!1,spaceAbove:0,spaceBelow:0};function v(e,t,n){return{context:p(e),selected:a.get(l)===e.id,rect:t,placement:u,menuWrapperProps:n}}var f=a.comment(),m=a.first_child(f),h=e=>{var i=I();a.each(i,21,()=>a.get(d),e=>e.id,(e,i)=>{var o=a.comment(),d=a.first_child(o),p=e=>{var o=P(),d=a.first_child(o);d.__pointerdown=e=>g(e,a.get(i).id);var p=a.sibling(d,2),u=e=>{{const r=(e,n)=>{const r=a.derived(()=>v(a.get(i),null==n?void 0:n().rect,null==n?void 0:n().menuWrapperProps));var o=a.comment(),d=a.first_child(o),s=e=>{const n=a.derived(()=>t.selectionMenu(a.get(r)));var i=a.comment(),o=a.first_child(i),d=e=>{var t=a.comment(),r=a.first_child(t);a.component(r,()=>a.get(n).component,(e,t)=>{t(e,a.spread_props(()=>a.get(n).props))}),a.append(e,t)};a.if(o,e=>{a.get(n)&&e(d)}),a.append(e,i)},l=e=>{var n=a.comment(),i=a.first_child(n),o=e=>{var n=a.comment(),i=a.first_child(n);a.snippet(i,()=>t.selectionMenuSnippet,()=>a.get(r)),a.append(e,n)};a.if(i,e=>{t.selectionMenuSnippet&&e(o)},!0),a.append(e,n)};a.if(d,e=>{t.selectionMenu?e(s):e(l,!1)}),a.append(e,o)};let o=a.derived(()=>({origin:{x:a.get(i).rect.origin.x*t.scale,y:a.get(i).rect.origin.y*t.scale},size:{width:a.get(i).rect.size.width*t.scale,height:a.get(i).rect.size.height*t.scale}}));s.CounterRotate(e,{get rect(){return a.get(o)},get rotation(){return n()},children:r,$$slots:{default:!0}})}};a.if(p,e=>{c(a.get(i).id)&&e(u)}),a.template_effect(()=>a.set_style(d,`\n position: absolute;\n left: ${a.get(i).rect.origin.x*t.scale}px;\n top: ${a.get(i).rect.origin.y*t.scale}px;\n width: ${a.get(i).rect.size.width*t.scale}px;\n height: ${a.get(i).rect.size.height*t.scale}px;\n background: transparent;\n outline: ${a.get(l)===a.get(i).id?`1px solid ${r()}`:"none"};\n outline-offset: 2px;\n border: 1px solid red;\n pointer-events: auto;\n cursor: pointer;\n `)),a.append(e,o)},u=e=>{var o=C(),d=a.first_child(o);R(a.child(d),{get rect(){return a.get(i).rect},get rects(){return a.get(i).rects},color:"transparent",border:"1px solid red",get scale(){return t.scale},onClick:e=>g(e,a.get(i).id)}),a.reset(d);var p=a.sibling(d,2),u=e=>{{const r=(e,n)=>{const r=a.derived(()=>v(a.get(i),null==n?void 0:n().rect,null==n?void 0:n().menuWrapperProps));var o=a.comment(),d=a.first_child(o),s=e=>{const n=a.derived(()=>t.selectionMenu(a.get(r)));var i=a.comment(),o=a.first_child(i),d=e=>{var t=a.comment(),r=a.first_child(t);a.component(r,()=>a.get(n).component,(e,t)=>{t(e,a.spread_props(()=>a.get(n).props))}),a.append(e,t)};a.if(o,e=>{a.get(n)&&e(d)}),a.append(e,i)},l=e=>{var n=a.comment(),i=a.first_child(n),o=e=>{var n=a.comment(),i=a.first_child(n);a.snippet(i,()=>t.selectionMenuSnippet,()=>a.get(r)),a.append(e,n)};a.if(i,e=>{t.selectionMenuSnippet&&e(o)},!0),a.append(e,n)};a.if(d,e=>{t.selectionMenu?e(s):e(l,!1)}),a.append(e,o)};let o=a.derived(()=>({origin:{x:a.get(i).rect.origin.x*t.scale,y:a.get(i).rect.origin.y*t.scale},size:{width:a.get(i).rect.size.width*t.scale,height:a.get(i).rect.size.height*t.scale}}));s.CounterRotate(e,{get rect(){return a.get(o)},get rotation(){return n()},children:r,$$slots:{default:!0}})}};a.if(p,e=>{c(a.get(i).id)&&e(u)}),a.template_effect(()=>a.set_style(d,`\n position: absolute;\n left: ${a.get(i).rect.origin.x*t.scale}px;\n top: ${a.get(i).rect.origin.y*t.scale}px;\n width: ${a.get(i).rect.size.width*t.scale}px;\n height: ${a.get(i).rect.size.height*t.scale}px;\n background: transparent;\n outline: ${a.get(l)===a.get(i).id?`1px solid ${r()}`:"none"};\n outline-offset: 2px;\n pointer-events: auto;\n cursor: ${a.get(l)===a.get(i).id?"pointer":"default"};\n `)),a.append(e,o)};a.if(d,e=>{"area"===a.get(i).kind?e(p):e(u,!1)}),a.append(e,o)}),a.reset(i),a.append(e,i)};a.if(m,e=>{a.get(d).length&&e(h)}),a.append(e,f),a.pop()}a.delegate(["pointerdown"]);var z=a.from_html("<div><!></div>");function $(e,t){a.push(t,!0);const n=y();let r=a.state(a.proxy([])),i=a.state(null);const o=a.derived(()=>{var e;return(null==(e=n.plugin)?void 0:e.getPreviewStrokeColor())??"red"});a.user_effect(()=>n.plugin?n.plugin.onRedactionSelectionChange(t.documentId,e=>{const n=e.find(e=>e.pageIndex===t.pageIndex);a.set(r,(null==n?void 0:n.segmentRects)??[],!0),a.set(i,(null==n?void 0:n.rect)??null,!0)}):(a.set(r,[],!0),void a.set(i,null)));var d=a.comment(),s=a.first_child(d),l=e=>{var n=z();a.set_style(n,"",{},{"mix-blend-mode":"normal","pointer-events":"none",position:"absolute",inset:"0"});var i=a.child(n);{let e=a.derived(()=>`1px solid ${a.get(o)}`);R(i,{color:"transparent",opacity:1,get rects(){return a.get(r)},get scale(){return t.scale},get border(){return a.get(e)}})}a.reset(n),a.append(e,n)};a.if(s,e=>{a.get(i)&&e(l)}),a.append(e,d),a.pop()}var k=a.from_html("<!> <!> <!>",1);const A=e.createPluginPackage(t.RedactionPluginPackage).addUtility(x).build();exports.Highlight=R,exports.MarqueeRedact=S,exports.PendingRedactions=F,exports.RedactArea=m,exports.RedactHighlight=u,exports.RedactRendererRegistration=x,exports.RedactionLayer=function(e,t){a.push(t,!0);const n=d.useDocumentState(()=>t.documentId),r=a.derived(()=>{var e,r,i;return null==(i=null==(r=null==(e=n.current)?void 0:e.document)?void 0:r.pages)?void 0:i[t.pageIndex]}),i=a.derived(()=>{var e;return void 0!==t.scale?t.scale:(null==(e=n.current)?void 0:e.scale)??1}),o=a.derived(()=>{var e,i;if(void 0!==t.rotation)return t.rotation;return(((null==(e=a.get(r))?void 0:e.rotation)??0)+((null==(i=n.current)?void 0:i.rotation)??0))%4});var s=k(),l=a.first_child(s);F(l,{get documentId(){return t.documentId},get pageIndex(){return t.pageIndex},get scale(){return a.get(i)},get rotation(){return a.get(o)},get selectionMenu(){return t.selectionMenu},get selectionMenuSnippet(){return t.selectionMenuSnippet}});var g=a.sibling(l,2);S(g,{get documentId(){return t.documentId},get pageIndex(){return t.pageIndex},get scale(){return a.get(i)}}),$(a.sibling(g,2),{get documentId(){return t.documentId},get pageIndex(){return t.pageIndex},get scale(){return a.get(i)}}),a.append(e,s),a.pop()},exports.RedactionPluginPackage=A,exports.SelectionRedact=$,exports.redactRenderers=h,exports.useRedaction=e=>{const n=b();let r=a.state(a.proxy(t.initialDocumentState));const i=a.derived(e),o=a.derived(()=>n.provides&&a.get(i)?n.provides.forDocument(a.get(i)):null);return a.user_effect(()=>{const e=n.provides,o=a.get(i);if(!e||!o)return void a.set(r,t.initialDocumentState,!0);const d=e.forDocument(o);try{a.set(r,d.getState(),!0)}catch(s){a.set(r,t.initialDocumentState,!0)}return d.onStateChange(e=>{a.set(r,e,!0)})}),{get provides(){return a.get(o)},get state(){return a.get(r)}}},exports.useRedactionCapability=b,exports.useRedactionPlugin=y,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
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../src/svelte/components/annotations/RedactHighlight.svelte","../../src/svelte/components/annotations/RedactArea.svelte","../../src/svelte/components/redact-renderers.ts","../../src/svelte/components/RedactRendererRegistration.svelte","../../src/svelte/hooks/use-redaction.svelte.ts","../../src/svelte/components/highlight.svelte","../../src/svelte/components/marquee-redact.svelte","../../src/svelte/components/pending-redactions.svelte","../../src/svelte/components/selection-redact.svelte","../../src/svelte/index.ts","../../src/svelte/components/redaction-layer.svelte"],"sourcesContent":["<script lang=\"ts\">\n import type { AnnotationRendererProps } from '@embedpdf/plugin-annotation/svelte';\n import type { PdfRedactAnnoObject } from '@embedpdf/models';\n import {\n PdfStandardFont,\n PdfTextAlignment,\n standardFontCssProperties,\n textAlignmentToCss,\n } from '@embedpdf/models';\n\n let { annotation, isSelected, scale, onClick }: AnnotationRendererProps<PdfRedactAnnoObject> =\n $props();\n let isHovered = $state(false);\n\n const object = $derived(annotation.object);\n\n const segmentRects = $derived(object.segmentRects ?? []);\n const rect = $derived(object.rect);\n\n // C - Border/stroke color\n const strokeColor = $derived(object.strokeColor ?? '#FF0000');\n // IC - Interior color (background fill when redaction is applied)\n const color = $derived(object.color ?? '#000000');\n // CA - Opacity (0-1)\n const opacity = $derived(object.opacity ?? 1);\n // OC - Overlay text color (Adobe extension), fallback to fontColor\n const textColor = $derived(object.fontColor ?? object.overlayColor ?? '#FFFFFF');\n // Overlay text properties\n const overlayText = $derived(object.overlayText);\n const overlayTextRepeat = $derived(object.overlayTextRepeat ?? false);\n const fontSize = $derived(object.fontSize ?? 12);\n const fontFamily = $derived(object.fontFamily ?? PdfStandardFont.Helvetica);\n const fontCss = $derived(standardFontCssProperties(fontFamily));\n const textAlign = $derived(object.textAlign ?? PdfTextAlignment.Center);\n\n // Calculate how many times to repeat text (approximate)\n function renderOverlayText(): string | null {\n if (!overlayText) return null;\n if (!overlayTextRepeat) return overlayText;\n // Repeat text multiple times to fill the space\n const reps = 10;\n return Array(reps).fill(overlayText).join(' ');\n }\n\n const justifyContent = $derived(\n textAlign === PdfTextAlignment.Left\n ? 'flex-start'\n : textAlign === PdfTextAlignment.Right\n ? 'flex-end'\n : 'center',\n );\n</script>\n\n<div\n role=\"group\"\n onmouseenter={() => (isHovered = true)}\n onmouseleave={() => (isHovered = false)}\n style:position=\"absolute\"\n style:inset=\"0\"\n>\n {#each segmentRects as b, i (i)}\n {@const left = (rect ? b.origin.x - rect.origin.x : b.origin.x) * scale}\n {@const top = (rect ? b.origin.y - rect.origin.y : b.origin.y) * scale}\n {@const width = b.size.width * scale}\n {@const height = b.size.height * scale}\n {@const scaledFontSize = Math.min(fontSize * scale, height * 0.8)}\n <div\n role=\"button\"\n tabindex=\"0\"\n onpointerdown={onClick}\n ontouchstart={onClick}\n style:position=\"absolute\"\n style:left=\"{left}px\"\n style:top=\"{top}px\"\n style:width=\"{width}px\"\n style:height=\"{height}px\"\n style:background={isHovered ? color : 'transparent'}\n style:border={!isHovered ? `2px solid ${strokeColor}` : 'none'}\n style:opacity={isHovered ? opacity : 1}\n style:box-sizing=\"border-box\"\n style:pointer-events=\"auto\"\n style:cursor=\"pointer\"\n style:display=\"flex\"\n style:align-items=\"center\"\n style:justify-content={justifyContent}\n style:overflow=\"hidden\"\n >\n {#if isHovered && overlayText}\n <span\n style:color={textColor}\n style:font-size=\"{scaledFontSize}px\"\n style:font-family={fontCss.fontFamily}\n style:font-weight={fontCss.fontWeight}\n style:font-style={fontCss.fontStyle}\n style:text-align={textAlignmentToCss(textAlign)}\n style:white-space={overlayTextRepeat ? 'normal' : 'nowrap'}\n style:overflow=\"hidden\"\n style:text-overflow=\"ellipsis\"\n style:line-height=\"1\"\n >\n {renderOverlayText()}\n </span>\n {/if}\n </div>\n {/each}\n</div>\n","<script lang=\"ts\">\n import type { AnnotationRendererProps } from '@embedpdf/plugin-annotation/svelte';\n import type { PdfRedactAnnoObject } from '@embedpdf/models';\n import {\n PdfStandardFont,\n PdfTextAlignment,\n standardFontCssProperties,\n textAlignmentToCss,\n } from '@embedpdf/models';\n\n let { annotation, isSelected, scale, onClick }: AnnotationRendererProps<PdfRedactAnnoObject> =\n $props();\n let isHovered = $state(false);\n\n const object = $derived(annotation.object);\n\n // C - Border/stroke color\n const strokeColor = $derived(object.strokeColor ?? '#FF0000');\n // IC - Interior color (background fill when redaction is applied)\n const color = $derived(object.color ?? '#000000');\n // CA - Opacity (0-1)\n const opacity = $derived(object.opacity ?? 1);\n // OC - Overlay text color (Adobe extension), fallback to fontColor\n const textColor = $derived(object.fontColor ?? object.overlayColor ?? '#FFFFFF');\n // Overlay text properties\n const overlayText = $derived(object.overlayText);\n const overlayTextRepeat = $derived(object.overlayTextRepeat ?? false);\n const fontSize = $derived(object.fontSize ?? 12);\n const fontFamily = $derived(object.fontFamily ?? PdfStandardFont.Helvetica);\n const fontCss = $derived(standardFontCssProperties(fontFamily));\n const textAlign = $derived(object.textAlign ?? PdfTextAlignment.Center);\n\n // Calculate how many times to repeat text (approximate)\n function renderOverlayText(): string | null {\n if (!overlayText) return null;\n if (!overlayTextRepeat) return overlayText;\n // Repeat text multiple times to fill the space\n const reps = 10;\n return Array(reps).fill(overlayText).join(' ');\n }\n\n const justifyContent = $derived(\n textAlign === PdfTextAlignment.Left\n ? 'flex-start'\n : textAlign === PdfTextAlignment.Right\n ? 'flex-end'\n : 'center',\n );\n</script>\n\n<div\n role=\"button\"\n tabindex=\"0\"\n onpointerdown={(e) => {\n if (!isSelected) onClick(e);\n }}\n ontouchstart={(e) => {\n if (!isSelected) onClick(e);\n }}\n onmouseenter={() => (isHovered = true)}\n onmouseleave={() => (isHovered = false)}\n style:position=\"absolute\"\n style:inset=\"0\"\n style:background={isHovered ? color : 'transparent'}\n style:border={!isHovered ? `2px solid ${strokeColor}` : 'none'}\n style:opacity={isHovered ? opacity : 1}\n style:box-sizing=\"border-box\"\n style:pointer-events=\"auto\"\n style:cursor={isSelected ? 'move' : 'pointer'}\n style:display=\"flex\"\n style:align-items=\"center\"\n style:justify-content={justifyContent}\n style:overflow=\"hidden\"\n>\n {#if isHovered && overlayText}\n <span\n style:color={textColor}\n style:font-size=\"{fontSize * scale}px\"\n style:font-family={fontCss.fontFamily}\n style:font-weight={fontCss.fontWeight}\n style:font-style={fontCss.fontStyle}\n style:text-align={textAlignmentToCss(textAlign)}\n style:white-space={overlayTextRepeat ? 'normal' : 'nowrap'}\n style:overflow=\"hidden\"\n style:text-overflow=\"ellipsis\"\n style:padding=\"4px\"\n >\n {renderOverlayText()}\n </span>\n {/if}\n</div>\n","import { createRenderer, type BoxedAnnotationRenderer } from '@embedpdf/plugin-annotation/svelte';\nimport { PdfAnnotationSubtype, type PdfRedactAnnoObject } from '@embedpdf/models';\nimport RedactHighlight from './annotations/RedactHighlight.svelte';\nimport RedactArea from './annotations/RedactArea.svelte';\n\n/**\n * Boxed annotation renderers for Redact annotations.\n * Type safety is enforced at definition time via createRenderer.\n * These are automatically registered with the annotation plugin via context.\n */\nexport const redactRenderers: BoxedAnnotationRenderer[] = [\n createRenderer<PdfRedactAnnoObject>({\n id: 'redactHighlight',\n matches: (a): a is PdfRedactAnnoObject =>\n a.type === PdfAnnotationSubtype.REDACT &&\n 'segmentRects' in a &&\n (a.segmentRects?.length ?? 0) > 0,\n component: RedactHighlight,\n interactionDefaults: { isDraggable: false, isResizable: false, isRotatable: false },\n useAppearanceStream: false,\n }),\n createRenderer<PdfRedactAnnoObject>({\n id: 'redactArea',\n matches: (a): a is PdfRedactAnnoObject =>\n a.type === PdfAnnotationSubtype.REDACT &&\n (!('segmentRects' in a) || !(a.segmentRects?.length ?? 0)),\n component: RedactArea,\n interactionDefaults: { isDraggable: false, isResizable: false, isRotatable: false },\n useAppearanceStream: false,\n }),\n];\n","<script lang=\"ts\">\n import { onMount } from 'svelte';\n import { getRendererRegistry } from '@embedpdf/plugin-annotation/svelte';\n import { redactRenderers } from './redact-renderers';\n import type { Snippet } from 'svelte';\n\n let { children }: { children?: Snippet } = $props();\n\n const registry = getRendererRegistry();\n\n onMount(() => {\n if (!registry) return;\n return registry.register(redactRenderers);\n });\n</script>\n\n{#if children}\n {@render children()}\n{/if}\n","import {\n RedactionPlugin,\n initialDocumentState,\n RedactionDocumentState,\n RedactionScope,\n} from '@embedpdf/plugin-redaction';\nimport { useCapability, usePlugin } from '@embedpdf/core/svelte';\n\nexport const useRedactionPlugin = () => usePlugin<RedactionPlugin>(RedactionPlugin.id);\nexport const useRedactionCapability = () => useCapability<RedactionPlugin>(RedactionPlugin.id);\n\n// Define the return type explicitly to maintain type safety\ninterface UseRedactionReturn {\n provides: RedactionScope | null;\n state: RedactionDocumentState;\n}\n\n/**\n * Hook for redaction state for a specific document\n * @param getDocumentId Document ID getter function\n */\nexport const useRedaction = (getDocumentId: () => string | null): UseRedactionReturn => {\n const capability = useRedactionCapability();\n\n let state = $state<RedactionDocumentState>(initialDocumentState);\n\n // Reactive documentId\n const documentId = $derived(getDocumentId());\n\n // Scoped capability for current docId\n const scopedProvides = $derived(\n capability.provides && documentId ? capability.provides.forDocument(documentId) : null,\n );\n\n $effect(() => {\n const provides = capability.provides;\n const docId = documentId;\n\n if (!provides || !docId) {\n state = initialDocumentState;\n return;\n }\n\n const scope = provides.forDocument(docId);\n\n // Get initial state\n try {\n state = scope.getState();\n } catch (e) {\n // Handle case where state might not be ready\n state = initialDocumentState;\n }\n\n // Subscribe to state changes for THIS docId\n return scope.onStateChange((newState) => {\n state = newState;\n });\n });\n\n return {\n get provides() {\n return scopedProvides;\n },\n get state() {\n return state;\n },\n };\n};\n","<script lang=\"ts\">\n import type { Rect } from '@embedpdf/models';\n\n interface HighlightProps {\n color?: string;\n opacity?: number;\n border?: string;\n rects: Rect[];\n rect?: Rect;\n scale: number;\n onClick?: (e: MouseEvent | TouchEvent) => void;\n style?: string;\n }\n\n let {\n color = '#FFFF00',\n opacity = 1,\n border = '1px solid red',\n rects,\n rect,\n scale,\n onClick,\n style = '',\n }: HighlightProps = $props();\n\n // Rename rect to boundingRect for clarity\n const boundingRect = $derived(rect);\n</script>\n\n{#each rects as b, i (i)}\n <div\n onpointerdown={onClick}\n ontouchstart={onClick}\n style:position=\"absolute\"\n style:border\n style:left={`${(boundingRect ? b.origin.x - boundingRect.origin.x : b.origin.x) * scale}px`}\n style:top={`${(boundingRect ? b.origin.y - boundingRect.origin.y : b.origin.y) * scale}px`}\n style:width={`${b.size.width * scale}px`}\n style:height={`${b.size.height * scale}px`}\n style:background={color}\n style:opacity\n style:pointer-events={onClick ? 'auto' : 'none'}\n style:cursor={onClick ? 'pointer' : 'default'}\n style:z-index={onClick ? '1' : undefined}\n {style}\n ></div>\n{/each}\n","<script lang=\"ts\">\n import { useDocumentState } from '@embedpdf/core/svelte';\n import type { Rect } from '@embedpdf/models';\n import { useRedactionPlugin } from '../hooks/use-redaction.svelte';\n\n interface MarqueeRedactProps {\n /** The ID of the document */\n documentId: string;\n /** Index of the page this layer lives on */\n pageIndex: number;\n /** Scale of the page */\n scale?: number;\n /** Optional CSS class applied to the marquee rectangle */\n className?: string;\n /** Stroke / fill colours (defaults below) */\n stroke?: string;\n fill?: string;\n }\n\n let {\n documentId,\n pageIndex,\n scale: scaleOverride,\n className = '',\n stroke,\n fill = 'transparent',\n }: MarqueeRedactProps = $props();\n\n const redactionPlugin = useRedactionPlugin();\n const documentState = useDocumentState(() => documentId);\n let rect = $state<Rect | null>(null);\n\n const actualScale = $derived(\n scaleOverride !== undefined ? scaleOverride : (documentState.current?.scale ?? 1),\n );\n\n // Get stroke color from plugin (annotation mode uses tool defaults, legacy uses red)\n // Allow prop override for backwards compatibility\n const strokeColor = $derived(stroke ?? redactionPlugin.plugin?.getPreviewStrokeColor() ?? 'red');\n\n $effect(() => {\n if (!redactionPlugin.plugin || !documentId) {\n rect = null;\n return;\n }\n\n return redactionPlugin.plugin.onRedactionMarqueeChange(documentId, (data) => {\n rect = data.pageIndex === pageIndex ? data.rect : null;\n });\n });\n</script>\n\n{#if rect}\n <div\n class={className}\n style:position=\"absolute\"\n style:pointer-events=\"none\"\n style:left={`${rect.origin.x * actualScale}px`}\n style:top={`${rect.origin.y * actualScale}px`}\n style:width={`${rect.size.width * actualScale}px`}\n style:height={`${rect.size.height * actualScale}px`}\n style:border={`1px solid ${strokeColor}`}\n style:background={fill}\n style:box-sizing=\"border-box\"\n ></div>\n{/if}\n","<script lang=\"ts\">\n import type { Snippet } from 'svelte';\n import type { Rect } from '@embedpdf/models';\n import { Rotation } from '@embedpdf/models';\n import { CounterRotate } from '@embedpdf/utils/svelte';\n import type { MenuWrapperProps, SelectionMenuPlacement } from '@embedpdf/utils/svelte';\n import type { RedactionItem } from '@embedpdf/plugin-redaction';\n import { useRedactionCapability } from '../hooks/use-redaction.svelte';\n import Highlight from './highlight.svelte';\n import type {\n RedactionSelectionContext,\n RedactionSelectionMenuRenderFn,\n RedactionSelectionMenuProps,\n } from '../types';\n\n interface Props {\n documentId: string;\n pageIndex: number;\n scale: number;\n rotation?: Rotation;\n bboxStroke?: string;\n selectionMenu?: RedactionSelectionMenuRenderFn;\n selectionMenuSnippet?: Snippet<[RedactionSelectionMenuProps]>;\n }\n\n let {\n documentId,\n pageIndex,\n scale,\n rotation = Rotation.Degree0,\n bboxStroke = 'rgba(0,0,0,0.8)',\n selectionMenu,\n selectionMenuSnippet,\n }: Props = $props();\n\n const redactionCapability = useRedactionCapability();\n\n let items = $state<RedactionItem[]>([]);\n let selectedId = $state<string | null>(null);\n\n $effect(() => {\n const redactionValue = redactionCapability.provides;\n if (!redactionValue) {\n items = [];\n selectedId = null;\n return;\n }\n\n const scoped = redactionValue.forDocument(documentId);\n const currentState = scoped.getState();\n // Only show legacy mode items (not annotation-based redactions)\n items = (currentState.pending[pageIndex] ?? []).filter((it) => it.source === 'legacy');\n selectedId = currentState.selected?.page === pageIndex ? currentState.selected.id : null;\n\n const off1 = scoped.onPendingChange((map) => {\n // Only show legacy mode items (not annotation-based redactions)\n items = (map[pageIndex] ?? []).filter((it) => it.source === 'legacy');\n });\n\n const off2 = scoped.onSelectedChange((sel) => {\n selectedId = sel?.page === pageIndex ? sel.id : null;\n });\n\n return () => {\n off1?.();\n off2?.();\n };\n });\n\n function select(e: MouseEvent | TouchEvent, id: string) {\n e.stopPropagation();\n if (!redactionCapability.provides) return;\n redactionCapability.provides.forDocument(documentId).selectPending(pageIndex, id);\n }\n\n function shouldShowMenu(itemId: string): boolean {\n const isSelected = selectedId === itemId;\n return isSelected && (!!selectionMenu || !!selectionMenuSnippet);\n }\n\n function buildContext(item: RedactionItem): RedactionSelectionContext {\n return { type: 'redaction', item, pageIndex };\n }\n\n const menuPlacement: SelectionMenuPlacement = {\n suggestTop: false,\n spaceAbove: 0,\n spaceBelow: 0,\n };\n\n function buildMenuProps(\n item: RedactionItem,\n rect: Rect,\n menuWrapperProps: MenuWrapperProps,\n ): RedactionSelectionMenuProps {\n return {\n context: buildContext(item),\n selected: selectedId === item.id,\n rect,\n placement: menuPlacement,\n menuWrapperProps,\n };\n }\n</script>\n\n{#if items.length}\n <div style=\"position: absolute; inset: 0; pointer-events: none;\">\n {#each items as item (item.id)}\n {#if item.kind === 'area'}\n <div\n style=\"\n position: absolute;\n left: {item.rect.origin.x * scale}px;\n top: {item.rect.origin.y * scale}px;\n width: {item.rect.size.width * scale}px;\n height: {item.rect.size.height * scale}px;\n background: transparent;\n outline: {selectedId === item.id ? `1px solid ${bboxStroke}` : 'none'};\n outline-offset: 2px;\n border: 1px solid red;\n pointer-events: auto;\n cursor: pointer;\n \"\n onpointerdown={(e) => select(e, item.id)}\n ontouchstart={(e) => select(e, item.id)}\n ></div>\n\n {#if shouldShowMenu(item.id)}\n <CounterRotate\n rect={{\n origin: { x: item.rect.origin.x * scale, y: item.rect.origin.y * scale },\n size: { width: item.rect.size.width * scale, height: item.rect.size.height * scale },\n }}\n {rotation}\n >\n {#snippet children({ rect, menuWrapperProps })}\n {@const menuProps = buildMenuProps(item, rect, menuWrapperProps)}\n {#if selectionMenu}\n {@const result = selectionMenu(menuProps)}\n {#if result}\n <result.component {...result.props} />\n {/if}\n {:else if selectionMenuSnippet}\n {@render selectionMenuSnippet(menuProps)}\n {/if}\n {/snippet}\n </CounterRotate>\n {/if}\n {:else}\n <div\n style=\"\n position: absolute;\n left: {item.rect.origin.x * scale}px;\n top: {item.rect.origin.y * scale}px;\n width: {item.rect.size.width * scale}px;\n height: {item.rect.size.height * scale}px;\n background: transparent;\n outline: {selectedId === item.id ? `1px solid ${bboxStroke}` : 'none'};\n outline-offset: 2px;\n pointer-events: auto;\n cursor: {selectedId === item.id ? 'pointer' : 'default'};\n \"\n >\n <Highlight\n rect={item.rect}\n rects={item.rects}\n color=\"transparent\"\n border=\"1px solid red\"\n {scale}\n onClick={(e) => select(e, item.id)}\n />\n </div>\n\n {#if shouldShowMenu(item.id)}\n <CounterRotate\n rect={{\n origin: { x: item.rect.origin.x * scale, y: item.rect.origin.y * scale },\n size: { width: item.rect.size.width * scale, height: item.rect.size.height * scale },\n }}\n {rotation}\n >\n {#snippet children({ rect, menuWrapperProps })}\n {@const menuProps = buildMenuProps(item, rect, menuWrapperProps)}\n {#if selectionMenu}\n {@const result = selectionMenu(menuProps)}\n {#if result}\n <result.component {...result.props} />\n {/if}\n {:else if selectionMenuSnippet}\n {@render selectionMenuSnippet(menuProps)}\n {/if}\n {/snippet}\n </CounterRotate>\n {/if}\n {/if}\n {/each}\n </div>\n{/if}\n","<script lang=\"ts\">\n import type { Rect } from '@embedpdf/models';\n import { useRedactionPlugin } from '../hooks/use-redaction.svelte';\n import Highlight from './highlight.svelte';\n\n interface SelectionRedactProps {\n documentId: string;\n pageIndex: number;\n scale: number;\n }\n\n let { documentId, pageIndex, scale }: SelectionRedactProps = $props();\n\n const redactionPlugin = useRedactionPlugin();\n let rects = $state<Rect[]>([]);\n let boundingRect = $state<Rect | null>(null);\n\n // Get stroke color from plugin (annotation mode uses tool defaults, legacy uses red)\n const strokeColor = $derived(redactionPlugin.plugin?.getPreviewStrokeColor() ?? 'red');\n\n $effect(() => {\n if (!redactionPlugin.plugin) {\n rects = [];\n boundingRect = null;\n return;\n }\n\n return redactionPlugin.plugin.onRedactionSelectionChange(documentId, (formattedSelection) => {\n const selection = formattedSelection.find((s) => s.pageIndex === pageIndex);\n rects = selection?.segmentRects ?? [];\n boundingRect = selection?.rect ?? null;\n });\n });\n</script>\n\n{#if boundingRect}\n <div\n style:mix-blend-mode=\"normal\"\n style:pointer-events=\"none\"\n style:position=\"absolute\"\n style:inset=\"0\"\n >\n <Highlight\n color=\"transparent\"\n opacity={1}\n {rects}\n {scale}\n border={`1px solid ${strokeColor}`}\n />\n </div>\n{/if}\n","import { createPluginPackage } from '@embedpdf/core';\nimport { RedactionPluginPackage as BaseRedactionPackage } from '@embedpdf/plugin-redaction';\nimport RedactRendererRegistration from './components/RedactRendererRegistration.svelte';\n\nexport * from './hooks';\nexport * from './components';\nexport * from './types';\nexport * from '@embedpdf/plugin-redaction';\n\nexport const RedactionPluginPackage = createPluginPackage(BaseRedactionPackage)\n .addUtility(RedactRendererRegistration)\n .build();\n","<script lang=\"ts\">\n import type { Snippet } from 'svelte';\n import { useDocumentState } from '@embedpdf/core/svelte';\n import { Rotation } from '@embedpdf/models';\n import PendingRedactions from './pending-redactions.svelte';\n import MarqueeRedact from './marquee-redact.svelte';\n import SelectionRedact from './selection-redact.svelte';\n import type { RedactionSelectionMenuRenderFn, RedactionSelectionMenuProps } from '../types';\n\n interface RedactionLayerProps {\n /** The ID of the document this layer belongs to */\n documentId: string;\n /** Index of the page this layer lives on */\n pageIndex: number;\n /** Current render scale for this page */\n scale?: number;\n /** Page rotation (for counter-rotating menus, etc.) */\n rotation?: Rotation;\n /** Render function for selection menu (schema-driven approach) */\n selectionMenu?: RedactionSelectionMenuRenderFn;\n /** Snippet for custom selection menu (slot-based approach) */\n selectionMenuSnippet?: Snippet<[RedactionSelectionMenuProps]>;\n }\n\n let {\n documentId,\n pageIndex,\n scale,\n rotation,\n selectionMenu,\n selectionMenuSnippet,\n }: RedactionLayerProps = $props();\n\n const documentState = useDocumentState(() => documentId);\n const page = $derived(documentState.current?.document?.pages?.[pageIndex]);\n\n const actualScale = $derived(scale !== undefined ? scale : (documentState.current?.scale ?? 1));\n\n const actualRotation = $derived.by(() => {\n if (rotation !== undefined) return rotation;\n // Combine page intrinsic rotation with document rotation\n const pageRotation = page?.rotation ?? 0;\n const docRotation = documentState.current?.rotation ?? 0;\n return ((pageRotation + docRotation) % 4) as Rotation;\n });\n</script>\n\n<PendingRedactions\n {documentId}\n {pageIndex}\n scale={actualScale}\n rotation={actualRotation}\n {selectionMenu}\n {selectionMenuSnippet}\n/>\n<MarqueeRedact {documentId} {pageIndex} scale={actualScale} />\n<SelectionRedact {documentId} {pageIndex} scale={actualScale} />\n"],"names":["isHovered","$","state","object","segmentRects","derived","get","rect","strokeColor","color","opacity","textColor","fontColor","overlayColor","overlayText","overlayTextRepeat","fontSize","fontFamily","PdfStandardFont","Helvetica","fontCss","standardFontCssProperties","textAlign","PdfTextAlignment","Center","renderOverlayText","Array","fill","join","justifyContent","Left","Right","div","root","position","inset","index","$$anchor","b","left","origin","x","$$props","scale","top","y","width","size","height","scaledFontSize","Math","min","div_1","root_1","__pointerdown","$$args","__touchstart","span","root_2","styles_1","$0","fontWeight","fontStyle","textAlignmentToCss","$$render","consequent","styles","set","e","cursor","isSelected","redactRenderers","createRenderer","id","matches","a","type","PdfAnnotationSubtype","REDACT","_a","length","component","RedactHighlight","interactionDefaults","isDraggable","isResizable","isRotatable","useAppearanceStream","RedactArea","registry","getRendererRegistry","onMount","register","useRedactionPlugin","usePlugin","RedactionPlugin","useRedactionCapability","useCapability","border","style","boundingRect","template_effect","set_style","onClick","className","redactionPlugin","documentState","useDocumentState","documentId","actualScale","current","plugin","getPreviewStrokeColor","user_effect","onRedactionMarqueeChange","data","pageIndex","set_class","rotation","prop","Rotation","Degree0","bboxStroke","redactionCapability","items","proxy","selectedId","select","stopPropagation","provides","forDocument","selectPending","shouldShowMenu","itemId","selectionMenu","selectionMenuSnippet","buildContext","item","redactionValue","scoped","currentState","getState","pending","filter","it","source","selected","page","off1","onPendingChange","map","off2","onSelectedChange","sel","menuPlacement","suggestTop","spaceAbove","spaceBelow","buildMenuProps","menuWrapperProps","context","placement","first_child","fragment_2","children","$$arg0","menuProps","result","result_component","spread_props","props","CounterRotate","consequent_3","div_2","fragment_9","Highlight","rects","result_component_1","consequent_5","consequent_8","kind","consequent_4","alternate_2","consequent_9","onRedactionSelectionChange","formattedSelection","selection","find","s","node_1","RedactionPluginPackage","createPluginPackage","BaseRedactionPackage","addUtility","RedactRendererRegistration","build","_c","_b","document","pages","actualRotation","PendingRedactions","node","MarqueeRedact","SelectionRedact","getDocumentId","capability","initialDocumentState","scopedProvides","docId","scope","onStateChange","newState"],"mappings":"21BAYMA,EAAYC,EAAAC,OAAO,GAEjB,MAAAC,6BAA6BA,QAE7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AA,OAAAtH,EAAA2B,EAAcI,cAAd,EAAA/B,EAAuBuH,eAAvB,EAAAD,EAAiCE,gBAAK7J,EAAA0E,aAEtDP,EAAW5G,EAAAI,QAAA,WAAA,YAAsB,IAAtBqC,EAAAC,MAA+BD,EAAAC,OAAY,OAAAoC,EAAA2B,EAAcI,kBAASnE,QAAS,IAEtF6J,EAAcvM,EAAAI,QAAA,qBACD,eAAS,OAAAqC,EAAA4E,kBAERrH,OAAAA,EAAAA,EAAAK,IAAG6I,aAAM7B,WAAY,KACnB,OAAA+E,EAAA3F,EAAcI,cAAd,EAAAuF,EAAuB/E,WAAY,IAChB,iCAI1CmF,EAAgBC,EAAA,oGAGR7F,gCACG2F,iIAIXG,EAAad,EAAA,oGAAiChF,MAC9C+F,iBAAe,oGAAiC/F,2BAXzC,4GNxBqBgG,IACrB,MAAAC,EAAa9G,QAEf9F,EAAQD,EAAAC,cAA+B6M,EAAAA,uBAGrC,MAAAnG,YAAsBiG,GAGtBG,EAAA/M,EAAAI,QAAA,IACJyM,EAAW7E,gBAAYrB,GAAakG,EAAW7E,SAASC,kBAAYtB,IAAc,aAGpF3G,EAAAgH,uBACQgB,EAAW6E,EAAW7E,SACtBgF,QAAQrG,OAETqB,IAAagF,cAChBhN,EAAAkE,IAAAjE,EAAQ6M,EAAAA,sBAAA,GAIJ,MAAAG,EAAQjF,EAASC,YAAY+E,aAIjC/M,EAAQgN,EAAMrE,YAAA,EAChB,OAASzE,GAEPnE,EAAAkE,IAAAjE,EAAQ6M,EAAAA,sBAAA,EACV,CAGO,OAAAG,EAAMC,cAAeC,IAC1BnN,EAAAkE,IAAAjE,EAAQkN,GAAA,QAKN,YAAAnF,gBACK+E,EACT,EACI,SAAA9M,gBACKA,EACT"}
1
+ {"version":3,"file":"index.cjs","sources":["../../src/svelte/components/annotations/RedactHighlight.svelte","../../src/svelte/components/annotations/RedactArea.svelte","../../src/svelte/components/redact-renderers.ts","../../src/svelte/components/RedactRendererRegistration.svelte","../../src/svelte/hooks/use-redaction.svelte.ts","../../src/svelte/components/highlight.svelte","../../src/svelte/components/marquee-redact.svelte","../../src/svelte/components/pending-redactions.svelte","../../src/svelte/components/selection-redact.svelte","../../src/svelte/index.ts","../../src/svelte/components/redaction-layer.svelte"],"sourcesContent":["<script lang=\"ts\">\n import type { AnnotationRendererProps } from '@embedpdf/plugin-annotation/svelte';\n import type { PdfRedactAnnoObject } from '@embedpdf/models';\n import {\n PdfStandardFont,\n PdfTextAlignment,\n standardFontCssProperties,\n textAlignmentToCss,\n } from '@embedpdf/models';\n\n let { annotation, isSelected, scale, onClick }: AnnotationRendererProps<PdfRedactAnnoObject> =\n $props();\n let isHovered = $state(false);\n\n const object = $derived(annotation.object);\n\n const segmentRects = $derived(object.segmentRects ?? []);\n const rect = $derived(object.rect);\n\n // C - Border/stroke color\n const strokeColor = $derived(object.strokeColor ?? '#FF0000');\n // IC - Interior color (background fill when redaction is applied)\n const color = $derived(object.color ?? '#000000');\n // CA - Opacity (0-1)\n const opacity = $derived(object.opacity ?? 1);\n // OC - Overlay text color (Adobe extension), fallback to fontColor\n const textColor = $derived(object.fontColor ?? object.overlayColor ?? '#FFFFFF');\n // Overlay text properties\n const overlayText = $derived(object.overlayText);\n const overlayTextRepeat = $derived(object.overlayTextRepeat ?? false);\n const fontSize = $derived(object.fontSize ?? 12);\n const fontFamily = $derived(object.fontFamily ?? PdfStandardFont.Helvetica);\n const fontCss = $derived(standardFontCssProperties(fontFamily));\n const textAlign = $derived(object.textAlign ?? PdfTextAlignment.Center);\n\n // Calculate how many times to repeat text (approximate)\n function renderOverlayText(): string | null {\n if (!overlayText) return null;\n if (!overlayTextRepeat) return overlayText;\n // Repeat text multiple times to fill the space\n const reps = 10;\n return Array(reps).fill(overlayText).join(' ');\n }\n\n const justifyContent = $derived(\n textAlign === PdfTextAlignment.Left\n ? 'flex-start'\n : textAlign === PdfTextAlignment.Right\n ? 'flex-end'\n : 'center',\n );\n</script>\n\n<div\n role=\"group\"\n onmouseenter={() => (isHovered = true)}\n onmouseleave={() => (isHovered = false)}\n style:position=\"absolute\"\n style:inset=\"0\"\n>\n {#each segmentRects as b, i (i)}\n {@const left = (rect ? b.origin.x - rect.origin.x : b.origin.x) * scale}\n {@const top = (rect ? b.origin.y - rect.origin.y : b.origin.y) * scale}\n {@const width = b.size.width * scale}\n {@const height = b.size.height * scale}\n {@const scaledFontSize = Math.min(fontSize * scale, height * 0.8)}\n <div\n role=\"button\"\n tabindex=\"0\"\n onpointerdown={onClick}\n style:position=\"absolute\"\n style:left=\"{left}px\"\n style:top=\"{top}px\"\n style:width=\"{width}px\"\n style:height=\"{height}px\"\n style:background={isHovered ? color : 'transparent'}\n style:border={!isHovered ? `2px solid ${strokeColor}` : 'none'}\n style:opacity={isHovered ? opacity : 1}\n style:box-sizing=\"border-box\"\n style:pointer-events=\"auto\"\n style:cursor=\"pointer\"\n style:display=\"flex\"\n style:align-items=\"center\"\n style:justify-content={justifyContent}\n style:overflow=\"hidden\"\n >\n {#if isHovered && overlayText}\n <span\n style:color={textColor}\n style:font-size=\"{scaledFontSize}px\"\n style:font-family={fontCss.fontFamily}\n style:font-weight={fontCss.fontWeight}\n style:font-style={fontCss.fontStyle}\n style:text-align={textAlignmentToCss(textAlign)}\n style:white-space={overlayTextRepeat ? 'normal' : 'nowrap'}\n style:overflow=\"hidden\"\n style:text-overflow=\"ellipsis\"\n style:line-height=\"1\"\n >\n {renderOverlayText()}\n </span>\n {/if}\n </div>\n {/each}\n</div>\n","<script lang=\"ts\">\n import type { AnnotationRendererProps } from '@embedpdf/plugin-annotation/svelte';\n import type { PdfRedactAnnoObject } from '@embedpdf/models';\n import {\n PdfStandardFont,\n PdfTextAlignment,\n standardFontCssProperties,\n textAlignmentToCss,\n } from '@embedpdf/models';\n\n let { annotation, isSelected, scale, onClick }: AnnotationRendererProps<PdfRedactAnnoObject> =\n $props();\n let isHovered = $state(false);\n\n const object = $derived(annotation.object);\n\n // C - Border/stroke color\n const strokeColor = $derived(object.strokeColor ?? '#FF0000');\n // IC - Interior color (background fill when redaction is applied)\n const color = $derived(object.color ?? '#000000');\n // CA - Opacity (0-1)\n const opacity = $derived(object.opacity ?? 1);\n // OC - Overlay text color (Adobe extension), fallback to fontColor\n const textColor = $derived(object.fontColor ?? object.overlayColor ?? '#FFFFFF');\n // Overlay text properties\n const overlayText = $derived(object.overlayText);\n const overlayTextRepeat = $derived(object.overlayTextRepeat ?? false);\n const fontSize = $derived(object.fontSize ?? 12);\n const fontFamily = $derived(object.fontFamily ?? PdfStandardFont.Helvetica);\n const fontCss = $derived(standardFontCssProperties(fontFamily));\n const textAlign = $derived(object.textAlign ?? PdfTextAlignment.Center);\n\n // Calculate how many times to repeat text (approximate)\n function renderOverlayText(): string | null {\n if (!overlayText) return null;\n if (!overlayTextRepeat) return overlayText;\n // Repeat text multiple times to fill the space\n const reps = 10;\n return Array(reps).fill(overlayText).join(' ');\n }\n\n const justifyContent = $derived(\n textAlign === PdfTextAlignment.Left\n ? 'flex-start'\n : textAlign === PdfTextAlignment.Right\n ? 'flex-end'\n : 'center',\n );\n</script>\n\n<div\n role=\"button\"\n tabindex=\"0\"\n onpointerdown={(e) => {\n if (!isSelected) onClick(e);\n }}\n onmouseenter={() => (isHovered = true)}\n onmouseleave={() => (isHovered = false)}\n style:position=\"absolute\"\n style:inset=\"0\"\n style:background={isHovered ? color : 'transparent'}\n style:border={!isHovered ? `2px solid ${strokeColor}` : 'none'}\n style:opacity={isHovered ? opacity : 1}\n style:box-sizing=\"border-box\"\n style:pointer-events=\"auto\"\n style:cursor={isSelected ? 'move' : 'pointer'}\n style:display=\"flex\"\n style:align-items=\"center\"\n style:justify-content={justifyContent}\n style:overflow=\"hidden\"\n>\n {#if isHovered && overlayText}\n <span\n style:color={textColor}\n style:font-size=\"{fontSize * scale}px\"\n style:font-family={fontCss.fontFamily}\n style:font-weight={fontCss.fontWeight}\n style:font-style={fontCss.fontStyle}\n style:text-align={textAlignmentToCss(textAlign)}\n style:white-space={overlayTextRepeat ? 'normal' : 'nowrap'}\n style:overflow=\"hidden\"\n style:text-overflow=\"ellipsis\"\n style:padding=\"4px\"\n >\n {renderOverlayText()}\n </span>\n {/if}\n</div>\n","import { createRenderer, type BoxedAnnotationRenderer } from '@embedpdf/plugin-annotation/svelte';\nimport { PdfAnnotationSubtype, type PdfRedactAnnoObject } from '@embedpdf/models';\nimport RedactHighlight from './annotations/RedactHighlight.svelte';\nimport RedactArea from './annotations/RedactArea.svelte';\n\n/**\n * Boxed annotation renderers for Redact annotations.\n * Type safety is enforced at definition time via createRenderer.\n * These are automatically registered with the annotation plugin via context.\n */\nexport const redactRenderers: BoxedAnnotationRenderer[] = [\n createRenderer<PdfRedactAnnoObject>({\n id: 'redactHighlight',\n matches: (a): a is PdfRedactAnnoObject =>\n a.type === PdfAnnotationSubtype.REDACT &&\n 'segmentRects' in a &&\n (a.segmentRects?.length ?? 0) > 0,\n component: RedactHighlight,\n interactionDefaults: { isDraggable: false, isResizable: false, isRotatable: false },\n useAppearanceStream: false,\n }),\n createRenderer<PdfRedactAnnoObject>({\n id: 'redactArea',\n matches: (a): a is PdfRedactAnnoObject =>\n a.type === PdfAnnotationSubtype.REDACT &&\n (!('segmentRects' in a) || !(a.segmentRects?.length ?? 0)),\n component: RedactArea,\n interactionDefaults: { isDraggable: false, isResizable: false, isRotatable: false },\n useAppearanceStream: false,\n }),\n];\n","<script lang=\"ts\">\n import { onMount } from 'svelte';\n import { getRendererRegistry } from '@embedpdf/plugin-annotation/svelte';\n import { redactRenderers } from './redact-renderers';\n import type { Snippet } from 'svelte';\n\n let { children }: { children?: Snippet } = $props();\n\n const registry = getRendererRegistry();\n\n onMount(() => {\n if (!registry) return;\n return registry.register(redactRenderers);\n });\n</script>\n\n{#if children}\n {@render children()}\n{/if}\n","import {\n RedactionPlugin,\n initialDocumentState,\n RedactionDocumentState,\n RedactionScope,\n} from '@embedpdf/plugin-redaction';\nimport { useCapability, usePlugin } from '@embedpdf/core/svelte';\n\nexport const useRedactionPlugin = () => usePlugin<RedactionPlugin>(RedactionPlugin.id);\nexport const useRedactionCapability = () => useCapability<RedactionPlugin>(RedactionPlugin.id);\n\n// Define the return type explicitly to maintain type safety\ninterface UseRedactionReturn {\n provides: RedactionScope | null;\n state: RedactionDocumentState;\n}\n\n/**\n * Hook for redaction state for a specific document\n * @param getDocumentId Document ID getter function\n */\nexport const useRedaction = (getDocumentId: () => string | null): UseRedactionReturn => {\n const capability = useRedactionCapability();\n\n let state = $state<RedactionDocumentState>(initialDocumentState);\n\n // Reactive documentId\n const documentId = $derived(getDocumentId());\n\n // Scoped capability for current docId\n const scopedProvides = $derived(\n capability.provides && documentId ? capability.provides.forDocument(documentId) : null,\n );\n\n $effect(() => {\n const provides = capability.provides;\n const docId = documentId;\n\n if (!provides || !docId) {\n state = initialDocumentState;\n return;\n }\n\n const scope = provides.forDocument(docId);\n\n // Get initial state\n try {\n state = scope.getState();\n } catch (e) {\n // Handle case where state might not be ready\n state = initialDocumentState;\n }\n\n // Subscribe to state changes for THIS docId\n return scope.onStateChange((newState) => {\n state = newState;\n });\n });\n\n return {\n get provides() {\n return scopedProvides;\n },\n get state() {\n return state;\n },\n };\n};\n","<script lang=\"ts\">\n import type { Rect } from '@embedpdf/models';\n\n interface HighlightProps {\n color?: string;\n opacity?: number;\n border?: string;\n rects: Rect[];\n rect?: Rect;\n scale: number;\n onClick?: (e: MouseEvent) => void;\n style?: string;\n }\n\n let {\n color = '#FFFF00',\n opacity = 1,\n border = '1px solid red',\n rects,\n rect,\n scale,\n onClick,\n style = '',\n }: HighlightProps = $props();\n\n // Rename rect to boundingRect for clarity\n const boundingRect = $derived(rect);\n</script>\n\n{#each rects as b, i (i)}\n <div\n onpointerdown={onClick}\n style:position=\"absolute\"\n style:border\n style:left={`${(boundingRect ? b.origin.x - boundingRect.origin.x : b.origin.x) * scale}px`}\n style:top={`${(boundingRect ? b.origin.y - boundingRect.origin.y : b.origin.y) * scale}px`}\n style:width={`${b.size.width * scale}px`}\n style:height={`${b.size.height * scale}px`}\n style:background={color}\n style:opacity\n style:pointer-events={onClick ? 'auto' : 'none'}\n style:cursor={onClick ? 'pointer' : 'default'}\n style:z-index={onClick ? '1' : undefined}\n {style}\n ></div>\n{/each}\n","<script lang=\"ts\">\n import { useDocumentState } from '@embedpdf/core/svelte';\n import type { Rect } from '@embedpdf/models';\n import { useRedactionPlugin } from '../hooks/use-redaction.svelte';\n\n interface MarqueeRedactProps {\n /** The ID of the document */\n documentId: string;\n /** Index of the page this layer lives on */\n pageIndex: number;\n /** Scale of the page */\n scale?: number;\n /** Optional CSS class applied to the marquee rectangle */\n className?: string;\n /** Stroke / fill colours (defaults below) */\n stroke?: string;\n fill?: string;\n }\n\n let {\n documentId,\n pageIndex,\n scale: scaleOverride,\n className = '',\n stroke,\n fill = 'transparent',\n }: MarqueeRedactProps = $props();\n\n const redactionPlugin = useRedactionPlugin();\n const documentState = useDocumentState(() => documentId);\n let rect = $state<Rect | null>(null);\n\n const actualScale = $derived(\n scaleOverride !== undefined ? scaleOverride : (documentState.current?.scale ?? 1),\n );\n\n // Get stroke color from plugin (annotation mode uses tool defaults, legacy uses red)\n // Allow prop override for backwards compatibility\n const strokeColor = $derived(stroke ?? redactionPlugin.plugin?.getPreviewStrokeColor() ?? 'red');\n\n $effect(() => {\n if (!redactionPlugin.plugin || !documentId) {\n rect = null;\n return;\n }\n\n return redactionPlugin.plugin.onRedactionMarqueeChange(documentId, (data) => {\n rect = data.pageIndex === pageIndex ? data.rect : null;\n });\n });\n</script>\n\n{#if rect}\n <div\n class={className}\n style:position=\"absolute\"\n style:pointer-events=\"none\"\n style:left={`${rect.origin.x * actualScale}px`}\n style:top={`${rect.origin.y * actualScale}px`}\n style:width={`${rect.size.width * actualScale}px`}\n style:height={`${rect.size.height * actualScale}px`}\n style:border={`1px solid ${strokeColor}`}\n style:background={fill}\n style:box-sizing=\"border-box\"\n ></div>\n{/if}\n","<script lang=\"ts\">\n import type { Snippet } from 'svelte';\n import type { Rect } from '@embedpdf/models';\n import { Rotation } from '@embedpdf/models';\n import { CounterRotate } from '@embedpdf/utils/svelte';\n import type { MenuWrapperProps, SelectionMenuPlacement } from '@embedpdf/utils/svelte';\n import type { RedactionItem } from '@embedpdf/plugin-redaction';\n import { useRedactionCapability } from '../hooks/use-redaction.svelte';\n import Highlight from './highlight.svelte';\n import type {\n RedactionSelectionContext,\n RedactionSelectionMenuRenderFn,\n RedactionSelectionMenuProps,\n } from '../types';\n\n interface Props {\n documentId: string;\n pageIndex: number;\n scale: number;\n rotation?: Rotation;\n bboxStroke?: string;\n selectionMenu?: RedactionSelectionMenuRenderFn;\n selectionMenuSnippet?: Snippet<[RedactionSelectionMenuProps]>;\n }\n\n let {\n documentId,\n pageIndex,\n scale,\n rotation = Rotation.Degree0,\n bboxStroke = 'rgba(0,0,0,0.8)',\n selectionMenu,\n selectionMenuSnippet,\n }: Props = $props();\n\n const redactionCapability = useRedactionCapability();\n\n let items = $state<RedactionItem[]>([]);\n let selectedId = $state<string | null>(null);\n\n $effect(() => {\n const redactionValue = redactionCapability.provides;\n if (!redactionValue) {\n items = [];\n selectedId = null;\n return;\n }\n\n const scoped = redactionValue.forDocument(documentId);\n const currentState = scoped.getState();\n // Only show legacy mode items (not annotation-based redactions)\n items = (currentState.pending[pageIndex] ?? []).filter((it) => it.source === 'legacy');\n selectedId = currentState.selected?.page === pageIndex ? currentState.selected.id : null;\n\n const off1 = scoped.onPendingChange((map) => {\n // Only show legacy mode items (not annotation-based redactions)\n items = (map[pageIndex] ?? []).filter((it) => it.source === 'legacy');\n });\n\n const off2 = scoped.onSelectedChange((sel) => {\n selectedId = sel?.page === pageIndex ? sel.id : null;\n });\n\n return () => {\n off1?.();\n off2?.();\n };\n });\n\n function select(e: MouseEvent, id: string) {\n e.stopPropagation();\n if (!redactionCapability.provides) return;\n redactionCapability.provides.forDocument(documentId).selectPending(pageIndex, id);\n }\n\n function shouldShowMenu(itemId: string): boolean {\n const isSelected = selectedId === itemId;\n return isSelected && (!!selectionMenu || !!selectionMenuSnippet);\n }\n\n function buildContext(item: RedactionItem): RedactionSelectionContext {\n return { type: 'redaction', item, pageIndex };\n }\n\n const menuPlacement: SelectionMenuPlacement = {\n suggestTop: false,\n spaceAbove: 0,\n spaceBelow: 0,\n };\n\n function buildMenuProps(\n item: RedactionItem,\n rect: Rect,\n menuWrapperProps: MenuWrapperProps,\n ): RedactionSelectionMenuProps {\n return {\n context: buildContext(item),\n selected: selectedId === item.id,\n rect,\n placement: menuPlacement,\n menuWrapperProps,\n };\n }\n</script>\n\n{#if items.length}\n <div style=\"position: absolute; inset: 0; pointer-events: none;\">\n {#each items as item (item.id)}\n {#if item.kind === 'area'}\n <div\n style=\"\n position: absolute;\n left: {item.rect.origin.x * scale}px;\n top: {item.rect.origin.y * scale}px;\n width: {item.rect.size.width * scale}px;\n height: {item.rect.size.height * scale}px;\n background: transparent;\n outline: {selectedId === item.id ? `1px solid ${bboxStroke}` : 'none'};\n outline-offset: 2px;\n border: 1px solid red;\n pointer-events: auto;\n cursor: pointer;\n \"\n onpointerdown={(e) => select(e, item.id)}\n ></div>\n\n {#if shouldShowMenu(item.id)}\n <CounterRotate\n rect={{\n origin: { x: item.rect.origin.x * scale, y: item.rect.origin.y * scale },\n size: { width: item.rect.size.width * scale, height: item.rect.size.height * scale },\n }}\n {rotation}\n >\n {#snippet children({ rect, menuWrapperProps })}\n {@const menuProps = buildMenuProps(item, rect, menuWrapperProps)}\n {#if selectionMenu}\n {@const result = selectionMenu(menuProps)}\n {#if result}\n <result.component {...result.props} />\n {/if}\n {:else if selectionMenuSnippet}\n {@render selectionMenuSnippet(menuProps)}\n {/if}\n {/snippet}\n </CounterRotate>\n {/if}\n {:else}\n <div\n style=\"\n position: absolute;\n left: {item.rect.origin.x * scale}px;\n top: {item.rect.origin.y * scale}px;\n width: {item.rect.size.width * scale}px;\n height: {item.rect.size.height * scale}px;\n background: transparent;\n outline: {selectedId === item.id ? `1px solid ${bboxStroke}` : 'none'};\n outline-offset: 2px;\n pointer-events: auto;\n cursor: {selectedId === item.id ? 'pointer' : 'default'};\n \"\n >\n <Highlight\n rect={item.rect}\n rects={item.rects}\n color=\"transparent\"\n border=\"1px solid red\"\n {scale}\n onClick={(e) => select(e, item.id)}\n />\n </div>\n\n {#if shouldShowMenu(item.id)}\n <CounterRotate\n rect={{\n origin: { x: item.rect.origin.x * scale, y: item.rect.origin.y * scale },\n size: { width: item.rect.size.width * scale, height: item.rect.size.height * scale },\n }}\n {rotation}\n >\n {#snippet children({ rect, menuWrapperProps })}\n {@const menuProps = buildMenuProps(item, rect, menuWrapperProps)}\n {#if selectionMenu}\n {@const result = selectionMenu(menuProps)}\n {#if result}\n <result.component {...result.props} />\n {/if}\n {:else if selectionMenuSnippet}\n {@render selectionMenuSnippet(menuProps)}\n {/if}\n {/snippet}\n </CounterRotate>\n {/if}\n {/if}\n {/each}\n </div>\n{/if}\n","<script lang=\"ts\">\n import type { Rect } from '@embedpdf/models';\n import { useRedactionPlugin } from '../hooks/use-redaction.svelte';\n import Highlight from './highlight.svelte';\n\n interface SelectionRedactProps {\n documentId: string;\n pageIndex: number;\n scale: number;\n }\n\n let { documentId, pageIndex, scale }: SelectionRedactProps = $props();\n\n const redactionPlugin = useRedactionPlugin();\n let rects = $state<Rect[]>([]);\n let boundingRect = $state<Rect | null>(null);\n\n // Get stroke color from plugin (annotation mode uses tool defaults, legacy uses red)\n const strokeColor = $derived(redactionPlugin.plugin?.getPreviewStrokeColor() ?? 'red');\n\n $effect(() => {\n if (!redactionPlugin.plugin) {\n rects = [];\n boundingRect = null;\n return;\n }\n\n return redactionPlugin.plugin.onRedactionSelectionChange(documentId, (formattedSelection) => {\n const selection = formattedSelection.find((s) => s.pageIndex === pageIndex);\n rects = selection?.segmentRects ?? [];\n boundingRect = selection?.rect ?? null;\n });\n });\n</script>\n\n{#if boundingRect}\n <div\n style:mix-blend-mode=\"normal\"\n style:pointer-events=\"none\"\n style:position=\"absolute\"\n style:inset=\"0\"\n >\n <Highlight\n color=\"transparent\"\n opacity={1}\n {rects}\n {scale}\n border={`1px solid ${strokeColor}`}\n />\n </div>\n{/if}\n","import { createPluginPackage } from '@embedpdf/core';\nimport { RedactionPluginPackage as BaseRedactionPackage } from '@embedpdf/plugin-redaction';\nimport RedactRendererRegistration from './components/RedactRendererRegistration.svelte';\n\nexport * from './hooks';\nexport * from './components';\nexport * from './types';\nexport * from '@embedpdf/plugin-redaction';\n\nexport const RedactionPluginPackage = createPluginPackage(BaseRedactionPackage)\n .addUtility(RedactRendererRegistration)\n .build();\n","<script lang=\"ts\">\n import type { Snippet } from 'svelte';\n import { useDocumentState } from '@embedpdf/core/svelte';\n import { Rotation } from '@embedpdf/models';\n import PendingRedactions from './pending-redactions.svelte';\n import MarqueeRedact from './marquee-redact.svelte';\n import SelectionRedact from './selection-redact.svelte';\n import type { RedactionSelectionMenuRenderFn, RedactionSelectionMenuProps } from '../types';\n\n interface RedactionLayerProps {\n /** The ID of the document this layer belongs to */\n documentId: string;\n /** Index of the page this layer lives on */\n pageIndex: number;\n /** Current render scale for this page */\n scale?: number;\n /** Page rotation (for counter-rotating menus, etc.) */\n rotation?: Rotation;\n /** Render function for selection menu (schema-driven approach) */\n selectionMenu?: RedactionSelectionMenuRenderFn;\n /** Snippet for custom selection menu (slot-based approach) */\n selectionMenuSnippet?: Snippet<[RedactionSelectionMenuProps]>;\n }\n\n let {\n documentId,\n pageIndex,\n scale,\n rotation,\n selectionMenu,\n selectionMenuSnippet,\n }: RedactionLayerProps = $props();\n\n const documentState = useDocumentState(() => documentId);\n const page = $derived(documentState.current?.document?.pages?.[pageIndex]);\n\n const actualScale = $derived(scale !== undefined ? scale : (documentState.current?.scale ?? 1));\n\n const actualRotation = $derived.by(() => {\n if (rotation !== undefined) return rotation;\n // Combine page intrinsic rotation with document rotation\n const pageRotation = page?.rotation ?? 0;\n const docRotation = documentState.current?.rotation ?? 0;\n return ((pageRotation + docRotation) % 4) as Rotation;\n });\n</script>\n\n<PendingRedactions\n {documentId}\n {pageIndex}\n scale={actualScale}\n rotation={actualRotation}\n {selectionMenu}\n {selectionMenuSnippet}\n/>\n<MarqueeRedact {documentId} {pageIndex} scale={actualScale} />\n<SelectionRedact {documentId} {pageIndex} scale={actualScale} />\n"],"names":["isHovered","$","state","object","segmentRects","derived","get","rect","strokeColor","color","opacity","textColor","fontColor","overlayColor","overlayText","overlayTextRepeat","fontSize","fontFamily","PdfStandardFont","Helvetica","fontCss","standardFontCssProperties","textAlign","PdfTextAlignment","Center","renderOverlayText","Array","fill","join","justifyContent","Left","Right","div","root","position","inset","index","$$anchor","b","left","origin","x","$$props","scale","top","y","width","size","height","scaledFontSize","Math","min","div_1","root_1","__pointerdown","$$args","span","root_2","styles_1","$0","fontWeight","fontStyle","textAlignmentToCss","$$render","consequent","styles","set","e","cursor","isSelected","redactRenderers","createRenderer","id","matches","a","type","PdfAnnotationSubtype","REDACT","_a","length","component","RedactHighlight","interactionDefaults","isDraggable","isResizable","isRotatable","useAppearanceStream","RedactArea","registry","getRendererRegistry","onMount","register","useRedactionPlugin","usePlugin","RedactionPlugin","useRedactionCapability","useCapability","border","style","boundingRect","template_effect","set_style","onClick","className","redactionPlugin","documentState","useDocumentState","documentId","actualScale","current","plugin","getPreviewStrokeColor","user_effect","onRedactionMarqueeChange","data","pageIndex","set_class","rotation","prop","Rotation","Degree0","bboxStroke","redactionCapability","items","proxy","selectedId","select","stopPropagation","provides","forDocument","selectPending","shouldShowMenu","itemId","selectionMenu","selectionMenuSnippet","buildContext","item","redactionValue","scoped","currentState","getState","pending","filter","it","source","selected","page","off1","onPendingChange","map","off2","onSelectedChange","sel","menuPlacement","suggestTop","spaceAbove","spaceBelow","buildMenuProps","menuWrapperProps","context","placement","first_child","fragment_2","children","$$arg0","menuProps","result","result_component","spread_props","props","CounterRotate","consequent_3","div_2","fragment_9","Highlight","rects","result_component_1","consequent_5","consequent_8","kind","consequent_4","alternate_2","consequent_9","onRedactionSelectionChange","formattedSelection","selection","find","s","node_1","RedactionPluginPackage","createPluginPackage","BaseRedactionPackage","addUtility","RedactRendererRegistration","build","_c","_b","document","pages","actualRotation","PendingRedactions","node","MarqueeRedact","SelectionRedact","getDocumentId","capability","initialDocumentState","scopedProvides","docId","scope","onStateChange","newState"],"mappings":"21BAYMA,EAAYC,EAAAC,OAAO,GAEjB,MAAAC,6BAA6BA,QAE7BC,EAAYH,EAAAI,QAAA,IAAAJ,EAAAK,IAAYH,GAAOC,cAAY,IAC3CG,EAAIN,EAAAI,QAAA,IAAAJ,EAAAK,IAAYH,GAAOI,MAGvBC,EAAWP,EAAAI,QAAA,IAAAJ,EAAAK,IAAYH,GAAOK,aAAe,WAE7CC,EAAKR,EAAAI,QAAA,IAAAJ,EAAAK,IAAYH,GAAOM,OAAS,WAEjCC,EAAOT,EAAAI,QAAA,IAAAJ,EAAAK,IAAYH,GAAOO,SAAW,GAErCC,EAASV,EAAAI,QAAA,IAAAJ,EAAAK,IAAYH,GAAOS,iBAAaT,GAAOU,cAAgB,WAEhEC,EAAWb,EAAAI,QAAA,IAAAJ,EAAAK,IAAYH,GAAOW,aAC9BC,EAAiBd,EAAAI,QAAA,IAAAJ,EAAAK,IAAYH,GAAOY,oBAAqB,GACzDC,EAAQf,EAAAI,QAAA,IAAAJ,EAAAK,IAAYH,GAAOa,UAAY,IACvCC,sBAAsBd,GAAOc,YAAcC,EAAAA,gBAAgBC,WAC3DC,EAAOnB,EAAAI,QAAA,IAAYgB,EAAAA,0BAAyBpB,EAAAK,IAACW,KAC7CK,sBAAqBnB,GAAOmB,WAAaC,EAAAA,iBAAiBC,QAGvD,SAAAC,IACF,IAAAxB,EAAAK,IAAAQ,UAAoB,KACpB,IAAAb,EAAAK,IAAAS,gBAA0BD,UAGxBY,MADM,IACMC,WAAKb,IAAac,KAAK,IAC5C,CAEM,MAAAC,EAAc5B,EAAAI,QAAA,IAAAJ,EAAAK,IAClBgB,KAAcC,mBAAiBO,KAC3B,aACA7B,EAAAK,IAAAgB,KAAcC,EAAAA,iBAAiBQ,MAC7B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
- div_1.__touchstart = function(...$$args) {
51
- var _a;
52
- (_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
53
- };
54
50
  let styles;
55
51
  var node = $.child(div_1);
56
52
  {
@@ -112,7 +108,7 @@ function RedactHighlight($$anchor, $$props) {
112
108
  $.append($$anchor, div);
113
109
  $.pop();
114
110
  }
115
- $.delegate(["pointerdown", "touchstart"]);
111
+ $.delegate(["pointerdown"]);
116
112
  var root_1$4 = $.from_html(`<span> </span>`);
117
113
  var root$1 = $.from_html(`<div role="button" tabindex="0"><!></div>`);
118
114
  function RedactArea($$anchor, $$props) {
@@ -140,9 +136,6 @@ function RedactArea($$anchor, $$props) {
140
136
  div.__pointerdown = (e) => {
141
137
  if (!$$props.isSelected) $$props.onClick(e);
142
138
  };
143
- div.__touchstart = (e) => {
144
- if (!$$props.isSelected) $$props.onClick(e);
145
- };
146
139
  let styles;
147
140
  var node = $.child(div);
148
141
  {
@@ -198,7 +191,7 @@ function RedactArea($$anchor, $$props) {
198
191
  $.append($$anchor, div);
199
192
  $.pop();
200
193
  }
201
- $.delegate(["pointerdown", "touchstart"]);
194
+ $.delegate(["pointerdown"]);
202
195
  const redactRenderers = [
203
196
  createRenderer({
204
197
  id: "redactHighlight",
@@ -289,10 +282,6 @@ function Highlight($$anchor, $$props) {
289
282
  var _a;
290
283
  (_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
291
284
  };
292
- div.__touchstart = function(...$$args) {
293
- var _a;
294
- (_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
295
- };
296
285
  let styles;
297
286
  $.template_effect(() => styles = $.set_style(div, style(), styles, {
298
287
  position: "absolute",
@@ -311,7 +300,7 @@ function Highlight($$anchor, $$props) {
311
300
  });
312
301
  $.append($$anchor, fragment);
313
302
  }
314
- $.delegate(["pointerdown", "touchstart"]);
303
+ $.delegate(["pointerdown"]);
315
304
  var root_1$2 = $.from_html(`<div></div>`);
316
305
  function Marquee_redact($$anchor, $$props) {
317
306
  $.push($$props, true);
@@ -432,7 +421,6 @@ function Pending_redactions($$anchor, $$props) {
432
421
  var fragment_2 = root_3();
433
422
  var div_1 = $.first_child(fragment_2);
434
423
  div_1.__pointerdown = (e) => select(e, $.get(item).id);
435
- div_1.__touchstart = (e) => select(e, $.get(item).id);
436
424
  var node_2 = $.sibling(div_1, 2);
437
425
  {
438
426
  var consequent_3 = ($$anchor5) => {
@@ -664,7 +652,7 @@ function Pending_redactions($$anchor, $$props) {
664
652
  $.append($$anchor, fragment);
665
653
  $.pop();
666
654
  }
667
- $.delegate(["pointerdown", "touchstart"]);
655
+ $.delegate(["pointerdown"]);
668
656
  var root_1 = $.from_html(`<div><!></div>`);
669
657
  function Selection_redact($$anchor, $$props) {
670
658
  $.push($$props, true);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/svelte/components/annotations/RedactHighlight.svelte","../../src/svelte/components/annotations/RedactArea.svelte","../../src/svelte/components/redact-renderers.ts","../../src/svelte/components/RedactRendererRegistration.svelte","../../src/svelte/hooks/use-redaction.svelte.ts","../../src/svelte/components/highlight.svelte","../../src/svelte/components/marquee-redact.svelte","../../src/svelte/components/pending-redactions.svelte","../../src/svelte/components/selection-redact.svelte","../../src/svelte/components/redaction-layer.svelte","../../src/svelte/index.ts"],"sourcesContent":["<script lang=\"ts\">\n import type { AnnotationRendererProps } from '@embedpdf/plugin-annotation/svelte';\n import type { PdfRedactAnnoObject } from '@embedpdf/models';\n import {\n PdfStandardFont,\n PdfTextAlignment,\n standardFontCssProperties,\n textAlignmentToCss,\n } from '@embedpdf/models';\n\n let { annotation, isSelected, scale, onClick }: AnnotationRendererProps<PdfRedactAnnoObject> =\n $props();\n let isHovered = $state(false);\n\n const object = $derived(annotation.object);\n\n const segmentRects = $derived(object.segmentRects ?? []);\n const rect = $derived(object.rect);\n\n // C - Border/stroke color\n const strokeColor = $derived(object.strokeColor ?? '#FF0000');\n // IC - Interior color (background fill when redaction is applied)\n const color = $derived(object.color ?? '#000000');\n // CA - Opacity (0-1)\n const opacity = $derived(object.opacity ?? 1);\n // OC - Overlay text color (Adobe extension), fallback to fontColor\n const textColor = $derived(object.fontColor ?? object.overlayColor ?? '#FFFFFF');\n // Overlay text properties\n const overlayText = $derived(object.overlayText);\n const overlayTextRepeat = $derived(object.overlayTextRepeat ?? false);\n const fontSize = $derived(object.fontSize ?? 12);\n const fontFamily = $derived(object.fontFamily ?? PdfStandardFont.Helvetica);\n const fontCss = $derived(standardFontCssProperties(fontFamily));\n const textAlign = $derived(object.textAlign ?? PdfTextAlignment.Center);\n\n // Calculate how many times to repeat text (approximate)\n function renderOverlayText(): string | null {\n if (!overlayText) return null;\n if (!overlayTextRepeat) return overlayText;\n // Repeat text multiple times to fill the space\n const reps = 10;\n return Array(reps).fill(overlayText).join(' ');\n }\n\n const justifyContent = $derived(\n textAlign === PdfTextAlignment.Left\n ? 'flex-start'\n : textAlign === PdfTextAlignment.Right\n ? 'flex-end'\n : 'center',\n );\n</script>\n\n<div\n role=\"group\"\n onmouseenter={() => (isHovered = true)}\n onmouseleave={() => (isHovered = false)}\n style:position=\"absolute\"\n style:inset=\"0\"\n>\n {#each segmentRects as b, i (i)}\n {@const left = (rect ? b.origin.x - rect.origin.x : b.origin.x) * scale}\n {@const top = (rect ? b.origin.y - rect.origin.y : b.origin.y) * scale}\n {@const width = b.size.width * scale}\n {@const height = b.size.height * scale}\n {@const scaledFontSize = Math.min(fontSize * scale, height * 0.8)}\n <div\n role=\"button\"\n tabindex=\"0\"\n onpointerdown={onClick}\n ontouchstart={onClick}\n style:position=\"absolute\"\n style:left=\"{left}px\"\n style:top=\"{top}px\"\n style:width=\"{width}px\"\n style:height=\"{height}px\"\n style:background={isHovered ? color : 'transparent'}\n style:border={!isHovered ? `2px solid ${strokeColor}` : 'none'}\n style:opacity={isHovered ? opacity : 1}\n style:box-sizing=\"border-box\"\n style:pointer-events=\"auto\"\n style:cursor=\"pointer\"\n style:display=\"flex\"\n style:align-items=\"center\"\n style:justify-content={justifyContent}\n style:overflow=\"hidden\"\n >\n {#if isHovered && overlayText}\n <span\n style:color={textColor}\n style:font-size=\"{scaledFontSize}px\"\n style:font-family={fontCss.fontFamily}\n style:font-weight={fontCss.fontWeight}\n style:font-style={fontCss.fontStyle}\n style:text-align={textAlignmentToCss(textAlign)}\n style:white-space={overlayTextRepeat ? 'normal' : 'nowrap'}\n style:overflow=\"hidden\"\n style:text-overflow=\"ellipsis\"\n style:line-height=\"1\"\n >\n {renderOverlayText()}\n </span>\n {/if}\n </div>\n {/each}\n</div>\n","<script lang=\"ts\">\n import type { AnnotationRendererProps } from '@embedpdf/plugin-annotation/svelte';\n import type { PdfRedactAnnoObject } from '@embedpdf/models';\n import {\n PdfStandardFont,\n PdfTextAlignment,\n standardFontCssProperties,\n textAlignmentToCss,\n } from '@embedpdf/models';\n\n let { annotation, isSelected, scale, onClick }: AnnotationRendererProps<PdfRedactAnnoObject> =\n $props();\n let isHovered = $state(false);\n\n const object = $derived(annotation.object);\n\n // C - Border/stroke color\n const strokeColor = $derived(object.strokeColor ?? '#FF0000');\n // IC - Interior color (background fill when redaction is applied)\n const color = $derived(object.color ?? '#000000');\n // CA - Opacity (0-1)\n const opacity = $derived(object.opacity ?? 1);\n // OC - Overlay text color (Adobe extension), fallback to fontColor\n const textColor = $derived(object.fontColor ?? object.overlayColor ?? '#FFFFFF');\n // Overlay text properties\n const overlayText = $derived(object.overlayText);\n const overlayTextRepeat = $derived(object.overlayTextRepeat ?? false);\n const fontSize = $derived(object.fontSize ?? 12);\n const fontFamily = $derived(object.fontFamily ?? PdfStandardFont.Helvetica);\n const fontCss = $derived(standardFontCssProperties(fontFamily));\n const textAlign = $derived(object.textAlign ?? PdfTextAlignment.Center);\n\n // Calculate how many times to repeat text (approximate)\n function renderOverlayText(): string | null {\n if (!overlayText) return null;\n if (!overlayTextRepeat) return overlayText;\n // Repeat text multiple times to fill the space\n const reps = 10;\n return Array(reps).fill(overlayText).join(' ');\n }\n\n const justifyContent = $derived(\n textAlign === PdfTextAlignment.Left\n ? 'flex-start'\n : textAlign === PdfTextAlignment.Right\n ? 'flex-end'\n : 'center',\n );\n</script>\n\n<div\n role=\"button\"\n tabindex=\"0\"\n onpointerdown={(e) => {\n if (!isSelected) onClick(e);\n }}\n ontouchstart={(e) => {\n if (!isSelected) onClick(e);\n }}\n onmouseenter={() => (isHovered = true)}\n onmouseleave={() => (isHovered = false)}\n style:position=\"absolute\"\n style:inset=\"0\"\n style:background={isHovered ? color : 'transparent'}\n style:border={!isHovered ? `2px solid ${strokeColor}` : 'none'}\n style:opacity={isHovered ? opacity : 1}\n style:box-sizing=\"border-box\"\n style:pointer-events=\"auto\"\n style:cursor={isSelected ? 'move' : 'pointer'}\n style:display=\"flex\"\n style:align-items=\"center\"\n style:justify-content={justifyContent}\n style:overflow=\"hidden\"\n>\n {#if isHovered && overlayText}\n <span\n style:color={textColor}\n style:font-size=\"{fontSize * scale}px\"\n style:font-family={fontCss.fontFamily}\n style:font-weight={fontCss.fontWeight}\n style:font-style={fontCss.fontStyle}\n style:text-align={textAlignmentToCss(textAlign)}\n style:white-space={overlayTextRepeat ? 'normal' : 'nowrap'}\n style:overflow=\"hidden\"\n style:text-overflow=\"ellipsis\"\n style:padding=\"4px\"\n >\n {renderOverlayText()}\n </span>\n {/if}\n</div>\n","import { createRenderer, type BoxedAnnotationRenderer } from '@embedpdf/plugin-annotation/svelte';\nimport { PdfAnnotationSubtype, type PdfRedactAnnoObject } from '@embedpdf/models';\nimport RedactHighlight from './annotations/RedactHighlight.svelte';\nimport RedactArea from './annotations/RedactArea.svelte';\n\n/**\n * Boxed annotation renderers for Redact annotations.\n * Type safety is enforced at definition time via createRenderer.\n * These are automatically registered with the annotation plugin via context.\n */\nexport const redactRenderers: BoxedAnnotationRenderer[] = [\n createRenderer<PdfRedactAnnoObject>({\n id: 'redactHighlight',\n matches: (a): a is PdfRedactAnnoObject =>\n a.type === PdfAnnotationSubtype.REDACT &&\n 'segmentRects' in a &&\n (a.segmentRects?.length ?? 0) > 0,\n component: RedactHighlight,\n interactionDefaults: { isDraggable: false, isResizable: false, isRotatable: false },\n useAppearanceStream: false,\n }),\n createRenderer<PdfRedactAnnoObject>({\n id: 'redactArea',\n matches: (a): a is PdfRedactAnnoObject =>\n a.type === PdfAnnotationSubtype.REDACT &&\n (!('segmentRects' in a) || !(a.segmentRects?.length ?? 0)),\n component: RedactArea,\n interactionDefaults: { isDraggable: false, isResizable: false, isRotatable: false },\n useAppearanceStream: false,\n }),\n];\n","<script lang=\"ts\">\n import { onMount } from 'svelte';\n import { getRendererRegistry } from '@embedpdf/plugin-annotation/svelte';\n import { redactRenderers } from './redact-renderers';\n import type { Snippet } from 'svelte';\n\n let { children }: { children?: Snippet } = $props();\n\n const registry = getRendererRegistry();\n\n onMount(() => {\n if (!registry) return;\n return registry.register(redactRenderers);\n });\n</script>\n\n{#if children}\n {@render children()}\n{/if}\n","import {\n RedactionPlugin,\n initialDocumentState,\n RedactionDocumentState,\n RedactionScope,\n} from '@embedpdf/plugin-redaction';\nimport { useCapability, usePlugin } from '@embedpdf/core/svelte';\n\nexport const useRedactionPlugin = () => usePlugin<RedactionPlugin>(RedactionPlugin.id);\nexport const useRedactionCapability = () => useCapability<RedactionPlugin>(RedactionPlugin.id);\n\n// Define the return type explicitly to maintain type safety\ninterface UseRedactionReturn {\n provides: RedactionScope | null;\n state: RedactionDocumentState;\n}\n\n/**\n * Hook for redaction state for a specific document\n * @param getDocumentId Document ID getter function\n */\nexport const useRedaction = (getDocumentId: () => string | null): UseRedactionReturn => {\n const capability = useRedactionCapability();\n\n let state = $state<RedactionDocumentState>(initialDocumentState);\n\n // Reactive documentId\n const documentId = $derived(getDocumentId());\n\n // Scoped capability for current docId\n const scopedProvides = $derived(\n capability.provides && documentId ? capability.provides.forDocument(documentId) : null,\n );\n\n $effect(() => {\n const provides = capability.provides;\n const docId = documentId;\n\n if (!provides || !docId) {\n state = initialDocumentState;\n return;\n }\n\n const scope = provides.forDocument(docId);\n\n // Get initial state\n try {\n state = scope.getState();\n } catch (e) {\n // Handle case where state might not be ready\n state = initialDocumentState;\n }\n\n // Subscribe to state changes for THIS docId\n return scope.onStateChange((newState) => {\n state = newState;\n });\n });\n\n return {\n get provides() {\n return scopedProvides;\n },\n get state() {\n return state;\n },\n };\n};\n","<script lang=\"ts\">\n import type { Rect } from '@embedpdf/models';\n\n interface HighlightProps {\n color?: string;\n opacity?: number;\n border?: string;\n rects: Rect[];\n rect?: Rect;\n scale: number;\n onClick?: (e: MouseEvent | TouchEvent) => void;\n style?: string;\n }\n\n let {\n color = '#FFFF00',\n opacity = 1,\n border = '1px solid red',\n rects,\n rect,\n scale,\n onClick,\n style = '',\n }: HighlightProps = $props();\n\n // Rename rect to boundingRect for clarity\n const boundingRect = $derived(rect);\n</script>\n\n{#each rects as b, i (i)}\n <div\n onpointerdown={onClick}\n ontouchstart={onClick}\n style:position=\"absolute\"\n style:border\n style:left={`${(boundingRect ? b.origin.x - boundingRect.origin.x : b.origin.x) * scale}px`}\n style:top={`${(boundingRect ? b.origin.y - boundingRect.origin.y : b.origin.y) * scale}px`}\n style:width={`${b.size.width * scale}px`}\n style:height={`${b.size.height * scale}px`}\n style:background={color}\n style:opacity\n style:pointer-events={onClick ? 'auto' : 'none'}\n style:cursor={onClick ? 'pointer' : 'default'}\n style:z-index={onClick ? '1' : undefined}\n {style}\n ></div>\n{/each}\n","<script lang=\"ts\">\n import { useDocumentState } from '@embedpdf/core/svelte';\n import type { Rect } from '@embedpdf/models';\n import { useRedactionPlugin } from '../hooks/use-redaction.svelte';\n\n interface MarqueeRedactProps {\n /** The ID of the document */\n documentId: string;\n /** Index of the page this layer lives on */\n pageIndex: number;\n /** Scale of the page */\n scale?: number;\n /** Optional CSS class applied to the marquee rectangle */\n className?: string;\n /** Stroke / fill colours (defaults below) */\n stroke?: string;\n fill?: string;\n }\n\n let {\n documentId,\n pageIndex,\n scale: scaleOverride,\n className = '',\n stroke,\n fill = 'transparent',\n }: MarqueeRedactProps = $props();\n\n const redactionPlugin = useRedactionPlugin();\n const documentState = useDocumentState(() => documentId);\n let rect = $state<Rect | null>(null);\n\n const actualScale = $derived(\n scaleOverride !== undefined ? scaleOverride : (documentState.current?.scale ?? 1),\n );\n\n // Get stroke color from plugin (annotation mode uses tool defaults, legacy uses red)\n // Allow prop override for backwards compatibility\n const strokeColor = $derived(stroke ?? redactionPlugin.plugin?.getPreviewStrokeColor() ?? 'red');\n\n $effect(() => {\n if (!redactionPlugin.plugin || !documentId) {\n rect = null;\n return;\n }\n\n return redactionPlugin.plugin.onRedactionMarqueeChange(documentId, (data) => {\n rect = data.pageIndex === pageIndex ? data.rect : null;\n });\n });\n</script>\n\n{#if rect}\n <div\n class={className}\n style:position=\"absolute\"\n style:pointer-events=\"none\"\n style:left={`${rect.origin.x * actualScale}px`}\n style:top={`${rect.origin.y * actualScale}px`}\n style:width={`${rect.size.width * actualScale}px`}\n style:height={`${rect.size.height * actualScale}px`}\n style:border={`1px solid ${strokeColor}`}\n style:background={fill}\n style:box-sizing=\"border-box\"\n ></div>\n{/if}\n","<script lang=\"ts\">\n import type { Snippet } from 'svelte';\n import type { Rect } from '@embedpdf/models';\n import { Rotation } from '@embedpdf/models';\n import { CounterRotate } from '@embedpdf/utils/svelte';\n import type { MenuWrapperProps, SelectionMenuPlacement } from '@embedpdf/utils/svelte';\n import type { RedactionItem } from '@embedpdf/plugin-redaction';\n import { useRedactionCapability } from '../hooks/use-redaction.svelte';\n import Highlight from './highlight.svelte';\n import type {\n RedactionSelectionContext,\n RedactionSelectionMenuRenderFn,\n RedactionSelectionMenuProps,\n } from '../types';\n\n interface Props {\n documentId: string;\n pageIndex: number;\n scale: number;\n rotation?: Rotation;\n bboxStroke?: string;\n selectionMenu?: RedactionSelectionMenuRenderFn;\n selectionMenuSnippet?: Snippet<[RedactionSelectionMenuProps]>;\n }\n\n let {\n documentId,\n pageIndex,\n scale,\n rotation = Rotation.Degree0,\n bboxStroke = 'rgba(0,0,0,0.8)',\n selectionMenu,\n selectionMenuSnippet,\n }: Props = $props();\n\n const redactionCapability = useRedactionCapability();\n\n let items = $state<RedactionItem[]>([]);\n let selectedId = $state<string | null>(null);\n\n $effect(() => {\n const redactionValue = redactionCapability.provides;\n if (!redactionValue) {\n items = [];\n selectedId = null;\n return;\n }\n\n const scoped = redactionValue.forDocument(documentId);\n const currentState = scoped.getState();\n // Only show legacy mode items (not annotation-based redactions)\n items = (currentState.pending[pageIndex] ?? []).filter((it) => it.source === 'legacy');\n selectedId = currentState.selected?.page === pageIndex ? currentState.selected.id : null;\n\n const off1 = scoped.onPendingChange((map) => {\n // Only show legacy mode items (not annotation-based redactions)\n items = (map[pageIndex] ?? []).filter((it) => it.source === 'legacy');\n });\n\n const off2 = scoped.onSelectedChange((sel) => {\n selectedId = sel?.page === pageIndex ? sel.id : null;\n });\n\n return () => {\n off1?.();\n off2?.();\n };\n });\n\n function select(e: MouseEvent | TouchEvent, id: string) {\n e.stopPropagation();\n if (!redactionCapability.provides) return;\n redactionCapability.provides.forDocument(documentId).selectPending(pageIndex, id);\n }\n\n function shouldShowMenu(itemId: string): boolean {\n const isSelected = selectedId === itemId;\n return isSelected && (!!selectionMenu || !!selectionMenuSnippet);\n }\n\n function buildContext(item: RedactionItem): RedactionSelectionContext {\n return { type: 'redaction', item, pageIndex };\n }\n\n const menuPlacement: SelectionMenuPlacement = {\n suggestTop: false,\n spaceAbove: 0,\n spaceBelow: 0,\n };\n\n function buildMenuProps(\n item: RedactionItem,\n rect: Rect,\n menuWrapperProps: MenuWrapperProps,\n ): RedactionSelectionMenuProps {\n return {\n context: buildContext(item),\n selected: selectedId === item.id,\n rect,\n placement: menuPlacement,\n menuWrapperProps,\n };\n }\n</script>\n\n{#if items.length}\n <div style=\"position: absolute; inset: 0; pointer-events: none;\">\n {#each items as item (item.id)}\n {#if item.kind === 'area'}\n <div\n style=\"\n position: absolute;\n left: {item.rect.origin.x * scale}px;\n top: {item.rect.origin.y * scale}px;\n width: {item.rect.size.width * scale}px;\n height: {item.rect.size.height * scale}px;\n background: transparent;\n outline: {selectedId === item.id ? `1px solid ${bboxStroke}` : 'none'};\n outline-offset: 2px;\n border: 1px solid red;\n pointer-events: auto;\n cursor: pointer;\n \"\n onpointerdown={(e) => select(e, item.id)}\n ontouchstart={(e) => select(e, item.id)}\n ></div>\n\n {#if shouldShowMenu(item.id)}\n <CounterRotate\n rect={{\n origin: { x: item.rect.origin.x * scale, y: item.rect.origin.y * scale },\n size: { width: item.rect.size.width * scale, height: item.rect.size.height * scale },\n }}\n {rotation}\n >\n {#snippet children({ rect, menuWrapperProps })}\n {@const menuProps = buildMenuProps(item, rect, menuWrapperProps)}\n {#if selectionMenu}\n {@const result = selectionMenu(menuProps)}\n {#if result}\n <result.component {...result.props} />\n {/if}\n {:else if selectionMenuSnippet}\n {@render selectionMenuSnippet(menuProps)}\n {/if}\n {/snippet}\n </CounterRotate>\n {/if}\n {:else}\n <div\n style=\"\n position: absolute;\n left: {item.rect.origin.x * scale}px;\n top: {item.rect.origin.y * scale}px;\n width: {item.rect.size.width * scale}px;\n height: {item.rect.size.height * scale}px;\n background: transparent;\n outline: {selectedId === item.id ? `1px solid ${bboxStroke}` : 'none'};\n outline-offset: 2px;\n pointer-events: auto;\n cursor: {selectedId === item.id ? 'pointer' : 'default'};\n \"\n >\n <Highlight\n rect={item.rect}\n rects={item.rects}\n color=\"transparent\"\n border=\"1px solid red\"\n {scale}\n onClick={(e) => select(e, item.id)}\n />\n </div>\n\n {#if shouldShowMenu(item.id)}\n <CounterRotate\n rect={{\n origin: { x: item.rect.origin.x * scale, y: item.rect.origin.y * scale },\n size: { width: item.rect.size.width * scale, height: item.rect.size.height * scale },\n }}\n {rotation}\n >\n {#snippet children({ rect, menuWrapperProps })}\n {@const menuProps = buildMenuProps(item, rect, menuWrapperProps)}\n {#if selectionMenu}\n {@const result = selectionMenu(menuProps)}\n {#if result}\n <result.component {...result.props} />\n {/if}\n {:else if selectionMenuSnippet}\n {@render selectionMenuSnippet(menuProps)}\n {/if}\n {/snippet}\n </CounterRotate>\n {/if}\n {/if}\n {/each}\n </div>\n{/if}\n","<script lang=\"ts\">\n import type { Rect } from '@embedpdf/models';\n import { useRedactionPlugin } from '../hooks/use-redaction.svelte';\n import Highlight from './highlight.svelte';\n\n interface SelectionRedactProps {\n documentId: string;\n pageIndex: number;\n scale: number;\n }\n\n let { documentId, pageIndex, scale }: SelectionRedactProps = $props();\n\n const redactionPlugin = useRedactionPlugin();\n let rects = $state<Rect[]>([]);\n let boundingRect = $state<Rect | null>(null);\n\n // Get stroke color from plugin (annotation mode uses tool defaults, legacy uses red)\n const strokeColor = $derived(redactionPlugin.plugin?.getPreviewStrokeColor() ?? 'red');\n\n $effect(() => {\n if (!redactionPlugin.plugin) {\n rects = [];\n boundingRect = null;\n return;\n }\n\n return redactionPlugin.plugin.onRedactionSelectionChange(documentId, (formattedSelection) => {\n const selection = formattedSelection.find((s) => s.pageIndex === pageIndex);\n rects = selection?.segmentRects ?? [];\n boundingRect = selection?.rect ?? null;\n });\n });\n</script>\n\n{#if boundingRect}\n <div\n style:mix-blend-mode=\"normal\"\n style:pointer-events=\"none\"\n style:position=\"absolute\"\n style:inset=\"0\"\n >\n <Highlight\n color=\"transparent\"\n opacity={1}\n {rects}\n {scale}\n border={`1px solid ${strokeColor}`}\n />\n </div>\n{/if}\n","<script lang=\"ts\">\n import type { Snippet } from 'svelte';\n import { useDocumentState } from '@embedpdf/core/svelte';\n import { Rotation } from '@embedpdf/models';\n import PendingRedactions from './pending-redactions.svelte';\n import MarqueeRedact from './marquee-redact.svelte';\n import SelectionRedact from './selection-redact.svelte';\n import type { RedactionSelectionMenuRenderFn, RedactionSelectionMenuProps } from '../types';\n\n interface RedactionLayerProps {\n /** The ID of the document this layer belongs to */\n documentId: string;\n /** Index of the page this layer lives on */\n pageIndex: number;\n /** Current render scale for this page */\n scale?: number;\n /** Page rotation (for counter-rotating menus, etc.) */\n rotation?: Rotation;\n /** Render function for selection menu (schema-driven approach) */\n selectionMenu?: RedactionSelectionMenuRenderFn;\n /** Snippet for custom selection menu (slot-based approach) */\n selectionMenuSnippet?: Snippet<[RedactionSelectionMenuProps]>;\n }\n\n let {\n documentId,\n pageIndex,\n scale,\n rotation,\n selectionMenu,\n selectionMenuSnippet,\n }: RedactionLayerProps = $props();\n\n const documentState = useDocumentState(() => documentId);\n const page = $derived(documentState.current?.document?.pages?.[pageIndex]);\n\n const actualScale = $derived(scale !== undefined ? scale : (documentState.current?.scale ?? 1));\n\n const actualRotation = $derived.by(() => {\n if (rotation !== undefined) return rotation;\n // Combine page intrinsic rotation with document rotation\n const pageRotation = page?.rotation ?? 0;\n const docRotation = documentState.current?.rotation ?? 0;\n return ((pageRotation + docRotation) % 4) as Rotation;\n });\n</script>\n\n<PendingRedactions\n {documentId}\n {pageIndex}\n scale={actualScale}\n rotation={actualRotation}\n {selectionMenu}\n {selectionMenuSnippet}\n/>\n<MarqueeRedact {documentId} {pageIndex} scale={actualScale} />\n<SelectionRedact {documentId} {pageIndex} scale={actualScale} />\n","import { createPluginPackage } from '@embedpdf/core';\nimport { RedactionPluginPackage as BaseRedactionPackage } from '@embedpdf/plugin-redaction';\nimport RedactRendererRegistration from './components/RedactRendererRegistration.svelte';\n\nexport * from './hooks';\nexport * from './components';\nexport * from './types';\nexport * from '@embedpdf/plugin-redaction';\n\nexport const RedactionPluginPackage = createPluginPackage(BaseRedactionPackage)\n .addUtility(RedactRendererRegistration)\n .build();\n"],"names":["root","$$anchor","root_1","PendingRedactions","MarqueeRedact","SelectionRedact","BaseRedactionPackage"],"mappings":";;;;;;;;;;;;;4CAAA;;MAYM,YAAY,EAAA,MAAO,KAAK;AAEtB,QAAA,4CAA6B,MAAM;QAEnC,eAAY,EAAA,QAAA,MAAA,EAAA,IAAY,MAAM,EAAC,gBAAY,EAAA;QAC3C,OAAI,EAAA,QAAA,MAAA,EAAA,IAAY,MAAM,EAAC,IAAI;AAG3B,QAAA,cAAW,EAAA,QAAA,MAAA,EAAA,IAAY,MAAM,EAAC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CAAC;AAAA,EACH,CAAC;;;;;UAIA,MAAE,OAAA;kBAAF,KAAE,IAAA,CAAA,GAAA;AAAA;;;;;2BAAF,GAAE;;oDAWsB,WAAW,CAAA,EAAA;AALjC,kBAAQ,QAAA;AAAA;mBAEE;AAAA;yBACR,KAAK;AAAA;;;;;;;;;cATT,GAAE;0BAAF,GAAE;AAAA;;gBADA,YAAY,EAAA,UAAA,UAAA;AAAA;;;;AAFT;;4CCjCR;;AAiCQ,QAAA,gBAAgB,iBAAgB,MAAA,QAAA,UAAA;AAChC,QAAA;;AAAgB,2CAAc,YAAd,mBAAuB,aAAvB,mBAAiC,UAAjC,mBAAsC,QAAA;AAAA,GAAA;QAEtD,cAAW,EAAA,QAAA,MAAA;;AAAA,mBAAA,UAAsB,SAAS,QAAA,UAAY,mBAAc,YAAd,mBAAuB,UAAS;AAAA,GAAC;AAEvF,QAAA,iBAAc,EAAA,QAAA,MAAqB;;6BACtB,OAAS,QAAA,QAAA;AAEpB,UAAA,iBAAY,OAAA,IAAG,IAAI,MAAP,mBAAS,aAAY;AACjC,UAAA,gBAAc,mBAAc,YAAd,mBAAuB,aAAY;YAC9C,eAAe,eAAe;AAAA,EACzC,CAAC;;;AAGFE,qBAAgB,MAAA;AAAA;;;;;;;mBAGR,WAAW;AAAA;;mBACR,cAAc;AAAA;;;;;;;;;AAIzBC,iBAAa,QAAA;AAAA;;;;;;;mBAAiC,WAAW;AAAA;;;AACzDC,mBAAe,QAAA;AAAA;;;;;;;mBAAiC,WAAW;AAAA;;;;AAXpD;ACpCD,MAAM,yBAAyB,oBAAoBC,wBAAoB,EAC3E,WAAW,0BAA0B,EACrC,MAAA;"}
1
+ {"version":3,"file":"index.js","sources":["../../src/svelte/components/annotations/RedactHighlight.svelte","../../src/svelte/components/annotations/RedactArea.svelte","../../src/svelte/components/redact-renderers.ts","../../src/svelte/components/RedactRendererRegistration.svelte","../../src/svelte/hooks/use-redaction.svelte.ts","../../src/svelte/components/highlight.svelte","../../src/svelte/components/marquee-redact.svelte","../../src/svelte/components/pending-redactions.svelte","../../src/svelte/components/selection-redact.svelte","../../src/svelte/components/redaction-layer.svelte","../../src/svelte/index.ts"],"sourcesContent":["<script lang=\"ts\">\n import type { AnnotationRendererProps } from '@embedpdf/plugin-annotation/svelte';\n import type { PdfRedactAnnoObject } from '@embedpdf/models';\n import {\n PdfStandardFont,\n PdfTextAlignment,\n standardFontCssProperties,\n textAlignmentToCss,\n } from '@embedpdf/models';\n\n let { annotation, isSelected, scale, onClick }: AnnotationRendererProps<PdfRedactAnnoObject> =\n $props();\n let isHovered = $state(false);\n\n const object = $derived(annotation.object);\n\n const segmentRects = $derived(object.segmentRects ?? []);\n const rect = $derived(object.rect);\n\n // C - Border/stroke color\n const strokeColor = $derived(object.strokeColor ?? '#FF0000');\n // IC - Interior color (background fill when redaction is applied)\n const color = $derived(object.color ?? '#000000');\n // CA - Opacity (0-1)\n const opacity = $derived(object.opacity ?? 1);\n // OC - Overlay text color (Adobe extension), fallback to fontColor\n const textColor = $derived(object.fontColor ?? object.overlayColor ?? '#FFFFFF');\n // Overlay text properties\n const overlayText = $derived(object.overlayText);\n const overlayTextRepeat = $derived(object.overlayTextRepeat ?? false);\n const fontSize = $derived(object.fontSize ?? 12);\n const fontFamily = $derived(object.fontFamily ?? PdfStandardFont.Helvetica);\n const fontCss = $derived(standardFontCssProperties(fontFamily));\n const textAlign = $derived(object.textAlign ?? PdfTextAlignment.Center);\n\n // Calculate how many times to repeat text (approximate)\n function renderOverlayText(): string | null {\n if (!overlayText) return null;\n if (!overlayTextRepeat) return overlayText;\n // Repeat text multiple times to fill the space\n const reps = 10;\n return Array(reps).fill(overlayText).join(' ');\n }\n\n const justifyContent = $derived(\n textAlign === PdfTextAlignment.Left\n ? 'flex-start'\n : textAlign === PdfTextAlignment.Right\n ? 'flex-end'\n : 'center',\n );\n</script>\n\n<div\n role=\"group\"\n onmouseenter={() => (isHovered = true)}\n onmouseleave={() => (isHovered = false)}\n style:position=\"absolute\"\n style:inset=\"0\"\n>\n {#each segmentRects as b, i (i)}\n {@const left = (rect ? b.origin.x - rect.origin.x : b.origin.x) * scale}\n {@const top = (rect ? b.origin.y - rect.origin.y : b.origin.y) * scale}\n {@const width = b.size.width * scale}\n {@const height = b.size.height * scale}\n {@const scaledFontSize = Math.min(fontSize * scale, height * 0.8)}\n <div\n role=\"button\"\n tabindex=\"0\"\n onpointerdown={onClick}\n style:position=\"absolute\"\n style:left=\"{left}px\"\n style:top=\"{top}px\"\n style:width=\"{width}px\"\n style:height=\"{height}px\"\n style:background={isHovered ? color : 'transparent'}\n style:border={!isHovered ? `2px solid ${strokeColor}` : 'none'}\n style:opacity={isHovered ? opacity : 1}\n style:box-sizing=\"border-box\"\n style:pointer-events=\"auto\"\n style:cursor=\"pointer\"\n style:display=\"flex\"\n style:align-items=\"center\"\n style:justify-content={justifyContent}\n style:overflow=\"hidden\"\n >\n {#if isHovered && overlayText}\n <span\n style:color={textColor}\n style:font-size=\"{scaledFontSize}px\"\n style:font-family={fontCss.fontFamily}\n style:font-weight={fontCss.fontWeight}\n style:font-style={fontCss.fontStyle}\n style:text-align={textAlignmentToCss(textAlign)}\n style:white-space={overlayTextRepeat ? 'normal' : 'nowrap'}\n style:overflow=\"hidden\"\n style:text-overflow=\"ellipsis\"\n style:line-height=\"1\"\n >\n {renderOverlayText()}\n </span>\n {/if}\n </div>\n {/each}\n</div>\n","<script lang=\"ts\">\n import type { AnnotationRendererProps } from '@embedpdf/plugin-annotation/svelte';\n import type { PdfRedactAnnoObject } from '@embedpdf/models';\n import {\n PdfStandardFont,\n PdfTextAlignment,\n standardFontCssProperties,\n textAlignmentToCss,\n } from '@embedpdf/models';\n\n let { annotation, isSelected, scale, onClick }: AnnotationRendererProps<PdfRedactAnnoObject> =\n $props();\n let isHovered = $state(false);\n\n const object = $derived(annotation.object);\n\n // C - Border/stroke color\n const strokeColor = $derived(object.strokeColor ?? '#FF0000');\n // IC - Interior color (background fill when redaction is applied)\n const color = $derived(object.color ?? '#000000');\n // CA - Opacity (0-1)\n const opacity = $derived(object.opacity ?? 1);\n // OC - Overlay text color (Adobe extension), fallback to fontColor\n const textColor = $derived(object.fontColor ?? object.overlayColor ?? '#FFFFFF');\n // Overlay text properties\n const overlayText = $derived(object.overlayText);\n const overlayTextRepeat = $derived(object.overlayTextRepeat ?? false);\n const fontSize = $derived(object.fontSize ?? 12);\n const fontFamily = $derived(object.fontFamily ?? PdfStandardFont.Helvetica);\n const fontCss = $derived(standardFontCssProperties(fontFamily));\n const textAlign = $derived(object.textAlign ?? PdfTextAlignment.Center);\n\n // Calculate how many times to repeat text (approximate)\n function renderOverlayText(): string | null {\n if (!overlayText) return null;\n if (!overlayTextRepeat) return overlayText;\n // Repeat text multiple times to fill the space\n const reps = 10;\n return Array(reps).fill(overlayText).join(' ');\n }\n\n const justifyContent = $derived(\n textAlign === PdfTextAlignment.Left\n ? 'flex-start'\n : textAlign === PdfTextAlignment.Right\n ? 'flex-end'\n : 'center',\n );\n</script>\n\n<div\n role=\"button\"\n tabindex=\"0\"\n onpointerdown={(e) => {\n if (!isSelected) onClick(e);\n }}\n onmouseenter={() => (isHovered = true)}\n onmouseleave={() => (isHovered = false)}\n style:position=\"absolute\"\n style:inset=\"0\"\n style:background={isHovered ? color : 'transparent'}\n style:border={!isHovered ? `2px solid ${strokeColor}` : 'none'}\n style:opacity={isHovered ? opacity : 1}\n style:box-sizing=\"border-box\"\n style:pointer-events=\"auto\"\n style:cursor={isSelected ? 'move' : 'pointer'}\n style:display=\"flex\"\n style:align-items=\"center\"\n style:justify-content={justifyContent}\n style:overflow=\"hidden\"\n>\n {#if isHovered && overlayText}\n <span\n style:color={textColor}\n style:font-size=\"{fontSize * scale}px\"\n style:font-family={fontCss.fontFamily}\n style:font-weight={fontCss.fontWeight}\n style:font-style={fontCss.fontStyle}\n style:text-align={textAlignmentToCss(textAlign)}\n style:white-space={overlayTextRepeat ? 'normal' : 'nowrap'}\n style:overflow=\"hidden\"\n style:text-overflow=\"ellipsis\"\n style:padding=\"4px\"\n >\n {renderOverlayText()}\n </span>\n {/if}\n</div>\n","import { createRenderer, type BoxedAnnotationRenderer } from '@embedpdf/plugin-annotation/svelte';\nimport { PdfAnnotationSubtype, type PdfRedactAnnoObject } from '@embedpdf/models';\nimport RedactHighlight from './annotations/RedactHighlight.svelte';\nimport RedactArea from './annotations/RedactArea.svelte';\n\n/**\n * Boxed annotation renderers for Redact annotations.\n * Type safety is enforced at definition time via createRenderer.\n * These are automatically registered with the annotation plugin via context.\n */\nexport const redactRenderers: BoxedAnnotationRenderer[] = [\n createRenderer<PdfRedactAnnoObject>({\n id: 'redactHighlight',\n matches: (a): a is PdfRedactAnnoObject =>\n a.type === PdfAnnotationSubtype.REDACT &&\n 'segmentRects' in a &&\n (a.segmentRects?.length ?? 0) > 0,\n component: RedactHighlight,\n interactionDefaults: { isDraggable: false, isResizable: false, isRotatable: false },\n useAppearanceStream: false,\n }),\n createRenderer<PdfRedactAnnoObject>({\n id: 'redactArea',\n matches: (a): a is PdfRedactAnnoObject =>\n a.type === PdfAnnotationSubtype.REDACT &&\n (!('segmentRects' in a) || !(a.segmentRects?.length ?? 0)),\n component: RedactArea,\n interactionDefaults: { isDraggable: false, isResizable: false, isRotatable: false },\n useAppearanceStream: false,\n }),\n];\n","<script lang=\"ts\">\n import { onMount } from 'svelte';\n import { getRendererRegistry } from '@embedpdf/plugin-annotation/svelte';\n import { redactRenderers } from './redact-renderers';\n import type { Snippet } from 'svelte';\n\n let { children }: { children?: Snippet } = $props();\n\n const registry = getRendererRegistry();\n\n onMount(() => {\n if (!registry) return;\n return registry.register(redactRenderers);\n });\n</script>\n\n{#if children}\n {@render children()}\n{/if}\n","import {\n RedactionPlugin,\n initialDocumentState,\n RedactionDocumentState,\n RedactionScope,\n} from '@embedpdf/plugin-redaction';\nimport { useCapability, usePlugin } from '@embedpdf/core/svelte';\n\nexport const useRedactionPlugin = () => usePlugin<RedactionPlugin>(RedactionPlugin.id);\nexport const useRedactionCapability = () => useCapability<RedactionPlugin>(RedactionPlugin.id);\n\n// Define the return type explicitly to maintain type safety\ninterface UseRedactionReturn {\n provides: RedactionScope | null;\n state: RedactionDocumentState;\n}\n\n/**\n * Hook for redaction state for a specific document\n * @param getDocumentId Document ID getter function\n */\nexport const useRedaction = (getDocumentId: () => string | null): UseRedactionReturn => {\n const capability = useRedactionCapability();\n\n let state = $state<RedactionDocumentState>(initialDocumentState);\n\n // Reactive documentId\n const documentId = $derived(getDocumentId());\n\n // Scoped capability for current docId\n const scopedProvides = $derived(\n capability.provides && documentId ? capability.provides.forDocument(documentId) : null,\n );\n\n $effect(() => {\n const provides = capability.provides;\n const docId = documentId;\n\n if (!provides || !docId) {\n state = initialDocumentState;\n return;\n }\n\n const scope = provides.forDocument(docId);\n\n // Get initial state\n try {\n state = scope.getState();\n } catch (e) {\n // Handle case where state might not be ready\n state = initialDocumentState;\n }\n\n // Subscribe to state changes for THIS docId\n return scope.onStateChange((newState) => {\n state = newState;\n });\n });\n\n return {\n get provides() {\n return scopedProvides;\n },\n get state() {\n return state;\n },\n };\n};\n","<script lang=\"ts\">\n import type { Rect } from '@embedpdf/models';\n\n interface HighlightProps {\n color?: string;\n opacity?: number;\n border?: string;\n rects: Rect[];\n rect?: Rect;\n scale: number;\n onClick?: (e: MouseEvent) => void;\n style?: string;\n }\n\n let {\n color = '#FFFF00',\n opacity = 1,\n border = '1px solid red',\n rects,\n rect,\n scale,\n onClick,\n style = '',\n }: HighlightProps = $props();\n\n // Rename rect to boundingRect for clarity\n const boundingRect = $derived(rect);\n</script>\n\n{#each rects as b, i (i)}\n <div\n onpointerdown={onClick}\n style:position=\"absolute\"\n style:border\n style:left={`${(boundingRect ? b.origin.x - boundingRect.origin.x : b.origin.x) * scale}px`}\n style:top={`${(boundingRect ? b.origin.y - boundingRect.origin.y : b.origin.y) * scale}px`}\n style:width={`${b.size.width * scale}px`}\n style:height={`${b.size.height * scale}px`}\n style:background={color}\n style:opacity\n style:pointer-events={onClick ? 'auto' : 'none'}\n style:cursor={onClick ? 'pointer' : 'default'}\n style:z-index={onClick ? '1' : undefined}\n {style}\n ></div>\n{/each}\n","<script lang=\"ts\">\n import { useDocumentState } from '@embedpdf/core/svelte';\n import type { Rect } from '@embedpdf/models';\n import { useRedactionPlugin } from '../hooks/use-redaction.svelte';\n\n interface MarqueeRedactProps {\n /** The ID of the document */\n documentId: string;\n /** Index of the page this layer lives on */\n pageIndex: number;\n /** Scale of the page */\n scale?: number;\n /** Optional CSS class applied to the marquee rectangle */\n className?: string;\n /** Stroke / fill colours (defaults below) */\n stroke?: string;\n fill?: string;\n }\n\n let {\n documentId,\n pageIndex,\n scale: scaleOverride,\n className = '',\n stroke,\n fill = 'transparent',\n }: MarqueeRedactProps = $props();\n\n const redactionPlugin = useRedactionPlugin();\n const documentState = useDocumentState(() => documentId);\n let rect = $state<Rect | null>(null);\n\n const actualScale = $derived(\n scaleOverride !== undefined ? scaleOverride : (documentState.current?.scale ?? 1),\n );\n\n // Get stroke color from plugin (annotation mode uses tool defaults, legacy uses red)\n // Allow prop override for backwards compatibility\n const strokeColor = $derived(stroke ?? redactionPlugin.plugin?.getPreviewStrokeColor() ?? 'red');\n\n $effect(() => {\n if (!redactionPlugin.plugin || !documentId) {\n rect = null;\n return;\n }\n\n return redactionPlugin.plugin.onRedactionMarqueeChange(documentId, (data) => {\n rect = data.pageIndex === pageIndex ? data.rect : null;\n });\n });\n</script>\n\n{#if rect}\n <div\n class={className}\n style:position=\"absolute\"\n style:pointer-events=\"none\"\n style:left={`${rect.origin.x * actualScale}px`}\n style:top={`${rect.origin.y * actualScale}px`}\n style:width={`${rect.size.width * actualScale}px`}\n style:height={`${rect.size.height * actualScale}px`}\n style:border={`1px solid ${strokeColor}`}\n style:background={fill}\n style:box-sizing=\"border-box\"\n ></div>\n{/if}\n","<script lang=\"ts\">\n import type { Snippet } from 'svelte';\n import type { Rect } from '@embedpdf/models';\n import { Rotation } from '@embedpdf/models';\n import { CounterRotate } from '@embedpdf/utils/svelte';\n import type { MenuWrapperProps, SelectionMenuPlacement } from '@embedpdf/utils/svelte';\n import type { RedactionItem } from '@embedpdf/plugin-redaction';\n import { useRedactionCapability } from '../hooks/use-redaction.svelte';\n import Highlight from './highlight.svelte';\n import type {\n RedactionSelectionContext,\n RedactionSelectionMenuRenderFn,\n RedactionSelectionMenuProps,\n } from '../types';\n\n interface Props {\n documentId: string;\n pageIndex: number;\n scale: number;\n rotation?: Rotation;\n bboxStroke?: string;\n selectionMenu?: RedactionSelectionMenuRenderFn;\n selectionMenuSnippet?: Snippet<[RedactionSelectionMenuProps]>;\n }\n\n let {\n documentId,\n pageIndex,\n scale,\n rotation = Rotation.Degree0,\n bboxStroke = 'rgba(0,0,0,0.8)',\n selectionMenu,\n selectionMenuSnippet,\n }: Props = $props();\n\n const redactionCapability = useRedactionCapability();\n\n let items = $state<RedactionItem[]>([]);\n let selectedId = $state<string | null>(null);\n\n $effect(() => {\n const redactionValue = redactionCapability.provides;\n if (!redactionValue) {\n items = [];\n selectedId = null;\n return;\n }\n\n const scoped = redactionValue.forDocument(documentId);\n const currentState = scoped.getState();\n // Only show legacy mode items (not annotation-based redactions)\n items = (currentState.pending[pageIndex] ?? []).filter((it) => it.source === 'legacy');\n selectedId = currentState.selected?.page === pageIndex ? currentState.selected.id : null;\n\n const off1 = scoped.onPendingChange((map) => {\n // Only show legacy mode items (not annotation-based redactions)\n items = (map[pageIndex] ?? []).filter((it) => it.source === 'legacy');\n });\n\n const off2 = scoped.onSelectedChange((sel) => {\n selectedId = sel?.page === pageIndex ? sel.id : null;\n });\n\n return () => {\n off1?.();\n off2?.();\n };\n });\n\n function select(e: MouseEvent, id: string) {\n e.stopPropagation();\n if (!redactionCapability.provides) return;\n redactionCapability.provides.forDocument(documentId).selectPending(pageIndex, id);\n }\n\n function shouldShowMenu(itemId: string): boolean {\n const isSelected = selectedId === itemId;\n return isSelected && (!!selectionMenu || !!selectionMenuSnippet);\n }\n\n function buildContext(item: RedactionItem): RedactionSelectionContext {\n return { type: 'redaction', item, pageIndex };\n }\n\n const menuPlacement: SelectionMenuPlacement = {\n suggestTop: false,\n spaceAbove: 0,\n spaceBelow: 0,\n };\n\n function buildMenuProps(\n item: RedactionItem,\n rect: Rect,\n menuWrapperProps: MenuWrapperProps,\n ): RedactionSelectionMenuProps {\n return {\n context: buildContext(item),\n selected: selectedId === item.id,\n rect,\n placement: menuPlacement,\n menuWrapperProps,\n };\n }\n</script>\n\n{#if items.length}\n <div style=\"position: absolute; inset: 0; pointer-events: none;\">\n {#each items as item (item.id)}\n {#if item.kind === 'area'}\n <div\n style=\"\n position: absolute;\n left: {item.rect.origin.x * scale}px;\n top: {item.rect.origin.y * scale}px;\n width: {item.rect.size.width * scale}px;\n height: {item.rect.size.height * scale}px;\n background: transparent;\n outline: {selectedId === item.id ? `1px solid ${bboxStroke}` : 'none'};\n outline-offset: 2px;\n border: 1px solid red;\n pointer-events: auto;\n cursor: pointer;\n \"\n onpointerdown={(e) => select(e, item.id)}\n ></div>\n\n {#if shouldShowMenu(item.id)}\n <CounterRotate\n rect={{\n origin: { x: item.rect.origin.x * scale, y: item.rect.origin.y * scale },\n size: { width: item.rect.size.width * scale, height: item.rect.size.height * scale },\n }}\n {rotation}\n >\n {#snippet children({ rect, menuWrapperProps })}\n {@const menuProps = buildMenuProps(item, rect, menuWrapperProps)}\n {#if selectionMenu}\n {@const result = selectionMenu(menuProps)}\n {#if result}\n <result.component {...result.props} />\n {/if}\n {:else if selectionMenuSnippet}\n {@render selectionMenuSnippet(menuProps)}\n {/if}\n {/snippet}\n </CounterRotate>\n {/if}\n {:else}\n <div\n style=\"\n position: absolute;\n left: {item.rect.origin.x * scale}px;\n top: {item.rect.origin.y * scale}px;\n width: {item.rect.size.width * scale}px;\n height: {item.rect.size.height * scale}px;\n background: transparent;\n outline: {selectedId === item.id ? `1px solid ${bboxStroke}` : 'none'};\n outline-offset: 2px;\n pointer-events: auto;\n cursor: {selectedId === item.id ? 'pointer' : 'default'};\n \"\n >\n <Highlight\n rect={item.rect}\n rects={item.rects}\n color=\"transparent\"\n border=\"1px solid red\"\n {scale}\n onClick={(e) => select(e, item.id)}\n />\n </div>\n\n {#if shouldShowMenu(item.id)}\n <CounterRotate\n rect={{\n origin: { x: item.rect.origin.x * scale, y: item.rect.origin.y * scale },\n size: { width: item.rect.size.width * scale, height: item.rect.size.height * scale },\n }}\n {rotation}\n >\n {#snippet children({ rect, menuWrapperProps })}\n {@const menuProps = buildMenuProps(item, rect, menuWrapperProps)}\n {#if selectionMenu}\n {@const result = selectionMenu(menuProps)}\n {#if result}\n <result.component {...result.props} />\n {/if}\n {:else if selectionMenuSnippet}\n {@render selectionMenuSnippet(menuProps)}\n {/if}\n {/snippet}\n </CounterRotate>\n {/if}\n {/if}\n {/each}\n </div>\n{/if}\n","<script lang=\"ts\">\n import type { Rect } from '@embedpdf/models';\n import { useRedactionPlugin } from '../hooks/use-redaction.svelte';\n import Highlight from './highlight.svelte';\n\n interface SelectionRedactProps {\n documentId: string;\n pageIndex: number;\n scale: number;\n }\n\n let { documentId, pageIndex, scale }: SelectionRedactProps = $props();\n\n const redactionPlugin = useRedactionPlugin();\n let rects = $state<Rect[]>([]);\n let boundingRect = $state<Rect | null>(null);\n\n // Get stroke color from plugin (annotation mode uses tool defaults, legacy uses red)\n const strokeColor = $derived(redactionPlugin.plugin?.getPreviewStrokeColor() ?? 'red');\n\n $effect(() => {\n if (!redactionPlugin.plugin) {\n rects = [];\n boundingRect = null;\n return;\n }\n\n return redactionPlugin.plugin.onRedactionSelectionChange(documentId, (formattedSelection) => {\n const selection = formattedSelection.find((s) => s.pageIndex === pageIndex);\n rects = selection?.segmentRects ?? [];\n boundingRect = selection?.rect ?? null;\n });\n });\n</script>\n\n{#if boundingRect}\n <div\n style:mix-blend-mode=\"normal\"\n style:pointer-events=\"none\"\n style:position=\"absolute\"\n style:inset=\"0\"\n >\n <Highlight\n color=\"transparent\"\n opacity={1}\n {rects}\n {scale}\n border={`1px solid ${strokeColor}`}\n />\n </div>\n{/if}\n","<script lang=\"ts\">\n import type { Snippet } from 'svelte';\n import { useDocumentState } from '@embedpdf/core/svelte';\n import { Rotation } from '@embedpdf/models';\n import PendingRedactions from './pending-redactions.svelte';\n import MarqueeRedact from './marquee-redact.svelte';\n import SelectionRedact from './selection-redact.svelte';\n import type { RedactionSelectionMenuRenderFn, RedactionSelectionMenuProps } from '../types';\n\n interface RedactionLayerProps {\n /** The ID of the document this layer belongs to */\n documentId: string;\n /** Index of the page this layer lives on */\n pageIndex: number;\n /** Current render scale for this page */\n scale?: number;\n /** Page rotation (for counter-rotating menus, etc.) */\n rotation?: Rotation;\n /** Render function for selection menu (schema-driven approach) */\n selectionMenu?: RedactionSelectionMenuRenderFn;\n /** Snippet for custom selection menu (slot-based approach) */\n selectionMenuSnippet?: Snippet<[RedactionSelectionMenuProps]>;\n }\n\n let {\n documentId,\n pageIndex,\n scale,\n rotation,\n selectionMenu,\n selectionMenuSnippet,\n }: RedactionLayerProps = $props();\n\n const documentState = useDocumentState(() => documentId);\n const page = $derived(documentState.current?.document?.pages?.[pageIndex]);\n\n const actualScale = $derived(scale !== undefined ? scale : (documentState.current?.scale ?? 1));\n\n const actualRotation = $derived.by(() => {\n if (rotation !== undefined) return rotation;\n // Combine page intrinsic rotation with document rotation\n const pageRotation = page?.rotation ?? 0;\n const docRotation = documentState.current?.rotation ?? 0;\n return ((pageRotation + docRotation) % 4) as Rotation;\n });\n</script>\n\n<PendingRedactions\n {documentId}\n {pageIndex}\n scale={actualScale}\n rotation={actualRotation}\n {selectionMenu}\n {selectionMenuSnippet}\n/>\n<MarqueeRedact {documentId} {pageIndex} scale={actualScale} />\n<SelectionRedact {documentId} {pageIndex} scale={actualScale} />\n","import { createPluginPackage } from '@embedpdf/core';\nimport { RedactionPluginPackage as BaseRedactionPackage } from '@embedpdf/plugin-redaction';\nimport RedactRendererRegistration from './components/RedactRendererRegistration.svelte';\n\nexport * from './hooks';\nexport * from './components';\nexport * from './types';\nexport * from '@embedpdf/plugin-redaction';\n\nexport const RedactionPluginPackage = createPluginPackage(BaseRedactionPackage)\n .addUtility(RedactRendererRegistration)\n .build();\n"],"names":["root","$$anchor","root_1","PendingRedactions","MarqueeRedact","SelectionRedact","BaseRedactionPackage"],"mappings":";;;;;;;;;;;;;4CAAA;;MAYM,YAAY,EAAA,MAAO,KAAK;AAEtB,QAAA,4CAA6B,MAAM;QAEnC,eAAY,EAAA,QAAA,MAAA,EAAA,IAAY,MAAM,EAAC,gBAAY,EAAA;QAC3C,OAAI,EAAA,QAAA,MAAA,EAAA,IAAY,MAAM,EAAC,IAAI;AAG3B,QAAA,cAAW,EAAA,QAAA,MAAA,EAAA,IAAY,MAAM,EAAC,eAAe,SAAS;AAEtD,QAAA,QAAK,EAAA,QAAA,MAAA,EAAA,IAAY,MAAM,EAAC,SAAS,SAAS;AAE1C,QAAA,UAAO,EAAA,QAAA,MAAA,EAAA,IAAY,MAAM,EAAC,WAAW,CAAC;QAEtC,YAAS,EAAA,QAAA,MAAA,EAAA,IAAY,MAAM,EAAC,mBAAa,MAAM,EAAC,gBAAgB,SAAS;QAEzE,cAAW,EAAA,QAAA,MAAA,EAAA,IAAY,MAAM,EAAC,WAAW;AACzC,QAAA,oBAAiB,EAAA,QAAA,MAAA,EAAA,IAAY,MAAM,EAAC,qBAAqB,KAAK;AAC9D,QAAA,WAAQ,EAAA,QAAA,MAAA,EAAA,IAAY,MAAM,EAAC,YAAY,EAAE;AACzC,QAAA,mCAAsB,MAAM,EAAC,cAAc,gBAAgB,SAAS;QACpE,UAAO,EAAA,QAAA,MAAY,0BAAyB,EAAA,IAAC,UAAU,CAAA,CAAA;AACvD,QAAA,kCAAqB,MAAM,EAAC,aAAa,iBAAiB,MAAM;AAG7D,WAAA,oBAAmC;AACrC,QAAA,CAAA,EAAA,IAAA,WAAW,UAAS;AACpB,QAAA,CAAA,EAAA,IAAA,iBAAiB,gBAAS,WAAW;AAEpC,UAAA,OAAO;WACN,MAAM,IAAI,EAAE,WAAK,W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E,WAAW,0BAA0B,EACrC,MAAA;"}
@@ -6,7 +6,7 @@ interface HighlightProps {
6
6
  rects: Rect[];
7
7
  rect?: Rect;
8
8
  scale: number;
9
- onClick?: (e: PointerEvent | TouchEvent) => void;
9
+ onClick?: (e: PointerEvent) => void;
10
10
  }
11
11
  declare const __VLS_export: import('vue').DefineComponent<HighlightProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<HighlightProps> & Readonly<{}>, {
12
12
  color: string;
@@ -27,7 +27,7 @@ declare var __VLS_8: {
27
27
  height: number;
28
28
  };
29
29
  };
30
- placement: import('@embedpdf/utils/vue').SelectionMenuPlacement;
30
+ placement: import('@embedpdf/utils').SelectionMenuPlacement;
31
31
  menuWrapperProps: {
32
32
  style: import('vue').CSSProperties;
33
33
  onPointerdown: (e: PointerEvent) => void;