glassbox 0.9.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +1 -1
- package/dist/client/app.global.js +16 -11
- package/dist/client/history.global.js +9 -4
- package/package.json +2 -2
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
"use strict";(()=>{var T=Object.defineProperty;var A=(e,t,n)=>t in e?T(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var u=(e,t,n)=>A(e,typeof t!="symbol"?t+"":t,n);function y(e,t){if(e.kind==="static")return e.html;if(e.kind==="list"){let n=e.items.map(r=>r.html).join("");return t?`<!--kf-list:${e.id}-->${n}`:n}return e.parts.map(n=>y(n,t)).join("")}function N(e){if(e.length===0)return{kind:"static",html:""};if(e.every(r=>r.kind==="static"))return{kind:"static",html:e.map(r=>r.html).join("")};let t=[],n="";for(let r of e)r.kind==="static"?n+=r.html:(n!==""&&(t.push({kind:"static",html:n}),n=""),t.push(r));return n!==""&&t.push({kind:"static",html:n}),{kind:"mixed",parts:t}}function
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";(()=>{var T=Object.defineProperty;var A=(e,t,n)=>t in e?T(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var u=(e,t,n)=>A(e,typeof t!="symbol"?t+"":t,n);function y(e,t){if(e.kind==="static")return e.html;if(e.kind==="list"){let n=e.items.map(r=>r.html).join("");return t?`<!--kf-list:${e.id}-->${n}`:n}return e.parts.map(n=>y(n,t)).join("")}function N(e){if(e.length===0)return{kind:"static",html:""};if(e.every(r=>r.kind==="static"))return{kind:"static",html:e.map(r=>r.html).join("")};let t=[],n="";for(let r of e)r.kind==="static"?n+=r.html:(n!==""&&(t.push({kind:"static",html:n}),n=""),t.push(r));return n!==""&&t.push({kind:"static",html:n}),{kind:"mixed",parts:t}}function C(e,t,n){return e.kind==="static"?{kind:"static",html:t+e.html+n}:e.kind==="mixed"?{kind:"mixed",parts:[{kind:"static",html:t},...e.parts,{kind:"static",html:n}]}:{kind:"mixed",parts:[{kind:"static",html:t},e,{kind:"static",html:n}]}}function L(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function O(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}var _={className:"class",htmlFor:"for",httpEquiv:"http-equiv",acceptCharset:"accept-charset",accessKey:"accesskey",autoCapitalize:"autocapitalize",autoComplete:"autocomplete",autoFocus:"autofocus",autoPlay:"autoplay",colSpan:"colspan",contentEditable:"contenteditable",crossOrigin:"crossorigin",dateTime:"datetime",defaultChecked:"checked",defaultValue:"value",encType:"enctype",formAction:"formaction",formEncType:"formenctype",formMethod:"formmethod",formNoValidate:"formnovalidate",formTarget:"formtarget",hrefLang:"hreflang",inputMode:"inputmode",maxLength:"maxlength",minLength:"minlength",noModule:"nomodule",noValidate:"novalidate",readOnly:"readonly",referrerPolicy:"referrerpolicy",rowSpan:"rowspan",spellCheck:"spellcheck",srcDoc:"srcdoc",srcLang:"srclang",srcSet:"srcset",tabIndex:"tabindex",useMap:"usemap",strokeWidth:"stroke-width",strokeLinecap:"stroke-linecap",strokeLinejoin:"stroke-linejoin",strokeDasharray:"stroke-dasharray",strokeDashoffset:"stroke-dashoffset",strokeMiterlimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",fillOpacity:"fill-opacity",fillRule:"fill-rule",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",floodColor:"flood-color",floodOpacity:"flood-opacity",lightingColor:"lighting-color",stopColor:"stop-color",stopOpacity:"stop-opacity",shapeRendering:"shape-rendering",imageRendering:"image-rendering",textRendering:"text-rendering",pointerEvents:"pointer-events",vectorEffect:"vector-effect",paintOrder:"paint-order",fontFamily:"font-family",fontSize:"font-size",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",fontStretch:"font-stretch",textAnchor:"text-anchor",textDecoration:"text-decoration",dominantBaseline:"dominant-baseline",alignmentBaseline:"alignment-baseline",baselineShift:"baseline-shift",letterSpacing:"letter-spacing",wordSpacing:"word-spacing",writingMode:"writing-mode",markerStart:"marker-start",markerMid:"marker-mid",markerEnd:"marker-end",xlinkHref:"xlink:href",xlinkShow:"xlink:show",xlinkActuate:"xlink:actuate",xlinkType:"xlink:type",xlinkRole:"xlink:role",xlinkTitle:"xlink:title",xlinkArcrole:"xlink:arcrole",xmlBase:"xml:base",xmlLang:"xml:lang",xmlSpace:"xml:space",xmlnsXlink:"xmlns:xlink"},v=Symbol.for("kerfjs.SafeHtml"),g,d=(g=v,class{constructor(e){u(this,"__html");u(this,"__segment");u(this,g,!0);typeof e=="string"?(this.__segment={kind:"static",html:e},this.__html=e):(this.__segment=e,this.__html=y(e,!1))}toString(){return this.__html}});function h(e){return typeof e=="object"&&e!==null&&e[v]===!0}var M=new Set(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"]);function w(e){if(e==null||typeof e=="boolean")return{kind:"static",html:""};if(h(e))return e.__segment??{kind:"static",html:e.__html};if(typeof e=="string")return{kind:"static",html:L(e)};if(typeof e=="number")return{kind:"static",html:String(e)};if(Array.isArray(e))return N(e.map(w));let t=e;throw typeof t=="object"&&t!==null&&("nodeType"in t||"outerHTML"in t)?new Error("JSX: DOM elements cannot be passed as children (the JSX runtime renders to HTML strings). Build the tree in one JSX expression and use querySelector after toElement() to get element refs."):new Error(`JSX: unsupported child of type ${S(e)}. Children must be SafeHtml, string, number, boolean, null, undefined, or an array of those. Common mistakes: passing a Signal/Store object directly (use signal.value or store.state.value), passing a function (call it first), or passing a Promise (await it before render).`)}function S(e){if(Array.isArray(e))return"array";if(typeof e=="object"&&e!==null){let t=e.constructor?.name;return t&&t!=="Object"?`object (${t})`:"object"}return typeof e}var R=new Set(["href","src","xlink:href","formaction","action"]),I=/^\s*(?:(?:java|vb)script:|data:text\/html[;,])/i;function j(e,t){let n=_[e]??e;if(t==null||t===!1)return"";if(t===!0)return` ${n}`;let r;if(h(t))r=t.__html;else if(typeof t=="number")r=String(t);else if(typeof t=="string"){if(R.has(n)&&I.test(t))return console.warn(`JSX: dropped dangerous URL value for ${n}=${JSON.stringify(t.slice(0,80))}. kerf blocks javascript:, vbscript:, and data:text/html URLs in href/src/formaction/action/xlink:href by default. Wrap in raw() if this is intentional (e.g. bookmarklets), or sanitize upstream.`),"";r=O(t)}else throw typeof t=="function"&&/^on[A-Z]/.test(e)?new Error(`JSX: inline event handlers like ${e}={fn} are not supported by kerf's JSX \u2192 HTML-string runtime. Use event delegation from the mount root instead:
|
|
2
|
+
|
|
3
|
+
delegate(rootEl, 'click', '[data-action="..."]', (evt, target) => { ... });
|
|
4
|
+
<button data-action="...">click</button>
|
|
5
|
+
|
|
6
|
+
See docs/5-event-delegation.md for the tier-1/tier-2/tier-3 model.`):new Error(`JSX: unsupported value for attribute "${e}" \u2014 got ${S(t)}. Attribute values must be string, number, boolean, null, undefined, or SafeHtml. Did you mean to read .value off a Signal, or stringify the object first?`);return` ${n}="${r}"`}function o(e,t){if(typeof e=="function")return e(t);let{children:n,...r}=t,i=Object.entries(r).map(([c,l])=>j(c,l)).join("");if(M.has(e))return new d(`<${e}${i}>`);let a=n!=null?w(n):{kind:"static",html:""};return new d(C(a,`<${e}${i}>`,`</${e}>`))}var D=new Set(["focus","blur","scroll","load","error","mouseenter","mouseleave"]);function $(e,t){try{document.createElement("div").matches(e)}catch{throw new Error(`${t}: invalid selector "${e}". Pass a valid CSS selector (e.g. '[data-action="add"]', '.btn', 'input').`)}}function s(e,t,n,r){$(n,"delegate");let i=c=>{let l=c.target;if(!(l instanceof Element))return;let f=l.closest(n);f!==null&&e.contains(f)&&r(c,f)},a=D.has(t);return e.addEventListener(t,i,a),()=>{e.removeEventListener(t,i,a)}}var B="http://www.w3.org/2000/svg",P=new Set(["g","path","circle","rect","line","polygon","polyline","ellipse","text","tspan","defs","use","symbol","clipPath","mask","pattern","filter","marker","linearGradient","radialGradient","stop","image","foreignObject"]),k=100;function V(e){let t=/^\s*<([a-zA-Z][a-zA-Z0-9]*)\b/.exec(e);return t!==null?t[1]:null}function m(e){let t=e.trim();return t.length>k?`${t.slice(0,k)}\u2026`:t}function x(e,t,n){let r=new DOMParser().parseFromString(e,"image/svg+xml"),i=r.querySelector("parsererror");if(i!==null)throw new Error(`toElement: ${t} parse error \u2014 ${i.textContent}
|
|
7
|
+
input: ${m(n)}`);return r}function E(e){let t=typeof e=="string"?e:e.toString(),n=V(t);if(n==="svg")return x(t,"SVG",t).documentElement;if(n!==null&&P.has(n)){let a=`<svg xmlns="${B}">${t}</svg>`,l=x(a,"SVG fragment",t).documentElement.firstElementChild;if(l===null)throw new Error(`toElement: SVG fragment produced no element
|
|
8
|
+
input: ${m(t)}`);return l}let r=document.createElement("template");r.innerHTML=t;let i=r.content.firstElementChild;if(i===null)throw new Error(`toElement: produced no element
|
|
9
|
+
input: ${m(t)}`);return i}function b(e){return E(e)}function F(){let e=document.querySelector(".bulk-actions");e&&!document.querySelector(".delete-review-btn")&&e.remove()}function p(e,t){let n=b(o("div",{className:"modal-overlay",children:o("div",{className:"modal",children:[o("h3",{children:"Confirm"}),o("p",{children:e}),o("div",{className:"modal-actions",children:[o("button",{className:"btn btn-sm modal-cancel",children:"Cancel"}),o("button",{className:"btn btn-sm btn-danger modal-confirm",children:"Delete"})]})]})}));s(n,"click",".modal-cancel",()=>{n.remove()}),s(n,"click",".modal-confirm",()=>{n.remove(),t()}),n.addEventListener("click",r=>{r.target===n&&n.remove()}),document.body.appendChild(n)}s(document.body,"click",".delete-review-btn",(e,t)=>{e.preventDefault(),e.stopPropagation();let n=t.dataset.deleteId??"";p("Delete this review? This cannot be undone.",()=>{fetch("/api/review/"+encodeURIComponent(n),{method:"DELETE"}).then(r=>r.json()).then(()=>{t.closest(".history-item-link")?.parentElement?.remove(),F()})})});s(document.body,"click","#delete-completed-btn",()=>{p("Delete all completed reviews (except current)? This cannot be undone.",()=>{fetch("/api/reviews/delete-completed",{method:"POST",headers:{"Content-Type":"application/json"}}).then(e=>e.json()).then(()=>{location.reload()})})});s(document.body,"click","#delete-all-btn",()=>{p("Delete ALL reviews except the current one? This cannot be undone.",()=>{fetch("/api/reviews/delete-all",{method:"POST",headers:{"Content-Type":"application/json"}}).then(e=>e.json()).then(()=>{location.reload()})})});})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "glassbox",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"description": "A local code review tool for AI-generated code. Review diffs, annotate lines, and export structured feedback that AI tools can act on.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
59
59
|
"@resvg/resvg-wasm": "^2.6.2",
|
|
60
60
|
"hono": "^4.12.2",
|
|
61
|
-
"kerfjs": "^0.
|
|
61
|
+
"kerfjs": "^0.8.0"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@eslint/js": "^9.39.3",
|