@area8975/ui 0.2.2-dev.48 → 0.2.2-dev.50

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 (182) hide show
  1. package/README.md +3 -2
  2. package/fesm2022/area8975-ui-alert.mjs +113 -0
  3. package/fesm2022/area8975-ui-alert.mjs.map +1 -0
  4. package/fesm2022/area8975-ui-avatar.mjs +157 -0
  5. package/fesm2022/area8975-ui-avatar.mjs.map +1 -0
  6. package/fesm2022/area8975-ui-badge.mjs +116 -0
  7. package/fesm2022/area8975-ui-badge.mjs.map +1 -0
  8. package/fesm2022/area8975-ui-button.mjs +314 -0
  9. package/fesm2022/area8975-ui-button.mjs.map +1 -0
  10. package/fesm2022/area8975-ui-calendar.mjs +549 -0
  11. package/fesm2022/area8975-ui-calendar.mjs.map +1 -0
  12. package/fesm2022/area8975-ui-card-header.mjs +96 -0
  13. package/fesm2022/area8975-ui-card-header.mjs.map +1 -0
  14. package/fesm2022/area8975-ui-card.mjs +73 -0
  15. package/fesm2022/area8975-ui-card.mjs.map +1 -0
  16. package/fesm2022/area8975-ui-chart-palette.mjs +225 -0
  17. package/fesm2022/area8975-ui-chart-palette.mjs.map +1 -0
  18. package/fesm2022/area8975-ui-charts.mjs +2813 -0
  19. package/fesm2022/area8975-ui-charts.mjs.map +1 -0
  20. package/fesm2022/area8975-ui-checkbox.mjs +202 -0
  21. package/fesm2022/area8975-ui-checkbox.mjs.map +1 -0
  22. package/fesm2022/area8975-ui-colour.mjs +200 -0
  23. package/fesm2022/area8975-ui-colour.mjs.map +1 -0
  24. package/fesm2022/area8975-ui-container.mjs +40 -0
  25. package/fesm2022/area8975-ui-container.mjs.map +1 -0
  26. package/fesm2022/area8975-ui-counter.mjs +246 -0
  27. package/fesm2022/area8975-ui-counter.mjs.map +1 -0
  28. package/fesm2022/area8975-ui-date-range-picker.mjs +554 -0
  29. package/fesm2022/area8975-ui-date-range-picker.mjs.map +1 -0
  30. package/fesm2022/area8975-ui-datepicker.mjs +547 -0
  31. package/fesm2022/area8975-ui-datepicker.mjs.map +1 -0
  32. package/fesm2022/area8975-ui-disclosure.mjs +279 -0
  33. package/fesm2022/area8975-ui-disclosure.mjs.map +1 -0
  34. package/fesm2022/area8975-ui-drawer.mjs +106 -0
  35. package/fesm2022/area8975-ui-drawer.mjs.map +1 -0
  36. package/fesm2022/area8975-ui-dropdown-button.mjs +141 -0
  37. package/fesm2022/area8975-ui-dropdown-button.mjs.map +1 -0
  38. package/fesm2022/area8975-ui-dropdown-menu.mjs +96 -0
  39. package/fesm2022/area8975-ui-dropdown-menu.mjs.map +1 -0
  40. package/fesm2022/area8975-ui-dropdown.mjs +208 -0
  41. package/fesm2022/area8975-ui-dropdown.mjs.map +1 -0
  42. package/fesm2022/area8975-ui-dropzone.mjs +332 -0
  43. package/fesm2022/area8975-ui-dropzone.mjs.map +1 -0
  44. package/fesm2022/area8975-ui-field.mjs +191 -0
  45. package/fesm2022/area8975-ui-field.mjs.map +1 -0
  46. package/fesm2022/area8975-ui-file-input.mjs +340 -0
  47. package/fesm2022/area8975-ui-file-input.mjs.map +1 -0
  48. package/fesm2022/area8975-ui-file.mjs +47 -0
  49. package/fesm2022/area8975-ui-file.mjs.map +1 -0
  50. package/fesm2022/area8975-ui-format.mjs +70 -0
  51. package/fesm2022/area8975-ui-format.mjs.map +1 -0
  52. package/fesm2022/area8975-ui-input-addon.mjs +42 -0
  53. package/fesm2022/area8975-ui-input-addon.mjs.map +1 -0
  54. package/fesm2022/area8975-ui-input-group.mjs +86 -0
  55. package/fesm2022/area8975-ui-input-group.mjs.map +1 -0
  56. package/fesm2022/area8975-ui-input.mjs +682 -0
  57. package/fesm2022/area8975-ui-input.mjs.map +1 -0
  58. package/fesm2022/area8975-ui-kpi.mjs +167 -0
  59. package/fesm2022/area8975-ui-kpi.mjs.map +1 -0
  60. package/fesm2022/area8975-ui-layout.mjs +63 -0
  61. package/fesm2022/area8975-ui-layout.mjs.map +1 -0
  62. package/fesm2022/area8975-ui-loading.mjs +76 -0
  63. package/fesm2022/area8975-ui-loading.mjs.map +1 -0
  64. package/fesm2022/area8975-ui-modal-close-btn.mjs +89 -0
  65. package/fesm2022/area8975-ui-modal-close-btn.mjs.map +1 -0
  66. package/fesm2022/area8975-ui-modal.mjs +235 -0
  67. package/fesm2022/area8975-ui-modal.mjs.map +1 -0
  68. package/fesm2022/area8975-ui-money.mjs +230 -0
  69. package/fesm2022/area8975-ui-money.mjs.map +1 -0
  70. package/fesm2022/area8975-ui-overlay.mjs +317 -0
  71. package/fesm2022/area8975-ui-overlay.mjs.map +1 -0
  72. package/fesm2022/area8975-ui-pagination.mjs +152 -0
  73. package/fesm2022/area8975-ui-pagination.mjs.map +1 -0
  74. package/fesm2022/area8975-ui-private.mjs +63 -0
  75. package/fesm2022/area8975-ui-private.mjs.map +1 -0
  76. package/fesm2022/area8975-ui-progress.mjs +307 -0
  77. package/fesm2022/area8975-ui-progress.mjs.map +1 -0
  78. package/fesm2022/area8975-ui-radio.mjs +199 -0
  79. package/fesm2022/area8975-ui-radio.mjs.map +1 -0
  80. package/fesm2022/area8975-ui-rich-text-editor.mjs +778 -0
  81. package/fesm2022/area8975-ui-rich-text-editor.mjs.map +1 -0
  82. package/fesm2022/area8975-ui-search.mjs +266 -0
  83. package/fesm2022/area8975-ui-search.mjs.map +1 -0
  84. package/fesm2022/area8975-ui-segmented.mjs +118 -0
  85. package/fesm2022/area8975-ui-segmented.mjs.map +1 -0
  86. package/fesm2022/area8975-ui-select.mjs +926 -0
  87. package/fesm2022/area8975-ui-select.mjs.map +1 -0
  88. package/fesm2022/area8975-ui-sidebar-group.mjs +60 -0
  89. package/fesm2022/area8975-ui-sidebar-group.mjs.map +1 -0
  90. package/fesm2022/area8975-ui-sidebar-item.mjs +107 -0
  91. package/fesm2022/area8975-ui-sidebar-item.mjs.map +1 -0
  92. package/fesm2022/area8975-ui-sidebar.mjs +109 -0
  93. package/fesm2022/area8975-ui-sidebar.mjs.map +1 -0
  94. package/fesm2022/area8975-ui-skeleton.mjs +116 -0
  95. package/fesm2022/area8975-ui-skeleton.mjs.map +1 -0
  96. package/fesm2022/area8975-ui-stat.mjs +55 -0
  97. package/fesm2022/area8975-ui-stat.mjs.map +1 -0
  98. package/fesm2022/area8975-ui-switch.mjs +132 -0
  99. package/fesm2022/area8975-ui-switch.mjs.map +1 -0
  100. package/fesm2022/area8975-ui-tab.mjs +217 -0
  101. package/fesm2022/area8975-ui-tab.mjs.map +1 -0
  102. package/fesm2022/area8975-ui-table-filters.mjs +499 -0
  103. package/fesm2022/area8975-ui-table-filters.mjs.map +1 -0
  104. package/fesm2022/area8975-ui-table.mjs +1237 -0
  105. package/fesm2022/area8975-ui-table.mjs.map +1 -0
  106. package/fesm2022/area8975-ui-textarea.mjs +375 -0
  107. package/fesm2022/area8975-ui-textarea.mjs.map +1 -0
  108. package/fesm2022/area8975-ui-theme.mjs +246 -0
  109. package/fesm2022/area8975-ui-theme.mjs.map +1 -0
  110. package/fesm2022/area8975-ui-time-select.mjs +170 -0
  111. package/fesm2022/area8975-ui-time-select.mjs.map +1 -0
  112. package/fesm2022/area8975-ui-toast.mjs +269 -0
  113. package/fesm2022/area8975-ui-toast.mjs.map +1 -0
  114. package/fesm2022/area8975-ui-toaster.mjs +117 -0
  115. package/fesm2022/area8975-ui-toaster.mjs.map +1 -0
  116. package/fesm2022/area8975-ui-tooltip.mjs +196 -0
  117. package/fesm2022/area8975-ui-tooltip.mjs.map +1 -0
  118. package/fesm2022/area8975-ui-user-menu.mjs +186 -0
  119. package/fesm2022/area8975-ui-user-menu.mjs.map +1 -0
  120. package/fesm2022/area8975-ui.mjs +0 -16269
  121. package/package.json +237 -1
  122. package/types/area8975-ui-alert.d.ts +25 -0
  123. package/types/area8975-ui-avatar.d.ts +40 -0
  124. package/types/area8975-ui-badge.d.ts +31 -0
  125. package/types/area8975-ui-button.d.ts +129 -0
  126. package/types/area8975-ui-calendar.d.ts +177 -0
  127. package/types/area8975-ui-card-header.d.ts +28 -0
  128. package/types/area8975-ui-card.d.ts +18 -0
  129. package/types/area8975-ui-chart-palette.d.ts +176 -0
  130. package/types/area8975-ui-charts.d.ts +747 -0
  131. package/types/area8975-ui-checkbox.d.ts +61 -0
  132. package/types/area8975-ui-colour.d.ts +31 -0
  133. package/types/area8975-ui-container.d.ts +5 -0
  134. package/types/area8975-ui-counter.d.ts +43 -0
  135. package/types/area8975-ui-date-range-picker.d.ts +132 -0
  136. package/types/area8975-ui-datepicker.d.ts +124 -0
  137. package/types/area8975-ui-disclosure.d.ts +79 -0
  138. package/types/area8975-ui-drawer.d.ts +25 -0
  139. package/types/area8975-ui-dropdown-button.d.ts +32 -0
  140. package/types/area8975-ui-dropdown-menu.d.ts +25 -0
  141. package/types/area8975-ui-dropdown.d.ts +56 -0
  142. package/types/area8975-ui-dropzone.d.ts +96 -0
  143. package/types/area8975-ui-field.d.ts +72 -0
  144. package/types/area8975-ui-file-input.d.ts +72 -0
  145. package/types/area8975-ui-file.d.ts +21 -0
  146. package/types/area8975-ui-format.d.ts +37 -0
  147. package/types/area8975-ui-input-addon.d.ts +10 -0
  148. package/types/area8975-ui-input-group.d.ts +18 -0
  149. package/types/area8975-ui-input.d.ts +224 -0
  150. package/types/area8975-ui-kpi.d.ts +36 -0
  151. package/types/area8975-ui-layout.d.ts +7 -0
  152. package/types/area8975-ui-loading.d.ts +16 -0
  153. package/types/area8975-ui-modal-close-btn.d.ts +14 -0
  154. package/types/area8975-ui-modal.d.ts +45 -0
  155. package/types/area8975-ui-money.d.ts +77 -0
  156. package/types/area8975-ui-overlay.d.ts +75 -0
  157. package/types/area8975-ui-pagination.d.ts +27 -0
  158. package/types/area8975-ui-private.d.ts +20 -0
  159. package/types/area8975-ui-progress.d.ts +127 -0
  160. package/types/area8975-ui-radio.d.ts +61 -0
  161. package/types/area8975-ui-rich-text-editor.d.ts +165 -0
  162. package/types/area8975-ui-search.d.ts +56 -0
  163. package/types/area8975-ui-segmented.d.ts +41 -0
  164. package/types/area8975-ui-select.d.ts +293 -0
  165. package/types/area8975-ui-sidebar-group.d.ts +15 -0
  166. package/types/area8975-ui-sidebar-item.d.ts +20 -0
  167. package/types/area8975-ui-sidebar.d.ts +16 -0
  168. package/types/area8975-ui-skeleton.d.ts +35 -0
  169. package/types/area8975-ui-stat.d.ts +13 -0
  170. package/types/area8975-ui-switch.d.ts +32 -0
  171. package/types/area8975-ui-tab.d.ts +45 -0
  172. package/types/area8975-ui-table-filters.d.ts +138 -0
  173. package/types/area8975-ui-table.d.ts +371 -0
  174. package/types/area8975-ui-textarea.d.ts +126 -0
  175. package/types/area8975-ui-theme.d.ts +61 -0
  176. package/types/area8975-ui-time-select.d.ts +35 -0
  177. package/types/area8975-ui-toast.d.ts +78 -0
  178. package/types/area8975-ui-toaster.d.ts +23 -0
  179. package/types/area8975-ui-tooltip.d.ts +47 -0
  180. package/types/area8975-ui-user-menu.d.ts +39 -0
  181. package/types/area8975-ui.d.ts +1 -4464
  182. package/fesm2022/area8975-ui.mjs.map +0 -1
@@ -0,0 +1,778 @@
1
+ import * as i0 from "@angular/core";
2
+ import { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, Injector, ViewEncapsulation, afterNextRender, afterRenderEffect, booleanAttribute, computed, effect, inject, input, model, output, signal, untracked, viewChild } from "@angular/core";
3
+ import { UiButtonComponent } from "@area8975/ui/button";
4
+ import { UiFieldComponent } from "@area8975/ui/field";
5
+ import { UiInputComponent } from "@area8975/ui/input";
6
+ import { NgIcon, provideIcons } from "@ng-icons/core";
7
+ import { heroArrowUturnLeft, heroArrowUturnRight, heroBold, heroChatBubbleLeft, heroCodeBracket, heroCodeBracketSquare, heroH1, heroH2, heroH3, heroItalic, heroLink, heroListBullet, heroMinus, heroNumberedList, heroStrikethrough, heroUnderline } from "@ng-icons/heroicons/outline";
8
+ import { Editor } from "@tiptap/core";
9
+ import { Placeholder } from "@tiptap/extensions";
10
+ import StarterKit from "@tiptap/starter-kit";
11
+ const RichTextTools = [
12
+ "bold",
13
+ "italic",
14
+ "underline",
15
+ "strike",
16
+ "code",
17
+ "heading1",
18
+ "heading2",
19
+ "heading3",
20
+ "bulletList",
21
+ "orderedList",
22
+ "blockquote",
23
+ "codeBlock",
24
+ "horizontalRule",
25
+ "link",
26
+ "undo",
27
+ "redo"
28
+ ];
29
+ const RichTextToolGroups = [
30
+ [
31
+ "bold",
32
+ "italic",
33
+ "underline",
34
+ "strike",
35
+ "code"
36
+ ],
37
+ [
38
+ "heading1",
39
+ "heading2",
40
+ "heading3"
41
+ ],
42
+ [
43
+ "bulletList",
44
+ "orderedList",
45
+ "blockquote",
46
+ "codeBlock",
47
+ "horizontalRule"
48
+ ],
49
+ ["link"],
50
+ ["undo", "redo"]
51
+ ];
52
+ const TOOLS = {
53
+ bold: {
54
+ label: "Bold",
55
+ icon: "heroBold",
56
+ active: (editor) => editor.isActive("bold"),
57
+ run: (chain) => chain.toggleBold()
58
+ },
59
+ italic: {
60
+ label: "Italic",
61
+ icon: "heroItalic",
62
+ active: (editor) => editor.isActive("italic"),
63
+ run: (chain) => chain.toggleItalic()
64
+ },
65
+ underline: {
66
+ label: "Underline",
67
+ icon: "heroUnderline",
68
+ active: (editor) => editor.isActive("underline"),
69
+ run: (chain) => chain.toggleUnderline()
70
+ },
71
+ strike: {
72
+ label: "Strikethrough",
73
+ icon: "heroStrikethrough",
74
+ active: (editor) => editor.isActive("strike"),
75
+ run: (chain) => chain.toggleStrike()
76
+ },
77
+ code: {
78
+ label: "Inline code",
79
+ icon: "heroCodeBracket",
80
+ active: (editor) => editor.isActive("code"),
81
+ run: (chain) => chain.toggleCode()
82
+ },
83
+ heading1: {
84
+ label: "Heading 1",
85
+ icon: "heroH1",
86
+ active: (editor) => editor.isActive("heading", { level: 1 }),
87
+ run: (chain) => chain.toggleHeading({ level: 1 })
88
+ },
89
+ heading2: {
90
+ label: "Heading 2",
91
+ icon: "heroH2",
92
+ active: (editor) => editor.isActive("heading", { level: 2 }),
93
+ run: (chain) => chain.toggleHeading({ level: 2 })
94
+ },
95
+ heading3: {
96
+ label: "Heading 3",
97
+ icon: "heroH3",
98
+ active: (editor) => editor.isActive("heading", { level: 3 }),
99
+ run: (chain) => chain.toggleHeading({ level: 3 })
100
+ },
101
+ bulletList: {
102
+ label: "Bulleted list",
103
+ icon: "heroListBullet",
104
+ active: (editor) => editor.isActive("bulletList"),
105
+ run: (chain) => chain.toggleBulletList()
106
+ },
107
+ orderedList: {
108
+ label: "Numbered list",
109
+ icon: "heroNumberedList",
110
+ active: (editor) => editor.isActive("orderedList"),
111
+ run: (chain) => chain.toggleOrderedList()
112
+ },
113
+ blockquote: {
114
+ label: "Quote",
115
+ icon: "heroChatBubbleLeft",
116
+ active: (editor) => editor.isActive("blockquote"),
117
+ run: (chain) => chain.toggleBlockquote()
118
+ },
119
+ codeBlock: {
120
+ label: "Code block",
121
+ icon: "heroCodeBracketSquare",
122
+ active: (editor) => editor.isActive("codeBlock"),
123
+ run: (chain) => chain.toggleCodeBlock()
124
+ },
125
+ horizontalRule: {
126
+ label: "Divider",
127
+ icon: "heroMinus",
128
+ run: (chain) => chain.setHorizontalRule()
129
+ },
130
+ undo: {
131
+ label: "Undo",
132
+ icon: "heroArrowUturnLeft",
133
+ run: (chain) => chain.undo()
134
+ },
135
+ redo: {
136
+ label: "Redo",
137
+ icon: "heroArrowUturnRight",
138
+ run: (chain) => chain.redo()
139
+ }
140
+ };
141
+ const LINK_TOOL = {
142
+ label: "Link",
143
+ icon: "heroLink",
144
+ active: (editor) => editor.isActive("link"),
145
+ run: (chain) => chain
146
+ };
147
+ let nextId = 0;
148
+ var UiRichTextEditorComponent = class UiRichTextEditorComponent {
149
+ value = model.required(...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
150
+ classes = input("", ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
151
+ tools = input(RichTextTools, ...ngDevMode ? [{ debugName: "tools" }] : /* istanbul ignore next */ []);
152
+ id = input("", ...ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []);
153
+ placeholder = input("", ...ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []);
154
+ required = input(false, {
155
+ ...ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {},
156
+ transform: booleanAttribute
157
+ });
158
+ disabled = input(false, {
159
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
160
+ transform: booleanAttribute
161
+ });
162
+ readonly = input(false, {
163
+ ...ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {},
164
+ transform: booleanAttribute
165
+ });
166
+ validationState = model(null, ...ngDevMode ? [{ debugName: "validationState" }] : /* istanbul ignore next */ []);
167
+ spellcheck = input(true, {
168
+ ...ngDevMode ? { debugName: "spellcheck" } : /* istanbul ignore next */ {},
169
+ transform: booleanAttribute
170
+ });
171
+ ariaLabel = input("", ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
172
+ describedBy = input("", ...ngDevMode ? [{ debugName: "describedBy" }] : /* istanbul ignore next */ []);
173
+ labelledBy = input("", ...ngDevMode ? [{ debugName: "labelledBy" }] : /* istanbul ignore next */ []);
174
+ focused = output();
175
+ blurred = output();
176
+ injector = inject(Injector);
177
+ field = inject(UiFieldComponent, { optional: true });
178
+ host = inject(ElementRef);
179
+ content = viewChild.required("content", ...ngDevMode ? [{ debugName: "content" }] : /* istanbul ignore next */ []);
180
+ editor = signal(null, ...ngDevMode ? [{ debugName: "editor" }] : /* istanbul ignore next */ []);
181
+ revision = signal(0, ...ngDevMode ? [{ debugName: "revision" }] : /* istanbul ignore next */ []);
182
+ lastHtml = null;
183
+ contentId = `ui-rich-text-editor-${nextId++}`;
184
+ linkInputId = `${this.contentId}-link`;
185
+ linkOpen = signal(false, ...ngDevMode ? [{ debugName: "linkOpen" }] : /* istanbul ignore next */ []);
186
+ linkHref = signal("", ...ngDevMode ? [{ debugName: "linkHref" }] : /* istanbul ignore next */ []);
187
+ focusIndex = signal(0, ...ngDevMode ? [{ debugName: "focusIndex" }] : /* istanbul ignore next */ []);
188
+ resolvedLabelledBy = computed(() => {
189
+ if (this.labelledBy()) return this.labelledBy();
190
+ const id = this.id();
191
+ return id && this.field?.for() === id ? this.field.labelId() : "";
192
+ }, ...ngDevMode ? [{ debugName: "resolvedLabelledBy" }] : /* istanbul ignore next */ []);
193
+ editable = computed(() => !this.disabled() && !this.readonly(), ...ngDevMode ? [{ debugName: "editable" }] : /* istanbul ignore next */ []);
194
+ toolGroups = computed(() => {
195
+ const tools = new Set(this.tools());
196
+ return RichTextToolGroups.map((group) => group.filter((tool) => tools.has(tool))).filter((group) => group.length > 0);
197
+ }, ...ngDevMode ? [{ debugName: "toolGroups" }] : /* istanbul ignore next */ []);
198
+ flatTools = computed(() => this.toolGroups().flat(), ...ngDevMode ? [{ debugName: "flatTools" }] : /* istanbul ignore next */ []);
199
+ showToolbar = computed(() => !this.readonly() && this.flatTools().length > 0, ...ngDevMode ? [{ debugName: "showToolbar" }] : /* istanbul ignore next */ []);
200
+ toolState = computed(() => {
201
+ this.revision();
202
+ const editor = this.editor();
203
+ const editable = this.editable();
204
+ const state = {};
205
+ for (const tool of this.flatTools()) {
206
+ const definition = this.toolDefinition(tool);
207
+ const runnable = tool === "undo" || tool === "redo" ? !!editor?.can()[tool]() : true;
208
+ state[tool] = {
209
+ active: !!editor && !!definition.active?.(editor),
210
+ enabled: !!editor && editable && runnable
211
+ };
212
+ }
213
+ return state;
214
+ }, ...ngDevMode ? [{ debugName: "toolState" }] : /* istanbul ignore next */ []);
215
+ generatedClasses = computed(() => ["ui-rich-text-editor", this.classes()].filter(Boolean).join(" "), ...ngDevMode ? [{ debugName: "generatedClasses" }] : /* istanbul ignore next */ []);
216
+ contentAttributes = computed(() => {
217
+ const attributes = {
218
+ id: this.id() || this.contentId,
219
+ class: "ui-rich-text-editor__content ui-text-body",
220
+ role: "textbox",
221
+ "aria-multiline": "true",
222
+ spellcheck: String(this.spellcheck())
223
+ };
224
+ const optional = {
225
+ "aria-label": this.ariaLabel(),
226
+ "aria-labelledby": this.resolvedLabelledBy(),
227
+ "aria-describedby": this.describedBy(),
228
+ "aria-required": this.required() && "true",
229
+ "aria-readonly": this.readonly() && "true",
230
+ "aria-disabled": this.disabled() && "true",
231
+ "aria-invalid": this.validationState() === false && "true"
232
+ };
233
+ for (const [name, value] of Object.entries(optional)) if (value) attributes[name] = value;
234
+ return attributes;
235
+ }, ...ngDevMode ? [{ debugName: "contentAttributes" }] : /* istanbul ignore next */ []);
236
+ extensions = computed(() => {
237
+ const tools = new Set(this.tools());
238
+ const on = (tool) => tools.has(tool) ? {} : false;
239
+ const levels = [
240
+ 1,
241
+ 2,
242
+ 3
243
+ ].filter((level) => tools.has(`heading${level}`));
244
+ return [StarterKit.configure({
245
+ bold: on("bold"),
246
+ italic: on("italic"),
247
+ underline: on("underline"),
248
+ strike: on("strike"),
249
+ code: on("code"),
250
+ heading: levels.length ? { levels: [...levels] } : false,
251
+ bulletList: on("bulletList"),
252
+ orderedList: on("orderedList"),
253
+ blockquote: on("blockquote"),
254
+ codeBlock: on("codeBlock"),
255
+ horizontalRule: on("horizontalRule"),
256
+ trailingNode: false,
257
+ link: tools.has("link") ? {
258
+ openOnClick: false,
259
+ autolink: true,
260
+ defaultProtocol: "https"
261
+ } : false
262
+ }), Placeholder.configure({ placeholder: () => this.placeholder() })];
263
+ }, ...ngDevMode ? [{ debugName: "extensions" }] : /* istanbul ignore next */ []);
264
+ constructor() {
265
+ afterRenderEffect(() => {
266
+ const extensions = this.extensions();
267
+ untracked(() => this.createEditor(extensions));
268
+ });
269
+ effect(() => {
270
+ this.editor()?.setEditable(this.editable(), false);
271
+ });
272
+ effect(() => {
273
+ this.editor()?.setOptions({ editorProps: { attributes: this.contentAttributes() } });
274
+ });
275
+ effect(() => {
276
+ const value = this.value();
277
+ const editor = this.editor();
278
+ if (editor && value !== this.lastHtml) {
279
+ this.lastHtml = value;
280
+ editor.commands.setContent(value, { emitUpdate: false });
281
+ }
282
+ });
283
+ inject(DestroyRef).onDestroy(() => this.editor()?.destroy());
284
+ }
285
+ toolDefinition(tool) {
286
+ return tool === "link" ? LINK_TOOL : TOOLS[tool];
287
+ }
288
+ runTool = (tool) => {
289
+ const editor = this.editor();
290
+ if (!editor || !this.toolState()[tool]?.enabled) return;
291
+ if (tool === "link") {
292
+ this.openLink();
293
+ return;
294
+ }
295
+ this.toolDefinition(tool).run(editor.chain().focus()).run();
296
+ };
297
+ onToolbarKeydown = (event) => {
298
+ const count = this.flatTools().length;
299
+ const current = this.focusIndex();
300
+ const next = {
301
+ ArrowRight: (current + 1) % count,
302
+ ArrowLeft: (current - 1 + count) % count,
303
+ Home: 0,
304
+ End: count - 1
305
+ }[event.key];
306
+ if (next === void 0) return;
307
+ event.preventDefault();
308
+ this.focusIndex.set(next);
309
+ this.host.nativeElement.querySelectorAll(".ui-rich-text-editor__tool")[next]?.focus();
310
+ };
311
+ openLink = () => {
312
+ const editor = this.editor();
313
+ if (!editor) return;
314
+ this.linkHref.set(editor.getAttributes("link")["href"] ?? "");
315
+ this.linkOpen.set(true);
316
+ afterNextRender(() => {
317
+ this.host.nativeElement.querySelector(`#${this.linkInputId}`)?.focus();
318
+ }, { injector: this.injector });
319
+ };
320
+ applyLink = () => {
321
+ const editor = this.editor();
322
+ const typed = this.linkHref().trim();
323
+ if (!editor) return;
324
+ if (!typed) {
325
+ this.removeLink();
326
+ return;
327
+ }
328
+ const href = /^([a-z][a-z\d+.-]*:|[/#?])/i.test(typed) ? typed : `https://${typed}`;
329
+ const chain = editor.chain().focus().extendMarkRange("link");
330
+ if (editor.state.selection.empty && !editor.isActive("link")) chain.insertContent({
331
+ type: "text",
332
+ text: href,
333
+ marks: [{
334
+ type: "link",
335
+ attrs: { href }
336
+ }]
337
+ });
338
+ else chain.setLink({ href });
339
+ chain.run();
340
+ this.linkOpen.set(false);
341
+ };
342
+ removeLink = () => {
343
+ this.editor()?.chain().focus().extendMarkRange("link").unsetLink().run();
344
+ this.linkOpen.set(false);
345
+ };
346
+ closeLink = () => {
347
+ this.linkOpen.set(false);
348
+ this.editor()?.commands.focus();
349
+ };
350
+ onLinkKeydown = (event) => {
351
+ if (event.key === "Enter") {
352
+ event.preventDefault();
353
+ this.applyLink();
354
+ } else if (event.key === "Escape") {
355
+ event.preventDefault();
356
+ this.closeLink();
357
+ }
358
+ };
359
+ createEditor(extensions) {
360
+ const previous = this.editor();
361
+ const content = previous ? this.htmlOf(previous) : this.value();
362
+ previous?.destroy();
363
+ const editor = new Editor({
364
+ element: this.content().nativeElement,
365
+ extensions,
366
+ content,
367
+ editable: this.editable(),
368
+ editorProps: { attributes: this.contentAttributes() },
369
+ onUpdate: ({ editor }) => {
370
+ this.lastHtml = this.htmlOf(editor);
371
+ this.value.set(this.lastHtml);
372
+ },
373
+ onTransaction: () => this.revision.update((revision) => revision + 1),
374
+ onFocus: ({ event }) => this.focused.emit(event),
375
+ onBlur: ({ event }) => this.blurred.emit(event)
376
+ });
377
+ this.lastHtml = content;
378
+ this.editor.set(editor);
379
+ if (previous && this.htmlOf(editor) !== content) {
380
+ this.lastHtml = this.htmlOf(editor);
381
+ this.value.set(this.lastHtml);
382
+ }
383
+ }
384
+ htmlOf(editor) {
385
+ return editor.isEmpty ? "" : editor.getHTML();
386
+ }
387
+ static ɵfac = i0.ɵɵngDeclareFactory({
388
+ minVersion: "12.0.0",
389
+ version: "22.2.1",
390
+ ngImport: i0,
391
+ type: UiRichTextEditorComponent,
392
+ deps: [],
393
+ target: i0.ɵɵFactoryTarget.Component
394
+ });
395
+ static ɵcmp = i0.ɵɵngDeclareComponent({
396
+ minVersion: "17.0.0",
397
+ version: "22.2.1",
398
+ type: UiRichTextEditorComponent,
399
+ isStandalone: true,
400
+ selector: "ui-rich-text-editor",
401
+ inputs: {
402
+ value: {
403
+ classPropertyName: "value",
404
+ publicName: "value",
405
+ isSignal: true,
406
+ isRequired: true,
407
+ transformFunction: null
408
+ },
409
+ classes: {
410
+ classPropertyName: "classes",
411
+ publicName: "classes",
412
+ isSignal: true,
413
+ isRequired: false,
414
+ transformFunction: null
415
+ },
416
+ tools: {
417
+ classPropertyName: "tools",
418
+ publicName: "tools",
419
+ isSignal: true,
420
+ isRequired: false,
421
+ transformFunction: null
422
+ },
423
+ id: {
424
+ classPropertyName: "id",
425
+ publicName: "id",
426
+ isSignal: true,
427
+ isRequired: false,
428
+ transformFunction: null
429
+ },
430
+ placeholder: {
431
+ classPropertyName: "placeholder",
432
+ publicName: "placeholder",
433
+ isSignal: true,
434
+ isRequired: false,
435
+ transformFunction: null
436
+ },
437
+ required: {
438
+ classPropertyName: "required",
439
+ publicName: "required",
440
+ isSignal: true,
441
+ isRequired: false,
442
+ transformFunction: null
443
+ },
444
+ disabled: {
445
+ classPropertyName: "disabled",
446
+ publicName: "disabled",
447
+ isSignal: true,
448
+ isRequired: false,
449
+ transformFunction: null
450
+ },
451
+ readonly: {
452
+ classPropertyName: "readonly",
453
+ publicName: "readonly",
454
+ isSignal: true,
455
+ isRequired: false,
456
+ transformFunction: null
457
+ },
458
+ validationState: {
459
+ classPropertyName: "validationState",
460
+ publicName: "validationState",
461
+ isSignal: true,
462
+ isRequired: false,
463
+ transformFunction: null
464
+ },
465
+ spellcheck: {
466
+ classPropertyName: "spellcheck",
467
+ publicName: "spellcheck",
468
+ isSignal: true,
469
+ isRequired: false,
470
+ transformFunction: null
471
+ },
472
+ ariaLabel: {
473
+ classPropertyName: "ariaLabel",
474
+ publicName: "ariaLabel",
475
+ isSignal: true,
476
+ isRequired: false,
477
+ transformFunction: null
478
+ },
479
+ describedBy: {
480
+ classPropertyName: "describedBy",
481
+ publicName: "describedBy",
482
+ isSignal: true,
483
+ isRequired: false,
484
+ transformFunction: null
485
+ },
486
+ labelledBy: {
487
+ classPropertyName: "labelledBy",
488
+ publicName: "labelledBy",
489
+ isSignal: true,
490
+ isRequired: false,
491
+ transformFunction: null
492
+ }
493
+ },
494
+ outputs: {
495
+ value: "valueChange",
496
+ validationState: "validationStateChange",
497
+ focused: "focused",
498
+ blurred: "blurred"
499
+ },
500
+ host: {
501
+ properties: { "attr.id": "null" },
502
+ classAttribute: "ui-rich-text-editor-host"
503
+ },
504
+ providers: [provideIcons({
505
+ heroArrowUturnLeft,
506
+ heroArrowUturnRight,
507
+ heroBold,
508
+ heroChatBubbleLeft,
509
+ heroCodeBracket,
510
+ heroCodeBracketSquare,
511
+ heroH1,
512
+ heroH2,
513
+ heroH3,
514
+ heroItalic,
515
+ heroLink,
516
+ heroListBullet,
517
+ heroMinus,
518
+ heroNumberedList,
519
+ heroStrikethrough,
520
+ heroUnderline
521
+ })],
522
+ viewQueries: [{
523
+ propertyName: "content",
524
+ first: true,
525
+ predicate: ["content"],
526
+ descendants: true,
527
+ isSignal: true
528
+ }],
529
+ ngImport: i0,
530
+ template: "<div\n [class]=\"generatedClasses()\"\n [attr.data-invalid]=\"validationState() === false ? '' : null\"\n [attr.data-valid]=\"validationState() === true ? '' : null\"\n [attr.data-disabled]=\"disabled() ? '' : null\"\n>\n @if (showToolbar()) {\n <div\n class=\"ui-rich-text-editor__toolbar\"\n role=\"toolbar\"\n tabindex=\"-1\"\n aria-label=\"Formatting\"\n [attr.aria-controls]=\"id() || contentId\"\n (keydown)=\"onToolbarKeydown($event)\"\n >\n @for (group of toolGroups(); track group[0]) {\n @if (!$first) {\n <span\n class=\"ui-rich-text-editor__divider\"\n role=\"separator\"\n aria-orientation=\"vertical\"\n ></span>\n }\n\n @for (tool of group; track tool) {\n @let definition = toolDefinition(tool);\n @let state = toolState()[tool];\n\n <button\n type=\"button\"\n class=\"ui-rich-text-editor__tool\"\n [title]=\"definition.label\"\n [attr.aria-label]=\"definition.label\"\n [attr.aria-pressed]=\"definition.active ? state.active : null\"\n [attr.aria-disabled]=\"state.enabled ? null : 'true'\"\n [attr.data-active]=\"state.active ? '' : null\"\n [tabIndex]=\"flatTools().indexOf(tool) === focusIndex() ? 0 : -1\"\n (mousedown)=\"$event.preventDefault()\"\n (focus)=\"focusIndex.set(flatTools().indexOf(tool))\"\n (click)=\"runTool(tool)\"\n >\n <ng-icon [name]=\"definition.icon\" aria-hidden=\"true\" />\n </button>\n }\n }\n </div>\n }\n\n @if (linkOpen()) {\n <div\n class=\"ui-rich-text-editor__link\"\n tabindex=\"-1\"\n (keydown)=\"onLinkKeydown($event)\"\n >\n <ui-input\n class=\"ui-rich-text-editor__link-input\"\n type=\"url\"\n placeholder=\"https://\"\n ariaLabel=\"Link address\"\n [id]=\"linkInputId\"\n [(value)]=\"linkHref\"\n />\n\n <ui-button size=\"sm\" (click)=\"applyLink()\">Apply</ui-button>\n\n @if (toolState()['link']?.active) {\n <ui-button\n size=\"sm\"\n appearance=\"ghost\"\n intent=\"danger\"\n (click)=\"removeLink()\"\n >\n Remove\n </ui-button>\n }\n\n <ui-button\n size=\"sm\"\n appearance=\"ghost\"\n intent=\"secondary\"\n (click)=\"closeLink()\"\n >\n Cancel\n </ui-button>\n </div>\n }\n\n <div #content class=\"ui-rich-text-editor__body\"></div>\n</div>\n",
531
+ styles: ["@layer properties;@layer components{.ui-rich-text-editor-host{width:100%}}.ui-rich-text-editor-host{display:block}.ui-rich-text-editor{display:flex;flex-direction:column;overflow:hidden;border-radius:var(--radius-md, .375rem);border-style:var(--tw-border-style);border-width:1px;border-color:var(--border-line-2);background-color:var(--layer)}.ui-rich-text-editor:focus-within{border-color:var(--primary-focus)}.ui-rich-text-editor:focus-within{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ui-rich-text-editor:focus-within{--tw-ring-color: color-mix(in srgb, oklch(88.2% .059 254.128) 50%, transparent)}@supports (color: color-mix(in lab,red,red)){.ui-rich-text-editor:focus-within{--tw-ring-color: color-mix(in oklab, var(--color-primary-200, var(--color-blue-200)) 50%, transparent)}}.ui-rich-text-editor[data-disabled]{opacity:50%}.ui-rich-text-editor[data-invalid]{border-color:var(--color-danger-500, var(--color-red-500))}.ui-rich-text-editor[data-invalid]:focus-within{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ui-rich-text-editor[data-invalid]:focus-within{--tw-ring-color: color-mix(in srgb, oklch(88.5% .062 18.334) 50%, transparent)}@supports (color: color-mix(in lab,red,red)){.ui-rich-text-editor[data-invalid]:focus-within{--tw-ring-color: color-mix(in oklab, var(--color-danger-200, var(--color-red-200)) 50%, transparent)}}.ui-rich-text-editor[data-valid]{border-color:var(--color-success-500, var(--color-teal-500))}.ui-rich-text-editor[data-valid]:focus-within{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ui-rich-text-editor[data-valid]:focus-within{--tw-ring-color: color-mix(in srgb, oklch(91% .096 180.426) 50%, transparent)}@supports (color: color-mix(in lab,red,red)){.ui-rich-text-editor[data-valid]:focus-within{--tw-ring-color: color-mix(in oklab, var(--color-success-200, var(--color-teal-200)) 50%, transparent)}}.ui-rich-text-editor__toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:calc(var(--spacing, .25rem) * .5);border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--border-line-2);padding:var(--spacing, .25rem)}.ui-rich-text-editor__divider{margin-inline:var(--spacing, .25rem);height:calc(var(--spacing, .25rem) * 5);width:1px;background-color:var(--border-line-2)}.ui-rich-text-editor__tool{display:inline-flex;width:calc(var(--spacing, .25rem) * 8);height:calc(var(--spacing, .25rem) * 8);align-items:center;justify-content:center;border-radius:var(--radius-md, .375rem);color:var(--muted-foreground-1)}.ui-rich-text-editor__tool:hover{background-color:var(--layer-hover)}.ui-rich-text-editor__tool:hover{color:var(--foreground)}.ui-rich-text-editor__tool:focus{--tw-outline-style: none;outline-style:none}.ui-rich-text-editor__tool:focus-visible{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ui-rich-text-editor__tool:focus-visible{--tw-ring-color: color-mix(in srgb, oklch(88.2% .059 254.128) 50%, transparent)}@supports (color: color-mix(in lab,red,red)){.ui-rich-text-editor__tool:focus-visible{--tw-ring-color: color-mix(in oklab, var(--color-primary-200, var(--color-blue-200)) 50%, transparent)}}.ui-rich-text-editor__tool[data-active]{background-color:var(--color-primary-100, var(--color-blue-100));color:var(--color-primary-700, var(--color-blue-700))}.ui-rich-text-editor__tool[data-active]:where(.dark,.dark *){background-color:color-mix(in srgb,oklch(37.9% .146 265.522) 50%,transparent)}@supports (color: color-mix(in lab,red,red)){.ui-rich-text-editor__tool[data-active]:where(.dark,.dark *){background-color:color-mix(in oklab,var(--color-primary-900, var(--color-blue-900)) 50%,transparent)}}.ui-rich-text-editor__tool[data-active]:where(.dark,.dark *){color:var(--color-primary-300, var(--color-blue-300))}.ui-rich-text-editor__tool[aria-disabled]{pointer-events:none;opacity:40%}.ui-rich-text-editor__link{display:flex;align-items:center;gap:calc(var(--spacing, .25rem) * 2);border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--border-line-2);padding:calc(var(--spacing, .25rem) * 2)}.ui-rich-text-editor__link-input{height:calc(var(--spacing, .25rem) * 9);flex:1}.ui-rich-text-editor__body{max-height:32rem;min-height:calc(var(--spacing, .25rem) * 32);overflow-y:auto}.ui-rich-text-editor__content{min-height:calc(var(--spacing, .25rem) * 32);padding:calc(var(--spacing, .25rem) * 3);color:var(--foreground)}.ui-rich-text-editor__content:focus{--tw-outline-style: none;outline-style:none}.ui-rich-text-editor__content>*+*{margin-top:calc(var(--spacing, .25rem) * 3)}.ui-rich-text-editor__content h1{font-size:var(--text-2xl, 1.5rem);line-height:var(--tw-leading, var(--text-2xl--line-height, calc(2 / 1.5)));--tw-font-weight: var(--font-weight-semibold, 600);font-weight:var(--font-weight-semibold, 600)}.ui-rich-text-editor__content h2{font-size:var(--text-xl, 1.25rem);line-height:var(--tw-leading, var(--text-xl--line-height, calc(1.75 / 1.25)));--tw-font-weight: var(--font-weight-semibold, 600);font-weight:var(--font-weight-semibold, 600)}.ui-rich-text-editor__content h3{font-size:var(--text-lg, 1.125rem);line-height:var(--tw-leading, var(--text-lg--line-height, calc(1.75 / 1.125)));--tw-font-weight: var(--font-weight-semibold, 600);font-weight:var(--font-weight-semibold, 600)}.ui-rich-text-editor__content ul{list-style-type:disc;padding-inline-start:calc(var(--spacing, .25rem) * 6)}.ui-rich-text-editor__content ol{list-style-type:decimal;padding-inline-start:calc(var(--spacing, .25rem) * 6)}.ui-rich-text-editor__content li>p{margin-block:calc(var(--spacing, .25rem) * .5)}.ui-rich-text-editor__content blockquote{border-inline-start-style:var(--tw-border-style);border-inline-start-width:4px;border-color:var(--border-line-3);padding-inline-start:calc(var(--spacing, .25rem) * 4);color:var(--muted-foreground-1)}.ui-rich-text-editor__content code{border-radius:.25rem;background-color:var(--muted);padding-inline:var(--spacing, .25rem);padding-block:calc(var(--spacing, .25rem) * .5);font-family:var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace);font-size:.875em}.ui-rich-text-editor__content pre{overflow-x:auto;border-radius:var(--radius-md, .375rem);background-color:var(--muted);padding:calc(var(--spacing, .25rem) * 3);font-family:var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace);font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)))}.ui-rich-text-editor__content pre code{background-color:transparent;padding:0;color:inherit}.ui-rich-text-editor__content hr{border-color:var(--border-line-2)}.ui-rich-text-editor__content hr.ProseMirror-selectednode{border-color:var(--color-primary-500, var(--color-blue-500))}.ui-rich-text-editor__content a{color:var(--color-primary-600, var(--color-blue-600));text-decoration-line:underline}.ui-rich-text-editor__content a:where(.dark,.dark *){color:var(--color-primary-400, var(--color-blue-400))}.ui-rich-text-editor__content p.is-editor-empty:first-child:before{pointer-events:none;float:inline-start;height:0px;color:var(--muted-foreground-2);content:attr(data-placeholder)}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-inset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-inset-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-ring-color{syntax: \"*\"; inherits: false;}@property --tw-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-ring-color{syntax: \"*\"; inherits: false;}@property --tw-inset-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-ring-inset{syntax: \"*\"; inherits: false;}@property --tw-ring-offset-width{syntax: \"<length>\"; inherits: false; initial-value: 0px;}@property --tw-ring-offset-color{syntax: \"*\"; inherits: false; initial-value: #fff;}@property --tw-ring-offset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid;--tw-shadow: 0 0 #0000;--tw-shadow-color: initial;--tw-shadow-alpha: 100%;--tw-inset-shadow: 0 0 #0000;--tw-inset-shadow-color: initial;--tw-inset-shadow-alpha: 100%;--tw-ring-color: initial;--tw-ring-shadow: 0 0 #0000;--tw-inset-ring-color: initial;--tw-inset-ring-shadow: 0 0 #0000;--tw-ring-inset: initial;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-offset-shadow: 0 0 #0000;--tw-font-weight: initial}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"],
532
+ dependencies: [
533
+ {
534
+ kind: "component",
535
+ type: NgIcon,
536
+ selector: "ng-icon",
537
+ inputs: [
538
+ "name",
539
+ "svg",
540
+ "size",
541
+ "strokeWidth",
542
+ "color"
543
+ ]
544
+ },
545
+ {
546
+ kind: "component",
547
+ type: UiButtonComponent,
548
+ selector: "ui-button",
549
+ inputs: [
550
+ "appearance",
551
+ "intent",
552
+ "size",
553
+ "classes",
554
+ "type",
555
+ "ariaLabel",
556
+ "disabled",
557
+ "loading"
558
+ ]
559
+ },
560
+ {
561
+ kind: "component",
562
+ type: UiInputComponent,
563
+ selector: "ui-input",
564
+ inputs: [
565
+ "value",
566
+ "classes",
567
+ "type",
568
+ "id",
569
+ "name",
570
+ "placeholder",
571
+ "autocomplete",
572
+ "inputmode",
573
+ "required",
574
+ "disabled",
575
+ "readonly",
576
+ "validationState",
577
+ "min",
578
+ "max",
579
+ "step",
580
+ "pattern",
581
+ "minlength",
582
+ "maxlength",
583
+ "autofocus",
584
+ "spellcheck",
585
+ "revealable",
586
+ "list",
587
+ "ariaLabel",
588
+ "describedBy",
589
+ "inputRole",
590
+ "ariaExpanded",
591
+ "ariaControls",
592
+ "ariaActiveDescendant",
593
+ "ariaAutocomplete",
594
+ "ariaHasPopup"
595
+ ],
596
+ outputs: [
597
+ "valueChange",
598
+ "validationStateChange",
599
+ "focused",
600
+ "blurred"
601
+ ]
602
+ }
603
+ ],
604
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
605
+ encapsulation: i0.ViewEncapsulation.None
606
+ });
607
+ };
608
+ i0.ɵɵngDeclareClassMetadata({
609
+ minVersion: "12.0.0",
610
+ version: "22.2.1",
611
+ ngImport: i0,
612
+ type: UiRichTextEditorComponent,
613
+ decorators: [{
614
+ type: Component,
615
+ args: [{
616
+ selector: "ui-rich-text-editor",
617
+ changeDetection: ChangeDetectionStrategy.OnPush,
618
+ encapsulation: ViewEncapsulation.None,
619
+ imports: [
620
+ NgIcon,
621
+ UiButtonComponent,
622
+ UiInputComponent
623
+ ],
624
+ providers: [provideIcons({
625
+ heroArrowUturnLeft,
626
+ heroArrowUturnRight,
627
+ heroBold,
628
+ heroChatBubbleLeft,
629
+ heroCodeBracket,
630
+ heroCodeBracketSquare,
631
+ heroH1,
632
+ heroH2,
633
+ heroH3,
634
+ heroItalic,
635
+ heroLink,
636
+ heroListBullet,
637
+ heroMinus,
638
+ heroNumberedList,
639
+ heroStrikethrough,
640
+ heroUnderline
641
+ })],
642
+ host: {
643
+ class: "ui-rich-text-editor-host",
644
+ "[attr.id]": "null"
645
+ },
646
+ template: "<div\n [class]=\"generatedClasses()\"\n [attr.data-invalid]=\"validationState() === false ? '' : null\"\n [attr.data-valid]=\"validationState() === true ? '' : null\"\n [attr.data-disabled]=\"disabled() ? '' : null\"\n>\n @if (showToolbar()) {\n <div\n class=\"ui-rich-text-editor__toolbar\"\n role=\"toolbar\"\n tabindex=\"-1\"\n aria-label=\"Formatting\"\n [attr.aria-controls]=\"id() || contentId\"\n (keydown)=\"onToolbarKeydown($event)\"\n >\n @for (group of toolGroups(); track group[0]) {\n @if (!$first) {\n <span\n class=\"ui-rich-text-editor__divider\"\n role=\"separator\"\n aria-orientation=\"vertical\"\n ></span>\n }\n\n @for (tool of group; track tool) {\n @let definition = toolDefinition(tool);\n @let state = toolState()[tool];\n\n <button\n type=\"button\"\n class=\"ui-rich-text-editor__tool\"\n [title]=\"definition.label\"\n [attr.aria-label]=\"definition.label\"\n [attr.aria-pressed]=\"definition.active ? state.active : null\"\n [attr.aria-disabled]=\"state.enabled ? null : 'true'\"\n [attr.data-active]=\"state.active ? '' : null\"\n [tabIndex]=\"flatTools().indexOf(tool) === focusIndex() ? 0 : -1\"\n (mousedown)=\"$event.preventDefault()\"\n (focus)=\"focusIndex.set(flatTools().indexOf(tool))\"\n (click)=\"runTool(tool)\"\n >\n <ng-icon [name]=\"definition.icon\" aria-hidden=\"true\" />\n </button>\n }\n }\n </div>\n }\n\n @if (linkOpen()) {\n <div\n class=\"ui-rich-text-editor__link\"\n tabindex=\"-1\"\n (keydown)=\"onLinkKeydown($event)\"\n >\n <ui-input\n class=\"ui-rich-text-editor__link-input\"\n type=\"url\"\n placeholder=\"https://\"\n ariaLabel=\"Link address\"\n [id]=\"linkInputId\"\n [(value)]=\"linkHref\"\n />\n\n <ui-button size=\"sm\" (click)=\"applyLink()\">Apply</ui-button>\n\n @if (toolState()['link']?.active) {\n <ui-button\n size=\"sm\"\n appearance=\"ghost\"\n intent=\"danger\"\n (click)=\"removeLink()\"\n >\n Remove\n </ui-button>\n }\n\n <ui-button\n size=\"sm\"\n appearance=\"ghost\"\n intent=\"secondary\"\n (click)=\"closeLink()\"\n >\n Cancel\n </ui-button>\n </div>\n }\n\n <div #content class=\"ui-rich-text-editor__body\"></div>\n</div>\n",
647
+ styles: ["@layer properties;@layer components{.ui-rich-text-editor-host{width:100%}}.ui-rich-text-editor-host{display:block}.ui-rich-text-editor{display:flex;flex-direction:column;overflow:hidden;border-radius:var(--radius-md, .375rem);border-style:var(--tw-border-style);border-width:1px;border-color:var(--border-line-2);background-color:var(--layer)}.ui-rich-text-editor:focus-within{border-color:var(--primary-focus)}.ui-rich-text-editor:focus-within{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ui-rich-text-editor:focus-within{--tw-ring-color: color-mix(in srgb, oklch(88.2% .059 254.128) 50%, transparent)}@supports (color: color-mix(in lab,red,red)){.ui-rich-text-editor:focus-within{--tw-ring-color: color-mix(in oklab, var(--color-primary-200, var(--color-blue-200)) 50%, transparent)}}.ui-rich-text-editor[data-disabled]{opacity:50%}.ui-rich-text-editor[data-invalid]{border-color:var(--color-danger-500, var(--color-red-500))}.ui-rich-text-editor[data-invalid]:focus-within{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ui-rich-text-editor[data-invalid]:focus-within{--tw-ring-color: color-mix(in srgb, oklch(88.5% .062 18.334) 50%, transparent)}@supports (color: color-mix(in lab,red,red)){.ui-rich-text-editor[data-invalid]:focus-within{--tw-ring-color: color-mix(in oklab, var(--color-danger-200, var(--color-red-200)) 50%, transparent)}}.ui-rich-text-editor[data-valid]{border-color:var(--color-success-500, var(--color-teal-500))}.ui-rich-text-editor[data-valid]:focus-within{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ui-rich-text-editor[data-valid]:focus-within{--tw-ring-color: color-mix(in srgb, oklch(91% .096 180.426) 50%, transparent)}@supports (color: color-mix(in lab,red,red)){.ui-rich-text-editor[data-valid]:focus-within{--tw-ring-color: color-mix(in oklab, var(--color-success-200, var(--color-teal-200)) 50%, transparent)}}.ui-rich-text-editor__toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:calc(var(--spacing, .25rem) * .5);border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--border-line-2);padding:var(--spacing, .25rem)}.ui-rich-text-editor__divider{margin-inline:var(--spacing, .25rem);height:calc(var(--spacing, .25rem) * 5);width:1px;background-color:var(--border-line-2)}.ui-rich-text-editor__tool{display:inline-flex;width:calc(var(--spacing, .25rem) * 8);height:calc(var(--spacing, .25rem) * 8);align-items:center;justify-content:center;border-radius:var(--radius-md, .375rem);color:var(--muted-foreground-1)}.ui-rich-text-editor__tool:hover{background-color:var(--layer-hover)}.ui-rich-text-editor__tool:hover{color:var(--foreground)}.ui-rich-text-editor__tool:focus{--tw-outline-style: none;outline-style:none}.ui-rich-text-editor__tool:focus-visible{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ui-rich-text-editor__tool:focus-visible{--tw-ring-color: color-mix(in srgb, oklch(88.2% .059 254.128) 50%, transparent)}@supports (color: color-mix(in lab,red,red)){.ui-rich-text-editor__tool:focus-visible{--tw-ring-color: color-mix(in oklab, var(--color-primary-200, var(--color-blue-200)) 50%, transparent)}}.ui-rich-text-editor__tool[data-active]{background-color:var(--color-primary-100, var(--color-blue-100));color:var(--color-primary-700, var(--color-blue-700))}.ui-rich-text-editor__tool[data-active]:where(.dark,.dark *){background-color:color-mix(in srgb,oklch(37.9% .146 265.522) 50%,transparent)}@supports (color: color-mix(in lab,red,red)){.ui-rich-text-editor__tool[data-active]:where(.dark,.dark *){background-color:color-mix(in oklab,var(--color-primary-900, var(--color-blue-900)) 50%,transparent)}}.ui-rich-text-editor__tool[data-active]:where(.dark,.dark *){color:var(--color-primary-300, var(--color-blue-300))}.ui-rich-text-editor__tool[aria-disabled]{pointer-events:none;opacity:40%}.ui-rich-text-editor__link{display:flex;align-items:center;gap:calc(var(--spacing, .25rem) * 2);border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--border-line-2);padding:calc(var(--spacing, .25rem) * 2)}.ui-rich-text-editor__link-input{height:calc(var(--spacing, .25rem) * 9);flex:1}.ui-rich-text-editor__body{max-height:32rem;min-height:calc(var(--spacing, .25rem) * 32);overflow-y:auto}.ui-rich-text-editor__content{min-height:calc(var(--spacing, .25rem) * 32);padding:calc(var(--spacing, .25rem) * 3);color:var(--foreground)}.ui-rich-text-editor__content:focus{--tw-outline-style: none;outline-style:none}.ui-rich-text-editor__content>*+*{margin-top:calc(var(--spacing, .25rem) * 3)}.ui-rich-text-editor__content h1{font-size:var(--text-2xl, 1.5rem);line-height:var(--tw-leading, var(--text-2xl--line-height, calc(2 / 1.5)));--tw-font-weight: var(--font-weight-semibold, 600);font-weight:var(--font-weight-semibold, 600)}.ui-rich-text-editor__content h2{font-size:var(--text-xl, 1.25rem);line-height:var(--tw-leading, var(--text-xl--line-height, calc(1.75 / 1.25)));--tw-font-weight: var(--font-weight-semibold, 600);font-weight:var(--font-weight-semibold, 600)}.ui-rich-text-editor__content h3{font-size:var(--text-lg, 1.125rem);line-height:var(--tw-leading, var(--text-lg--line-height, calc(1.75 / 1.125)));--tw-font-weight: var(--font-weight-semibold, 600);font-weight:var(--font-weight-semibold, 600)}.ui-rich-text-editor__content ul{list-style-type:disc;padding-inline-start:calc(var(--spacing, .25rem) * 6)}.ui-rich-text-editor__content ol{list-style-type:decimal;padding-inline-start:calc(var(--spacing, .25rem) * 6)}.ui-rich-text-editor__content li>p{margin-block:calc(var(--spacing, .25rem) * .5)}.ui-rich-text-editor__content blockquote{border-inline-start-style:var(--tw-border-style);border-inline-start-width:4px;border-color:var(--border-line-3);padding-inline-start:calc(var(--spacing, .25rem) * 4);color:var(--muted-foreground-1)}.ui-rich-text-editor__content code{border-radius:.25rem;background-color:var(--muted);padding-inline:var(--spacing, .25rem);padding-block:calc(var(--spacing, .25rem) * .5);font-family:var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace);font-size:.875em}.ui-rich-text-editor__content pre{overflow-x:auto;border-radius:var(--radius-md, .375rem);background-color:var(--muted);padding:calc(var(--spacing, .25rem) * 3);font-family:var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace);font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)))}.ui-rich-text-editor__content pre code{background-color:transparent;padding:0;color:inherit}.ui-rich-text-editor__content hr{border-color:var(--border-line-2)}.ui-rich-text-editor__content hr.ProseMirror-selectednode{border-color:var(--color-primary-500, var(--color-blue-500))}.ui-rich-text-editor__content a{color:var(--color-primary-600, var(--color-blue-600));text-decoration-line:underline}.ui-rich-text-editor__content a:where(.dark,.dark *){color:var(--color-primary-400, var(--color-blue-400))}.ui-rich-text-editor__content p.is-editor-empty:first-child:before{pointer-events:none;float:inline-start;height:0px;color:var(--muted-foreground-2);content:attr(data-placeholder)}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-inset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-inset-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-ring-color{syntax: \"*\"; inherits: false;}@property --tw-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-ring-color{syntax: \"*\"; inherits: false;}@property --tw-inset-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-ring-inset{syntax: \"*\"; inherits: false;}@property --tw-ring-offset-width{syntax: \"<length>\"; inherits: false; initial-value: 0px;}@property --tw-ring-offset-color{syntax: \"*\"; inherits: false; initial-value: #fff;}@property --tw-ring-offset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid;--tw-shadow: 0 0 #0000;--tw-shadow-color: initial;--tw-shadow-alpha: 100%;--tw-inset-shadow: 0 0 #0000;--tw-inset-shadow-color: initial;--tw-inset-shadow-alpha: 100%;--tw-ring-color: initial;--tw-ring-shadow: 0 0 #0000;--tw-inset-ring-color: initial;--tw-inset-ring-shadow: 0 0 #0000;--tw-ring-inset: initial;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-offset-shadow: 0 0 #0000;--tw-font-weight: initial}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
648
+ }]
649
+ }],
650
+ ctorParameters: () => [],
651
+ propDecorators: {
652
+ value: [{
653
+ type: i0.Input,
654
+ args: [{
655
+ isSignal: true,
656
+ alias: "value",
657
+ required: true
658
+ }]
659
+ }, {
660
+ type: i0.Output,
661
+ args: ["valueChange"]
662
+ }],
663
+ classes: [{
664
+ type: i0.Input,
665
+ args: [{
666
+ isSignal: true,
667
+ alias: "classes",
668
+ required: false
669
+ }]
670
+ }],
671
+ tools: [{
672
+ type: i0.Input,
673
+ args: [{
674
+ isSignal: true,
675
+ alias: "tools",
676
+ required: false
677
+ }]
678
+ }],
679
+ id: [{
680
+ type: i0.Input,
681
+ args: [{
682
+ isSignal: true,
683
+ alias: "id",
684
+ required: false
685
+ }]
686
+ }],
687
+ placeholder: [{
688
+ type: i0.Input,
689
+ args: [{
690
+ isSignal: true,
691
+ alias: "placeholder",
692
+ required: false
693
+ }]
694
+ }],
695
+ required: [{
696
+ type: i0.Input,
697
+ args: [{
698
+ isSignal: true,
699
+ alias: "required",
700
+ required: false
701
+ }]
702
+ }],
703
+ disabled: [{
704
+ type: i0.Input,
705
+ args: [{
706
+ isSignal: true,
707
+ alias: "disabled",
708
+ required: false
709
+ }]
710
+ }],
711
+ readonly: [{
712
+ type: i0.Input,
713
+ args: [{
714
+ isSignal: true,
715
+ alias: "readonly",
716
+ required: false
717
+ }]
718
+ }],
719
+ validationState: [{
720
+ type: i0.Input,
721
+ args: [{
722
+ isSignal: true,
723
+ alias: "validationState",
724
+ required: false
725
+ }]
726
+ }, {
727
+ type: i0.Output,
728
+ args: ["validationStateChange"]
729
+ }],
730
+ spellcheck: [{
731
+ type: i0.Input,
732
+ args: [{
733
+ isSignal: true,
734
+ alias: "spellcheck",
735
+ required: false
736
+ }]
737
+ }],
738
+ ariaLabel: [{
739
+ type: i0.Input,
740
+ args: [{
741
+ isSignal: true,
742
+ alias: "ariaLabel",
743
+ required: false
744
+ }]
745
+ }],
746
+ describedBy: [{
747
+ type: i0.Input,
748
+ args: [{
749
+ isSignal: true,
750
+ alias: "describedBy",
751
+ required: false
752
+ }]
753
+ }],
754
+ labelledBy: [{
755
+ type: i0.Input,
756
+ args: [{
757
+ isSignal: true,
758
+ alias: "labelledBy",
759
+ required: false
760
+ }]
761
+ }],
762
+ focused: [{
763
+ type: i0.Output,
764
+ args: ["focused"]
765
+ }],
766
+ blurred: [{
767
+ type: i0.Output,
768
+ args: ["blurred"]
769
+ }],
770
+ content: [{
771
+ type: i0.ViewChild,
772
+ args: ["content", { isSignal: true }]
773
+ }]
774
+ }
775
+ });
776
+ export { RichTextToolGroups, RichTextTools, UiRichTextEditorComponent };
777
+
778
+ //# sourceMappingURL=area8975-ui-rich-text-editor.mjs.map