timvir 0.2.19 → 0.2.20

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.
@@ -59,7 +59,12 @@ function Code(props, ref) {
59
59
  const [state, mutate] = useImmer({
60
60
  mouseOver: false,
61
61
  copiedToClipboard: false,
62
- html: ""
62
+ /*
63
+ * Prevent layout shift during (asynchronous) highlighting of the markup by
64
+ * initializing the html witha pre/code block with the expected number of
65
+ * lines.
66
+ */
67
+ html: `<pre><code>${children.trim().split("\n").map(() => "\n").join("")}</code></pre>`
63
68
  });
64
69
  React.useEffect(() => {
65
70
  (async () => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "timvir",
4
- "version": "0.2.19",
4
+ "version": "0.2.20",
5
5
  "license": "MIT",
6
6
  "sideEffects": false,
7
7
  "exports": {
@@ -21,7 +21,7 @@
21
21
  "immer": "^9 || ^10",
22
22
  "shiki": "^1",
23
23
  "react-feather": "^2",
24
- "use-immer": "^0.8.0 || ^0.8.1 || ^0.9.0",
24
+ "use-immer": "^0.8.0 || ^0.8.1 || ^0.9.0 || ^0.10.0",
25
25
  "wonka": "^6"
26
26
  },
27
27
  "peerDependencies": {