@wordpress/block-editor 13.0.3 → 13.2.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 +21 -17
- package/README.md +1 -1
- package/build/components/block-lock/modal.js +67 -67
- package/build/components/block-lock/modal.js.map +1 -1
- package/build/components/block-mover/index.js +12 -6
- package/build/components/block-mover/index.js.map +1 -1
- package/build/components/child-layout-control/index.js +185 -127
- package/build/components/child-layout-control/index.js.map +1 -1
- package/build/components/date-format-picker/index.js +18 -10
- package/build/components/date-format-picker/index.js.map +1 -1
- package/build/components/grid/grid-item-movers.js +97 -0
- package/build/components/grid/grid-item-movers.js.map +1 -0
- package/build/components/{grid-visualizer → grid}/grid-item-resizer.js +18 -56
- package/build/components/grid/grid-item-resizer.js.map +1 -0
- package/build/components/grid/grid-visualizer.js +225 -0
- package/build/components/grid/grid-visualizer.js.map +1 -0
- package/build/components/{grid-visualizer → grid}/index.js +14 -0
- package/build/components/grid/index.js.map +1 -0
- package/build/components/grid/use-get-number-of-blocks-before-cell.js +40 -0
- package/build/components/grid/use-get-number-of-blocks-before-cell.js.map +1 -0
- package/build/components/grid/use-grid-layout-sync.js +162 -0
- package/build/components/grid/use-grid-layout-sync.js.map +1 -0
- package/build/components/grid/utils.js +145 -0
- package/build/components/grid/utils.js.map +1 -0
- package/build/components/inner-blocks/index.js +1 -1
- package/build/components/inner-blocks/index.js.map +1 -1
- package/build/components/inserter/block-types-tab.native.js +1 -1
- package/build/components/inserter/block-types-tab.native.js.map +1 -1
- package/build/components/link-control/link-preview.js +12 -1
- package/build/components/link-control/link-preview.js.map +1 -1
- package/build/components/provider/use-block-sync.js +1 -7
- package/build/components/provider/use-block-sync.js.map +1 -1
- package/build/components/rich-text/event-listeners/input-rules.js +1 -0
- package/build/components/rich-text/event-listeners/input-rules.js.map +1 -1
- package/build/components/rich-text/index.native.js +14 -4
- package/build/components/rich-text/index.native.js.map +1 -1
- package/build/components/rich-text/native/index.native.js +20 -4
- package/build/components/rich-text/native/index.native.js.map +1 -1
- package/build/hooks/block-style-variation.js +2 -2
- package/build/hooks/block-style-variation.js.map +1 -1
- package/build/hooks/layout-child.js +29 -21
- package/build/hooks/layout-child.js.map +1 -1
- package/build/layouts/grid.js +24 -47
- package/build/layouts/grid.js.map +1 -1
- package/build/store/private-actions.js +0 -34
- package/build/store/private-actions.js.map +1 -1
- package/build-module/components/block-lock/modal.js +67 -67
- package/build-module/components/block-lock/modal.js.map +1 -1
- package/build-module/components/block-mover/index.js +12 -6
- package/build-module/components/block-mover/index.js.map +1 -1
- package/build-module/components/child-layout-control/index.js +185 -127
- package/build-module/components/child-layout-control/index.js.map +1 -1
- package/build-module/components/date-format-picker/index.js +19 -11
- package/build-module/components/date-format-picker/index.js.map +1 -1
- package/build-module/components/grid/grid-item-movers.js +90 -0
- package/build-module/components/grid/grid-item-movers.js.map +1 -0
- package/build-module/components/{grid-visualizer → grid}/grid-item-resizer.js +13 -51
- package/build-module/components/grid/grid-item-resizer.js.map +1 -0
- package/build-module/components/grid/grid-visualizer.js +217 -0
- package/build-module/components/grid/grid-visualizer.js.map +1 -0
- package/build-module/components/grid/index.js +5 -0
- package/build-module/components/grid/index.js.map +1 -0
- package/build-module/components/grid/use-get-number-of-blocks-before-cell.js +33 -0
- package/build-module/components/grid/use-get-number-of-blocks-before-cell.js.map +1 -0
- package/build-module/components/grid/use-grid-layout-sync.js +155 -0
- package/build-module/components/grid/use-grid-layout-sync.js.map +1 -0
- package/build-module/components/grid/utils.js +131 -0
- package/build-module/components/grid/utils.js.map +1 -0
- package/build-module/components/inner-blocks/index.js +1 -1
- package/build-module/components/inner-blocks/index.js.map +1 -1
- package/build-module/components/inserter/block-types-tab.native.js +1 -1
- package/build-module/components/inserter/block-types-tab.native.js.map +1 -1
- package/build-module/components/link-control/link-preview.js +14 -1
- package/build-module/components/link-control/link-preview.js.map +1 -1
- package/build-module/components/provider/use-block-sync.js +1 -7
- package/build-module/components/provider/use-block-sync.js.map +1 -1
- package/build-module/components/rich-text/event-listeners/input-rules.js +1 -1
- package/build-module/components/rich-text/event-listeners/input-rules.js.map +1 -1
- package/build-module/components/rich-text/index.native.js +15 -5
- package/build-module/components/rich-text/index.native.js.map +1 -1
- package/build-module/components/rich-text/native/index.native.js +20 -4
- package/build-module/components/rich-text/native/index.native.js.map +1 -1
- package/build-module/hooks/block-style-variation.js +2 -2
- package/build-module/hooks/block-style-variation.js.map +1 -1
- package/build-module/hooks/layout-child.js +27 -19
- package/build-module/hooks/layout-child.js.map +1 -1
- package/build-module/layouts/grid.js +24 -47
- package/build-module/layouts/grid.js.map +1 -1
- package/build-module/store/private-actions.js +0 -33
- package/build-module/store/private-actions.js.map +1 -1
- package/build-style/style-rtl.css +38 -16
- package/build-style/style.css +38 -16
- package/package.json +31 -31
- package/src/components/block-lock/modal.js +95 -82
- package/src/components/block-lock/style.scss +11 -1
- package/src/components/block-mover/index.js +37 -24
- package/src/components/child-layout-control/index.js +224 -159
- package/src/components/date-format-picker/index.js +25 -13
- package/src/components/grid/grid-item-movers.js +128 -0
- package/src/components/{grid-visualizer → grid}/grid-item-resizer.js +14 -52
- package/src/components/grid/grid-visualizer.js +267 -0
- package/src/components/grid/index.js +4 -0
- package/src/components/grid/style.scss +63 -0
- package/src/components/grid/use-get-number-of-blocks-before-cell.js +30 -0
- package/src/components/grid/use-grid-layout-sync.js +167 -0
- package/src/components/grid/utils.js +178 -0
- package/src/components/inner-blocks/index.js +3 -1
- package/src/components/inserter/block-types-tab.native.js +2 -1
- package/src/components/link-control/link-preview.js +18 -1
- package/src/components/provider/use-block-sync.js +0 -6
- package/src/components/rich-text/event-listeners/input-rules.js +1 -1
- package/src/components/rich-text/index.native.js +14 -8
- package/src/components/rich-text/native/index.native.js +20 -1
- package/src/hooks/block-style-variation.js +2 -2
- package/src/hooks/layout-child.js +34 -14
- package/src/layouts/grid.js +54 -62
- package/src/store/private-actions.js +0 -29
- package/src/style.scss +1 -1
- package/build/components/grid-visualizer/grid-item-resizer.js.map +0 -1
- package/build/components/grid-visualizer/grid-visualizer.js +0 -92
- package/build/components/grid-visualizer/grid-visualizer.js.map +0 -1
- package/build/components/grid-visualizer/index.js.map +0 -1
- package/build/components/grid-visualizer/utils.js +0 -10
- package/build/components/grid-visualizer/utils.js.map +0 -1
- package/build/store/undo-ignore.js +0 -11
- package/build/store/undo-ignore.js.map +0 -1
- package/build-module/components/grid-visualizer/grid-item-resizer.js.map +0 -1
- package/build-module/components/grid-visualizer/grid-visualizer.js +0 -84
- package/build-module/components/grid-visualizer/grid-visualizer.js.map +0 -1
- package/build-module/components/grid-visualizer/index.js +0 -3
- package/build-module/components/grid-visualizer/index.js.map +0 -1
- package/build-module/components/grid-visualizer/utils.js +0 -4
- package/build-module/components/grid-visualizer/utils.js.map +0 -1
- package/build-module/store/undo-ignore.js +0 -5
- package/build-module/store/undo-ignore.js.map +0 -1
- package/src/components/grid-visualizer/grid-visualizer.js +0 -101
- package/src/components/grid-visualizer/index.js +0 -2
- package/src/components/grid-visualizer/style.scss +0 -34
- package/src/components/grid-visualizer/utils.js +0 -5
- package/src/store/undo-ignore.js +0 -4
- /package/src/components/font-sizes/{README.MD → README.md} +0 -0
|
@@ -6,7 +6,6 @@ import { Platform } from '@wordpress/element';
|
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
|
-
import { undoIgnoreBlocks } from './undo-ignore';
|
|
10
9
|
import { store as blockEditorStore } from './index';
|
|
11
10
|
import { unlock } from '../lock-unlock';
|
|
12
11
|
|
|
@@ -288,34 +287,6 @@ export function deleteStyleOverride( id ) {
|
|
|
288
287
|
};
|
|
289
288
|
}
|
|
290
289
|
|
|
291
|
-
/**
|
|
292
|
-
* A higher-order action that mark every change inside a callback as "non-persistent"
|
|
293
|
-
* and ignore pushing to the undo history stack. It's primarily used for synchronized
|
|
294
|
-
* derived updates from the block editor without affecting the undo history.
|
|
295
|
-
*
|
|
296
|
-
* @param {() => void} callback The synchronous callback to derive updates.
|
|
297
|
-
*/
|
|
298
|
-
export function syncDerivedUpdates( callback ) {
|
|
299
|
-
return ( { dispatch, select, registry } ) => {
|
|
300
|
-
registry.batch( () => {
|
|
301
|
-
// Mark every change in the `callback` as non-persistent.
|
|
302
|
-
dispatch( {
|
|
303
|
-
type: 'SET_EXPLICIT_PERSISTENT',
|
|
304
|
-
isPersistentChange: false,
|
|
305
|
-
} );
|
|
306
|
-
callback();
|
|
307
|
-
dispatch( {
|
|
308
|
-
type: 'SET_EXPLICIT_PERSISTENT',
|
|
309
|
-
isPersistentChange: undefined,
|
|
310
|
-
} );
|
|
311
|
-
|
|
312
|
-
// Ignore pushing undo stack for the updated blocks.
|
|
313
|
-
const updatedBlocks = select.getBlocks();
|
|
314
|
-
undoIgnoreBlocks.add( updatedBlocks );
|
|
315
|
-
} );
|
|
316
|
-
};
|
|
317
|
-
}
|
|
318
|
-
|
|
319
290
|
/**
|
|
320
291
|
* Action that sets the element that had focus when focus leaves the editor canvas.
|
|
321
292
|
*
|
package/src/style.scss
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
@import "./components/duotone-control/style.scss";
|
|
28
28
|
@import "./components/font-appearance-control/style.scss";
|
|
29
29
|
@import "./components/global-styles/style.scss";
|
|
30
|
-
@import "./components/grid
|
|
30
|
+
@import "./components/grid/style.scss";
|
|
31
31
|
@import "./components/height-control/style.scss";
|
|
32
32
|
@import "./components/image-size-control/style.scss";
|
|
33
33
|
@import "./components/inserter-list-item/style.scss";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_element","_useBlockRefs","_cover","_interopRequireDefault","_utils","_jsxRuntime","GridItemResizer","clientId","bounds","onChange","blockElement","useBlockElement","rootBlockElement","parentElement","jsx","GridItemResizerInner","resizeDirection","setResizeDirection","useState","enableSide","setEnableSide","top","bottom","left","right","useEffect","observer","window","ResizeObserver","blockClientRect","getBoundingClientRect","rootBlockClientRect","observe","disconnect","justification","alignment","styles","display","justifyContent","alignItems","default","className","__unstablePopoverSlot","additionalStyles","children","ResizableBox","size","width","height","enable","bottomLeft","bottomRight","topLeft","topRight","boundsByDirection","onResizeStart","event","direction","ownerDocument","addEventListener","target","dispatchEvent","Event","bubbles","once","onResizeStop","boxElement","columnGap","parseFloat","getComputedCSS","rowGap","gridColumnTracks","getGridTracks","gridRowTracks","rect","DOMRect","offsetLeft","offsetTop","offsetWidth","offsetHeight","columnStart","getClosestTrack","rowStart","columnEnd","rowEnd","columnSpan","rowSpan","template","gap","tracks","split","previousTrack","length","start","end","push","position","edge","reduce","closest","track","index","Math","abs"],"sources":["@wordpress/block-editor/src/components/grid-visualizer/grid-item-resizer.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ResizableBox } from '@wordpress/components';\nimport { useState, useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { __unstableUseBlockElement as useBlockElement } from '../block-list/use-block-props/use-block-refs';\nimport BlockPopoverCover from '../block-popover/cover';\nimport { getComputedCSS } from './utils';\n\nexport function GridItemResizer( { clientId, bounds, onChange } ) {\n\tconst blockElement = useBlockElement( clientId );\n\tconst rootBlockElement = blockElement?.parentElement;\n\n\tif ( ! blockElement || ! rootBlockElement ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<GridItemResizerInner\n\t\t\tclientId={ clientId }\n\t\t\tbounds={ bounds }\n\t\t\tblockElement={ blockElement }\n\t\t\trootBlockElement={ rootBlockElement }\n\t\t\tonChange={ onChange }\n\t\t/>\n\t);\n}\n\nfunction GridItemResizerInner( {\n\tclientId,\n\tbounds,\n\tblockElement,\n\trootBlockElement,\n\tonChange,\n} ) {\n\tconst [ resizeDirection, setResizeDirection ] = useState( null );\n\tconst [ enableSide, setEnableSide ] = useState( {\n\t\ttop: false,\n\t\tbottom: false,\n\t\tleft: false,\n\t\tright: false,\n\t} );\n\n\tuseEffect( () => {\n\t\tconst observer = new window.ResizeObserver( () => {\n\t\t\tconst blockClientRect = blockElement.getBoundingClientRect();\n\t\t\tconst rootBlockClientRect =\n\t\t\t\trootBlockElement.getBoundingClientRect();\n\t\t\tsetEnableSide( {\n\t\t\t\ttop: blockClientRect.top > rootBlockClientRect.top,\n\t\t\t\tbottom: blockClientRect.bottom < rootBlockClientRect.bottom,\n\t\t\t\tleft: blockClientRect.left > rootBlockClientRect.left,\n\t\t\t\tright: blockClientRect.right < rootBlockClientRect.right,\n\t\t\t} );\n\t\t} );\n\t\tobserver.observe( blockElement );\n\t\treturn () => observer.disconnect();\n\t}, [ blockElement, rootBlockElement ] );\n\n\tconst justification = {\n\t\tright: 'flex-start',\n\t\tleft: 'flex-end',\n\t};\n\n\tconst alignment = {\n\t\ttop: 'flex-end',\n\t\tbottom: 'flex-start',\n\t};\n\n\tconst styles = {\n\t\tdisplay: 'flex',\n\t\tjustifyContent: 'center',\n\t\talignItems: 'center',\n\t\t...( justification[ resizeDirection ] && {\n\t\t\tjustifyContent: justification[ resizeDirection ],\n\t\t} ),\n\t\t...( alignment[ resizeDirection ] && {\n\t\t\talignItems: alignment[ resizeDirection ],\n\t\t} ),\n\t};\n\n\treturn (\n\t\t<BlockPopoverCover\n\t\t\tclassName=\"block-editor-grid-item-resizer\"\n\t\t\tclientId={ clientId }\n\t\t\t__unstablePopoverSlot=\"block-toolbar\"\n\t\t\tadditionalStyles={ styles }\n\t\t>\n\t\t\t<ResizableBox\n\t\t\t\tclassName=\"block-editor-grid-item-resizer__box\"\n\t\t\t\tsize={ {\n\t\t\t\t\twidth: '100%',\n\t\t\t\t\theight: '100%',\n\t\t\t\t} }\n\t\t\t\tenable={ {\n\t\t\t\t\tbottom: enableSide.bottom,\n\t\t\t\t\tbottomLeft: false,\n\t\t\t\t\tbottomRight: false,\n\t\t\t\t\tleft: enableSide.left,\n\t\t\t\t\tright: enableSide.right,\n\t\t\t\t\ttop: enableSide.top,\n\t\t\t\t\ttopLeft: false,\n\t\t\t\t\ttopRight: false,\n\t\t\t\t} }\n\t\t\t\tbounds={ bounds }\n\t\t\t\tboundsByDirection\n\t\t\t\tonResizeStart={ ( event, direction ) => {\n\t\t\t\t\t/*\n\t\t\t\t\t * The container justification and alignment need to be set\n\t\t\t\t\t * according to the direction the resizer is being dragged in,\n\t\t\t\t\t * so that it resizes in the right direction.\n\t\t\t\t\t */\n\t\t\t\t\tsetResizeDirection( direction );\n\n\t\t\t\t\t/*\n\t\t\t\t\t * The mouseup event on the resize handle doesn't trigger if the mouse\n\t\t\t\t\t * isn't directly above the handle, so we try to detect if it happens\n\t\t\t\t\t * outside the grid and dispatch a mouseup event on the handle.\n\t\t\t\t\t */\n\t\t\t\t\tblockElement.ownerDocument.addEventListener(\n\t\t\t\t\t\t'mouseup',\n\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\tevent.target.dispatchEvent(\n\t\t\t\t\t\t\t\tnew Event( 'mouseup', { bubbles: true } )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{ once: true }\n\t\t\t\t\t);\n\t\t\t\t} }\n\t\t\t\tonResizeStop={ ( event, direction, boxElement ) => {\n\t\t\t\t\tconst columnGap = parseFloat(\n\t\t\t\t\t\tgetComputedCSS( rootBlockElement, 'column-gap' )\n\t\t\t\t\t);\n\t\t\t\t\tconst rowGap = parseFloat(\n\t\t\t\t\t\tgetComputedCSS( rootBlockElement, 'row-gap' )\n\t\t\t\t\t);\n\t\t\t\t\tconst gridColumnTracks = getGridTracks(\n\t\t\t\t\t\tgetComputedCSS(\n\t\t\t\t\t\t\trootBlockElement,\n\t\t\t\t\t\t\t'grid-template-columns'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tcolumnGap\n\t\t\t\t\t);\n\t\t\t\t\tconst gridRowTracks = getGridTracks(\n\t\t\t\t\t\tgetComputedCSS(\n\t\t\t\t\t\t\trootBlockElement,\n\t\t\t\t\t\t\t'grid-template-rows'\n\t\t\t\t\t\t),\n\t\t\t\t\t\trowGap\n\t\t\t\t\t);\n\t\t\t\t\tconst rect = new window.DOMRect(\n\t\t\t\t\t\tblockElement.offsetLeft + boxElement.offsetLeft,\n\t\t\t\t\t\tblockElement.offsetTop + boxElement.offsetTop,\n\t\t\t\t\t\tboxElement.offsetWidth,\n\t\t\t\t\t\tboxElement.offsetHeight\n\t\t\t\t\t);\n\t\t\t\t\tconst columnStart =\n\t\t\t\t\t\tgetClosestTrack( gridColumnTracks, rect.left ) + 1;\n\t\t\t\t\tconst rowStart =\n\t\t\t\t\t\tgetClosestTrack( gridRowTracks, rect.top ) + 1;\n\t\t\t\t\tconst columnEnd =\n\t\t\t\t\t\tgetClosestTrack( gridColumnTracks, rect.right, 'end' ) +\n\t\t\t\t\t\t1;\n\t\t\t\t\tconst rowEnd =\n\t\t\t\t\t\tgetClosestTrack( gridRowTracks, rect.bottom, 'end' ) +\n\t\t\t\t\t\t1;\n\t\t\t\t\tonChange( {\n\t\t\t\t\t\tcolumnSpan: columnEnd - columnStart + 1,\n\t\t\t\t\t\trowSpan: rowEnd - rowStart + 1,\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t/>\n\t\t</BlockPopoverCover>\n\t);\n}\n\n/**\n * Given a grid-template-columns or grid-template-rows CSS property value, gets the start and end\n * position in pixels of each grid track.\n *\n * https://css-tricks.com/snippets/css/complete-guide-grid/#aa-grid-track\n *\n * @param {string} template The grid-template-columns or grid-template-rows CSS property value.\n * Only supports fixed sizes in pixels.\n * @param {number} gap The gap between grid tracks in pixels.\n *\n * @return {Array<{start: number, end: number}>} An array of objects with the start and end\n * position in pixels of each grid track.\n */\nfunction getGridTracks( template, gap ) {\n\tconst tracks = [];\n\tfor ( const size of template.split( ' ' ) ) {\n\t\tconst previousTrack = tracks[ tracks.length - 1 ];\n\t\tconst start = previousTrack ? previousTrack.end + gap : 0;\n\t\tconst end = start + parseFloat( size );\n\t\ttracks.push( { start, end } );\n\t}\n\treturn tracks;\n}\n\n/**\n * Given an array of grid tracks and a position in pixels, gets the index of the closest track to\n * that position.\n *\n * https://css-tricks.com/snippets/css/complete-guide-grid/#aa-grid-track\n *\n * @param {Array<{start: number, end: number}>} tracks An array of objects with the start and end\n * position in pixels of each grid track.\n * @param {number} position The position in pixels.\n * @param {string} edge The edge of the track to compare the\n * position to. Either 'start' or 'end'.\n *\n * @return {number} The index of the closest track to the position. 0-based, unlike CSS grid which\n * is 1-based.\n */\nfunction getClosestTrack( tracks, position, edge = 'start' ) {\n\treturn tracks.reduce(\n\t\t( closest, track, index ) =>\n\t\t\tMath.abs( track[ edge ] - position ) <\n\t\t\tMath.abs( tracks[ closest ][ edge ] - position )\n\t\t\t\t? index\n\t\t\t\t: closest,\n\t\t0\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAKA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAAyC,IAAAM,WAAA,GAAAN,OAAA;AAXzC;AACA;AACA;;AAIA;AACA;AACA;;AAKO,SAASO,eAAeA,CAAE;EAAEC,QAAQ;EAAEC,MAAM;EAAEC;AAAS,CAAC,EAAG;EACjE,MAAMC,YAAY,GAAG,IAAAC,uCAAe,EAAEJ,QAAS,CAAC;EAChD,MAAMK,gBAAgB,GAAGF,YAAY,EAAEG,aAAa;EAEpD,IAAK,CAAEH,YAAY,IAAI,CAAEE,gBAAgB,EAAG;IAC3C,OAAO,IAAI;EACZ;EAEA,oBACC,IAAAP,WAAA,CAAAS,GAAA,EAACC,oBAAoB;IACpBR,QAAQ,EAAGA,QAAU;IACrBC,MAAM,EAAGA,MAAQ;IACjBE,YAAY,EAAGA,YAAc;IAC7BE,gBAAgB,EAAGA,gBAAkB;IACrCH,QAAQ,EAAGA;EAAU,CACrB,CAAC;AAEJ;AAEA,SAASM,oBAAoBA,CAAE;EAC9BR,QAAQ;EACRC,MAAM;EACNE,YAAY;EACZE,gBAAgB;EAChBH;AACD,CA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GAAGF,QAAQ,GAAG;QAC9B,CAAE,CAAC;MACJ;IAAG,CACH;EAAC,CACgB,CAAC;AAEtB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASV,aAAaA,CAAEe,QAAQ,EAAEC,GAAG,EAAG;EACvC,MAAMC,MAAM,GAAG,EAAE;EACjB,KAAM,MAAM3C,IAAI,IAAIyC,QAAQ,CAACG,KAAK,CAAE,GAAI,CAAC,EAAG;IAC3C,MAAMC,aAAa,GAAGF,MAAM,CAAEA,MAAM,CAACG,MAAM,GAAG,CAAC,CAAE;IACjD,MAAMC,KAAK,GAAGF,aAAa,GAAGA,aAAa,CAACG,GAAG,GAAGN,GAAG,GAAG,CAAC;IACzD,MAAMM,GAAG,GAAGD,KAAK,GAAGzB,UAAU,CAAEtB,IAAK,CAAC;IACtC2C,MAAM,CAACM,IAAI,CAAE;MAAEF,KAAK;MAAEC;IAAI,CAAE,CAAC;EAC9B;EACA,OAAOL,MAAM;AACd;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASR,eAAeA,CAAEQ,MAAM,EAAEO,QAAQ,EAAEC,IAAI,GAAG,OAAO,EAAG;EAC5D,OAAOR,MAAM,CAACS,MAAM,CACnB,CAAEC,OAAO,EAAEC,KAAK,EAAEC,KAAK,KACtBC,IAAI,CAACC,GAAG,CAAEH,KAAK,CAAEH,IAAI,CAAE,GAAGD,QAAS,CAAC,GACpCM,IAAI,CAACC,GAAG,CAAEd,MAAM,CAAEU,OAAO,CAAE,CAAEF,IAAI,CAAE,GAAGD,QAAS,CAAC,GAC7CK,KAAK,GACLF,OAAO,EACX,CACD,CAAC;AACF","ignoreList":[]}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.GridVisualizer = GridVisualizer;
|
|
8
|
-
var _element = require("@wordpress/element");
|
|
9
|
-
var _data = require("@wordpress/data");
|
|
10
|
-
var _useBlockRefs = require("../block-list/use-block-props/use-block-refs");
|
|
11
|
-
var _cover = _interopRequireDefault(require("../block-popover/cover"));
|
|
12
|
-
var _store = require("../../store");
|
|
13
|
-
var _utils = require("./utils");
|
|
14
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
/**
|
|
16
|
-
* WordPress dependencies
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Internal dependencies
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
function GridVisualizer({
|
|
24
|
-
clientId,
|
|
25
|
-
contentRef
|
|
26
|
-
}) {
|
|
27
|
-
const isDistractionFree = (0, _data.useSelect)(select => select(_store.store).getSettings().isDistractionFree, []);
|
|
28
|
-
const blockElement = (0, _useBlockRefs.__unstableUseBlockElement)(clientId);
|
|
29
|
-
if (isDistractionFree || !blockElement) {
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_cover.default, {
|
|
33
|
-
className: "block-editor-grid-visualizer",
|
|
34
|
-
clientId: clientId,
|
|
35
|
-
__unstablePopoverSlot: "block-toolbar",
|
|
36
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(GridVisualizerGrid, {
|
|
37
|
-
ref: contentRef,
|
|
38
|
-
blockElement: blockElement
|
|
39
|
-
})
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
const GridVisualizerGrid = (0, _element.forwardRef)(({
|
|
43
|
-
blockElement
|
|
44
|
-
}, ref) => {
|
|
45
|
-
const [gridInfo, setGridInfo] = (0, _element.useState)(() => getGridInfo(blockElement));
|
|
46
|
-
(0, _element.useEffect)(() => {
|
|
47
|
-
const observers = [];
|
|
48
|
-
for (const element of [blockElement, ...blockElement.children]) {
|
|
49
|
-
const observer = new window.ResizeObserver(() => {
|
|
50
|
-
setGridInfo(getGridInfo(blockElement));
|
|
51
|
-
});
|
|
52
|
-
observer.observe(element);
|
|
53
|
-
observers.push(observer);
|
|
54
|
-
}
|
|
55
|
-
return () => {
|
|
56
|
-
for (const observer of observers) {
|
|
57
|
-
observer.disconnect();
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
}, [blockElement]);
|
|
61
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
62
|
-
ref: ref,
|
|
63
|
-
className: "block-editor-grid-visualizer__grid",
|
|
64
|
-
style: gridInfo.style,
|
|
65
|
-
children: Array.from({
|
|
66
|
-
length: gridInfo.numItems
|
|
67
|
-
}, (_, i) => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
68
|
-
className: "block-editor-grid-visualizer__item",
|
|
69
|
-
style: {
|
|
70
|
-
boxShadow: `inset 0 0 0 1px color-mix(in srgb, ${gridInfo.currentColor} 20%, #0000)`
|
|
71
|
-
}
|
|
72
|
-
}, i))
|
|
73
|
-
});
|
|
74
|
-
});
|
|
75
|
-
function getGridInfo(blockElement) {
|
|
76
|
-
const gridTemplateColumns = (0, _utils.getComputedCSS)(blockElement, 'grid-template-columns');
|
|
77
|
-
const gridTemplateRows = (0, _utils.getComputedCSS)(blockElement, 'grid-template-rows');
|
|
78
|
-
const numColumns = gridTemplateColumns.split(' ').length;
|
|
79
|
-
const numRows = gridTemplateRows.split(' ').length;
|
|
80
|
-
const numItems = numColumns * numRows;
|
|
81
|
-
return {
|
|
82
|
-
numItems,
|
|
83
|
-
currentColor: (0, _utils.getComputedCSS)(blockElement, 'color'),
|
|
84
|
-
style: {
|
|
85
|
-
gridTemplateColumns,
|
|
86
|
-
gridTemplateRows,
|
|
87
|
-
gap: (0, _utils.getComputedCSS)(blockElement, 'gap'),
|
|
88
|
-
padding: (0, _utils.getComputedCSS)(blockElement, 'padding')
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
//# sourceMappingURL=grid-visualizer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_data","_useBlockRefs","_cover","_interopRequireDefault","_store","_utils","_jsxRuntime","GridVisualizer","clientId","contentRef","isDistractionFree","useSelect","select","blockEditorStore","getSettings","blockElement","useBlockElement","jsx","default","className","__unstablePopoverSlot","children","GridVisualizerGrid","ref","forwardRef","gridInfo","setGridInfo","useState","getGridInfo","useEffect","observers","element","observer","window","ResizeObserver","observe","push","disconnect","style","Array","from","length","numItems","_","i","boxShadow","currentColor","gridTemplateColumns","getComputedCSS","gridTemplateRows","numColumns","split","numRows","gap","padding"],"sources":["@wordpress/block-editor/src/components/grid-visualizer/grid-visualizer.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useEffect, forwardRef } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { __unstableUseBlockElement as useBlockElement } from '../block-list/use-block-props/use-block-refs';\nimport BlockPopoverCover from '../block-popover/cover';\nimport { store as blockEditorStore } from '../../store';\nimport { getComputedCSS } from './utils';\n\nexport function GridVisualizer( { clientId, contentRef } ) {\n\tconst isDistractionFree = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getSettings().isDistractionFree,\n\t\t[]\n\t);\n\tconst blockElement = useBlockElement( clientId );\n\n\tif ( isDistractionFree || ! blockElement ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<BlockPopoverCover\n\t\t\tclassName=\"block-editor-grid-visualizer\"\n\t\t\tclientId={ clientId }\n\t\t\t__unstablePopoverSlot=\"block-toolbar\"\n\t\t>\n\t\t\t<GridVisualizerGrid\n\t\t\t\tref={ contentRef }\n\t\t\t\tblockElement={ blockElement }\n\t\t\t/>\n\t\t</BlockPopoverCover>\n\t);\n}\n\nconst GridVisualizerGrid = forwardRef( ( { blockElement }, ref ) => {\n\tconst [ gridInfo, setGridInfo ] = useState( () =>\n\t\tgetGridInfo( blockElement )\n\t);\n\tuseEffect( () => {\n\t\tconst observers = [];\n\t\tfor ( const element of [ blockElement, ...blockElement.children ] ) {\n\t\t\tconst observer = new window.ResizeObserver( () => {\n\t\t\t\tsetGridInfo( getGridInfo( blockElement ) );\n\t\t\t} );\n\t\t\tobserver.observe( element );\n\t\t\tobservers.push( observer );\n\t\t}\n\t\treturn () => {\n\t\t\tfor ( const observer of observers ) {\n\t\t\t\tobserver.disconnect();\n\t\t\t}\n\t\t};\n\t}, [ blockElement ] );\n\treturn (\n\t\t<div\n\t\t\tref={ ref }\n\t\t\tclassName=\"block-editor-grid-visualizer__grid\"\n\t\t\tstyle={ gridInfo.style }\n\t\t>\n\t\t\t{ Array.from( { length: gridInfo.numItems }, ( _, i ) => (\n\t\t\t\t<div\n\t\t\t\t\tkey={ i }\n\t\t\t\t\tclassName=\"block-editor-grid-visualizer__item\"\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tboxShadow: `inset 0 0 0 1px color-mix(in srgb, ${ gridInfo.currentColor } 20%, #0000)`,\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</div>\n\t);\n} );\n\nfunction getGridInfo( blockElement ) {\n\tconst gridTemplateColumns = getComputedCSS(\n\t\tblockElement,\n\t\t'grid-template-columns'\n\t);\n\tconst gridTemplateRows = getComputedCSS(\n\t\tblockElement,\n\t\t'grid-template-rows'\n\t);\n\tconst numColumns = gridTemplateColumns.split( ' ' ).length;\n\tconst numRows = gridTemplateRows.split( ' ' ).length;\n\tconst numItems = numColumns * numRows;\n\treturn {\n\t\tnumItems,\n\t\tcurrentColor: getComputedCSS( blockElement, 'color' ),\n\t\tstyle: {\n\t\t\tgridTemplateColumns,\n\t\t\tgridTemplateRows,\n\t\t\tgap: getComputedCSS( blockElement, 'gap' ),\n\t\t\tpadding: getComputedCSS( blockElement, 'padding' ),\n\t\t},\n\t};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K,CAAE,GAAI,CAAC,CAACV,MAAM;EACpD,MAAMC,QAAQ,GAAGQ,UAAU,GAAGE,OAAO;EACrC,OAAO;IACNV,QAAQ;IACRI,YAAY,EAAE,IAAAE,qBAAc,EAAEjC,YAAY,EAAE,OAAQ,CAAC;IACrDuB,KAAK,EAAE;MACNS,mBAAmB;MACnBE,gBAAgB;MAChBI,GAAG,EAAE,IAAAL,qBAAc,EAAEjC,YAAY,EAAE,KAAM,CAAC;MAC1CuC,OAAO,EAAE,IAAAN,qBAAc,EAAEjC,YAAY,EAAE,SAAU;IAClD;EACD,CAAC;AACF","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_gridVisualizer","require","_gridItemResizer"],"sources":["@wordpress/block-editor/src/components/grid-visualizer/index.js"],"sourcesContent":["export { GridVisualizer } from './grid-visualizer';\nexport { GridItemResizer } from './grid-item-resizer';\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAAA,eAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA","ignoreList":[]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getComputedCSS = getComputedCSS;
|
|
7
|
-
function getComputedCSS(element, property) {
|
|
8
|
-
return element.ownerDocument.defaultView.getComputedStyle(element).getPropertyValue(property);
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["getComputedCSS","element","property","ownerDocument","defaultView","getComputedStyle","getPropertyValue"],"sources":["@wordpress/block-editor/src/components/grid-visualizer/utils.js"],"sourcesContent":["export function getComputedCSS( element, property ) {\n\treturn element.ownerDocument.defaultView\n\t\t.getComputedStyle( element )\n\t\t.getPropertyValue( property );\n}\n"],"mappings":";;;;;;AAAO,SAASA,cAAcA,CAAEC,OAAO,EAAEC,QAAQ,EAAG;EACnD,OAAOD,OAAO,CAACE,aAAa,CAACC,WAAW,CACtCC,gBAAgB,CAAEJ,OAAQ,CAAC,CAC3BK,gBAAgB,CAAEJ,QAAS,CAAC;AAC/B","ignoreList":[]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.undoIgnoreBlocks = void 0;
|
|
7
|
-
// Keep track of the blocks that should not be pushing an additional
|
|
8
|
-
// undo stack when editing the entity.
|
|
9
|
-
// See the implementation of `syncDerivedUpdates` and `useBlockSync`.
|
|
10
|
-
const undoIgnoreBlocks = exports.undoIgnoreBlocks = new WeakSet();
|
|
11
|
-
//# sourceMappingURL=undo-ignore.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["undoIgnoreBlocks","exports","WeakSet"],"sources":["@wordpress/block-editor/src/store/undo-ignore.js"],"sourcesContent":["// Keep track of the blocks that should not be pushing an additional\n// undo stack when editing the entity.\n// See the implementation of `syncDerivedUpdates` and `useBlockSync`.\nexport const undoIgnoreBlocks = new WeakSet();\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACO,MAAMA,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAG,IAAIE,OAAO,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["ResizableBox","useState","useEffect","__unstableUseBlockElement","useBlockElement","BlockPopoverCover","getComputedCSS","jsx","_jsx","GridItemResizer","clientId","bounds","onChange","blockElement","rootBlockElement","parentElement","GridItemResizerInner","resizeDirection","setResizeDirection","enableSide","setEnableSide","top","bottom","left","right","observer","window","ResizeObserver","blockClientRect","getBoundingClientRect","rootBlockClientRect","observe","disconnect","justification","alignment","styles","display","justifyContent","alignItems","className","__unstablePopoverSlot","additionalStyles","children","size","width","height","enable","bottomLeft","bottomRight","topLeft","topRight","boundsByDirection","onResizeStart","event","direction","ownerDocument","addEventListener","target","dispatchEvent","Event","bubbles","once","onResizeStop","boxElement","columnGap","parseFloat","rowGap","gridColumnTracks","getGridTracks","gridRowTracks","rect","DOMRect","offsetLeft","offsetTop","offsetWidth","offsetHeight","columnStart","getClosestTrack","rowStart","columnEnd","rowEnd","columnSpan","rowSpan","template","gap","tracks","split","previousTrack","length","start","end","push","position","edge","reduce","closest","track","index","Math","abs"],"sources":["@wordpress/block-editor/src/components/grid-visualizer/grid-item-resizer.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ResizableBox } from '@wordpress/components';\nimport { useState, useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { __unstableUseBlockElement as useBlockElement } from '../block-list/use-block-props/use-block-refs';\nimport BlockPopoverCover from '../block-popover/cover';\nimport { getComputedCSS } from './utils';\n\nexport function GridItemResizer( { clientId, bounds, onChange } ) {\n\tconst blockElement = useBlockElement( clientId );\n\tconst rootBlockElement = blockElement?.parentElement;\n\n\tif ( ! blockElement || ! rootBlockElement ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<GridItemResizerInner\n\t\t\tclientId={ clientId }\n\t\t\tbounds={ bounds }\n\t\t\tblockElement={ blockElement }\n\t\t\trootBlockElement={ rootBlockElement }\n\t\t\tonChange={ onChange }\n\t\t/>\n\t);\n}\n\nfunction GridItemResizerInner( {\n\tclientId,\n\tbounds,\n\tblockElement,\n\trootBlockElement,\n\tonChange,\n} ) {\n\tconst [ resizeDirection, setResizeDirection ] = useState( null );\n\tconst [ enableSide, setEnableSide ] = useState( {\n\t\ttop: false,\n\t\tbottom: false,\n\t\tleft: false,\n\t\tright: false,\n\t} );\n\n\tuseEffect( () => {\n\t\tconst observer = new window.ResizeObserver( () => {\n\t\t\tconst blockClientRect = blockElement.getBoundingClientRect();\n\t\t\tconst rootBlockClientRect =\n\t\t\t\trootBlockElement.getBoundingClientRect();\n\t\t\tsetEnableSide( {\n\t\t\t\ttop: blockClientRect.top > rootBlockClientRect.top,\n\t\t\t\tbottom: blockClientRect.bottom < rootBlockClientRect.bottom,\n\t\t\t\tleft: blockClientRect.left > rootBlockClientRect.left,\n\t\t\t\tright: blockClientRect.right < rootBlockClientRect.right,\n\t\t\t} );\n\t\t} );\n\t\tobserver.observe( blockElement );\n\t\treturn () => observer.disconnect();\n\t}, [ blockElement, rootBlockElement ] );\n\n\tconst justification = {\n\t\tright: 'flex-start',\n\t\tleft: 'flex-end',\n\t};\n\n\tconst alignment = {\n\t\ttop: 'flex-end',\n\t\tbottom: 'flex-start',\n\t};\n\n\tconst styles = {\n\t\tdisplay: 'flex',\n\t\tjustifyContent: 'center',\n\t\talignItems: 'center',\n\t\t...( justification[ resizeDirection ] && {\n\t\t\tjustifyContent: justification[ resizeDirection ],\n\t\t} ),\n\t\t...( alignment[ resizeDirection ] && {\n\t\t\talignItems: alignment[ resizeDirection ],\n\t\t} ),\n\t};\n\n\treturn (\n\t\t<BlockPopoverCover\n\t\t\tclassName=\"block-editor-grid-item-resizer\"\n\t\t\tclientId={ clientId }\n\t\t\t__unstablePopoverSlot=\"block-toolbar\"\n\t\t\tadditionalStyles={ styles }\n\t\t>\n\t\t\t<ResizableBox\n\t\t\t\tclassName=\"block-editor-grid-item-resizer__box\"\n\t\t\t\tsize={ {\n\t\t\t\t\twidth: '100%',\n\t\t\t\t\theight: '100%',\n\t\t\t\t} }\n\t\t\t\tenable={ {\n\t\t\t\t\tbottom: enableSide.bottom,\n\t\t\t\t\tbottomLeft: false,\n\t\t\t\t\tbottomRight: false,\n\t\t\t\t\tleft: enableSide.left,\n\t\t\t\t\tright: enableSide.right,\n\t\t\t\t\ttop: enableSide.top,\n\t\t\t\t\ttopLeft: false,\n\t\t\t\t\ttopRight: false,\n\t\t\t\t} }\n\t\t\t\tbounds={ bounds }\n\t\t\t\tboundsByDirection\n\t\t\t\tonResizeStart={ ( event, direction ) => {\n\t\t\t\t\t/*\n\t\t\t\t\t * The container justification and alignment need to be set\n\t\t\t\t\t * according to the direction the resizer is being dragged in,\n\t\t\t\t\t * so that it resizes in the right direction.\n\t\t\t\t\t */\n\t\t\t\t\tsetResizeDirection( direction );\n\n\t\t\t\t\t/*\n\t\t\t\t\t * The mouseup event on the resize handle doesn't trigger if the mouse\n\t\t\t\t\t * isn't directly above the handle, so we try to detect if it happens\n\t\t\t\t\t * outside the grid and dispatch a mouseup event on the handle.\n\t\t\t\t\t */\n\t\t\t\t\tblockElement.ownerDocument.addEventListener(\n\t\t\t\t\t\t'mouseup',\n\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\tevent.target.dispatchEvent(\n\t\t\t\t\t\t\t\tnew Event( 'mouseup', { bubbles: true } )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{ once: true }\n\t\t\t\t\t);\n\t\t\t\t} }\n\t\t\t\tonResizeStop={ ( event, direction, boxElement ) => {\n\t\t\t\t\tconst columnGap = parseFloat(\n\t\t\t\t\t\tgetComputedCSS( rootBlockElement, 'column-gap' )\n\t\t\t\t\t);\n\t\t\t\t\tconst rowGap = parseFloat(\n\t\t\t\t\t\tgetComputedCSS( rootBlockElement, 'row-gap' )\n\t\t\t\t\t);\n\t\t\t\t\tconst gridColumnTracks = getGridTracks(\n\t\t\t\t\t\tgetComputedCSS(\n\t\t\t\t\t\t\trootBlockElement,\n\t\t\t\t\t\t\t'grid-template-columns'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tcolumnGap\n\t\t\t\t\t);\n\t\t\t\t\tconst gridRowTracks = getGridTracks(\n\t\t\t\t\t\tgetComputedCSS(\n\t\t\t\t\t\t\trootBlockElement,\n\t\t\t\t\t\t\t'grid-template-rows'\n\t\t\t\t\t\t),\n\t\t\t\t\t\trowGap\n\t\t\t\t\t);\n\t\t\t\t\tconst rect = new window.DOMRect(\n\t\t\t\t\t\tblockElement.offsetLeft + boxElement.offsetLeft,\n\t\t\t\t\t\tblockElement.offsetTop + boxElement.offsetTop,\n\t\t\t\t\t\tboxElement.offsetWidth,\n\t\t\t\t\t\tboxElement.offsetHeight\n\t\t\t\t\t);\n\t\t\t\t\tconst columnStart =\n\t\t\t\t\t\tgetClosestTrack( gridColumnTracks, rect.left ) + 1;\n\t\t\t\t\tconst rowStart =\n\t\t\t\t\t\tgetClosestTrack( gridRowTracks, rect.top ) + 1;\n\t\t\t\t\tconst columnEnd =\n\t\t\t\t\t\tgetClosestTrack( gridColumnTracks, rect.right, 'end' ) +\n\t\t\t\t\t\t1;\n\t\t\t\t\tconst rowEnd =\n\t\t\t\t\t\tgetClosestTrack( gridRowTracks, rect.bottom, 'end' ) +\n\t\t\t\t\t\t1;\n\t\t\t\t\tonChange( {\n\t\t\t\t\t\tcolumnSpan: columnEnd - columnStart + 1,\n\t\t\t\t\t\trowSpan: rowEnd - rowStart + 1,\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t/>\n\t\t</BlockPopoverCover>\n\t);\n}\n\n/**\n * Given a grid-template-columns or grid-template-rows CSS property value, gets the start and end\n * position in pixels of each grid track.\n *\n * https://css-tricks.com/snippets/css/complete-guide-grid/#aa-grid-track\n *\n * @param {string} template The grid-template-columns or grid-template-rows CSS property value.\n * Only supports fixed sizes in pixels.\n * @param {number} gap The gap between grid tracks in pixels.\n *\n * @return {Array<{start: number, end: number}>} An array of objects with the start and end\n * position in pixels of each grid track.\n */\nfunction getGridTracks( template, gap ) {\n\tconst tracks = [];\n\tfor ( const size of template.split( ' ' ) ) {\n\t\tconst previousTrack = tracks[ tracks.length - 1 ];\n\t\tconst start = previousTrack ? previousTrack.end + gap : 0;\n\t\tconst end = start + parseFloat( size );\n\t\ttracks.push( { start, end } );\n\t}\n\treturn tracks;\n}\n\n/**\n * Given an array of grid tracks and a position in pixels, gets the index of the closest track to\n * that position.\n *\n * https://css-tricks.com/snippets/css/complete-guide-grid/#aa-grid-track\n *\n * @param {Array<{start: number, end: number}>} tracks An array of objects with the start and end\n * position in pixels of each grid track.\n * @param {number} position The position in pixels.\n * @param {string} edge The edge of the track to compare the\n * position to. Either 'start' or 'end'.\n *\n * @return {number} The index of the closest track to the position. 0-based, unlike CSS grid which\n * is 1-based.\n */\nfunction getClosestTrack( tracks, position, edge = 'start' ) {\n\treturn tracks.reduce(\n\t\t( closest, track, index ) =>\n\t\t\tMath.abs( track[ edge ] - position ) <\n\t\t\tMath.abs( tracks[ closest ][ edge ] - position )\n\t\t\t\t? index\n\t\t\t\t: closest,\n\t\t0\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,YAAY,QAAQ,uBAAuB;AACpD,SAASC,QAAQ,EAAEC,SAAS,QAAQ,oBAAoB;;AAExD;AACA;AACA;AACA,SAASC,yBAAyB,IAAIC,eAAe,QAAQ,8CAA8C;AAC3G,OAAOC,iBAAiB,MAAM,wBAAwB;AACtD,SAASC,cAAc,QAAQ,SAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEzC,OAAO,SAASC,eAAeA,CAAE;EAAEC,QAAQ;EAAEC,MAAM;EAAEC;AAAS,CAAC,EAAG;EACjE,MAAMC,YAAY,GAAGT,eAAe,CAAEM,QAAS,CAAC;EAChD,MAAMI,gBAAgB,GAAGD,YAAY,EAAEE,aAAa;EAEpD,IAAK,CAAEF,YAAY,IAAI,CAAEC,gBAAgB,EAAG;IAC3C,OAAO,IAAI;EACZ;EAEA,oBACCN,IAAA,CAACQ,oBAAoB;IACpBN,QAAQ,EAAGA,QAAU;IACrBC,MAAM,EAAGA,MAAQ;IACjBE,YAAY,EAAGA,YAAc;IAC7BC,gBAAgB,EAAGA,gBAAkB;IACrCF,QAAQ,EAAGA;EAAU,CACrB,CAAC;AAEJ;AAEA,SAASI,oBAAoBA,CAAE;EAC9BN,QAAQ;EACRC,MAAM;EACNE,YAAY;EACZC,gBAAgB;EAChBF;AACD,CAAC,EAAG;EACH,MAAM,CAAEK,eAAe,EAAEC,kBAAkB,CAAE,GAAGjB,QAA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QAAQ,EAAEC,GAAG,EAAG;EACvC,MAAMC,MAAM,GAAG,EAAE;EACjB,KAAM,MAAM1C,IAAI,IAAIwC,QAAQ,CAACG,KAAK,CAAE,GAAI,CAAC,EAAG;IAC3C,MAAMC,aAAa,GAAGF,MAAM,CAAEA,MAAM,CAACG,MAAM,GAAG,CAAC,CAAE;IACjD,MAAMC,KAAK,GAAGF,aAAa,GAAGA,aAAa,CAACG,GAAG,GAAGN,GAAG,GAAG,CAAC;IACzD,MAAMM,GAAG,GAAGD,KAAK,GAAGxB,UAAU,CAAEtB,IAAK,CAAC;IACtC0C,MAAM,CAACM,IAAI,CAAE;MAAEF,KAAK;MAAEC;IAAI,CAAE,CAAC;EAC9B;EACA,OAAOL,MAAM;AACd;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASR,eAAeA,CAAEQ,MAAM,EAAEO,QAAQ,EAAEC,IAAI,GAAG,OAAO,EAAG;EAC5D,OAAOR,MAAM,CAACS,MAAM,CACnB,CAAEC,OAAO,EAAEC,KAAK,EAAEC,KAAK,KACtBC,IAAI,CAACC,GAAG,CAAEH,KAAK,CAAEH,IAAI,CAAE,GAAGD,QAAS,CAAC,GACpCM,IAAI,CAACC,GAAG,CAAEd,MAAM,CAAEU,OAAO,CAAE,CAAEF,IAAI,CAAE,GAAGD,QAAS,CAAC,GAC7CK,KAAK,GACLF,OAAO,EACX,CACD,CAAC;AACF","ignoreList":[]}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { useState, useEffect, forwardRef } from '@wordpress/element';
|
|
5
|
-
import { useSelect } from '@wordpress/data';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Internal dependencies
|
|
9
|
-
*/
|
|
10
|
-
import { __unstableUseBlockElement as useBlockElement } from '../block-list/use-block-props/use-block-refs';
|
|
11
|
-
import BlockPopoverCover from '../block-popover/cover';
|
|
12
|
-
import { store as blockEditorStore } from '../../store';
|
|
13
|
-
import { getComputedCSS } from './utils';
|
|
14
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
-
export function GridVisualizer({
|
|
16
|
-
clientId,
|
|
17
|
-
contentRef
|
|
18
|
-
}) {
|
|
19
|
-
const isDistractionFree = useSelect(select => select(blockEditorStore).getSettings().isDistractionFree, []);
|
|
20
|
-
const blockElement = useBlockElement(clientId);
|
|
21
|
-
if (isDistractionFree || !blockElement) {
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
return /*#__PURE__*/_jsx(BlockPopoverCover, {
|
|
25
|
-
className: "block-editor-grid-visualizer",
|
|
26
|
-
clientId: clientId,
|
|
27
|
-
__unstablePopoverSlot: "block-toolbar",
|
|
28
|
-
children: /*#__PURE__*/_jsx(GridVisualizerGrid, {
|
|
29
|
-
ref: contentRef,
|
|
30
|
-
blockElement: blockElement
|
|
31
|
-
})
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
const GridVisualizerGrid = forwardRef(({
|
|
35
|
-
blockElement
|
|
36
|
-
}, ref) => {
|
|
37
|
-
const [gridInfo, setGridInfo] = useState(() => getGridInfo(blockElement));
|
|
38
|
-
useEffect(() => {
|
|
39
|
-
const observers = [];
|
|
40
|
-
for (const element of [blockElement, ...blockElement.children]) {
|
|
41
|
-
const observer = new window.ResizeObserver(() => {
|
|
42
|
-
setGridInfo(getGridInfo(blockElement));
|
|
43
|
-
});
|
|
44
|
-
observer.observe(element);
|
|
45
|
-
observers.push(observer);
|
|
46
|
-
}
|
|
47
|
-
return () => {
|
|
48
|
-
for (const observer of observers) {
|
|
49
|
-
observer.disconnect();
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
}, [blockElement]);
|
|
53
|
-
return /*#__PURE__*/_jsx("div", {
|
|
54
|
-
ref: ref,
|
|
55
|
-
className: "block-editor-grid-visualizer__grid",
|
|
56
|
-
style: gridInfo.style,
|
|
57
|
-
children: Array.from({
|
|
58
|
-
length: gridInfo.numItems
|
|
59
|
-
}, (_, i) => /*#__PURE__*/_jsx("div", {
|
|
60
|
-
className: "block-editor-grid-visualizer__item",
|
|
61
|
-
style: {
|
|
62
|
-
boxShadow: `inset 0 0 0 1px color-mix(in srgb, ${gridInfo.currentColor} 20%, #0000)`
|
|
63
|
-
}
|
|
64
|
-
}, i))
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
function getGridInfo(blockElement) {
|
|
68
|
-
const gridTemplateColumns = getComputedCSS(blockElement, 'grid-template-columns');
|
|
69
|
-
const gridTemplateRows = getComputedCSS(blockElement, 'grid-template-rows');
|
|
70
|
-
const numColumns = gridTemplateColumns.split(' ').length;
|
|
71
|
-
const numRows = gridTemplateRows.split(' ').length;
|
|
72
|
-
const numItems = numColumns * numRows;
|
|
73
|
-
return {
|
|
74
|
-
numItems,
|
|
75
|
-
currentColor: getComputedCSS(blockElement, 'color'),
|
|
76
|
-
style: {
|
|
77
|
-
gridTemplateColumns,
|
|
78
|
-
gridTemplateRows,
|
|
79
|
-
gap: getComputedCSS(blockElement, 'gap'),
|
|
80
|
-
padding: getComputedCSS(blockElement, 'padding')
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
//# sourceMappingURL=grid-visualizer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["useState","useEffect","forwardRef","useSelect","__unstableUseBlockElement","useBlockElement","BlockPopoverCover","store","blockEditorStore","getComputedCSS","jsx","_jsx","GridVisualizer","clientId","contentRef","isDistractionFree","select","getSettings","blockElement","className","__unstablePopoverSlot","children","GridVisualizerGrid","ref","gridInfo","setGridInfo","getGridInfo","observers","element","observer","window","ResizeObserver","observe","push","disconnect","style","Array","from","length","numItems","_","i","boxShadow","currentColor","gridTemplateColumns","gridTemplateRows","numColumns","split","numRows","gap","padding"],"sources":["@wordpress/block-editor/src/components/grid-visualizer/grid-visualizer.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useEffect, forwardRef } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { __unstableUseBlockElement as useBlockElement } from '../block-list/use-block-props/use-block-refs';\nimport BlockPopoverCover from '../block-popover/cover';\nimport { store as blockEditorStore } from '../../store';\nimport { getComputedCSS } from './utils';\n\nexport function GridVisualizer( { clientId, contentRef } ) {\n\tconst isDistractionFree = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getSettings().isDistractionFree,\n\t\t[]\n\t);\n\tconst blockElement = useBlockElement( clientId );\n\n\tif ( isDistractionFree || ! blockElement ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<BlockPopoverCover\n\t\t\tclassName=\"block-editor-grid-visualizer\"\n\t\t\tclientId={ clientId }\n\t\t\t__unstablePopoverSlot=\"block-toolbar\"\n\t\t>\n\t\t\t<GridVisualizerGrid\n\t\t\t\tref={ contentRef }\n\t\t\t\tblockElement={ blockElement }\n\t\t\t/>\n\t\t</BlockPopoverCover>\n\t);\n}\n\nconst GridVisualizerGrid = forwardRef( ( { blockElement }, ref ) => {\n\tconst [ gridInfo, setGridInfo ] = useState( () =>\n\t\tgetGridInfo( blockElement )\n\t);\n\tuseEffect( () => {\n\t\tconst observers = [];\n\t\tfor ( const element of [ blockElement, ...blockElement.children ] ) {\n\t\t\tconst observer = new window.ResizeObserver( () => {\n\t\t\t\tsetGridInfo( getGridInfo( blockElement ) );\n\t\t\t} );\n\t\t\tobserver.observe( element );\n\t\t\tobservers.push( observer );\n\t\t}\n\t\treturn () => {\n\t\t\tfor ( const observer of observers ) {\n\t\t\t\tobserver.disconnect();\n\t\t\t}\n\t\t};\n\t}, [ blockElement ] );\n\treturn (\n\t\t<div\n\t\t\tref={ ref }\n\t\t\tclassName=\"block-editor-grid-visualizer__grid\"\n\t\t\tstyle={ gridInfo.style }\n\t\t>\n\t\t\t{ Array.from( { length: gridInfo.numItems }, ( _, i ) => (\n\t\t\t\t<div\n\t\t\t\t\tkey={ i }\n\t\t\t\t\tclassName=\"block-editor-grid-visualizer__item\"\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tboxShadow: `inset 0 0 0 1px color-mix(in srgb, ${ gridInfo.currentColor } 20%, #0000)`,\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</div>\n\t);\n} );\n\nfunction getGridInfo( blockElement ) {\n\tconst gridTemplateColumns = getComputedCSS(\n\t\tblockElement,\n\t\t'grid-template-columns'\n\t);\n\tconst gridTemplateRows = getComputedCSS(\n\t\tblockElement,\n\t\t'grid-template-rows'\n\t);\n\tconst numColumns = gridTemplateColumns.split( ' ' ).length;\n\tconst numRows = gridTemplateRows.split( ' ' ).length;\n\tconst numItems = numColumns * numRows;\n\treturn {\n\t\tnumItems,\n\t\tcurrentColor: getComputedCSS( blockElement, 'color' ),\n\t\tstyle: {\n\t\t\tgridTemplateColumns,\n\t\t\tgridTemplateRows,\n\t\t\tgap: getComputedCSS( blockElement, 'gap' ),\n\t\t\tpadding: getComputedCSS( blockElement, 'padding' ),\n\t\t},\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,EAAEC,SAAS,EAAEC,UAAU,QAAQ,oBAAoB;AACpE,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,yBAAyB,IAAIC,eAAe,QAAQ,8CAA8C;AAC3G,OAAOC,iBAAiB,MAAM,wBAAwB;AACtD,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AACvD,SAASC,cAAc,QAAQ,SAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEzC,OAAO,SAASC,cAAcA,CAAE;EAAEC,QAAQ;EAAEC;AAAW,CAAC,EAAG;EAC1D,MAAMC,iBAAiB,GAAGZ,SAAS,CAChCa,MAAM,IACPA,MAAM,CAAER,gBAAiB,CAAC,CAACS,WAAW,CA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KAAK,EAAGX,QAAQ,CAACW,KAAO;IAAAd,QAAA,EAEtBe,KAAK,CAACC,IAAI,CAAE;MAAEC,MAAM,EAAEd,QAAQ,CAACe;IAAS,CAAC,EAAE,CAAEC,CAAC,EAAEC,CAAC,kBAClD9B,IAAA;MAECQ,SAAS,EAAC,oCAAoC;MAC9CgB,KAAK,EAAG;QACPO,SAAS,EAAG,sCAAsClB,QAAQ,CAACmB,YAAc;MAC1E;IAAG,GAJGF,CAKN,CACA;EAAC,CACC,CAAC;AAER,CAAE,CAAC;AAEH,SAASf,WAAWA,CAAER,YAAY,EAAG;EACpC,MAAM0B,mBAAmB,GAAGnC,cAAc,CACzCS,YAAY,EACZ,uBACD,CAAC;EACD,MAAM2B,gBAAgB,GAAGpC,cAAc,CACtCS,YAAY,EACZ,oBACD,CAAC;EACD,MAAM4B,UAAU,GAAGF,mBAAmB,CAACG,KAAK,CAAE,GAAI,CAAC,CAACT,MAAM;EAC1D,MAAMU,OAAO,GAAGH,gBAAgB,CAACE,KAAK,CAAE,GAAI,CAAC,CAACT,MAAM;EACpD,MAAMC,QAAQ,GAAGO,UAAU,GAAGE,OAAO;EACrC,OAAO;IACNT,QAAQ;IACRI,YAAY,EAAElC,cAAc,CAAES,YAAY,EAAE,OAAQ,CAAC;IACrDiB,KAAK,EAAE;MACNS,mBAAmB;MACnBC,gBAAgB;MAChBI,GAAG,EAAExC,cAAc,CAAES,YAAY,EAAE,KAAM,CAAC;MAC1CgC,OAAO,EAAEzC,cAAc,CAAES,YAAY,EAAE,SAAU;IAClD;EACD,CAAC;AACF","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["GridVisualizer","GridItemResizer"],"sources":["@wordpress/block-editor/src/components/grid-visualizer/index.js"],"sourcesContent":["export { GridVisualizer } from './grid-visualizer';\nexport { GridItemResizer } from './grid-item-resizer';\n"],"mappings":"AAAA,SAASA,cAAc,QAAQ,mBAAmB;AAClD,SAASC,eAAe,QAAQ,qBAAqB","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["getComputedCSS","element","property","ownerDocument","defaultView","getComputedStyle","getPropertyValue"],"sources":["@wordpress/block-editor/src/components/grid-visualizer/utils.js"],"sourcesContent":["export function getComputedCSS( element, property ) {\n\treturn element.ownerDocument.defaultView\n\t\t.getComputedStyle( element )\n\t\t.getPropertyValue( property );\n}\n"],"mappings":"AAAA,OAAO,SAASA,cAAcA,CAAEC,OAAO,EAAEC,QAAQ,EAAG;EACnD,OAAOD,OAAO,CAACE,aAAa,CAACC,WAAW,CACtCC,gBAAgB,CAAEJ,OAAQ,CAAC,CAC3BK,gBAAgB,CAAEJ,QAAS,CAAC;AAC/B","ignoreList":[]}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
// Keep track of the blocks that should not be pushing an additional
|
|
2
|
-
// undo stack when editing the entity.
|
|
3
|
-
// See the implementation of `syncDerivedUpdates` and `useBlockSync`.
|
|
4
|
-
export const undoIgnoreBlocks = new WeakSet();
|
|
5
|
-
//# sourceMappingURL=undo-ignore.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["undoIgnoreBlocks","WeakSet"],"sources":["@wordpress/block-editor/src/store/undo-ignore.js"],"sourcesContent":["// Keep track of the blocks that should not be pushing an additional\n// undo stack when editing the entity.\n// See the implementation of `syncDerivedUpdates` and `useBlockSync`.\nexport const undoIgnoreBlocks = new WeakSet();\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,MAAMA,gBAAgB,GAAG,IAAIC,OAAO,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { useState, useEffect, forwardRef } from '@wordpress/element';
|
|
5
|
-
import { useSelect } from '@wordpress/data';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Internal dependencies
|
|
9
|
-
*/
|
|
10
|
-
import { __unstableUseBlockElement as useBlockElement } from '../block-list/use-block-props/use-block-refs';
|
|
11
|
-
import BlockPopoverCover from '../block-popover/cover';
|
|
12
|
-
import { store as blockEditorStore } from '../../store';
|
|
13
|
-
import { getComputedCSS } from './utils';
|
|
14
|
-
|
|
15
|
-
export function GridVisualizer( { clientId, contentRef } ) {
|
|
16
|
-
const isDistractionFree = useSelect(
|
|
17
|
-
( select ) =>
|
|
18
|
-
select( blockEditorStore ).getSettings().isDistractionFree,
|
|
19
|
-
[]
|
|
20
|
-
);
|
|
21
|
-
const blockElement = useBlockElement( clientId );
|
|
22
|
-
|
|
23
|
-
if ( isDistractionFree || ! blockElement ) {
|
|
24
|
-
return null;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
return (
|
|
28
|
-
<BlockPopoverCover
|
|
29
|
-
className="block-editor-grid-visualizer"
|
|
30
|
-
clientId={ clientId }
|
|
31
|
-
__unstablePopoverSlot="block-toolbar"
|
|
32
|
-
>
|
|
33
|
-
<GridVisualizerGrid
|
|
34
|
-
ref={ contentRef }
|
|
35
|
-
blockElement={ blockElement }
|
|
36
|
-
/>
|
|
37
|
-
</BlockPopoverCover>
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const GridVisualizerGrid = forwardRef( ( { blockElement }, ref ) => {
|
|
42
|
-
const [ gridInfo, setGridInfo ] = useState( () =>
|
|
43
|
-
getGridInfo( blockElement )
|
|
44
|
-
);
|
|
45
|
-
useEffect( () => {
|
|
46
|
-
const observers = [];
|
|
47
|
-
for ( const element of [ blockElement, ...blockElement.children ] ) {
|
|
48
|
-
const observer = new window.ResizeObserver( () => {
|
|
49
|
-
setGridInfo( getGridInfo( blockElement ) );
|
|
50
|
-
} );
|
|
51
|
-
observer.observe( element );
|
|
52
|
-
observers.push( observer );
|
|
53
|
-
}
|
|
54
|
-
return () => {
|
|
55
|
-
for ( const observer of observers ) {
|
|
56
|
-
observer.disconnect();
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
}, [ blockElement ] );
|
|
60
|
-
return (
|
|
61
|
-
<div
|
|
62
|
-
ref={ ref }
|
|
63
|
-
className="block-editor-grid-visualizer__grid"
|
|
64
|
-
style={ gridInfo.style }
|
|
65
|
-
>
|
|
66
|
-
{ Array.from( { length: gridInfo.numItems }, ( _, i ) => (
|
|
67
|
-
<div
|
|
68
|
-
key={ i }
|
|
69
|
-
className="block-editor-grid-visualizer__item"
|
|
70
|
-
style={ {
|
|
71
|
-
boxShadow: `inset 0 0 0 1px color-mix(in srgb, ${ gridInfo.currentColor } 20%, #0000)`,
|
|
72
|
-
} }
|
|
73
|
-
/>
|
|
74
|
-
) ) }
|
|
75
|
-
</div>
|
|
76
|
-
);
|
|
77
|
-
} );
|
|
78
|
-
|
|
79
|
-
function getGridInfo( blockElement ) {
|
|
80
|
-
const gridTemplateColumns = getComputedCSS(
|
|
81
|
-
blockElement,
|
|
82
|
-
'grid-template-columns'
|
|
83
|
-
);
|
|
84
|
-
const gridTemplateRows = getComputedCSS(
|
|
85
|
-
blockElement,
|
|
86
|
-
'grid-template-rows'
|
|
87
|
-
);
|
|
88
|
-
const numColumns = gridTemplateColumns.split( ' ' ).length;
|
|
89
|
-
const numRows = gridTemplateRows.split( ' ' ).length;
|
|
90
|
-
const numItems = numColumns * numRows;
|
|
91
|
-
return {
|
|
92
|
-
numItems,
|
|
93
|
-
currentColor: getComputedCSS( blockElement, 'color' ),
|
|
94
|
-
style: {
|
|
95
|
-
gridTemplateColumns,
|
|
96
|
-
gridTemplateRows,
|
|
97
|
-
gap: getComputedCSS( blockElement, 'gap' ),
|
|
98
|
-
padding: getComputedCSS( blockElement, 'padding' ),
|
|
99
|
-
},
|
|
100
|
-
};
|
|
101
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
// TODO: Specificity hacks to get rid of all these darn !importants.
|
|
2
|
-
|
|
3
|
-
.block-editor-grid-visualizer {
|
|
4
|
-
z-index: z-index(".block-editor-grid-visualizer") !important;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.block-editor-grid-visualizer .components-popover__content * {
|
|
8
|
-
pointer-events: none !important;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.block-editor-grid-visualizer__grid {
|
|
12
|
-
display: grid;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.block-editor-grid-visualizer__item {
|
|
16
|
-
outline: 1px solid transparent;
|
|
17
|
-
border-radius: $radius-block-ui;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.block-editor-grid-item-resizer {
|
|
21
|
-
z-index: z-index(".block-editor-grid-visualizer") !important;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.block-editor-grid-item-resizer .components-popover__content * {
|
|
25
|
-
pointer-events: none !important;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.block-editor-grid-item-resizer__box {
|
|
29
|
-
border: $border-width solid var(--wp-admin-theme-color);
|
|
30
|
-
|
|
31
|
-
.components-resizable-box__handle {
|
|
32
|
-
pointer-events: all !important;
|
|
33
|
-
}
|
|
34
|
-
}
|
package/src/store/undo-ignore.js
DELETED
|
File without changes
|