@milkdown/preset-gfm 5.4.1 → 6.0.0-next.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 (83) hide show
  1. package/README.md +4 -4
  2. package/lib/{src/auto-link.d.ts → auto-link.d.ts} +0 -0
  3. package/lib/auto-link.d.ts.map +1 -0
  4. package/lib/footnote/definition.d.ts +7 -0
  5. package/lib/footnote/definition.d.ts.map +1 -0
  6. package/lib/footnote/index.d.ts +3 -0
  7. package/lib/footnote/index.d.ts.map +1 -0
  8. package/lib/footnote/reference.d.ts +7 -0
  9. package/lib/footnote/reference.d.ts.map +1 -0
  10. package/lib/footnote/utils.d.ts +3 -0
  11. package/lib/footnote/utils.d.ts.map +1 -0
  12. package/lib/index.d.ts +37 -1
  13. package/lib/index.d.ts.map +1 -0
  14. package/lib/index.es.js +572 -443
  15. package/lib/index.es.js.map +1 -1
  16. package/lib/{src/strike-through.d.ts → strike-through.d.ts} +1 -1
  17. package/lib/strike-through.d.ts.map +1 -0
  18. package/lib/{src/supported-keys.d.ts → supported-keys.d.ts} +0 -0
  19. package/lib/supported-keys.d.ts.map +1 -0
  20. package/lib/{src/table → table}/command.d.ts +0 -0
  21. package/lib/table/command.d.ts.map +1 -0
  22. package/lib/{src/table → table}/index.d.ts +0 -0
  23. package/lib/table/index.d.ts.map +1 -0
  24. package/lib/{src/table → table}/nodes/index.d.ts +7 -6
  25. package/lib/table/nodes/index.d.ts.map +1 -0
  26. package/lib/{src/table → table}/nodes/schema.d.ts +0 -0
  27. package/lib/table/nodes/schema.d.ts.map +1 -0
  28. package/lib/{src/table → table}/operator-plugin/actions.d.ts +0 -0
  29. package/lib/table/operator-plugin/actions.d.ts.map +1 -0
  30. package/lib/{src/table → table}/operator-plugin/calc-pos.d.ts +0 -0
  31. package/lib/table/operator-plugin/calc-pos.d.ts.map +1 -0
  32. package/lib/{src/table → table}/operator-plugin/constant.d.ts +0 -0
  33. package/lib/table/operator-plugin/constant.d.ts.map +1 -0
  34. package/lib/{src/table → table}/operator-plugin/helper.d.ts +0 -0
  35. package/lib/table/operator-plugin/helper.d.ts.map +1 -0
  36. package/lib/{src/table → table}/operator-plugin/index.d.ts +0 -0
  37. package/lib/table/operator-plugin/index.d.ts.map +1 -0
  38. package/lib/table/operator-plugin/style.d.ts +3 -0
  39. package/lib/table/operator-plugin/style.d.ts.map +1 -0
  40. package/lib/{src/table → table}/operator-plugin/widget.d.ts +0 -0
  41. package/lib/table/operator-plugin/widget.d.ts.map +1 -0
  42. package/lib/{src/table → table}/utils.d.ts +1 -0
  43. package/lib/table/utils.d.ts.map +1 -0
  44. package/lib/{src/task-list-item.d.ts → task-list-item.d.ts} +1 -1
  45. package/lib/task-list-item.d.ts.map +1 -0
  46. package/package.json +36 -12
  47. package/src/auto-link.ts +1 -1
  48. package/src/footnote/definition.ts +181 -0
  49. package/src/footnote/index.ts +3 -0
  50. package/src/footnote/reference.ts +153 -0
  51. package/src/footnote/utils.ts +4 -0
  52. package/src/index.ts +5 -0
  53. package/src/strike-through.ts +2 -9
  54. package/src/table/nodes/index.ts +20 -14
  55. package/src/table/operator-plugin/actions.ts +9 -9
  56. package/src/table/operator-plugin/helper.ts +1 -1
  57. package/src/table/operator-plugin/index.ts +8 -6
  58. package/src/table/operator-plugin/style.ts +109 -37
  59. package/src/table/operator-plugin/widget.ts +3 -4
  60. package/src/table/utils.ts +9 -6
  61. package/src/task-list-item.ts +65 -130
  62. package/lib/src/auto-link.d.ts.map +0 -1
  63. package/lib/src/index.d.ts +0 -36
  64. package/lib/src/index.d.ts.map +0 -1
  65. package/lib/src/strike-through.d.ts.map +0 -1
  66. package/lib/src/supported-keys.d.ts.map +0 -1
  67. package/lib/src/table/command.d.ts.map +0 -1
  68. package/lib/src/table/index.d.ts.map +0 -1
  69. package/lib/src/table/nodes/index.d.ts.map +0 -1
  70. package/lib/src/table/nodes/schema.d.ts.map +0 -1
  71. package/lib/src/table/nodes/style.d.ts +0 -3
  72. package/lib/src/table/nodes/style.d.ts.map +0 -1
  73. package/lib/src/table/operator-plugin/actions.d.ts.map +0 -1
  74. package/lib/src/table/operator-plugin/calc-pos.d.ts.map +0 -1
  75. package/lib/src/table/operator-plugin/constant.d.ts.map +0 -1
  76. package/lib/src/table/operator-plugin/helper.d.ts.map +0 -1
  77. package/lib/src/table/operator-plugin/index.d.ts.map +0 -1
  78. package/lib/src/table/operator-plugin/style.d.ts +0 -3
  79. package/lib/src/table/operator-plugin/style.d.ts.map +0 -1
  80. package/lib/src/table/operator-plugin/widget.d.ts.map +0 -1
  81. package/lib/src/table/utils.d.ts.map +0 -1
  82. package/lib/src/task-list-item.d.ts.map +0 -1
  83. package/src/table/nodes/style.ts +0 -170
@@ -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
- };