@meta-1/editor 1.0.5 → 1.0.7
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.
- package/package.json +1 -1
- package/src/components/tiptap-node/image-node/image-node-view.css +4 -0
- package/src/components/tiptap-node/image-node/image-node.css +4 -0
- package/src/components/tiptap-node/list-node/list-node.css +9 -0
- package/src/components/tiptap-node/table-node/styles/table-node.css +11 -0
- package/src/components/tiptap-ui/drag-context-menu/drag-context-menu.tsx +4 -0
package/package.json
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
@reference "@meta-1/design/theme.css";
|
|
2
2
|
|
|
3
|
+
.tiptap.ProseMirror[data-dragging="true"] .ProseMirror-selectednode .tiptap-image .tiptap-image-container {
|
|
4
|
+
outline: none !important;
|
|
5
|
+
}
|
|
6
|
+
|
|
3
7
|
.tiptap.ProseMirror .ProseMirror-selectednode .tiptap-image .tiptap-image-container {
|
|
4
8
|
@apply rounded-sm;
|
|
5
9
|
outline: 0.125rem solid transparent;
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
@apply outline-indigo-500;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
.tiptap.ProseMirror[data-dragging="true"] img:not([data-type="emoji"] img).ProseMirror-selectednode {
|
|
17
|
+
outline: none !important;
|
|
18
|
+
}
|
|
19
|
+
|
|
16
20
|
/* Thread image handling */
|
|
17
21
|
.tiptap.ProseMirror .tiptap-thread:has(> img) {
|
|
18
22
|
@apply my-8;
|
|
@@ -94,6 +94,9 @@
|
|
|
94
94
|
@apply dark:border-gray-700 dark:bg-gray-800;
|
|
95
95
|
@apply transition-[background-color,border-color] duration-[80ms] ease-out;
|
|
96
96
|
}
|
|
97
|
+
.dark .tiptap.ProseMirror ul[data-type="taskList"] li label span {
|
|
98
|
+
@apply border-gray-700 bg-gray-800;
|
|
99
|
+
}
|
|
97
100
|
|
|
98
101
|
.tiptap.ProseMirror ul[data-type="taskList"] li label span::before {
|
|
99
102
|
@apply absolute;
|
|
@@ -112,11 +115,17 @@
|
|
|
112
115
|
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")
|
|
113
116
|
center / contain no-repeat;
|
|
114
117
|
}
|
|
118
|
+
.dark .tiptap.ProseMirror ul[data-type="taskList"] li label span::before {
|
|
119
|
+
@apply bg-black;
|
|
120
|
+
}
|
|
115
121
|
|
|
116
122
|
.tiptap.ProseMirror ul[data-type="taskList"] li label input[type="checkbox"]:checked + span {
|
|
117
123
|
@apply bg-gray-900 border-gray-900;
|
|
118
124
|
@apply dark:bg-gray-100 dark:border-gray-100;
|
|
119
125
|
}
|
|
126
|
+
.dark .tiptap.ProseMirror ul[data-type="taskList"] li label input[type="checkbox"]:checked + span {
|
|
127
|
+
@apply bg-gray-100 border-gray-100;
|
|
128
|
+
}
|
|
120
129
|
|
|
121
130
|
.tiptap.ProseMirror ul[data-type="taskList"] li label input[type="checkbox"]:checked + span::before {
|
|
122
131
|
opacity: 1;
|
|
@@ -16,6 +16,10 @@
|
|
|
16
16
|
transition: opacity 0.2s ease-in-out;
|
|
17
17
|
z-index: 1;
|
|
18
18
|
}
|
|
19
|
+
.dark .tiptap [data-content-type="table"] .tableWrapper table::before,
|
|
20
|
+
.dark .tiptap [data-content-type="table"] .tableWrapper table::after {
|
|
21
|
+
@apply bg-gray-800;
|
|
22
|
+
}
|
|
19
23
|
|
|
20
24
|
.tiptap [data-content-type="table"] .tableWrapper table::before {
|
|
21
25
|
left: -4px;
|
|
@@ -41,6 +45,10 @@
|
|
|
41
45
|
.tiptap td {
|
|
42
46
|
@apply border border-gray-300 dark:border-gray-700 p-2;
|
|
43
47
|
}
|
|
48
|
+
.dark .tiptap th,
|
|
49
|
+
.dark .tiptap td {
|
|
50
|
+
@apply border-gray-700;
|
|
51
|
+
}
|
|
44
52
|
.tiptap.ProseMirror .table-container td > * {
|
|
45
53
|
@apply !mt-4;
|
|
46
54
|
}
|
|
@@ -51,6 +59,9 @@
|
|
|
51
59
|
.tiptap table th {
|
|
52
60
|
@apply bg-gray-100 dark:bg-gray-800 font-bold text-left;
|
|
53
61
|
}
|
|
62
|
+
.dark .tiptap table th {
|
|
63
|
+
@apply bg-gray-800;
|
|
64
|
+
}
|
|
54
65
|
|
|
55
66
|
.ProseMirror .column-resize-handle {
|
|
56
67
|
@apply absolute right-0 w-0.5 bg-indigo-500 cursor-col-resize z-[1] pointer-events-auto transition-colors duration-150 delay-50;
|
|
@@ -316,11 +316,15 @@ export const DragContextMenu: React.FC<DragContextMenuProps> = ({
|
|
|
316
316
|
const onElementDragStart = useCallback(() => {
|
|
317
317
|
if (!editor) return;
|
|
318
318
|
editor.commands.setIsDragging(true);
|
|
319
|
+
// Add data attribute to hide selected outline in drag ghost
|
|
320
|
+
editor.view.dom.setAttribute("data-dragging", "true");
|
|
319
321
|
}, [editor]);
|
|
320
322
|
|
|
321
323
|
const onElementDragEnd = useCallback(() => {
|
|
322
324
|
if (!editor) return;
|
|
323
325
|
editor.commands.setIsDragging(false);
|
|
326
|
+
// Remove data attribute
|
|
327
|
+
editor.view.dom.removeAttribute("data-dragging");
|
|
324
328
|
|
|
325
329
|
setTimeout(() => {
|
|
326
330
|
editor.view.dom.blur();
|