react-grab 0.1.13 → 0.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -10
- package/dist/chunk-CRY4UGGA.js +112 -0
- package/dist/chunk-EFUDUWZJ.cjs +112 -0
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.d.cts +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/{index-CNwr6CHX.d.cts → index-BR6gp9du.d.cts} +55 -1
- package/dist/{index-CNwr6CHX.d.ts → index-BR6gp9du.d.ts} +55 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.global.js +37 -32
- package/dist/index.js +1 -1
- package/dist/react.cjs +1940 -482
- package/dist/react.d.cts +9 -2
- package/dist/react.d.ts +9 -2
- package/dist/react.js +1940 -482
- package/dist/styles.css +1 -1
- package/package.json +3 -3
- package/dist/chunk-2T22V7DM.cjs +0 -107
- package/dist/chunk-VR2ILUMN.js +0 -107
package/dist/react.js
CHANGED
|
@@ -1884,7 +1884,7 @@ var init_web = __esm({
|
|
|
1884
1884
|
var styles_default;
|
|
1885
1885
|
var init_styles = __esm({
|
|
1886
1886
|
"dist/styles.css"() {
|
|
1887
|
-
styles_default = '/*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */\n@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-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--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:"Geist",ui-sans-serif,system-ui,sans-serif;--font-mono:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;--color-black:#000;--color-white:#fff;--spacing:.25rem;--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--font-weight-medium:500;--radius-sm:.25rem;--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);--transition-fast:.1s;--transition-normal:.15s;--transition-slow:.2s}}@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}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.touch-hitbox{position:relative}.touch-hitbox:before{content:"";width:100%;min-width:32px;height:100%;min-height:32px;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.top-0{top:calc(var(--spacing)*0)}.top-0\\.5{top:calc(var(--spacing)*.5)}.top-full{top:100%}.bottom-full{bottom:100%}.left-0{left:calc(var(--spacing)*0)}.left-0\\.5{left:calc(var(--spacing)*.5)}.left-1\\/2{left:50%}.left-2\\.5{left:calc(var(--spacing)*2.5)}.z-10{z-index:10}.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)}.-mx-2{margin-inline:calc(var(--spacing)*-2)}.mx-0\\.5{margin-inline:calc(var(--spacing)*.5)}.-my-1\\.5{margin-block:calc(var(--spacing)*-1.5)}.mt-0\\.5{margin-top:calc(var(--spacing)*.5)}.mt-2\\.5{margin-top:calc(var(--spacing)*2.5)}.mr-1\\.5{margin-right:calc(var(--spacing)*1.5)}.mb-0\\.5{margin-bottom:calc(var(--spacing)*.5)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-2\\.5{margin-bottom:calc(var(--spacing)*2.5)}.-ml-\\[2px\\]{margin-left:-2px}.ml-1{margin-left:calc(var(--spacing)*1)}.ml-4{margin-left:calc(var(--spacing)*4)}.ml-auto{margin-left:auto}.line-clamp-5{-webkit-line-clamp:5;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.size-1\\.5{width:calc(var(--spacing)*1.5);height:calc(var(--spacing)*1.5)}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.size-\\[18px\\]{width:18px;height:18px}.h-0{height:calc(var(--spacing)*0)}.h-2{height:calc(var(--spacing)*2)}.h-3{height:calc(var(--spacing)*3)}.h-\\[17px\\]{height:17px}.h-fit{height:fit-content}.min-h-4{min-height:calc(var(--spacing)*4)}.w-0{width:calc(var(--spacing)*0)}.w-2{width:calc(var(--spacing)*2)}.w-5{width:calc(var(--spacing)*5)}.w-\\[calc\\(100\\%\\+16px\\)\\]{width:calc(100% + 16px)}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.max-w-\\[280px\\]{max-width:280px}.max-w-full{max-width:100%}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\\[100px\\]{min-width:100px}.min-w-\\[150px\\]{min-width:150px}.flex-1{flex:1}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.-translate-x-1\\/2{--tw-translate-x: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)}.-rotate-90{rotate:-90deg}.rotate-0{rotate:none}.rotate-90{rotate:90deg}.rotate-180{rotate:180deg}.interactive-scale{transition-property:transform;transition-duration:var(--transition-normal);transition-timing-function:cubic-bezier(.34,1.56,.64,1)}@media (hover:hover) and (pointer:fine){.interactive-scale:hover{transform:scale(1.05)}}.interactive-scale:active{transform:scale(.97)}.press-scale{transition-property:transform;transition-duration:var(--transition-fast);transition-timing-function:ease-out}.press-scale:active{transform:scale(.97)}.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-grab{cursor:grab}.cursor-grabbing{cursor:grabbing}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.grid-cols-\\[0fr\\]{grid-template-columns:0fr}.grid-cols-\\[1fr\\]{grid-template-columns:1fr}.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-1\\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-\\[5px\\]{gap:5px}.self-stretch{align-self:stretch}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-y-auto{overflow-y:auto}.rounded-\\[1px\\]{border-radius:1px}.rounded-\\[10px\\]{border-radius:10px}.rounded-full{border-radius:3.40282e38px}.rounded-sm{border-radius:var(--radius-sm)}.rounded-t-\\[10px\\]{border-top-left-radius:10px;border-top-right-radius:10px}.rounded-t-none{border-top-left-radius:0;border-top-right-radius:0}.rounded-l-\\[10px\\]{border-top-left-radius:10px;border-bottom-left-radius:10px}.rounded-l-none{border-top-left-radius:0;border-bottom-left-radius:0}.rounded-r-\\[10px\\]{border-top-right-radius:10px;border-bottom-right-radius:10px}.rounded-r-none{border-top-right-radius:0;border-bottom-right-radius:0}.rounded-b-\\[6px\\]{border-bottom-right-radius:6px;border-bottom-left-radius:6px}.rounded-b-\\[10px\\]{border-bottom-right-radius:10px;border-bottom-left-radius:10px}.rounded-b-none{border-bottom-right-radius:0;border-bottom-left-radius:0}.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-t-\\[\\#D9D9D9\\]{border-top-color:#d9d9d9}.bg-\\[\\#FEF2F2\\]{background-color:#fef2f2}.bg-black{background-color:var(--color-black)}.bg-black\\/5{background-color:#0000000d}@supports (color:color-mix(in lab, red, red)){.bg-black\\/5{background-color:color-mix(in oklab,var(--color-black)5%,transparent)}}.bg-black\\/25{background-color:#00000040}@supports (color:color-mix(in lab, red, red)){.bg-black\\/25{background-color:color-mix(in oklab,var(--color-black)25%,transparent)}}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.p-0{padding:calc(var(--spacing)*0)}.px-0\\.25{padding-inline:calc(var(--spacing)*.25)}.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\\.5{padding-block:calc(var(--spacing)*.5)}.py-0\\.25{padding-block:calc(var(--spacing)*.25)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-px{padding-block:1px}.pt-1\\.5{padding-top:calc(var(--spacing)*1.5)}.pb-1{padding-bottom:calc(var(--spacing)*1)}.text-left{text-align:left}.font-sans{font-family:var(--font-sans)}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[13px\\]{font-size:13px}.leading-3{--tw-leading:calc(var(--spacing)*3);line-height:calc(var(--spacing)*3)}.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)}.wrap-break-word{overflow-wrap:break-word}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.text-\\[\\#71717a\\]{color:#71717a}.text-\\[\\#B3B3B3\\]{color:#b3b3b3}.text-\\[\\#B91C1C\\]{color:#b91c1c}.text-black{color:var(--color-black)}.text-black\\/30{color:#0000004d}@supports (color:color-mix(in lab, red, red)){.text-black\\/30{color:color-mix(in oklab,var(--color-black)30%,transparent)}}.text-black\\/40{color:#0006}@supports (color:color-mix(in lab, red, red)){.text-black\\/40{color:color-mix(in oklab,var(--color-black)40%,transparent)}}.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-black\\/60{color:#0009}@supports (color:color-mix(in lab, red, red)){.text-black\\/60{color:color-mix(in oklab,var(--color-black)60%,transparent)}}.text-black\\/70{color:#000000b3}@supports (color:color-mix(in lab, red, red)){.text-black\\/70{color:color-mix(in oklab,var(--color-black)70%,transparent)}}.text-black\\/85{color:#000000d9}@supports (color:color-mix(in lab, red, red)){.text-black\\/85{color:color-mix(in oklab,var(--color-black)85%,transparent)}}.text-white{color:var(--color-white)}.italic{font-style:italic}.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-35{opacity:.35}.opacity-50{opacity:.5}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);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_1px_2px_\\#51515140\\)\\]{filter:drop-shadow(0 1px 2px #51515140)}.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-\\[transform\\,opacity\\]{transition-property:transform,opacity;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-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;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-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.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)}.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}.\\[corner-shape\\:superellipse\\(1\\.25\\)\\]{corner-shape:superellipse(1.25)}.\\[font-synthesis\\:none\\]{font-synthesis:none}@media (hover:hover){.hover\\:bg-\\[\\#F5F5F5\\]:hover{background-color:#f5f5f5}.hover\\:bg-\\[\\#FEE2E2\\]:hover{background-color:#fee2e2}.hover\\:bg-black\\/5:hover{background-color:#0000000d}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-black\\/5:hover{background-color:color-mix(in oklab,var(--color-black)5%,transparent)}}.hover\\:bg-black\\/10:hover{background-color:#0000001a}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-black\\/10:hover{background-color:color-mix(in oklab,var(--color-black)10%,transparent)}}.hover\\:text-black:hover{color:var(--color-black)}}.disabled\\:cursor-default:disabled{cursor:default}.disabled\\:opacity-40:disabled{opacity:.4}@media (hover:hover){.disabled\\:hover\\:bg-transparent:disabled:hover{background-color:#0000}}}@keyframes shake{0%,to{transform:translate(0)}15%{transform:translate(-3px)}30%{transform:translate(3px)}45%{transform:translate(-3px)}60%{transform:translate(3px)}75%{transform:translate(-2px)}90%{transform:translate(2px)}}@keyframes pop-in{0%{opacity:0;transform:scale(.9)}70%{opacity:1;transform:scale(1.02)}to{opacity:1;transform:scale(1)}}@keyframes pop-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.95)}}@keyframes slide-in-bottom{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@keyframes slide-in-top{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}@keyframes slide-in-left{0%{opacity:0;transform:translate(-8px)}to{opacity:1;transform:translate(0)}}@keyframes slide-in-right{0%{opacity:0;transform:translate(8px)}to{opacity:1;transform:translate(0)}}@keyframes success-pop{0%{opacity:0;transform:scale(.9)}60%{opacity:1;transform:scale(1.1)}80%{transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes tooltip-fade-in{0%{opacity:0;transform:scale(.97)}to{opacity:1;transform:scale(1)}}@keyframes icon-loader-spin{0%{opacity:1}50%{opacity:.5}to{opacity:.2}}.icon-loader-bar{animation:.5s linear infinite icon-loader-spin}@keyframes shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}.shimmer-text{color:#0000;background:linear-gradient(90deg,#71717a 0%,#a1a1aa 25%,#71717a 50%,#a1a1aa 75%,#71717a 100%) 0 0/200% 100%;-webkit-background-clip:text;background-clip:text;animation:2.5s linear infinite shimmer}.animate-shake{will-change:transform;animation:.3s ease-out shake}.animate-pop-in{animation:pop-in var(--transition-normal)ease-out;will-change:transform,opacity}.animate-pop-out{animation:pop-out var(--transition-normal)ease-out forwards;will-change:transform,opacity}.animate-slide-in-bottom{animation:slide-in-bottom var(--transition-slow)ease-out;will-change:transform,opacity}.animate-slide-in-top{animation:slide-in-top var(--transition-slow)ease-out;will-change:transform,opacity}.animate-slide-in-left{animation:slide-in-left var(--transition-slow)ease-out;will-change:transform,opacity}.animate-slide-in-right{animation:slide-in-right var(--transition-slow)ease-out;will-change:transform,opacity}.animate-success-pop{will-change:transform,opacity;animation:.25s ease-out success-pop}.animate-tooltip-fade-in{animation:tooltip-fade-in var(--transition-fast)ease-out;will-change:transform,opacity}@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-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-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@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}}';
|
|
1887
|
+
styles_default = '/*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */\n@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-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--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:"Geist",ui-sans-serif,system-ui,sans-serif;--font-mono:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;--color-yellow-500:oklch(79.5% .184 86.047);--color-black:#000;--color-white:#fff;--spacing:4px;--text-sm:14px;--text-sm--line-height:calc(1.25/.875);--font-weight-medium:500;--radius-sm:4px;--ease-out:cubic-bezier(0,0,.2,1);--animate-ping:ping 1s cubic-bezier(0,0,.2,1)infinite;--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);--transition-fast:.1s;--transition-normal:.15s;--transition-slow:.2s}}@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}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.touch-hitbox{position:relative}.touch-hitbox:before{content:"";width:100%;min-width:32px;height:100%;min-height:32px;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.top-0{top:calc(var(--spacing)*0)}.top-0\\.5{top:calc(var(--spacing)*.5)}.top-1\\/2{top:50%}.top-full{top:100%}.right-full{right:100%}.bottom-full{bottom:100%}.left-0{left:calc(var(--spacing)*0)}.left-0\\.5{left:calc(var(--spacing)*.5)}.left-1\\.5{left:calc(var(--spacing)*1.5)}.left-1\\/2{left:50%}.left-2\\.5{left:calc(var(--spacing)*2.5)}.left-full{left:100%}.z-10{z-index:10}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.m-0{margin:calc(var(--spacing)*0)}.-mx-2{margin-inline:calc(var(--spacing)*-2)}.mx-0\\.5{margin-inline:calc(var(--spacing)*.5)}.-my-1\\.5{margin-block:calc(var(--spacing)*-1.5)}.my-0\\.5{margin-block:calc(var(--spacing)*.5)}.mt-0\\.5{margin-top:calc(var(--spacing)*.5)}.mt-2\\.5{margin-top:calc(var(--spacing)*2.5)}.mr-0\\.5{margin-right:calc(var(--spacing)*.5)}.mr-1\\.5{margin-right:calc(var(--spacing)*1.5)}.mr-2\\.5{margin-right:calc(var(--spacing)*2.5)}.mb-0\\.5{margin-bottom:calc(var(--spacing)*.5)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-1\\.5{margin-bottom:calc(var(--spacing)*1.5)}.mb-2\\.5{margin-bottom:calc(var(--spacing)*2.5)}.-ml-\\[2px\\]{margin-left:-2px}.ml-0\\.5{margin-left:calc(var(--spacing)*.5)}.ml-1{margin-left:calc(var(--spacing)*1)}.ml-2\\.5{margin-left:calc(var(--spacing)*2.5)}.ml-4{margin-left:calc(var(--spacing)*4)}.ml-auto{margin-left:auto}.line-clamp-5{-webkit-line-clamp:5;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.size-1\\.5{width:calc(var(--spacing)*1.5);height:calc(var(--spacing)*1.5)}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.size-\\[18px\\]{width:18px;height:18px}.h-0{height:calc(var(--spacing)*0)}.h-1\\.5{height:calc(var(--spacing)*1.5)}.h-2{height:calc(var(--spacing)*2)}.h-2\\.5{height:calc(var(--spacing)*2.5)}.h-3{height:calc(var(--spacing)*3)}.h-4{height:calc(var(--spacing)*4)}.h-\\[17px\\]{height:17px}.h-fit{height:fit-content}.max-h-\\[240px\\]{max-height:240px}.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-1\\.5{width:calc(var(--spacing)*1.5)}.w-2{width:calc(var(--spacing)*2)}.w-3\\.5{width:calc(var(--spacing)*3.5)}.w-4{width:calc(var(--spacing)*4)}.w-5{width:calc(var(--spacing)*5)}.w-\\[calc\\(100\\%\\+16px\\)\\]{width:calc(100% + 16px)}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.max-w-\\[280px\\]{max-width:280px}.max-w-full{max-width:100%}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\\[100px\\]{min-width:100px}.min-w-\\[150px\\]{min-width:150px}.flex-1{flex:1}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.-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)}.-rotate-90{rotate:-90deg}.rotate-0{rotate:none}.rotate-90{rotate:90deg}.rotate-180{rotate:180deg}.interactive-scale{transition-property:transform;transition-duration:var(--transition-normal);transition-timing-function:cubic-bezier(.34,1.56,.64,1)}@media (hover:hover) and (pointer:fine){.interactive-scale:hover{transform:scale(1.05)}}.interactive-scale:active{transform:scale(.97)}.press-scale{transition-property:transform;transition-duration:var(--transition-fast);transition-timing-function:ease-out}.press-scale:active{transform:scale(.97)}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-ping{animation:var(--animate-ping)}.animate-pulse{animation:var(--animate-pulse)}.cursor-grab{cursor:grab}.cursor-grabbing{cursor:grabbing}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.grid-cols-\\[0fr\\]{grid-template-columns:0fr}.grid-cols-\\[1fr\\]{grid-template-columns:1fr}.grid-rows-\\[0fr\\]{grid-template-rows:0fr}.grid-rows-\\[1fr\\]{grid-template-rows:1fr}.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-1\\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-\\[5px\\]{gap:5px}.self-stretch{align-self:stretch}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-y-auto{overflow-y:auto}.rounded-\\[1px\\]{border-radius:1px}.rounded-\\[10px\\]{border-radius:10px}.rounded-full{border-radius:3.40282e38px}.rounded-sm{border-radius:var(--radius-sm)}.rounded-t-\\[10px\\]{border-top-left-radius:10px;border-top-right-radius:10px}.rounded-t-none{border-top-left-radius:0;border-top-right-radius:0}.rounded-l-\\[10px\\]{border-top-left-radius:10px;border-bottom-left-radius:10px}.rounded-l-none{border-top-left-radius:0;border-bottom-left-radius:0}.rounded-r-\\[10px\\]{border-top-right-radius:10px;border-bottom-right-radius:10px}.rounded-r-none{border-top-right-radius:0;border-bottom-right-radius:0}.rounded-b-\\[6px\\]{border-bottom-right-radius:6px;border-bottom-left-radius:6px}.rounded-b-\\[10px\\]{border-bottom-right-radius:10px;border-bottom-left-radius:10px}.rounded-b-none{border-bottom-right-radius:0;border-bottom-left-radius:0}.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-t-\\[\\#D9D9D9\\]{border-top-color:#d9d9d9}.bg-\\[\\#FEF2F2\\]{background-color:#fef2f2}.bg-black{background-color:var(--color-black)}.bg-black\\/5{background-color:#0000000d}@supports (color:color-mix(in lab, red, red)){.bg-black\\/5{background-color:color-mix(in oklab,var(--color-black)5%,transparent)}}.bg-black\\/25{background-color:#00000040}@supports (color:color-mix(in lab, red, red)){.bg-black\\/25{background-color:color-mix(in oklab,var(--color-black)25%,transparent)}}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-yellow-500{background-color:var(--color-yellow-500)}.p-0{padding:calc(var(--spacing)*0)}.px-0\\.25{padding-inline:calc(var(--spacing)*.25)}.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\\.5{padding-block:calc(var(--spacing)*.5)}.py-0\\.25{padding-block:calc(var(--spacing)*.25)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-px{padding-block:1px}.pt-1\\.5{padding-top:calc(var(--spacing)*1.5)}.pb-1{padding-bottom:calc(var(--spacing)*1)}.text-left{text-align:left}.font-sans{font-family:var(--font-sans)}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.text-\\[13px\\]{font-size:13px}.leading-3{--tw-leading:calc(var(--spacing)*3);line-height:calc(var(--spacing)*3)}.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)}.wrap-break-word{overflow-wrap:break-word}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.text-\\[\\#71717a\\]{color:#71717a}.text-\\[\\#B3B3B3\\]{color:#b3b3b3}.text-\\[\\#B91C1C\\]{color:#b91c1c}.text-black{color:var(--color-black)}.text-black\\/25{color:#00000040}@supports (color:color-mix(in lab, red, red)){.text-black\\/25{color:color-mix(in oklab,var(--color-black)25%,transparent)}}.text-black\\/30{color:#0000004d}@supports (color:color-mix(in lab, red, red)){.text-black\\/30{color:color-mix(in oklab,var(--color-black)30%,transparent)}}.text-black\\/40{color:#0006}@supports (color:color-mix(in lab, red, red)){.text-black\\/40{color:color-mix(in oklab,var(--color-black)40%,transparent)}}.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-black\\/60{color:#0009}@supports (color:color-mix(in lab, red, red)){.text-black\\/60{color:color-mix(in oklab,var(--color-black)60%,transparent)}}.text-black\\/70{color:#000000b3}@supports (color:color-mix(in lab, red, red)){.text-black\\/70{color:color-mix(in oklab,var(--color-black)70%,transparent)}}.text-black\\/80{color:#000c}@supports (color:color-mix(in lab, red, red)){.text-black\\/80{color:color-mix(in oklab,var(--color-black)80%,transparent)}}.text-black\\/85{color:#000000d9}@supports (color:color-mix(in lab, red, red)){.text-black\\/85{color:color-mix(in oklab,var(--color-black)85%,transparent)}}.text-white{color:var(--color-white)}.italic{font-style:italic}.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-35{opacity:.35}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);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_1px_2px_\\#51515140\\)\\]{filter:drop-shadow(0 1px 2px #51515140)}.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-columns\\,opacity\\]{transition-property:grid-template-columns,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[grid-template-rows\\,opacity\\]{transition-property:grid-template-rows,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[opacity\\,transform\\]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[transform\\,opacity\\]{transition-property:transform,opacity;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-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;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-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.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-\\[opacity\\,transform\\]{will-change:opacity,transform}.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}.\\[corner-shape\\:superellipse\\(1\\.25\\)\\]{corner-shape:superellipse(1.25)}.\\[font-synthesis\\:none\\]{font-synthesis:none}.\\[grid-area\\:1\\/1\\]{grid-area:1/1}.group-focus-within\\:invisible:is(:where(.group):focus-within *){visibility:hidden}.group-focus-within\\:visible:is(:where(.group):focus-within *){visibility:visible}@media (hover:hover){.group-hover\\:invisible:is(:where(.group):hover *){visibility:hidden}.group-hover\\:visible:is(:where(.group):hover *){visibility:visible}}.focus-within\\:bg-black\\/5:focus-within{background-color:#0000000d}@supports (color:color-mix(in lab, red, red)){.focus-within\\:bg-black\\/5:focus-within{background-color:color-mix(in oklab,var(--color-black)5%,transparent)}}@media (hover:hover){.hover\\:bg-\\[\\#F5F5F5\\]:hover{background-color:#f5f5f5}.hover\\:bg-\\[\\#FEE2E2\\]:hover{background-color:#fee2e2}.hover\\:bg-black\\/5:hover{background-color:#0000000d}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-black\\/5:hover{background-color:color-mix(in oklab,var(--color-black)5%,transparent)}}.hover\\:bg-black\\/10:hover{background-color:#0000001a}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-black\\/10:hover{background-color:color-mix(in oklab,var(--color-black)10%,transparent)}}.hover\\:text-\\[\\#B91C1C\\]:hover{color:#b91c1c}.hover\\:text-black:hover{color:var(--color-black)}.hover\\:text-black\\/60:hover{color:#0009}@supports (color:color-mix(in lab, red, red)){.hover\\:text-black\\/60:hover{color:color-mix(in oklab,var(--color-black)60%,transparent)}}.hover\\:opacity-100:hover{opacity:1}}.disabled\\:cursor-default:disabled{cursor:default}.disabled\\:opacity-40:disabled{opacity:.4}@media (hover:hover){.disabled\\:hover\\:bg-transparent:disabled:hover{background-color:#0000}}}:host{all:initial;direction:ltr}@keyframes shake{0%,to{transform:translate(0)}15%{transform:translate(-3px)}30%{transform:translate(3px)}45%{transform:translate(-3px)}60%{transform:translate(3px)}75%{transform:translate(-2px)}90%{transform:translate(2px)}}@keyframes pop-in{0%{opacity:0;transform:scale(.9)}70%{opacity:1;transform:scale(1.02)}to{opacity:1;transform:scale(1)}}@keyframes pop-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.95)}}@keyframes slide-in-bottom{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@keyframes slide-in-top{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}@keyframes slide-in-left{0%{opacity:0;transform:translate(-8px)}to{opacity:1;transform:translate(0)}}@keyframes slide-in-right{0%{opacity:0;transform:translate(8px)}to{opacity:1;transform:translate(0)}}@keyframes success-pop{0%{opacity:0;transform:scale(.9)}60%{opacity:1;transform:scale(1.1)}80%{transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes tooltip-fade-in{0%{opacity:0;transform:scale(.97)}to{opacity:1;transform:scale(1)}}@keyframes icon-loader-spin{0%{opacity:1}50%{opacity:.5}to{opacity:.2}}.icon-loader-bar{animation:.5s linear infinite icon-loader-spin}@keyframes shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}.shimmer-text{color:#0000;background:linear-gradient(90deg,#71717a 0%,#a1a1aa 25%,#71717a 50%,#a1a1aa 75%,#71717a 100%) 0 0/200% 100%;-webkit-background-clip:text;background-clip:text;animation:2.5s linear infinite shimmer}.animate-shake{will-change:transform;animation:.3s ease-out shake}.animate-pop-in{animation:pop-in var(--transition-normal)ease-out;will-change:transform,opacity}.animate-pop-out{animation:pop-out var(--transition-normal)ease-out forwards;will-change:transform,opacity}.animate-slide-in-bottom{animation:slide-in-bottom var(--transition-slow)ease-out;will-change:transform,opacity}.animate-slide-in-top{animation:slide-in-top var(--transition-slow)ease-out;will-change:transform,opacity}.animate-slide-in-left{animation:slide-in-left var(--transition-slow)ease-out;will-change:transform,opacity}.animate-slide-in-right{animation:slide-in-right var(--transition-slow)ease-out;will-change:transform,opacity}.animate-success-pop{will-change:transform,opacity;animation:.25s ease-out success-pop}.animate-tooltip-fade-in{animation:tooltip-fade-in var(--transition-fast)ease-out;will-change:transform,opacity}@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-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-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@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 ping{75%,to{opacity:0;transform:scale(2)}}@keyframes pulse{50%{opacity:.5}}';
|
|
1888
1888
|
}
|
|
1889
1889
|
});
|
|
1890
1890
|
|
|
@@ -2136,11 +2136,11 @@ var init_store = __esm({
|
|
|
2136
2136
|
});
|
|
2137
2137
|
|
|
2138
2138
|
// src/constants.ts
|
|
2139
|
-
var VERSION, VIEWPORT_MARGIN_PX, OFFSCREEN_POSITION, SELECTION_LERP_FACTOR, FEEDBACK_DURATION_MS, FADE_DURATION_MS, FADE_COMPLETE_BUFFER_MS, DISMISS_ANIMATION_BUFFER_MS, KEYDOWN_SPAM_TIMEOUT_MS, BLUR_DEACTIVATION_THRESHOLD_MS, INPUT_FOCUS_ACTIVATION_DELAY_MS, INPUT_TEXT_SELECTION_ACTIVATION_DELAY_MS, DEFAULT_KEY_HOLD_DURATION_MS, MIN_HOLD_FOR_ACTIVATION_AFTER_COPY_MS, RECENT_THRESHOLD_MS, ACTION_CYCLE_IDLE_TRIGGER_MS,
|
|
2139
|
+
var VERSION, VIEWPORT_MARGIN_PX, OFFSCREEN_POSITION, SELECTION_LERP_FACTOR, FEEDBACK_DURATION_MS, FADE_DURATION_MS, FADE_COMPLETE_BUFFER_MS, DISMISS_ANIMATION_BUFFER_MS, KEYDOWN_SPAM_TIMEOUT_MS, BLUR_DEACTIVATION_THRESHOLD_MS, WINDOW_REFOCUS_GRACE_PERIOD_MS, INPUT_FOCUS_ACTIVATION_DELAY_MS, INPUT_TEXT_SELECTION_ACTIVATION_DELAY_MS, DEFERRED_EXECUTION_DELAY_MS, DEFAULT_KEY_HOLD_DURATION_MS, MIN_HOLD_FOR_ACTIVATION_AFTER_COPY_MS, RECENT_THRESHOLD_MS, ACTION_CYCLE_IDLE_TRIGGER_MS, DRAG_THRESHOLD_PX, ELEMENT_DETECTION_THROTTLE_MS, COMPONENT_NAME_DEBOUNCE_MS, DRAG_PREVIEW_DEBOUNCE_MS, BOUNDS_CACHE_TTL_MS, BOUNDS_RECALC_INTERVAL_MS, AUTO_SCROLL_EDGE_THRESHOLD_PX, AUTO_SCROLL_SPEED_PX, Z_INDEX_HOST, Z_INDEX_LABEL, Z_INDEX_OVERLAY_CANVAS, DRAG_LERP_FACTOR, LERP_CONVERGENCE_THRESHOLD_PX, FADE_OUT_BUFFER_MS, MIN_DEVICE_PIXEL_RATIO, GRAB_PURPLE_RGB, OVERLAY_CROSSHAIR_COLOR, OVERLAY_BORDER_COLOR_DRAG, OVERLAY_FILL_COLOR_DRAG, OVERLAY_BORDER_COLOR_DEFAULT, OVERLAY_FILL_COLOR_DEFAULT, FROZEN_GLOW_COLOR, FROZEN_GLOW_EDGE_PX, ARROW_HEIGHT_PX, ARROW_MIN_SIZE_PX, ARROW_MAX_LABEL_WIDTH_RATIO, ARROW_CENTER_PERCENT, ARROW_LABEL_MARGIN_PX, LABEL_GAP_PX, PREVIEW_TEXT_MAX_LENGTH, PREVIEW_ATTR_VALUE_MAX_LENGTH, PREVIEW_MAX_ATTRS, PREVIEW_PRIORITY_ATTRS, SCREENSHOT_CAPTURE_DELAY_MS, VIDEO_METADATA_TIMEOUT_MS, VIDEO_READY_POLL_INTERVAL_MS, VIDEO_READY_TIMEOUT_MS, MODIFIER_KEYS, ARROW_KEYS, FROZEN_ELEMENT_ATTRIBUTE, USER_IGNORE_ATTRIBUTE, VIEWPORT_COVERAGE_THRESHOLD, OVERLAY_Z_INDEX_THRESHOLD, DEV_TOOLS_OVERLAY_Z_INDEX_THRESHOLD, TOOLTIP_DELAY_MS, TOOLTIP_GRACE_PERIOD_MS, TOOLBAR_SNAP_MARGIN_PX, TOOLBAR_FADE_IN_DELAY_MS, TOOLBAR_SNAP_ANIMATION_DURATION_MS, TOOLBAR_DRAG_THRESHOLD_PX, TOOLBAR_VELOCITY_MULTIPLIER_MS, TOOLBAR_COLLAPSED_SHORT_PX, TOOLBAR_COLLAPSED_LONG_PX, TOOLBAR_COLLAPSE_ANIMATION_DURATION_MS, TOGGLE_ANIMATION_BUFFER_MS, TOOLBAR_DEFAULT_WIDTH_PX, TOOLBAR_DEFAULT_HEIGHT_PX, TOOLBAR_SHAKE_TOOLTIP_DURATION_MS, DRAG_SELECTION_COVERAGE_THRESHOLD, DRAG_SELECTION_SAMPLE_SPACING_PX, DRAG_SELECTION_MIN_SAMPLES_PER_AXIS, DRAG_SELECTION_MAX_SAMPLES_PER_AXIS, DRAG_SELECTION_MAX_TOTAL_SAMPLE_POINTS, DRAG_SELECTION_EDGE_INSET_PX, MAX_ARROW_NAVIGATION_HISTORY, MAX_MEMORY_SESSIONS, MAX_TRANSFORM_ANCESTOR_DEPTH, TRANSFORM_EARLY_BAIL_DEPTH, ELEMENT_POSITION_CACHE_DISTANCE_THRESHOLD_PX, ELEMENT_POSITION_THROTTLE_MS, VISIBILITY_CACHE_TTL_MS, ZOOM_DETECTION_THRESHOLD, MOUNT_ROOT_RECHECK_DELAY_MS, MAX_HISTORY_ITEMS, DROPDOWN_ANIMATION_DURATION_MS, DROPDOWN_HOVER_OPEN_DELAY_MS, DROPDOWN_VIEWPORT_PADDING_PX, DROPDOWN_ANCHOR_GAP_PX, DROPDOWN_ICON_SIZE_PX, DROPDOWN_MIN_WIDTH_PX, DROPDOWN_MAX_WIDTH_PX, PANEL_STYLES, LOGO_SVG, IME_COMPOSING_KEY_CODE, SELECTION_LABEL_OFFSCREEN_PX;
|
|
2140
2140
|
var init_constants = __esm({
|
|
2141
2141
|
"src/constants.ts"() {
|
|
2142
2142
|
"use strict";
|
|
2143
|
-
VERSION = "0.1.
|
|
2143
|
+
VERSION = "0.1.15";
|
|
2144
2144
|
VIEWPORT_MARGIN_PX = 8;
|
|
2145
2145
|
OFFSCREEN_POSITION = -1e3;
|
|
2146
2146
|
SELECTION_LERP_FACTOR = 0.95;
|
|
@@ -2150,22 +2150,14 @@ var init_constants = __esm({
|
|
|
2150
2150
|
DISMISS_ANIMATION_BUFFER_MS = 50;
|
|
2151
2151
|
KEYDOWN_SPAM_TIMEOUT_MS = 200;
|
|
2152
2152
|
BLUR_DEACTIVATION_THRESHOLD_MS = 500;
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2153
|
+
WINDOW_REFOCUS_GRACE_PERIOD_MS = 200;
|
|
2154
|
+
INPUT_FOCUS_ACTIVATION_DELAY_MS = 400;
|
|
2155
|
+
INPUT_TEXT_SELECTION_ACTIVATION_DELAY_MS = 600;
|
|
2156
|
+
DEFERRED_EXECUTION_DELAY_MS = 0;
|
|
2157
|
+
DEFAULT_KEY_HOLD_DURATION_MS = 100;
|
|
2156
2158
|
MIN_HOLD_FOR_ACTIVATION_AFTER_COPY_MS = 200;
|
|
2157
2159
|
RECENT_THRESHOLD_MS = 1e4;
|
|
2158
2160
|
ACTION_CYCLE_IDLE_TRIGGER_MS = 600;
|
|
2159
|
-
ACTION_CYCLE_INPUT_THROTTLE_MS = 100;
|
|
2160
|
-
ACTION_CYCLE_SCROLL_THRESHOLD_PX = 30;
|
|
2161
|
-
ACTION_CYCLE_SCROLL_LINE_HEIGHT_PX = 16;
|
|
2162
|
-
ACTION_CYCLE_ACTION_IDS = [
|
|
2163
|
-
"copy",
|
|
2164
|
-
"comment",
|
|
2165
|
-
"screenshot",
|
|
2166
|
-
"copy-html",
|
|
2167
|
-
"open"
|
|
2168
|
-
];
|
|
2169
2161
|
DRAG_THRESHOLD_PX = 2;
|
|
2170
2162
|
ELEMENT_DETECTION_THROTTLE_MS = 32;
|
|
2171
2163
|
COMPONENT_NAME_DEBOUNCE_MS = 100;
|
|
@@ -2174,6 +2166,7 @@ var init_constants = __esm({
|
|
|
2174
2166
|
BOUNDS_RECALC_INTERVAL_MS = 100;
|
|
2175
2167
|
AUTO_SCROLL_EDGE_THRESHOLD_PX = 25;
|
|
2176
2168
|
AUTO_SCROLL_SPEED_PX = 10;
|
|
2169
|
+
Z_INDEX_HOST = 2147483647;
|
|
2177
2170
|
Z_INDEX_LABEL = 2147483647;
|
|
2178
2171
|
Z_INDEX_OVERLAY_CANVAS = 2147483645;
|
|
2179
2172
|
DRAG_LERP_FACTOR = 0.7;
|
|
@@ -2189,8 +2182,12 @@ var init_constants = __esm({
|
|
|
2189
2182
|
FROZEN_GLOW_COLOR = `rgba(${GRAB_PURPLE_RGB}, 0.15)`;
|
|
2190
2183
|
FROZEN_GLOW_EDGE_PX = 50;
|
|
2191
2184
|
ARROW_HEIGHT_PX = 8;
|
|
2185
|
+
ARROW_MIN_SIZE_PX = 4;
|
|
2186
|
+
ARROW_MAX_LABEL_WIDTH_RATIO = 0.2;
|
|
2192
2187
|
ARROW_CENTER_PERCENT = 50;
|
|
2188
|
+
ARROW_LABEL_MARGIN_PX = 16;
|
|
2193
2189
|
LABEL_GAP_PX = 4;
|
|
2190
|
+
PREVIEW_TEXT_MAX_LENGTH = 100;
|
|
2194
2191
|
PREVIEW_ATTR_VALUE_MAX_LENGTH = 15;
|
|
2195
2192
|
PREVIEW_MAX_ATTRS = 3;
|
|
2196
2193
|
PREVIEW_PRIORITY_ATTRS = [
|
|
@@ -2233,6 +2230,7 @@ var init_constants = __esm({
|
|
|
2233
2230
|
TOOLBAR_COLLAPSED_SHORT_PX = 14;
|
|
2234
2231
|
TOOLBAR_COLLAPSED_LONG_PX = 28;
|
|
2235
2232
|
TOOLBAR_COLLAPSE_ANIMATION_DURATION_MS = 150;
|
|
2233
|
+
TOGGLE_ANIMATION_BUFFER_MS = 50;
|
|
2236
2234
|
TOOLBAR_DEFAULT_WIDTH_PX = 78;
|
|
2237
2235
|
TOOLBAR_DEFAULT_HEIGHT_PX = 28;
|
|
2238
2236
|
TOOLBAR_SHAKE_TOOLTIP_DURATION_MS = 1500;
|
|
@@ -2242,6 +2240,8 @@ var init_constants = __esm({
|
|
|
2242
2240
|
DRAG_SELECTION_MAX_SAMPLES_PER_AXIS = 20;
|
|
2243
2241
|
DRAG_SELECTION_MAX_TOTAL_SAMPLE_POINTS = 100;
|
|
2244
2242
|
DRAG_SELECTION_EDGE_INSET_PX = 1;
|
|
2243
|
+
MAX_ARROW_NAVIGATION_HISTORY = 50;
|
|
2244
|
+
MAX_MEMORY_SESSIONS = 50;
|
|
2245
2245
|
MAX_TRANSFORM_ANCESTOR_DEPTH = 6;
|
|
2246
2246
|
TRANSFORM_EARLY_BAIL_DEPTH = 3;
|
|
2247
2247
|
ELEMENT_POSITION_CACHE_DISTANCE_THRESHOLD_PX = 2;
|
|
@@ -2249,8 +2249,18 @@ var init_constants = __esm({
|
|
|
2249
2249
|
VISIBILITY_CACHE_TTL_MS = 50;
|
|
2250
2250
|
ZOOM_DETECTION_THRESHOLD = 0.01;
|
|
2251
2251
|
MOUNT_ROOT_RECHECK_DELAY_MS = 1e3;
|
|
2252
|
+
MAX_HISTORY_ITEMS = 20;
|
|
2253
|
+
DROPDOWN_ANIMATION_DURATION_MS = 100;
|
|
2254
|
+
DROPDOWN_HOVER_OPEN_DELAY_MS = 200;
|
|
2255
|
+
DROPDOWN_VIEWPORT_PADDING_PX = 8;
|
|
2256
|
+
DROPDOWN_ANCHOR_GAP_PX = 8;
|
|
2257
|
+
DROPDOWN_ICON_SIZE_PX = 11;
|
|
2258
|
+
DROPDOWN_MIN_WIDTH_PX = 180;
|
|
2259
|
+
DROPDOWN_MAX_WIDTH_PX = 280;
|
|
2252
2260
|
PANEL_STYLES = "bg-white";
|
|
2253
2261
|
LOGO_SVG = `<svg width="294" height="294" viewBox="0 0 294 294" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_0_3)"><mask id="mask0_0_3" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="0" width="294" height="294"><path d="M294 0H0V294H294V0Z" fill="white"/></mask><g mask="url(#mask0_0_3)"><path d="M144.599 47.4924C169.712 27.3959 194.548 20.0265 212.132 30.1797C227.847 39.2555 234.881 60.3243 231.926 89.516C231.677 92.0069 231.328 94.5423 230.94 97.1058L228.526 110.14C228.517 110.136 228.505 110.132 228.495 110.127C228.486 110.165 228.479 110.203 228.468 110.24L216.255 105.741C216.256 105.736 216.248 105.728 216.248 105.723C207.915 103.125 199.421 101.075 190.82 99.5888L190.696 99.5588L173.526 97.2648L173.511 97.2631C173.492 97.236 173.467 97.2176 173.447 97.1905C163.862 96.2064 154.233 95.7166 144.599 95.7223C134.943 95.7162 125.295 96.219 115.693 97.2286C110.075 105.033 104.859 113.118 100.063 121.453C95.2426 129.798 90.8624 138.391 86.939 147.193C90.8624 155.996 95.2426 164.588 100.063 172.933C104.866 181.302 110.099 189.417 115.741 197.245C115.749 197.245 115.758 197.246 115.766 197.247L115.752 197.27L115.745 197.283L115.754 197.296L126.501 211.013L126.574 211.089C132.136 217.767 138.126 224.075 144.507 229.974L144.609 230.082L154.572 238.287C154.539 238.319 154.506 238.35 154.472 238.38C154.485 238.392 154.499 238.402 154.513 238.412L143.846 247.482L143.827 247.497C126.56 261.128 109.472 268.745 94.8019 268.745C88.5916 268.837 82.4687 267.272 77.0657 264.208C61.3496 255.132 54.3164 234.062 57.2707 204.871C57.528 202.307 57.8806 199.694 58.2904 197.054C28.3363 185.327 9.52301 167.51 9.52301 147.193C9.52301 129.042 24.2476 112.396 50.9901 100.375C53.3443 99.3163 55.7938 98.3058 58.2904 97.3526C57.8806 94.7023 57.528 92.0803 57.2707 89.516C54.3164 60.3243 61.3496 39.2555 77.0657 30.1797C94.6494 20.0265 119.486 27.3959 144.599 47.4924ZM70.6423 201.315C70.423 202.955 70.2229 204.566 70.0704 206.168C67.6686 229.567 72.5478 246.628 83.3615 252.988L83.5176 253.062C95.0399 259.717 114.015 254.426 134.782 238.38C125.298 229.45 116.594 219.725 108.764 209.314C95.8516 207.742 83.0977 205.066 70.6423 201.315ZM80.3534 163.438C77.34 171.677 74.8666 180.104 72.9484 188.664C81.1787 191.224 89.5657 193.247 98.0572 194.724L98.4618 194.813C95.2115 189.865 92.0191 184.66 88.9311 179.378C85.8433 174.097 83.003 168.768 80.3534 163.438ZM60.759 110.203C59.234 110.839 57.7378 111.475 56.27 112.11C34.7788 121.806 22.3891 134.591 22.3891 147.193C22.3891 160.493 36.4657 174.297 60.7494 184.26C63.7439 171.581 67.8124 159.182 72.9104 147.193C67.822 135.23 63.7566 122.855 60.759 110.203ZM98.4137 99.6404C89.8078 101.145 81.3075 103.206 72.9676 105.809C74.854 114.203 77.2741 122.468 80.2132 130.554L80.3059 130.939C82.9938 125.6 85.8049 120.338 88.8834 115.008C91.9618 109.679 95.1544 104.569 98.4137 99.6404ZM94.9258 38.5215C90.9331 38.4284 86.9866 39.3955 83.4891 41.3243C72.6291 47.6015 67.6975 64.5954 70.0424 87.9446L70.0416 88.2194C70.194 89.8208 70.3941 91.4325 70.6134 93.0624C83.0737 89.3364 95.8263 86.6703 108.736 85.0924C116.57 74.6779 125.28 64.9532 134.773 56.0249C119.877 44.5087 105.895 38.5215 94.9258 38.5215ZM205.737 41.3148C202.268 39.398 198.355 38.4308 194.394 38.5099L194.29 38.512C183.321 38.512 169.34 44.4991 154.444 56.0153C163.93 64.9374 172.634 74.6557 180.462 85.064C193.375 86.6345 206.128 89.3102 218.584 93.0624C218.812 91.4325 219.003 89.8118 219.165 88.2098C221.548 64.7099 216.65 47.6164 205.737 41.3148ZM144.552 64.3097C138.104 70.2614 132.054 76.6306 126.443 83.3765C132.39 82.995 138.426 82.8046 144.552 82.8046C150.727 82.8046 156.778 83.0143 162.707 83.3765C157.08 76.6293 151.015 70.2596 144.552 64.3097Z" fill="white"/><path d="M144.598 47.4924C169.712 27.3959 194.547 20.0265 212.131 30.1797C227.847 39.2555 234.88 60.3243 231.926 89.516C231.677 92.0069 231.327 94.5423 230.941 97.1058L228.526 110.14L228.496 110.127C228.487 110.165 228.478 110.203 228.469 110.24L216.255 105.741L216.249 105.723C207.916 103.125 199.42 101.075 190.82 99.5888L190.696 99.5588L173.525 97.2648L173.511 97.263C173.492 97.236 173.468 97.2176 173.447 97.1905C163.863 96.2064 154.234 95.7166 144.598 95.7223C134.943 95.7162 125.295 96.219 115.693 97.2286C110.075 105.033 104.859 113.118 100.063 121.453C95.2426 129.798 90.8622 138.391 86.939 147.193C90.8622 155.996 95.2426 164.588 100.063 172.933C104.866 181.302 110.099 189.417 115.741 197.245L115.766 197.247L115.752 197.27L115.745 197.283L115.754 197.296L126.501 211.013L126.574 211.089C132.136 217.767 138.126 224.075 144.506 229.974L144.61 230.082L154.572 238.287C154.539 238.319 154.506 238.35 154.473 238.38L154.512 238.412L143.847 247.482L143.827 247.497C126.56 261.13 109.472 268.745 94.8018 268.745C88.5915 268.837 82.4687 267.272 77.0657 264.208C61.3496 255.132 54.3162 234.062 57.2707 204.871C57.528 202.307 57.8806 199.694 58.2904 197.054C28.3362 185.327 9.52298 167.51 9.52298 147.193C9.52298 129.042 24.2476 112.396 50.9901 100.375C53.3443 99.3163 55.7938 98.3058 58.2904 97.3526C57.8806 94.7023 57.528 92.0803 57.2707 89.516C54.3162 60.3243 61.3496 39.2555 77.0657 30.1797C94.6493 20.0265 119.486 27.3959 144.598 47.4924ZM70.6422 201.315C70.423 202.955 70.2229 204.566 70.0704 206.168C67.6686 229.567 72.5478 246.628 83.3615 252.988L83.5175 253.062C95.0399 259.717 114.015 254.426 134.782 238.38C125.298 229.45 116.594 219.725 108.764 209.314C95.8515 207.742 83.0977 205.066 70.6422 201.315ZM80.3534 163.438C77.34 171.677 74.8666 180.104 72.9484 188.664C81.1786 191.224 89.5657 193.247 98.0572 194.724L98.4618 194.813C95.2115 189.865 92.0191 184.66 88.931 179.378C85.8433 174.097 83.003 168.768 80.3534 163.438ZM60.7589 110.203C59.234 110.839 57.7378 111.475 56.2699 112.11C34.7788 121.806 22.3891 134.591 22.3891 147.193C22.3891 160.493 36.4657 174.297 60.7494 184.26C63.7439 171.581 67.8124 159.182 72.9103 147.193C67.822 135.23 63.7566 122.855 60.7589 110.203ZM98.4137 99.6404C89.8078 101.145 81.3075 103.206 72.9676 105.809C74.8539 114.203 77.2741 122.468 80.2132 130.554L80.3059 130.939C82.9938 125.6 85.8049 120.338 88.8834 115.008C91.9618 109.679 95.1544 104.569 98.4137 99.6404ZM94.9258 38.5215C90.9331 38.4284 86.9866 39.3955 83.4891 41.3243C72.629 47.6015 67.6975 64.5954 70.0424 87.9446L70.0415 88.2194C70.194 89.8208 70.3941 91.4325 70.6134 93.0624C83.0737 89.3364 95.8262 86.6703 108.736 85.0924C116.57 74.6779 125.28 64.9532 134.772 56.0249C119.877 44.5087 105.895 38.5215 94.9258 38.5215ZM205.737 41.3148C202.268 39.398 198.355 38.4308 194.394 38.5099L194.291 38.512C183.321 38.512 169.34 44.4991 154.443 56.0153C163.929 64.9374 172.634 74.6557 180.462 85.064C193.374 86.6345 206.129 89.3102 218.584 93.0624C218.813 91.4325 219.003 89.8118 219.166 88.2098C221.548 64.7099 216.65 47.6164 205.737 41.3148ZM144.551 64.3097C138.103 70.2614 132.055 76.6306 126.443 83.3765C132.389 82.995 138.427 82.8046 144.551 82.8046C150.727 82.8046 156.779 83.0143 162.707 83.3765C157.079 76.6293 151.015 70.2596 144.551 64.3097Z" fill="#FF40E0"/></g><mask id="mask1_0_3" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="102" y="84" width="161" height="162"><path d="M235.282 84.827L102.261 112.259L129.693 245.28L262.714 217.848L235.282 84.827Z" fill="white"/></mask><g mask="url(#mask1_0_3)"><path d="M136.863 129.916L213.258 141.224C220.669 142.322 222.495 152.179 215.967 155.856L187.592 171.843L184.135 204.227C183.339 211.678 173.564 213.901 169.624 207.526L129.021 141.831C125.503 136.14 130.245 128.936 136.863 129.916Z" fill="#FF40E0" stroke="#FF40E0" stroke-width="0.817337" stroke-linecap="round" stroke-linejoin="round"/></g></g><defs><clipPath id="clip0_0_3"><rect width="294" height="294" fill="white"/></clipPath></defs></svg>`;
|
|
2262
|
+
IME_COMPOSING_KEY_CODE = 229;
|
|
2263
|
+
SELECTION_LABEL_OFFSCREEN_PX = -9999;
|
|
2254
2264
|
}
|
|
2255
2265
|
});
|
|
2256
2266
|
|
|
@@ -2460,8 +2470,6 @@ var init_store2 = __esm({
|
|
|
2460
2470
|
theme: input.theme,
|
|
2461
2471
|
activationTimestamp: null,
|
|
2462
2472
|
previouslyFocusedElement: null,
|
|
2463
|
-
canUndo: false,
|
|
2464
|
-
canRedo: false,
|
|
2465
2473
|
isAgentConnected: false,
|
|
2466
2474
|
supportsUndo: false,
|
|
2467
2475
|
supportsFollowUp: false,
|
|
@@ -2515,6 +2523,7 @@ var init_store2 = __esm({
|
|
|
2515
2523
|
setStore("contextMenuElement", null);
|
|
2516
2524
|
setStore("contextMenuClickOffset", null);
|
|
2517
2525
|
setStore("selectedAgent", null);
|
|
2526
|
+
setStore("lastCopiedElement", null);
|
|
2518
2527
|
},
|
|
2519
2528
|
toggle: () => {
|
|
2520
2529
|
if (store.activationTimestamp !== null) {
|
|
@@ -2738,9 +2747,6 @@ var init_store2 = __esm({
|
|
|
2738
2747
|
setLastGrabbed: (element) => {
|
|
2739
2748
|
setStore("lastGrabbedElement", element);
|
|
2740
2749
|
},
|
|
2741
|
-
setLastCopied: (element) => {
|
|
2742
|
-
setStore("lastCopiedElement", element);
|
|
2743
|
-
},
|
|
2744
2750
|
clearLastCopied: () => {
|
|
2745
2751
|
setStore("lastCopiedElement", null);
|
|
2746
2752
|
},
|
|
@@ -2757,19 +2763,9 @@ var init_store2 = __esm({
|
|
|
2757
2763
|
setStore("selectionFilePath", filePath);
|
|
2758
2764
|
setStore("selectionLineNumber", lineNumber);
|
|
2759
2765
|
},
|
|
2760
|
-
clearSelectionSource: () => {
|
|
2761
|
-
setStore("selectionFilePath", null);
|
|
2762
|
-
setStore("selectionLineNumber", null);
|
|
2763
|
-
},
|
|
2764
2766
|
setPendingClickData: (data) => {
|
|
2765
2767
|
setStore("pendingClickData", data);
|
|
2766
2768
|
},
|
|
2767
|
-
clearPendingClickData: () => {
|
|
2768
|
-
setStore("pendingClickData", null);
|
|
2769
|
-
},
|
|
2770
|
-
setReplySessionId: (sessionId) => {
|
|
2771
|
-
setStore("replySessionId", sessionId);
|
|
2772
|
-
},
|
|
2773
2769
|
clearReplySessionId: () => {
|
|
2774
2770
|
setStore("replySessionId", null);
|
|
2775
2771
|
},
|
|
@@ -2814,22 +2810,12 @@ var init_store2 = __esm({
|
|
|
2814
2810
|
(instances) => instances.filter((instance) => instance.id !== instanceId)
|
|
2815
2811
|
);
|
|
2816
2812
|
},
|
|
2817
|
-
removeLabelsForElement: (element) => {
|
|
2818
|
-
setStore(
|
|
2819
|
-
"labelInstances",
|
|
2820
|
-
(instances) => instances.filter((instance) => instance.element !== element)
|
|
2821
|
-
);
|
|
2822
|
-
},
|
|
2823
2813
|
clearLabelInstances: () => {
|
|
2824
2814
|
setStore("labelInstances", []);
|
|
2825
2815
|
},
|
|
2826
2816
|
setHasAgentProvider: (value) => {
|
|
2827
2817
|
setStore("hasAgentProvider", value);
|
|
2828
2818
|
},
|
|
2829
|
-
setUndoRedoState: (canUndo, canRedo) => {
|
|
2830
|
-
setStore("canUndo", canUndo);
|
|
2831
|
-
setStore("canRedo", canRedo);
|
|
2832
|
-
},
|
|
2833
2819
|
setAgentCapabilities: (capabilities) => {
|
|
2834
2820
|
setStore("supportsUndo", capabilities.supportsUndo);
|
|
2835
2821
|
setStore("supportsFollowUp", capabilities.supportsFollowUp);
|
|
@@ -2946,9 +2932,6 @@ var init_store2 = __esm({
|
|
|
2946
2932
|
},
|
|
2947
2933
|
setSelectedAgent: (agent) => {
|
|
2948
2934
|
setStore("selectedAgent", agent);
|
|
2949
|
-
},
|
|
2950
|
-
clearSelectedAgent: () => {
|
|
2951
|
-
setStore("selectedAgent", null);
|
|
2952
2935
|
}
|
|
2953
2936
|
};
|
|
2954
2937
|
return { store, setStore, actions, isActive, isHolding };
|
|
@@ -3055,7 +3038,7 @@ var init_mount_root = __esm({
|
|
|
3055
3038
|
}
|
|
3056
3039
|
const host = document.createElement("div");
|
|
3057
3040
|
host.setAttribute(ATTRIBUTE_NAME, "true");
|
|
3058
|
-
host.style.zIndex =
|
|
3041
|
+
host.style.zIndex = String(Z_INDEX_HOST);
|
|
3059
3042
|
host.style.position = "fixed";
|
|
3060
3043
|
host.style.inset = "0";
|
|
3061
3044
|
host.style.pointerEvents = "none";
|
|
@@ -3071,9 +3054,7 @@ var init_mount_root = __esm({
|
|
|
3071
3054
|
const doc = document.body ?? document.documentElement;
|
|
3072
3055
|
doc.appendChild(host);
|
|
3073
3056
|
setTimeout(() => {
|
|
3074
|
-
|
|
3075
|
-
doc.appendChild(host);
|
|
3076
|
-
}
|
|
3057
|
+
doc.appendChild(host);
|
|
3077
3058
|
}, MOUNT_ROOT_RECHECK_DELAY_MS);
|
|
3078
3059
|
return root;
|
|
3079
3060
|
};
|
|
@@ -3591,6 +3572,20 @@ var init_overlay_canvas = __esm({
|
|
|
3591
3572
|
}
|
|
3592
3573
|
});
|
|
3593
3574
|
|
|
3575
|
+
// src/utils/get-arrow-size.ts
|
|
3576
|
+
var getArrowSize;
|
|
3577
|
+
var init_get_arrow_size = __esm({
|
|
3578
|
+
"src/utils/get-arrow-size.ts"() {
|
|
3579
|
+
"use strict";
|
|
3580
|
+
init_constants();
|
|
3581
|
+
getArrowSize = (labelWidth) => {
|
|
3582
|
+
if (labelWidth <= 0) return ARROW_HEIGHT_PX;
|
|
3583
|
+
const scaledSize = labelWidth * ARROW_MAX_LABEL_WIDTH_RATIO;
|
|
3584
|
+
return Math.max(ARROW_MIN_SIZE_PX, Math.min(ARROW_HEIGHT_PX, scaledSize));
|
|
3585
|
+
};
|
|
3586
|
+
}
|
|
3587
|
+
});
|
|
3588
|
+
|
|
3594
3589
|
// ../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
3595
3590
|
function r2(e2) {
|
|
3596
3591
|
var t2, f3, n2 = "";
|
|
@@ -6240,21 +6235,24 @@ var init_arrow = __esm({
|
|
|
6240
6235
|
init_web();
|
|
6241
6236
|
init_web();
|
|
6242
6237
|
init_web();
|
|
6243
|
-
|
|
6238
|
+
init_get_arrow_size();
|
|
6239
|
+
_tmpl$5 = /* @__PURE__ */ template(`<div data-react-grab-arrow class="absolute w-0 h-0 z-10">`);
|
|
6244
6240
|
Arrow = (props) => {
|
|
6245
6241
|
const arrowColor = () => props.color ?? "white";
|
|
6246
6242
|
const isBottom = () => props.position === "bottom";
|
|
6243
|
+
const arrowSize = () => getArrowSize(props.labelWidth ?? 0);
|
|
6247
6244
|
return (() => {
|
|
6248
6245
|
var _el$ = _tmpl$5();
|
|
6249
6246
|
createRenderEffect((_p$) => {
|
|
6250
|
-
var _v$ = `calc(${props.leftPercent}% + ${props.leftOffsetPx}px)`, _v$2 = isBottom() ? "0" : void 0, _v$3 = isBottom() ? void 0 : "0", _v$4 = isBottom() ? "translateX(-50%) translateY(-100%)" : "translateX(-50%) translateY(100%)", _v$5 =
|
|
6247
|
+
var _v$ = `calc(${props.leftPercent}% + ${props.leftOffsetPx}px)`, _v$2 = isBottom() ? "0" : void 0, _v$3 = isBottom() ? void 0 : "0", _v$4 = isBottom() ? "translateX(-50%) translateY(-100%)" : "translateX(-50%) translateY(100%)", _v$5 = `${arrowSize()}px solid transparent`, _v$6 = `${arrowSize()}px solid transparent`, _v$7 = isBottom() ? `${arrowSize()}px solid ${arrowColor()}` : void 0, _v$8 = isBottom() ? void 0 : `${arrowSize()}px solid ${arrowColor()}`;
|
|
6251
6248
|
_v$ !== _p$.e && setStyleProperty(_el$, "left", _p$.e = _v$);
|
|
6252
6249
|
_v$2 !== _p$.t && setStyleProperty(_el$, "top", _p$.t = _v$2);
|
|
6253
6250
|
_v$3 !== _p$.a && setStyleProperty(_el$, "bottom", _p$.a = _v$3);
|
|
6254
6251
|
_v$4 !== _p$.o && setStyleProperty(_el$, "transform", _p$.o = _v$4);
|
|
6255
|
-
_v$5 !== _p$.i && setStyleProperty(_el$, "border-
|
|
6256
|
-
_v$6 !== _p$.n && setStyleProperty(_el$, "border-
|
|
6257
|
-
_v$7 !== _p$.s && setStyleProperty(_el$, "
|
|
6252
|
+
_v$5 !== _p$.i && setStyleProperty(_el$, "border-left", _p$.i = _v$5);
|
|
6253
|
+
_v$6 !== _p$.n && setStyleProperty(_el$, "border-right", _p$.n = _v$6);
|
|
6254
|
+
_v$7 !== _p$.s && setStyleProperty(_el$, "border-bottom", _p$.s = _v$7);
|
|
6255
|
+
_v$8 !== _p$.h && setStyleProperty(_el$, "border-top", _p$.h = _v$8);
|
|
6258
6256
|
return _p$;
|
|
6259
6257
|
}, {
|
|
6260
6258
|
e: void 0,
|
|
@@ -6263,7 +6261,8 @@ var init_arrow = __esm({
|
|
|
6263
6261
|
o: void 0,
|
|
6264
6262
|
i: void 0,
|
|
6265
6263
|
n: void 0,
|
|
6266
|
-
s: void 0
|
|
6264
|
+
s: void 0,
|
|
6265
|
+
h: void 0
|
|
6267
6266
|
});
|
|
6268
6267
|
return _el$;
|
|
6269
6268
|
})();
|
|
@@ -6991,7 +6990,7 @@ var init_completion_view = __esm({
|
|
|
6991
6990
|
});
|
|
6992
6991
|
|
|
6993
6992
|
// src/components/selection-label/index.tsx
|
|
6994
|
-
var _tmpl$16, _tmpl$26, _tmpl$34, _tmpl$43, _tmpl$53, _tmpl$63, _tmpl$73, _tmpl$83, _tmpl$92, _tmpl$0, _tmpl$1, DEFAULT_OFFSCREEN_POSITION, SelectionLabel;
|
|
6993
|
+
var _tmpl$16, _tmpl$26, _tmpl$34, _tmpl$43, _tmpl$53, _tmpl$63, _tmpl$73, _tmpl$83, _tmpl$92, _tmpl$0, _tmpl$1, _tmpl$102, DEFAULT_OFFSCREEN_POSITION, SelectionLabel;
|
|
6995
6994
|
var init_selection_label = __esm({
|
|
6996
6995
|
"src/components/selection-label/index.tsx"() {
|
|
6997
6996
|
"use strict";
|
|
@@ -7007,6 +7006,7 @@ var init_selection_label = __esm({
|
|
|
7007
7006
|
init_web();
|
|
7008
7007
|
init_solid();
|
|
7009
7008
|
init_constants();
|
|
7009
|
+
init_get_arrow_size();
|
|
7010
7010
|
init_is_keyboard_event_triggered_by_input();
|
|
7011
7011
|
init_cn();
|
|
7012
7012
|
init_get_tag_display();
|
|
@@ -7026,26 +7026,29 @@ var init_selection_label = __esm({
|
|
|
7026
7026
|
_tmpl$43 = /* @__PURE__ */ template(`<div class="flex flex-col w-[calc(100%+16px)] -mx-2 -my-1.5">`);
|
|
7027
7027
|
_tmpl$53 = /* @__PURE__ */ template(`<div class="contain-layout shrink-0 flex flex-col items-start w-fit h-fit"><div class="contain-layout shrink-0 flex items-center gap-1 py-1.5 w-fit h-fit px-2">`);
|
|
7028
7028
|
_tmpl$63 = /* @__PURE__ */ template(`<div class="flex items-center gap-1 w-full mb-1 overflow-hidden"><span class="text-black/40 text-[11px] leading-3 font-medium truncate italic">`);
|
|
7029
|
-
_tmpl$73 = /* @__PURE__ */ template(`<
|
|
7030
|
-
_tmpl$83 = /* @__PURE__ */ template(`<div class="
|
|
7031
|
-
_tmpl$92 = /* @__PURE__ */ template(`<div
|
|
7032
|
-
_tmpl$0 = /* @__PURE__ */ template(`<
|
|
7033
|
-
_tmpl$1 = /* @__PURE__ */ template(`<
|
|
7029
|
+
_tmpl$73 = /* @__PURE__ */ template(`<button data-react-grab-submit class="contain-layout shrink-0 flex items-center justify-center size-4 rounded-full bg-black cursor-pointer ml-1 interactive-scale">`);
|
|
7030
|
+
_tmpl$83 = /* @__PURE__ */ template(`<div class="shrink-0 flex justify-between items-end w-full min-h-4"><textarea data-react-grab-ignore-events data-react-grab-input class="text-black text-[13px] leading-4 font-medium bg-transparent border-none outline-none resize-none flex-1 p-0 m-0 wrap-break-word overflow-y-auto"placeholder="Add context"rows=1 style=field-sizing:content;min-height:16px;max-height:95px;scrollbar-width:none>`);
|
|
7031
|
+
_tmpl$92 = /* @__PURE__ */ template(`<div class="contain-layout shrink-0 flex flex-col justify-center items-start w-fit h-fit min-w-[150px] max-w-[280px]"><div class="contain-layout shrink-0 flex items-center gap-1 pt-1.5 pb-1 w-fit h-fit px-2 max-w-full">`);
|
|
7032
|
+
_tmpl$0 = /* @__PURE__ */ template(`<div data-react-grab-ignore-events data-react-grab-selection-label style=z-index:2147483647><div>`);
|
|
7033
|
+
_tmpl$1 = /* @__PURE__ */ template(`<span class="text-[11px] font-sans text-black/50 ml-4">`);
|
|
7034
|
+
_tmpl$102 = /* @__PURE__ */ template(`<div class="contain-layout flex items-center justify-between w-full px-2 py-1 transition-colors"><span class="text-[13px] leading-4 font-sans font-medium text-black">`);
|
|
7034
7035
|
DEFAULT_OFFSCREEN_POSITION = {
|
|
7035
|
-
left:
|
|
7036
|
-
top:
|
|
7036
|
+
left: SELECTION_LABEL_OFFSCREEN_PX,
|
|
7037
|
+
top: SELECTION_LABEL_OFFSCREEN_PX,
|
|
7037
7038
|
arrowLeftPercent: ARROW_CENTER_PERCENT,
|
|
7038
7039
|
arrowLeftOffset: 0,
|
|
7039
7040
|
edgeOffsetX: 0
|
|
7040
7041
|
};
|
|
7041
7042
|
SelectionLabel = (props) => {
|
|
7042
7043
|
let containerRef;
|
|
7044
|
+
let panelRef;
|
|
7043
7045
|
let inputRef;
|
|
7044
7046
|
let isTagCurrentlyHovered = false;
|
|
7045
7047
|
let lastValidPosition = null;
|
|
7046
7048
|
let lastElementIdentity = null;
|
|
7047
7049
|
const [measuredWidth, setMeasuredWidth] = createSignal(0);
|
|
7048
7050
|
const [measuredHeight, setMeasuredHeight] = createSignal(0);
|
|
7051
|
+
const [panelWidth, setPanelWidth] = createSignal(0);
|
|
7049
7052
|
const [arrowPosition, setArrowPosition] = createSignal("bottom");
|
|
7050
7053
|
const [viewportVersion, setViewportVersion] = createSignal(0);
|
|
7051
7054
|
const [hadValidBounds, setHadValidBounds] = createSignal(false);
|
|
@@ -7069,6 +7072,9 @@ var init_selection_label = __esm({
|
|
|
7069
7072
|
setMeasuredWidth(rect.width);
|
|
7070
7073
|
setMeasuredHeight(rect.height);
|
|
7071
7074
|
}
|
|
7075
|
+
if (panelRef) {
|
|
7076
|
+
setPanelWidth(panelRef.getBoundingClientRect().width);
|
|
7077
|
+
}
|
|
7072
7078
|
};
|
|
7073
7079
|
const handleTagHoverChange = (hovered) => {
|
|
7074
7080
|
isTagCurrentlyHovered = hovered;
|
|
@@ -7114,32 +7120,22 @@ var init_selection_label = __esm({
|
|
|
7114
7120
|
lastValidPosition = null;
|
|
7115
7121
|
}
|
|
7116
7122
|
});
|
|
7123
|
+
const sizeAffectingSignature = createMemo(() => [props.tagName, props.componentName, props.elementsCount, props.statusText, props.inputValue, props.hasAgent, props.isPromptMode, props.isPendingDismiss, props.error, props.isPendingAbort, props.visible, props.status, props.actionCycleState?.items, props.actionCycleState?.activeIndex, props.actionCycleState?.isVisible]);
|
|
7117
7124
|
createEffect(() => {
|
|
7118
|
-
void
|
|
7119
|
-
void props.componentName;
|
|
7120
|
-
void props.elementsCount;
|
|
7121
|
-
void props.statusText;
|
|
7122
|
-
void props.inputValue;
|
|
7123
|
-
void props.hasAgent;
|
|
7124
|
-
void props.isPromptMode;
|
|
7125
|
-
void props.isPendingDismiss;
|
|
7126
|
-
void props.error;
|
|
7127
|
-
void props.isPendingAbort;
|
|
7128
|
-
void props.visible;
|
|
7129
|
-
void props.status;
|
|
7130
|
-
void props.actionCycleState?.items;
|
|
7131
|
-
void props.actionCycleState?.activeIndex;
|
|
7132
|
-
void props.actionCycleState?.isVisible;
|
|
7125
|
+
void sizeAffectingSignature();
|
|
7133
7126
|
queueMicrotask(measureContainer);
|
|
7134
7127
|
});
|
|
7135
7128
|
createEffect(() => {
|
|
7136
|
-
if (props.isPromptMode && inputRef) {
|
|
7137
|
-
setTimeout(() => {
|
|
7129
|
+
if (props.isPromptMode && inputRef && props.onSubmit) {
|
|
7130
|
+
const focusTimeout = setTimeout(() => {
|
|
7138
7131
|
inputRef?.focus();
|
|
7139
|
-
},
|
|
7132
|
+
}, DEFERRED_EXECUTION_DELAY_MS);
|
|
7133
|
+
onCleanup(() => {
|
|
7134
|
+
clearTimeout(focusTimeout);
|
|
7135
|
+
});
|
|
7140
7136
|
}
|
|
7141
7137
|
});
|
|
7142
|
-
const
|
|
7138
|
+
const positionComputation = createMemo(() => {
|
|
7143
7139
|
viewportVersion();
|
|
7144
7140
|
const bounds = props.selectionBounds;
|
|
7145
7141
|
const labelWidth = measuredWidth();
|
|
@@ -7147,21 +7143,28 @@ var init_selection_label = __esm({
|
|
|
7147
7143
|
const hasMeasurements = labelWidth > 0 && labelHeight > 0;
|
|
7148
7144
|
const hasValidBounds = bounds && bounds.width > 0 && bounds.height > 0;
|
|
7149
7145
|
if (!hasMeasurements || !hasValidBounds) {
|
|
7150
|
-
return
|
|
7146
|
+
return {
|
|
7147
|
+
position: lastValidPosition ?? DEFAULT_OFFSCREEN_POSITION,
|
|
7148
|
+
computedArrowPosition: null
|
|
7149
|
+
};
|
|
7151
7150
|
}
|
|
7152
7151
|
const viewportWidth = window.innerWidth;
|
|
7153
7152
|
const viewportHeight = window.innerHeight;
|
|
7154
7153
|
const isSelectionVisibleInViewport = bounds.x + bounds.width > 0 && bounds.x < viewportWidth && bounds.y + bounds.height > 0 && bounds.y < viewportHeight;
|
|
7155
7154
|
if (!isSelectionVisibleInViewport) {
|
|
7156
|
-
return
|
|
7155
|
+
return {
|
|
7156
|
+
position: DEFAULT_OFFSCREEN_POSITION,
|
|
7157
|
+
computedArrowPosition: null
|
|
7158
|
+
};
|
|
7157
7159
|
}
|
|
7158
7160
|
const selectionCenterX = bounds.x + bounds.width / 2;
|
|
7159
7161
|
const cursorX = props.mouseX ?? selectionCenterX;
|
|
7160
7162
|
const selectionBottom = bounds.y + bounds.height;
|
|
7161
7163
|
const selectionTop = bounds.y;
|
|
7164
|
+
const actualArrowHeight = props.hideArrow ? 0 : getArrowSize(panelWidth());
|
|
7162
7165
|
const anchorX = cursorX;
|
|
7163
7166
|
let edgeOffsetX = 0;
|
|
7164
|
-
let positionTop = selectionBottom +
|
|
7167
|
+
let positionTop = selectionBottom + actualArrowHeight + LABEL_GAP_PX;
|
|
7165
7168
|
if (labelWidth > 0) {
|
|
7166
7169
|
const labelLeft = anchorX - labelWidth / 2;
|
|
7167
7170
|
const labelRight = anchorX + labelWidth / 2;
|
|
@@ -7172,32 +7175,44 @@ var init_selection_label = __esm({
|
|
|
7172
7175
|
edgeOffsetX = VIEWPORT_MARGIN_PX - labelLeft;
|
|
7173
7176
|
}
|
|
7174
7177
|
}
|
|
7175
|
-
const totalHeightNeeded = labelHeight +
|
|
7178
|
+
const totalHeightNeeded = labelHeight + actualArrowHeight + LABEL_GAP_PX;
|
|
7176
7179
|
const fitsBelow = positionTop + labelHeight <= viewportHeight - VIEWPORT_MARGIN_PX;
|
|
7177
7180
|
if (!fitsBelow) {
|
|
7178
7181
|
positionTop = selectionTop - totalHeightNeeded;
|
|
7179
|
-
setArrowPosition("top");
|
|
7180
|
-
} else {
|
|
7181
|
-
setArrowPosition("bottom");
|
|
7182
7182
|
}
|
|
7183
7183
|
if (positionTop < VIEWPORT_MARGIN_PX) {
|
|
7184
7184
|
positionTop = VIEWPORT_MARGIN_PX;
|
|
7185
7185
|
}
|
|
7186
7186
|
const arrowLeftPercent = ARROW_CENTER_PERCENT;
|
|
7187
|
-
const
|
|
7188
|
-
const
|
|
7189
|
-
|
|
7190
|
-
|
|
7191
|
-
|
|
7192
|
-
|
|
7193
|
-
|
|
7187
|
+
const labelHalfWidth = labelWidth / 2;
|
|
7188
|
+
const arrowCenterPx = labelHalfWidth - edgeOffsetX;
|
|
7189
|
+
const arrowMinPx = Math.min(ARROW_LABEL_MARGIN_PX, labelHalfWidth);
|
|
7190
|
+
const arrowMaxPx = Math.max(labelWidth - ARROW_LABEL_MARGIN_PX, labelHalfWidth);
|
|
7191
|
+
const clampedArrowCenterPx = Math.max(arrowMinPx, Math.min(arrowMaxPx, arrowCenterPx));
|
|
7192
|
+
const arrowLeftOffset = clampedArrowCenterPx - labelHalfWidth;
|
|
7193
|
+
const computedArrowPosition = fitsBelow ? "bottom" : "top";
|
|
7194
|
+
return {
|
|
7195
|
+
position: {
|
|
7196
|
+
left: anchorX,
|
|
7197
|
+
top: positionTop,
|
|
7198
|
+
arrowLeftPercent,
|
|
7199
|
+
arrowLeftOffset,
|
|
7200
|
+
edgeOffsetX
|
|
7201
|
+
},
|
|
7202
|
+
computedArrowPosition
|
|
7194
7203
|
};
|
|
7195
|
-
|
|
7196
|
-
|
|
7197
|
-
|
|
7198
|
-
|
|
7204
|
+
});
|
|
7205
|
+
const computedPosition = () => positionComputation().position;
|
|
7206
|
+
createEffect(() => {
|
|
7207
|
+
const result = positionComputation();
|
|
7208
|
+
if (result.computedArrowPosition !== null) {
|
|
7209
|
+
lastValidPosition = result.position;
|
|
7210
|
+
setHadValidBounds(true);
|
|
7211
|
+
setArrowPosition(result.computedArrowPosition);
|
|
7212
|
+
}
|
|
7213
|
+
});
|
|
7199
7214
|
const handleKeyDown = (event) => {
|
|
7200
|
-
if (event.isComposing || event.keyCode ===
|
|
7215
|
+
if (event.isComposing || event.keyCode === IME_COMPOSING_KEY_CODE) {
|
|
7201
7216
|
return;
|
|
7202
7217
|
}
|
|
7203
7218
|
event.stopPropagation();
|
|
@@ -7213,8 +7228,11 @@ var init_selection_label = __esm({
|
|
|
7213
7228
|
}
|
|
7214
7229
|
};
|
|
7215
7230
|
const handleInput = (event) => {
|
|
7216
|
-
const
|
|
7217
|
-
|
|
7231
|
+
const inputTarget = event.target;
|
|
7232
|
+
if (!(inputTarget instanceof HTMLTextAreaElement)) {
|
|
7233
|
+
return;
|
|
7234
|
+
}
|
|
7235
|
+
props.onInputChange?.(inputTarget.value);
|
|
7218
7236
|
};
|
|
7219
7237
|
const tagDisplayResult = () => getTagDisplay({
|
|
7220
7238
|
tagName: props.tagName,
|
|
@@ -7237,7 +7255,7 @@ var init_selection_label = __esm({
|
|
|
7237
7255
|
const handleContainerPointerDown = (event) => {
|
|
7238
7256
|
event.stopPropagation();
|
|
7239
7257
|
event.stopImmediatePropagation();
|
|
7240
|
-
const isEditableInputVisible = canInteract() && props.isPromptMode && !props.isPendingDismiss;
|
|
7258
|
+
const isEditableInputVisible = canInteract() && props.isPromptMode && !props.isPendingDismiss && props.onSubmit;
|
|
7241
7259
|
if (isEditableInputVisible && inputRef) {
|
|
7242
7260
|
inputRef.focus();
|
|
7243
7261
|
}
|
|
@@ -7248,7 +7266,7 @@ var init_selection_label = __esm({
|
|
|
7248
7266
|
return memo(() => props.visible !== false)() && (props.selectionBounds || shouldPersistDuringFade());
|
|
7249
7267
|
},
|
|
7250
7268
|
get children() {
|
|
7251
|
-
var _el$ = _tmpl$
|
|
7269
|
+
var _el$ = _tmpl$0(), _el$2 = _el$.firstChild;
|
|
7252
7270
|
_el$.addEventListener("mouseleave", () => props.onHoverChange?.(false));
|
|
7253
7271
|
_el$.addEventListener("mouseenter", () => props.onHoverChange?.(true));
|
|
7254
7272
|
_el$.$$click = (event) => {
|
|
@@ -7258,15 +7276,25 @@ var init_selection_label = __esm({
|
|
|
7258
7276
|
_el$.$$pointerdown = handleContainerPointerDown;
|
|
7259
7277
|
var _ref$ = containerRef;
|
|
7260
7278
|
typeof _ref$ === "function" ? use(_ref$, _el$) : containerRef = _el$;
|
|
7261
|
-
insert(_el$, createComponent(
|
|
7262
|
-
get
|
|
7263
|
-
return
|
|
7264
|
-
},
|
|
7265
|
-
get leftPercent() {
|
|
7266
|
-
return computedPosition().arrowLeftPercent;
|
|
7279
|
+
insert(_el$, createComponent(Show, {
|
|
7280
|
+
get when() {
|
|
7281
|
+
return !props.hideArrow;
|
|
7267
7282
|
},
|
|
7268
|
-
get
|
|
7269
|
-
return
|
|
7283
|
+
get children() {
|
|
7284
|
+
return createComponent(Arrow, {
|
|
7285
|
+
get position() {
|
|
7286
|
+
return arrowPosition();
|
|
7287
|
+
},
|
|
7288
|
+
get leftPercent() {
|
|
7289
|
+
return computedPosition().arrowLeftPercent;
|
|
7290
|
+
},
|
|
7291
|
+
get leftOffsetPx() {
|
|
7292
|
+
return computedPosition().arrowLeftOffset;
|
|
7293
|
+
},
|
|
7294
|
+
get labelWidth() {
|
|
7295
|
+
return panelWidth();
|
|
7296
|
+
}
|
|
7297
|
+
});
|
|
7270
7298
|
}
|
|
7271
7299
|
}), _el$2);
|
|
7272
7300
|
insert(_el$, createComponent(Show, {
|
|
@@ -7309,6 +7337,8 @@ var init_selection_label = __esm({
|
|
|
7309
7337
|
});
|
|
7310
7338
|
}
|
|
7311
7339
|
}), _el$2);
|
|
7340
|
+
var _ref$2 = panelRef;
|
|
7341
|
+
typeof _ref$2 === "function" ? use(_ref$2, _el$2) : panelRef = _el$2;
|
|
7312
7342
|
insert(_el$2, createComponent(Show, {
|
|
7313
7343
|
get when() {
|
|
7314
7344
|
return memo(() => props.status === "copying")() && !props.isPendingAbort;
|
|
@@ -7328,8 +7358,8 @@ var init_selection_label = __esm({
|
|
|
7328
7358
|
return createComponent(BottomSection, {
|
|
7329
7359
|
get children() {
|
|
7330
7360
|
var _el$6 = _tmpl$26(), _el$7 = _el$6.firstChild;
|
|
7331
|
-
var _ref$
|
|
7332
|
-
typeof _ref$
|
|
7361
|
+
var _ref$3 = inputRef;
|
|
7362
|
+
typeof _ref$3 === "function" ? use(_ref$3, _el$7) : inputRef = _el$7;
|
|
7333
7363
|
insert(_el$6, createComponent(Show, {
|
|
7334
7364
|
get when() {
|
|
7335
7365
|
return props.onAbort;
|
|
@@ -7405,23 +7435,23 @@ var init_selection_label = __esm({
|
|
|
7405
7435
|
return actionCycleItems();
|
|
7406
7436
|
},
|
|
7407
7437
|
children: (item, itemIndex) => (() => {
|
|
7408
|
-
var _el$17 = _tmpl$
|
|
7438
|
+
var _el$17 = _tmpl$102(), _el$18 = _el$17.firstChild;
|
|
7409
7439
|
insert(_el$18, () => item.label);
|
|
7410
7440
|
insert(_el$17, createComponent(Show, {
|
|
7411
7441
|
get when() {
|
|
7412
7442
|
return item.shortcut;
|
|
7413
7443
|
},
|
|
7414
7444
|
get children() {
|
|
7415
|
-
var _el$19 = _tmpl$
|
|
7445
|
+
var _el$19 = _tmpl$1();
|
|
7416
7446
|
insert(_el$19, () => formatShortcut(item.shortcut));
|
|
7417
7447
|
return _el$19;
|
|
7418
7448
|
}
|
|
7419
7449
|
}), null);
|
|
7420
7450
|
createRenderEffect((_p$) => {
|
|
7421
|
-
var _v$
|
|
7422
|
-
_v$
|
|
7423
|
-
_v$
|
|
7424
|
-
_v$
|
|
7451
|
+
var _v$1 = item.label.toLowerCase(), _v$10 = !!(itemIndex() === actionCycleActiveIndex()), _v$11 = !!(itemIndex() === actionCycleItems().length - 1);
|
|
7452
|
+
_v$1 !== _p$.e && setAttribute(_el$17, "data-react-grab-action-cycle-item", _p$.e = _v$1);
|
|
7453
|
+
_v$10 !== _p$.t && _el$17.classList.toggle("bg-black/5", _p$.t = _v$10);
|
|
7454
|
+
_v$11 !== _p$.a && _el$17.classList.toggle("rounded-b-[6px]", _p$.a = _v$11);
|
|
7425
7455
|
return _p$;
|
|
7426
7456
|
}, {
|
|
7427
7457
|
e: void 0,
|
|
@@ -7444,7 +7474,7 @@ var init_selection_label = __esm({
|
|
|
7444
7474
|
return memo(() => !!(canInteract() && props.isPromptMode))() && !props.isPendingDismiss;
|
|
7445
7475
|
},
|
|
7446
7476
|
get children() {
|
|
7447
|
-
var _el$10 = _tmpl$
|
|
7477
|
+
var _el$10 = _tmpl$92(), _el$11 = _el$10.firstChild;
|
|
7448
7478
|
insert(_el$11, createComponent(TagBadge, {
|
|
7449
7479
|
get tagName() {
|
|
7450
7480
|
return tagDisplay();
|
|
@@ -7475,17 +7505,34 @@ var init_selection_label = __esm({
|
|
|
7475
7505
|
return _el$12;
|
|
7476
7506
|
}
|
|
7477
7507
|
}), (() => {
|
|
7478
|
-
var _el$14 = _tmpl$
|
|
7508
|
+
var _el$14 = _tmpl$83(), _el$15 = _el$14.firstChild;
|
|
7479
7509
|
_el$15.$$keydown = handleKeyDown;
|
|
7480
7510
|
_el$15.$$input = handleInput;
|
|
7481
|
-
var _ref$
|
|
7482
|
-
typeof _ref$
|
|
7483
|
-
_el$
|
|
7484
|
-
|
|
7485
|
-
|
|
7486
|
-
|
|
7487
|
-
|
|
7488
|
-
|
|
7511
|
+
var _ref$4 = inputRef;
|
|
7512
|
+
typeof _ref$4 === "function" ? use(_ref$4, _el$15) : inputRef = _el$15;
|
|
7513
|
+
insert(_el$14, createComponent(Show, {
|
|
7514
|
+
get when() {
|
|
7515
|
+
return props.onSubmit;
|
|
7516
|
+
},
|
|
7517
|
+
get children() {
|
|
7518
|
+
var _el$16 = _tmpl$73();
|
|
7519
|
+
_el$16.$$click = () => props.onSubmit?.();
|
|
7520
|
+
insert(_el$16, createComponent(IconSubmit, {
|
|
7521
|
+
size: 10,
|
|
7522
|
+
"class": "text-white"
|
|
7523
|
+
}));
|
|
7524
|
+
return _el$16;
|
|
7525
|
+
}
|
|
7526
|
+
}), null);
|
|
7527
|
+
createRenderEffect((_p$) => {
|
|
7528
|
+
var _v$ = props.replyToPrompt ? "14px" : "0", _v$2 = !props.onSubmit;
|
|
7529
|
+
_v$ !== _p$.e && setStyleProperty(_el$14, "padding-left", _p$.e = _v$);
|
|
7530
|
+
_v$2 !== _p$.t && (_el$15.readOnly = _p$.t = _v$2);
|
|
7531
|
+
return _p$;
|
|
7532
|
+
}, {
|
|
7533
|
+
e: void 0,
|
|
7534
|
+
t: void 0
|
|
7535
|
+
});
|
|
7489
7536
|
createRenderEffect(() => _el$15.value = props.inputValue ?? "");
|
|
7490
7537
|
return _el$14;
|
|
7491
7538
|
})()];
|
|
@@ -7528,15 +7575,15 @@ var init_selection_label = __esm({
|
|
|
7528
7575
|
}
|
|
7529
7576
|
}), null);
|
|
7530
7577
|
createRenderEffect((_p$) => {
|
|
7531
|
-
var _v$ = cn("fixed font-sans text-[13px] antialiased filter-[drop-shadow(0px_1px_2px_#51515140)] select-none transition-opacity duration-100 ease-out"), _v$
|
|
7532
|
-
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
7533
|
-
_v$
|
|
7534
|
-
_v$
|
|
7535
|
-
_v$
|
|
7536
|
-
_v$
|
|
7537
|
-
_v$
|
|
7538
|
-
_v$
|
|
7539
|
-
_v$
|
|
7578
|
+
var _v$3 = cn("fixed font-sans text-[13px] antialiased filter-[drop-shadow(0px_1px_2px_#51515140)] select-none transition-opacity duration-100 ease-out"), _v$4 = `${computedPosition().top}px`, _v$5 = `${computedPosition().left}px`, _v$6 = `translateX(calc(-50% + ${computedPosition().edgeOffsetX}px))`, _v$7 = shouldEnablePointerEvents() ? "auto" : "none", _v$8 = props.status === "fading" || isInternalFading() ? 0 : 1, _v$9 = cn("contain-layout flex items-center gap-[5px] rounded-[10px] antialiased w-fit h-fit p-0 [font-synthesis:none] [corner-shape:superellipse(1.25)]", PANEL_STYLES), _v$0 = isCompletedStatus() && !props.error ? "none" : void 0;
|
|
7579
|
+
_v$3 !== _p$.e && className(_el$, _p$.e = _v$3);
|
|
7580
|
+
_v$4 !== _p$.t && setStyleProperty(_el$, "top", _p$.t = _v$4);
|
|
7581
|
+
_v$5 !== _p$.a && setStyleProperty(_el$, "left", _p$.a = _v$5);
|
|
7582
|
+
_v$6 !== _p$.o && setStyleProperty(_el$, "transform", _p$.o = _v$6);
|
|
7583
|
+
_v$7 !== _p$.i && setStyleProperty(_el$, "pointer-events", _p$.i = _v$7);
|
|
7584
|
+
_v$8 !== _p$.n && setStyleProperty(_el$, "opacity", _p$.n = _v$8);
|
|
7585
|
+
_v$9 !== _p$.s && className(_el$2, _p$.s = _v$9);
|
|
7586
|
+
_v$0 !== _p$.h && setStyleProperty(_el$2, "display", _p$.h = _v$0);
|
|
7540
7587
|
return _p$;
|
|
7541
7588
|
}, {
|
|
7542
7589
|
e: void 0,
|
|
@@ -7686,6 +7733,55 @@ var init_icon_comment = __esm({
|
|
|
7686
7733
|
}
|
|
7687
7734
|
});
|
|
7688
7735
|
|
|
7736
|
+
// src/components/icons/icon-inbox.tsx
|
|
7737
|
+
var _tmpl$20, _tmpl$27, IconInbox, IconInboxUnread;
|
|
7738
|
+
var init_icon_inbox = __esm({
|
|
7739
|
+
"src/components/icons/icon-inbox.tsx"() {
|
|
7740
|
+
"use strict";
|
|
7741
|
+
init_web();
|
|
7742
|
+
init_web();
|
|
7743
|
+
init_web();
|
|
7744
|
+
_tmpl$20 = /* @__PURE__ */ template(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=currentColor><path d="M12.8277 1.75C15.0033 1.74998 15.7381 1.74997 17.0981 1.93282C18.5025 2.12164 19.6563 2.52175 20.5687 3.43414C21.4811 4.34653 21.8812 5.50033 22.07 6.90471C22.234 8.12428 22.2509 10.047 22.2526 12L22.2494 12.75H20.2528C20.2528 10.4826 20.2507 8.38258 20.0878 7.17121C19.9288 5.9886 19.6333 5.3272 19.1545 4.84835C18.6756 4.3695 18.0142 4.07399 16.8316 3.91499C15.6202 3.75212 15.0203 3.75 12.7528 3.75C10.4854 3.75 8.3854 3.75212 7.17403 3.91499C5.99143 4.07399 5.33003 4.3695 4.85118 4.84835C4.37232 5.3272 4.07681 5.9886 3.91782 7.17121C3.75495 8.38258 3.75283 10.4826 3.75283 12.75L1.75195 12.7518L1.75302 11.9999C1.75475 10.0469 1.77169 8.12426 1.93565 6.90471C2.12447 5.50033 2.52457 4.34653 3.43696 3.43414C4.34935 2.52175 5.50316 2.12164 6.90754 1.93282C8.26767 1.74996 10.0024 1.74998 12.1783 1.75H12.1784H12.8277H12.8277Z"></path><path d="M22.2453 13.5037C22.2368 15.2454 22.1975 16.6539 21.9924 17.7892C21.7834 18.9461 21.3919 19.8839 20.6368 20.6391C19.7786 21.4973 18.6863 21.8843 17.3097 22.0694C15.9662 22.25 14.2455 22.25 12.0548 22.25H11.9405C9.74978 22.25 8.02911 22.25 6.6857 22.0694C5.30904 21.8843 4.21679 21.4973 3.35859 20.6391C2.60342 19.8839 2.21192 18.9461 2.00296 17.7892C1.79789 16.6539 1.75858 15.2454 1.75 13.5037L1.75107 12.7518L3.75194 12.75L7.42333 12.75C8.70352 12.75 9.55879 13.7898 9.96929 14.6123C10.2595 15.1938 10.8231 15.75 11.9977 15.75C13.1723 15.75 13.7358 15.1938 14.0261 14.6123C14.4366 13.7898 15.2918 12.75 16.572 12.75L20.2519 12.75H22.2486L22.2453 13.5037Z">`);
|
|
7745
|
+
_tmpl$27 = /* @__PURE__ */ template(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=currentColor><path fill=#404040 d="M14.25 5.5C14.25 3.15279 16.1528 1.25 18.5 1.25C20.8472 1.25 22.75 3.15279 22.75 5.5C22.75 7.84721 20.8472 9.75 18.5 9.75C16.1528 9.75 14.25 7.84721 14.25 5.5Z"></path><path d="M20.2156 10.9897C19.9813 11.0629 19.8641 11.0994 19.8057 11.1792C19.7474 11.259 19.748 11.373 19.7491 11.6009C19.7513 12.0381 19.7518 12.4898 19.7519 12.9499C19.752 13.1155 19.6176 13.25 19.4519 13.25L16.072 13.25C14.7918 13.25 13.9366 14.2898 13.5261 15.1123C13.2358 15.6938 12.6723 16.25 11.4977 16.25C10.3231 16.25 9.7595 15.6938 9.46929 15.1123C9.05879 14.2898 8.20352 13.25 6.92333 13.25L3.55194 13.25C3.38626 13.25 3.25193 13.1155 3.25197 12.9499C3.25245 10.7983 3.26128 8.82894 3.41693 7.67121C3.57593 6.4886 3.87144 5.8272 4.35029 5.34835C4.82915 4.8695 5.49055 4.57399 6.67315 4.41499C7.88452 4.25212 9.9845 4.25 12.2519 4.25C12.3035 4.25 12.3542 4.25 12.4041 4.25001C12.6299 4.25002 12.7427 4.25003 12.822 4.19171C12.9014 4.13339 12.9377 4.0171 13.0103 3.78451C13.0682 3.59881 13.1354 3.41715 13.2111 3.24007C13.4166 2.75982 13.5193 2.51969 13.4304 2.38492C13.3415 2.25015 13.1029 2.25011 12.6257 2.25002C12.5291 2.25 12.4296 2.25 12.3268 2.25H11.6775C9.50152 2.24998 7.76678 2.24996 6.40666 2.43283C5.00228 2.62164 3.84847 3.02175 2.93608 3.93414C2.02369 4.84653 1.62358 6.00033 1.43477 7.40471C1.2708 8.62426 1.25387 10.5469 1.25214 12.4999L1.25 14.0037C1.25858 15.7454 1.29789 17.1539 1.50296 18.2892C1.71192 19.4461 2.10342 20.3839 2.85859 21.1391C3.71679 21.9973 4.80904 22.3843 6.1857 22.5694C7.52911 22.75 9.24978 22.75 11.4405 22.75H11.5548C13.7455 22.75 15.4662 22.75 16.8097 22.5694C18.1863 22.3843 19.2786 21.9973 20.1368 21.1391C20.8919 20.3839 21.2834 19.4461 21.4924 18.2892C21.6975 17.1539 21.7368 15.7454 21.7453 14.0037L21.7517 12.5C21.7514 12.1187 21.7505 11.7385 21.748 11.3645C21.7449 10.8942 21.7433 10.6591 21.6087 10.5709C21.4741 10.4828 21.2371 10.5844 20.763 10.7876C20.585 10.8638 20.4023 10.9314 20.2156 10.9897Z">`);
|
|
7746
|
+
IconInbox = (props) => {
|
|
7747
|
+
const size = () => props.size ?? 14;
|
|
7748
|
+
return (() => {
|
|
7749
|
+
var _el$ = _tmpl$20();
|
|
7750
|
+
createRenderEffect((_p$) => {
|
|
7751
|
+
var _v$ = size(), _v$2 = size(), _v$3 = props.class;
|
|
7752
|
+
_v$ !== _p$.e && setAttribute(_el$, "width", _p$.e = _v$);
|
|
7753
|
+
_v$2 !== _p$.t && setAttribute(_el$, "height", _p$.t = _v$2);
|
|
7754
|
+
_v$3 !== _p$.a && setAttribute(_el$, "class", _p$.a = _v$3);
|
|
7755
|
+
return _p$;
|
|
7756
|
+
}, {
|
|
7757
|
+
e: void 0,
|
|
7758
|
+
t: void 0,
|
|
7759
|
+
a: void 0
|
|
7760
|
+
});
|
|
7761
|
+
return _el$;
|
|
7762
|
+
})();
|
|
7763
|
+
};
|
|
7764
|
+
IconInboxUnread = (props) => {
|
|
7765
|
+
const size = () => props.size ?? 14;
|
|
7766
|
+
return (() => {
|
|
7767
|
+
var _el$2 = _tmpl$27();
|
|
7768
|
+
createRenderEffect((_p$) => {
|
|
7769
|
+
var _v$4 = size(), _v$5 = size(), _v$6 = props.class;
|
|
7770
|
+
_v$4 !== _p$.e && setAttribute(_el$2, "width", _p$.e = _v$4);
|
|
7771
|
+
_v$5 !== _p$.t && setAttribute(_el$2, "height", _p$.t = _v$5);
|
|
7772
|
+
_v$6 !== _p$.a && setAttribute(_el$2, "class", _p$.a = _v$6);
|
|
7773
|
+
return _p$;
|
|
7774
|
+
}, {
|
|
7775
|
+
e: void 0,
|
|
7776
|
+
t: void 0,
|
|
7777
|
+
a: void 0
|
|
7778
|
+
});
|
|
7779
|
+
return _el$2;
|
|
7780
|
+
})();
|
|
7781
|
+
};
|
|
7782
|
+
}
|
|
7783
|
+
});
|
|
7784
|
+
|
|
7689
7785
|
// src/utils/freeze-updates.ts
|
|
7690
7786
|
var isUpdatesPaused, getOrCache, patchedDispatchers, wrappedDispatchCache, wrappedStartTransitionCache, pendingStoreCallbacks, pendingTransitionCallbacks, pendingStateUpdates, pausedQueueStates, pausedContextStates, renderersWithPatchedDispatcher, typedFiberRoots, getFiberRoot, collectFiberRoots, mergePendingChains, pauseHookQueue, resumeHookQueue, pauseContextDependency, resumeContextDependency, forEachHookQueue, forEachContextDependency, traverseFibers, pauseFiber, resumeFiber, patchDispatcher, installDispatcherPatching, scheduleReactUpdate, invokeCallbacks, initializeFreezeSupport, freezeUpdates;
|
|
7691
7787
|
var init_freeze_updates = __esm({
|
|
@@ -8158,7 +8254,28 @@ var init_freeze_animations = __esm({
|
|
|
8158
8254
|
);
|
|
8159
8255
|
};
|
|
8160
8256
|
unfreezeGlobalAnimations = () => {
|
|
8161
|
-
globalAnimationStyleElement
|
|
8257
|
+
if (!globalAnimationStyleElement) return;
|
|
8258
|
+
globalAnimationStyleElement.textContent = `
|
|
8259
|
+
*, *::before, *::after {
|
|
8260
|
+
transition: none !important;
|
|
8261
|
+
}
|
|
8262
|
+
`;
|
|
8263
|
+
for (const animation of document.getAnimations()) {
|
|
8264
|
+
if (animation.effect instanceof KeyframeEffect) {
|
|
8265
|
+
const target = animation.effect.target;
|
|
8266
|
+
if (target instanceof Element) {
|
|
8267
|
+
const rootNode = target.getRootNode();
|
|
8268
|
+
if (rootNode instanceof ShadowRoot) {
|
|
8269
|
+
continue;
|
|
8270
|
+
}
|
|
8271
|
+
}
|
|
8272
|
+
}
|
|
8273
|
+
try {
|
|
8274
|
+
animation.finish();
|
|
8275
|
+
} catch {
|
|
8276
|
+
}
|
|
8277
|
+
}
|
|
8278
|
+
globalAnimationStyleElement.remove();
|
|
8162
8279
|
globalAnimationStyleElement = null;
|
|
8163
8280
|
};
|
|
8164
8281
|
}
|
|
@@ -8467,7 +8584,7 @@ var init_freeze_pseudo_states = __esm({
|
|
|
8467
8584
|
});
|
|
8468
8585
|
|
|
8469
8586
|
// src/components/tooltip.tsx
|
|
8470
|
-
var _tmpl$
|
|
8587
|
+
var _tmpl$21, tooltipCloseTimestamp, wasTooltipRecentlyVisible, Tooltip;
|
|
8471
8588
|
var init_tooltip = __esm({
|
|
8472
8589
|
"src/components/tooltip.tsx"() {
|
|
8473
8590
|
"use strict";
|
|
@@ -8479,7 +8596,7 @@ var init_tooltip = __esm({
|
|
|
8479
8596
|
init_solid();
|
|
8480
8597
|
init_cn();
|
|
8481
8598
|
init_constants();
|
|
8482
|
-
_tmpl$
|
|
8599
|
+
_tmpl$21 = /* @__PURE__ */ template(`<div style=z-index:2147483647>`);
|
|
8483
8600
|
tooltipCloseTimestamp = 0;
|
|
8484
8601
|
wasTooltipRecentlyVisible = () => {
|
|
8485
8602
|
return Date.now() - tooltipCloseTimestamp < TOOLTIP_GRACE_PERIOD_MS;
|
|
@@ -8523,9 +8640,9 @@ var init_tooltip = __esm({
|
|
|
8523
8640
|
return delayedVisible();
|
|
8524
8641
|
},
|
|
8525
8642
|
get children() {
|
|
8526
|
-
var _el$ = _tmpl$
|
|
8643
|
+
var _el$ = _tmpl$21();
|
|
8527
8644
|
insert(_el$, () => props.children);
|
|
8528
|
-
createRenderEffect(() => className(_el$, cn("absolute
|
|
8645
|
+
createRenderEffect(() => className(_el$, cn("absolute whitespace-nowrap px-1.5 py-0.5 rounded-[10px] text-[10px] text-black/60 pointer-events-none [corner-shape:superellipse(1.25)]", PANEL_STYLES, props.position === "left" || props.position === "right" ? "top-1/2 -translate-y-1/2" : "left-1/2 -translate-x-1/2", props.position === "top" && "bottom-full mb-2.5", props.position === "bottom" && "top-full mt-2.5", props.position === "left" && "right-full mr-2.5", props.position === "right" && "left-full ml-2.5", shouldAnimate() && "animate-tooltip-fade-in")));
|
|
8529
8646
|
return _el$;
|
|
8530
8647
|
}
|
|
8531
8648
|
});
|
|
@@ -8546,8 +8663,25 @@ var init_get_toolbar_icon_color = __esm({
|
|
|
8546
8663
|
}
|
|
8547
8664
|
});
|
|
8548
8665
|
|
|
8666
|
+
// src/utils/toolbar-layout.ts
|
|
8667
|
+
var getExpandGridClass, getButtonSpacingClass, getMinDimensionClass;
|
|
8668
|
+
var init_toolbar_layout = __esm({
|
|
8669
|
+
"src/utils/toolbar-layout.ts"() {
|
|
8670
|
+
"use strict";
|
|
8671
|
+
getExpandGridClass = (isVertical, isExpanded, collapsedExtra) => {
|
|
8672
|
+
if (isExpanded) {
|
|
8673
|
+
return isVertical ? "grid-rows-[1fr] opacity-100" : "grid-cols-[1fr] opacity-100";
|
|
8674
|
+
}
|
|
8675
|
+
const base = isVertical ? "grid-rows-[0fr] opacity-0" : "grid-cols-[0fr] opacity-0";
|
|
8676
|
+
return collapsedExtra ? `${base} ${collapsedExtra}` : base;
|
|
8677
|
+
};
|
|
8678
|
+
getButtonSpacingClass = (isVertical) => isVertical ? "mb-1.5" : "mr-1.5";
|
|
8679
|
+
getMinDimensionClass = (isVertical) => isVertical ? "min-h-0" : "min-w-0";
|
|
8680
|
+
}
|
|
8681
|
+
});
|
|
8682
|
+
|
|
8549
8683
|
// src/components/toolbar/index.tsx
|
|
8550
|
-
var _tmpl$
|
|
8684
|
+
var _tmpl$28, _tmpl$29, Toolbar;
|
|
8551
8685
|
var init_toolbar = __esm({
|
|
8552
8686
|
"src/components/toolbar/index.tsx"() {
|
|
8553
8687
|
"use strict";
|
|
@@ -8569,24 +8703,30 @@ var init_toolbar = __esm({
|
|
|
8569
8703
|
init_icon_select();
|
|
8570
8704
|
init_icon_chevron();
|
|
8571
8705
|
init_icon_comment();
|
|
8706
|
+
init_icon_inbox();
|
|
8572
8707
|
init_constants();
|
|
8573
8708
|
init_freeze_updates();
|
|
8574
8709
|
init_freeze_animations();
|
|
8575
8710
|
init_freeze_pseudo_states();
|
|
8576
8711
|
init_tooltip();
|
|
8577
8712
|
init_get_toolbar_icon_color();
|
|
8578
|
-
|
|
8579
|
-
_tmpl$
|
|
8713
|
+
init_toolbar_layout();
|
|
8714
|
+
_tmpl$28 = /* @__PURE__ */ template(`<div style=z-index:2147483647>Enable to continue`);
|
|
8715
|
+
_tmpl$29 = /* @__PURE__ */ template(`<div data-react-grab-ignore-events data-react-grab-toolbar style=z-index:2147483647><div><div><div><div><div><div><button data-react-grab-ignore-events data-react-grab-toolbar-toggle></button></div></div><div><div><button data-react-grab-ignore-events data-react-grab-toolbar-comment></button></div></div><div><div><button data-react-grab-ignore-events data-react-grab-toolbar-history></button></div></div></div><div class="relative shrink-0 overflow-visible"><button data-react-grab-ignore-events data-react-grab-toolbar-enabled><div><div></div></div></button></div></div></div><button data-react-grab-ignore-events data-react-grab-toolbar-collapse class="contain-layout shrink-0 flex items-center justify-center cursor-pointer interactive-scale">`);
|
|
8580
8716
|
Toolbar = (props) => {
|
|
8581
8717
|
let containerRef;
|
|
8718
|
+
let expandableButtonsRef;
|
|
8582
8719
|
let unfreezeUpdatesCallback = null;
|
|
8720
|
+
let lastKnownExpandableWidth = 0;
|
|
8721
|
+
let lastKnownExpandableHeight = 0;
|
|
8722
|
+
const savedState = loadToolbarState();
|
|
8583
8723
|
const [isVisible, setIsVisible] = createSignal(false);
|
|
8584
8724
|
const [isCollapsed, setIsCollapsed] = createSignal(false);
|
|
8585
8725
|
const [isDragging, setIsDragging] = createSignal(false);
|
|
8586
8726
|
const [isSnapping, setIsSnapping] = createSignal(false);
|
|
8587
8727
|
const [isResizing, setIsResizing] = createSignal(false);
|
|
8588
|
-
const [snapEdge, setSnapEdge] = createSignal("bottom");
|
|
8589
|
-
const [positionRatio, setPositionRatio] = createSignal(0.5);
|
|
8728
|
+
const [snapEdge, setSnapEdge] = createSignal(savedState?.edge ?? "bottom");
|
|
8729
|
+
const [positionRatio, setPositionRatio] = createSignal(savedState?.ratio ?? 0.5);
|
|
8590
8730
|
const [position, setPosition] = createSignal({
|
|
8591
8731
|
x: 0,
|
|
8592
8732
|
y: 0
|
|
@@ -8606,30 +8746,81 @@ var init_toolbar = __esm({
|
|
|
8606
8746
|
const [isCommentTooltipVisible, setIsCommentTooltipVisible] = createSignal(false);
|
|
8607
8747
|
const [isToggleTooltipVisible, setIsToggleTooltipVisible] = createSignal(false);
|
|
8608
8748
|
const [isShakeTooltipVisible, setIsShakeTooltipVisible] = createSignal(false);
|
|
8609
|
-
const
|
|
8749
|
+
const [isToggleAnimating, setIsToggleAnimating] = createSignal(false);
|
|
8750
|
+
const [isRapidRetoggle, setIsRapidRetoggle] = createSignal(false);
|
|
8751
|
+
const [isHistoryTooltipVisible, setIsHistoryTooltipVisible] = createSignal(false);
|
|
8752
|
+
const historyTooltipLabel = () => {
|
|
8753
|
+
const count = props.historyItemCount ?? 0;
|
|
8754
|
+
return count > 0 ? `History (${count})` : "History";
|
|
8755
|
+
};
|
|
8756
|
+
const historyIconClass = () => cn("transition-colors", props.isHistoryPinned ? "text-black/80" : "text-[#B3B3B3]");
|
|
8757
|
+
const isVertical = () => snapEdge() === "left" || snapEdge() === "right";
|
|
8758
|
+
const measureExpandableDimension = () => {
|
|
8759
|
+
if (!expandableButtonsRef) return;
|
|
8760
|
+
const rect = expandableButtonsRef.getBoundingClientRect();
|
|
8761
|
+
if (isVertical()) {
|
|
8762
|
+
lastKnownExpandableHeight = rect.height;
|
|
8763
|
+
} else {
|
|
8764
|
+
lastKnownExpandableWidth = rect.width;
|
|
8765
|
+
}
|
|
8766
|
+
};
|
|
8767
|
+
const isTooltipAllowed = () => !isCollapsed() && !props.isHistoryDropdownOpen;
|
|
8768
|
+
const tooltipPosition = () => {
|
|
8769
|
+
const edge = snapEdge();
|
|
8770
|
+
switch (edge) {
|
|
8771
|
+
case "top":
|
|
8772
|
+
return "bottom";
|
|
8773
|
+
case "bottom":
|
|
8774
|
+
return "top";
|
|
8775
|
+
case "left":
|
|
8776
|
+
return "right";
|
|
8777
|
+
case "right":
|
|
8778
|
+
return "left";
|
|
8779
|
+
}
|
|
8780
|
+
};
|
|
8781
|
+
const expandGridClass = (isExpanded, collapsedExtra) => getExpandGridClass(isVertical(), isExpanded, collapsedExtra);
|
|
8782
|
+
const gridTransitionClass = () => isVertical() ? "transition-[grid-template-rows,opacity] duration-150 ease-out" : "transition-[grid-template-columns,opacity] duration-150 ease-out";
|
|
8783
|
+
const buttonSpacingClass = () => getButtonSpacingClass(isVertical());
|
|
8784
|
+
const minDimensionClass = () => getMinDimensionClass(isVertical());
|
|
8785
|
+
const shakeTooltipPositionClass = () => {
|
|
8786
|
+
const tooltipSide = tooltipPosition();
|
|
8787
|
+
if (isVertical()) {
|
|
8788
|
+
const placementClass2 = tooltipSide === "left" ? "right-full mr-0.5" : "left-full ml-0.5";
|
|
8789
|
+
return `top-1/2 -translate-y-1/2 ${placementClass2}`;
|
|
8790
|
+
}
|
|
8791
|
+
const placementClass = tooltipSide === "top" ? "bottom-full mb-0.5" : "top-full mt-0.5";
|
|
8792
|
+
return `left-1/2 -translate-x-1/2 ${placementClass}`;
|
|
8793
|
+
};
|
|
8610
8794
|
const stopEventPropagation = (event) => {
|
|
8611
8795
|
event.stopPropagation();
|
|
8612
8796
|
event.stopImmediatePropagation();
|
|
8613
8797
|
};
|
|
8614
|
-
const createFreezeHandlers = (setTooltipVisible) => ({
|
|
8798
|
+
const createFreezeHandlers = (setTooltipVisible, onHoverChange, options) => ({
|
|
8615
8799
|
onMouseEnter: () => {
|
|
8800
|
+
if (isDragging()) return;
|
|
8616
8801
|
setTooltipVisible(true);
|
|
8617
|
-
|
|
8618
|
-
|
|
8802
|
+
if (options?.shouldSetSelectHoverState !== false) {
|
|
8803
|
+
props.onSelectHoverChange?.(true);
|
|
8804
|
+
}
|
|
8805
|
+
if (options?.shouldFreezeInteractions !== false && !unfreezeUpdatesCallback) {
|
|
8619
8806
|
unfreezeUpdatesCallback = freezeUpdates();
|
|
8620
8807
|
freezeGlobalAnimations();
|
|
8621
8808
|
freezePseudoStates();
|
|
8622
8809
|
}
|
|
8810
|
+
onHoverChange?.(true);
|
|
8623
8811
|
},
|
|
8624
8812
|
onMouseLeave: () => {
|
|
8625
8813
|
setTooltipVisible(false);
|
|
8626
|
-
|
|
8627
|
-
|
|
8814
|
+
if (options?.shouldSetSelectHoverState !== false) {
|
|
8815
|
+
props.onSelectHoverChange?.(false);
|
|
8816
|
+
}
|
|
8817
|
+
if (options?.shouldFreezeInteractions !== false && !props.isActive && !props.isContextMenuOpen) {
|
|
8628
8818
|
unfreezeUpdatesCallback?.();
|
|
8629
8819
|
unfreezeUpdatesCallback = null;
|
|
8630
8820
|
unfreezeGlobalAnimations();
|
|
8631
8821
|
unfreezePseudoStates();
|
|
8632
8822
|
}
|
|
8823
|
+
onHoverChange?.(false);
|
|
8633
8824
|
}
|
|
8634
8825
|
});
|
|
8635
8826
|
const collapsedEdgeClasses = () => {
|
|
@@ -8641,7 +8832,7 @@ var init_toolbar = __esm({
|
|
|
8641
8832
|
left: "rounded-l-none rounded-r-[10px]",
|
|
8642
8833
|
right: "rounded-r-none rounded-l-[10px]"
|
|
8643
8834
|
}[edge];
|
|
8644
|
-
const paddingClass =
|
|
8835
|
+
const paddingClass = isVertical() ? "px-0.25 py-2" : "px-2 py-0.25";
|
|
8645
8836
|
return `${roundedClass} ${paddingClass}`;
|
|
8646
8837
|
};
|
|
8647
8838
|
let shakeTooltipTimeout;
|
|
@@ -8671,6 +8862,67 @@ var init_toolbar = __esm({
|
|
|
8671
8862
|
unfreezeUpdatesCallback = null;
|
|
8672
8863
|
}
|
|
8673
8864
|
}));
|
|
8865
|
+
const reclampToolbarToViewport = () => {
|
|
8866
|
+
if (!containerRef) return;
|
|
8867
|
+
const rect = containerRef.getBoundingClientRect();
|
|
8868
|
+
expandedDimensions = {
|
|
8869
|
+
width: rect.width,
|
|
8870
|
+
height: rect.height
|
|
8871
|
+
};
|
|
8872
|
+
const currentPos = position();
|
|
8873
|
+
const viewport = getVisualViewport();
|
|
8874
|
+
const edge = snapEdge();
|
|
8875
|
+
let clampedX = currentPos.x;
|
|
8876
|
+
let clampedY = currentPos.y;
|
|
8877
|
+
if (edge === "top" || edge === "bottom") {
|
|
8878
|
+
const minX = viewport.offsetLeft + TOOLBAR_SNAP_MARGIN_PX;
|
|
8879
|
+
const maxX = Math.max(minX, viewport.offsetLeft + viewport.width - rect.width - TOOLBAR_SNAP_MARGIN_PX);
|
|
8880
|
+
clampedX = clampToViewport2(currentPos.x, minX, maxX);
|
|
8881
|
+
clampedY = edge === "top" ? viewport.offsetTop + TOOLBAR_SNAP_MARGIN_PX : viewport.offsetTop + viewport.height - rect.height - TOOLBAR_SNAP_MARGIN_PX;
|
|
8882
|
+
} else {
|
|
8883
|
+
const minY = viewport.offsetTop + TOOLBAR_SNAP_MARGIN_PX;
|
|
8884
|
+
const maxY = Math.max(minY, viewport.offsetTop + viewport.height - rect.height - TOOLBAR_SNAP_MARGIN_PX);
|
|
8885
|
+
clampedY = clampToViewport2(currentPos.y, minY, maxY);
|
|
8886
|
+
clampedX = edge === "left" ? viewport.offsetLeft + TOOLBAR_SNAP_MARGIN_PX : viewport.offsetLeft + viewport.width - rect.width - TOOLBAR_SNAP_MARGIN_PX;
|
|
8887
|
+
}
|
|
8888
|
+
const newRatio = getRatioFromPosition(edge, clampedX, clampedY, rect.width, rect.height);
|
|
8889
|
+
setPositionRatio(newRatio);
|
|
8890
|
+
const didPositionChange = clampedX !== currentPos.x || clampedY !== currentPos.y;
|
|
8891
|
+
if (didPositionChange) {
|
|
8892
|
+
setIsCollapseAnimating(true);
|
|
8893
|
+
requestAnimationFrame(() => {
|
|
8894
|
+
requestAnimationFrame(() => {
|
|
8895
|
+
setPosition({
|
|
8896
|
+
x: clampedX,
|
|
8897
|
+
y: clampedY
|
|
8898
|
+
});
|
|
8899
|
+
if (collapseAnimationTimeout) {
|
|
8900
|
+
clearTimeout(collapseAnimationTimeout);
|
|
8901
|
+
}
|
|
8902
|
+
collapseAnimationTimeout = setTimeout(() => {
|
|
8903
|
+
setIsCollapseAnimating(false);
|
|
8904
|
+
}, TOOLBAR_COLLAPSE_ANIMATION_DURATION_MS);
|
|
8905
|
+
});
|
|
8906
|
+
});
|
|
8907
|
+
}
|
|
8908
|
+
};
|
|
8909
|
+
createEffect(on(() => props.historyItemCount ?? 0, () => {
|
|
8910
|
+
if (isCollapsed()) return;
|
|
8911
|
+
if (historyItemCountTimeout) {
|
|
8912
|
+
clearTimeout(historyItemCountTimeout);
|
|
8913
|
+
}
|
|
8914
|
+
historyItemCountTimeout = setTimeout(() => {
|
|
8915
|
+
measureExpandableDimension();
|
|
8916
|
+
reclampToolbarToViewport();
|
|
8917
|
+
}, TOOLBAR_COLLAPSE_ANIMATION_DURATION_MS);
|
|
8918
|
+
onCleanup(() => {
|
|
8919
|
+
if (historyItemCountTimeout) {
|
|
8920
|
+
clearTimeout(historyItemCountTimeout);
|
|
8921
|
+
}
|
|
8922
|
+
});
|
|
8923
|
+
}, {
|
|
8924
|
+
defer: true
|
|
8925
|
+
}));
|
|
8674
8926
|
let lastPointerPosition = {
|
|
8675
8927
|
x: 0,
|
|
8676
8928
|
y: 0,
|
|
@@ -8688,7 +8940,7 @@ var init_toolbar = __esm({
|
|
|
8688
8940
|
width: TOOLBAR_COLLAPSED_SHORT_PX,
|
|
8689
8941
|
height: TOOLBAR_COLLAPSED_SHORT_PX
|
|
8690
8942
|
});
|
|
8691
|
-
const
|
|
8943
|
+
const clampToViewport2 = (value, min, max) => Math.max(min, Math.min(value, max));
|
|
8692
8944
|
const getVisualViewport = () => {
|
|
8693
8945
|
const visualViewport = window.visualViewport;
|
|
8694
8946
|
if (visualViewport) {
|
|
@@ -8721,7 +8973,7 @@ var init_toolbar = __esm({
|
|
|
8721
8973
|
if (edge === "top" || edge === "bottom") {
|
|
8722
8974
|
const xOffset = (expandedWidth - actualCollapsedWidth) / 2;
|
|
8723
8975
|
const newExpandedX = collapsedPosition.x - xOffset;
|
|
8724
|
-
const clampedX =
|
|
8976
|
+
const clampedX = clampToViewport2(newExpandedX, viewport.offsetLeft + TOOLBAR_SNAP_MARGIN_PX, viewport.offsetLeft + viewportWidth - expandedWidth - TOOLBAR_SNAP_MARGIN_PX);
|
|
8725
8977
|
const newExpandedY = edge === "top" ? viewport.offsetTop + TOOLBAR_SNAP_MARGIN_PX : viewport.offsetTop + viewportHeight - expandedHeight - TOOLBAR_SNAP_MARGIN_PX;
|
|
8726
8978
|
newPosition = {
|
|
8727
8979
|
x: clampedX,
|
|
@@ -8730,7 +8982,7 @@ var init_toolbar = __esm({
|
|
|
8730
8982
|
} else {
|
|
8731
8983
|
const yOffset = (expandedHeight - actualCollapsedHeight) / 2;
|
|
8732
8984
|
const newExpandedY = collapsedPosition.y - yOffset;
|
|
8733
|
-
const clampedY =
|
|
8985
|
+
const clampedY = clampToViewport2(newExpandedY, viewport.offsetTop + TOOLBAR_SNAP_MARGIN_PX, viewport.offsetTop + viewportHeight - expandedHeight - TOOLBAR_SNAP_MARGIN_PX);
|
|
8734
8986
|
const newExpandedX = edge === "left" ? viewport.offsetLeft + TOOLBAR_SNAP_MARGIN_PX : viewport.offsetLeft + viewportWidth - expandedWidth - TOOLBAR_SNAP_MARGIN_PX;
|
|
8735
8987
|
newPosition = {
|
|
8736
8988
|
x: newExpandedX,
|
|
@@ -8797,6 +9049,7 @@ var init_toolbar = __esm({
|
|
|
8797
9049
|
};
|
|
8798
9050
|
const handleToggle = createDragAwareHandler(() => props.onToggle?.());
|
|
8799
9051
|
const handleComment = createDragAwareHandler(() => props.onComment?.());
|
|
9052
|
+
const handleHistory = createDragAwareHandler(() => props.onToggleHistory?.());
|
|
8800
9053
|
const handleToggleCollapse = createDragAwareHandler(() => {
|
|
8801
9054
|
const rect = containerRef?.getBoundingClientRect();
|
|
8802
9055
|
const wasCollapsed = isCollapsed();
|
|
@@ -8839,7 +9092,134 @@ var init_toolbar = __esm({
|
|
|
8839
9092
|
}
|
|
8840
9093
|
}, TOOLBAR_COLLAPSE_ANIMATION_DURATION_MS);
|
|
8841
9094
|
});
|
|
8842
|
-
const handleToggleEnabled = createDragAwareHandler(() =>
|
|
9095
|
+
const handleToggleEnabled = createDragAwareHandler(() => {
|
|
9096
|
+
const isCurrentlyEnabled = Boolean(props.enabled);
|
|
9097
|
+
const edge = snapEdge();
|
|
9098
|
+
const preTogglePosition = position();
|
|
9099
|
+
const isVerticalEdge = edge === "left" || edge === "right";
|
|
9100
|
+
const readExpandableDimension = () => isVerticalEdge ? lastKnownExpandableHeight : lastKnownExpandableWidth;
|
|
9101
|
+
if (isCurrentlyEnabled && expandableButtonsRef && !isToggleAnimating()) {
|
|
9102
|
+
measureExpandableDimension();
|
|
9103
|
+
}
|
|
9104
|
+
let expandableDimension = readExpandableDimension();
|
|
9105
|
+
let shouldCompensatePosition = expandableDimension > 0;
|
|
9106
|
+
let currentRenderedDimension = 0;
|
|
9107
|
+
if (expandableButtonsRef) {
|
|
9108
|
+
const expandableRect = expandableButtonsRef.getBoundingClientRect();
|
|
9109
|
+
currentRenderedDimension = isVerticalEdge ? expandableRect.height : expandableRect.width;
|
|
9110
|
+
}
|
|
9111
|
+
if (!isCurrentlyEnabled && expandableDimension === 0 && expandableButtonsRef) {
|
|
9112
|
+
const hasHistoryItems = (props.historyItemCount ?? 0) > 0;
|
|
9113
|
+
const expandedWrappers = Array.from(expandableButtonsRef.children).filter((child) => {
|
|
9114
|
+
if (!(child instanceof HTMLElement)) return false;
|
|
9115
|
+
const isHistoryGrid = child.classList.contains("pointer-events-none");
|
|
9116
|
+
return !(isHistoryGrid && !hasHistoryItems);
|
|
9117
|
+
});
|
|
9118
|
+
const gridProperty = isVerticalEdge ? "gridTemplateRows" : "gridTemplateColumns";
|
|
9119
|
+
for (const wrapper of expandedWrappers) {
|
|
9120
|
+
wrapper.style.transition = "none";
|
|
9121
|
+
wrapper.style[gridProperty] = "1fr";
|
|
9122
|
+
}
|
|
9123
|
+
void expandableButtonsRef.offsetWidth;
|
|
9124
|
+
measureExpandableDimension();
|
|
9125
|
+
expandableDimension = readExpandableDimension();
|
|
9126
|
+
for (const wrapper of expandedWrappers) {
|
|
9127
|
+
wrapper.style[gridProperty] = "";
|
|
9128
|
+
}
|
|
9129
|
+
void expandableButtonsRef.offsetWidth;
|
|
9130
|
+
for (const wrapper of expandedWrappers) {
|
|
9131
|
+
wrapper.style.transition = "";
|
|
9132
|
+
}
|
|
9133
|
+
shouldCompensatePosition = expandableDimension > 0;
|
|
9134
|
+
}
|
|
9135
|
+
if (shouldCompensatePosition) {
|
|
9136
|
+
setIsRapidRetoggle(isToggleAnimating());
|
|
9137
|
+
setIsToggleAnimating(true);
|
|
9138
|
+
}
|
|
9139
|
+
props.onToggleEnabled?.();
|
|
9140
|
+
if (shouldCompensatePosition) {
|
|
9141
|
+
const dimensionChange = isCurrentlyEnabled ? -expandableDimension : expandableDimension;
|
|
9142
|
+
if (isVerticalEdge) {
|
|
9143
|
+
expandedDimensions = {
|
|
9144
|
+
width: expandedDimensions.width,
|
|
9145
|
+
height: expandedDimensions.height + dimensionChange
|
|
9146
|
+
};
|
|
9147
|
+
} else {
|
|
9148
|
+
expandedDimensions = {
|
|
9149
|
+
width: expandedDimensions.width + dimensionChange,
|
|
9150
|
+
height: expandedDimensions.height
|
|
9151
|
+
};
|
|
9152
|
+
}
|
|
9153
|
+
const collapsedAxisPosition = isVerticalEdge ? preTogglePosition.y + currentRenderedDimension : preTogglePosition.x + currentRenderedDimension;
|
|
9154
|
+
const computeClampedPosition = (expandDimension) => {
|
|
9155
|
+
const viewport = getVisualViewport();
|
|
9156
|
+
const targetAxisPosition = collapsedAxisPosition - expandDimension;
|
|
9157
|
+
if (isVerticalEdge) {
|
|
9158
|
+
const clampMin2 = viewport.offsetTop + TOOLBAR_SNAP_MARGIN_PX;
|
|
9159
|
+
const clampMax2 = viewport.offsetTop + viewport.height - expandedDimensions.height - TOOLBAR_SNAP_MARGIN_PX;
|
|
9160
|
+
return {
|
|
9161
|
+
x: preTogglePosition.x,
|
|
9162
|
+
y: clampToViewport2(targetAxisPosition, clampMin2, clampMax2)
|
|
9163
|
+
};
|
|
9164
|
+
}
|
|
9165
|
+
const clampMin = viewport.offsetLeft + TOOLBAR_SNAP_MARGIN_PX;
|
|
9166
|
+
const clampMax = viewport.offsetLeft + viewport.width - expandedDimensions.width - TOOLBAR_SNAP_MARGIN_PX;
|
|
9167
|
+
return {
|
|
9168
|
+
x: clampToViewport2(targetAxisPosition, clampMin, clampMax),
|
|
9169
|
+
y: preTogglePosition.y
|
|
9170
|
+
};
|
|
9171
|
+
};
|
|
9172
|
+
if (toggleAnimationRafId !== void 0) {
|
|
9173
|
+
cancelAnimationFrame(toggleAnimationRafId);
|
|
9174
|
+
}
|
|
9175
|
+
if (isRapidRetoggle()) {
|
|
9176
|
+
const finalExpandDimension = isCurrentlyEnabled ? 0 : expandableDimension;
|
|
9177
|
+
setPosition(computeClampedPosition(finalExpandDimension));
|
|
9178
|
+
toggleAnimationRafId = void 0;
|
|
9179
|
+
} else {
|
|
9180
|
+
const animationStartTime = performance.now();
|
|
9181
|
+
const syncPositionWithGrid = () => {
|
|
9182
|
+
const elapsed = performance.now() - animationStartTime;
|
|
9183
|
+
if (elapsed > TOOLBAR_COLLAPSE_ANIMATION_DURATION_MS + TOGGLE_ANIMATION_BUFFER_MS) {
|
|
9184
|
+
toggleAnimationRafId = void 0;
|
|
9185
|
+
return;
|
|
9186
|
+
}
|
|
9187
|
+
if (expandableButtonsRef) {
|
|
9188
|
+
const currentExpandDimension = isVerticalEdge ? expandableButtonsRef.getBoundingClientRect().height : expandableButtonsRef.getBoundingClientRect().width;
|
|
9189
|
+
setPosition(computeClampedPosition(currentExpandDimension));
|
|
9190
|
+
}
|
|
9191
|
+
toggleAnimationRafId = requestAnimationFrame(syncPositionWithGrid);
|
|
9192
|
+
};
|
|
9193
|
+
toggleAnimationRafId = requestAnimationFrame(syncPositionWithGrid);
|
|
9194
|
+
}
|
|
9195
|
+
clearTimeout(toggleAnimationTimeout);
|
|
9196
|
+
toggleAnimationTimeout = setTimeout(() => {
|
|
9197
|
+
if (toggleAnimationRafId !== void 0) {
|
|
9198
|
+
cancelAnimationFrame(toggleAnimationRafId);
|
|
9199
|
+
toggleAnimationRafId = void 0;
|
|
9200
|
+
}
|
|
9201
|
+
const finalExpandDimension = isCurrentlyEnabled ? 0 : expandableDimension;
|
|
9202
|
+
setPosition(computeClampedPosition(finalExpandDimension));
|
|
9203
|
+
setIsToggleAnimating(false);
|
|
9204
|
+
setIsRapidRetoggle(false);
|
|
9205
|
+
const newRatio = getRatioFromPosition(edge, position().x, position().y, expandedDimensions.width, expandedDimensions.height);
|
|
9206
|
+
setPositionRatio(newRatio);
|
|
9207
|
+
saveAndNotify({
|
|
9208
|
+
edge,
|
|
9209
|
+
ratio: newRatio,
|
|
9210
|
+
collapsed: isCollapsed(),
|
|
9211
|
+
enabled: !isCurrentlyEnabled
|
|
9212
|
+
});
|
|
9213
|
+
}, TOOLBAR_COLLAPSE_ANIMATION_DURATION_MS);
|
|
9214
|
+
} else {
|
|
9215
|
+
saveAndNotify({
|
|
9216
|
+
edge,
|
|
9217
|
+
ratio: positionRatio(),
|
|
9218
|
+
collapsed: isCollapsed(),
|
|
9219
|
+
enabled: !isCurrentlyEnabled
|
|
9220
|
+
});
|
|
9221
|
+
}
|
|
9222
|
+
});
|
|
8843
9223
|
const getSnapPosition = (currentX, currentY, elementWidth, elementHeight, velocityX, velocityY) => {
|
|
8844
9224
|
const viewport = getVisualViewport();
|
|
8845
9225
|
const viewportWidth = viewport.width;
|
|
@@ -8883,6 +9263,12 @@ var init_toolbar = __esm({
|
|
|
8883
9263
|
const distanceMoved = Math.sqrt(Math.pow(event.clientX - pointerStartPosition.x, 2) + Math.pow(event.clientY - pointerStartPosition.y, 2));
|
|
8884
9264
|
if (distanceMoved > TOOLBAR_DRAG_THRESHOLD_PX) {
|
|
8885
9265
|
setHasDragMoved(true);
|
|
9266
|
+
if (unfreezeUpdatesCallback) {
|
|
9267
|
+
unfreezeUpdatesCallback();
|
|
9268
|
+
unfreezeUpdatesCallback = null;
|
|
9269
|
+
unfreezeGlobalAnimations();
|
|
9270
|
+
unfreezePseudoStates();
|
|
9271
|
+
}
|
|
8886
9272
|
}
|
|
8887
9273
|
if (!hasDragMoved()) return;
|
|
8888
9274
|
const now = performance.now();
|
|
@@ -8926,11 +9312,16 @@ var init_toolbar = __esm({
|
|
|
8926
9312
|
setPositionRatio(ratio);
|
|
8927
9313
|
setIsSnapping(true);
|
|
8928
9314
|
requestAnimationFrame(() => {
|
|
9315
|
+
const postRenderRect = containerRef?.getBoundingClientRect();
|
|
9316
|
+
if (postRenderRect) {
|
|
9317
|
+
expandedDimensions = {
|
|
9318
|
+
width: postRenderRect.width,
|
|
9319
|
+
height: postRenderRect.height
|
|
9320
|
+
};
|
|
9321
|
+
}
|
|
8929
9322
|
requestAnimationFrame(() => {
|
|
8930
|
-
|
|
8931
|
-
|
|
8932
|
-
y: snap.y
|
|
8933
|
-
});
|
|
9323
|
+
const snappedPosition = getPositionFromEdgeAndRatio(snap.edge, ratio, expandedDimensions.width, expandedDimensions.height);
|
|
9324
|
+
setPosition(snappedPosition);
|
|
8934
9325
|
saveAndNotify({
|
|
8935
9326
|
edge: snap.edge,
|
|
8936
9327
|
ratio,
|
|
@@ -8939,6 +9330,9 @@ var init_toolbar = __esm({
|
|
|
8939
9330
|
});
|
|
8940
9331
|
snapAnimationTimeout = setTimeout(() => {
|
|
8941
9332
|
setIsSnapping(false);
|
|
9333
|
+
if (props.enabled) {
|
|
9334
|
+
measureExpandableDimension();
|
|
9335
|
+
}
|
|
8942
9336
|
}, TOOLBAR_SNAP_ANIMATION_DURATION_MS);
|
|
8943
9337
|
});
|
|
8944
9338
|
});
|
|
@@ -8986,7 +9380,7 @@ var init_toolbar = __esm({
|
|
|
8986
9380
|
case "bottom": {
|
|
8987
9381
|
const xOffset = (expandedWidth - collapsedWidth) / 2;
|
|
8988
9382
|
const centeredX = pos.x + xOffset;
|
|
8989
|
-
const clampedX =
|
|
9383
|
+
const clampedX = clampToViewport2(centeredX, viewport.offsetLeft, viewport.offsetLeft + viewport.width - collapsedWidth);
|
|
8990
9384
|
return {
|
|
8991
9385
|
x: clampedX,
|
|
8992
9386
|
y: edge === "top" ? viewport.offsetTop : viewport.offsetTop + viewport.height - collapsedHeight
|
|
@@ -8996,7 +9390,7 @@ var init_toolbar = __esm({
|
|
|
8996
9390
|
case "right": {
|
|
8997
9391
|
const yOffset = (expandedHeight - collapsedHeight) / 2;
|
|
8998
9392
|
const centeredY = pos.y + yOffset;
|
|
8999
|
-
const clampedY =
|
|
9393
|
+
const clampedY = clampToViewport2(centeredY, viewport.offsetTop, viewport.offsetTop + viewport.height - collapsedHeight);
|
|
9000
9394
|
return {
|
|
9001
9395
|
x: edge === "left" ? viewport.offsetLeft : viewport.offsetLeft + viewport.width - collapsedWidth,
|
|
9002
9396
|
y: clampedY
|
|
@@ -9025,6 +9419,9 @@ var init_toolbar = __esm({
|
|
|
9025
9419
|
let resizeTimeout;
|
|
9026
9420
|
let collapseAnimationTimeout;
|
|
9027
9421
|
let snapAnimationTimeout;
|
|
9422
|
+
let toggleAnimationTimeout;
|
|
9423
|
+
let toggleAnimationRafId;
|
|
9424
|
+
let historyItemCountTimeout;
|
|
9028
9425
|
const handleResize = () => {
|
|
9029
9426
|
if (isDragging()) return;
|
|
9030
9427
|
setIsResizing(true);
|
|
@@ -9049,12 +9446,12 @@ var init_toolbar = __esm({
|
|
|
9049
9446
|
props.onStateChange?.(state);
|
|
9050
9447
|
};
|
|
9051
9448
|
onMount(() => {
|
|
9052
|
-
|
|
9449
|
+
if (containerRef) {
|
|
9450
|
+
props.onContainerRef?.(containerRef);
|
|
9451
|
+
}
|
|
9053
9452
|
const rect = containerRef?.getBoundingClientRect();
|
|
9054
9453
|
const viewport = getVisualViewport();
|
|
9055
9454
|
if (savedState) {
|
|
9056
|
-
setSnapEdge(savedState.edge);
|
|
9057
|
-
setPositionRatio(savedState.ratio);
|
|
9058
9455
|
if (rect) {
|
|
9059
9456
|
expandedDimensions = {
|
|
9060
9457
|
width: rect.width,
|
|
@@ -9085,9 +9482,12 @@ var init_toolbar = __esm({
|
|
|
9085
9482
|
const defaultPosition = getPositionFromEdgeAndRatio("bottom", 0.5, expandedDimensions.width, expandedDimensions.height);
|
|
9086
9483
|
setPosition(defaultPosition);
|
|
9087
9484
|
}
|
|
9485
|
+
if (props.enabled) {
|
|
9486
|
+
measureExpandableDimension();
|
|
9487
|
+
}
|
|
9088
9488
|
if (props.onSubscribeToStateChanges) {
|
|
9089
9489
|
const unsubscribe = props.onSubscribeToStateChanges((state) => {
|
|
9090
|
-
if (isCollapseAnimating()) return;
|
|
9490
|
+
if (isCollapseAnimating() || isToggleAnimating()) return;
|
|
9091
9491
|
const rect2 = containerRef?.getBoundingClientRect();
|
|
9092
9492
|
if (!rect2) return;
|
|
9093
9493
|
const didCollapsedChange = isCollapsed() !== state.collapsed;
|
|
@@ -9102,18 +9502,14 @@ var init_toolbar = __esm({
|
|
|
9102
9502
|
} = calculateExpandedPositionFromCollapsed(collapsedPos, state.edge);
|
|
9103
9503
|
setPosition(newPos);
|
|
9104
9504
|
setPositionRatio(newRatio);
|
|
9105
|
-
|
|
9106
|
-
clearTimeout(collapseAnimationTimeout);
|
|
9107
|
-
}
|
|
9505
|
+
clearTimeout(collapseAnimationTimeout);
|
|
9108
9506
|
collapseAnimationTimeout = setTimeout(() => {
|
|
9109
9507
|
setIsCollapseAnimating(false);
|
|
9110
9508
|
}, TOOLBAR_COLLAPSE_ANIMATION_DURATION_MS);
|
|
9111
9509
|
} else {
|
|
9112
9510
|
if (didCollapsedChange) {
|
|
9113
9511
|
setIsCollapseAnimating(true);
|
|
9114
|
-
|
|
9115
|
-
clearTimeout(collapseAnimationTimeout);
|
|
9116
|
-
}
|
|
9512
|
+
clearTimeout(collapseAnimationTimeout);
|
|
9117
9513
|
collapseAnimationTimeout = setTimeout(() => {
|
|
9118
9514
|
setIsCollapseAnimating(false);
|
|
9119
9515
|
}, TOOLBAR_COLLAPSE_ANIMATION_DURATION_MS);
|
|
@@ -9142,17 +9538,14 @@ var init_toolbar = __esm({
|
|
|
9142
9538
|
window.visualViewport?.removeEventListener("scroll", handleResize);
|
|
9143
9539
|
window.removeEventListener("pointermove", handleWindowPointerMove);
|
|
9144
9540
|
window.removeEventListener("pointerup", handleWindowPointerUp);
|
|
9145
|
-
|
|
9146
|
-
|
|
9147
|
-
|
|
9148
|
-
|
|
9149
|
-
|
|
9150
|
-
|
|
9151
|
-
if (
|
|
9152
|
-
|
|
9153
|
-
}
|
|
9154
|
-
if (snapAnimationTimeout) {
|
|
9155
|
-
clearTimeout(snapAnimationTimeout);
|
|
9541
|
+
clearTimeout(resizeTimeout);
|
|
9542
|
+
clearTimeout(collapseAnimationTimeout);
|
|
9543
|
+
clearTimeout(shakeTooltipTimeout);
|
|
9544
|
+
clearTimeout(snapAnimationTimeout);
|
|
9545
|
+
clearTimeout(toggleAnimationTimeout);
|
|
9546
|
+
clearTimeout(historyItemCountTimeout);
|
|
9547
|
+
if (toggleAnimationRafId !== void 0) {
|
|
9548
|
+
cancelAnimationFrame(toggleAnimationRafId);
|
|
9156
9549
|
}
|
|
9157
9550
|
unfreezeUpdatesCallback?.();
|
|
9158
9551
|
});
|
|
@@ -9179,6 +9572,9 @@ var init_toolbar = __esm({
|
|
|
9179
9572
|
if (isCollapseAnimating()) {
|
|
9180
9573
|
return "transition-[transform,opacity] duration-150 ease-out";
|
|
9181
9574
|
}
|
|
9575
|
+
if (isToggleAnimating()) {
|
|
9576
|
+
return "transition-opacity duration-150 ease-out";
|
|
9577
|
+
}
|
|
9182
9578
|
return "transition-opacity duration-300 ease-out";
|
|
9183
9579
|
};
|
|
9184
9580
|
const getTransformOrigin = () => {
|
|
@@ -9197,7 +9593,7 @@ var init_toolbar = __esm({
|
|
|
9197
9593
|
}
|
|
9198
9594
|
};
|
|
9199
9595
|
return (() => {
|
|
9200
|
-
var _el$ = _tmpl$
|
|
9596
|
+
var _el$ = _tmpl$29(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.firstChild, _el$8 = _el$7.firstChild, _el$9 = _el$6.nextSibling, _el$0 = _el$9.firstChild, _el$1 = _el$0.firstChild, _el$10 = _el$9.nextSibling, _el$11 = _el$10.firstChild, _el$12 = _el$11.firstChild, _el$13 = _el$5.nextSibling, _el$14 = _el$13.firstChild, _el$15 = _el$14.firstChild, _el$16 = _el$15.firstChild, _el$17 = _el$3.nextSibling;
|
|
9201
9597
|
_el$.$$pointerdown = handlePointerDown;
|
|
9202
9598
|
var _ref$ = containerRef;
|
|
9203
9599
|
typeof _ref$ === "function" ? use(_ref$, _el$) : containerRef = _el$;
|
|
@@ -9227,65 +9623,127 @@ var init_toolbar = __esm({
|
|
|
9227
9623
|
}
|
|
9228
9624
|
};
|
|
9229
9625
|
_el$2.addEventListener("animationend", () => setIsShaking(false));
|
|
9230
|
-
|
|
9626
|
+
var _ref$2 = expandableButtonsRef;
|
|
9627
|
+
typeof _ref$2 === "function" ? use(_ref$2, _el$5) : expandableButtonsRef = _el$5;
|
|
9628
|
+
_el$8.$$click = (event) => {
|
|
9231
9629
|
setIsSelectTooltipVisible(false);
|
|
9232
9630
|
handleToggle(event);
|
|
9233
9631
|
};
|
|
9234
|
-
addEventListener(_el$
|
|
9235
|
-
addEventListener(_el$
|
|
9632
|
+
addEventListener(_el$8, "mousedown", stopEventPropagation);
|
|
9633
|
+
addEventListener(_el$8, "pointerdown", (event) => {
|
|
9236
9634
|
stopEventPropagation(event);
|
|
9237
9635
|
handlePointerDown(event);
|
|
9238
9636
|
});
|
|
9239
|
-
spread(_el$
|
|
9240
|
-
|
|
9637
|
+
spread(_el$8, mergeProps({
|
|
9638
|
+
get ["class"]() {
|
|
9639
|
+
return cn("contain-layout flex items-center justify-center cursor-pointer interactive-scale touch-hitbox", buttonSpacingClass());
|
|
9640
|
+
}
|
|
9641
|
+
}, () => createFreezeHandlers(setIsSelectTooltipVisible)), false, true);
|
|
9642
|
+
insert(_el$8, createComponent(IconSelect, {
|
|
9241
9643
|
size: 14,
|
|
9242
9644
|
get ["class"]() {
|
|
9243
9645
|
return cn("transition-colors", getToolbarIconColor(Boolean(props.isActive) && !props.isCommentMode, Boolean(props.isCommentMode)));
|
|
9244
9646
|
}
|
|
9245
9647
|
}));
|
|
9246
|
-
insert(_el$
|
|
9648
|
+
insert(_el$7, createComponent(Tooltip, {
|
|
9247
9649
|
get visible() {
|
|
9248
|
-
return memo(() => !!isSelectTooltipVisible())() &&
|
|
9650
|
+
return memo(() => !!isSelectTooltipVisible())() && isTooltipAllowed();
|
|
9249
9651
|
},
|
|
9250
9652
|
get position() {
|
|
9251
9653
|
return tooltipPosition();
|
|
9252
9654
|
},
|
|
9253
|
-
children: "Select"
|
|
9655
|
+
children: "Select element"
|
|
9254
9656
|
}), null);
|
|
9255
|
-
_el$
|
|
9657
|
+
_el$1.$$click = (event) => {
|
|
9256
9658
|
setIsCommentTooltipVisible(false);
|
|
9257
9659
|
handleComment(event);
|
|
9258
9660
|
};
|
|
9259
|
-
addEventListener(_el$
|
|
9260
|
-
addEventListener(_el$
|
|
9661
|
+
addEventListener(_el$1, "mousedown", stopEventPropagation);
|
|
9662
|
+
addEventListener(_el$1, "pointerdown", (event) => {
|
|
9261
9663
|
stopEventPropagation(event);
|
|
9262
9664
|
handlePointerDown(event);
|
|
9263
9665
|
});
|
|
9264
|
-
spread(_el$
|
|
9265
|
-
|
|
9666
|
+
spread(_el$1, mergeProps({
|
|
9667
|
+
get ["class"]() {
|
|
9668
|
+
return cn("contain-layout flex items-center justify-center cursor-pointer interactive-scale touch-hitbox", buttonSpacingClass());
|
|
9669
|
+
}
|
|
9670
|
+
}, () => createFreezeHandlers(setIsCommentTooltipVisible)), false, true);
|
|
9671
|
+
insert(_el$1, createComponent(IconComment, {
|
|
9266
9672
|
size: 14,
|
|
9267
9673
|
get ["class"]() {
|
|
9268
9674
|
return cn("transition-colors", getToolbarIconColor(Boolean(props.isCommentMode), Boolean(props.isActive) && !props.isCommentMode));
|
|
9269
9675
|
}
|
|
9270
9676
|
}));
|
|
9271
|
-
insert(_el$
|
|
9677
|
+
insert(_el$0, createComponent(Tooltip, {
|
|
9678
|
+
get visible() {
|
|
9679
|
+
return memo(() => !!isCommentTooltipVisible())() && isTooltipAllowed();
|
|
9680
|
+
},
|
|
9681
|
+
get position() {
|
|
9682
|
+
return tooltipPosition();
|
|
9683
|
+
},
|
|
9684
|
+
children: "Add comment"
|
|
9685
|
+
}), null);
|
|
9686
|
+
_el$12.$$click = (event) => {
|
|
9687
|
+
setIsHistoryTooltipVisible(false);
|
|
9688
|
+
handleHistory(event);
|
|
9689
|
+
};
|
|
9690
|
+
addEventListener(_el$12, "mousedown", stopEventPropagation);
|
|
9691
|
+
addEventListener(_el$12, "pointerdown", (event) => {
|
|
9692
|
+
stopEventPropagation(event);
|
|
9693
|
+
handlePointerDown(event);
|
|
9694
|
+
});
|
|
9695
|
+
spread(_el$12, mergeProps({
|
|
9696
|
+
get ["class"]() {
|
|
9697
|
+
return cn("contain-layout flex items-center justify-center cursor-pointer interactive-scale touch-hitbox", buttonSpacingClass());
|
|
9698
|
+
}
|
|
9699
|
+
}, () => createFreezeHandlers((visible) => {
|
|
9700
|
+
if (visible && props.isHistoryDropdownOpen) return;
|
|
9701
|
+
setIsHistoryTooltipVisible(visible);
|
|
9702
|
+
}, (isHovered) => props.onHistoryButtonHover?.(isHovered), {
|
|
9703
|
+
shouldFreezeInteractions: false,
|
|
9704
|
+
shouldSetSelectHoverState: false
|
|
9705
|
+
})), false, true);
|
|
9706
|
+
insert(_el$12, createComponent(Show, {
|
|
9707
|
+
get when() {
|
|
9708
|
+
return props.hasUnreadHistoryItems;
|
|
9709
|
+
},
|
|
9710
|
+
get fallback() {
|
|
9711
|
+
return createComponent(IconInbox, {
|
|
9712
|
+
size: 14,
|
|
9713
|
+
get ["class"]() {
|
|
9714
|
+
return historyIconClass();
|
|
9715
|
+
}
|
|
9716
|
+
});
|
|
9717
|
+
},
|
|
9718
|
+
get children() {
|
|
9719
|
+
return createComponent(IconInboxUnread, {
|
|
9720
|
+
size: 14,
|
|
9721
|
+
get ["class"]() {
|
|
9722
|
+
return historyIconClass();
|
|
9723
|
+
}
|
|
9724
|
+
});
|
|
9725
|
+
}
|
|
9726
|
+
}));
|
|
9727
|
+
insert(_el$11, createComponent(Tooltip, {
|
|
9272
9728
|
get visible() {
|
|
9273
|
-
return memo(() => !!
|
|
9729
|
+
return memo(() => !!isHistoryTooltipVisible())() && isTooltipAllowed();
|
|
9274
9730
|
},
|
|
9275
9731
|
get position() {
|
|
9276
9732
|
return tooltipPosition();
|
|
9277
9733
|
},
|
|
9278
|
-
children
|
|
9734
|
+
get children() {
|
|
9735
|
+
return historyTooltipLabel();
|
|
9736
|
+
}
|
|
9279
9737
|
}), null);
|
|
9280
|
-
_el$
|
|
9281
|
-
_el$
|
|
9282
|
-
_el$
|
|
9738
|
+
_el$14.addEventListener("mouseleave", () => setIsToggleTooltipVisible(false));
|
|
9739
|
+
_el$14.addEventListener("mouseenter", () => setIsToggleTooltipVisible(true));
|
|
9740
|
+
_el$14.$$click = (event) => {
|
|
9283
9741
|
setIsToggleTooltipVisible(false);
|
|
9284
9742
|
handleToggleEnabled(event);
|
|
9285
9743
|
};
|
|
9286
|
-
insert(_el$
|
|
9744
|
+
insert(_el$13, createComponent(Tooltip, {
|
|
9287
9745
|
get visible() {
|
|
9288
|
-
return memo(() => !!isToggleTooltipVisible())() &&
|
|
9746
|
+
return memo(() => !!isToggleTooltipVisible())() && isTooltipAllowed();
|
|
9289
9747
|
},
|
|
9290
9748
|
get position() {
|
|
9291
9749
|
return tooltipPosition();
|
|
@@ -9294,8 +9752,9 @@ var init_toolbar = __esm({
|
|
|
9294
9752
|
return props.enabled ? "Disable" : "Enable";
|
|
9295
9753
|
}
|
|
9296
9754
|
}), null);
|
|
9297
|
-
addEventListener(_el$
|
|
9298
|
-
insert(_el$
|
|
9755
|
+
addEventListener(_el$17, "click", handleToggleCollapse, true);
|
|
9756
|
+
insert(_el$17, createComponent(IconChevron, {
|
|
9757
|
+
size: 14,
|
|
9299
9758
|
get ["class"]() {
|
|
9300
9759
|
return cn("text-[#B3B3B3] transition-transform duration-150", chevronRotation());
|
|
9301
9760
|
}
|
|
@@ -9305,23 +9764,30 @@ var init_toolbar = __esm({
|
|
|
9305
9764
|
return isShakeTooltipVisible();
|
|
9306
9765
|
},
|
|
9307
9766
|
get children() {
|
|
9308
|
-
var _el$
|
|
9309
|
-
createRenderEffect(() => className(_el$
|
|
9310
|
-
return _el$
|
|
9767
|
+
var _el$18 = _tmpl$28();
|
|
9768
|
+
createRenderEffect(() => className(_el$18, cn("absolute whitespace-nowrap px-1.5 py-0.5 rounded-[10px] text-[10px] text-black/60 pointer-events-none animate-tooltip-fade-in [corner-shape:superellipse(1.25)]", PANEL_STYLES, shakeTooltipPositionClass())));
|
|
9769
|
+
return _el$18;
|
|
9311
9770
|
}
|
|
9312
9771
|
}), null);
|
|
9313
9772
|
createRenderEffect((_p$) => {
|
|
9314
|
-
var _v$ = cn("fixed left-0 top-0 font-sans text-[13px] antialiased filter-[drop-shadow(0px_1px_2px_#51515140)] select-none", getCursorClass(), getTransitionClass(), isVisible() ? "opacity-100 pointer-events-auto" : "opacity-0 pointer-events-none"), _v$2 = `translate(${currentPosition().x}px, ${currentPosition().y}px)`, _v$3 = getTransformOrigin(), _v$4 = cn("flex items-center justify-center rounded-[10px] antialiased
|
|
9773
|
+
var _v$ = cn("fixed left-0 top-0 font-sans text-[13px] antialiased filter-[drop-shadow(0px_1px_2px_#51515140)] select-none", getCursorClass(), getTransitionClass(), isVisible() ? "opacity-100 pointer-events-auto" : "opacity-0 pointer-events-none"), _v$2 = `translate(${currentPosition().x}px, ${currentPosition().y}px)`, _v$3 = getTransformOrigin(), _v$4 = cn("flex items-center justify-center rounded-[10px] antialiased relative overflow-visible [font-synthesis:none] [corner-shape:superellipse(1.25)]", isVertical() && "flex-col", PANEL_STYLES, !isCollapsed() && (isVertical() ? "px-1.5 gap-1.5 py-2" : "py-1.5 gap-1.5 px-2"), collapsedEdgeClasses(), isShaking() && "animate-shake"), _v$5 = getTransformOrigin(), _v$6 = cn("grid", !isRapidRetoggle() && gridTransitionClass(), expandGridClass(!isCollapsed(), "pointer-events-none")), _v$7 = cn("flex", isVertical() ? "flex-col items-center min-h-0" : "items-center min-w-0"), _v$8 = cn("flex items-center", isVertical() && "flex-col"), _v$9 = cn("grid", !isRapidRetoggle() && gridTransitionClass(), expandGridClass(Boolean(props.enabled))), _v$0 = cn("relative overflow-visible", minDimensionClass()), _v$1 = cn("grid", !isRapidRetoggle() && gridTransitionClass(), expandGridClass(Boolean(props.enabled))), _v$10 = cn("relative overflow-visible", minDimensionClass()), _v$11 = cn("grid", !isRapidRetoggle() && gridTransitionClass(), expandGridClass(Boolean(props.enabled) && (props.historyItemCount ?? 0) > 0, "pointer-events-none")), _v$12 = cn("relative overflow-visible", minDimensionClass()), _v$13 = cn("contain-layout flex items-center justify-center cursor-pointer interactive-scale outline-none", isVertical() ? "my-0.5" : "mx-0.5"), _v$14 = cn("relative rounded-full transition-colors", isVertical() ? "w-3.5 h-2.5" : "w-5 h-3", props.enabled ? "bg-black" : "bg-black/25"), _v$15 = cn("absolute top-0.5 rounded-full bg-white transition-transform", isVertical() ? "w-1.5 h-1.5" : "w-2 h-2", !props.enabled && "left-0.5", props.enabled && (isVertical() ? "left-1.5" : "left-2.5"));
|
|
9315
9774
|
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
9316
9775
|
_v$2 !== _p$.t && setStyleProperty(_el$, "transform", _p$.t = _v$2);
|
|
9317
9776
|
_v$3 !== _p$.a && setStyleProperty(_el$, "transform-origin", _p$.a = _v$3);
|
|
9318
9777
|
_v$4 !== _p$.o && className(_el$2, _p$.o = _v$4);
|
|
9319
9778
|
_v$5 !== _p$.i && setStyleProperty(_el$2, "transform-origin", _p$.i = _v$5);
|
|
9320
9779
|
_v$6 !== _p$.n && className(_el$3, _p$.n = _v$6);
|
|
9321
|
-
_v$7 !== _p$.s && className(_el$
|
|
9322
|
-
_v$8 !== _p$.h && className(_el$
|
|
9323
|
-
_v$9 !== _p$.r && className(_el$
|
|
9324
|
-
_v$0 !== _p$.d && className(_el$
|
|
9780
|
+
_v$7 !== _p$.s && className(_el$4, _p$.s = _v$7);
|
|
9781
|
+
_v$8 !== _p$.h && className(_el$5, _p$.h = _v$8);
|
|
9782
|
+
_v$9 !== _p$.r && className(_el$6, _p$.r = _v$9);
|
|
9783
|
+
_v$0 !== _p$.d && className(_el$7, _p$.d = _v$0);
|
|
9784
|
+
_v$1 !== _p$.l && className(_el$9, _p$.l = _v$1);
|
|
9785
|
+
_v$10 !== _p$.u && className(_el$0, _p$.u = _v$10);
|
|
9786
|
+
_v$11 !== _p$.c && className(_el$10, _p$.c = _v$11);
|
|
9787
|
+
_v$12 !== _p$.w && className(_el$11, _p$.w = _v$12);
|
|
9788
|
+
_v$13 !== _p$.m && className(_el$14, _p$.m = _v$13);
|
|
9789
|
+
_v$14 !== _p$.f && className(_el$15, _p$.f = _v$14);
|
|
9790
|
+
_v$15 !== _p$.y && className(_el$16, _p$.y = _v$15);
|
|
9325
9791
|
return _p$;
|
|
9326
9792
|
}, {
|
|
9327
9793
|
e: void 0,
|
|
@@ -9333,7 +9799,14 @@ var init_toolbar = __esm({
|
|
|
9333
9799
|
s: void 0,
|
|
9334
9800
|
h: void 0,
|
|
9335
9801
|
r: void 0,
|
|
9336
|
-
d: void 0
|
|
9802
|
+
d: void 0,
|
|
9803
|
+
l: void 0,
|
|
9804
|
+
u: void 0,
|
|
9805
|
+
c: void 0,
|
|
9806
|
+
w: void 0,
|
|
9807
|
+
m: void 0,
|
|
9808
|
+
f: void 0,
|
|
9809
|
+
y: void 0
|
|
9337
9810
|
});
|
|
9338
9811
|
return _el$;
|
|
9339
9812
|
})();
|
|
@@ -9374,7 +9847,7 @@ var init_is_event_from_overlay = __esm({
|
|
|
9374
9847
|
});
|
|
9375
9848
|
|
|
9376
9849
|
// src/components/context-menu.tsx
|
|
9377
|
-
var _tmpl$
|
|
9850
|
+
var _tmpl$30, _tmpl$210, _tmpl$35, _tmpl$44, ContextMenu;
|
|
9378
9851
|
var init_context_menu = __esm({
|
|
9379
9852
|
"src/components/context-menu.tsx"() {
|
|
9380
9853
|
"use strict";
|
|
@@ -9397,8 +9870,8 @@ var init_context_menu = __esm({
|
|
|
9397
9870
|
init_get_tag_display();
|
|
9398
9871
|
init_resolve_action_enabled();
|
|
9399
9872
|
init_is_event_from_overlay();
|
|
9400
|
-
_tmpl$
|
|
9401
|
-
_tmpl$
|
|
9873
|
+
_tmpl$30 = /* @__PURE__ */ template(`<div class="flex flex-col w-[calc(100%+16px)] -mx-2 -my-1.5">`);
|
|
9874
|
+
_tmpl$210 = /* @__PURE__ */ template(`<div data-react-grab-ignore-events data-react-grab-context-menu class="fixed font-sans text-[13px] antialiased filter-[drop-shadow(0px_1px_2px_#51515140)] select-none transition-opacity duration-150 ease-out"style=z-index:2147483647;pointer-events:auto><div><div class="contain-layout shrink-0 flex items-center gap-1 pt-1.5 pb-1 w-fit h-fit px-2">`);
|
|
9402
9875
|
_tmpl$35 = /* @__PURE__ */ template(`<span class="text-[11px] font-sans text-black/50 ml-4">`);
|
|
9403
9876
|
_tmpl$44 = /* @__PURE__ */ template(`<button data-react-grab-ignore-events class="contain-layout flex items-center justify-between w-full px-2 py-1 cursor-pointer transition-colors hover:bg-black/5 text-left border-none bg-transparent disabled:opacity-40 disabled:cursor-default disabled:hover:bg-transparent"><span class="text-[13px] leading-4 font-sans font-medium text-black">`);
|
|
9404
9877
|
ContextMenu = (props) => {
|
|
@@ -9552,7 +10025,7 @@ var init_context_menu = __esm({
|
|
|
9552
10025
|
return isVisible();
|
|
9553
10026
|
},
|
|
9554
10027
|
get children() {
|
|
9555
|
-
var _el$ = _tmpl$
|
|
10028
|
+
var _el$ = _tmpl$210(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild;
|
|
9556
10029
|
_el$.$$contextmenu = handleMenuEvent;
|
|
9557
10030
|
_el$.$$click = handleMenuEvent;
|
|
9558
10031
|
_el$.$$mousedown = handleMenuEvent;
|
|
@@ -9592,7 +10065,7 @@ var init_context_menu = __esm({
|
|
|
9592
10065
|
}));
|
|
9593
10066
|
insert(_el$2, createComponent(BottomSection, {
|
|
9594
10067
|
get children() {
|
|
9595
|
-
var _el$4 = _tmpl$
|
|
10068
|
+
var _el$4 = _tmpl$30();
|
|
9596
10069
|
insert(_el$4, createComponent(For, {
|
|
9597
10070
|
get each() {
|
|
9598
10071
|
return menuItems();
|
|
@@ -9646,10 +10119,436 @@ var init_context_menu = __esm({
|
|
|
9646
10119
|
}
|
|
9647
10120
|
});
|
|
9648
10121
|
|
|
9649
|
-
// src/
|
|
9650
|
-
var
|
|
9651
|
-
var
|
|
9652
|
-
"src/
|
|
10122
|
+
// src/utils/clamp-to-viewport.ts
|
|
10123
|
+
var clampToViewport;
|
|
10124
|
+
var init_clamp_to_viewport = __esm({
|
|
10125
|
+
"src/utils/clamp-to-viewport.ts"() {
|
|
10126
|
+
"use strict";
|
|
10127
|
+
clampToViewport = (value, elementSize, viewportSize, padding) => Math.max(padding, Math.min(value, viewportSize - elementSize - padding));
|
|
10128
|
+
}
|
|
10129
|
+
});
|
|
10130
|
+
|
|
10131
|
+
// src/components/icons/icon-trash.tsx
|
|
10132
|
+
var _tmpl$31, IconTrash;
|
|
10133
|
+
var init_icon_trash = __esm({
|
|
10134
|
+
"src/components/icons/icon-trash.tsx"() {
|
|
10135
|
+
"use strict";
|
|
10136
|
+
init_web();
|
|
10137
|
+
init_web();
|
|
10138
|
+
init_web();
|
|
10139
|
+
_tmpl$31 = /* @__PURE__ */ template(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=currentColor><path fill-rule=evenodd clip-rule=evenodd d="M4.63751 20.1665L3.82444 6.75092L3.73431 5.06621C3.72513 4.89447 3.8619 4.75018 4.03388 4.75018H19.9945C20.1685 4.75018 20.306 4.89769 20.2938 5.07124L20.1756 6.75092L19.3625 20.1665C19.2745 21.618 18.0717 22.7502 16.6176 22.7502H7.38247C5.9283 22.7502 4.72548 21.618 4.63751 20.1665ZM8.74963 16.5002C8.74963 16.9144 9.08542 17.2502 9.49963 17.2502C9.91385 17.2502 10.2496 16.9144 10.2496 16.5002V10.5002C10.2496 10.086 9.91385 9.75018 9.49963 9.75018C9.08542 9.75018 8.74963 10.086 8.74963 10.5002V16.5002ZM14.4996 9.75018C14.9138 9.75018 15.2496 10.086 15.2496 10.5002V16.5002C15.2496 16.9144 14.9138 17.2502 14.4996 17.2502C14.0854 17.2502 13.7496 16.9144 13.7496 16.5002V10.5002C13.7496 10.086 14.0854 9.75018 14.4996 9.75018Z"></path><path fill-rule=evenodd clip-rule=evenodd d="M8.31879 2.46286C8.63394 1.7275 9.35702 1.2507 10.1571 1.2507H13.8383C14.6383 1.2507 15.3614 1.7275 15.6766 2.46286L16.6569 4.75034H19.2239C19.2903 4.75034 19.3523 4.75034 19.4102 4.7507H19.4637C19.4857 4.74973 19.5079 4.74972 19.5303 4.7507H20.9977C21.55 4.7507 21.9977 5.19842 21.9977 5.7507C21.9977 6.30299 21.55 6.7507 20.9977 6.7507H2.99768C2.4454 6.7507 1.99768 6.30299 1.99768 5.7507C1.99768 5.19842 2.4454 4.7507 2.99768 4.7507H4.46507C4.48746 4.74972 4.50968 4.74973 4.53167 4.7507H4.58469C4.6426 4.75034 4.70457 4.75034 4.77093 4.75034H7.33844L8.31879 2.46286ZM13.8903 3.37192L14.481 4.75034H9.5144L10.1052 3.37192C10.1367 3.29838 10.209 3.2507 10.289 3.2507L13.7064 3.2507C13.7864 3.2507 13.8587 3.29838 13.8903 3.37192Z">`);
|
|
10140
|
+
IconTrash = (props) => {
|
|
10141
|
+
const size = () => props.size ?? 14;
|
|
10142
|
+
return (() => {
|
|
10143
|
+
var _el$ = _tmpl$31();
|
|
10144
|
+
createRenderEffect((_p$) => {
|
|
10145
|
+
var _v$ = size(), _v$2 = size(), _v$3 = props.class;
|
|
10146
|
+
_v$ !== _p$.e && setAttribute(_el$, "width", _p$.e = _v$);
|
|
10147
|
+
_v$2 !== _p$.t && setAttribute(_el$, "height", _p$.t = _v$2);
|
|
10148
|
+
_v$3 !== _p$.a && setAttribute(_el$, "class", _p$.a = _v$3);
|
|
10149
|
+
return _p$;
|
|
10150
|
+
}, {
|
|
10151
|
+
e: void 0,
|
|
10152
|
+
t: void 0,
|
|
10153
|
+
a: void 0
|
|
10154
|
+
});
|
|
10155
|
+
return _el$;
|
|
10156
|
+
})();
|
|
10157
|
+
};
|
|
10158
|
+
}
|
|
10159
|
+
});
|
|
10160
|
+
|
|
10161
|
+
// src/components/icons/icon-copy.tsx
|
|
10162
|
+
var _tmpl$36, IconCopy;
|
|
10163
|
+
var init_icon_copy = __esm({
|
|
10164
|
+
"src/components/icons/icon-copy.tsx"() {
|
|
10165
|
+
"use strict";
|
|
10166
|
+
init_web();
|
|
10167
|
+
init_web();
|
|
10168
|
+
init_web();
|
|
10169
|
+
_tmpl$36 = /* @__PURE__ */ template(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=currentColor><path d="M16.0549 8.25C17.4225 8.24998 18.5248 8.24996 19.3918 8.36652C20.2919 8.48754 21.0497 8.74643 21.6517 9.34835C22.2536 9.95027 22.5125 10.7081 22.6335 11.6083C22.75 12.4752 22.75 13.5775 22.75 14.9451V14.9451V16.0549V16.0549C22.75 17.4225 22.75 18.5248 22.6335 19.3918C22.5125 20.2919 22.2536 21.0497 21.6517 21.6517C21.0497 22.2536 20.2919 22.5125 19.3918 22.6335C18.5248 22.75 17.4225 22.75 16.0549 22.75H16.0549H14.9451H14.9451C13.5775 22.75 12.4752 22.75 11.6082 22.6335C10.7081 22.5125 9.95027 22.2536 9.34835 21.6516C8.74643 21.0497 8.48754 20.2919 8.36652 19.3918C8.24996 18.5248 8.24998 17.4225 8.25 16.0549V16.0549V14.9451V14.9451C8.24998 13.5775 8.24996 12.4752 8.36652 11.6082C8.48754 10.7081 8.74643 9.95027 9.34835 9.34835C9.95027 8.74643 10.7081 8.48754 11.6083 8.36652C12.4752 8.24996 13.5775 8.24998 14.9451 8.25H14.9451H16.0549H16.0549Z"></path><path d="M6.75 14.8569C6.74991 13.5627 6.74983 12.3758 6.8799 11.4084C7.0232 10.3425 7.36034 9.21504 8.28769 8.28769C9.21504 7.36034 10.3425 7.0232 11.4084 6.8799C12.3758 6.74983 13.5627 6.74991 14.8569 6.75L17.0931 6.75C17.3891 6.75 17.5371 6.75 17.6261 6.65419C17.7151 6.55838 17.7045 6.4142 17.6833 6.12584C17.6648 5.87546 17.6412 5.63892 17.6111 5.41544C17.4818 4.45589 17.2232 3.6585 16.6718 2.98663C16.4744 2.74612 16.2539 2.52558 16.0134 2.3282C15.3044 1.74638 14.4557 1.49055 13.4248 1.36868C12.4205 1.24998 11.1512 1.24999 9.54893 1.25H9.45109C7.84883 1.24999 6.57947 1.24998 5.57525 1.36868C4.54428 1.49054 3.69558 1.74638 2.98663 2.3282C2.74612 2.52558 2.52558 2.74612 2.3282 2.98663C1.74638 3.69558 1.49055 4.54428 1.36868 5.57525C1.24998 6.57947 1.24999 7.84882 1.25 9.45108V9.54891C1.24999 11.1512 1.24998 12.4205 1.36868 13.4247C1.49054 14.4557 1.74638 15.3044 2.3282 16.0134C2.52558 16.2539 2.74612 16.4744 2.98663 16.6718C3.6585 17.2232 4.45589 17.4818 5.41544 17.6111C5.63892 17.6412 5.87546 17.6648 6.12584 17.6833C6.4142 17.7045 6.55838 17.7151 6.65419 17.6261C6.75 17.5371 6.75 17.3891 6.75 17.0931V14.8569Z">`);
|
|
10170
|
+
IconCopy = (props) => {
|
|
10171
|
+
const size = () => props.size ?? 14;
|
|
10172
|
+
return (() => {
|
|
10173
|
+
var _el$ = _tmpl$36();
|
|
10174
|
+
createRenderEffect((_p$) => {
|
|
10175
|
+
var _v$ = size(), _v$2 = size(), _v$3 = props.class;
|
|
10176
|
+
_v$ !== _p$.e && setAttribute(_el$, "width", _p$.e = _v$);
|
|
10177
|
+
_v$2 !== _p$.t && setAttribute(_el$, "height", _p$.t = _v$2);
|
|
10178
|
+
_v$3 !== _p$.a && setAttribute(_el$, "class", _p$.a = _v$3);
|
|
10179
|
+
return _p$;
|
|
10180
|
+
}, {
|
|
10181
|
+
e: void 0,
|
|
10182
|
+
t: void 0,
|
|
10183
|
+
a: void 0
|
|
10184
|
+
});
|
|
10185
|
+
return _el$;
|
|
10186
|
+
})();
|
|
10187
|
+
};
|
|
10188
|
+
}
|
|
10189
|
+
});
|
|
10190
|
+
|
|
10191
|
+
// src/components/history-dropdown.tsx
|
|
10192
|
+
var _tmpl$37, _tmpl$211, _tmpl$38, _tmpl$45, DEFAULT_OFFSCREEN_POSITION2, ITEM_ACTION_CLASS, EDGE_TO_TRANSFORM_ORIGIN, formatRelativeTime, HistoryDropdown;
|
|
10193
|
+
var init_history_dropdown = __esm({
|
|
10194
|
+
"src/components/history-dropdown.tsx"() {
|
|
10195
|
+
"use strict";
|
|
10196
|
+
init_web();
|
|
10197
|
+
init_web();
|
|
10198
|
+
init_web();
|
|
10199
|
+
init_web();
|
|
10200
|
+
init_web();
|
|
10201
|
+
init_web();
|
|
10202
|
+
init_web();
|
|
10203
|
+
init_web();
|
|
10204
|
+
init_web();
|
|
10205
|
+
init_solid();
|
|
10206
|
+
init_constants();
|
|
10207
|
+
init_clamp_to_viewport();
|
|
10208
|
+
init_cn();
|
|
10209
|
+
init_icon_trash();
|
|
10210
|
+
init_icon_copy();
|
|
10211
|
+
init_icon_check();
|
|
10212
|
+
init_tooltip();
|
|
10213
|
+
_tmpl$37 = /* @__PURE__ */ template(`<div class="flex items-center gap-[5px]"><div class=relative><button data-react-grab-ignore-events data-react-grab-history-clear class="contain-layout shrink-0 flex items-center justify-center px-[3px] py-px rounded-sm bg-[#FEF2F2] cursor-pointer transition-all hover:bg-[#FEE2E2] press-scale h-[17px] text-[#B91C1C]"></button></div><div class=relative><button data-react-grab-ignore-events data-react-grab-history-copy-all class="contain-layout shrink-0 flex items-center justify-center gap-1 px-[3px] py-px rounded-sm bg-white [border-width:0.5px] border-solid border-[#B3B3B3] cursor-pointer transition-all hover:bg-[#F5F5F5] press-scale h-[17px] text-black/60">`);
|
|
10214
|
+
_tmpl$211 = /* @__PURE__ */ template(`<div data-react-grab-ignore-events data-react-grab-history-dropdown class="fixed font-sans text-[13px] antialiased filter-[drop-shadow(0px_1px_2px_#51515140)] select-none transition-[opacity,transform] duration-100 ease-out will-change-[opacity,transform]"style=z-index:2147483647><div><div class="contain-layout shrink-0 flex items-center justify-between px-2 pt-1.5 pb-1"><span class="text-[11px] font-medium text-black/40">History</span></div><div class="min-h-0 [border-top-width:0.5px] border-t-solid border-t-[#D9D9D9] px-2 py-1.5"><div class="flex flex-col max-h-[240px] overflow-y-auto -mx-2 -my-1.5"style="scrollbar-color:rgba(0,0,0,0.15) transparent">`);
|
|
10215
|
+
_tmpl$38 = /* @__PURE__ */ template(`<span class="text-[11px] leading-3 font-sans text-black/40 truncate mt-0.5">`);
|
|
10216
|
+
_tmpl$45 = /* @__PURE__ */ template(`<div data-react-grab-ignore-events data-react-grab-history-item class="group contain-layout flex items-start justify-between w-full px-2 py-1 cursor-pointer hover:bg-black/5 focus-within:bg-black/5 text-left gap-2"tabindex=0><span class="flex flex-col min-w-0 flex-1"><span class="text-[12px] leading-4 font-sans font-medium text-black truncate"></span></span><span class="shrink-0 grid"><span class="text-[10px] font-sans text-black/25 group-hover:invisible group-focus-within:invisible [grid-area:1/1] flex items-center justify-end"></span><span class="invisible group-hover:visible group-focus-within:visible [grid-area:1/1] flex items-center justify-end gap-1.5"><button data-react-grab-ignore-events data-react-grab-history-item-remove></button><button data-react-grab-ignore-events data-react-grab-history-item-copy>`);
|
|
10217
|
+
DEFAULT_OFFSCREEN_POSITION2 = {
|
|
10218
|
+
left: -9999,
|
|
10219
|
+
top: -9999
|
|
10220
|
+
};
|
|
10221
|
+
ITEM_ACTION_CLASS = "flex items-center justify-center cursor-pointer text-black/25 transition-colors press-scale";
|
|
10222
|
+
EDGE_TO_TRANSFORM_ORIGIN = {
|
|
10223
|
+
left: "left center",
|
|
10224
|
+
right: "right center",
|
|
10225
|
+
top: "center top",
|
|
10226
|
+
bottom: "center bottom"
|
|
10227
|
+
};
|
|
10228
|
+
formatRelativeTime = (timestamp) => {
|
|
10229
|
+
const elapsedSeconds = Math.floor((Date.now() - timestamp) / 1e3);
|
|
10230
|
+
if (elapsedSeconds < 60) return "now";
|
|
10231
|
+
const elapsedMinutes = Math.floor(elapsedSeconds / 60);
|
|
10232
|
+
if (elapsedMinutes < 60) return `${elapsedMinutes}m`;
|
|
10233
|
+
const elapsedHours = Math.floor(elapsedMinutes / 60);
|
|
10234
|
+
if (elapsedHours < 24) return `${elapsedHours}h`;
|
|
10235
|
+
return `${Math.floor(elapsedHours / 24)}d`;
|
|
10236
|
+
};
|
|
10237
|
+
HistoryDropdown = (props) => {
|
|
10238
|
+
let containerRef;
|
|
10239
|
+
const [measuredWidth, setMeasuredWidth] = createSignal(0);
|
|
10240
|
+
const [measuredHeight, setMeasuredHeight] = createSignal(0);
|
|
10241
|
+
const [activeHeaderTooltip, setActiveHeaderTooltip] = createSignal(null);
|
|
10242
|
+
const [isCopyAllConfirmed, setIsCopyAllConfirmed] = createSignal(false);
|
|
10243
|
+
const [confirmedCopyItemId, setConfirmedCopyItemId] = createSignal(null);
|
|
10244
|
+
let copyAllFeedbackTimeout;
|
|
10245
|
+
let copyItemFeedbackTimeout;
|
|
10246
|
+
let exitAnimationTimeout;
|
|
10247
|
+
let enterAnimationFrameId;
|
|
10248
|
+
const isVisible = () => props.position !== null;
|
|
10249
|
+
const [shouldMount, setShouldMount] = createSignal(false);
|
|
10250
|
+
const [isAnimatedIn, setIsAnimatedIn] = createSignal(false);
|
|
10251
|
+
const [lastAnchorEdge, setLastAnchorEdge] = createSignal("bottom");
|
|
10252
|
+
const measureContainer = () => {
|
|
10253
|
+
if (containerRef) {
|
|
10254
|
+
setMeasuredWidth(containerRef.offsetWidth);
|
|
10255
|
+
setMeasuredHeight(containerRef.offsetHeight);
|
|
10256
|
+
}
|
|
10257
|
+
};
|
|
10258
|
+
createEffect(() => {
|
|
10259
|
+
if (isVisible()) {
|
|
10260
|
+
if (props.position) setLastAnchorEdge(props.position.edge);
|
|
10261
|
+
clearTimeout(exitAnimationTimeout);
|
|
10262
|
+
setShouldMount(true);
|
|
10263
|
+
if (enterAnimationFrameId !== void 0) cancelAnimationFrame(enterAnimationFrameId);
|
|
10264
|
+
enterAnimationFrameId = requestAnimationFrame(() => {
|
|
10265
|
+
measureContainer();
|
|
10266
|
+
void containerRef?.offsetHeight;
|
|
10267
|
+
setIsAnimatedIn(true);
|
|
10268
|
+
});
|
|
10269
|
+
} else {
|
|
10270
|
+
if (enterAnimationFrameId !== void 0) cancelAnimationFrame(enterAnimationFrameId);
|
|
10271
|
+
setIsAnimatedIn(false);
|
|
10272
|
+
exitAnimationTimeout = setTimeout(() => {
|
|
10273
|
+
setShouldMount(false);
|
|
10274
|
+
}, DROPDOWN_ANIMATION_DURATION_MS);
|
|
10275
|
+
}
|
|
10276
|
+
});
|
|
10277
|
+
createEffect(on(isAnimatedIn, (animatedIn) => {
|
|
10278
|
+
if (animatedIn && containerRef?.matches(":hover")) {
|
|
10279
|
+
props.onDropdownHover?.(true);
|
|
10280
|
+
}
|
|
10281
|
+
}, {
|
|
10282
|
+
defer: true
|
|
10283
|
+
}));
|
|
10284
|
+
const computedPosition = () => {
|
|
10285
|
+
const anchor = props.position;
|
|
10286
|
+
const width = measuredWidth();
|
|
10287
|
+
const height = measuredHeight();
|
|
10288
|
+
if (!anchor || width === 0 || height === 0) {
|
|
10289
|
+
return DEFAULT_OFFSCREEN_POSITION2;
|
|
10290
|
+
}
|
|
10291
|
+
const {
|
|
10292
|
+
edge
|
|
10293
|
+
} = anchor;
|
|
10294
|
+
let rawLeft;
|
|
10295
|
+
let rawTop;
|
|
10296
|
+
if (edge === "left" || edge === "right") {
|
|
10297
|
+
rawLeft = edge === "left" ? anchor.x + DROPDOWN_ANCHOR_GAP_PX : anchor.x - width - DROPDOWN_ANCHOR_GAP_PX;
|
|
10298
|
+
rawTop = anchor.y - height / 2;
|
|
10299
|
+
} else {
|
|
10300
|
+
rawLeft = anchor.x - width / 2;
|
|
10301
|
+
rawTop = edge === "top" ? anchor.y + DROPDOWN_ANCHOR_GAP_PX : anchor.y - height - DROPDOWN_ANCHOR_GAP_PX;
|
|
10302
|
+
}
|
|
10303
|
+
return {
|
|
10304
|
+
left: clampToViewport(rawLeft, width, window.innerWidth, DROPDOWN_VIEWPORT_PADDING_PX),
|
|
10305
|
+
top: clampToViewport(rawTop, height, window.innerHeight, DROPDOWN_VIEWPORT_PADDING_PX)
|
|
10306
|
+
};
|
|
10307
|
+
};
|
|
10308
|
+
const displayPosition = createMemo((previousPosition) => {
|
|
10309
|
+
const position = computedPosition();
|
|
10310
|
+
if (position.left !== DEFAULT_OFFSCREEN_POSITION2.left) {
|
|
10311
|
+
return position;
|
|
10312
|
+
}
|
|
10313
|
+
return previousPosition;
|
|
10314
|
+
}, DEFAULT_OFFSCREEN_POSITION2);
|
|
10315
|
+
const clampedMaxWidth = () => Math.min(DROPDOWN_MAX_WIDTH_PX, window.innerWidth - displayPosition().left - DROPDOWN_VIEWPORT_PADDING_PX);
|
|
10316
|
+
const clampedMaxHeight = () => window.innerHeight - displayPosition().top - DROPDOWN_VIEWPORT_PADDING_PX;
|
|
10317
|
+
const panelMinWidth = () => Math.max(DROPDOWN_MIN_WIDTH_PX, props.position?.toolbarWidth ?? 0);
|
|
10318
|
+
const handleMenuEvent = (event) => {
|
|
10319
|
+
if (event.type === "contextmenu") {
|
|
10320
|
+
event.preventDefault();
|
|
10321
|
+
}
|
|
10322
|
+
event.stopImmediatePropagation();
|
|
10323
|
+
};
|
|
10324
|
+
onMount(() => {
|
|
10325
|
+
measureContainer();
|
|
10326
|
+
const handleKeyDown = (event) => {
|
|
10327
|
+
if (!isVisible()) return;
|
|
10328
|
+
if (event.code === "Escape") {
|
|
10329
|
+
event.preventDefault();
|
|
10330
|
+
event.stopPropagation();
|
|
10331
|
+
props.onDismiss?.();
|
|
10332
|
+
}
|
|
10333
|
+
};
|
|
10334
|
+
window.addEventListener("keydown", handleKeyDown, {
|
|
10335
|
+
capture: true
|
|
10336
|
+
});
|
|
10337
|
+
onCleanup(() => {
|
|
10338
|
+
clearTimeout(copyAllFeedbackTimeout);
|
|
10339
|
+
clearTimeout(copyItemFeedbackTimeout);
|
|
10340
|
+
clearTimeout(exitAnimationTimeout);
|
|
10341
|
+
if (enterAnimationFrameId !== void 0) cancelAnimationFrame(enterAnimationFrameId);
|
|
10342
|
+
window.removeEventListener("keydown", handleKeyDown, {
|
|
10343
|
+
capture: true
|
|
10344
|
+
});
|
|
10345
|
+
});
|
|
10346
|
+
});
|
|
10347
|
+
return createComponent(Show, {
|
|
10348
|
+
get when() {
|
|
10349
|
+
return shouldMount();
|
|
10350
|
+
},
|
|
10351
|
+
get children() {
|
|
10352
|
+
var _el$ = _tmpl$211(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$0 = _el$3.nextSibling, _el$1 = _el$0.firstChild;
|
|
10353
|
+
_el$.addEventListener("mouseleave", () => props.onDropdownHover?.(false));
|
|
10354
|
+
_el$.addEventListener("mouseenter", () => props.onDropdownHover?.(true));
|
|
10355
|
+
_el$.$$contextmenu = handleMenuEvent;
|
|
10356
|
+
_el$.$$click = handleMenuEvent;
|
|
10357
|
+
_el$.$$mousedown = handleMenuEvent;
|
|
10358
|
+
_el$.$$pointerdown = handleMenuEvent;
|
|
10359
|
+
var _ref$ = containerRef;
|
|
10360
|
+
typeof _ref$ === "function" ? use(_ref$, _el$) : containerRef = _el$;
|
|
10361
|
+
insert(_el$3, createComponent(Show, {
|
|
10362
|
+
get when() {
|
|
10363
|
+
return props.items.length > 0;
|
|
10364
|
+
},
|
|
10365
|
+
get children() {
|
|
10366
|
+
var _el$5 = _tmpl$37(), _el$6 = _el$5.firstChild, _el$7 = _el$6.firstChild, _el$8 = _el$6.nextSibling, _el$9 = _el$8.firstChild;
|
|
10367
|
+
_el$7.addEventListener("mouseleave", () => setActiveHeaderTooltip(null));
|
|
10368
|
+
_el$7.addEventListener("mouseenter", () => setActiveHeaderTooltip("clear"));
|
|
10369
|
+
_el$7.$$click = (event) => {
|
|
10370
|
+
event.stopPropagation();
|
|
10371
|
+
setActiveHeaderTooltip(null);
|
|
10372
|
+
props.onClearAll?.();
|
|
10373
|
+
};
|
|
10374
|
+
insert(_el$7, createComponent(IconTrash, {
|
|
10375
|
+
size: DROPDOWN_ICON_SIZE_PX
|
|
10376
|
+
}));
|
|
10377
|
+
insert(_el$6, createComponent(Tooltip, {
|
|
10378
|
+
get visible() {
|
|
10379
|
+
return activeHeaderTooltip() === "clear";
|
|
10380
|
+
},
|
|
10381
|
+
position: "top",
|
|
10382
|
+
children: "Clear all"
|
|
10383
|
+
}), null);
|
|
10384
|
+
_el$9.addEventListener("mouseleave", () => {
|
|
10385
|
+
setActiveHeaderTooltip(null);
|
|
10386
|
+
props.onCopyAllHover?.(false);
|
|
10387
|
+
});
|
|
10388
|
+
_el$9.addEventListener("mouseenter", () => {
|
|
10389
|
+
setActiveHeaderTooltip("copy");
|
|
10390
|
+
if (!isCopyAllConfirmed()) {
|
|
10391
|
+
props.onCopyAllHover?.(true);
|
|
10392
|
+
}
|
|
10393
|
+
});
|
|
10394
|
+
_el$9.$$click = (event) => {
|
|
10395
|
+
event.stopPropagation();
|
|
10396
|
+
setActiveHeaderTooltip(null);
|
|
10397
|
+
props.onCopyAll?.();
|
|
10398
|
+
setIsCopyAllConfirmed(true);
|
|
10399
|
+
clearTimeout(copyAllFeedbackTimeout);
|
|
10400
|
+
copyAllFeedbackTimeout = setTimeout(() => {
|
|
10401
|
+
setIsCopyAllConfirmed(false);
|
|
10402
|
+
}, FEEDBACK_DURATION_MS);
|
|
10403
|
+
};
|
|
10404
|
+
insert(_el$9, createComponent(Show, {
|
|
10405
|
+
get when() {
|
|
10406
|
+
return isCopyAllConfirmed();
|
|
10407
|
+
},
|
|
10408
|
+
get fallback() {
|
|
10409
|
+
return createComponent(IconCopy, {
|
|
10410
|
+
size: DROPDOWN_ICON_SIZE_PX
|
|
10411
|
+
});
|
|
10412
|
+
},
|
|
10413
|
+
get children() {
|
|
10414
|
+
return createComponent(IconCheck, {
|
|
10415
|
+
size: DROPDOWN_ICON_SIZE_PX,
|
|
10416
|
+
"class": "text-black"
|
|
10417
|
+
});
|
|
10418
|
+
}
|
|
10419
|
+
}));
|
|
10420
|
+
insert(_el$8, createComponent(Tooltip, {
|
|
10421
|
+
get visible() {
|
|
10422
|
+
return activeHeaderTooltip() === "copy";
|
|
10423
|
+
},
|
|
10424
|
+
position: "top",
|
|
10425
|
+
children: "Copy all"
|
|
10426
|
+
}), null);
|
|
10427
|
+
return _el$5;
|
|
10428
|
+
}
|
|
10429
|
+
}), null);
|
|
10430
|
+
insert(_el$1, createComponent(For, {
|
|
10431
|
+
get each() {
|
|
10432
|
+
return props.items;
|
|
10433
|
+
},
|
|
10434
|
+
children: (item) => (() => {
|
|
10435
|
+
var _el$10 = _tmpl$45(), _el$11 = _el$10.firstChild, _el$12 = _el$11.firstChild, _el$14 = _el$11.nextSibling, _el$15 = _el$14.firstChild, _el$16 = _el$15.nextSibling, _el$17 = _el$16.firstChild, _el$18 = _el$17.nextSibling;
|
|
10436
|
+
_el$10.addEventListener("mouseleave", () => props.onItemHover?.(null));
|
|
10437
|
+
_el$10.addEventListener("mouseenter", () => props.onItemHover?.(item.id));
|
|
10438
|
+
_el$10.$$keydown = (event) => {
|
|
10439
|
+
if (event.code === "Space" && event.currentTarget === event.target) {
|
|
10440
|
+
event.preventDefault();
|
|
10441
|
+
event.stopPropagation();
|
|
10442
|
+
props.onSelectItem?.(item);
|
|
10443
|
+
}
|
|
10444
|
+
};
|
|
10445
|
+
_el$10.$$click = (event) => {
|
|
10446
|
+
event.stopPropagation();
|
|
10447
|
+
props.onSelectItem?.(item);
|
|
10448
|
+
setConfirmedCopyItemId(item.id);
|
|
10449
|
+
clearTimeout(copyItemFeedbackTimeout);
|
|
10450
|
+
copyItemFeedbackTimeout = setTimeout(() => {
|
|
10451
|
+
setConfirmedCopyItemId(null);
|
|
10452
|
+
}, FEEDBACK_DURATION_MS);
|
|
10453
|
+
};
|
|
10454
|
+
_el$10.$$pointerdown = (event) => event.stopPropagation();
|
|
10455
|
+
insert(_el$12, () => item.componentName ?? item.tagName);
|
|
10456
|
+
insert(_el$11, createComponent(Show, {
|
|
10457
|
+
get when() {
|
|
10458
|
+
return item.commentText;
|
|
10459
|
+
},
|
|
10460
|
+
get children() {
|
|
10461
|
+
var _el$13 = _tmpl$38();
|
|
10462
|
+
insert(_el$13, () => item.commentText);
|
|
10463
|
+
return _el$13;
|
|
10464
|
+
}
|
|
10465
|
+
}), null);
|
|
10466
|
+
insert(_el$15, () => formatRelativeTime(item.timestamp));
|
|
10467
|
+
_el$17.$$click = (event) => {
|
|
10468
|
+
event.stopPropagation();
|
|
10469
|
+
props.onRemoveItem?.(item);
|
|
10470
|
+
};
|
|
10471
|
+
insert(_el$17, createComponent(IconTrash, {
|
|
10472
|
+
size: DROPDOWN_ICON_SIZE_PX
|
|
10473
|
+
}));
|
|
10474
|
+
_el$18.$$click = (event) => {
|
|
10475
|
+
event.stopPropagation();
|
|
10476
|
+
props.onCopyItem?.(item);
|
|
10477
|
+
setConfirmedCopyItemId(item.id);
|
|
10478
|
+
clearTimeout(copyItemFeedbackTimeout);
|
|
10479
|
+
copyItemFeedbackTimeout = setTimeout(() => {
|
|
10480
|
+
setConfirmedCopyItemId(null);
|
|
10481
|
+
}, FEEDBACK_DURATION_MS);
|
|
10482
|
+
};
|
|
10483
|
+
insert(_el$18, createComponent(Show, {
|
|
10484
|
+
get when() {
|
|
10485
|
+
return confirmedCopyItemId() === item.id;
|
|
10486
|
+
},
|
|
10487
|
+
get fallback() {
|
|
10488
|
+
return createComponent(IconCopy, {
|
|
10489
|
+
size: DROPDOWN_ICON_SIZE_PX
|
|
10490
|
+
});
|
|
10491
|
+
},
|
|
10492
|
+
get children() {
|
|
10493
|
+
return createComponent(IconCheck, {
|
|
10494
|
+
size: DROPDOWN_ICON_SIZE_PX,
|
|
10495
|
+
"class": "text-black"
|
|
10496
|
+
});
|
|
10497
|
+
}
|
|
10498
|
+
}));
|
|
10499
|
+
createRenderEffect((_p$) => {
|
|
10500
|
+
var _v$1 = {
|
|
10501
|
+
"opacity-40 hover:opacity-100": Boolean(props.disconnectedItemIds?.has(item.id))
|
|
10502
|
+
}, _v$10 = cn(ITEM_ACTION_CLASS, "hover:text-[#B91C1C]"), _v$11 = cn(ITEM_ACTION_CLASS, "hover:text-black/60");
|
|
10503
|
+
_p$.e = classList(_el$10, _v$1, _p$.e);
|
|
10504
|
+
_v$10 !== _p$.t && className(_el$17, _p$.t = _v$10);
|
|
10505
|
+
_v$11 !== _p$.a && className(_el$18, _p$.a = _v$11);
|
|
10506
|
+
return _p$;
|
|
10507
|
+
}, {
|
|
10508
|
+
e: void 0,
|
|
10509
|
+
t: void 0,
|
|
10510
|
+
a: void 0
|
|
10511
|
+
});
|
|
10512
|
+
return _el$10;
|
|
10513
|
+
})()
|
|
10514
|
+
}));
|
|
10515
|
+
createRenderEffect((_p$) => {
|
|
10516
|
+
var _v$ = `${displayPosition().top}px`, _v$2 = `${displayPosition().left}px`, _v$3 = isAnimatedIn() ? "auto" : "none", _v$4 = EDGE_TO_TRANSFORM_ORIGIN[lastAnchorEdge()], _v$5 = isAnimatedIn() ? "1" : "0", _v$6 = isAnimatedIn() ? "scale(1)" : "scale(0.95)", _v$7 = cn("contain-layout flex flex-col rounded-[10px] antialiased w-fit h-fit overflow-hidden [font-synthesis:none] [corner-shape:superellipse(1.25)]", PANEL_STYLES), _v$8 = `${panelMinWidth()}px`, _v$9 = `${clampedMaxWidth()}px`, _v$0 = `${clampedMaxHeight()}px`;
|
|
10517
|
+
_v$ !== _p$.e && setStyleProperty(_el$, "top", _p$.e = _v$);
|
|
10518
|
+
_v$2 !== _p$.t && setStyleProperty(_el$, "left", _p$.t = _v$2);
|
|
10519
|
+
_v$3 !== _p$.a && setStyleProperty(_el$, "pointer-events", _p$.a = _v$3);
|
|
10520
|
+
_v$4 !== _p$.o && setStyleProperty(_el$, "transform-origin", _p$.o = _v$4);
|
|
10521
|
+
_v$5 !== _p$.i && setStyleProperty(_el$, "opacity", _p$.i = _v$5);
|
|
10522
|
+
_v$6 !== _p$.n && setStyleProperty(_el$, "transform", _p$.n = _v$6);
|
|
10523
|
+
_v$7 !== _p$.s && className(_el$2, _p$.s = _v$7);
|
|
10524
|
+
_v$8 !== _p$.h && setStyleProperty(_el$2, "min-width", _p$.h = _v$8);
|
|
10525
|
+
_v$9 !== _p$.r && setStyleProperty(_el$2, "max-width", _p$.r = _v$9);
|
|
10526
|
+
_v$0 !== _p$.d && setStyleProperty(_el$2, "max-height", _p$.d = _v$0);
|
|
10527
|
+
return _p$;
|
|
10528
|
+
}, {
|
|
10529
|
+
e: void 0,
|
|
10530
|
+
t: void 0,
|
|
10531
|
+
a: void 0,
|
|
10532
|
+
o: void 0,
|
|
10533
|
+
i: void 0,
|
|
10534
|
+
n: void 0,
|
|
10535
|
+
s: void 0,
|
|
10536
|
+
h: void 0,
|
|
10537
|
+
r: void 0,
|
|
10538
|
+
d: void 0
|
|
10539
|
+
});
|
|
10540
|
+
return _el$;
|
|
10541
|
+
}
|
|
10542
|
+
});
|
|
10543
|
+
};
|
|
10544
|
+
delegateEvents(["pointerdown", "mousedown", "click", "contextmenu", "keydown"]);
|
|
10545
|
+
}
|
|
10546
|
+
});
|
|
10547
|
+
|
|
10548
|
+
// src/components/renderer.tsx
|
|
10549
|
+
var _tmpl$39, ReactGrabRenderer;
|
|
10550
|
+
var init_renderer = __esm({
|
|
10551
|
+
"src/components/renderer.tsx"() {
|
|
9653
10552
|
"use strict";
|
|
9654
10553
|
init_web();
|
|
9655
10554
|
init_web();
|
|
@@ -9663,7 +10562,8 @@ var init_renderer = __esm({
|
|
|
9663
10562
|
init_selection_label();
|
|
9664
10563
|
init_toolbar();
|
|
9665
10564
|
init_context_menu();
|
|
9666
|
-
|
|
10565
|
+
init_history_dropdown();
|
|
10566
|
+
_tmpl$39 = /* @__PURE__ */ template(`<div style="position:fixed;top:0;right:0;bottom:0;left:0;pointer-events:none;transition:opacity 100ms ease-out;will-change:opacity;contain:strict;transform:translateZ(0)">`);
|
|
9667
10567
|
ReactGrabRenderer = (props) => {
|
|
9668
10568
|
return [createComponent(OverlayCanvas, {
|
|
9669
10569
|
get crosshairVisible() {
|
|
@@ -9706,7 +10606,7 @@ var init_renderer = __esm({
|
|
|
9706
10606
|
return props.labelInstances;
|
|
9707
10607
|
}
|
|
9708
10608
|
}), (() => {
|
|
9709
|
-
var _el$ = _tmpl$
|
|
10609
|
+
var _el$ = _tmpl$39();
|
|
9710
10610
|
setStyleProperty(_el$, "z-index", Z_INDEX_OVERLAY_CANVAS);
|
|
9711
10611
|
setStyleProperty(_el$, "box-shadow", `inset 0 0 ${FROZEN_GLOW_EDGE_PX}px ${FROZEN_GLOW_COLOR}`);
|
|
9712
10612
|
createRenderEffect((_$p) => setStyleProperty(_el$, "opacity", props.isFrozen ? 1 : 0));
|
|
@@ -9887,9 +10787,24 @@ var init_renderer = __esm({
|
|
|
9887
10787
|
get status() {
|
|
9888
10788
|
return instance().status;
|
|
9889
10789
|
},
|
|
10790
|
+
get statusText() {
|
|
10791
|
+
return instance().statusText;
|
|
10792
|
+
},
|
|
10793
|
+
get hasAgent() {
|
|
10794
|
+
return Boolean(instance().statusText);
|
|
10795
|
+
},
|
|
10796
|
+
get isPromptMode() {
|
|
10797
|
+
return instance().isPromptMode;
|
|
10798
|
+
},
|
|
10799
|
+
get inputValue() {
|
|
10800
|
+
return instance().inputValue;
|
|
10801
|
+
},
|
|
9890
10802
|
get error() {
|
|
9891
10803
|
return instance().errorMessage;
|
|
9892
10804
|
},
|
|
10805
|
+
get hideArrow() {
|
|
10806
|
+
return instance().hideArrow;
|
|
10807
|
+
},
|
|
9893
10808
|
get onShowContextMenu() {
|
|
9894
10809
|
return (instance().status === "copied" || instance().status === "fading") && instance().element && (document.body ?? document.documentElement).contains(instance().element) ? () => props.onShowContextMenuInstance?.(instance().id) : void 0;
|
|
9895
10810
|
},
|
|
@@ -9933,6 +10848,27 @@ var init_renderer = __esm({
|
|
|
9933
10848
|
},
|
|
9934
10849
|
get onSelectHoverChange() {
|
|
9935
10850
|
return props.onToolbarSelectHoverChange;
|
|
10851
|
+
},
|
|
10852
|
+
get onContainerRef() {
|
|
10853
|
+
return props.onToolbarRef;
|
|
10854
|
+
},
|
|
10855
|
+
get historyItemCount() {
|
|
10856
|
+
return props.historyItemCount;
|
|
10857
|
+
},
|
|
10858
|
+
get hasUnreadHistoryItems() {
|
|
10859
|
+
return props.hasUnreadHistoryItems;
|
|
10860
|
+
},
|
|
10861
|
+
get onToggleHistory() {
|
|
10862
|
+
return props.onToggleHistory;
|
|
10863
|
+
},
|
|
10864
|
+
get onHistoryButtonHover() {
|
|
10865
|
+
return props.onHistoryButtonHover;
|
|
10866
|
+
},
|
|
10867
|
+
get isHistoryDropdownOpen() {
|
|
10868
|
+
return Boolean(props.historyDropdownPosition);
|
|
10869
|
+
},
|
|
10870
|
+
get isHistoryPinned() {
|
|
10871
|
+
return props.isHistoryPinned;
|
|
9936
10872
|
}
|
|
9937
10873
|
});
|
|
9938
10874
|
}
|
|
@@ -9966,6 +10902,43 @@ var init_renderer = __esm({
|
|
|
9966
10902
|
return props.onContextMenuHide ?? (() => {
|
|
9967
10903
|
});
|
|
9968
10904
|
}
|
|
10905
|
+
}), createComponent(HistoryDropdown, {
|
|
10906
|
+
get position() {
|
|
10907
|
+
return props.historyDropdownPosition ?? null;
|
|
10908
|
+
},
|
|
10909
|
+
get items() {
|
|
10910
|
+
return props.historyItems ?? [];
|
|
10911
|
+
},
|
|
10912
|
+
get disconnectedItemIds() {
|
|
10913
|
+
return props.historyDisconnectedItemIds;
|
|
10914
|
+
},
|
|
10915
|
+
get onSelectItem() {
|
|
10916
|
+
return props.onHistoryItemSelect;
|
|
10917
|
+
},
|
|
10918
|
+
get onRemoveItem() {
|
|
10919
|
+
return props.onHistoryItemRemove;
|
|
10920
|
+
},
|
|
10921
|
+
get onCopyItem() {
|
|
10922
|
+
return props.onHistoryItemCopy;
|
|
10923
|
+
},
|
|
10924
|
+
get onItemHover() {
|
|
10925
|
+
return props.onHistoryItemHover;
|
|
10926
|
+
},
|
|
10927
|
+
get onCopyAll() {
|
|
10928
|
+
return props.onHistoryCopyAll;
|
|
10929
|
+
},
|
|
10930
|
+
get onCopyAllHover() {
|
|
10931
|
+
return props.onHistoryCopyAllHover;
|
|
10932
|
+
},
|
|
10933
|
+
get onClearAll() {
|
|
10934
|
+
return props.onHistoryClear;
|
|
10935
|
+
},
|
|
10936
|
+
get onDismiss() {
|
|
10937
|
+
return props.onHistoryDismiss;
|
|
10938
|
+
},
|
|
10939
|
+
get onDropdownHover() {
|
|
10940
|
+
return props.onHistoryDropdownHover;
|
|
10941
|
+
}
|
|
9969
10942
|
})];
|
|
9970
10943
|
};
|
|
9971
10944
|
}
|
|
@@ -10656,8 +11629,17 @@ var init_is_capitalized = __esm({
|
|
|
10656
11629
|
}
|
|
10657
11630
|
});
|
|
10658
11631
|
|
|
11632
|
+
// src/utils/truncate-string.ts
|
|
11633
|
+
var truncateString;
|
|
11634
|
+
var init_truncate_string = __esm({
|
|
11635
|
+
"src/utils/truncate-string.ts"() {
|
|
11636
|
+
"use strict";
|
|
11637
|
+
truncateString = (text, maxLength) => text.length > maxLength ? `${text.slice(0, maxLength)}...` : text;
|
|
11638
|
+
}
|
|
11639
|
+
});
|
|
11640
|
+
|
|
10659
11641
|
// src/core/context.ts
|
|
10660
|
-
var NEXT_INTERNAL_COMPONENT_NAMES, REACT_INTERNAL_COMPONENT_NAMES, checkIsNextProject, checkIsInternalComponentName, checkIsSourceComponentName, stackCache, fetchStackForElement, getStack, getNearestComponentName, isUsefulComponentName, getComponentDisplayName, hasSourceFiles, getComponentNamesFromFiber, getElementContext, getFallbackContext, truncateAttrValue, formatPriorityAttrs, getHTMLPreview;
|
|
11642
|
+
var NEXT_INTERNAL_COMPONENT_NAMES, REACT_INTERNAL_COMPONENT_NAMES, checkIsNextProject, checkIsInternalComponentName, checkIsSourceComponentName, stackCache, fetchStackForElement, getStack, getNearestComponentName, resolveSourceFromStack, isUsefulComponentName, getComponentDisplayName, hasSourceFiles, getComponentNamesFromFiber, getElementContext, getFallbackContext, truncateAttrValue, formatPriorityAttrs, getHTMLPreview;
|
|
10661
11643
|
var init_context = __esm({
|
|
10662
11644
|
"src/core/context.ts"() {
|
|
10663
11645
|
"use strict";
|
|
@@ -10666,6 +11648,7 @@ var init_context = __esm({
|
|
|
10666
11648
|
init_dist();
|
|
10667
11649
|
init_constants();
|
|
10668
11650
|
init_get_tag_name();
|
|
11651
|
+
init_truncate_string();
|
|
10669
11652
|
NEXT_INTERNAL_COMPONENT_NAMES = /* @__PURE__ */ new Set([
|
|
10670
11653
|
"InnerLayoutRouter",
|
|
10671
11654
|
"RedirectErrorBoundary",
|
|
@@ -10749,6 +11732,19 @@ var init_context = __esm({
|
|
|
10749
11732
|
}
|
|
10750
11733
|
return null;
|
|
10751
11734
|
};
|
|
11735
|
+
resolveSourceFromStack = (stack) => {
|
|
11736
|
+
if (!stack || stack.length === 0) return null;
|
|
11737
|
+
for (const frame of stack) {
|
|
11738
|
+
if (frame.fileName && Pe2(frame.fileName)) {
|
|
11739
|
+
return {
|
|
11740
|
+
filePath: Ne2(frame.fileName),
|
|
11741
|
+
lineNumber: frame.lineNumber,
|
|
11742
|
+
componentName: frame.functionName && checkIsSourceComponentName(frame.functionName) ? frame.functionName : null
|
|
11743
|
+
};
|
|
11744
|
+
}
|
|
11745
|
+
}
|
|
11746
|
+
return null;
|
|
11747
|
+
};
|
|
10752
11748
|
isUsefulComponentName = (name) => {
|
|
10753
11749
|
if (!name) return false;
|
|
10754
11750
|
if (checkIsInternalComponentName(name)) return false;
|
|
@@ -10857,7 +11853,7 @@ var init_context = __esm({
|
|
|
10857
11853
|
for (const { name, value } of element.attributes) {
|
|
10858
11854
|
attrsText += ` ${name}="${value}"`;
|
|
10859
11855
|
}
|
|
10860
|
-
const truncatedText = text
|
|
11856
|
+
const truncatedText = truncateString(text, PREVIEW_TEXT_MAX_LENGTH);
|
|
10861
11857
|
if (truncatedText.length > 0) {
|
|
10862
11858
|
return `<${tagName}${attrsText}>
|
|
10863
11859
|
${truncatedText}
|
|
@@ -10865,7 +11861,7 @@ var init_context = __esm({
|
|
|
10865
11861
|
}
|
|
10866
11862
|
return `<${tagName}${attrsText} />`;
|
|
10867
11863
|
};
|
|
10868
|
-
truncateAttrValue = (value) => value
|
|
11864
|
+
truncateAttrValue = (value) => truncateString(value, PREVIEW_ATTR_VALUE_MAX_LENGTH);
|
|
10869
11865
|
formatPriorityAttrs = (element, options = {}) => {
|
|
10870
11866
|
const { truncate = true, maxAttrs = PREVIEW_MAX_ATTRS } = options;
|
|
10871
11867
|
const priorityAttrs = [];
|
|
@@ -10911,7 +11907,7 @@ var init_context = __esm({
|
|
|
10911
11907
|
const formatElements = (elements) => {
|
|
10912
11908
|
if (elements.length === 0) return "";
|
|
10913
11909
|
if (elements.length <= 2) {
|
|
10914
|
-
return elements.map((
|
|
11910
|
+
return elements.map((childElement) => `<${getTagName(childElement)} ...>`).join("\n ");
|
|
10915
11911
|
}
|
|
10916
11912
|
return `(${elements.length} elements)`;
|
|
10917
11913
|
};
|
|
@@ -10920,9 +11916,8 @@ var init_context = __esm({
|
|
|
10920
11916
|
if (topElementsStr) content += `
|
|
10921
11917
|
${topElementsStr}`;
|
|
10922
11918
|
if (text.length > 0) {
|
|
10923
|
-
const truncatedText = text.length > 100 ? `${text.slice(0, 100)}...` : text;
|
|
10924
11919
|
content += `
|
|
10925
|
-
${
|
|
11920
|
+
${truncateString(text, PREVIEW_TEXT_MAX_LENGTH)}`;
|
|
10926
11921
|
}
|
|
10927
11922
|
const bottomElementsStr = formatElements(bottomElements);
|
|
10928
11923
|
if (bottomElementsStr) content += `
|
|
@@ -10954,6 +11949,7 @@ var init_noop_api = __esm({
|
|
|
10954
11949
|
targetElement: null,
|
|
10955
11950
|
dragBounds: null,
|
|
10956
11951
|
grabbedBoxes: [],
|
|
11952
|
+
labelInstances: [],
|
|
10957
11953
|
selectionFilePath: null,
|
|
10958
11954
|
toolbarState: null
|
|
10959
11955
|
};
|
|
@@ -11022,20 +12018,18 @@ var init_events = __esm({
|
|
|
11022
12018
|
});
|
|
11023
12019
|
|
|
11024
12020
|
// src/utils/copy-content.ts
|
|
11025
|
-
var LEXICAL_EDITOR_MIME_TYPE, REACT_GRAB_MIME_TYPE, generateUuid, createMentionNode, createTextNode,
|
|
12021
|
+
var LEXICAL_EDITOR_MIME_TYPE, REACT_GRAB_MIME_TYPE, generateUuid, createMentionNode, createTextNode, escapeHtml, createClipboardData, copyContent;
|
|
11026
12022
|
var init_copy_content = __esm({
|
|
11027
12023
|
"src/utils/copy-content.ts"() {
|
|
11028
12024
|
"use strict";
|
|
11029
12025
|
init_constants();
|
|
11030
12026
|
LEXICAL_EDITOR_MIME_TYPE = "application/x-lexical-editor";
|
|
11031
12027
|
REACT_GRAB_MIME_TYPE = "application/x-react-grab";
|
|
11032
|
-
generateUuid = () => {
|
|
11033
|
-
|
|
11034
|
-
|
|
11035
|
-
|
|
11036
|
-
|
|
11037
|
-
});
|
|
11038
|
-
};
|
|
12028
|
+
generateUuid = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (character) => {
|
|
12029
|
+
const randomNibble = Math.random() * 16 | 0;
|
|
12030
|
+
const hexValue = character === "x" ? randomNibble : randomNibble & 3 | 8;
|
|
12031
|
+
return hexValue.toString(16);
|
|
12032
|
+
});
|
|
11039
12033
|
createMentionNode = (displayName, mentionKey, typeaheadType, metadata) => ({
|
|
11040
12034
|
detail: 1,
|
|
11041
12035
|
format: 0,
|
|
@@ -11059,7 +12053,8 @@ var init_copy_content = __esm({
|
|
|
11059
12053
|
type: "text",
|
|
11060
12054
|
version: 1
|
|
11061
12055
|
});
|
|
11062
|
-
|
|
12056
|
+
escapeHtml = (text) => text.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
12057
|
+
createClipboardData = (content, elementName) => {
|
|
11063
12058
|
const mentionKey = String(Math.floor(Math.random() * 1e4));
|
|
11064
12059
|
const namespaceUuid = generateUuid();
|
|
11065
12060
|
const displayName = `<${elementName}>`;
|
|
@@ -11082,16 +12077,12 @@ var init_copy_content = __esm({
|
|
|
11082
12077
|
selection: { type: 0 },
|
|
11083
12078
|
selectedOption
|
|
11084
12079
|
};
|
|
11085
|
-
const escapedMentionMetadata = JSON.stringify(mentionMetadata).replace(
|
|
11086
|
-
/"/g,
|
|
11087
|
-
"""
|
|
11088
|
-
);
|
|
11089
12080
|
return {
|
|
11090
12081
|
plainText: `@${displayName}
|
|
11091
12082
|
|
|
11092
12083
|
${content}
|
|
11093
12084
|
`,
|
|
11094
|
-
htmlContent: `<meta charset='utf-8'><
|
|
12085
|
+
htmlContent: `<meta charset='utf-8'><pre><code>${escapeHtml(content)}</code></pre>`,
|
|
11095
12086
|
lexicalData: JSON.stringify({
|
|
11096
12087
|
namespace: `chat-input${namespaceUuid}-pane`,
|
|
11097
12088
|
nodes: [
|
|
@@ -11109,14 +12100,23 @@ ${content}`)
|
|
|
11109
12100
|
};
|
|
11110
12101
|
};
|
|
11111
12102
|
copyContent = (content, options) => {
|
|
11112
|
-
const elementName = options?.
|
|
11113
|
-
const { plainText, htmlContent, lexicalData } =
|
|
12103
|
+
const elementName = options?.componentName ?? "div";
|
|
12104
|
+
const { plainText, htmlContent, lexicalData } = createClipboardData(
|
|
11114
12105
|
content,
|
|
11115
12106
|
elementName
|
|
11116
12107
|
);
|
|
12108
|
+
const entries = options?.entries ?? [
|
|
12109
|
+
{
|
|
12110
|
+
tagName: options?.tagName,
|
|
12111
|
+
componentName: elementName,
|
|
12112
|
+
content,
|
|
12113
|
+
commentText: options?.commentText
|
|
12114
|
+
}
|
|
12115
|
+
];
|
|
11117
12116
|
const reactGrabMetadata = {
|
|
11118
12117
|
version: VERSION,
|
|
11119
12118
|
content,
|
|
12119
|
+
entries,
|
|
11120
12120
|
timestamp: Date.now()
|
|
11121
12121
|
};
|
|
11122
12122
|
const copyHandler = (event) => {
|
|
@@ -11169,6 +12169,19 @@ var init_generate_snippet = __esm({
|
|
|
11169
12169
|
}
|
|
11170
12170
|
});
|
|
11171
12171
|
|
|
12172
|
+
// src/utils/join-snippets.ts
|
|
12173
|
+
var joinSnippets;
|
|
12174
|
+
var init_join_snippets = __esm({
|
|
12175
|
+
"src/utils/join-snippets.ts"() {
|
|
12176
|
+
"use strict";
|
|
12177
|
+
joinSnippets = (snippets) => {
|
|
12178
|
+
if (snippets.length <= 1) return snippets[0] ?? "";
|
|
12179
|
+
return snippets.map((snippet, index) => `[${index + 1}]
|
|
12180
|
+
${snippet}`).join("\n\n");
|
|
12181
|
+
};
|
|
12182
|
+
}
|
|
12183
|
+
});
|
|
12184
|
+
|
|
11172
12185
|
// src/core/copy.ts
|
|
11173
12186
|
var tryCopyWithFallback;
|
|
11174
12187
|
var init_copy = __esm({
|
|
@@ -11176,12 +12189,14 @@ var init_copy = __esm({
|
|
|
11176
12189
|
"use strict";
|
|
11177
12190
|
init_copy_content();
|
|
11178
12191
|
init_generate_snippet();
|
|
12192
|
+
init_join_snippets();
|
|
11179
12193
|
tryCopyWithFallback = async (options, hooks, elements, extraPrompt) => {
|
|
11180
12194
|
let didCopy = false;
|
|
11181
12195
|
let copiedContent = "";
|
|
11182
12196
|
await hooks.onBeforeCopy(elements);
|
|
11183
12197
|
try {
|
|
11184
12198
|
let generatedContent;
|
|
12199
|
+
let entries;
|
|
11185
12200
|
if (options.getContent) {
|
|
11186
12201
|
generatedContent = await options.getContent(elements);
|
|
11187
12202
|
} else {
|
|
@@ -11193,7 +12208,14 @@ var init_copy = __esm({
|
|
|
11193
12208
|
(snippet, index) => snippet.trim() ? hooks.transformSnippet(snippet, elements[index]) : Promise.resolve("")
|
|
11194
12209
|
)
|
|
11195
12210
|
);
|
|
11196
|
-
|
|
12211
|
+
const snippetElementPairs = transformedSnippets.map((snippet, index) => ({ snippet, element: elements[index] })).filter(({ snippet }) => snippet.trim());
|
|
12212
|
+
generatedContent = joinSnippets(
|
|
12213
|
+
snippetElementPairs.map(({ snippet }) => snippet)
|
|
12214
|
+
);
|
|
12215
|
+
entries = snippetElementPairs.map(({ snippet, element }) => ({
|
|
12216
|
+
tagName: element.localName,
|
|
12217
|
+
content: snippet
|
|
12218
|
+
}));
|
|
11197
12219
|
}
|
|
11198
12220
|
if (generatedContent.trim()) {
|
|
11199
12221
|
const transformedContent = await hooks.transformCopyContent(
|
|
@@ -11203,7 +12225,10 @@ var init_copy = __esm({
|
|
|
11203
12225
|
copiedContent = extraPrompt ? `${extraPrompt}
|
|
11204
12226
|
|
|
11205
12227
|
${transformedContent}` : transformedContent;
|
|
11206
|
-
didCopy = copyContent(copiedContent, {
|
|
12228
|
+
didCopy = copyContent(copiedContent, {
|
|
12229
|
+
componentName: options.componentName,
|
|
12230
|
+
entries
|
|
12231
|
+
});
|
|
11207
12232
|
}
|
|
11208
12233
|
} catch (error) {
|
|
11209
12234
|
const resolvedError = error instanceof Error ? error : new Error(String(error));
|
|
@@ -11803,46 +12828,8 @@ var init_delay = __esm({
|
|
|
11803
12828
|
}
|
|
11804
12829
|
});
|
|
11805
12830
|
|
|
11806
|
-
// src/utils/create-scroll-cycler.ts
|
|
11807
|
-
var createScrollCycler;
|
|
11808
|
-
var init_create_scroll_cycler = __esm({
|
|
11809
|
-
"src/utils/create-scroll-cycler.ts"() {
|
|
11810
|
-
"use strict";
|
|
11811
|
-
createScrollCycler = (options) => {
|
|
11812
|
-
const { thresholdPx, throttleMs, lineHeightPx, onStep } = options;
|
|
11813
|
-
let accumulatedDelta = 0;
|
|
11814
|
-
let currentDirection = null;
|
|
11815
|
-
let lastStepTimestamp = 0;
|
|
11816
|
-
const handleWheel = (event) => {
|
|
11817
|
-
const primaryAxisDelta = Math.abs(event.deltaY) >= Math.abs(event.deltaX) ? event.deltaY : event.deltaX;
|
|
11818
|
-
if (primaryAxisDelta === 0) return;
|
|
11819
|
-
let normalizedDelta = primaryAxisDelta;
|
|
11820
|
-
if (event.deltaMode === 1) {
|
|
11821
|
-
normalizedDelta *= lineHeightPx;
|
|
11822
|
-
} else if (event.deltaMode === 2) {
|
|
11823
|
-
normalizedDelta *= window.innerHeight;
|
|
11824
|
-
}
|
|
11825
|
-
const direction = normalizedDelta > 0 ? 1 : -1;
|
|
11826
|
-
if (currentDirection !== direction) {
|
|
11827
|
-
currentDirection = direction;
|
|
11828
|
-
accumulatedDelta = 0;
|
|
11829
|
-
}
|
|
11830
|
-
accumulatedDelta += Math.abs(normalizedDelta);
|
|
11831
|
-
const now = Date.now();
|
|
11832
|
-
if (now - lastStepTimestamp < throttleMs || accumulatedDelta < thresholdPx) {
|
|
11833
|
-
return;
|
|
11834
|
-
}
|
|
11835
|
-
accumulatedDelta -= thresholdPx;
|
|
11836
|
-
lastStepTimestamp = now;
|
|
11837
|
-
onStep(direction < 0 ? "backward" : "forward");
|
|
11838
|
-
};
|
|
11839
|
-
return { handleWheel };
|
|
11840
|
-
};
|
|
11841
|
-
}
|
|
11842
|
-
});
|
|
11843
|
-
|
|
11844
12831
|
// src/core/theme.ts
|
|
11845
|
-
var DEFAULT_THEME,
|
|
12832
|
+
var DEFAULT_THEME, deepMergeTheme;
|
|
11846
12833
|
var init_theme = __esm({
|
|
11847
12834
|
"src/core/theme.ts"() {
|
|
11848
12835
|
"use strict";
|
|
@@ -11868,7 +12855,7 @@ var init_theme = __esm({
|
|
|
11868
12855
|
enabled: true
|
|
11869
12856
|
}
|
|
11870
12857
|
};
|
|
11871
|
-
|
|
12858
|
+
deepMergeTheme = (baseTheme, partialTheme) => ({
|
|
11872
12859
|
enabled: partialTheme.enabled ?? baseTheme.enabled,
|
|
11873
12860
|
hue: partialTheme.hue ?? baseTheme.hue,
|
|
11874
12861
|
selectionBox: {
|
|
@@ -11890,7 +12877,6 @@ var init_theme = __esm({
|
|
|
11890
12877
|
enabled: partialTheme.toolbar?.enabled ?? baseTheme.toolbar.enabled
|
|
11891
12878
|
}
|
|
11892
12879
|
});
|
|
11893
|
-
deepMergeTheme = mergeThemeWithBase;
|
|
11894
12880
|
}
|
|
11895
12881
|
});
|
|
11896
12882
|
|
|
@@ -11954,15 +12940,7 @@ var init_plugin_registry = __esm({
|
|
|
11954
12940
|
if (plugins.has(plugin.name)) {
|
|
11955
12941
|
unregister(plugin.name);
|
|
11956
12942
|
}
|
|
11957
|
-
|
|
11958
|
-
if (plugin.setup) {
|
|
11959
|
-
const setupResult = plugin.setup(
|
|
11960
|
-
api
|
|
11961
|
-
);
|
|
11962
|
-
config = setupResult ?? {};
|
|
11963
|
-
} else {
|
|
11964
|
-
config = {};
|
|
11965
|
-
}
|
|
12943
|
+
const config = plugin.setup?.(api) ?? {};
|
|
11966
12944
|
if (plugin.theme) {
|
|
11967
12945
|
config.theme = config.theme ? deepMergeTheme(
|
|
11968
12946
|
deepMergeTheme(DEFAULT_THEME, plugin.theme),
|
|
@@ -12084,10 +13062,11 @@ var init_plugin_registry = __esm({
|
|
|
12084
13062
|
});
|
|
12085
13063
|
|
|
12086
13064
|
// src/core/agent/session.ts
|
|
12087
|
-
var STORAGE_KEY2, generateSessionId, createSession, memorySessions, saveSessions, saveSessionById, loadSessions, clearSessions, clearSessionById, updateSession;
|
|
13065
|
+
var STORAGE_KEY2, generateSessionId, createSession, memorySessions, evictOldestMemorySessions, saveSessions, saveSessionById, loadSessions, clearSessions, clearSessionById, updateSession;
|
|
12088
13066
|
var init_session = __esm({
|
|
12089
13067
|
"src/core/agent/session.ts"() {
|
|
12090
13068
|
"use strict";
|
|
13069
|
+
init_constants();
|
|
12091
13070
|
STORAGE_KEY2 = "react-grab:agent-sessions";
|
|
12092
13071
|
generateSessionId = () => `session-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
|
|
12093
13072
|
createSession = (context, position, selectionBounds, tagName, componentName) => {
|
|
@@ -12106,10 +13085,19 @@ var init_session = __esm({
|
|
|
12106
13085
|
};
|
|
12107
13086
|
};
|
|
12108
13087
|
memorySessions = /* @__PURE__ */ new Map();
|
|
13088
|
+
evictOldestMemorySessions = () => {
|
|
13089
|
+
while (memorySessions.size > MAX_MEMORY_SESSIONS) {
|
|
13090
|
+
const oldestKey = memorySessions.keys().next().value;
|
|
13091
|
+
if (oldestKey !== void 0) {
|
|
13092
|
+
memorySessions.delete(oldestKey);
|
|
13093
|
+
}
|
|
13094
|
+
}
|
|
13095
|
+
};
|
|
12109
13096
|
saveSessions = (sessions, storage) => {
|
|
12110
13097
|
if (!storage) {
|
|
12111
13098
|
memorySessions.clear();
|
|
12112
13099
|
sessions.forEach((session, id) => memorySessions.set(id, session));
|
|
13100
|
+
evictOldestMemorySessions();
|
|
12113
13101
|
return;
|
|
12114
13102
|
}
|
|
12115
13103
|
try {
|
|
@@ -12118,6 +13106,7 @@ var init_session = __esm({
|
|
|
12118
13106
|
} catch {
|
|
12119
13107
|
memorySessions.clear();
|
|
12120
13108
|
sessions.forEach((session, id) => memorySessions.set(id, session));
|
|
13109
|
+
evictOldestMemorySessions();
|
|
12121
13110
|
}
|
|
12122
13111
|
};
|
|
12123
13112
|
saveSessionById = (session, storage) => {
|
|
@@ -12204,12 +13193,14 @@ var init_manager = __esm({
|
|
|
12204
13193
|
return agentOptions;
|
|
12205
13194
|
};
|
|
12206
13195
|
const isProcessing = () => Array.from(sessions().values()).some((session) => session.isStreaming);
|
|
12207
|
-
const executeSessionStream = async (session, streamIterator, activeAgent) => {
|
|
13196
|
+
const executeSessionStream = async (session, streamIterator, abortController, activeAgent) => {
|
|
12208
13197
|
const effectiveAgent = activeAgent ?? agentOptions;
|
|
12209
13198
|
const storage = effectiveAgent?.storage;
|
|
12210
13199
|
let wasAborted = false;
|
|
13200
|
+
const isCurrentExecution = () => abortControllers.get(session.id) === abortController;
|
|
12211
13201
|
try {
|
|
12212
13202
|
for await (const status of streamIterator) {
|
|
13203
|
+
if (!isCurrentExecution()) break;
|
|
12213
13204
|
const currentSessions = sessions();
|
|
12214
13205
|
const currentSession = currentSessions.get(session.id);
|
|
12215
13206
|
if (!currentSession) break;
|
|
@@ -12221,6 +13212,7 @@ var init_manager = __esm({
|
|
|
12221
13212
|
setSessions((prev) => new Map(prev).set(session.id, updatedSession));
|
|
12222
13213
|
effectiveAgent?.onStatus?.(status, updatedSession);
|
|
12223
13214
|
}
|
|
13215
|
+
if (!isCurrentExecution()) return;
|
|
12224
13216
|
const finalSessions = sessions();
|
|
12225
13217
|
const finalSession = finalSessions.get(session.id);
|
|
12226
13218
|
if (finalSession) {
|
|
@@ -12262,6 +13254,7 @@ var init_manager = __esm({
|
|
|
12262
13254
|
}
|
|
12263
13255
|
}
|
|
12264
13256
|
} catch (error) {
|
|
13257
|
+
if (!isCurrentExecution()) return;
|
|
12265
13258
|
const currentSessions = sessions();
|
|
12266
13259
|
const currentSession = currentSessions.get(session.id);
|
|
12267
13260
|
if (error instanceof Error && error.name === "AbortError") {
|
|
@@ -12288,8 +13281,16 @@ var init_manager = __esm({
|
|
|
12288
13281
|
}
|
|
12289
13282
|
}
|
|
12290
13283
|
} finally {
|
|
13284
|
+
if (!isCurrentExecution()) {
|
|
13285
|
+
return;
|
|
13286
|
+
}
|
|
12291
13287
|
abortControllers.delete(session.id);
|
|
12292
13288
|
if (wasAborted) {
|
|
13289
|
+
const dismissTimeout = dismissTimeouts.get(session.id);
|
|
13290
|
+
if (dismissTimeout) {
|
|
13291
|
+
clearTimeout(dismissTimeout);
|
|
13292
|
+
dismissTimeouts.delete(session.id);
|
|
13293
|
+
}
|
|
12293
13294
|
sessionMetadata.delete(session.id);
|
|
12294
13295
|
clearSessionById(session.id, storage);
|
|
12295
13296
|
setSessions((prev) => {
|
|
@@ -12341,6 +13342,11 @@ var init_manager = __esm({
|
|
|
12341
13342
|
clearSessions(storage);
|
|
12342
13343
|
return;
|
|
12343
13344
|
}
|
|
13345
|
+
dismissTimeouts.forEach((timeoutId) => clearTimeout(timeoutId));
|
|
13346
|
+
dismissTimeouts.clear();
|
|
13347
|
+
abortControllers.forEach((controller) => controller.abort());
|
|
13348
|
+
abortControllers.clear();
|
|
13349
|
+
sessionMetadata.clear();
|
|
12344
13350
|
const resumableSessionsMap = new Map(
|
|
12345
13351
|
resumableSessions.map((session) => [session.id, session])
|
|
12346
13352
|
);
|
|
@@ -12375,7 +13381,11 @@ var init_manager = __esm({
|
|
|
12375
13381
|
abortController.signal,
|
|
12376
13382
|
storage
|
|
12377
13383
|
);
|
|
12378
|
-
void executeSessionStream(
|
|
13384
|
+
void executeSessionStream(
|
|
13385
|
+
existingSession,
|
|
13386
|
+
streamIterator,
|
|
13387
|
+
abortController
|
|
13388
|
+
);
|
|
12379
13389
|
}
|
|
12380
13390
|
};
|
|
12381
13391
|
const startSession = async (params) => {
|
|
@@ -12454,7 +13464,12 @@ var init_manager = __esm({
|
|
|
12454
13464
|
transformedContext,
|
|
12455
13465
|
abortController.signal
|
|
12456
13466
|
);
|
|
12457
|
-
void executeSessionStream(
|
|
13467
|
+
void executeSessionStream(
|
|
13468
|
+
session,
|
|
13469
|
+
streamIterator,
|
|
13470
|
+
abortController,
|
|
13471
|
+
activeAgent
|
|
13472
|
+
);
|
|
12458
13473
|
};
|
|
12459
13474
|
const abort = (sessionId) => {
|
|
12460
13475
|
if (sessionId) {
|
|
@@ -12496,6 +13511,11 @@ var init_manager = __esm({
|
|
|
12496
13511
|
if (existingTimeout) clearTimeout(existingTimeout);
|
|
12497
13512
|
const timeoutId = setTimeout(() => {
|
|
12498
13513
|
dismissTimeouts.delete(sessionId);
|
|
13514
|
+
const controller = abortControllers.get(sessionId);
|
|
13515
|
+
if (controller) {
|
|
13516
|
+
controller.abort();
|
|
13517
|
+
abortControllers.delete(sessionId);
|
|
13518
|
+
}
|
|
12499
13519
|
sessionMetadata.delete(sessionId);
|
|
12500
13520
|
clearSessionById(sessionId, activeAgent?.storage);
|
|
12501
13521
|
setSessions((prev) => {
|
|
@@ -12610,7 +13630,12 @@ var init_manager = __esm({
|
|
|
12610
13630
|
contextWithSessionId,
|
|
12611
13631
|
abortController.signal
|
|
12612
13632
|
);
|
|
12613
|
-
void executeSessionStream(
|
|
13633
|
+
void executeSessionStream(
|
|
13634
|
+
retriedSession,
|
|
13635
|
+
streamIterator,
|
|
13636
|
+
abortController,
|
|
13637
|
+
activeAgent
|
|
13638
|
+
);
|
|
12614
13639
|
};
|
|
12615
13640
|
const updateSessionBoundsOnViewportChange = () => {
|
|
12616
13641
|
const currentSessions = sessions();
|
|
@@ -12696,6 +13721,7 @@ var createArrowNavigator;
|
|
|
12696
13721
|
var init_arrow_navigation = __esm({
|
|
12697
13722
|
"src/core/arrow-navigation.ts"() {
|
|
12698
13723
|
"use strict";
|
|
13724
|
+
init_constants();
|
|
12699
13725
|
init_get_element_at_position();
|
|
12700
13726
|
init_is_element_connected();
|
|
12701
13727
|
createArrowNavigator = (isValidGrabbableElement2, createElementBounds2) => {
|
|
@@ -12714,6 +13740,11 @@ var init_arrow_navigation = __esm({
|
|
|
12714
13740
|
const nextElement = findVerticalNext(currentElement, 1);
|
|
12715
13741
|
if (nextElement) {
|
|
12716
13742
|
navigationHistory.push(currentElement);
|
|
13743
|
+
if (navigationHistory.length > MAX_ARROW_NAVIGATION_HISTORY) {
|
|
13744
|
+
navigationHistory = navigationHistory.slice(
|
|
13745
|
+
-MAX_ARROW_NAVIGATION_HISTORY
|
|
13746
|
+
);
|
|
13747
|
+
}
|
|
12717
13748
|
}
|
|
12718
13749
|
return nextElement;
|
|
12719
13750
|
};
|
|
@@ -12789,12 +13820,12 @@ var init_arrow_navigation = __esm({
|
|
|
12789
13820
|
return null;
|
|
12790
13821
|
}
|
|
12791
13822
|
};
|
|
12792
|
-
const
|
|
13823
|
+
const clearHistory2 = () => {
|
|
12793
13824
|
navigationHistory = [];
|
|
12794
13825
|
};
|
|
12795
13826
|
return {
|
|
12796
13827
|
findNext,
|
|
12797
|
-
clearHistory
|
|
13828
|
+
clearHistory: clearHistory2
|
|
12798
13829
|
};
|
|
12799
13830
|
};
|
|
12800
13831
|
}
|
|
@@ -12807,13 +13838,10 @@ var init_keyboard_handlers = __esm({
|
|
|
12807
13838
|
"use strict";
|
|
12808
13839
|
init_parse_activation_key();
|
|
12809
13840
|
getRequiredModifiers = (options) => {
|
|
12810
|
-
const
|
|
12811
|
-
|
|
12812
|
-
|
|
12813
|
-
|
|
12814
|
-
shiftKey: modifiers.shiftKey,
|
|
12815
|
-
altKey: modifiers.altKey
|
|
12816
|
-
};
|
|
13841
|
+
const { metaKey, ctrlKey, shiftKey, altKey } = getModifiersFromActivationKey(
|
|
13842
|
+
options.activationKey
|
|
13843
|
+
);
|
|
13844
|
+
return { metaKey, ctrlKey, shiftKey, altKey };
|
|
12817
13845
|
};
|
|
12818
13846
|
setupKeyboardEventClaimer = () => {
|
|
12819
13847
|
const claimedEvents = /* @__PURE__ */ new WeakSet();
|
|
@@ -12929,7 +13957,7 @@ var init_log_intro = __esm({
|
|
|
12929
13957
|
init_is_extension_context();
|
|
12930
13958
|
logIntro = () => {
|
|
12931
13959
|
try {
|
|
12932
|
-
const version = "0.1.
|
|
13960
|
+
const version = "0.1.15";
|
|
12933
13961
|
const logoDataUri = `data:image/svg+xml;base64,${btoa(LOGO_SVG)}`;
|
|
12934
13962
|
console.log(
|
|
12935
13963
|
`%cReact Grab${version ? ` v${version}` : ""}%c
|
|
@@ -12946,7 +13974,7 @@ https://react-grab.com`,
|
|
|
12946
13974
|
priority: "low",
|
|
12947
13975
|
cache: "no-store"
|
|
12948
13976
|
}
|
|
12949
|
-
).then((
|
|
13977
|
+
).then((response) => response.text()).then((latestVersion) => {
|
|
12950
13978
|
if (latestVersion && latestVersion !== version) {
|
|
12951
13979
|
console.warn(
|
|
12952
13980
|
`[React Grab] v${version} is outdated (latest: v${latestVersion})`
|
|
@@ -13171,6 +14199,53 @@ var init_comment = __esm({
|
|
|
13171
14199
|
}
|
|
13172
14200
|
});
|
|
13173
14201
|
|
|
14202
|
+
// src/utils/history-storage.ts
|
|
14203
|
+
var SESSION_STORAGE_KEY, loadFromSessionStorage, saveToSessionStorage, historyItems, generateHistoryItemId, loadHistory, addHistoryItem, removeHistoryItem, clearHistory;
|
|
14204
|
+
var init_history_storage = __esm({
|
|
14205
|
+
"src/utils/history-storage.ts"() {
|
|
14206
|
+
"use strict";
|
|
14207
|
+
init_constants();
|
|
14208
|
+
SESSION_STORAGE_KEY = "react-grab-history-items";
|
|
14209
|
+
loadFromSessionStorage = () => {
|
|
14210
|
+
try {
|
|
14211
|
+
const serializedHistoryItems = sessionStorage.getItem(SESSION_STORAGE_KEY);
|
|
14212
|
+
if (!serializedHistoryItems) return [];
|
|
14213
|
+
return JSON.parse(serializedHistoryItems);
|
|
14214
|
+
} catch {
|
|
14215
|
+
return [];
|
|
14216
|
+
}
|
|
14217
|
+
};
|
|
14218
|
+
saveToSessionStorage = (items) => {
|
|
14219
|
+
try {
|
|
14220
|
+
sessionStorage.setItem(SESSION_STORAGE_KEY, JSON.stringify(items));
|
|
14221
|
+
} catch {
|
|
14222
|
+
}
|
|
14223
|
+
};
|
|
14224
|
+
historyItems = loadFromSessionStorage();
|
|
14225
|
+
generateHistoryItemId = () => `history-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;
|
|
14226
|
+
loadHistory = () => historyItems;
|
|
14227
|
+
addHistoryItem = (item) => {
|
|
14228
|
+
const newItem = {
|
|
14229
|
+
...item,
|
|
14230
|
+
id: generateHistoryItemId()
|
|
14231
|
+
};
|
|
14232
|
+
historyItems = [newItem, ...historyItems].slice(0, MAX_HISTORY_ITEMS);
|
|
14233
|
+
saveToSessionStorage(historyItems);
|
|
14234
|
+
return historyItems;
|
|
14235
|
+
};
|
|
14236
|
+
removeHistoryItem = (itemId) => {
|
|
14237
|
+
historyItems = historyItems.filter((item) => item.id !== itemId);
|
|
14238
|
+
saveToSessionStorage(historyItems);
|
|
14239
|
+
return historyItems;
|
|
14240
|
+
};
|
|
14241
|
+
clearHistory = () => {
|
|
14242
|
+
historyItems = [];
|
|
14243
|
+
saveToSessionStorage(historyItems);
|
|
14244
|
+
return historyItems;
|
|
14245
|
+
};
|
|
14246
|
+
}
|
|
14247
|
+
});
|
|
14248
|
+
|
|
13174
14249
|
// src/core/index.tsx
|
|
13175
14250
|
var core_exports = {};
|
|
13176
14251
|
__export(core_exports, {
|
|
@@ -13220,7 +14295,6 @@ var init_core = __esm({
|
|
|
13220
14295
|
init_is_screenshot_supported();
|
|
13221
14296
|
init_delay();
|
|
13222
14297
|
init_resolve_action_enabled();
|
|
13223
|
-
init_create_scroll_cycler();
|
|
13224
14298
|
init_theme();
|
|
13225
14299
|
init_plugin_registry();
|
|
13226
14300
|
init_agent();
|
|
@@ -13241,6 +14315,9 @@ var init_core = __esm({
|
|
|
13241
14315
|
init_freeze_animations();
|
|
13242
14316
|
init_freeze_pseudo_states();
|
|
13243
14317
|
init_freeze_updates();
|
|
14318
|
+
init_history_storage();
|
|
14319
|
+
init_copy_content();
|
|
14320
|
+
init_join_snippets();
|
|
13244
14321
|
init_context();
|
|
13245
14322
|
init_dist();
|
|
13246
14323
|
init_theme();
|
|
@@ -13316,6 +14393,33 @@ var init_core = __esm({
|
|
|
13316
14393
|
const [toolbarShakeCount, setToolbarShakeCount] = createSignal(0);
|
|
13317
14394
|
const [currentToolbarState, setCurrentToolbarState] = createSignal(savedToolbarState);
|
|
13318
14395
|
const [isToolbarSelectHovered, setIsToolbarSelectHovered] = createSignal(false);
|
|
14396
|
+
const [historyItems2, setHistoryItems] = createSignal(loadHistory());
|
|
14397
|
+
const [historyDropdownPosition, setHistoryDropdownPosition] = createSignal(null);
|
|
14398
|
+
let toolbarElement;
|
|
14399
|
+
let historyPositionFrameId = null;
|
|
14400
|
+
const historyElementMap = /* @__PURE__ */ new Map();
|
|
14401
|
+
const [hasUnreadHistoryItems, setHasUnreadHistoryItems] = createSignal(false);
|
|
14402
|
+
const [isHistoryHoverOpen, setIsHistoryHoverOpen] = createSignal(false);
|
|
14403
|
+
let historyHoverPreviews = [];
|
|
14404
|
+
const historyDisconnectedItemIds = createMemo(() => {
|
|
14405
|
+
void historyDropdownPosition();
|
|
14406
|
+
const disconnectedIds = /* @__PURE__ */ new Set();
|
|
14407
|
+
for (const item of historyItems2()) {
|
|
14408
|
+
const element = historyElementMap.get(item.id);
|
|
14409
|
+
if (!element || !isElementConnected(element)) {
|
|
14410
|
+
disconnectedIds.add(item.id);
|
|
14411
|
+
}
|
|
14412
|
+
}
|
|
14413
|
+
return disconnectedIds;
|
|
14414
|
+
}, void 0, {
|
|
14415
|
+
equals: (prev, next) => {
|
|
14416
|
+
if (prev.size !== next.size) return false;
|
|
14417
|
+
for (const id of next) {
|
|
14418
|
+
if (!prev.has(id)) return false;
|
|
14419
|
+
}
|
|
14420
|
+
return true;
|
|
14421
|
+
}
|
|
14422
|
+
});
|
|
13319
14423
|
const pendingAbortSessionId = createMemo(() => store.pendingAbortSessionId);
|
|
13320
14424
|
const hasAgentProvider = createMemo(() => store.hasAgentProvider);
|
|
13321
14425
|
const clearHoldTimer = () => {
|
|
@@ -13359,26 +14463,18 @@ var init_core = __esm({
|
|
|
13359
14463
|
}, FEEDBACK_DURATION_MS);
|
|
13360
14464
|
onCleanup(() => clearTimeout(timerId));
|
|
13361
14465
|
});
|
|
13362
|
-
|
|
13363
|
-
|
|
13364
|
-
|
|
13365
|
-
const currentlyActive = isActivated();
|
|
13366
|
-
if (previouslyHoldingKeys && !currentlyHolding && currentlyActive) {
|
|
13367
|
-
if (pluginRegistry.store.options.activationMode !== "hold") {
|
|
13368
|
-
actions.setWasActivatedByToggle(true);
|
|
13369
|
-
}
|
|
13370
|
-
pluginRegistry.hooks.onActivate();
|
|
14466
|
+
createEffect(on(isHoldingKeys, (currentlyHolding, previouslyHolding = false) => {
|
|
14467
|
+
if (!previouslyHolding || currentlyHolding || !isActivated()) {
|
|
14468
|
+
return;
|
|
13371
14469
|
}
|
|
13372
|
-
|
|
13373
|
-
|
|
13374
|
-
|
|
13375
|
-
|
|
13376
|
-
|
|
13377
|
-
actions.setInputText(cachedInput ?? "");
|
|
13378
|
-
};
|
|
14470
|
+
if (pluginRegistry.store.options.activationMode !== "hold") {
|
|
14471
|
+
actions.setWasActivatedByToggle(true);
|
|
14472
|
+
}
|
|
14473
|
+
pluginRegistry.hooks.onActivate();
|
|
14474
|
+
}));
|
|
13379
14475
|
const preparePromptMode = (element, positionX, positionY) => {
|
|
13380
14476
|
setCopyStartPosition(element, positionX, positionY);
|
|
13381
|
-
|
|
14477
|
+
actions.clearInputText();
|
|
13382
14478
|
};
|
|
13383
14479
|
const activatePromptMode = () => {
|
|
13384
14480
|
const element = store.frozenElement || targetElement();
|
|
@@ -13418,6 +14514,7 @@ var init_core = __esm({
|
|
|
13418
14514
|
let copyWaitingForConfirmation = false;
|
|
13419
14515
|
let holdTimerFiredWaitingForConfirmation = false;
|
|
13420
14516
|
let isScreenshotInProgress = false;
|
|
14517
|
+
let lastWindowFocusTimestamp = 0;
|
|
13421
14518
|
let inToggleFeedbackPeriod = false;
|
|
13422
14519
|
let toggleFeedbackTimerId = null;
|
|
13423
14520
|
let actionCycleIdleTimeoutId = null;
|
|
@@ -13476,7 +14573,7 @@ var init_core = __esm({
|
|
|
13476
14573
|
if (!componentName) {
|
|
13477
14574
|
componentName = getComponentDisplayName(element);
|
|
13478
14575
|
}
|
|
13479
|
-
const textContent = element instanceof HTMLElement ? element.innerText?.slice(0,
|
|
14576
|
+
const textContent = element instanceof HTMLElement ? element.innerText?.slice(0, PREVIEW_TEXT_MAX_LENGTH) : void 0;
|
|
13480
14577
|
return {
|
|
13481
14578
|
tagName: getTagName(element),
|
|
13482
14579
|
id: element.id || void 0,
|
|
@@ -13494,32 +14591,31 @@ var init_core = __esm({
|
|
|
13494
14591
|
}
|
|
13495
14592
|
}));
|
|
13496
14593
|
};
|
|
13497
|
-
const createLabelInstance = (bounds, tagName, componentName, status,
|
|
14594
|
+
const createLabelInstance = (bounds, tagName, componentName, status, options) => {
|
|
13498
14595
|
actions.clearLabelInstances();
|
|
13499
14596
|
const instanceId = `label-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
13500
14597
|
const boundsCenterX = bounds.x + bounds.width / 2;
|
|
13501
14598
|
const boundsHalfWidth = bounds.width / 2;
|
|
14599
|
+
const mouseX = options?.mouseX;
|
|
13502
14600
|
const mouseXOffset = mouseX !== void 0 ? mouseX - boundsCenterX : void 0;
|
|
13503
14601
|
const instance = {
|
|
13504
14602
|
id: instanceId,
|
|
13505
14603
|
bounds,
|
|
13506
|
-
boundsMultiple,
|
|
14604
|
+
boundsMultiple: options?.boundsMultiple,
|
|
13507
14605
|
tagName,
|
|
13508
14606
|
componentName,
|
|
13509
14607
|
status,
|
|
13510
14608
|
createdAt: Date.now(),
|
|
13511
|
-
element,
|
|
13512
|
-
elements,
|
|
14609
|
+
element: options?.element,
|
|
14610
|
+
elements: options?.elements,
|
|
13513
14611
|
mouseX,
|
|
13514
14612
|
mouseXOffsetFromCenter: mouseXOffset,
|
|
13515
|
-
mouseXOffsetRatio: mouseXOffset !== void 0 && boundsHalfWidth > 0 ? mouseXOffset / boundsHalfWidth : void 0
|
|
14613
|
+
mouseXOffsetRatio: mouseXOffset !== void 0 && boundsHalfWidth > 0 ? mouseXOffset / boundsHalfWidth : void 0,
|
|
14614
|
+
hideArrow: options?.hideArrow
|
|
13516
14615
|
};
|
|
13517
14616
|
actions.addLabelInstance(instance);
|
|
13518
14617
|
return instanceId;
|
|
13519
14618
|
};
|
|
13520
|
-
const updateLabelInstance = (instanceId, status, errorMessage) => {
|
|
13521
|
-
actions.updateLabelInstance(instanceId, status, errorMessage);
|
|
13522
|
-
};
|
|
13523
14619
|
const removeLabelInstance = (instanceId) => {
|
|
13524
14620
|
labelFadeTimeouts.delete(instanceId);
|
|
13525
14621
|
actions.removeLabelInstance(instanceId);
|
|
@@ -13536,7 +14632,7 @@ var init_core = __esm({
|
|
|
13536
14632
|
cancelLabelFade(instanceId);
|
|
13537
14633
|
const timeoutId = window.setTimeout(() => {
|
|
13538
14634
|
labelFadeTimeouts.delete(instanceId);
|
|
13539
|
-
updateLabelInstance(instanceId, "fading");
|
|
14635
|
+
actions.updateLabelInstance(instanceId, "fading");
|
|
13540
14636
|
setTimeout(() => {
|
|
13541
14637
|
removeLabelInstance(instanceId);
|
|
13542
14638
|
}, FADE_COMPLETE_BUFFER_MS);
|
|
@@ -13556,11 +14652,15 @@ var init_core = __esm({
|
|
|
13556
14652
|
const executeCopyOperation = async (positionX, positionY, operation, bounds, tagName, componentName, element, shouldDeactivateAfter, elements) => {
|
|
13557
14653
|
inToggleFeedbackPeriod = false;
|
|
13558
14654
|
actions.startCopy();
|
|
13559
|
-
const instanceId = bounds && tagName ? createLabelInstance(bounds, tagName, componentName, "copying",
|
|
14655
|
+
const instanceId = bounds && tagName ? createLabelInstance(bounds, tagName, componentName, "copying", {
|
|
14656
|
+
element,
|
|
14657
|
+
mouseX: positionX,
|
|
14658
|
+
elements
|
|
14659
|
+
}) : null;
|
|
13560
14660
|
await operation().finally(() => {
|
|
13561
14661
|
actions.completeCopy(element);
|
|
13562
14662
|
if (instanceId) {
|
|
13563
|
-
updateLabelInstance(instanceId, "copied");
|
|
14663
|
+
actions.updateLabelInstance(instanceId, "copied");
|
|
13564
14664
|
scheduleLabelFade(instanceId);
|
|
13565
14665
|
}
|
|
13566
14666
|
if (shouldDeactivateAfter) {
|
|
@@ -13578,9 +14678,9 @@ var init_core = __esm({
|
|
|
13578
14678
|
}
|
|
13579
14679
|
});
|
|
13580
14680
|
};
|
|
13581
|
-
const copyWithFallback = (elements, extraPrompt) => {
|
|
14681
|
+
const copyWithFallback = (elements, extraPrompt, resolvedComponentName2) => {
|
|
13582
14682
|
const firstElement = elements[0];
|
|
13583
|
-
const componentName = firstElement ? getComponentDisplayName(firstElement) : null;
|
|
14683
|
+
const componentName = resolvedComponentName2 ?? (firstElement ? getComponentDisplayName(firstElement) : null);
|
|
13584
14684
|
const tagName = firstElement ? getTagName(firstElement) : null;
|
|
13585
14685
|
const elementName = componentName ?? tagName ?? void 0;
|
|
13586
14686
|
return tryCopyWithFallback({
|
|
@@ -13592,11 +14692,50 @@ var init_core = __esm({
|
|
|
13592
14692
|
transformSnippet: pluginRegistry.hooks.transformSnippet,
|
|
13593
14693
|
transformCopyContent: pluginRegistry.hooks.transformCopyContent,
|
|
13594
14694
|
onAfterCopy: pluginRegistry.hooks.onAfterCopy,
|
|
13595
|
-
onCopySuccess:
|
|
14695
|
+
onCopySuccess: (copiedElements, content) => {
|
|
14696
|
+
pluginRegistry.hooks.onCopySuccess(copiedElements, content);
|
|
14697
|
+
const primaryElement = copiedElements[0];
|
|
14698
|
+
const isComment = Boolean(extraPrompt);
|
|
14699
|
+
if (primaryElement) {
|
|
14700
|
+
const currentItems = historyItems2();
|
|
14701
|
+
for (const [existingItemId, mappedElement] of historyElementMap.entries()) {
|
|
14702
|
+
if (mappedElement !== primaryElement) continue;
|
|
14703
|
+
const existingItem = currentItems.find((item) => item.id === existingItemId);
|
|
14704
|
+
if (!existingItem) continue;
|
|
14705
|
+
const shouldDedup = isComment ? existingItem.isComment && existingItem.commentText === extraPrompt : !existingItem.isComment;
|
|
14706
|
+
if (shouldDedup) {
|
|
14707
|
+
removeHistoryItem(existingItemId);
|
|
14708
|
+
historyElementMap.delete(existingItemId);
|
|
14709
|
+
break;
|
|
14710
|
+
}
|
|
14711
|
+
}
|
|
14712
|
+
}
|
|
14713
|
+
const updatedHistoryItems = addHistoryItem({
|
|
14714
|
+
content,
|
|
14715
|
+
elementName: elementName ?? "element",
|
|
14716
|
+
tagName: tagName ?? "div",
|
|
14717
|
+
componentName: componentName ?? void 0,
|
|
14718
|
+
isComment,
|
|
14719
|
+
commentText: extraPrompt ?? void 0,
|
|
14720
|
+
timestamp: Date.now()
|
|
14721
|
+
});
|
|
14722
|
+
setHistoryItems(updatedHistoryItems);
|
|
14723
|
+
setHasUnreadHistoryItems(true);
|
|
14724
|
+
const newestHistoryItem = updatedHistoryItems[0];
|
|
14725
|
+
if (newestHistoryItem && primaryElement) {
|
|
14726
|
+
historyElementMap.set(newestHistoryItem.id, primaryElement);
|
|
14727
|
+
}
|
|
14728
|
+
const currentItemIds = new Set(updatedHistoryItems.map((item) => item.id));
|
|
14729
|
+
for (const mapItemId of historyElementMap.keys()) {
|
|
14730
|
+
if (!currentItemIds.has(mapItemId)) {
|
|
14731
|
+
historyElementMap.delete(mapItemId);
|
|
14732
|
+
}
|
|
14733
|
+
}
|
|
14734
|
+
},
|
|
13596
14735
|
onCopyError: pluginRegistry.hooks.onCopyError
|
|
13597
14736
|
}, elements, extraPrompt);
|
|
13598
14737
|
};
|
|
13599
|
-
const copyElementsToClipboard = async (targetElements, extraPrompt) => {
|
|
14738
|
+
const copyElementsToClipboard = async (targetElements, extraPrompt, resolvedComponentName2) => {
|
|
13600
14739
|
if (targetElements.length === 0) return;
|
|
13601
14740
|
for (const element of targetElements) {
|
|
13602
14741
|
pluginRegistry.hooks.onElementSelect(element);
|
|
@@ -13605,7 +14744,7 @@ var init_core = __esm({
|
|
|
13605
14744
|
}
|
|
13606
14745
|
}
|
|
13607
14746
|
await new Promise((resolve) => requestAnimationFrame(resolve));
|
|
13608
|
-
await copyWithFallback(targetElements, extraPrompt);
|
|
14747
|
+
await copyWithFallback(targetElements, extraPrompt, resolvedComponentName2);
|
|
13609
14748
|
void notifyElementsSelected(targetElements);
|
|
13610
14749
|
};
|
|
13611
14750
|
const performCopyWithLabel = ({
|
|
@@ -13629,7 +14768,7 @@ var init_core = __esm({
|
|
|
13629
14768
|
const labelPositionX = allElements.length > 1 ? overlayBounds.x + overlayBounds.width / 2 : positionX;
|
|
13630
14769
|
const tagName = getTagName(element);
|
|
13631
14770
|
void getNearestComponentName(element).then((componentName) => {
|
|
13632
|
-
void executeCopyOperation(labelPositionX, positionY, () => copyElementsToClipboard(allElements, extraPrompt), overlayBounds, tagName, componentName ?? void 0, element, shouldDeactivateAfter, elements).then(() => {
|
|
14771
|
+
void executeCopyOperation(labelPositionX, positionY, () => copyElementsToClipboard(allElements, extraPrompt, componentName ?? void 0), overlayBounds, tagName, componentName ?? void 0, element, shouldDeactivateAfter, elements).then(() => {
|
|
13633
14772
|
onComplete?.();
|
|
13634
14773
|
});
|
|
13635
14774
|
});
|
|
@@ -13651,9 +14790,10 @@ var init_core = __esm({
|
|
|
13651
14790
|
}, BOUNDS_RECALC_INTERVAL_MS);
|
|
13652
14791
|
onCleanup(() => clearInterval(intervalId));
|
|
13653
14792
|
});
|
|
13654
|
-
createEffect(on(
|
|
14793
|
+
createEffect(on(effectiveElement, (element) => {
|
|
13655
14794
|
if (componentNameDebounceTimerId !== null) {
|
|
13656
14795
|
clearTimeout(componentNameDebounceTimerId);
|
|
14796
|
+
componentNameDebounceTimerId = null;
|
|
13657
14797
|
}
|
|
13658
14798
|
if (!element) {
|
|
13659
14799
|
setDebouncedElementForComponentName(null);
|
|
@@ -13663,13 +14803,13 @@ var init_core = __esm({
|
|
|
13663
14803
|
componentNameDebounceTimerId = null;
|
|
13664
14804
|
setDebouncedElementForComponentName(element);
|
|
13665
14805
|
}, COMPONENT_NAME_DEBOUNCE_MS);
|
|
13666
|
-
onCleanup(() => {
|
|
13667
|
-
if (componentNameDebounceTimerId !== null) {
|
|
13668
|
-
clearTimeout(componentNameDebounceTimerId);
|
|
13669
|
-
componentNameDebounceTimerId = null;
|
|
13670
|
-
}
|
|
13671
|
-
});
|
|
13672
14806
|
}));
|
|
14807
|
+
onCleanup(() => {
|
|
14808
|
+
if (componentNameDebounceTimerId !== null) {
|
|
14809
|
+
clearTimeout(componentNameDebounceTimerId);
|
|
14810
|
+
componentNameDebounceTimerId = null;
|
|
14811
|
+
}
|
|
14812
|
+
});
|
|
13673
14813
|
createEffect(() => {
|
|
13674
14814
|
const elements = store.frozenElements;
|
|
13675
14815
|
const cleanup = freezeAnimations(elements);
|
|
@@ -13693,7 +14833,7 @@ var init_core = __esm({
|
|
|
13693
14833
|
};
|
|
13694
14834
|
const selectionElement = createMemo(() => getSelectionElement());
|
|
13695
14835
|
const isSelectionElementVisible = () => {
|
|
13696
|
-
const element =
|
|
14836
|
+
const element = selectionElement();
|
|
13697
14837
|
if (!element) return false;
|
|
13698
14838
|
if (store.isTouchMode && isDragging()) {
|
|
13699
14839
|
return isRendererActive();
|
|
@@ -13726,7 +14866,7 @@ var init_core = __esm({
|
|
|
13726
14866
|
}
|
|
13727
14867
|
return createFlatOverlayBounds(combineBounds(frozenBounds));
|
|
13728
14868
|
}
|
|
13729
|
-
const element =
|
|
14869
|
+
const element = selectionElement();
|
|
13730
14870
|
if (!element) return void 0;
|
|
13731
14871
|
return createElementBounds(element);
|
|
13732
14872
|
});
|
|
@@ -13845,7 +14985,19 @@ var init_core = __esm({
|
|
|
13845
14985
|
});
|
|
13846
14986
|
}));
|
|
13847
14987
|
createEffect(on(() => store.viewportVersion, () => agentManager._internal.updateBoundsOnViewportChange()));
|
|
13848
|
-
|
|
14988
|
+
const stateChangeGrabbedBoxes = createMemo(() => store.grabbedBoxes.map((box) => ({
|
|
14989
|
+
id: box.id,
|
|
14990
|
+
bounds: box.bounds,
|
|
14991
|
+
createdAt: box.createdAt
|
|
14992
|
+
})));
|
|
14993
|
+
const stateChangeLabelInstances = createMemo(() => store.labelInstances.map((instance) => ({
|
|
14994
|
+
id: instance.id,
|
|
14995
|
+
status: instance.status,
|
|
14996
|
+
tagName: instance.tagName,
|
|
14997
|
+
componentName: instance.componentName,
|
|
14998
|
+
createdAt: instance.createdAt
|
|
14999
|
+
})));
|
|
15000
|
+
createEffect(on(() => [isActivated(), isDragging(), isCopying(), isPromptMode(), crosshairVisible(), targetElement(), dragBounds(), pluginRegistry.store.theme.enabled, pluginRegistry.store.theme.selectionBox.enabled, pluginRegistry.store.theme.dragBox.enabled, isDraggingBeyondThreshold(), effectiveElement(), didJustCopy(), currentToolbarState(), stateChangeGrabbedBoxes(), stateChangeLabelInstances(), store.selectionFilePath], ([active, dragging, copying, inputMode, isCrosshairVisible, target, drag, themeEnabled, selectionBoxEnabled, dragBoxEnabled, draggingBeyondThreshold, effectiveTarget, justCopied, toolbarState, grabbedBoxes, labelInstances, selectionFilePath]) => {
|
|
13849
15001
|
const isSelectionBoxVisible = Boolean(themeEnabled && selectionBoxEnabled && active && !copying && !justCopied && !dragging && effectiveTarget != null);
|
|
13850
15002
|
const isDragBoxVisible = Boolean(themeEnabled && dragBoxEnabled && active && !copying && draggingBeyondThreshold);
|
|
13851
15003
|
pluginRegistry.hooks.onStateChange({
|
|
@@ -13863,12 +15015,9 @@ var init_core = __esm({
|
|
|
13863
15015
|
width: drag.width,
|
|
13864
15016
|
height: drag.height
|
|
13865
15017
|
} : null,
|
|
13866
|
-
grabbedBoxes
|
|
13867
|
-
|
|
13868
|
-
|
|
13869
|
-
createdAt: box.createdAt
|
|
13870
|
-
})),
|
|
13871
|
-
selectionFilePath: store.selectionFilePath,
|
|
15018
|
+
grabbedBoxes,
|
|
15019
|
+
labelInstances,
|
|
15020
|
+
selectionFilePath,
|
|
13872
15021
|
toolbarState
|
|
13873
15022
|
});
|
|
13874
15023
|
}));
|
|
@@ -13997,7 +15146,7 @@ var init_core = __esm({
|
|
|
13997
15146
|
actions.setInputText(value);
|
|
13998
15147
|
};
|
|
13999
15148
|
const handleInputSubmit = () => {
|
|
14000
|
-
actions.
|
|
15149
|
+
actions.clearLastCopied();
|
|
14001
15150
|
const frozenElements2 = [...store.frozenElements];
|
|
14002
15151
|
const element = store.frozenElement || targetElement();
|
|
14003
15152
|
const prompt = isPromptMode() ? store.inputText.trim() : "";
|
|
@@ -14006,18 +15155,17 @@ var init_core = __esm({
|
|
|
14006
15155
|
return;
|
|
14007
15156
|
}
|
|
14008
15157
|
const elements = frozenElements2.length > 0 ? frozenElements2 : element ? [element] : [];
|
|
14009
|
-
const currentSelectionBounds = elements.map((
|
|
15158
|
+
const currentSelectionBounds = elements.map((selectedElement) => createElementBounds(selectedElement));
|
|
14010
15159
|
const firstBounds = currentSelectionBounds[0];
|
|
14011
15160
|
const currentX = firstBounds.x + firstBounds.width / 2;
|
|
14012
15161
|
const currentY = firstBounds.y + firstBounds.height / 2;
|
|
14013
15162
|
const labelPositionX = currentX + store.copyOffsetFromCenterX;
|
|
14014
15163
|
if ((store.selectedAgent || hasAgentProvider()) && prompt) {
|
|
14015
|
-
elementInputCache.delete(element);
|
|
14016
15164
|
const currentReplySessionId = store.replySessionId;
|
|
14017
15165
|
const selectedAgent = store.selectedAgent;
|
|
14018
15166
|
deactivateRenderer();
|
|
14019
|
-
actions.
|
|
14020
|
-
actions.
|
|
15167
|
+
actions.clearReplySessionId();
|
|
15168
|
+
actions.setSelectedAgent(null);
|
|
14021
15169
|
void agentManager.session.start({
|
|
14022
15170
|
elements,
|
|
14023
15171
|
prompt,
|
|
@@ -14038,11 +15186,6 @@ var init_core = __esm({
|
|
|
14038
15186
|
actions.exitPromptMode();
|
|
14039
15187
|
actions.clearInputText();
|
|
14040
15188
|
actions.clearReplySessionId();
|
|
14041
|
-
if (prompt) {
|
|
14042
|
-
elementInputCache.set(element, prompt);
|
|
14043
|
-
} else {
|
|
14044
|
-
elementInputCache.delete(element);
|
|
14045
|
-
}
|
|
14046
15189
|
performCopyWithLabel({
|
|
14047
15190
|
element,
|
|
14048
15191
|
positionX: labelPositionX,
|
|
@@ -14053,17 +15196,13 @@ var init_core = __esm({
|
|
|
14053
15196
|
});
|
|
14054
15197
|
};
|
|
14055
15198
|
const handleInputCancel = () => {
|
|
14056
|
-
actions.
|
|
15199
|
+
actions.clearLastCopied();
|
|
14057
15200
|
if (!isPromptMode()) return;
|
|
14058
15201
|
const currentInput = store.inputText.trim();
|
|
14059
15202
|
if (currentInput && !isPendingDismiss()) {
|
|
14060
15203
|
actions.setPendingDismiss(true);
|
|
14061
15204
|
return;
|
|
14062
15205
|
}
|
|
14063
|
-
const element = store.frozenElement || targetElement();
|
|
14064
|
-
if (element && currentInput) {
|
|
14065
|
-
elementInputCache.set(element, currentInput);
|
|
14066
|
-
}
|
|
14067
15206
|
actions.clearInputText();
|
|
14068
15207
|
actions.clearReplySessionId();
|
|
14069
15208
|
deactivateRenderer();
|
|
@@ -14125,7 +15264,7 @@ var init_core = __esm({
|
|
|
14125
15264
|
};
|
|
14126
15265
|
const enterCommentModeForElement = (element, positionX, positionY) => {
|
|
14127
15266
|
actions.setPendingCommentMode(false);
|
|
14128
|
-
|
|
15267
|
+
actions.clearInputText();
|
|
14129
15268
|
actions.enterPromptMode({
|
|
14130
15269
|
x: positionX,
|
|
14131
15270
|
y: positionY
|
|
@@ -14155,7 +15294,7 @@ var init_core = __esm({
|
|
|
14155
15294
|
};
|
|
14156
15295
|
saveToolbarState(newState);
|
|
14157
15296
|
setCurrentToolbarState(newState);
|
|
14158
|
-
toolbarStateChangeCallbacks.forEach((
|
|
15297
|
+
toolbarStateChangeCallbacks.forEach((callback) => callback(newState));
|
|
14159
15298
|
if (!newEnabled) {
|
|
14160
15299
|
if (isHoldingKeys()) {
|
|
14161
15300
|
actions.release();
|
|
@@ -14163,6 +15302,7 @@ var init_core = __esm({
|
|
|
14163
15302
|
if (isActivated()) {
|
|
14164
15303
|
deactivateRenderer();
|
|
14165
15304
|
}
|
|
15305
|
+
dismissHistoryDropdown();
|
|
14166
15306
|
if (toggleFeedbackTimerId !== null) {
|
|
14167
15307
|
window.clearTimeout(toggleFeedbackTimerId);
|
|
14168
15308
|
toggleFeedbackTimerId = null;
|
|
@@ -14372,6 +15512,7 @@ var init_core = __esm({
|
|
|
14372
15512
|
};
|
|
14373
15513
|
const handleEnterKeyActivation = (event) => {
|
|
14374
15514
|
if (!isEnterCode(event.code)) return false;
|
|
15515
|
+
if (isKeyboardEventTriggeredByInput(event)) return false;
|
|
14375
15516
|
const copiedElement = store.lastCopiedElement;
|
|
14376
15517
|
const canActivateFromCopied = !isHoldingKeys() && !isPromptMode() && !isActivated() && copiedElement && isElementConnected(copiedElement) && !store.labelInstances.some((instance) => instance.status === "copied" || instance.status === "fading");
|
|
14377
15518
|
if (canActivateFromCopied) {
|
|
@@ -14382,7 +15523,7 @@ var init_core = __esm({
|
|
|
14382
15523
|
actions.setPointer(center);
|
|
14383
15524
|
preparePromptMode(copiedElement, center.x, center.y);
|
|
14384
15525
|
actions.setFrozenElement(copiedElement);
|
|
14385
|
-
actions.
|
|
15526
|
+
actions.clearLastCopied();
|
|
14386
15527
|
activatePromptMode();
|
|
14387
15528
|
if (!isActivated()) {
|
|
14388
15529
|
activateRenderer();
|
|
@@ -14449,7 +15590,11 @@ var init_core = __esm({
|
|
|
14449
15590
|
const shouldDeactivate = store.wasActivatedByToggle;
|
|
14450
15591
|
const overlayBounds = createFlatOverlayBounds(bounds);
|
|
14451
15592
|
const selectionBoundsArray = allBounds.length > 1 ? allBounds : singleBounds ? [singleBounds] : [];
|
|
14452
|
-
const instanceId = createLabelInstance(overlayBounds, tagName, void 0, "copying",
|
|
15593
|
+
const instanceId = createLabelInstance(overlayBounds, tagName, void 0, "copying", {
|
|
15594
|
+
element: element ?? void 0,
|
|
15595
|
+
mouseX: bounds.x + bounds.width / 2,
|
|
15596
|
+
boundsMultiple: selectionBoundsArray
|
|
15597
|
+
});
|
|
14453
15598
|
isScreenshotInProgress = true;
|
|
14454
15599
|
rendererRoot.style.visibility = "hidden";
|
|
14455
15600
|
const elementsForScreenshot = store.frozenElements.length > 0 ? [...store.frozenElements] : element ? [element] : [];
|
|
@@ -14469,7 +15614,7 @@ var init_core = __esm({
|
|
|
14469
15614
|
}
|
|
14470
15615
|
isScreenshotInProgress = false;
|
|
14471
15616
|
rendererRoot.style.visibility = "";
|
|
14472
|
-
updateLabelInstance(instanceId, didSucceed ? "copied" : "error", didSucceed ? void 0 : errorMessage || "Unknown error");
|
|
15617
|
+
actions.updateLabelInstance(instanceId, didSucceed ? "copied" : "error", didSucceed ? void 0 : errorMessage || "Unknown error");
|
|
14473
15618
|
scheduleLabelFade(instanceId);
|
|
14474
15619
|
if (shouldDeactivate) {
|
|
14475
15620
|
deactivateRenderer();
|
|
@@ -14528,13 +15673,9 @@ var init_core = __esm({
|
|
|
14528
15673
|
});
|
|
14529
15674
|
};
|
|
14530
15675
|
const availableActionCycleItems = createMemo(() => {
|
|
14531
|
-
|
|
14532
|
-
if (!element) return [];
|
|
14533
|
-
const actionsById = new Map(pluginRegistry.store.actions.map((action) => [action.id, action]));
|
|
15676
|
+
if (!selectionElement()) return [];
|
|
14534
15677
|
const cycleItems = [];
|
|
14535
|
-
for (const
|
|
14536
|
-
const action = actionsById.get(actionId);
|
|
14537
|
-
if (!action) continue;
|
|
15678
|
+
for (const action of pluginRegistry.store.actions) {
|
|
14538
15679
|
const isStaticallyDisabled = typeof action.enabled === "boolean" && !action.enabled;
|
|
14539
15680
|
if (isStaticallyDisabled) continue;
|
|
14540
15681
|
cycleItems.push({
|
|
@@ -14570,33 +15711,23 @@ var init_core = __esm({
|
|
|
14570
15711
|
}
|
|
14571
15712
|
}, ACTION_CYCLE_IDLE_TRIGGER_MS);
|
|
14572
15713
|
};
|
|
14573
|
-
const
|
|
15714
|
+
const advanceActionCycle = () => {
|
|
15715
|
+
if (!canCycleActions()) return false;
|
|
15716
|
+
const cycleItems = availableActionCycleItems();
|
|
14574
15717
|
if (cycleItems.length === 0) return false;
|
|
14575
15718
|
setActionCycleItems(cycleItems);
|
|
14576
15719
|
const currentIndex = actionCycleActiveIndex();
|
|
14577
15720
|
const isCurrentIndexValid = currentIndex !== null && currentIndex < cycleItems.length;
|
|
14578
|
-
const
|
|
14579
|
-
let nextIndex;
|
|
14580
|
-
if (!isCurrentIndexValid) {
|
|
14581
|
-
nextIndex = direction === "forward" ? 0 : cycleItems.length - 1;
|
|
14582
|
-
} else {
|
|
14583
|
-
nextIndex = (currentIndex + stepOffset + cycleItems.length) % cycleItems.length;
|
|
14584
|
-
}
|
|
15721
|
+
const nextIndex = isCurrentIndexValid ? (currentIndex + 1) % cycleItems.length : 0;
|
|
14585
15722
|
setActionCycleActiveIndex(nextIndex);
|
|
14586
15723
|
scheduleActionCycleActivation();
|
|
14587
15724
|
return true;
|
|
14588
15725
|
};
|
|
14589
|
-
const handleActionCycleInput = (direction) => {
|
|
14590
|
-
if (!canCycleActions()) return false;
|
|
14591
|
-
const cycleItems = availableActionCycleItems();
|
|
14592
|
-
if (cycleItems.length === 0) return false;
|
|
14593
|
-
return applyActionCycleItems(cycleItems, direction);
|
|
14594
|
-
};
|
|
14595
15726
|
const handleActionCycleKey = (event) => {
|
|
14596
15727
|
if (event.code !== "KeyC") return false;
|
|
14597
15728
|
if (event.altKey || event.repeat) return false;
|
|
14598
15729
|
if (isKeyboardEventTriggeredByInput(event)) return false;
|
|
14599
|
-
if (!
|
|
15730
|
+
if (!advanceActionCycle()) return false;
|
|
14600
15731
|
event.preventDefault();
|
|
14601
15732
|
event.stopPropagation();
|
|
14602
15733
|
if (event.metaKey || event.ctrlKey) {
|
|
@@ -14604,31 +15735,18 @@ var init_core = __esm({
|
|
|
14604
15735
|
}
|
|
14605
15736
|
return true;
|
|
14606
15737
|
};
|
|
14607
|
-
const actionCycleScrollCycler = createScrollCycler({
|
|
14608
|
-
thresholdPx: ACTION_CYCLE_SCROLL_THRESHOLD_PX,
|
|
14609
|
-
throttleMs: ACTION_CYCLE_INPUT_THROTTLE_MS,
|
|
14610
|
-
lineHeightPx: ACTION_CYCLE_SCROLL_LINE_HEIGHT_PX,
|
|
14611
|
-
onStep: handleActionCycleInput
|
|
14612
|
-
});
|
|
14613
|
-
const handleActionCycleWheel = (event) => {
|
|
14614
|
-
if (!canCycleActions()) return;
|
|
14615
|
-
const isActionCycleActive = actionCycleActiveIndex() !== null;
|
|
14616
|
-
if (!isActionCycleActive) {
|
|
14617
|
-
const cycleItems = availableActionCycleItems();
|
|
14618
|
-
if (cycleItems.length === 0) return;
|
|
14619
|
-
}
|
|
14620
|
-
event.preventDefault();
|
|
14621
|
-
event.stopPropagation();
|
|
14622
|
-
actionCycleScrollCycler.handleWheel(event);
|
|
14623
|
-
};
|
|
14624
15738
|
const handleActivationKeys = (event) => {
|
|
14625
15739
|
if (!pluginRegistry.store.options.allowActivationInsideInput && isKeyboardEventTriggeredByInput(event)) {
|
|
14626
15740
|
return;
|
|
14627
15741
|
}
|
|
14628
15742
|
if (!isTargetKeyCombination(event, pluginRegistry.store.options)) {
|
|
14629
|
-
if (
|
|
14630
|
-
if (
|
|
15743
|
+
if ((event.metaKey || event.ctrlKey) && !MODIFIER_KEYS.includes(event.key) && !isEnterCode(event.code)) {
|
|
15744
|
+
if (isActivated() && !store.wasActivatedByToggle) {
|
|
14631
15745
|
deactivateRenderer();
|
|
15746
|
+
} else if (isHoldingKeys()) {
|
|
15747
|
+
clearHoldTimer();
|
|
15748
|
+
resetCopyConfirmation();
|
|
15749
|
+
actions.release();
|
|
14632
15750
|
}
|
|
14633
15751
|
}
|
|
14634
15752
|
if (!isEnterCode(event.code) || !isHoldingKeys()) {
|
|
@@ -14697,6 +15815,10 @@ var init_core = __esm({
|
|
|
14697
15815
|
handleInputCancel();
|
|
14698
15816
|
return;
|
|
14699
15817
|
}
|
|
15818
|
+
if (event.key === "Escape" && historyDropdownPosition() !== null) {
|
|
15819
|
+
dismissHistoryDropdown();
|
|
15820
|
+
return;
|
|
15821
|
+
}
|
|
14700
15822
|
const isFromOverlay = isEventFromOverlay(event, "data-react-grab-ignore-events") && !isEnterToActivateInput;
|
|
14701
15823
|
if (isPromptMode() || isFromOverlay) {
|
|
14702
15824
|
if (event.key === "Escape") {
|
|
@@ -14728,18 +15850,18 @@ var init_core = __esm({
|
|
|
14728
15850
|
return;
|
|
14729
15851
|
}
|
|
14730
15852
|
}
|
|
14731
|
-
|
|
15853
|
+
const didWindowJustRegainFocus = Date.now() - lastWindowFocusTimestamp < WINDOW_REFOCUS_GRACE_PERIOD_MS;
|
|
15854
|
+
if (!didWindowJustRegainFocus && handleActionCycleKey(event)) return;
|
|
14732
15855
|
if (handleArrowNavigation(event)) return;
|
|
14733
15856
|
if (handleEnterKeyActivation(event)) return;
|
|
14734
15857
|
if (handleOpenFileShortcut(event)) return;
|
|
14735
15858
|
if (handleScreenshotShortcut(event)) return;
|
|
14736
|
-
|
|
15859
|
+
if (!didWindowJustRegainFocus) {
|
|
15860
|
+
handleActivationKeys(event);
|
|
15861
|
+
}
|
|
14737
15862
|
}, {
|
|
14738
15863
|
capture: true
|
|
14739
15864
|
});
|
|
14740
|
-
eventListenerManager.addWindowListener("wheel", handleActionCycleWheel, {
|
|
14741
|
-
passive: false
|
|
14742
|
-
});
|
|
14743
15865
|
eventListenerManager.addWindowListener("keyup", (event) => {
|
|
14744
15866
|
if (blockEnterIfNeeded(event)) return;
|
|
14745
15867
|
const requiredModifiers = getRequiredModifiers(pluginRegistry.store.options);
|
|
@@ -14810,6 +15932,7 @@ var init_core = __esm({
|
|
|
14810
15932
|
actions.setTouchMode(isTouchPointer);
|
|
14811
15933
|
if (isEventFromOverlay(event, "data-react-grab-ignore-events")) return;
|
|
14812
15934
|
if (store.contextMenuPosition !== null) return;
|
|
15935
|
+
if (isTouchPointer && !isHoldingKeys() && !isActivated()) return;
|
|
14813
15936
|
const isActiveState = isTouchPointer ? isHoldingKeys() : isActivated();
|
|
14814
15937
|
if (isActiveState && !isPromptMode() && isToggleFrozen()) {
|
|
14815
15938
|
actions.unfreeze();
|
|
@@ -14880,6 +16003,7 @@ var init_core = __esm({
|
|
|
14880
16003
|
actions.setPointer(position);
|
|
14881
16004
|
actions.freeze();
|
|
14882
16005
|
actions.showContextMenu(position, element);
|
|
16006
|
+
dismissHistoryDropdown();
|
|
14883
16007
|
pluginRegistry.hooks.onContextMenu(element, position);
|
|
14884
16008
|
}, {
|
|
14885
16009
|
capture: true
|
|
@@ -14919,7 +16043,18 @@ var init_core = __esm({
|
|
|
14919
16043
|
}
|
|
14920
16044
|
}
|
|
14921
16045
|
});
|
|
16046
|
+
eventListenerManager.addWindowListener("blur", () => {
|
|
16047
|
+
if (isHoldingKeys()) {
|
|
16048
|
+
clearHoldTimer();
|
|
16049
|
+
actions.release();
|
|
16050
|
+
resetCopyConfirmation();
|
|
16051
|
+
}
|
|
16052
|
+
});
|
|
16053
|
+
eventListenerManager.addWindowListener("focus", () => {
|
|
16054
|
+
lastWindowFocusTimestamp = Date.now();
|
|
16055
|
+
});
|
|
14922
16056
|
const redetectElementUnderPointer = () => {
|
|
16057
|
+
if (store.isTouchMode && !isHoldingKeys() && !isActivated()) return;
|
|
14923
16058
|
if (isEnabled() && !isPromptMode() && !isToggleFrozen() && !isDragging() && store.contextMenuPosition === null && store.frozenElements.length === 0) {
|
|
14924
16059
|
const candidate = getElementAtPosition(store.pointer.x, store.pointer.y);
|
|
14925
16060
|
actions.setDetectedElement(candidate);
|
|
@@ -15007,11 +16142,17 @@ var init_core = __esm({
|
|
|
15007
16142
|
});
|
|
15008
16143
|
onCleanup(() => {
|
|
15009
16144
|
eventListenerManager.abort();
|
|
16145
|
+
if (dragPreviewDebounceTimerId !== null) {
|
|
16146
|
+
window.clearTimeout(dragPreviewDebounceTimerId);
|
|
16147
|
+
}
|
|
15010
16148
|
if (keydownSpamTimerId) window.clearTimeout(keydownSpamTimerId);
|
|
15011
16149
|
if (toggleFeedbackTimerId) window.clearTimeout(toggleFeedbackTimerId);
|
|
15012
16150
|
if (actionCycleIdleTimeoutId) {
|
|
15013
16151
|
window.clearTimeout(actionCycleIdleTimeoutId);
|
|
15014
16152
|
}
|
|
16153
|
+
if (historyPositionFrameId !== null) {
|
|
16154
|
+
cancelAnimationFrame(historyPositionFrameId);
|
|
16155
|
+
}
|
|
15015
16156
|
grabbedBoxTimeouts.forEach((timeoutId) => window.clearTimeout(timeoutId));
|
|
15016
16157
|
grabbedBoxTimeouts.clear();
|
|
15017
16158
|
autoScroller.stop();
|
|
@@ -15021,16 +16162,21 @@ var init_core = __esm({
|
|
|
15021
16162
|
keyboardClaimer.restore();
|
|
15022
16163
|
});
|
|
15023
16164
|
const rendererRoot = mountRoot(styles_default);
|
|
16165
|
+
const isThemeEnabled = createMemo(() => pluginRegistry.store.theme.enabled);
|
|
16166
|
+
const isSelectionBoxThemeEnabled = createMemo(() => pluginRegistry.store.theme.selectionBox.enabled);
|
|
16167
|
+
const isElementLabelThemeEnabled = createMemo(() => pluginRegistry.store.theme.elementLabel.enabled);
|
|
16168
|
+
const isDragBoxThemeEnabled = createMemo(() => pluginRegistry.store.theme.dragBox.enabled);
|
|
16169
|
+
const isSelectionSuppressed = createMemo(() => didJustCopy());
|
|
16170
|
+
const hasDragPreviewBounds = createMemo(() => dragPreviewBounds().length > 0);
|
|
15024
16171
|
const selectionVisible = createMemo(() => {
|
|
15025
|
-
if (!
|
|
15026
|
-
if (!
|
|
15027
|
-
if (
|
|
15028
|
-
|
|
15029
|
-
if (hasDragPreview) return true;
|
|
16172
|
+
if (!isThemeEnabled()) return false;
|
|
16173
|
+
if (!isSelectionBoxThemeEnabled()) return false;
|
|
16174
|
+
if (isSelectionSuppressed()) return false;
|
|
16175
|
+
if (hasDragPreviewBounds()) return true;
|
|
15030
16176
|
return isSelectionElementVisible();
|
|
15031
16177
|
});
|
|
15032
16178
|
const selectionTagName = createMemo(() => {
|
|
15033
|
-
const element =
|
|
16179
|
+
const element = selectionElement();
|
|
15034
16180
|
if (!element) return void 0;
|
|
15035
16181
|
return getTagName(element) || void 0;
|
|
15036
16182
|
});
|
|
@@ -15051,13 +16197,13 @@ var init_core = __esm({
|
|
|
15051
16197
|
const selectionComponentName = resolvedComponentName;
|
|
15052
16198
|
const selectionLabelVisible = createMemo(() => {
|
|
15053
16199
|
if (store.contextMenuPosition !== null) return false;
|
|
15054
|
-
if (!
|
|
15055
|
-
if (
|
|
16200
|
+
if (!isElementLabelThemeEnabled()) return false;
|
|
16201
|
+
if (isSelectionSuppressed()) return false;
|
|
15056
16202
|
return isSelectionElementVisible();
|
|
15057
16203
|
});
|
|
15058
16204
|
const labelInstanceCache = /* @__PURE__ */ new Map();
|
|
15059
16205
|
const computedLabelInstances = createMemo(() => {
|
|
15060
|
-
if (!
|
|
16206
|
+
if (!isThemeEnabled()) return [];
|
|
15061
16207
|
if (!pluginRegistry.store.theme.grabbedBoxes.enabled) return [];
|
|
15062
16208
|
void store.viewportVersion;
|
|
15063
16209
|
const currentIds = new Set(store.labelInstances.map((i2) => i2.id));
|
|
@@ -15089,7 +16235,7 @@ var init_core = __esm({
|
|
|
15089
16235
|
});
|
|
15090
16236
|
});
|
|
15091
16237
|
const computedGrabbedBoxes = createMemo(() => {
|
|
15092
|
-
if (!
|
|
16238
|
+
if (!isThemeEnabled()) return [];
|
|
15093
16239
|
if (!pluginRegistry.store.theme.grabbedBoxes.enabled) return [];
|
|
15094
16240
|
void store.viewportVersion;
|
|
15095
16241
|
return store.grabbedBoxes.map((box) => {
|
|
@@ -15102,11 +16248,11 @@ var init_core = __esm({
|
|
|
15102
16248
|
};
|
|
15103
16249
|
});
|
|
15104
16250
|
});
|
|
15105
|
-
const dragVisible = createMemo(() =>
|
|
16251
|
+
const dragVisible = createMemo(() => isThemeEnabled() && isDragBoxThemeEnabled() && isRendererActive() && isDraggingBeyondThreshold());
|
|
15106
16252
|
const labelVariant = createMemo(() => isCopying() ? "processing" : "hover");
|
|
15107
16253
|
const labelVisible = createMemo(() => {
|
|
15108
|
-
if (!
|
|
15109
|
-
const themeEnabled =
|
|
16254
|
+
if (!isThemeEnabled()) return false;
|
|
16255
|
+
const themeEnabled = isElementLabelThemeEnabled();
|
|
15110
16256
|
const inPromptMode = isPromptMode();
|
|
15111
16257
|
const copying = isCopying();
|
|
15112
16258
|
const rendererActive = isRendererActive();
|
|
@@ -15151,16 +16297,7 @@ var init_core = __esm({
|
|
|
15151
16297
|
const [contextMenuFilePath] = createResource(() => store.contextMenuElement, async (element) => {
|
|
15152
16298
|
if (!element) return null;
|
|
15153
16299
|
const stack = await getStack(element);
|
|
15154
|
-
|
|
15155
|
-
for (const frame of stack) {
|
|
15156
|
-
if (frame.fileName && Pe2(frame.fileName)) {
|
|
15157
|
-
return {
|
|
15158
|
-
filePath: Ne2(frame.fileName),
|
|
15159
|
-
lineNumber: frame.lineNumber
|
|
15160
|
-
};
|
|
15161
|
-
}
|
|
15162
|
-
}
|
|
15163
|
-
return null;
|
|
16300
|
+
return resolveSourceFromStack(stack);
|
|
15164
16301
|
});
|
|
15165
16302
|
const createPerformWithFeedback = (element, elements, tagName, componentName, options) => {
|
|
15166
16303
|
return async (action) => {
|
|
@@ -15176,7 +16313,12 @@ var init_core = __esm({
|
|
|
15176
16313
|
actions.hideContextMenu();
|
|
15177
16314
|
if (labelBounds) {
|
|
15178
16315
|
const labelPositionX = hasMultipleElements ? labelBounds.x + labelBounds.width / 2 : position.x;
|
|
15179
|
-
const labelInstanceId = createLabelInstance(labelBounds, tagName || "element", componentName, "copying",
|
|
16316
|
+
const labelInstanceId = createLabelInstance(labelBounds, tagName || "element", componentName, "copying", {
|
|
16317
|
+
element,
|
|
16318
|
+
mouseX: labelPositionX,
|
|
16319
|
+
elements: hasMultipleElements ? elements : void 0,
|
|
16320
|
+
boundsMultiple: selectionBoundsForLabel
|
|
16321
|
+
});
|
|
15180
16322
|
let didSucceed = false;
|
|
15181
16323
|
let errorMessage;
|
|
15182
16324
|
try {
|
|
@@ -15187,7 +16329,7 @@ var init_core = __esm({
|
|
|
15187
16329
|
} catch (error) {
|
|
15188
16330
|
errorMessage = error instanceof Error && error.message ? error.message : "Action failed";
|
|
15189
16331
|
}
|
|
15190
|
-
updateLabelInstance(labelInstanceId, didSucceed ? "copied" : "error", didSucceed ? void 0 : errorMessage || "Unknown error");
|
|
16332
|
+
actions.updateLabelInstance(labelInstanceId, didSucceed ? "copied" : "error", didSucceed ? void 0 : errorMessage || "Unknown error");
|
|
15191
16333
|
scheduleLabelFade(labelInstanceId);
|
|
15192
16334
|
} else {
|
|
15193
16335
|
try {
|
|
@@ -15205,7 +16347,7 @@ var init_core = __esm({
|
|
|
15205
16347
|
const deferHideContextMenu = () => {
|
|
15206
16348
|
setTimeout(() => {
|
|
15207
16349
|
actions.hideContextMenu();
|
|
15208
|
-
},
|
|
16350
|
+
}, DEFERRED_EXECUTION_DELAY_MS);
|
|
15209
16351
|
};
|
|
15210
16352
|
const buildActionContext = (options) => {
|
|
15211
16353
|
const {
|
|
@@ -15238,6 +16380,7 @@ var init_core = __esm({
|
|
|
15238
16380
|
if (agent) {
|
|
15239
16381
|
actions.setSelectedAgent(agent);
|
|
15240
16382
|
}
|
|
16383
|
+
actions.clearLabelInstances();
|
|
15241
16384
|
onBeforePrompt?.();
|
|
15242
16385
|
preparePromptMode(element, position.x, position.y);
|
|
15243
16386
|
actions.setPointer({
|
|
@@ -15306,7 +16449,8 @@ var init_core = __esm({
|
|
|
15306
16449
|
if (agent) {
|
|
15307
16450
|
actions.setSelectedAgent(agent);
|
|
15308
16451
|
}
|
|
15309
|
-
|
|
16452
|
+
actions.clearLabelInstances();
|
|
16453
|
+
actions.clearInputText();
|
|
15310
16454
|
actions.enterPromptMode(position, element);
|
|
15311
16455
|
deferHideContextMenu();
|
|
15312
16456
|
}
|
|
@@ -15316,7 +16460,283 @@ var init_core = __esm({
|
|
|
15316
16460
|
setTimeout(() => {
|
|
15317
16461
|
actions.hideContextMenu();
|
|
15318
16462
|
deactivateRenderer();
|
|
15319
|
-
},
|
|
16463
|
+
}, DEFERRED_EXECUTION_DELAY_MS);
|
|
16464
|
+
};
|
|
16465
|
+
const clearHistoryHoverPreviews = () => {
|
|
16466
|
+
for (const {
|
|
16467
|
+
boxId,
|
|
16468
|
+
labelId
|
|
16469
|
+
} of historyHoverPreviews) {
|
|
16470
|
+
actions.removeGrabbedBox(boxId);
|
|
16471
|
+
if (labelId) {
|
|
16472
|
+
actions.removeLabelInstance(labelId);
|
|
16473
|
+
}
|
|
16474
|
+
}
|
|
16475
|
+
historyHoverPreviews = [];
|
|
16476
|
+
};
|
|
16477
|
+
const addHistoryItemPreview = (item, element, idPrefix) => {
|
|
16478
|
+
const bounds = createElementBounds(element);
|
|
16479
|
+
const boxId = `${idPrefix}-${item.id}`;
|
|
16480
|
+
actions.addGrabbedBox({
|
|
16481
|
+
id: boxId,
|
|
16482
|
+
bounds,
|
|
16483
|
+
createdAt: 0,
|
|
16484
|
+
element
|
|
16485
|
+
});
|
|
16486
|
+
const hasCommentText = item.isComment && item.commentText;
|
|
16487
|
+
const labelId = `${idPrefix}-label-${item.id}`;
|
|
16488
|
+
actions.addLabelInstance({
|
|
16489
|
+
id: labelId,
|
|
16490
|
+
bounds,
|
|
16491
|
+
tagName: item.tagName,
|
|
16492
|
+
componentName: item.componentName,
|
|
16493
|
+
status: "idle",
|
|
16494
|
+
isPromptMode: Boolean(hasCommentText),
|
|
16495
|
+
inputValue: hasCommentText ? item.commentText : void 0,
|
|
16496
|
+
createdAt: 0,
|
|
16497
|
+
element,
|
|
16498
|
+
mouseX: bounds.x + bounds.width / 2
|
|
16499
|
+
});
|
|
16500
|
+
historyHoverPreviews.push({
|
|
16501
|
+
boxId,
|
|
16502
|
+
labelId
|
|
16503
|
+
});
|
|
16504
|
+
};
|
|
16505
|
+
const stopTrackingToolbarPosition = () => {
|
|
16506
|
+
if (historyPositionFrameId !== null) {
|
|
16507
|
+
cancelAnimationFrame(historyPositionFrameId);
|
|
16508
|
+
historyPositionFrameId = null;
|
|
16509
|
+
}
|
|
16510
|
+
};
|
|
16511
|
+
const getNearestEdge = (rect) => {
|
|
16512
|
+
const centerX = rect.left + rect.width / 2;
|
|
16513
|
+
const centerY = rect.top + rect.height / 2;
|
|
16514
|
+
const distanceToTop = centerY;
|
|
16515
|
+
const distanceToBottom = window.innerHeight - centerY;
|
|
16516
|
+
const distanceToLeft = centerX;
|
|
16517
|
+
const distanceToRight = window.innerWidth - centerX;
|
|
16518
|
+
const minimumDistance = Math.min(distanceToTop, distanceToBottom, distanceToLeft, distanceToRight);
|
|
16519
|
+
if (minimumDistance === distanceToTop) return "top";
|
|
16520
|
+
if (minimumDistance === distanceToLeft) return "left";
|
|
16521
|
+
if (minimumDistance === distanceToRight) return "right";
|
|
16522
|
+
return "bottom";
|
|
16523
|
+
};
|
|
16524
|
+
const startTrackingToolbarPosition = () => {
|
|
16525
|
+
stopTrackingToolbarPosition();
|
|
16526
|
+
const updatePosition = () => {
|
|
16527
|
+
if (!toolbarElement) return;
|
|
16528
|
+
const toolbarRect = toolbarElement.getBoundingClientRect();
|
|
16529
|
+
const edge = getNearestEdge(toolbarRect);
|
|
16530
|
+
let anchorX;
|
|
16531
|
+
let anchorY;
|
|
16532
|
+
if (edge === "left" || edge === "right") {
|
|
16533
|
+
anchorX = edge === "left" ? toolbarRect.right : toolbarRect.left;
|
|
16534
|
+
anchorY = toolbarRect.top + toolbarRect.height / 2;
|
|
16535
|
+
} else {
|
|
16536
|
+
anchorX = toolbarRect.left + toolbarRect.width / 2;
|
|
16537
|
+
anchorY = edge === "top" ? toolbarRect.bottom : toolbarRect.top;
|
|
16538
|
+
}
|
|
16539
|
+
setHistoryDropdownPosition({
|
|
16540
|
+
x: anchorX,
|
|
16541
|
+
y: anchorY,
|
|
16542
|
+
edge,
|
|
16543
|
+
toolbarWidth: toolbarRect.width
|
|
16544
|
+
});
|
|
16545
|
+
historyPositionFrameId = requestAnimationFrame(updatePosition);
|
|
16546
|
+
};
|
|
16547
|
+
historyPositionFrameId = requestAnimationFrame(updatePosition);
|
|
16548
|
+
};
|
|
16549
|
+
const dismissHistoryDropdown = () => {
|
|
16550
|
+
cancelHistoryHoverOpenTimeout();
|
|
16551
|
+
cancelHistoryHoverCloseTimeout();
|
|
16552
|
+
stopTrackingToolbarPosition();
|
|
16553
|
+
clearHistoryHoverPreviews();
|
|
16554
|
+
setHistoryDropdownPosition(null);
|
|
16555
|
+
setIsHistoryHoverOpen(false);
|
|
16556
|
+
};
|
|
16557
|
+
const openHistoryDropdown = () => {
|
|
16558
|
+
actions.hideContextMenu();
|
|
16559
|
+
setHistoryItems(loadHistory());
|
|
16560
|
+
setHasUnreadHistoryItems(false);
|
|
16561
|
+
startTrackingToolbarPosition();
|
|
16562
|
+
};
|
|
16563
|
+
let historyHoverOpenTimeoutId = null;
|
|
16564
|
+
let historyHoverCloseTimeoutId = null;
|
|
16565
|
+
const cancelHistoryHoverOpenTimeout = () => {
|
|
16566
|
+
if (historyHoverOpenTimeoutId !== null) {
|
|
16567
|
+
clearTimeout(historyHoverOpenTimeoutId);
|
|
16568
|
+
historyHoverOpenTimeoutId = null;
|
|
16569
|
+
}
|
|
16570
|
+
};
|
|
16571
|
+
const cancelHistoryHoverCloseTimeout = () => {
|
|
16572
|
+
if (historyHoverCloseTimeoutId !== null) {
|
|
16573
|
+
clearTimeout(historyHoverCloseTimeoutId);
|
|
16574
|
+
historyHoverCloseTimeoutId = null;
|
|
16575
|
+
}
|
|
16576
|
+
};
|
|
16577
|
+
const handleToggleHistory = () => {
|
|
16578
|
+
cancelHistoryHoverOpenTimeout();
|
|
16579
|
+
cancelHistoryHoverCloseTimeout();
|
|
16580
|
+
const isCurrentlyOpen = historyDropdownPosition() !== null;
|
|
16581
|
+
if (isCurrentlyOpen) {
|
|
16582
|
+
if (isHistoryHoverOpen()) {
|
|
16583
|
+
clearHistoryHoverPreviews();
|
|
16584
|
+
setIsHistoryHoverOpen(false);
|
|
16585
|
+
} else {
|
|
16586
|
+
dismissHistoryDropdown();
|
|
16587
|
+
}
|
|
16588
|
+
} else {
|
|
16589
|
+
clearHistoryHoverPreviews();
|
|
16590
|
+
openHistoryDropdown();
|
|
16591
|
+
}
|
|
16592
|
+
};
|
|
16593
|
+
const copyHistoryItemContent = (item) => {
|
|
16594
|
+
copyContent(item.content, {
|
|
16595
|
+
tagName: item.tagName,
|
|
16596
|
+
componentName: item.componentName ?? item.elementName,
|
|
16597
|
+
commentText: item.commentText
|
|
16598
|
+
});
|
|
16599
|
+
const element = historyElementMap.get(item.id);
|
|
16600
|
+
if (!element || !isElementConnected(element)) return;
|
|
16601
|
+
actions.clearLabelInstances();
|
|
16602
|
+
requestAnimationFrame(() => {
|
|
16603
|
+
if (!isElementConnected(element)) return;
|
|
16604
|
+
const bounds = createElementBounds(element);
|
|
16605
|
+
const instanceId = createLabelInstance(bounds, item.tagName, item.componentName, "copied", {
|
|
16606
|
+
element,
|
|
16607
|
+
mouseX: bounds.x + bounds.width / 2
|
|
16608
|
+
});
|
|
16609
|
+
scheduleLabelFade(instanceId);
|
|
16610
|
+
});
|
|
16611
|
+
};
|
|
16612
|
+
const handleHistoryItemSelect = (item) => {
|
|
16613
|
+
clearHistoryHoverPreviews();
|
|
16614
|
+
if (isPromptMode()) {
|
|
16615
|
+
actions.exitPromptMode();
|
|
16616
|
+
actions.clearInputText();
|
|
16617
|
+
}
|
|
16618
|
+
const element = historyElementMap.get(item.id);
|
|
16619
|
+
if (item.isComment && item.commentText && element && isElementConnected(element)) {
|
|
16620
|
+
const bounds = createElementBounds(element);
|
|
16621
|
+
const centerX = bounds.x + bounds.width / 2;
|
|
16622
|
+
const centerY = bounds.y + bounds.height / 2;
|
|
16623
|
+
actions.enterPromptMode({
|
|
16624
|
+
x: centerX,
|
|
16625
|
+
y: centerY
|
|
16626
|
+
}, element);
|
|
16627
|
+
actions.setInputText(item.commentText);
|
|
16628
|
+
} else {
|
|
16629
|
+
copyHistoryItemContent(item);
|
|
16630
|
+
}
|
|
16631
|
+
};
|
|
16632
|
+
const handleHistoryItemRemove = (item) => {
|
|
16633
|
+
clearHistoryHoverPreviews();
|
|
16634
|
+
historyElementMap.delete(item.id);
|
|
16635
|
+
const updatedHistoryItems = removeHistoryItem(item.id);
|
|
16636
|
+
setHistoryItems(updatedHistoryItems);
|
|
16637
|
+
if (updatedHistoryItems.length === 0) {
|
|
16638
|
+
setHasUnreadHistoryItems(false);
|
|
16639
|
+
dismissHistoryDropdown();
|
|
16640
|
+
}
|
|
16641
|
+
};
|
|
16642
|
+
const handleHistoryCopyAll = () => {
|
|
16643
|
+
clearHistoryHoverPreviews();
|
|
16644
|
+
const currentHistoryItems = historyItems2();
|
|
16645
|
+
if (currentHistoryItems.length === 0) return;
|
|
16646
|
+
const combinedContent = joinSnippets(currentHistoryItems.map((historyItem) => historyItem.content));
|
|
16647
|
+
const firstItem = currentHistoryItems[0];
|
|
16648
|
+
copyContent(combinedContent, {
|
|
16649
|
+
componentName: firstItem.componentName ?? firstItem.tagName,
|
|
16650
|
+
entries: currentHistoryItems.map((historyItem) => ({
|
|
16651
|
+
tagName: historyItem.tagName,
|
|
16652
|
+
componentName: historyItem.componentName ?? historyItem.elementName,
|
|
16653
|
+
content: historyItem.content,
|
|
16654
|
+
commentText: historyItem.commentText
|
|
16655
|
+
}))
|
|
16656
|
+
});
|
|
16657
|
+
actions.clearLabelInstances();
|
|
16658
|
+
requestAnimationFrame(() => {
|
|
16659
|
+
batch(() => {
|
|
16660
|
+
for (const historyItem of currentHistoryItems) {
|
|
16661
|
+
const element = historyElementMap.get(historyItem.id);
|
|
16662
|
+
if (!element || !isElementConnected(element)) continue;
|
|
16663
|
+
const bounds = createElementBounds(element);
|
|
16664
|
+
const labelId = `label-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
16665
|
+
actions.addLabelInstance({
|
|
16666
|
+
id: labelId,
|
|
16667
|
+
bounds,
|
|
16668
|
+
tagName: historyItem.tagName,
|
|
16669
|
+
componentName: historyItem.componentName,
|
|
16670
|
+
status: "copied",
|
|
16671
|
+
createdAt: Date.now(),
|
|
16672
|
+
element,
|
|
16673
|
+
mouseX: bounds.x + bounds.width / 2
|
|
16674
|
+
});
|
|
16675
|
+
scheduleLabelFade(labelId);
|
|
16676
|
+
}
|
|
16677
|
+
});
|
|
16678
|
+
});
|
|
16679
|
+
};
|
|
16680
|
+
const handleHistoryItemHover = (historyItemId) => {
|
|
16681
|
+
clearHistoryHoverPreviews();
|
|
16682
|
+
if (historyItemId) {
|
|
16683
|
+
const item = historyItems2().find((innerItem) => innerItem.id === historyItemId);
|
|
16684
|
+
const element = historyElementMap.get(historyItemId);
|
|
16685
|
+
if (item && element && isElementConnected(element)) {
|
|
16686
|
+
addHistoryItemPreview(item, element, "history-hover");
|
|
16687
|
+
}
|
|
16688
|
+
}
|
|
16689
|
+
};
|
|
16690
|
+
const handleHistoryButtonHover = (isHovered) => {
|
|
16691
|
+
cancelHistoryHoverOpenTimeout();
|
|
16692
|
+
clearHistoryHoverPreviews();
|
|
16693
|
+
if (isHovered) {
|
|
16694
|
+
cancelHistoryHoverCloseTimeout();
|
|
16695
|
+
if (historyDropdownPosition() === null) {
|
|
16696
|
+
showAllHistoryItemPreviews();
|
|
16697
|
+
historyHoverOpenTimeoutId = setTimeout(() => {
|
|
16698
|
+
historyHoverOpenTimeoutId = null;
|
|
16699
|
+
setIsHistoryHoverOpen(true);
|
|
16700
|
+
openHistoryDropdown();
|
|
16701
|
+
}, DROPDOWN_HOVER_OPEN_DELAY_MS);
|
|
16702
|
+
}
|
|
16703
|
+
} else if (isHistoryHoverOpen()) {
|
|
16704
|
+
historyHoverCloseTimeoutId = setTimeout(() => {
|
|
16705
|
+
historyHoverCloseTimeoutId = null;
|
|
16706
|
+
dismissHistoryDropdown();
|
|
16707
|
+
}, DROPDOWN_HOVER_OPEN_DELAY_MS);
|
|
16708
|
+
}
|
|
16709
|
+
};
|
|
16710
|
+
const handleHistoryDropdownHover = (isHovered) => {
|
|
16711
|
+
if (isHovered) {
|
|
16712
|
+
cancelHistoryHoverCloseTimeout();
|
|
16713
|
+
} else if (isHistoryHoverOpen()) {
|
|
16714
|
+
historyHoverCloseTimeoutId = setTimeout(() => {
|
|
16715
|
+
historyHoverCloseTimeoutId = null;
|
|
16716
|
+
dismissHistoryDropdown();
|
|
16717
|
+
}, DROPDOWN_HOVER_OPEN_DELAY_MS);
|
|
16718
|
+
}
|
|
16719
|
+
};
|
|
16720
|
+
const handleHistoryCopyAllHover = (isHovered) => {
|
|
16721
|
+
clearHistoryHoverPreviews();
|
|
16722
|
+
if (isHovered) {
|
|
16723
|
+
showAllHistoryItemPreviews();
|
|
16724
|
+
}
|
|
16725
|
+
};
|
|
16726
|
+
const showAllHistoryItemPreviews = () => {
|
|
16727
|
+
for (const item of historyItems2()) {
|
|
16728
|
+
const element = historyElementMap.get(item.id);
|
|
16729
|
+
if (element && isElementConnected(element)) {
|
|
16730
|
+
addHistoryItemPreview(item, element, "history-all-hover");
|
|
16731
|
+
}
|
|
16732
|
+
}
|
|
16733
|
+
};
|
|
16734
|
+
const handleHistoryClear = () => {
|
|
16735
|
+
historyElementMap.clear();
|
|
16736
|
+
const updatedHistoryItems = clearHistory();
|
|
16737
|
+
setHistoryItems(updatedHistoryItems);
|
|
16738
|
+
setHasUnreadHistoryItems(false);
|
|
16739
|
+
dismissHistoryDropdown();
|
|
15320
16740
|
};
|
|
15321
16741
|
const handleShowContextMenuSession = (sessionId) => {
|
|
15322
16742
|
const session = agentManager.sessions().get(sessionId);
|
|
@@ -15333,7 +16753,7 @@ var init_core = __esm({
|
|
|
15333
16753
|
actions.setFrozenElement(element);
|
|
15334
16754
|
actions.freeze();
|
|
15335
16755
|
actions.showContextMenu(session.position, element);
|
|
15336
|
-
},
|
|
16756
|
+
}, DEFERRED_EXECUTION_DELAY_MS);
|
|
15337
16757
|
};
|
|
15338
16758
|
const handleShowContextMenuInstance = (instanceId) => {
|
|
15339
16759
|
const instance = store.labelInstances.find((labelInstance) => labelInstance.id === instanceId);
|
|
@@ -15358,7 +16778,7 @@ var init_core = __esm({
|
|
|
15358
16778
|
}
|
|
15359
16779
|
actions.freeze();
|
|
15360
16780
|
actions.showContextMenu(position, instance.element);
|
|
15361
|
-
},
|
|
16781
|
+
}, DEFERRED_EXECUTION_DELAY_MS);
|
|
15362
16782
|
};
|
|
15363
16783
|
createEffect(() => {
|
|
15364
16784
|
const hue = pluginRegistry.store.theme.hue;
|
|
@@ -15505,7 +16925,7 @@ var init_core = __esm({
|
|
|
15505
16925
|
},
|
|
15506
16926
|
onToolbarStateChange: (state) => {
|
|
15507
16927
|
setCurrentToolbarState(state);
|
|
15508
|
-
toolbarStateChangeCallbacks.forEach((
|
|
16928
|
+
toolbarStateChangeCallbacks.forEach((callback) => callback(state));
|
|
15509
16929
|
},
|
|
15510
16930
|
onSubscribeToToolbarStateChanges: (callback) => {
|
|
15511
16931
|
toolbarStateChangeCallbacks.add(callback);
|
|
@@ -15514,6 +16934,9 @@ var init_core = __esm({
|
|
|
15514
16934
|
};
|
|
15515
16935
|
},
|
|
15516
16936
|
onToolbarSelectHoverChange: setIsToolbarSelectHovered,
|
|
16937
|
+
onToolbarRef: (element) => {
|
|
16938
|
+
toolbarElement = element;
|
|
16939
|
+
},
|
|
15517
16940
|
get contextMenuPosition() {
|
|
15518
16941
|
return contextMenuPosition();
|
|
15519
16942
|
},
|
|
@@ -15536,7 +16959,36 @@ var init_core = __esm({
|
|
|
15536
16959
|
return contextMenuActionContext();
|
|
15537
16960
|
},
|
|
15538
16961
|
onContextMenuDismiss: handleContextMenuDismiss,
|
|
15539
|
-
onContextMenuHide: deferHideContextMenu
|
|
16962
|
+
onContextMenuHide: deferHideContextMenu,
|
|
16963
|
+
get historyItems() {
|
|
16964
|
+
return historyItems2();
|
|
16965
|
+
},
|
|
16966
|
+
get historyDisconnectedItemIds() {
|
|
16967
|
+
return historyDisconnectedItemIds();
|
|
16968
|
+
},
|
|
16969
|
+
get historyItemCount() {
|
|
16970
|
+
return historyItems2().length;
|
|
16971
|
+
},
|
|
16972
|
+
get hasUnreadHistoryItems() {
|
|
16973
|
+
return hasUnreadHistoryItems();
|
|
16974
|
+
},
|
|
16975
|
+
get historyDropdownPosition() {
|
|
16976
|
+
return historyDropdownPosition();
|
|
16977
|
+
},
|
|
16978
|
+
get isHistoryPinned() {
|
|
16979
|
+
return memo(() => historyDropdownPosition() !== null)() && !isHistoryHoverOpen();
|
|
16980
|
+
},
|
|
16981
|
+
onToggleHistory: handleToggleHistory,
|
|
16982
|
+
onHistoryButtonHover: handleHistoryButtonHover,
|
|
16983
|
+
onHistoryItemSelect: handleHistoryItemSelect,
|
|
16984
|
+
onHistoryItemRemove: handleHistoryItemRemove,
|
|
16985
|
+
onHistoryItemCopy: copyHistoryItemContent,
|
|
16986
|
+
onHistoryItemHover: handleHistoryItemHover,
|
|
16987
|
+
onHistoryCopyAll: handleHistoryCopyAll,
|
|
16988
|
+
onHistoryCopyAllHover: handleHistoryCopyAllHover,
|
|
16989
|
+
onHistoryClear: handleHistoryClear,
|
|
16990
|
+
onHistoryDismiss: dismissHistoryDropdown,
|
|
16991
|
+
onHistoryDropdownHover: handleHistoryDropdownHover
|
|
15540
16992
|
});
|
|
15541
16993
|
}, rendererRoot);
|
|
15542
16994
|
}
|
|
@@ -15639,7 +17091,7 @@ var init_core = __esm({
|
|
|
15639
17091
|
if (state.enabled !== void 0 && state.enabled !== isEnabled()) {
|
|
15640
17092
|
setIsEnabled(state.enabled);
|
|
15641
17093
|
}
|
|
15642
|
-
toolbarStateChangeCallbacks.forEach((
|
|
17094
|
+
toolbarStateChangeCallbacks.forEach((callback) => callback(newState));
|
|
15643
17095
|
},
|
|
15644
17096
|
onToolbarStateChange: (callback) => {
|
|
15645
17097
|
toolbarStateChangeCallbacks.add(callback);
|
|
@@ -15649,23 +17101,22 @@ var init_core = __esm({
|
|
|
15649
17101
|
},
|
|
15650
17102
|
dispose: () => {
|
|
15651
17103
|
hasInited = false;
|
|
17104
|
+
cancelHistoryHoverOpenTimeout();
|
|
17105
|
+
cancelHistoryHoverCloseTimeout();
|
|
17106
|
+
stopTrackingToolbarPosition();
|
|
15652
17107
|
toolbarStateChangeCallbacks.clear();
|
|
15653
17108
|
dispose2();
|
|
15654
17109
|
},
|
|
15655
17110
|
copyElement: copyElementAPI,
|
|
15656
17111
|
getSource: async (element) => {
|
|
15657
17112
|
const stack = await getStack(element);
|
|
15658
|
-
|
|
15659
|
-
|
|
15660
|
-
|
|
15661
|
-
|
|
15662
|
-
|
|
15663
|
-
|
|
15664
|
-
|
|
15665
|
-
};
|
|
15666
|
-
}
|
|
15667
|
-
}
|
|
15668
|
-
return null;
|
|
17113
|
+
const source = resolveSourceFromStack(stack);
|
|
17114
|
+
if (!source) return null;
|
|
17115
|
+
return {
|
|
17116
|
+
filePath: source.filePath,
|
|
17117
|
+
lineNumber: source.lineNumber ?? null,
|
|
17118
|
+
componentName: source.componentName
|
|
17119
|
+
};
|
|
15669
17120
|
},
|
|
15670
17121
|
getState: () => ({
|
|
15671
17122
|
isActive: isActivated(),
|
|
@@ -15682,6 +17133,13 @@ var init_core = __esm({
|
|
|
15682
17133
|
bounds: box.bounds,
|
|
15683
17134
|
createdAt: box.createdAt
|
|
15684
17135
|
})),
|
|
17136
|
+
labelInstances: store.labelInstances.map((instance) => ({
|
|
17137
|
+
id: instance.id,
|
|
17138
|
+
status: instance.status,
|
|
17139
|
+
tagName: instance.tagName,
|
|
17140
|
+
componentName: instance.componentName,
|
|
17141
|
+
createdAt: instance.createdAt
|
|
17142
|
+
})),
|
|
15685
17143
|
selectionFilePath: store.selectionFilePath,
|
|
15686
17144
|
toolbarState: currentToolbarState()
|
|
15687
17145
|
}),
|