use-chisel 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +67 -2
- package/bin/chisel.js +10 -0
- package/dist/index.d.ts +8 -2
- package/dist/index.js +99 -1607
- package/dist/persistence.d.ts +30 -0
- package/dist/theme.d.ts +1 -0
- package/dist/workspace/color-picker.d.ts +6 -0
- package/dist/workspace/color.d.ts +9 -0
- package/dist/workspace/comment-box.d.ts +28 -0
- package/dist/workspace/comment-drag-handle.d.ts +3 -0
- package/dist/workspace/comments.d.ts +80 -0
- package/dist/workspace/composer-position.d.ts +13 -0
- package/dist/workspace/confirmation.d.ts +11 -0
- package/dist/workspace/hover-dismiss.d.ts +4 -0
- package/dist/workspace/mode-shortcuts.d.ts +1 -0
- package/dist/workspace/page-control.d.ts +7 -0
- package/dist/workspace/preview-navigation.d.ts +4 -0
- package/dist/workspace/preview.d.ts +3 -0
- package/dist/workspace/style-changes.d.ts +15 -0
- package/dist/workspace/styles.d.ts +1 -0
- package/dist/workspace/thread-morph.d.ts +1 -0
- package/dist/workspace/workspace.d.ts +51 -0
- package/dist/workspace-entry.d.ts +6 -0
- package/dist/workspace-entry.js +394 -0
- package/package.json +24 -7
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
"use client";import{jsx as u,jsxs as x,Fragment as sa}from"react/jsx-runtime";import{useEffect as Se,useLayoutEffect as Da,useRef as z,useState as T}from"react";import{forwardRef as bo,createElement as ko}from"react";var lt=a=>a?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();function ut(a,t,r=[]){if(t==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:lt(a),size:24,node:t,...r.length>0?{aliases:r}:{}}}var st=a=>{let t="",r=!1;for(let o of a){if(o==="-"||o==="_"||o<=" "){r=t.length>0;continue}t.length===0?t+=o.toLowerCase():t+=r?o.toUpperCase():o,r=!1}return t};var it=a=>{let t=st(a);return t.charAt(0).toUpperCase()+t.slice(1)};import{forwardRef as Co,createElement as mt}from"react";var Ge=(...a)=>a.filter((t,r,o)=>!!t&&t.trim()!==""&&o.indexOf(t)===r).join(" ").trim();var Ie={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};function Ua(a){return a!=null}function ft(a,t={}){let r=t.attributeNames??{},o=b=>r[b]??b,l=a.size??a.width??Ie.width,f=a.size??a.height??Ie.height,s=a.aliases?.filter(b=>typeof b=="string"&&b.trim()!=="").map(b=>`lucide-${b}`)??[],p=[...a.name?[`lucide-${a.name}`]:[],...s],L=t.className?.split(" ").filter(Boolean)??[],S=t.includeDefaultClasses===!1?Ge(...L):Ge("lucide",...p,...L),k=t.absoluteStrokeWidth?Number(t.strokeWidth??Ie["stroke-width"])*Number(a.size??a.width??Ie.width)/Number(t.size??t.width??Ie.width):t.strokeWidth??Ie["stroke-width"];return["svg",{...Object.entries(Ie).reduce((b,[g,M])=>(b[o(g)]=M,b),{}),..."color"in t&&t.color&&{[o("stroke")]:t.color},..."size"in t&&Ua(t.size)&&{[o("width")]:t.size,[o("height")]:t.size},..."width"in t&&Ua(t.width)&&{[o("width")]:t.width},..."height"in t&&Ua(t.height)&&{[o("height")]:t.height},[o("stroke-width")]:k,...S&&{[o("class")]:S},[o("viewBox")]:`0 0 ${l} ${f}`,...t.hasA11yProp===!1?{[o("aria-hidden")]:"true"}:{},..."attributes"in t&&t.attributes},a.node.map(b=>{let[g,M,F]=b,G=t.nonScalingStroke?{[o("vector-effect")]:"non-scaling-stroke",...M}:M;return F?[g,G,F]:[g,G]})]}function nt(a,t={}){return ft(a,{...t,attributeNames:{...t.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}var ct=a=>{for(let t in a)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};import{createContext as Lo,useContext as go,useMemo as or,createElement as rr}from"react";var Io=Lo({});var pt=()=>go(Io);var ht=Co(({color:a,size:t,width:r,height:o,strokeWidth:l,absoluteStrokeWidth:f,nonScalingStroke:s,className:p="",children:L,iconNode:S=[],icon:k={node:S,aliases:[],size:24},...w},b)=>{let{size:g=24,strokeWidth:M=2,absoluteStrokeWidth:F=!1,nonScalingStroke:G=!1,color:V="currentColor",className:J=""}=pt()??{},D=!!L||ct(w),[H,i,m=[]]=nt(k,{color:a??V,width:r??t??g,height:o??t??g,strokeWidth:l??M,absoluteStrokeWidth:f??F,nonScalingStroke:s??G,className:Ge(J,p),hasA11yProp:D,attributes:w});return mt(H,{ref:b,...i},[...m.map(([W,q])=>mt(W,q)),...Array.isArray(L)?L:[L]])});function I(a,t=[],r=[]){let o=typeof a=="string"?ut(a,t,r):a,l=bo(({className:f,...s},p)=>ko(ht,{ref:p,icon:o,className:f,...s}));return o.name&&(l.displayName=it(o.name)),l}var xt={name:"arrow-right",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]};xt.node;var We=I(xt);var Lt={name:"arrow-up",size:24,node:[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]};Lt.node;var Ve=I(Lt);var gt={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};gt.node;var Pe=I(gt);var It={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};It.node;var Xe=I(It);var Ct={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};Ct.node;var Ae=I(Ct);var bt={name:"circle-check",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 9-5.5 5.5L8 12",key:"xofnsj"}]],aliases:["check-circle-2"]};bt.node;var Ce=I(bt);var kt={name:"eye",size:24,node:[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};kt.node;var Ke=I(kt);var St={name:"globe",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]};St.node;var $e=I(St);var wt={name:"grip-horizontal",size:24,node:[["circle",{cx:"12",cy:"9",r:"1",key:"124mty"}],["circle",{cx:"19",cy:"9",r:"1",key:"1ruzo2"}],["circle",{cx:"5",cy:"9",r:"1",key:"1a8b28"}],["circle",{cx:"12",cy:"15",r:"1",key:"1e56xg"}],["circle",{cx:"19",cy:"15",r:"1",key:"1a92ep"}],["circle",{cx:"5",cy:"15",r:"1",key:"5r1jwy"}]]};wt.node;var Ze=I(wt);var yt={name:"link-2",size:24,node:[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]};yt.node;var je=I(yt);var vt={name:"loader-circle",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],aliases:["loader-2"]};vt.node;var be=I(vt);var Pt={name:"log-out",size:24,node:[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]};Pt.node;var _e=I(Pt);var At={name:"message-circle",size:24,node:[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]]};At.node;var Ue=I(At);var Dt={name:"mouse-pointer-2",size:24,node:[["path",{d:"M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z",key:"edeuup"}]]};Dt.node;var Je=I(Dt);var Bt={name:"pencil",size:24,node:[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]};Bt.node;var Qe=I(Bt);var Mt={name:"pipette",size:24,node:[["path",{d:"m12 9-8.414 8.414A2 2 0 0 0 3 18.828v1.344a2 2 0 0 1-.586 1.414A2 2 0 0 1 3.828 21h1.344a2 2 0 0 0 1.414-.586L15 12",key:"1y3wsu"}],["path",{d:"m18 9 .4.4a1 1 0 1 1-3 3l-3.8-3.8a1 1 0 1 1 3-3l.4.4 3.4-3.4a1 1 0 1 1 3 3z",key:"110lr1"}],["path",{d:"m2 22 .414-.414",key:"jhxm08"}]]};Mt.node;var Ye=I(Mt);var Ft={name:"rotate-ccw",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]};Ft.node;var ea=I(Ft);var Rt={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};Rt.node;var aa=I(Rt);var Tt={name:"sliders-horizontal",size:24,node:[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]]};Tt.node;var De=I(Tt);var qt={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};qt.node;var ke=I(qt);var Ut={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};Ut.node;var ta=I(Ut);import{jsx as B,jsxs as _,Fragment as vo}from"react/jsx-runtime";import{useEffect as Wt,useId as Po,useState as he}from"react";import{jsx as se,jsxs as oa}from"react/jsx-runtime";import{useEffect as So,useRef as Ot,useState as He}from"react";import{createPortal as wo}from"react-dom";function Ht(a,t,r,o=1){a/=255,t/=255,r/=255;let l=Math.max(a,t,r),f=Math.min(a,t,r),s=l-f;return{h:(s?l===a?((t-r)/s+6)%6:l===t?(r-a)/s+2:(a-t)/s+4:0)*60,s:l?s/l:0,v:l,a:o}}function Ca({h:a,s:t,v:r,a:o}){let l=f=>{let s=(f+a/60)%6;return Math.round(255*r*(1-t*Math.max(0,Math.min(s,4-s,1)))).toString(16).padStart(2,"0")};return`#${l(5)}${l(3)}${l(1)}${o<1?Math.round(o*255).toString(16).padStart(2,"0"):""}`}function ba(a){if(typeof document<"u"){let t=document.createElement("canvas");t.width=t.height=1;let r=t.getContext("2d");if(r){r.fillStyle=a,r.fillRect(0,0,1,1);let[o,l,f,s]=r.getImageData(0,0,1,1).data;return Ht(o,l,f,s/255)}}return Ht(0,0,0)}function Ha({label:a,value:t,onChange:r,disabled:o}){let l=Ot(null),f=Ot(null),[s,p]=He(null),[L,S]=He({h:0,s:0,v:0,a:1}),[k,w]=He(""),[b,g]=He(!1),[M,F]=He(!1),[G,V]=He(!1);function J(){p(null)}So(()=>{if(!s)return;let i=O=>{!f.current?.contains(O.target)&&!l.current?.contains(O.target)&&J()},m=O=>{O.key==="Escape"&&(O.preventDefault(),O.stopPropagation(),J(),l.current?.focus())},W=l.current?.getBoundingClientRect(),q=O=>{if(f.current?.contains(O.target))return;let ae=l.current?.getBoundingClientRect();(ae?.top!==W?.top||ae?.left!==W?.left)&&J()};return document.addEventListener("pointerdown",i),document.addEventListener("keydown",m,!0),window.addEventListener("resize",J),document.addEventListener("scroll",q,!0),f.current?.querySelector("input")?.focus({preventScroll:!0}),()=>{document.removeEventListener("pointerdown",i),document.removeEventListener("keydown",m,!0),window.removeEventListener("resize",J),document.removeEventListener("scroll",q,!0)}},[s]);function D(i){i.a===0&&(i={...i,a:1}),S(i);let m=Ca(i);w(m.slice(1).toUpperCase()),g(!1),r(m)}function H(i){let m=i.currentTarget.getBoundingClientRect();D({...L,s:Math.max(0,Math.min(1,(i.clientX-m.left)/m.width)),v:1-Math.max(0,Math.min(1,(i.clientY-m.top)/m.height))})}return oa("div",{className:"comment-box-color",children:[se("button",{ref:l,className:"comment-color-trigger",type:"button","aria-label":`${a} picker`,"aria-haspopup":"dialog","aria-expanded":!!s,disabled:o,onClick:()=>{if(s){J();return}let i=ba(t);S(i),w(Ca(i).slice(1).toUpperCase()),g(!1),F("EyeDropper"in window);let m=l.current.getBoundingClientRect();p({left:Math.max(8,Math.min(m.right-256,window.innerWidth-264)),top:Math.max(8,Math.min(m.bottom+8,window.innerHeight-330))})},children:se("span",{style:{background:t}})}),se("span",{className:"comment-color-value",title:t,children:t}),s&&wo(oa("div",{ref:f,className:"chisel-color-picker",role:"dialog","aria-label":`${a} color picker`,style:s,onKeyDown:i=>{if(i.key!=="Tab")return;let m=Array.from(f.current.querySelectorAll("button:not(:disabled), input:not(:disabled)"));i.shiftKey&&document.activeElement===m[0]?(i.preventDefault(),m[m.length-1]?.focus()):!i.shiftKey&&document.activeElement===m[m.length-1]&&(i.preventDefault(),m[0]?.focus())},children:[oa("div",{className:"chisel-color-plane",style:{backgroundColor:`hsl(${L.h} 100% 50%)`},onPointerDown:i=>{i.currentTarget.setPointerCapture(i.pointerId),H(i)},onPointerMove:i=>{i.currentTarget.hasPointerCapture(i.pointerId)&&H(i)},children:[se("span",{className:"chisel-color-thumb",style:{left:`${L.s*100}%`,top:`${(1-L.v)*100}%`,background:Ca({...L,a:1})}}),se("input",{className:"chisel-color-accessible",type:"range","aria-label":`${a} saturation`,min:0,max:100,value:Math.round(L.s*100),onChange:i=>D({...L,s:Number(i.target.value)/100})}),se("input",{className:"chisel-color-accessible",type:"range","aria-label":`${a} brightness`,min:0,max:100,value:Math.round(L.v*100),onChange:i=>D({...L,v:Number(i.target.value)/100})})]}),oa("div",{className:"chisel-color-tools",children:[se("input",{className:"chisel-color-hue",type:"range","aria-label":`${a} hue`,min:0,max:360,value:Math.round(L.h),style:{"--hue":`hsl(${L.h} 100% 50%)`},onChange:i=>D({...L,h:Number(i.target.value)})}),se("button",{type:"button","aria-label":`Pick ${a.toLowerCase()} from screen`,title:M?"Pick a color from the screen":"Screen color picker is not supported in this browser",disabled:!M||G,onClick:async()=>{let i=window.EyeDropper;if(i){V(!0);try{let m=await new i().open();f.current&&D(ba(m.sRGBHex))}catch{}finally{V(!1)}}},children:se(Ye,{size:18})})]}),oa("label",{className:"chisel-color-hex",children:["HEX",se("input",{"aria-label":`${a} hex`,value:k,maxLength:9,spellCheck:!1,"aria-invalid":b,onChange:i=>{let m=i.target.value.replace(/^#/,"");w(m);let W=/^(?:[0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(m);if(g(!W),W){let q=ba(`#${m}`);S(q),r(`#${m}`)}}})]}),b&&se("span",{className:"chisel-color-error",role:"status",children:"Enter a valid hex color."})]}),document.body)]})}import{jsx as Et}from"react/jsx-runtime";import{useRef as yo}from"react";function ra({onMoveStart:a}){let t=yo(null);function r(o,l,f){let s=o.closest(".comment-box,.comment-thread"),p=s?.closest(".feedback-viewport");if(!s||!p)return;let L=p.getBoundingClientRect(),S=s.getBoundingClientRect();for(let[k,w]of[["x",Math.max(L.left+8-S.left,Math.min(l,L.right-8-S.right))],["y",Math.max(L.top+8-S.top,Math.min(f,L.bottom-8-S.bottom))]]){let b=`--comment-drag-${k}`;s.style.setProperty(b,`${(parseFloat(s.style.getPropertyValue(b))||0)+w}px`)}}return Et("button",{type:"button",className:"comment-window-drag","aria-label":"Move comment window",title:"Drag to move \xB7 Arrow keys to nudge",onPointerDown:o=>{!o.isPrimary||o.button!==0||(o.preventDefault(),a?.(),o.currentTarget.closest(".comment-box,.comment-thread")?.getAnimations().forEach(l=>l.cancel()),o.currentTarget.setPointerCapture(o.pointerId),t.current={id:o.pointerId,x:o.clientX,y:o.clientY},o.currentTarget.dataset.dragging="true")},onPointerMove:o=>{let l=t.current;!l||l.id!==o.pointerId||(r(o.currentTarget,o.clientX-l.x,o.clientY-l.y),l.x=o.clientX,l.y=o.clientY)},onPointerUp:o=>{o.currentTarget.hasPointerCapture(o.pointerId)&&o.currentTarget.releasePointerCapture(o.pointerId)},onLostPointerCapture:o=>{t.current=null,delete o.currentTarget.dataset.dragging},onKeyDown:o=>{let l={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]}[o.key];if(!l)return;o.preventDefault(),o.stopPropagation(),a?.();let f=o.shiftKey?40:10;r(o.currentTarget,l[0]*f,l[1]*f)},children:Et(Ze,{size:16,"aria-hidden":"true"})})}function zt(a,t,r,o){let l={[a]:t},f=r.find(s=>s!==a);if(!f||!r.includes(a))return l;if(r.includes("width")){let s=parseFloat(o.width)/parseFloat(o.height),p=parseFloat(t);if(!Number.isFinite(s)||s<=0||!Number.isFinite(p))return l;l[f]=`${a==="width"?p/s:p*s}px`}else l[f]=t;return l}var Nt=new Set(["color","background-color","opacity","font-family","font-size","font-weight","border-color","border-width","width","height",...["padding","margin"].flatMap(a=>["top","right","bottom","left"].map(t=>`${a}-${t}`))]);function Gt(a,t){let r={...a},o={...a};for(let l of Array.isArray(t)?t:[])!l||!Object.prototype.hasOwnProperty.call(a,l.property)||typeof l.before!="string"||typeof l.after!="string"||l.property!=="text"&&(!Nt.has(l.property)||!CSS.supports(l.property,l.after))||(r[l.property]=l.before,o[l.property]=l.after);return{initial:r,values:o}}function ka(a,t){if(!Array.isArray(t))return()=>{};let r=a.style,o=a.getAttribute("style"),l=a.textContent,f=!1;for(let p of t)!p||typeof p.after!="string"||(p.property==="text"&&!a.children.length?(a.textContent=p.after,f=!0):r&&Nt.has(p.property)&&CSS.supports(p.property,p.after)&&r.setProperty(p.property,p.after,"important"));let s=!1;return()=>{s||(s=!0,o===null?a.removeAttribute("style"):a.setAttribute("style",o),f&&!a.children.length&&(a.textContent=l))}}var Xt=[["Text color","color","color"],["Background","background-color","color"],["Opacity","opacity","number"],["Font","font-family","font"],["Font size","font-size","number"],["Font weight","font-weight","weight"],["Border color","border-color","color"],["Border width","border-width","number"]],Ao=["top","bottom","left","right"],Vt=[{label:"Size",pairs:[["width","height"]]},...["padding","margin"].map(a=>({label:a[0].toUpperCase()+a.slice(1),pairs:[[`${a}-top`,`${a}-bottom`],[`${a}-left`,`${a}-right`]]}))];function Do(a){let t=a.ownerDocument.defaultView.getComputedStyle(a);return Object.fromEntries([["text",a.children.length?"":a.textContent??""],...["width","height"].map(r=>[r,t.getPropertyValue(r)]),...Xt.map(([,r])=>[r,t.getPropertyValue(r)]),...["padding","margin"].flatMap(r=>Ao.map(o=>[`${r}-${o}`,t.getPropertyValue(`${r}-${o}`)]))])}function Oa({target:a,text:t,onText:r,onCancel:o,onPost:l,style:f,changes:s=[],editing:p=!1,commentId:L,renderComposer:S,hasExistingAttachments:k=!1,onDraftChange:w,hidden:b=!1}){let[g]=he(()=>Gt(Do(a),s)),M=g.initial,[F,G]=he(g.values),[V]=he(()=>({style:a.getAttribute("style"),text:a.textContent})),[J,D]=he({}),[H,i]=he(!1),[m]=he(t),[W,q]=he(!1),[ee,O]=he(""),[ae,xe]=he(!1),te=Po();function N(){V.style===null?a.removeAttribute("style"):a.setAttribute("style",V.style),a.children.length||a.replaceChildren(a.ownerDocument.createTextNode(V.text??""))}function we(){N(),o()}Wt(()=>(ka(a,s),N),[a,V]);function le(R,j){if(R==="text"){G(v=>({...v,text:j})),a.children.length||a.replaceChildren(a.ownerDocument.createTextNode(j));return}let X=Vt.flatMap(v=>v.pairs).find(v=>v.includes(R)&&J[v.join(":")]),re=X?zt(R,j,X,M):{[R]:j};G(v=>({...v,...re}));for(let[v,h]of Object.entries(re))CSS.supports(v,h)&&a.style.setProperty(v,h,"important")}let Me=Object.entries(F).some(([R,j])=>j!==M[R]),Z=!!(t.trim()||Me||W||p&&t!==m);Wt(()=>(w?.(Z),()=>w?.(!1)),[Z,w]);async function Oe(R=t,j,X,re){if(H||!R.trim()&&!X?.length&&!k)return!1;let v=Object.entries(F).filter(([h,y])=>y!==M[h]).map(([h,y])=>({property:h,before:M[h],after:y}));if(v.some(h=>h.property!=="text"&&!CSS.supports(h.property,h.after)))return O("Check the style values before posting."),!1;i(!0),O("");try{let h=await l(v,R.trimEnd(),j,X,re);return h?we():O("Could not post. Your changes are still here; please try again."),h}catch{return O("Could not post. Please try again."),!1}finally{i(!1)}}let Q=(R,j=!1,X=!1,re)=>_(vo,{children:[_("div",{className:"comment-box-prompt",children:[B("button",{type:"button",className:"comment-box-symbol","aria-label":"Comment settings",title:"Comment settings","aria-expanded":ae,"aria-controls":te,disabled:H,onClick:()=>xe(v=>!v),children:B(De,{})}),R]}),_("div",{className:"comment-box-settings",id:te,hidden:!ae,children:[_("div",{className:"comment-box-element",children:[_("code",{children:["<",a.tagName.toLowerCase(),">"]}),Me&&B("span",{className:"comment-box-preview-status",role:"status",children:"Unsaved preview"}),B(ra,{})]}),_("fieldset",{className:"comment-box-properties",disabled:H||!ae,children:[_("label",{className:"comment-box-row",children:[B("span",{children:"Text"}),B("input",{"aria-label":"Element text",value:F.text,disabled:!!a.children.length,title:a.children.length?"Select a text-only element to change its text":void 0,onChange:v=>le("text",v.target.value)})]}),["Typography","Appearance"].map(v=>_("div",{className:"comment-box-control-group",children:[B("h3",{children:v}),Xt.filter(([,h])=>v==="Typography"===["color","font-family","font-size","font-weight"].includes(h)).map(([h,y,ne])=>_("div",{className:"comment-box-row",children:[B("span",{children:h}),ne==="color"?ae&&B(Ha,{label:h,value:F[y],disabled:H,onChange:P=>le(y,P)}):ne==="font"?B("select",{"aria-label":h,value:F[y],onChange:P=>le(y,P.target.value),children:Array.from(new Set([M[y],"Arial, sans-serif","Georgia, serif","system-ui","monospace"])).map(P=>B("option",{value:P,children:P},P))}):ne==="weight"?B("select",{"aria-label":h,value:F[y],onChange:P=>le(y,P.target.value),children:Array.from(new Set([M[y],...[100,200,300,400,500,600,700,800,900].map(String)])).map(P=>B("option",{children:P},P))}):_("div",{className:"comment-box-number",children:[B("input",{type:"number","aria-label":h,value:Number.isFinite(parseFloat(F[y]))?parseFloat(F[y]):"",min:0,max:y==="opacity"?1:void 0,step:"any",onChange:P=>le(y,P.target.value+(y==="opacity"?"":"px"))}),y!=="opacity"&&B("span",{children:"px"})]})]},y))]},v)),Vt.map(v=>_("details",{className:"comment-box-group",open:!0,children:[_("summary",{children:[v.label,B(Ae,{size:12,"aria-hidden":"true"})]}),v.pairs.map(h=>{let y=h.join(":"),ne=v.label==="Size"?"Lock aspect ratio":`Link ${v.label.toLowerCase()} ${h[0].split("-")[1]} and ${h[1].split("-")[1]}`;return _("div",{className:"comment-box-pair",children:[B("button",{className:"comment-box-link",type:"button","aria-label":ne,title:ne,"aria-pressed":!!J[y],onClick:()=>D(P=>({...P,[y]:!P[y]})),children:B(je,{size:12})}),h.map(P=>{let ia=P.includes("-")?P.split("-")[1]:P;return _("label",{className:"comment-box-row",children:[B("span",{children:ia[0].toUpperCase()+ia.slice(1)}),_("span",{className:"comment-box-number",children:[B("input",{type:"number",step:"any",min:P.startsWith("margin-")?void 0:0,"aria-label":P.replace("-"," ").replace(/^width$/,"Width").replace(/^height$/,"Height"),value:Number.isFinite(parseFloat(F[P]))?parseFloat(F[P]):"",onChange:ue=>le(P,`${ue.target.value}px`)}),B("span",{children:"px"})]})]},P)})]},y)})]},v.label))]})]}),ee&&B("p",{className:"comment-box-error",role:"alert",children:ee}),_("footer",{className:"comment-box-footer",children:[B("button",{type:"button",className:"comment-box-cancel",onClick:we,disabled:H,children:"Cancel"}),B("span",{}),re,B("button",{type:"submit",className:"comment-box-submit","aria-label":p?"Save comment":"Post comment",title:p?"Save comment":"Post comment",disabled:H||X||!t.trim()&&!j&&!k,children:H?B("span",{className:"comment-box-saving"}):B(Pe,{})})]})]}),Ee=`comment-box${S?" comment-box-native":""}`,ye=R=>{R.key==="Escape"&&!H&&(R.preventDefault(),R.stopPropagation(),we())};return S?B("div",{className:Ee,hidden:b,"data-settings-open":ae,style:f,onKeyDown:ye,children:S({text:t,onText:r,disabled:H,commentId:L,onAttachmentDraftChange:q,onSubmit:Oe,renderContent:Q})}):B("form",{className:Ee,hidden:b,"data-settings-open":ae,style:f,"aria-label":p?"Edit comment":"New comment",onKeyDown:ye,onSubmit:R=>{R.preventDefault(),Oe()},children:Q(B("input",{"aria-label":"Comment",placeholder:"Leave a comment\u2026",value:t,onChange:R=>r(R.target.value),autoFocus:!0,maxLength:4e3,required:!0,disabled:H}))})}import{jsx as fe,jsxs as da}from"react/jsx-runtime";import{useEffect as Bo,useLayoutEffect as Mo,useRef as Sa,useState as wa}from"react";function Be(a,t,r="/"){if(!a.trim())return null;try{let o=new URL(a.trim(),new URL(r,t)),l=decodeURIComponent(o.pathname);return!/^https?:$/.test(o.protocol)||o.origin!==t||o.username||o.password||/^\/(chisel|feedback)(\/|$)/.test(l)?null:o.pathname+o.search+o.hash}catch{return null}}function Ea(a){return a.split(/[?#]/,1)[0]}function za(a){try{let{pathname:t,search:r,hash:o}=a.location;return t.startsWith("/")?t+r+o:null}catch{return null}}function Kt(a,t){let r;try{r=a.history}catch{return()=>{}}let o=r.pushState,l=r.replaceState,f=!0,s=()=>{let S=za(a);f&&S!==null&&t(S)},p=function(...S){o.apply(this,S),s()},L=function(...S){l.apply(this,S),s()};return r.pushState=p,r.replaceState=L,a.addEventListener("popstate",s),a.addEventListener("hashchange",s),s(),()=>{f=!1,r.pushState===p&&(r.pushState=o),r.replaceState===L&&(r.replaceState=l),a.removeEventListener("popstate",s),a.removeEventListener("hashchange",s)}}function Na({path:a,routes:t,disabled:r,onNavigate:o,onOpen:l}){let f=Sa(null),s=Sa(null),p=Sa(null),L=Sa(!1),[S,k]=wa(!1),[w,b]=wa(a),[g,M]=wa(!1),[F,G]=wa(""),V=Ea(a),J=[...new Set([a,...t].map(Ea))];function D(i=!1){f.current&&(f.current.open=!1),k(!1),i&&s.current?.focus({preventScroll:!0})}Mo(()=>{if(!S)return;let i=()=>{let m=f.current,W=m?.closest(".feedback-sidebar-panel");m&&W&&m.style.setProperty("--feedback-page-space",`${Math.max(0,m.getBoundingClientRect().top-W.getBoundingClientRect().top-12)}px`)};return i(),p.current?.focus(),p.current?.select(),window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[S]),Bo(()=>{if(!S)return;let i=q=>{!L.current&&!f.current?.contains(q.target)&&D()},m=q=>{q.key!=="Escape"||L.current||(q.preventDefault(),q.stopPropagation(),D(!0))},W=()=>{L.current||D()};return document.addEventListener("pointerdown",i),document.addEventListener("keydown",m,!0),window.addEventListener("blur",W),()=>{document.removeEventListener("pointerdown",i),document.removeEventListener("keydown",m,!0),window.removeEventListener("blur",W)}},[S]);async function H(i){if(!(r||L.current)){L.current=!0,M(!0),G("");try{await o(i)&&D(!0)}catch(m){G(m instanceof Error&&m.message?m.message:"This page could not be opened. Try again.")}finally{L.current=!1,M(!1)}}}return da("details",{ref:f,className:"feedback-page-control",onToggle:i=>k(i.currentTarget.open),children:[da("summary",{ref:s,"aria-label":`Current page: ${a}`,"aria-disabled":r||g,tabIndex:r||g?-1:0,onClick:i=>{i.preventDefault(),!(r||g||!f.current)&&(f.current.open?D():(b(a),G(""),l?.(),f.current.open=!0,k(!0)))},children:[fe($e,{"aria-hidden":"true"}),fe("span",{title:a,children:a}),fe(Xe,{className:"feedback-page-chevron","aria-hidden":"true"})]}),da("div",{className:"feedback-page-popover",children:[da("form",{className:"feedback-page-form",onSubmit:i=>{i.preventDefault(),H(w)},children:[fe("input",{ref:p,"aria-label":"Page URL or path",value:w,placeholder:"Enter a URL or path",autoComplete:"off",autoCapitalize:"off",spellCheck:!1,disabled:r||g,onChange:i=>{b(i.target.value),G("")}}),fe("button",{type:"submit","aria-label":"Go to page",title:"Go to page","aria-busy":g,disabled:r||g||!w.trim(),children:fe(We,{"aria-hidden":"true"})})]}),F&&fe("p",{className:"feedback-page-error",role:"alert",children:F}),fe("nav",{className:"feedback-page-routes","aria-label":"Known pages",children:J.map(i=>da("button",{type:"button",title:i,"aria-current":i===V?"page":void 0,disabled:r||g,onClick:()=>{i===V?D(!0):H(i)},children:[fe("span",{children:i}),i===V&&fe(Pe,{"aria-hidden":"true"})]},i))})]})]})}import{jsx as la,jsxs as $t}from"react/jsx-runtime";import{useEffect as Zt,useRef as Ga,useState as Fo}from"react";function Ro({request:a,finish:t,returnFocus:r}){let o=Ga(null);return Zt(()=>(o.current?.showModal(),()=>r?.focus({preventScroll:!0})),[]),$t("dialog",{ref:o,className:"feedback-confirmation","aria-labelledby":"feedback-confirmation-title","aria-describedby":"feedback-confirmation-description",onCancel:l=>{l.preventDefault(),t(!1)},children:[la("h2",{id:"feedback-confirmation-title",children:a.title}),la("p",{id:"feedback-confirmation-description",children:a.description}),$t("div",{children:[la("button",{type:"button",autoFocus:!0,onClick:()=>t(!1),children:"Cancel"}),la("button",{type:"button","data-danger":a.danger,onClick:()=>t(!0),children:a.action})]})]})}function jt(){let[a,t]=Fo(null),r=Ga(null),o=Ga(null);Zt(()=>()=>o.current?.(!1),[]);function l(s){o.current?.(s),o.current=null,t(null)}function f(s){return o.current?Promise.resolve(!1):(r.current=document.activeElement,t(s),new Promise(p=>{o.current=p}))}return{confirm:f,dialog:a&&la(Ro,{request:a,finish:l,returnFocus:r.current})}}function _t(a){if(!(a.defaultPrevented||a.repeat||a.isComposing||a.ctrlKey||a.metaKey||a.altKey||a.composedPath().some(r=>{let o=r;return o.nodeType===1&&(o.isContentEditable||o.closest('input,textarea,select,[role="textbox"],[role="combobox"],[contenteditable]:not([contenteditable="false"])'))})))switch(a.key.toLowerCase()){case"c":return a.shiftKey?"toggle-comments":"comment";case"e":return"edit";case"v":return"view"}}function Jt(a){let t,r=()=>clearTimeout(t);return{cancel:r,schedule(){r(),t=setTimeout(a,70)}}}function Qt(a,t,r){let p=(G,V)=>Math.max(8,Math.min(G,V)),L=a.x+36+8,S=a.x+-4-8-t.width,k=r.width-t.width-8,w=Math.max(0,r.height-16);if(L<=k||S>=8)return{left:p(L<=k?L:S,k),top:p(a.y,r.height-Math.min(t.height,w)-8),maxHeight:w};let b=p(a.y+36+8,r.height-8),g=p(a.y+-4-8,r.height-8),M=r.height-b-8,F=g-8;return M>=F?{left:p(a.x+-4,k),top:b,maxHeight:M}:{left:p(a.x+-4,k),top:g-Math.min(t.height,F),maxHeight:F}}var ya=new WeakMap;function va(a,t=!1,r){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches||!a.animate)return r?.cancel(),null;let o=r?.playState==="running",l=window.getComputedStyle(a);if(a.dataset.expanded==="true"){let b={opacity:0,transform:"translateY(4px)"},g={opacity:1,transform:"translateY(0px)"},M=o?{opacity:l.opacity,transform:l.transform}:t?g:b;return r?.cancel(),a.animate([M,t?b:g],{duration:t?100:140,easing:"cubic-bezier(.4,0,.2,1)"})}let f=a.querySelector(".feedback-hover-preview"),s=ya.get(a)??{width:a.offsetWidth,height:a.offsetHeight,content:f,contentWidth:f?.style.width??""},p={width:`${(Number(a.dataset.pinWidth)||40)-8}px`,height:"32px",opacity:0,transform:`translate(${Number(a.dataset.pinX)-a.offsetLeft}px, ${Number(a.dataset.pinY)-a.offsetTop}px)`,borderRadius:"16px 16px 16px 0px"},L={width:`${s.width}px`,height:`${s.height}px`,opacity:1,transform:"translate(0px, 0px)",borderRadius:l.borderRadius},S=o?{width:l.width,height:l.height,opacity:l.opacity,transform:l.transform,borderRadius:l.borderRadius}:t?L:p;f&&(f.style.width=`${s.width-(parseFloat(l.borderLeftWidth)||0)-(parseFloat(l.borderRightWidth)||0)}px`),r?.cancel();let k=a.animate([{...S,overflow:"hidden"},{...t?p:L,overflow:"hidden"}],{duration:t?120:140,easing:"cubic-bezier(.4,0,.2,1)",fill:t?"forwards":"none"});s.animation=k,ya.set(a,s);let w=()=>{ya.get(a)?.animation===k&&(s.content&&(s.content.style.width=s.contentWidth),ya.delete(a))};return k.finished.then(()=>{t||w()},w),k}import{jsx as To}from"react/jsx-runtime";var Yt=`
|
|
2
|
+
:is(.chisel-root,.feedback-shell,.chisel-sign-in,.chisel-color-picker,.comment-box) :focus{outline:none}
|
|
3
|
+
.chisel-root,.feedback-shell,.chisel-sign-in,.chisel-color-picker,.comment-box{color-scheme:light;--chisel-ui-panel-shadow:0 4px 20px rgba(0,0,0,.08);--chisel-ui-canvas:#f7f7f7;--chisel-ui-surface:#ffffff;--chisel-ui-raised:#f5f5f5;--chisel-ui-inset:#eeeeee;--chisel-ui-hover:#f0f0f0;--chisel-ui-selected:#eaeaea;--chisel-ui-border:#e2e2e2;--chisel-ui-border-strong:#c4c4c4;--chisel-ui-text:#242424;--chisel-ui-secondary:#626262;--chisel-ui-muted:#686868;--chisel-ui-focus:#2468d3;--chisel-ui-accent-text:#2468d3;--chisel-ui-accent-surface:#edf4ff;--chisel-ui-action:#242424;--chisel-ui-action-text:#ffffff;--chisel-ui-danger:#b33737;--chisel-ui-avatar:#ededed;--chisel-ui-avatar-text:#565656;--chisel-ui-scrollbar:#c2c2c2;--chisel-ui-checker-light:#e5e5e5;--chisel-ui-checker-dark:#c7c7c7;}
|
|
4
|
+
@media(prefers-color-scheme:dark){.chisel-root,.feedback-shell,.chisel-sign-in,.chisel-color-picker,.comment-box{color-scheme:dark;--chisel-ui-panel-shadow:0 4px 20px #0003;--chisel-ui-canvas:#171717;--chisel-ui-surface:#222222;--chisel-ui-raised:#2a2a2a;--chisel-ui-inset:#191919;--chisel-ui-hover:#303030;--chisel-ui-selected:#383838;--chisel-ui-border:#3c3c3c;--chisel-ui-border-strong:#555555;--chisel-ui-text:#ededed;--chisel-ui-secondary:#b7b7b7;--chisel-ui-muted:#a5a5a5;--chisel-ui-focus:#8bb9ff;--chisel-ui-accent-text:#8bb9ff;--chisel-ui-accent-surface:#253447;--chisel-ui-action:#ededed;--chisel-ui-action-text:#111111;--chisel-ui-danger:#ffa5a5;--chisel-ui-avatar:#383838;--chisel-ui-avatar-text:#cccccc;--chisel-ui-scrollbar:#50504d;--chisel-ui-checker-light:#555555;--chisel-ui-checker-dark:#333333;}
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.chisel-root,.feedback-shell,.chisel-sign-in,.chisel-color-picker,.comment-box{--chisel-ui-font:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;--chisel-ui-space:4px;--chisel-ui-control:40px;--chisel-ui-radius:8px;--chisel-ui-text-size:13px;--chisel-ui-small:12px;--chisel-ui-motion:120ms cubic-bezier(.2,0,0,1);--chisel-ui-popover-shadow:0 2px 6px #0000000f,0 12px 36px #0000001f;}
|
|
8
|
+
@media(prefers-color-scheme:dark){.chisel-root,.feedback-shell,.chisel-sign-in,.chisel-color-picker,.comment-box{--chisel-ui-popover-shadow:0 0 0 1px #ffffff0d,0 4px 12px #0003,0 16px 40px #0004;}}
|
|
9
|
+
`;var qo=`
|
|
10
|
+
.feedback-confirmation{width:360px;max-width:calc(100vw - 32px);padding:24px;border:0;border-radius:16px;background:var(--chisel-ui-surface);color:var(--chisel-ui-text);box-shadow:var(--chisel-ui-popover-shadow);font:14px var(--chisel-ui-font)}
|
|
11
|
+
.feedback-confirmation::backdrop{background:#0005}
|
|
12
|
+
.feedback-confirmation h2{margin:0 0 8px;font-size:16px;font-weight:600}
|
|
13
|
+
.feedback-confirmation p{margin:0;color:var(--chisel-ui-secondary);line-height:1.6;text-wrap:pretty}
|
|
14
|
+
.feedback-confirmation>div{display:flex;justify-content:flex-end;gap:8px;margin-top:24px}
|
|
15
|
+
.feedback-confirmation button{min-height:40px;padding:0 16px;border:0;border-radius:8px;background:var(--chisel-ui-raised);color:var(--chisel-ui-text)}
|
|
16
|
+
.feedback-confirmation button[data-danger=true]{background:var(--chisel-ui-danger);color:var(--chisel-ui-surface)}
|
|
17
|
+
|
|
18
|
+
${Yt}
|
|
19
|
+
.feedback-shell,.feedback-shell *{box-sizing:border-box}
|
|
20
|
+
.feedback-shell{font-synthesis:none;-webkit-font-smoothing:antialiased;position:fixed;inset:0;background:var(--chisel-ui-canvas);color:var(--chisel-ui-text);z-index:999999;font-family:var(--chisel-ui-font);font-size:13px;letter-spacing:0}
|
|
21
|
+
.feedback-avatar{overflow:hidden}
|
|
22
|
+
.feedback-account{position:relative}
|
|
23
|
+
.feedback-account summary{list-style:none;cursor:pointer;display:flex;align-items:center;justify-content:center;min-width:40px;min-height:40px}
|
|
24
|
+
.feedback-account summary::-webkit-details-marker{display:none}
|
|
25
|
+
.feedback-account>div{position:absolute;right:0;top:44px;z-index:20;background:var(--chisel-ui-surface);color:var(--chisel-ui-text);border:0;box-shadow:var(--chisel-ui-popover-shadow);border-radius:12px;padding:16px;min-width:220px;max-width:calc(100vw - 32px);display:flex;flex-direction:column;gap:8px;overflow-wrap:anywhere}
|
|
26
|
+
.feedback-account[open]>div{transform-origin:top right;animation:chisel-account-in 160ms cubic-bezier(.2,0,0,1)}
|
|
27
|
+
@keyframes chisel-account-in{from{opacity:0;transform:translateY(-4px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}
|
|
28
|
+
@media(prefers-reduced-motion:reduce){.feedback-account[open]>div{animation:none}}
|
|
29
|
+
.feedback-account>div>span{color:var(--chisel-ui-muted);font-size:12px;line-height:1.5}
|
|
30
|
+
.feedback-account button:hover{background:var(--chisel-ui-hover)}
|
|
31
|
+
.feedback-account button{display:flex;align-items:center;gap:8px;color:var(--chisel-ui-text);background:transparent;border:0;min-height:40px;padding:8px;border-radius:8px}
|
|
32
|
+
.chisel-sign-in{min-height:100dvh;display:grid;place-items:center;padding:24px;background:var(--chisel-ui-canvas);color:var(--chisel-ui-text);font-family:var(--chisel-ui-font)}
|
|
33
|
+
.chisel-sign-in section{width:100%;max-width:360px;text-align:left}
|
|
34
|
+
.chisel-sign-in-brand{font-size:24px;letter-spacing:-.8px}
|
|
35
|
+
.chisel-sign-in h1{font-size:24px;font-weight:500;letter-spacing:-.4px;line-height:1.25;margin:32px 0 8px}
|
|
36
|
+
.chisel-sign-in p{font-size:14px;line-height:1.6;color:var(--chisel-ui-secondary);margin:12px 0 24px}
|
|
37
|
+
.chisel-sign-in button{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:44px;padding:12px;background:var(--chisel-ui-action);color:var(--chisel-ui-action-text);border:0;border-radius:8px;cursor:pointer}
|
|
38
|
+
.chisel-sign-in button:disabled{opacity:.5;cursor:not-allowed}
|
|
39
|
+
.chisel-sign-in a{display:inline-flex;align-items:center;min-height:40px;margin-top:16px;font-size:13px;color:var(--chisel-ui-secondary)}
|
|
40
|
+
.chisel-sign-in [role=alert]{color:var(--chisel-ui-danger)}
|
|
41
|
+
.chisel-spin{animation:chisel-spin 1s linear infinite}
|
|
42
|
+
@keyframes chisel-spin{to{transform:rotate(360deg)}
|
|
43
|
+
}
|
|
44
|
+
@media(prefers-reduced-motion:reduce){.chisel-spin{animation:none}
|
|
45
|
+
}
|
|
46
|
+
.feedback-sidebar[hidden]{display:none}
|
|
47
|
+
.feedback-comment-layer[hidden]{display:none}
|
|
48
|
+
.feedback-shell.comments-hidden .feedback-canvas{height:100%;flex:1}
|
|
49
|
+
.feedback-shell.is-editing .feedback-canvas{height:100%;flex:1}
|
|
50
|
+
.feedback-element-box{position:absolute;pointer-events:none;z-index:1;border:1px solid var(--chisel-ui-focus);background:color-mix(in srgb,var(--chisel-ui-focus) 4%,transparent);box-sizing:border-box}
|
|
51
|
+
.feedback-element-box.is-selected{border-width:2px;background:color-mix(in srgb,var(--chisel-ui-focus) 6%,transparent)}
|
|
52
|
+
.feedback-thread-popup{max-height:calc(100% - 16px);overflow:auto}
|
|
53
|
+
.feedback-thread-message,.feedback-thread-replies{overflow-wrap:anywhere;line-height:1.6;margin:0}
|
|
54
|
+
.feedback-thread-replies{max-height:140px;overflow:auto}
|
|
55
|
+
.feedback-thread-actions{display:flex;justify-content:space-between;align-items:center;margin-top:8px;gap:8px}
|
|
56
|
+
.feedback-thread-actions .feedback-resolve{margin:0;font-size:11px;padding:8px}
|
|
57
|
+
.feedback-composer-heading>button{display:grid;place-items:center;width:24px;height:24px;border-radius:4px}
|
|
58
|
+
.feedback-composer-heading>button:hover{background:var(--chisel-ui-raised)}
|
|
59
|
+
.feedback-shell button,.feedback-shell input,.feedback-shell textarea{font:inherit}
|
|
60
|
+
.feedback-shell button{cursor:pointer}
|
|
61
|
+
.feedback-shell button:disabled{cursor:not-allowed}
|
|
62
|
+
.feedback-shell :where(button,summary){-webkit-tap-highlight-color:transparent}
|
|
63
|
+
.feedback-workspace{display:flex;height:100%}
|
|
64
|
+
.feedback-canvas{position:relative;flex:1;min-width:0;padding:0}
|
|
65
|
+
.feedback-viewport{position:relative;height:100%;overflow:hidden;background:white;border:0;border-radius:0}
|
|
66
|
+
.feedback-viewport iframe{width:100%;height:100%;border:0;display:block}
|
|
67
|
+
.feedback-pin{position:absolute;transform:translate(-4px,-4px);width:40px;height:40px;display:grid;place-items:center;padding:8px;border-radius:50% 50% 50% 0;background:transparent;color:var(--chisel-ui-text);border:0;box-sizing:border-box;z-index:2}
|
|
68
|
+
.feedback-comment-layer[data-hover-preview=true] .feedback-pin:not(.selected){z-index:5}
|
|
69
|
+
.feedback-pin:before{content:"";position:absolute;inset:4px;border:1px solid var(--chisel-ui-border);border-radius:inherit;background:var(--chisel-ui-surface);box-shadow:0 2px 7px #0002;z-index:-1}
|
|
70
|
+
|
|
71
|
+
.feedback-pin .feedback-avatar{width:24px;height:24px;font-size:12px}
|
|
72
|
+
.feedback-pin-group{display:flex;width:auto;border-radius:20px 20px 20px 0}
|
|
73
|
+
.feedback-pin-group .feedback-avatar+.feedback-avatar{margin-left:-4px}
|
|
74
|
+
.feedback-pin .feedback-avatar img{width:100%;height:100%;object-fit:cover}
|
|
75
|
+
.feedback-pin .feedback-pin-more{font-size:9px;font-variant-numeric:tabular-nums}
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
.feedback-toolbar{position:absolute;z-index:2;bottom:17px;left:50%;transform:translateX(-50%);display:flex;padding:4px;gap:4px;background:var(--chisel-ui-surface);color:var(--chisel-ui-text);border:0;border-radius:999px;box-shadow:var(--chisel-ui-popover-shadow)}
|
|
79
|
+
.feedback-toolbar button{border:1px solid transparent;background:transparent;color:var(--chisel-ui-muted);height:var(--chisel-ui-control);padding:0 16px;display:inline-flex;align-items:center;justify-content:center;gap:8px;border-radius:999px;white-space:nowrap;transition:background-color var(--chisel-ui-motion),color var(--chisel-ui-motion),border-color var(--chisel-ui-motion)}
|
|
80
|
+
.feedback-toolbar button:hover{background:var(--chisel-ui-raised);color:var(--chisel-ui-text)}
|
|
81
|
+
.feedback-toolbar button[aria-pressed=true]{background:var(--chisel-ui-raised);color:var(--chisel-ui-text);border-color:transparent}
|
|
82
|
+
.feedback-collaboration{display:flex;align-items:center;gap:8px;min-height:32px;margin-bottom:8px;color:var(--chisel-ui-muted);font-size:12px}
|
|
83
|
+
.feedback-reviewers{display:flex;flex:1;min-width:0;overflow:hidden}
|
|
84
|
+
.feedback-reviewers .feedback-avatar{width:24px;height:24px}
|
|
85
|
+
.feedback-reviewers .feedback-avatar+.feedback-avatar{margin-left:-4px}
|
|
86
|
+
.feedback-reviewers img{width:100%;height:100%;object-fit:cover}
|
|
87
|
+
.feedback-unread-count,.feedback-unread-label{color:var(--chisel-ui-accent-text);font-size:12px;font-variant-numeric:tabular-nums}
|
|
88
|
+
.feedback-unread-label{display:inline}
|
|
89
|
+
@media(prefers-reduced-motion:reduce){.feedback-toolbar button,.feedback-comment{transition:none}
|
|
90
|
+
}
|
|
91
|
+
.feedback-shell button svg,.feedback-shell summary svg{width:16px;height:16px;stroke-width:1.75;flex-shrink:0}
|
|
92
|
+
.feedback-primary,.feedback-resolve,.feedback-thread form button{display:inline-flex;align-items:center;justify-content:center;gap:6px}
|
|
93
|
+
.feedback-sidebar{--feedback-panel-divider:var(--chisel-ui-border);--feedback-panel-shadow:var(--chisel-ui-panel-shadow);width:400px;flex-shrink:0;padding:0;background:transparent;color:var(--chisel-ui-text);border:0;display:flex;flex-direction:column;min-height:0;font-family:var(--chisel-ui-font);font-size:13px;letter-spacing:0;-webkit-font-smoothing:antialiased;color-scheme:inherit}
|
|
94
|
+
|
|
95
|
+
.feedback-sidebar-panel{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden;padding:16px 20px 0;border:0;border-radius:0;background:var(--chisel-ui-surface)}
|
|
96
|
+
.feedback-search{display:flex;align-items:center;gap:8px;min-height:40px;margin-bottom:8px;padding:0 8px;border-radius:8px;background:transparent;color:var(--chisel-ui-muted)}
|
|
97
|
+
.feedback-search svg{flex-shrink:0}
|
|
98
|
+
.feedback-shell .feedback-search input{min-width:0;min-height:40px;padding:0;border:0;background:transparent;font-size:13px}
|
|
99
|
+
.feedback-search input::placeholder{color:var(--chisel-ui-muted)}
|
|
100
|
+
.feedback-search:hover{background:var(--chisel-ui-raised)}
|
|
101
|
+
.feedback-page-control{position:relative;flex-shrink:0;margin:8px 0}
|
|
102
|
+
.feedback-page-control:last-child{margin-bottom:16px}
|
|
103
|
+
.feedback-page-control+.feedback-review-invite{padding-top:0}
|
|
104
|
+
.feedback-page-control>summary{display:flex;align-items:center;gap:8px;min-height:40px;padding:0 8px;border-radius:8px;list-style:none;color:var(--chisel-ui-secondary);cursor:pointer}
|
|
105
|
+
.feedback-page-control>summary::-webkit-details-marker{display:none}
|
|
106
|
+
.feedback-page-control>summary:hover,.feedback-page-control[open]>summary{background:var(--chisel-ui-raised);color:var(--chisel-ui-text)}
|
|
107
|
+
.feedback-page-control>summary[aria-disabled=true]{opacity:.5;cursor:default}
|
|
108
|
+
.feedback-page-control>summary>span,.feedback-page-routes button>span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;font:12px/20px ui-monospace,SFMono-Regular,monospace}
|
|
109
|
+
.feedback-page-chevron{transform:rotate(180deg);transition:transform var(--chisel-ui-motion)}
|
|
110
|
+
.feedback-page-control[open] .feedback-page-chevron{transform:rotate(0)}
|
|
111
|
+
.feedback-page-popover{position:absolute;bottom:calc(100% + 4px);left:0;right:0;z-index:30;display:flex;flex-direction:column;gap:6px;max-height:var(--feedback-page-space,320px);overflow:auto;padding:8px;border-radius:12px;background:var(--chisel-ui-surface);box-shadow:var(--chisel-ui-popover-shadow)}
|
|
112
|
+
.feedback-page-form{display:flex;flex-shrink:0;align-items:center;gap:4px;border-radius:8px;background:var(--chisel-ui-raised)}
|
|
113
|
+
.feedback-shell .feedback-page-form input{flex:1;min-width:0;min-height:40px;padding:0 10px;border:0;border-radius:8px;background:transparent;font-size:13px}
|
|
114
|
+
.feedback-page-form button{display:grid;place-items:center;flex-shrink:0;width:40px;min-height:40px;padding:0;border:0;border-radius:8px;background:transparent;color:var(--chisel-ui-text)}
|
|
115
|
+
.feedback-page-routes{display:flex;flex-direction:column;gap:2px;min-height:0;max-height:min(240px,30dvh);overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--chisel-ui-scrollbar) transparent}
|
|
116
|
+
.feedback-page-routes button{display:flex;align-items:center;gap:8px;width:100%;min-height:40px;padding:0 8px;border:0;border-radius:8px;background:transparent;color:var(--chisel-ui-secondary)}
|
|
117
|
+
.feedback-page-routes button[aria-current=page]{background:var(--chisel-ui-selected);color:var(--chisel-ui-text)}
|
|
118
|
+
.feedback-page-control button:hover{background:var(--chisel-ui-hover);color:var(--chisel-ui-text)}
|
|
119
|
+
.feedback-page-control button:disabled{opacity:.5}
|
|
120
|
+
.feedback-page-control button:active{transform:scale(.96)}
|
|
121
|
+
.feedback-page-error{margin:0;padding:4px 8px;color:var(--chisel-ui-danger);font-size:12px;line-height:1.5;overflow-wrap:anywhere}
|
|
122
|
+
@media(pointer:coarse){.feedback-page-control>summary,.feedback-page-control button,.feedback-shell .feedback-page-form input{min-height:44px}.feedback-page-form button{width:44px}}
|
|
123
|
+
@media(prefers-reduced-motion:reduce){.feedback-page-chevron{transition:none}}
|
|
124
|
+
.feedback-sidebar-title{min-height:40px;padding:0;margin-bottom:12px;border:0;display:flex;align-items:center;justify-content:space-between;gap:6px}
|
|
125
|
+
.feedback-sidebar h1{font:600 15px/22px var(--chisel-ui-font);letter-spacing:-.01em;margin:0;color:var(--chisel-ui-text)}
|
|
126
|
+
.feedback-sidebar h1 span{font:500 12px ui-monospace,SFMono-Regular,Menlo,monospace;font-variant-numeric:tabular-nums;margin-left:6px;color:var(--chisel-ui-muted)}
|
|
127
|
+
.feedback-avatar{width:27px;height:27px;background:var(--chisel-ui-avatar);color:var(--chisel-ui-avatar-text);border:0;display:inline-flex;justify-content:center;align-items:center;border-radius:50%;font-size:11px;flex-shrink:0}
|
|
128
|
+
.feedback-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));flex-shrink:0;gap:6px;margin:0 0 8px;padding:4px;border-radius:12px;background:var(--chisel-ui-raised)}
|
|
129
|
+
.feedback-tabs button{position:relative;min-width:0;min-height:40px;background:transparent;border:0;border-radius:8px;color:var(--chisel-ui-secondary);padding:0 12px;font-size:13px;font-weight:500;transition:background-color var(--chisel-ui-motion),color var(--chisel-ui-motion),box-shadow var(--chisel-ui-motion)}
|
|
130
|
+
.feedback-tabs button+button::before{content:"";position:absolute;left:-3.5px;top:50%;width:1px;height:16px;transform:translateY(-50%);background:var(--chisel-ui-border);pointer-events:none}
|
|
131
|
+
.feedback-tabs button:hover{background:var(--chisel-ui-hover);color:var(--chisel-ui-text)}
|
|
132
|
+
.feedback-tabs button[aria-pressed=true]{color:var(--chisel-ui-text);background:var(--chisel-ui-surface);box-shadow:0 1px 3px #0000000d,0 0 0 1px var(--chisel-ui-border)}
|
|
133
|
+
@media(prefers-reduced-motion:reduce){.feedback-tabs button{transition:none}}
|
|
134
|
+
.feedback-comment-list{flex:1;min-height:0;overflow:auto;padding:0;scrollbar-width:thin;scrollbar-color:var(--chisel-ui-scrollbar) transparent}
|
|
135
|
+
.feedback-comment{border:0;border-radius:8px;padding:16px 8px;margin-bottom:8px;background:transparent;transition:background-color var(--chisel-ui-motion)}
|
|
136
|
+
.feedback-comment:hover{background:var(--chisel-ui-raised)}
|
|
137
|
+
.feedback-comment.active{background:var(--chisel-ui-raised)}
|
|
138
|
+
.feedback-comment-main{display:flex;flex-direction:column;align-items:stretch;gap:8px;border:0;background:none;text-align:left;width:100%;min-height:40px;padding:0;color:inherit}
|
|
139
|
+
.feedback-comment-heading{display:flex;align-items:center;gap:10px}
|
|
140
|
+
.feedback-comment-identity{flex:1;min-width:0}
|
|
141
|
+
.feedback-comment-activity{display:flex;align-items:center;gap:8px;margin-left:38px;margin-top:4px}
|
|
142
|
+
.feedback-comment-heading>.feedback-avatar{width:28px;height:28px}
|
|
143
|
+
.feedback-comment-heading img{width:100%;height:100%;object-fit:cover}
|
|
144
|
+
.feedback-comment-avatars{display:flex;gap:4px}
|
|
145
|
+
.feedback-comment-avatars .feedback-avatar{width:20px;height:20px;font-size:10px}
|
|
146
|
+
.feedback-comment-avatars img{width:100%;height:100%;object-fit:cover}
|
|
147
|
+
.feedback-comment-unread-dot{width:8px;height:8px;flex-shrink:0;border-radius:50%;background:var(--chisel-ui-focus)}
|
|
148
|
+
.feedback-comment-status{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--chisel-ui-muted);font-size:12px;line-height:1.5}
|
|
149
|
+
.feedback-comment-meta{display:flex;align-items:baseline;gap:6px;flex-wrap:wrap;font-size:13px;line-height:1.5}
|
|
150
|
+
.feedback-comment-meta strong{font-weight:500;overflow-wrap:anywhere}
|
|
151
|
+
.feedback-comment-meta time{color:var(--chisel-ui-muted);font-size:12px;font-variant-numeric:tabular-nums}
|
|
152
|
+
.feedback-comment-body{display:block;margin-left:38px;line-height:1.5;overflow-wrap:anywhere;color:var(--chisel-ui-text);font-size:14px;white-space:pre-wrap}
|
|
153
|
+
.feedback-comment-reply-count{color:var(--chisel-ui-secondary);font-size:12px;line-height:1.5}
|
|
154
|
+
.feedback-comment-path{font:inherit;color:inherit}
|
|
155
|
+
.feedback-empty{padding:24px 8px;color:var(--chisel-ui-muted)}
|
|
156
|
+
.feedback-empty>span{display:none}
|
|
157
|
+
.feedback-empty h2{font:500 14px var(--chisel-ui-font);color:var(--chisel-ui-secondary);margin:0 0 6px}
|
|
158
|
+
.feedback-empty p{font-size:13px;line-height:1.6;color:var(--chisel-ui-muted);margin:0}
|
|
159
|
+
.feedback-review-invite{border:0;padding:16px 0;color:var(--chisel-ui-secondary)}
|
|
160
|
+
.feedback-review-invite summary{display:flex;align-items:center;gap:8px;list-style:none;cursor:pointer;font-size:13px;padding:10px 8px;min-height:40px;border-radius:8px}
|
|
161
|
+
.feedback-review-invite summary::-webkit-details-marker{display:none}
|
|
162
|
+
.feedback-review-invite[open]>summary svg{transform:rotate(90deg)}
|
|
163
|
+
.feedback-review-invite summary:hover{background:var(--chisel-ui-hover)}
|
|
164
|
+
.feedback-review-invite form{display:flex;flex-direction:column;gap:10px;margin-top:10px}
|
|
165
|
+
.feedback-review-invite .feedback-primary{width:100%;align-self:stretch}
|
|
166
|
+
.feedback-review-invite label{display:flex;flex-direction:column;gap:6px;font-size:11px}
|
|
167
|
+
.feedback-review-invite p{font-size:12px;line-height:1.5;margin:0}
|
|
168
|
+
.feedback-composer{position:absolute;z-index:3;width:288px;background:var(--chisel-ui-surface);padding:14px;border:0;border-radius:16px;box-shadow:var(--chisel-ui-popover-shadow);display:flex;flex-direction:column;gap:10px}
|
|
169
|
+
.feedback-composer-heading{display:flex;align-items:center;justify-content:space-between;font-weight:bold}
|
|
170
|
+
.feedback-composer-heading button{border:0;background:none;font-size:21px}
|
|
171
|
+
.feedback-shell input,.feedback-shell textarea{border:1px solid var(--chisel-ui-border);border-radius:4px;background:var(--chisel-ui-surface);color:var(--chisel-ui-text);padding:9px;width:100%;box-sizing:border-box}
|
|
172
|
+
.feedback-shell textarea{resize:none;min-height:70px}
|
|
173
|
+
.feedback-primary{min-height:40px;background:var(--chisel-ui-action);color:var(--chisel-ui-action-text);border:0;padding:0 12px;border-radius:8px;align-self:flex-end}
|
|
174
|
+
.feedback-thread{margin-top:16px}
|
|
175
|
+
.feedback-thread form button,.feedback-resolve{background:var(--chisel-ui-surface);border:1px solid var(--chisel-ui-border);border-radius:4px;padding:7px 10px;margin-top:8px}
|
|
176
|
+
.feedback-resolve{color:var(--chisel-ui-text)}
|
|
177
|
+
.feedback-reply{border-left:2px solid var(--chisel-ui-border);padding-left:10px}
|
|
178
|
+
.feedback-error{color:var(--chisel-ui-danger);padding:0 8px;margin:0 0 16px;line-height:1.5;font-size:13px}
|
|
179
|
+
.feedback-comment-list>p[role=status]{margin:0;padding:24px 8px;color:var(--chisel-ui-secondary);line-height:1.5;font-size:13px}
|
|
180
|
+
@media(max-width:760px){.feedback-workspace{flex-direction:column}
|
|
181
|
+
.feedback-canvas{height:48%;flex:none;padding:0}
|
|
182
|
+
.feedback-sidebar{width:100%;height:auto;flex:1;padding:0}
|
|
183
|
+
.feedback-sidebar-panel{border:0}
|
|
184
|
+
.feedback-sidebar-title{min-height:44px}
|
|
185
|
+
.feedback-tabs{margin-bottom:8px}
|
|
186
|
+
.feedback-tabs button{min-height:44px;padding:0 8px}
|
|
187
|
+
.feedback-empty{padding:12px}
|
|
188
|
+
.feedback-empty>span{display:none}
|
|
189
|
+
.feedback-toolbar{bottom:10px}
|
|
190
|
+
.feedback-comment{padding:14px 8px}
|
|
191
|
+
}
|
|
192
|
+
.comment-box{position:absolute;z-index:4;display:flex;flex-direction:column;width:344px;max-width:calc(100% - 16px);height:auto;max-height:calc(100% - 16px);padding:0;overflow:hidden;border:0;border-radius:16px;background:var(--chisel-ui-surface);color:var(--chisel-ui-text);box-shadow:var(--chisel-ui-popover-shadow);font:12px var(--chisel-ui-font);color-scheme:inherit}
|
|
193
|
+
.comment-box[data-settings-open=true]{height:440px}
|
|
194
|
+
.comment-box-settings{display:flex;flex-direction:column;flex:1;min-height:0}
|
|
195
|
+
.comment-box-settings[hidden]{display:none}
|
|
196
|
+
.comment-box[hidden],.comment-thread form[hidden]{display:none}
|
|
197
|
+
.comment-box-draft-pin{pointer-events:none}
|
|
198
|
+
.comment-box-prompt{display:flex;align-items:center;gap:9px;min-height:44px;padding:8px 12px;flex-shrink:0}
|
|
199
|
+
.comment-box-symbol{position:relative;border:0;padding:0;display:grid;place-items:center;background:transparent;border-radius:8px;width:40px;height:40px;flex-shrink:0}
|
|
200
|
+
|
|
201
|
+
.comment-box-symbol[aria-expanded=true]{background:var(--chisel-ui-selected)}
|
|
202
|
+
.comment-box-symbol:hover{background:var(--chisel-ui-hover)}
|
|
203
|
+
.comment-box-symbol svg{width:14px;height:14px;color:var(--chisel-ui-text)}
|
|
204
|
+
.comment-box .comment-box-prompt input{border:0;border-radius:0;background:none;box-shadow:none;padding:0;color:var(--chisel-ui-text);font:13px var(--chisel-ui-font);outline:none;width:100%;min-width:0}
|
|
205
|
+
.comment-box-prompt input::placeholder{color:var(--chisel-ui-muted)}
|
|
206
|
+
.comment-box-element{display:flex;align-items:center;justify-content:space-between;background:var(--chisel-ui-raised);color:var(--chisel-ui-muted);min-height:28px;padding:0 15px;flex-shrink:0}
|
|
207
|
+
.comment-box-element code{font:12px monospace}
|
|
208
|
+
.comment-box-element svg{color:var(--chisel-ui-muted)}
|
|
209
|
+
.comment-box,.comment-thread{translate:var(--comment-drag-x,0px) var(--comment-drag-y,0px)}
|
|
210
|
+
.feedback-shell .comment-window-drag{display:grid;place-items:center;flex-shrink:0;width:40px;height:40px;padding:0;border:0;border-radius:var(--chisel-ui-radius);background:transparent;color:var(--chisel-ui-muted);cursor:grab;touch-action:none;user-select:none}
|
|
211
|
+
.feedback-shell .comment-window-drag:hover{background:var(--chisel-ui-hover);color:var(--chisel-ui-text)}
|
|
212
|
+
.feedback-shell .comment-window-drag[data-dragging=true]{cursor:grabbing}
|
|
213
|
+
.comment-box-element .comment-window-drag{margin-left:auto;margin-right:-8px}
|
|
214
|
+
.feedback-thread-header>.comment-window-drag{margin-right:auto}
|
|
215
|
+
.comment-box-preview-status{margin-left:auto;margin-right:8px;font:12px var(--chisel-ui-font);color:var(--chisel-ui-accent-text)}
|
|
216
|
+
.comment-box-properties{flex:1;min-height:0;min-width:0;border:0;margin:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--chisel-ui-scrollbar) transparent;padding:4px 15px 9px;position:relative}
|
|
217
|
+
.comment-box-row{min-height:44px;display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px;color:var(--chisel-ui-secondary)}
|
|
218
|
+
.comment-box-row>span{white-space:nowrap}
|
|
219
|
+
.comment-box .comment-box-row input,.comment-box select{border:0;background:var(--chisel-ui-raised);color:var(--chisel-ui-secondary);border-radius:8px;min-width:0;width:128px;height:var(--chisel-ui-control);font:12px var(--chisel-ui-font);padding:4px 8px;text-overflow:ellipsis}
|
|
220
|
+
.comment-box input:disabled{opacity:.35}
|
|
221
|
+
.comment-box-number{display:flex;align-items:center;border:0;background:var(--chisel-ui-raised);border-radius:8px;width:128px;flex-shrink:0;height:var(--chisel-ui-control);padding-right:8px;color:var(--chisel-ui-muted)}
|
|
222
|
+
.comment-box .comment-box-number input{border:0;width:100%;height:40px;background:transparent;box-shadow:none}
|
|
223
|
+
.comment-box-number input::-webkit-inner-spin-button,.comment-box-spacing input::-webkit-inner-spin-button{-webkit-appearance:none}
|
|
224
|
+
.comment-box-number>span{font:11px monospace}
|
|
225
|
+
.comment-box select{appearance:auto}
|
|
226
|
+
.comment-box-color{display:flex;align-items:center;gap:8px;border:0;width:142px;height:var(--chisel-ui-control);border-radius:7px;padding:3px 4px;min-width:0}
|
|
227
|
+
.comment-color-trigger{position:relative;display:grid;place-items:center;width:24px;height:24px;flex-shrink:0;padding:0;border:0;border-radius:4px;background:repeating-conic-gradient(var(--chisel-ui-checker-light) 0% 25%,var(--chisel-ui-checker-dark) 0% 50%) 50%/8px 8px}
|
|
228
|
+
.comment-color-trigger:after{content:"";position:absolute;inset:-8px;border-radius:inherit}
|
|
229
|
+
.comment-color-trigger>span{display:block;width:100%;height:100%;border-radius:inherit;box-shadow:inset 0 0 0 1px var(--chisel-ui-border)}
|
|
230
|
+
@media(pointer:coarse){.comment-color-trigger:after{inset:-10px}}
|
|
231
|
+
.comment-color-value{font:12px monospace;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--chisel-ui-secondary)}
|
|
232
|
+
.chisel-color-picker,.chisel-color-picker *{box-sizing:border-box}
|
|
233
|
+
.chisel-color-picker{position:fixed;z-index:1000001;width:256px;max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);overflow:auto;padding:16px;border:0;border-radius:16px;background:var(--chisel-ui-surface);color:var(--chisel-ui-text);font:12px var(--chisel-ui-font);box-shadow:var(--chisel-ui-popover-shadow);color-scheme:inherit}
|
|
234
|
+
.chisel-color-plane{position:relative;height:160px;margin:0 0 14px;border-radius:10px;touch-action:none;cursor:crosshair;background-image:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,transparent)}
|
|
235
|
+
.chisel-color-thumb{position:absolute;width:19px;height:19px;border:2px solid #fff;border-radius:50%;transform:translate(-50%,-50%);pointer-events:none;box-shadow:0 1px 5px #0004}
|
|
236
|
+
.chisel-color-tools{display:flex;gap:12px;align-items:center;margin-bottom:14px}
|
|
237
|
+
.chisel-color-hue{appearance:none;-webkit-appearance:none;flex:1;min-width:0;height:40px;border:12px solid transparent;background-clip:padding-box;border-radius:20px;margin:0;background:linear-gradient(to right,red,#ff0,#0f0,#0ff,#00f,#f0f,red);cursor:pointer}
|
|
238
|
+
.chisel-color-hue::-webkit-slider-thumb{appearance:none;-webkit-appearance:none;width:20px;height:20px;border:2px solid #fff;border-radius:50%;background:var(--hue);box-shadow:0 1px 4px #0004}
|
|
239
|
+
.chisel-color-hue::-moz-range-thumb{width:16px;height:16px;border:2px solid #fff;border-radius:50%;background:var(--hue);box-shadow:0 1px 4px #0004}
|
|
240
|
+
.chisel-color-tools button{display:grid;place-items:center;flex-shrink:0;width:44px;height:40px;padding:0;background:var(--chisel-ui-raised);border:0;border-radius:8px;color:var(--chisel-ui-text);cursor:pointer}
|
|
241
|
+
.chisel-color-tools button:disabled{opacity:.35;cursor:not-allowed}
|
|
242
|
+
.chisel-color-hex{display:flex;flex-direction:column;gap:8px;color:var(--chisel-ui-secondary);font-size:11px}
|
|
243
|
+
.chisel-color-hex input{width:100%;height:40px;border:0;border-radius:8px;padding:7px 9px;background:var(--chisel-ui-raised);color:var(--chisel-ui-text);font:13px monospace}
|
|
244
|
+
.chisel-color-hex input[aria-invalid=true]{outline:2px solid var(--chisel-ui-danger)}
|
|
245
|
+
.chisel-color-error{display:block;color:var(--chisel-ui-danger);font-size:11px;margin-top:6px}
|
|
246
|
+
.chisel-color-accessible{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);border:0}
|
|
247
|
+
.comment-box-control-group{margin-top:20px}
|
|
248
|
+
.comment-box-control-group h3{font:500 12px/18px var(--chisel-ui-font);margin:0 0 8px;color:var(--chisel-ui-text)}
|
|
249
|
+
.comment-box-group{border:0;margin-top:20px;padding-top:0}
|
|
250
|
+
.comment-box-group summary{list-style:none;display:flex;align-items:center;gap:6px;min-height:40px;color:var(--chisel-ui-secondary);cursor:pointer}
|
|
251
|
+
.comment-box-group summary::-webkit-details-marker{display:none}
|
|
252
|
+
.comment-box-group[open] summary svg{transform:rotate(90deg)}
|
|
253
|
+
.comment-box-pair{position:relative;padding:2px 0}
|
|
254
|
+
.comment-box-pair .comment-box-row{min-height:44px}
|
|
255
|
+
.comment-box-link{position:absolute;left:42%;top:50%;transform:translate(-50%,-50%);border:0;background:var(--chisel-ui-surface);color:var(--chisel-ui-muted);border-radius:50%;width:40px;height:40px;display:grid;place-items:center;z-index:1}
|
|
256
|
+
.comment-box-link:before{content:none}
|
|
257
|
+
.comment-box-link svg{padding:0}
|
|
258
|
+
.comment-box-link:hover{background:var(--chisel-ui-hover)}
|
|
259
|
+
.comment-box-link[aria-pressed=true]{color:var(--chisel-ui-accent-text);background:var(--chisel-ui-accent-surface)}
|
|
260
|
+
.comment-box-link[aria-pressed=true]:before{border-color:var(--chisel-ui-focus)}
|
|
261
|
+
.comment-box-number{font-variant-numeric:tabular-nums}
|
|
262
|
+
.comment-box .comment-box-number input::-webkit-inner-spin-button{-webkit-appearance:none}
|
|
263
|
+
.comment-box-footer{height:56px;min-height:56px;display:flex;align-items:center;gap:8px;padding:8px;border:0}
|
|
264
|
+
.comment-box-footer>span{flex:1}
|
|
265
|
+
.comment-box-footer button{display:grid;place-items:center;border:0;background:none;color:var(--chisel-ui-text);height:40px;width:40px}
|
|
266
|
+
.comment-box-footer .comment-box-cancel:hover{background:var(--chisel-ui-hover)}
|
|
267
|
+
.comment-box-footer .comment-box-cancel{width:auto;padding:0 9px;font:13px var(--chisel-ui-font);border:0;border-radius:8px;background:transparent}
|
|
268
|
+
.comment-box-footer .comment-box-submit{width:40px;border-radius:8px;background:var(--chisel-ui-action);color:var(--chisel-ui-action-text)}
|
|
269
|
+
.comment-box-footer .comment-box-submit:disabled{opacity:.4;cursor:not-allowed}
|
|
270
|
+
.comment-box-error{margin:0;padding:0 12px 8px;flex-shrink:0;font-size:11px;line-height:1.5;color:var(--chisel-ui-danger)}
|
|
271
|
+
.comment-box-saving{width:12px;height:12px;border:1px solid var(--chisel-ui-border-strong);border-top-color:transparent;border-radius:50%;animation:chisel-spin 1s linear infinite}
|
|
272
|
+
.feedback-composer.comment-thread{width:400px;max-width:calc(100% - 16px);gap:0;border-radius:16px;background:var(--chisel-ui-surface);border-color:var(--chisel-ui-border);color:var(--chisel-ui-text);padding:0;box-shadow:var(--chisel-ui-popover-shadow);color-scheme:inherit;overflow:hidden auto;scrollbar-width:thin}
|
|
273
|
+
.feedback-thread-header{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:56px;padding:8px 12px 4px 20px;border:0;flex-shrink:0}
|
|
274
|
+
.comment-thread .feedback-thread-summary{width:100%;padding:16px}
|
|
275
|
+
.comment-thread .feedback-thread-summary:empty{display:none}
|
|
276
|
+
.comment-thread .feedback-thread-replies{width:100%;padding:0 16px}
|
|
277
|
+
.comment-thread form{width:100%;padding:16px}
|
|
278
|
+
.feedback-composer.comment-thread[data-expanded=false]{width:240px;max-width:calc(100% - 16px);border-radius:16px 16px 16px 0;overflow:hidden}
|
|
279
|
+
.feedback-thread-content{display:flex;flex-direction:column;flex-shrink:0;width:100%}
|
|
280
|
+
.feedback-thread-content[hidden]{display:none}
|
|
281
|
+
.feedback-hover-preview{display:flex;align-items:flex-start;gap:10px;flex-shrink:0;width:100%;padding:12px;border:0;border-radius:inherit;background:transparent;color:var(--chisel-ui-text);text-align:left;font:12px/16px var(--chisel-ui-font)}
|
|
282
|
+
.feedback-hover-preview>.feedback-avatar{width:24px;height:24px;font-size:12px}
|
|
283
|
+
.feedback-hover-preview img{width:100%;height:100%;object-fit:cover}
|
|
284
|
+
.feedback-hover-copy{flex:1;min-width:0}
|
|
285
|
+
.feedback-hover-byline{display:flex;align-items:baseline;gap:4px;white-space:nowrap;overflow:hidden}
|
|
286
|
+
.feedback-hover-byline strong{font-weight:500;overflow:hidden;text-overflow:ellipsis}
|
|
287
|
+
.feedback-hover-byline time{color:var(--chisel-ui-muted);font-size:11px;flex-shrink:0}
|
|
288
|
+
.feedback-hover-message{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}
|
|
289
|
+
.feedback-pin.selected:before{border-color:var(--chisel-ui-focus)}
|
|
290
|
+
.comment-thread .feedback-thread-summary,.comment-thread .feedback-thread-replies,.comment-thread form{width:100%;flex-shrink:0}
|
|
291
|
+
.comment-thread .feedback-preview{white-space:nowrap}
|
|
292
|
+
.feedback-thread-summary{display:flex;align-items:flex-start;gap:8px;flex-shrink:0}
|
|
293
|
+
.feedback-thread-summary-button{display:flex;align-items:flex-start;gap:10px;flex:1;min-width:0;border:0;padding:0;text-align:left;background:transparent;color:inherit}
|
|
294
|
+
.feedback-thread-summary-button>.feedback-avatar{width:26px;height:26px;flex-shrink:0;margin-top:1px;font-size:10px}
|
|
295
|
+
.feedback-thread-summary-copy{display:flex;flex-direction:column;gap:4px;min-width:0;flex:1}
|
|
296
|
+
.feedback-thread-byline{display:flex;align-items:baseline;gap:7px;min-width:0;flex-wrap:wrap}
|
|
297
|
+
.feedback-thread-byline strong{font-size:13px;font-weight:600;line-height:1.4;overflow-wrap:anywhere}
|
|
298
|
+
.feedback-thread-byline time{font-size:12px;color:var(--chisel-ui-muted);white-space:nowrap}
|
|
299
|
+
.feedback-thread-summary .feedback-thread-message{font-size:14px;line-height:1.5;color:var(--chisel-ui-text);overflow-wrap:anywhere}
|
|
300
|
+
.comment-thread[data-expanded=false] .feedback-thread-message{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
|
|
301
|
+
.feedback-thread-reply-count{font-size:12px;line-height:1.4;color:var(--chisel-ui-muted)}
|
|
302
|
+
.feedback-thread-close{display:grid;place-items:center;flex-shrink:0;width:24px;height:24px;border:0;border-radius:6px;background:none;color:var(--chisel-ui-muted);padding:4px}
|
|
303
|
+
.feedback-thread-header-actions{display:flex;gap:4px;flex-shrink:0}
|
|
304
|
+
.feedback-thread-header-actions .feedback-thread-close{position:relative;width:40px;height:40px}
|
|
305
|
+
|
|
306
|
+
.feedback-thread-header-actions .feedback-thread-delete:hover{color:var(--chisel-ui-danger)}
|
|
307
|
+
.feedback-thread-close:hover{background:var(--chisel-ui-hover);color:var(--chisel-ui-text)}
|
|
308
|
+
.feedback-thread-reply{display:flex;align-items:flex-start;gap:10px;padding:16px 0;border:0}
|
|
309
|
+
.feedback-thread-reply>.feedback-avatar{width:24px;height:24px;font-size:10px}
|
|
310
|
+
.feedback-thread-reply>div{flex:1;min-width:0}
|
|
311
|
+
.feedback-thread-reply strong{font-size:13px;font-weight:600}
|
|
312
|
+
.feedback-thread-reply p{font-size:14px;line-height:1.5;margin:4px 0 0;color:var(--chisel-ui-secondary)}
|
|
313
|
+
.comment-thread form{padding-top:16px;border:0}
|
|
314
|
+
.feedback-shell .comment-thread textarea{background:var(--chisel-ui-raised);color:var(--chisel-ui-text);border:1px solid var(--chisel-ui-border);border-radius:9px;min-height:40px;max-height:min(240px,40dvh);padding:10px 12px;font-size:14px;line-height:1.5;resize:none;overflow-y:auto}
|
|
315
|
+
.comment-thread .feedback-thread-actions{margin-top:6px}
|
|
316
|
+
.comment-thread .feedback-primary{border-radius:50%;width:40px;height:40px;padding:0;font-size:0;background:var(--chisel-ui-action);color:var(--chisel-ui-action-text);margin:0;transition:opacity 150ms,transform 150ms}
|
|
317
|
+
.comment-thread .feedback-primary:disabled{opacity:.35;cursor:not-allowed}
|
|
318
|
+
.comment-thread .feedback-primary:not(:disabled):active{transform:scale(.96)}
|
|
319
|
+
.comment-thread .feedback-resolve{background:transparent;color:var(--chisel-ui-secondary);border:0;border-radius:6px;padding:6px;font-size:12px;min-height:40px}
|
|
320
|
+
.comment-thread .feedback-resolve:hover{background:var(--chisel-ui-hover);color:var(--chisel-ui-text)}
|
|
321
|
+
@media(prefers-reduced-motion:reduce){.comment-thread .feedback-primary{transition:none}}
|
|
322
|
+
@media(prefers-reduced-motion:reduce){.comment-box-saving{animation:none}
|
|
323
|
+
}
|
|
324
|
+
.comment-thread .feedback-preview{display:inline-flex;align-items:center;gap:6px;align-self:flex-start;min-height:40px;margin-left:36px;padding:5px 9px;border:1px solid var(--chisel-ui-border);border-radius:6px;background:var(--chisel-ui-raised);color:var(--chisel-ui-secondary);font-size:11px}
|
|
325
|
+
.comment-thread .feedback-preview[aria-pressed=true]{border-color:var(--chisel-ui-focus);background:var(--chisel-ui-accent-surface)}
|
|
326
|
+
.comment-thread .feedback-preview:disabled{opacity:.5;cursor:not-allowed}
|
|
327
|
+
.feedback-proposal-actions{display:flex;align-items:center;flex-wrap:wrap;gap:4px;padding:0 12px 8px}
|
|
328
|
+
.comment-thread .feedback-proposal-actions .feedback-preview{margin:0;padding:0 8px;border:0;border-radius:8px;background:transparent;font-size:12px;min-height:40px}
|
|
329
|
+
.comment-thread .feedback-proposal-actions .feedback-preview:hover{background:var(--chisel-ui-hover);color:var(--chisel-ui-text)}
|
|
330
|
+
.comment-thread .feedback-proposal-actions .feedback-preview[aria-pressed=true]{background:var(--chisel-ui-accent-surface);color:var(--chisel-ui-accent-text)}
|
|
331
|
+
@media(pointer:coarse){.feedback-toolbar button{height:44px}.feedback-tabs button,.feedback-account summary{min-width:44px}.feedback-review-invite summary{min-height:44px}.feedback-pin:after{content:"";position:absolute;inset:-2px;border-radius:inherit}.feedback-account summary,.feedback-review-invite button,.feedback-shell .feedback-primary{min-height:44px}.feedback-shell .comment-window-drag,.feedback-thread-header-actions .feedback-thread-close{width:44px;height:44px}.comment-box-footer{height:60px;min-height:60px}.comment-box-footer button{height:44px;width:44px}.comment-box-footer .comment-box-submit{width:44px}}
|
|
332
|
+
@media(forced-colors:active){.feedback-sidebar-panel,.comment-box,.feedback-composer.comment-thread,.feedback-confirmation,.feedback-account>div{border:1px solid CanvasText;box-shadow:none;background:Canvas;color:CanvasText}.feedback-shell button[aria-pressed=true]{outline:1px solid Highlight;outline-offset:-2px}.feedback-shell input,.feedback-shell textarea,.comment-box-number{border:1px solid CanvasText}.feedback-avatar{border:1px solid CanvasText}}
|
|
333
|
+
|
|
334
|
+
`;function Wa(){return To("style",{children:qo})}function Va(a,t){if(t.type==="create")return t.comment;let r=a.find(o=>o.id===t.id);if(!r)throw new Error("This comment no longer exists. Reload and try again.");switch(t.type){case"edit":return{...r,text:t.text,changes:t.changes};case"resolve":return{...r,resolved:t.resolved};case"reply":return{...r,replies:[...r.replies,t.reply]}}}function ua(a,t){return a.some(r=>r.id===t.id)?a.map(r=>r.id===t.id?t:r):[...a,t]}function Pa(a,t){return a.filter(r=>r.id!==t)}function Aa(a){let t=new Map;for(let r of[a,...a.replies]){if(typeof r=="string")continue;let o=r.authorId?`id:${r.authorId}`:`name:${r.author}`;t.has(o)||t.set(o,{author:r.author,authorImage:r.authorImage})}return[...t.values()]}function eo(a,t,r){let o=r.trim().toLocaleLowerCase();return a.filter(l=>(t==="all"||l.resolved===(t==="resolved"))&&[l.text,l.author,l.path,...(l.attachments??[]).map(f=>f.name),...l.replies.map(f=>typeof f=="string"?f:`${f.author} ${f.text}`)].some(f=>f.toLocaleLowerCase().includes(o)))}function ao(a,t=Date.now()){let r=Math.max(0,t-Date.parse(a));if(!Number.isFinite(r))return"";if(r<6e4)return"Just now";let[o,l]=r<36e5?["minute",6e4]:r<864e5?["hour",36e5]:["day",864e5];return new Intl.RelativeTimeFormat(void 0,{numeric:"always"}).format(-Math.floor(r/l),o)}var Xa="chisel-feedback-v1",Ba=process.env.NODE_ENV!=="production";function to(a,t){let r=`<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 40 40"><defs><filter id="shadow" x="-25%" y="-25%" width="150%" height="150%"><feDropShadow dx="0" dy="2" stdDeviation="2" flood-opacity=".16"/></filter></defs><path d="M4 20a16 16 0 1 1 16 16H4Z" fill="${a}" stroke="${t}" filter="url(#shadow)"/></svg>`;return`url("data:image/svg+xml,${encodeURIComponent(r)}") 3 3, crosshair`}function oo(a){for(let r of["data-chisel-id","data-ai-edit","data-component","id"]){let o=a.getAttribute(r);if(o){let l=`[${r}="${CSS.escape(o)}"]`,f=a.ownerDocument.querySelectorAll(l);if(f.length===1&&f[0]===a)return l}}let t=a.parentElement;return t?`${oo(t)} > :nth-child(${Array.from(t.children).indexOf(a)+1})`:a.tagName.toLowerCase()}function ro({user:a,validateSession:t,signOut:r,commentStore:o,canManageComments:l=!1,getReviewLink:f,collaboration:s,commentUI:p}){let{confirm:L,dialog:S}=jt(),k=z(null),[w,b]=T([]),[g,M]=T("/"),[F,G]=T(["/"]),[V,J]=T([]),[D,H]=T(Ba?"edit":"comment"),i=z(D),m=z(null),W=z(null),q=z(null),ee=z(!1),O=z(null),ae=z(""),xe=z(!1),te=z(null),N=z(null),we=z(null),[le,Me]=T(null),[Z,Oe]=T(!1),[Q,Ee]=T(!1),ye=z(Q);ye.current=Q;let[R,j]=T(null),[X,re]=T(null),v=z(X);v.current=X;let[h,y]=T(null),ne=z(h),P=z(!1);ne.current=h;let[ia,ue]=T(null),[K,uo]=T(null),[so,Fe]=T(null),[io,ze]=T(""),[Le,ce]=T(""),[Ne,fo]=T("open"),[fa,no]=T(""),[Ka,Y]=T(""),[$a,na]=T(!!o),[Re,ca]=T(!1),[pe,Za]=T(null),[ja,co]=T(""),[pa,_a]=T(!1),[Ja,ma]=T(""),ie=z(!1),ve=z(0),ha=z(null),Qa=z(!1),Ma=z(null),[Fa,Ya]=T({x:0,y:0});ae.current=Le,N.current||(N.current=Jt(()=>{let e=document.activeElement,d=m.current?.contains(e)&&e?.matches('input,textarea,[contenteditable="true"]');!O.current||ae.current.trim()||xe.current||d||tt()}));let n=w.find(e=>e.id===X),xa=pe?.type==="resolve"&&pe.id===n?.id?pe:null,et=xa?xa.resolved?"Resolving thread\u2026":"Reopening thread\u2026":n?.resolved?"Reopen thread":"Resolve thread";async function at(e=!1){if(!(!f||pa)){_a(!0),ma("");try{let d=await f(e);co(d);try{await navigator.clipboard.writeText(d),ma(e?"New link copied. The previous link no longer accepts new reviewers.":"Link copied. Your client can sign in with any Google account.")}catch{ma("Select and copy the review link below.")}}catch{ma("The review link could not be created. Please try again.")}finally{_a(!1)}}}async function tt(){if((ae.current.trim()||xe.current)&&!await Te()||(N.current?.cancel(),O.current=null,ee.current))return;ee.current=!0;let e=m.current?va(m.current,!0,q.current):null;q.current=e;let d=()=>{!ee.current||q.current!==e||(ee.current=!1,ge(),re(null),ce(""))};e?e.finished.then(d,()=>{}):d()}function Ra(){N.current?.cancel(),ee.current&&(ee.current=!1,q.current=m.current?va(m.current,!1,q.current):null)}function La(){q.current?.cancel(),q.current=null,ee.current=!1,Oe(!0)}async function po(e){if(!await Te()||ie.current)return;let d=null;try{d=e.selector?K?.querySelector(e.selector)??null:null}catch{}if(!d){Y("This element is no longer on the page. Its changes cannot be edited.");return}ge(),N.current?.cancel(),ce(""),te.current=null,j(e.id),ze(e.text),y(e)}function ot(e){N.current?.cancel(),!(h||e.path!==g||(Le.trim()||xe.current)&&X!==e.id)&&(X===e.id&&Z||(O.current=e.id,Ia(e,!0)))}function ge(){we.current?.(),we.current=null,Me(null)}async function Te(){return!ie.current&&(!(ne.current&&P.current)&&!ae.current.trim()&&!xe.current||await L({title:"Discard this draft?",description:"Your comment and unsaved preview changes will be discarded.",action:"Discard draft",danger:!0}))}async function ga(e){if(e===i.current||!await Te())return;N.current?.cancel(),O.current=null,ge(),H(e),i.current=e,y(null),j(null),ue(null),e==="comment"&&Ee(!1);let d=k.current?.contentDocument;d?.documentElement&&(d.documentElement.dataset.chiselMode=e,k.current?.contentWindow?.dispatchEvent(new Event("chisel:mode")));let c=new URL(window.location.href);c.searchParams.set("mode",e),window.history.replaceState(window.history.state,"",c)}function mo(){let e=k.current?.contentDocument;if(!e)return;let d=Array.from(e.querySelectorAll("a[href]:not([download])"),c=>Be(c.href,window.location.origin));J([...new Set(d.filter(c=>c!==null))])}async function ho(e){let d=Be(e,window.location.origin,g);if(!d)throw new Error("Enter a page path or URL from this site.");if(d===g)return!0;if(!await Te())return!1;let c=k.current?.contentWindow;return c?(N.current?.cancel(),O.current=null,ge(),y(null),j(null),re(null),ue(null),Fe(null),ze(""),ce(""),ha.current=null,te.current=null,P.current=!1,xe.current=!1,c.location.assign(d),!0):!1}function de(e){let d=null;try{d=e.selector?K?.querySelector(e.selector)??null:null}catch{}let c=d?.getBoundingClientRect();return{rect:c,x:c?c.left+c.width*(e.offsetX??0):e.x-Fa.x,y:c?c.top+c.height*(e.offsetY??0):e.y-Fa.y}}async function Ia(e,d=!1){let c=Be(e.path,window.location.origin);if(!c){Y("This comment's page cannot be opened in the preview.");return}if(!d&&!await Te()||(Ra(),d||s?.markRead(e.id),d||(La(),O.current=null),X===e.id&&g===e.path))return;Oe(!d),ge(),re(e.id),y(null),ue(null),Fe(e),ce(""),te.current=null;let C=k.current?.contentDocument;if(C?.documentElement&&e.selector&&(C.documentElement.dataset.chiselSelection=e.selector),g!==c){k.current?.contentWindow?.location.assign(c);return}let E=de(e);d||k.current?.contentWindow?.scrollTo({top:Math.max(0,E.y+Fa.y-180),behavior:"smooth"})}async function qe(e,d=[]){if(ie.current)return!1;ie.current=!0,ca(!0),Za(e),++ve.current;let c=e.type==="create"?e.comment.id:e.id,C=w.find($=>$.id===c),E=!1;try{if(e.type==="create"||e.type==="reply"){let A=e.type==="create"?{...e.comment,body:e.body,attachments:d,pending:!0}:Va(w,{...e,reply:{...e.reply,body:e.body,attachments:d,date:new Date().toISOString(),pending:!0}});b(U=>ua(U,{...A,pending:!0})),na(!1),Y(""),E=!0}if(!await t())throw new Error("Your session has expired. Reload this page to sign in again.");let $=o?await o.mutate(e):Va(w,e);return++ve.current,o||localStorage.setItem(Xa,JSON.stringify(ua(w,$))),b(A=>ua(A,$)),na(!1),Y(""),!0}catch($){return E&&b(A=>C?ua(A,C):Pa(A,c)),Y($ instanceof Error?$.message:"Your comment could not be saved. Your draft is still here; please try again."),!1}finally{ie.current=!1,ca(!1),Za(null)}}async function xo(e){if(!(ie.current||!await L({title:"Delete this comment?",description:"The comment and all its replies will be permanently deleted.",action:"Delete comment",danger:!0}))){ie.current=!0,ca(!0),++ve.current;try{if(!await t()){Y("Your session has expired. Reload this page to sign in again.");return}if(o){if(!o.delete)throw new Error("Comment deletion is unavailable");await o.delete(e.id)}else localStorage.setItem(Xa,JSON.stringify(Pa(w,e.id)));++ve.current,v.current===e.id&&(ge(),re(null),ce(""),Fe(null)),b(d=>Pa(d,e.id)),Y("")}catch{Y("The comment could not be deleted. Please try again.")}finally{ie.current=!1,ca(!1)}}}function Ta(){let e=k.current?.contentDocument,d=k.current?.contentWindow;if(!e?.documentElement||!d)return;let c=za(d);if(c===null||e===Ma.current)return;if(Ma.current=null,!Qa.current){if(Qa.current=!0,!o)try{let oe=JSON.parse(localStorage.getItem(Xa)||"[]");if(!Array.isArray(oe)||oe.some(qa=>typeof qa.id!="string"||typeof qa.text!="string"||!Array.isArray(qa.replies)))throw Error();b(oe)}catch{Y("Saved comments could not be loaded.")}let A=new URLSearchParams(window.location.search).get("mode"),U=A==="browse"?"view":A;U&&["edit","comment","view"].includes(U)&&(U!=="edit"||Ba)&&(H(U),i.current=U);let me=new URLSearchParams(window.location.search).get("path");if(me){let oe=Be(me,window.location.origin);if(!oe)Y("That preview page is invalid. Enter a URL from this site.");else if(oe!==c){if(oe.split("#")[0]!==c.split("#")[0]){Ma.current=e,d.location.replace(oe);return}d.location.replace(oe),c=oe}}}if(M(c),uo(e),!d.chiselReady){e.addEventListener("chisel:ready",Ta,{once:!0});return}let C=e.documentElement;if(C.dataset.feedbackBound)return;C.dataset.feedbackBound="true";let E=e.createElement("style");E.textContent=`
|
|
335
|
+
html[data-chisel-mode="comment"]:not([data-chisel-comments-hidden="true"]) { --chisel-comment-cursor:${to("#ffffff","#e2e2e2")};cursor:var(--chisel-comment-cursor) !important; }
|
|
336
|
+
html[data-chisel-mode="comment"]:not([data-chisel-comments-hidden="true"]) :not([data-chisel-root], [data-chisel-root] *) { cursor:var(--chisel-comment-cursor) !important; }
|
|
337
|
+
html[data-chisel-mode="comment"] [data-chisel-root] { cursor:auto; }
|
|
338
|
+
@media(prefers-color-scheme:dark) {
|
|
339
|
+
html[data-chisel-mode="comment"]:not([data-chisel-comments-hidden="true"]) { --chisel-comment-cursor:${to("#222222","#3c3c3c")}; }
|
|
340
|
+
}
|
|
341
|
+
html[data-chisel-mode="edit"] .chisel-panel-inner { border-radius:0;box-shadow:none; }
|
|
342
|
+
@media(min-width:761px) {
|
|
343
|
+
html[data-chisel-mode="edit"] body { width:calc(100% - 336px); }
|
|
344
|
+
html[data-chisel-mode="edit"] .chisel-panel { top:0;right:0;left:auto;bottom:0;width:400px;max-height:100dvh;height:100dvh;padding:0;background:transparent;border:0; }
|
|
345
|
+
html[data-chisel-mode="edit"] .chisel-panel-wrapper { height:100%; }
|
|
346
|
+
html[data-chisel-mode="edit"] .chisel-panel-inner { width:100%;height:100%;max-height:100%; }
|
|
347
|
+
}
|
|
348
|
+
@media(max-width:760px) {
|
|
349
|
+
html[data-chisel-mode="edit"] .chisel-panel { left:0;right:0;bottom:0; }
|
|
350
|
+
}
|
|
351
|
+
`,e.head.append(E),C.dataset.chiselMode=i.current,C.dataset.chiselCommentsHidden=String(ye.current),d.dispatchEvent(new Event("chisel:mode")),d.addEventListener("chisel:selection",A=>{let U=A.detail;Fe(U),U.selector&&(C.dataset.chiselSelection=U.selector)});let $=()=>Ya({x:d.scrollX,y:d.scrollY});$(),d.addEventListener("scroll",$),d.addEventListener("resize",()=>{ue(null),$()}),e.addEventListener("scroll",()=>{ue(null),$()},!0),e.addEventListener("mousemove",A=>{let U=A.target;ue(i.current==="comment"&&!ye.current&&U?.nodeType===1?U.getBoundingClientRect():null)},!0),e.addEventListener("mouseleave",()=>ue(null)),e.addEventListener("keydown",A=>{A.key==="Escape"&&!ie.current&&(y(null),re(null),ue(null),Fe(null),delete C.dataset.chiselSelection)}),e.addEventListener("click",async A=>{let U=A.target;if(!U||U.nodeType!==1||U.closest("[data-chisel-root]")||i.current==="view"||i.current==="comment"&&ye.current||i.current==="comment"&&(A.preventDefault(),A.stopImmediatePropagation(),!await Te()))return;ge();let me=U.getBoundingClientRect(),oe={x:A.clientX+d.scrollX,y:A.clientY+d.scrollY,selector:oo(U),tag:U.tagName.toLowerCase(),offsetX:me.width?(A.clientX-me.left)/me.width:0,offsetY:me.height?(A.clientY-me.top)/me.height:0};Fe(oe),C.dataset.chiselSelection=oe.selector,i.current!=="edit"&&(A.preventDefault(),A.stopImmediatePropagation(),re(null),ze(""),ue(null),j(null),ha.current=crypto.randomUUID(),y(oe))},!0)}Se(()=>{let e=K?.defaultView;if(e)return Kt(e,d=>{if(!Be(d,window.location.origin))return;M(d),G(C=>C.includes(d)?C:[...C,d]);let c=new URL(window.location.href);d==="/"?c.searchParams.delete("path"):c.searchParams.set("path",d),window.history.replaceState(window.history.state,"",c)})},[K]),Se(()=>{K&&(K.documentElement.dataset.chiselCommentsHidden=String(Q))},[Q,K]),Se(()=>()=>N.current?.cancel(),[]),Se(()=>{if(!o)return;let e=!1,d,c=()=>{clearTimeout(d),d=setTimeout(()=>{d=void 0,C()},1e4)},C=async()=>{if(e||document.visibilityState==="hidden")return;if(ie.current){c();return}clearTimeout(d),d=void 0;let A=++ve.current;try{let U=await o.list();!e&&A===ve.current&&(clearTimeout(d),d=void 0,b(U),na(!1),Y(""))}catch{!e&&A===ve.current&&(na(!1),Y("Shared comments could not be loaded. Check your connection; retrying automatically."),c())}};C();let E=o.subscribe?.(()=>{C()}),$=o.subscribe?void 0:window.setInterval(()=>{C()},1e4);return window.addEventListener("focus",C),document.addEventListener("visibilitychange",C),()=>{e=!0,clearTimeout(d),E?.(),window.clearInterval($),window.removeEventListener("focus",C),document.removeEventListener("visibilitychange",C)}},[o]);let rt=s?.setPage;Se(()=>{rt?.(g)},[g,rt]),Da(()=>{let e=W.current;e&&(e.style.height="auto",e.style.height=`${e.scrollHeight+e.offsetHeight-e.clientHeight}px`)},[Le,Z,n?.id,Q,D,g]),Da(()=>{let e=k.current?.parentElement,d=e?.querySelector(".comment-box");if(!h||!e||!d||Q)return;let c=()=>{let E=Qt(de(h),{width:d.offsetWidth,height:d.offsetHeight},{width:e.clientWidth,height:e.clientHeight});d.style.left=`${E.left}px`,d.style.top=`${E.top}px`,d.style.maxHeight=`${E.maxHeight}px`};c();let C=new ResizeObserver(c);return C.observe(d),C.observe(e),()=>C.disconnect()}),Da(()=>{let e=m.current;if(!e||Q||q.current?.playState==="running")return;let d=e.parentElement?.parentElement,c=d?.clientHeight??356,C=d?.clientWidth??416,E=Number(e.dataset.pinX),$=Number(e.dataset.pinY),A=Z?Math.max(8,Math.min($-40,c-Math.min(340,c-16)-8)):Math.max(8,Math.min($+32-e.offsetHeight,c-e.offsetHeight-8)),U=Z?E+44:E;e.style.left=`${Math.max(8,Math.min(U,C-e.offsetWidth-8))}px`,e.style.top=`${A}px`,e.style.maxHeight=`${c-A-8}px`}),Da(()=>(ee.current=!1,q.current=m.current&&!Q?va(m.current):null,()=>{ee.current=!1,q.current?.cancel()}),[n?.id,!!h,D,Q,g]),Se(()=>{k.current?.contentDocument?.readyState==="complete"&&Ta()},[]),Se(()=>{let e=d=>{if(document.querySelector('dialog[open], [aria-modal="true"]'))return;let c=_t(d);if(!(!c||c===i.current||c==="edit"&&!Ba)){if(d.preventDefault(),d.stopPropagation(),c==="toggle-comments"){N.current?.cancel(),ge(),Ee(C=>!C);return}ga(c)}};return document.addEventListener("keydown",e,!0),K?.addEventListener("keydown",e,!0),()=>{document.removeEventListener("keydown",e,!0),K?.removeEventListener("keydown",e,!0)}},[K]),Se(()=>{if(!n||le!==n.id||h||D==="edit"||n.path!==g||!n.selector||!K)return;let e;try{e=K.querySelector(n.selector)}catch{e=null}if(!e){Me(null),Y("This element is no longer on the page. Its saved changes cannot be previewed.");return}let d=ka(e,n.changes??[]);return we.current=d,Ya({x:e.ownerDocument.defaultView.scrollX,y:e.ownerDocument.defaultView.scrollY}),d},[le,n,h,D,g,K]);let dt=eo(w,Ne,fa);return x("main",{"aria-label":"Chisel workspace",className:`feedback-shell ${p?.className??""} ${D==="edit"?"is-editing":""} ${Q?"comments-hidden":""}`,children:[u(Wa,{}),S,x("div",{className:"feedback-workspace",children:[x("section",{className:"feedback-canvas","aria-label":"Website preview",children:[x("div",{className:"feedback-viewport",children:[u("iframe",{ref:k,src:"/",title:"Website for feedback",onLoad:Ta}),x("div",{className:"feedback-comment-layer","data-hover-preview":!!(n&&!Z&&!h),hidden:Q,children:[h&&pe?.type!=="create"&&u("span",{className:"feedback-pin comment-box-draft-pin","aria-hidden":"true",style:{left:de(h).x,top:de(h).y}}),n&&!h&&D!=="edit"&&n.path===g&&x("section",{ref:m,"data-pin-x":de(n).x,"data-pin-y":de(n).y,"data-pin-width":40+(Math.min(Aa(n).length,4)-1)*20,"data-expanded":Z,onPointerEnter:()=>{ee.current||N.current?.cancel()},onPointerMove:Ra,onPointerLeave:()=>N.current?.schedule(),onFocus:Ra,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||N.current?.schedule()},"data-native-ui":!!p,className:"feedback-composer feedback-thread-popup comment-thread",role:"dialog","aria-label":"Comment thread",style:{left:`clamp(8px, ${de(n).x-4}px, calc(100% - 408px))`,top:`clamp(8px, ${de(n).y-4}px, calc(100% - ${Z?340:128}px))`},children:[!Z&&x("button",{type:"button",className:"feedback-hover-preview","aria-label":`Expand comment: ${n.text||n.attachments?.map(e=>e.name).join(", ")}`,onClick:()=>{Ia(n)},children:[u("span",{className:"feedback-avatar",children:n.authorImage?u("img",{src:n.authorImage,alt:"",width:24,height:24}):n.author.slice(0,1).toUpperCase()}),x("span",{className:"feedback-hover-copy",children:[x("span",{className:"feedback-hover-byline",children:[u("strong",{children:n.author}),u("time",{dateTime:n.date,children:ao(n.date)})]}),u("span",{className:"feedback-hover-message",children:n.text||n.attachments?.map(e=>e.name).join(", ")})]})]}),x("div",{className:"feedback-thread-content",hidden:!Z,children:[x("header",{className:"feedback-thread-header",children:[u(ra,{onMoveStart:()=>{O.current=null,N.current?.cancel(),La()}}),x("div",{className:"feedback-thread-header-actions",children:[n.authorId===a.id&&u("button",{className:"feedback-thread-close",type:"button",title:"Edit comment","aria-label":"Edit comment",disabled:!n.selector,onClick:()=>{po(n)},children:u(Qe,{size:16})}),u("button",{className:"feedback-thread-close",type:"button",title:et,"aria-label":et,"aria-busy":!!xa,disabled:Re||!!o&&!l&&n.authorId!==a.id,onClick:()=>{qe({type:"resolve",id:n.id,resolved:!n.resolved})},children:xa?u(be,{size:18,className:"chisel-spin"}):n.resolved?u(ea,{size:18}):u(Ce,{size:18})}),(!o||o.delete)&&(!o||n.authorId===a.id||l)&&u("button",{className:"feedback-thread-close feedback-thread-delete",type:"button",title:"Delete comment","aria-label":"Delete comment",disabled:Re,onClick:()=>{xo(n)},children:u(ke,{size:16})}),u("button",{className:"feedback-thread-close",type:"button",title:"Close thread","aria-label":"Close thread",onClick:tt,children:u(ta,{size:18})})]})]}),u("div",{className:"feedback-thread-summary",children:!p&&x("button",{type:"button",className:"feedback-thread-summary-button","aria-label":`Expand comment: ${n.text}`,"aria-expanded":Z,onClick:La,children:[u("span",{className:"feedback-avatar",children:n.authorImage?u("img",{src:n.authorImage,alt:"",width:27,height:27}):n.author.slice(0,1).toUpperCase()}),x("span",{className:"feedback-thread-summary-copy",children:[x("span",{className:"feedback-thread-byline",children:[u("strong",{children:n.author}),u("time",{dateTime:n.date,children:new Date(n.date).toLocaleDateString(void 0,{month:"short",day:"numeric"})})]}),u("span",{className:"feedback-thread-message",children:n.text}),!Z&&u("span",{className:"feedback-thread-reply-count",children:n.replies.length?`${n.replies.length} ${n.replies.length===1?"reply":"replies"}`:"Reply\u2026"})]})]})}),!!n.changes?.length&&u("div",{className:"feedback-proposal-actions",children:x("button",{type:"button",className:"feedback-preview","aria-pressed":le===n.id,disabled:!n.selector,onClick:()=>{Y(""),Me(le===n.id?null:n.id)},children:[u(Ke,{size:16}),le===n.id?"Exit preview":"Preview changes"]})}),(Z||p)&&u(sa,{children:p?p.renderThread({comment:n,expanded:Z,reply:Le,saving:Re,submittingReply:pe?.type==="reply"&&pe.id===n.id,canResolve:!o||l||n.authorId===a.id,replyAuthor:a,onAttachmentDraftChange:e=>{xe.current=e},onReplyText:e=>{ce(e),te.current=null},onReply:async(e,d,c,C)=>{if(!e.trim()&&!c?.length)return!1;let E=await qe({type:"reply",id:n.id,body:d,attachmentTokens:c,reply:{id:te.current??(te.current=crypto.randomUUID()),text:e.trimEnd(),author:a.name,authorId:a.id,authorImage:a.image}},C);return E&&(ce(""),te.current=null),E},onResolve:()=>{qe({type:"resolve",id:n.id,resolved:!n.resolved})},onExpand:La}):x(sa,{children:[u("div",{className:"feedback-thread-replies",children:n.replies.map((e,d)=>x("div",{className:"feedback-thread-reply",children:[u("span",{className:"feedback-avatar","aria-hidden":"true",children:(typeof e=="string"?"?":e.author.slice(0,1)).toUpperCase()}),x("div",{children:[typeof e!="string"&&u("strong",{children:e.author}),u("p",{children:typeof e=="string"?e:e.text})]})]},d))}),x("form",{hidden:pe?.type==="reply"&&pe.id===n.id,onSubmit:async e=>{e.preventDefault(),Le.trim()&&await qe({type:"reply",id:n.id,reply:{id:te.current??(te.current=crypto.randomUUID()),text:Le.trimEnd(),author:a.name,authorId:a.id,authorImage:a.image}})&&(ce(""),te.current=null)},children:[u("textarea",{ref:W,"aria-label":"Reply",rows:1,placeholder:"Write a reply\u2026",value:Le,maxLength:4e3,onChange:e=>{ce(e.target.value),te.current=null},disabled:Re,required:!0}),u("div",{className:"feedback-thread-actions",children:x("button",{type:"submit",className:"feedback-primary",disabled:Re||!Le.trim(),"aria-label":"Reply",children:["Reply ",u(Ve,{})]})})]})]})})]})]},n.id),D==="comment"&&[ia,de(h??n??so??{x:0,y:0}).rect].map((e,d)=>e&&u("div",{"data-testid":d===0?"element-hover":"element-selection",className:`feedback-element-box ${d===1?"is-selected":""}`,style:{left:e.left,top:e.top,width:e.width,height:e.height}},d)),D!=="edit"&&w.filter(e=>e.path===g&&!e.resolved).map(e=>{let d=Aa(e);return x("button",{"aria-label":`Open comment: ${e.text}`,title:d.map(c=>c.author).join(", "),className:`feedback-pin ${d.length>1?"feedback-pin-group":""} ${X===e.id?"selected":""}`,onPointerEnter:c=>{c.pointerType!=="touch"&&ot(e)},onPointerLeave:()=>N.current?.schedule(),style:{left:de(e).x,top:de(e).y},onClick:()=>Ia(e),children:[d.slice(0,3).map((c,C)=>u("span",{className:"feedback-avatar","aria-hidden":"true",children:c.authorImage?u("img",{src:c.authorImage,alt:"",width:24,height:24}):c.author.slice(0,1).toUpperCase()},C)),d.length>3&&x("span",{className:"feedback-avatar feedback-pin-more","aria-hidden":"true",children:["+",d.length-3]})]},e.id)}),h?.selector&&K?.querySelector(h.selector)&&u(Oa,{target:K.querySelector(h.selector),text:io,onText:ze,onDraftChange:e=>{P.current=e},hidden:pe?.type==="create",editing:!!R,commentId:R??void 0,renderComposer:p?.renderComposer,changes:w.find(e=>e.id===R)?.changes,hasExistingAttachments:!!w.find(e=>e.id===R)?.attachments?.length,onCancel:()=>{y(null),ze(""),j(null)},onPost:(e,d,c,C,E)=>R?qe({type:"edit",id:R,text:d,changes:e,body:c,attachmentTokens:C}):qe({type:"create",body:c,attachmentTokens:C,comment:{id:ha.current??(ha.current=crypto.randomUUID()),path:g,...h,text:d,author:a.name,authorId:a.id,authorImage:a.image,date:new Date().toISOString(),resolved:!1,replies:[],changes:e}},E),style:{left:de(h).x+44,top:de(h).y}},`${h.selector}:${h.x}:${h.y}`)]})]}),x("div",{className:"feedback-toolbar","aria-label":"Preview mode",children:[Ba&&x("button",{title:"Edit styles","aria-keyshortcuts":"E","aria-pressed":D==="edit",onClick:()=>ga("edit"),children:[u(De,{}),u("span",{children:"Edit"})]}),x("button",{title:"Add comments","aria-keyshortcuts":"C","aria-pressed":D==="comment",onClick:()=>ga("comment"),children:[u(Ue,{}),u("span",{children:"Comment"})]}),x("button",{title:"View website","aria-keyshortcuts":"V","aria-pressed":D==="view",onClick:()=>ga("view"),children:[u(Je,{}),u("span",{children:"View"})]})]})]}),u("aside",{className:"feedback-sidebar",hidden:D==="edit"||Q,children:x("div",{className:"feedback-sidebar-panel",children:[x("div",{className:"feedback-sidebar-title",children:[x("h1",{children:["Comments ",u("span",{children:w.length})]}),x("details",{className:"feedback-account",children:[u("summary",{title:`Signed in as ${a.name}`,"aria-label":`Account: ${a.name}`,children:u("span",{className:"feedback-avatar",children:a.image?u("img",{src:a.image,alt:"",width:27,height:27}):a.name.slice(0,1).toUpperCase()})}),x("div",{children:[u("strong",{children:a.name}),u("span",{children:a.email}),x("button",{onClick:async()=>{try{await r(),window.location.reload()}catch{Y("Sign out failed. Please try again.")}},children:[u(_e,{}),"Sign out"]})]})]})]}),x("label",{className:"feedback-search",children:[u(aa,{"aria-hidden":"true",size:18}),u("input",{type:"search","aria-label":"Search comments",placeholder:"Search",value:fa,onChange:e=>no(e.target.value)})]}),s&&(s.status!=="connected"||s.participants.length>0||s.unreadThreadIds.length>0)&&x("div",{className:"feedback-collaboration","aria-label":"Review activity",children:[s.status!=="connected"&&u("span",{role:"status",children:s.status==="connecting"||s.status==="initial"?"Connecting\u2026":"Reconnecting\u2026"}),u("div",{className:"feedback-reviewers",children:s.participants.map(e=>u("span",{className:"feedback-avatar",title:`${e.name} \xB7 ${e.path}`,"aria-label":`${e.name} is reviewing ${e.path}`,children:e.image?u("img",{src:e.image,alt:"",width:24,height:24}):e.name.slice(0,1).toUpperCase()},e.id))}),s.unreadThreadIds.length>0&&x("span",{className:"feedback-unread-count",children:[s.unreadThreadIds.length," unread"]})]}),u("div",{className:"feedback-tabs",role:"group","aria-label":"Filter comments",children:["open","resolved","all"].map(e=>u("button",{"aria-pressed":Ne===e,onClick:()=>fo(e),children:e[0].toUpperCase()+e.slice(1)},e))}),Ka&&u("p",{role:"alert",className:"feedback-error",children:Ka}),x("div",{className:"feedback-comment-list",children:[dt.map(e=>u("article",{onPointerEnter:d=>{d.pointerType!=="touch"&&ot(e)},onPointerLeave:()=>N.current?.schedule(),className:`feedback-comment ${X===e.id?"active":""}`,children:x("button",{className:"feedback-comment-main","aria-pressed":X===e.id,onClick:()=>Ia(e),children:[x("span",{className:"feedback-comment-heading",children:[u("span",{className:"feedback-avatar",children:e.authorImage?u("img",{src:e.authorImage,alt:"",width:28,height:28}):e.author.slice(0,1).toUpperCase()}),x("span",{className:"feedback-comment-identity",children:[x("span",{className:"feedback-comment-meta",children:[u("strong",{children:e.author}),e.pending?u("span",{role:"status",children:"Sending\u2026"}):u("time",{dateTime:e.date,children:new Date(e.date).toLocaleDateString(void 0,{month:"short",day:"numeric"})})]}),x("span",{className:"feedback-comment-status",children:[Ne==="all"&&x(sa,{children:[e.resolved?"Resolved":"Open",u("span",{"aria-hidden":"true",children:" \xB7 "})]}),u("span",{className:"feedback-comment-path",title:e.path,children:e.path})]})]}),s?.unreadThreadIds.includes(e.id)&&u("span",{className:"feedback-comment-unread-dot","aria-hidden":"true"})]}),u("span",{className:"feedback-comment-body",children:e.text||e.attachments?.map(d=>d.name).join(", ")}),(e.replies.length>0||s?.unreadThreadIds.includes(e.id))&&x("span",{className:"feedback-comment-activity",children:[e.replies.length>0&&x(sa,{children:[u("span",{className:"feedback-comment-avatars",children:Aa(e).slice(1,4).map((d,c)=>u("span",{className:"feedback-avatar",title:d.author,children:d.authorImage?u("img",{src:d.authorImage,alt:"",width:20,height:20}):d.author.slice(0,1).toUpperCase()},c))}),x("span",{className:"feedback-comment-reply-count",children:[e.replies.length," ",e.replies.length===1?"reply":"replies"]})]}),s?.unreadThreadIds.includes(e.id)&&u("span",{className:"feedback-unread-label",children:e.replies.length?"New replies":"Unread"})]})]})},e.id)),$a&&u("p",{role:"status",children:"Loading shared comments\u2026"}),!$a&&!dt.length&&x("div",{className:"feedback-empty",children:[u("span",{children:u(Ue,{size:30})}),u("h2",{children:fa.trim()?"No matching comments":Ne==="resolved"?"Nothing resolved yet":"No comments yet"}),u("p",{children:fa.trim()?"Try another name, phrase, or page.":Ne==="resolved"?"Resolved threads will appear here.":"Click anywhere on the page to leave your first comment."})]})]}),u(Na,{path:g,disabled:Re||!K,onNavigate:ho,onOpen:mo,routes:[...new Set([g,...F,...V,...w.map(e=>e.path)])].filter(e=>K&&Be(e,window.location.origin)).sort((e,d)=>e.localeCompare(d))}),f&&l&&x("details",{className:"feedback-review-invite",children:[x("summary",{children:[u(Ae,{"aria-hidden":"true"}),"Share review link"]}),x("form",{onSubmit:e=>{e.preventDefault(),at()},children:[u("p",{children:"Anyone with this link can sign in and review this website."}),u("button",{type:"submit",className:"feedback-primary",disabled:pa,children:pa?"Preparing link\u2026":"Copy review link"}),ja&&x(sa,{children:[u("input",{"aria-label":"Review link",value:ja,readOnly:!0,onFocus:e=>e.currentTarget.select()}),u("button",{type:"button",onClick:()=>{at(!0)},disabled:pa,children:"Replace invitation link"}),u("p",{children:"Replacing the link blocks new joins through the old link. Existing reviewers keep access."})]}),Ja&&u("p",{role:"status",children:Ja})]})]})]})})]})]})}import{jsx as Uo}from"react/jsx-runtime";import{useEffect as lo,useSyncExternalStore as Ho}from"react";import{Chisel as Oo}from"use-chisel";function Eo(a){return window.addEventListener("chisel:mode",a),()=>window.removeEventListener("chisel:mode",a)}function zo(){try{return window.self!==window.top&&window.parent.location.origin===window.location.origin&&window.parent.location.pathname==="/chisel"?document.documentElement.dataset.chiselMode??"view":"site"}catch{return"site"}}function No({projectName:a="Chisel"}){let t=Ho(Eo,zo,()=>"site");return lo(()=>{window.chiselReady=!0,document.dispatchEvent(new Event("chisel:ready"))},[]),lo(()=>{if(t!=="edit")return;let r=window.setTimeout(()=>window.dispatchEvent(new Event("chisel:select")),50);return()=>window.clearTimeout(r)},[t]),t==="site"||process.env.NODE_ENV==="production"?null:Uo(Oo,{embedded:!0,enabled:t==="edit",projectName:a})}export{No as ChiselPreview,ro as ChiselWorkspace,Wa as ChiselWorkspaceStyles};
|
|
352
|
+
/*! Bundled license information:
|
|
353
|
+
|
|
354
|
+
lucide-react/dist/esm/shared/src/utils/toKebabCase.mjs:
|
|
355
|
+
lucide-react/dist/esm/shared/src/utils/toLucideIconData.mjs:
|
|
356
|
+
lucide-react/dist/esm/shared/src/utils/toCamelCase.mjs:
|
|
357
|
+
lucide-react/dist/esm/shared/src/utils/toPascalCase.mjs:
|
|
358
|
+
lucide-react/dist/esm/shared/src/utils/mergeClasses.mjs:
|
|
359
|
+
lucide-react/dist/esm/shared/src/build/defaultAttributes.mjs:
|
|
360
|
+
lucide-react/dist/esm/shared/src/build/buildLucideIconNode.mjs:
|
|
361
|
+
lucide-react/dist/esm/shared/src/build/buildLucideIconForReact.mjs:
|
|
362
|
+
lucide-react/dist/esm/shared/src/utils/hasA11yProp.mjs:
|
|
363
|
+
lucide-react/dist/esm/context.mjs:
|
|
364
|
+
lucide-react/dist/esm/Icon.mjs:
|
|
365
|
+
lucide-react/dist/esm/createLucideIcon.mjs:
|
|
366
|
+
lucide-react/dist/esm/icons/arrow-right.mjs:
|
|
367
|
+
lucide-react/dist/esm/icons/arrow-up.mjs:
|
|
368
|
+
lucide-react/dist/esm/icons/check.mjs:
|
|
369
|
+
lucide-react/dist/esm/icons/chevron-down.mjs:
|
|
370
|
+
lucide-react/dist/esm/icons/chevron-right.mjs:
|
|
371
|
+
lucide-react/dist/esm/icons/circle-check.mjs:
|
|
372
|
+
lucide-react/dist/esm/icons/eye.mjs:
|
|
373
|
+
lucide-react/dist/esm/icons/globe.mjs:
|
|
374
|
+
lucide-react/dist/esm/icons/grip-horizontal.mjs:
|
|
375
|
+
lucide-react/dist/esm/icons/link-2.mjs:
|
|
376
|
+
lucide-react/dist/esm/icons/loader-circle.mjs:
|
|
377
|
+
lucide-react/dist/esm/icons/log-out.mjs:
|
|
378
|
+
lucide-react/dist/esm/icons/message-circle.mjs:
|
|
379
|
+
lucide-react/dist/esm/icons/mouse-pointer-2.mjs:
|
|
380
|
+
lucide-react/dist/esm/icons/pencil.mjs:
|
|
381
|
+
lucide-react/dist/esm/icons/pipette.mjs:
|
|
382
|
+
lucide-react/dist/esm/icons/rotate-ccw.mjs:
|
|
383
|
+
lucide-react/dist/esm/icons/search.mjs:
|
|
384
|
+
lucide-react/dist/esm/icons/sliders-horizontal.mjs:
|
|
385
|
+
lucide-react/dist/esm/icons/trash.mjs:
|
|
386
|
+
lucide-react/dist/esm/icons/x.mjs:
|
|
387
|
+
lucide-react/dist/esm/lucide-react.mjs:
|
|
388
|
+
(**
|
|
389
|
+
* @license lucide-react v1.61.0 - ISC
|
|
390
|
+
*
|
|
391
|
+
* This source code is licensed under the ISC license.
|
|
392
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
393
|
+
*)
|
|
394
|
+
*/
|