@wordpress/interactivity-router 2.43.1-next.v.202604091042.0 → 2.44.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/CHANGELOG.md +2 -0
- package/README.md +9 -11
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -65,26 +65,24 @@ const { state, actions } = store( 'core/router', {
|
|
|
65
65
|
|
|
66
66
|
#### `data-wp-router-region`
|
|
67
67
|
|
|
68
|
-
|
|
69
68
|
It defines a region that is updated on navigation. It requires a unique ID as the value and must be used alongside `data-wp-interactive` to receive the proper namespace. Router regions can be placed anywhere within interactive regions, including nested interactive elements.
|
|
70
69
|
|
|
71
70
|
<div class="callout callout-warning">
|
|
72
71
|
When adding <code>data-wp-router-region</code> to a child element inside a parent with <code>data-wp-interactive</code>, always include <code>data-wp-interactive</code> on the child element as well. This is required for the router region to function correctly.
|
|
73
72
|
</div>
|
|
74
73
|
|
|
75
|
-
|
|
76
74
|
The value can be a string with the region ID, or a JSON object containing the `id` and an optional `attachTo` property.
|
|
77
75
|
|
|
78
76
|
Example:
|
|
79
77
|
|
|
80
78
|
```html
|
|
81
79
|
<div data-wp-interactive="myblock" data-wp-router-region="main-list">
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
80
|
+
<ul>
|
|
81
|
+
<li><a href="/post-1">Post 1</a></li>
|
|
82
|
+
<li><a href="/post-2">Post 2</a></li>
|
|
83
|
+
<li><a href="/post-3">Post 3</a></li>
|
|
84
|
+
</ul>
|
|
85
|
+
<a data-wp-on--click="actions.navigate" href="/page/2">Page 2</a>
|
|
88
86
|
</div>
|
|
89
87
|
```
|
|
90
88
|
|
|
@@ -101,10 +99,10 @@ Example with `attachTo`:
|
|
|
101
99
|
|
|
102
100
|
```html
|
|
103
101
|
<div
|
|
104
|
-
|
|
105
|
-
|
|
102
|
+
data-wp-interactive="myblock"
|
|
103
|
+
data-wp-router-region='{ "id": "myblock/overlay", "attachTo": "body" }'
|
|
106
104
|
>
|
|
107
|
-
|
|
105
|
+
I'm in a new region!
|
|
108
106
|
</div>
|
|
109
107
|
```
|
|
110
108
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/interactivity-router",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.44.0",
|
|
4
4
|
"description": "Package that exposes state and actions from the `core/router` store, part of the Interactivity API.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -46,12 +46,12 @@
|
|
|
46
46
|
},
|
|
47
47
|
"types": "build-types",
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@wordpress/a11y": "^4.
|
|
50
|
-
"@wordpress/interactivity": "^6.
|
|
49
|
+
"@wordpress/a11y": "^4.44.0",
|
|
50
|
+
"@wordpress/interactivity": "^6.44.0",
|
|
51
51
|
"es-module-lexer": "^1.5.4"
|
|
52
52
|
},
|
|
53
53
|
"publishConfig": {
|
|
54
54
|
"access": "public"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "b862d8c84121a47bbeff882f6c87e61681ce2e0d"
|
|
57
57
|
}
|