@jimka/typescript-ui 0.1.0 → 0.2.0

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 (216) hide show
  1. package/README.md +5 -18
  2. package/dist/lib/{AbstractBooleanInput-C3rj7sje.js → AbstractBooleanInput-BGesvIZy.js} +2 -2
  3. package/dist/lib/{AbstractBooleanInput-C3rj7sje.js.map → AbstractBooleanInput-BGesvIZy.js.map} +1 -1
  4. package/dist/lib/{AbstractInput-DD-NpicS.js → AbstractInput-BxOtFrER.js} +2 -2
  5. package/dist/lib/{AbstractInput-DD-NpicS.js.map → AbstractInput-BxOtFrER.js.map} +1 -1
  6. package/dist/lib/AnimatedDropdown-CZQEqQi-.js +2 -0
  7. package/dist/lib/AnimatedDropdown-CZQEqQi-.js.map +1 -0
  8. package/dist/lib/Border-BgaZkc1R.js +2 -0
  9. package/dist/lib/Border-BgaZkc1R.js.map +1 -0
  10. package/dist/lib/{BoxLayout-DgZukB5_.js → BoxLayout-DrKGfsup.js} +2 -2
  11. package/dist/lib/{BoxLayout-DgZukB5_.js.map → BoxLayout-DrKGfsup.js.map} +1 -1
  12. package/dist/lib/Button-U1rsP4v8.js +2 -0
  13. package/dist/lib/Button-U1rsP4v8.js.map +1 -0
  14. package/dist/lib/{Card-UF0fq8cQ.js → Card-BVwOS8AG.js} +2 -2
  15. package/dist/lib/{Card-UF0fq8cQ.js.map → Card-BVwOS8AG.js.map} +1 -1
  16. package/dist/lib/ComboBox-B9EDPu6T.js +2 -0
  17. package/dist/lib/ComboBox-B9EDPu6T.js.map +1 -0
  18. package/dist/lib/Component-DXf5a3g0.js +2 -0
  19. package/dist/lib/Component-DXf5a3g0.js.map +1 -0
  20. package/dist/lib/Container-D5H8VxJK.js +2 -0
  21. package/dist/lib/{Container-3KsvsJ6S.js.map → Container-D5H8VxJK.js.map} +1 -1
  22. package/dist/lib/DOM-CGn7xyTw.js +2 -0
  23. package/dist/lib/DOM-CGn7xyTw.js.map +1 -0
  24. package/dist/lib/DragManager-CI4mZQFy.js +2 -0
  25. package/dist/lib/{DragManager-tPMnbjeO.js.map → DragManager-CI4mZQFy.js.map} +1 -1
  26. package/dist/lib/FieldDecorator-CJs9gwqH.js +2 -0
  27. package/dist/lib/{FieldDecorator-E7WzutjO.js.map → FieldDecorator-CJs9gwqH.js.map} +1 -1
  28. package/dist/lib/{Fit-CFIr4P9R.js → Fit-DjRsiwlg.js} +2 -2
  29. package/dist/lib/{Fit-CFIr4P9R.js.map → Fit-DjRsiwlg.js.map} +1 -1
  30. package/dist/lib/Glyph-KEf4nIv2.js +2 -0
  31. package/dist/lib/Glyph-KEf4nIv2.js.map +1 -0
  32. package/dist/lib/{Grid-Czux--Mr.js → Grid-DdL9TVeJ.js} +2 -2
  33. package/dist/lib/{Grid-Czux--Mr.js.map → Grid-DdL9TVeJ.js.map} +1 -1
  34. package/dist/lib/GridConstraints-DkLueyrf.js +2 -0
  35. package/dist/lib/GridConstraints-DkLueyrf.js.map +1 -0
  36. package/dist/lib/{HBox-Q8y1PHlk.js → HBox-Ce0GTCJP.js} +2 -2
  37. package/dist/lib/{HBox-Q8y1PHlk.js.map → HBox-Ce0GTCJP.js.map} +1 -1
  38. package/dist/lib/{Header-zPdvC2AX.js → Header-BQIVpBte.js} +2 -2
  39. package/dist/lib/{Header-zPdvC2AX.js.map → Header-BQIVpBte.js.map} +1 -1
  40. package/dist/lib/{IconText-BvGfu7eq.js → IconText-Bo4Qcnot.js} +2 -2
  41. package/dist/lib/{IconText-BvGfu7eq.js.map → IconText-Bo4Qcnot.js.map} +1 -1
  42. package/dist/lib/LayoutConstraints-DkctJZXB.js +2 -0
  43. package/dist/lib/LayoutConstraints-DkctJZXB.js.map +1 -0
  44. package/dist/lib/LayoutSerialization-BT66TY83.js +2 -0
  45. package/dist/lib/LayoutSerialization-BT66TY83.js.map +1 -0
  46. package/dist/lib/LayoutSizes-DU3qSq0w.js +2 -0
  47. package/dist/lib/LayoutSizes-DU3qSq0w.js.map +1 -0
  48. package/dist/lib/List-DtTVTyWW.js +2 -0
  49. package/dist/lib/List-DtTVTyWW.js.map +1 -0
  50. package/dist/lib/Menu-Dz4L7EKJ.js +2 -0
  51. package/dist/lib/Menu-Dz4L7EKJ.js.map +1 -0
  52. package/dist/lib/MenuButton-VJ5uC3c1.js +2 -0
  53. package/dist/lib/{MenuButton-JQQaKThJ.js.map → MenuButton-VJ5uC3c1.js.map} +1 -1
  54. package/dist/lib/Panel-DzWdYwq1.js +2 -0
  55. package/dist/lib/Panel-DzWdYwq1.js.map +1 -0
  56. package/dist/lib/Position-A39T7-_1.js +2 -0
  57. package/dist/lib/Position-A39T7-_1.js.map +1 -0
  58. package/dist/lib/ProgressSpinner-zJKtGyNJ.js +2 -0
  59. package/dist/lib/ProgressSpinner-zJKtGyNJ.js.map +1 -0
  60. package/dist/lib/RadioButton-CYSSv4nV.js +2 -0
  61. package/dist/lib/RadioButton-CYSSv4nV.js.map +1 -0
  62. package/dist/lib/{RovingTabIndex-CFIzIjjU.js → RovingTabIndex-BSZ31Vp5.js} +2 -2
  63. package/dist/lib/{RovingTabIndex-CFIzIjjU.js.map → RovingTabIndex-BSZ31Vp5.js.map} +1 -1
  64. package/dist/lib/Scrollbar-BhtOjqkG.js +2 -0
  65. package/dist/lib/Scrollbar-BhtOjqkG.js.map +1 -0
  66. package/dist/lib/Slider-CdXm7E64.js +2 -0
  67. package/dist/lib/Slider-CdXm7E64.js.map +1 -0
  68. package/dist/lib/{Spacer-BVQncB5B.js → Spacer-D9NGW4QG.js} +2 -2
  69. package/dist/lib/{Spacer-BVQncB5B.js.map → Spacer-D9NGW4QG.js.map} +1 -1
  70. package/dist/lib/TabButton-CThevdY_.js +2 -0
  71. package/dist/lib/{TabButton-pZKFYg7b.js.map → TabButton-CThevdY_.js.map} +1 -1
  72. package/dist/lib/Text-gz6qjFfP.js +2 -0
  73. package/dist/lib/Text-gz6qjFfP.js.map +1 -0
  74. package/dist/lib/Tooltip-tkXDk5Bo.js +3 -0
  75. package/dist/lib/Tooltip-tkXDk5Bo.js.map +1 -0
  76. package/dist/lib/{VBox-D5B9ecw0.js → VBox-EIqw85Rh.js} +2 -2
  77. package/dist/lib/{VBox-D5B9ecw0.js.map → VBox-EIqw85Rh.js.map} +1 -1
  78. package/dist/lib/VirtualRowView-BxpHQ_u8.js +2 -0
  79. package/dist/lib/{VirtualRowView-Con9SWiU.js.map → VirtualRowView-BxpHQ_u8.js.map} +1 -1
  80. package/dist/lib/VirtualScroller-DwEEJE1_.js +2 -0
  81. package/dist/lib/{VirtualScroller-BPDmO1ir.js.map → VirtualScroller-DwEEJE1_.js.map} +1 -1
  82. package/dist/lib/component/button.es.js +1 -1
  83. package/dist/lib/component/button.es.js.map +1 -1
  84. package/dist/lib/component/chart.es.js +1 -1
  85. package/dist/lib/component/chart.es.js.map +1 -1
  86. package/dist/lib/component/container.es.js +1 -1
  87. package/dist/lib/component/container.es.js.map +1 -1
  88. package/dist/lib/component/diagram.es.js +1 -1
  89. package/dist/lib/component/diagram.es.js.map +1 -1
  90. package/dist/lib/component/display.es.js +1 -1
  91. package/dist/lib/component/display.es.js.map +1 -1
  92. package/dist/lib/component/editor.es.js +3 -1
  93. package/dist/lib/component/editor.es.js.map +1 -1
  94. package/dist/lib/component/input.es.js +1 -1
  95. package/dist/lib/component/input.es.js.map +1 -1
  96. package/dist/lib/component/list.es.js +1 -1
  97. package/dist/lib/component/list.es.js.map +1 -1
  98. package/dist/lib/component/menubar.es.js +1 -1
  99. package/dist/lib/component/menubar.es.js.map +1 -1
  100. package/dist/lib/component/table.es.js +2 -2
  101. package/dist/lib/component/table.es.js.map +1 -1
  102. package/dist/lib/component/tree.es.js +1 -1
  103. package/dist/lib/component/tree.es.js.map +1 -1
  104. package/dist/lib/core.es.js +1 -1
  105. package/dist/lib/core.es.js.map +1 -1
  106. package/dist/lib/layout.es.js +1 -1
  107. package/dist/lib/overlay.es.js +1 -1
  108. package/dist/lib/overlay.es.js.map +1 -1
  109. package/dist/lib/primitive.es.js +1 -1
  110. package/dist/lib/router.es.js +2 -0
  111. package/dist/lib/router.es.js.map +1 -0
  112. package/dist/lib/types/component/button/Button.d.ts +4 -3
  113. package/dist/lib/types/component/chart/AbstractChart.d.ts +1 -1
  114. package/dist/lib/types/component/chart/ChartLegend.d.ts +1 -1
  115. package/dist/lib/types/component/container/DialogBackdrop.d.ts +2 -1
  116. package/dist/lib/types/component/container/MenuItem.d.ts +1 -1
  117. package/dist/lib/types/component/container/ScrollStrip.d.ts +1 -0
  118. package/dist/lib/types/component/container/SplitGutter.d.ts +3 -2
  119. package/dist/lib/types/component/container/TabBar.d.ts +1 -2
  120. package/dist/lib/types/component/container/TabPanel.d.ts +6 -3
  121. package/dist/lib/types/component/container/WindowBorder.d.ts +2 -1
  122. package/dist/lib/types/component/container/WindowHeader.d.ts +2 -1
  123. package/dist/lib/types/component/display/Glyph.d.ts +2 -1
  124. package/dist/lib/types/component/display/Markdown.d.ts +11 -1
  125. package/dist/lib/types/component/display/PaginationBar.d.ts +1 -1
  126. package/dist/lib/types/component/display/SpinnerWrap.d.ts +2 -0
  127. package/dist/lib/types/component/display/Video.d.ts +1 -1
  128. package/dist/lib/types/component/display/VideoPlayer.d.ts +1 -1
  129. package/dist/lib/types/component/display/index.d.ts +1 -1
  130. package/dist/lib/types/component/editor/CodeEditor.d.ts +2 -1
  131. package/dist/lib/types/component/editor/MarkdownEditor.d.ts +7 -1
  132. package/dist/lib/types/component/editor/markdownTableTransformer.d.ts +2 -0
  133. package/dist/lib/types/component/input/Checkbox.d.ts +2 -1
  134. package/dist/lib/types/component/input/Link.d.ts +1 -1
  135. package/dist/lib/types/component/input/RadioButton.d.ts +2 -1
  136. package/dist/lib/types/component/input/Slider.d.ts +2 -1
  137. package/dist/lib/types/component/input/Text.d.ts +1 -3
  138. package/dist/lib/types/component/input/TextInput.d.ts +3 -2
  139. package/dist/lib/types/component/list/AbstractSelectableList.d.ts +2 -1
  140. package/dist/lib/types/component/menubar/MenuBarButton.d.ts +1 -1
  141. package/dist/lib/types/core/AnimatedDropdown.d.ts +6 -2
  142. package/dist/lib/types/core/Animation.d.ts +9 -6
  143. package/dist/lib/types/core/Component.d.ts +16 -11
  144. package/dist/lib/types/core/DOM.d.ts +14 -0
  145. package/dist/lib/types/core/Event.d.ts +12 -6
  146. package/dist/lib/types/core/index.d.ts +2 -2
  147. package/dist/lib/types/layout/Accordion.d.ts +2 -0
  148. package/dist/lib/types/layout/Border.d.ts +1 -0
  149. package/dist/lib/types/layout/CollapseSupport.d.ts +5 -1
  150. package/dist/lib/types/layout/LayoutConstraints.d.ts +1 -0
  151. package/dist/lib/types/layout/LayoutManager.d.ts +2 -0
  152. package/dist/lib/types/layout/Split.d.ts +1 -0
  153. package/dist/lib/types/layout/Tab.d.ts +10 -3
  154. package/dist/lib/types/overlay/AbstractWindow.d.ts +9 -2
  155. package/dist/lib/types/overlay/Dialog.d.ts +6 -0
  156. package/dist/lib/types/overlay/Dock.d.ts +12 -2
  157. package/dist/lib/types/overlay/Drawer.d.ts +5 -0
  158. package/dist/lib/types/overlay/Menu.d.ts +3 -1
  159. package/dist/lib/types/overlay/Notification.d.ts +3 -0
  160. package/dist/lib/types/overlay/Popover.d.ts +3 -1
  161. package/dist/lib/types/overlay/Rail.d.ts +7 -0
  162. package/dist/lib/types/overlay/Tooltip.d.ts +3 -0
  163. package/dist/lib/types/overlay/index.d.ts +1 -1
  164. package/dist/lib/types/router/RoutePattern.d.ts +18 -0
  165. package/dist/lib/types/router/Router.d.ts +36 -0
  166. package/dist/lib/types/router/index.d.ts +2 -0
  167. package/dist/lib/validation.es.js +1 -1
  168. package/llms.txt +9 -5
  169. package/package.json +6 -1
  170. package/dist/lib/AnimatedDropdown-BbGCs70E.js +0 -2
  171. package/dist/lib/AnimatedDropdown-BbGCs70E.js.map +0 -1
  172. package/dist/lib/Border-oZC_SDy8.js +0 -2
  173. package/dist/lib/Border-oZC_SDy8.js.map +0 -1
  174. package/dist/lib/Button-DEUtBqK4.js +0 -2
  175. package/dist/lib/Button-DEUtBqK4.js.map +0 -1
  176. package/dist/lib/ComboBox-GOBOAJ1N.js +0 -2
  177. package/dist/lib/ComboBox-GOBOAJ1N.js.map +0 -1
  178. package/dist/lib/Component-BR2f0Itb.js +0 -2
  179. package/dist/lib/Component-BR2f0Itb.js.map +0 -1
  180. package/dist/lib/Container-3KsvsJ6S.js +0 -2
  181. package/dist/lib/DragManager-tPMnbjeO.js +0 -2
  182. package/dist/lib/FieldDecorator-E7WzutjO.js +0 -2
  183. package/dist/lib/Glyph-WUqTF_Z9.js +0 -2
  184. package/dist/lib/Glyph-WUqTF_Z9.js.map +0 -1
  185. package/dist/lib/GridConstraints-Q3wvuovN.js +0 -2
  186. package/dist/lib/GridConstraints-Q3wvuovN.js.map +0 -1
  187. package/dist/lib/LayoutConstraints-CHI2lhPd.js +0 -2
  188. package/dist/lib/LayoutConstraints-CHI2lhPd.js.map +0 -1
  189. package/dist/lib/LayoutSerialization-CWU0iEuV.js +0 -2
  190. package/dist/lib/LayoutSerialization-CWU0iEuV.js.map +0 -1
  191. package/dist/lib/LayoutSizes-BW4wyGDI.js +0 -2
  192. package/dist/lib/LayoutSizes-BW4wyGDI.js.map +0 -1
  193. package/dist/lib/List-D-GhoVgB.js +0 -2
  194. package/dist/lib/List-D-GhoVgB.js.map +0 -1
  195. package/dist/lib/Menu-Wz4MK6sA.js +0 -2
  196. package/dist/lib/Menu-Wz4MK6sA.js.map +0 -1
  197. package/dist/lib/MenuButton-JQQaKThJ.js +0 -2
  198. package/dist/lib/Panel-DIsdaqc2.js +0 -2
  199. package/dist/lib/Panel-DIsdaqc2.js.map +0 -1
  200. package/dist/lib/Position-B-WfZYAJ.js +0 -2
  201. package/dist/lib/Position-B-WfZYAJ.js.map +0 -1
  202. package/dist/lib/ProgressSpinner-Dzaka7_c.js +0 -2
  203. package/dist/lib/ProgressSpinner-Dzaka7_c.js.map +0 -1
  204. package/dist/lib/RadioButton-eI3-vXn3.js +0 -2
  205. package/dist/lib/RadioButton-eI3-vXn3.js.map +0 -1
  206. package/dist/lib/Scrollbar-DchfiFKC.js +0 -2
  207. package/dist/lib/Scrollbar-DchfiFKC.js.map +0 -1
  208. package/dist/lib/Slider-xRxNSjFN.js +0 -2
  209. package/dist/lib/Slider-xRxNSjFN.js.map +0 -1
  210. package/dist/lib/TabButton-pZKFYg7b.js +0 -2
  211. package/dist/lib/Text-D1RrBY52.js +0 -2
  212. package/dist/lib/Text-D1RrBY52.js.map +0 -1
  213. package/dist/lib/Tooltip-4lU_tf6r.js +0 -3
  214. package/dist/lib/Tooltip-4lU_tf6r.js.map +0 -1
  215. package/dist/lib/VirtualRowView-Con9SWiU.js +0 -2
  216. package/dist/lib/VirtualScroller-BPDmO1ir.js +0 -2
@@ -1,2 +1,2 @@
1
- import{a as e,c as t,i as n,n as r,o as i,r as a,s as o,t as s}from"./Position-B-WfZYAJ.js";import{t as c}from"./Placement-7kqdaK4Z.js";var Point=class extends t{_x;_y;constructor(e,t){super(),this._x=e??0,this._y=t??0}getX(){return this._x??0}getY(){return this._y??0}render(){return this.getX()+` `+this.getY()}};export{r as Insets,c as Placement,Point,s as Position,e as UNBOUNDED,a as borderSideWidth,n as borderToStyle,i as isUnbounded,o as saturate};
1
+ import{a as e,c as t,i as n,n as r,o as i,r as a,s as o,t as s}from"./Position-A39T7-_1.js";import{t as c}from"./Placement-7kqdaK4Z.js";var Point=class extends t{_x;_y;constructor(e,t){super(),this._x=e??0,this._y=t??0}getX(){return this._x??0}getY(){return this._y??0}render(){return this.getX()+` `+this.getY()}};export{r as Insets,c as Placement,Point,s as Position,e as UNBOUNDED,a as borderSideWidth,n as borderToStyle,i as isUnbounded,o as saturate};
2
2
  //# sourceMappingURL=primitive.es.js.map
@@ -0,0 +1,2 @@
1
+ import{t as e}from"./DOM-CGn7xyTw.js";import{t}from"./ListenerBag-WPdKuuds.js";function normalizePath(e){let t=e.startsWith(`#`)?e.slice(1):e,n=t.indexOf(`?`);return n>=0&&(t=t.slice(0,n)),`/`+splitPath(t).join(`/`)}function splitPath(e){return e.split(`/`).filter(e=>e.length>0)}function compilePattern(e){let t=normalizePath(e),n=splitPath(t),r=n.map((t,r)=>{if(t===`*`){if(r!==n.length-1)throw Error(`RoutePattern: "*" is only valid as the final segment of "${e}"`);return{kind:`catchAll`,value:``}}return t.startsWith(`:`)?{kind:`param`,value:t.slice(1)}:{kind:`static`,value:t}});return{pattern:t,key:r.map(e=>e.kind===`static`?e.value:e.kind===`param`?`:`:`*`).join(`/`),segments:r}}function matchPattern(e,t){let n=e.segments,r=n.length>0&&n.at(-1).kind===`catchAll`,i=r?n.length-1:n.length;if(r?t.length<i:t.length!==i)return null;let a={};for(let e=0;e<i;e+=1){let r=n[e],i=t[e];if(r.kind===`static`){if(r.value!==i)return null}else r.kind===`param`&&(a[r.value]=decodeSegment(i))}return a}function decodeSegment(e){try{return decodeURIComponent(e)}catch{return e}}var n={static:2,param:1,catchAll:0};function rankAt(e,t){return t>=e.length?3:n[e[t].kind]}function selectPattern(e,t){let n=splitPath(t),r=null,i=null;for(let t of e){let e=matchPattern(t,n);e!==null&&(r===null||isMoreSpecific(t.segments,r.segments))&&(r=t,i=e)}return r===null?null:{compiled:r,params:i}}function isMoreSpecific(e,t){let n=Math.max(e.length,t.length);for(let r=0;r<n;r+=1){let n=rankAt(e,r),i=rankAt(t,r);if(n!==i)return n>i}return!1}var Router=class{_routes=new Map;_listeners=new t;_started=!1;_onHashChange=()=>this.handleHashChange();constructor(e){this.applyOptions(e??{})}register(e,t){let n=compilePattern(e),r=this._routes.get(n.key);return r!==void 0&&r.pattern!==n.pattern&&console.warn(`Router: "${r.pattern}" and "${n.pattern}" have the same specificity; "${n.pattern}" replaces it.`),this._routes.set(n.key,{...n,handler:t}),this}start(){return this._started?(console.warn(`Router: start() called on an already-started router; ignoring.`),this):(this._started=!0,this.applyCurrentRoute(),e.sink.addListener(e.source.getWindow(),`hashchange`,this._onHashChange),this)}stop(){return this._started?(e.sink.removeListener(e.source.getWindow(),`hashchange`,this._onHashChange),this._started=!1,this):this}navigate(t,n){let r=`#/`+splitPath(normalizePath(t)).map(e=>encodeURIComponent(e)).join(`/`);return n?.replace===!0?e.sink.replaceLocationHash(r):e.sink.setLocationHash(r),this}getPath(){return normalizePath(e.source.getLocationHash())}on(e,t){return this._listeners.add(e,t),this}off(e,t){return this._listeners.remove(e,t),this}emit(e,t){this._listeners.fire(e,t)}applyCurrentRoute(){let e=this.getPath(),t=selectPattern(Array.from(this._routes.values()),e);if(t===null){this.emit(`nomatch`,e);return}let n={pattern:t.compiled.pattern,params:t.params,path:e};t.compiled.handler(t.params,e),this.emit(`navigate`,n)}applyOptions(e){if(e.routes!==void 0)for(let t of Object.keys(e.routes))this.register(t,e.routes[t]);if(e.listeners!==void 0)for(let t of Object.keys(e.listeners)){let n=e.listeners[t];n!==void 0&&this._listeners.add(t,n)}}handleHashChange(){this.applyCurrentRoute()}};export{Router};
2
+ //# sourceMappingURL=router.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"router.es.js","names":[],"sources":["../../src/typescript/lib/router/RoutePattern.ts","../../src/typescript/lib/router/Router.ts"],"sourcesContent":["// SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0\n\n// Pure route-pattern mechanics behind Router: normalizing a hash/path,\n// compiling a registered pattern into segments + an ambiguity key, matching a\n// path against a compiled pattern, and picking the most specific match. No\n// DOM seam involved — internal to router/, not exported from the barrel.\n\n/** The kind of a single pattern segment. */\nexport type SegmentKind = \"static\" | \"param\" | \"catchAll\";\n\n/** One segment of a compiled pattern. */\nexport interface RouteSegment {\n kind: SegmentKind;\n /** Literal text for \"static\", the parameter name for \"param\", \"\" for \"catchAll\". */\n value: string;\n}\n\n/** A pattern parsed into segments, plus its ambiguity key. */\nexport interface CompiledPattern {\n /** The pattern string as registered, after normalization (e.g. \"/data/:id\"). */\n pattern: string;\n /** Ambiguity key: static segments by literal, \"param\" as \":\", \"catchAll\" as \"*\". */\n key: string;\n segments: RouteSegment[];\n}\n\n/**\n * Normalizes a hash or path to a leading-slash, no-trailing-slash path: strips\n * a leading `\"#\"`, discards everything from the first `\"?\"` onward, and\n * collapses empty segments (so a doubled `\"//\"` and a trailing `\"/\"` both\n * disappear). `\"\"`, `\"#\"`, and `\"#/\"` all normalize to `\"/\"`.\n *\n * @param input - The raw hash (with or without its leading `\"#\"`) or path.\n * @returns The normalized path.\n */\nexport function normalizePath(input: string): string {\n let path = input.startsWith(\"#\") ? input.slice(1) : input;\n const queryIndex = path.indexOf(\"?\");\n\n if (queryIndex >= 0) {\n path = path.slice(0, queryIndex);\n }\n\n return \"/\" + splitPath(path).join(\"/\");\n}\n\n/**\n * Splits a normalized path into its non-empty segments.\n *\n * @param path - The path to split.\n * @returns The segments, in order.\n */\nexport function splitPath(path: string): string[] {\n return path.split(\"/\").filter((segment) => segment.length > 0);\n}\n\n/**\n * Parses a registered pattern into {@link RouteSegment}s and derives its\n * ambiguity key.\n *\n * @param pattern - The pattern string, e.g. `\"/data/rows/:sel\"`.\n * @returns The compiled pattern.\n * @throws If `\"*\"` appears anywhere but the final segment.\n */\nexport function compilePattern(pattern: string): CompiledPattern {\n const normalized = normalizePath(pattern);\n const rawSegments = splitPath(normalized);\n\n const segments: RouteSegment[] = rawSegments.map((raw, i) => {\n if (raw === \"*\") {\n if (i !== rawSegments.length - 1) {\n throw new Error(`RoutePattern: \"*\" is only valid as the final segment of \"${pattern}\"`);\n }\n\n return { kind: \"catchAll\", value: \"\" };\n }\n\n if (raw.startsWith(\":\")) {\n return { kind: \"param\", value: raw.slice(1) };\n }\n\n return { kind: \"static\", value: raw };\n });\n\n const key = segments\n .map((segment) => segment.kind === \"static\" ? segment.value : segment.kind === \"param\" ? \":\" : \"*\")\n .join(\"/\");\n\n return { pattern: normalized, key, segments };\n}\n\n/**\n * Returns the extracted params when `segments` match `compiled`, or `null`\n * when they don't. A trailing `catchAll` segment matches zero or more\n * remaining segments; every other kind requires an exact segment count.\n * Captured `:param` values run through `decodeURIComponent`, falling back to\n * the raw segment text on a malformed escape.\n *\n * @param compiled - The compiled pattern to match against.\n * @param segments - The candidate path's segments (from {@link splitPath}).\n * @returns The extracted params, or `null` when there is no match.\n */\nexport function matchPattern(compiled: CompiledPattern, segments: string[]): Record<string, string> | null {\n const patternSegments = compiled.segments;\n const isCatchAll = patternSegments.length > 0 && patternSegments.at(-1)!.kind === \"catchAll\";\n const staticLength = isCatchAll ? patternSegments.length - 1 : patternSegments.length;\n\n if (isCatchAll ? segments.length < staticLength : segments.length !== staticLength) {\n return null;\n }\n\n const params: Record<string, string> = {};\n\n for (let i = 0; i < staticLength; i += 1) {\n const patternSegment = patternSegments[i];\n const value = segments[i];\n\n if (patternSegment.kind === \"static\") {\n if (patternSegment.value !== value) {\n return null;\n }\n } else if (patternSegment.kind === \"param\") {\n params[patternSegment.value] = decodeSegment(value);\n }\n }\n\n return params;\n}\n\n/**\n * Decodes a captured path segment, falling back to the raw text when it\n * carries a malformed percent-escape.\n *\n * @param value - The raw segment text.\n * @returns The decoded value, or `value` unchanged on a decode failure.\n */\nfunction decodeSegment(value: string): string {\n try {\n return decodeURIComponent(value);\n } catch {\n return value;\n }\n}\n\n/** Rank of each real segment kind: higher wins a specificity tie-break. */\nconst KIND_RANK: Record<SegmentKind, number> = { static: 2, param: 1, catchAll: 0 };\n\n/**\n * Rank of position `i` in `segments`. Reaching the end of the pattern (`i` at\n * or past its length) outranks every real segment kind — see\n * {@link selectPattern}.\n *\n * @param segments - The pattern's segments.\n * @param i - The position to rank.\n * @returns The rank at that position.\n */\nfunction rankAt(segments: readonly RouteSegment[], i: number): number {\n return i >= segments.length ? 3 : KIND_RANK[segments[i].kind];\n}\n\n/**\n * Returns the highest-ranked pattern in `compiled` that matches `path`, or\n * `null` when none match. Patterns are compared segment by segment from the\n * left via {@link rankAt}; the first position where two matching patterns\n * differ decides the winner. Two patterns can never tie on every position —\n * that would mean identical ambiguity keys, which the route table (see\n * `Router`) forbids. Registration order never affects the result.\n *\n * @param compiled - The candidate compiled patterns.\n * @param path - The normalized path to match.\n * @returns The winning pattern and its extracted params, or `null`.\n */\nexport function selectPattern<T extends CompiledPattern>(\n compiled: readonly T[],\n path: string,\n): { compiled: T; params: Record<string, string> } | null {\n const segments = splitPath(path);\n\n let best: T | null = null;\n let bestParams: Record<string, string> | null = null;\n\n for (const candidate of compiled) {\n const params = matchPattern(candidate, segments);\n\n if (params === null) {\n continue;\n }\n\n if (best === null || isMoreSpecific(candidate.segments, best.segments)) {\n best = candidate;\n bestParams = params;\n }\n }\n\n return best === null ? null : { compiled: best, params: bestParams! };\n}\n\n/**\n * Whether `a` outranks `b` by {@link rankAt} at the first position where they\n * differ.\n *\n * @param a - The candidate pattern's segments.\n * @param b - The current best pattern's segments.\n * @returns `true` when `a` is more specific than `b`.\n */\nfunction isMoreSpecific(a: readonly RouteSegment[], b: readonly RouteSegment[]): boolean {\n const length = Math.max(a.length, b.length);\n\n for (let i = 0; i < length; i += 1) {\n const rankA = rankAt(a, i);\n const rankB = rankAt(b, i);\n\n if (rankA !== rankB) {\n return rankA > rankB;\n }\n }\n\n return false;\n}\n","// SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0\n\nimport { DOM } from '~/core/DOM.js';\nimport { ListenerBag } from '~/core/ListenerBag.js';\nimport { compilePattern, normalizePath, splitPath, selectPattern, type CompiledPattern } from '~/router/RoutePattern.js';\n\n/** Params extracted from a matched pattern's `:name` segments. */\nexport type RouteParams = Record<string, string>;\n\n/** A registered route's callback: drives whatever it fronts, never builds it. */\nexport type RouteHandler = (params: RouteParams, path: string) => void;\n\n/** The events a {@link Router} emits. */\nexport type RouterEvent = \"navigate\" | \"nomatch\";\n\n/** The pattern and params a navigation resolved to. */\nexport interface RouteMatch {\n /** The pattern that won, as registered. */\n pattern: string;\n params: RouteParams;\n /** The normalized path that was matched. */\n path: string;\n}\n\n/** Construction options for {@link Router}. */\nexport interface RouterOptions {\n /** Patterns to `register` at construction, keyed by pattern string. */\n routes?: Record<string, RouteHandler>;\n listeners?: Partial<{\n navigate: (match: RouteMatch) => void;\n nomatch: (path: string) => void;\n }>;\n}\n\n/** A registered route: its compiled pattern plus the handler it drives. */\ntype CompiledRoute = CompiledPattern & { handler: RouteHandler };\n\n/**\n * Maps the URL hash to a single top-level app section. Patterns are\n * registered with {@link register} (e.g. `\"/data/rows/:sel\"`); on a\n * navigation, the router selects the most specific matching pattern, extracts\n * its `:param` values, and calls that pattern's handler — the handler drives\n * components that already exist, it never builds them.\n *\n * {@link start} reads the current hash, applies the matching route\n * synchronously, then installs the `hashchange` listener; call it once the\n * app has built its component tree and before the first layout pass runs, so\n * the routed section is already selected when that pass runs. {@link stop}\n * removes the listener.\n *\n * It is a plain class (no DOM element, so not `callable()`-wrapped) — it\n * follows the shape of a data store: an options bag, a private listener bag,\n * and typed `on` / `off` / `emit` forwarders.\n *\n * @category Core\n */\nexport class Router {\n\n private _routes: Map<string, CompiledRoute> = new Map();\n private _listeners: ListenerBag<RouterEvent> = new ListenerBag<RouterEvent>();\n private _started: boolean = false;\n\n // Stable reference so add/remove pair up; delegates to a named method.\n private readonly _onHashChange: () => void = () => this.handleHashChange();\n\n /**\n * @param options - Routes and listeners to register at construction.\n */\n constructor(options?: RouterOptions) {\n this.applyOptions(options ?? {});\n }\n\n /**\n * Registers a pattern's handler. Re-registering the exact same pattern\n * string replaces its handler silently. Registering a *different*\n * pattern string that collides with an already-registered one on\n * specificity (e.g. `\"/users/:id\"` and `\"/users/:name\"`) replaces it too,\n * but logs a warning naming both patterns — that collision usually\n * signals an authoring mistake.\n *\n * @param pattern - The route pattern, e.g. `\"/data/rows/:sel\"`.\n * @param handler - Called with the extracted params and the normalized\n * path when this pattern wins a navigation.\n * @returns This router, for chaining.\n */\n register(pattern: string, handler: RouteHandler): this {\n const compiled = compilePattern(pattern);\n const existing = this._routes.get(compiled.key);\n\n if (existing !== undefined && existing.pattern !== compiled.pattern) {\n console.warn(`Router: \"${existing.pattern}\" and \"${compiled.pattern}\" have the same specificity; \"${compiled.pattern}\" replaces it.`);\n }\n\n this._routes.set(compiled.key, { ...compiled, handler });\n\n return this;\n }\n\n /**\n * Reads the current hash, applies the matching route synchronously, then\n * installs the `hashchange` listener. Calling `start()` again on an\n * already-started router logs a warning and is otherwise a no-op — it\n * does not install a second listener.\n *\n * @returns This router, for chaining.\n */\n start(): this {\n if (this._started) {\n console.warn(`Router: start() called on an already-started router; ignoring.`);\n\n return this;\n }\n\n this._started = true;\n this.applyCurrentRoute();\n DOM.sink.addListener(DOM.source.getWindow(), \"hashchange\", this._onHashChange);\n\n return this;\n }\n\n /**\n * Removes the `hashchange` listener. Safe to call when never started, or\n * more than once.\n *\n * @returns This router, for chaining.\n */\n stop(): this {\n if (!this._started) {\n return this;\n }\n\n DOM.sink.removeListener(DOM.source.getWindow(), \"hashchange\", this._onHashChange);\n this._started = false;\n\n return this;\n }\n\n /**\n * Writes `path` into the hash — pushing a history entry, or replacing the\n * current one when `options.replace` is `true`. Each segment is\n * percent-encoded. Writing the path already in the hash is a same-value\n * write: it fires no `hashchange` and re-runs no handler.\n *\n * @param path - The path to navigate to, e.g. `\"/settings\"`.\n * @param options - `replace` to replace the current history entry instead\n * of pushing a new one.\n * @returns This router, for chaining.\n */\n navigate(path: string, options?: { replace?: boolean }): this {\n const segments = splitPath(normalizePath(path));\n const hash = \"#/\" + segments.map((segment) => encodeURIComponent(segment)).join(\"/\");\n\n if (options?.replace === true) {\n DOM.sink.replaceLocationHash(hash);\n } else {\n DOM.sink.setLocationHash(hash);\n }\n\n return this;\n }\n\n /**\n * The normalized path currently in the hash.\n *\n * @returns The current path.\n */\n getPath(): string {\n return normalizePath(DOM.source.getLocationHash());\n }\n\n on(event: \"navigate\", listener: (match: RouteMatch) => void): this;\n on(event: \"nomatch\", listener: (path: string) => void): this;\n\n /**\n * Subscribes a listener to a router event. Listeners fire in\n * registration order.\n *\n * @param event - The event to listen for.\n * @param listener - The callback to invoke.\n * @returns This router, for chaining.\n */\n on(event: RouterEvent, listener: Function): this {\n this._listeners.add(event, listener);\n\n return this;\n }\n\n /**\n * Removes a previously registered listener. No-op if it was never\n * registered for that event.\n *\n * @param event - The event the listener was registered for.\n * @param listener - The exact callback reference to remove.\n * @returns This router, for chaining.\n */\n off(event: RouterEvent, listener: Function): this {\n this._listeners.remove(event, listener);\n\n return this;\n }\n\n /**\n * Notifies all listeners registered for an event, in registration order.\n *\n * @param event - The event to emit.\n * @param payload - The value passed to each listener.\n */\n protected emit(event: RouterEvent, payload: unknown): void {\n this._listeners.fire(event, payload);\n }\n\n /**\n * Reads the current hash and calls the most specific matching pattern's\n * handler, emitting `\"navigate\"` — or emits `\"nomatch\"` when nothing\n * matches. Shared by {@link start} and the `hashchange` listener.\n */\n private applyCurrentRoute(): void {\n const path = this.getPath();\n const result = selectPattern(Array.from(this._routes.values()), path);\n\n if (result === null) {\n this.emit(\"nomatch\", path);\n\n return;\n }\n\n const match: RouteMatch = { pattern: result.compiled.pattern, params: result.params, path };\n\n result.compiled.handler(result.params, path);\n this.emit(\"navigate\", match);\n }\n\n /**\n * Applies an {@link RouterOptions} bag: registers `routes`, then wires\n * `listeners`. Called from the constructor body, after every field\n * initializer has run.\n *\n * @param options - The options bag to apply.\n */\n protected applyOptions(options: RouterOptions): void {\n if (options.routes !== undefined) {\n for (const pattern of Object.keys(options.routes)) {\n this.register(pattern, options.routes[pattern]);\n }\n }\n\n if (options.listeners !== undefined) {\n for (const event of Object.keys(options.listeners) as RouterEvent[]) {\n const listener = options.listeners[event];\n\n if (listener !== undefined) {\n this._listeners.add(event, listener);\n }\n }\n }\n }\n\n private handleHashChange(): void {\n this.applyCurrentRoute();\n }\n}\n"],"mappings":"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"}
@@ -1,4 +1,5 @@
1
1
  import { Component, ComponentOptions } from "../../core/Component.js";
2
+ import { Event } from "../../core/Event.js";
2
3
  import { Text } from "../../component/input/Text.js";
3
4
  import { Glyph } from "../../component/display/Glyph.js";
4
5
  import { FillType } from "../../layout/FillType.js";
@@ -7,7 +8,7 @@ import { BorderOptions } from "../../primitive/Border.js";
7
8
  import { Insets } from "../../primitive/Insets.js";
8
9
  import { Size } from "../../primitive/Size.js";
9
10
  export type ButtonEvent = "action";
10
- export type ClickListener = (event: MouseEvent) => void;
11
+ export type ClickListener = (event: MouseEvent) => Event.ListenerResult;
11
12
  export interface ButtonOptions extends ComponentOptions {
12
13
  text?: string;
13
14
  description?: string;
@@ -98,7 +99,7 @@ declare class Button<TOptions extends ButtonOptions = ButtonOptions> extends Com
98
99
  on(event: "action", listener: ClickListener): this;
99
100
  off(event: "action", listener: ClickListener): this;
100
101
  click(): this;
101
- addPointerDownListener(listener: Function): this;
102
+ addPointerDownListener(listener: Event.Listener): this;
102
103
  isChromeless(): boolean;
103
104
  setChromeless(value: boolean): this;
104
105
  private _clearChrome;
@@ -110,7 +111,7 @@ declare class Button<TOptions extends ButtonOptions = ButtonOptions> extends Com
110
111
  private _applyFlatChrome;
111
112
  private _resolveInsets;
112
113
  setInsets(insets: Insets): this;
113
- setPreferredSize(width: number, height: number): this;
114
+ setPreferredSize(size: Size): this;
114
115
  getPreferredSize(): Size | null;
115
116
  protected recomputePreferredSize(): void;
116
117
  protected computePreferredSize(): {
@@ -100,6 +100,6 @@ export declare abstract class AbstractChart<O extends AbstractChartOptions = Abs
100
100
  x: number;
101
101
  y: number;
102
102
  } | null;
103
- dispose(): void;
103
+ protected destructor(): void;
104
104
  }
105
105
  export {};
@@ -31,7 +31,7 @@ declare class ChartLegend extends Panel<ChartLegendOptions> {
31
31
  on(event: "toggle", listener: (seriesIndex: number) => void): this;
32
32
  off(event: "toggle", listener: (seriesIndex: number) => void): this;
33
33
  protected emit(event: ChartLegendEvent, seriesIndex: number): void;
34
- dispose(): void;
34
+ protected destructor(): void;
35
35
  }
36
36
  declare const ChartLegendCallable: import("../../core/Callable.js").Callable<typeof ChartLegend>;
37
37
  type ChartLegendCallable = ChartLegend;
@@ -1,9 +1,10 @@
1
1
  import { Component, ComponentOptions } from "../../core/Component.js";
2
+ import { Event } from "../../core/Event.js";
2
3
  interface DialogBackdropOptions extends ComponentOptions {
3
4
  }
4
5
  declare class DialogBackdrop extends Component<DialogBackdropOptions> {
5
6
  constructor(options?: DialogBackdropOptions);
6
- addClickListener(listener: Function): this;
7
+ addClickListener(listener: Event.Listener): this;
7
8
  resize(): void;
8
9
  destroy(): void;
9
10
  }
@@ -56,7 +56,7 @@ declare class MenuItem extends Component {
56
56
  isSeparator(): boolean;
57
57
  isEnabled(): boolean;
58
58
  activate(): void;
59
- dispose(): void;
59
+ protected destructor(): void;
60
60
  getBaseline(): number | null;
61
61
  doLayout(): this;
62
62
  }
@@ -52,6 +52,7 @@ declare class ScrollStrip extends Panel<ScrollStripOptions> {
52
52
  private trailClicked;
53
53
  revealItem(itemElement: Handle): void;
54
54
  containsArrow(target: EventTarget | null): boolean;
55
+ protected destructor(): void;
55
56
  }
56
57
  declare const ScrollStripCallable: import("../../core/Callable.js").Callable<typeof ScrollStrip>;
57
58
  type ScrollStripCallable = ScrollStrip;
@@ -1,6 +1,7 @@
1
1
  import { Component, ComponentOptions } from "../../core/Component.js";
2
2
  import type { Handle } from "../../core/DOM.js";
3
3
  import { CollapseDirection } from "../../component/container/CollapseButton.js";
4
+ import { Event } from "../../core/Event.js";
4
5
  export type SplitGutterEvent = "dragstart" | "drag" | "dragend" | "collapse";
5
6
  export interface SplitGutterOptions extends ComponentOptions {
6
7
  orientation?: string;
@@ -52,8 +53,8 @@ declare class SplitGutter extends Component<SplitGutterOptions> {
52
53
  destroy(): void;
53
54
  private _dispatchDrag;
54
55
  onDragStart(evnt: MouseEvent): void;
55
- onDragStop(): void;
56
- onDrag(evnt: MouseEvent): void;
56
+ onDragStop(): Event.ListenerResult;
57
+ onDrag(evnt: MouseEvent): Event.ListenerResult;
57
58
  private dragCursor;
58
59
  private applyCursor;
59
60
  render(): Handle;
@@ -46,7 +46,6 @@ declare class TabBar extends Container<TabBarOptions> {
46
46
  private _fixedWidth;
47
47
  private _underBorderFullWidth;
48
48
  private _underBorderFromTheme;
49
- private _themeCleanup;
50
49
  private _indicator;
51
50
  private _side;
52
51
  private _align;
@@ -74,7 +73,7 @@ declare class TabBar extends Container<TabBarOptions> {
74
73
  private dispatchBarOptions;
75
74
  setBarSurfaceColor(color: string): this;
76
75
  protected init(element?: Handle): this;
77
- dispose(): this;
76
+ protected destructor(): void;
78
77
  private applyUnderBorder;
79
78
  setWidthMode(mode: TabWidthMode): this;
80
79
  getWidthMode(): TabWidthMode;
@@ -1,11 +1,13 @@
1
1
  import { Container, ContainerOptions } from "../../core/Container.js";
2
2
  import { Component } from "../../core/Component.js";
3
+ import type { ComponentFactory } from "../../core/Component.js";
3
4
  import { Tab, TabOptions } from "../../layout/Tab.js";
4
5
  export interface TabEntryConfig {
5
6
  label: string;
6
- component: Component;
7
+ component: Component | ComponentFactory;
7
8
  closeable?: boolean;
8
9
  glyph?: string;
10
+ lazy?: boolean;
9
11
  }
10
12
  export interface TabPanelOptions extends ContainerOptions {
11
13
  tabs?: TabEntryConfig[];
@@ -14,11 +16,12 @@ export interface TabPanelOptions extends ContainerOptions {
14
16
  }
15
17
  declare class TabPanel<TOptions extends TabPanelOptions = TabPanelOptions> extends Container<TOptions> {
16
18
  constructor(options?: TOptions);
17
- addTab(component: Component, label: string, options?: {
19
+ addTab(component: Component | ComponentFactory, label: string, options?: {
18
20
  closeable?: boolean;
19
21
  glyph?: string;
22
+ lazy?: boolean;
20
23
  }): this;
21
- addLazyTab(factory: () => Component, label: string, options?: {
24
+ addLazyTab(factory: ComponentFactory, label: string, options?: {
22
25
  closeable?: boolean;
23
26
  glyph?: string;
24
27
  }): this;
@@ -1,4 +1,5 @@
1
1
  import { Component, ComponentOptions } from "../../core/Component.js";
2
+ import { Event } from "../../core/Event.js";
2
3
  export type WindowBorderEvent = "drag";
3
4
  export declare enum Direction {
4
5
  NORTH = 0,
@@ -34,7 +35,7 @@ declare class WindowBorder extends Component<WindowBorderOptions> {
34
35
  isSnapTarget(): boolean;
35
36
  setSnapTarget(value: boolean): this;
36
37
  onDragStart(): void;
37
- onDragStop(): void;
38
+ onDragStop(): Event.ListenerResult;
38
39
  private dragCursor;
39
40
  render(): import("../../core/DOM.js").Handle;
40
41
  }
@@ -1,5 +1,6 @@
1
1
  import { Header, HeaderOptions } from "../../component/display/Header.js";
2
2
  import type { Handle } from "../../core/DOM.js";
3
+ import { Event } from "../../core/Event.js";
3
4
  import { Glyph } from "../../component/display/Glyph.js";
4
5
  export interface WindowHeaderOptions extends HeaderOptions {
5
6
  closeable?: boolean;
@@ -37,7 +38,7 @@ declare class WindowHeader extends Header {
37
38
  addExitButtonListener(listener: Function): this;
38
39
  addMinimizeButtonListener(listener: Function): this;
39
40
  addMaximizeButtonListener(listener: Function): this;
40
- addHeaderDoubleClickListener(listener: Function): this;
41
+ addHeaderDoubleClickListener(listener: Event.Listener): this;
41
42
  getMinContentWidth(textBudget?: number): number;
42
43
  getMinimizeButtonElement(): Handle | undefined;
43
44
  getMaximizeButtonElement(): Handle | undefined;
@@ -1,5 +1,6 @@
1
1
  import { Component, ComponentOptions } from "../../core/Component.js";
2
2
  import type { Handle } from "../../core/DOM.js";
3
+ import { Size } from "../../primitive/Size.js";
3
4
  import { NamedGlyphDef } from "../../component/display/Glyphs.js";
4
5
  export type GlyphAnimation = "spin" | "pulse" | "beat";
5
6
  export interface GlyphOptions extends ComponentOptions {
@@ -18,7 +19,7 @@ declare class Glyph extends Component<GlyphOptions> {
18
19
  static register(...defs: NamedGlyphDef[]): void;
19
20
  static unregister(name: string): void;
20
21
  constructor(name: string, options?: GlyphOptions);
21
- setPreferredSize(width: number, height: number): this;
22
+ setPreferredSize(size: Size): this;
22
23
  getBaseline(): number | null;
23
24
  getGlyphName(): string;
24
25
  getFontSize(): number | null;
@@ -1,8 +1,14 @@
1
1
  import { Component, ComponentOptions } from "../../core/Component.js";
2
2
  import type { Handle } from "../../core/DOM.js";
3
3
  import { Size } from "../../primitive/Size.js";
4
+ export interface MarkdownLinkResolution {
5
+ href: string;
6
+ external: boolean;
7
+ }
8
+ export type MarkdownLinkResolver = (href: string) => MarkdownLinkResolution;
4
9
  export interface MarkdownOptions extends ComponentOptions {
5
10
  markdown?: string;
11
+ linkResolver?: MarkdownLinkResolver;
6
12
  }
7
13
  declare class Markdown extends Component<MarkdownOptions> {
8
14
  private _contentHandles;
@@ -11,11 +17,13 @@ declare class Markdown extends Component<MarkdownOptions> {
11
17
  constructor(markdown?: string, options?: MarkdownOptions);
12
18
  protected applyOptions(options: MarkdownOptions): this;
13
19
  getMarkdown(): string;
20
+ setLinkResolver(resolver: MarkdownLinkResolver): this;
21
+ getLinkResolver(): MarkdownLinkResolver;
14
22
  setMarkdown(markdown: string): this;
15
23
  getMinSize(): Size | null;
16
24
  getPreferredSize(): Size | null;
17
25
  setWidth(width: number): this;
18
- dispose(): void;
26
+ protected destructor(): void;
19
27
  private measureContentHeight;
20
28
  protected render(): Handle;
21
29
  private create;
@@ -26,6 +34,8 @@ declare class Markdown extends Component<MarkdownOptions> {
26
34
  private appendParagraph;
27
35
  private appendList;
28
36
  private appendListItem;
37
+ private appendTable;
38
+ private appendTableRow;
29
39
  private appendBlockquote;
30
40
  private appendCode;
31
41
  private appendInlineTokens;
@@ -15,7 +15,7 @@ declare class PaginationBar extends Component<PaginationBarOptions> {
15
15
  private readonly _onStoreUpdate;
16
16
  constructor(store: AbstractStore, options?: PaginationBarOptions);
17
17
  protected applyOptions(options: PaginationBarOptions): this;
18
- dispose(): void;
18
+ protected destructor(): void;
19
19
  private refresh;
20
20
  }
21
21
  declare const PaginationBarCallable: import("../../core/Callable.js").Callable<typeof PaginationBar>;
@@ -0,0 +1,2 @@
1
+ import { Component } from "../../core/Component.js";
2
+ export declare function createSpinnerWrap(): Component;
@@ -50,7 +50,7 @@ declare class Video extends Component<VideoOptions> {
50
50
  off(event: VideoMediaEvent, listener: () => void): this;
51
51
  protected emit(event: VideoMediaEvent): void;
52
52
  protected init(element?: Handle): this;
53
- dispose(): void;
53
+ protected destructor(): void;
54
54
  private buildMediaHandlers;
55
55
  private replayMediaOptions;
56
56
  private attachMediaListeners;
@@ -73,7 +73,7 @@ declare class VideoPlayer extends Component<VideoPlayerOptions> {
73
73
  off(event: VideoPlayerEvent, listener: () => void): this;
74
74
  protected emit(event: VideoPlayerEvent): void;
75
75
  protected init(element?: Handle): this;
76
- dispose(): void;
76
+ protected destructor(): void;
77
77
  private syncFromState;
78
78
  private syncFromVideo;
79
79
  private buildControlBar;
@@ -12,7 +12,7 @@ export type { GlyphDef, NamedGlyphDef } from '../../component/display/Glyphs.js'
12
12
  export { IconText } from '../../component/display/IconText.js';
13
13
  export type { IconTextOptions } from '../../component/display/IconText.js';
14
14
  export { Markdown } from '../../component/display/Markdown.js';
15
- export type { MarkdownOptions } from '../../component/display/Markdown.js';
15
+ export type { MarkdownOptions, MarkdownLinkResolution, MarkdownLinkResolver } from '../../component/display/Markdown.js';
16
16
  export { IconLabel } from '../../component/display/IconLabel.js';
17
17
  export type { IconLabelOptions } from '../../component/display/IconLabel.js';
18
18
  export { ProgressBar } from '../../component/display/ProgressBar.js';
@@ -14,6 +14,7 @@ export interface CodeEditorOptions extends ComponentOptions {
14
14
  declare class CodeEditor extends Component<CodeEditorOptions> {
15
15
  private _view;
16
16
  private _flashOverlay;
17
+ private _flashAnimation;
17
18
  private readonly _langCompartment;
18
19
  private readonly _readOnlyCompartment;
19
20
  private readonly _themeCompartment;
@@ -38,7 +39,7 @@ declare class CodeEditor extends Component<CodeEditorOptions> {
38
39
  off(event: "readonlyedit", listener: () => void): this;
39
40
  protected emit(event: "change", payload: CodeEditorChange): void;
40
41
  protected emit(event: "readonlyedit"): void;
41
- dispose(): void;
42
+ protected destructor(): void;
42
43
  private claimScrollableWheel;
43
44
  private mount;
44
45
  private mountFlashOverlay;
@@ -16,6 +16,7 @@ export interface MarkdownEditorOptions extends ComponentOptions {
16
16
  declare class MarkdownEditor extends Component<MarkdownEditorOptions> {
17
17
  private _editor;
18
18
  private _unregister;
19
+ private _unregisterTableView;
19
20
  private readonly _listeners;
20
21
  private readonly _card;
21
22
  private readonly _wysiwyg;
@@ -36,12 +37,17 @@ declare class MarkdownEditor extends Component<MarkdownEditorOptions> {
36
37
  toggleOrderedList(): this;
37
38
  toggleLink(url: string | null): this;
38
39
  setBlockType(type: MarkdownBlockType): this;
40
+ insertTable(rows: number, columns: number): this;
41
+ insertTableRow(after?: boolean): this;
42
+ deleteTableRow(): this;
43
+ insertTableColumn(after?: boolean): this;
44
+ deleteTableColumn(): this;
39
45
  on(event: MarkdownEditorEvent, listener: (payload: MarkdownEditorChange) => void): this;
40
46
  off(event: MarkdownEditorEvent, listener: (payload: MarkdownEditorChange) => void): this;
41
47
  protected emit(event: MarkdownEditorEvent, payload: MarkdownEditorChange): void;
42
48
  setContentEditable(contentEditable: boolean): this;
43
49
  getContentEditable(): boolean;
44
- dispose(): void;
50
+ protected destructor(): void;
45
51
  private ensureEditor;
46
52
  private mountWysiwyg;
47
53
  private handleChange;
@@ -0,0 +1,2 @@
1
+ import type { MultilineElementTransformer, Transformer } from "@lexical/markdown";
2
+ export declare function createTableTransformer(getTransformers: () => Transformer[]): MultilineElementTransformer;
@@ -1,5 +1,6 @@
1
1
  import { AbstractBooleanInput, AbstractBooleanInputOptions } from "../../component/input/AbstractBooleanInput.js";
2
2
  import { Component } from "../../core/Component.js";
3
+ import { Event } from "../../core/Event.js";
3
4
  export interface CheckboxOptions extends AbstractBooleanInputOptions {
4
5
  selected?: boolean;
5
6
  value?: boolean;
@@ -25,7 +26,7 @@ declare class Checkbox<TOptions extends CheckboxOptions = CheckboxOptions> exten
25
26
  isIndeterminate(): boolean;
26
27
  setIndeterminate(value: boolean): this;
27
28
  setAnimated(value: boolean): this;
28
- on(event: "action", listener: Function): this;
29
+ on(event: "action", listener: Event.Listener): this;
29
30
  on(event: "change", listener: (value: boolean) => void): this;
30
31
  on(event: "binding", listener: () => void): this;
31
32
  off(event: "action" | "change" | "binding", listener: Function): this;
@@ -15,7 +15,7 @@ declare class Link extends Text<LinkOptions> {
15
15
  on(event: "action", listener: ClickListener): this;
16
16
  off(event: "action", listener: ClickListener): this;
17
17
  click(): this;
18
- dispose(): void;
18
+ protected destructor(): void;
19
19
  private handleKeyDown;
20
20
  }
21
21
  declare const LinkCallable: import("../../core/Callable.js").Callable<typeof Link>;
@@ -1,5 +1,6 @@
1
1
  import { AbstractBooleanInput, AbstractBooleanInputOptions } from "../../component/input/AbstractBooleanInput.js";
2
2
  import { Component } from "../../core/Component.js";
3
+ import { Event } from "../../core/Event.js";
3
4
  export interface RadioButtonOptions extends AbstractBooleanInputOptions {
4
5
  selected?: boolean;
5
6
  value?: boolean;
@@ -25,7 +26,7 @@ declare class RadioButton<TOptions extends RadioButtonOptions = RadioButtonOptio
25
26
  setRadioName(name: string): this;
26
27
  clearRadioName(): this;
27
28
  getRadioName(): string | null;
28
- on(event: "action", listener: Function): this;
29
+ on(event: "action", listener: Event.Listener): this;
29
30
  on(event: "change", listener: (value: boolean) => void): this;
30
31
  on(event: "binding", listener: () => void): this;
31
32
  off(event: "action" | "change" | "binding", listener: Function): this;
@@ -1,4 +1,5 @@
1
1
  import { AbstractInput, AbstractInputOptions } from "../../component/input/AbstractInput.js";
2
+ import { Event } from "../../core/Event.js";
2
3
  import type { AxisOrientation } from "../../primitive/Axis.js";
3
4
  export interface SliderOptions extends AbstractInputOptions {
4
5
  value?: number;
@@ -41,7 +42,7 @@ declare class Slider<TOptions extends SliderOptions = SliderOptions> extends Abs
41
42
  setOrientation(orientation: AxisOrientation): this;
42
43
  isShowTicks(): boolean;
43
44
  setShowTicks(value: boolean): this;
44
- on(event: "action", listener: Function): this;
45
+ on(event: "action", listener: Event.Listener): this;
45
46
  on(event: "change", listener: (value: number) => void): this;
46
47
  on(event: "binding", listener: () => void): this;
47
48
  off(event: "action" | "change" | "binding", listener: Function): this;
@@ -23,7 +23,6 @@ declare class Text<TOptions extends TextOptions = TextOptions> extends Component
23
23
  private _hasExplicitPreferredSize;
24
24
  private _fontSizeCSSVar;
25
25
  private _fontSizeCSSRule;
26
- private readonly _unsubscribeTheme;
27
26
  private _lineHeightCSSVar;
28
27
  private _lineHeightCSSRule;
29
28
  private _measuredBaseline;
@@ -39,7 +38,7 @@ declare class Text<TOptions extends TextOptions = TextOptions> extends Component
39
38
  private readThemeLineHeightPx;
40
39
  getElement(createIfMissing?: boolean): Handle | undefined;
41
40
  private resolveBoundFontSizePx;
42
- setPreferredSize(width: number, height: number): this;
41
+ setPreferredSize(size: Size): this;
43
42
  private setCalculatedSize;
44
43
  private calculateSize;
45
44
  measure(): void;
@@ -89,7 +88,6 @@ declare class Text<TOptions extends TextOptions = TextOptions> extends Component
89
88
  setLineClamp(lines: number): this;
90
89
  clearLineClamp(): this;
91
90
  applyStyle(element: Handle): this;
92
- dispose(): void;
93
91
  protected render(): Handle;
94
92
  }
95
93
  declare const TextCallable: import("../../core/Callable.js").Callable<typeof Text>;
@@ -1,5 +1,6 @@
1
1
  import { AbstractInput, AbstractInputOptions } from "../../component/input/AbstractInput.js";
2
2
  import type { Handle } from "../../core/DOM.js";
3
+ import { Event } from "../../core/Event.js";
3
4
  export interface TextInputOptions extends AbstractInputOptions {
4
5
  type?: string;
5
6
  text?: string;
@@ -18,8 +19,8 @@ declare class TextInput<TOptions extends TextInputOptions = TextInputOptions> ex
18
19
  constructor(options?: TOptions, subclassDefaults?: Partial<TOptions>);
19
20
  protected onInput(): void;
20
21
  protected applyOptions(options: TOptions): this;
21
- on(event: "action", listener: Function): this;
22
- on(event: "keydown", listener: (e: KeyboardEvent) => void): this;
22
+ on(event: "action", listener: Event.Listener): this;
23
+ on(event: "keydown", listener: (e: KeyboardEvent) => Event.ListenerResult): this;
23
24
  on(event: "change", listener: (value: string) => void): this;
24
25
  on(event: "binding", listener: () => void): this;
25
26
  off(event: "action" | "keydown" | "change" | "binding", listener: Function): this;
@@ -2,6 +2,7 @@ import { AbstractInput, AbstractInputOptions } from "../../component/input/Abstr
2
2
  import { Component } from "../../core/Component.js";
3
3
  import type { Handle } from "../../core/DOM.js";
4
4
  import { Panel } from "../../core/Panel.js";
5
+ import { Event } from "../../core/Event.js";
5
6
  import { AbstractStore } from "../../data/AbstractStore.js";
6
7
  import { ModelRecord } from "../../data/ModelRecord.js";
7
8
  import { ListItemRenderer } from "../../component/list/ListItemRenderer.js";
@@ -103,7 +104,7 @@ declare abstract class AbstractSelectableList<TValue, TOptions extends AbstractS
103
104
  getSelectedRecord(): ModelRecord | undefined;
104
105
  getSelectedIndex(): number;
105
106
  setSelectedIndex(idx: number, fireEvent?: boolean): this;
106
- on(event: "action", listener: Function): this;
107
+ on(event: "action", listener: Event.Listener): this;
107
108
  on(event: "change", listener: (value: TValue) => void): this;
108
109
  on(event: "binding", listener: () => void): this;
109
110
  on(event: "contextmenu", listener: (index: number, event: MouseEvent) => void): this;
@@ -11,7 +11,7 @@ declare class MenuBarButton extends Button<MenuBarButtonOptions> {
11
11
  height: number;
12
12
  };
13
13
  setActive(active: boolean): this;
14
- dispose(): void;
14
+ protected destructor(): void;
15
15
  }
16
16
  declare const MenuBarButtonCallable: import("../../core/Callable.js").Callable<typeof MenuBarButton>;
17
17
  type MenuBarButtonCallable = MenuBarButton;
@@ -1,4 +1,5 @@
1
1
  import { Component, ComponentOptions } from "../core/Component.js";
2
+ import { Animation } from "../core/Animation.js";
2
3
  import { DismissableLayer, LayerDismissMode } from "../core/LayerManager.js";
3
4
  import { type Rect, type Handle } from "../core/DOM.js";
4
5
  export interface AnimatedDropdownOptions extends ComponentOptions {
@@ -17,6 +18,8 @@ declare class AnimatedDropdown<TOptions extends AnimatedDropdownOptions = Animat
17
18
  private _open;
18
19
  private _closeHandler;
19
20
  private _anchorElement;
21
+ private _showAnimation;
22
+ private _hideAnimation;
20
23
  constructor(options?: AnimatedDropdownOptions, subclassDefaults?: Partial<AnimatedDropdownOptions>);
21
24
  protected applyOptions(options: TOptions): this;
22
25
  setAnimated(value: boolean): this;
@@ -33,6 +36,7 @@ declare class AnimatedDropdown<TOptions extends AnimatedDropdownOptions = Animat
33
36
  placeAnchored(rect: Rect): this;
34
37
  protected onShowComplete(): void;
35
38
  protected onHideComplete(): void;
39
+ protected destructor(): void;
36
40
  getLayerElement(): Handle | null;
37
41
  getDismissMode(): LayerDismissMode;
38
42
  requestClose(): void;
@@ -41,8 +45,8 @@ declare class AnimatedDropdown<TOptions extends AnimatedDropdownOptions = Animat
41
45
  setCloseHandler(handler: (() => void) | null): this;
42
46
  setAnchorElement(el: Handle | null): this;
43
47
  }
44
- export declare function fadeShow(component: Component, options?: FadeOptions): void;
45
- export declare function fadeHideAndDetach(component: Component, options?: FadeOptions): void;
48
+ export declare function fadeShow(component: Component, options?: FadeOptions): Animation.CancelHandle;
49
+ export declare function fadeHideAndDetach(component: Component, options?: FadeOptions): Animation.CancelHandle;
46
50
  declare const AnimatedDropdownCallable: import("../core/Callable.js").Callable<typeof AnimatedDropdown>;
47
51
  type AnimatedDropdownCallable<TOptions extends AnimatedDropdownOptions = AnimatedDropdownOptions> = AnimatedDropdown<TOptions>;
48
52
  export { AnimatedDropdown as _AnimatedDropdown, AnimatedDropdownCallable as AnimatedDropdown };
@@ -1,4 +1,5 @@
1
1
  import { Component } from "../core/Component.js";
2
+ import type { ComponentFactory } from "../core/Component.js";
2
3
  import type { Handle } from "../core/DOM.js";
3
4
  export declare namespace Animation {
4
5
  interface PlayConfig {
@@ -11,7 +12,7 @@ export declare namespace Animation {
11
12
  fallbackBufferMs?: number;
12
13
  }
13
14
  function isReducedMotion(): boolean;
14
- function play(el: Handle, config: PlayConfig): void;
15
+ function play(el: Handle, config: PlayConfig): CancelHandle;
15
16
  interface AfterTransitionConfig {
16
17
  component: Component;
17
18
  property?: string;
@@ -19,7 +20,7 @@ export declare namespace Animation {
19
20
  fallbackBufferMs?: number;
20
21
  onComplete: () => void;
21
22
  }
22
- function afterTransition(config: AfterTransitionConfig): void;
23
+ function afterTransition(config: AfterTransitionConfig): CancelHandle;
23
24
  interface TweenConfig<T extends {
24
25
  [K in keyof T]: number;
25
26
  }> {
@@ -30,18 +31,20 @@ export declare namespace Animation {
30
31
  onStep: (values: T) => void;
31
32
  onComplete?: () => void;
32
33
  }
33
- interface TweenHandle {
34
+ interface CancelHandle {
34
35
  cancel(): void;
35
36
  }
36
37
  function tween<T extends {
37
38
  [K in keyof T]: number;
38
- }>(config: TweenConfig<T>): TweenHandle;
39
+ }>(config: TweenConfig<T>): CancelHandle;
39
40
  interface MaterializeConfig {
40
41
  host: Component;
41
- factory: () => Component;
42
+ factory: ComponentFactory;
42
43
  spinnerComponent: Component;
43
44
  fadeMs?: number;
44
45
  onReady?: (component: Component) => void;
46
+ onError?: (error: unknown) => void;
47
+ isStale?: () => boolean;
45
48
  }
46
- function materialize(config: MaterializeConfig): void;
49
+ function materialize(config: MaterializeConfig): CancelHandle;
47
50
  }