@docusaurus/theme-live-codeblock 3.3.2 → 3.5.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.
@@ -4,7 +4,6 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- /// <reference path="../src/deps.d.ts" />
8
7
  import { type TransformOptions, type TransformOutput } from '@philpl/buble';
9
8
  export { features } from '@philpl/buble';
10
9
  export declare function transform(source: string, options: TransformOptions): TransformOutput;
package/lib/index.js CHANGED
@@ -7,6 +7,7 @@
7
7
  */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.validateThemeConfig = void 0;
10
+ exports.default = themeLiveCodeblock;
10
11
  const theme_translations_1 = require("@docusaurus/theme-translations");
11
12
  function themeLiveCodeblock(context) {
12
13
  const { i18n: { currentLocale }, } = context;
@@ -35,6 +36,5 @@ function themeLiveCodeblock(context) {
35
36
  },
36
37
  };
37
38
  }
38
- exports.default = themeLiveCodeblock;
39
39
  var validateThemeConfig_1 = require("./validateThemeConfig");
40
40
  Object.defineProperty(exports, "validateThemeConfig", { enumerable: true, get: function () { return validateThemeConfig_1.validateThemeConfig; } });
@@ -4,7 +4,6 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- /// <reference path="../../../src/types.d.ts" />
8
7
  import React from 'react';
9
8
  import { type Props } from '@theme-init/CodeBlock';
10
9
  declare const _default: (props: Props) => React.JSX.Element;
@@ -4,7 +4,5 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- /// <reference path="../../../src/theme-live-codeblock.d.ts" />
8
- /// <reference types="react" />
9
7
  import type { Props } from '@theme/Playground';
10
8
  export default function Playground({ children, transformCode, ...props }: Props): JSX.Element;
@@ -8,70 +8,70 @@ import React from 'react';
8
8
  declare const ReactLiveScope: {
9
9
  createFactory<T extends HTMLElement>(type: keyof React.ReactHTML): React.HTMLFactory<T>;
10
10
  createFactory(type: keyof React.ReactSVG): React.SVGFactory;
11
- createFactory<P extends React.DOMAttributes<T_1>, T_1 extends Element>(type: string): React.DOMFactory<P, T_1>;
12
- createFactory<P_1>(type: React.FunctionComponent<P_1>): React.FunctionComponentFactory<P_1>;
13
- createFactory<P_2>(type: React.ClassType<P_2, React.ClassicComponent<P_2, any>, React.ClassicComponentClass<P_2>>): React.CFactory<P_2, React.ClassicComponent<P_2, any>>;
14
- createFactory<P_3, T_2 extends React.Component<P_3, any, any>, C extends React.ComponentClass<P_3, any>>(type: React.ClassType<P_3, T_2, C>): React.CFactory<P_3, T_2>;
15
- createFactory<P_4>(type: React.ComponentClass<P_4, any>): React.Factory<P_4>;
16
- createElement(type: "input", props?: (React.InputHTMLAttributes<HTMLInputElement> & React.ClassAttributes<HTMLInputElement>) | null | undefined, ...children: React.ReactNode[]): React.DetailedReactHTMLElement<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
17
- createElement<P_5 extends React.HTMLAttributes<T_3>, T_3 extends HTMLElement>(type: keyof React.ReactHTML, props?: (React.ClassAttributes<T_3> & P_5) | null | undefined, ...children: React.ReactNode[]): React.DetailedReactHTMLElement<P_5, T_3>;
18
- createElement<P_6 extends React.SVGAttributes<T_4>, T_4 extends SVGElement>(type: keyof React.ReactSVG, props?: (React.ClassAttributes<T_4> & P_6) | null | undefined, ...children: React.ReactNode[]): React.ReactSVGElement;
19
- createElement<P_7 extends React.DOMAttributes<T_5>, T_5 extends Element>(type: string, props?: (React.ClassAttributes<T_5> & P_7) | null | undefined, ...children: React.ReactNode[]): React.DOMElement<P_7, T_5>;
20
- createElement<P_8 extends {}>(type: React.FunctionComponent<P_8>, props?: (React.Attributes & P_8) | null | undefined, ...children: React.ReactNode[]): React.FunctionComponentElement<P_8>;
21
- createElement<P_9 extends {}>(type: React.ClassType<P_9, React.ClassicComponent<P_9, any>, React.ClassicComponentClass<P_9>>, props?: (React.ClassAttributes<React.ClassicComponent<P_9, any>> & P_9) | null | undefined, ...children: React.ReactNode[]): React.CElement<P_9, React.ClassicComponent<P_9, any>>;
22
- createElement<P_10 extends {}, T_6 extends React.Component<P_10, any, any>, C_1 extends React.ComponentClass<P_10, any>>(type: React.ClassType<P_10, T_6, C_1>, props?: (React.ClassAttributes<T_6> & P_10) | null | undefined, ...children: React.ReactNode[]): React.CElement<P_10, T_6>;
23
- createElement<P_11 extends {}>(type: string | React.FunctionComponent<P_11> | React.ComponentClass<P_11, any>, props?: (React.Attributes & P_11) | null | undefined, ...children: React.ReactNode[]): React.ReactElement<P_11, string | React.JSXElementConstructor<any>>;
24
- cloneElement<P_12 extends React.HTMLAttributes<T_7>, T_7 extends HTMLElement>(element: React.DetailedReactHTMLElement<P_12, T_7>, props?: P_12 | undefined, ...children: React.ReactNode[]): React.DetailedReactHTMLElement<P_12, T_7>;
25
- cloneElement<P_13 extends React.HTMLAttributes<T_8>, T_8 extends HTMLElement>(element: React.ReactHTMLElement<T_8>, props?: P_13 | undefined, ...children: React.ReactNode[]): React.ReactHTMLElement<T_8>;
26
- cloneElement<P_14 extends React.SVGAttributes<T_9>, T_9 extends SVGElement>(element: React.ReactSVGElement, props?: P_14 | undefined, ...children: React.ReactNode[]): React.ReactSVGElement;
27
- cloneElement<P_15 extends React.DOMAttributes<T_10>, T_10 extends Element>(element: React.DOMElement<P_15, T_10>, props?: (React.DOMAttributes<T_10> & P_15) | undefined, ...children: React.ReactNode[]): React.DOMElement<P_15, T_10>;
28
- cloneElement<P_16>(element: React.FunctionComponentElement<P_16>, props?: (Partial<P_16> & React.Attributes) | undefined, ...children: React.ReactNode[]): React.FunctionComponentElement<P_16>;
29
- cloneElement<P_17, T_11 extends React.Component<P_17, any, any>>(element: React.CElement<P_17, T_11>, props?: (Partial<P_17> & React.ClassAttributes<T_11>) | undefined, ...children: React.ReactNode[]): React.CElement<P_17, T_11>;
30
- cloneElement<P_18>(element: React.ReactElement<P_18, string | React.JSXElementConstructor<any>>, props?: (Partial<P_18> & React.Attributes) | undefined, ...children: React.ReactNode[]): React.ReactElement<P_18, string | React.JSXElementConstructor<any>>;
31
- createContext<T_12>(defaultValue: T_12): React.Context<T_12>;
32
- isValidElement<P_19>(object: {} | null | undefined): object is React.ReactElement<P_19, string | React.JSXElementConstructor<any>>;
33
- createRef<T_13>(): React.RefObject<T_13>;
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<P_21>, nextProps: Readonly<P_21>) => boolean) | undefined): React.NamedExoticComponent<P_21>;
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
- lazy<T_16 extends React.ComponentType<any>>(factory: () => Promise<{
38
- default: T_16;
39
- }>): React.LazyExoticComponent<T_16>;
40
- useContext<T_17>(context: React.Context<T_17>): T_17;
11
+ createFactory<P extends React.DOMAttributes<T>, T extends Element>(type: string): React.DOMFactory<P, T>;
12
+ createFactory<P>(type: React.FunctionComponent<P>): React.FunctionComponentFactory<P>;
13
+ createFactory<P>(type: React.ClassType<P, React.ClassicComponent<P, React.ComponentState>, React.ClassicComponentClass<P>>): React.CFactory<P, React.ClassicComponent<P, React.ComponentState>>;
14
+ createFactory<P, T extends React.Component<P, React.ComponentState>, C extends React.ComponentClass<P>>(type: React.ClassType<P, T, C>): React.CFactory<P, T>;
15
+ createFactory<P>(type: React.ComponentClass<P>): React.Factory<P>;
16
+ createElement(type: "input", props?: (React.InputHTMLAttributes<HTMLInputElement> & React.ClassAttributes<HTMLInputElement>) | null, ...children: React.ReactNode[]): React.DetailedReactHTMLElement<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
17
+ createElement<P extends React.HTMLAttributes<T>, T extends HTMLElement>(type: keyof React.ReactHTML, props?: (React.ClassAttributes<T> & P) | null, ...children: React.ReactNode[]): React.DetailedReactHTMLElement<P, T>;
18
+ createElement<P extends React.SVGAttributes<T>, T extends SVGElement>(type: keyof React.ReactSVG, props?: (React.ClassAttributes<T> & P) | null, ...children: React.ReactNode[]): React.ReactSVGElement;
19
+ createElement<P extends React.DOMAttributes<T>, T extends Element>(type: string, props?: (React.ClassAttributes<T> & P) | null, ...children: React.ReactNode[]): React.DOMElement<P, T>;
20
+ createElement<P extends {}>(type: React.FunctionComponent<P>, props?: (React.Attributes & P) | null, ...children: React.ReactNode[]): React.FunctionComponentElement<P>;
21
+ createElement<P extends {}>(type: React.ClassType<P, React.ClassicComponent<P, React.ComponentState>, React.ClassicComponentClass<P>>, props?: (React.ClassAttributes<React.ClassicComponent<P, React.ComponentState>> & P) | null, ...children: React.ReactNode[]): React.CElement<P, React.ClassicComponent<P, React.ComponentState>>;
22
+ createElement<P extends {}, T extends React.Component<P, React.ComponentState>, C extends React.ComponentClass<P>>(type: React.ClassType<P, T, C>, props?: (React.ClassAttributes<T> & P) | null, ...children: React.ReactNode[]): React.CElement<P, T>;
23
+ createElement<P extends {}>(type: React.FunctionComponent<P> | React.ComponentClass<P> | string, props?: (React.Attributes & P) | null, ...children: React.ReactNode[]): React.ReactElement<P>;
24
+ cloneElement<P extends React.HTMLAttributes<T>, T extends HTMLElement>(element: React.DetailedReactHTMLElement<P, T>, props?: P, ...children: React.ReactNode[]): React.DetailedReactHTMLElement<P, T>;
25
+ cloneElement<P extends React.HTMLAttributes<T>, T extends HTMLElement>(element: React.ReactHTMLElement<T>, props?: P, ...children: React.ReactNode[]): React.ReactHTMLElement<T>;
26
+ cloneElement<P extends React.SVGAttributes<T>, T extends SVGElement>(element: React.ReactSVGElement, props?: P, ...children: React.ReactNode[]): React.ReactSVGElement;
27
+ cloneElement<P extends React.DOMAttributes<T>, T extends Element>(element: React.DOMElement<P, T>, props?: React.DOMAttributes<T> & P, ...children: React.ReactNode[]): React.DOMElement<P, T>;
28
+ cloneElement<P>(element: React.FunctionComponentElement<P>, props?: Partial<P> & React.Attributes, ...children: React.ReactNode[]): React.FunctionComponentElement<P>;
29
+ cloneElement<P, T extends React.Component<P, React.ComponentState>>(element: React.CElement<P, T>, props?: Partial<P> & React.ClassAttributes<T>, ...children: React.ReactNode[]): React.CElement<P, T>;
30
+ cloneElement<P>(element: React.ReactElement<P>, props?: Partial<P> & React.Attributes, ...children: React.ReactNode[]): React.ReactElement<P>;
31
+ createContext<T>(defaultValue: T): React.Context<T>;
32
+ isValidElement<P>(object: {} | null | undefined): object is React.ReactElement<P>;
33
+ createRef<T>(): React.RefObject<T>;
34
+ forwardRef<T, P = {}>(render: React.ForwardRefRenderFunction<T, P>): React.ForwardRefExoticComponent<React.PropsWithoutRef<P> & React.RefAttributes<T>>;
35
+ memo<P extends object>(Component: React.FunctionComponent<P>, propsAreEqual?: (prevProps: Readonly<P>, nextProps: Readonly<P>) => boolean): React.NamedExoticComponent<P>;
36
+ memo<T extends React.ComponentType<any>>(Component: T, propsAreEqual?: (prevProps: Readonly<React.ComponentProps<T>>, nextProps: Readonly<React.ComponentProps<T>>) => boolean): React.MemoExoticComponent<T>;
37
+ lazy<T extends React.ComponentType<any>>(factory: () => Promise<{
38
+ default: T;
39
+ }>): React.LazyExoticComponent<T>;
40
+ useContext<T>(context: React.Context<T>): T;
41
41
  useState<S>(initialState: S | (() => S)): [S, React.Dispatch<React.SetStateAction<S>>];
42
- useState<S_1 = undefined>(): [S_1 | undefined, React.Dispatch<React.SetStateAction<S_1 | undefined>>];
42
+ useState<S = undefined>(): [S | undefined, React.Dispatch<React.SetStateAction<S | undefined>>];
43
43
  useReducer<R extends React.ReducerWithoutAction<any>, I>(reducer: R, initializerArg: I, initializer: (arg: I) => React.ReducerStateWithoutAction<R>): [React.ReducerStateWithoutAction<R>, React.DispatchWithoutAction];
44
- useReducer<R_1 extends React.ReducerWithoutAction<any>>(reducer: R_1, initializerArg: React.ReducerStateWithoutAction<R_1>, initializer?: undefined): [React.ReducerStateWithoutAction<R_1>, React.DispatchWithoutAction];
45
- useReducer<R_2 extends React.Reducer<any, any>, I_1>(reducer: R_2, initializerArg: I_1 & React.ReducerState<R_2>, initializer: (arg: I_1 & React.ReducerState<R_2>) => React.ReducerState<R_2>): [React.ReducerState<R_2>, React.Dispatch<React.ReducerAction<R_2>>];
46
- useReducer<R_3 extends React.Reducer<any, any>, I_2>(reducer: R_3, initializerArg: I_2, initializer: (arg: I_2) => React.ReducerState<R_3>): [React.ReducerState<R_3>, React.Dispatch<React.ReducerAction<R_3>>];
47
- useReducer<R_4 extends React.Reducer<any, any>>(reducer: R_4, initialState: React.ReducerState<R_4>, initializer?: undefined): [React.ReducerState<R_4>, React.Dispatch<React.ReducerAction<R_4>>];
48
- useRef<T_18>(initialValue: T_18): React.MutableRefObject<T_18>;
49
- useRef<T_19>(initialValue: T_19 | null): React.RefObject<T_19>;
50
- useRef<T_20 = undefined>(): React.MutableRefObject<T_20 | undefined>;
51
- useLayoutEffect(effect: React.EffectCallback, deps?: React.DependencyList | undefined): void;
52
- useEffect(effect: React.EffectCallback, deps?: React.DependencyList | undefined): void;
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 Function>(callback: T_22, deps: React.DependencyList): T_22;
55
- useMemo<T_23>(factory: () => T_23, deps: React.DependencyList | undefined): T_23;
56
- useDebugValue<T_24>(value: T_24, format?: ((value: T_24) => any) | undefined): void;
57
- useDeferredValue<T_25>(value: T_25): T_25;
44
+ useReducer<R extends React.ReducerWithoutAction<any>>(reducer: R, initializerArg: React.ReducerStateWithoutAction<R>, initializer?: undefined): [React.ReducerStateWithoutAction<R>, React.DispatchWithoutAction];
45
+ useReducer<R extends React.Reducer<any, any>, I>(reducer: R, initializerArg: I & React.ReducerState<R>, initializer: (arg: I & React.ReducerState<R>) => React.ReducerState<R>): [React.ReducerState<R>, React.Dispatch<React.ReducerAction<R>>];
46
+ useReducer<R extends React.Reducer<any, any>, I>(reducer: R, initializerArg: I, initializer: (arg: I) => React.ReducerState<R>): [React.ReducerState<R>, React.Dispatch<React.ReducerAction<R>>];
47
+ useReducer<R extends React.Reducer<any, any>>(reducer: R, initialState: React.ReducerState<R>, initializer?: undefined): [React.ReducerState<R>, React.Dispatch<React.ReducerAction<R>>];
48
+ useRef<T>(initialValue: T): React.MutableRefObject<T>;
49
+ useRef<T>(initialValue: T | null): React.RefObject<T>;
50
+ useRef<T = undefined>(): React.MutableRefObject<T | undefined>;
51
+ useLayoutEffect(effect: React.EffectCallback, deps?: React.DependencyList): void;
52
+ useEffect(effect: React.EffectCallback, deps?: React.DependencyList): void;
53
+ useImperativeHandle<T, R extends T>(ref: React.Ref<T> | undefined, init: () => R, deps?: React.DependencyList): void;
54
+ useCallback<T extends Function>(callback: T, deps: React.DependencyList): T;
55
+ useMemo<T>(factory: () => T, deps: React.DependencyList | undefined): T;
56
+ useDebugValue<T>(value: T, format?: (value: T) => any): void;
57
+ useDeferredValue<T>(value: T): T;
58
58
  useTransition(): [boolean, React.TransitionStartFunction];
59
59
  startTransition(scope: React.TransitionFunction): void;
60
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;
61
+ useInsertionEffect(effect: React.EffectCallback, deps?: React.DependencyList): void;
62
+ useSyncExternalStore<Snapshot>(subscribe: (onStoreChange: () => void) => () => void, getSnapshot: () => Snapshot, getServerSnapshot?: () => Snapshot): Snapshot;
63
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;
64
+ map<T, C>(children: C | ReadonlyArray<C>, fn: (child: C, index: number) => T): C extends null | undefined ? C : Array<Exclude<T, boolean | null | undefined>>;
65
+ forEach<C>(children: C | ReadonlyArray<C>, fn: (child: C, index: number) => void): void;
66
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>> | Iterable<React.ReactNode> | React.ReactPortal)[];
67
+ only<C>(children: C): C extends any[] ? never : C;
68
+ toArray(children: React.ReactNode | React.ReactNode[]): Array<Exclude<React.ReactNode, boolean | null | undefined>>;
69
69
  };
70
70
  Fragment: React.ExoticComponent<{
71
- children?: React.ReactNode;
71
+ children?: React.ReactNode | undefined;
72
72
  }>;
73
73
  StrictMode: React.ExoticComponent<{
74
- children?: React.ReactNode;
74
+ children?: React.ReactNode | undefined;
75
75
  }>;
76
76
  Suspense: React.ExoticComponent<React.SuspenseProps>;
77
77
  version: string;
@@ -6,7 +6,8 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.validateThemeConfig = exports.Schema = exports.DEFAULT_CONFIG = void 0;
9
+ exports.Schema = exports.DEFAULT_CONFIG = void 0;
10
+ exports.validateThemeConfig = validateThemeConfig;
10
11
  const utils_validation_1 = require("@docusaurus/utils-validation");
11
12
  exports.DEFAULT_CONFIG = {
12
13
  playgroundPosition: 'bottom',
@@ -23,4 +24,3 @@ exports.Schema = utils_validation_1.Joi.object({
23
24
  function validateThemeConfig({ validate, themeConfig, }) {
24
25
  return validate(exports.Schema, themeConfig);
25
26
  }
26
- exports.validateThemeConfig = validateThemeConfig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/theme-live-codeblock",
3
- "version": "3.3.2",
3
+ "version": "3.5.0",
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": "3.3.2",
27
- "@docusaurus/theme-common": "3.3.2",
28
- "@docusaurus/theme-translations": "3.3.2",
29
- "@docusaurus/utils-validation": "3.3.2",
26
+ "@docusaurus/core": "3.5.0",
27
+ "@docusaurus/theme-common": "3.5.0",
28
+ "@docusaurus/theme-translations": "3.5.0",
29
+ "@docusaurus/utils-validation": "3.5.0",
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": "3.3.2",
37
+ "@docusaurus/types": "3.5.0",
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": "bc638d674bfbde1e254ef306697f47e764b5e107"
47
+ "gitHead": "cb5829f3c34b26d798b869e38ee25073488140bd"
48
48
  }