markdown-wysiwyg-editor 0.2.4 → 0.2.6

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 (79) hide show
  1. package/README.md +143 -67
  2. package/dist/components/EditorChrome.d.ts +25 -0
  3. package/dist/components/EditorChrome.d.ts.map +1 -0
  4. package/dist/components/EmojiPicker.d.ts +1 -1
  5. package/dist/components/EmojiPicker.d.ts.map +1 -1
  6. package/dist/components/ImagePicker.d.ts +1 -1
  7. package/dist/components/ImagePicker.d.ts.map +1 -1
  8. package/dist/components/LinkContextMenu.d.ts +8 -1
  9. package/dist/components/LinkContextMenu.d.ts.map +1 -1
  10. package/dist/components/MarkdownEditor.d.ts +2 -2
  11. package/dist/components/MarkdownEditor.d.ts.map +1 -1
  12. package/dist/components/MarkdownSyntaxStatus.d.ts +2 -2
  13. package/dist/components/MarkdownToolbar.d.ts +7 -2
  14. package/dist/components/MarkdownToolbar.d.ts.map +1 -1
  15. package/dist/components/TableContextMenu.d.ts +4 -1
  16. package/dist/components/TableEdgeControls.d.ts +3 -2
  17. package/dist/components/TableToolbar.d.ts +3 -2
  18. package/dist/components/toolbar/DownloadMenu.d.ts +13 -0
  19. package/dist/components/toolbar/DownloadMenu.d.ts.map +1 -0
  20. package/dist/components/toolbar/HeadingMenu.d.ts +13 -0
  21. package/dist/components/toolbar/HeadingMenu.d.ts.map +1 -0
  22. package/dist/components/toolbar/LinkModal.d.ts +12 -0
  23. package/dist/components/toolbar/LinkModal.d.ts.map +1 -0
  24. package/dist/components/toolbar/ToolbarButton.d.ts +11 -0
  25. package/dist/components/toolbar/ToolbarButton.d.ts.map +1 -0
  26. package/dist/components/ui/icons.d.ts +30 -0
  27. package/dist/components/ui/icons.d.ts.map +1 -0
  28. package/dist/constants/emojiData.d.ts +1 -1
  29. package/dist/converters/JsonToMarkdownConverter.d.ts +5 -2
  30. package/dist/converters/JsonToMarkdownConverter.d.ts.map +1 -1
  31. package/dist/converters/MarkdownTipTapConverter.d.ts +13 -7
  32. package/dist/converters/MarkdownTipTapConverter.d.ts.map +1 -1
  33. package/dist/converters/markdown/BlockExtractor.d.ts +20 -0
  34. package/dist/converters/markdown/BlockExtractor.d.ts.map +1 -0
  35. package/dist/converters/markdown/BlockParser.d.ts +9 -0
  36. package/dist/converters/markdown/BlockParser.d.ts.map +1 -0
  37. package/dist/converters/markdown/InlineParser.d.ts +10 -0
  38. package/dist/converters/markdown/InlineParser.d.ts.map +1 -0
  39. package/dist/extensions/CodeBlockNodeView/IconButton.d.ts +9 -0
  40. package/dist/extensions/CodeBlockNodeView/IconButton.d.ts.map +1 -0
  41. package/dist/extensions/CodeBlockNodeView/MermaidCodeBlockView.d.ts +12 -0
  42. package/dist/extensions/CodeBlockNodeView/MermaidCodeBlockView.d.ts.map +1 -0
  43. package/dist/extensions/CodeBlockNodeView/RegularCodeBlockView.d.ts +10 -0
  44. package/dist/extensions/CodeBlockNodeView/RegularCodeBlockView.d.ts.map +1 -0
  45. package/dist/extensions/CodeBlockNodeView/constants.d.ts +5 -0
  46. package/dist/extensions/CodeBlockNodeView/constants.d.ts.map +1 -0
  47. package/dist/extensions/CodeBlockNodeView.d.ts +1 -1
  48. package/dist/extensions/CodeBlockNodeView.d.ts.map +1 -1
  49. package/dist/extensions/CustomCodeBlock.d.ts +1 -1
  50. package/dist/extensions/LinkClickExtension.d.ts +3 -1
  51. package/dist/extensions/LinkClickExtension.d.ts.map +1 -1
  52. package/dist/extensions/TableRightClickExtension.d.ts +1 -1
  53. package/dist/extensions/mermaidRegistry.d.ts +2 -2
  54. package/dist/hooks/useEditorContextMenus.d.ts +34 -0
  55. package/dist/hooks/useEditorContextMenus.d.ts.map +1 -0
  56. package/dist/hooks/useEditorState.d.ts +3 -3
  57. package/dist/hooks/useMarkdownEditor.d.ts +4 -2
  58. package/dist/hooks/useMarkdownEditor.d.ts.map +1 -1
  59. package/dist/hooks/useMarkdownInsertion.d.ts +11 -0
  60. package/dist/hooks/useMarkdownInsertion.d.ts.map +1 -0
  61. package/dist/hooks/useTableToolbar.d.ts +1 -1
  62. package/dist/i18n/I18nContext.d.ts +1 -1
  63. package/dist/index.css +704 -1
  64. package/dist/index.d.ts +4 -0
  65. package/dist/index.d.ts.map +1 -1
  66. package/dist/index.js +33640 -27167
  67. package/dist/index.js.map +150 -1
  68. package/dist/lib/utils.d.ts +8 -0
  69. package/dist/lib/utils.d.ts.map +1 -0
  70. package/dist/setupTests.d.ts +2 -0
  71. package/dist/setupTests.d.ts.map +1 -0
  72. package/dist/theme.css +96 -0
  73. package/dist/types/editor.d.ts +1 -1
  74. package/dist/types/index.d.ts +1 -1
  75. package/dist/utils/pasteHandler.d.ts +2 -2
  76. package/dist/utils/pasteHandler.d.ts.map +1 -1
  77. package/dist/utils/selectionUtils.d.ts +2 -3
  78. package/dist/utils/selectionUtils.d.ts.map +1 -1
  79. package/package.json +40 -16
package/dist/index.css CHANGED
@@ -1 +1,704 @@
1
- :root{--background: var(--background, 0 0% 100%);--foreground: var(--foreground, 222.2 84% 4.9%);--card: var(--card, 0 0% 100%);--card-foreground: var(--card-foreground, 222.2 84% 4.9%);--popover: var(--popover, 0 0% 100%);--popover-foreground: var(--popover-foreground, 222.2 84% 4.9%);--primary: var(--primary, 221.2 83.2% 53.3%);--primary-foreground: var(--primary-foreground, 210 40% 98%);--secondary: var(--secondary, 210 40% 96.1%);--secondary-foreground: var(--secondary-foreground, 222.2 47.4% 11.2%);--muted: var(--muted, 210 40% 96.1%);--muted-foreground: var(--muted-foreground, 215.4 16.3% 46.9%);--accent: var(--accent, 210 40% 96.1%);--accent-foreground: var(--accent-foreground, 222.2 47.4% 11.2%);--destructive: var(--destructive, 0 84.2% 60.2%);--destructive-foreground: var(--destructive-foreground, 210 40% 98%);--border: var(--border, 214.3 31.8% 91.4%);--input: var(--input, 214.3 31.8% 91.4%);--ring: var(--ring, 221.2 83.2% 53.3%);--radius: var(--radius, .5rem);--mw-bg-canvas: hsl(var(--background));--mw-text-primary: hsl(var(--foreground));--mw-text-secondary: hsl(var(--muted-foreground));--mw-heading-color: hsl(var(--foreground));--mw-heading-secondary: hsl(var(--foreground));--mw-code-bg: #1e293b;--mw-code-text: #e2e8f0;--mw-code-border: hsl(var(--border));--mw-inline-code-bg: #fef2f2;--mw-inline-code-text: #b91c1c;--mw-inline-code-border: #fecaca;--mw-table-border: hsl(var(--border));--mw-table-header-bg: hsl(var(--muted));--mw-table-header-text: hsl(var(--foreground));--mw-table-header-border-bottom: hsl(var(--border));--mw-table-row-hover: hsl(var(--accent));--mw-table-resize-handle: hsl(var(--primary));--mw-quote-border: hsl(var(--primary));--mw-quote-text: hsl(var(--muted-foreground));--mw-quote-bg: hsl(var(--muted));--mw-tooltip-bg: hsl(var(--popover));--mw-tooltip-text: hsl(var(--popover-foreground));--mw-toolbar-bg: hsl(var(--background));--mw-toolbar-border: hsl(var(--border));--mw-toolbar-text: hsl(var(--foreground));--mw-toolbar-hover-bg: hsl(var(--accent));--mw-toolbar-active-bg: hsl(var(--accent))}.ProseMirror{background-color:var(--mw-bg-canvas);color:var(--mw-text-primary);min-height:100%}.ProseMirror h1{font-size:2.25rem;line-height:2.5rem;font-weight:700;color:var(--mw-heading-color);margin-bottom:1rem;margin-top:1.5rem}.ProseMirror h2{font-size:1.875rem;line-height:2.25rem;font-weight:700;color:var(--mw-heading-color);margin-bottom:.75rem;margin-top:1.25rem}.ProseMirror h3{font-size:1.5rem;line-height:2rem;font-weight:600;color:var(--mw-heading-color);margin-bottom:.75rem;margin-top:1rem}.ProseMirror h4{font-size:1.25rem;line-height:1.75rem;font-weight:600;color:var(--mw-heading-secondary);margin-bottom:.5rem;margin-top:.75rem}.ProseMirror h5{font-size:1.125rem;line-height:1.75rem;font-weight:500;color:var(--mw-heading-secondary);margin-bottom:.5rem;margin-top:.75rem}.ProseMirror h6{font-size:1rem;line-height:1.5rem;font-weight:500;color:var(--mw-text-secondary);margin-bottom:.5rem;margin-top:.5rem}.ProseMirror p{margin-bottom:.75rem;color:var(--mw-text-secondary)}.ProseMirror ul,.ProseMirror ol{padding-left:1.5rem;margin-bottom:.75rem;margin-top:.75rem}.ProseMirror ul{list-style-type:disc}.ProseMirror ol{list-style-type:decimal}.ProseMirror ul li,.ProseMirror ol li{margin-bottom:.25rem;padding-left:.25rem;color:var(--mw-text-primary)}.ProseMirror li>p{margin-bottom:0;margin-top:0}.ProseMirror strong,.ProseMirror b{font-weight:700;color:var(--mw-text-primary)}.ProseMirror em,.ProseMirror i{font-style:italic;color:var(--mw-text-primary)}.ProseMirror s,.ProseMirror strike,.ProseMirror del{color:var(--mw-text-secondary)}.ProseMirror blockquote{border-left:4px solid var(--mw-quote-border);padding:.75rem 1rem;font-style:italic;color:var(--mw-quote-text);background-color:var(--mw-quote-bg);border-radius:0 .375rem .375rem 0;margin-top:1rem;margin-bottom:1rem}.ProseMirror blockquote p{margin-top:.5rem;margin-bottom:.5rem}.ProseMirror blockquote p:first-child{margin-top:0}.ProseMirror blockquote p:last-child{margin-bottom:0}.ProseMirror ul>li::marker{color:var(--mw-heading-secondary);font-weight:600}.ProseMirror ol>li::marker{color:var(--mw-heading-secondary);font-weight:600}.ProseMirror code:not(pre code){background-color:var(--mw-inline-code-bg);color:var(--mw-inline-code-text);padding:2px 6px;border-radius:3px;font-size:.9em;border:1px solid var(--mw-inline-code-border);font-family:Monaco,Menlo,Ubuntu Mono,monospace;font-weight:400}.ProseMirror table{border-collapse:collapse;width:100%;margin-top:1rem;margin-bottom:1rem;overflow:hidden;border-radius:.375rem;box-shadow:0 0 0 2px var(--mw-table-border)}.ProseMirror table th,.ProseMirror table td{border:2px solid var(--mw-table-border);padding:.75rem 1rem;text-align:left;min-width:100px}.ProseMirror table th{background-color:var(--mw-table-header-bg);font-weight:600;color:var(--mw-table-header-text);border-bottom:2px solid var(--mw-table-border)}.ProseMirror table td{background-color:var(--mw-bg-canvas);color:var(--mw-text-primary)}.ProseMirror table tr:hover td{background-color:var(--mw-table-row-hover)}.ProseMirror .column-resize-handle{position:absolute;right:-2px;top:0;bottom:0;width:4px;background-color:var(--mw-table-resize-handle);cursor:col-resize;z-index:20}.ProseMirror pre{background:var(--mw-code-bg);color:var(--mw-code-text);padding:1rem;border-radius:.375rem;overflow-x:auto;margin-top:1rem;margin-bottom:1rem;font-size:.875rem;line-height:1.5}.ProseMirror pre code{display:block;white-space:pre;color:var(--mw-code-text);background:transparent;border:none;padding:0;font-family:Monaco,Menlo,Ubuntu Mono,Courier New,monospace}.ProseMirror .hljs{background:var(--mw-code-bg);color:var(--mw-code-text)}.mw-toolbar-root [data-tooltip]{position:relative}.mw-toolbar-root [data-tooltip]:before{content:attr(data-tooltip);position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);padding:6px 8px;background-color:var(--mw-tooltip-bg);color:var(--mw-tooltip-text);font-size:12px;white-space:nowrap;border-radius:4px;opacity:0;pointer-events:none;transition:opacity .1s ease-in-out;z-index:1000}.mw-toolbar-root [data-tooltip]:after{content:"";position:absolute;top:calc(100% + 2px);left:50%;transform:translate(-50%);border:6px solid transparent;border-bottom-color:var(--mw-tooltip-bg);opacity:0;pointer-events:none;transition:opacity .1s ease-in-out;z-index:1000}.mw-toolbar-root [data-tooltip]:hover:before,.mw-toolbar-root [data-tooltip]:hover:after{opacity:1}.mw-emoji-picker{width:320px;max-height:320px;background-color:var(--mw-toolbar-bg, #ffffff);border:1px solid var(--mw-toolbar-border, #d1d5db);border-radius:.5rem;box-shadow:0 0 0 1px var(--mw-toolbar-border, rgba(17, 24, 39, .14)),0 12px 28px #0000002e;overflow:hidden;display:flex;flex-direction:column}.mw-emoji-categories{display:flex;align-items:center;border-bottom:1px solid var(--mw-toolbar-border, #e5e7eb);padding:4px;gap:2px;flex-shrink:0}.mw-emoji-search{padding:6px;border-bottom:1px solid var(--mw-toolbar-border, #e5e7eb);flex-shrink:0}.mw-emoji-search-input{width:100%;height:32px;padding:0 10px;border-radius:6px;border:1px solid var(--mw-toolbar-border, #d1d5db);background-color:var(--mw-bg-canvas, #ffffff);color:var(--mw-toolbar-text, #111827);font-size:13px}.mw-emoji-search-input:focus{outline:none;border-color:var(--mw-ring, rgba(59, 130, 246, .75));box-shadow:0 0 0 3px #3b82f640}.mw-emoji-search-input::placeholder{color:var(--mw-text-secondary, #6b7280)}.mw-emoji-category-tab{width:32px;height:32px;display:flex;align-items:center;justify-content:center;border:1px solid transparent;background:transparent;border-radius:.25rem;cursor:pointer;transition:background-color .15s ease;color:var(--mw-toolbar-text, #111827)}.mw-emoji-category-tab:hover{background-color:var(--mw-toolbar-hover-bg, rgba(0, 0, 0, .06))}.mw-emoji-category-tab--active{background-color:var(--mw-toolbar-active-bg, rgba(0, 0, 0, .08));color:var(--mw-toolbar-text, #111827);border-color:var(--mw-toolbar-border, #d1d5db);box-shadow:inset 0 -2px 0 var(--mw-ring, rgba(59, 130, 246, .85))}.mw-emoji-category-tab:focus-visible{outline:none;box-shadow:0 0 0 3px #3b82f640}.mw-emoji-category-icon{font-size:16px;line-height:1}.mw-emoji-scroll{overflow-y:auto;overflow-x:hidden;scrollbar-gutter:stable;flex:1 1 auto;min-height:0;padding:6px}.mw-emoji-sections{display:flex;flex-direction:column;gap:10px}.mw-emoji-section-header{display:flex;align-items:center;gap:6px;padding:4px 2px;border-bottom:1px solid var(--mw-toolbar-border, #e5e7eb);margin-bottom:6px}.mw-emoji-section-icon{font-size:14px;line-height:1}.mw-emoji-section-title{font-size:12px;font-weight:600;color:var(--mw-toolbar-text, #111827)}.mw-emoji-grid{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:2px;padding:0}.mw-emoji-empty{grid-column:1 / -1;padding:12px 8px;color:var(--mw-text-secondary, #6b7280);font-size:12px}.mw-emoji-item{width:100%;height:36px;display:flex;align-items:center;justify-content:center;border:none;background:transparent;border-radius:.25rem;cursor:pointer;transition:background-color .15s ease;color:var(--mw-toolbar-text, #111827);font-size:20px;line-height:1}.mw-emoji-item:hover{background-color:var(--mw-toolbar-hover-bg, rgba(0, 0, 0, .06))}.mw-emoji-item:focus{outline:2px solid var(--mw-toolbar-border, #e5e7eb);outline-offset:-2px}.mw-emoji-item:disabled{opacity:.5;cursor:not-allowed}.mw-emoji-char{font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",EmojiOne Color,"Android Emoji",sans-serif;font-style:normal;font-weight:400;line-height:1}.mw-image-picker{width:320px;max-height:360px;border-radius:.5rem;box-shadow:0 0 0 1px var(--mw-toolbar-border, rgba(17, 24, 39, .14)),0 12px 28px #0000002e;overflow:hidden;display:flex;flex-direction:column}.mw-image-body{padding:10px}.mw-image-form{display:flex;flex-direction:column;gap:6px}.mw-image-label{font-size:12px;font-weight:600;color:var(--mw-text-secondary, #6b7280)}.mw-image-input{width:100%;height:34px;padding:0 10px;border-radius:6px;border:1px solid var(--mw-toolbar-border, #d1d5db);background-color:var(--mw-bg-canvas, #ffffff);color:var(--mw-text-primary, #111827);font-size:13px}.mw-image-input:focus{outline:none;border-color:var(--mw-ring, rgba(59, 130, 246, .75));box-shadow:0 0 0 3px #3b82f640}.mw-image-actions{display:flex;justify-content:flex-end;margin-top:6px}.mw-image-insert{height:34px;padding:0 12px;border-radius:6px;border:1px solid var(--mw-toolbar-border, #d1d5db);background-color:var(--mw-toolbar-bg, #ffffff);color:var(--mw-toolbar-text, #111827);cursor:pointer;font-size:13px;font-weight:600}.mw-image-insert:hover{background-color:var(--mw-toolbar-hover-bg, rgba(0, 0, 0, .06))}.mw-image-insert:disabled{opacity:.5;cursor:not-allowed}
1
+ /* ========================================
2
+ * Markdown WYSIWYG Editor - Styles
3
+ * ========================================
4
+ *
5
+ * This file contains editor-specific styles for ProseMirror and UI components.
6
+ *
7
+ * For theming, import theme.css which provides shadcn-compatible CSS variables:
8
+ * @import "markdown-wysiwyg-editor/theme.css";
9
+ *
10
+ * Or define your own CSS variables in your host project's CSS.
11
+ *
12
+ * Required Tailwind v4 setup in your index.css:
13
+ * @import "tailwindcss";
14
+ * @source "./node_modules/markdown-wysiwyg-editor/dist/*.js";
15
+ * @import "markdown-wysiwyg-editor/theme.css";
16
+ *
17
+ * ======================================== */
18
+ @theme {
19
+ /* Spacing Tokens */
20
+ --spacing-ui-x: var(--ui-component-padding-x);
21
+ --spacing-ui-y: var(--ui-component-padding-y);
22
+ --spacing-ui-modal: var(--ui-modal-padding);
23
+ --spacing-ui-cell: var(--ui-table-cell-padding);
24
+
25
+ --spacing-btn-x: var(--ui-button-padding-x);
26
+ --spacing-btn-y: var(--ui-button-padding-y);
27
+
28
+ /* Icon Size Tokens */
29
+ --spacing-icon-xs: var(--ui-icon-size-xs);
30
+ --spacing-icon-sm: var(--ui-icon-size-sm);
31
+ --spacing-icon-md: var(--ui-icon-size-md);
32
+ --spacing-icon-lg: var(--ui-icon-size-lg);
33
+ --spacing-icon-xl: var(--ui-icon-size-xl);
34
+
35
+ /* Radius Tokens */
36
+ --radius-ui: var(--radius);
37
+ }
38
+
39
+ /* UI Density Variables */
40
+ @layer base {
41
+ :root {
42
+ --ui-component-height: 2.5rem;
43
+ --ui-list-row-height: 2.5rem;
44
+ --ui-component-padding-x: 0.75rem;
45
+ --ui-component-padding-y: 0.5rem;
46
+ --ui-button-padding-x: 1rem;
47
+ --ui-button-padding-y: 0.5rem;
48
+ --ui-font-size-base: 0.875rem;
49
+ --ui-modal-padding: 1.5rem;
50
+ --ui-modal-padding: 1.5rem;
51
+ --ui-table-cell-padding: 0.75rem;
52
+
53
+ /* Icon Sizes */
54
+ --ui-icon-size-xs: 0.5rem;
55
+ /* 8px (w-2) */
56
+ --ui-icon-size-sm: 0.75rem;
57
+ /* 12px (w-3) */
58
+ --ui-icon-size-md: 1rem;
59
+ /* 16px (w-4) */
60
+ --ui-icon-size-lg: 1.25rem;
61
+ /* 20px (w-5) */
62
+ --ui-icon-size-xl: 1.5rem;
63
+ /* 24px (w-6) */
64
+ }
65
+ }
66
+
67
+ :root[data-density="compact"] {
68
+ --ui-component-height: 2rem;
69
+ /* 32px */
70
+ --ui-list-row-height: 2rem;
71
+ --ui-component-padding-x: 0.5rem;
72
+ /* 8px */
73
+ --ui-component-padding-y: 0.25rem;
74
+ /* 4px */
75
+ --ui-button-padding-x: 0.5rem;
76
+ /* 8px */
77
+ --ui-button-padding-y: 0.25rem;
78
+ /* 4px */
79
+ --ui-font-size-base: 0.825rem;
80
+ /* 13.2px */
81
+ --ui-modal-padding: 1rem;
82
+ /* 16px */
83
+ --ui-table-cell-padding: 0.5rem;
84
+ /* 8px */
85
+ }
86
+
87
+ :root[data-density="spacious"] {
88
+ --ui-component-height: 3rem;
89
+ /* 48px */
90
+ --ui-list-row-height: 3.5rem;
91
+ /* 56px */
92
+ --ui-component-padding-x: 1.25rem;
93
+ /* 20px */
94
+ --ui-component-padding-y: 0.75rem;
95
+ /* 12px */
96
+ --ui-button-padding-x: 1.25rem;
97
+ /* 20px */
98
+ --ui-button-padding-y: 0.75rem;
99
+ /* 12px */
100
+ --ui-font-size-base: 1rem;
101
+ /* 16px */
102
+ --ui-modal-padding: 2rem;
103
+ /* 32px */
104
+ --ui-table-cell-padding: 1rem;
105
+ /* 16px */
106
+ }
107
+
108
+ :root {
109
+ /* ========================================
110
+ * Editor-specific Tokens (referencing shadcn tokens)
111
+ * ======================================== */
112
+
113
+ /* Editor Background & Text */
114
+ --mw-bg-canvas: hsl(var(--background));
115
+ --mw-text-primary: hsl(var(--foreground));
116
+ --mw-text-secondary: hsl(var(--muted-foreground));
117
+
118
+ /* Headings */
119
+ --mw-heading-color: hsl(var(--foreground));
120
+ --mw-heading-secondary: hsl(var(--foreground));
121
+
122
+ /* Code Blocks */
123
+ --mw-code-bg: #1e293b;
124
+ --mw-code-text: #e2e8f0;
125
+ --mw-code-border: hsl(var(--border));
126
+
127
+ /* Inline Code */
128
+ --mw-inline-code-bg: #fef2f2;
129
+ --mw-inline-code-text: #b91c1c;
130
+ --mw-inline-code-border: #fecaca;
131
+
132
+ /* Tables */
133
+ --mw-table-border: hsl(var(--border));
134
+ --mw-table-header-bg: hsl(var(--muted));
135
+ --mw-table-header-text: hsl(var(--foreground));
136
+ --mw-table-header-border-bottom: hsl(var(--border) / 0.1);
137
+ --mw-table-row-hover: hsl(var(--accent));
138
+ --mw-table-resize-handle: hsl(var(--primary));
139
+
140
+ /* Blockquotes */
141
+ --mw-quote-border: hsl(var(--primary));
142
+ --mw-quote-text: hsl(var(--muted-foreground));
143
+ --mw-quote-bg: hsl(var(--muted));
144
+
145
+ /* Toolbar Tooltip */
146
+ --mw-tooltip-bg: hsl(var(--popover));
147
+ --mw-tooltip-text: hsl(var(--popover-foreground));
148
+
149
+ /* Toolbar */
150
+ --mw-toolbar-bg: hsl(var(--popover));
151
+ --mw-toolbar-border: hsl(var(--border));
152
+ --mw-toolbar-text: hsl(var(--popover-foreground));
153
+ --mw-toolbar-hover-bg: hsl(var(--accent));
154
+ --mw-toolbar-active-bg: hsl(var(--accent));
155
+ }
156
+
157
+ /* Base Editor Styles */
158
+ .ProseMirror,
159
+ .markdown-wysiwyg-editor {
160
+ background-color: var(--mw-bg-canvas);
161
+ color: var(--mw-text-primary);
162
+ min-height: 100%;
163
+ }
164
+
165
+ .ProseMirror:focus,
166
+ .markdown-wysiwyg-editor:focus {
167
+ outline: none;
168
+ }
169
+
170
+ /* Heading styles for WYSIWYG */
171
+
172
+ .ProseMirror h1 {
173
+ font-size: 2.25rem;
174
+ line-height: 2.5rem;
175
+ font-weight: 700;
176
+ color: var(--mw-heading-color);
177
+ margin-bottom: var(--ui-component-padding-y);
178
+ margin-top: calc(var(--ui-component-padding-y) * 2);
179
+ }
180
+
181
+ .ProseMirror h2 {
182
+ font-size: 1.875rem;
183
+ line-height: 2.25rem;
184
+ font-weight: 700;
185
+ color: var(--mw-heading-color);
186
+ margin-bottom: var(--ui-component-padding-y);
187
+ margin-top: calc(var(--ui-component-padding-y) * 1.5);
188
+ }
189
+
190
+ .ProseMirror h3 {
191
+ font-size: 1.5rem;
192
+ line-height: 2rem;
193
+ font-weight: 600;
194
+ color: var(--mw-heading-color);
195
+ margin-bottom: var(--ui-component-padding-y);
196
+ margin-top: var(--ui-component-padding-y);
197
+ }
198
+
199
+ .ProseMirror h4 {
200
+ font-size: 1.25rem;
201
+ line-height: 1.75rem;
202
+ font-weight: 600;
203
+ color: var(--mw-heading-secondary);
204
+ margin-bottom: var(--ui-component-padding-y);
205
+ margin-top: var(--ui-component-padding-y);
206
+ }
207
+
208
+ .ProseMirror h5 {
209
+ font-size: 1.125rem;
210
+ line-height: 1.75rem;
211
+ font-weight: 500;
212
+ color: var(--mw-heading-secondary);
213
+ margin-bottom: var(--ui-component-padding-y);
214
+ margin-top: var(--ui-component-padding-y);
215
+ }
216
+
217
+ .ProseMirror h6 {
218
+ font-size: 1rem;
219
+ line-height: 1.5rem;
220
+ font-weight: 500;
221
+ color: var(--mw-text-secondary);
222
+ margin-bottom: var(--ui-component-padding-y);
223
+ margin-top: var(--ui-component-padding-y);
224
+ }
225
+
226
+ .ProseMirror p {
227
+ margin-bottom: var(--ui-component-padding-y);
228
+ color: var(--mw-text-primary);
229
+ /* Fixed: use primary text color for paragraphs */
230
+ line-height: 1.6;
231
+ }
232
+
233
+ .ProseMirror a {
234
+ color: #2563eb;
235
+ /* blue-600 */
236
+ text-decoration: underline;
237
+ cursor: pointer;
238
+ }
239
+
240
+ .ProseMirror a:hover {
241
+ color: #1e40af;
242
+ /* blue-800 */
243
+ }
244
+
245
+ .ProseMirror hr {
246
+ border: 0;
247
+ border-top: 1px solid var(--mw-table-border);
248
+ margin: 1.5rem 0;
249
+ }
250
+
251
+ /* List styles */
252
+ .ProseMirror ul,
253
+ .ProseMirror ol {
254
+ padding-left: 1.5rem;
255
+ margin-bottom: 0.75rem;
256
+ margin-top: 0.75rem;
257
+ }
258
+
259
+ .ProseMirror ul {
260
+ list-style-type: disc;
261
+ }
262
+
263
+ .ProseMirror ol {
264
+ list-style-type: decimal;
265
+ }
266
+
267
+ .ProseMirror ul li,
268
+ .ProseMirror ol li {
269
+ margin-bottom: 0.25rem;
270
+ padding-left: 0.25rem;
271
+ color: var(--mw-text-primary);
272
+ }
273
+
274
+ .ProseMirror li>p {
275
+ margin-bottom: 0;
276
+ margin-top: 0;
277
+ }
278
+
279
+ /* Bold, Italic, Strikethrough */
280
+ .ProseMirror strong,
281
+ .ProseMirror b {
282
+ font-weight: 700;
283
+ color: var(--mw-text-primary);
284
+ }
285
+
286
+ .ProseMirror em,
287
+ .ProseMirror i {
288
+ font-style: italic;
289
+ color: var(--mw-text-primary);
290
+ }
291
+
292
+ .ProseMirror s,
293
+ .ProseMirror strike,
294
+ .ProseMirror del {
295
+ color: var(--mw-text-secondary);
296
+ }
297
+
298
+ /* Blockquote styling */
299
+ /* Blockquote styling */
300
+ .ProseMirror blockquote {
301
+ border-left: 4px solid var(--mw-quote-border);
302
+ padding-left: var(--ui-component-padding-x);
303
+ padding-right: var(--ui-component-padding-x);
304
+ font-style: italic;
305
+ color: var(--mw-quote-text);
306
+ background-color: var(--mw-quote-bg);
307
+ padding-top: var(--ui-component-padding-y);
308
+ padding-bottom: var(--ui-component-padding-y);
309
+ border-radius: 0 var(--radius) var(--radius) 0;
310
+ margin-top: var(--ui-component-padding-y);
311
+ margin-bottom: var(--ui-component-padding-y);
312
+ }
313
+
314
+ .ProseMirror blockquote p {
315
+ margin-top: 0.5rem;
316
+ margin-bottom: 0.5rem;
317
+ }
318
+
319
+ .ProseMirror blockquote p:first-child {
320
+ margin-top: 0;
321
+ }
322
+
323
+ .ProseMirror blockquote p:last-child {
324
+ margin-bottom: 0;
325
+ }
326
+
327
+ /* List marker color */
328
+ .ProseMirror ul>li::marker {
329
+ color: var(--mw-heading-secondary);
330
+ font-weight: 600;
331
+ }
332
+
333
+ .ProseMirror ol>li::marker {
334
+ color: var(--mw-heading-secondary);
335
+ font-weight: 600;
336
+ }
337
+
338
+ /* Inline code styling */
339
+ .ProseMirror code:not(pre code) {
340
+ background-color: var(--mw-inline-code-bg);
341
+ color: var(--mw-inline-code-text);
342
+ padding: 2px 6px;
343
+ border-radius: 3px;
344
+ font-size: 0.9em;
345
+ border: 1px solid var(--mw-inline-code-border);
346
+ font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
347
+ font-weight: normal;
348
+ }
349
+
350
+ /* Table styling */
351
+ .ProseMirror table {
352
+ border-collapse: collapse;
353
+ width: 100%;
354
+ margin-top: var(--ui-component-padding-y);
355
+ margin-bottom: var(--ui-component-padding-y);
356
+ overflow: hidden;
357
+ border-radius: var(--radius);
358
+ box-shadow: 0 0 0 2px var(--mw-table-border);
359
+ }
360
+
361
+ .ProseMirror table th,
362
+ .ProseMirror table td {
363
+ border: 2px solid var(--mw-table-border);
364
+ padding: var(--ui-table-cell-padding);
365
+ text-align: left;
366
+ min-width: 100px;
367
+ }
368
+
369
+ .ProseMirror table th {
370
+ background-color: var(--mw-table-header-bg);
371
+ font-weight: 600;
372
+ color: var(--mw-table-header-text);
373
+ border-bottom: 2px solid var(--mw-table-border);
374
+ }
375
+
376
+ .ProseMirror table td {
377
+ background-color: var(--mw-bg-canvas);
378
+ color: var(--mw-text-primary);
379
+ }
380
+
381
+ .ProseMirror table tr:hover td {
382
+ background-color: var(--mw-table-row-hover);
383
+ }
384
+
385
+ /* Table resize handle */
386
+ .ProseMirror .column-resize-handle {
387
+ position: absolute;
388
+ right: -2px;
389
+ top: 0;
390
+ bottom: 0;
391
+ width: 4px;
392
+ background-color: var(--mw-table-resize-handle);
393
+ cursor: col-resize;
394
+ z-index: 20;
395
+ }
396
+
397
+ /* Code block styling */
398
+ /* Code block styling */
399
+ .ProseMirror pre {
400
+ background: var(--mw-code-bg);
401
+ color: var(--mw-code-text);
402
+ padding: var(--ui-component-padding-x);
403
+ border-radius: var(--radius);
404
+ overflow-x: auto;
405
+ margin-top: var(--ui-component-padding-y);
406
+ margin-bottom: var(--ui-component-padding-y);
407
+ font-size: 0.875rem;
408
+ line-height: 1.5;
409
+ }
410
+
411
+ .ProseMirror pre code {
412
+ display: block;
413
+ white-space: pre;
414
+ color: var(--mw-code-text);
415
+ background: transparent;
416
+ border: none;
417
+ padding: 0;
418
+ font-family: "Monaco", "Menlo", "Ubuntu Mono", "Courier New", monospace;
419
+ }
420
+
421
+ .ProseMirror .hljs {
422
+ background: var(--mw-code-bg);
423
+ color: var(--mw-code-text);
424
+ }
425
+
426
+ /* Toolbar tooltip styling */
427
+ .mw-toolbar-root [data-tooltip] {
428
+ position: relative;
429
+ }
430
+
431
+ .mw-toolbar-root [data-tooltip]::before {
432
+ content: attr(data-tooltip);
433
+ position: absolute;
434
+ top: calc(100% + 8px);
435
+ left: 50%;
436
+ transform: translateX(-50%);
437
+ padding: 6px 8px;
438
+ background-color: var(--mw-tooltip-bg);
439
+ color: var(--mw-tooltip-text);
440
+ font-size: 12px;
441
+ white-space: nowrap;
442
+ border-radius: 4px;
443
+ opacity: 0;
444
+ pointer-events: none;
445
+ transition: opacity 0.1s ease-in-out;
446
+ z-index: 1000;
447
+ }
448
+
449
+ .mw-toolbar-root [data-tooltip]::after {
450
+ content: "";
451
+ position: absolute;
452
+ top: calc(100% + 2px);
453
+ left: 50%;
454
+ transform: translateX(-50%);
455
+ border: 6px solid transparent;
456
+ border-bottom-color: var(--mw-tooltip-bg);
457
+ opacity: 0;
458
+ pointer-events: none;
459
+ transition: opacity 0.1s ease-in-out;
460
+ z-index: 1000;
461
+ }
462
+
463
+ .mw-toolbar-root [data-tooltip]:hover::before,
464
+ .mw-toolbar-root [data-tooltip]:hover::after {
465
+ opacity: 1;
466
+ }
467
+
468
+ /* ========================================
469
+ * Emoji Picker Styles
470
+ * ======================================== */
471
+
472
+ .mw-emoji-picker {
473
+ width: 320px;
474
+ max-height: 320px;
475
+ overflow: hidden;
476
+ display: flex;
477
+ flex-direction: column;
478
+ }
479
+
480
+ /* Category tabs */
481
+ .mw-emoji-categories {
482
+ display: flex;
483
+ align-items: center;
484
+ border-bottom: 1px solid var(--mw-toolbar-border, #e5e7eb);
485
+ padding: 4px;
486
+ gap: 2px;
487
+ flex-shrink: 0;
488
+ }
489
+
490
+ .mw-emoji-search {
491
+ padding: 6px;
492
+ border-bottom: 1px solid var(--mw-toolbar-border, #e5e7eb);
493
+ flex-shrink: 0;
494
+ }
495
+
496
+ .mw-emoji-search-input {
497
+ width: 100%;
498
+ height: 32px;
499
+ padding: 0 10px;
500
+ border-radius: 6px;
501
+ border: 1px solid var(--mw-toolbar-border, #d1d5db);
502
+ background-color: var(--mw-bg-canvas, #ffffff);
503
+ color: var(--mw-toolbar-text, #111827);
504
+ font-size: 13px;
505
+ }
506
+
507
+ .mw-emoji-search-input:focus {
508
+ outline: none;
509
+ border-color: var(--mw-ring, rgba(59, 130, 246, 0.75));
510
+ box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
511
+ }
512
+
513
+ .mw-emoji-search-input::placeholder {
514
+ color: var(--mw-text-secondary, #6b7280);
515
+ }
516
+
517
+ .mw-emoji-category-tab {
518
+ width: 32px;
519
+ height: 32px;
520
+ display: flex;
521
+ align-items: center;
522
+ justify-content: center;
523
+ border: 1px solid transparent;
524
+ background: transparent;
525
+ border-radius: var(--radius);
526
+ cursor: pointer;
527
+ transition: background-color 0.15s ease;
528
+ color: var(--mw-toolbar-text, #111827);
529
+ }
530
+
531
+ .mw-emoji-category-tab:hover {
532
+ background-color: var(--mw-toolbar-hover-bg, rgba(0, 0, 0, 0.06));
533
+ }
534
+
535
+ .mw-emoji-category-tab--active {
536
+ background-color: var(--mw-toolbar-active-bg, rgba(0, 0, 0, 0.08));
537
+ color: var(--mw-toolbar-text, #111827);
538
+ border-color: var(--mw-toolbar-border, #d1d5db);
539
+ box-shadow: inset 0 -2px 0 var(--mw-ring, rgba(59, 130, 246, 0.85));
540
+ }
541
+
542
+ .mw-emoji-category-tab:focus-visible {
543
+ outline: none;
544
+ box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
545
+ }
546
+
547
+ .mw-emoji-category-icon {
548
+ font-size: 16px;
549
+ line-height: 1;
550
+ }
551
+
552
+ .mw-emoji-scroll {
553
+ overflow-y: auto;
554
+ overflow-x: hidden;
555
+ scrollbar-gutter: stable;
556
+ flex: 1 1 auto;
557
+ min-height: 0;
558
+ padding: 6px;
559
+ }
560
+
561
+ /* Emoji sections (grouped categories) */
562
+ .mw-emoji-sections {
563
+ display: flex;
564
+ flex-direction: column;
565
+ gap: 10px;
566
+ }
567
+
568
+ .mw-emoji-section-header {
569
+ display: flex;
570
+ align-items: center;
571
+ gap: 6px;
572
+ padding: 4px 2px;
573
+ border-bottom: 1px solid var(--mw-toolbar-border, #e5e7eb);
574
+ margin-bottom: 6px;
575
+ }
576
+
577
+ .mw-emoji-section-icon {
578
+ font-size: 14px;
579
+ line-height: 1;
580
+ }
581
+
582
+ .mw-emoji-section-title {
583
+ font-size: 12px;
584
+ font-weight: 600;
585
+ color: var(--mw-toolbar-text, #111827);
586
+ }
587
+
588
+ /* Emoji grid */
589
+ .mw-emoji-grid {
590
+ display: grid;
591
+ grid-template-columns: repeat(8, minmax(0, 1fr));
592
+ gap: 2px;
593
+ padding: 0;
594
+ }
595
+
596
+ .mw-emoji-empty {
597
+ grid-column: 1 / -1;
598
+ padding: 12px 8px;
599
+ color: var(--mw-text-secondary, #6b7280);
600
+ font-size: 12px;
601
+ }
602
+
603
+ .mw-emoji-item {
604
+ width: 100%;
605
+ height: 36px;
606
+ display: flex;
607
+ align-items: center;
608
+ justify-content: center;
609
+ border: none;
610
+ background: transparent;
611
+ border-radius: var(--radius);
612
+ cursor: pointer;
613
+ transition: background-color 0.15s ease;
614
+ color: var(--mw-toolbar-text, #111827);
615
+ font-size: 20px;
616
+ line-height: 1;
617
+ }
618
+
619
+ .mw-emoji-item:hover {
620
+ background-color: var(--mw-toolbar-hover-bg, rgba(0, 0, 0, 0.06));
621
+ }
622
+
623
+ .mw-emoji-item:focus {
624
+ outline: 2px solid var(--mw-toolbar-border, #e5e7eb);
625
+ outline-offset: -2px;
626
+ }
627
+
628
+ .mw-emoji-item:disabled {
629
+ opacity: 0.5;
630
+ cursor: not-allowed;
631
+ }
632
+
633
+ .mw-emoji-char {
634
+ font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "EmojiOne Color",
635
+ "Android Emoji", sans-serif;
636
+ font-style: normal;
637
+ font-weight: normal;
638
+ line-height: 1;
639
+ }
640
+
641
+ .mw-image-picker {
642
+ width: 320px;
643
+ max-height: 360px;
644
+ overflow: hidden;
645
+ display: flex;
646
+ flex-direction: column;
647
+ }
648
+
649
+ .mw-image-body {
650
+ padding: 10px;
651
+ }
652
+
653
+ .mw-image-form {
654
+ display: flex;
655
+ flex-direction: column;
656
+ gap: 6px;
657
+ }
658
+
659
+ .mw-image-label {
660
+ font-size: 12px;
661
+ font-weight: 600;
662
+ color: var(--mw-text-secondary, #6b7280);
663
+ }
664
+
665
+ .mw-image-input {
666
+ width: 100%;
667
+ height: 34px;
668
+ padding: 0 10px;
669
+ border-radius: var(--radius);
670
+ border: 1px solid var(--mw-toolbar-border, #d1d5db);
671
+ background-color: var(--mw-bg-canvas, #ffffff);
672
+ color: var(--mw-text-primary, #111827);
673
+ font-size: 13px;
674
+ }
675
+
676
+ .mw-image-input:focus {
677
+ outline: none;
678
+ border-color: var(--mw-ring, rgba(59, 130, 246, 0.75));
679
+ box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
680
+ }
681
+
682
+ .mw-image-actions {
683
+ display: flex;
684
+ justify-content: flex-end;
685
+ margin-top: 6px;
686
+ }
687
+
688
+ .mw-image-insert {
689
+ height: 34px;
690
+ padding: 0 12px;
691
+ border-radius: 6px;
692
+ cursor: pointer;
693
+ font-size: 13px;
694
+ font-weight: 600;
695
+ }
696
+
697
+ .mw-image-insert:hover {
698
+ background-color: var(--mw-toolbar-hover-bg, rgba(0, 0, 0, 0.06));
699
+ }
700
+
701
+ .mw-image-insert:disabled {
702
+ opacity: 0.5;
703
+ cursor: not-allowed;
704
+ }