@wordpress/edit-site 6.49.1 → 6.50.1-next.v.202607070741.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.
Files changed (56) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/editor/index.cjs +33 -101
  3. package/build/components/editor/index.cjs.map +3 -3
  4. package/build/components/layout/index.cjs +12 -14
  5. package/build/components/layout/index.cjs.map +3 -3
  6. package/build/components/page-patterns/fields.cjs +0 -36
  7. package/build/components/page-patterns/fields.cjs.map +2 -2
  8. package/build/components/page-patterns/index.cjs +4 -15
  9. package/build/components/page-patterns/index.cjs.map +2 -2
  10. package/build/components/save-panel/index.cjs +1 -2
  11. package/build/components/save-panel/index.cjs.map +2 -2
  12. package/build/components/site-hub/index.cjs +24 -155
  13. package/build/components/site-hub/index.cjs.map +3 -3
  14. package/build/index.cjs +3 -1
  15. package/build/index.cjs.map +2 -2
  16. package/build-module/components/editor/index.mjs +36 -104
  17. package/build-module/components/editor/index.mjs.map +2 -2
  18. package/build-module/components/layout/index.mjs +12 -14
  19. package/build-module/components/layout/index.mjs.map +2 -2
  20. package/build-module/components/page-patterns/fields.mjs +2 -41
  21. package/build-module/components/page-patterns/fields.mjs.map +2 -2
  22. package/build-module/components/page-patterns/index.mjs +5 -16
  23. package/build-module/components/page-patterns/index.mjs.map +2 -2
  24. package/build-module/components/save-panel/index.mjs +1 -2
  25. package/build-module/components/save-panel/index.mjs.map +2 -2
  26. package/build-module/components/site-hub/index.mjs +27 -158
  27. package/build-module/components/site-hub/index.mjs.map +2 -2
  28. package/build-module/index.mjs +3 -1
  29. package/build-module/index.mjs.map +2 -2
  30. package/build-style/style-rtl.css +71 -189
  31. package/build-style/style.css +71 -189
  32. package/package.json +48 -48
  33. package/src/components/editor/index.js +18 -101
  34. package/src/components/editor/style.scss +8 -19
  35. package/src/components/layout/index.js +12 -15
  36. package/src/components/layout/style.scss +5 -7
  37. package/src/components/page-patterns/fields.js +2 -50
  38. package/src/components/page-patterns/index.js +5 -23
  39. package/src/components/page-patterns/style.scss +1 -1
  40. package/src/components/save-panel/index.js +1 -2
  41. package/src/components/sidebar/style.scss +2 -0
  42. package/src/components/sidebar-global-styles/style.scss +7 -4
  43. package/src/components/sidebar-navigation-screen/style.scss +1 -1
  44. package/src/components/site-hub/index.js +7 -141
  45. package/src/components/site-hub/style.scss +0 -72
  46. package/src/index.js +3 -1
  47. package/src/style.scss +14 -11
  48. package/build/components/site-icon/index.cjs +0 -73
  49. package/build/components/site-icon/index.cjs.map +0 -7
  50. package/build-module/components/site-icon/index.mjs +0 -42
  51. package/build-module/components/site-icon/index.mjs.map +0 -7
  52. package/build-style/experimental-omnibar-rtl.css +0 -103
  53. package/build-style/experimental-omnibar.css +0 -103
  54. package/src/components/site-icon/index.js +0 -51
  55. package/src/components/site-icon/style.scss +0 -41
  56. package/src/experimental-omnibar.scss +0 -75
@@ -6,129 +6,35 @@ import clsx from 'clsx';
6
6
  /**
7
7
  * WordPress dependencies
8
8
  */
9
- import { useSelect, useDispatch } from '@wordpress/data';
9
+ import { useSelect } from '@wordpress/data';
10
10
  import { Button, __experimentalHStack as HStack } from '@wordpress/components';
11
11
  import { __, isRTL } from '@wordpress/i18n';
12
12
  import { store as coreStore } from '@wordpress/core-data';
13
- import { decodeEntities } from '@wordpress/html-entities';
14
13
  import { memo, forwardRef, useContext } from '@wordpress/element';
15
- import { Icon, arrowUpLeft, arrowUpRight, search } from '@wordpress/icons';
16
- import { store as commandsStore } from '@wordpress/commands';
17
- import { displayShortcut } from '@wordpress/keycodes';
18
- import { VisuallyHidden } from '@wordpress/ui';
19
- import { filterURLForDisplay } from '@wordpress/url';
14
+ import { Icon, chevronLeft, chevronRight } from '@wordpress/icons';
20
15
  import { privateApis as routerPrivateApis } from '@wordpress/router';
21
16
 
22
17
  /**
23
18
  * Internal dependencies
24
19
  */
25
20
  import { store as editSiteStore } from '../../store';
26
- import SiteIcon from '../site-icon';
27
21
  import { unlock } from '../../lock-unlock';
28
22
  import { SidebarNavigationContext } from '../sidebar';
29
23
  const { useLocation, useHistory } = unlock( routerPrivateApis );
30
24
 
31
- const SiteHub = memo(
32
- forwardRef( ( { isTransparent }, ref ) => {
33
- const { dashboardLink, homeUrl, siteTitle } = useSelect( ( select ) => {
34
- const { getSettings } = unlock( select( editSiteStore ) );
35
-
36
- const { getEntityRecord } = select( coreStore );
37
- const _site = getEntityRecord( 'root', 'site' );
38
- return {
39
- dashboardLink: getSettings().__experimentalDashboardLink,
40
- homeUrl: getEntityRecord( 'root', '__unstableBase' )?.home,
41
- siteTitle:
42
- ! _site?.title && !! _site?.url
43
- ? filterURLForDisplay( _site?.url )
44
- : _site?.title,
45
- };
46
- }, [] );
47
- const { open: openCommandCenter } = useDispatch( commandsStore );
48
-
49
- return (
50
- <div className="edit-site-site-hub">
51
- <HStack justify="flex-start" spacing="0">
52
- <div
53
- className={ clsx(
54
- 'edit-site-site-hub__view-mode-toggle-container',
55
- {
56
- 'has-transparent-background': isTransparent,
57
- }
58
- ) }
59
- >
60
- <Button
61
- __next40pxDefaultSize
62
- ref={ ref }
63
- href={ dashboardLink }
64
- label={ __( 'Go to the Dashboard' ) }
65
- className="edit-site-layout__view-mode-toggle"
66
- style={ {
67
- transform: 'scale(0.5333) translateX(-4px)', // Offset to position the icon 12px from viewport edge
68
- borderRadius: 4,
69
- } }
70
- >
71
- <SiteIcon className="edit-site-layout__view-mode-toggle-icon" />
72
- </Button>
73
- </div>
74
-
75
- <HStack>
76
- <div className="edit-site-site-hub__title">
77
- <Button
78
- __next40pxDefaultSize
79
- variant="link"
80
- href={ homeUrl }
81
- target="_blank"
82
- >
83
- { decodeEntities( siteTitle ) }
84
- <VisuallyHidden render={ <span /> }>
85
- {
86
- /* translators: accessibility text */
87
- __( '(opens in a new tab)' )
88
- }
89
- </VisuallyHidden>
90
- </Button>
91
- </div>
92
- <HStack
93
- spacing={ 0 }
94
- expanded={ false }
95
- className="edit-site-site-hub__actions"
96
- >
97
- <Button
98
- size="compact"
99
- className="edit-site-site-hub_toggle-command-center"
100
- icon={ search }
101
- onClick={ () => openCommandCenter() }
102
- label={ __( 'Open command palette' ) }
103
- shortcut={ displayShortcut.primary( 'k' ) }
104
- />
105
- </HStack>
106
- </HStack>
107
- </HStack>
108
- </div>
109
- );
110
- } )
111
- );
112
-
113
- export default SiteHub;
114
-
115
25
  export const SiteHubMobile = memo(
116
26
  forwardRef( ( { isTransparent }, ref ) => {
117
27
  const { path } = useLocation();
118
28
  const history = useHistory();
119
29
  const { navigate } = useContext( SidebarNavigationContext );
120
- const hasAdminBarInEditor = window.__experimentalAdminBarInEditor;
121
30
 
122
31
  const {
123
32
  dashboardLink,
124
- homeUrl,
125
- siteTitle,
126
33
  isBlockTheme,
127
34
  isClassicThemeWithStyleBookSupport,
128
35
  } = useSelect( ( select ) => {
129
36
  const { getSettings } = unlock( select( editSiteStore ) );
130
- const { getEntityRecord, getCurrentTheme } = select( coreStore );
131
- const _site = getEntityRecord( 'root', 'site' );
37
+ const { getCurrentTheme } = select( coreStore );
132
38
  const currentTheme = getCurrentTheme();
133
39
  const settings = getSettings();
134
40
  const supportsEditorStyles =
@@ -138,18 +44,12 @@ export const SiteHubMobile = memo(
138
44
 
139
45
  return {
140
46
  dashboardLink: settings.__experimentalDashboardLink,
141
- homeUrl: getEntityRecord( 'root', '__unstableBase' )?.home,
142
- siteTitle:
143
- ! _site?.title && !! _site?.url
144
- ? filterURLForDisplay( _site?.url )
145
- : _site?.title,
146
47
  isBlockTheme: currentTheme?.is_block_theme,
147
48
  isClassicThemeWithStyleBookSupport:
148
49
  ! currentTheme?.is_block_theme &&
149
50
  ( supportsEditorStyles || hasThemeJson ),
150
51
  };
151
52
  }, [] );
152
- const { open: openCommandCenter } = useDispatch( commandsStore );
153
53
 
154
54
  let backPath;
155
55
 
@@ -200,46 +100,12 @@ export const SiteHubMobile = memo(
200
100
  } }
201
101
  { ...backButtonProps }
202
102
  >
203
- { hasAdminBarInEditor ? (
204
- <Icon
205
- icon={
206
- isRTL() ? arrowUpRight : arrowUpLeft
207
- }
208
- size={ 48 }
209
- />
210
- ) : (
211
- <SiteIcon className="edit-site-layout__view-mode-toggle-icon" />
212
- ) }
103
+ <Icon
104
+ icon={ isRTL() ? chevronRight : chevronLeft }
105
+ size={ 48 }
106
+ />
213
107
  </Button>
214
108
  </div>
215
-
216
- <HStack>
217
- <div className="edit-site-site-hub__title">
218
- <Button
219
- __next40pxDefaultSize
220
- variant="link"
221
- href={ homeUrl }
222
- target="_blank"
223
- label={ __( 'View site (opens in a new tab)' ) }
224
- >
225
- { decodeEntities( siteTitle ) }
226
- </Button>
227
- </div>
228
- <HStack
229
- spacing={ 0 }
230
- expanded={ false }
231
- className="edit-site-site-hub__actions"
232
- >
233
- <Button
234
- __next40pxDefaultSize
235
- className="edit-site-site-hub_toggle-command-center"
236
- icon={ search }
237
- onClick={ () => openCommandCenter() }
238
- label={ __( 'Open command palette' ) }
239
- shortcut={ displayShortcut.primary( 'k' ) }
240
- />
241
- </HStack>
242
- </HStack>
243
109
  </HStack>
244
110
  </div>
245
111
  );
@@ -9,10 +9,6 @@
9
9
  height: $header-height;
10
10
  }
11
11
 
12
- .edit-site-site-hub__actions {
13
- flex-shrink: 0;
14
- }
15
-
16
12
  .edit-site-site-hub__view-mode-toggle-container {
17
13
  height: $header-height;
18
14
  width: $header-height;
@@ -22,71 +18,3 @@
22
18
  background: transparent;
23
19
  }
24
20
  }
25
-
26
- .edit-site-site-hub__title .components-button {
27
- color: var(--wpds-color-foreground-interactive-neutral);
28
- display: block;
29
- flex-grow: 1;
30
- font-size: 15px;
31
- font-weight: $font-weight-medium;
32
- overflow: hidden;
33
- // Add space for the ↗ to render.
34
- padding-right: $grid-unit-20;
35
-
36
- // Create 12px gap between site icon and site title
37
- margin-left: - $grid-unit-05;
38
- position: relative;
39
- text-decoration: none;
40
- text-overflow: ellipsis;
41
- white-space: nowrap;
42
-
43
- &:hover,
44
- &:focus,
45
- &:active {
46
- color: var(--wpds-color-foreground-interactive-neutral);
47
- }
48
-
49
- &:focus {
50
- // Defer to :focus-visible below.
51
- box-shadow: none;
52
- outline: none;
53
- }
54
-
55
- &:focus-visible {
56
- // Push the shadow away from the title.
57
- box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wpds-color-background-surface-neutral-weak), 0 0 0 calc(2 * var(--wp-admin-border-width-focus)) var(--wp-admin-theme-color);
58
-
59
- // Windows High Contrast mode will show this outline, but not the box-shadow.
60
- outline: 2px solid transparent;
61
- outline-offset: 2px;
62
- }
63
-
64
- &::after {
65
- content: "\2197";
66
- font-weight: 400;
67
- opacity: 0;
68
- position: absolute;
69
- right: 0;
70
-
71
- @media not (prefers-reduced-motion) {
72
- transition: opacity 0.1s linear;
73
- }
74
- }
75
-
76
- &:hover::after,
77
- &:focus::after,
78
- &:active::after {
79
- opacity: 1;
80
- }
81
- }
82
-
83
- .edit-site-site-hub_toggle-command-center {
84
- color: var(--wpds-color-foreground-interactive-neutral);
85
-
86
- &:hover,
87
- &:active {
88
- svg {
89
- fill: var(--wpds-color-foreground-interactive-neutral-active);
90
- }
91
- }
92
- }
package/src/index.js CHANGED
@@ -74,7 +74,9 @@ export function initializeEditor( id, settings ) {
74
74
  showListViewByDefault: false,
75
75
  enableChoosePatternModal: true,
76
76
  showCollaborationCursor: false,
77
- showCollaborationNotifications: true,
77
+ showCollaborationJoinNotifications: true,
78
+ showCollaborationLeaveNotifications: true,
79
+ showCollaborationPostSaveNotifications: true,
78
80
  } );
79
81
 
80
82
  if ( window.__clientSideMediaProcessing ) {
package/src/style.scss CHANGED
@@ -26,14 +26,11 @@
26
26
  @use "./components/sidebar-navigation-screen-templates-browse/style.scss" as *;
27
27
  @use "./components/sidebar-dataviews/style.scss" as *;
28
28
  @use "./components/site-hub/style.scss" as *;
29
- @use "./components/site-icon/style.scss" as *;
30
29
  @use "./components/post-list/style.scss" as *;
31
30
  @use "./components/resizable-frame/style.scss" as *;
32
31
  @use "./components/pagination/style.scss" as *;
33
32
  @use "./components/sidebar-global-styles/style.scss" as *;
34
- @use "./experimental-omnibar.scss" as *;
35
33
 
36
- /* stylelint-disable -- Disable reason: View Transitions not supported properly by stylelint. */
37
34
  ::view-transition-image-pair(root) {
38
35
  isolation: auto;
39
36
  }
@@ -45,12 +42,6 @@
45
42
  display: block;
46
43
  }
47
44
 
48
- /* stylelint-enable */
49
-
50
- body.js #wpadminbar {
51
- display: none;
52
- }
53
-
54
45
  body.js #wpbody {
55
46
  padding-top: 0;
56
47
  }
@@ -62,10 +53,21 @@ body.js.site-editor-php {
62
53
 
63
54
  body.js.site-editor-php {
64
55
  background: var(--wpds-color-background-surface-neutral-weak);
56
+
57
+ @include break-medium {
58
+ &:has(.editor-editor-interface.is-distraction-free) {
59
+ --wp-admin--admin-bar--height: 0px;
60
+
61
+ #wpadminbar {
62
+ display: none;
63
+ }
64
+ }
65
+ }
65
66
  }
66
67
 
67
68
  .edit-site {
68
69
  @include reset;
70
+ padding-top: var(--wp-admin--admin-bar--height, 0);
69
71
  height: 100vh;
70
72
 
71
73
  // On mobile the main content area has to scroll, otherwise you can invoke
@@ -73,10 +75,11 @@ body.js.site-editor-php {
73
75
  @include break-small {
74
76
  bottom: 0;
75
77
  left: 0;
76
- min-height: 100vh;
78
+ height: calc(100vh - var(--wp-admin--admin-bar--height, 0px));
79
+ padding-top: 0;
77
80
  position: fixed;
78
81
  right: 0;
79
- top: 0;
82
+ top: var(--wp-admin--admin-bar--height, 0);
80
83
  }
81
84
 
82
85
  .no-js & {
@@ -1,73 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // packages/edit-site/src/components/site-icon/index.js
31
- var site_icon_exports = {};
32
- __export(site_icon_exports, {
33
- default: () => site_icon_default
34
- });
35
- module.exports = __toCommonJS(site_icon_exports);
36
- var import_clsx = __toESM(require("clsx"));
37
- var import_data = require("@wordpress/data");
38
- var import_components = require("@wordpress/components");
39
- var import_i18n = require("@wordpress/i18n");
40
- var import_icons = require("@wordpress/icons");
41
- var import_core_data = require("@wordpress/core-data");
42
- var import_jsx_runtime = require("react/jsx-runtime");
43
- function SiteIcon({ className }) {
44
- const { isRequestingSite, siteIconUrl } = (0, import_data.useSelect)((select) => {
45
- const { getEntityRecord } = select(import_core_data.store);
46
- const siteData = getEntityRecord("root", "__unstableBase", void 0);
47
- return {
48
- isRequestingSite: !siteData,
49
- siteIconUrl: siteData?.site_icon_url
50
- };
51
- }, []);
52
- if (isRequestingSite && !siteIconUrl) {
53
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "edit-site-site-icon__image" });
54
- }
55
- const icon = siteIconUrl ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
56
- "img",
57
- {
58
- className: "edit-site-site-icon__image",
59
- alt: (0, import_i18n.__)("Site Icon"),
60
- src: siteIconUrl
61
- }
62
- ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
63
- import_components.Icon,
64
- {
65
- className: "edit-site-site-icon__icon",
66
- icon: import_icons.wordpress,
67
- size: 48
68
- }
69
- );
70
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_clsx.default)(className, "edit-site-site-icon"), children: icon });
71
- }
72
- var site_icon_default = SiteIcon;
73
- //# sourceMappingURL=index.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/site-icon/index.js"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { Icon as WCIcon } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { wordpress } from '@wordpress/icons';\nimport { store as coreDataStore } from '@wordpress/core-data';\n\nfunction SiteIcon( { className } ) {\n\tconst { isRequestingSite, siteIconUrl } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord } = select( coreDataStore );\n\t\tconst siteData = getEntityRecord( 'root', '__unstableBase', undefined );\n\n\t\treturn {\n\t\t\tisRequestingSite: ! siteData,\n\t\t\tsiteIconUrl: siteData?.site_icon_url,\n\t\t};\n\t}, [] );\n\n\tif ( isRequestingSite && ! siteIconUrl ) {\n\t\treturn <div className=\"edit-site-site-icon__image\" />;\n\t}\n\n\tconst icon = siteIconUrl ? (\n\t\t<img\n\t\t\tclassName=\"edit-site-site-icon__image\"\n\t\t\talt={ __( 'Site Icon' ) }\n\t\t\tsrc={ siteIconUrl }\n\t\t/>\n\t) : (\n\t\t<WCIcon\n\t\t\tclassName=\"edit-site-site-icon__icon\"\n\t\t\ticon={ wordpress }\n\t\t\tsize={ 48 }\n\t\t/>\n\t);\n\n\treturn (\n\t\t<div className={ clsx( className, 'edit-site-site-icon' ) }>\n\t\t\t{ icon }\n\t\t</div>\n\t);\n}\n\nexport default SiteIcon;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,kBAA0B;AAC1B,wBAA+B;AAC/B,kBAAmB;AACnB,mBAA0B;AAC1B,uBAAuC;AAc9B;AAZT,SAAS,SAAU,EAAE,UAAU,GAAI;AAClC,QAAM,EAAE,kBAAkB,YAAY,QAAI,uBAAW,CAAE,WAAY;AAClE,UAAM,EAAE,gBAAgB,IAAI,OAAQ,iBAAAA,KAAc;AAClD,UAAM,WAAW,gBAAiB,QAAQ,kBAAkB,MAAU;AAEtE,WAAO;AAAA,MACN,kBAAkB,CAAE;AAAA,MACpB,aAAa,UAAU;AAAA,IACxB;AAAA,EACD,GAAG,CAAC,CAAE;AAEN,MAAK,oBAAoB,CAAE,aAAc;AACxC,WAAO,4CAAC,SAAI,WAAU,8BAA6B;AAAA,EACpD;AAEA,QAAM,OAAO,cACZ;AAAA,IAAC;AAAA;AAAA,MACA,WAAU;AAAA,MACV,SAAM,gBAAI,WAAY;AAAA,MACtB,KAAM;AAAA;AAAA,EACP,IAEA;AAAA,IAAC,kBAAAC;AAAA,IAAA;AAAA,MACA,WAAU;AAAA,MACV,MAAO;AAAA,MACP,MAAO;AAAA;AAAA,EACR;AAGD,SACC,4CAAC,SAAI,eAAY,YAAAC,SAAM,WAAW,qBAAsB,GACrD,gBACH;AAEF;AAEA,IAAO,oBAAQ;",
6
- "names": ["coreDataStore", "WCIcon", "clsx"]
7
- }
@@ -1,42 +0,0 @@
1
- // packages/edit-site/src/components/site-icon/index.js
2
- import clsx from "clsx";
3
- import { useSelect } from "@wordpress/data";
4
- import { Icon as WCIcon } from "@wordpress/components";
5
- import { __ } from "@wordpress/i18n";
6
- import { wordpress } from "@wordpress/icons";
7
- import { store as coreDataStore } from "@wordpress/core-data";
8
- import { jsx } from "react/jsx-runtime";
9
- function SiteIcon({ className }) {
10
- const { isRequestingSite, siteIconUrl } = useSelect((select) => {
11
- const { getEntityRecord } = select(coreDataStore);
12
- const siteData = getEntityRecord("root", "__unstableBase", void 0);
13
- return {
14
- isRequestingSite: !siteData,
15
- siteIconUrl: siteData?.site_icon_url
16
- };
17
- }, []);
18
- if (isRequestingSite && !siteIconUrl) {
19
- return /* @__PURE__ */ jsx("div", { className: "edit-site-site-icon__image" });
20
- }
21
- const icon = siteIconUrl ? /* @__PURE__ */ jsx(
22
- "img",
23
- {
24
- className: "edit-site-site-icon__image",
25
- alt: __("Site Icon"),
26
- src: siteIconUrl
27
- }
28
- ) : /* @__PURE__ */ jsx(
29
- WCIcon,
30
- {
31
- className: "edit-site-site-icon__icon",
32
- icon: wordpress,
33
- size: 48
34
- }
35
- );
36
- return /* @__PURE__ */ jsx("div", { className: clsx(className, "edit-site-site-icon"), children: icon });
37
- }
38
- var site_icon_default = SiteIcon;
39
- export {
40
- site_icon_default as default
41
- };
42
- //# sourceMappingURL=index.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/site-icon/index.js"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { Icon as WCIcon } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { wordpress } from '@wordpress/icons';\nimport { store as coreDataStore } from '@wordpress/core-data';\n\nfunction SiteIcon( { className } ) {\n\tconst { isRequestingSite, siteIconUrl } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord } = select( coreDataStore );\n\t\tconst siteData = getEntityRecord( 'root', '__unstableBase', undefined );\n\n\t\treturn {\n\t\t\tisRequestingSite: ! siteData,\n\t\t\tsiteIconUrl: siteData?.site_icon_url,\n\t\t};\n\t}, [] );\n\n\tif ( isRequestingSite && ! siteIconUrl ) {\n\t\treturn <div className=\"edit-site-site-icon__image\" />;\n\t}\n\n\tconst icon = siteIconUrl ? (\n\t\t<img\n\t\t\tclassName=\"edit-site-site-icon__image\"\n\t\t\talt={ __( 'Site Icon' ) }\n\t\t\tsrc={ siteIconUrl }\n\t\t/>\n\t) : (\n\t\t<WCIcon\n\t\t\tclassName=\"edit-site-site-icon__icon\"\n\t\t\ticon={ wordpress }\n\t\t\tsize={ 48 }\n\t\t/>\n\t);\n\n\treturn (\n\t\t<div className={ clsx( className, 'edit-site-site-icon' ) }>\n\t\t\t{ icon }\n\t\t</div>\n\t);\n}\n\nexport default SiteIcon;\n"],
5
- "mappings": ";AAGA,OAAO,UAAU;AAKjB,SAAS,iBAAiB;AAC1B,SAAS,QAAQ,cAAc;AAC/B,SAAS,UAAU;AACnB,SAAS,iBAAiB;AAC1B,SAAS,SAAS,qBAAqB;AAc9B;AAZT,SAAS,SAAU,EAAE,UAAU,GAAI;AAClC,QAAM,EAAE,kBAAkB,YAAY,IAAI,UAAW,CAAE,WAAY;AAClE,UAAM,EAAE,gBAAgB,IAAI,OAAQ,aAAc;AAClD,UAAM,WAAW,gBAAiB,QAAQ,kBAAkB,MAAU;AAEtE,WAAO;AAAA,MACN,kBAAkB,CAAE;AAAA,MACpB,aAAa,UAAU;AAAA,IACxB;AAAA,EACD,GAAG,CAAC,CAAE;AAEN,MAAK,oBAAoB,CAAE,aAAc;AACxC,WAAO,oBAAC,SAAI,WAAU,8BAA6B;AAAA,EACpD;AAEA,QAAM,OAAO,cACZ;AAAA,IAAC;AAAA;AAAA,MACA,WAAU;AAAA,MACV,KAAM,GAAI,WAAY;AAAA,MACtB,KAAM;AAAA;AAAA,EACP,IAEA;AAAA,IAAC;AAAA;AAAA,MACA,WAAU;AAAA,MACV,MAAO;AAAA,MACP,MAAO;AAAA;AAAA,EACR;AAGD,SACC,oBAAC,SAAI,WAAY,KAAM,WAAW,qBAAsB,GACrD,gBACH;AAEF;AAEA,IAAO,oBAAQ;",
6
- "names": []
7
- }
@@ -1,103 +0,0 @@
1
- /**
2
- * SCSS Variables.
3
- *
4
- * Please use variables from this sheet to ensure consistency across the UI.
5
- * Don't add to this sheet unless you're pretty sure the value will be reused in many places.
6
- * For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
7
- */
8
- /**
9
- * Colors
10
- */
11
- /**
12
- * Fonts & basic variables.
13
- */
14
- /**
15
- * Typography
16
- */
17
- /**
18
- * Grid System.
19
- * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
20
- */
21
- /**
22
- * Radius scale.
23
- */
24
- /**
25
- * Elevation scale.
26
- */
27
- /**
28
- * Dimensions.
29
- */
30
- /**
31
- * Mobile specific styles
32
- */
33
- /**
34
- * Editor styles.
35
- */
36
- /**
37
- * Block & Editor UI.
38
- */
39
- /**
40
- * Block paddings.
41
- */
42
- /**
43
- * React Native specific.
44
- * These variables do not appear to be used anywhere else.
45
- */
46
- body.has-admin-bar-in-editor {
47
- margin-top: 0;
48
- height: 100%;
49
- }
50
- body.has-admin-bar-in-editor:has(.editor-editor-interface.is-distraction-free) {
51
- --wp-admin--admin-bar--height: 0;
52
- }
53
- body.has-admin-bar-in-editor .edit-site-site-hub__title,
54
- body.has-admin-bar-in-editor .edit-site-site-hub__actions {
55
- display: none;
56
- }
57
- body.has-admin-bar-in-editor .edit-site-editor__view-mode-toggle .edit-site-editor__back-icon {
58
- background: transparent;
59
- }
60
- body.has-admin-bar-in-editor .edit-site-editor__view-mode-toggle:hover .edit-site-editor__back-icon {
61
- color: var(--wp-admin-theme-color);
62
- }
63
- body.has-admin-bar-in-editor .edit-site-sidebar-navigation-screen__title-icon {
64
- padding-top: 32px;
65
- }
66
- body.has-admin-bar-in-editor .edit-site-layout__content,
67
- body.has-admin-bar-in-editor .edit-site-layout__sidebar {
68
- min-height: 0;
69
- }
70
- body.has-admin-bar-in-editor .edit-site-sidebar__content {
71
- flex-basis: 0;
72
- min-height: 0;
73
- }
74
- body.has-admin-bar-in-editor .edit-site {
75
- box-sizing: border-box;
76
- padding-top: var(--wp-admin--admin-bar--height, 0);
77
- height: 100vh;
78
- min-height: 100vh;
79
- }
80
- @media (min-width: 600px) {
81
- body.has-admin-bar-in-editor .edit-site {
82
- padding-top: 0;
83
- top: var(--wp-admin--admin-bar--height, 0);
84
- height: calc(100vh - var(--wp-admin--admin-bar--height, 0));
85
- min-height: calc(100vh - var(--wp-admin--admin-bar--height, 0));
86
- }
87
- }
88
- body.has-admin-bar-in-editor .edit-site-layout.is-full-canvas .edit-site-layout__sidebar-region {
89
- top: var(--wp-admin--admin-bar--height, 0);
90
- height: calc(100vh - var(--wp-admin--admin-bar--height, 0));
91
- }
92
- body.has-admin-bar-in-editor.is-fullscreen-mode .is-entity-save-view-open .interface-interface-skeleton__actions:focus,
93
- body.has-admin-bar-in-editor.is-fullscreen-mode .is-entity-save-view-open .interface-interface-skeleton__actions:focus-within,
94
- body.has-admin-bar-in-editor.is-fullscreen-mode .edit-site-layout__actions.is-entity-save-view-open:focus,
95
- body.has-admin-bar-in-editor.is-fullscreen-mode .edit-site-layout__actions.is-entity-save-view-open:focus-within {
96
- top: var(--wp-admin--admin-bar--height, 0);
97
- }
98
- body.has-admin-bar-in-editor.is-fullscreen-mode #wpadminbar {
99
- display: block;
100
- }
101
- body.has-admin-bar-in-editor.is-fullscreen-mode:has(.editor-editor-interface.is-distraction-free) #wpadminbar {
102
- display: none;
103
- }