@jvs-milkdown/crepe 1.2.20 → 1.2.22
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/LICENSE +21 -0
- package/lib/cjs/feature/toolbar/index.js +20 -5
- package/lib/cjs/feature/toolbar/index.js.map +1 -1
- package/lib/cjs/index.js +73 -53
- package/lib/cjs/index.js.map +1 -1
- package/lib/esm/feature/toolbar/index.js +20 -5
- package/lib/esm/feature/toolbar/index.js.map +1 -1
- package/lib/esm/index.js +232 -212
- package/lib/esm/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/feature/attachment/view/components/attachment-block.d.ts.map +1 -1
- package/lib/types/feature/fixed-toolbar/component.d.ts.map +1 -1
- package/lib/types/feature/fixed-toolbar/menu-bar.d.ts.map +1 -1
- package/lib/types/feature/fixed-toolbar/outline-panel.d.ts.map +1 -1
- package/lib/types/feature/fixed-toolbar/shortcut-help-modal.d.ts.map +1 -1
- package/lib/types/feature/toolbar/component.d.ts.map +1 -1
- package/package.json +62 -116
- package/src/feature/attachment/view/components/attachment-block.tsx +3 -0
- package/src/feature/fixed-toolbar/component.tsx +4 -0
- package/src/feature/fixed-toolbar/menu-bar.tsx +5 -0
- package/src/feature/fixed-toolbar/outline-panel.tsx +3 -0
- package/src/feature/fixed-toolbar/shortcut-help-modal.tsx +3 -0
- package/src/feature/toolbar/component.tsx +19 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachment-block.d.ts","sourceRoot":"","sources":["../../../../../../src/feature/attachment/view/components/attachment-block.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,GAAG,EAAiD,MAAM,KAAK,CAAA;AAE7E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"attachment-block.d.ts","sourceRoot":"","sources":["../../../../../../src/feature/attachment/view/components/attachment-block.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,GAAG,EAAiD,MAAM,KAAK,CAAA;AAE7E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAA;AAW3D,KAAK,KAAK,GAAG;IACX,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,4BAA4B,GAAG;IACzC,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;IACtB,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;IACtB,OAAO,EAAE,CAAC,CAAC,SAAS,MAAM,KAAK,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,CAAA;IAClE,MAAM,EAAE,uBAAuB,CAAA;CAChC,GAAG;KACD,CAAC,IAAI,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;CAC9C,CAAA;AAWD,eAAO,MAAM,uBAAuB,0YAkPhC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../../src/feature/fixed-toolbar/component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAA;AAChD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAA;AAI9D,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,GAAG,
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../../src/feature/fixed-toolbar/component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAA;AAChD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAA;AAI9D,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,GAAG,EAKT,MAAM,KAAK,CAAA;AAIZ,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,GAAG,CAAA;AAOlD,KAAK,iBAAiB,GAAG;IACvB,GAAG,EAAE,GAAG,CAAA;IACR,IAAI,EAAE,MAAM,IAAI,CAAA;IAChB,IAAI,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;IAClB,SAAS,EAAE,UAAU,CAAC,SAAS,CAAC,CAAA;IAChC,MAAM,CAAC,EAAE,yBAAyB,CAAA;IAClC,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;IACrB,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,qBAAqB,oXA+JhC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-bar.d.ts","sourceRoot":"","sources":["../../../../src/feature/fixed-toolbar/menu-bar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"menu-bar.d.ts","sourceRoot":"","sources":["../../../../src/feature/fixed-toolbar/menu-bar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAA;AAkBhD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAsDjD,eAAO,MAAM,OAAO;;cAEO,MAAM,GAAG;;;;cACN,MAAM,kBAAkB;;;;;cAD3B,MAAM,GAAG;;;;cACN,MAAM,kBAAkB;;;+GAkgBpD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outline-panel.d.ts","sourceRoot":"","sources":["../../../../src/feature/fixed-toolbar/outline-panel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"outline-panel.d.ts","sourceRoot":"","sources":["../../../../src/feature/fixed-toolbar/outline-panel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAA;AAmBhD,eAAO,MAAM,YAAY;;cAEE,MAAM,GAAG;;;;;cAAT,MAAM,GAAG;;;+GA0oBlC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shortcut-help-modal.d.ts","sourceRoot":"","sources":["../../../../src/feature/fixed-toolbar/shortcut-help-modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAA;AAIhD,OAAO,EAAmB,KAAK,GAAG,EAAiC,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"shortcut-help-modal.d.ts","sourceRoot":"","sources":["../../../../src/feature/fixed-toolbar/shortcut-help-modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAA;AAIhD,OAAO,EAAmB,KAAK,GAAG,EAAiC,MAAM,KAAK,CAAA;AAuE9E,KAAK,UAAU,GAAG;IAChB,GAAG,EAAE,GAAG,CAAA;IACR,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;CACtB,CAAA;AAmED,eAAO,MAAM,iBAAiB,sWAsG5B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../../src/feature/toolbar/component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAA;AAgBhD,OAAO,EACL,KAAK,SAAS,EAGf,MAAM,+BAA+B,CAAA;AAUtC,OAAO,EAEL,KAAK,GAAG,EACR,KAAK,UAAU,EAQhB,MAAM,KAAK,CAAA;AAEZ,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,GAAG,CAAA;AAmG7C,KAAK,YAAY,GAAG;IAClB,GAAG,EAAE,GAAG,CAAA;IACR,IAAI,EAAE,MAAM,IAAI,CAAA;IAChB,IAAI,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;IAClB,SAAS,EAAE,UAAU,CAAC,SAAS,CAAC,CAAA;IAChC,MAAM,CAAC,EAAE,oBAAoB,CAAA;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAeD,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../../src/feature/toolbar/component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAA;AAgBhD,OAAO,EACL,KAAK,SAAS,EAGf,MAAM,+BAA+B,CAAA;AAUtC,OAAO,EAEL,KAAK,GAAG,EACR,KAAK,UAAU,EAQhB,MAAM,KAAK,CAAA;AAEZ,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,GAAG,CAAA;AAmG7C,KAAK,YAAY,GAAG;IAClB,GAAG,EAAE,GAAG,CAAA;IACR,IAAI,EAAE,MAAM,IAAI,CAAA;IAChB,IAAI,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;IAClB,SAAS,EAAE,UAAU,CAAC,SAAS,CAAC,CAAA;IAChC,MAAM,CAAC,EAAE,oBAAoB,CAAA;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAeD,eAAO,MAAM,OAAO,0WA+hFlB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jvs-milkdown/crepe",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.22",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"crepe",
|
|
6
6
|
"editor",
|
|
@@ -19,145 +19,85 @@
|
|
|
19
19
|
],
|
|
20
20
|
"type": "module",
|
|
21
21
|
"sideEffects": false,
|
|
22
|
-
"main": "./
|
|
22
|
+
"main": "./lib/esm/index.js",
|
|
23
23
|
"exports": {
|
|
24
24
|
".": {
|
|
25
|
-
"import": "./
|
|
25
|
+
"import": "./lib/esm/index.js",
|
|
26
|
+
"require": "./lib/cjs/index.js",
|
|
27
|
+
"types": "./lib/types/index.d.ts"
|
|
26
28
|
},
|
|
27
29
|
"./builder": {
|
|
28
|
-
"import": "./
|
|
30
|
+
"import": "./lib/esm/builder.js",
|
|
31
|
+
"require": "./lib/cjs/builder.js",
|
|
32
|
+
"types": "./lib/types/builder.d.ts"
|
|
29
33
|
},
|
|
30
34
|
"./feature/block-edit": {
|
|
31
|
-
"import": "./
|
|
35
|
+
"import": "./lib/esm/feature/block-edit/index.js",
|
|
36
|
+
"require": "./lib/cjs/feature/block-edit/index.js",
|
|
37
|
+
"types": "./lib/types/feature/block-edit/index.d.ts"
|
|
32
38
|
},
|
|
33
39
|
"./feature/code-mirror": {
|
|
34
|
-
"import": "./
|
|
40
|
+
"import": "./lib/esm/feature/code-mirror/index.js",
|
|
41
|
+
"require": "./lib/cjs/feature/code-mirror/index.js",
|
|
42
|
+
"types": "./lib/types/feature/code-mirror/index.d.ts"
|
|
35
43
|
},
|
|
36
44
|
"./feature/cursor": {
|
|
37
|
-
"import": "./
|
|
45
|
+
"import": "./lib/esm/feature/cursor/index.js",
|
|
46
|
+
"require": "./lib/cjs/feature/cursor/index.js",
|
|
47
|
+
"types": "./lib/types/feature/cursor/index.d.ts"
|
|
38
48
|
},
|
|
39
49
|
"./feature/image-block": {
|
|
40
|
-
"import": "./
|
|
50
|
+
"import": "./lib/esm/feature/image-block/index.js",
|
|
51
|
+
"require": "./lib/cjs/feature/image-block/index.js",
|
|
52
|
+
"types": "./lib/types/feature/image-block/index.d.ts"
|
|
41
53
|
},
|
|
42
54
|
"./feature/latex": {
|
|
43
|
-
"import": "./
|
|
55
|
+
"import": "./lib/esm/feature/latex/index.js",
|
|
56
|
+
"require": "./lib/cjs/feature/latex/index.js",
|
|
57
|
+
"types": "./lib/types/feature/latex/index.d.ts"
|
|
44
58
|
},
|
|
45
59
|
"./feature/link-tooltip": {
|
|
46
|
-
"import": "./
|
|
60
|
+
"import": "./lib/esm/feature/link-tooltip/index.js",
|
|
61
|
+
"require": "./lib/cjs/feature/link-tooltip/index.js",
|
|
62
|
+
"types": "./lib/types/feature/link-tooltip/index.d.ts"
|
|
47
63
|
},
|
|
48
64
|
"./feature/list-item": {
|
|
49
|
-
"import": "./
|
|
65
|
+
"import": "./lib/esm/feature/list-item/index.js",
|
|
66
|
+
"require": "./lib/cjs/feature/list-item/index.js",
|
|
67
|
+
"types": "./lib/types/feature/list-item/index.d.ts"
|
|
50
68
|
},
|
|
51
69
|
"./feature/placeholder": {
|
|
52
|
-
"import": "./
|
|
70
|
+
"import": "./lib/esm/feature/placeholder/index.js",
|
|
71
|
+
"require": "./lib/cjs/feature/placeholder/index.js",
|
|
72
|
+
"types": "./lib/types/feature/placeholder/index.d.ts"
|
|
53
73
|
},
|
|
54
74
|
"./feature/table": {
|
|
55
|
-
"import": "./
|
|
75
|
+
"import": "./lib/esm/feature/table/index.js",
|
|
76
|
+
"require": "./lib/cjs/feature/table/index.js",
|
|
77
|
+
"types": "./lib/types/feature/table/index.d.ts"
|
|
56
78
|
},
|
|
57
79
|
"./feature/toolbar": {
|
|
58
|
-
"import": "./
|
|
80
|
+
"import": "./lib/esm/feature/toolbar/index.js",
|
|
81
|
+
"require": "./lib/cjs/feature/toolbar/index.js",
|
|
82
|
+
"types": "./lib/types/feature/toolbar/index.d.ts"
|
|
59
83
|
},
|
|
60
84
|
"./feature/inline-diff": {
|
|
61
|
-
"import": "./
|
|
85
|
+
"import": "./lib/esm/feature/inline-diff/index.js",
|
|
86
|
+
"require": "./lib/cjs/feature/inline-diff/index.js",
|
|
87
|
+
"types": "./lib/types/feature/inline-diff/index.d.ts"
|
|
62
88
|
},
|
|
63
89
|
"./feature/diff-block": {
|
|
64
|
-
"import": "./
|
|
90
|
+
"import": "./lib/esm/feature/diff-block/index.js",
|
|
91
|
+
"require": "./lib/cjs/feature/diff-block/index.js",
|
|
92
|
+
"types": "./lib/types/feature/diff-block/index.d.ts"
|
|
65
93
|
},
|
|
66
|
-
"./theme/common/*": "./
|
|
67
|
-
"./theme/classic.css": "./
|
|
68
|
-
"./theme/classic-dark.css": "./
|
|
69
|
-
"./theme/nord.css": "./
|
|
70
|
-
"./theme/nord-dark.css": "./
|
|
71
|
-
"./theme/frame.css": "./
|
|
72
|
-
"./theme/frame-dark.css": "./
|
|
73
|
-
},
|
|
74
|
-
"publishConfig": {
|
|
75
|
-
"exports": {
|
|
76
|
-
".": {
|
|
77
|
-
"import": "./lib/esm/index.js",
|
|
78
|
-
"require": "./lib/cjs/index.js",
|
|
79
|
-
"types": "./lib/types/index.d.ts"
|
|
80
|
-
},
|
|
81
|
-
"./builder": {
|
|
82
|
-
"import": "./lib/esm/builder.js",
|
|
83
|
-
"require": "./lib/cjs/builder.js",
|
|
84
|
-
"types": "./lib/types/builder.d.ts"
|
|
85
|
-
},
|
|
86
|
-
"./feature/block-edit": {
|
|
87
|
-
"import": "./lib/esm/feature/block-edit/index.js",
|
|
88
|
-
"require": "./lib/cjs/feature/block-edit/index.js",
|
|
89
|
-
"types": "./lib/types/feature/block-edit/index.d.ts"
|
|
90
|
-
},
|
|
91
|
-
"./feature/code-mirror": {
|
|
92
|
-
"import": "./lib/esm/feature/code-mirror/index.js",
|
|
93
|
-
"require": "./lib/cjs/feature/code-mirror/index.js",
|
|
94
|
-
"types": "./lib/types/feature/code-mirror/index.d.ts"
|
|
95
|
-
},
|
|
96
|
-
"./feature/cursor": {
|
|
97
|
-
"import": "./lib/esm/feature/cursor/index.js",
|
|
98
|
-
"require": "./lib/cjs/feature/cursor/index.js",
|
|
99
|
-
"types": "./lib/types/feature/cursor/index.d.ts"
|
|
100
|
-
},
|
|
101
|
-
"./feature/image-block": {
|
|
102
|
-
"import": "./lib/esm/feature/image-block/index.js",
|
|
103
|
-
"require": "./lib/cjs/feature/image-block/index.js",
|
|
104
|
-
"types": "./lib/types/feature/image-block/index.d.ts"
|
|
105
|
-
},
|
|
106
|
-
"./feature/latex": {
|
|
107
|
-
"import": "./lib/esm/feature/latex/index.js",
|
|
108
|
-
"require": "./lib/cjs/feature/latex/index.js",
|
|
109
|
-
"types": "./lib/types/feature/latex/index.d.ts"
|
|
110
|
-
},
|
|
111
|
-
"./feature/link-tooltip": {
|
|
112
|
-
"import": "./lib/esm/feature/link-tooltip/index.js",
|
|
113
|
-
"require": "./lib/cjs/feature/link-tooltip/index.js",
|
|
114
|
-
"types": "./lib/types/feature/link-tooltip/index.d.ts"
|
|
115
|
-
},
|
|
116
|
-
"./feature/list-item": {
|
|
117
|
-
"import": "./lib/esm/feature/list-item/index.js",
|
|
118
|
-
"require": "./lib/cjs/feature/list-item/index.js",
|
|
119
|
-
"types": "./lib/types/feature/list-item/index.d.ts"
|
|
120
|
-
},
|
|
121
|
-
"./feature/placeholder": {
|
|
122
|
-
"import": "./lib/esm/feature/placeholder/index.js",
|
|
123
|
-
"require": "./lib/cjs/feature/placeholder/index.js",
|
|
124
|
-
"types": "./lib/types/feature/placeholder/index.d.ts"
|
|
125
|
-
},
|
|
126
|
-
"./feature/table": {
|
|
127
|
-
"import": "./lib/esm/feature/table/index.js",
|
|
128
|
-
"require": "./lib/cjs/feature/table/index.js",
|
|
129
|
-
"types": "./lib/types/feature/table/index.d.ts"
|
|
130
|
-
},
|
|
131
|
-
"./feature/toolbar": {
|
|
132
|
-
"import": "./lib/esm/feature/toolbar/index.js",
|
|
133
|
-
"require": "./lib/cjs/feature/toolbar/index.js",
|
|
134
|
-
"types": "./lib/types/feature/toolbar/index.d.ts"
|
|
135
|
-
},
|
|
136
|
-
"./feature/inline-diff": {
|
|
137
|
-
"import": "./lib/esm/feature/inline-diff/index.js",
|
|
138
|
-
"require": "./lib/cjs/feature/inline-diff/index.js",
|
|
139
|
-
"types": "./lib/types/feature/inline-diff/index.d.ts"
|
|
140
|
-
},
|
|
141
|
-
"./feature/diff-block": {
|
|
142
|
-
"import": "./lib/esm/feature/diff-block/index.js",
|
|
143
|
-
"require": "./lib/cjs/feature/diff-block/index.js",
|
|
144
|
-
"types": "./lib/types/feature/diff-block/index.d.ts"
|
|
145
|
-
},
|
|
146
|
-
"./theme/common/*": "./lib/theme/common/*",
|
|
147
|
-
"./theme/classic.css": "./lib/theme/crepe/style.css",
|
|
148
|
-
"./theme/classic-dark.css": "./lib/theme/crepe-dark/style.css",
|
|
149
|
-
"./theme/nord.css": "./lib/theme/nord/style.css",
|
|
150
|
-
"./theme/nord-dark.css": "./lib/theme/nord-dark/style.css",
|
|
151
|
-
"./theme/frame.css": "./lib/theme/frame/style.css",
|
|
152
|
-
"./theme/frame-dark.css": "./lib/theme/frame-dark/style.css"
|
|
153
|
-
},
|
|
154
|
-
"main": "./lib/esm/index.js",
|
|
155
|
-
"types": "./lib/types/index.d.ts"
|
|
156
|
-
},
|
|
157
|
-
"scripts": {
|
|
158
|
-
"build": "pnpm run build:es && pnpm run build:theme && echo",
|
|
159
|
-
"build:es": "rollup -c",
|
|
160
|
-
"build:theme": "postcss src/theme/**/*.css --base src/theme --dir lib/theme && xcopy /E /I /Y src\\theme\\fonts lib\\theme\\fonts"
|
|
94
|
+
"./theme/common/*": "./lib/theme/common/*",
|
|
95
|
+
"./theme/classic.css": "./lib/theme/crepe/style.css",
|
|
96
|
+
"./theme/classic-dark.css": "./lib/theme/crepe-dark/style.css",
|
|
97
|
+
"./theme/nord.css": "./lib/theme/nord/style.css",
|
|
98
|
+
"./theme/nord-dark.css": "./lib/theme/nord-dark/style.css",
|
|
99
|
+
"./theme/frame.css": "./lib/theme/frame/style.css",
|
|
100
|
+
"./theme/frame-dark.css": "./lib/theme/frame-dark/style.css"
|
|
161
101
|
},
|
|
162
102
|
"dependencies": {
|
|
163
103
|
"@codemirror/commands": "^6.3.3",
|
|
@@ -167,9 +107,9 @@
|
|
|
167
107
|
"@codemirror/theme-one-dark": "^6.1.2",
|
|
168
108
|
"@codemirror/view": "^6.26.0",
|
|
169
109
|
"@floating-ui/dom": "^1.7.6",
|
|
170
|
-
"@jvs-milkdown/kit": "^1.2.
|
|
171
|
-
"@jvs-milkdown/prose": "^1.2.
|
|
172
|
-
"@jvs-milkdown/utils": "^1.2.
|
|
110
|
+
"@jvs-milkdown/kit": "^1.2.22",
|
|
111
|
+
"@jvs-milkdown/prose": "^1.2.22",
|
|
112
|
+
"@jvs-milkdown/utils": "^1.2.22",
|
|
173
113
|
"@types/lodash-es": "^4.17.12",
|
|
174
114
|
"clsx": "^2.0.0",
|
|
175
115
|
"codemirror": "^6.0.1",
|
|
@@ -187,5 +127,11 @@
|
|
|
187
127
|
"@vue/reactivity": "^3.5.34",
|
|
188
128
|
"@vue/runtime-core": "^3.5.34",
|
|
189
129
|
"@vue/runtime-dom": "^3.5.34"
|
|
190
|
-
}
|
|
191
|
-
|
|
130
|
+
},
|
|
131
|
+
"scripts": {
|
|
132
|
+
"build": "pnpm run build:es && pnpm run build:theme && echo",
|
|
133
|
+
"build:es": "rollup -c",
|
|
134
|
+
"build:theme": "postcss src/theme/**/*.css --base src/theme --dir lib/theme && xcopy /E /I /Y src\\theme\\fonts lib\\theme\\fonts"
|
|
135
|
+
},
|
|
136
|
+
"types": "./lib/types/index.d.ts"
|
|
137
|
+
}
|
|
@@ -5,6 +5,9 @@ import { type Ref, defineComponent, shallowRef, computed, ref, h } from 'vue'
|
|
|
5
5
|
import type { AttachmentFeatureConfig } from '../../config'
|
|
6
6
|
|
|
7
7
|
import { fileLinkIcon } from '../../../../icons/file-link'
|
|
8
|
+
import { keepAlive } from '../../../../utils/keep-alive'
|
|
9
|
+
|
|
10
|
+
keepAlive(h)
|
|
8
11
|
|
|
9
12
|
const downloadIcon = `<svg viewBox="0 0 1024 1024" width="20" height="20" fill="currentColor">
|
|
10
13
|
<path d="M464.96 743.936L194.304 479.68c-4.928-4.8-10.24-9.408-14.592-14.656-20.736-24.768-21.376-45.76-2.368-63.424 17.664-16.384 43.328-16 65.472 4.8 49.088 46.144 96.64 93.824 144.896 140.8l69.376 67.52 11.968 11.392v-184.96c0-36.096-0.128-86.272-0.32-136.96-0.192-54.912-0.32-110.464-0.32-149.504l-0.064-9.28a208 208 0 0 1 0.704-26.56c3.52-31.168 19.328-46.592 45.248-45.76 25.344 0.832 41.088 16.96 42.688 48.576 1.28 24.384 1.024 48.896 0.768 73.408l-0.128 28.928c0 53.376 0.128 120.32 0.256 188.096 0.192 76.352 0.384 153.792 0.32 214.016 74.432-72.704 185.6-181.12 216.32-210.88 7.424-7.168 14.912-15.168 24-19.52 18.688-8.96 37.632-8.32 52.672 7.872 14.72 15.744 16.448 33.408 4.032 51.392-3.84 5.632-8.576 10.816-13.44 15.616-45.696 44.736-243.328 238.272-289.728 282.24a62.592 62.592 0 0 1-8.064 6.4 43.392 43.392 0 0 1-15.872 10.432c-20.544 7.616-37.504-0.512-51.968-14.848l-11.2-10.88z m430.784-39.744c24-0.576 42.176 14.4 43.328 41.6 1.728 40.832 2.944 82.176-1.088 122.816-5.312 54.144-51.52 89.792-114.752 91.008-50.112 0.896-100.224 0.704-150.4 0.512L608 960H434.944c-64.832 0.128-129.6 0.192-194.432-0.192-90.624-0.512-130.752-40.192-131.392-128.64l-0.192-18.56c-0.32-21.12-0.576-42.304 0.768-63.36 1.92-29.76 20.48-46.528 45.76-45.184 23.488 1.28 37.312 16.32 40.064 45.184 0.896 9.792 0.832 19.648 0.704 29.504l-0.064 11.52c0.384 76.544 7.36 83.392 88.128 83.456a163213.952 163213.952 0 0 0 351.68 0.064l43.968 0.128c36.096 0.128 72.192 0.256 108.288-0.448 52.672-1.024 64-12.864 65.152-64.32 0.192-7.68 0.128-15.488 0-23.232a414.72 414.72 0 0 1 0.704-38.208c2.24-27.712 17.92-42.944 41.664-43.52z" fill="currentColor"></path>
|
|
@@ -10,8 +10,11 @@ import {
|
|
|
10
10
|
ref,
|
|
11
11
|
onMounted,
|
|
12
12
|
onUnmounted,
|
|
13
|
+
h,
|
|
13
14
|
} from 'vue'
|
|
14
15
|
|
|
16
|
+
import { keepAlive } from '../../utils/keep-alive'
|
|
17
|
+
|
|
15
18
|
import type { FixedToolbarFeatureConfig } from '.'
|
|
16
19
|
|
|
17
20
|
import { undoIcon, redoIcon } from '../../icons'
|
|
@@ -40,6 +43,7 @@ export const FixedToolbarComponent = defineComponent<FixedToolbarProps>({
|
|
|
40
43
|
canRedo: { type: Object, required: true },
|
|
41
44
|
},
|
|
42
45
|
setup(props: any) {
|
|
46
|
+
keepAlive(h)
|
|
43
47
|
const showShortcuts = ref(false)
|
|
44
48
|
|
|
45
49
|
onMounted(() => {
|
|
@@ -6,6 +6,9 @@ import { defineComponent, onMounted, onUnmounted, ref, computed, h } from 'vue'
|
|
|
6
6
|
|
|
7
7
|
import { i18n } from '../../core/locale'
|
|
8
8
|
import { viewMenuStateCtx } from './view-menu-state'
|
|
9
|
+
import { keepAlive } from '../../utils/keep-alive'
|
|
10
|
+
|
|
11
|
+
keepAlive(h)
|
|
9
12
|
|
|
10
13
|
interface OutlineItem {
|
|
11
14
|
text: string
|
|
@@ -8,6 +8,9 @@ import type { CrepeTranslations } from '../../core/locale'
|
|
|
8
8
|
|
|
9
9
|
import { i18n } from '../../core/locale'
|
|
10
10
|
import { closeIcon } from '../../icons'
|
|
11
|
+
import { keepAlive } from '../../utils/keep-alive'
|
|
12
|
+
|
|
13
|
+
keepAlive(h)
|
|
11
14
|
|
|
12
15
|
const isMac =
|
|
13
16
|
typeof navigator !== 'undefined' &&
|
|
@@ -545,15 +545,21 @@ export const Toolbar = defineComponent<ToolbarProps>({
|
|
|
545
545
|
|
|
546
546
|
const computeOverflow = () => {
|
|
547
547
|
if (!toolbarContainerRef.value) return
|
|
548
|
+
const status = ctx?.get(editorCtx)?.status
|
|
549
|
+
if (status !== EditorStatus.Created) return
|
|
550
|
+
const view = ctx.get(editorViewCtx)
|
|
551
|
+
if (!view || !view.dom) return
|
|
552
|
+
|
|
548
553
|
const container = toolbarContainerRef.value
|
|
549
554
|
|
|
550
555
|
if (!isFixed) {
|
|
551
|
-
const view = ctx.get(editorViewCtx)
|
|
552
556
|
const containerDOM =
|
|
553
557
|
view.dom.closest('.milkdown-editor-container') ||
|
|
554
558
|
view.dom.closest('.milkdown') ||
|
|
555
559
|
view.dom
|
|
556
|
-
|
|
560
|
+
if (containerDOM) {
|
|
561
|
+
container.style.maxWidth = `${containerDOM.clientWidth - 32}px`
|
|
562
|
+
}
|
|
557
563
|
}
|
|
558
564
|
|
|
559
565
|
// For fixed toolbar: use available space in parent (minus MenuBar & separator)
|
|
@@ -576,12 +582,11 @@ export const Toolbar = defineComponent<ToolbarProps>({
|
|
|
576
582
|
containerWidth = container.clientWidth
|
|
577
583
|
}
|
|
578
584
|
} else {
|
|
579
|
-
const view = ctx.get(editorViewCtx)
|
|
580
585
|
const containerDOM =
|
|
581
586
|
view.dom.closest('.milkdown-editor-container') ||
|
|
582
587
|
view.dom.closest('.milkdown') ||
|
|
583
588
|
view.dom
|
|
584
|
-
containerWidth = containerDOM.clientWidth - 32
|
|
589
|
+
containerWidth = containerDOM ? containerDOM.clientWidth - 32 : 0
|
|
585
590
|
}
|
|
586
591
|
|
|
587
592
|
if (showOverflowMenu.value) {
|
|
@@ -808,6 +813,16 @@ export const Toolbar = defineComponent<ToolbarProps>({
|
|
|
808
813
|
|
|
809
814
|
const setupOverflowObserver = () => {
|
|
810
815
|
if (!toolbarContainerRef.value || overflowSetupDone) return
|
|
816
|
+
const status = ctx?.get(editorCtx)?.status
|
|
817
|
+
if (status !== EditorStatus.Created) {
|
|
818
|
+
setTimeout(setupOverflowObserver, 50)
|
|
819
|
+
return
|
|
820
|
+
}
|
|
821
|
+
const view = ctx.get(editorViewCtx)
|
|
822
|
+
if (!view || !view.dom) {
|
|
823
|
+
setTimeout(setupOverflowObserver, 50)
|
|
824
|
+
return
|
|
825
|
+
}
|
|
811
826
|
overflowSetupDone = true
|
|
812
827
|
overflowResizeObserver = new ResizeObserver(() => {
|
|
813
828
|
computeOverflow()
|
|
@@ -818,7 +833,6 @@ export const Toolbar = defineComponent<ToolbarProps>({
|
|
|
818
833
|
const parent = toolbarContainerRef.value.parentElement
|
|
819
834
|
if (parent) overflowResizeObserver.observe(parent)
|
|
820
835
|
} else {
|
|
821
|
-
const view = ctx.get(editorViewCtx)
|
|
822
836
|
overflowResizeObserver.observe(view.dom)
|
|
823
837
|
|
|
824
838
|
const containerDOM = view.dom.closest('.milkdown-editor-container')
|