@docusaurus/theme-live-codeblock 2.0.0-beta.18 → 2.0.0-beta.19

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.
@@ -18,6 +18,7 @@ function Header({children}) {
18
18
  }
19
19
  function LivePreviewLoader() {
20
20
  // Is it worth improving/translating?
21
+ // eslint-disable-next-line @docusaurus/no-untranslated-text
21
22
  return <div>Loading...</div>;
22
23
  }
23
24
  function ResultWithHeader() {
@@ -32,7 +32,7 @@ declare const ReactLiveScope: {
32
32
  isValidElement<P_19>(object: {} | null | undefined): object is React.ReactElement<P_19, string | React.JSXElementConstructor<any>>;
33
33
  createRef<T_13>(): React.RefObject<T_13>;
34
34
  forwardRef<T_14, P_20 = {}>(render: React.ForwardRefRenderFunction<T_14, P_20>): React.ForwardRefExoticComponent<React.PropsWithoutRef<P_20> & React.RefAttributes<T_14>>;
35
- memo<P_21 extends object>(Component: React.FunctionComponent<P_21>, propsAreEqual?: ((prevProps: Readonly<React.PropsWithChildren<P_21>>, nextProps: Readonly<React.PropsWithChildren<P_21>>) => boolean) | undefined): React.NamedExoticComponent<P_21>;
35
+ memo<P_21 extends object>(Component: React.FunctionComponent<P_21>, propsAreEqual?: ((prevProps: Readonly<P_21>, nextProps: Readonly<P_21>) => boolean) | undefined): React.NamedExoticComponent<P_21>;
36
36
  memo<T_15 extends React.ComponentType<any>>(Component: T_15, propsAreEqual?: ((prevProps: Readonly<React.ComponentProps<T_15>>, nextProps: Readonly<React.ComponentProps<T_15>>) => boolean) | undefined): React.MemoExoticComponent<T_15>;
37
37
  lazy<T_16 extends React.ComponentType<any>>(factory: () => Promise<{
38
38
  default: T_16;
@@ -51,10 +51,22 @@ declare const ReactLiveScope: {
51
51
  useLayoutEffect(effect: React.EffectCallback, deps?: React.DependencyList | undefined): void;
52
52
  useEffect(effect: React.EffectCallback, deps?: React.DependencyList | undefined): void;
53
53
  useImperativeHandle<T_21, R_5 extends T_21>(ref: React.Ref<T_21> | undefined, init: () => R_5, deps?: React.DependencyList | undefined): void;
54
- useCallback<T_22 extends (...args: any[]) => any>(callback: T_22, deps: React.DependencyList): T_22;
54
+ useCallback<T_22 extends Function>(callback: T_22, deps: React.DependencyList): T_22;
55
55
  useMemo<T_23>(factory: () => T_23, deps: React.DependencyList | undefined): T_23;
56
56
  useDebugValue<T_24>(value: T_24, format?: ((value: T_24) => any) | undefined): void;
57
- Children: React.ReactChildren;
57
+ useDeferredValue<T_25>(value: T_25): T_25;
58
+ useTransition(): [boolean, React.TransitionStartFunction];
59
+ startTransition(scope: React.TransitionFunction): void;
60
+ useId(): string;
61
+ useInsertionEffect(effect: React.EffectCallback, deps?: React.DependencyList | undefined): void;
62
+ useSyncExternalStore<Snapshot>(subscribe: (onStoreChange: () => void) => () => void, getSnapshot: () => Snapshot, getServerSnapshot?: (() => Snapshot) | undefined): Snapshot;
63
+ Children: {
64
+ map<T_26, C_2>(children: C_2 | readonly C_2[], fn: (child: C_2, index: number) => T_26): C_2 extends null | undefined ? C_2 : Exclude<T_26, boolean | null | undefined>[];
65
+ forEach<C_3>(children: C_3 | readonly C_3[], fn: (child: C_3, index: number) => void): void;
66
+ count(children: any): number;
67
+ only<C_4>(children: C_4): C_4 extends any[] ? never : C_4;
68
+ toArray(children: React.ReactNode | React.ReactNode[]): (string | number | React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactFragment | React.ReactPortal)[];
69
+ };
58
70
  Fragment: React.ExoticComponent<{
59
71
  children?: React.ReactNode;
60
72
  }>;
package/package.json CHANGED
@@ -1,9 +1,12 @@
1
1
  {
2
2
  "name": "@docusaurus/theme-live-codeblock",
3
- "version": "2.0.0-beta.18",
3
+ "version": "2.0.0-beta.19",
4
4
  "description": "Docusaurus live code block component.",
5
5
  "main": "lib/index.js",
6
6
  "types": "src/theme-live-codeblock.d.ts",
7
+ "sideEffects": [
8
+ "lib/theme/Playground/*"
9
+ ],
7
10
  "publishConfig": {
8
11
  "access": "public"
9
12
  },
@@ -21,18 +24,18 @@
21
24
  },
22
25
  "license": "MIT",
23
26
  "dependencies": {
24
- "@docusaurus/core": "2.0.0-beta.18",
25
- "@docusaurus/theme-common": "2.0.0-beta.18",
26
- "@docusaurus/theme-translations": "2.0.0-beta.18",
27
- "@docusaurus/utils-validation": "2.0.0-beta.18",
27
+ "@docusaurus/core": "2.0.0-beta.19",
28
+ "@docusaurus/theme-common": "2.0.0-beta.19",
29
+ "@docusaurus/theme-translations": "2.0.0-beta.19",
30
+ "@docusaurus/utils-validation": "2.0.0-beta.19",
28
31
  "@philpl/buble": "^0.19.7",
29
32
  "clsx": "^1.1.1",
30
- "fs-extra": "^10.0.1",
33
+ "fs-extra": "^10.1.0",
31
34
  "react-live": "2.2.3",
32
- "tslib": "^2.3.1"
35
+ "tslib": "^2.4.0"
33
36
  },
34
37
  "devDependencies": {
35
- "@docusaurus/types": "2.0.0-beta.18",
38
+ "@docusaurus/types": "2.0.0-beta.19",
36
39
  "@types/buble": "^0.20.1"
37
40
  },
38
41
  "peerDependencies": {
@@ -42,5 +45,5 @@
42
45
  "engines": {
43
46
  "node": ">=14"
44
47
  },
45
- "gitHead": "1a945d06993d53376e61bed2c942799fe07dc336"
48
+ "gitHead": "a71e60a49cce93c1006ef10c41ac03187f057102"
46
49
  }
package/src/deps.d.ts CHANGED
@@ -10,10 +10,10 @@ declare module '@philpl/buble' {
10
10
  // eslint-disable-next-line import/no-extraneous-dependencies, no-restricted-syntax
11
11
  export * from 'buble';
12
12
  export const features: string[];
13
- export interface TransformOptions extends OriginalTransformOptions {
13
+ export type TransformOptions = OriginalTransformOptions & {
14
14
  transforms?: OriginalTransformOptions['transforms'] & {
15
15
  asyncAwait?: boolean;
16
16
  getterSetter?: boolean;
17
17
  };
18
- }
18
+ };
19
19
  }
@@ -23,6 +23,7 @@ function Header({children}: {children: React.ReactNode}) {
23
23
 
24
24
  function LivePreviewLoader() {
25
25
  // Is it worth improving/translating?
26
+ // eslint-disable-next-line @docusaurus/no-untranslated-text
26
27
  return <div>Loading...</div>;
27
28
  }
28
29
 
@@ -23,9 +23,9 @@ declare module '@theme/Playground' {
23
23
  }
24
24
 
25
25
  declare module '@theme/ReactLiveScope' {
26
- interface Scope {
26
+ type Scope = {
27
27
  [key: string]: unknown;
28
- }
28
+ };
29
29
 
30
30
  const ReactLiveScope: Scope;
31
31
  export default ReactLiveScope;
package/src/types.d.ts CHANGED
@@ -6,9 +6,11 @@
6
6
  */
7
7
 
8
8
  /// <reference types="@docusaurus/theme-classic" />
9
+ /// <reference types="@docusaurus/module-type-aliases" />
9
10
 
10
11
  declare module '@theme-init/CodeBlock' {
11
- import type CodeBlock, {Props as BaseProps} from '@theme/CodeBlock';
12
+ import type CodeBlock from '@theme/CodeBlock';
13
+ import type {Props as BaseProps} from '@theme/CodeBlock';
12
14
 
13
15
  export interface Props extends BaseProps {
14
16
  live?: boolean;