@milkdown/preset-gfm 5.5.0 → 6.0.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.
- package/README.md +4 -4
- package/lib/{src/auto-link.d.ts → auto-link.d.ts} +0 -0
- package/lib/auto-link.d.ts.map +1 -0
- package/lib/footnote/definition.d.ts +7 -0
- package/lib/footnote/definition.d.ts.map +1 -0
- package/lib/footnote/index.d.ts +3 -0
- package/lib/footnote/index.d.ts.map +1 -0
- package/lib/footnote/reference.d.ts +7 -0
- package/lib/footnote/reference.d.ts.map +1 -0
- package/lib/footnote/utils.d.ts +3 -0
- package/lib/footnote/utils.d.ts.map +1 -0
- package/lib/index.d.ts +37 -1
- package/lib/index.d.ts.map +1 -0
- package/lib/index.es.js +569 -426
- package/lib/index.es.js.map +1 -1
- package/lib/{src/strike-through.d.ts → strike-through.d.ts} +1 -1
- package/lib/strike-through.d.ts.map +1 -0
- package/lib/{src/supported-keys.d.ts → supported-keys.d.ts} +0 -0
- package/lib/supported-keys.d.ts.map +1 -0
- package/lib/{src/table → table}/command.d.ts +0 -0
- package/lib/table/command.d.ts.map +1 -0
- package/lib/{src/table → table}/index.d.ts +0 -0
- package/lib/table/index.d.ts.map +1 -0
- package/lib/{src/table → table}/nodes/index.d.ts +3 -3
- package/lib/table/nodes/index.d.ts.map +1 -0
- package/lib/{src/table → table}/nodes/schema.d.ts +0 -0
- package/lib/table/nodes/schema.d.ts.map +1 -0
- package/lib/{src/table → table}/operator-plugin/actions.d.ts +0 -0
- package/lib/table/operator-plugin/actions.d.ts.map +1 -0
- package/lib/{src/table → table}/operator-plugin/calc-pos.d.ts +0 -0
- package/lib/table/operator-plugin/calc-pos.d.ts.map +1 -0
- package/lib/{src/table → table}/operator-plugin/constant.d.ts +0 -0
- package/lib/table/operator-plugin/constant.d.ts.map +1 -0
- package/lib/{src/table → table}/operator-plugin/helper.d.ts +0 -0
- package/lib/table/operator-plugin/helper.d.ts.map +1 -0
- package/lib/{src/table → table}/operator-plugin/index.d.ts +0 -0
- package/lib/table/operator-plugin/index.d.ts.map +1 -0
- package/lib/table/operator-plugin/style.d.ts +3 -0
- package/lib/table/operator-plugin/style.d.ts.map +1 -0
- package/lib/{src/table → table}/operator-plugin/widget.d.ts +0 -0
- package/lib/table/operator-plugin/widget.d.ts.map +1 -0
- package/lib/{src/table → table}/utils.d.ts +1 -0
- package/lib/table/utils.d.ts.map +1 -0
- package/lib/{src/task-list-item.d.ts → task-list-item.d.ts} +1 -1
- package/lib/task-list-item.d.ts.map +1 -0
- package/package.json +36 -12
- package/src/footnote/definition.ts +184 -0
- package/src/footnote/index.ts +3 -0
- package/src/footnote/reference.ts +171 -0
- package/src/footnote/utils.ts +4 -0
- package/src/index.ts +5 -0
- package/src/strike-through.ts +2 -9
- package/src/table/nodes/index.ts +0 -2
- package/src/table/operator-plugin/actions.ts +9 -9
- package/src/table/operator-plugin/index.ts +9 -8
- package/src/table/operator-plugin/style.ts +109 -37
- package/src/table/operator-plugin/widget.ts +3 -4
- package/src/task-list-item.ts +62 -127
- package/lib/src/auto-link.d.ts.map +0 -1
- package/lib/src/index.d.ts +0 -36
- package/lib/src/index.d.ts.map +0 -1
- package/lib/src/strike-through.d.ts.map +0 -1
- package/lib/src/supported-keys.d.ts.map +0 -1
- package/lib/src/table/command.d.ts.map +0 -1
- package/lib/src/table/index.d.ts.map +0 -1
- package/lib/src/table/nodes/index.d.ts.map +0 -1
- package/lib/src/table/nodes/schema.d.ts.map +0 -1
- package/lib/src/table/nodes/style.d.ts +0 -3
- package/lib/src/table/nodes/style.d.ts.map +0 -1
- package/lib/src/table/operator-plugin/actions.d.ts.map +0 -1
- package/lib/src/table/operator-plugin/calc-pos.d.ts.map +0 -1
- package/lib/src/table/operator-plugin/constant.d.ts.map +0 -1
- package/lib/src/table/operator-plugin/helper.d.ts.map +0 -1
- package/lib/src/table/operator-plugin/index.d.ts.map +0 -1
- package/lib/src/table/operator-plugin/style.d.ts +0 -3
- package/lib/src/table/operator-plugin/style.d.ts.map +0 -1
- package/lib/src/table/operator-plugin/widget.d.ts.map +0 -1
- package/lib/src/table/utils.d.ts.map +0 -1
- package/lib/src/task-list-item.d.ts.map +0 -1
- package/src/table/nodes/style.ts +0 -170
package/src/table/nodes/style.ts
DELETED
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
/* Copyright 2021, Milkdown by Mirone. */
|
|
2
|
-
import { Emotion } from '@milkdown/design-system';
|
|
3
|
-
import { Utils } from '@milkdown/utils';
|
|
4
|
-
|
|
5
|
-
const proseTableStyle = ({ css }: Emotion) => css`
|
|
6
|
-
/* copy from https://github.com/ProseMirror/prosemirror-tables/blob/master/style/tables.css */
|
|
7
|
-
.ProseMirror .tableWrapper {
|
|
8
|
-
overflow-x: auto;
|
|
9
|
-
}
|
|
10
|
-
.ProseMirror table {
|
|
11
|
-
border-collapse: collapse;
|
|
12
|
-
table-layout: fixed;
|
|
13
|
-
width: 100%;
|
|
14
|
-
overflow: hidden;
|
|
15
|
-
}
|
|
16
|
-
.ProseMirror td,
|
|
17
|
-
.ProseMirror th {
|
|
18
|
-
vertical-align: top;
|
|
19
|
-
box-sizing: border-box;
|
|
20
|
-
position: relative;
|
|
21
|
-
}
|
|
22
|
-
.ProseMirror .column-resize-handle {
|
|
23
|
-
position: absolute;
|
|
24
|
-
right: -2px;
|
|
25
|
-
top: 0;
|
|
26
|
-
bottom: 0;
|
|
27
|
-
width: 4px;
|
|
28
|
-
z-index: 20;
|
|
29
|
-
background-color: #adf;
|
|
30
|
-
pointer-events: none;
|
|
31
|
-
}
|
|
32
|
-
.ProseMirror.resize-cursor {
|
|
33
|
-
cursor: ew-resize;
|
|
34
|
-
cursor: col-resize;
|
|
35
|
-
}
|
|
36
|
-
/* Give selected cells a blue overlay */
|
|
37
|
-
.ProseMirror .selectedCell:after {
|
|
38
|
-
z-index: 2;
|
|
39
|
-
position: absolute;
|
|
40
|
-
content: '';
|
|
41
|
-
left: 0;
|
|
42
|
-
right: 0;
|
|
43
|
-
top: 0;
|
|
44
|
-
bottom: 0;
|
|
45
|
-
background: rgba(200, 200, 255, 0.4);
|
|
46
|
-
pointer-events: none;
|
|
47
|
-
}
|
|
48
|
-
`;
|
|
49
|
-
|
|
50
|
-
export const injectStyle = (utils: Utils) => {
|
|
51
|
-
return utils.getStyle(({ size, palette, mixin }, emotion) => {
|
|
52
|
-
const css = emotion.injectGlobal;
|
|
53
|
-
css`
|
|
54
|
-
${proseTableStyle(emotion)}
|
|
55
|
-
|
|
56
|
-
.tableWrapper {
|
|
57
|
-
margin: 0 !important;
|
|
58
|
-
|
|
59
|
-
${mixin.scrollbar?.('x')};
|
|
60
|
-
|
|
61
|
-
width: 100%;
|
|
62
|
-
|
|
63
|
-
table {
|
|
64
|
-
width: calc(100% - 2rem) !important;
|
|
65
|
-
border-radius: ${size.radius};
|
|
66
|
-
box-sizing: border-box;
|
|
67
|
-
margin: 1rem 0 1rem 1rem !important;
|
|
68
|
-
overflow: auto !important;
|
|
69
|
-
* {
|
|
70
|
-
margin: 0 !important;
|
|
71
|
-
box-sizing: border-box;
|
|
72
|
-
font-size: 1rem;
|
|
73
|
-
}
|
|
74
|
-
tr {
|
|
75
|
-
${mixin.border?.('bottom')};
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
th {
|
|
79
|
-
background: ${palette('background', 0.5)};
|
|
80
|
-
font-weight: 400;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
th,
|
|
84
|
-
td {
|
|
85
|
-
min-width: 100px;
|
|
86
|
-
${mixin.border?.()};
|
|
87
|
-
text-align: left;
|
|
88
|
-
position: relative;
|
|
89
|
-
line-height: 3rem;
|
|
90
|
-
box-sizing: border-box;
|
|
91
|
-
height: 3rem;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.selectedCell {
|
|
95
|
-
&::after {
|
|
96
|
-
background: ${palette('secondary', 0.38)};
|
|
97
|
-
}
|
|
98
|
-
& ::selection {
|
|
99
|
-
background: transparent;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.column-resize-handle {
|
|
104
|
-
background: ${palette('primary')};
|
|
105
|
-
width: ${size.lineWidth};
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
th,
|
|
109
|
-
td {
|
|
110
|
-
padding: 0 1rem;
|
|
111
|
-
p {
|
|
112
|
-
line-height: unset !important;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
.milkdown-cell-left,
|
|
117
|
-
.milkdown-cell-point,
|
|
118
|
-
.milkdown-cell-top {
|
|
119
|
-
position: absolute;
|
|
120
|
-
|
|
121
|
-
&::after {
|
|
122
|
-
cursor: pointer;
|
|
123
|
-
position: absolute;
|
|
124
|
-
top: 0;
|
|
125
|
-
left: 0;
|
|
126
|
-
height: 100%;
|
|
127
|
-
width: 100%;
|
|
128
|
-
display: block;
|
|
129
|
-
transition: all 0.2s ease-in-out;
|
|
130
|
-
background: ${palette('secondary', 0.12)};
|
|
131
|
-
content: '';
|
|
132
|
-
}
|
|
133
|
-
&:hover::after {
|
|
134
|
-
background: ${palette('secondary', 0.38)};
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
.milkdown-cell-left {
|
|
139
|
-
left: calc(-6px - 0.5rem);
|
|
140
|
-
top: 0;
|
|
141
|
-
bottom: 0;
|
|
142
|
-
width: 0.5rem;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
.milkdown-cell-top {
|
|
146
|
-
left: 0;
|
|
147
|
-
right: 0;
|
|
148
|
-
top: calc(-6px - 0.5rem);
|
|
149
|
-
height: 0.5rem;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
.milkdown-cell-point {
|
|
153
|
-
left: calc(-2px - 1rem);
|
|
154
|
-
top: calc(-2px - 1rem);
|
|
155
|
-
width: 1rem;
|
|
156
|
-
height: 1rem;
|
|
157
|
-
|
|
158
|
-
.icon {
|
|
159
|
-
position: absolute;
|
|
160
|
-
top: 0;
|
|
161
|
-
bottom: 0;
|
|
162
|
-
left: 0;
|
|
163
|
-
right: 0;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
`;
|
|
169
|
-
});
|
|
170
|
-
};
|