@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 CHANGED
@@ -16,9 +16,23 @@ accessible by default.
16
16
  npm ci
17
17
  ```
18
18
 
19
- Peer dependencies: `react ^18.3`, `react-dom ^18.3`, and the
20
- `@wordpress/*` packages listed in `package.json` (available in any
21
- modern Gutenberg/WP 6.4+ environment).
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 resolvedEntry = records[`${item.kind}:${item.type}:${item.id}`];
1775
- if (!resolvedEntry) return item;
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) {