frappe-ui 1.0.2 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (194) hide show
  1. package/experimental/Calendar/CalendarEventRow.vue +0 -4
  2. package/experimental/Calendar/calendarUtils.ts +33 -21
  3. package/experimental/CommandPalette/CommandPaletteItem.vue +9 -1
  4. package/experimental/MultiEmailInput/MultiEmailInput.vue +64 -12
  5. package/experimental/MultiEmailInput/types.ts +12 -3
  6. package/experimental/SpriteIcons/IconPicker.vue +2 -1
  7. package/experimental/Stepper/StepIndicator.vue +129 -0
  8. package/experimental/Stepper/Stepper.api.md +117 -0
  9. package/experimental/Stepper/Stepper.md +95 -0
  10. package/experimental/Stepper/Stepper.vue +82 -0
  11. package/experimental/Stepper/StepperHorizontal.vue +93 -0
  12. package/experimental/Stepper/StepperVertical.vue +291 -0
  13. package/experimental/Stepper/index.ts +11 -0
  14. package/experimental/Stepper/resolve.ts +87 -0
  15. package/experimental/Stepper/types.ts +89 -0
  16. package/experimental.ts +2 -21
  17. package/package.json +1 -3
  18. package/src/charts/CalendarHeatmapChart.vue +353 -0
  19. package/src/charts/DonutChart.vue +34 -58
  20. package/src/charts/HeatmapChart.vue +26 -64
  21. package/src/charts/NumberCard.vue +62 -7
  22. package/src/charts/PercentageBarChart.vue +243 -0
  23. package/src/charts/SankeyChart.vue +14 -11
  24. package/src/charts/ScatterChart.vue +24 -20
  25. package/src/charts/axisChartCommon.ts +182 -18
  26. package/src/charts/axisFormat.ts +8 -3
  27. package/src/charts/calendarHeatmapOptions.ts +604 -0
  28. package/src/charts/colorMath.ts +26 -0
  29. package/src/charts/components/ChartContainer.vue +63 -53
  30. package/src/charts/components/ChartLegend.vue +216 -24
  31. package/src/charts/components/ChartScale.vue +85 -0
  32. package/src/charts/core/dataLabelFit.ts +45 -6
  33. package/src/charts/core/useAxisChart.ts +36 -19
  34. package/src/charts/core/useChart.ts +6 -1
  35. package/src/charts/core/usePlotKeyboard.ts +13 -2
  36. package/src/charts/docs/BarChart.md +11 -3
  37. package/src/charts/docs/CalendarHeatmapChart.api.md +165 -0
  38. package/src/charts/docs/CalendarHeatmapChart.md +33 -0
  39. package/src/charts/docs/ChartContainer.api.md +6 -0
  40. package/src/charts/docs/ChartLegend.api.md +1 -1
  41. package/src/charts/docs/ChartLegend.md +25 -3
  42. package/src/charts/docs/DonutChart.api.md +12 -0
  43. package/src/charts/docs/DonutChart.md +17 -0
  44. package/src/charts/docs/HeatmapChart.api.md +1 -1
  45. package/src/charts/docs/LineChart.md +5 -3
  46. package/src/charts/docs/NumberCard.api.md +6 -0
  47. package/src/charts/docs/NumberCard.md +6 -0
  48. package/src/charts/docs/Overview.md +13 -6
  49. package/src/charts/docs/PercentageBarChart.api.md +148 -0
  50. package/src/charts/docs/PercentageBarChart.md +42 -0
  51. package/src/charts/docs/ScatterChart.md +2 -3
  52. package/src/charts/donutChartOptions.ts +22 -130
  53. package/src/charts/format.ts +4 -1
  54. package/src/charts/heatmapOptions.ts +17 -12
  55. package/src/charts/hiddenSeries.ts +8 -3
  56. package/src/charts/index.ts +12 -0
  57. package/src/charts/legendOverflow.ts +40 -0
  58. package/src/charts/numberCardFormat.ts +19 -13
  59. package/src/charts/referenceLines.ts +2 -1
  60. package/src/charts/scatterOptions.ts +16 -3
  61. package/src/charts/seriesData.ts +8 -3
  62. package/src/charts/slices.ts +228 -0
  63. package/src/charts/tokens.ts +99 -0
  64. package/src/charts/types.ts +318 -9
  65. package/src/components/Avatar/Avatar.md +27 -2
  66. package/src/components/Avatar/Avatar.vue +29 -12
  67. package/src/components/Breadcrumbs/Breadcrumbs.vue +2 -1
  68. package/src/components/Combobox/Combobox.vue +9 -2
  69. package/src/components/Combobox/ComboboxResults.vue +6 -1
  70. package/src/components/Combobox/utils.ts +2 -1
  71. package/src/components/DatePicker/DatePicker.md +7 -0
  72. package/src/components/DatePicker/DatePicker.vue +6 -0
  73. package/src/components/DatePicker/DateTimePicker.vue +6 -0
  74. package/src/components/DatePicker/composables.ts +18 -1
  75. package/src/components/DatePicker/utils.ts +53 -0
  76. package/src/components/Dialog/Dialog.md +3 -1
  77. package/src/components/Duration/Duration.api.md +16 -3
  78. package/src/components/Duration/Duration.md +21 -0
  79. package/src/components/Duration/Duration.vue +29 -8
  80. package/src/components/Duration/duration.ts +105 -44
  81. package/src/components/Duration/index.ts +1 -0
  82. package/src/components/Duration/types.ts +30 -1
  83. package/src/components/HoverCard/HoverCard.vue +21 -5
  84. package/src/components/Menu/utils.ts +3 -2
  85. package/src/components/MobileNav/MobileNavItem.vue +3 -22
  86. package/src/components/MultiSelect/MultiSelect.api.md +5 -0
  87. package/src/components/MultiSelect/MultiSelect.vue +34 -0
  88. package/src/components/MultiSelect/MultiSelectResults.vue +3 -4
  89. package/src/components/MultiSelect/types.ts +6 -0
  90. package/src/components/Select/Select.vue +4 -4
  91. package/src/components/Select/utils.ts +1 -0
  92. package/src/components/SettingsDialog/SettingsDialog.api.md +7 -2
  93. package/src/components/SettingsDialog/SettingsDialog.md +2 -1
  94. package/src/components/SettingsDialog/SettingsRow.vue +12 -2
  95. package/src/components/Sidebar/SidebarItem.vue +3 -33
  96. package/src/components/SidebarRail/SidebarRailItem.vue +4 -17
  97. package/src/components/Switch/Switch.vue +3 -3
  98. package/src/components/Tooltip/Tooltip.vue +8 -0
  99. package/src/components/shared/deferredTrigger.ts +174 -0
  100. package/src/components/shared/navLink.ts +45 -0
  101. package/src/components/shared/selection/utils.ts +8 -1
  102. package/src/data-fetching/useCall/useCall.ts +25 -26
  103. package/src/data-fetching/useFrappeFetch.ts +48 -2
  104. package/src/data-fetching/useList/useList.ts +11 -3
  105. package/src/data-fetching/utils.ts +15 -1
  106. package/src/molecules/editor/components/MediaNodeView.vue +10 -1
  107. package/src/molecules/editor/components/MediaResizeGuide.vue +71 -0
  108. package/src/molecules/editor/components/media-node-view-utils.ts +7 -0
  109. package/src/molecules/editor/composables/useNodeViewResize.ts +142 -10
  110. package/src/molecules/editor/extensions/attachment/attachment-engine.ts +1 -1
  111. package/src/molecules/editor/extensions/content-paste/paste-html-utils.ts +16 -6
  112. package/src/molecules/editor/extensions/iframe/IframeNodeView.vue +29 -10
  113. package/src/molecules/editor/extensions/iframe/iframe-allowlist.ts +35 -16
  114. package/src/molecules/editor/extensions/iframe/iframe-embed-utils.ts +1 -1
  115. package/src/molecules/editor/extensions/iframe/iframe-extension.ts +30 -30
  116. package/src/molecules/editor/extensions/link/LinkEditorPopup.vue +1 -1
  117. package/src/molecules/editor/extensions/link/link-paste-plugin.ts +1 -1
  118. package/src/molecules/editor/extensions/shared/media-upload-engine.ts +1 -1
  119. package/src/molecules/editor/useEditor.ts +12 -6
  120. package/src/molecules/list/ListRow.vue +8 -1
  121. package/src/utils/dialog.ts +57 -16
  122. package/src/{molecules/editor/extensions/shared → utils}/url-safety.ts +28 -16
  123. package/tailwind/content.js +1 -1
  124. package/tailwind/plugin.js +22 -0
  125. package/vite/README.md +5 -3
  126. package/vite/codeLanguages.js +41 -17
  127. package/vite/doctypeInterfaceGenerator.js +52 -39
  128. package/vitepress/index.node.ts +0 -2
  129. package/experimental/TextEditor/TextEditor.api.md +0 -161
  130. package/experimental/TextEditor/TextEditor.vue +0 -298
  131. package/experimental/TextEditor/classIcon.ts +0 -21
  132. package/experimental/TextEditor/commands.js +0 -344
  133. package/experimental/TextEditor/components/CodeBlockComponent.vue +0 -103
  134. package/experimental/TextEditor/components/FontColor.vue +0 -153
  135. package/experimental/TextEditor/components/ImageViewerModal.vue +0 -463
  136. package/experimental/TextEditor/components/InsertImage.vue +0 -54
  137. package/experimental/TextEditor/components/InsertLink.vue +0 -13
  138. package/experimental/TextEditor/components/InsertVideo.vue +0 -14
  139. package/experimental/TextEditor/components/LinkPopup.vue +0 -99
  140. package/experimental/TextEditor/components/MediaNodeView.vue +0 -398
  141. package/experimental/TextEditor/components/MentionList.vue +0 -95
  142. package/experimental/TextEditor/components/TextEditorBubbleMenu.vue +0 -78
  143. package/experimental/TextEditor/components/TextEditorFixedMenu.vue +0 -78
  144. package/experimental/TextEditor/components/TextEditorFloatingMenu.vue +0 -61
  145. package/experimental/TextEditor/components/TextEditorMenu.vue +0 -218
  146. package/experimental/TextEditor/components/index.js +0 -0
  147. package/experimental/TextEditor/extensions/code-block.ts +0 -119
  148. package/experimental/TextEditor/extensions/color/color-extension.ts +0 -140
  149. package/experimental/TextEditor/extensions/color/color-styles.css +0 -25
  150. package/experimental/TextEditor/extensions/color/index.ts +0 -2
  151. package/experimental/TextEditor/extensions/content-paste-extension.ts +0 -160
  152. package/experimental/TextEditor/extensions/copy-styles.ts +0 -160
  153. package/experimental/TextEditor/extensions/emoji/EmojiList.vue +0 -55
  154. package/experimental/TextEditor/extensions/emoji/emoji-extension.ts +0 -55
  155. package/experimental/TextEditor/extensions/emoji/emojis.json +0 -7422
  156. package/experimental/TextEditor/extensions/heading/heading.ts +0 -20
  157. package/experimental/TextEditor/extensions/highlight/highlight-extension.ts +0 -241
  158. package/experimental/TextEditor/extensions/highlight/highlight-styles.css +0 -31
  159. package/experimental/TextEditor/extensions/highlight/index.ts +0 -2
  160. package/experimental/TextEditor/extensions/iframe/IframeNodeView.vue +0 -308
  161. package/experimental/TextEditor/extensions/iframe/InsertIframe.vue +0 -209
  162. package/experimental/TextEditor/extensions/iframe/iframe-extension.ts +0 -404
  163. package/experimental/TextEditor/extensions/iframe/index.ts +0 -11
  164. package/experimental/TextEditor/extensions/iframe/utils.ts +0 -283
  165. package/experimental/TextEditor/extensions/image/image-extension.ts +0 -661
  166. package/experimental/TextEditor/extensions/image/index.ts +0 -5
  167. package/experimental/TextEditor/extensions/image-group/ImageGroupNodeView.vue +0 -182
  168. package/experimental/TextEditor/extensions/image-group/ImageGroupUploadDialog.vue +0 -740
  169. package/experimental/TextEditor/extensions/image-group/image-group-extension.ts +0 -187
  170. package/experimental/TextEditor/extensions/image-viewer-extension.ts +0 -162
  171. package/experimental/TextEditor/extensions/link/index.ts +0 -1
  172. package/experimental/TextEditor/extensions/link/link-extension.ts +0 -323
  173. package/experimental/TextEditor/extensions/link/linkPasteHandler.ts +0 -51
  174. package/experimental/TextEditor/extensions/mention/index.ts +0 -1
  175. package/experimental/TextEditor/extensions/mention/mention-extension.ts +0 -204
  176. package/experimental/TextEditor/extensions/mention/style.css +0 -11
  177. package/experimental/TextEditor/extensions/shared/color-utils.ts +0 -236
  178. package/experimental/TextEditor/extensions/slash-commands/SlashCommandsList.vue +0 -59
  179. package/experimental/TextEditor/extensions/slash-commands/slash-commands-extension.ts +0 -184
  180. package/experimental/TextEditor/extensions/suggestion/SuggestionList.vue +0 -130
  181. package/experimental/TextEditor/extensions/suggestion/createSuggestionExtension.ts +0 -151
  182. package/experimental/TextEditor/extensions/suggestion/index.ts +0 -5
  183. package/experimental/TextEditor/extensions/tag/index.ts +0 -1
  184. package/experimental/TextEditor/extensions/tag/tag-extension.ts +0 -170
  185. package/experimental/TextEditor/extensions/toc-node/TocNodeView.vue +0 -439
  186. package/experimental/TextEditor/extensions/toc-node/index.ts +0 -3
  187. package/experimental/TextEditor/extensions/toc-node/toc-node-extension.ts +0 -167
  188. package/experimental/TextEditor/extensions/video-extension.ts +0 -653
  189. package/experimental/TextEditor/hljs-github.css +0 -197
  190. package/experimental/TextEditor/index.ts +0 -21
  191. package/experimental/TextEditor/style.css +0 -190
  192. package/experimental/TextEditor/types.ts +0 -72
  193. package/experimental/TextEditor/utils.js +0 -11
  194. package/src/utils/url-validation.ts +0 -39
@@ -1,197 +0,0 @@
1
- /* GitHub light / dark syntax-highlight theme for highlight.js.
2
- Selector-agnostic: styles any <pre> containing hljs-annotated tokens.
3
- Used by both the TipTap editor (CodeBlockComponent) and the chat Markdown renderer. */
4
-
5
- /* ── pre shell ────────────────────────────────────────────────── */
6
- .hljs-pre {
7
- background: #f6f8fa;
8
- color: #24292e;
9
- font-family:
10
- ui-monospace, Menlo, Monaco, 'Cascadia Mono', 'Segoe UI Mono',
11
- 'Roboto Mono', 'Oxygen Mono', 'Ubuntu Mono', 'Source Code Pro', 'Fira Mono',
12
- 'Droid Sans Mono', 'Consolas', 'Courier New', monospace;
13
- font-size: 12px;
14
- line-height: 1.7;
15
- padding: 0.75rem 1rem;
16
- border-radius: 0.75rem;
17
- border: 1px solid var(--outline-gray-2);
18
- caret-color: #24292e;
19
- }
20
-
21
- .hljs-pre code {
22
- color: inherit;
23
- padding: 0;
24
- background: none;
25
- font-size: inherit;
26
- }
27
-
28
- /* ── GitHub light tokens ──────────────────────────────────────── */
29
- .hljs-pre .hljs-doctag,
30
- .hljs-pre .hljs-keyword,
31
- .hljs-pre .hljs-meta .hljs-keyword,
32
- .hljs-pre .hljs-template-tag,
33
- .hljs-pre .hljs-template-variable,
34
- .hljs-pre .hljs-type,
35
- .hljs-pre .hljs-variable.language_ {
36
- color: #d73a49;
37
- }
38
-
39
- .hljs-pre .hljs-title,
40
- .hljs-pre .hljs-title.class_,
41
- .hljs-pre .hljs-title.class_.inherited__,
42
- .hljs-pre .hljs-title.function_ {
43
- color: #6f42c1;
44
- }
45
-
46
- .hljs-pre .hljs-attr,
47
- .hljs-pre .hljs-attribute,
48
- .hljs-pre .hljs-literal,
49
- .hljs-pre .hljs-meta,
50
- .hljs-pre .hljs-number,
51
- .hljs-pre .hljs-operator,
52
- .hljs-pre .hljs-variable,
53
- .hljs-pre .hljs-selector-attr,
54
- .hljs-pre .hljs-selector-class,
55
- .hljs-pre .hljs-selector-id {
56
- color: #005cc5;
57
- }
58
-
59
- .hljs-pre .hljs-regexp,
60
- .hljs-pre .hljs-string,
61
- .hljs-pre .hljs-meta .hljs-string {
62
- color: #032f62;
63
- }
64
-
65
- .hljs-pre .hljs-built_in,
66
- .hljs-pre .hljs-symbol {
67
- color: #e36209;
68
- }
69
-
70
- .hljs-pre .hljs-comment,
71
- .hljs-pre .hljs-code,
72
- .hljs-pre .hljs-formula {
73
- color: #6a737d;
74
- }
75
-
76
- .hljs-pre .hljs-name,
77
- .hljs-pre .hljs-quote,
78
- .hljs-pre .hljs-selector-tag,
79
- .hljs-pre .hljs-selector-pseudo {
80
- color: #22863a;
81
- }
82
-
83
- .hljs-pre .hljs-subst {
84
- color: #24292e;
85
- }
86
- .hljs-pre .hljs-section {
87
- color: #005cc5;
88
- font-weight: bold;
89
- }
90
- .hljs-pre .hljs-bullet {
91
- color: #735c0f;
92
- }
93
- .hljs-pre .hljs-emphasis {
94
- color: #24292e;
95
- font-style: italic;
96
- }
97
- .hljs-pre .hljs-strong {
98
- color: #24292e;
99
- font-weight: 700;
100
- }
101
- .hljs-pre .hljs-addition {
102
- color: #22863a;
103
- background-color: #f0fff4;
104
- }
105
- .hljs-pre .hljs-deletion {
106
- color: #b31d28;
107
- background-color: #ffeef0;
108
- }
109
-
110
- /* ── pre shell — dark mode ───────────────────────────────────── */
111
- [data-theme='dark'] .hljs-pre {
112
- background: #0d1117;
113
- color: #c9d1d9;
114
- caret-color: #c9d1d9;
115
- }
116
-
117
- /* ── GitHub dark tokens ──────────────────────────────────────── */
118
- [data-theme='dark'] .hljs-pre .hljs-doctag,
119
- [data-theme='dark'] .hljs-pre .hljs-keyword,
120
- [data-theme='dark'] .hljs-pre .hljs-meta .hljs-keyword,
121
- [data-theme='dark'] .hljs-pre .hljs-template-tag,
122
- [data-theme='dark'] .hljs-pre .hljs-template-variable,
123
- [data-theme='dark'] .hljs-pre .hljs-type,
124
- [data-theme='dark'] .hljs-pre .hljs-variable.language_ {
125
- color: #ff7b72;
126
- }
127
-
128
- [data-theme='dark'] .hljs-pre .hljs-title,
129
- [data-theme='dark'] .hljs-pre .hljs-title.class_,
130
- [data-theme='dark'] .hljs-pre .hljs-title.class_.inherited__,
131
- [data-theme='dark'] .hljs-pre .hljs-title.function_ {
132
- color: #d2a8ff;
133
- }
134
-
135
- [data-theme='dark'] .hljs-pre .hljs-attr,
136
- [data-theme='dark'] .hljs-pre .hljs-attribute,
137
- [data-theme='dark'] .hljs-pre .hljs-literal,
138
- [data-theme='dark'] .hljs-pre .hljs-meta,
139
- [data-theme='dark'] .hljs-pre .hljs-number,
140
- [data-theme='dark'] .hljs-pre .hljs-operator,
141
- [data-theme='dark'] .hljs-pre .hljs-variable,
142
- [data-theme='dark'] .hljs-pre .hljs-selector-attr,
143
- [data-theme='dark'] .hljs-pre .hljs-selector-class,
144
- [data-theme='dark'] .hljs-pre .hljs-selector-id {
145
- color: #79c0ff;
146
- }
147
-
148
- [data-theme='dark'] .hljs-pre .hljs-regexp,
149
- [data-theme='dark'] .hljs-pre .hljs-string,
150
- [data-theme='dark'] .hljs-pre .hljs-meta .hljs-string {
151
- color: #a5d6ff;
152
- }
153
-
154
- [data-theme='dark'] .hljs-pre .hljs-built_in,
155
- [data-theme='dark'] .hljs-pre .hljs-symbol {
156
- color: #ffa657;
157
- }
158
-
159
- [data-theme='dark'] .hljs-pre .hljs-comment,
160
- [data-theme='dark'] .hljs-pre .hljs-code,
161
- [data-theme='dark'] .hljs-pre .hljs-formula {
162
- color: #8b949e;
163
- }
164
-
165
- [data-theme='dark'] .hljs-pre .hljs-name,
166
- [data-theme='dark'] .hljs-pre .hljs-quote,
167
- [data-theme='dark'] .hljs-pre .hljs-selector-tag,
168
- [data-theme='dark'] .hljs-pre .hljs-selector-pseudo {
169
- color: #7ee787;
170
- }
171
-
172
- [data-theme='dark'] .hljs-pre .hljs-subst {
173
- color: #c9d1d9;
174
- }
175
- [data-theme='dark'] .hljs-pre .hljs-section {
176
- color: #1f6feb;
177
- font-weight: bold;
178
- }
179
- [data-theme='dark'] .hljs-pre .hljs-bullet {
180
- color: #f2cc60;
181
- }
182
- [data-theme='dark'] .hljs-pre .hljs-emphasis {
183
- color: #c9d1d9;
184
- font-style: italic;
185
- }
186
- [data-theme='dark'] .hljs-pre .hljs-strong {
187
- color: #c9d1d9;
188
- font-weight: 700;
189
- }
190
- [data-theme='dark'] .hljs-pre .hljs-addition {
191
- color: #aff5b4;
192
- background-color: #033a16;
193
- }
194
- [data-theme='dark'] .hljs-pre .hljs-deletion {
195
- color: #ffdcd7;
196
- background-color: #67060c;
197
- }
@@ -1,21 +0,0 @@
1
- // @ts-nocheck -- frozen v0 code, kept out of type-check (see tsconfig.app.json)
2
- /** @deprecated Use `Editor` from `frappe-ui/editor` instead. */
3
- export { default } from './TextEditor.vue'
4
-
5
- /** @deprecated Use `Editor` from `frappe-ui/editor` instead. */
6
- export { default as TextEditor } from './TextEditor.vue'
7
-
8
- /** @deprecated Use `EditorBubbleMenu` from `frappe-ui/editor` instead. */
9
- export { default as TextEditorBubbleMenu } from './components/TextEditorBubbleMenu.vue'
10
-
11
- /** @deprecated Use `EditorFixedMenu` from `frappe-ui/editor` instead. */
12
- export { default as TextEditorFixedMenu } from './components/TextEditorFixedMenu.vue'
13
-
14
- /** @deprecated Use `EditorFloatingMenu` from `frappe-ui/editor` instead. */
15
- export { default as TextEditorFloatingMenu } from './components/TextEditorFloatingMenu.vue'
16
-
17
- /** @deprecated Use `EditorContent` from `frappe-ui/editor` instead. */
18
- export { EditorContent as TextEditorContent } from '@tiptap/vue-3'
19
-
20
- /** @deprecated Use toolbar presets and menu items from `frappe-ui/editor` instead. */
21
- export { createEditorButton as createEditorButton } from './utils'
@@ -1,190 +0,0 @@
1
- @import './extensions/color/color-styles.css';
2
- @import './extensions/highlight/highlight-styles.css';
3
-
4
- .ProseMirror {
5
- outline: none;
6
- caret-color: var(--ink-gray-9);
7
- word-break: break-word;
8
- }
9
-
10
- /* Firefox */
11
- .ProseMirror-focused:focus-visible {
12
- outline: none;
13
- }
14
-
15
- /* Placeholder */
16
- .ProseMirror:not(.ProseMirror-focused) p.is-editor-empty::before {
17
- content: attr(data-placeholder);
18
- float: left;
19
- color: var(--ink-gray-4);
20
- pointer-events: none;
21
- height: 0;
22
- }
23
-
24
- .ProseMirror-selectednode video,
25
- img.ProseMirror-selectednode {
26
- outline: 2px solid var(--outline-gray-2);
27
- }
28
-
29
- .table-of-contents-node {
30
- padding: 0 10px;
31
- }
32
- .table-of-contents-node li p {
33
- width: fit-content;
34
- padding: 0 3px;
35
- border-radius: 4px;
36
- }
37
-
38
- .table-of-contents-node li p:hover {
39
- background-color: var(--surface-gray-2);
40
- }
41
-
42
- .table-of-contents-node.ProseMirror-selectednode {
43
- outline: 2px solid var(--outline-gray-2);
44
- outline-offset: 2px;
45
- border-radius: 4px;
46
- }
47
-
48
- .ProseMirror ul[data-type='taskList'] {
49
- list-style: none;
50
- padding: 0;
51
-
52
- li {
53
- align-items: flex-start;
54
- display: flex;
55
- margin: 0;
56
-
57
- > label {
58
- flex: 0 0 auto;
59
- margin-right: 0.5rem;
60
- margin-top: 0.25rem;
61
- height: 1lh;
62
- display: flex;
63
- align-items: center;
64
- user-select: none;
65
- }
66
-
67
- > div {
68
- flex: 1 1 auto;
69
- margin-bottom: 0;
70
-
71
- > p {
72
- margin: 0.25rem 0;
73
- }
74
- }
75
- }
76
- ul[data-type='taskList'] {
77
- margin: 0;
78
- }
79
-
80
- input[type='checkbox'] {
81
- cursor: pointer;
82
- width: 14px;
83
- height: 14px;
84
- border-radius: 4px;
85
- color: var(--ink-gray-9);
86
- }
87
- }
88
-
89
- .resize-cursor {
90
- cursor: ew-resize;
91
- cursor: col-resize;
92
- }
93
-
94
- .tag-item,
95
- .tag-suggestion-active {
96
- background-color: var(--surface-gray-1, #f8f8f8);
97
- color: inherit;
98
- border: 1px solid transparent;
99
- padding: 0px 2px;
100
- border-radius: 4px;
101
- font-size: 1em;
102
- white-space: nowrap;
103
- cursor: default;
104
- }
105
-
106
- .tag-item.ProseMirror-selectednode {
107
- border-color: var(--outline-gray-3, #c7c7c7);
108
- }
109
-
110
- .tag-suggestion-active {
111
- background-color: var(--surface-gray-2, #f3f3f3);
112
- }
113
-
114
- .ProseMirror table {
115
- table-layout: fixed;
116
- }
117
-
118
- .ProseMirror td,
119
- .ProseMirror th {
120
- padding: 0.5rem;
121
- border: 1px solid var(--outline-gray-2);
122
- position: relative;
123
- }
124
-
125
- .ProseMirror td p,
126
- .ProseMirror th p {
127
- margin: 0;
128
- }
129
-
130
- .ProseMirror th {
131
- background-color: var(--surface-gray-2);
132
- }
133
-
134
- /* Applies the current color to the link's underline */
135
- .ProseMirror a span[style] {
136
- text-decoration: underline;
137
- }
138
-
139
- .ProseMirror .tableWrapper {
140
- overflow-x: scroll;
141
- }
142
-
143
- /* Edit prose classes to be more functional */
144
- .prose-v2 {
145
- line-height: 1.5 !important;
146
- blockquote {
147
- quotes: none;
148
- font-style: normal;
149
- margin-top: 0.75em;
150
- margin-bottom: 0.75em;
151
- }
152
-
153
- p,
154
- ul,
155
- ol,
156
- pre,
157
- blockquote,
158
- table {
159
- margin-top: 0;
160
- margin-bottom: 0;
161
- }
162
- /* fix: heading bottom margin */
163
- :is(h1, h2, h3, h4, h5, h6) + :is(h1, h2, h3, h4, h5, h6) {
164
- margin-top: 0;
165
- }
166
- :is(h1, h2, h3, h4, h5, h6):first-child {
167
- margin-top: 0;
168
- }
169
-
170
- hr {
171
- margin: 2.25em 0;
172
- }
173
- }
174
-
175
- /* Empty paragraph height in prose-v3.
176
- ProseMirror always renders empty paragraphs as <p><br class="ProseMirror-trailingBreak"></p>
177
- even in readonly mode, so p:empty never matches.
178
- Edit mode: no override — natural 14px × 1.7 = 23.8px, avoids jump when typing
179
- Readonly mode: scoped via [contenteditable=false] + ProseMirror-trailingBreak class
180
- to precisely target empty paragraphs (not inline <br> in content) */
181
- .ProseMirror[contenteditable='false'] .prose-v3 p:has(> br.ProseMirror-trailingBreak:only-child),
182
- .prose-v3.ProseMirror[contenteditable='false'] p:has(> br.ProseMirror-trailingBreak:only-child) {
183
- line-height: 20px;
184
- }
185
-
186
- /* prose-v3 blockquote: 2px left border — overrides Tailwind Typography's 0.25rem
187
- using element specificity (0,1,1) to beat the plugin's :where() (0,1,0) */
188
- .prose-v3 blockquote {
189
- border-inline-start-width: 2px;
190
- }
@@ -1,72 +0,0 @@
1
- import { type Component } from 'vue'
2
- import { type UploadedFile } from '#utils/useFileUpload'
3
- import { type MentionSuggestionItem } from './extensions/mention/mention-extension'
4
-
5
- type ConfigureMentionOptions =
6
- | {
7
- mentions: MentionSuggestionItem[]
8
- component?: Component
9
- }
10
- | MentionSuggestionItem[]
11
- | null
12
-
13
- export interface TextEditorProps {
14
- /** Initial editor content (HTML/string). `null` renders an empty editor */
15
- content?: string | null
16
-
17
- /** Placeholder text or dynamic placeholder resolver */
18
- placeholder?: string | (() => string)
19
-
20
- /** Custom classes applied to the editor root */
21
- editorClass?: string | string[] | object
22
-
23
- /** Toggles editability of the editor */
24
- editable?: boolean
25
-
26
- /** Autofocus the editor on mount */
27
- autofocus?: boolean
28
-
29
- /** Enables bubble menu or provides custom bubble menu items */
30
- bubbleMenu?: boolean | any[]
31
-
32
- /** Configuration options for the bubble menu */
33
- bubbleMenuOptions?: object
34
-
35
- /** Enables fixed menu or provides custom fixed menu items */
36
- fixedMenu?: boolean | any[]
37
-
38
- /** Enables floating menu or provides custom floating menu items */
39
- floatingMenu?: boolean | any[]
40
-
41
- /** Custom TipTap extensions */
42
- extensions?: any[]
43
-
44
- /** Options passed to TipTap StarterKit */
45
- starterkitOptions?: any
46
-
47
- /** Mention extension configuration */
48
- mentions?: ConfigureMentionOptions
49
-
50
- /** Tag / hashtag configuration */
51
- tags?: any[] | null
52
-
53
- /** Async file upload handler (used for images, files, etc.) */
54
- uploadFunction?: (file: File) => Promise<UploadedFile>
55
-
56
- /** Extra arguments passed to the upload function */
57
- uploadArgs?: object
58
- }
59
-
60
- export interface TextEditorEmits {
61
- /** Fired whenever editor content changes */
62
- change: [content: string]
63
-
64
- /** Fired when the editor gains focus */
65
- focus: [event: FocusEvent]
66
-
67
- /** Fired when the editor loses focus */
68
- blur: [event: FocusEvent]
69
-
70
- /** Fired on every editor transaction */
71
- transaction: [editor: object]
72
- }
@@ -1,11 +0,0 @@
1
- import commands from './commands'
2
-
3
- export function createEditorButton(option) {
4
- if (option instanceof Array) {
5
- return option.map(createEditorButton)
6
- }
7
- if (typeof option == 'object') {
8
- return option
9
- }
10
- return commands[option]
11
- }
@@ -1,39 +0,0 @@
1
- /**
2
- * Validates if the given string is a valid URL, including common protocols,
3
- * relative paths, and anchor links. It also allows an empty string.
4
- *
5
- * @param url The URL string to validate.
6
- * @returns True if the URL is considered valid, false otherwise.
7
- */
8
- export function isValidUrl(url: string): boolean {
9
- if (url === '') {
10
- return true // Allows empty string as per documentation
11
- }
12
-
13
- // Regex for absolute URLs with common schemes (http, https, mailto, tel, //)
14
- // Allows for paths, query strings, and fragments.
15
- if (/^(https?:\/\/|mailto:|tel:|\/\/)[^\s]+$/i.test(url)) {
16
- return true
17
- }
18
-
19
- // Regex for:
20
- // 1. Relative paths (starting with / or .)
21
- // 2. Anchor links (starting with #)
22
- // These allow for most characters except whitespace, as the initial characters
23
- // prevent misinterpretation as a scheme like 'javascript:'.
24
- if (/^([./#][^\s]*)$/i.test(url)) {
25
- return true
26
- }
27
-
28
- // Regex for "Schemeless" paths (e.g., page.html, my-document, slug-name)
29
- // Must start with a word character or hyphen.
30
- // Subsequent characters are restricted to common URL path/query/fragment characters
31
- // (alphanumeric, -, _, ., /, #, ?, =, &, %).
32
- // This prevents colons (avoiding 'javascript:' like schemes) and other problematic
33
- // characters like spaces, (, ), !, {, }.
34
- if (/^[\w\-]([\w\-./#?=&%]*)$/i.test(url)) {
35
- return true
36
- }
37
-
38
- return false
39
- }