@wordpress/element 6.40.1-next.v.202602271551.0 → 6.40.1
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.
- package/build-types/react-polyfill-base.d.ts +5 -0
- package/build-types/react-polyfill-base.d.ts.map +1 -0
- package/build-types/react-polyfill.d.ts +42 -0
- package/build-types/react-polyfill.d.ts.map +1 -0
- package/build-types/types.d.ts +39 -0
- package/build-types/types.d.ts.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function findDOMNode(instance: any): Element | Text | null;
|
|
2
|
+
export declare function render(element: React.ReactNode, container: Element, callback?: () => void): void;
|
|
3
|
+
export declare function hydrate(element: React.ReactNode, container: Element, callback?: () => void): void;
|
|
4
|
+
export declare function unmountComponentAtNode(container: Element): boolean;
|
|
5
|
+
//# sourceMappingURL=react-polyfill-base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-polyfill-base.d.ts","sourceRoot":"","sources":["../src/react-polyfill-base.ts"],"names":[],"mappings":"AAyDA,wBAAgB,WAAW,CAAE,QAAQ,EAAE,GAAG,GAAI,OAAO,GAAG,IAAI,GAAG,IAAI,CAsBlE;AAID,wBAAgB,MAAM,CACrB,OAAO,EAAE,KAAK,CAAC,SAAS,EACxB,SAAS,EAAE,OAAO,EAClB,QAAQ,CAAC,EAAE,MAAM,IAAI,GACnB,IAAI,CAcN;AAED,wBAAgB,OAAO,CACtB,OAAO,EAAE,KAAK,CAAC,SAAS,EACxB,SAAS,EAAE,OAAO,EAClB,QAAQ,CAAC,EAAE,MAAM,IAAI,GACnB,IAAI,CAYN;AAED,wBAAgB,sBAAsB,CAAE,SAAS,EAAE,OAAO,GAAI,OAAO,CAWpE"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Finds the DOM node of a React component instance.
|
|
3
|
+
*
|
|
4
|
+
* @deprecated since WordPress 7.1.0. Use DOM refs instead.
|
|
5
|
+
* @see https://react.dev/reference/react-dom/findDOMNode
|
|
6
|
+
*
|
|
7
|
+
* @param instance Component's instance.
|
|
8
|
+
*/
|
|
9
|
+
export declare function findDOMNode(instance: any): Element | Text | null;
|
|
10
|
+
/**
|
|
11
|
+
* Renders a given element into the target DOM node.
|
|
12
|
+
*
|
|
13
|
+
* @deprecated since WordPress 6.2.0. Use `createRoot` instead.
|
|
14
|
+
* @see https://react.dev/reference/react-dom/render
|
|
15
|
+
*
|
|
16
|
+
* @param element Element to render.
|
|
17
|
+
* @param container DOM node into which to render.
|
|
18
|
+
* @param callback Optional callback called after render.
|
|
19
|
+
*/
|
|
20
|
+
export declare function render(element: React.ReactNode, container: Element, callback?: () => void): void;
|
|
21
|
+
/**
|
|
22
|
+
* Hydrates a given element into the target DOM node.
|
|
23
|
+
*
|
|
24
|
+
* @deprecated since WordPress 6.2.0. Use `hydrateRoot` instead.
|
|
25
|
+
* @see https://react.dev/reference/react-dom/hydrate
|
|
26
|
+
*
|
|
27
|
+
* @param element Element to hydrate.
|
|
28
|
+
* @param container DOM node to hydrate.
|
|
29
|
+
* @param callback Optional callback called after hydration.
|
|
30
|
+
*/
|
|
31
|
+
export declare function hydrate(element: React.ReactNode, container: Element, callback?: () => void): void;
|
|
32
|
+
/**
|
|
33
|
+
* Removes any mounted element from the target DOM node.
|
|
34
|
+
*
|
|
35
|
+
* @deprecated since WordPress 6.2.0. Use `root.unmount()` instead.
|
|
36
|
+
* @see https://react.dev/reference/react-dom/unmountComponentAtNode
|
|
37
|
+
*
|
|
38
|
+
* @param container DOM node in which to unmount.
|
|
39
|
+
* @return Whether the node was unmounted.
|
|
40
|
+
*/
|
|
41
|
+
export declare function unmountComponentAtNode(container: Element): boolean;
|
|
42
|
+
//# sourceMappingURL=react-polyfill.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-polyfill.d.ts","sourceRoot":"","sources":["../src/react-polyfill.ts"],"names":[],"mappings":"AAeA;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAE,QAAQ,EAAE,GAAG,GAAI,OAAO,GAAG,IAAI,GAAG,IAAI,CAQlE;AAED;;;;;;;;;GASG;AACH,wBAAgB,MAAM,CACrB,OAAO,EAAE,KAAK,CAAC,SAAS,EACxB,SAAS,EAAE,OAAO,EAClB,QAAQ,CAAC,EAAE,MAAM,IAAI,GACnB,IAAI,CAQN;AAED;;;;;;;;;GASG;AACH,wBAAgB,OAAO,CACtB,OAAO,EAAE,KAAK,CAAC,SAAS,EACxB,SAAS,EAAE,OAAO,EAClB,QAAQ,CAAC,EAAE,MAAM,IAAI,GACnB,IAAI,CAQN;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAE,SAAS,EAAE,OAAO,GAAI,OAAO,CAQpE"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Mirrors `TransformedText` from @wordpress/i18n.
|
|
4
|
+
* We don't import directly to avoid a circular dependency.
|
|
5
|
+
*/
|
|
6
|
+
type TransformedText<T extends string> = string & {
|
|
7
|
+
readonly __transformedText: T;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* The input that can be passed to `createInterpolateElement`.
|
|
11
|
+
*/
|
|
12
|
+
export type InterpolationInput = string | TransformedText<string>;
|
|
13
|
+
/**
|
|
14
|
+
* The literal string extracted from the input.
|
|
15
|
+
*/
|
|
16
|
+
export type InterpolationString<Input> = Input extends TransformedText<infer Text> ? Text : Input;
|
|
17
|
+
/**
|
|
18
|
+
* Recursively trims trailing spaces from a string type.
|
|
19
|
+
* Matches the runtime tokenizer's `\s*` before the closing `>` or `/>`.
|
|
20
|
+
*/
|
|
21
|
+
type TrimTrailingSpaces<S extends string> = S extends `${infer Rest} ` ? TrimTrailingSpaces<Rest> : S;
|
|
22
|
+
/**
|
|
23
|
+
* Helper type to extract tag name and handle closing/self-closing indicators.
|
|
24
|
+
* Filters out tags with spaces as they won't be parsed by the tokenizer.
|
|
25
|
+
*/
|
|
26
|
+
type ExtractTagName<T extends string> = T extends `/${string}` ? never : TrimTrailingSpaces<T> extends infer Name extends string ? Name extends '' ? never : Name extends `${string} ${string}` ? never : Name extends `${infer Base}/` ? Base : Name : never;
|
|
27
|
+
/**
|
|
28
|
+
* Utility type to extract all tag names from a template literal string.
|
|
29
|
+
* Only handles simple tags without attributes, matching the runtime tokenizer.
|
|
30
|
+
*/
|
|
31
|
+
export type ExtractTags<T extends string> = T extends `${string}<${infer Tag}>${infer After}` ? ExtractTagName<Tag> | ExtractTags<After> : never;
|
|
32
|
+
/**
|
|
33
|
+
* Utility type to create a conversion map that:
|
|
34
|
+
* - Makes extracted tag keys optional
|
|
35
|
+
* - Only allows properties for tags found in the template literal
|
|
36
|
+
*/
|
|
37
|
+
export type ConversionMap<T extends string> = Partial<Record<ExtractTags<T>, ReactElement>>;
|
|
38
|
+
export {};
|
|
39
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C;;;GAGG;AACH,KAAK,eAAe,CAAE,CAAC,SAAS,MAAM,IAAK,MAAM,GAAG;IACnD,QAAQ,CAAC,iBAAiB,EAAE,CAAC,CAAC;CAC9B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,eAAe,CAAE,MAAM,CAAE,CAAC;AAEpE;;GAEG;AACH,MAAM,MAAM,mBAAmB,CAAE,KAAK,IAAK,KAAK,SAAS,eAAe,CACvE,MAAM,IAAI,CACV,GACE,IAAI,GACJ,KAAK,CAAC;AAET;;;GAGG;AACH,KAAK,kBAAkB,CAAE,CAAC,SAAS,MAAM,IAAK,CAAC,SAAS,GAAI,MAAM,IAAK,GAAG,GACvE,kBAAkB,CAAE,IAAI,CAAE,GAC1B,CAAC,CAAC;AAEL;;;GAGG;AACH,KAAK,cAAc,CAAE,CAAC,SAAS,MAAM,IAEpC,CAAC,SAAS,IAAK,MAAO,EAAE,GACrB,KAAK,GACL,kBAAkB,CAAE,CAAC,CAAE,SAAS,MAAM,IAAI,SAAS,MAAM,GACzD,IAAI,SAAS,EAAE,GACd,KAAK,GACL,IAAI,SAAS,GAAI,MAAO,IAAK,MAAO,EAAE,GACtC,KAAK,GACL,IAAI,SAAS,GAAI,MAAM,IAAK,GAAG,GAC/B,IAAI,GACJ,IAAI,GACL,KAAK,CAAC;AAEV;;;GAGG;AACH,MAAM,MAAM,WAAW,CAAE,CAAC,SAAS,MAAM,IACxC,CAAC,SAAS,GAAI,MAAO,IAAK,MAAM,GAAI,IAAK,MAAM,KAAM,EAAE,GACpD,cAAc,CAAE,GAAG,CAAE,GAAG,WAAW,CAAE,KAAK,CAAE,GAC5C,KAAK,CAAC;AAEV;;;;GAIG;AACH,MAAM,MAAM,aAAa,CAAE,CAAC,SAAS,MAAM,IAAK,OAAO,CACtD,MAAM,CAAE,WAAW,CAAE,CAAC,CAAE,EAAE,YAAY,CAAE,CACxC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/element",
|
|
3
|
-
"version": "6.40.1
|
|
3
|
+
"version": "6.40.1",
|
|
4
4
|
"description": "Element React module for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@types/react": "^18.3.27",
|
|
49
49
|
"@types/react-dom": "^18.3.1",
|
|
50
|
-
"@wordpress/escape-html": "^3.40.1
|
|
50
|
+
"@wordpress/escape-html": "^3.40.1",
|
|
51
51
|
"change-case": "^4.1.2",
|
|
52
52
|
"is-plain-object": "^5.0.0",
|
|
53
53
|
"react": "^18.3.0",
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"publishConfig": {
|
|
57
57
|
"access": "public"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "adb6623c9f32490cfc73c7ac7f122578c1f10c65"
|
|
60
60
|
}
|