@docusaurus/theme-live-codeblock 2.0.0-beta.21 → 2.0.0-beta.22

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.
@@ -78,11 +78,13 @@ export default function Playground({children, transformCode, ...props}) {
78
78
  liveCodeBlock: {playgroundPosition},
79
79
  } = themeConfig;
80
80
  const prismTheme = usePrismTheme();
81
+ const noInline = props.metastring?.includes('noInline') ?? false;
81
82
  return (
82
83
  <div className={styles.playgroundContainer}>
83
84
  {/* @ts-expect-error: type incompatibility with refs */}
84
85
  <LiveProvider
85
86
  code={children.replace(/\n$/, '')}
87
+ noInline={noInline}
86
88
  transformCode={transformCode ?? ((code) => `${code};`)}
87
89
  theme={prismTheme}
88
90
  {...props}>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/theme-live-codeblock",
3
- "version": "2.0.0-beta.21",
3
+ "version": "2.0.0-beta.22",
4
4
  "description": "Docusaurus live code block component.",
5
5
  "main": "lib/index.js",
6
6
  "types": "src/theme-live-codeblock.d.ts",
@@ -23,18 +23,18 @@
23
23
  },
24
24
  "license": "MIT",
25
25
  "dependencies": {
26
- "@docusaurus/core": "2.0.0-beta.21",
27
- "@docusaurus/theme-common": "2.0.0-beta.21",
28
- "@docusaurus/theme-translations": "2.0.0-beta.21",
29
- "@docusaurus/utils-validation": "2.0.0-beta.21",
26
+ "@docusaurus/core": "2.0.0-beta.22",
27
+ "@docusaurus/theme-common": "2.0.0-beta.22",
28
+ "@docusaurus/theme-translations": "2.0.0-beta.22",
29
+ "@docusaurus/utils-validation": "2.0.0-beta.22",
30
30
  "@philpl/buble": "^0.19.7",
31
- "clsx": "^1.1.1",
31
+ "clsx": "^1.2.0",
32
32
  "fs-extra": "^10.1.0",
33
33
  "react-live": "2.2.3",
34
34
  "tslib": "^2.4.0"
35
35
  },
36
36
  "devDependencies": {
37
- "@docusaurus/types": "2.0.0-beta.21",
37
+ "@docusaurus/types": "2.0.0-beta.22",
38
38
  "@types/buble": "^0.20.1"
39
39
  },
40
40
  "peerDependencies": {
@@ -44,5 +44,5 @@
44
44
  "engines": {
45
45
  "node": ">=16.14"
46
46
  },
47
- "gitHead": "69ac49fc6909517f13615ee40290c4bd00c39df4"
47
+ "gitHead": "daf9e462c4eebb7ac26a940932311f987e768f87"
48
48
  }
@@ -93,11 +93,14 @@ export default function Playground({
93
93
  } = themeConfig as ThemeConfig;
94
94
  const prismTheme = usePrismTheme();
95
95
 
96
+ const noInline = props.metastring?.includes('noInline') ?? false;
97
+
96
98
  return (
97
99
  <div className={styles.playgroundContainer}>
98
100
  {/* @ts-expect-error: type incompatibility with refs */}
99
101
  <LiveProvider
100
102
  code={children.replace(/\n$/, '')}
103
+ noInline={noInline}
101
104
  transformCode={transformCode ?? ((code) => `${code};`)}
102
105
  theme={prismTheme}
103
106
  {...props}>
@@ -5,6 +5,9 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
+ /// <reference types="@docusaurus/theme-classic" />
9
+ /// <reference types="@docusaurus/module-type-aliases" />
10
+
8
11
  declare module '@docusaurus/theme-live-codeblock' {
9
12
  export type ThemeConfig = {
10
13
  liveCodeBlock: {
@@ -14,9 +17,12 @@ declare module '@docusaurus/theme-live-codeblock' {
14
17
  }
15
18
 
16
19
  declare module '@theme/Playground' {
20
+ import type {Props as BaseProps} from '@theme/CodeBlock';
17
21
  import type {LiveProviderProps} from 'react-live';
18
22
 
19
- export interface Props extends LiveProviderProps {
23
+ type CodeBlockProps = Omit<BaseProps, 'className' | 'language' | 'title'>;
24
+
25
+ export interface Props extends CodeBlockProps, LiveProviderProps {
20
26
  children: string;
21
27
  }
22
28
  export default function Playground(props: LiveProviderProps): JSX.Element;