@shikijs/twoslash 1.2.4 → 1.4.0

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.
Files changed (2) hide show
  1. package/dist/core.mjs +14 -8
  2. package/package.json +5 -5
package/dist/core.mjs CHANGED
@@ -415,14 +415,20 @@ function rendererRich(options = {}) {
415
415
  if (!content || content === "any")
416
416
  return [];
417
417
  const popupContents = [];
418
- const typeCode = this.codeToHast(
419
- content,
420
- {
421
- ...this.options,
422
- transformers: [],
423
- lang: this.options.lang === "tsx" || this.options.lang === "jsx" ? "tsx" : "ts"
424
- }
425
- ).children[0].children[0];
418
+ const typeCode = {
419
+ type: "element",
420
+ tagName: "code",
421
+ properties: {},
422
+ children: this.codeToHast(
423
+ content,
424
+ {
425
+ ...this.options,
426
+ transformers: [],
427
+ lang: this.options.lang === "tsx" || this.options.lang === "jsx" ? "tsx" : "ts",
428
+ structure: "inline"
429
+ }
430
+ ).children
431
+ };
426
432
  typeCode.properties.class = "twoslash-popup-code";
427
433
  popupContents.push(
428
434
  extend(
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@shikijs/twoslash",
3
3
  "type": "module",
4
- "version": "1.2.4",
4
+ "version": "1.4.0",
5
5
  "description": "Shiki transformer for twoslash",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -50,14 +50,14 @@
50
50
  ],
51
51
  "dependencies": {
52
52
  "twoslash": "^0.2.5",
53
- "@shikijs/core": "1.2.4"
53
+ "@shikijs/core": "1.4.0"
54
54
  },
55
55
  "devDependencies": {
56
- "@iconify-json/carbon": "^1.1.31",
57
- "@iconify-json/codicon": "^1.1.45",
56
+ "@iconify-json/carbon": "^1.1.32",
57
+ "@iconify-json/codicon": "^1.1.47",
58
58
  "@shikijs/twoslash": "^3.1.2",
59
59
  "hast-util-from-html": "^2.0.1",
60
- "typescript": "^5.4.3"
60
+ "typescript": "^5.4.5"
61
61
  },
62
62
  "scripts": {
63
63
  "build": "unbuild",