@ngstarter-ui/components 22.3.5 → 22.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (476) hide show
  1. package/README.md +27 -0
  2. package/ai/component-registry.json +186 -101
  3. package/fesm2022/attachment-block-BK9QxVjq.mjs +163 -0
  4. package/fesm2022/attachment-block-BK9QxVjq.mjs.map +1 -0
  5. package/fesm2022/callout-block-Bl4GZYz8.mjs +196 -0
  6. package/fesm2022/callout-block-Bl4GZYz8.mjs.map +1 -0
  7. package/fesm2022/code-block.component-DCRD-9iP.mjs +393 -0
  8. package/fesm2022/code-block.component-DCRD-9iP.mjs.map +1 -0
  9. package/fesm2022/content-builder.store-D622mHxt.mjs +328 -0
  10. package/fesm2022/content-builder.store-D622mHxt.mjs.map +1 -0
  11. package/fesm2022/content-editor-content-editable.directive-WzD9_71s.mjs +1110 -0
  12. package/fesm2022/content-editor-content-editable.directive-WzD9_71s.mjs.map +1 -0
  13. package/fesm2022/cursor-controller-DKfBII1n.mjs +55 -0
  14. package/fesm2022/cursor-controller-DKfBII1n.mjs.map +1 -0
  15. package/fesm2022/default-converters-9oSKDsXP.mjs +140 -0
  16. package/fesm2022/default-converters-9oSKDsXP.mjs.map +1 -0
  17. package/fesm2022/divider-block.component-Dvgeq_D0.mjs +148 -0
  18. package/fesm2022/divider-block.component-Dvgeq_D0.mjs.map +1 -0
  19. package/fesm2022/embed-block-CYkOv4Wt.mjs +565 -0
  20. package/fesm2022/embed-block-CYkOv4Wt.mjs.map +1 -0
  21. package/fesm2022/extra-block-defs-Cn_hfM3c.mjs +122 -0
  22. package/fesm2022/extra-block-defs-Cn_hfM3c.mjs.map +1 -0
  23. package/fesm2022/gallery-block-DT3uIURY.mjs +365 -0
  24. package/fesm2022/gallery-block-DT3uIURY.mjs.map +1 -0
  25. package/fesm2022/grid-block-ZVDT3m8-.mjs +504 -0
  26. package/fesm2022/grid-block-ZVDT3m8-.mjs.map +1 -0
  27. package/fesm2022/heading-block.component-iCpJGTMh.mjs +274 -0
  28. package/fesm2022/heading-block.component-iCpJGTMh.mjs.map +1 -0
  29. package/fesm2022/html-utils-DywL8gGa.mjs +24 -0
  30. package/fesm2022/html-utils-DywL8gGa.mjs.map +1 -0
  31. package/fesm2022/image-block.component-DJ7-HCR8.mjs +285 -0
  32. package/fesm2022/image-block.component-DJ7-HCR8.mjs.map +1 -0
  33. package/fesm2022/list-block.component-qFIebEBO.mjs +312 -0
  34. package/fesm2022/list-block.component-qFIebEBO.mjs.map +1 -0
  35. package/fesm2022/nested-blocks-CXhgXJ1H.mjs +345 -0
  36. package/fesm2022/nested-blocks-CXhgXJ1H.mjs.map +1 -0
  37. package/fesm2022/ngstarter-ui-components-action-required.mjs +150 -45
  38. package/fesm2022/ngstarter-ui-components-action-required.mjs.map +1 -1
  39. package/fesm2022/ngstarter-ui-components-alert.mjs +318 -133
  40. package/fesm2022/ngstarter-ui-components-alert.mjs.map +1 -1
  41. package/fesm2022/ngstarter-ui-components-announcement.mjs +280 -88
  42. package/fesm2022/ngstarter-ui-components-announcement.mjs.map +1 -1
  43. package/fesm2022/ngstarter-ui-components-autocomplete.mjs +647 -386
  44. package/fesm2022/ngstarter-ui-components-autocomplete.mjs.map +1 -1
  45. package/fesm2022/ngstarter-ui-components-avatar.mjs +715 -482
  46. package/fesm2022/ngstarter-ui-components-avatar.mjs.map +1 -1
  47. package/fesm2022/ngstarter-ui-components-badge.mjs +308 -97
  48. package/fesm2022/ngstarter-ui-components-badge.mjs.map +1 -1
  49. package/fesm2022/ngstarter-ui-components-block-loader.mjs +164 -47
  50. package/fesm2022/ngstarter-ui-components-block-loader.mjs.map +1 -1
  51. package/fesm2022/ngstarter-ui-components-bottom-sheet.mjs +278 -315
  52. package/fesm2022/ngstarter-ui-components-bottom-sheet.mjs.map +1 -1
  53. package/fesm2022/ngstarter-ui-components-breadcrumbs.mjs +707 -205
  54. package/fesm2022/ngstarter-ui-components-breadcrumbs.mjs.map +1 -1
  55. package/fesm2022/ngstarter-ui-components-button-toggle.mjs +518 -175
  56. package/fesm2022/ngstarter-ui-components-button-toggle.mjs.map +1 -1
  57. package/fesm2022/ngstarter-ui-components-button.mjs +294 -68
  58. package/fesm2022/ngstarter-ui-components-button.mjs.map +1 -1
  59. package/fesm2022/ngstarter-ui-components-calendar.mjs +442 -250
  60. package/fesm2022/ngstarter-ui-components-calendar.mjs.map +1 -1
  61. package/fesm2022/ngstarter-ui-components-card-overlay.mjs +159 -47
  62. package/fesm2022/ngstarter-ui-components-card-overlay.mjs.map +1 -1
  63. package/fesm2022/ngstarter-ui-components-card.mjs +619 -194
  64. package/fesm2022/ngstarter-ui-components-card.mjs.map +1 -1
  65. package/fesm2022/ngstarter-ui-components-carousel.mjs +1012 -634
  66. package/fesm2022/ngstarter-ui-components-carousel.mjs.map +1 -1
  67. package/fesm2022/ngstarter-ui-components-checkbox.mjs +715 -308
  68. package/fesm2022/ngstarter-ui-components-checkbox.mjs.map +1 -1
  69. package/fesm2022/ngstarter-ui-components-chips.mjs +1397 -667
  70. package/fesm2022/ngstarter-ui-components-chips.mjs.map +1 -1
  71. package/fesm2022/ngstarter-ui-components-code-highlighter.mjs +519 -357
  72. package/fesm2022/ngstarter-ui-components-code-highlighter.mjs.map +1 -1
  73. package/fesm2022/ngstarter-ui-components-color-picker.mjs +1218 -604
  74. package/fesm2022/ngstarter-ui-components-color-picker.mjs.map +1 -1
  75. package/fesm2022/ngstarter-ui-components-color-scheme.mjs +265 -134
  76. package/fesm2022/ngstarter-ui-components-color-scheme.mjs.map +1 -1
  77. package/fesm2022/ngstarter-ui-components-color-switcher.mjs +190 -71
  78. package/fesm2022/ngstarter-ui-components-color-switcher.mjs.map +1 -1
  79. package/fesm2022/ngstarter-ui-components-command-bar.mjs +197 -58
  80. package/fesm2022/ngstarter-ui-components-command-bar.mjs.map +1 -1
  81. package/fesm2022/ngstarter-ui-components-comment-editor.mjs +2212 -1128
  82. package/fesm2022/ngstarter-ui-components-comment-editor.mjs.map +1 -1
  83. package/fesm2022/ngstarter-ui-components-comparison-slider.mjs +269 -183
  84. package/fesm2022/ngstarter-ui-components-comparison-slider.mjs.map +1 -1
  85. package/fesm2022/ngstarter-ui-components-confirm.mjs +164 -86
  86. package/fesm2022/ngstarter-ui-components-confirm.mjs.map +1 -1
  87. package/fesm2022/ngstarter-ui-components-content-editor.mjs +6240 -2
  88. package/fesm2022/ngstarter-ui-components-content-editor.mjs.map +1 -1
  89. package/fesm2022/ngstarter-ui-components-cookie-popup.mjs +244 -108
  90. package/fesm2022/ngstarter-ui-components-cookie-popup.mjs.map +1 -1
  91. package/fesm2022/ngstarter-ui-components-core.mjs +2110 -1592
  92. package/fesm2022/ngstarter-ui-components-core.mjs.map +1 -1
  93. package/fesm2022/ngstarter-ui-components-country-select.mjs +1970 -588
  94. package/fesm2022/ngstarter-ui-components-country-select.mjs.map +1 -1
  95. package/fesm2022/ngstarter-ui-components-crop.mjs +249 -191
  96. package/fesm2022/ngstarter-ui-components-crop.mjs.map +1 -1
  97. package/fesm2022/ngstarter-ui-components-currency-select.mjs +1658 -452
  98. package/fesm2022/ngstarter-ui-components-currency-select.mjs.map +1 -1
  99. package/fesm2022/ngstarter-ui-components-data-view.mjs +4538 -2497
  100. package/fesm2022/ngstarter-ui-components-data-view.mjs.map +1 -1
  101. package/fesm2022/ngstarter-ui-components-date-format-select.mjs +357 -157
  102. package/fesm2022/ngstarter-ui-components-date-format-select.mjs.map +1 -1
  103. package/fesm2022/ngstarter-ui-components-datepicker.mjs +2587 -1264
  104. package/fesm2022/ngstarter-ui-components-datepicker.mjs.map +1 -1
  105. package/fesm2022/ngstarter-ui-components-dialog.mjs +681 -385
  106. package/fesm2022/ngstarter-ui-components-dialog.mjs.map +1 -1
  107. package/fesm2022/ngstarter-ui-components-digit-roller.mjs +1000 -750
  108. package/fesm2022/ngstarter-ui-components-digit-roller.mjs.map +1 -1
  109. package/fesm2022/ngstarter-ui-components-divider.mjs +164 -41
  110. package/fesm2022/ngstarter-ui-components-divider.mjs.map +1 -1
  111. package/fesm2022/ngstarter-ui-components-drawer.mjs +218 -143
  112. package/fesm2022/ngstarter-ui-components-drawer.mjs.map +1 -1
  113. package/fesm2022/ngstarter-ui-components-emoji-picker.mjs +345 -247
  114. package/fesm2022/ngstarter-ui-components-emoji-picker.mjs.map +1 -1
  115. package/fesm2022/ngstarter-ui-components-empty-state.mjs +244 -74
  116. package/fesm2022/ngstarter-ui-components-empty-state.mjs.map +1 -1
  117. package/fesm2022/ngstarter-ui-components-events.mjs +467 -126
  118. package/fesm2022/ngstarter-ui-components-events.mjs.map +1 -1
  119. package/fesm2022/ngstarter-ui-components-expand.mjs +191 -59
  120. package/fesm2022/ngstarter-ui-components-expand.mjs.map +1 -1
  121. package/fesm2022/ngstarter-ui-components-expansion.mjs +529 -193
  122. package/fesm2022/ngstarter-ui-components-expansion.mjs.map +1 -1
  123. package/fesm2022/ngstarter-ui-components-file-type.mjs +270 -171
  124. package/fesm2022/ngstarter-ui-components-file-type.mjs.map +1 -1
  125. package/fesm2022/ngstarter-ui-components-filter-builder.mjs +741 -352
  126. package/fesm2022/ngstarter-ui-components-filter-builder.mjs.map +1 -1
  127. package/fesm2022/ngstarter-ui-components-form-builder.mjs +9032 -6964
  128. package/fesm2022/ngstarter-ui-components-form-builder.mjs.map +1 -1
  129. package/fesm2022/ngstarter-ui-components-form-field.mjs +741 -276
  130. package/fesm2022/ngstarter-ui-components-form-field.mjs.map +1 -1
  131. package/fesm2022/ngstarter-ui-components-gauge.mjs +155 -43
  132. package/fesm2022/ngstarter-ui-components-gauge.mjs.map +1 -1
  133. package/fesm2022/ngstarter-ui-components-grid.mjs +197 -81
  134. package/fesm2022/ngstarter-ui-components-grid.mjs.map +1 -1
  135. package/fesm2022/ngstarter-ui-components-guided-tour.mjs +881 -740
  136. package/fesm2022/ngstarter-ui-components-guided-tour.mjs.map +1 -1
  137. package/fesm2022/ngstarter-ui-components-headless-editor.mjs +3573 -3656
  138. package/fesm2022/ngstarter-ui-components-headless-editor.mjs.map +1 -1
  139. package/fesm2022/ngstarter-ui-components-headless-stepper.mjs +277 -204
  140. package/fesm2022/ngstarter-ui-components-headless-stepper.mjs.map +1 -1
  141. package/fesm2022/ngstarter-ui-components-icon.mjs +209 -182
  142. package/fesm2022/ngstarter-ui-components-icon.mjs.map +1 -1
  143. package/fesm2022/ngstarter-ui-components-image-designer.mjs +5096 -4066
  144. package/fesm2022/ngstarter-ui-components-image-designer.mjs.map +1 -1
  145. package/fesm2022/ngstarter-ui-components-image-placeholder.mjs +45 -19
  146. package/fesm2022/ngstarter-ui-components-image-placeholder.mjs.map +1 -1
  147. package/fesm2022/ngstarter-ui-components-image-resizer.mjs +333 -154
  148. package/fesm2022/ngstarter-ui-components-image-resizer.mjs.map +1 -1
  149. package/fesm2022/ngstarter-ui-components-image-viewer.mjs +564 -358
  150. package/fesm2022/ngstarter-ui-components-image-viewer.mjs.map +1 -1
  151. package/fesm2022/ngstarter-ui-components-image-zoom-viewer.mjs +246 -167
  152. package/fesm2022/ngstarter-ui-components-image-zoom-viewer.mjs.map +1 -1
  153. package/fesm2022/ngstarter-ui-components-incidents.mjs +732 -258
  154. package/fesm2022/ngstarter-ui-components-incidents.mjs.map +1 -1
  155. package/fesm2022/ngstarter-ui-components-inline-text-edit.mjs +244 -182
  156. package/fesm2022/ngstarter-ui-components-inline-text-edit.mjs.map +1 -1
  157. package/fesm2022/ngstarter-ui-components-input-mask.mjs +314 -174
  158. package/fesm2022/ngstarter-ui-components-input-mask.mjs.map +1 -1
  159. package/fesm2022/ngstarter-ui-components-input-validator.mjs +45 -69
  160. package/fesm2022/ngstarter-ui-components-input-validator.mjs.map +1 -1
  161. package/fesm2022/ngstarter-ui-components-input.mjs +303 -161
  162. package/fesm2022/ngstarter-ui-components-input.mjs.map +1 -1
  163. package/fesm2022/ngstarter-ui-components-kanban-board.mjs +504 -159
  164. package/fesm2022/ngstarter-ui-components-kanban-board.mjs.map +1 -1
  165. package/fesm2022/ngstarter-ui-components-kbd.mjs +86 -30
  166. package/fesm2022/ngstarter-ui-components-kbd.mjs.map +1 -1
  167. package/fesm2022/ngstarter-ui-components-layout.mjs +681 -220
  168. package/fesm2022/ngstarter-ui-components-layout.mjs.map +1 -1
  169. package/fesm2022/ngstarter-ui-components-list.mjs +968 -281
  170. package/fesm2022/ngstarter-ui-components-list.mjs.map +1 -1
  171. package/fesm2022/ngstarter-ui-components-logo.mjs +181 -51
  172. package/fesm2022/ngstarter-ui-components-logo.mjs.map +1 -1
  173. package/fesm2022/ngstarter-ui-components-marquee.mjs +226 -147
  174. package/fesm2022/ngstarter-ui-components-marquee.mjs.map +1 -1
  175. package/fesm2022/ngstarter-ui-components-menu.mjs +1686 -1091
  176. package/fesm2022/ngstarter-ui-components-menu.mjs.map +1 -1
  177. package/fesm2022/ngstarter-ui-components-micro-chart.mjs +1541 -943
  178. package/fesm2022/ngstarter-ui-components-micro-chart.mjs.map +1 -1
  179. package/fesm2022/ngstarter-ui-components-navigation.mjs +1035 -455
  180. package/fesm2022/ngstarter-ui-components-navigation.mjs.map +1 -1
  181. package/fesm2022/ngstarter-ui-components-notifications.mjs +678 -230
  182. package/fesm2022/ngstarter-ui-components-notifications.mjs.map +1 -1
  183. package/fesm2022/ngstarter-ui-components-number-input.mjs +616 -316
  184. package/fesm2022/ngstarter-ui-components-number-input.mjs.map +1 -1
  185. package/fesm2022/ngstarter-ui-components-option.mjs +405 -163
  186. package/fesm2022/ngstarter-ui-components-option.mjs.map +1 -1
  187. package/fesm2022/ngstarter-ui-components-overlay.mjs +107 -111
  188. package/fesm2022/ngstarter-ui-components-overlay.mjs.map +1 -1
  189. package/fesm2022/ngstarter-ui-components-page-loading-bar.mjs +131 -76
  190. package/fesm2022/ngstarter-ui-components-page-loading-bar.mjs.map +1 -1
  191. package/fesm2022/ngstarter-ui-components-paginator.mjs +543 -295
  192. package/fesm2022/ngstarter-ui-components-paginator.mjs.map +1 -1
  193. package/fesm2022/ngstarter-ui-components-password-strength.mjs +785 -340
  194. package/fesm2022/ngstarter-ui-components-password-strength.mjs.map +1 -1
  195. package/fesm2022/ngstarter-ui-components-pdf-builder.mjs +3705 -2695
  196. package/fesm2022/ngstarter-ui-components-pdf-builder.mjs.map +1 -1
  197. package/fesm2022/ngstarter-ui-components-pdf-signer.mjs +1179 -851
  198. package/fesm2022/ngstarter-ui-components-pdf-signer.mjs.map +1 -1
  199. package/fesm2022/ngstarter-ui-components-pdf-viewer.mjs +2973 -2070
  200. package/fesm2022/ngstarter-ui-components-pdf-viewer.mjs.map +1 -1
  201. package/fesm2022/ngstarter-ui-components-phone-input.mjs +2081 -770
  202. package/fesm2022/ngstarter-ui-components-phone-input.mjs.map +1 -1
  203. package/fesm2022/ngstarter-ui-components-pin-input.mjs +366 -198
  204. package/fesm2022/ngstarter-ui-components-pin-input.mjs.map +1 -1
  205. package/fesm2022/ngstarter-ui-components-popover.mjs +558 -308
  206. package/fesm2022/ngstarter-ui-components-popover.mjs.map +1 -1
  207. package/fesm2022/ngstarter-ui-components-progress-bar.mjs +178 -73
  208. package/fesm2022/ngstarter-ui-components-progress-bar.mjs.map +1 -1
  209. package/fesm2022/ngstarter-ui-components-radio-card.mjs +301 -105
  210. package/fesm2022/ngstarter-ui-components-radio-card.mjs.map +1 -1
  211. package/fesm2022/ngstarter-ui-components-radio.mjs +417 -157
  212. package/fesm2022/ngstarter-ui-components-radio.mjs.map +1 -1
  213. package/fesm2022/ngstarter-ui-components-rail-nav.mjs +208 -88
  214. package/fesm2022/ngstarter-ui-components-rail-nav.mjs.map +1 -1
  215. package/fesm2022/ngstarter-ui-components-resizable-container.mjs +123 -74
  216. package/fesm2022/ngstarter-ui-components-resizable-container.mjs.map +1 -1
  217. package/fesm2022/ngstarter-ui-components-screen-loader.mjs +197 -95
  218. package/fesm2022/ngstarter-ui-components-screen-loader.mjs.map +1 -1
  219. package/fesm2022/ngstarter-ui-components-scroll-spy.mjs +383 -245
  220. package/fesm2022/ngstarter-ui-components-scroll-spy.mjs.map +1 -1
  221. package/fesm2022/ngstarter-ui-components-scrollbar-area.mjs +705 -581
  222. package/fesm2022/ngstarter-ui-components-scrollbar-area.mjs.map +1 -1
  223. package/fesm2022/ngstarter-ui-components-segmented.mjs +422 -220
  224. package/fesm2022/ngstarter-ui-components-segmented.mjs.map +1 -1
  225. package/fesm2022/ngstarter-ui-components-select.mjs +1862 -1159
  226. package/fesm2022/ngstarter-ui-components-select.mjs.map +1 -1
  227. package/fesm2022/ngstarter-ui-components-side-panel.mjs +313 -118
  228. package/fesm2022/ngstarter-ui-components-side-panel.mjs.map +1 -1
  229. package/fesm2022/ngstarter-ui-components-sidebar.mjs +1239 -470
  230. package/fesm2022/ngstarter-ui-components-sidebar.mjs.map +1 -1
  231. package/fesm2022/ngstarter-ui-components-sidenav.mjs +664 -354
  232. package/fesm2022/ngstarter-ui-components-sidenav.mjs.map +1 -1
  233. package/fesm2022/ngstarter-ui-components-signature-pad.mjs +1092 -643
  234. package/fesm2022/ngstarter-ui-components-signature-pad.mjs.map +1 -1
  235. package/fesm2022/ngstarter-ui-components-skeleton.mjs +153 -43
  236. package/fesm2022/ngstarter-ui-components-skeleton.mjs.map +1 -1
  237. package/fesm2022/ngstarter-ui-components-slide-toggle.mjs +425 -108
  238. package/fesm2022/ngstarter-ui-components-slide-toggle.mjs.map +1 -1
  239. package/fesm2022/ngstarter-ui-components-slider.mjs +645 -487
  240. package/fesm2022/ngstarter-ui-components-slider.mjs.map +1 -1
  241. package/fesm2022/ngstarter-ui-components-snack-bar.mjs +372 -354
  242. package/fesm2022/ngstarter-ui-components-snack-bar.mjs.map +1 -1
  243. package/fesm2022/ngstarter-ui-components-sort.mjs +378 -147
  244. package/fesm2022/ngstarter-ui-components-sort.mjs.map +1 -1
  245. package/fesm2022/ngstarter-ui-components-spinner.mjs +242 -76
  246. package/fesm2022/ngstarter-ui-components-spinner.mjs.map +1 -1
  247. package/fesm2022/ngstarter-ui-components-splash-screen.mjs +142 -91
  248. package/fesm2022/ngstarter-ui-components-splash-screen.mjs.map +1 -1
  249. package/fesm2022/ngstarter-ui-components-split.mjs +1067 -929
  250. package/fesm2022/ngstarter-ui-components-split.mjs.map +1 -1
  251. package/fesm2022/ngstarter-ui-components-step-tracker.mjs +617 -331
  252. package/fesm2022/ngstarter-ui-components-step-tracker.mjs.map +1 -1
  253. package/fesm2022/ngstarter-ui-components-stepper.mjs +357 -126
  254. package/fesm2022/ngstarter-ui-components-stepper.mjs.map +1 -1
  255. package/fesm2022/ngstarter-ui-components-suggestions.mjs +259 -72
  256. package/fesm2022/ngstarter-ui-components-suggestions.mjs.map +1 -1
  257. package/fesm2022/ngstarter-ui-components-tab-panel.mjs +674 -267
  258. package/fesm2022/ngstarter-ui-components-tab-panel.mjs.map +1 -1
  259. package/fesm2022/ngstarter-ui-components-table.mjs +1144 -662
  260. package/fesm2022/ngstarter-ui-components-table.mjs.map +1 -1
  261. package/fesm2022/ngstarter-ui-components-tabs.mjs +1236 -615
  262. package/fesm2022/ngstarter-ui-components-tabs.mjs.map +1 -1
  263. package/fesm2022/ngstarter-ui-components-thumbnail-maker.mjs +414 -216
  264. package/fesm2022/ngstarter-ui-components-thumbnail-maker.mjs.map +1 -1
  265. package/fesm2022/ngstarter-ui-components-tiles.mjs +939 -647
  266. package/fesm2022/ngstarter-ui-components-tiles.mjs.map +1 -1
  267. package/fesm2022/ngstarter-ui-components-timeline.mjs +418 -122
  268. package/fesm2022/ngstarter-ui-components-timeline.mjs.map +1 -1
  269. package/fesm2022/ngstarter-ui-components-timepicker.mjs +870 -508
  270. package/fesm2022/ngstarter-ui-components-timepicker.mjs.map +1 -1
  271. package/fesm2022/ngstarter-ui-components-timezone-select.mjs +651 -371
  272. package/fesm2022/ngstarter-ui-components-timezone-select.mjs.map +1 -1
  273. package/fesm2022/ngstarter-ui-components-toolbar.mjs +727 -320
  274. package/fesm2022/ngstarter-ui-components-toolbar.mjs.map +1 -1
  275. package/fesm2022/ngstarter-ui-components-tooltip.mjs +601 -521
  276. package/fesm2022/ngstarter-ui-components-tooltip.mjs.map +1 -1
  277. package/fesm2022/ngstarter-ui-components-tree-select.mjs +1197 -434
  278. package/fesm2022/ngstarter-ui-components-tree-select.mjs.map +1 -1
  279. package/fesm2022/ngstarter-ui-components-tree.mjs +1821 -1262
  280. package/fesm2022/ngstarter-ui-components-tree.mjs.map +1 -1
  281. package/fesm2022/ngstarter-ui-components-upload.mjs +1059 -345
  282. package/fesm2022/ngstarter-ui-components-upload.mjs.map +1 -1
  283. package/fesm2022/ngstarter-ui-components-video-player.mjs +763 -533
  284. package/fesm2022/ngstarter-ui-components-video-player.mjs.map +1 -1
  285. package/fesm2022/ngstarter-ui-components-video-viewer.mjs +630 -229
  286. package/fesm2022/ngstarter-ui-components-video-viewer.mjs.map +1 -1
  287. package/fesm2022/ngstarter-ui-components-visual-builder.mjs +40 -17
  288. package/fesm2022/ngstarter-ui-components-visual-builder.mjs.map +1 -1
  289. package/fesm2022/ngstarter-ui-components-whiteboard.mjs +3039 -1803
  290. package/fesm2022/ngstarter-ui-components-whiteboard.mjs.map +1 -1
  291. package/fesm2022/ngstarter-ui-components.mjs +3 -5
  292. package/fesm2022/ngstarter-ui-components.mjs.map +1 -1
  293. package/fesm2022/paragraph-block.component-Csk8Gu3x.mjs +264 -0
  294. package/fesm2022/paragraph-block.component-Csk8Gu3x.mjs.map +1 -0
  295. package/fesm2022/plain-text-settings-BnxCxLhA.mjs +354 -0
  296. package/fesm2022/plain-text-settings-BnxCxLhA.mjs.map +1 -0
  297. package/fesm2022/quote-block.component-tRmrU97F.mjs +309 -0
  298. package/fesm2022/quote-block.component-tRmrU97F.mjs.map +1 -0
  299. package/fesm2022/table-block.component-BuzRRggv.mjs +1859 -0
  300. package/fesm2022/table-block.component-BuzRRggv.mjs.map +1 -0
  301. package/fesm2022/toggle-block-C5Jo2YDf.mjs +150 -0
  302. package/fesm2022/toggle-block-C5Jo2YDf.mjs.map +1 -0
  303. package/fesm2022/upload-status-tZ0x0BUB.mjs +107 -0
  304. package/fesm2022/upload-status-tZ0x0BUB.mjs.map +1 -0
  305. package/fesm2022/video-block.component-CpAXibm6.mjs +312 -0
  306. package/fesm2022/video-block.component-CpAXibm6.mjs.map +1 -0
  307. package/package.json +11 -10
  308. package/styles/_tokens.scss +1 -0
  309. package/types/ngstarter-ui-components-action-required.d.ts +34 -14
  310. package/types/ngstarter-ui-components-alert.d.ts +53 -44
  311. package/types/ngstarter-ui-components-announcement.d.ts +74 -53
  312. package/types/ngstarter-ui-components-autocomplete.d.ts +141 -84
  313. package/types/ngstarter-ui-components-avatar.d.ts +113 -66
  314. package/types/ngstarter-ui-components-badge.d.ts +73 -37
  315. package/types/ngstarter-ui-components-block-loader.d.ts +32 -20
  316. package/types/ngstarter-ui-components-bottom-sheet.d.ts +125 -132
  317. package/types/ngstarter-ui-components-breadcrumbs.d.ts +93 -88
  318. package/types/ngstarter-ui-components-button-toggle.d.ts +124 -54
  319. package/types/ngstarter-ui-components-button.d.ts +69 -27
  320. package/types/ngstarter-ui-components-calendar.d.ts +123 -71
  321. package/types/ngstarter-ui-components-card-overlay.d.ts +31 -19
  322. package/types/ngstarter-ui-components-card.d.ts +75 -71
  323. package/types/ngstarter-ui-components-carousel.d.ts +115 -69
  324. package/types/ngstarter-ui-components-checkbox.d.ts +183 -86
  325. package/types/ngstarter-ui-components-chips.d.ts +288 -195
  326. package/types/ngstarter-ui-components-code-highlighter.d.ts +71 -28
  327. package/types/ngstarter-ui-components-color-picker.d.ts +140 -89
  328. package/types/ngstarter-ui-components-color-scheme.d.ts +43 -52
  329. package/types/ngstarter-ui-components-color-switcher.d.ts +46 -26
  330. package/types/ngstarter-ui-components-command-bar.d.ts +40 -26
  331. package/types/ngstarter-ui-components-comment-editor.d.ts +311 -235
  332. package/types/ngstarter-ui-components-comparison-slider.d.ts +41 -40
  333. package/types/ngstarter-ui-components-confirm.d.ts +24 -29
  334. package/types/ngstarter-ui-components-content-editor.d.ts +1482 -998
  335. package/types/ngstarter-ui-components-cookie-popup.d.ts +43 -38
  336. package/types/ngstarter-ui-components-core.d.ts +513 -467
  337. package/types/ngstarter-ui-components-country-select.d.ts +170 -97
  338. package/types/ngstarter-ui-components-crop.d.ts +67 -52
  339. package/types/ngstarter-ui-components-currency-select.d.ts +127 -90
  340. package/types/ngstarter-ui-components-data-view.d.ts +811 -567
  341. package/types/ngstarter-ui-components-date-format-select.d.ts +90 -58
  342. package/types/ngstarter-ui-components-datepicker.d.ts +589 -373
  343. package/types/ngstarter-ui-components-dialog.d.ts +138 -116
  344. package/types/ngstarter-ui-components-digit-roller.d.ts +228 -131
  345. package/types/ngstarter-ui-components-divider.d.ts +29 -17
  346. package/types/ngstarter-ui-components-drawer.d.ts +39 -30
  347. package/types/ngstarter-ui-components-emoji-picker.d.ts +69 -47
  348. package/types/ngstarter-ui-components-empty-state.d.ts +20 -28
  349. package/types/ngstarter-ui-components-events.d.ts +73 -57
  350. package/types/ngstarter-ui-components-expand.d.ts +55 -25
  351. package/types/ngstarter-ui-components-expansion.d.ts +93 -64
  352. package/types/ngstarter-ui-components-file-type.d.ts +53 -27
  353. package/types/ngstarter-ui-components-filter-builder.d.ts +131 -100
  354. package/types/ngstarter-ui-components-form-builder.d.ts +1094 -881
  355. package/types/ngstarter-ui-components-form-field.d.ts +116 -105
  356. package/types/ngstarter-ui-components-gauge.d.ts +32 -20
  357. package/types/ngstarter-ui-components-grid.d.ts +66 -50
  358. package/types/ngstarter-ui-components-guided-tour.d.ts +250 -222
  359. package/types/ngstarter-ui-components-headless-editor.d.ts +708 -658
  360. package/types/ngstarter-ui-components-headless-stepper.d.ts +84 -64
  361. package/types/ngstarter-ui-components-icon.d.ts +39 -38
  362. package/types/ngstarter-ui-components-image-designer.d.ts +422 -341
  363. package/types/ngstarter-ui-components-image-placeholder.d.ts +5 -8
  364. package/types/ngstarter-ui-components-image-resizer.d.ts +40 -33
  365. package/types/ngstarter-ui-components-image-viewer.d.ts +67 -54
  366. package/types/ngstarter-ui-components-image-zoom-viewer.d.ts +29 -33
  367. package/types/ngstarter-ui-components-incidents.d.ts +97 -104
  368. package/types/ngstarter-ui-components-inline-text-edit.d.ts +54 -39
  369. package/types/ngstarter-ui-components-input-mask.d.ts +54 -34
  370. package/types/ngstarter-ui-components-input-validator.d.ts +7 -11
  371. package/types/ngstarter-ui-components-input.d.ts +82 -54
  372. package/types/ngstarter-ui-components-kanban-board.d.ts +76 -63
  373. package/types/ngstarter-ui-components-kbd.d.ts +8 -12
  374. package/types/ngstarter-ui-components-layout.d.ts +131 -87
  375. package/types/ngstarter-ui-components-list.d.ts +123 -88
  376. package/types/ngstarter-ui-components-logo.d.ts +21 -21
  377. package/types/ngstarter-ui-components-marquee.d.ts +41 -34
  378. package/types/ngstarter-ui-components-menu.d.ts +329 -221
  379. package/types/ngstarter-ui-components-micro-chart.d.ts +385 -186
  380. package/types/ngstarter-ui-components-navigation.d.ts +186 -125
  381. package/types/ngstarter-ui-components-notifications.d.ts +104 -89
  382. package/types/ngstarter-ui-components-number-input.d.ts +138 -96
  383. package/types/ngstarter-ui-components-option.d.ts +102 -68
  384. package/types/ngstarter-ui-components-overlay.d.ts +7 -12
  385. package/types/ngstarter-ui-components-page-loading-bar.d.ts +23 -20
  386. package/types/ngstarter-ui-components-paginator.d.ts +171 -129
  387. package/types/ngstarter-ui-components-password-strength.d.ts +217 -102
  388. package/types/ngstarter-ui-components-pdf-builder.d.ts +717 -649
  389. package/types/ngstarter-ui-components-pdf-signer.d.ts +202 -142
  390. package/types/ngstarter-ui-components-pdf-viewer.d.ts +544 -385
  391. package/types/ngstarter-ui-components-phone-input.d.ts +175 -115
  392. package/types/ngstarter-ui-components-pin-input.d.ts +83 -45
  393. package/types/ngstarter-ui-components-popover.d.ts +128 -89
  394. package/types/ngstarter-ui-components-progress-bar.d.ts +49 -30
  395. package/types/ngstarter-ui-components-radio-card.d.ts +50 -34
  396. package/types/ngstarter-ui-components-radio.d.ts +100 -47
  397. package/types/ngstarter-ui-components-rail-nav.d.ts +36 -29
  398. package/types/ngstarter-ui-components-resizable-container.d.ts +30 -25
  399. package/types/ngstarter-ui-components-screen-loader.d.ts +38 -32
  400. package/types/ngstarter-ui-components-scroll-spy.d.ts +56 -60
  401. package/types/ngstarter-ui-components-scrollbar-area.d.ts +116 -86
  402. package/types/ngstarter-ui-components-segmented.d.ts +93 -61
  403. package/types/ngstarter-ui-components-select.d.ts +366 -266
  404. package/types/ngstarter-ui-components-side-panel.d.ts +59 -40
  405. package/types/ngstarter-ui-components-sidebar.d.ts +208 -154
  406. package/types/ngstarter-ui-components-sidenav.d.ts +136 -78
  407. package/types/ngstarter-ui-components-signature-pad.d.ts +165 -92
  408. package/types/ngstarter-ui-components-skeleton.d.ts +18 -17
  409. package/types/ngstarter-ui-components-slide-toggle.d.ts +113 -44
  410. package/types/ngstarter-ui-components-slider.d.ts +123 -82
  411. package/types/ngstarter-ui-components-snack-bar.d.ts +126 -134
  412. package/types/ngstarter-ui-components-sort.d.ts +99 -63
  413. package/types/ngstarter-ui-components-spinner.d.ts +49 -27
  414. package/types/ngstarter-ui-components-splash-screen.d.ts +34 -29
  415. package/types/ngstarter-ui-components-split.d.ts +276 -195
  416. package/types/ngstarter-ui-components-step-tracker.d.ts +102 -83
  417. package/types/ngstarter-ui-components-stepper.d.ts +57 -43
  418. package/types/ngstarter-ui-components-suggestions.d.ts +41 -28
  419. package/types/ngstarter-ui-components-tab-panel.d.ts +110 -83
  420. package/types/ngstarter-ui-components-table.d.ts +256 -228
  421. package/types/ngstarter-ui-components-tabs.d.ts +231 -138
  422. package/types/ngstarter-ui-components-thumbnail-maker.d.ts +40 -34
  423. package/types/ngstarter-ui-components-tiles.d.ts +166 -104
  424. package/types/ngstarter-ui-components-timeline.d.ts +45 -57
  425. package/types/ngstarter-ui-components-timepicker.d.ts +166 -111
  426. package/types/ngstarter-ui-components-timezone-select.d.ts +110 -70
  427. package/types/ngstarter-ui-components-toolbar.d.ts +89 -72
  428. package/types/ngstarter-ui-components-tooltip.d.ts +89 -52
  429. package/types/ngstarter-ui-components-tree-select.d.ts +182 -105
  430. package/types/ngstarter-ui-components-tree.d.ts +355 -229
  431. package/types/ngstarter-ui-components-upload.d.ts +216 -131
  432. package/types/ngstarter-ui-components-video-player.d.ts +130 -67
  433. package/types/ngstarter-ui-components-video-viewer.d.ts +140 -91
  434. package/types/ngstarter-ui-components-visual-builder.d.ts +5 -8
  435. package/types/ngstarter-ui-components-whiteboard.d.ts +412 -339
  436. package/types/ngstarter-ui-components.d.ts +2 -2
  437. package/fesm2022/ngstarter-ui-components-content-editor-attachment-block-8OmuepvH.mjs +0 -35
  438. package/fesm2022/ngstarter-ui-components-content-editor-attachment-block-8OmuepvH.mjs.map +0 -1
  439. package/fesm2022/ngstarter-ui-components-content-editor-callout-block-Dp5tISk3.mjs +0 -26
  440. package/fesm2022/ngstarter-ui-components-content-editor-callout-block-Dp5tISk3.mjs.map +0 -1
  441. package/fesm2022/ngstarter-ui-components-content-editor-code-block.component-BbBs-R_y.mjs +0 -220
  442. package/fesm2022/ngstarter-ui-components-content-editor-code-block.component-BbBs-R_y.mjs.map +0 -1
  443. package/fesm2022/ngstarter-ui-components-content-editor-cursor-controller-4Ak8VqGX.mjs +0 -99
  444. package/fesm2022/ngstarter-ui-components-content-editor-cursor-controller-4Ak8VqGX.mjs.map +0 -1
  445. package/fesm2022/ngstarter-ui-components-content-editor-divider-block.component-D1nXMRXD.mjs +0 -40
  446. package/fesm2022/ngstarter-ui-components-content-editor-divider-block.component-D1nXMRXD.mjs.map +0 -1
  447. package/fesm2022/ngstarter-ui-components-content-editor-embed-block-DGCCeU-Y.mjs +0 -375
  448. package/fesm2022/ngstarter-ui-components-content-editor-embed-block-DGCCeU-Y.mjs.map +0 -1
  449. package/fesm2022/ngstarter-ui-components-content-editor-gallery-block-BJfRgtaA.mjs +0 -80
  450. package/fesm2022/ngstarter-ui-components-content-editor-gallery-block-BJfRgtaA.mjs.map +0 -1
  451. package/fesm2022/ngstarter-ui-components-content-editor-grid-block-C_L7hF2G.mjs +0 -65
  452. package/fesm2022/ngstarter-ui-components-content-editor-grid-block-C_L7hF2G.mjs.map +0 -1
  453. package/fesm2022/ngstarter-ui-components-content-editor-heading-block.component-durrPUhm.mjs +0 -137
  454. package/fesm2022/ngstarter-ui-components-content-editor-heading-block.component-durrPUhm.mjs.map +0 -1
  455. package/fesm2022/ngstarter-ui-components-content-editor-image-block.component-BoL1jZpT.mjs +0 -113
  456. package/fesm2022/ngstarter-ui-components-content-editor-image-block.component-BoL1jZpT.mjs.map +0 -1
  457. package/fesm2022/ngstarter-ui-components-content-editor-list-block.component-ChZpgXO5.mjs +0 -235
  458. package/fesm2022/ngstarter-ui-components-content-editor-list-block.component-ChZpgXO5.mjs.map +0 -1
  459. package/fesm2022/ngstarter-ui-components-content-editor-nested-blocks-DwyNFnII.mjs +0 -117
  460. package/fesm2022/ngstarter-ui-components-content-editor-nested-blocks-DwyNFnII.mjs.map +0 -1
  461. package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-BWpJv6CO.mjs +0 -4464
  462. package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-BWpJv6CO.mjs.map +0 -1
  463. package/fesm2022/ngstarter-ui-components-content-editor-paragraph-block.component-BvNvkqTO.mjs +0 -132
  464. package/fesm2022/ngstarter-ui-components-content-editor-paragraph-block.component-BvNvkqTO.mjs.map +0 -1
  465. package/fesm2022/ngstarter-ui-components-content-editor-quote-block.component-tgNKltfK.mjs +0 -171
  466. package/fesm2022/ngstarter-ui-components-content-editor-quote-block.component-tgNKltfK.mjs.map +0 -1
  467. package/fesm2022/ngstarter-ui-components-content-editor-table-block.component-BcAlqmh8.mjs +0 -1653
  468. package/fesm2022/ngstarter-ui-components-content-editor-table-block.component-BcAlqmh8.mjs.map +0 -1
  469. package/fesm2022/ngstarter-ui-components-content-editor-toggle-block-S474I51r.mjs +0 -20
  470. package/fesm2022/ngstarter-ui-components-content-editor-toggle-block-S474I51r.mjs.map +0 -1
  471. package/fesm2022/ngstarter-ui-components-content-editor-upload-status-QnKI_Rfz.mjs +0 -19
  472. package/fesm2022/ngstarter-ui-components-content-editor-upload-status-QnKI_Rfz.mjs.map +0 -1
  473. package/fesm2022/ngstarter-ui-components-content-editor-video-block.component-Dj82fxTI.mjs +0 -134
  474. package/fesm2022/ngstarter-ui-components-content-editor-video-block.component-Dj82fxTI.mjs.map +0 -1
  475. package/fesm2022/ngstarter-ui-components-form-builder-plain-text-settings-GNXKGonc.mjs +0 -159
  476. package/fesm2022/ngstarter-ui-components-form-builder-plain-text-settings-GNXKGonc.mjs.map +0 -1
@@ -1,1169 +1,2253 @@
1
- import * as i0 from '@angular/core';
2
- import { InjectionToken, inject, ElementRef, Renderer2, DOCUMENT, DestroyRef, viewChild, signal, model, input, booleanAttribute, output, computed, effect, untracked, afterNextRender, forwardRef, ChangeDetectionStrategy, Component, Directive } from '@angular/core';
3
- import { Button } from '@ngstarter-ui/components/button';
4
- import { defineNgsHeadlessEditorPlugin, createNgsHeadlessEditorId, createNgsHeadlessEditorText, isNgsHeadlessEditorTextContent, normalizeNgsHeadlessEditorColor, NgsHeadlessEditor, NgsHeadlessEditorSurface, basicTextEditorPlugin, colorEditorPlugin, createNgsHeadlessEditorDocument, NGS_HEADLESS_EDITOR_TOGGLE_BOLD, NGS_HEADLESS_EDITOR_TOGGLE_ITALIC, NGS_HEADLESS_EDITOR_TOGGLE_STRIKE, NGS_HEADLESS_EDITOR_TOGGLE_CODE, ngsHeadlessEditorDocumentsEqual, getNgsHeadlessEditorBlockText, createNgsHeadlessEditorParagraph, getNgsHeadlessEditorDocumentText, NGS_HEADLESS_EDITOR_SET_TEXT_COLOR, NGS_HEADLESS_EDITOR_UNSET_TEXT_COLOR, NGS_HEADLESS_EDITOR_SET_BACKGROUND_COLOR, NGS_HEADLESS_EDITOR_UNSET_BACKGROUND_COLOR, provideNgsHeadlessEditor } from '@ngstarter-ui/components/headless-editor';
5
- import * as i1 from '@ngstarter-ui/components/upload';
6
- import { UploadTriggerDirective } from '@ngstarter-ui/components/upload';
7
- import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
8
- import { DialogRef, DIALOG_DATA, DialogActions, DialogContent, DialogTitle, Dialog } from '@ngstarter-ui/components/dialog';
9
- import * as i1$1 from '@angular/forms';
10
- import { FormsModule } from '@angular/forms';
11
- import { FormField, Label } from '@ngstarter-ui/components/form-field';
12
- import { Input } from '@ngstarter-ui/components/input';
13
-
14
- const NGS_COMMENT_EDITOR_TOGGLE_BLOCKQUOTE = toggleBlockCommand('toggle-blockquote', 'blockquote');
15
- const NGS_COMMENT_EDITOR_TOGGLE_CODE_BLOCK = toggleBlockCommand('toggle-code-block', 'codeBlock');
16
- const NGS_COMMENT_EDITOR_TOGGLE_BULLET_LIST = toggleBlockCommand('toggle-bullet-list', 'bulletList');
17
- const NGS_COMMENT_EDITOR_TOGGLE_ORDERED_LIST = toggleBlockCommand('toggle-ordered-list', 'orderedList');
1
+ import * as i0 from "@angular/core";
2
+ import { ChangeDetectionStrategy, Component, DOCUMENT, DestroyRef, Directive, ElementRef, InjectionToken, Renderer2, afterNextRender, booleanAttribute, computed, effect, forwardRef, inject, input, model, output, signal, untracked, viewChild } from "@angular/core";
3
+ import { Button } from "@ngstarter-ui/components/button";
4
+ import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
5
+ import { FormField, Label } from "@ngstarter-ui/components/form-field";
6
+ import * as i1 from "@angular/forms";
7
+ import { FormsModule } from "@angular/forms";
8
+ import { Input as Input$1 } from "@ngstarter-ui/components/input";
9
+ import { NGS_HEADLESS_EDITOR_SET_BACKGROUND_COLOR, NGS_HEADLESS_EDITOR_SET_TEXT_COLOR, NGS_HEADLESS_EDITOR_TOGGLE_BOLD, NGS_HEADLESS_EDITOR_TOGGLE_CODE, NGS_HEADLESS_EDITOR_TOGGLE_ITALIC, NGS_HEADLESS_EDITOR_TOGGLE_STRIKE, NGS_HEADLESS_EDITOR_UNSET_BACKGROUND_COLOR, NGS_HEADLESS_EDITOR_UNSET_TEXT_COLOR, NgsHeadlessEditor, NgsHeadlessEditorSurface, basicTextEditorPlugin, colorEditorPlugin, createNgsHeadlessEditorDocument, createNgsHeadlessEditorId, createNgsHeadlessEditorParagraph, createNgsHeadlessEditorText, defineNgsHeadlessEditorPlugin, getNgsHeadlessEditorBlockText, getNgsHeadlessEditorDocumentText, isNgsHeadlessEditorTextContent, ngsHeadlessEditorDocumentsEqual, normalizeNgsHeadlessEditorColor, provideNgsHeadlessEditor } from "@ngstarter-ui/components/headless-editor";
10
+ import * as i1$1 from "@ngstarter-ui/components/upload";
11
+ import { UploadTriggerDirective } from "@ngstarter-ui/components/upload";
12
+ import { DIALOG_DATA, Dialog, DialogActions, DialogContent, DialogRef, DialogTitle } from "@ngstarter-ui/components/dialog";
13
+ const NGS_COMMENT_EDITOR_TOGGLE_BLOCKQUOTE = toggleBlockCommand("toggle-blockquote", "blockquote");
14
+ const NGS_COMMENT_EDITOR_TOGGLE_CODE_BLOCK = toggleBlockCommand("toggle-code-block", "codeBlock");
15
+ const NGS_COMMENT_EDITOR_TOGGLE_BULLET_LIST = toggleBlockCommand("toggle-bullet-list", "bulletList");
16
+ const NGS_COMMENT_EDITOR_TOGGLE_ORDERED_LIST = toggleBlockCommand("toggle-ordered-list", "orderedList");
18
17
  const NGS_COMMENT_EDITOR_SET_LINK = {
19
- id: 'set-link',
20
- execute: (editor, href) => editor.setMark('link', { href: normalizeLinkUrl(href) }),
21
- enabled: (_editor, href) => !!href?.trim(),
22
- active: editor => editor.isMarkActive('link')
18
+ id: "set-link",
19
+ execute: (editor, href) => editor.setMark("link", { href: normalizeLinkUrl(href) }),
20
+ enabled: (_editor, href) => !!href?.trim(),
21
+ active: (editor) => editor.isMarkActive("link")
23
22
  };
24
23
  const NGS_COMMENT_EDITOR_UNSET_LINK = {
25
- id: 'unset-link',
26
- execute: editor => editor.unsetMark('link'),
27
- enabled: editor => editor.isMarkActive('link'),
28
- active: editor => editor.isMarkActive('link')
24
+ id: "unset-link",
25
+ execute: (editor) => editor.unsetMark("link"),
26
+ enabled: (editor) => editor.isMarkActive("link"),
27
+ active: (editor) => editor.isMarkActive("link")
29
28
  };
30
29
  function commentEditorPlugin() {
31
- return defineNgsHeadlessEditorPlugin({
32
- id: 'comment-editor-features',
33
- blocks: [
34
- textBlock('blockquote', 'blockquote'),
35
- textBlock('codeBlock', 'pre', 'code'),
36
- textBlock('bulletList', 'ul', 'li'),
37
- textBlock('orderedList', 'ol', 'li'),
38
- mediaBlock('image', 'figure', renderImage),
39
- mediaBlock('imageUpload', 'figure', renderImageUpload),
40
- mediaBlock('youtube', 'figure', renderYoutube)
41
- ],
42
- marks: [
43
- {
44
- type: 'link',
45
- tagName: 'a',
46
- parseTags: ['a'],
47
- applyAttributes: (element, mark) => {
48
- const href = normalizeLinkUrl(String(mark.attrs?.['href'] ?? ''));
49
- element.setAttribute('href', href);
50
- element.setAttribute('target', '_blank');
51
- element.setAttribute('rel', 'noopener noreferrer');
52
- },
53
- readAttributes: element => ({ href: element.getAttribute('href') ?? '' })
54
- },
55
- {
56
- type: 'singleEmoji',
57
- tagName: 'span',
58
- applyAttributes: element => element.classList.add('single-emoji')
59
- }
60
- ],
61
- commands: [
62
- NGS_COMMENT_EDITOR_TOGGLE_BLOCKQUOTE,
63
- NGS_COMMENT_EDITOR_TOGGLE_CODE_BLOCK,
64
- NGS_COMMENT_EDITOR_TOGGLE_BULLET_LIST,
65
- NGS_COMMENT_EDITOR_TOGGLE_ORDERED_LIST,
66
- NGS_COMMENT_EDITOR_SET_LINK,
67
- NGS_COMMENT_EDITOR_UNSET_LINK
68
- ],
69
- keymap: [
70
- { key: 'Mod-Shift-7', command: NGS_COMMENT_EDITOR_TOGGLE_ORDERED_LIST },
71
- { key: 'Mod-Shift-8', command: NGS_COMMENT_EDITOR_TOGGLE_BULLET_LIST },
72
- { key: 'Mod-Shift-b', command: NGS_COMMENT_EDITOR_TOGGLE_BLOCKQUOTE },
73
- { key: 'Mod-Alt-c', command: NGS_COMMENT_EDITOR_TOGGLE_CODE_BLOCK }
74
- ]
75
- });
30
+ return defineNgsHeadlessEditorPlugin({
31
+ id: "comment-editor-features",
32
+ blocks: [
33
+ textBlock("blockquote", "blockquote"),
34
+ textBlock("codeBlock", "pre", "code"),
35
+ textBlock("bulletList", "ul", "li"),
36
+ textBlock("orderedList", "ol", "li"),
37
+ mediaBlock("image", "figure", renderImage),
38
+ mediaBlock("imageUpload", "figure", renderImageUpload),
39
+ mediaBlock("youtube", "figure", renderYoutube)
40
+ ],
41
+ marks: [{
42
+ type: "link",
43
+ tagName: "a",
44
+ parseTags: ["a"],
45
+ applyAttributes: (element, mark) => {
46
+ const href = normalizeLinkUrl(String(mark.attrs?.["href"] ?? ""));
47
+ element.setAttribute("href", href);
48
+ element.setAttribute("target", "_blank");
49
+ element.setAttribute("rel", "noopener noreferrer");
50
+ },
51
+ readAttributes: (element) => ({ href: element.getAttribute("href") ?? "" })
52
+ }, {
53
+ type: "singleEmoji",
54
+ tagName: "span",
55
+ applyAttributes: (element) => element.classList.add("single-emoji")
56
+ }],
57
+ commands: [
58
+ NGS_COMMENT_EDITOR_TOGGLE_BLOCKQUOTE,
59
+ NGS_COMMENT_EDITOR_TOGGLE_CODE_BLOCK,
60
+ NGS_COMMENT_EDITOR_TOGGLE_BULLET_LIST,
61
+ NGS_COMMENT_EDITOR_TOGGLE_ORDERED_LIST,
62
+ NGS_COMMENT_EDITOR_SET_LINK,
63
+ NGS_COMMENT_EDITOR_UNSET_LINK
64
+ ],
65
+ keymap: [
66
+ {
67
+ key: "Mod-Shift-7",
68
+ command: NGS_COMMENT_EDITOR_TOGGLE_ORDERED_LIST
69
+ },
70
+ {
71
+ key: "Mod-Shift-8",
72
+ command: NGS_COMMENT_EDITOR_TOGGLE_BULLET_LIST
73
+ },
74
+ {
75
+ key: "Mod-Shift-b",
76
+ command: NGS_COMMENT_EDITOR_TOGGLE_BLOCKQUOTE
77
+ },
78
+ {
79
+ key: "Mod-Alt-c",
80
+ command: NGS_COMMENT_EDITOR_TOGGLE_CODE_BLOCK
81
+ }
82
+ ]
83
+ });
76
84
  }
77
85
  function createCommentEditorMediaBlock(type, attrs) {
78
- return {
79
- id: createNgsHeadlessEditorId(type),
80
- type,
81
- content: null,
82
- attrs: { ...attrs }
83
- };
86
+ return {
87
+ id: createNgsHeadlessEditorId(type),
88
+ type,
89
+ content: null,
90
+ attrs: { ...attrs }
91
+ };
84
92
  }
85
93
  function normalizeLinkUrl(value) {
86
- const url = value.trim();
87
- if (!url) {
88
- return '';
89
- }
90
- if (/^(https?:|mailto:|tel:)/i.test(url)) {
91
- return url;
92
- }
93
- return `https://${url}`;
94
+ const url = value.trim();
95
+ if (!url) return "";
96
+ if (/^(https?:|mailto:|tel:)/i.test(url)) return url;
97
+ return `https://${url}`;
94
98
  }
95
99
  function normalizeYoutubeUrl(value) {
96
- const url = normalizeLinkUrl(value);
97
- try {
98
- const parsed = new URL(url);
99
- const host = parsed.hostname.replace(/^www\./, '');
100
- let videoId = '';
101
- if (host === 'youtu.be') {
102
- videoId = parsed.pathname.slice(1).split('/')[0];
103
- }
104
- else if (host === 'youtube.com' || host === 'm.youtube.com' || host === 'youtube-nocookie.com') {
105
- if (parsed.pathname.startsWith('/embed/')) {
106
- videoId = parsed.pathname.split('/')[2] ?? '';
107
- }
108
- else if (parsed.pathname.startsWith('/shorts/')) {
109
- videoId = parsed.pathname.split('/')[2] ?? '';
110
- }
111
- else {
112
- videoId = parsed.searchParams.get('v') ?? '';
113
- }
114
- }
115
- return /^[\w-]{6,}$/.test(videoId)
116
- ? `https://www.youtube-nocookie.com/embed/${videoId}`
117
- : null;
118
- }
119
- catch {
120
- return null;
121
- }
100
+ const url = normalizeLinkUrl(value);
101
+ try {
102
+ const parsed = new URL(url);
103
+ const host = parsed.hostname.replace(/^www\./, "");
104
+ let videoId = "";
105
+ if (host === "youtu.be") videoId = parsed.pathname.slice(1).split("/")[0];
106
+ else if (host === "youtube.com" || host === "m.youtube.com" || host === "youtube-nocookie.com") {
107
+ if (parsed.pathname.startsWith("/embed/")) videoId = parsed.pathname.split("/")[2] ?? "";
108
+ else if (parsed.pathname.startsWith("/shorts/")) videoId = parsed.pathname.split("/")[2] ?? "";
109
+ else videoId = parsed.searchParams.get("v") ?? "";
110
+ }
111
+ return /^[\w-]{6,}$/.test(videoId) ? `https://www.youtube-nocookie.com/embed/${videoId}` : null;
112
+ } catch {
113
+ return null;
114
+ }
122
115
  }
123
116
  function toggleBlockCommand(id, type) {
124
- return {
125
- id,
126
- execute: editor => editor.toggleBlock(type),
127
- active: editor => editor.isBlockActive(type)
128
- };
117
+ return {
118
+ id,
119
+ execute: (editor) => editor.toggleBlock(type),
120
+ active: (editor) => editor.isBlockActive(type)
121
+ };
129
122
  }
130
123
  function textBlock(type, tagName, contentTagName) {
131
- return {
132
- type,
133
- tagName,
134
- contentTagName,
135
- create: () => ({
136
- id: createNgsHeadlessEditorId(type),
137
- type,
138
- content: [createNgsHeadlessEditorText()]
139
- })
140
- };
124
+ return {
125
+ type,
126
+ tagName,
127
+ contentTagName,
128
+ create: () => ({
129
+ id: createNgsHeadlessEditorId(type),
130
+ type,
131
+ content: [createNgsHeadlessEditorText()]
132
+ })
133
+ };
141
134
  }
142
135
  function mediaBlock(type, tagName, render) {
143
- return {
144
- type,
145
- tagName,
146
- editable: false,
147
- create: () => ({
148
- id: createNgsHeadlessEditorId(type),
149
- type,
150
- content: null
151
- }),
152
- render,
153
- isEmpty: () => false
154
- };
136
+ return {
137
+ type,
138
+ tagName,
139
+ editable: false,
140
+ create: () => ({
141
+ id: createNgsHeadlessEditorId(type),
142
+ type,
143
+ content: null
144
+ }),
145
+ render,
146
+ isEmpty: () => false
147
+ };
155
148
  }
156
149
  function renderImage(element, block) {
157
- element.classList.add('ngs-comment-editor-media', 'ngs-comment-editor-image');
158
- const image = element.ownerDocument.createElement('img');
159
- image.src = String(block.attrs?.['src'] ?? '');
160
- image.alt = String(block.attrs?.['alt'] ?? '');
161
- image.loading = 'lazy';
162
- element.append(image);
150
+ element.classList.add("ngs-comment-editor-media", "ngs-comment-editor-image");
151
+ const image = element.ownerDocument.createElement("img");
152
+ image.src = String(block.attrs?.["src"] ?? "");
153
+ image.alt = String(block.attrs?.["alt"] ?? "");
154
+ image.loading = "lazy";
155
+ element.append(image);
163
156
  }
164
157
  function renderImageUpload(element, block) {
165
- element.classList.add('ngs-comment-editor-media', 'ngs-comment-editor-image-upload');
166
- const image = element.ownerDocument.createElement('img');
167
- image.src = String(block.attrs?.['src'] ?? '');
168
- image.alt = '';
169
- element.append(image);
170
- const status = element.ownerDocument.createElement('span');
171
- status.className = 'ngs-comment-editor-upload-status';
172
- const error = String(block.attrs?.['error'] ?? '');
173
- status.textContent = error || 'Uploading image…';
174
- status.setAttribute('role', error ? 'alert' : 'status');
175
- element.append(status);
158
+ element.classList.add("ngs-comment-editor-media", "ngs-comment-editor-image-upload");
159
+ const image = element.ownerDocument.createElement("img");
160
+ image.src = String(block.attrs?.["src"] ?? "");
161
+ image.alt = "";
162
+ element.append(image);
163
+ const status = element.ownerDocument.createElement("span");
164
+ status.className = "ngs-comment-editor-upload-status";
165
+ const error = String(block.attrs?.["error"] ?? "");
166
+ status.textContent = error || "Uploading image…";
167
+ status.setAttribute("role", error ? "alert" : "status");
168
+ element.append(status);
176
169
  }
177
170
  function renderYoutube(element, block) {
178
- element.classList.add('ngs-comment-editor-media', 'ngs-comment-editor-youtube');
179
- const iframe = element.ownerDocument.createElement('iframe');
180
- iframe.src = String(block.attrs?.['src'] ?? '');
181
- iframe.title = 'YouTube video';
182
- iframe.loading = 'lazy';
183
- iframe.allow = 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture';
184
- iframe.setAttribute('allowfullscreen', '');
185
- element.append(iframe);
171
+ element.classList.add("ngs-comment-editor-media", "ngs-comment-editor-youtube");
172
+ const iframe = element.ownerDocument.createElement("iframe");
173
+ iframe.src = String(block.attrs?.["src"] ?? "");
174
+ iframe.title = "YouTube video";
175
+ iframe.loading = "lazy";
176
+ iframe.allow = "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture";
177
+ iframe.setAttribute("allowfullscreen", "");
178
+ element.append(iframe);
186
179
  }
187
-
188
180
  function serializeCommentEditorDocument(document) {
189
- if (document.blocks.every(block => (isNgsHeadlessEditorTextContent(block.content) &&
190
- block.content.every(run => run.text.trim().length === 0)))) {
191
- return '';
192
- }
193
- return document.blocks.map(serializeBlock).filter(Boolean).join('');
181
+ if (document.blocks.every((block) => isNgsHeadlessEditorTextContent(block.content) && block.content.every((run) => run.text.trim().length === 0))) return "";
182
+ return document.blocks.map(serializeBlock).filter(Boolean).join("");
194
183
  }
195
184
  function serializeBlock(block) {
196
- const text = isNgsHeadlessEditorTextContent(block.content)
197
- ? block.content.map(serializeText).join('')
198
- : '';
199
- switch (block.type) {
200
- case 'paragraph':
201
- return `<p>${text || '<br>'}</p>`;
202
- case 'blockquote':
203
- return `<blockquote>${text || '<br>'}</blockquote>`;
204
- case 'codeBlock':
205
- return `<pre><code>${stripInlineMarkup(text) || '<br>'}</code></pre>`;
206
- case 'bulletList':
207
- return `<ul><li>${text || '<br>'}</li></ul>`;
208
- case 'orderedList':
209
- return `<ol><li>${text || '<br>'}</li></ol>`;
210
- case 'image': {
211
- const src = escapeAttribute(String(block.attrs?.['src'] ?? ''));
212
- const alt = escapeAttribute(String(block.attrs?.['alt'] ?? ''));
213
- return src ? `<img src="${src}" alt="${alt}">` : '';
214
- }
215
- case 'youtube': {
216
- const src = escapeAttribute(String(block.attrs?.['src'] ?? ''));
217
- return src
218
- ? `<div data-youtube-video><iframe src="${src}" title="YouTube video" loading="lazy" allowfullscreen></iframe></div>`
219
- : '';
220
- }
221
- case 'imageUpload':
222
- return '';
223
- default:
224
- return text ? `<div data-ngs-headless-editor-block-type="${escapeAttribute(block.type)}">${text}</div>` : '';
225
- }
185
+ const text = isNgsHeadlessEditorTextContent(block.content) ? block.content.map(serializeText).join("") : "";
186
+ switch (block.type) {
187
+ case "paragraph": return `<p>${text || "<br>"}</p>`;
188
+ case "blockquote": return `<blockquote>${text || "<br>"}</blockquote>`;
189
+ case "codeBlock": return `<pre><code>${stripInlineMarkup(text) || "<br>"}</code></pre>`;
190
+ case "bulletList": return `<ul><li>${text || "<br>"}</li></ul>`;
191
+ case "orderedList": return `<ol><li>${text || "<br>"}</li></ol>`;
192
+ case "image": {
193
+ const src = escapeAttribute(String(block.attrs?.["src"] ?? ""));
194
+ const alt = escapeAttribute(String(block.attrs?.["alt"] ?? ""));
195
+ return src ? `<img src="${src}" alt="${alt}">` : "";
196
+ }
197
+ case "youtube": {
198
+ const src = escapeAttribute(String(block.attrs?.["src"] ?? ""));
199
+ return src ? `<div data-youtube-video><iframe src="${src}" title="YouTube video" loading="lazy" allowfullscreen></iframe></div>` : "";
200
+ }
201
+ case "imageUpload": return "";
202
+ default: return text ? `<div data-ngs-headless-editor-block-type="${escapeAttribute(block.type)}">${text}</div>` : "";
203
+ }
226
204
  }
227
205
  function serializeText(run) {
228
- let value = escapeHtml(run.text);
229
- for (const mark of run.marks) {
230
- value = wrapMark(value, mark);
231
- }
232
- return value;
206
+ let value = escapeHtml(run.text);
207
+ for (const mark of run.marks) value = wrapMark(value, mark);
208
+ return value;
233
209
  }
234
210
  function wrapMark(value, mark) {
235
- switch (mark.type) {
236
- case 'bold':
237
- return `<strong>${value}</strong>`;
238
- case 'italic':
239
- return `<em>${value}</em>`;
240
- case 'strike':
241
- return `<s>${value}</s>`;
242
- case 'code':
243
- return `<code>${value}</code>`;
244
- case 'singleEmoji':
245
- return `<span class="single-emoji">${value}</span>`;
246
- case 'textColor': {
247
- const color = normalizeNgsHeadlessEditorColor(String(mark.attrs?.['color'] ?? ''));
248
- return color ? `<span style="color: ${escapeAttribute(color)}">${value}</span>` : value;
249
- }
250
- case 'backgroundColor': {
251
- const color = normalizeNgsHeadlessEditorColor(String(mark.attrs?.['color'] ?? ''));
252
- return color
253
- ? `<span style="background-color: ${escapeAttribute(color)}">${value}</span>`
254
- : value;
255
- }
256
- case 'link': {
257
- // The document may come from storage or an API: never trust the raw href.
258
- const href = escapeAttribute(normalizeLinkUrl(String(mark.attrs?.['href'] ?? '')));
259
- return href
260
- ? `<a href="${href}" target="_blank" rel="noopener noreferrer">${value}</a>`
261
- : value;
262
- }
263
- default:
264
- return value;
265
- }
211
+ switch (mark.type) {
212
+ case "bold": return `<strong>${value}</strong>`;
213
+ case "italic": return `<em>${value}</em>`;
214
+ case "strike": return `<s>${value}</s>`;
215
+ case "code": return `<code>${value}</code>`;
216
+ case "singleEmoji": return `<span class="single-emoji">${value}</span>`;
217
+ case "textColor": {
218
+ const color = normalizeNgsHeadlessEditorColor(String(mark.attrs?.["color"] ?? ""));
219
+ return color ? `<span style="color: ${escapeAttribute(color)}">${value}</span>` : value;
220
+ }
221
+ case "backgroundColor": {
222
+ const color = normalizeNgsHeadlessEditorColor(String(mark.attrs?.["color"] ?? ""));
223
+ return color ? `<span style="background-color: ${escapeAttribute(color)}">${value}</span>` : value;
224
+ }
225
+ case "link": {
226
+ const href = escapeAttribute(normalizeLinkUrl(String(mark.attrs?.["href"] ?? "")));
227
+ return href ? `<a href="${href}" target="_blank" rel="noopener noreferrer">${value}</a>` : value;
228
+ }
229
+ default: return value;
230
+ }
266
231
  }
267
232
  function escapeHtml(value) {
268
- return value
269
- .replaceAll('&', '&amp;')
270
- .replaceAll('<', '&lt;')
271
- .replaceAll('>', '&gt;')
272
- .replaceAll('"', '&quot;')
273
- .replaceAll("'", '&#39;');
233
+ return value.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;").replaceAll("\"", "&quot;").replaceAll("'", "&#39;");
274
234
  }
275
235
  function escapeAttribute(value) {
276
- return escapeHtml(value);
236
+ return escapeHtml(value);
277
237
  }
278
238
  function stripInlineMarkup(value) {
279
- return value.replace(/<[^>]+>/g, '');
280
- }
281
-
282
- const COMMENT_EDITOR = new InjectionToken('COMMENT_EDITOR');
283
- const COMMENT_EDITOR_BUBBLE_MENU = new InjectionToken('COMMENT_EDITOR_BUBBLE_MENU');
284
-
285
- class CommentEditor {
286
- editor = inject(NgsHeadlessEditor);
287
- host = inject(ElementRef);
288
- renderer = inject(Renderer2);
289
- documentRef = inject(DOCUMENT);
290
- destroyRef = inject(DestroyRef);
291
- surface = viewChild.required(NgsHeadlessEditorSurface, /* @ts-ignore */
292
- ...(ngDevMode ? [{ debugName: "surface" }] : /* istanbul ignore next */ []));
293
- bubbleMenuLayer = viewChild('bubbleMenuLayer', /* @ts-ignore */
294
- ...(ngDevMode ? [{ debugName: "bubbleMenuLayer" }] : /* istanbul ignore next */ []));
295
- basicPlugin = basicTextEditorPlugin();
296
- colorPlugin = colorEditorPlugin();
297
- commentPlugin = commentEditorPlugin();
298
- toolbarActive = signal(false, /* @ts-ignore */
299
- ...(ngDevMode ? [{ debugName: "toolbarActive" }] : /* istanbul ignore next */ []));
300
- fullViewActive = signal(false, /* @ts-ignore */
301
- ...(ngDevMode ? [{ debugName: "fullViewActive" }] : /* istanbul ignore next */ []));
302
- bubbleMenuFrame = null;
303
- value = model(createNgsHeadlessEditorDocument(), /* @ts-ignore */
304
- ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
305
- plugins = input([], /* @ts-ignore */
306
- ...(ngDevMode ? [{ debugName: "plugins" }] : /* istanbul ignore next */ []));
307
- contentMaxHeight = input(/* @ts-ignore */
308
- ...(ngDevMode ? [undefined, { debugName: "contentMaxHeight" }] : /* istanbul ignore next */ []));
309
- buttonCancelLabel = input('Cancel', /* @ts-ignore */
310
- ...(ngDevMode ? [{ debugName: "buttonCancelLabel" }] : /* istanbul ignore next */ []));
311
- buttonSendLabel = input('Send', /* @ts-ignore */
312
- ...(ngDevMode ? [{ debugName: "buttonSendLabel" }] : /* istanbul ignore next */ []));
313
- buttonSubmitLabel = input(/* @ts-ignore */
314
- ...(ngDevMode ? [undefined, { debugName: "buttonSubmitLabel" }] : /* istanbul ignore next */ []));
315
- placeholder = input('Write something …', /* @ts-ignore */
316
- ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
317
- ariaLabel = input('Comment editor', /* @ts-ignore */
318
- ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
319
- toolbarAlwaysVisible = input(false, { ...(ngDevMode ? { debugName: "toolbarAlwaysVisible" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
320
- fullViewMode = input(false, { ...(ngDevMode ? { debugName: "fullViewMode" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
321
- cancelButtonAlwaysVisible = input(false, { ...(ngDevMode ? { debugName: "cancelButtonAlwaysVisible" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
322
- allowEmptyContent = input(false, { ...(ngDevMode ? { debugName: "allowEmptyContent" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
323
- allowEmpty = input(false, { ...(ngDevMode ? { debugName: "allowEmpty" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
324
- autoClear = input(true, { ...(ngDevMode ? { debugName: "autoClear" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
325
- loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
326
- disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
327
- readOnly = input(false, { ...(ngDevMode ? { debugName: "readOnly" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
328
- imageUploadFn = input(/* @ts-ignore */
329
- ...(ngDevMode ? [undefined, { debugName: "imageUploadFn" }] : /* istanbul ignore next */ []));
330
- submitted = output();
331
- sent = output();
332
- canceled = output();
333
- isEditorActivated = computed(() => this.fullViewActive() || this.fullViewMode(), /* @ts-ignore */
334
- ...(ngDevMode ? [{ debugName: "isEditorActivated" }] : /* istanbul ignore next */ []));
335
- isToolbarVisible = computed(() => ((this.toolbarActive() || this.toolbarAlwaysVisible()) && this.isEditorActivated()), /* @ts-ignore */
336
- ...(ngDevMode ? [{ debugName: "isToolbarVisible" }] : /* istanbul ignore next */ []));
337
- isBubbleMenuVisible = computed(() => {
338
- const selection = this.editor.selection();
339
- return this.editor.focused() && !!selection && (selection.anchor.blockId !== selection.focus.blockId ||
340
- selection.anchor.offset !== selection.focus.offset);
341
- }, /* @ts-ignore */
342
- ...(ngDevMode ? [{ debugName: "isBubbleMenuVisible" }] : /* istanbul ignore next */ []));
343
- isCancelVisible = computed(() => ((this.fullViewActive() && !this.fullViewMode()) || this.cancelButtonAlwaysVisible()), /* @ts-ignore */
344
- ...(ngDevMode ? [{ debugName: "isCancelVisible" }] : /* istanbul ignore next */ []));
345
- sendLabel = computed(() => this.buttonSubmitLabel() ?? this.buttonSendLabel(), /* @ts-ignore */
346
- ...(ngDevMode ? [{ debugName: "sendLabel" }] : /* istanbul ignore next */ []));
347
- sendDisabled = computed(() => (this.disabled() ||
348
- this.loading() ||
349
- (!(this.allowEmpty() || this.allowEmptyContent()) && this.editor.empty())), /* @ts-ignore */
350
- ...(ngDevMode ? [{ debugName: "sendDisabled" }] : /* istanbul ignore next */ []));
351
- commands = new Map([
352
- ['toggleBold', NGS_HEADLESS_EDITOR_TOGGLE_BOLD],
353
- ['toggleItalic', NGS_HEADLESS_EDITOR_TOGGLE_ITALIC],
354
- ['toggleStrike', NGS_HEADLESS_EDITOR_TOGGLE_STRIKE],
355
- ['toggleCode', NGS_HEADLESS_EDITOR_TOGGLE_CODE],
356
- ['toggleBlockquote', NGS_COMMENT_EDITOR_TOGGLE_BLOCKQUOTE],
357
- ['toggleCodeBlock', NGS_COMMENT_EDITOR_TOGGLE_CODE_BLOCK],
358
- ['toggleBulletList', NGS_COMMENT_EDITOR_TOGGLE_BULLET_LIST],
359
- ['toggleOrderedList', NGS_COMMENT_EDITOR_TOGGLE_ORDERED_LIST]
360
- ]);
361
- api = {
362
- isCommandDisabled: command => this.isCommandDisabled(command),
363
- isActive: command => this.isActive(command),
364
- runCommand: command => this.runCommand(command),
365
- editor: () => this.editor,
366
- document: () => this.editor.document(),
367
- isToolbarActive: () => this.toolbarActive(),
368
- toggleToolbar: () => this.toggleToolbar(),
369
- showToolbar: () => this.showToolbar(),
370
- hideToolbar: () => this.hideToolbar(),
371
- isEditorActivated: () => this.isEditorActivated(),
372
- showFullView: () => this.showFullView(),
373
- hideFullView: () => this.hideFullView(),
374
- insertText: text => this.insertText(text),
375
- insertImage: file => this.insertImage(file),
376
- insertYoutube: url => this.insertYoutube(url),
377
- getMarkAttributes: type => this.editor.getActiveMark(type)?.attrs,
378
- setTextColor: color => this.setTextColor(color),
379
- unsetTextColor: () => this.unsetTextColor(),
380
- setBackgroundColor: color => this.setBackgroundColor(color),
381
- unsetBackgroundColor: () => this.unsetBackgroundColor(),
382
- setLink: url => this.setLink(url),
383
- unsetLink: () => this.unsetLink(),
384
- clear: () => this.clear(),
385
- focus: () => this.focus()
386
- };
387
- constructor() {
388
- effect(() => {
389
- this.editor.setPlugins([
390
- this.basicPlugin,
391
- this.colorPlugin,
392
- this.commentPlugin,
393
- ...this.plugins()
394
- ]);
395
- });
396
- effect(() => {
397
- const value = this.value();
398
- untracked(() => {
399
- if (!ngsHeadlessEditorDocumentsEqual(value, this.editor.document())) {
400
- this.editor.setDocument(value);
401
- }
402
- });
403
- });
404
- effect(() => {
405
- const document = this.editor.document();
406
- if (this.editor.origin() !== 'external' && !ngsHeadlessEditorDocumentsEqual(document, this.value())) {
407
- this.value.set(document);
408
- }
409
- });
410
- effect(() => {
411
- this.editor.setReadOnly(this.disabled() || this.readOnly());
412
- });
413
- effect(() => {
414
- const maxHeight = this.contentMaxHeight();
415
- if (typeof maxHeight === 'number') {
416
- this.renderer.setStyle(this.host.nativeElement, '--ngs-comment-editor-content-max-height', `${Math.max(0, maxHeight)}px`);
417
- }
418
- else {
419
- this.renderer.removeStyle(this.host.nativeElement, '--ngs-comment-editor-content-max-height');
420
- }
421
- });
422
- effect(() => {
423
- this.editor.selection();
424
- this.editor.focused();
425
- this.editor.revision();
426
- const layer = this.bubbleMenuLayer();
427
- if (layer && this.isBubbleMenuVisible()) {
428
- untracked(() => this.scheduleBubbleMenuPosition());
429
- }
430
- });
431
- afterNextRender(() => {
432
- const windowRef = this.documentRef.defaultView;
433
- if (!windowRef) {
434
- return;
435
- }
436
- const reposition = () => this.scheduleBubbleMenuPosition();
437
- windowRef.addEventListener('resize', reposition);
438
- this.documentRef.addEventListener('scroll', reposition, true);
439
- this.destroyRef.onDestroy(() => {
440
- windowRef.removeEventListener('resize', reposition);
441
- this.documentRef.removeEventListener('scroll', reposition, true);
442
- if (this.bubbleMenuFrame !== null) {
443
- windowRef.cancelAnimationFrame(this.bubbleMenuFrame);
444
- }
445
- });
446
- });
447
- }
448
- insertText(text) {
449
- if (!text || this.disabled() || this.readOnly()) {
450
- return;
451
- }
452
- if (!this.editor.focused()) {
453
- const lastTextBlock = [...this.editor.document().blocks]
454
- .reverse()
455
- .find(block => Array.isArray(block.content));
456
- if (lastTextBlock) {
457
- const offset = getNgsHeadlessEditorBlockText(lastTextBlock).length;
458
- this.editor.setSelection({
459
- anchor: { blockId: lastTextBlock.id, offset },
460
- focus: { blockId: lastTextBlock.id, offset }
461
- });
462
- }
463
- else {
464
- const paragraph = createNgsHeadlessEditorParagraph();
465
- this.editor.insertBlock(paragraph, true);
466
- }
467
- }
468
- const value = getNgsHeadlessEditorDocumentText(this.editor.document()).length > 0 && !this.editor.focused()
469
- ? ` ${text} `
470
- : text;
471
- const singleEmoji = isOnlyEmoji(text) && this.currentBlockIsEmpty();
472
- if (singleEmoji) {
473
- this.editor.setMark('singleEmoji');
474
- }
475
- this.editor.insertText(value, 'api');
476
- if (singleEmoji) {
477
- this.editor.unsetMark('singleEmoji');
478
- }
479
- this.showFullView();
480
- queueMicrotask(() => this.focus());
481
- }
482
- isCommandDisabled(command) {
483
- if (command === 'toggleLink') {
484
- const selection = this.editor.selection();
485
- const collapsed = !selection || (selection.anchor.blockId === selection.focus.blockId &&
486
- selection.anchor.offset === selection.focus.offset);
487
- return this.editor.readOnly() || collapsed ? true : null;
488
- }
489
- const resolved = this.commands.get(command);
490
- return !resolved || !this.editor.isCommandEnabled(resolved) ? true : null;
491
- }
492
- isActive(command) {
493
- const markAliases = {
494
- bold: 'bold',
495
- italic: 'italic',
496
- strike: 'strike',
497
- code: 'code',
498
- link: 'link'
499
- };
500
- if (markAliases[command]) {
501
- return this.editor.isMarkActive(markAliases[command]);
502
- }
503
- const resolved = this.commands.get(command);
504
- return resolved ? this.editor.isCommandActive(resolved) : false;
505
- }
506
- runCommand(command) {
507
- const resolved = this.commands.get(command);
508
- if (resolved) {
509
- this.editor.execute(resolved);
510
- this.focus();
511
- }
512
- }
513
- send(event) {
514
- event?.stopPropagation();
515
- event?.preventDefault();
516
- if (this.sendDisabled()) {
517
- return;
518
- }
519
- const document = this.editor.document();
520
- this.submitted.emit(document);
521
- this.sent.emit(serializeCommentEditorDocument(document));
522
- if (this.autoClear()) {
523
- this.toolbarActive.set(false);
524
- this.fullViewActive.set(false);
525
- this.clear();
526
- }
527
- }
528
- submit(event) {
529
- this.send(event);
530
- }
531
- cancel(event) {
532
- event?.stopPropagation();
533
- event?.preventDefault();
534
- this.toolbarActive.set(false);
535
- this.fullViewActive.set(false);
536
- this.clear();
537
- this.canceled.emit();
538
- }
539
- clear() {
540
- this.editor.clear();
541
- }
542
- activateFullView(event) {
543
- if (event) {
544
- const target = event.target;
545
- if (target.closest('button, a')) {
546
- return;
547
- }
548
- }
549
- this.showFullView();
550
- }
551
- showFullView() {
552
- this.fullViewActive.set(true);
553
- }
554
- hideFullView() {
555
- this.fullViewActive.set(false);
556
- }
557
- toggleToolbar() {
558
- this.toolbarActive.update(visible => !visible);
559
- }
560
- showToolbar() {
561
- this.toolbarActive.set(true);
562
- }
563
- hideToolbar() {
564
- this.toolbarActive.set(false);
565
- }
566
- focus() {
567
- this.surface().focus();
568
- }
569
- setLink(url) {
570
- if (!url.trim()) {
571
- return this.unsetLink();
572
- }
573
- return this.editor.execute(NGS_COMMENT_EDITOR_SET_LINK, url);
574
- }
575
- setTextColor(color) {
576
- return this.editor.execute(NGS_HEADLESS_EDITOR_SET_TEXT_COLOR, color);
577
- }
578
- unsetTextColor() {
579
- return this.editor.execute(NGS_HEADLESS_EDITOR_UNSET_TEXT_COLOR);
580
- }
581
- setBackgroundColor(color) {
582
- return this.editor.execute(NGS_HEADLESS_EDITOR_SET_BACKGROUND_COLOR, color);
583
- }
584
- unsetBackgroundColor() {
585
- return this.editor.execute(NGS_HEADLESS_EDITOR_UNSET_BACKGROUND_COLOR);
586
- }
587
- unsetLink() {
588
- return this.editor.execute(NGS_COMMENT_EDITOR_UNSET_LINK);
589
- }
590
- insertYoutube(url) {
591
- const src = normalizeYoutubeUrl(url);
592
- if (!src) {
593
- return false;
594
- }
595
- const inserted = this.editor.insertBlock(createCommentEditorMediaBlock('youtube', { src }));
596
- if (inserted) {
597
- this.showFullView();
598
- }
599
- return inserted;
600
- }
601
- insertImage(file) {
602
- if (this.disabled() || this.readOnly()) {
603
- return;
604
- }
605
- void this.readFile(file).then(preview => {
606
- const block = createCommentEditorMediaBlock('imageUpload', {
607
- src: preview,
608
- status: 'uploading'
609
- });
610
- if (!this.editor.insertBlock(block)) {
611
- return;
612
- }
613
- this.showFullView();
614
- const upload = this.imageUploadFn();
615
- const result = upload ? upload(file) : Promise.resolve(preview);
616
- result.then(src => this.editor.updateBlock(block.id, {
617
- type: 'image',
618
- attrs: { src, alt: file.name }
619
- }), error => this.editor.updateBlock(block.id, {
620
- attrs: {
621
- src: preview,
622
- status: 'error',
623
- error: error instanceof Error ? error.message : String(error)
624
- }
625
- }));
626
- });
627
- }
628
- currentBlockIsEmpty() {
629
- const selection = this.editor.selection();
630
- const block = this.editor.document().blocks.find(item => item.id === selection?.focus.blockId);
631
- return !!block && getNgsHeadlessEditorBlockText(block).length === 0;
632
- }
633
- readFile(file) {
634
- return new Promise((resolve, reject) => {
635
- const reader = new FileReader();
636
- reader.onload = () => resolve(String(reader.result ?? ''));
637
- reader.onerror = () => reject(reader.error ?? new Error('Unable to read image'));
638
- reader.readAsDataURL(file);
639
- });
640
- }
641
- scheduleBubbleMenuPosition() {
642
- const windowRef = this.documentRef.defaultView;
643
- if (!windowRef) {
644
- return;
645
- }
646
- if (this.bubbleMenuFrame !== null) {
647
- windowRef.cancelAnimationFrame(this.bubbleMenuFrame);
648
- }
649
- this.bubbleMenuFrame = windowRef.requestAnimationFrame(() => {
650
- this.bubbleMenuFrame = null;
651
- this.positionBubbleMenu();
652
- });
653
- }
654
- positionBubbleMenu() {
655
- const layer = this.bubbleMenuLayer()?.nativeElement;
656
- if (!layer) {
657
- return;
658
- }
659
- const selectionRect = this.surface().getSelectionRect();
660
- if (!selectionRect || !this.isBubbleMenuVisible()) {
661
- this.renderer.removeClass(layer, 'bubble-menu-positioned');
662
- return;
663
- }
664
- const viewportWidth = this.documentRef.documentElement.clientWidth;
665
- const layerWidth = layer.getBoundingClientRect().width;
666
- const edge = 8;
667
- const halfWidth = layerWidth / 2;
668
- const selectionCenter = selectionRect.left + selectionRect.width / 2;
669
- const x = layerWidth + edge * 2 >= viewportWidth
670
- ? viewportWidth / 2
671
- : Math.min(Math.max(selectionCenter, edge + halfWidth), viewportWidth - edge - halfWidth);
672
- this.renderer.setStyle(layer, 'left', `${x}px`);
673
- this.renderer.setStyle(layer, 'top', `${selectionRect.top}px`);
674
- this.renderer.addClass(layer, 'bubble-menu-positioned');
675
- }
676
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CommentEditor, deps: [], target: i0.ɵɵFactoryTarget.Component });
677
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: CommentEditor, isStandalone: true, selector: "ngs-comment-editor", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, plugins: { classPropertyName: "plugins", publicName: "plugins", isSignal: true, isRequired: false, transformFunction: null }, contentMaxHeight: { classPropertyName: "contentMaxHeight", publicName: "contentMaxHeight", isSignal: true, isRequired: false, transformFunction: null }, buttonCancelLabel: { classPropertyName: "buttonCancelLabel", publicName: "buttonCancelLabel", isSignal: true, isRequired: false, transformFunction: null }, buttonSendLabel: { classPropertyName: "buttonSendLabel", publicName: "buttonSendLabel", isSignal: true, isRequired: false, transformFunction: null }, buttonSubmitLabel: { classPropertyName: "buttonSubmitLabel", publicName: "buttonSubmitLabel", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, toolbarAlwaysVisible: { classPropertyName: "toolbarAlwaysVisible", publicName: "toolbarAlwaysVisible", isSignal: true, isRequired: false, transformFunction: null }, fullViewMode: { classPropertyName: "fullViewMode", publicName: "fullViewMode", isSignal: true, isRequired: false, transformFunction: null }, cancelButtonAlwaysVisible: { classPropertyName: "cancelButtonAlwaysVisible", publicName: "cancelButtonAlwaysVisible", isSignal: true, isRequired: false, transformFunction: null }, allowEmptyContent: { classPropertyName: "allowEmptyContent", publicName: "allowEmptyContent", isSignal: true, isRequired: false, transformFunction: null }, allowEmpty: { classPropertyName: "allowEmpty", publicName: "allowEmpty", isSignal: true, isRequired: false, transformFunction: null }, autoClear: { classPropertyName: "autoClear", publicName: "autoClear", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null }, imageUploadFn: { classPropertyName: "imageUploadFn", publicName: "imageUploadFn", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", submitted: "submitted", sent: "sent", canceled: "canceled" }, host: { listeners: { "click": "activateFullView($event)" }, properties: { "class.full-view": "isEditorActivated()", "class.ngs-comment-editor-disabled": "disabled()" }, classAttribute: "ngs-comment-editor" }, providers: [
678
- provideNgsHeadlessEditor(),
679
- {
680
- provide: COMMENT_EDITOR,
681
- useExisting: forwardRef(() => CommentEditor)
682
- }
683
- ], viewQueries: [{ propertyName: "surface", first: true, predicate: NgsHeadlessEditorSurface, descendants: true, isSignal: true }, { propertyName: "bubbleMenuLayer", first: true, predicate: ["bubbleMenuLayer"], descendants: true, isSignal: true }], exportAs: ["ngsCommentEditor"], ngImport: i0, template: "@if (isToolbarVisible()) {\n <div class=\"toolbar\">\n <ng-content select=\"ngs-comment-editor-toolbar\"/>\n </div>\n}\n\n<div\n class=\"content\"\n ngsHeadlessEditorSurface\n [placeholder]=\"placeholder()\"\n [ariaLabel]=\"ariaLabel()\"\n [disabled]=\"disabled()\">\n</div>\n\n<div class=\"editor-content\">\n <ng-content/>\n</div>\n\n<div class=\"footer\">\n <div class=\"footer-tools\">\n <ng-content select=\"ngs-comment-editor-footer-bar\"/>\n </div>\n <div class=\"footer-actions\">\n @if (isCancelVisible()) {\n <button\n type=\"button\"\n ngsButton\n [disabled]=\"disabled() || loading()\"\n (click)=\"cancel($event)\">\n {{ buttonCancelLabel() }}\n </button>\n }\n <button\n type=\"button\"\n ngsButton=\"filled\"\n [disabled]=\"sendDisabled()\"\n [loading]=\"loading()\"\n (click)=\"send($event)\">\n {{ sendLabel() }}\n </button>\n </div>\n</div>\n\n@if (isBubbleMenuVisible()) {\n <div #bubbleMenuLayer class=\"bubble-menu-layer\">\n <ng-content select=\"ngs-comment-editor-bubble-menu\"/>\n </div>\n}\n", styles: [":host{--ngs-comment-editor-bg: transparent;--ngs-comment-editor-content-max-height: 9999px;display:block;position:relative;overflow:hidden;background:var(--ngs-comment-editor-bg)}:host .content{box-sizing:border-box;position:absolute;inset:0;height:calc(var(--spacing, .25rem) * 14);min-height:calc(var(--spacing, .25rem) * 10);padding:calc(var(--spacing, .25rem) * 4);outline:none;overflow:hidden;overflow-wrap:anywhere;white-space:pre-wrap;font-size:var(--ngs-font-size-sm);line-height:var(--ngs-line-height-base)}:host .content ::ng-deep [data-ngs-headless-editor-placeholder]{position:relative}:host .content ::ng-deep [data-ngs-headless-editor-placeholder]:before{content:attr(data-ngs-headless-editor-placeholder);color:var(--ngs-color-neutral-500);pointer-events:none;position:absolute;inset-block-start:0;inset-inline-start:0;font:inherit}:host .content ::ng-deep p,:host .content ::ng-deep blockquote,:host .content ::ng-deep pre,:host .content ::ng-deep ul,:host .content ::ng-deep ol{margin:0;min-height:1.5em}:host .content ::ng-deep p+p,:host .content ::ng-deep p+blockquote,:host .content ::ng-deep p+pre,:host .content ::ng-deep p+ul,:host .content ::ng-deep p+ol,:host .content ::ng-deep blockquote+p,:host .content ::ng-deep blockquote+blockquote,:host .content ::ng-deep blockquote+pre,:host .content ::ng-deep blockquote+ul,:host .content ::ng-deep blockquote+ol,:host .content ::ng-deep pre+p,:host .content ::ng-deep pre+blockquote,:host .content ::ng-deep pre+pre,:host .content ::ng-deep pre+ul,:host .content ::ng-deep pre+ol,:host .content ::ng-deep ul+p,:host .content ::ng-deep ul+blockquote,:host .content ::ng-deep ul+pre,:host .content ::ng-deep ul+ul,:host .content ::ng-deep ul+ol,:host .content ::ng-deep ol+p,:host .content ::ng-deep ol+blockquote,:host .content ::ng-deep ol+pre,:host .content ::ng-deep ol+ul,:host .content ::ng-deep ol+ol{margin-top:calc(var(--spacing, .25rem) * 2)}:host .content ::ng-deep blockquote{padding-inline-start:calc(var(--spacing, .25rem) * 3);border-inline-start:3px solid var(--ngs-color-border);color:var(--ngs-color-neutral-600)}:host .content ::ng-deep pre{padding:calc(var(--spacing, .25rem) * 3);border-radius:var(--ngs-radius-md);background:var(--ngs-color-surface-container-high);font-family:var(--ngs-font-family-mono);white-space:pre-wrap}:host .content ::ng-deep ul{list-style:disc;padding-inline-start:calc(var(--spacing, .25rem) * 6)}:host .content ::ng-deep ol{list-style:decimal;padding-inline-start:calc(var(--spacing, .25rem) * 6)}:host .content ::ng-deep code{padding:0 var(--spacing, .25rem);border-radius:var(--ngs-radius-xs);background:var(--ngs-color-surface-container-high);font-family:var(--ngs-font-family-mono)}:host .content ::ng-deep a[data-ngs-headless-editor-mark=link]{color:var(--ngs-color-primary);text-decoration-line:underline;text-decoration-thickness:1px;text-underline-offset:.15em;cursor:pointer}:host .content ::ng-deep .single-emoji{font-size:var(--ngs-font-size-3xl)}:host .content ::ng-deep .ngs-comment-editor-media{position:relative;display:flex;align-items:center;justify-content:center;margin:calc(var(--spacing, .25rem) * 6) 0;max-width:100%}:host .content ::ng-deep .ngs-comment-editor-media img{display:block;height:auto;max-width:100%}:host .content ::ng-deep .ngs-comment-editor-image-upload img{opacity:.7}:host .content ::ng-deep .ngs-comment-editor-image-upload .ngs-comment-editor-upload-status{position:absolute;inset-inline:calc(var(--spacing, .25rem) * 3);top:calc(var(--spacing, .25rem) * 3);padding:calc(var(--spacing, .25rem) * 2) calc(var(--spacing, .25rem) * 3);border-radius:var(--ngs-radius-sm);background:var(--ngs-color-surface-container-highest);color:var(--ngs-color-on-surface);font-size:var(--ngs-font-size-xs);box-shadow:var(--ngs-shadow-sm)}:host .content ::ng-deep .ngs-comment-editor-image-upload .ngs-comment-editor-upload-status[role=alert]{background:var(--ngs-color-danger);color:var(--ngs-color-on-danger)}:host .content ::ng-deep .ngs-comment-editor-youtube{background:var(--ngs-color-neutral-100);padding:calc(var(--spacing, .25rem) * 3)}:host .content ::ng-deep .ngs-comment-editor-youtube iframe{display:block;width:100%;min-width:200px;min-height:200px;aspect-ratio:16/9;border:0}:host .editor-content{padding:0 calc(var(--spacing, .25rem) * 4)}:host .editor-content:empty{display:none}:host .footer{height:calc(var(--spacing, .25rem) * 14);padding:0 calc(var(--spacing, .25rem) * 2.5);display:flex;align-items:center;justify-content:space-between}:host .footer-tools{display:flex;align-items:center;flex:1 1 auto;min-width:0;padding-inline-end:calc(var(--spacing, .25rem) * 3)}:host .footer-actions{display:flex;align-items:center;flex:none;gap:calc(var(--spacing, .25rem) * 2)}:host .toolbar{height:calc(var(--spacing, .25rem) * 14);padding:0 calc(var(--spacing, .25rem) * 3);display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--ngs-color-border)}:host .bubble-menu-layer{position:fixed;z-index:999;top:0;left:0;visibility:hidden;transform:translate(-50%,calc(-100% - calc(var(--spacing, .25rem) * 2)))}:host .bubble-menu-layer.bubble-menu-positioned{visibility:visible}:host .button.active{background:var(--ngs-color-neutral-200)}:host ::ng-deep .button.active{background:var(--ngs-color-neutral-200)}:host.full-view .content{position:static;height:auto;min-height:calc(var(--spacing, .25rem) * 12);max-height:var(--ngs-comment-editor-content-max-height);overflow-y:auto}:host.ngs-comment-editor-disabled{opacity:.7}:host-context(html.dark) .button.active{background:var(--ngs-color-neutral-650);color:var(--ngs-color-neutral-200)}:host-context(html.dark) ::ng-deep .button.active{background:var(--ngs-color-neutral-650);color:var(--ngs-color-neutral-200)}:host-context(html.dark) .content .ngs-comment-editor-youtube{background:var(--ngs-color-neutral-800)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "component", type: Button, selector: " button[ngsButton], button[ngsIconButton], a[ngsButton], a[ngsIconButton] ", inputs: ["ngsButton", "ngsIconButton", "loading", "disabled", "disabledInteractive", "disableRipple", "reverse", "fullWidth", "hideTextOnMobile"], exportAs: ["ngsButton"] }, { kind: "directive", type: NgsHeadlessEditorSurface, selector: "[ngsHeadlessEditorSurface]", inputs: ["placeholder", "ariaLabel", "disabled", "spellcheck"], exportAs: ["ngsHeadlessEditorSurface"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
239
+ return value.replace(/<[^>]+>/g, "");
684
240
  }
685
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CommentEditor, decorators: [{
686
- type: Component,
687
- args: [{ selector: 'ngs-comment-editor', exportAs: 'ngsCommentEditor', imports: [Button, NgsHeadlessEditorSurface], providers: [
688
- provideNgsHeadlessEditor(),
689
- {
690
- provide: COMMENT_EDITOR,
691
- useExisting: forwardRef(() => CommentEditor)
692
- }
693
- ], changeDetection: ChangeDetectionStrategy.OnPush, host: {
694
- 'class': 'ngs-comment-editor',
695
- '[class.full-view]': 'isEditorActivated()',
696
- '[class.ngs-comment-editor-disabled]': 'disabled()',
697
- '(click)': 'activateFullView($event)'
698
- }, template: "@if (isToolbarVisible()) {\n <div class=\"toolbar\">\n <ng-content select=\"ngs-comment-editor-toolbar\"/>\n </div>\n}\n\n<div\n class=\"content\"\n ngsHeadlessEditorSurface\n [placeholder]=\"placeholder()\"\n [ariaLabel]=\"ariaLabel()\"\n [disabled]=\"disabled()\">\n</div>\n\n<div class=\"editor-content\">\n <ng-content/>\n</div>\n\n<div class=\"footer\">\n <div class=\"footer-tools\">\n <ng-content select=\"ngs-comment-editor-footer-bar\"/>\n </div>\n <div class=\"footer-actions\">\n @if (isCancelVisible()) {\n <button\n type=\"button\"\n ngsButton\n [disabled]=\"disabled() || loading()\"\n (click)=\"cancel($event)\">\n {{ buttonCancelLabel() }}\n </button>\n }\n <button\n type=\"button\"\n ngsButton=\"filled\"\n [disabled]=\"sendDisabled()\"\n [loading]=\"loading()\"\n (click)=\"send($event)\">\n {{ sendLabel() }}\n </button>\n </div>\n</div>\n\n@if (isBubbleMenuVisible()) {\n <div #bubbleMenuLayer class=\"bubble-menu-layer\">\n <ng-content select=\"ngs-comment-editor-bubble-menu\"/>\n </div>\n}\n", styles: [":host{--ngs-comment-editor-bg: transparent;--ngs-comment-editor-content-max-height: 9999px;display:block;position:relative;overflow:hidden;background:var(--ngs-comment-editor-bg)}:host .content{box-sizing:border-box;position:absolute;inset:0;height:calc(var(--spacing, .25rem) * 14);min-height:calc(var(--spacing, .25rem) * 10);padding:calc(var(--spacing, .25rem) * 4);outline:none;overflow:hidden;overflow-wrap:anywhere;white-space:pre-wrap;font-size:var(--ngs-font-size-sm);line-height:var(--ngs-line-height-base)}:host .content ::ng-deep [data-ngs-headless-editor-placeholder]{position:relative}:host .content ::ng-deep [data-ngs-headless-editor-placeholder]:before{content:attr(data-ngs-headless-editor-placeholder);color:var(--ngs-color-neutral-500);pointer-events:none;position:absolute;inset-block-start:0;inset-inline-start:0;font:inherit}:host .content ::ng-deep p,:host .content ::ng-deep blockquote,:host .content ::ng-deep pre,:host .content ::ng-deep ul,:host .content ::ng-deep ol{margin:0;min-height:1.5em}:host .content ::ng-deep p+p,:host .content ::ng-deep p+blockquote,:host .content ::ng-deep p+pre,:host .content ::ng-deep p+ul,:host .content ::ng-deep p+ol,:host .content ::ng-deep blockquote+p,:host .content ::ng-deep blockquote+blockquote,:host .content ::ng-deep blockquote+pre,:host .content ::ng-deep blockquote+ul,:host .content ::ng-deep blockquote+ol,:host .content ::ng-deep pre+p,:host .content ::ng-deep pre+blockquote,:host .content ::ng-deep pre+pre,:host .content ::ng-deep pre+ul,:host .content ::ng-deep pre+ol,:host .content ::ng-deep ul+p,:host .content ::ng-deep ul+blockquote,:host .content ::ng-deep ul+pre,:host .content ::ng-deep ul+ul,:host .content ::ng-deep ul+ol,:host .content ::ng-deep ol+p,:host .content ::ng-deep ol+blockquote,:host .content ::ng-deep ol+pre,:host .content ::ng-deep ol+ul,:host .content ::ng-deep ol+ol{margin-top:calc(var(--spacing, .25rem) * 2)}:host .content ::ng-deep blockquote{padding-inline-start:calc(var(--spacing, .25rem) * 3);border-inline-start:3px solid var(--ngs-color-border);color:var(--ngs-color-neutral-600)}:host .content ::ng-deep pre{padding:calc(var(--spacing, .25rem) * 3);border-radius:var(--ngs-radius-md);background:var(--ngs-color-surface-container-high);font-family:var(--ngs-font-family-mono);white-space:pre-wrap}:host .content ::ng-deep ul{list-style:disc;padding-inline-start:calc(var(--spacing, .25rem) * 6)}:host .content ::ng-deep ol{list-style:decimal;padding-inline-start:calc(var(--spacing, .25rem) * 6)}:host .content ::ng-deep code{padding:0 var(--spacing, .25rem);border-radius:var(--ngs-radius-xs);background:var(--ngs-color-surface-container-high);font-family:var(--ngs-font-family-mono)}:host .content ::ng-deep a[data-ngs-headless-editor-mark=link]{color:var(--ngs-color-primary);text-decoration-line:underline;text-decoration-thickness:1px;text-underline-offset:.15em;cursor:pointer}:host .content ::ng-deep .single-emoji{font-size:var(--ngs-font-size-3xl)}:host .content ::ng-deep .ngs-comment-editor-media{position:relative;display:flex;align-items:center;justify-content:center;margin:calc(var(--spacing, .25rem) * 6) 0;max-width:100%}:host .content ::ng-deep .ngs-comment-editor-media img{display:block;height:auto;max-width:100%}:host .content ::ng-deep .ngs-comment-editor-image-upload img{opacity:.7}:host .content ::ng-deep .ngs-comment-editor-image-upload .ngs-comment-editor-upload-status{position:absolute;inset-inline:calc(var(--spacing, .25rem) * 3);top:calc(var(--spacing, .25rem) * 3);padding:calc(var(--spacing, .25rem) * 2) calc(var(--spacing, .25rem) * 3);border-radius:var(--ngs-radius-sm);background:var(--ngs-color-surface-container-highest);color:var(--ngs-color-on-surface);font-size:var(--ngs-font-size-xs);box-shadow:var(--ngs-shadow-sm)}:host .content ::ng-deep .ngs-comment-editor-image-upload .ngs-comment-editor-upload-status[role=alert]{background:var(--ngs-color-danger);color:var(--ngs-color-on-danger)}:host .content ::ng-deep .ngs-comment-editor-youtube{background:var(--ngs-color-neutral-100);padding:calc(var(--spacing, .25rem) * 3)}:host .content ::ng-deep .ngs-comment-editor-youtube iframe{display:block;width:100%;min-width:200px;min-height:200px;aspect-ratio:16/9;border:0}:host .editor-content{padding:0 calc(var(--spacing, .25rem) * 4)}:host .editor-content:empty{display:none}:host .footer{height:calc(var(--spacing, .25rem) * 14);padding:0 calc(var(--spacing, .25rem) * 2.5);display:flex;align-items:center;justify-content:space-between}:host .footer-tools{display:flex;align-items:center;flex:1 1 auto;min-width:0;padding-inline-end:calc(var(--spacing, .25rem) * 3)}:host .footer-actions{display:flex;align-items:center;flex:none;gap:calc(var(--spacing, .25rem) * 2)}:host .toolbar{height:calc(var(--spacing, .25rem) * 14);padding:0 calc(var(--spacing, .25rem) * 3);display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--ngs-color-border)}:host .bubble-menu-layer{position:fixed;z-index:999;top:0;left:0;visibility:hidden;transform:translate(-50%,calc(-100% - calc(var(--spacing, .25rem) * 2)))}:host .bubble-menu-layer.bubble-menu-positioned{visibility:visible}:host .button.active{background:var(--ngs-color-neutral-200)}:host ::ng-deep .button.active{background:var(--ngs-color-neutral-200)}:host.full-view .content{position:static;height:auto;min-height:calc(var(--spacing, .25rem) * 12);max-height:var(--ngs-comment-editor-content-max-height);overflow-y:auto}:host.ngs-comment-editor-disabled{opacity:.7}:host-context(html.dark) .button.active{background:var(--ngs-color-neutral-650);color:var(--ngs-color-neutral-200)}:host-context(html.dark) ::ng-deep .button.active{background:var(--ngs-color-neutral-650);color:var(--ngs-color-neutral-200)}:host-context(html.dark) .content .ngs-comment-editor-youtube{background:var(--ngs-color-neutral-800)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"] }]
699
- }], ctorParameters: () => [], propDecorators: { surface: [{ type: i0.ViewChild, args: [i0.forwardRef(() => NgsHeadlessEditorSurface), { isSignal: true }] }], bubbleMenuLayer: [{ type: i0.ViewChild, args: ['bubbleMenuLayer', { isSignal: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], plugins: [{ type: i0.Input, args: [{ isSignal: true, alias: "plugins", required: false }] }], contentMaxHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "contentMaxHeight", required: false }] }], buttonCancelLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "buttonCancelLabel", required: false }] }], buttonSendLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "buttonSendLabel", required: false }] }], buttonSubmitLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "buttonSubmitLabel", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], toolbarAlwaysVisible: [{ type: i0.Input, args: [{ isSignal: true, alias: "toolbarAlwaysVisible", required: false }] }], fullViewMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullViewMode", required: false }] }], cancelButtonAlwaysVisible: [{ type: i0.Input, args: [{ isSignal: true, alias: "cancelButtonAlwaysVisible", required: false }] }], allowEmptyContent: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowEmptyContent", required: false }] }], allowEmpty: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowEmpty", required: false }] }], autoClear: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoClear", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readOnly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readOnly", required: false }] }], imageUploadFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "imageUploadFn", required: false }] }], submitted: [{ type: i0.Output, args: ["submitted"] }], sent: [{ type: i0.Output, args: ["sent"] }], canceled: [{ type: i0.Output, args: ["canceled"] }] } });
241
+ const COMMENT_EDITOR = new InjectionToken("COMMENT_EDITOR");
242
+ const COMMENT_EDITOR_BUBBLE_MENU = new InjectionToken("COMMENT_EDITOR_BUBBLE_MENU");
243
+ var CommentEditor = class CommentEditor {
244
+ editor = inject(NgsHeadlessEditor);
245
+ host = inject(ElementRef);
246
+ renderer = inject(Renderer2);
247
+ documentRef = inject(DOCUMENT);
248
+ destroyRef = inject(DestroyRef);
249
+ surface = viewChild.required(NgsHeadlessEditorSurface, ...ngDevMode ? [{ debugName: "surface" }] : /* istanbul ignore next */ []);
250
+ bubbleMenuLayer = viewChild("bubbleMenuLayer", ...ngDevMode ? [{ debugName: "bubbleMenuLayer" }] : /* istanbul ignore next */ []);
251
+ basicPlugin = basicTextEditorPlugin();
252
+ colorPlugin = colorEditorPlugin();
253
+ commentPlugin = commentEditorPlugin();
254
+ toolbarActive = signal(false, ...ngDevMode ? [{ debugName: "toolbarActive" }] : /* istanbul ignore next */ []);
255
+ fullViewActive = signal(false, ...ngDevMode ? [{ debugName: "fullViewActive" }] : /* istanbul ignore next */ []);
256
+ bubbleMenuFrame = null;
257
+ value = model(createNgsHeadlessEditorDocument(), ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
258
+ plugins = input([], ...ngDevMode ? [{ debugName: "plugins" }] : /* istanbul ignore next */ []);
259
+ contentMaxHeight = input(...ngDevMode ? [void 0, { debugName: "contentMaxHeight" }] : /* istanbul ignore next */ []);
260
+ buttonCancelLabel = input("Cancel", ...ngDevMode ? [{ debugName: "buttonCancelLabel" }] : /* istanbul ignore next */ []);
261
+ buttonSendLabel = input("Send", ...ngDevMode ? [{ debugName: "buttonSendLabel" }] : /* istanbul ignore next */ []);
262
+ buttonSubmitLabel = input(...ngDevMode ? [void 0, { debugName: "buttonSubmitLabel" }] : /* istanbul ignore next */ []);
263
+ placeholder = input("Write something …", ...ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []);
264
+ ariaLabel = input("Comment editor", ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
265
+ toolbarAlwaysVisible = input(false, {
266
+ ...ngDevMode ? { debugName: "toolbarAlwaysVisible" } : /* istanbul ignore next */ {},
267
+ transform: booleanAttribute
268
+ });
269
+ fullViewMode = input(false, {
270
+ ...ngDevMode ? { debugName: "fullViewMode" } : /* istanbul ignore next */ {},
271
+ transform: booleanAttribute
272
+ });
273
+ cancelButtonAlwaysVisible = input(false, {
274
+ ...ngDevMode ? { debugName: "cancelButtonAlwaysVisible" } : /* istanbul ignore next */ {},
275
+ transform: booleanAttribute
276
+ });
277
+ allowEmptyContent = input(false, {
278
+ ...ngDevMode ? { debugName: "allowEmptyContent" } : /* istanbul ignore next */ {},
279
+ transform: booleanAttribute
280
+ });
281
+ allowEmpty = input(false, {
282
+ ...ngDevMode ? { debugName: "allowEmpty" } : /* istanbul ignore next */ {},
283
+ transform: booleanAttribute
284
+ });
285
+ autoClear = input(true, {
286
+ ...ngDevMode ? { debugName: "autoClear" } : /* istanbul ignore next */ {},
287
+ transform: booleanAttribute
288
+ });
289
+ loading = input(false, {
290
+ ...ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {},
291
+ transform: booleanAttribute
292
+ });
293
+ disabled = input(false, {
294
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
295
+ transform: booleanAttribute
296
+ });
297
+ readOnly = input(false, {
298
+ ...ngDevMode ? { debugName: "readOnly" } : /* istanbul ignore next */ {},
299
+ transform: booleanAttribute
300
+ });
301
+ imageUploadFn = input(...ngDevMode ? [void 0, { debugName: "imageUploadFn" }] : /* istanbul ignore next */ []);
302
+ submitted = output();
303
+ sent = output();
304
+ canceled = output();
305
+ isEditorActivated = computed(() => this.fullViewActive() || this.fullViewMode(), ...ngDevMode ? [{ debugName: "isEditorActivated" }] : /* istanbul ignore next */ []);
306
+ isToolbarVisible = computed(() => (this.toolbarActive() || this.toolbarAlwaysVisible()) && this.isEditorActivated(), ...ngDevMode ? [{ debugName: "isToolbarVisible" }] : /* istanbul ignore next */ []);
307
+ isBubbleMenuVisible = computed(() => {
308
+ const selection = this.editor.selection();
309
+ return this.editor.focused() && !!selection && (selection.anchor.blockId !== selection.focus.blockId || selection.anchor.offset !== selection.focus.offset);
310
+ }, ...ngDevMode ? [{ debugName: "isBubbleMenuVisible" }] : /* istanbul ignore next */ []);
311
+ isCancelVisible = computed(() => this.fullViewActive() && !this.fullViewMode() || this.cancelButtonAlwaysVisible(), ...ngDevMode ? [{ debugName: "isCancelVisible" }] : /* istanbul ignore next */ []);
312
+ sendLabel = computed(() => this.buttonSubmitLabel() ?? this.buttonSendLabel(), ...ngDevMode ? [{ debugName: "sendLabel" }] : /* istanbul ignore next */ []);
313
+ sendDisabled = computed(() => this.disabled() || this.loading() || !(this.allowEmpty() || this.allowEmptyContent()) && this.editor.empty(), ...ngDevMode ? [{ debugName: "sendDisabled" }] : /* istanbul ignore next */ []);
314
+ commands = /* @__PURE__ */ new Map([
315
+ ["toggleBold", NGS_HEADLESS_EDITOR_TOGGLE_BOLD],
316
+ ["toggleItalic", NGS_HEADLESS_EDITOR_TOGGLE_ITALIC],
317
+ ["toggleStrike", NGS_HEADLESS_EDITOR_TOGGLE_STRIKE],
318
+ ["toggleCode", NGS_HEADLESS_EDITOR_TOGGLE_CODE],
319
+ ["toggleBlockquote", NGS_COMMENT_EDITOR_TOGGLE_BLOCKQUOTE],
320
+ ["toggleCodeBlock", NGS_COMMENT_EDITOR_TOGGLE_CODE_BLOCK],
321
+ ["toggleBulletList", NGS_COMMENT_EDITOR_TOGGLE_BULLET_LIST],
322
+ ["toggleOrderedList", NGS_COMMENT_EDITOR_TOGGLE_ORDERED_LIST]
323
+ ]);
324
+ api = {
325
+ isCommandDisabled: (command) => this.isCommandDisabled(command),
326
+ isActive: (command) => this.isActive(command),
327
+ runCommand: (command) => this.runCommand(command),
328
+ editor: () => this.editor,
329
+ document: () => this.editor.document(),
330
+ isToolbarActive: () => this.toolbarActive(),
331
+ toggleToolbar: () => this.toggleToolbar(),
332
+ showToolbar: () => this.showToolbar(),
333
+ hideToolbar: () => this.hideToolbar(),
334
+ isEditorActivated: () => this.isEditorActivated(),
335
+ showFullView: () => this.showFullView(),
336
+ hideFullView: () => this.hideFullView(),
337
+ insertText: (text) => this.insertText(text),
338
+ insertImage: (file) => this.insertImage(file),
339
+ insertYoutube: (url) => this.insertYoutube(url),
340
+ getMarkAttributes: (type) => this.editor.getActiveMark(type)?.attrs,
341
+ setTextColor: (color) => this.setTextColor(color),
342
+ unsetTextColor: () => this.unsetTextColor(),
343
+ setBackgroundColor: (color) => this.setBackgroundColor(color),
344
+ unsetBackgroundColor: () => this.unsetBackgroundColor(),
345
+ setLink: (url) => this.setLink(url),
346
+ unsetLink: () => this.unsetLink(),
347
+ clear: () => this.clear(),
348
+ focus: () => this.focus()
349
+ };
350
+ constructor() {
351
+ effect(() => {
352
+ this.editor.setPlugins([
353
+ this.basicPlugin,
354
+ this.colorPlugin,
355
+ this.commentPlugin,
356
+ ...this.plugins()
357
+ ]);
358
+ });
359
+ effect(() => {
360
+ const value = this.value();
361
+ untracked(() => {
362
+ if (!ngsHeadlessEditorDocumentsEqual(value, this.editor.document())) this.editor.setDocument(value);
363
+ });
364
+ });
365
+ effect(() => {
366
+ const document = this.editor.document();
367
+ if (this.editor.origin() !== "external" && !ngsHeadlessEditorDocumentsEqual(document, this.value())) this.value.set(document);
368
+ });
369
+ effect(() => {
370
+ this.editor.setReadOnly(this.disabled() || this.readOnly());
371
+ });
372
+ effect(() => {
373
+ const maxHeight = this.contentMaxHeight();
374
+ if (typeof maxHeight === "number") this.renderer.setStyle(this.host.nativeElement, "--ngs-comment-editor-content-max-height", `${Math.max(0, maxHeight)}px`);
375
+ else this.renderer.removeStyle(this.host.nativeElement, "--ngs-comment-editor-content-max-height");
376
+ });
377
+ effect(() => {
378
+ this.editor.selection();
379
+ this.editor.focused();
380
+ this.editor.revision();
381
+ if (this.bubbleMenuLayer() && this.isBubbleMenuVisible()) untracked(() => this.scheduleBubbleMenuPosition());
382
+ });
383
+ afterNextRender(() => {
384
+ const windowRef = this.documentRef.defaultView;
385
+ if (!windowRef) return;
386
+ const reposition = () => this.scheduleBubbleMenuPosition();
387
+ windowRef.addEventListener("resize", reposition);
388
+ this.documentRef.addEventListener("scroll", reposition, true);
389
+ this.destroyRef.onDestroy(() => {
390
+ windowRef.removeEventListener("resize", reposition);
391
+ this.documentRef.removeEventListener("scroll", reposition, true);
392
+ if (this.bubbleMenuFrame !== null) windowRef.cancelAnimationFrame(this.bubbleMenuFrame);
393
+ });
394
+ });
395
+ }
396
+ insertText(text) {
397
+ if (!text || this.disabled() || this.readOnly()) return;
398
+ if (!this.editor.focused()) {
399
+ const lastTextBlock = [...this.editor.document().blocks].reverse().find((block) => Array.isArray(block.content));
400
+ if (lastTextBlock) {
401
+ const offset = getNgsHeadlessEditorBlockText(lastTextBlock).length;
402
+ this.editor.setSelection({
403
+ anchor: {
404
+ blockId: lastTextBlock.id,
405
+ offset
406
+ },
407
+ focus: {
408
+ blockId: lastTextBlock.id,
409
+ offset
410
+ }
411
+ });
412
+ } else {
413
+ const paragraph = createNgsHeadlessEditorParagraph();
414
+ this.editor.insertBlock(paragraph, true);
415
+ }
416
+ }
417
+ const value = getNgsHeadlessEditorDocumentText(this.editor.document()).length > 0 && !this.editor.focused() ? ` ${text} ` : text;
418
+ const singleEmoji = isOnlyEmoji(text) && this.currentBlockIsEmpty();
419
+ if (singleEmoji) this.editor.setMark("singleEmoji");
420
+ this.editor.insertText(value, "api");
421
+ if (singleEmoji) this.editor.unsetMark("singleEmoji");
422
+ this.showFullView();
423
+ queueMicrotask(() => this.focus());
424
+ }
425
+ isCommandDisabled(command) {
426
+ if (command === "toggleLink") {
427
+ const selection = this.editor.selection();
428
+ const collapsed = !selection || selection.anchor.blockId === selection.focus.blockId && selection.anchor.offset === selection.focus.offset;
429
+ return this.editor.readOnly() || collapsed ? true : null;
430
+ }
431
+ const resolved = this.commands.get(command);
432
+ return !resolved || !this.editor.isCommandEnabled(resolved) ? true : null;
433
+ }
434
+ isActive(command) {
435
+ const markAliases = {
436
+ bold: "bold",
437
+ italic: "italic",
438
+ strike: "strike",
439
+ code: "code",
440
+ link: "link"
441
+ };
442
+ if (markAliases[command]) return this.editor.isMarkActive(markAliases[command]);
443
+ const resolved = this.commands.get(command);
444
+ return resolved ? this.editor.isCommandActive(resolved) : false;
445
+ }
446
+ runCommand(command) {
447
+ const resolved = this.commands.get(command);
448
+ if (resolved) {
449
+ this.editor.execute(resolved);
450
+ this.focus();
451
+ }
452
+ }
453
+ send(event) {
454
+ event?.stopPropagation();
455
+ event?.preventDefault();
456
+ if (this.sendDisabled()) return;
457
+ const document = this.editor.document();
458
+ this.submitted.emit(document);
459
+ this.sent.emit(serializeCommentEditorDocument(document));
460
+ if (this.autoClear()) {
461
+ this.toolbarActive.set(false);
462
+ this.fullViewActive.set(false);
463
+ this.clear();
464
+ }
465
+ }
466
+ submit(event) {
467
+ this.send(event);
468
+ }
469
+ cancel(event) {
470
+ event?.stopPropagation();
471
+ event?.preventDefault();
472
+ this.toolbarActive.set(false);
473
+ this.fullViewActive.set(false);
474
+ this.clear();
475
+ this.canceled.emit();
476
+ }
477
+ clear() {
478
+ this.editor.clear();
479
+ }
480
+ activateFullView(event) {
481
+ if (event) {
482
+ if (event.target.closest("button, a")) return;
483
+ }
484
+ this.showFullView();
485
+ }
486
+ showFullView() {
487
+ this.fullViewActive.set(true);
488
+ }
489
+ hideFullView() {
490
+ this.fullViewActive.set(false);
491
+ }
492
+ toggleToolbar() {
493
+ this.toolbarActive.update((visible) => !visible);
494
+ }
495
+ showToolbar() {
496
+ this.toolbarActive.set(true);
497
+ }
498
+ hideToolbar() {
499
+ this.toolbarActive.set(false);
500
+ }
501
+ focus() {
502
+ this.surface().focus();
503
+ }
504
+ setLink(url) {
505
+ if (!url.trim()) return this.unsetLink();
506
+ return this.editor.execute(NGS_COMMENT_EDITOR_SET_LINK, url);
507
+ }
508
+ setTextColor(color) {
509
+ return this.editor.execute(NGS_HEADLESS_EDITOR_SET_TEXT_COLOR, color);
510
+ }
511
+ unsetTextColor() {
512
+ return this.editor.execute(NGS_HEADLESS_EDITOR_UNSET_TEXT_COLOR);
513
+ }
514
+ setBackgroundColor(color) {
515
+ return this.editor.execute(NGS_HEADLESS_EDITOR_SET_BACKGROUND_COLOR, color);
516
+ }
517
+ unsetBackgroundColor() {
518
+ return this.editor.execute(NGS_HEADLESS_EDITOR_UNSET_BACKGROUND_COLOR);
519
+ }
520
+ unsetLink() {
521
+ return this.editor.execute(NGS_COMMENT_EDITOR_UNSET_LINK);
522
+ }
523
+ insertYoutube(url) {
524
+ const src = normalizeYoutubeUrl(url);
525
+ if (!src) return false;
526
+ const inserted = this.editor.insertBlock(createCommentEditorMediaBlock("youtube", { src }));
527
+ if (inserted) this.showFullView();
528
+ return inserted;
529
+ }
530
+ insertImage(file) {
531
+ if (this.disabled() || this.readOnly()) return;
532
+ this.readFile(file).then((preview) => {
533
+ const block = createCommentEditorMediaBlock("imageUpload", {
534
+ src: preview,
535
+ status: "uploading"
536
+ });
537
+ if (!this.editor.insertBlock(block)) return;
538
+ this.showFullView();
539
+ const upload = this.imageUploadFn();
540
+ (upload ? upload(file) : Promise.resolve(preview)).then((src) => this.editor.updateBlock(block.id, {
541
+ type: "image",
542
+ attrs: {
543
+ src,
544
+ alt: file.name
545
+ }
546
+ }), (error) => this.editor.updateBlock(block.id, { attrs: {
547
+ src: preview,
548
+ status: "error",
549
+ error: error instanceof Error ? error.message : String(error)
550
+ } }));
551
+ });
552
+ }
553
+ currentBlockIsEmpty() {
554
+ const selection = this.editor.selection();
555
+ const block = this.editor.document().blocks.find((item) => item.id === selection?.focus.blockId);
556
+ return !!block && getNgsHeadlessEditorBlockText(block).length === 0;
557
+ }
558
+ readFile(file) {
559
+ return new Promise((resolve, reject) => {
560
+ const reader = new FileReader();
561
+ reader.onload = () => resolve(String(reader.result ?? ""));
562
+ reader.onerror = () => reject(reader.error ?? /* @__PURE__ */ new Error("Unable to read image"));
563
+ reader.readAsDataURL(file);
564
+ });
565
+ }
566
+ scheduleBubbleMenuPosition() {
567
+ const windowRef = this.documentRef.defaultView;
568
+ if (!windowRef) return;
569
+ if (this.bubbleMenuFrame !== null) windowRef.cancelAnimationFrame(this.bubbleMenuFrame);
570
+ this.bubbleMenuFrame = windowRef.requestAnimationFrame(() => {
571
+ this.bubbleMenuFrame = null;
572
+ this.positionBubbleMenu();
573
+ });
574
+ }
575
+ positionBubbleMenu() {
576
+ const layer = this.bubbleMenuLayer()?.nativeElement;
577
+ if (!layer) return;
578
+ const selectionRect = this.surface().getSelectionRect();
579
+ if (!selectionRect || !this.isBubbleMenuVisible()) {
580
+ this.renderer.removeClass(layer, "bubble-menu-positioned");
581
+ return;
582
+ }
583
+ const viewportWidth = this.documentRef.documentElement.clientWidth;
584
+ const layerWidth = layer.getBoundingClientRect().width;
585
+ const edge = 8;
586
+ const halfWidth = layerWidth / 2;
587
+ const selectionCenter = selectionRect.left + selectionRect.width / 2;
588
+ const x = layerWidth + 16 >= viewportWidth ? viewportWidth / 2 : Math.min(Math.max(selectionCenter, edge + halfWidth), viewportWidth - edge - halfWidth);
589
+ this.renderer.setStyle(layer, "left", `${x}px`);
590
+ this.renderer.setStyle(layer, "top", `${selectionRect.top}px`);
591
+ this.renderer.addClass(layer, "bubble-menu-positioned");
592
+ }
593
+ static ɵfac = i0.ɵɵngDeclareFactory({
594
+ minVersion: "12.0.0",
595
+ version: "22.3.0",
596
+ ngImport: i0,
597
+ type: CommentEditor,
598
+ deps: [],
599
+ target: i0.ɵɵFactoryTarget.Component
600
+ });
601
+ static ɵcmp = i0.ɵɵngDeclareComponent({
602
+ minVersion: "17.0.0",
603
+ version: "22.3.0",
604
+ type: CommentEditor,
605
+ isStandalone: true,
606
+ selector: "ngs-comment-editor",
607
+ inputs: {
608
+ value: {
609
+ classPropertyName: "value",
610
+ publicName: "value",
611
+ isSignal: true,
612
+ isRequired: false,
613
+ transformFunction: null
614
+ },
615
+ plugins: {
616
+ classPropertyName: "plugins",
617
+ publicName: "plugins",
618
+ isSignal: true,
619
+ isRequired: false,
620
+ transformFunction: null
621
+ },
622
+ contentMaxHeight: {
623
+ classPropertyName: "contentMaxHeight",
624
+ publicName: "contentMaxHeight",
625
+ isSignal: true,
626
+ isRequired: false,
627
+ transformFunction: null
628
+ },
629
+ buttonCancelLabel: {
630
+ classPropertyName: "buttonCancelLabel",
631
+ publicName: "buttonCancelLabel",
632
+ isSignal: true,
633
+ isRequired: false,
634
+ transformFunction: null
635
+ },
636
+ buttonSendLabel: {
637
+ classPropertyName: "buttonSendLabel",
638
+ publicName: "buttonSendLabel",
639
+ isSignal: true,
640
+ isRequired: false,
641
+ transformFunction: null
642
+ },
643
+ buttonSubmitLabel: {
644
+ classPropertyName: "buttonSubmitLabel",
645
+ publicName: "buttonSubmitLabel",
646
+ isSignal: true,
647
+ isRequired: false,
648
+ transformFunction: null
649
+ },
650
+ placeholder: {
651
+ classPropertyName: "placeholder",
652
+ publicName: "placeholder",
653
+ isSignal: true,
654
+ isRequired: false,
655
+ transformFunction: null
656
+ },
657
+ ariaLabel: {
658
+ classPropertyName: "ariaLabel",
659
+ publicName: "ariaLabel",
660
+ isSignal: true,
661
+ isRequired: false,
662
+ transformFunction: null
663
+ },
664
+ toolbarAlwaysVisible: {
665
+ classPropertyName: "toolbarAlwaysVisible",
666
+ publicName: "toolbarAlwaysVisible",
667
+ isSignal: true,
668
+ isRequired: false,
669
+ transformFunction: null
670
+ },
671
+ fullViewMode: {
672
+ classPropertyName: "fullViewMode",
673
+ publicName: "fullViewMode",
674
+ isSignal: true,
675
+ isRequired: false,
676
+ transformFunction: null
677
+ },
678
+ cancelButtonAlwaysVisible: {
679
+ classPropertyName: "cancelButtonAlwaysVisible",
680
+ publicName: "cancelButtonAlwaysVisible",
681
+ isSignal: true,
682
+ isRequired: false,
683
+ transformFunction: null
684
+ },
685
+ allowEmptyContent: {
686
+ classPropertyName: "allowEmptyContent",
687
+ publicName: "allowEmptyContent",
688
+ isSignal: true,
689
+ isRequired: false,
690
+ transformFunction: null
691
+ },
692
+ allowEmpty: {
693
+ classPropertyName: "allowEmpty",
694
+ publicName: "allowEmpty",
695
+ isSignal: true,
696
+ isRequired: false,
697
+ transformFunction: null
698
+ },
699
+ autoClear: {
700
+ classPropertyName: "autoClear",
701
+ publicName: "autoClear",
702
+ isSignal: true,
703
+ isRequired: false,
704
+ transformFunction: null
705
+ },
706
+ loading: {
707
+ classPropertyName: "loading",
708
+ publicName: "loading",
709
+ isSignal: true,
710
+ isRequired: false,
711
+ transformFunction: null
712
+ },
713
+ disabled: {
714
+ classPropertyName: "disabled",
715
+ publicName: "disabled",
716
+ isSignal: true,
717
+ isRequired: false,
718
+ transformFunction: null
719
+ },
720
+ readOnly: {
721
+ classPropertyName: "readOnly",
722
+ publicName: "readOnly",
723
+ isSignal: true,
724
+ isRequired: false,
725
+ transformFunction: null
726
+ },
727
+ imageUploadFn: {
728
+ classPropertyName: "imageUploadFn",
729
+ publicName: "imageUploadFn",
730
+ isSignal: true,
731
+ isRequired: false,
732
+ transformFunction: null
733
+ }
734
+ },
735
+ outputs: {
736
+ value: "valueChange",
737
+ submitted: "submitted",
738
+ sent: "sent",
739
+ canceled: "canceled"
740
+ },
741
+ host: {
742
+ listeners: { "click": "activateFullView($event)" },
743
+ properties: {
744
+ "class.full-view": "isEditorActivated()",
745
+ "class.ngs-comment-editor-disabled": "disabled()"
746
+ },
747
+ classAttribute: "ngs-comment-editor"
748
+ },
749
+ providers: [provideNgsHeadlessEditor(), {
750
+ provide: COMMENT_EDITOR,
751
+ useExisting: forwardRef(() => CommentEditor)
752
+ }],
753
+ viewQueries: [{
754
+ propertyName: "surface",
755
+ first: true,
756
+ predicate: NgsHeadlessEditorSurface,
757
+ descendants: true,
758
+ isSignal: true
759
+ }, {
760
+ propertyName: "bubbleMenuLayer",
761
+ first: true,
762
+ predicate: ["bubbleMenuLayer"],
763
+ descendants: true,
764
+ isSignal: true
765
+ }],
766
+ exportAs: ["ngsCommentEditor"],
767
+ ngImport: i0,
768
+ template: "@if (isToolbarVisible()) {\n <div class=\"toolbar\">\n <ng-content select=\"ngs-comment-editor-toolbar\"/>\n </div>\n}\n\n<div\n class=\"content\"\n ngsHeadlessEditorSurface\n [placeholder]=\"placeholder()\"\n [ariaLabel]=\"ariaLabel()\"\n [disabled]=\"disabled()\">\n</div>\n\n<div class=\"editor-content\">\n <ng-content/>\n</div>\n\n<div class=\"footer\">\n <div class=\"footer-tools\">\n <ng-content select=\"ngs-comment-editor-footer-bar\"/>\n </div>\n <div class=\"footer-actions\">\n @if (isCancelVisible()) {\n <button\n type=\"button\"\n ngsButton\n [disabled]=\"disabled() || loading()\"\n (click)=\"cancel($event)\">\n {{ buttonCancelLabel() }}\n </button>\n }\n <button\n type=\"button\"\n ngsButton=\"filled\"\n [disabled]=\"sendDisabled()\"\n [loading]=\"loading()\"\n (click)=\"send($event)\">\n {{ sendLabel() }}\n </button>\n </div>\n</div>\n\n@if (isBubbleMenuVisible()) {\n <div #bubbleMenuLayer class=\"bubble-menu-layer\">\n <ng-content select=\"ngs-comment-editor-bubble-menu\"/>\n </div>\n}\n",
769
+ styles: [":host{--ngs-comment-editor-bg: transparent;--ngs-comment-editor-content-max-height: 9999px;display:block;position:relative;overflow:hidden;background:var(--ngs-comment-editor-bg)}:host .content{box-sizing:border-box;position:absolute;inset:0;height:calc(var(--spacing, .25rem) * 14);min-height:calc(var(--spacing, .25rem) * 10);padding:calc(var(--spacing, .25rem) * 4);outline:none;overflow:hidden;overflow-wrap:anywhere;white-space:pre-wrap;font-size:var(--ngs-font-size-sm);line-height:var(--ngs-line-height-base)}:host .content ::ng-deep [data-ngs-headless-editor-placeholder]{position:relative}:host .content ::ng-deep [data-ngs-headless-editor-placeholder]:before{content:attr(data-ngs-headless-editor-placeholder);color:var(--ngs-color-neutral-500);pointer-events:none;position:absolute;inset-block-start:0;inset-inline-start:0;font:inherit}:host .content ::ng-deep p,:host .content ::ng-deep blockquote,:host .content ::ng-deep pre,:host .content ::ng-deep ul,:host .content ::ng-deep ol{margin:0;min-height:1.5em}:host .content ::ng-deep p+p,:host .content ::ng-deep p+blockquote,:host .content ::ng-deep p+pre,:host .content ::ng-deep p+ul,:host .content ::ng-deep p+ol,:host .content ::ng-deep blockquote+p,:host .content ::ng-deep blockquote+blockquote,:host .content ::ng-deep blockquote+pre,:host .content ::ng-deep blockquote+ul,:host .content ::ng-deep blockquote+ol,:host .content ::ng-deep pre+p,:host .content ::ng-deep pre+blockquote,:host .content ::ng-deep pre+pre,:host .content ::ng-deep pre+ul,:host .content ::ng-deep pre+ol,:host .content ::ng-deep ul+p,:host .content ::ng-deep ul+blockquote,:host .content ::ng-deep ul+pre,:host .content ::ng-deep ul+ul,:host .content ::ng-deep ul+ol,:host .content ::ng-deep ol+p,:host .content ::ng-deep ol+blockquote,:host .content ::ng-deep ol+pre,:host .content ::ng-deep ol+ul,:host .content ::ng-deep ol+ol{margin-top:calc(var(--spacing, .25rem) * 2)}:host .content ::ng-deep blockquote{padding-inline-start:calc(var(--spacing, .25rem) * 3);border-inline-start:3px solid var(--ngs-color-border);color:var(--ngs-color-neutral-600)}:host .content ::ng-deep pre{padding:calc(var(--spacing, .25rem) * 3);border-radius:var(--ngs-radius-md);background:var(--ngs-color-surface-container-high);font-family:var(--ngs-font-family-mono);white-space:pre-wrap}:host .content ::ng-deep ul{list-style:disc;padding-inline-start:calc(var(--spacing, .25rem) * 6)}:host .content ::ng-deep ol{list-style:decimal;padding-inline-start:calc(var(--spacing, .25rem) * 6)}:host .content ::ng-deep code{padding:0 var(--spacing, .25rem);border-radius:var(--ngs-radius-xs);background:var(--ngs-color-surface-container-high);font-family:var(--ngs-font-family-mono)}:host .content ::ng-deep a[data-ngs-headless-editor-mark=link]{color:var(--ngs-color-primary);text-decoration-line:underline;text-decoration-thickness:1px;text-underline-offset:.15em;cursor:pointer}:host .content ::ng-deep .single-emoji{font-size:var(--ngs-font-size-3xl)}:host .content ::ng-deep .ngs-comment-editor-media{position:relative;display:flex;align-items:center;justify-content:center;margin:calc(var(--spacing, .25rem) * 6) 0;max-width:100%}:host .content ::ng-deep .ngs-comment-editor-media img{display:block;height:auto;max-width:100%}:host .content ::ng-deep .ngs-comment-editor-image-upload img{opacity:.7}:host .content ::ng-deep .ngs-comment-editor-image-upload .ngs-comment-editor-upload-status{position:absolute;inset-inline:calc(var(--spacing, .25rem) * 3);top:calc(var(--spacing, .25rem) * 3);padding:calc(var(--spacing, .25rem) * 2) calc(var(--spacing, .25rem) * 3);border-radius:var(--ngs-radius-sm);background:var(--ngs-color-surface-container-highest);color:var(--ngs-color-on-surface);font-size:var(--ngs-font-size-xs);box-shadow:var(--ngs-shadow-sm)}:host .content ::ng-deep .ngs-comment-editor-image-upload .ngs-comment-editor-upload-status[role=alert]{background:var(--ngs-color-danger);color:var(--ngs-color-on-danger)}:host .content ::ng-deep .ngs-comment-editor-youtube{background:var(--ngs-color-neutral-100);padding:calc(var(--spacing, .25rem) * 3)}:host .content ::ng-deep .ngs-comment-editor-youtube iframe{display:block;width:100%;min-width:200px;min-height:200px;aspect-ratio:16/9;border:0}:host .editor-content{padding:0 calc(var(--spacing, .25rem) * 4)}:host .editor-content:empty{display:none}:host .footer{height:calc(var(--spacing, .25rem) * 14);padding:0 calc(var(--spacing, .25rem) * 2.5);display:flex;align-items:center;justify-content:space-between}:host .footer-tools{display:flex;align-items:center;flex:1 1 auto;min-width:0;padding-inline-end:calc(var(--spacing, .25rem) * 3)}:host .footer-actions{display:flex;align-items:center;flex:none;gap:calc(var(--spacing, .25rem) * 2)}:host .toolbar{height:calc(var(--spacing, .25rem) * 14);padding:0 calc(var(--spacing, .25rem) * 3);display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--ngs-color-border)}:host .bubble-menu-layer{position:fixed;z-index:999;top:0;left:0;visibility:hidden;transform:translate(-50%,calc(-100% - calc(var(--spacing, .25rem) * 2)))}:host .bubble-menu-layer.bubble-menu-positioned{visibility:visible}:host .button.active{background:var(--ngs-color-neutral-200)}:host ::ng-deep .button.active{background:var(--ngs-color-neutral-200)}:host.full-view .content{position:static;height:auto;min-height:calc(var(--spacing, .25rem) * 12);max-height:var(--ngs-comment-editor-content-max-height);overflow-y:auto}:host.ngs-comment-editor-disabled{opacity:.7}:host-context(html.dark) .button.active{background:var(--ngs-color-neutral-650);color:var(--ngs-color-neutral-200)}:host-context(html.dark) ::ng-deep .button.active{background:var(--ngs-color-neutral-650);color:var(--ngs-color-neutral-200)}:host-context(html.dark) .content .ngs-comment-editor-youtube{background:var(--ngs-color-neutral-800)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"],
770
+ dependencies: [{
771
+ kind: "component",
772
+ type: Button,
773
+ selector: "\n button[ngsButton], button[ngsIconButton],\n a[ngsButton], a[ngsIconButton]\n ",
774
+ inputs: [
775
+ "ngsButton",
776
+ "ngsIconButton",
777
+ "loading",
778
+ "disabled",
779
+ "disabledInteractive",
780
+ "disableRipple",
781
+ "reverse",
782
+ "fullWidth",
783
+ "hideTextOnMobile"
784
+ ],
785
+ exportAs: ["ngsButton"]
786
+ }, {
787
+ kind: "directive",
788
+ type: NgsHeadlessEditorSurface,
789
+ selector: "[ngsHeadlessEditorSurface]",
790
+ inputs: [
791
+ "placeholder",
792
+ "ariaLabel",
793
+ "disabled",
794
+ "spellcheck"
795
+ ],
796
+ exportAs: ["ngsHeadlessEditorSurface"]
797
+ }],
798
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
799
+ });
800
+ };
801
+ i0.ɵɵngDeclareClassMetadata({
802
+ minVersion: "12.0.0",
803
+ version: "22.3.0",
804
+ ngImport: i0,
805
+ type: CommentEditor,
806
+ decorators: [{
807
+ type: Component,
808
+ args: [{
809
+ selector: "ngs-comment-editor",
810
+ exportAs: "ngsCommentEditor",
811
+ imports: [Button, NgsHeadlessEditorSurface],
812
+ providers: [provideNgsHeadlessEditor(), {
813
+ provide: COMMENT_EDITOR,
814
+ useExisting: forwardRef(() => CommentEditor)
815
+ }],
816
+ changeDetection: ChangeDetectionStrategy.OnPush,
817
+ host: {
818
+ "class": "ngs-comment-editor",
819
+ "[class.full-view]": "isEditorActivated()",
820
+ "[class.ngs-comment-editor-disabled]": "disabled()",
821
+ "(click)": "activateFullView($event)"
822
+ },
823
+ template: "@if (isToolbarVisible()) {\n <div class=\"toolbar\">\n <ng-content select=\"ngs-comment-editor-toolbar\"/>\n </div>\n}\n\n<div\n class=\"content\"\n ngsHeadlessEditorSurface\n [placeholder]=\"placeholder()\"\n [ariaLabel]=\"ariaLabel()\"\n [disabled]=\"disabled()\">\n</div>\n\n<div class=\"editor-content\">\n <ng-content/>\n</div>\n\n<div class=\"footer\">\n <div class=\"footer-tools\">\n <ng-content select=\"ngs-comment-editor-footer-bar\"/>\n </div>\n <div class=\"footer-actions\">\n @if (isCancelVisible()) {\n <button\n type=\"button\"\n ngsButton\n [disabled]=\"disabled() || loading()\"\n (click)=\"cancel($event)\">\n {{ buttonCancelLabel() }}\n </button>\n }\n <button\n type=\"button\"\n ngsButton=\"filled\"\n [disabled]=\"sendDisabled()\"\n [loading]=\"loading()\"\n (click)=\"send($event)\">\n {{ sendLabel() }}\n </button>\n </div>\n</div>\n\n@if (isBubbleMenuVisible()) {\n <div #bubbleMenuLayer class=\"bubble-menu-layer\">\n <ng-content select=\"ngs-comment-editor-bubble-menu\"/>\n </div>\n}\n",
824
+ styles: [":host{--ngs-comment-editor-bg: transparent;--ngs-comment-editor-content-max-height: 9999px;display:block;position:relative;overflow:hidden;background:var(--ngs-comment-editor-bg)}:host .content{box-sizing:border-box;position:absolute;inset:0;height:calc(var(--spacing, .25rem) * 14);min-height:calc(var(--spacing, .25rem) * 10);padding:calc(var(--spacing, .25rem) * 4);outline:none;overflow:hidden;overflow-wrap:anywhere;white-space:pre-wrap;font-size:var(--ngs-font-size-sm);line-height:var(--ngs-line-height-base)}:host .content ::ng-deep [data-ngs-headless-editor-placeholder]{position:relative}:host .content ::ng-deep [data-ngs-headless-editor-placeholder]:before{content:attr(data-ngs-headless-editor-placeholder);color:var(--ngs-color-neutral-500);pointer-events:none;position:absolute;inset-block-start:0;inset-inline-start:0;font:inherit}:host .content ::ng-deep p,:host .content ::ng-deep blockquote,:host .content ::ng-deep pre,:host .content ::ng-deep ul,:host .content ::ng-deep ol{margin:0;min-height:1.5em}:host .content ::ng-deep p+p,:host .content ::ng-deep p+blockquote,:host .content ::ng-deep p+pre,:host .content ::ng-deep p+ul,:host .content ::ng-deep p+ol,:host .content ::ng-deep blockquote+p,:host .content ::ng-deep blockquote+blockquote,:host .content ::ng-deep blockquote+pre,:host .content ::ng-deep blockquote+ul,:host .content ::ng-deep blockquote+ol,:host .content ::ng-deep pre+p,:host .content ::ng-deep pre+blockquote,:host .content ::ng-deep pre+pre,:host .content ::ng-deep pre+ul,:host .content ::ng-deep pre+ol,:host .content ::ng-deep ul+p,:host .content ::ng-deep ul+blockquote,:host .content ::ng-deep ul+pre,:host .content ::ng-deep ul+ul,:host .content ::ng-deep ul+ol,:host .content ::ng-deep ol+p,:host .content ::ng-deep ol+blockquote,:host .content ::ng-deep ol+pre,:host .content ::ng-deep ol+ul,:host .content ::ng-deep ol+ol{margin-top:calc(var(--spacing, .25rem) * 2)}:host .content ::ng-deep blockquote{padding-inline-start:calc(var(--spacing, .25rem) * 3);border-inline-start:3px solid var(--ngs-color-border);color:var(--ngs-color-neutral-600)}:host .content ::ng-deep pre{padding:calc(var(--spacing, .25rem) * 3);border-radius:var(--ngs-radius-md);background:var(--ngs-color-surface-container-high);font-family:var(--ngs-font-family-mono);white-space:pre-wrap}:host .content ::ng-deep ul{list-style:disc;padding-inline-start:calc(var(--spacing, .25rem) * 6)}:host .content ::ng-deep ol{list-style:decimal;padding-inline-start:calc(var(--spacing, .25rem) * 6)}:host .content ::ng-deep code{padding:0 var(--spacing, .25rem);border-radius:var(--ngs-radius-xs);background:var(--ngs-color-surface-container-high);font-family:var(--ngs-font-family-mono)}:host .content ::ng-deep a[data-ngs-headless-editor-mark=link]{color:var(--ngs-color-primary);text-decoration-line:underline;text-decoration-thickness:1px;text-underline-offset:.15em;cursor:pointer}:host .content ::ng-deep .single-emoji{font-size:var(--ngs-font-size-3xl)}:host .content ::ng-deep .ngs-comment-editor-media{position:relative;display:flex;align-items:center;justify-content:center;margin:calc(var(--spacing, .25rem) * 6) 0;max-width:100%}:host .content ::ng-deep .ngs-comment-editor-media img{display:block;height:auto;max-width:100%}:host .content ::ng-deep .ngs-comment-editor-image-upload img{opacity:.7}:host .content ::ng-deep .ngs-comment-editor-image-upload .ngs-comment-editor-upload-status{position:absolute;inset-inline:calc(var(--spacing, .25rem) * 3);top:calc(var(--spacing, .25rem) * 3);padding:calc(var(--spacing, .25rem) * 2) calc(var(--spacing, .25rem) * 3);border-radius:var(--ngs-radius-sm);background:var(--ngs-color-surface-container-highest);color:var(--ngs-color-on-surface);font-size:var(--ngs-font-size-xs);box-shadow:var(--ngs-shadow-sm)}:host .content ::ng-deep .ngs-comment-editor-image-upload .ngs-comment-editor-upload-status[role=alert]{background:var(--ngs-color-danger);color:var(--ngs-color-on-danger)}:host .content ::ng-deep .ngs-comment-editor-youtube{background:var(--ngs-color-neutral-100);padding:calc(var(--spacing, .25rem) * 3)}:host .content ::ng-deep .ngs-comment-editor-youtube iframe{display:block;width:100%;min-width:200px;min-height:200px;aspect-ratio:16/9;border:0}:host .editor-content{padding:0 calc(var(--spacing, .25rem) * 4)}:host .editor-content:empty{display:none}:host .footer{height:calc(var(--spacing, .25rem) * 14);padding:0 calc(var(--spacing, .25rem) * 2.5);display:flex;align-items:center;justify-content:space-between}:host .footer-tools{display:flex;align-items:center;flex:1 1 auto;min-width:0;padding-inline-end:calc(var(--spacing, .25rem) * 3)}:host .footer-actions{display:flex;align-items:center;flex:none;gap:calc(var(--spacing, .25rem) * 2)}:host .toolbar{height:calc(var(--spacing, .25rem) * 14);padding:0 calc(var(--spacing, .25rem) * 3);display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--ngs-color-border)}:host .bubble-menu-layer{position:fixed;z-index:999;top:0;left:0;visibility:hidden;transform:translate(-50%,calc(-100% - calc(var(--spacing, .25rem) * 2)))}:host .bubble-menu-layer.bubble-menu-positioned{visibility:visible}:host .button.active{background:var(--ngs-color-neutral-200)}:host ::ng-deep .button.active{background:var(--ngs-color-neutral-200)}:host.full-view .content{position:static;height:auto;min-height:calc(var(--spacing, .25rem) * 12);max-height:var(--ngs-comment-editor-content-max-height);overflow-y:auto}:host.ngs-comment-editor-disabled{opacity:.7}:host-context(html.dark) .button.active{background:var(--ngs-color-neutral-650);color:var(--ngs-color-neutral-200)}:host-context(html.dark) ::ng-deep .button.active{background:var(--ngs-color-neutral-650);color:var(--ngs-color-neutral-200)}:host-context(html.dark) .content .ngs-comment-editor-youtube{background:var(--ngs-color-neutral-800)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
825
+ }]
826
+ }],
827
+ ctorParameters: () => [],
828
+ propDecorators: {
829
+ surface: [{
830
+ type: i0.ViewChild,
831
+ args: [i0.forwardRef(() => NgsHeadlessEditorSurface), { isSignal: true }]
832
+ }],
833
+ bubbleMenuLayer: [{
834
+ type: i0.ViewChild,
835
+ args: ["bubbleMenuLayer", { isSignal: true }]
836
+ }],
837
+ value: [{
838
+ type: i0.Input,
839
+ args: [{
840
+ isSignal: true,
841
+ alias: "value",
842
+ required: false
843
+ }]
844
+ }, {
845
+ type: i0.Output,
846
+ args: ["valueChange"]
847
+ }],
848
+ plugins: [{
849
+ type: i0.Input,
850
+ args: [{
851
+ isSignal: true,
852
+ alias: "plugins",
853
+ required: false
854
+ }]
855
+ }],
856
+ contentMaxHeight: [{
857
+ type: i0.Input,
858
+ args: [{
859
+ isSignal: true,
860
+ alias: "contentMaxHeight",
861
+ required: false
862
+ }]
863
+ }],
864
+ buttonCancelLabel: [{
865
+ type: i0.Input,
866
+ args: [{
867
+ isSignal: true,
868
+ alias: "buttonCancelLabel",
869
+ required: false
870
+ }]
871
+ }],
872
+ buttonSendLabel: [{
873
+ type: i0.Input,
874
+ args: [{
875
+ isSignal: true,
876
+ alias: "buttonSendLabel",
877
+ required: false
878
+ }]
879
+ }],
880
+ buttonSubmitLabel: [{
881
+ type: i0.Input,
882
+ args: [{
883
+ isSignal: true,
884
+ alias: "buttonSubmitLabel",
885
+ required: false
886
+ }]
887
+ }],
888
+ placeholder: [{
889
+ type: i0.Input,
890
+ args: [{
891
+ isSignal: true,
892
+ alias: "placeholder",
893
+ required: false
894
+ }]
895
+ }],
896
+ ariaLabel: [{
897
+ type: i0.Input,
898
+ args: [{
899
+ isSignal: true,
900
+ alias: "ariaLabel",
901
+ required: false
902
+ }]
903
+ }],
904
+ toolbarAlwaysVisible: [{
905
+ type: i0.Input,
906
+ args: [{
907
+ isSignal: true,
908
+ alias: "toolbarAlwaysVisible",
909
+ required: false
910
+ }]
911
+ }],
912
+ fullViewMode: [{
913
+ type: i0.Input,
914
+ args: [{
915
+ isSignal: true,
916
+ alias: "fullViewMode",
917
+ required: false
918
+ }]
919
+ }],
920
+ cancelButtonAlwaysVisible: [{
921
+ type: i0.Input,
922
+ args: [{
923
+ isSignal: true,
924
+ alias: "cancelButtonAlwaysVisible",
925
+ required: false
926
+ }]
927
+ }],
928
+ allowEmptyContent: [{
929
+ type: i0.Input,
930
+ args: [{
931
+ isSignal: true,
932
+ alias: "allowEmptyContent",
933
+ required: false
934
+ }]
935
+ }],
936
+ allowEmpty: [{
937
+ type: i0.Input,
938
+ args: [{
939
+ isSignal: true,
940
+ alias: "allowEmpty",
941
+ required: false
942
+ }]
943
+ }],
944
+ autoClear: [{
945
+ type: i0.Input,
946
+ args: [{
947
+ isSignal: true,
948
+ alias: "autoClear",
949
+ required: false
950
+ }]
951
+ }],
952
+ loading: [{
953
+ type: i0.Input,
954
+ args: [{
955
+ isSignal: true,
956
+ alias: "loading",
957
+ required: false
958
+ }]
959
+ }],
960
+ disabled: [{
961
+ type: i0.Input,
962
+ args: [{
963
+ isSignal: true,
964
+ alias: "disabled",
965
+ required: false
966
+ }]
967
+ }],
968
+ readOnly: [{
969
+ type: i0.Input,
970
+ args: [{
971
+ isSignal: true,
972
+ alias: "readOnly",
973
+ required: false
974
+ }]
975
+ }],
976
+ imageUploadFn: [{
977
+ type: i0.Input,
978
+ args: [{
979
+ isSignal: true,
980
+ alias: "imageUploadFn",
981
+ required: false
982
+ }]
983
+ }],
984
+ submitted: [{
985
+ type: i0.Output,
986
+ args: ["submitted"]
987
+ }],
988
+ sent: [{
989
+ type: i0.Output,
990
+ args: ["sent"]
991
+ }],
992
+ canceled: [{
993
+ type: i0.Output,
994
+ args: ["canceled"]
995
+ }]
996
+ }
997
+ });
700
998
  function isOnlyEmoji(value) {
701
- if (!value.trim()) {
702
- return false;
703
- }
704
- return /^(?:\p{Extended_Pictographic}|\p{Emoji_Presentation}|[\u200d\ufe0f])+$/u.test(value.trim());
705
- }
706
-
707
- class CommentEditorDivider {
708
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CommentEditorDivider, deps: [], target: i0.ɵɵFactoryTarget.Component });
709
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.7", type: CommentEditorDivider, isStandalone: true, selector: "ngs-comment-editor-divider", ngImport: i0, template: "<div class=\"divider\"></div>\n", styles: [":host{display:block;padding:0 calc(var(--spacing, .25rem) * 2)}:host .divider{width:1px;height:calc(var(--spacing, .25rem) * 6);background:var(--ngs-color-neutral-300)}:host-context(html.dark) .divider{background:var(--ngs-color-neutral-500)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
710
- }
711
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CommentEditorDivider, decorators: [{
712
- type: Component,
713
- args: [{ selector: 'ngs-comment-editor-divider', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"divider\"></div>\n", styles: [":host{display:block;padding:0 calc(var(--spacing, .25rem) * 2)}:host .divider{width:1px;height:calc(var(--spacing, .25rem) * 6);background:var(--ngs-color-neutral-300)}:host-context(html.dark) .divider{background:var(--ngs-color-neutral-500)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"] }]
714
- }] });
715
-
716
- class CommentEditorToolbar {
717
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CommentEditorToolbar, deps: [], target: i0.ɵɵFactoryTarget.Component });
718
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.7", type: CommentEditorToolbar, isStandalone: true, selector: "ngs-comment-editor-toolbar", host: { classAttribute: "ngs-comment-editor-toolbar" }, exportAs: ["ngsCommentEditorToolbar"], ngImport: i0, template: "<ng-content select=\"[ngsCommentEditorCommand],ngs-comment-editor-divider\"/>\n", styles: [":host{display:flex;align-items:center;gap:calc(var(--spacing, .25rem) * .5)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
719
- }
720
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CommentEditorToolbar, decorators: [{
721
- type: Component,
722
- args: [{ selector: 'ngs-comment-editor-toolbar', exportAs: 'ngsCommentEditorToolbar', changeDetection: ChangeDetectionStrategy.OnPush, host: { 'class': 'ngs-comment-editor-toolbar' }, template: "<ng-content select=\"[ngsCommentEditorCommand],ngs-comment-editor-divider\"/>\n", styles: [":host{display:flex;align-items:center;gap:calc(var(--spacing, .25rem) * .5)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"] }]
723
- }] });
724
-
725
- class CommentEditorBubbleMenu {
726
- commentEditor = inject(COMMENT_EDITOR);
727
- getLinkUrl() {
728
- return String(this.commentEditor.api.getMarkAttributes('link')?.['href'] ?? '') || null;
729
- }
730
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CommentEditorBubbleMenu, deps: [], target: i0.ɵɵFactoryTarget.Component });
731
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: CommentEditorBubbleMenu, isStandalone: true, selector: "ngs-comment-editor-bubble-menu", host: { classAttribute: "ngs-comment-editor-bubble-menu" }, providers: [
732
- {
733
- provide: COMMENT_EDITOR_BUBBLE_MENU,
734
- useExisting: forwardRef(() => CommentEditorBubbleMenu)
735
- }
736
- ], exportAs: ["ngsCommentEditorBubbleMenu"], ngImport: i0, template: "@if (commentEditor.api.isActive('link') && getLinkUrl()) {\n <div class=\"link-row\">\n <div class=\"link-value\">\n <a [href]=\"getLinkUrl()\" target=\"_blank\" rel=\"noopener noreferrer\" class=\"link\">\n {{ getLinkUrl() }}\n </a>\n </div>\n <div class=\"link-actions\">\n <ng-content select=\"[ngsCommentEditorCommandEditLink],[ngsCommentEditorCommandUnsetLink]\"/>\n </div>\n </div>\n}\n<div class=\"commands-row\">\n <ng-content select=\"[ngsCommentEditorCommand],ngs-comment-editor-divider\"/>\n</div>\n", styles: [":host{display:block;min-height:calc(var(--spacing, .25rem) * 12);padding-inline:calc(var(--spacing, .25rem) * 2);border-radius:var(--ngs-radius-xl);background:var(--ngs-color-neutral-950);color:var(--ngs-color-neutral-200);box-shadow:var(--ngs-shadow-sm)}:host .link-row{display:flex;align-items:center;gap:var(--spacing, .25rem);height:calc(var(--spacing, .25rem) * 11);border-bottom:1px solid var(--ngs-color-neutral-700)}:host .link-value{flex:1 1 auto;width:116px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--ngs-font-size-sm)}:host .link-actions{display:flex;align-items:center;flex:none}:host .commands-row{display:flex;align-items:center;justify-content:center;height:calc(var(--spacing, .25rem) * 12);gap:calc(var(--spacing, .25rem) * .5)}:host .link{position:relative;top:1px;color:var(--ngs-color-tertiary-300)}:host .link:hover{color:var(--ngs-color-tertiary-100)}:host ::ng-deep .button{display:flex;align-items:center;justify-content:center;width:calc(var(--spacing, .25rem) * 10);height:calc(var(--spacing, .25rem) * 10);border-radius:calc(infinity * 1px);--ngs-icon-size: var(--ngs-font-size-xl)}:host ::ng-deep .button:hover,:host ::ng-deep .button.active{color:var(--ngs-color-tertiary-300);background:var(--ngs-color-neutral-700)}:host ::ng-deep .button:disabled{pointer-events:none;opacity:.7}:host-context(html.dark){background:var(--ngs-color-tertiary-200);color:var(--ngs-color-neutral-900)}:host-context(html.dark) .link{color:var(--ngs-color-tertiary-700)}:host-context(html.dark) .link:hover{color:var(--ngs-color-tertiary-800)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
737
- }
738
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CommentEditorBubbleMenu, decorators: [{
739
- type: Component,
740
- args: [{ selector: 'ngs-comment-editor-bubble-menu', exportAs: 'ngsCommentEditorBubbleMenu', providers: [
741
- {
742
- provide: COMMENT_EDITOR_BUBBLE_MENU,
743
- useExisting: forwardRef(() => CommentEditorBubbleMenu)
744
- }
745
- ], changeDetection: ChangeDetectionStrategy.OnPush, host: { 'class': 'ngs-comment-editor-bubble-menu' }, template: "@if (commentEditor.api.isActive('link') && getLinkUrl()) {\n <div class=\"link-row\">\n <div class=\"link-value\">\n <a [href]=\"getLinkUrl()\" target=\"_blank\" rel=\"noopener noreferrer\" class=\"link\">\n {{ getLinkUrl() }}\n </a>\n </div>\n <div class=\"link-actions\">\n <ng-content select=\"[ngsCommentEditorCommandEditLink],[ngsCommentEditorCommandUnsetLink]\"/>\n </div>\n </div>\n}\n<div class=\"commands-row\">\n <ng-content select=\"[ngsCommentEditorCommand],ngs-comment-editor-divider\"/>\n</div>\n", styles: [":host{display:block;min-height:calc(var(--spacing, .25rem) * 12);padding-inline:calc(var(--spacing, .25rem) * 2);border-radius:var(--ngs-radius-xl);background:var(--ngs-color-neutral-950);color:var(--ngs-color-neutral-200);box-shadow:var(--ngs-shadow-sm)}:host .link-row{display:flex;align-items:center;gap:var(--spacing, .25rem);height:calc(var(--spacing, .25rem) * 11);border-bottom:1px solid var(--ngs-color-neutral-700)}:host .link-value{flex:1 1 auto;width:116px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--ngs-font-size-sm)}:host .link-actions{display:flex;align-items:center;flex:none}:host .commands-row{display:flex;align-items:center;justify-content:center;height:calc(var(--spacing, .25rem) * 12);gap:calc(var(--spacing, .25rem) * .5)}:host .link{position:relative;top:1px;color:var(--ngs-color-tertiary-300)}:host .link:hover{color:var(--ngs-color-tertiary-100)}:host ::ng-deep .button{display:flex;align-items:center;justify-content:center;width:calc(var(--spacing, .25rem) * 10);height:calc(var(--spacing, .25rem) * 10);border-radius:calc(infinity * 1px);--ngs-icon-size: var(--ngs-font-size-xl)}:host ::ng-deep .button:hover,:host ::ng-deep .button.active{color:var(--ngs-color-tertiary-300);background:var(--ngs-color-neutral-700)}:host ::ng-deep .button:disabled{pointer-events:none;opacity:.7}:host-context(html.dark){background:var(--ngs-color-tertiary-200);color:var(--ngs-color-neutral-900)}:host-context(html.dark) .link{color:var(--ngs-color-tertiary-700)}:host-context(html.dark) .link:hover{color:var(--ngs-color-tertiary-800)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"] }]
746
- }] });
747
-
748
- class CommentEditorFooterBar {
749
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CommentEditorFooterBar, deps: [], target: i0.ɵɵFactoryTarget.Component });
750
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.7", type: CommentEditorFooterBar, isStandalone: true, selector: "ngs-comment-editor-footer-bar", host: { classAttribute: "ngs-comment-editor-footer-bar" }, exportAs: ["ngsCommentEditorFooterBar"], ngImport: i0, template: "<ng-content select=\"[ngsCommentEditorCommand],ngs-comment-editor-divider\"/>\n", styles: [":host{display:flex;align-items:center;justify-content:flex-end;width:100%;gap:calc(var(--spacing, .25rem) * .5)}:host-context(.ngs-comment-editor.full-view){justify-content:flex-start}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
751
- }
752
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CommentEditorFooterBar, decorators: [{
753
- type: Component,
754
- args: [{ selector: 'ngs-comment-editor-footer-bar', exportAs: 'ngsCommentEditorFooterBar', changeDetection: ChangeDetectionStrategy.OnPush, host: { 'class': 'ngs-comment-editor-footer-bar' }, template: "<ng-content select=\"[ngsCommentEditorCommand],ngs-comment-editor-divider\"/>\n", styles: [":host{display:flex;align-items:center;justify-content:flex-end;width:100%;gap:calc(var(--spacing, .25rem) * .5)}:host-context(.ngs-comment-editor.full-view){justify-content:flex-start}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"] }]
755
- }] });
756
-
757
- class CommentEditorCommandDirective {
758
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CommentEditorCommandDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
759
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.7", type: CommentEditorCommandDirective, isStandalone: true, selector: "[ngsCommentEditorCommand]", host: { properties: { "class.button": "true" } }, ngImport: i0 });
760
- }
761
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CommentEditorCommandDirective, decorators: [{
762
- type: Directive,
763
- args: [{
764
- selector: '[ngsCommentEditorCommand]',
765
- host: { '[class.button]': 'true' }
766
- }]
767
- }] });
768
-
769
- class CommentEditorCommandBase {
770
- commentEditor = inject(COMMENT_EDITOR);
771
- preserveSelection(event) {
772
- event.preventDefault();
773
- }
774
- run(command, event) {
775
- event?.preventDefault();
776
- event?.stopPropagation();
777
- this.commentEditor.api.runCommand(command);
778
- }
779
- }
780
-
781
- class CommentEditorCommandBoldDirective extends CommentEditorCommandBase {
782
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CommentEditorCommandBoldDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
783
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.7", type: CommentEditorCommandBoldDirective, isStandalone: true, selector: "[ngsCommentEditorCommandBold]", host: { listeners: { "mousedown": "preserveSelection($event)", "click": "run(\"toggleBold\", $event)" }, properties: { "attr.disabled": "commentEditor.api.isCommandDisabled(\"toggleBold\") ? \"\" : null", "class.active": "commentEditor.api.isActive(\"toggleBold\")" } }, exportAs: ["ngsCommentEditorCommandBold"], usesInheritance: true, ngImport: i0 });
784
- }
785
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CommentEditorCommandBoldDirective, decorators: [{
786
- type: Directive,
787
- args: [{
788
- selector: '[ngsCommentEditorCommandBold]',
789
- exportAs: 'ngsCommentEditorCommandBold',
790
- host: {
791
- '[attr.disabled]': 'commentEditor.api.isCommandDisabled("toggleBold") ? "" : null',
792
- '[class.active]': 'commentEditor.api.isActive("toggleBold")',
793
- '(mousedown)': 'preserveSelection($event)',
794
- '(click)': 'run("toggleBold", $event)'
795
- }
796
- }]
797
- }] });
798
-
799
- class CommentEditorCommandItalicDirective extends CommentEditorCommandBase {
800
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CommentEditorCommandItalicDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
801
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.7", type: CommentEditorCommandItalicDirective, isStandalone: true, selector: "[ngsCommentEditorCommandItalic]", host: { listeners: { "mousedown": "preserveSelection($event)", "click": "run(\"toggleItalic\", $event)" }, properties: { "attr.disabled": "commentEditor.api.isCommandDisabled(\"toggleItalic\") ? \"\" : null", "class.active": "commentEditor.api.isActive(\"toggleItalic\")" } }, usesInheritance: true, ngImport: i0 });
802
- }
803
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CommentEditorCommandItalicDirective, decorators: [{
804
- type: Directive,
805
- args: [{
806
- selector: '[ngsCommentEditorCommandItalic]',
807
- host: {
808
- '[attr.disabled]': 'commentEditor.api.isCommandDisabled("toggleItalic") ? "" : null',
809
- '[class.active]': 'commentEditor.api.isActive("toggleItalic")',
810
- '(mousedown)': 'preserveSelection($event)',
811
- '(click)': 'run("toggleItalic", $event)'
812
- }
813
- }]
814
- }] });
815
-
816
- class CommentEditorCommandStrikeDirective extends CommentEditorCommandBase {
817
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CommentEditorCommandStrikeDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
818
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.7", type: CommentEditorCommandStrikeDirective, isStandalone: true, selector: "[ngsCommentEditorCommandStrike]", host: { listeners: { "mousedown": "preserveSelection($event)", "click": "run(\"toggleStrike\", $event)" }, properties: { "attr.disabled": "commentEditor.api.isCommandDisabled(\"toggleStrike\") ? \"\" : null", "class.active": "commentEditor.api.isActive(\"toggleStrike\")" } }, usesInheritance: true, ngImport: i0 });
819
- }
820
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CommentEditorCommandStrikeDirective, decorators: [{
821
- type: Directive,
822
- args: [{
823
- selector: '[ngsCommentEditorCommandStrike]',
824
- host: {
825
- '[attr.disabled]': 'commentEditor.api.isCommandDisabled("toggleStrike") ? "" : null',
826
- '[class.active]': 'commentEditor.api.isActive("toggleStrike")',
827
- '(mousedown)': 'preserveSelection($event)',
828
- '(click)': 'run("toggleStrike", $event)'
829
- }
830
- }]
831
- }] });
832
-
833
- class CommentEditorCommandBulletListDirective extends CommentEditorCommandBase {
834
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CommentEditorCommandBulletListDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
835
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.7", type: CommentEditorCommandBulletListDirective, isStandalone: true, selector: "[ngsCommentEditorCommandBulletList]", host: { listeners: { "mousedown": "preserveSelection($event)", "click": "run(\"toggleBulletList\", $event)" }, properties: { "attr.disabled": "commentEditor.api.isCommandDisabled(\"toggleBulletList\") ? \"\" : null", "class.active": "commentEditor.api.isActive(\"toggleBulletList\")" } }, usesInheritance: true, ngImport: i0 });
836
- }
837
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CommentEditorCommandBulletListDirective, decorators: [{
838
- type: Directive,
839
- args: [{
840
- selector: '[ngsCommentEditorCommandBulletList]',
841
- host: {
842
- '[attr.disabled]': 'commentEditor.api.isCommandDisabled("toggleBulletList") ? "" : null',
843
- '[class.active]': 'commentEditor.api.isActive("toggleBulletList")',
844
- '(mousedown)': 'preserveSelection($event)',
845
- '(click)': 'run("toggleBulletList", $event)'
846
- }
847
- }]
848
- }] });
849
-
850
- class CommentEditorCommandOrderedListDirective extends CommentEditorCommandBase {
851
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CommentEditorCommandOrderedListDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
852
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.7", type: CommentEditorCommandOrderedListDirective, isStandalone: true, selector: "[ngsCommentEditorCommandOrderedList]", host: { listeners: { "mousedown": "preserveSelection($event)", "click": "run(\"toggleOrderedList\", $event)" }, properties: { "attr.disabled": "commentEditor.api.isCommandDisabled(\"toggleOrderedList\") ? \"\" : null", "class.active": "commentEditor.api.isActive(\"toggleOrderedList\")" } }, usesInheritance: true, ngImport: i0 });
853
- }
854
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CommentEditorCommandOrderedListDirective, decorators: [{
855
- type: Directive,
856
- args: [{
857
- selector: '[ngsCommentEditorCommandOrderedList]',
858
- host: {
859
- '[attr.disabled]': 'commentEditor.api.isCommandDisabled("toggleOrderedList") ? "" : null',
860
- '[class.active]': 'commentEditor.api.isActive("toggleOrderedList")',
861
- '(mousedown)': 'preserveSelection($event)',
862
- '(click)': 'run("toggleOrderedList", $event)'
863
- }
864
- }]
865
- }] });
866
-
867
- class CommentEditorCommandBlockquoteDirective extends CommentEditorCommandBase {
868
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CommentEditorCommandBlockquoteDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
869
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.7", type: CommentEditorCommandBlockquoteDirective, isStandalone: true, selector: "[ngsCommentEditorCommandBlockquote]", host: { listeners: { "mousedown": "preserveSelection($event)", "click": "run(\"toggleBlockquote\", $event)" }, properties: { "attr.disabled": "commentEditor.api.isCommandDisabled(\"toggleBlockquote\") ? \"\" : null", "class.active": "commentEditor.api.isActive(\"toggleBlockquote\")" } }, usesInheritance: true, ngImport: i0 });
870
- }
871
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CommentEditorCommandBlockquoteDirective, decorators: [{
872
- type: Directive,
873
- args: [{
874
- selector: '[ngsCommentEditorCommandBlockquote]',
875
- host: {
876
- '[attr.disabled]': 'commentEditor.api.isCommandDisabled("toggleBlockquote") ? "" : null',
877
- '[class.active]': 'commentEditor.api.isActive("toggleBlockquote")',
878
- '(mousedown)': 'preserveSelection($event)',
879
- '(click)': 'run("toggleBlockquote", $event)'
880
- }
881
- }]
882
- }] });
883
-
884
- class CommentEditorCommandCodeBlockDirective extends CommentEditorCommandBase {
885
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CommentEditorCommandCodeBlockDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
886
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.7", type: CommentEditorCommandCodeBlockDirective, isStandalone: true, selector: "[ngsCommentEditorCommandCodeBlock]", host: { listeners: { "mousedown": "preserveSelection($event)", "click": "run(\"toggleCodeBlock\", $event)" }, properties: { "attr.disabled": "commentEditor.api.isCommandDisabled(\"toggleCodeBlock\") ? \"\" : null", "class.active": "commentEditor.api.isActive(\"toggleCodeBlock\")" } }, usesInheritance: true, ngImport: i0 });
887
- }
888
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CommentEditorCommandCodeBlockDirective, decorators: [{
889
- type: Directive,
890
- args: [{
891
- selector: '[ngsCommentEditorCommandCodeBlock]',
892
- host: {
893
- '[attr.disabled]': 'commentEditor.api.isCommandDisabled("toggleCodeBlock") ? "" : null',
894
- '[class.active]': 'commentEditor.api.isActive("toggleCodeBlock")',
895
- '(mousedown)': 'preserveSelection($event)',
896
- '(click)': 'run("toggleCodeBlock", $event)'
897
- }
898
- }]
899
- }] });
900
-
901
- class CommentEditorCommandImageDirective {
902
- commentEditor = inject(COMMENT_EDITOR);
903
- selectImage(event) {
904
- const file = event.files[0];
905
- if (file) {
906
- this.commentEditor.api.insertImage(file);
907
- }
908
- }
909
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CommentEditorCommandImageDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
910
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.7", type: CommentEditorCommandImageDirective, isStandalone: true, selector: "[ngsCommentEditorCommandImage]", host: { listeners: { "fileSelected": "selectImage($event)" }, properties: { "attr.accept": "\"image/*\"" } }, hostDirectives: [{ directive: i1.UploadTriggerDirective, outputs: ["fileSelected", "fileSelected"] }], ngImport: i0 });
911
- }
912
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CommentEditorCommandImageDirective, decorators: [{
913
- type: Directive,
914
- args: [{
915
- selector: '[ngsCommentEditorCommandImage]',
916
- hostDirectives: [
917
- {
918
- directive: UploadTriggerDirective,
919
- outputs: ['fileSelected']
920
- }
921
- ],
922
- host: {
923
- '[attr.accept]': '"image/*"',
924
- '(fileSelected)': 'selectImage($event)'
925
- }
926
- }]
927
- }] });
928
-
929
- class YoutubeDialog {
930
- dialogRef = inject(DialogRef);
931
- data = inject(DIALOG_DATA);
932
- linkUrl = this.data.linkUrl ?? '';
933
- isUpdate = !!this.data.linkUrl;
934
- submit() {
935
- this.dialogRef.close(this.linkUrl.trim());
936
- }
937
- cancel() {
938
- this.dialogRef.close();
939
- }
940
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: YoutubeDialog, deps: [], target: i0.ɵɵFactoryTarget.Component });
941
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.7", type: YoutubeDialog, isStandalone: true, selector: "ngs-comment-editor-youtube-dialog", ngImport: i0, template: "<form class=\"w-[500px] max-w-full\" (ngSubmit)=\"submit()\">\n <h3 ngs-dialog-title>{{ isUpdate ? 'Update YouTube' : 'Add YouTube' }}</h3>\n <ngs-dialog-content>\n <div class=\"pt-4\">\n <ngs-form-field class=\"w-full\">\n <ngs-label>Paste URL</ngs-label>\n <input name=\"linkUrl\" ngsInput [(ngModel)]=\"linkUrl\">\n </ngs-form-field>\n </div>\n </ngs-dialog-content>\n <div ngs-dialog-actions align=\"end\">\n <button type=\"button\" ngsButton (click)=\"cancel()\">Cancel</button>\n <button type=\"submit\" ngsButton=\"filled\" [disabled]=\"!linkUrl.trim()\">\n {{ isUpdate ? 'Save' : 'Add URL' }}\n </button>\n </div>\n</form>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1$1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: Button, selector: " button[ngsButton], button[ngsIconButton], a[ngsButton], a[ngsIconButton] ", inputs: ["ngsButton", "ngsIconButton", "loading", "disabled", "disabledInteractive", "disableRipple", "reverse", "fullWidth", "hideTextOnMobile"], exportAs: ["ngsButton"] }, { kind: "component", type: DialogActions, selector: "ngs-dialog-actions, [ngs-dialog-actions], [ngsDialogActions]", inputs: ["align"] }, { kind: "component", type: DialogContent, selector: "ngs-dialog-content,[ngs-dialog-content],[ngsDialogContent]" }, { kind: "component", type: DialogTitle, selector: "ngs-dialog-title, [ngs-dialog-title], [ngsDialogTitle]", inputs: ["id"], exportAs: ["ngsDialogTitle"] }, { kind: "component", type: FormField, selector: "ngs-form-field", inputs: ["labelMode", "subscriptHiddenIfEmpty", "sameHeightAsButton"], exportAs: ["ngsFormField"] }, { kind: "component", type: Label, selector: "ngs-label" }, { kind: "directive", type: Input, selector: "input[ngsInput], textarea[ngsInput]", inputs: ["id", "placeholder", "required", "disabled", "readonly", "errorStateMatcher"], exportAs: ["ngsInput"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
942
- }
943
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: YoutubeDialog, decorators: [{
944
- type: Component,
945
- args: [{ selector: 'ngs-comment-editor-youtube-dialog', imports: [
946
- FormsModule,
947
- Button,
948
- DialogActions,
949
- DialogContent,
950
- DialogTitle,
951
- FormField,
952
- Label,
953
- Input
954
- ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<form class=\"w-[500px] max-w-full\" (ngSubmit)=\"submit()\">\n <h3 ngs-dialog-title>{{ isUpdate ? 'Update YouTube' : 'Add YouTube' }}</h3>\n <ngs-dialog-content>\n <div class=\"pt-4\">\n <ngs-form-field class=\"w-full\">\n <ngs-label>Paste URL</ngs-label>\n <input name=\"linkUrl\" ngsInput [(ngModel)]=\"linkUrl\">\n </ngs-form-field>\n </div>\n </ngs-dialog-content>\n <div ngs-dialog-actions align=\"end\">\n <button type=\"button\" ngsButton (click)=\"cancel()\">Cancel</button>\n <button type=\"submit\" ngsButton=\"filled\" [disabled]=\"!linkUrl.trim()\">\n {{ isUpdate ? 'Save' : 'Add URL' }}\n </button>\n </div>\n</form>\n" }]
955
- }] });
956
-
957
- class CommentEditorCommandYoutubeDirective {
958
- destroyRef = inject(DestroyRef);
959
- dialog = inject(Dialog);
960
- commentEditor = inject(COMMENT_EDITOR);
961
- preserveSelection(event) {
962
- event.preventDefault();
963
- }
964
- open(event) {
965
- event.preventDefault();
966
- event.stopPropagation();
967
- this.dialog.open(YoutubeDialog, { data: { linkUrl: '' } })
968
- .afterClosed()
969
- .pipe(takeUntilDestroyed(this.destroyRef))
970
- .subscribe(linkUrl => {
971
- if (typeof linkUrl === 'string' && linkUrl) {
972
- this.commentEditor.api.insertYoutube(linkUrl);
973
- this.commentEditor.api.focus();
974
- }
975
- });
976
- }
977
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CommentEditorCommandYoutubeDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
978
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.7", type: CommentEditorCommandYoutubeDirective, isStandalone: true, selector: "[ngsCommentEditorCommandYoutube]", host: { listeners: { "mousedown": "preserveSelection($event)", "click": "open($event)" } }, ngImport: i0 });
999
+ if (!value.trim()) return false;
1000
+ return /^(?:\p{Extended_Pictographic}|\p{Emoji_Presentation}|[\u200d\ufe0f])+$/u.test(value.trim());
979
1001
  }
980
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CommentEditorCommandYoutubeDirective, decorators: [{
981
- type: Directive,
982
- args: [{
983
- selector: '[ngsCommentEditorCommandYoutube]',
984
- host: {
985
- '(mousedown)': 'preserveSelection($event)',
986
- '(click)': 'open($event)'
987
- }
988
- }]
989
- }] });
990
-
991
- class LinkDialog {
992
- dialogRef = inject(DialogRef);
993
- data = inject(DIALOG_DATA);
994
- linkUrl = this.data.linkUrl ?? '';
995
- isUpdate = !!this.data.linkUrl;
996
- submit() {
997
- this.dialogRef.close(this.linkUrl.trim());
998
- }
999
- cancel() {
1000
- this.dialogRef.close();
1001
- }
1002
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: LinkDialog, deps: [], target: i0.ɵɵFactoryTarget.Component });
1003
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.7", type: LinkDialog, isStandalone: true, selector: "ngs-comment-editor-link-dialog", ngImport: i0, template: "<form class=\"w-[500px] max-w-full\" (ngSubmit)=\"submit()\">\n <h3 ngs-dialog-title>{{ isUpdate ? 'Update Link' : 'Add Link' }}</h3>\n <ngs-dialog-content>\n <div class=\"pt-4\">\n <ngs-form-field class=\"w-full\">\n <ngs-label>Paste Link</ngs-label>\n <input name=\"linkUrl\" ngsInput [(ngModel)]=\"linkUrl\">\n </ngs-form-field>\n </div>\n </ngs-dialog-content>\n <div ngs-dialog-actions align=\"end\">\n <button type=\"button\" ngsButton (click)=\"cancel()\">Cancel</button>\n <button type=\"submit\" ngsButton=\"filled\" [disabled]=\"!linkUrl.trim()\">\n {{ isUpdate ? 'Save' : 'Add link' }}\n </button>\n </div>\n</form>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1$1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: Button, selector: " button[ngsButton], button[ngsIconButton], a[ngsButton], a[ngsIconButton] ", inputs: ["ngsButton", "ngsIconButton", "loading", "disabled", "disabledInteractive", "disableRipple", "reverse", "fullWidth", "hideTextOnMobile"], exportAs: ["ngsButton"] }, { kind: "component", type: DialogActions, selector: "ngs-dialog-actions, [ngs-dialog-actions], [ngsDialogActions]", inputs: ["align"] }, { kind: "component", type: DialogContent, selector: "ngs-dialog-content,[ngs-dialog-content],[ngsDialogContent]" }, { kind: "component", type: DialogTitle, selector: "ngs-dialog-title, [ngs-dialog-title], [ngsDialogTitle]", inputs: ["id"], exportAs: ["ngsDialogTitle"] }, { kind: "component", type: FormField, selector: "ngs-form-field", inputs: ["labelMode", "subscriptHiddenIfEmpty", "sameHeightAsButton"], exportAs: ["ngsFormField"] }, { kind: "component", type: Label, selector: "ngs-label" }, { kind: "directive", type: Input, selector: "input[ngsInput], textarea[ngsInput]", inputs: ["id", "placeholder", "required", "disabled", "readonly", "errorStateMatcher"], exportAs: ["ngsInput"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1004
- }
1005
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: LinkDialog, decorators: [{
1006
- type: Component,
1007
- args: [{ selector: 'ngs-comment-editor-link-dialog', imports: [
1008
- FormsModule,
1009
- Button,
1010
- DialogActions,
1011
- DialogContent,
1012
- DialogTitle,
1013
- FormField,
1014
- Label,
1015
- Input
1016
- ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<form class=\"w-[500px] max-w-full\" (ngSubmit)=\"submit()\">\n <h3 ngs-dialog-title>{{ isUpdate ? 'Update Link' : 'Add Link' }}</h3>\n <ngs-dialog-content>\n <div class=\"pt-4\">\n <ngs-form-field class=\"w-full\">\n <ngs-label>Paste Link</ngs-label>\n <input name=\"linkUrl\" ngsInput [(ngModel)]=\"linkUrl\">\n </ngs-form-field>\n </div>\n </ngs-dialog-content>\n <div ngs-dialog-actions align=\"end\">\n <button type=\"button\" ngsButton (click)=\"cancel()\">Cancel</button>\n <button type=\"submit\" ngsButton=\"filled\" [disabled]=\"!linkUrl.trim()\">\n {{ isUpdate ? 'Save' : 'Add link' }}\n </button>\n </div>\n</form>\n" }]
1017
- }] });
1018
-
1019
- class CommentEditorCommandLinkDirective {
1020
- destroyRef = inject(DestroyRef);
1021
- dialog = inject(Dialog);
1022
- commentEditor = inject(COMMENT_EDITOR);
1023
- preserveSelection(event) {
1024
- event.preventDefault();
1025
- }
1026
- open(event) {
1027
- event.preventDefault();
1028
- event.stopPropagation();
1029
- this.dialog.open(LinkDialog, {
1030
- data: {
1031
- linkUrl: this.commentEditor.api.getMarkAttributes('link')?.['href'] ?? ''
1032
- }
1033
- }).afterClosed()
1034
- .pipe(takeUntilDestroyed(this.destroyRef))
1035
- .subscribe(linkUrl => {
1036
- if (typeof linkUrl === 'string') {
1037
- this.commentEditor.api.setLink(linkUrl);
1038
- this.commentEditor.api.focus();
1039
- }
1040
- });
1041
- }
1042
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CommentEditorCommandLinkDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1043
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.7", type: CommentEditorCommandLinkDirective, isStandalone: true, selector: "[ngsCommentEditorCommandLink]", host: { listeners: { "mousedown": "preserveSelection($event)", "click": "open($event)" }, properties: { "attr.disabled": "commentEditor.api.isCommandDisabled(\"toggleLink\") ? \"\" : null", "class.active": "commentEditor.api.isActive(\"link\")" } }, ngImport: i0 });
1044
- }
1045
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CommentEditorCommandLinkDirective, decorators: [{
1046
- type: Directive,
1047
- args: [{
1048
- selector: '[ngsCommentEditorCommandLink]',
1049
- host: {
1050
- '[attr.disabled]': 'commentEditor.api.isCommandDisabled("toggleLink") ? "" : null',
1051
- '[class.active]': 'commentEditor.api.isActive("link")',
1052
- '(mousedown)': 'preserveSelection($event)',
1053
- '(click)': 'open($event)'
1054
- }
1055
- }]
1056
- }] });
1057
-
1058
- class CommentEditorCommandCodeDirective extends CommentEditorCommandBase {
1059
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CommentEditorCommandCodeDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
1060
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.7", type: CommentEditorCommandCodeDirective, isStandalone: true, selector: "[ngsCommentEditorCommandCode]", host: { listeners: { "mousedown": "preserveSelection($event)", "click": "run(\"toggleCode\", $event)" }, properties: { "attr.disabled": "commentEditor.api.isCommandDisabled(\"toggleCode\") ? \"\" : null", "class.active": "commentEditor.api.isActive(\"toggleCode\")" } }, usesInheritance: true, ngImport: i0 });
1061
- }
1062
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CommentEditorCommandCodeDirective, decorators: [{
1063
- type: Directive,
1064
- args: [{
1065
- selector: '[ngsCommentEditorCommandCode]',
1066
- host: {
1067
- '[attr.disabled]': 'commentEditor.api.isCommandDisabled("toggleCode") ? "" : null',
1068
- '[class.active]': 'commentEditor.api.isActive("toggleCode")',
1069
- '(mousedown)': 'preserveSelection($event)',
1070
- '(click)': 'run("toggleCode", $event)'
1071
- }
1072
- }]
1073
- }] });
1074
-
1075
- class CommentEditorCommandEditLinkDirective {
1076
- destroyRef = inject(DestroyRef);
1077
- dialog = inject(Dialog);
1078
- commentEditor = inject(COMMENT_EDITOR);
1079
- preserveSelection(event) {
1080
- event.preventDefault();
1081
- }
1082
- open(event) {
1083
- event.preventDefault();
1084
- event.stopPropagation();
1085
- this.dialog.open(LinkDialog, {
1086
- data: {
1087
- linkUrl: this.commentEditor.api.getMarkAttributes('link')?.['href'] ?? ''
1088
- }
1089
- }).afterClosed()
1090
- .pipe(takeUntilDestroyed(this.destroyRef))
1091
- .subscribe(linkUrl => {
1092
- if (typeof linkUrl === 'string') {
1093
- this.commentEditor.api.setLink(linkUrl);
1094
- this.commentEditor.api.focus();
1095
- }
1096
- });
1097
- }
1098
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CommentEditorCommandEditLinkDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1099
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.7", type: CommentEditorCommandEditLinkDirective, isStandalone: true, selector: "[ngsCommentEditorCommandEditLink]", host: { listeners: { "mousedown": "preserveSelection($event)", "click": "open($event)" }, properties: { "class.button": "true" } }, ngImport: i0 });
1100
- }
1101
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CommentEditorCommandEditLinkDirective, decorators: [{
1102
- type: Directive,
1103
- args: [{
1104
- selector: '[ngsCommentEditorCommandEditLink]',
1105
- host: {
1106
- '[class.button]': 'true',
1107
- '(mousedown)': 'preserveSelection($event)',
1108
- '(click)': 'open($event)'
1109
- }
1110
- }]
1111
- }] });
1112
-
1113
- class CommentEditorCommandUnsetLinkDirective {
1114
- commentEditor = inject(COMMENT_EDITOR);
1115
- preserveSelection(event) {
1116
- event.preventDefault();
1117
- }
1118
- unset(event) {
1119
- event.preventDefault();
1120
- event.stopPropagation();
1121
- this.commentEditor.api.unsetLink();
1122
- this.commentEditor.api.focus();
1123
- }
1124
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CommentEditorCommandUnsetLinkDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1125
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.7", type: CommentEditorCommandUnsetLinkDirective, isStandalone: true, selector: "[ngsCommentEditorCommandUnsetLink]", host: { listeners: { "mousedown": "preserveSelection($event)", "click": "unset($event)" }, properties: { "class.button": "true" } }, ngImport: i0 });
1126
- }
1127
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CommentEditorCommandUnsetLinkDirective, decorators: [{
1128
- type: Directive,
1129
- args: [{
1130
- selector: '[ngsCommentEditorCommandUnsetLink]',
1131
- host: {
1132
- '[class.button]': 'true',
1133
- '(mousedown)': 'preserveSelection($event)',
1134
- '(click)': 'unset($event)'
1135
- }
1136
- }]
1137
- }] });
1138
-
1139
- class CommentEditorCommandToggleToolbarDirective {
1140
- commentEditor = inject(COMMENT_EDITOR);
1141
- preserveSelection(event) {
1142
- event.preventDefault();
1143
- }
1144
- toggle(event) {
1145
- event.preventDefault();
1146
- event.stopPropagation();
1147
- this.commentEditor.api.toggleToolbar();
1148
- }
1149
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CommentEditorCommandToggleToolbarDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1150
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.7", type: CommentEditorCommandToggleToolbarDirective, isStandalone: true, selector: "[ngsCommentEditorCommandToggleToolbar]", host: { listeners: { "mousedown": "preserveSelection($event)", "click": "toggle($event)" }, properties: { "class.active": "commentEditor.api.isToolbarActive()" } }, ngImport: i0 });
1151
- }
1152
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CommentEditorCommandToggleToolbarDirective, decorators: [{
1153
- type: Directive,
1154
- args: [{
1155
- selector: '[ngsCommentEditorCommandToggleToolbar]',
1156
- host: {
1157
- '[class.active]': 'commentEditor.api.isToolbarActive()',
1158
- '(mousedown)': 'preserveSelection($event)',
1159
- '(click)': 'toggle($event)'
1160
- }
1161
- }]
1162
- }] });
1163
-
1164
- /**
1165
- * Generated bundle index. Do not edit.
1166
- */
1167
-
1002
+ var CommentEditorDivider = class CommentEditorDivider {
1003
+ static ɵfac = i0.ɵɵngDeclareFactory({
1004
+ minVersion: "12.0.0",
1005
+ version: "22.3.0",
1006
+ ngImport: i0,
1007
+ type: CommentEditorDivider,
1008
+ deps: [],
1009
+ target: i0.ɵɵFactoryTarget.Component
1010
+ });
1011
+ static ɵcmp = i0.ɵɵngDeclareComponent({
1012
+ minVersion: "14.0.0",
1013
+ version: "22.3.0",
1014
+ type: CommentEditorDivider,
1015
+ isStandalone: true,
1016
+ selector: "ngs-comment-editor-divider",
1017
+ ngImport: i0,
1018
+ template: "<div class=\"divider\"></div>\n",
1019
+ styles: [":host{display:block;padding:0 calc(var(--spacing, .25rem) * 2)}:host .divider{width:1px;height:calc(var(--spacing, .25rem) * 6);background:var(--ngs-color-neutral-300)}:host-context(html.dark) .divider{background:var(--ngs-color-neutral-500)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"],
1020
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
1021
+ });
1022
+ };
1023
+ i0.ɵɵngDeclareClassMetadata({
1024
+ minVersion: "12.0.0",
1025
+ version: "22.3.0",
1026
+ ngImport: i0,
1027
+ type: CommentEditorDivider,
1028
+ decorators: [{
1029
+ type: Component,
1030
+ args: [{
1031
+ selector: "ngs-comment-editor-divider",
1032
+ changeDetection: ChangeDetectionStrategy.OnPush,
1033
+ template: "<div class=\"divider\"></div>\n",
1034
+ styles: [":host{display:block;padding:0 calc(var(--spacing, .25rem) * 2)}:host .divider{width:1px;height:calc(var(--spacing, .25rem) * 6);background:var(--ngs-color-neutral-300)}:host-context(html.dark) .divider{background:var(--ngs-color-neutral-500)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
1035
+ }]
1036
+ }]
1037
+ });
1038
+ var CommentEditorToolbar = class CommentEditorToolbar {
1039
+ static ɵfac = i0.ɵɵngDeclareFactory({
1040
+ minVersion: "12.0.0",
1041
+ version: "22.3.0",
1042
+ ngImport: i0,
1043
+ type: CommentEditorToolbar,
1044
+ deps: [],
1045
+ target: i0.ɵɵFactoryTarget.Component
1046
+ });
1047
+ static ɵcmp = i0.ɵɵngDeclareComponent({
1048
+ minVersion: "14.0.0",
1049
+ version: "22.3.0",
1050
+ type: CommentEditorToolbar,
1051
+ isStandalone: true,
1052
+ selector: "ngs-comment-editor-toolbar",
1053
+ host: { classAttribute: "ngs-comment-editor-toolbar" },
1054
+ exportAs: ["ngsCommentEditorToolbar"],
1055
+ ngImport: i0,
1056
+ template: "<ng-content select=\"[ngsCommentEditorCommand],ngs-comment-editor-divider\"/>\n",
1057
+ styles: [":host{display:flex;align-items:center;gap:calc(var(--spacing, .25rem) * .5)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"],
1058
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
1059
+ });
1060
+ };
1061
+ i0.ɵɵngDeclareClassMetadata({
1062
+ minVersion: "12.0.0",
1063
+ version: "22.3.0",
1064
+ ngImport: i0,
1065
+ type: CommentEditorToolbar,
1066
+ decorators: [{
1067
+ type: Component,
1068
+ args: [{
1069
+ selector: "ngs-comment-editor-toolbar",
1070
+ exportAs: "ngsCommentEditorToolbar",
1071
+ changeDetection: ChangeDetectionStrategy.OnPush,
1072
+ host: { "class": "ngs-comment-editor-toolbar" },
1073
+ template: "<ng-content select=\"[ngsCommentEditorCommand],ngs-comment-editor-divider\"/>\n",
1074
+ styles: [":host{display:flex;align-items:center;gap:calc(var(--spacing, .25rem) * .5)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
1075
+ }]
1076
+ }]
1077
+ });
1078
+ var CommentEditorBubbleMenu = class CommentEditorBubbleMenu {
1079
+ commentEditor = inject(COMMENT_EDITOR);
1080
+ getLinkUrl() {
1081
+ return String(this.commentEditor.api.getMarkAttributes("link")?.["href"] ?? "") || null;
1082
+ }
1083
+ static ɵfac = i0.ɵɵngDeclareFactory({
1084
+ minVersion: "12.0.0",
1085
+ version: "22.3.0",
1086
+ ngImport: i0,
1087
+ type: CommentEditorBubbleMenu,
1088
+ deps: [],
1089
+ target: i0.ɵɵFactoryTarget.Component
1090
+ });
1091
+ static ɵcmp = i0.ɵɵngDeclareComponent({
1092
+ minVersion: "17.0.0",
1093
+ version: "22.3.0",
1094
+ type: CommentEditorBubbleMenu,
1095
+ isStandalone: true,
1096
+ selector: "ngs-comment-editor-bubble-menu",
1097
+ host: { classAttribute: "ngs-comment-editor-bubble-menu" },
1098
+ providers: [{
1099
+ provide: COMMENT_EDITOR_BUBBLE_MENU,
1100
+ useExisting: forwardRef(() => CommentEditorBubbleMenu)
1101
+ }],
1102
+ exportAs: ["ngsCommentEditorBubbleMenu"],
1103
+ ngImport: i0,
1104
+ template: "@if (commentEditor.api.isActive('link') && getLinkUrl()) {\n <div class=\"link-row\">\n <div class=\"link-value\">\n <a [href]=\"getLinkUrl()\" target=\"_blank\" rel=\"noopener noreferrer\" class=\"link\">\n {{ getLinkUrl() }}\n </a>\n </div>\n <div class=\"link-actions\">\n <ng-content select=\"[ngsCommentEditorCommandEditLink],[ngsCommentEditorCommandUnsetLink]\"/>\n </div>\n </div>\n}\n<div class=\"commands-row\">\n <ng-content select=\"[ngsCommentEditorCommand],ngs-comment-editor-divider\"/>\n</div>\n",
1105
+ styles: [":host{display:block;min-height:calc(var(--spacing, .25rem) * 12);padding-inline:calc(var(--spacing, .25rem) * 2);border-radius:var(--ngs-radius-xl);background:var(--ngs-color-neutral-950);color:var(--ngs-color-neutral-200);box-shadow:var(--ngs-shadow-sm)}:host .link-row{display:flex;align-items:center;gap:var(--spacing, .25rem);height:calc(var(--spacing, .25rem) * 11);border-bottom:1px solid var(--ngs-color-neutral-700)}:host .link-value{flex:1 1 auto;width:116px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--ngs-font-size-sm)}:host .link-actions{display:flex;align-items:center;flex:none}:host .commands-row{display:flex;align-items:center;justify-content:center;height:calc(var(--spacing, .25rem) * 12);gap:calc(var(--spacing, .25rem) * .5)}:host .link{position:relative;top:1px;color:var(--ngs-color-tertiary-300)}:host .link:hover{color:var(--ngs-color-tertiary-100)}:host ::ng-deep .button{display:flex;align-items:center;justify-content:center;width:calc(var(--spacing, .25rem) * 10);height:calc(var(--spacing, .25rem) * 10);border-radius:calc(infinity * 1px);--ngs-icon-size: var(--ngs-font-size-xl)}:host ::ng-deep .button:hover,:host ::ng-deep .button.active{color:var(--ngs-color-tertiary-300);background:var(--ngs-color-neutral-700)}:host ::ng-deep .button:disabled{pointer-events:none;opacity:.7}:host-context(html.dark){background:var(--ngs-color-tertiary-200);color:var(--ngs-color-neutral-900)}:host-context(html.dark) .link{color:var(--ngs-color-tertiary-700)}:host-context(html.dark) .link:hover{color:var(--ngs-color-tertiary-800)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"],
1106
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
1107
+ });
1108
+ };
1109
+ i0.ɵɵngDeclareClassMetadata({
1110
+ minVersion: "12.0.0",
1111
+ version: "22.3.0",
1112
+ ngImport: i0,
1113
+ type: CommentEditorBubbleMenu,
1114
+ decorators: [{
1115
+ type: Component,
1116
+ args: [{
1117
+ selector: "ngs-comment-editor-bubble-menu",
1118
+ exportAs: "ngsCommentEditorBubbleMenu",
1119
+ providers: [{
1120
+ provide: COMMENT_EDITOR_BUBBLE_MENU,
1121
+ useExisting: forwardRef(() => CommentEditorBubbleMenu)
1122
+ }],
1123
+ changeDetection: ChangeDetectionStrategy.OnPush,
1124
+ host: { "class": "ngs-comment-editor-bubble-menu" },
1125
+ template: "@if (commentEditor.api.isActive('link') && getLinkUrl()) {\n <div class=\"link-row\">\n <div class=\"link-value\">\n <a [href]=\"getLinkUrl()\" target=\"_blank\" rel=\"noopener noreferrer\" class=\"link\">\n {{ getLinkUrl() }}\n </a>\n </div>\n <div class=\"link-actions\">\n <ng-content select=\"[ngsCommentEditorCommandEditLink],[ngsCommentEditorCommandUnsetLink]\"/>\n </div>\n </div>\n}\n<div class=\"commands-row\">\n <ng-content select=\"[ngsCommentEditorCommand],ngs-comment-editor-divider\"/>\n</div>\n",
1126
+ styles: [":host{display:block;min-height:calc(var(--spacing, .25rem) * 12);padding-inline:calc(var(--spacing, .25rem) * 2);border-radius:var(--ngs-radius-xl);background:var(--ngs-color-neutral-950);color:var(--ngs-color-neutral-200);box-shadow:var(--ngs-shadow-sm)}:host .link-row{display:flex;align-items:center;gap:var(--spacing, .25rem);height:calc(var(--spacing, .25rem) * 11);border-bottom:1px solid var(--ngs-color-neutral-700)}:host .link-value{flex:1 1 auto;width:116px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--ngs-font-size-sm)}:host .link-actions{display:flex;align-items:center;flex:none}:host .commands-row{display:flex;align-items:center;justify-content:center;height:calc(var(--spacing, .25rem) * 12);gap:calc(var(--spacing, .25rem) * .5)}:host .link{position:relative;top:1px;color:var(--ngs-color-tertiary-300)}:host .link:hover{color:var(--ngs-color-tertiary-100)}:host ::ng-deep .button{display:flex;align-items:center;justify-content:center;width:calc(var(--spacing, .25rem) * 10);height:calc(var(--spacing, .25rem) * 10);border-radius:calc(infinity * 1px);--ngs-icon-size: var(--ngs-font-size-xl)}:host ::ng-deep .button:hover,:host ::ng-deep .button.active{color:var(--ngs-color-tertiary-300);background:var(--ngs-color-neutral-700)}:host ::ng-deep .button:disabled{pointer-events:none;opacity:.7}:host-context(html.dark){background:var(--ngs-color-tertiary-200);color:var(--ngs-color-neutral-900)}:host-context(html.dark) .link{color:var(--ngs-color-tertiary-700)}:host-context(html.dark) .link:hover{color:var(--ngs-color-tertiary-800)}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
1127
+ }]
1128
+ }]
1129
+ });
1130
+ var CommentEditorFooterBar = class CommentEditorFooterBar {
1131
+ static ɵfac = i0.ɵɵngDeclareFactory({
1132
+ minVersion: "12.0.0",
1133
+ version: "22.3.0",
1134
+ ngImport: i0,
1135
+ type: CommentEditorFooterBar,
1136
+ deps: [],
1137
+ target: i0.ɵɵFactoryTarget.Component
1138
+ });
1139
+ static ɵcmp = i0.ɵɵngDeclareComponent({
1140
+ minVersion: "14.0.0",
1141
+ version: "22.3.0",
1142
+ type: CommentEditorFooterBar,
1143
+ isStandalone: true,
1144
+ selector: "ngs-comment-editor-footer-bar",
1145
+ host: { classAttribute: "ngs-comment-editor-footer-bar" },
1146
+ exportAs: ["ngsCommentEditorFooterBar"],
1147
+ ngImport: i0,
1148
+ template: "<ng-content select=\"[ngsCommentEditorCommand],ngs-comment-editor-divider\"/>\n",
1149
+ styles: [":host{display:flex;align-items:center;justify-content:flex-end;width:100%;gap:calc(var(--spacing, .25rem) * .5)}:host-context(.ngs-comment-editor.full-view){justify-content:flex-start}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"],
1150
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
1151
+ });
1152
+ };
1153
+ i0.ɵɵngDeclareClassMetadata({
1154
+ minVersion: "12.0.0",
1155
+ version: "22.3.0",
1156
+ ngImport: i0,
1157
+ type: CommentEditorFooterBar,
1158
+ decorators: [{
1159
+ type: Component,
1160
+ args: [{
1161
+ selector: "ngs-comment-editor-footer-bar",
1162
+ exportAs: "ngsCommentEditorFooterBar",
1163
+ changeDetection: ChangeDetectionStrategy.OnPush,
1164
+ host: { "class": "ngs-comment-editor-footer-bar" },
1165
+ template: "<ng-content select=\"[ngsCommentEditorCommand],ngs-comment-editor-divider\"/>\n",
1166
+ styles: [":host{display:flex;align-items:center;justify-content:flex-end;width:100%;gap:calc(var(--spacing, .25rem) * .5)}:host-context(.ngs-comment-editor.full-view){justify-content:flex-start}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
1167
+ }]
1168
+ }]
1169
+ });
1170
+ var CommentEditorCommandDirective = class CommentEditorCommandDirective {
1171
+ static ɵfac = i0.ɵɵngDeclareFactory({
1172
+ minVersion: "12.0.0",
1173
+ version: "22.3.0",
1174
+ ngImport: i0,
1175
+ type: CommentEditorCommandDirective,
1176
+ deps: [],
1177
+ target: i0.ɵɵFactoryTarget.Directive
1178
+ });
1179
+ static ɵdir = i0.ɵɵngDeclareDirective({
1180
+ minVersion: "14.0.0",
1181
+ version: "22.3.0",
1182
+ type: CommentEditorCommandDirective,
1183
+ isStandalone: true,
1184
+ selector: "[ngsCommentEditorCommand]",
1185
+ host: { properties: { "class.button": "true" } },
1186
+ ngImport: i0
1187
+ });
1188
+ };
1189
+ i0.ɵɵngDeclareClassMetadata({
1190
+ minVersion: "12.0.0",
1191
+ version: "22.3.0",
1192
+ ngImport: i0,
1193
+ type: CommentEditorCommandDirective,
1194
+ decorators: [{
1195
+ type: Directive,
1196
+ args: [{
1197
+ selector: "[ngsCommentEditorCommand]",
1198
+ host: { "[class.button]": "true" }
1199
+ }]
1200
+ }]
1201
+ });
1202
+ var CommentEditorCommandBase = class {
1203
+ commentEditor = inject(COMMENT_EDITOR);
1204
+ preserveSelection(event) {
1205
+ event.preventDefault();
1206
+ }
1207
+ run(command, event) {
1208
+ event?.preventDefault();
1209
+ event?.stopPropagation();
1210
+ this.commentEditor.api.runCommand(command);
1211
+ }
1212
+ };
1213
+ var CommentEditorCommandBoldDirective = class CommentEditorCommandBoldDirective extends CommentEditorCommandBase {
1214
+ static ɵfac = i0.ɵɵngDeclareFactory({
1215
+ minVersion: "12.0.0",
1216
+ version: "22.3.0",
1217
+ ngImport: i0,
1218
+ type: CommentEditorCommandBoldDirective,
1219
+ deps: null,
1220
+ target: i0.ɵɵFactoryTarget.Directive
1221
+ });
1222
+ static ɵdir = i0.ɵɵngDeclareDirective({
1223
+ minVersion: "14.0.0",
1224
+ version: "22.3.0",
1225
+ type: CommentEditorCommandBoldDirective,
1226
+ isStandalone: true,
1227
+ selector: "[ngsCommentEditorCommandBold]",
1228
+ host: {
1229
+ listeners: {
1230
+ "mousedown": "preserveSelection($event)",
1231
+ "click": "run(\"toggleBold\", $event)"
1232
+ },
1233
+ properties: {
1234
+ "attr.disabled": "commentEditor.api.isCommandDisabled(\"toggleBold\") ? \"\" : null",
1235
+ "class.active": "commentEditor.api.isActive(\"toggleBold\")"
1236
+ }
1237
+ },
1238
+ exportAs: ["ngsCommentEditorCommandBold"],
1239
+ usesInheritance: true,
1240
+ ngImport: i0
1241
+ });
1242
+ };
1243
+ i0.ɵɵngDeclareClassMetadata({
1244
+ minVersion: "12.0.0",
1245
+ version: "22.3.0",
1246
+ ngImport: i0,
1247
+ type: CommentEditorCommandBoldDirective,
1248
+ decorators: [{
1249
+ type: Directive,
1250
+ args: [{
1251
+ selector: "[ngsCommentEditorCommandBold]",
1252
+ exportAs: "ngsCommentEditorCommandBold",
1253
+ host: {
1254
+ "[attr.disabled]": "commentEditor.api.isCommandDisabled(\"toggleBold\") ? \"\" : null",
1255
+ "[class.active]": "commentEditor.api.isActive(\"toggleBold\")",
1256
+ "(mousedown)": "preserveSelection($event)",
1257
+ "(click)": "run(\"toggleBold\", $event)"
1258
+ }
1259
+ }]
1260
+ }]
1261
+ });
1262
+ var CommentEditorCommandItalicDirective = class CommentEditorCommandItalicDirective extends CommentEditorCommandBase {
1263
+ static ɵfac = i0.ɵɵngDeclareFactory({
1264
+ minVersion: "12.0.0",
1265
+ version: "22.3.0",
1266
+ ngImport: i0,
1267
+ type: CommentEditorCommandItalicDirective,
1268
+ deps: null,
1269
+ target: i0.ɵɵFactoryTarget.Directive
1270
+ });
1271
+ static ɵdir = i0.ɵɵngDeclareDirective({
1272
+ minVersion: "14.0.0",
1273
+ version: "22.3.0",
1274
+ type: CommentEditorCommandItalicDirective,
1275
+ isStandalone: true,
1276
+ selector: "[ngsCommentEditorCommandItalic]",
1277
+ host: {
1278
+ listeners: {
1279
+ "mousedown": "preserveSelection($event)",
1280
+ "click": "run(\"toggleItalic\", $event)"
1281
+ },
1282
+ properties: {
1283
+ "attr.disabled": "commentEditor.api.isCommandDisabled(\"toggleItalic\") ? \"\" : null",
1284
+ "class.active": "commentEditor.api.isActive(\"toggleItalic\")"
1285
+ }
1286
+ },
1287
+ usesInheritance: true,
1288
+ ngImport: i0
1289
+ });
1290
+ };
1291
+ i0.ɵɵngDeclareClassMetadata({
1292
+ minVersion: "12.0.0",
1293
+ version: "22.3.0",
1294
+ ngImport: i0,
1295
+ type: CommentEditorCommandItalicDirective,
1296
+ decorators: [{
1297
+ type: Directive,
1298
+ args: [{
1299
+ selector: "[ngsCommentEditorCommandItalic]",
1300
+ host: {
1301
+ "[attr.disabled]": "commentEditor.api.isCommandDisabled(\"toggleItalic\") ? \"\" : null",
1302
+ "[class.active]": "commentEditor.api.isActive(\"toggleItalic\")",
1303
+ "(mousedown)": "preserveSelection($event)",
1304
+ "(click)": "run(\"toggleItalic\", $event)"
1305
+ }
1306
+ }]
1307
+ }]
1308
+ });
1309
+ var CommentEditorCommandStrikeDirective = class CommentEditorCommandStrikeDirective extends CommentEditorCommandBase {
1310
+ static ɵfac = i0.ɵɵngDeclareFactory({
1311
+ minVersion: "12.0.0",
1312
+ version: "22.3.0",
1313
+ ngImport: i0,
1314
+ type: CommentEditorCommandStrikeDirective,
1315
+ deps: null,
1316
+ target: i0.ɵɵFactoryTarget.Directive
1317
+ });
1318
+ static ɵdir = i0.ɵɵngDeclareDirective({
1319
+ minVersion: "14.0.0",
1320
+ version: "22.3.0",
1321
+ type: CommentEditorCommandStrikeDirective,
1322
+ isStandalone: true,
1323
+ selector: "[ngsCommentEditorCommandStrike]",
1324
+ host: {
1325
+ listeners: {
1326
+ "mousedown": "preserveSelection($event)",
1327
+ "click": "run(\"toggleStrike\", $event)"
1328
+ },
1329
+ properties: {
1330
+ "attr.disabled": "commentEditor.api.isCommandDisabled(\"toggleStrike\") ? \"\" : null",
1331
+ "class.active": "commentEditor.api.isActive(\"toggleStrike\")"
1332
+ }
1333
+ },
1334
+ usesInheritance: true,
1335
+ ngImport: i0
1336
+ });
1337
+ };
1338
+ i0.ɵɵngDeclareClassMetadata({
1339
+ minVersion: "12.0.0",
1340
+ version: "22.3.0",
1341
+ ngImport: i0,
1342
+ type: CommentEditorCommandStrikeDirective,
1343
+ decorators: [{
1344
+ type: Directive,
1345
+ args: [{
1346
+ selector: "[ngsCommentEditorCommandStrike]",
1347
+ host: {
1348
+ "[attr.disabled]": "commentEditor.api.isCommandDisabled(\"toggleStrike\") ? \"\" : null",
1349
+ "[class.active]": "commentEditor.api.isActive(\"toggleStrike\")",
1350
+ "(mousedown)": "preserveSelection($event)",
1351
+ "(click)": "run(\"toggleStrike\", $event)"
1352
+ }
1353
+ }]
1354
+ }]
1355
+ });
1356
+ var CommentEditorCommandBulletListDirective = class CommentEditorCommandBulletListDirective extends CommentEditorCommandBase {
1357
+ static ɵfac = i0.ɵɵngDeclareFactory({
1358
+ minVersion: "12.0.0",
1359
+ version: "22.3.0",
1360
+ ngImport: i0,
1361
+ type: CommentEditorCommandBulletListDirective,
1362
+ deps: null,
1363
+ target: i0.ɵɵFactoryTarget.Directive
1364
+ });
1365
+ static ɵdir = i0.ɵɵngDeclareDirective({
1366
+ minVersion: "14.0.0",
1367
+ version: "22.3.0",
1368
+ type: CommentEditorCommandBulletListDirective,
1369
+ isStandalone: true,
1370
+ selector: "[ngsCommentEditorCommandBulletList]",
1371
+ host: {
1372
+ listeners: {
1373
+ "mousedown": "preserveSelection($event)",
1374
+ "click": "run(\"toggleBulletList\", $event)"
1375
+ },
1376
+ properties: {
1377
+ "attr.disabled": "commentEditor.api.isCommandDisabled(\"toggleBulletList\") ? \"\" : null",
1378
+ "class.active": "commentEditor.api.isActive(\"toggleBulletList\")"
1379
+ }
1380
+ },
1381
+ usesInheritance: true,
1382
+ ngImport: i0
1383
+ });
1384
+ };
1385
+ i0.ɵɵngDeclareClassMetadata({
1386
+ minVersion: "12.0.0",
1387
+ version: "22.3.0",
1388
+ ngImport: i0,
1389
+ type: CommentEditorCommandBulletListDirective,
1390
+ decorators: [{
1391
+ type: Directive,
1392
+ args: [{
1393
+ selector: "[ngsCommentEditorCommandBulletList]",
1394
+ host: {
1395
+ "[attr.disabled]": "commentEditor.api.isCommandDisabled(\"toggleBulletList\") ? \"\" : null",
1396
+ "[class.active]": "commentEditor.api.isActive(\"toggleBulletList\")",
1397
+ "(mousedown)": "preserveSelection($event)",
1398
+ "(click)": "run(\"toggleBulletList\", $event)"
1399
+ }
1400
+ }]
1401
+ }]
1402
+ });
1403
+ var CommentEditorCommandOrderedListDirective = class CommentEditorCommandOrderedListDirective extends CommentEditorCommandBase {
1404
+ static ɵfac = i0.ɵɵngDeclareFactory({
1405
+ minVersion: "12.0.0",
1406
+ version: "22.3.0",
1407
+ ngImport: i0,
1408
+ type: CommentEditorCommandOrderedListDirective,
1409
+ deps: null,
1410
+ target: i0.ɵɵFactoryTarget.Directive
1411
+ });
1412
+ static ɵdir = i0.ɵɵngDeclareDirective({
1413
+ minVersion: "14.0.0",
1414
+ version: "22.3.0",
1415
+ type: CommentEditorCommandOrderedListDirective,
1416
+ isStandalone: true,
1417
+ selector: "[ngsCommentEditorCommandOrderedList]",
1418
+ host: {
1419
+ listeners: {
1420
+ "mousedown": "preserveSelection($event)",
1421
+ "click": "run(\"toggleOrderedList\", $event)"
1422
+ },
1423
+ properties: {
1424
+ "attr.disabled": "commentEditor.api.isCommandDisabled(\"toggleOrderedList\") ? \"\" : null",
1425
+ "class.active": "commentEditor.api.isActive(\"toggleOrderedList\")"
1426
+ }
1427
+ },
1428
+ usesInheritance: true,
1429
+ ngImport: i0
1430
+ });
1431
+ };
1432
+ i0.ɵɵngDeclareClassMetadata({
1433
+ minVersion: "12.0.0",
1434
+ version: "22.3.0",
1435
+ ngImport: i0,
1436
+ type: CommentEditorCommandOrderedListDirective,
1437
+ decorators: [{
1438
+ type: Directive,
1439
+ args: [{
1440
+ selector: "[ngsCommentEditorCommandOrderedList]",
1441
+ host: {
1442
+ "[attr.disabled]": "commentEditor.api.isCommandDisabled(\"toggleOrderedList\") ? \"\" : null",
1443
+ "[class.active]": "commentEditor.api.isActive(\"toggleOrderedList\")",
1444
+ "(mousedown)": "preserveSelection($event)",
1445
+ "(click)": "run(\"toggleOrderedList\", $event)"
1446
+ }
1447
+ }]
1448
+ }]
1449
+ });
1450
+ var CommentEditorCommandBlockquoteDirective = class CommentEditorCommandBlockquoteDirective extends CommentEditorCommandBase {
1451
+ static ɵfac = i0.ɵɵngDeclareFactory({
1452
+ minVersion: "12.0.0",
1453
+ version: "22.3.0",
1454
+ ngImport: i0,
1455
+ type: CommentEditorCommandBlockquoteDirective,
1456
+ deps: null,
1457
+ target: i0.ɵɵFactoryTarget.Directive
1458
+ });
1459
+ static ɵdir = i0.ɵɵngDeclareDirective({
1460
+ minVersion: "14.0.0",
1461
+ version: "22.3.0",
1462
+ type: CommentEditorCommandBlockquoteDirective,
1463
+ isStandalone: true,
1464
+ selector: "[ngsCommentEditorCommandBlockquote]",
1465
+ host: {
1466
+ listeners: {
1467
+ "mousedown": "preserveSelection($event)",
1468
+ "click": "run(\"toggleBlockquote\", $event)"
1469
+ },
1470
+ properties: {
1471
+ "attr.disabled": "commentEditor.api.isCommandDisabled(\"toggleBlockquote\") ? \"\" : null",
1472
+ "class.active": "commentEditor.api.isActive(\"toggleBlockquote\")"
1473
+ }
1474
+ },
1475
+ usesInheritance: true,
1476
+ ngImport: i0
1477
+ });
1478
+ };
1479
+ i0.ɵɵngDeclareClassMetadata({
1480
+ minVersion: "12.0.0",
1481
+ version: "22.3.0",
1482
+ ngImport: i0,
1483
+ type: CommentEditorCommandBlockquoteDirective,
1484
+ decorators: [{
1485
+ type: Directive,
1486
+ args: [{
1487
+ selector: "[ngsCommentEditorCommandBlockquote]",
1488
+ host: {
1489
+ "[attr.disabled]": "commentEditor.api.isCommandDisabled(\"toggleBlockquote\") ? \"\" : null",
1490
+ "[class.active]": "commentEditor.api.isActive(\"toggleBlockquote\")",
1491
+ "(mousedown)": "preserveSelection($event)",
1492
+ "(click)": "run(\"toggleBlockquote\", $event)"
1493
+ }
1494
+ }]
1495
+ }]
1496
+ });
1497
+ var CommentEditorCommandCodeBlockDirective = class CommentEditorCommandCodeBlockDirective extends CommentEditorCommandBase {
1498
+ static ɵfac = i0.ɵɵngDeclareFactory({
1499
+ minVersion: "12.0.0",
1500
+ version: "22.3.0",
1501
+ ngImport: i0,
1502
+ type: CommentEditorCommandCodeBlockDirective,
1503
+ deps: null,
1504
+ target: i0.ɵɵFactoryTarget.Directive
1505
+ });
1506
+ static ɵdir = i0.ɵɵngDeclareDirective({
1507
+ minVersion: "14.0.0",
1508
+ version: "22.3.0",
1509
+ type: CommentEditorCommandCodeBlockDirective,
1510
+ isStandalone: true,
1511
+ selector: "[ngsCommentEditorCommandCodeBlock]",
1512
+ host: {
1513
+ listeners: {
1514
+ "mousedown": "preserveSelection($event)",
1515
+ "click": "run(\"toggleCodeBlock\", $event)"
1516
+ },
1517
+ properties: {
1518
+ "attr.disabled": "commentEditor.api.isCommandDisabled(\"toggleCodeBlock\") ? \"\" : null",
1519
+ "class.active": "commentEditor.api.isActive(\"toggleCodeBlock\")"
1520
+ }
1521
+ },
1522
+ usesInheritance: true,
1523
+ ngImport: i0
1524
+ });
1525
+ };
1526
+ i0.ɵɵngDeclareClassMetadata({
1527
+ minVersion: "12.0.0",
1528
+ version: "22.3.0",
1529
+ ngImport: i0,
1530
+ type: CommentEditorCommandCodeBlockDirective,
1531
+ decorators: [{
1532
+ type: Directive,
1533
+ args: [{
1534
+ selector: "[ngsCommentEditorCommandCodeBlock]",
1535
+ host: {
1536
+ "[attr.disabled]": "commentEditor.api.isCommandDisabled(\"toggleCodeBlock\") ? \"\" : null",
1537
+ "[class.active]": "commentEditor.api.isActive(\"toggleCodeBlock\")",
1538
+ "(mousedown)": "preserveSelection($event)",
1539
+ "(click)": "run(\"toggleCodeBlock\", $event)"
1540
+ }
1541
+ }]
1542
+ }]
1543
+ });
1544
+ var CommentEditorCommandImageDirective = class CommentEditorCommandImageDirective {
1545
+ commentEditor = inject(COMMENT_EDITOR);
1546
+ selectImage(event) {
1547
+ const file = event.files[0];
1548
+ if (file) this.commentEditor.api.insertImage(file);
1549
+ }
1550
+ static ɵfac = i0.ɵɵngDeclareFactory({
1551
+ minVersion: "12.0.0",
1552
+ version: "22.3.0",
1553
+ ngImport: i0,
1554
+ type: CommentEditorCommandImageDirective,
1555
+ deps: [],
1556
+ target: i0.ɵɵFactoryTarget.Directive
1557
+ });
1558
+ static ɵdir = i0.ɵɵngDeclareDirective({
1559
+ minVersion: "14.0.0",
1560
+ version: "22.3.0",
1561
+ type: CommentEditorCommandImageDirective,
1562
+ isStandalone: true,
1563
+ selector: "[ngsCommentEditorCommandImage]",
1564
+ host: {
1565
+ listeners: { "fileSelected": "selectImage($event)" },
1566
+ properties: { "attr.accept": "\"image/*\"" }
1567
+ },
1568
+ hostDirectives: [{
1569
+ directive: i1$1.UploadTriggerDirective,
1570
+ outputs: ["fileSelected", "fileSelected"]
1571
+ }],
1572
+ ngImport: i0
1573
+ });
1574
+ };
1575
+ i0.ɵɵngDeclareClassMetadata({
1576
+ minVersion: "12.0.0",
1577
+ version: "22.3.0",
1578
+ ngImport: i0,
1579
+ type: CommentEditorCommandImageDirective,
1580
+ decorators: [{
1581
+ type: Directive,
1582
+ args: [{
1583
+ selector: "[ngsCommentEditorCommandImage]",
1584
+ hostDirectives: [{
1585
+ directive: UploadTriggerDirective,
1586
+ outputs: ["fileSelected"]
1587
+ }],
1588
+ host: {
1589
+ "[attr.accept]": "\"image/*\"",
1590
+ "(fileSelected)": "selectImage($event)"
1591
+ }
1592
+ }]
1593
+ }]
1594
+ });
1595
+ var YoutubeDialog = class YoutubeDialog {
1596
+ dialogRef = inject(DialogRef);
1597
+ data = inject(DIALOG_DATA);
1598
+ linkUrl = this.data.linkUrl ?? "";
1599
+ isUpdate = !!this.data.linkUrl;
1600
+ submit() {
1601
+ this.dialogRef.close(this.linkUrl.trim());
1602
+ }
1603
+ cancel() {
1604
+ this.dialogRef.close();
1605
+ }
1606
+ static ɵfac = i0.ɵɵngDeclareFactory({
1607
+ minVersion: "12.0.0",
1608
+ version: "22.3.0",
1609
+ ngImport: i0,
1610
+ type: YoutubeDialog,
1611
+ deps: [],
1612
+ target: i0.ɵɵFactoryTarget.Component
1613
+ });
1614
+ static ɵcmp = i0.ɵɵngDeclareComponent({
1615
+ minVersion: "14.0.0",
1616
+ version: "22.3.0",
1617
+ type: YoutubeDialog,
1618
+ isStandalone: true,
1619
+ selector: "ngs-comment-editor-youtube-dialog",
1620
+ ngImport: i0,
1621
+ template: "<form class=\"w-[500px] max-w-full\" (ngSubmit)=\"submit()\">\n <h3 ngs-dialog-title>{{ isUpdate ? 'Update YouTube' : 'Add YouTube' }}</h3>\n <ngs-dialog-content>\n <div class=\"pt-4\">\n <ngs-form-field class=\"w-full\">\n <ngs-label>Paste URL</ngs-label>\n <input name=\"linkUrl\" ngsInput [(ngModel)]=\"linkUrl\">\n </ngs-form-field>\n </div>\n </ngs-dialog-content>\n <div ngs-dialog-actions align=\"end\">\n <button type=\"button\" ngsButton (click)=\"cancel()\">Cancel</button>\n <button type=\"submit\" ngsButton=\"filled\" [disabled]=\"!linkUrl.trim()\">\n {{ isUpdate ? 'Save' : 'Add URL' }}\n </button>\n </div>\n</form>\n",
1622
+ dependencies: [
1623
+ {
1624
+ kind: "ngmodule",
1625
+ type: FormsModule
1626
+ },
1627
+ {
1628
+ kind: "directive",
1629
+ type: i1.ɵNgNoValidate,
1630
+ selector: "form:not([ngNoForm]):not([ngNativeValidate])"
1631
+ },
1632
+ {
1633
+ kind: "directive",
1634
+ type: i1.DefaultValueAccessor,
1635
+ selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
1636
+ },
1637
+ {
1638
+ kind: "directive",
1639
+ type: i1.NgControlStatus,
1640
+ selector: "[formControlName],[ngModel],[formControl]"
1641
+ },
1642
+ {
1643
+ kind: "directive",
1644
+ type: i1.NgControlStatusGroup,
1645
+ selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"
1646
+ },
1647
+ {
1648
+ kind: "directive",
1649
+ type: i1.NgModel,
1650
+ selector: "[ngModel]:not([formControlName]):not([formControl])",
1651
+ inputs: [
1652
+ "name",
1653
+ "disabled",
1654
+ "ngModel",
1655
+ "ngModelOptions"
1656
+ ],
1657
+ outputs: ["ngModelChange"],
1658
+ exportAs: ["ngModel"]
1659
+ },
1660
+ {
1661
+ kind: "directive",
1662
+ type: i1.NgForm,
1663
+ selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]",
1664
+ inputs: ["ngFormOptions"],
1665
+ outputs: ["ngSubmit"],
1666
+ exportAs: ["ngForm"]
1667
+ },
1668
+ {
1669
+ kind: "component",
1670
+ type: Button,
1671
+ selector: "\n button[ngsButton], button[ngsIconButton],\n a[ngsButton], a[ngsIconButton]\n ",
1672
+ inputs: [
1673
+ "ngsButton",
1674
+ "ngsIconButton",
1675
+ "loading",
1676
+ "disabled",
1677
+ "disabledInteractive",
1678
+ "disableRipple",
1679
+ "reverse",
1680
+ "fullWidth",
1681
+ "hideTextOnMobile"
1682
+ ],
1683
+ exportAs: ["ngsButton"]
1684
+ },
1685
+ {
1686
+ kind: "component",
1687
+ type: DialogActions,
1688
+ selector: "ngs-dialog-actions, [ngs-dialog-actions], [ngsDialogActions]",
1689
+ inputs: ["align"]
1690
+ },
1691
+ {
1692
+ kind: "component",
1693
+ type: DialogContent,
1694
+ selector: "ngs-dialog-content,[ngs-dialog-content],[ngsDialogContent]"
1695
+ },
1696
+ {
1697
+ kind: "component",
1698
+ type: DialogTitle,
1699
+ selector: "ngs-dialog-title, [ngs-dialog-title], [ngsDialogTitle]",
1700
+ inputs: ["id"],
1701
+ exportAs: ["ngsDialogTitle"]
1702
+ },
1703
+ {
1704
+ kind: "component",
1705
+ type: FormField,
1706
+ selector: "ngs-form-field",
1707
+ inputs: [
1708
+ "labelMode",
1709
+ "subscriptHiddenIfEmpty",
1710
+ "sameHeightAsButton"
1711
+ ],
1712
+ exportAs: ["ngsFormField"]
1713
+ },
1714
+ {
1715
+ kind: "component",
1716
+ type: Label,
1717
+ selector: "ngs-label"
1718
+ },
1719
+ {
1720
+ kind: "directive",
1721
+ type: Input$1,
1722
+ selector: "input[ngsInput], textarea[ngsInput]",
1723
+ inputs: [
1724
+ "id",
1725
+ "placeholder",
1726
+ "required",
1727
+ "disabled",
1728
+ "readonly",
1729
+ "errorStateMatcher"
1730
+ ],
1731
+ exportAs: ["ngsInput"]
1732
+ }
1733
+ ],
1734
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
1735
+ });
1736
+ };
1737
+ i0.ɵɵngDeclareClassMetadata({
1738
+ minVersion: "12.0.0",
1739
+ version: "22.3.0",
1740
+ ngImport: i0,
1741
+ type: YoutubeDialog,
1742
+ decorators: [{
1743
+ type: Component,
1744
+ args: [{
1745
+ selector: "ngs-comment-editor-youtube-dialog",
1746
+ imports: [
1747
+ FormsModule,
1748
+ Button,
1749
+ DialogActions,
1750
+ DialogContent,
1751
+ DialogTitle,
1752
+ FormField,
1753
+ Label,
1754
+ Input$1
1755
+ ],
1756
+ changeDetection: ChangeDetectionStrategy.OnPush,
1757
+ template: "<form class=\"w-[500px] max-w-full\" (ngSubmit)=\"submit()\">\n <h3 ngs-dialog-title>{{ isUpdate ? 'Update YouTube' : 'Add YouTube' }}</h3>\n <ngs-dialog-content>\n <div class=\"pt-4\">\n <ngs-form-field class=\"w-full\">\n <ngs-label>Paste URL</ngs-label>\n <input name=\"linkUrl\" ngsInput [(ngModel)]=\"linkUrl\">\n </ngs-form-field>\n </div>\n </ngs-dialog-content>\n <div ngs-dialog-actions align=\"end\">\n <button type=\"button\" ngsButton (click)=\"cancel()\">Cancel</button>\n <button type=\"submit\" ngsButton=\"filled\" [disabled]=\"!linkUrl.trim()\">\n {{ isUpdate ? 'Save' : 'Add URL' }}\n </button>\n </div>\n</form>\n"
1758
+ }]
1759
+ }]
1760
+ });
1761
+ var CommentEditorCommandYoutubeDirective = class CommentEditorCommandYoutubeDirective {
1762
+ destroyRef = inject(DestroyRef);
1763
+ dialog = inject(Dialog);
1764
+ commentEditor = inject(COMMENT_EDITOR);
1765
+ preserveSelection(event) {
1766
+ event.preventDefault();
1767
+ }
1768
+ open(event) {
1769
+ event.preventDefault();
1770
+ event.stopPropagation();
1771
+ this.dialog.open(YoutubeDialog, { data: { linkUrl: "" } }).afterClosed().pipe(takeUntilDestroyed(this.destroyRef)).subscribe((linkUrl) => {
1772
+ if (typeof linkUrl === "string" && linkUrl) {
1773
+ this.commentEditor.api.insertYoutube(linkUrl);
1774
+ this.commentEditor.api.focus();
1775
+ }
1776
+ });
1777
+ }
1778
+ static ɵfac = i0.ɵɵngDeclareFactory({
1779
+ minVersion: "12.0.0",
1780
+ version: "22.3.0",
1781
+ ngImport: i0,
1782
+ type: CommentEditorCommandYoutubeDirective,
1783
+ deps: [],
1784
+ target: i0.ɵɵFactoryTarget.Directive
1785
+ });
1786
+ static ɵdir = i0.ɵɵngDeclareDirective({
1787
+ minVersion: "14.0.0",
1788
+ version: "22.3.0",
1789
+ type: CommentEditorCommandYoutubeDirective,
1790
+ isStandalone: true,
1791
+ selector: "[ngsCommentEditorCommandYoutube]",
1792
+ host: { listeners: {
1793
+ "mousedown": "preserveSelection($event)",
1794
+ "click": "open($event)"
1795
+ } },
1796
+ ngImport: i0
1797
+ });
1798
+ };
1799
+ i0.ɵɵngDeclareClassMetadata({
1800
+ minVersion: "12.0.0",
1801
+ version: "22.3.0",
1802
+ ngImport: i0,
1803
+ type: CommentEditorCommandYoutubeDirective,
1804
+ decorators: [{
1805
+ type: Directive,
1806
+ args: [{
1807
+ selector: "[ngsCommentEditorCommandYoutube]",
1808
+ host: {
1809
+ "(mousedown)": "preserveSelection($event)",
1810
+ "(click)": "open($event)"
1811
+ }
1812
+ }]
1813
+ }]
1814
+ });
1815
+ var LinkDialog = class LinkDialog {
1816
+ dialogRef = inject(DialogRef);
1817
+ data = inject(DIALOG_DATA);
1818
+ linkUrl = this.data.linkUrl ?? "";
1819
+ isUpdate = !!this.data.linkUrl;
1820
+ submit() {
1821
+ this.dialogRef.close(this.linkUrl.trim());
1822
+ }
1823
+ cancel() {
1824
+ this.dialogRef.close();
1825
+ }
1826
+ static ɵfac = i0.ɵɵngDeclareFactory({
1827
+ minVersion: "12.0.0",
1828
+ version: "22.3.0",
1829
+ ngImport: i0,
1830
+ type: LinkDialog,
1831
+ deps: [],
1832
+ target: i0.ɵɵFactoryTarget.Component
1833
+ });
1834
+ static ɵcmp = i0.ɵɵngDeclareComponent({
1835
+ minVersion: "14.0.0",
1836
+ version: "22.3.0",
1837
+ type: LinkDialog,
1838
+ isStandalone: true,
1839
+ selector: "ngs-comment-editor-link-dialog",
1840
+ ngImport: i0,
1841
+ template: "<form class=\"w-[500px] max-w-full\" (ngSubmit)=\"submit()\">\n <h3 ngs-dialog-title>{{ isUpdate ? 'Update Link' : 'Add Link' }}</h3>\n <ngs-dialog-content>\n <div class=\"pt-4\">\n <ngs-form-field class=\"w-full\">\n <ngs-label>Paste Link</ngs-label>\n <input name=\"linkUrl\" ngsInput [(ngModel)]=\"linkUrl\">\n </ngs-form-field>\n </div>\n </ngs-dialog-content>\n <div ngs-dialog-actions align=\"end\">\n <button type=\"button\" ngsButton (click)=\"cancel()\">Cancel</button>\n <button type=\"submit\" ngsButton=\"filled\" [disabled]=\"!linkUrl.trim()\">\n {{ isUpdate ? 'Save' : 'Add link' }}\n </button>\n </div>\n</form>\n",
1842
+ dependencies: [
1843
+ {
1844
+ kind: "ngmodule",
1845
+ type: FormsModule
1846
+ },
1847
+ {
1848
+ kind: "directive",
1849
+ type: i1.ɵNgNoValidate,
1850
+ selector: "form:not([ngNoForm]):not([ngNativeValidate])"
1851
+ },
1852
+ {
1853
+ kind: "directive",
1854
+ type: i1.DefaultValueAccessor,
1855
+ selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
1856
+ },
1857
+ {
1858
+ kind: "directive",
1859
+ type: i1.NgControlStatus,
1860
+ selector: "[formControlName],[ngModel],[formControl]"
1861
+ },
1862
+ {
1863
+ kind: "directive",
1864
+ type: i1.NgControlStatusGroup,
1865
+ selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"
1866
+ },
1867
+ {
1868
+ kind: "directive",
1869
+ type: i1.NgModel,
1870
+ selector: "[ngModel]:not([formControlName]):not([formControl])",
1871
+ inputs: [
1872
+ "name",
1873
+ "disabled",
1874
+ "ngModel",
1875
+ "ngModelOptions"
1876
+ ],
1877
+ outputs: ["ngModelChange"],
1878
+ exportAs: ["ngModel"]
1879
+ },
1880
+ {
1881
+ kind: "directive",
1882
+ type: i1.NgForm,
1883
+ selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]",
1884
+ inputs: ["ngFormOptions"],
1885
+ outputs: ["ngSubmit"],
1886
+ exportAs: ["ngForm"]
1887
+ },
1888
+ {
1889
+ kind: "component",
1890
+ type: Button,
1891
+ selector: "\n button[ngsButton], button[ngsIconButton],\n a[ngsButton], a[ngsIconButton]\n ",
1892
+ inputs: [
1893
+ "ngsButton",
1894
+ "ngsIconButton",
1895
+ "loading",
1896
+ "disabled",
1897
+ "disabledInteractive",
1898
+ "disableRipple",
1899
+ "reverse",
1900
+ "fullWidth",
1901
+ "hideTextOnMobile"
1902
+ ],
1903
+ exportAs: ["ngsButton"]
1904
+ },
1905
+ {
1906
+ kind: "component",
1907
+ type: DialogActions,
1908
+ selector: "ngs-dialog-actions, [ngs-dialog-actions], [ngsDialogActions]",
1909
+ inputs: ["align"]
1910
+ },
1911
+ {
1912
+ kind: "component",
1913
+ type: DialogContent,
1914
+ selector: "ngs-dialog-content,[ngs-dialog-content],[ngsDialogContent]"
1915
+ },
1916
+ {
1917
+ kind: "component",
1918
+ type: DialogTitle,
1919
+ selector: "ngs-dialog-title, [ngs-dialog-title], [ngsDialogTitle]",
1920
+ inputs: ["id"],
1921
+ exportAs: ["ngsDialogTitle"]
1922
+ },
1923
+ {
1924
+ kind: "component",
1925
+ type: FormField,
1926
+ selector: "ngs-form-field",
1927
+ inputs: [
1928
+ "labelMode",
1929
+ "subscriptHiddenIfEmpty",
1930
+ "sameHeightAsButton"
1931
+ ],
1932
+ exportAs: ["ngsFormField"]
1933
+ },
1934
+ {
1935
+ kind: "component",
1936
+ type: Label,
1937
+ selector: "ngs-label"
1938
+ },
1939
+ {
1940
+ kind: "directive",
1941
+ type: Input$1,
1942
+ selector: "input[ngsInput], textarea[ngsInput]",
1943
+ inputs: [
1944
+ "id",
1945
+ "placeholder",
1946
+ "required",
1947
+ "disabled",
1948
+ "readonly",
1949
+ "errorStateMatcher"
1950
+ ],
1951
+ exportAs: ["ngsInput"]
1952
+ }
1953
+ ],
1954
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
1955
+ });
1956
+ };
1957
+ i0.ɵɵngDeclareClassMetadata({
1958
+ minVersion: "12.0.0",
1959
+ version: "22.3.0",
1960
+ ngImport: i0,
1961
+ type: LinkDialog,
1962
+ decorators: [{
1963
+ type: Component,
1964
+ args: [{
1965
+ selector: "ngs-comment-editor-link-dialog",
1966
+ imports: [
1967
+ FormsModule,
1968
+ Button,
1969
+ DialogActions,
1970
+ DialogContent,
1971
+ DialogTitle,
1972
+ FormField,
1973
+ Label,
1974
+ Input$1
1975
+ ],
1976
+ changeDetection: ChangeDetectionStrategy.OnPush,
1977
+ template: "<form class=\"w-[500px] max-w-full\" (ngSubmit)=\"submit()\">\n <h3 ngs-dialog-title>{{ isUpdate ? 'Update Link' : 'Add Link' }}</h3>\n <ngs-dialog-content>\n <div class=\"pt-4\">\n <ngs-form-field class=\"w-full\">\n <ngs-label>Paste Link</ngs-label>\n <input name=\"linkUrl\" ngsInput [(ngModel)]=\"linkUrl\">\n </ngs-form-field>\n </div>\n </ngs-dialog-content>\n <div ngs-dialog-actions align=\"end\">\n <button type=\"button\" ngsButton (click)=\"cancel()\">Cancel</button>\n <button type=\"submit\" ngsButton=\"filled\" [disabled]=\"!linkUrl.trim()\">\n {{ isUpdate ? 'Save' : 'Add link' }}\n </button>\n </div>\n</form>\n"
1978
+ }]
1979
+ }]
1980
+ });
1981
+ var CommentEditorCommandLinkDirective = class CommentEditorCommandLinkDirective {
1982
+ destroyRef = inject(DestroyRef);
1983
+ dialog = inject(Dialog);
1984
+ commentEditor = inject(COMMENT_EDITOR);
1985
+ preserveSelection(event) {
1986
+ event.preventDefault();
1987
+ }
1988
+ open(event) {
1989
+ event.preventDefault();
1990
+ event.stopPropagation();
1991
+ this.dialog.open(LinkDialog, { data: { linkUrl: this.commentEditor.api.getMarkAttributes("link")?.["href"] ?? "" } }).afterClosed().pipe(takeUntilDestroyed(this.destroyRef)).subscribe((linkUrl) => {
1992
+ if (typeof linkUrl === "string") {
1993
+ this.commentEditor.api.setLink(linkUrl);
1994
+ this.commentEditor.api.focus();
1995
+ }
1996
+ });
1997
+ }
1998
+ static ɵfac = i0.ɵɵngDeclareFactory({
1999
+ minVersion: "12.0.0",
2000
+ version: "22.3.0",
2001
+ ngImport: i0,
2002
+ type: CommentEditorCommandLinkDirective,
2003
+ deps: [],
2004
+ target: i0.ɵɵFactoryTarget.Directive
2005
+ });
2006
+ static ɵdir = i0.ɵɵngDeclareDirective({
2007
+ minVersion: "14.0.0",
2008
+ version: "22.3.0",
2009
+ type: CommentEditorCommandLinkDirective,
2010
+ isStandalone: true,
2011
+ selector: "[ngsCommentEditorCommandLink]",
2012
+ host: {
2013
+ listeners: {
2014
+ "mousedown": "preserveSelection($event)",
2015
+ "click": "open($event)"
2016
+ },
2017
+ properties: {
2018
+ "attr.disabled": "commentEditor.api.isCommandDisabled(\"toggleLink\") ? \"\" : null",
2019
+ "class.active": "commentEditor.api.isActive(\"link\")"
2020
+ }
2021
+ },
2022
+ ngImport: i0
2023
+ });
2024
+ };
2025
+ i0.ɵɵngDeclareClassMetadata({
2026
+ minVersion: "12.0.0",
2027
+ version: "22.3.0",
2028
+ ngImport: i0,
2029
+ type: CommentEditorCommandLinkDirective,
2030
+ decorators: [{
2031
+ type: Directive,
2032
+ args: [{
2033
+ selector: "[ngsCommentEditorCommandLink]",
2034
+ host: {
2035
+ "[attr.disabled]": "commentEditor.api.isCommandDisabled(\"toggleLink\") ? \"\" : null",
2036
+ "[class.active]": "commentEditor.api.isActive(\"link\")",
2037
+ "(mousedown)": "preserveSelection($event)",
2038
+ "(click)": "open($event)"
2039
+ }
2040
+ }]
2041
+ }]
2042
+ });
2043
+ var CommentEditorCommandCodeDirective = class CommentEditorCommandCodeDirective extends CommentEditorCommandBase {
2044
+ static ɵfac = i0.ɵɵngDeclareFactory({
2045
+ minVersion: "12.0.0",
2046
+ version: "22.3.0",
2047
+ ngImport: i0,
2048
+ type: CommentEditorCommandCodeDirective,
2049
+ deps: null,
2050
+ target: i0.ɵɵFactoryTarget.Directive
2051
+ });
2052
+ static ɵdir = i0.ɵɵngDeclareDirective({
2053
+ minVersion: "14.0.0",
2054
+ version: "22.3.0",
2055
+ type: CommentEditorCommandCodeDirective,
2056
+ isStandalone: true,
2057
+ selector: "[ngsCommentEditorCommandCode]",
2058
+ host: {
2059
+ listeners: {
2060
+ "mousedown": "preserveSelection($event)",
2061
+ "click": "run(\"toggleCode\", $event)"
2062
+ },
2063
+ properties: {
2064
+ "attr.disabled": "commentEditor.api.isCommandDisabled(\"toggleCode\") ? \"\" : null",
2065
+ "class.active": "commentEditor.api.isActive(\"toggleCode\")"
2066
+ }
2067
+ },
2068
+ usesInheritance: true,
2069
+ ngImport: i0
2070
+ });
2071
+ };
2072
+ i0.ɵɵngDeclareClassMetadata({
2073
+ minVersion: "12.0.0",
2074
+ version: "22.3.0",
2075
+ ngImport: i0,
2076
+ type: CommentEditorCommandCodeDirective,
2077
+ decorators: [{
2078
+ type: Directive,
2079
+ args: [{
2080
+ selector: "[ngsCommentEditorCommandCode]",
2081
+ host: {
2082
+ "[attr.disabled]": "commentEditor.api.isCommandDisabled(\"toggleCode\") ? \"\" : null",
2083
+ "[class.active]": "commentEditor.api.isActive(\"toggleCode\")",
2084
+ "(mousedown)": "preserveSelection($event)",
2085
+ "(click)": "run(\"toggleCode\", $event)"
2086
+ }
2087
+ }]
2088
+ }]
2089
+ });
2090
+ var CommentEditorCommandEditLinkDirective = class CommentEditorCommandEditLinkDirective {
2091
+ destroyRef = inject(DestroyRef);
2092
+ dialog = inject(Dialog);
2093
+ commentEditor = inject(COMMENT_EDITOR);
2094
+ preserveSelection(event) {
2095
+ event.preventDefault();
2096
+ }
2097
+ open(event) {
2098
+ event.preventDefault();
2099
+ event.stopPropagation();
2100
+ this.dialog.open(LinkDialog, { data: { linkUrl: this.commentEditor.api.getMarkAttributes("link")?.["href"] ?? "" } }).afterClosed().pipe(takeUntilDestroyed(this.destroyRef)).subscribe((linkUrl) => {
2101
+ if (typeof linkUrl === "string") {
2102
+ this.commentEditor.api.setLink(linkUrl);
2103
+ this.commentEditor.api.focus();
2104
+ }
2105
+ });
2106
+ }
2107
+ static ɵfac = i0.ɵɵngDeclareFactory({
2108
+ minVersion: "12.0.0",
2109
+ version: "22.3.0",
2110
+ ngImport: i0,
2111
+ type: CommentEditorCommandEditLinkDirective,
2112
+ deps: [],
2113
+ target: i0.ɵɵFactoryTarget.Directive
2114
+ });
2115
+ static ɵdir = i0.ɵɵngDeclareDirective({
2116
+ minVersion: "14.0.0",
2117
+ version: "22.3.0",
2118
+ type: CommentEditorCommandEditLinkDirective,
2119
+ isStandalone: true,
2120
+ selector: "[ngsCommentEditorCommandEditLink]",
2121
+ host: {
2122
+ listeners: {
2123
+ "mousedown": "preserveSelection($event)",
2124
+ "click": "open($event)"
2125
+ },
2126
+ properties: { "class.button": "true" }
2127
+ },
2128
+ ngImport: i0
2129
+ });
2130
+ };
2131
+ i0.ɵɵngDeclareClassMetadata({
2132
+ minVersion: "12.0.0",
2133
+ version: "22.3.0",
2134
+ ngImport: i0,
2135
+ type: CommentEditorCommandEditLinkDirective,
2136
+ decorators: [{
2137
+ type: Directive,
2138
+ args: [{
2139
+ selector: "[ngsCommentEditorCommandEditLink]",
2140
+ host: {
2141
+ "[class.button]": "true",
2142
+ "(mousedown)": "preserveSelection($event)",
2143
+ "(click)": "open($event)"
2144
+ }
2145
+ }]
2146
+ }]
2147
+ });
2148
+ var CommentEditorCommandUnsetLinkDirective = class CommentEditorCommandUnsetLinkDirective {
2149
+ commentEditor = inject(COMMENT_EDITOR);
2150
+ preserveSelection(event) {
2151
+ event.preventDefault();
2152
+ }
2153
+ unset(event) {
2154
+ event.preventDefault();
2155
+ event.stopPropagation();
2156
+ this.commentEditor.api.unsetLink();
2157
+ this.commentEditor.api.focus();
2158
+ }
2159
+ static ɵfac = i0.ɵɵngDeclareFactory({
2160
+ minVersion: "12.0.0",
2161
+ version: "22.3.0",
2162
+ ngImport: i0,
2163
+ type: CommentEditorCommandUnsetLinkDirective,
2164
+ deps: [],
2165
+ target: i0.ɵɵFactoryTarget.Directive
2166
+ });
2167
+ static ɵdir = i0.ɵɵngDeclareDirective({
2168
+ minVersion: "14.0.0",
2169
+ version: "22.3.0",
2170
+ type: CommentEditorCommandUnsetLinkDirective,
2171
+ isStandalone: true,
2172
+ selector: "[ngsCommentEditorCommandUnsetLink]",
2173
+ host: {
2174
+ listeners: {
2175
+ "mousedown": "preserveSelection($event)",
2176
+ "click": "unset($event)"
2177
+ },
2178
+ properties: { "class.button": "true" }
2179
+ },
2180
+ ngImport: i0
2181
+ });
2182
+ };
2183
+ i0.ɵɵngDeclareClassMetadata({
2184
+ minVersion: "12.0.0",
2185
+ version: "22.3.0",
2186
+ ngImport: i0,
2187
+ type: CommentEditorCommandUnsetLinkDirective,
2188
+ decorators: [{
2189
+ type: Directive,
2190
+ args: [{
2191
+ selector: "[ngsCommentEditorCommandUnsetLink]",
2192
+ host: {
2193
+ "[class.button]": "true",
2194
+ "(mousedown)": "preserveSelection($event)",
2195
+ "(click)": "unset($event)"
2196
+ }
2197
+ }]
2198
+ }]
2199
+ });
2200
+ var CommentEditorCommandToggleToolbarDirective = class CommentEditorCommandToggleToolbarDirective {
2201
+ commentEditor = inject(COMMENT_EDITOR);
2202
+ preserveSelection(event) {
2203
+ event.preventDefault();
2204
+ }
2205
+ toggle(event) {
2206
+ event.preventDefault();
2207
+ event.stopPropagation();
2208
+ this.commentEditor.api.toggleToolbar();
2209
+ }
2210
+ static ɵfac = i0.ɵɵngDeclareFactory({
2211
+ minVersion: "12.0.0",
2212
+ version: "22.3.0",
2213
+ ngImport: i0,
2214
+ type: CommentEditorCommandToggleToolbarDirective,
2215
+ deps: [],
2216
+ target: i0.ɵɵFactoryTarget.Directive
2217
+ });
2218
+ static ɵdir = i0.ɵɵngDeclareDirective({
2219
+ minVersion: "14.0.0",
2220
+ version: "22.3.0",
2221
+ type: CommentEditorCommandToggleToolbarDirective,
2222
+ isStandalone: true,
2223
+ selector: "[ngsCommentEditorCommandToggleToolbar]",
2224
+ host: {
2225
+ listeners: {
2226
+ "mousedown": "preserveSelection($event)",
2227
+ "click": "toggle($event)"
2228
+ },
2229
+ properties: { "class.active": "commentEditor.api.isToolbarActive()" }
2230
+ },
2231
+ ngImport: i0
2232
+ });
2233
+ };
2234
+ i0.ɵɵngDeclareClassMetadata({
2235
+ minVersion: "12.0.0",
2236
+ version: "22.3.0",
2237
+ ngImport: i0,
2238
+ type: CommentEditorCommandToggleToolbarDirective,
2239
+ decorators: [{
2240
+ type: Directive,
2241
+ args: [{
2242
+ selector: "[ngsCommentEditorCommandToggleToolbar]",
2243
+ host: {
2244
+ "[class.active]": "commentEditor.api.isToolbarActive()",
2245
+ "(mousedown)": "preserveSelection($event)",
2246
+ "(click)": "toggle($event)"
2247
+ }
2248
+ }]
2249
+ }]
2250
+ });
1168
2251
  export { COMMENT_EDITOR, COMMENT_EDITOR_BUBBLE_MENU, CommentEditor, CommentEditorBubbleMenu, CommentEditorCommandBlockquoteDirective, CommentEditorCommandBoldDirective, CommentEditorCommandBulletListDirective, CommentEditorCommandCodeBlockDirective, CommentEditorCommandCodeDirective, CommentEditorCommandDirective, CommentEditorCommandEditLinkDirective, CommentEditorCommandImageDirective, CommentEditorCommandItalicDirective, CommentEditorCommandLinkDirective, CommentEditorCommandOrderedListDirective, CommentEditorCommandStrikeDirective, CommentEditorCommandToggleToolbarDirective, CommentEditorCommandUnsetLinkDirective, CommentEditorCommandYoutubeDirective, CommentEditorDivider, CommentEditorFooterBar, CommentEditorToolbar, NGS_COMMENT_EDITOR_SET_LINK, NGS_COMMENT_EDITOR_TOGGLE_BLOCKQUOTE, NGS_COMMENT_EDITOR_TOGGLE_BULLET_LIST, NGS_COMMENT_EDITOR_TOGGLE_CODE_BLOCK, NGS_COMMENT_EDITOR_TOGGLE_ORDERED_LIST, NGS_COMMENT_EDITOR_UNSET_LINK, commentEditorPlugin, createCommentEditorMediaBlock, normalizeLinkUrl, normalizeYoutubeUrl, serializeCommentEditorDocument };
1169
- //# sourceMappingURL=ngstarter-ui-components-comment-editor.mjs.map
2252
+
2253
+ //# sourceMappingURL=ngstarter-ui-components-comment-editor.mjs.map