create-starlight-cms 0.9.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 (228) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +18 -0
  3. package/THIRD_PARTY_NOTICES.md +4 -0
  4. package/bin/index.js +147 -0
  5. package/package.json +46 -0
  6. package/template/.nvmrc +1 -0
  7. package/template/LICENSE +21 -0
  8. package/template/README.md +68 -0
  9. package/template/THIRD_PARTY_NOTICES.md +12 -0
  10. package/template/_gitignore +14 -0
  11. package/template/astro.config.mjs +26 -0
  12. package/template/migrations/0001_schema.sql +73 -0
  13. package/template/migrations/0002_publish_delivery.sql +16 -0
  14. package/template/package-lock.json.template +9123 -0
  15. package/template/package.json +89 -0
  16. package/template/scripts/build-admin.mjs +38 -0
  17. package/template/scripts/check-linux-bindings.mjs +18 -0
  18. package/template/scripts/dev.mjs +94 -0
  19. package/template/src/admin/admin.scss +182 -0
  20. package/template/src/admin/app.ts +130 -0
  21. package/template/src/admin/client.tsx +684 -0
  22. package/template/src/admin/components/tiptap-extension/node-background-extension.ts +150 -0
  23. package/template/src/admin/components/tiptap-icons/align-center-icon.tsx +38 -0
  24. package/template/src/admin/components/tiptap-icons/align-justify-icon.tsx +38 -0
  25. package/template/src/admin/components/tiptap-icons/align-left-icon.tsx +38 -0
  26. package/template/src/admin/components/tiptap-icons/align-right-icon.tsx +38 -0
  27. package/template/src/admin/components/tiptap-icons/arrow-left-icon.tsx +24 -0
  28. package/template/src/admin/components/tiptap-icons/arrow-right-icon.tsx +26 -0
  29. package/template/src/admin/components/tiptap-icons/ban-icon.tsx +26 -0
  30. package/template/src/admin/components/tiptap-icons/blockquote-icon.tsx +44 -0
  31. package/template/src/admin/components/tiptap-icons/bold-icon.tsx +26 -0
  32. package/template/src/admin/components/tiptap-icons/case-sensitive-icon.tsx +32 -0
  33. package/template/src/admin/components/tiptap-icons/check-icon.tsx +26 -0
  34. package/template/src/admin/components/tiptap-icons/chevron-down-icon.tsx +26 -0
  35. package/template/src/admin/components/tiptap-icons/chevron-up-icon.tsx +22 -0
  36. package/template/src/admin/components/tiptap-icons/close-icon.tsx +24 -0
  37. package/template/src/admin/components/tiptap-icons/code-block-icon.tsx +38 -0
  38. package/template/src/admin/components/tiptap-icons/code2-icon.tsx +32 -0
  39. package/template/src/admin/components/tiptap-icons/corner-down-left-icon.tsx +26 -0
  40. package/template/src/admin/components/tiptap-icons/external-link-icon.tsx +28 -0
  41. package/template/src/admin/components/tiptap-icons/heading-five-icon.tsx +28 -0
  42. package/template/src/admin/components/tiptap-icons/heading-four-icon.tsx +28 -0
  43. package/template/src/admin/components/tiptap-icons/heading-icon.tsx +24 -0
  44. package/template/src/admin/components/tiptap-icons/heading-one-icon.tsx +28 -0
  45. package/template/src/admin/components/tiptap-icons/heading-six-icon.tsx +30 -0
  46. package/template/src/admin/components/tiptap-icons/heading-three-icon.tsx +36 -0
  47. package/template/src/admin/components/tiptap-icons/heading-two-icon.tsx +28 -0
  48. package/template/src/admin/components/tiptap-icons/highlighter-icon.tsx +26 -0
  49. package/template/src/admin/components/tiptap-icons/image-plus-icon.tsx +26 -0
  50. package/template/src/admin/components/tiptap-icons/italic-icon.tsx +24 -0
  51. package/template/src/admin/components/tiptap-icons/link-icon.tsx +28 -0
  52. package/template/src/admin/components/tiptap-icons/list-icon.tsx +56 -0
  53. package/template/src/admin/components/tiptap-icons/list-ordered-icon.tsx +56 -0
  54. package/template/src/admin/components/tiptap-icons/list-todo-icon.tsx +50 -0
  55. package/template/src/admin/components/tiptap-icons/moon-star-icon.tsx +30 -0
  56. package/template/src/admin/components/tiptap-icons/redo2-icon.tsx +26 -0
  57. package/template/src/admin/components/tiptap-icons/search-icon.tsx +26 -0
  58. package/template/src/admin/components/tiptap-icons/strike-icon.tsx +28 -0
  59. package/template/src/admin/components/tiptap-icons/subscript-icon.tsx +38 -0
  60. package/template/src/admin/components/tiptap-icons/sun-icon.tsx +58 -0
  61. package/template/src/admin/components/tiptap-icons/superscript-icon.tsx +38 -0
  62. package/template/src/admin/components/tiptap-icons/trash-icon.tsx +26 -0
  63. package/template/src/admin/components/tiptap-icons/underline-icon.tsx +26 -0
  64. package/template/src/admin/components/tiptap-icons/undo2-icon.tsx +26 -0
  65. package/template/src/admin/components/tiptap-icons/whole-word-icon.tsx +36 -0
  66. package/template/src/admin/components/tiptap-node/blockquote-node/blockquote-node.scss +37 -0
  67. package/template/src/admin/components/tiptap-node/code-block-node/code-block-node.scss +54 -0
  68. package/template/src/admin/components/tiptap-node/heading-node/heading-node.scss +45 -0
  69. package/template/src/admin/components/tiptap-node/horizontal-rule-node/horizontal-rule-node-extension.ts +14 -0
  70. package/template/src/admin/components/tiptap-node/horizontal-rule-node/horizontal-rule-node.scss +25 -0
  71. package/template/src/admin/components/tiptap-node/image-node/image-node.scss +35 -0
  72. package/template/src/admin/components/tiptap-node/image-upload-node/image-upload-node-extension.ts +161 -0
  73. package/template/src/admin/components/tiptap-node/image-upload-node/image-upload-node.scss +249 -0
  74. package/template/src/admin/components/tiptap-node/image-upload-node/image-upload-node.tsx +554 -0
  75. package/template/src/admin/components/tiptap-node/image-upload-node/index.tsx +1 -0
  76. package/template/src/admin/components/tiptap-node/list-node/list-node.scss +208 -0
  77. package/template/src/admin/components/tiptap-node/paragraph-node/paragraph-node.scss +217 -0
  78. package/template/src/admin/components/tiptap-templates/simple/NOTICE.md +14 -0
  79. package/template/src/admin/components/tiptap-templates/simple/data/content.json +477 -0
  80. package/template/src/admin/components/tiptap-templates/simple/simple-editor.scss +97 -0
  81. package/template/src/admin/components/tiptap-templates/simple/simple-editor.tsx +348 -0
  82. package/template/src/admin/components/tiptap-templates/simple/theme-toggle.tsx +44 -0
  83. package/template/src/admin/components/tiptap-ui/blockquote-button/blockquote-button.tsx +122 -0
  84. package/template/src/admin/components/tiptap-ui/blockquote-button/index.tsx +2 -0
  85. package/template/src/admin/components/tiptap-ui/blockquote-button/use-blockquote.ts +273 -0
  86. package/template/src/admin/components/tiptap-ui/code-block-button/code-block-button.tsx +122 -0
  87. package/template/src/admin/components/tiptap-ui/code-block-button/index.tsx +2 -0
  88. package/template/src/admin/components/tiptap-ui/code-block-button/use-code-block.ts +283 -0
  89. package/template/src/admin/components/tiptap-ui/color-highlight-button/color-highlight-button.scss +49 -0
  90. package/template/src/admin/components/tiptap-ui/color-highlight-button/color-highlight-button.tsx +170 -0
  91. package/template/src/admin/components/tiptap-ui/color-highlight-button/index.tsx +2 -0
  92. package/template/src/admin/components/tiptap-ui/color-highlight-button/use-color-highlight.ts +380 -0
  93. package/template/src/admin/components/tiptap-ui/color-highlight-popover/color-highlight-popover.tsx +231 -0
  94. package/template/src/admin/components/tiptap-ui/color-highlight-popover/index.tsx +1 -0
  95. package/template/src/admin/components/tiptap-ui/heading-button/heading-button.tsx +124 -0
  96. package/template/src/admin/components/tiptap-ui/heading-button/index.tsx +2 -0
  97. package/template/src/admin/components/tiptap-ui/heading-button/use-heading.ts +348 -0
  98. package/template/src/admin/components/tiptap-ui/heading-dropdown-menu/heading-dropdown-menu.tsx +128 -0
  99. package/template/src/admin/components/tiptap-ui/heading-dropdown-menu/index.tsx +2 -0
  100. package/template/src/admin/components/tiptap-ui/heading-dropdown-menu/use-heading-dropdown-menu.ts +132 -0
  101. package/template/src/admin/components/tiptap-ui/image-upload-button/image-upload-button.tsx +130 -0
  102. package/template/src/admin/components/tiptap-ui/image-upload-button/index.tsx +2 -0
  103. package/template/src/admin/components/tiptap-ui/image-upload-button/use-image-upload.ts +197 -0
  104. package/template/src/admin/components/tiptap-ui/link-popover/index.tsx +2 -0
  105. package/template/src/admin/components/tiptap-ui/link-popover/link-popover.scss +16 -0
  106. package/template/src/admin/components/tiptap-ui/link-popover/link-popover.tsx +315 -0
  107. package/template/src/admin/components/tiptap-ui/link-popover/use-link-popover.ts +297 -0
  108. package/template/src/admin/components/tiptap-ui/list-button/index.tsx +2 -0
  109. package/template/src/admin/components/tiptap-ui/list-button/list-button.tsx +120 -0
  110. package/template/src/admin/components/tiptap-ui/list-button/use-list.ts +353 -0
  111. package/template/src/admin/components/tiptap-ui/list-dropdown-menu/index.tsx +2 -0
  112. package/template/src/admin/components/tiptap-ui/list-dropdown-menu/list-dropdown-menu.tsx +126 -0
  113. package/template/src/admin/components/tiptap-ui/list-dropdown-menu/use-list-dropdown-menu.ts +220 -0
  114. package/template/src/admin/components/tiptap-ui/mark-button/index.tsx +2 -0
  115. package/template/src/admin/components/tiptap-ui/mark-button/mark-button.tsx +122 -0
  116. package/template/src/admin/components/tiptap-ui/mark-button/use-mark.ts +219 -0
  117. package/template/src/admin/components/tiptap-ui/search-and-replace/index.tsx +2 -0
  118. package/template/src/admin/components/tiptap-ui/search-and-replace/search-and-replace.scss +300 -0
  119. package/template/src/admin/components/tiptap-ui/search-and-replace/search-and-replace.tsx +718 -0
  120. package/template/src/admin/components/tiptap-ui/search-and-replace/use-search-and-replace.ts +528 -0
  121. package/template/src/admin/components/tiptap-ui/text-align-button/index.tsx +2 -0
  122. package/template/src/admin/components/tiptap-ui/text-align-button/text-align-button.tsx +144 -0
  123. package/template/src/admin/components/tiptap-ui/text-align-button/use-text-align.ts +237 -0
  124. package/template/src/admin/components/tiptap-ui/undo-redo-button/index.tsx +2 -0
  125. package/template/src/admin/components/tiptap-ui/undo-redo-button/undo-redo-button.tsx +125 -0
  126. package/template/src/admin/components/tiptap-ui/undo-redo-button/use-undo-redo.ts +200 -0
  127. package/template/src/admin/components/tiptap-ui-primitive/badge/badge-colors.scss +395 -0
  128. package/template/src/admin/components/tiptap-ui-primitive/badge/badge-group.scss +16 -0
  129. package/template/src/admin/components/tiptap-ui-primitive/badge/badge.scss +99 -0
  130. package/template/src/admin/components/tiptap-ui-primitive/badge/badge.tsx +44 -0
  131. package/template/src/admin/components/tiptap-ui-primitive/badge/index.tsx +1 -0
  132. package/template/src/admin/components/tiptap-ui-primitive/button/button-colors.scss +613 -0
  133. package/template/src/admin/components/tiptap-ui-primitive/button/button.scss +390 -0
  134. package/template/src/admin/components/tiptap-ui-primitive/button/button.tsx +158 -0
  135. package/template/src/admin/components/tiptap-ui-primitive/button/index.tsx +1 -0
  136. package/template/src/admin/components/tiptap-ui-primitive/button-group/button-group.scss +89 -0
  137. package/template/src/admin/components/tiptap-ui-primitive/button-group/button-group.tsx +72 -0
  138. package/template/src/admin/components/tiptap-ui-primitive/button-group/index.tsx +1 -0
  139. package/template/src/admin/components/tiptap-ui-primitive/card/card.scss +74 -0
  140. package/template/src/admin/components/tiptap-ui-primitive/card/card.tsx +79 -0
  141. package/template/src/admin/components/tiptap-ui-primitive/card/index.tsx +1 -0
  142. package/template/src/admin/components/tiptap-ui-primitive/dropdown-menu/dropdown-menu.scss +152 -0
  143. package/template/src/admin/components/tiptap-ui-primitive/dropdown-menu/dropdown-menu.tsx +262 -0
  144. package/template/src/admin/components/tiptap-ui-primitive/dropdown-menu/index.tsx +1 -0
  145. package/template/src/admin/components/tiptap-ui-primitive/input/index.tsx +1 -0
  146. package/template/src/admin/components/tiptap-ui-primitive/input/input.scss +41 -0
  147. package/template/src/admin/components/tiptap-ui-primitive/input/input.tsx +22 -0
  148. package/template/src/admin/components/tiptap-ui-primitive/input-group/index.tsx +1 -0
  149. package/template/src/admin/components/tiptap-ui-primitive/input-group/input-group.scss +225 -0
  150. package/template/src/admin/components/tiptap-ui-primitive/input-group/input-group.tsx +135 -0
  151. package/template/src/admin/components/tiptap-ui-primitive/popover/index.tsx +1 -0
  152. package/template/src/admin/components/tiptap-ui-primitive/popover/popover.scss +64 -0
  153. package/template/src/admin/components/tiptap-ui-primitive/popover/popover.tsx +35 -0
  154. package/template/src/admin/components/tiptap-ui-primitive/separator/index.tsx +1 -0
  155. package/template/src/admin/components/tiptap-ui-primitive/separator/separator.scss +23 -0
  156. package/template/src/admin/components/tiptap-ui-primitive/separator/separator.tsx +28 -0
  157. package/template/src/admin/components/tiptap-ui-primitive/spacer/index.tsx +1 -0
  158. package/template/src/admin/components/tiptap-ui-primitive/spacer/spacer.tsx +24 -0
  159. package/template/src/admin/components/tiptap-ui-primitive/switch/index.tsx +1 -0
  160. package/template/src/admin/components/tiptap-ui-primitive/switch/switch.scss +86 -0
  161. package/template/src/admin/components/tiptap-ui-primitive/switch/switch.tsx +29 -0
  162. package/template/src/admin/components/tiptap-ui-primitive/textarea/index.tsx +1 -0
  163. package/template/src/admin/components/tiptap-ui-primitive/textarea/textarea.scss +42 -0
  164. package/template/src/admin/components/tiptap-ui-primitive/textarea/textarea.tsx +16 -0
  165. package/template/src/admin/components/tiptap-ui-primitive/toolbar/index.tsx +1 -0
  166. package/template/src/admin/components/tiptap-ui-primitive/toolbar/toolbar.scss +98 -0
  167. package/template/src/admin/components/tiptap-ui-primitive/toolbar/toolbar.tsx +203 -0
  168. package/template/src/admin/components/tiptap-ui-primitive/tooltip/index.tsx +1 -0
  169. package/template/src/admin/components/tiptap-ui-primitive/tooltip/tooltip.scss +43 -0
  170. package/template/src/admin/components/tiptap-ui-primitive/tooltip/tooltip.tsx +241 -0
  171. package/template/src/admin/hooks/use-composed-ref.ts +46 -0
  172. package/template/src/admin/hooks/use-cursor-visibility.ts +69 -0
  173. package/template/src/admin/hooks/use-element-rect.ts +166 -0
  174. package/template/src/admin/hooks/use-is-breakpoint.ts +35 -0
  175. package/template/src/admin/hooks/use-menu-navigation.ts +204 -0
  176. package/template/src/admin/hooks/use-scrolling.ts +75 -0
  177. package/template/src/admin/hooks/use-throttled-callback.ts +48 -0
  178. package/template/src/admin/hooks/use-tiptap-editor.ts +69 -0
  179. package/template/src/admin/hooks/use-unmount.ts +21 -0
  180. package/template/src/admin/hooks/use-window-size.ts +93 -0
  181. package/template/src/admin/html.ts +17 -0
  182. package/template/src/admin/lib/tiptap-utils.ts +652 -0
  183. package/template/src/admin/navigation-tree.tsx +82 -0
  184. package/template/src/admin/preview.ts +73 -0
  185. package/template/src/admin/styles/_cms-theme.scss +58 -0
  186. package/template/src/admin/styles/_keyframe-animations.scss +91 -0
  187. package/template/src/admin/styles/_variables.scss +298 -0
  188. package/template/src/assets/favicon.svg +1 -0
  189. package/template/src/assets/logo.svg +1 -0
  190. package/template/src/astro-env.d.ts +1 -0
  191. package/template/src/content.config.ts +12 -0
  192. package/template/src/db/bootstrap.ts +36 -0
  193. package/template/src/db/client.ts +7 -0
  194. package/template/src/db/schema.ts +45 -0
  195. package/template/src/documents/service.ts +178 -0
  196. package/template/src/documents/validation.ts +9 -0
  197. package/template/src/env.ts +9 -0
  198. package/template/src/index.ts +10 -0
  199. package/template/src/locales.ts +10 -0
  200. package/template/src/media/service.ts +120 -0
  201. package/template/src/navigation/service.ts +171 -0
  202. package/template/src/pages/[locale]/cms-preview-shell.astro +12 -0
  203. package/template/src/pages/cms-preview-shell.astro +5 -0
  204. package/template/src/publish/deploy-hook.ts +42 -0
  205. package/template/src/publish/record.ts +20 -0
  206. package/template/src/publish/service.ts +135 -0
  207. package/template/src/scss.d.ts +5 -0
  208. package/template/src/site.config.ts +7 -0
  209. package/template/src/sql.d.ts +4 -0
  210. package/template/src/starlight/cms-origin.ts +4 -0
  211. package/template/src/starlight/loader.ts +21 -0
  212. package/template/src/starlight/preview-render.ts +162 -0
  213. package/template/src/starlight/preview-shell.astro +14 -0
  214. package/template/src/starlight/render.ts +59 -0
  215. package/template/src/starlight/schema.ts +34 -0
  216. package/template/src/starlight/sidebar.ts +35 -0
  217. package/template/src/starlight/snapshot.ts +47 -0
  218. package/template/src/starlight/source.ts +26 -0
  219. package/template/src/starlight/tiptap.ts +29 -0
  220. package/template/src/styles/starlight.css +12 -0
  221. package/template/test-files/content.test.template.ts +82 -0
  222. package/template/test-files/deploy-hook.test.template.ts +32 -0
  223. package/template/test-files/media.test.template.ts +39 -0
  224. package/template/test-files/publishing.integration.test.template.ts +156 -0
  225. package/template/tsconfig.admin.json +18 -0
  226. package/template/tsconfig.json +23 -0
  227. package/template/worker-configuration.d.ts +15389 -0
  228. package/template/wrangler.jsonc +26 -0
@@ -0,0 +1,208 @@
1
+ .tiptap.ProseMirror {
2
+ --tt-checklist-bg-color: var(--tt-gray-light-a-100);
3
+ --tt-checklist-bg-active-color: var(--tt-gray-light-a-900);
4
+ --tt-checklist-border-color: var(--tt-gray-light-a-200);
5
+ --tt-checklist-border-active-color: var(--tt-gray-light-a-900);
6
+ --tt-checklist-check-icon-color: var(--white);
7
+ --tt-checklist-text-active: var(--tt-gray-light-a-500);
8
+
9
+ .dark & {
10
+ --tt-checklist-bg-color: var(--tt-gray-dark-a-100);
11
+ --tt-checklist-bg-active-color: var(--tt-gray-dark-a-900);
12
+ --tt-checklist-border-color: var(--tt-gray-dark-a-200);
13
+ --tt-checklist-border-active-color: var(--tt-gray-dark-a-900);
14
+ --tt-checklist-check-icon-color: var(--black);
15
+ --tt-checklist-text-active: var(--tt-gray-dark-a-500);
16
+ }
17
+ }
18
+
19
+ /* =====================
20
+ LISTS
21
+ ===================== */
22
+ .tiptap.ProseMirror {
23
+ // Common list styles
24
+ ol,
25
+ ul {
26
+ margin-top: 1.5em;
27
+ margin-bottom: 1.5em;
28
+ padding-left: 1.5em;
29
+
30
+ &:first-child {
31
+ margin-top: 0;
32
+ }
33
+
34
+ &:last-child {
35
+ margin-bottom: 0;
36
+ }
37
+
38
+ ol,
39
+ ul {
40
+ margin-top: 0;
41
+ margin-bottom: 0;
42
+ }
43
+ }
44
+
45
+ li {
46
+ p:not(:first-child):not(td p):not(th p) {
47
+ margin-top: 0;
48
+ line-height: 1.6;
49
+ }
50
+ }
51
+
52
+ // Ordered lists
53
+ ol {
54
+ list-style: decimal;
55
+
56
+ ol {
57
+ list-style: lower-alpha;
58
+
59
+ ol {
60
+ list-style: lower-roman;
61
+
62
+ ol {
63
+ list-style: decimal;
64
+
65
+ ol {
66
+ list-style: lower-alpha;
67
+
68
+ ol {
69
+ list-style: lower-roman;
70
+
71
+ ol {
72
+ list-style: decimal;
73
+
74
+ ol {
75
+ list-style: lower-alpha;
76
+
77
+ ol {
78
+ list-style: lower-roman;
79
+ }
80
+ }
81
+ }
82
+ }
83
+ }
84
+ }
85
+ }
86
+ }
87
+ }
88
+
89
+ // Unordered lists
90
+ ul:not([data-type="taskList"]) {
91
+ list-style: disc;
92
+
93
+ ul {
94
+ list-style: circle;
95
+
96
+ ul {
97
+ list-style: square;
98
+
99
+ ul {
100
+ list-style: disc;
101
+
102
+ ul {
103
+ list-style: circle;
104
+
105
+ ul {
106
+ list-style: square;
107
+
108
+ ul {
109
+ list-style: disc;
110
+
111
+ ul {
112
+ list-style: circle;
113
+
114
+ ul {
115
+ list-style: square;
116
+ }
117
+ }
118
+ }
119
+ }
120
+ }
121
+ }
122
+ }
123
+ }
124
+ }
125
+
126
+ // Task lists
127
+ ul[data-type="taskList"] {
128
+ padding-left: 0.25em;
129
+
130
+ li {
131
+ display: flex;
132
+ flex-direction: row;
133
+ align-items: flex-start;
134
+
135
+ &:not(:has(> p:first-child)) {
136
+ list-style-type: none;
137
+ }
138
+
139
+ &[data-checked="true"] {
140
+ > div > p {
141
+ opacity: 0.5;
142
+ text-decoration: line-through;
143
+ }
144
+
145
+ > div > p span {
146
+ text-decoration: line-through;
147
+ }
148
+ }
149
+
150
+ label {
151
+ position: relative;
152
+ padding-top: 0.375rem;
153
+ padding-right: 0.5rem;
154
+
155
+ input[type="checkbox"] {
156
+ position: absolute;
157
+ opacity: 0;
158
+ width: 0;
159
+ height: 0;
160
+ }
161
+
162
+ span {
163
+ display: block;
164
+ width: 1em;
165
+ height: 1em;
166
+ border: 1px solid var(--tt-checklist-border-color);
167
+ border-radius: var(--tt-radius-xs, 0.25rem);
168
+ position: relative;
169
+ cursor: pointer;
170
+ background-color: var(--tt-checklist-bg-color);
171
+ transition:
172
+ background-color 80ms ease-out,
173
+ border-color 80ms ease-out;
174
+
175
+ &::before {
176
+ content: "";
177
+ position: absolute;
178
+ left: 50%;
179
+ top: 50%;
180
+ transform: translate(-50%, -50%);
181
+ width: 0.75em;
182
+ height: 0.75em;
183
+ background-color: var(--tt-checklist-check-icon-color);
184
+ opacity: 0;
185
+ -webkit-mask: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22currentColor%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M21.4142%204.58579C22.1953%205.36683%2022.1953%206.63317%2021.4142%207.41421L10.4142%2018.4142C9.63317%2019.1953%208.36684%2019.1953%207.58579%2018.4142L2.58579%2013.4142C1.80474%2012.6332%201.80474%2011.3668%202.58579%2010.5858C3.36683%209.80474%204.63317%209.80474%205.41421%2010.5858L9%2014.1716L18.5858%204.58579C19.3668%203.80474%2020.6332%203.80474%2021.4142%204.58579Z%22%20fill%3D%22currentColor%22%2F%3E%3C%2Fsvg%3E")
186
+ center/contain no-repeat;
187
+ mask: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22currentColor%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M21.4142%204.58579C22.1953%205.36683%2022.1953%206.63317%2021.4142%207.41421L10.4142%2018.4142C9.63317%2019.1953%208.36684%2019.1953%207.58579%2018.4142L2.58579%2013.4142C1.80474%2012.6332%201.80474%2011.3668%202.58579%2010.5858C3.36683%209.80474%204.63317%209.80474%205.41421%2010.5858L9%2014.1716L18.5858%204.58579C19.3668%203.80474%2020.6332%203.80474%2021.4142%204.58579Z%22%20fill%3D%22currentColor%22%2F%3E%3C%2Fsvg%3E")
188
+ center/contain no-repeat;
189
+ }
190
+ }
191
+
192
+ input[type="checkbox"]:checked + span {
193
+ background: var(--tt-checklist-bg-active-color);
194
+ border-color: var(--tt-checklist-border-active-color);
195
+
196
+ &::before {
197
+ opacity: 1;
198
+ }
199
+ }
200
+ }
201
+
202
+ div {
203
+ flex: 1 1 0%;
204
+ min-width: 0;
205
+ }
206
+ }
207
+ }
208
+ }
@@ -0,0 +1,217 @@
1
+ .tiptap.ProseMirror {
2
+ --tt-collaboration-carets-label: var(--tt-gray-light-900);
3
+ --link-text-color: var(--tt-brand-color-500);
4
+ --placeholder-color: var(--tt-gray-light-a-400);
5
+
6
+ // ai
7
+ --tiptap-ai-insertion-color: var(--tt-brand-color-600);
8
+
9
+ .dark & {
10
+ --tt-collaboration-carets-label: var(--tt-gray-dark-100);
11
+ --link-text-color: var(--tt-brand-color-400);
12
+ --placeholder-color: var(--tt-gray-dark-a-400);
13
+
14
+ --tiptap-ai-insertion-color: var(--tt-brand-color-400);
15
+ }
16
+ }
17
+
18
+ /* Ensure each top-level node has relative positioning
19
+ so absolutely positioned placeholders work correctly */
20
+ .tiptap.ProseMirror > * {
21
+ position: relative;
22
+ }
23
+
24
+ /* =====================
25
+ CORE EDITOR STYLES
26
+ ===================== */
27
+ .tiptap.ProseMirror {
28
+ white-space: pre-wrap;
29
+ outline: none;
30
+ caret-color: var(--tt-cursor-color);
31
+
32
+ // Paragraph spacing
33
+ p:not(:first-child):not(td p):not(th p) {
34
+ margin-top: 20px;
35
+ }
36
+
37
+ p:not(td p):not(th p) {
38
+ font-size: 1rem;
39
+ line-height: 1.6;
40
+ font-weight: normal;
41
+ }
42
+
43
+ // Selection styles
44
+ &:not(.readonly):not(.ProseMirror-hideselection) {
45
+ ::selection {
46
+ background-color: var(--tt-selection-color);
47
+ }
48
+
49
+ .selection::selection {
50
+ background: transparent;
51
+ }
52
+ }
53
+
54
+ .selection {
55
+ display: inline;
56
+ background-color: var(--tt-selection-color);
57
+ }
58
+
59
+ // Selected node styles
60
+ .ProseMirror-selectednode:not(img):not(pre):not(.react-renderer) {
61
+ border-radius: var(--tt-radius-md);
62
+ background-color: var(--tt-selection-color);
63
+ }
64
+
65
+ .ProseMirror-hideselection {
66
+ caret-color: transparent;
67
+ }
68
+
69
+ // Resize cursor
70
+ &.resize-cursor {
71
+ cursor: ew-resize;
72
+ cursor: col-resize;
73
+ }
74
+ }
75
+
76
+ /* =====================
77
+ TEXT DECORATION
78
+ ===================== */
79
+ .tiptap.ProseMirror {
80
+ // Text decoration inheritance for spans
81
+ a span {
82
+ text-decoration: underline;
83
+ }
84
+
85
+ s span {
86
+ text-decoration: line-through;
87
+ }
88
+
89
+ u span {
90
+ text-decoration: underline;
91
+ }
92
+
93
+ .tiptap-ai-insertion {
94
+ color: var(--tiptap-ai-insertion-color);
95
+ }
96
+ }
97
+
98
+ /* =====================
99
+ COLLABORATION
100
+ ===================== */
101
+ .tiptap.ProseMirror {
102
+ .collaboration-carets {
103
+ &__caret {
104
+ border-right: 1px solid transparent;
105
+ border-left: 1px solid transparent;
106
+ pointer-events: none;
107
+ margin-left: -1px;
108
+ margin-right: -1px;
109
+ position: relative;
110
+ word-break: normal;
111
+ }
112
+
113
+ &__label {
114
+ color: var(--tt-collaboration-carets-label);
115
+ border-radius: 0.25rem;
116
+ border-bottom-left-radius: 0;
117
+ font-size: 0.75rem;
118
+ font-weight: 600;
119
+ left: -1px;
120
+ line-height: 1;
121
+ padding: 0.125rem 0.375rem;
122
+ position: absolute;
123
+ top: -1.3em;
124
+ user-select: none;
125
+ white-space: nowrap;
126
+ }
127
+ }
128
+ }
129
+
130
+ /* =====================
131
+ EMOJI
132
+ ===================== */
133
+ .tiptap.ProseMirror [data-type="emoji"] img {
134
+ display: inline-block;
135
+ width: 1.25em;
136
+ height: 1.25em;
137
+ cursor: text;
138
+ }
139
+
140
+ /* =====================
141
+ LINKS
142
+ ===================== */
143
+ .tiptap.ProseMirror {
144
+ a {
145
+ color: var(--link-text-color);
146
+ text-decoration: underline;
147
+ }
148
+ }
149
+
150
+ /* =====================
151
+ MENTION
152
+ ===================== */
153
+ .tiptap.ProseMirror {
154
+ [data-type="mention"] {
155
+ display: inline-block;
156
+ color: var(--tt-brand-color-500);
157
+ }
158
+ }
159
+
160
+ /* =====================
161
+ PLACEHOLDER
162
+ ===================== */
163
+ .is-empty:not(.with-slash)[data-placeholder]:has(
164
+ > .ProseMirror-trailingBreak:only-child
165
+ )::before {
166
+ content: attr(data-placeholder);
167
+ }
168
+
169
+ .is-empty.with-slash[data-placeholder]:has(
170
+ > .ProseMirror-trailingBreak:only-child
171
+ )::before {
172
+ content: "Write, type '/' for commands…";
173
+ font-style: italic;
174
+ }
175
+
176
+ .is-empty[data-placeholder]:has(
177
+ > .ProseMirror-trailingBreak:only-child
178
+ ):before {
179
+ pointer-events: none;
180
+ height: 0;
181
+ position: absolute;
182
+ width: 100%;
183
+ text-align: inherit;
184
+ left: 0;
185
+ right: 0;
186
+ }
187
+
188
+ .is-empty[data-placeholder]:has(> .ProseMirror-trailingBreak):before {
189
+ color: var(--placeholder-color);
190
+ }
191
+
192
+ /* =====================
193
+ DROPCURSOR
194
+ ===================== */
195
+ .prosemirror-dropcursor-block,
196
+ .prosemirror-dropcursor-inline {
197
+ background: var(--tt-brand-color-400) !important;
198
+ border-radius: 0.25rem;
199
+ margin-left: -1px;
200
+ margin-right: -1px;
201
+ width: 100%;
202
+ height: 0.188rem;
203
+ cursor: grabbing;
204
+ }
205
+
206
+ /* =====================
207
+ INDENT
208
+ ===================== */
209
+
210
+ .tiptap.ProseMirror {
211
+ --tt-indent-unit: 24px;
212
+
213
+ [data-indent] {
214
+ transition: margin-left 0.2s ease-in-out;
215
+ margin-left: calc(var(--tt-indent-unit) * var(--tt-indent-level, 0));
216
+ }
217
+ }
@@ -0,0 +1,14 @@
1
+ # Tiptap Simple Editor
2
+
3
+ This directory and its dependent `src/admin/components/tiptap-*`, `src/admin/hooks`,
4
+ `src/admin/lib`, and `src/admin/styles` sources were installed with:
5
+
6
+ ```sh
7
+ npx @tiptap/cli@3.19.4 add simple-editor
8
+ ```
9
+
10
+ Tiptap publishes the Simple Editor template and its included UI components under
11
+ MIT. Source: https://tiptap.dev/docs/ui-components/templates/simple-editor
12
+
13
+ Local changes connect the editor to this project's D1 document model and R2 media
14
+ upload API. Keep the attribution when updating or redistributing these sources.