react-grab 0.0.70 → 0.0.72
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/{chunk-UIOO5VVO.js → chunk-DZ2VZRJA.js} +560 -204
- package/dist/{chunk-3OWWYY5I.cjs → chunk-GFBDYRPI.cjs} +560 -204
- package/dist/{core-CnnkNbYQ.d.cts → core-HtZR37lF.d.cts} +8 -19
- package/dist/{core-CnnkNbYQ.d.ts → core-HtZR37lF.d.ts} +8 -19
- package/dist/core.cjs +7 -7
- package/dist/core.d.cts +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +1 -1
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.global.js +27 -27
- package/dist/index.js +2 -2
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -578,6 +578,61 @@ function mapArray(list, mapFn, options = {}) {
|
|
|
578
578
|
}
|
|
579
579
|
};
|
|
580
580
|
}
|
|
581
|
+
function indexArray(list, mapFn, options = {}) {
|
|
582
|
+
let items = [], mapped = [], disposers = [], signals = [], len = 0, i2;
|
|
583
|
+
onCleanup(() => dispose(disposers));
|
|
584
|
+
return () => {
|
|
585
|
+
const newItems = list() || [], newLen = newItems.length;
|
|
586
|
+
newItems[$TRACK];
|
|
587
|
+
return untrack(() => {
|
|
588
|
+
if (newLen === 0) {
|
|
589
|
+
if (len !== 0) {
|
|
590
|
+
dispose(disposers);
|
|
591
|
+
disposers = [];
|
|
592
|
+
items = [];
|
|
593
|
+
mapped = [];
|
|
594
|
+
len = 0;
|
|
595
|
+
signals = [];
|
|
596
|
+
}
|
|
597
|
+
if (options.fallback) {
|
|
598
|
+
items = [FALLBACK];
|
|
599
|
+
mapped[0] = createRoot((disposer) => {
|
|
600
|
+
disposers[0] = disposer;
|
|
601
|
+
return options.fallback();
|
|
602
|
+
});
|
|
603
|
+
len = 1;
|
|
604
|
+
}
|
|
605
|
+
return mapped;
|
|
606
|
+
}
|
|
607
|
+
if (items[0] === FALLBACK) {
|
|
608
|
+
disposers[0]();
|
|
609
|
+
disposers = [];
|
|
610
|
+
items = [];
|
|
611
|
+
mapped = [];
|
|
612
|
+
len = 0;
|
|
613
|
+
}
|
|
614
|
+
for (i2 = 0; i2 < newLen; i2++) {
|
|
615
|
+
if (i2 < items.length && items[i2] !== newItems[i2]) {
|
|
616
|
+
signals[i2](() => newItems[i2]);
|
|
617
|
+
} else if (i2 >= items.length) {
|
|
618
|
+
mapped[i2] = createRoot(mapper);
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
for (; i2 < items.length; i2++) {
|
|
622
|
+
disposers[i2]();
|
|
623
|
+
}
|
|
624
|
+
len = signals.length = disposers.length = newLen;
|
|
625
|
+
items = newItems.slice(0);
|
|
626
|
+
return mapped = mapped.slice(0, len);
|
|
627
|
+
});
|
|
628
|
+
function mapper(disposer) {
|
|
629
|
+
disposers[i2] = disposer;
|
|
630
|
+
const [s3, set] = createSignal(newItems[i2]);
|
|
631
|
+
signals[i2] = set;
|
|
632
|
+
return mapFn(s3, i2);
|
|
633
|
+
}
|
|
634
|
+
};
|
|
635
|
+
}
|
|
581
636
|
function createComponent(Comp, props) {
|
|
582
637
|
return untrack(() => Comp(props || {}));
|
|
583
638
|
}
|
|
@@ -588,6 +643,12 @@ function For(props) {
|
|
|
588
643
|
};
|
|
589
644
|
return createMemo(mapArray(() => props.each, props.children, fallback || void 0));
|
|
590
645
|
}
|
|
646
|
+
function Index(props) {
|
|
647
|
+
const fallback = "fallback" in props && {
|
|
648
|
+
fallback: () => props.fallback
|
|
649
|
+
};
|
|
650
|
+
return createMemo(indexArray(() => props.each, props.children, fallback || void 0));
|
|
651
|
+
}
|
|
591
652
|
function Show(props) {
|
|
592
653
|
const keyed = props.keyed;
|
|
593
654
|
const conditionValue = createMemo(() => props.when, void 0, void 0);
|
|
@@ -890,7 +951,7 @@ function cleanChildren(parent, current, marker, replacement) {
|
|
|
890
951
|
|
|
891
952
|
// dist/styles.css
|
|
892
953
|
var styles_default = `/*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */
|
|
893
|
-
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial;--tw-contain-size:initial;--tw-contain-layout:initial;--tw-contain-paint:initial;--tw-contain-style:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-black:#000;--color-white:#fff;--spacing:.25rem;--font-weight-medium:500;--radius-xs:.125rem;--ease-out:cubic-bezier(0,0,.2,1);--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-grab-pink:#b21c8e;--color-grab-purple:#d239c0;--color-label-tag-border:#730079;--color-label-muted:#767676}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.top-0{top:calc(var(--spacing)*0)}.left-0{left:calc(var(--spacing)*0)}.z-2147483645{z-index:2147483645}.z-2147483646{z-index:2147483646}.z-2147483647{z-index:2147483647}.z-\\[2147483645\\]{z-index:2147483645}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.m-0{margin:calc(var(--spacing)*0)}.-ml-\\[2px\\]{margin-left:-2px}.ml-1{margin-left:calc(var(--spacing)*1)}.box-border{box-sizing:border-box}.flex{display:flex}.grid{display:grid}.hidden{display:none}.size-fit{width:fit-content;height:fit-content}.h-0{height:calc(var(--spacing)*0)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-5\\.5{height:calc(var(--spacing)*5.5)}.h-\\[7px\\]{height:7px}.h-\\[9px\\]{height:9px}.h-\\[18px\\]{height:18px}.h-fit{height:fit-content}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-4{min-height:calc(var(--spacing)*4)}.w-0{width:calc(var(--spacing)*0)}.w-0\\.5{width:calc(var(--spacing)*.5)}.w-1{width:calc(var(--spacing)*1)}.w-2\\.5{width:calc(var(--spacing)*2.5)}.w-\\[7px\\]{width:7px}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.max-w-\\[280px\\]{max-width:280px}.flex-1{flex:1}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.-translate-x-1\\/2{--tw-translate-x:calc(calc(1/2*100%)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y:calc(calc(1/2*100%)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.scale-75{--tw-scale-x:75%;--tw-scale-y:75%;--tw-scale-z:75%;scale:var(--tw-scale-x)var(--tw-scale-y)}.scale-100{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x)var(--tw-scale-y)}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.cursor-crosshair{cursor:crosshair}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.flex-col{flex-direction:column}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-0\\.5{gap:calc(var(--spacing)*.5)}.gap-1{gap:calc(var(--spacing)*1)}.gap-\\[3px\\]{gap:3px}.gap-\\[5px\\]{gap:5px}.gap-px{gap:1px}.self-stretch{align-self:stretch}.overflow-hidden{overflow:hidden}.rounded-\\[1\\.5px\\]{border-radius:1.5px}.rounded-\\[1px\\]{border-radius:1px}.rounded-full{border-radius:3.40282e38px}.rounded-xs{border-radius:var(--radius-xs)}.rounded-t-none{border-top-left-radius:0;border-top-right-radius:0}.rounded-b-xs{border-bottom-right-radius:var(--radius-xs);border-bottom-left-radius:var(--radius-xs)}.border{border-style:var(--tw-border-style);border-width:1px}.\\[border-width\\:0\\.5px\\]{border-width:.5px}.\\[border-top-width\\:0\\.5px\\]{border-top-width:.5px}.border-none{--tw-border-style:none;border-style:none}.border-solid{--tw-border-style:solid;border-style:solid}.border-\\[\\#B3B3B3\\]{border-color:#b3b3b3}.border-grab-purple{border-color:var(--color-grab-purple)}.border-grab-purple\\/40{border-color:#d239c066}@supports (color:color-mix(in lab, red, red)){.border-grab-purple\\/40{border-color:color-mix(in oklab,var(--color-grab-purple)40%,transparent)}}.border-grab-purple\\/50{border-color:#d239c080}@supports (color:color-mix(in lab, red, red)){.border-grab-purple\\/50{border-color:color-mix(in oklab,var(--color-grab-purple)50%,transparent)}}.border-label-tag-border{border-color:var(--color-label-tag-border)}.border-white{border-color:var(--color-white)}.border-t-\\[\\#D9D9D9\\]{border-top-color:#d9d9d9}.bg-\\[\\#F7F7F7\\]{background-color:#f7f7f7}.bg-black{background-color:var(--color-black)}.bg-grab-pink{background-color:var(--color-grab-pink)}.bg-grab-purple{background-color:var(--color-grab-purple)}.bg-grab-purple\\/5{background-color:#d239c00d}@supports (color:color-mix(in lab, red, red)){.bg-grab-purple\\/5{background-color:color-mix(in oklab,var(--color-grab-purple)5%,transparent)}}.bg-grab-purple\\/8{background-color:#d239c014}@supports (color:color-mix(in lab, red, red)){.bg-grab-purple\\/8{background-color:color-mix(in oklab,var(--color-grab-purple)8%,transparent)}}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-cover{background-size:cover}.bg-center{background-position:50%}.p-0{padding:calc(var(--spacing)*0)}.p-1{padding:calc(var(--spacing)*1)}.px-0{padding-inline:calc(var(--spacing)*0)}.px-1\\.5{padding-inline:calc(var(--spacing)*1.5)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-\\[3px\\]{padding-inline:3px}.py-0{padding-block:calc(var(--spacing)*0)}.py-1{padding-block:calc(var(--spacing)*1)}.py-\\[3px\\]{padding-block:3px}.py-\\[5px\\]{padding-block:5px}.py-px{padding-block:1px}.pt-1{padding-top:calc(var(--spacing)*1)}.align-middle{vertical-align:middle}.font-\\[ui-monospace\\,\\'SFMono-Regular\\'\\,\\'SF_Mono\\'\\,\\'Menlo\\'\\,\\'Consolas\\'\\,\\'Liberation_Mono\\'\\,monospace\\]{font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace}.font-mono{font-family:var(--font-mono)}.font-sans{font-family:var(--font-sans)}.text-\\[11\\.5px\\]{font-size:11.5px}.text-\\[12px\\]{font-size:12px}.leading-3\\.5{--tw-leading:calc(var(--spacing)*3.5);line-height:calc(var(--spacing)*3.5)}.leading-4{--tw-leading:calc(var(--spacing)*4);line-height:calc(var(--spacing)*4)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.tracking-\\[-0\\.04em\\]{--tw-tracking:-.04em;letter-spacing:-.04em}.tracking-\\[-0\\.08em\\]{--tw-tracking:-.08em;letter-spacing:-.08em}.break-all{word-break:break-all}.whitespace-normal{white-space:normal}.text-\\[\\#0C0C0C\\]{color:#0c0c0c}.text-\\[\\#47004A\\]{color:#47004a}.text-black{color:var(--color-black)}.text-black\\/50{color:#00000080}@supports (color:color-mix(in lab, red, red)){.text-black\\/50{color:color-mix(in oklab,var(--color-black)50%,transparent)}}.text-label-muted{color:var(--color-label-muted)}.text-label-tag-border{color:var(--color-label-tag-border)}.text-white{color:var(--color-white)}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-100{opacity:1}.opacity-\\[0\\.99\\]{opacity:.99}.brightness-125{--tw-brightness:brightness(125%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.filter-\\[drop-shadow\\(0px_0px_4px_\\#51515180\\)\\]{filter:drop-shadow(0 0 4px #51515180)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[grid-template-rows\\]{transition-property:grid-template-rows;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[width\\,height\\]{transition-property:width,height;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-none{transition-property:none}.duration-30{--tw-duration:30ms;transition-duration:30ms}.duration-100{--tw-duration:.1s;transition-duration:.1s}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.will-change-\\[transform\\,width\\,height\\]{will-change:transform,width,height}.contain-layout{--tw-contain-layout:layout;contain:var(--tw-contain-size,)var(--tw-contain-layout,)var(--tw-contain-paint,)var(--tw-contain-style,)}.outline-none{--tw-outline-style:none;outline-style:none}.\\[font-synthesis\\:none\\]{font-synthesis:none}@media (hover:hover){.hover\\:scale-105:hover{--tw-scale-x:105%;--tw-scale-y:105%;--tw-scale-z:105%;scale:var(--tw-scale-x)var(--tw-scale-y)}.hover\\:text-black:hover{color:var(--color-black)}.hover\\:opacity-100:hover{opacity:1}}}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@keyframes flash{0%{opacity:1;background-color:#d239c040;border-color:#d239c0}50%{opacity:1;background-color:#d239c073;border-color:#e650d2}to{opacity:1;background-color:#d239c014;border-color:#d239c080}}.react-grab-flash{animation:.4s ease-out forwards flash}.react-grab-shimmer{position:relative;overflow:hidden}.react-grab-shimmer:after{content:"";border-radius:inherit;pointer-events:none;background:linear-gradient(90deg,#0000 0%,#fff6 50%,#0000 100%) 0 0/200% 100%;animation:1.5s ease-in-out infinite shimmer;position:absolute;inset:0}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-contain-size{syntax:"*";inherits:false}@property --tw-contain-layout{syntax:"*";inherits:false}@property --tw-contain-paint{syntax:"*";inherits:false}@property --tw-contain-style{syntax:"*";inherits:false}@keyframes pulse{50%{opacity:.5}}`;
|
|
954
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial;--tw-contain-size:initial;--tw-contain-layout:initial;--tw-contain-paint:initial;--tw-contain-style:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-black:#000;--color-white:#fff;--spacing:.25rem;--font-weight-medium:500;--radius-xs:.125rem;--ease-out:cubic-bezier(0,0,.2,1);--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-grab-pink:#b21c8e;--color-grab-purple:#d239c0;--color-label-tag-border:#730079;--color-label-muted:#767676}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.top-0{top:calc(var(--spacing)*0)}.left-0{left:calc(var(--spacing)*0)}.z-2147483645{z-index:2147483645}.z-2147483646{z-index:2147483646}.z-2147483647{z-index:2147483647}.z-\\[2147483645\\]{z-index:2147483645}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.m-0{margin:calc(var(--spacing)*0)}.-mt-px{margin-top:-1px}.-ml-\\[2px\\]{margin-left:-2px}.ml-1{margin-left:calc(var(--spacing)*1)}.box-border{box-sizing:border-box}.flex{display:flex}.grid{display:grid}.hidden{display:none}.size-fit{width:fit-content;height:fit-content}.h-0{height:calc(var(--spacing)*0)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-5\\.5{height:calc(var(--spacing)*5.5)}.h-\\[7px\\]{height:7px}.h-\\[17px\\]{height:17px}.h-\\[18px\\]{height:18px}.h-fit{height:fit-content}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-4{min-height:calc(var(--spacing)*4)}.w-0{width:calc(var(--spacing)*0)}.w-0\\.5{width:calc(var(--spacing)*.5)}.w-1{width:calc(var(--spacing)*1)}.w-\\[7px\\]{width:7px}.w-\\[17px\\]{width:17px}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.max-w-\\[280px\\]{max-width:280px}.flex-1{flex:1}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.-translate-x-1\\/2{--tw-translate-x:calc(calc(1/2*100%)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y:calc(calc(1/2*100%)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.scale-75{--tw-scale-x:75%;--tw-scale-y:75%;--tw-scale-z:75%;scale:var(--tw-scale-x)var(--tw-scale-y)}.scale-100{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x)var(--tw-scale-y)}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.cursor-crosshair{cursor:crosshair}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.flex-col{flex-direction:column}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\\.5{gap:calc(var(--spacing)*.5)}.gap-1{gap:calc(var(--spacing)*1)}.gap-\\[3px\\]{gap:3px}.gap-\\[5px\\]{gap:5px}.gap-px{gap:1px}.self-stretch{align-self:stretch}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded-\\[1\\.5px\\]{border-radius:1.5px}.rounded-\\[1px\\]{border-radius:1px}.rounded-full{border-radius:3.40282e38px}.rounded-xs{border-radius:var(--radius-xs)}.rounded-t-none{border-top-left-radius:0;border-top-right-radius:0}.rounded-b-xs{border-bottom-right-radius:var(--radius-xs);border-bottom-left-radius:var(--radius-xs)}.border{border-style:var(--tw-border-style);border-width:1px}.\\[border-width\\:0\\.5px\\]{border-width:.5px}.\\[border-top-width\\:0\\.5px\\]{border-top-width:.5px}.border-none{--tw-border-style:none;border-style:none}.border-solid{--tw-border-style:solid;border-style:solid}.border-\\[\\#7e0002\\]{border-color:#7e0002}.border-\\[\\#B3B3B3\\]{border-color:#b3b3b3}.border-grab-purple{border-color:var(--color-grab-purple)}.border-grab-purple\\/40{border-color:#d239c066}@supports (color:color-mix(in lab, red, red)){.border-grab-purple\\/40{border-color:color-mix(in oklab,var(--color-grab-purple)40%,transparent)}}.border-grab-purple\\/50{border-color:#d239c080}@supports (color:color-mix(in lab, red, red)){.border-grab-purple\\/50{border-color:color-mix(in oklab,var(--color-grab-purple)50%,transparent)}}.border-label-tag-border{border-color:var(--color-label-tag-border)}.border-white{border-color:var(--color-white)}.border-t-\\[\\#D9D9D9\\]{border-top-color:#d9d9d9}.bg-\\[\\#F7F7F7\\]{background-color:#f7f7f7}.bg-black{background-color:var(--color-black)}.bg-grab-pink{background-color:var(--color-grab-pink)}.bg-grab-purple{background-color:var(--color-grab-purple)}.bg-grab-purple\\/5{background-color:#d239c00d}@supports (color:color-mix(in lab, red, red)){.bg-grab-purple\\/5{background-color:color-mix(in oklab,var(--color-grab-purple)5%,transparent)}}.bg-grab-purple\\/8{background-color:#d239c014}@supports (color:color-mix(in lab, red, red)){.bg-grab-purple\\/8{background-color:color-mix(in oklab,var(--color-grab-purple)8%,transparent)}}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.p-0{padding:calc(var(--spacing)*0)}.p-1{padding:calc(var(--spacing)*1)}.px-0{padding-inline:calc(var(--spacing)*0)}.px-1\\.5{padding-inline:calc(var(--spacing)*1.5)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-\\[2px\\]{padding-inline:2px}.px-\\[3px\\]{padding-inline:3px}.py-0{padding-block:calc(var(--spacing)*0)}.py-1{padding-block:calc(var(--spacing)*1)}.py-\\[2px\\]{padding-block:2px}.py-\\[3px\\]{padding-block:3px}.py-\\[5px\\]{padding-block:5px}.py-px{padding-block:1px}.pt-1{padding-top:calc(var(--spacing)*1)}.pr-1{padding-right:calc(var(--spacing)*1)}.pr-1\\.5{padding-right:calc(var(--spacing)*1.5)}.pl-1\\.5{padding-left:calc(var(--spacing)*1.5)}.align-middle{vertical-align:middle}.font-\\[ui-monospace\\,\\'SFMono-Regular\\'\\,\\'SF_Mono\\'\\,\\'Menlo\\'\\,\\'Consolas\\'\\,\\'Liberation_Mono\\'\\,monospace\\]{font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace}.font-mono{font-family:var(--font-mono)}.font-sans{font-family:var(--font-sans)}.text-\\[11\\.5px\\]{font-size:11.5px}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.leading-3\\.5{--tw-leading:calc(var(--spacing)*3.5);line-height:calc(var(--spacing)*3.5)}.leading-4{--tw-leading:calc(var(--spacing)*4);line-height:calc(var(--spacing)*4)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.tracking-\\[-0\\.04em\\]{--tw-tracking:-.04em;letter-spacing:-.04em}.tracking-\\[-0\\.08em\\]{--tw-tracking:-.08em;letter-spacing:-.08em}.wrap-break-word{overflow-wrap:break-word}.whitespace-normal{white-space:normal}.text-\\[\\#0C0C0C\\]{color:#0c0c0c}.text-\\[\\#47004A\\]{color:#47004a}.text-\\[\\#71717a\\]{color:#71717a}.text-\\[\\#B91C1C\\]{color:#b91c1c}.text-\\[\\#c00002\\]{color:#c00002}.text-black{color:var(--color-black)}.text-label-muted{color:var(--color-label-muted)}.text-label-tag-border{color:var(--color-label-tag-border)}.text-white{color:var(--color-white)}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-100{opacity:1}.opacity-\\[0\\.99\\]{opacity:.99}.brightness-125{--tw-brightness:brightness(125%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.filter-\\[drop-shadow\\(0px_0px_4px_\\#51515180\\)\\]{filter:drop-shadow(0 0 4px #51515180)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[grid-template-rows\\]{transition-property:grid-template-rows;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[width\\,height\\]{transition-property:width,height;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-none{transition-property:none}.duration-30{--tw-duration:30ms;transition-duration:30ms}.duration-100{--tw-duration:.1s;transition-duration:.1s}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.will-change-\\[transform\\,width\\,height\\]{will-change:transform,width,height}.contain-layout{--tw-contain-layout:layout;contain:var(--tw-contain-size,)var(--tw-contain-layout,)var(--tw-contain-paint,)var(--tw-contain-style,)}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.\\[font-synthesis\\:none\\]{font-synthesis:none}@media (hover:hover){.hover\\:scale-105:hover{--tw-scale-x:105%;--tw-scale-y:105%;--tw-scale-z:105%;scale:var(--tw-scale-x)var(--tw-scale-y)}.hover\\:bg-\\[\\#F5F5F5\\]:hover{background-color:#f5f5f5}.hover\\:bg-\\[\\#FEF2F2\\]:hover{background-color:#fef2f2}.hover\\:opacity-100:hover{opacity:1}}}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-contain-size{syntax:"*";inherits:false}@property --tw-contain-layout{syntax:"*";inherits:false}@property --tw-contain-paint{syntax:"*";inherits:false}@property --tw-contain-style{syntax:"*";inherits:false}@keyframes pulse{50%{opacity:.5}}`;
|
|
894
955
|
|
|
895
956
|
// src/utils/is-keyboard-event-triggered-by-input.ts
|
|
896
957
|
var FORM_TAGS_AND_ROLES = [
|
|
@@ -1019,7 +1080,7 @@ var buildOpenFileUrl = (filePath, lineNumber) => {
|
|
|
1019
1080
|
};
|
|
1020
1081
|
|
|
1021
1082
|
// src/constants.ts
|
|
1022
|
-
var VERSION = "0.0.
|
|
1083
|
+
var VERSION = "0.0.72";
|
|
1023
1084
|
var VIEWPORT_MARGIN_PX = 8;
|
|
1024
1085
|
var OFFSCREEN_POSITION = -1e3;
|
|
1025
1086
|
var SELECTION_LERP_FACTOR = 0.95;
|
|
@@ -1029,6 +1090,7 @@ var SELECTION_CURSOR_SETTLE_DELAY_MS = 500;
|
|
|
1029
1090
|
var BLUR_DEACTIVATION_THRESHOLD_MS = 500;
|
|
1030
1091
|
var DRAG_THRESHOLD_PX = 2;
|
|
1031
1092
|
var ELEMENT_DETECTION_THROTTLE_MS = 32;
|
|
1093
|
+
var BOUNDS_RECALC_INTERVAL_MS = 100;
|
|
1032
1094
|
var AUTO_SCROLL_EDGE_THRESHOLD_PX = 25;
|
|
1033
1095
|
var AUTO_SCROLL_SPEED_PX = 10;
|
|
1034
1096
|
var Z_INDEX_LABEL = 2147483647;
|
|
@@ -3600,7 +3662,7 @@ var SelectionBox = (props) => {
|
|
|
3600
3662
|
get children() {
|
|
3601
3663
|
var _el$ = _tmpl$();
|
|
3602
3664
|
createRenderEffect((_p$) => {
|
|
3603
|
-
var _v$ = cn("fixed box-border", props.variant === "drag" && "pointer-events-none", props.variant !== "drag" && "pointer-events-auto", props.variant === "grabbed" && "z-2147483645", props.variant !== "grabbed" && "z-2147483646", props.variant === "drag" && "border border-solid border-grab-purple/40 bg-grab-purple/5 will-change-[transform,width,height] cursor-crosshair", props.variant === "selection" && "border border-solid border-grab-purple/50 bg-grab-purple/8 transition-opacity duration-100 ease-out", props.variant === "grabbed" && "border border-solid
|
|
3665
|
+
var _v$ = cn("fixed box-border", props.variant === "drag" && "pointer-events-none", props.variant !== "drag" && "pointer-events-auto", props.variant === "grabbed" && "z-2147483645", props.variant !== "grabbed" && "z-2147483646", props.variant === "drag" && "border border-solid border-grab-purple/40 bg-grab-purple/5 will-change-[transform,width,height] cursor-crosshair", props.variant === "selection" && "border border-solid border-grab-purple/50 bg-grab-purple/8 transition-opacity duration-100 ease-out", props.variant === "grabbed" && "border border-solid border-grab-purple/50 bg-grab-purple/8", props.variant === "processing" && !props.isCompleted && "border border-solid border-grab-purple/50 bg-grab-purple/8", props.variant === "processing" && props.isCompleted && "border border-solid border-grab-purple/50 bg-grab-purple/8"), _v$2 = `${currentY()}px`, _v$3 = `${currentX()}px`, _v$4 = `${currentWidth()}px`, _v$5 = `${currentHeight()}px`, _v$6 = props.bounds.borderRadius, _v$7 = props.bounds.transform, _v$8 = props.isFading ? 0 : opacity(), _v$9 = props.variant === "drag" ? "layout paint size" : void 0;
|
|
3604
3666
|
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
3605
3667
|
_v$2 !== _p$.t && setStyleProperty(_el$, "top", _p$.t = _v$2);
|
|
3606
3668
|
_v$3 !== _p$.a && setStyleProperty(_el$, "left", _p$.a = _v$3);
|
|
@@ -3762,7 +3824,7 @@ var useSpeechRecognition = (options) => {
|
|
|
3762
3824
|
let baseValue;
|
|
3763
3825
|
if (lastInterimText && currentValue.endsWith(lastInterimText)) {
|
|
3764
3826
|
baseValue = currentValue.slice(0, -lastInterimText.length);
|
|
3765
|
-
} else if (currentValue === lastValueWeSet) {
|
|
3827
|
+
} else if (currentValue === lastValueWeSet && lastInterimText) {
|
|
3766
3828
|
baseValue = currentValue.slice(0, -lastInterimText.length);
|
|
3767
3829
|
} else {
|
|
3768
3830
|
baseValue = currentValue;
|
|
@@ -3859,24 +3921,48 @@ var IconMic = (props) => {
|
|
|
3859
3921
|
})();
|
|
3860
3922
|
};
|
|
3861
3923
|
|
|
3924
|
+
// src/components/icon-return.tsx
|
|
3925
|
+
var _tmpl$5 = /* @__PURE__ */ template(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 22 19"fill=none><path d="M6.76263 18.6626C7.48251 18.6626 7.95474 18.1682 7.95474 17.4895C7.95474 17.1207 7.80474 16.8576 7.58683 16.6361L5.3018 14.4137L2.84621 12.3589L2.44374 13.0037L5.92137 13.1622H17.9232C20.4842 13.1622 21.593 12.021 21.593 9.47237V3.66983C21.593 1.10875 20.4842 0 17.9232 0H12.5414C11.8179 0 11.3018 0.545895 11.3018 1.21695C11.3018 1.888 11.8179 2.43389 12.5414 2.43389H17.8424C18.7937 2.43389 19.1897 2.83653 19.1897 3.78784V9.35747C19.1897 10.3257 18.7937 10.7314 17.8424 10.7314H5.92137L2.44374 10.8832L2.84621 11.5281L5.3018 9.47993L7.58683 7.2606C7.80474 7.03914 7.95474 6.7693 7.95474 6.40049C7.95474 5.72854 7.48251 5.22747 6.76263 5.22747C6.46129 5.22747 6.12975 5.36905 5.89231 5.6096L0.376815 11.0425C0.134921 11.2777 0 11.6141 0 11.9452C0 12.2728 0.134921 12.6158 0.376815 12.848L5.89231 18.2871C6.12975 18.5276 6.46129 18.6626 6.76263 18.6626Z"fill=currentColor>`);
|
|
3926
|
+
var IconReturn = (props) => {
|
|
3927
|
+
const size = () => props.size ?? 12;
|
|
3928
|
+
return (() => {
|
|
3929
|
+
var _el$ = _tmpl$5();
|
|
3930
|
+
createRenderEffect((_p$) => {
|
|
3931
|
+
var _v$ = size(), _v$2 = size() * 19 / 22, _v$3 = props.class;
|
|
3932
|
+
_v$ !== _p$.e && setAttribute(_el$, "width", _p$.e = _v$);
|
|
3933
|
+
_v$2 !== _p$.t && setAttribute(_el$, "height", _p$.t = _v$2);
|
|
3934
|
+
_v$3 !== _p$.a && setAttribute(_el$, "class", _p$.a = _v$3);
|
|
3935
|
+
return _p$;
|
|
3936
|
+
}, {
|
|
3937
|
+
e: void 0,
|
|
3938
|
+
t: void 0,
|
|
3939
|
+
a: void 0
|
|
3940
|
+
});
|
|
3941
|
+
return _el$;
|
|
3942
|
+
})();
|
|
3943
|
+
};
|
|
3944
|
+
|
|
3862
3945
|
// src/components/selection-label.tsx
|
|
3863
|
-
var _tmpl$
|
|
3946
|
+
var _tmpl$6 = /* @__PURE__ */ template(`<div style="background-image:linear-gradient(in oklab 180deg, oklab(88.7% 0.086 -0.058) 0%, oklab(83.2% 0.132 -0.089) 100%)"><span>`);
|
|
3864
3947
|
var _tmpl$22 = /* @__PURE__ */ template(`<div class="contain-layout shrink-0 flex items-center w-fit h-4 rounded-[1px] gap-1 px-[3px] [border-width:0.5px] border-solid border-[#B3B3B3] py-0 bg-[#F7F7F7]"><span class="text-[#0C0C0C] text-[11.5px] leading-3.5 shrink-0 tracking-[-0.08em] font-[ui-monospace,'SFMono-Regular','SF_Mono','Menlo','Consolas','Liberation_Mono',monospace] w-fit h-fit">`);
|
|
3865
3948
|
var _tmpl$32 = /* @__PURE__ */ template(`<div class="contain-layout shrink-0 flex items-center w-fit h-4 rounded-[1px] gap-1 px-[3px] [border-width:0.5px] border-solid border-white py-0"><span class="text-[#0C0C0C] text-[11.5px] leading-3.5 shrink-0 tracking-[-0.08em] font-[ui-monospace,'SFMono-Regular','SF_Mono','Menlo','Consolas','Liberation_Mono',monospace] w-fit h-fit">>`);
|
|
3866
3949
|
var _tmpl$42 = /* @__PURE__ */ template(`<div class="absolute w-0 h-0"style="border-left:8px solid transparent;border-right:8px solid transparent">`);
|
|
3867
3950
|
var _tmpl$52 = /* @__PURE__ */ template(`<div role=button><div class="text-black text-[12px] leading-4 shrink-0 tracking-[-0.04em] font-sans font-medium w-fit h-fit">`);
|
|
3868
|
-
var _tmpl$
|
|
3869
|
-
var _tmpl$7 = /* @__PURE__ */ template(`<div class="[
|
|
3870
|
-
var _tmpl$8 = /* @__PURE__ */ template(`<
|
|
3871
|
-
var _tmpl$9 = /* @__PURE__ */ template(`<div class="shrink-0 flex
|
|
3872
|
-
var _tmpl$0 = /* @__PURE__ */ template(`<
|
|
3873
|
-
var _tmpl$1 = /* @__PURE__ */ template(`<div class="
|
|
3874
|
-
var _tmpl$10 = /* @__PURE__ */ template(`<div class="contain-layout shrink-0 flex
|
|
3875
|
-
var _tmpl$11 = /* @__PURE__ */ template(`<div class="contain-layout shrink-0 flex
|
|
3876
|
-
var _tmpl$12 = /* @__PURE__ */ template(`<
|
|
3877
|
-
var _tmpl$13 = /* @__PURE__ */ template(`<div class="shrink-0 flex justify-
|
|
3878
|
-
var _tmpl$14 = /* @__PURE__ */ template(`<
|
|
3879
|
-
var _tmpl$15 = /* @__PURE__ */ template(`<
|
|
3951
|
+
var _tmpl$62 = /* @__PURE__ */ template(`<div class="[font-synthesis:none] contain-layout shrink-0 flex flex-col items-start px-2 py-[5px] w-auto h-fit self-stretch [border-top-width:0.5px] border-t-solid border-t-[#D9D9D9] antialiased rounded-t-none rounded-b-xs -mt-px"style="background-image:linear-gradient(in oklab 180deg, oklab(100% 0 0) 0%, oklab(96.1% 0 0) 5.92%)">`);
|
|
3952
|
+
var _tmpl$7 = /* @__PURE__ */ template(`<div class="contain-layout shrink-0 flex items-center justify-end gap-[5px] w-full h-fit"><button class="contain-layout shrink-0 flex items-center justify-center px-[3px] py-px rounded-xs bg-white [border-width:0.5px] border-solid border-[#B3B3B3] cursor-pointer transition-all hover:bg-[#F5F5F5] h-[17px]"><span class="text-black text-[11px] leading-3.5 tracking-[-0.04em] font-sans font-medium">No</span></button><button class="contain-layout shrink-0 flex items-center justify-center gap-1 px-[3px] py-px rounded-xs bg-white [border-width:0.5px] border-solid border-[#7e0002] cursor-pointer transition-all hover:bg-[#FEF2F2] h-[17px]"><span class="text-[#B91C1C] text-[11px] leading-3.5 tracking-[-0.04em] font-sans font-medium">Yes`);
|
|
3953
|
+
var _tmpl$8 = /* @__PURE__ */ template(`<div class="contain-layout shrink-0 flex flex-col justify-center items-end gap-1 w-fit h-fit"><div class="contain-layout shrink-0 flex items-center gap-1 pt-1 px-1.5 w-full h-fit"><span class="text-black text-[12px] leading-4 shrink-0 tracking-[-0.04em] font-sans font-medium w-fit h-fit">Discard prompt?`);
|
|
3954
|
+
var _tmpl$9 = /* @__PURE__ */ template(`<div class="[font-synthesis:none] contain-layout shrink-0 flex items-center gap-1 rounded-xs bg-white antialiased w-fit h-fit py-1 px-1.5"><div class="contain-layout shrink-0 flex items-center px-0 py-px w-fit h-[18px] rounded-[1.5px] gap-[3px]"><div class="text-black text-[12px] leading-4 shrink-0 tracking-[-0.04em] font-sans font-medium w-fit h-fit">`);
|
|
3955
|
+
var _tmpl$0 = /* @__PURE__ */ template(`<button data-react-grab-ignore-events class="contain-layout shrink-0 flex flex-col items-start rounded-xs bg-white [border-width:0.5px] border-solid border-[#B3B3B3] p-1 size-fit cursor-pointer ml-1 transition-none hover:scale-105"><div data-react-grab-ignore-events class="shrink-0 w-[7px] h-[7px] rounded-[1px] bg-black pointer-events-none">`);
|
|
3956
|
+
var _tmpl$1 = /* @__PURE__ */ template(`<div class="shrink-0 flex justify-between items-end w-full min-h-4"><textarea class="text-black text-[12px] leading-4 tracking-[-0.04em] font-medium bg-transparent border-none outline-none resize-none flex-1 p-0 m-0 opacity-50 wrap-break-word overflow-y-auto"placeholder="type to edit"rows=1 disabled style=field-sizing:content;min-height:16px;max-height:95px;scrollbar-width:none>`);
|
|
3957
|
+
var _tmpl$10 = /* @__PURE__ */ template(`<div class="contain-layout shrink-0 flex flex-col justify-center items-start gap-1 w-fit h-fit max-w-[280px]"><div class="contain-layout shrink-0 flex items-center gap-1 pt-1 px-1.5 w-auto h-fit"><div class="contain-layout flex items-center px-0 py-px w-auto h-fit rounded-[1.5px] gap-[3px]"><span class="text-[12px] leading-4 tracking-[-0.04em] font-sans font-medium w-auto h-fit whitespace-normal text-[#71717a] animate-pulse">`);
|
|
3958
|
+
var _tmpl$11 = /* @__PURE__ */ template(`<div class="contain-layout shrink-0 flex items-center gap-px w-fit h-fit">`);
|
|
3959
|
+
var _tmpl$12 = /* @__PURE__ */ template(`<div class="contain-layout shrink-0 flex items-center gap-1 w-fit h-fit"><span class="text-label-muted text-[12px] leading-4 shrink-0 tracking-[-0.04em] font-sans font-medium w-fit h-fit">Press</span><div class="contain-layout shrink-0 flex flex-col items-start px-[3px] py-[3px] rounded-xs bg-white [border-width:0.5px] border-solid border-[#B3B3B3] size-fit"></div><span class="text-label-muted text-[12px] leading-4 shrink-0 tracking-[-0.04em] font-sans font-medium w-fit h-fit">to edit`);
|
|
3960
|
+
var _tmpl$13 = /* @__PURE__ */ template(`<div class="contain-layout shrink-0 flex flex-col justify-center items-start gap-1 w-fit h-fit"><div></div><div class="grid transition-[grid-template-rows] duration-30 ease-out self-stretch"><div>`);
|
|
3961
|
+
var _tmpl$14 = /* @__PURE__ */ template(`<button>`);
|
|
3962
|
+
var _tmpl$15 = /* @__PURE__ */ template(`<button class="contain-layout shrink-0 flex flex-col items-start px-[3px] py-[3px] rounded-xs bg-white [border-width:0.5px] border-solid border-[#B3B3B3] size-fit cursor-pointer transition-all hover:scale-105">`);
|
|
3963
|
+
var _tmpl$16 = /* @__PURE__ */ template(`<div class="shrink-0 flex justify-between items-end w-full min-h-4"><textarea class="text-black text-[12px] leading-4 tracking-[-0.04em] font-medium bg-transparent border-none outline-none resize-none flex-1 p-0 m-0 wrap-break-word overflow-y-auto"rows=1 style=field-sizing:content;min-height:16px;max-height:95px;scrollbar-width:none></textarea><div class="flex items-center gap-0.5 ml-1 w-[17px] h-[17px] justify-end">`);
|
|
3964
|
+
var _tmpl$17 = /* @__PURE__ */ template(`<div class="contain-layout shrink-0 flex flex-col justify-center items-start gap-1 w-fit h-fit max-w-[280px]"><div>`);
|
|
3965
|
+
var _tmpl$18 = /* @__PURE__ */ template(`<div data-react-grab-ignore-events class="fixed font-sans antialiased transition-opacity duration-300 ease-out filter-[drop-shadow(0px_0px_4px_#51515180)] select-none"style=z-index:2147483647><div class="[font-synthesis:none] contain-layout flex items-center gap-[5px] rounded-xs bg-white antialiased w-fit h-fit p-0">`);
|
|
3880
3966
|
var ARROW_HEIGHT = 8;
|
|
3881
3967
|
var LABEL_GAP = 4;
|
|
3882
3968
|
var IDLE_TIMEOUT_MS = 400;
|
|
@@ -3891,7 +3977,7 @@ var TagBadge = (props) => {
|
|
|
3891
3977
|
props.onHoverChange?.(false);
|
|
3892
3978
|
};
|
|
3893
3979
|
return (() => {
|
|
3894
|
-
var _el$ = _tmpl$
|
|
3980
|
+
var _el$ = _tmpl$6(), _el$2 = _el$.firstChild;
|
|
3895
3981
|
addEventListener(_el$, "click", props.onClick);
|
|
3896
3982
|
_el$.addEventListener("mouseleave", handleMouseLeave);
|
|
3897
3983
|
_el$.addEventListener("mouseenter", handleMouseEnter);
|
|
@@ -3964,19 +4050,61 @@ var ClickToCopyPill = (props) => {
|
|
|
3964
4050
|
})();
|
|
3965
4051
|
};
|
|
3966
4052
|
var BottomSection = (props) => (() => {
|
|
3967
|
-
var _el$9 = _tmpl$
|
|
4053
|
+
var _el$9 = _tmpl$62();
|
|
3968
4054
|
insert(_el$9, () => props.children);
|
|
3969
4055
|
return _el$9;
|
|
3970
4056
|
})();
|
|
4057
|
+
var DismissConfirmation = (props) => {
|
|
4058
|
+
const handleKeyDown = (event) => {
|
|
4059
|
+
if (event.code === "Enter") {
|
|
4060
|
+
event.preventDefault();
|
|
4061
|
+
event.stopPropagation();
|
|
4062
|
+
props.onConfirm?.();
|
|
4063
|
+
} else if (event.code === "Escape") {
|
|
4064
|
+
event.preventDefault();
|
|
4065
|
+
event.stopPropagation();
|
|
4066
|
+
props.onCancel?.();
|
|
4067
|
+
}
|
|
4068
|
+
};
|
|
4069
|
+
onMount(() => {
|
|
4070
|
+
window.addEventListener("keydown", handleKeyDown, {
|
|
4071
|
+
capture: true
|
|
4072
|
+
});
|
|
4073
|
+
});
|
|
4074
|
+
onCleanup(() => {
|
|
4075
|
+
window.removeEventListener("keydown", handleKeyDown, {
|
|
4076
|
+
capture: true
|
|
4077
|
+
});
|
|
4078
|
+
});
|
|
4079
|
+
return (() => {
|
|
4080
|
+
var _el$0 = _tmpl$8(); _el$0.firstChild;
|
|
4081
|
+
insert(_el$0, createComponent(BottomSection, {
|
|
4082
|
+
get children() {
|
|
4083
|
+
var _el$10 = _tmpl$7(), _el$11 = _el$10.firstChild, _el$12 = _el$11.nextSibling; _el$12.firstChild;
|
|
4084
|
+
addEventListener(_el$11, "click", props.onCancel);
|
|
4085
|
+
addEventListener(_el$12, "click", props.onConfirm);
|
|
4086
|
+
insert(_el$12, createComponent(IconReturn, {
|
|
4087
|
+
size: 10,
|
|
4088
|
+
"class": "text-[#c00002]"
|
|
4089
|
+
}), null);
|
|
4090
|
+
return _el$10;
|
|
4091
|
+
}
|
|
4092
|
+
}), null);
|
|
4093
|
+
return _el$0;
|
|
4094
|
+
})();
|
|
4095
|
+
};
|
|
3971
4096
|
var SelectionLabel = (props) => {
|
|
3972
4097
|
let containerRef;
|
|
3973
4098
|
let inputRef;
|
|
3974
4099
|
let isTagCurrentlyHovered = false;
|
|
4100
|
+
let lastValidPosition = null;
|
|
4101
|
+
let lastElementIdentity = null;
|
|
3975
4102
|
const [measuredWidth, setMeasuredWidth] = createSignal(0);
|
|
3976
4103
|
const [measuredHeight, setMeasuredHeight] = createSignal(0);
|
|
3977
4104
|
const [arrowPosition, setArrowPosition] = createSignal("bottom");
|
|
3978
4105
|
const [viewportVersion, setViewportVersion] = createSignal(0);
|
|
3979
4106
|
const [isIdle, setIsIdle] = createSignal(false);
|
|
4107
|
+
const [hadValidBounds, setHadValidBounds] = createSignal(false);
|
|
3980
4108
|
const speechRecognition = useSpeechRecognition({
|
|
3981
4109
|
onTranscript: (transcript) => props.onInputChange?.(transcript),
|
|
3982
4110
|
getCurrentValue: () => props.inputValue ?? ""
|
|
@@ -4033,8 +4161,11 @@ var SelectionLabel = (props) => {
|
|
|
4033
4161
|
}
|
|
4034
4162
|
});
|
|
4035
4163
|
createEffect(() => {
|
|
4036
|
-
|
|
4037
|
-
|
|
4164
|
+
const elementIdentity = `${props.tagName ?? ""}:${props.componentName ?? ""}`;
|
|
4165
|
+
if (elementIdentity !== lastElementIdentity) {
|
|
4166
|
+
lastElementIdentity = elementIdentity;
|
|
4167
|
+
resetIdleTimer();
|
|
4168
|
+
}
|
|
4038
4169
|
});
|
|
4039
4170
|
createEffect(() => {
|
|
4040
4171
|
if (props.visible) {
|
|
@@ -4059,8 +4190,10 @@ var SelectionLabel = (props) => {
|
|
|
4059
4190
|
const bounds = props.selectionBounds;
|
|
4060
4191
|
const labelWidth = measuredWidth();
|
|
4061
4192
|
const labelHeight = measuredHeight();
|
|
4062
|
-
|
|
4063
|
-
|
|
4193
|
+
const hasMeasurements = labelWidth > 0 && labelHeight > 0;
|
|
4194
|
+
const hasValidBounds = bounds && bounds.width > 0 && bounds.height > 0;
|
|
4195
|
+
if (!hasMeasurements || !hasValidBounds) {
|
|
4196
|
+
return lastValidPosition ?? {
|
|
4064
4197
|
left: -9999,
|
|
4065
4198
|
top: -9999,
|
|
4066
4199
|
arrowLeft: 0
|
|
@@ -4092,17 +4225,21 @@ var SelectionLabel = (props) => {
|
|
|
4092
4225
|
positionTop = VIEWPORT_MARGIN_PX;
|
|
4093
4226
|
}
|
|
4094
4227
|
const arrowLeft = Math.max(12, Math.min(cursorX - positionLeft, labelWidth - 12));
|
|
4095
|
-
|
|
4228
|
+
const position = {
|
|
4096
4229
|
left: positionLeft,
|
|
4097
4230
|
top: positionTop,
|
|
4098
4231
|
arrowLeft
|
|
4099
4232
|
};
|
|
4233
|
+
lastValidPosition = position;
|
|
4234
|
+
setHadValidBounds(true);
|
|
4235
|
+
return position;
|
|
4100
4236
|
};
|
|
4101
4237
|
const handleKeyDown = (event) => {
|
|
4102
4238
|
event.stopPropagation();
|
|
4103
4239
|
event.stopImmediatePropagation();
|
|
4104
4240
|
if (event.code === "Enter" && !event.shiftKey) {
|
|
4105
4241
|
event.preventDefault();
|
|
4242
|
+
if (!props.inputValue?.trim()) return;
|
|
4106
4243
|
speechRecognition.stop();
|
|
4107
4244
|
props.onSubmit?.();
|
|
4108
4245
|
} else if (event.code === "Escape") {
|
|
@@ -4128,75 +4265,93 @@ var SelectionLabel = (props) => {
|
|
|
4128
4265
|
event.stopPropagation();
|
|
4129
4266
|
event.stopImmediatePropagation();
|
|
4130
4267
|
};
|
|
4268
|
+
const handleContainerPointerDown = (event) => {
|
|
4269
|
+
stopPropagation(event);
|
|
4270
|
+
const isEditableInputVisible = isNotProcessing() && props.isInputExpanded && !props.isPendingDismiss;
|
|
4271
|
+
if (isEditableInputVisible && inputRef) {
|
|
4272
|
+
inputRef.focus();
|
|
4273
|
+
}
|
|
4274
|
+
};
|
|
4131
4275
|
const handleSubmit = () => {
|
|
4276
|
+
if (props.isInputExpanded && !props.inputValue?.trim()) return;
|
|
4132
4277
|
speechRecognition.stop();
|
|
4133
4278
|
props.onSubmit?.();
|
|
4134
4279
|
};
|
|
4280
|
+
const shouldShowWithoutBounds = () => hadValidBounds() && (props.status === "copied" || props.status === "fading");
|
|
4135
4281
|
return createComponent(Show, {
|
|
4136
4282
|
get when() {
|
|
4137
|
-
return memo(() => props.visible !== false)() && props.selectionBounds;
|
|
4283
|
+
return memo(() => props.visible !== false)() && (props.selectionBounds || shouldShowWithoutBounds());
|
|
4138
4284
|
},
|
|
4139
4285
|
get children() {
|
|
4140
|
-
var _el$
|
|
4141
|
-
_el$
|
|
4142
|
-
_el$
|
|
4143
|
-
_el$
|
|
4286
|
+
var _el$14 = _tmpl$18(), _el$18 = _el$14.firstChild;
|
|
4287
|
+
_el$14.$$click = stopPropagation;
|
|
4288
|
+
_el$14.$$mousedown = stopPropagation;
|
|
4289
|
+
_el$14.$$pointerdown = handleContainerPointerDown;
|
|
4144
4290
|
var _ref$ = containerRef;
|
|
4145
|
-
typeof _ref$ === "function" ? use(_ref$, _el$
|
|
4146
|
-
insert(_el$
|
|
4291
|
+
typeof _ref$ === "function" ? use(_ref$, _el$14) : containerRef = _el$14;
|
|
4292
|
+
insert(_el$14, createComponent(Arrow, {
|
|
4147
4293
|
get position() {
|
|
4148
4294
|
return arrowPosition();
|
|
4149
4295
|
},
|
|
4150
4296
|
get leftPx() {
|
|
4151
4297
|
return computedPosition().arrowLeft;
|
|
4152
4298
|
}
|
|
4153
|
-
}), _el$
|
|
4154
|
-
insert(_el$
|
|
4299
|
+
}), _el$18);
|
|
4300
|
+
insert(_el$14, createComponent(Show, {
|
|
4155
4301
|
get when() {
|
|
4156
4302
|
return props.status === "copied" || props.status === "fading";
|
|
4157
4303
|
},
|
|
4158
4304
|
get children() {
|
|
4159
|
-
var _el$
|
|
4160
|
-
insert(_el$
|
|
4161
|
-
return _el$
|
|
4305
|
+
var _el$15 = _tmpl$9(), _el$16 = _el$15.firstChild, _el$17 = _el$16.firstChild;
|
|
4306
|
+
insert(_el$17, () => props.hasAgent ? "Completed" : "Copied");
|
|
4307
|
+
return _el$15;
|
|
4162
4308
|
}
|
|
4163
|
-
}), _el$
|
|
4164
|
-
insert(_el$
|
|
4309
|
+
}), _el$18);
|
|
4310
|
+
insert(_el$18, createComponent(Show, {
|
|
4165
4311
|
get when() {
|
|
4166
4312
|
return props.status === "copying";
|
|
4167
4313
|
},
|
|
4168
4314
|
get children() {
|
|
4169
|
-
var _el$
|
|
4170
|
-
insert(_el$
|
|
4171
|
-
insert(_el$
|
|
4315
|
+
var _el$19 = _tmpl$10(), _el$20 = _el$19.firstChild, _el$21 = _el$20.firstChild, _el$22 = _el$21.firstChild;
|
|
4316
|
+
insert(_el$22, () => props.statusText ?? "Grabbing\u2026");
|
|
4317
|
+
insert(_el$19, createComponent(BottomSection, {
|
|
4172
4318
|
get children() {
|
|
4173
|
-
var _el$
|
|
4319
|
+
var _el$23 = _tmpl$1(), _el$24 = _el$23.firstChild;
|
|
4174
4320
|
var _ref$2 = inputRef;
|
|
4175
|
-
typeof _ref$2 === "function" ? use(_ref$2, _el$
|
|
4176
|
-
insert(_el$
|
|
4321
|
+
typeof _ref$2 === "function" ? use(_ref$2, _el$24) : inputRef = _el$24;
|
|
4322
|
+
insert(_el$23, createComponent(Show, {
|
|
4177
4323
|
get when() {
|
|
4178
4324
|
return props.onAbort;
|
|
4179
4325
|
},
|
|
4180
4326
|
get children() {
|
|
4181
|
-
var _el$
|
|
4182
|
-
|
|
4183
|
-
|
|
4327
|
+
var _el$25 = _tmpl$0();
|
|
4328
|
+
_el$25.$$click = (event) => {
|
|
4329
|
+
event.stopPropagation();
|
|
4330
|
+
props.onAbort?.();
|
|
4331
|
+
};
|
|
4332
|
+
_el$25.$$pointerup = (event) => {
|
|
4333
|
+
event.stopPropagation();
|
|
4334
|
+
props.onAbort?.();
|
|
4335
|
+
};
|
|
4336
|
+
_el$25.$$mousedown = (event) => event.stopPropagation();
|
|
4337
|
+
_el$25.$$pointerdown = (event) => event.stopPropagation();
|
|
4338
|
+
return _el$25;
|
|
4184
4339
|
}
|
|
4185
4340
|
}), null);
|
|
4186
|
-
createRenderEffect(() => _el$
|
|
4187
|
-
return _el$
|
|
4341
|
+
createRenderEffect(() => _el$24.value = props.inputValue ?? "");
|
|
4342
|
+
return _el$23;
|
|
4188
4343
|
}
|
|
4189
4344
|
}), null);
|
|
4190
|
-
return _el$
|
|
4345
|
+
return _el$19;
|
|
4191
4346
|
}
|
|
4192
4347
|
}), null);
|
|
4193
|
-
insert(_el$
|
|
4348
|
+
insert(_el$18, createComponent(Show, {
|
|
4194
4349
|
get when() {
|
|
4195
4350
|
return memo(() => !!isNotProcessing())() && !props.isInputExpanded;
|
|
4196
4351
|
},
|
|
4197
4352
|
get children() {
|
|
4198
|
-
var _el$
|
|
4199
|
-
insert(_el$
|
|
4353
|
+
var _el$26 = _tmpl$13(), _el$27 = _el$26.firstChild, _el$29 = _el$27.nextSibling, _el$30 = _el$29.firstChild;
|
|
4354
|
+
insert(_el$27, createComponent(ClickToCopyPill, {
|
|
4200
4355
|
onClick: handleSubmit,
|
|
4201
4356
|
shrink: true,
|
|
4202
4357
|
get hasParent() {
|
|
@@ -4206,19 +4361,19 @@ var SelectionLabel = (props) => {
|
|
|
4206
4361
|
return props.hasAgent;
|
|
4207
4362
|
}
|
|
4208
4363
|
}), null);
|
|
4209
|
-
insert(_el$
|
|
4364
|
+
insert(_el$27, createComponent(Show, {
|
|
4210
4365
|
get when() {
|
|
4211
4366
|
return props.componentName;
|
|
4212
4367
|
},
|
|
4213
4368
|
get children() {
|
|
4214
|
-
var _el$
|
|
4215
|
-
insert(_el$
|
|
4369
|
+
var _el$28 = _tmpl$11();
|
|
4370
|
+
insert(_el$28, createComponent(ParentBadge, {
|
|
4216
4371
|
get name() {
|
|
4217
4372
|
return props.componentName;
|
|
4218
4373
|
}
|
|
4219
4374
|
}), null);
|
|
4220
|
-
insert(_el$
|
|
4221
|
-
insert(_el$
|
|
4375
|
+
insert(_el$28, createComponent(ChevronSeparator, {}), null);
|
|
4376
|
+
insert(_el$28, createComponent(TagBadge, {
|
|
4222
4377
|
get tagName() {
|
|
4223
4378
|
return tagDisplay();
|
|
4224
4379
|
},
|
|
@@ -4230,10 +4385,10 @@ var SelectionLabel = (props) => {
|
|
|
4230
4385
|
showMono: true,
|
|
4231
4386
|
shrink: true
|
|
4232
4387
|
}), null);
|
|
4233
|
-
return _el$
|
|
4388
|
+
return _el$28;
|
|
4234
4389
|
}
|
|
4235
4390
|
}), null);
|
|
4236
|
-
insert(_el$
|
|
4391
|
+
insert(_el$27, createComponent(Show, {
|
|
4237
4392
|
get when() {
|
|
4238
4393
|
return !props.componentName;
|
|
4239
4394
|
},
|
|
@@ -4252,23 +4407,37 @@ var SelectionLabel = (props) => {
|
|
|
4252
4407
|
});
|
|
4253
4408
|
}
|
|
4254
4409
|
}), null);
|
|
4255
|
-
insert(_el$
|
|
4410
|
+
insert(_el$30, createComponent(BottomSection, {
|
|
4256
4411
|
get children() {
|
|
4257
|
-
var _el$
|
|
4258
|
-
|
|
4412
|
+
var _el$31 = _tmpl$12(), _el$32 = _el$31.firstChild, _el$33 = _el$32.nextSibling;
|
|
4413
|
+
insert(_el$33, createComponent(IconReturn, {
|
|
4414
|
+
size: 10,
|
|
4415
|
+
"class": "opacity-[0.99] text-black"
|
|
4416
|
+
}));
|
|
4417
|
+
return _el$31;
|
|
4259
4418
|
}
|
|
4260
4419
|
}));
|
|
4261
|
-
createRenderEffect((
|
|
4262
|
-
|
|
4420
|
+
createRenderEffect((_p$) => {
|
|
4421
|
+
var _v$3 = cn("contain-layout shrink-0 flex items-center gap-1 pt-1 w-fit h-fit pl-1.5", props.componentName ? "pr-1.5" : "pr-1"), _v$4 = isIdle() ? "1fr" : "0fr", _v$5 = cn("overflow-hidden min-h-0", !isIdle() && "w-0");
|
|
4422
|
+
_v$3 !== _p$.e && className(_el$27, _p$.e = _v$3);
|
|
4423
|
+
_v$4 !== _p$.t && setStyleProperty(_el$29, "grid-template-rows", _p$.t = _v$4);
|
|
4424
|
+
_v$5 !== _p$.a && className(_el$30, _p$.a = _v$5);
|
|
4425
|
+
return _p$;
|
|
4426
|
+
}, {
|
|
4427
|
+
e: void 0,
|
|
4428
|
+
t: void 0,
|
|
4429
|
+
a: void 0
|
|
4430
|
+
});
|
|
4431
|
+
return _el$26;
|
|
4263
4432
|
}
|
|
4264
4433
|
}), null);
|
|
4265
|
-
insert(_el$
|
|
4434
|
+
insert(_el$18, createComponent(Show, {
|
|
4266
4435
|
get when() {
|
|
4267
|
-
return memo(() => !!isNotProcessing())() && props.
|
|
4436
|
+
return memo(() => !!(isNotProcessing() && props.isInputExpanded))() && !props.isPendingDismiss;
|
|
4268
4437
|
},
|
|
4269
4438
|
get children() {
|
|
4270
|
-
var _el$
|
|
4271
|
-
insert(_el$
|
|
4439
|
+
var _el$34 = _tmpl$17(), _el$35 = _el$34.firstChild;
|
|
4440
|
+
insert(_el$35, createComponent(ClickToCopyPill, {
|
|
4272
4441
|
onClick: handleSubmit,
|
|
4273
4442
|
dimmed: true,
|
|
4274
4443
|
shrink: true,
|
|
@@ -4279,19 +4448,19 @@ var SelectionLabel = (props) => {
|
|
|
4279
4448
|
return props.hasAgent;
|
|
4280
4449
|
}
|
|
4281
4450
|
}), null);
|
|
4282
|
-
insert(_el$
|
|
4451
|
+
insert(_el$35, createComponent(Show, {
|
|
4283
4452
|
get when() {
|
|
4284
4453
|
return props.componentName;
|
|
4285
4454
|
},
|
|
4286
4455
|
get children() {
|
|
4287
|
-
var _el$
|
|
4288
|
-
insert(_el$
|
|
4456
|
+
var _el$36 = _tmpl$11();
|
|
4457
|
+
insert(_el$36, createComponent(ParentBadge, {
|
|
4289
4458
|
get name() {
|
|
4290
4459
|
return props.componentName;
|
|
4291
4460
|
}
|
|
4292
4461
|
}), null);
|
|
4293
|
-
insert(_el$
|
|
4294
|
-
insert(_el$
|
|
4462
|
+
insert(_el$36, createComponent(ChevronSeparator, {}), null);
|
|
4463
|
+
insert(_el$36, createComponent(TagBadge, {
|
|
4295
4464
|
get tagName() {
|
|
4296
4465
|
return tagDisplay();
|
|
4297
4466
|
},
|
|
@@ -4304,10 +4473,10 @@ var SelectionLabel = (props) => {
|
|
|
4304
4473
|
shrink: true,
|
|
4305
4474
|
forceShowIcon: true
|
|
4306
4475
|
}), null);
|
|
4307
|
-
return _el$
|
|
4476
|
+
return _el$36;
|
|
4308
4477
|
}
|
|
4309
4478
|
}), null);
|
|
4310
|
-
insert(_el$
|
|
4479
|
+
insert(_el$35, createComponent(Show, {
|
|
4311
4480
|
get when() {
|
|
4312
4481
|
return !props.componentName;
|
|
4313
4482
|
},
|
|
@@ -4327,62 +4496,83 @@ var SelectionLabel = (props) => {
|
|
|
4327
4496
|
});
|
|
4328
4497
|
}
|
|
4329
4498
|
}), null);
|
|
4330
|
-
insert(_el$
|
|
4499
|
+
insert(_el$34, createComponent(BottomSection, {
|
|
4331
4500
|
get children() {
|
|
4332
|
-
var _el$
|
|
4333
|
-
_el$
|
|
4334
|
-
_el$
|
|
4501
|
+
var _el$37 = _tmpl$16(), _el$38 = _el$37.firstChild, _el$39 = _el$38.nextSibling;
|
|
4502
|
+
_el$38.$$keydown = handleKeyDown;
|
|
4503
|
+
_el$38.$$input = handleInput;
|
|
4335
4504
|
var _ref$3 = inputRef;
|
|
4336
|
-
typeof _ref$3 === "function" ? use(_ref$3, _el$
|
|
4337
|
-
insert(_el$
|
|
4505
|
+
typeof _ref$3 === "function" ? use(_ref$3, _el$38) : inputRef = _el$38;
|
|
4506
|
+
insert(_el$39, createComponent(Show, {
|
|
4338
4507
|
get when() {
|
|
4339
|
-
return memo(() => !!props.hasAgent
|
|
4508
|
+
return memo(() => !!(props.hasAgent && speechRecognition.isSupported()))() && !props.inputValue;
|
|
4340
4509
|
},
|
|
4341
4510
|
get children() {
|
|
4342
|
-
var _el$
|
|
4343
|
-
addEventListener(_el$
|
|
4344
|
-
insert(_el$
|
|
4511
|
+
var _el$40 = _tmpl$14();
|
|
4512
|
+
addEventListener(_el$40, "click", speechRecognition.toggle);
|
|
4513
|
+
insert(_el$40, createComponent(IconMic, {
|
|
4345
4514
|
size: 11,
|
|
4346
4515
|
get ["class"]() {
|
|
4347
4516
|
return speechRecognition.isListening() ? "animate-pulse" : "";
|
|
4348
4517
|
}
|
|
4349
4518
|
}));
|
|
4350
4519
|
createRenderEffect((_p$) => {
|
|
4351
|
-
var _v$
|
|
4352
|
-
_v$
|
|
4353
|
-
_v$
|
|
4520
|
+
var _v$6 = cn("contain-layout shrink-0 flex items-center justify-center px-[2px] py-[2px] rounded-xs [border-width:0.5px] border-solid size-fit cursor-pointer transition-all hover:scale-105", speechRecognition.isListening() ? "bg-grab-purple border-grab-purple text-white" : "bg-white border-[#B3B3B3] text-black"), _v$7 = speechRecognition.isListening() ? "Stop listening" : "Start voice input";
|
|
4521
|
+
_v$6 !== _p$.e && className(_el$40, _p$.e = _v$6);
|
|
4522
|
+
_v$7 !== _p$.t && setAttribute(_el$40, "title", _p$.t = _v$7);
|
|
4354
4523
|
return _p$;
|
|
4355
4524
|
}, {
|
|
4356
4525
|
e: void 0,
|
|
4357
4526
|
t: void 0
|
|
4358
4527
|
});
|
|
4359
|
-
return _el$
|
|
4528
|
+
return _el$40;
|
|
4360
4529
|
}
|
|
4361
|
-
}),
|
|
4362
|
-
_el$
|
|
4363
|
-
|
|
4364
|
-
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
|
|
4373
|
-
|
|
4530
|
+
}), null);
|
|
4531
|
+
insert(_el$39, createComponent(Show, {
|
|
4532
|
+
get when() {
|
|
4533
|
+
return props.inputValue;
|
|
4534
|
+
},
|
|
4535
|
+
get children() {
|
|
4536
|
+
var _el$41 = _tmpl$15();
|
|
4537
|
+
_el$41.$$click = handleSubmit;
|
|
4538
|
+
insert(_el$41, createComponent(IconReturn, {
|
|
4539
|
+
size: 10,
|
|
4540
|
+
"class": "opacity-[0.99] text-black"
|
|
4541
|
+
}));
|
|
4542
|
+
return _el$41;
|
|
4543
|
+
}
|
|
4544
|
+
}), null);
|
|
4545
|
+
createRenderEffect(() => setAttribute(_el$38, "placeholder", speechRecognition.isListening() ? "listening..." : props.hasAgent && props.isAgentConnected ? "type to edit" : "type prompt"));
|
|
4546
|
+
createRenderEffect(() => _el$38.value = props.inputValue ?? "");
|
|
4547
|
+
return _el$37;
|
|
4374
4548
|
}
|
|
4375
4549
|
}), null);
|
|
4376
|
-
|
|
4550
|
+
createRenderEffect(() => className(_el$35, cn("contain-layout shrink-0 flex items-center gap-1 pt-1 w-fit h-fit pl-1.5", props.componentName ? "pr-1.5" : "pr-1")));
|
|
4551
|
+
return _el$34;
|
|
4552
|
+
}
|
|
4553
|
+
}), null);
|
|
4554
|
+
insert(_el$18, createComponent(Show, {
|
|
4555
|
+
get when() {
|
|
4556
|
+
return props.isPendingDismiss;
|
|
4557
|
+
},
|
|
4558
|
+
get children() {
|
|
4559
|
+
return createComponent(DismissConfirmation, {
|
|
4560
|
+
get onConfirm() {
|
|
4561
|
+
return props.onConfirmDismiss;
|
|
4562
|
+
},
|
|
4563
|
+
get onCancel() {
|
|
4564
|
+
return props.onCancelDismiss;
|
|
4565
|
+
}
|
|
4566
|
+
});
|
|
4377
4567
|
}
|
|
4378
4568
|
}), null);
|
|
4379
4569
|
createRenderEffect((_p$) => {
|
|
4380
|
-
var _v$
|
|
4381
|
-
_v$
|
|
4382
|
-
_v$
|
|
4383
|
-
_v$
|
|
4384
|
-
_v$
|
|
4385
|
-
_v$
|
|
4570
|
+
var _v$8 = `${computedPosition().top}px`, _v$9 = `${computedPosition().left}px`, _v$0 = props.isInputExpanded ? "auto" : "none", _v$1 = props.status === "fading" ? 0 : 1, _v$10 = props.status === "copied" || props.status === "fading" ? "none" : void 0;
|
|
4571
|
+
_v$8 !== _p$.e && setStyleProperty(_el$14, "top", _p$.e = _v$8);
|
|
4572
|
+
_v$9 !== _p$.t && setStyleProperty(_el$14, "left", _p$.t = _v$9);
|
|
4573
|
+
_v$0 !== _p$.a && setStyleProperty(_el$14, "pointer-events", _p$.a = _v$0);
|
|
4574
|
+
_v$1 !== _p$.o && setStyleProperty(_el$14, "opacity", _p$.o = _v$1);
|
|
4575
|
+
_v$10 !== _p$.i && setStyleProperty(_el$18, "display", _p$.i = _v$10);
|
|
4386
4576
|
return _p$;
|
|
4387
4577
|
}, {
|
|
4388
4578
|
e: void 0,
|
|
@@ -4391,14 +4581,14 @@ var SelectionLabel = (props) => {
|
|
|
4391
4581
|
o: void 0,
|
|
4392
4582
|
i: void 0
|
|
4393
4583
|
});
|
|
4394
|
-
return _el$
|
|
4584
|
+
return _el$14;
|
|
4395
4585
|
}
|
|
4396
4586
|
});
|
|
4397
4587
|
};
|
|
4398
|
-
delegateEvents(["click", "pointerdown", "mousedown", "input", "keydown"]);
|
|
4588
|
+
delegateEvents(["click", "pointerdown", "mousedown", "pointerup", "input", "keydown"]);
|
|
4399
4589
|
|
|
4400
4590
|
// src/components/selection-cursor.tsx
|
|
4401
|
-
var _tmpl$
|
|
4591
|
+
var _tmpl$19 = /* @__PURE__ */ template(`<div class="fixed z-2147483647"><button data-react-grab-selection-cursor>`);
|
|
4402
4592
|
var SelectionCursor = (props) => {
|
|
4403
4593
|
const [isHovered, setIsHovered] = createSignal(false);
|
|
4404
4594
|
const [debouncedVisible, setDebouncedVisible] = createSignal(false);
|
|
@@ -4435,7 +4625,7 @@ var SelectionCursor = (props) => {
|
|
|
4435
4625
|
});
|
|
4436
4626
|
}
|
|
4437
4627
|
}), (() => {
|
|
4438
|
-
var _el$ = _tmpl$
|
|
4628
|
+
var _el$ = _tmpl$19(), _el$2 = _el$.firstChild;
|
|
4439
4629
|
_el$.addEventListener("mouseleave", () => setIsHovered(false));
|
|
4440
4630
|
_el$.addEventListener("mouseenter", () => setIsHovered(true));
|
|
4441
4631
|
_el$2.$$click = handleClick;
|
|
@@ -4480,6 +4670,7 @@ delegateEvents(["click"]);
|
|
|
4480
4670
|
|
|
4481
4671
|
// src/components/renderer.tsx
|
|
4482
4672
|
var ReactGrabRenderer = (props) => {
|
|
4673
|
+
const agentSessionsList = createMemo(() => props.agentSessions ? Array.from(props.agentSessions.values()) : []);
|
|
4483
4674
|
return [createComponent(Show, {
|
|
4484
4675
|
get when() {
|
|
4485
4676
|
return memo(() => !!props.selectionVisible)() && props.selectionBounds;
|
|
@@ -4541,51 +4732,52 @@ var ReactGrabRenderer = (props) => {
|
|
|
4541
4732
|
return box.createdAt;
|
|
4542
4733
|
}
|
|
4543
4734
|
})
|
|
4544
|
-
}), createComponent(
|
|
4735
|
+
}), createComponent(Index, {
|
|
4545
4736
|
get each() {
|
|
4546
|
-
return
|
|
4737
|
+
return agentSessionsList();
|
|
4547
4738
|
},
|
|
4548
4739
|
children: (session) => [createComponent(Show, {
|
|
4549
4740
|
get when() {
|
|
4550
|
-
return session.selectionBounds;
|
|
4741
|
+
return session().selectionBounds;
|
|
4551
4742
|
},
|
|
4552
4743
|
get children() {
|
|
4553
4744
|
return createComponent(SelectionBox, {
|
|
4554
4745
|
variant: "processing",
|
|
4555
4746
|
get bounds() {
|
|
4556
|
-
return session.selectionBounds;
|
|
4747
|
+
return session().selectionBounds;
|
|
4557
4748
|
},
|
|
4558
4749
|
visible: true,
|
|
4559
4750
|
get isCompleted() {
|
|
4560
|
-
return !session.isStreaming;
|
|
4751
|
+
return !session().isStreaming;
|
|
4561
4752
|
}
|
|
4562
4753
|
});
|
|
4563
4754
|
}
|
|
4564
4755
|
}), createComponent(SelectionLabel, {
|
|
4565
4756
|
get tagName() {
|
|
4566
|
-
return session.tagName;
|
|
4757
|
+
return session().tagName;
|
|
4567
4758
|
},
|
|
4568
4759
|
get componentName() {
|
|
4569
|
-
return session.componentName;
|
|
4760
|
+
return session().componentName;
|
|
4570
4761
|
},
|
|
4571
4762
|
get selectionBounds() {
|
|
4572
|
-
return session.selectionBounds;
|
|
4763
|
+
return session().selectionBounds;
|
|
4573
4764
|
},
|
|
4574
4765
|
get mouseX() {
|
|
4575
|
-
return session.position.x;
|
|
4766
|
+
return session().position.x;
|
|
4576
4767
|
},
|
|
4577
4768
|
visible: true,
|
|
4578
4769
|
hasAgent: true,
|
|
4770
|
+
isAgentConnected: true,
|
|
4579
4771
|
get status() {
|
|
4580
|
-
return session.isStreaming ? "copying" : "copied";
|
|
4772
|
+
return session().isStreaming ? "copying" : "copied";
|
|
4581
4773
|
},
|
|
4582
4774
|
get statusText() {
|
|
4583
|
-
return session.lastStatus || "
|
|
4775
|
+
return session().lastStatus || "Thinking\u2026";
|
|
4584
4776
|
},
|
|
4585
4777
|
get inputValue() {
|
|
4586
|
-
return session.context.prompt;
|
|
4778
|
+
return session().context.prompt;
|
|
4587
4779
|
},
|
|
4588
|
-
onAbort: () => props.onAbortSession?.(session.id)
|
|
4780
|
+
onAbort: () => props.onAbortSession?.(session().id)
|
|
4589
4781
|
})]
|
|
4590
4782
|
}), createComponent(Show, {
|
|
4591
4783
|
get when() {
|
|
@@ -4617,6 +4809,9 @@ var ReactGrabRenderer = (props) => {
|
|
|
4617
4809
|
get hasAgent() {
|
|
4618
4810
|
return props.hasAgent;
|
|
4619
4811
|
},
|
|
4812
|
+
get isAgentConnected() {
|
|
4813
|
+
return props.isAgentConnected;
|
|
4814
|
+
},
|
|
4620
4815
|
get status() {
|
|
4621
4816
|
return props.selectionLabelStatus;
|
|
4622
4817
|
},
|
|
@@ -4638,6 +4833,15 @@ var ReactGrabRenderer = (props) => {
|
|
|
4638
4833
|
get onToggleExpand() {
|
|
4639
4834
|
return props.onToggleExpand;
|
|
4640
4835
|
},
|
|
4836
|
+
get isPendingDismiss() {
|
|
4837
|
+
return props.isPendingDismiss;
|
|
4838
|
+
},
|
|
4839
|
+
get onConfirmDismiss() {
|
|
4840
|
+
return props.onConfirmDismiss;
|
|
4841
|
+
},
|
|
4842
|
+
get onCancelDismiss() {
|
|
4843
|
+
return props.onCancelDismiss;
|
|
4844
|
+
},
|
|
4641
4845
|
onOpen: () => {
|
|
4642
4846
|
if (props.selectionFilePath) {
|
|
4643
4847
|
const openFileUrl = buildOpenFileUrl(props.selectionFilePath, props.selectionLineNumber);
|
|
@@ -6000,7 +6204,7 @@ var isTargetKeyCombination = (event, options) => {
|
|
|
6000
6204
|
].filter(Boolean).length;
|
|
6001
6205
|
return allRequiredModifiersPressed && pressedModifierCount >= requiredModifierCount;
|
|
6002
6206
|
}
|
|
6003
|
-
const keyMatches = event.key
|
|
6207
|
+
const keyMatches = event.key?.toLowerCase() === key.toLowerCase() || keyMatchesCode(key, event.code);
|
|
6004
6208
|
const hasModifier = metaKey || ctrlKey || shiftKey || altKey;
|
|
6005
6209
|
const modifiersMatch = hasModifier ? (metaKey ? event.metaKey : true) && (ctrlKey ? event.ctrlKey : true) && (shiftKey ? event.shiftKey : true) && (altKey ? event.altKey : true) : event.metaKey || event.ctrlKey;
|
|
6006
6210
|
return keyMatches && modifiersMatch;
|
|
@@ -6029,9 +6233,6 @@ var DEFAULT_THEME = {
|
|
|
6029
6233
|
elementLabel: {
|
|
6030
6234
|
enabled: true
|
|
6031
6235
|
},
|
|
6032
|
-
successLabels: {
|
|
6033
|
-
enabled: true
|
|
6034
|
-
},
|
|
6035
6236
|
crosshair: {
|
|
6036
6237
|
enabled: true
|
|
6037
6238
|
}
|
|
@@ -6051,9 +6252,6 @@ var mergeThemeWithBase = (baseTheme, partialTheme) => ({
|
|
|
6051
6252
|
elementLabel: {
|
|
6052
6253
|
enabled: partialTheme.elementLabel?.enabled ?? baseTheme.elementLabel.enabled
|
|
6053
6254
|
},
|
|
6054
|
-
successLabels: {
|
|
6055
|
-
enabled: partialTheme.successLabels?.enabled ?? baseTheme.successLabels.enabled
|
|
6056
|
-
},
|
|
6057
6255
|
crosshair: {
|
|
6058
6256
|
enabled: partialTheme.crosshair?.enabled ?? baseTheme.crosshair.enabled
|
|
6059
6257
|
}
|
|
@@ -6192,7 +6390,8 @@ var createAgentManager = (initialAgentOptions) => {
|
|
|
6192
6390
|
storage
|
|
6193
6391
|
);
|
|
6194
6392
|
setSessions((prev) => new Map(prev).set(session.id, completedSession));
|
|
6195
|
-
|
|
6393
|
+
const element = sessionElements.get(session.id);
|
|
6394
|
+
agentOptions?.onComplete?.(completedSession, element);
|
|
6196
6395
|
}
|
|
6197
6396
|
} catch (error) {
|
|
6198
6397
|
const currentSessions = sessions();
|
|
@@ -6325,7 +6524,7 @@ var createAgentManager = (initialAgentOptions) => {
|
|
|
6325
6524
|
return;
|
|
6326
6525
|
}
|
|
6327
6526
|
const elements = [element];
|
|
6328
|
-
const content = await generateSnippet(elements);
|
|
6527
|
+
const content = await generateSnippet(elements, { maxLines: Infinity });
|
|
6329
6528
|
const context = {
|
|
6330
6529
|
content,
|
|
6331
6530
|
prompt,
|
|
@@ -6340,11 +6539,11 @@ var createAgentManager = (initialAgentOptions) => {
|
|
|
6340
6539
|
tagName,
|
|
6341
6540
|
componentName
|
|
6342
6541
|
);
|
|
6343
|
-
session.lastStatus = "
|
|
6542
|
+
session.lastStatus = "Thinking\u2026";
|
|
6344
6543
|
sessionElements.set(session.id, element);
|
|
6345
6544
|
setSessions((prev) => new Map(prev).set(session.id, session));
|
|
6346
6545
|
saveSessionById(session, storage);
|
|
6347
|
-
agentOptions.onStart?.(session);
|
|
6546
|
+
agentOptions.onStart?.(session, element);
|
|
6348
6547
|
const abortController = new AbortController();
|
|
6349
6548
|
abortControllers.set(session.id, abortController);
|
|
6350
6549
|
const streamIterator = agentOptions.provider.send(
|
|
@@ -6421,7 +6620,7 @@ var createAgentManager = (initialAgentOptions) => {
|
|
|
6421
6620
|
};
|
|
6422
6621
|
|
|
6423
6622
|
// src/core.tsx
|
|
6424
|
-
var _tmpl$
|
|
6623
|
+
var _tmpl$20 = /* @__PURE__ */ template(`<span class="tabular-nums align-middle">`);
|
|
6425
6624
|
var _tmpl$23 = /* @__PURE__ */ template(`<span class="font-mono tabular-nums align-middle"><<!>>`);
|
|
6426
6625
|
var _tmpl$33 = /* @__PURE__ */ template(`<span class="tabular-nums ml-1 align-middle"> in `);
|
|
6427
6626
|
var onIdle = (callback) => {
|
|
@@ -6515,7 +6714,7 @@ var init = (rawOptions) => {
|
|
|
6515
6714
|
hasInited = true;
|
|
6516
6715
|
const logIntro = () => {
|
|
6517
6716
|
try {
|
|
6518
|
-
const version = "0.0.
|
|
6717
|
+
const version = "0.0.72";
|
|
6519
6718
|
const logoDataUri = `data:image/svg+xml;base64,${btoa(LOGO_SVG)}`;
|
|
6520
6719
|
console.log(`%cReact Grab${version ? ` v${version}` : ""}%c
|
|
6521
6720
|
https://react-grab.com`, `background: #330039; color: #ffffff; border: 1px solid #d75fcb; padding: 4px 4px 4px 24px; border-radius: 4px; background-image: url("${logoDataUri}"); background-size: 16px 16px; background-repeat: no-repeat; background-position: 4px center; display: inline-block; margin-bottom: 4px;`, "");
|
|
@@ -6549,12 +6748,13 @@ https://react-grab.com`, `background: #330039; color: #ffffff; border: 1px solid
|
|
|
6549
6748
|
const [selectionLabelStatus, setSelectionLabelStatus] = createSignal("idle");
|
|
6550
6749
|
const [labelInstances, setLabelInstances] = createSignal([]);
|
|
6551
6750
|
const [lastGrabbedElement, setLastGrabbedElement] = createSignal(null);
|
|
6751
|
+
const [lastCopiedElement, setLastCopiedElement] = createSignal(null);
|
|
6552
6752
|
const [progressStartTime, setProgressStartTime] = createSignal(null);
|
|
6553
6753
|
const [grabbedBoxes, setGrabbedBoxes] = createSignal([]);
|
|
6554
|
-
const [successLabels, setSuccessLabels] = createSignal([]);
|
|
6555
6754
|
const [isActivated, setIsActivated] = createSignal(false);
|
|
6556
6755
|
const [isToggleMode, setIsToggleMode] = createSignal(false);
|
|
6557
6756
|
const [didJustDrag, setDidJustDrag] = createSignal(false);
|
|
6757
|
+
const [didJustCopy, setDidJustCopy] = createSignal(false);
|
|
6558
6758
|
const [copyStartX, setCopyStartX] = createSignal(OFFSCREEN_POSITION);
|
|
6559
6759
|
const [copyStartY, setCopyStartY] = createSignal(OFFSCREEN_POSITION);
|
|
6560
6760
|
const [copyOffsetFromCenterX, setCopyOffsetFromCenterX] = createSignal(0);
|
|
@@ -6568,6 +6768,9 @@ https://react-grab.com`, `background: #330039; color: #ffffff; border: 1px solid
|
|
|
6568
6768
|
const [isInputExpanded, setIsInputExpanded] = createSignal(false);
|
|
6569
6769
|
const [frozenElement, setFrozenElement] = createSignal(null);
|
|
6570
6770
|
const [hasAgentProvider, setHasAgentProvider] = createSignal(Boolean(options.agent?.provider));
|
|
6771
|
+
const [isAgentConnected, setIsAgentConnected] = createSignal(false);
|
|
6772
|
+
const [isPendingDismiss, setIsPendingDismiss] = createSignal(false);
|
|
6773
|
+
const elementInputCache = /* @__PURE__ */ new WeakMap();
|
|
6571
6774
|
const [nativeSelectionCursorX, setNativeSelectionCursorX] = createSignal(OFFSCREEN_POSITION);
|
|
6572
6775
|
const [nativeSelectionCursorY, setNativeSelectionCursorY] = createSignal(OFFSCREEN_POSITION);
|
|
6573
6776
|
const [hasNativeSelection, setHasNativeSelection] = createSignal(false);
|
|
@@ -6587,6 +6790,7 @@ https://react-grab.com`, `background: #330039; color: #ffffff; border: 1px solid
|
|
|
6587
6790
|
return await getNearestComponentName(element) || void 0;
|
|
6588
6791
|
});
|
|
6589
6792
|
const clearNativeSelectionState = () => {
|
|
6793
|
+
setHasNativeSelection(false);
|
|
6590
6794
|
setNativeSelectionCursorX(OFFSCREEN_POSITION);
|
|
6591
6795
|
setNativeSelectionCursorY(OFFSCREEN_POSITION);
|
|
6592
6796
|
setNativeSelectionElements([]);
|
|
@@ -6654,24 +6858,6 @@ https://react-grab.com`, `background: #330039; color: #ffffff; border: 1px solid
|
|
|
6654
6858
|
setGrabbedBoxes((previousBoxes) => previousBoxes.filter((box) => box.id !== boxId));
|
|
6655
6859
|
}, SUCCESS_LABEL_DURATION_MS);
|
|
6656
6860
|
};
|
|
6657
|
-
const showTemporarySuccessLabel = (text, type) => {
|
|
6658
|
-
const labelId = `success-${Date.now()}-${Math.random()}`;
|
|
6659
|
-
setSuccessLabels((previousLabels) => [...previousLabels, {
|
|
6660
|
-
id: labelId,
|
|
6661
|
-
text
|
|
6662
|
-
}]);
|
|
6663
|
-
options.onSuccessLabel?.(text, type, {
|
|
6664
|
-
x: mouseX(),
|
|
6665
|
-
y: mouseY()
|
|
6666
|
-
});
|
|
6667
|
-
setTimeout(() => {
|
|
6668
|
-
setSuccessLabels((previousLabels) => previousLabels.filter((label) => label.id !== labelId));
|
|
6669
|
-
}, SUCCESS_LABEL_DURATION_MS);
|
|
6670
|
-
};
|
|
6671
|
-
const extractElementTagNameForSuccess = (element) => {
|
|
6672
|
-
const tagName = extractElementTagName(element);
|
|
6673
|
-
return tagName ? `<${tagName}>` : "1 element";
|
|
6674
|
-
};
|
|
6675
6861
|
const notifyElementsSelected = (elements) => {
|
|
6676
6862
|
const elementsPayload = elements.map((element) => ({
|
|
6677
6863
|
tagName: extractElementTagName(element)
|
|
@@ -6705,7 +6891,7 @@ https://react-grab.com`, `background: #330039; color: #ffffff; border: 1px solid
|
|
|
6705
6891
|
const removeLabelInstance = (instanceId) => {
|
|
6706
6892
|
setLabelInstances((prev) => prev.filter((instance) => instance.id !== instanceId));
|
|
6707
6893
|
};
|
|
6708
|
-
const executeCopyOperation = async (positionX, positionY, operation, bounds, tagName, componentName, element) => {
|
|
6894
|
+
const executeCopyOperation = async (positionX, positionY, operation, bounds, tagName, componentName, element, shouldDeactivateAfter) => {
|
|
6709
6895
|
setCopyStartX(positionX);
|
|
6710
6896
|
setCopyStartY(positionY);
|
|
6711
6897
|
if (bounds) {
|
|
@@ -6719,6 +6905,10 @@ https://react-grab.com`, `background: #330039; color: #ffffff; border: 1px solid
|
|
|
6719
6905
|
const instanceId = bounds && tagName ? createLabelInstance(bounds, tagName, componentName, "copying", element, positionX) : null;
|
|
6720
6906
|
await operation().finally(() => {
|
|
6721
6907
|
setIsCopying(false);
|
|
6908
|
+
setDidJustCopy(true);
|
|
6909
|
+
if (element) {
|
|
6910
|
+
setLastCopiedElement(element);
|
|
6911
|
+
}
|
|
6722
6912
|
stopProgressAnimation();
|
|
6723
6913
|
if (instanceId) {
|
|
6724
6914
|
updateLabelInstance(instanceId, "copied");
|
|
@@ -6729,7 +6919,7 @@ https://react-grab.com`, `background: #330039; color: #ffffff; border: 1px solid
|
|
|
6729
6919
|
}, 350);
|
|
6730
6920
|
}, COPIED_LABEL_DURATION_MS);
|
|
6731
6921
|
}
|
|
6732
|
-
if (isToggleMode()) {
|
|
6922
|
+
if (isToggleMode() || shouldDeactivateAfter) {
|
|
6733
6923
|
deactivateRenderer();
|
|
6734
6924
|
}
|
|
6735
6925
|
});
|
|
@@ -6792,16 +6982,12 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
6792
6982
|
return didCopy;
|
|
6793
6983
|
};
|
|
6794
6984
|
const copySingleElementToClipboard = async (targetElement2, extraPrompt) => {
|
|
6795
|
-
const successLabelType = extraPrompt ? "input-submit" : "copy";
|
|
6796
6985
|
options.onElementSelect?.(targetElement2);
|
|
6797
6986
|
if (theme().grabbedBoxes.enabled) {
|
|
6798
6987
|
showTemporaryGrabbedBox(createElementBounds(targetElement2), targetElement2);
|
|
6799
6988
|
}
|
|
6800
6989
|
await new Promise((resolve) => requestAnimationFrame(resolve));
|
|
6801
|
-
|
|
6802
|
-
if (didCopy && theme().successLabels.enabled) {
|
|
6803
|
-
showTemporarySuccessLabel(extractElementTagNameForSuccess(targetElement2), successLabelType);
|
|
6804
|
-
}
|
|
6990
|
+
await tryCopyWithFallback([targetElement2], extraPrompt);
|
|
6805
6991
|
notifyElementsSelected([targetElement2]);
|
|
6806
6992
|
};
|
|
6807
6993
|
const copyMultipleElementsToClipboard = async (targetElements) => {
|
|
@@ -6815,10 +7001,7 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
6815
7001
|
}
|
|
6816
7002
|
}
|
|
6817
7003
|
await new Promise((resolve) => requestAnimationFrame(resolve));
|
|
6818
|
-
|
|
6819
|
-
if (didCopy && theme().successLabels.enabled) {
|
|
6820
|
-
showTemporarySuccessLabel(`${targetElements.length} elements`, "copy");
|
|
6821
|
-
}
|
|
7004
|
+
await tryCopyWithFallback(targetElements);
|
|
6822
7005
|
notifyElementsSelected(targetElements);
|
|
6823
7006
|
};
|
|
6824
7007
|
const targetElement = createMemo(() => {
|
|
@@ -6827,6 +7010,12 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
6827
7010
|
if (element && !document.contains(element)) return null;
|
|
6828
7011
|
return element;
|
|
6829
7012
|
});
|
|
7013
|
+
const effectiveElement = createMemo(() => {
|
|
7014
|
+
if (isToggleFrozen()) {
|
|
7015
|
+
return frozenElement();
|
|
7016
|
+
}
|
|
7017
|
+
return targetElement();
|
|
7018
|
+
});
|
|
6830
7019
|
createEffect(() => {
|
|
6831
7020
|
const element = detectedElement();
|
|
6832
7021
|
if (!element) return;
|
|
@@ -6845,7 +7034,7 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
6845
7034
|
});
|
|
6846
7035
|
const selectionBounds = createMemo(() => {
|
|
6847
7036
|
viewportVersion();
|
|
6848
|
-
const element =
|
|
7037
|
+
const element = effectiveElement();
|
|
6849
7038
|
if (!element) return void 0;
|
|
6850
7039
|
return createElementBounds(element);
|
|
6851
7040
|
});
|
|
@@ -6897,8 +7086,8 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
6897
7086
|
const copying = isCopying();
|
|
6898
7087
|
if (!element) {
|
|
6899
7088
|
return (() => {
|
|
6900
|
-
var _el$ = _tmpl$
|
|
6901
|
-
insert(_el$, copying ? "
|
|
7089
|
+
var _el$ = _tmpl$20();
|
|
7090
|
+
insert(_el$, copying ? "Processing\u2026" : "1 element");
|
|
6902
7091
|
return _el$;
|
|
6903
7092
|
})();
|
|
6904
7093
|
}
|
|
@@ -6923,8 +7112,8 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
6923
7112
|
})();
|
|
6924
7113
|
}
|
|
6925
7114
|
return (() => {
|
|
6926
|
-
var _el$10 = _tmpl$
|
|
6927
|
-
insert(_el$10, copying ? "
|
|
7115
|
+
var _el$10 = _tmpl$20();
|
|
7116
|
+
insert(_el$10, copying ? "Processing\u2026" : "1 element");
|
|
6928
7117
|
return _el$10;
|
|
6929
7118
|
})();
|
|
6930
7119
|
});
|
|
@@ -6979,15 +7168,6 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
6979
7168
|
clearSource();
|
|
6980
7169
|
}).catch(clearSource);
|
|
6981
7170
|
}));
|
|
6982
|
-
createEffect(on(() => viewportVersion(), () => {
|
|
6983
|
-
const currentBoxes = grabbedBoxes();
|
|
6984
|
-
if (currentBoxes.length === 0) return;
|
|
6985
|
-
const updatedBoxes = currentBoxes.map((box) => ({
|
|
6986
|
-
...box,
|
|
6987
|
-
bounds: createElementBounds(box.element)
|
|
6988
|
-
}));
|
|
6989
|
-
setGrabbedBoxes(updatedBoxes);
|
|
6990
|
-
}));
|
|
6991
7171
|
createEffect(on(() => viewportVersion(), () => agentManager.updateSessionBoundsOnViewportChange()));
|
|
6992
7172
|
createEffect(on(() => [isActivated(), isDragging(), isCopying(), isInputMode(), targetElement(), dragBounds()], ([active, dragging, copying, inputMode, target, drag]) => {
|
|
6993
7173
|
options.onStateChange?.({
|
|
@@ -7125,8 +7305,10 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7125
7305
|
setInputText("");
|
|
7126
7306
|
setIsToggleFrozen(false);
|
|
7127
7307
|
setIsInputExpanded(false);
|
|
7308
|
+
setIsPendingDismiss(false);
|
|
7128
7309
|
setFrozenElement(null);
|
|
7129
7310
|
setSelectionLabelStatus("idle");
|
|
7311
|
+
setDidJustCopy(false);
|
|
7130
7312
|
if (isDragging()) {
|
|
7131
7313
|
setIsDragging(false);
|
|
7132
7314
|
document.body.style.userSelect = "";
|
|
@@ -7168,6 +7350,7 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7168
7350
|
setInputText(value);
|
|
7169
7351
|
};
|
|
7170
7352
|
const handleInputSubmit = () => {
|
|
7353
|
+
setLastCopiedElement(null);
|
|
7171
7354
|
const element = frozenElement() || targetElement();
|
|
7172
7355
|
const prompt = isInputMode() ? inputText().trim() : "";
|
|
7173
7356
|
if (!element) {
|
|
@@ -7181,6 +7364,7 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7181
7364
|
setMouseX(currentX);
|
|
7182
7365
|
setMouseY(currentY);
|
|
7183
7366
|
if (hasAgentProvider() && prompt) {
|
|
7367
|
+
elementInputCache.delete(element);
|
|
7184
7368
|
deactivateRenderer();
|
|
7185
7369
|
void agentManager.startSession({
|
|
7186
7370
|
element,
|
|
@@ -7195,6 +7379,11 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7195
7379
|
}
|
|
7196
7380
|
setIsInputMode(false);
|
|
7197
7381
|
setInputText("");
|
|
7382
|
+
if (prompt) {
|
|
7383
|
+
elementInputCache.set(element, prompt);
|
|
7384
|
+
} else {
|
|
7385
|
+
elementInputCache.delete(element);
|
|
7386
|
+
}
|
|
7198
7387
|
const tagName = extractElementTagName(element);
|
|
7199
7388
|
void getNearestComponentName(element).then((componentName) => {
|
|
7200
7389
|
void executeCopyOperation(currentX, currentY, () => copySingleElementToClipboard(element, prompt || void 0), bounds, tagName, componentName ?? void 0, element).then(() => {
|
|
@@ -7203,9 +7392,27 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7203
7392
|
});
|
|
7204
7393
|
};
|
|
7205
7394
|
const handleInputCancel = () => {
|
|
7395
|
+
setLastCopiedElement(null);
|
|
7206
7396
|
if (!isInputMode()) return;
|
|
7397
|
+
const currentInput = inputText().trim();
|
|
7398
|
+
if (currentInput && !isPendingDismiss()) {
|
|
7399
|
+
setIsPendingDismiss(true);
|
|
7400
|
+
return;
|
|
7401
|
+
}
|
|
7402
|
+
const element = frozenElement() || targetElement();
|
|
7403
|
+
if (element && currentInput) {
|
|
7404
|
+
elementInputCache.set(element, currentInput);
|
|
7405
|
+
}
|
|
7406
|
+
setIsPendingDismiss(false);
|
|
7407
|
+
deactivateRenderer();
|
|
7408
|
+
};
|
|
7409
|
+
const handleConfirmDismiss = () => {
|
|
7410
|
+
setIsPendingDismiss(false);
|
|
7207
7411
|
deactivateRenderer();
|
|
7208
7412
|
};
|
|
7413
|
+
const handleCancelDismiss = () => {
|
|
7414
|
+
setIsPendingDismiss(false);
|
|
7415
|
+
};
|
|
7209
7416
|
const handleToggleExpand = () => {
|
|
7210
7417
|
const element = frozenElement() || targetElement();
|
|
7211
7418
|
if (element) {
|
|
@@ -7214,6 +7421,10 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7214
7421
|
setCopyStartX(mouseX());
|
|
7215
7422
|
setCopyStartY(mouseY());
|
|
7216
7423
|
setCopyOffsetFromCenterX(mouseX() - selectionCenterX);
|
|
7424
|
+
const cachedInput = elementInputCache.get(element);
|
|
7425
|
+
if (cachedInput) {
|
|
7426
|
+
setInputText(cachedInput);
|
|
7427
|
+
}
|
|
7217
7428
|
}
|
|
7218
7429
|
setIsToggleMode(true);
|
|
7219
7430
|
setIsToggleFrozen(true);
|
|
@@ -7256,6 +7467,7 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7256
7467
|
};
|
|
7257
7468
|
const handlePointerMove = (clientX, clientY) => {
|
|
7258
7469
|
if (isInputMode() || isToggleFrozen()) return;
|
|
7470
|
+
setDidJustCopy(false);
|
|
7259
7471
|
setMouseX(clientX);
|
|
7260
7472
|
setMouseY(clientY);
|
|
7261
7473
|
const now = performance.now();
|
|
@@ -7312,19 +7524,22 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7312
7524
|
transform: stripTranslateFromTransform(firstElement)
|
|
7313
7525
|
};
|
|
7314
7526
|
const tagName = extractElementTagName(firstElement);
|
|
7527
|
+
const centerX = bounds.x + bounds.width / 2;
|
|
7528
|
+
const centerY = bounds.y + bounds.height / 2;
|
|
7315
7529
|
if (hasAgentProvider()) {
|
|
7316
|
-
const centerX = bounds.x + bounds.width / 2;
|
|
7317
|
-
const centerY = bounds.y + bounds.height / 2;
|
|
7318
7530
|
setMouseX(centerX);
|
|
7319
7531
|
setMouseY(centerY);
|
|
7320
7532
|
setFrozenElement(firstElement);
|
|
7321
7533
|
setIsToggleMode(true);
|
|
7322
7534
|
setIsToggleFrozen(true);
|
|
7323
7535
|
setIsInputExpanded(true);
|
|
7536
|
+
if (!isActivated()) {
|
|
7537
|
+
activateRenderer();
|
|
7538
|
+
}
|
|
7324
7539
|
setIsInputMode(true);
|
|
7325
7540
|
} else {
|
|
7326
7541
|
void getNearestComponentName(firstElement).then((componentName) => {
|
|
7327
|
-
void executeCopyOperation(
|
|
7542
|
+
void executeCopyOperation(centerX, centerY, () => copyMultipleElementsToClipboard(selectedElements), bounds, tagName, componentName ?? void 0, firstElement, true);
|
|
7328
7543
|
});
|
|
7329
7544
|
}
|
|
7330
7545
|
}
|
|
@@ -7341,8 +7556,65 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7341
7556
|
};
|
|
7342
7557
|
const abortController = new AbortController();
|
|
7343
7558
|
const eventListenerSignal = abortController.signal;
|
|
7559
|
+
const claimedEvents = /* @__PURE__ */ new WeakSet();
|
|
7560
|
+
const isEnterCode = (code) => code === "Enter" || code === "NumpadEnter";
|
|
7561
|
+
const originalKeyDescriptor = Object.getOwnPropertyDescriptor(KeyboardEvent.prototype, "key");
|
|
7562
|
+
let didPatchKeyboardEvent = false;
|
|
7563
|
+
if (originalKeyDescriptor?.get && !originalKeyDescriptor.get.__reactGrabPatched) {
|
|
7564
|
+
didPatchKeyboardEvent = true;
|
|
7565
|
+
const originalGetter = originalKeyDescriptor.get;
|
|
7566
|
+
const patchedGetter = function() {
|
|
7567
|
+
if (claimedEvents.has(this)) {
|
|
7568
|
+
return "";
|
|
7569
|
+
}
|
|
7570
|
+
return originalGetter.call(this);
|
|
7571
|
+
};
|
|
7572
|
+
patchedGetter.__reactGrabPatched = true;
|
|
7573
|
+
Object.defineProperty(KeyboardEvent.prototype, "key", {
|
|
7574
|
+
get: patchedGetter,
|
|
7575
|
+
configurable: true
|
|
7576
|
+
});
|
|
7577
|
+
}
|
|
7578
|
+
const blockEnterIfNeeded = (event) => {
|
|
7579
|
+
const originalKey = originalKeyDescriptor?.get ? originalKeyDescriptor.get.call(event) : event.key;
|
|
7580
|
+
const isEnterKey = originalKey === "Enter" || isEnterCode(event.code);
|
|
7581
|
+
const isOverlayActive = isActivated() || isHoldingKeys();
|
|
7582
|
+
const shouldBlockEnter = isEnterKey && isOverlayActive && !isInputMode() && !isToggleMode();
|
|
7583
|
+
if (shouldBlockEnter) {
|
|
7584
|
+
claimedEvents.add(event);
|
|
7585
|
+
event.preventDefault();
|
|
7586
|
+
event.stopPropagation();
|
|
7587
|
+
event.stopImmediatePropagation();
|
|
7588
|
+
return true;
|
|
7589
|
+
}
|
|
7590
|
+
return false;
|
|
7591
|
+
};
|
|
7592
|
+
document.addEventListener("keydown", blockEnterIfNeeded, {
|
|
7593
|
+
signal: eventListenerSignal,
|
|
7594
|
+
capture: true
|
|
7595
|
+
});
|
|
7596
|
+
document.addEventListener("keyup", blockEnterIfNeeded, {
|
|
7597
|
+
signal: eventListenerSignal,
|
|
7598
|
+
capture: true
|
|
7599
|
+
});
|
|
7600
|
+
document.addEventListener("keypress", blockEnterIfNeeded, {
|
|
7601
|
+
signal: eventListenerSignal,
|
|
7602
|
+
capture: true
|
|
7603
|
+
});
|
|
7344
7604
|
window.addEventListener("keydown", (event) => {
|
|
7345
|
-
|
|
7605
|
+
blockEnterIfNeeded(event);
|
|
7606
|
+
const isEnterToActivateInput = isEnterCode(event.code) && isHoldingKeys() && !isInputMode();
|
|
7607
|
+
if (isInputMode() && isTargetKeyCombination(event, options) && !event.repeat) {
|
|
7608
|
+
event.preventDefault();
|
|
7609
|
+
event.stopPropagation();
|
|
7610
|
+
setIsInputMode(false);
|
|
7611
|
+
setInputText("");
|
|
7612
|
+
setIsToggleFrozen(false);
|
|
7613
|
+
setIsInputExpanded(false);
|
|
7614
|
+
setIsPendingDismiss(false);
|
|
7615
|
+
return;
|
|
7616
|
+
}
|
|
7617
|
+
if (isInputMode() || isEventFromOverlay(event, "data-react-grab-ignore-events") && !isEnterToActivateInput) {
|
|
7346
7618
|
if (event.key === "Escape" && agentManager.isProcessing()) {
|
|
7347
7619
|
agentManager.abortAllSessions();
|
|
7348
7620
|
}
|
|
@@ -7358,9 +7630,37 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7358
7630
|
return;
|
|
7359
7631
|
}
|
|
7360
7632
|
}
|
|
7361
|
-
|
|
7633
|
+
const copiedElement = lastCopiedElement();
|
|
7634
|
+
if (isEnterCode(event.code) && !isHoldingKeys() && !isInputMode() && !isActivated() && copiedElement && document.contains(copiedElement)) {
|
|
7362
7635
|
event.preventDefault();
|
|
7363
7636
|
event.stopPropagation();
|
|
7637
|
+
event.stopImmediatePropagation();
|
|
7638
|
+
const bounds = createElementBounds(copiedElement);
|
|
7639
|
+
const selectionCenterX = bounds.x + bounds.width / 2;
|
|
7640
|
+
const centerY = bounds.y + bounds.height / 2;
|
|
7641
|
+
setMouseX(selectionCenterX);
|
|
7642
|
+
setMouseY(centerY);
|
|
7643
|
+
setCopyStartX(selectionCenterX);
|
|
7644
|
+
setCopyStartY(centerY);
|
|
7645
|
+
setCopyOffsetFromCenterX(0);
|
|
7646
|
+
setFrozenElement(copiedElement);
|
|
7647
|
+
setLastCopiedElement(null);
|
|
7648
|
+
setLabelInstances([]);
|
|
7649
|
+
const cachedInput = elementInputCache.get(copiedElement);
|
|
7650
|
+
if (cachedInput) {
|
|
7651
|
+
setInputText(cachedInput);
|
|
7652
|
+
}
|
|
7653
|
+
setIsToggleMode(true);
|
|
7654
|
+
setIsToggleFrozen(true);
|
|
7655
|
+
setIsInputExpanded(true);
|
|
7656
|
+
activateRenderer();
|
|
7657
|
+
setIsInputMode(true);
|
|
7658
|
+
return;
|
|
7659
|
+
}
|
|
7660
|
+
if (isEnterCode(event.code) && isHoldingKeys() && !isInputMode()) {
|
|
7661
|
+
event.preventDefault();
|
|
7662
|
+
event.stopPropagation();
|
|
7663
|
+
event.stopImmediatePropagation();
|
|
7364
7664
|
const element = frozenElement() || targetElement();
|
|
7365
7665
|
if (element) {
|
|
7366
7666
|
const bounds = createElementBounds(element);
|
|
@@ -7368,6 +7668,10 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7368
7668
|
setCopyStartX(mouseX());
|
|
7369
7669
|
setCopyStartY(mouseY());
|
|
7370
7670
|
setCopyOffsetFromCenterX(mouseX() - selectionCenterX);
|
|
7671
|
+
const cachedInput = elementInputCache.get(element);
|
|
7672
|
+
if (cachedInput) {
|
|
7673
|
+
setInputText(cachedInput);
|
|
7674
|
+
}
|
|
7371
7675
|
}
|
|
7372
7676
|
setIsToggleMode(true);
|
|
7373
7677
|
setIsToggleFrozen(true);
|
|
@@ -7405,16 +7709,20 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7405
7709
|
}
|
|
7406
7710
|
if (!isTargetKeyCombination(event, options)) {
|
|
7407
7711
|
if (isActivated() && !isToggleMode() && (event.metaKey || event.ctrlKey)) {
|
|
7408
|
-
if (!MODIFIER_KEYS.includes(event.key) && event.
|
|
7712
|
+
if (!MODIFIER_KEYS.includes(event.key) && !isEnterCode(event.code)) {
|
|
7409
7713
|
deactivateRenderer();
|
|
7410
7714
|
}
|
|
7411
7715
|
}
|
|
7412
|
-
if (event.
|
|
7716
|
+
if (!isEnterCode(event.code) || !isHoldingKeys()) {
|
|
7413
7717
|
return;
|
|
7414
7718
|
}
|
|
7415
7719
|
}
|
|
7416
7720
|
if ((isActivated() || isHoldingKeys()) && !isInputMode()) {
|
|
7417
7721
|
event.preventDefault();
|
|
7722
|
+
if (isEnterCode(event.code)) {
|
|
7723
|
+
event.stopPropagation();
|
|
7724
|
+
event.stopImmediatePropagation();
|
|
7725
|
+
}
|
|
7418
7726
|
}
|
|
7419
7727
|
if (isActivated()) {
|
|
7420
7728
|
if (isToggleMode()) return;
|
|
@@ -7442,6 +7750,7 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7442
7750
|
capture: true
|
|
7443
7751
|
});
|
|
7444
7752
|
window.addEventListener("keyup", (event) => {
|
|
7753
|
+
if (blockEnterIfNeeded(event)) return;
|
|
7445
7754
|
if (!isHoldingKeys() && !isActivated()) return;
|
|
7446
7755
|
if (isInputMode()) return;
|
|
7447
7756
|
const hasCustomShortcut = Boolean(options.activationShortcut || options.activationKey);
|
|
@@ -7488,6 +7797,10 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7488
7797
|
signal: eventListenerSignal,
|
|
7489
7798
|
capture: true
|
|
7490
7799
|
});
|
|
7800
|
+
window.addEventListener("keypress", blockEnterIfNeeded, {
|
|
7801
|
+
signal: eventListenerSignal,
|
|
7802
|
+
capture: true
|
|
7803
|
+
});
|
|
7491
7804
|
window.addEventListener("mousemove", (event) => {
|
|
7492
7805
|
setIsTouchMode(false);
|
|
7493
7806
|
if (isEventFromOverlay(event, "data-react-grab-ignore-events")) return;
|
|
@@ -7496,6 +7809,7 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7496
7809
|
signal: eventListenerSignal
|
|
7497
7810
|
});
|
|
7498
7811
|
window.addEventListener("mousedown", (event) => {
|
|
7812
|
+
if (event.button !== 0) return;
|
|
7499
7813
|
if (isEventFromOverlay(event, "data-react-grab-ignore-events")) return;
|
|
7500
7814
|
if (isInputMode()) {
|
|
7501
7815
|
handleInputCancel();
|
|
@@ -7511,14 +7825,16 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7511
7825
|
capture: true
|
|
7512
7826
|
});
|
|
7513
7827
|
window.addEventListener("pointerdown", (event) => {
|
|
7514
|
-
if (
|
|
7828
|
+
if (event.button !== 0) return;
|
|
7515
7829
|
if (isEventFromOverlay(event, "data-react-grab-ignore-events")) return;
|
|
7830
|
+
if (!isRendererActive() || isCopying() || isInputMode()) return;
|
|
7516
7831
|
event.stopPropagation();
|
|
7517
7832
|
}, {
|
|
7518
7833
|
signal: eventListenerSignal,
|
|
7519
7834
|
capture: true
|
|
7520
7835
|
});
|
|
7521
7836
|
window.addEventListener("mouseup", (event) => {
|
|
7837
|
+
if (event.button !== 0) return;
|
|
7522
7838
|
handlePointerUp(event.clientX, event.clientY);
|
|
7523
7839
|
}, {
|
|
7524
7840
|
signal: eventListenerSignal
|
|
@@ -7563,7 +7879,7 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7563
7879
|
if (hadDrag) {
|
|
7564
7880
|
setDidJustDrag(false);
|
|
7565
7881
|
}
|
|
7566
|
-
if (isToggleMode() && !isCopying()) {
|
|
7882
|
+
if (isToggleMode() && !isCopying() && !isInputMode()) {
|
|
7567
7883
|
if (!isHoldingKeys()) {
|
|
7568
7884
|
deactivateRenderer();
|
|
7569
7885
|
} else {
|
|
@@ -7596,6 +7912,10 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7596
7912
|
}, {
|
|
7597
7913
|
signal: eventListenerSignal
|
|
7598
7914
|
});
|
|
7915
|
+
const boundsRecalcIntervalId = setInterval(() => {
|
|
7916
|
+
setViewportVersion((version) => version + 1);
|
|
7917
|
+
}, BOUNDS_RECALC_INTERVAL_MS);
|
|
7918
|
+
onCleanup(() => clearInterval(boundsRecalcIntervalId));
|
|
7599
7919
|
document.addEventListener("copy", (event) => {
|
|
7600
7920
|
if (isInputMode() || isEventFromOverlay(event, "data-react-grab-ignore-events")) {
|
|
7601
7921
|
return;
|
|
@@ -7623,11 +7943,18 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7623
7943
|
selectionDebounceTimerId = null;
|
|
7624
7944
|
const currentSelection = window.getSelection();
|
|
7625
7945
|
if (!currentSelection || currentSelection.isCollapsed || currentSelection.rangeCount === 0) {
|
|
7946
|
+
clearNativeSelectionState();
|
|
7626
7947
|
return;
|
|
7627
7948
|
}
|
|
7628
7949
|
const range = currentSelection.getRangeAt(0);
|
|
7629
7950
|
const rangeRect = range.getBoundingClientRect();
|
|
7630
7951
|
if (rangeRect.width === 0 && rangeRect.height === 0) {
|
|
7952
|
+
clearNativeSelectionState();
|
|
7953
|
+
return;
|
|
7954
|
+
}
|
|
7955
|
+
const selectedText = currentSelection.toString().trim();
|
|
7956
|
+
if (!selectedText) {
|
|
7957
|
+
clearNativeSelectionState();
|
|
7631
7958
|
return;
|
|
7632
7959
|
}
|
|
7633
7960
|
const isBackward = (() => {
|
|
@@ -7639,6 +7966,7 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7639
7966
|
})();
|
|
7640
7967
|
const clientRects = range.getClientRects();
|
|
7641
7968
|
if (clientRects.length === 0) {
|
|
7969
|
+
clearNativeSelectionState();
|
|
7642
7970
|
return;
|
|
7643
7971
|
}
|
|
7644
7972
|
const cursorRect = isBackward ? clientRects[0] : clientRects[clientRects.length - 1];
|
|
@@ -7648,15 +7976,15 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7648
7976
|
clearNativeSelectionState();
|
|
7649
7977
|
return;
|
|
7650
7978
|
}
|
|
7651
|
-
setNativeSelectionCursorX(cursorX);
|
|
7652
|
-
setNativeSelectionCursorY(cursorY);
|
|
7653
7979
|
const container = range.commonAncestorContainer;
|
|
7654
7980
|
const element = container.nodeType === Node.ELEMENT_NODE ? container : container.parentElement;
|
|
7655
7981
|
if (element && isValidGrabbableElement(element)) {
|
|
7982
|
+
setNativeSelectionCursorX(cursorX);
|
|
7983
|
+
setNativeSelectionCursorY(cursorY);
|
|
7656
7984
|
setNativeSelectionElements([element]);
|
|
7657
7985
|
setHasNativeSelection(true);
|
|
7658
7986
|
} else {
|
|
7659
|
-
|
|
7987
|
+
clearNativeSelectionState();
|
|
7660
7988
|
}
|
|
7661
7989
|
}, 150);
|
|
7662
7990
|
}, {
|
|
@@ -7670,26 +7998,30 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7670
7998
|
stopProgressAnimation();
|
|
7671
7999
|
document.body.style.userSelect = "";
|
|
7672
8000
|
setCursorOverride(null);
|
|
8001
|
+
if (didPatchKeyboardEvent && originalKeyDescriptor) {
|
|
8002
|
+
Object.defineProperty(KeyboardEvent.prototype, "key", originalKeyDescriptor);
|
|
8003
|
+
}
|
|
7673
8004
|
});
|
|
7674
8005
|
const rendererRoot = mountRoot(styles_default);
|
|
7675
8006
|
const selectionVisible = createMemo(() => {
|
|
7676
8007
|
if (!theme().selectionBox.enabled) return false;
|
|
7677
|
-
|
|
8008
|
+
if (didJustCopy()) return false;
|
|
8009
|
+
return isRendererActive() && !isDragging() && Boolean(effectiveElement());
|
|
7678
8010
|
});
|
|
7679
8011
|
const selectionTagName = createMemo(() => {
|
|
7680
|
-
const element =
|
|
8012
|
+
const element = effectiveElement();
|
|
7681
8013
|
if (!element) return void 0;
|
|
7682
8014
|
return extractElementTagName(element) || void 0;
|
|
7683
8015
|
});
|
|
7684
|
-
const [selectionComponentName] = createResource(() =>
|
|
8016
|
+
const [selectionComponentName] = createResource(() => effectiveElement(), async (element) => {
|
|
7685
8017
|
if (!element) return void 0;
|
|
7686
8018
|
const name = await getNearestComponentName(element);
|
|
7687
8019
|
return name ?? void 0;
|
|
7688
8020
|
});
|
|
7689
8021
|
const selectionLabelVisible = createMemo(() => {
|
|
7690
8022
|
if (!theme().elementLabel.enabled) return false;
|
|
7691
|
-
if (
|
|
7692
|
-
return isRendererActive() && !isDragging() && Boolean(
|
|
8023
|
+
if (didJustCopy()) return false;
|
|
8024
|
+
return isRendererActive() && !isDragging() && Boolean(effectiveElement());
|
|
7693
8025
|
});
|
|
7694
8026
|
const computedLabelInstances = createMemo(() => {
|
|
7695
8027
|
viewportVersion();
|
|
@@ -7703,14 +8035,25 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7703
8035
|
};
|
|
7704
8036
|
});
|
|
7705
8037
|
});
|
|
8038
|
+
const computedGrabbedBoxes = createMemo(() => {
|
|
8039
|
+
viewportVersion();
|
|
8040
|
+
return grabbedBoxes().map((box) => {
|
|
8041
|
+
if (!box.element || !document.body.contains(box.element)) {
|
|
8042
|
+
return box;
|
|
8043
|
+
}
|
|
8044
|
+
return {
|
|
8045
|
+
...box,
|
|
8046
|
+
bounds: createElementBounds(box.element)
|
|
8047
|
+
};
|
|
8048
|
+
});
|
|
8049
|
+
});
|
|
7706
8050
|
const dragVisible = createMemo(() => theme().dragBox.enabled && isRendererActive() && isDraggingBeyondThreshold());
|
|
7707
8051
|
const labelVariant = createMemo(() => isCopying() ? "processing" : "hover");
|
|
7708
8052
|
const labelVisible = createMemo(() => {
|
|
7709
8053
|
if (!theme().elementLabel.enabled) return false;
|
|
7710
8054
|
if (isInputMode()) return false;
|
|
7711
8055
|
if (isCopying()) return true;
|
|
7712
|
-
|
|
7713
|
-
return isRendererActive() && !isDragging() && Boolean(targetElement());
|
|
8056
|
+
return isRendererActive() && !isDragging() && Boolean(effectiveElement());
|
|
7714
8057
|
});
|
|
7715
8058
|
const crosshairVisible = createMemo(() => theme().crosshair.enabled && isRendererActive() && !isDragging() && !isTouchMode() && !isToggleFrozen());
|
|
7716
8059
|
const shouldShowGrabbedBoxes = createMemo(() => theme().grabbedBoxes.enabled);
|
|
@@ -7757,7 +8100,7 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7757
8100
|
return dragBounds();
|
|
7758
8101
|
},
|
|
7759
8102
|
get grabbedBoxes() {
|
|
7760
|
-
return memo(() => !!shouldShowGrabbedBoxes())() ?
|
|
8103
|
+
return memo(() => !!shouldShowGrabbedBoxes())() ? computedGrabbedBoxes() : [];
|
|
7761
8104
|
},
|
|
7762
8105
|
labelZIndex: Z_INDEX_LABEL,
|
|
7763
8106
|
get mouseX() {
|
|
@@ -7778,6 +8121,9 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7778
8121
|
get hasAgent() {
|
|
7779
8122
|
return hasAgentProvider();
|
|
7780
8123
|
},
|
|
8124
|
+
get isAgentConnected() {
|
|
8125
|
+
return isAgentConnected();
|
|
8126
|
+
},
|
|
7781
8127
|
get agentSessions() {
|
|
7782
8128
|
return agentManager.sessions();
|
|
7783
8129
|
},
|
|
@@ -7786,6 +8132,11 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7786
8132
|
onInputSubmit: () => void handleInputSubmit(),
|
|
7787
8133
|
onInputCancel: handleInputCancel,
|
|
7788
8134
|
onToggleExpand: handleToggleExpand,
|
|
8135
|
+
get isPendingDismiss() {
|
|
8136
|
+
return isPendingDismiss();
|
|
8137
|
+
},
|
|
8138
|
+
onConfirmDismiss: handleConfirmDismiss,
|
|
8139
|
+
onCancelDismiss: handleCancelDismiss,
|
|
7789
8140
|
get nativeSelectionCursorVisible() {
|
|
7790
8141
|
return hasNativeSelection();
|
|
7791
8142
|
},
|
|
@@ -7895,6 +8246,11 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7895
8246
|
};
|
|
7896
8247
|
agentManager.setOptions(mergedOptions);
|
|
7897
8248
|
setHasAgentProvider(Boolean(mergedOptions.provider));
|
|
8249
|
+
if (mergedOptions.provider?.checkConnection) {
|
|
8250
|
+
void mergedOptions.provider.checkConnection().then((connected) => {
|
|
8251
|
+
setIsAgentConnected(connected);
|
|
8252
|
+
});
|
|
8253
|
+
}
|
|
7898
8254
|
agentManager.tryResumeSessions();
|
|
7899
8255
|
}
|
|
7900
8256
|
};
|