@wordpress/block-editor 15.7.1-next.2f1c7c01b.0 → 15.8.1-next.16d95556a.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/block-card/index.js +76 -34
- package/build/components/block-card/index.js.map +2 -2
- package/build/components/block-inspector/edit-contents.js +72 -0
- package/build/components/block-inspector/edit-contents.js.map +7 -0
- package/build/components/block-inspector/index.js +32 -9
- package/build/components/block-inspector/index.js.map +3 -3
- package/build/components/block-list/index.js +9 -9
- package/build/components/block-list/index.js.map +2 -2
- package/build/components/block-switcher/index.js +24 -123
- package/build/components/block-switcher/index.js.map +3 -3
- package/build/components/block-toolbar/block-toolbar-icon.js +175 -0
- package/build/components/block-toolbar/block-toolbar-icon.js.map +7 -0
- package/build/components/block-toolbar/index.js +51 -53
- package/build/components/block-toolbar/index.js.map +3 -3
- package/build/components/block-toolbar/pattern-overrides-dropdown.js +93 -0
- package/build/components/block-toolbar/pattern-overrides-dropdown.js.map +7 -0
- package/build/components/block-tools/index.js +10 -3
- package/build/components/block-tools/index.js.map +2 -2
- package/build/components/border-radius-control/utils.js +7 -3
- package/build/components/border-radius-control/utils.js.map +2 -2
- package/build/components/content-lock/modify-content-lock-menu-item.js +3 -3
- package/build/components/content-lock/modify-content-lock-menu-item.js.map +2 -2
- package/build/components/global-styles/border-panel.js +11 -7
- package/build/components/global-styles/border-panel.js.map +2 -2
- package/build/components/global-styles/color-panel.js +35 -27
- package/build/components/global-styles/color-panel.js.map +2 -2
- package/build/components/global-styles/typography-panel.js +19 -12
- package/build/components/global-styles/typography-panel.js.map +2 -2
- package/build/components/inserter/media-tab/media-tab.js +2 -1
- package/build/components/inserter/media-tab/media-tab.js.map +2 -2
- package/build/components/inspector-controls-tabs/index.js +2 -1
- package/build/components/inspector-controls-tabs/index.js.map +2 -2
- package/build/components/inspector-controls-tabs/styles-tab.js +55 -1
- package/build/components/inspector-controls-tabs/styles-tab.js.map +3 -3
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js +1 -1
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +2 -2
- package/build/components/keyboard-shortcuts/index.js +8 -0
- package/build/components/keyboard-shortcuts/index.js.map +2 -2
- package/build/components/rich-text/format-edit.js +9 -1
- package/build/components/rich-text/format-edit.js.map +2 -2
- package/build/components/rich-text/index.js +1 -0
- package/build/components/rich-text/index.js.map +2 -2
- package/build/hooks/border.js +10 -5
- package/build/hooks/border.js.map +3 -3
- package/build/hooks/color.js +31 -9
- package/build/hooks/color.js.map +3 -3
- package/build/hooks/content-lock-ui.js +4 -5
- package/build/hooks/content-lock-ui.js.map +2 -2
- package/build/hooks/dimensions.js +9 -4
- package/build/hooks/dimensions.js.map +2 -2
- package/build/hooks/fit-text.js +19 -75
- package/build/hooks/fit-text.js.map +3 -3
- package/build/hooks/font-size.js +5 -2
- package/build/hooks/font-size.js.map +2 -2
- package/build/hooks/layout.js +4 -1
- package/build/hooks/layout.js.map +2 -2
- package/build/hooks/spacing-visualizer.js +5 -0
- package/build/hooks/spacing-visualizer.js.map +2 -2
- package/build/hooks/typography.js +23 -14
- package/build/hooks/typography.js.map +3 -3
- package/build/store/private-selectors.js +21 -1
- package/build/store/private-selectors.js.map +2 -2
- package/build/store/reducer.js +4 -0
- package/build/store/reducer.js.map +2 -2
- package/build/store/selectors.js +12 -3
- package/build/store/selectors.js.map +2 -2
- package/build/utils/fit-text-frontend.js +1 -0
- package/build/utils/fit-text-frontend.js.map +2 -2
- package/build/utils/fit-text-utils.js +1 -1
- package/build/utils/fit-text-utils.js.map +1 -1
- package/build-module/components/block-card/index.js +82 -32
- package/build-module/components/block-card/index.js.map +2 -2
- package/build-module/components/block-inspector/edit-contents.js +51 -0
- package/build-module/components/block-inspector/edit-contents.js.map +7 -0
- package/build-module/components/block-inspector/index.js +32 -9
- package/build-module/components/block-inspector/index.js.map +2 -2
- package/build-module/components/block-list/index.js +11 -11
- package/build-module/components/block-list/index.js.map +2 -2
- package/build-module/components/block-switcher/index.js +24 -124
- package/build-module/components/block-switcher/index.js.map +2 -2
- package/build-module/components/block-toolbar/block-toolbar-icon.js +144 -0
- package/build-module/components/block-toolbar/block-toolbar-icon.js.map +7 -0
- package/build-module/components/block-toolbar/index.js +51 -53
- package/build-module/components/block-toolbar/index.js.map +2 -2
- package/build-module/components/block-toolbar/pattern-overrides-dropdown.js +76 -0
- package/build-module/components/block-toolbar/pattern-overrides-dropdown.js.map +7 -0
- package/build-module/components/block-tools/index.js +10 -3
- package/build-module/components/block-tools/index.js.map +2 -2
- package/build-module/components/border-radius-control/utils.js +7 -3
- package/build-module/components/border-radius-control/utils.js.map +2 -2
- package/build-module/components/content-lock/modify-content-lock-menu-item.js +3 -3
- package/build-module/components/content-lock/modify-content-lock-menu-item.js.map +2 -2
- package/build-module/components/global-styles/border-panel.js +11 -7
- package/build-module/components/global-styles/border-panel.js.map +2 -2
- package/build-module/components/global-styles/color-panel.js +34 -27
- package/build-module/components/global-styles/color-panel.js.map +2 -2
- package/build-module/components/global-styles/typography-panel.js +21 -13
- package/build-module/components/global-styles/typography-panel.js.map +2 -2
- package/build-module/components/inserter/media-tab/media-tab.js +2 -1
- package/build-module/components/inserter/media-tab/media-tab.js.map +2 -2
- package/build-module/components/inspector-controls-tabs/index.js +2 -1
- package/build-module/components/inspector-controls-tabs/index.js.map +2 -2
- package/build-module/components/inspector-controls-tabs/styles-tab.js +55 -1
- package/build-module/components/inspector-controls-tabs/styles-tab.js.map +2 -2
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js +1 -1
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +2 -2
- package/build-module/components/keyboard-shortcuts/index.js +8 -0
- package/build-module/components/keyboard-shortcuts/index.js.map +2 -2
- package/build-module/components/rich-text/format-edit.js +9 -1
- package/build-module/components/rich-text/format-edit.js.map +2 -2
- package/build-module/components/rich-text/index.js +1 -0
- package/build-module/components/rich-text/index.js.map +2 -2
- package/build-module/hooks/border.js +10 -5
- package/build-module/hooks/border.js.map +3 -3
- package/build-module/hooks/color.js +31 -9
- package/build-module/hooks/color.js.map +3 -3
- package/build-module/hooks/content-lock-ui.js +4 -5
- package/build-module/hooks/content-lock-ui.js.map +2 -2
- package/build-module/hooks/dimensions.js +9 -4
- package/build-module/hooks/dimensions.js.map +2 -2
- package/build-module/hooks/fit-text.js +18 -66
- package/build-module/hooks/fit-text.js.map +2 -2
- package/build-module/hooks/font-size.js +5 -2
- package/build-module/hooks/font-size.js.map +2 -2
- package/build-module/hooks/layout.js +4 -1
- package/build-module/hooks/layout.js.map +2 -2
- package/build-module/hooks/spacing-visualizer.js +5 -0
- package/build-module/hooks/spacing-visualizer.js.map +2 -2
- package/build-module/hooks/typography.js +23 -14
- package/build-module/hooks/typography.js.map +3 -3
- package/build-module/store/private-selectors.js +20 -1
- package/build-module/store/private-selectors.js.map +2 -2
- package/build-module/store/reducer.js +4 -0
- package/build-module/store/reducer.js.map +2 -2
- package/build-module/store/selectors.js +12 -3
- package/build-module/store/selectors.js.map +2 -2
- package/build-module/utils/fit-text-frontend.js +1 -0
- package/build-module/utils/fit-text-frontend.js.map +2 -2
- package/build-module/utils/fit-text-utils.js +1 -1
- package/build-module/utils/fit-text-utils.js.map +1 -1
- package/build-style/style-rtl.css +31 -71
- package/build-style/style.css +31 -71
- package/package.json +37 -37
- package/src/components/block-card/index.js +95 -38
- package/src/components/block-card/style.scss +17 -1
- package/src/components/block-inspector/edit-contents.js +64 -0
- package/src/components/block-inspector/index.js +35 -13
- package/src/components/block-inspector/style.scss +6 -3
- package/src/components/block-list/index.js +11 -9
- package/src/components/block-switcher/block-transformations-menu.native.js +0 -1
- package/src/components/block-switcher/index.js +51 -180
- package/src/components/block-switcher/style.scss +0 -70
- package/src/components/block-switcher/test/index.js +17 -18
- package/src/components/block-toolbar/block-toolbar-icon.js +173 -0
- package/src/components/block-toolbar/index.js +50 -52
- package/src/components/block-toolbar/pattern-overrides-dropdown.js +99 -0
- package/src/components/block-toolbar/style.scss +21 -21
- package/src/components/block-toolbar/test/__snapshots__/block-toolbar-menu.native.js.snap +6 -4
- package/src/components/block-toolbar/test/block-toolbar-icon.js +182 -0
- package/src/components/block-toolbar/test/block-toolbar-menu.native.js +2 -2
- package/src/components/block-tools/index.js +11 -1
- package/src/components/border-radius-control/test/utils.js +90 -0
- package/src/components/border-radius-control/utils.js +7 -3
- package/src/components/content-lock/modify-content-lock-menu-item.js +9 -3
- package/src/components/global-styles/border-panel.js +11 -7
- package/src/components/global-styles/color-panel.js +32 -26
- package/src/components/global-styles/typography-panel.js +14 -1
- package/src/components/inserter/media-tab/media-tab.js +7 -1
- package/src/components/inspector-controls-tabs/index.js +1 -0
- package/src/components/inspector-controls-tabs/styles-tab.js +58 -0
- package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +5 -1
- package/src/components/keyboard-shortcuts/index.js +9 -0
- package/src/components/rich-text/format-edit.js +9 -1
- package/src/components/rich-text/index.js +1 -0
- package/src/hooks/border.js +12 -6
- package/src/hooks/color.js +40 -13
- package/src/hooks/content-lock-ui.js +9 -6
- package/src/hooks/dimensions.js +25 -17
- package/src/hooks/fit-text.js +23 -84
- package/src/hooks/font-size.js +7 -2
- package/src/hooks/layout.js +11 -7
- package/src/hooks/spacing-visualizer.js +9 -1
- package/src/hooks/typography.js +24 -18
- package/src/store/private-selectors.js +26 -1
- package/src/store/reducer.js +6 -0
- package/src/store/selectors.js +24 -3
- package/src/utils/fit-text-frontend.js +1 -0
- package/src/utils/fit-text-utils.js +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/build/components/block-inspector/edit-contents-button.js +0 -61
- package/build/components/block-inspector/edit-contents-button.js.map +0 -7
- package/build-module/components/block-inspector/edit-contents-button.js +0 -40
- package/build-module/components/block-inspector/edit-contents-button.js.map +0 -7
- package/src/components/block-inspector/edit-contents-button.js +0 -46
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/fit-text-frontend.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * Frontend fit text functionality.\n * Automatically detects and initializes fit text on blocks with the has-fit-text class.\n * Supports both initial page load and Interactivity API client-side navigation.\n */\n\n/**\n * WordPress dependencies\n */\nimport { store, getElement, getContext } from '@wordpress/interactivity';\n\n/**\n * Internal dependencies\n */\nimport { optimizeFitText } from './fit-text-utils';\n\n// Initialize via Interactivity API for client-side navigation\nstore( 'core/fit-text', {\n\tcallbacks: {\n\t\tinit() {\n\t\t\tconst context = getContext();\n\t\t\tconst { ref } = getElement();\n\n\t\t\tconst applyFontSize = ( fontSize ) => {\n\t\t\t\tif ( fontSize === 0 ) {\n\t\t\t\t\tref.style.fontSize = '';\n\t\t\t\t} else {\n\t\t\t\t\tref.style.fontSize = `${ fontSize }px`;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t// Initial fit text optimization.\n\t\t\tcontext.fontSize = optimizeFitText( ref, applyFontSize );\n\n\t\t\t// Starts ResizeObserver to handle dynamic resizing.\n\t\t\tif ( window.ResizeObserver && ref.parentElement ) {\n\t\t\t\tconst resizeObserver = new window.ResizeObserver( () => {\n\t\t\t\t\tcontext.fontSize = optimizeFitText( ref, applyFontSize );\n\t\t\t\t} );\n\t\t\t\tresizeObserver.observe( ref.parentElement );\n\n\t\t\t\t// Return cleanup function to be called when element is removed.\n\t\t\t\treturn () => {\n\t\t\t\t\tif ( resizeObserver ) {\n\t\t\t\t\t\tresizeObserver.disconnect();\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\t},\n\t},\n} );\n"],
|
|
5
|
-
"mappings": ";AASA,SAAS,OAAO,YAAY,kBAAkB;AAK9C,SAAS,uBAAuB;AAGhC,MAAO,iBAAiB;AAAA,EACvB,WAAW;AAAA,IACV,OAAO;AACN,YAAM,UAAU,WAAW;AAC3B,YAAM,EAAE,IAAI,IAAI,WAAW;AAE3B,YAAM,gBAAgB,CAAE,aAAc;AACrC,YAAK,aAAa,GAAI;AACrB,cAAI,MAAM,WAAW;AAAA,QACtB,OAAO;AACN,cAAI,MAAM,WAAW,GAAI,QAAS;AAAA,QACnC;AAAA,MACD;AAGA,cAAQ,WAAW,gBAAiB,KAAK,aAAc;AAGvD,UAAK,OAAO,kBAAkB,IAAI,eAAgB;AACjD,cAAM,iBAAiB,IAAI,OAAO,eAAgB,MAAM;AACvD,kBAAQ,WAAW,gBAAiB,KAAK,aAAc;AAAA,QACxD,CAAE;AACF,uBAAe,QAAS,IAAI,aAAc;
|
|
4
|
+
"sourcesContent": ["/**\n * Frontend fit text functionality.\n * Automatically detects and initializes fit text on blocks with the has-fit-text class.\n * Supports both initial page load and Interactivity API client-side navigation.\n */\n\n/**\n * WordPress dependencies\n */\nimport { store, getElement, getContext } from '@wordpress/interactivity';\n\n/**\n * Internal dependencies\n */\nimport { optimizeFitText } from './fit-text-utils';\n\n// Initialize via Interactivity API for client-side navigation\nstore( 'core/fit-text', {\n\tcallbacks: {\n\t\tinit() {\n\t\t\tconst context = getContext();\n\t\t\tconst { ref } = getElement();\n\n\t\t\tconst applyFontSize = ( fontSize ) => {\n\t\t\t\tif ( fontSize === 0 ) {\n\t\t\t\t\tref.style.fontSize = '';\n\t\t\t\t} else {\n\t\t\t\t\tref.style.fontSize = `${ fontSize }px`;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t// Initial fit text optimization.\n\t\t\tcontext.fontSize = optimizeFitText( ref, applyFontSize );\n\n\t\t\t// Starts ResizeObserver to handle dynamic resizing.\n\t\t\tif ( window.ResizeObserver && ref.parentElement ) {\n\t\t\t\tconst resizeObserver = new window.ResizeObserver( () => {\n\t\t\t\t\tcontext.fontSize = optimizeFitText( ref, applyFontSize );\n\t\t\t\t} );\n\t\t\t\tresizeObserver.observe( ref.parentElement );\n\t\t\t\tresizeObserver.observe( ref );\n\n\t\t\t\t// Return cleanup function to be called when element is removed.\n\t\t\t\treturn () => {\n\t\t\t\t\tif ( resizeObserver ) {\n\t\t\t\t\t\tresizeObserver.disconnect();\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\t},\n\t},\n} );\n"],
|
|
5
|
+
"mappings": ";AASA,SAAS,OAAO,YAAY,kBAAkB;AAK9C,SAAS,uBAAuB;AAGhC,MAAO,iBAAiB;AAAA,EACvB,WAAW;AAAA,IACV,OAAO;AACN,YAAM,UAAU,WAAW;AAC3B,YAAM,EAAE,IAAI,IAAI,WAAW;AAE3B,YAAM,gBAAgB,CAAE,aAAc;AACrC,YAAK,aAAa,GAAI;AACrB,cAAI,MAAM,WAAW;AAAA,QACtB,OAAO;AACN,cAAI,MAAM,WAAW,GAAI,QAAS;AAAA,QACnC;AAAA,MACD;AAGA,cAAQ,WAAW,gBAAiB,KAAK,aAAc;AAGvD,UAAK,OAAO,kBAAkB,IAAI,eAAgB;AACjD,cAAM,iBAAiB,IAAI,OAAO,eAAgB,MAAM;AACvD,kBAAQ,WAAW,gBAAiB,KAAK,aAAc;AAAA,QACxD,CAAE;AACF,uBAAe,QAAS,IAAI,aAAc;AAC1C,uBAAe,QAAS,GAAI;AAG5B,eAAO,MAAM;AACZ,cAAK,gBAAiB;AACrB,2BAAe,WAAW;AAAA,UAC3B;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD,CAAE;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
function findOptimalFontSize(textElement, applyFontSize) {
|
|
3
3
|
const alreadyHasScrollableHeight = textElement.scrollHeight > textElement.clientHeight;
|
|
4
4
|
let minSize = 5;
|
|
5
|
-
let maxSize =
|
|
5
|
+
let maxSize = 2400;
|
|
6
6
|
let bestSize = minSize;
|
|
7
7
|
while (minSize <= maxSize) {
|
|
8
8
|
const midSize = Math.floor((minSize + maxSize) / 2);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/fit-text-utils.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * Shared utility functions for fit text functionality.\n * Uses callback-based approach for maximum code reuse between editor and frontend.\n */\n\n/**\n * Find optimal font size using simple binary search between 5-600px.\n *\n * @param {HTMLElement} textElement The text element\n * @param {Function} applyFontSize Function that receives font size in pixels\n * @return {number} Optimal font size\n */\nfunction findOptimalFontSize( textElement, applyFontSize ) {\n\tconst alreadyHasScrollableHeight =\n\t\ttextElement.scrollHeight > textElement.clientHeight;\n\tlet minSize = 5;\n\tlet maxSize =
|
|
4
|
+
"sourcesContent": ["/**\n * Shared utility functions for fit text functionality.\n * Uses callback-based approach for maximum code reuse between editor and frontend.\n */\n\n/**\n * Find optimal font size using simple binary search between 5-600px.\n *\n * @param {HTMLElement} textElement The text element\n * @param {Function} applyFontSize Function that receives font size in pixels\n * @return {number} Optimal font size\n */\nfunction findOptimalFontSize( textElement, applyFontSize ) {\n\tconst alreadyHasScrollableHeight =\n\t\ttextElement.scrollHeight > textElement.clientHeight;\n\tlet minSize = 5;\n\tlet maxSize = 2400;\n\tlet bestSize = minSize;\n\n\twhile ( minSize <= maxSize ) {\n\t\tconst midSize = Math.floor( ( minSize + maxSize ) / 2 );\n\t\tapplyFontSize( midSize );\n\n\t\tconst fitsWidth = textElement.scrollWidth <= textElement.clientWidth;\n\t\tconst fitsHeight =\n\t\t\talreadyHasScrollableHeight ||\n\t\t\ttextElement.scrollHeight <= textElement.clientHeight;\n\n\t\tif ( fitsWidth && fitsHeight ) {\n\t\t\tbestSize = midSize;\n\t\t\tminSize = midSize + 1;\n\t\t} else {\n\t\t\tmaxSize = midSize - 1;\n\t\t}\n\t}\n\n\treturn bestSize;\n}\n\n/**\n * Complete fit text optimization for a single text element.\n * Handles the full flow using callbacks for font size application.\n *\n * @param {HTMLElement} textElement The text element (paragraph, heading, etc.)\n * @param {Function} applyFontSize Function that receives font size in pixels (0 to clear, >0 to apply)\n */\nexport function optimizeFitText( textElement, applyFontSize ) {\n\tif ( ! textElement ) {\n\t\treturn;\n\t}\n\n\tapplyFontSize( 0 );\n\n\tconst optimalSize = findOptimalFontSize( textElement, applyFontSize );\n\n\tapplyFontSize( optimalSize );\n\treturn optimalSize;\n}\n"],
|
|
5
5
|
"mappings": ";AAYA,SAAS,oBAAqB,aAAa,eAAgB;AAC1D,QAAM,6BACL,YAAY,eAAe,YAAY;AACxC,MAAI,UAAU;AACd,MAAI,UAAU;AACd,MAAI,WAAW;AAEf,SAAQ,WAAW,SAAU;AAC5B,UAAM,UAAU,KAAK,OAAS,UAAU,WAAY,CAAE;AACtD,kBAAe,OAAQ;AAEvB,UAAM,YAAY,YAAY,eAAe,YAAY;AACzD,UAAM,aACL,8BACA,YAAY,gBAAgB,YAAY;AAEzC,QAAK,aAAa,YAAa;AAC9B,iBAAW;AACX,gBAAU,UAAU;AAAA,IACrB,OAAO;AACN,gBAAU,UAAU;AAAA,IACrB;AAAA,EACD;AAEA,SAAO;AACR;AASO,SAAS,gBAAiB,aAAa,eAAgB;AAC7D,MAAK,CAAE,aAAc;AACpB;AAAA,EACD;AAEA,gBAAe,CAAE;AAEjB,QAAM,cAAc,oBAAqB,aAAa,aAAc;AAEpE,gBAAe,WAAY;AAC3B,SAAO;AACR;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -360,8 +360,10 @@ iframe[name=editor-canvas] {
|
|
|
360
360
|
border-top: 1px solid #ddd;
|
|
361
361
|
}
|
|
362
362
|
|
|
363
|
-
.block-editor-block-inspector-edit-contents
|
|
364
|
-
margin
|
|
363
|
+
.block-editor-block-inspector-edit-contents {
|
|
364
|
+
margin: 0 16px 16px 16px;
|
|
365
|
+
}
|
|
366
|
+
.block-editor-block-inspector-edit-contents .block-editor-block-inspector-edit-contents__button {
|
|
365
367
|
justify-content: center;
|
|
366
368
|
}
|
|
367
369
|
|
|
@@ -659,6 +661,19 @@ iframe[name=editor-canvas] {
|
|
|
659
661
|
display: flex;
|
|
660
662
|
padding: 16px;
|
|
661
663
|
}
|
|
664
|
+
.block-editor-block-card.is-parent {
|
|
665
|
+
padding-bottom: 4px;
|
|
666
|
+
}
|
|
667
|
+
.block-editor-block-card.is-child {
|
|
668
|
+
padding-top: 4px;
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
.block-editor-block-card__parent-select-button {
|
|
672
|
+
padding: 0;
|
|
673
|
+
align-items: start;
|
|
674
|
+
text-align: start;
|
|
675
|
+
height: auto !important;
|
|
676
|
+
}
|
|
662
677
|
|
|
663
678
|
.block-editor-block-card__title {
|
|
664
679
|
font-weight: 499;
|
|
@@ -677,7 +692,8 @@ iframe[name=editor-canvas] {
|
|
|
677
692
|
padding: 3px 0;
|
|
678
693
|
}
|
|
679
694
|
|
|
680
|
-
.block-editor-block-card .block-editor-block-icon
|
|
695
|
+
.block-editor-block-card .block-editor-block-icon,
|
|
696
|
+
.block-editor-block-card__child-indicator-icon {
|
|
681
697
|
flex: 0 0 24px;
|
|
682
698
|
margin-right: 0;
|
|
683
699
|
margin-left: 12px;
|
|
@@ -1192,45 +1208,6 @@ iframe[name=editor-canvas] {
|
|
|
1192
1208
|
box-sizing: border-box !important;
|
|
1193
1209
|
}
|
|
1194
1210
|
|
|
1195
|
-
.block-editor-block-switcher {
|
|
1196
|
-
position: relative;
|
|
1197
|
-
}
|
|
1198
|
-
.block-editor-block-switcher .components-button.components-dropdown-menu__toggle.has-icon.has-icon {
|
|
1199
|
-
min-width: 36px;
|
|
1200
|
-
}
|
|
1201
|
-
|
|
1202
|
-
.block-editor-block-switcher__no-switcher-icon,
|
|
1203
|
-
.block-editor-block-switcher__toggle {
|
|
1204
|
-
position: relative;
|
|
1205
|
-
}
|
|
1206
|
-
|
|
1207
|
-
.components-button.block-editor-block-switcher__toggle,
|
|
1208
|
-
.components-button.block-editor-block-switcher__no-switcher-icon {
|
|
1209
|
-
margin: 0;
|
|
1210
|
-
display: block;
|
|
1211
|
-
height: 48px;
|
|
1212
|
-
}
|
|
1213
|
-
.components-button.block-editor-block-switcher__toggle .block-editor-block-icon,
|
|
1214
|
-
.components-button.block-editor-block-switcher__no-switcher-icon .block-editor-block-icon {
|
|
1215
|
-
margin: auto;
|
|
1216
|
-
}
|
|
1217
|
-
|
|
1218
|
-
.components-button.block-editor-block-switcher__no-switcher-icon {
|
|
1219
|
-
display: flex;
|
|
1220
|
-
}
|
|
1221
|
-
.components-button.block-editor-block-switcher__no-switcher-icon .block-editor-block-icon {
|
|
1222
|
-
margin-left: auto;
|
|
1223
|
-
margin-right: auto;
|
|
1224
|
-
min-width: 24px !important;
|
|
1225
|
-
}
|
|
1226
|
-
|
|
1227
|
-
.components-button.block-editor-block-switcher__no-switcher-icon[aria-disabled=true] {
|
|
1228
|
-
color: #1e1e1e;
|
|
1229
|
-
}
|
|
1230
|
-
.components-button.block-editor-block-switcher__no-switcher-icon[aria-disabled=true]:hover {
|
|
1231
|
-
color: #1e1e1e;
|
|
1232
|
-
}
|
|
1233
|
-
|
|
1234
1211
|
.components-popover.block-editor-block-switcher__popover .components-popover__content {
|
|
1235
1212
|
min-width: 300px;
|
|
1236
1213
|
}
|
|
@@ -1274,25 +1251,6 @@ iframe[name=editor-canvas] {
|
|
|
1274
1251
|
font-weight: 499;
|
|
1275
1252
|
}
|
|
1276
1253
|
|
|
1277
|
-
.block-editor-block-contextual-toolbar .components-button.block-editor-block-switcher__no-switcher-icon {
|
|
1278
|
-
min-width: 36px;
|
|
1279
|
-
}
|
|
1280
|
-
.block-editor-block-contextual-toolbar .components-button.block-editor-block-switcher__no-switcher-icon,
|
|
1281
|
-
.block-editor-block-contextual-toolbar .components-button.block-editor-block-switcher__toggle {
|
|
1282
|
-
height: 48px;
|
|
1283
|
-
}
|
|
1284
|
-
.block-editor-block-contextual-toolbar .components-button.block-editor-block-switcher__no-switcher-icon .block-editor-block-icon,
|
|
1285
|
-
.block-editor-block-contextual-toolbar .components-button.block-editor-block-switcher__no-switcher-icon .block-editor-block-switcher__transform,
|
|
1286
|
-
.block-editor-block-contextual-toolbar .components-button.block-editor-block-switcher__toggle .block-editor-block-icon,
|
|
1287
|
-
.block-editor-block-contextual-toolbar .components-button.block-editor-block-switcher__toggle .block-editor-block-switcher__transform {
|
|
1288
|
-
width: 48px;
|
|
1289
|
-
height: 48px;
|
|
1290
|
-
}
|
|
1291
|
-
.block-editor-block-contextual-toolbar .components-button.block-editor-block-switcher__no-switcher-icon .block-editor-block-switcher__transform,
|
|
1292
|
-
.block-editor-block-contextual-toolbar .components-button.block-editor-block-switcher__toggle .block-editor-block-switcher__transform {
|
|
1293
|
-
padding: 12px;
|
|
1294
|
-
}
|
|
1295
|
-
|
|
1296
1254
|
.block-editor-block-switcher__preview-patterns-container {
|
|
1297
1255
|
padding-bottom: 16px;
|
|
1298
1256
|
}
|
|
@@ -3552,10 +3510,13 @@ div.block-editor-bindings__panel button:hover .block-editor-bindings__item span
|
|
|
3552
3510
|
background: color-mix(in srgb, var(--wp-block-synced-color) 10%, transparent);
|
|
3553
3511
|
border-radius: 2px;
|
|
3554
3512
|
}
|
|
3555
|
-
.block-editor-block-toolbar
|
|
3556
|
-
color:
|
|
3513
|
+
.block-editor-block-toolbar .components-button.block-editor-block-toolbar__block-icon-button[aria-disabled=true] {
|
|
3514
|
+
color: #1e1e1e;
|
|
3515
|
+
}
|
|
3516
|
+
.block-editor-block-toolbar .components-button.block-editor-block-toolbar__block-icon-button[aria-disabled=true]:hover {
|
|
3517
|
+
color: #1e1e1e;
|
|
3557
3518
|
}
|
|
3558
|
-
.block-editor-block-toolbar.is-synced .block-editor-block-
|
|
3519
|
+
.block-editor-block-toolbar.is-synced .block-editor-block-toolbar__block-icon, .block-editor-block-toolbar.is-connected .block-editor-block-toolbar__block-icon {
|
|
3559
3520
|
color: var(--wp-block-synced-color);
|
|
3560
3521
|
}
|
|
3561
3522
|
.block-editor-block-toolbar > :last-child,
|
|
@@ -3649,15 +3610,15 @@ div.block-editor-bindings__panel button:hover .block-editor-bindings__item span
|
|
|
3649
3610
|
width: 2px;
|
|
3650
3611
|
}
|
|
3651
3612
|
|
|
3652
|
-
.block-editor-block-toolbar__block-controls .block-editor-block-switcher .components-dropdown-menu__toggle .block-editor-block-icon,
|
|
3653
|
-
.block-editor-block-toolbar__block-controls .block-editor-block-switcher__no-switcher-icon .block-editor-block-icon {
|
|
3654
|
-
width: 24px !important;
|
|
3655
|
-
margin: 0 !important;
|
|
3656
|
-
}
|
|
3657
3613
|
.block-editor-block-toolbar__block-controls .components-toolbar-group {
|
|
3658
3614
|
padding: 0;
|
|
3659
3615
|
}
|
|
3660
3616
|
|
|
3617
|
+
.block-editor-block-toolbar__pattern-overrides-popover .components-popover__content {
|
|
3618
|
+
min-width: 260px;
|
|
3619
|
+
padding: 16px;
|
|
3620
|
+
}
|
|
3621
|
+
|
|
3661
3622
|
.block-editor-block-toolbar .components-toolbar-group,
|
|
3662
3623
|
.block-editor-block-toolbar .components-toolbar,
|
|
3663
3624
|
.block-editor-rich-text__inline-format-toolbar-group .components-toolbar-group,
|
|
@@ -3684,8 +3645,7 @@ div.block-editor-bindings__panel button:hover .block-editor-bindings__item span
|
|
|
3684
3645
|
padding-right: 6px;
|
|
3685
3646
|
padding-left: 6px;
|
|
3686
3647
|
}
|
|
3687
|
-
.show-icon-labels .block-editor-block-
|
|
3688
|
-
.show-icon-labels .block-editor-block-switcher__no-switcher-icon .block-editor-block-icon {
|
|
3648
|
+
.show-icon-labels .block-editor-block-icon {
|
|
3689
3649
|
width: 0 !important;
|
|
3690
3650
|
height: 0 !important;
|
|
3691
3651
|
min-width: 0 !important;
|
package/build-style/style.css
CHANGED
|
@@ -360,8 +360,10 @@ iframe[name=editor-canvas] {
|
|
|
360
360
|
border-top: 1px solid #ddd;
|
|
361
361
|
}
|
|
362
362
|
|
|
363
|
-
.block-editor-block-inspector-edit-contents
|
|
364
|
-
margin
|
|
363
|
+
.block-editor-block-inspector-edit-contents {
|
|
364
|
+
margin: 0 16px 16px 16px;
|
|
365
|
+
}
|
|
366
|
+
.block-editor-block-inspector-edit-contents .block-editor-block-inspector-edit-contents__button {
|
|
365
367
|
justify-content: center;
|
|
366
368
|
}
|
|
367
369
|
|
|
@@ -659,6 +661,19 @@ iframe[name=editor-canvas] {
|
|
|
659
661
|
display: flex;
|
|
660
662
|
padding: 16px;
|
|
661
663
|
}
|
|
664
|
+
.block-editor-block-card.is-parent {
|
|
665
|
+
padding-bottom: 4px;
|
|
666
|
+
}
|
|
667
|
+
.block-editor-block-card.is-child {
|
|
668
|
+
padding-top: 4px;
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
.block-editor-block-card__parent-select-button {
|
|
672
|
+
padding: 0;
|
|
673
|
+
align-items: start;
|
|
674
|
+
text-align: start;
|
|
675
|
+
height: auto !important;
|
|
676
|
+
}
|
|
662
677
|
|
|
663
678
|
.block-editor-block-card__title {
|
|
664
679
|
font-weight: 499;
|
|
@@ -677,7 +692,8 @@ iframe[name=editor-canvas] {
|
|
|
677
692
|
padding: 3px 0;
|
|
678
693
|
}
|
|
679
694
|
|
|
680
|
-
.block-editor-block-card .block-editor-block-icon
|
|
695
|
+
.block-editor-block-card .block-editor-block-icon,
|
|
696
|
+
.block-editor-block-card__child-indicator-icon {
|
|
681
697
|
flex: 0 0 24px;
|
|
682
698
|
margin-left: 0;
|
|
683
699
|
margin-right: 12px;
|
|
@@ -1192,45 +1208,6 @@ iframe[name=editor-canvas] {
|
|
|
1192
1208
|
box-sizing: border-box !important;
|
|
1193
1209
|
}
|
|
1194
1210
|
|
|
1195
|
-
.block-editor-block-switcher {
|
|
1196
|
-
position: relative;
|
|
1197
|
-
}
|
|
1198
|
-
.block-editor-block-switcher .components-button.components-dropdown-menu__toggle.has-icon.has-icon {
|
|
1199
|
-
min-width: 36px;
|
|
1200
|
-
}
|
|
1201
|
-
|
|
1202
|
-
.block-editor-block-switcher__no-switcher-icon,
|
|
1203
|
-
.block-editor-block-switcher__toggle {
|
|
1204
|
-
position: relative;
|
|
1205
|
-
}
|
|
1206
|
-
|
|
1207
|
-
.components-button.block-editor-block-switcher__toggle,
|
|
1208
|
-
.components-button.block-editor-block-switcher__no-switcher-icon {
|
|
1209
|
-
margin: 0;
|
|
1210
|
-
display: block;
|
|
1211
|
-
height: 48px;
|
|
1212
|
-
}
|
|
1213
|
-
.components-button.block-editor-block-switcher__toggle .block-editor-block-icon,
|
|
1214
|
-
.components-button.block-editor-block-switcher__no-switcher-icon .block-editor-block-icon {
|
|
1215
|
-
margin: auto;
|
|
1216
|
-
}
|
|
1217
|
-
|
|
1218
|
-
.components-button.block-editor-block-switcher__no-switcher-icon {
|
|
1219
|
-
display: flex;
|
|
1220
|
-
}
|
|
1221
|
-
.components-button.block-editor-block-switcher__no-switcher-icon .block-editor-block-icon {
|
|
1222
|
-
margin-right: auto;
|
|
1223
|
-
margin-left: auto;
|
|
1224
|
-
min-width: 24px !important;
|
|
1225
|
-
}
|
|
1226
|
-
|
|
1227
|
-
.components-button.block-editor-block-switcher__no-switcher-icon[aria-disabled=true] {
|
|
1228
|
-
color: #1e1e1e;
|
|
1229
|
-
}
|
|
1230
|
-
.components-button.block-editor-block-switcher__no-switcher-icon[aria-disabled=true]:hover {
|
|
1231
|
-
color: #1e1e1e;
|
|
1232
|
-
}
|
|
1233
|
-
|
|
1234
1211
|
.components-popover.block-editor-block-switcher__popover .components-popover__content {
|
|
1235
1212
|
min-width: 300px;
|
|
1236
1213
|
}
|
|
@@ -1274,25 +1251,6 @@ iframe[name=editor-canvas] {
|
|
|
1274
1251
|
font-weight: 499;
|
|
1275
1252
|
}
|
|
1276
1253
|
|
|
1277
|
-
.block-editor-block-contextual-toolbar .components-button.block-editor-block-switcher__no-switcher-icon {
|
|
1278
|
-
min-width: 36px;
|
|
1279
|
-
}
|
|
1280
|
-
.block-editor-block-contextual-toolbar .components-button.block-editor-block-switcher__no-switcher-icon,
|
|
1281
|
-
.block-editor-block-contextual-toolbar .components-button.block-editor-block-switcher__toggle {
|
|
1282
|
-
height: 48px;
|
|
1283
|
-
}
|
|
1284
|
-
.block-editor-block-contextual-toolbar .components-button.block-editor-block-switcher__no-switcher-icon .block-editor-block-icon,
|
|
1285
|
-
.block-editor-block-contextual-toolbar .components-button.block-editor-block-switcher__no-switcher-icon .block-editor-block-switcher__transform,
|
|
1286
|
-
.block-editor-block-contextual-toolbar .components-button.block-editor-block-switcher__toggle .block-editor-block-icon,
|
|
1287
|
-
.block-editor-block-contextual-toolbar .components-button.block-editor-block-switcher__toggle .block-editor-block-switcher__transform {
|
|
1288
|
-
width: 48px;
|
|
1289
|
-
height: 48px;
|
|
1290
|
-
}
|
|
1291
|
-
.block-editor-block-contextual-toolbar .components-button.block-editor-block-switcher__no-switcher-icon .block-editor-block-switcher__transform,
|
|
1292
|
-
.block-editor-block-contextual-toolbar .components-button.block-editor-block-switcher__toggle .block-editor-block-switcher__transform {
|
|
1293
|
-
padding: 12px;
|
|
1294
|
-
}
|
|
1295
|
-
|
|
1296
1254
|
.block-editor-block-switcher__preview-patterns-container {
|
|
1297
1255
|
padding-bottom: 16px;
|
|
1298
1256
|
}
|
|
@@ -3554,10 +3512,13 @@ div.block-editor-bindings__panel button:hover .block-editor-bindings__item span
|
|
|
3554
3512
|
background: color-mix(in srgb, var(--wp-block-synced-color) 10%, transparent);
|
|
3555
3513
|
border-radius: 2px;
|
|
3556
3514
|
}
|
|
3557
|
-
.block-editor-block-toolbar
|
|
3558
|
-
color:
|
|
3515
|
+
.block-editor-block-toolbar .components-button.block-editor-block-toolbar__block-icon-button[aria-disabled=true] {
|
|
3516
|
+
color: #1e1e1e;
|
|
3517
|
+
}
|
|
3518
|
+
.block-editor-block-toolbar .components-button.block-editor-block-toolbar__block-icon-button[aria-disabled=true]:hover {
|
|
3519
|
+
color: #1e1e1e;
|
|
3559
3520
|
}
|
|
3560
|
-
.block-editor-block-toolbar.is-synced .block-editor-block-
|
|
3521
|
+
.block-editor-block-toolbar.is-synced .block-editor-block-toolbar__block-icon, .block-editor-block-toolbar.is-connected .block-editor-block-toolbar__block-icon {
|
|
3561
3522
|
color: var(--wp-block-synced-color);
|
|
3562
3523
|
}
|
|
3563
3524
|
.block-editor-block-toolbar > :last-child,
|
|
@@ -3651,15 +3612,15 @@ div.block-editor-bindings__panel button:hover .block-editor-bindings__item span
|
|
|
3651
3612
|
width: 2px;
|
|
3652
3613
|
}
|
|
3653
3614
|
|
|
3654
|
-
.block-editor-block-toolbar__block-controls .block-editor-block-switcher .components-dropdown-menu__toggle .block-editor-block-icon,
|
|
3655
|
-
.block-editor-block-toolbar__block-controls .block-editor-block-switcher__no-switcher-icon .block-editor-block-icon {
|
|
3656
|
-
width: 24px !important;
|
|
3657
|
-
margin: 0 !important;
|
|
3658
|
-
}
|
|
3659
3615
|
.block-editor-block-toolbar__block-controls .components-toolbar-group {
|
|
3660
3616
|
padding: 0;
|
|
3661
3617
|
}
|
|
3662
3618
|
|
|
3619
|
+
.block-editor-block-toolbar__pattern-overrides-popover .components-popover__content {
|
|
3620
|
+
min-width: 260px;
|
|
3621
|
+
padding: 16px;
|
|
3622
|
+
}
|
|
3623
|
+
|
|
3663
3624
|
.block-editor-block-toolbar .components-toolbar-group,
|
|
3664
3625
|
.block-editor-block-toolbar .components-toolbar,
|
|
3665
3626
|
.block-editor-rich-text__inline-format-toolbar-group .components-toolbar-group,
|
|
@@ -3686,8 +3647,7 @@ div.block-editor-bindings__panel button:hover .block-editor-bindings__item span
|
|
|
3686
3647
|
padding-left: 6px;
|
|
3687
3648
|
padding-right: 6px;
|
|
3688
3649
|
}
|
|
3689
|
-
.show-icon-labels .block-editor-block-
|
|
3690
|
-
.show-icon-labels .block-editor-block-switcher__no-switcher-icon .block-editor-block-icon {
|
|
3650
|
+
.show-icon-labels .block-editor-block-icon {
|
|
3691
3651
|
width: 0 !important;
|
|
3692
3652
|
height: 0 !important;
|
|
3693
3653
|
min-width: 0 !important;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-editor",
|
|
3
|
-
"version": "15.
|
|
3
|
+
"version": "15.8.1-next.16d95556a.0",
|
|
4
4
|
"description": "Generic block editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -55,41 +55,41 @@
|
|
|
55
55
|
"@emotion/react": "^11.7.1",
|
|
56
56
|
"@emotion/styled": "^11.6.0",
|
|
57
57
|
"@react-spring/web": "^9.4.5",
|
|
58
|
-
"@wordpress/a11y": "^4.
|
|
59
|
-
"@wordpress/api-fetch": "^7.
|
|
60
|
-
"@wordpress/base-styles": "^6.
|
|
61
|
-
"@wordpress/blob": "^4.
|
|
62
|
-
"@wordpress/block-serialization-default-parser": "^5.
|
|
63
|
-
"@wordpress/blocks": "^15.
|
|
64
|
-
"@wordpress/commands": "^1.
|
|
65
|
-
"@wordpress/components": "^30.
|
|
66
|
-
"@wordpress/compose": "^7.
|
|
67
|
-
"@wordpress/data": "^10.
|
|
68
|
-
"@wordpress/date": "^5.
|
|
69
|
-
"@wordpress/deprecated": "^4.
|
|
70
|
-
"@wordpress/dom": "^4.
|
|
71
|
-
"@wordpress/element": "^6.
|
|
72
|
-
"@wordpress/escape-html": "^3.
|
|
73
|
-
"@wordpress/global-styles-engine": "^1.
|
|
74
|
-
"@wordpress/hooks": "^4.
|
|
75
|
-
"@wordpress/html-entities": "^4.
|
|
76
|
-
"@wordpress/i18n": "^6.
|
|
77
|
-
"@wordpress/icons": "^11.
|
|
78
|
-
"@wordpress/interactivity": "^6.
|
|
79
|
-
"@wordpress/is-shallow-equal": "^5.
|
|
80
|
-
"@wordpress/keyboard-shortcuts": "^5.
|
|
81
|
-
"@wordpress/keycodes": "^4.
|
|
82
|
-
"@wordpress/notices": "^5.
|
|
83
|
-
"@wordpress/preferences": "^4.
|
|
84
|
-
"@wordpress/priority-queue": "^3.
|
|
85
|
-
"@wordpress/private-apis": "^1.
|
|
86
|
-
"@wordpress/rich-text": "^7.
|
|
87
|
-
"@wordpress/style-engine": "^2.
|
|
88
|
-
"@wordpress/token-list": "^3.
|
|
89
|
-
"@wordpress/upload-media": "^0.
|
|
90
|
-
"@wordpress/url": "^4.
|
|
91
|
-
"@wordpress/warning": "^3.
|
|
92
|
-
"@wordpress/wordcount": "^4.
|
|
58
|
+
"@wordpress/a11y": "^4.35.1-next.16d95556a.0",
|
|
59
|
+
"@wordpress/api-fetch": "^7.35.1-next.16d95556a.0",
|
|
60
|
+
"@wordpress/base-styles": "^6.11.1-next.16d95556a.0",
|
|
61
|
+
"@wordpress/blob": "^4.35.1-next.16d95556a.0",
|
|
62
|
+
"@wordpress/block-serialization-default-parser": "^5.35.1-next.16d95556a.0",
|
|
63
|
+
"@wordpress/blocks": "^15.8.1-next.16d95556a.0",
|
|
64
|
+
"@wordpress/commands": "^1.35.1-next.16d95556a.0",
|
|
65
|
+
"@wordpress/components": "^30.8.1-next.16d95556a.0",
|
|
66
|
+
"@wordpress/compose": "^7.35.1-next.16d95556a.0",
|
|
67
|
+
"@wordpress/data": "^10.35.1-next.16d95556a.0",
|
|
68
|
+
"@wordpress/date": "^5.35.1-next.16d95556a.0",
|
|
69
|
+
"@wordpress/deprecated": "^4.35.1-next.16d95556a.0",
|
|
70
|
+
"@wordpress/dom": "^4.35.1-next.16d95556a.0",
|
|
71
|
+
"@wordpress/element": "^6.35.1-next.16d95556a.0",
|
|
72
|
+
"@wordpress/escape-html": "^3.35.1-next.16d95556a.0",
|
|
73
|
+
"@wordpress/global-styles-engine": "^1.2.1-next.16d95556a.0",
|
|
74
|
+
"@wordpress/hooks": "^4.35.1-next.16d95556a.0",
|
|
75
|
+
"@wordpress/html-entities": "^4.35.1-next.16d95556a.0",
|
|
76
|
+
"@wordpress/i18n": "^6.8.1-next.16d95556a.0",
|
|
77
|
+
"@wordpress/icons": "^11.2.1-next.16d95556a.0",
|
|
78
|
+
"@wordpress/interactivity": "^6.35.1-next.16d95556a.0",
|
|
79
|
+
"@wordpress/is-shallow-equal": "^5.35.1-next.16d95556a.0",
|
|
80
|
+
"@wordpress/keyboard-shortcuts": "^5.35.1-next.16d95556a.0",
|
|
81
|
+
"@wordpress/keycodes": "^4.35.1-next.16d95556a.0",
|
|
82
|
+
"@wordpress/notices": "^5.35.1-next.16d95556a.0",
|
|
83
|
+
"@wordpress/preferences": "^4.35.1-next.16d95556a.0",
|
|
84
|
+
"@wordpress/priority-queue": "^3.35.1-next.16d95556a.0",
|
|
85
|
+
"@wordpress/private-apis": "^1.35.1-next.16d95556a.0",
|
|
86
|
+
"@wordpress/rich-text": "^7.35.1-next.16d95556a.0",
|
|
87
|
+
"@wordpress/style-engine": "^2.35.1-next.16d95556a.0",
|
|
88
|
+
"@wordpress/token-list": "^3.35.1-next.16d95556a.0",
|
|
89
|
+
"@wordpress/upload-media": "^0.20.1-next.16d95556a.0",
|
|
90
|
+
"@wordpress/url": "^4.35.1-next.16d95556a.0",
|
|
91
|
+
"@wordpress/warning": "^3.35.1-next.16d95556a.0",
|
|
92
|
+
"@wordpress/wordcount": "^4.35.1-next.16d95556a.0",
|
|
93
93
|
"change-case": "^4.1.2",
|
|
94
94
|
"clsx": "^2.1.1",
|
|
95
95
|
"colord": "^2.7.0",
|
|
@@ -112,5 +112,5 @@
|
|
|
112
112
|
"publishConfig": {
|
|
113
113
|
"access": "public"
|
|
114
114
|
},
|
|
115
|
-
"gitHead": "
|
|
115
|
+
"gitHead": "59a9383612bbe16e21af84d13b035bfbca7fe833"
|
|
116
116
|
}
|
|
@@ -8,6 +8,7 @@ import clsx from 'clsx';
|
|
|
8
8
|
*/
|
|
9
9
|
import {
|
|
10
10
|
Button,
|
|
11
|
+
Icon,
|
|
11
12
|
__experimentalText as Text,
|
|
12
13
|
__experimentalVStack as VStack,
|
|
13
14
|
privateApis as componentsPrivateApis,
|
|
@@ -15,7 +16,12 @@ import {
|
|
|
15
16
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
16
17
|
import deprecated from '@wordpress/deprecated';
|
|
17
18
|
import { __, isRTL } from '@wordpress/i18n';
|
|
18
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
chevronLeft,
|
|
21
|
+
chevronRight,
|
|
22
|
+
arrowRight,
|
|
23
|
+
arrowLeft,
|
|
24
|
+
} from '@wordpress/icons';
|
|
19
25
|
|
|
20
26
|
/**
|
|
21
27
|
* Internal dependencies
|
|
@@ -26,6 +32,22 @@ import BlockIcon from '../block-icon';
|
|
|
26
32
|
|
|
27
33
|
const { Badge } = unlock( componentsPrivateApis );
|
|
28
34
|
|
|
35
|
+
function OptionalParentSelectButton( { children, onClick } ) {
|
|
36
|
+
if ( ! onClick ) {
|
|
37
|
+
return children;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<Button
|
|
42
|
+
__next40pxDefaultSize
|
|
43
|
+
className="block-editor-block-card__parent-select-button"
|
|
44
|
+
onClick={ onClick }
|
|
45
|
+
>
|
|
46
|
+
{ children }
|
|
47
|
+
</Button>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
29
51
|
/**
|
|
30
52
|
* A card component that displays block information including title, icon, and description.
|
|
31
53
|
* Can be used to show block metadata and navigation controls for parent blocks.
|
|
@@ -54,6 +76,9 @@ const { Badge } = unlock( componentsPrivateApis );
|
|
|
54
76
|
* @param {string} [props.className] Additional classes to apply to the card.
|
|
55
77
|
* @param {string} [props.name] Custom block name to display before the title.
|
|
56
78
|
* @param {string} [props.allowParentNavigation] Show a back arrow to the parent block in some situations.
|
|
79
|
+
* @param {string} [props.parentClientId] The parent clientId, if this card is for a parent block.
|
|
80
|
+
* @param {string} [props.isChild] Whether the block card is for a child block, in which case, indent the block using an arrow.
|
|
81
|
+
* @param {string} [props.clientId] Whether the block card is for a child block, in which case, indent the block using an arrow.
|
|
57
82
|
* @param {Element} [props.children] Children.
|
|
58
83
|
* @return {Element} Block card component.
|
|
59
84
|
*/
|
|
@@ -65,7 +90,10 @@ function BlockCard( {
|
|
|
65
90
|
className,
|
|
66
91
|
name,
|
|
67
92
|
allowParentNavigation,
|
|
93
|
+
parentClientId,
|
|
94
|
+
isChild,
|
|
68
95
|
children,
|
|
96
|
+
clientId,
|
|
69
97
|
} ) {
|
|
70
98
|
if ( blockType ) {
|
|
71
99
|
deprecated( '`blockType` property in `BlockCard component`', {
|
|
@@ -77,56 +105,85 @@ function BlockCard( {
|
|
|
77
105
|
|
|
78
106
|
const parentNavBlockClientId = useSelect(
|
|
79
107
|
( select ) => {
|
|
80
|
-
if ( ! allowParentNavigation ) {
|
|
108
|
+
if ( parentClientId || isChild || ! allowParentNavigation ) {
|
|
81
109
|
return;
|
|
82
110
|
}
|
|
83
|
-
const {
|
|
84
|
-
select( blockEditorStore );
|
|
85
|
-
|
|
86
|
-
const _selectedBlockClientId = getSelectedBlockClientId();
|
|
111
|
+
const { getBlockParentsByBlockName } = select( blockEditorStore );
|
|
87
112
|
|
|
88
113
|
return getBlockParentsByBlockName(
|
|
89
|
-
|
|
114
|
+
clientId,
|
|
90
115
|
'core/navigation',
|
|
91
116
|
true
|
|
92
117
|
)[ 0 ];
|
|
93
118
|
},
|
|
94
|
-
[ allowParentNavigation ]
|
|
119
|
+
[ clientId, allowParentNavigation, isChild, parentClientId ]
|
|
95
120
|
);
|
|
96
121
|
|
|
97
122
|
const { selectBlock } = useDispatch( blockEditorStore );
|
|
98
123
|
|
|
124
|
+
const TitleElement = parentClientId ? 'div' : 'h2';
|
|
125
|
+
|
|
99
126
|
return (
|
|
100
|
-
<div
|
|
101
|
-
{
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
127
|
+
<div
|
|
128
|
+
className={ clsx(
|
|
129
|
+
'block-editor-block-card',
|
|
130
|
+
{
|
|
131
|
+
'is-parent': parentClientId,
|
|
132
|
+
'is-child': isChild,
|
|
133
|
+
},
|
|
134
|
+
className
|
|
135
|
+
) }
|
|
136
|
+
>
|
|
137
|
+
{ parentNavBlockClientId && ( // This is only used by the Navigation block for now. It's not ideal having Navigation block specific code here.
|
|
138
|
+
<Button
|
|
139
|
+
onClick={ () => selectBlock( parentNavBlockClientId ) }
|
|
140
|
+
label={
|
|
141
|
+
parentNavBlockClientId
|
|
142
|
+
? __( 'Go to parent Navigation block' )
|
|
143
|
+
: // TODO - improve copy, not sure that we should use the term 'section'
|
|
144
|
+
__( 'Go to parent section' )
|
|
145
|
+
}
|
|
146
|
+
style={
|
|
147
|
+
// TODO: This style override is also used in ToolsPanelHeader.
|
|
148
|
+
// It should be supported out-of-the-box by Button.
|
|
149
|
+
{ minWidth: 24, padding: 0 }
|
|
150
|
+
}
|
|
151
|
+
icon={ isRTL() ? chevronRight : chevronLeft }
|
|
152
|
+
size="small"
|
|
153
|
+
/>
|
|
154
|
+
) }
|
|
155
|
+
{ isChild && (
|
|
156
|
+
<span className="block-editor-block-card__child-indicator-icon">
|
|
157
|
+
<Icon icon={ isRTL() ? arrowLeft : arrowRight } />
|
|
158
|
+
</span>
|
|
159
|
+
) }
|
|
160
|
+
<OptionalParentSelectButton
|
|
161
|
+
onClick={
|
|
162
|
+
parentClientId
|
|
163
|
+
? () => {
|
|
164
|
+
selectBlock( parentClientId );
|
|
165
|
+
}
|
|
166
|
+
: undefined
|
|
167
|
+
}
|
|
168
|
+
>
|
|
169
|
+
<BlockIcon icon={ icon } showColors />
|
|
170
|
+
<VStack spacing={ 1 }>
|
|
171
|
+
<TitleElement className="block-editor-block-card__title">
|
|
172
|
+
<span className="block-editor-block-card__name">
|
|
173
|
+
{ !! name?.length ? name : title }
|
|
174
|
+
</span>
|
|
175
|
+
{ ! parentClientId && ! isChild && !! name?.length && (
|
|
176
|
+
<Badge>{ title }</Badge>
|
|
177
|
+
) }
|
|
178
|
+
</TitleElement>
|
|
179
|
+
{ ! parentClientId && ! isChild && description && (
|
|
180
|
+
<Text className="block-editor-block-card__description">
|
|
181
|
+
{ description }
|
|
182
|
+
</Text>
|
|
183
|
+
) }
|
|
184
|
+
{ children }
|
|
185
|
+
</VStack>
|
|
186
|
+
</OptionalParentSelectButton>
|
|
130
187
|
</div>
|
|
131
188
|
);
|
|
132
189
|
}
|