Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/kit-1-47.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@dskripchenko/embed": minor
---

The kit 1.47.2 inside: in `<dsk-markdown>` and `<dsk-markdown-editor>` a link or picture destination in angle brackets, as CommonMark allows — `[text](<my notes/plan.md>)` — is the address inside the brackets, spaces and all. Before, the brackets went into the address and a destination with a space was no link at all. The loader's light-theme fallback is written without the kit's comments; with the kit's newer tokens the loader's budget is 10.5 KB gzipped (was 10 KB).
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- run: pnpm test
- run: pnpm build
- name: The loader stays small
run: node -e "const z=require('zlib'),fs=require('fs');const n=z.gzipSync(fs.readFileSync('dist/embed.js'),{level:9}).length;console.log('embed.js gzip',n);if(n>10*1024){console.error('loader over 10 KB gzipped');process.exit(1)}"
run: node -e "const z=require('zlib'),fs=require('fs');const n=z.gzipSync(fs.readFileSync('dist/embed.js'),{level:9}).length;console.log('embed.js gzip',n);if(n>10.5*1024){console.error('loader over 10.5 KB gzipped');process.exit(1)}"

browser:
name: Browser check
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"@dskripchenko/math": "0.1.0",
"@dskripchenko/openapi": "1.3.1",
"@dskripchenko/syntax": "0.4.1",
"@dskripchenko/ui": "1.29.0",
"@dskripchenko/ui": "1.47.2",
"@dskripchenko/wysiwyg": "0.13.0",
"@eslint/js": "^10.0.1",
"@types/node": "^22.20.5",
Expand Down
48 changes: 24 additions & 24 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion scripts/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@ function lightFallback() {
const themes = readFileSync(join(pkgDir('@dskripchenko/ui'), 'dist/styles/themes.css'), 'utf8')
const block = /:root\[data-theme='light'\]\s*\{[^}]*\}/.exec(themes)?.[0]
if (!block) throw new Error('light theme block not found in @dskripchenko/ui themes.css')
return block.replace(":root[data-theme='light']", ':root:not([data-theme])').replace(/\s+/g, ' ')
// Minified: the kit's comments and spaces are no part of the loader's 10.5 KB.
return block
.replace(":root[data-theme='light']", ':root:not([data-theme])')
.replace(/\/\*[\s\S]*?\*\//g, '')
.replace(/\s+/g, ' ')
.replace(/\s*([{};:,])\s*/g, '$1')
.trim()
}

const virtualLight = {
Expand Down
Loading