@elementar-rt/components 0.6.55

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 (259) hide show
  1. package/README.md +49 -0
  2. package/action-required/index.d.ts +13 -0
  3. package/alert/index.d.ts +51 -0
  4. package/announcement/index.d.ts +45 -0
  5. package/avatar/index.d.ts +67 -0
  6. package/block-loader/index.d.ts +21 -0
  7. package/block-state/index.d.ts +33 -0
  8. package/brand-colors/index.d.ts +27 -0
  9. package/breadcrumbs/index.d.ts +104 -0
  10. package/card-overlay/index.d.ts +20 -0
  11. package/carousel/index.d.ts +75 -0
  12. package/code-highlighter/index.d.ts +18 -0
  13. package/color-picker/index.d.ts +92 -0
  14. package/color-scheme/index.d.ts +44 -0
  15. package/command-bar/index.d.ts +28 -0
  16. package/comment-editor/index.d.ts +194 -0
  17. package/comparison-slider/index.d.ts +51 -0
  18. package/confirm/index.d.ts +35 -0
  19. package/content-fade/index.d.ts +17 -0
  20. package/cookie-popup/index.d.ts +41 -0
  21. package/core/index.d.ts +252 -0
  22. package/country-select/index.d.ts +76 -0
  23. package/crop/index.d.ts +59 -0
  24. package/currency-select/index.d.ts +78 -0
  25. package/dashboard/index.d.ts +48 -0
  26. package/data-view/index.d.ts +127 -0
  27. package/date-format-select/index.d.ts +56 -0
  28. package/divider/index.d.ts +13 -0
  29. package/drawer/index.d.ts +35 -0
  30. package/emoji-picker/index.d.ts +49 -0
  31. package/expand/index.d.ts +26 -0
  32. package/fesm2022/elementar-rt-components-action-required.mjs +30 -0
  33. package/fesm2022/elementar-rt-components-action-required.mjs.map +1 -0
  34. package/fesm2022/elementar-rt-components-alert.mjs +139 -0
  35. package/fesm2022/elementar-rt-components-alert.mjs.map +1 -0
  36. package/fesm2022/elementar-rt-components-announcement.mjs +73 -0
  37. package/fesm2022/elementar-rt-components-announcement.mjs.map +1 -0
  38. package/fesm2022/elementar-rt-components-avatar.mjs +234 -0
  39. package/fesm2022/elementar-rt-components-avatar.mjs.map +1 -0
  40. package/fesm2022/elementar-rt-components-block-loader.mjs +54 -0
  41. package/fesm2022/elementar-rt-components-block-loader.mjs.map +1 -0
  42. package/fesm2022/elementar-rt-components-block-state.mjs +75 -0
  43. package/fesm2022/elementar-rt-components-block-state.mjs.map +1 -0
  44. package/fesm2022/elementar-rt-components-brand-colors.mjs +78 -0
  45. package/fesm2022/elementar-rt-components-brand-colors.mjs.map +1 -0
  46. package/fesm2022/elementar-rt-components-breadcrumbs.mjs +213 -0
  47. package/fesm2022/elementar-rt-components-breadcrumbs.mjs.map +1 -0
  48. package/fesm2022/elementar-rt-components-card-overlay.mjs +55 -0
  49. package/fesm2022/elementar-rt-components-card-overlay.mjs.map +1 -0
  50. package/fesm2022/elementar-rt-components-carousel.mjs +605 -0
  51. package/fesm2022/elementar-rt-components-carousel.mjs.map +1 -0
  52. package/fesm2022/elementar-rt-components-code-highlighter.mjs +57 -0
  53. package/fesm2022/elementar-rt-components-code-highlighter.mjs.map +1 -0
  54. package/fesm2022/elementar-rt-components-color-picker.mjs +708 -0
  55. package/fesm2022/elementar-rt-components-color-picker.mjs.map +1 -0
  56. package/fesm2022/elementar-rt-components-color-scheme.mjs +106 -0
  57. package/fesm2022/elementar-rt-components-color-scheme.mjs.map +1 -0
  58. package/fesm2022/elementar-rt-components-command-bar.mjs +59 -0
  59. package/fesm2022/elementar-rt-components-command-bar.mjs.map +1 -0
  60. package/fesm2022/elementar-rt-components-comment-editor.mjs +1039 -0
  61. package/fesm2022/elementar-rt-components-comment-editor.mjs.map +1 -0
  62. package/fesm2022/elementar-rt-components-comparison-slider.mjs +193 -0
  63. package/fesm2022/elementar-rt-components-comparison-slider.mjs.map +1 -0
  64. package/fesm2022/elementar-rt-components-confirm.mjs +86 -0
  65. package/fesm2022/elementar-rt-components-confirm.mjs.map +1 -0
  66. package/fesm2022/elementar-rt-components-content-fade.mjs +35 -0
  67. package/fesm2022/elementar-rt-components-content-fade.mjs.map +1 -0
  68. package/fesm2022/elementar-rt-components-cookie-popup.mjs +109 -0
  69. package/fesm2022/elementar-rt-components-cookie-popup.mjs.map +1 -0
  70. package/fesm2022/elementar-rt-components-core.mjs +837 -0
  71. package/fesm2022/elementar-rt-components-core.mjs.map +1 -0
  72. package/fesm2022/elementar-rt-components-country-select.mjs +477 -0
  73. package/fesm2022/elementar-rt-components-country-select.mjs.map +1 -0
  74. package/fesm2022/elementar-rt-components-crop.mjs +183 -0
  75. package/fesm2022/elementar-rt-components-crop.mjs.map +1 -0
  76. package/fesm2022/elementar-rt-components-currency-select.mjs +384 -0
  77. package/fesm2022/elementar-rt-components-currency-select.mjs.map +1 -0
  78. package/fesm2022/elementar-rt-components-dashboard.mjs +96 -0
  79. package/fesm2022/elementar-rt-components-dashboard.mjs.map +1 -0
  80. package/fesm2022/elementar-rt-components-data-view.mjs +302 -0
  81. package/fesm2022/elementar-rt-components-data-view.mjs.map +1 -0
  82. package/fesm2022/elementar-rt-components-date-format-select.mjs +136 -0
  83. package/fesm2022/elementar-rt-components-date-format-select.mjs.map +1 -0
  84. package/fesm2022/elementar-rt-components-divider.mjs +31 -0
  85. package/fesm2022/elementar-rt-components-divider.mjs.map +1 -0
  86. package/fesm2022/elementar-rt-components-drawer.mjs +131 -0
  87. package/fesm2022/elementar-rt-components-drawer.mjs.map +1 -0
  88. package/fesm2022/elementar-rt-components-emoji-picker.mjs +249 -0
  89. package/fesm2022/elementar-rt-components-emoji-picker.mjs.map +1 -0
  90. package/fesm2022/elementar-rt-components-expand.mjs +60 -0
  91. package/fesm2022/elementar-rt-components-expand.mjs.map +1 -0
  92. package/fesm2022/elementar-rt-components-filter-builder.mjs +333 -0
  93. package/fesm2022/elementar-rt-components-filter-builder.mjs.map +1 -0
  94. package/fesm2022/elementar-rt-components-form-renderer-autocomplete-many-field.component-AqEghjO_.mjs +123 -0
  95. package/fesm2022/elementar-rt-components-form-renderer-autocomplete-many-field.component-AqEghjO_.mjs.map +1 -0
  96. package/fesm2022/elementar-rt-components-form-renderer-checkbox-field.component-CUKmZGFq.mjs +22 -0
  97. package/fesm2022/elementar-rt-components-form-renderer-checkbox-field.component-CUKmZGFq.mjs.map +1 -0
  98. package/fesm2022/elementar-rt-components-form-renderer-datepicker-field.component-DihIRWMt.mjs +40 -0
  99. package/fesm2022/elementar-rt-components-form-renderer-datepicker-field.component-DihIRWMt.mjs.map +1 -0
  100. package/fesm2022/elementar-rt-components-form-renderer-divider-content.component-CjlGcU3B.mjs +17 -0
  101. package/fesm2022/elementar-rt-components-form-renderer-divider-content.component-CjlGcU3B.mjs.map +1 -0
  102. package/fesm2022/elementar-rt-components-form-renderer-image-content.component-0pL2Fk0H.mjs +17 -0
  103. package/fesm2022/elementar-rt-components-form-renderer-image-content.component-0pL2Fk0H.mjs.map +1 -0
  104. package/fesm2022/elementar-rt-components-form-renderer-input-field.component-X2sKvj6J.mjs +33 -0
  105. package/fesm2022/elementar-rt-components-form-renderer-input-field.component-X2sKvj6J.mjs.map +1 -0
  106. package/fesm2022/elementar-rt-components-form-renderer-radio-group-field.component-DWXZAA3F.mjs +38 -0
  107. package/fesm2022/elementar-rt-components-form-renderer-radio-group-field.component-DWXZAA3F.mjs.map +1 -0
  108. package/fesm2022/elementar-rt-components-form-renderer-select-field.component-Cx9DZoD6.mjs +39 -0
  109. package/fesm2022/elementar-rt-components-form-renderer-select-field.component-Cx9DZoD6.mjs.map +1 -0
  110. package/fesm2022/elementar-rt-components-form-renderer-text-content.component-BmFyUG06.mjs +24 -0
  111. package/fesm2022/elementar-rt-components-form-renderer-text-content.component-BmFyUG06.mjs.map +1 -0
  112. package/fesm2022/elementar-rt-components-form-renderer-textarea-field.component-D9KmE049.mjs +37 -0
  113. package/fesm2022/elementar-rt-components-form-renderer-textarea-field.component-D9KmE049.mjs.map +1 -0
  114. package/fesm2022/elementar-rt-components-form-renderer-timezone-field.component-BroP_Q4P.mjs +35 -0
  115. package/fesm2022/elementar-rt-components-form-renderer-timezone-field.component-BroP_Q4P.mjs.map +1 -0
  116. package/fesm2022/elementar-rt-components-form-renderer-toggle-field.component-nGbtVi1_.mjs +22 -0
  117. package/fesm2022/elementar-rt-components-form-renderer-toggle-field.component-nGbtVi1_.mjs.map +1 -0
  118. package/fesm2022/elementar-rt-components-form-renderer.mjs +321 -0
  119. package/fesm2022/elementar-rt-components-form-renderer.mjs.map +1 -0
  120. package/fesm2022/elementar-rt-components-gauge.mjs +50 -0
  121. package/fesm2022/elementar-rt-components-gauge.mjs.map +1 -0
  122. package/fesm2022/elementar-rt-components-icon.mjs +62 -0
  123. package/fesm2022/elementar-rt-components-icon.mjs.map +1 -0
  124. package/fesm2022/elementar-rt-components-image-resizer.mjs +159 -0
  125. package/fesm2022/elementar-rt-components-image-resizer.mjs.map +1 -0
  126. package/fesm2022/elementar-rt-components-image-viewer.mjs +349 -0
  127. package/fesm2022/elementar-rt-components-image-viewer.mjs.map +1 -0
  128. package/fesm2022/elementar-rt-components-incidents.mjs +259 -0
  129. package/fesm2022/elementar-rt-components-incidents.mjs.map +1 -0
  130. package/fesm2022/elementar-rt-components-inline-text-edit.mjs +181 -0
  131. package/fesm2022/elementar-rt-components-inline-text-edit.mjs.map +1 -0
  132. package/fesm2022/elementar-rt-components-input-mask.mjs +180 -0
  133. package/fesm2022/elementar-rt-components-input-mask.mjs.map +1 -0
  134. package/fesm2022/elementar-rt-components-input-validator.mjs +24 -0
  135. package/fesm2022/elementar-rt-components-input-validator.mjs.map +1 -0
  136. package/fesm2022/elementar-rt-components-kanban-board.mjs +156 -0
  137. package/fesm2022/elementar-rt-components-kanban-board.mjs.map +1 -0
  138. package/fesm2022/elementar-rt-components-layout.mjs +188 -0
  139. package/fesm2022/elementar-rt-components-layout.mjs.map +1 -0
  140. package/fesm2022/elementar-rt-components-logo.mjs +43 -0
  141. package/fesm2022/elementar-rt-components-logo.mjs.map +1 -0
  142. package/fesm2022/elementar-rt-components-marquee.mjs +79 -0
  143. package/fesm2022/elementar-rt-components-marquee.mjs.map +1 -0
  144. package/fesm2022/elementar-rt-components-micro-chart.mjs +950 -0
  145. package/fesm2022/elementar-rt-components-micro-chart.mjs.map +1 -0
  146. package/fesm2022/elementar-rt-components-navigation.mjs +379 -0
  147. package/fesm2022/elementar-rt-components-navigation.mjs.map +1 -0
  148. package/fesm2022/elementar-rt-components-notifications.mjs +190 -0
  149. package/fesm2022/elementar-rt-components-notifications.mjs.map +1 -0
  150. package/fesm2022/elementar-rt-components-number-input.mjs +288 -0
  151. package/fesm2022/elementar-rt-components-number-input.mjs.map +1 -0
  152. package/fesm2022/elementar-rt-components-overlay-scrollbar.mjs +455 -0
  153. package/fesm2022/elementar-rt-components-overlay-scrollbar.mjs.map +1 -0
  154. package/fesm2022/elementar-rt-components-overlay.mjs +112 -0
  155. package/fesm2022/elementar-rt-components-overlay.mjs.map +1 -0
  156. package/fesm2022/elementar-rt-components-page-loading-bar.mjs +79 -0
  157. package/fesm2022/elementar-rt-components-page-loading-bar.mjs.map +1 -0
  158. package/fesm2022/elementar-rt-components-panel.mjs +105 -0
  159. package/fesm2022/elementar-rt-components-panel.mjs.map +1 -0
  160. package/fesm2022/elementar-rt-components-password-strength.mjs +474 -0
  161. package/fesm2022/elementar-rt-components-password-strength.mjs.map +1 -0
  162. package/fesm2022/elementar-rt-components-phone-input.mjs +637 -0
  163. package/fesm2022/elementar-rt-components-phone-input.mjs.map +1 -0
  164. package/fesm2022/elementar-rt-components-pin-input.mjs +197 -0
  165. package/fesm2022/elementar-rt-components-pin-input.mjs.map +1 -0
  166. package/fesm2022/elementar-rt-components-popover.mjs +262 -0
  167. package/fesm2022/elementar-rt-components-popover.mjs.map +1 -0
  168. package/fesm2022/elementar-rt-components-radio-card.mjs +102 -0
  169. package/fesm2022/elementar-rt-components-radio-card.mjs.map +1 -0
  170. package/fesm2022/elementar-rt-components-rail-nav.mjs +84 -0
  171. package/fesm2022/elementar-rt-components-rail-nav.mjs.map +1 -0
  172. package/fesm2022/elementar-rt-components-resizable-container.mjs +69 -0
  173. package/fesm2022/elementar-rt-components-resizable-container.mjs.map +1 -0
  174. package/fesm2022/elementar-rt-components-screen-loader.mjs +27 -0
  175. package/fesm2022/elementar-rt-components-screen-loader.mjs.map +1 -0
  176. package/fesm2022/elementar-rt-components-scroll-spy.mjs +165 -0
  177. package/fesm2022/elementar-rt-components-scroll-spy.mjs.map +1 -0
  178. package/fesm2022/elementar-rt-components-segmented.mjs +153 -0
  179. package/fesm2022/elementar-rt-components-segmented.mjs.map +1 -0
  180. package/fesm2022/elementar-rt-components-side-panel.mjs +110 -0
  181. package/fesm2022/elementar-rt-components-side-panel.mjs.map +1 -0
  182. package/fesm2022/elementar-rt-components-sidebar.mjs +423 -0
  183. package/fesm2022/elementar-rt-components-sidebar.mjs.map +1 -0
  184. package/fesm2022/elementar-rt-components-signature-pad.mjs +452 -0
  185. package/fesm2022/elementar-rt-components-signature-pad.mjs.map +1 -0
  186. package/fesm2022/elementar-rt-components-skeleton.mjs +56 -0
  187. package/fesm2022/elementar-rt-components-skeleton.mjs.map +1 -0
  188. package/fesm2022/elementar-rt-components-splash-screen.mjs +91 -0
  189. package/fesm2022/elementar-rt-components-splash-screen.mjs.map +1 -0
  190. package/fesm2022/elementar-rt-components-stepper.mjs +194 -0
  191. package/fesm2022/elementar-rt-components-stepper.mjs.map +1 -0
  192. package/fesm2022/elementar-rt-components-suggestions.mjs +76 -0
  193. package/fesm2022/elementar-rt-components-suggestions.mjs.map +1 -0
  194. package/fesm2022/elementar-rt-components-tab-panel.mjs +270 -0
  195. package/fesm2022/elementar-rt-components-tab-panel.mjs.map +1 -0
  196. package/fesm2022/elementar-rt-components-text-editor.mjs +1025 -0
  197. package/fesm2022/elementar-rt-components-text-editor.mjs.map +1 -0
  198. package/fesm2022/elementar-rt-components-thumbnail-maker.mjs +214 -0
  199. package/fesm2022/elementar-rt-components-thumbnail-maker.mjs.map +1 -0
  200. package/fesm2022/elementar-rt-components-timeline.mjs +122 -0
  201. package/fesm2022/elementar-rt-components-timeline.mjs.map +1 -0
  202. package/fesm2022/elementar-rt-components-timezone-select.mjs +351 -0
  203. package/fesm2022/elementar-rt-components-timezone-select.mjs.map +1 -0
  204. package/fesm2022/elementar-rt-components-upload.mjs +340 -0
  205. package/fesm2022/elementar-rt-components-upload.mjs.map +1 -0
  206. package/fesm2022/elementar-rt-components.mjs +6 -0
  207. package/fesm2022/elementar-rt-components.mjs.map +1 -0
  208. package/filter-builder/index.d.ts +107 -0
  209. package/form-renderer/index.d.ts +121 -0
  210. package/gauge/index.d.ts +21 -0
  211. package/icon/index.d.ts +17 -0
  212. package/image-resizer/index.d.ts +35 -0
  213. package/image-viewer/index.d.ts +63 -0
  214. package/incidents/index.d.ts +119 -0
  215. package/index.d.ts +2 -0
  216. package/inline-text-edit/index.d.ts +39 -0
  217. package/input-mask/index.d.ts +36 -0
  218. package/input-validator/index.d.ts +5 -0
  219. package/kanban-board/index.d.ts +68 -0
  220. package/layout/index.d.ts +75 -0
  221. package/logo/index.d.ts +21 -0
  222. package/marquee/index.d.ts +26 -0
  223. package/micro-chart/index.d.ts +193 -0
  224. package/navigation/index.d.ts +119 -0
  225. package/notifications/index.d.ts +84 -0
  226. package/number-input/index.d.ts +93 -0
  227. package/overlay/index.d.ts +12 -0
  228. package/overlay-scrollbar/index.d.ts +66 -0
  229. package/package.json +356 -0
  230. package/page-loading-bar/index.d.ts +20 -0
  231. package/panel/index.d.ts +43 -0
  232. package/password-strength/index.d.ts +109 -0
  233. package/phone-input/index.d.ts +94 -0
  234. package/pin-input/index.d.ts +48 -0
  235. package/popover/index.d.ts +75 -0
  236. package/radio-card/index.d.ts +37 -0
  237. package/rail-nav/index.d.ts +36 -0
  238. package/resizable-container/index.d.ts +21 -0
  239. package/screen-loader/index.d.ts +9 -0
  240. package/scroll-spy/index.d.ts +48 -0
  241. package/segmented/index.d.ts +54 -0
  242. package/side-panel/index.d.ts +42 -0
  243. package/sidebar/index.d.ts +143 -0
  244. package/signature-pad/index.d.ts +49 -0
  245. package/skeleton/index.d.ts +24 -0
  246. package/splash-screen/index.d.ts +31 -0
  247. package/stepper/index.d.ts +65 -0
  248. package/styles/_common.scss +776 -0
  249. package/styles/themes/cyan-orange.scss +41 -0
  250. package/styles/themes/default.scss +5 -0
  251. package/styles/themes/magenta-violet.scss +41 -0
  252. package/styles/themes/rose-red.scss +41 -0
  253. package/suggestions/index.d.ts +32 -0
  254. package/tab-panel/index.d.ts +96 -0
  255. package/text-editor/index.d.ts +191 -0
  256. package/thumbnail-maker/index.d.ts +35 -0
  257. package/timeline/index.d.ts +57 -0
  258. package/timezone-select/index.d.ts +72 -0
  259. package/upload/index.d.ts +134 -0
@@ -0,0 +1,1039 @@
1
+ import * as i0 from '@angular/core';
2
+ import { InjectionToken, ApplicationRef, createComponent, ElementRef, Input, Component, inject, PLATFORM_ID, DOCUMENT, ChangeDetectorRef, Injector, viewChild, input, booleanAttribute, output, forwardRef, Directive, DestroyRef } from '@angular/core';
3
+ import { NodeView, Node, mergeAttributes, Editor } from '@tiptap/core';
4
+ import Document from '@tiptap/extension-document';
5
+ import Paragraph from '@tiptap/extension-paragraph';
6
+ import Text from '@tiptap/extension-text';
7
+ import Bold from '@tiptap/extension-bold';
8
+ import Italic from '@tiptap/extension-italic';
9
+ import Strike from '@tiptap/extension-strike';
10
+ import CodeBlock from '@tiptap/extension-code-block';
11
+ import { Blockquote } from '@tiptap/extension-blockquote';
12
+ import BulletList from '@tiptap/extension-bullet-list';
13
+ import OrderedList from '@tiptap/extension-ordered-list';
14
+ import ListItem from '@tiptap/extension-list-item';
15
+ import Link from '@tiptap/extension-link';
16
+ import Placeholder from '@tiptap/extension-placeholder';
17
+ import Youtube from '@tiptap/extension-youtube';
18
+ import BubbleMenu from '@tiptap/extension-bubble-menu';
19
+ import Code from '@tiptap/extension-code';
20
+ import History from '@tiptap/extension-history';
21
+ import Dropcursor from '@tiptap/extension-dropcursor';
22
+ import Image$1 from '@tiptap/extension-image';
23
+ import { MatButton } from '@angular/material/button';
24
+ import { isPlatformServer } from '@angular/common';
25
+ import { MatProgressSpinner } from '@angular/material/progress-spinner';
26
+ import * as i1 from '@elementar-rt/components/upload';
27
+ import { UploadTriggerDirective } from '@elementar-rt/components/upload';
28
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
29
+ import { MatDialogRef, MAT_DIALOG_DATA, MatDialogActions, MatDialogContent, MatDialogTitle, MatDialog } from '@angular/material/dialog';
30
+ import * as i1$1 from '@angular/forms';
31
+ import { FormsModule, ReactiveFormsModule } from '@angular/forms';
32
+ import { MatFormField, MatLabel } from '@angular/material/form-field';
33
+ import { MatInput } from '@angular/material/input';
34
+
35
+ const COMMENT_EDITOR = new InjectionToken('COMMENT_EDITOR');
36
+ const COMMENT_EDITOR_BUBBLE_MENU = new InjectionToken('COMMENT_EDITOR_BUBBLE_MENU');
37
+
38
+ class AngularRenderer {
39
+ applicationRef;
40
+ componentRef;
41
+ constructor(ViewComponent, injector, props) {
42
+ this.applicationRef = injector.get(ApplicationRef);
43
+ this.componentRef = createComponent(ViewComponent, {
44
+ environmentInjector: this.applicationRef.injector,
45
+ elementInjector: injector,
46
+ });
47
+ // set input props to the component
48
+ this.updateProps(props);
49
+ this.applicationRef.attachView(this.componentRef.hostView);
50
+ }
51
+ get instance() {
52
+ return this.componentRef.instance;
53
+ }
54
+ get elementRef() {
55
+ return this.componentRef.injector.get(ElementRef);
56
+ }
57
+ get dom() {
58
+ return this.elementRef.nativeElement;
59
+ }
60
+ updateProps(props) {
61
+ Object.entries(props).forEach(([key, value]) => {
62
+ this.componentRef.setInput(key, value);
63
+ });
64
+ }
65
+ detectChanges() {
66
+ this.componentRef.changeDetectorRef.detectChanges();
67
+ }
68
+ destroy() {
69
+ this.componentRef.destroy();
70
+ this.applicationRef.detachView(this.componentRef.hostView);
71
+ }
72
+ }
73
+
74
+ class AngularNodeView extends NodeView {
75
+ renderer;
76
+ contentDOMElement;
77
+ mount() {
78
+ const injector = this.options.injector;
79
+ const props = {
80
+ editor: this.editor,
81
+ node: this.node,
82
+ // @ts-ignore
83
+ decorations: this.decorations,
84
+ selected: false,
85
+ extension: this.extension,
86
+ getPos: () => this.getPos(),
87
+ updateAttributes: (attributes = {}) => this.updateAttributes(attributes),
88
+ deleteNode: () => this.deleteNode(),
89
+ };
90
+ this.handleSelectionUpdate = this.handleSelectionUpdate.bind(this);
91
+ this.editor.on('selectionUpdate', this.handleSelectionUpdate);
92
+ // create renderer
93
+ this.renderer = new AngularRenderer(this.component, injector, props);
94
+ // Register drag handler
95
+ if (this.extension.config.draggable) {
96
+ this.renderer.elementRef.nativeElement.ondragstart = (e) => {
97
+ this.onDragStart(e);
98
+ };
99
+ }
100
+ this.contentDOMElement = this.node.isLeaf ? null : document.createElement(this.node.isInline ? 'span' : 'div');
101
+ if (this.contentDOMElement) {
102
+ // For some reason the whiteSpace prop is not inherited properly in Chrome and Safari
103
+ // With this fix it seems to work fine
104
+ // See: https://github.com/ueberdosis/tiptap/issues/1197
105
+ this.contentDOMElement.style.whiteSpace = 'inherit';
106
+ // Required for editable node views
107
+ // The content won't be rendered if `editable` is set to `false`
108
+ this.renderer.detectChanges();
109
+ }
110
+ this.appendContendDom();
111
+ }
112
+ get dom() {
113
+ return this.renderer.dom;
114
+ }
115
+ get contentDOM() {
116
+ if (this.node.isLeaf) {
117
+ return null;
118
+ }
119
+ return this.contentDOMElement;
120
+ }
121
+ appendContendDom() {
122
+ const contentElement = this.dom.querySelector('[data-node-view-content]');
123
+ if (this.contentDOMElement
124
+ && contentElement
125
+ && !contentElement.contains(this.contentDOMElement)) {
126
+ contentElement.appendChild(this.contentDOMElement);
127
+ }
128
+ }
129
+ handleSelectionUpdate() {
130
+ const { from, to } = this.editor.state.selection;
131
+ if (from <= this.getPos() && to >= this.getPos() + this.node.nodeSize) {
132
+ this.selectNode();
133
+ }
134
+ else {
135
+ this.deselectNode();
136
+ }
137
+ }
138
+ update(node, decorations) {
139
+ const updateProps = () => {
140
+ this.renderer.updateProps({ node, decorations });
141
+ };
142
+ if (this.options.update) {
143
+ const oldNode = this.node;
144
+ const oldDecorations = this.decorations;
145
+ this.node = node;
146
+ this.decorations = decorations;
147
+ return this.options.update({
148
+ oldNode,
149
+ // @ts-ignore
150
+ oldDecorations,
151
+ newNode: node,
152
+ newDecorations: decorations,
153
+ updateProps: () => updateProps(),
154
+ });
155
+ }
156
+ if (node.type !== this.node.type) {
157
+ return false;
158
+ }
159
+ if (node === this.node && this.decorations === decorations) {
160
+ return true;
161
+ }
162
+ this.node = node;
163
+ this.decorations = decorations;
164
+ updateProps();
165
+ return true;
166
+ }
167
+ selectNode() {
168
+ this.renderer.updateProps({ selected: true });
169
+ }
170
+ deselectNode() {
171
+ this.renderer.updateProps({ selected: false });
172
+ }
173
+ destroy() {
174
+ this.renderer.destroy();
175
+ this.editor.off('selectionUpdate', this.handleSelectionUpdate);
176
+ this.contentDOMElement = null;
177
+ }
178
+ }
179
+ const AngularNodeViewRenderer = (ViewComponent, options) => {
180
+ // @ts-ignore
181
+ return (props) => {
182
+ return new AngularNodeView(ViewComponent, props, options);
183
+ };
184
+ };
185
+
186
+ class AngularNodeViewComponent {
187
+ editor;
188
+ node;
189
+ decorations;
190
+ selected;
191
+ extension;
192
+ getPos;
193
+ updateAttributes;
194
+ deleteNode;
195
+ HTMLAttributes;
196
+ innerDecorations;
197
+ view;
198
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AngularNodeViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
199
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.10", type: AngularNodeViewComponent, isStandalone: true, selector: "ng-component", inputs: { editor: "editor", node: "node", decorations: "decorations", selected: "selected", extension: "extension", getPos: "getPos", updateAttributes: "updateAttributes", deleteNode: "deleteNode", HTMLAttributes: "HTMLAttributes", innerDecorations: "innerDecorations", view: "view" }, ngImport: i0, template: '', isInline: true });
200
+ }
201
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: AngularNodeViewComponent, decorators: [{
202
+ type: Component,
203
+ args: [{ standalone: true, template: '' }]
204
+ }], propDecorators: { editor: [{
205
+ type: Input
206
+ }], node: [{
207
+ type: Input
208
+ }], decorations: [{
209
+ type: Input
210
+ }], selected: [{
211
+ type: Input
212
+ }], extension: [{
213
+ type: Input
214
+ }], getPos: [{
215
+ type: Input
216
+ }], updateAttributes: [{
217
+ type: Input
218
+ }], deleteNode: [{
219
+ type: Input
220
+ }], HTMLAttributes: [{
221
+ type: Input
222
+ }], innerDecorations: [{
223
+ type: Input
224
+ }], view: [{
225
+ type: Input
226
+ }] } });
227
+
228
+ class ImageUploadingPlaceholderComponent extends AngularNodeViewComponent {
229
+ src;
230
+ error;
231
+ _canceled = false;
232
+ ngOnInit() {
233
+ const uploadFn = this.extension.options['uploadFn'];
234
+ this.src = this.node.attrs['src'];
235
+ const blob = this._dataURItoBlob(this.src);
236
+ uploadFn(blob).then((src) => {
237
+ if (this._canceled) {
238
+ return;
239
+ }
240
+ const image = new Image();
241
+ image.src = src;
242
+ image.onload = () => {
243
+ this.editor.chain().focus().setImage({ src }).run();
244
+ };
245
+ }, (error) => {
246
+ this.error = error;
247
+ });
248
+ }
249
+ ngOnDestroy() {
250
+ this._canceled = true;
251
+ }
252
+ _dataURItoBlob(dataURI) {
253
+ // convert base64 to raw binary data held in a string
254
+ // doesn't handle URLEncoded DataURIs - see SO answer #6850276 for code that does this
255
+ const byteString = atob(dataURI.split(',')[1]);
256
+ // separate out the mime component
257
+ const mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0];
258
+ // write the bytes of the string to an ArrayBuffer
259
+ const ab = new ArrayBuffer(byteString.length);
260
+ const ia = new Uint8Array(ab);
261
+ for (var i = 0; i < byteString.length; i++) {
262
+ ia[i] = byteString.charCodeAt(i);
263
+ }
264
+ return new Blob([ab], { type: mimeString });
265
+ }
266
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: ImageUploadingPlaceholderComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
267
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.10", type: ImageUploadingPlaceholderComponent, isStandalone: true, selector: "emr-image-uploading-placeholder", host: { properties: { "class.selected": "selected" }, classAttribute: "emr-image-uploading-placeholder" }, usesInheritance: true, ngImport: i0, template: "@if (src) {\r\n <div class=\"flex items-center justify-center relative\">\r\n @if (error) {\r\n <div class=\"absolute top-0 start-0 right-0 min-h-8 bg-error z-[2]\r\n text-on-error text-tiny flex items-center px-3\">{{ error }}</div>\r\n }\r\n <div class=\"w-max absolute start-1/2 top-1/2 z-[1] -translate-y-1/2 -translate-x-1/2\">\r\n @if (!error) {\r\n <mat-spinner></mat-spinner>\r\n }\r\n </div>\r\n <img [src]=\"src\" alt=\"\" class=\"max-w-full opacity-70\">\r\n </div>\r\n}\r\n", styles: [":host{display:block}:host.selected{outline:var(--sys-tertiary) solid 4px}\n/*! tailwindcss v4.1.14 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "component", type: MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }] });
268
+ }
269
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: ImageUploadingPlaceholderComponent, decorators: [{
270
+ type: Component,
271
+ args: [{ selector: 'emr-image-uploading-placeholder', imports: [
272
+ MatProgressSpinner
273
+ ], host: {
274
+ 'class': 'emr-image-uploading-placeholder',
275
+ '[class.selected]': 'selected'
276
+ }, template: "@if (src) {\r\n <div class=\"flex items-center justify-center relative\">\r\n @if (error) {\r\n <div class=\"absolute top-0 start-0 right-0 min-h-8 bg-error z-[2]\r\n text-on-error text-tiny flex items-center px-3\">{{ error }}</div>\r\n }\r\n <div class=\"w-max absolute start-1/2 top-1/2 z-[1] -translate-y-1/2 -translate-x-1/2\">\r\n @if (!error) {\r\n <mat-spinner></mat-spinner>\r\n }\r\n </div>\r\n <img [src]=\"src\" alt=\"\" class=\"max-w-full opacity-70\">\r\n </div>\r\n}\r\n", styles: [":host{display:block}:host.selected{outline:var(--sys-tertiary) solid 4px}\n/*! tailwindcss v4.1.14 | MIT License | https://tailwindcss.com */\n"] }]
277
+ }] });
278
+
279
+ const ImageUploadingPlaceholderExtension = (injector, options) => {
280
+ return Node.create({
281
+ name: 'imageUploadingPlaceholder',
282
+ draggable: false,
283
+ group: 'block',
284
+ addOptions() {
285
+ return {
286
+ uploadFn: options.uploadFn
287
+ };
288
+ },
289
+ addAttributes() {
290
+ return {
291
+ uploadId: {
292
+ default: ''
293
+ },
294
+ src: {
295
+ default: null
296
+ }
297
+ };
298
+ },
299
+ addCommands() {
300
+ return {
301
+ addImageUploadingPlaceholder: options => ({ commands }) => {
302
+ return commands.insertContent({
303
+ type: this.name,
304
+ attrs: {
305
+ src: options.src
306
+ }
307
+ });
308
+ },
309
+ };
310
+ },
311
+ addNodeView() {
312
+ return AngularNodeViewRenderer(ImageUploadingPlaceholderComponent, { injector });
313
+ },
314
+ parseHTML() {
315
+ return [
316
+ {
317
+ tag: 'image-uploading-placeholder',
318
+ }
319
+ ];
320
+ },
321
+ renderHTML({ HTMLAttributes }) {
322
+ return [
323
+ 'image-uploading-placeholder', mergeAttributes(HTMLAttributes),
324
+ ];
325
+ }
326
+ });
327
+ };
328
+
329
+ class CommentEditorComponent {
330
+ _platformId = inject(PLATFORM_ID);
331
+ _document = inject(DOCUMENT);
332
+ _cdr = inject(ChangeDetectorRef);
333
+ _injector = inject(Injector);
334
+ _content = viewChild.required('content');
335
+ _bubbleMenu = viewChild.required('bubbleMenu');
336
+ _imageBubbleMenu = viewChild.required('imageBubbleMenu');
337
+ _value = '';
338
+ editor;
339
+ showToolbar = false;
340
+ fullView = false;
341
+ contentMaxHeight = input(...(ngDevMode ? [undefined, { debugName: "contentMaxHeight" }] : []));
342
+ buttonCancelLabel = input('Cancel', ...(ngDevMode ? [{ debugName: "buttonCancelLabel" }] : []));
343
+ buttonSendLabel = input('Send', ...(ngDevMode ? [{ debugName: "buttonSendLabel" }] : []));
344
+ placeholder = input('Write something …', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
345
+ toolbarAlwaysVisible = input(false, ...(ngDevMode ? [{ debugName: "toolbarAlwaysVisible", transform: booleanAttribute }] : [{
346
+ transform: booleanAttribute
347
+ }]));
348
+ fullViewMode = input(false, ...(ngDevMode ? [{ debugName: "fullViewMode", transform: booleanAttribute }] : [{
349
+ transform: booleanAttribute
350
+ }]));
351
+ cancelButtonAlwaysVisible = input(false, ...(ngDevMode ? [{ debugName: "cancelButtonAlwaysVisible", transform: booleanAttribute }] : [{
352
+ transform: booleanAttribute
353
+ }]));
354
+ imageUploadFn = input(...(ngDevMode ? [undefined, { debugName: "imageUploadFn" }] : []));
355
+ sent = output();
356
+ canceled = output();
357
+ ngOnInit() {
358
+ this._init();
359
+ }
360
+ get api() {
361
+ return {
362
+ isCommandDisabled: (command) => this.isCommandDisabled(command),
363
+ isActive: (command) => this.editor?.isActive(command),
364
+ runCommand: (command) => this._runCommand(command),
365
+ editor: () => this.editor,
366
+ isToolbarActive: () => this.showToolbar,
367
+ toggleToolbar: () => this.toggleToolbar(),
368
+ isEditorActivated: () => this.fullView || this.fullViewMode()
369
+ };
370
+ }
371
+ isCommandDisabled(command) {
372
+ if (!this.editor) {
373
+ return true;
374
+ }
375
+ const canFocus = this.editor.can().chain().focus();
376
+ return !canFocus[command]().run() || null;
377
+ }
378
+ ngOnDestroy() {
379
+ this.editor?.destroy();
380
+ }
381
+ send(event) {
382
+ event.stopPropagation();
383
+ event.preventDefault();
384
+ this.sent.emit(this._value);
385
+ this.showToolbar = false;
386
+ this.fullView = false;
387
+ this._value = '';
388
+ this.editor.commands.clearContent(true);
389
+ }
390
+ activateFullView() {
391
+ if (this.fullView) {
392
+ return;
393
+ }
394
+ this.fullView = true;
395
+ }
396
+ toggleToolbar() {
397
+ this.showToolbar = !this.showToolbar;
398
+ }
399
+ cancel(event) {
400
+ event.stopPropagation();
401
+ event.preventDefault();
402
+ this.showToolbar = false;
403
+ this.fullView = false;
404
+ this._value = '';
405
+ this.editor.commands.clearContent(true);
406
+ this.canceled.emit();
407
+ }
408
+ _runCommand(command) {
409
+ if (!this.editor) {
410
+ return;
411
+ }
412
+ const chainFocus = this.editor.chain().focus();
413
+ chainFocus[command]().run();
414
+ }
415
+ _init() {
416
+ if (isPlatformServer(this._platformId)) {
417
+ return;
418
+ }
419
+ this.editor = new Editor({
420
+ element: this._content().nativeElement,
421
+ extensions: [
422
+ Document,
423
+ Paragraph,
424
+ Text,
425
+ Bold,
426
+ Italic,
427
+ Strike,
428
+ Blockquote,
429
+ CodeBlock,
430
+ BulletList,
431
+ OrderedList,
432
+ ListItem,
433
+ Code,
434
+ History,
435
+ Dropcursor,
436
+ Youtube.configure({
437
+ controls: false,
438
+ nocookie: true,
439
+ }),
440
+ ImageUploadingPlaceholderExtension(this._injector, {
441
+ uploadFn: this.imageUploadFn(),
442
+ }),
443
+ Image$1.configure({
444
+ inline: true,
445
+ allowBase64: true
446
+ }),
447
+ Link.configure({
448
+ openOnClick: false,
449
+ defaultProtocol: 'https',
450
+ }),
451
+ Placeholder.configure({
452
+ placeholder: this.placeholder()
453
+ }),
454
+ // FloatingMenu.configure({
455
+ // element: this._floatingMenu().nativeElement
456
+ // }),
457
+ BubbleMenu.configure({
458
+ element: this._imageBubbleMenu().nativeElement,
459
+ shouldShow: ({ editor, view, state, oldState, from, to }) => {
460
+ // return editor.isActive('image');
461
+ return false;
462
+ },
463
+ }),
464
+ BubbleMenu.configure({
465
+ element: this._bubbleMenu().nativeElement,
466
+ tippyOptions: {
467
+ appendTo: this._document.body,
468
+ zIndex: 999
469
+ },
470
+ shouldShow: ({ editor, view, state, oldState, from, to }) => {
471
+ return !editor.isActive('image') &&
472
+ !editor.isActive('youtube') &&
473
+ !editor.isActive('imageUploadingPlaceholder') &&
474
+ !editor.view.state.selection.empty;
475
+ },
476
+ })
477
+ ],
478
+ content: '',
479
+ onUpdate: ({ editor }) => {
480
+ this._value = !editor.isEmpty ? editor.getHTML() : '';
481
+ }
482
+ });
483
+ this._cdr.detectChanges();
484
+ }
485
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: CommentEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
486
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.10", type: CommentEditorComponent, isStandalone: true, selector: "emr-comment-editor", inputs: { 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 }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", 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 }, imageUploadFn: { classPropertyName: "imageUploadFn", publicName: "imageUploadFn", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sent: "sent", canceled: "canceled" }, host: { listeners: { "click": "activateFullView()" }, properties: { "class.full-view": "fullView || fullViewMode()" }, classAttribute: "emr-comment-editor" }, providers: [
487
+ {
488
+ provide: COMMENT_EDITOR,
489
+ useExisting: forwardRef(() => CommentEditorComponent)
490
+ }
491
+ ], viewQueries: [{ propertyName: "_content", first: true, predicate: ["content"], descendants: true, isSignal: true }, { propertyName: "_bubbleMenu", first: true, predicate: ["bubbleMenu"], descendants: true, isSignal: true }, { propertyName: "_imageBubbleMenu", first: true, predicate: ["imageBubbleMenu"], descendants: true, isSignal: true }], exportAs: ["emrCommentEditor"], ngImport: i0, template: "@if ((showToolbar || toolbarAlwaysVisible()) && (fullView || fullViewMode())) {\r\n <div class=\"toolbar\">\r\n <ng-content select=\"emr-comment-editor-toolbar\" />\r\n </div>\r\n}\r\n<div #content class=\"content prose dark:prose-invert max-w-full\"></div>\r\n<div class=\"footer\">\r\n <div class=\"flex items-center gap-0.5\">\r\n <ng-content select=\"emr-comment-editor-footer-bar\"/>\r\n </div>\r\n <div class=\"flex items-center gap-2\">\r\n @if ((fullView && !fullViewMode()) || cancelButtonAlwaysVisible()) {\r\n <button mat-button (click)=\"cancel($event)\">{{ buttonCancelLabel() }}</button>\r\n }\r\n\r\n <button mat-flat-button [disabled]=\"!_value || null\" (click)=\"send($event)\">{{ buttonSendLabel() }}</button>\r\n </div>\r\n</div>\r\n<div #imageBubbleMenu class=\"emr-comment-editor-bubble-menu\">\r\n</div>\r\n<div #bubbleMenu>\r\n <ng-content select=\"emr-comment-editor-bubble-menu\"/>\r\n</div>\r\n<!--<div #floatingMenu class=\"floating-menu\">-->\r\n<!-- @if (editor) {-->\r\n<!-- <div class=\"flex items-center gap-1.5\">-->\r\n<!-- <button class=\"button\"-->\r\n<!-- [disabled]=\"isCommandDisabled('toggleCodeBlock')\"-->\r\n<!-- [class.active]=\"editor && editor.isActive('codeBlock')\"-->\r\n<!-- (click)=\"onButtonClick('toggleCodeBlock')\">-->\r\n<!-- <mat-icon>code</mat-icon>-->\r\n<!-- </button>-->\r\n<!-- <button class=\"button\">-->\r\n<!-- <mat-icon>image</mat-icon>-->\r\n<!-- </button>-->\r\n<!-- </div>-->\r\n<!-- }-->\r\n<!--</div>-->\r\n", styles: [":host{--emr-comment-editor-bg: transparent;--emr-comment-editor-content-max-height: 9999px;display:block;position:relative;overflow:hidden;background:var(--emr-comment-editor-bg)}:host .floating-menu{box-shadow:0 1px 3px #0000001a,0 1px 2px -1px #0000001a;background:#fff;padding-top:calc(var(--spacing) * 1.5);padding-bottom:calc(var(--spacing) * 1.5);padding-inline-start:calc(var(--spacing) * 2);padding-inline-end:calc(var(--spacing) * 2);border:1px solid var(--color-border);border-radius:calc(infinity * 1px)}:host .floating-menu .button:hover{color:var(--color-primary);border-radius:calc(infinity * 1px)}:host .floating-menu .button mat-icon{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);font-size:1.25rem;line-height:1.25}:host .floating-menu .button:disabled{pointer-events:none;opacity:70%}:host .content{position:absolute;inset:0;height:calc(var(--spacing) * 14)}:host .content ::ng-deep .tiptap{padding:calc(var(--spacing) * 4);min-height:calc(var(--spacing) * 10)}:host .content ::ng-deep .tiptap:focus{outline:none}:host .content ::ng-deep .tiptap div[data-youtube-video]{cursor:move;background:var(--color-neutral-100);padding:calc(var(--spacing) * 6);display:flex;align-items:center;justify-content:center}:host .content ::ng-deep .tiptap div[data-youtube-video] iframe{width:100%;aspect-ratio:16/9;border:none;display:block;min-height:200px;min-width:200px;outline:none}:host .content ::ng-deep .tiptap div[data-youtube-video].ProseMirror-selectednode iframe{outline:var(--sys-tertiary) solid 4px;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}:host .content ::ng-deep .tiptap img{display:block;height:auto;margin:calc(var(--spacing) * 6) 0;max-width:100%}:host .content ::ng-deep .tiptap img.ProseMirror-selectednode{outline:var(--sys-tertiary) solid 4px;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}:host .content ::ng-deep .tiptap p.is-editor-empty:first-child:before{content:attr(data-placeholder);color:var(--color-neutral-500);float:left;height:0;pointer-events:none;font-size:14px}:host .content ::ng-deep .tiptap.ProseMirror-focused p.is-editor-empty:first-child:before{content:none}:host .content ::ng-deep .tiptap p.is-empty:before{content:attr(data-placeholder);color:var(--color-neutral-500);float:left;height:0;pointer-events:none;font-size:14px}:host .content ::ng-deep p:first-child,:host .content ::ng-deep pre:first-child{margin-top:0}:host .content ::ng-deep p:last-child,:host .content ::ng-deep pre:last-child{margin-bottom:0}:host.full-view .content{position:static;height:auto;min-height:calc(var(--spacing) * 12);max-height:var(--emr-comment-editor-content-max-height);overflow-y:auto}:host .footer{height:calc(var(--spacing) * 14);padding:0 calc(var(--spacing) * 2.5);display:flex;align-items:center;justify-content:space-between}:host .toolbar{border-bottom:1px solid var(--color-border);height:calc(var(--spacing) * 14);padding:0 calc(var(--spacing) * 3);display:flex;align-items:center;justify-content:space-between}:host .button.active,:host ::ng-deep .button.active{background:var(--color-neutral-200)}:host-context(html.dark) .button.active,:host-context(html.dark) ::ng-deep .button.active{background:var(--color-neutral-650);color:var(--color-neutral-200)}\n/*! tailwindcss v4.1.14 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "component", type: MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }] });
492
+ }
493
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: CommentEditorComponent, decorators: [{
494
+ type: Component,
495
+ args: [{ selector: 'emr-comment-editor', exportAs: 'emrCommentEditor', imports: [
496
+ MatButton
497
+ ], providers: [
498
+ {
499
+ provide: COMMENT_EDITOR,
500
+ useExisting: forwardRef(() => CommentEditorComponent)
501
+ }
502
+ ], host: {
503
+ 'class': 'emr-comment-editor',
504
+ '[class.full-view]': 'fullView || fullViewMode()',
505
+ '(click)': 'activateFullView()'
506
+ }, template: "@if ((showToolbar || toolbarAlwaysVisible()) && (fullView || fullViewMode())) {\r\n <div class=\"toolbar\">\r\n <ng-content select=\"emr-comment-editor-toolbar\" />\r\n </div>\r\n}\r\n<div #content class=\"content prose dark:prose-invert max-w-full\"></div>\r\n<div class=\"footer\">\r\n <div class=\"flex items-center gap-0.5\">\r\n <ng-content select=\"emr-comment-editor-footer-bar\"/>\r\n </div>\r\n <div class=\"flex items-center gap-2\">\r\n @if ((fullView && !fullViewMode()) || cancelButtonAlwaysVisible()) {\r\n <button mat-button (click)=\"cancel($event)\">{{ buttonCancelLabel() }}</button>\r\n }\r\n\r\n <button mat-flat-button [disabled]=\"!_value || null\" (click)=\"send($event)\">{{ buttonSendLabel() }}</button>\r\n </div>\r\n</div>\r\n<div #imageBubbleMenu class=\"emr-comment-editor-bubble-menu\">\r\n</div>\r\n<div #bubbleMenu>\r\n <ng-content select=\"emr-comment-editor-bubble-menu\"/>\r\n</div>\r\n<!--<div #floatingMenu class=\"floating-menu\">-->\r\n<!-- @if (editor) {-->\r\n<!-- <div class=\"flex items-center gap-1.5\">-->\r\n<!-- <button class=\"button\"-->\r\n<!-- [disabled]=\"isCommandDisabled('toggleCodeBlock')\"-->\r\n<!-- [class.active]=\"editor && editor.isActive('codeBlock')\"-->\r\n<!-- (click)=\"onButtonClick('toggleCodeBlock')\">-->\r\n<!-- <mat-icon>code</mat-icon>-->\r\n<!-- </button>-->\r\n<!-- <button class=\"button\">-->\r\n<!-- <mat-icon>image</mat-icon>-->\r\n<!-- </button>-->\r\n<!-- </div>-->\r\n<!-- }-->\r\n<!--</div>-->\r\n", styles: [":host{--emr-comment-editor-bg: transparent;--emr-comment-editor-content-max-height: 9999px;display:block;position:relative;overflow:hidden;background:var(--emr-comment-editor-bg)}:host .floating-menu{box-shadow:0 1px 3px #0000001a,0 1px 2px -1px #0000001a;background:#fff;padding-top:calc(var(--spacing) * 1.5);padding-bottom:calc(var(--spacing) * 1.5);padding-inline-start:calc(var(--spacing) * 2);padding-inline-end:calc(var(--spacing) * 2);border:1px solid var(--color-border);border-radius:calc(infinity * 1px)}:host .floating-menu .button:hover{color:var(--color-primary);border-radius:calc(infinity * 1px)}:host .floating-menu .button mat-icon{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);font-size:1.25rem;line-height:1.25}:host .floating-menu .button:disabled{pointer-events:none;opacity:70%}:host .content{position:absolute;inset:0;height:calc(var(--spacing) * 14)}:host .content ::ng-deep .tiptap{padding:calc(var(--spacing) * 4);min-height:calc(var(--spacing) * 10)}:host .content ::ng-deep .tiptap:focus{outline:none}:host .content ::ng-deep .tiptap div[data-youtube-video]{cursor:move;background:var(--color-neutral-100);padding:calc(var(--spacing) * 6);display:flex;align-items:center;justify-content:center}:host .content ::ng-deep .tiptap div[data-youtube-video] iframe{width:100%;aspect-ratio:16/9;border:none;display:block;min-height:200px;min-width:200px;outline:none}:host .content ::ng-deep .tiptap div[data-youtube-video].ProseMirror-selectednode iframe{outline:var(--sys-tertiary) solid 4px;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}:host .content ::ng-deep .tiptap img{display:block;height:auto;margin:calc(var(--spacing) * 6) 0;max-width:100%}:host .content ::ng-deep .tiptap img.ProseMirror-selectednode{outline:var(--sys-tertiary) solid 4px;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}:host .content ::ng-deep .tiptap p.is-editor-empty:first-child:before{content:attr(data-placeholder);color:var(--color-neutral-500);float:left;height:0;pointer-events:none;font-size:14px}:host .content ::ng-deep .tiptap.ProseMirror-focused p.is-editor-empty:first-child:before{content:none}:host .content ::ng-deep .tiptap p.is-empty:before{content:attr(data-placeholder);color:var(--color-neutral-500);float:left;height:0;pointer-events:none;font-size:14px}:host .content ::ng-deep p:first-child,:host .content ::ng-deep pre:first-child{margin-top:0}:host .content ::ng-deep p:last-child,:host .content ::ng-deep pre:last-child{margin-bottom:0}:host.full-view .content{position:static;height:auto;min-height:calc(var(--spacing) * 12);max-height:var(--emr-comment-editor-content-max-height);overflow-y:auto}:host .footer{height:calc(var(--spacing) * 14);padding:0 calc(var(--spacing) * 2.5);display:flex;align-items:center;justify-content:space-between}:host .toolbar{border-bottom:1px solid var(--color-border);height:calc(var(--spacing) * 14);padding:0 calc(var(--spacing) * 3);display:flex;align-items:center;justify-content:space-between}:host .button.active,:host ::ng-deep .button.active{background:var(--color-neutral-200)}:host-context(html.dark) .button.active,:host-context(html.dark) ::ng-deep .button.active{background:var(--color-neutral-650);color:var(--color-neutral-200)}\n/*! tailwindcss v4.1.14 | MIT License | https://tailwindcss.com */\n"] }]
507
+ }], propDecorators: { _content: [{ type: i0.ViewChild, args: ['content', { isSignal: true }] }], _bubbleMenu: [{ type: i0.ViewChild, args: ['bubbleMenu', { isSignal: true }] }], _imageBubbleMenu: [{ type: i0.ViewChild, args: ['imageBubbleMenu', { isSignal: true }] }], 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 }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", 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 }] }], imageUploadFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "imageUploadFn", required: false }] }], sent: [{ type: i0.Output, args: ["sent"] }], canceled: [{ type: i0.Output, args: ["canceled"] }] } });
508
+
509
+ class CommentEditorDividerComponent {
510
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: CommentEditorDividerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
511
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.10", type: CommentEditorDividerComponent, isStandalone: true, selector: "emr-comment-editor-divider", ngImport: i0, template: "<div class=\"divider\"></div>\r\n", styles: [":host{display:block;padding:0 calc(var(--spacing) * 2)}:host .divider{height:calc(var(--spacing) * 6);background:var(--color-neutral-300);width:1px}:host-context(html.dark) .divider{background:var(--color-neutral-500)}\n/*! tailwindcss v4.1.14 | MIT License | https://tailwindcss.com */\n"] });
512
+ }
513
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: CommentEditorDividerComponent, decorators: [{
514
+ type: Component,
515
+ args: [{ selector: 'emr-comment-editor-divider', imports: [], template: "<div class=\"divider\"></div>\r\n", styles: [":host{display:block;padding:0 calc(var(--spacing) * 2)}:host .divider{height:calc(var(--spacing) * 6);background:var(--color-neutral-300);width:1px}:host-context(html.dark) .divider{background:var(--color-neutral-500)}\n/*! tailwindcss v4.1.14 | MIT License | https://tailwindcss.com */\n"] }]
516
+ }] });
517
+
518
+ class CommentEditorToolbarComponent {
519
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: CommentEditorToolbarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
520
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.10", type: CommentEditorToolbarComponent, isStandalone: true, selector: "emr-comment-editor-toolbar", host: { classAttribute: "emr-comment-editor-toolbar" }, exportAs: ["emrCommentEditorToolbar"], ngImport: i0, template: "<ng-content select=\"[emrCommentEditorCommand],emr-comment-editor-divider\"></ng-content>\r\n", styles: [":host{display:flex;align-items:center;gap:calc(var(--spacing) * .5)}\n/*! tailwindcss v4.1.14 | MIT License | https://tailwindcss.com */\n"] });
521
+ }
522
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: CommentEditorToolbarComponent, decorators: [{
523
+ type: Component,
524
+ args: [{ selector: 'emr-comment-editor-toolbar', exportAs: 'emrCommentEditorToolbar', host: {
525
+ 'class': 'emr-comment-editor-toolbar',
526
+ }, template: "<ng-content select=\"[emrCommentEditorCommand],emr-comment-editor-divider\"></ng-content>\r\n", styles: [":host{display:flex;align-items:center;gap:calc(var(--spacing) * .5)}\n/*! tailwindcss v4.1.14 | MIT License | https://tailwindcss.com */\n"] }]
527
+ }] });
528
+
529
+ class CommentEditorBubbleMenuComponent {
530
+ commentEditor = inject(COMMENT_EDITOR);
531
+ getLinkUrl() {
532
+ return (this.commentEditor.api.editor()?.getAttributes('link')).href || null;
533
+ }
534
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: CommentEditorBubbleMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
535
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.10", type: CommentEditorBubbleMenuComponent, isStandalone: true, selector: "emr-comment-editor-bubble-menu", host: { classAttribute: "emr-comment-editor-bubble-menu" }, providers: [
536
+ {
537
+ provide: COMMENT_EDITOR_BUBBLE_MENU,
538
+ useExisting: forwardRef(() => CommentEditorBubbleMenuComponent)
539
+ }
540
+ ], exportAs: ["emrCommentEditorBubbleMenu"], ngImport: i0, template: "@if (this.commentEditor.api.isActive('link') && getLinkUrl()) {\r\n <div class=\"flex items-center gap-1 h-11 border-b border-b-default border-b-neutral-700\">\r\n <div class=\"grow text-sm overflow-hidden text-ellipsis whitespace-nowrap w-[116px]\">\r\n <a [href]=\"getLinkUrl()\" target=\"_blank\" class=\"link\">{{ getLinkUrl() }}</a>\r\n </div>\r\n <div class=\"flex items-center flex-none\">\r\n <ng-content select=\"[emrCommentEditorCommandEditLink],[emrCommentEditorCommandUnsetLink]\"></ng-content>\r\n </div>\r\n </div>\r\n}\r\n<div class=\"h-12 flex items-center justify-center gap-0.5\">\r\n <ng-content select=\"[emrCommentEditorCommand],emr-comment-editor-divider\"></ng-content>\r\n</div>\r\n", styles: [":host{display:block;box-shadow:0 1px 3px #0000001a,0 1px 2px -1px #0000001a;background:var(--color-neutral-950);color:var(--color-neutral-200);min-height:calc(var(--spacing) * 12);border-radius:1rem;top:1px;padding-inline-start:calc(var(--spacing) * 2);padding-inline-end:calc(var(--spacing) * 2)}:host .button,:host ::ng-deep .button{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);display:flex;align-items:center;justify-content:center;border-radius:calc(infinity * 1px);--emr-icon-size: 1.25rem}:host .button:hover,:host ::ng-deep .button:hover{color:var(--color-tertiary-300);background-color:var(--color-neutral-700);border-radius:calc(infinity * 1px);padding:calc(var(--spacing) * 1.5)}:host .button.active,:host ::ng-deep .button.active{color:var(--color-tertiary-300);background-color:var(--color-neutral-700)}:host .button mat-icon,:host ::ng-deep .button mat-icon{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);font-size:1.25rem;line-height:1.25}:host .button:disabled,:host ::ng-deep .button:disabled{pointer-events:none;opacity:70%}:host .link{color:var(--color-tertiary-300);position:relative;top:1px}:host .link:hover{color:var(--color-tertiary-100)}:host-context(html.dark){background:var(--color-tertiary-200);color:var(--color-neutral-900)}:host-context(html.dark) .link{color:var(--color-tertiary-700)}:host-context(html.dark) .link:hover{color:var(--color-tertiary-800)}\n/*! tailwindcss v4.1.14 | MIT License | https://tailwindcss.com */\n"] });
541
+ }
542
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: CommentEditorBubbleMenuComponent, decorators: [{
543
+ type: Component,
544
+ args: [{ selector: 'emr-comment-editor-bubble-menu', exportAs: 'emrCommentEditorBubbleMenu', providers: [
545
+ {
546
+ provide: COMMENT_EDITOR_BUBBLE_MENU,
547
+ useExisting: forwardRef(() => CommentEditorBubbleMenuComponent)
548
+ }
549
+ ], host: {
550
+ 'class': 'emr-comment-editor-bubble-menu',
551
+ }, template: "@if (this.commentEditor.api.isActive('link') && getLinkUrl()) {\r\n <div class=\"flex items-center gap-1 h-11 border-b border-b-default border-b-neutral-700\">\r\n <div class=\"grow text-sm overflow-hidden text-ellipsis whitespace-nowrap w-[116px]\">\r\n <a [href]=\"getLinkUrl()\" target=\"_blank\" class=\"link\">{{ getLinkUrl() }}</a>\r\n </div>\r\n <div class=\"flex items-center flex-none\">\r\n <ng-content select=\"[emrCommentEditorCommandEditLink],[emrCommentEditorCommandUnsetLink]\"></ng-content>\r\n </div>\r\n </div>\r\n}\r\n<div class=\"h-12 flex items-center justify-center gap-0.5\">\r\n <ng-content select=\"[emrCommentEditorCommand],emr-comment-editor-divider\"></ng-content>\r\n</div>\r\n", styles: [":host{display:block;box-shadow:0 1px 3px #0000001a,0 1px 2px -1px #0000001a;background:var(--color-neutral-950);color:var(--color-neutral-200);min-height:calc(var(--spacing) * 12);border-radius:1rem;top:1px;padding-inline-start:calc(var(--spacing) * 2);padding-inline-end:calc(var(--spacing) * 2)}:host .button,:host ::ng-deep .button{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);display:flex;align-items:center;justify-content:center;border-radius:calc(infinity * 1px);--emr-icon-size: 1.25rem}:host .button:hover,:host ::ng-deep .button:hover{color:var(--color-tertiary-300);background-color:var(--color-neutral-700);border-radius:calc(infinity * 1px);padding:calc(var(--spacing) * 1.5)}:host .button.active,:host ::ng-deep .button.active{color:var(--color-tertiary-300);background-color:var(--color-neutral-700)}:host .button mat-icon,:host ::ng-deep .button mat-icon{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);font-size:1.25rem;line-height:1.25}:host .button:disabled,:host ::ng-deep .button:disabled{pointer-events:none;opacity:70%}:host .link{color:var(--color-tertiary-300);position:relative;top:1px}:host .link:hover{color:var(--color-tertiary-100)}:host-context(html.dark){background:var(--color-tertiary-200);color:var(--color-neutral-900)}:host-context(html.dark) .link{color:var(--color-tertiary-700)}:host-context(html.dark) .link:hover{color:var(--color-tertiary-800)}\n/*! tailwindcss v4.1.14 | MIT License | https://tailwindcss.com */\n"] }]
552
+ }] });
553
+
554
+ class CommentEditorFooterBarComponent {
555
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: CommentEditorFooterBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
556
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.10", type: CommentEditorFooterBarComponent, isStandalone: true, selector: "emr-comment-editor-footer-bar", host: { classAttribute: "emr-comment-editor-footer-bar" }, exportAs: ["emrCommentEditorFooterBar"], ngImport: i0, template: "<ng-content select=\"[emrCommentEditorCommand],emr-comment-editor-divider\"></ng-content>\r\n", styles: [":host{display:flex;align-items:center;gap:calc(var(--spacing) * .5)}\n/*! tailwindcss v4.1.14 | MIT License | https://tailwindcss.com */\n"] });
557
+ }
558
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: CommentEditorFooterBarComponent, decorators: [{
559
+ type: Component,
560
+ args: [{ selector: 'emr-comment-editor-footer-bar', exportAs: 'emrCommentEditorFooterBar', host: {
561
+ 'class': 'emr-comment-editor-footer-bar',
562
+ }, template: "<ng-content select=\"[emrCommentEditorCommand],emr-comment-editor-divider\"></ng-content>\r\n", styles: [":host{display:flex;align-items:center;gap:calc(var(--spacing) * .5)}\n/*! tailwindcss v4.1.14 | MIT License | https://tailwindcss.com */\n"] }]
563
+ }] });
564
+
565
+ class CommentEditorCommandDirective {
566
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: CommentEditorCommandDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
567
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.10", type: CommentEditorCommandDirective, isStandalone: true, selector: "[emrCommentEditorCommand]", host: { properties: { "class.button": "true" } }, ngImport: i0 });
568
+ }
569
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: CommentEditorCommandDirective, decorators: [{
570
+ type: Directive,
571
+ args: [{
572
+ selector: '[emrCommentEditorCommand]',
573
+ standalone: true,
574
+ host: {
575
+ '[class.button]': 'true'
576
+ }
577
+ }]
578
+ }] });
579
+
580
+ class CommentEditorCommandBoldDirective {
581
+ commentEditor = inject(COMMENT_EDITOR);
582
+ onClick() {
583
+ this.commentEditor.api.runCommand('toggleBold');
584
+ }
585
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: CommentEditorCommandBoldDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
586
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.10", type: CommentEditorCommandBoldDirective, isStandalone: true, selector: "[emrCommentEditorCommandBold]", host: { listeners: { "click": "onClick()" }, properties: { "attr.disabled": "(commentEditor && commentEditor.api.isCommandDisabled('toggleBold')) ? '' : null", "class.active": "commentEditor && commentEditor.api.isActive('bold')" } }, exportAs: ["emrCommentEditorCommandBold"], ngImport: i0 });
587
+ }
588
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: CommentEditorCommandBoldDirective, decorators: [{
589
+ type: Directive,
590
+ args: [{
591
+ selector: '[emrCommentEditorCommandBold]',
592
+ exportAs: 'emrCommentEditorCommandBold',
593
+ standalone: true,
594
+ host: {
595
+ '[attr.disabled]': `(commentEditor && commentEditor.api.isCommandDisabled('toggleBold')) ? '' : null`,
596
+ '[class.active]': `commentEditor && commentEditor.api.isActive('bold')`,
597
+ '(click)': `onClick()`
598
+ }
599
+ }]
600
+ }] });
601
+
602
+ class CommentEditorCommandItalicDirective {
603
+ commentEditor = inject(COMMENT_EDITOR);
604
+ onClick() {
605
+ this.commentEditor.api.runCommand('toggleItalic');
606
+ }
607
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: CommentEditorCommandItalicDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
608
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.10", type: CommentEditorCommandItalicDirective, isStandalone: true, selector: "[emrCommentEditorCommandItalic]", host: { listeners: { "click": "onClick()" }, properties: { "attr.disabled": "(commentEditor && commentEditor.api.isCommandDisabled('toggleItalic')) ? '' : null", "class.active": "commentEditor && commentEditor.api.isActive('italic')" } }, ngImport: i0 });
609
+ }
610
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: CommentEditorCommandItalicDirective, decorators: [{
611
+ type: Directive,
612
+ args: [{
613
+ selector: '[emrCommentEditorCommandItalic]',
614
+ standalone: true,
615
+ host: {
616
+ '[attr.disabled]': `(commentEditor && commentEditor.api.isCommandDisabled('toggleItalic')) ? '' : null`,
617
+ '[class.active]': `commentEditor && commentEditor.api.isActive('italic')`,
618
+ '(click)': `onClick()`
619
+ }
620
+ }]
621
+ }] });
622
+
623
+ class CommentEditorCommandStrikeDirective {
624
+ commentEditor = inject(COMMENT_EDITOR);
625
+ onClick() {
626
+ this.commentEditor.api.runCommand('toggleStrike');
627
+ }
628
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: CommentEditorCommandStrikeDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
629
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.10", type: CommentEditorCommandStrikeDirective, isStandalone: true, selector: "[emrCommentEditorCommandStrike]", host: { listeners: { "click": "onClick()" }, properties: { "attr.disabled": "(commentEditor && commentEditor.api.isCommandDisabled('toggleStrike')) ? '' : null", "class.active": "commentEditor && commentEditor.api.isActive('strike')" } }, ngImport: i0 });
630
+ }
631
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: CommentEditorCommandStrikeDirective, decorators: [{
632
+ type: Directive,
633
+ args: [{
634
+ selector: '[emrCommentEditorCommandStrike]',
635
+ standalone: true,
636
+ host: {
637
+ '[attr.disabled]': `(commentEditor && commentEditor.api.isCommandDisabled('toggleStrike')) ? '' : null`,
638
+ '[class.active]': `commentEditor && commentEditor.api.isActive('strike')`,
639
+ '(click)': `onClick()`
640
+ }
641
+ }]
642
+ }] });
643
+
644
+ class CommentEditorCommandBulletListDirective {
645
+ commentEditor = inject(COMMENT_EDITOR);
646
+ onClick() {
647
+ this.commentEditor.api.runCommand('toggleBulletList');
648
+ }
649
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: CommentEditorCommandBulletListDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
650
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.10", type: CommentEditorCommandBulletListDirective, isStandalone: true, selector: "[emrCommentEditorCommandBulletList]", host: { listeners: { "click": "onClick()" }, properties: { "attr.disabled": "(commentEditor && commentEditor.api.isCommandDisabled('toggleBulletList')) ? '' : null", "class.active": "commentEditor && commentEditor.api.isActive('bulletList')" } }, ngImport: i0 });
651
+ }
652
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: CommentEditorCommandBulletListDirective, decorators: [{
653
+ type: Directive,
654
+ args: [{
655
+ selector: '[emrCommentEditorCommandBulletList]',
656
+ standalone: true,
657
+ host: {
658
+ '[attr.disabled]': `(commentEditor && commentEditor.api.isCommandDisabled('toggleBulletList')) ? '' : null`,
659
+ '[class.active]': `commentEditor && commentEditor.api.isActive('bulletList')`,
660
+ '(click)': `onClick()`
661
+ }
662
+ }]
663
+ }] });
664
+
665
+ class CommentEditorCommandOrderedListDirective {
666
+ commentEditor = inject(COMMENT_EDITOR);
667
+ onClick() {
668
+ this.commentEditor.api.runCommand('toggleOrderedList');
669
+ }
670
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: CommentEditorCommandOrderedListDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
671
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.10", type: CommentEditorCommandOrderedListDirective, isStandalone: true, selector: "[emrCommentEditorCommandOrderedList]", host: { listeners: { "click": "onClick()" }, properties: { "attr.disabled": "(commentEditor && commentEditor.api.isCommandDisabled('toggleOrderedList')) ? '' : null", "class.active": "commentEditor && commentEditor.api.isActive('orderedList')" } }, ngImport: i0 });
672
+ }
673
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: CommentEditorCommandOrderedListDirective, decorators: [{
674
+ type: Directive,
675
+ args: [{
676
+ selector: '[emrCommentEditorCommandOrderedList]',
677
+ standalone: true,
678
+ host: {
679
+ '[attr.disabled]': `(commentEditor && commentEditor.api.isCommandDisabled('toggleOrderedList')) ? '' : null`,
680
+ '[class.active]': `commentEditor && commentEditor.api.isActive('orderedList')`,
681
+ '(click)': `onClick()`
682
+ }
683
+ }]
684
+ }] });
685
+
686
+ class CommentEditorCommandBlockquoteDirective {
687
+ commentEditor = inject(COMMENT_EDITOR);
688
+ onClick() {
689
+ this.commentEditor.api.runCommand('toggleBlockquote');
690
+ }
691
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: CommentEditorCommandBlockquoteDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
692
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.10", type: CommentEditorCommandBlockquoteDirective, isStandalone: true, selector: "[emrCommentEditorCommandBlockquote]", host: { listeners: { "click": "onClick()" }, properties: { "attr.disabled": "(commentEditor && commentEditor.api.isCommandDisabled('toggleBlockquote')) ? '' : null", "class.active": "commentEditor && commentEditor.api.isActive('blockquote')" } }, ngImport: i0 });
693
+ }
694
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: CommentEditorCommandBlockquoteDirective, decorators: [{
695
+ type: Directive,
696
+ args: [{
697
+ selector: '[emrCommentEditorCommandBlockquote]',
698
+ standalone: true,
699
+ host: {
700
+ '[attr.disabled]': `(commentEditor && commentEditor.api.isCommandDisabled('toggleBlockquote')) ? '' : null`,
701
+ '[class.active]': `commentEditor && commentEditor.api.isActive('blockquote')`,
702
+ '(click)': `onClick()`
703
+ }
704
+ }]
705
+ }] });
706
+
707
+ class CommentEditorCommandCodeBlockDirective {
708
+ commentEditor = inject(COMMENT_EDITOR);
709
+ onClick() {
710
+ this.commentEditor.api.runCommand('toggleCodeBlock');
711
+ }
712
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: CommentEditorCommandCodeBlockDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
713
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.10", type: CommentEditorCommandCodeBlockDirective, isStandalone: true, selector: "[emrCommentEditorCommandCodeBlock]", host: { listeners: { "click": "onClick()" }, properties: { "attr.disabled": "(commentEditor && commentEditor.api.isCommandDisabled('toggleCodeBlock')) ? '' : null", "class.active": "commentEditor && commentEditor.api.isActive('codeBlock')" } }, ngImport: i0 });
714
+ }
715
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: CommentEditorCommandCodeBlockDirective, decorators: [{
716
+ type: Directive,
717
+ args: [{
718
+ selector: '[emrCommentEditorCommandCodeBlock]',
719
+ standalone: true,
720
+ host: {
721
+ '[attr.disabled]': `(commentEditor && commentEditor.api.isCommandDisabled('toggleCodeBlock')) ? '' : null`,
722
+ '[class.active]': `commentEditor && commentEditor.api.isActive('codeBlock')`,
723
+ '(click)': `onClick()`
724
+ }
725
+ }]
726
+ }] });
727
+
728
+ class CommentEditorCommandImageDirective {
729
+ commentEditor = inject(COMMENT_EDITOR);
730
+ onImageSelected(event) {
731
+ const file = event.files[0];
732
+ const reader = new FileReader();
733
+ reader.readAsDataURL(file);
734
+ reader.onload = () => {
735
+ const src = reader.result;
736
+ this.commentEditor.api.editor().chain().focus().addImageUploadingPlaceholder({ src, file }).run();
737
+ };
738
+ }
739
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: CommentEditorCommandImageDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
740
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.10", type: CommentEditorCommandImageDirective, isStandalone: true, selector: "[emrCommentEditorCommandImage]", host: { listeners: { "fileSelected": "onImageSelected($event)" }, properties: { "attr.accept": "\"image/*\"" } }, hostDirectives: [{ directive: i1.UploadTriggerDirective, outputs: ["fileSelected", "fileSelected"] }], ngImport: i0 });
741
+ }
742
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: CommentEditorCommandImageDirective, decorators: [{
743
+ type: Directive,
744
+ args: [{
745
+ selector: '[emrCommentEditorCommandImage]',
746
+ standalone: true,
747
+ hostDirectives: [
748
+ {
749
+ directive: UploadTriggerDirective,
750
+ outputs: ['fileSelected']
751
+ }
752
+ ],
753
+ host: {
754
+ '[attr.accept]': '"image/*"',
755
+ '(fileSelected)': `onImageSelected($event)`
756
+ }
757
+ }]
758
+ }] });
759
+
760
+ class YoutubeDialog {
761
+ _dialogRef = inject(MatDialogRef);
762
+ _data = inject(MAT_DIALOG_DATA);
763
+ linkUrl = this._data.linkUrl || '';
764
+ isUpdate = !!this._data.linkUrl;
765
+ onSubmit() {
766
+ this._dialogRef.close(this.linkUrl);
767
+ }
768
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: YoutubeDialog, deps: [], target: i0.ɵɵFactoryTarget.Component });
769
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.10", type: YoutubeDialog, isStandalone: true, selector: "emr-youtube", ngImport: i0, template: "<form class=\"w-[500px]\" (ngSubmit)=\"onSubmit()\">\r\n <h3 class=\"mat-title-large\" mat-dialog-title>\r\n @if (isUpdate) {\r\n Update Youtube\r\n } @else {\r\n Add Youtube\r\n }\r\n </h3>\r\n <mat-dialog-content>\r\n <div class=\"pt-4\">\r\n <mat-form-field class=\"w-full\">\r\n <mat-label>Paste Url</mat-label>\r\n <input name=\"linkUrl\" matInput [(ngModel)]=\"linkUrl\">\r\n </mat-form-field>\r\n </div>\r\n </mat-dialog-content>\r\n <mat-dialog-actions align=\"end\">\r\n <button mat-button>Cancel</button>\r\n <button type=\"submit\" mat-flat-button color=\"primary\"\r\n cdkFocusInitial [disabled]=\"!linkUrl.trim() || null\">\r\n @if (isUpdate) {\r\n Save\r\n } @else {\r\n Add url\r\n }\r\n </button>\r\n </mat-dialog-actions>\r\n</form>\r\n", styles: [""], 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])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],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]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: ReactiveFormsModule }] });
770
+ }
771
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: YoutubeDialog, decorators: [{
772
+ type: Component,
773
+ args: [{ selector: 'emr-youtube', imports: [
774
+ FormsModule,
775
+ MatButton,
776
+ MatDialogActions,
777
+ MatDialogContent,
778
+ MatDialogTitle,
779
+ MatFormField,
780
+ MatInput,
781
+ MatLabel,
782
+ ReactiveFormsModule
783
+ ], template: "<form class=\"w-[500px]\" (ngSubmit)=\"onSubmit()\">\r\n <h3 class=\"mat-title-large\" mat-dialog-title>\r\n @if (isUpdate) {\r\n Update Youtube\r\n } @else {\r\n Add Youtube\r\n }\r\n </h3>\r\n <mat-dialog-content>\r\n <div class=\"pt-4\">\r\n <mat-form-field class=\"w-full\">\r\n <mat-label>Paste Url</mat-label>\r\n <input name=\"linkUrl\" matInput [(ngModel)]=\"linkUrl\">\r\n </mat-form-field>\r\n </div>\r\n </mat-dialog-content>\r\n <mat-dialog-actions align=\"end\">\r\n <button mat-button>Cancel</button>\r\n <button type=\"submit\" mat-flat-button color=\"primary\"\r\n cdkFocusInitial [disabled]=\"!linkUrl.trim() || null\">\r\n @if (isUpdate) {\r\n Save\r\n } @else {\r\n Add url\r\n }\r\n </button>\r\n </mat-dialog-actions>\r\n</form>\r\n" }]
784
+ }] });
785
+
786
+ class CommentEditorCommandYoutubeDirective {
787
+ commentEditor = inject(COMMENT_EDITOR);
788
+ _dialog = inject(MatDialog);
789
+ _destroyRef = inject(DestroyRef);
790
+ onClick() {
791
+ const dialogRef = this._dialog.open(YoutubeDialog, {
792
+ data: {
793
+ linkUrl: this.commentEditor.api.editor().getAttributes('iframe').src
794
+ }
795
+ });
796
+ dialogRef
797
+ .afterClosed()
798
+ .pipe(takeUntilDestroyed(this._destroyRef))
799
+ .subscribe((linkUrl) => {
800
+ if (typeof linkUrl === 'undefined') {
801
+ return;
802
+ }
803
+ this.commentEditor.api.editor().commands.setYoutubeVideo({
804
+ src: linkUrl
805
+ });
806
+ });
807
+ }
808
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: CommentEditorCommandYoutubeDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
809
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.10", type: CommentEditorCommandYoutubeDirective, isStandalone: true, selector: "[emrCommentEditorCommandYoutube]", host: { listeners: { "click": "onClick()" }, properties: { "attr.disabled": "(commentEditor && commentEditor.api.isCommandDisabled('toggleBlockquote')) ? '' : null", "class.active": "commentEditor && commentEditor.api.isActive('blockquote')" } }, ngImport: i0 });
810
+ }
811
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: CommentEditorCommandYoutubeDirective, decorators: [{
812
+ type: Directive,
813
+ args: [{
814
+ selector: '[emrCommentEditorCommandYoutube]',
815
+ standalone: true,
816
+ host: {
817
+ '[attr.disabled]': `(commentEditor && commentEditor.api.isCommandDisabled('toggleBlockquote')) ? '' : null`,
818
+ '[class.active]': `commentEditor && commentEditor.api.isActive('blockquote')`,
819
+ '(click)': `onClick()`
820
+ }
821
+ }]
822
+ }] });
823
+
824
+ class LinkDialog {
825
+ _dialogRef = inject(MatDialogRef);
826
+ _data = inject(MAT_DIALOG_DATA);
827
+ linkUrl = this._data.linkUrl || '';
828
+ isUpdate = !!this._data.linkUrl;
829
+ onSubmit() {
830
+ this._dialogRef.close(this.linkUrl);
831
+ }
832
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: LinkDialog, deps: [], target: i0.ɵɵFactoryTarget.Component });
833
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.10", type: LinkDialog, isStandalone: true, selector: "emr-link", ngImport: i0, template: "<form class=\"w-[500px]\" (ngSubmit)=\"onSubmit()\">\r\n <h3 class=\"mat-title-large\" mat-dialog-title>\r\n @if (isUpdate) {\r\n Update Link\r\n } @else {\r\n Add Link\r\n }</h3>\r\n <mat-dialog-content>\r\n <div class=\"pt-4\">\r\n <mat-form-field class=\"w-full\">\r\n <mat-label>Paste Link</mat-label>\r\n <input name=\"linkUrl\" matInput [(ngModel)]=\"linkUrl\">\r\n </mat-form-field>\r\n </div>\r\n </mat-dialog-content>\r\n <mat-dialog-actions align=\"end\">\r\n <button mat-button>Cancel</button>\r\n <button type=\"submit\" mat-flat-button color=\"primary\"\r\n cdkFocusInitial [disabled]=\"!linkUrl.trim() || null\">\r\n @if (isUpdate) {\r\n Save\r\n } @else {\r\n Add link\r\n }\r\n </button>\r\n </mat-dialog-actions>\r\n</form>\r\n", styles: [""], dependencies: [{ kind: "component", type: MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: FormsModule }, { 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]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }] });
834
+ }
835
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: LinkDialog, decorators: [{
836
+ type: Component,
837
+ args: [{ selector: 'emr-link', imports: [
838
+ MatButton,
839
+ MatDialogActions,
840
+ MatDialogContent,
841
+ MatDialogTitle,
842
+ MatFormField,
843
+ MatInput,
844
+ MatLabel,
845
+ ReactiveFormsModule,
846
+ FormsModule
847
+ ], template: "<form class=\"w-[500px]\" (ngSubmit)=\"onSubmit()\">\r\n <h3 class=\"mat-title-large\" mat-dialog-title>\r\n @if (isUpdate) {\r\n Update Link\r\n } @else {\r\n Add Link\r\n }</h3>\r\n <mat-dialog-content>\r\n <div class=\"pt-4\">\r\n <mat-form-field class=\"w-full\">\r\n <mat-label>Paste Link</mat-label>\r\n <input name=\"linkUrl\" matInput [(ngModel)]=\"linkUrl\">\r\n </mat-form-field>\r\n </div>\r\n </mat-dialog-content>\r\n <mat-dialog-actions align=\"end\">\r\n <button mat-button>Cancel</button>\r\n <button type=\"submit\" mat-flat-button color=\"primary\"\r\n cdkFocusInitial [disabled]=\"!linkUrl.trim() || null\">\r\n @if (isUpdate) {\r\n Save\r\n } @else {\r\n Add link\r\n }\r\n </button>\r\n </mat-dialog-actions>\r\n</form>\r\n" }]
848
+ }] });
849
+
850
+ class CommentEditorCommandLinkDirective {
851
+ _destroyRef = inject(DestroyRef);
852
+ _dialog = inject(MatDialog);
853
+ commentEditor = inject(COMMENT_EDITOR);
854
+ setLinkActive = false;
855
+ onClick() {
856
+ this.setLinkActive = true;
857
+ const dialogRef = this._dialog.open(LinkDialog, {
858
+ data: {
859
+ linkUrl: this.commentEditor.api.editor().getAttributes('link').href
860
+ }
861
+ });
862
+ dialogRef
863
+ .afterClosed()
864
+ .pipe(takeUntilDestroyed(this._destroyRef))
865
+ .subscribe((linkUrl) => {
866
+ this.setLinkActive = false;
867
+ if (typeof linkUrl === 'undefined') {
868
+ return;
869
+ }
870
+ this._setLink(linkUrl);
871
+ });
872
+ }
873
+ _setLink(url) {
874
+ // cancelled
875
+ if (url === null) {
876
+ return;
877
+ }
878
+ // empty
879
+ if (url === '') {
880
+ this.commentEditor.api.editor()
881
+ .chain()
882
+ .focus()
883
+ .extendMarkRange('link')
884
+ .unsetLink()
885
+ .run();
886
+ return;
887
+ }
888
+ // update link
889
+ this.commentEditor.api.editor()
890
+ .chain()
891
+ .focus()
892
+ .extendMarkRange('link')
893
+ .setLink({ href: url })
894
+ .run();
895
+ }
896
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: CommentEditorCommandLinkDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
897
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.10", type: CommentEditorCommandLinkDirective, isStandalone: true, selector: "[emrCommentEditorCommandLink]", host: { listeners: { "click": "onClick()" }, properties: { "attr.disabled": "(commentEditor && commentEditor.api.isCommandDisabled('toggleLink')) ? '' : null", "class.active": "commentEditor && commentEditor.api.isActive('link')" } }, ngImport: i0 });
898
+ }
899
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: CommentEditorCommandLinkDirective, decorators: [{
900
+ type: Directive,
901
+ args: [{
902
+ selector: '[emrCommentEditorCommandLink]',
903
+ standalone: true,
904
+ host: {
905
+ '[attr.disabled]': `(commentEditor && commentEditor.api.isCommandDisabled('toggleLink')) ? '' : null`,
906
+ '[class.active]': `commentEditor && commentEditor.api.isActive('link')`,
907
+ '(click)': `onClick()`
908
+ }
909
+ }]
910
+ }] });
911
+
912
+ class CommentEditorCommandCodeDirective {
913
+ commentEditor = inject(COMMENT_EDITOR);
914
+ onClick() {
915
+ this.commentEditor.api.runCommand('toggleCode');
916
+ }
917
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: CommentEditorCommandCodeDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
918
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.10", type: CommentEditorCommandCodeDirective, isStandalone: true, selector: "[emrCommentEditorCommandCode]", host: { listeners: { "click": "onClick()" }, properties: { "attr.disabled": "(commentEditor && commentEditor.api.isCommandDisabled('toggleCode')) ? '' : null", "class.active": "commentEditor && commentEditor.api.isActive('code')" } }, ngImport: i0 });
919
+ }
920
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: CommentEditorCommandCodeDirective, decorators: [{
921
+ type: Directive,
922
+ args: [{
923
+ selector: '[emrCommentEditorCommandCode]',
924
+ standalone: true,
925
+ host: {
926
+ '[attr.disabled]': `(commentEditor && commentEditor.api.isCommandDisabled('toggleCode')) ? '' : null`,
927
+ '[class.active]': `commentEditor && commentEditor.api.isActive('code')`,
928
+ '(click)': `onClick()`
929
+ }
930
+ }]
931
+ }] });
932
+
933
+ class CommentEditorCommandEditLinkDirective {
934
+ _destroyRef = inject(DestroyRef);
935
+ _dialog = inject(MatDialog);
936
+ commentEditor = inject(COMMENT_EDITOR);
937
+ setLinkActive = false;
938
+ onClick() {
939
+ this.setLinkActive = true;
940
+ const dialogRef = this._dialog.open(LinkDialog, {
941
+ data: {
942
+ linkUrl: this.commentEditor.api.editor().getAttributes('link').href
943
+ }
944
+ });
945
+ dialogRef
946
+ .afterClosed()
947
+ .pipe(takeUntilDestroyed(this._destroyRef))
948
+ .subscribe((linkUrl) => {
949
+ this.setLinkActive = false;
950
+ if (typeof linkUrl === 'undefined') {
951
+ return;
952
+ }
953
+ this._setLink(linkUrl);
954
+ });
955
+ }
956
+ _setLink(url) {
957
+ // cancelled
958
+ if (url === null) {
959
+ return;
960
+ }
961
+ // empty
962
+ if (url === '') {
963
+ this.commentEditor.api.editor()
964
+ .chain()
965
+ .focus()
966
+ .extendMarkRange('link')
967
+ .unsetLink()
968
+ .run();
969
+ return;
970
+ }
971
+ // update link
972
+ this.commentEditor.api.editor()
973
+ .chain()
974
+ .focus()
975
+ .extendMarkRange('link')
976
+ .setLink({ href: url })
977
+ .run();
978
+ }
979
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: CommentEditorCommandEditLinkDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
980
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.10", type: CommentEditorCommandEditLinkDirective, isStandalone: true, selector: "[emrCommentEditorCommandEditLink]", host: { listeners: { "click": "onClick()" }, properties: { "class.button": "true" } }, ngImport: i0 });
981
+ }
982
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: CommentEditorCommandEditLinkDirective, decorators: [{
983
+ type: Directive,
984
+ args: [{
985
+ selector: '[emrCommentEditorCommandEditLink]',
986
+ standalone: true,
987
+ host: {
988
+ '[class.button]': 'true',
989
+ '(click)': `onClick()`
990
+ }
991
+ }]
992
+ }] });
993
+
994
+ class CommentEditorCommandUnsetLinkDirective {
995
+ commentEditor = inject(COMMENT_EDITOR);
996
+ onClick() {
997
+ this.commentEditor.api.editor().commands.unsetLink();
998
+ }
999
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: CommentEditorCommandUnsetLinkDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1000
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.10", type: CommentEditorCommandUnsetLinkDirective, isStandalone: true, selector: "[emrCommentEditorCommandUnsetLink]", host: { listeners: { "click": "onClick()" }, properties: { "class.button": "true" } }, ngImport: i0 });
1001
+ }
1002
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: CommentEditorCommandUnsetLinkDirective, decorators: [{
1003
+ type: Directive,
1004
+ args: [{
1005
+ selector: '[emrCommentEditorCommandUnsetLink]',
1006
+ standalone: true,
1007
+ host: {
1008
+ '[class.button]': 'true',
1009
+ '(click)': `onClick()`
1010
+ }
1011
+ }]
1012
+ }] });
1013
+
1014
+ class CommentEditorCommandToggleToolbarDirective {
1015
+ commentEditor = inject(COMMENT_EDITOR);
1016
+ onClick() {
1017
+ this.commentEditor.api.toggleToolbar();
1018
+ }
1019
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: CommentEditorCommandToggleToolbarDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1020
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.10", type: CommentEditorCommandToggleToolbarDirective, isStandalone: true, selector: "[emrCommentEditorCommandToggleToolbar]", host: { listeners: { "click": "onClick()" }, properties: { "class.active": "commentEditor && commentEditor.api.isToolbarActive()" } }, ngImport: i0 });
1021
+ }
1022
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: CommentEditorCommandToggleToolbarDirective, decorators: [{
1023
+ type: Directive,
1024
+ args: [{
1025
+ selector: '[emrCommentEditorCommandToggleToolbar]',
1026
+ standalone: true,
1027
+ host: {
1028
+ '[class.active]': `commentEditor && commentEditor.api.isToolbarActive()`,
1029
+ '(click)': `onClick()`
1030
+ }
1031
+ }]
1032
+ }] });
1033
+
1034
+ /**
1035
+ * Generated bundle index. Do not edit.
1036
+ */
1037
+
1038
+ export { COMMENT_EDITOR, COMMENT_EDITOR_BUBBLE_MENU, CommentEditorBubbleMenuComponent, CommentEditorCommandBlockquoteDirective, CommentEditorCommandBoldDirective, CommentEditorCommandBulletListDirective, CommentEditorCommandCodeBlockDirective, CommentEditorCommandCodeDirective, CommentEditorCommandDirective, CommentEditorCommandEditLinkDirective, CommentEditorCommandImageDirective, CommentEditorCommandItalicDirective, CommentEditorCommandLinkDirective, CommentEditorCommandOrderedListDirective, CommentEditorCommandStrikeDirective, CommentEditorCommandToggleToolbarDirective, CommentEditorCommandUnsetLinkDirective, CommentEditorCommandYoutubeDirective, CommentEditorComponent, CommentEditorDividerComponent, CommentEditorFooterBarComponent, CommentEditorToolbarComponent };
1039
+ //# sourceMappingURL=elementar-rt-components-comment-editor.mjs.map