@docusaurus/theme-live-codeblock 0.0.0-5774 → 0.0.0-5780

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.
@@ -86,6 +86,9 @@ function EditorWithHeader() {
86
86
  </>
87
87
  );
88
88
  }
89
+ // this should rather be a stable function
90
+ // see https://github.com/facebook/docusaurus/issues/9630#issuecomment-1855682643
91
+ const DEFAULT_TRANSFORM_CODE = (code) => `${code};`;
89
92
  export default function Playground({children, transformCode, ...props}) {
90
93
  const {
91
94
  siteConfig: {themeConfig},
@@ -100,7 +103,7 @@ export default function Playground({children, transformCode, ...props}) {
100
103
  <LiveProvider
101
104
  code={children.replace(/\n$/, '')}
102
105
  noInline={noInline}
103
- transformCode={transformCode ?? ((code) => `${code};`)}
106
+ transformCode={transformCode ?? DEFAULT_TRANSFORM_CODE}
104
107
  theme={prismTheme}
105
108
  {...props}>
106
109
  {playgroundPosition === 'top' ? (
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/theme-live-codeblock",
3
- "version": "0.0.0-5774",
3
+ "version": "0.0.0-5780",
4
4
  "description": "Docusaurus live code block component.",
5
5
  "main": "lib/index.js",
6
6
  "types": "src/theme-live-codeblock.d.ts",
@@ -23,10 +23,10 @@
23
23
  },
24
24
  "license": "MIT",
25
25
  "dependencies": {
26
- "@docusaurus/core": "0.0.0-5774",
27
- "@docusaurus/theme-common": "0.0.0-5774",
28
- "@docusaurus/theme-translations": "0.0.0-5774",
29
- "@docusaurus/utils-validation": "0.0.0-5774",
26
+ "@docusaurus/core": "0.0.0-5780",
27
+ "@docusaurus/theme-common": "0.0.0-5780",
28
+ "@docusaurus/theme-translations": "0.0.0-5780",
29
+ "@docusaurus/utils-validation": "0.0.0-5780",
30
30
  "@philpl/buble": "^0.19.7",
31
31
  "clsx": "^2.0.0",
32
32
  "fs-extra": "^11.1.1",
@@ -34,7 +34,7 @@
34
34
  "tslib": "^2.6.0"
35
35
  },
36
36
  "devDependencies": {
37
- "@docusaurus/types": "0.0.0-5774",
37
+ "@docusaurus/types": "0.0.0-5780",
38
38
  "@types/buble": "^0.20.1"
39
39
  },
40
40
  "peerDependencies": {
@@ -44,5 +44,5 @@
44
44
  "engines": {
45
45
  "node": ">=18.0"
46
46
  },
47
- "gitHead": "39bbe69da70b8a1b84e373451241004c0cbb3861"
47
+ "gitHead": "5dfced5ce8202a15462e873574747d35f117c86b"
48
48
  }
@@ -98,6 +98,10 @@ function EditorWithHeader() {
98
98
  );
99
99
  }
100
100
 
101
+ // this should rather be a stable function
102
+ // see https://github.com/facebook/docusaurus/issues/9630#issuecomment-1855682643
103
+ const DEFAULT_TRANSFORM_CODE = (code: string) => `${code};`;
104
+
101
105
  export default function Playground({
102
106
  children,
103
107
  transformCode,
@@ -118,7 +122,7 @@ export default function Playground({
118
122
  <LiveProvider
119
123
  code={children.replace(/\n$/, '')}
120
124
  noInline={noInline}
121
- transformCode={transformCode ?? ((code) => `${code};`)}
125
+ transformCode={transformCode ?? DEFAULT_TRANSFORM_CODE}
122
126
  theme={prismTheme}
123
127
  {...props}>
124
128
  {playgroundPosition === 'top' ? (