@mistweaverco/mdsvex-shiki 1.0.16 → 1.0.17

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/README.md CHANGED
@@ -1,13 +1,35 @@
1
1
  # mdsvex-shiki
2
2
 
3
- Supports most [common transformers][shiki-transformers] out of the box.
3
+ A highlighter for mdsvex using Shiki with
4
+ support for most [common transformers][shiki-transformers] out of the box.
5
+
6
+ Why? Because mdsvex's built-in Prism highlighter is
7
+ limited in features and customization options.
8
+
9
+ We needed a better solution for our SvelteKit projects,
10
+ so we created this package to fill the gap.
11
+
12
+ <img width="945" height="874" alt="Screenshot" src="https://github.com/user-attachments/assets/c717f559-ae96-4372-a1ac-3eba3d4db340" />
4
13
 
5
14
  ## Installation
6
15
 
7
- Using bun:
16
+ Using your package manager of choice, run:
8
17
 
9
18
  ```bash
10
- bun add @mistweaverco/mdsvex-shiki#v1.0.15
19
+ # npm
20
+ npm install @mistweaverco/mdsvex-shiki@v1.0.16
21
+
22
+ # yarn
23
+ yarn add @mistweaverco/mdsvex-shiki@v1.0.
24
+
25
+ # bun
26
+ bun add @mistweaverco/mdsvex-shiki@v1.0.16
27
+
28
+ # pnpm
29
+ pnpm add @mistweaverco/mdsvex-shiki@v1.0.16
30
+
31
+ # deno
32
+ deno add npm:@mistweaverco/mdsvex-shiki@v1.0.16
11
33
  ```
12
34
 
13
35
  ## Configuration
package/index.cjs CHANGED
@@ -4837,20 +4837,20 @@ var mdsvexWrapItUpTransformer = (lang, codeText, disableCopyButton) => {
4837
4837
  tabindex: "0"
4838
4838
  },
4839
4839
  children: [
4840
- ...children.map((child) => {
4840
+ ...children.flatMap((child) => {
4841
4841
  if (child.type === "element" && child.tagName === "pre") {
4842
- return {
4843
- ...child,
4844
- children: [
4845
- {
4846
- type: "element",
4847
- tagName: "div",
4848
- properties: { class: "header" },
4849
- children: headerChildren
4850
- },
4851
- ...child.children
4852
- ]
4853
- };
4842
+ return [
4843
+ {
4844
+ type: "element",
4845
+ tagName: "div",
4846
+ properties: { class: "header" },
4847
+ children: headerChildren
4848
+ },
4849
+ {
4850
+ ...child,
4851
+ children: child.children
4852
+ }
4853
+ ];
4854
4854
  }
4855
4855
  return child;
4856
4856
  })
@@ -4878,7 +4878,7 @@ var mdsvexWrapItUpTransformer = (lang, codeText, disableCopyButton) => {
4878
4878
  };
4879
4879
  };
4880
4880
 
4881
- // node_modules/shiki/node_modules/@shikijs/types/dist/index.mjs
4881
+ // node_modules/@shikijs/types/dist/index.mjs
4882
4882
  class ShikiError extends Error {
4883
4883
  constructor(message) {
4884
4884
  super(message);
@@ -9629,7 +9629,7 @@ function all(parent) {
9629
9629
  }
9630
9630
  return results.join("");
9631
9631
  }
9632
- // node_modules/shiki/node_modules/@shikijs/core/dist/index.mjs
9632
+ // node_modules/@shikijs/core/dist/index.mjs
9633
9633
  function resolveColorReplacements(theme, options) {
9634
9634
  const replacements = typeof theme === "string" ? {} : { ...theme.colorReplacements };
9635
9635
  const themeName = typeof theme === "string" ? theme : theme.name;
package/index.js CHANGED
@@ -4810,20 +4810,20 @@ var mdsvexWrapItUpTransformer = (lang, codeText, disableCopyButton) => {
4810
4810
  tabindex: "0"
4811
4811
  },
4812
4812
  children: [
4813
- ...children.map((child) => {
4813
+ ...children.flatMap((child) => {
4814
4814
  if (child.type === "element" && child.tagName === "pre") {
4815
- return {
4816
- ...child,
4817
- children: [
4818
- {
4819
- type: "element",
4820
- tagName: "div",
4821
- properties: { class: "header" },
4822
- children: headerChildren
4823
- },
4824
- ...child.children
4825
- ]
4826
- };
4815
+ return [
4816
+ {
4817
+ type: "element",
4818
+ tagName: "div",
4819
+ properties: { class: "header" },
4820
+ children: headerChildren
4821
+ },
4822
+ {
4823
+ ...child,
4824
+ children: child.children
4825
+ }
4826
+ ];
4827
4827
  }
4828
4828
  return child;
4829
4829
  })
@@ -4851,7 +4851,7 @@ var mdsvexWrapItUpTransformer = (lang, codeText, disableCopyButton) => {
4851
4851
  };
4852
4852
  };
4853
4853
 
4854
- // node_modules/shiki/node_modules/@shikijs/types/dist/index.mjs
4854
+ // node_modules/@shikijs/types/dist/index.mjs
4855
4855
  class ShikiError extends Error {
4856
4856
  constructor(message) {
4857
4857
  super(message);
@@ -9602,7 +9602,7 @@ function all(parent) {
9602
9602
  }
9603
9603
  return results.join("");
9604
9604
  }
9605
- // node_modules/shiki/node_modules/@shikijs/core/dist/index.mjs
9605
+ // node_modules/@shikijs/core/dist/index.mjs
9606
9606
  function resolveColorReplacements(theme, options) {
9607
9607
  const replacements = typeof theme === "string" ? {} : { ...theme.colorReplacements };
9608
9608
  const themeName = typeof theme === "string" ? theme : theme.name;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mistweaverco/mdsvex-shiki",
3
- "version": "1.0.16",
3
+ "version": "1.0.17",
4
4
  "type": "module",
5
5
  "main": "./index.cjs",
6
6
  "module": "./index.js",
@@ -24,7 +24,7 @@
24
24
  "prepublishOnly": "bun run build",
25
25
  "clear": "rm -f *.js *.cjs *.d.ts",
26
26
  "build": "bun build.ts",
27
- "publish:npm": "npm publish",
27
+ "publish:npm": "npm publish --access public",
28
28
  "publish:github": "npm publish --registry https://npm.pkg.github.com --access public"
29
29
  },
30
30
  "keywords": [
package/styles.css CHANGED
@@ -25,7 +25,7 @@
25
25
  }
26
26
 
27
27
  .mdsvex-shiki {
28
- padding: 5px 15px;
28
+ padding: 12px 20px;
29
29
  background-color: var(--shiki-dark-bg);
30
30
  position: relative;
31
31
  border: 1px solid var(--shiki-dark-border);
@@ -56,6 +56,8 @@
56
56
  }
57
57
 
58
58
  .mdsvex-shiki .header .language {
59
+ right: 12px;
60
+ top: 8px;
59
61
  color: var(--shiki-dark);
60
62
  font-size: 0.875em;
61
63
  opacity: 0.7;
@@ -79,7 +81,8 @@
79
81
  color: var(--shiki-dark);
80
82
  background-color: transparent;
81
83
  border: none;
82
- padding: 0.25em 0.5em;
84
+ right: 6px;
85
+ top: 8px;
83
86
  cursor: pointer;
84
87
  opacity: 0;
85
88
  display: flex;