@hazem3500/komo 0.9.30 → 0.9.32

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.
Files changed (37) hide show
  1. package/README.md +8 -3
  2. package/dist/adapters/tailwind.d.ts +1 -1
  3. package/dist/adapters/tailwind.js +1 -1
  4. package/dist/chunk-5BPQP3VG.js +1 -0
  5. package/dist/chunk-LDZL6B65.js +1 -0
  6. package/dist/chunk-MU3NFN44.js +1 -0
  7. package/dist/design-comment-SBTYFBOV.js +1 -0
  8. package/dist/{design-export-JEWGQH3R.js → design-export-44WHYCLI.js} +1 -1
  9. package/dist/design-mode.js +1 -1
  10. package/dist/design-panel-ISV2MKNX.js +1 -0
  11. package/dist/design-panel.d.ts +4 -2
  12. package/dist/design-preview.d.ts +33 -0
  13. package/dist/frame-portals.d.ts +1 -0
  14. package/dist/index.js +1 -1
  15. package/dist/inline-text-editor-VIICPLUY.js +1 -0
  16. package/dist/inline-text-editor.d.ts +5 -14
  17. package/dist/node.mjs +1 -1
  18. package/dist/react-props-panel-ME6XCEVP.js +1 -0
  19. package/dist/react-props-panel.d.ts +6 -3
  20. package/dist/react.js +1 -1
  21. package/dist/review-layout.d.ts +1 -1
  22. package/dist/{select-menu-QH7IVM7P.js → select-menu-OQOLRJT5.js} +1 -1
  23. package/dist/server.js +1 -1
  24. package/dist/setup.js +1 -1
  25. package/dist/text-preview.d.ts +23 -0
  26. package/dist/token-adapter.d.ts +13 -0
  27. package/dist/{token-picker-RHPT7HCK.js → token-picker-DY76T4PJ.js} +1 -1
  28. package/dist/types.d.ts +8 -4
  29. package/package.json +1 -1
  30. package/server/setup-client.txt +50 -47
  31. package/src/types.ts +8 -5
  32. package/dist/chunk-HHG6KWKR.js +0 -1
  33. package/dist/chunk-YSTPKET2.js +0 -1
  34. package/dist/design-comment-W2OVUWBL.js +0 -1
  35. package/dist/design-panel-KHZDEA36.js +0 -1
  36. package/dist/inline-text-editor-HKKHLSNR.js +0 -1
  37. package/dist/react-props-panel-PD6ENV6Q.js +0 -1
package/README.md CHANGED
@@ -326,6 +326,10 @@ Suggested agent workflow: list open threads, read a thread, inspect the reposito
326
326
 
327
327
  Mount once after hydration, outside server rendering, and call `destroy()` before changing project or branch. Repeated teardown is safe. komo preserves the host DOM hierarchy: it frames an existing content root, or uses Floating when there is no suitable root. Pass a mounted `pageRoot` with a layout box for explicit Frame support; body, html, detached elements, and `display: contents` are not frameable.
328
328
 
329
+ Frame keeps the page unscaled by default and gives its root the available width beside the comments. Native pointer and touch coordinates retain their normal CSS-pixel relationship to the page, including grids and drag controls that subtract `getBoundingClientRect()` from `clientX`/`clientY`. Content can reflow; fixed-width or `100vw` content can scroll within the frame. Viewport units still refer to the browser window. Body-level dialogs and popovers remain bounded to the frame without moving their DOM.
330
+
331
+ `frame: { scale: true }` explicitly opts into shrinking the original viewport instead. A CSS transform changes visual rectangles without changing local layout dimensions, so arbitrary coordinate-sensitive host handlers may select the wrong value under scaling. This option requires host controls that already account for transforms; komo does not rewrite native events or browser prototypes. Use the default unscaled Frame or Floating for interactive pages that do not support scaling.
332
+
329
333
  ## Bots and CI
330
334
 
331
335
  Give a bot its own revocable credential instead of sharing your login.
@@ -445,9 +449,10 @@ Pass these to `initKomo(config)` from `@hazem3500/komo` or `useKomo(config)` fro
445
449
  | `scope` | `"project" \| "branch"` | `"project"` | `"project"` shares comments; `"branch"` separates branches. |
446
450
  | `branch` | `string` | Inferred by `komo sync` | Required only for branch scope. |
447
451
  | `enabled` | `boolean` | `true` | Set from your build environment to restrict review UI. |
448
- | `pageRoot` | `HTMLElement` | Sole existing content root, when present | Mounted element inside body to scale in Frame mode. Body and html are not supported. |
452
+ | `pageRoot` | `HTMLElement` | Sole existing content root, when present | Mounted element inside body to frame. Body and html are not supported. |
449
453
  | `pickRoots()` | `() => Element[]` | All of body except komo | Extra roots, besides `pageRoot`, that can be picked for comments and Design mode. By default body-level portals such as dialogs and popovers are pickable; return `[]` to limit picking to `pageRoot`, or return your portal container to allow only it. |
450
- | `frame.include(element)` | `(element: HTMLElement) => boolean` | Fixed portals, including fixed descendants of static wrappers | Frame scales dialogs, overlays and toasts with the page. Script-positioned popovers keep their viewport placement while their content scales. Host transforms, animations and focus are preserved without moving portal DOM. Return `true` to map a whole body child through Frame or `false` to exclude its subtree; komo's own host is never framed. |
454
+ | `frame.scale` | `boolean` | `false` | Reflow at the available width without scaling. Set `true` only for hosts whose interactive controls account for transformed coordinates; keeps the original viewport layout and scales its contents. |
455
+ | `frame.include(element)` | `(element: HTMLElement) => boolean` | Fixed portals, including fixed descendants of static wrappers | Keep body-level dialogs, overlays and toasts inside Frame. Host transforms, animations and focus are preserved without moving portal DOM. Return `true` to map a whole body child through Frame or `false` to exclude its subtree; komo's own host is never framed. |
451
456
  | `isolateEvents` | `boolean` | `true` | Keep komo's events out of the host page. See [Host events](#host-events). |
452
457
  | `source(element)` | `(element: Element) => string \| undefined` | Anchor metadata | Return a repository-relative source path. |
453
458
  | `anchorTarget(element)` | `(element: Element) => Element \| undefined` | Declared owners and stable semantic cards | Optional persistent ancestor for comment capture. Offsets stay relative to this owner when hover-only children disappear. Owners cannot cross a dialog/popover boundary. Design inspection continues to target the exact element. |
@@ -459,7 +464,7 @@ Pass these to `initKomo(config)` from `@hazem3500/komo` or `useKomo(config)` fro
459
464
  | `showToolbar` | `boolean` | `true` | Set `false` to keep the toolbar, drawer, and comment pins hidden until `controller.open()` or the restore shortcut. |
460
465
  | `shortcuts` | `{ comment?, browse?, design?, comments?, restore? }` | `C`, `V`, `D`, `L`, `Shift+K` | A key with optional `Ctrl`, `Alt`, `Shift`, or `Meta`, such as `"M"` or `"Shift+J"`. Set `false` to disable one. Escape and Tab are reserved. Tooltips and tips show the configured keys. |
461
466
  | `features` | `{ designMode?, tags? }` | All `true` | Set a feature to `false` to remove it from the review UI, e.g. `{ designMode: false, tags: false }`. Existing tags stay stored and remain available to the CLI. |
462
- | `sidebar` | `"background" \| "edge"` | `"edge"` | `"edge"` (Floating) is a draggable sidebar that parks off and peeks from the viewport edge while closed. `"background"` (Frame) frames the site and shows the sidebar in the scaled review sheet. Account → Sidebar switches the two; that choice is remembered per project. |
467
+ | `sidebar` | `"background" \| "edge"` | `"edge"` | `"edge"` (Floating) is a draggable sidebar that parks off and peeks from the viewport edge while closed. `"background"` (Frame) reflows the unscaled page beside the review sidebar. Account → Sidebar switches the two; that choice is remembered per project. |
463
468
  | `restoreOpen` | `"session" \| "always" \| false` | `"session"` | Reopen the sidebar if it was left open: after a reload in the same tab, across tabs and visits, or never. |
464
469
  | `emojiDataSource` | `string` | jsDelivr emoji data 1.8.0 | Full emoji JSON URL; fetched only after “Choose another emoji”. |
465
470
  | `pollInterval` | `number` | `4000` | Refresh interval in milliseconds, minimum 2000. |
@@ -19,7 +19,7 @@ export interface TailwindToken {
19
19
  value?: string;
20
20
  /**
21
21
  * Values per theme. Keys are option ids ("dark"), "axis=option" pairs ("mode=dark"),
22
- * or combinations joined with "+" ("track+dark"). The most specific key that
22
+ * or combinations joined with "+" ("docs+dark"). The most specific key that
23
23
  * fully matches the theme state wins; otherwise `value` is used.
24
24
  */
25
25
  values?: Record<string, string>;
@@ -1 +1 @@
1
- var e=["top","right","bottom","left"],t={padding:e.map(e=>`padding-${e}`),margin:e.map(e=>`margin-${e}`),gap:["row-gap","column-gap"],"border-radius":["top-left","top-right","bottom-right","bottom-left"].map(e=>`border-${e}-radius`),"border-width":e.map(e=>`border-${e}-width`),"border-color":e.map(e=>`border-${e}-color`)},r=e=>(Array.isArray(e)?e:[e]).flatMap(e=>e.split(/\s+/)).filter(Boolean),a=e=>e.getAttribute("class"),n=e=>e.includes(":")?null:e.replace(/^!|!$/g,"");function i(e,t={}){let r,a=0;for(let[n,i]of Object.entries(e.values??{})){let e=n.split("+");e.every(e=>{let[r,a]=e.split("=");return void 0===a?Object.values(t).includes(r):t[r]===a})&&e.length>a&&([r,a]=[i,e.length])}return r??e.value??""}function o(e,o={}){let l=e.tokens.map(e=>({token:e,classes:r(e.class),covers:new Set(e.properties.flatMap(e=>[e,...t[e]??[]]))})),s=new Map;for(let e of l)for(let t of e.classes)s.set(t,e);let p=new Map(l.map(e=>[e.token.path,e])),g=!1===o.offToken?[]:o.offToken??[...new Set(e.tokens.flatMap(e=>e.properties))],d=new WeakMap,c=e=>(e??"").split(/\s+/).flatMap(e=>{let t=n(e),r=t?s.get(t):void 0;return r?[{name:e,entry:r}]:[]});function f(e,r){if(!r.stack.length)return null===r.original?e.removeAttribute("class"):e.setAttribute("class",r.original),void d.delete(e);e.setAttribute("class",r.stack.reduce((e,r)=>function(e,r,a){let i=e.split(/\s+/).filter(Boolean),o=a.classes[0],l=-1,p=i.filter((e,i)=>{let o=n(e),p=o?s.get(o):void 0,g=!!p&&(p===a||[...p.covers].every(e=>a.covers.has(e))&&(p.covers.has(r)||(t[r]??[]).some(e=>p.covers.has(e))));return g&&l<0&&(l=i),!g}),g=i.slice(0,l<0?i.length:l).filter(e=>p.includes(e)).length;return p.splice(g,0,o),p.join(" ")}(e,r.property,r.entry),r.original??""))}return{id:"tailwind",list(e){let t=e??Object.fromEntries((o.themes??[]).map(e=>[e.id,e.current()]));return l.map(({token:e,classes:r})=>({path:e.path,type:e.type,value:i(e,t),properties:[...e.properties],ref:r[0],...e.label?{label:e.label}:{},...e.group?{group:e.group}:{},...e.description?{description:e.description}:{},...e.states?{states:[...e.states]}:{}}))},resolve(e){let r,n={},i=function(e){let r=new Map;for(let t of c(e))for(let e of t.entry.covers){let a=r.get(e);(!a||t.entry.covers.size<=a.entry.covers.size)&&r.set(e,t)}for(let[e,a]of r)t[e]?.some(e=>r.get(e)?.entry!==a.entry)&&r.delete(e);return r}(a(e));for(let[e,t]of i)n[e]={path:t.entry.token.path};for(let a of g){if(i.has(a)||t[a]?.some(e=>i.has(e)))continue;r??=getComputedStyle(e);let o=r.getPropertyValue(a);o&&(n[a]={offToken:o})}return n},preview(e,t,r){let n=p.get(r.path);if(!n)return()=>{};let i=d.get(e)??{original:a(e),stack:[]};d.set(e,i);let o={property:t,entry:n};return i.stack.push(o),f(e,i),()=>{let t=i.stack.indexOf(o);t<0||(i.stack.splice(t,1),f(e,i))}},describe(e,t,r,n){let i=p.get(n.path)?.classes[0]??n.ref??n.path;if("path"in r){let t=p.get(r.path),n=d.get(e)?.original??a(e),o=c(n).find(e=>e.entry===t)?.name??t?.classes[0]??r.path;return o===i?`Keep class "${i}"`:`Replace class "${o}" with "${i}"`}return`Add class "${i}"`}}}var l={p:["Padding",["padding"]],px:["Padding",["padding-left","padding-right"]],py:["Padding",["padding-top","padding-bottom"]],pt:["Padding",["padding-top"]],pr:["Padding",["padding-right"]],pb:["Padding",["padding-bottom"]],pl:["Padding",["padding-left"]],m:["Margin",["margin"]],mx:["Margin",["margin-left","margin-right"]],my:["Margin",["margin-top","margin-bottom"]],mt:["Margin",["margin-top"]],mr:["Margin",["margin-right"]],mb:["Margin",["margin-bottom"]],ml:["Margin",["margin-left"]],gap:["Gap",["gap"]],"gap-x":["Gap",["column-gap"]],"gap-y":["Gap",["row-gap"]]},s=[0,.5,1,1.5,2,2.5,3,3.5,4,5,6,7,8,9,10,11,12,14,16,20,24,28,32,36,40,44,48,52,56,60,64,72,80,96];function p(e={}){let t=e.scale??4,r=e.steps??s;return(e.prefix??Object.keys(l)).flatMap(e=>{let a=l[e];if(!a)throw new Error(`komo: unknown spacing prefix "${e}"`);return r.map(r=>{let n=`${e}-${r}`;return{path:`spacing.${n}`,type:"dimension",class:n,properties:a[1],value:r*t+"px",group:a[0],label:n}})})}export{s as defaultSpacingSteps,p as tailwindSpacing,o as tailwindTokens,i as tokenValue};
1
+ function e(e){return e instanceof HTMLElement||e instanceof SVGElement}var t=["top","right","bottom","left"],r={padding:t.map(e=>`padding-${e}`),margin:t.map(e=>`margin-${e}`),gap:["row-gap","column-gap"],"border-radius":["top-left","top-right","bottom-right","bottom-left"].map(e=>`border-${e}-radius`),"border-width":t.map(e=>`border-${e}-width`),"border-color":t.map(e=>`border-${e}-color`)},n=e=>(Array.isArray(e)?e:[e]).flatMap(e=>e.split(/\s+/)).filter(Boolean),a=e=>e.getAttribute("class"),l=e=>e.includes(":")?null:e.replace(/^!|!$/g,"");function i(e,t={}){let r,n=0;for(let[a,l]of Object.entries(e.values??{})){let e=a.split("+");e.every(e=>{let[r,n]=e.split("=");return void 0===n?Object.values(t).includes(r):t[r]===n})&&e.length>n&&([r,n]=[l,e.length])}return r??e.value??""}function s(t,s={}){let o=t.tokens.map(e=>({token:e,classes:n(e.class),covers:new Set(e.properties.flatMap(e=>[e,...r[e]??[]]))})),p=new Map;for(let e of o)for(let t of e.classes)p.set(t,e);let g=new Map(o.map(e=>[e.token.path,e])),d=!1===s.offToken?[]:s.offToken??[...new Set(t.tokens.flatMap(e=>e.properties))],c=new WeakMap,u=e=>(e??"").split(/\s+/).flatMap(e=>{let t=l(e),r=t?p.get(t):void 0;return r?[{name:e,entry:r}]:[]});function f(e,t){if(!t.stack.length)return null===t.original?e.removeAttribute("class"):e.setAttribute("class",t.original),void c.delete(e);e.setAttribute("class",t.stack.reduce((e,t)=>function(e,t,n){let a=e.split(/\s+/).filter(Boolean),i=n.classes[0],s=-1,o=a.filter((e,a)=>{let i=l(e),o=i?p.get(i):void 0,g=!!o&&(o===n||[...o.covers].every(e=>n.covers.has(e))&&(o.covers.has(t)||(r[t]??[]).some(e=>o.covers.has(e))));return g&&s<0&&(s=a),!g}),g=a.slice(0,s<0?a.length:s).filter(e=>o.includes(e)).length;return o.splice(g,0,i),o.join(" ")}(e,t.property,t.entry),t.original??""))}return{id:"tailwind",list(e){let t=e??Object.fromEntries((s.themes??[]).map(e=>[e.id,e.current()]));return o.map(({token:e,classes:r})=>({path:e.path,type:e.type,value:i(e,t),properties:[...e.properties],ref:r[0],...e.label?{label:e.label}:{},...e.group?{group:e.group}:{},...e.description?{description:e.description}:{},...e.states?{states:[...e.states]}:{}}))},resolve(t){let n,l={},i=function(e){let t=new Map;for(let r of u(e))for(let e of r.entry.covers){let n=t.get(e);(!n||r.entry.covers.size<=n.entry.covers.size)&&t.set(e,r)}for(let[e,n]of t)r[e]?.some(e=>t.get(e)?.entry!==n.entry)&&t.delete(e);return t}(a(t));if(e(t)){for(let[e,r]of i){let n=t.style.getPropertyValue(e),a=r.name.startsWith("!")||r.name.endsWith("!");n&&(!a||"important"===t.style.getPropertyPriority(e))&&i.delete(e)}for(let[e,t]of i)r[e]?.some(e=>i.get(e)?.entry!==t.entry)&&i.delete(e)}for(let[e,t]of i)l[e]={path:t.entry.token.path};for(let e of d){if(i.has(e)||r[e]?.some(e=>i.has(e)))continue;n??=getComputedStyle(t);let a=n.getPropertyValue(e);a&&(l[e]={offToken:a})}return l},preview(t,r,n){let l=g.get(n.path);if(!l)return()=>{};let i=c.get(t)??{original:a(t),stack:[],inline:new Map};c.set(t,i),e(t)&&(i.inline.has(r)||i.inline.set(r,function(e,t){let r=e.getAttribute("style"),n=e.style.cssText,a=e.style.getPropertyValue(t),l=e.style.getPropertyPriority(t),i=getComputedStyle(e).getPropertyValue(t).trim(),s=r=>{let n=e.ownerDocument.createElement("span").style;return n.cssText=r,n.setProperty(t,""),n.cssText},o=s(n);return{value:a,priority:l,computed:i,restore(){s(e.style.cssText)===o?null===r?e.removeAttribute("style"):e.setAttribute("style",r):(e.style.setProperty(t,a,l),null===r&&!e.style.length&&function(e){e.style.length||(e.getAttribute("style"),e.removeAttribute("style"))}(e))}}}(t,r)),t.style.setProperty(r,""));let s={property:r,entry:l};return i.stack.push(s),f(t,i),()=>{let e=i.stack.indexOf(s);e<0||(i.stack.splice(e,1),f(t,i),i.stack.some(e=>e.property===r)||(i.inline.get(r)?.restore(),i.inline.delete(r)))}},describe(e,t,r,n){let l=g.get(n.path)?.classes[0]??n.ref??n.path;if("path"in r){let t=g.get(r.path),n=c.get(e)?.original??a(e),i=u(n).find(e=>e.entry===t)?.name??t?.classes[0]??r.path;return i===l?`Keep class "${l}"`:`Replace class "${i}" with "${l}"`}return`Add class "${l}"`}}}var o={p:["Padding",["padding"]],px:["Padding",["padding-left","padding-right"]],py:["Padding",["padding-top","padding-bottom"]],pt:["Padding",["padding-top"]],pr:["Padding",["padding-right"]],pb:["Padding",["padding-bottom"]],pl:["Padding",["padding-left"]],m:["Margin",["margin"]],mx:["Margin",["margin-left","margin-right"]],my:["Margin",["margin-top","margin-bottom"]],mt:["Margin",["margin-top"]],mr:["Margin",["margin-right"]],mb:["Margin",["margin-bottom"]],ml:["Margin",["margin-left"]],gap:["Gap",["gap"]],"gap-x":["Gap",["column-gap"]],"gap-y":["Gap",["row-gap"]]},p=[0,.5,1,1.5,2,2.5,3,3.5,4,5,6,7,8,9,10,11,12,14,16,20,24,28,32,36,40,44,48,52,56,60,64,72,80,96];function g(e={}){let t=e.scale??4,r=e.steps??p;return(e.prefix??Object.keys(o)).flatMap(e=>{let n=o[e];if(!n)throw new Error(`komo: unknown spacing prefix "${e}"`);return r.map(r=>{let a=`${e}-${r}`;return{path:`spacing.${a}`,type:"dimension",class:a,properties:n[1],value:r*t+"px",group:n[0],label:a}})})}export{p as defaultSpacingSteps,g as tailwindSpacing,s as tailwindTokens,i as tokenValue};
@@ -0,0 +1 @@
1
+ import{a as e}from"./chunk-RPY7OOOR.js";function t(e){let t=new WeakMap,i=new WeakMap;return{begin(e,r){t.set(e,r)},override(e,r){let s=t.get(e);r&&s&&!s.bindingUndo&&!i.has(e)&&(s.bindingUndo=r)},commit(r,s,l,o){let n={value:s.style.getPropertyValue(l),priority:s.style.getPropertyPriority(l)},y=i.get(r),a=y?.before??t.get(r)??{value:"",priority:""};if(n.value!==a.value||n.priority!==a.priority||a.bindingUndo)if(y)y.after=n;else{let t={kind:"style",element:s,property:l,before:a,after:n};e.push(t),i.set(r,t)}else y&&e.splice(e.indexOf(y),1),i.delete(r);o&&(t.set(r,n),i.delete(r))},cancel(s,l,o){let n=i.get(s);n&&(r(l,o,n.before),n.before.bindingUndo?.(),e.splice(e.indexOf(n),1)),i.delete(s),t.delete(s)}}}function r(e,t,r){r?.restore?r.restore():e.style.setProperty(t,r?.value??"",r?.priority)}function i(e){if(/^#[\da-f]{6}$/i.test(e))return e;if(/^#[\da-f]{3}$/i.test(e))return`#${[...e.slice(1)].map(e=>e+e).join("")}`;let t=e.match(/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i);return t?`#${t.slice(1,4).map(e=>Number(e).toString(16).padStart(2,"0")).join("")}`:"#000000"}function s(e,t){if(!t)return null;let r="",i=0,s=!1;for(let e of t)if(s)s=!1;else if("\\"===e)s=!0;else if(r)e===r&&(r="");else if('"'===e||"'"===e)r=e;else if("("===e)i++;else if(")"===e&&--i<0)return null;if(r||i||s)return null;let l=document.createElement("span").style;return l.setProperty(e,t),l.getPropertyValue(e)?t:null}function l(e,t){let r=e.getAttribute("style"),i=e.style.cssText,s=e.style.getPropertyValue(t),l=e.style.getPropertyPriority(t),n=getComputedStyle(e).getPropertyValue(t).trim(),y=r=>{let i=e.ownerDocument.createElement("span").style;return i.cssText=r,i.setProperty(t,""),i.cssText},a=y(i);return{value:s,priority:l,computed:n,restore(){y(e.style.cssText)===a?null===r?e.removeAttribute("style"):e.setAttribute("style",r):(e.style.setProperty(t,s,l),null===r&&!e.style.length&&o(e))}}}function o(e){e.style.length||(e.getAttribute("style"),e.removeAttribute("style"))}function n(t,r,i){if(!e(t))return()=>{};let s=t.style.getPropertyValue(r),l=t.style.getPropertyPriority(r),n=!t.hasAttribute("style");return t.style.setProperty(r,i,l),()=>{s?t.style.setProperty(r,s,l):t.style.removeProperty(r),n&&o(t)}}var y=new WeakMap;function a(e,t,r,i=!1,s=!1){let l=y.get(e);l&&(clearTimeout(l.timer),l.restore());let n=e.style.getPropertyValue("transition"),a=e.style.getPropertyPriority("transition"),u=!e.hasAttribute("style"),p=i?[...t].map(e=>`${e} .3s cubic-bezier(.22,1,.36,1)`).join():"none";e.style.setProperty("transition",p,"important");let f=e.style.getPropertyValue("transition"),g=()=>{y.delete(e),e.style.getPropertyValue("transition")===f&&"important"===e.style.getPropertyPriority("transition")&&(n?e.style.setProperty("transition",n,a):e.style.removeProperty("transition"),(s||u)&&o(e))};r(),i?y.set(e,{restore:g,timer:window.setTimeout(g,320)}):(getComputedStyle(e).color,g())}export{t as a,r as b,i as c,s as d,l as e,o as f,n as g,a as h};
@@ -0,0 +1 @@
1
+ var e="script,style,svg,input,textarea,select,[data-private],[data-sensitive]";function t(e){let t=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT),n=[];for(;t.nextNode();){let e=t.currentNode;n.push([e,e.data])}return n}function n(t,n){for(let[r,l]of t)(!r.isConnected||n.contains(r))&&!r.parentElement?.closest(e)&&r.data!==l&&(r.data=l)}function r(e,t,r){n(t,e);let l=new MutationObserver(()=>{!e.isConnected||t.some(([t])=>!e.contains(t))?(l.disconnect(),r?.()):n(t,e)});return l.observe(e,{childList:!0,characterData:!0,subtree:!0}),()=>l.disconnect()}function l(l,s,o,a){if(!l.isConnected)return;let i=t(l);if(i.map(([,e])=>e).join("")!==s)return;let c=0,f=s.length;for(;c<s.length&&c<o.length&&s[c]===o[c];)c++;for(;f>c&&o.length-(s.length-f)>c&&s[f-1]===o[o.length-(s.length-f)-1];)f--;let d=o.slice(c,o.length-(s.length-f)),u=[],h=0,m=!1;for(let[t,n]of i){let r=h+n.length;if(c===f?!m&&c>=h&&c<=r&&!t.parentElement?.closest(e):c<r&&f>h){if(t.parentElement?.closest(e))return;let r=Math.max(0,c-h),l=Math.min(n.length,Math.max(r,f-h));u.push([t,n.slice(0,r)+(m?"":d)+n.slice(l)]),m=!0}else u.push([t,n]);h=r}if(!m)return;let g=r(l,u,a);return()=>{g(),n(i,l)}}function s(){let e=new Map,l=[],s=new Map,o=new Map,a=e=>{s.get(e)?.(),s.delete(e)},i=(e,t)=>{a(e),s.set(e,r(e,t))},c=t=>{a(t),e.delete(t),o.delete(t)};return{pause:a,resume(e){let t=o.get(e);t&&i(e,t)},record(n){if(n.reactProp||n.before===n.after)return;e.has(n.element)||e.set(n.element,{text:n.before,nodes:n.nodes??t(n.element)}),l.push(n);let r=t(n.element);o.set(n.element,r),i(n.element,r)},remember(n,r){e.has(n)||e.set(n,{text:r,nodes:t(n)})},original:t=>e.get(t)?.text,reconcile(t,n){e.get(t)?.text===n&&c(t)},reset(t){a(t),n(e.get(t)?.nodes??[],t),c(t);for(let e=l.length-1;e>=0;e--)l[e].element===t&&l.splice(e,1)},proposal(t){let n=e.get(t)?.text,r=o.get(t)?.map(([,e])=>e).join("")??t.textContent??"";return void 0!==n&&n!==r?`Proposed inline text change (preview only)\n- Text: ${JSON.stringify(n)} → ${JSON.stringify(r)}\n- Source markup is unchanged; refresh resets this preview.`:void 0},restoreAll(){for(let e of s.keys())a(e);for(let[t,{nodes:r}]of e)n(r,t);e.clear(),o.clear(),l.length=0},showBefore(t,r=!0){for(let[l,s]of e)t&&!r?(a(l),n(s.nodes,l)):i(l,t?s.nodes:o.get(l)??s.nodes)},undo(){let r=l.pop();if(!r)return null;if(a(r.element),n(r.nodes??[],r.element),e.get(r.element)?.text===r.before)c(r.element);else{let e=t(r.element);o.set(r.element,e),i(r.element,e)}return r.element}}}export{e as a,t as b,n as c,r as d,l as e,s as f};