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