@wordpress/edit-site 3.0.11 → 3.0.12

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 (151) hide show
  1. package/build/components/add-new-template/new-template-part.js +34 -17
  2. package/build/components/add-new-template/new-template-part.js.map +1 -1
  3. package/build/components/add-new-template/new-template.js +41 -22
  4. package/build/components/add-new-template/new-template.js.map +1 -1
  5. package/build/components/block-editor/index.js +3 -1
  6. package/build/components/block-editor/index.js.map +1 -1
  7. package/build/components/global-styles/color-palette-panel.js +4 -4
  8. package/build/components/global-styles/color-palette-panel.js.map +1 -1
  9. package/build/components/global-styles/gradients-palette-panel.js +56 -0
  10. package/build/components/global-styles/gradients-palette-panel.js.map +1 -0
  11. package/build/components/global-styles/hooks.js +5 -5
  12. package/build/components/global-styles/hooks.js.map +1 -1
  13. package/build/components/global-styles/palette.js +11 -5
  14. package/build/components/global-styles/palette.js.map +1 -1
  15. package/build/components/global-styles/screen-background-color.js +2 -1
  16. package/build/components/global-styles/screen-background-color.js.map +1 -1
  17. package/build/components/global-styles/screen-color-palette.js +23 -3
  18. package/build/components/global-styles/screen-color-palette.js.map +1 -1
  19. package/build/components/global-styles/screen-link-color.js +2 -1
  20. package/build/components/global-styles/screen-link-color.js.map +1 -1
  21. package/build/components/global-styles/screen-text-color.js +2 -1
  22. package/build/components/global-styles/screen-text-color.js.map +1 -1
  23. package/build/components/global-styles/screen-typography-element.js +54 -0
  24. package/build/components/global-styles/screen-typography-element.js.map +1 -0
  25. package/build/components/global-styles/screen-typography.js +74 -6
  26. package/build/components/global-styles/screen-typography.js.map +1 -1
  27. package/build/components/global-styles/typography-panel.js +28 -8
  28. package/build/components/global-styles/typography-panel.js.map +1 -1
  29. package/build/components/global-styles/ui.js +12 -0
  30. package/build/components/global-styles/ui.js.map +1 -1
  31. package/build/components/global-styles/use-global-styles-output.js +2 -2
  32. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  33. package/build/components/global-styles/utils.js +1 -1
  34. package/build/components/global-styles/utils.js.map +1 -1
  35. package/build/components/list/actions/index.js +104 -0
  36. package/build/components/list/actions/index.js.map +1 -0
  37. package/build/components/list/actions/rename-menu-item.js +112 -0
  38. package/build/components/list/actions/rename-menu-item.js.map +1 -0
  39. package/build/components/list/added-by.js +180 -0
  40. package/build/components/list/added-by.js.map +1 -0
  41. package/build/components/list/index.js +18 -3
  42. package/build/components/list/index.js.map +1 -1
  43. package/build/components/list/table.js +54 -67
  44. package/build/components/list/table.js.map +1 -1
  45. package/build/components/navigation-sidebar/index.js +12 -11
  46. package/build/components/navigation-sidebar/index.js.map +1 -1
  47. package/build/components/navigation-sidebar/navigation-panel/index.js +28 -11
  48. package/build/components/navigation-sidebar/navigation-panel/index.js.map +1 -1
  49. package/build/components/navigation-sidebar/navigation-toggle/index.js +14 -5
  50. package/build/components/navigation-sidebar/navigation-toggle/index.js.map +1 -1
  51. package/build/index.js +8 -2
  52. package/build/index.js.map +1 -1
  53. package/build/store/actions.js +47 -18
  54. package/build/store/actions.js.map +1 -1
  55. package/build/store/selectors.js +25 -5
  56. package/build/store/selectors.js.map +1 -1
  57. package/build-module/components/add-new-template/new-template-part.js +30 -16
  58. package/build-module/components/add-new-template/new-template-part.js.map +1 -1
  59. package/build-module/components/add-new-template/new-template.js +40 -23
  60. package/build-module/components/add-new-template/new-template.js.map +1 -1
  61. package/build-module/components/block-editor/index.js +2 -1
  62. package/build-module/components/block-editor/index.js.map +1 -1
  63. package/build-module/components/global-styles/color-palette-panel.js +5 -5
  64. package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
  65. package/build-module/components/global-styles/gradients-palette-panel.js +46 -0
  66. package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -0
  67. package/build-module/components/global-styles/hooks.js +5 -5
  68. package/build-module/components/global-styles/hooks.js.map +1 -1
  69. package/build-module/components/global-styles/palette.js +12 -5
  70. package/build-module/components/global-styles/palette.js.map +1 -1
  71. package/build-module/components/global-styles/screen-background-color.js +2 -1
  72. package/build-module/components/global-styles/screen-background-color.js.map +1 -1
  73. package/build-module/components/global-styles/screen-color-palette.js +22 -3
  74. package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
  75. package/build-module/components/global-styles/screen-link-color.js +2 -1
  76. package/build-module/components/global-styles/screen-link-color.js.map +1 -1
  77. package/build-module/components/global-styles/screen-text-color.js +2 -1
  78. package/build-module/components/global-styles/screen-text-color.js.map +1 -1
  79. package/build-module/components/global-styles/screen-typography-element.js +41 -0
  80. package/build-module/components/global-styles/screen-typography-element.js.map +1 -0
  81. package/build-module/components/global-styles/screen-typography.js +70 -6
  82. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  83. package/build-module/components/global-styles/typography-panel.js +28 -8
  84. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  85. package/build-module/components/global-styles/ui.js +11 -0
  86. package/build-module/components/global-styles/ui.js.map +1 -1
  87. package/build-module/components/global-styles/use-global-styles-output.js +2 -2
  88. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  89. package/build-module/components/global-styles/utils.js +1 -1
  90. package/build-module/components/global-styles/utils.js.map +1 -1
  91. package/build-module/components/list/actions/index.js +85 -0
  92. package/build-module/components/list/actions/index.js.map +1 -0
  93. package/build-module/components/list/actions/rename-menu-item.js +101 -0
  94. package/build-module/components/list/actions/rename-menu-item.js.map +1 -0
  95. package/build-module/components/list/added-by.js +166 -0
  96. package/build-module/components/list/added-by.js.map +1 -0
  97. package/build-module/components/list/index.js +15 -3
  98. package/build-module/components/list/index.js.map +1 -1
  99. package/build-module/components/list/table.js +56 -69
  100. package/build-module/components/list/table.js.map +1 -1
  101. package/build-module/components/navigation-sidebar/index.js +11 -12
  102. package/build-module/components/navigation-sidebar/index.js.map +1 -1
  103. package/build-module/components/navigation-sidebar/navigation-panel/index.js +26 -12
  104. package/build-module/components/navigation-sidebar/navigation-panel/index.js.map +1 -1
  105. package/build-module/components/navigation-sidebar/navigation-toggle/index.js +14 -6
  106. package/build-module/components/navigation-sidebar/navigation-toggle/index.js.map +1 -1
  107. package/build-module/index.js +8 -3
  108. package/build-module/index.js.map +1 -1
  109. package/build-module/store/actions.js +48 -19
  110. package/build-module/store/actions.js.map +1 -1
  111. package/build-module/store/selectors.js +21 -3
  112. package/build-module/store/selectors.js.map +1 -1
  113. package/build-style/style-rtl.css +136 -17
  114. package/build-style/style.css +136 -17
  115. package/package.json +10 -8
  116. package/src/components/add-new-template/new-template-part.js +32 -17
  117. package/src/components/add-new-template/new-template.js +39 -19
  118. package/src/components/block-editor/index.js +2 -0
  119. package/src/components/global-styles/color-palette-panel.js +5 -5
  120. package/src/components/global-styles/gradients-palette-panel.js +79 -0
  121. package/src/components/global-styles/hooks.js +4 -4
  122. package/src/components/global-styles/palette.js +30 -10
  123. package/src/components/global-styles/screen-background-color.js +1 -0
  124. package/src/components/global-styles/screen-color-palette.js +30 -3
  125. package/src/components/global-styles/screen-link-color.js +1 -0
  126. package/src/components/global-styles/screen-text-color.js +1 -0
  127. package/src/components/global-styles/screen-typography-element.js +39 -0
  128. package/src/components/global-styles/screen-typography.js +84 -3
  129. package/src/components/global-styles/style.scss +33 -0
  130. package/src/components/global-styles/test/use-global-styles-output.js +1 -1
  131. package/src/components/global-styles/test/utils.js +1 -1
  132. package/src/components/global-styles/typography-panel.js +37 -7
  133. package/src/components/global-styles/ui.js +9 -0
  134. package/src/components/global-styles/use-global-styles-output.js +2 -2
  135. package/src/components/global-styles/utils.js +1 -1
  136. package/src/components/list/actions/index.js +95 -0
  137. package/src/components/list/actions/rename-menu-item.js +134 -0
  138. package/src/components/list/added-by.js +179 -0
  139. package/src/components/list/index.js +27 -11
  140. package/src/components/list/style.scss +106 -11
  141. package/src/components/list/table.js +64 -75
  142. package/src/components/navigation-sidebar/index.js +9 -16
  143. package/src/components/navigation-sidebar/navigation-panel/index.js +25 -9
  144. package/src/components/navigation-sidebar/navigation-toggle/index.js +29 -17
  145. package/src/components/navigation-sidebar/navigation-toggle/test/index.js +2 -0
  146. package/src/components/sidebar/style.scss +2 -1
  147. package/src/index.js +10 -2
  148. package/src/store/actions.js +82 -34
  149. package/src/store/selectors.js +22 -4
  150. package/src/store/test/actions.js +0 -24
  151. package/src/store/test/selectors.js +24 -0
@@ -0,0 +1,101 @@
1
+ import { createElement, Fragment } from "@wordpress/element";
2
+
3
+ /**
4
+ * WordPress dependencies
5
+ */
6
+ import { __ } from '@wordpress/i18n';
7
+ import { useState } from '@wordpress/element';
8
+ import { useDispatch, useSelect } from '@wordpress/data';
9
+ import { Button, Flex, FlexItem, MenuItem, Modal, TextControl } from '@wordpress/components';
10
+ import { store as coreStore } from '@wordpress/core-data';
11
+ import { store as noticesStore } from '@wordpress/notices';
12
+ export default function RenameMenuItem(_ref) {
13
+ let {
14
+ template,
15
+ onClose
16
+ } = _ref;
17
+ const [title, setTitle] = useState(() => template.title.rendered);
18
+ const [isModalOpen, setIsModalOpen] = useState(false);
19
+ const {
20
+ getLastEntitySaveError
21
+ } = useSelect(coreStore);
22
+ const {
23
+ editEntityRecord,
24
+ saveEditedEntityRecord
25
+ } = useDispatch(coreStore);
26
+ const {
27
+ createSuccessNotice,
28
+ createErrorNotice
29
+ } = useDispatch(noticesStore);
30
+
31
+ if (!template.is_custom) {
32
+ return null;
33
+ }
34
+
35
+ async function onTemplateRename(event) {
36
+ event.preventDefault();
37
+
38
+ try {
39
+ await editEntityRecord('postType', template.type, template.id, {
40
+ title
41
+ }); // Update state before saving rerenders the list.
42
+
43
+ setTitle('');
44
+ setIsModalOpen(false);
45
+ onClose(); // Persist edited entity.
46
+
47
+ await saveEditedEntityRecord('postType', template.type, template.id);
48
+ const lastError = getLastEntitySaveError('postType', template.type, template.id);
49
+
50
+ if (lastError) {
51
+ throw lastError;
52
+ }
53
+
54
+ createSuccessNotice(__('Template has been renamed.'), {
55
+ type: 'snackbar'
56
+ });
57
+ } catch (error) {
58
+ const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : __('An error occurred while renaming the template.');
59
+ createErrorNotice(errorMessage, {
60
+ type: 'snackbar'
61
+ });
62
+ }
63
+ }
64
+
65
+ return createElement(Fragment, null, createElement(MenuItem, {
66
+ onClick: () => {
67
+ setIsModalOpen(true);
68
+ setTitle(template.title.rendered);
69
+ }
70
+ }, __('Rename')), isModalOpen && createElement(Modal, {
71
+ title: __('Rename template'),
72
+ closeLabel: __('Close'),
73
+ onRequestClose: () => {
74
+ setIsModalOpen(false);
75
+ },
76
+ overlayClassName: "edit-site-list__rename-modal"
77
+ }, createElement("form", {
78
+ onSubmit: onTemplateRename
79
+ }, createElement(Flex, {
80
+ align: "flex-start",
81
+ gap: 8
82
+ }, createElement(FlexItem, null, createElement(TextControl, {
83
+ label: __('Name'),
84
+ value: title,
85
+ onChange: setTitle,
86
+ required: true
87
+ }))), createElement(Flex, {
88
+ className: "edit-site-list__rename-modal-actions",
89
+ justify: "flex-end",
90
+ expanded: false
91
+ }, createElement(FlexItem, null, createElement(Button, {
92
+ variant: "tertiary",
93
+ onClick: () => {
94
+ setIsModalOpen(false);
95
+ }
96
+ }, __('Cancel'))), createElement(FlexItem, null, createElement(Button, {
97
+ variant: "primary",
98
+ type: "submit"
99
+ }, __('Save')))))));
100
+ }
101
+ //# sourceMappingURL=rename-menu-item.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/list/actions/rename-menu-item.js"],"names":["__","useState","useDispatch","useSelect","Button","Flex","FlexItem","MenuItem","Modal","TextControl","store","coreStore","noticesStore","RenameMenuItem","template","onClose","title","setTitle","rendered","isModalOpen","setIsModalOpen","getLastEntitySaveError","editEntityRecord","saveEditedEntityRecord","createSuccessNotice","createErrorNotice","is_custom","onTemplateRename","event","preventDefault","type","id","lastError","error","errorMessage","message","code"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,QAAT,QAAyB,oBAAzB;AACA,SAASC,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SACCC,MADD,EAECC,I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KAFT;AAGC,IAAA,QAAQ,EAAGC,QAHZ;AAIC,IAAA,QAAQ;AAJT,IADD,CADD,CADD,EAYC,cAAC,IAAD;AACC,IAAA,SAAS,EAAC,sCADX;AAEC,IAAA,OAAO,EAAC,UAFT;AAGC,IAAA,QAAQ,EAAG;AAHZ,KAKC,cAAC,QAAD,QACC,cAAC,MAAD;AACC,IAAA,OAAO,EAAC,UADT;AAEC,IAAA,OAAO,EAAG,MAAM;AACfG,MAAAA,cAAc,CAAE,KAAF,CAAd;AACA;AAJF,KAMGpB,EAAE,CAAE,QAAF,CANL,CADD,CALD,EAeC,cAAC,QAAD,QACC,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAC,SAAhB;AAA0B,IAAA,IAAI,EAAC;AAA/B,KACGA,EAAE,CAAE,MAAF,CADL,CADD,CAfD,CAZD,CARD,CAVF,CADD;AAyDA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tButton,\n\tFlex,\n\tFlexItem,\n\tMenuItem,\n\tModal,\n\tTextControl,\n} from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as noticesStore } from '@wordpress/notices';\n\nexport default function RenameMenuItem( { template, onClose } ) {\n\tconst [ title, setTitle ] = useState( () => template.title.rendered );\n\tconst [ isModalOpen, setIsModalOpen ] = useState( false );\n\n\tconst { getLastEntitySaveError } = useSelect( coreStore );\n\tconst { editEntityRecord, saveEditedEntityRecord } = useDispatch(\n\t\tcoreStore\n\t);\n\tconst { createSuccessNotice, createErrorNotice } = useDispatch(\n\t\tnoticesStore\n\t);\n\n\tif ( ! template.is_custom ) {\n\t\treturn null;\n\t}\n\n\tasync function onTemplateRename( event ) {\n\t\tevent.preventDefault();\n\n\t\ttry {\n\t\t\tawait editEntityRecord( 'postType', template.type, template.id, {\n\t\t\t\ttitle,\n\t\t\t} );\n\n\t\t\t// Update state before saving rerenders the list.\n\t\t\tsetTitle( '' );\n\t\t\tsetIsModalOpen( false );\n\t\t\tonClose();\n\n\t\t\t// Persist edited entity.\n\t\t\tawait saveEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\ttemplate.type,\n\t\t\t\ttemplate.id\n\t\t\t);\n\n\t\t\tconst lastError = getLastEntitySaveError(\n\t\t\t\t'postType',\n\t\t\t\ttemplate.type,\n\t\t\t\ttemplate.id\n\t\t\t);\n\n\t\t\tif ( lastError ) {\n\t\t\t\tthrow lastError;\n\t\t\t}\n\n\t\t\tcreateSuccessNotice( __( 'Template has been renamed.' ), {\n\t\t\t\ttype: 'snackbar',\n\t\t\t} );\n\t\t} catch ( error ) {\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __( 'An error occurred while renaming the template.' );\n\n\t\t\tcreateErrorNotice( errorMessage, { type: 'snackbar' } );\n\t\t}\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<MenuItem\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetIsModalOpen( true );\n\t\t\t\t\tsetTitle( template.title.rendered );\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ __( 'Rename' ) }\n\t\t\t</MenuItem>\n\t\t\t{ isModalOpen && (\n\t\t\t\t<Modal\n\t\t\t\t\ttitle={ __( 'Rename template' ) }\n\t\t\t\t\tcloseLabel={ __( 'Close' ) }\n\t\t\t\t\tonRequestClose={ () => {\n\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t} }\n\t\t\t\t\toverlayClassName=\"edit-site-list__rename-modal\"\n\t\t\t\t>\n\t\t\t\t\t<form onSubmit={ onTemplateRename }>\n\t\t\t\t\t\t<Flex align=\"flex-start\" gap={ 8 }>\n\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\t\t\t\t\tvalue={ title }\n\t\t\t\t\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t</Flex>\n\n\t\t\t\t\t\t<Flex\n\t\t\t\t\t\t\tclassName=\"edit-site-list__rename-modal-actions\"\n\t\t\t\t\t\t\tjustify=\"flex-end\"\n\t\t\t\t\t\t\texpanded={ false }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t<Button variant=\"primary\" type=\"submit\">\n\t\t\t\t\t\t\t\t\t{ __( 'Save' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t</Flex>\n\t\t\t\t\t</form>\n\t\t\t\t</Modal>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"]}
@@ -0,0 +1,166 @@
1
+ import { createElement } from "@wordpress/element";
2
+
3
+ /**
4
+ * External dependencies
5
+ */
6
+ import classnames from 'classnames';
7
+ /**
8
+ * WordPress dependencies
9
+ */
10
+
11
+ import { __experimentalHStack as HStack, Icon, Tooltip } from '@wordpress/components';
12
+ import { store as coreStore } from '@wordpress/core-data';
13
+ import { useSelect } from '@wordpress/data';
14
+ import { useState } from '@wordpress/element';
15
+ import { layout as themeIcon, plugins as pluginIcon } from '@wordpress/icons';
16
+ import { __ } from '@wordpress/i18n';
17
+ const TEMPLATE_POST_TYPE_NAMES = ['wp_template', 'wp_template_part'];
18
+
19
+ function CustomizedTooltip(_ref) {
20
+ let {
21
+ isCustomized,
22
+ children
23
+ } = _ref;
24
+
25
+ if (!isCustomized) {
26
+ return children;
27
+ }
28
+
29
+ return createElement(Tooltip, {
30
+ text: __('This template has been customized')
31
+ }, children);
32
+ }
33
+
34
+ function AddedByTheme(_ref2) {
35
+ var _theme$name;
36
+
37
+ let {
38
+ slug,
39
+ isCustomized
40
+ } = _ref2;
41
+ const theme = useSelect(select => select(coreStore).getTheme(slug), [slug]);
42
+ return createElement(HStack, {
43
+ alignment: "left"
44
+ }, createElement(CustomizedTooltip, {
45
+ isCustomized: isCustomized
46
+ }, createElement("div", {
47
+ className: classnames('edit-site-list-added-by__icon', {
48
+ 'is-customized': isCustomized
49
+ })
50
+ }, createElement(Icon, {
51
+ icon: themeIcon
52
+ }))), createElement("span", null, (theme === null || theme === void 0 ? void 0 : (_theme$name = theme.name) === null || _theme$name === void 0 ? void 0 : _theme$name.rendered) || slug));
53
+ }
54
+
55
+ function AddedByPlugin(_ref3) {
56
+ let {
57
+ slug,
58
+ isCustomized
59
+ } = _ref3;
60
+ const plugin = useSelect(select => select(coreStore).getPlugin(slug), [slug]);
61
+ return createElement(HStack, {
62
+ alignment: "left"
63
+ }, createElement(CustomizedTooltip, {
64
+ isCustomized: isCustomized
65
+ }, createElement("div", {
66
+ className: "edit-site-list-added-by__icon"
67
+ }, createElement(Icon, {
68
+ icon: pluginIcon
69
+ }))), createElement("span", null, (plugin === null || plugin === void 0 ? void 0 : plugin.name) || slug));
70
+ }
71
+
72
+ function AddedByAuthor(_ref4) {
73
+ let {
74
+ id
75
+ } = _ref4;
76
+ const user = useSelect(select => select(coreStore).getUser(id), [id]);
77
+ const [isImageLoaded, setIsImageLoaded] = useState(false);
78
+ return createElement(HStack, {
79
+ alignment: "left"
80
+ }, createElement("div", {
81
+ className: classnames('edit-site-list-added-by__avatar', {
82
+ 'is-loaded': isImageLoaded
83
+ })
84
+ }, createElement("img", {
85
+ onLoad: () => setIsImageLoaded(true),
86
+ alt: "",
87
+ src: user === null || user === void 0 ? void 0 : user.avatar_urls[48]
88
+ })), createElement("span", null, user === null || user === void 0 ? void 0 : user.nickname));
89
+ }
90
+
91
+ function AddedBySite() {
92
+ const {
93
+ name,
94
+ logoURL
95
+ } = useSelect(select => {
96
+ var _getMedia;
97
+
98
+ const {
99
+ getEntityRecord,
100
+ getMedia
101
+ } = select(coreStore);
102
+ const siteData = getEntityRecord('root', '__unstableBase');
103
+ return {
104
+ name: siteData.name,
105
+ logoURL: siteData !== null && siteData !== void 0 && siteData.site_logo ? (_getMedia = getMedia(siteData.site_logo)) === null || _getMedia === void 0 ? void 0 : _getMedia.source_url : undefined
106
+ };
107
+ }, []);
108
+ const [isImageLoaded, setIsImageLoaded] = useState(false);
109
+ return createElement(HStack, {
110
+ alignment: "left"
111
+ }, createElement("div", {
112
+ className: classnames('edit-site-list-added-by__avatar', {
113
+ 'is-loaded': isImageLoaded
114
+ })
115
+ }, createElement("img", {
116
+ onLoad: () => setIsImageLoaded(true),
117
+ alt: "",
118
+ src: logoURL
119
+ })), createElement("span", null, name));
120
+ }
121
+
122
+ export default function AddedBy(_ref5) {
123
+ let {
124
+ templateType,
125
+ template
126
+ } = _ref5;
127
+
128
+ if (!template) {
129
+ return;
130
+ }
131
+
132
+ if (TEMPLATE_POST_TYPE_NAMES.includes(templateType)) {
133
+ // Template originally provided by a theme, but customized by a user.
134
+ // Templates originally didn't have the 'origin' field so identify
135
+ // older customized templates by checking for no origin and a 'theme'
136
+ // or 'custom' source.
137
+ if (template.has_theme_file && (template.origin === 'theme' || !template.origin && ['theme', 'custom'].includes(template.source))) {
138
+ return createElement(AddedByTheme, {
139
+ slug: template.theme,
140
+ isCustomized: template.source === 'custom'
141
+ });
142
+ } // Template originally provided by a plugin, but customized by a user.
143
+
144
+
145
+ if (template.has_theme_file && template.origin === 'plugin') {
146
+ return createElement(AddedByPlugin, {
147
+ slug: template.theme,
148
+ isCustomized: template.source === 'custom'
149
+ });
150
+ } // Template was created from scratch, but has no author. Author support
151
+ // was only added to templates in WordPress 5.9. Fallback to showing the
152
+ // site logo and title.
153
+
154
+
155
+ if (!template.has_theme_file && template.source === 'custom' && !template.author) {
156
+ return createElement(AddedBySite, null);
157
+ }
158
+ } // Simply show the author for templates created from scratch that have an
159
+ // author or for any other post type.
160
+
161
+
162
+ return createElement(AddedByAuthor, {
163
+ id: template.author
164
+ });
165
+ }
166
+ //# sourceMappingURL=added-by.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/list/added-by.js"],"names":["classnames","__experimentalHStack","HStack","Icon","Tooltip","store","coreStore","useSelect","useState","layout","themeIcon","plugins","pluginIcon","__","TEMPLATE_POST_TYPE_NAMES","CustomizedTooltip","isCustomized","children","AddedByTheme","slug","theme","select","getTheme","name","rendered","AddedByPlugin","plugin","getPlugin","AddedByAuthor","id","user","getUser","isImageLoaded","setIsImageLoaded","avatar_urls","nickname","AddedBySite","logoURL","getEntityRecord","getMedia","siteData","site_logo","source_url","undefined","AddedBy","templateType","template","includes","has_theme_file","origin","source","author"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SACCC,oBAAoB,IAAIC,MADzB,EAECC,IAFD,EAGCC,OAHD,QAIO,uBAJP;AAKA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,QAAT,QAAyB,oBAAzB;AACA,SAASC,MAAM,IAAIC,SAAnB,EAA8BC,OAAO,IAAIC,UAAzC,QAA2D,kBAA3D;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA,MAAMC,wBAAwB,GAAG,CAAE,aAAF,EAAiB,kBAAjB,CAAjC;;AAEA,SAASC,iBAAT,OAAyD;AAAA,MAA7B;AAAEC,IAAAA,YAAF;AAAgBC,IAAAA;AAAhB,GAA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AAI,EAAGH,QAAQ,CAAC1B,KADjB;AAEC,QAAA,YAAY,EAAG0B,QAAQ,CAACI,MAAT,KAAoB;AAFpC,QADD;AAMA,KA3BuD,CA6BxD;AACA;AACA;;;AACA,QACC,CAAEJ,QAAQ,CAACE,cAAX,IACAF,QAAQ,CAACI,MAAT,KAAoB,QADpB,IAEA,CAAEJ,QAAQ,CAACK,MAHZ,EAIE;AACD,aAAO,cAAC,WAAD,OAAP;AACA;AACD,GA5C4D,CA8C7D;AACA;;;AACA,SAAO,cAAC,aAAD;AAAe,IAAA,EAAE,EAAGL,QAAQ,CAACK;AAA7B,IAAP;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\tIcon,\n\tTooltip,\n} from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\nimport { layout as themeIcon, plugins as pluginIcon } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\n\nconst TEMPLATE_POST_TYPE_NAMES = [ 'wp_template', 'wp_template_part' ];\n\nfunction CustomizedTooltip( { isCustomized, children } ) {\n\tif ( ! isCustomized ) {\n\t\treturn children;\n\t}\n\n\treturn (\n\t\t<Tooltip text={ __( 'This template has been customized' ) }>\n\t\t\t{ children }\n\t\t</Tooltip>\n\t);\n}\n\nfunction AddedByTheme( { slug, isCustomized } ) {\n\tconst theme = useSelect(\n\t\t( select ) => select( coreStore ).getTheme( slug ),\n\t\t[ slug ]\n\t);\n\n\treturn (\n\t\t<HStack alignment=\"left\">\n\t\t\t<CustomizedTooltip isCustomized={ isCustomized }>\n\t\t\t\t<div\n\t\t\t\t\tclassName={ classnames( 'edit-site-list-added-by__icon', {\n\t\t\t\t\t\t'is-customized': isCustomized,\n\t\t\t\t\t} ) }\n\t\t\t\t>\n\t\t\t\t\t<Icon icon={ themeIcon } />\n\t\t\t\t</div>\n\t\t\t</CustomizedTooltip>\n\t\t\t<span>{ theme?.name?.rendered || slug }</span>\n\t\t</HStack>\n\t);\n}\n\nfunction AddedByPlugin( { slug, isCustomized } ) {\n\tconst plugin = useSelect(\n\t\t( select ) => select( coreStore ).getPlugin( slug ),\n\t\t[ slug ]\n\t);\n\n\treturn (\n\t\t<HStack alignment=\"left\">\n\t\t\t<CustomizedTooltip isCustomized={ isCustomized }>\n\t\t\t\t<div className=\"edit-site-list-added-by__icon\">\n\t\t\t\t\t<Icon icon={ pluginIcon } />\n\t\t\t\t</div>\n\t\t\t</CustomizedTooltip>\n\t\t\t<span>{ plugin?.name || slug }</span>\n\t\t</HStack>\n\t);\n}\n\nfunction AddedByAuthor( { id } ) {\n\tconst user = useSelect( ( select ) => select( coreStore ).getUser( id ), [\n\t\tid,\n\t] );\n\tconst [ isImageLoaded, setIsImageLoaded ] = useState( false );\n\n\treturn (\n\t\t<HStack alignment=\"left\">\n\t\t\t<div\n\t\t\t\tclassName={ classnames( 'edit-site-list-added-by__avatar', {\n\t\t\t\t\t'is-loaded': isImageLoaded,\n\t\t\t\t} ) }\n\t\t\t>\n\t\t\t\t<img\n\t\t\t\t\tonLoad={ () => setIsImageLoaded( true ) }\n\t\t\t\t\talt=\"\"\n\t\t\t\t\tsrc={ user?.avatar_urls[ 48 ] }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<span>{ user?.nickname }</span>\n\t\t</HStack>\n\t);\n}\n\nfunction AddedBySite() {\n\tconst { name, logoURL } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord, getMedia } = select( coreStore );\n\t\tconst siteData = getEntityRecord( 'root', '__unstableBase' );\n\n\t\treturn {\n\t\t\tname: siteData.name,\n\t\t\tlogoURL: siteData?.site_logo\n\t\t\t\t? getMedia( siteData.site_logo )?.source_url\n\t\t\t\t: undefined,\n\t\t};\n\t}, [] );\n\tconst [ isImageLoaded, setIsImageLoaded ] = useState( false );\n\n\treturn (\n\t\t<HStack alignment=\"left\">\n\t\t\t<div\n\t\t\t\tclassName={ classnames( 'edit-site-list-added-by__avatar', {\n\t\t\t\t\t'is-loaded': isImageLoaded,\n\t\t\t\t} ) }\n\t\t\t>\n\t\t\t\t<img\n\t\t\t\t\tonLoad={ () => setIsImageLoaded( true ) }\n\t\t\t\t\talt=\"\"\n\t\t\t\t\tsrc={ logoURL }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<span>{ name }</span>\n\t\t</HStack>\n\t);\n}\n\nexport default function AddedBy( { templateType, template } ) {\n\tif ( ! template ) {\n\t\treturn;\n\t}\n\n\tif ( TEMPLATE_POST_TYPE_NAMES.includes( templateType ) ) {\n\t\t// Template originally provided by a theme, but customized by a user.\n\t\t// Templates originally didn't have the 'origin' field so identify\n\t\t// older customized templates by checking for no origin and a 'theme'\n\t\t// or 'custom' source.\n\t\tif (\n\t\t\ttemplate.has_theme_file &&\n\t\t\t( template.origin === 'theme' ||\n\t\t\t\t( ! template.origin &&\n\t\t\t\t\t[ 'theme', 'custom' ].includes( template.source ) ) )\n\t\t) {\n\t\t\treturn (\n\t\t\t\t<AddedByTheme\n\t\t\t\t\tslug={ template.theme }\n\t\t\t\t\tisCustomized={ template.source === 'custom' }\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\t// Template originally provided by a plugin, but customized by a user.\n\t\tif ( template.has_theme_file && template.origin === 'plugin' ) {\n\t\t\treturn (\n\t\t\t\t<AddedByPlugin\n\t\t\t\t\tslug={ template.theme }\n\t\t\t\t\tisCustomized={ template.source === 'custom' }\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\t// Template was created from scratch, but has no author. Author support\n\t\t// was only added to templates in WordPress 5.9. Fallback to showing the\n\t\t// site logo and title.\n\t\tif (\n\t\t\t! template.has_theme_file &&\n\t\t\ttemplate.source === 'custom' &&\n\t\t\t! template.author\n\t\t) {\n\t\t\treturn <AddedBySite />;\n\t\t}\n\t}\n\n\t// Simply show the author for templates created from scratch that have an\n\t// author or for any other post type.\n\treturn <AddedByAuthor id={ template.author } />;\n}\n"]}
@@ -1,13 +1,19 @@
1
1
  import { createElement } from "@wordpress/element";
2
2
 
3
+ /**
4
+ * External dependencies
5
+ */
6
+ import classnames from 'classnames';
3
7
  /**
4
8
  * WordPress dependencies
5
9
  */
10
+
6
11
  import { store as coreStore } from '@wordpress/core-data';
7
12
  import { useSelect } from '@wordpress/data';
8
13
  import { InterfaceSkeleton } from '@wordpress/interface';
9
14
  import { __, sprintf } from '@wordpress/i18n';
10
15
  import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
16
+ import { EditorSnackbars } from '@wordpress/editor';
11
17
  /**
12
18
  * Internal dependencies
13
19
  */
@@ -16,6 +22,7 @@ import useRegisterShortcuts from './use-register-shortcuts';
16
22
  import Header from './header';
17
23
  import NavigationSidebar from '../navigation-sidebar';
18
24
  import Table from './table';
25
+ import { store as editSiteStore } from '../../store';
19
26
  export default function List(_ref) {
20
27
  var _postType$labels;
21
28
 
@@ -25,11 +32,13 @@ export default function List(_ref) {
25
32
  useRegisterShortcuts();
26
33
  const {
27
34
  previousShortcut,
28
- nextShortcut
35
+ nextShortcut,
36
+ isNavigationOpen
29
37
  } = useSelect(select => {
30
38
  return {
31
39
  previousShortcut: select(keyboardShortcutsStore).getAllShortcutKeyCombinations('core/edit-site/previous-region'),
32
- nextShortcut: select(keyboardShortcutsStore).getAllShortcutKeyCombinations('core/edit-site/next-region')
40
+ nextShortcut: select(keyboardShortcutsStore).getAllShortcutKeyCombinations('core/edit-site/next-region'),
41
+ isNavigationOpen: select(editSiteStore).isNavigationOpened()
33
42
  };
34
43
  }, []);
35
44
  const postType = useSelect(select => select(coreStore).getPostType(templateType), [templateType]); // `postType` could load in asynchronously. Only provide the detailed region labels if
@@ -43,7 +52,9 @@ export default function List(_ref) {
43
52
  __('%s - Content'), itemsListLabel)
44
53
  } : undefined;
45
54
  return createElement(InterfaceSkeleton, {
46
- className: "edit-site-list",
55
+ className: classnames('edit-site-list', {
56
+ 'is-navigation-open': isNavigationOpen
57
+ }),
47
58
  labels: {
48
59
  drawer: __('Navigation Sidebar'),
49
60
  ...detailedRegionLabels
@@ -55,6 +66,7 @@ export default function List(_ref) {
55
66
  activeTemplateType: templateType,
56
67
  isDefaultOpen: true
57
68
  }),
69
+ notices: createElement(EditorSnackbars, null),
58
70
  content: createElement("main", {
59
71
  className: "edit-site-list-main"
60
72
  }, createElement(Table, {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/list/index.js"],"names":["store","coreStore","useSelect","InterfaceSkeleton","__","sprintf","keyboardShortcutsStore","useRegisterShortcuts","Header","NavigationSidebar","Table","List","templateType","previousShortcut","nextShortcut","select","getAllShortcutKeyCombinations","postType","getPostType","itemsListLabel","labels","items_list","detailedRegionLabels","header","body","undefined","drawer","previous","next"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,iBAAT,QAAkC,sBAAlC;AACA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SAASL,KAAK,IAAIM,sBAAlB,QAAgD,+BAAhD;AAEA;AACA;AACA;;AACA,OAAOC,oBAAP,MAAiC,0BAAjC;AACA,OAAOC,MAAP,MAAmB,UAAnB;AACA,OAAOC,iBAAP,MAA8B,uBAA9B;AACA,OAAOC,KAAP,MAAkB,SAAlB;AAEA,eAAe,SAASC,IAAT,OAAkC;AAAA;;AAAA,MAAnB;AAAEC,IAAAA;AAAF,GAAmB;AAChDL,EAAAA,oBAAoB;AAEpB,QAAM;AAAEM,IAAAA,gBAAF;AAAoBC,IAAAA;AAApB,MAAqCZ,SAAS,CAAIa,MAAF,IAAc;AACnE,WAAO;AACNF,MAAAA,gBAAgB,EAAEE,MAAM,CACvBT,sBADuB,CAAN,CAEhBU,6BAFgB,CAEe,gCAFf,CADZ;AAINF,MAAAA,YAAY,EAAEC,MAAM,CACnBT,sBADmB,CAAN,CAEZU,6BAFY,CAEmB,4BAFnB;AAJR,KAAP;AAQA,GATmD,EASjD,EATiD,CAApD;AAWA,QAAMC,QAAQ,GAAGf,SAAS,CACvBa,MAAF,IAAcA,MAAM,CAAEd,SAAF,CAAN,CAAoBiB,WAApB,CAAiCN,YAAjC,CADW,EAEzB,CAAEA,YAAF,CAFyB,CAA1B,CAdgD,CAmBhD;AACA;;AACA,QAAMO,cAAc,GAAGF,QAAH,aAAGA,QAAH,2CAAGA,QAAQ,CAAEG,MAAb,qDAAG,iBAAkBC,UAAzC;AACA,QAAMC,oBAAoB,GAAGL,QAAQ,GAClC;AACAM,IAAAA,MAAM,EAAElB,OAAO,EACd;AACAD,IAAAA,EAAE,CAAE,aAAF,CAFY,EAGde,cAHc,CADf;AAMAK,IAAAA,IAAI,EAAEnB,OAAO,EACZ;AACAD,IAAAA,EAAE,CAAE,cAAF,CAFU,EAGZe,cAHY;AANb,GADkC,GAalCM,SAbH;AAeA,SACC,cAAC,iBAAD;AACC,IAAA,SAAS,EAAC,gBADX;AAEC,IAAA,MAAM,EAAG;AACRC,MAAAA,MAAM,EAAEtB,EAAE,CAAE,oBAAF,CADF;AAER,SAAGkB;AAFK,KAFV;AAMC,IAAA,MAAM,EAAG,cAAC,MAAD;AAAQ,MAAA,YAAY,EAAGV;AAAvB,MANV;AAOC,IAAA,MAAM,EACL,cAAC,iBAAD;AACC,MAAA,kBAAkB,EAAGA,YADtB;AAEC,MAAA,aAAa;AAFd,MARF;AAaC,IAAA,OAAO,EACN;AAAM,MAAA,SAAS,EAAC;AAAhB,OACC,cAAC,KAAD;AAAO,MAAA,YAAY,EAAGA;AAAtB,MADD,CAdF;AAkBC,IAAA,SAAS,EAAG;AACXe,MAAAA,QAAQ,EAAEd,gBADC;AAEXe,MAAAA,IAAI,EAAEd;AAFK;AAlBb,IADD;AAyBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { InterfaceSkeleton } from '@wordpress/interface';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\n\n/**\n * Internal dependencies\n */\nimport useRegisterShortcuts from './use-register-shortcuts';\nimport Header from './header';\nimport NavigationSidebar from '../navigation-sidebar';\nimport Table from './table';\n\nexport default function List( { templateType } ) {\n\tuseRegisterShortcuts();\n\n\tconst { previousShortcut, nextShortcut } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tpreviousShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/edit-site/previous-region' ),\n\t\t\tnextShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/edit-site/next-region' ),\n\t\t};\n\t}, [] );\n\n\tconst postType = useSelect(\n\t\t( select ) => select( coreStore ).getPostType( templateType ),\n\t\t[ templateType ]\n\t);\n\n\t// `postType` could load in asynchronously. Only provide the detailed region labels if\n\t// the postType has loaded, otherwise `InterfaceSkeleton` will fallback to the defaults.\n\tconst itemsListLabel = postType?.labels?.items_list;\n\tconst detailedRegionLabels = postType\n\t\t? {\n\t\t\t\theader: sprintf(\n\t\t\t\t\t// translators: %s - the name of the page, 'Header' as in the header area of that page.\n\t\t\t\t\t__( '%s - Header' ),\n\t\t\t\t\titemsListLabel\n\t\t\t\t),\n\t\t\t\tbody: sprintf(\n\t\t\t\t\t// translators: %s - the name of the page, 'Content' as in the content area of that page.\n\t\t\t\t\t__( '%s - Content' ),\n\t\t\t\t\titemsListLabel\n\t\t\t\t),\n\t\t }\n\t\t: undefined;\n\n\treturn (\n\t\t<InterfaceSkeleton\n\t\t\tclassName=\"edit-site-list\"\n\t\t\tlabels={ {\n\t\t\t\tdrawer: __( 'Navigation Sidebar' ),\n\t\t\t\t...detailedRegionLabels,\n\t\t\t} }\n\t\t\theader={ <Header templateType={ templateType } /> }\n\t\t\tdrawer={\n\t\t\t\t<NavigationSidebar\n\t\t\t\t\tactiveTemplateType={ templateType }\n\t\t\t\t\tisDefaultOpen\n\t\t\t\t/>\n\t\t\t}\n\t\t\tcontent={\n\t\t\t\t<main className=\"edit-site-list-main\">\n\t\t\t\t\t<Table templateType={ templateType } />\n\t\t\t\t</main>\n\t\t\t}\n\t\t\tshortcuts={ {\n\t\t\t\tprevious: previousShortcut,\n\t\t\t\tnext: nextShortcut,\n\t\t\t} }\n\t\t/>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/list/index.js"],"names":["classnames","store","coreStore","useSelect","InterfaceSkeleton","__","sprintf","keyboardShortcutsStore","EditorSnackbars","useRegisterShortcuts","Header","NavigationSidebar","Table","editSiteStore","List","templateType","previousShortcut","nextShortcut","isNavigationOpen","select","getAllShortcutKeyCombinations","isNavigationOpened","postType","getPostType","itemsListLabel","labels","items_list","detailedRegionLabels","header","body","undefined","drawer","previous","next"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,iBAAT,QAAkC,sBAAlC;AACA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SAASL,KAAK,IAAIM,sBAAlB,QAAgD,+BAAhD;AACA,SAASC,eAAT,QAAgC,mBAAhC;AAEA;AACA;AACA;;AACA,OAAOC,oBAAP,MAAiC,0BAAjC;AACA,OAAOC,MAAP,MAAmB,UAAnB;AACA,OAAOC,iBAAP,MAA8B,uBAA9B;AACA,OAAOC,KAAP,MAAkB,SAAlB;AACA,SAASX,KAAK,IAAIY,aAAlB,QAAuC,aAAvC;AAEA,eAAe,SAASC,IAAT,OAAkC;AAAA;;AAAA,MAAnB;AAAEC,IAAAA;AAAF,GAAmB;AAChDN,EAAAA,oBAAoB;AAEpB,QAAM;AAAEO,IAAAA,gBAAF;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AC,iBAAD;AACC,MAAA,kBAAkB,EAAGA,YADtB;AAEC,MAAA,aAAa;AAFd,MAVF;AAeC,IAAA,OAAO,EAAG,cAAC,eAAD,OAfX;AAgBC,IAAA,OAAO,EACN;AAAM,MAAA,SAAS,EAAC;AAAhB,OACC,cAAC,KAAD;AAAO,MAAA,YAAY,EAAGA;AAAtB,MADD,CAjBF;AAqBC,IAAA,SAAS,EAAG;AACXiB,MAAAA,QAAQ,EAAEhB,gBADC;AAEXiB,MAAAA,IAAI,EAAEhB;AAFK;AArBb,IADD;AA4BA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { InterfaceSkeleton } from '@wordpress/interface';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { EditorSnackbars } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport useRegisterShortcuts from './use-register-shortcuts';\nimport Header from './header';\nimport NavigationSidebar from '../navigation-sidebar';\nimport Table from './table';\nimport { store as editSiteStore } from '../../store';\n\nexport default function List( { templateType } ) {\n\tuseRegisterShortcuts();\n\n\tconst { previousShortcut, nextShortcut, isNavigationOpen } = useSelect(\n\t\t( select ) => {\n\t\t\treturn {\n\t\t\t\tpreviousShortcut: select(\n\t\t\t\t\tkeyboardShortcutsStore\n\t\t\t\t).getAllShortcutKeyCombinations(\n\t\t\t\t\t'core/edit-site/previous-region'\n\t\t\t\t),\n\t\t\t\tnextShortcut: select(\n\t\t\t\t\tkeyboardShortcutsStore\n\t\t\t\t).getAllShortcutKeyCombinations( 'core/edit-site/next-region' ),\n\t\t\t\tisNavigationOpen: select( editSiteStore ).isNavigationOpened(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst postType = useSelect(\n\t\t( select ) => select( coreStore ).getPostType( templateType ),\n\t\t[ templateType ]\n\t);\n\n\t// `postType` could load in asynchronously. Only provide the detailed region labels if\n\t// the postType has loaded, otherwise `InterfaceSkeleton` will fallback to the defaults.\n\tconst itemsListLabel = postType?.labels?.items_list;\n\tconst detailedRegionLabels = postType\n\t\t? {\n\t\t\t\theader: sprintf(\n\t\t\t\t\t// translators: %s - the name of the page, 'Header' as in the header area of that page.\n\t\t\t\t\t__( '%s - Header' ),\n\t\t\t\t\titemsListLabel\n\t\t\t\t),\n\t\t\t\tbody: sprintf(\n\t\t\t\t\t// translators: %s - the name of the page, 'Content' as in the content area of that page.\n\t\t\t\t\t__( '%s - Content' ),\n\t\t\t\t\titemsListLabel\n\t\t\t\t),\n\t\t }\n\t\t: undefined;\n\n\treturn (\n\t\t<InterfaceSkeleton\n\t\t\tclassName={ classnames( 'edit-site-list', {\n\t\t\t\t'is-navigation-open': isNavigationOpen,\n\t\t\t} ) }\n\t\t\tlabels={ {\n\t\t\t\tdrawer: __( 'Navigation Sidebar' ),\n\t\t\t\t...detailedRegionLabels,\n\t\t\t} }\n\t\t\theader={ <Header templateType={ templateType } /> }\n\t\t\tdrawer={\n\t\t\t\t<NavigationSidebar\n\t\t\t\t\tactiveTemplateType={ templateType }\n\t\t\t\t\tisDefaultOpen\n\t\t\t\t/>\n\t\t\t}\n\t\t\tnotices={ <EditorSnackbars /> }\n\t\t\tcontent={\n\t\t\t\t<main className=\"edit-site-list-main\">\n\t\t\t\t\t<Table templateType={ templateType } />\n\t\t\t\t</main>\n\t\t\t}\n\t\t\tshortcuts={ {\n\t\t\t\tprevious: previousShortcut,\n\t\t\t\tnext: nextShortcut,\n\t\t\t} }\n\t\t/>\n\t);\n}\n"]}
@@ -3,39 +3,21 @@ import { createElement } from "@wordpress/element";
3
3
  /**
4
4
  * WordPress dependencies
5
5
  */
6
- import { useSelect, useDispatch } from '@wordpress/data';
6
+ import { useSelect } from '@wordpress/data';
7
7
  import { store as coreStore } from '@wordpress/core-data';
8
8
  import { __, sprintf } from '@wordpress/i18n';
9
- import { VisuallyHidden, FlexItem, __experimentalHStack as HStack, __experimentalHeading as Heading, DropdownMenu, MenuGroup, MenuItem } from '@wordpress/components';
10
- import { moreVertical } from '@wordpress/icons';
9
+ import { VisuallyHidden, __experimentalHeading as Heading } from '@wordpress/components';
11
10
  import { addQueryArgs } from '@wordpress/url';
12
11
  /**
13
12
  * Internal dependencies
14
13
  */
15
14
 
16
- import { store as editSiteStore } from '../../store';
17
- import isTemplateRemovable from '../../utils/is-template-removable';
18
-
19
- function Actions(_ref) {
20
- let {
21
- template,
22
- onClose
23
- } = _ref;
24
- const {
25
- removeTemplate
26
- } = useDispatch(editSiteStore);
27
- return createElement(MenuGroup, null, createElement(MenuItem, {
28
- onClick: () => {
29
- removeTemplate(template);
30
- onClose();
31
- }
32
- }, __('Remove template')));
33
- }
34
-
35
- export default function Table(_ref2) {
15
+ import Actions from './actions';
16
+ import AddedBy from './added-by';
17
+ export default function Table(_ref) {
36
18
  let {
37
19
  templateType
38
- } = _ref2;
20
+ } = _ref;
39
21
  const {
40
22
  templates,
41
23
  isLoading,
@@ -47,8 +29,12 @@ export default function Table(_ref2) {
47
29
  getPostType
48
30
  } = select(coreStore);
49
31
  return {
50
- templates: getEntityRecords('postType', templateType),
51
- isLoading: !hasFinishedResolution('getEntityRecords', ['postType', templateType]),
32
+ templates: getEntityRecords('postType', templateType, {
33
+ per_page: -1
34
+ }),
35
+ isLoading: !hasFinishedResolution('getEntityRecords', ['postType', templateType, {
36
+ per_page: -1
37
+ }]),
52
38
  postType: getPostType(templateType)
53
39
  };
54
40
  }, [templateType]);
@@ -64,48 +50,49 @@ export default function Table(_ref2) {
64
50
  __('No %s found.'), postType === null || postType === void 0 ? void 0 : (_postType$labels = postType.labels) === null || _postType$labels === void 0 ? void 0 : (_postType$labels$name = _postType$labels.name) === null || _postType$labels$name === void 0 ? void 0 : _postType$labels$name.toLowerCase()));
65
51
  }
66
52
 
67
- return createElement("ul", {
68
- className: "edit-site-list-table"
69
- }, createElement(HStack, {
70
- className: "edit-site-list-table-head",
71
- as: "li"
72
- }, createElement(FlexItem, {
73
- className: "edit-site-list-table-column"
74
- }, createElement(Heading, {
75
- level: 4
76
- }, __('Template'))), createElement(FlexItem, {
77
- className: "edit-site-list-table-column"
78
- }, createElement(Heading, {
79
- level: 4
80
- }, __('Added by'))), createElement(FlexItem, {
81
- className: "edit-site-list-table-column"
82
- }, createElement(VisuallyHidden, null, __('Actions')))), templates.map(template => createElement("li", {
83
- key: template.id
84
- }, createElement(HStack, {
85
- className: "edit-site-list-table-row"
86
- }, createElement(FlexItem, {
87
- className: "edit-site-list-table-column"
88
- }, createElement("a", {
89
- href: addQueryArgs(window.location.href, {
90
- postId: template.id,
91
- postType: template.type
92
- })
93
- }, template.title.rendered), template.description), createElement(FlexItem, {
94
- className: "edit-site-list-table-column"
95
- }, template.theme), createElement(FlexItem, {
96
- className: "edit-site-list-table-column"
97
- }, isTemplateRemovable(template) && createElement(DropdownMenu, {
98
- icon: moreVertical,
99
- label: __('Actions'),
100
- className: "edit-site-list-table__actions"
101
- }, _ref3 => {
102
- let {
103
- onClose
104
- } = _ref3;
105
- return createElement(Actions, {
106
- template: template,
107
- onClose: onClose
108
- });
109
- }))))));
53
+ return (// These explicit aria roles are needed for Safari.
54
+ // See https://developer.mozilla.org/en-US/docs/Web/CSS/display#tables
55
+ createElement("table", {
56
+ className: "edit-site-list-table",
57
+ role: "table"
58
+ }, createElement("thead", null, createElement("tr", {
59
+ className: "edit-site-list-table-head",
60
+ role: "row"
61
+ }, createElement("th", {
62
+ className: "edit-site-list-table-column",
63
+ role: "columnheader"
64
+ }, __('Template')), createElement("th", {
65
+ className: "edit-site-list-table-column",
66
+ role: "columnheader"
67
+ }, __('Added by')), createElement("th", {
68
+ className: "edit-site-list-table-column",
69
+ role: "columnheader"
70
+ }, createElement(VisuallyHidden, null, __('Actions'))))), createElement("tbody", null, templates.map(template => createElement("tr", {
71
+ key: template.id,
72
+ className: "edit-site-list-table-row",
73
+ role: "row"
74
+ }, createElement("td", {
75
+ className: "edit-site-list-table-column",
76
+ role: "cell"
77
+ }, createElement(Heading, {
78
+ level: 4
79
+ }, createElement("a", {
80
+ href: addQueryArgs(window.location.href, {
81
+ postId: template.id,
82
+ postType: template.type
83
+ })
84
+ }, template.title.rendered)), template.description), createElement("td", {
85
+ className: "edit-site-list-table-column",
86
+ role: "cell"
87
+ }, createElement(AddedBy, {
88
+ templateType: templateType,
89
+ template: template
90
+ })), createElement("td", {
91
+ className: "edit-site-list-table-column",
92
+ role: "cell"
93
+ }, createElement(Actions, {
94
+ template: template
95
+ }))))))
96
+ );
110
97
  }
111
98
  //# sourceMappingURL=table.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/list/table.js"],"names":["useSelect","useDispatch","store","coreStore","__","sprintf","VisuallyHidden","FlexItem","__experimentalHStack","HStack","__experimentalHeading","Heading","DropdownMenu","MenuGroup","MenuItem","moreVertical","addQueryArgs","editSiteStore","isTemplateRemovable","Actions","template","onClose","removeTemplate","Table","templateType","templates","isLoading","postType","select","getEntityRecords","hasFinishedResolution","getPostType","length","labels","name","toLowerCase","map","id","window","location","href","postId","type","title","rendered","description","theme"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AACA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SACCC,cADD,EAECC,QAFD,EAGCC,oBAAoB,IAAIC,MAHzB,EAICC,qBAAqB,IAAIC,OAJ1B,EAKCC,YALD,EAMCC,SAND,EAOCC,QAPD,QAQO,uBARP;AASA,SAASC,YAAT,QAA6B,kBAA7B;AACA,SAASC,YAAT,QAA6B,gBAA7B;AAEA;AACA;AACA;;AACA,SAASd,KAAK,IAAIe,aAAlB,QAAuC,aAAvC;AACA,OAAOC,mBAAP,MAAgC,mCAAhC;;AAEA,SAASC,OAAT,OAA0C;AAAA,MAAx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,IAAA,SAAS,EAAC;AAHX,KAKG;AAAA,QAAE;AAAEiB,MAAAA;AAAF,KAAF;AAAA,WACD,cAAC,OAAD;AACC,MAAA,QAAQ,EAAGD,QADZ;AAEC,MAAA,OAAO,EAAGC;AAFX,MADC;AAAA,GALH,CAFF,CAhBD,CADD,CADC,CAbH,CADD;AAqDA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tVisuallyHidden,\n\tFlexItem,\n\t__experimentalHStack as HStack,\n\t__experimentalHeading as Heading,\n\tDropdownMenu,\n\tMenuGroup,\n\tMenuItem,\n} from '@wordpress/components';\nimport { moreVertical } from '@wordpress/icons';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport isTemplateRemovable from '../../utils/is-template-removable';\n\nfunction Actions( { template, onClose } ) {\n\tconst { removeTemplate } = useDispatch( editSiteStore );\n\n\treturn (\n\t\t<MenuGroup>\n\t\t\t<MenuItem\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tremoveTemplate( template );\n\t\t\t\t\tonClose();\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ __( 'Remove template' ) }\n\t\t\t</MenuItem>\n\t\t</MenuGroup>\n\t);\n}\n\nexport default function Table( { templateType } ) {\n\tconst { templates, isLoading, postType } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetEntityRecords,\n\t\t\t\thasFinishedResolution,\n\t\t\t\tgetPostType,\n\t\t\t} = select( coreStore );\n\n\t\t\treturn {\n\t\t\t\ttemplates: getEntityRecords( 'postType', templateType ),\n\t\t\t\tisLoading: ! hasFinishedResolution( 'getEntityRecords', [\n\t\t\t\t\t'postType',\n\t\t\t\t\ttemplateType,\n\t\t\t\t] ),\n\t\t\t\tpostType: getPostType( templateType ),\n\t\t\t};\n\t\t},\n\t\t[ templateType ]\n\t);\n\n\tif ( ! templates || isLoading ) {\n\t\treturn null;\n\t}\n\n\tif ( ! templates.length ) {\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t{ sprintf(\n\t\t\t\t\t// translators: The template type name, should be either \"templates\" or \"template parts\".\n\t\t\t\t\t__( 'No %s found.' ),\n\t\t\t\t\tpostType?.labels?.name?.toLowerCase()\n\t\t\t\t) }\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<ul className=\"edit-site-list-table\">\n\t\t\t<HStack className=\"edit-site-list-table-head\" as=\"li\">\n\t\t\t\t<FlexItem className=\"edit-site-list-table-column\">\n\t\t\t\t\t<Heading level={ 4 }>{ __( 'Template' ) }</Heading>\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem className=\"edit-site-list-table-column\">\n\t\t\t\t\t<Heading level={ 4 }>{ __( 'Added by' ) }</Heading>\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem className=\"edit-site-list-table-column\">\n\t\t\t\t\t<VisuallyHidden>{ __( 'Actions' ) }</VisuallyHidden>\n\t\t\t\t</FlexItem>\n\t\t\t</HStack>\n\n\t\t\t{ templates.map( ( template ) => (\n\t\t\t\t<li key={ template.id }>\n\t\t\t\t\t<HStack className=\"edit-site-list-table-row\">\n\t\t\t\t\t\t<FlexItem className=\"edit-site-list-table-column\">\n\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\thref={ addQueryArgs( window.location.href, {\n\t\t\t\t\t\t\t\t\tpostId: template.id,\n\t\t\t\t\t\t\t\t\tpostType: template.type,\n\t\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ template.title.rendered }\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t{ template.description }\n\t\t\t\t\t\t</FlexItem>\n\n\t\t\t\t\t\t<FlexItem className=\"edit-site-list-table-column\">\n\t\t\t\t\t\t\t{ template.theme }\n\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t<FlexItem className=\"edit-site-list-table-column\">\n\t\t\t\t\t\t\t{ isTemplateRemovable( template ) && (\n\t\t\t\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Actions' ) }\n\t\t\t\t\t\t\t\t\tclassName=\"edit-site-list-table__actions\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t\t\t\t\t<Actions\n\t\t\t\t\t\t\t\t\t\t\ttemplate={ template }\n\t\t\t\t\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</DropdownMenu>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t</HStack>\n\t\t\t\t</li>\n\t\t\t) ) }\n\t\t</ul>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/list/table.js"],"names":["useSelect","store","coreStore","__","sprintf","VisuallyHidden","__experimentalHeading","Heading","addQueryArgs","Actions","AddedBy","Table","templateType","templates","isLoading","postType","select","getEntityRecords","hasFinishedResolution","getPostType","per_page","length","labels","name","toLowerCase","map","template","id","window","location","href","postId","type","title","rendered","description"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,iBAA1B;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AACA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SACCC,cADD,EAECC,qBAAqB,IAAIC,OAF1B,QAGO,uBAHP;AAIA,SAASC,YAAT,QAA6B,gBAA7B;AAEA;AACA;AACA;;AACA,OAAOC,OAAP,MAAoB,WAApB;AACA,OAAOC,OAAP,MAAoB,YAApB;AAEA,eAAe,SAASC,KAAT,OAAmC;AAAA,MAAnB;AAAEC,IAAA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S,EAAC,6BADX;AAEC,MAAA,IAAI,EAAC;AAFN,OAIGA,EAAE,CAAE,UAAF,CAJL,CAPD,EAaC;AACC,MAAA,SAAS,EAAC,6BADX;AAEC,MAAA,IAAI,EAAC;AAFN,OAIC,cAAC,cAAD,QAAkBA,EAAE,CAAE,SAAF,CAApB,CAJD,CAbD,CADD,CADD,EAwBC,6BACGU,SAAS,CAACY,GAAV,CAAiBC,QAAF,IAChB;AACC,MAAA,GAAG,EAAGA,QAAQ,CAACC,EADhB;AAEC,MAAA,SAAS,EAAC,0BAFX;AAGC,MAAA,IAAI,EAAC;AAHN,OAKC;AAAI,MAAA,SAAS,EAAC,6BAAd;AAA4C,MAAA,IAAI,EAAC;AAAjD,OACC,cAAC,OAAD;AAAS,MAAA,KAAK,EAAG;AAAjB,OACC;AACC,MAAA,IAAI,EAAGnB,YAAY,CAAEoB,MAAM,CAACC,QAAP,CAAgBC,IAAlB,EAAwB;AAC1CC,QAAAA,MAAM,EAAEL,QAAQ,CAACC,EADyB;AAE1CZ,QAAAA,QAAQ,EAAEW,QAAQ,CAACM;AAFuB,OAAxB;AADpB,OAMGN,QAAQ,CAACO,KAAT,CAAeC,QANlB,CADD,CADD,EAWGR,QAAQ,CAACS,WAXZ,CALD,EAmBC;AAAI,MAAA,SAAS,EAAC,6BAAd;AAA4C,MAAA,IAAI,EAAC;AAAjD,OACC,cAAC,OAAD;AACC,MAAA,YAAY,EAAGvB,YADhB;AAEC,MAAA,QAAQ,EAAGc;AAFZ,MADD,CAnBD,EAyBC;AAAI,MAAA,SAAS,EAAC,6BAAd;AAA4C,MAAA,IAAI,EAAC;AAAjD,OACC,cAAC,OAAD;AAAS,MAAA,QAAQ,EAAGA;AAApB,MADD,CAzBD,CADC,CADH,CAxBD;AAHD;AA8DA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tVisuallyHidden,\n\t__experimentalHeading as Heading,\n} from '@wordpress/components';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport Actions from './actions';\nimport AddedBy from './added-by';\n\nexport default function Table( { templateType } ) {\n\tconst { templates, isLoading, postType } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetEntityRecords,\n\t\t\t\thasFinishedResolution,\n\t\t\t\tgetPostType,\n\t\t\t} = select( coreStore );\n\n\t\t\treturn {\n\t\t\t\ttemplates: getEntityRecords( 'postType', templateType, {\n\t\t\t\t\tper_page: -1,\n\t\t\t\t} ),\n\t\t\t\tisLoading: ! hasFinishedResolution( 'getEntityRecords', [\n\t\t\t\t\t'postType',\n\t\t\t\t\ttemplateType,\n\t\t\t\t\t{ per_page: -1 },\n\t\t\t\t] ),\n\t\t\t\tpostType: getPostType( templateType ),\n\t\t\t};\n\t\t},\n\t\t[ templateType ]\n\t);\n\n\tif ( ! templates || isLoading ) {\n\t\treturn null;\n\t}\n\n\tif ( ! templates.length ) {\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t{ sprintf(\n\t\t\t\t\t// translators: The template type name, should be either \"templates\" or \"template parts\".\n\t\t\t\t\t__( 'No %s found.' ),\n\t\t\t\t\tpostType?.labels?.name?.toLowerCase()\n\t\t\t\t) }\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t// These explicit aria roles are needed for Safari.\n\t\t// See https://developer.mozilla.org/en-US/docs/Web/CSS/display#tables\n\t\t<table className=\"edit-site-list-table\" role=\"table\">\n\t\t\t<thead>\n\t\t\t\t<tr className=\"edit-site-list-table-head\" role=\"row\">\n\t\t\t\t\t<th\n\t\t\t\t\t\tclassName=\"edit-site-list-table-column\"\n\t\t\t\t\t\trole=\"columnheader\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Template' ) }\n\t\t\t\t\t</th>\n\t\t\t\t\t<th\n\t\t\t\t\t\tclassName=\"edit-site-list-table-column\"\n\t\t\t\t\t\trole=\"columnheader\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Added by' ) }\n\t\t\t\t\t</th>\n\t\t\t\t\t<th\n\t\t\t\t\t\tclassName=\"edit-site-list-table-column\"\n\t\t\t\t\t\trole=\"columnheader\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<VisuallyHidden>{ __( 'Actions' ) }</VisuallyHidden>\n\t\t\t\t\t</th>\n\t\t\t\t</tr>\n\t\t\t</thead>\n\n\t\t\t<tbody>\n\t\t\t\t{ templates.map( ( template ) => (\n\t\t\t\t\t<tr\n\t\t\t\t\t\tkey={ template.id }\n\t\t\t\t\t\tclassName=\"edit-site-list-table-row\"\n\t\t\t\t\t\trole=\"row\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<td className=\"edit-site-list-table-column\" role=\"cell\">\n\t\t\t\t\t\t\t<Heading level={ 4 }>\n\t\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\t\thref={ addQueryArgs( window.location.href, {\n\t\t\t\t\t\t\t\t\t\tpostId: template.id,\n\t\t\t\t\t\t\t\t\t\tpostType: template.type,\n\t\t\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ template.title.rendered }\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</Heading>\n\t\t\t\t\t\t\t{ template.description }\n\t\t\t\t\t\t</td>\n\n\t\t\t\t\t\t<td className=\"edit-site-list-table-column\" role=\"cell\">\n\t\t\t\t\t\t\t<AddedBy\n\t\t\t\t\t\t\t\ttemplateType={ templateType }\n\t\t\t\t\t\t\t\ttemplate={ template }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td className=\"edit-site-list-table-column\" role=\"cell\">\n\t\t\t\t\t\t\t<Actions template={ template } />\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t) ) }\n\t\t\t</tbody>\n\t\t</table>\n\t);\n}\n"]}