lantern-harness 0.1.9 → 0.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. package/CHANGELOG.md +90 -0
  2. package/README.md +6 -6
  3. package/builtin/session/lh-fs.mjs +32 -14
  4. package/dist/500.html +258 -22
  5. package/dist/_astro/Base.Bgxs1QQl.css +1 -0
  6. package/dist/_astro/Base.astro_astro_type_script_index_0_lang.CvbRi7Tl.js +1 -0
  7. package/dist/_astro/CaseExecBoard.Dttqp0wg.js +1 -0
  8. package/dist/_astro/CaseGenerateApp.DqW_nWMc.js +9 -0
  9. package/dist/_astro/CasesLibrary.8aMUUGp_.js +1 -0
  10. package/dist/_astro/ChatApp.BLxf0h1d.js +219 -0
  11. package/dist/_astro/ColumnResize.BEkEW7qw.js +1 -0
  12. package/dist/_astro/{ConfirmDialog.CBVsDJ8f.js → ConfirmDialog.BZzZWDci.js} +1 -1
  13. package/dist/_astro/{DashboardBoard.DCtfrrJz.js → DashboardBoard.CkSbhEDI.js} +3 -3
  14. package/dist/_astro/DatePicker.Bkl71M49.js +1 -0
  15. package/dist/_astro/DocsFileBrowser.MKVCfZrE.js +1 -0
  16. package/dist/_astro/DocsPager.DJY4foYL.js +1 -0
  17. package/dist/_astro/{DrawerField.CWMLhcPX.js → DrawerField.CHRg77LG.js} +1 -1
  18. package/dist/_astro/{ExcelFieldTags.B_XMwNNx.js → ExcelFieldTags.DXMeaDa5.js} +4 -4
  19. package/dist/_astro/KnowledgeLibrary.B-p1aoQN.js +1 -0
  20. package/dist/_astro/NamePromptDialog.Wa9O530a.js +1 -0
  21. package/dist/_astro/NavLibraries.C6LImMO_.js +1 -0
  22. package/dist/_astro/OverflowHint.D6v4Uj2N.js +1 -0
  23. package/dist/_astro/PluginsPage.-97n3x2U.js +39 -0
  24. package/dist/_astro/PluginsPage.DkmRPfbU.js +1 -0
  25. package/dist/_astro/PmBugsBoard.CMT4-eoB.js +1 -0
  26. package/dist/_astro/PmIterationsBoard.BQM_dzdZ.js +1 -0
  27. package/dist/_astro/PmProjectDetail.CzU80pat.js +1 -0
  28. package/dist/_astro/PmProjectsBoard.Cxsa7SYQ.js +1 -0
  29. package/dist/_astro/PmRequirementsBoard.4_JMDDN0.js +1 -0
  30. package/dist/_astro/PmRequirementsBoard.B8HL07cw.js +1 -0
  31. package/dist/_astro/PmShared.Ca2Ao7v_.js +1 -0
  32. package/dist/_astro/PromptsLibrary.C9BcIxKK.js +1 -0
  33. package/dist/_astro/ReportsPage.Fh5DRKLT.js +1 -0
  34. package/dist/_astro/RequirementsLibrary.CBkuWE8X.js +1 -0
  35. package/dist/_astro/SearchableSelect.DnjoSslK.js +1 -0
  36. package/dist/_astro/SelectDropdown.CuuDHa8s.js +1 -0
  37. package/dist/_astro/SettingsDialog.CVB5Gtk4.js +1 -0
  38. package/dist/_astro/SlideOverDrawer.B7B5Wu8I.js +1 -0
  39. package/dist/_astro/{SpaceSwitcher.CI3KDBOA.js → SpaceSwitcher.BVQLt_tL.js} +2 -2
  40. package/dist/_astro/TagSelect.CuN5RdF4.js +1 -0
  41. package/dist/_astro/TasksBoard.Bu-fpIZ7.js +1 -0
  42. package/dist/_astro/TemplatesLibrary.DSylQGlN.js +1 -0
  43. package/dist/_astro/TestStatsBoard.CPyKW4wc.js +1 -0
  44. package/dist/_astro/Toast.R8_2OWRX.js +1 -0
  45. package/dist/_astro/TodosBoard.8kvRTEW-.js +1 -0
  46. package/dist/_astro/UiAutoBoard.DFTiDqCp.js +9 -0
  47. package/dist/_astro/active-element-history.CED-m1Zp.js +1 -0
  48. package/dist/_astro/app-config.BUPzGl9f.js +1 -0
  49. package/dist/_astro/{client.Be_SakrB.js → client.BHNTqLjv.js} +3 -3
  50. package/dist/_astro/dialog.BAPTk9a_.js +1 -0
  51. package/dist/_astro/hydrate-cache.BXX604Bw.js +1 -0
  52. package/dist/_astro/{i18n.B52gLzii.js → i18n.BGPnP1Bg.js} +1 -1
  53. package/dist/_astro/index.astro_astro_type_script_index_0_lang.LPL9mPQY.js +1 -0
  54. package/dist/_astro/jsx-runtime.DUg_B_vD.js +1 -0
  55. package/dist/_astro/{lib.DJNDi_Ht.js → lib.CgXLzMMd.js} +15 -15
  56. package/dist/_astro/listbox.C96OCanh.js +1 -0
  57. package/dist/_astro/markdown-client.DRva7DS9.js +58 -0
  58. package/dist/_astro/menu.IPWdRoNM.js +1 -0
  59. package/dist/_astro/{open-docs-in-session.Xg3OSOfc.js → open-docs-in-session.CyFNgh1I.js} +1 -1
  60. package/dist/_astro/{plugins.BDZqJNOy.js → plugins.C2BMfzv1.js} +1 -1
  61. package/dist/_astro/{pm.Bl3hz9fF.js → pm.CagBA-ht.js} +2 -2
  62. package/dist/_astro/{portal.Cm9XlIPf.js → portal.C0hAhXDF.js} +2 -2
  63. package/dist/_astro/prompts-meta.Bua-j14I.js +2 -0
  64. package/dist/_astro/react-dom.DLW9pGCF.js +1 -0
  65. package/dist/_astro/{react-dom.CqAxpHMt.js → react.Blvh0GOs.js} +1 -1
  66. package/dist/_astro/report-prompt.CAfZ6RIo.js +1 -0
  67. package/dist/_astro/{settings.C6NWuiFO.js → settings.Ceefeil5.js} +2 -2
  68. package/dist/_astro/{spaces-client.k_ciWMai.js → spaces-client.BocUabwy.js} +1 -1
  69. package/dist/_astro/ui-auto-prompt.CX8fju7r.js +3 -0
  70. package/dist/_astro/ui-auto.BmC9JJ_X.js +1 -0
  71. package/dist/_astro/update.CtF8vsag.js +1 -0
  72. package/dist/_astro/use-text-value.DBQvHeNl.js +1 -0
  73. package/dist/_astro/use-tree-walker.DFU2AaAP.js +1 -0
  74. package/dist/_astro/useListAnim.BoerpmsB.js +1 -0
  75. package/dist/_astro/{view-prefs.Dyu_lmN2.js → view-prefs.BEAZRcxF.js} +1 -1
  76. package/dist/case-exec/index.html +458 -22
  77. package/dist/cases/generate/index.html +258 -22
  78. package/dist/cases/library/index.html +458 -22
  79. package/dist/dashboard/index.html +458 -22
  80. package/dist/docs/changelog/index.html +373 -23
  81. package/dist/docs/install/index.html +258 -22
  82. package/dist/docs/manual/index.html +314 -35
  83. package/dist/index.html +2 -281
  84. package/dist/knowledge/index.html +458 -22
  85. package/dist/knowledge//345/212/237/350/203/275/346/265/213/350/257/225/347/224/250/344/276/213/347/274/226/345/206/231/350/247/204/350/214/203/index.html +258 -22
  86. package/dist/plugins/index.html +258 -22
  87. package/dist/pm/bugs/index.html +458 -22
  88. package/dist/pm/iterations/index.html +458 -22
  89. package/dist/pm/projects/detail/index.html +458 -22
  90. package/dist/pm/projects/index.html +458 -22
  91. package/dist/pm/requirements/index.html +458 -22
  92. package/dist/prompts/index.html +458 -22
  93. package/dist/reports/index.html +458 -22
  94. package/dist/requirements/index.html +458 -22
  95. package/dist/tasks/index.html +458 -22
  96. package/dist/templates/index.html +458 -22
  97. package/dist/templates//345/212/237/350/203/275/346/265/213/350/257/225/346/212/245/345/221/212//345/212/237/350/203/275/346/265/213/350/257/225/346/212/245/345/221/212/346/250/241/346/235/277/index.html +258 -22
  98. package/dist/templates//346/200/247/350/203/275/346/265/213/350/257/225/346/212/245/345/221/212//346/200/247/350/203/275/346/265/213/350/257/225/346/212/245/345/221/212/346/250/241/346/235/277/index.html +258 -22
  99. package/dist/templates//346/200/247/350/203/275/346/265/213/350/257/225/347/224/250/344/276/213//346/200/247/350/203/275/346/265/213/350/257/225/347/224/250/344/276/213/346/250/241/346/235/277/index.html +258 -22
  100. package/dist/templates//346/216/245/345/217/243/346/265/213/350/257/225/346/212/245/345/221/212//346/216/245/345/217/243/346/265/213/350/257/225/346/212/245/345/221/212/346/250/241/346/235/277/index.html +258 -22
  101. package/dist/templates//350/207/252/345/212/250/345/214/226/346/265/213/350/257/225/347/224/250/344/276/213//350/207/252/345/212/250/345/214/226/346/265/213/350/257/225/347/224/250/344/276/213/346/250/241/346/235/277/index.html +258 -22
  102. package/dist/test-automation/index.html +717 -0
  103. package/dist/test-stats/index.html +458 -22
  104. package/dist/todos/index.html +458 -22
  105. package/dist/workbench/index.html +517 -0
  106. package/docs//346/223/215/344/275/234/346/211/213/345/206/214.md +80 -43
  107. package/lh-plugins/lh-project-docs.mjs +14 -0
  108. package/lh-plugins/lh-uiauto.mjs +1445 -386
  109. package/lh-plugins/plugin-prompts.mjs +200 -0
  110. package/lh-plugins/storage-domain.mjs +6 -0
  111. package/lh-plugins/uiauto-adapters/index.mjs +57 -0
  112. package/lh-plugins/uiauto-adapters/playwright.mjs +215 -0
  113. package/lh-plugins/uiauto-adapters/pytest.mjs +151 -0
  114. package/lh-plugins/uiauto-adapters/selenium.mjs +163 -0
  115. package/lh-plugins/uiauto-adapters/shared.mjs +371 -0
  116. package/lh-plugins/uiauto-adapters/tasks.mjs +369 -0
  117. package/lh-plugins/uiauto-explorer/apps.mjs +332 -0
  118. package/lh-plugins/uiauto-explorer/diff.mjs +159 -0
  119. package/lh-plugins/uiauto-explorer/emit-files.mjs +506 -0
  120. package/lh-plugins/uiauto-explorer/emit-python.mjs +160 -0
  121. package/lh-plugins/uiauto-explorer/emit-ts.mjs +118 -0
  122. package/lh-plugins/uiauto-explorer/emit.mjs +15 -0
  123. package/lh-plugins/uiauto-explorer/ir.mjs +114 -0
  124. package/lh-plugins/uiauto-explorer/locators.mjs +267 -0
  125. package/lh-plugins/uiauto-explorer/merge.mjs +235 -0
  126. package/lh-plugins/uiauto-explorer/plan.mjs +165 -0
  127. package/lh-plugins/uiauto-explorer/runner.mjs +370 -0
  128. package/lh-plugins/uiauto-explorer/sessions.mjs +1373 -0
  129. package/lh-plugins/uiauto-explorer/snapshot.mjs +492 -0
  130. package/lh-plugins/uiauto-prompt.mjs +122 -0
  131. package/lh-plugins/uiauto-report.mjs +111 -0
  132. package/package.json +1 -1
  133. package/dist/_astro/Base.4X_wsSoR.css +0 -1
  134. package/dist/_astro/Base.astro_astro_type_script_index_0_lang.Dy7fJoxu.js +0 -1
  135. package/dist/_astro/CaseExecBoard.DKdfW5fM.js +0 -1
  136. package/dist/_astro/CaseGenerateApp.Bm8AyH9s.js +0 -9
  137. package/dist/_astro/CasesLibrary.CvVJZ74h.js +0 -1
  138. package/dist/_astro/ChatApp.BS-wLBRa.js +0 -276
  139. package/dist/_astro/ColumnResize.Bs6GL3DJ.js +0 -1
  140. package/dist/_astro/DatePicker.CMfX7F6z.js +0 -1
  141. package/dist/_astro/DocsFileBrowser.BtRoZ787.js +0 -1
  142. package/dist/_astro/DocsPager.C20ue_JZ.js +0 -1
  143. package/dist/_astro/KnowledgeLibrary.CV4DyStj.js +0 -1
  144. package/dist/_astro/NamePromptDialog.Dl5kSnQI.js +0 -1
  145. package/dist/_astro/NavLibraries.DmD2lZBZ.js +0 -1
  146. package/dist/_astro/OverflowHint.lzmplP5j.js +0 -1
  147. package/dist/_astro/PluginsPage.B59AMDrB.js +0 -1
  148. package/dist/_astro/PluginsPage.BEAPymNL.js +0 -39
  149. package/dist/_astro/PmBugsBoard.CPEyBp0l.js +0 -1
  150. package/dist/_astro/PmIterationsBoard.zCeLpcBo.js +0 -1
  151. package/dist/_astro/PmProjectDetail.ejIam5sD.js +0 -1
  152. package/dist/_astro/PmProjectsBoard.DbXzir8o.js +0 -1
  153. package/dist/_astro/PmRequirementsBoard.CynewRfv.js +0 -1
  154. package/dist/_astro/PmRequirementsBoard.D9eUMJWI.js +0 -1
  155. package/dist/_astro/PmShared.BxTHKdjY.js +0 -1
  156. package/dist/_astro/PromptsLibrary.Bkruu80b.js +0 -1
  157. package/dist/_astro/ReportsPage.BoBQshMQ.js +0 -1
  158. package/dist/_astro/RequirementsLibrary.BC0A8qdk.js +0 -1
  159. package/dist/_astro/SearchableSelect.CXa1hiDd.js +0 -1
  160. package/dist/_astro/SelectDropdown.Buv7rQJ_.js +0 -1
  161. package/dist/_astro/SettingsDialog.Dc-9QNJI.js +0 -1
  162. package/dist/_astro/SlideOverDrawer.TPbGEoWn.js +0 -1
  163. package/dist/_astro/TagSelect.u8DTop7v.js +0 -1
  164. package/dist/_astro/TasksBoard.Bb--oVV8.js +0 -1
  165. package/dist/_astro/TemplatesLibrary.D1wZq94E.js +0 -1
  166. package/dist/_astro/TestStatsBoard.DlVezlXl.js +0 -1
  167. package/dist/_astro/TodosBoard.S84wqcWY.js +0 -1
  168. package/dist/_astro/UiAutoBoard.BKp9ifxg.js +0 -1
  169. package/dist/_astro/active-element-history.CeefGkFQ.js +0 -1
  170. package/dist/_astro/app-config.DUyozIL9.js +0 -1
  171. package/dist/_astro/dialog.DXHznyjD.js +0 -1
  172. package/dist/_astro/jsx-runtime.BUXbF_vF.js +0 -1
  173. package/dist/_astro/listbox.Di-t5U37.js +0 -1
  174. package/dist/_astro/menu.Bkluqxic.js +0 -1
  175. package/dist/_astro/prompts-meta.F4wwkjUA.js +0 -2
  176. package/dist/_astro/report-prompt.Cmw4XzfY.js +0 -1
  177. package/dist/_astro/update.Bl_HfSe6.js +0 -1
  178. package/dist/_astro/use-text-value.BuY0Cm1z.js +0 -1
  179. package/dist/_astro/use-tree-walker.CfTHFX43.js +0 -1
  180. package/dist/_astro/useListAnim.CpGB1cft.js +0 -1
  181. package/dist/ui-automation/index.html +0 -281
@@ -0,0 +1 @@
1
+ import{s as e,t}from"./react.Blvh0GOs.js";import{t as n}from"./react-dom.DLW9pGCF.js";import{t as r}from"./jsx-runtime.DUg_B_vD.js";var i=e(t(),1),a=e(n(),1),o=r(),s=[`日`,`一`,`二`,`三`,`四`,`五`,`六`],c=272;function l(){let e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`}function u(e){let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2])-1,i=Number(t[3]);return!Number.isFinite(n)||!Number.isFinite(r)||!Number.isFinite(i)||r<0||r>11||i<1||i>31?null:{y:n,m:r,d:i}}function d(e,t,n){return`${e}-${String(t+1).padStart(2,`0`)}-${String(n).padStart(2,`0`)}`}function f(e){let t=u(e);return t?`${t.y}/${String(t.m+1).padStart(2,`0`)}/${String(t.d).padStart(2,`0`)}`:``}function p({value:e,onChange:t,placeholder:n=`选择日期`,className:r=``,disabled:p=!1,ariaLabel:m,clearable:h=!0}){let g=(0,i.useRef)(null),_=(0,i.useRef)(null),[v,y]=(0,i.useState)(!1),[b,x]=(0,i.useState)(null),S=u(e),C=l(),[w,T]=(0,i.useState)(()=>{let e=S??u(C);return{y:e.y,m:e.m}});(0,i.useEffect)(()=>{if(!v)return;let t=u(e)??u(C);T({y:t.y,m:t.m})},[v,e,C]),(0,i.useEffect)(()=>{if(!v)return;function e(){let e=g.current;if(!e)return;let t=e.getBoundingClientRect(),n=_.current?.offsetHeight??340,r=t.bottom+6,i=t.top-n-6,a=r+n>window.innerHeight-8&&i>8?i:r,o=Math.min(Math.max(8,t.left),Math.max(8,window.innerWidth-c-8));x({top:a,left:o})}e();let t=e=>{let t=e.target;g.current?.contains(t)||_.current?.contains(t)||y(!1)},n=e=>{e.key===`Escape`&&(e.stopPropagation(),y(!1))},r=()=>y(!1);return window.addEventListener(`mousedown`,t),window.addEventListener(`keydown`,n,!0),window.addEventListener(`resize`,r),window.addEventListener(`scroll`,r,!0),()=>{window.removeEventListener(`mousedown`,t),window.removeEventListener(`keydown`,n,!0),window.removeEventListener(`resize`,r),window.removeEventListener(`scroll`,r,!0)}},[v]);let E=(0,i.useMemo)(()=>{let e=new Date(w.y,w.m,1).getDay(),t=new Date(w.y,w.m,1-e);return Array.from({length:42},(e,n)=>{let r=new Date(t.getFullYear(),t.getMonth(),t.getDate()+n);return{iso:d(r.getFullYear(),r.getMonth(),r.getDate()),day:r.getDate(),inMonth:r.getMonth()===w.m}})},[w]);function D(e){t(e),y(!1)}function O(e){T(t=>{let n=t.m+e;return n<0?{y:t.y-1,m:11}:n>11?{y:t.y+1,m:0}:{...t,m:n}})}let k=f(e);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`button`,{ref:g,type:`button`,disabled:p,"aria-label":m??n,"aria-haspopup":`dialog`,"aria-expanded":v,onClick:()=>y(e=>!e),className:`flex w-full min-w-0 items-center text-left outline-none disabled:cursor-not-allowed ${r}`,children:k?(0,o.jsx)(`span`,{className:`truncate tabular-nums`,children:k}):(0,o.jsx)(`span`,{className:`truncate text-stone-400`,children:n})}),v&&b?(0,a.createPortal)((0,o.jsxs)(`div`,{ref:_,role:`dialog`,"aria-label":`选择日期`,style:{top:b.top,left:b.left,width:c},className:`tw-date-panel tw-menu-anim fixed z-120 rounded-xl border border-stone-200 bg-white p-3 shadow-xl`,children:[(0,o.jsxs)(`div`,{className:`mb-2 flex items-center justify-between`,children:[(0,o.jsxs)(`div`,{className:`pl-1 text-sm font-semibold text-stone-800`,children:[w.y,`年`,w.m+1,`月`]}),(0,o.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[(0,o.jsx)(`button`,{type:`button`,"aria-label":`上个月`,onClick:()=>O(-1),className:`flex h-7 w-7 items-center justify-center rounded-md text-stone-500 transition-colors hover:bg-stone-100 hover:text-stone-800`,children:(0,o.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,o.jsx)(`path`,{d:`m15 6-6 6 6 6`})})}),(0,o.jsx)(`button`,{type:`button`,"aria-label":`下个月`,onClick:()=>O(1),className:`flex h-7 w-7 items-center justify-center rounded-md text-stone-500 transition-colors hover:bg-stone-100 hover:text-stone-800`,children:(0,o.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,o.jsx)(`path`,{d:`m9 6 6 6-6 6`})})})]})]}),(0,o.jsx)(`div`,{className:`grid grid-cols-7 text-center text-xs text-stone-500`,children:s.map(e=>(0,o.jsx)(`div`,{className:`py-1`,children:e},e))}),(0,o.jsx)(`div`,{className:`grid grid-cols-7 gap-y-0.5 text-center text-sm`,children:E.map(t=>{let n=t.iso===e,r=t.iso===C;return(0,o.jsx)(`button`,{type:`button`,onClick:()=>D(t.iso),"aria-label":t.iso,"aria-current":n?`date`:void 0,className:`mx-auto flex h-8 w-8 items-center justify-center rounded-md tabular-nums transition-colors ${n?`bg-[#3370ff] font-medium text-white`:t.inMonth?`text-stone-700 hover:bg-stone-100`:`text-stone-300 hover:bg-stone-50`} ${r&&!n?`ring-1 ring-stone-300 ring-inset`:``}`,children:t.day},t.iso)})}),(0,o.jsxs)(`div`,{className:`mt-2 flex items-center justify-between border-t border-stone-100 pt-2 text-sm`,children:[(0,o.jsx)(`button`,{type:`button`,onClick:()=>{t(``),y(!1)},disabled:!h,className:`rounded-md px-2 py-1 text-[#3370ff] transition-colors hover:bg-[#eef3ff] disabled:opacity-40`,children:`清除`}),(0,o.jsx)(`button`,{type:`button`,onClick:()=>D(C),className:`rounded-md px-2 py-1 text-[#3370ff] transition-colors hover:bg-[#eef3ff]`,children:`今天`})]})]}),document.body):null]})}export{f as n,p as t};
@@ -0,0 +1 @@
1
+ import{s as e,t}from"./react.Blvh0GOs.js";import{p as n}from"./app-config.BUPzGl9f.js";import{a as r,n as i,o as a,r as o}from"./view-prefs.BEAZRcxF.js";import{t as s}from"./jsx-runtime.DUg_B_vD.js";import{n as c,t as l}from"./DocsPager.DJY4foYL.js";import{t as u}from"./OverflowHint.D6v4Uj2N.js";import{t as d}from"./SelectDropdown.CuuDHa8s.js";import{t as f}from"./useListAnim.BoerpmsB.js";var p=`tw.docs.files.v1.`;function m(e){try{let t=sessionStorage.getItem(n(p+e));if(!t)return null;let r=JSON.parse(t);return Array.isArray(r)?r:null}catch{return null}}function h(e,t){try{sessionStorage.setItem(n(p+e),JSON.stringify(t))}catch{}}var g=e(t(),1);function _(e){return e==null?`—`:e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}function v(e){if(!e)return`—`;try{return new Date(e).toLocaleString(`zh-CN`,{hour12:!1,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`})}catch{return`—`}}var y=s(),b=[{value:`mtime`,label:`按修改时间`},{value:`name`,label:`按文件名`}],x=b.map(e=>e.value),S=`h-8 px-3 text-sm border border-stone-300 rounded-lg bg-white text-stone-800 focus:outline-none focus:ring-2 focus:ring-[#4176e6]/30 focus:border-[#4176e6]`,C=`transition-colors duration-150 hover:bg-stone-50 hover:shadow-[inset_3px_0_0_0_var(--tw-accent)] cursor-pointer`,w=`w-38 shrink-0`,T=`w-16 shrink-0 text-left`,E=`w-40 shrink-0 text-right`,D=`text-sm text-stone-400 py-10 text-center border border-dashed border-stone-200 rounded-lg`;function O(e,t,n){let[s,l]=(0,g.useState)(()=>n?o(`docs.${n}.search`):``),[u,d]=(0,g.useState)(()=>n?i(`docs.${n}.sort`,x,`mtime`):`mtime`),[f,p]=(0,g.useState)(1),[m,h]=c(t),_=(0,g.useMemo)(()=>{let t=s.trim().toLowerCase(),n=[...t?e.filter(e=>e.name.toLowerCase().includes(t)||e.path.toLowerCase().includes(t)):e];return u===`name`?n.sort((e,t)=>e.name.localeCompare(t.name,`zh`)):n.sort((e,t)=>(t.mtime??0)-(e.mtime??0)),n},[e,s,u]),v=Math.max(1,Math.ceil(_.length/m)),y=Math.min(f,v);return{query:s,setQuery:e=>{l(e),n&&a(`docs.${n}.search`,e),p(1)},sortBy:u,setSortBy:e=>{d(e),n&&r(`docs.${n}.sort`,e),p(1)},page:y,setPage:p,pageSize:m,setPageSize:e=>{h(e),p(1)},filtered:_,totalPages:v,pageFiles:(0,g.useMemo)(()=>_.slice((y-1)*m,y*m),[_,y,m])}}function k({files:e,filtered:t,pageFiles:n,query:r,onQuery:i,sortBy:a,onSortBy:o,page:s,totalPages:c,pageSize:p,onPage:m,onPageSize:h,busy:g=!1,emptyText:x,searchPlaceholder:O,selectAllLabel:k=`全选本页`,renderBadge:A,renderNameAction:j,renderActions:M,actionsClassName:N=E,extraColumn:P,onRowDoubleClick:F,selectable:I,selected:L,onToggleRow:R,onSelectPage:z}){let B=I??(()=>!0),V=n.filter(B),H=V.length>0&&V.every(e=>L[e.path]),U=!H&&V.some(e=>L[e.path]),{cls:W,play:G}=f(),K=e=>{G(),i(e)};return(0,y.jsxs)(y.Fragment,{children:[e.length>0?(0,y.jsxs)(`div`,{className:`shrink-0 px-4 py-2 border-b border-stone-100 bg-stone-50/60 flex items-center gap-2 flex-wrap`,children:[(0,y.jsx)(`input`,{type:`search`,value:r,onChange:e=>K(e.target.value),placeholder:O,"aria-label":O,className:`${S} flex-1 min-w-48`}),(0,y.jsx)(d,{compact:!0,options:b,value:a,onChange:e=>{G(),o(e)},ariaLabel:`排序方式`,showCheck:!1,className:`w-34 shrink-0`})]}):null,(0,y.jsx)(`div`,{className:`flex-1 min-h-0 overflow-y-auto p-4`,children:e.length===0?(0,y.jsx)(`p`,{className:D,children:x}):t.length===0?(0,y.jsxs)(`p`,{className:D,children:[`没有匹配「`,r.trim(),`」的文件。`]}):(0,y.jsxs)(`ul`,{className:`${W}divide-y divide-stone-100 border border-stone-200 rounded-lg overflow-hidden`,children:[(0,y.jsxs)(`li`,{className:`flex items-center gap-2 px-3 py-2 bg-stone-50 text-xs text-stone-500`,children:[(0,y.jsx)(`input`,{type:`checkbox`,checked:H,ref:e=>{e&&(e.indeterminate=U)},onChange:()=>z(V.map(e=>e.path),!H),disabled:g||V.length===0,className:`rounded border-stone-300`,"aria-label":k}),(0,y.jsx)(`span`,{className:`flex-1 min-w-0`,children:`文件名`}),P?(0,y.jsx)(`span`,{className:`${P.className??`w-28 shrink-0`} text-xs text-stone-500`,children:P.header}):null,(0,y.jsx)(`span`,{className:w,children:`创建时间`}),(0,y.jsx)(`span`,{className:w,children:`修改时间`}),(0,y.jsx)(`span`,{className:T,children:`大小`}),(0,y.jsx)(`span`,{className:N,children:`操作`})]}),n.map(e=>{let t=B(e);return(0,y.jsxs)(`li`,{className:`group flex items-center gap-2 px-3 py-2.5 ${C}`,onDoubleClick:F?()=>F(e):void 0,children:[(0,y.jsx)(`input`,{type:`checkbox`,checked:!!L[e.path],disabled:g||!t,onChange:()=>R(e.path),onDoubleClick:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),className:`rounded border-stone-300`,"aria-label":`选择 ${e.name}`}),(0,y.jsxs)(`div`,{className:`flex-1 min-w-0 text-left flex items-center gap-2`,children:[(0,y.jsx)(u,{text:e.name,className:`text-sm text-stone-800 truncate`}),A?A(e):null,j?(0,y.jsx)(`span`,{className:`flex shrink-0 items-center opacity-0 transition-opacity focus-within:opacity-100 group-hover:opacity-100`,onDoubleClick:e=>e.stopPropagation(),children:j(e)}):null]}),P?(0,y.jsx)(`div`,{className:`${P.className??`w-28 shrink-0`} truncate`,children:P.render(e)}):null,(0,y.jsx)(`span`,{className:`${w} text-[11px] text-stone-500 tabular-nums`,children:v(e.ctime??e.mtime)}),(0,y.jsx)(`span`,{className:`${w} text-[11px] text-stone-500 tabular-nums`,children:v(e.mtime)}),(0,y.jsx)(`span`,{className:`${T} text-[11px] text-stone-400`,children:_(e.size)}),(0,y.jsx)(`div`,{className:`${N} flex flex-nowrap items-center justify-end gap-1`,onDoubleClick:e=>e.stopPropagation(),children:M(e)})]},e.path)})]})}),e.length>0?(0,y.jsx)(l,{page:s,totalPages:c,pageSize:p,busy:g,onPage:e=>{G(),m(e)},onPageSize:e=>{G(),h(e)}}):null]})}export{h as i,O as n,m as r,k as t};
@@ -0,0 +1 @@
1
+ import{s as e,t}from"./react.Blvh0GOs.js";import{p as n}from"./app-config.BUPzGl9f.js";import{t as r}from"./jsx-runtime.DUg_B_vD.js";import{t as i}from"./SelectDropdown.CuuDHa8s.js";var a=e(t(),1),o=[5,10,20,50],s=`tw.docs.page-size.v1`;function c(e){return typeof e==`number`&&o.includes(e)}function l(e,t=s){try{let r=localStorage.getItem(n(t)),i=r===null?NaN:Number(r);return c(i)?i:e}catch{return e}}function u(e,t=s){if(c(e))try{localStorage.setItem(n(t),String(e))}catch{}}var d=r(),f=`h-8 px-3 shrink-0 whitespace-nowrap text-sm text-stone-600 border border-stone-200 rounded-lg hover:bg-stone-50 disabled:opacity-40 disabled:cursor-not-allowed cursor-pointer`,p=o.map(e=>({value:String(e),label:String(e)}));function m(e,t){let[n,r]=(0,a.useState)(()=>l(e,t));return[n,(0,a.useCallback)(e=>{c(e)&&(u(e,t),r(e))},[t])]}function h({page:e,totalPages:t,pageSize:n,busy:r=!1,onPage:a,onPageSize:o}){return(0,d.jsxs)(`div`,{className:`shrink-0 px-4 py-3 border-t border-stone-100 flex items-center justify-between gap-2 flex-wrap`,children:[(0,d.jsxs)(`span`,{className:`text-xs text-stone-500 flex items-center gap-1.5`,children:[(0,d.jsxs)(`span`,{children:[`第 `,e,` / `,t,` 页 ·`]}),(0,d.jsx)(i,{compact:!0,centerContent:!0,options:p,value:String(n),onChange:e=>o(Number(e)),disabled:r,ariaLabel:`每页条数`,showCheck:!1,className:`w-18`}),(0,d.jsx)(`span`,{children:`条`})]}),(0,d.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,d.jsx)(`button`,{type:`button`,disabled:r||e<=1,onClick:()=>a(1),className:f,children:`首页`}),(0,d.jsx)(`button`,{type:`button`,disabled:r||e<=1,onClick:()=>a(e-1),className:f,children:`上一页`}),(0,d.jsx)(`button`,{type:`button`,disabled:r||e>=t,onClick:()=>a(e+1),className:f,children:`下一页`}),(0,d.jsx)(`button`,{type:`button`,disabled:r||e>=t,onClick:()=>a(t),className:f,children:`末页`})]})]})}export{m as n,h as t};
@@ -1 +1 @@
1
- import{t as e}from"./jsx-runtime.BUXbF_vF.js";import{t}from"./SelectDropdown.Buv7rQJ_.js";var n=e(),r=`h-9 w-full rounded-md border border-transparent bg-transparent px-2 text-sm text-stone-800 outline-none transition-colors hover:border-stone-200 focus:border-[#3370ff] focus:bg-white placeholder:text-stone-400`;function i(e){return(0,n.jsxs)(`div`,{className:`flex items-start gap-3 px-6 py-2`,children:[(0,n.jsxs)(`div`,{className:`flex w-[132px] shrink-0 items-center gap-2 pt-1.5 text-sm text-stone-600`,children:[(0,n.jsx)(`span`,{className:`flex h-4 w-4 items-center justify-center text-stone-400`,children:e.icon}),(0,n.jsx)(`span`,{className:`truncate`,children:e.label})]}),(0,n.jsx)(`div`,{className:`min-w-0 flex-1`,children:e.children})]})}function a(e){return(0,n.jsx)(t,{flat:!0,menuMatchTrigger:!0,ariaLabel:e.ariaLabel,options:e.options,value:e.value,onChange:e.onChange,disabled:e.disabled,className:`w-full`,renderTrigger:()=>(0,n.jsx)(`span`,{className:`truncate`,children:e.label}),renderOptionPrefix:e.optionDotClassName?t=>(0,n.jsx)(`span`,{className:`h-2 w-2 rounded-full ${e.optionDotClassName?.(t.value)??``}`}):void 0})}function o(){return(0,n.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.7`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,n.jsx)(`path`,{d:`M5 19 11 5l6 14`}),(0,n.jsx)(`path`,{d:`M7.5 14h7`}),(0,n.jsx)(`path`,{d:`M18 9v10`})]})}function s(){return(0,n.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.7`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,n.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,n.jsx)(`path`,{d:`m8.5 12.5 2.5 2.5 4.5-5`})]})}function c(){return(0,n.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.7`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,n.jsx)(`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`}),(0,n.jsx)(`path`,{d:`M9 4v16`})]})}function l(){return(0,n.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.7`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,n.jsx)(`rect`,{x:`4`,y:`5`,width:`16`,height:`15`,rx:`2`}),(0,n.jsx)(`path`,{d:`M4 10h16M9 3v4M15 3v4`})]})}function u(){return(0,n.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.7`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,n.jsx)(`path`,{d:`M7 4h10l-5 7 5 9H7l5-9Z`})})}function d(e){return(0,n.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`12`,height:`12`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.4`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,className:`transition-transform ${e.open?``:`-rotate-90`}`,children:(0,n.jsx)(`path`,{d:`m6 9 6 6 6-6`})})}export{l as a,c,d as i,o as l,i as n,u as o,a as r,s,r as t};
1
+ import{t as e}from"./jsx-runtime.DUg_B_vD.js";import{t}from"./SelectDropdown.CuuDHa8s.js";var n=e(),r=`h-9 w-full rounded-md border border-transparent bg-transparent px-2 text-sm text-stone-800 outline-none transition-colors hover:border-stone-200 focus:border-[#3370ff] focus:bg-white placeholder:text-stone-400`;function i(e){return(0,n.jsxs)(`div`,{className:`flex items-start gap-3 px-6 py-2`,children:[(0,n.jsxs)(`div`,{className:`flex w-[132px] shrink-0 items-center gap-2 pt-1.5 text-sm text-stone-600`,children:[(0,n.jsx)(`span`,{className:`flex h-4 w-4 items-center justify-center text-stone-400`,children:e.icon}),(0,n.jsx)(`span`,{className:`truncate`,children:e.label})]}),(0,n.jsx)(`div`,{className:`min-w-0 flex-1`,children:e.children})]})}function a(e){return(0,n.jsx)(t,{flat:!0,menuMatchTrigger:!0,ariaLabel:e.ariaLabel,options:e.options,value:e.value,onChange:e.onChange,disabled:e.disabled,className:`w-full`,renderTrigger:()=>(0,n.jsx)(`span`,{className:`truncate`,children:e.label}),renderOptionPrefix:e.optionDotClassName?t=>(0,n.jsx)(`span`,{className:`h-2 w-2 rounded-full ${e.optionDotClassName?.(t.value)??``}`}):void 0})}function o(){return(0,n.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.7`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,n.jsx)(`path`,{d:`M5 19 11 5l6 14`}),(0,n.jsx)(`path`,{d:`M7.5 14h7`}),(0,n.jsx)(`path`,{d:`M18 9v10`})]})}function s(){return(0,n.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.7`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,n.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,n.jsx)(`path`,{d:`m8.5 12.5 2.5 2.5 4.5-5`})]})}function c(){return(0,n.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.7`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,n.jsx)(`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`}),(0,n.jsx)(`path`,{d:`M9 4v16`})]})}function l(){return(0,n.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.7`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,n.jsx)(`rect`,{x:`4`,y:`5`,width:`16`,height:`15`,rx:`2`}),(0,n.jsx)(`path`,{d:`M4 10h16M9 3v4M15 3v4`})]})}function u(){return(0,n.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.7`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,n.jsx)(`path`,{d:`M7 4h10l-5 7 5 9H7l5-9Z`})})}function d(e){return(0,n.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`12`,height:`12`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.4`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,className:`transition-transform ${e.open?``:`-rotate-90`}`,children:(0,n.jsx)(`path`,{d:`m6 9 6 6 6-6`})})}export{l as a,c,d as i,o as l,i as n,u as o,a as r,s,r as t};