Skip to content

Commit

Permalink
fix: editor close icon
Browse files Browse the repository at this point in the history
  • Loading branch information
pd4d10 committed Jan 4, 2023
1 parent d12c70c commit 64c3325
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
"scripts": {
"build": "rm -rf packages/*/tsconfig.tsbuildinfo && tsc --build && tsx scripts/build.ts",
"dev": "pnpm --filter playground dev",
"style": "prettier --check '**/*.{ts,tsx,json,md,svelte}'",
"format": "prettier --write '**/*.{ts,tsx,json,md,svelte}' && sort-package-json package.json 'packages/*/package.json'",
"postinstall": "tsx scripts/postinstall.ts && pnpm format && sort-json packages/*/locales/*.json",
"pub": "pnpm build && lerna publish",
"style": "prettier --check '**/*.{ts,tsx,json,md,svelte}'",
"test": "pnpm --filter bytemd test"
},
"prettier": {
Expand Down
4 changes: 2 additions & 2 deletions packages/bytemd/src/editor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
handleImageUpload,
} from './editor'
import Help from './help.svelte'
import * as icons from './icons'
import { icons } from './icons'
import Status from './status.svelte'
import Toc from './toc.svelte'
import Toolbar from './toolbar.svelte'
Expand Down Expand Up @@ -407,7 +407,7 @@
sidebar = false
}}
>
{@html icons.Close({})}
{@html icons.Close}
</div>
<Help
locale={mergedLocale}
Expand Down
2 changes: 2 additions & 0 deletions packages/bytemd/src/icons.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// DO NOT EDIT, generated by scripts/icon.ts
export const icons = {
Close:
'<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="m8 8 32 32M8 40 40 8"/></svg>',
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>',
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>',
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>',
Expand Down
2 changes: 2 additions & 0 deletions scripts/icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import svgo from 'svgo'

const meta: Record<string, (keyof typeof icons)[]> = {
'bytemd/src': [
'Close',

'H',
'H1',
'H2',
Expand Down

0 comments on commit 64c3325

Please sign in to comment.