@htmlos-next/ui 0.0.6 → 0.0.8

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.
@@ -1,11 +1,10 @@
1
1
  import { default as React } from 'react';
2
2
  interface ContextMenuProps {
3
3
  open: boolean;
4
- x?: number;
5
- y?: number;
6
- from?: "top-left" | "top-right" | "bottom-left" | "bottom-right";
4
+ x: number;
5
+ y: number;
7
6
  children: React.ReactNode;
8
7
  }
9
- export declare function ContextMenu({ open, x, y, from, children, }: ContextMenuProps): import("react/jsx-runtime").JSX.Element;
8
+ export declare function ContextMenu({ open, x, y, children }: ContextMenuProps): import("react/jsx-runtime").JSX.Element;
10
9
  export {};
11
10
  //# sourceMappingURL=ContextMenu.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ContextMenu.d.ts","sourceRoot":"","sources":["../../../src/components/ContextMenu/ContextMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,UAAU,gBAAgB;IACxB,IAAI,EAAE,OAAO,CAAC;IACd,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,UAAU,GAAG,WAAW,GAAG,aAAa,GAAG,cAAc,CAAC;IACjE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,CAAM,EACN,CAAM,EACN,IAAiB,EACjB,QAAQ,GACT,EAAE,gBAAgB,2CAiClB"}
1
+ {"version":3,"file":"ContextMenu.d.ts","sourceRoot":"","sources":["../../../src/components/ContextMenu/ContextMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4C,MAAM,OAAO,CAAC;AAIjE,UAAU,gBAAgB;IACxB,IAAI,EAAE,OAAO,CAAC;IACd,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,wBAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,gBAAgB,2CAmDrE"}
@@ -1,10 +1,10 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode(`:root{--accent: #0088ff;--button-primary-bg: var(--accent);--button-primary-bg-hover: color-mix(in srgb, var(--accent), black 15%);--button-primary-bg-active: color-mix(in srgb, var(--accent), black 30%);--button-secondary-bg-hover: color-mix(in srgb, var(--accent), white 90%);--button-secondary-bg-active: color-mix(in srgb, var(--accent), white 90%);--button-disabled-bg: color-mix(in srgb, var(--accent), white 60%);--text-disabled: color-mix(in srgb, var(--text-primary), white 40%);--icon-color: var(--accent);--border-color: #0000001a;--surface-bg: #ffffff7a;--surface-bg-hover: #ffffffa1;--surface-bg-active: #ffffffd5;--card-bg: #e5e5e5;--card-bg-secondary: #f5f5f5;--overlay-bg: rgba(0, 0, 0, .4);--muted-bg: rgba(0, 0, 0, .06);--text-primary: #000000;--text-secondary: #8b8b8b;--text-inverse: #ffffff;--sidebar-width: 200px}[data-theme=dark]{--button-secondary-bg-hover: #252628;--button-secondary-bg-active: #2b2f35;--button-disabled-bg: color-mix(in srgb, var(--accent), black 60%);--text-disabled: color-mix(in srgb, var(--text-primary), black 40%);--surface-bg: #1e1e1e7a;--surface-bg-hover: #2a2a2aa1;--surface-bg-active: #3a3a3ad5;--card-bg: #1d1d1d;--card-bg-secondary: #2a2a2a;--overlay-bg: rgba(255, 255, 255, .4);--muted-bg: rgba(255, 255, 255, .12);--text-primary: #ffffff;--text-inverse: #000000;--text-secondary: #b3b3b3}body{color:var(--text-primary);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}[device-type=mobile] body{background-color:var(--card-bg-secondary)!important}*,*:before,*:after{box-sizing:border-box;-webkit-tap-highlight-color:transparent;-webkit-tap-highlight-color:rgba(0,0,0,0)}._sidebar_yoln4_1{width:var(--sidebar-width);background-color:var(--surface-bg);position:absolute;top:0;bottom:5px;height:auto;left:5px;border-radius:9px;transition:left .3s;display:flex;flex-direction:column;z-index:999;border:solid 1px var(--border-color);transform:translate(0)}._sidebarCollapsed_yoln4_18{left:calc(-1 * var(--sidebar-width) - 10px)}[device-type=mobile] ._sidebar_yoln4_1._sidebarMobile_yoln4_22{position:absolute;inset:0;width:auto;height:auto;border-radius:0;transition:transform .25s ease;background-color:var(--card-bg)}[device-type=mobile] ._sidebar_yoln4_1._sidebarMobile_yoln4_22._sidebarMobileHidden_yoln4_35{transform:translate(-105%)}._sidebarContent_yoln4_39{height:100%;padding:0 4px;display:flex;flex-direction:column;overflow-y:auto;gap:2px}._sidebarFooter_yoln4_48{padding:4px}._sidebarTitle_azx8n_1{font-size:.8rem;font-weight:600;margin:8px 8px 8px 4px;color:var(--text-secondary)}[device-type=mobile] ._sidebarTitle_azx8n_1{font-size:1.2rem}._sidebarItem_1e3ru_1{padding:6px;transition:background-color .1s;border-radius:8px;color:var(--text-primary);cursor:pointer;display:flex;flex-direction:row;justify-content:start;align-items:center;gap:8px}[device-type=mobile] ._sidebarItem_1e3ru_1{font-size:1.4rem}._sidebarItem_1e3ru_1:hover{background-color:var(--surface-bg-hover)}._sidebarItem_1e3ru_1._selected_1e3ru_22{background-color:var(--surface-bg-active);color:var(--icon-color)}._sidebarMainBtn_65l8c_1{width:calc(100% - 8px);background-color:var(--button-primary-bg);border:none;outline:none;color:var(--text-inverse);border-radius:5px;height:32px;margin:4px;font-weight:600;font-size:.9rem;transition:background-color .2s;display:flex;flex-direction:row;justify-content:center;align-items:center;gap:8px;cursor:pointer}[device-type=mobile] ._sidebarMainBtn_65l8c_1{font-size:1.4rem;height:48px}._sidebarMainBtn_65l8c_1:hover{background-color:var(--button-primary-bg-hover)}._sidebarMainBtn_65l8c_1:active{background-color:var(--button-primary-bg-active)}._popupContainer_vz8rg_1{position:fixed;top:0;left:0;width:100%;height:100%;background-color:var(--overlay-bg);z-index:9999;display:flex;justify-content:center;align-items:center;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);opacity:1;transition:.2s;pointer-events:auto}._popupClosed_vz8rg_18{opacity:0;pointer-events:none}._popup_vz8rg_1{background-color:var(--card-bg);border-radius:8px;padding:12px;width:300px;height:auto;display:flex;flex-direction:column;justify-content:space-between;gap:12px}._popupIconContainer_vz8rg_35{display:flex;justify-content:center}._popupIcon_vz8rg_35{color:var(--icon-color)}._popupContent_vz8rg_44{display:flex;flex-direction:column;gap:8px}._popupTitle_4z5vb_1{margin:0;text-align:center;font-size:large;font-weight:700}[device-type=mobile] ._popupTitle_4z5vb_1{font-size:1.4rem}._popupDescription_4ewx1_1{text-align:center}[device-type=mobile] ._popupDescription_4ewx1_1{font-size:1.4rem}._popupInput_1b42s_1{width:100%;height:32px;background-color:var(--muted-bg);border:none;border-radius:5px;padding:4px 8px;font-size:1rem;color:var(--text-primary)}[device-type=mobile] ._popupInput_1b42s_1{font-size:1.4rem;height:48px}._popupActions_84v2b_1{display:flex;gap:8px}._popupBtn_ouvtc_1{width:100%;height:32px;border:none;border-radius:5px;font-weight:600;font-size:.9rem;background-color:var(--button-primary-bg);transition:background-color .2s;color:var(--text-inverse);cursor:pointer}[device-type=mobile] ._popupBtn_ouvtc_1{font-size:1.4rem;height:48px}._popupBtn_ouvtc_1:hover{background-color:var(--button-primary-bg-hover)}._popupBtn_ouvtc_1:active{background-color:var(--button-primary-bg-active)}._popupBtn_ouvtc_1._secondary_ouvtc_27{background-color:transparent;color:var(--text-primary);border:solid 1px var(--button-primary-bg);font-weight:400}._popupBtn_ouvtc_1._secondary_ouvtc_27:hover{background-color:var(--button-secondary-bg-hover)}._popupBtn_ouvtc_1._secondary_ouvtc_27:active{background-color:var(--button-secondary-bg-active)}._toolbar_1rbls_1{position:absolute;top:0;left:calc(var(--sidebar-width) + 10px);width:calc(100% - calc(var(--sidebar-width) + 15px));height:32px;display:flex;flex-direction:row;justify-content:space-between;align-items:center;z-index:9999;transition:top .3s,left .3s,width .3s}._toolbarCollapsed_1rbls_18{top:-100%}[device-type=mobile] ._toolbar_1rbls_1{top:5px;height:48px}._toolbarExpanded_1rbls_27{left:5px;width:calc(100% - 10px)}._toolbarTitle_1rbls_32{margin:0;font-size:1rem;font-weight:600}._toolbarActions_1rbls_38{background-color:var(--surface-bg);border-radius:16px;display:flex;flex-direction:row}._toolbarActions_1rbls_38 button{width:32px;height:32px;background-color:transparent;border:none;outline:none;color:var(--icon-color);cursor:pointer}[device-type=mobile] ._toolbarTitle_1p2s8_1{font-size:1.4rem}._toolbarActions_l0jv2_1{background-color:var(--surface-bg);border-radius:16px;display:flex;flex-direction:row}[device-type=mobile] ._toolbarActions_l0jv2_1{border-radius:24px}._toolbarActions_l0jv2_1 button{background-color:transparent}._toolbarBtn_8jy1b_1{width:32px;height:32px;border:none;outline:none;padding:0;display:flex;justify-content:center;align-items:center;background-color:var(--surface-bg);border-radius:16px;color:var(--icon-color);transition:background-color .2s;cursor:pointer}._toolbarBtn_8jy1b_1:hover{background-color:var(--surface-bg-hover)}._toolbarBtn_8jy1b_1:active{background-color:var(--surface-bg-active)}[device-type=mobile] ._toolbarBtn_8jy1b_1{width:48px;height:48px;border-radius:24px}._sidebarIcon_1lib1_1{rotate:0deg;transition:rotate .3s}._sidebarIconExpanded_1lib1_6{rotate:180deg}._content_to68z_1{position:absolute;top:0;left:calc(var(--sidebar-width) + 10px);height:100%;width:calc(100% - calc(var(--sidebar-width) + 15px));transition:left .3s,width .3s;display:flex;flex-direction:column;justify-content:start;align-items:start;overflow:auto;padding-bottom:5px}._contentExpanded_to68z_18{left:5px;width:calc(100% - 10px)}._toolbarPresent_to68z_23{top:37px;height:calc(100% - 37px)}[device-type=mobile] ._content_to68z_1._toolbarPresent_to68z_23{top:58px;height:calc(100% - 58px)}._contentNoMargin_to68z_33{padding:0;left:calc(var(--sidebar-width))}._contentExpanded_to68z_18._contentNoMargin_to68z_33{left:0;width:100%}._contextMenu_vtnpl_1{background-color:var(--surface-bg-active);position:fixed;border-radius:9px;transition:opacity .1s,transform .1s;display:flex;flex-direction:column;z-index:9999;border:solid 1px var(--border-color);transform:scale(.7) translate(var(--tx-start)) translateY(var(--ty-start));opacity:0;visibility:hidden;pointer-events:none;-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);padding:4px}._contextMenuOpen_vtnpl_22{visibility:visible;pointer-events:auto;transform:scale(1) translate(0) translateY(0);opacity:1}._listItem_7ga7e_1{padding:10px;transition:background-color .1s;border-radius:8px;color:var(--text-primary);cursor:pointer;display:flex;flex-direction:row;justify-content:start;align-items:center;gap:8px;width:100%}[device-type=mobile] ._listItem_7ga7e_1{font-size:1.4rem}._listItem_7ga7e_1:hover{background-color:var(--surface-bg-hover)}._listItem_7ga7e_1._selected_7ga7e_23{background-color:var(--surface-bg-active)}._emptyView_1synn_1{display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;height:100%;color:var(--text-secondary)}._card_zjz9h_1{background-color:var(--surface-bg);border-radius:9px;display:flex;flex-direction:column;border:solid 1px var(--border-color);padding:14px;margin:0 8px;width:calc(100% - 16px);gap:8px}._textInput_on5q4_1{width:100%;height:32px;background-color:var(--muted-bg);border:none;border-radius:5px;padding:4px 8px;font-size:.9rem;color:var(--text-primary);transition:background-color .2s}._textInput_on5q4_1:focus{outline:none;background-color:var(--surface-bg)}._textInput_on5q4_1:disabled{opacity:.5;cursor:not-allowed}._textInput_on5q4_1::placeholder{color:var(--text-secondary)}[device-type=mobile] ._textInput_on5q4_1{font-size:1.4rem;height:48px}._selectInput_3f04b_1{height:32px;background-color:var(--muted-bg);border:none;border-radius:5px;padding:4px 32px 4px 8px;font-size:.9rem;color:var(--text-primary);cursor:pointer;transition:background-color .2s;appearance:none;-webkit-appearance:none;-moz-appearance:none;background-image:url('data:image/svg+xml;utf8,<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4 6L8 10L12 6" stroke="%23666" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>');background-repeat:no-repeat;background-position:right 8px center}._selectInput_3f04b_1:hover{background-color:var(--surface-bg-hover)}._selectInput_3f04b_1:focus{outline:none;background-color:var(--surface-bg)}._selectInput_3f04b_1:disabled{opacity:.5;cursor:not-allowed}[device-type=mobile] ._selectInput_3f04b_1{font-size:1.4rem;height:48px}._button_g5rur_1{width:100%;height:32px;border:none;border-radius:5px;font-weight:600;font-size:.9rem;background-color:var(--button-primary-bg);transition:background-color .2s;color:var(--text-inverse);cursor:pointer}[device-type=mobile] ._button_g5rur_1{font-size:1.4rem;height:48px}._button_g5rur_1:hover{background-color:var(--button-primary-bg-hover)}._button_g5rur_1:active{background-color:var(--button-primary-bg-active)}._button_g5rur_1._secondary_g5rur_27{background-color:transparent;color:var(--text-primary);border:solid 1px var(--button-primary-bg);font-weight:400}._button_g5rur_1._secondary_g5rur_27:hover{background-color:var(--button-secondary-bg-hover)}._button_g5rur_1._secondary_g5rur_27:active{background-color:var(--button-secondary-bg-active)}._button_g5rur_1:disabled{background-color:var(--button-disabled-bg);color:var(--text-disabled);cursor:not-allowed;opacity:.6}._balloon_1jdjr_1{position:fixed;z-index:1000;display:flex;flex-direction:column;width:256px;padding:14px;gap:8px;border-radius:9px;background-color:var(--surface-bg);border:solid 1px var(--border-color);align-items:center;box-sizing:border-box;transform-origin:50% calc(100% + 8px);transform:translate(-50%,calc(-100% - 8px)) scale(.1);filter:opacity(0);transition:.3s;pointer-events:none;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px)}._balloonOpen_1jdjr_22{transform:translate(-50%,calc(-100% - 8px)) scale(1);filter:opacity(1);pointer-events:auto}._balloon_1jdjr_1:after{content:"";position:absolute;bottom:-6px;left:50%;transform:translate(-50%) rotate(45deg);width:10px;height:10px;background-color:var(--surface-bg);border-right:solid 1px var(--border-color);border-bottom:solid 1px var(--border-color);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px)}[device-type=mobile] ._balloon_1jdjr_1{font-size:1.4rem}`)),document.head.appendChild(r)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
2
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),i=require("react"),C=require("lucide-react"),I=i.createContext({isMobile:!1}),d=()=>i.useContext(I);function B({isMobile:t,sidebar:e,children:o,accentColor:n="#0088ff"}){return i.useLayoutEffect(()=>{n&&document.documentElement.style.setProperty("--accent",n)},[n]),s.jsx(I.Provider,{value:{isMobile:t},children:s.jsxs("div",{children:[s.jsx("aside",{children:e}),s.jsx("main",{children:o})]})})}const E="_sidebar_yoln4_1",g="_sidebarCollapsed_yoln4_18",S="_sidebarMobile_yoln4_22",P="_sidebarMobileHidden_yoln4_35",z="_sidebarContent_yoln4_39",D="_sidebarFooter_yoln4_48",u={sidebar:E,sidebarCollapsed:g,sidebarMobile:S,sidebarMobileHidden:P,sidebarContent:z,sidebarFooter:D};function A({open:t,footer:e,children:o}){const{isMobile:n}=d();return s.jsxs("div",{className:`
3
- ${u.sidebar}
4
- ${t?"":u.sidebarCollapsed}
5
- ${n?u.sidebarMobile:""}
6
- ${!t&&n?u.sidebarMobileHidden:""}`,children:[s.jsx("div",{className:u.sidebarContent,children:o}),e&&s.jsx("div",{className:u.sidebarFooter,children:e})]})}const w="_sidebarTitle_azx8n_1",R={sidebarTitle:w};function O({children:t}){return s.jsx("h2",{className:R.sidebarTitle,children:t})}const V="_sidebarItem_1e3ru_1",k="_selected_1e3ru_22",m={sidebarItem:V,selected:k};function q({onClick:t,onContextMenu:e,selected:o=!1,children:n}){const c=i.useRef(null),a=r=>{c.current=setTimeout(()=>{e&&(r.preventDefault(),e(r))},500)},l=()=>{c.current&&clearTimeout(c.current)};return s.jsx("div",{className:`${m.sidebarItem} ${o?m.selected:""}`,onClick:t,onContextMenu:r=>{r.preventDefault(),e&&e(r)},onTouchStart:a,onTouchEnd:l,onTouchMove:l,children:n})}const H="_sidebarMainBtn_65l8c_1",F={sidebarMainBtn:H};function L({onClick:t,children:e}){return s.jsx("button",{className:F.sidebarMainBtn,onClick:t,children:e})}const W="_popupContainer_vz8rg_1",K="_popupClosed_vz8rg_18",G="_popup_vz8rg_1",J="_popupContent_vz8rg_44",b={popupContainer:W,popupClosed:K,popup:G,popupContent:J};function Q({open:t=!1,children:e}){return s.jsx("div",{className:`${b.popupContainer} ${t?"":b.popupClosed}`,children:s.jsx("div",{className:b.popup,children:s.jsx("div",{className:b.popupContent,children:e})})})}const U="_popupTitle_4z5vb_1",X={popupTitle:U};function Y({children:t}){return s.jsx("span",{className:X.popupTitle,children:t})}const Z="_popupDescription_4ewx1_1",tt={popupDescription:Z};function et({children:t}){return s.jsx("span",{className:tt.popupDescription,children:t})}const ot="_popupInput_1b42s_1",nt={popupInput:ot},st=i.forwardRef(({placeholder:t="Enter text...",value:e,onChange:o,onSubmit:n,autoFocus:c},a)=>{const l=i.useRef(null),r=a||l;return i.useEffect(()=>{c&&r.current&&r.current.focus()},[c,r]),s.jsx("input",{ref:r,type:"text",className:nt.popupInput,placeholder:t,value:e,onChange:p=>o?.(p.target.value),onKeyDown:p=>{p.key==="Enter"&&n&&n(e||"")}})}),rt="_popupActions_84v2b_1",ct={popupActions:rt};function lt({orientation:t="vertical",children:e}){return s.jsx("div",{className:ct.popupActions,style:{flexDirection:t=="vertical"?"column":"row"},children:e})}const at="_popupBtn_ouvtc_1",it="_secondary_ouvtc_27",$={popupBtn:at,secondary:it};function pt({type:t="primary",onClick:e,children:o}){return s.jsx("button",{className:`${$.popupBtn} ${t=="secondary"?$.secondary:""}`,onClick:e,children:o})}const ut="_toolbar_1rbls_1",dt="_toolbarCollapsed_1rbls_18",bt="_toolbarExpanded_1rbls_27",_={toolbar:ut,toolbarCollapsed:dt,toolbarExpanded:bt};function _t({expanded:t=!0,collapsed:e=!1,children:o}){const{isMobile:n}=d();return s.jsx("div",{className:`${_.toolbar} ${t||n?_.toolbarExpanded:""} ${n?_.toolbarMobile:""} ${e?_.toolbarCollapsed:""}`,children:o})}const ft="_toolbarTitle_1p2s8_1",xt={toolbarTitle:ft};function yt({children:t}){return s.jsx("h3",{className:xt.toolbarTitle,children:t})}const mt="_toolbarActions_l0jv2_1",$t={toolbarActions:mt};function jt({children:t}){return s.jsx("div",{className:$t.toolbarActions,children:t})}const vt="_toolbarBtn_8jy1b_1",Tt={toolbarBtn:vt};function M({onClick:t,children:e}){return s.jsx("button",{onClick:o=>{o.preventDefault(),t&&t(o)},className:Tt.toolbarBtn,children:e})}const ht="_sidebarIcon_1lib1_1",It="_sidebarIconExpanded_1lib1_6",j={sidebarIcon:ht,sidebarIconExpanded:It};function Mt({onToggleSidebar:t,expanded:e=!1}){const{isMobile:o}=d();return s.jsx(M,{onClick:t,children:s.jsx(C.Menu,{size:o?24:18,className:`${j.sidebarIcon} ${e?j.sidebarIconExpanded:""}`})})}const Nt="_content_to68z_1",Ct="_contentExpanded_to68z_18",Bt="_toolbarPresent_to68z_23",Et="_contentNoMargin_to68z_33",f={content:Nt,contentExpanded:Ct,toolbarPresent:Bt,contentNoMargin:Et};function gt({expanded:t=!0,toolbar:e=!0,margin:o="default",children:n}){return s.jsx("div",{className:`${f.content} ${t?f.contentExpanded:""} ${e?f.toolbarPresent:""} ${o==="none"?f.contentNoMargin:""}`,children:n})}const St="_contextMenu_vtnpl_1",Pt="_contextMenuOpen_vtnpl_22",y={contextMenu:St,contextMenuOpen:Pt};function zt({open:t,x:e=20,y:o=20,from:n="top-left",children:c}){const{isMobile:a}=d(),l={"top-left":{tx:"-30%",ty:"-30%"},"top-right":{tx:"30%",ty:"-30%"},"bottom-left":{tx:"-30%",ty:"30%"},"bottom-right":{tx:"30%",ty:"30%"}},{tx:r,ty:p}=l[n],x={top:n.includes("top")?`${o}px`:"auto",bottom:n.includes("bottom")?`${o}px`:"auto",left:n.includes("left")?`${e}px`:"auto",right:n.includes("right")?`${e}px`:"auto","--tx-start":r,"--ty-start":p};return s.jsx("div",{className:`
7
- ${y.contextMenu}
8
- ${t?y.contextMenuOpen:""}
9
- ${a?y.contextMenuMobile:""}
10
- `,style:x,children:c})}const Dt="_listItem_7ga7e_1",At="_selected_7ga7e_23",v={listItem:Dt,selected:At};function wt({onClick:t,onContextMenu:e,selected:o=!1,children:n}){const c=i.useRef(null),a=r=>{c.current=setTimeout(()=>{e&&(r.preventDefault(),e(r))},500)},l=()=>{c.current&&clearTimeout(c.current)};return s.jsx("div",{className:`${v.listItem} ${o?v.selected:""}`,onClick:t,onContextMenu:r=>{r.preventDefault(),e&&e(r)},onTouchStart:a,onTouchEnd:l,onTouchMove:l,children:n})}function N({icon:t,size:e="default",color:o="default",className:n}){const{isMobile:c}=d(),a=e==="default"?c?24:18:e,l=o==="selected"?"var(--icon-color)":o;return o==="default"?s.jsx(t,{size:a,className:n,strokeWidth:c?2.5:2}):s.jsx(t,{size:a,color:l,className:n,strokeWidth:c?2.5:2})}const Rt="_emptyView_1synn_1",Ot={emptyView:Rt};function Vt({icon:t,label:e}){const{isMobile:o}=d(),n=o?64:48;return s.jsxs("div",{className:Ot.emptyView,children:[s.jsx(N,{icon:t,size:n,color:"var(--text-secondary)"}),s.jsx("h2",{children:e})]})}const kt="_card_zjz9h_1",qt={card:kt};function Ht({children:t}){return s.jsx("div",{className:qt.card,children:t})}const Ft="_textInput_on5q4_1",Lt={textInput:Ft},Wt=i.forwardRef(({placeholder:t,value:e,onChange:o,onFocus:n,onBlur:c,disabled:a=!1,type:l="text",className:r},p)=>s.jsx("input",{ref:p,type:l,className:`${Lt.textInput} ${r||""}`,placeholder:t,value:e,onChange:x=>o?.(x.target.value),onFocus:n,onBlur:c,disabled:a})),Kt="_selectInput_3f04b_1",Gt={selectInput:Kt},Jt=i.forwardRef(({className:t,children:e,...o},n)=>s.jsx("select",{ref:n,className:`${Gt.selectInput} ${t||""}`,...o,children:e})),Qt="_button_g5rur_1",Ut="_secondary_g5rur_27",T={button:Qt,secondary:Ut};function Xt({disabled:t=!1,type:e="primary",onClick:o,children:n,style:c}){return s.jsx("button",{className:`${T.button} ${e=="secondary"?T.secondary:""}`,onClick:o,disabled:t,style:c,children:n})}const Yt="_balloon_1jdjr_1",Zt="_balloonOpen_1jdjr_22",h={balloon:Yt,balloonOpen:Zt};function te({open:t,x:e,y:o,children:n,className:c,style:a,...l}){const r={};typeof e=="number"&&(r.left=e),typeof o=="number"&&(r.top=o);const p=[h.balloon,t?h.balloonOpen:"",c??""].filter(Boolean).join(" ");return s.jsx("div",{...l,className:p,style:{...a,...r},children:n})}exports.AppShell=B;exports.Balloon=te;exports.Button=Xt;exports.Card=Ht;exports.Content=gt;exports.ContextMenu=zt;exports.EmptyView=Vt;exports.Icon=N;exports.ListItem=wt;exports.Popup=Q;exports.PopupActions=lt;exports.PopupButton=pt;exports.PopupDescription=et;exports.PopupInput=st;exports.PopupTitle=Y;exports.SelectInput=Jt;exports.Sidebar=A;exports.SidebarButton=L;exports.SidebarItem=q;exports.SidebarTitle=O;exports.TextInput=Wt;exports.Toolbar=_t;exports.ToolbarActions=jt;exports.ToolbarButton=M;exports.ToolbarExpandSidebarButton=Mt;exports.ToolbarTitle=yt;
1
+ (function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode(`:root{--accent: #0088ff;--button-primary-bg: var(--accent);--button-primary-bg-hover: color-mix(in srgb, var(--accent), black 15%);--button-primary-bg-active: color-mix(in srgb, var(--accent), black 30%);--button-secondary-bg-hover: color-mix(in srgb, var(--accent), white 90%);--button-secondary-bg-active: color-mix(in srgb, var(--accent), white 90%);--button-disabled-bg: color-mix(in srgb, var(--accent), white 60%);--text-disabled: color-mix(in srgb, var(--text-primary), white 40%);--icon-color: var(--accent);--border-color: #0000001a;--surface-bg: #ffffff7a;--surface-bg-hover: #ffffffa1;--surface-bg-active: #ffffffd5;--card-bg: #e5e5e5;--card-bg-secondary: #f5f5f5;--overlay-bg: rgba(0, 0, 0, .4);--muted-bg: rgba(0, 0, 0, .06);--text-primary: #000000;--text-secondary: #8b8b8b;--text-inverse: #ffffff;--sidebar-width: 200px}[data-theme=dark]{--button-secondary-bg-hover: #252628;--button-secondary-bg-active: #2b2f35;--button-disabled-bg: color-mix(in srgb, var(--accent), black 60%);--text-disabled: color-mix(in srgb, var(--text-primary), black 40%);--surface-bg: #1e1e1e7a;--surface-bg-hover: #2a2a2aa1;--surface-bg-active: #3a3a3ad5;--card-bg: #1d1d1d;--card-bg-secondary: #2a2a2a;--overlay-bg: rgba(255, 255, 255, .4);--muted-bg: rgba(255, 255, 255, .12);--text-primary: #ffffff;--text-inverse: #000000;--text-secondary: #b3b3b3}body{color:var(--text-primary);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}[device-type=mobile] body{background-color:var(--card-bg-secondary)!important}*,*:before,*:after{box-sizing:border-box;-webkit-tap-highlight-color:transparent;-webkit-tap-highlight-color:rgba(0,0,0,0)}._sidebar_yoln4_1{width:var(--sidebar-width);background-color:var(--surface-bg);position:absolute;top:0;bottom:5px;height:auto;left:5px;border-radius:9px;transition:left .3s;display:flex;flex-direction:column;z-index:999;border:solid 1px var(--border-color);transform:translate(0)}._sidebarCollapsed_yoln4_18{left:calc(-1 * var(--sidebar-width) - 10px)}[device-type=mobile] ._sidebar_yoln4_1._sidebarMobile_yoln4_22{position:absolute;inset:0;width:auto;height:auto;border-radius:0;transition:transform .25s ease;background-color:var(--card-bg)}[device-type=mobile] ._sidebar_yoln4_1._sidebarMobile_yoln4_22._sidebarMobileHidden_yoln4_35{transform:translate(-105%)}._sidebarContent_yoln4_39{height:100%;padding:0 4px;display:flex;flex-direction:column;overflow-y:auto;gap:2px}._sidebarFooter_yoln4_48{padding:4px}._sidebarTitle_azx8n_1{font-size:.8rem;font-weight:600;margin:8px 8px 8px 4px;color:var(--text-secondary)}[device-type=mobile] ._sidebarTitle_azx8n_1{font-size:1.2rem}._sidebarItem_1e3ru_1{padding:6px;transition:background-color .1s;border-radius:8px;color:var(--text-primary);cursor:pointer;display:flex;flex-direction:row;justify-content:start;align-items:center;gap:8px}[device-type=mobile] ._sidebarItem_1e3ru_1{font-size:1.4rem}._sidebarItem_1e3ru_1:hover{background-color:var(--surface-bg-hover)}._sidebarItem_1e3ru_1._selected_1e3ru_22{background-color:var(--surface-bg-active);color:var(--icon-color)}._sidebarMainBtn_65l8c_1{width:calc(100% - 8px);background-color:var(--button-primary-bg);border:none;outline:none;color:var(--text-inverse);border-radius:5px;height:32px;margin:4px;font-weight:600;font-size:.9rem;transition:background-color .2s;display:flex;flex-direction:row;justify-content:center;align-items:center;gap:8px;cursor:pointer}[device-type=mobile] ._sidebarMainBtn_65l8c_1{font-size:1.4rem;height:48px}._sidebarMainBtn_65l8c_1:hover{background-color:var(--button-primary-bg-hover)}._sidebarMainBtn_65l8c_1:active{background-color:var(--button-primary-bg-active)}._popupContainer_vz8rg_1{position:fixed;top:0;left:0;width:100%;height:100%;background-color:var(--overlay-bg);z-index:9999;display:flex;justify-content:center;align-items:center;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);opacity:1;transition:.2s;pointer-events:auto}._popupClosed_vz8rg_18{opacity:0;pointer-events:none}._popup_vz8rg_1{background-color:var(--card-bg);border-radius:8px;padding:12px;width:300px;height:auto;display:flex;flex-direction:column;justify-content:space-between;gap:12px}._popupIconContainer_vz8rg_35{display:flex;justify-content:center}._popupIcon_vz8rg_35{color:var(--icon-color)}._popupContent_vz8rg_44{display:flex;flex-direction:column;gap:8px}._popupTitle_4z5vb_1{margin:0;text-align:center;font-size:large;font-weight:700}[device-type=mobile] ._popupTitle_4z5vb_1{font-size:1.4rem}._popupDescription_4ewx1_1{text-align:center}[device-type=mobile] ._popupDescription_4ewx1_1{font-size:1.4rem}._popupInput_1b42s_1{width:100%;height:32px;background-color:var(--muted-bg);border:none;border-radius:5px;padding:4px 8px;font-size:1rem;color:var(--text-primary)}[device-type=mobile] ._popupInput_1b42s_1{font-size:1.4rem;height:48px}._popupActions_84v2b_1{display:flex;gap:8px}._popupBtn_ouvtc_1{width:100%;height:32px;border:none;border-radius:5px;font-weight:600;font-size:.9rem;background-color:var(--button-primary-bg);transition:background-color .2s;color:var(--text-inverse);cursor:pointer}[device-type=mobile] ._popupBtn_ouvtc_1{font-size:1.4rem;height:48px}._popupBtn_ouvtc_1:hover{background-color:var(--button-primary-bg-hover)}._popupBtn_ouvtc_1:active{background-color:var(--button-primary-bg-active)}._popupBtn_ouvtc_1._secondary_ouvtc_27{background-color:transparent;color:var(--text-primary);border:solid 1px var(--button-primary-bg);font-weight:400}._popupBtn_ouvtc_1._secondary_ouvtc_27:hover{background-color:var(--button-secondary-bg-hover)}._popupBtn_ouvtc_1._secondary_ouvtc_27:active{background-color:var(--button-secondary-bg-active)}._toolbar_1rbls_1{position:absolute;top:0;left:calc(var(--sidebar-width) + 10px);width:calc(100% - calc(var(--sidebar-width) + 15px));height:32px;display:flex;flex-direction:row;justify-content:space-between;align-items:center;z-index:9999;transition:top .3s,left .3s,width .3s}._toolbarCollapsed_1rbls_18{top:-100%}[device-type=mobile] ._toolbar_1rbls_1{top:5px;height:48px}._toolbarExpanded_1rbls_27{left:5px;width:calc(100% - 10px)}._toolbarTitle_1rbls_32{margin:0;font-size:1rem;font-weight:600}._toolbarActions_1rbls_38{background-color:var(--surface-bg);border-radius:16px;display:flex;flex-direction:row}._toolbarActions_1rbls_38 button{width:32px;height:32px;background-color:transparent;border:none;outline:none;color:var(--icon-color);cursor:pointer}._toolbarTitle_14yia_1{overflow-x:scroll;scrollbar-width:none;-ms-overflow-style:none}._toolbarTitle_14yia_1::-webkit-scrollbar{display:none}[device-type=mobile] ._toolbarTitle_14yia_1{font-size:1.4rem}._toolbarActions_l0jv2_1{background-color:var(--surface-bg);border-radius:16px;display:flex;flex-direction:row}[device-type=mobile] ._toolbarActions_l0jv2_1{border-radius:24px}._toolbarActions_l0jv2_1 button{background-color:transparent}._toolbarBtn_8jy1b_1{width:32px;height:32px;border:none;outline:none;padding:0;display:flex;justify-content:center;align-items:center;background-color:var(--surface-bg);border-radius:16px;color:var(--icon-color);transition:background-color .2s;cursor:pointer}._toolbarBtn_8jy1b_1:hover{background-color:var(--surface-bg-hover)}._toolbarBtn_8jy1b_1:active{background-color:var(--surface-bg-active)}[device-type=mobile] ._toolbarBtn_8jy1b_1{width:48px;height:48px;border-radius:24px}._sidebarIcon_1lib1_1{rotate:0deg;transition:rotate .3s}._sidebarIconExpanded_1lib1_6{rotate:180deg}._content_to68z_1{position:absolute;top:0;left:calc(var(--sidebar-width) + 10px);height:100%;width:calc(100% - calc(var(--sidebar-width) + 15px));transition:left .3s,width .3s;display:flex;flex-direction:column;justify-content:start;align-items:start;overflow:auto;padding-bottom:5px}._contentExpanded_to68z_18{left:5px;width:calc(100% - 10px)}._toolbarPresent_to68z_23{top:37px;height:calc(100% - 37px)}[device-type=mobile] ._content_to68z_1._toolbarPresent_to68z_23{top:58px;height:calc(100% - 58px)}._contentNoMargin_to68z_33{padding:0;left:calc(var(--sidebar-width))}._contentExpanded_to68z_18._contentNoMargin_to68z_33{left:0;width:100%}._contextMenu_vtnpl_1{background-color:var(--surface-bg-active);position:fixed;border-radius:9px;transition:opacity .1s,transform .1s;display:flex;flex-direction:column;z-index:9999;border:solid 1px var(--border-color);transform:scale(.7) translate(var(--tx-start)) translateY(var(--ty-start));opacity:0;visibility:hidden;pointer-events:none;-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);padding:4px}._contextMenuOpen_vtnpl_22{visibility:visible;pointer-events:auto;transform:scale(1) translate(0) translateY(0);opacity:1}._listItem_7ga7e_1{padding:10px;transition:background-color .1s;border-radius:8px;color:var(--text-primary);cursor:pointer;display:flex;flex-direction:row;justify-content:start;align-items:center;gap:8px;width:100%}[device-type=mobile] ._listItem_7ga7e_1{font-size:1.4rem}._listItem_7ga7e_1:hover{background-color:var(--surface-bg-hover)}._listItem_7ga7e_1._selected_7ga7e_23{background-color:var(--surface-bg-active)}._emptyView_1synn_1{display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;height:100%;color:var(--text-secondary)}._card_zjz9h_1{background-color:var(--surface-bg);border-radius:9px;display:flex;flex-direction:column;border:solid 1px var(--border-color);padding:14px;margin:0 8px;width:calc(100% - 16px);gap:8px}._textInput_on5q4_1{width:100%;height:32px;background-color:var(--muted-bg);border:none;border-radius:5px;padding:4px 8px;font-size:.9rem;color:var(--text-primary);transition:background-color .2s}._textInput_on5q4_1:focus{outline:none;background-color:var(--surface-bg)}._textInput_on5q4_1:disabled{opacity:.5;cursor:not-allowed}._textInput_on5q4_1::placeholder{color:var(--text-secondary)}[device-type=mobile] ._textInput_on5q4_1{font-size:1.4rem;height:48px}._selectInput_3f04b_1{height:32px;background-color:var(--muted-bg);border:none;border-radius:5px;padding:4px 32px 4px 8px;font-size:.9rem;color:var(--text-primary);cursor:pointer;transition:background-color .2s;appearance:none;-webkit-appearance:none;-moz-appearance:none;background-image:url('data:image/svg+xml;utf8,<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4 6L8 10L12 6" stroke="%23666" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>');background-repeat:no-repeat;background-position:right 8px center}._selectInput_3f04b_1:hover{background-color:var(--surface-bg-hover)}._selectInput_3f04b_1:focus{outline:none;background-color:var(--surface-bg)}._selectInput_3f04b_1:disabled{opacity:.5;cursor:not-allowed}[device-type=mobile] ._selectInput_3f04b_1{font-size:1.4rem;height:48px}._button_g5rur_1{width:100%;height:32px;border:none;border-radius:5px;font-weight:600;font-size:.9rem;background-color:var(--button-primary-bg);transition:background-color .2s;color:var(--text-inverse);cursor:pointer}[device-type=mobile] ._button_g5rur_1{font-size:1.4rem;height:48px}._button_g5rur_1:hover{background-color:var(--button-primary-bg-hover)}._button_g5rur_1:active{background-color:var(--button-primary-bg-active)}._button_g5rur_1._secondary_g5rur_27{background-color:transparent;color:var(--text-primary);border:solid 1px var(--button-primary-bg);font-weight:400}._button_g5rur_1._secondary_g5rur_27:hover{background-color:var(--button-secondary-bg-hover)}._button_g5rur_1._secondary_g5rur_27:active{background-color:var(--button-secondary-bg-active)}._button_g5rur_1:disabled{background-color:var(--button-disabled-bg);color:var(--text-disabled);cursor:not-allowed;opacity:.6}._balloon_1jdjr_1{position:fixed;z-index:1000;display:flex;flex-direction:column;width:256px;padding:14px;gap:8px;border-radius:9px;background-color:var(--surface-bg);border:solid 1px var(--border-color);align-items:center;box-sizing:border-box;transform-origin:50% calc(100% + 8px);transform:translate(-50%,calc(-100% - 8px)) scale(.1);filter:opacity(0);transition:.3s;pointer-events:none;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px)}._balloonOpen_1jdjr_22{transform:translate(-50%,calc(-100% - 8px)) scale(1);filter:opacity(1);pointer-events:auto}._balloon_1jdjr_1:after{content:"";position:absolute;bottom:-6px;left:50%;transform:translate(-50%) rotate(45deg);width:10px;height:10px;background-color:var(--surface-bg);border-right:solid 1px var(--border-color);border-bottom:solid 1px var(--border-color);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px)}[device-type=mobile] ._balloon_1jdjr_1{font-size:1.4rem}`)),document.head.appendChild(r)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),a=require("react"),S=require("lucide-react"),C=a.createContext({isMobile:!1}),b=()=>a.useContext(C);function w({isMobile:t,sidebar:e,children:o,accentColor:s="#0088ff"}){return a.useLayoutEffect(()=>{s&&document.documentElement.style.setProperty("--accent",s)},[s]),n.jsx(C.Provider,{value:{isMobile:t},children:n.jsxs("div",{children:[n.jsx("aside",{children:e}),n.jsx("main",{children:o})]})})}const P="_sidebar_yoln4_1",z="_sidebarCollapsed_yoln4_18",R="_sidebarMobile_yoln4_22",D="_sidebarMobileHidden_yoln4_35",A="_sidebarContent_yoln4_39",O="_sidebarFooter_yoln4_48",d={sidebar:P,sidebarCollapsed:z,sidebarMobile:R,sidebarMobileHidden:D,sidebarContent:A,sidebarFooter:O};function H({open:t,footer:e,children:o}){const{isMobile:s}=b();return n.jsxs("div",{className:`
3
+ ${d.sidebar}
4
+ ${t?"":d.sidebarCollapsed}
5
+ ${s?d.sidebarMobile:""}
6
+ ${!t&&s?d.sidebarMobileHidden:""}`,children:[n.jsx("div",{className:d.sidebarContent,children:o}),e&&n.jsx("div",{className:d.sidebarFooter,children:e})]})}const V="_sidebarTitle_azx8n_1",k={sidebarTitle:V};function L({children:t}){return n.jsx("h2",{className:k.sidebarTitle,children:t})}const q="_sidebarItem_1e3ru_1",W="_selected_1e3ru_22",v={sidebarItem:q,selected:W};function F({onClick:t,onContextMenu:e,selected:o=!1,children:s}){const i=a.useRef(null),c=r=>{i.current=setTimeout(()=>{e&&(r.preventDefault(),e(r))},500)},l=()=>{i.current&&clearTimeout(i.current)};return n.jsx("div",{className:`${v.sidebarItem} ${o?v.selected:""}`,onClick:t,onContextMenu:r=>{r.preventDefault(),e&&e(r)},onTouchStart:c,onTouchEnd:l,onTouchMove:l,children:s})}const K="_sidebarMainBtn_65l8c_1",G={sidebarMainBtn:K};function J({onClick:t,children:e}){return n.jsx("button",{className:G.sidebarMainBtn,onClick:t,children:e})}const Q="_popupContainer_vz8rg_1",U="_popupClosed_vz8rg_18",X="_popup_vz8rg_1",Y="_popupContent_vz8rg_44",x={popupContainer:Q,popupClosed:U,popup:X,popupContent:Y};function Z({open:t=!1,children:e}){return n.jsx("div",{className:`${x.popupContainer} ${t?"":x.popupClosed}`,children:n.jsx("div",{className:x.popup,children:n.jsx("div",{className:x.popupContent,children:e})})})}const tt="_popupTitle_4z5vb_1",et={popupTitle:tt};function ot({children:t}){return n.jsx("span",{className:et.popupTitle,children:t})}const nt="_popupDescription_4ewx1_1",st={popupDescription:nt};function rt({children:t}){return n.jsx("span",{className:st.popupDescription,children:t})}const it="_popupInput_1b42s_1",ct={popupInput:it},lt=a.forwardRef(({placeholder:t="Enter text...",value:e,onChange:o,onSubmit:s,autoFocus:i},c)=>{const l=a.useRef(null),r=c||l;return a.useEffect(()=>{i&&r.current&&r.current.focus()},[i,r]),n.jsx("input",{ref:r,type:"text",className:ct.popupInput,placeholder:t,value:e,onChange:p=>o?.(p.target.value),onKeyDown:p=>{p.key==="Enter"&&s&&s(e||"")}})}),at="_popupActions_84v2b_1",pt={popupActions:at};function ut({orientation:t="vertical",children:e}){return n.jsx("div",{className:pt.popupActions,style:{flexDirection:t=="vertical"?"column":"row"},children:e})}const dt="_popupBtn_ouvtc_1",bt="_secondary_ouvtc_27",h={popupBtn:dt,secondary:bt};function _t({type:t="primary",onClick:e,children:o}){return n.jsx("button",{className:`${h.popupBtn} ${t=="secondary"?h.secondary:""}`,onClick:e,children:o})}const ft="_toolbar_1rbls_1",xt="_toolbarCollapsed_1rbls_18",mt="_toolbarExpanded_1rbls_27",m={toolbar:ft,toolbarCollapsed:xt,toolbarExpanded:mt};function yt({expanded:t=!0,collapsed:e=!1,children:o}){const{isMobile:s}=b();return n.jsx("div",{className:`${m.toolbar} ${t||s?m.toolbarExpanded:""} ${s?m.toolbarMobile:""} ${e?m.toolbarCollapsed:""}`,children:o})}const $t="_toolbarTitle_14yia_1",vt={toolbarTitle:$t};function ht({children:t}){return n.jsx("h3",{className:vt.toolbarTitle,children:t})}const jt="_toolbarActions_l0jv2_1",Tt={toolbarActions:jt};function It({children:t}){return n.jsx("div",{className:Tt.toolbarActions,children:t})}const Mt="_toolbarBtn_8jy1b_1",Ct={toolbarBtn:Mt};function N({onClick:t,children:e}){return n.jsx("button",{onClick:o=>{o.preventDefault(),t&&t(o)},className:Ct.toolbarBtn,children:e})}const Nt="_sidebarIcon_1lib1_1",Bt="_sidebarIconExpanded_1lib1_6",j={sidebarIcon:Nt,sidebarIconExpanded:Bt};function Et({onToggleSidebar:t,expanded:e=!1}){const{isMobile:o}=b();return n.jsx(N,{onClick:t,children:n.jsx(S.Menu,{size:o?24:18,className:`${j.sidebarIcon} ${e?j.sidebarIconExpanded:""}`})})}const gt="_content_to68z_1",St="_contentExpanded_to68z_18",wt="_toolbarPresent_to68z_23",Pt="_contentNoMargin_to68z_33",y={content:gt,contentExpanded:St,toolbarPresent:wt,contentNoMargin:Pt};function zt({expanded:t=!0,toolbar:e=!0,margin:o="default",children:s}){return n.jsx("div",{className:`${y.content} ${t?y.contentExpanded:""} ${e?y.toolbarPresent:""} ${o==="none"?y.contentNoMargin:""}`,children:s})}const Rt="_contextMenu_vtnpl_1",Dt="_contextMenuOpen_vtnpl_22",$={contextMenu:Rt,contextMenuOpen:Dt};function At({open:t,x:e,y:o,children:s}){const{isMobile:i}=b(),c=a.useRef(null),[l,r]=a.useState({top:0,left:0});a.useLayoutEffect(()=>{if(t&&c.current){const u=c.current.getBoundingClientRect(),E=window.innerWidth,g=window.innerHeight;let _=e,f=o;e+u.width>E&&(_=e-u.width),o+u.height>g&&(f=o-u.height),_=Math.max(5,_),f=Math.max(5,f),r({top:f,left:_})}},[t,e,o]);const p={top:`${l.top}px`,left:`${l.left}px`,position:"fixed",visibility:t?"visible":"hidden",opacity:t?1:0};return n.jsx("div",{ref:c,className:`
7
+ ${$.contextMenu}
8
+ ${t?$.contextMenuOpen:""}
9
+ ${i?$.contextMenuMobile:""}
10
+ `,style:p,children:s})}const Ot="_listItem_7ga7e_1",Ht="_selected_7ga7e_23",T={listItem:Ot,selected:Ht};function Vt({onClick:t,onContextMenu:e,selected:o=!1,children:s}){const i=a.useRef(null),c=r=>{i.current=setTimeout(()=>{e&&(r.preventDefault(),e(r))},500)},l=()=>{i.current&&clearTimeout(i.current)};return n.jsx("div",{className:`${T.listItem} ${o?T.selected:""}`,onClick:t,onContextMenu:r=>{r.preventDefault(),e&&e(r)},onTouchStart:c,onTouchEnd:l,onTouchMove:l,children:s})}function B({icon:t,size:e="default",color:o="default",className:s}){const{isMobile:i}=b(),c=e==="default"?i?24:18:e,l=o==="selected"?"var(--icon-color)":o;return o==="default"?n.jsx(t,{size:c,className:s,strokeWidth:i?2.5:2}):n.jsx(t,{size:c,color:l,className:s,strokeWidth:i?2.5:2})}const kt="_emptyView_1synn_1",Lt={emptyView:kt};function qt({icon:t,label:e}){const{isMobile:o}=b(),s=o?64:48;return n.jsxs("div",{className:Lt.emptyView,children:[n.jsx(B,{icon:t,size:s,color:"var(--text-secondary)"}),n.jsx("h2",{children:e})]})}const Wt="_card_zjz9h_1",Ft={card:Wt};function Kt({children:t}){return n.jsx("div",{className:Ft.card,children:t})}const Gt="_textInput_on5q4_1",Jt={textInput:Gt},Qt=a.forwardRef(({placeholder:t,value:e,onChange:o,onFocus:s,onBlur:i,disabled:c=!1,type:l="text",className:r},p)=>n.jsx("input",{ref:p,type:l,className:`${Jt.textInput} ${r||""}`,placeholder:t,value:e,onChange:u=>o?.(u.target.value),onFocus:s,onBlur:i,disabled:c})),Ut="_selectInput_3f04b_1",Xt={selectInput:Ut},Yt=a.forwardRef(({className:t,children:e,...o},s)=>n.jsx("select",{ref:s,className:`${Xt.selectInput} ${t||""}`,...o,children:e})),Zt="_button_g5rur_1",te="_secondary_g5rur_27",I={button:Zt,secondary:te};function ee({disabled:t=!1,type:e="primary",onClick:o,children:s,style:i}){return n.jsx("button",{className:`${I.button} ${e=="secondary"?I.secondary:""}`,onClick:o,disabled:t,style:i,children:s})}const oe="_balloon_1jdjr_1",ne="_balloonOpen_1jdjr_22",M={balloon:oe,balloonOpen:ne};function se({open:t,x:e,y:o,children:s,className:i,style:c,...l}){const r={};typeof e=="number"&&(r.left=e),typeof o=="number"&&(r.top=o);const p=[M.balloon,t?M.balloonOpen:"",i??""].filter(Boolean).join(" ");return n.jsx("div",{...l,className:p,style:{...c,...r},children:s})}exports.AppShell=w;exports.Balloon=se;exports.Button=ee;exports.Card=Kt;exports.Content=zt;exports.ContextMenu=At;exports.EmptyView=qt;exports.Icon=B;exports.ListItem=Vt;exports.Popup=Z;exports.PopupActions=ut;exports.PopupButton=_t;exports.PopupDescription=rt;exports.PopupInput=lt;exports.PopupTitle=ot;exports.SelectInput=Yt;exports.Sidebar=H;exports.SidebarButton=J;exports.SidebarItem=F;exports.SidebarTitle=L;exports.TextInput=Qt;exports.Toolbar=yt;exports.ToolbarActions=It;exports.ToolbarButton=N;exports.ToolbarExpandSidebarButton=Et;exports.ToolbarTitle=ht;
package/dist/htmlos-ui.js CHANGED
@@ -1,150 +1,150 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode(`:root{--accent: #0088ff;--button-primary-bg: var(--accent);--button-primary-bg-hover: color-mix(in srgb, var(--accent), black 15%);--button-primary-bg-active: color-mix(in srgb, var(--accent), black 30%);--button-secondary-bg-hover: color-mix(in srgb, var(--accent), white 90%);--button-secondary-bg-active: color-mix(in srgb, var(--accent), white 90%);--button-disabled-bg: color-mix(in srgb, var(--accent), white 60%);--text-disabled: color-mix(in srgb, var(--text-primary), white 40%);--icon-color: var(--accent);--border-color: #0000001a;--surface-bg: #ffffff7a;--surface-bg-hover: #ffffffa1;--surface-bg-active: #ffffffd5;--card-bg: #e5e5e5;--card-bg-secondary: #f5f5f5;--overlay-bg: rgba(0, 0, 0, .4);--muted-bg: rgba(0, 0, 0, .06);--text-primary: #000000;--text-secondary: #8b8b8b;--text-inverse: #ffffff;--sidebar-width: 200px}[data-theme=dark]{--button-secondary-bg-hover: #252628;--button-secondary-bg-active: #2b2f35;--button-disabled-bg: color-mix(in srgb, var(--accent), black 60%);--text-disabled: color-mix(in srgb, var(--text-primary), black 40%);--surface-bg: #1e1e1e7a;--surface-bg-hover: #2a2a2aa1;--surface-bg-active: #3a3a3ad5;--card-bg: #1d1d1d;--card-bg-secondary: #2a2a2a;--overlay-bg: rgba(255, 255, 255, .4);--muted-bg: rgba(255, 255, 255, .12);--text-primary: #ffffff;--text-inverse: #000000;--text-secondary: #b3b3b3}body{color:var(--text-primary);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}[device-type=mobile] body{background-color:var(--card-bg-secondary)!important}*,*:before,*:after{box-sizing:border-box;-webkit-tap-highlight-color:transparent;-webkit-tap-highlight-color:rgba(0,0,0,0)}._sidebar_yoln4_1{width:var(--sidebar-width);background-color:var(--surface-bg);position:absolute;top:0;bottom:5px;height:auto;left:5px;border-radius:9px;transition:left .3s;display:flex;flex-direction:column;z-index:999;border:solid 1px var(--border-color);transform:translate(0)}._sidebarCollapsed_yoln4_18{left:calc(-1 * var(--sidebar-width) - 10px)}[device-type=mobile] ._sidebar_yoln4_1._sidebarMobile_yoln4_22{position:absolute;inset:0;width:auto;height:auto;border-radius:0;transition:transform .25s ease;background-color:var(--card-bg)}[device-type=mobile] ._sidebar_yoln4_1._sidebarMobile_yoln4_22._sidebarMobileHidden_yoln4_35{transform:translate(-105%)}._sidebarContent_yoln4_39{height:100%;padding:0 4px;display:flex;flex-direction:column;overflow-y:auto;gap:2px}._sidebarFooter_yoln4_48{padding:4px}._sidebarTitle_azx8n_1{font-size:.8rem;font-weight:600;margin:8px 8px 8px 4px;color:var(--text-secondary)}[device-type=mobile] ._sidebarTitle_azx8n_1{font-size:1.2rem}._sidebarItem_1e3ru_1{padding:6px;transition:background-color .1s;border-radius:8px;color:var(--text-primary);cursor:pointer;display:flex;flex-direction:row;justify-content:start;align-items:center;gap:8px}[device-type=mobile] ._sidebarItem_1e3ru_1{font-size:1.4rem}._sidebarItem_1e3ru_1:hover{background-color:var(--surface-bg-hover)}._sidebarItem_1e3ru_1._selected_1e3ru_22{background-color:var(--surface-bg-active);color:var(--icon-color)}._sidebarMainBtn_65l8c_1{width:calc(100% - 8px);background-color:var(--button-primary-bg);border:none;outline:none;color:var(--text-inverse);border-radius:5px;height:32px;margin:4px;font-weight:600;font-size:.9rem;transition:background-color .2s;display:flex;flex-direction:row;justify-content:center;align-items:center;gap:8px;cursor:pointer}[device-type=mobile] ._sidebarMainBtn_65l8c_1{font-size:1.4rem;height:48px}._sidebarMainBtn_65l8c_1:hover{background-color:var(--button-primary-bg-hover)}._sidebarMainBtn_65l8c_1:active{background-color:var(--button-primary-bg-active)}._popupContainer_vz8rg_1{position:fixed;top:0;left:0;width:100%;height:100%;background-color:var(--overlay-bg);z-index:9999;display:flex;justify-content:center;align-items:center;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);opacity:1;transition:.2s;pointer-events:auto}._popupClosed_vz8rg_18{opacity:0;pointer-events:none}._popup_vz8rg_1{background-color:var(--card-bg);border-radius:8px;padding:12px;width:300px;height:auto;display:flex;flex-direction:column;justify-content:space-between;gap:12px}._popupIconContainer_vz8rg_35{display:flex;justify-content:center}._popupIcon_vz8rg_35{color:var(--icon-color)}._popupContent_vz8rg_44{display:flex;flex-direction:column;gap:8px}._popupTitle_4z5vb_1{margin:0;text-align:center;font-size:large;font-weight:700}[device-type=mobile] ._popupTitle_4z5vb_1{font-size:1.4rem}._popupDescription_4ewx1_1{text-align:center}[device-type=mobile] ._popupDescription_4ewx1_1{font-size:1.4rem}._popupInput_1b42s_1{width:100%;height:32px;background-color:var(--muted-bg);border:none;border-radius:5px;padding:4px 8px;font-size:1rem;color:var(--text-primary)}[device-type=mobile] ._popupInput_1b42s_1{font-size:1.4rem;height:48px}._popupActions_84v2b_1{display:flex;gap:8px}._popupBtn_ouvtc_1{width:100%;height:32px;border:none;border-radius:5px;font-weight:600;font-size:.9rem;background-color:var(--button-primary-bg);transition:background-color .2s;color:var(--text-inverse);cursor:pointer}[device-type=mobile] ._popupBtn_ouvtc_1{font-size:1.4rem;height:48px}._popupBtn_ouvtc_1:hover{background-color:var(--button-primary-bg-hover)}._popupBtn_ouvtc_1:active{background-color:var(--button-primary-bg-active)}._popupBtn_ouvtc_1._secondary_ouvtc_27{background-color:transparent;color:var(--text-primary);border:solid 1px var(--button-primary-bg);font-weight:400}._popupBtn_ouvtc_1._secondary_ouvtc_27:hover{background-color:var(--button-secondary-bg-hover)}._popupBtn_ouvtc_1._secondary_ouvtc_27:active{background-color:var(--button-secondary-bg-active)}._toolbar_1rbls_1{position:absolute;top:0;left:calc(var(--sidebar-width) + 10px);width:calc(100% - calc(var(--sidebar-width) + 15px));height:32px;display:flex;flex-direction:row;justify-content:space-between;align-items:center;z-index:9999;transition:top .3s,left .3s,width .3s}._toolbarCollapsed_1rbls_18{top:-100%}[device-type=mobile] ._toolbar_1rbls_1{top:5px;height:48px}._toolbarExpanded_1rbls_27{left:5px;width:calc(100% - 10px)}._toolbarTitle_1rbls_32{margin:0;font-size:1rem;font-weight:600}._toolbarActions_1rbls_38{background-color:var(--surface-bg);border-radius:16px;display:flex;flex-direction:row}._toolbarActions_1rbls_38 button{width:32px;height:32px;background-color:transparent;border:none;outline:none;color:var(--icon-color);cursor:pointer}[device-type=mobile] ._toolbarTitle_1p2s8_1{font-size:1.4rem}._toolbarActions_l0jv2_1{background-color:var(--surface-bg);border-radius:16px;display:flex;flex-direction:row}[device-type=mobile] ._toolbarActions_l0jv2_1{border-radius:24px}._toolbarActions_l0jv2_1 button{background-color:transparent}._toolbarBtn_8jy1b_1{width:32px;height:32px;border:none;outline:none;padding:0;display:flex;justify-content:center;align-items:center;background-color:var(--surface-bg);border-radius:16px;color:var(--icon-color);transition:background-color .2s;cursor:pointer}._toolbarBtn_8jy1b_1:hover{background-color:var(--surface-bg-hover)}._toolbarBtn_8jy1b_1:active{background-color:var(--surface-bg-active)}[device-type=mobile] ._toolbarBtn_8jy1b_1{width:48px;height:48px;border-radius:24px}._sidebarIcon_1lib1_1{rotate:0deg;transition:rotate .3s}._sidebarIconExpanded_1lib1_6{rotate:180deg}._content_to68z_1{position:absolute;top:0;left:calc(var(--sidebar-width) + 10px);height:100%;width:calc(100% - calc(var(--sidebar-width) + 15px));transition:left .3s,width .3s;display:flex;flex-direction:column;justify-content:start;align-items:start;overflow:auto;padding-bottom:5px}._contentExpanded_to68z_18{left:5px;width:calc(100% - 10px)}._toolbarPresent_to68z_23{top:37px;height:calc(100% - 37px)}[device-type=mobile] ._content_to68z_1._toolbarPresent_to68z_23{top:58px;height:calc(100% - 58px)}._contentNoMargin_to68z_33{padding:0;left:calc(var(--sidebar-width))}._contentExpanded_to68z_18._contentNoMargin_to68z_33{left:0;width:100%}._contextMenu_vtnpl_1{background-color:var(--surface-bg-active);position:fixed;border-radius:9px;transition:opacity .1s,transform .1s;display:flex;flex-direction:column;z-index:9999;border:solid 1px var(--border-color);transform:scale(.7) translate(var(--tx-start)) translateY(var(--ty-start));opacity:0;visibility:hidden;pointer-events:none;-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);padding:4px}._contextMenuOpen_vtnpl_22{visibility:visible;pointer-events:auto;transform:scale(1) translate(0) translateY(0);opacity:1}._listItem_7ga7e_1{padding:10px;transition:background-color .1s;border-radius:8px;color:var(--text-primary);cursor:pointer;display:flex;flex-direction:row;justify-content:start;align-items:center;gap:8px;width:100%}[device-type=mobile] ._listItem_7ga7e_1{font-size:1.4rem}._listItem_7ga7e_1:hover{background-color:var(--surface-bg-hover)}._listItem_7ga7e_1._selected_7ga7e_23{background-color:var(--surface-bg-active)}._emptyView_1synn_1{display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;height:100%;color:var(--text-secondary)}._card_zjz9h_1{background-color:var(--surface-bg);border-radius:9px;display:flex;flex-direction:column;border:solid 1px var(--border-color);padding:14px;margin:0 8px;width:calc(100% - 16px);gap:8px}._textInput_on5q4_1{width:100%;height:32px;background-color:var(--muted-bg);border:none;border-radius:5px;padding:4px 8px;font-size:.9rem;color:var(--text-primary);transition:background-color .2s}._textInput_on5q4_1:focus{outline:none;background-color:var(--surface-bg)}._textInput_on5q4_1:disabled{opacity:.5;cursor:not-allowed}._textInput_on5q4_1::placeholder{color:var(--text-secondary)}[device-type=mobile] ._textInput_on5q4_1{font-size:1.4rem;height:48px}._selectInput_3f04b_1{height:32px;background-color:var(--muted-bg);border:none;border-radius:5px;padding:4px 32px 4px 8px;font-size:.9rem;color:var(--text-primary);cursor:pointer;transition:background-color .2s;appearance:none;-webkit-appearance:none;-moz-appearance:none;background-image:url('data:image/svg+xml;utf8,<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4 6L8 10L12 6" stroke="%23666" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>');background-repeat:no-repeat;background-position:right 8px center}._selectInput_3f04b_1:hover{background-color:var(--surface-bg-hover)}._selectInput_3f04b_1:focus{outline:none;background-color:var(--surface-bg)}._selectInput_3f04b_1:disabled{opacity:.5;cursor:not-allowed}[device-type=mobile] ._selectInput_3f04b_1{font-size:1.4rem;height:48px}._button_g5rur_1{width:100%;height:32px;border:none;border-radius:5px;font-weight:600;font-size:.9rem;background-color:var(--button-primary-bg);transition:background-color .2s;color:var(--text-inverse);cursor:pointer}[device-type=mobile] ._button_g5rur_1{font-size:1.4rem;height:48px}._button_g5rur_1:hover{background-color:var(--button-primary-bg-hover)}._button_g5rur_1:active{background-color:var(--button-primary-bg-active)}._button_g5rur_1._secondary_g5rur_27{background-color:transparent;color:var(--text-primary);border:solid 1px var(--button-primary-bg);font-weight:400}._button_g5rur_1._secondary_g5rur_27:hover{background-color:var(--button-secondary-bg-hover)}._button_g5rur_1._secondary_g5rur_27:active{background-color:var(--button-secondary-bg-active)}._button_g5rur_1:disabled{background-color:var(--button-disabled-bg);color:var(--text-disabled);cursor:not-allowed;opacity:.6}._balloon_1jdjr_1{position:fixed;z-index:1000;display:flex;flex-direction:column;width:256px;padding:14px;gap:8px;border-radius:9px;background-color:var(--surface-bg);border:solid 1px var(--border-color);align-items:center;box-sizing:border-box;transform-origin:50% calc(100% + 8px);transform:translate(-50%,calc(-100% - 8px)) scale(.1);filter:opacity(0);transition:.3s;pointer-events:none;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px)}._balloonOpen_1jdjr_22{transform:translate(-50%,calc(-100% - 8px)) scale(1);filter:opacity(1);pointer-events:auto}._balloon_1jdjr_1:after{content:"";position:absolute;bottom:-6px;left:50%;transform:translate(-50%) rotate(45deg);width:10px;height:10px;background-color:var(--surface-bg);border-right:solid 1px var(--border-color);border-bottom:solid 1px var(--border-color);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px)}[device-type=mobile] ._balloon_1jdjr_1{font-size:1.4rem}`)),document.head.appendChild(r)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
2
- import { jsx as s, jsxs as m } from "react/jsx-runtime";
3
- import { createContext as E, useContext as g, useLayoutEffect as B, useRef as $, forwardRef as v, useEffect as z } from "react";
4
- import { Menu as D } from "lucide-react";
5
- const C = E({ isMobile: !1 }), u = () => g(C);
6
- function Vt({
1
+ (function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode(`:root{--accent: #0088ff;--button-primary-bg: var(--accent);--button-primary-bg-hover: color-mix(in srgb, var(--accent), black 15%);--button-primary-bg-active: color-mix(in srgb, var(--accent), black 30%);--button-secondary-bg-hover: color-mix(in srgb, var(--accent), white 90%);--button-secondary-bg-active: color-mix(in srgb, var(--accent), white 90%);--button-disabled-bg: color-mix(in srgb, var(--accent), white 60%);--text-disabled: color-mix(in srgb, var(--text-primary), white 40%);--icon-color: var(--accent);--border-color: #0000001a;--surface-bg: #ffffff7a;--surface-bg-hover: #ffffffa1;--surface-bg-active: #ffffffd5;--card-bg: #e5e5e5;--card-bg-secondary: #f5f5f5;--overlay-bg: rgba(0, 0, 0, .4);--muted-bg: rgba(0, 0, 0, .06);--text-primary: #000000;--text-secondary: #8b8b8b;--text-inverse: #ffffff;--sidebar-width: 200px}[data-theme=dark]{--button-secondary-bg-hover: #252628;--button-secondary-bg-active: #2b2f35;--button-disabled-bg: color-mix(in srgb, var(--accent), black 60%);--text-disabled: color-mix(in srgb, var(--text-primary), black 40%);--surface-bg: #1e1e1e7a;--surface-bg-hover: #2a2a2aa1;--surface-bg-active: #3a3a3ad5;--card-bg: #1d1d1d;--card-bg-secondary: #2a2a2a;--overlay-bg: rgba(255, 255, 255, .4);--muted-bg: rgba(255, 255, 255, .12);--text-primary: #ffffff;--text-inverse: #000000;--text-secondary: #b3b3b3}body{color:var(--text-primary);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}[device-type=mobile] body{background-color:var(--card-bg-secondary)!important}*,*:before,*:after{box-sizing:border-box;-webkit-tap-highlight-color:transparent;-webkit-tap-highlight-color:rgba(0,0,0,0)}._sidebar_yoln4_1{width:var(--sidebar-width);background-color:var(--surface-bg);position:absolute;top:0;bottom:5px;height:auto;left:5px;border-radius:9px;transition:left .3s;display:flex;flex-direction:column;z-index:999;border:solid 1px var(--border-color);transform:translate(0)}._sidebarCollapsed_yoln4_18{left:calc(-1 * var(--sidebar-width) - 10px)}[device-type=mobile] ._sidebar_yoln4_1._sidebarMobile_yoln4_22{position:absolute;inset:0;width:auto;height:auto;border-radius:0;transition:transform .25s ease;background-color:var(--card-bg)}[device-type=mobile] ._sidebar_yoln4_1._sidebarMobile_yoln4_22._sidebarMobileHidden_yoln4_35{transform:translate(-105%)}._sidebarContent_yoln4_39{height:100%;padding:0 4px;display:flex;flex-direction:column;overflow-y:auto;gap:2px}._sidebarFooter_yoln4_48{padding:4px}._sidebarTitle_azx8n_1{font-size:.8rem;font-weight:600;margin:8px 8px 8px 4px;color:var(--text-secondary)}[device-type=mobile] ._sidebarTitle_azx8n_1{font-size:1.2rem}._sidebarItem_1e3ru_1{padding:6px;transition:background-color .1s;border-radius:8px;color:var(--text-primary);cursor:pointer;display:flex;flex-direction:row;justify-content:start;align-items:center;gap:8px}[device-type=mobile] ._sidebarItem_1e3ru_1{font-size:1.4rem}._sidebarItem_1e3ru_1:hover{background-color:var(--surface-bg-hover)}._sidebarItem_1e3ru_1._selected_1e3ru_22{background-color:var(--surface-bg-active);color:var(--icon-color)}._sidebarMainBtn_65l8c_1{width:calc(100% - 8px);background-color:var(--button-primary-bg);border:none;outline:none;color:var(--text-inverse);border-radius:5px;height:32px;margin:4px;font-weight:600;font-size:.9rem;transition:background-color .2s;display:flex;flex-direction:row;justify-content:center;align-items:center;gap:8px;cursor:pointer}[device-type=mobile] ._sidebarMainBtn_65l8c_1{font-size:1.4rem;height:48px}._sidebarMainBtn_65l8c_1:hover{background-color:var(--button-primary-bg-hover)}._sidebarMainBtn_65l8c_1:active{background-color:var(--button-primary-bg-active)}._popupContainer_vz8rg_1{position:fixed;top:0;left:0;width:100%;height:100%;background-color:var(--overlay-bg);z-index:9999;display:flex;justify-content:center;align-items:center;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);opacity:1;transition:.2s;pointer-events:auto}._popupClosed_vz8rg_18{opacity:0;pointer-events:none}._popup_vz8rg_1{background-color:var(--card-bg);border-radius:8px;padding:12px;width:300px;height:auto;display:flex;flex-direction:column;justify-content:space-between;gap:12px}._popupIconContainer_vz8rg_35{display:flex;justify-content:center}._popupIcon_vz8rg_35{color:var(--icon-color)}._popupContent_vz8rg_44{display:flex;flex-direction:column;gap:8px}._popupTitle_4z5vb_1{margin:0;text-align:center;font-size:large;font-weight:700}[device-type=mobile] ._popupTitle_4z5vb_1{font-size:1.4rem}._popupDescription_4ewx1_1{text-align:center}[device-type=mobile] ._popupDescription_4ewx1_1{font-size:1.4rem}._popupInput_1b42s_1{width:100%;height:32px;background-color:var(--muted-bg);border:none;border-radius:5px;padding:4px 8px;font-size:1rem;color:var(--text-primary)}[device-type=mobile] ._popupInput_1b42s_1{font-size:1.4rem;height:48px}._popupActions_84v2b_1{display:flex;gap:8px}._popupBtn_ouvtc_1{width:100%;height:32px;border:none;border-radius:5px;font-weight:600;font-size:.9rem;background-color:var(--button-primary-bg);transition:background-color .2s;color:var(--text-inverse);cursor:pointer}[device-type=mobile] ._popupBtn_ouvtc_1{font-size:1.4rem;height:48px}._popupBtn_ouvtc_1:hover{background-color:var(--button-primary-bg-hover)}._popupBtn_ouvtc_1:active{background-color:var(--button-primary-bg-active)}._popupBtn_ouvtc_1._secondary_ouvtc_27{background-color:transparent;color:var(--text-primary);border:solid 1px var(--button-primary-bg);font-weight:400}._popupBtn_ouvtc_1._secondary_ouvtc_27:hover{background-color:var(--button-secondary-bg-hover)}._popupBtn_ouvtc_1._secondary_ouvtc_27:active{background-color:var(--button-secondary-bg-active)}._toolbar_1rbls_1{position:absolute;top:0;left:calc(var(--sidebar-width) + 10px);width:calc(100% - calc(var(--sidebar-width) + 15px));height:32px;display:flex;flex-direction:row;justify-content:space-between;align-items:center;z-index:9999;transition:top .3s,left .3s,width .3s}._toolbarCollapsed_1rbls_18{top:-100%}[device-type=mobile] ._toolbar_1rbls_1{top:5px;height:48px}._toolbarExpanded_1rbls_27{left:5px;width:calc(100% - 10px)}._toolbarTitle_1rbls_32{margin:0;font-size:1rem;font-weight:600}._toolbarActions_1rbls_38{background-color:var(--surface-bg);border-radius:16px;display:flex;flex-direction:row}._toolbarActions_1rbls_38 button{width:32px;height:32px;background-color:transparent;border:none;outline:none;color:var(--icon-color);cursor:pointer}._toolbarTitle_14yia_1{overflow-x:scroll;scrollbar-width:none;-ms-overflow-style:none}._toolbarTitle_14yia_1::-webkit-scrollbar{display:none}[device-type=mobile] ._toolbarTitle_14yia_1{font-size:1.4rem}._toolbarActions_l0jv2_1{background-color:var(--surface-bg);border-radius:16px;display:flex;flex-direction:row}[device-type=mobile] ._toolbarActions_l0jv2_1{border-radius:24px}._toolbarActions_l0jv2_1 button{background-color:transparent}._toolbarBtn_8jy1b_1{width:32px;height:32px;border:none;outline:none;padding:0;display:flex;justify-content:center;align-items:center;background-color:var(--surface-bg);border-radius:16px;color:var(--icon-color);transition:background-color .2s;cursor:pointer}._toolbarBtn_8jy1b_1:hover{background-color:var(--surface-bg-hover)}._toolbarBtn_8jy1b_1:active{background-color:var(--surface-bg-active)}[device-type=mobile] ._toolbarBtn_8jy1b_1{width:48px;height:48px;border-radius:24px}._sidebarIcon_1lib1_1{rotate:0deg;transition:rotate .3s}._sidebarIconExpanded_1lib1_6{rotate:180deg}._content_to68z_1{position:absolute;top:0;left:calc(var(--sidebar-width) + 10px);height:100%;width:calc(100% - calc(var(--sidebar-width) + 15px));transition:left .3s,width .3s;display:flex;flex-direction:column;justify-content:start;align-items:start;overflow:auto;padding-bottom:5px}._contentExpanded_to68z_18{left:5px;width:calc(100% - 10px)}._toolbarPresent_to68z_23{top:37px;height:calc(100% - 37px)}[device-type=mobile] ._content_to68z_1._toolbarPresent_to68z_23{top:58px;height:calc(100% - 58px)}._contentNoMargin_to68z_33{padding:0;left:calc(var(--sidebar-width))}._contentExpanded_to68z_18._contentNoMargin_to68z_33{left:0;width:100%}._contextMenu_vtnpl_1{background-color:var(--surface-bg-active);position:fixed;border-radius:9px;transition:opacity .1s,transform .1s;display:flex;flex-direction:column;z-index:9999;border:solid 1px var(--border-color);transform:scale(.7) translate(var(--tx-start)) translateY(var(--ty-start));opacity:0;visibility:hidden;pointer-events:none;-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);padding:4px}._contextMenuOpen_vtnpl_22{visibility:visible;pointer-events:auto;transform:scale(1) translate(0) translateY(0);opacity:1}._listItem_7ga7e_1{padding:10px;transition:background-color .1s;border-radius:8px;color:var(--text-primary);cursor:pointer;display:flex;flex-direction:row;justify-content:start;align-items:center;gap:8px;width:100%}[device-type=mobile] ._listItem_7ga7e_1{font-size:1.4rem}._listItem_7ga7e_1:hover{background-color:var(--surface-bg-hover)}._listItem_7ga7e_1._selected_7ga7e_23{background-color:var(--surface-bg-active)}._emptyView_1synn_1{display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;height:100%;color:var(--text-secondary)}._card_zjz9h_1{background-color:var(--surface-bg);border-radius:9px;display:flex;flex-direction:column;border:solid 1px var(--border-color);padding:14px;margin:0 8px;width:calc(100% - 16px);gap:8px}._textInput_on5q4_1{width:100%;height:32px;background-color:var(--muted-bg);border:none;border-radius:5px;padding:4px 8px;font-size:.9rem;color:var(--text-primary);transition:background-color .2s}._textInput_on5q4_1:focus{outline:none;background-color:var(--surface-bg)}._textInput_on5q4_1:disabled{opacity:.5;cursor:not-allowed}._textInput_on5q4_1::placeholder{color:var(--text-secondary)}[device-type=mobile] ._textInput_on5q4_1{font-size:1.4rem;height:48px}._selectInput_3f04b_1{height:32px;background-color:var(--muted-bg);border:none;border-radius:5px;padding:4px 32px 4px 8px;font-size:.9rem;color:var(--text-primary);cursor:pointer;transition:background-color .2s;appearance:none;-webkit-appearance:none;-moz-appearance:none;background-image:url('data:image/svg+xml;utf8,<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4 6L8 10L12 6" stroke="%23666" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>');background-repeat:no-repeat;background-position:right 8px center}._selectInput_3f04b_1:hover{background-color:var(--surface-bg-hover)}._selectInput_3f04b_1:focus{outline:none;background-color:var(--surface-bg)}._selectInput_3f04b_1:disabled{opacity:.5;cursor:not-allowed}[device-type=mobile] ._selectInput_3f04b_1{font-size:1.4rem;height:48px}._button_g5rur_1{width:100%;height:32px;border:none;border-radius:5px;font-weight:600;font-size:.9rem;background-color:var(--button-primary-bg);transition:background-color .2s;color:var(--text-inverse);cursor:pointer}[device-type=mobile] ._button_g5rur_1{font-size:1.4rem;height:48px}._button_g5rur_1:hover{background-color:var(--button-primary-bg-hover)}._button_g5rur_1:active{background-color:var(--button-primary-bg-active)}._button_g5rur_1._secondary_g5rur_27{background-color:transparent;color:var(--text-primary);border:solid 1px var(--button-primary-bg);font-weight:400}._button_g5rur_1._secondary_g5rur_27:hover{background-color:var(--button-secondary-bg-hover)}._button_g5rur_1._secondary_g5rur_27:active{background-color:var(--button-secondary-bg-active)}._button_g5rur_1:disabled{background-color:var(--button-disabled-bg);color:var(--text-disabled);cursor:not-allowed;opacity:.6}._balloon_1jdjr_1{position:fixed;z-index:1000;display:flex;flex-direction:column;width:256px;padding:14px;gap:8px;border-radius:9px;background-color:var(--surface-bg);border:solid 1px var(--border-color);align-items:center;box-sizing:border-box;transform-origin:50% calc(100% + 8px);transform:translate(-50%,calc(-100% - 8px)) scale(.1);filter:opacity(0);transition:.3s;pointer-events:none;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px)}._balloonOpen_1jdjr_22{transform:translate(-50%,calc(-100% - 8px)) scale(1);filter:opacity(1);pointer-events:auto}._balloon_1jdjr_1:after{content:"";position:absolute;bottom:-6px;left:50%;transform:translate(-50%) rotate(45deg);width:10px;height:10px;background-color:var(--surface-bg);border-right:solid 1px var(--border-color);border-bottom:solid 1px var(--border-color);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px)}[device-type=mobile] ._balloon_1jdjr_1{font-size:1.4rem}`)),document.head.appendChild(r)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
2
+ import { jsx as o, jsxs as h } from "react/jsx-runtime";
3
+ import { createContext as S, useContext as D, useLayoutEffect as E, useRef as $, forwardRef as x, useEffect as P, useState as j } from "react";
4
+ import { Menu as A } from "lucide-react";
5
+ const B = S({ isMobile: !1 }), d = () => D(B);
6
+ function qt({
7
7
  isMobile: t,
8
8
  sidebar: e,
9
- children: o,
10
- accentColor: n = "#0088ff"
9
+ children: n,
10
+ accentColor: s = "#0088ff"
11
11
  }) {
12
- return B(() => {
13
- n && document.documentElement.style.setProperty("--accent", n);
14
- }, [n]), /* @__PURE__ */ s(C.Provider, { value: { isMobile: t }, children: /* @__PURE__ */ m("div", { children: [
15
- /* @__PURE__ */ s("aside", { children: e }),
16
- /* @__PURE__ */ s("main", { children: o })
12
+ return E(() => {
13
+ s && document.documentElement.style.setProperty("--accent", s);
14
+ }, [s]), /* @__PURE__ */ o(B.Provider, { value: { isMobile: t }, children: /* @__PURE__ */ h("div", { children: [
15
+ /* @__PURE__ */ o("aside", { children: e }),
16
+ /* @__PURE__ */ o("main", { children: n })
17
17
  ] }) });
18
18
  }
19
- const S = "_sidebar_yoln4_1", P = "_sidebarCollapsed_yoln4_18", j = "_sidebarMobile_yoln4_22", A = "_sidebarMobileHidden_yoln4_35", w = "_sidebarContent_yoln4_39", O = "_sidebarFooter_yoln4_48", p = {
20
- sidebar: S,
21
- sidebarCollapsed: P,
22
- sidebarMobile: j,
23
- sidebarMobileHidden: A,
24
- sidebarContent: w,
25
- sidebarFooter: O
19
+ const R = "_sidebar_yoln4_1", O = "_sidebarCollapsed_yoln4_18", H = "_sidebarMobile_yoln4_22", k = "_sidebarMobileHidden_yoln4_35", V = "_sidebarContent_yoln4_39", W = "_sidebarFooter_yoln4_48", u = {
20
+ sidebar: R,
21
+ sidebarCollapsed: O,
22
+ sidebarMobile: H,
23
+ sidebarMobileHidden: k,
24
+ sidebarContent: V,
25
+ sidebarFooter: W
26
26
  };
27
- function Ht({ open: t, footer: e, children: o }) {
28
- const { isMobile: n } = u();
29
- return /* @__PURE__ */ m(
27
+ function Kt({ open: t, footer: e, children: n }) {
28
+ const { isMobile: s } = d();
29
+ return /* @__PURE__ */ h(
30
30
  "div",
31
31
  {
32
32
  className: `
33
- ${p.sidebar}
34
- ${t ? "" : p.sidebarCollapsed}
35
- ${n ? p.sidebarMobile : ""}
36
- ${!t && n ? p.sidebarMobileHidden : ""}`,
33
+ ${u.sidebar}
34
+ ${t ? "" : u.sidebarCollapsed}
35
+ ${s ? u.sidebarMobile : ""}
36
+ ${!t && s ? u.sidebarMobileHidden : ""}`,
37
37
  children: [
38
- /* @__PURE__ */ s("div", { className: p.sidebarContent, children: o }),
39
- e && /* @__PURE__ */ s("div", { className: p.sidebarFooter, children: e })
38
+ /* @__PURE__ */ o("div", { className: u.sidebarContent, children: n }),
39
+ e && /* @__PURE__ */ o("div", { className: u.sidebarFooter, children: e })
40
40
  ]
41
41
  }
42
42
  );
43
43
  }
44
- const R = "_sidebarTitle_azx8n_1", k = {
45
- sidebarTitle: R
44
+ const F = "_sidebarTitle_azx8n_1", L = {
45
+ sidebarTitle: F
46
46
  };
47
- function Ft({ children: t }) {
48
- return /* @__PURE__ */ s("h2", { className: k.sidebarTitle, children: t });
47
+ function Gt({ children: t }) {
48
+ return /* @__PURE__ */ o("h2", { className: L.sidebarTitle, children: t });
49
49
  }
50
- const V = "_sidebarItem_1e3ru_1", H = "_selected_1e3ru_22", x = {
51
- sidebarItem: V,
52
- selected: H
50
+ const q = "_sidebarItem_1e3ru_1", K = "_selected_1e3ru_22", M = {
51
+ sidebarItem: q,
52
+ selected: K
53
53
  };
54
- function Lt({
54
+ function Jt({
55
55
  onClick: t,
56
56
  onContextMenu: e,
57
- selected: o = !1,
58
- children: n
57
+ selected: n = !1,
58
+ children: s
59
59
  }) {
60
- const r = $(null), a = (c) => {
61
- r.current = setTimeout(() => {
62
- e && (c.preventDefault(), e(c));
60
+ const c = $(null), i = (r) => {
61
+ c.current = setTimeout(() => {
62
+ e && (r.preventDefault(), e(r));
63
63
  }, 500);
64
64
  }, l = () => {
65
- r.current && clearTimeout(r.current);
65
+ c.current && clearTimeout(c.current);
66
66
  };
67
- return /* @__PURE__ */ s(
67
+ return /* @__PURE__ */ o(
68
68
  "div",
69
69
  {
70
- className: `${x.sidebarItem} ${o ? x.selected : ""}`,
70
+ className: `${M.sidebarItem} ${n ? M.selected : ""}`,
71
71
  onClick: t,
72
- onContextMenu: (c) => {
73
- c.preventDefault(), e && e(c);
72
+ onContextMenu: (r) => {
73
+ r.preventDefault(), e && e(r);
74
74
  },
75
- onTouchStart: a,
75
+ onTouchStart: i,
76
76
  onTouchEnd: l,
77
77
  onTouchMove: l,
78
- children: n
78
+ children: s
79
79
  }
80
80
  );
81
81
  }
82
- const F = "_sidebarMainBtn_65l8c_1", L = {
83
- sidebarMainBtn: F
82
+ const G = "_sidebarMainBtn_65l8c_1", J = {
83
+ sidebarMainBtn: G
84
84
  };
85
- function Wt({ onClick: t, children: e }) {
86
- return /* @__PURE__ */ s("button", { className: L.sidebarMainBtn, onClick: t, children: e });
85
+ function Qt({ onClick: t, children: e }) {
86
+ return /* @__PURE__ */ o("button", { className: J.sidebarMainBtn, onClick: t, children: e });
87
87
  }
88
- const W = "_popupContainer_vz8rg_1", q = "_popupClosed_vz8rg_18", K = "_popup_vz8rg_1", G = "_popupContent_vz8rg_44", d = {
89
- popupContainer: W,
90
- popupClosed: q,
91
- popup: K,
92
- popupContent: G
88
+ const Q = "_popupContainer_vz8rg_1", U = "_popupClosed_vz8rg_18", X = "_popup_vz8rg_1", Y = "_popupContent_vz8rg_44", f = {
89
+ popupContainer: Q,
90
+ popupClosed: U,
91
+ popup: X,
92
+ popupContent: Y
93
93
  };
94
- function qt({ open: t = !1, children: e }) {
95
- return /* @__PURE__ */ s(
94
+ function Ut({ open: t = !1, children: e }) {
95
+ return /* @__PURE__ */ o(
96
96
  "div",
97
97
  {
98
- className: `${d.popupContainer} ${t ? "" : d.popupClosed}`,
99
- children: /* @__PURE__ */ s("div", { className: d.popup, children: /* @__PURE__ */ s("div", { className: d.popupContent, children: e }) })
98
+ className: `${f.popupContainer} ${t ? "" : f.popupClosed}`,
99
+ children: /* @__PURE__ */ o("div", { className: f.popup, children: /* @__PURE__ */ o("div", { className: f.popupContent, children: e }) })
100
100
  }
101
101
  );
102
102
  }
103
- const J = "_popupTitle_4z5vb_1", Q = {
104
- popupTitle: J
103
+ const Z = "_popupTitle_4z5vb_1", tt = {
104
+ popupTitle: Z
105
105
  };
106
- function Kt({ children: t }) {
107
- return /* @__PURE__ */ s("span", { className: Q.popupTitle, children: t });
106
+ function Xt({ children: t }) {
107
+ return /* @__PURE__ */ o("span", { className: tt.popupTitle, children: t });
108
108
  }
109
- const U = "_popupDescription_4ewx1_1", X = {
110
- popupDescription: U
109
+ const et = "_popupDescription_4ewx1_1", nt = {
110
+ popupDescription: et
111
111
  };
112
- function Gt({ children: t }) {
113
- return /* @__PURE__ */ s("span", { className: X.popupDescription, children: t });
112
+ function Yt({ children: t }) {
113
+ return /* @__PURE__ */ o("span", { className: nt.popupDescription, children: t });
114
114
  }
115
- const Y = "_popupInput_1b42s_1", Z = {
116
- popupInput: Y
117
- }, Jt = v(
118
- ({ placeholder: t = "Enter text...", value: e, onChange: o, onSubmit: n, autoFocus: r }, a) => {
119
- const l = $(null), c = a || l;
120
- return z(() => {
121
- r && c.current && c.current.focus();
122
- }, [r, c]), /* @__PURE__ */ s(
115
+ const ot = "_popupInput_1b42s_1", st = {
116
+ popupInput: ot
117
+ }, Zt = x(
118
+ ({ placeholder: t = "Enter text...", value: e, onChange: n, onSubmit: s, autoFocus: c }, i) => {
119
+ const l = $(null), r = i || l;
120
+ return P(() => {
121
+ c && r.current && r.current.focus();
122
+ }, [c, r]), /* @__PURE__ */ o(
123
123
  "input",
124
124
  {
125
- ref: c,
125
+ ref: r,
126
126
  type: "text",
127
- className: Z.popupInput,
127
+ className: st.popupInput,
128
128
  placeholder: t,
129
129
  value: e,
130
- onChange: (i) => o?.(i.target.value),
131
- onKeyDown: (i) => {
132
- i.key === "Enter" && n && n(e || "");
130
+ onChange: (a) => n?.(a.target.value),
131
+ onKeyDown: (a) => {
132
+ a.key === "Enter" && s && s(e || "");
133
133
  }
134
134
  }
135
135
  );
136
136
  }
137
- ), tt = "_popupActions_84v2b_1", et = {
138
- popupActions: tt
137
+ ), rt = "_popupActions_84v2b_1", ct = {
138
+ popupActions: rt
139
139
  };
140
- function Qt({
140
+ function te({
141
141
  orientation: t = "vertical",
142
142
  children: e
143
143
  }) {
144
- return /* @__PURE__ */ s(
144
+ return /* @__PURE__ */ o(
145
145
  "div",
146
146
  {
147
- className: et.popupActions,
147
+ className: ct.popupActions,
148
148
  style: {
149
149
  flexDirection: t == "vertical" ? "column" : "row"
150
150
  },
@@ -152,331 +152,329 @@ function Qt({
152
152
  }
153
153
  );
154
154
  }
155
- const ot = "_popupBtn_ouvtc_1", nt = "_secondary_ouvtc_27", h = {
156
- popupBtn: ot,
157
- secondary: nt
155
+ const it = "_popupBtn_ouvtc_1", lt = "_secondary_ouvtc_27", T = {
156
+ popupBtn: it,
157
+ secondary: lt
158
158
  };
159
- function Ut({
159
+ function ee({
160
160
  type: t = "primary",
161
161
  onClick: e,
162
- children: o
162
+ children: n
163
163
  }) {
164
- return /* @__PURE__ */ s(
164
+ return /* @__PURE__ */ o(
165
165
  "button",
166
166
  {
167
- className: `${h.popupBtn} ${t == "secondary" ? h.secondary : ""}`,
167
+ className: `${T.popupBtn} ${t == "secondary" ? T.secondary : ""}`,
168
168
  onClick: e,
169
- children: o
169
+ children: n
170
170
  }
171
171
  );
172
172
  }
173
- const st = "_toolbar_1rbls_1", ct = "_toolbarCollapsed_1rbls_18", rt = "_toolbarExpanded_1rbls_27", b = {
174
- toolbar: st,
175
- toolbarCollapsed: ct,
176
- toolbarExpanded: rt
173
+ const at = "_toolbar_1rbls_1", pt = "_toolbarCollapsed_1rbls_18", ut = "_toolbarExpanded_1rbls_27", m = {
174
+ toolbar: at,
175
+ toolbarCollapsed: pt,
176
+ toolbarExpanded: ut
177
177
  };
178
- function Xt({
178
+ function ne({
179
179
  expanded: t = !0,
180
180
  collapsed: e = !1,
181
- children: o
181
+ children: n
182
182
  }) {
183
- const { isMobile: n } = u();
184
- return /* @__PURE__ */ s(
183
+ const { isMobile: s } = d();
184
+ return /* @__PURE__ */ o(
185
185
  "div",
186
186
  {
187
- className: `${b.toolbar} ${t || n ? b.toolbarExpanded : ""} ${n ? b.toolbarMobile : ""} ${e ? b.toolbarCollapsed : ""}`,
188
- children: o
187
+ className: `${m.toolbar} ${t || s ? m.toolbarExpanded : ""} ${s ? m.toolbarMobile : ""} ${e ? m.toolbarCollapsed : ""}`,
188
+ children: n
189
189
  }
190
190
  );
191
191
  }
192
- const lt = "_toolbarTitle_1p2s8_1", at = {
193
- toolbarTitle: lt
192
+ const dt = "_toolbarTitle_14yia_1", _t = {
193
+ toolbarTitle: dt
194
194
  };
195
- function Yt({ children: t }) {
196
- return /* @__PURE__ */ s("h3", { className: at.toolbarTitle, children: t });
195
+ function oe({ children: t }) {
196
+ return /* @__PURE__ */ o("h3", { className: _t.toolbarTitle, children: t });
197
197
  }
198
- const it = "_toolbarActions_l0jv2_1", pt = {
199
- toolbarActions: it
198
+ const bt = "_toolbarActions_l0jv2_1", ft = {
199
+ toolbarActions: bt
200
200
  };
201
- function Zt({ children: t }) {
202
- return /* @__PURE__ */ s("div", { className: pt.toolbarActions, children: t });
201
+ function se({ children: t }) {
202
+ return /* @__PURE__ */ o("div", { className: ft.toolbarActions, children: t });
203
203
  }
204
- const ut = "_toolbarBtn_8jy1b_1", dt = {
205
- toolbarBtn: ut
204
+ const mt = "_toolbarBtn_8jy1b_1", yt = {
205
+ toolbarBtn: mt
206
206
  };
207
- function bt({ onClick: t, children: e }) {
208
- return /* @__PURE__ */ s(
207
+ function $t({ onClick: t, children: e }) {
208
+ return /* @__PURE__ */ o(
209
209
  "button",
210
210
  {
211
- onClick: (o) => {
212
- o.preventDefault(), t && t(o);
211
+ onClick: (n) => {
212
+ n.preventDefault(), t && t(n);
213
213
  },
214
- className: dt.toolbarBtn,
214
+ className: yt.toolbarBtn,
215
215
  children: e
216
216
  }
217
217
  );
218
218
  }
219
- const _t = "_sidebarIcon_1lib1_1", ft = "_sidebarIconExpanded_1lib1_6", T = {
220
- sidebarIcon: _t,
221
- sidebarIconExpanded: ft
219
+ const vt = "_sidebarIcon_1lib1_1", ht = "_sidebarIconExpanded_1lib1_6", I = {
220
+ sidebarIcon: vt,
221
+ sidebarIconExpanded: ht
222
222
  };
223
- function te({
223
+ function re({
224
224
  onToggleSidebar: t,
225
225
  expanded: e = !1
226
226
  }) {
227
- const { isMobile: o } = u();
228
- return /* @__PURE__ */ s(bt, { onClick: t, children: /* @__PURE__ */ s(
229
- D,
227
+ const { isMobile: n } = d();
228
+ return /* @__PURE__ */ o($t, { onClick: t, children: /* @__PURE__ */ o(
229
+ A,
230
230
  {
231
- size: o ? 24 : 18,
232
- className: `${T.sidebarIcon} ${e ? T.sidebarIconExpanded : ""}`
231
+ size: n ? 24 : 18,
232
+ className: `${I.sidebarIcon} ${e ? I.sidebarIconExpanded : ""}`
233
233
  }
234
234
  ) });
235
235
  }
236
- const yt = "_content_to68z_1", mt = "_contentExpanded_to68z_18", $t = "_toolbarPresent_to68z_23", vt = "_contentNoMargin_to68z_33", _ = {
237
- content: yt,
238
- contentExpanded: mt,
239
- toolbarPresent: $t,
240
- contentNoMargin: vt
236
+ const xt = "_content_to68z_1", Mt = "_contentExpanded_to68z_18", Tt = "_toolbarPresent_to68z_23", It = "_contentNoMargin_to68z_33", y = {
237
+ content: xt,
238
+ contentExpanded: Mt,
239
+ toolbarPresent: Tt,
240
+ contentNoMargin: It
241
241
  };
242
- function ee({
242
+ function ce({
243
243
  expanded: t = !0,
244
244
  toolbar: e = !0,
245
- margin: o = "default",
246
- children: n
245
+ margin: n = "default",
246
+ children: s
247
247
  }) {
248
- return /* @__PURE__ */ s(
248
+ return /* @__PURE__ */ o(
249
249
  "div",
250
250
  {
251
- className: `${_.content} ${t ? _.contentExpanded : ""} ${e ? _.toolbarPresent : ""} ${o === "none" ? _.contentNoMargin : ""}`,
252
- children: n
251
+ className: `${y.content} ${t ? y.contentExpanded : ""} ${e ? y.toolbarPresent : ""} ${n === "none" ? y.contentNoMargin : ""}`,
252
+ children: s
253
253
  }
254
254
  );
255
255
  }
256
- const xt = "_contextMenu_vtnpl_1", ht = "_contextMenuOpen_vtnpl_22", y = {
257
- contextMenu: xt,
258
- contextMenuOpen: ht
256
+ const Nt = "_contextMenu_vtnpl_1", Ct = "_contextMenuOpen_vtnpl_22", v = {
257
+ contextMenu: Nt,
258
+ contextMenuOpen: Ct
259
259
  };
260
- function oe({
261
- open: t,
262
- x: e = 20,
263
- y: o = 20,
264
- from: n = "top-left",
265
- children: r
266
- }) {
267
- const { isMobile: a } = u(), l = {
268
- "top-left": { tx: "-30%", ty: "-30%" },
269
- "top-right": { tx: "30%", ty: "-30%" },
270
- "bottom-left": { tx: "-30%", ty: "30%" },
271
- "bottom-right": { tx: "30%", ty: "30%" }
272
- }, { tx: c, ty: i } = l[n], f = {
273
- top: n.includes("top") ? `${o}px` : "auto",
274
- bottom: n.includes("bottom") ? `${o}px` : "auto",
275
- left: n.includes("left") ? `${e}px` : "auto",
276
- right: n.includes("right") ? `${e}px` : "auto",
277
- "--tx-start": c,
278
- "--ty-start": i
260
+ function ie({ open: t, x: e, y: n, children: s }) {
261
+ const { isMobile: c } = d(), i = $(null), [l, r] = j({ top: 0, left: 0 });
262
+ E(() => {
263
+ if (t && i.current) {
264
+ const p = i.current.getBoundingClientRect(), w = window.innerWidth, z = window.innerHeight;
265
+ let _ = e, b = n;
266
+ e + p.width > w && (_ = e - p.width), n + p.height > z && (b = n - p.height), _ = Math.max(5, _), b = Math.max(5, b), r({ top: b, left: _ });
267
+ }
268
+ }, [t, e, n]);
269
+ const a = {
270
+ top: `${l.top}px`,
271
+ left: `${l.left}px`,
272
+ position: "fixed",
273
+ // Fixed is usually safer for global context menus
274
+ visibility: t ? "visible" : "hidden",
275
+ opacity: t ? 1 : 0
279
276
  };
280
- return /* @__PURE__ */ s(
277
+ return /* @__PURE__ */ o(
281
278
  "div",
282
279
  {
280
+ ref: i,
283
281
  className: `
284
- ${y.contextMenu}
285
- ${t ? y.contextMenuOpen : ""}
286
- ${a ? y.contextMenuMobile : ""}
287
- `,
288
- style: f,
289
- children: r
282
+ ${v.contextMenu}
283
+ ${t ? v.contextMenuOpen : ""}
284
+ ${c ? v.contextMenuMobile : ""}
285
+ `,
286
+ style: a,
287
+ children: s
290
288
  }
291
289
  );
292
290
  }
293
- const Tt = "_listItem_7ga7e_1", Mt = "_selected_7ga7e_23", M = {
294
- listItem: Tt,
295
- selected: Mt
291
+ const gt = "_listItem_7ga7e_1", Et = "_selected_7ga7e_23", N = {
292
+ listItem: gt,
293
+ selected: Et
296
294
  };
297
- function ne({
295
+ function le({
298
296
  onClick: t,
299
297
  onContextMenu: e,
300
- selected: o = !1,
301
- children: n
298
+ selected: n = !1,
299
+ children: s
302
300
  }) {
303
- const r = $(null), a = (c) => {
304
- r.current = setTimeout(() => {
305
- e && (c.preventDefault(), e(c));
301
+ const c = $(null), i = (r) => {
302
+ c.current = setTimeout(() => {
303
+ e && (r.preventDefault(), e(r));
306
304
  }, 500);
307
305
  }, l = () => {
308
- r.current && clearTimeout(r.current);
306
+ c.current && clearTimeout(c.current);
309
307
  };
310
- return /* @__PURE__ */ s(
308
+ return /* @__PURE__ */ o(
311
309
  "div",
312
310
  {
313
- className: `${M.listItem} ${o ? M.selected : ""}`,
311
+ className: `${N.listItem} ${n ? N.selected : ""}`,
314
312
  onClick: t,
315
- onContextMenu: (c) => {
316
- c.preventDefault(), e && e(c);
313
+ onContextMenu: (r) => {
314
+ r.preventDefault(), e && e(r);
317
315
  },
318
- onTouchStart: a,
316
+ onTouchStart: i,
319
317
  onTouchEnd: l,
320
318
  onTouchMove: l,
321
- children: n
319
+ children: s
322
320
  }
323
321
  );
324
322
  }
325
- function It({
323
+ function Bt({
326
324
  icon: t,
327
325
  size: e = "default",
328
- color: o = "default",
329
- className: n
326
+ color: n = "default",
327
+ className: s
330
328
  }) {
331
- const { isMobile: r } = u(), a = e === "default" ? r ? 24 : 18 : e, l = o === "selected" ? "var(--icon-color)" : o;
332
- return o === "default" ? /* @__PURE__ */ s(
329
+ const { isMobile: c } = d(), i = e === "default" ? c ? 24 : 18 : e, l = n === "selected" ? "var(--icon-color)" : n;
330
+ return n === "default" ? /* @__PURE__ */ o(
333
331
  t,
334
332
  {
335
- size: a,
336
- className: n,
337
- strokeWidth: r ? 2.5 : 2
333
+ size: i,
334
+ className: s,
335
+ strokeWidth: c ? 2.5 : 2
338
336
  }
339
- ) : /* @__PURE__ */ s(
337
+ ) : /* @__PURE__ */ o(
340
338
  t,
341
339
  {
342
- size: a,
340
+ size: i,
343
341
  color: l,
344
- className: n,
345
- strokeWidth: r ? 2.5 : 2
342
+ className: s,
343
+ strokeWidth: c ? 2.5 : 2
346
344
  }
347
345
  );
348
346
  }
349
- const Nt = "_emptyView_1synn_1", Ct = {
350
- emptyView: Nt
347
+ const wt = "_emptyView_1synn_1", zt = {
348
+ emptyView: wt
351
349
  };
352
- function se({ icon: t, label: e }) {
353
- const { isMobile: o } = u(), n = o ? 64 : 48;
354
- return /* @__PURE__ */ m("div", { className: Ct.emptyView, children: [
355
- /* @__PURE__ */ s(It, { icon: t, size: n, color: "var(--text-secondary)" }),
356
- /* @__PURE__ */ s("h2", { children: e })
350
+ function ae({ icon: t, label: e }) {
351
+ const { isMobile: n } = d(), s = n ? 64 : 48;
352
+ return /* @__PURE__ */ h("div", { className: zt.emptyView, children: [
353
+ /* @__PURE__ */ o(Bt, { icon: t, size: s, color: "var(--text-secondary)" }),
354
+ /* @__PURE__ */ o("h2", { children: e })
357
355
  ] });
358
356
  }
359
- const Et = "_card_zjz9h_1", gt = {
360
- card: Et
357
+ const St = "_card_zjz9h_1", Dt = {
358
+ card: St
361
359
  };
362
- function ce({ children: t }) {
363
- return /* @__PURE__ */ s("div", { className: gt.card, children: t });
360
+ function pe({ children: t }) {
361
+ return /* @__PURE__ */ o("div", { className: Dt.card, children: t });
364
362
  }
365
- const Bt = "_textInput_on5q4_1", zt = {
366
- textInput: Bt
367
- }, re = v(
363
+ const Pt = "_textInput_on5q4_1", jt = {
364
+ textInput: Pt
365
+ }, ue = x(
368
366
  ({
369
367
  placeholder: t,
370
368
  value: e,
371
- onChange: o,
372
- onFocus: n,
373
- onBlur: r,
374
- disabled: a = !1,
369
+ onChange: n,
370
+ onFocus: s,
371
+ onBlur: c,
372
+ disabled: i = !1,
375
373
  type: l = "text",
376
- className: c
377
- }, i) => /* @__PURE__ */ s(
374
+ className: r
375
+ }, a) => /* @__PURE__ */ o(
378
376
  "input",
379
377
  {
380
- ref: i,
378
+ ref: a,
381
379
  type: l,
382
- className: `${zt.textInput} ${c || ""}`,
380
+ className: `${jt.textInput} ${r || ""}`,
383
381
  placeholder: t,
384
382
  value: e,
385
- onChange: (f) => o?.(f.target.value),
386
- onFocus: n,
387
- onBlur: r,
388
- disabled: a
383
+ onChange: (p) => n?.(p.target.value),
384
+ onFocus: s,
385
+ onBlur: c,
386
+ disabled: i
389
387
  }
390
388
  )
391
- ), Dt = "_selectInput_3f04b_1", St = {
392
- selectInput: Dt
393
- }, le = v(
394
- ({ className: t, children: e, ...o }, n) => /* @__PURE__ */ s(
389
+ ), At = "_selectInput_3f04b_1", Rt = {
390
+ selectInput: At
391
+ }, de = x(
392
+ ({ className: t, children: e, ...n }, s) => /* @__PURE__ */ o(
395
393
  "select",
396
394
  {
397
- ref: n,
398
- className: `${St.selectInput} ${t || ""}`,
399
- ...o,
395
+ ref: s,
396
+ className: `${Rt.selectInput} ${t || ""}`,
397
+ ...n,
400
398
  children: e
401
399
  }
402
400
  )
403
- ), Pt = "_button_g5rur_1", jt = "_secondary_g5rur_27", I = {
404
- button: Pt,
405
- secondary: jt
401
+ ), Ot = "_button_g5rur_1", Ht = "_secondary_g5rur_27", C = {
402
+ button: Ot,
403
+ secondary: Ht
406
404
  };
407
- function ae({
405
+ function _e({
408
406
  disabled: t = !1,
409
407
  type: e = "primary",
410
- onClick: o,
411
- children: n,
412
- style: r
408
+ onClick: n,
409
+ children: s,
410
+ style: c
413
411
  }) {
414
- return /* @__PURE__ */ s(
412
+ return /* @__PURE__ */ o(
415
413
  "button",
416
414
  {
417
- className: `${I.button} ${e == "secondary" ? I.secondary : ""}`,
418
- onClick: o,
415
+ className: `${C.button} ${e == "secondary" ? C.secondary : ""}`,
416
+ onClick: n,
419
417
  disabled: t,
420
- style: r,
421
- children: n
418
+ style: c,
419
+ children: s
422
420
  }
423
421
  );
424
422
  }
425
- const At = "_balloon_1jdjr_1", wt = "_balloonOpen_1jdjr_22", N = {
426
- balloon: At,
427
- balloonOpen: wt
423
+ const kt = "_balloon_1jdjr_1", Vt = "_balloonOpen_1jdjr_22", g = {
424
+ balloon: kt,
425
+ balloonOpen: Vt
428
426
  };
429
- function ie({
427
+ function be({
430
428
  open: t,
431
429
  x: e,
432
- y: o,
433
- children: n,
434
- className: r,
435
- style: a,
430
+ y: n,
431
+ children: s,
432
+ className: c,
433
+ style: i,
436
434
  ...l
437
435
  }) {
438
- const c = {};
439
- typeof e == "number" && (c.left = e), typeof o == "number" && (c.top = o);
440
- const i = [
441
- N.balloon,
442
- t ? N.balloonOpen : "",
443
- r ?? ""
436
+ const r = {};
437
+ typeof e == "number" && (r.left = e), typeof n == "number" && (r.top = n);
438
+ const a = [
439
+ g.balloon,
440
+ t ? g.balloonOpen : "",
441
+ c ?? ""
444
442
  ].filter(Boolean).join(" ");
445
- return /* @__PURE__ */ s(
443
+ return /* @__PURE__ */ o(
446
444
  "div",
447
445
  {
448
446
  ...l,
449
- className: i,
450
- style: { ...a, ...c },
451
- children: n
447
+ className: a,
448
+ style: { ...i, ...r },
449
+ children: s
452
450
  }
453
451
  );
454
452
  }
455
453
  export {
456
- Vt as AppShell,
457
- ie as Balloon,
458
- ae as Button,
459
- ce as Card,
460
- ee as Content,
461
- oe as ContextMenu,
462
- se as EmptyView,
463
- It as Icon,
464
- ne as ListItem,
465
- qt as Popup,
466
- Qt as PopupActions,
467
- Ut as PopupButton,
468
- Gt as PopupDescription,
469
- Jt as PopupInput,
470
- Kt as PopupTitle,
471
- le as SelectInput,
472
- Ht as Sidebar,
473
- Wt as SidebarButton,
474
- Lt as SidebarItem,
475
- Ft as SidebarTitle,
476
- re as TextInput,
477
- Xt as Toolbar,
478
- Zt as ToolbarActions,
479
- bt as ToolbarButton,
480
- te as ToolbarExpandSidebarButton,
481
- Yt as ToolbarTitle
454
+ qt as AppShell,
455
+ be as Balloon,
456
+ _e as Button,
457
+ pe as Card,
458
+ ce as Content,
459
+ ie as ContextMenu,
460
+ ae as EmptyView,
461
+ Bt as Icon,
462
+ le as ListItem,
463
+ Ut as Popup,
464
+ te as PopupActions,
465
+ ee as PopupButton,
466
+ Yt as PopupDescription,
467
+ Zt as PopupInput,
468
+ Xt as PopupTitle,
469
+ de as SelectInput,
470
+ Kt as Sidebar,
471
+ Qt as SidebarButton,
472
+ Jt as SidebarItem,
473
+ Gt as SidebarTitle,
474
+ ue as TextInput,
475
+ ne as Toolbar,
476
+ se as ToolbarActions,
477
+ $t as ToolbarButton,
478
+ re as ToolbarExpandSidebarButton,
479
+ oe as ToolbarTitle
482
480
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@htmlos-next/ui",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "type": "module",
5
5
  "main": "./dist/htmlos-ui.cjs",
6
6
  "module": "./dist/htmlos-ui.js",