Skip to content

Commit a8b4c9a

Browse files
committed
feat: optimize bundle size for leagcy build tools
ref: 267c85d closes #228
1 parent abe69d4 commit a8b4c9a

File tree

18 files changed

+266
-54
lines changed

18 files changed

+266
-54
lines changed

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"singleQuote": true
2020
},
2121
"devDependencies": {
22+
"@icon-park/svg": "^1.4.2",
2223
"@sveltejs/vite-plugin-svelte": "1.0.9",
2324
"@testing-library/jest-dom": "^5.16.5",
2425
"@testing-library/svelte": "^3.2.2",
@@ -43,6 +44,7 @@
4344
"svelte": "^3.54.0",
4445
"svelte-preprocess": "^4.10.7",
4546
"svelte2tsx": "^0.5.22",
47+
"svgo": "^3.0.2",
4648
"tsdv": "^0.7.0",
4749
"tsx": "^3.12.1",
4850
"typescript": "^4.9.4"

packages/bytemd/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
"svelte"
3838
],
3939
"dependencies": {
40-
"@icon-park/svg": "^1.4.2",
4140
"@popperjs/core": "^2.11.6",
4241
"@types/codemirror": "^5.60.5",
4342
"@types/hast": "^2.3.4",

packages/bytemd/src/editor.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
handleImageUpload,
1111
} from './editor'
1212
import Help from './help.svelte'
13+
import * as icons from './icons'
1314
import Status from './status.svelte'
1415
import Toc from './toc.svelte'
1516
import Toolbar from './toolbar.svelte'
@@ -19,7 +20,6 @@
1920
EditorProps as Props,
2021
} from './types'
2122
import Viewer from './viewer.svelte'
22-
import * as icons from '@icon-park/svg'
2323
import type { Editor, KeyMap } from 'codemirror'
2424
import type { Root, Element } from 'hast'
2525
import { debounce, throttle } from 'lodash-es'

packages/bytemd/src/editor.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1+
import { icons } from './icons'
12
import type {
23
BytemdPlugin,
34
BytemdAction,
45
EditorProps,
56
BytemdLocale,
67
BytemdEditorContext,
78
} from './types'
8-
import * as icons from '@icon-park/svg'
99
import type { Editor, Position } from 'codemirror'
1010
import type CodeMirror from 'codemirror'
1111
import factory from 'codemirror-ssr'
@@ -169,18 +169,18 @@ export function getBuiltinActions(
169169
): { leftActions: BytemdAction[]; rightActions: BytemdAction[] } {
170170
const leftActions: BytemdAction[] = [
171171
{
172-
icon: icons.H({}),
172+
icon: icons.H,
173173
handler: {
174174
type: 'dropdown',
175175
actions: [1, 2, 3, 4, 5, 6].map((level) => ({
176176
title: locale[`h${level}` as keyof BytemdLocale],
177177
icon: [
178-
icons.H1({}),
179-
icons.H2({}),
180-
icons.H3({}),
181-
icons.LevelFourTitle({}),
182-
icons.LevelFiveTitle({}),
183-
icons.LevelSixTitle({}),
178+
icons.H1,
179+
icons.H2,
180+
icons.H3,
181+
icons.LevelFourTitle,
182+
icons.LevelFiveTitle,
183+
icons.LevelSixTitle,
184184
][level - 1],
185185
cheatsheet:
186186
level <= 3
@@ -202,7 +202,7 @@ export function getBuiltinActions(
202202
},
203203
{
204204
title: locale.bold,
205-
icon: icons.TextBold({}),
205+
icon: icons.TextBold,
206206
cheatsheet: `**${locale.boldText}**`,
207207
handler: {
208208
type: 'action',
@@ -215,7 +215,7 @@ export function getBuiltinActions(
215215
},
216216
{
217217
title: locale.italic,
218-
icon: icons.TextItalic({}),
218+
icon: icons.TextItalic,
219219
cheatsheet: `*${locale.italicText}*`,
220220
handler: {
221221
type: 'action',
@@ -228,7 +228,7 @@ export function getBuiltinActions(
228228
},
229229
{
230230
title: locale.quote,
231-
icon: icons.Quote({}),
231+
icon: icons.Quote,
232232
cheatsheet: `> ${locale.quotedText}`,
233233
handler: {
234234
type: 'action',
@@ -240,7 +240,7 @@ export function getBuiltinActions(
240240
},
241241
{
242242
title: locale.link,
243-
icon: icons.LinkOne({}),
243+
icon: icons.LinkOne,
244244
cheatsheet: `[${locale.linkText}](url)`,
245245
handler: {
246246
type: 'action',
@@ -258,7 +258,7 @@ export function getBuiltinActions(
258258
},
259259
{
260260
title: locale.image,
261-
icon: icons.Pic({}),
261+
icon: icons.Pic,
262262
cheatsheet: `![${locale.imageAlt}](url "${locale.imageTitle}")`,
263263
handler: uploadImages
264264
? {
@@ -279,7 +279,7 @@ export function getBuiltinActions(
279279
},
280280
{
281281
title: locale.code,
282-
icon: icons.Code({}),
282+
icon: icons.Code,
283283
cheatsheet: '`' + locale.codeText + '`',
284284
handler: {
285285
type: 'action',
@@ -292,7 +292,7 @@ export function getBuiltinActions(
292292
},
293293
{
294294
title: locale.codeBlock,
295-
icon: icons.CodeBrackets({}),
295+
icon: icons.CodeBrackets,
296296
cheatsheet: '```' + locale.codeLang + '↵',
297297
handler: {
298298
type: 'action',
@@ -309,7 +309,7 @@ export function getBuiltinActions(
309309
},
310310
{
311311
title: locale.ul,
312-
icon: icons.ListTwo({}),
312+
icon: icons.ListTwo,
313313
cheatsheet: `- ${locale.ulItem}`,
314314
handler: {
315315
type: 'action',
@@ -322,7 +322,7 @@ export function getBuiltinActions(
322322
},
323323
{
324324
title: locale.ol,
325-
icon: icons.OrderedList({}),
325+
icon: icons.OrderedList,
326326
cheatsheet: `1. ${locale.olItem}`,
327327
handler: {
328328
type: 'action',
@@ -335,7 +335,7 @@ export function getBuiltinActions(
335335
},
336336
{
337337
title: locale.hr,
338-
icon: icons.DividingLine({}),
338+
icon: icons.DividingLine,
339339
cheatsheet: '---',
340340
},
341341
]

packages/bytemd/src/icons.ts

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// DO NOT EDIT, generated by scripts/icon.ts
2+
export const icons = {
3+
H: '<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="none" viewBox="0 0 48 48"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" d="M12 5v38M36 5v38M12 24h24"/></svg>',
4+
H1: '<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="none" viewBox="0 0 48 48"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" d="M6 8v32M25 8v32M6 24h19M34.226 24 39 19.017V40"/></svg>',
5+
H2: '<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="none" viewBox="0 0 48 48"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" d="M6 8v32M24 8v32M7 24h16M32 25c0-3.167 2.667-5 5-5s5 1.833 5 5c0 5.7-10 9.933-10 15h10"/></svg>',
6+
H3: '<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="none" viewBox="0 0 48 48"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" d="M6 8v32M24 8v32M7 24h16M32 20h10l-7 9c4 0 7 2 7 6s-3 5-5 5c-2.381 0-4-1-5-2.1"/></svg>',
7+
LevelFourTitle:
8+
'<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="none" viewBox="0 0 48 48"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" d="M6 8v32M24 8v32M7 24h16M39.977 40V20L31 32.997v2.023h12"/></svg>',
9+
LevelFiveTitle:
10+
'<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="none" viewBox="0 0 48 48"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" d="M6 8v32M24 8v32M7 24h16M40 21.01h-8v7.024C32 28 34 27 37 27s4 2.534 4 6.5-1 6.5-5 6.5c-3 0-4-2-4-3.992"/></svg>',
11+
LevelSixTitle:
12+
'<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="none" viewBox="0 0 48 48"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" d="M6 8v32M24 8v32M7 24h16"/><path stroke="currentColor" stroke-width="4" d="M36.5 40a5.5 5.5 0 1 0 0-11 5.5 5.5 0 0 0 0 11Z"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" d="M41.596 24.74C40.778 22.545 38.804 21 36.5 21c-3.038 0-5.5 2.686-5.5 6v7"/></svg>',
13+
TextBold:
14+
'<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="none" viewBox="0 0 48 48"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" d="M24 24c5.506 0 9.969-4.477 9.969-10S29.506 4 24 4H11v20h13ZM28.031 44C33.537 44 38 39.523 38 34s-4.463-10-9.969-10H11v20h17.031Z" clip-rule="evenodd"/></svg>',
15+
TextItalic:
16+
'<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="none" viewBox="0 0 48 48"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" d="M20 6h16M12 42h16M29 5.952 19 42"/></svg>',
17+
Quote:
18+
'<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="none" viewBox="0 0 48 48"><path fill="currentColor" fill-rule="evenodd" d="M18.853 9.116C11.323 13.952 7.14 19.58 6.303 26.003 5 36 13.94 40.893 18.47 36.497 23 32.1 20.285 26.52 17.005 24.994c-3.28-1.525-5.286-.994-4.936-3.033.35-2.038 5.016-7.69 9.116-10.322a.749.749 0 0 0 .114-1.02L20.285 9.3c-.44-.572-.862-.55-1.432-.185ZM38.679 9.116c-7.53 4.836-11.714 10.465-12.55 16.887-1.303 9.997 7.637 14.89 12.167 10.494 4.53-4.397 1.815-9.977-1.466-11.503-3.28-1.525-5.286-.994-4.936-3.033.35-2.038 5.017-7.69 9.117-10.322a.749.749 0 0 0 .113-1.02L40.11 9.3c-.44-.572-.862-.55-1.431-.185Z" clip-rule="evenodd"/></svg>',
19+
LinkOne:
20+
'<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="none" viewBox="0 0 48 48"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" d="m26.24 16.373-9.14-9.14c-2.661-2.661-7.035-2.603-9.768.131-2.734 2.734-2.793 7.107-.131 9.768l7.935 7.936M32.903 23.003l7.935 7.935c2.661 2.662 2.603 7.035-.13 9.769-2.735 2.734-7.108 2.792-9.77.13l-9.14-9.14"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" d="M26.11 26.142c2.733-2.734 2.792-7.108.13-9.769M21.799 21.798c-2.734 2.734-2.792 7.108-.131 9.769"/></svg>',
21+
Pic: '<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="none" viewBox="0 0 48 48"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" d="M5 10a2 2 0 0 1 2-2h34a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V10Z" clip-rule="evenodd"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" d="M14.5 18a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z" clip-rule="evenodd"/><path stroke="currentColor" stroke-linejoin="round" stroke-width="4" d="m15 24 5 4 6-7 17 13v4a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-4l10-10Z"/></svg>',
22+
Code: '<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="none" viewBox="0 0 48 48"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" d="M16 13 4 25.432 16 37M32 13l12 12.432L32 37"/><path stroke="currentColor" stroke-linecap="round" stroke-width="4" d="m28 4-7 40"/></svg>',
23+
CodeBrackets:
24+
'<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="none" viewBox="0 0 48 48"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" d="M16 4c-2 0-5 1-5 5v9c0 3-5 5-5 5s5 2 5 5v11c0 4 3 5 5 5M32 4c2 0 5 1 5 5v9c0 3 5 5 5 5s-5 2-5 5v11c0 4-3 5-5 5"/></svg>',
25+
ListTwo:
26+
'<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="none" viewBox="0 0 48 48"><path stroke="currentColor" stroke-linejoin="round" stroke-width="4" d="M9 42a4 4 0 1 0 0-8 4 4 0 0 0 0 8ZM9 14a4 4 0 1 0 0-8 4 4 0 0 0 0 8ZM9 28a4 4 0 1 0 0-8 4 4 0 0 0 0 8Z"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" d="M21 24h22M21 38h22M21 10h22"/></svg>',
27+
OrderedList:
28+
'<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="none" viewBox="0 0 48 48"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" d="M9 4v9M12 13H6M12 27H6M6 20s3-3 5 0-5 7-5 7M6 34.5s2-3 5-1 0 4.5 0 4.5 3 2.5 0 4.5-5-1-5-1M11 38H9M9 4 6 6M21 24h22M21 38h22M21 10h22"/></svg>',
29+
DividingLine:
30+
'<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="none" viewBox="0 0 48 48"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" d="M5 24h38M21 38h6M37 38h6M21 10h6M5 38h6M5 10h6M37 10h6"/></svg>',
31+
AlignTextLeftOne:
32+
'<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="none" viewBox="0 0 48 48"><path stroke="currentColor" stroke-linejoin="round" stroke-width="4" d="M39 6H9a3 3 0 0 0-3 3v30a3 3 0 0 0 3 3h30a3 3 0 0 0 3-3V9a3 3 0 0 0-3-3Z"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" d="M26 24H14M34 15H14M32 33H14"/></svg>',
33+
Helpcenter:
34+
'<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="none" viewBox="0 0 48 48"><path stroke="currentColor" stroke-linejoin="round" stroke-width="4" d="M39 6H9a3 3 0 0 0-3 3v30a3 3 0 0 0 3 3h30a3 3 0 0 0 3-3V9a3 3 0 0 0-3-3Z"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" d="M24 28.625v-4a6 6 0 1 0-6-6"/><path fill="currentColor" fill-rule="evenodd" d="M24 37.625a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z" clip-rule="evenodd"/></svg>',
35+
LeftExpand:
36+
'<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="none" viewBox="0 0 48 48"><rect width="28" height="36" x="6" y="6" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" rx="2"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" d="M42 6v36"/></svg>',
37+
RightExpand:
38+
'<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="none" viewBox="0 0 48 48"><rect width="28" height="36" x="14" y="6" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" rx="2"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" d="M6 6v36"/></svg>',
39+
OffScreen:
40+
'<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="none" viewBox="0 0 48 48"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" d="M33 6v9h9M15 6v9H6M15 42v-9H6M33 42v-9h8.9"/></svg>',
41+
FullScreen:
42+
'<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="none" viewBox="0 0 48 48"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" d="M33 6h9v9M42 33v9h-9M15 42H6v-9M6 15V6h9"/></svg>',
43+
GithubOne:
44+
'<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="none" viewBox="0 0 48 48"><path stroke="currentColor" stroke-linecap="round" stroke-width="4" d="M29.344 30.477c2.404-.5 4.585-1.366 6.28-2.638C38.52 25.668 40 22.314 40 19c0-2.324-.881-4.494-2.407-6.332-.85-1.024 1.636-8.667-.573-7.638-2.21 1.03-5.45 3.308-7.147 2.805A20.712 20.712 0 0 0 24 7c-1.8 0-3.532.223-5.147.634C16.505 8.232 14.259 6 12 5.03c-2.26-.97-1.026 6.934-1.697 7.765C8.84 14.605 8 16.73 8 19c0 3.314 1.79 6.668 4.686 8.84 1.93 1.446 4.348 2.368 7.054 2.822M19.74 30.662c-1.159 1.275-1.738 2.486-1.738 3.632v8.717M29.345 30.477c1.097 1.44 1.646 2.734 1.646 3.88v8.654M6 31.215c.899.11 1.566.524 2 1.24.652 1.075 3.074 5.063 5.825 5.063h4.177"/></svg>',
45+
}

packages/bytemd/src/toolbar.svelte

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<svelte:options immutable={true} />
22

33
<script lang="ts">
4+
import { icons } from './icons'
45
import type { BytemdEditorContext, BytemdAction, BytemdLocale } from './types'
5-
import * as icons from '@icon-park/svg'
66
import { createEventDispatcher, onMount } from 'svelte'
77
import type { DelegateInstance } from 'tippy.js'
88
import { delegate } from 'tippy.js'
@@ -32,7 +32,7 @@
3232
$: rightActions = [
3333
{
3434
title: tocActive ? locale.closeToc : locale.toc,
35-
icon: icons.AlignTextLeftOne({}),
35+
icon: icons.AlignTextLeftOne,
3636
handler: {
3737
type: 'action',
3838
click() {
@@ -43,7 +43,7 @@
4343
},
4444
{
4545
title: helpActive ? locale.closeHelp : locale.help,
46-
icon: icons.Helpcenter({}),
46+
icon: icons.Helpcenter,
4747
handler: {
4848
type: 'action',
4949
click() {
@@ -54,7 +54,7 @@
5454
},
5555
{
5656
title: writeActive ? locale.exitWriteOnly : locale.writeOnly,
57-
icon: icons.LeftExpand({}),
57+
icon: icons.LeftExpand,
5858
handler: {
5959
type: 'action',
6060
click() {
@@ -66,7 +66,7 @@
6666
},
6767
{
6868
title: previewActive ? locale.exitPreviewOnly : locale.previewOnly,
69-
icon: icons.RightExpand({}),
69+
icon: icons.RightExpand,
7070
handler: {
7171
type: 'action',
7272
click() {
@@ -78,7 +78,7 @@
7878
},
7979
{
8080
title: fullscreen ? locale.exitFullscreen : locale.fullscreen,
81-
icon: fullscreen ? icons.OffScreen({}) : icons.FullScreen({}),
81+
icon: fullscreen ? icons.OffScreen : icons.FullScreen,
8282
handler: {
8383
type: 'action',
8484
click() {
@@ -88,7 +88,7 @@
8888
},
8989
{
9090
title: locale.source,
91-
icon: icons.GithubOne({}),
91+
icon: icons.GithubOne,
9292
handler: {
9393
type: 'action',
9494
click() {

packages/plugin-gfm/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
"locales"
2929
],
3030
"dependencies": {
31-
"@icon-park/svg": "^1.4.2",
3231
"remark-gfm": "^3.0.1"
3332
},
3433
"devDependencies": {

packages/plugin-gfm/src/icons.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// DO NOT EDIT, generated by scripts/icon.ts
2+
export const icons = {
3+
Strikethrough:
4+
'<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="none" viewBox="0 0 48 48"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" d="M5 24h38M24 24c16 6 10 20 0 20s-12-8-12-8M36 12s-3-8-12-8-12.564 7.6-8.39 14"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" d="M12 36s4 8 12 8 12.564-7.6 8.39-14"/></svg>',
5+
CheckCorrect:
6+
'<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="none" viewBox="0 0 48 48"><g stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" clip-path="url(#a)"><path d="M42 20v19a3 3 0 0 1-3 3H9a3 3 0 0 1-3-3V9a3 3 0 0 1 3-3h21"/><path d="m16 20 10 8L41 7"/></g><defs><clipPath id="a"><path fill="currentColor" d="M0 0h48v48H0z"/></clipPath></defs></svg>',
7+
InsertTable:
8+
'<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="none" viewBox="0 0 48 48"><path stroke="currentColor" stroke-width="4" d="M39.3 6H8.7A2.7 2.7 0 0 0 6 8.7v30.6A2.7 2.7 0 0 0 8.7 42h30.6a2.7 2.7 0 0 0 2.7-2.7V8.7A2.7 2.7 0 0 0 39.3 6Z"/><path stroke="currentColor" stroke-linecap="round" stroke-width="4" d="M18 6v36M30 6v36M6 18h36M6 30h36"/></svg>',
9+
}

packages/plugin-gfm/src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import { icons } from './icons'
12
import en from './locales/en.json'
2-
import * as icons from '@icon-park/svg'
33
import type { BytemdPlugin } from 'bytemd'
44
import remarkGfm, { Options } from 'remark-gfm'
55

@@ -27,7 +27,7 @@ export default function gfm({
2727
actions: [
2828
{
2929
title: locale.strike,
30-
icon: icons.Strikethrough({}),
30+
icon: icons.Strikethrough,
3131
cheatsheet: `~~${locale.strikeText}~~`,
3232
handler: {
3333
type: 'action',
@@ -39,7 +39,7 @@ export default function gfm({
3939
},
4040
{
4141
title: locale.task,
42-
icon: icons.CheckCorrect({}),
42+
icon: icons.CheckCorrect,
4343
cheatsheet: `- [ ] ${locale.taskText}`,
4444
handler: {
4545
type: 'action',
@@ -51,7 +51,7 @@ export default function gfm({
5151
},
5252
{
5353
title: locale.table,
54-
icon: icons.InsertTable({}),
54+
icon: icons.InsertTable,
5555
handler: {
5656
type: 'action',
5757
click({ editor, appendBlock, codemirror }) {

packages/plugin-math-ssr/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
"locales"
2929
],
3030
"dependencies": {
31-
"@icon-park/svg": "^1.4.2",
3231
"rehype-katex": "^6.0.2",
3332
"remark-math": "^5.1.1"
3433
},

0 commit comments

Comments
 (0)