@wordpress/block-library 9.7.1-next.5368f64a9.0 → 9.8.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 (132) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/categories/edit.js +38 -17
  3. package/build/categories/edit.js.map +1 -1
  4. package/build/categories/index.js +10 -3
  5. package/build/categories/index.js.map +1 -1
  6. package/build/categories/variations.js +43 -0
  7. package/build/categories/variations.js.map +1 -0
  8. package/build/embed/edit.js +1 -0
  9. package/build/embed/edit.js.map +1 -1
  10. package/build/embed/edit.native.js +1 -0
  11. package/build/embed/edit.native.js.map +1 -1
  12. package/build/embed/embed-preview.js +80 -100
  13. package/build/embed/embed-preview.js.map +1 -1
  14. package/build/embed/embed-preview.native.js +1 -0
  15. package/build/embed/embed-preview.native.js.map +1 -1
  16. package/build/form/view.js +1 -0
  17. package/build/form/view.js.map +1 -1
  18. package/build/form-input/deprecated.js +113 -1
  19. package/build/form-input/deprecated.js.map +1 -1
  20. package/build/form-input/edit.js +16 -12
  21. package/build/form-input/edit.js.map +1 -1
  22. package/build/form-input/save.js +9 -1
  23. package/build/form-input/save.js.map +1 -1
  24. package/build/image/image.js +5 -2
  25. package/build/image/image.js.map +1 -1
  26. package/build/index.js +1 -0
  27. package/build/index.js.map +1 -1
  28. package/build/navigation-submenu/index.js +13 -0
  29. package/build/navigation-submenu/index.js.map +1 -1
  30. package/build/post-template/edit.js +6 -1
  31. package/build/post-template/edit.js.map +1 -1
  32. package/build/post-title/index.js +1 -4
  33. package/build/post-title/index.js.map +1 -1
  34. package/build/query/edit/inspector-controls/format-controls.js +102 -0
  35. package/build/query/edit/inspector-controls/format-controls.js.map +1 -0
  36. package/build/query/edit/inspector-controls/index.js +45 -9
  37. package/build/query/edit/inspector-controls/index.js.map +1 -1
  38. package/build/query/edit/query-content.js +26 -10
  39. package/build/query/edit/query-content.js.map +1 -1
  40. package/build/query/index.js +3 -1
  41. package/build/query/index.js.map +1 -1
  42. package/build/query/utils.js +12 -1
  43. package/build/query/utils.js.map +1 -1
  44. package/build/site-title/index.js +1 -4
  45. package/build/site-title/index.js.map +1 -1
  46. package/build/social-link/edit.js +13 -11
  47. package/build/social-link/edit.js.map +1 -1
  48. package/build-module/categories/edit.js +40 -19
  49. package/build-module/categories/edit.js.map +1 -1
  50. package/build-module/categories/index.js +10 -3
  51. package/build-module/categories/index.js.map +1 -1
  52. package/build-module/categories/variations.js +36 -0
  53. package/build-module/categories/variations.js.map +1 -0
  54. package/build-module/embed/edit.js +1 -0
  55. package/build-module/embed/edit.js.map +1 -1
  56. package/build-module/embed/edit.native.js +1 -0
  57. package/build-module/embed/edit.native.js.map +1 -1
  58. package/build-module/embed/embed-preview.js +80 -100
  59. package/build-module/embed/embed-preview.js.map +1 -1
  60. package/build-module/embed/embed-preview.native.js +1 -0
  61. package/build-module/embed/embed-preview.native.js.map +1 -1
  62. package/build-module/form/view.js +1 -0
  63. package/build-module/form/view.js.map +1 -1
  64. package/build-module/form-input/deprecated.js +114 -2
  65. package/build-module/form-input/deprecated.js.map +1 -1
  66. package/build-module/form-input/edit.js +16 -12
  67. package/build-module/form-input/edit.js.map +1 -1
  68. package/build-module/form-input/save.js +9 -1
  69. package/build-module/form-input/save.js.map +1 -1
  70. package/build-module/image/image.js +5 -2
  71. package/build-module/image/image.js.map +1 -1
  72. package/build-module/index.js +1 -0
  73. package/build-module/index.js.map +1 -1
  74. package/build-module/navigation-submenu/index.js +13 -0
  75. package/build-module/navigation-submenu/index.js.map +1 -1
  76. package/build-module/post-template/edit.js +6 -1
  77. package/build-module/post-template/edit.js.map +1 -1
  78. package/build-module/post-title/index.js +1 -4
  79. package/build-module/post-title/index.js.map +1 -1
  80. package/build-module/query/edit/inspector-controls/format-controls.js +96 -0
  81. package/build-module/query/edit/inspector-controls/format-controls.js.map +1 -0
  82. package/build-module/query/edit/inspector-controls/index.js +45 -9
  83. package/build-module/query/edit/inspector-controls/index.js.map +1 -1
  84. package/build-module/query/edit/query-content.js +27 -11
  85. package/build-module/query/edit/query-content.js.map +1 -1
  86. package/build-module/query/index.js +3 -1
  87. package/build-module/query/index.js.map +1 -1
  88. package/build-module/query/utils.js +12 -1
  89. package/build-module/query/utils.js.map +1 -1
  90. package/build-module/site-title/index.js +1 -4
  91. package/build-module/site-title/index.js.map +1 -1
  92. package/build-module/social-link/edit.js +14 -12
  93. package/build-module/social-link/edit.js.map +1 -1
  94. package/build-style/editor-rtl.css +1 -1
  95. package/build-style/editor.css +1 -1
  96. package/build-style/form-input/style-rtl.css +7 -8
  97. package/build-style/form-input/style.css +7 -8
  98. package/build-style/gallery/editor-rtl.css +1 -1
  99. package/build-style/gallery/editor.css +1 -1
  100. package/build-style/post-title/style-rtl.css +4 -18
  101. package/build-style/post-title/style.css +4 -18
  102. package/build-style/site-title/style-rtl.css +4 -18
  103. package/build-style/site-title/style.css +4 -18
  104. package/build-style/style-rtl.css +15 -44
  105. package/build-style/style.css +15 -44
  106. package/package.json +35 -35
  107. package/src/categories/block.json +7 -2
  108. package/src/categories/edit.js +69 -30
  109. package/src/categories/index.js +2 -0
  110. package/src/categories/index.php +21 -9
  111. package/src/categories/variations.js +40 -0
  112. package/src/comments-pagination-next/index.php +1 -1
  113. package/src/comments-pagination-previous/index.php +2 -1
  114. package/src/embed/embed-preview.js +96 -112
  115. package/src/form-input/deprecated.js +114 -1
  116. package/src/form-input/edit.js +17 -11
  117. package/src/form-input/save.js +13 -3
  118. package/src/form-input/style.scss +9 -8
  119. package/src/image/image.js +2 -1
  120. package/src/navigation-submenu/block.json +13 -0
  121. package/src/post-template/edit.js +6 -0
  122. package/src/post-template/index.php +5 -0
  123. package/src/post-title/block.json +1 -4
  124. package/src/post-title/style.scss +4 -21
  125. package/src/query/block.json +3 -1
  126. package/src/query/edit/inspector-controls/format-controls.js +90 -0
  127. package/src/query/edit/inspector-controls/index.js +68 -9
  128. package/src/query/edit/query-content.js +38 -5
  129. package/src/query/utils.js +16 -1
  130. package/src/site-title/block.json +1 -4
  131. package/src/site-title/style.scss +4 -21
  132. package/src/social-link/edit.js +11 -7
@@ -6,11 +6,11 @@ import clsx from 'clsx';
6
6
  /**
7
7
  * WordPress dependencies
8
8
  */
9
- import { PanelBody, Placeholder, Spinner, ToggleControl, VisuallyHidden } from '@wordpress/components';
9
+ import { PanelBody, Placeholder, SelectControl, Spinner, ToggleControl, VisuallyHidden } from '@wordpress/components';
10
10
  import { useInstanceId } from '@wordpress/compose';
11
11
  import { InspectorControls, useBlockProps, RichText } from '@wordpress/block-editor';
12
12
  import { decodeEntities } from '@wordpress/html-entities';
13
- import { __ } from '@wordpress/i18n';
13
+ import { __, sprintf } from '@wordpress/i18n';
14
14
  import { pin } from '@wordpress/icons';
15
15
  import { useEntityRecords } from '@wordpress/core-data';
16
16
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -24,24 +24,32 @@ export default function CategoriesEdit({
24
24
  showOnlyTopLevel,
25
25
  showEmpty,
26
26
  label,
27
- showLabel
27
+ showLabel,
28
+ taxonomy: taxonomySlug
28
29
  },
29
30
  setAttributes,
30
31
  className
31
32
  }) {
32
33
  const selectId = useInstanceId(CategoriesEdit, 'blocks-category-select');
34
+ const {
35
+ records: allTaxonomies,
36
+ isResolvingTaxonomies
37
+ } = useEntityRecords('root', 'taxonomy');
38
+ const taxonomies = allTaxonomies?.filter(t => t.visibility.public);
39
+ const taxonomy = taxonomies?.find(t => t.slug === taxonomySlug);
40
+ const isHierarchicalTaxonomy = !isResolvingTaxonomies && taxonomy?.hierarchical;
33
41
  const query = {
34
42
  per_page: -1,
35
43
  hide_empty: !showEmpty,
36
44
  context: 'view'
37
45
  };
38
- if (showOnlyTopLevel) {
46
+ if (isHierarchicalTaxonomy && showOnlyTopLevel) {
39
47
  query.parent = 0;
40
48
  }
41
49
  const {
42
50
  records: categories,
43
51
  isResolving
44
- } = useEntityRecords('taxonomy', 'category', query);
52
+ } = useEntityRecords('taxonomy', taxonomySlug, query);
45
53
  const getCategoriesList = parentId => {
46
54
  if (!categories?.length) {
47
55
  return [];
@@ -58,7 +66,7 @@ export default function CategoriesEdit({
58
66
  });
59
67
  const renderCategoryName = name => !name ? __('(Untitled)') : decodeEntities(name).trim();
60
68
  const renderCategoryList = () => {
61
- const parentId = showHierarchy ? 0 : null;
69
+ const parentId = isHierarchicalTaxonomy && showHierarchy ? 0 : null;
62
70
  const categoriesList = getCategoriesList(parentId);
63
71
  return categoriesList.map(category => renderCategoryListItem(category));
64
72
  };
@@ -77,20 +85,20 @@ export default function CategoriesEdit({
77
85
  target: "_blank",
78
86
  rel: "noreferrer noopener",
79
87
  children: renderCategoryName(name)
80
- }), showPostCounts && ` (${count})`, showHierarchy && !!childCategories.length && /*#__PURE__*/_jsx("ul", {
88
+ }), showPostCounts && ` (${count})`, isHierarchicalTaxonomy && showHierarchy && !!childCategories.length && /*#__PURE__*/_jsx("ul", {
81
89
  className: "children",
82
90
  children: childCategories.map(childCategory => renderCategoryListItem(childCategory))
83
91
  })]
84
92
  }, id);
85
93
  };
86
94
  const renderCategoryDropdown = () => {
87
- const parentId = showHierarchy ? 0 : null;
95
+ const parentId = isHierarchicalTaxonomy && showHierarchy ? 0 : null;
88
96
  const categoriesList = getCategoriesList(parentId);
89
97
  return /*#__PURE__*/_jsxs(_Fragment, {
90
98
  children: [showLabel ? /*#__PURE__*/_jsx(RichText, {
91
99
  className: "wp-block-categories__label",
92
100
  "aria-label": __('Label text'),
93
- placeholder: __('Categories'),
101
+ placeholder: taxonomy.name,
94
102
  withoutInteractiveFormatting: true,
95
103
  value: label,
96
104
  onChange: html => setAttributes({
@@ -99,11 +107,12 @@ export default function CategoriesEdit({
99
107
  }) : /*#__PURE__*/_jsx(VisuallyHidden, {
100
108
  as: "label",
101
109
  htmlFor: selectId,
102
- children: label ? label : __('Categories')
110
+ children: label ? label : taxonomy.name
103
111
  }), /*#__PURE__*/_jsxs("select", {
104
112
  id: selectId,
105
113
  children: [/*#__PURE__*/_jsx("option", {
106
- children: __('Select Category')
114
+ children: sprintf( /* translators: %s: taxonomy's singular name */
115
+ __('Select %s'), taxonomy.labels.singular_name)
107
116
  }), categoriesList.map(category => renderCategoryDropdownItem(category, 0))]
108
117
  })]
109
118
  });
@@ -120,7 +129,7 @@ export default function CategoriesEdit({
120
129
  children: [Array.from({
121
130
  length: level * 3
122
131
  }).map(() => '\xa0'), renderCategoryName(name), showPostCounts && ` (${count})`]
123
- }, id), showHierarchy && !!childCategories.length && childCategories.map(childCategory => renderCategoryDropdownItem(childCategory, level + 1))];
132
+ }, id), isHierarchicalTaxonomy && showHierarchy && !!childCategories.length && childCategories.map(childCategory => renderCategoryDropdownItem(childCategory, level + 1))];
124
133
  };
125
134
  const TagName = !!categories?.length && !displayAsDropdown && !isResolving ? 'ul' : 'div';
126
135
  const classes = clsx(className, {
@@ -135,7 +144,19 @@ export default function CategoriesEdit({
135
144
  children: [/*#__PURE__*/_jsx(InspectorControls, {
136
145
  children: /*#__PURE__*/_jsxs(PanelBody, {
137
146
  title: __('Settings'),
138
- children: [/*#__PURE__*/_jsx(ToggleControl, {
147
+ children: [Array.isArray(taxonomies) && /*#__PURE__*/_jsx(SelectControl, {
148
+ __nextHasNoMarginBottom: true,
149
+ __next40pxDefaultSize: true,
150
+ label: __('Taxonomy'),
151
+ options: taxonomies.map(t => ({
152
+ label: t.name,
153
+ value: t.slug
154
+ })),
155
+ value: taxonomySlug,
156
+ onChange: selectedTaxonomy => setAttributes({
157
+ taxonomy: selectedTaxonomy
158
+ })
159
+ }), /*#__PURE__*/_jsx(ToggleControl, {
139
160
  __nextHasNoMarginBottom: true,
140
161
  label: __('Display as dropdown'),
141
162
  checked: displayAsDropdown,
@@ -151,17 +172,17 @@ export default function CategoriesEdit({
151
172
  label: __('Show post counts'),
152
173
  checked: showPostCounts,
153
174
  onChange: toggleAttribute('showPostCounts')
154
- }), /*#__PURE__*/_jsx(ToggleControl, {
175
+ }), isHierarchicalTaxonomy && /*#__PURE__*/_jsx(ToggleControl, {
155
176
  __nextHasNoMarginBottom: true,
156
- label: __('Show only top level categories'),
177
+ label: __('Show only top level terms'),
157
178
  checked: showOnlyTopLevel,
158
179
  onChange: toggleAttribute('showOnlyTopLevel')
159
180
  }), /*#__PURE__*/_jsx(ToggleControl, {
160
181
  __nextHasNoMarginBottom: true,
161
- label: __('Show empty categories'),
182
+ label: __('Show empty terms'),
162
183
  checked: showEmpty,
163
184
  onChange: toggleAttribute('showEmpty')
164
- }), !showOnlyTopLevel && /*#__PURE__*/_jsx(ToggleControl, {
185
+ }), isHierarchicalTaxonomy && !showOnlyTopLevel && /*#__PURE__*/_jsx(ToggleControl, {
165
186
  __nextHasNoMarginBottom: true,
166
187
  label: __('Show hierarchy'),
167
188
  checked: showHierarchy,
@@ -170,10 +191,10 @@ export default function CategoriesEdit({
170
191
  })
171
192
  }), isResolving && /*#__PURE__*/_jsx(Placeholder, {
172
193
  icon: pin,
173
- label: __('Categories'),
194
+ label: __('Terms'),
174
195
  children: /*#__PURE__*/_jsx(Spinner, {})
175
196
  }), !isResolving && categories?.length === 0 && /*#__PURE__*/_jsx("p", {
176
- children: __('Your site does not have any posts, so there is nothing to display here at the moment.')
197
+ children: taxonomy.labels.no_terms
177
198
  }), !isResolving && categories?.length > 0 && (displayAsDropdown ? renderCategoryDropdown() : renderCategoryList())]
178
199
  });
179
200
  }
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","PanelBody","Placeholder","Spinner","ToggleControl","VisuallyHidden","useInstanceId","InspectorControls","useBlockProps","RichText","decodeEntities","__","pin","useEntityRecords","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","CategoriesEdit","attributes","displayAsDropdown","showHierarchy","showPostCounts","showOnlyTopLevel","showEmpty","label","showLabel","setAttributes","className","selectId","query","per_page","hide_empty","context","parent","records","categories","isResolving","getCategoriesList","parentId","length","filter","toggleAttribute","attributeName","newValue","renderCategoryName","name","trim","renderCategoryList","categoriesList","map","category","renderCategoryListItem","childCategories","id","link","count","children","href","target","rel","childCategory","renderCategoryDropdown","placeholder","withoutInteractiveFormatting","value","onChange","html","as","htmlFor","renderCategoryDropdownItem","level","Array","from","TagName","classes","blockProps","title","__nextHasNoMarginBottom","checked","icon"],"sources":["@wordpress/block-library/src/categories/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tPanelBody,\n\tPlaceholder,\n\tSpinner,\n\tToggleControl,\n\tVisuallyHidden,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport {\n\tInspectorControls,\n\tuseBlockProps,\n\tRichText,\n} from '@wordpress/block-editor';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { __ } from '@wordpress/i18n';\nimport { pin } from '@wordpress/icons';\nimport { useEntityRecords } from '@wordpress/core-data';\n\nexport default function CategoriesEdit( {\n\tattributes: {\n\t\tdisplayAsDropdown,\n\t\tshowHierarchy,\n\t\tshowPostCounts,\n\t\tshowOnlyTopLevel,\n\t\tshowEmpty,\n\t\tlabel,\n\t\tshowLabel,\n\t},\n\tsetAttributes,\n\tclassName,\n} ) {\n\tconst selectId = useInstanceId( CategoriesEdit, 'blocks-category-select' );\n\tconst query = { per_page: -1, hide_empty: ! showEmpty, context: 'view' };\n\tif ( showOnlyTopLevel ) {\n\t\tquery.parent = 0;\n\t}\n\n\tconst { records: categories, isResolving } = useEntityRecords(\n\t\t'taxonomy',\n\t\t'category',\n\t\tquery\n\t);\n\n\tconst getCategoriesList = ( parentId ) => {\n\t\tif ( ! categories?.length ) {\n\t\t\treturn [];\n\t\t}\n\t\tif ( parentId === null ) {\n\t\t\treturn categories;\n\t\t}\n\t\treturn categories.filter( ( { parent } ) => parent === parentId );\n\t};\n\n\tconst toggleAttribute = ( attributeName ) => ( newValue ) =>\n\t\tsetAttributes( { [ attributeName ]: newValue } );\n\n\tconst renderCategoryName = ( name ) =>\n\t\t! name ? __( '(Untitled)' ) : decodeEntities( name ).trim();\n\n\tconst renderCategoryList = () => {\n\t\tconst parentId = showHierarchy ? 0 : null;\n\t\tconst categoriesList = getCategoriesList( parentId );\n\t\treturn categoriesList.map( ( category ) =>\n\t\t\trenderCategoryListItem( category )\n\t\t);\n\t};\n\n\tconst renderCategoryListItem = ( category ) => {\n\t\tconst childCategories = getCategoriesList( category.id );\n\t\tconst { id, link, count, name } = category;\n\t\treturn (\n\t\t\t<li key={ id } className={ `cat-item cat-item-${ id }` }>\n\t\t\t\t<a href={ link } target=\"_blank\" rel=\"noreferrer noopener\">\n\t\t\t\t\t{ renderCategoryName( name ) }\n\t\t\t\t</a>\n\t\t\t\t{ showPostCounts && ` (${ count })` }\n\t\t\t\t{ showHierarchy && !! childCategories.length && (\n\t\t\t\t\t<ul className=\"children\">\n\t\t\t\t\t\t{ childCategories.map( ( childCategory ) =>\n\t\t\t\t\t\t\trenderCategoryListItem( childCategory )\n\t\t\t\t\t\t) }\n\t\t\t\t\t</ul>\n\t\t\t\t) }\n\t\t\t</li>\n\t\t);\n\t};\n\n\tconst renderCategoryDropdown = () => {\n\t\tconst parentId = showHierarchy ? 0 : null;\n\t\tconst categoriesList = getCategoriesList( parentId );\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ showLabel ? (\n\t\t\t\t\t<RichText\n\t\t\t\t\t\tclassName=\"wp-block-categories__label\"\n\t\t\t\t\t\taria-label={ __( 'Label text' ) }\n\t\t\t\t\t\tplaceholder={ __( 'Categories' ) }\n\t\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\t\tvalue={ label }\n\t\t\t\t\t\tonChange={ ( html ) =>\n\t\t\t\t\t\t\tsetAttributes( { label: html } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<VisuallyHidden as=\"label\" htmlFor={ selectId }>\n\t\t\t\t\t\t{ label ? label : __( 'Categories' ) }\n\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t) }\n\t\t\t\t<select id={ selectId }>\n\t\t\t\t\t<option>{ __( 'Select Category' ) }</option>\n\t\t\t\t\t{ categoriesList.map( ( category ) =>\n\t\t\t\t\t\trenderCategoryDropdownItem( category, 0 )\n\t\t\t\t\t) }\n\t\t\t\t</select>\n\t\t\t</>\n\t\t);\n\t};\n\n\tconst renderCategoryDropdownItem = ( category, level ) => {\n\t\tconst { id, count, name } = category;\n\t\tconst childCategories = getCategoriesList( id );\n\t\treturn [\n\t\t\t<option key={ id } className={ `level-${ level }` }>\n\t\t\t\t{ Array.from( { length: level * 3 } ).map( () => '\\xa0' ) }\n\t\t\t\t{ renderCategoryName( name ) }\n\t\t\t\t{ showPostCounts && ` (${ count })` }\n\t\t\t</option>,\n\t\t\tshowHierarchy &&\n\t\t\t\t!! childCategories.length &&\n\t\t\t\tchildCategories.map( ( childCategory ) =>\n\t\t\t\t\trenderCategoryDropdownItem( childCategory, level + 1 )\n\t\t\t\t),\n\t\t];\n\t};\n\n\tconst TagName =\n\t\t!! categories?.length && ! displayAsDropdown && ! isResolving\n\t\t\t? 'ul'\n\t\t\t: 'div';\n\n\tconst classes = clsx( className, {\n\t\t'wp-block-categories-list':\n\t\t\t!! categories?.length && ! displayAsDropdown && ! isResolving,\n\t\t'wp-block-categories-dropdown':\n\t\t\t!! categories?.length && displayAsDropdown && ! isResolving,\n\t} );\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classes,\n\t} );\n\n\treturn (\n\t\t<TagName { ...blockProps }>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Display as dropdown' ) }\n\t\t\t\t\t\tchecked={ displayAsDropdown }\n\t\t\t\t\t\tonChange={ toggleAttribute( 'displayAsDropdown' ) }\n\t\t\t\t\t/>\n\t\t\t\t\t{ displayAsDropdown && (\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tclassName=\"wp-block-categories__indentation\"\n\t\t\t\t\t\t\tlabel={ __( 'Show label' ) }\n\t\t\t\t\t\t\tchecked={ showLabel }\n\t\t\t\t\t\t\tonChange={ toggleAttribute( 'showLabel' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Show post counts' ) }\n\t\t\t\t\t\tchecked={ showPostCounts }\n\t\t\t\t\t\tonChange={ toggleAttribute( 'showPostCounts' ) }\n\t\t\t\t\t/>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Show only top level categories' ) }\n\t\t\t\t\t\tchecked={ showOnlyTopLevel }\n\t\t\t\t\t\tonChange={ toggleAttribute( 'showOnlyTopLevel' ) }\n\t\t\t\t\t/>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Show empty categories' ) }\n\t\t\t\t\t\tchecked={ showEmpty }\n\t\t\t\t\t\tonChange={ toggleAttribute( 'showEmpty' ) }\n\t\t\t\t\t/>\n\t\t\t\t\t{ ! showOnlyTopLevel && (\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Show hierarchy' ) }\n\t\t\t\t\t\t\tchecked={ showHierarchy }\n\t\t\t\t\t\t\tonChange={ toggleAttribute( 'showHierarchy' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t{ isResolving && (\n\t\t\t\t<Placeholder icon={ pin } label={ __( 'Categories' ) }>\n\t\t\t\t\t<Spinner />\n\t\t\t\t</Placeholder>\n\t\t\t) }\n\t\t\t{ ! isResolving && categories?.length === 0 && (\n\t\t\t\t<p>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Your site does not have any posts, so there is nothing to display here at the moment.'\n\t\t\t\t\t) }\n\t\t\t\t</p>\n\t\t\t) }\n\t\t\t{ ! isResolving &&\n\t\t\t\tcategories?.length > 0 &&\n\t\t\t\t( displayAsDropdown\n\t\t\t\t\t? renderCategoryDropdown()\n\t\t\t\t\t: renderCategoryList() ) }\n\t\t</TagName>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,SAAS,EACTC,WAAW,EACXC,OAAO,EACPC,aAAa,EACbC,cAAc,QACR,uBAAuB;AAC9B,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SACCC,iBAAiB,EACjBC,aAAa,EACbC,QAAQ,QACF,yBAAyB;AAChC,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,GAAG,QAAQ,kBAAkB;AACtC,SAASC,gBAAgB,QAAQ,sBAAsB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAExD,eAAe,SAASC,cAAcA,CAAE;EACvCC,UAAU,EAAE;IACXC,iBAAiB;IACjBC,aAAa;IACbC,cAAc;IACdC,gBAAgB;IAChBC,SAAS;IACTC,KAAK;IACLC;EACD,CAAC;EACDC,aAAa;EACbC;AACD,CAAC,EAAG;EACH,MAAMC,QAAQ,GAAGzB,aAAa,CAAEc,cAAc,EAAE,wBAAyB,CAAC;EAC1E,MAAMY,KAAK,GAAG;IAAEC,QAAQ,EAAE,CAAC,CAAC;IAAEC,UAAU,EAAE,CAAER,SAAS;IAAES,OAAO,EAAE;EAAO,CAAC;EACxE,IAAKV,gBAAgB,EAAG;IACvBO,KAAK,CAACI,MAAM,GAAG,CAAC;EACjB;EAEA,MAAM;IAAEC,OAAO,EAAEC,UAAU;IAAEC;EAAY,CAAC,GAAG1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;UACzB6C,QAAQ,EAAGxB,eAAe,CAAE,eAAgB;QAAG,CAC/C,CACD;MAAA,CACS;IAAC,CACM,CAAC,EAClBL,WAAW,iBACZxB,IAAA,CAACb,WAAW;MAACgF,IAAI,EAAGtE,GAAK;MAACe,KAAK,EAAGhB,EAAE,CAAE,YAAa,CAAG;MAAAgD,QAAA,eACrD5C,IAAA,CAACZ,OAAO,IAAE;IAAC,CACC,CACb,EACC,CAAEoC,WAAW,IAAID,UAAU,EAAEI,MAAM,KAAK,CAAC,iBAC1C3B,IAAA;MAAA4C,QAAA,EACGhD,EAAE,CACH,uFACD;IAAC,CACC,CACH,EACC,CAAE4B,WAAW,IACdD,UAAU,EAAEI,MAAM,GAAG,CAAC,KACpBpB,iBAAiB,GAChB0C,sBAAsB,CAAC,CAAC,GACxBd,kBAAkB,CAAC,CAAC,CAAE;EAAA,CAClB,CAAC;AAEZ","ignoreList":[]}
1
+ {"version":3,"names":["clsx","PanelBody","Placeholder","SelectControl","Spinner","ToggleControl","VisuallyHidden","useInstanceId","InspectorControls","useBlockProps","RichText","decodeEntities","__","sprintf","pin","useEntityRecords","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","CategoriesEdit","attributes","displayAsDropdown","showHierarchy","showPostCounts","showOnlyTopLevel","showEmpty","label","showLabel","taxonomy","taxonomySlug","setAttributes","className","selectId","records","allTaxonomies","isResolvingTaxonomies","taxonomies","filter","t","visibility","public","find","slug","isHierarchicalTaxonomy","hierarchical","query","per_page","hide_empty","context","parent","categories","isResolving","getCategoriesList","parentId","length","toggleAttribute","attributeName","newValue","renderCategoryName","name","trim","renderCategoryList","categoriesList","map","category","renderCategoryListItem","childCategories","id","link","count","children","href","target","rel","childCategory","renderCategoryDropdown","placeholder","withoutInteractiveFormatting","value","onChange","html","as","htmlFor","labels","singular_name","renderCategoryDropdownItem","level","Array","from","TagName","classes","blockProps","title","isArray","__nextHasNoMarginBottom","__next40pxDefaultSize","options","selectedTaxonomy","checked","icon","no_terms"],"sources":["@wordpress/block-library/src/categories/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tPanelBody,\n\tPlaceholder,\n\tSelectControl,\n\tSpinner,\n\tToggleControl,\n\tVisuallyHidden,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport {\n\tInspectorControls,\n\tuseBlockProps,\n\tRichText,\n} from '@wordpress/block-editor';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { pin } from '@wordpress/icons';\nimport { useEntityRecords } from '@wordpress/core-data';\n\nexport default function CategoriesEdit( {\n\tattributes: {\n\t\tdisplayAsDropdown,\n\t\tshowHierarchy,\n\t\tshowPostCounts,\n\t\tshowOnlyTopLevel,\n\t\tshowEmpty,\n\t\tlabel,\n\t\tshowLabel,\n\t\ttaxonomy: taxonomySlug,\n\t},\n\tsetAttributes,\n\tclassName,\n} ) {\n\tconst selectId = useInstanceId( CategoriesEdit, 'blocks-category-select' );\n\n\tconst { records: allTaxonomies, isResolvingTaxonomies } = useEntityRecords(\n\t\t'root',\n\t\t'taxonomy'\n\t);\n\n\tconst taxonomies = allTaxonomies?.filter( ( t ) => t.visibility.public );\n\n\tconst taxonomy = taxonomies?.find( ( t ) => t.slug === taxonomySlug );\n\n\tconst isHierarchicalTaxonomy =\n\t\t! isResolvingTaxonomies && taxonomy?.hierarchical;\n\n\tconst query = { per_page: -1, hide_empty: ! showEmpty, context: 'view' };\n\tif ( isHierarchicalTaxonomy && showOnlyTopLevel ) {\n\t\tquery.parent = 0;\n\t}\n\n\tconst { records: categories, isResolving } = useEntityRecords(\n\t\t'taxonomy',\n\t\ttaxonomySlug,\n\t\tquery\n\t);\n\n\tconst getCategoriesList = ( parentId ) => {\n\t\tif ( ! categories?.length ) {\n\t\t\treturn [];\n\t\t}\n\t\tif ( parentId === null ) {\n\t\t\treturn categories;\n\t\t}\n\t\treturn categories.filter( ( { parent } ) => parent === parentId );\n\t};\n\n\tconst toggleAttribute = ( attributeName ) => ( newValue ) =>\n\t\tsetAttributes( { [ attributeName ]: newValue } );\n\n\tconst renderCategoryName = ( name ) =>\n\t\t! name ? __( '(Untitled)' ) : decodeEntities( name ).trim();\n\n\tconst renderCategoryList = () => {\n\t\tconst parentId = isHierarchicalTaxonomy && showHierarchy ? 0 : null;\n\t\tconst categoriesList = getCategoriesList( parentId );\n\t\treturn categoriesList.map( ( category ) =>\n\t\t\trenderCategoryListItem( category )\n\t\t);\n\t};\n\n\tconst renderCategoryListItem = ( category ) => {\n\t\tconst childCategories = getCategoriesList( category.id );\n\t\tconst { id, link, count, name } = category;\n\t\treturn (\n\t\t\t<li key={ id } className={ `cat-item cat-item-${ id }` }>\n\t\t\t\t<a href={ link } target=\"_blank\" rel=\"noreferrer noopener\">\n\t\t\t\t\t{ renderCategoryName( name ) }\n\t\t\t\t</a>\n\t\t\t\t{ showPostCounts && ` (${ count })` }\n\t\t\t\t{ isHierarchicalTaxonomy &&\n\t\t\t\t\tshowHierarchy &&\n\t\t\t\t\t!! childCategories.length && (\n\t\t\t\t\t\t<ul className=\"children\">\n\t\t\t\t\t\t\t{ childCategories.map( ( childCategory ) =>\n\t\t\t\t\t\t\t\trenderCategoryListItem( childCategory )\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t) }\n\t\t\t</li>\n\t\t);\n\t};\n\n\tconst renderCategoryDropdown = () => {\n\t\tconst parentId = isHierarchicalTaxonomy && showHierarchy ? 0 : null;\n\t\tconst categoriesList = getCategoriesList( parentId );\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ showLabel ? (\n\t\t\t\t\t<RichText\n\t\t\t\t\t\tclassName=\"wp-block-categories__label\"\n\t\t\t\t\t\taria-label={ __( 'Label text' ) }\n\t\t\t\t\t\tplaceholder={ taxonomy.name }\n\t\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\t\tvalue={ label }\n\t\t\t\t\t\tonChange={ ( html ) =>\n\t\t\t\t\t\t\tsetAttributes( { label: html } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<VisuallyHidden as=\"label\" htmlFor={ selectId }>\n\t\t\t\t\t\t{ label ? label : taxonomy.name }\n\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t) }\n\t\t\t\t<select id={ selectId }>\n\t\t\t\t\t<option>\n\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t/* translators: %s: taxonomy's singular name */\n\t\t\t\t\t\t\t__( 'Select %s' ),\n\t\t\t\t\t\t\ttaxonomy.labels.singular_name\n\t\t\t\t\t\t) }\n\t\t\t\t\t</option>\n\t\t\t\t\t{ categoriesList.map( ( category ) =>\n\t\t\t\t\t\trenderCategoryDropdownItem( category, 0 )\n\t\t\t\t\t) }\n\t\t\t\t</select>\n\t\t\t</>\n\t\t);\n\t};\n\n\tconst renderCategoryDropdownItem = ( category, level ) => {\n\t\tconst { id, count, name } = category;\n\t\tconst childCategories = getCategoriesList( id );\n\t\treturn [\n\t\t\t<option key={ id } className={ `level-${ level }` }>\n\t\t\t\t{ Array.from( { length: level * 3 } ).map( () => '\\xa0' ) }\n\t\t\t\t{ renderCategoryName( name ) }\n\t\t\t\t{ showPostCounts && ` (${ count })` }\n\t\t\t</option>,\n\t\t\tisHierarchicalTaxonomy &&\n\t\t\t\tshowHierarchy &&\n\t\t\t\t!! childCategories.length &&\n\t\t\t\tchildCategories.map( ( childCategory ) =>\n\t\t\t\t\trenderCategoryDropdownItem( childCategory, level + 1 )\n\t\t\t\t),\n\t\t];\n\t};\n\n\tconst TagName =\n\t\t!! categories?.length && ! displayAsDropdown && ! isResolving\n\t\t\t? 'ul'\n\t\t\t: 'div';\n\n\tconst classes = clsx( className, {\n\t\t'wp-block-categories-list':\n\t\t\t!! categories?.length && ! displayAsDropdown && ! isResolving,\n\t\t'wp-block-categories-dropdown':\n\t\t\t!! categories?.length && displayAsDropdown && ! isResolving,\n\t} );\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classes,\n\t} );\n\n\treturn (\n\t\t<TagName { ...blockProps }>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t{ Array.isArray( taxonomies ) && (\n\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tlabel={ __( 'Taxonomy' ) }\n\t\t\t\t\t\t\toptions={ taxonomies.map( ( t ) => ( {\n\t\t\t\t\t\t\t\tlabel: t.name,\n\t\t\t\t\t\t\t\tvalue: t.slug,\n\t\t\t\t\t\t\t} ) ) }\n\t\t\t\t\t\t\tvalue={ taxonomySlug }\n\t\t\t\t\t\t\tonChange={ ( selectedTaxonomy ) =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\ttaxonomy: selectedTaxonomy,\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Display as dropdown' ) }\n\t\t\t\t\t\tchecked={ displayAsDropdown }\n\t\t\t\t\t\tonChange={ toggleAttribute( 'displayAsDropdown' ) }\n\t\t\t\t\t/>\n\t\t\t\t\t{ displayAsDropdown && (\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tclassName=\"wp-block-categories__indentation\"\n\t\t\t\t\t\t\tlabel={ __( 'Show label' ) }\n\t\t\t\t\t\t\tchecked={ showLabel }\n\t\t\t\t\t\t\tonChange={ toggleAttribute( 'showLabel' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Show post counts' ) }\n\t\t\t\t\t\tchecked={ showPostCounts }\n\t\t\t\t\t\tonChange={ toggleAttribute( 'showPostCounts' ) }\n\t\t\t\t\t/>\n\t\t\t\t\t{ isHierarchicalTaxonomy && (\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Show only top level terms' ) }\n\t\t\t\t\t\t\tchecked={ showOnlyTopLevel }\n\t\t\t\t\t\t\tonChange={ toggleAttribute( 'showOnlyTopLevel' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Show empty terms' ) }\n\t\t\t\t\t\tchecked={ showEmpty }\n\t\t\t\t\t\tonChange={ toggleAttribute( 'showEmpty' ) }\n\t\t\t\t\t/>\n\t\t\t\t\t{ isHierarchicalTaxonomy && ! showOnlyTopLevel && (\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Show hierarchy' ) }\n\t\t\t\t\t\t\tchecked={ showHierarchy }\n\t\t\t\t\t\t\tonChange={ toggleAttribute( 'showHierarchy' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t{ isResolving && (\n\t\t\t\t<Placeholder icon={ pin } label={ __( 'Terms' ) }>\n\t\t\t\t\t<Spinner />\n\t\t\t\t</Placeholder>\n\t\t\t) }\n\t\t\t{ ! isResolving && categories?.length === 0 && (\n\t\t\t\t<p>{ taxonomy.labels.no_terms }</p>\n\t\t\t) }\n\t\t\t{ ! isResolving &&\n\t\t\t\tcategories?.length > 0 &&\n\t\t\t\t( displayAsDropdown\n\t\t\t\t\t? renderCategoryDropdown()\n\t\t\t\t\t: renderCategoryList() )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AAQ,CAAK,CAClC,EACC,CAAEjD,WAAW,IACdD,UAAU,EAAEI,MAAM,GAAG,CAAC,KACpBjC,iBAAiB,GAChBsD,sBAAsB,CAAC,CAAC,GACxBd,kBAAkB,CAAC,CAAC,CAAE;EAAA,CAClB,CAAC;AAEZ","ignoreList":[]}
@@ -11,11 +11,16 @@ const metadata = {
11
11
  $schema: "https://schemas.wp.org/trunk/block.json",
12
12
  apiVersion: 3,
13
13
  name: "core/categories",
14
- title: "Categories List",
14
+ title: "Terms List",
15
15
  category: "widgets",
16
- description: "Display a list of all categories.",
16
+ description: "Display a list of all terms of a given taxonomy.",
17
+ keywords: ["categories"],
17
18
  textdomain: "default",
18
19
  attributes: {
20
+ taxonomy: {
21
+ type: "string",
22
+ "default": "category"
23
+ },
19
24
  displayAsDropdown: {
20
25
  type: "boolean",
21
26
  "default": false
@@ -90,6 +95,7 @@ const metadata = {
90
95
  style: "wp-block-categories"
91
96
  };
92
97
  import edit from './edit';
98
+ import variations from './variations';
93
99
  const {
94
100
  name
95
101
  } = metadata;
@@ -97,7 +103,8 @@ export { metadata, name };
97
103
  export const settings = {
98
104
  icon,
99
105
  example: {},
100
- edit
106
+ edit,
107
+ variations
101
108
  };
102
109
  export const init = () => initBlock({
103
110
  name,
@@ -1 +1 @@
1
- {"version":3,"names":["category","icon","initBlock","metadata","$schema","apiVersion","name","title","description","textdomain","attributes","displayAsDropdown","type","showHierarchy","showPostCounts","showOnlyTopLevel","showEmpty","label","__experimentalRole","showLabel","usesContext","supports","align","html","spacing","margin","padding","__experimentalDefaultControls","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","interactivity","clientNavigation","__experimentalBorder","radius","color","width","style","editorStyle","edit","settings","example","init"],"sources":["@wordpress/block-library/src/categories/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { category as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {},\n\tedit,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,IAAIC,IAAI,QAAQ,kBAAkB;;AAEnD;AACA;AACA;AACA,OAAOC,SAAS,MAAM,qBAAqB;AAAC,MAAAC,QAAA;EAAAC,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAP,QAAA;EAAAQ,WAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,iBAAA;MAAAC,IAAA;MAAA;IAAA;IAAAC,aAAA;MAAAD,IAAA;MAAA;IAAA;IAAAE,cAAA;MAAAF,IAAA;MAAA;IAAA;IAAAG,gBAAA;MAAAH,IAAA;MAAA;IAAA;IAAAI,SAAA;MAAAJ,IAAA;MAAA;IAAA;IAAAK,KAAA;MAAAL,IAAA;MAAAM,kBAAA;IAAA;IAAAC,SAAA;MAAAP,IAAA;MAAA;IAAA;EAAA;EAAAQ,WAAA;EAAAC,QAAA;IAAAC,KAAA;IAAAC,IAAA;IAAAC,OAAA;MAAAC,MAAA;MAAAC,OAAA;MAAAC,6BAAA;QAAAF,MAAA;QAAAC,OAAA;MAAA;IAAA;IAAAE,UAAA;MAAAC,QAAA;MAAAC,UAAA;MAAAC,wBAAA;MAAAC,wBAAA;MAAAC,uBAAA;MAAAC,2BAAA;MAAAC,4BAAA;MAAAC,2BAAA;MAAAT,6BAAA;QAAAE,QAAA;MAAA;IAAA;IAAAQ,aAAA;MAAAC,gBAAA;IAAA;IAAAC,oBAAA;MAAAC,MAAA;MAAAC,KAAA;MAAAC,KAAA;MAAAC,KAAA;MAAAhB,6BAAA;QAAAa,MAAA;QAAAC,KAAA;QAAAC,KAAA;QAAAC,KAAA;MAAA;IAAA;EAAA;EAAAC,WAAA;EAAAD,KAAA;AAAA;AAE5C,OAAOE,IAAI,MAAM,QAAQ;AAEzB,MAAM;EAAEvC;AAAK,CAAC,GAAGH,QAAQ;AAEzB,SAASA,QAAQ,EAAEG,IAAI;AAEvB,OAAO,MAAMwC,QAAQ,GAAG;EACvB7C,IAAI;EACJ8C,OAAO,EAAE,CAAC,CAAC;EACXF;AACD,CAAC;AAED,OAAO,MAAMG,IAAI,GAAGA,CAAA,KAAM9C,SAAS,CAAE;EAAEI,IAAI;EAAEH,QAAQ;EAAE2C;AAAS,CAAE,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["category","icon","initBlock","metadata","$schema","apiVersion","name","title","description","keywords","textdomain","attributes","taxonomy","type","displayAsDropdown","showHierarchy","showPostCounts","showOnlyTopLevel","showEmpty","label","__experimentalRole","showLabel","usesContext","supports","align","html","spacing","margin","padding","__experimentalDefaultControls","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","interactivity","clientNavigation","__experimentalBorder","radius","color","width","style","editorStyle","edit","variations","settings","example","init"],"sources":["@wordpress/block-library/src/categories/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { category as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport variations from './variations';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {},\n\tedit,\n\tvariations,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,IAAIC,IAAI,QAAQ,kBAAkB;;AAEnD;AACA;AACA;AACA,OAAOC,SAAS,MAAM,qBAAqB;AAAC,MAAAC,QAAA;EAAAC,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAP,QAAA;EAAAQ,WAAA;EAAAC,QAAA;EAAAC,UAAA;EAAAC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","ignoreList":[]}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { __ } from '@wordpress/i18n';
5
+ import { category as icon } from '@wordpress/icons';
6
+ const variations = [{
7
+ name: 'terms',
8
+ title: __('Terms List'),
9
+ icon,
10
+ attributes: {
11
+ // We need to set an attribute here that will be set when inserting the block.
12
+ // We cannot leave this empty, as that would be interpreted as the default value,
13
+ // which is `category` -- for which we're defining a distinct variation below,
14
+ // for backwards compatibility reasons.
15
+ // The logical fallback is thus the only other built-in and public taxonomy: Tags.
16
+ taxonomy: 'post_tag'
17
+ },
18
+ isActive: blockAttributes =>
19
+ // This variation is used for any taxonomy other than `category`.
20
+ blockAttributes.taxonomy !== 'category'
21
+ }, {
22
+ name: 'categories',
23
+ title: __('Categories List'),
24
+ description: __('Display a list of all categories.'),
25
+ icon,
26
+ attributes: {
27
+ taxonomy: 'category'
28
+ },
29
+ isActive: ['taxonomy'],
30
+ // The following is needed to prevent "Terms List" from showing up twice in the inserter
31
+ // (once for the block, once for the variation). Fortunately, it does not collide with
32
+ // `categories` being the default value of the `taxonomy` attribute.
33
+ isDefault: true
34
+ }];
35
+ export default variations;
36
+ //# sourceMappingURL=variations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["__","category","icon","variations","name","title","attributes","taxonomy","isActive","blockAttributes","description","isDefault"],"sources":["@wordpress/block-library/src/categories/variations.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { category as icon } from '@wordpress/icons';\n\nconst variations = [\n\t{\n\t\tname: 'terms',\n\t\ttitle: __( 'Terms List' ),\n\t\ticon,\n\t\tattributes: {\n\t\t\t// We need to set an attribute here that will be set when inserting the block.\n\t\t\t// We cannot leave this empty, as that would be interpreted as the default value,\n\t\t\t// which is `category` -- for which we're defining a distinct variation below,\n\t\t\t// for backwards compatibility reasons.\n\t\t\t// The logical fallback is thus the only other built-in and public taxonomy: Tags.\n\t\t\ttaxonomy: 'post_tag',\n\t\t},\n\t\tisActive: ( blockAttributes ) =>\n\t\t\t// This variation is used for any taxonomy other than `category`.\n\t\t\tblockAttributes.taxonomy !== 'category',\n\t},\n\t{\n\t\tname: 'categories',\n\t\ttitle: __( 'Categories List' ),\n\t\tdescription: __( 'Display a list of all categories.' ),\n\t\ticon,\n\t\tattributes: {\n\t\t\ttaxonomy: 'category',\n\t\t},\n\t\tisActive: [ 'taxonomy' ],\n\t\t// The following is needed to prevent \"Terms List\" from showing up twice in the inserter\n\t\t// (once for the block, once for the variation). Fortunately, it does not collide with\n\t\t// `categories` being the default value of the `taxonomy` attribute.\n\t\tisDefault: true,\n\t},\n];\n\nexport default variations;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,QAAQ,IAAIC,IAAI,QAAQ,kBAAkB;AAEnD,MAAMC,UAAU,GAAG,CAClB;EACCC,IAAI,EAAE,OAAO;EACbC,KAAK,EAAEL,EAAE,CAAE,YAAa,CAAC;EACzBE,IAAI;EACJI,UAAU,EAAE;IACX;IACA;IACA;IACA;IACA;IACAC,QAAQ,EAAE;EACX,CAAC;EACDC,QAAQ,EAAIC,eAAe;EAC1B;EACAA,eAAe,CAACF,QAAQ,KAAK;AAC/B,CAAC,EACD;EACCH,IAAI,EAAE,YAAY;EAClBC,KAAK,EAAEL,EAAE,CAAE,iBAAkB,CAAC;EAC9BU,WAAW,EAAEV,EAAE,CAAE,mCAAoC,CAAC;EACtDE,IAAI;EACJI,UAAU,EAAE;IACXC,QAAQ,EAAE;EACX,CAAC;EACDC,QAAQ,EAAE,CAAE,UAAU,CAAE;EACxB;EACA;EACA;EACAG,SAAS,EAAE;AACZ,CAAC,CACD;AAED,eAAeR,UAAU","ignoreList":[]}
@@ -1,3 +1,4 @@
1
+ /* wp:polyfill */
1
2
  /**
2
3
  * Internal dependencies
3
4
  */
@@ -1 +1 @@
1
- {"version":3,"names":["createUpgradedEmbedBlock","getClassNames","removeAspectRatioClasses","fallback","getEmbedInfoByProvider","getMergedAttributesWithPreview","EmbedControls","embedContentIcon","EmbedLoading","EmbedPlaceholder","EmbedPreview","clsx","__","_x","sprintf","useState","useEffect","useDispatch","useSelect","useBlockProps","store","coreStore","View","getAuthority","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","EmbedEdit","props","attributes","providerNameSlug","previewable","responsive","url","attributesUrl","isSelected","onReplace","setAttributes","insertBlocksAfter","onFocus","defaultEmbedInfo","title","icon","setURL","isEditingURL","setIsEditingURL","invalidateResolution","preview","fetching","themeSupportsResponsive","cannotEmbed","hasResolved","select","getEmbedPreview","isPreviewEmbedFallback","isRequestingEmbedPreview","getThemeSupports","hasFinishedResolution","embedPreview","previewIsFallback","badEmbedProvider","html","type","undefined","wordpressCantEmbed","data","status","validPreview","getMergedAttributes","toggleResponsive","allowResponsive","className","newAllowResponsive","newURL","replace","URL","host","toString","mergedAttributes","upgradedBlock","blockProps","children","label","showEmbedPlaceholder","onSubmit","event","preventDefault","blockClass","value","onChange","tryAgain","caption","classFromPreview","showEditButton","blockSupportsResponsive","switchBackToURLInput","onCaptionChange"],"sources":["@wordpress/block-library/src/embed/edit.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport {\n\tcreateUpgradedEmbedBlock,\n\tgetClassNames,\n\tremoveAspectRatioClasses,\n\tfallback,\n\tgetEmbedInfoByProvider,\n\tgetMergedAttributesWithPreview,\n} from './util';\nimport EmbedControls from './embed-controls';\nimport { embedContentIcon } from './icons';\nimport EmbedLoading from './embed-loading';\nimport EmbedPlaceholder from './embed-placeholder';\nimport EmbedPreview from './embed-preview';\n\n/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { useState, useEffect } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useBlockProps } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { View } from '@wordpress/primitives';\nimport { getAuthority } from '@wordpress/url';\n\nconst EmbedEdit = ( props ) => {\n\tconst {\n\t\tattributes: {\n\t\t\tproviderNameSlug,\n\t\t\tpreviewable,\n\t\t\tresponsive,\n\t\t\turl: attributesUrl,\n\t\t},\n\t\tattributes,\n\t\tisSelected,\n\t\tonReplace,\n\t\tsetAttributes,\n\t\tinsertBlocksAfter,\n\t\tonFocus,\n\t} = props;\n\n\tconst defaultEmbedInfo = {\n\t\ttitle: _x( 'Embed', 'block title' ),\n\t\ticon: embedContentIcon,\n\t};\n\tconst { icon, title } =\n\t\tgetEmbedInfoByProvider( providerNameSlug ) || defaultEmbedInfo;\n\n\tconst [ url, setURL ] = useState( attributesUrl );\n\tconst [ isEditingURL, setIsEditingURL ] = useState( false );\n\tconst { invalidateResolution } = useDispatch( coreStore );\n\n\tconst {\n\t\tpreview,\n\t\tfetching,\n\t\tthemeSupportsResponsive,\n\t\tcannotEmbed,\n\t\thasResolved,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetEmbedPreview,\n\t\t\t\tisPreviewEmbedFallback,\n\t\t\t\tisRequestingEmbedPreview,\n\t\t\t\tgetThemeSupports,\n\t\t\t\thasFinishedResolution,\n\t\t\t} = select( coreStore );\n\t\t\tif ( ! attributesUrl ) {\n\t\t\t\treturn { fetching: false, cannotEmbed: false };\n\t\t\t}\n\n\t\t\tconst embedPreview = getEmbedPreview( attributesUrl );\n\t\t\tconst previewIsFallback = isPreviewEmbedFallback( attributesUrl );\n\n\t\t\t// The external oEmbed provider does not exist. We got no type info and no html.\n\t\t\tconst badEmbedProvider =\n\t\t\t\tembedPreview?.html === false &&\n\t\t\t\tembedPreview?.type === undefined;\n\t\t\t// Some WordPress URLs that can't be embedded will cause the API to return\n\t\t\t// a valid JSON response with no HTML and `data.status` set to 404, rather\n\t\t\t// than generating a fallback response as other embeds do.\n\t\t\tconst wordpressCantEmbed = embedPreview?.data?.status === 404;\n\t\t\tconst validPreview =\n\t\t\t\t!! embedPreview && ! badEmbedProvider && ! wordpressCantEmbed;\n\t\t\treturn {\n\t\t\t\tpreview: validPreview ? embedPreview : undefined,\n\t\t\t\tfetching: isRequestingEmbedPreview( attributesUrl ),\n\t\t\t\tthemeSupportsResponsive:\n\t\t\t\t\tgetThemeSupports()[ 'responsive-embeds' ],\n\t\t\t\tcannotEmbed: ! validPreview || previewIsFallback,\n\t\t\t\thasResolved: hasFinishedResolution( 'getEmbedPreview', [\n\t\t\t\t\tattributesUrl,\n\t\t\t\t] ),\n\t\t\t};\n\t\t},\n\t\t[ attributesUrl ]\n\t);\n\n\t/**\n\t * Returns the attributes derived from the preview, merged with the current attributes.\n\t *\n\t * @return {Object} Merged attributes.\n\t */\n\tconst getMergedAttributes = () =>\n\t\tgetMergedAttributesWithPreview(\n\t\t\tattributes,\n\t\t\tpreview,\n\t\t\ttitle,\n\t\t\tresponsive\n\t\t);\n\n\tconst toggleResponsive = () => {\n\t\tconst { allowResponsive, className } = attributes;\n\t\tconst { html } = preview;\n\t\tconst newAllowResponsive = ! allowResponsive;\n\n\t\tsetAttributes( {\n\t\t\tallowResponsive: newAllowResponsive,\n\t\t\tclassName: getClassNames(\n\t\t\t\thtml,\n\t\t\t\tclassName,\n\t\t\t\tresponsive && newAllowResponsive\n\t\t\t),\n\t\t} );\n\t};\n\n\tuseEffect( () => {\n\t\tif ( preview?.html || ! cannotEmbed || ! hasResolved ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// At this stage, we're not fetching the preview and know it can't be embedded,\n\t\t// so try removing any trailing slash, and resubmit.\n\t\tconst newURL = attributesUrl.replace( /\\/$/, '' );\n\t\tsetURL( newURL );\n\t\tsetIsEditingURL( false );\n\t\tsetAttributes( { url: newURL } );\n\t}, [\n\t\tpreview?.html,\n\t\tattributesUrl,\n\t\tcannotEmbed,\n\t\thasResolved,\n\t\tsetAttributes,\n\t] );\n\n\t// Try a different provider in case the embed url is not supported.\n\tuseEffect( () => {\n\t\tif ( ! cannotEmbed || fetching || ! url ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Until X provider is supported in WordPress, as a workaround we use Twitter provider.\n\t\tif ( getAuthority( url ) === 'x.com' ) {\n\t\t\tconst newURL = new URL( url );\n\t\t\tnewURL.host = 'twitter.com';\n\t\t\tsetAttributes( { url: newURL.toString() } );\n\t\t}\n\t}, [ url, cannotEmbed, fetching, setAttributes ] );\n\n\t// Handle incoming preview.\n\tuseEffect( () => {\n\t\tif ( preview && ! isEditingURL ) {\n\t\t\t// When obtaining an incoming preview,\n\t\t\t// we set the attributes derived from the preview data.\n\t\t\tconst mergedAttributes = getMergedAttributes();\n\t\t\tsetAttributes( mergedAttributes );\n\n\t\t\tif ( onReplace ) {\n\t\t\t\tconst upgradedBlock = createUpgradedEmbedBlock(\n\t\t\t\t\tprops,\n\t\t\t\t\tmergedAttributes\n\t\t\t\t);\n\n\t\t\t\tif ( upgradedBlock ) {\n\t\t\t\t\tonReplace( upgradedBlock );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}, [ preview, isEditingURL ] );\n\n\tconst blockProps = useBlockProps();\n\n\tif ( fetching ) {\n\t\treturn (\n\t\t\t<View { ...blockProps }>\n\t\t\t\t<EmbedLoading />\n\t\t\t</View>\n\t\t);\n\t}\n\n\t// translators: %s: type of embed e.g: \"YouTube\", \"Twitter\", etc. \"Embed\" is used when no specific type exists\n\tconst label = sprintf( __( '%s URL' ), title );\n\n\t// No preview, or we can't embed the current URL, or we've clicked the edit button.\n\tconst showEmbedPlaceholder = ! preview || cannotEmbed || isEditingURL;\n\n\tif ( showEmbedPlaceholder ) {\n\t\treturn (\n\t\t\t<View { ...blockProps }>\n\t\t\t\t<EmbedPlaceholder\n\t\t\t\t\ticon={ icon }\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\tonSubmit={ ( event ) => {\n\t\t\t\t\t\tif ( event ) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// If the embed URL was changed, we need to reset the aspect ratio class.\n\t\t\t\t\t\t// To do this we have to remove the existing ratio class so it can be recalculated.\n\t\t\t\t\t\tconst blockClass = removeAspectRatioClasses(\n\t\t\t\t\t\t\tattributes.className\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tsetIsEditingURL( false );\n\t\t\t\t\t\tsetAttributes( { url, className: blockClass } );\n\t\t\t\t\t} }\n\t\t\t\t\tvalue={ url }\n\t\t\t\t\tcannotEmbed={ cannotEmbed }\n\t\t\t\t\tonChange={ ( value ) => setURL( value ) }\n\t\t\t\t\tfallback={ () => fallback( url, onReplace ) }\n\t\t\t\t\ttryAgain={ () => {\n\t\t\t\t\t\tinvalidateResolution( 'getEmbedPreview', [ url ] );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</View>\n\t\t);\n\t}\n\n\t// Even though we set attributes that get derived from the preview,\n\t// we don't access them directly because for the initial render,\n\t// the `setAttributes` call will not have taken effect. If we're\n\t// rendering responsive content, setting the responsive classes\n\t// after the preview has been rendered can result in unwanted\n\t// clipping or scrollbars. The `getAttributesFromPreview` function\n\t// that `getMergedAttributes` uses is memoized so that we're not\n\t// calculating them on every render.\n\tconst {\n\t\tcaption,\n\t\ttype,\n\t\tallowResponsive,\n\t\tclassName: classFromPreview,\n\t} = getMergedAttributes();\n\tconst className = clsx( classFromPreview, props.className );\n\n\treturn (\n\t\t<>\n\t\t\t<EmbedControls\n\t\t\t\tshowEditButton={ preview && ! cannotEmbed }\n\t\t\t\tthemeSupportsResponsive={ themeSupportsResponsive }\n\t\t\t\tblockSupportsResponsive={ responsive }\n\t\t\t\tallowResponsive={ allowResponsive }\n\t\t\t\ttoggleResponsive={ toggleResponsive }\n\t\t\t\tswitchBackToURLInput={ () => setIsEditingURL( true ) }\n\t\t\t/>\n\t\t\t<View { ...blockProps }>\n\t\t\t\t<EmbedPreview\n\t\t\t\t\tpreview={ preview }\n\t\t\t\t\tpreviewable={ previewable }\n\t\t\t\t\tclassName={ className }\n\t\t\t\t\turl={ url }\n\t\t\t\t\ttype={ type }\n\t\t\t\t\tcaption={ caption }\n\t\t\t\t\tonCaptionChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { caption: value } )\n\t\t\t\t\t}\n\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\ticon={ icon }\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t/>\n\t\t\t</View>\n\t\t</>\n\t);\n};\n\nexport default EmbedEdit;\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,wBAAwB,EACxBC,aAAa,EACbC,wBAAwB,EACxBC,QAAQ,EACRC,sBAAsB,EACtBC,8BAA8B,QACxB,QAAQ;AACf,OAAOC,aAAa,MAAM,kBAAkB;AAC5C,SAASC,gBAAgB,QAAQ,SAAS;AAC1C,OAAOC,YAAY,MAAM,iBAAiB;AAC1C,OAAOC,gBAAgB,MAAM,qBAAqB;AAClD,OAAOC,YAAY,MAAM,iBAAiB;;AAE1C;AACA;AACA;AACA,OAAOC,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACjD,SAASC,QAAQ,EAAEC,SAAS,QAAQ,oBAAoB;AACxD,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,aAAa,QAAQ,yBAAyB;AACvD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,IAAI,QAAQ,uBAAuB;AAC5C,SAASC,YAAY,QAAQ,gBAAgB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAE9C,MAAMC,SAAS,GAAKC,KAAK,IAAM;EAC9B,MAAM;IACLC,UAA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AAC2C,SAAU,CAAC;EAE3D,oBACC7C,KAAA,CAAAF,SAAA;IAAAyD,QAAA,gBACC3D,IAAA,CAACnB,aAAa;MACb0F,cAAc,EAAG9C,OAAO,IAAI,CAAEG,WAAa;MAC3CD,uBAAuB,EAAGA,uBAAyB;MACnD6C,uBAAuB,EAAG9D,UAAY;MACtCsC,eAAe,EAAGA,eAAiB;MACnCD,gBAAgB,EAAGA,gBAAkB;MACrC0B,oBAAoB,EAAGA,CAAA,KAAMlD,eAAe,CAAE,IAAK;IAAG,CACtD,CAAC,eACFvB,IAAA,CAACH,IAAI;MAAA,GAAM6D,UAAU;MAAAC,QAAA,eACpB3D,IAAA,CAACf,YAAY;QACZwC,OAAO,EAAGA,OAAS;QACnBhB,WAAW,EAAGA,WAAa;QAC3BwC,SAAS,EAAGA,SAAW;QACvBtC,GAAG,EAAGA,GAAK;QACX6B,IAAI,EAAGA,IAAM;QACb6B,OAAO,EAAGA,OAAS;QACnBK,eAAe,EAAKR,KAAK,IACxBnD,aAAa,CAAE;UAAEsD,OAAO,EAAEH;QAAM,CAAE,CAClC;QACDrD,UAAU,EAAGA,UAAY;QACzBO,IAAI,EAAGA,IAAM;QACbwC,KAAK,EAAGA,KAAO;QACf5C,iBAAiB,EAAGA,iBAAmB;QACvCT,UAAU,EAAGA,UAAY;QACzBQ,aAAa,EAAGA;MAAe,CAC/B;IAAC,CACG,CAAC;EAAA,CACN,CAAC;AAEL,CAAC;AAED,eAAeV,SAAS","ignoreList":[]}
1
+ {"version":3,"names":["createUpgradedEmbedBlock","getClassNames","removeAspectRatioClasses","fallback","getEmbedInfoByProvider","getMergedAttributesWithPreview","EmbedControls","embedContentIcon","EmbedLoading","EmbedPlaceholder","EmbedPreview","clsx","__","_x","sprintf","useState","useEffect","useDispatch","useSelect","useBlockProps","store","coreStore","View","getAuthority","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","EmbedEdit","props","attributes","providerNameSlug","previewable","responsive","url","attributesUrl","isSelected","onReplace","setAttributes","insertBlocksAfter","onFocus","defaultEmbedInfo","title","icon","setURL","isEditingURL","setIsEditingURL","invalidateResolution","preview","fetching","themeSupportsResponsive","cannotEmbed","hasResolved","select","getEmbedPreview","isPreviewEmbedFallback","isRequestingEmbedPreview","getThemeSupports","hasFinishedResolution","embedPreview","previewIsFallback","badEmbedProvider","html","type","undefined","wordpressCantEmbed","data","status","validPreview","getMergedAttributes","toggleResponsive","allowResponsive","className","newAllowResponsive","newURL","replace","URL","host","toString","mergedAttributes","upgradedBlock","blockProps","children","label","showEmbedPlaceholder","onSubmit","event","preventDefault","blockClass","value","onChange","tryAgain","caption","classFromPreview","showEditButton","blockSupportsResponsive","switchBackToURLInput","onCaptionChange"],"sources":["@wordpress/block-library/src/embed/edit.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport {\n\tcreateUpgradedEmbedBlock,\n\tgetClassNames,\n\tremoveAspectRatioClasses,\n\tfallback,\n\tgetEmbedInfoByProvider,\n\tgetMergedAttributesWithPreview,\n} from './util';\nimport EmbedControls from './embed-controls';\nimport { embedContentIcon } from './icons';\nimport EmbedLoading from './embed-loading';\nimport EmbedPlaceholder from './embed-placeholder';\nimport EmbedPreview from './embed-preview';\n\n/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { useState, useEffect } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useBlockProps } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { View } from '@wordpress/primitives';\nimport { getAuthority } from '@wordpress/url';\n\nconst EmbedEdit = ( props ) => {\n\tconst {\n\t\tattributes: {\n\t\t\tproviderNameSlug,\n\t\t\tpreviewable,\n\t\t\tresponsive,\n\t\t\turl: attributesUrl,\n\t\t},\n\t\tattributes,\n\t\tisSelected,\n\t\tonReplace,\n\t\tsetAttributes,\n\t\tinsertBlocksAfter,\n\t\tonFocus,\n\t} = props;\n\n\tconst defaultEmbedInfo = {\n\t\ttitle: _x( 'Embed', 'block title' ),\n\t\ticon: embedContentIcon,\n\t};\n\tconst { icon, title } =\n\t\tgetEmbedInfoByProvider( providerNameSlug ) || defaultEmbedInfo;\n\n\tconst [ url, setURL ] = useState( attributesUrl );\n\tconst [ isEditingURL, setIsEditingURL ] = useState( false );\n\tconst { invalidateResolution } = useDispatch( coreStore );\n\n\tconst {\n\t\tpreview,\n\t\tfetching,\n\t\tthemeSupportsResponsive,\n\t\tcannotEmbed,\n\t\thasResolved,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetEmbedPreview,\n\t\t\t\tisPreviewEmbedFallback,\n\t\t\t\tisRequestingEmbedPreview,\n\t\t\t\tgetThemeSupports,\n\t\t\t\thasFinishedResolution,\n\t\t\t} = select( coreStore );\n\t\t\tif ( ! attributesUrl ) {\n\t\t\t\treturn { fetching: false, cannotEmbed: false };\n\t\t\t}\n\n\t\t\tconst embedPreview = getEmbedPreview( attributesUrl );\n\t\t\tconst previewIsFallback = isPreviewEmbedFallback( attributesUrl );\n\n\t\t\t// The external oEmbed provider does not exist. We got no type info and no html.\n\t\t\tconst badEmbedProvider =\n\t\t\t\tembedPreview?.html === false &&\n\t\t\t\tembedPreview?.type === undefined;\n\t\t\t// Some WordPress URLs that can't be embedded will cause the API to return\n\t\t\t// a valid JSON response with no HTML and `data.status` set to 404, rather\n\t\t\t// than generating a fallback response as other embeds do.\n\t\t\tconst wordpressCantEmbed = embedPreview?.data?.status === 404;\n\t\t\tconst validPreview =\n\t\t\t\t!! embedPreview && ! badEmbedProvider && ! wordpressCantEmbed;\n\t\t\treturn {\n\t\t\t\tpreview: validPreview ? embedPreview : undefined,\n\t\t\t\tfetching: isRequestingEmbedPreview( attributesUrl ),\n\t\t\t\tthemeSupportsResponsive:\n\t\t\t\t\tgetThemeSupports()[ 'responsive-embeds' ],\n\t\t\t\tcannotEmbed: ! validPreview || previewIsFallback,\n\t\t\t\thasResolved: hasFinishedResolution( 'getEmbedPreview', [\n\t\t\t\t\tattributesUrl,\n\t\t\t\t] ),\n\t\t\t};\n\t\t},\n\t\t[ attributesUrl ]\n\t);\n\n\t/**\n\t * Returns the attributes derived from the preview, merged with the current attributes.\n\t *\n\t * @return {Object} Merged attributes.\n\t */\n\tconst getMergedAttributes = () =>\n\t\tgetMergedAttributesWithPreview(\n\t\t\tattributes,\n\t\t\tpreview,\n\t\t\ttitle,\n\t\t\tresponsive\n\t\t);\n\n\tconst toggleResponsive = () => {\n\t\tconst { allowResponsive, className } = attributes;\n\t\tconst { html } = preview;\n\t\tconst newAllowResponsive = ! allowResponsive;\n\n\t\tsetAttributes( {\n\t\t\tallowResponsive: newAllowResponsive,\n\t\t\tclassName: getClassNames(\n\t\t\t\thtml,\n\t\t\t\tclassName,\n\t\t\t\tresponsive && newAllowResponsive\n\t\t\t),\n\t\t} );\n\t};\n\n\tuseEffect( () => {\n\t\tif ( preview?.html || ! cannotEmbed || ! hasResolved ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// At this stage, we're not fetching the preview and know it can't be embedded,\n\t\t// so try removing any trailing slash, and resubmit.\n\t\tconst newURL = attributesUrl.replace( /\\/$/, '' );\n\t\tsetURL( newURL );\n\t\tsetIsEditingURL( false );\n\t\tsetAttributes( { url: newURL } );\n\t}, [\n\t\tpreview?.html,\n\t\tattributesUrl,\n\t\tcannotEmbed,\n\t\thasResolved,\n\t\tsetAttributes,\n\t] );\n\n\t// Try a different provider in case the embed url is not supported.\n\tuseEffect( () => {\n\t\tif ( ! cannotEmbed || fetching || ! url ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Until X provider is supported in WordPress, as a workaround we use Twitter provider.\n\t\tif ( getAuthority( url ) === 'x.com' ) {\n\t\t\tconst newURL = new URL( url );\n\t\t\tnewURL.host = 'twitter.com';\n\t\t\tsetAttributes( { url: newURL.toString() } );\n\t\t}\n\t}, [ url, cannotEmbed, fetching, setAttributes ] );\n\n\t// Handle incoming preview.\n\tuseEffect( () => {\n\t\tif ( preview && ! isEditingURL ) {\n\t\t\t// When obtaining an incoming preview,\n\t\t\t// we set the attributes derived from the preview data.\n\t\t\tconst mergedAttributes = getMergedAttributes();\n\t\t\tsetAttributes( mergedAttributes );\n\n\t\t\tif ( onReplace ) {\n\t\t\t\tconst upgradedBlock = createUpgradedEmbedBlock(\n\t\t\t\t\tprops,\n\t\t\t\t\tmergedAttributes\n\t\t\t\t);\n\n\t\t\t\tif ( upgradedBlock ) {\n\t\t\t\t\tonReplace( upgradedBlock );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}, [ preview, isEditingURL ] );\n\n\tconst blockProps = useBlockProps();\n\n\tif ( fetching ) {\n\t\treturn (\n\t\t\t<View { ...blockProps }>\n\t\t\t\t<EmbedLoading />\n\t\t\t</View>\n\t\t);\n\t}\n\n\t// translators: %s: type of embed e.g: \"YouTube\", \"Twitter\", etc. \"Embed\" is used when no specific type exists\n\tconst label = sprintf( __( '%s URL' ), title );\n\n\t// No preview, or we can't embed the current URL, or we've clicked the edit button.\n\tconst showEmbedPlaceholder = ! preview || cannotEmbed || isEditingURL;\n\n\tif ( showEmbedPlaceholder ) {\n\t\treturn (\n\t\t\t<View { ...blockProps }>\n\t\t\t\t<EmbedPlaceholder\n\t\t\t\t\ticon={ icon }\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\tonSubmit={ ( event ) => {\n\t\t\t\t\t\tif ( event ) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// If the embed URL was changed, we need to reset the aspect ratio class.\n\t\t\t\t\t\t// To do this we have to remove the existing ratio class so it can be recalculated.\n\t\t\t\t\t\tconst blockClass = removeAspectRatioClasses(\n\t\t\t\t\t\t\tattributes.className\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tsetIsEditingURL( false );\n\t\t\t\t\t\tsetAttributes( { url, className: blockClass } );\n\t\t\t\t\t} }\n\t\t\t\t\tvalue={ url }\n\t\t\t\t\tcannotEmbed={ cannotEmbed }\n\t\t\t\t\tonChange={ ( value ) => setURL( value ) }\n\t\t\t\t\tfallback={ () => fallback( url, onReplace ) }\n\t\t\t\t\ttryAgain={ () => {\n\t\t\t\t\t\tinvalidateResolution( 'getEmbedPreview', [ url ] );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</View>\n\t\t);\n\t}\n\n\t// Even though we set attributes that get derived from the preview,\n\t// we don't access them directly because for the initial render,\n\t// the `setAttributes` call will not have taken effect. If we're\n\t// rendering responsive content, setting the responsive classes\n\t// after the preview has been rendered can result in unwanted\n\t// clipping or scrollbars. The `getAttributesFromPreview` function\n\t// that `getMergedAttributes` uses is memoized so that we're not\n\t// calculating them on every render.\n\tconst {\n\t\tcaption,\n\t\ttype,\n\t\tallowResponsive,\n\t\tclassName: classFromPreview,\n\t} = getMergedAttributes();\n\tconst className = clsx( classFromPreview, props.className );\n\n\treturn (\n\t\t<>\n\t\t\t<EmbedControls\n\t\t\t\tshowEditButton={ preview && ! cannotEmbed }\n\t\t\t\tthemeSupportsResponsive={ themeSupportsResponsive }\n\t\t\t\tblockSupportsResponsive={ responsive }\n\t\t\t\tallowResponsive={ allowResponsive }\n\t\t\t\ttoggleResponsive={ toggleResponsive }\n\t\t\t\tswitchBackToURLInput={ () => setIsEditingURL( true ) }\n\t\t\t/>\n\t\t\t<View { ...blockProps }>\n\t\t\t\t<EmbedPreview\n\t\t\t\t\tpreview={ preview }\n\t\t\t\t\tpreviewable={ previewable }\n\t\t\t\t\tclassName={ className }\n\t\t\t\t\turl={ url }\n\t\t\t\t\ttype={ type }\n\t\t\t\t\tcaption={ caption }\n\t\t\t\t\tonCaptionChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { caption: value } )\n\t\t\t\t\t}\n\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\ticon={ icon }\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t/>\n\t\t\t</View>\n\t\t</>\n\t);\n};\n\nexport default EmbedEdit;\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,wBAAwB,EACxBC,aAAa,EACbC,wBAAwB,EACxBC,QAAQ,EACRC,sBAAsB,EACtBC,8BAA8B,QACxB,QAAQ;AACf,OAAOC,aAAa,MAAM,kBAAkB;AAC5C,SAASC,gBAAgB,QAAQ,SAAS;AAC1C,OAAOC,YAAY,MAAM,iBAAiB;AAC1C,OAAOC,gBAAgB,MAAM,qBAAqB;AAClD,OAAOC,YAAY,MAAM,iBAAiB;;AAE1C;AACA;AACA;AACA,OAAOC,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACjD,SAASC,QAAQ,EAAEC,SAAS,QAAQ,oBAAoB;AACxD,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,aAAa,QAAQ,yBAAyB;AACvD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,IAAI,QAAQ,uBAAuB;AAC5C,SAASC,YAAY,QAAQ,gBAAgB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAE9C,MAAMC,SAAS,GAAKC,KAAK,IAAM;EAC9B,MAAM;IACLC,UAAU,EAAE;MACXC,gBAAgB;MAChBC,WAAW;MACXC,UAAU;MACVC,GAAG,EAAEC;IACN,CAAC;IACDL,UAAU;IACVM,UAAU;IACVC,SAAS;IACTC,aAAa;IACbC,iBAAiB;IACjBC;EACD,CAAC,GAAGX,KAAK;EAET,MAAMY,gBAAgB,GAAG;IACxBC,KAAK,EAAE/B,EAAE,CAAE,OAAO,EAAE,aAAc,CAAC;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A,gBAAkB;MACrC0B,oBAAoB,EAAGA,CAAA,KAAMlD,eAAe,CAAE,IAAK;IAAG,CACtD,CAAC,eACFvB,IAAA,CAACH,IAAI;MAAA,GAAM6D,UAAU;MAAAC,QAAA,eACpB3D,IAAA,CAACf,YAAY;QACZwC,OAAO,EAAGA,OAAS;QACnBhB,WAAW,EAAGA,WAAa;QAC3BwC,SAAS,EAAGA,SAAW;QACvBtC,GAAG,EAAGA,GAAK;QACX6B,IAAI,EAAGA,IAAM;QACb6B,OAAO,EAAGA,OAAS;QACnBK,eAAe,EAAKR,KAAK,IACxBnD,aAAa,CAAE;UAAEsD,OAAO,EAAEH;QAAM,CAAE,CAClC;QACDrD,UAAU,EAAGA,UAAY;QACzBO,IAAI,EAAGA,IAAM;QACbwC,KAAK,EAAGA,KAAO;QACf5C,iBAAiB,EAAGA,iBAAmB;QACvCT,UAAU,EAAGA,UAAY;QACzBQ,aAAa,EAAGA;MAAe,CAC/B;IAAC,CACG,CAAC;EAAA,CACN,CAAC;AAEL,CAAC;AAED,eAAeV,SAAS","ignoreList":[]}
@@ -1,3 +1,4 @@
1
+ /* wp:polyfill */
1
2
  /**
2
3
  * Internal dependencies
3
4
  */
@@ -1 +1 @@
1
- {"version":3,"names":["createUpgradedEmbedBlock","getClassNames","removeAspectRatioClasses","fallback","getEmbedInfoByProvider","getMergedAttributesWithPreview","EmbedControls","embedContentIcon","EmbedLoading","EmbedPlaceholder","EmbedPreview","EmbedLinkSettings","clsx","_x","useCallback","useState","useEffect","useDispatch","useSelect","useBlockProps","store","blockEditorStore","coreStore","View","getAuthority","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","PREVIEWABLE_PROVIDERS","NOT_PREVIEWABLE_WP_EMBED_PROVIDERS","WP_EMBED_TYPE","EmbedEdit","props","attributes","align","providerNameSlug","previewable","responsive","url","isSelected","onReplace","setAttributes","insertBlocksAfter","onFocus","clientId","defaultEmbedInfo","title","icon","embedInfoByProvider","wasBlockJustInserted","select","isEditingURL","setIsEditingURL","showEmbedBottomSheet","setShowEmbedBottomSheet","invalidateResolution","preview","fetching","themeSupportsResponsive","cannotEmbed","getEmbedPreview","hasFinishedResolution","isPreviewEmbedFallback","getThemeSupports","embedPreview","hasResolvedEmbedPreview","previewIsFallback","badEmbedProvider","html","type","undefined","wordpressCantEmbed","code","validPreview","getMergedAttributes","toggleResponsive","allowResponsive","className","newAllowResponsive","newURL","replace","URL","host","toString","mergedAttributes","upgradedBlock","onEditURL","value","blockClass","blockProps","children","showEmbedPlaceholder","classFromPreview","isProviderPreviewable","includes","linkLabel","label","onPress","event","tryAgain","openEmbedLinkSettings","blockSupportsResponsive","isDefaultEmbedInfo","autoFocus","isVisible","onClose","onSubmit","withBottomSheet"],"sources":["@wordpress/block-library/src/embed/edit.native.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport {\n\tcreateUpgradedEmbedBlock,\n\tgetClassNames,\n\tremoveAspectRatioClasses,\n\tfallback,\n\tgetEmbedInfoByProvider,\n\tgetMergedAttributesWithPreview,\n} from './util';\nimport EmbedControls from './embed-controls';\nimport { embedContentIcon } from './icons';\nimport EmbedLoading from './embed-loading';\nimport EmbedPlaceholder from './embed-placeholder';\nimport EmbedPreview from './embed-preview';\nimport EmbedLinkSettings from './embed-link-settings';\n\n/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { _x } from '@wordpress/i18n';\nimport { useCallback, useState, useEffect } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tuseBlockProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { View } from '@wordpress/primitives';\nimport { getAuthority } from '@wordpress/url';\n\n// The inline preview feature will be released progressible, for this reason\n// the embed will only be considered previewable for the following providers list.\nconst PREVIEWABLE_PROVIDERS = [ 'youtube', 'twitter', 'instagram', 'vimeo' ];\n// Some providers are rendering the inline preview as a WordPress embed and\n// are not supported yet, so we need to disallow them with a fixed providers list.\nconst NOT_PREVIEWABLE_WP_EMBED_PROVIDERS = [ 'pinterest' ];\n\nconst WP_EMBED_TYPE = 'wp-embed';\n\nconst EmbedEdit = ( props ) => {\n\tconst {\n\t\tattributes: { align, providerNameSlug, previewable, responsive, url },\n\t\tattributes,\n\t\tisSelected,\n\t\tonReplace,\n\t\tsetAttributes,\n\t\tinsertBlocksAfter,\n\t\tonFocus,\n\t\tclientId,\n\t} = props;\n\n\tconst defaultEmbedInfo = {\n\t\ttitle: _x( 'Embed', 'block title' ),\n\t\ticon: embedContentIcon,\n\t};\n\tconst embedInfoByProvider = getEmbedInfoByProvider( providerNameSlug );\n\tconst { icon, title } = embedInfoByProvider || defaultEmbedInfo;\n\n\tconst { wasBlockJustInserted } = useSelect(\n\t\t( select ) => ( {\n\t\t\twasBlockJustInserted: select(\n\t\t\t\tblockEditorStore\n\t\t\t).wasBlockJustInserted( clientId, 'inserter_menu' ),\n\t\t} ),\n\t\t[ clientId ]\n\t);\n\tconst [ isEditingURL, setIsEditingURL ] = useState(\n\t\tisSelected && wasBlockJustInserted && ! url\n\t);\n\tconst [ showEmbedBottomSheet, setShowEmbedBottomSheet ] =\n\t\tuseState( isEditingURL );\n\tconst { invalidateResolution } = useDispatch( coreStore );\n\n\tconst { preview, fetching, themeSupportsResponsive, cannotEmbed } =\n\t\tuseSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst {\n\t\t\t\t\tgetEmbedPreview,\n\t\t\t\t\thasFinishedResolution,\n\t\t\t\t\tisPreviewEmbedFallback,\n\t\t\t\t\tgetThemeSupports,\n\t\t\t\t} = select( coreStore );\n\t\t\t\tif ( ! url ) {\n\t\t\t\t\treturn { fetching: false, cannotEmbed: false };\n\t\t\t\t}\n\n\t\t\t\tconst embedPreview = getEmbedPreview( url );\n\t\t\t\tconst hasResolvedEmbedPreview = hasFinishedResolution(\n\t\t\t\t\t'getEmbedPreview',\n\t\t\t\t\t[ url ]\n\t\t\t\t);\n\t\t\t\tconst previewIsFallback = isPreviewEmbedFallback( url );\n\n\t\t\t\t// The external oEmbed provider does not exist. We got no type info and no html.\n\t\t\t\tconst badEmbedProvider =\n\t\t\t\t\tembedPreview?.html === false &&\n\t\t\t\t\tembedPreview?.type === undefined;\n\t\t\t\t// Some WordPress URLs that can't be embedded will cause the API to return\n\t\t\t\t// a valid JSON response with no HTML and `code` set to 404, rather\n\t\t\t\t// than generating a fallback response as other embeds do.\n\t\t\t\tconst wordpressCantEmbed = embedPreview?.code === '404';\n\t\t\t\tconst validPreview =\n\t\t\t\t\t!! embedPreview &&\n\t\t\t\t\t! badEmbedProvider &&\n\t\t\t\t\t! wordpressCantEmbed;\n\n\t\t\t\treturn {\n\t\t\t\t\tpreview: validPreview ? embedPreview : undefined,\n\t\t\t\t\tfetching: ! hasResolvedEmbedPreview,\n\t\t\t\t\tthemeSupportsResponsive:\n\t\t\t\t\t\tgetThemeSupports()[ 'responsive-embeds' ],\n\t\t\t\t\tcannotEmbed: ! validPreview || previewIsFallback,\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ url ]\n\t\t);\n\n\t/**\n\t * Returns the attributes derived from the preview, merged with the current attributes.\n\t *\n\t * @return {Object} Merged attributes.\n\t */\n\tconst getMergedAttributes = () =>\n\t\tgetMergedAttributesWithPreview(\n\t\t\tattributes,\n\t\t\tpreview,\n\t\t\ttitle,\n\t\t\tresponsive\n\t\t);\n\n\tconst toggleResponsive = () => {\n\t\tconst { allowResponsive, className } = attributes;\n\t\tconst { html } = preview;\n\t\tconst newAllowResponsive = ! allowResponsive;\n\n\t\tsetAttributes( {\n\t\t\tallowResponsive: newAllowResponsive,\n\t\t\tclassName: getClassNames(\n\t\t\t\thtml,\n\t\t\t\tclassName,\n\t\t\t\tresponsive && newAllowResponsive\n\t\t\t),\n\t\t} );\n\t};\n\n\tuseEffect( () => {\n\t\tif ( ! preview?.html || ! cannotEmbed || fetching ) {\n\t\t\treturn;\n\t\t}\n\t\t// At this stage, we're not fetching the preview and know it can't be embedded,\n\t\t// so try removing any trailing slash, and resubmit.\n\t\tconst newURL = url.replace( /\\/$/, '' );\n\t\tsetIsEditingURL( false );\n\t\tsetAttributes( { url: newURL } );\n\t}, [ preview?.html, url, cannotEmbed, fetching ] );\n\n\t// Try a different provider in case the embed url is not supported.\n\tuseEffect( () => {\n\t\tif ( ! cannotEmbed || fetching || ! url ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Until X provider is supported in WordPress, as a workaround we use Twitter provider.\n\t\tif ( getAuthority( url ) === 'x.com' ) {\n\t\t\tconst newURL = new URL( url );\n\t\t\tnewURL.host = 'twitter.com';\n\t\t\tsetAttributes( { url: newURL.toString() } );\n\t\t}\n\t}, [ url, cannotEmbed, fetching, setAttributes ] );\n\n\t// Handle incoming preview.\n\tuseEffect( () => {\n\t\tif ( preview && ! isEditingURL ) {\n\t\t\t// When obtaining an incoming preview,\n\t\t\t// we set the attributes derived from the preview data.\n\t\t\tconst mergedAttributes = getMergedAttributes();\n\t\t\tsetAttributes( mergedAttributes );\n\n\t\t\tif ( onReplace ) {\n\t\t\t\tconst upgradedBlock = createUpgradedEmbedBlock(\n\t\t\t\t\tprops,\n\t\t\t\t\tmergedAttributes\n\t\t\t\t);\n\n\t\t\t\tif ( upgradedBlock ) {\n\t\t\t\t\tonReplace( upgradedBlock );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}, [ preview, isEditingURL ] );\n\n\tuseEffect(\n\t\t() => setShowEmbedBottomSheet( isEditingURL ),\n\t\t[ isEditingURL ]\n\t);\n\n\tconst onEditURL = useCallback(\n\t\t( value ) => {\n\t\t\t// If the embed URL was changed, we need to reset the aspect ratio class.\n\t\t\t// To do this we have to remove the existing ratio class so it can be recalculated.\n\t\t\tif ( attributes.url !== value ) {\n\t\t\t\tconst blockClass = removeAspectRatioClasses(\n\t\t\t\t\tattributes.className\n\t\t\t\t);\n\t\t\t\tsetAttributes( { className: blockClass } );\n\t\t\t}\n\n\t\t\t// The order of the following calls is important, we need to update the URL attribute before changing `isEditingURL`,\n\t\t\t// otherwise the side-effect that potentially replaces the block when updating the local state won't use the new URL\n\t\t\t// for creating the new block.\n\t\t\tsetAttributes( { url: value } );\n\t\t\tsetIsEditingURL( false );\n\t\t},\n\t\t[ attributes, setAttributes ]\n\t);\n\n\tconst blockProps = useBlockProps();\n\n\tif ( fetching ) {\n\t\treturn (\n\t\t\t<View { ...blockProps }>\n\t\t\t\t<EmbedLoading />\n\t\t\t</View>\n\t\t);\n\t}\n\n\tconst showEmbedPlaceholder = ! preview || cannotEmbed;\n\n\t// Even though we set attributes that get derived from the preview,\n\t// we don't access them directly because for the initial render,\n\t// the `setAttributes` call will not have taken effect. If we're\n\t// rendering responsive content, setting the responsive classes\n\t// after the preview has been rendered can result in unwanted\n\t// clipping or scrollbars. The `getAttributesFromPreview` function\n\t// that `getMergedAttributes` uses is memoized so that we're not\n\t// calculating them on every render.\n\tconst {\n\t\ttype,\n\t\tallowResponsive,\n\t\tclassName: classFromPreview,\n\t} = getMergedAttributes();\n\tconst className = clsx( classFromPreview, props.className );\n\n\tconst isProviderPreviewable =\n\t\tPREVIEWABLE_PROVIDERS.includes( providerNameSlug ) ||\n\t\t// For WordPress embeds, we enable the inline preview for all its providers\n\t\t// except the ones that are not supported yet.\n\t\t( WP_EMBED_TYPE === type &&\n\t\t\t! NOT_PREVIEWABLE_WP_EMBED_PROVIDERS.includes( providerNameSlug ) );\n\n\tconst linkLabel = WP_EMBED_TYPE === type ? 'WordPress' : title;\n\n\treturn (\n\t\t<>\n\t\t\t{ showEmbedPlaceholder ? (\n\t\t\t\t<>\n\t\t\t\t\t<View { ...blockProps }>\n\t\t\t\t\t\t<EmbedPlaceholder\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\t\tlabel={ title }\n\t\t\t\t\t\t\tonPress={ ( event ) => {\n\t\t\t\t\t\t\t\tonFocus( event );\n\t\t\t\t\t\t\t\tsetIsEditingURL( true );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tcannotEmbed={ cannotEmbed }\n\t\t\t\t\t\t\tfallback={ () => fallback( url, onReplace ) }\n\t\t\t\t\t\t\ttryAgain={ () => {\n\t\t\t\t\t\t\t\tinvalidateResolution( 'getEmbedPreview', [\n\t\t\t\t\t\t\t\t\turl,\n\t\t\t\t\t\t\t\t] );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\topenEmbedLinkSettings={ () =>\n\t\t\t\t\t\t\t\tsetShowEmbedBottomSheet( true )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</View>\n\t\t\t\t</>\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<EmbedControls\n\t\t\t\t\t\tthemeSupportsResponsive={ themeSupportsResponsive }\n\t\t\t\t\t\tblockSupportsResponsive={ responsive }\n\t\t\t\t\t\tallowResponsive={ allowResponsive }\n\t\t\t\t\t\ttoggleResponsive={ toggleResponsive }\n\t\t\t\t\t\turl={ url }\n\t\t\t\t\t\tlinkLabel={ linkLabel }\n\t\t\t\t\t\tonEditURL={ onEditURL }\n\t\t\t\t\t/>\n\t\t\t\t\t<View { ...blockProps }>\n\t\t\t\t\t\t<EmbedPreview\n\t\t\t\t\t\t\talign={ align }\n\t\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\t\tlabel={ title }\n\t\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\t\tpreview={ preview }\n\t\t\t\t\t\t\tisProviderPreviewable={ isProviderPreviewable }\n\t\t\t\t\t\t\tpreviewable={ previewable }\n\t\t\t\t\t\t\ttype={ type }\n\t\t\t\t\t\t\turl={ url }\n\t\t\t\t\t\t\tisDefaultEmbedInfo={ ! embedInfoByProvider }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</View>\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t<EmbedLinkSettings\n\t\t\t\t// eslint-disable-next-line jsx-a11y/no-autofocus\n\t\t\t\tautoFocus\n\t\t\t\tvalue={ url }\n\t\t\t\tlabel={ linkLabel }\n\t\t\t\tisVisible={ showEmbedBottomSheet }\n\t\t\t\tonClose={ () => setShowEmbedBottomSheet( false ) }\n\t\t\t\tonSubmit={ onEditURL }\n\t\t\t\twithBottomSheet\n\t\t\t/>\n\t\t</>\n\t);\n};\n\nexport default EmbedEdit;\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,wBAAwB,EACxBC,aAAa,EACbC,wBAAwB,EACxBC,QAAQ,EACRC,sBAAsB,EACtBC,8BAA8B,QACxB,QAAQ;AACf,OAAOC,aAAa,MAAM,kBAAkB;AAC5C,SAASC,gBAAgB,QAAQ,SAAS;AAC1C,OAAOC,YAAY,MAAM,iBAAiB;AAC1C,OAAOC,gBAAgB,MAAM,qBAAqB;AAClD,OAAOC,YAAY,MAAM,iBAAiB;AAC1C,OAAOC,iBAAiB,MAAM,uBAAuB;;AAErD;AACA;AACA;AACA,OAAOC,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,EAAEC,QAAQ,EAAEC,SAAS,QAAQ,oBAAoB;AACrE,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SACCC,aAAa,EACbC,KAAK,IAAIC,gBAAgB,QACnB,yBAAyB;AAChC,SAASD,KAAK,IAAIE,SAAS,QAAQ,sBAAsB;AACzD,SAASC,IAAI,QAAQ,uBAAuB;AAC5C,SAASC,YAAY,QAAQ,gBAAgB;;AAE7C;AACA;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AACA,MAAMC,qBAAqB,GAAG,CAAE,SA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,CAACH,IAAI;QAAA,GAAMqE,UAAU;QAAAC,QAAA,eACpBnE,IAAA,CAAChB,YAAY;UACZ2B,KAAK,EAAGA,KAAO;UACf2C,SAAS,EAAGA,SAAW;UACvBjC,QAAQ,EAAGA,QAAU;UACrBG,IAAI,EAAGA,IAAM;UACbL,iBAAiB,EAAGA,iBAAmB;UACvCH,UAAU,EAAGA,UAAY;UACzByD,KAAK,EAAGlD,KAAO;UACfH,OAAO,EAAGA,OAAS;UACnBa,OAAO,EAAGA,OAAS;UACnBqC,qBAAqB,EAAGA,qBAAuB;UAC/CzD,WAAW,EAAGA,WAAa;UAC3BiC,IAAI,EAAGA,IAAM;UACb/B,GAAG,EAAGA,GAAK;UACXgE,kBAAkB,EAAG,CAAEtD;QAAqB,CAC5C;MAAC,CACG,CAAC;IAAA,CACN,CACF,eACDzB,IAAA,CAACf;IACA;IAAA;MACA+F,SAAS;MACThB,KAAK,EAAGjD,GAAK;MACb0D,KAAK,EAAGD,SAAW;MACnBS,SAAS,EAAGnD,oBAAsB;MAClCoD,OAAO,EAAGA,CAAA,KAAMnD,uBAAuB,CAAE,KAAM,CAAG;MAClDoD,QAAQ,EAAGpB,SAAW;MACtBqB,eAAe;IAAA,CACf,CAAC;EAAA,CACD,CAAC;AAEL,CAAC;AAED,eAAe5E,SAAS","ignoreList":[]}
1
+ {"version":3,"names":["createUpgradedEmbedBlock","getClassNames","removeAspectRatioClasses","fallback","getEmbedInfoByProvider","getMergedAttributesWithPreview","EmbedControls","embedContentIcon","EmbedLoading","EmbedPlaceholder","EmbedPreview","EmbedLinkSettings","clsx","_x","useCallback","useState","useEffect","useDispatch","useSelect","useBlockProps","store","blockEditorStore","coreStore","View","getAuthority","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","PREVIEWABLE_PROVIDERS","NOT_PREVIEWABLE_WP_EMBED_PROVIDERS","WP_EMBED_TYPE","EmbedEdit","props","attributes","align","providerNameSlug","previewable","responsive","url","isSelected","onReplace","setAttributes","insertBlocksAfter","onFocus","clientId","defaultEmbedInfo","title","icon","embedInfoByProvider","wasBlockJustInserted","select","isEditingURL","setIsEditingURL","showEmbedBottomSheet","setShowEmbedBottomSheet","invalidateResolution","preview","fetching","themeSupportsResponsive","cannotEmbed","getEmbedPreview","hasFinishedResolution","isPreviewEmbedFallback","getThemeSupports","embedPreview","hasResolvedEmbedPreview","previewIsFallback","badEmbedProvider","html","type","undefined","wordpressCantEmbed","code","validPreview","getMergedAttributes","toggleResponsive","allowResponsive","className","newAllowResponsive","newURL","replace","URL","host","toString","mergedAttributes","upgradedBlock","onEditURL","value","blockClass","blockProps","children","showEmbedPlaceholder","classFromPreview","isProviderPreviewable","includes","linkLabel","label","onPress","event","tryAgain","openEmbedLinkSettings","blockSupportsResponsive","isDefaultEmbedInfo","autoFocus","isVisible","onClose","onSubmit","withBottomSheet"],"sources":["@wordpress/block-library/src/embed/edit.native.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport {\n\tcreateUpgradedEmbedBlock,\n\tgetClassNames,\n\tremoveAspectRatioClasses,\n\tfallback,\n\tgetEmbedInfoByProvider,\n\tgetMergedAttributesWithPreview,\n} from './util';\nimport EmbedControls from './embed-controls';\nimport { embedContentIcon } from './icons';\nimport EmbedLoading from './embed-loading';\nimport EmbedPlaceholder from './embed-placeholder';\nimport EmbedPreview from './embed-preview';\nimport EmbedLinkSettings from './embed-link-settings';\n\n/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { _x } from '@wordpress/i18n';\nimport { useCallback, useState, useEffect } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tuseBlockProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { View } from '@wordpress/primitives';\nimport { getAuthority } from '@wordpress/url';\n\n// The inline preview feature will be released progressible, for this reason\n// the embed will only be considered previewable for the following providers list.\nconst PREVIEWABLE_PROVIDERS = [ 'youtube', 'twitter', 'instagram', 'vimeo' ];\n// Some providers are rendering the inline preview as a WordPress embed and\n// are not supported yet, so we need to disallow them with a fixed providers list.\nconst NOT_PREVIEWABLE_WP_EMBED_PROVIDERS = [ 'pinterest' ];\n\nconst WP_EMBED_TYPE = 'wp-embed';\n\nconst EmbedEdit = ( props ) => {\n\tconst {\n\t\tattributes: { align, providerNameSlug, previewable, responsive, url },\n\t\tattributes,\n\t\tisSelected,\n\t\tonReplace,\n\t\tsetAttributes,\n\t\tinsertBlocksAfter,\n\t\tonFocus,\n\t\tclientId,\n\t} = props;\n\n\tconst defaultEmbedInfo = {\n\t\ttitle: _x( 'Embed', 'block title' ),\n\t\ticon: embedContentIcon,\n\t};\n\tconst embedInfoByProvider = getEmbedInfoByProvider( providerNameSlug );\n\tconst { icon, title } = embedInfoByProvider || defaultEmbedInfo;\n\n\tconst { wasBlockJustInserted } = useSelect(\n\t\t( select ) => ( {\n\t\t\twasBlockJustInserted: select(\n\t\t\t\tblockEditorStore\n\t\t\t).wasBlockJustInserted( clientId, 'inserter_menu' ),\n\t\t} ),\n\t\t[ clientId ]\n\t);\n\tconst [ isEditingURL, setIsEditingURL ] = useState(\n\t\tisSelected && wasBlockJustInserted && ! url\n\t);\n\tconst [ showEmbedBottomSheet, setShowEmbedBottomSheet ] =\n\t\tuseState( isEditingURL );\n\tconst { invalidateResolution } = useDispatch( coreStore );\n\n\tconst { preview, fetching, themeSupportsResponsive, cannotEmbed } =\n\t\tuseSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst {\n\t\t\t\t\tgetEmbedPreview,\n\t\t\t\t\thasFinishedResolution,\n\t\t\t\t\tisPreviewEmbedFallback,\n\t\t\t\t\tgetThemeSupports,\n\t\t\t\t} = select( coreStore );\n\t\t\t\tif ( ! url ) {\n\t\t\t\t\treturn { fetching: false, cannotEmbed: false };\n\t\t\t\t}\n\n\t\t\t\tconst embedPreview = getEmbedPreview( url );\n\t\t\t\tconst hasResolvedEmbedPreview = hasFinishedResolution(\n\t\t\t\t\t'getEmbedPreview',\n\t\t\t\t\t[ url ]\n\t\t\t\t);\n\t\t\t\tconst previewIsFallback = isPreviewEmbedFallback( url );\n\n\t\t\t\t// The external oEmbed provider does not exist. We got no type info and no html.\n\t\t\t\tconst badEmbedProvider =\n\t\t\t\t\tembedPreview?.html === false &&\n\t\t\t\t\tembedPreview?.type === undefined;\n\t\t\t\t// Some WordPress URLs that can't be embedded will cause the API to return\n\t\t\t\t// a valid JSON response with no HTML and `code` set to 404, rather\n\t\t\t\t// than generating a fallback response as other embeds do.\n\t\t\t\tconst wordpressCantEmbed = embedPreview?.code === '404';\n\t\t\t\tconst validPreview =\n\t\t\t\t\t!! embedPreview &&\n\t\t\t\t\t! badEmbedProvider &&\n\t\t\t\t\t! wordpressCantEmbed;\n\n\t\t\t\treturn {\n\t\t\t\t\tpreview: validPreview ? embedPreview : undefined,\n\t\t\t\t\tfetching: ! hasResolvedEmbedPreview,\n\t\t\t\t\tthemeSupportsResponsive:\n\t\t\t\t\t\tgetThemeSupports()[ 'responsive-embeds' ],\n\t\t\t\t\tcannotEmbed: ! validPreview || previewIsFallback,\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ url ]\n\t\t);\n\n\t/**\n\t * Returns the attributes derived from the preview, merged with the current attributes.\n\t *\n\t * @return {Object} Merged attributes.\n\t */\n\tconst getMergedAttributes = () =>\n\t\tgetMergedAttributesWithPreview(\n\t\t\tattributes,\n\t\t\tpreview,\n\t\t\ttitle,\n\t\t\tresponsive\n\t\t);\n\n\tconst toggleResponsive = () => {\n\t\tconst { allowResponsive, className } = attributes;\n\t\tconst { html } = preview;\n\t\tconst newAllowResponsive = ! allowResponsive;\n\n\t\tsetAttributes( {\n\t\t\tallowResponsive: newAllowResponsive,\n\t\t\tclassName: getClassNames(\n\t\t\t\thtml,\n\t\t\t\tclassName,\n\t\t\t\tresponsive && newAllowResponsive\n\t\t\t),\n\t\t} );\n\t};\n\n\tuseEffect( () => {\n\t\tif ( ! preview?.html || ! cannotEmbed || fetching ) {\n\t\t\treturn;\n\t\t}\n\t\t// At this stage, we're not fetching the preview and know it can't be embedded,\n\t\t// so try removing any trailing slash, and resubmit.\n\t\tconst newURL = url.replace( /\\/$/, '' );\n\t\tsetIsEditingURL( false );\n\t\tsetAttributes( { url: newURL } );\n\t}, [ preview?.html, url, cannotEmbed, fetching ] );\n\n\t// Try a different provider in case the embed url is not supported.\n\tuseEffect( () => {\n\t\tif ( ! cannotEmbed || fetching || ! url ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Until X provider is supported in WordPress, as a workaround we use Twitter provider.\n\t\tif ( getAuthority( url ) === 'x.com' ) {\n\t\t\tconst newURL = new URL( url );\n\t\t\tnewURL.host = 'twitter.com';\n\t\t\tsetAttributes( { url: newURL.toString() } );\n\t\t}\n\t}, [ url, cannotEmbed, fetching, setAttributes ] );\n\n\t// Handle incoming preview.\n\tuseEffect( () => {\n\t\tif ( preview && ! isEditingURL ) {\n\t\t\t// When obtaining an incoming preview,\n\t\t\t// we set the attributes derived from the preview data.\n\t\t\tconst mergedAttributes = getMergedAttributes();\n\t\t\tsetAttributes( mergedAttributes );\n\n\t\t\tif ( onReplace ) {\n\t\t\t\tconst upgradedBlock = createUpgradedEmbedBlock(\n\t\t\t\t\tprops,\n\t\t\t\t\tmergedAttributes\n\t\t\t\t);\n\n\t\t\t\tif ( upgradedBlock ) {\n\t\t\t\t\tonReplace( upgradedBlock );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}, [ preview, isEditingURL ] );\n\n\tuseEffect(\n\t\t() => setShowEmbedBottomSheet( isEditingURL ),\n\t\t[ isEditingURL ]\n\t);\n\n\tconst onEditURL = useCallback(\n\t\t( value ) => {\n\t\t\t// If the embed URL was changed, we need to reset the aspect ratio class.\n\t\t\t// To do this we have to remove the existing ratio class so it can be recalculated.\n\t\t\tif ( attributes.url !== value ) {\n\t\t\t\tconst blockClass = removeAspectRatioClasses(\n\t\t\t\t\tattributes.className\n\t\t\t\t);\n\t\t\t\tsetAttributes( { className: blockClass } );\n\t\t\t}\n\n\t\t\t// The order of the following calls is important, we need to update the URL attribute before changing `isEditingURL`,\n\t\t\t// otherwise the side-effect that potentially replaces the block when updating the local state won't use the new URL\n\t\t\t// for creating the new block.\n\t\t\tsetAttributes( { url: value } );\n\t\t\tsetIsEditingURL( false );\n\t\t},\n\t\t[ attributes, setAttributes ]\n\t);\n\n\tconst blockProps = useBlockProps();\n\n\tif ( fetching ) {\n\t\treturn (\n\t\t\t<View { ...blockProps }>\n\t\t\t\t<EmbedLoading />\n\t\t\t</View>\n\t\t);\n\t}\n\n\tconst showEmbedPlaceholder = ! preview || cannotEmbed;\n\n\t// Even though we set attributes that get derived from the preview,\n\t// we don't access them directly because for the initial render,\n\t// the `setAttributes` call will not have taken effect. If we're\n\t// rendering responsive content, setting the responsive classes\n\t// after the preview has been rendered can result in unwanted\n\t// clipping or scrollbars. The `getAttributesFromPreview` function\n\t// that `getMergedAttributes` uses is memoized so that we're not\n\t// calculating them on every render.\n\tconst {\n\t\ttype,\n\t\tallowResponsive,\n\t\tclassName: classFromPreview,\n\t} = getMergedAttributes();\n\tconst className = clsx( classFromPreview, props.className );\n\n\tconst isProviderPreviewable =\n\t\tPREVIEWABLE_PROVIDERS.includes( providerNameSlug ) ||\n\t\t// For WordPress embeds, we enable the inline preview for all its providers\n\t\t// except the ones that are not supported yet.\n\t\t( WP_EMBED_TYPE === type &&\n\t\t\t! NOT_PREVIEWABLE_WP_EMBED_PROVIDERS.includes( providerNameSlug ) );\n\n\tconst linkLabel = WP_EMBED_TYPE === type ? 'WordPress' : title;\n\n\treturn (\n\t\t<>\n\t\t\t{ showEmbedPlaceholder ? (\n\t\t\t\t<>\n\t\t\t\t\t<View { ...blockProps }>\n\t\t\t\t\t\t<EmbedPlaceholder\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\t\tlabel={ title }\n\t\t\t\t\t\t\tonPress={ ( event ) => {\n\t\t\t\t\t\t\t\tonFocus( event );\n\t\t\t\t\t\t\t\tsetIsEditingURL( true );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tcannotEmbed={ cannotEmbed }\n\t\t\t\t\t\t\tfallback={ () => fallback( url, onReplace ) }\n\t\t\t\t\t\t\ttryAgain={ () => {\n\t\t\t\t\t\t\t\tinvalidateResolution( 'getEmbedPreview', [\n\t\t\t\t\t\t\t\t\turl,\n\t\t\t\t\t\t\t\t] );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\topenEmbedLinkSettings={ () =>\n\t\t\t\t\t\t\t\tsetShowEmbedBottomSheet( true )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</View>\n\t\t\t\t</>\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<EmbedControls\n\t\t\t\t\t\tthemeSupportsResponsive={ themeSupportsResponsive }\n\t\t\t\t\t\tblockSupportsResponsive={ responsive }\n\t\t\t\t\t\tallowResponsive={ allowResponsive }\n\t\t\t\t\t\ttoggleResponsive={ toggleResponsive }\n\t\t\t\t\t\turl={ url }\n\t\t\t\t\t\tlinkLabel={ linkLabel }\n\t\t\t\t\t\tonEditURL={ onEditURL }\n\t\t\t\t\t/>\n\t\t\t\t\t<View { ...blockProps }>\n\t\t\t\t\t\t<EmbedPreview\n\t\t\t\t\t\t\talign={ align }\n\t\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\t\tlabel={ title }\n\t\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\t\tpreview={ preview }\n\t\t\t\t\t\t\tisProviderPreviewable={ isProviderPreviewable }\n\t\t\t\t\t\t\tpreviewable={ previewable }\n\t\t\t\t\t\t\ttype={ type }\n\t\t\t\t\t\t\turl={ url }\n\t\t\t\t\t\t\tisDefaultEmbedInfo={ ! embedInfoByProvider }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</View>\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t<EmbedLinkSettings\n\t\t\t\t// eslint-disable-next-line jsx-a11y/no-autofocus\n\t\t\t\tautoFocus\n\t\t\t\tvalue={ url }\n\t\t\t\tlabel={ linkLabel }\n\t\t\t\tisVisible={ showEmbedBottomSheet }\n\t\t\t\tonClose={ () => setShowEmbedBottomSheet( false ) }\n\t\t\t\tonSubmit={ onEditURL }\n\t\t\t\twithBottomSheet\n\t\t\t/>\n\t\t</>\n\t);\n};\n\nexport default EmbedEdit;\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,wBAAwB,EACxBC,aAAa,EACbC,wBAAwB,EACxBC,QAAQ,EACRC,sBAAsB,EACtBC,8BAA8B,QACxB,QAAQ;AACf,OAAOC,aAAa,MAAM,kBAAkB;AAC5C,SAASC,gBAAgB,QAAQ,SAAS;AAC1C,OAAOC,YAAY,MAAM,iBAAiB;AAC1C,OAAOC,gBAAgB,MAAM,qBAAqB;AAClD,OAAOC,YAAY,MAAM,iBAAiB;AAC1C,OAAOC,iBAAiB,MAAM,uBAAuB;;AAErD;AACA;AACA;AACA,OAAOC,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,EAAEC,QAAQ,EAAEC,SAAS,QAAQ,oBAAoB;AACrE,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SACCC,aAAa,EACbC,KAAK,IAAIC,gBAAgB,QACnB,yBAAyB;AAChC,SAASD,KAAK,IAAIE,SAAS,QAAQ,sBAAsB;AACzD,SAASC,IAAI,QAAQ,uBAAuB;AAC5C,SAASC,YAAY,QAAQ,gBAAgB;;AAE7C;AACA;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAA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