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
|
@@ -576,6 +576,61 @@ function mapArray(list, mapFn, options = {}) {
|
|
|
576
576
|
}
|
|
577
577
|
};
|
|
578
578
|
}
|
|
579
|
+
function indexArray(list, mapFn, options = {}) {
|
|
580
|
+
let items = [], mapped = [], disposers = [], signals = [], len = 0, i2;
|
|
581
|
+
onCleanup(() => dispose(disposers));
|
|
582
|
+
return () => {
|
|
583
|
+
const newItems = list() || [], newLen = newItems.length;
|
|
584
|
+
newItems[$TRACK];
|
|
585
|
+
return untrack(() => {
|
|
586
|
+
if (newLen === 0) {
|
|
587
|
+
if (len !== 0) {
|
|
588
|
+
dispose(disposers);
|
|
589
|
+
disposers = [];
|
|
590
|
+
items = [];
|
|
591
|
+
mapped = [];
|
|
592
|
+
len = 0;
|
|
593
|
+
signals = [];
|
|
594
|
+
}
|
|
595
|
+
if (options.fallback) {
|
|
596
|
+
items = [FALLBACK];
|
|
597
|
+
mapped[0] = createRoot((disposer) => {
|
|
598
|
+
disposers[0] = disposer;
|
|
599
|
+
return options.fallback();
|
|
600
|
+
});
|
|
601
|
+
len = 1;
|
|
602
|
+
}
|
|
603
|
+
return mapped;
|
|
604
|
+
}
|
|
605
|
+
if (items[0] === FALLBACK) {
|
|
606
|
+
disposers[0]();
|
|
607
|
+
disposers = [];
|
|
608
|
+
items = [];
|
|
609
|
+
mapped = [];
|
|
610
|
+
len = 0;
|
|
611
|
+
}
|
|
612
|
+
for (i2 = 0; i2 < newLen; i2++) {
|
|
613
|
+
if (i2 < items.length && items[i2] !== newItems[i2]) {
|
|
614
|
+
signals[i2](() => newItems[i2]);
|
|
615
|
+
} else if (i2 >= items.length) {
|
|
616
|
+
mapped[i2] = createRoot(mapper);
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
for (; i2 < items.length; i2++) {
|
|
620
|
+
disposers[i2]();
|
|
621
|
+
}
|
|
622
|
+
len = signals.length = disposers.length = newLen;
|
|
623
|
+
items = newItems.slice(0);
|
|
624
|
+
return mapped = mapped.slice(0, len);
|
|
625
|
+
});
|
|
626
|
+
function mapper(disposer) {
|
|
627
|
+
disposers[i2] = disposer;
|
|
628
|
+
const [s3, set] = createSignal(newItems[i2]);
|
|
629
|
+
signals[i2] = set;
|
|
630
|
+
return mapFn(s3, i2);
|
|
631
|
+
}
|
|
632
|
+
};
|
|
633
|
+
}
|
|
579
634
|
function createComponent(Comp, props) {
|
|
580
635
|
return untrack(() => Comp(props || {}));
|
|
581
636
|
}
|
|
@@ -586,6 +641,12 @@ function For(props) {
|
|
|
586
641
|
};
|
|
587
642
|
return createMemo(mapArray(() => props.each, props.children, fallback || void 0));
|
|
588
643
|
}
|
|
644
|
+
function Index(props) {
|
|
645
|
+
const fallback = "fallback" in props && {
|
|
646
|
+
fallback: () => props.fallback
|
|
647
|
+
};
|
|
648
|
+
return createMemo(indexArray(() => props.each, props.children, fallback || void 0));
|
|
649
|
+
}
|
|
589
650
|
function Show(props) {
|
|
590
651
|
const keyed = props.keyed;
|
|
591
652
|
const conditionValue = createMemo(() => props.when, void 0, void 0);
|
|
@@ -888,7 +949,7 @@ function cleanChildren(parent, current, marker, replacement) {
|
|
|
888
949
|
|
|
889
950
|
// dist/styles.css
|
|
890
951
|
var styles_default = `/*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */
|
|
891
|
-
@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}}`;
|
|
952
|
+
@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}}`;
|
|
892
953
|
|
|
893
954
|
// src/utils/is-keyboard-event-triggered-by-input.ts
|
|
894
955
|
var FORM_TAGS_AND_ROLES = [
|
|
@@ -1017,7 +1078,7 @@ var buildOpenFileUrl = (filePath, lineNumber) => {
|
|
|
1017
1078
|
};
|
|
1018
1079
|
|
|
1019
1080
|
// src/constants.ts
|
|
1020
|
-
var VERSION = "0.0.
|
|
1081
|
+
var VERSION = "0.0.72";
|
|
1021
1082
|
var VIEWPORT_MARGIN_PX = 8;
|
|
1022
1083
|
var OFFSCREEN_POSITION = -1e3;
|
|
1023
1084
|
var SELECTION_LERP_FACTOR = 0.95;
|
|
@@ -1027,6 +1088,7 @@ var SELECTION_CURSOR_SETTLE_DELAY_MS = 500;
|
|
|
1027
1088
|
var BLUR_DEACTIVATION_THRESHOLD_MS = 500;
|
|
1028
1089
|
var DRAG_THRESHOLD_PX = 2;
|
|
1029
1090
|
var ELEMENT_DETECTION_THROTTLE_MS = 32;
|
|
1091
|
+
var BOUNDS_RECALC_INTERVAL_MS = 100;
|
|
1030
1092
|
var AUTO_SCROLL_EDGE_THRESHOLD_PX = 25;
|
|
1031
1093
|
var AUTO_SCROLL_SPEED_PX = 10;
|
|
1032
1094
|
var Z_INDEX_LABEL = 2147483647;
|
|
@@ -3598,7 +3660,7 @@ var SelectionBox = (props) => {
|
|
|
3598
3660
|
get children() {
|
|
3599
3661
|
var _el$ = _tmpl$();
|
|
3600
3662
|
createRenderEffect((_p$) => {
|
|
3601
|
-
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
|
|
3663
|
+
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;
|
|
3602
3664
|
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
3603
3665
|
_v$2 !== _p$.t && setStyleProperty(_el$, "top", _p$.t = _v$2);
|
|
3604
3666
|
_v$3 !== _p$.a && setStyleProperty(_el$, "left", _p$.a = _v$3);
|
|
@@ -3760,7 +3822,7 @@ var useSpeechRecognition = (options) => {
|
|
|
3760
3822
|
let baseValue;
|
|
3761
3823
|
if (lastInterimText && currentValue.endsWith(lastInterimText)) {
|
|
3762
3824
|
baseValue = currentValue.slice(0, -lastInterimText.length);
|
|
3763
|
-
} else if (currentValue === lastValueWeSet) {
|
|
3825
|
+
} else if (currentValue === lastValueWeSet && lastInterimText) {
|
|
3764
3826
|
baseValue = currentValue.slice(0, -lastInterimText.length);
|
|
3765
3827
|
} else {
|
|
3766
3828
|
baseValue = currentValue;
|
|
@@ -3857,24 +3919,48 @@ var IconMic = (props) => {
|
|
|
3857
3919
|
})();
|
|
3858
3920
|
};
|
|
3859
3921
|
|
|
3922
|
+
// src/components/icon-return.tsx
|
|
3923
|
+
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>`);
|
|
3924
|
+
var IconReturn = (props) => {
|
|
3925
|
+
const size = () => props.size ?? 12;
|
|
3926
|
+
return (() => {
|
|
3927
|
+
var _el$ = _tmpl$5();
|
|
3928
|
+
createRenderEffect((_p$) => {
|
|
3929
|
+
var _v$ = size(), _v$2 = size() * 19 / 22, _v$3 = props.class;
|
|
3930
|
+
_v$ !== _p$.e && setAttribute(_el$, "width", _p$.e = _v$);
|
|
3931
|
+
_v$2 !== _p$.t && setAttribute(_el$, "height", _p$.t = _v$2);
|
|
3932
|
+
_v$3 !== _p$.a && setAttribute(_el$, "class", _p$.a = _v$3);
|
|
3933
|
+
return _p$;
|
|
3934
|
+
}, {
|
|
3935
|
+
e: void 0,
|
|
3936
|
+
t: void 0,
|
|
3937
|
+
a: void 0
|
|
3938
|
+
});
|
|
3939
|
+
return _el$;
|
|
3940
|
+
})();
|
|
3941
|
+
};
|
|
3942
|
+
|
|
3860
3943
|
// src/components/selection-label.tsx
|
|
3861
|
-
var _tmpl$
|
|
3944
|
+
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>`);
|
|
3862
3945
|
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">`);
|
|
3863
3946
|
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">>`);
|
|
3864
3947
|
var _tmpl$42 = /* @__PURE__ */ template(`<div class="absolute w-0 h-0"style="border-left:8px solid transparent;border-right:8px solid transparent">`);
|
|
3865
3948
|
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">`);
|
|
3866
|
-
var _tmpl$
|
|
3867
|
-
var _tmpl$7 = /* @__PURE__ */ template(`<div class="[
|
|
3868
|
-
var _tmpl$8 = /* @__PURE__ */ template(`<
|
|
3869
|
-
var _tmpl$9 = /* @__PURE__ */ template(`<div class="shrink-0 flex
|
|
3870
|
-
var _tmpl$0 = /* @__PURE__ */ template(`<
|
|
3871
|
-
var _tmpl$1 = /* @__PURE__ */ template(`<div class="
|
|
3872
|
-
var _tmpl$10 = /* @__PURE__ */ template(`<div class="contain-layout shrink-0 flex
|
|
3873
|
-
var _tmpl$11 = /* @__PURE__ */ template(`<div class="contain-layout shrink-0 flex
|
|
3874
|
-
var _tmpl$12 = /* @__PURE__ */ template(`<
|
|
3875
|
-
var _tmpl$13 = /* @__PURE__ */ template(`<div class="shrink-0 flex justify-
|
|
3876
|
-
var _tmpl$14 = /* @__PURE__ */ template(`<
|
|
3877
|
-
var _tmpl$15 = /* @__PURE__ */ template(`<
|
|
3949
|
+
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%)">`);
|
|
3950
|
+
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`);
|
|
3951
|
+
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?`);
|
|
3952
|
+
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">`);
|
|
3953
|
+
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">`);
|
|
3954
|
+
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>`);
|
|
3955
|
+
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">`);
|
|
3956
|
+
var _tmpl$11 = /* @__PURE__ */ template(`<div class="contain-layout shrink-0 flex items-center gap-px w-fit h-fit">`);
|
|
3957
|
+
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`);
|
|
3958
|
+
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>`);
|
|
3959
|
+
var _tmpl$14 = /* @__PURE__ */ template(`<button>`);
|
|
3960
|
+
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">`);
|
|
3961
|
+
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">`);
|
|
3962
|
+
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>`);
|
|
3963
|
+
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">`);
|
|
3878
3964
|
var ARROW_HEIGHT = 8;
|
|
3879
3965
|
var LABEL_GAP = 4;
|
|
3880
3966
|
var IDLE_TIMEOUT_MS = 400;
|
|
@@ -3889,7 +3975,7 @@ var TagBadge = (props) => {
|
|
|
3889
3975
|
props.onHoverChange?.(false);
|
|
3890
3976
|
};
|
|
3891
3977
|
return (() => {
|
|
3892
|
-
var _el$ = _tmpl$
|
|
3978
|
+
var _el$ = _tmpl$6(), _el$2 = _el$.firstChild;
|
|
3893
3979
|
addEventListener(_el$, "click", props.onClick);
|
|
3894
3980
|
_el$.addEventListener("mouseleave", handleMouseLeave);
|
|
3895
3981
|
_el$.addEventListener("mouseenter", handleMouseEnter);
|
|
@@ -3962,19 +4048,61 @@ var ClickToCopyPill = (props) => {
|
|
|
3962
4048
|
})();
|
|
3963
4049
|
};
|
|
3964
4050
|
var BottomSection = (props) => (() => {
|
|
3965
|
-
var _el$9 = _tmpl$
|
|
4051
|
+
var _el$9 = _tmpl$62();
|
|
3966
4052
|
insert(_el$9, () => props.children);
|
|
3967
4053
|
return _el$9;
|
|
3968
4054
|
})();
|
|
4055
|
+
var DismissConfirmation = (props) => {
|
|
4056
|
+
const handleKeyDown = (event) => {
|
|
4057
|
+
if (event.code === "Enter") {
|
|
4058
|
+
event.preventDefault();
|
|
4059
|
+
event.stopPropagation();
|
|
4060
|
+
props.onConfirm?.();
|
|
4061
|
+
} else if (event.code === "Escape") {
|
|
4062
|
+
event.preventDefault();
|
|
4063
|
+
event.stopPropagation();
|
|
4064
|
+
props.onCancel?.();
|
|
4065
|
+
}
|
|
4066
|
+
};
|
|
4067
|
+
onMount(() => {
|
|
4068
|
+
window.addEventListener("keydown", handleKeyDown, {
|
|
4069
|
+
capture: true
|
|
4070
|
+
});
|
|
4071
|
+
});
|
|
4072
|
+
onCleanup(() => {
|
|
4073
|
+
window.removeEventListener("keydown", handleKeyDown, {
|
|
4074
|
+
capture: true
|
|
4075
|
+
});
|
|
4076
|
+
});
|
|
4077
|
+
return (() => {
|
|
4078
|
+
var _el$0 = _tmpl$8(); _el$0.firstChild;
|
|
4079
|
+
insert(_el$0, createComponent(BottomSection, {
|
|
4080
|
+
get children() {
|
|
4081
|
+
var _el$10 = _tmpl$7(), _el$11 = _el$10.firstChild, _el$12 = _el$11.nextSibling; _el$12.firstChild;
|
|
4082
|
+
addEventListener(_el$11, "click", props.onCancel);
|
|
4083
|
+
addEventListener(_el$12, "click", props.onConfirm);
|
|
4084
|
+
insert(_el$12, createComponent(IconReturn, {
|
|
4085
|
+
size: 10,
|
|
4086
|
+
"class": "text-[#c00002]"
|
|
4087
|
+
}), null);
|
|
4088
|
+
return _el$10;
|
|
4089
|
+
}
|
|
4090
|
+
}), null);
|
|
4091
|
+
return _el$0;
|
|
4092
|
+
})();
|
|
4093
|
+
};
|
|
3969
4094
|
var SelectionLabel = (props) => {
|
|
3970
4095
|
let containerRef;
|
|
3971
4096
|
let inputRef;
|
|
3972
4097
|
let isTagCurrentlyHovered = false;
|
|
4098
|
+
let lastValidPosition = null;
|
|
4099
|
+
let lastElementIdentity = null;
|
|
3973
4100
|
const [measuredWidth, setMeasuredWidth] = createSignal(0);
|
|
3974
4101
|
const [measuredHeight, setMeasuredHeight] = createSignal(0);
|
|
3975
4102
|
const [arrowPosition, setArrowPosition] = createSignal("bottom");
|
|
3976
4103
|
const [viewportVersion, setViewportVersion] = createSignal(0);
|
|
3977
4104
|
const [isIdle, setIsIdle] = createSignal(false);
|
|
4105
|
+
const [hadValidBounds, setHadValidBounds] = createSignal(false);
|
|
3978
4106
|
const speechRecognition = useSpeechRecognition({
|
|
3979
4107
|
onTranscript: (transcript) => props.onInputChange?.(transcript),
|
|
3980
4108
|
getCurrentValue: () => props.inputValue ?? ""
|
|
@@ -4031,8 +4159,11 @@ var SelectionLabel = (props) => {
|
|
|
4031
4159
|
}
|
|
4032
4160
|
});
|
|
4033
4161
|
createEffect(() => {
|
|
4034
|
-
|
|
4035
|
-
|
|
4162
|
+
const elementIdentity = `${props.tagName ?? ""}:${props.componentName ?? ""}`;
|
|
4163
|
+
if (elementIdentity !== lastElementIdentity) {
|
|
4164
|
+
lastElementIdentity = elementIdentity;
|
|
4165
|
+
resetIdleTimer();
|
|
4166
|
+
}
|
|
4036
4167
|
});
|
|
4037
4168
|
createEffect(() => {
|
|
4038
4169
|
if (props.visible) {
|
|
@@ -4057,8 +4188,10 @@ var SelectionLabel = (props) => {
|
|
|
4057
4188
|
const bounds = props.selectionBounds;
|
|
4058
4189
|
const labelWidth = measuredWidth();
|
|
4059
4190
|
const labelHeight = measuredHeight();
|
|
4060
|
-
|
|
4061
|
-
|
|
4191
|
+
const hasMeasurements = labelWidth > 0 && labelHeight > 0;
|
|
4192
|
+
const hasValidBounds = bounds && bounds.width > 0 && bounds.height > 0;
|
|
4193
|
+
if (!hasMeasurements || !hasValidBounds) {
|
|
4194
|
+
return lastValidPosition ?? {
|
|
4062
4195
|
left: -9999,
|
|
4063
4196
|
top: -9999,
|
|
4064
4197
|
arrowLeft: 0
|
|
@@ -4090,17 +4223,21 @@ var SelectionLabel = (props) => {
|
|
|
4090
4223
|
positionTop = VIEWPORT_MARGIN_PX;
|
|
4091
4224
|
}
|
|
4092
4225
|
const arrowLeft = Math.max(12, Math.min(cursorX - positionLeft, labelWidth - 12));
|
|
4093
|
-
|
|
4226
|
+
const position = {
|
|
4094
4227
|
left: positionLeft,
|
|
4095
4228
|
top: positionTop,
|
|
4096
4229
|
arrowLeft
|
|
4097
4230
|
};
|
|
4231
|
+
lastValidPosition = position;
|
|
4232
|
+
setHadValidBounds(true);
|
|
4233
|
+
return position;
|
|
4098
4234
|
};
|
|
4099
4235
|
const handleKeyDown = (event) => {
|
|
4100
4236
|
event.stopPropagation();
|
|
4101
4237
|
event.stopImmediatePropagation();
|
|
4102
4238
|
if (event.code === "Enter" && !event.shiftKey) {
|
|
4103
4239
|
event.preventDefault();
|
|
4240
|
+
if (!props.inputValue?.trim()) return;
|
|
4104
4241
|
speechRecognition.stop();
|
|
4105
4242
|
props.onSubmit?.();
|
|
4106
4243
|
} else if (event.code === "Escape") {
|
|
@@ -4126,75 +4263,93 @@ var SelectionLabel = (props) => {
|
|
|
4126
4263
|
event.stopPropagation();
|
|
4127
4264
|
event.stopImmediatePropagation();
|
|
4128
4265
|
};
|
|
4266
|
+
const handleContainerPointerDown = (event) => {
|
|
4267
|
+
stopPropagation(event);
|
|
4268
|
+
const isEditableInputVisible = isNotProcessing() && props.isInputExpanded && !props.isPendingDismiss;
|
|
4269
|
+
if (isEditableInputVisible && inputRef) {
|
|
4270
|
+
inputRef.focus();
|
|
4271
|
+
}
|
|
4272
|
+
};
|
|
4129
4273
|
const handleSubmit = () => {
|
|
4274
|
+
if (props.isInputExpanded && !props.inputValue?.trim()) return;
|
|
4130
4275
|
speechRecognition.stop();
|
|
4131
4276
|
props.onSubmit?.();
|
|
4132
4277
|
};
|
|
4278
|
+
const shouldShowWithoutBounds = () => hadValidBounds() && (props.status === "copied" || props.status === "fading");
|
|
4133
4279
|
return createComponent(Show, {
|
|
4134
4280
|
get when() {
|
|
4135
|
-
return memo(() => props.visible !== false)() && props.selectionBounds;
|
|
4281
|
+
return memo(() => props.visible !== false)() && (props.selectionBounds || shouldShowWithoutBounds());
|
|
4136
4282
|
},
|
|
4137
4283
|
get children() {
|
|
4138
|
-
var _el$
|
|
4139
|
-
_el$
|
|
4140
|
-
_el$
|
|
4141
|
-
_el$
|
|
4284
|
+
var _el$14 = _tmpl$18(), _el$18 = _el$14.firstChild;
|
|
4285
|
+
_el$14.$$click = stopPropagation;
|
|
4286
|
+
_el$14.$$mousedown = stopPropagation;
|
|
4287
|
+
_el$14.$$pointerdown = handleContainerPointerDown;
|
|
4142
4288
|
var _ref$ = containerRef;
|
|
4143
|
-
typeof _ref$ === "function" ? use(_ref$, _el$
|
|
4144
|
-
insert(_el$
|
|
4289
|
+
typeof _ref$ === "function" ? use(_ref$, _el$14) : containerRef = _el$14;
|
|
4290
|
+
insert(_el$14, createComponent(Arrow, {
|
|
4145
4291
|
get position() {
|
|
4146
4292
|
return arrowPosition();
|
|
4147
4293
|
},
|
|
4148
4294
|
get leftPx() {
|
|
4149
4295
|
return computedPosition().arrowLeft;
|
|
4150
4296
|
}
|
|
4151
|
-
}), _el$
|
|
4152
|
-
insert(_el$
|
|
4297
|
+
}), _el$18);
|
|
4298
|
+
insert(_el$14, createComponent(Show, {
|
|
4153
4299
|
get when() {
|
|
4154
4300
|
return props.status === "copied" || props.status === "fading";
|
|
4155
4301
|
},
|
|
4156
4302
|
get children() {
|
|
4157
|
-
var _el$
|
|
4158
|
-
insert(_el$
|
|
4159
|
-
return _el$
|
|
4303
|
+
var _el$15 = _tmpl$9(), _el$16 = _el$15.firstChild, _el$17 = _el$16.firstChild;
|
|
4304
|
+
insert(_el$17, () => props.hasAgent ? "Completed" : "Copied");
|
|
4305
|
+
return _el$15;
|
|
4160
4306
|
}
|
|
4161
|
-
}), _el$
|
|
4162
|
-
insert(_el$
|
|
4307
|
+
}), _el$18);
|
|
4308
|
+
insert(_el$18, createComponent(Show, {
|
|
4163
4309
|
get when() {
|
|
4164
4310
|
return props.status === "copying";
|
|
4165
4311
|
},
|
|
4166
4312
|
get children() {
|
|
4167
|
-
var _el$
|
|
4168
|
-
insert(_el$
|
|
4169
|
-
insert(_el$
|
|
4313
|
+
var _el$19 = _tmpl$10(), _el$20 = _el$19.firstChild, _el$21 = _el$20.firstChild, _el$22 = _el$21.firstChild;
|
|
4314
|
+
insert(_el$22, () => props.statusText ?? "Grabbing\u2026");
|
|
4315
|
+
insert(_el$19, createComponent(BottomSection, {
|
|
4170
4316
|
get children() {
|
|
4171
|
-
var _el$
|
|
4317
|
+
var _el$23 = _tmpl$1(), _el$24 = _el$23.firstChild;
|
|
4172
4318
|
var _ref$2 = inputRef;
|
|
4173
|
-
typeof _ref$2 === "function" ? use(_ref$2, _el$
|
|
4174
|
-
insert(_el$
|
|
4319
|
+
typeof _ref$2 === "function" ? use(_ref$2, _el$24) : inputRef = _el$24;
|
|
4320
|
+
insert(_el$23, createComponent(Show, {
|
|
4175
4321
|
get when() {
|
|
4176
4322
|
return props.onAbort;
|
|
4177
4323
|
},
|
|
4178
4324
|
get children() {
|
|
4179
|
-
var _el$
|
|
4180
|
-
|
|
4181
|
-
|
|
4325
|
+
var _el$25 = _tmpl$0();
|
|
4326
|
+
_el$25.$$click = (event) => {
|
|
4327
|
+
event.stopPropagation();
|
|
4328
|
+
props.onAbort?.();
|
|
4329
|
+
};
|
|
4330
|
+
_el$25.$$pointerup = (event) => {
|
|
4331
|
+
event.stopPropagation();
|
|
4332
|
+
props.onAbort?.();
|
|
4333
|
+
};
|
|
4334
|
+
_el$25.$$mousedown = (event) => event.stopPropagation();
|
|
4335
|
+
_el$25.$$pointerdown = (event) => event.stopPropagation();
|
|
4336
|
+
return _el$25;
|
|
4182
4337
|
}
|
|
4183
4338
|
}), null);
|
|
4184
|
-
createRenderEffect(() => _el$
|
|
4185
|
-
return _el$
|
|
4339
|
+
createRenderEffect(() => _el$24.value = props.inputValue ?? "");
|
|
4340
|
+
return _el$23;
|
|
4186
4341
|
}
|
|
4187
4342
|
}), null);
|
|
4188
|
-
return _el$
|
|
4343
|
+
return _el$19;
|
|
4189
4344
|
}
|
|
4190
4345
|
}), null);
|
|
4191
|
-
insert(_el$
|
|
4346
|
+
insert(_el$18, createComponent(Show, {
|
|
4192
4347
|
get when() {
|
|
4193
4348
|
return memo(() => !!isNotProcessing())() && !props.isInputExpanded;
|
|
4194
4349
|
},
|
|
4195
4350
|
get children() {
|
|
4196
|
-
var _el$
|
|
4197
|
-
insert(_el$
|
|
4351
|
+
var _el$26 = _tmpl$13(), _el$27 = _el$26.firstChild, _el$29 = _el$27.nextSibling, _el$30 = _el$29.firstChild;
|
|
4352
|
+
insert(_el$27, createComponent(ClickToCopyPill, {
|
|
4198
4353
|
onClick: handleSubmit,
|
|
4199
4354
|
shrink: true,
|
|
4200
4355
|
get hasParent() {
|
|
@@ -4204,19 +4359,19 @@ var SelectionLabel = (props) => {
|
|
|
4204
4359
|
return props.hasAgent;
|
|
4205
4360
|
}
|
|
4206
4361
|
}), null);
|
|
4207
|
-
insert(_el$
|
|
4362
|
+
insert(_el$27, createComponent(Show, {
|
|
4208
4363
|
get when() {
|
|
4209
4364
|
return props.componentName;
|
|
4210
4365
|
},
|
|
4211
4366
|
get children() {
|
|
4212
|
-
var _el$
|
|
4213
|
-
insert(_el$
|
|
4367
|
+
var _el$28 = _tmpl$11();
|
|
4368
|
+
insert(_el$28, createComponent(ParentBadge, {
|
|
4214
4369
|
get name() {
|
|
4215
4370
|
return props.componentName;
|
|
4216
4371
|
}
|
|
4217
4372
|
}), null);
|
|
4218
|
-
insert(_el$
|
|
4219
|
-
insert(_el$
|
|
4373
|
+
insert(_el$28, createComponent(ChevronSeparator, {}), null);
|
|
4374
|
+
insert(_el$28, createComponent(TagBadge, {
|
|
4220
4375
|
get tagName() {
|
|
4221
4376
|
return tagDisplay();
|
|
4222
4377
|
},
|
|
@@ -4228,10 +4383,10 @@ var SelectionLabel = (props) => {
|
|
|
4228
4383
|
showMono: true,
|
|
4229
4384
|
shrink: true
|
|
4230
4385
|
}), null);
|
|
4231
|
-
return _el$
|
|
4386
|
+
return _el$28;
|
|
4232
4387
|
}
|
|
4233
4388
|
}), null);
|
|
4234
|
-
insert(_el$
|
|
4389
|
+
insert(_el$27, createComponent(Show, {
|
|
4235
4390
|
get when() {
|
|
4236
4391
|
return !props.componentName;
|
|
4237
4392
|
},
|
|
@@ -4250,23 +4405,37 @@ var SelectionLabel = (props) => {
|
|
|
4250
4405
|
});
|
|
4251
4406
|
}
|
|
4252
4407
|
}), null);
|
|
4253
|
-
insert(_el$
|
|
4408
|
+
insert(_el$30, createComponent(BottomSection, {
|
|
4254
4409
|
get children() {
|
|
4255
|
-
var _el$
|
|
4256
|
-
|
|
4410
|
+
var _el$31 = _tmpl$12(), _el$32 = _el$31.firstChild, _el$33 = _el$32.nextSibling;
|
|
4411
|
+
insert(_el$33, createComponent(IconReturn, {
|
|
4412
|
+
size: 10,
|
|
4413
|
+
"class": "opacity-[0.99] text-black"
|
|
4414
|
+
}));
|
|
4415
|
+
return _el$31;
|
|
4257
4416
|
}
|
|
4258
4417
|
}));
|
|
4259
|
-
createRenderEffect((
|
|
4260
|
-
|
|
4418
|
+
createRenderEffect((_p$) => {
|
|
4419
|
+
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");
|
|
4420
|
+
_v$3 !== _p$.e && className(_el$27, _p$.e = _v$3);
|
|
4421
|
+
_v$4 !== _p$.t && setStyleProperty(_el$29, "grid-template-rows", _p$.t = _v$4);
|
|
4422
|
+
_v$5 !== _p$.a && className(_el$30, _p$.a = _v$5);
|
|
4423
|
+
return _p$;
|
|
4424
|
+
}, {
|
|
4425
|
+
e: void 0,
|
|
4426
|
+
t: void 0,
|
|
4427
|
+
a: void 0
|
|
4428
|
+
});
|
|
4429
|
+
return _el$26;
|
|
4261
4430
|
}
|
|
4262
4431
|
}), null);
|
|
4263
|
-
insert(_el$
|
|
4432
|
+
insert(_el$18, createComponent(Show, {
|
|
4264
4433
|
get when() {
|
|
4265
|
-
return memo(() => !!isNotProcessing())() && props.
|
|
4434
|
+
return memo(() => !!(isNotProcessing() && props.isInputExpanded))() && !props.isPendingDismiss;
|
|
4266
4435
|
},
|
|
4267
4436
|
get children() {
|
|
4268
|
-
var _el$
|
|
4269
|
-
insert(_el$
|
|
4437
|
+
var _el$34 = _tmpl$17(), _el$35 = _el$34.firstChild;
|
|
4438
|
+
insert(_el$35, createComponent(ClickToCopyPill, {
|
|
4270
4439
|
onClick: handleSubmit,
|
|
4271
4440
|
dimmed: true,
|
|
4272
4441
|
shrink: true,
|
|
@@ -4277,19 +4446,19 @@ var SelectionLabel = (props) => {
|
|
|
4277
4446
|
return props.hasAgent;
|
|
4278
4447
|
}
|
|
4279
4448
|
}), null);
|
|
4280
|
-
insert(_el$
|
|
4449
|
+
insert(_el$35, createComponent(Show, {
|
|
4281
4450
|
get when() {
|
|
4282
4451
|
return props.componentName;
|
|
4283
4452
|
},
|
|
4284
4453
|
get children() {
|
|
4285
|
-
var _el$
|
|
4286
|
-
insert(_el$
|
|
4454
|
+
var _el$36 = _tmpl$11();
|
|
4455
|
+
insert(_el$36, createComponent(ParentBadge, {
|
|
4287
4456
|
get name() {
|
|
4288
4457
|
return props.componentName;
|
|
4289
4458
|
}
|
|
4290
4459
|
}), null);
|
|
4291
|
-
insert(_el$
|
|
4292
|
-
insert(_el$
|
|
4460
|
+
insert(_el$36, createComponent(ChevronSeparator, {}), null);
|
|
4461
|
+
insert(_el$36, createComponent(TagBadge, {
|
|
4293
4462
|
get tagName() {
|
|
4294
4463
|
return tagDisplay();
|
|
4295
4464
|
},
|
|
@@ -4302,10 +4471,10 @@ var SelectionLabel = (props) => {
|
|
|
4302
4471
|
shrink: true,
|
|
4303
4472
|
forceShowIcon: true
|
|
4304
4473
|
}), null);
|
|
4305
|
-
return _el$
|
|
4474
|
+
return _el$36;
|
|
4306
4475
|
}
|
|
4307
4476
|
}), null);
|
|
4308
|
-
insert(_el$
|
|
4477
|
+
insert(_el$35, createComponent(Show, {
|
|
4309
4478
|
get when() {
|
|
4310
4479
|
return !props.componentName;
|
|
4311
4480
|
},
|
|
@@ -4325,62 +4494,83 @@ var SelectionLabel = (props) => {
|
|
|
4325
4494
|
});
|
|
4326
4495
|
}
|
|
4327
4496
|
}), null);
|
|
4328
|
-
insert(_el$
|
|
4497
|
+
insert(_el$34, createComponent(BottomSection, {
|
|
4329
4498
|
get children() {
|
|
4330
|
-
var _el$
|
|
4331
|
-
_el$
|
|
4332
|
-
_el$
|
|
4499
|
+
var _el$37 = _tmpl$16(), _el$38 = _el$37.firstChild, _el$39 = _el$38.nextSibling;
|
|
4500
|
+
_el$38.$$keydown = handleKeyDown;
|
|
4501
|
+
_el$38.$$input = handleInput;
|
|
4333
4502
|
var _ref$3 = inputRef;
|
|
4334
|
-
typeof _ref$3 === "function" ? use(_ref$3, _el$
|
|
4335
|
-
insert(_el$
|
|
4503
|
+
typeof _ref$3 === "function" ? use(_ref$3, _el$38) : inputRef = _el$38;
|
|
4504
|
+
insert(_el$39, createComponent(Show, {
|
|
4336
4505
|
get when() {
|
|
4337
|
-
return memo(() => !!props.hasAgent
|
|
4506
|
+
return memo(() => !!(props.hasAgent && speechRecognition.isSupported()))() && !props.inputValue;
|
|
4338
4507
|
},
|
|
4339
4508
|
get children() {
|
|
4340
|
-
var _el$
|
|
4341
|
-
addEventListener(_el$
|
|
4342
|
-
insert(_el$
|
|
4509
|
+
var _el$40 = _tmpl$14();
|
|
4510
|
+
addEventListener(_el$40, "click", speechRecognition.toggle);
|
|
4511
|
+
insert(_el$40, createComponent(IconMic, {
|
|
4343
4512
|
size: 11,
|
|
4344
4513
|
get ["class"]() {
|
|
4345
4514
|
return speechRecognition.isListening() ? "animate-pulse" : "";
|
|
4346
4515
|
}
|
|
4347
4516
|
}));
|
|
4348
4517
|
createRenderEffect((_p$) => {
|
|
4349
|
-
var _v$
|
|
4350
|
-
_v$
|
|
4351
|
-
_v$
|
|
4518
|
+
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";
|
|
4519
|
+
_v$6 !== _p$.e && className(_el$40, _p$.e = _v$6);
|
|
4520
|
+
_v$7 !== _p$.t && setAttribute(_el$40, "title", _p$.t = _v$7);
|
|
4352
4521
|
return _p$;
|
|
4353
4522
|
}, {
|
|
4354
4523
|
e: void 0,
|
|
4355
4524
|
t: void 0
|
|
4356
4525
|
});
|
|
4357
|
-
return _el$
|
|
4526
|
+
return _el$40;
|
|
4358
4527
|
}
|
|
4359
|
-
}),
|
|
4360
|
-
_el$
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
|
|
4364
|
-
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
|
|
4528
|
+
}), null);
|
|
4529
|
+
insert(_el$39, createComponent(Show, {
|
|
4530
|
+
get when() {
|
|
4531
|
+
return props.inputValue;
|
|
4532
|
+
},
|
|
4533
|
+
get children() {
|
|
4534
|
+
var _el$41 = _tmpl$15();
|
|
4535
|
+
_el$41.$$click = handleSubmit;
|
|
4536
|
+
insert(_el$41, createComponent(IconReturn, {
|
|
4537
|
+
size: 10,
|
|
4538
|
+
"class": "opacity-[0.99] text-black"
|
|
4539
|
+
}));
|
|
4540
|
+
return _el$41;
|
|
4541
|
+
}
|
|
4542
|
+
}), null);
|
|
4543
|
+
createRenderEffect(() => setAttribute(_el$38, "placeholder", speechRecognition.isListening() ? "listening..." : props.hasAgent && props.isAgentConnected ? "type to edit" : "type prompt"));
|
|
4544
|
+
createRenderEffect(() => _el$38.value = props.inputValue ?? "");
|
|
4545
|
+
return _el$37;
|
|
4372
4546
|
}
|
|
4373
4547
|
}), null);
|
|
4374
|
-
|
|
4548
|
+
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")));
|
|
4549
|
+
return _el$34;
|
|
4550
|
+
}
|
|
4551
|
+
}), null);
|
|
4552
|
+
insert(_el$18, createComponent(Show, {
|
|
4553
|
+
get when() {
|
|
4554
|
+
return props.isPendingDismiss;
|
|
4555
|
+
},
|
|
4556
|
+
get children() {
|
|
4557
|
+
return createComponent(DismissConfirmation, {
|
|
4558
|
+
get onConfirm() {
|
|
4559
|
+
return props.onConfirmDismiss;
|
|
4560
|
+
},
|
|
4561
|
+
get onCancel() {
|
|
4562
|
+
return props.onCancelDismiss;
|
|
4563
|
+
}
|
|
4564
|
+
});
|
|
4375
4565
|
}
|
|
4376
4566
|
}), null);
|
|
4377
4567
|
createRenderEffect((_p$) => {
|
|
4378
|
-
var _v$
|
|
4379
|
-
_v$
|
|
4380
|
-
_v$
|
|
4381
|
-
_v$
|
|
4382
|
-
_v$
|
|
4383
|
-
_v$
|
|
4568
|
+
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;
|
|
4569
|
+
_v$8 !== _p$.e && setStyleProperty(_el$14, "top", _p$.e = _v$8);
|
|
4570
|
+
_v$9 !== _p$.t && setStyleProperty(_el$14, "left", _p$.t = _v$9);
|
|
4571
|
+
_v$0 !== _p$.a && setStyleProperty(_el$14, "pointer-events", _p$.a = _v$0);
|
|
4572
|
+
_v$1 !== _p$.o && setStyleProperty(_el$14, "opacity", _p$.o = _v$1);
|
|
4573
|
+
_v$10 !== _p$.i && setStyleProperty(_el$18, "display", _p$.i = _v$10);
|
|
4384
4574
|
return _p$;
|
|
4385
4575
|
}, {
|
|
4386
4576
|
e: void 0,
|
|
@@ -4389,14 +4579,14 @@ var SelectionLabel = (props) => {
|
|
|
4389
4579
|
o: void 0,
|
|
4390
4580
|
i: void 0
|
|
4391
4581
|
});
|
|
4392
|
-
return _el$
|
|
4582
|
+
return _el$14;
|
|
4393
4583
|
}
|
|
4394
4584
|
});
|
|
4395
4585
|
};
|
|
4396
|
-
delegateEvents(["click", "pointerdown", "mousedown", "input", "keydown"]);
|
|
4586
|
+
delegateEvents(["click", "pointerdown", "mousedown", "pointerup", "input", "keydown"]);
|
|
4397
4587
|
|
|
4398
4588
|
// src/components/selection-cursor.tsx
|
|
4399
|
-
var _tmpl$
|
|
4589
|
+
var _tmpl$19 = /* @__PURE__ */ template(`<div class="fixed z-2147483647"><button data-react-grab-selection-cursor>`);
|
|
4400
4590
|
var SelectionCursor = (props) => {
|
|
4401
4591
|
const [isHovered, setIsHovered] = createSignal(false);
|
|
4402
4592
|
const [debouncedVisible, setDebouncedVisible] = createSignal(false);
|
|
@@ -4433,7 +4623,7 @@ var SelectionCursor = (props) => {
|
|
|
4433
4623
|
});
|
|
4434
4624
|
}
|
|
4435
4625
|
}), (() => {
|
|
4436
|
-
var _el$ = _tmpl$
|
|
4626
|
+
var _el$ = _tmpl$19(), _el$2 = _el$.firstChild;
|
|
4437
4627
|
_el$.addEventListener("mouseleave", () => setIsHovered(false));
|
|
4438
4628
|
_el$.addEventListener("mouseenter", () => setIsHovered(true));
|
|
4439
4629
|
_el$2.$$click = handleClick;
|
|
@@ -4478,6 +4668,7 @@ delegateEvents(["click"]);
|
|
|
4478
4668
|
|
|
4479
4669
|
// src/components/renderer.tsx
|
|
4480
4670
|
var ReactGrabRenderer = (props) => {
|
|
4671
|
+
const agentSessionsList = createMemo(() => props.agentSessions ? Array.from(props.agentSessions.values()) : []);
|
|
4481
4672
|
return [createComponent(Show, {
|
|
4482
4673
|
get when() {
|
|
4483
4674
|
return memo(() => !!props.selectionVisible)() && props.selectionBounds;
|
|
@@ -4539,51 +4730,52 @@ var ReactGrabRenderer = (props) => {
|
|
|
4539
4730
|
return box.createdAt;
|
|
4540
4731
|
}
|
|
4541
4732
|
})
|
|
4542
|
-
}), createComponent(
|
|
4733
|
+
}), createComponent(Index, {
|
|
4543
4734
|
get each() {
|
|
4544
|
-
return
|
|
4735
|
+
return agentSessionsList();
|
|
4545
4736
|
},
|
|
4546
4737
|
children: (session) => [createComponent(Show, {
|
|
4547
4738
|
get when() {
|
|
4548
|
-
return session.selectionBounds;
|
|
4739
|
+
return session().selectionBounds;
|
|
4549
4740
|
},
|
|
4550
4741
|
get children() {
|
|
4551
4742
|
return createComponent(SelectionBox, {
|
|
4552
4743
|
variant: "processing",
|
|
4553
4744
|
get bounds() {
|
|
4554
|
-
return session.selectionBounds;
|
|
4745
|
+
return session().selectionBounds;
|
|
4555
4746
|
},
|
|
4556
4747
|
visible: true,
|
|
4557
4748
|
get isCompleted() {
|
|
4558
|
-
return !session.isStreaming;
|
|
4749
|
+
return !session().isStreaming;
|
|
4559
4750
|
}
|
|
4560
4751
|
});
|
|
4561
4752
|
}
|
|
4562
4753
|
}), createComponent(SelectionLabel, {
|
|
4563
4754
|
get tagName() {
|
|
4564
|
-
return session.tagName;
|
|
4755
|
+
return session().tagName;
|
|
4565
4756
|
},
|
|
4566
4757
|
get componentName() {
|
|
4567
|
-
return session.componentName;
|
|
4758
|
+
return session().componentName;
|
|
4568
4759
|
},
|
|
4569
4760
|
get selectionBounds() {
|
|
4570
|
-
return session.selectionBounds;
|
|
4761
|
+
return session().selectionBounds;
|
|
4571
4762
|
},
|
|
4572
4763
|
get mouseX() {
|
|
4573
|
-
return session.position.x;
|
|
4764
|
+
return session().position.x;
|
|
4574
4765
|
},
|
|
4575
4766
|
visible: true,
|
|
4576
4767
|
hasAgent: true,
|
|
4768
|
+
isAgentConnected: true,
|
|
4577
4769
|
get status() {
|
|
4578
|
-
return session.isStreaming ? "copying" : "copied";
|
|
4770
|
+
return session().isStreaming ? "copying" : "copied";
|
|
4579
4771
|
},
|
|
4580
4772
|
get statusText() {
|
|
4581
|
-
return session.lastStatus || "
|
|
4773
|
+
return session().lastStatus || "Thinking\u2026";
|
|
4582
4774
|
},
|
|
4583
4775
|
get inputValue() {
|
|
4584
|
-
return session.context.prompt;
|
|
4776
|
+
return session().context.prompt;
|
|
4585
4777
|
},
|
|
4586
|
-
onAbort: () => props.onAbortSession?.(session.id)
|
|
4778
|
+
onAbort: () => props.onAbortSession?.(session().id)
|
|
4587
4779
|
})]
|
|
4588
4780
|
}), createComponent(Show, {
|
|
4589
4781
|
get when() {
|
|
@@ -4615,6 +4807,9 @@ var ReactGrabRenderer = (props) => {
|
|
|
4615
4807
|
get hasAgent() {
|
|
4616
4808
|
return props.hasAgent;
|
|
4617
4809
|
},
|
|
4810
|
+
get isAgentConnected() {
|
|
4811
|
+
return props.isAgentConnected;
|
|
4812
|
+
},
|
|
4618
4813
|
get status() {
|
|
4619
4814
|
return props.selectionLabelStatus;
|
|
4620
4815
|
},
|
|
@@ -4636,6 +4831,15 @@ var ReactGrabRenderer = (props) => {
|
|
|
4636
4831
|
get onToggleExpand() {
|
|
4637
4832
|
return props.onToggleExpand;
|
|
4638
4833
|
},
|
|
4834
|
+
get isPendingDismiss() {
|
|
4835
|
+
return props.isPendingDismiss;
|
|
4836
|
+
},
|
|
4837
|
+
get onConfirmDismiss() {
|
|
4838
|
+
return props.onConfirmDismiss;
|
|
4839
|
+
},
|
|
4840
|
+
get onCancelDismiss() {
|
|
4841
|
+
return props.onCancelDismiss;
|
|
4842
|
+
},
|
|
4639
4843
|
onOpen: () => {
|
|
4640
4844
|
if (props.selectionFilePath) {
|
|
4641
4845
|
const openFileUrl = buildOpenFileUrl(props.selectionFilePath, props.selectionLineNumber);
|
|
@@ -5998,7 +6202,7 @@ var isTargetKeyCombination = (event, options) => {
|
|
|
5998
6202
|
].filter(Boolean).length;
|
|
5999
6203
|
return allRequiredModifiersPressed && pressedModifierCount >= requiredModifierCount;
|
|
6000
6204
|
}
|
|
6001
|
-
const keyMatches = event.key
|
|
6205
|
+
const keyMatches = event.key?.toLowerCase() === key.toLowerCase() || keyMatchesCode(key, event.code);
|
|
6002
6206
|
const hasModifier = metaKey || ctrlKey || shiftKey || altKey;
|
|
6003
6207
|
const modifiersMatch = hasModifier ? (metaKey ? event.metaKey : true) && (ctrlKey ? event.ctrlKey : true) && (shiftKey ? event.shiftKey : true) && (altKey ? event.altKey : true) : event.metaKey || event.ctrlKey;
|
|
6004
6208
|
return keyMatches && modifiersMatch;
|
|
@@ -6027,9 +6231,6 @@ var DEFAULT_THEME = {
|
|
|
6027
6231
|
elementLabel: {
|
|
6028
6232
|
enabled: true
|
|
6029
6233
|
},
|
|
6030
|
-
successLabels: {
|
|
6031
|
-
enabled: true
|
|
6032
|
-
},
|
|
6033
6234
|
crosshair: {
|
|
6034
6235
|
enabled: true
|
|
6035
6236
|
}
|
|
@@ -6049,9 +6250,6 @@ var mergeThemeWithBase = (baseTheme, partialTheme) => ({
|
|
|
6049
6250
|
elementLabel: {
|
|
6050
6251
|
enabled: partialTheme.elementLabel?.enabled ?? baseTheme.elementLabel.enabled
|
|
6051
6252
|
},
|
|
6052
|
-
successLabels: {
|
|
6053
|
-
enabled: partialTheme.successLabels?.enabled ?? baseTheme.successLabels.enabled
|
|
6054
|
-
},
|
|
6055
6253
|
crosshair: {
|
|
6056
6254
|
enabled: partialTheme.crosshair?.enabled ?? baseTheme.crosshair.enabled
|
|
6057
6255
|
}
|
|
@@ -6190,7 +6388,8 @@ var createAgentManager = (initialAgentOptions) => {
|
|
|
6190
6388
|
storage
|
|
6191
6389
|
);
|
|
6192
6390
|
setSessions((prev) => new Map(prev).set(session.id, completedSession));
|
|
6193
|
-
|
|
6391
|
+
const element = sessionElements.get(session.id);
|
|
6392
|
+
agentOptions?.onComplete?.(completedSession, element);
|
|
6194
6393
|
}
|
|
6195
6394
|
} catch (error) {
|
|
6196
6395
|
const currentSessions = sessions();
|
|
@@ -6323,7 +6522,7 @@ var createAgentManager = (initialAgentOptions) => {
|
|
|
6323
6522
|
return;
|
|
6324
6523
|
}
|
|
6325
6524
|
const elements = [element];
|
|
6326
|
-
const content = await generateSnippet(elements);
|
|
6525
|
+
const content = await generateSnippet(elements, { maxLines: Infinity });
|
|
6327
6526
|
const context = {
|
|
6328
6527
|
content,
|
|
6329
6528
|
prompt,
|
|
@@ -6338,11 +6537,11 @@ var createAgentManager = (initialAgentOptions) => {
|
|
|
6338
6537
|
tagName,
|
|
6339
6538
|
componentName
|
|
6340
6539
|
);
|
|
6341
|
-
session.lastStatus = "
|
|
6540
|
+
session.lastStatus = "Thinking\u2026";
|
|
6342
6541
|
sessionElements.set(session.id, element);
|
|
6343
6542
|
setSessions((prev) => new Map(prev).set(session.id, session));
|
|
6344
6543
|
saveSessionById(session, storage);
|
|
6345
|
-
agentOptions.onStart?.(session);
|
|
6544
|
+
agentOptions.onStart?.(session, element);
|
|
6346
6545
|
const abortController = new AbortController();
|
|
6347
6546
|
abortControllers.set(session.id, abortController);
|
|
6348
6547
|
const streamIterator = agentOptions.provider.send(
|
|
@@ -6419,7 +6618,7 @@ var createAgentManager = (initialAgentOptions) => {
|
|
|
6419
6618
|
};
|
|
6420
6619
|
|
|
6421
6620
|
// src/core.tsx
|
|
6422
|
-
var _tmpl$
|
|
6621
|
+
var _tmpl$20 = /* @__PURE__ */ template(`<span class="tabular-nums align-middle">`);
|
|
6423
6622
|
var _tmpl$23 = /* @__PURE__ */ template(`<span class="font-mono tabular-nums align-middle"><<!>>`);
|
|
6424
6623
|
var _tmpl$33 = /* @__PURE__ */ template(`<span class="tabular-nums ml-1 align-middle"> in `);
|
|
6425
6624
|
var onIdle = (callback) => {
|
|
@@ -6513,7 +6712,7 @@ var init = (rawOptions) => {
|
|
|
6513
6712
|
hasInited = true;
|
|
6514
6713
|
const logIntro = () => {
|
|
6515
6714
|
try {
|
|
6516
|
-
const version = "0.0.
|
|
6715
|
+
const version = "0.0.72";
|
|
6517
6716
|
const logoDataUri = `data:image/svg+xml;base64,${btoa(LOGO_SVG)}`;
|
|
6518
6717
|
console.log(`%cReact Grab${version ? ` v${version}` : ""}%c
|
|
6519
6718
|
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;`, "");
|
|
@@ -6547,12 +6746,13 @@ https://react-grab.com`, `background: #330039; color: #ffffff; border: 1px solid
|
|
|
6547
6746
|
const [selectionLabelStatus, setSelectionLabelStatus] = createSignal("idle");
|
|
6548
6747
|
const [labelInstances, setLabelInstances] = createSignal([]);
|
|
6549
6748
|
const [lastGrabbedElement, setLastGrabbedElement] = createSignal(null);
|
|
6749
|
+
const [lastCopiedElement, setLastCopiedElement] = createSignal(null);
|
|
6550
6750
|
const [progressStartTime, setProgressStartTime] = createSignal(null);
|
|
6551
6751
|
const [grabbedBoxes, setGrabbedBoxes] = createSignal([]);
|
|
6552
|
-
const [successLabels, setSuccessLabels] = createSignal([]);
|
|
6553
6752
|
const [isActivated, setIsActivated] = createSignal(false);
|
|
6554
6753
|
const [isToggleMode, setIsToggleMode] = createSignal(false);
|
|
6555
6754
|
const [didJustDrag, setDidJustDrag] = createSignal(false);
|
|
6755
|
+
const [didJustCopy, setDidJustCopy] = createSignal(false);
|
|
6556
6756
|
const [copyStartX, setCopyStartX] = createSignal(OFFSCREEN_POSITION);
|
|
6557
6757
|
const [copyStartY, setCopyStartY] = createSignal(OFFSCREEN_POSITION);
|
|
6558
6758
|
const [copyOffsetFromCenterX, setCopyOffsetFromCenterX] = createSignal(0);
|
|
@@ -6566,6 +6766,9 @@ https://react-grab.com`, `background: #330039; color: #ffffff; border: 1px solid
|
|
|
6566
6766
|
const [isInputExpanded, setIsInputExpanded] = createSignal(false);
|
|
6567
6767
|
const [frozenElement, setFrozenElement] = createSignal(null);
|
|
6568
6768
|
const [hasAgentProvider, setHasAgentProvider] = createSignal(Boolean(options.agent?.provider));
|
|
6769
|
+
const [isAgentConnected, setIsAgentConnected] = createSignal(false);
|
|
6770
|
+
const [isPendingDismiss, setIsPendingDismiss] = createSignal(false);
|
|
6771
|
+
const elementInputCache = /* @__PURE__ */ new WeakMap();
|
|
6569
6772
|
const [nativeSelectionCursorX, setNativeSelectionCursorX] = createSignal(OFFSCREEN_POSITION);
|
|
6570
6773
|
const [nativeSelectionCursorY, setNativeSelectionCursorY] = createSignal(OFFSCREEN_POSITION);
|
|
6571
6774
|
const [hasNativeSelection, setHasNativeSelection] = createSignal(false);
|
|
@@ -6585,6 +6788,7 @@ https://react-grab.com`, `background: #330039; color: #ffffff; border: 1px solid
|
|
|
6585
6788
|
return await getNearestComponentName(element) || void 0;
|
|
6586
6789
|
});
|
|
6587
6790
|
const clearNativeSelectionState = () => {
|
|
6791
|
+
setHasNativeSelection(false);
|
|
6588
6792
|
setNativeSelectionCursorX(OFFSCREEN_POSITION);
|
|
6589
6793
|
setNativeSelectionCursorY(OFFSCREEN_POSITION);
|
|
6590
6794
|
setNativeSelectionElements([]);
|
|
@@ -6652,24 +6856,6 @@ https://react-grab.com`, `background: #330039; color: #ffffff; border: 1px solid
|
|
|
6652
6856
|
setGrabbedBoxes((previousBoxes) => previousBoxes.filter((box) => box.id !== boxId));
|
|
6653
6857
|
}, SUCCESS_LABEL_DURATION_MS);
|
|
6654
6858
|
};
|
|
6655
|
-
const showTemporarySuccessLabel = (text, type) => {
|
|
6656
|
-
const labelId = `success-${Date.now()}-${Math.random()}`;
|
|
6657
|
-
setSuccessLabels((previousLabels) => [...previousLabels, {
|
|
6658
|
-
id: labelId,
|
|
6659
|
-
text
|
|
6660
|
-
}]);
|
|
6661
|
-
options.onSuccessLabel?.(text, type, {
|
|
6662
|
-
x: mouseX(),
|
|
6663
|
-
y: mouseY()
|
|
6664
|
-
});
|
|
6665
|
-
setTimeout(() => {
|
|
6666
|
-
setSuccessLabels((previousLabels) => previousLabels.filter((label) => label.id !== labelId));
|
|
6667
|
-
}, SUCCESS_LABEL_DURATION_MS);
|
|
6668
|
-
};
|
|
6669
|
-
const extractElementTagNameForSuccess = (element) => {
|
|
6670
|
-
const tagName = extractElementTagName(element);
|
|
6671
|
-
return tagName ? `<${tagName}>` : "1 element";
|
|
6672
|
-
};
|
|
6673
6859
|
const notifyElementsSelected = (elements) => {
|
|
6674
6860
|
const elementsPayload = elements.map((element) => ({
|
|
6675
6861
|
tagName: extractElementTagName(element)
|
|
@@ -6703,7 +6889,7 @@ https://react-grab.com`, `background: #330039; color: #ffffff; border: 1px solid
|
|
|
6703
6889
|
const removeLabelInstance = (instanceId) => {
|
|
6704
6890
|
setLabelInstances((prev) => prev.filter((instance) => instance.id !== instanceId));
|
|
6705
6891
|
};
|
|
6706
|
-
const executeCopyOperation = async (positionX, positionY, operation, bounds, tagName, componentName, element) => {
|
|
6892
|
+
const executeCopyOperation = async (positionX, positionY, operation, bounds, tagName, componentName, element, shouldDeactivateAfter) => {
|
|
6707
6893
|
setCopyStartX(positionX);
|
|
6708
6894
|
setCopyStartY(positionY);
|
|
6709
6895
|
if (bounds) {
|
|
@@ -6717,6 +6903,10 @@ https://react-grab.com`, `background: #330039; color: #ffffff; border: 1px solid
|
|
|
6717
6903
|
const instanceId = bounds && tagName ? createLabelInstance(bounds, tagName, componentName, "copying", element, positionX) : null;
|
|
6718
6904
|
await operation().finally(() => {
|
|
6719
6905
|
setIsCopying(false);
|
|
6906
|
+
setDidJustCopy(true);
|
|
6907
|
+
if (element) {
|
|
6908
|
+
setLastCopiedElement(element);
|
|
6909
|
+
}
|
|
6720
6910
|
stopProgressAnimation();
|
|
6721
6911
|
if (instanceId) {
|
|
6722
6912
|
updateLabelInstance(instanceId, "copied");
|
|
@@ -6727,7 +6917,7 @@ https://react-grab.com`, `background: #330039; color: #ffffff; border: 1px solid
|
|
|
6727
6917
|
}, 350);
|
|
6728
6918
|
}, COPIED_LABEL_DURATION_MS);
|
|
6729
6919
|
}
|
|
6730
|
-
if (isToggleMode()) {
|
|
6920
|
+
if (isToggleMode() || shouldDeactivateAfter) {
|
|
6731
6921
|
deactivateRenderer();
|
|
6732
6922
|
}
|
|
6733
6923
|
});
|
|
@@ -6790,16 +6980,12 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
6790
6980
|
return didCopy;
|
|
6791
6981
|
};
|
|
6792
6982
|
const copySingleElementToClipboard = async (targetElement2, extraPrompt) => {
|
|
6793
|
-
const successLabelType = extraPrompt ? "input-submit" : "copy";
|
|
6794
6983
|
options.onElementSelect?.(targetElement2);
|
|
6795
6984
|
if (theme().grabbedBoxes.enabled) {
|
|
6796
6985
|
showTemporaryGrabbedBox(createElementBounds(targetElement2), targetElement2);
|
|
6797
6986
|
}
|
|
6798
6987
|
await new Promise((resolve) => requestAnimationFrame(resolve));
|
|
6799
|
-
|
|
6800
|
-
if (didCopy && theme().successLabels.enabled) {
|
|
6801
|
-
showTemporarySuccessLabel(extractElementTagNameForSuccess(targetElement2), successLabelType);
|
|
6802
|
-
}
|
|
6988
|
+
await tryCopyWithFallback([targetElement2], extraPrompt);
|
|
6803
6989
|
notifyElementsSelected([targetElement2]);
|
|
6804
6990
|
};
|
|
6805
6991
|
const copyMultipleElementsToClipboard = async (targetElements) => {
|
|
@@ -6813,10 +6999,7 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
6813
6999
|
}
|
|
6814
7000
|
}
|
|
6815
7001
|
await new Promise((resolve) => requestAnimationFrame(resolve));
|
|
6816
|
-
|
|
6817
|
-
if (didCopy && theme().successLabels.enabled) {
|
|
6818
|
-
showTemporarySuccessLabel(`${targetElements.length} elements`, "copy");
|
|
6819
|
-
}
|
|
7002
|
+
await tryCopyWithFallback(targetElements);
|
|
6820
7003
|
notifyElementsSelected(targetElements);
|
|
6821
7004
|
};
|
|
6822
7005
|
const targetElement = createMemo(() => {
|
|
@@ -6825,6 +7008,12 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
6825
7008
|
if (element && !document.contains(element)) return null;
|
|
6826
7009
|
return element;
|
|
6827
7010
|
});
|
|
7011
|
+
const effectiveElement = createMemo(() => {
|
|
7012
|
+
if (isToggleFrozen()) {
|
|
7013
|
+
return frozenElement();
|
|
7014
|
+
}
|
|
7015
|
+
return targetElement();
|
|
7016
|
+
});
|
|
6828
7017
|
createEffect(() => {
|
|
6829
7018
|
const element = detectedElement();
|
|
6830
7019
|
if (!element) return;
|
|
@@ -6843,7 +7032,7 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
6843
7032
|
});
|
|
6844
7033
|
const selectionBounds = createMemo(() => {
|
|
6845
7034
|
viewportVersion();
|
|
6846
|
-
const element =
|
|
7035
|
+
const element = effectiveElement();
|
|
6847
7036
|
if (!element) return void 0;
|
|
6848
7037
|
return createElementBounds(element);
|
|
6849
7038
|
});
|
|
@@ -6895,8 +7084,8 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
6895
7084
|
const copying = isCopying();
|
|
6896
7085
|
if (!element) {
|
|
6897
7086
|
return (() => {
|
|
6898
|
-
var _el$ = _tmpl$
|
|
6899
|
-
insert(_el$, copying ? "
|
|
7087
|
+
var _el$ = _tmpl$20();
|
|
7088
|
+
insert(_el$, copying ? "Processing\u2026" : "1 element");
|
|
6900
7089
|
return _el$;
|
|
6901
7090
|
})();
|
|
6902
7091
|
}
|
|
@@ -6921,8 +7110,8 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
6921
7110
|
})();
|
|
6922
7111
|
}
|
|
6923
7112
|
return (() => {
|
|
6924
|
-
var _el$10 = _tmpl$
|
|
6925
|
-
insert(_el$10, copying ? "
|
|
7113
|
+
var _el$10 = _tmpl$20();
|
|
7114
|
+
insert(_el$10, copying ? "Processing\u2026" : "1 element");
|
|
6926
7115
|
return _el$10;
|
|
6927
7116
|
})();
|
|
6928
7117
|
});
|
|
@@ -6977,15 +7166,6 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
6977
7166
|
clearSource();
|
|
6978
7167
|
}).catch(clearSource);
|
|
6979
7168
|
}));
|
|
6980
|
-
createEffect(on(() => viewportVersion(), () => {
|
|
6981
|
-
const currentBoxes = grabbedBoxes();
|
|
6982
|
-
if (currentBoxes.length === 0) return;
|
|
6983
|
-
const updatedBoxes = currentBoxes.map((box) => ({
|
|
6984
|
-
...box,
|
|
6985
|
-
bounds: createElementBounds(box.element)
|
|
6986
|
-
}));
|
|
6987
|
-
setGrabbedBoxes(updatedBoxes);
|
|
6988
|
-
}));
|
|
6989
7169
|
createEffect(on(() => viewportVersion(), () => agentManager.updateSessionBoundsOnViewportChange()));
|
|
6990
7170
|
createEffect(on(() => [isActivated(), isDragging(), isCopying(), isInputMode(), targetElement(), dragBounds()], ([active, dragging, copying, inputMode, target, drag]) => {
|
|
6991
7171
|
options.onStateChange?.({
|
|
@@ -7123,8 +7303,10 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7123
7303
|
setInputText("");
|
|
7124
7304
|
setIsToggleFrozen(false);
|
|
7125
7305
|
setIsInputExpanded(false);
|
|
7306
|
+
setIsPendingDismiss(false);
|
|
7126
7307
|
setFrozenElement(null);
|
|
7127
7308
|
setSelectionLabelStatus("idle");
|
|
7309
|
+
setDidJustCopy(false);
|
|
7128
7310
|
if (isDragging()) {
|
|
7129
7311
|
setIsDragging(false);
|
|
7130
7312
|
document.body.style.userSelect = "";
|
|
@@ -7166,6 +7348,7 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7166
7348
|
setInputText(value);
|
|
7167
7349
|
};
|
|
7168
7350
|
const handleInputSubmit = () => {
|
|
7351
|
+
setLastCopiedElement(null);
|
|
7169
7352
|
const element = frozenElement() || targetElement();
|
|
7170
7353
|
const prompt = isInputMode() ? inputText().trim() : "";
|
|
7171
7354
|
if (!element) {
|
|
@@ -7179,6 +7362,7 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7179
7362
|
setMouseX(currentX);
|
|
7180
7363
|
setMouseY(currentY);
|
|
7181
7364
|
if (hasAgentProvider() && prompt) {
|
|
7365
|
+
elementInputCache.delete(element);
|
|
7182
7366
|
deactivateRenderer();
|
|
7183
7367
|
void agentManager.startSession({
|
|
7184
7368
|
element,
|
|
@@ -7193,6 +7377,11 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7193
7377
|
}
|
|
7194
7378
|
setIsInputMode(false);
|
|
7195
7379
|
setInputText("");
|
|
7380
|
+
if (prompt) {
|
|
7381
|
+
elementInputCache.set(element, prompt);
|
|
7382
|
+
} else {
|
|
7383
|
+
elementInputCache.delete(element);
|
|
7384
|
+
}
|
|
7196
7385
|
const tagName = extractElementTagName(element);
|
|
7197
7386
|
void getNearestComponentName(element).then((componentName) => {
|
|
7198
7387
|
void executeCopyOperation(currentX, currentY, () => copySingleElementToClipboard(element, prompt || void 0), bounds, tagName, componentName ?? void 0, element).then(() => {
|
|
@@ -7201,9 +7390,27 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7201
7390
|
});
|
|
7202
7391
|
};
|
|
7203
7392
|
const handleInputCancel = () => {
|
|
7393
|
+
setLastCopiedElement(null);
|
|
7204
7394
|
if (!isInputMode()) return;
|
|
7395
|
+
const currentInput = inputText().trim();
|
|
7396
|
+
if (currentInput && !isPendingDismiss()) {
|
|
7397
|
+
setIsPendingDismiss(true);
|
|
7398
|
+
return;
|
|
7399
|
+
}
|
|
7400
|
+
const element = frozenElement() || targetElement();
|
|
7401
|
+
if (element && currentInput) {
|
|
7402
|
+
elementInputCache.set(element, currentInput);
|
|
7403
|
+
}
|
|
7404
|
+
setIsPendingDismiss(false);
|
|
7405
|
+
deactivateRenderer();
|
|
7406
|
+
};
|
|
7407
|
+
const handleConfirmDismiss = () => {
|
|
7408
|
+
setIsPendingDismiss(false);
|
|
7205
7409
|
deactivateRenderer();
|
|
7206
7410
|
};
|
|
7411
|
+
const handleCancelDismiss = () => {
|
|
7412
|
+
setIsPendingDismiss(false);
|
|
7413
|
+
};
|
|
7207
7414
|
const handleToggleExpand = () => {
|
|
7208
7415
|
const element = frozenElement() || targetElement();
|
|
7209
7416
|
if (element) {
|
|
@@ -7212,6 +7419,10 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7212
7419
|
setCopyStartX(mouseX());
|
|
7213
7420
|
setCopyStartY(mouseY());
|
|
7214
7421
|
setCopyOffsetFromCenterX(mouseX() - selectionCenterX);
|
|
7422
|
+
const cachedInput = elementInputCache.get(element);
|
|
7423
|
+
if (cachedInput) {
|
|
7424
|
+
setInputText(cachedInput);
|
|
7425
|
+
}
|
|
7215
7426
|
}
|
|
7216
7427
|
setIsToggleMode(true);
|
|
7217
7428
|
setIsToggleFrozen(true);
|
|
@@ -7254,6 +7465,7 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7254
7465
|
};
|
|
7255
7466
|
const handlePointerMove = (clientX, clientY) => {
|
|
7256
7467
|
if (isInputMode() || isToggleFrozen()) return;
|
|
7468
|
+
setDidJustCopy(false);
|
|
7257
7469
|
setMouseX(clientX);
|
|
7258
7470
|
setMouseY(clientY);
|
|
7259
7471
|
const now = performance.now();
|
|
@@ -7310,19 +7522,22 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7310
7522
|
transform: stripTranslateFromTransform(firstElement)
|
|
7311
7523
|
};
|
|
7312
7524
|
const tagName = extractElementTagName(firstElement);
|
|
7525
|
+
const centerX = bounds.x + bounds.width / 2;
|
|
7526
|
+
const centerY = bounds.y + bounds.height / 2;
|
|
7313
7527
|
if (hasAgentProvider()) {
|
|
7314
|
-
const centerX = bounds.x + bounds.width / 2;
|
|
7315
|
-
const centerY = bounds.y + bounds.height / 2;
|
|
7316
7528
|
setMouseX(centerX);
|
|
7317
7529
|
setMouseY(centerY);
|
|
7318
7530
|
setFrozenElement(firstElement);
|
|
7319
7531
|
setIsToggleMode(true);
|
|
7320
7532
|
setIsToggleFrozen(true);
|
|
7321
7533
|
setIsInputExpanded(true);
|
|
7534
|
+
if (!isActivated()) {
|
|
7535
|
+
activateRenderer();
|
|
7536
|
+
}
|
|
7322
7537
|
setIsInputMode(true);
|
|
7323
7538
|
} else {
|
|
7324
7539
|
void getNearestComponentName(firstElement).then((componentName) => {
|
|
7325
|
-
void executeCopyOperation(
|
|
7540
|
+
void executeCopyOperation(centerX, centerY, () => copyMultipleElementsToClipboard(selectedElements), bounds, tagName, componentName ?? void 0, firstElement, true);
|
|
7326
7541
|
});
|
|
7327
7542
|
}
|
|
7328
7543
|
}
|
|
@@ -7339,8 +7554,65 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7339
7554
|
};
|
|
7340
7555
|
const abortController = new AbortController();
|
|
7341
7556
|
const eventListenerSignal = abortController.signal;
|
|
7557
|
+
const claimedEvents = /* @__PURE__ */ new WeakSet();
|
|
7558
|
+
const isEnterCode = (code) => code === "Enter" || code === "NumpadEnter";
|
|
7559
|
+
const originalKeyDescriptor = Object.getOwnPropertyDescriptor(KeyboardEvent.prototype, "key");
|
|
7560
|
+
let didPatchKeyboardEvent = false;
|
|
7561
|
+
if (originalKeyDescriptor?.get && !originalKeyDescriptor.get.__reactGrabPatched) {
|
|
7562
|
+
didPatchKeyboardEvent = true;
|
|
7563
|
+
const originalGetter = originalKeyDescriptor.get;
|
|
7564
|
+
const patchedGetter = function() {
|
|
7565
|
+
if (claimedEvents.has(this)) {
|
|
7566
|
+
return "";
|
|
7567
|
+
}
|
|
7568
|
+
return originalGetter.call(this);
|
|
7569
|
+
};
|
|
7570
|
+
patchedGetter.__reactGrabPatched = true;
|
|
7571
|
+
Object.defineProperty(KeyboardEvent.prototype, "key", {
|
|
7572
|
+
get: patchedGetter,
|
|
7573
|
+
configurable: true
|
|
7574
|
+
});
|
|
7575
|
+
}
|
|
7576
|
+
const blockEnterIfNeeded = (event) => {
|
|
7577
|
+
const originalKey = originalKeyDescriptor?.get ? originalKeyDescriptor.get.call(event) : event.key;
|
|
7578
|
+
const isEnterKey = originalKey === "Enter" || isEnterCode(event.code);
|
|
7579
|
+
const isOverlayActive = isActivated() || isHoldingKeys();
|
|
7580
|
+
const shouldBlockEnter = isEnterKey && isOverlayActive && !isInputMode() && !isToggleMode();
|
|
7581
|
+
if (shouldBlockEnter) {
|
|
7582
|
+
claimedEvents.add(event);
|
|
7583
|
+
event.preventDefault();
|
|
7584
|
+
event.stopPropagation();
|
|
7585
|
+
event.stopImmediatePropagation();
|
|
7586
|
+
return true;
|
|
7587
|
+
}
|
|
7588
|
+
return false;
|
|
7589
|
+
};
|
|
7590
|
+
document.addEventListener("keydown", blockEnterIfNeeded, {
|
|
7591
|
+
signal: eventListenerSignal,
|
|
7592
|
+
capture: true
|
|
7593
|
+
});
|
|
7594
|
+
document.addEventListener("keyup", blockEnterIfNeeded, {
|
|
7595
|
+
signal: eventListenerSignal,
|
|
7596
|
+
capture: true
|
|
7597
|
+
});
|
|
7598
|
+
document.addEventListener("keypress", blockEnterIfNeeded, {
|
|
7599
|
+
signal: eventListenerSignal,
|
|
7600
|
+
capture: true
|
|
7601
|
+
});
|
|
7342
7602
|
window.addEventListener("keydown", (event) => {
|
|
7343
|
-
|
|
7603
|
+
blockEnterIfNeeded(event);
|
|
7604
|
+
const isEnterToActivateInput = isEnterCode(event.code) && isHoldingKeys() && !isInputMode();
|
|
7605
|
+
if (isInputMode() && isTargetKeyCombination(event, options) && !event.repeat) {
|
|
7606
|
+
event.preventDefault();
|
|
7607
|
+
event.stopPropagation();
|
|
7608
|
+
setIsInputMode(false);
|
|
7609
|
+
setInputText("");
|
|
7610
|
+
setIsToggleFrozen(false);
|
|
7611
|
+
setIsInputExpanded(false);
|
|
7612
|
+
setIsPendingDismiss(false);
|
|
7613
|
+
return;
|
|
7614
|
+
}
|
|
7615
|
+
if (isInputMode() || isEventFromOverlay(event, "data-react-grab-ignore-events") && !isEnterToActivateInput) {
|
|
7344
7616
|
if (event.key === "Escape" && agentManager.isProcessing()) {
|
|
7345
7617
|
agentManager.abortAllSessions();
|
|
7346
7618
|
}
|
|
@@ -7356,9 +7628,37 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7356
7628
|
return;
|
|
7357
7629
|
}
|
|
7358
7630
|
}
|
|
7359
|
-
|
|
7631
|
+
const copiedElement = lastCopiedElement();
|
|
7632
|
+
if (isEnterCode(event.code) && !isHoldingKeys() && !isInputMode() && !isActivated() && copiedElement && document.contains(copiedElement)) {
|
|
7360
7633
|
event.preventDefault();
|
|
7361
7634
|
event.stopPropagation();
|
|
7635
|
+
event.stopImmediatePropagation();
|
|
7636
|
+
const bounds = createElementBounds(copiedElement);
|
|
7637
|
+
const selectionCenterX = bounds.x + bounds.width / 2;
|
|
7638
|
+
const centerY = bounds.y + bounds.height / 2;
|
|
7639
|
+
setMouseX(selectionCenterX);
|
|
7640
|
+
setMouseY(centerY);
|
|
7641
|
+
setCopyStartX(selectionCenterX);
|
|
7642
|
+
setCopyStartY(centerY);
|
|
7643
|
+
setCopyOffsetFromCenterX(0);
|
|
7644
|
+
setFrozenElement(copiedElement);
|
|
7645
|
+
setLastCopiedElement(null);
|
|
7646
|
+
setLabelInstances([]);
|
|
7647
|
+
const cachedInput = elementInputCache.get(copiedElement);
|
|
7648
|
+
if (cachedInput) {
|
|
7649
|
+
setInputText(cachedInput);
|
|
7650
|
+
}
|
|
7651
|
+
setIsToggleMode(true);
|
|
7652
|
+
setIsToggleFrozen(true);
|
|
7653
|
+
setIsInputExpanded(true);
|
|
7654
|
+
activateRenderer();
|
|
7655
|
+
setIsInputMode(true);
|
|
7656
|
+
return;
|
|
7657
|
+
}
|
|
7658
|
+
if (isEnterCode(event.code) && isHoldingKeys() && !isInputMode()) {
|
|
7659
|
+
event.preventDefault();
|
|
7660
|
+
event.stopPropagation();
|
|
7661
|
+
event.stopImmediatePropagation();
|
|
7362
7662
|
const element = frozenElement() || targetElement();
|
|
7363
7663
|
if (element) {
|
|
7364
7664
|
const bounds = createElementBounds(element);
|
|
@@ -7366,6 +7666,10 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7366
7666
|
setCopyStartX(mouseX());
|
|
7367
7667
|
setCopyStartY(mouseY());
|
|
7368
7668
|
setCopyOffsetFromCenterX(mouseX() - selectionCenterX);
|
|
7669
|
+
const cachedInput = elementInputCache.get(element);
|
|
7670
|
+
if (cachedInput) {
|
|
7671
|
+
setInputText(cachedInput);
|
|
7672
|
+
}
|
|
7369
7673
|
}
|
|
7370
7674
|
setIsToggleMode(true);
|
|
7371
7675
|
setIsToggleFrozen(true);
|
|
@@ -7403,16 +7707,20 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7403
7707
|
}
|
|
7404
7708
|
if (!isTargetKeyCombination(event, options)) {
|
|
7405
7709
|
if (isActivated() && !isToggleMode() && (event.metaKey || event.ctrlKey)) {
|
|
7406
|
-
if (!MODIFIER_KEYS.includes(event.key) && event.
|
|
7710
|
+
if (!MODIFIER_KEYS.includes(event.key) && !isEnterCode(event.code)) {
|
|
7407
7711
|
deactivateRenderer();
|
|
7408
7712
|
}
|
|
7409
7713
|
}
|
|
7410
|
-
if (event.
|
|
7714
|
+
if (!isEnterCode(event.code) || !isHoldingKeys()) {
|
|
7411
7715
|
return;
|
|
7412
7716
|
}
|
|
7413
7717
|
}
|
|
7414
7718
|
if ((isActivated() || isHoldingKeys()) && !isInputMode()) {
|
|
7415
7719
|
event.preventDefault();
|
|
7720
|
+
if (isEnterCode(event.code)) {
|
|
7721
|
+
event.stopPropagation();
|
|
7722
|
+
event.stopImmediatePropagation();
|
|
7723
|
+
}
|
|
7416
7724
|
}
|
|
7417
7725
|
if (isActivated()) {
|
|
7418
7726
|
if (isToggleMode()) return;
|
|
@@ -7440,6 +7748,7 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7440
7748
|
capture: true
|
|
7441
7749
|
});
|
|
7442
7750
|
window.addEventListener("keyup", (event) => {
|
|
7751
|
+
if (blockEnterIfNeeded(event)) return;
|
|
7443
7752
|
if (!isHoldingKeys() && !isActivated()) return;
|
|
7444
7753
|
if (isInputMode()) return;
|
|
7445
7754
|
const hasCustomShortcut = Boolean(options.activationShortcut || options.activationKey);
|
|
@@ -7486,6 +7795,10 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7486
7795
|
signal: eventListenerSignal,
|
|
7487
7796
|
capture: true
|
|
7488
7797
|
});
|
|
7798
|
+
window.addEventListener("keypress", blockEnterIfNeeded, {
|
|
7799
|
+
signal: eventListenerSignal,
|
|
7800
|
+
capture: true
|
|
7801
|
+
});
|
|
7489
7802
|
window.addEventListener("mousemove", (event) => {
|
|
7490
7803
|
setIsTouchMode(false);
|
|
7491
7804
|
if (isEventFromOverlay(event, "data-react-grab-ignore-events")) return;
|
|
@@ -7494,6 +7807,7 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7494
7807
|
signal: eventListenerSignal
|
|
7495
7808
|
});
|
|
7496
7809
|
window.addEventListener("mousedown", (event) => {
|
|
7810
|
+
if (event.button !== 0) return;
|
|
7497
7811
|
if (isEventFromOverlay(event, "data-react-grab-ignore-events")) return;
|
|
7498
7812
|
if (isInputMode()) {
|
|
7499
7813
|
handleInputCancel();
|
|
@@ -7509,14 +7823,16 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7509
7823
|
capture: true
|
|
7510
7824
|
});
|
|
7511
7825
|
window.addEventListener("pointerdown", (event) => {
|
|
7512
|
-
if (
|
|
7826
|
+
if (event.button !== 0) return;
|
|
7513
7827
|
if (isEventFromOverlay(event, "data-react-grab-ignore-events")) return;
|
|
7828
|
+
if (!isRendererActive() || isCopying() || isInputMode()) return;
|
|
7514
7829
|
event.stopPropagation();
|
|
7515
7830
|
}, {
|
|
7516
7831
|
signal: eventListenerSignal,
|
|
7517
7832
|
capture: true
|
|
7518
7833
|
});
|
|
7519
7834
|
window.addEventListener("mouseup", (event) => {
|
|
7835
|
+
if (event.button !== 0) return;
|
|
7520
7836
|
handlePointerUp(event.clientX, event.clientY);
|
|
7521
7837
|
}, {
|
|
7522
7838
|
signal: eventListenerSignal
|
|
@@ -7561,7 +7877,7 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7561
7877
|
if (hadDrag) {
|
|
7562
7878
|
setDidJustDrag(false);
|
|
7563
7879
|
}
|
|
7564
|
-
if (isToggleMode() && !isCopying()) {
|
|
7880
|
+
if (isToggleMode() && !isCopying() && !isInputMode()) {
|
|
7565
7881
|
if (!isHoldingKeys()) {
|
|
7566
7882
|
deactivateRenderer();
|
|
7567
7883
|
} else {
|
|
@@ -7594,6 +7910,10 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7594
7910
|
}, {
|
|
7595
7911
|
signal: eventListenerSignal
|
|
7596
7912
|
});
|
|
7913
|
+
const boundsRecalcIntervalId = setInterval(() => {
|
|
7914
|
+
setViewportVersion((version) => version + 1);
|
|
7915
|
+
}, BOUNDS_RECALC_INTERVAL_MS);
|
|
7916
|
+
onCleanup(() => clearInterval(boundsRecalcIntervalId));
|
|
7597
7917
|
document.addEventListener("copy", (event) => {
|
|
7598
7918
|
if (isInputMode() || isEventFromOverlay(event, "data-react-grab-ignore-events")) {
|
|
7599
7919
|
return;
|
|
@@ -7621,11 +7941,18 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7621
7941
|
selectionDebounceTimerId = null;
|
|
7622
7942
|
const currentSelection = window.getSelection();
|
|
7623
7943
|
if (!currentSelection || currentSelection.isCollapsed || currentSelection.rangeCount === 0) {
|
|
7944
|
+
clearNativeSelectionState();
|
|
7624
7945
|
return;
|
|
7625
7946
|
}
|
|
7626
7947
|
const range = currentSelection.getRangeAt(0);
|
|
7627
7948
|
const rangeRect = range.getBoundingClientRect();
|
|
7628
7949
|
if (rangeRect.width === 0 && rangeRect.height === 0) {
|
|
7950
|
+
clearNativeSelectionState();
|
|
7951
|
+
return;
|
|
7952
|
+
}
|
|
7953
|
+
const selectedText = currentSelection.toString().trim();
|
|
7954
|
+
if (!selectedText) {
|
|
7955
|
+
clearNativeSelectionState();
|
|
7629
7956
|
return;
|
|
7630
7957
|
}
|
|
7631
7958
|
const isBackward = (() => {
|
|
@@ -7637,6 +7964,7 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7637
7964
|
})();
|
|
7638
7965
|
const clientRects = range.getClientRects();
|
|
7639
7966
|
if (clientRects.length === 0) {
|
|
7967
|
+
clearNativeSelectionState();
|
|
7640
7968
|
return;
|
|
7641
7969
|
}
|
|
7642
7970
|
const cursorRect = isBackward ? clientRects[0] : clientRects[clientRects.length - 1];
|
|
@@ -7646,15 +7974,15 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7646
7974
|
clearNativeSelectionState();
|
|
7647
7975
|
return;
|
|
7648
7976
|
}
|
|
7649
|
-
setNativeSelectionCursorX(cursorX);
|
|
7650
|
-
setNativeSelectionCursorY(cursorY);
|
|
7651
7977
|
const container = range.commonAncestorContainer;
|
|
7652
7978
|
const element = container.nodeType === Node.ELEMENT_NODE ? container : container.parentElement;
|
|
7653
7979
|
if (element && isValidGrabbableElement(element)) {
|
|
7980
|
+
setNativeSelectionCursorX(cursorX);
|
|
7981
|
+
setNativeSelectionCursorY(cursorY);
|
|
7654
7982
|
setNativeSelectionElements([element]);
|
|
7655
7983
|
setHasNativeSelection(true);
|
|
7656
7984
|
} else {
|
|
7657
|
-
|
|
7985
|
+
clearNativeSelectionState();
|
|
7658
7986
|
}
|
|
7659
7987
|
}, 150);
|
|
7660
7988
|
}, {
|
|
@@ -7668,26 +7996,30 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7668
7996
|
stopProgressAnimation();
|
|
7669
7997
|
document.body.style.userSelect = "";
|
|
7670
7998
|
setCursorOverride(null);
|
|
7999
|
+
if (didPatchKeyboardEvent && originalKeyDescriptor) {
|
|
8000
|
+
Object.defineProperty(KeyboardEvent.prototype, "key", originalKeyDescriptor);
|
|
8001
|
+
}
|
|
7671
8002
|
});
|
|
7672
8003
|
const rendererRoot = mountRoot(styles_default);
|
|
7673
8004
|
const selectionVisible = createMemo(() => {
|
|
7674
8005
|
if (!theme().selectionBox.enabled) return false;
|
|
7675
|
-
|
|
8006
|
+
if (didJustCopy()) return false;
|
|
8007
|
+
return isRendererActive() && !isDragging() && Boolean(effectiveElement());
|
|
7676
8008
|
});
|
|
7677
8009
|
const selectionTagName = createMemo(() => {
|
|
7678
|
-
const element =
|
|
8010
|
+
const element = effectiveElement();
|
|
7679
8011
|
if (!element) return void 0;
|
|
7680
8012
|
return extractElementTagName(element) || void 0;
|
|
7681
8013
|
});
|
|
7682
|
-
const [selectionComponentName] = createResource(() =>
|
|
8014
|
+
const [selectionComponentName] = createResource(() => effectiveElement(), async (element) => {
|
|
7683
8015
|
if (!element) return void 0;
|
|
7684
8016
|
const name = await getNearestComponentName(element);
|
|
7685
8017
|
return name ?? void 0;
|
|
7686
8018
|
});
|
|
7687
8019
|
const selectionLabelVisible = createMemo(() => {
|
|
7688
8020
|
if (!theme().elementLabel.enabled) return false;
|
|
7689
|
-
if (
|
|
7690
|
-
return isRendererActive() && !isDragging() && Boolean(
|
|
8021
|
+
if (didJustCopy()) return false;
|
|
8022
|
+
return isRendererActive() && !isDragging() && Boolean(effectiveElement());
|
|
7691
8023
|
});
|
|
7692
8024
|
const computedLabelInstances = createMemo(() => {
|
|
7693
8025
|
viewportVersion();
|
|
@@ -7701,14 +8033,25 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7701
8033
|
};
|
|
7702
8034
|
});
|
|
7703
8035
|
});
|
|
8036
|
+
const computedGrabbedBoxes = createMemo(() => {
|
|
8037
|
+
viewportVersion();
|
|
8038
|
+
return grabbedBoxes().map((box) => {
|
|
8039
|
+
if (!box.element || !document.body.contains(box.element)) {
|
|
8040
|
+
return box;
|
|
8041
|
+
}
|
|
8042
|
+
return {
|
|
8043
|
+
...box,
|
|
8044
|
+
bounds: createElementBounds(box.element)
|
|
8045
|
+
};
|
|
8046
|
+
});
|
|
8047
|
+
});
|
|
7704
8048
|
const dragVisible = createMemo(() => theme().dragBox.enabled && isRendererActive() && isDraggingBeyondThreshold());
|
|
7705
8049
|
const labelVariant = createMemo(() => isCopying() ? "processing" : "hover");
|
|
7706
8050
|
const labelVisible = createMemo(() => {
|
|
7707
8051
|
if (!theme().elementLabel.enabled) return false;
|
|
7708
8052
|
if (isInputMode()) return false;
|
|
7709
8053
|
if (isCopying()) return true;
|
|
7710
|
-
|
|
7711
|
-
return isRendererActive() && !isDragging() && Boolean(targetElement());
|
|
8054
|
+
return isRendererActive() && !isDragging() && Boolean(effectiveElement());
|
|
7712
8055
|
});
|
|
7713
8056
|
const crosshairVisible = createMemo(() => theme().crosshair.enabled && isRendererActive() && !isDragging() && !isTouchMode() && !isToggleFrozen());
|
|
7714
8057
|
const shouldShowGrabbedBoxes = createMemo(() => theme().grabbedBoxes.enabled);
|
|
@@ -7755,7 +8098,7 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7755
8098
|
return dragBounds();
|
|
7756
8099
|
},
|
|
7757
8100
|
get grabbedBoxes() {
|
|
7758
|
-
return memo(() => !!shouldShowGrabbedBoxes())() ?
|
|
8101
|
+
return memo(() => !!shouldShowGrabbedBoxes())() ? computedGrabbedBoxes() : [];
|
|
7759
8102
|
},
|
|
7760
8103
|
labelZIndex: Z_INDEX_LABEL,
|
|
7761
8104
|
get mouseX() {
|
|
@@ -7776,6 +8119,9 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7776
8119
|
get hasAgent() {
|
|
7777
8120
|
return hasAgentProvider();
|
|
7778
8121
|
},
|
|
8122
|
+
get isAgentConnected() {
|
|
8123
|
+
return isAgentConnected();
|
|
8124
|
+
},
|
|
7779
8125
|
get agentSessions() {
|
|
7780
8126
|
return agentManager.sessions();
|
|
7781
8127
|
},
|
|
@@ -7784,6 +8130,11 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7784
8130
|
onInputSubmit: () => void handleInputSubmit(),
|
|
7785
8131
|
onInputCancel: handleInputCancel,
|
|
7786
8132
|
onToggleExpand: handleToggleExpand,
|
|
8133
|
+
get isPendingDismiss() {
|
|
8134
|
+
return isPendingDismiss();
|
|
8135
|
+
},
|
|
8136
|
+
onConfirmDismiss: handleConfirmDismiss,
|
|
8137
|
+
onCancelDismiss: handleCancelDismiss,
|
|
7787
8138
|
get nativeSelectionCursorVisible() {
|
|
7788
8139
|
return hasNativeSelection();
|
|
7789
8140
|
},
|
|
@@ -7893,6 +8244,11 @@ ${plainTextContentOnly}` : plainTextContentOnly;
|
|
|
7893
8244
|
};
|
|
7894
8245
|
agentManager.setOptions(mergedOptions);
|
|
7895
8246
|
setHasAgentProvider(Boolean(mergedOptions.provider));
|
|
8247
|
+
if (mergedOptions.provider?.checkConnection) {
|
|
8248
|
+
void mergedOptions.provider.checkConnection().then((connected) => {
|
|
8249
|
+
setIsAgentConnected(connected);
|
|
8250
|
+
});
|
|
8251
|
+
}
|
|
7896
8252
|
agentManager.tryResumeSessions();
|
|
7897
8253
|
}
|
|
7898
8254
|
};
|