@wirabyte/ui 0.0.0-stage → 1.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1702) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/LICENSE +21 -0
  3. package/README.md +74 -2
  4. package/accordion/accordion.component.d.ts +126 -0
  5. package/accordion/accordion.module.d.ts +9 -0
  6. package/accordion/accordion.types.d.ts +10 -0
  7. package/accordion/index.d.ts +5 -0
  8. package/accordion/public-api.d.ts +3 -0
  9. package/alert/alert-dialog.base.d.ts +79 -0
  10. package/alert/alert-dialog.component.d.ts +8 -0
  11. package/alert/alert.module.d.ts +8 -0
  12. package/alert/alert.service.d.ts +76 -0
  13. package/alert/alert.types.d.ts +87 -0
  14. package/alert/index.d.ts +5 -0
  15. package/alert/public-api.d.ts +5 -0
  16. package/animate/animate.directive.d.ts +34 -0
  17. package/animate/animate.module.d.ts +11 -0
  18. package/animate/animate.service.d.ts +36 -0
  19. package/animate/animate.styles.d.ts +2 -0
  20. package/animate/animate.types.d.ts +20 -0
  21. package/animate/index.d.ts +5 -0
  22. package/animate/public-api.d.ts +4 -0
  23. package/api/index.d.ts +5 -0
  24. package/api/public-api.d.ts +15 -0
  25. package/api/shared.module.d.ts +8 -0
  26. package/asidemenu/asidemenu.component.d.ts +221 -0
  27. package/asidemenu/asidemenu.module.d.ts +9 -0
  28. package/asidemenu/index.d.ts +5 -0
  29. package/asidemenu/public-api.d.ts +2 -0
  30. package/autocomplete/autocomplete.base.d.ts +181 -0
  31. package/autocomplete/autocomplete.component.d.ts +10 -0
  32. package/autocomplete/autocomplete.module.d.ts +9 -0
  33. package/autocomplete/autocomplete.types.d.ts +10 -0
  34. package/autocomplete/index.d.ts +5 -0
  35. package/autocomplete/public-api.d.ts +4 -0
  36. package/avatar/avatar.component.d.ts +38 -0
  37. package/avatar/avatar.module.d.ts +8 -0
  38. package/avatar/avatar.types.d.ts +2 -0
  39. package/avatar/index.d.ts +5 -0
  40. package/avatar/public-api.d.ts +3 -0
  41. package/badge/badge.component.d.ts +20 -0
  42. package/badge/badge.directive.d.ts +32 -0
  43. package/badge/badge.module.d.ts +9 -0
  44. package/badge/badge.styles.d.ts +2 -0
  45. package/badge/badge.types.d.ts +3 -0
  46. package/badge/index.d.ts +5 -0
  47. package/badge/public-api.d.ts +4 -0
  48. package/blockui/blockui.component.d.ts +41 -0
  49. package/blockui/blockui.module.d.ts +8 -0
  50. package/blockui/index.d.ts +5 -0
  51. package/blockui/public-api.d.ts +2 -0
  52. package/bottombar/bottombar.component.d.ts +79 -0
  53. package/bottombar/bottombar.module.d.ts +9 -0
  54. package/bottombar/index.d.ts +5 -0
  55. package/bottombar/public-api.d.ts +2 -0
  56. package/breadcrumb/breadcrumb.component.d.ts +41 -0
  57. package/breadcrumb/breadcrumb.module.d.ts +8 -0
  58. package/breadcrumb/index.d.ts +5 -0
  59. package/breadcrumb/public-api.d.ts +2 -0
  60. package/button/button-class.d.ts +8 -0
  61. package/button/button.component.d.ts +69 -0
  62. package/button/button.directive.d.ts +53 -0
  63. package/button/button.module.d.ts +9 -0
  64. package/button/button.styles.d.ts +2 -0
  65. package/button/button.types.d.ts +8 -0
  66. package/button/index.d.ts +5 -0
  67. package/button/public-api.d.ts +7 -0
  68. package/card/card-slots.d.ts +11 -0
  69. package/card/card.component.d.ts +41 -0
  70. package/card/card.module.d.ts +10 -0
  71. package/card/card.types.d.ts +5 -0
  72. package/card/index.d.ts +5 -0
  73. package/card/public-api.d.ts +4 -0
  74. package/carousel/carousel.component.d.ts +169 -0
  75. package/carousel/carousel.module.d.ts +10 -0
  76. package/carousel/carousel.types.d.ts +21 -0
  77. package/carousel/index.d.ts +5 -0
  78. package/carousel/public-api.d.ts +3 -0
  79. package/chart/chart.component.d.ts +11 -0
  80. package/chart/chart.module.d.ts +8 -0
  81. package/chart/index.d.ts +5 -0
  82. package/chart/public-api.d.ts +3 -0
  83. package/chartjs/chartjs.base.d.ts +70 -0
  84. package/chartjs/chartjs.component.d.ts +10 -0
  85. package/chartjs/chartjs.module.d.ts +8 -0
  86. package/chartjs/chartjs.types.d.ts +8 -0
  87. package/chartjs/index.d.ts +5 -0
  88. package/chartjs/public-api.d.ts +4 -0
  89. package/checkbox/checkbox.component.d.ts +59 -0
  90. package/checkbox/checkbox.module.d.ts +8 -0
  91. package/checkbox/checkbox.styles.d.ts +2 -0
  92. package/checkbox/checkbox.types.d.ts +4 -0
  93. package/checkbox/index.d.ts +5 -0
  94. package/checkbox/public-api.d.ts +5 -0
  95. package/chip/chip.component.d.ts +36 -0
  96. package/chip/chip.module.d.ts +8 -0
  97. package/chip/index.d.ts +5 -0
  98. package/chip/public-api.d.ts +2 -0
  99. package/colorpicker/colorpicker.component.d.ts +87 -0
  100. package/colorpicker/colorpicker.module.d.ts +8 -0
  101. package/colorpicker/index.d.ts +5 -0
  102. package/colorpicker/public-api.d.ts +2 -0
  103. package/config/forms.d.ts +17 -0
  104. package/config/index.d.ts +5 -0
  105. package/config/initializer.d.ts +3 -0
  106. package/config/menu-item.d.ts +52 -0
  107. package/config/options.d.ts +48 -0
  108. package/config/popup.d.ts +48 -0
  109. package/config/provide.d.ts +23 -0
  110. package/config/public-api.d.ts +17 -0
  111. package/config/ripple.d.ts +2 -0
  112. package/config/scroll-lock.d.ts +5 -0
  113. package/config/severity.d.ts +5 -0
  114. package/config/style-loader.d.ts +12 -0
  115. package/config/template.d.ts +19 -0
  116. package/config/theme.service.d.ts +46 -0
  117. package/config/version-guard.d.ts +14 -0
  118. package/config/version.d.ts +6 -0
  119. package/config/wu-config.service.d.ts +24 -0
  120. package/confirmdialog/confirmation.service.d.ts +25 -0
  121. package/confirmdialog/confirmdialog.base.d.ts +110 -0
  122. package/confirmdialog/confirmdialog.component.d.ts +11 -0
  123. package/confirmdialog/confirmdialog.module.d.ts +9 -0
  124. package/confirmdialog/confirmdialog.types.d.ts +37 -0
  125. package/confirmdialog/index.d.ts +5 -0
  126. package/confirmdialog/public-api.d.ts +5 -0
  127. package/contextmenu/contextmenu.component.d.ts +47 -0
  128. package/contextmenu/contextmenu.module.d.ts +8 -0
  129. package/contextmenu/index.d.ts +5 -0
  130. package/contextmenu/public-api.d.ts +2 -0
  131. package/core/carousel.d.ts +27 -0
  132. package/core/catalog.d.ts +446 -0
  133. package/core/chart/format.d.ts +19 -0
  134. package/core/chart/index.d.ts +6 -0
  135. package/core/chart/kinds.d.ts +78 -0
  136. package/core/chart/model.d.ts +500 -0
  137. package/core/chart/more.d.ts +33 -0
  138. package/core/chart/paths.d.ts +41 -0
  139. package/core/chart/scale.d.ts +22 -0
  140. package/core/color.d.ts +31 -0
  141. package/core/colorpicker.d.ts +23 -0
  142. package/core/compat.d.ts +11 -0
  143. package/core/config.d.ts +64 -0
  144. package/core/date.d.ts +130 -0
  145. package/core/datepicker.d.ts +184 -0
  146. package/core/dock.d.ts +6 -0
  147. package/core/editor.d.ts +117 -0
  148. package/core/errorpage.d.ts +15 -0
  149. package/core/excel.d.ts +239 -0
  150. package/core/exporters.d.ts +18 -0
  151. package/core/families.d.ts +13 -0
  152. package/core/fileupload.d.ts +24 -0
  153. package/core/flow/changes.d.ts +63 -0
  154. package/core/flow/edges.d.ts +52 -0
  155. package/core/flow/export.d.ts +56 -0
  156. package/core/flow/geometry.d.ts +117 -0
  157. package/core/flow/graph.d.ts +104 -0
  158. package/core/flow/history.d.ts +54 -0
  159. package/core/flow/index.d.ts +13 -0
  160. package/core/flow/interaction.d.ts +140 -0
  161. package/core/flow/layout.d.ts +57 -0
  162. package/core/flow/paths.d.ts +76 -0
  163. package/core/flow/text.d.ts +18 -0
  164. package/core/flow/types.d.ts +217 -0
  165. package/core/flow/viewport.d.ts +48 -0
  166. package/core/i18n.d.ts +24 -0
  167. package/core/imagecompare.d.ts +12 -0
  168. package/core/imagecropper.d.ts +183 -0
  169. package/core/index.d.ts +39 -0
  170. package/core/inputotp.d.ts +20 -0
  171. package/core/knob.d.ts +28 -0
  172. package/core/mask.d.ts +43 -0
  173. package/core/menu.d.ts +29 -0
  174. package/core/number.d.ts +66 -0
  175. package/core/organizationchart.d.ts +39 -0
  176. package/core/overrides.d.ts +109 -0
  177. package/core/picklist.d.ts +81 -0
  178. package/core/select.d.ts +44 -0
  179. package/core/splitter.d.ts +17 -0
  180. package/core/table.d.ts +48 -0
  181. package/core/terminal.d.ts +12 -0
  182. package/core/thai/buddhist.d.ts +22 -0
  183. package/core/thai/locale.d.ts +358 -0
  184. package/core/thai/text.d.ts +32 -0
  185. package/core/thai/thai-id.d.ts +6 -0
  186. package/core/tokens.d.ts +69 -0
  187. package/core/tree.d.ts +50 -0
  188. package/core/validation.d.ts +18 -0
  189. package/datepicker/datepicker.component.d.ts +275 -0
  190. package/datepicker/datepicker.module.d.ts +8 -0
  191. package/datepicker/datepicker.types.d.ts +10 -0
  192. package/datepicker/index.d.ts +5 -0
  193. package/datepicker/public-api.d.ts +3 -0
  194. package/dialog/dialog.base.d.ts +147 -0
  195. package/dialog/dialog.component.d.ts +11 -0
  196. package/dialog/dialog.module.d.ts +10 -0
  197. package/dialog/dialog.service.d.ts +104 -0
  198. package/dialog/dialog.types.d.ts +3 -0
  199. package/dialog/index.d.ts +5 -0
  200. package/dialog/public-api.d.ts +5 -0
  201. package/divider/divider.component.d.ts +20 -0
  202. package/divider/divider.module.d.ts +8 -0
  203. package/divider/divider.types.d.ts +4 -0
  204. package/divider/index.d.ts +5 -0
  205. package/divider/public-api.d.ts +3 -0
  206. package/dock/dock.component.d.ts +88 -0
  207. package/dock/dock.module.d.ts +9 -0
  208. package/dock/index.d.ts +5 -0
  209. package/dock/public-api.d.ts +2 -0
  210. package/dragdrop/dragdrop.directive.d.ts +65 -0
  211. package/dragdrop/dragdrop.module.d.ts +8 -0
  212. package/dragdrop/dragdrop.styles.d.ts +2 -0
  213. package/dragdrop/index.d.ts +5 -0
  214. package/dragdrop/public-api.d.ts +2 -0
  215. package/drawer/drawer.component.d.ts +102 -0
  216. package/drawer/drawer.module.d.ts +8 -0
  217. package/drawer/index.d.ts +5 -0
  218. package/drawer/public-api.d.ts +5 -0
  219. package/editor/editor-content.directive.d.ts +10 -0
  220. package/editor/editor-icon.directive.d.ts +8 -0
  221. package/editor/editor.base.d.ts +367 -0
  222. package/editor/editor.component.d.ts +11 -0
  223. package/editor/editor.dom.d.ts +91 -0
  224. package/editor/editor.icons.d.ts +13 -0
  225. package/editor/editor.module.d.ts +10 -0
  226. package/editor/editor.styles.d.ts +2 -0
  227. package/editor/editor.types.d.ts +92 -0
  228. package/editor/index.d.ts +5 -0
  229. package/editor/public-api.d.ts +6 -0
  230. package/emptystate/emptystate.component.d.ts +44 -0
  231. package/emptystate/emptystate.module.d.ts +8 -0
  232. package/emptystate/index.d.ts +5 -0
  233. package/emptystate/public-api.d.ts +2 -0
  234. package/errorpage/errorpage.component.d.ts +73 -0
  235. package/errorpage/errorpage.module.d.ts +8 -0
  236. package/errorpage/index.d.ts +5 -0
  237. package/errorpage/public-api.d.ts +2 -0
  238. package/esm2020/accordion/accordion.component.mjs +376 -0
  239. package/esm2020/accordion/accordion.module.mjs +19 -0
  240. package/esm2020/accordion/accordion.types.mjs +17 -0
  241. package/esm2020/accordion/public-api.mjs +4 -0
  242. package/esm2020/accordion/wirabyte-ui-accordion.mjs +5 -0
  243. package/esm2020/alert/alert-dialog.base.mjs +355 -0
  244. package/esm2020/alert/alert-dialog.component.mjs +21 -0
  245. package/esm2020/alert/alert.module.mjs +17 -0
  246. package/esm2020/alert/alert.service.mjs +142 -0
  247. package/esm2020/alert/alert.types.mjs +2 -0
  248. package/esm2020/alert/public-api.mjs +6 -0
  249. package/esm2020/alert/wirabyte-ui-alert.mjs +5 -0
  250. package/esm2020/animate/animate.directive.mjs +71 -0
  251. package/esm2020/animate/animate.module.mjs +21 -0
  252. package/esm2020/animate/animate.service.mjs +183 -0
  253. package/esm2020/animate/animate.styles.mjs +3 -0
  254. package/esm2020/animate/animate.types.mjs +2 -0
  255. package/esm2020/animate/public-api.mjs +5 -0
  256. package/esm2020/animate/wirabyte-ui-animate.mjs +5 -0
  257. package/esm2020/api/public-api.mjs +11 -0
  258. package/esm2020/api/shared.module.mjs +17 -0
  259. package/esm2020/api/wirabyte-ui-api.mjs +5 -0
  260. package/esm2020/asidemenu/asidemenu.component.mjs +811 -0
  261. package/esm2020/asidemenu/asidemenu.module.mjs +18 -0
  262. package/esm2020/asidemenu/public-api.mjs +3 -0
  263. package/esm2020/asidemenu/wirabyte-ui-asidemenu.mjs +5 -0
  264. package/esm2020/autocomplete/autocomplete.base.mjs +567 -0
  265. package/esm2020/autocomplete/autocomplete.component.mjs +24 -0
  266. package/esm2020/autocomplete/autocomplete.module.mjs +18 -0
  267. package/esm2020/autocomplete/autocomplete.types.mjs +2 -0
  268. package/esm2020/autocomplete/public-api.mjs +5 -0
  269. package/esm2020/autocomplete/wirabyte-ui-autocomplete.mjs +5 -0
  270. package/esm2020/avatar/avatar.component.mjs +81 -0
  271. package/esm2020/avatar/avatar.module.mjs +17 -0
  272. package/esm2020/avatar/avatar.types.mjs +2 -0
  273. package/esm2020/avatar/public-api.mjs +4 -0
  274. package/esm2020/avatar/wirabyte-ui-avatar.mjs +5 -0
  275. package/esm2020/badge/badge.component.mjs +52 -0
  276. package/esm2020/badge/badge.directive.mjs +111 -0
  277. package/esm2020/badge/badge.module.mjs +18 -0
  278. package/esm2020/badge/badge.styles.mjs +3 -0
  279. package/esm2020/badge/badge.types.mjs +2 -0
  280. package/esm2020/badge/public-api.mjs +5 -0
  281. package/esm2020/badge/wirabyte-ui-badge.mjs +5 -0
  282. package/esm2020/blockui/blockui.component.mjs +152 -0
  283. package/esm2020/blockui/blockui.module.mjs +17 -0
  284. package/esm2020/blockui/public-api.mjs +3 -0
  285. package/esm2020/blockui/wirabyte-ui-blockui.mjs +5 -0
  286. package/esm2020/bottombar/bottombar.component.mjs +209 -0
  287. package/esm2020/bottombar/bottombar.module.mjs +18 -0
  288. package/esm2020/bottombar/public-api.mjs +3 -0
  289. package/esm2020/bottombar/wirabyte-ui-bottombar.mjs +5 -0
  290. package/esm2020/breadcrumb/breadcrumb.component.mjs +86 -0
  291. package/esm2020/breadcrumb/breadcrumb.module.mjs +17 -0
  292. package/esm2020/breadcrumb/public-api.mjs +3 -0
  293. package/esm2020/breadcrumb/wirabyte-ui-breadcrumb.mjs +5 -0
  294. package/esm2020/button/button-class.mjs +26 -0
  295. package/esm2020/button/button.component.mjs +175 -0
  296. package/esm2020/button/button.directive.mjs +193 -0
  297. package/esm2020/button/button.module.mjs +18 -0
  298. package/esm2020/button/button.styles.mjs +3 -0
  299. package/esm2020/button/button.types.mjs +2 -0
  300. package/esm2020/button/public-api.mjs +8 -0
  301. package/esm2020/button/wirabyte-ui-button.mjs +5 -0
  302. package/esm2020/card/card-slots.mjs +27 -0
  303. package/esm2020/card/card.component.mjs +88 -0
  304. package/esm2020/card/card.module.mjs +19 -0
  305. package/esm2020/card/card.types.mjs +2 -0
  306. package/esm2020/card/public-api.mjs +5 -0
  307. package/esm2020/card/wirabyte-ui-card.mjs +5 -0
  308. package/esm2020/carousel/carousel.component.mjs +617 -0
  309. package/esm2020/carousel/carousel.module.mjs +19 -0
  310. package/esm2020/carousel/carousel.types.mjs +2 -0
  311. package/esm2020/carousel/public-api.mjs +4 -0
  312. package/esm2020/carousel/wirabyte-ui-carousel.mjs +5 -0
  313. package/esm2020/chart/chart.component.mjs +42 -0
  314. package/esm2020/chart/chart.module.mjs +17 -0
  315. package/esm2020/chart/public-api.mjs +3 -0
  316. package/esm2020/chart/wirabyte-ui-chart.mjs +5 -0
  317. package/esm2020/chartjs/chartjs.base.mjs +204 -0
  318. package/esm2020/chartjs/chartjs.component.mjs +41 -0
  319. package/esm2020/chartjs/chartjs.module.mjs +17 -0
  320. package/esm2020/chartjs/chartjs.types.mjs +2 -0
  321. package/esm2020/chartjs/public-api.mjs +5 -0
  322. package/esm2020/chartjs/wirabyte-ui-chartjs.mjs +5 -0
  323. package/esm2020/checkbox/checkbox.component.mjs +140 -0
  324. package/esm2020/checkbox/checkbox.module.mjs +17 -0
  325. package/esm2020/checkbox/checkbox.styles.mjs +3 -0
  326. package/esm2020/checkbox/checkbox.types.mjs +2 -0
  327. package/esm2020/checkbox/public-api.mjs +6 -0
  328. package/esm2020/checkbox/wirabyte-ui-checkbox.mjs +5 -0
  329. package/esm2020/chip/chip.component.mjs +76 -0
  330. package/esm2020/chip/chip.module.mjs +17 -0
  331. package/esm2020/chip/public-api.mjs +3 -0
  332. package/esm2020/chip/wirabyte-ui-chip.mjs +5 -0
  333. package/esm2020/colorpicker/colorpicker.component.mjs +308 -0
  334. package/esm2020/colorpicker/colorpicker.module.mjs +17 -0
  335. package/esm2020/colorpicker/public-api.mjs +3 -0
  336. package/esm2020/colorpicker/wirabyte-ui-colorpicker.mjs +5 -0
  337. package/esm2020/config/forms.mjs +38 -0
  338. package/esm2020/config/initializer.mjs +6 -0
  339. package/esm2020/config/menu-item.mjs +2 -0
  340. package/esm2020/config/options.mjs +3 -0
  341. package/esm2020/config/popup.mjs +153 -0
  342. package/esm2020/config/provide.mjs +45 -0
  343. package/esm2020/config/public-api.mjs +17 -0
  344. package/esm2020/config/ripple.mjs +13 -0
  345. package/esm2020/config/scroll-lock.mjs +31 -0
  346. package/esm2020/config/severity.mjs +9 -0
  347. package/esm2020/config/style-loader.mjs +32 -0
  348. package/esm2020/config/template.mjs +46 -0
  349. package/esm2020/config/theme.service.mjs +161 -0
  350. package/esm2020/config/version-guard.mjs +43 -0
  351. package/esm2020/config/version.mjs +3 -0
  352. package/esm2020/config/wirabyte-ui-config.mjs +5 -0
  353. package/esm2020/config/wu-config.service.mjs +50 -0
  354. package/esm2020/confirmdialog/confirmation.service.mjs +78 -0
  355. package/esm2020/confirmdialog/confirmdialog.base.mjs +274 -0
  356. package/esm2020/confirmdialog/confirmdialog.component.mjs +22 -0
  357. package/esm2020/confirmdialog/confirmdialog.module.mjs +18 -0
  358. package/esm2020/confirmdialog/confirmdialog.types.mjs +8 -0
  359. package/esm2020/confirmdialog/public-api.mjs +6 -0
  360. package/esm2020/confirmdialog/wirabyte-ui-confirmdialog.mjs +5 -0
  361. package/esm2020/contextmenu/contextmenu.component.mjs +159 -0
  362. package/esm2020/contextmenu/contextmenu.module.mjs +17 -0
  363. package/esm2020/contextmenu/public-api.mjs +3 -0
  364. package/esm2020/contextmenu/wirabyte-ui-contextmenu.mjs +5 -0
  365. package/esm2020/core/carousel.mjs +62 -0
  366. package/esm2020/core/catalog.mjs +203 -0
  367. package/esm2020/core/chart/format.mjs +66 -0
  368. package/esm2020/core/chart/index.mjs +7 -0
  369. package/esm2020/core/chart/kinds.mjs +1336 -0
  370. package/esm2020/core/chart/model.mjs +713 -0
  371. package/esm2020/core/chart/more.mjs +311 -0
  372. package/esm2020/core/chart/paths.mjs +160 -0
  373. package/esm2020/core/chart/scale.mjs +58 -0
  374. package/esm2020/core/color.mjs +94 -0
  375. package/esm2020/core/colorpicker.mjs +73 -0
  376. package/esm2020/core/compat.mjs +149 -0
  377. package/esm2020/core/config.mjs +163 -0
  378. package/esm2020/core/date.mjs +317 -0
  379. package/esm2020/core/datepicker.mjs +526 -0
  380. package/esm2020/core/dock.mjs +14 -0
  381. package/esm2020/core/editor.mjs +271 -0
  382. package/esm2020/core/errorpage.mjs +47 -0
  383. package/esm2020/core/excel.mjs +809 -0
  384. package/esm2020/core/exporters.mjs +241 -0
  385. package/esm2020/core/families.mjs +1756 -0
  386. package/esm2020/core/fileupload.mjs +48 -0
  387. package/esm2020/core/flow/changes.mjs +205 -0
  388. package/esm2020/core/flow/edges.mjs +87 -0
  389. package/esm2020/core/flow/export.mjs +231 -0
  390. package/esm2020/core/flow/geometry.mjs +309 -0
  391. package/esm2020/core/flow/graph.mjs +314 -0
  392. package/esm2020/core/flow/history.mjs +105 -0
  393. package/esm2020/core/flow/index.mjs +14 -0
  394. package/esm2020/core/flow/interaction.mjs +246 -0
  395. package/esm2020/core/flow/layout.mjs +586 -0
  396. package/esm2020/core/flow/paths.mjs +252 -0
  397. package/esm2020/core/flow/text.mjs +68 -0
  398. package/esm2020/core/flow/types.mjs +7 -0
  399. package/esm2020/core/flow/viewport.mjs +133 -0
  400. package/esm2020/core/i18n.mjs +78 -0
  401. package/esm2020/core/imagecompare.mjs +28 -0
  402. package/esm2020/core/imagecropper.mjs +483 -0
  403. package/esm2020/core/index.mjs +40 -0
  404. package/esm2020/core/inputotp.mjs +50 -0
  405. package/esm2020/core/knob.mjs +106 -0
  406. package/esm2020/core/mask.mjs +112 -0
  407. package/esm2020/core/menu.mjs +77 -0
  408. package/esm2020/core/number.mjs +131 -0
  409. package/esm2020/core/organizationchart.mjs +84 -0
  410. package/esm2020/core/overrides.mjs +169 -0
  411. package/esm2020/core/picklist.mjs +248 -0
  412. package/esm2020/core/select.mjs +161 -0
  413. package/esm2020/core/splitter.mjs +63 -0
  414. package/esm2020/core/table.mjs +174 -0
  415. package/esm2020/core/terminal.mjs +29 -0
  416. package/esm2020/core/thai/buddhist.mjs +129 -0
  417. package/esm2020/core/thai/locale.mjs +652 -0
  418. package/esm2020/core/thai/text.mjs +164 -0
  419. package/esm2020/core/thai/thai-id.mjs +22 -0
  420. package/esm2020/core/tokens.mjs +314 -0
  421. package/esm2020/core/tree.mjs +137 -0
  422. package/esm2020/core/validation.mjs +43 -0
  423. package/esm2020/core/wirabyte-ui-core.mjs +5 -0
  424. package/esm2020/datepicker/datepicker.component.mjs +921 -0
  425. package/esm2020/datepicker/datepicker.module.mjs +17 -0
  426. package/esm2020/datepicker/datepicker.types.mjs +2 -0
  427. package/esm2020/datepicker/public-api.mjs +4 -0
  428. package/esm2020/datepicker/wirabyte-ui-datepicker.mjs +5 -0
  429. package/esm2020/dialog/dialog.base.mjs +433 -0
  430. package/esm2020/dialog/dialog.component.mjs +18 -0
  431. package/esm2020/dialog/dialog.module.mjs +19 -0
  432. package/esm2020/dialog/dialog.service.mjs +237 -0
  433. package/esm2020/dialog/dialog.types.mjs +2 -0
  434. package/esm2020/dialog/public-api.mjs +6 -0
  435. package/esm2020/dialog/wirabyte-ui-dialog.mjs +5 -0
  436. package/esm2020/divider/divider.component.mjs +56 -0
  437. package/esm2020/divider/divider.module.mjs +17 -0
  438. package/esm2020/divider/divider.types.mjs +2 -0
  439. package/esm2020/divider/public-api.mjs +4 -0
  440. package/esm2020/divider/wirabyte-ui-divider.mjs +5 -0
  441. package/esm2020/dock/dock.component.mjs +287 -0
  442. package/esm2020/dock/dock.module.mjs +18 -0
  443. package/esm2020/dock/public-api.mjs +3 -0
  444. package/esm2020/dock/wirabyte-ui-dock.mjs +5 -0
  445. package/esm2020/dragdrop/dragdrop.directive.mjs +206 -0
  446. package/esm2020/dragdrop/dragdrop.module.mjs +17 -0
  447. package/esm2020/dragdrop/dragdrop.styles.mjs +3 -0
  448. package/esm2020/dragdrop/public-api.mjs +3 -0
  449. package/esm2020/dragdrop/wirabyte-ui-dragdrop.mjs +5 -0
  450. package/esm2020/drawer/drawer.component.mjs +300 -0
  451. package/esm2020/drawer/drawer.module.mjs +17 -0
  452. package/esm2020/drawer/public-api.mjs +6 -0
  453. package/esm2020/drawer/wirabyte-ui-drawer.mjs +5 -0
  454. package/esm2020/editor/editor-content.directive.mjs +24 -0
  455. package/esm2020/editor/editor-icon.directive.mjs +24 -0
  456. package/esm2020/editor/editor.base.mjs +2082 -0
  457. package/esm2020/editor/editor.component.mjs +20 -0
  458. package/esm2020/editor/editor.dom.mjs +787 -0
  459. package/esm2020/editor/editor.icons.mjs +106 -0
  460. package/esm2020/editor/editor.module.mjs +19 -0
  461. package/esm2020/editor/editor.styles.mjs +3 -0
  462. package/esm2020/editor/editor.types.mjs +6 -0
  463. package/esm2020/editor/public-api.mjs +7 -0
  464. package/esm2020/editor/wirabyte-ui-editor.mjs +5 -0
  465. package/esm2020/emptystate/emptystate.component.mjs +78 -0
  466. package/esm2020/emptystate/emptystate.module.mjs +17 -0
  467. package/esm2020/emptystate/public-api.mjs +3 -0
  468. package/esm2020/emptystate/wirabyte-ui-emptystate.mjs +5 -0
  469. package/esm2020/errorpage/errorpage.component.mjs +163 -0
  470. package/esm2020/errorpage/errorpage.module.mjs +17 -0
  471. package/esm2020/errorpage/public-api.mjs +3 -0
  472. package/esm2020/errorpage/wirabyte-ui-errorpage.mjs +5 -0
  473. package/esm2020/excel/excel.mjs +35 -0
  474. package/esm2020/excel/public-api.mjs +3 -0
  475. package/esm2020/excel/wirabyte-ui-excel.mjs +5 -0
  476. package/esm2020/fieldset/fieldset.component.mjs +74 -0
  477. package/esm2020/fieldset/fieldset.module.mjs +18 -0
  478. package/esm2020/fieldset/public-api.mjs +3 -0
  479. package/esm2020/fieldset/wirabyte-ui-fieldset.mjs +5 -0
  480. package/esm2020/fileupload/fileupload.base.mjs +563 -0
  481. package/esm2020/fileupload/fileupload.component.mjs +19 -0
  482. package/esm2020/fileupload/fileupload.module.mjs +18 -0
  483. package/esm2020/fileupload/fileupload.types.mjs +2 -0
  484. package/esm2020/fileupload/public-api.mjs +5 -0
  485. package/esm2020/fileupload/wirabyte-ui-fileupload.mjs +5 -0
  486. package/esm2020/floatlabel/floatlabel.component.mjs +53 -0
  487. package/esm2020/floatlabel/floatlabel.module.mjs +17 -0
  488. package/esm2020/floatlabel/floatlabel.types.mjs +2 -0
  489. package/esm2020/floatlabel/public-api.mjs +4 -0
  490. package/esm2020/floatlabel/wirabyte-ui-floatlabel.mjs +5 -0
  491. package/esm2020/flow/flow-background.component.mjs +183 -0
  492. package/esm2020/flow/flow-controls.component.mjs +267 -0
  493. package/esm2020/flow/flow-handle.component.mjs +130 -0
  494. package/esm2020/flow/flow-history.directive.mjs +129 -0
  495. package/esm2020/flow/flow-host.mjs +7 -0
  496. package/esm2020/flow/flow-minimap.component.mjs +322 -0
  497. package/esm2020/flow/flow-node-outlet.mjs +148 -0
  498. package/esm2020/flow/flow-node-resizer.component.mjs +208 -0
  499. package/esm2020/flow/flow-node-toolbar.component.mjs +119 -0
  500. package/esm2020/flow/flow-panel.component.mjs +37 -0
  501. package/esm2020/flow/flow-templates.mjs +100 -0
  502. package/esm2020/flow/flow.component.mjs +3245 -0
  503. package/esm2020/flow/flow.module.mjs +76 -0
  504. package/esm2020/flow/flow.types.mjs +7 -0
  505. package/esm2020/flow/public-api.mjs +17 -0
  506. package/esm2020/flow/wirabyte-ui-flow.mjs +5 -0
  507. package/esm2020/galleria/galleria.component.mjs +480 -0
  508. package/esm2020/galleria/galleria.module.mjs +17 -0
  509. package/esm2020/galleria/public-api.mjs +3 -0
  510. package/esm2020/galleria/wirabyte-ui-galleria.mjs +5 -0
  511. package/esm2020/i18n/i18n.module.mjs +37 -0
  512. package/esm2020/i18n/i18n.service.mjs +148 -0
  513. package/esm2020/i18n/i18n.types.mjs +3 -0
  514. package/esm2020/i18n/language-switch.component.mjs +91 -0
  515. package/esm2020/i18n/public-api.mjs +7 -0
  516. package/esm2020/i18n/translate.pipe.mjs +52 -0
  517. package/esm2020/i18n/wirabyte-ui-i18n.mjs +5 -0
  518. package/esm2020/iconfield/iconfield.component.mjs +73 -0
  519. package/esm2020/iconfield/iconfield.module.mjs +17 -0
  520. package/esm2020/iconfield/public-api.mjs +3 -0
  521. package/esm2020/iconfield/wirabyte-ui-iconfield.mjs +5 -0
  522. package/esm2020/image/image.base.mjs +183 -0
  523. package/esm2020/image/image.component.mjs +14 -0
  524. package/esm2020/image/image.module.mjs +18 -0
  525. package/esm2020/image/public-api.mjs +4 -0
  526. package/esm2020/image/wirabyte-ui-image.mjs +5 -0
  527. package/esm2020/imagecompare/imagecompare.component.mjs +200 -0
  528. package/esm2020/imagecompare/imagecompare.module.mjs +18 -0
  529. package/esm2020/imagecompare/public-api.mjs +3 -0
  530. package/esm2020/imagecompare/wirabyte-ui-imagecompare.mjs +5 -0
  531. package/esm2020/imagecropper/imagecropper.component.mjs +1253 -0
  532. package/esm2020/imagecropper/imagecropper.module.mjs +17 -0
  533. package/esm2020/imagecropper/imagecropper.types.mjs +6 -0
  534. package/esm2020/imagecropper/public-api.mjs +5 -0
  535. package/esm2020/imagecropper/wirabyte-ui-imagecropper.mjs +5 -0
  536. package/esm2020/inplace/inplace.component.mjs +145 -0
  537. package/esm2020/inplace/inplace.module.mjs +17 -0
  538. package/esm2020/inplace/public-api.mjs +3 -0
  539. package/esm2020/inplace/wirabyte-ui-inplace.mjs +5 -0
  540. package/esm2020/inputgroup/inputgroup.component.mjs +61 -0
  541. package/esm2020/inputgroup/inputgroup.module.mjs +17 -0
  542. package/esm2020/inputgroup/public-api.mjs +3 -0
  543. package/esm2020/inputgroup/wirabyte-ui-inputgroup.mjs +5 -0
  544. package/esm2020/inputmask/inputmask.base.mjs +319 -0
  545. package/esm2020/inputmask/inputmask.component.mjs +23 -0
  546. package/esm2020/inputmask/inputmask.module.mjs +17 -0
  547. package/esm2020/inputmask/public-api.mjs +4 -0
  548. package/esm2020/inputmask/wirabyte-ui-inputmask.mjs +5 -0
  549. package/esm2020/inputnumber/inputnumber.component.mjs +364 -0
  550. package/esm2020/inputnumber/inputnumber.module.mjs +17 -0
  551. package/esm2020/inputnumber/inputnumber.types.mjs +2 -0
  552. package/esm2020/inputnumber/public-api.mjs +4 -0
  553. package/esm2020/inputnumber/wirabyte-ui-inputnumber.mjs +5 -0
  554. package/esm2020/inputotp/inputotp.component.mjs +344 -0
  555. package/esm2020/inputotp/inputotp.module.mjs +18 -0
  556. package/esm2020/inputotp/inputotp.types.mjs +2 -0
  557. package/esm2020/inputotp/public-api.mjs +4 -0
  558. package/esm2020/inputotp/wirabyte-ui-inputotp.mjs +5 -0
  559. package/esm2020/inputtext/inputtext.directive.mjs +62 -0
  560. package/esm2020/inputtext/inputtext.module.mjs +17 -0
  561. package/esm2020/inputtext/inputtext.styles.mjs +3 -0
  562. package/esm2020/inputtext/inputtext.types.mjs +2 -0
  563. package/esm2020/inputtext/public-api.mjs +6 -0
  564. package/esm2020/inputtext/wirabyte-ui-inputtext.mjs +5 -0
  565. package/esm2020/keyfilter/keyfilter.directive.mjs +131 -0
  566. package/esm2020/keyfilter/keyfilter.module.mjs +17 -0
  567. package/esm2020/keyfilter/public-api.mjs +3 -0
  568. package/esm2020/keyfilter/wirabyte-ui-keyfilter.mjs +5 -0
  569. package/esm2020/knob/knob.component.mjs +207 -0
  570. package/esm2020/knob/knob.module.mjs +17 -0
  571. package/esm2020/knob/public-api.mjs +3 -0
  572. package/esm2020/knob/wirabyte-ui-knob.mjs +5 -0
  573. package/esm2020/listbox/listbox.component.mjs +520 -0
  574. package/esm2020/listbox/listbox.module.mjs +17 -0
  575. package/esm2020/listbox/public-api.mjs +3 -0
  576. package/esm2020/listbox/wirabyte-ui-listbox.mjs +5 -0
  577. package/esm2020/menu/menu.base.mjs +320 -0
  578. package/esm2020/menu/menu.component.mjs +19 -0
  579. package/esm2020/menu/menu.module.mjs +18 -0
  580. package/esm2020/menu/public-api.mjs +4 -0
  581. package/esm2020/menu/wirabyte-ui-menu.mjs +5 -0
  582. package/esm2020/menubar/menubar.base.mjs +568 -0
  583. package/esm2020/menubar/menubar.component.mjs +19 -0
  584. package/esm2020/menubar/menubar.module.mjs +18 -0
  585. package/esm2020/menubar/public-api.mjs +4 -0
  586. package/esm2020/menubar/wirabyte-ui-menubar.mjs +5 -0
  587. package/esm2020/message/message.component.mjs +107 -0
  588. package/esm2020/message/message.module.mjs +20 -0
  589. package/esm2020/message/message.types.mjs +2 -0
  590. package/esm2020/message/messages.base.mjs +109 -0
  591. package/esm2020/message/messages.component.mjs +62 -0
  592. package/esm2020/message/public-api.mjs +6 -0
  593. package/esm2020/message/wirabyte-ui-message.mjs +5 -0
  594. package/esm2020/metergroup/metergroup.component.mjs +146 -0
  595. package/esm2020/metergroup/metergroup.module.mjs +17 -0
  596. package/esm2020/metergroup/metergroup.types.mjs +26 -0
  597. package/esm2020/metergroup/public-api.mjs +4 -0
  598. package/esm2020/metergroup/wirabyte-ui-metergroup.mjs +5 -0
  599. package/esm2020/multiselect/multiselect.base.mjs +732 -0
  600. package/esm2020/multiselect/multiselect.component.mjs +26 -0
  601. package/esm2020/multiselect/multiselect.module.mjs +18 -0
  602. package/esm2020/multiselect/multiselect.styles.mjs +3 -0
  603. package/esm2020/multiselect/multiselect.types.mjs +2 -0
  604. package/esm2020/multiselect/public-api.mjs +6 -0
  605. package/esm2020/multiselect/wirabyte-ui-multiselect.mjs +5 -0
  606. package/esm2020/navbar/navbar.component.mjs +460 -0
  607. package/esm2020/navbar/navbar.module.mjs +18 -0
  608. package/esm2020/navbar/public-api.mjs +3 -0
  609. package/esm2020/navbar/wirabyte-ui-navbar.mjs +5 -0
  610. package/esm2020/orderlist/orderlist.base.mjs +411 -0
  611. package/esm2020/orderlist/orderlist.component.mjs +17 -0
  612. package/esm2020/orderlist/orderlist.module.mjs +18 -0
  613. package/esm2020/orderlist/orderlist.types.mjs +2 -0
  614. package/esm2020/orderlist/public-api.mjs +5 -0
  615. package/esm2020/orderlist/wirabyte-ui-orderlist.mjs +5 -0
  616. package/esm2020/organizationchart/organizationchart.component.mjs +200 -0
  617. package/esm2020/organizationchart/organizationchart.module.mjs +18 -0
  618. package/esm2020/organizationchart/organizationchart.types.mjs +2 -0
  619. package/esm2020/organizationchart/public-api.mjs +4 -0
  620. package/esm2020/organizationchart/wirabyte-ui-organizationchart.mjs +5 -0
  621. package/esm2020/paginator/paginator.base.mjs +188 -0
  622. package/esm2020/paginator/paginator.component.mjs +20 -0
  623. package/esm2020/paginator/paginator.module.mjs +17 -0
  624. package/esm2020/paginator/paginator.types.mjs +2 -0
  625. package/esm2020/paginator/public-api.mjs +5 -0
  626. package/esm2020/paginator/wirabyte-ui-paginator.mjs +5 -0
  627. package/esm2020/panel/panel.component.mjs +108 -0
  628. package/esm2020/panel/panel.module.mjs +19 -0
  629. package/esm2020/panel/panel.types.mjs +2 -0
  630. package/esm2020/panel/public-api.mjs +4 -0
  631. package/esm2020/panel/wirabyte-ui-panel.mjs +5 -0
  632. package/esm2020/panelmenu/panelmenu.base.mjs +181 -0
  633. package/esm2020/panelmenu/panelmenu.component.mjs +15 -0
  634. package/esm2020/panelmenu/panelmenu.module.mjs +18 -0
  635. package/esm2020/panelmenu/public-api.mjs +4 -0
  636. package/esm2020/panelmenu/wirabyte-ui-panelmenu.mjs +5 -0
  637. package/esm2020/password/password.component.mjs +233 -0
  638. package/esm2020/password/password.module.mjs +17 -0
  639. package/esm2020/password/password.types.mjs +14 -0
  640. package/esm2020/password/public-api.mjs +4 -0
  641. package/esm2020/password/wirabyte-ui-password.mjs +5 -0
  642. package/esm2020/picklist/list-drag.mjs +259 -0
  643. package/esm2020/picklist/picklist.base.mjs +649 -0
  644. package/esm2020/picklist/picklist.component.mjs +17 -0
  645. package/esm2020/picklist/picklist.module.mjs +18 -0
  646. package/esm2020/picklist/picklist.styles.mjs +3 -0
  647. package/esm2020/picklist/picklist.types.mjs +2 -0
  648. package/esm2020/picklist/public-api.mjs +8 -0
  649. package/esm2020/picklist/wirabyte-ui-picklist.mjs +5 -0
  650. package/esm2020/popover/popover.base.mjs +171 -0
  651. package/esm2020/popover/popover.component.mjs +17 -0
  652. package/esm2020/popover/popover.module.mjs +18 -0
  653. package/esm2020/popover/public-api.mjs +4 -0
  654. package/esm2020/popover/wirabyte-ui-popover.mjs +5 -0
  655. package/esm2020/presets/public-api.mjs +5 -0
  656. package/esm2020/presets/wirabyte-ui-presets.mjs +5 -0
  657. package/esm2020/progressbar/progressbar.component.mjs +117 -0
  658. package/esm2020/progressbar/progressbar.module.mjs +17 -0
  659. package/esm2020/progressbar/progressbar.types.mjs +19 -0
  660. package/esm2020/progressbar/public-api.mjs +4 -0
  661. package/esm2020/progressbar/wirabyte-ui-progressbar.mjs +5 -0
  662. package/esm2020/progressspinner/progressspinner.component.mjs +109 -0
  663. package/esm2020/progressspinner/progressspinner.module.mjs +17 -0
  664. package/esm2020/progressspinner/progressspinner.types.mjs +27 -0
  665. package/esm2020/progressspinner/public-api.mjs +4 -0
  666. package/esm2020/progressspinner/wirabyte-ui-progressspinner.mjs +5 -0
  667. package/esm2020/public-api.mjs +3 -0
  668. package/esm2020/radiobutton/public-api.mjs +7 -0
  669. package/esm2020/radiobutton/radio-registry.mjs +40 -0
  670. package/esm2020/radiobutton/radiobutton.component.mjs +125 -0
  671. package/esm2020/radiobutton/radiobutton.module.mjs +17 -0
  672. package/esm2020/radiobutton/radiobutton.styles.mjs +3 -0
  673. package/esm2020/radiobutton/radiobutton.types.mjs +2 -0
  674. package/esm2020/radiobutton/wirabyte-ui-radiobutton.mjs +5 -0
  675. package/esm2020/rating/public-api.mjs +4 -0
  676. package/esm2020/rating/rating.component.mjs +107 -0
  677. package/esm2020/rating/rating.module.mjs +17 -0
  678. package/esm2020/rating/rating.types.mjs +2 -0
  679. package/esm2020/rating/wirabyte-ui-rating.mjs +5 -0
  680. package/esm2020/result/public-api.mjs +3 -0
  681. package/esm2020/result/result.component.mjs +72 -0
  682. package/esm2020/result/result.module.mjs +17 -0
  683. package/esm2020/result/wirabyte-ui-result.mjs +5 -0
  684. package/esm2020/ripple/public-api.mjs +3 -0
  685. package/esm2020/ripple/ripple.directive.mjs +43 -0
  686. package/esm2020/ripple/ripple.module.mjs +17 -0
  687. package/esm2020/ripple/ripple.styles.mjs +3 -0
  688. package/esm2020/ripple/wirabyte-ui-ripple.mjs +5 -0
  689. package/esm2020/scroller/public-api.mjs +6 -0
  690. package/esm2020/scroller/scroller.component.mjs +305 -0
  691. package/esm2020/scroller/scroller.module.mjs +17 -0
  692. package/esm2020/scroller/wirabyte-ui-scroller.mjs +5 -0
  693. package/esm2020/scrollpanel/public-api.mjs +3 -0
  694. package/esm2020/scrollpanel/scrollpanel.component.mjs +67 -0
  695. package/esm2020/scrollpanel/scrollpanel.module.mjs +17 -0
  696. package/esm2020/scrollpanel/wirabyte-ui-scrollpanel.mjs +5 -0
  697. package/esm2020/select/public-api.mjs +7 -0
  698. package/esm2020/select/select.base.mjs +667 -0
  699. package/esm2020/select/select.component.mjs +26 -0
  700. package/esm2020/select/select.module.mjs +17 -0
  701. package/esm2020/select/select.styles.mjs +3 -0
  702. package/esm2020/select/select.types.mjs +2 -0
  703. package/esm2020/select/wirabyte-ui-select.mjs +5 -0
  704. package/esm2020/selectbutton/public-api.mjs +4 -0
  705. package/esm2020/selectbutton/selectbutton.component.mjs +174 -0
  706. package/esm2020/selectbutton/selectbutton.module.mjs +18 -0
  707. package/esm2020/selectbutton/selectbutton.types.mjs +2 -0
  708. package/esm2020/selectbutton/wirabyte-ui-selectbutton.mjs +5 -0
  709. package/esm2020/sitefooter/public-api.mjs +3 -0
  710. package/esm2020/sitefooter/sitefooter.component.mjs +139 -0
  711. package/esm2020/sitefooter/sitefooter.module.mjs +18 -0
  712. package/esm2020/sitefooter/wirabyte-ui-sitefooter.mjs +5 -0
  713. package/esm2020/skeleton/public-api.mjs +4 -0
  714. package/esm2020/skeleton/skeleton.component.mjs +51 -0
  715. package/esm2020/skeleton/skeleton.module.mjs +17 -0
  716. package/esm2020/skeleton/skeleton.types.mjs +2 -0
  717. package/esm2020/skeleton/wirabyte-ui-skeleton.mjs +5 -0
  718. package/esm2020/slider/public-api.mjs +3 -0
  719. package/esm2020/slider/slider.component.mjs +247 -0
  720. package/esm2020/slider/slider.module.mjs +17 -0
  721. package/esm2020/slider/wirabyte-ui-slider.mjs +5 -0
  722. package/esm2020/splitbutton/public-api.mjs +3 -0
  723. package/esm2020/splitbutton/splitbutton.component.mjs +180 -0
  724. package/esm2020/splitbutton/splitbutton.module.mjs +17 -0
  725. package/esm2020/splitbutton/wirabyte-ui-splitbutton.mjs +5 -0
  726. package/esm2020/splitter/public-api.mjs +5 -0
  727. package/esm2020/splitter/splitter-panel.component.mjs +32 -0
  728. package/esm2020/splitter/splitter.component.mjs +372 -0
  729. package/esm2020/splitter/splitter.module.mjs +19 -0
  730. package/esm2020/splitter/splitter.types.mjs +2 -0
  731. package/esm2020/splitter/wirabyte-ui-splitter.mjs +5 -0
  732. package/esm2020/stepper/public-api.mjs +4 -0
  733. package/esm2020/stepper/stepper.base.mjs +392 -0
  734. package/esm2020/stepper/stepper.component.mjs +191 -0
  735. package/esm2020/stepper/stepper.module.mjs +19 -0
  736. package/esm2020/stepper/wirabyte-ui-stepper.mjs +5 -0
  737. package/esm2020/steps/public-api.mjs +4 -0
  738. package/esm2020/steps/steps.base.mjs +148 -0
  739. package/esm2020/steps/steps.component.mjs +15 -0
  740. package/esm2020/steps/steps.module.mjs +17 -0
  741. package/esm2020/steps/wirabyte-ui-steps.mjs +5 -0
  742. package/esm2020/table/public-api.mjs +10 -0
  743. package/esm2020/table/table-celleditor.component.mjs +34 -0
  744. package/esm2020/table/table-filter.component.mjs +123 -0
  745. package/esm2020/table/table.base.mjs +1443 -0
  746. package/esm2020/table/table.celleditor.mjs +42 -0
  747. package/esm2020/table/table.component.mjs +21 -0
  748. package/esm2020/table/table.directives.mjs +1117 -0
  749. package/esm2020/table/table.filter.mjs +346 -0
  750. package/esm2020/table/table.module.mjs +99 -0
  751. package/esm2020/table/table.types.mjs +3 -0
  752. package/esm2020/table/wirabyte-ui-table.mjs +5 -0
  753. package/esm2020/tabmenu/public-api.mjs +3 -0
  754. package/esm2020/tabmenu/wirabyte-ui-tabmenu.mjs +5 -0
  755. package/esm2020/tabs/public-api.mjs +9 -0
  756. package/esm2020/tabs/tabmenu.base.mjs +196 -0
  757. package/esm2020/tabs/tabmenu.component.mjs +18 -0
  758. package/esm2020/tabs/tabmenu.module.mjs +18 -0
  759. package/esm2020/tabs/tabs.component.mjs +477 -0
  760. package/esm2020/tabs/tabs.module.mjs +20 -0
  761. package/esm2020/tabs/tabs.styles.mjs +3 -0
  762. package/esm2020/tabs/tabs.types.mjs +50 -0
  763. package/esm2020/tabs/wirabyte-ui-tabs.mjs +5 -0
  764. package/esm2020/tag/public-api.mjs +4 -0
  765. package/esm2020/tag/tag.component.mjs +52 -0
  766. package/esm2020/tag/tag.module.mjs +17 -0
  767. package/esm2020/tag/tag.types.mjs +2 -0
  768. package/esm2020/tag/wirabyte-ui-tag.mjs +5 -0
  769. package/esm2020/terminal/public-api.mjs +6 -0
  770. package/esm2020/terminal/terminal.component.mjs +150 -0
  771. package/esm2020/terminal/terminal.module.mjs +17 -0
  772. package/esm2020/terminal/terminal.service.mjs +35 -0
  773. package/esm2020/terminal/wirabyte-ui-terminal.mjs +5 -0
  774. package/esm2020/textarea/public-api.mjs +3 -0
  775. package/esm2020/textarea/textarea.directive.mjs +87 -0
  776. package/esm2020/textarea/textarea.module.mjs +17 -0
  777. package/esm2020/textarea/wirabyte-ui-textarea.mjs +5 -0
  778. package/esm2020/thai/public-api.mjs +4 -0
  779. package/esm2020/thai/thai.module.mjs +18 -0
  780. package/esm2020/thai/thai.pipes.mjs +115 -0
  781. package/esm2020/thai/wirabyte-ui-thai.mjs +5 -0
  782. package/esm2020/tieredmenu/public-api.mjs +3 -0
  783. package/esm2020/tieredmenu/tieredmenu.component.mjs +385 -0
  784. package/esm2020/tieredmenu/tieredmenu.module.mjs +17 -0
  785. package/esm2020/tieredmenu/wirabyte-ui-tieredmenu.mjs +5 -0
  786. package/esm2020/timeline/public-api.mjs +4 -0
  787. package/esm2020/timeline/timeline.base.mjs +66 -0
  788. package/esm2020/timeline/timeline.component.mjs +46 -0
  789. package/esm2020/timeline/timeline.module.mjs +18 -0
  790. package/esm2020/timeline/wirabyte-ui-timeline.mjs +5 -0
  791. package/esm2020/toast/message.service.mjs +34 -0
  792. package/esm2020/toast/public-api.mjs +6 -0
  793. package/esm2020/toast/toast.base.mjs +227 -0
  794. package/esm2020/toast/toast.component.mjs +17 -0
  795. package/esm2020/toast/toast.module.mjs +18 -0
  796. package/esm2020/toast/toast.types.mjs +2 -0
  797. package/esm2020/toast/wirabyte-ui-toast.mjs +5 -0
  798. package/esm2020/togglebutton/public-api.mjs +4 -0
  799. package/esm2020/togglebutton/togglebutton.component.mjs +129 -0
  800. package/esm2020/togglebutton/togglebutton.module.mjs +17 -0
  801. package/esm2020/togglebutton/togglebutton.types.mjs +2 -0
  802. package/esm2020/togglebutton/wirabyte-ui-togglebutton.mjs +5 -0
  803. package/esm2020/toggleswitch/public-api.mjs +4 -0
  804. package/esm2020/toggleswitch/toggleswitch.component.mjs +123 -0
  805. package/esm2020/toggleswitch/toggleswitch.module.mjs +17 -0
  806. package/esm2020/toggleswitch/toggleswitch.types.mjs +2 -0
  807. package/esm2020/toggleswitch/wirabyte-ui-toggleswitch.mjs +5 -0
  808. package/esm2020/toolbar/public-api.mjs +3 -0
  809. package/esm2020/toolbar/toolbar.component.mjs +67 -0
  810. package/esm2020/toolbar/toolbar.module.mjs +18 -0
  811. package/esm2020/toolbar/wirabyte-ui-toolbar.mjs +5 -0
  812. package/esm2020/tooltip/public-api.mjs +4 -0
  813. package/esm2020/tooltip/tooltip.directive.mjs +370 -0
  814. package/esm2020/tooltip/tooltip.module.mjs +17 -0
  815. package/esm2020/tooltip/tooltip.styles.mjs +3 -0
  816. package/esm2020/tooltip/tooltip.types.mjs +2 -0
  817. package/esm2020/tooltip/wirabyte-ui-tooltip.mjs +5 -0
  818. package/esm2020/tree/public-api.mjs +3 -0
  819. package/esm2020/tree/tree.component.mjs +453 -0
  820. package/esm2020/tree/tree.module.mjs +17 -0
  821. package/esm2020/tree/wirabyte-ui-tree.mjs +5 -0
  822. package/esm2020/treeselect/public-api.mjs +3 -0
  823. package/esm2020/treeselect/treeselect.component.mjs +410 -0
  824. package/esm2020/treeselect/treeselect.module.mjs +17 -0
  825. package/esm2020/treeselect/wirabyte-ui-treeselect.mjs +5 -0
  826. package/esm2020/validation/field-error.component.mjs +84 -0
  827. package/esm2020/validation/public-api.mjs +4 -0
  828. package/esm2020/validation/validation.module.mjs +19 -0
  829. package/esm2020/validation/validators.mjs +84 -0
  830. package/esm2020/validation/wirabyte-ui-validation.mjs +5 -0
  831. package/esm2020/wirabyte-ui.mjs +5 -0
  832. package/excel/excel.d.ts +24 -0
  833. package/excel/index.d.ts +5 -0
  834. package/excel/public-api.d.ts +3 -0
  835. package/fesm2015/wirabyte-ui-accordion.mjs +416 -0
  836. package/fesm2015/wirabyte-ui-accordion.mjs.map +1 -0
  837. package/fesm2015/wirabyte-ui-alert.mjs +555 -0
  838. package/fesm2015/wirabyte-ui-alert.mjs.map +1 -0
  839. package/fesm2015/wirabyte-ui-animate.mjs +280 -0
  840. package/fesm2015/wirabyte-ui-animate.mjs.map +1 -0
  841. package/fesm2015/wirabyte-ui-api.mjs +34 -0
  842. package/fesm2015/wirabyte-ui-api.mjs.map +1 -0
  843. package/fesm2015/wirabyte-ui-asidemenu.mjs +848 -0
  844. package/fesm2015/wirabyte-ui-asidemenu.mjs.map +1 -0
  845. package/fesm2015/wirabyte-ui-autocomplete.mjs +619 -0
  846. package/fesm2015/wirabyte-ui-autocomplete.mjs.map +1 -0
  847. package/fesm2015/wirabyte-ui-avatar.mjs +103 -0
  848. package/fesm2015/wirabyte-ui-avatar.mjs.map +1 -0
  849. package/fesm2015/wirabyte-ui-badge.mjs +185 -0
  850. package/fesm2015/wirabyte-ui-badge.mjs.map +1 -0
  851. package/fesm2015/wirabyte-ui-blockui.mjs +176 -0
  852. package/fesm2015/wirabyte-ui-blockui.mjs.map +1 -0
  853. package/fesm2015/wirabyte-ui-bottombar.mjs +237 -0
  854. package/fesm2015/wirabyte-ui-bottombar.mjs.map +1 -0
  855. package/fesm2015/wirabyte-ui-breadcrumb.mjs +109 -0
  856. package/fesm2015/wirabyte-ui-breadcrumb.mjs.map +1 -0
  857. package/fesm2015/wirabyte-ui-button.mjs +415 -0
  858. package/fesm2015/wirabyte-ui-button.mjs.map +1 -0
  859. package/fesm2015/wirabyte-ui-card.mjs +134 -0
  860. package/fesm2015/wirabyte-ui-card.mjs.map +1 -0
  861. package/fesm2015/wirabyte-ui-carousel.mjs +647 -0
  862. package/fesm2015/wirabyte-ui-carousel.mjs.map +1 -0
  863. package/fesm2015/wirabyte-ui-chart.mjs +63 -0
  864. package/fesm2015/wirabyte-ui-chart.mjs.map +1 -0
  865. package/fesm2015/wirabyte-ui-chartjs.mjs +268 -0
  866. package/fesm2015/wirabyte-ui-chartjs.mjs.map +1 -0
  867. package/fesm2015/wirabyte-ui-checkbox.mjs +164 -0
  868. package/fesm2015/wirabyte-ui-checkbox.mjs.map +1 -0
  869. package/fesm2015/wirabyte-ui-chip.mjs +97 -0
  870. package/fesm2015/wirabyte-ui-chip.mjs.map +1 -0
  871. package/fesm2015/wirabyte-ui-colorpicker.mjs +333 -0
  872. package/fesm2015/wirabyte-ui-colorpicker.mjs.map +1 -0
  873. package/fesm2015/wirabyte-ui-config.mjs +624 -0
  874. package/fesm2015/wirabyte-ui-config.mjs.map +1 -0
  875. package/fesm2015/wirabyte-ui-confirmdialog.mjs +421 -0
  876. package/fesm2015/wirabyte-ui-confirmdialog.mjs.map +1 -0
  877. package/fesm2015/wirabyte-ui-contextmenu.mjs +185 -0
  878. package/fesm2015/wirabyte-ui-contextmenu.mjs.map +1 -0
  879. package/fesm2015/wirabyte-ui-core.mjs +13312 -0
  880. package/fesm2015/wirabyte-ui-core.mjs.map +1 -0
  881. package/fesm2015/wirabyte-ui-datepicker.mjs +951 -0
  882. package/fesm2015/wirabyte-ui-datepicker.mjs.map +1 -0
  883. package/fesm2015/wirabyte-ui-dialog.mjs +707 -0
  884. package/fesm2015/wirabyte-ui-dialog.mjs.map +1 -0
  885. package/fesm2015/wirabyte-ui-divider.mjs +77 -0
  886. package/fesm2015/wirabyte-ui-divider.mjs.map +1 -0
  887. package/fesm2015/wirabyte-ui-dock.mjs +317 -0
  888. package/fesm2015/wirabyte-ui-dock.mjs.map +1 -0
  889. package/fesm2015/wirabyte-ui-dragdrop.mjs +232 -0
  890. package/fesm2015/wirabyte-ui-dragdrop.mjs.map +1 -0
  891. package/fesm2015/wirabyte-ui-drawer.mjs +326 -0
  892. package/fesm2015/wirabyte-ui-drawer.mjs.map +1 -0
  893. package/fesm2015/wirabyte-ui-editor.mjs +3099 -0
  894. package/fesm2015/wirabyte-ui-editor.mjs.map +1 -0
  895. package/fesm2015/wirabyte-ui-emptystate.mjs +101 -0
  896. package/fesm2015/wirabyte-ui-emptystate.mjs.map +1 -0
  897. package/fesm2015/wirabyte-ui-errorpage.mjs +187 -0
  898. package/fesm2015/wirabyte-ui-errorpage.mjs.map +1 -0
  899. package/fesm2015/wirabyte-ui-excel.mjs +49 -0
  900. package/fesm2015/wirabyte-ui-excel.mjs.map +1 -0
  901. package/fesm2015/wirabyte-ui-fieldset.mjs +95 -0
  902. package/fesm2015/wirabyte-ui-fieldset.mjs.map +1 -0
  903. package/fesm2015/wirabyte-ui-fileupload.mjs +607 -0
  904. package/fesm2015/wirabyte-ui-fileupload.mjs.map +1 -0
  905. package/fesm2015/wirabyte-ui-floatlabel.mjs +74 -0
  906. package/fesm2015/wirabyte-ui-floatlabel.mjs.map +1 -0
  907. package/fesm2015/wirabyte-ui-flow.mjs +4967 -0
  908. package/fesm2015/wirabyte-ui-flow.mjs.map +1 -0
  909. package/fesm2015/wirabyte-ui-galleria.mjs +506 -0
  910. package/fesm2015/wirabyte-ui-galleria.mjs.map +1 -0
  911. package/fesm2015/wirabyte-ui-i18n.mjs +330 -0
  912. package/fesm2015/wirabyte-ui-i18n.mjs.map +1 -0
  913. package/fesm2015/wirabyte-ui-iconfield.mjs +94 -0
  914. package/fesm2015/wirabyte-ui-iconfield.mjs.map +1 -0
  915. package/fesm2015/wirabyte-ui-image.mjs +218 -0
  916. package/fesm2015/wirabyte-ui-image.mjs.map +1 -0
  917. package/fesm2015/wirabyte-ui-imagecompare.mjs +224 -0
  918. package/fesm2015/wirabyte-ui-imagecompare.mjs.map +1 -0
  919. package/fesm2015/wirabyte-ui-imagecropper.mjs +1301 -0
  920. package/fesm2015/wirabyte-ui-imagecropper.mjs.map +1 -0
  921. package/fesm2015/wirabyte-ui-inplace.mjs +167 -0
  922. package/fesm2015/wirabyte-ui-inplace.mjs.map +1 -0
  923. package/fesm2015/wirabyte-ui-inputgroup.mjs +82 -0
  924. package/fesm2015/wirabyte-ui-inputgroup.mjs.map +1 -0
  925. package/fesm2015/wirabyte-ui-inputmask.mjs +367 -0
  926. package/fesm2015/wirabyte-ui-inputmask.mjs.map +1 -0
  927. package/fesm2015/wirabyte-ui-inputnumber.mjs +388 -0
  928. package/fesm2015/wirabyte-ui-inputnumber.mjs.map +1 -0
  929. package/fesm2015/wirabyte-ui-inputotp.mjs +370 -0
  930. package/fesm2015/wirabyte-ui-inputotp.mjs.map +1 -0
  931. package/fesm2015/wirabyte-ui-inputtext.mjs +85 -0
  932. package/fesm2015/wirabyte-ui-inputtext.mjs.map +1 -0
  933. package/fesm2015/wirabyte-ui-keyfilter.mjs +155 -0
  934. package/fesm2015/wirabyte-ui-keyfilter.mjs.map +1 -0
  935. package/fesm2015/wirabyte-ui-knob.mjs +229 -0
  936. package/fesm2015/wirabyte-ui-knob.mjs.map +1 -0
  937. package/fesm2015/wirabyte-ui-listbox.mjs +543 -0
  938. package/fesm2015/wirabyte-ui-listbox.mjs.map +1 -0
  939. package/fesm2015/wirabyte-ui-menu.mjs +365 -0
  940. package/fesm2015/wirabyte-ui-menu.mjs.map +1 -0
  941. package/fesm2015/wirabyte-ui-menubar.mjs +614 -0
  942. package/fesm2015/wirabyte-ui-menubar.mjs.map +1 -0
  943. package/fesm2015/wirabyte-ui-message.mjs +291 -0
  944. package/fesm2015/wirabyte-ui-message.mjs.map +1 -0
  945. package/fesm2015/wirabyte-ui-metergroup.mjs +192 -0
  946. package/fesm2015/wirabyte-ui-metergroup.mjs.map +1 -0
  947. package/fesm2015/wirabyte-ui-multiselect.mjs +795 -0
  948. package/fesm2015/wirabyte-ui-multiselect.mjs.map +1 -0
  949. package/fesm2015/wirabyte-ui-navbar.mjs +491 -0
  950. package/fesm2015/wirabyte-ui-navbar.mjs.map +1 -0
  951. package/fesm2015/wirabyte-ui-orderlist.mjs +450 -0
  952. package/fesm2015/wirabyte-ui-orderlist.mjs.map +1 -0
  953. package/fesm2015/wirabyte-ui-organizationchart.mjs +225 -0
  954. package/fesm2015/wirabyte-ui-organizationchart.mjs.map +1 -0
  955. package/fesm2015/wirabyte-ui-paginator.mjs +226 -0
  956. package/fesm2015/wirabyte-ui-paginator.mjs.map +1 -0
  957. package/fesm2015/wirabyte-ui-panel.mjs +130 -0
  958. package/fesm2015/wirabyte-ui-panel.mjs.map +1 -0
  959. package/fesm2015/wirabyte-ui-panelmenu.mjs +216 -0
  960. package/fesm2015/wirabyte-ui-panelmenu.mjs.map +1 -0
  961. package/fesm2015/wirabyte-ui-password.mjs +271 -0
  962. package/fesm2015/wirabyte-ui-password.mjs.map +1 -0
  963. package/fesm2015/wirabyte-ui-picklist.mjs +954 -0
  964. package/fesm2015/wirabyte-ui-picklist.mjs.map +1 -0
  965. package/fesm2015/wirabyte-ui-popover.mjs +210 -0
  966. package/fesm2015/wirabyte-ui-popover.mjs.map +1 -0
  967. package/fesm2015/wirabyte-ui-presets.mjs +10 -0
  968. package/fesm2015/wirabyte-ui-presets.mjs.map +1 -0
  969. package/fesm2015/wirabyte-ui-progressbar.mjs +156 -0
  970. package/fesm2015/wirabyte-ui-progressbar.mjs.map +1 -0
  971. package/fesm2015/wirabyte-ui-progressspinner.mjs +158 -0
  972. package/fesm2015/wirabyte-ui-progressspinner.mjs.map +1 -0
  973. package/fesm2015/wirabyte-ui-radiobutton.mjs +186 -0
  974. package/fesm2015/wirabyte-ui-radiobutton.mjs.map +1 -0
  975. package/fesm2015/wirabyte-ui-rating.mjs +129 -0
  976. package/fesm2015/wirabyte-ui-rating.mjs.map +1 -0
  977. package/fesm2015/wirabyte-ui-result.mjs +95 -0
  978. package/fesm2015/wirabyte-ui-result.mjs.map +1 -0
  979. package/fesm2015/wirabyte-ui-ripple.mjs +67 -0
  980. package/fesm2015/wirabyte-ui-ripple.mjs.map +1 -0
  981. package/fesm2015/wirabyte-ui-scroller.mjs +330 -0
  982. package/fesm2015/wirabyte-ui-scroller.mjs.map +1 -0
  983. package/fesm2015/wirabyte-ui-scrollpanel.mjs +90 -0
  984. package/fesm2015/wirabyte-ui-scrollpanel.mjs.map +1 -0
  985. package/fesm2015/wirabyte-ui-select.mjs +730 -0
  986. package/fesm2015/wirabyte-ui-select.mjs.map +1 -0
  987. package/fesm2015/wirabyte-ui-selectbutton.mjs +195 -0
  988. package/fesm2015/wirabyte-ui-selectbutton.mjs.map +1 -0
  989. package/fesm2015/wirabyte-ui-sitefooter.mjs +166 -0
  990. package/fesm2015/wirabyte-ui-sitefooter.mjs.map +1 -0
  991. package/fesm2015/wirabyte-ui-skeleton.mjs +72 -0
  992. package/fesm2015/wirabyte-ui-skeleton.mjs.map +1 -0
  993. package/fesm2015/wirabyte-ui-slider.mjs +271 -0
  994. package/fesm2015/wirabyte-ui-slider.mjs.map +1 -0
  995. package/fesm2015/wirabyte-ui-splitbutton.mjs +202 -0
  996. package/fesm2015/wirabyte-ui-splitbutton.mjs.map +1 -0
  997. package/fesm2015/wirabyte-ui-splitter.mjs +431 -0
  998. package/fesm2015/wirabyte-ui-splitter.mjs.map +1 -0
  999. package/fesm2015/wirabyte-ui-stepper.mjs +607 -0
  1000. package/fesm2015/wirabyte-ui-stepper.mjs.map +1 -0
  1001. package/fesm2015/wirabyte-ui-steps.mjs +182 -0
  1002. package/fesm2015/wirabyte-ui-steps.mjs.map +1 -0
  1003. package/fesm2015/wirabyte-ui-table.mjs +3223 -0
  1004. package/fesm2015/wirabyte-ui-table.mjs.map +1 -0
  1005. package/fesm2015/wirabyte-ui-tabmenu.mjs +8 -0
  1006. package/fesm2015/wirabyte-ui-tabmenu.mjs.map +1 -0
  1007. package/fesm2015/wirabyte-ui-tabs.mjs +790 -0
  1008. package/fesm2015/wirabyte-ui-tabs.mjs.map +1 -0
  1009. package/fesm2015/wirabyte-ui-tag.mjs +73 -0
  1010. package/fesm2015/wirabyte-ui-tag.mjs.map +1 -0
  1011. package/fesm2015/wirabyte-ui-terminal.mjs +207 -0
  1012. package/fesm2015/wirabyte-ui-terminal.mjs.map +1 -0
  1013. package/fesm2015/wirabyte-ui-textarea.mjs +108 -0
  1014. package/fesm2015/wirabyte-ui-textarea.mjs.map +1 -0
  1015. package/fesm2015/wirabyte-ui-thai.mjs +138 -0
  1016. package/fesm2015/wirabyte-ui-thai.mjs.map +1 -0
  1017. package/fesm2015/wirabyte-ui-tieredmenu.mjs +417 -0
  1018. package/fesm2015/wirabyte-ui-tieredmenu.mjs.map +1 -0
  1019. package/fesm2015/wirabyte-ui-timeline.mjs +130 -0
  1020. package/fesm2015/wirabyte-ui-timeline.mjs.map +1 -0
  1021. package/fesm2015/wirabyte-ui-toast.mjs +294 -0
  1022. package/fesm2015/wirabyte-ui-toast.mjs.map +1 -0
  1023. package/fesm2015/wirabyte-ui-togglebutton.mjs +151 -0
  1024. package/fesm2015/wirabyte-ui-togglebutton.mjs.map +1 -0
  1025. package/fesm2015/wirabyte-ui-toggleswitch.mjs +144 -0
  1026. package/fesm2015/wirabyte-ui-toggleswitch.mjs.map +1 -0
  1027. package/fesm2015/wirabyte-ui-toolbar.mjs +88 -0
  1028. package/fesm2015/wirabyte-ui-toolbar.mjs.map +1 -0
  1029. package/fesm2015/wirabyte-ui-tooltip.mjs +398 -0
  1030. package/fesm2015/wirabyte-ui-tooltip.mjs.map +1 -0
  1031. package/fesm2015/wirabyte-ui-tree.mjs +480 -0
  1032. package/fesm2015/wirabyte-ui-tree.mjs.map +1 -0
  1033. package/fesm2015/wirabyte-ui-treeselect.mjs +438 -0
  1034. package/fesm2015/wirabyte-ui-treeselect.mjs.map +1 -0
  1035. package/fesm2015/wirabyte-ui-validation.mjs +189 -0
  1036. package/fesm2015/wirabyte-ui-validation.mjs.map +1 -0
  1037. package/fesm2015/wirabyte-ui.mjs +9 -0
  1038. package/fesm2015/wirabyte-ui.mjs.map +1 -0
  1039. package/fesm2020/wirabyte-ui-accordion.mjs +414 -0
  1040. package/fesm2020/wirabyte-ui-accordion.mjs.map +1 -0
  1041. package/fesm2020/wirabyte-ui-alert.mjs +529 -0
  1042. package/fesm2020/wirabyte-ui-alert.mjs.map +1 -0
  1043. package/fesm2020/wirabyte-ui-animate.mjs +276 -0
  1044. package/fesm2020/wirabyte-ui-animate.mjs.map +1 -0
  1045. package/fesm2020/wirabyte-ui-api.mjs +34 -0
  1046. package/fesm2020/wirabyte-ui-api.mjs.map +1 -0
  1047. package/fesm2020/wirabyte-ui-asidemenu.mjs +832 -0
  1048. package/fesm2020/wirabyte-ui-asidemenu.mjs.map +1 -0
  1049. package/fesm2020/wirabyte-ui-autocomplete.mjs +608 -0
  1050. package/fesm2020/wirabyte-ui-autocomplete.mjs.map +1 -0
  1051. package/fesm2020/wirabyte-ui-avatar.mjs +102 -0
  1052. package/fesm2020/wirabyte-ui-avatar.mjs.map +1 -0
  1053. package/fesm2020/wirabyte-ui-badge.mjs +183 -0
  1054. package/fesm2020/wirabyte-ui-badge.mjs.map +1 -0
  1055. package/fesm2020/wirabyte-ui-blockui.mjs +173 -0
  1056. package/fesm2020/wirabyte-ui-blockui.mjs.map +1 -0
  1057. package/fesm2020/wirabyte-ui-bottombar.mjs +230 -0
  1058. package/fesm2020/wirabyte-ui-bottombar.mjs.map +1 -0
  1059. package/fesm2020/wirabyte-ui-breadcrumb.mjs +107 -0
  1060. package/fesm2020/wirabyte-ui-breadcrumb.mjs.map +1 -0
  1061. package/fesm2020/wirabyte-ui-button.mjs +412 -0
  1062. package/fesm2020/wirabyte-ui-button.mjs.map +1 -0
  1063. package/fesm2020/wirabyte-ui-card.mjs +134 -0
  1064. package/fesm2020/wirabyte-ui-card.mjs.map +1 -0
  1065. package/fesm2020/wirabyte-ui-carousel.mjs +638 -0
  1066. package/fesm2020/wirabyte-ui-carousel.mjs.map +1 -0
  1067. package/fesm2020/wirabyte-ui-chart.mjs +63 -0
  1068. package/fesm2020/wirabyte-ui-chart.mjs.map +1 -0
  1069. package/fesm2020/wirabyte-ui-chartjs.mjs +262 -0
  1070. package/fesm2020/wirabyte-ui-chartjs.mjs.map +1 -0
  1071. package/fesm2020/wirabyte-ui-checkbox.mjs +164 -0
  1072. package/fesm2020/wirabyte-ui-checkbox.mjs.map +1 -0
  1073. package/fesm2020/wirabyte-ui-chip.mjs +97 -0
  1074. package/fesm2020/wirabyte-ui-chip.mjs.map +1 -0
  1075. package/fesm2020/wirabyte-ui-colorpicker.mjs +329 -0
  1076. package/fesm2020/wirabyte-ui-colorpicker.mjs.map +1 -0
  1077. package/fesm2020/wirabyte-ui-config.mjs +621 -0
  1078. package/fesm2020/wirabyte-ui-config.mjs.map +1 -0
  1079. package/fesm2020/wirabyte-ui-confirmdialog.mjs +395 -0
  1080. package/fesm2020/wirabyte-ui-confirmdialog.mjs.map +1 -0
  1081. package/fesm2020/wirabyte-ui-contextmenu.mjs +180 -0
  1082. package/fesm2020/wirabyte-ui-contextmenu.mjs.map +1 -0
  1083. package/fesm2020/wirabyte-ui-core.mjs +13367 -0
  1084. package/fesm2020/wirabyte-ui-core.mjs.map +1 -0
  1085. package/fesm2020/wirabyte-ui-datepicker.mjs +942 -0
  1086. package/fesm2020/wirabyte-ui-datepicker.mjs.map +1 -0
  1087. package/fesm2020/wirabyte-ui-dialog.mjs +698 -0
  1088. package/fesm2020/wirabyte-ui-dialog.mjs.map +1 -0
  1089. package/fesm2020/wirabyte-ui-divider.mjs +77 -0
  1090. package/fesm2020/wirabyte-ui-divider.mjs.map +1 -0
  1091. package/fesm2020/wirabyte-ui-dock.mjs +308 -0
  1092. package/fesm2020/wirabyte-ui-dock.mjs.map +1 -0
  1093. package/fesm2020/wirabyte-ui-dragdrop.mjs +229 -0
  1094. package/fesm2020/wirabyte-ui-dragdrop.mjs.map +1 -0
  1095. package/fesm2020/wirabyte-ui-drawer.mjs +321 -0
  1096. package/fesm2020/wirabyte-ui-drawer.mjs.map +1 -0
  1097. package/fesm2020/wirabyte-ui-editor.mjs +3056 -0
  1098. package/fesm2020/wirabyte-ui-editor.mjs.map +1 -0
  1099. package/fesm2020/wirabyte-ui-emptystate.mjs +99 -0
  1100. package/fesm2020/wirabyte-ui-emptystate.mjs.map +1 -0
  1101. package/fesm2020/wirabyte-ui-errorpage.mjs +184 -0
  1102. package/fesm2020/wirabyte-ui-errorpage.mjs.map +1 -0
  1103. package/fesm2020/wirabyte-ui-excel.mjs +43 -0
  1104. package/fesm2020/wirabyte-ui-excel.mjs.map +1 -0
  1105. package/fesm2020/wirabyte-ui-fieldset.mjs +95 -0
  1106. package/fesm2020/wirabyte-ui-fieldset.mjs.map +1 -0
  1107. package/fesm2020/wirabyte-ui-fileupload.mjs +599 -0
  1108. package/fesm2020/wirabyte-ui-fileupload.mjs.map +1 -0
  1109. package/fesm2020/wirabyte-ui-floatlabel.mjs +74 -0
  1110. package/fesm2020/wirabyte-ui-floatlabel.mjs.map +1 -0
  1111. package/fesm2020/wirabyte-ui-flow.mjs +4920 -0
  1112. package/fesm2020/wirabyte-ui-flow.mjs.map +1 -0
  1113. package/fesm2020/wirabyte-ui-galleria.mjs +501 -0
  1114. package/fesm2020/wirabyte-ui-galleria.mjs.map +1 -0
  1115. package/fesm2020/wirabyte-ui-i18n.mjs +321 -0
  1116. package/fesm2020/wirabyte-ui-i18n.mjs.map +1 -0
  1117. package/fesm2020/wirabyte-ui-iconfield.mjs +94 -0
  1118. package/fesm2020/wirabyte-ui-iconfield.mjs.map +1 -0
  1119. package/fesm2020/wirabyte-ui-image.mjs +214 -0
  1120. package/fesm2020/wirabyte-ui-image.mjs.map +1 -0
  1121. package/fesm2020/wirabyte-ui-imagecompare.mjs +221 -0
  1122. package/fesm2020/wirabyte-ui-imagecompare.mjs.map +1 -0
  1123. package/fesm2020/wirabyte-ui-imagecropper.mjs +1279 -0
  1124. package/fesm2020/wirabyte-ui-imagecropper.mjs.map +1 -0
  1125. package/fesm2020/wirabyte-ui-inplace.mjs +166 -0
  1126. package/fesm2020/wirabyte-ui-inplace.mjs.map +1 -0
  1127. package/fesm2020/wirabyte-ui-inputgroup.mjs +82 -0
  1128. package/fesm2020/wirabyte-ui-inputgroup.mjs.map +1 -0
  1129. package/fesm2020/wirabyte-ui-inputmask.mjs +360 -0
  1130. package/fesm2020/wirabyte-ui-inputmask.mjs.map +1 -0
  1131. package/fesm2020/wirabyte-ui-inputnumber.mjs +385 -0
  1132. package/fesm2020/wirabyte-ui-inputnumber.mjs.map +1 -0
  1133. package/fesm2020/wirabyte-ui-inputotp.mjs +365 -0
  1134. package/fesm2020/wirabyte-ui-inputotp.mjs.map +1 -0
  1135. package/fesm2020/wirabyte-ui-inputtext.mjs +85 -0
  1136. package/fesm2020/wirabyte-ui-inputtext.mjs.map +1 -0
  1137. package/fesm2020/wirabyte-ui-keyfilter.mjs +152 -0
  1138. package/fesm2020/wirabyte-ui-keyfilter.mjs.map +1 -0
  1139. package/fesm2020/wirabyte-ui-knob.mjs +228 -0
  1140. package/fesm2020/wirabyte-ui-knob.mjs.map +1 -0
  1141. package/fesm2020/wirabyte-ui-listbox.mjs +541 -0
  1142. package/fesm2020/wirabyte-ui-listbox.mjs.map +1 -0
  1143. package/fesm2020/wirabyte-ui-menu.mjs +356 -0
  1144. package/fesm2020/wirabyte-ui-menu.mjs.map +1 -0
  1145. package/fesm2020/wirabyte-ui-menubar.mjs +604 -0
  1146. package/fesm2020/wirabyte-ui-menubar.mjs.map +1 -0
  1147. package/fesm2020/wirabyte-ui-message.mjs +291 -0
  1148. package/fesm2020/wirabyte-ui-message.mjs.map +1 -0
  1149. package/fesm2020/wirabyte-ui-metergroup.mjs +192 -0
  1150. package/fesm2020/wirabyte-ui-metergroup.mjs.map +1 -0
  1151. package/fesm2020/wirabyte-ui-multiselect.mjs +778 -0
  1152. package/fesm2020/wirabyte-ui-multiselect.mjs.map +1 -0
  1153. package/fesm2020/wirabyte-ui-navbar.mjs +481 -0
  1154. package/fesm2020/wirabyte-ui-navbar.mjs.map +1 -0
  1155. package/fesm2020/wirabyte-ui-orderlist.mjs +445 -0
  1156. package/fesm2020/wirabyte-ui-orderlist.mjs.map +1 -0
  1157. package/fesm2020/wirabyte-ui-organizationchart.mjs +221 -0
  1158. package/fesm2020/wirabyte-ui-organizationchart.mjs.map +1 -0
  1159. package/fesm2020/wirabyte-ui-paginator.mjs +226 -0
  1160. package/fesm2020/wirabyte-ui-paginator.mjs.map +1 -0
  1161. package/fesm2020/wirabyte-ui-panel.mjs +130 -0
  1162. package/fesm2020/wirabyte-ui-panel.mjs.map +1 -0
  1163. package/fesm2020/wirabyte-ui-panelmenu.mjs +213 -0
  1164. package/fesm2020/wirabyte-ui-panelmenu.mjs.map +1 -0
  1165. package/fesm2020/wirabyte-ui-password.mjs +267 -0
  1166. package/fesm2020/wirabyte-ui-password.mjs.map +1 -0
  1167. package/fesm2020/wirabyte-ui-picklist.mjs +944 -0
  1168. package/fesm2020/wirabyte-ui-picklist.mjs.map +1 -0
  1169. package/fesm2020/wirabyte-ui-popover.mjs +205 -0
  1170. package/fesm2020/wirabyte-ui-popover.mjs.map +1 -0
  1171. package/fesm2020/wirabyte-ui-presets.mjs +10 -0
  1172. package/fesm2020/wirabyte-ui-presets.mjs.map +1 -0
  1173. package/fesm2020/wirabyte-ui-progressbar.mjs +156 -0
  1174. package/fesm2020/wirabyte-ui-progressbar.mjs.map +1 -0
  1175. package/fesm2020/wirabyte-ui-progressspinner.mjs +156 -0
  1176. package/fesm2020/wirabyte-ui-progressspinner.mjs.map +1 -0
  1177. package/fesm2020/wirabyte-ui-radiobutton.mjs +186 -0
  1178. package/fesm2020/wirabyte-ui-radiobutton.mjs.map +1 -0
  1179. package/fesm2020/wirabyte-ui-rating.mjs +128 -0
  1180. package/fesm2020/wirabyte-ui-rating.mjs.map +1 -0
  1181. package/fesm2020/wirabyte-ui-result.mjs +93 -0
  1182. package/fesm2020/wirabyte-ui-result.mjs.map +1 -0
  1183. package/fesm2020/wirabyte-ui-ripple.mjs +66 -0
  1184. package/fesm2020/wirabyte-ui-ripple.mjs.map +1 -0
  1185. package/fesm2020/wirabyte-ui-scroller.mjs +326 -0
  1186. package/fesm2020/wirabyte-ui-scroller.mjs.map +1 -0
  1187. package/fesm2020/wirabyte-ui-scrollpanel.mjs +88 -0
  1188. package/fesm2020/wirabyte-ui-scrollpanel.mjs.map +1 -0
  1189. package/fesm2020/wirabyte-ui-select.mjs +713 -0
  1190. package/fesm2020/wirabyte-ui-select.mjs.map +1 -0
  1191. package/fesm2020/wirabyte-ui-selectbutton.mjs +195 -0
  1192. package/fesm2020/wirabyte-ui-selectbutton.mjs.map +1 -0
  1193. package/fesm2020/wirabyte-ui-sitefooter.mjs +160 -0
  1194. package/fesm2020/wirabyte-ui-sitefooter.mjs.map +1 -0
  1195. package/fesm2020/wirabyte-ui-skeleton.mjs +72 -0
  1196. package/fesm2020/wirabyte-ui-skeleton.mjs.map +1 -0
  1197. package/fesm2020/wirabyte-ui-slider.mjs +268 -0
  1198. package/fesm2020/wirabyte-ui-slider.mjs.map +1 -0
  1199. package/fesm2020/wirabyte-ui-splitbutton.mjs +201 -0
  1200. package/fesm2020/wirabyte-ui-splitbutton.mjs.map +1 -0
  1201. package/fesm2020/wirabyte-ui-splitter.mjs +422 -0
  1202. package/fesm2020/wirabyte-ui-splitter.mjs.map +1 -0
  1203. package/fesm2020/wirabyte-ui-stepper.mjs +602 -0
  1204. package/fesm2020/wirabyte-ui-stepper.mjs.map +1 -0
  1205. package/fesm2020/wirabyte-ui-steps.mjs +180 -0
  1206. package/fesm2020/wirabyte-ui-steps.mjs.map +1 -0
  1207. package/fesm2020/wirabyte-ui-table.mjs +3201 -0
  1208. package/fesm2020/wirabyte-ui-table.mjs.map +1 -0
  1209. package/fesm2020/wirabyte-ui-tabmenu.mjs +8 -0
  1210. package/fesm2020/wirabyte-ui-tabmenu.mjs.map +1 -0
  1211. package/fesm2020/wirabyte-ui-tabs.mjs +769 -0
  1212. package/fesm2020/wirabyte-ui-tabs.mjs.map +1 -0
  1213. package/fesm2020/wirabyte-ui-tag.mjs +73 -0
  1214. package/fesm2020/wirabyte-ui-tag.mjs.map +1 -0
  1215. package/fesm2020/wirabyte-ui-terminal.mjs +203 -0
  1216. package/fesm2020/wirabyte-ui-terminal.mjs.map +1 -0
  1217. package/fesm2020/wirabyte-ui-textarea.mjs +108 -0
  1218. package/fesm2020/wirabyte-ui-textarea.mjs.map +1 -0
  1219. package/fesm2020/wirabyte-ui-thai.mjs +138 -0
  1220. package/fesm2020/wirabyte-ui-thai.mjs.map +1 -0
  1221. package/fesm2020/wirabyte-ui-tieredmenu.mjs +406 -0
  1222. package/fesm2020/wirabyte-ui-tieredmenu.mjs.map +1 -0
  1223. package/fesm2020/wirabyte-ui-timeline.mjs +130 -0
  1224. package/fesm2020/wirabyte-ui-timeline.mjs.map +1 -0
  1225. package/fesm2020/wirabyte-ui-toast.mjs +291 -0
  1226. package/fesm2020/wirabyte-ui-toast.mjs.map +1 -0
  1227. package/fesm2020/wirabyte-ui-togglebutton.mjs +150 -0
  1228. package/fesm2020/wirabyte-ui-togglebutton.mjs.map +1 -0
  1229. package/fesm2020/wirabyte-ui-toggleswitch.mjs +144 -0
  1230. package/fesm2020/wirabyte-ui-toggleswitch.mjs.map +1 -0
  1231. package/fesm2020/wirabyte-ui-toolbar.mjs +88 -0
  1232. package/fesm2020/wirabyte-ui-toolbar.mjs.map +1 -0
  1233. package/fesm2020/wirabyte-ui-tooltip.mjs +393 -0
  1234. package/fesm2020/wirabyte-ui-tooltip.mjs.map +1 -0
  1235. package/fesm2020/wirabyte-ui-tree.mjs +474 -0
  1236. package/fesm2020/wirabyte-ui-tree.mjs.map +1 -0
  1237. package/fesm2020/wirabyte-ui-treeselect.mjs +431 -0
  1238. package/fesm2020/wirabyte-ui-treeselect.mjs.map +1 -0
  1239. package/fesm2020/wirabyte-ui-validation.mjs +186 -0
  1240. package/fesm2020/wirabyte-ui-validation.mjs.map +1 -0
  1241. package/fesm2020/wirabyte-ui.mjs +9 -0
  1242. package/fesm2020/wirabyte-ui.mjs.map +1 -0
  1243. package/fieldset/fieldset.component.d.ts +35 -0
  1244. package/fieldset/fieldset.module.d.ts +9 -0
  1245. package/fieldset/index.d.ts +5 -0
  1246. package/fieldset/public-api.d.ts +2 -0
  1247. package/fileupload/fileupload.base.d.ts +175 -0
  1248. package/fileupload/fileupload.component.d.ts +11 -0
  1249. package/fileupload/fileupload.module.d.ts +9 -0
  1250. package/fileupload/fileupload.types.d.ts +54 -0
  1251. package/fileupload/index.d.ts +5 -0
  1252. package/fileupload/public-api.d.ts +4 -0
  1253. package/floatlabel/floatlabel.component.d.ts +21 -0
  1254. package/floatlabel/floatlabel.module.d.ts +8 -0
  1255. package/floatlabel/floatlabel.types.d.ts +1 -0
  1256. package/floatlabel/index.d.ts +5 -0
  1257. package/floatlabel/public-api.d.ts +3 -0
  1258. package/flow/flow-background.component.d.ts +49 -0
  1259. package/flow/flow-controls.component.d.ts +47 -0
  1260. package/flow/flow-handle.component.d.ts +48 -0
  1261. package/flow/flow-history.directive.d.ts +42 -0
  1262. package/flow/flow-host.d.ts +48 -0
  1263. package/flow/flow-minimap.component.d.ts +79 -0
  1264. package/flow/flow-node-outlet.d.ts +46 -0
  1265. package/flow/flow-node-resizer.component.d.ts +57 -0
  1266. package/flow/flow-node-toolbar.component.d.ts +38 -0
  1267. package/flow/flow-panel.component.d.ts +11 -0
  1268. package/flow/flow-templates.d.ts +47 -0
  1269. package/flow/flow.component.d.ts +633 -0
  1270. package/flow/flow.module.d.ts +21 -0
  1271. package/flow/flow.types.d.ts +210 -0
  1272. package/flow/index.d.ts +5 -0
  1273. package/flow/public-api.d.ts +16 -0
  1274. package/galleria/galleria.component.d.ts +163 -0
  1275. package/galleria/galleria.module.d.ts +8 -0
  1276. package/galleria/index.d.ts +5 -0
  1277. package/galleria/public-api.d.ts +2 -0
  1278. package/i18n/i18n.module.d.ts +22 -0
  1279. package/i18n/i18n.service.d.ts +54 -0
  1280. package/i18n/i18n.types.d.ts +33 -0
  1281. package/i18n/index.d.ts +5 -0
  1282. package/i18n/language-switch.component.d.ts +50 -0
  1283. package/i18n/public-api.d.ts +6 -0
  1284. package/i18n/translate.pipe.d.ts +25 -0
  1285. package/iconfield/iconfield.component.d.ts +30 -0
  1286. package/iconfield/iconfield.module.d.ts +8 -0
  1287. package/iconfield/index.d.ts +5 -0
  1288. package/iconfield/public-api.d.ts +2 -0
  1289. package/image/image.base.d.ts +83 -0
  1290. package/image/image.component.d.ts +7 -0
  1291. package/image/image.module.d.ts +9 -0
  1292. package/image/index.d.ts +5 -0
  1293. package/image/public-api.d.ts +3 -0
  1294. package/imagecompare/imagecompare.component.d.ts +67 -0
  1295. package/imagecompare/imagecompare.module.d.ts +9 -0
  1296. package/imagecompare/index.d.ts +5 -0
  1297. package/imagecompare/public-api.d.ts +2 -0
  1298. package/imagecropper/imagecropper.component.d.ts +309 -0
  1299. package/imagecropper/imagecropper.module.d.ts +8 -0
  1300. package/imagecropper/imagecropper.types.d.ts +79 -0
  1301. package/imagecropper/index.d.ts +5 -0
  1302. package/imagecropper/public-api.d.ts +4 -0
  1303. package/index.d.ts +5 -0
  1304. package/inplace/index.d.ts +5 -0
  1305. package/inplace/inplace.component.d.ts +59 -0
  1306. package/inplace/inplace.module.d.ts +8 -0
  1307. package/inplace/public-api.d.ts +2 -0
  1308. package/inputgroup/index.d.ts +5 -0
  1309. package/inputgroup/inputgroup.component.d.ts +26 -0
  1310. package/inputgroup/inputgroup.module.d.ts +8 -0
  1311. package/inputgroup/public-api.d.ts +2 -0
  1312. package/inputmask/index.d.ts +5 -0
  1313. package/inputmask/inputmask.base.d.ts +115 -0
  1314. package/inputmask/inputmask.component.d.ts +10 -0
  1315. package/inputmask/inputmask.module.d.ts +8 -0
  1316. package/inputmask/public-api.d.ts +3 -0
  1317. package/inputnumber/index.d.ts +5 -0
  1318. package/inputnumber/inputnumber.component.d.ts +132 -0
  1319. package/inputnumber/inputnumber.module.d.ts +8 -0
  1320. package/inputnumber/inputnumber.types.d.ts +7 -0
  1321. package/inputnumber/public-api.d.ts +3 -0
  1322. package/inputotp/index.d.ts +5 -0
  1323. package/inputotp/inputotp.component.d.ts +105 -0
  1324. package/inputotp/inputotp.module.d.ts +9 -0
  1325. package/inputotp/inputotp.types.d.ts +22 -0
  1326. package/inputotp/public-api.d.ts +3 -0
  1327. package/inputtext/index.d.ts +5 -0
  1328. package/inputtext/inputtext.directive.d.ts +25 -0
  1329. package/inputtext/inputtext.module.d.ts +8 -0
  1330. package/inputtext/inputtext.styles.d.ts +2 -0
  1331. package/inputtext/inputtext.types.d.ts +3 -0
  1332. package/inputtext/public-api.d.ts +5 -0
  1333. package/keyfilter/index.d.ts +5 -0
  1334. package/keyfilter/keyfilter.directive.d.ts +29 -0
  1335. package/keyfilter/keyfilter.module.d.ts +8 -0
  1336. package/keyfilter/public-api.d.ts +2 -0
  1337. package/knob/index.d.ts +5 -0
  1338. package/knob/knob.component.d.ts +94 -0
  1339. package/knob/knob.module.d.ts +8 -0
  1340. package/knob/public-api.d.ts +2 -0
  1341. package/listbox/index.d.ts +5 -0
  1342. package/listbox/listbox.component.d.ts +186 -0
  1343. package/listbox/listbox.module.d.ts +8 -0
  1344. package/listbox/public-api.d.ts +2 -0
  1345. package/menu/index.d.ts +5 -0
  1346. package/menu/menu.base.d.ts +95 -0
  1347. package/menu/menu.component.d.ts +11 -0
  1348. package/menu/menu.module.d.ts +9 -0
  1349. package/menu/public-api.d.ts +4 -0
  1350. package/menubar/index.d.ts +5 -0
  1351. package/menubar/menubar.base.d.ts +135 -0
  1352. package/menubar/menubar.component.d.ts +11 -0
  1353. package/menubar/menubar.module.d.ts +9 -0
  1354. package/menubar/public-api.d.ts +4 -0
  1355. package/message/index.d.ts +5 -0
  1356. package/message/message.component.d.ts +50 -0
  1357. package/message/message.module.d.ts +11 -0
  1358. package/message/message.types.d.ts +5 -0
  1359. package/message/messages.base.d.ts +50 -0
  1360. package/message/messages.component.d.ts +7 -0
  1361. package/message/public-api.d.ts +5 -0
  1362. package/metergroup/index.d.ts +5 -0
  1363. package/metergroup/metergroup.component.d.ts +59 -0
  1364. package/metergroup/metergroup.module.d.ts +8 -0
  1365. package/metergroup/metergroup.types.d.ts +42 -0
  1366. package/metergroup/public-api.d.ts +3 -0
  1367. package/multiselect/index.d.ts +5 -0
  1368. package/multiselect/multiselect.base.d.ts +222 -0
  1369. package/multiselect/multiselect.component.d.ts +11 -0
  1370. package/multiselect/multiselect.module.d.ts +9 -0
  1371. package/multiselect/multiselect.styles.d.ts +2 -0
  1372. package/multiselect/multiselect.types.d.ts +20 -0
  1373. package/multiselect/public-api.d.ts +5 -0
  1374. package/navbar/index.d.ts +5 -0
  1375. package/navbar/navbar.component.d.ts +172 -0
  1376. package/navbar/navbar.module.d.ts +9 -0
  1377. package/navbar/public-api.d.ts +2 -0
  1378. package/orderlist/index.d.ts +5 -0
  1379. package/orderlist/orderlist.base.d.ts +136 -0
  1380. package/orderlist/orderlist.component.d.ts +10 -0
  1381. package/orderlist/orderlist.module.d.ts +9 -0
  1382. package/orderlist/orderlist.types.d.ts +10 -0
  1383. package/orderlist/public-api.d.ts +4 -0
  1384. package/organizationchart/index.d.ts +5 -0
  1385. package/organizationchart/organizationchart.component.d.ts +76 -0
  1386. package/organizationchart/organizationchart.module.d.ts +9 -0
  1387. package/organizationchart/organizationchart.types.d.ts +10 -0
  1388. package/organizationchart/public-api.d.ts +4 -0
  1389. package/package.json +891 -3
  1390. package/paginator/index.d.ts +5 -0
  1391. package/paginator/paginator.base.d.ts +95 -0
  1392. package/paginator/paginator.component.d.ts +10 -0
  1393. package/paginator/paginator.module.d.ts +8 -0
  1394. package/paginator/paginator.types.d.ts +7 -0
  1395. package/paginator/public-api.d.ts +4 -0
  1396. package/panel/index.d.ts +5 -0
  1397. package/panel/panel.component.d.ts +51 -0
  1398. package/panel/panel.module.d.ts +10 -0
  1399. package/panel/panel.types.d.ts +2 -0
  1400. package/panel/public-api.d.ts +3 -0
  1401. package/panelmenu/index.d.ts +5 -0
  1402. package/panelmenu/panelmenu.base.d.ts +53 -0
  1403. package/panelmenu/panelmenu.component.d.ts +7 -0
  1404. package/panelmenu/panelmenu.module.d.ts +9 -0
  1405. package/panelmenu/public-api.d.ts +3 -0
  1406. package/password/index.d.ts +5 -0
  1407. package/password/password.component.d.ts +90 -0
  1408. package/password/password.module.d.ts +8 -0
  1409. package/password/password.types.d.ts +6 -0
  1410. package/password/public-api.d.ts +3 -0
  1411. package/picklist/index.d.ts +5 -0
  1412. package/picklist/list-drag.d.ts +49 -0
  1413. package/picklist/picklist.base.d.ts +217 -0
  1414. package/picklist/picklist.component.d.ts +10 -0
  1415. package/picklist/picklist.module.d.ts +9 -0
  1416. package/picklist/picklist.styles.d.ts +2 -0
  1417. package/picklist/picklist.types.d.ts +21 -0
  1418. package/picklist/public-api.d.ts +7 -0
  1419. package/popover/index.d.ts +5 -0
  1420. package/popover/popover.base.d.ts +61 -0
  1421. package/popover/popover.component.d.ts +10 -0
  1422. package/popover/popover.module.d.ts +9 -0
  1423. package/popover/public-api.d.ts +3 -0
  1424. package/presets/index.d.ts +5 -0
  1425. package/presets/public-api.d.ts +2 -0
  1426. package/progressbar/index.d.ts +5 -0
  1427. package/progressbar/progressbar.component.d.ts +62 -0
  1428. package/progressbar/progressbar.module.d.ts +8 -0
  1429. package/progressbar/progressbar.types.d.ts +16 -0
  1430. package/progressbar/public-api.d.ts +3 -0
  1431. package/progressspinner/index.d.ts +5 -0
  1432. package/progressspinner/progressspinner.component.d.ts +50 -0
  1433. package/progressspinner/progressspinner.module.d.ts +8 -0
  1434. package/progressspinner/progressspinner.types.d.ts +9 -0
  1435. package/progressspinner/public-api.d.ts +3 -0
  1436. package/public-api.d.ts +2 -0
  1437. package/radiobutton/index.d.ts +5 -0
  1438. package/radiobutton/public-api.d.ts +6 -0
  1439. package/radiobutton/radio-registry.d.ts +23 -0
  1440. package/radiobutton/radiobutton.component.d.ts +57 -0
  1441. package/radiobutton/radiobutton.module.d.ts +8 -0
  1442. package/radiobutton/radiobutton.styles.d.ts +2 -0
  1443. package/radiobutton/radiobutton.types.d.ts +4 -0
  1444. package/rating/index.d.ts +5 -0
  1445. package/rating/public-api.d.ts +3 -0
  1446. package/rating/rating.component.d.ts +47 -0
  1447. package/rating/rating.module.d.ts +8 -0
  1448. package/rating/rating.types.d.ts +4 -0
  1449. package/result/index.d.ts +5 -0
  1450. package/result/public-api.d.ts +2 -0
  1451. package/result/result.component.d.ts +39 -0
  1452. package/result/result.module.d.ts +8 -0
  1453. package/ripple/index.d.ts +5 -0
  1454. package/ripple/public-api.d.ts +2 -0
  1455. package/ripple/ripple.directive.d.ts +15 -0
  1456. package/ripple/ripple.module.d.ts +8 -0
  1457. package/ripple/ripple.styles.d.ts +2 -0
  1458. package/schematics/collection.json +21 -0
  1459. package/schematics/core/carousel.cjs +70 -0
  1460. package/schematics/core/catalog.cjs +206 -0
  1461. package/schematics/core/chart/format.cjs +68 -0
  1462. package/schematics/core/chart/index.cjs +32 -0
  1463. package/schematics/core/chart/kinds.cjs +1355 -0
  1464. package/schematics/core/chart/model.cjs +717 -0
  1465. package/schematics/core/chart/more.cjs +317 -0
  1466. package/schematics/core/chart/paths.cjs +170 -0
  1467. package/schematics/core/chart/scale.cjs +63 -0
  1468. package/schematics/core/color.cjs +106 -0
  1469. package/schematics/core/colorpicker.cjs +79 -0
  1470. package/schematics/core/compat.cjs +152 -0
  1471. package/schematics/core/config.cjs +172 -0
  1472. package/schematics/core/date.cjs +346 -0
  1473. package/schematics/core/datepicker.cjs +530 -0
  1474. package/schematics/core/dock.cjs +16 -0
  1475. package/schematics/core/editor.cjs +281 -0
  1476. package/schematics/core/errorpage.cjs +52 -0
  1477. package/schematics/core/excel.cjs +826 -0
  1478. package/schematics/core/exporters.cjs +249 -0
  1479. package/schematics/core/families.cjs +1758 -0
  1480. package/schematics/core/fileupload.cjs +54 -0
  1481. package/schematics/core/flow/changes.cjs +215 -0
  1482. package/schematics/core/flow/edges.cjs +95 -0
  1483. package/schematics/core/flow/export.cjs +236 -0
  1484. package/schematics/core/flow/geometry.cjs +338 -0
  1485. package/schematics/core/flow/graph.cjs +338 -0
  1486. package/schematics/core/flow/history.cjs +109 -0
  1487. package/schematics/core/flow/index.cjs +29 -0
  1488. package/schematics/core/flow/interaction.cjs +264 -0
  1489. package/schematics/core/flow/layout.cjs +592 -0
  1490. package/schematics/core/flow/paths.cjs +268 -0
  1491. package/schematics/core/flow/text.cjs +74 -0
  1492. package/schematics/core/flow/types.cjs +7 -0
  1493. package/schematics/core/flow/viewport.cjs +151 -0
  1494. package/schematics/core/i18n.cjs +85 -0
  1495. package/schematics/core/imagecompare.cjs +32 -0
  1496. package/schematics/core/imagecropper.cjs +515 -0
  1497. package/schematics/core/index.cjs +55 -0
  1498. package/schematics/core/inputotp.cjs +56 -0
  1499. package/schematics/core/knob.cjs +114 -0
  1500. package/schematics/core/mask.cjs +122 -0
  1501. package/schematics/core/menu.cjs +88 -0
  1502. package/schematics/core/number.cjs +141 -0
  1503. package/schematics/core/organizationchart.cjs +91 -0
  1504. package/schematics/core/overrides.cjs +179 -0
  1505. package/schematics/core/picklist.cjs +262 -0
  1506. package/schematics/core/select.cjs +172 -0
  1507. package/schematics/core/splitter.cjs +69 -0
  1508. package/schematics/core/table.cjs +183 -0
  1509. package/schematics/core/terminal.cjs +34 -0
  1510. package/schematics/core/thai/buddhist.cjs +135 -0
  1511. package/schematics/core/thai/locale.cjs +654 -0
  1512. package/schematics/core/thai/text.cjs +173 -0
  1513. package/schematics/core/thai/thai-id.cjs +26 -0
  1514. package/schematics/core/tokens.cjs +335 -0
  1515. package/schematics/core/tree.cjs +144 -0
  1516. package/schematics/core/validation.cjs +46 -0
  1517. package/schematics/from-primeng/index.cjs +221 -0
  1518. package/schematics/from-primeng/mapping.cjs +195 -0
  1519. package/schematics/from-primeng/schema.cjs +2 -0
  1520. package/schematics/from-primeng/schema.json +17 -0
  1521. package/schematics/migration.json +4 -0
  1522. package/schematics/ng-add/index.cjs +318 -0
  1523. package/schematics/ng-add/schema.cjs +2 -0
  1524. package/schematics/ng-add/schema.json +325 -0
  1525. package/schematics/utils/ast.cjs +185 -0
  1526. package/schematics/utils/workspace.cjs +115 -0
  1527. package/scroller/index.d.ts +5 -0
  1528. package/scroller/public-api.d.ts +5 -0
  1529. package/scroller/scroller.component.d.ts +135 -0
  1530. package/scroller/scroller.module.d.ts +8 -0
  1531. package/scrollpanel/index.d.ts +5 -0
  1532. package/scrollpanel/public-api.d.ts +2 -0
  1533. package/scrollpanel/scrollpanel.component.d.ts +27 -0
  1534. package/scrollpanel/scrollpanel.module.d.ts +8 -0
  1535. package/select/index.d.ts +5 -0
  1536. package/select/public-api.d.ts +6 -0
  1537. package/select/select.base.d.ts +217 -0
  1538. package/select/select.component.d.ts +11 -0
  1539. package/select/select.module.d.ts +8 -0
  1540. package/select/select.styles.d.ts +2 -0
  1541. package/select/select.types.d.ts +9 -0
  1542. package/selectbutton/index.d.ts +5 -0
  1543. package/selectbutton/public-api.d.ts +3 -0
  1544. package/selectbutton/selectbutton.component.d.ts +70 -0
  1545. package/selectbutton/selectbutton.module.d.ts +9 -0
  1546. package/selectbutton/selectbutton.types.d.ts +9 -0
  1547. package/sitefooter/index.d.ts +5 -0
  1548. package/sitefooter/public-api.d.ts +2 -0
  1549. package/sitefooter/sitefooter.component.d.ts +69 -0
  1550. package/sitefooter/sitefooter.module.d.ts +9 -0
  1551. package/skeleton/index.d.ts +5 -0
  1552. package/skeleton/public-api.d.ts +3 -0
  1553. package/skeleton/skeleton.component.d.ts +22 -0
  1554. package/skeleton/skeleton.module.d.ts +8 -0
  1555. package/skeleton/skeleton.types.d.ts +2 -0
  1556. package/slider/index.d.ts +5 -0
  1557. package/slider/public-api.d.ts +2 -0
  1558. package/slider/slider.component.d.ts +79 -0
  1559. package/slider/slider.module.d.ts +8 -0
  1560. package/splitbutton/index.d.ts +5 -0
  1561. package/splitbutton/public-api.d.ts +2 -0
  1562. package/splitbutton/splitbutton.component.d.ts +75 -0
  1563. package/splitbutton/splitbutton.module.d.ts +8 -0
  1564. package/splitter/index.d.ts +5 -0
  1565. package/splitter/public-api.d.ts +4 -0
  1566. package/splitter/splitter-panel.component.d.ts +20 -0
  1567. package/splitter/splitter.component.d.ts +109 -0
  1568. package/splitter/splitter.module.d.ts +10 -0
  1569. package/splitter/splitter.types.d.ts +8 -0
  1570. package/stepper/index.d.ts +5 -0
  1571. package/stepper/public-api.d.ts +3 -0
  1572. package/stepper/stepper.base.d.ts +200 -0
  1573. package/stepper/stepper.component.d.ts +41 -0
  1574. package/stepper/stepper.module.d.ts +9 -0
  1575. package/steps/index.d.ts +5 -0
  1576. package/steps/public-api.d.ts +3 -0
  1577. package/steps/steps.base.d.ts +52 -0
  1578. package/steps/steps.component.d.ts +7 -0
  1579. package/steps/steps.module.d.ts +8 -0
  1580. package/table/index.d.ts +5 -0
  1581. package/table/public-api.d.ts +9 -0
  1582. package/table/table-celleditor.component.d.ts +14 -0
  1583. package/table/table-filter.component.d.ts +11 -0
  1584. package/table/table.base.d.ts +410 -0
  1585. package/table/table.celleditor.d.ts +20 -0
  1586. package/table/table.component.d.ts +12 -0
  1587. package/table/table.directives.d.ts +330 -0
  1588. package/table/table.filter.d.ts +131 -0
  1589. package/table/table.module.d.ts +12 -0
  1590. package/table/table.types.d.ts +180 -0
  1591. package/tabmenu/index.d.ts +5 -0
  1592. package/tabmenu/public-api.d.ts +2 -0
  1593. package/tabs/index.d.ts +5 -0
  1594. package/tabs/public-api.d.ts +8 -0
  1595. package/tabs/tabmenu.base.d.ts +59 -0
  1596. package/tabs/tabmenu.component.d.ts +10 -0
  1597. package/tabs/tabmenu.module.d.ts +9 -0
  1598. package/tabs/tabs.component.d.ts +147 -0
  1599. package/tabs/tabs.module.d.ts +10 -0
  1600. package/tabs/tabs.styles.d.ts +2 -0
  1601. package/tabs/tabs.types.d.ts +21 -0
  1602. package/tag/index.d.ts +5 -0
  1603. package/tag/public-api.d.ts +3 -0
  1604. package/tag/tag.component.d.ts +24 -0
  1605. package/tag/tag.module.d.ts +8 -0
  1606. package/tag/tag.types.d.ts +2 -0
  1607. package/terminal/index.d.ts +5 -0
  1608. package/terminal/public-api.d.ts +5 -0
  1609. package/terminal/terminal.component.d.ts +58 -0
  1610. package/terminal/terminal.module.d.ts +8 -0
  1611. package/terminal/terminal.service.d.ts +20 -0
  1612. package/textarea/index.d.ts +5 -0
  1613. package/textarea/public-api.d.ts +2 -0
  1614. package/textarea/textarea.directive.d.ts +33 -0
  1615. package/textarea/textarea.module.d.ts +8 -0
  1616. package/thai/index.d.ts +5 -0
  1617. package/thai/public-api.d.ts +3 -0
  1618. package/thai/thai.module.d.ts +8 -0
  1619. package/thai/thai.pipes.d.ts +57 -0
  1620. package/theme/_api.scss +71 -0
  1621. package/theme/_color.scss +153 -0
  1622. package/theme/_data.scss +9283 -0
  1623. package/theme/_index.scss +424 -0
  1624. package/theme/_version.scss +2 -0
  1625. package/themes/arun-blue/theme.css +1446 -0
  1626. package/themes/arun-green/theme.css +1446 -0
  1627. package/themes/arun-orange/theme.css +1445 -0
  1628. package/themes/arun-purple/theme.css +1446 -0
  1629. package/themes/md-dark-deeppurple/theme.css +1309 -0
  1630. package/themes/md-dark-indigo/theme.css +1309 -0
  1631. package/themes/md-light-deeppurple/theme.css +1418 -0
  1632. package/themes/md-light-indigo/theme.css +1418 -0
  1633. package/themes/ratri-blue/theme.css +1309 -0
  1634. package/themes/ratri-green/theme.css +1309 -0
  1635. package/themes/ratri-orange/theme.css +1309 -0
  1636. package/themes/ratri-purple/theme.css +1309 -0
  1637. package/themes/sayan-blue/theme.css +1309 -0
  1638. package/themes/sayan-green/theme.css +1309 -0
  1639. package/themes/sayan-orange/theme.css +1309 -0
  1640. package/themes/sayan-purple/theme.css +1309 -0
  1641. package/themes/sila-dark-blue/theme.css +1309 -0
  1642. package/themes/sila-dark-indigo/theme.css +1309 -0
  1643. package/themes/sila-dark-purple/theme.css +1309 -0
  1644. package/themes/sila-dark-teal/theme.css +1309 -0
  1645. package/themes/sila-light-blue/theme.css +1446 -0
  1646. package/themes/sila-light-indigo/theme.css +1446 -0
  1647. package/themes/sila-light-purple/theme.css +1446 -0
  1648. package/themes/sila-light-teal/theme.css +1446 -0
  1649. package/themes/sila-light-wira/theme.css +1446 -0
  1650. package/tieredmenu/index.d.ts +5 -0
  1651. package/tieredmenu/public-api.d.ts +2 -0
  1652. package/tieredmenu/tieredmenu.component.d.ts +90 -0
  1653. package/tieredmenu/tieredmenu.module.d.ts +8 -0
  1654. package/timeline/index.d.ts +5 -0
  1655. package/timeline/public-api.d.ts +3 -0
  1656. package/timeline/timeline.base.d.ts +36 -0
  1657. package/timeline/timeline.component.d.ts +7 -0
  1658. package/timeline/timeline.module.d.ts +9 -0
  1659. package/toast/index.d.ts +5 -0
  1660. package/toast/message.service.d.ts +19 -0
  1661. package/toast/public-api.d.ts +5 -0
  1662. package/toast/toast.base.d.ts +84 -0
  1663. package/toast/toast.component.d.ts +10 -0
  1664. package/toast/toast.module.d.ts +9 -0
  1665. package/toast/toast.types.d.ts +28 -0
  1666. package/togglebutton/index.d.ts +5 -0
  1667. package/togglebutton/public-api.d.ts +3 -0
  1668. package/togglebutton/togglebutton.component.d.ts +56 -0
  1669. package/togglebutton/togglebutton.module.d.ts +8 -0
  1670. package/togglebutton/togglebutton.types.d.ts +4 -0
  1671. package/toggleswitch/index.d.ts +5 -0
  1672. package/toggleswitch/public-api.d.ts +3 -0
  1673. package/toggleswitch/toggleswitch.component.d.ts +52 -0
  1674. package/toggleswitch/toggleswitch.module.d.ts +8 -0
  1675. package/toggleswitch/toggleswitch.types.d.ts +4 -0
  1676. package/toolbar/index.d.ts +5 -0
  1677. package/toolbar/public-api.d.ts +2 -0
  1678. package/toolbar/toolbar.component.d.ts +29 -0
  1679. package/toolbar/toolbar.module.d.ts +9 -0
  1680. package/tooltip/index.d.ts +5 -0
  1681. package/tooltip/public-api.d.ts +3 -0
  1682. package/tooltip/tooltip.directive.d.ts +87 -0
  1683. package/tooltip/tooltip.module.d.ts +8 -0
  1684. package/tooltip/tooltip.styles.d.ts +2 -0
  1685. package/tooltip/tooltip.types.d.ts +14 -0
  1686. package/tree/index.d.ts +5 -0
  1687. package/tree/public-api.d.ts +2 -0
  1688. package/tree/tree.component.d.ts +149 -0
  1689. package/tree/tree.module.d.ts +8 -0
  1690. package/treeselect/index.d.ts +5 -0
  1691. package/treeselect/public-api.d.ts +2 -0
  1692. package/treeselect/treeselect.component.d.ts +140 -0
  1693. package/treeselect/treeselect.module.d.ts +8 -0
  1694. package/utils/_index.scss +532 -0
  1695. package/utils/_palettes.scss +23 -0
  1696. package/utils/utils.css +9280 -0
  1697. package/utils/utils.min.css +1 -0
  1698. package/validation/field-error.component.d.ts +39 -0
  1699. package/validation/index.d.ts +5 -0
  1700. package/validation/public-api.d.ts +3 -0
  1701. package/validation/validation.module.d.ts +9 -0
  1702. package/validation/validators.d.ts +33 -0
@@ -0,0 +1,3056 @@
1
+ import { DOCUMENT, NgClass, NgFor, NgIf, NgStyle, NgSwitch, NgSwitchCase, NgTemplateOutlet } from '@angular/common';
2
+ import * as i0 from '@angular/core';
3
+ import { InjectionToken, TemplateRef, EventEmitter, inject, ChangeDetectorRef, NgZone, ElementRef, Directive, Input, Output, ContentChildren, ContentChild, ViewChild, forwardRef, Component, ViewEncapsulation, ChangeDetectionStrategy, NgModule } from '@angular/core';
4
+ import { ɵtoBool, WU_VERSION_INFO, ɵuniqueId, WuConfig, ɵrefreshOnTranslation, ɵassertSupportedAngular, ɵWU_SKIP_VERSION_CHECK, ɵWuStyleLoader, ɵfindTemplate, ɵWuPopup, ɵlockScroll, WuTemplate } from '@wirabyte/ui/config';
5
+ import { ɵWU_BUTTON_CSS, ɵbuttonClass } from '@wirabyte/ui/button';
6
+ import { ɵWU_INPUTTEXT_CSS } from '@wirabyte/ui/inputtext';
7
+ import { safeEditorUrl, safeEditorImage, editorToolbarGroups, editorToolOptions, EditorHistory, editorHtmlToText, TH_LOCALE, EDITOR_FONT_SIZES, acceptsFile, formatFileSize, isEmptyEditorHtml, editorCounts } from '@wirabyte/ui/core';
8
+ import { NG_VALUE_ACCESSOR } from '@angular/forms';
9
+
10
+ /**
11
+ * DOM helpers of wu-editor, free of Angular: selection save / restore, the HTML cleaner used for values, pastes and
12
+ * drops, block lookups and the table operations.
13
+ */
14
+ const TEXT_BLOCKS = ['P', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'BLOCKQUOTE', 'PRE', 'LI', 'DIV', 'TD', 'TH'];
15
+ const BLOCK_SET = new Set([...TEXT_BLOCKS, 'UL', 'OL', 'TABLE', 'THEAD', 'TBODY', 'TFOOT', 'TR', 'HR', 'FIGURE']);
16
+ function isBlock(node) {
17
+ return !!node && node.nodeType === 1 && BLOCK_SET.has(node.tagName);
18
+ }
19
+ // ---------- selection ----------
20
+ function nodePath(root, node) {
21
+ const path = [];
22
+ let n = node;
23
+ while (n && n !== root) {
24
+ const parent = n.parentNode;
25
+ if (!parent)
26
+ return null;
27
+ path.unshift(Array.prototype.indexOf.call(parent.childNodes, n));
28
+ n = parent;
29
+ }
30
+ return n === root ? path : null;
31
+ }
32
+ function nodeAt(root, path) {
33
+ let n = root;
34
+ for (const i of path) {
35
+ if (!n || !n.childNodes[i])
36
+ return null;
37
+ n = n.childNodes[i];
38
+ }
39
+ return n;
40
+ }
41
+ /** The selection's range when it is inside `root`. */
42
+ function rangeIn(root) {
43
+ const sel = root.ownerDocument.getSelection();
44
+ if (!sel || !sel.rangeCount)
45
+ return null;
46
+ const r = sel.getRangeAt(0);
47
+ return root.contains(r.commonAncestorContainer) ? r : null;
48
+ }
49
+ function saveSelection(root) {
50
+ const r = rangeIn(root);
51
+ if (!r)
52
+ return null;
53
+ const start = nodePath(root, r.startContainer);
54
+ const end = nodePath(root, r.endContainer);
55
+ return start && end ? { start, startOffset: r.startOffset, end, endOffset: r.endOffset } : null;
56
+ }
57
+ function restoreSelection(root, s) {
58
+ if (!s)
59
+ return false;
60
+ const a = nodeAt(root, s.start);
61
+ const b = nodeAt(root, s.end);
62
+ if (!a || !b)
63
+ return false;
64
+ const len = (n) => (n.nodeType === 3 ? n.length : n.childNodes.length);
65
+ const range = root.ownerDocument.createRange();
66
+ try {
67
+ range.setStart(a, Math.min(s.startOffset, len(a)));
68
+ range.setEnd(b, Math.min(s.endOffset, len(b)));
69
+ }
70
+ catch {
71
+ return false;
72
+ }
73
+ selectRange(range);
74
+ return true;
75
+ }
76
+ function selectRange(range) {
77
+ const sel = range.startContainer.ownerDocument?.getSelection();
78
+ if (!sel)
79
+ return;
80
+ sel.removeAllRanges();
81
+ sel.addRange(range);
82
+ }
83
+ /** Puts the caret at the start (or end) of a node. */
84
+ function caretIn(node, atEnd = false) {
85
+ const doc = node.ownerDocument;
86
+ if (!doc)
87
+ return;
88
+ const r = doc.createRange();
89
+ r.selectNodeContents(node);
90
+ r.collapse(!atEnd);
91
+ selectRange(r);
92
+ }
93
+ function closestIn(node, root, selector) {
94
+ let el = node ? (node.nodeType === 1 ? node : node.parentElement) : null;
95
+ while (el && el !== root) {
96
+ if (el.matches(selector))
97
+ return el;
98
+ el = el.parentElement;
99
+ }
100
+ return null;
101
+ }
102
+ /** The innermost text block holding a node (paragraph, heading, list item, cell …). */
103
+ function blockOf(node, root) {
104
+ let el = node ? (node.nodeType === 1 ? node : node.parentElement) : null;
105
+ while (el && el !== root) {
106
+ if (TEXT_BLOCKS.includes(el.tagName))
107
+ return el;
108
+ el = el.parentElement;
109
+ }
110
+ return null;
111
+ }
112
+ /** Text blocks the range touches, in document order (cells and list items count; their wrappers do not). */
113
+ function blocksIn(root, range) {
114
+ const out = [];
115
+ const add = (b) => {
116
+ if (b && !out.includes(b))
117
+ out.push(b);
118
+ };
119
+ add(blockOf(range.startContainer, root));
120
+ const walker = root.ownerDocument.createTreeWalker(root, NodeFilter.SHOW_ELEMENT);
121
+ let n = walker.nextNode();
122
+ while (n) {
123
+ if (TEXT_BLOCKS.includes(n.tagName) && range.intersectsNode(n) && !n.querySelector(TEXT_BLOCKS.join(',')))
124
+ add(n);
125
+ n = walker.nextNode();
126
+ }
127
+ add(blockOf(range.endContainer, root));
128
+ return out.filter((b) => !(range.collapsed && b !== blockOf(range.startContainer, root)));
129
+ }
130
+ // ---------- class helpers (Quill-compatible class names, so saved HTML keeps working) ----------
131
+ /** Replaces the class matching `prefix` (e.g. `ql-align-`) with `prefix + value`, or removes it when value is empty. */
132
+ function setPrefixedClass(el, prefix, value) {
133
+ for (const c of Array.from(el.classList))
134
+ if (c.startsWith(prefix))
135
+ el.classList.remove(c);
136
+ if (value)
137
+ el.classList.add(prefix + value);
138
+ if (!el.classList.length)
139
+ el.removeAttribute('class');
140
+ }
141
+ function prefixedClass(el, prefix) {
142
+ if (!el)
143
+ return null;
144
+ for (const c of Array.from(el.classList))
145
+ if (c.startsWith(prefix))
146
+ return c.slice(prefix.length);
147
+ return null;
148
+ }
149
+ // ---------- the cleaner ----------
150
+ const DROP = new Set(['SCRIPT', 'STYLE', 'IFRAME', 'OBJECT', 'EMBED', 'META', 'LINK', 'TITLE', 'HEAD', 'SVG', 'MATH', 'FORM', 'INPUT', 'BUTTON', 'TEXTAREA', 'SELECT', 'OPTION', 'NOSCRIPT', 'TEMPLATE', 'CANVAS', 'VIDEO', 'AUDIO', 'SOURCE', 'XML']);
151
+ const ALLOWED = {
152
+ P: ['class', 'style'],
153
+ H1: ['class', 'style'],
154
+ H2: ['class', 'style'],
155
+ H3: ['class', 'style'],
156
+ H4: ['class', 'style'],
157
+ H5: ['class', 'style'],
158
+ H6: ['class', 'style'],
159
+ BLOCKQUOTE: ['class', 'style'],
160
+ PRE: ['class', 'spellcheck'],
161
+ CODE: [],
162
+ STRONG: [],
163
+ EM: [],
164
+ U: [],
165
+ S: [],
166
+ SUB: [],
167
+ SUP: [],
168
+ BR: [],
169
+ HR: [],
170
+ SPAN: ['class', 'style'],
171
+ A: ['href', 'target', 'rel', 'title'],
172
+ UL: ['class'],
173
+ OL: ['class', 'start', 'type'],
174
+ LI: ['class', 'style'],
175
+ IMG: ['src', 'alt', 'width', 'height', 'class', 'title'],
176
+ TABLE: ['class', 'style'],
177
+ THEAD: [],
178
+ TBODY: [],
179
+ TFOOT: [],
180
+ TR: [],
181
+ TH: ['colspan', 'rowspan', 'class', 'style'],
182
+ TD: ['colspan', 'rowspan', 'class', 'style'],
183
+ COLGROUP: [],
184
+ COL: ['width', 'span', 'style'],
185
+ CAPTION: [],
186
+ FIGURE: ['class'],
187
+ FIGCAPTION: [],
188
+ };
189
+ const RENAME = { B: 'STRONG', I: 'EM', STRIKE: 'S', DEL: 'S', INS: 'U', DIV: 'P', H7: 'P', ARTICLE: 'P', SECTION: 'P' };
190
+ const INLINE_TAGS = new Set(['STRONG', 'EM', 'U', 'S', 'SUB', 'SUP', 'CODE', 'A']);
191
+ const STYLE_PROPS = ['color', 'background-color', 'text-align', 'font-size', 'font-family', 'width', 'margin-left', 'padding-left'];
192
+ const CLASS_OK = /^(ql-(align|indent|size|font|direction)-[\w-]+|ql-syntax|wu-image-(left|center|right|inline)|wu-editor-table)$/;
193
+ /**
194
+ * Cleans HTML for the editor: only the tags and attributes it understands, safe links and images, a few inline styles
195
+ * (colours, alignment, size, font, image width). Pastes from Word, Google Docs and web pages lose their own markup;
196
+ * values saved by Quill keep their `ql-*` classes. Returns the clean HTML.
197
+ */
198
+ function cleanEditorHtml(html, doc, o = {}) {
199
+ const tpl = doc.createElement('template');
200
+ tpl.innerHTML = html || '';
201
+ const root = tpl.content;
202
+ // Quill 2 writes bullet lists as <ol><li data-list="bullet">.
203
+ root.querySelectorAll('ol').forEach((ol) => {
204
+ const items = Array.from(ol.children);
205
+ if (items.length && items.every((li) => li.getAttribute('data-list') === 'bullet')) {
206
+ const ul = doc.createElement('ul');
207
+ while (ol.firstChild)
208
+ ul.appendChild(ol.firstChild);
209
+ ol.replaceWith(ul);
210
+ }
211
+ });
212
+ cleanChildren(root, doc, o);
213
+ wrapLoose(root, doc);
214
+ const div = doc.createElement('div');
215
+ div.appendChild(root);
216
+ return div.innerHTML;
217
+ }
218
+ function cleanChildren(parent, doc, o) {
219
+ const inPre = !!parent.closest?.('pre');
220
+ for (const node of Array.from(parent.childNodes)) {
221
+ if (node.nodeType === 8) {
222
+ node.remove();
223
+ continue;
224
+ }
225
+ if (node.nodeType === 3) {
226
+ // Source formatting (newlines, indentation) is not content, except inside code blocks.
227
+ if (!inPre)
228
+ node.nodeValue = (node.nodeValue || '').replace(/[\t\n\r ]+/g, ' ');
229
+ continue;
230
+ }
231
+ if (node.nodeType !== 1)
232
+ continue;
233
+ let el = node;
234
+ const tag = el.tagName.toUpperCase();
235
+ if (DROP.has(tag) || tag.includes(':')) {
236
+ // Word's <o:p> and friends hold nothing worth keeping.
237
+ el.remove();
238
+ continue;
239
+ }
240
+ // Google Docs wraps everything in <b style="font-weight:normal">.
241
+ if (tag === 'B' && /font-weight\s*:\s*(normal|400)/i.test(el.getAttribute('style') || '')) {
242
+ cleanChildren(el, doc, o);
243
+ el.replaceWith(...Array.from(el.childNodes));
244
+ continue;
245
+ }
246
+ if (tag === 'FONT') {
247
+ const span = doc.createElement('span');
248
+ const color = el.getAttribute('color');
249
+ if (color)
250
+ span.style.color = color;
251
+ const face = el.getAttribute('face');
252
+ if (face)
253
+ span.style.fontFamily = face;
254
+ while (el.firstChild)
255
+ span.appendChild(el.firstChild);
256
+ el.replaceWith(span);
257
+ el = span;
258
+ }
259
+ else if (RENAME[tag]) {
260
+ const target = RENAME[tag];
261
+ // A div holding blocks is just a wrapper: keep its children.
262
+ if (tag === 'DIV' && Array.from(el.children).some((c) => isBlock(c))) {
263
+ cleanChildren(el, doc, o);
264
+ el.replaceWith(...Array.from(el.childNodes));
265
+ continue;
266
+ }
267
+ const renamed = doc.createElement(target);
268
+ for (const a of Array.from(el.attributes))
269
+ renamed.setAttribute(a.name, a.value);
270
+ while (el.firstChild)
271
+ renamed.appendChild(el.firstChild);
272
+ el.replaceWith(renamed);
273
+ el = renamed;
274
+ }
275
+ const name = el.tagName.toUpperCase();
276
+ // Browsers put colours straight on <strong>, <em> …; colours live on spans, as before.
277
+ if (INLINE_TAGS.has(name) && el.getAttribute('style')) {
278
+ const span = doc.createElement('span');
279
+ span.setAttribute('style', el.getAttribute('style') || '');
280
+ el.removeAttribute('style');
281
+ while (el.firstChild)
282
+ span.appendChild(el.firstChild);
283
+ el.appendChild(span);
284
+ }
285
+ const allowed = ALLOWED[name];
286
+ if (!allowed) {
287
+ // Unknown wrappers (section, label, …) give way to their content.
288
+ cleanChildren(el, doc, o);
289
+ el.replaceWith(...Array.from(el.childNodes));
290
+ continue;
291
+ }
292
+ for (const a of Array.from(el.attributes)) {
293
+ const n = a.name.toLowerCase();
294
+ if (!allowed.includes(n))
295
+ el.removeAttribute(a.name);
296
+ }
297
+ if (el.hasAttribute('class')) {
298
+ const keep = Array.from(el.classList).filter((c) => CLASS_OK.test(c));
299
+ if (keep.length)
300
+ el.setAttribute('class', keep.join(' '));
301
+ else
302
+ el.removeAttribute('class');
303
+ }
304
+ if (el.hasAttribute('style')) {
305
+ const kept = [];
306
+ for (const prop of STYLE_PROPS) {
307
+ const v = el.style.getPropertyValue(prop);
308
+ // Safari copies the page's own styles (theme variables, inherit) onto what it pastes; those are not content.
309
+ if (v && !/expression|url\(|javascript|var\(|^(inherit|initial|unset|normal)$/i.test(v.trim()))
310
+ kept.push(`${prop}: ${v}`);
311
+ }
312
+ // Width only on tables, their columns and cells.
313
+ const out = kept.filter((d) => !d.startsWith('width') || ['TABLE', 'COL', 'TD', 'TH'].includes(name));
314
+ if (out.length)
315
+ el.setAttribute('style', out.join('; '));
316
+ else
317
+ el.removeAttribute('style');
318
+ }
319
+ if (name === 'A') {
320
+ const href = el.getAttribute('href');
321
+ if (!href || !safeEditorUrl(href, o.protocols)) {
322
+ // A link that goes nowhere is just its text.
323
+ cleanChildren(el, doc, o);
324
+ el.replaceWith(...Array.from(el.childNodes));
325
+ continue;
326
+ }
327
+ if (el.getAttribute('target') === '_blank')
328
+ el.setAttribute('rel', 'noopener noreferrer');
329
+ else
330
+ el.removeAttribute('target');
331
+ }
332
+ if (name === 'IMG') {
333
+ const src = el.getAttribute('src') || '';
334
+ if (!safeEditorImage(src)) {
335
+ el.remove();
336
+ continue;
337
+ }
338
+ }
339
+ if (name === 'SPAN' && !el.attributes.length) {
340
+ cleanChildren(el, doc, o);
341
+ el.replaceWith(...Array.from(el.childNodes));
342
+ continue;
343
+ }
344
+ cleanChildren(el, doc, o);
345
+ }
346
+ }
347
+ /** Text and inline content directly in the root goes into paragraphs. */
348
+ function wrapLoose(root, doc) {
349
+ let p = null;
350
+ for (const node of Array.from(root.childNodes)) {
351
+ const inline = node.nodeType === 3 ? !!node.textContent?.trim() || !!p : node.nodeType === 1 && !isBlock(node);
352
+ if (inline) {
353
+ if (!p) {
354
+ p = doc.createElement('p');
355
+ root.insertBefore(p, node);
356
+ }
357
+ p.appendChild(node);
358
+ }
359
+ else {
360
+ if (node.nodeType === 3)
361
+ node.remove();
362
+ p = null;
363
+ }
364
+ }
365
+ }
366
+ function tableGrid(table) {
367
+ const rows = Array.from(table.rows);
368
+ const grid = rows.map(() => []);
369
+ rows.forEach((tr, r) => {
370
+ let c = 0;
371
+ for (const cell of Array.from(tr.cells)) {
372
+ while (grid[r][c])
373
+ c++;
374
+ const rs = Math.max(1, cell.rowSpan || 1);
375
+ const cs = Math.max(1, cell.colSpan || 1);
376
+ for (let i = 0; i < rs && r + i < rows.length; i++)
377
+ for (let j = 0; j < cs; j++)
378
+ grid[r + i][c + j] = cell;
379
+ c += cs;
380
+ }
381
+ });
382
+ const cols = Math.max(0, ...grid.map((row) => row.length));
383
+ return { grid, rows, cols };
384
+ }
385
+ /** Row and column of a cell's top-left slot. */
386
+ function cellSlot(g, cell) {
387
+ for (let r = 0; r < g.grid.length; r++) {
388
+ const c = g.grid[r].indexOf(cell);
389
+ if (c >= 0)
390
+ return { row: r, col: c };
391
+ }
392
+ return { row: -1, col: -1 };
393
+ }
394
+ /** Sets a row / column span; a span of 1 leaves no attribute behind. */
395
+ function setSpan(cell, kind, n) {
396
+ const attr = kind === 'row' ? 'rowspan' : 'colspan';
397
+ if (n > 1)
398
+ cell.setAttribute(attr, String(n));
399
+ else
400
+ cell.removeAttribute(attr);
401
+ }
402
+ function newCell(doc, tag) {
403
+ const cell = doc.createElement(tag);
404
+ cell.appendChild(doc.createElement('br'));
405
+ return cell;
406
+ }
407
+ /** A new table, `rows` × `cols`, with a header row when asked. */
408
+ function createTable(doc, rows, cols, headerRow) {
409
+ const table = doc.createElement('table');
410
+ table.className = 'wu-editor-table';
411
+ if (headerRow) {
412
+ const thead = table.createTHead();
413
+ const tr = thead.insertRow();
414
+ for (let c = 0; c < cols; c++)
415
+ tr.appendChild(newCell(doc, 'th'));
416
+ }
417
+ const tbody = table.createTBody();
418
+ for (let r = 0; r < (headerRow ? rows - 1 : rows); r++) {
419
+ const tr = tbody.insertRow();
420
+ for (let c = 0; c < cols; c++)
421
+ tr.appendChild(newCell(doc, 'td'));
422
+ }
423
+ // The full width of the text, with even columns in %, so it follows the page on any screen.
424
+ table.style.width = '100%';
425
+ const group = doc.createElement('colgroup');
426
+ for (let c = 0; c < cols; c++) {
427
+ const col = doc.createElement('col');
428
+ col.style.width = percent(100 / cols);
429
+ group.appendChild(col);
430
+ }
431
+ table.insertBefore(group, table.firstChild);
432
+ return table;
433
+ }
434
+ /** A width in % with at most two decimals. */
435
+ function percent(n) {
436
+ return `${Math.round(Math.max(0, n) * 100) / 100}%`;
437
+ }
438
+ /** The <col>s of the table's <colgroup>, one per column; null when it has none or they do not match the columns. */
439
+ function tableCols(table) {
440
+ const group = Array.from(table.children).find((c) => c.tagName === 'COLGROUP');
441
+ if (!group)
442
+ return null;
443
+ const cols = Array.from(group.children).filter((c) => c.tagName === 'COL');
444
+ return cols.length && cols.length === tableGrid(table).cols ? cols : null;
445
+ }
446
+ /** Gives the table one <col> per column with its width in % of the table, measured from how it is drawn now. */
447
+ function ensureTableCols(table) {
448
+ const have = tableCols(table);
449
+ if (have)
450
+ return have;
451
+ const g = tableGrid(table);
452
+ const doc = table.ownerDocument;
453
+ const widths = [];
454
+ for (let c = 0; c < g.cols; c++) {
455
+ let w = 0;
456
+ for (const row of g.grid) {
457
+ const cell = row[c];
458
+ if (cell && (cell.colSpan || 1) === 1) {
459
+ w = cell.getBoundingClientRect().width;
460
+ break;
461
+ }
462
+ }
463
+ widths.push(w);
464
+ }
465
+ const known = widths.filter((w) => w > 0);
466
+ const fallback = known.length ? known.reduce((a, b) => a + b, 0) / known.length : 1;
467
+ const full = widths.map((w) => w || fallback);
468
+ const sum = full.reduce((a, b) => a + b, 0) || 1;
469
+ Array.from(table.children)
470
+ .filter((c) => c.tagName === 'COLGROUP')
471
+ .forEach((c) => c.remove());
472
+ const group = doc.createElement('colgroup');
473
+ const cols = full.map((w) => {
474
+ const col = doc.createElement('col');
475
+ col.style.width = percent((w / sum) * 100);
476
+ group.appendChild(col);
477
+ return col;
478
+ });
479
+ table.insertBefore(group, table.firstChild);
480
+ if (!table.style.width)
481
+ table.style.width = percent((table.getBoundingClientRect().width / Math.max(1, table.parentElement?.clientWidth || 1)) * 100);
482
+ return cols;
483
+ }
484
+ /** The rectangle of grid slots from cell `a` to cell `b`, grown until no merged cell sticks out of it. */
485
+ function cellRect(table, a, b) {
486
+ const g = tableGrid(table);
487
+ const sa = cellSlot(g, a);
488
+ const sb = cellSlot(g, b);
489
+ let r1 = Math.min(sa.row, sb.row);
490
+ let c1 = Math.min(sa.col, sb.col);
491
+ let r2 = Math.max(sa.row + (a.rowSpan || 1) - 1, sb.row + (b.rowSpan || 1) - 1);
492
+ let c2 = Math.max(sa.col + (a.colSpan || 1) - 1, sb.col + (b.colSpan || 1) - 1);
493
+ for (let grown = true; grown;) {
494
+ grown = false;
495
+ for (let r = r1; r <= r2; r++) {
496
+ for (let c = c1; c <= c2; c++) {
497
+ const cell = g.grid[r]?.[c];
498
+ if (!cell)
499
+ continue;
500
+ const s = cellSlot(g, cell);
501
+ const er = s.row + (cell.rowSpan || 1) - 1;
502
+ const ec = s.col + (cell.colSpan || 1) - 1;
503
+ if (s.row < r1 || s.col < c1 || er > r2 || ec > c2) {
504
+ r1 = Math.min(r1, s.row);
505
+ c1 = Math.min(c1, s.col);
506
+ r2 = Math.max(r2, er);
507
+ c2 = Math.max(c2, ec);
508
+ grown = true;
509
+ }
510
+ }
511
+ }
512
+ }
513
+ return { r1, c1, r2, c2 };
514
+ }
515
+ /** The cells inside a rectangle of slots, each once, in reading order. */
516
+ function cellsInRect(table, rect) {
517
+ const g = tableGrid(table);
518
+ const out = [];
519
+ for (let r = rect.r1; r <= rect.r2; r++) {
520
+ for (let c = rect.c1; c <= rect.c2; c++) {
521
+ const cell = g.grid[r]?.[c];
522
+ if (cell && !out.includes(cell))
523
+ out.push(cell);
524
+ }
525
+ }
526
+ return out;
527
+ }
528
+ /** Joins every cell of the rectangle into its top-left one (their content kept, one after another). */
529
+ function mergeRect(table, rect) {
530
+ const cells = cellsInRect(table, rect);
531
+ if (cells.length < 2)
532
+ return null;
533
+ const target = cells[0];
534
+ const filled = (c) => !!(c.textContent?.trim() || c.querySelector('img, table'));
535
+ if (!filled(target))
536
+ target.innerHTML = '';
537
+ for (const cell of cells.slice(1)) {
538
+ if (filled(cell)) {
539
+ if (target.childNodes.length)
540
+ target.appendChild(table.ownerDocument.createElement('br'));
541
+ while (cell.firstChild)
542
+ target.appendChild(cell.firstChild);
543
+ }
544
+ cell.remove();
545
+ }
546
+ if (!target.childNodes.length)
547
+ target.appendChild(table.ownerDocument.createElement('br'));
548
+ setSpan(target, 'row', rect.r2 - rect.r1 + 1);
549
+ setSpan(target, 'col', rect.c2 - rect.c1 + 1);
550
+ return target;
551
+ }
552
+ /** Inserts a row above or below the cell's row; cells merged across the spot grow. Returns the new row's first cell. */
553
+ function insertRow(cell, below) {
554
+ const table = cell.closest('table');
555
+ const doc = cell.ownerDocument;
556
+ const g = tableGrid(table);
557
+ const { row } = cellSlot(g, cell);
558
+ const at = below ? row + (cell.rowSpan || 1) - 1 : row;
559
+ const ref = g.rows[at];
560
+ const tr = doc.createElement('tr');
561
+ const tag = ref.parentElement?.tagName === 'THEAD' && !below ? 'th' : 'td';
562
+ const seen = new Set();
563
+ for (let c = 0; c < g.cols; c++) {
564
+ const covering = g.grid[at][c];
565
+ const spansAcross = covering && (below ? cellSlot(g, covering).row + (covering.rowSpan || 1) - 1 > at : cellSlot(g, covering).row < at);
566
+ if (spansAcross) {
567
+ if (!seen.has(covering)) {
568
+ setSpan(covering, 'row', (covering.rowSpan || 1) + 1);
569
+ seen.add(covering);
570
+ }
571
+ c += (covering.colSpan || 1) - 1;
572
+ }
573
+ else {
574
+ tr.appendChild(newCell(doc, tag === 'th' && below ? 'td' : tag));
575
+ }
576
+ }
577
+ // A row added under the header row goes into the body.
578
+ if (below && ref.parentElement?.tagName === 'THEAD') {
579
+ const body = table.tBodies[0] || table.createTBody();
580
+ body.insertBefore(tr, body.firstChild);
581
+ }
582
+ else {
583
+ ref.parentElement.insertBefore(tr, below ? ref.nextSibling : ref);
584
+ }
585
+ return tr.cells[0] || null;
586
+ }
587
+ /** Inserts a column left or right of the cell's column. */
588
+ function insertColumn(cell, right) {
589
+ const table = cell.closest('table');
590
+ const doc = cell.ownerDocument;
591
+ const g = tableGrid(table);
592
+ const { col } = cellSlot(g, cell);
593
+ const at = right ? col + (cell.colSpan || 1) - 1 : col;
594
+ // The new column takes half of the one it sits beside.
595
+ const cols = tableCols(table);
596
+ if (cols) {
597
+ const ref = cols[at];
598
+ const half = (parseFloat(ref.style.width) || 100 / (cols.length + 1)) / 2;
599
+ const fresh = doc.createElement('col');
600
+ ref.style.width = percent(half);
601
+ fresh.style.width = percent(half);
602
+ ref.parentElement.insertBefore(fresh, right ? ref.nextSibling : ref);
603
+ }
604
+ const grown = new Set();
605
+ g.rows.forEach((tr, r) => {
606
+ const covering = g.grid[r][at];
607
+ if (!covering) {
608
+ tr.appendChild(newCell(doc, tr.parentElement?.tagName === 'THEAD' ? 'th' : 'td'));
609
+ return;
610
+ }
611
+ const slot = cellSlot(g, covering);
612
+ const inside = right ? slot.col + (covering.colSpan || 1) - 1 > at : slot.col < at;
613
+ if (inside) {
614
+ if (!grown.has(covering)) {
615
+ setSpan(covering, 'col', (covering.colSpan || 1) + 1);
616
+ grown.add(covering);
617
+ }
618
+ return;
619
+ }
620
+ if (slot.row !== r)
621
+ return; // a cell merged down from above already covers this row's slot
622
+ const fresh = newCell(doc, covering.tagName === 'TH' ? 'th' : 'td');
623
+ if ((covering.rowSpan || 1) > 1)
624
+ setSpan(fresh, 'row', covering.rowSpan);
625
+ covering.parentElement.insertBefore(fresh, right ? covering.nextSibling : covering);
626
+ });
627
+ }
628
+ /** Removes the cell's row (merged cells shrink). Returns a cell to put the caret in, or null when the table is empty. */
629
+ function deleteRow(cell) {
630
+ const table = cell.closest('table');
631
+ const g = tableGrid(table);
632
+ const { row } = cellSlot(g, cell);
633
+ const tr = g.rows[row];
634
+ const done = new Set();
635
+ for (let c = 0; c < g.cols; c++) {
636
+ const covering = g.grid[row][c];
637
+ if (!covering || done.has(covering))
638
+ continue;
639
+ done.add(covering);
640
+ const slot = cellSlot(g, covering);
641
+ const rs = covering.rowSpan || 1;
642
+ if (rs > 1) {
643
+ if (slot.row === row) {
644
+ // Move the merged cell down into the next row.
645
+ const next = g.rows[row + 1];
646
+ setSpan(covering, 'row', rs - 1);
647
+ const after = g.grid[row + 1].slice(0, c).reverse().find((x) => x && x.parentElement === next);
648
+ next.insertBefore(covering, after ? after.nextSibling : next.firstChild);
649
+ }
650
+ else {
651
+ setSpan(covering, 'row', rs - 1);
652
+ }
653
+ }
654
+ }
655
+ const target = (g.rows[row + 1] || g.rows[row - 1])?.cells[0] || null;
656
+ tr.remove();
657
+ if (!table.rows.length) {
658
+ table.remove();
659
+ return null;
660
+ }
661
+ return target && target.isConnected ? target : table.rows[0].cells[0] || null;
662
+ }
663
+ /** Removes the cell's column. */
664
+ function deleteColumn(cell) {
665
+ const table = cell.closest('table');
666
+ const cols = tableCols(table);
667
+ const g = tableGrid(table);
668
+ const { row, col } = cellSlot(g, cell);
669
+ // Its width goes to the neighbour.
670
+ if (cols) {
671
+ const gone = cols[col];
672
+ const next = cols[col + 1] || cols[col - 1];
673
+ if (next)
674
+ next.style.width = percent((parseFloat(next.style.width) || 0) + (parseFloat(gone.style.width) || 0));
675
+ gone.remove();
676
+ }
677
+ const done = new Set();
678
+ g.rows.forEach((_, r) => {
679
+ const covering = g.grid[r][col];
680
+ if (!covering || done.has(covering))
681
+ return;
682
+ done.add(covering);
683
+ if ((covering.colSpan || 1) > 1)
684
+ setSpan(covering, 'col', covering.colSpan - 1);
685
+ else
686
+ covering.remove();
687
+ });
688
+ if (!table.querySelector('td, th')) {
689
+ table.remove();
690
+ return null;
691
+ }
692
+ const g2 = tableGrid(table);
693
+ const r = Math.min(row, g2.grid.length - 1);
694
+ return g2.grid[r][Math.min(col, g2.grid[r].length - 1)] || table.querySelector('td, th');
695
+ }
696
+ /** Joins the cell with the one to its right (same height), or below (same width). Returns whether it merged. */
697
+ function mergeCells(cell, direction) {
698
+ const table = cell.closest('table');
699
+ const g = tableGrid(table);
700
+ const { row, col } = cellSlot(g, cell);
701
+ const rs = cell.rowSpan || 1;
702
+ const cs = cell.colSpan || 1;
703
+ const other = direction === 'right' ? g.grid[row]?.[col + cs] : g.grid[row + rs]?.[col];
704
+ if (!other || other === cell)
705
+ return false;
706
+ const o = cellSlot(g, other);
707
+ if (direction === 'right' && (o.row !== row || (other.rowSpan || 1) !== rs))
708
+ return false;
709
+ if (direction === 'down' && (o.col !== col || (other.colSpan || 1) !== cs))
710
+ return false;
711
+ if (other.textContent?.trim() || other.querySelector('img')) {
712
+ if (!cell.textContent?.trim())
713
+ cell.innerHTML = '';
714
+ else
715
+ cell.appendChild(cell.ownerDocument.createElement('br'));
716
+ while (other.firstChild)
717
+ cell.appendChild(other.firstChild);
718
+ }
719
+ if (direction === 'right')
720
+ setSpan(cell, 'col', cs + (other.colSpan || 1));
721
+ else
722
+ setSpan(cell, 'row', rs + (other.rowSpan || 1));
723
+ other.remove();
724
+ return true;
725
+ }
726
+ /** Splits a merged cell back into single cells. */
727
+ function splitCell(cell) {
728
+ const rs = cell.rowSpan || 1;
729
+ const cs = cell.colSpan || 1;
730
+ if (rs === 1 && cs === 1)
731
+ return false;
732
+ const table = cell.closest('table');
733
+ const doc = cell.ownerDocument;
734
+ const g = tableGrid(table);
735
+ const { row, col } = cellSlot(g, cell);
736
+ const tag = cell.tagName === 'TH' ? 'th' : 'td';
737
+ setSpan(cell, 'row', 1);
738
+ setSpan(cell, 'col', 1);
739
+ for (let r = row; r < row + rs; r++) {
740
+ const tr = g.rows[r];
741
+ // Insert after the last cell of this row that sits left of the split area.
742
+ let after = r === row ? cell : null;
743
+ if (r !== row) {
744
+ for (let c = col - 1; c >= 0; c--) {
745
+ const x = g.grid[r][c];
746
+ if (x && x.parentElement === tr) {
747
+ after = x;
748
+ break;
749
+ }
750
+ }
751
+ }
752
+ for (let c = r === row ? 1 : 0; c < cs; c++) {
753
+ const fresh = newCell(doc, tag);
754
+ tr.insertBefore(fresh, after ? after.nextSibling : tr.firstChild);
755
+ after = fresh;
756
+ }
757
+ }
758
+ return true;
759
+ }
760
+ /** Turns the first row into a header row (`<thead>` with `<th>`), or back into a body row. */
761
+ function toggleHeaderRow(table) {
762
+ const doc = table.ownerDocument;
763
+ const swap = (cell, tag) => {
764
+ const n = doc.createElement(tag);
765
+ for (const a of Array.from(cell.attributes))
766
+ n.setAttribute(a.name, a.value);
767
+ while (cell.firstChild)
768
+ n.appendChild(cell.firstChild);
769
+ cell.replaceWith(n);
770
+ };
771
+ if (table.tHead && table.tHead.rows.length) {
772
+ const body = table.tBodies[0] || table.createTBody();
773
+ for (const tr of Array.from(table.tHead.rows).reverse()) {
774
+ Array.from(tr.cells).forEach((c) => swap(c, 'td'));
775
+ body.insertBefore(tr, body.firstChild);
776
+ }
777
+ table.tHead.remove();
778
+ }
779
+ else {
780
+ const first = table.rows[0];
781
+ if (!first)
782
+ return;
783
+ const thead = table.createTHead();
784
+ Array.from(first.cells).forEach((c) => swap(c, 'th'));
785
+ thead.appendChild(first);
786
+ }
787
+ }
788
+ /** The next (or previous) cell for Tab / Shift+Tab, or null at the end. */
789
+ function adjacentCell(cell, back) {
790
+ const table = cell.closest('table');
791
+ const cells = Array.from(table.querySelectorAll('td, th')).filter((c) => c.closest('table') === table);
792
+ const i = cells.indexOf(cell);
793
+ return cells[back ? i - 1 : i + 1] || null;
794
+ }
795
+
796
+ const WU_EDITOR_OPTIONS = new InjectionToken('WU_EDITOR_OPTIONS');
797
+ function provideEditorOptions(options) {
798
+ return { provide: WU_EDITOR_OPTIONS, useValue: options };
799
+ }
800
+
801
+ const svg = (body, fill = false) => `<svg class="wu-editor-icon" viewBox="0 0 20 20" ${fill ? 'fill="currentColor" stroke="none"' : 'fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"'} aria-hidden="true" focusable="false">${body}</svg>`;
802
+ /** The editor's built-in icons (inline SVG, they follow the text colour). */
803
+ const ɵWU_EDITOR_ICONS = {
804
+ undo: svg('<path d="M7.5 5 4 8.5 7.5 12"/><path d="M4 8.5h8a4 4 0 0 1 0 8h-2"/>'),
805
+ redo: svg('<path d="M12.5 5 16 8.5 12.5 12"/><path d="M16 8.5H8a4 4 0 0 0 0 8h2"/>'),
806
+ bold: svg('<path d="M6 4h5a3.25 3.25 0 0 1 0 6.5H6zM6 10.5h6a3.25 3.25 0 0 1 0 6.5H6z" stroke-width="2"/>'),
807
+ italic: svg('<path d="M12.5 4h-5M12.5 16h-5M11.25 4 8.75 16"/>'),
808
+ underline: svg('<path d="M6 3.5v6a4 4 0 0 0 8 0v-6M5 17h10"/>'),
809
+ strike: svg('<path d="M4 10h12M13.5 6.25C13 4.9 11.7 4 10 4 8 4 6.5 5.1 6.5 6.6c0 1.2.8 2 2.5 2.6M7 13.6c.4 1.4 1.7 2.4 3.3 2.4 2.1 0 3.6-1.1 3.6-2.7 0-.7-.2-1.2-.6-1.7"/>'),
810
+ subscript: svg('<path d="m3.5 5 7 9M10.5 5l-7 9M13.5 12.5c0-.9.7-1.5 1.6-1.5s1.6.6 1.6 1.4c0 1.4-3.2 2.4-3.2 4.1h3.3"/>'),
811
+ superscript: svg('<path d="m3.5 6 7 9M10.5 6l-7 9M13.5 4.5c0-.9.7-1.5 1.6-1.5s1.6.6 1.6 1.4c0 1.4-3.2 2.4-3.2 4.1h3.3"/>'),
812
+ code: svg('<path d="M7.5 6 3.5 10l4 4M12.5 6l4 4-4 4"/>'),
813
+ color: svg('<path d="m5.5 13.5 4.5-10 4.5 10M7.2 10h5.6"/><path d="M4 16.75h12" stroke-width="2.5"/>'),
814
+ highlight: svg('<path d="m11.5 4.5 4 4-6 6H5.5v-4z"/><path d="m9.5 6.5 4 4M3.5 17h13"/>'),
815
+ bulletList: svg('<path d="M8 5.5h8.5M8 10h8.5M8 14.5h8.5"/><circle cx="4.25" cy="5.5" r=".9" fill="currentColor"/><circle cx="4.25" cy="10" r=".9" fill="currentColor"/><circle cx="4.25" cy="14.5" r=".9" fill="currentColor"/>'),
816
+ orderedList: svg('<path d="M8.5 5.5h8M8.5 10h8M8.5 14.5h8M3.5 4.25l1-.75v4M3.25 12.5c.2-.6.7-1 1.3-1 .7 0 1.2.5 1.2 1.1 0 1-2.5 1.6-2.5 3h2.6" stroke-width="1.3"/>'),
817
+ indent: svg('<path d="M9 5.5h7.5M9 10h7.5M9 14.5h7.5M3.5 7.5 6 10l-2.5 2.5"/>'),
818
+ outdent: svg('<path d="M9 5.5h7.5M9 10h7.5M9 14.5h7.5M6 7.5 3.5 10 6 12.5"/>'),
819
+ alignLeft: svg('<path d="M3.5 5h13M3.5 8.33h8.5M3.5 11.67h13M3.5 15h8.5"/>'),
820
+ alignCenter: svg('<path d="M3.5 5h13M5.75 8.33h8.5M3.5 11.67h13M5.75 15h8.5"/>'),
821
+ alignRight: svg('<path d="M3.5 5h13M8 8.33h8.5M3.5 11.67h13M8 15h8.5"/>'),
822
+ alignJustify: svg('<path d="M3.5 5h13M3.5 8.33h13M3.5 11.67h13M3.5 15h13"/>'),
823
+ link: svg('<path d="M8.5 11.5a3.25 3.25 0 0 0 4.6 0l2.3-2.3a3.25 3.25 0 0 0-4.6-4.6l-.9.9"/><path d="M11.5 8.5a3.25 3.25 0 0 0-4.6 0l-2.3 2.3a3.25 3.25 0 0 0 4.6 4.6l.9-.9"/>'),
824
+ unlink: svg('<path d="M8.5 11.5a3.25 3.25 0 0 0 4.6 0l2.3-2.3a3.25 3.25 0 0 0-4.6-4.6l-.9.9M11.5 8.5a3.25 3.25 0 0 0-4.6 0l-2.3 2.3a3.25 3.25 0 0 0 4.6 4.6l.9-.9M3.5 3.5l13 13"/>'),
825
+ external: svg('<path d="M11 4h5v5M16 4l-7 7M14 11.5V15a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h3.5"/>'),
826
+ edit: svg('<path d="m12.5 4.5 3 3L7 16H4v-3z"/>'),
827
+ image: svg('<rect x="3" y="4" width="14" height="12" rx="1.5"/><circle cx="7.5" cy="8.25" r="1.25"/><path d="m3.5 14 4-4 3 3 2-2 4 4"/>'),
828
+ table: svg('<rect x="3" y="4" width="14" height="12" rx="1.5"/><path d="M3 8h14M3 12h14M8 8v8M12.5 8v8"/>'),
829
+ blockquote: svg('<path d="M4 10.5V14h3.5v-3.5H5.5c0-2 .7-3.2 2-4M11 10.5V14h3.5v-3.5h-2c0-2 .7-3.2 2-4"/>'),
830
+ codeBlock: svg('<rect x="3" y="3.5" width="14" height="13" rx="1.5"/><path d="M8 8 6 10l2 2M12 8l2 2-2 2"/>'),
831
+ hr: svg('<path d="M3 10h14M6 6h8M6 14h8" stroke-dasharray="0"/>'),
832
+ clear: svg('<path d="M6 4h8M10 4l-3 12M4 16h5M12.5 11.5l4 4M16.5 11.5l-4 4"/>'),
833
+ source: svg('<path d="M7 6 3.5 10 7 14M13 6l3.5 4-3.5 4M11 4.5l-2 11"/>'),
834
+ fullscreen: svg('<path d="M4 8V4h4M12 4h4v4M16 12v4h-4M8 16H4v-4"/>'),
835
+ exitFullscreen: svg('<path d="M8 4v4H4M16 8h-4V4M12 16v-4h4M4 12h4v4"/>'),
836
+ heading: svg('<path d="M5 4v12M15 4v12M5 10h10"/>'),
837
+ fontSize: svg('<path d="m2.5 15 4-10 4 10M4 11.5h5M12 15l2.75-6.5L17.5 15M12.9 13h3.7"/>'),
838
+ fontFamily: svg('<path d="M5 15 9 4h2l4 11M6.5 11h7"/>'),
839
+ chevron: '<svg class="wu-editor-chevron" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="m4.5 6.5 3.5 3.5 3.5-3.5"/></svg>',
840
+ trash: svg('<path d="M4 6h12M8 6V4h4v2M5.5 6l.7 10h7.6l.7-10M8.5 9v4.5M11.5 9v4.5"/>'),
841
+ check: svg('<path d="m4.5 10.5 3.5 3.5 7.5-8"/>'),
842
+ upload: svg('<path d="M10 13V4M6.5 7.5 10 4l3.5 3.5M4 13v3h12v-3"/>'),
843
+ rowAbove: svg('<rect x="3" y="9" width="14" height="7" rx="1"/><path d="M10 2.5v5M7.5 5h5"/>'),
844
+ rowBelow: svg('<rect x="3" y="4" width="14" height="7" rx="1"/><path d="M10 12.5v5M7.5 15h5"/>'),
845
+ colLeft: svg('<rect x="9" y="3" width="7" height="14" rx="1"/><path d="M2.5 10h5M5 7.5v5"/>'),
846
+ colRight: svg('<rect x="4" y="3" width="7" height="14" rx="1"/><path d="M12.5 10h5M15 7.5v5"/>'),
847
+ deleteRow: svg('<rect x="3" y="7" width="14" height="6" rx="1"/><path d="m8 8.5 4 3M12 8.5l-4 3"/>'),
848
+ deleteCol: svg('<rect x="7" y="3" width="6" height="14" rx="1"/><path d="m8.5 8 3 4M11.5 8l-3 4"/>'),
849
+ headerRow: svg('<rect x="3" y="4" width="14" height="12" rx="1.5"/><path d="M3 8h14"/><path d="M3.75 4.75h12.5v2.5H3.75z" fill="currentColor" stroke="none"/>'),
850
+ mergeRight: svg('<rect x="3" y="5" width="14" height="10" rx="1"/><path d="M6 10h8M11.5 7.5 14 10l-2.5 2.5"/>'),
851
+ mergeDown: svg('<rect x="5" y="3" width="10" height="14" rx="1"/><path d="M10 6v8M7.5 11.5 10 14l2.5-2.5"/>'),
852
+ splitCell: svg('<rect x="3" y="5" width="14" height="10" rx="1"/><path d="M10 5v10"/>'),
853
+ imageInline: svg('<rect x="7" y="6" width="6" height="5" rx="1"/><path d="M3 8.5h2.5M14.5 8.5H17M3 14h14"/>'),
854
+ imageLeft: svg('<rect x="3" y="5" width="7" height="6" rx="1"/><path d="M12 6h5M12 9h5M3 14h14"/>'),
855
+ imageCenter: svg('<rect x="6.5" y="4" width="7" height="7" rx="1"/><path d="M3 14h14M5 17h10"/>'),
856
+ imageRight: svg('<rect x="10" y="5" width="7" height="6" rx="1"/><path d="M3 6h5M3 9h5M3 14h14"/>'),
857
+ };
858
+ /** Reads `ql-bold`, `ql-list` + value, `select.ql-header` and the rest; null for controls the editor does not offer. */
859
+ function ɵquillTool(el) {
860
+ const has = (c) => el.classList.contains(c);
861
+ const value = (el.getAttribute('value') || '').trim();
862
+ const select = el.tagName === 'SELECT';
863
+ if (has('ql-bold'))
864
+ return { tool: 'bold' };
865
+ if (has('ql-italic'))
866
+ return { tool: 'italic' };
867
+ if (has('ql-underline'))
868
+ return { tool: 'underline' };
869
+ if (has('ql-strike'))
870
+ return { tool: 'strike' };
871
+ if (has('ql-script'))
872
+ return { tool: value === 'super' ? 'superscript' : 'subscript' };
873
+ if (has('ql-header'))
874
+ return select ? { tool: 'heading', dropdown: true } : { tool: 'heading', heading: Number(value) || 1 };
875
+ if (has('ql-size'))
876
+ return { tool: 'fontSize', dropdown: true };
877
+ if (has('ql-font'))
878
+ return { tool: 'fontFamily', dropdown: true };
879
+ if (has('ql-color'))
880
+ return { tool: 'color' };
881
+ if (has('ql-background'))
882
+ return { tool: 'highlight' };
883
+ if (has('ql-list'))
884
+ return { tool: value === 'ordered' ? 'orderedList' : 'bulletList' };
885
+ if (has('ql-indent'))
886
+ return { tool: value === '-1' ? 'outdent' : 'indent' };
887
+ if (has('ql-align')) {
888
+ if (select)
889
+ return { tool: 'align' };
890
+ return { tool: value === 'center' ? 'alignCenter' : value === 'right' ? 'alignRight' : value === 'justify' ? 'alignJustify' : 'alignLeft' };
891
+ }
892
+ if (has('ql-blockquote'))
893
+ return { tool: 'blockquote' };
894
+ if (has('ql-code-block'))
895
+ return { tool: 'codeBlock' };
896
+ if (has('ql-code'))
897
+ return { tool: 'code' };
898
+ if (has('ql-link'))
899
+ return { tool: 'link' };
900
+ if (has('ql-image'))
901
+ return { tool: 'image' };
902
+ if (has('ql-clean'))
903
+ return { tool: 'clear' };
904
+ return null;
905
+ }
906
+
907
+ const asTemplate = (v) => (v instanceof TemplateRef ? v : null);
908
+ const QUILL_SIZES = { '0.75em': 'small', '1.5em': 'large', '2.5em': 'huge' };
909
+ const ACCEPT_IMAGES = 'image/png,image/jpeg,image/gif,image/webp';
910
+ const MAX_INDENT = 8;
911
+ /** Header names and values from Angular's HttpHeaders or a plain object. */
912
+ function headerEntries(headers) {
913
+ if (!headers)
914
+ return [];
915
+ const h = headers;
916
+ if (typeof h.keys === 'function' && typeof h.get === 'function')
917
+ return h.keys().map((k) => [k, h.get(k) || '']);
918
+ return Object.entries(headers).map(([k, v]) => [k, String(v)]);
919
+ }
920
+ function pathValue(obj, path) {
921
+ let v = obj;
922
+ for (const k of path.split('.')) {
923
+ if (v === null || v === undefined || typeof v !== 'object')
924
+ return undefined;
925
+ v = v[k];
926
+ }
927
+ return v;
928
+ }
929
+ const EMPTY_STATE = {
930
+ bold: false,
931
+ italic: false,
932
+ underline: false,
933
+ strike: false,
934
+ subscript: false,
935
+ superscript: false,
936
+ code: false,
937
+ bulletList: false,
938
+ orderedList: false,
939
+ blockquote: false,
940
+ codeBlock: false,
941
+ link: false,
942
+ table: false,
943
+ heading: 0,
944
+ align: 'left',
945
+ fontSize: '',
946
+ fontFamily: '',
947
+ };
948
+ /**
949
+ * What wu-editor does, shared by the v1 and v2/v3 templates: a rich-text editor written for WiraUI (no third-party
950
+ * editor inside). The value is HTML through `[(ngModel)]` / forms (null when empty, as before), with the class names
951
+ * values saved earlier use (`ql-align-center`, `ql-indent-1`, `ql-size-large`) so stored content keeps its look.
952
+ *
953
+ * Toolbar: a preset (`toolbar="basic" | "standard" | "full"`), a list of tools, or the app's own `header` template with
954
+ * the familiar `ql-bold` / `ql-header` markup; `[toolOptions]` sets heading levels, sizes, colours, table grid and more.
955
+ * Tables (insert, rows, columns, merge, header row), links, pictures (uploaded to a URL or embedded as base64, resized,
956
+ * aligned), undo / redo, paste clean-up, source view, full screen and a word count.
957
+ */
958
+ class ɵWuEditorBase {
959
+ /** Tools to show: a preset, a list with `'|'` between groups, or a list of groups. Default `'standard'`. */
960
+ set toolbar(v) {
961
+ this._toolbar = v ?? null;
962
+ this.groups = editorToolbarGroups(this._toolbar ?? this.defaults.toolbar, 'standard');
963
+ }
964
+ /** Fine settings of the tools: heading levels, font sizes and families, colours, alignments, table grid, links. */
965
+ set toolOptions(v) {
966
+ this._toolOptions = v ?? null;
967
+ this.opts = editorToolOptions({ ...(this.defaults.toolOptions || {}), ...(v || {}) });
968
+ }
969
+ set readonly(v) {
970
+ this._readonly = ɵtoBool(v);
971
+ this.syncEditable();
972
+ }
973
+ get readonly() {
974
+ return this._readonly;
975
+ }
976
+ /** Show the word and character count under the content. */
977
+ set showCount(v) {
978
+ this._showCount = ɵtoBool(v);
979
+ }
980
+ get showCount() {
981
+ return this._showCount;
982
+ }
983
+ /** Keep the toolbar in view while a tall editor scrolls the page. Default true. */
984
+ set stickyToolbar(v) {
985
+ this._sticky = v === undefined || ɵtoBool(v);
986
+ }
987
+ get stickyToolbar() {
988
+ return this._sticky;
989
+ }
990
+ constructor() {
991
+ this.onTextChange = new EventEmitter();
992
+ this.onSelectionChange = new EventEmitter();
993
+ this.onInit = new EventEmitter();
994
+ this.onFocus = new EventEmitter();
995
+ this.onBlur = new EventEmitter();
996
+ this.onImageUpload = new EventEmitter();
997
+ this.onImageUploadError = new EventEmitter();
998
+ this.major = WU_VERSION_INFO.major;
999
+ this.icons = ɵWU_EDITOR_ICONS;
1000
+ this.baseId = ɵuniqueId('wu-editor');
1001
+ this.groups = editorToolbarGroups(null);
1002
+ this.opts = editorToolOptions(null);
1003
+ this.state = { ...EMPTY_STATE };
1004
+ this.focused = false;
1005
+ this.empty = true;
1006
+ this.disabled = false;
1007
+ this.sourceMode = false;
1008
+ this.sourceText = '';
1009
+ this.fullscreen = false;
1010
+ this.counts = { characters: 0, words: 0 };
1011
+ this.canUndo = false;
1012
+ this.canRedo = false;
1013
+ /** The open panel and what it is about. */
1014
+ this.panel = null;
1015
+ this.panelAnchor = null;
1016
+ /** Table grid picker: rows × cols under the pointer. */
1017
+ this.gridHover = { rows: 0, cols: 0 };
1018
+ /** The insert panel's own size fields. */
1019
+ this.tableForm = { rows: 3, cols: 3, header: true };
1020
+ /** Cells picked by dragging across them (or Shift + click), for merging. */
1021
+ this.cellPick = null;
1022
+ /** Link form fields. */
1023
+ this.linkForm = { url: '', text: '', newTab: true, showText: false, error: '' };
1024
+ /** Image form. */
1025
+ this.imageForm = { tab: 'upload', url: '', alt: '', error: '' };
1026
+ /** Picture selected in the content (shows the frame and the picture menu). */
1027
+ this.selectedImage = null;
1028
+ this.frame = { top: 0, left: 0, width: 0, height: 0 };
1029
+ /** Messages shown under the content (upload failures …), cleared after a while. */
1030
+ this.notices = [];
1031
+ this.imageAligns = ['inline', 'left', 'center', 'right'];
1032
+ this.imageWidths = [25, 50, 75, 100];
1033
+ this.tableInserts = ['rowAbove', 'rowBelow', 'colLeft', 'colRight'];
1034
+ this.cdr = inject(ChangeDetectorRef);
1035
+ this.doc = inject(DOCUMENT);
1036
+ this.zone = inject(NgZone);
1037
+ this.config = inject(WuConfig);
1038
+ this.host = inject(ElementRef).nativeElement;
1039
+ this.defaults = inject(WU_EDITOR_OPTIONS, { optional: true }) || {};
1040
+ this.i18n = ɵrefreshOnTranslation();
1041
+ this.history = new EditorHistory();
1042
+ this._toolbar = null;
1043
+ this._toolOptions = null;
1044
+ this._readonly = false;
1045
+ this._showCount = false;
1046
+ this._sticky = true;
1047
+ this.value = null;
1048
+ this.lastEmitted = null;
1049
+ this.savedRange = null;
1050
+ this.lastSelection = null;
1051
+ this.popup = null;
1052
+ this.unlockScroll = null;
1053
+ this.cleanups = [];
1054
+ this.stateFrame = 0;
1055
+ this.quillObserver = null;
1056
+ this.onChange = () => undefined;
1057
+ this.onTouched = () => undefined;
1058
+ this.viewReady = false;
1059
+ // ---------- tables: picking cells, resizing columns ----------
1060
+ this.resizeHover = null;
1061
+ ɵassertSupportedAngular(inject(ɵWU_SKIP_VERSION_CHECK, { optional: true }));
1062
+ const styles = inject(ɵWuStyleLoader);
1063
+ styles.load('button', ɵWU_BUTTON_CSS);
1064
+ styles.load('inputtext', ɵWU_INPUTTEXT_CSS);
1065
+ this.groups = editorToolbarGroups(this.defaults.toolbar ?? null, 'standard');
1066
+ this.opts = editorToolOptions(this.defaults.toolOptions);
1067
+ const self = this;
1068
+ this.api = {
1069
+ get root() {
1070
+ return self.area;
1071
+ },
1072
+ getHTML: () => this.html(),
1073
+ getSemanticHTML: () => this.html(),
1074
+ getText: () => editorHtmlToText(this.html()),
1075
+ getLength: () => editorHtmlToText(this.html()).length + 1,
1076
+ setHTML: (html) => this.setContent(html, true),
1077
+ insertHTML: (html) => this.insertHtml(cleanEditorHtml(html, this.doc, this.cleanOpts)),
1078
+ insertText: (text) => this.exec(() => this.doc.execCommand('insertText', false, text)),
1079
+ focus: () => this.focus(),
1080
+ blur: () => this.area.blur(),
1081
+ hasFocus: () => this.doc.activeElement === this.area,
1082
+ enable: (on = true) => this.setDisabledState(!on),
1083
+ disable: () => this.setDisabledState(true),
1084
+ undo: () => this.undo(),
1085
+ redo: () => this.redo(),
1086
+ clipboard: {
1087
+ dangerouslyPasteHTML: (a, b) => this.setContent(typeof a === 'string' ? a : b || '', true),
1088
+ },
1089
+ };
1090
+ }
1091
+ // ---------- lifecycle ----------
1092
+ ngAfterViewInit() {
1093
+ this.viewReady = true;
1094
+ const area = this.area;
1095
+ area.innerHTML = this.toEditable(this.value);
1096
+ this.history.reset({ html: area.innerHTML, selection: null });
1097
+ this.syncEditable();
1098
+ this.refreshMeta();
1099
+ this.zone.runOutsideAngular(() => {
1100
+ const onSel = () => this.selectionChanged();
1101
+ this.doc.addEventListener('selectionchange', onSel);
1102
+ this.cleanups.push(() => this.doc.removeEventListener('selectionchange', onSel));
1103
+ const onBeforeInput = (e) => this.beforeInput(e);
1104
+ area.addEventListener('beforeinput', onBeforeInput);
1105
+ this.cleanups.push(() => area.removeEventListener('beforeinput', onBeforeInput));
1106
+ const onScroll = () => this.placeFrame();
1107
+ area.addEventListener('scroll', onScroll, { passive: true });
1108
+ this.cleanups.push(() => area.removeEventListener('scroll', onScroll));
1109
+ // Tables: drag across cells to pick them, drag a column's edge to resize it.
1110
+ const onMove = (e) => this.tablePointerMove(e);
1111
+ const onDown = (e) => this.tablePointerDown(e);
1112
+ area.addEventListener('pointermove', onMove);
1113
+ area.addEventListener('pointerdown', onDown);
1114
+ this.cleanups.push(() => area.removeEventListener('pointermove', onMove), () => area.removeEventListener('pointerdown', onDown));
1115
+ });
1116
+ if (this.headerTemplate)
1117
+ this.wireQuillToolbar();
1118
+ this.syncToolbarTabStops();
1119
+ this.cdr.detectChanges();
1120
+ this.onInit.emit({ editor: this.api });
1121
+ }
1122
+ ngOnDestroy() {
1123
+ this.i18n.unsubscribe();
1124
+ this.closePanel(false);
1125
+ this.unlockScroll?.();
1126
+ this.quillObserver?.disconnect();
1127
+ for (const off of this.cleanups.splice(0))
1128
+ off();
1129
+ const win = this.doc.defaultView;
1130
+ if (this.stateFrame && win)
1131
+ win.cancelAnimationFrame(this.stateFrame);
1132
+ }
1133
+ /** The calls apps make on the editor from code (the same object `(onInit)` hands over). */
1134
+ getEditor() {
1135
+ return this.api;
1136
+ }
1137
+ /** The same as getEditor(), for code moving over. */
1138
+ getQuill() {
1139
+ return this.api;
1140
+ }
1141
+ // ---------- forms ----------
1142
+ writeValue(v) {
1143
+ this.value = v === null || v === undefined ? null : String(v);
1144
+ this.lastEmitted = this.value;
1145
+ if (this.viewReady) {
1146
+ this.area.innerHTML = this.toEditable(this.value);
1147
+ this.history.reset({ html: this.area.innerHTML, selection: null });
1148
+ this.selectImage(null);
1149
+ this.refreshMeta();
1150
+ this.cdr.markForCheck();
1151
+ }
1152
+ }
1153
+ registerOnChange(fn) {
1154
+ this.onChange = fn;
1155
+ }
1156
+ registerOnTouched(fn) {
1157
+ this.onTouched = fn;
1158
+ }
1159
+ setDisabledState(disabled) {
1160
+ this.disabled = disabled;
1161
+ this.syncEditable();
1162
+ this.cdr.markForCheck();
1163
+ }
1164
+ // ---------- what the templates read ----------
1165
+ get t() {
1166
+ return this.config.translation;
1167
+ }
1168
+ get m() {
1169
+ return this.config.translation.editor || TH_LOCALE.editor;
1170
+ }
1171
+ get headerTemplate() {
1172
+ return asTemplate(this.headerRef) || ɵfindTemplate(this.templates, 'header');
1173
+ }
1174
+ get locked() {
1175
+ return this.disabled || this._readonly;
1176
+ }
1177
+ get area() {
1178
+ return this.areaRef.nativeElement;
1179
+ }
1180
+ get areaLabel() {
1181
+ return this.ariaLabel || this.placeholder || this.m.content;
1182
+ }
1183
+ headingLabel(level) {
1184
+ return level ? this.m.heading.replace('{0}', String(level)) : this.m.paragraph;
1185
+ }
1186
+ get currentHeadingLabel() {
1187
+ if (this.state.codeBlock)
1188
+ return this.m.codeBlock;
1189
+ if (this.state.blockquote)
1190
+ return this.m.blockquote;
1191
+ return this.headingLabel(this.state.heading);
1192
+ }
1193
+ get fontSizes() {
1194
+ if (this.opts.fontSizes.length)
1195
+ return this.opts.fontSizes;
1196
+ const m = this.m;
1197
+ return EDITOR_FONT_SIZES.map((s) => ({
1198
+ value: s.value,
1199
+ label: s.label === 'small' ? m.sizeSmall : s.label === 'large' ? m.sizeLarge : s.label === 'huge' ? m.sizeHuge : m.sizeNormal,
1200
+ }));
1201
+ }
1202
+ get fontFamilies() {
1203
+ if (this.opts.fontFamilies.length)
1204
+ return this.opts.fontFamilies;
1205
+ return [
1206
+ { label: this.m.defaultFont, value: '' },
1207
+ { label: 'Serif', value: 'serif' },
1208
+ { label: 'Monospace', value: 'monospace' },
1209
+ ];
1210
+ }
1211
+ get currentSizeLabel() {
1212
+ return this.fontSizes.find((s) => s.value === this.state.fontSize)?.label || this.m.fontSize;
1213
+ }
1214
+ get currentFontLabel() {
1215
+ return this.fontFamilies.find((s) => s.value === this.state.fontFamily)?.label || this.m.fontFamily;
1216
+ }
1217
+ /** Label and icon of one tool. */
1218
+ toolLabel(tool) {
1219
+ const m = this.m;
1220
+ if (tool === 'fullscreen' && this.fullscreen)
1221
+ return this.m.exitFullscreen;
1222
+ if (tool === 'table' && this.state.table)
1223
+ return this.m.table;
1224
+ return m[tool] || tool;
1225
+ }
1226
+ isOn(tool) {
1227
+ const s = this.state;
1228
+ if (tool === 'source')
1229
+ return this.sourceMode;
1230
+ if (tool === 'fullscreen')
1231
+ return this.fullscreen;
1232
+ if (tool === 'alignLeft' || tool === 'alignCenter' || tool === 'alignRight' || tool === 'alignJustify')
1233
+ return this.state.align === tool.slice(5).toLowerCase();
1234
+ return s[tool] === true;
1235
+ }
1236
+ isDisabled(tool) {
1237
+ if (tool === 'fullscreen')
1238
+ return false;
1239
+ if (this.locked)
1240
+ return true;
1241
+ if (this.sourceMode)
1242
+ return tool !== 'source';
1243
+ if (tool === 'undo')
1244
+ return !this.canUndo;
1245
+ if (tool === 'redo')
1246
+ return !this.canRedo;
1247
+ return false;
1248
+ }
1249
+ /** Tools that open a menu (aria-haspopup). */
1250
+ hasMenu(tool) {
1251
+ return ['heading', 'fontSize', 'fontFamily', 'color', 'highlight', 'align', 'link', 'image', 'table'].includes(tool);
1252
+ }
1253
+ /** Tools drawn as a labelled dropdown rather than an icon. */
1254
+ isDropdown(tool) {
1255
+ return tool === 'heading' || tool === 'fontSize' || tool === 'fontFamily';
1256
+ }
1257
+ dropdownLabel(tool) {
1258
+ return tool === 'heading' ? this.currentHeadingLabel : tool === 'fontSize' ? this.currentSizeLabel : this.currentFontLabel;
1259
+ }
1260
+ /** Name of the icon a tool shows (the align tool shows the current alignment). */
1261
+ toolIcon(tool) {
1262
+ if (tool === 'align')
1263
+ return 'align' + this.state.align[0].toUpperCase() + this.state.align.slice(1);
1264
+ if (tool === 'fullscreen' && this.fullscreen)
1265
+ return 'exitFullscreen';
1266
+ return tool;
1267
+ }
1268
+ /** Whether the menu of a tool is the one open. */
1269
+ panelOpenFor(tool) {
1270
+ return tool === 'table' ? this.panel === 'table' || this.panel === 'tableMenu' : this.panel === tool;
1271
+ }
1272
+ get areaId() {
1273
+ return `${this.id || this.baseId}_content`;
1274
+ }
1275
+ buttonClass(styleClass, extra = '') {
1276
+ return ɵbuttonClass(styleClass) + (extra ? ' ' + extra : '');
1277
+ }
1278
+ alignLabel(a) {
1279
+ return a === 'center' ? this.m.alignCenter : a === 'right' ? this.m.alignRight : a === 'justify' ? this.m.alignJustify : this.m.alignLeft;
1280
+ }
1281
+ alignIcon(a) {
1282
+ return 'align' + a[0].toUpperCase() + a.slice(1);
1283
+ }
1284
+ gridRows() {
1285
+ return Array.from({ length: this.opts.table.rows }, (_, i) => i + 1);
1286
+ }
1287
+ gridCols() {
1288
+ return Array.from({ length: this.opts.table.cols }, (_, i) => i + 1);
1289
+ }
1290
+ get gridLabel() {
1291
+ const { rows, cols } = this.gridHover;
1292
+ return rows && cols ? this.m.tableSize.replace('{0}', String(rows)).replace('{1}', String(cols)) : this.m.insertTable;
1293
+ }
1294
+ get countText() {
1295
+ return `${this.m.words.replace('{0}', String(this.counts.words))} · ${this.m.characters.replace('{0}', String(this.counts.characters))}`;
1296
+ }
1297
+ get acceptImages() {
1298
+ return this.uploadConfig.accept || ACCEPT_IMAGES;
1299
+ }
1300
+ get imageWidthLabel() {
1301
+ const img = this.selectedImage;
1302
+ return img && img.getAttribute('width') ? `${img.getAttribute('width')}px` : this.m.imageOriginal;
1303
+ }
1304
+ imageAlignLabel(a) {
1305
+ const m = this.m;
1306
+ return a === 'left' ? m.imageLeft : a === 'center' ? m.imageCenter : a === 'right' ? m.imageRight : m.imageInline;
1307
+ }
1308
+ imageAlignIs(a) {
1309
+ const img = this.selectedImage;
1310
+ if (!img)
1311
+ return false;
1312
+ const cur = prefixedClass(img, 'wu-image-') || 'inline';
1313
+ return cur === a;
1314
+ }
1315
+ // ---------- toolbar actions ----------
1316
+ /** Keeps the content's selection when a toolbar button is pressed. */
1317
+ toolbarMouseDown(event) {
1318
+ const t = event.target;
1319
+ if (t.closest('select, input, textarea'))
1320
+ return;
1321
+ if (t.closest('button'))
1322
+ event.preventDefault();
1323
+ }
1324
+ /** A toolbar button. */
1325
+ runTool(tool, event) {
1326
+ if (this.isDisabled(tool))
1327
+ return;
1328
+ const anchor = event.currentTarget || null;
1329
+ switch (tool) {
1330
+ case 'undo':
1331
+ return this.undo();
1332
+ case 'redo':
1333
+ return this.redo();
1334
+ case 'bold':
1335
+ case 'italic':
1336
+ case 'underline':
1337
+ return this.exec(() => this.doc.execCommand(tool, false));
1338
+ case 'strike':
1339
+ return this.exec(() => this.doc.execCommand('strikeThrough', false));
1340
+ case 'subscript':
1341
+ case 'superscript':
1342
+ return this.exec(() => this.doc.execCommand(tool, false));
1343
+ case 'code':
1344
+ return this.exec(() => this.toggleInlineCode());
1345
+ case 'bulletList':
1346
+ return this.exec(() => this.doc.execCommand('insertUnorderedList', false));
1347
+ case 'orderedList':
1348
+ return this.exec(() => this.doc.execCommand('insertOrderedList', false));
1349
+ case 'indent':
1350
+ return this.exec(() => this.indent(1));
1351
+ case 'outdent':
1352
+ return this.exec(() => this.indent(-1));
1353
+ case 'alignLeft':
1354
+ case 'alignCenter':
1355
+ case 'alignRight':
1356
+ case 'alignJustify':
1357
+ return this.exec(() => this.setAlign(tool.slice(5).toLowerCase()));
1358
+ case 'blockquote':
1359
+ return this.exec(() => this.formatBlock(this.state.blockquote ? 'p' : 'blockquote'));
1360
+ case 'codeBlock':
1361
+ return this.exec(() => this.formatBlock(this.state.codeBlock ? 'p' : 'pre'));
1362
+ case 'hr':
1363
+ return this.exec(() => this.doc.execCommand('insertHorizontalRule', false));
1364
+ case 'clear':
1365
+ return this.exec(() => this.clearFormatting());
1366
+ case 'source':
1367
+ return this.toggleSource();
1368
+ case 'fullscreen':
1369
+ return this.toggleFullscreen();
1370
+ case 'table':
1371
+ return this.openPanel(this.state.table ? 'tableMenu' : 'table', anchor);
1372
+ case 'align':
1373
+ case 'heading':
1374
+ case 'fontSize':
1375
+ case 'fontFamily':
1376
+ case 'color':
1377
+ case 'highlight':
1378
+ case 'link':
1379
+ case 'image':
1380
+ return this.openPanel(tool, anchor);
1381
+ }
1382
+ }
1383
+ /** ← / → / Home / End move along the toolbar (one Tab stop), as toolbars do. */
1384
+ toolbarKeydown(event) {
1385
+ const bar = this.toolbarRef?.nativeElement;
1386
+ if (!bar || !['ArrowLeft', 'ArrowRight', 'Home', 'End'].includes(event.key))
1387
+ return;
1388
+ const items = this.toolbarItems();
1389
+ const at = items.indexOf(event.target);
1390
+ if (at < 0)
1391
+ return;
1392
+ event.preventDefault();
1393
+ const next = event.key === 'Home' ? 0 : event.key === 'End' ? items.length - 1 : (at + (event.key === 'ArrowRight' ? 1 : -1) + items.length) % items.length;
1394
+ items.forEach((el, i) => el.setAttribute('tabindex', i === next ? '0' : '-1'));
1395
+ items[next].focus();
1396
+ }
1397
+ pickHeading(level) {
1398
+ this.closePanel(false);
1399
+ this.exec(() => this.formatBlock(level ? `h${level}` : 'p'));
1400
+ }
1401
+ /** Quote or code block from the block menu; picking the current one turns it back into a paragraph. */
1402
+ pickBlock(kind) {
1403
+ this.closePanel(false);
1404
+ const on = kind === 'blockquote' ? this.state.blockquote : this.state.codeBlock;
1405
+ this.exec(() => this.formatBlock(on ? 'p' : kind === 'blockquote' ? 'blockquote' : 'pre'));
1406
+ }
1407
+ pickSize(value) {
1408
+ this.closePanel(false);
1409
+ this.exec(() => this.applyInlineStyle('fontSize', value));
1410
+ }
1411
+ pickFont(value) {
1412
+ this.closePanel(false);
1413
+ this.exec(() => this.applyInlineStyle('fontFamily', value));
1414
+ }
1415
+ pickAlign(a) {
1416
+ this.closePanel(false);
1417
+ this.exec(() => this.setAlign(a));
1418
+ }
1419
+ pickColor(kind, value) {
1420
+ this.closePanel(false);
1421
+ this.exec(() => {
1422
+ if (!value)
1423
+ return this.removeInlineStyle(kind === 'color' ? 'color' : 'background-color');
1424
+ this.doc.execCommand('styleWithCSS', false, 'true');
1425
+ if (kind === 'color')
1426
+ this.doc.execCommand('foreColor', false, value);
1427
+ else if (!this.doc.execCommand('hiliteColor', false, value))
1428
+ this.doc.execCommand('backColor', false, value);
1429
+ this.doc.execCommand('styleWithCSS', false, 'false');
1430
+ });
1431
+ }
1432
+ customColor(kind, event) {
1433
+ this.pickColor(kind, event.target.value);
1434
+ }
1435
+ gridMove(rows, cols) {
1436
+ this.gridHover = { rows, cols };
1437
+ }
1438
+ /** Arrow keys over the grid picker; Enter inserts. */
1439
+ gridKeydown(event) {
1440
+ const g = this.gridHover;
1441
+ let { rows, cols } = g.rows ? g : { rows: 1, cols: 1 };
1442
+ if (event.key === 'ArrowRight')
1443
+ cols = Math.min(this.opts.table.cols, cols + 1);
1444
+ else if (event.key === 'ArrowLeft')
1445
+ cols = Math.max(1, cols - 1);
1446
+ else if (event.key === 'ArrowDown')
1447
+ rows = Math.min(this.opts.table.rows, rows + 1);
1448
+ else if (event.key === 'ArrowUp')
1449
+ rows = Math.max(1, rows - 1);
1450
+ else if (event.key === 'Enter' || event.key === ' ') {
1451
+ event.preventDefault();
1452
+ return this.insertTable(rows, cols);
1453
+ }
1454
+ else
1455
+ return;
1456
+ event.preventDefault();
1457
+ this.gridHover = { rows, cols };
1458
+ this.cdr.markForCheck();
1459
+ }
1460
+ /** The insert panel's size fields: rows and columns typed in, then Insert. */
1461
+ insertCustomTable() {
1462
+ const n = (v, max) => Math.min(max, Math.max(1, Math.floor(Number(v)) || 1));
1463
+ this.insertTable(n(this.tableForm.rows, 100), n(this.tableForm.cols, 30), this.tableForm.header);
1464
+ }
1465
+ setTableForm(field, event) {
1466
+ this.tableForm = { ...this.tableForm, [field]: event.target.value };
1467
+ }
1468
+ setTableHeader(event) {
1469
+ this.tableForm = { ...this.tableForm, header: event.target.checked };
1470
+ }
1471
+ insertTable(rows, cols, header = this.opts.table.headerRow) {
1472
+ this.closePanel(false);
1473
+ this.exec(() => {
1474
+ const table = createTable(this.doc, Math.max(1, rows), Math.max(1, cols), header && rows > 1);
1475
+ const html = table.outerHTML + '<p><br></p>';
1476
+ this.doc.execCommand('insertHTML', false, html);
1477
+ // Put the caret in the first cell of the new table.
1478
+ const tables = this.area.querySelectorAll('table');
1479
+ const r = rangeIn(this.area);
1480
+ let target = null;
1481
+ tables.forEach((t) => {
1482
+ if (!target && r && t.compareDocumentPosition(r.startContainer) & 4)
1483
+ target = t;
1484
+ });
1485
+ const placed = (target || tables[tables.length - 1]);
1486
+ const first = placed?.querySelector('td, th');
1487
+ if (first)
1488
+ caretIn(first);
1489
+ });
1490
+ }
1491
+ /** Table menu actions. */
1492
+ tableAction(action) {
1493
+ const pick = this.cellPick;
1494
+ const cell = pick?.from || this.currentCell();
1495
+ const fromBar = this.panel === 'tableBar';
1496
+ this.closePanel(false);
1497
+ if (!cell)
1498
+ return;
1499
+ this.exec(() => {
1500
+ const table = cell.closest('table');
1501
+ let caret = cell;
1502
+ this.clearCellPick();
1503
+ switch (action) {
1504
+ case 'mergeCells':
1505
+ if (pick && pick.table === table)
1506
+ caret = mergeRect(table, cellRect(table, pick.from, pick.to)) || cell;
1507
+ else
1508
+ mergeCells(cell, 'right');
1509
+ break;
1510
+ case 'rowAbove':
1511
+ insertRow(cell, false);
1512
+ break;
1513
+ case 'rowBelow':
1514
+ caret = insertRow(cell, true);
1515
+ break;
1516
+ case 'colLeft':
1517
+ insertColumn(cell, false);
1518
+ break;
1519
+ case 'colRight':
1520
+ insertColumn(cell, true);
1521
+ break;
1522
+ case 'deleteRow':
1523
+ caret = deleteRow(cell);
1524
+ break;
1525
+ case 'deleteCol':
1526
+ caret = deleteColumn(cell);
1527
+ break;
1528
+ case 'deleteTable': {
1529
+ const after = table.nextElementSibling;
1530
+ table.remove();
1531
+ caret = after || null;
1532
+ break;
1533
+ }
1534
+ case 'headerRow':
1535
+ toggleHeaderRow(table);
1536
+ break;
1537
+ case 'mergeRight':
1538
+ mergeCells(cell, 'right');
1539
+ break;
1540
+ case 'mergeDown':
1541
+ mergeCells(cell, 'down');
1542
+ break;
1543
+ case 'splitCell':
1544
+ splitCell(cell);
1545
+ break;
1546
+ }
1547
+ if (caret && caret.isConnected)
1548
+ caretIn(caret);
1549
+ else if (!this.area.firstChild)
1550
+ this.area.innerHTML = '<p><br></p>';
1551
+ }, true);
1552
+ // The table's own toolbar stays while the table does.
1553
+ const still = (cell.isConnected ? cell : this.currentCell())?.closest('table');
1554
+ if (fromBar && still && this.area.contains(still))
1555
+ setTimeout(() => this.openPanel('tableBar', still));
1556
+ }
1557
+ /** Two or more cells picked (merge them), else the cell can join its right neighbour. */
1558
+ get canMergePicked() {
1559
+ if (this.cellPick)
1560
+ return cellsInRect(this.cellPick.table, cellRect(this.cellPick.table, this.cellPick.from, this.cellPick.to)).length > 1;
1561
+ return this.canMerge('right');
1562
+ }
1563
+ /** Over a column's right edge the pointer becomes a resize arrow. */
1564
+ tablePointerMove(event) {
1565
+ if (this.locked || event.buttons)
1566
+ return;
1567
+ const hit = this.columnEdgeAt(event);
1568
+ if (!!hit !== !!this.resizeHover || hit?.col !== this.resizeHover?.col)
1569
+ this.area.classList.toggle('wu-editor-col-resize', !!hit);
1570
+ this.resizeHover = hit;
1571
+ }
1572
+ tablePointerDown(event) {
1573
+ if (this.locked || event.button !== 0)
1574
+ return;
1575
+ const hit = this.columnEdgeAt(event);
1576
+ if (hit) {
1577
+ event.preventDefault();
1578
+ this.zone.run(() => this.startColumnResize(hit.table, hit.col, event));
1579
+ return;
1580
+ }
1581
+ const cell = event.target.closest?.('td, th');
1582
+ if (!cell || !this.area.contains(cell)) {
1583
+ if (this.cellPick)
1584
+ this.zone.run(() => this.clearCellPick());
1585
+ return;
1586
+ }
1587
+ const table = cell.closest('table');
1588
+ // Shift + click: from the cell with the caret to this one.
1589
+ const caretCell = this.currentCell();
1590
+ if (event.shiftKey && caretCell && caretCell !== cell && caretCell.closest('table') === table) {
1591
+ event.preventDefault();
1592
+ this.zone.run(() => this.pickCells(table, this.cellPick?.from || caretCell, cell));
1593
+ return;
1594
+ }
1595
+ if (this.cellPick)
1596
+ this.zone.run(() => this.clearCellPick());
1597
+ const doc = this.doc;
1598
+ const move = (e) => {
1599
+ const over = doc.elementFromPoint(e.clientX, e.clientY)?.closest?.('td, th');
1600
+ if (!over || over.closest('table') !== table)
1601
+ return;
1602
+ if (over === cell && !this.cellPick)
1603
+ return;
1604
+ this.zone.run(() => this.pickCells(table, cell, over));
1605
+ };
1606
+ const up = () => {
1607
+ doc.removeEventListener('pointermove', move);
1608
+ doc.removeEventListener('pointerup', up);
1609
+ if (this.cellPick) {
1610
+ // The caret goes back to the first cell; the picked cells stay marked.
1611
+ caretIn(this.cellPick.from);
1612
+ this.area.classList.remove('wu-editor-picking');
1613
+ }
1614
+ };
1615
+ doc.addEventListener('pointermove', move);
1616
+ doc.addEventListener('pointerup', up);
1617
+ }
1618
+ pickCells(table, from, to) {
1619
+ this.cellPick = { table, from, to };
1620
+ const picked = new Set(cellsInRect(table, cellRect(table, from, to)));
1621
+ table.querySelectorAll('td, th').forEach((c) => c.classList.toggle('wu-editor-cell-picked', picked.has(c)));
1622
+ this.area.classList.add('wu-editor-picking');
1623
+ if (this.panel !== 'tableBar' || this.panelAnchor !== table)
1624
+ this.openPanel('tableBar', table);
1625
+ this.cdr.markForCheck();
1626
+ }
1627
+ clearCellPick() {
1628
+ if (!this.cellPick)
1629
+ return;
1630
+ this.cellPick.table.querySelectorAll('.wu-editor-cell-picked').forEach((c) => c.classList.remove('wu-editor-cell-picked'));
1631
+ this.area.classList.remove('wu-editor-picking');
1632
+ this.cellPick = null;
1633
+ this.cdr.markForCheck();
1634
+ }
1635
+ /** The column whose right edge is under the pointer (within 4px), or null. */
1636
+ columnEdgeAt(event) {
1637
+ const cell = event.target.closest?.('td, th');
1638
+ if (!cell || !this.area.contains(cell))
1639
+ return null;
1640
+ const r = cell.getBoundingClientRect();
1641
+ const rtl = this.doc.defaultView?.getComputedStyle(cell).direction === 'rtl';
1642
+ const edge = rtl ? r.left : r.right;
1643
+ if (Math.abs(event.clientX - edge) > 4)
1644
+ return null;
1645
+ const table = cell.closest('table');
1646
+ const g = tableGrid(table);
1647
+ let col = -1;
1648
+ for (const row of g.grid) {
1649
+ const i = row.lastIndexOf(cell);
1650
+ if (i >= 0) {
1651
+ col = i;
1652
+ break;
1653
+ }
1654
+ }
1655
+ return col >= 0 ? { table, col } : null;
1656
+ }
1657
+ /** Drags a column's edge: the column and its right neighbour share the width; the last edge resizes the table. */
1658
+ startColumnResize(table, col, event) {
1659
+ const cols = ensureTableCols(table);
1660
+ const tableWidth = table.getBoundingClientRect().width || 1;
1661
+ const host = Math.max(1, table.parentElement?.clientWidth || tableWidth);
1662
+ const start = event.clientX;
1663
+ const startW = cols.map((c) => ((parseFloat(c.style.width) || 100 / cols.length) / 100) * tableWidth);
1664
+ const startTable = tableWidth;
1665
+ const min = 24;
1666
+ const last = col >= cols.length - 1;
1667
+ const doc = this.doc;
1668
+ this.area.classList.add('wu-editor-resizing');
1669
+ const move = (e) => {
1670
+ const dx = e.clientX - start;
1671
+ if (last) {
1672
+ // The table itself: as wide as the text at most.
1673
+ const w = Math.min(host, Math.max(min * cols.length, startTable + dx));
1674
+ table.style.width = percent((w / host) * 100);
1675
+ const total = startW.reduce((a, b) => a + b, 0) - startW[col] + Math.max(min, startW[col] + (w - startTable));
1676
+ cols.forEach((c, i) => (c.style.width = percent(((i === col ? Math.max(min, startW[col] + (w - startTable)) : startW[i]) / total) * 100)));
1677
+ return;
1678
+ }
1679
+ const pair = startW[col] + startW[col + 1];
1680
+ const a = Math.min(pair - min, Math.max(min, startW[col] + dx));
1681
+ const widths = startW.slice();
1682
+ widths[col] = a;
1683
+ widths[col + 1] = pair - a;
1684
+ const sum = widths.reduce((x, y) => x + y, 0) || 1;
1685
+ cols.forEach((c, i) => (c.style.width = percent((widths[i] / sum) * 100)));
1686
+ };
1687
+ const up = () => {
1688
+ doc.removeEventListener('pointermove', move);
1689
+ doc.removeEventListener('pointerup', up);
1690
+ this.area.classList.remove('wu-editor-resizing');
1691
+ this.zone.run(() => this.afterTableResize());
1692
+ };
1693
+ doc.addEventListener('pointermove', move);
1694
+ doc.addEventListener('pointerup', up);
1695
+ }
1696
+ afterTableResize() {
1697
+ this.pushHistory(false);
1698
+ this.emit('user');
1699
+ }
1700
+ canMerge(direction) {
1701
+ const cell = this.currentCell();
1702
+ if (!cell)
1703
+ return false;
1704
+ const clone = cell.closest('table').cloneNode(true);
1705
+ const path = [];
1706
+ // Try the merge on a copy so the menu can say whether it would work.
1707
+ const rows = Array.from(cell.closest('table').rows);
1708
+ const r = rows.indexOf(cell.parentElement);
1709
+ const c = Array.from(cell.parentElement.cells).indexOf(cell);
1710
+ path.push(r, c);
1711
+ const copy = clone.rows[r]?.cells[c];
1712
+ return !!copy && mergeCells(copy, direction);
1713
+ }
1714
+ canSplit() {
1715
+ const cell = this.currentCell();
1716
+ return !!cell && ((cell.rowSpan || 1) > 1 || (cell.colSpan || 1) > 1);
1717
+ }
1718
+ get inHeaderRow() {
1719
+ const cell = this.currentCell();
1720
+ return !!cell?.closest('thead');
1721
+ }
1722
+ // ---------- links ----------
1723
+ applyLink() {
1724
+ const url = this.linkForm.url.trim();
1725
+ if (!url)
1726
+ return this.unlink();
1727
+ const href = /^[a-z][a-z0-9+.-]*:|^[/#?.]/i.test(url) ? url : `https://${url}`;
1728
+ if (!safeEditorUrl(href, this.opts.link.protocols)) {
1729
+ this.linkForm.error = this.m.invalidUrl;
1730
+ this.cdr.markForCheck();
1731
+ return;
1732
+ }
1733
+ const newTab = this.linkForm.newTab;
1734
+ const text = this.linkForm.text.trim();
1735
+ this.closePanel(false);
1736
+ this.exec(() => {
1737
+ const r = rangeIn(this.area);
1738
+ const existing = r ? closestIn(r.startContainer, this.area, 'a') : null;
1739
+ if (existing && (!r || r.collapsed)) {
1740
+ existing.setAttribute('href', href);
1741
+ if (text && text !== existing.textContent)
1742
+ existing.textContent = text;
1743
+ this.setLinkTarget(existing, newTab);
1744
+ return;
1745
+ }
1746
+ if (!r || r.collapsed) {
1747
+ const a = this.doc.createElement('a');
1748
+ a.setAttribute('href', href);
1749
+ a.textContent = text || url;
1750
+ this.setLinkTarget(a, newTab);
1751
+ this.doc.execCommand('insertHTML', false, a.outerHTML + '&nbsp;');
1752
+ return;
1753
+ }
1754
+ this.doc.execCommand('createLink', false, href);
1755
+ const sel = rangeIn(this.area);
1756
+ const anchors = new Set();
1757
+ this.area.querySelectorAll('a').forEach((a) => {
1758
+ if (a.getAttribute('href') === href && sel && sel.intersectsNode(a))
1759
+ anchors.add(a);
1760
+ });
1761
+ anchors.forEach((a) => this.setLinkTarget(a, newTab));
1762
+ });
1763
+ }
1764
+ unlink() {
1765
+ this.closePanel(false);
1766
+ this.exec(() => {
1767
+ const r = rangeIn(this.area);
1768
+ const a = r ? closestIn(r.startContainer, this.area, 'a') : null;
1769
+ if (a && r?.collapsed) {
1770
+ a.replaceWith(...Array.from(a.childNodes));
1771
+ return;
1772
+ }
1773
+ this.doc.execCommand('unlink', false);
1774
+ });
1775
+ }
1776
+ currentLinkHref() {
1777
+ const r = this.savedRange;
1778
+ const a = r ? closestIn(r.startContainer, this.area, 'a') : null;
1779
+ return a?.getAttribute('href') || '';
1780
+ }
1781
+ // ---------- images ----------
1782
+ chooseImage() {
1783
+ this.imageInputRef?.nativeElement.click();
1784
+ }
1785
+ imageFilesChosen(event) {
1786
+ const input = event.target;
1787
+ const files = Array.from(input.files || []);
1788
+ input.value = '';
1789
+ this.closePanel(false);
1790
+ this.restore();
1791
+ void this.insertImageFiles(files);
1792
+ }
1793
+ insertImageUrl() {
1794
+ const url = this.imageForm.url.trim();
1795
+ if (!url || !safeEditorImage(url)) {
1796
+ this.imageForm.error = this.m.invalidUrl;
1797
+ this.cdr.markForCheck();
1798
+ return;
1799
+ }
1800
+ const alt = this.imageForm.alt.trim();
1801
+ this.closePanel(false);
1802
+ this.exec(() => {
1803
+ const img = this.doc.createElement('img');
1804
+ img.setAttribute('src', url);
1805
+ img.setAttribute('alt', alt);
1806
+ this.doc.execCommand('insertHTML', false, img.outerHTML);
1807
+ });
1808
+ }
1809
+ imagePanelDrop(event) {
1810
+ event.preventDefault();
1811
+ const files = Array.from(event.dataTransfer?.files || []);
1812
+ this.closePanel(false);
1813
+ this.restore();
1814
+ void this.insertImageFiles(files);
1815
+ }
1816
+ /** Picture menu: alignment, width, alternative text, remove. */
1817
+ setImageAlign(a) {
1818
+ const img = this.selectedImage;
1819
+ if (!img)
1820
+ return;
1821
+ setPrefixedClass(img, 'wu-image-', a === 'inline' ? null : a);
1822
+ this.afterDomChange();
1823
+ this.placeFrame();
1824
+ }
1825
+ setImageWidth(percent) {
1826
+ const img = this.selectedImage;
1827
+ if (!img)
1828
+ return;
1829
+ if (percent === null)
1830
+ img.removeAttribute('width');
1831
+ else {
1832
+ const box = this.area.clientWidth - 32;
1833
+ img.setAttribute('width', String(Math.round((box * percent) / 100)));
1834
+ }
1835
+ img.removeAttribute('height');
1836
+ this.afterDomChange();
1837
+ this.placeFrame();
1838
+ }
1839
+ setImageAlt(event) {
1840
+ const img = this.selectedImage;
1841
+ if (!img)
1842
+ return;
1843
+ img.setAttribute('alt', event.target.value);
1844
+ this.afterDomChange();
1845
+ }
1846
+ removeImage() {
1847
+ const img = this.selectedImage;
1848
+ if (!img)
1849
+ return;
1850
+ this.closePanel(false);
1851
+ this.selectImage(null);
1852
+ img.remove();
1853
+ this.afterDomChange();
1854
+ this.area.focus();
1855
+ }
1856
+ /** Drag on the frame's corner handle resizes the picture, keeping its proportions. */
1857
+ resizeStart(event) {
1858
+ const img = this.selectedImage;
1859
+ if (!img || this.locked)
1860
+ return;
1861
+ event.preventDefault();
1862
+ const handle = event.currentTarget;
1863
+ handle.setPointerCapture?.(event.pointerId);
1864
+ const startX = event.clientX;
1865
+ const startW = img.getBoundingClientRect().width;
1866
+ const max = this.area.clientWidth - 16;
1867
+ const move = (e) => {
1868
+ const w = Math.max(24, Math.min(max, Math.round(startW + (e.clientX - startX))));
1869
+ img.setAttribute('width', String(w));
1870
+ img.removeAttribute('height');
1871
+ this.placeFrame();
1872
+ };
1873
+ const up = () => {
1874
+ handle.removeEventListener('pointermove', move);
1875
+ handle.removeEventListener('pointerup', up);
1876
+ handle.removeEventListener('pointercancel', up);
1877
+ this.zone.run(() => this.afterDomChange());
1878
+ };
1879
+ this.zone.runOutsideAngular(() => {
1880
+ handle.addEventListener('pointermove', move);
1881
+ handle.addEventListener('pointerup', up);
1882
+ handle.addEventListener('pointercancel', up);
1883
+ });
1884
+ }
1885
+ /** Uploads or embeds pictures and puts them at the caret. */
1886
+ async insertImageFiles(files) {
1887
+ const cfg = this.uploadConfig;
1888
+ for (const file of files) {
1889
+ if (!acceptsFile(file, cfg.accept || ACCEPT_IMAGES)) {
1890
+ this.fail(file, 'type', this.m.imageWrongType.replace('{0}', file.name));
1891
+ continue;
1892
+ }
1893
+ if (cfg.maxSize && file.size > cfg.maxSize) {
1894
+ this.fail(file, 'size', this.m.imageTooLarge.replace('{0}', file.name).replace('{1}', formatFileSize(cfg.maxSize, this.t.fileSizeTypes)));
1895
+ continue;
1896
+ }
1897
+ if (this.uploadMode === 'base64') {
1898
+ const data = await this.readAsDataUrl(file);
1899
+ this.exec(() => this.doc.execCommand('insertHTML', false, `<img src="${data}" alt="">`));
1900
+ continue;
1901
+ }
1902
+ // Show the picture at once, from memory, while it uploads.
1903
+ const win = this.doc.defaultView;
1904
+ const temp = win?.URL?.createObjectURL ? win.URL.createObjectURL(file) : await this.readAsDataUrl(file);
1905
+ const marker = `wu-up-${Math.random().toString(36).slice(2)}`;
1906
+ this.exec(() => this.doc.execCommand('insertHTML', false, `<img src="${temp}" alt="" class="wu-image-uploading" data-wu-upload="${marker}">`));
1907
+ try {
1908
+ const url = await this.upload(file);
1909
+ const img = this.area.querySelector(`img[data-wu-upload="${marker}"]`);
1910
+ if (img) {
1911
+ img.setAttribute('src', url);
1912
+ img.classList.remove('wu-image-uploading');
1913
+ if (!img.classList.length)
1914
+ img.removeAttribute('class');
1915
+ img.removeAttribute('data-wu-upload');
1916
+ }
1917
+ this.onImageUpload.emit({ file, url });
1918
+ this.afterDomChange();
1919
+ }
1920
+ catch (error) {
1921
+ this.area.querySelector(`img[data-wu-upload="${marker}"]`)?.remove();
1922
+ this.fail(file, 'upload', this.m.uploadFailed, error);
1923
+ this.afterDomChange();
1924
+ }
1925
+ finally {
1926
+ if (temp.startsWith('blob:'))
1927
+ win?.URL?.revokeObjectURL?.(temp);
1928
+ }
1929
+ }
1930
+ }
1931
+ /** Puts the keyboard in the content, where the caret last was. */
1932
+ focus() {
1933
+ if (this.sourceMode)
1934
+ return;
1935
+ this.restore();
1936
+ }
1937
+ // ---------- content events ----------
1938
+ areaInput() {
1939
+ this.normalizeEmpty();
1940
+ this.pushHistory(true);
1941
+ this.emit('user');
1942
+ }
1943
+ areaFocus(event) {
1944
+ this.focused = true;
1945
+ this.onFocus.emit(event);
1946
+ this.cdr.markForCheck();
1947
+ }
1948
+ areaBlur(event) {
1949
+ this.focused = false;
1950
+ this.onTouched();
1951
+ this.onBlur.emit(event);
1952
+ this.cdr.markForCheck();
1953
+ }
1954
+ areaKeydown(event) {
1955
+ if (this.locked)
1956
+ return;
1957
+ if (this.cellPick && !['Shift', 'Control', 'Meta', 'Alt'].includes(event.key)) {
1958
+ const pick = this.cellPick;
1959
+ if (event.key === 'Delete' || event.key === 'Backspace') {
1960
+ event.preventDefault();
1961
+ this.exec(() => {
1962
+ for (const c of cellsInRect(pick.table, cellRect(pick.table, pick.from, pick.to)))
1963
+ c.innerHTML = '<br>';
1964
+ caretIn(pick.from);
1965
+ });
1966
+ }
1967
+ this.clearCellPick();
1968
+ if (event.defaultPrevented)
1969
+ return;
1970
+ }
1971
+ const mod = event.ctrlKey || event.metaKey;
1972
+ const key = event.key.toLowerCase();
1973
+ if (mod && !event.altKey) {
1974
+ if (key === 'z') {
1975
+ event.preventDefault();
1976
+ return event.shiftKey ? this.redo() : this.undo();
1977
+ }
1978
+ if (key === 'y') {
1979
+ event.preventDefault();
1980
+ return this.redo();
1981
+ }
1982
+ if (key === 'k') {
1983
+ event.preventDefault();
1984
+ return this.openPanel('link', this.toolbarButton('link') || this.area);
1985
+ }
1986
+ if (key === 'b' || key === 'i' || key === 'u') {
1987
+ event.preventDefault();
1988
+ return this.runTool(key === 'b' ? 'bold' : key === 'i' ? 'italic' : 'underline', event);
1989
+ }
1990
+ }
1991
+ if (event.key === 'Tab' && !mod && !event.altKey) {
1992
+ const cell = this.currentCell();
1993
+ if (cell) {
1994
+ event.preventDefault();
1995
+ const next = adjacentCell(cell, event.shiftKey);
1996
+ if (next)
1997
+ caretIn(next, true);
1998
+ else if (!event.shiftKey)
1999
+ this.exec(() => {
2000
+ const added = insertRow(cell, true);
2001
+ if (added)
2002
+ caretIn(added);
2003
+ }, true);
2004
+ return;
2005
+ }
2006
+ if (this.state.bulletList || this.state.orderedList) {
2007
+ event.preventDefault();
2008
+ return this.exec(() => this.doc.execCommand(event.shiftKey ? 'outdent' : 'indent', false));
2009
+ }
2010
+ }
2011
+ if ((event.key === 'Delete' || event.key === 'Backspace') && this.selectedImage) {
2012
+ event.preventDefault();
2013
+ return this.removeImage();
2014
+ }
2015
+ if (event.key === 'Escape' && this.fullscreen) {
2016
+ event.preventDefault();
2017
+ this.toggleFullscreen();
2018
+ }
2019
+ }
2020
+ areaClick(event) {
2021
+ const t = event.target;
2022
+ if (t.tagName === 'IMG' && this.area.contains(t)) {
2023
+ this.selectImage(t);
2024
+ if (!this.locked)
2025
+ this.openPanel('imageMenu', t);
2026
+ return;
2027
+ }
2028
+ this.selectImage(null);
2029
+ const table = t.closest('table');
2030
+ if (table && this.area.contains(table) && !this.locked && !t.closest('a')) {
2031
+ if (this.panel !== 'tableBar' || this.panelAnchor !== table)
2032
+ this.openPanel('tableBar', table);
2033
+ return;
2034
+ }
2035
+ const a = t.closest('a');
2036
+ if (a && this.area.contains(a) && !this.locked) {
2037
+ // Ctrl / ⌘ + click opens the link, as in other editors.
2038
+ if (event.ctrlKey || event.metaKey) {
2039
+ const href = a.getAttribute('href');
2040
+ if (href)
2041
+ this.doc.defaultView?.open(href, '_blank', 'noopener');
2042
+ return;
2043
+ }
2044
+ this.saveRange();
2045
+ this.openPanel('linkMenu', a);
2046
+ }
2047
+ }
2048
+ areaPaste(event) {
2049
+ if (this.locked)
2050
+ return;
2051
+ const dt = event.clipboardData;
2052
+ if (!dt)
2053
+ return;
2054
+ const files = Array.from(dt.files || []).filter((f) => /^image\//.test(f.type));
2055
+ const html = dt.getData('text/html');
2056
+ if (files.length && !html) {
2057
+ event.preventDefault();
2058
+ void this.insertImageFiles(files);
2059
+ return;
2060
+ }
2061
+ event.preventDefault();
2062
+ if (html) {
2063
+ this.insertHtml(cleanEditorHtml(html.replace(/<!--StartFragment-->|<!--EndFragment-->/g, ''), this.doc, this.cleanOpts));
2064
+ return;
2065
+ }
2066
+ const text = dt.getData('text/plain');
2067
+ if (!text)
2068
+ return;
2069
+ if (this.state.codeBlock || !/\r?\n/.test(text)) {
2070
+ this.exec(() => this.doc.execCommand('insertText', false, text));
2071
+ return;
2072
+ }
2073
+ const esc = (s) => s.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
2074
+ const paragraphs = text.replace(/\r\n/g, '\n').split(/\n/).map((line) => `<p>${line ? esc(line) : '<br>'}</p>`);
2075
+ this.insertHtml(paragraphs.join(''));
2076
+ }
2077
+ areaDragOver(event) {
2078
+ if (!this.locked && Array.from(event.dataTransfer?.types || []).includes('Files'))
2079
+ event.preventDefault();
2080
+ }
2081
+ areaDrop(event) {
2082
+ const files = Array.from(event.dataTransfer?.files || []).filter((f) => /^image\//.test(f.type));
2083
+ if (!files.length || this.locked)
2084
+ return;
2085
+ event.preventDefault();
2086
+ const d = this.doc;
2087
+ let r = null;
2088
+ if (d.caretRangeFromPoint)
2089
+ r = d.caretRangeFromPoint(event.clientX, event.clientY);
2090
+ else if (d.caretPositionFromPoint) {
2091
+ const p = d.caretPositionFromPoint(event.clientX, event.clientY);
2092
+ if (p) {
2093
+ r = this.doc.createRange();
2094
+ r.setStart(p.offsetNode, p.offset);
2095
+ }
2096
+ }
2097
+ this.area.focus();
2098
+ if (r && this.area.contains(r.startContainer))
2099
+ selectRange(r);
2100
+ void this.insertImageFiles(files);
2101
+ }
2102
+ sourceInput(event) {
2103
+ this.sourceText = event.target.value;
2104
+ }
2105
+ dismissNotice(i) {
2106
+ this.notices = this.notices.filter((_, k) => k !== i);
2107
+ this.cdr.markForCheck();
2108
+ }
2109
+ // ---------- panels ----------
2110
+ openPanel(kind, anchor) {
2111
+ if (this.panel === kind && this.panelAnchor === anchor)
2112
+ return this.closePanel(true);
2113
+ this.closePanel(false);
2114
+ if (!['imageMenu', 'linkMenu', 'tableBar'].includes(kind))
2115
+ this.saveRange();
2116
+ this.panel = kind;
2117
+ this.panelAnchor = anchor || this.area;
2118
+ if (kind === 'link') {
2119
+ const r = this.savedRange;
2120
+ const a = r ? closestIn(r.startContainer, this.area, 'a') : null;
2121
+ this.linkForm = {
2122
+ url: a?.getAttribute('href') || '',
2123
+ text: a ? a.textContent || '' : '',
2124
+ newTab: a ? a.getAttribute('target') === '_blank' : this.opts.link.newTab,
2125
+ showText: !!a || !r || r.collapsed,
2126
+ error: '',
2127
+ };
2128
+ }
2129
+ else if (kind === 'image') {
2130
+ this.imageForm = { tab: 'upload', url: '', alt: '', error: '' };
2131
+ }
2132
+ else if (kind === 'table') {
2133
+ this.gridHover = { rows: 0, cols: 0 };
2134
+ }
2135
+ this.cdr.detectChanges();
2136
+ const panel = this.panelRef?.nativeElement;
2137
+ if (!panel)
2138
+ return;
2139
+ this.popup = new ɵWuPopup(this.panelAnchor, panel, {
2140
+ onOutside: () => this.zone.run(() => this.closePanel(false)),
2141
+ onEscape: (e) => this.zone.run(() => {
2142
+ e.preventDefault();
2143
+ this.closePanel(true);
2144
+ }),
2145
+ sheetClass: 'wu-editor-panel-sheet',
2146
+ modalClass: 'wu-editor-panel-modal',
2147
+ sheet: false,
2148
+ gap: 6,
2149
+ });
2150
+ this.popup.open();
2151
+ // Menus get the keyboard; balloons over the content leave it in the text.
2152
+ if (kind !== 'linkMenu' && kind !== 'tableBar') {
2153
+ const first = panel.querySelector('input:not([type="checkbox"]):not([type="color"]):not([type="file"]), [role="menuitemradio"][aria-checked="true"], [role="menuitem"], [role="menuitemradio"], button, [tabindex="0"]');
2154
+ first?.focus();
2155
+ }
2156
+ }
2157
+ closePanel(returnFocus) {
2158
+ if (!this.panel)
2159
+ return;
2160
+ const was = this.panel;
2161
+ const anchor = this.panelAnchor;
2162
+ this.popup?.close();
2163
+ this.popup = null;
2164
+ this.panel = null;
2165
+ this.panelAnchor = null;
2166
+ this.cdr.markForCheck();
2167
+ if (returnFocus) {
2168
+ if (was === 'imageMenu' || was === 'linkMenu' || was === 'tableBar' || !anchor || anchor === this.area || !this.host.contains(anchor))
2169
+ this.restore();
2170
+ else
2171
+ anchor.focus();
2172
+ }
2173
+ }
2174
+ /** ↑ / ↓ inside a menu panel. */
2175
+ panelKeydown(event) {
2176
+ if (!['ArrowDown', 'ArrowUp', 'Home', 'End'].includes(event.key))
2177
+ return;
2178
+ const panel = this.panelRef?.nativeElement;
2179
+ if (!panel)
2180
+ return;
2181
+ const items = Array.from(panel.querySelectorAll('[role="menuitem"], [role="menuitemradio"]')).filter((el) => !el.disabled);
2182
+ if (!items.length)
2183
+ return;
2184
+ const at = items.indexOf(this.doc.activeElement);
2185
+ event.preventDefault();
2186
+ const next = event.key === 'Home' ? 0 : event.key === 'End' ? items.length - 1 : (at + (event.key === 'ArrowDown' ? 1 : -1) + items.length) % items.length;
2187
+ items[next].focus();
2188
+ }
2189
+ // ---------- internals: commands ----------
2190
+ /** Runs a change on the content with the selection back in place, then records and reports it. */
2191
+ exec(change, structural = false) {
2192
+ if (this.locked || this.sourceMode)
2193
+ return;
2194
+ this.restore();
2195
+ change();
2196
+ if (structural)
2197
+ this.normalizeEmpty();
2198
+ this.afterDomChange();
2199
+ }
2200
+ afterDomChange() {
2201
+ this.normalizeMarkup();
2202
+ this.normalizeEmpty();
2203
+ this.pushHistory(false);
2204
+ this.emit('user');
2205
+ this.updateState();
2206
+ }
2207
+ undo() {
2208
+ const s = this.history.undo();
2209
+ if (s)
2210
+ this.applySnapshot(s.html, s.selection);
2211
+ }
2212
+ redo() {
2213
+ const s = this.history.redo();
2214
+ if (s)
2215
+ this.applySnapshot(s.html, s.selection);
2216
+ }
2217
+ applySnapshot(html, selection) {
2218
+ this.selectImage(null);
2219
+ this.area.innerHTML = html;
2220
+ this.area.focus();
2221
+ if (!restoreSelection(this.area, selection))
2222
+ caretIn(this.area, true);
2223
+ this.canUndo = this.history.canUndo;
2224
+ this.canRedo = this.history.canRedo;
2225
+ this.emit('user');
2226
+ this.updateState();
2227
+ }
2228
+ beforeInput(event) {
2229
+ if (event.inputType === 'historyUndo' || event.inputType === 'historyRedo') {
2230
+ event.preventDefault();
2231
+ this.zone.run(() => (event.inputType === 'historyUndo' ? this.undo() : this.redo()));
2232
+ }
2233
+ }
2234
+ formatBlock(tag) {
2235
+ this.doc.execCommand('formatBlock', false, `<${tag}>`);
2236
+ }
2237
+ setAlign(a) {
2238
+ const r = rangeIn(this.area);
2239
+ if (!r)
2240
+ return;
2241
+ const blocks = blocksIn(this.area, r);
2242
+ for (const b of blocks) {
2243
+ setPrefixedClass(b, 'ql-align-', a === 'left' ? null : a);
2244
+ b.style.removeProperty('text-align');
2245
+ if (!b.getAttribute('style'))
2246
+ b.removeAttribute('style');
2247
+ }
2248
+ }
2249
+ /** Indent for paragraphs (Quill's `ql-indent-N` classes); lists nest instead. */
2250
+ indent(step) {
2251
+ if (this.state.bulletList || this.state.orderedList) {
2252
+ this.doc.execCommand(step > 0 ? 'indent' : 'outdent', false);
2253
+ return;
2254
+ }
2255
+ const r = rangeIn(this.area);
2256
+ if (!r)
2257
+ return;
2258
+ for (const b of blocksIn(this.area, r)) {
2259
+ if (b.tagName === 'TD' || b.tagName === 'TH')
2260
+ continue;
2261
+ const cur = Number(prefixedClass(b, 'ql-indent-') || 0);
2262
+ const next = Math.max(0, Math.min(MAX_INDENT, cur + step));
2263
+ setPrefixedClass(b, 'ql-indent-', next ? String(next) : null);
2264
+ }
2265
+ }
2266
+ toggleInlineCode() {
2267
+ const r = rangeIn(this.area);
2268
+ if (!r)
2269
+ return;
2270
+ const code = closestIn(r.startContainer, this.area, 'code');
2271
+ if (code && !closestIn(code, this.area, 'pre')) {
2272
+ code.replaceWith(...Array.from(code.childNodes));
2273
+ return;
2274
+ }
2275
+ if (r.collapsed)
2276
+ return;
2277
+ const el = this.doc.createElement('code');
2278
+ el.appendChild(r.extractContents());
2279
+ el.querySelectorAll('code').forEach((c) => c.replaceWith(...Array.from(c.childNodes)));
2280
+ r.insertNode(el);
2281
+ const after = this.doc.createRange();
2282
+ after.selectNodeContents(el);
2283
+ selectRange(after);
2284
+ }
2285
+ /** Font size / family: Quill's classes for its own sizes and fonts, an inline style for anything else. */
2286
+ applyInlineStyle(kind, value) {
2287
+ const r = rangeIn(this.area);
2288
+ if (!r || r.collapsed)
2289
+ return;
2290
+ // The browser wraps the selection in <font>; each one becomes a span with our class or style.
2291
+ this.doc.execCommand('styleWithCSS', false, 'false');
2292
+ this.doc.execCommand(kind === 'fontSize' ? 'fontSize' : 'fontName', false, kind === 'fontSize' ? '7' : 'wu-marker');
2293
+ const fonts = Array.from(this.area.querySelectorAll(kind === 'fontSize' ? 'font[size="7"]' : 'font[face="wu-marker"]'));
2294
+ for (const f of fonts) {
2295
+ // Inner spans carrying the same property give way to the new value.
2296
+ f.querySelectorAll('span').forEach((s) => {
2297
+ if (kind === 'fontSize') {
2298
+ setPrefixedClass(s, 'ql-size-', null);
2299
+ s.style.removeProperty('font-size');
2300
+ }
2301
+ else {
2302
+ setPrefixedClass(s, 'ql-font-', null);
2303
+ s.style.removeProperty('font-family');
2304
+ }
2305
+ if (!s.attributes.length)
2306
+ s.replaceWith(...Array.from(s.childNodes));
2307
+ });
2308
+ if (!value) {
2309
+ f.replaceWith(...Array.from(f.childNodes));
2310
+ continue;
2311
+ }
2312
+ const span = this.doc.createElement('span');
2313
+ if (kind === 'fontSize') {
2314
+ if (QUILL_SIZES[value])
2315
+ span.className = `ql-size-${QUILL_SIZES[value]}`;
2316
+ else
2317
+ span.style.fontSize = value;
2318
+ }
2319
+ else if (value === 'serif' || value === 'monospace')
2320
+ span.className = `ql-font-${value}`;
2321
+ else
2322
+ span.style.fontFamily = value;
2323
+ while (f.firstChild)
2324
+ span.appendChild(f.firstChild);
2325
+ f.replaceWith(span);
2326
+ }
2327
+ }
2328
+ removeInlineStyle(prop) {
2329
+ const r = rangeIn(this.area);
2330
+ if (!r)
2331
+ return;
2332
+ const spans = new Set();
2333
+ const start = closestIn(r.startContainer, this.area, 'span');
2334
+ if (start)
2335
+ spans.add(start);
2336
+ this.area.querySelectorAll('span[style], font').forEach((s) => {
2337
+ if (r.intersectsNode(s))
2338
+ spans.add(s);
2339
+ });
2340
+ for (const s of spans) {
2341
+ if (s.tagName === 'FONT') {
2342
+ s.removeAttribute('color');
2343
+ continue;
2344
+ }
2345
+ s.style.removeProperty(prop);
2346
+ if (!s.getAttribute('style'))
2347
+ s.removeAttribute('style');
2348
+ if (!s.attributes.length)
2349
+ s.replaceWith(...Array.from(s.childNodes));
2350
+ }
2351
+ }
2352
+ clearFormatting() {
2353
+ const r = rangeIn(this.area);
2354
+ if (!r)
2355
+ return;
2356
+ this.doc.execCommand('removeFormat', false);
2357
+ this.doc.execCommand('unlink', false);
2358
+ const r2 = rangeIn(this.area) || r;
2359
+ this.area.querySelectorAll('code, span').forEach((el) => {
2360
+ if (r2.intersectsNode(el) && !closestIn(el, this.area, 'pre'))
2361
+ el.replaceWith(...Array.from(el.childNodes));
2362
+ });
2363
+ for (const b of blocksIn(this.area, r2)) {
2364
+ setPrefixedClass(b, 'ql-align-', null);
2365
+ setPrefixedClass(b, 'ql-indent-', null);
2366
+ b.removeAttribute('style');
2367
+ }
2368
+ }
2369
+ setLinkTarget(a, newTab) {
2370
+ if (newTab) {
2371
+ a.setAttribute('target', '_blank');
2372
+ a.setAttribute('rel', 'noopener noreferrer');
2373
+ }
2374
+ else {
2375
+ a.removeAttribute('target');
2376
+ a.removeAttribute('rel');
2377
+ }
2378
+ }
2379
+ insertHtml(html) {
2380
+ this.exec(() => this.doc.execCommand('insertHTML', false, html), true);
2381
+ }
2382
+ toggleSource() {
2383
+ if (!this.sourceMode) {
2384
+ this.closePanel(false);
2385
+ this.selectImage(null);
2386
+ this.sourceText = this.prettyHtml(this.html());
2387
+ this.sourceMode = true;
2388
+ }
2389
+ else {
2390
+ this.sourceMode = false;
2391
+ this.cdr.detectChanges();
2392
+ this.area.innerHTML = this.toEditable(cleanEditorHtml(this.sourceText, this.doc, this.cleanOpts));
2393
+ this.pushHistory(false);
2394
+ this.emit('user');
2395
+ }
2396
+ this.cdr.markForCheck();
2397
+ }
2398
+ /**
2399
+ * Full screen in the top layer, so no parent with a transform, filter or container query can trap it, and it stays
2400
+ * above dialogs. Browsers without popovers get a fixed overlay.
2401
+ */
2402
+ toggleFullscreen() {
2403
+ this.fullscreen = !this.fullscreen;
2404
+ const root = this.host.querySelector('.wu-editor');
2405
+ if (this.fullscreen) {
2406
+ this.unlockScroll = ɵlockScroll(this.doc);
2407
+ if (root && typeof root.showPopover === 'function') {
2408
+ root.setAttribute('popover', 'manual');
2409
+ try {
2410
+ root.showPopover();
2411
+ }
2412
+ catch {
2413
+ root.removeAttribute('popover');
2414
+ }
2415
+ }
2416
+ }
2417
+ else {
2418
+ this.unlockScroll?.();
2419
+ this.unlockScroll = null;
2420
+ if (root?.hasAttribute('popover')) {
2421
+ try {
2422
+ root.hidePopover?.();
2423
+ }
2424
+ catch {
2425
+ /* not shown */
2426
+ }
2427
+ root.removeAttribute('popover');
2428
+ }
2429
+ }
2430
+ this.cdr.markForCheck();
2431
+ setTimeout(() => {
2432
+ this.placeFrame();
2433
+ if (this.fullscreen)
2434
+ this.restore();
2435
+ });
2436
+ }
2437
+ // ---------- internals: state ----------
2438
+ selectionChanged() {
2439
+ const r = rangeIn(this.area);
2440
+ if (r)
2441
+ this.savedRange = r.cloneRange();
2442
+ const win = this.doc.defaultView;
2443
+ if (!win || this.stateFrame)
2444
+ return;
2445
+ this.stateFrame = win.requestAnimationFrame(() => {
2446
+ this.stateFrame = 0;
2447
+ if (!rangeIn(this.area)) {
2448
+ if (this.lastSelection && this.doc.activeElement !== this.area) {
2449
+ const old = this.lastSelection;
2450
+ this.lastSelection = null;
2451
+ this.zone.run(() => this.onSelectionChange.emit({ range: null, oldRange: old, source: 'user' }));
2452
+ }
2453
+ return;
2454
+ }
2455
+ this.zone.run(() => {
2456
+ if (this.panel === 'tableBar' && this.panelAnchor) {
2457
+ const r2 = rangeIn(this.area);
2458
+ if (r2 && !this.panelAnchor.contains(r2.startContainer))
2459
+ this.closePanel(false);
2460
+ }
2461
+ this.updateState();
2462
+ this.reportSelection();
2463
+ });
2464
+ });
2465
+ }
2466
+ reportSelection() {
2467
+ if (!this.onSelectionChange.observed)
2468
+ return;
2469
+ const r = rangeIn(this.area);
2470
+ if (!r)
2471
+ return;
2472
+ const pre = this.doc.createRange();
2473
+ pre.selectNodeContents(this.area);
2474
+ pre.setEnd(r.startContainer, r.startOffset);
2475
+ const range = { index: pre.toString().length, length: r.toString().length };
2476
+ const old = this.lastSelection;
2477
+ if (old && old.index === range.index && old.length === range.length)
2478
+ return;
2479
+ this.lastSelection = range;
2480
+ this.onSelectionChange.emit({ range, oldRange: old, source: 'user' });
2481
+ }
2482
+ updateState() {
2483
+ const r = rangeIn(this.area);
2484
+ if (!r)
2485
+ return;
2486
+ const q = (cmd) => {
2487
+ try {
2488
+ return this.doc.queryCommandState(cmd);
2489
+ }
2490
+ catch {
2491
+ return false;
2492
+ }
2493
+ };
2494
+ const node = r.startContainer;
2495
+ const block = blockOf(node, this.area);
2496
+ const headingEl = closestIn(node, this.area, 'h1, h2, h3, h4, h5, h6');
2497
+ const sizeSpan = closestIn(node, this.area, '[class*="ql-size-"], span[style*="font-size"]');
2498
+ const fontSpan = closestIn(node, this.area, '[class*="ql-font-"], span[style*="font-family"]');
2499
+ const size = prefixedClass(sizeSpan, 'ql-size-');
2500
+ const font = prefixedClass(fontSpan, 'ql-font-');
2501
+ this.state = {
2502
+ bold: q('bold'),
2503
+ italic: q('italic'),
2504
+ underline: q('underline'),
2505
+ strike: q('strikeThrough'),
2506
+ subscript: q('subscript'),
2507
+ superscript: q('superscript'),
2508
+ code: !!closestIn(node, this.area, 'code') && !closestIn(node, this.area, 'pre'),
2509
+ bulletList: !!closestIn(node, this.area, 'ul'),
2510
+ orderedList: !!closestIn(node, this.area, 'ol') && !closestIn(node, this.area, 'ul'),
2511
+ blockquote: !!closestIn(node, this.area, 'blockquote'),
2512
+ codeBlock: !!closestIn(node, this.area, 'pre'),
2513
+ link: !!closestIn(node, this.area, 'a'),
2514
+ table: !!closestIn(node, this.area, 'td, th'),
2515
+ heading: headingEl ? Number(headingEl.tagName.slice(1)) : 0,
2516
+ align: ((block && (prefixedClass(block, 'ql-align-') || block.style.textAlign)) || 'left'),
2517
+ fontSize: size ? Object.keys(QUILL_SIZES).find((k) => QUILL_SIZES[k] === size) || '' : sizeSpan?.style.fontSize || '',
2518
+ fontFamily: font || fontSpan?.style.fontFamily || '',
2519
+ };
2520
+ this.syncQuillToolbar();
2521
+ this.cdr.markForCheck();
2522
+ }
2523
+ refreshMeta() {
2524
+ const html = this.area.innerHTML;
2525
+ this.empty = isEmptyEditorHtml(html);
2526
+ this.canUndo = this.history.canUndo;
2527
+ this.canRedo = this.history.canRedo;
2528
+ if (this._showCount)
2529
+ this.counts = editorCounts(editorHtmlToText(html));
2530
+ }
2531
+ pushHistory(merge) {
2532
+ this.history.push({ html: this.area.innerHTML, selection: saveSelection(this.area) }, { merge });
2533
+ this.refreshMeta();
2534
+ }
2535
+ emit(source) {
2536
+ const html = this.html();
2537
+ const value = isEmptyEditorHtml(html) ? null : html;
2538
+ this.refreshMeta();
2539
+ if (value === this.lastEmitted) {
2540
+ this.cdr.markForCheck();
2541
+ return;
2542
+ }
2543
+ this.lastEmitted = value;
2544
+ this.value = value;
2545
+ this.onChange(value);
2546
+ this.onTextChange.emit({ htmlValue: value, textValue: editorHtmlToText(value), delta: null, source });
2547
+ this.cdr.markForCheck();
2548
+ }
2549
+ /** The value: the content cleaned, without the editor's own marks (pictures still uploading are left out). */
2550
+ html() {
2551
+ if (!this.viewReady)
2552
+ return this.value || '';
2553
+ if (this.sourceMode)
2554
+ return cleanEditorHtml(this.sourceText, this.doc, this.cleanOpts);
2555
+ const copy = this.area.cloneNode(true);
2556
+ copy.querySelectorAll('img.wu-image-uploading').forEach((i) => i.remove());
2557
+ copy.querySelectorAll('.wu-image-selected').forEach((i) => i.classList.remove('wu-image-selected'));
2558
+ const html = cleanEditorHtml(copy.innerHTML, this.doc, this.cleanOpts);
2559
+ return html === '<p><br></p>' ? '' : html;
2560
+ }
2561
+ toEditable(html) {
2562
+ const clean = cleanEditorHtml(html || '', this.doc, this.cleanOpts);
2563
+ return clean.trim() ? clean : '<p><br></p>';
2564
+ }
2565
+ setContent(html, emit) {
2566
+ if (!this.viewReady) {
2567
+ this.value = html;
2568
+ return;
2569
+ }
2570
+ this.area.innerHTML = this.toEditable(html);
2571
+ this.pushHistory(false);
2572
+ if (emit)
2573
+ this.emit('api');
2574
+ }
2575
+ /** `<b>` from the browser becomes `<strong>`, `<font>` from colours a span, and so on. */
2576
+ normalizeMarkup() {
2577
+ const area = this.area;
2578
+ const rename = (from, to) => area.querySelectorAll(from).forEach((el) => {
2579
+ const n = this.doc.createElement(to);
2580
+ for (const a of Array.from(el.attributes))
2581
+ n.setAttribute(a.name, a.value);
2582
+ while (el.firstChild)
2583
+ n.appendChild(el.firstChild);
2584
+ el.replaceWith(n);
2585
+ });
2586
+ const sel = saveSelection(area);
2587
+ let changed = false;
2588
+ const renameAll = (from, to) => {
2589
+ if (area.querySelector(from)) {
2590
+ changed = true;
2591
+ rename(from, to);
2592
+ }
2593
+ };
2594
+ renameAll('b', 'strong');
2595
+ renameAll('i', 'em');
2596
+ renameAll('strike', 's');
2597
+ area.querySelectorAll('font').forEach((f) => {
2598
+ changed = true;
2599
+ const span = this.doc.createElement('span');
2600
+ const color = f.getAttribute('color');
2601
+ if (color)
2602
+ span.style.color = color;
2603
+ const face = f.getAttribute('face');
2604
+ if (face && face !== 'wu-marker')
2605
+ span.style.fontFamily = face;
2606
+ while (f.firstChild)
2607
+ span.appendChild(f.firstChild);
2608
+ f.replaceWith(span);
2609
+ if (!span.attributes.length)
2610
+ span.replaceWith(...Array.from(span.childNodes));
2611
+ });
2612
+ // Chrome's formatBlock and Enter can leave <div>s at the top level.
2613
+ Array.from(area.children).forEach((el) => {
2614
+ if (el.tagName === 'DIV') {
2615
+ changed = true;
2616
+ const p = this.doc.createElement('p');
2617
+ for (const a of Array.from(el.attributes))
2618
+ p.setAttribute(a.name, a.value);
2619
+ while (el.firstChild)
2620
+ p.appendChild(el.firstChild);
2621
+ el.replaceWith(p);
2622
+ }
2623
+ });
2624
+ // Setting the selection again (when nothing moved) would drop a pending bold / italic at the caret.
2625
+ if (changed)
2626
+ restoreSelection(area, sel);
2627
+ }
2628
+ /** An empty editor holds one empty paragraph, so typing starts in a paragraph. */
2629
+ normalizeEmpty() {
2630
+ const area = this.area;
2631
+ if (!area.firstChild || (area.childNodes.length === 1 && area.firstChild.nodeName === 'BR')) {
2632
+ area.innerHTML = '<p><br></p>';
2633
+ caretIn(area.firstChild);
2634
+ }
2635
+ this.empty = isEmptyEditorHtml(area.innerHTML);
2636
+ }
2637
+ saveRange() {
2638
+ const r = rangeIn(this.area);
2639
+ if (r)
2640
+ this.savedRange = r.cloneRange();
2641
+ }
2642
+ /** Focus back in the content with the selection it had. */
2643
+ restore() {
2644
+ const area = this.area;
2645
+ // Still in the content (a toolbar press keeps focus there): use the selection as it is now. selectionchange fires
2646
+ // a task later, so the saved range may be one step behind (a shortcut right after Shift + arrow).
2647
+ const live = this.doc.activeElement === area ? rangeIn(area) : null;
2648
+ if (live) {
2649
+ this.savedRange = live.cloneRange();
2650
+ return;
2651
+ }
2652
+ if (this.doc.activeElement !== area)
2653
+ area.focus({ preventScroll: true });
2654
+ const r = this.savedRange;
2655
+ if (r && area.contains(r.startContainer) && area.contains(r.endContainer))
2656
+ selectRange(r);
2657
+ else if (!rangeIn(area))
2658
+ caretIn(area, true);
2659
+ }
2660
+ currentCell() {
2661
+ const r = rangeIn(this.area) || this.savedRange;
2662
+ return r ? closestIn(r.startContainer, this.area, 'td, th') : null;
2663
+ }
2664
+ syncEditable() {
2665
+ if (!this.viewReady)
2666
+ return;
2667
+ const editable = !this.locked;
2668
+ this.area.setAttribute('contenteditable', editable ? 'true' : 'false');
2669
+ if (!editable)
2670
+ this.selectImage(null);
2671
+ }
2672
+ selectImage(img) {
2673
+ if (this.selectedImage === img)
2674
+ return;
2675
+ this.selectedImage?.classList.remove('wu-image-selected');
2676
+ this.selectedImage = img;
2677
+ img?.classList.add('wu-image-selected');
2678
+ this.placeFrame();
2679
+ }
2680
+ /** The resize frame follows the selected picture. */
2681
+ placeFrame() {
2682
+ const img = this.selectedImage;
2683
+ const frame = this.frameRef?.nativeElement;
2684
+ if (!frame)
2685
+ return;
2686
+ if (!img || !img.isConnected) {
2687
+ frame.style.display = 'none';
2688
+ return;
2689
+ }
2690
+ const body = frame.parentElement.getBoundingClientRect();
2691
+ const r = img.getBoundingClientRect();
2692
+ frame.style.display = '';
2693
+ frame.style.top = `${r.top - body.top}px`;
2694
+ frame.style.left = `${r.left - body.left}px`;
2695
+ frame.style.width = `${r.width}px`;
2696
+ frame.style.height = `${r.height}px`;
2697
+ }
2698
+ toolbarItems() {
2699
+ const bar = this.toolbarRef?.nativeElement;
2700
+ if (!bar)
2701
+ return [];
2702
+ return Array.from(bar.querySelectorAll('button, select')).filter((el) => !el.disabled && el.offsetParent !== null && !el.closest('.wu-editor-hidden'));
2703
+ }
2704
+ syncToolbarTabStops() {
2705
+ const items = this.toolbarItems();
2706
+ if (!items.length)
2707
+ return;
2708
+ const current = items.find((el) => el.getAttribute('tabindex') === '0') || items[0];
2709
+ items.forEach((el) => el.setAttribute('tabindex', el === current ? '0' : '-1'));
2710
+ }
2711
+ toolbarButton(tool) {
2712
+ return this.toolbarRef?.nativeElement.querySelector(`[data-wu-tool="${tool}"]`) || null;
2713
+ }
2714
+ fail(file, reason, message, error) {
2715
+ this.onImageUploadError.emit({ file, reason, message, error });
2716
+ this.notices = [...this.notices, message];
2717
+ this.cdr.markForCheck();
2718
+ setTimeout(() => {
2719
+ this.notices = this.notices.filter((n) => n !== message);
2720
+ this.cdr.markForCheck();
2721
+ }, 6000);
2722
+ }
2723
+ get uploadConfig() {
2724
+ return { ...(this.defaults.imageUpload || {}), ...(this.imageUpload || {}) };
2725
+ }
2726
+ get uploadMode() {
2727
+ const c = this.uploadConfig;
2728
+ return c.mode || (c.url || c.upload ? 'upload' : 'base64');
2729
+ }
2730
+ get cleanOpts() {
2731
+ return { protocols: this.opts.link.protocols };
2732
+ }
2733
+ readAsDataUrl(file) {
2734
+ return new Promise((resolve, reject) => {
2735
+ const reader = new FileReader();
2736
+ reader.onload = () => resolve(String(reader.result || ''));
2737
+ reader.onerror = () => reject(reader.error);
2738
+ reader.readAsDataURL(file);
2739
+ });
2740
+ }
2741
+ /** Sends a picture to the configured endpoint (or the app's own `upload`) and resolves with its URL. */
2742
+ upload(file) {
2743
+ const c = this.uploadConfig;
2744
+ if (c.upload)
2745
+ return c.upload(file);
2746
+ if (!c.url)
2747
+ return Promise.reject(new Error('imageUpload.url is not set'));
2748
+ return new Promise((resolve, reject) => {
2749
+ const xhr = new XMLHttpRequest();
2750
+ const form = new FormData();
2751
+ form.append(c.fieldName || 'file', file, file.name);
2752
+ xhr.open(c.method || 'POST', c.url, true);
2753
+ for (const [k, v] of headerEntries(c.headers))
2754
+ xhr.setRequestHeader(k, v);
2755
+ xhr.withCredentials = !!c.withCredentials;
2756
+ xhr.onload = () => {
2757
+ if (xhr.status < 200 || xhr.status >= 300)
2758
+ return reject(new Error(`HTTP ${xhr.status}`));
2759
+ let body = xhr.responseText;
2760
+ try {
2761
+ body = JSON.parse(xhr.responseText);
2762
+ }
2763
+ catch {
2764
+ /* a plain-text URL */
2765
+ }
2766
+ let url;
2767
+ if (typeof c.responseUrl === 'function')
2768
+ url = c.responseUrl(body);
2769
+ else if (c.responseUrl)
2770
+ url = pathValue(body, c.responseUrl);
2771
+ else if (typeof body === 'string')
2772
+ url = body.trim();
2773
+ else
2774
+ for (const p of ['url', 'data.url', 'location', 'path', 'data.path', 'file.url'])
2775
+ if (!url)
2776
+ url = pathValue(body, p);
2777
+ if (typeof url !== 'string' || !url)
2778
+ return reject(new Error('No image URL in the response'));
2779
+ const full = c.baseUrl && !/^[a-z][a-z0-9+.-]*:|^\/\//i.test(url) ? c.baseUrl.replace(/\/$/, '') + '/' + url.replace(/^\//, '') : url;
2780
+ resolve(full);
2781
+ };
2782
+ xhr.onerror = () => reject(new Error('Network error'));
2783
+ xhr.send(form);
2784
+ });
2785
+ }
2786
+ prettyHtml(html) {
2787
+ return html.replace(/(<\/(p|h[1-6]|li|ul|ol|blockquote|pre|table|thead|tbody|tr)>)/g, '$1\n').replace(/(<(ul|ol|table|thead|tbody|tr)>)/g, '$1\n').trim();
2788
+ }
2789
+ // ---------- the app's own header template (Quill toolbar markup) ----------
2790
+ /** Gives `ql-*` buttons and selects of a `header` template their icons, labels and actions. */
2791
+ wireQuillToolbar() {
2792
+ const bar = this.toolbarRef?.nativeElement;
2793
+ if (!bar)
2794
+ return;
2795
+ const wire = () => {
2796
+ bar.querySelectorAll('button[class*="ql-"], select[class*="ql-"]').forEach((el) => {
2797
+ if (el.dataset['wuWired'])
2798
+ return;
2799
+ el.dataset['wuWired'] = '1';
2800
+ const info = ɵquillTool(el);
2801
+ if (!info) {
2802
+ el.classList.add('wu-editor-hidden');
2803
+ return;
2804
+ }
2805
+ if (el.tagName === 'SELECT') {
2806
+ // A Quill select becomes one of our dropdown buttons; the select stays hidden.
2807
+ el.classList.add('wu-editor-hidden');
2808
+ const btn = this.doc.createElement('button');
2809
+ btn.type = 'button';
2810
+ btn.className = 'wu-editor-tool wu-editor-tool-quill' + (info.dropdown ? ' wu-editor-dropdown' : '');
2811
+ btn.setAttribute('aria-haspopup', 'true');
2812
+ btn.setAttribute('aria-label', this.toolLabel(info.tool));
2813
+ btn.title = this.toolLabel(info.tool);
2814
+ btn.dataset['wuTool'] = info.tool;
2815
+ btn.innerHTML = info.dropdown
2816
+ ? `<span class="wu-editor-dropdown-label"></span>${this.icons['chevron']}`
2817
+ : this.icons[this.toolIcon(info.tool)] || '';
2818
+ if (info.tool === 'align')
2819
+ btn.dataset['wuAlignIcon'] = this.toolIcon('align');
2820
+ el.insertAdjacentElement('afterend', btn);
2821
+ const values = Array.from(el.options).map((o) => o.value);
2822
+ btn.addEventListener('mousedown', (e) => e.preventDefault());
2823
+ btn.addEventListener('click', () => this.zone.run(() => {
2824
+ // The header's select lists the blocks it offers (quotes and code have their own ql-* buttons).
2825
+ if (info.tool === 'heading')
2826
+ this.opts = { ...this.opts, headings: values.map((v) => Number(v) || 0), blocks: [] };
2827
+ if ((info.tool === 'color' || info.tool === 'highlight') && values.some(Boolean)) {
2828
+ const palette = values.filter(Boolean);
2829
+ this.opts = info.tool === 'color' ? { ...this.opts, colors: palette } : { ...this.opts, highlights: palette };
2830
+ }
2831
+ if (info.tool === 'align')
2832
+ this.opts = { ...this.opts, alignments: values.map((v) => (v || 'left')) };
2833
+ this.runTool(info.tool, { currentTarget: btn });
2834
+ }));
2835
+ return;
2836
+ }
2837
+ const b = el;
2838
+ b.type = 'button';
2839
+ b.classList.add('wu-editor-tool');
2840
+ b.dataset['wuTool'] = info.tool;
2841
+ if (!b.getAttribute('aria-label'))
2842
+ b.setAttribute('aria-label', this.toolLabel(info.tool));
2843
+ if (!b.title)
2844
+ b.title = this.toolLabel(info.tool);
2845
+ if (info.heading) {
2846
+ b.dataset['wuHeading'] = String(info.heading);
2847
+ if (!b.innerHTML.trim())
2848
+ b.innerHTML = `<span class="wu-editor-heading-mark">H${info.heading}</span>`;
2849
+ b.setAttribute('aria-label', this.headingLabel(info.heading));
2850
+ }
2851
+ if (!b.innerHTML.trim())
2852
+ b.innerHTML = this.icons[info.tool] || '';
2853
+ b.addEventListener('mousedown', (e) => e.preventDefault());
2854
+ b.addEventListener('click', () => this.zone.run(() => {
2855
+ if (info.heading)
2856
+ this.pickHeading(this.state.heading === info.heading ? 0 : info.heading);
2857
+ else
2858
+ this.runTool(info.tool, { currentTarget: b });
2859
+ }));
2860
+ });
2861
+ this.syncQuillToolbar();
2862
+ this.syncToolbarTabStops();
2863
+ };
2864
+ wire();
2865
+ // Templates with *ngIf inside re-render: wire new buttons as they appear.
2866
+ const win = this.doc.defaultView;
2867
+ if (win?.MutationObserver) {
2868
+ // Only new, unwired controls matter; our own label updates must not set it off again.
2869
+ this.quillObserver = new win.MutationObserver(() => {
2870
+ if (bar.querySelector('button[class*="ql-"]:not([data-wu-wired]), select[class*="ql-"]:not([data-wu-wired])'))
2871
+ wire();
2872
+ });
2873
+ this.quillObserver.observe(bar, { childList: true, subtree: true });
2874
+ }
2875
+ }
2876
+ syncQuillToolbar() {
2877
+ const bar = this.toolbarRef?.nativeElement;
2878
+ if (!bar || !this.headerTemplate)
2879
+ return;
2880
+ bar.querySelectorAll('[data-wu-tool]').forEach((el) => {
2881
+ const tool = el.dataset['wuTool'];
2882
+ const level = Number(el.dataset['wuHeading'] || 0);
2883
+ const on = level ? this.state.heading === level : this.isOn(tool);
2884
+ el.classList.toggle('ql-active', on);
2885
+ el.classList.toggle('wu-editor-tool-on', on);
2886
+ if (el.tagName === 'BUTTON' && (level || !this.hasMenu(tool)))
2887
+ el.setAttribute('aria-pressed', String(on));
2888
+ const off = this.isDisabled(tool);
2889
+ if (el.disabled !== off)
2890
+ el.disabled = off;
2891
+ // The align button shows the current alignment.
2892
+ const alignIcon = el.dataset['wuAlignIcon'];
2893
+ if (alignIcon && alignIcon !== this.toolIcon('align')) {
2894
+ el.dataset['wuAlignIcon'] = this.toolIcon('align');
2895
+ el.innerHTML = this.icons[this.toolIcon('align')] || '';
2896
+ }
2897
+ const label = el.querySelector('.wu-editor-dropdown-label');
2898
+ const text = this.dropdownLabel(tool);
2899
+ if (label && label.textContent !== text)
2900
+ label.textContent = text;
2901
+ });
2902
+ }
2903
+ }
2904
+ ɵWuEditorBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ɵWuEditorBase, deps: [], target: i0.ɵɵFactoryTarget.Directive });
2905
+ ɵWuEditorBase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: ɵWuEditorBase, inputs: { toolbar: "toolbar", toolOptions: "toolOptions", imageUpload: "imageUpload", placeholder: "placeholder", readonly: "readonly", style: "style", styleClass: "styleClass", showCount: "showCount", stickyToolbar: "stickyToolbar", ariaLabel: "ariaLabel", ariaLabelledBy: "ariaLabelledBy", id: "id", formats: "formats", modules: "modules", bounds: "bounds", scrollingContainer: "scrollingContainer", debug: "debug" }, outputs: { onTextChange: "onTextChange", onSelectionChange: "onSelectionChange", onInit: "onInit", onFocus: "onFocus", onBlur: "onBlur", onImageUpload: "onImageUpload", onImageUploadError: "onImageUploadError" }, queries: [{ propertyName: "headerRef", first: true, predicate: ["header"] }, { propertyName: "templates", predicate: WuTemplate }], viewQueries: [{ propertyName: "areaRef", first: true, predicate: ["area"], descendants: true }, { propertyName: "toolbarRef", first: true, predicate: ["toolbarEl"], descendants: true }, { propertyName: "panelRef", first: true, predicate: ["panelEl"], descendants: true }, { propertyName: "imageInputRef", first: true, predicate: ["imageInput"], descendants: true }, { propertyName: "frameRef", first: true, predicate: ["frameEl"], descendants: true }], ngImport: i0 });
2906
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ɵWuEditorBase, decorators: [{
2907
+ type: Directive
2908
+ }], ctorParameters: function () { return []; }, propDecorators: { toolbar: [{
2909
+ type: Input
2910
+ }], toolOptions: [{
2911
+ type: Input
2912
+ }], imageUpload: [{
2913
+ type: Input
2914
+ }], placeholder: [{
2915
+ type: Input
2916
+ }], readonly: [{
2917
+ type: Input
2918
+ }], style: [{
2919
+ type: Input
2920
+ }], styleClass: [{
2921
+ type: Input
2922
+ }], showCount: [{
2923
+ type: Input
2924
+ }], stickyToolbar: [{
2925
+ type: Input
2926
+ }], ariaLabel: [{
2927
+ type: Input
2928
+ }], ariaLabelledBy: [{
2929
+ type: Input
2930
+ }], id: [{
2931
+ type: Input
2932
+ }], formats: [{
2933
+ type: Input
2934
+ }], modules: [{
2935
+ type: Input
2936
+ }], bounds: [{
2937
+ type: Input
2938
+ }], scrollingContainer: [{
2939
+ type: Input
2940
+ }], debug: [{
2941
+ type: Input
2942
+ }], onTextChange: [{
2943
+ type: Output
2944
+ }], onSelectionChange: [{
2945
+ type: Output
2946
+ }], onInit: [{
2947
+ type: Output
2948
+ }], onFocus: [{
2949
+ type: Output
2950
+ }], onBlur: [{
2951
+ type: Output
2952
+ }], onImageUpload: [{
2953
+ type: Output
2954
+ }], onImageUploadError: [{
2955
+ type: Output
2956
+ }], templates: [{
2957
+ type: ContentChildren,
2958
+ args: [WuTemplate]
2959
+ }], headerRef: [{
2960
+ type: ContentChild,
2961
+ args: ['header', { descendants: false }]
2962
+ }], areaRef: [{
2963
+ type: ViewChild,
2964
+ args: ['area']
2965
+ }], toolbarRef: [{
2966
+ type: ViewChild,
2967
+ args: ['toolbarEl']
2968
+ }], panelRef: [{
2969
+ type: ViewChild,
2970
+ args: ['panelEl']
2971
+ }], imageInputRef: [{
2972
+ type: ViewChild,
2973
+ args: ['imageInput']
2974
+ }], frameRef: [{
2975
+ type: ViewChild,
2976
+ args: ['frameEl']
2977
+ }] } });
2978
+
2979
+ /** Draws one of the editor's built-in SVG icons: `<span wuEditorIcon="bold"></span>`. */
2980
+ class ɵWuEditorIcon {
2981
+ constructor() {
2982
+ this.el = inject(ElementRef).nativeElement;
2983
+ }
2984
+ set wuEditorIcon(name) {
2985
+ this.el.innerHTML = (name && ɵWU_EDITOR_ICONS[name]) || '';
2986
+ }
2987
+ }
2988
+ ɵWuEditorIcon.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ɵWuEditorIcon, deps: [], target: i0.ɵɵFactoryTarget.Directive });
2989
+ ɵWuEditorIcon.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: ɵWuEditorIcon, isStandalone: true, selector: "[wuEditorIcon]", inputs: { wuEditorIcon: "wuEditorIcon" }, ngImport: i0 });
2990
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ɵWuEditorIcon, decorators: [{
2991
+ type: Directive,
2992
+ args: [{
2993
+ selector: '[wuEditorIcon]',
2994
+ standalone: true,
2995
+ }]
2996
+ }], propDecorators: { wuEditorIcon: [{
2997
+ type: Input
2998
+ }] } });
2999
+
3000
+ /**
3001
+ * Rich-text editor: `<wu-editor [(ngModel)]="news.body" [style]="{ height: '320px' }" toolbar="full"
3002
+ * [imageUpload]="{ url: '/api/upload' }">`. The value is HTML (null when empty). The app's own `header` template
3003
+ * with the familiar `ql-*` buttons still works.
3004
+ */
3005
+ class WuEditor extends ɵWuEditorBase {
3006
+ }
3007
+ WuEditor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WuEditor, deps: null, target: i0.ɵɵFactoryTarget.Component });
3008
+ WuEditor.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: WuEditor, isStandalone: true, selector: "wu-editor", host: { classAttribute: "wu-editor-host" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => WuEditor), multi: true }], exportAs: ["wuEditor"], usesInheritance: true, ngImport: i0, template: "<div\n class=\"wu-editor p-editor p-editor-container p-component\"\n [class.wu-editor-focused]=\"focused\"\n [class.wu-editor-disabled]=\"disabled\"\n [class.p-disabled]=\"disabled\"\n [class.wu-editor-readonly]=\"readonly\"\n [class.wu-editor-fullscreen]=\"fullscreen\"\n [class.wu-editor-sticky]=\"stickyToolbar\"\n [class.wu-editor-source-mode]=\"sourceMode\"\n [ngClass]=\"styleClass || ''\"\n>\n <div\n *ngIf=\"headerTemplate || groups.length\"\n #toolbarEl\n class=\"wu-editor-toolbar p-editor-toolbar\"\n role=\"toolbar\"\n [attr.aria-label]=\"m.toolbar\"\n [attr.aria-controls]=\"areaId\"\n (mousedown)=\"toolbarMouseDown($event)\"\n (keydown)=\"toolbarKeydown($event)\"\n >\n <ng-container *ngIf=\"headerTemplate; else ownTools\">\n <ng-container *ngTemplateOutlet=\"headerTemplate\"></ng-container>\n </ng-container>\n <ng-template #ownTools>\n <span *ngFor=\"let group of groups\" class=\"wu-editor-group\" role=\"group\">\n <button\n *ngFor=\"let t of group\"\n type=\"button\"\n class=\"wu-editor-tool\"\n tabindex=\"-1\"\n [class.wu-editor-dropdown]=\"isDropdown(t)\"\n [class.wu-editor-tool-on]=\"isOn(t)\"\n [class.wu-editor-tool-open]=\"panelOpenFor(t)\"\n [attr.data-wu-tool]=\"t\"\n [disabled]=\"isDisabled(t)\"\n [attr.aria-pressed]=\"hasMenu(t) ? null : isOn(t)\"\n [attr.aria-haspopup]=\"hasMenu(t) ? 'true' : null\"\n [attr.aria-expanded]=\"hasMenu(t) ? panelOpenFor(t) : null\"\n [attr.aria-label]=\"toolLabel(t)\"\n [attr.title]=\"toolLabel(t)\"\n (click)=\"runTool(t, $event)\"\n >\n <ng-container *ngIf=\"isDropdown(t); else iconTool\">\n <span class=\"wu-editor-dropdown-label\">{{ dropdownLabel(t) }}</span>\n <span class=\"wu-editor-chevron-wrap\" wuEditorIcon=\"chevron\"></span>\n </ng-container>\n <ng-template #iconTool><span class=\"wu-editor-icon-wrap\" [wuEditorIcon]=\"toolIcon(t)\"></span></ng-template>\n </button>\n </span>\n </ng-template>\n </div>\n\n <div class=\"wu-editor-body\">\n <div\n #area\n class=\"wu-editor-area wu-editor-content p-editor-content\"\n role=\"textbox\"\n aria-multiline=\"true\"\n spellcheck=\"true\"\n [id]=\"areaId\"\n [class.wu-editor-hidden]=\"sourceMode\"\n [class.wu-editor-empty]=\"empty\"\n [attr.aria-label]=\"ariaLabelledBy ? null : areaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledBy || null\"\n [attr.aria-readonly]=\"readonly || null\"\n [attr.aria-disabled]=\"disabled || null\"\n [attr.data-placeholder]=\"placeholder || null\"\n [ngStyle]=\"style || null\"\n (input)=\"areaInput()\"\n (keydown)=\"areaKeydown($event)\"\n (focus)=\"areaFocus($event)\"\n (blur)=\"areaBlur($event)\"\n (click)=\"areaClick($event)\"\n (paste)=\"areaPaste($event)\"\n (dragover)=\"areaDragOver($event)\"\n (drop)=\"areaDrop($event)\"\n ></div>\n <textarea\n *ngIf=\"sourceMode\"\n class=\"wu-editor-source wu-inputtext p-inputtext\"\n spellcheck=\"false\"\n [value]=\"sourceText\"\n [ngStyle]=\"style || null\"\n [attr.aria-label]=\"m.source\"\n (input)=\"sourceInput($event)\"\n ></textarea>\n <div #frameEl class=\"wu-editor-image-frame\" style=\"display: none\" aria-hidden=\"true\">\n <span class=\"wu-editor-image-handle\" [attr.title]=\"m.imageResize\" (pointerdown)=\"resizeStart($event)\"></span>\n </div>\n </div>\n\n <div *ngIf=\"notices.length || showCount\" class=\"wu-editor-footer\">\n <div *ngFor=\"let n of notices; let i = index\" class=\"wu-editor-notice\" role=\"alert\">\n <span>{{ n }}</span>\n <button type=\"button\" class=\"wu-editor-notice-close\" [attr.aria-label]=\"t.close\" (click)=\"dismissNotice(i)\">\u00D7</button>\n </div>\n <span *ngIf=\"showCount\" class=\"wu-editor-count\">{{ countText }}</span>\n </div>\n\n <input #imageInput type=\"file\" class=\"wu-editor-file\" tabindex=\"-1\" aria-hidden=\"true\" multiple [attr.accept]=\"acceptImages\" (change)=\"imageFilesChosen($event)\" />\n\n <div *ngIf=\"panel\" #panelEl class=\"wu-editor-panel\" popover=\"manual\" [attr.data-wu-panel]=\"panel\" (keydown)=\"panelKeydown($event)\" [ngSwitch]=\"panel\">\n <div *ngSwitchCase=\"'heading'\" class=\"wu-editor-menu\" role=\"menu\" [attr.aria-label]=\"m.blockStyle\">\n <button *ngFor=\"let h of opts.headings\" type=\"button\" role=\"menuitemradio\" [class]=\"'wu-editor-menu-item wu-editor-block-' + h\" [attr.aria-checked]=\"state.heading === h && !state.codeBlock && !state.blockquote\" (click)=\"pickHeading(h)\">\n {{ headingLabel(h) }}\n </button>\n <div *ngIf=\"opts.blocks.length\" class=\"wu-editor-menu-sep\" role=\"separator\"></div>\n <button\n *ngFor=\"let b of opts.blocks\"\n type=\"button\"\n role=\"menuitemradio\"\n [class]=\"'wu-editor-menu-item wu-editor-block-' + b\"\n [attr.aria-checked]=\"b === 'blockquote' ? !!state.blockquote : !!state.codeBlock\"\n (click)=\"pickBlock(b)\"\n >\n {{ b === 'blockquote' ? m.blockquote : m.codeBlock }}\n </button>\n </div>\n <div *ngSwitchCase=\"'fontSize'\" class=\"wu-editor-menu\" role=\"menu\" [attr.aria-label]=\"m.fontSize\">\n <button *ngFor=\"let s of fontSizes\" type=\"button\" role=\"menuitemradio\" class=\"wu-editor-menu-item\" [style.font-size]=\"s.value || null\" [attr.aria-checked]=\"state.fontSize === s.value\" (click)=\"pickSize(s.value)\">{{ s.label }}</button>\n </div>\n <div *ngSwitchCase=\"'fontFamily'\" class=\"wu-editor-menu\" role=\"menu\" [attr.aria-label]=\"m.fontFamily\">\n <button *ngFor=\"let f of fontFamilies\" type=\"button\" role=\"menuitemradio\" class=\"wu-editor-menu-item\" [style.font-family]=\"f.value || null\" [attr.aria-checked]=\"state.fontFamily === f.value\" (click)=\"pickFont(f.value)\">{{ f.label }}</button>\n </div>\n <div *ngSwitchCase=\"'align'\" class=\"wu-editor-menu wu-editor-menu-icons\" role=\"menu\" [attr.aria-label]=\"m.align\">\n <button *ngFor=\"let a of opts.alignments\" type=\"button\" role=\"menuitemradio\" class=\"wu-editor-menu-item\" [attr.aria-checked]=\"state.align === a\" (click)=\"pickAlign(a)\">\n <span class=\"wu-editor-icon-wrap\" [wuEditorIcon]=\"alignIcon(a)\"></span>\n <span>{{ alignLabel(a) }}</span>\n </button>\n </div>\n <ng-container *ngSwitchCase=\"'color'\">\n <ng-container *ngTemplateOutlet=\"palette; context: { kind: 'color', colors: opts.colors }\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'highlight'\">\n <ng-container *ngTemplateOutlet=\"palette; context: { kind: 'highlight', colors: opts.highlights }\"></ng-container>\n </ng-container>\n <form *ngSwitchCase=\"'link'\" class=\"wu-editor-form\" (submit)=\"$event.preventDefault(); applyLink()\">\n <label class=\"wu-editor-field\">\n <span>{{ m.linkUrl }}</span>\n <input class=\"wu-inputtext p-inputtext\" type=\"text\" inputmode=\"url\" autocomplete=\"off\" name=\"url\" placeholder=\"https://\" [value]=\"linkForm.url\" (input)=\"linkForm.url = $any($event.target).value; linkForm.error = ''\" />\n </label>\n <label *ngIf=\"linkForm.showText\" class=\"wu-editor-field\">\n <span>{{ m.linkText }}</span>\n <input class=\"wu-inputtext p-inputtext\" type=\"text\" name=\"text\" [value]=\"linkForm.text\" (input)=\"linkForm.text = $any($event.target).value\" />\n </label>\n <label class=\"wu-editor-check\">\n <input type=\"checkbox\" name=\"newTab\" [checked]=\"linkForm.newTab\" (change)=\"linkForm.newTab = $any($event.target).checked\" />\n <span>{{ m.linkNewTab }}</span>\n </label>\n <div *ngIf=\"linkForm.error\" class=\"wu-editor-form-error\" role=\"alert\">{{ linkForm.error }}</div>\n <div class=\"wu-editor-form-actions\">\n <button *ngIf=\"state.link\" type=\"button\" [class]=\"buttonClass('p-button-text p-button-danger p-button-sm')\" (click)=\"unlink()\">{{ m.unlink }}</button>\n <button type=\"submit\" [class]=\"buttonClass('p-button-sm')\">{{ m.apply }}</button>\n </div>\n </form>\n <div *ngSwitchCase=\"'linkMenu'\" class=\"wu-editor-balloon\">\n <a class=\"wu-editor-balloon-link\" [attr.href]=\"currentLinkHref() || null\" target=\"_blank\" rel=\"noopener noreferrer\" [attr.title]=\"m.openLink\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"external\"></span>\n <span class=\"wu-editor-balloon-url\">{{ currentLinkHref() }}</span>\n </a>\n <button type=\"button\" class=\"wu-editor-tool\" [attr.aria-label]=\"m.editLink\" [attr.title]=\"m.editLink\" (click)=\"openPanel('link', panelAnchor)\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"edit\"></span>\n </button>\n <button type=\"button\" class=\"wu-editor-tool\" [attr.aria-label]=\"m.unlink\" [attr.title]=\"m.unlink\" (click)=\"unlink()\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"unlink\"></span>\n </button>\n </div>\n <div *ngSwitchCase=\"'image'\" class=\"wu-editor-image-form\">\n <div class=\"wu-editor-tabs\" role=\"tablist\">\n <button type=\"button\" role=\"tab\" class=\"wu-editor-tab\" [attr.aria-selected]=\"imageForm.tab === 'upload'\" (click)=\"imageForm.tab = 'upload'\">{{ m.imageUpload }}</button>\n <button type=\"button\" role=\"tab\" class=\"wu-editor-tab\" [attr.aria-selected]=\"imageForm.tab === 'url'\" (click)=\"imageForm.tab = 'url'\">{{ m.imageFromUrl }}</button>\n </div>\n <button *ngIf=\"imageForm.tab === 'upload'; else urlForm\" type=\"button\" class=\"wu-editor-drop\" (click)=\"chooseImage()\" (dragover)=\"$event.preventDefault()\" (drop)=\"imagePanelDrop($event)\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"upload\"></span>\n <span>{{ m.imageDrop }}</span>\n </button>\n <ng-template #urlForm>\n <form class=\"wu-editor-form\" (submit)=\"$event.preventDefault(); insertImageUrl()\">\n <label class=\"wu-editor-field\">\n <span>{{ m.imageUrl }}</span>\n <input class=\"wu-inputtext p-inputtext\" type=\"text\" inputmode=\"url\" name=\"src\" placeholder=\"https://\" [value]=\"imageForm.url\" (input)=\"imageForm.url = $any($event.target).value; imageForm.error = ''\" />\n </label>\n <label class=\"wu-editor-field\">\n <span>{{ m.imageAlt }}</span>\n <input class=\"wu-inputtext p-inputtext\" type=\"text\" name=\"alt\" [value]=\"imageForm.alt\" (input)=\"imageForm.alt = $any($event.target).value\" />\n </label>\n <div *ngIf=\"imageForm.error\" class=\"wu-editor-form-error\" role=\"alert\">{{ imageForm.error }}</div>\n <div class=\"wu-editor-form-actions\">\n <button type=\"submit\" [class]=\"buttonClass('p-button-sm')\">{{ m.apply }}</button>\n </div>\n </form>\n </ng-template>\n </div>\n <div *ngSwitchCase=\"'imageMenu'\" class=\"wu-editor-balloon wu-editor-image-menu\">\n <span class=\"wu-editor-balloon-group\" role=\"group\">\n <button\n *ngFor=\"let a of imageAligns\"\n type=\"button\"\n class=\"wu-editor-tool\"\n [class.wu-editor-tool-on]=\"imageAlignIs(a)\"\n [attr.aria-pressed]=\"imageAlignIs(a)\"\n [attr.aria-label]=\"imageAlignLabel(a)\"\n [attr.title]=\"imageAlignLabel(a)\"\n (click)=\"setImageAlign(a)\"\n >\n <span class=\"wu-editor-icon-wrap\" [wuEditorIcon]=\"'image' + a[0].toUpperCase() + a.slice(1)\"></span>\n </button>\n </span>\n <span class=\"wu-editor-balloon-group\" role=\"group\" [attr.aria-label]=\"m.imageWidth\">\n <button *ngFor=\"let w of imageWidths\" type=\"button\" class=\"wu-editor-tool wu-editor-tool-text\" (click)=\"setImageWidth(w)\">{{ w }}%</button>\n <button type=\"button\" class=\"wu-editor-tool wu-editor-tool-text\" (click)=\"setImageWidth(null)\">{{ m.imageOriginal }}</button>\n </span>\n <input class=\"wu-inputtext p-inputtext wu-editor-alt\" type=\"text\" [attr.placeholder]=\"m.imageAlt\" [attr.aria-label]=\"m.imageAlt\" [value]=\"selectedImage?.getAttribute('alt') || ''\" (change)=\"setImageAlt($event)\" />\n <button type=\"button\" class=\"wu-editor-tool wu-editor-tool-danger\" [attr.aria-label]=\"m.imageRemove\" [attr.title]=\"m.imageRemove\" (click)=\"removeImage()\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"trash\"></span>\n </button>\n </div>\n <div *ngSwitchCase=\"'table'\" class=\"wu-editor-table-insert\">\n <div class=\"wu-editor-grid\" role=\"grid\" tabindex=\"0\" [attr.aria-label]=\"m.insertTable\" (keydown)=\"gridKeydown($event)\" (mouseleave)=\"gridMove(0, 0)\">\n <div *ngFor=\"let r of gridRows()\" class=\"wu-editor-grid-row\" role=\"row\">\n <button\n *ngFor=\"let c of gridCols()\"\n type=\"button\"\n role=\"gridcell\"\n tabindex=\"-1\"\n class=\"wu-editor-grid-cell\"\n [class.wu-editor-grid-on]=\"r <= gridHover.rows && c <= gridHover.cols\"\n [attr.aria-label]=\"m.tableSize.replace('{0}', '' + r).replace('{1}', '' + c)\"\n (mouseenter)=\"gridMove(r, c)\"\n (focus)=\"gridMove(r, c)\"\n (click)=\"insertTable(r, c)\"\n ></button>\n </div>\n <div class=\"wu-editor-grid-label\" aria-live=\"polite\">{{ gridLabel }}</div>\n </div>\n <div class=\"wu-editor-table-size\">\n <label class=\"wu-editor-table-size-field\">\n <span>{{ m.tableRows }}</span>\n <input class=\"wu-inputtext p-inputtext\" type=\"number\" min=\"1\" max=\"100\" inputmode=\"numeric\" [value]=\"tableForm.rows\" (input)=\"setTableForm('rows', $event)\" (keydown.enter)=\"$event.preventDefault(); insertCustomTable()\" />\n </label>\n <label class=\"wu-editor-table-size-field\">\n <span>{{ m.tableCols }}</span>\n <input class=\"wu-inputtext p-inputtext\" type=\"number\" min=\"1\" max=\"30\" inputmode=\"numeric\" [value]=\"tableForm.cols\" (input)=\"setTableForm('cols', $event)\" (keydown.enter)=\"$event.preventDefault(); insertCustomTable()\" />\n </label>\n <label class=\"wu-editor-check wu-editor-table-size-header\">\n <input type=\"checkbox\" [checked]=\"tableForm.header\" (change)=\"setTableHeader($event)\" />\n <span>{{ m.headerRow }}</span>\n </label>\n <button type=\"button\" class=\"wu-btn p-button wu-btn-sm p-button-sm wu-editor-table-size-insert\" (click)=\"insertCustomTable()\">{{ m.insert }}</button>\n </div>\n </div>\n <div *ngSwitchCase=\"'tableBar'\" class=\"wu-editor-balloon wu-editor-table-bar\" role=\"toolbar\" [attr.aria-label]=\"m.tableTools\">\n <span class=\"wu-editor-balloon-group\" role=\"group\">\n <button *ngFor=\"let a of tableInserts\" type=\"button\" class=\"wu-editor-tool\" [attr.aria-label]=\"$any(m)[a]\" [attr.title]=\"$any(m)[a]\" (click)=\"tableAction(a)\">\n <span class=\"wu-editor-icon-wrap\" [wuEditorIcon]=\"a\"></span>\n </button>\n </span>\n <span class=\"wu-editor-balloon-group\" role=\"group\">\n <button type=\"button\" class=\"wu-editor-tool\" [disabled]=\"!canMergePicked\" [attr.aria-label]=\"cellPick ? m.mergeCells : m.mergeRight\" [attr.title]=\"cellPick ? m.mergeCells : m.mergeRight\" (click)=\"tableAction('mergeCells')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"mergeRight\"></span>\n </button>\n <button type=\"button\" class=\"wu-editor-tool\" [disabled]=\"!canSplit()\" [attr.aria-label]=\"m.splitCell\" [attr.title]=\"m.splitCell\" (click)=\"tableAction('splitCell')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"splitCell\"></span>\n </button>\n <button type=\"button\" class=\"wu-editor-tool\" [class.wu-editor-tool-on]=\"inHeaderRow\" [attr.aria-pressed]=\"inHeaderRow\" [attr.aria-label]=\"m.headerRow\" [attr.title]=\"m.headerRow\" (click)=\"tableAction('headerRow')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"headerRow\"></span>\n </button>\n </span>\n <span class=\"wu-editor-balloon-group\" role=\"group\">\n <button type=\"button\" class=\"wu-editor-tool\" [attr.aria-label]=\"m.deleteRow\" [attr.title]=\"m.deleteRow\" (click)=\"tableAction('deleteRow')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"deleteRow\"></span>\n </button>\n <button type=\"button\" class=\"wu-editor-tool\" [attr.aria-label]=\"m.deleteCol\" [attr.title]=\"m.deleteCol\" (click)=\"tableAction('deleteCol')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"deleteCol\"></span>\n </button>\n <button type=\"button\" class=\"wu-editor-tool wu-editor-tool-danger\" [attr.aria-label]=\"m.deleteTable\" [attr.title]=\"m.deleteTable\" (click)=\"tableAction('deleteTable')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"trash\"></span>\n </button>\n </span>\n </div>\n <div *ngSwitchCase=\"'tableMenu'\" class=\"wu-editor-menu wu-editor-menu-icons\" role=\"menu\" [attr.aria-label]=\"m.table\">\n <button *ngFor=\"let a of tableInserts\" type=\"button\" role=\"menuitem\" class=\"wu-editor-menu-item\" (click)=\"tableAction(a)\">\n <span class=\"wu-editor-icon-wrap\" [wuEditorIcon]=\"a\"></span><span>{{ $any(m)[a] }}</span>\n </button>\n <div class=\"wu-editor-menu-sep\" role=\"separator\"></div>\n <button type=\"button\" role=\"menuitemcheckbox\" class=\"wu-editor-menu-item\" [attr.aria-checked]=\"inHeaderRow\" (click)=\"tableAction('headerRow')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"headerRow\"></span><span>{{ m.headerRow }}</span>\n </button>\n <button *ngIf=\"cellPick\" type=\"button\" role=\"menuitem\" class=\"wu-editor-menu-item\" [disabled]=\"!canMergePicked\" (click)=\"tableAction('mergeCells')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"mergeRight\"></span><span>{{ m.mergeCells }}</span>\n </button>\n <button type=\"button\" role=\"menuitem\" class=\"wu-editor-menu-item\" [disabled]=\"!canMerge('right')\" (click)=\"tableAction('mergeRight')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"mergeRight\"></span><span>{{ m.mergeRight }}</span>\n </button>\n <button type=\"button\" role=\"menuitem\" class=\"wu-editor-menu-item\" [disabled]=\"!canMerge('down')\" (click)=\"tableAction('mergeDown')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"mergeDown\"></span><span>{{ m.mergeDown }}</span>\n </button>\n <button type=\"button\" role=\"menuitem\" class=\"wu-editor-menu-item\" [disabled]=\"!canSplit()\" (click)=\"tableAction('splitCell')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"splitCell\"></span><span>{{ m.splitCell }}</span>\n </button>\n <div class=\"wu-editor-menu-sep\" role=\"separator\"></div>\n <button type=\"button\" role=\"menuitem\" class=\"wu-editor-menu-item\" (click)=\"tableAction('deleteRow')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"deleteRow\"></span><span>{{ m.deleteRow }}</span>\n </button>\n <button type=\"button\" role=\"menuitem\" class=\"wu-editor-menu-item\" (click)=\"tableAction('deleteCol')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"deleteCol\"></span><span>{{ m.deleteCol }}</span>\n </button>\n <button type=\"button\" role=\"menuitem\" class=\"wu-editor-menu-item wu-editor-menu-danger\" (click)=\"tableAction('deleteTable')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"trash\"></span><span>{{ m.deleteTable }}</span>\n </button>\n </div>\n </div>\n</div>\n\n<ng-template #palette let-kind=\"kind\" let-colors=\"colors\">\n <div class=\"wu-editor-palette\" role=\"menu\" [attr.aria-label]=\"kind === 'color' ? m.color : m.highlight\">\n <button type=\"button\" role=\"menuitem\" class=\"wu-editor-menu-item wu-editor-palette-none\" (click)=\"pickColor(kind, null)\">\n <span class=\"wu-editor-swatch wu-editor-swatch-none\" aria-hidden=\"true\"></span>{{ m.removeColor }}\n </button>\n <div class=\"wu-editor-swatches\">\n <button *ngFor=\"let c of colors\" type=\"button\" role=\"menuitem\" class=\"wu-editor-swatch\" [style.background]=\"c\" [attr.aria-label]=\"c\" [attr.title]=\"c\" (click)=\"pickColor(kind, c)\"></button>\n </div>\n <label class=\"wu-editor-custom-color\">\n <input type=\"color\" (change)=\"customColor(kind, $event)\" />\n <span>{{ m.customColor }}</span>\n </label>\n </div>\n</ng-template>\n", styles: ["@layer wiraui.components{wu-editor{display:block;max-width:100%}.wu-editor{position:relative;display:flex;flex-direction:column;min-width:0;font-family:var(--wu-font-family);font-size:var(--wu-font-size);color:var(--wu-text)}.wu-editor-hidden,.wu-editor-file{display:none!important}.wu-editor-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:.25rem;padding:var(--wu-editor-toolbar-padding);border:1px solid var(--wu-field-border);border-bottom-color:var(--wu-border);border-radius:var(--wu-editor-radius) var(--wu-editor-radius) 0 0;background:var(--wu-editor-toolbar-bg)}.wu-editor-sticky .wu-editor-toolbar{position:sticky;top:var(--wu-editor-sticky-top, 0px);z-index:2}.wu-editor-group,.wu-editor-toolbar .ql-formats{display:inline-flex;flex-wrap:wrap;align-items:center;gap:2px}.wu-editor-group+.wu-editor-group,.wu-editor-toolbar .ql-formats+.ql-formats{margin-left:.125rem;padding-left:.375rem;border-left:1px solid var(--wu-border)}.wu-editor-tool,.wu-editor-toolbar .ql-formats>button{display:inline-flex;align-items:center;justify-content:center;gap:.25rem;box-sizing:border-box;min-width:var(--wu-editor-tool-size);height:var(--wu-editor-tool-size);margin:0;padding:0 .375rem;border:0;border-radius:var(--wu-editor-tool-radius);background:transparent;color:var(--wu-text);font:inherit;font-size:.875em;line-height:1;white-space:nowrap;cursor:pointer;transition:background-color var(--wu-transition),color var(--wu-transition)}.wu-editor-tool:not(:disabled):hover{background:var(--wu-editor-tool-hover-bg)}.wu-editor-tool.wu-editor-tool-on,.wu-editor-tool.wu-editor-tool-open{background:var(--wu-editor-tool-on-bg);color:var(--wu-editor-tool-on-color)}.wu-editor-tool:disabled{opacity:var(--wu-disabled-opacity);cursor:default}.wu-editor-tool:focus-visible{outline:var(--wu-control-focus-outline);outline-offset:-1px}.wu-editor-icon-wrap,.wu-editor-chevron-wrap{display:inline-flex}.wu-editor-icon{width:1.25rem;height:1.25rem}.wu-editor-chevron{width:.875rem;height:.875rem;opacity:.7}.wu-editor-dropdown{justify-content:space-between;padding:0 .375rem 0 .5rem}.wu-editor-dropdown-label{min-width:4.5rem;max-width:9rem;overflow:hidden;text-align:start;text-overflow:ellipsis}.wu-editor-heading-mark{font-weight:700;font-size:.875em}.wu-editor-tool-text{font-size:.8125em}.wu-editor-tool-danger:not(:disabled):hover{background:var(--wu-danger-bg);color:var(--wu-danger-text)}.wu-editor-body{position:relative;display:flex;flex:1 1 auto;flex-direction:column;min-height:0}.wu-editor-area{position:relative;box-sizing:border-box;min-height:var(--wu-editor-content-min-height);padding:var(--wu-editor-content-padding-y) var(--wu-editor-content-padding-x);border:1px solid var(--wu-field-border);border-radius:var(--wu-editor-radius);background:var(--wu-field-bg);outline:none;overflow:auto;overscroll-behavior:contain;transition:border-color var(--wu-transition),box-shadow var(--wu-transition)}.wu-editor-toolbar+.wu-editor-body>.wu-editor-area,.wu-editor-toolbar+.wu-editor-body>.wu-editor-source{border-top:0;border-radius:0 0 var(--wu-editor-radius) var(--wu-editor-radius)}.wu-editor-focused .wu-editor-area{border-color:var(--wu-primary-color);box-shadow:var(--wu-control-focus-shadow)}.wu-editor-area.wu-editor-empty:before{content:attr(data-placeholder);position:absolute;top:var(--wu-editor-content-padding-y);right:var(--wu-editor-content-padding-x);left:var(--wu-editor-content-padding-x);color:var(--wu-field-placeholder);pointer-events:none}.wu-editor-disabled .wu-editor-area{opacity:var(--wu-disabled-opacity)}.wu-editor-readonly .wu-editor-area{background:var(--wu-editor-toolbar-bg)}.wu-editor-source{box-sizing:border-box;width:100%;min-height:var(--wu-editor-content-min-height);resize:vertical;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.875em;line-height:1.5}.wu-editor-content{line-height:1.6;overflow-wrap:break-word;white-space:pre-wrap;tab-size:4}.wu-editor-view{display:block;color:var(--wu-text)}.wu-editor-content:after{content:\"\";display:table;clear:both}.wu-editor-content>:first-child{margin-top:0}.wu-editor-content :is(p,ol,ul,pre,blockquote,h1,h2,h3,h4,h5,h6){margin:0;padding:0}.wu-editor-content h1{font-size:2em;line-height:1.25}.wu-editor-content h2{font-size:1.5em;line-height:1.3}.wu-editor-content h3{font-size:1.25em}.wu-editor-content h4{font-size:1.1em}.wu-editor-content :is(h1,h2,h3,h4,h5,h6){font-weight:600}.wu-editor-content :is(ol,ul){padding-left:1.5em}.wu-editor-content li>:is(ol,ul){margin:0}.wu-editor-content blockquote{margin:.5em 0;padding:.25em 0 .25em 1em;border-left:4px solid var(--wu-border);color:var(--wu-text-muted)}.wu-editor-content pre{margin:.5em 0;padding:.75em 1em;border-radius:var(--wu-radius-sm);background:var(--wu-hover-bg);font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.875em;white-space:pre-wrap;overflow-x:auto}.wu-editor-content code{padding:.1em .3em;border-radius:3px;background:var(--wu-hover-bg);font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.875em}.wu-editor-content pre code{padding:0;background:none;font-size:inherit}.wu-editor-content a{color:var(--wu-primary-color);text-decoration:underline}.wu-editor-content hr{margin:1em 0;border:0;border-top:1px solid var(--wu-border)}.wu-editor-content img{max-width:100%;height:auto;vertical-align:bottom}.wu-editor-content img.wu-image-left{float:left;margin:.25em 1em .5em 0}.wu-editor-content img.wu-image-right{float:right;margin:.25em 0 .5em 1em}.wu-editor-content img.wu-image-center{display:block;margin:.5em auto}.wu-editor-content table{margin:.5em 0;border-collapse:collapse;max-width:100%}.wu-editor-content :is(td,th){min-width:2.5em;padding:.375em .5em;border:1px solid var(--wu-border);text-align:start;vertical-align:top}.wu-editor-content th{background:var(--wu-hover-bg);font-weight:600}.wu-editor-content table:has(> colgroup){table-layout:fixed}.wu-editor-content :is(td,th){overflow-wrap:anywhere}.wu-editor-area .wu-editor-cell-picked{background:color-mix(in srgb,var(--wu-primary-color) 14%,transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--wu-primary-color) 60%,transparent)}.wu-editor-picking ::selection{background:transparent}.wu-editor-col-resize,.wu-editor-col-resize *,.wu-editor-resizing,.wu-editor-resizing *{cursor:col-resize!important}.wu-editor-resizing{-webkit-user-select:none;user-select:none}.wu-editor-content .ql-align-center{text-align:center}.wu-editor-content .ql-align-right{text-align:right}.wu-editor-content .ql-align-justify{text-align:justify}.wu-editor-content .ql-size-small{font-size:.75em}.wu-editor-content .ql-size-large{font-size:1.5em}.wu-editor-content .ql-size-huge{font-size:2.5em}.wu-editor-content .ql-font-serif{font-family:Georgia,Times New Roman,serif}.wu-editor-content .ql-font-monospace{font-family:Monaco,Courier New,monospace}.wu-editor-content .ql-indent-1{padding-left:3em}.wu-editor-content .ql-indent-2{padding-left:6em}.wu-editor-content .ql-indent-3{padding-left:9em}.wu-editor-content .ql-indent-4{padding-left:12em}.wu-editor-content .ql-indent-5{padding-left:15em}.wu-editor-content .ql-indent-6{padding-left:18em}.wu-editor-content .ql-indent-7{padding-left:21em}.wu-editor-content .ql-indent-8{padding-left:24em}.wu-editor-content li.ql-indent-1{margin-left:3em;padding-left:0}.wu-editor-content li.ql-indent-2{margin-left:6em;padding-left:0}.wu-editor-content li.ql-indent-3{margin-left:9em;padding-left:0}.wu-editor-content li.ql-indent-4{margin-left:12em;padding-left:0}.wu-editor-area img.wu-image-selected{outline:2px solid var(--wu-primary-color);outline-offset:1px}.wu-editor-area img.wu-image-uploading{opacity:.5;animation:wu-editor-pulse 1.2s ease-in-out infinite}.wu-editor-area :is(td,th):focus-within{outline:2px solid color-mix(in srgb,var(--wu-primary-color) 45%,transparent);outline-offset:-2px}.wu-editor-image-frame{position:absolute;box-sizing:border-box;pointer-events:none}.wu-editor-image-handle{position:absolute;right:-7px;bottom:-7px;box-sizing:border-box;width:14px;height:14px;border:2px solid var(--wu-card-bg);border-radius:3px;background:var(--wu-primary-color);cursor:nwse-resize;pointer-events:auto;touch-action:none}.wu-editor-readonly .wu-editor-image-frame,.wu-editor-disabled .wu-editor-image-frame{display:none!important}.wu-editor-footer{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.5rem;padding:.375rem .125rem 0;font-size:.8125em;color:var(--wu-text-muted)}.wu-editor-count{margin-left:auto}.wu-editor-notice{display:inline-flex;align-items:center;gap:.5rem;padding:.25rem .5rem;border-radius:var(--wu-radius-sm);background:var(--wu-danger-bg);color:var(--wu-danger-text)}.wu-editor-notice-close{padding:0 .25rem;border:0;background:none;color:inherit;font:inherit;cursor:pointer}.wu-editor.wu-editor-fullscreen{position:fixed;inset:0;z-index:1100;box-sizing:border-box;width:100%;max-width:none;height:100%;max-height:none;margin:0;padding:.75rem;border:0;overflow:hidden;background:var(--wu-ground, var(--wu-card-bg));color:var(--wu-text)}.wu-editor-fullscreen .wu-editor-area,.wu-editor-fullscreen .wu-editor-source{flex:1 1 auto;height:auto!important;max-height:none!important}.wu-editor-panel{position:fixed;inset:auto;z-index:1200;box-sizing:border-box;max-width:min(24rem,calc(100vw - 1rem));margin:0;padding:.375rem;overflow:auto;border:1px solid var(--wu-border);border-radius:var(--wu-radius-md);background:var(--wu-card-bg);color:var(--wu-text);box-shadow:var(--wu-shadow-md);font-family:var(--wu-font-family);font-size:var(--wu-font-size)}.wu-editor-menu{display:flex;flex-direction:column;gap:2px;min-width:11rem}.wu-editor-menu-item{display:flex;align-items:center;gap:.5rem;width:100%;padding:.4375rem .625rem;border:0;border-radius:var(--wu-radius-sm);background:none;color:inherit;font:inherit;text-align:start;cursor:pointer}.wu-editor-menu-item:not(:disabled):hover,.wu-editor-menu-item:focus-visible{background:var(--wu-editor-tool-hover-bg);outline:none}.wu-editor-menu-item[aria-checked=true]{background:var(--wu-editor-tool-on-bg);color:var(--wu-editor-tool-on-color)}.wu-editor-menu-item:disabled{opacity:var(--wu-disabled-opacity);cursor:default}.wu-editor-menu-danger{color:var(--wu-danger-color)}.wu-editor-menu-sep{height:1px;margin:.25rem 0;background:var(--wu-border)}.wu-editor-block-1{font-size:1.5em;font-weight:600}.wu-editor-block-2{font-size:1.3em;font-weight:600}.wu-editor-block-3{font-size:1.15em;font-weight:600}.wu-editor-block-4{font-size:1.05em;font-weight:600}.wu-editor-block-5{font-weight:600}.wu-editor-block-6{font-size:.875em;font-weight:600;text-transform:uppercase;letter-spacing:.02em}.wu-editor-block-blockquote{border-left:3px solid var(--wu-border);font-style:italic}.wu-editor-block-codeBlock{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.875em}.wu-editor-palette{display:flex;flex-direction:column;gap:.375rem;width:14.5rem}.wu-editor-swatches{display:grid;grid-template-columns:repeat(6,1fr);gap:.375rem}.wu-editor-swatch{box-sizing:border-box;width:100%;aspect-ratio:1;padding:0;border:1px solid color-mix(in srgb,var(--wu-text) 18%,transparent);border-radius:var(--wu-radius-sm);cursor:pointer}.wu-editor-palette-none .wu-editor-swatch{width:1.25rem;flex:none}.wu-editor-swatch-none{background:linear-gradient(135deg,transparent 45%,var(--wu-danger-color) 45%,var(--wu-danger-color) 55%,transparent 55%),var(--wu-card-bg)}.wu-editor-swatch:hover,.wu-editor-swatch:focus-visible{outline:2px solid var(--wu-primary-color);outline-offset:1px}.wu-editor-custom-color{display:flex;align-items:center;gap:.5rem;font-size:.875em;cursor:pointer}.wu-editor-custom-color input{width:2rem;height:1.75rem;padding:0;border:0;background:none;cursor:pointer}.wu-editor-form,.wu-editor-image-form{display:flex;flex-direction:column;gap:.625rem;width:min(20rem,calc(100vw - 2.5rem));padding:.25rem}.wu-editor-field{display:flex;flex-direction:column;gap:.25rem;font-size:.875em}.wu-editor-field .wu-inputtext{width:100%;box-sizing:border-box}.wu-editor-check{display:flex;align-items:center;gap:.5rem;font-size:.875em}.wu-editor-form-error{color:var(--wu-danger-color);font-size:.875em}.wu-editor-form-actions{display:flex;justify-content:flex-end;gap:.5rem}.wu-editor-tabs{display:flex;gap:.25rem;border-bottom:1px solid var(--wu-border)}.wu-editor-tab{margin-bottom:-1px;padding:.375rem .75rem;border:0;border-bottom:2px solid transparent;background:none;color:var(--wu-text-muted);font:inherit;font-size:.875em;cursor:pointer}.wu-editor-tab[aria-selected=true]{border-bottom-color:var(--wu-primary-color);color:var(--wu-primary-color);font-weight:600}.wu-editor-drop{display:flex;flex-direction:column;align-items:center;gap:.5rem;padding:1.25rem .75rem;border:1.5px dashed var(--wu-field-border);border-radius:var(--wu-radius-md);background:none;color:var(--wu-text-muted);font:inherit;font-size:.875em;text-align:center;cursor:pointer}.wu-editor-drop:hover,.wu-editor-drop:focus-visible{border-color:var(--wu-primary-color);color:var(--wu-primary-color);outline:none}.wu-editor-drop .wu-editor-icon{width:1.75rem;height:1.75rem}.wu-editor-grid{display:flex;flex-direction:column;gap:3px;padding:.125rem;outline:none}.wu-editor-grid-row{display:flex;gap:3px}.wu-editor-grid-cell{width:1.125rem;height:1.125rem;padding:0;border:1px solid var(--wu-field-border);border-radius:2px;background:var(--wu-field-bg);cursor:pointer}.wu-editor-grid-cell.wu-editor-grid-on{border-color:var(--wu-primary-color);background:color-mix(in srgb,var(--wu-primary-color) 22%,var(--wu-field-bg))}.wu-editor-grid:focus-visible{outline:var(--wu-control-focus-outline)}.wu-editor-grid-label{padding-top:.25rem;font-size:.8125em;text-align:center;color:var(--wu-text-muted)}.wu-editor-table-insert{display:flex;flex-direction:column;gap:.75rem}.wu-editor-table-size{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:.5rem;padding-top:.75rem;border-top:1px solid var(--wu-border)}.wu-editor-table-size-field{display:flex;flex-direction:column;gap:.25rem;min-width:0;color:var(--wu-text-muted);font-size:.875em}.wu-editor-table-size-field .wu-inputtext{box-sizing:border-box;width:100%;min-width:0}.wu-editor-table-size-header,.wu-editor-table-size-insert{grid-column:1 / -1}.wu-editor-table-size-insert{justify-self:end}.wu-editor-balloon{display:flex;flex-wrap:wrap;align-items:center;gap:.25rem}.wu-editor-balloon-group{display:inline-flex;gap:2px}.wu-editor-balloon-group+.wu-editor-balloon-group{padding-left:.25rem;border-left:1px solid var(--wu-border)}.wu-editor-balloon-link{display:inline-flex;align-items:center;gap:.375rem;max-width:14rem;padding:0 .375rem;color:var(--wu-primary-color);text-decoration:none}.wu-editor-balloon-url{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wu-editor-alt{width:9rem;min-width:0;height:var(--wu-editor-tool-size);box-sizing:border-box;font-size:.875em}@keyframes wu-editor-pulse{50%{opacity:.25}}@media (prefers-reduced-motion: reduce){.wu-editor-tool,.wu-editor-area{transition:none}.wu-editor-area img.wu-image-uploading{animation:none}}}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: ɵWuEditorIcon, selector: "[wuEditorIcon]", inputs: ["wuEditorIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
3009
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WuEditor, decorators: [{
3010
+ type: Component,
3011
+ args: [{ selector: 'wu-editor', standalone: true, exportAs: 'wuEditor', imports: [NgClass, NgFor, NgIf, NgStyle, NgSwitch, NgSwitchCase, NgTemplateOutlet, ɵWuEditorIcon], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => WuEditor), multi: true }], host: { class: 'wu-editor-host' }, template: "<div\n class=\"wu-editor p-editor p-editor-container p-component\"\n [class.wu-editor-focused]=\"focused\"\n [class.wu-editor-disabled]=\"disabled\"\n [class.p-disabled]=\"disabled\"\n [class.wu-editor-readonly]=\"readonly\"\n [class.wu-editor-fullscreen]=\"fullscreen\"\n [class.wu-editor-sticky]=\"stickyToolbar\"\n [class.wu-editor-source-mode]=\"sourceMode\"\n [ngClass]=\"styleClass || ''\"\n>\n <div\n *ngIf=\"headerTemplate || groups.length\"\n #toolbarEl\n class=\"wu-editor-toolbar p-editor-toolbar\"\n role=\"toolbar\"\n [attr.aria-label]=\"m.toolbar\"\n [attr.aria-controls]=\"areaId\"\n (mousedown)=\"toolbarMouseDown($event)\"\n (keydown)=\"toolbarKeydown($event)\"\n >\n <ng-container *ngIf=\"headerTemplate; else ownTools\">\n <ng-container *ngTemplateOutlet=\"headerTemplate\"></ng-container>\n </ng-container>\n <ng-template #ownTools>\n <span *ngFor=\"let group of groups\" class=\"wu-editor-group\" role=\"group\">\n <button\n *ngFor=\"let t of group\"\n type=\"button\"\n class=\"wu-editor-tool\"\n tabindex=\"-1\"\n [class.wu-editor-dropdown]=\"isDropdown(t)\"\n [class.wu-editor-tool-on]=\"isOn(t)\"\n [class.wu-editor-tool-open]=\"panelOpenFor(t)\"\n [attr.data-wu-tool]=\"t\"\n [disabled]=\"isDisabled(t)\"\n [attr.aria-pressed]=\"hasMenu(t) ? null : isOn(t)\"\n [attr.aria-haspopup]=\"hasMenu(t) ? 'true' : null\"\n [attr.aria-expanded]=\"hasMenu(t) ? panelOpenFor(t) : null\"\n [attr.aria-label]=\"toolLabel(t)\"\n [attr.title]=\"toolLabel(t)\"\n (click)=\"runTool(t, $event)\"\n >\n <ng-container *ngIf=\"isDropdown(t); else iconTool\">\n <span class=\"wu-editor-dropdown-label\">{{ dropdownLabel(t) }}</span>\n <span class=\"wu-editor-chevron-wrap\" wuEditorIcon=\"chevron\"></span>\n </ng-container>\n <ng-template #iconTool><span class=\"wu-editor-icon-wrap\" [wuEditorIcon]=\"toolIcon(t)\"></span></ng-template>\n </button>\n </span>\n </ng-template>\n </div>\n\n <div class=\"wu-editor-body\">\n <div\n #area\n class=\"wu-editor-area wu-editor-content p-editor-content\"\n role=\"textbox\"\n aria-multiline=\"true\"\n spellcheck=\"true\"\n [id]=\"areaId\"\n [class.wu-editor-hidden]=\"sourceMode\"\n [class.wu-editor-empty]=\"empty\"\n [attr.aria-label]=\"ariaLabelledBy ? null : areaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledBy || null\"\n [attr.aria-readonly]=\"readonly || null\"\n [attr.aria-disabled]=\"disabled || null\"\n [attr.data-placeholder]=\"placeholder || null\"\n [ngStyle]=\"style || null\"\n (input)=\"areaInput()\"\n (keydown)=\"areaKeydown($event)\"\n (focus)=\"areaFocus($event)\"\n (blur)=\"areaBlur($event)\"\n (click)=\"areaClick($event)\"\n (paste)=\"areaPaste($event)\"\n (dragover)=\"areaDragOver($event)\"\n (drop)=\"areaDrop($event)\"\n ></div>\n <textarea\n *ngIf=\"sourceMode\"\n class=\"wu-editor-source wu-inputtext p-inputtext\"\n spellcheck=\"false\"\n [value]=\"sourceText\"\n [ngStyle]=\"style || null\"\n [attr.aria-label]=\"m.source\"\n (input)=\"sourceInput($event)\"\n ></textarea>\n <div #frameEl class=\"wu-editor-image-frame\" style=\"display: none\" aria-hidden=\"true\">\n <span class=\"wu-editor-image-handle\" [attr.title]=\"m.imageResize\" (pointerdown)=\"resizeStart($event)\"></span>\n </div>\n </div>\n\n <div *ngIf=\"notices.length || showCount\" class=\"wu-editor-footer\">\n <div *ngFor=\"let n of notices; let i = index\" class=\"wu-editor-notice\" role=\"alert\">\n <span>{{ n }}</span>\n <button type=\"button\" class=\"wu-editor-notice-close\" [attr.aria-label]=\"t.close\" (click)=\"dismissNotice(i)\">\u00D7</button>\n </div>\n <span *ngIf=\"showCount\" class=\"wu-editor-count\">{{ countText }}</span>\n </div>\n\n <input #imageInput type=\"file\" class=\"wu-editor-file\" tabindex=\"-1\" aria-hidden=\"true\" multiple [attr.accept]=\"acceptImages\" (change)=\"imageFilesChosen($event)\" />\n\n <div *ngIf=\"panel\" #panelEl class=\"wu-editor-panel\" popover=\"manual\" [attr.data-wu-panel]=\"panel\" (keydown)=\"panelKeydown($event)\" [ngSwitch]=\"panel\">\n <div *ngSwitchCase=\"'heading'\" class=\"wu-editor-menu\" role=\"menu\" [attr.aria-label]=\"m.blockStyle\">\n <button *ngFor=\"let h of opts.headings\" type=\"button\" role=\"menuitemradio\" [class]=\"'wu-editor-menu-item wu-editor-block-' + h\" [attr.aria-checked]=\"state.heading === h && !state.codeBlock && !state.blockquote\" (click)=\"pickHeading(h)\">\n {{ headingLabel(h) }}\n </button>\n <div *ngIf=\"opts.blocks.length\" class=\"wu-editor-menu-sep\" role=\"separator\"></div>\n <button\n *ngFor=\"let b of opts.blocks\"\n type=\"button\"\n role=\"menuitemradio\"\n [class]=\"'wu-editor-menu-item wu-editor-block-' + b\"\n [attr.aria-checked]=\"b === 'blockquote' ? !!state.blockquote : !!state.codeBlock\"\n (click)=\"pickBlock(b)\"\n >\n {{ b === 'blockquote' ? m.blockquote : m.codeBlock }}\n </button>\n </div>\n <div *ngSwitchCase=\"'fontSize'\" class=\"wu-editor-menu\" role=\"menu\" [attr.aria-label]=\"m.fontSize\">\n <button *ngFor=\"let s of fontSizes\" type=\"button\" role=\"menuitemradio\" class=\"wu-editor-menu-item\" [style.font-size]=\"s.value || null\" [attr.aria-checked]=\"state.fontSize === s.value\" (click)=\"pickSize(s.value)\">{{ s.label }}</button>\n </div>\n <div *ngSwitchCase=\"'fontFamily'\" class=\"wu-editor-menu\" role=\"menu\" [attr.aria-label]=\"m.fontFamily\">\n <button *ngFor=\"let f of fontFamilies\" type=\"button\" role=\"menuitemradio\" class=\"wu-editor-menu-item\" [style.font-family]=\"f.value || null\" [attr.aria-checked]=\"state.fontFamily === f.value\" (click)=\"pickFont(f.value)\">{{ f.label }}</button>\n </div>\n <div *ngSwitchCase=\"'align'\" class=\"wu-editor-menu wu-editor-menu-icons\" role=\"menu\" [attr.aria-label]=\"m.align\">\n <button *ngFor=\"let a of opts.alignments\" type=\"button\" role=\"menuitemradio\" class=\"wu-editor-menu-item\" [attr.aria-checked]=\"state.align === a\" (click)=\"pickAlign(a)\">\n <span class=\"wu-editor-icon-wrap\" [wuEditorIcon]=\"alignIcon(a)\"></span>\n <span>{{ alignLabel(a) }}</span>\n </button>\n </div>\n <ng-container *ngSwitchCase=\"'color'\">\n <ng-container *ngTemplateOutlet=\"palette; context: { kind: 'color', colors: opts.colors }\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'highlight'\">\n <ng-container *ngTemplateOutlet=\"palette; context: { kind: 'highlight', colors: opts.highlights }\"></ng-container>\n </ng-container>\n <form *ngSwitchCase=\"'link'\" class=\"wu-editor-form\" (submit)=\"$event.preventDefault(); applyLink()\">\n <label class=\"wu-editor-field\">\n <span>{{ m.linkUrl }}</span>\n <input class=\"wu-inputtext p-inputtext\" type=\"text\" inputmode=\"url\" autocomplete=\"off\" name=\"url\" placeholder=\"https://\" [value]=\"linkForm.url\" (input)=\"linkForm.url = $any($event.target).value; linkForm.error = ''\" />\n </label>\n <label *ngIf=\"linkForm.showText\" class=\"wu-editor-field\">\n <span>{{ m.linkText }}</span>\n <input class=\"wu-inputtext p-inputtext\" type=\"text\" name=\"text\" [value]=\"linkForm.text\" (input)=\"linkForm.text = $any($event.target).value\" />\n </label>\n <label class=\"wu-editor-check\">\n <input type=\"checkbox\" name=\"newTab\" [checked]=\"linkForm.newTab\" (change)=\"linkForm.newTab = $any($event.target).checked\" />\n <span>{{ m.linkNewTab }}</span>\n </label>\n <div *ngIf=\"linkForm.error\" class=\"wu-editor-form-error\" role=\"alert\">{{ linkForm.error }}</div>\n <div class=\"wu-editor-form-actions\">\n <button *ngIf=\"state.link\" type=\"button\" [class]=\"buttonClass('p-button-text p-button-danger p-button-sm')\" (click)=\"unlink()\">{{ m.unlink }}</button>\n <button type=\"submit\" [class]=\"buttonClass('p-button-sm')\">{{ m.apply }}</button>\n </div>\n </form>\n <div *ngSwitchCase=\"'linkMenu'\" class=\"wu-editor-balloon\">\n <a class=\"wu-editor-balloon-link\" [attr.href]=\"currentLinkHref() || null\" target=\"_blank\" rel=\"noopener noreferrer\" [attr.title]=\"m.openLink\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"external\"></span>\n <span class=\"wu-editor-balloon-url\">{{ currentLinkHref() }}</span>\n </a>\n <button type=\"button\" class=\"wu-editor-tool\" [attr.aria-label]=\"m.editLink\" [attr.title]=\"m.editLink\" (click)=\"openPanel('link', panelAnchor)\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"edit\"></span>\n </button>\n <button type=\"button\" class=\"wu-editor-tool\" [attr.aria-label]=\"m.unlink\" [attr.title]=\"m.unlink\" (click)=\"unlink()\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"unlink\"></span>\n </button>\n </div>\n <div *ngSwitchCase=\"'image'\" class=\"wu-editor-image-form\">\n <div class=\"wu-editor-tabs\" role=\"tablist\">\n <button type=\"button\" role=\"tab\" class=\"wu-editor-tab\" [attr.aria-selected]=\"imageForm.tab === 'upload'\" (click)=\"imageForm.tab = 'upload'\">{{ m.imageUpload }}</button>\n <button type=\"button\" role=\"tab\" class=\"wu-editor-tab\" [attr.aria-selected]=\"imageForm.tab === 'url'\" (click)=\"imageForm.tab = 'url'\">{{ m.imageFromUrl }}</button>\n </div>\n <button *ngIf=\"imageForm.tab === 'upload'; else urlForm\" type=\"button\" class=\"wu-editor-drop\" (click)=\"chooseImage()\" (dragover)=\"$event.preventDefault()\" (drop)=\"imagePanelDrop($event)\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"upload\"></span>\n <span>{{ m.imageDrop }}</span>\n </button>\n <ng-template #urlForm>\n <form class=\"wu-editor-form\" (submit)=\"$event.preventDefault(); insertImageUrl()\">\n <label class=\"wu-editor-field\">\n <span>{{ m.imageUrl }}</span>\n <input class=\"wu-inputtext p-inputtext\" type=\"text\" inputmode=\"url\" name=\"src\" placeholder=\"https://\" [value]=\"imageForm.url\" (input)=\"imageForm.url = $any($event.target).value; imageForm.error = ''\" />\n </label>\n <label class=\"wu-editor-field\">\n <span>{{ m.imageAlt }}</span>\n <input class=\"wu-inputtext p-inputtext\" type=\"text\" name=\"alt\" [value]=\"imageForm.alt\" (input)=\"imageForm.alt = $any($event.target).value\" />\n </label>\n <div *ngIf=\"imageForm.error\" class=\"wu-editor-form-error\" role=\"alert\">{{ imageForm.error }}</div>\n <div class=\"wu-editor-form-actions\">\n <button type=\"submit\" [class]=\"buttonClass('p-button-sm')\">{{ m.apply }}</button>\n </div>\n </form>\n </ng-template>\n </div>\n <div *ngSwitchCase=\"'imageMenu'\" class=\"wu-editor-balloon wu-editor-image-menu\">\n <span class=\"wu-editor-balloon-group\" role=\"group\">\n <button\n *ngFor=\"let a of imageAligns\"\n type=\"button\"\n class=\"wu-editor-tool\"\n [class.wu-editor-tool-on]=\"imageAlignIs(a)\"\n [attr.aria-pressed]=\"imageAlignIs(a)\"\n [attr.aria-label]=\"imageAlignLabel(a)\"\n [attr.title]=\"imageAlignLabel(a)\"\n (click)=\"setImageAlign(a)\"\n >\n <span class=\"wu-editor-icon-wrap\" [wuEditorIcon]=\"'image' + a[0].toUpperCase() + a.slice(1)\"></span>\n </button>\n </span>\n <span class=\"wu-editor-balloon-group\" role=\"group\" [attr.aria-label]=\"m.imageWidth\">\n <button *ngFor=\"let w of imageWidths\" type=\"button\" class=\"wu-editor-tool wu-editor-tool-text\" (click)=\"setImageWidth(w)\">{{ w }}%</button>\n <button type=\"button\" class=\"wu-editor-tool wu-editor-tool-text\" (click)=\"setImageWidth(null)\">{{ m.imageOriginal }}</button>\n </span>\n <input class=\"wu-inputtext p-inputtext wu-editor-alt\" type=\"text\" [attr.placeholder]=\"m.imageAlt\" [attr.aria-label]=\"m.imageAlt\" [value]=\"selectedImage?.getAttribute('alt') || ''\" (change)=\"setImageAlt($event)\" />\n <button type=\"button\" class=\"wu-editor-tool wu-editor-tool-danger\" [attr.aria-label]=\"m.imageRemove\" [attr.title]=\"m.imageRemove\" (click)=\"removeImage()\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"trash\"></span>\n </button>\n </div>\n <div *ngSwitchCase=\"'table'\" class=\"wu-editor-table-insert\">\n <div class=\"wu-editor-grid\" role=\"grid\" tabindex=\"0\" [attr.aria-label]=\"m.insertTable\" (keydown)=\"gridKeydown($event)\" (mouseleave)=\"gridMove(0, 0)\">\n <div *ngFor=\"let r of gridRows()\" class=\"wu-editor-grid-row\" role=\"row\">\n <button\n *ngFor=\"let c of gridCols()\"\n type=\"button\"\n role=\"gridcell\"\n tabindex=\"-1\"\n class=\"wu-editor-grid-cell\"\n [class.wu-editor-grid-on]=\"r <= gridHover.rows && c <= gridHover.cols\"\n [attr.aria-label]=\"m.tableSize.replace('{0}', '' + r).replace('{1}', '' + c)\"\n (mouseenter)=\"gridMove(r, c)\"\n (focus)=\"gridMove(r, c)\"\n (click)=\"insertTable(r, c)\"\n ></button>\n </div>\n <div class=\"wu-editor-grid-label\" aria-live=\"polite\">{{ gridLabel }}</div>\n </div>\n <div class=\"wu-editor-table-size\">\n <label class=\"wu-editor-table-size-field\">\n <span>{{ m.tableRows }}</span>\n <input class=\"wu-inputtext p-inputtext\" type=\"number\" min=\"1\" max=\"100\" inputmode=\"numeric\" [value]=\"tableForm.rows\" (input)=\"setTableForm('rows', $event)\" (keydown.enter)=\"$event.preventDefault(); insertCustomTable()\" />\n </label>\n <label class=\"wu-editor-table-size-field\">\n <span>{{ m.tableCols }}</span>\n <input class=\"wu-inputtext p-inputtext\" type=\"number\" min=\"1\" max=\"30\" inputmode=\"numeric\" [value]=\"tableForm.cols\" (input)=\"setTableForm('cols', $event)\" (keydown.enter)=\"$event.preventDefault(); insertCustomTable()\" />\n </label>\n <label class=\"wu-editor-check wu-editor-table-size-header\">\n <input type=\"checkbox\" [checked]=\"tableForm.header\" (change)=\"setTableHeader($event)\" />\n <span>{{ m.headerRow }}</span>\n </label>\n <button type=\"button\" class=\"wu-btn p-button wu-btn-sm p-button-sm wu-editor-table-size-insert\" (click)=\"insertCustomTable()\">{{ m.insert }}</button>\n </div>\n </div>\n <div *ngSwitchCase=\"'tableBar'\" class=\"wu-editor-balloon wu-editor-table-bar\" role=\"toolbar\" [attr.aria-label]=\"m.tableTools\">\n <span class=\"wu-editor-balloon-group\" role=\"group\">\n <button *ngFor=\"let a of tableInserts\" type=\"button\" class=\"wu-editor-tool\" [attr.aria-label]=\"$any(m)[a]\" [attr.title]=\"$any(m)[a]\" (click)=\"tableAction(a)\">\n <span class=\"wu-editor-icon-wrap\" [wuEditorIcon]=\"a\"></span>\n </button>\n </span>\n <span class=\"wu-editor-balloon-group\" role=\"group\">\n <button type=\"button\" class=\"wu-editor-tool\" [disabled]=\"!canMergePicked\" [attr.aria-label]=\"cellPick ? m.mergeCells : m.mergeRight\" [attr.title]=\"cellPick ? m.mergeCells : m.mergeRight\" (click)=\"tableAction('mergeCells')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"mergeRight\"></span>\n </button>\n <button type=\"button\" class=\"wu-editor-tool\" [disabled]=\"!canSplit()\" [attr.aria-label]=\"m.splitCell\" [attr.title]=\"m.splitCell\" (click)=\"tableAction('splitCell')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"splitCell\"></span>\n </button>\n <button type=\"button\" class=\"wu-editor-tool\" [class.wu-editor-tool-on]=\"inHeaderRow\" [attr.aria-pressed]=\"inHeaderRow\" [attr.aria-label]=\"m.headerRow\" [attr.title]=\"m.headerRow\" (click)=\"tableAction('headerRow')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"headerRow\"></span>\n </button>\n </span>\n <span class=\"wu-editor-balloon-group\" role=\"group\">\n <button type=\"button\" class=\"wu-editor-tool\" [attr.aria-label]=\"m.deleteRow\" [attr.title]=\"m.deleteRow\" (click)=\"tableAction('deleteRow')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"deleteRow\"></span>\n </button>\n <button type=\"button\" class=\"wu-editor-tool\" [attr.aria-label]=\"m.deleteCol\" [attr.title]=\"m.deleteCol\" (click)=\"tableAction('deleteCol')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"deleteCol\"></span>\n </button>\n <button type=\"button\" class=\"wu-editor-tool wu-editor-tool-danger\" [attr.aria-label]=\"m.deleteTable\" [attr.title]=\"m.deleteTable\" (click)=\"tableAction('deleteTable')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"trash\"></span>\n </button>\n </span>\n </div>\n <div *ngSwitchCase=\"'tableMenu'\" class=\"wu-editor-menu wu-editor-menu-icons\" role=\"menu\" [attr.aria-label]=\"m.table\">\n <button *ngFor=\"let a of tableInserts\" type=\"button\" role=\"menuitem\" class=\"wu-editor-menu-item\" (click)=\"tableAction(a)\">\n <span class=\"wu-editor-icon-wrap\" [wuEditorIcon]=\"a\"></span><span>{{ $any(m)[a] }}</span>\n </button>\n <div class=\"wu-editor-menu-sep\" role=\"separator\"></div>\n <button type=\"button\" role=\"menuitemcheckbox\" class=\"wu-editor-menu-item\" [attr.aria-checked]=\"inHeaderRow\" (click)=\"tableAction('headerRow')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"headerRow\"></span><span>{{ m.headerRow }}</span>\n </button>\n <button *ngIf=\"cellPick\" type=\"button\" role=\"menuitem\" class=\"wu-editor-menu-item\" [disabled]=\"!canMergePicked\" (click)=\"tableAction('mergeCells')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"mergeRight\"></span><span>{{ m.mergeCells }}</span>\n </button>\n <button type=\"button\" role=\"menuitem\" class=\"wu-editor-menu-item\" [disabled]=\"!canMerge('right')\" (click)=\"tableAction('mergeRight')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"mergeRight\"></span><span>{{ m.mergeRight }}</span>\n </button>\n <button type=\"button\" role=\"menuitem\" class=\"wu-editor-menu-item\" [disabled]=\"!canMerge('down')\" (click)=\"tableAction('mergeDown')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"mergeDown\"></span><span>{{ m.mergeDown }}</span>\n </button>\n <button type=\"button\" role=\"menuitem\" class=\"wu-editor-menu-item\" [disabled]=\"!canSplit()\" (click)=\"tableAction('splitCell')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"splitCell\"></span><span>{{ m.splitCell }}</span>\n </button>\n <div class=\"wu-editor-menu-sep\" role=\"separator\"></div>\n <button type=\"button\" role=\"menuitem\" class=\"wu-editor-menu-item\" (click)=\"tableAction('deleteRow')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"deleteRow\"></span><span>{{ m.deleteRow }}</span>\n </button>\n <button type=\"button\" role=\"menuitem\" class=\"wu-editor-menu-item\" (click)=\"tableAction('deleteCol')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"deleteCol\"></span><span>{{ m.deleteCol }}</span>\n </button>\n <button type=\"button\" role=\"menuitem\" class=\"wu-editor-menu-item wu-editor-menu-danger\" (click)=\"tableAction('deleteTable')\">\n <span class=\"wu-editor-icon-wrap\" wuEditorIcon=\"trash\"></span><span>{{ m.deleteTable }}</span>\n </button>\n </div>\n </div>\n</div>\n\n<ng-template #palette let-kind=\"kind\" let-colors=\"colors\">\n <div class=\"wu-editor-palette\" role=\"menu\" [attr.aria-label]=\"kind === 'color' ? m.color : m.highlight\">\n <button type=\"button\" role=\"menuitem\" class=\"wu-editor-menu-item wu-editor-palette-none\" (click)=\"pickColor(kind, null)\">\n <span class=\"wu-editor-swatch wu-editor-swatch-none\" aria-hidden=\"true\"></span>{{ m.removeColor }}\n </button>\n <div class=\"wu-editor-swatches\">\n <button *ngFor=\"let c of colors\" type=\"button\" role=\"menuitem\" class=\"wu-editor-swatch\" [style.background]=\"c\" [attr.aria-label]=\"c\" [attr.title]=\"c\" (click)=\"pickColor(kind, c)\"></button>\n </div>\n <label class=\"wu-editor-custom-color\">\n <input type=\"color\" (change)=\"customColor(kind, $event)\" />\n <span>{{ m.customColor }}</span>\n </label>\n </div>\n</ng-template>\n", styles: ["@layer wiraui.components{wu-editor{display:block;max-width:100%}.wu-editor{position:relative;display:flex;flex-direction:column;min-width:0;font-family:var(--wu-font-family);font-size:var(--wu-font-size);color:var(--wu-text)}.wu-editor-hidden,.wu-editor-file{display:none!important}.wu-editor-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:.25rem;padding:var(--wu-editor-toolbar-padding);border:1px solid var(--wu-field-border);border-bottom-color:var(--wu-border);border-radius:var(--wu-editor-radius) var(--wu-editor-radius) 0 0;background:var(--wu-editor-toolbar-bg)}.wu-editor-sticky .wu-editor-toolbar{position:sticky;top:var(--wu-editor-sticky-top, 0px);z-index:2}.wu-editor-group,.wu-editor-toolbar .ql-formats{display:inline-flex;flex-wrap:wrap;align-items:center;gap:2px}.wu-editor-group+.wu-editor-group,.wu-editor-toolbar .ql-formats+.ql-formats{margin-left:.125rem;padding-left:.375rem;border-left:1px solid var(--wu-border)}.wu-editor-tool,.wu-editor-toolbar .ql-formats>button{display:inline-flex;align-items:center;justify-content:center;gap:.25rem;box-sizing:border-box;min-width:var(--wu-editor-tool-size);height:var(--wu-editor-tool-size);margin:0;padding:0 .375rem;border:0;border-radius:var(--wu-editor-tool-radius);background:transparent;color:var(--wu-text);font:inherit;font-size:.875em;line-height:1;white-space:nowrap;cursor:pointer;transition:background-color var(--wu-transition),color var(--wu-transition)}.wu-editor-tool:not(:disabled):hover{background:var(--wu-editor-tool-hover-bg)}.wu-editor-tool.wu-editor-tool-on,.wu-editor-tool.wu-editor-tool-open{background:var(--wu-editor-tool-on-bg);color:var(--wu-editor-tool-on-color)}.wu-editor-tool:disabled{opacity:var(--wu-disabled-opacity);cursor:default}.wu-editor-tool:focus-visible{outline:var(--wu-control-focus-outline);outline-offset:-1px}.wu-editor-icon-wrap,.wu-editor-chevron-wrap{display:inline-flex}.wu-editor-icon{width:1.25rem;height:1.25rem}.wu-editor-chevron{width:.875rem;height:.875rem;opacity:.7}.wu-editor-dropdown{justify-content:space-between;padding:0 .375rem 0 .5rem}.wu-editor-dropdown-label{min-width:4.5rem;max-width:9rem;overflow:hidden;text-align:start;text-overflow:ellipsis}.wu-editor-heading-mark{font-weight:700;font-size:.875em}.wu-editor-tool-text{font-size:.8125em}.wu-editor-tool-danger:not(:disabled):hover{background:var(--wu-danger-bg);color:var(--wu-danger-text)}.wu-editor-body{position:relative;display:flex;flex:1 1 auto;flex-direction:column;min-height:0}.wu-editor-area{position:relative;box-sizing:border-box;min-height:var(--wu-editor-content-min-height);padding:var(--wu-editor-content-padding-y) var(--wu-editor-content-padding-x);border:1px solid var(--wu-field-border);border-radius:var(--wu-editor-radius);background:var(--wu-field-bg);outline:none;overflow:auto;overscroll-behavior:contain;transition:border-color var(--wu-transition),box-shadow var(--wu-transition)}.wu-editor-toolbar+.wu-editor-body>.wu-editor-area,.wu-editor-toolbar+.wu-editor-body>.wu-editor-source{border-top:0;border-radius:0 0 var(--wu-editor-radius) var(--wu-editor-radius)}.wu-editor-focused .wu-editor-area{border-color:var(--wu-primary-color);box-shadow:var(--wu-control-focus-shadow)}.wu-editor-area.wu-editor-empty:before{content:attr(data-placeholder);position:absolute;top:var(--wu-editor-content-padding-y);right:var(--wu-editor-content-padding-x);left:var(--wu-editor-content-padding-x);color:var(--wu-field-placeholder);pointer-events:none}.wu-editor-disabled .wu-editor-area{opacity:var(--wu-disabled-opacity)}.wu-editor-readonly .wu-editor-area{background:var(--wu-editor-toolbar-bg)}.wu-editor-source{box-sizing:border-box;width:100%;min-height:var(--wu-editor-content-min-height);resize:vertical;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.875em;line-height:1.5}.wu-editor-content{line-height:1.6;overflow-wrap:break-word;white-space:pre-wrap;tab-size:4}.wu-editor-view{display:block;color:var(--wu-text)}.wu-editor-content:after{content:\"\";display:table;clear:both}.wu-editor-content>:first-child{margin-top:0}.wu-editor-content :is(p,ol,ul,pre,blockquote,h1,h2,h3,h4,h5,h6){margin:0;padding:0}.wu-editor-content h1{font-size:2em;line-height:1.25}.wu-editor-content h2{font-size:1.5em;line-height:1.3}.wu-editor-content h3{font-size:1.25em}.wu-editor-content h4{font-size:1.1em}.wu-editor-content :is(h1,h2,h3,h4,h5,h6){font-weight:600}.wu-editor-content :is(ol,ul){padding-left:1.5em}.wu-editor-content li>:is(ol,ul){margin:0}.wu-editor-content blockquote{margin:.5em 0;padding:.25em 0 .25em 1em;border-left:4px solid var(--wu-border);color:var(--wu-text-muted)}.wu-editor-content pre{margin:.5em 0;padding:.75em 1em;border-radius:var(--wu-radius-sm);background:var(--wu-hover-bg);font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.875em;white-space:pre-wrap;overflow-x:auto}.wu-editor-content code{padding:.1em .3em;border-radius:3px;background:var(--wu-hover-bg);font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.875em}.wu-editor-content pre code{padding:0;background:none;font-size:inherit}.wu-editor-content a{color:var(--wu-primary-color);text-decoration:underline}.wu-editor-content hr{margin:1em 0;border:0;border-top:1px solid var(--wu-border)}.wu-editor-content img{max-width:100%;height:auto;vertical-align:bottom}.wu-editor-content img.wu-image-left{float:left;margin:.25em 1em .5em 0}.wu-editor-content img.wu-image-right{float:right;margin:.25em 0 .5em 1em}.wu-editor-content img.wu-image-center{display:block;margin:.5em auto}.wu-editor-content table{margin:.5em 0;border-collapse:collapse;max-width:100%}.wu-editor-content :is(td,th){min-width:2.5em;padding:.375em .5em;border:1px solid var(--wu-border);text-align:start;vertical-align:top}.wu-editor-content th{background:var(--wu-hover-bg);font-weight:600}.wu-editor-content table:has(> colgroup){table-layout:fixed}.wu-editor-content :is(td,th){overflow-wrap:anywhere}.wu-editor-area .wu-editor-cell-picked{background:color-mix(in srgb,var(--wu-primary-color) 14%,transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--wu-primary-color) 60%,transparent)}.wu-editor-picking ::selection{background:transparent}.wu-editor-col-resize,.wu-editor-col-resize *,.wu-editor-resizing,.wu-editor-resizing *{cursor:col-resize!important}.wu-editor-resizing{-webkit-user-select:none;user-select:none}.wu-editor-content .ql-align-center{text-align:center}.wu-editor-content .ql-align-right{text-align:right}.wu-editor-content .ql-align-justify{text-align:justify}.wu-editor-content .ql-size-small{font-size:.75em}.wu-editor-content .ql-size-large{font-size:1.5em}.wu-editor-content .ql-size-huge{font-size:2.5em}.wu-editor-content .ql-font-serif{font-family:Georgia,Times New Roman,serif}.wu-editor-content .ql-font-monospace{font-family:Monaco,Courier New,monospace}.wu-editor-content .ql-indent-1{padding-left:3em}.wu-editor-content .ql-indent-2{padding-left:6em}.wu-editor-content .ql-indent-3{padding-left:9em}.wu-editor-content .ql-indent-4{padding-left:12em}.wu-editor-content .ql-indent-5{padding-left:15em}.wu-editor-content .ql-indent-6{padding-left:18em}.wu-editor-content .ql-indent-7{padding-left:21em}.wu-editor-content .ql-indent-8{padding-left:24em}.wu-editor-content li.ql-indent-1{margin-left:3em;padding-left:0}.wu-editor-content li.ql-indent-2{margin-left:6em;padding-left:0}.wu-editor-content li.ql-indent-3{margin-left:9em;padding-left:0}.wu-editor-content li.ql-indent-4{margin-left:12em;padding-left:0}.wu-editor-area img.wu-image-selected{outline:2px solid var(--wu-primary-color);outline-offset:1px}.wu-editor-area img.wu-image-uploading{opacity:.5;animation:wu-editor-pulse 1.2s ease-in-out infinite}.wu-editor-area :is(td,th):focus-within{outline:2px solid color-mix(in srgb,var(--wu-primary-color) 45%,transparent);outline-offset:-2px}.wu-editor-image-frame{position:absolute;box-sizing:border-box;pointer-events:none}.wu-editor-image-handle{position:absolute;right:-7px;bottom:-7px;box-sizing:border-box;width:14px;height:14px;border:2px solid var(--wu-card-bg);border-radius:3px;background:var(--wu-primary-color);cursor:nwse-resize;pointer-events:auto;touch-action:none}.wu-editor-readonly .wu-editor-image-frame,.wu-editor-disabled .wu-editor-image-frame{display:none!important}.wu-editor-footer{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.5rem;padding:.375rem .125rem 0;font-size:.8125em;color:var(--wu-text-muted)}.wu-editor-count{margin-left:auto}.wu-editor-notice{display:inline-flex;align-items:center;gap:.5rem;padding:.25rem .5rem;border-radius:var(--wu-radius-sm);background:var(--wu-danger-bg);color:var(--wu-danger-text)}.wu-editor-notice-close{padding:0 .25rem;border:0;background:none;color:inherit;font:inherit;cursor:pointer}.wu-editor.wu-editor-fullscreen{position:fixed;inset:0;z-index:1100;box-sizing:border-box;width:100%;max-width:none;height:100%;max-height:none;margin:0;padding:.75rem;border:0;overflow:hidden;background:var(--wu-ground, var(--wu-card-bg));color:var(--wu-text)}.wu-editor-fullscreen .wu-editor-area,.wu-editor-fullscreen .wu-editor-source{flex:1 1 auto;height:auto!important;max-height:none!important}.wu-editor-panel{position:fixed;inset:auto;z-index:1200;box-sizing:border-box;max-width:min(24rem,calc(100vw - 1rem));margin:0;padding:.375rem;overflow:auto;border:1px solid var(--wu-border);border-radius:var(--wu-radius-md);background:var(--wu-card-bg);color:var(--wu-text);box-shadow:var(--wu-shadow-md);font-family:var(--wu-font-family);font-size:var(--wu-font-size)}.wu-editor-menu{display:flex;flex-direction:column;gap:2px;min-width:11rem}.wu-editor-menu-item{display:flex;align-items:center;gap:.5rem;width:100%;padding:.4375rem .625rem;border:0;border-radius:var(--wu-radius-sm);background:none;color:inherit;font:inherit;text-align:start;cursor:pointer}.wu-editor-menu-item:not(:disabled):hover,.wu-editor-menu-item:focus-visible{background:var(--wu-editor-tool-hover-bg);outline:none}.wu-editor-menu-item[aria-checked=true]{background:var(--wu-editor-tool-on-bg);color:var(--wu-editor-tool-on-color)}.wu-editor-menu-item:disabled{opacity:var(--wu-disabled-opacity);cursor:default}.wu-editor-menu-danger{color:var(--wu-danger-color)}.wu-editor-menu-sep{height:1px;margin:.25rem 0;background:var(--wu-border)}.wu-editor-block-1{font-size:1.5em;font-weight:600}.wu-editor-block-2{font-size:1.3em;font-weight:600}.wu-editor-block-3{font-size:1.15em;font-weight:600}.wu-editor-block-4{font-size:1.05em;font-weight:600}.wu-editor-block-5{font-weight:600}.wu-editor-block-6{font-size:.875em;font-weight:600;text-transform:uppercase;letter-spacing:.02em}.wu-editor-block-blockquote{border-left:3px solid var(--wu-border);font-style:italic}.wu-editor-block-codeBlock{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.875em}.wu-editor-palette{display:flex;flex-direction:column;gap:.375rem;width:14.5rem}.wu-editor-swatches{display:grid;grid-template-columns:repeat(6,1fr);gap:.375rem}.wu-editor-swatch{box-sizing:border-box;width:100%;aspect-ratio:1;padding:0;border:1px solid color-mix(in srgb,var(--wu-text) 18%,transparent);border-radius:var(--wu-radius-sm);cursor:pointer}.wu-editor-palette-none .wu-editor-swatch{width:1.25rem;flex:none}.wu-editor-swatch-none{background:linear-gradient(135deg,transparent 45%,var(--wu-danger-color) 45%,var(--wu-danger-color) 55%,transparent 55%),var(--wu-card-bg)}.wu-editor-swatch:hover,.wu-editor-swatch:focus-visible{outline:2px solid var(--wu-primary-color);outline-offset:1px}.wu-editor-custom-color{display:flex;align-items:center;gap:.5rem;font-size:.875em;cursor:pointer}.wu-editor-custom-color input{width:2rem;height:1.75rem;padding:0;border:0;background:none;cursor:pointer}.wu-editor-form,.wu-editor-image-form{display:flex;flex-direction:column;gap:.625rem;width:min(20rem,calc(100vw - 2.5rem));padding:.25rem}.wu-editor-field{display:flex;flex-direction:column;gap:.25rem;font-size:.875em}.wu-editor-field .wu-inputtext{width:100%;box-sizing:border-box}.wu-editor-check{display:flex;align-items:center;gap:.5rem;font-size:.875em}.wu-editor-form-error{color:var(--wu-danger-color);font-size:.875em}.wu-editor-form-actions{display:flex;justify-content:flex-end;gap:.5rem}.wu-editor-tabs{display:flex;gap:.25rem;border-bottom:1px solid var(--wu-border)}.wu-editor-tab{margin-bottom:-1px;padding:.375rem .75rem;border:0;border-bottom:2px solid transparent;background:none;color:var(--wu-text-muted);font:inherit;font-size:.875em;cursor:pointer}.wu-editor-tab[aria-selected=true]{border-bottom-color:var(--wu-primary-color);color:var(--wu-primary-color);font-weight:600}.wu-editor-drop{display:flex;flex-direction:column;align-items:center;gap:.5rem;padding:1.25rem .75rem;border:1.5px dashed var(--wu-field-border);border-radius:var(--wu-radius-md);background:none;color:var(--wu-text-muted);font:inherit;font-size:.875em;text-align:center;cursor:pointer}.wu-editor-drop:hover,.wu-editor-drop:focus-visible{border-color:var(--wu-primary-color);color:var(--wu-primary-color);outline:none}.wu-editor-drop .wu-editor-icon{width:1.75rem;height:1.75rem}.wu-editor-grid{display:flex;flex-direction:column;gap:3px;padding:.125rem;outline:none}.wu-editor-grid-row{display:flex;gap:3px}.wu-editor-grid-cell{width:1.125rem;height:1.125rem;padding:0;border:1px solid var(--wu-field-border);border-radius:2px;background:var(--wu-field-bg);cursor:pointer}.wu-editor-grid-cell.wu-editor-grid-on{border-color:var(--wu-primary-color);background:color-mix(in srgb,var(--wu-primary-color) 22%,var(--wu-field-bg))}.wu-editor-grid:focus-visible{outline:var(--wu-control-focus-outline)}.wu-editor-grid-label{padding-top:.25rem;font-size:.8125em;text-align:center;color:var(--wu-text-muted)}.wu-editor-table-insert{display:flex;flex-direction:column;gap:.75rem}.wu-editor-table-size{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:.5rem;padding-top:.75rem;border-top:1px solid var(--wu-border)}.wu-editor-table-size-field{display:flex;flex-direction:column;gap:.25rem;min-width:0;color:var(--wu-text-muted);font-size:.875em}.wu-editor-table-size-field .wu-inputtext{box-sizing:border-box;width:100%;min-width:0}.wu-editor-table-size-header,.wu-editor-table-size-insert{grid-column:1 / -1}.wu-editor-table-size-insert{justify-self:end}.wu-editor-balloon{display:flex;flex-wrap:wrap;align-items:center;gap:.25rem}.wu-editor-balloon-group{display:inline-flex;gap:2px}.wu-editor-balloon-group+.wu-editor-balloon-group{padding-left:.25rem;border-left:1px solid var(--wu-border)}.wu-editor-balloon-link{display:inline-flex;align-items:center;gap:.375rem;max-width:14rem;padding:0 .375rem;color:var(--wu-primary-color);text-decoration:none}.wu-editor-balloon-url{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wu-editor-alt{width:9rem;min-width:0;height:var(--wu-editor-tool-size);box-sizing:border-box;font-size:.875em}@keyframes wu-editor-pulse{50%{opacity:.25}}@media (prefers-reduced-motion: reduce){.wu-editor-tool,.wu-editor-area{transition:none}.wu-editor-area img.wu-image-uploading{animation:none}}}\n"] }]
3012
+ }] });
3013
+
3014
+ /** Generated by tools/sync-sources.mjs from packages/styles/editor.css. */
3015
+ const WU_EDITOR_CSS = "/* wu-editor and wuEditorContent. Shared by wiraui v1, v2 and v3. A light toolbar of grouped icon buttons over a\n framed writing area, its menus in the top layer. Content keeps the spacing and class names of values saved with\n the earlier editor (paragraphs without margins, ql-align-*, ql-indent-*, ql-size-*, ql-font-*), so old and new\n content look the same in the editor and wherever wuEditorContent shows it. */\n@layer wiraui.components {\n wu-editor {\n display: block;\n max-width: 100%;\n }\n .wu-editor {\n position: relative;\n display: flex;\n flex-direction: column;\n min-width: 0;\n font-family: var(--wu-font-family);\n font-size: var(--wu-font-size);\n color: var(--wu-text);\n }\n .wu-editor-hidden,\n .wu-editor-file {\n display: none !important;\n }\n\n /* ---------- toolbar ---------- */\n .wu-editor-toolbar {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 0.25rem;\n padding: var(--wu-editor-toolbar-padding);\n border: 1px solid var(--wu-field-border);\n border-bottom-color: var(--wu-border);\n border-radius: var(--wu-editor-radius) var(--wu-editor-radius) 0 0;\n background: var(--wu-editor-toolbar-bg);\n }\n .wu-editor-sticky .wu-editor-toolbar {\n position: sticky;\n top: var(--wu-editor-sticky-top, 0px);\n z-index: 2;\n }\n .wu-editor-group,\n .wu-editor-toolbar .ql-formats {\n display: inline-flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 2px;\n }\n .wu-editor-group + .wu-editor-group,\n .wu-editor-toolbar .ql-formats + .ql-formats {\n margin-left: 0.125rem;\n padding-left: 0.375rem;\n border-left: 1px solid var(--wu-border);\n }\n .wu-editor-tool,\n .wu-editor-toolbar .ql-formats > button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 0.25rem;\n box-sizing: border-box;\n min-width: var(--wu-editor-tool-size);\n height: var(--wu-editor-tool-size);\n margin: 0;\n padding: 0 0.375rem;\n border: 0;\n border-radius: var(--wu-editor-tool-radius);\n background: transparent;\n color: var(--wu-text);\n font: inherit;\n font-size: 0.875em;\n line-height: 1;\n white-space: nowrap;\n cursor: pointer;\n transition:\n background-color var(--wu-transition),\n color var(--wu-transition);\n }\n .wu-editor-tool:not(:disabled):hover {\n background: var(--wu-editor-tool-hover-bg);\n }\n .wu-editor-tool.wu-editor-tool-on,\n .wu-editor-tool.wu-editor-tool-open {\n background: var(--wu-editor-tool-on-bg);\n color: var(--wu-editor-tool-on-color);\n }\n .wu-editor-tool:disabled {\n opacity: var(--wu-disabled-opacity);\n cursor: default;\n }\n .wu-editor-tool:focus-visible {\n outline: var(--wu-control-focus-outline);\n outline-offset: -1px;\n }\n .wu-editor-icon-wrap,\n .wu-editor-chevron-wrap {\n display: inline-flex;\n }\n .wu-editor-icon {\n width: 1.25rem;\n height: 1.25rem;\n }\n .wu-editor-chevron {\n width: 0.875rem;\n height: 0.875rem;\n opacity: 0.7;\n }\n .wu-editor-dropdown {\n justify-content: space-between;\n padding: 0 0.375rem 0 0.5rem;\n }\n .wu-editor-dropdown-label {\n min-width: 4.5rem;\n max-width: 9rem;\n overflow: hidden;\n text-align: start;\n text-overflow: ellipsis;\n }\n .wu-editor-heading-mark {\n font-weight: 700;\n font-size: 0.875em;\n }\n .wu-editor-tool-text {\n font-size: 0.8125em;\n }\n .wu-editor-tool-danger:not(:disabled):hover {\n background: var(--wu-danger-bg);\n color: var(--wu-danger-text);\n }\n\n /* ---------- writing area ---------- */\n .wu-editor-body {\n position: relative;\n display: flex;\n flex: 1 1 auto;\n flex-direction: column;\n min-height: 0;\n }\n .wu-editor-area {\n position: relative;\n box-sizing: border-box;\n min-height: var(--wu-editor-content-min-height);\n padding: var(--wu-editor-content-padding-y) var(--wu-editor-content-padding-x);\n border: 1px solid var(--wu-field-border);\n border-radius: var(--wu-editor-radius);\n background: var(--wu-field-bg);\n outline: none;\n overflow: auto;\n overscroll-behavior: contain;\n transition:\n border-color var(--wu-transition),\n box-shadow var(--wu-transition);\n }\n .wu-editor-toolbar + .wu-editor-body > .wu-editor-area,\n .wu-editor-toolbar + .wu-editor-body > .wu-editor-source {\n border-top: 0;\n border-radius: 0 0 var(--wu-editor-radius) var(--wu-editor-radius);\n }\n .wu-editor-focused .wu-editor-area {\n border-color: var(--wu-primary-color);\n box-shadow: var(--wu-control-focus-shadow);\n }\n .wu-editor-area.wu-editor-empty::before {\n content: attr(data-placeholder);\n position: absolute;\n top: var(--wu-editor-content-padding-y);\n right: var(--wu-editor-content-padding-x);\n left: var(--wu-editor-content-padding-x);\n color: var(--wu-field-placeholder);\n pointer-events: none;\n }\n .wu-editor-disabled .wu-editor-area {\n opacity: var(--wu-disabled-opacity);\n }\n .wu-editor-readonly .wu-editor-area {\n background: var(--wu-editor-toolbar-bg);\n }\n .wu-editor-source {\n box-sizing: border-box;\n width: 100%;\n min-height: var(--wu-editor-content-min-height);\n resize: vertical;\n font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n font-size: 0.875em;\n line-height: 1.5;\n }\n\n /* ---------- content: in the editor and in wuEditorContent ---------- */\n .wu-editor-content {\n line-height: 1.6;\n overflow-wrap: break-word;\n white-space: pre-wrap;\n tab-size: 4;\n }\n .wu-editor-view {\n display: block;\n color: var(--wu-text);\n }\n .wu-editor-content::after {\n content: '';\n display: table;\n clear: both;\n }\n .wu-editor-content > :first-child {\n margin-top: 0;\n }\n .wu-editor-content :is(p, ol, ul, pre, blockquote, h1, h2, h3, h4, h5, h6) {\n margin: 0;\n padding: 0;\n }\n .wu-editor-content h1 {\n font-size: 2em;\n line-height: 1.25;\n }\n .wu-editor-content h2 {\n font-size: 1.5em;\n line-height: 1.3;\n }\n .wu-editor-content h3 {\n font-size: 1.25em;\n }\n .wu-editor-content h4 {\n font-size: 1.1em;\n }\n .wu-editor-content :is(h1, h2, h3, h4, h5, h6) {\n font-weight: 600;\n }\n .wu-editor-content :is(ol, ul) {\n padding-left: 1.5em;\n }\n .wu-editor-content li > :is(ol, ul) {\n margin: 0;\n }\n .wu-editor-content blockquote {\n margin: 0.5em 0;\n padding: 0.25em 0 0.25em 1em;\n border-left: 4px solid var(--wu-border);\n color: var(--wu-text-muted);\n }\n .wu-editor-content pre {\n margin: 0.5em 0;\n padding: 0.75em 1em;\n border-radius: var(--wu-radius-sm);\n background: var(--wu-hover-bg);\n font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n font-size: 0.875em;\n white-space: pre-wrap;\n overflow-x: auto;\n }\n .wu-editor-content code {\n padding: 0.1em 0.3em;\n border-radius: 3px;\n background: var(--wu-hover-bg);\n font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n font-size: 0.875em;\n }\n .wu-editor-content pre code {\n padding: 0;\n background: none;\n font-size: inherit;\n }\n .wu-editor-content a {\n color: var(--wu-primary-color);\n text-decoration: underline;\n }\n .wu-editor-content hr {\n margin: 1em 0;\n border: 0;\n border-top: 1px solid var(--wu-border);\n }\n .wu-editor-content img {\n max-width: 100%;\n height: auto;\n vertical-align: bottom;\n }\n .wu-editor-content img.wu-image-left {\n float: left;\n margin: 0.25em 1em 0.5em 0;\n }\n .wu-editor-content img.wu-image-right {\n float: right;\n margin: 0.25em 0 0.5em 1em;\n }\n .wu-editor-content img.wu-image-center {\n display: block;\n margin: 0.5em auto;\n }\n .wu-editor-content table {\n margin: 0.5em 0;\n border-collapse: collapse;\n max-width: 100%;\n }\n .wu-editor-content :is(td, th) {\n min-width: 2.5em;\n padding: 0.375em 0.5em;\n border: 1px solid var(--wu-border);\n text-align: start;\n vertical-align: top;\n }\n .wu-editor-content th {\n background: var(--wu-hover-bg);\n font-weight: 600;\n }\n /* Column widths in % (set when the table is made or a column is dragged) are kept: the table follows the page width. */\n .wu-editor-content table:has(> colgroup) {\n table-layout: fixed;\n }\n .wu-editor-content :is(td, th) {\n overflow-wrap: anywhere;\n }\n /* Cells picked by dragging across them, for merging; the browser's own highlight hides meanwhile. */\n .wu-editor-area .wu-editor-cell-picked {\n background: color-mix(in srgb, var(--wu-primary-color) 14%, transparent);\n box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--wu-primary-color) 60%, transparent);\n }\n .wu-editor-picking ::selection {\n background: transparent;\n }\n /* A column's right edge resizes it. */\n .wu-editor-col-resize,\n .wu-editor-col-resize *,\n .wu-editor-resizing,\n .wu-editor-resizing * {\n cursor: col-resize !important;\n }\n .wu-editor-resizing {\n user-select: none;\n }\n .wu-editor-content .ql-align-center {\n text-align: center;\n }\n .wu-editor-content .ql-align-right {\n text-align: right;\n }\n .wu-editor-content .ql-align-justify {\n text-align: justify;\n }\n .wu-editor-content .ql-size-small {\n font-size: 0.75em;\n }\n .wu-editor-content .ql-size-large {\n font-size: 1.5em;\n }\n .wu-editor-content .ql-size-huge {\n font-size: 2.5em;\n }\n .wu-editor-content .ql-font-serif {\n font-family: Georgia, 'Times New Roman', serif;\n }\n .wu-editor-content .ql-font-monospace {\n font-family: Monaco, 'Courier New', monospace;\n }\n .wu-editor-content .ql-indent-1 { padding-left: 3em; }\n .wu-editor-content .ql-indent-2 { padding-left: 6em; }\n .wu-editor-content .ql-indent-3 { padding-left: 9em; }\n .wu-editor-content .ql-indent-4 { padding-left: 12em; }\n .wu-editor-content .ql-indent-5 { padding-left: 15em; }\n .wu-editor-content .ql-indent-6 { padding-left: 18em; }\n .wu-editor-content .ql-indent-7 { padding-left: 21em; }\n .wu-editor-content .ql-indent-8 { padding-left: 24em; }\n .wu-editor-content li.ql-indent-1 { margin-left: 3em; padding-left: 0; }\n .wu-editor-content li.ql-indent-2 { margin-left: 6em; padding-left: 0; }\n .wu-editor-content li.ql-indent-3 { margin-left: 9em; padding-left: 0; }\n .wu-editor-content li.ql-indent-4 { margin-left: 12em; padding-left: 0; }\n /* Inside the editor: the picture being edited and pictures still uploading. */\n .wu-editor-area img.wu-image-selected {\n outline: 2px solid var(--wu-primary-color);\n outline-offset: 1px;\n }\n .wu-editor-area img.wu-image-uploading {\n opacity: 0.5;\n animation: wu-editor-pulse 1.2s ease-in-out infinite;\n }\n .wu-editor-area :is(td, th):focus-within {\n outline: 2px solid color-mix(in srgb, var(--wu-primary-color) 45%, transparent);\n outline-offset: -2px;\n }\n\n /* Picture resize frame. */\n .wu-editor-image-frame {\n position: absolute;\n box-sizing: border-box;\n pointer-events: none;\n }\n .wu-editor-image-handle {\n position: absolute;\n right: -7px;\n bottom: -7px;\n box-sizing: border-box;\n width: 14px;\n height: 14px;\n border: 2px solid var(--wu-card-bg);\n border-radius: 3px;\n background: var(--wu-primary-color);\n cursor: nwse-resize;\n pointer-events: auto;\n touch-action: none;\n }\n .wu-editor-readonly .wu-editor-image-frame,\n .wu-editor-disabled .wu-editor-image-frame {\n display: none !important;\n }\n\n /* ---------- footer ---------- */\n .wu-editor-footer {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: space-between;\n gap: 0.5rem;\n padding: 0.375rem 0.125rem 0;\n font-size: 0.8125em;\n color: var(--wu-text-muted);\n }\n .wu-editor-count {\n margin-left: auto;\n }\n .wu-editor-notice {\n display: inline-flex;\n align-items: center;\n gap: 0.5rem;\n padding: 0.25rem 0.5rem;\n border-radius: var(--wu-radius-sm);\n background: var(--wu-danger-bg);\n color: var(--wu-danger-text);\n }\n .wu-editor-notice-close {\n padding: 0 0.25rem;\n border: 0;\n background: none;\n color: inherit;\n font: inherit;\n cursor: pointer;\n }\n\n /* ---------- full screen ---------- */\n .wu-editor.wu-editor-fullscreen {\n position: fixed;\n inset: 0;\n z-index: 1100;\n box-sizing: border-box;\n width: 100%;\n max-width: none;\n height: 100%;\n max-height: none;\n margin: 0;\n padding: 0.75rem;\n border: 0;\n overflow: hidden;\n background: var(--wu-ground, var(--wu-card-bg));\n color: var(--wu-text);\n }\n .wu-editor-fullscreen .wu-editor-area,\n .wu-editor-fullscreen .wu-editor-source {\n flex: 1 1 auto;\n height: auto !important;\n max-height: none !important;\n }\n\n /* ---------- menus and balloons (top layer) ---------- */\n .wu-editor-panel {\n position: fixed;\n inset: auto;\n z-index: 1200;\n box-sizing: border-box;\n max-width: min(24rem, calc(100vw - 1rem));\n margin: 0;\n padding: 0.375rem;\n overflow: auto;\n border: 1px solid var(--wu-border);\n border-radius: var(--wu-radius-md);\n background: var(--wu-card-bg);\n color: var(--wu-text);\n box-shadow: var(--wu-shadow-md);\n font-family: var(--wu-font-family);\n font-size: var(--wu-font-size);\n }\n .wu-editor-menu {\n display: flex;\n flex-direction: column;\n gap: 2px;\n min-width: 11rem;\n }\n .wu-editor-menu-item {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n width: 100%;\n padding: 0.4375rem 0.625rem;\n border: 0;\n border-radius: var(--wu-radius-sm);\n background: none;\n color: inherit;\n font: inherit;\n text-align: start;\n cursor: pointer;\n }\n .wu-editor-menu-item:not(:disabled):hover,\n .wu-editor-menu-item:focus-visible {\n background: var(--wu-editor-tool-hover-bg);\n outline: none;\n }\n .wu-editor-menu-item[aria-checked='true'] {\n background: var(--wu-editor-tool-on-bg);\n color: var(--wu-editor-tool-on-color);\n }\n .wu-editor-menu-item:disabled {\n opacity: var(--wu-disabled-opacity);\n cursor: default;\n }\n .wu-editor-menu-danger {\n color: var(--wu-danger-color);\n }\n .wu-editor-menu-sep {\n height: 1px;\n margin: 0.25rem 0;\n background: var(--wu-border);\n }\n .wu-editor-block-1 {\n font-size: 1.5em;\n font-weight: 600;\n }\n .wu-editor-block-2 {\n font-size: 1.3em;\n font-weight: 600;\n }\n .wu-editor-block-3 {\n font-size: 1.15em;\n font-weight: 600;\n }\n .wu-editor-block-4 {\n font-size: 1.05em;\n font-weight: 600;\n }\n .wu-editor-block-5 {\n font-weight: 600;\n }\n .wu-editor-block-6 {\n font-size: 0.875em;\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.02em;\n }\n /* Quote and code block shown as they look in the text. */\n .wu-editor-block-blockquote {\n border-left: 3px solid var(--wu-border);\n font-style: italic;\n }\n .wu-editor-block-codeBlock {\n font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n font-size: 0.875em;\n }\n .wu-editor-palette {\n display: flex;\n flex-direction: column;\n gap: 0.375rem;\n width: 14.5rem;\n }\n .wu-editor-swatches {\n display: grid;\n grid-template-columns: repeat(6, 1fr);\n gap: 0.375rem;\n }\n .wu-editor-swatch {\n box-sizing: border-box;\n width: 100%;\n aspect-ratio: 1;\n padding: 0;\n border: 1px solid color-mix(in srgb, var(--wu-text) 18%, transparent);\n border-radius: var(--wu-radius-sm);\n cursor: pointer;\n }\n .wu-editor-palette-none .wu-editor-swatch {\n width: 1.25rem;\n flex: none;\n }\n .wu-editor-swatch-none {\n background: linear-gradient(135deg, transparent 45%, var(--wu-danger-color) 45%, var(--wu-danger-color) 55%, transparent 55%), var(--wu-card-bg);\n }\n .wu-editor-swatch:hover,\n .wu-editor-swatch:focus-visible {\n outline: 2px solid var(--wu-primary-color);\n outline-offset: 1px;\n }\n .wu-editor-custom-color {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n font-size: 0.875em;\n cursor: pointer;\n }\n .wu-editor-custom-color input {\n width: 2rem;\n height: 1.75rem;\n padding: 0;\n border: 0;\n background: none;\n cursor: pointer;\n }\n .wu-editor-form,\n .wu-editor-image-form {\n display: flex;\n flex-direction: column;\n gap: 0.625rem;\n width: min(20rem, calc(100vw - 2.5rem));\n padding: 0.25rem;\n }\n .wu-editor-field {\n display: flex;\n flex-direction: column;\n gap: 0.25rem;\n font-size: 0.875em;\n }\n .wu-editor-field .wu-inputtext {\n width: 100%;\n box-sizing: border-box;\n }\n .wu-editor-check {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n font-size: 0.875em;\n }\n .wu-editor-form-error {\n color: var(--wu-danger-color);\n font-size: 0.875em;\n }\n .wu-editor-form-actions {\n display: flex;\n justify-content: flex-end;\n gap: 0.5rem;\n }\n .wu-editor-tabs {\n display: flex;\n gap: 0.25rem;\n border-bottom: 1px solid var(--wu-border);\n }\n .wu-editor-tab {\n margin-bottom: -1px;\n padding: 0.375rem 0.75rem;\n border: 0;\n border-bottom: 2px solid transparent;\n background: none;\n color: var(--wu-text-muted);\n font: inherit;\n font-size: 0.875em;\n cursor: pointer;\n }\n .wu-editor-tab[aria-selected='true'] {\n border-bottom-color: var(--wu-primary-color);\n color: var(--wu-primary-color);\n font-weight: 600;\n }\n .wu-editor-drop {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 0.5rem;\n padding: 1.25rem 0.75rem;\n border: 1.5px dashed var(--wu-field-border);\n border-radius: var(--wu-radius-md);\n background: none;\n color: var(--wu-text-muted);\n font: inherit;\n font-size: 0.875em;\n text-align: center;\n cursor: pointer;\n }\n .wu-editor-drop:hover,\n .wu-editor-drop:focus-visible {\n border-color: var(--wu-primary-color);\n color: var(--wu-primary-color);\n outline: none;\n }\n .wu-editor-drop .wu-editor-icon {\n width: 1.75rem;\n height: 1.75rem;\n }\n .wu-editor-grid {\n display: flex;\n flex-direction: column;\n gap: 3px;\n padding: 0.125rem;\n outline: none;\n }\n .wu-editor-grid-row {\n display: flex;\n gap: 3px;\n }\n .wu-editor-grid-cell {\n width: 1.125rem;\n height: 1.125rem;\n padding: 0;\n border: 1px solid var(--wu-field-border);\n border-radius: 2px;\n background: var(--wu-field-bg);\n cursor: pointer;\n }\n .wu-editor-grid-cell.wu-editor-grid-on {\n border-color: var(--wu-primary-color);\n background: color-mix(in srgb, var(--wu-primary-color) 22%, var(--wu-field-bg));\n }\n .wu-editor-grid:focus-visible {\n outline: var(--wu-control-focus-outline);\n }\n .wu-editor-grid-label {\n padding-top: 0.25rem;\n font-size: 0.8125em;\n text-align: center;\n color: var(--wu-text-muted);\n }\n /* The insert-table panel: the grid, then the size typed in. */\n .wu-editor-table-insert {\n display: flex;\n flex-direction: column;\n gap: 0.75rem;\n }\n .wu-editor-table-size {\n display: grid;\n grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);\n gap: 0.5rem;\n padding-top: 0.75rem;\n border-top: 1px solid var(--wu-border);\n }\n .wu-editor-table-size-field {\n display: flex;\n flex-direction: column;\n gap: 0.25rem;\n min-width: 0;\n color: var(--wu-text-muted);\n font-size: 0.875em;\n }\n .wu-editor-table-size-field .wu-inputtext {\n box-sizing: border-box;\n width: 100%;\n min-width: 0;\n }\n .wu-editor-table-size-header,\n .wu-editor-table-size-insert {\n grid-column: 1 / -1;\n }\n .wu-editor-table-size-insert {\n justify-self: end;\n }\n .wu-editor-balloon {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 0.25rem;\n }\n .wu-editor-balloon-group {\n display: inline-flex;\n gap: 2px;\n }\n .wu-editor-balloon-group + .wu-editor-balloon-group {\n padding-left: 0.25rem;\n border-left: 1px solid var(--wu-border);\n }\n .wu-editor-balloon-link {\n display: inline-flex;\n align-items: center;\n gap: 0.375rem;\n max-width: 14rem;\n padding: 0 0.375rem;\n color: var(--wu-primary-color);\n text-decoration: none;\n }\n .wu-editor-balloon-url {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .wu-editor-alt {\n width: 9rem;\n min-width: 0;\n height: var(--wu-editor-tool-size);\n box-sizing: border-box;\n font-size: 0.875em;\n }\n @keyframes wu-editor-pulse {\n 50% {\n opacity: 0.25;\n }\n }\n @media (prefers-reduced-motion: reduce) {\n .wu-editor-tool,\n .wu-editor-area {\n transition: none;\n }\n .wu-editor-area img.wu-image-uploading {\n animation: none;\n }\n }\n}\n";
3016
+
3017
+ /**
3018
+ * Shows saved editor HTML the way the editor drew it (headings, lists, quotes, tables, pictures, the `ql-align-*` /
3019
+ * `ql-indent-*` / `ql-size-*` classes): `<div wuEditorContent [innerHTML]="news.body"></div>`.
3020
+ */
3021
+ class WuEditorContent {
3022
+ constructor() {
3023
+ inject(ɵWuStyleLoader).load('editor', WU_EDITOR_CSS);
3024
+ }
3025
+ }
3026
+ WuEditorContent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WuEditorContent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
3027
+ WuEditorContent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: WuEditorContent, isStandalone: true, selector: "[wuEditorContent]", host: { classAttribute: "wu-editor-content wu-editor-view" }, ngImport: i0 });
3028
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WuEditorContent, decorators: [{
3029
+ type: Directive,
3030
+ args: [{
3031
+ selector: '[wuEditorContent]',
3032
+ standalone: true,
3033
+ host: { class: 'wu-editor-content wu-editor-view' },
3034
+ }]
3035
+ }], ctorParameters: function () { return []; } });
3036
+
3037
+ /** For NgModule apps: the editor, `wuEditorContent` for showing saved HTML, and `wuTemplate` (`pTemplate`). */
3038
+ class WuEditorModule {
3039
+ }
3040
+ WuEditorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WuEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3041
+ WuEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: WuEditorModule, imports: [WuEditor, WuEditorContent, WuTemplate], exports: [WuEditor, WuEditorContent, WuTemplate] });
3042
+ WuEditorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WuEditorModule, imports: [WuEditor] });
3043
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WuEditorModule, decorators: [{
3044
+ type: NgModule,
3045
+ args: [{
3046
+ imports: [WuEditor, WuEditorContent, WuTemplate],
3047
+ exports: [WuEditor, WuEditorContent, WuTemplate],
3048
+ }]
3049
+ }] });
3050
+
3051
+ /**
3052
+ * Generated bundle index. Do not edit.
3053
+ */
3054
+
3055
+ export { WU_EDITOR_OPTIONS, WuEditor, WuEditorContent, WuEditorModule, cleanEditorHtml, provideEditorOptions, ɵWuEditorBase };
3056
+ //# sourceMappingURL=wirabyte-ui-editor.mjs.map