@mlightcad/cad-simple-viewer 1.6.3 → 1.7.1

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 (808) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +185 -180
  3. package/dist/cad-simple-viewer.js +34895 -23320
  4. package/dist/cad-simple-viewer.umd.cjs +2570 -372
  5. package/dist/mtext-renderer-worker.js +15359 -15067
  6. package/icons.ts +7 -7
  7. package/lib/app/AcApBrand.d.ts +2 -2
  8. package/lib/app/AcApBrand.d.ts.map +1 -1
  9. package/lib/app/AcApBrand.js +2 -2
  10. package/lib/app/AcApBrand.js.map +1 -1
  11. package/lib/app/AcApContext.d.ts.map +1 -1
  12. package/lib/app/AcApContext.js +4 -3
  13. package/lib/app/AcApContext.js.map +1 -1
  14. package/lib/app/AcApDocManager.d.ts +107 -25
  15. package/lib/app/AcApDocManager.d.ts.map +1 -1
  16. package/lib/app/AcApDocManager.js +209 -93
  17. package/lib/app/AcApDocManager.js.map +1 -1
  18. package/lib/app/AcApDocsUrl.d.ts +57 -0
  19. package/lib/app/AcApDocsUrl.d.ts.map +1 -0
  20. package/lib/app/AcApDocsUrl.js +76 -0
  21. package/lib/app/AcApDocsUrl.js.map +1 -0
  22. package/lib/app/AcApDocument.d.ts +1 -1
  23. package/lib/app/AcApDocument.d.ts.map +1 -1
  24. package/lib/app/AcApDocument.js.map +1 -1
  25. package/lib/app/AcApFontLoader.d.ts +6 -0
  26. package/lib/app/AcApFontLoader.d.ts.map +1 -1
  27. package/lib/app/AcApFontLoader.js +11 -0
  28. package/lib/app/AcApFontLoader.js.map +1 -1
  29. package/lib/app/AcApOpenDatabaseOptions.d.ts +106 -0
  30. package/lib/app/AcApOpenDatabaseOptions.d.ts.map +1 -0
  31. package/lib/app/{AcDbOpenDatabaseOptions.js → AcApOpenDatabaseOptions.js} +2 -2
  32. package/lib/app/AcApOpenDatabaseOptions.js.map +1 -0
  33. package/lib/app/AcApOpenFileDialog.d.ts +1 -1
  34. package/lib/app/AcApOpenFileProgressController.d.ts +4 -2
  35. package/lib/app/AcApOpenFileProgressController.d.ts.map +1 -1
  36. package/lib/app/AcApOpenFileProgressController.js +4 -2
  37. package/lib/app/AcApOpenFileProgressController.js.map +1 -1
  38. package/lib/app/AcApSettingManager.d.ts +156 -43
  39. package/lib/app/AcApSettingManager.d.ts.map +1 -1
  40. package/lib/app/AcApSettingManager.js +216 -66
  41. package/lib/app/AcApSettingManager.js.map +1 -1
  42. package/lib/app/index.d.ts +4 -2
  43. package/lib/app/index.d.ts.map +1 -1
  44. package/lib/app/index.js +3 -1
  45. package/lib/app/index.js.map +1 -1
  46. package/lib/app/notification/AcApNotificationEventBridge.d.ts +130 -0
  47. package/lib/app/notification/AcApNotificationEventBridge.d.ts.map +1 -0
  48. package/lib/app/notification/AcApNotificationEventBridge.js +309 -0
  49. package/lib/app/notification/AcApNotificationEventBridge.js.map +1 -0
  50. package/lib/app/notification/AcApNotificationService.d.ts +185 -0
  51. package/lib/app/notification/AcApNotificationService.d.ts.map +1 -0
  52. package/lib/app/notification/AcApNotificationService.js +271 -0
  53. package/lib/app/notification/AcApNotificationService.js.map +1 -0
  54. package/lib/app/notification/AcApNotificationStore.d.ts +147 -0
  55. package/lib/app/notification/AcApNotificationStore.d.ts.map +1 -0
  56. package/lib/app/notification/AcApNotificationStore.js +345 -0
  57. package/lib/app/notification/AcApNotificationStore.js.map +1 -0
  58. package/lib/app/notification/AcApNotificationTypes.d.ts +195 -0
  59. package/lib/app/notification/AcApNotificationTypes.d.ts.map +1 -0
  60. package/lib/app/notification/AcApNotificationTypes.js +78 -0
  61. package/lib/app/notification/AcApNotificationTypes.js.map +1 -0
  62. package/lib/app/notification/index.d.ts +13 -0
  63. package/lib/app/notification/index.d.ts.map +1 -0
  64. package/lib/app/notification/index.js +13 -0
  65. package/lib/app/notification/index.js.map +1 -0
  66. package/lib/command/AcApDrawOverlayInput.d.ts +6 -0
  67. package/lib/command/AcApDrawOverlayInput.d.ts.map +1 -0
  68. package/lib/command/AcApDrawOverlayInput.js +64 -0
  69. package/lib/command/AcApDrawOverlayInput.js.map +1 -0
  70. package/lib/command/AcApDrawStyleDrawCmd.d.ts +9 -0
  71. package/lib/command/AcApDrawStyleDrawCmd.d.ts.map +1 -0
  72. package/lib/command/AcApDrawStyleDrawCmd.js +32 -0
  73. package/lib/command/AcApDrawStyleDrawCmd.js.map +1 -0
  74. package/lib/command/AcApDrawStyleSession.d.ts +20 -0
  75. package/lib/command/AcApDrawStyleSession.d.ts.map +1 -0
  76. package/lib/command/AcApDrawStyleSession.js +2 -0
  77. package/lib/command/AcApDrawStyleSession.js.map +1 -0
  78. package/lib/command/AcApInstallDrawStyleSessionAccessory.d.ts +28 -0
  79. package/lib/command/AcApInstallDrawStyleSessionAccessory.d.ts.map +1 -0
  80. package/lib/command/AcApInstallDrawStyleSessionAccessory.js +178 -0
  81. package/lib/command/AcApInstallDrawStyleSessionAccessory.js.map +1 -0
  82. package/lib/command/AcApReadingModeCmd.d.ts +17 -0
  83. package/lib/command/AcApReadingModeCmd.d.ts.map +1 -0
  84. package/lib/command/AcApReadingModeCmd.js +82 -0
  85. package/lib/command/AcApReadingModeCmd.js.map +1 -0
  86. package/lib/command/AcApShortCutSelectionAccessory.d.ts +14 -0
  87. package/lib/command/AcApShortCutSelectionAccessory.d.ts.map +1 -0
  88. package/lib/command/AcApShortCutSelectionAccessory.js +266 -0
  89. package/lib/command/AcApShortCutSelectionAccessory.js.map +1 -0
  90. package/lib/command/AcApShortCutToolbarDocBind.d.ts +20 -0
  91. package/lib/command/AcApShortCutToolbarDocBind.d.ts.map +1 -0
  92. package/lib/command/AcApShortCutToolbarDocBind.js +155 -0
  93. package/lib/command/AcApShortCutToolbarDocBind.js.map +1 -0
  94. package/lib/command/AcApSwitchBgCmd.d.ts.map +1 -1
  95. package/lib/command/AcApSwitchBgCmd.js +7 -2
  96. package/lib/command/AcApSwitchBgCmd.js.map +1 -1
  97. package/lib/command/AcApToolbarDocBind.d.ts +19 -0
  98. package/lib/command/AcApToolbarDocBind.d.ts.map +1 -0
  99. package/lib/command/AcApToolbarDocBind.js +62 -0
  100. package/lib/command/AcApToolbarDocBind.js.map +1 -0
  101. package/lib/command/AcApZoomCmd.d.ts +39 -1
  102. package/lib/command/AcApZoomCmd.d.ts.map +1 -1
  103. package/lib/command/AcApZoomCmd.js +70 -6
  104. package/lib/command/AcApZoomCmd.js.map +1 -1
  105. package/lib/command/convert/AcApConvertToBmpCmd.d.ts +14 -0
  106. package/lib/command/convert/AcApConvertToBmpCmd.d.ts.map +1 -0
  107. package/lib/command/convert/AcApConvertToBmpCmd.js +34 -0
  108. package/lib/command/convert/AcApConvertToBmpCmd.js.map +1 -0
  109. package/lib/command/convert/AcApConvertToJpgCmd.d.ts +14 -0
  110. package/lib/command/convert/AcApConvertToJpgCmd.d.ts.map +1 -0
  111. package/lib/command/convert/AcApConvertToJpgCmd.js +34 -0
  112. package/lib/command/convert/AcApConvertToJpgCmd.js.map +1 -0
  113. package/lib/command/convert/AcApConvertToPngCmd.d.ts +4 -36
  114. package/lib/command/convert/AcApConvertToPngCmd.d.ts.map +1 -1
  115. package/lib/command/convert/AcApConvertToPngCmd.js +4 -138
  116. package/lib/command/convert/AcApConvertToPngCmd.js.map +1 -1
  117. package/lib/command/convert/AcApConvertToRasterImageCmd.d.ts +40 -0
  118. package/lib/command/convert/AcApConvertToRasterImageCmd.d.ts.map +1 -0
  119. package/lib/command/convert/AcApConvertToRasterImageCmd.js +161 -0
  120. package/lib/command/convert/AcApConvertToRasterImageCmd.js.map +1 -0
  121. package/lib/command/convert/{AcApPngConvertor.d.ts → AcApRasterImageConvertor.d.ts} +36 -12
  122. package/lib/command/convert/AcApRasterImageConvertor.d.ts.map +1 -0
  123. package/lib/command/convert/{AcApPngConvertor.js → AcApRasterImageConvertor.js} +163 -32
  124. package/lib/command/convert/AcApRasterImageConvertor.js.map +1 -0
  125. package/lib/command/convert/index.d.ts +4 -1
  126. package/lib/command/convert/index.d.ts.map +1 -1
  127. package/lib/command/convert/index.js +4 -1
  128. package/lib/command/convert/index.js.map +1 -1
  129. package/lib/command/draw/AcApHatchCmd.js +1 -1
  130. package/lib/command/draw/AcApHatchCmd.js.map +1 -1
  131. package/lib/command/draw/AcApMTextCmd.d.ts.map +1 -1
  132. package/lib/command/draw/AcApMTextCmd.js +11 -7
  133. package/lib/command/draw/AcApMTextCmd.js.map +1 -1
  134. package/lib/command/index.d.ts +5 -0
  135. package/lib/command/index.d.ts.map +1 -1
  136. package/lib/command/index.js +5 -0
  137. package/lib/command/index.js.map +1 -1
  138. package/lib/command/markup/AcApMarkupArrowCmd.d.ts +2 -3
  139. package/lib/command/markup/AcApMarkupArrowCmd.d.ts.map +1 -1
  140. package/lib/command/markup/AcApMarkupArrowCmd.js +8 -9
  141. package/lib/command/markup/AcApMarkupArrowCmd.js.map +1 -1
  142. package/lib/command/markup/AcApMarkupCalloutCmd.d.ts +2 -3
  143. package/lib/command/markup/AcApMarkupCalloutCmd.d.ts.map +1 -1
  144. package/lib/command/markup/AcApMarkupCalloutCmd.js +69 -13
  145. package/lib/command/markup/AcApMarkupCalloutCmd.js.map +1 -1
  146. package/lib/command/markup/AcApMarkupCircleCmd.d.ts +2 -3
  147. package/lib/command/markup/AcApMarkupCircleCmd.d.ts.map +1 -1
  148. package/lib/command/markup/AcApMarkupCircleCmd.js +8 -9
  149. package/lib/command/markup/AcApMarkupCircleCmd.js.map +1 -1
  150. package/lib/command/markup/AcApMarkupCloudCmd.d.ts +2 -3
  151. package/lib/command/markup/AcApMarkupCloudCmd.d.ts.map +1 -1
  152. package/lib/command/markup/AcApMarkupCloudCmd.js +8 -9
  153. package/lib/command/markup/AcApMarkupCloudCmd.js.map +1 -1
  154. package/lib/command/markup/AcApMarkupCmdUtil.d.ts +12 -1
  155. package/lib/command/markup/AcApMarkupCmdUtil.d.ts.map +1 -1
  156. package/lib/command/markup/AcApMarkupCmdUtil.js +37 -9
  157. package/lib/command/markup/AcApMarkupCmdUtil.js.map +1 -1
  158. package/lib/command/markup/AcApMarkupDrawCmd.d.ts +19 -0
  159. package/lib/command/markup/AcApMarkupDrawCmd.d.ts.map +1 -0
  160. package/lib/command/markup/AcApMarkupDrawCmd.js +47 -0
  161. package/lib/command/markup/AcApMarkupDrawCmd.js.map +1 -0
  162. package/lib/command/markup/AcApMarkupGeometry.d.ts +19 -2
  163. package/lib/command/markup/AcApMarkupGeometry.d.ts.map +1 -1
  164. package/lib/command/markup/AcApMarkupGeometry.js +43 -2
  165. package/lib/command/markup/AcApMarkupGeometry.js.map +1 -1
  166. package/lib/command/markup/AcApMarkupHighlightCmd.d.ts +2 -3
  167. package/lib/command/markup/AcApMarkupHighlightCmd.d.ts.map +1 -1
  168. package/lib/command/markup/AcApMarkupHighlightCmd.js +9 -10
  169. package/lib/command/markup/AcApMarkupHighlightCmd.js.map +1 -1
  170. package/lib/command/markup/AcApMarkupLineCmd.d.ts +2 -3
  171. package/lib/command/markup/AcApMarkupLineCmd.d.ts.map +1 -1
  172. package/lib/command/markup/AcApMarkupLineCmd.js +18 -11
  173. package/lib/command/markup/AcApMarkupLineCmd.js.map +1 -1
  174. package/lib/command/markup/AcApMarkupPresenter.d.ts +16 -2
  175. package/lib/command/markup/AcApMarkupPresenter.d.ts.map +1 -1
  176. package/lib/command/markup/AcApMarkupPresenter.js +66 -14
  177. package/lib/command/markup/AcApMarkupPresenter.js.map +1 -1
  178. package/lib/command/markup/AcApMarkupRectCmd.d.ts +2 -3
  179. package/lib/command/markup/AcApMarkupRectCmd.d.ts.map +1 -1
  180. package/lib/command/markup/AcApMarkupRectCmd.js +8 -9
  181. package/lib/command/markup/AcApMarkupRectCmd.js.map +1 -1
  182. package/lib/command/markup/AcApMarkupShapeBuilder.d.ts +7 -4
  183. package/lib/command/markup/AcApMarkupShapeBuilder.d.ts.map +1 -1
  184. package/lib/command/markup/AcApMarkupShapeBuilder.js +24 -11
  185. package/lib/command/markup/AcApMarkupShapeBuilder.js.map +1 -1
  186. package/lib/command/markup/AcApMarkupShapeCallout.d.ts.map +1 -1
  187. package/lib/command/markup/AcApMarkupShapeCallout.js +61 -4
  188. package/lib/command/markup/AcApMarkupShapeCallout.js.map +1 -1
  189. package/lib/command/markup/AcApMarkupSidecar.d.ts.map +1 -1
  190. package/lib/command/markup/AcApMarkupSidecar.js +39 -5
  191. package/lib/command/markup/AcApMarkupSidecar.js.map +1 -1
  192. package/lib/command/markup/AcApMarkupStampCmd.d.ts +2 -3
  193. package/lib/command/markup/AcApMarkupStampCmd.d.ts.map +1 -1
  194. package/lib/command/markup/AcApMarkupStampCmd.js +6 -7
  195. package/lib/command/markup/AcApMarkupStampCmd.js.map +1 -1
  196. package/lib/command/markup/AcApMarkupTextCmd.d.ts +2 -3
  197. package/lib/command/markup/AcApMarkupTextCmd.d.ts.map +1 -1
  198. package/lib/command/markup/AcApMarkupTextCmd.js +13 -9
  199. package/lib/command/markup/AcApMarkupTextCmd.js.map +1 -1
  200. package/lib/command/markup/AcApMarkupTypes.d.ts +18 -2
  201. package/lib/command/markup/AcApMarkupTypes.d.ts.map +1 -1
  202. package/lib/command/markup/AcApMarkupUtil.d.ts +36 -7
  203. package/lib/command/markup/AcApMarkupUtil.d.ts.map +1 -1
  204. package/lib/command/markup/AcApMarkupUtil.js +149 -34
  205. package/lib/command/markup/AcApMarkupUtil.js.map +1 -1
  206. package/lib/command/markup/AcApRegisterMarkupCommands.d.ts +8 -0
  207. package/lib/command/markup/AcApRegisterMarkupCommands.d.ts.map +1 -0
  208. package/lib/command/markup/AcApRegisterMarkupCommands.js +35 -0
  209. package/lib/command/markup/AcApRegisterMarkupCommands.js.map +1 -0
  210. package/lib/command/markup/entity/AcApMarkupCalloutEntity.d.ts.map +1 -1
  211. package/lib/command/markup/entity/AcApMarkupCalloutEntity.js +16 -15
  212. package/lib/command/markup/entity/AcApMarkupCalloutEntity.js.map +1 -1
  213. package/lib/command/markup/entity/AcApMarkupEntity.d.ts +5 -1
  214. package/lib/command/markup/entity/AcApMarkupEntity.d.ts.map +1 -1
  215. package/lib/command/markup/entity/AcApMarkupEntity.js +19 -5
  216. package/lib/command/markup/entity/AcApMarkupEntity.js.map +1 -1
  217. package/lib/command/markup/entity/AcApMarkupEntityGrips.d.ts +8 -3
  218. package/lib/command/markup/entity/AcApMarkupEntityGrips.d.ts.map +1 -1
  219. package/lib/command/markup/entity/AcApMarkupEntityGrips.js +15 -7
  220. package/lib/command/markup/entity/AcApMarkupEntityGrips.js.map +1 -1
  221. package/lib/command/markup/entity/AcApMarkupHighlightEntity.d.ts.map +1 -1
  222. package/lib/command/markup/entity/AcApMarkupHighlightEntity.js +14 -12
  223. package/lib/command/markup/entity/AcApMarkupHighlightEntity.js.map +1 -1
  224. package/lib/command/markup/entity/AcApMarkupSegmentEntity.d.ts.map +1 -1
  225. package/lib/command/markup/entity/AcApMarkupSegmentEntity.js +8 -6
  226. package/lib/command/markup/entity/AcApMarkupSegmentEntity.js.map +1 -1
  227. package/lib/command/markup/entity/AcApMarkupShapeEntity.d.ts.map +1 -1
  228. package/lib/command/markup/entity/AcApMarkupShapeEntity.js +23 -21
  229. package/lib/command/markup/entity/AcApMarkupShapeEntity.js.map +1 -1
  230. package/lib/command/markup/entity/AcApMarkupStampEntity.d.ts.map +1 -1
  231. package/lib/command/markup/entity/AcApMarkupStampEntity.js +1 -0
  232. package/lib/command/markup/entity/AcApMarkupStampEntity.js.map +1 -1
  233. package/lib/command/markup/entity/AcApMarkupTextEntity.d.ts.map +1 -1
  234. package/lib/command/markup/entity/AcApMarkupTextEntity.js +1 -0
  235. package/lib/command/markup/entity/AcApMarkupTextEntity.js.map +1 -1
  236. package/lib/command/markup/index.d.ts +2 -0
  237. package/lib/command/markup/index.d.ts.map +1 -1
  238. package/lib/command/markup/index.js +2 -0
  239. package/lib/command/markup/index.js.map +1 -1
  240. package/lib/command/measure/AcApMeasureAngleArc.d.ts +27 -0
  241. package/lib/command/measure/AcApMeasureAngleArc.d.ts.map +1 -0
  242. package/lib/command/measure/AcApMeasureAngleArc.js +22 -0
  243. package/lib/command/measure/AcApMeasureAngleArc.js.map +1 -0
  244. package/lib/command/measure/AcApMeasureAngleCmd.d.ts +2 -3
  245. package/lib/command/measure/AcApMeasureAngleCmd.d.ts.map +1 -1
  246. package/lib/command/measure/AcApMeasureAngleCmd.js +46 -45
  247. package/lib/command/measure/AcApMeasureAngleCmd.js.map +1 -1
  248. package/lib/command/measure/AcApMeasureArcCmd.d.ts +2 -3
  249. package/lib/command/measure/AcApMeasureArcCmd.d.ts.map +1 -1
  250. package/lib/command/measure/AcApMeasureArcCmd.js +71 -67
  251. package/lib/command/measure/AcApMeasureArcCmd.js.map +1 -1
  252. package/lib/command/measure/AcApMeasureAreaCmd.d.ts +2 -3
  253. package/lib/command/measure/AcApMeasureAreaCmd.d.ts.map +1 -1
  254. package/lib/command/measure/AcApMeasureAreaCmd.js +102 -99
  255. package/lib/command/measure/AcApMeasureAreaCmd.js.map +1 -1
  256. package/lib/command/measure/AcApMeasureContinuousCmd.d.ts +44 -0
  257. package/lib/command/measure/AcApMeasureContinuousCmd.d.ts.map +1 -0
  258. package/lib/command/measure/AcApMeasureContinuousCmd.js +317 -0
  259. package/lib/command/measure/AcApMeasureContinuousCmd.js.map +1 -0
  260. package/lib/command/measure/AcApMeasureDistanceCmd.d.ts +3 -3
  261. package/lib/command/measure/AcApMeasureDistanceCmd.d.ts.map +1 -1
  262. package/lib/command/measure/AcApMeasureDistanceCmd.js +41 -37
  263. package/lib/command/measure/AcApMeasureDistanceCmd.js.map +1 -1
  264. package/lib/command/measure/AcApMeasureDrawCmd.d.ts +32 -0
  265. package/lib/command/measure/AcApMeasureDrawCmd.d.ts.map +1 -0
  266. package/lib/command/measure/AcApMeasureDrawCmd.js +56 -0
  267. package/lib/command/measure/AcApMeasureDrawCmd.js.map +1 -0
  268. package/lib/command/measure/AcApMeasurePointCmd.d.ts +2 -3
  269. package/lib/command/measure/AcApMeasurePointCmd.d.ts.map +1 -1
  270. package/lib/command/measure/AcApMeasurePointCmd.js +20 -23
  271. package/lib/command/measure/AcApMeasurePointCmd.js.map +1 -1
  272. package/lib/command/measure/AcApMeasurementGeometry.d.ts +19 -0
  273. package/lib/command/measure/AcApMeasurementGeometry.d.ts.map +1 -1
  274. package/lib/command/measure/AcApMeasurementGeometry.js +53 -3
  275. package/lib/command/measure/AcApMeasurementGeometry.js.map +1 -1
  276. package/lib/command/measure/AcApMeasurementHistory.d.ts.map +1 -1
  277. package/lib/command/measure/AcApMeasurementHistory.js +3 -1
  278. package/lib/command/measure/AcApMeasurementHistory.js.map +1 -1
  279. package/lib/command/measure/AcApMeasurementPlace.d.ts.map +1 -1
  280. package/lib/command/measure/AcApMeasurementPlace.js +22 -5
  281. package/lib/command/measure/AcApMeasurementPlace.js.map +1 -1
  282. package/lib/command/measure/AcApMeasurementRepublish.d.ts +35 -0
  283. package/lib/command/measure/AcApMeasurementRepublish.d.ts.map +1 -0
  284. package/lib/command/measure/AcApMeasurementRepublish.js +31 -0
  285. package/lib/command/measure/AcApMeasurementRepublish.js.map +1 -0
  286. package/lib/command/measure/AcApMeasurementSidecar.d.ts +2 -1
  287. package/lib/command/measure/AcApMeasurementSidecar.d.ts.map +1 -1
  288. package/lib/command/measure/AcApMeasurementSidecar.js +55 -10
  289. package/lib/command/measure/AcApMeasurementSidecar.js.map +1 -1
  290. package/lib/command/measure/AcApMeasurementStore.d.ts +45 -2
  291. package/lib/command/measure/AcApMeasurementStore.d.ts.map +1 -1
  292. package/lib/command/measure/AcApMeasurementStore.js +277 -33
  293. package/lib/command/measure/AcApMeasurementStore.js.map +1 -1
  294. package/lib/command/measure/AcApMeasurementTypes.d.ts +17 -1
  295. package/lib/command/measure/AcApMeasurementTypes.d.ts.map +1 -1
  296. package/lib/command/measure/AcApRegisterMeasureCommands.d.ts +8 -0
  297. package/lib/command/measure/AcApRegisterMeasureCommands.d.ts.map +1 -0
  298. package/lib/command/measure/AcApRegisterMeasureCommands.js +29 -0
  299. package/lib/command/measure/AcApRegisterMeasureCommands.js.map +1 -0
  300. package/lib/command/measure/entity/AcApMeasureAngleEntity.d.ts +3 -5
  301. package/lib/command/measure/entity/AcApMeasureAngleEntity.d.ts.map +1 -1
  302. package/lib/command/measure/entity/AcApMeasureAngleEntity.js +165 -56
  303. package/lib/command/measure/entity/AcApMeasureAngleEntity.js.map +1 -1
  304. package/lib/command/measure/entity/AcApMeasureArcEntity.d.ts +5 -8
  305. package/lib/command/measure/entity/AcApMeasureArcEntity.d.ts.map +1 -1
  306. package/lib/command/measure/entity/AcApMeasureArcEntity.js +251 -53
  307. package/lib/command/measure/entity/AcApMeasureArcEntity.js.map +1 -1
  308. package/lib/command/measure/entity/AcApMeasureAreaEntity.d.ts +4 -3
  309. package/lib/command/measure/entity/AcApMeasureAreaEntity.d.ts.map +1 -1
  310. package/lib/command/measure/entity/AcApMeasureAreaEntity.js +154 -28
  311. package/lib/command/measure/entity/AcApMeasureAreaEntity.js.map +1 -1
  312. package/lib/command/measure/entity/AcApMeasureDistanceEntity.d.ts +5 -3
  313. package/lib/command/measure/entity/AcApMeasureDistanceEntity.d.ts.map +1 -1
  314. package/lib/command/measure/entity/AcApMeasureDistanceEntity.js +180 -28
  315. package/lib/command/measure/entity/AcApMeasureDistanceEntity.js.map +1 -1
  316. package/lib/command/measure/entity/AcApMeasureDrawUtil.d.ts +20 -8
  317. package/lib/command/measure/entity/AcApMeasureDrawUtil.d.ts.map +1 -1
  318. package/lib/command/measure/entity/AcApMeasureDrawUtil.js +45 -19
  319. package/lib/command/measure/entity/AcApMeasureDrawUtil.js.map +1 -1
  320. package/lib/command/measure/entity/AcApMeasureEntity.d.ts +41 -6
  321. package/lib/command/measure/entity/AcApMeasureEntity.d.ts.map +1 -1
  322. package/lib/command/measure/entity/AcApMeasureEntity.js +48 -2
  323. package/lib/command/measure/entity/AcApMeasureEntity.js.map +1 -1
  324. package/lib/command/measure/entity/AcApMeasureEntityFactory.d.ts +2 -2
  325. package/lib/command/measure/entity/AcApMeasureEntityFactory.d.ts.map +1 -1
  326. package/lib/command/measure/entity/AcApMeasureEntityFactory.js +10 -3
  327. package/lib/command/measure/entity/AcApMeasureEntityFactory.js.map +1 -1
  328. package/lib/command/measure/entity/AcApMeasureEntityGrips.d.ts +33 -0
  329. package/lib/command/measure/entity/AcApMeasureEntityGrips.d.ts.map +1 -0
  330. package/lib/command/measure/entity/AcApMeasureEntityGrips.js +49 -0
  331. package/lib/command/measure/entity/AcApMeasureEntityGrips.js.map +1 -0
  332. package/lib/command/measure/entity/AcApMeasurePointEntity.d.ts +3 -2
  333. package/lib/command/measure/entity/AcApMeasurePointEntity.d.ts.map +1 -1
  334. package/lib/command/measure/entity/AcApMeasurePointEntity.js +130 -16
  335. package/lib/command/measure/entity/AcApMeasurePointEntity.js.map +1 -1
  336. package/lib/command/measure/entity/index.d.ts +1 -0
  337. package/lib/command/measure/entity/index.d.ts.map +1 -1
  338. package/lib/command/measure/entity/index.js +1 -0
  339. package/lib/command/measure/entity/index.js.map +1 -1
  340. package/lib/command/measure/index.d.ts +4 -0
  341. package/lib/command/measure/index.d.ts.map +1 -1
  342. package/lib/command/measure/index.js +4 -0
  343. package/lib/command/measure/index.js.map +1 -1
  344. package/lib/command/overlay/AcApHtmlLivePreview.d.ts +16 -4
  345. package/lib/command/overlay/AcApHtmlLivePreview.d.ts.map +1 -1
  346. package/lib/command/overlay/AcApHtmlLivePreview.js +42 -12
  347. package/lib/command/overlay/AcApHtmlLivePreview.js.map +1 -1
  348. package/lib/command/overlay/AcApOverlayDrawUtil.d.ts +113 -3
  349. package/lib/command/overlay/AcApOverlayDrawUtil.d.ts.map +1 -1
  350. package/lib/command/overlay/AcApOverlayDrawUtil.js +341 -7
  351. package/lib/command/overlay/AcApOverlayDrawUtil.js.map +1 -1
  352. package/lib/command/overlay/AcApOverlayGripHost.d.ts +19 -0
  353. package/lib/command/overlay/AcApOverlayGripHost.d.ts.map +1 -1
  354. package/lib/command/overlay/AcApOverlayGripHost.js +124 -6
  355. package/lib/command/overlay/AcApOverlayGripHost.js.map +1 -1
  356. package/lib/editor/command/AcEdCommand.d.ts +17 -0
  357. package/lib/editor/command/AcEdCommand.d.ts.map +1 -1
  358. package/lib/editor/command/AcEdCommand.js +81 -1
  359. package/lib/editor/command/AcEdCommand.js.map +1 -1
  360. package/lib/editor/command/AcEdCommandStack.d.ts +14 -3
  361. package/lib/editor/command/AcEdCommandStack.d.ts.map +1 -1
  362. package/lib/editor/command/AcEdCommandStack.js +39 -3
  363. package/lib/editor/command/AcEdCommandStack.js.map +1 -1
  364. package/lib/editor/command/AcEdSessionAccessory.d.ts +82 -0
  365. package/lib/editor/command/AcEdSessionAccessory.d.ts.map +1 -0
  366. package/lib/editor/command/AcEdSessionAccessory.js +15 -0
  367. package/lib/editor/command/AcEdSessionAccessory.js.map +1 -0
  368. package/lib/editor/command/AcEdSessionProviderRegistry.d.ts +42 -0
  369. package/lib/editor/command/AcEdSessionProviderRegistry.d.ts.map +1 -0
  370. package/lib/editor/command/AcEdSessionProviderRegistry.js +54 -0
  371. package/lib/editor/command/AcEdSessionProviderRegistry.js.map +1 -0
  372. package/lib/editor/command/index.d.ts +4 -0
  373. package/lib/editor/command/index.d.ts.map +1 -1
  374. package/lib/editor/command/index.js +3 -0
  375. package/lib/editor/command/index.js.map +1 -1
  376. package/lib/editor/global/AcEdUiColor.d.ts +10 -0
  377. package/lib/editor/global/AcEdUiColor.d.ts.map +1 -1
  378. package/lib/editor/global/AcEdUiColor.js +14 -0
  379. package/lib/editor/global/AcEdUiColor.js.map +1 -1
  380. package/lib/editor/global/AcEdUiLayout.d.ts +108 -0
  381. package/lib/editor/global/AcEdUiLayout.d.ts.map +1 -1
  382. package/lib/editor/global/AcEdUiLayout.js +143 -0
  383. package/lib/editor/global/AcEdUiLayout.js.map +1 -1
  384. package/lib/editor/global/AcEdUiTheme.d.ts +15 -3
  385. package/lib/editor/global/AcEdUiTheme.d.ts.map +1 -1
  386. package/lib/editor/global/AcEdUiTheme.js +113 -6
  387. package/lib/editor/global/AcEdUiTheme.js.map +1 -1
  388. package/lib/editor/grip/AcEdGripAppearance.d.ts +18 -0
  389. package/lib/editor/grip/AcEdGripAppearance.d.ts.map +1 -1
  390. package/lib/editor/grip/AcEdGripAppearance.js +23 -1
  391. package/lib/editor/grip/AcEdGripAppearance.js.map +1 -1
  392. package/lib/editor/grip/AcEdGripEditSession.js +2 -2
  393. package/lib/editor/grip/AcEdGripEditSession.js.map +1 -1
  394. package/lib/editor/grip/AcEdGripHandle.d.ts +1 -2
  395. package/lib/editor/grip/AcEdGripHandle.d.ts.map +1 -1
  396. package/lib/editor/grip/AcEdGripHandle.js +4 -13
  397. package/lib/editor/grip/AcEdGripHandle.js.map +1 -1
  398. package/lib/editor/grip/AcEdGripManager.d.ts +3 -1
  399. package/lib/editor/grip/AcEdGripManager.d.ts.map +1 -1
  400. package/lib/editor/grip/AcEdGripManager.js +30 -14
  401. package/lib/editor/grip/AcEdGripManager.js.map +1 -1
  402. package/lib/editor/grip/index.d.ts +1 -0
  403. package/lib/editor/grip/index.d.ts.map +1 -1
  404. package/lib/editor/grip/index.js +1 -0
  405. package/lib/editor/grip/index.js.map +1 -1
  406. package/lib/editor/input/AcEdDynamicInput.d.ts +15 -0
  407. package/lib/editor/input/AcEdDynamicInput.d.ts.map +1 -0
  408. package/lib/editor/input/AcEdDynamicInput.js +22 -0
  409. package/lib/editor/input/AcEdDynamicInput.js.map +1 -0
  410. package/lib/editor/input/AcEdOsnapCenterMarks.d.ts +19 -1
  411. package/lib/editor/input/AcEdOsnapCenterMarks.d.ts.map +1 -1
  412. package/lib/editor/input/AcEdOsnapCenterMarks.js +53 -9
  413. package/lib/editor/input/AcEdOsnapCenterMarks.js.map +1 -1
  414. package/lib/editor/input/AcEdOsnapResolver.d.ts.map +1 -1
  415. package/lib/editor/input/AcEdOsnapResolver.js +216 -35
  416. package/lib/editor/input/AcEdOsnapResolver.js.map +1 -1
  417. package/lib/editor/input/AcEditor.d.ts +14 -1
  418. package/lib/editor/input/AcEditor.d.ts.map +1 -1
  419. package/lib/editor/input/AcEditor.js +18 -2
  420. package/lib/editor/input/AcEditor.js.map +1 -1
  421. package/lib/editor/input/index.d.ts +1 -0
  422. package/lib/editor/input/index.d.ts.map +1 -1
  423. package/lib/editor/input/index.js +1 -0
  424. package/lib/editor/input/index.js.map +1 -1
  425. package/lib/editor/input/marker/AcEdOSnapMarkerManager.d.ts +12 -0
  426. package/lib/editor/input/marker/AcEdOSnapMarkerManager.d.ts.map +1 -1
  427. package/lib/editor/input/marker/AcEdOSnapMarkerManager.js +53 -18
  428. package/lib/editor/input/marker/AcEdOSnapMarkerManager.js.map +1 -1
  429. package/lib/editor/input/prompt/AcEdPromptPointOptions.d.ts +15 -0
  430. package/lib/editor/input/prompt/AcEdPromptPointOptions.d.ts.map +1 -1
  431. package/lib/editor/input/prompt/AcEdPromptPointOptions.js +24 -0
  432. package/lib/editor/input/prompt/AcEdPromptPointOptions.js.map +1 -1
  433. package/lib/editor/input/ui/AcEdCanvasTouchCalloutGuard.d.ts +31 -0
  434. package/lib/editor/input/ui/AcEdCanvasTouchCalloutGuard.d.ts.map +1 -0
  435. package/lib/editor/input/ui/AcEdCanvasTouchCalloutGuard.js +67 -0
  436. package/lib/editor/input/ui/AcEdCanvasTouchCalloutGuard.js.map +1 -0
  437. package/lib/editor/input/ui/AcEdDesktopSessionAccessoryChrome.d.ts +33 -0
  438. package/lib/editor/input/ui/AcEdDesktopSessionAccessoryChrome.d.ts.map +1 -0
  439. package/lib/editor/input/ui/AcEdDesktopSessionAccessoryChrome.js +85 -0
  440. package/lib/editor/input/ui/AcEdDesktopSessionAccessoryChrome.js.map +1 -0
  441. package/lib/editor/input/ui/AcEdEntityPickCancelChrome.d.ts +57 -0
  442. package/lib/editor/input/ui/AcEdEntityPickCancelChrome.d.ts.map +1 -0
  443. package/lib/editor/input/ui/AcEdEntityPickCancelChrome.js +104 -0
  444. package/lib/editor/input/ui/AcEdEntityPickCancelChrome.js.map +1 -0
  445. package/lib/editor/input/ui/AcEdFloatingInput.d.ts +146 -0
  446. package/lib/editor/input/ui/AcEdFloatingInput.d.ts.map +1 -1
  447. package/lib/editor/input/ui/AcEdFloatingInput.js +423 -13
  448. package/lib/editor/input/ui/AcEdFloatingInput.js.map +1 -1
  449. package/lib/editor/input/ui/AcEdFloatingInputTypes.d.ts +8 -1
  450. package/lib/editor/input/ui/AcEdFloatingInputTypes.d.ts.map +1 -1
  451. package/lib/editor/input/ui/AcEdFloatingMessage.d.ts.map +1 -1
  452. package/lib/editor/input/ui/AcEdFloatingMessage.js +2 -2
  453. package/lib/editor/input/ui/AcEdFloatingMessage.js.map +1 -1
  454. package/lib/editor/input/ui/AcEdInputManager.d.ts +100 -7
  455. package/lib/editor/input/ui/AcEdInputManager.d.ts.map +1 -1
  456. package/lib/editor/input/ui/AcEdInputManager.js +846 -165
  457. package/lib/editor/input/ui/AcEdInputManager.js.map +1 -1
  458. package/lib/editor/input/ui/AcEdInteractionStrategy.d.ts +94 -0
  459. package/lib/editor/input/ui/AcEdInteractionStrategy.d.ts.map +1 -0
  460. package/lib/editor/input/ui/AcEdInteractionStrategy.js +60 -0
  461. package/lib/editor/input/ui/AcEdInteractionStrategy.js.map +1 -0
  462. package/lib/editor/input/ui/AcEdMobileBoxGesture.d.ts +52 -0
  463. package/lib/editor/input/ui/AcEdMobileBoxGesture.d.ts.map +1 -0
  464. package/lib/editor/input/ui/AcEdMobileBoxGesture.js +203 -0
  465. package/lib/editor/input/ui/AcEdMobileBoxGesture.js.map +1 -0
  466. package/lib/editor/input/ui/AcEdMobileCommandChrome.d.ts +103 -0
  467. package/lib/editor/input/ui/AcEdMobileCommandChrome.d.ts.map +1 -0
  468. package/lib/editor/input/ui/AcEdMobileCommandChrome.js +157 -0
  469. package/lib/editor/input/ui/AcEdMobileCommandChrome.js.map +1 -0
  470. package/lib/editor/input/ui/AcEdMobileSessionMetrics.d.ts +29 -0
  471. package/lib/editor/input/ui/AcEdMobileSessionMetrics.d.ts.map +1 -0
  472. package/lib/editor/input/ui/AcEdMobileSessionMetrics.js +37 -0
  473. package/lib/editor/input/ui/AcEdMobileSessionMetrics.js.map +1 -0
  474. package/lib/editor/input/ui/AcEdMobileSnapLoupe.d.ts +45 -0
  475. package/lib/editor/input/ui/AcEdMobileSnapLoupe.d.ts.map +1 -0
  476. package/lib/editor/input/ui/AcEdMobileSnapLoupe.js +63 -0
  477. package/lib/editor/input/ui/AcEdMobileSnapLoupe.js.map +1 -0
  478. package/lib/editor/input/ui/AcEdSessionAccessoryController.d.ts +121 -0
  479. package/lib/editor/input/ui/AcEdSessionAccessoryController.d.ts.map +1 -0
  480. package/lib/editor/input/ui/AcEdSessionAccessoryController.js +306 -0
  481. package/lib/editor/input/ui/AcEdSessionAccessoryController.js.map +1 -0
  482. package/lib/editor/input/ui/AcEdSimulatedMouseCursor.d.ts +28 -0
  483. package/lib/editor/input/ui/AcEdSimulatedMouseCursor.d.ts.map +1 -0
  484. package/lib/editor/input/ui/AcEdSimulatedMouseCursor.js +86 -0
  485. package/lib/editor/input/ui/AcEdSimulatedMouseCursor.js.map +1 -0
  486. package/lib/editor/input/ui/AcEdSnapLoupe.d.ts +60 -0
  487. package/lib/editor/input/ui/AcEdSnapLoupe.d.ts.map +1 -0
  488. package/lib/editor/input/ui/AcEdSnapLoupe.js +109 -0
  489. package/lib/editor/input/ui/AcEdSnapLoupe.js.map +1 -0
  490. package/lib/editor/input/ui/AcEdSnapLoupeMath.d.ts +47 -0
  491. package/lib/editor/input/ui/AcEdSnapLoupeMath.d.ts.map +1 -0
  492. package/lib/editor/input/ui/AcEdSnapLoupeMath.js +50 -0
  493. package/lib/editor/input/ui/AcEdSnapLoupeMath.js.map +1 -0
  494. package/lib/editor/input/ui/AcEdTouchPickStrategy.d.ts +97 -0
  495. package/lib/editor/input/ui/AcEdTouchPickStrategy.d.ts.map +1 -0
  496. package/lib/editor/input/ui/AcEdTouchPickStrategy.js +74 -0
  497. package/lib/editor/input/ui/AcEdTouchPickStrategy.js.map +1 -0
  498. package/lib/editor/input/ui/AcEdTouchPointSession.d.ts +198 -0
  499. package/lib/editor/input/ui/AcEdTouchPointSession.d.ts.map +1 -0
  500. package/lib/editor/input/ui/AcEdTouchPointSession.js +329 -0
  501. package/lib/editor/input/ui/AcEdTouchPointSession.js.map +1 -0
  502. package/lib/editor/input/ui/AcEdTouchPointTiming.d.ts +18 -0
  503. package/lib/editor/input/ui/AcEdTouchPointTiming.d.ts.map +1 -0
  504. package/lib/editor/input/ui/AcEdTouchPointTiming.js +18 -0
  505. package/lib/editor/input/ui/AcEdTouchPointTiming.js.map +1 -0
  506. package/lib/editor/input/ui/index.d.ts +14 -0
  507. package/lib/editor/input/ui/index.d.ts.map +1 -1
  508. package/lib/editor/input/ui/index.js +14 -0
  509. package/lib/editor/input/ui/index.js.map +1 -1
  510. package/lib/editor/view/AcEdBaseView.d.ts +144 -39
  511. package/lib/editor/view/AcEdBaseView.d.ts.map +1 -1
  512. package/lib/editor/view/AcEdBaseView.js +200 -49
  513. package/lib/editor/view/AcEdBaseView.js.map +1 -1
  514. package/lib/editor/view/AcEdSelectionBoxIntersect.d.ts +36 -0
  515. package/lib/editor/view/AcEdSelectionBoxIntersect.d.ts.map +1 -0
  516. package/lib/editor/view/AcEdSelectionBoxIntersect.js +113 -0
  517. package/lib/editor/view/AcEdSelectionBoxIntersect.js.map +1 -0
  518. package/lib/editor/view/AcEdViewMode.d.ts +34 -0
  519. package/lib/editor/view/AcEdViewMode.d.ts.map +1 -0
  520. package/lib/editor/view/AcEdViewMode.js +35 -0
  521. package/lib/editor/view/AcEdViewMode.js.map +1 -0
  522. package/lib/editor/view/index.d.ts +2 -0
  523. package/lib/editor/view/index.d.ts.map +1 -1
  524. package/lib/editor/view/index.js +2 -0
  525. package/lib/editor/view/index.js.map +1 -1
  526. package/lib/i18n/AcApI18n.d.ts +2 -1
  527. package/lib/i18n/AcApI18n.d.ts.map +1 -1
  528. package/lib/i18n/AcApI18n.js +5 -2
  529. package/lib/i18n/AcApI18n.js.map +1 -1
  530. package/lib/i18n/ar/command.d.ts +18 -0
  531. package/lib/i18n/ar/command.d.ts.map +1 -1
  532. package/lib/i18n/ar/command.js +1 -1
  533. package/lib/i18n/ar/command.js.map +1 -1
  534. package/lib/i18n/ar/jig.d.ts +67 -0
  535. package/lib/i18n/ar/jig.d.ts.map +1 -1
  536. package/lib/i18n/ar/jig.js +31 -3
  537. package/lib/i18n/ar/jig.js.map +1 -1
  538. package/lib/i18n/ar/main.d.ts +100 -1
  539. package/lib/i18n/ar/main.d.ts.map +1 -1
  540. package/lib/i18n/ar/main.js +101 -2
  541. package/lib/i18n/ar/main.js.map +1 -1
  542. package/lib/i18n/cs/command.d.ts +15 -0
  543. package/lib/i18n/cs/command.d.ts.map +1 -1
  544. package/lib/i18n/cs/command.js +15 -0
  545. package/lib/i18n/cs/command.js.map +1 -1
  546. package/lib/i18n/cs/jig.d.ts +67 -0
  547. package/lib/i18n/cs/jig.d.ts.map +1 -1
  548. package/lib/i18n/cs/jig.js +67 -0
  549. package/lib/i18n/cs/jig.js.map +1 -1
  550. package/lib/i18n/cs/main.d.ts +100 -1
  551. package/lib/i18n/cs/main.d.ts.map +1 -1
  552. package/lib/i18n/cs/main.js +101 -2
  553. package/lib/i18n/cs/main.js.map +1 -1
  554. package/lib/i18n/en/command.d.ts +18 -0
  555. package/lib/i18n/en/command.d.ts.map +1 -1
  556. package/lib/i18n/en/command.js +18 -0
  557. package/lib/i18n/en/command.js.map +1 -1
  558. package/lib/i18n/en/jig.d.ts +67 -0
  559. package/lib/i18n/en/jig.d.ts.map +1 -1
  560. package/lib/i18n/en/jig.js +67 -0
  561. package/lib/i18n/en/jig.js.map +1 -1
  562. package/lib/i18n/en/main.d.ts +100 -1
  563. package/lib/i18n/en/main.d.ts.map +1 -1
  564. package/lib/i18n/en/main.js +101 -2
  565. package/lib/i18n/en/main.js.map +1 -1
  566. package/lib/i18n/index.d.ts +2 -2
  567. package/lib/i18n/index.d.ts.map +1 -1
  568. package/lib/i18n/index.js.map +1 -1
  569. package/lib/i18n/tr/command.d.ts +15 -0
  570. package/lib/i18n/tr/command.d.ts.map +1 -1
  571. package/lib/i18n/tr/command.js +15 -0
  572. package/lib/i18n/tr/command.js.map +1 -1
  573. package/lib/i18n/tr/jig.d.ts +67 -0
  574. package/lib/i18n/tr/jig.d.ts.map +1 -1
  575. package/lib/i18n/tr/jig.js +67 -0
  576. package/lib/i18n/tr/jig.js.map +1 -1
  577. package/lib/i18n/tr/main.d.ts +100 -1
  578. package/lib/i18n/tr/main.d.ts.map +1 -1
  579. package/lib/i18n/tr/main.js +101 -2
  580. package/lib/i18n/tr/main.js.map +1 -1
  581. package/lib/i18n/zh/command.d.ts +18 -0
  582. package/lib/i18n/zh/command.d.ts.map +1 -1
  583. package/lib/i18n/zh/command.js +18 -0
  584. package/lib/i18n/zh/command.js.map +1 -1
  585. package/lib/i18n/zh/jig.d.ts +67 -0
  586. package/lib/i18n/zh/jig.d.ts.map +1 -1
  587. package/lib/i18n/zh/jig.js +67 -0
  588. package/lib/i18n/zh/jig.js.map +1 -1
  589. package/lib/i18n/zh/main.d.ts +100 -1
  590. package/lib/i18n/zh/main.d.ts.map +1 -1
  591. package/lib/i18n/zh/main.js +102 -3
  592. package/lib/i18n/zh/main.js.map +1 -1
  593. package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.d.ts +6 -0
  594. package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.d.ts.map +1 -1
  595. package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.js +10 -0
  596. package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.js.map +1 -1
  597. package/lib/spatialIndex/AcTrLinearSpatialIndex.d.ts +4 -0
  598. package/lib/spatialIndex/AcTrLinearSpatialIndex.d.ts.map +1 -1
  599. package/lib/spatialIndex/AcTrLinearSpatialIndex.js +9 -0
  600. package/lib/spatialIndex/AcTrLinearSpatialIndex.js.map +1 -1
  601. package/lib/spatialIndex/AcTrRBushSpatialIndex.d.ts +4 -0
  602. package/lib/spatialIndex/AcTrRBushSpatialIndex.d.ts.map +1 -1
  603. package/lib/spatialIndex/AcTrRBushSpatialIndex.js +20 -4
  604. package/lib/spatialIndex/AcTrRBushSpatialIndex.js.map +1 -1
  605. package/lib/ui/AcUiAciColorDialog.d.ts +57 -0
  606. package/lib/ui/AcUiAciColorDialog.d.ts.map +1 -0
  607. package/lib/ui/AcUiAciColorDialog.js +91 -0
  608. package/lib/ui/AcUiAciColorDialog.js.map +1 -0
  609. package/lib/ui/AcUiAciPaletteUi.d.ts +118 -0
  610. package/lib/ui/AcUiAciPaletteUi.d.ts.map +1 -0
  611. package/lib/ui/AcUiAciPaletteUi.js +521 -0
  612. package/lib/ui/AcUiAciPaletteUi.js.map +1 -0
  613. package/lib/ui/AcUiDefaultNotificationUi.d.ts +167 -0
  614. package/lib/ui/AcUiDefaultNotificationUi.d.ts.map +1 -0
  615. package/lib/ui/AcUiDefaultNotificationUi.js +603 -0
  616. package/lib/ui/AcUiDefaultNotificationUi.js.map +1 -0
  617. package/lib/ui/AcUiDialog.d.ts +38 -2
  618. package/lib/ui/AcUiDialog.d.ts.map +1 -1
  619. package/lib/ui/AcUiDialog.js +45 -16
  620. package/lib/ui/AcUiDialog.js.map +1 -1
  621. package/lib/ui/AcUiDrawStyle.d.ts +60 -0
  622. package/lib/ui/AcUiDrawStyle.d.ts.map +1 -0
  623. package/lib/ui/AcUiDrawStyle.js +95 -0
  624. package/lib/ui/AcUiDrawStyle.js.map +1 -0
  625. package/lib/ui/AcUiDrawStyleSessionAccessory.d.ts +108 -0
  626. package/lib/ui/AcUiDrawStyleSessionAccessory.d.ts.map +1 -0
  627. package/lib/ui/AcUiDrawStyleSessionAccessory.js +459 -0
  628. package/lib/ui/AcUiDrawStyleSessionAccessory.js.map +1 -0
  629. package/lib/ui/AcUiFullscreenPanel.d.ts +89 -0
  630. package/lib/ui/AcUiFullscreenPanel.d.ts.map +1 -0
  631. package/lib/ui/AcUiFullscreenPanel.js +224 -0
  632. package/lib/ui/AcUiFullscreenPanel.js.map +1 -0
  633. package/lib/ui/AcUiHelpPanel.d.ts +49 -0
  634. package/lib/ui/AcUiHelpPanel.d.ts.map +1 -0
  635. package/lib/ui/AcUiHelpPanel.js +124 -0
  636. package/lib/ui/AcUiHelpPanel.js.map +1 -0
  637. package/lib/ui/AcUiMobileSessionPanel.d.ts +239 -0
  638. package/lib/ui/AcUiMobileSessionPanel.d.ts.map +1 -0
  639. package/lib/ui/AcUiMobileSessionPanel.js +822 -0
  640. package/lib/ui/AcUiMobileSessionPanel.js.map +1 -0
  641. package/lib/ui/AcUiShortCutToolbar.d.ts +160 -0
  642. package/lib/ui/AcUiShortCutToolbar.d.ts.map +1 -0
  643. package/lib/ui/AcUiShortCutToolbar.js +318 -0
  644. package/lib/ui/AcUiShortCutToolbar.js.map +1 -0
  645. package/lib/ui/AcUiSimpleToolbar.d.ts +110 -0
  646. package/lib/ui/AcUiSimpleToolbar.d.ts.map +1 -0
  647. package/lib/ui/AcUiSimpleToolbar.js +431 -0
  648. package/lib/ui/AcUiSimpleToolbar.js.map +1 -0
  649. package/lib/ui/AcUiTextHeightDialog.d.ts +85 -0
  650. package/lib/ui/AcUiTextHeightDialog.d.ts.map +1 -0
  651. package/lib/ui/AcUiTextHeightDialog.js +205 -0
  652. package/lib/ui/AcUiTextHeightDialog.js.map +1 -0
  653. package/lib/ui/AcUiTextHeightDialogHelpers.d.ts +54 -0
  654. package/lib/ui/AcUiTextHeightDialogHelpers.d.ts.map +1 -0
  655. package/lib/ui/AcUiTextHeightDialogHelpers.js +128 -0
  656. package/lib/ui/AcUiTextHeightDialogHelpers.js.map +1 -0
  657. package/lib/ui/AcUiTouchPointTutorialDialog.d.ts +18 -0
  658. package/lib/ui/AcUiTouchPointTutorialDialog.d.ts.map +1 -0
  659. package/lib/ui/AcUiTouchPointTutorialDialog.js +58 -0
  660. package/lib/ui/AcUiTouchPointTutorialDialog.js.map +1 -0
  661. package/lib/ui/icons.d.ts +54 -27
  662. package/lib/ui/icons.d.ts.map +1 -1
  663. package/lib/ui/icons.js +79 -25
  664. package/lib/ui/icons.js.map +1 -1
  665. package/lib/ui/index.d.ts +15 -2
  666. package/lib/ui/index.d.ts.map +1 -1
  667. package/lib/ui/index.js +15 -2
  668. package/lib/ui/index.js.map +1 -1
  669. package/lib/ui/toolbar/AcUiDropdownMenu.d.ts +48 -0
  670. package/lib/ui/toolbar/AcUiDropdownMenu.d.ts.map +1 -0
  671. package/lib/ui/toolbar/AcUiDropdownMenu.js +116 -0
  672. package/lib/ui/toolbar/AcUiDropdownMenu.js.map +1 -0
  673. package/lib/ui/toolbar/AcUiSubToolbar.d.ts +125 -0
  674. package/lib/ui/toolbar/AcUiSubToolbar.d.ts.map +1 -0
  675. package/lib/ui/toolbar/AcUiSubToolbar.js +625 -0
  676. package/lib/ui/toolbar/AcUiSubToolbar.js.map +1 -0
  677. package/lib/ui/toolbar/AcUiToolbar.d.ts +446 -0
  678. package/lib/ui/toolbar/AcUiToolbar.d.ts.map +1 -0
  679. package/lib/ui/toolbar/AcUiToolbar.js +1550 -0
  680. package/lib/ui/toolbar/AcUiToolbar.js.map +1 -0
  681. package/lib/ui/toolbar/AcUiToolbarStyles.d.ts +20 -0
  682. package/lib/ui/toolbar/AcUiToolbarStyles.d.ts.map +1 -0
  683. package/lib/ui/toolbar/AcUiToolbarStyles.js +34 -0
  684. package/lib/ui/toolbar/AcUiToolbarStyles.js.map +1 -0
  685. package/lib/ui/toolbar/acuiWrapPackLayout.d.ts +19 -0
  686. package/lib/ui/toolbar/acuiWrapPackLayout.d.ts.map +1 -0
  687. package/lib/ui/toolbar/acuiWrapPackLayout.js +36 -0
  688. package/lib/ui/toolbar/acuiWrapPackLayout.js.map +1 -0
  689. package/lib/ui/toolbar/index.d.ts +19 -0
  690. package/lib/ui/toolbar/index.d.ts.map +1 -0
  691. package/lib/ui/toolbar/index.js +15 -0
  692. package/lib/ui/toolbar/index.js.map +1 -0
  693. package/lib/ui/toolbar/resolveToolbarChrome.d.ts +14 -0
  694. package/lib/ui/toolbar/resolveToolbarChrome.d.ts.map +1 -0
  695. package/lib/ui/toolbar/resolveToolbarChrome.js +35 -0
  696. package/lib/ui/toolbar/resolveToolbarChrome.js.map +1 -0
  697. package/lib/ui/toolbar/resolveToolbarItemState.d.ts +63 -0
  698. package/lib/ui/toolbar/resolveToolbarItemState.d.ts.map +1 -0
  699. package/lib/ui/toolbar/resolveToolbarItemState.js +171 -0
  700. package/lib/ui/toolbar/resolveToolbarItemState.js.map +1 -0
  701. package/lib/ui/toolbar/toolbarItemUtils.d.ts +62 -0
  702. package/lib/ui/toolbar/toolbarItemUtils.d.ts.map +1 -0
  703. package/lib/ui/toolbar/toolbarItemUtils.js +184 -0
  704. package/lib/ui/toolbar/toolbarItemUtils.js.map +1 -0
  705. package/lib/ui/toolbar/types.d.ts +268 -0
  706. package/lib/ui/toolbar/types.d.ts.map +1 -0
  707. package/lib/ui/toolbar/types.js +8 -0
  708. package/lib/ui/toolbar/types.js.map +1 -0
  709. package/lib/ui/touch-point-tutorial.d.ts +64 -0
  710. package/lib/ui/touch-point-tutorial.d.ts.map +1 -0
  711. package/lib/ui/touch-point-tutorial.js +271 -0
  712. package/lib/ui/touch-point-tutorial.js.map +1 -0
  713. package/lib/ui-html-entry.d.ts +38 -0
  714. package/lib/ui-html-entry.d.ts.map +1 -0
  715. package/lib/ui-html-entry.js +28 -0
  716. package/lib/ui-html-entry.js.map +1 -0
  717. package/lib/util/AcApAciPalette.d.ts +7 -0
  718. package/lib/util/AcApAciPalette.d.ts.map +1 -0
  719. package/lib/util/AcApAciPalette.js +51 -0
  720. package/lib/util/AcApAciPalette.js.map +1 -0
  721. package/lib/util/AcApAnalyzeUnsupportedDrawing.d.ts +53 -0
  722. package/lib/util/AcApAnalyzeUnsupportedDrawing.d.ts.map +1 -0
  723. package/lib/util/AcApAnalyzeUnsupportedDrawing.js +164 -0
  724. package/lib/util/AcApAnalyzeUnsupportedDrawing.js.map +1 -0
  725. package/lib/util/AcApCommandUtil.d.ts +15 -0
  726. package/lib/util/AcApCommandUtil.d.ts.map +1 -0
  727. package/lib/util/AcApCommandUtil.js +38 -0
  728. package/lib/util/AcApCommandUtil.js.map +1 -0
  729. package/lib/util/AcApCssColor.d.ts +10 -0
  730. package/lib/util/AcApCssColor.d.ts.map +1 -1
  731. package/lib/util/AcApCssColor.js +52 -0
  732. package/lib/util/AcApCssColor.js.map +1 -1
  733. package/lib/util/AcApFormatFontMissedMessage.d.ts +32 -0
  734. package/lib/util/AcApFormatFontMissedMessage.d.ts.map +1 -0
  735. package/lib/util/AcApFormatFontMissedMessage.js +46 -0
  736. package/lib/util/AcApFormatFontMissedMessage.js.map +1 -0
  737. package/lib/util/AcApFormatUnsupportedEntitiesMessage.d.ts +44 -0
  738. package/lib/util/AcApFormatUnsupportedEntitiesMessage.d.ts.map +1 -0
  739. package/lib/util/AcApFormatUnsupportedEntitiesMessage.js +105 -0
  740. package/lib/util/AcApFormatUnsupportedEntitiesMessage.js.map +1 -0
  741. package/lib/util/AcApMeasurementUnits.d.ts +13 -1
  742. package/lib/util/AcApMeasurementUnits.d.ts.map +1 -1
  743. package/lib/util/AcApMeasurementUnits.js +144 -10
  744. package/lib/util/AcApMeasurementUnits.js.map +1 -1
  745. package/lib/util/AcApMeasurementUtil.d.ts +30 -9
  746. package/lib/util/AcApMeasurementUtil.d.ts.map +1 -1
  747. package/lib/util/AcApMeasurementUtil.js +70 -40
  748. package/lib/util/AcApMeasurementUtil.js.map +1 -1
  749. package/lib/util/AcApOpenFileErrorMessage.d.ts +25 -0
  750. package/lib/util/AcApOpenFileErrorMessage.d.ts.map +1 -0
  751. package/lib/util/AcApOpenFileErrorMessage.js +121 -0
  752. package/lib/util/AcApOpenFileErrorMessage.js.map +1 -0
  753. package/lib/util/index.d.ts +6 -0
  754. package/lib/util/index.d.ts.map +1 -1
  755. package/lib/util/index.js +6 -0
  756. package/lib/util/index.js.map +1 -1
  757. package/lib/view/AcApReadingMode.d.ts +52 -0
  758. package/lib/view/AcApReadingMode.d.ts.map +1 -0
  759. package/lib/view/AcApReadingMode.js +81 -0
  760. package/lib/view/AcApReadingMode.js.map +1 -0
  761. package/lib/view/AcEdViewKeyHandler.d.ts.map +1 -1
  762. package/lib/view/AcEdViewKeyHandler.js +6 -1
  763. package/lib/view/AcEdViewKeyHandler.js.map +1 -1
  764. package/lib/view/AcTrInheritedLayerMaterialMapper.d.ts +6 -1
  765. package/lib/view/AcTrInheritedLayerMaterialMapper.d.ts.map +1 -1
  766. package/lib/view/AcTrInheritedLayerMaterialMapper.js +9 -1
  767. package/lib/view/AcTrInheritedLayerMaterialMapper.js.map +1 -1
  768. package/lib/view/AcTrLayer.d.ts +13 -1
  769. package/lib/view/AcTrLayer.d.ts.map +1 -1
  770. package/lib/view/AcTrLayer.js +28 -11
  771. package/lib/view/AcTrLayer.js.map +1 -1
  772. package/lib/view/AcTrLayout.d.ts +17 -2
  773. package/lib/view/AcTrLayout.d.ts.map +1 -1
  774. package/lib/view/AcTrLayout.js +67 -15
  775. package/lib/view/AcTrLayout.js.map +1 -1
  776. package/lib/view/AcTrLayoutView.d.ts +25 -1
  777. package/lib/view/AcTrLayoutView.d.ts.map +1 -1
  778. package/lib/view/AcTrLayoutView.js +62 -1
  779. package/lib/view/AcTrLayoutView.js.map +1 -1
  780. package/lib/view/AcTrScene.d.ts +4 -0
  781. package/lib/view/AcTrScene.d.ts.map +1 -1
  782. package/lib/view/AcTrScene.js +6 -0
  783. package/lib/view/AcTrScene.js.map +1 -1
  784. package/lib/view/AcTrView2d.d.ts +128 -15
  785. package/lib/view/AcTrView2d.d.ts.map +1 -1
  786. package/lib/view/AcTrView2d.js +634 -149
  787. package/lib/view/AcTrView2d.js.map +1 -1
  788. package/lib/view/AcTrViewSessionState.d.ts +6 -0
  789. package/lib/view/AcTrViewSessionState.d.ts.map +1 -1
  790. package/lib/view/index.d.ts +1 -0
  791. package/lib/view/index.d.ts.map +1 -1
  792. package/lib/view/index.js +1 -0
  793. package/lib/view/index.js.map +1 -1
  794. package/package.json +8 -8
  795. package/src/ui/icons.ts +387 -293
  796. package/lib/app/AcDbOpenDatabaseOptions.d.ts +0 -63
  797. package/lib/app/AcDbOpenDatabaseOptions.d.ts.map +0 -1
  798. package/lib/app/AcDbOpenDatabaseOptions.js.map +0 -1
  799. package/lib/command/convert/AcApPngConvertor.d.ts.map +0 -1
  800. package/lib/command/convert/AcApPngConvertor.js.map +0 -1
  801. package/lib/ui/AcApDrawStyle.d.ts +0 -81
  802. package/lib/ui/AcApDrawStyle.d.ts.map +0 -1
  803. package/lib/ui/AcApDrawStyle.js +0 -170
  804. package/lib/ui/AcApDrawStyle.js.map +0 -1
  805. package/lib/ui/AcApDrawStyleToolbar.d.ts +0 -129
  806. package/lib/ui/AcApDrawStyleToolbar.d.ts.map +0 -1
  807. package/lib/ui/AcApDrawStyleToolbar.js +0 -607
  808. package/lib/ui/AcApDrawStyleToolbar.js.map +0 -1
@@ -0,0 +1,1550 @@
1
+ /**
2
+ * Plain-DOM floating toolbar with sub-toolbars, dropdown menus, and toggles.
3
+ *
4
+ * Document open / open-mode state is injected via {@link AcUiToolbar.setDocState}
5
+ * or {@link acapBindToolbarDocState} — this module never imports DocManager.
6
+ *
7
+ * @module AcUiToolbar
8
+ * @packageDocumentation
9
+ */
10
+ var __values = (this && this.__values) || function(o) {
11
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
12
+ if (m) return m.call(o);
13
+ if (o && typeof o.length === "number") return {
14
+ next: function () {
15
+ if (o && i >= o.length) o = void 0;
16
+ return { value: o && o[i++], done: !o };
17
+ }
18
+ };
19
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
20
+ };
21
+ var __read = (this && this.__read) || function (o, n) {
22
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
23
+ if (!m) return o;
24
+ var i = m.call(o), r, ar = [], e;
25
+ try {
26
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
27
+ }
28
+ catch (error) { e = { error: error }; }
29
+ finally {
30
+ try {
31
+ if (r && !r.done && (m = i["return"])) m.call(i);
32
+ }
33
+ finally { if (e) throw e.error; }
34
+ }
35
+ return ar;
36
+ };
37
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
38
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
39
+ if (ar || !(i in from)) {
40
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
41
+ ar[i] = from[i];
42
+ }
43
+ }
44
+ return to.concat(ar || Array.prototype.slice.call(from));
45
+ };
46
+ import { AcEdOpenMode } from '../../editor/view/AcEdOpenMode';
47
+ import { createIconElement, ICON_CHEVRON_DOWN, ICON_CHEVRON_LEFT, ICON_CHEVRON_RIGHT, ICON_CHEVRON_UP, ICON_MORE } from '../icons';
48
+ import { AcUiDropdownMenu } from './AcUiDropdownMenu';
49
+ import { AcUiSubToolbar } from './AcUiSubToolbar';
50
+ import { acuiEnsureToolbarStyles } from './AcUiToolbarStyles';
51
+ import { acuiResolveToolbarChrome } from './resolveToolbarChrome';
52
+ import { acuiFilterVisibleToolbarItems, acuiIsToolbarItemDisabled, acuiItemRequiresDocument, acuiResolveEffectiveToolbarItem, acuiResolveParentToolbarDisplay } from './resolveToolbarItemState';
53
+ import { acuiIsDynamicToolbarChildren, acuiIsToolbarChildrenStrip, acuiIsToolbarSeparatorItem, acuiResolveToolbarChildrenUi } from './toolbarItemUtils';
54
+ var AcUiToolbar = /** @class */ (function () {
55
+ /**
56
+ * @param options - Host, placement, items, i18n, and command callback.
57
+ */
58
+ function AcUiToolbar(options) {
59
+ var _this = this;
60
+ var _a, _b, _c, _d, _e, _f, _g;
61
+ this.options = options;
62
+ /** Whether the toolbar is globally disabled during document open. */
63
+ this.isDisabled = false;
64
+ /** Current document open mode used for item visibility. */
65
+ this.openMode = AcEdOpenMode.Read;
66
+ /** Whether an active document is loaded. */
67
+ this.hasDocument = false;
68
+ /** Runtime submenu selection for parents with {@link AcUiToolbarItem.childIcon} `'selected'`. */
69
+ this.selectedChildByParent = new Map();
70
+ /** Whether the toolbar root is shown. */
71
+ this.visible = true;
72
+ /** Items currently hidden behind the overflow menu. */
73
+ this.overflowItems = [];
74
+ /** Whether menu overflow is showing the ⋯ button (used for vertical positioning). */
75
+ this.overflowMenuActive = false;
76
+ /** Toolbar item nodes rendered in the last {@link renderButtons} pass. */
77
+ this.renderedEntries = [];
78
+ acuiEnsureToolbarStyles();
79
+ this.mountHost = options.host;
80
+ this.themeHost = (_a = options.themeHost) !== null && _a !== void 0 ? _a : options.host;
81
+ this.edgeOffset = (_b = options.edgeOffset) !== null && _b !== void 0 ? _b : 8;
82
+ this.sideOffset = (_c = options.sideOffset) !== null && _c !== void 0 ? _c : 0;
83
+ this.showBorder = (_d = options.showBorder) !== null && _d !== void 0 ? _d : true;
84
+ this.showButtonBorder = (_e = options.showButtonBorder) !== null && _e !== void 0 ? _e : false;
85
+ this.showSeparators = (_f = options.showSeparators) !== null && _f !== void 0 ? _f : true;
86
+ this.showChildrenIndicator = (_g = options.showChildrenIndicator) !== null && _g !== void 0 ? _g : true;
87
+ this.inCanvasParent = options.inCanvasParent === true;
88
+ this.items = options.items;
89
+ this.collapsed =
90
+ Boolean(options.collapsible) && Boolean(options.defaultCollapsed);
91
+ if (options.overflow === undefined) {
92
+ options.overflow = 'menu';
93
+ }
94
+ this.seedSelectedChildren(options.items);
95
+ this.ensureMountHostLayout();
96
+ this.root = document.createElement('div');
97
+ this.syncRootClasses();
98
+ this.root.setAttribute('role', 'toolbar');
99
+ this.overflowButton = document.createElement('button');
100
+ this.overflowButton.type = 'button';
101
+ this.overflowButton.className =
102
+ 'ml-ex-ui-toolbar-btn ml-ex-ui-toolbar-overflow-btn';
103
+ this.overflowButton.dataset.toolbarItemId = 'toolbar-overflow';
104
+ this.overflowButton.hidden = true;
105
+ this.overflowButton.appendChild(createIconElement(ICON_MORE));
106
+ this.overflowButton.addEventListener('click', function (event) {
107
+ event.stopPropagation();
108
+ if (_this.overflowButton.hidden)
109
+ return;
110
+ _this.toggleOverflowMenu();
111
+ });
112
+ this.mountHost.appendChild(this.root);
113
+ this.ensureInParentLayout();
114
+ this.setupResizeObserver();
115
+ if (options.docState) {
116
+ this.setDocState(options.docState);
117
+ }
118
+ else {
119
+ this.renderButtons();
120
+ }
121
+ }
122
+ /**
123
+ * Updates document-related enablement and open-mode filtering.
124
+ *
125
+ * Hosts with DocManager should use {@link acapBindToolbarDocState}. Offline
126
+ * HTML / custom hosts call this directly.
127
+ *
128
+ * @param state - Partial document state to merge.
129
+ */
130
+ AcUiToolbar.prototype.setDocState = function (state) {
131
+ if (state.hasDocument !== undefined) {
132
+ this.hasDocument = state.hasDocument;
133
+ }
134
+ if (state.isOpening !== undefined) {
135
+ this.isDisabled = state.isOpening;
136
+ if (state.isOpening) {
137
+ this.closeChildrenUi();
138
+ }
139
+ }
140
+ if (state.openMode !== undefined) {
141
+ this.openMode = state.openMode;
142
+ }
143
+ this.syncRootClasses();
144
+ this.renderButtons();
145
+ };
146
+ /**
147
+ * Replaces the toolbar item list and re-renders buttons.
148
+ *
149
+ * @param items - New toolbar items.
150
+ */
151
+ AcUiToolbar.prototype.updateItems = function (items) {
152
+ this.items = items;
153
+ this.seedSelectedChildren(items);
154
+ this.renderButtons();
155
+ };
156
+ /**
157
+ * Applies layout-driven view options (placement, chrome flags, items).
158
+ *
159
+ * Used by {@link AcApSimpleUiPlugin} when switching phone / pad / desktop
160
+ * layouts without recreating the toolbar instance.
161
+ *
162
+ * @param view - Partial toolbar view state to merge.
163
+ */
164
+ AcUiToolbar.prototype.applyViewOptions = function (view) {
165
+ if (view.placement !== undefined) {
166
+ this.options.placement = view.placement;
167
+ }
168
+ if (view.edgeOffset !== undefined) {
169
+ this.edgeOffset = Math.max(0, view.edgeOffset);
170
+ }
171
+ if (view.sideOffset !== undefined) {
172
+ this.sideOffset = Math.max(0, view.sideOffset);
173
+ }
174
+ if (view.collapsible !== undefined) {
175
+ this.options.collapsible = view.collapsible;
176
+ if (!view.collapsible) {
177
+ this.collapsed = false;
178
+ }
179
+ }
180
+ if (view.defaultCollapsed !== undefined) {
181
+ this.collapsed =
182
+ Boolean(this.options.collapsible) && Boolean(view.defaultCollapsed);
183
+ }
184
+ if (view.showLabels !== undefined) {
185
+ this.options.showLabels = view.showLabels;
186
+ }
187
+ if (view.size !== undefined) {
188
+ this.options.size = view.size;
189
+ }
190
+ if (view.overflow !== undefined) {
191
+ this.options.overflow = view.overflow;
192
+ }
193
+ if (view.showBorder !== undefined) {
194
+ this.showBorder = view.showBorder;
195
+ }
196
+ if (view.showButtonBorder !== undefined) {
197
+ this.showButtonBorder = view.showButtonBorder;
198
+ }
199
+ if (view.showSeparators !== undefined) {
200
+ this.showSeparators = view.showSeparators;
201
+ }
202
+ if (view.showChildrenIndicator !== undefined) {
203
+ this.showChildrenIndicator = view.showChildrenIndicator;
204
+ this.options.showChildrenIndicator = view.showChildrenIndicator;
205
+ }
206
+ if (view.subToolbar !== undefined) {
207
+ this.options.subToolbar = view.subToolbar;
208
+ }
209
+ if (view.inCanvasParent !== undefined) {
210
+ this.inCanvasParent = view.inCanvasParent;
211
+ this.options.inCanvasParent = view.inCanvasParent;
212
+ }
213
+ if (view.items !== undefined) {
214
+ this.items = view.items;
215
+ this.seedSelectedChildren(view.items);
216
+ }
217
+ this.syncRootClasses();
218
+ this.ensureInParentLayout();
219
+ this.renderButtons();
220
+ this.scheduleSyncPosition();
221
+ };
222
+ /** Re-renders buttons (e.g. after locale or theme change). */
223
+ AcUiToolbar.prototype.refresh = function () {
224
+ this.renderButtons();
225
+ };
226
+ /** Updates button labels and tooltips after locale change. */
227
+ AcUiToolbar.prototype.refreshLocale = function () {
228
+ var e_1, _a;
229
+ var _b, _c;
230
+ this.syncOverflowButtonLabels();
231
+ this.syncCollapseToggleButton();
232
+ try {
233
+ for (var _d = __values(this.renderedEntries), _e = _d.next(); !_e.done; _e = _d.next()) {
234
+ var _f = _e.value, item = _f.item, element = _f.element, isSeparator = _f.isSeparator;
235
+ if (isSeparator)
236
+ continue;
237
+ var button = element;
238
+ var effective = acuiResolveParentToolbarDisplay(item, this.selectedChildByParent.get(item.id));
239
+ var label = effective.label
240
+ ? this.options.i18n.t(effective.label)
241
+ : effective.id;
242
+ button.title = label;
243
+ button.setAttribute('aria-label', label);
244
+ var labelEl = button.querySelector('.ml-ex-ui-toolbar-btn-label, .ml-ex-ui-toolbar-btn-text');
245
+ if (labelEl) {
246
+ labelEl.textContent = label;
247
+ }
248
+ }
249
+ }
250
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
251
+ finally {
252
+ try {
253
+ if (_e && !_e.done && (_a = _d.return)) _a.call(_d);
254
+ }
255
+ finally { if (e_1) throw e_1.error; }
256
+ }
257
+ (_b = this.openSubToolbar) === null || _b === void 0 ? void 0 : _b.refreshLocale();
258
+ (_c = this.openNestedSubToolbar) === null || _c === void 0 ? void 0 : _c.refreshLocale();
259
+ };
260
+ Object.defineProperty(AcUiToolbar.prototype, "replaceOnNested", {
261
+ /**
262
+ * Whether nested strips and dock panels replace an open ancestor strip.
263
+ *
264
+ * @see {@link AcUiSubToolbarOptions.replaceOnNested}
265
+ */
266
+ get: function () {
267
+ return this.resolveSubToolbarChrome().replaceOnNested === true;
268
+ },
269
+ enumerable: false,
270
+ configurable: true
271
+ });
272
+ /** Closes any open dropdown or sub-toolbar. */
273
+ AcUiToolbar.prototype.dismissOpenChildren = function () {
274
+ this.closeChildrenUi();
275
+ };
276
+ /** Notifies the host to hide mutually exclusive chrome (e.g. dock panels). */
277
+ AcUiToolbar.prototype.notifyExclusiveOpen = function () {
278
+ var _a, _b;
279
+ if (this.replaceOnNested) {
280
+ (_b = (_a = this.options).onExclusiveOpen) === null || _b === void 0 ? void 0 : _b.call(_a);
281
+ }
282
+ };
283
+ /**
284
+ * Moves the toolbar to another host edge and updates orientation classes.
285
+ *
286
+ * @param placement - Target edge placement.
287
+ */
288
+ AcUiToolbar.prototype.setPlacement = function (placement) {
289
+ if (this.options.placement === placement)
290
+ return;
291
+ this.options.placement = placement;
292
+ this.selectedChildByParent.set('toolbar-placement', "placement-".concat(placement));
293
+ this.syncRootClasses();
294
+ this.ensureInParentLayout();
295
+ this.renderButtons();
296
+ };
297
+ /** Current inset from the canvas edge in px. */
298
+ AcUiToolbar.prototype.getEdgeOffset = function () {
299
+ return this.edgeOffset;
300
+ };
301
+ /**
302
+ * Sets the inset from the canvas edge and reclamps toolbar position.
303
+ *
304
+ * @param offset - Distance in px (clamped to >= 0).
305
+ */
306
+ AcUiToolbar.prototype.setEdgeOffset = function (offset) {
307
+ this.edgeOffset = Math.max(0, offset);
308
+ this.scheduleSyncPosition();
309
+ };
310
+ /** Current cross-axis inset from host edges in px. */
311
+ AcUiToolbar.prototype.getSideOffset = function () {
312
+ return this.sideOffset;
313
+ };
314
+ /**
315
+ * Sets the cross-axis inset from host edges and reclamps toolbar position.
316
+ *
317
+ * @param offset - Distance in px (clamped to >= 0).
318
+ */
319
+ AcUiToolbar.prototype.setSideOffset = function (offset) {
320
+ this.sideOffset = Math.max(0, offset);
321
+ this.scheduleSyncPosition();
322
+ };
323
+ /** Resolved chrome options for sub-toolbars. */
324
+ AcUiToolbar.prototype.resolveSubToolbarChrome = function () {
325
+ return acuiResolveToolbarChrome({
326
+ edgeOffset: this.edgeOffset,
327
+ sideOffset: this.sideOffset,
328
+ showLabels: this.options.showLabels,
329
+ size: this.options.size,
330
+ overflow: this.options.overflow,
331
+ showBorder: this.showBorder,
332
+ showButtonBorder: this.showButtonBorder,
333
+ showSeparators: this.showSeparators,
334
+ showChildrenIndicator: this.showChildrenIndicator
335
+ }, this.options.subToolbar);
336
+ };
337
+ /**
338
+ * Cross-axis host margins for wrap sizing and sub-toolbar clamping.
339
+ *
340
+ * Horizontal toolbars use {@link sideOffset} on the top/bottom edges; vertical
341
+ * toolbars use it on the left/right edges. The dock edge keeps
342
+ * {@link edgeOffset}.
343
+ */
344
+ AcUiToolbar.prototype.getCrossAxisInset = function () {
345
+ var horizontal = this.getOrientationClass() === 'horizontal';
346
+ if (horizontal) {
347
+ return this.options.placement === 'top'
348
+ ? { near: this.edgeOffset, far: this.sideOffset }
349
+ : { near: this.sideOffset, far: this.edgeOffset };
350
+ }
351
+ return this.options.placement === 'left'
352
+ ? { near: this.sideOffset, far: this.edgeOffset }
353
+ : { near: this.edgeOffset, far: this.sideOffset };
354
+ };
355
+ /**
356
+ * Moves the toolbar to another canvas mount element.
357
+ *
358
+ * @param newHost - New canvas container.
359
+ */
360
+ AcUiToolbar.prototype.reparentTo = function (newHost) {
361
+ var _a;
362
+ if (this.mountHost === newHost) {
363
+ if (!this.root.isConnected && newHost.isConnected) {
364
+ newHost.appendChild(this.root);
365
+ }
366
+ this.syncInParentLayout();
367
+ return;
368
+ }
369
+ (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
370
+ this.releaseInParentLayout({ keepRoot: true });
371
+ this.root.remove();
372
+ this.mountHost = newHost;
373
+ this.ensureMountHostLayout();
374
+ this.mountHost.appendChild(this.root);
375
+ this.ensureInParentLayout();
376
+ this.setupResizeObserver();
377
+ this.scheduleSyncPosition();
378
+ };
379
+ /**
380
+ * Re-applies in-canvas-parent flex layout after the dock panel wraps or
381
+ * reparents the canvas slot.
382
+ */
383
+ AcUiToolbar.prototype.syncInParentLayout = function () {
384
+ this.ensureInParentLayout();
385
+ this.setupResizeObserver();
386
+ this.scheduleSyncPosition();
387
+ };
388
+ /**
389
+ * Sets the active submenu child for a parent button.
390
+ *
391
+ * @param parentId - Parent toolbar item id.
392
+ * @param childId - Selected child item id.
393
+ */
394
+ AcUiToolbar.prototype.setSelectedChild = function (parentId, childId) {
395
+ this.selectedChildByParent.set(parentId, childId);
396
+ };
397
+ Object.defineProperty(AcUiToolbar.prototype, "placement", {
398
+ /** Current toolbar edge placement. */
399
+ get: function () {
400
+ return this.options.placement;
401
+ },
402
+ enumerable: false,
403
+ configurable: true
404
+ });
405
+ Object.defineProperty(AcUiToolbar.prototype, "isCollapsed", {
406
+ /** Whether the toolbar is collapsed to the toggle button only. */
407
+ get: function () {
408
+ return this.collapsed;
409
+ },
410
+ enumerable: false,
411
+ configurable: true
412
+ });
413
+ Object.defineProperty(AcUiToolbar.prototype, "isVisible", {
414
+ /** Whether the toolbar root is visible. */
415
+ get: function () {
416
+ return this.visible;
417
+ },
418
+ enumerable: false,
419
+ configurable: true
420
+ });
421
+ /** Whether the toolbar root node is still attached to the document. */
422
+ AcUiToolbar.prototype.isRootConnected = function () {
423
+ return this.root.isConnected;
424
+ };
425
+ /**
426
+ * Shows or hides the entire toolbar.
427
+ *
428
+ * @param visible - Target visibility.
429
+ */
430
+ AcUiToolbar.prototype.setVisible = function (visible) {
431
+ var _a, _b;
432
+ if (this.visible === visible)
433
+ return;
434
+ this.visible = visible;
435
+ this.root.hidden = !visible;
436
+ if (!visible) {
437
+ this.closeChildrenUi();
438
+ (_b = (_a = this.options).onCollapse) === null || _b === void 0 ? void 0 : _b.call(_a);
439
+ }
440
+ };
441
+ /**
442
+ * Returns the layer toolbar button, expanding a collapsed toolbar first.
443
+ */
444
+ AcUiToolbar.prototype.getLayerButtonAnchor = function () {
445
+ var _a;
446
+ if (this.options.collapsible && this.collapsed) {
447
+ this.setCollapsed(false);
448
+ }
449
+ return ((_a = this.root.querySelector('[data-toolbar-item-id="layer"]')) !== null && _a !== void 0 ? _a : undefined);
450
+ };
451
+ /**
452
+ * Sets collapsed state without toggling.
453
+ *
454
+ * @param collapsed - Target collapsed state.
455
+ */
456
+ AcUiToolbar.prototype.setCollapsed = function (collapsed) {
457
+ var _a, _b;
458
+ if (!this.options.collapsible || this.collapsed === collapsed)
459
+ return;
460
+ this.collapsed = collapsed;
461
+ if (collapsed) {
462
+ this.closeChildrenUi();
463
+ (_b = (_a = this.options).onCollapse) === null || _b === void 0 ? void 0 : _b.call(_a);
464
+ }
465
+ this.syncRootClasses();
466
+ this.syncCollapseToggleButton();
467
+ this.scheduleSyncPosition();
468
+ };
469
+ /** Closes dropdowns and detaches the toolbar DOM. */
470
+ AcUiToolbar.prototype.destroy = function () {
471
+ var _a;
472
+ if (this.layoutFrame !== undefined) {
473
+ cancelAnimationFrame(this.layoutFrame);
474
+ this.layoutFrame = undefined;
475
+ }
476
+ (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
477
+ this.resizeObserver = undefined;
478
+ this.closeChildrenUi();
479
+ this.releaseInParentLayout({ keepRoot: false });
480
+ this.root.remove();
481
+ };
482
+ /** Whether the toolbar stretches along its layout axis. */
483
+ AcUiToolbar.prototype.isStretchSize = function () {
484
+ return this.options.size === 'stretch';
485
+ };
486
+ /**
487
+ * Returns the CSS orientation class suffix for the current placement.
488
+ *
489
+ * @returns `'vertical'` for left/right, `'horizontal'` for top/bottom.
490
+ */
491
+ AcUiToolbar.prototype.getOrientationClass = function () {
492
+ return this.options.placement === 'left' ||
493
+ this.options.placement === 'right'
494
+ ? 'vertical'
495
+ : 'horizontal';
496
+ };
497
+ /** Applies placement, collapsed, and disabled classes on the root element. */
498
+ AcUiToolbar.prototype.syncRootClasses = function () {
499
+ var classes = [
500
+ 'ml-ex-ui-toolbar',
501
+ "is-".concat(this.getOrientationClass()),
502
+ "is-".concat(this.options.placement)
503
+ ];
504
+ if (this.collapsed)
505
+ classes.push('is-collapsed');
506
+ if (this.isDisabled)
507
+ classes.push('is-disabled');
508
+ if (this.options.showLabels)
509
+ classes.push('has-labels');
510
+ if (this.options.size === 'stretch')
511
+ classes.push('is-stretch');
512
+ if (this.inCanvasParent)
513
+ classes.push('is-in-parent');
514
+ if (this.options.overflow === 'wrap')
515
+ classes.push('is-overflow-wrap');
516
+ if (this.options.overflow === 'menu')
517
+ classes.push('is-overflow-menu');
518
+ if (!this.showBorder)
519
+ classes.push('no-border');
520
+ if (this.showButtonBorder)
521
+ classes.push('show-button-border');
522
+ if (this.showChildrenIndicator)
523
+ classes.push('show-children-indicator');
524
+ this.root.className = classes.join(' ');
525
+ };
526
+ /** Appends icon and optional label content to a toolbar button. */
527
+ AcUiToolbar.prototype.populateButtonContent = function (button, effective) {
528
+ if (effective.icon) {
529
+ button.appendChild(createIconElement(effective.icon));
530
+ }
531
+ else if (effective.label && !this.options.showLabels) {
532
+ var text = document.createElement('span');
533
+ text.className = 'ml-ex-ui-toolbar-btn-text';
534
+ text.textContent = this.options.i18n.t(effective.label);
535
+ text.style.fontSize = '11px';
536
+ text.style.padding = '0 4px';
537
+ button.appendChild(text);
538
+ }
539
+ if (this.options.showLabels && effective.label) {
540
+ var label = document.createElement('span');
541
+ label.className = 'ml-ex-ui-toolbar-btn-label';
542
+ label.textContent = this.options.i18n.t(effective.label);
543
+ button.appendChild(label);
544
+ }
545
+ };
546
+ /** Toggles collapsed state when {@link AcUiToolbarMountOptions.collapsible} is enabled. */
547
+ AcUiToolbar.prototype.toggleCollapsed = function () {
548
+ this.setCollapsed(!this.collapsed);
549
+ };
550
+ /**
551
+ * Chevron for the collapse toggle: vertical placements use up/down;
552
+ * horizontal placements (top/bottom) use left/right.
553
+ */
554
+ AcUiToolbar.prototype.getCollapseToggleIcon = function () {
555
+ var horizontal = this.options.placement === 'top' || this.options.placement === 'bottom';
556
+ if (horizontal) {
557
+ return this.collapsed ? ICON_CHEVRON_RIGHT : ICON_CHEVRON_LEFT;
558
+ }
559
+ return this.collapsed ? ICON_CHEVRON_DOWN : ICON_CHEVRON_UP;
560
+ };
561
+ /** Updates collapse toggle icon and labels after locale or state changes. */
562
+ AcUiToolbar.prototype.syncCollapseToggleButton = function (button) {
563
+ var target = button !== null && button !== void 0 ? button : this.root.querySelector('[data-toolbar-item-id="toolbar-collapse"]');
564
+ if (!target)
565
+ return;
566
+ var labelKey = this.collapsed ? 'toolbar.expand' : 'toolbar.collapse';
567
+ target.replaceChildren(createIconElement(this.getCollapseToggleIcon()));
568
+ target.title = this.options.i18n.t(labelKey);
569
+ target.setAttribute('aria-label', target.title);
570
+ target.setAttribute('aria-expanded', String(!this.collapsed));
571
+ };
572
+ /** Appends separator and collapse toggle when collapsible mode is enabled. */
573
+ AcUiToolbar.prototype.appendCollapseToggle = function () {
574
+ var _this = this;
575
+ if (!this.options.collapsible)
576
+ return;
577
+ if (this.showSeparators) {
578
+ var separator = document.createElement('div');
579
+ separator.className = 'ml-ex-ui-toolbar-separator';
580
+ separator.setAttribute('role', 'separator');
581
+ this.root.appendChild(separator);
582
+ }
583
+ var button = document.createElement('button');
584
+ button.type = 'button';
585
+ button.className = 'ml-ex-ui-toolbar-btn ml-ex-ui-toolbar-collapse-btn';
586
+ button.dataset.toolbarItemId = 'toolbar-collapse';
587
+ this.syncCollapseToggleButton(button);
588
+ button.addEventListener('click', function (event) {
589
+ event.stopPropagation();
590
+ _this.toggleCollapsed();
591
+ });
592
+ this.root.appendChild(button);
593
+ };
594
+ /** Rebuilds all toolbar buttons from {@link items}. */
595
+ AcUiToolbar.prototype.renderButtons = function () {
596
+ var _this = this;
597
+ var restoreStickyId = this.stickyParentId;
598
+ this.closeChildrenUi();
599
+ this.root.replaceChildren();
600
+ this.renderedEntries = [];
601
+ this.overflowItems = [];
602
+ var visibleItems = acuiFilterVisibleToolbarItems(this.items, this.openMode);
603
+ visibleItems.forEach(function (item) {
604
+ var _a;
605
+ if (acuiIsToolbarSeparatorItem(item)) {
606
+ if (!_this.showSeparators)
607
+ return;
608
+ var separator = document.createElement('div');
609
+ separator.className = 'ml-ex-ui-toolbar-separator';
610
+ separator.setAttribute('role', 'separator');
611
+ if (item.id) {
612
+ separator.dataset.toolbarItemId = item.id;
613
+ }
614
+ _this.root.appendChild(separator);
615
+ _this.renderedEntries.push({
616
+ item: item,
617
+ element: separator,
618
+ isSeparator: true
619
+ });
620
+ return;
621
+ }
622
+ var effective = acuiResolveParentToolbarDisplay(item, _this.selectedChildByParent.get(item.id));
623
+ var button = document.createElement('button');
624
+ button.type = 'button';
625
+ button.className = 'ml-ex-ui-toolbar-btn';
626
+ button.title = effective.label
627
+ ? _this.options.i18n.t(effective.label)
628
+ : effective.id;
629
+ button.setAttribute('aria-label', button.title);
630
+ button.dataset.toolbarItemId = effective.id;
631
+ if (((_a = effective.children) === null || _a === void 0 ? void 0 : _a.length) || acuiIsDynamicToolbarChildren(item)) {
632
+ button.classList.add('has-children');
633
+ button.setAttribute('aria-haspopup', 'true');
634
+ button.setAttribute('aria-expanded', 'false');
635
+ }
636
+ _this.populateButtonContent(button, effective);
637
+ var disabled = (acuiItemRequiresDocument(effective) &&
638
+ (_this.isDisabled || !_this.hasDocument)) ||
639
+ acuiIsToolbarItemDisabled(effective);
640
+ button.disabled = disabled;
641
+ button.addEventListener('click', function (event) {
642
+ event.stopPropagation();
643
+ if (button.disabled)
644
+ return;
645
+ _this.activateToolbarItem(item, button);
646
+ });
647
+ _this.root.appendChild(button);
648
+ _this.renderedEntries.push({ item: item, element: button, isSeparator: false });
649
+ });
650
+ if (this.options.overflow === 'menu') {
651
+ this.syncOverflowButtonLabels();
652
+ this.root.appendChild(this.overflowButton);
653
+ }
654
+ this.appendCollapseToggle();
655
+ this.applyOverflowLayout();
656
+ this.scheduleSyncPosition();
657
+ if (restoreStickyId && !this.collapsed && this.visible) {
658
+ this.openStickyChildrenByParentId(restoreStickyId);
659
+ }
660
+ };
661
+ /**
662
+ * Runs a toolbar item action or opens its children UI.
663
+ *
664
+ * @param item - Source toolbar item definition.
665
+ * @param anchor - Button element used as the submenu anchor.
666
+ */
667
+ AcUiToolbar.prototype.activateToolbarItem = function (item, anchor) {
668
+ var _this = this;
669
+ var _a, _b;
670
+ var effective = acuiResolveParentToolbarDisplay(item, this.selectedChildByParent.get(item.id));
671
+ if (((_a = effective.children) === null || _a === void 0 ? void 0 : _a.length) || acuiIsDynamicToolbarChildren(item)) {
672
+ var visibleChildren = this.resolveStripChildItems((_b = effective.children) !== null && _b !== void 0 ? _b : []);
673
+ if (visibleChildren.length === 0)
674
+ return;
675
+ if (this.openParentId === item.id) {
676
+ this.closeChildrenUi();
677
+ return;
678
+ }
679
+ this.openChildrenUi(item, anchor, visibleChildren);
680
+ return;
681
+ }
682
+ if (effective.anchorAction) {
683
+ effective.anchorAction(anchor);
684
+ }
685
+ else if (effective.action) {
686
+ effective.action();
687
+ }
688
+ else if (effective.command) {
689
+ this.options.onCommand(effective.command);
690
+ }
691
+ if (item.toggle) {
692
+ window.setTimeout(function () { return _this.renderButtons(); }, 0);
693
+ }
694
+ };
695
+ /** Syncs overflow button tooltip with the active locale. */
696
+ AcUiToolbar.prototype.syncOverflowButtonLabels = function () {
697
+ var label = this.options.i18n.t('toolbar.moreOverflow');
698
+ this.overflowButton.title = label;
699
+ this.overflowButton.setAttribute('aria-label', label);
700
+ };
701
+ /** Applies overflow menu or wrap constraints after render or resize. */
702
+ AcUiToolbar.prototype.applyOverflowLayout = function () {
703
+ if (this.collapsed || !this.root.isConnected) {
704
+ this.overflowButton.hidden = true;
705
+ this.overflowMenuActive = false;
706
+ return;
707
+ }
708
+ if (this.options.overflow === 'wrap') {
709
+ this.applyOverflowWrapLayout();
710
+ return;
711
+ }
712
+ if (this.options.overflow === 'menu') {
713
+ this.applyOverflowMenuLayout();
714
+ }
715
+ };
716
+ /** Constrains wrap layout to the mount host and allows multi-row/column flow. */
717
+ AcUiToolbar.prototype.applyOverflowWrapLayout = function () {
718
+ this.overflowButton.hidden = true;
719
+ this.renderedEntries.forEach(function (entry) {
720
+ entry.element.hidden = false;
721
+ });
722
+ var offset = this.inCanvasParent ? this.sideOffset : this.edgeOffset;
723
+ var crossInset = this.getCrossAxisInset();
724
+ var horizontal = this.getOrientationClass() === 'horizontal';
725
+ var host = this.getLayoutHost();
726
+ if (horizontal) {
727
+ var maxWidth = Math.max(0, host.clientWidth - offset * 2);
728
+ this.root.style.setProperty('--ml-ex-ui-toolbar-max-width', "".concat(maxWidth, "px"));
729
+ if (this.inCanvasParent) {
730
+ this.root.style.removeProperty('--ml-ex-ui-toolbar-max-height');
731
+ }
732
+ else {
733
+ var maxHeight = Math.max(0, host.clientHeight - crossInset.near - crossInset.far);
734
+ this.root.style.setProperty('--ml-ex-ui-toolbar-max-height', "".concat(maxHeight, "px"));
735
+ }
736
+ }
737
+ else {
738
+ if (this.inCanvasParent) {
739
+ this.root.style.removeProperty('--ml-ex-ui-toolbar-max-width');
740
+ }
741
+ else {
742
+ var maxWidth = Math.max(0, host.clientWidth - crossInset.near - crossInset.far);
743
+ this.root.style.setProperty('--ml-ex-ui-toolbar-max-width', "".concat(maxWidth, "px"));
744
+ }
745
+ var maxHeight = Math.max(0, host.clientHeight - offset * 2);
746
+ this.root.style.setProperty('--ml-ex-ui-toolbar-max-height', "".concat(maxHeight, "px"));
747
+ }
748
+ };
749
+ /** Returns the measured size of a toolbar child along the layout axis. */
750
+ AcUiToolbar.prototype.getEntryAxisSize = function (entry, horizontal) {
751
+ var measured = horizontal ? entry.offsetWidth : entry.offsetHeight;
752
+ if (measured > 0)
753
+ return measured;
754
+ return entry.classList.contains('ml-ex-ui-toolbar-separator')
755
+ ? horizontal
756
+ ? 9
757
+ : 9
758
+ : 36;
759
+ };
760
+ /** Hides overflowing items behind a ⋯ menu button. */
761
+ AcUiToolbar.prototype.applyOverflowMenuLayout = function () {
762
+ this.closeOverflowMenu();
763
+ this.overflowItems = [];
764
+ this.overflowMenuActive = false;
765
+ this.overflowButton.hidden = true;
766
+ this.renderedEntries.forEach(function (entry) {
767
+ entry.element.hidden = false;
768
+ });
769
+ var horizontal = this.getOrientationClass() === 'horizontal';
770
+ var hostLimit = this.getOverflowHostLimit(horizontal);
771
+ // Stretch mode forces root width/height to the host, so offset* metrics never
772
+ // shrink when items are hidden. Measure intrinsic content size instead.
773
+ var fullSize = this.getToolbarOverflowMeasureSize(horizontal);
774
+ if (hostLimit <= 0 || this.renderedEntries.length === 0) {
775
+ this.root.style.removeProperty('--ml-ex-ui-toolbar-max-width');
776
+ this.root.style.removeProperty('--ml-ex-ui-toolbar-max-height');
777
+ return;
778
+ }
779
+ if (fullSize <= hostLimit) {
780
+ this.root.style.removeProperty('--ml-ex-ui-toolbar-max-width');
781
+ this.root.style.removeProperty('--ml-ex-ui-toolbar-max-height');
782
+ return;
783
+ }
784
+ this.overflowButton.hidden = false;
785
+ var hideFrom = this.renderedEntries.length;
786
+ while (true) {
787
+ for (var i = 0; i < this.renderedEntries.length; i++) {
788
+ this.renderedEntries[i].element.hidden = i >= hideFrom;
789
+ }
790
+ if (this.getToolbarOverflowMeasureSize(horizontal) <= hostLimit ||
791
+ hideFrom === 0) {
792
+ break;
793
+ }
794
+ hideFrom -= 1;
795
+ }
796
+ // Keep at least one primary item visible when possible (avoid ⋯-only bars).
797
+ if (hideFrom === 0 && this.renderedEntries.length > 0) {
798
+ hideFrom = 1;
799
+ for (var i = 0; i < this.renderedEntries.length; i++) {
800
+ this.renderedEntries[i].element.hidden = i >= hideFrom;
801
+ }
802
+ }
803
+ for (var i = hideFrom; i < this.renderedEntries.length; i++) {
804
+ var entry = this.renderedEntries[i];
805
+ if (!entry.isSeparator) {
806
+ this.overflowItems.push(entry.item);
807
+ }
808
+ }
809
+ this.overflowButton.hidden = this.overflowItems.length === 0;
810
+ this.overflowMenuActive = !this.overflowButton.hidden;
811
+ this.root.style.removeProperty('--ml-ex-ui-toolbar-max-width');
812
+ this.root.style.removeProperty('--ml-ex-ui-toolbar-max-height');
813
+ };
814
+ /** Forces layout so axis measurements reflect the current DOM state. */
815
+ AcUiToolbar.prototype.flushToolbarAxisMeasure = function () {
816
+ void this.root.offsetHeight;
817
+ void this.root.offsetWidth;
818
+ };
819
+ /**
820
+ * Intrinsic axis size for overflow-menu decisions (padding + visible children).
821
+ *
822
+ * Stretch chrome forces the root box to the host size, so {@link getToolbarAxisSize}
823
+ * cannot detect overflow. This sums unstretched child sizes instead.
824
+ */
825
+ AcUiToolbar.prototype.getToolbarOverflowMeasureSize = function (horizontal) {
826
+ var e_2, _a;
827
+ var stretch = this.isStretchSize();
828
+ var prevWidth = this.root.style.width;
829
+ var prevHeight = this.root.style.height;
830
+ if (stretch) {
831
+ // Drop stretch flex so labeled buttons report natural widths/heights.
832
+ this.root.classList.remove('is-stretch');
833
+ this.root.style.width = horizontal ? 'max-content' : prevWidth;
834
+ this.root.style.height = horizontal ? prevHeight : 'max-content';
835
+ }
836
+ this.flushToolbarAxisMeasure();
837
+ var style = getComputedStyle(this.root);
838
+ var gap = Number.parseFloat(horizontal ? style.columnGap || style.gap : style.rowGap || style.gap) ||
839
+ 4;
840
+ var padding = horizontal
841
+ ? Number.parseFloat(style.paddingLeft) + Number.parseFloat(style.paddingRight)
842
+ : Number.parseFloat(style.paddingTop) + Number.parseFloat(style.paddingBottom);
843
+ var border = horizontal
844
+ ? Number.parseFloat(style.borderLeftWidth) +
845
+ Number.parseFloat(style.borderRightWidth)
846
+ : Number.parseFloat(style.borderTopWidth) +
847
+ Number.parseFloat(style.borderBottomWidth);
848
+ var size = (Number.isFinite(padding) ? padding : 0) +
849
+ (Number.isFinite(border) ? border : 0);
850
+ var visibleCount = 0;
851
+ try {
852
+ for (var _b = __values(Array.from(this.root.children)), _c = _b.next(); !_c.done; _c = _b.next()) {
853
+ var child = _c.value;
854
+ if (child instanceof HTMLElement && !child.hidden) {
855
+ if (visibleCount > 0)
856
+ size += gap;
857
+ size += this.getEntryAxisSize(child, horizontal);
858
+ visibleCount += 1;
859
+ }
860
+ }
861
+ }
862
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
863
+ finally {
864
+ try {
865
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
866
+ }
867
+ finally { if (e_2) throw e_2.error; }
868
+ }
869
+ if (stretch) {
870
+ this.root.classList.add('is-stretch');
871
+ this.root.style.width = prevWidth;
872
+ this.root.style.height = prevHeight;
873
+ this.flushToolbarAxisMeasure();
874
+ }
875
+ return size;
876
+ };
877
+ /**
878
+ * Returns the toolbar root size along the layout axis (padding and chrome included).
879
+ *
880
+ * Uses live layout metrics; falls back to child summation in test environments.
881
+ */
882
+ AcUiToolbar.prototype.getToolbarAxisSize = function (horizontal) {
883
+ this.flushToolbarAxisMeasure();
884
+ var measured = horizontal ? this.root.offsetWidth : this.root.offsetHeight;
885
+ if (measured > 0)
886
+ return measured;
887
+ return this.getToolbarOverflowMeasureSize(horizontal);
888
+ };
889
+ /** Returns the host axis limit for toolbar content (inside edge offsets). */
890
+ AcUiToolbar.prototype.getOverflowHostLimit = function (horizontal) {
891
+ var offset = this.inCanvasParent ? this.sideOffset : this.edgeOffset;
892
+ var host = this.getLayoutHost();
893
+ var hostSize = horizontal ? host.clientWidth : host.clientHeight;
894
+ return Math.max(0, hostSize - offset * 2);
895
+ };
896
+ /** Opens or closes the overflow dropdown menu. */
897
+ AcUiToolbar.prototype.toggleOverflowMenu = function () {
898
+ var _this = this;
899
+ if (this.overflowDropdown) {
900
+ this.closeOverflowMenu();
901
+ return;
902
+ }
903
+ if (this.overflowItems.length === 0)
904
+ return;
905
+ this.notifyExclusiveOpen();
906
+ this.closeChildrenUi();
907
+ var menuItems = this.overflowItems
908
+ .map(function (item) {
909
+ return acuiResolveParentToolbarDisplay(item, _this.selectedChildByParent.get(item.id));
910
+ })
911
+ .filter(function (item) { return !acuiIsToolbarSeparatorItem(item); });
912
+ this.overflowDropdown = new AcUiDropdownMenu(this.options.i18n, menuItems, this.overflowButton, this.themeHost);
913
+ this.overflowDropdown.setOnSelect(function (child) {
914
+ _this.activateToolbarItem(child, _this.overflowButton);
915
+ _this.closeOverflowMenu();
916
+ });
917
+ this.overflowDropdown.setOnClose(function () {
918
+ _this.overflowDropdown = undefined;
919
+ });
920
+ };
921
+ /** Closes the overflow dropdown when open. */
922
+ AcUiToolbar.prototype.closeOverflowMenu = function () {
923
+ var _a;
924
+ (_a = this.overflowDropdown) === null || _a === void 0 ? void 0 : _a.close();
925
+ this.overflowDropdown = undefined;
926
+ };
927
+ AcUiToolbar.prototype.ensureMountHostLayout = function () {
928
+ if (getComputedStyle(this.mountHost).position === 'static') {
929
+ this.mountHost.style.position = 'relative';
930
+ }
931
+ this.mountHost.classList.add('ml-ex-ui-toolbar-host');
932
+ };
933
+ /**
934
+ * Flex container used for overflow and in-canvas-parent sizing.
935
+ *
936
+ * Overlay toolbars measure the mount host. In-canvas-parent toolbars measure
937
+ * the canvas-slot flex host so the bar tracks the drawing area, not the
938
+ * outer dock chrome.
939
+ */
940
+ AcUiToolbar.prototype.getLayoutHost = function () {
941
+ var _a;
942
+ if (this.inCanvasParent) {
943
+ return (_a = this.inParentHost) !== null && _a !== void 0 ? _a : this.mountHost;
944
+ }
945
+ return this.mountHost;
946
+ };
947
+ /**
948
+ * Positioning host for sub-toolbars: optional {@link AcUiToolbarMountOptions.overlayHost},
949
+ * otherwise the canvas slot when in-canvas-parent so strips overlay the drawing,
950
+ * otherwise {@link mountHost}.
951
+ */
952
+ AcUiToolbar.prototype.getOverlayHost = function () {
953
+ if (this.options.overlayHost) {
954
+ return this.options.overlayHost;
955
+ }
956
+ if (this.inCanvasParent && this.toolbarMain) {
957
+ return this.toolbarMain;
958
+ }
959
+ return this.mountHost;
960
+ };
961
+ /**
962
+ * Wraps canvas children and places the toolbar as a flex sibling when
963
+ * {@link inCanvasParent} is enabled. Prefers an existing dock-main slot so
964
+ * dock side changes do not pull the toolbar onto the dock axis.
965
+ */
966
+ AcUiToolbar.prototype.ensureInParentLayout = function () {
967
+ if (!this.inCanvasParent) {
968
+ this.releaseInParentLayout({ keepRoot: true });
969
+ return;
970
+ }
971
+ var wrapRoot = this.resolveInParentWrapRoot();
972
+ this.applyInParentHostClasses(wrapRoot);
973
+ this.ensureToolbarMainWrapper(wrapRoot);
974
+ this.placeToolbarInWrapRoot(wrapRoot);
975
+ };
976
+ /** Dock-main when present, otherwise the toolbar mount host. */
977
+ AcUiToolbar.prototype.resolveInParentWrapRoot = function () {
978
+ var dockMain = this.mountHost.querySelector(':scope > .ml-ex-ui-dock-main');
979
+ return dockMain instanceof HTMLElement ? dockMain : this.mountHost;
980
+ };
981
+ AcUiToolbar.prototype.applyInParentHostClasses = function (wrapRoot) {
982
+ if (this.inParentHost && this.inParentHost !== wrapRoot) {
983
+ this.clearInParentHostClasses(this.inParentHost);
984
+ }
985
+ this.inParentHost = wrapRoot;
986
+ wrapRoot.classList.add('ml-ex-ui-toolbar-in-parent');
987
+ wrapRoot.classList.remove('ml-ex-ui-toolbar-in-parent-top', 'ml-ex-ui-toolbar-in-parent-bottom', 'ml-ex-ui-toolbar-in-parent-left', 'ml-ex-ui-toolbar-in-parent-right');
988
+ wrapRoot.classList.add("ml-ex-ui-toolbar-in-parent-".concat(this.options.placement));
989
+ };
990
+ AcUiToolbar.prototype.clearInParentHostClasses = function (host) {
991
+ var _a;
992
+ if (!host)
993
+ return;
994
+ (_a = host.classList).remove.apply(_a, __spreadArray([], __read(AcUiToolbar.IN_PARENT_HOST_CLASSES), false));
995
+ };
996
+ AcUiToolbar.prototype.shouldSkipInParentMove = function (node) {
997
+ if (!(node instanceof HTMLElement))
998
+ return false;
999
+ return (node === this.root ||
1000
+ node.classList.contains('ml-ex-ui-toolbar') ||
1001
+ node.classList.contains('ml-ex-ui-toolbar-main') ||
1002
+ node.classList.contains('ml-ex-ui-dock-panel') ||
1003
+ node.classList.contains('ml-ex-ui-subtoolbar') ||
1004
+ node.classList.contains('ml-ex-ui-dropdown'));
1005
+ };
1006
+ AcUiToolbar.prototype.ensureToolbarMainWrapper = function (wrapRoot) {
1007
+ var _this = this;
1008
+ var _a;
1009
+ if (((_a = this.toolbarMain) === null || _a === void 0 ? void 0 : _a.parentElement) === wrapRoot)
1010
+ return;
1011
+ var existing = wrapRoot.querySelector(':scope > .ml-ex-ui-toolbar-main');
1012
+ if (existing instanceof HTMLElement) {
1013
+ this.toolbarMain = existing;
1014
+ return;
1015
+ }
1016
+ var movable = [];
1017
+ Array.from(wrapRoot.childNodes).forEach(function (child) {
1018
+ if (_this.shouldSkipInParentMove(child))
1019
+ return;
1020
+ movable.push(child);
1021
+ });
1022
+ var wrapper = document.createElement('div');
1023
+ wrapper.className = 'ml-ex-ui-toolbar-main';
1024
+ movable.forEach(function (node) { return wrapper.appendChild(node); });
1025
+ wrapRoot.appendChild(wrapper);
1026
+ this.toolbarMain = wrapper;
1027
+ };
1028
+ AcUiToolbar.prototype.placeToolbarInWrapRoot = function (wrapRoot) {
1029
+ var placement = this.options.placement;
1030
+ if (placement === 'top' || placement === 'left') {
1031
+ wrapRoot.insertBefore(this.root, wrapRoot.firstChild);
1032
+ return;
1033
+ }
1034
+ wrapRoot.appendChild(this.root);
1035
+ };
1036
+ /**
1037
+ * Unwraps the canvas slot and restores overlay mounting.
1038
+ *
1039
+ * @param options.keepRoot - When true, leaves the toolbar root in the DOM.
1040
+ */
1041
+ AcUiToolbar.prototype.releaseInParentLayout = function (options) {
1042
+ var wasInParent = Boolean(this.inParentHost || this.toolbarMain);
1043
+ this.clearInParentHostClasses(this.inParentHost);
1044
+ this.inParentHost = undefined;
1045
+ this.releaseToolbarMainWrapper();
1046
+ this.clearInParentOffsetStyles();
1047
+ if (wasInParent &&
1048
+ options.keepRoot &&
1049
+ this.root.isConnected &&
1050
+ this.root.parentElement !== this.mountHost &&
1051
+ this.mountHost.isConnected) {
1052
+ this.mountHost.appendChild(this.root);
1053
+ }
1054
+ };
1055
+ AcUiToolbar.prototype.releaseToolbarMainWrapper = function () {
1056
+ var _a;
1057
+ if (!((_a = this.toolbarMain) === null || _a === void 0 ? void 0 : _a.isConnected)) {
1058
+ this.toolbarMain = undefined;
1059
+ return;
1060
+ }
1061
+ var parent = this.toolbarMain.parentElement;
1062
+ if (parent) {
1063
+ while (this.toolbarMain.firstChild) {
1064
+ parent.insertBefore(this.toolbarMain.firstChild, this.toolbarMain);
1065
+ }
1066
+ }
1067
+ this.toolbarMain.remove();
1068
+ this.toolbarMain = undefined;
1069
+ };
1070
+ AcUiToolbar.prototype.clearInParentOffsetStyles = function () {
1071
+ this.root.style.marginTop = '';
1072
+ this.root.style.marginRight = '';
1073
+ this.root.style.marginBottom = '';
1074
+ this.root.style.marginLeft = '';
1075
+ };
1076
+ AcUiToolbar.prototype.setupResizeObserver = function () {
1077
+ var _this = this;
1078
+ var _a;
1079
+ (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
1080
+ this.resizeObserver = new ResizeObserver(function () {
1081
+ _this.scheduleSyncPosition();
1082
+ });
1083
+ this.resizeObserver.observe(this.mountHost);
1084
+ var layoutHost = this.getLayoutHost();
1085
+ if (layoutHost !== this.mountHost) {
1086
+ this.resizeObserver.observe(layoutHost);
1087
+ }
1088
+ if (this.toolbarMain && this.toolbarMain !== layoutHost) {
1089
+ this.resizeObserver.observe(this.toolbarMain);
1090
+ }
1091
+ };
1092
+ AcUiToolbar.prototype.scheduleSyncPosition = function () {
1093
+ var _this = this;
1094
+ if (this.layoutFrame !== undefined)
1095
+ return;
1096
+ this.layoutFrame = requestAnimationFrame(function () {
1097
+ var _a, _b;
1098
+ _this.layoutFrame = undefined;
1099
+ _this.applyOverflowLayout();
1100
+ _this.syncPosition();
1101
+ if (_this.overflowMenuActive) {
1102
+ var horizontal = _this.getOrientationClass() === 'horizontal';
1103
+ var hostLimit = _this.getOverflowHostLimit(horizontal);
1104
+ if (_this.getToolbarOverflowMeasureSize(horizontal) > hostLimit) {
1105
+ _this.applyOverflowMenuLayout();
1106
+ _this.syncPosition();
1107
+ }
1108
+ }
1109
+ (_a = _this.openSubToolbar) === null || _a === void 0 ? void 0 : _a.syncPosition();
1110
+ (_b = _this.openNestedSubToolbar) === null || _b === void 0 ? void 0 : _b.syncPosition();
1111
+ });
1112
+ };
1113
+ /** Positions the toolbar inside the canvas, clamped to the current host bounds. */
1114
+ AcUiToolbar.prototype.syncPosition = function () {
1115
+ if (!this.root.isConnected || this.root.hidden)
1116
+ return;
1117
+ if (this.inCanvasParent) {
1118
+ this.applyInParentPosition();
1119
+ return;
1120
+ }
1121
+ this.clearInParentOffsetStyles();
1122
+ var offset = this.edgeOffset;
1123
+ var hostWidth = this.mountHost.clientWidth;
1124
+ var hostHeight = this.mountHost.clientHeight;
1125
+ if (hostWidth <= 0 || hostHeight <= 0)
1126
+ return;
1127
+ this.root.style.top = '';
1128
+ this.root.style.bottom = '';
1129
+ this.root.style.left = '';
1130
+ this.root.style.right = '';
1131
+ this.root.style.transform = '';
1132
+ this.root.style.width = '';
1133
+ this.root.style.height = '';
1134
+ this.root.style.maxWidth = '';
1135
+ this.root.style.maxHeight = '';
1136
+ var toolbarWidth = this.getToolbarAxisSize(true);
1137
+ var toolbarHeight = this.getToolbarAxisSize(false);
1138
+ var placement = this.options.placement;
1139
+ var stretch = this.isStretchSize();
1140
+ if (placement === 'top' || placement === 'bottom') {
1141
+ if (stretch) {
1142
+ this.root.style.left = '0';
1143
+ this.root.style.right = '0';
1144
+ this.root.style.width = "".concat(hostWidth, "px");
1145
+ this.root.style.maxWidth = "".concat(hostWidth, "px");
1146
+ }
1147
+ else {
1148
+ var maxLeft = Math.max(offset, hostWidth - toolbarWidth - offset);
1149
+ var idealLeft = (hostWidth - toolbarWidth) / 2;
1150
+ var left = Math.min(maxLeft, Math.max(offset, idealLeft));
1151
+ this.root.style.left = "".concat(left, "px");
1152
+ this.root.style.maxWidth = "".concat(Math.max(0, hostWidth - offset * 2), "px");
1153
+ }
1154
+ if (placement === 'top') {
1155
+ this.root.style.top = "".concat(offset, "px");
1156
+ }
1157
+ else {
1158
+ this.root.style.bottom = "".concat(offset, "px");
1159
+ }
1160
+ return;
1161
+ }
1162
+ if (stretch) {
1163
+ var stretchHeight = Math.max(0, hostHeight - offset * 2);
1164
+ this.root.style.height = "".concat(stretchHeight, "px");
1165
+ this.root.style.top = "".concat(offset, "px");
1166
+ }
1167
+ else {
1168
+ var lowerTop = offset;
1169
+ var upperTop = hostHeight - toolbarHeight - offset;
1170
+ var idealTop = (hostHeight - toolbarHeight) / 2;
1171
+ // When the shrunk toolbar still fits, keep vertical centering. When it
1172
+ // cannot fit, upperTop is negative and bottom-aligns so ⋯ stays in view.
1173
+ var top_1 = upperTop >= lowerTop
1174
+ ? Math.min(upperTop, Math.max(lowerTop, idealTop))
1175
+ : upperTop;
1176
+ this.root.style.top = "".concat(top_1, "px");
1177
+ }
1178
+ if (placement === 'left') {
1179
+ this.root.style.left = "".concat(offset, "px");
1180
+ }
1181
+ else {
1182
+ this.root.style.right = "".concat(offset, "px");
1183
+ }
1184
+ };
1185
+ /**
1186
+ * Applies edge/side offsets as margins so an in-canvas-parent toolbar sits
1187
+ * against the canvas without overlay positioning.
1188
+ */
1189
+ AcUiToolbar.prototype.applyInParentPosition = function () {
1190
+ this.root.style.top = '';
1191
+ this.root.style.bottom = '';
1192
+ this.root.style.left = '';
1193
+ this.root.style.right = '';
1194
+ this.root.style.transform = '';
1195
+ this.root.style.width = '';
1196
+ this.root.style.height = '';
1197
+ this.root.style.maxWidth = '';
1198
+ this.root.style.maxHeight = '';
1199
+ var offset = this.edgeOffset;
1200
+ var side = this.sideOffset;
1201
+ var placement = this.options.placement;
1202
+ if (placement === 'top' || placement === 'bottom') {
1203
+ this.root.style.marginTop = placement === 'bottom' ? "".concat(offset, "px") : '0';
1204
+ this.root.style.marginBottom = placement === 'top' ? "".concat(offset, "px") : '0';
1205
+ this.root.style.marginLeft = "".concat(side, "px");
1206
+ this.root.style.marginRight = "".concat(side, "px");
1207
+ }
1208
+ else {
1209
+ this.root.style.marginLeft = placement === 'right' ? "".concat(offset, "px") : '0';
1210
+ this.root.style.marginRight = placement === 'left' ? "".concat(offset, "px") : '0';
1211
+ this.root.style.marginTop = "".concat(side, "px");
1212
+ this.root.style.marginBottom = "".concat(side, "px");
1213
+ }
1214
+ };
1215
+ /** Seeds submenu selection from {@link AcUiToolbarItem.selectedChildId}. */
1216
+ AcUiToolbar.prototype.seedSelectedChildren = function (items) {
1217
+ var e_3, _a;
1218
+ var _b;
1219
+ try {
1220
+ for (var items_1 = __values(items), items_1_1 = items_1.next(); !items_1_1.done; items_1_1 = items_1.next()) {
1221
+ var item = items_1_1.value;
1222
+ if (acuiIsToolbarSeparatorItem(item))
1223
+ continue;
1224
+ if (item.childIcon === 'selected' && item.selectedChildId) {
1225
+ this.selectedChildByParent.set(item.id, item.selectedChildId);
1226
+ }
1227
+ if (!acuiIsDynamicToolbarChildren(item) && ((_b = item.children) === null || _b === void 0 ? void 0 : _b.length)) {
1228
+ this.seedSelectedChildren(item.children);
1229
+ }
1230
+ }
1231
+ }
1232
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
1233
+ finally {
1234
+ try {
1235
+ if (items_1_1 && !items_1_1.done && (_a = items_1.return)) _a.call(items_1);
1236
+ }
1237
+ finally { if (e_3) throw e_3.error; }
1238
+ }
1239
+ };
1240
+ /**
1241
+ * Resolves visible strip children, applying {@link acuiResolveParentToolbarDisplay}
1242
+ * so nested parents (e.g. toolbar placement under settings) show the active
1243
+ * child icon.
1244
+ */
1245
+ AcUiToolbar.prototype.resolveStripChildItems = function (children) {
1246
+ var _this = this;
1247
+ return acuiFilterVisibleToolbarItems(children, this.openMode).map(function (child) {
1248
+ return acuiResolveParentToolbarDisplay(child, _this.selectedChildByParent.get(child.id));
1249
+ });
1250
+ };
1251
+ /** Closes any open dropdown or sub-toolbar and clears parent expanded state. */
1252
+ AcUiToolbar.prototype.closeChildrenUi = function () {
1253
+ var _a, _b;
1254
+ this.closeOverflowMenu();
1255
+ this.closeNestedSubToolbar();
1256
+ (_a = this.openDropdown) === null || _a === void 0 ? void 0 : _a.close();
1257
+ this.openDropdown = undefined;
1258
+ (_b = this.openSubToolbar) === null || _b === void 0 ? void 0 : _b.close();
1259
+ this.openSubToolbar = undefined;
1260
+ this.clearParentOpenState();
1261
+ this.openParentId = undefined;
1262
+ this.stickyParentId = undefined;
1263
+ };
1264
+ /** Removes `is-open` / `aria-expanded` from the last expanded parent button. */
1265
+ AcUiToolbar.prototype.clearParentOpenState = function () {
1266
+ if (!this.openParentButton)
1267
+ return;
1268
+ this.openParentButton.classList.remove('is-open');
1269
+ this.openParentButton.setAttribute('aria-expanded', 'false');
1270
+ if (this.openParentButton instanceof HTMLElement) {
1271
+ this.openParentButton.blur();
1272
+ }
1273
+ this.openParentButton = undefined;
1274
+ };
1275
+ /**
1276
+ * Marks a parent button as expanded while its children UI is open.
1277
+ *
1278
+ * @param button - Parent toolbar button.
1279
+ */
1280
+ AcUiToolbar.prototype.markParentOpen = function (button) {
1281
+ this.clearParentOpenState();
1282
+ button.classList.add('is-open');
1283
+ button.setAttribute('aria-expanded', 'true');
1284
+ this.openParentButton = button;
1285
+ };
1286
+ /**
1287
+ * Opens a dropdown or sub-toolbar for a parent item.
1288
+ *
1289
+ * @param item - Parent toolbar item.
1290
+ * @param button - Parent button used as the anchor.
1291
+ * @param visibleChildren - Filtered, effective child items.
1292
+ */
1293
+ AcUiToolbar.prototype.openChildrenUi = function (item, button, visibleChildren) {
1294
+ var _this = this;
1295
+ var _a;
1296
+ this.notifyExclusiveOpen();
1297
+ this.closeChildrenUi();
1298
+ var childrenUi = acuiResolveToolbarChildrenUi(item);
1299
+ this.openParentId = item.id;
1300
+ this.markParentOpen(button);
1301
+ if (acuiIsToolbarChildrenStrip(childrenUi)) {
1302
+ var sticky_1 = childrenUi === 'sticky-toolbar';
1303
+ this.stickyParentId = sticky_1 ? item.id : undefined;
1304
+ var strip_1 = new AcUiSubToolbar({
1305
+ i18n: this.options.i18n,
1306
+ items: visibleChildren,
1307
+ anchor: button,
1308
+ toolbarRoot: this.root,
1309
+ host: this.getOverlayHost(),
1310
+ placement: this.options.placement,
1311
+ sticky: sticky_1,
1312
+ chrome: this.resolveSubToolbarChrome(),
1313
+ position: (_a = this.options.subToolbar) === null || _a === void 0 ? void 0 : _a.position,
1314
+ getCrossAxisInset: function () { return _this.getCrossAxisInset(); },
1315
+ commandsDisabled: this.isDisabled || !this.hasDocument,
1316
+ onSelect: function (child, childButton) {
1317
+ return _this.handleSubToolbarSelect(item, child, childButton, sticky_1);
1318
+ },
1319
+ onClose: function () {
1320
+ if (_this.openSubToolbar === strip_1) {
1321
+ _this.closeNestedSubToolbar();
1322
+ _this.openSubToolbar = undefined;
1323
+ _this.clearParentOpenState();
1324
+ _this.openParentId = undefined;
1325
+ _this.stickyParentId = undefined;
1326
+ }
1327
+ },
1328
+ shouldKeepOpenForTarget: function (target) { var _a, _b; return (_b = (_a = _this.openNestedSubToolbar) === null || _a === void 0 ? void 0 : _a.containsTarget(target)) !== null && _b !== void 0 ? _b : false; }
1329
+ });
1330
+ this.openSubToolbar = strip_1;
1331
+ return;
1332
+ }
1333
+ var dropdown = new AcUiDropdownMenu(this.options.i18n, visibleChildren, button, this.themeHost);
1334
+ dropdown.setOnSelect(function (child) {
1335
+ _this.activateChild(item, child, false);
1336
+ });
1337
+ dropdown.setOnClose(function () {
1338
+ if (_this.openDropdown === dropdown) {
1339
+ _this.openDropdown = undefined;
1340
+ _this.clearParentOpenState();
1341
+ _this.openParentId = undefined;
1342
+ }
1343
+ });
1344
+ this.openDropdown = dropdown;
1345
+ };
1346
+ /**
1347
+ * Re-opens a sticky sub-toolbar after the main toolbar is rebuilt.
1348
+ *
1349
+ * @param parentId - Parent item id that was sticky-open.
1350
+ */
1351
+ AcUiToolbar.prototype.openStickyChildrenByParentId = function (parentId) {
1352
+ var _a;
1353
+ var item = this.items.find(function (candidate) {
1354
+ if (acuiIsToolbarSeparatorItem(candidate))
1355
+ return false;
1356
+ return candidate.id === parentId;
1357
+ });
1358
+ if (!((_a = item === null || item === void 0 ? void 0 : item.children) === null || _a === void 0 ? void 0 : _a.length))
1359
+ return;
1360
+ if (acuiResolveToolbarChildrenUi(item) !== 'sticky-toolbar')
1361
+ return;
1362
+ var button = this.root.querySelector("[data-toolbar-item-id=\"".concat(parentId, "\"]"));
1363
+ if (!button)
1364
+ return;
1365
+ var visibleChildren = this.resolveStripChildItems(item.children);
1366
+ if (visibleChildren.length === 0)
1367
+ return;
1368
+ this.openChildrenUi(item, button, visibleChildren);
1369
+ };
1370
+ /**
1371
+ * Handles a sub-toolbar item click, opening nested strips when needed.
1372
+ *
1373
+ * @param stripParent - Root parent item that owns the first-level strip.
1374
+ * @param child - Sub-toolbar item that was activated.
1375
+ * @param button - Anchor button for nested UI positioning.
1376
+ * @param stripSticky - Whether the first-level strip is sticky.
1377
+ */
1378
+ AcUiToolbar.prototype.handleSubToolbarSelect = function (stripParent, child, button, stripSticky) {
1379
+ var _a, _b;
1380
+ if (acuiIsToolbarSeparatorItem(child))
1381
+ return;
1382
+ var effective = acuiResolveEffectiveToolbarItem(child);
1383
+ if (((_a = effective.children) === null || _a === void 0 ? void 0 : _a.length) ||
1384
+ acuiIsDynamicToolbarChildren(effective)) {
1385
+ var visibleChildren = this.resolveStripChildItems((_b = effective.children) !== null && _b !== void 0 ? _b : []);
1386
+ if (visibleChildren.length === 0)
1387
+ return;
1388
+ this.openNestedSubToolbarUi(effective, button, visibleChildren, stripParent, stripSticky);
1389
+ return;
1390
+ }
1391
+ this.activateChild(stripParent, child, stripSticky);
1392
+ if (!stripSticky) {
1393
+ this.closeChildrenUi();
1394
+ }
1395
+ };
1396
+ /**
1397
+ * Opens a nested icon strip or dropdown for a sub-toolbar parent
1398
+ * (e.g. locale under settings on the phone toolbar).
1399
+ *
1400
+ * @param item - Parent item with nested children.
1401
+ * @param button - Sub-toolbar button used as the nested anchor.
1402
+ * @param visibleChildren - Filtered child items to show.
1403
+ * @param stripParent - First-level strip parent (for refresh after nested select).
1404
+ * @param stripSticky - Whether the first-level strip is sticky.
1405
+ */
1406
+ AcUiToolbar.prototype.openNestedSubToolbarUi = function (item, button, visibleChildren, stripParent, stripSticky) {
1407
+ var _this = this;
1408
+ var _a, _b;
1409
+ if (this.openNestedSubToolbar &&
1410
+ this.openNestedSubToolbar.anchor === button) {
1411
+ this.closeNestedSubToolbar();
1412
+ return;
1413
+ }
1414
+ this.closeNestedSubToolbar();
1415
+ var childrenUi = acuiResolveToolbarChildrenUi(item);
1416
+ var chrome = this.resolveSubToolbarChrome();
1417
+ var replaceOnNested = chrome.replaceOnNested;
1418
+ if (!acuiIsToolbarChildrenStrip(childrenUi)) {
1419
+ var dropdown_1 = new AcUiDropdownMenu(this.options.i18n, visibleChildren, button, this.themeHost);
1420
+ dropdown_1.setOnSelect(function (child) {
1421
+ var _a, _b;
1422
+ _this.activateChild(item, child, false);
1423
+ dropdown_1.close();
1424
+ if (!stripSticky) {
1425
+ _this.closeChildrenUi();
1426
+ }
1427
+ else {
1428
+ (_a = _this.openSubToolbar) === null || _a === void 0 ? void 0 : _a.refresh(_this.resolveStripChildItems((_b = stripParent.children) !== null && _b !== void 0 ? _b : []), _this.isDisabled || !_this.hasDocument);
1429
+ }
1430
+ });
1431
+ dropdown_1.setOnClose(function () { return undefined; });
1432
+ return;
1433
+ }
1434
+ if (replaceOnNested) {
1435
+ (_a = this.openSubToolbar) === null || _a === void 0 ? void 0 : _a.setHidden(true);
1436
+ }
1437
+ var nestedSticky = childrenUi === 'sticky-toolbar';
1438
+ var nested = new AcUiSubToolbar({
1439
+ i18n: this.options.i18n,
1440
+ items: visibleChildren,
1441
+ anchor: button,
1442
+ toolbarRoot: replaceOnNested || !this.openSubToolbar
1443
+ ? this.root
1444
+ : this.openSubToolbar.rootElement,
1445
+ host: this.getOverlayHost(),
1446
+ placement: this.options.placement,
1447
+ sticky: nestedSticky,
1448
+ chrome: chrome,
1449
+ position: (_b = this.options.subToolbar) === null || _b === void 0 ? void 0 : _b.position,
1450
+ getCrossAxisInset: function () { return _this.getCrossAxisInset(); },
1451
+ commandsDisabled: this.isDisabled || !this.hasDocument,
1452
+ onSelect: function (child, nestedButton) {
1453
+ return _this.handleSubToolbarSelect(item, child, nestedButton, nestedSticky);
1454
+ },
1455
+ onClose: function () {
1456
+ var _a, _b;
1457
+ if (_this.openNestedSubToolbar === nested) {
1458
+ _this.openNestedSubToolbar = undefined;
1459
+ if (replaceOnNested) {
1460
+ (_a = _this.openSubToolbar) === null || _a === void 0 ? void 0 : _a.setHidden(false);
1461
+ (_b = _this.openSubToolbar) === null || _b === void 0 ? void 0 : _b.syncPosition();
1462
+ }
1463
+ }
1464
+ }
1465
+ });
1466
+ this.openNestedSubToolbar = nested;
1467
+ };
1468
+ /** Closes the nested sub-toolbar opened from a parent strip item. */
1469
+ AcUiToolbar.prototype.closeNestedSubToolbar = function () {
1470
+ var _a, _b;
1471
+ var replaceOnNested = this.resolveSubToolbarChrome().replaceOnNested === true;
1472
+ (_a = this.openNestedSubToolbar) === null || _a === void 0 ? void 0 : _a.close();
1473
+ this.openNestedSubToolbar = undefined;
1474
+ if (replaceOnNested) {
1475
+ (_b = this.openSubToolbar) === null || _b === void 0 ? void 0 : _b.setHidden(false);
1476
+ }
1477
+ };
1478
+ /**
1479
+ * Runs a child item's action/command and refreshes parent/child UI as needed.
1480
+ *
1481
+ * @param parent - Parent toolbar item.
1482
+ * @param child - Selected child item.
1483
+ * @param sticky - Whether the child UI should stay open.
1484
+ */
1485
+ AcUiToolbar.prototype.activateChild = function (parent, child, sticky) {
1486
+ var _this = this;
1487
+ var _a;
1488
+ if (acuiIsToolbarSeparatorItem(child))
1489
+ return;
1490
+ var effective = acuiResolveEffectiveToolbarItem(child);
1491
+ if (parent.childIcon === 'selected') {
1492
+ this.selectedChildByParent.set(parent.id, effective.id);
1493
+ }
1494
+ if (effective.action) {
1495
+ effective.action();
1496
+ }
1497
+ else if (effective.command) {
1498
+ this.options.onCommand(effective.command);
1499
+ }
1500
+ var isLocalePick = !acuiIsToolbarSeparatorItem(child) &&
1501
+ effective.id.startsWith('locale-');
1502
+ if (isLocalePick) {
1503
+ this.refreshLocale();
1504
+ }
1505
+ if (child.toggle && sticky && this.openSubToolbar) {
1506
+ window.setTimeout(function () {
1507
+ var _a;
1508
+ if (!_this.openSubToolbar)
1509
+ return;
1510
+ _this.openSubToolbar.refresh(_this.resolveStripChildItems((_a = parent.children) !== null && _a !== void 0 ? _a : []), _this.isDisabled || !_this.hasDocument);
1511
+ }, 0);
1512
+ return;
1513
+ }
1514
+ // Nested parents under an open strip (e.g. placement under settings):
1515
+ // refresh the strip so the parent button shows the newly selected icon.
1516
+ if (parent.childIcon === 'selected' &&
1517
+ this.openSubToolbar &&
1518
+ this.openParentId &&
1519
+ parent.id !== this.openParentId) {
1520
+ var stripParent_1 = this.items.find(function (candidate) {
1521
+ if (acuiIsToolbarSeparatorItem(candidate))
1522
+ return false;
1523
+ return candidate.id === _this.openParentId;
1524
+ });
1525
+ if ((_a = stripParent_1 === null || stripParent_1 === void 0 ? void 0 : stripParent_1.children) === null || _a === void 0 ? void 0 : _a.length) {
1526
+ window.setTimeout(function () {
1527
+ if (!_this.openSubToolbar || !stripParent_1.children)
1528
+ return;
1529
+ _this.openSubToolbar.refresh(_this.resolveStripChildItems(stripParent_1.children), _this.isDisabled || !_this.hasDocument);
1530
+ }, 0);
1531
+ }
1532
+ }
1533
+ if (child.toggle) {
1534
+ window.setTimeout(function () { return _this.renderButtons(); }, 0);
1535
+ }
1536
+ else if (parent.childIcon === 'selected' || parent.toggle) {
1537
+ this.renderButtons();
1538
+ }
1539
+ };
1540
+ AcUiToolbar.IN_PARENT_HOST_CLASSES = [
1541
+ 'ml-ex-ui-toolbar-in-parent',
1542
+ 'ml-ex-ui-toolbar-in-parent-top',
1543
+ 'ml-ex-ui-toolbar-in-parent-bottom',
1544
+ 'ml-ex-ui-toolbar-in-parent-left',
1545
+ 'ml-ex-ui-toolbar-in-parent-right'
1546
+ ];
1547
+ return AcUiToolbar;
1548
+ }());
1549
+ export { AcUiToolbar };
1550
+ //# sourceMappingURL=AcUiToolbar.js.map