@wordpress/edit-site 6.8.4 → 6.8.5
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/components/editor/index.js +1 -1
- package/build/components/editor/index.js.map +1 -1
- package/build/components/global-styles/font-families.js +2 -16
- package/build/components/global-styles/font-families.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +5 -3
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/ui.js +0 -4
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/sidebar-dataviews/dataview-item.js +1 -3
- package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build/components/sidebar-dataviews/default-views.js +0 -42
- package/build/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build/components/sidebar-dataviews/index.js +1 -4
- package/build/components/sidebar-dataviews/index.js.map +1 -1
- package/build-module/components/editor/index.js +2 -2
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/global-styles/font-families.js +4 -18
- package/build-module/components/global-styles/font-families.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +5 -3
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/ui.js +0 -4
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/sidebar-dataviews/dataview-item.js +1 -3
- package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build-module/components/sidebar-dataviews/default-views.js +1 -42
- package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build-module/components/sidebar-dataviews/index.js +2 -5
- package/build-module/components/sidebar-dataviews/index.js.map +1 -1
- package/build-style/style-rtl.css +7 -7
- package/build-style/style.css +7 -7
- package/package.json +30 -30
- package/src/components/editor/index.js +2 -2
- package/src/components/editor/style.scss +4 -0
- package/src/components/global-styles/font-families.js +5 -28
- package/src/components/global-styles/screen-typography.js +3 -3
- package/src/components/global-styles/ui.js +0 -5
- package/src/components/sidebar-dataviews/dataview-item.js +0 -2
- package/src/components/sidebar-dataviews/default-views.js +1 -45
- package/src/components/sidebar-dataviews/index.js +2 -7
- package/src/components/sidebar-dataviews/style.scss +0 -4
- package/build/components/global-styles/screen-typeset.js +0 -40
- package/build/components/global-styles/screen-typeset.js.map +0 -1
- package/build/components/global-styles/typeset-button.js +0 -98
- package/build/components/global-styles/typeset-button.js.map +0 -1
- package/build-module/components/global-styles/screen-typeset.js +0 -34
- package/build-module/components/global-styles/screen-typeset.js.map +0 -1
- package/build-module/components/global-styles/typeset-button.js +0 -90
- package/build-module/components/global-styles/typeset-button.js.map +0 -1
- package/src/components/global-styles/screen-typeset.js +0 -42
- package/src/components/global-styles/typeset-button.js +0 -100
|
@@ -7,7 +7,7 @@ import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
|
7
7
|
/**
|
|
8
8
|
* Internal dependencies
|
|
9
9
|
*/
|
|
10
|
-
import {
|
|
10
|
+
import { useDefaultViews } from './default-views';
|
|
11
11
|
import { unlock } from '../../lock-unlock';
|
|
12
12
|
import DataViewItem from './dataview-item';
|
|
13
13
|
import CustomDataViewsList from './custom-dataviews-list';
|
|
@@ -25,7 +25,7 @@ export default function DataViewsSidebarContent() {
|
|
|
25
25
|
isCustom = 'false'
|
|
26
26
|
}
|
|
27
27
|
} = useLocation();
|
|
28
|
-
const defaultViews =
|
|
28
|
+
const defaultViews = useDefaultViews({
|
|
29
29
|
postType
|
|
30
30
|
});
|
|
31
31
|
if (!postType) {
|
|
@@ -39,9 +39,6 @@ export default function DataViewsSidebarContent() {
|
|
|
39
39
|
slug: dataview.slug,
|
|
40
40
|
title: dataview.title,
|
|
41
41
|
icon: dataview.icon,
|
|
42
|
-
navigationItemSuffix: /*#__PURE__*/_jsx("span", {
|
|
43
|
-
children: dataview.count
|
|
44
|
-
}),
|
|
45
42
|
type: dataview.view.type,
|
|
46
43
|
isActive: !isCustomBoolean && dataview.slug === activeView,
|
|
47
44
|
isCustom: false
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__experimentalItemGroup","ItemGroup","privateApis","routerPrivateApis","
|
|
1
|
+
{"version":3,"names":["__experimentalItemGroup","ItemGroup","privateApis","routerPrivateApis","useDefaultViews","unlock","DataViewItem","CustomDataViewsList","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","useLocation","DataViewsSidebarContent","params","postType","activeView","isCustom","defaultViews","isCustomBoolean","children","map","dataview","slug","title","icon","type","view","isActive","window","__experimentalCustomViews"],"sources":["@wordpress/edit-site/src/components/sidebar-dataviews/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { useDefaultViews } from './default-views';\nimport { unlock } from '../../lock-unlock';\nimport DataViewItem from './dataview-item';\nimport CustomDataViewsList from './custom-dataviews-list';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function DataViewsSidebarContent() {\n\tconst {\n\t\tparams: { postType, activeView = 'all', isCustom = 'false' },\n\t} = useLocation();\n\tconst defaultViews = useDefaultViews( { postType } );\n\tif ( ! postType ) {\n\t\treturn null;\n\t}\n\tconst isCustomBoolean = isCustom === 'true';\n\n\treturn (\n\t\t<>\n\t\t\t<ItemGroup>\n\t\t\t\t{ defaultViews.map( ( dataview ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<DataViewItem\n\t\t\t\t\t\t\tkey={ dataview.slug }\n\t\t\t\t\t\t\tslug={ dataview.slug }\n\t\t\t\t\t\t\ttitle={ dataview.title }\n\t\t\t\t\t\t\ticon={ dataview.icon }\n\t\t\t\t\t\t\ttype={ dataview.view.type }\n\t\t\t\t\t\t\tisActive={\n\t\t\t\t\t\t\t\t! isCustomBoolean &&\n\t\t\t\t\t\t\t\tdataview.slug === activeView\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisCustom={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\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xBC,IAAI,EAAGH,QAAQ,CAACG,IAAM;UACtBC,IAAI,EAAGJ,QAAQ,CAACK,IAAI,CAACD,IAAM;UAC3BE,QAAQ,EACP,CAAET,eAAe,IACjBG,QAAQ,CAACC,IAAI,KAAKP,UAClB;UACDC,QAAQ,EAAG;QAAO,GATZK,QAAQ,CAACC,IAUf,CAAC;MAEJ,CAAE;IAAC,CACO,CAAC,EACVM,MAAM,EAAEC,yBAAyB,iBAClCvB,IAAA,CAACF,mBAAmB;MACnBW,UAAU,EAAGA,UAAY;MACzBU,IAAI,EAAGX,QAAU;MACjBE,QAAQ;IAAA,CACR,CACD;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
|
|
@@ -2212,6 +2212,9 @@ ul.dataviews-view-list {
|
|
|
2212
2212
|
background-color: #cccccc;
|
|
2213
2213
|
pointer-events: none;
|
|
2214
2214
|
}
|
|
2215
|
+
.edit-site-editor__back-icon svg {
|
|
2216
|
+
fill: currentColor;
|
|
2217
|
+
}
|
|
2215
2218
|
.edit-site-editor__back-icon.has-site-icon {
|
|
2216
2219
|
background-color: rgba(255, 255, 255, 0.6);
|
|
2217
2220
|
-webkit-backdrop-filter: saturate(180%) blur(15px);
|
|
@@ -2538,7 +2541,7 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
|
|
|
2538
2541
|
contain: content;
|
|
2539
2542
|
}
|
|
2540
2543
|
|
|
2541
|
-
@keyframes
|
|
2544
|
+
@keyframes _anvff_slide-from-right {
|
|
2542
2545
|
from {
|
|
2543
2546
|
transform: translateX(-50px);
|
|
2544
2547
|
opacity: 0;
|
|
@@ -2548,7 +2551,7 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
|
|
|
2548
2551
|
opacity: 1;
|
|
2549
2552
|
}
|
|
2550
2553
|
}
|
|
2551
|
-
@keyframes
|
|
2554
|
+
@keyframes _anvff_slide-from-left {
|
|
2552
2555
|
from {
|
|
2553
2556
|
transform: translateX(50px);
|
|
2554
2557
|
opacity: 0;
|
|
@@ -2604,10 +2607,10 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
|
|
|
2604
2607
|
}
|
|
2605
2608
|
}
|
|
2606
2609
|
.edit-site-sidebar__screen-wrapper.slide-from-left {
|
|
2607
|
-
animation-name:
|
|
2610
|
+
animation-name: _anvff_slide-from-left;
|
|
2608
2611
|
}
|
|
2609
2612
|
.edit-site-sidebar__screen-wrapper.slide-from-right {
|
|
2610
|
-
animation-name:
|
|
2613
|
+
animation-name: _anvff_slide-from-right;
|
|
2611
2614
|
}
|
|
2612
2615
|
|
|
2613
2616
|
.edit-site-sidebar-button {
|
|
@@ -2871,9 +2874,6 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
|
|
|
2871
2874
|
.edit-site-sidebar-dataviews-dataview-item .edit-site-sidebar-dataviews-dataview-item__dropdown-menu {
|
|
2872
2875
|
min-width: initial;
|
|
2873
2876
|
}
|
|
2874
|
-
.edit-site-sidebar-dataviews-dataview-item .edit-site-sidebar-navigation-item.with-suffix {
|
|
2875
|
-
padding-left: 8px;
|
|
2876
|
-
}
|
|
2877
2877
|
.edit-site-sidebar-dataviews-dataview-item:hover, .edit-site-sidebar-dataviews-dataview-item:focus, .edit-site-sidebar-dataviews-dataview-item[aria-current] {
|
|
2878
2878
|
color: #e0e0e0;
|
|
2879
2879
|
background: #2f2f2f;
|
package/build-style/style.css
CHANGED
|
@@ -2213,6 +2213,9 @@ ul.dataviews-view-list {
|
|
|
2213
2213
|
background-color: #cccccc;
|
|
2214
2214
|
pointer-events: none;
|
|
2215
2215
|
}
|
|
2216
|
+
.edit-site-editor__back-icon svg {
|
|
2217
|
+
fill: currentColor;
|
|
2218
|
+
}
|
|
2216
2219
|
.edit-site-editor__back-icon.has-site-icon {
|
|
2217
2220
|
background-color: rgba(255, 255, 255, 0.6);
|
|
2218
2221
|
-webkit-backdrop-filter: saturate(180%) blur(15px);
|
|
@@ -2539,7 +2542,7 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
|
|
|
2539
2542
|
contain: content;
|
|
2540
2543
|
}
|
|
2541
2544
|
|
|
2542
|
-
@keyframes
|
|
2545
|
+
@keyframes _anvff_slide-from-right {
|
|
2543
2546
|
from {
|
|
2544
2547
|
transform: translateX(50px);
|
|
2545
2548
|
opacity: 0;
|
|
@@ -2549,7 +2552,7 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
|
|
|
2549
2552
|
opacity: 1;
|
|
2550
2553
|
}
|
|
2551
2554
|
}
|
|
2552
|
-
@keyframes
|
|
2555
|
+
@keyframes _anvff_slide-from-left {
|
|
2553
2556
|
from {
|
|
2554
2557
|
transform: translateX(-50px);
|
|
2555
2558
|
opacity: 0;
|
|
@@ -2605,10 +2608,10 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
|
|
|
2605
2608
|
}
|
|
2606
2609
|
}
|
|
2607
2610
|
.edit-site-sidebar__screen-wrapper.slide-from-left {
|
|
2608
|
-
animation-name:
|
|
2611
|
+
animation-name: _anvff_slide-from-left;
|
|
2609
2612
|
}
|
|
2610
2613
|
.edit-site-sidebar__screen-wrapper.slide-from-right {
|
|
2611
|
-
animation-name:
|
|
2614
|
+
animation-name: _anvff_slide-from-right;
|
|
2612
2615
|
}
|
|
2613
2616
|
|
|
2614
2617
|
.edit-site-sidebar-button {
|
|
@@ -2872,9 +2875,6 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
|
|
|
2872
2875
|
.edit-site-sidebar-dataviews-dataview-item .edit-site-sidebar-dataviews-dataview-item__dropdown-menu {
|
|
2873
2876
|
min-width: initial;
|
|
2874
2877
|
}
|
|
2875
|
-
.edit-site-sidebar-dataviews-dataview-item .edit-site-sidebar-navigation-item.with-suffix {
|
|
2876
|
-
padding-right: 8px;
|
|
2877
|
-
}
|
|
2878
2878
|
.edit-site-sidebar-dataviews-dataview-item:hover, .edit-site-sidebar-dataviews-dataview-item:focus, .edit-site-sidebar-dataviews-dataview-item[aria-current] {
|
|
2879
2879
|
color: #e0e0e0;
|
|
2880
2880
|
background: #2f2f2f;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/edit-site",
|
|
3
|
-
"version": "6.8.
|
|
3
|
+
"version": "6.8.5",
|
|
4
4
|
"description": "Edit Site Page module for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -29,44 +29,44 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@babel/runtime": "^7.16.0",
|
|
31
31
|
"@react-spring/web": "^9.4.5",
|
|
32
|
-
"@wordpress/a11y": "^4.8.
|
|
33
|
-
"@wordpress/api-fetch": "^7.8.
|
|
32
|
+
"@wordpress/a11y": "^4.8.2",
|
|
33
|
+
"@wordpress/api-fetch": "^7.8.2",
|
|
34
34
|
"@wordpress/blob": "^4.8.1",
|
|
35
|
-
"@wordpress/block-editor": "^14.3.
|
|
36
|
-
"@wordpress/block-library": "^9.8.
|
|
37
|
-
"@wordpress/blocks": "^13.8.
|
|
38
|
-
"@wordpress/commands": "^1.8.
|
|
39
|
-
"@wordpress/components": "^28.8.
|
|
40
|
-
"@wordpress/compose": "^7.8.
|
|
41
|
-
"@wordpress/core-commands": "^1.8.
|
|
42
|
-
"@wordpress/core-data": "^7.8.
|
|
43
|
-
"@wordpress/data": "^10.8.
|
|
44
|
-
"@wordpress/dataviews": "^4.4.
|
|
45
|
-
"@wordpress/date": "^5.8.
|
|
46
|
-
"@wordpress/deprecated": "^4.8.
|
|
47
|
-
"@wordpress/dom": "^4.8.
|
|
48
|
-
"@wordpress/editor": "^14.8.
|
|
35
|
+
"@wordpress/block-editor": "^14.3.3",
|
|
36
|
+
"@wordpress/block-library": "^9.8.4",
|
|
37
|
+
"@wordpress/blocks": "^13.8.3",
|
|
38
|
+
"@wordpress/commands": "^1.8.3",
|
|
39
|
+
"@wordpress/components": "^28.8.3",
|
|
40
|
+
"@wordpress/compose": "^7.8.3",
|
|
41
|
+
"@wordpress/core-commands": "^1.8.3",
|
|
42
|
+
"@wordpress/core-data": "^7.8.3",
|
|
43
|
+
"@wordpress/data": "^10.8.3",
|
|
44
|
+
"@wordpress/dataviews": "^4.4.3",
|
|
45
|
+
"@wordpress/date": "^5.8.2",
|
|
46
|
+
"@wordpress/deprecated": "^4.8.2",
|
|
47
|
+
"@wordpress/dom": "^4.8.2",
|
|
48
|
+
"@wordpress/editor": "^14.8.5",
|
|
49
49
|
"@wordpress/element": "^6.8.1",
|
|
50
50
|
"@wordpress/escape-html": "^3.8.1",
|
|
51
|
-
"@wordpress/hooks": "^4.8.
|
|
51
|
+
"@wordpress/hooks": "^4.8.2",
|
|
52
52
|
"@wordpress/html-entities": "^4.8.1",
|
|
53
|
-
"@wordpress/i18n": "^5.8.
|
|
54
|
-
"@wordpress/icons": "^10.8.
|
|
55
|
-
"@wordpress/keyboard-shortcuts": "^5.8.
|
|
56
|
-
"@wordpress/keycodes": "^4.8.
|
|
57
|
-
"@wordpress/notices": "^5.8.
|
|
58
|
-
"@wordpress/patterns": "^2.8.
|
|
59
|
-
"@wordpress/plugins": "^7.8.
|
|
60
|
-
"@wordpress/preferences": "^4.8.
|
|
53
|
+
"@wordpress/i18n": "^5.8.2",
|
|
54
|
+
"@wordpress/icons": "^10.8.2",
|
|
55
|
+
"@wordpress/keyboard-shortcuts": "^5.8.3",
|
|
56
|
+
"@wordpress/keycodes": "^4.8.2",
|
|
57
|
+
"@wordpress/notices": "^5.8.3",
|
|
58
|
+
"@wordpress/patterns": "^2.8.3",
|
|
59
|
+
"@wordpress/plugins": "^7.8.3",
|
|
60
|
+
"@wordpress/preferences": "^4.8.3",
|
|
61
61
|
"@wordpress/primitives": "^4.8.1",
|
|
62
62
|
"@wordpress/priority-queue": "^3.8.1",
|
|
63
63
|
"@wordpress/private-apis": "^1.8.1",
|
|
64
|
-
"@wordpress/reusable-blocks": "^5.8.
|
|
64
|
+
"@wordpress/reusable-blocks": "^5.8.3",
|
|
65
65
|
"@wordpress/router": "^1.8.1",
|
|
66
66
|
"@wordpress/style-engine": "^2.8.1",
|
|
67
67
|
"@wordpress/url": "^4.8.1",
|
|
68
|
-
"@wordpress/viewport": "^6.8.
|
|
69
|
-
"@wordpress/widgets": "^4.8.
|
|
68
|
+
"@wordpress/viewport": "^6.8.3",
|
|
69
|
+
"@wordpress/widgets": "^4.8.3",
|
|
70
70
|
"@wordpress/wordcount": "^4.8.1",
|
|
71
71
|
"change-case": "^4.1.2",
|
|
72
72
|
"clsx": "^2.1.1",
|
|
@@ -82,5 +82,5 @@
|
|
|
82
82
|
"publishConfig": {
|
|
83
83
|
"access": "public"
|
|
84
84
|
},
|
|
85
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "6187079697e13c3292eb098d6338523a6676c6e8"
|
|
86
86
|
}
|
|
@@ -22,7 +22,7 @@ import { store as noticesStore } from '@wordpress/notices';
|
|
|
22
22
|
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
23
23
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
24
24
|
import { decodeEntities } from '@wordpress/html-entities';
|
|
25
|
-
import { Icon,
|
|
25
|
+
import { Icon, arrowUpLeft } from '@wordpress/icons';
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* Internal dependencies
|
|
@@ -291,7 +291,7 @@ export default function EditSiteEditor( { isPostsList = false } ) {
|
|
|
291
291
|
) }
|
|
292
292
|
variants={ toggleHomeIconVariants }
|
|
293
293
|
>
|
|
294
|
-
<Icon icon={
|
|
294
|
+
<Icon icon={ arrowUpLeft } />
|
|
295
295
|
</motion.div>
|
|
296
296
|
</motion.div>
|
|
297
297
|
)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { __
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
5
5
|
import {
|
|
6
6
|
__experimentalText as Text,
|
|
7
7
|
__experimentalItemGroup as ItemGroup,
|
|
@@ -61,14 +61,9 @@ function FontFamilies() {
|
|
|
61
61
|
) }
|
|
62
62
|
|
|
63
63
|
<VStack spacing={ 4 }>
|
|
64
|
-
{ themeFonts.length > 0 && (
|
|
65
|
-
|
|
66
|
-
<Subtitle level={ 3 }>
|
|
67
|
-
{
|
|
68
|
-
/* translators: Heading for a list of fonts provided by the theme. */
|
|
69
|
-
_x( 'Theme', 'font source' )
|
|
70
|
-
}
|
|
71
|
-
</Subtitle>
|
|
64
|
+
{ [ ...themeFonts, ...customFonts ].length > 0 && (
|
|
65
|
+
<>
|
|
66
|
+
<Subtitle level={ 3 }>{ __( 'Fonts' ) }</Subtitle>
|
|
72
67
|
<ItemGroup size="large" isBordered isSeparated>
|
|
73
68
|
{ themeFonts.map( ( font ) => (
|
|
74
69
|
<FontFamilyItem
|
|
@@ -77,25 +72,7 @@ function FontFamilies() {
|
|
|
77
72
|
/>
|
|
78
73
|
) ) }
|
|
79
74
|
</ItemGroup>
|
|
80
|
-
|
|
81
|
-
) }
|
|
82
|
-
{ customFonts.length > 0 && (
|
|
83
|
-
<VStack>
|
|
84
|
-
<Subtitle level={ 3 }>
|
|
85
|
-
{
|
|
86
|
-
/* translators: Heading for a list of fonts installed by the user. */
|
|
87
|
-
_x( 'Custom', 'font source' )
|
|
88
|
-
}
|
|
89
|
-
</Subtitle>
|
|
90
|
-
<ItemGroup size="large" isBordered isSeparated>
|
|
91
|
-
{ customFonts.map( ( font ) => (
|
|
92
|
-
<FontFamilyItem
|
|
93
|
-
key={ font.slug }
|
|
94
|
-
font={ font }
|
|
95
|
-
/>
|
|
96
|
-
) ) }
|
|
97
|
-
</ItemGroup>
|
|
98
|
-
</VStack>
|
|
75
|
+
</>
|
|
99
76
|
) }
|
|
100
77
|
{ ! hasFonts && (
|
|
101
78
|
<VStack>
|
|
@@ -11,8 +11,8 @@ import { store as editorStore } from '@wordpress/editor';
|
|
|
11
11
|
*/
|
|
12
12
|
import TypographyElements from './typography-elements';
|
|
13
13
|
import ScreenHeader from './header';
|
|
14
|
+
import TypographyVariations from './variations/variations-typography';
|
|
14
15
|
import FontSizesCount from './font-sizes/font-sizes-count';
|
|
15
|
-
import TypesetButton from './typeset-button';
|
|
16
16
|
import FontFamilies from './font-families';
|
|
17
17
|
|
|
18
18
|
function ScreenTypography() {
|
|
@@ -27,12 +27,12 @@ function ScreenTypography() {
|
|
|
27
27
|
<ScreenHeader
|
|
28
28
|
title={ __( 'Typography' ) }
|
|
29
29
|
description={ __(
|
|
30
|
-
'
|
|
30
|
+
'Available fonts, typographic styles, and the application of those styles.'
|
|
31
31
|
) }
|
|
32
32
|
/>
|
|
33
33
|
<div className="edit-site-global-styles-screen">
|
|
34
34
|
<VStack spacing={ 7 }>
|
|
35
|
-
<
|
|
35
|
+
<TypographyVariations title={ __( 'Typesets' ) } />
|
|
36
36
|
{ fontLibraryEnabled && <FontFamilies /> }
|
|
37
37
|
<TypographyElements />
|
|
38
38
|
<FontSizesCount />
|
|
@@ -32,7 +32,6 @@ import {
|
|
|
32
32
|
} from './screen-block-list';
|
|
33
33
|
import ScreenBlock from './screen-block';
|
|
34
34
|
import ScreenTypography from './screen-typography';
|
|
35
|
-
import ScreenTypeset from './screen-typeset';
|
|
36
35
|
import ScreenTypographyElement from './screen-typography-element';
|
|
37
36
|
import FontSize from './font-sizes/font-size';
|
|
38
37
|
import FontSizes from './font-sizes/font-sizes';
|
|
@@ -325,10 +324,6 @@ function GlobalStylesUI() {
|
|
|
325
324
|
<FontSize />
|
|
326
325
|
</GlobalStylesNavigationScreen>
|
|
327
326
|
|
|
328
|
-
<GlobalStylesNavigationScreen path="/typography/typeset">
|
|
329
|
-
<ScreenTypeset />
|
|
330
|
-
</GlobalStylesNavigationScreen>
|
|
331
|
-
|
|
332
327
|
<GlobalStylesNavigationScreen path="/typography/text">
|
|
333
328
|
<ScreenTypographyElement element="text" />
|
|
334
329
|
</GlobalStylesNavigationScreen>
|
|
@@ -27,7 +27,6 @@ export default function DataViewItem( {
|
|
|
27
27
|
isActive,
|
|
28
28
|
isCustom,
|
|
29
29
|
suffix,
|
|
30
|
-
navigationItemSuffix,
|
|
31
30
|
} ) {
|
|
32
31
|
const {
|
|
33
32
|
params: { postType },
|
|
@@ -56,7 +55,6 @@ export default function DataViewItem( {
|
|
|
56
55
|
<SidebarNavigationItem
|
|
57
56
|
icon={ iconToUse }
|
|
58
57
|
{ ...linkInfo }
|
|
59
|
-
suffix={ navigationItemSuffix }
|
|
60
58
|
aria-current={ isActive ? 'true' : undefined }
|
|
61
59
|
>
|
|
62
60
|
{ title }
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
notAllowed,
|
|
14
14
|
} from '@wordpress/icons';
|
|
15
15
|
import { useSelect } from '@wordpress/data';
|
|
16
|
-
import { store as coreStore
|
|
16
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
17
17
|
import { useMemo } from '@wordpress/element';
|
|
18
18
|
|
|
19
19
|
/**
|
|
@@ -68,50 +68,6 @@ const DEFAULT_POST_BASE = {
|
|
|
68
68
|
layout: defaultLayouts[ LAYOUT_LIST ].layout,
|
|
69
69
|
};
|
|
70
70
|
|
|
71
|
-
export function useDefaultViewsWithItemCounts( { postType } ) {
|
|
72
|
-
const defaultViews = useDefaultViews( { postType } );
|
|
73
|
-
const { records, totalItems } = useEntityRecords( 'postType', postType, {
|
|
74
|
-
per_page: -1,
|
|
75
|
-
status: [ 'any', 'trash' ],
|
|
76
|
-
} );
|
|
77
|
-
|
|
78
|
-
return useMemo( () => {
|
|
79
|
-
if ( ! defaultViews ) {
|
|
80
|
-
return [];
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
// If there are no records, return the default views with no counts.
|
|
84
|
-
if ( ! records ) {
|
|
85
|
-
return defaultViews;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
const counts = {
|
|
89
|
-
drafts: records.filter( ( record ) => record.status === 'draft' )
|
|
90
|
-
.length,
|
|
91
|
-
future: records.filter( ( record ) => record.status === 'future' )
|
|
92
|
-
.length,
|
|
93
|
-
pending: records.filter( ( record ) => record.status === 'pending' )
|
|
94
|
-
.length,
|
|
95
|
-
private: records.filter( ( record ) => record.status === 'private' )
|
|
96
|
-
.length,
|
|
97
|
-
published: records.filter(
|
|
98
|
-
( record ) => record.status === 'publish'
|
|
99
|
-
).length,
|
|
100
|
-
trash: records.filter( ( record ) => record.status === 'trash' )
|
|
101
|
-
.length,
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
// All items excluding trashed items as per the default "all" status query.
|
|
105
|
-
counts.all = totalItems ? totalItems - counts.trash : 0;
|
|
106
|
-
|
|
107
|
-
// Filter out views with > 0 item counts.
|
|
108
|
-
return defaultViews.map( ( _view ) => {
|
|
109
|
-
_view.count = counts[ _view.slug ];
|
|
110
|
-
return _view;
|
|
111
|
-
} );
|
|
112
|
-
}, [ defaultViews, records, totalItems ] );
|
|
113
|
-
}
|
|
114
|
-
|
|
115
71
|
export function useDefaultViews( { postType } ) {
|
|
116
72
|
const labels = useSelect(
|
|
117
73
|
( select ) => {
|
|
@@ -7,7 +7,7 @@ import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
|
7
7
|
/**
|
|
8
8
|
* Internal dependencies
|
|
9
9
|
*/
|
|
10
|
-
import {
|
|
10
|
+
import { useDefaultViews } from './default-views';
|
|
11
11
|
import { unlock } from '../../lock-unlock';
|
|
12
12
|
import DataViewItem from './dataview-item';
|
|
13
13
|
import CustomDataViewsList from './custom-dataviews-list';
|
|
@@ -18,9 +18,7 @@ export default function DataViewsSidebarContent() {
|
|
|
18
18
|
const {
|
|
19
19
|
params: { postType, activeView = 'all', isCustom = 'false' },
|
|
20
20
|
} = useLocation();
|
|
21
|
-
|
|
22
|
-
const defaultViews = useDefaultViewsWithItemCounts( { postType } );
|
|
23
|
-
|
|
21
|
+
const defaultViews = useDefaultViews( { postType } );
|
|
24
22
|
if ( ! postType ) {
|
|
25
23
|
return null;
|
|
26
24
|
}
|
|
@@ -36,9 +34,6 @@ export default function DataViewsSidebarContent() {
|
|
|
36
34
|
slug={ dataview.slug }
|
|
37
35
|
title={ dataview.title }
|
|
38
36
|
icon={ dataview.icon }
|
|
39
|
-
navigationItemSuffix={
|
|
40
|
-
<span>{ dataview.count }</span>
|
|
41
|
-
}
|
|
42
37
|
type={ dataview.view.type }
|
|
43
38
|
isActive={
|
|
44
39
|
! isCustomBoolean &&
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _i18n = require("@wordpress/i18n");
|
|
9
|
-
var _data = require("@wordpress/data");
|
|
10
|
-
var _editor = require("@wordpress/editor");
|
|
11
|
-
var _components = require("@wordpress/components");
|
|
12
|
-
var _variationsTypography = _interopRequireDefault(require("./variations/variations-typography"));
|
|
13
|
-
var _header = _interopRequireDefault(require("./header"));
|
|
14
|
-
var _fontFamilies = _interopRequireDefault(require("./font-families"));
|
|
15
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
-
/**
|
|
17
|
-
* WordPress dependencies
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Internal dependencies
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
function ScreenTypeset() {
|
|
25
|
-
const fontLibraryEnabled = (0, _data.useSelect)(select => select(_editor.store).getEditorSettings().fontLibraryEnabled, []);
|
|
26
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
27
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_header.default, {
|
|
28
|
-
title: (0, _i18n.__)('Typesets'),
|
|
29
|
-
description: (0, _i18n.__)('Fonts and typographic styling applied across the site.')
|
|
30
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
31
|
-
className: "edit-site-global-styles-screen",
|
|
32
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalVStack, {
|
|
33
|
-
spacing: 7,
|
|
34
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_variationsTypography.default, {}), fontLibraryEnabled && /*#__PURE__*/(0, _jsxRuntime.jsx)(_fontFamilies.default, {})]
|
|
35
|
-
})
|
|
36
|
-
})]
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
var _default = exports.default = ScreenTypeset;
|
|
40
|
-
//# sourceMappingURL=screen-typeset.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_data","_editor","_components","_variationsTypography","_interopRequireDefault","_header","_fontFamilies","_jsxRuntime","ScreenTypeset","fontLibraryEnabled","useSelect","select","editorStore","getEditorSettings","jsxs","Fragment","children","jsx","default","title","__","description","className","__experimentalVStack","spacing","_default","exports"],"sources":["@wordpress/edit-site/src/components/global-styles/screen-typeset.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { __experimentalVStack as VStack } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport TypographyVariations from './variations/variations-typography';\nimport ScreenHeader from './header';\nimport FontFamilies from './font-families';\n\nfunction ScreenTypeset() {\n\tconst fontLibraryEnabled = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getEditorSettings().fontLibraryEnabled,\n\t\t[]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ __( 'Typesets' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Fonts and typographic styling applied across the site.'\n\t\t\t\t) }\n\t\t\t/>\n\t\t\t<div className=\"edit-site-global-styles-screen\">\n\t\t\t\t<VStack spacing={ 7 }>\n\t\t\t\t\t<Typograph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;MAAA,CACjC;IAAC,CACL,CAAC;EAAA,CACL,CAAC;AAEL;AAAC,IAAAO,QAAA,GAAAC,OAAA,CAAAR,OAAA,GAEcV,aAAa","ignoreList":[]}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _i18n = require("@wordpress/i18n");
|
|
9
|
-
var _components = require("@wordpress/components");
|
|
10
|
-
var _coreData = require("@wordpress/core-data");
|
|
11
|
-
var _data = require("@wordpress/data");
|
|
12
|
-
var _blockEditor = require("@wordpress/block-editor");
|
|
13
|
-
var _editor = require("@wordpress/editor");
|
|
14
|
-
var _element = require("@wordpress/element");
|
|
15
|
-
var _icons = require("@wordpress/icons");
|
|
16
|
-
var _context = _interopRequireDefault(require("./font-library-modal/context"));
|
|
17
|
-
var _utils = require("./utils");
|
|
18
|
-
var _navigationButton = require("./navigation-button");
|
|
19
|
-
var _subtitle = _interopRequireDefault(require("./subtitle"));
|
|
20
|
-
var _lockUnlock = require("../../lock-unlock");
|
|
21
|
-
var _useThemeStyleVariationsByProperty = require("../../hooks/use-theme-style-variations/use-theme-style-variations-by-property");
|
|
22
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
|
-
/**
|
|
24
|
-
* WordPress dependencies
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Internal dependencies
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
const {
|
|
32
|
-
GlobalStylesContext
|
|
33
|
-
} = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
|
|
34
|
-
const {
|
|
35
|
-
mergeBaseAndUserConfigs
|
|
36
|
-
} = (0, _lockUnlock.unlock)(_editor.privateApis);
|
|
37
|
-
function TypesetButton() {
|
|
38
|
-
const propertiesToFilter = ['typography'];
|
|
39
|
-
const typographyVariations = (0, _useThemeStyleVariationsByProperty.useCurrentMergeThemeStyleVariationsWithUserConfig)(propertiesToFilter);
|
|
40
|
-
const hasTypographyVariations = typographyVariations?.length > 1;
|
|
41
|
-
const {
|
|
42
|
-
base,
|
|
43
|
-
user: userConfig
|
|
44
|
-
} = (0, _element.useContext)(GlobalStylesContext);
|
|
45
|
-
const config = mergeBaseAndUserConfigs(base, userConfig);
|
|
46
|
-
const allFontFamilies = (0, _utils.getFontFamilies)(config);
|
|
47
|
-
const hasFonts = allFontFamilies.filter(font => font !== null).length > 0;
|
|
48
|
-
const variations = (0, _data.useSelect)(select => {
|
|
49
|
-
return select(_coreData.store).__experimentalGetCurrentThemeGlobalStylesVariations();
|
|
50
|
-
}, []);
|
|
51
|
-
const userTypographyConfig = (0, _useThemeStyleVariationsByProperty.filterObjectByProperties)(userConfig, 'typography');
|
|
52
|
-
const title = (0, _element.useMemo)(() => {
|
|
53
|
-
if (Object.keys(userTypographyConfig).length === 0) {
|
|
54
|
-
return (0, _i18n.__)('Default');
|
|
55
|
-
}
|
|
56
|
-
const activeVariation = variations?.find(variation => {
|
|
57
|
-
return JSON.stringify((0, _useThemeStyleVariationsByProperty.filterObjectByProperties)(variation, 'typography')) === JSON.stringify(userTypographyConfig);
|
|
58
|
-
});
|
|
59
|
-
if (activeVariation) {
|
|
60
|
-
return activeVariation.title;
|
|
61
|
-
}
|
|
62
|
-
return allFontFamilies.map(font => font?.name).join(', ');
|
|
63
|
-
}, [allFontFamilies, userTypographyConfig, variations]);
|
|
64
|
-
return hasTypographyVariations && hasFonts && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalVStack, {
|
|
65
|
-
spacing: 2,
|
|
66
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalHStack, {
|
|
67
|
-
justify: "space-between",
|
|
68
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_subtitle.default, {
|
|
69
|
-
level: 3,
|
|
70
|
-
children: (0, _i18n.__)('Typeset')
|
|
71
|
-
})
|
|
72
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalItemGroup, {
|
|
73
|
-
isBordered: true,
|
|
74
|
-
isSeparated: true,
|
|
75
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_navigationButton.NavigationButtonAsItem, {
|
|
76
|
-
path: "/typography/typeset",
|
|
77
|
-
"aria-label": (0, _i18n.__)('Typeset'),
|
|
78
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalHStack, {
|
|
79
|
-
direction: "row",
|
|
80
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.FlexItem, {
|
|
81
|
-
children: title
|
|
82
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.Icon, {
|
|
83
|
-
icon: (0, _i18n.isRTL)() ? _icons.chevronLeft : _icons.chevronRight
|
|
84
|
-
})]
|
|
85
|
-
})
|
|
86
|
-
})
|
|
87
|
-
})]
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
var _default = ({
|
|
91
|
-
...props
|
|
92
|
-
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_context.default, {
|
|
93
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(TypesetButton, {
|
|
94
|
-
...props
|
|
95
|
-
})
|
|
96
|
-
});
|
|
97
|
-
exports.default = _default;
|
|
98
|
-
//# sourceMappingURL=typeset-button.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_components","_coreData","_data","_blockEditor","_editor","_element","_icons","_context","_interopRequireDefault","_utils","_navigationButton","_subtitle","_lockUnlock","_useThemeStyleVariationsByProperty","_jsxRuntime","GlobalStylesContext","unlock","blockEditorPrivateApis","mergeBaseAndUserConfigs","editorPrivateApis","TypesetButton","propertiesToFilter","typographyVariations","useCurrentMergeThemeStyleVariationsWithUserConfig","hasTypographyVariations","length","base","user","userConfig","useContext","config","allFontFamilies","getFontFamilies","hasFonts","filter","font","variations","useSelect","select","coreStore","__experimentalGetCurrentThemeGlobalStylesVariations","userTypographyConfig","filterObjectByProperties","title","useMemo","Object","keys","__","activeVariation","find","variation","JSON","stringify","map","name","join","jsxs","__experimentalVStack","spacing","children","jsx","__experimentalHStack","justify","default","level","__experimentalItemGroup","isBordered","isSeparated","NavigationButtonAsItem","path","direction","FlexItem","Icon","icon","isRTL","chevronLeft","chevronRight","_default","props","exports"],"sources":["@wordpress/edit-site/src/components/global-styles/typeset-button.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { isRTL, __ } from '@wordpress/i18n';\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalVStack as VStack,\n\t__experimentalHStack as HStack,\n\tFlexItem,\n} from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { useMemo, useContext } from '@wordpress/element';\nimport { Icon, chevronLeft, chevronRight } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport FontLibraryProvider from './font-library-modal/context';\nimport { getFontFamilies } from './utils';\nimport { NavigationButtonAsItem } from './navigation-button';\nimport Subtitle from './subtitle';\nimport { unlock } from '../../lock-unlock';\nimport {\n\tfilterObjectByProperties,\n\tuseCurrentMergeThemeStyleVariationsWithUserConfig,\n} from '../../hooks/use-theme-style-variations/use-theme-style-variations-by-property';\n\nconst { GlobalStylesContext } = unlock( blockEditorPrivateApis );\nconst { mergeBaseAndUserConfigs } = unlock( editorPrivateApis );\n\nfunction TypesetButton() {\n\tconst propertiesToFilter = [ 'typography' ];\n\tconst typographyVariations =\n\t\tuseCurrentMergeThemeStyleVariationsWithUserConfig( propertiesToFilter );\n\tconst hasTypographyVariations = typographyVariations?.length > 1;\n\tconst { base, user: userConfig } = useContext( GlobalStylesContext );\n\tconst config = mergeBaseAndUserConfigs( base, userConfig );\n\tconst allFontFamilies = getFontFamilies( config );\n\tconst hasFonts =\n\t\tallFontFamilies.filter( ( font ) => font !== null ).length > 0;\n\tconst variations = useSelect( ( select ) => {\n\t\treturn select(\n\t\t\tcoreStore\n\t\t).__experimentalGetCurrentThemeGlobalStylesVariations();\n\t}, [] );\n\tconst userTypographyConfig = filterObjectByProperties(\n\t\tuserConfig,\n\t\t'typography'\n\t);\n\n\tconst title = useMemo( () => {\n\t\tif ( Object.keys( userTypographyConfig ).length === 0 ) {\n\t\t\treturn __( 'Default' );\n\t\t}\n\t\tconst activeVariation = variations?.find( ( variation ) => {\n\t\t\treturn (\n\t\t\t\tJSON.stringify(\n\t\t\t\t\tfilterObjectByProperties( variation, 'typography' )\n\t\t\t\t) === JSON.stringify( userTypographyConfig )\n\t\t\t);\n\t\t} );\n\t\tif ( activeVariation ) {\n\t\t\treturn activeVariation.title;\n\t\t}\n\t\treturn allFontFamilies.map( ( font ) => font?.name ).join( ', ' );\n\t}, [ allFontFamilies, userTypographyConfig, variations ] );\n\n\treturn (\n\t\thasTypographyVariations &&\n\t\thasFonts && (\n\t\t\t<VStack spacing={ 2 }>\n\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t<Subtitle level={ 3 }>{ __( 'Typeset' ) }</Subtitle>\n\t\t\t\t</HStack>\n\t\t\t\t<ItemGroup isBordered isSeparated>\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\tpath=\"/typography/typeset\"\n\t\t\t\t\t\taria-label={ __( 'Typeset' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<HStack direction=\"row\">\n\t\t\t\t\t\t\t<FlexItem>{ title }</FlexItem>\n\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\ticon={ isRTL() ? chevronLeft : chevronRight }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</NavigationButtonAsIt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