@valu/block-components 0.4.0 → 0.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.
- package/README.md +17 -3
- package/dist/components/content-picker/index.cjs +3 -8
- package/dist/components/content-picker/index.cjs.map +1 -1
- package/dist/components/content-picker/index.js +3 -8
- package/dist/components/content-picker/index.js.map +1 -1
- package/dist/components/document-picker/index.cjs +3 -5
- package/dist/components/document-picker/index.cjs.map +1 -1
- package/dist/components/document-picker/index.js +3 -5
- package/dist/components/document-picker/index.js.map +1 -1
- package/dist/index.cjs +6 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -13
- package/dist/index.js.map +1 -1
- package/package.json +2 -14
package/README.md
CHANGED
|
@@ -16,9 +16,23 @@ accessible by default.
|
|
|
16
16
|
npm ci
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
### Requirements
|
|
20
|
+
|
|
21
|
+
- **WordPress 7.0 or newer.** The components use the `@wordpress/*` packages
|
|
22
|
+
that WordPress ships at runtime.
|
|
23
|
+
- **A build that externalizes WordPress packages**, such as `@wordpress/scripts`
|
|
24
|
+
or `@wordpress/dependency-extraction-webpack-plugin`. The `@wordpress/*`
|
|
25
|
+
imports are left bare in `dist/` and must resolve to the `wp.*` globals, so
|
|
26
|
+
every plugin on the page shares the editor's copy.
|
|
27
|
+
- **Peer dependencies:** `react ^18.3` and `react-dom ^18.3`.
|
|
28
|
+
|
|
29
|
+
The `@wordpress/*` packages are intentionally not declared as peer
|
|
30
|
+
dependencies: npm would check them against your `node_modules`, while the
|
|
31
|
+
version that actually runs is the one WordPress provides. `@wordpress/icons`
|
|
32
|
+
is a regular dependency because WordPress doesn't provide it at runtime.
|
|
33
|
+
|
|
34
|
+
If you use TypeScript or run unit tests that import this package, install the
|
|
35
|
+
`@wordpress/*` packages you use as your own `devDependencies`.
|
|
22
36
|
|
|
23
37
|
## Quickstart
|
|
24
38
|
|
|
@@ -1760,10 +1760,7 @@ var useResolvedItems = (value) => {
|
|
|
1760
1760
|
nameKey,
|
|
1761
1761
|
item.id
|
|
1762
1762
|
]);
|
|
1763
|
-
out[`${item.kind}:${item.type}:${item.id}`] =
|
|
1764
|
-
record: record ?? null,
|
|
1765
|
-
resolved
|
|
1766
|
-
};
|
|
1763
|
+
out[`${item.kind}:${item.type}:${item.id}`] = resolved ? record ?? null : void 0;
|
|
1767
1764
|
}
|
|
1768
1765
|
return out;
|
|
1769
1766
|
},
|
|
@@ -1771,10 +1768,8 @@ var useResolvedItems = (value) => {
|
|
|
1771
1768
|
);
|
|
1772
1769
|
return react$1.useMemo(
|
|
1773
1770
|
() => value.map((item) => {
|
|
1774
|
-
const
|
|
1775
|
-
if (
|
|
1776
|
-
const { record, resolved } = resolvedEntry;
|
|
1777
|
-
if (!resolved) {
|
|
1771
|
+
const record = records[`${item.kind}:${item.type}:${item.id}`];
|
|
1772
|
+
if (record === void 0) {
|
|
1778
1773
|
return item;
|
|
1779
1774
|
}
|
|
1780
1775
|
if (!record) {
|