@cyberyozh/text-editor 0.1.1

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 (209) hide show
  1. package/README.md +102 -0
  2. package/dist/editor.css +2069 -0
  3. package/dist/editor.css.map +1 -0
  4. package/dist/editor.d.mts +45 -0
  5. package/dist/editor.d.ts +45 -0
  6. package/dist/editor.js +6155 -0
  7. package/dist/editor.js.map +1 -0
  8. package/dist/editor.mjs +6118 -0
  9. package/dist/editor.mjs.map +1 -0
  10. package/dist/render/client.d.mts +24 -0
  11. package/dist/render/client.d.ts +24 -0
  12. package/dist/render/client.js +98 -0
  13. package/dist/render/client.js.map +1 -0
  14. package/dist/render/client.mjs +74 -0
  15. package/dist/render/client.mjs.map +1 -0
  16. package/dist/render.d.mts +58 -0
  17. package/dist/render.d.ts +58 -0
  18. package/dist/render.js +2521 -0
  19. package/dist/render.js.map +1 -0
  20. package/dist/render.mjs +2484 -0
  21. package/dist/render.mjs.map +1 -0
  22. package/dist/styles/index.css +2068 -0
  23. package/package.json +92 -0
  24. package/src/editor/commands/items.ts +374 -0
  25. package/src/editor/commands/suggestion.tsx +146 -0
  26. package/src/editor/components/button/button.css +56 -0
  27. package/src/editor/components/button/button.tsx +35 -0
  28. package/src/editor/components/button/index.ts +1 -0
  29. package/src/editor/components/common-modal/common-modal.css +85 -0
  30. package/src/editor/components/common-modal/common-modal.tsx +58 -0
  31. package/src/editor/components/common-modal/index.ts +1 -0
  32. package/src/editor/components/index.ts +3 -0
  33. package/src/editor/components/input/index.ts +1 -0
  34. package/src/editor/components/input/input.css +43 -0
  35. package/src/editor/components/input/input.tsx +22 -0
  36. package/src/editor/context/dialog-command.tsx +47 -0
  37. package/src/editor/context/index.ts +2 -0
  38. package/src/editor/context/translations-context.tsx +28 -0
  39. package/src/editor/controls/bubble-menu-content.tsx +394 -0
  40. package/src/editor/controls/callout-menu.tsx +169 -0
  41. package/src/editor/controls/character-count.tsx +36 -0
  42. package/src/editor/controls/commands-list.tsx +117 -0
  43. package/src/editor/controls/drag-handle.tsx +98 -0
  44. package/src/editor/controls/emoji-picker.tsx +62 -0
  45. package/src/editor/controls/index.ts +5 -0
  46. package/src/editor/controls/table-menu.tsx +322 -0
  47. package/src/editor/dialogs/add-katex-dialog/add-katex-dialog.css +115 -0
  48. package/src/editor/dialogs/add-katex-dialog/add-katex-dialog.tsx +116 -0
  49. package/src/editor/dialogs/add-katex-dialog/index.ts +1 -0
  50. package/src/editor/dialogs/add-link-dialog/add-link-dialog.css +105 -0
  51. package/src/editor/dialogs/add-link-dialog/add-link-dialog.tsx +177 -0
  52. package/src/editor/dialogs/add-link-dialog/index.ts +1 -0
  53. package/src/editor/dialogs/add-video-dialog/add-video-dialog.css +146 -0
  54. package/src/editor/dialogs/add-video-dialog/add-video-dialog.tsx +157 -0
  55. package/src/editor/dialogs/add-video-dialog/index.ts +1 -0
  56. package/src/editor/dialogs/image-dialog/image-dialog.css +101 -0
  57. package/src/editor/dialogs/image-dialog/image-dialog.tsx +276 -0
  58. package/src/editor/dialogs/image-dialog/index.ts +1 -0
  59. package/src/editor/dialogs/index.ts +4 -0
  60. package/src/editor/editor.tsx +247 -0
  61. package/src/editor/handlers/create-image-upload-handler.ts +24 -0
  62. package/src/editor/handlers/dialog-handlers.ts +143 -0
  63. package/src/editor/handlers/index.ts +8 -0
  64. package/src/editor/index.ts +3 -0
  65. package/src/extensions/base/callout.ts +138 -0
  66. package/src/extensions/base/code-block.ts +24 -0
  67. package/src/extensions/base/compatibility.ts +493 -0
  68. package/src/extensions/base/copyable-text.ts +56 -0
  69. package/src/extensions/base/custom-quote.ts +174 -0
  70. package/src/extensions/base/figure.ts +141 -0
  71. package/src/extensions/base/index.ts +19 -0
  72. package/src/extensions/base/link.ts +18 -0
  73. package/src/extensions/base/myth-reality.ts +45 -0
  74. package/src/extensions/base/prompt.ts +109 -0
  75. package/src/extensions/base/video.ts +29 -0
  76. package/src/extensions/editor/callout.ts +43 -0
  77. package/src/extensions/editor/code-block.ts +9 -0
  78. package/src/extensions/editor/commands.ts +43 -0
  79. package/src/extensions/editor/copyable-text.ts +16 -0
  80. package/src/extensions/editor/custom-quote.ts +54 -0
  81. package/src/extensions/editor/figure.ts +20 -0
  82. package/src/extensions/editor/get-editor-extensions.ts +113 -0
  83. package/src/extensions/editor/index.ts +25 -0
  84. package/src/extensions/editor/prompt.ts +43 -0
  85. package/src/extensions/editor/video.ts +23 -0
  86. package/src/extensions/render/get-render-extensions.ts +74 -0
  87. package/src/extensions/render/index.ts +6 -0
  88. package/src/extensions/views/components/callout.tsx +70 -0
  89. package/src/extensions/views/components/code-block.tsx +73 -0
  90. package/src/extensions/views/components/copy-button.tsx +52 -0
  91. package/src/extensions/views/components/copyable-text.tsx +11 -0
  92. package/src/extensions/views/components/custom-quote.tsx +64 -0
  93. package/src/extensions/views/components/figure.tsx +63 -0
  94. package/src/extensions/views/components/index.ts +7 -0
  95. package/src/extensions/views/components/prompt.tsx +43 -0
  96. package/src/extensions/views/components/video.tsx +40 -0
  97. package/src/extensions/views/node-views/callout.tsx +51 -0
  98. package/src/extensions/views/node-views/code-block.tsx +30 -0
  99. package/src/extensions/views/node-views/copyable-text.tsx +10 -0
  100. package/src/extensions/views/node-views/custom-quote.tsx +66 -0
  101. package/src/extensions/views/node-views/figure.tsx +38 -0
  102. package/src/extensions/views/node-views/index.ts +7 -0
  103. package/src/extensions/views/node-views/prompt.tsx +35 -0
  104. package/src/extensions/views/node-views/video.tsx +19 -0
  105. package/src/icons/Check.tsx +12 -0
  106. package/src/icons/Copy.tsx +15 -0
  107. package/src/icons/DragIcon.tsx +10 -0
  108. package/src/icons/Edit.tsx +12 -0
  109. package/src/icons/Quote.tsx +10 -0
  110. package/src/icons/X.tsx +13 -0
  111. package/src/icons/color/TiptapCalloutError.tsx +25 -0
  112. package/src/icons/color/TiptapCalloutInfo.tsx +18 -0
  113. package/src/icons/color/TiptapCalloutSuccess.tsx +49 -0
  114. package/src/icons/color/TiptapCalloutWarning.tsx +28 -0
  115. package/src/icons/color/index.ts +4 -0
  116. package/src/icons/index.ts +60 -0
  117. package/src/icons/menu/AddImage.tsx +10 -0
  118. package/src/icons/menu/AlignCenter.tsx +10 -0
  119. package/src/icons/menu/AlignLeft.tsx +10 -0
  120. package/src/icons/menu/AlignRight.tsx +10 -0
  121. package/src/icons/menu/ArrowDown.tsx +13 -0
  122. package/src/icons/menu/ArrowLeft.tsx +13 -0
  123. package/src/icons/menu/ArrowRight.tsx +13 -0
  124. package/src/icons/menu/ArrowUp.tsx +13 -0
  125. package/src/icons/menu/Blockquote.tsx +7 -0
  126. package/src/icons/menu/Bold.tsx +10 -0
  127. package/src/icons/menu/BulletList.tsx +10 -0
  128. package/src/icons/menu/CalloutError.tsx +10 -0
  129. package/src/icons/menu/CalloutInfo.tsx +12 -0
  130. package/src/icons/menu/CalloutSuccess.tsx +10 -0
  131. package/src/icons/menu/CalloutWarning.tsx +12 -0
  132. package/src/icons/menu/ClearFormatting.tsx +10 -0
  133. package/src/icons/menu/Code.tsx +10 -0
  134. package/src/icons/menu/CodeBlock.tsx +10 -0
  135. package/src/icons/menu/Copyable.tsx +10 -0
  136. package/src/icons/menu/CustomQuote.tsx +17 -0
  137. package/src/icons/menu/DeleteColumn.tsx +17 -0
  138. package/src/icons/menu/DeleteRow.tsx +17 -0
  139. package/src/icons/menu/Details.tsx +10 -0
  140. package/src/icons/menu/H2.tsx +10 -0
  141. package/src/icons/menu/H3.tsx +10 -0
  142. package/src/icons/menu/H4.tsx +10 -0
  143. package/src/icons/menu/H5.tsx +10 -0
  144. package/src/icons/menu/H6.tsx +10 -0
  145. package/src/icons/menu/Highlight.tsx +13 -0
  146. package/src/icons/menu/HorizontalRule.tsx +7 -0
  147. package/src/icons/menu/Italic.tsx +10 -0
  148. package/src/icons/menu/Link.tsx +10 -0
  149. package/src/icons/menu/LinkOff.tsx +10 -0
  150. package/src/icons/menu/Math.tsx +10 -0
  151. package/src/icons/menu/MergeCells.tsx +10 -0
  152. package/src/icons/menu/MythReality.tsx +10 -0
  153. package/src/icons/menu/OrderedList.tsx +10 -0
  154. package/src/icons/menu/Prompt.tsx +18 -0
  155. package/src/icons/menu/Redo.tsx +14 -0
  156. package/src/icons/menu/SplitCells.tsx +7 -0
  157. package/src/icons/menu/Strikethrough.tsx +10 -0
  158. package/src/icons/menu/Subscript.tsx +10 -0
  159. package/src/icons/menu/Superscript.tsx +10 -0
  160. package/src/icons/menu/Table.tsx +14 -0
  161. package/src/icons/menu/TableColumnHeading.tsx +7 -0
  162. package/src/icons/menu/TableRowHeading.tsx +10 -0
  163. package/src/icons/menu/TextColor.tsx +13 -0
  164. package/src/icons/menu/Underline.tsx +10 -0
  165. package/src/icons/menu/Undo.tsx +14 -0
  166. package/src/icons/menu/Video.tsx +14 -0
  167. package/src/icons/menu/index.ts +49 -0
  168. package/src/render/index.ts +22 -0
  169. package/src/render/static-renderer-config.tsx +206 -0
  170. package/src/render/tiptap-interactivity-provider.tsx +78 -0
  171. package/src/render/tiptap-render.tsx +102 -0
  172. package/src/styles/components.css +10 -0
  173. package/src/styles/editor/base.css +39 -0
  174. package/src/styles/editor/callout-menu.css +81 -0
  175. package/src/styles/editor/controls.css +57 -0
  176. package/src/styles/editor/emoji-picker.css +113 -0
  177. package/src/styles/editor/index.css +9 -0
  178. package/src/styles/editor/menus.css +16 -0
  179. package/src/styles/editor/states.css +43 -0
  180. package/src/styles/editor/typography.css +165 -0
  181. package/src/styles/editor/utilities.css +71 -0
  182. package/src/styles/editor/variables.css +70 -0
  183. package/src/styles/extensions/callout.css +155 -0
  184. package/src/styles/extensions/code-block.css +109 -0
  185. package/src/styles/extensions/commands-list.css +83 -0
  186. package/src/styles/extensions/custom-quote.css +103 -0
  187. package/src/styles/extensions/details.css +87 -0
  188. package/src/styles/extensions/figure.css +66 -0
  189. package/src/styles/extensions/index.css +11 -0
  190. package/src/styles/extensions/math.css +32 -0
  191. package/src/styles/extensions/myth-reality.css +59 -0
  192. package/src/styles/extensions/prompt.css +75 -0
  193. package/src/styles/extensions/table.css +253 -0
  194. package/src/styles/extensions/video.css +53 -0
  195. package/src/styles/styles.css +3 -0
  196. package/src/translations/en.json +158 -0
  197. package/src/translations/ru.json +158 -0
  198. package/src/types/image-handler.ts +33 -0
  199. package/src/types/index.ts +1 -0
  200. package/src/utils/copy-to-clipboard.ts +23 -0
  201. package/src/utils/custom-emoji.ts +174 -0
  202. package/src/utils/detect-video-hosting.ts +106 -0
  203. package/src/utils/get-shared-extensions.ts +45 -0
  204. package/src/utils/get-translations.ts +25 -0
  205. package/src/utils/handle-exit-node.ts +61 -0
  206. package/src/utils/image-src-resolver.ts +74 -0
  207. package/src/utils/index.ts +2 -0
  208. package/src/utils/migrate-legacy-callouts.ts +59 -0
  209. package/src/utils/pluralize.ts +38 -0
@@ -0,0 +1,109 @@
1
+ :root {
2
+ --tiptap-code-block-background: #111927;
3
+ --tiptap-code-block-border: #404040;
4
+ --tiptap-code-block-text: #e0e0e0;
5
+ --tiptap-code-block-copy-button: #eaecef;
6
+ --tiptap-code-block-copy-button-hover: #cdc8c8;
7
+ --tiptap-code-block-font-family: 'Fira Code', monospace;
8
+ }
9
+
10
+ .tiptap-code-block-wrapper {
11
+ display: flex;
12
+ flex-direction: column;
13
+ margin: 32px 0;
14
+ padding: 24px;
15
+ overflow: hidden;
16
+ border-radius: var(--tiptap-radius);
17
+ background-color: var(--tiptap-code-block-background);
18
+ }
19
+
20
+ .tiptap-code-block-header {
21
+ display: flex;
22
+ align-items: center;
23
+ justify-content: space-between;
24
+ padding-bottom: 16px;
25
+ gap: 12px;
26
+ border-bottom: 1px solid var(--tiptap-code-block-border);
27
+ }
28
+
29
+ .tiptap-code-block-language-select {
30
+ flex: 1;
31
+ max-width: 50%;
32
+ padding: 6px 12px;
33
+ border: 1px solid var(--tiptap-code-block-border);
34
+ border-radius: 4px;
35
+ background-color: var(--tiptap-code-block-background);
36
+ color: var(--tiptap-code-block-text);
37
+ font-size: 14px;
38
+ font-family: var(--tiptap-code-block-font-family);
39
+ cursor: pointer;
40
+ }
41
+
42
+ .tiptap-code-block-language-select:focus {
43
+ border-color: var(--tiptap-color-primary);
44
+ outline: none;
45
+ background-color: var(--tiptap-color-primary-subtle);
46
+ }
47
+
48
+ .tiptap-code-block-language-select option {
49
+ background-color: var(--tiptap-code-block-background);
50
+ color: var(--tiptap-code-block-text);
51
+ }
52
+
53
+ .tiptap-code-block-language-text {
54
+ display: inline-block;
55
+ flex: 1;
56
+ max-width: 50%;
57
+ color: var(--tiptap-code-block-text);
58
+ font-family: var(--tiptap-code-block-font-family);
59
+ }
60
+
61
+ .tiptap-code-block-copy-button {
62
+ display: flex;
63
+ align-items: center;
64
+ justify-content: center;
65
+ width: 30px;
66
+ height: 30px;
67
+ border: none;
68
+ outline: none;
69
+ background-color: transparent;
70
+ color: var(--tiptap-code-block-copy-button);
71
+ cursor: pointer;
72
+ transition: all 150ms ease-in-out;
73
+ }
74
+
75
+ .tiptap-code-block-copy-button svg {
76
+ width: 24px;
77
+ height: 24px;
78
+ }
79
+
80
+ .tiptap-code-block-copy-button:hover {
81
+ color: var(--tiptap-code-block-copy-button-hover);
82
+ }
83
+
84
+ .tiptap-code-block {
85
+ margin: 0;
86
+ padding: 24px 0;
87
+ overflow-x: auto;
88
+ color: var(--tiptap-code-block-text);
89
+ font-size: var(--tiptap-font-size);
90
+ line-height: 1.5;
91
+ font-family: var(--tiptap-code-block-font-family);
92
+ }
93
+
94
+ .tiptap-code-block::-webkit-scrollbar {
95
+ height: 8px;
96
+ }
97
+
98
+ .tiptap-code-block::-webkit-scrollbar-track {
99
+ background-color: var(--tiptap-code-block-background);
100
+ }
101
+
102
+ .tiptap-code-block::-webkit-scrollbar-thumb {
103
+ border-radius: 4px;
104
+ background-color: var(--tiptap-code-block-border);
105
+ }
106
+
107
+ .tiptap-code-block::-webkit-scrollbar-thumb:hover {
108
+ background-color: var(--tiptap-color-primary);
109
+ }
@@ -0,0 +1,83 @@
1
+ .commands-list-container {
2
+ display: flex;
3
+ z-index: 50;
4
+ flex-direction: column;
5
+ width: 280px;
6
+ max-height: 300px;
7
+ padding: 12px;
8
+ overflow-y: auto;
9
+ gap: 6px;
10
+ border: 1px solid var(--tiptap-color-primary-light);
11
+ border-radius: var(--tiptap-radius);
12
+ background-color: var(--tiptap-bg-surface-menu);
13
+ box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
14
+ scrollbar-color: black transparent;
15
+ scrollbar-width: thin;
16
+ }
17
+
18
+ .commands-list-container::-webkit-scrollbar {
19
+ width: 6px;
20
+ height: 6px;
21
+ }
22
+
23
+ .commands-list-container::-webkit-scrollbar-track {
24
+ border-radius: 10px;
25
+ background: transparent;
26
+ }
27
+
28
+ .commands-list-container::-webkit-scrollbar-thumb {
29
+ border-radius: 10px;
30
+ background: black;
31
+ }
32
+
33
+ .commands-list-container::-webkit-scrollbar-thumb:hover {
34
+ background: #333;
35
+ }
36
+
37
+ .commands-list-item {
38
+ display: flex;
39
+ align-items: center;
40
+ width: 100%;
41
+ padding: 6px 12px;
42
+ gap: 8px;
43
+ border: none;
44
+ border-radius: 4px;
45
+ background: transparent;
46
+ color: var(--tiptap-color-primary);
47
+ font-weight: 500;
48
+ font-size: 14px;
49
+ text-align: left;
50
+ cursor: pointer;
51
+ transition: all 0.15s ease-in-out;
52
+ }
53
+
54
+ .commands-list-item:hover {
55
+ outline: 1px solid var(--tiptap-color-primary-light);
56
+ background-color: var(--tiptap-color-primary-subtle);
57
+ }
58
+
59
+ .commands-list-item.active {
60
+ outline: none;
61
+ background-color: var(--tiptap-color-primary);
62
+ color: var(--tiptap-state-control-active-color);
63
+ }
64
+
65
+ .commands-list-icon svg {
66
+ width: 24px;
67
+ height: 24px;
68
+ }
69
+
70
+ .commands-list-title {
71
+ flex: 1;
72
+ font-weight: 500;
73
+ }
74
+
75
+ .commands-list-empty {
76
+ padding: 20px 12px;
77
+ border: none;
78
+ border-radius: 4px;
79
+ background: transparent;
80
+ color: var(--tiptap-color-text-placeholder);
81
+ font-size: 14px;
82
+ text-align: center;
83
+ }
@@ -0,0 +1,103 @@
1
+ [data-custom-quote] {
2
+ display: flex;
3
+ flex-direction: column;
4
+ margin: 24px 0;
5
+ padding: 8px;
6
+ border-radius: 8px;
7
+ text-align: center;
8
+ }
9
+
10
+ .custom-quote-divider {
11
+ width: 100%;
12
+ height: 1px;
13
+ }
14
+
15
+ .custom-quote-svg-wrapper {
16
+ display: flex;
17
+ align-items: center;
18
+ justify-content: center;
19
+ margin: 24px 0;
20
+ color: var(--tiptap-color-primary);
21
+ }
22
+
23
+ .custom-quote-svg-wrapper svg {
24
+ width: 48px;
25
+ height: 48px;
26
+ }
27
+
28
+ [data-custom-quote-text] {
29
+ display: flex;
30
+ flex-direction: column;
31
+ max-width: 700px;
32
+ margin: 0 auto 16px;
33
+ }
34
+
35
+ [data-custom-quote-text] .is-empty::before {
36
+ position: absolute;
37
+ left: 50%;
38
+ transform: translateX(-50%);
39
+ content: attr(data-placeholder);
40
+ color: var(--tiptap-color-text-placeholder);
41
+ pointer-events: none;
42
+ }
43
+
44
+ [data-custom-quote-text] p {
45
+ margin: 0;
46
+ font-weight: 500;
47
+ font-size: 18px;
48
+ line-height: 140%;
49
+ letter-spacing: -0.36px;
50
+ }
51
+
52
+ [data-custom-quote-author] {
53
+ display: flex;
54
+ flex-direction: column;
55
+ margin-bottom: 4px;
56
+ font-weight: 500;
57
+ font-size: 14px;
58
+ line-height: 130%;
59
+ letter-spacing: -0.14px;
60
+ }
61
+
62
+ [data-custom-quote-author] .is-empty::before {
63
+ position: absolute;
64
+ left: 50%;
65
+ transform: translateX(-50%);
66
+ content: attr(data-placeholder);
67
+ color: var(--tiptap-color-text-placeholder);
68
+ pointer-events: none;
69
+ }
70
+
71
+ [data-custom-quote-author] p {
72
+ margin: 0;
73
+ color: #000;
74
+ font-weight: 600;
75
+ font-size: 14px;
76
+ line-height: 1.43;
77
+ text-align: center;
78
+ }
79
+
80
+ [data-custom-quote-sign] {
81
+ display: flex;
82
+ flex-direction: column;
83
+ color: #6a6a6a;
84
+ font-size: 12px;
85
+ line-height: 120%;
86
+ letter-spacing: 0px;
87
+ }
88
+
89
+ [data-custom-quote-sign] .is-empty::before {
90
+ position: absolute;
91
+ left: 50%;
92
+ transform: translateX(-50%);
93
+ content: attr(data-placeholder);
94
+ color: var(--tiptap-color-text-placeholder);
95
+ pointer-events: none;
96
+ }
97
+
98
+ [data-custom-quote-sign] p {
99
+ margin: 0;
100
+ font-size: 12px;
101
+ line-height: 1.5;
102
+ text-align: center;
103
+ }
@@ -0,0 +1,87 @@
1
+ /* Editor view with custom button */
2
+ [data-type="details"] {
3
+ display: flex;
4
+ align-items: baseline;
5
+ margin: 24px 0;
6
+ padding: 8px;
7
+ gap: 8px;
8
+ border: 1px solid var(--tiptap-color-primary-light);
9
+ border-radius: 8px;
10
+ }
11
+
12
+ [data-type="details"] > button {
13
+ border: none;
14
+ outline: none;
15
+ background: transparent;
16
+ color: var(--tiptap-color-primary);
17
+ cursor: pointer;
18
+ transition: all 150ms ease-in-out;
19
+ }
20
+
21
+ [data-type="details"] > button::before {
22
+ position: relative;
23
+ bottom: 2px;
24
+ content: "▶";
25
+ }
26
+
27
+ [data-type="details"] > div {
28
+ display: flex;
29
+ flex-direction: column;
30
+ width: 100%;
31
+ gap: 8px;
32
+ }
33
+
34
+ [data-type="details"].is-open > button {
35
+ transform: rotate(90deg);
36
+ }
37
+
38
+ /* Native HTML details element (server-rendered) */
39
+ .tiptap details.details {
40
+ align-items: baseline;
41
+ margin: 24px 0;
42
+ padding: 8px;
43
+ gap: 8px;
44
+ border: 1px solid var(--tiptap-color-primary-light);
45
+ border-radius: 8px;
46
+ }
47
+
48
+ .tiptap details.details summary {
49
+ display: flex;
50
+ flex: 1;
51
+ align-items: baseline;
52
+ gap: 8px;
53
+ border: none;
54
+ outline: none;
55
+ background: transparent;
56
+ list-style: none;
57
+ cursor: pointer;
58
+ transition: all 150ms ease-in-out;
59
+ }
60
+
61
+ /* Custom marker styling using ::before since ::marker doesn't support transform */
62
+ .tiptap details.details summary::before {
63
+ display: inline-block;
64
+ flex-shrink: 0;
65
+ content: "▶";
66
+ color: var(--tiptap-color-primary);
67
+ font-size: 16px;
68
+ transition: transform 150ms ease-in-out;
69
+ }
70
+
71
+ .tiptap details.details[open] summary::before {
72
+ transform: rotate(90deg);
73
+ }
74
+
75
+ /* Hide the default marker */
76
+ .tiptap details.details summary::-webkit-details-marker {
77
+ display: none;
78
+ }
79
+
80
+ .tiptap details.details > div[data-type="detailsContent"] {
81
+ display: flex;
82
+ flex-direction: column;
83
+ width: 100%;
84
+ margin-top: 12px;
85
+ padding-left: 20px;
86
+ gap: 8px;
87
+ }
@@ -0,0 +1,66 @@
1
+ .tiptap figure {
2
+ display: flex;
3
+ flex-direction: column;
4
+ align-items: center;
5
+ margin: 24px auto;
6
+ }
7
+
8
+ .figure-image-container {
9
+ display: inline-block;
10
+ position: relative;
11
+ }
12
+
13
+ .figure-image-container img {
14
+ display: block;
15
+ max-width: 100%;
16
+ height: auto;
17
+ border-radius: 12px;
18
+ }
19
+
20
+ .figure-edit-button {
21
+ display: flex;
22
+ position: absolute;
23
+ top: 12px;
24
+ right: 12px;
25
+ align-items: center;
26
+ justify-content: center;
27
+ width: 32px;
28
+ height: 32px;
29
+ padding: 0;
30
+ border: 1px solid var(--tiptap-color-border);
31
+ border-radius: 50%;
32
+ background: var(--tiptap-bg-surface-menu);
33
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
34
+ color: var(--ui-text-primary);
35
+ cursor: pointer;
36
+ opacity: 0;
37
+ transition: all 0.2s ease;
38
+ }
39
+
40
+ .figure-edit-button svg {
41
+ width: 16px;
42
+ height: 16px;
43
+ }
44
+
45
+ .figure-image-container:hover .figure-edit-button,
46
+ .figure-selected .figure-edit-button {
47
+ opacity: 1;
48
+ }
49
+
50
+ .figure-edit-button:hover {
51
+ border-color: var(--tiptap-color-primary);
52
+ color: var(--tiptap-color-primary);
53
+ }
54
+
55
+ .figure-edit-button:active {
56
+ transform: scale(0.95);
57
+ }
58
+
59
+ .tiptap figure figcaption {
60
+ margin-top: 12px;
61
+ font-weight: 600;
62
+ font-size: 16px;
63
+ line-height: 24px;
64
+ letter-spacing: -0.32px;
65
+ text-align: center;
66
+ }
@@ -0,0 +1,11 @@
1
+ @import './figure.css';
2
+ @import './table.css';
3
+ @import './details.css';
4
+ @import './myth-reality.css';
5
+ @import './custom-quote.css';
6
+ @import './callout.css';
7
+ @import './code-block.css';
8
+ @import './prompt.css';
9
+ @import './video.css';
10
+ @import './math.css';
11
+ @import './commands-list.css';
@@ -0,0 +1,32 @@
1
+ /* Inline Math */
2
+ .tiptap .tiptap-mathematics-render[data-type='inline-math'] {
3
+ display: inline-block;
4
+ padding: 2px 6px;
5
+ border-radius: 4px;
6
+ transition: all 150ms ease-in-out;
7
+ }
8
+
9
+ .tiptap[contenteditable='true'] .tiptap-mathematics-render[data-type='inline-math'] {
10
+ cursor: pointer;
11
+ }
12
+
13
+ .tiptap[contenteditable='true'] .tiptap-mathematics-render[data-type='inline-math']:hover {
14
+ background-color: var(--tiptap-color-primary-subtle);
15
+ }
16
+
17
+ /* Block Math */
18
+ .tiptap .tiptap-mathematics-render[data-type='block-math'] {
19
+ display: block;
20
+ margin: 16px 0;
21
+ padding: 8px 12px;
22
+ border-radius: 6px;
23
+ transition: all 150ms ease-in-out;
24
+ }
25
+
26
+ .tiptap[contenteditable='true'] .tiptap-mathematics-render[data-type='block-math'] {
27
+ cursor: pointer;
28
+ }
29
+
30
+ .tiptap[contenteditable='true'] .tiptap-mathematics-render[data-type='block-math']:hover {
31
+ background-color: var(--tiptap-color-primary-subtle);
32
+ }
@@ -0,0 +1,59 @@
1
+ :root {
2
+ --tiptap-myth-bg--light: #fff0ef;
3
+ --tiptap-myth-bg--dark: #ff000014;
4
+
5
+ --tiptap-reality-bg--light: #f0fdf9;
6
+ --tiptap-reality-bg--dark: #1bae7514;
7
+ }
8
+
9
+ [data-myth-reality] {
10
+ display: flex;
11
+ flex-direction: column;
12
+ margin: 32px 0;
13
+ gap: 16px;
14
+ }
15
+
16
+ [data-myth-reality-block] {
17
+ flex: 1;
18
+ padding: 24px;
19
+ padding-left: 20px;
20
+ border-radius: 10px;
21
+ }
22
+
23
+ [data-myth-reality-block]:first-child .myth-reality-block-content {
24
+ padding-left: 16px;
25
+ border-left: 3px solid #ff363a;
26
+ }
27
+
28
+ [data-myth-reality-block]:first-child {
29
+ border-radius: 10px;
30
+ background-color: var(--tiptap-myth-bg--light);
31
+ }
32
+
33
+ [data-theme="dark"] [data-myth-reality-block]:first-child {
34
+ background-color: var(--tiptap-myth-bg--dark);
35
+ }
36
+
37
+ [data-myth-reality-block]:last-child .myth-reality-block-content {
38
+ padding-left: 16px;
39
+ border-left: 3px solid #30cf40;
40
+ }
41
+
42
+ [data-myth-reality-block]:last-child {
43
+ background-color: var(--tiptap-reality-bg--light);
44
+ }
45
+
46
+ [data-theme="dark"] [data-myth-reality-block]:last-child {
47
+ background-color: var(--tiptap-reality-bg--dark);
48
+ }
49
+
50
+ .myth-reality-block-content p:first-child {
51
+ margin-bottom: 8px;
52
+ font-weight: 600;
53
+ }
54
+
55
+ .myth-reality-block-content ul p,
56
+ .myth-reality-block-content li p {
57
+ margin-bottom: 0;
58
+ font-size: var(--tiptap-font-size);
59
+ }
@@ -0,0 +1,75 @@
1
+ :root {
2
+ --tiptap-prompt-background--light: #f2f7fe;
3
+ --tiptap-prompt-content-background--light: #fff;
4
+
5
+ --tiptap-prompt-background--dark: #0d6efd26;
6
+ --tiptap-prompt-content-background--dark: #101012;
7
+
8
+ --tiptap-prompt-action-color: #0d6efd;
9
+
10
+ --tiptap-prompt-border-radius: 20px;
11
+ --tiptap-prompt-content-border-radius: 12px;
12
+ --tiptap-prompt-padding: 24px;
13
+ --tiptap-prompt-content-padding: 16px;
14
+ --tiptap-prompt-max-height: 220px;
15
+ --tiptap-prompt-font-family: "Fira Code", monospace;
16
+ --tiptap-prompt-font-size: 16px;
17
+ --tiptap-prompt-header-font-size: 20px;
18
+ }
19
+
20
+ [data-prompt] {
21
+ display: flex;
22
+ flex-direction: column;
23
+ margin: 24px 0;
24
+ padding: var(--tiptap-prompt-padding);
25
+ gap: 8px;
26
+ border-radius: var(--tiptap-prompt-border-radius);
27
+ background-color: var(--tiptap-prompt-background--light);
28
+ }
29
+
30
+ [data-theme="dark"] [data-prompt] {
31
+ background-color: var(--tiptap-prompt-background--dark);
32
+ }
33
+
34
+ .prompt-header-wrapper {
35
+ display: flex;
36
+ position: relative;
37
+ justify-content: space-between;
38
+ margin-bottom: 16px;
39
+ gap: 8px;
40
+ font-weight: 600;
41
+ font-size: var(--tiptap-prompt-header-font-size);
42
+ }
43
+
44
+ .prompt-content-wrapper {
45
+ display: flex;
46
+ flex-direction: column;
47
+ max-height: var(--tiptap-prompt-max-height);
48
+ padding: var(--tiptap-prompt-content-padding);
49
+ overflow-y: auto;
50
+ gap: 8px;
51
+ border-radius: var(--tiptap-prompt-content-border-radius);
52
+ background-color: var(--tiptap-prompt-content-background--light);
53
+ font-weight: 400;
54
+ font-size: var(--tiptap-prompt-font-size);
55
+ line-height: 24px;
56
+ font-family: var(--tiptap-prompt-font-family);
57
+ }
58
+
59
+ [data-theme="dark"] .prompt-content-wrapper {
60
+ background-color: var(--tiptap-prompt-content-background--dark);
61
+ }
62
+
63
+ .prompt-copy-icon-wrapper {
64
+ display: flex;
65
+ flex-shrink: 0;
66
+ align-items: center;
67
+ justify-content: center;
68
+ color: var(--tiptap-prompt-action-color);
69
+ cursor: pointer;
70
+ }
71
+
72
+ .prompt-copy-icon-wrapper svg {
73
+ width: 20px;
74
+ height: 20px;
75
+ }