@wordpress/block-editor 13.1.0 → 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 +19 -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/block-toolbar/shuffle.js +3 -1
- package/build/components/block-toolbar/shuffle.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/global-styles/use-global-styles-output.js +4 -3
- package/build/components/global-styles/use-global-styles-output.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/image-editor/aspect-ratio-dropdown.js +0 -1
- package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
- package/build/components/inner-blocks/index.js +1 -1
- package/build/components/inner-blocks/index.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 +10 -4
- package/build/components/rich-text/index.native.js.map +1 -1
- package/build/components/rich-text/native/index.native.js +14 -0
- package/build/components/rich-text/native/index.native.js.map +1 -1
- package/build/hooks/block-style-variation.js +26 -7
- 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/hooks/utils.js +3 -2
- package/build/hooks/utils.js.map +1 -1
- package/build/layouts/grid.js +24 -47
- package/build/layouts/grid.js.map +1 -1
- package/build/lock-unlock.js +1 -1
- package/build/lock-unlock.js.map +1 -1
- package/build/store/actions.js +17 -1
- package/build/store/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/block-toolbar/shuffle.js +3 -1
- package/build-module/components/block-toolbar/shuffle.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/global-styles/use-global-styles-output.js +4 -3
- package/build-module/components/global-styles/use-global-styles-output.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/image-editor/aspect-ratio-dropdown.js +0 -1
- package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
- 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/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 +11 -5
- package/build-module/components/rich-text/index.native.js.map +1 -1
- package/build-module/components/rich-text/native/index.native.js +14 -0
- package/build-module/components/rich-text/native/index.native.js.map +1 -1
- package/build-module/hooks/block-style-variation.js +25 -7
- 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/hooks/utils.js +3 -2
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/layouts/grid.js +24 -47
- package/build-module/layouts/grid.js.map +1 -1
- package/build-module/lock-unlock.js +1 -1
- package/build-module/lock-unlock.js.map +1 -1
- package/build-module/store/actions.js +17 -1
- package/build-module/store/actions.js.map +1 -1
- package/build-style/style-rtl.css +39 -18
- package/build-style/style.css +39 -18
- 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/block-toolbar/shuffle.js +3 -1
- package/src/components/child-layout-control/index.js +224 -159
- package/src/components/global-styles/test/use-global-styles-output.js +38 -3
- package/src/components/global-styles/use-global-styles-output.js +4 -3
- 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/image-editor/aspect-ratio-dropdown.js +0 -1
- package/src/components/inner-blocks/index.js +3 -1
- package/src/components/rich-text/event-listeners/input-rules.js +1 -1
- package/src/components/rich-text/index.native.js +10 -8
- package/src/components/rich-text/native/index.native.js +17 -0
- package/src/hooks/block-style-variation.js +24 -6
- package/src/hooks/layout-child.js +34 -14
- package/src/hooks/utils.js +3 -1
- package/src/layouts/grid.js +54 -62
- package/src/lock-unlock.js +1 -1
- package/src/store/actions.js +21 -1
- 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-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/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/components/font-sizes/{README.MD → README.md} +0 -0
|
@@ -10,7 +10,7 @@ var _element = require("@wordpress/element");
|
|
|
10
10
|
var _store = require("../store");
|
|
11
11
|
var _utils = require("./utils");
|
|
12
12
|
var _layout = require("../components/block-list/layout");
|
|
13
|
-
var
|
|
13
|
+
var _grid = require("../components/grid");
|
|
14
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
15
|
/**
|
|
16
16
|
* WordPress dependencies
|
|
@@ -136,10 +136,12 @@ function ChildLayoutControlsPure({
|
|
|
136
136
|
style,
|
|
137
137
|
setAttributes
|
|
138
138
|
}) {
|
|
139
|
+
const parentLayout = (0, _layout.useLayout)() || {};
|
|
139
140
|
const {
|
|
140
141
|
type: parentLayoutType = 'default',
|
|
141
|
-
allowSizingOnChildren = false
|
|
142
|
-
|
|
142
|
+
allowSizingOnChildren = false,
|
|
143
|
+
columnCount
|
|
144
|
+
} = parentLayout;
|
|
143
145
|
const rootClientId = (0, _data.useSelect)(select => {
|
|
144
146
|
return select(_store.store).getBlockRootClientId(clientId);
|
|
145
147
|
}, [clientId]);
|
|
@@ -149,30 +151,36 @@ function ChildLayoutControlsPure({
|
|
|
149
151
|
if (parentLayoutType !== 'grid') {
|
|
150
152
|
return null;
|
|
151
153
|
}
|
|
154
|
+
const isManualGrid = !!columnCount;
|
|
155
|
+
function updateLayout(layout) {
|
|
156
|
+
setAttributes({
|
|
157
|
+
style: {
|
|
158
|
+
...style,
|
|
159
|
+
layout: {
|
|
160
|
+
...style?.layout,
|
|
161
|
+
...layout
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
}
|
|
152
166
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
153
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
167
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_grid.GridVisualizer, {
|
|
154
168
|
clientId: rootClientId,
|
|
155
|
-
contentRef: setResizerBounds
|
|
156
|
-
|
|
169
|
+
contentRef: setResizerBounds,
|
|
170
|
+
parentLayout: parentLayout
|
|
171
|
+
}), allowSizingOnChildren && /*#__PURE__*/(0, _jsxRuntime.jsx)(_grid.GridItemResizer, {
|
|
157
172
|
clientId: clientId
|
|
158
173
|
// Don't allow resizing beyond the grid visualizer.
|
|
159
174
|
,
|
|
160
175
|
bounds: resizerBounds,
|
|
161
|
-
onChange:
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
...style?.layout,
|
|
170
|
-
columnSpan,
|
|
171
|
-
rowSpan
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
+
onChange: updateLayout,
|
|
177
|
+
parentLayout: parentLayout
|
|
178
|
+
}), isManualGrid && window.__experimentalEnableGridInteractivity && /*#__PURE__*/(0, _jsxRuntime.jsx)(_grid.GridItemMovers, {
|
|
179
|
+
layout: style?.layout,
|
|
180
|
+
parentLayout: parentLayout,
|
|
181
|
+
onChange: updateLayout,
|
|
182
|
+
gridClientId: rootClientId,
|
|
183
|
+
blockClientId: clientId
|
|
176
184
|
})]
|
|
177
185
|
});
|
|
178
186
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_compose","require","_data","_element","_store","_utils","_layout","_gridVisualizer","_jsxRuntime","useBlockPropsChildLayoutStyles","style","_style$layout","shouldRenderChildLayoutStyles","useSelect","select","blockEditorStore","getSettings","disableLayoutStyles","layout","selfStretch","flexSize","columnStart","rowStart","columnSpan","rowSpan","parentLayout","useLayout","columnCount","minimumColumnWidth","id","useInstanceId","selector","css","columnSpanNumber","parseInt","columnStartNumber","highestNumber","Math","max","parentColumnValue","parseFloat","isNaN","parentColumnUnit","replace","includes","defaultGapValue","containerQueryValue","gridColumnValue","useStyleOverride","className","ChildLayoutControlsPure","clientId","setAttributes","type","parentLayoutType","allowSizingOnChildren","rootClientId","getBlockRootClientId","resizerBounds","setResizerBounds","useState","jsxs","Fragment","children","jsx","GridVisualizer","contentRef","GridItemResizer","bounds","onChange","_default","exports","default","useBlockProps","edit","attributeKeys","hasSupport"],"sources":["@wordpress/block-editor/src/hooks/layout-child.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../store';\nimport { useStyleOverride } from './utils';\nimport { useLayout } from '../components/block-list/layout';\nimport { GridVisualizer, GridItemResizer } from '../components/grid-visualizer';\n\nfunction useBlockPropsChildLayoutStyles( { style } ) {\n\tconst shouldRenderChildLayoutStyles = useSelect( ( select ) => {\n\t\treturn ! select( blockEditorStore ).getSettings().disableLayoutStyles;\n\t} );\n\tconst layout = style?.layout ?? {};\n\tconst {\n\t\tselfStretch,\n\t\tflexSize,\n\t\tcolumnStart,\n\t\trowStart,\n\t\tcolumnSpan,\n\t\trowSpan,\n\t} = layout;\n\tconst parentLayout = useLayout() || {};\n\tconst { columnCount, minimumColumnWidth } = parentLayout;\n\tconst id = useInstanceId( useBlockPropsChildLayoutStyles );\n\tconst selector = `.wp-container-content-${ id }`;\n\n\tlet css = '';\n\tif ( shouldRenderChildLayoutStyles ) {\n\t\tif ( selfStretch === 'fixed' && flexSize ) {\n\t\t\tcss = `${ selector } {\n\t\t\t\tflex-basis: ${ flexSize };\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}`;\n\t\t} else if ( selfStretch === 'fill' ) {\n\t\t\tcss = `${ selector } {\n\t\t\t\tflex-grow: 1;\n\t\t\t}`;\n\t\t} else if ( columnStart && columnSpan ) {\n\t\t\tcss = `${ selector } {\n\t\t\t\tgrid-column: ${ columnStart } / span ${ columnSpan };\n\t\t\t}`;\n\t\t} else if ( columnStart ) {\n\t\t\tcss = `${ selector } {\n\t\t\t\tgrid-column: ${ columnStart };\n\t\t\t}`;\n\t\t} else if ( columnSpan ) {\n\t\t\tcss = `${ selector } {\n\t\t\t\tgrid-column: span ${ columnSpan };\n\t\t\t}`;\n\t\t}\n\t\t/**\n\t\t * If minimumColumnWidth is set on the parent, or if no\n\t\t * columnCount is set, the grid is responsive so a\n\t\t * container query is needed for the span to resize.\n\t\t */\n\t\tif (\n\t\t\t( columnSpan || columnStart ) &&\n\t\t\t( minimumColumnWidth || ! columnCount )\n\t\t) {\n\t\t\t// Check if columnSpan and columnStart are numbers so Math.max doesn't break.\n\t\t\tconst columnSpanNumber = columnSpan ? parseInt( columnSpan ) : null;\n\t\t\tconst columnStartNumber = columnStart\n\t\t\t\t? parseInt( columnStart )\n\t\t\t\t: null;\n\t\t\tconst highestNumber = Math.max(\n\t\t\t\tcolumnSpanNumber,\n\t\t\t\tcolumnStartNumber\n\t\t\t);\n\n\t\t\tlet parentColumnValue = parseFloat( minimumColumnWidth );\n\t\t\t/**\n\t\t\t * 12rem is the default minimumColumnWidth value.\n\t\t\t * If parentColumnValue is not a number, default to 12.\n\t\t\t */\n\t\t\tif ( isNaN( parentColumnValue ) ) {\n\t\t\t\tparentColumnValue = 12;\n\t\t\t}\n\n\t\t\tlet parentColumnUnit = minimumColumnWidth?.replace(\n\t\t\t\tparentColumnValue,\n\t\t\t\t''\n\t\t\t);\n\t\t\t/**\n\t\t\t * Check that parent column unit is either 'px', 'rem' or 'em'.\n\t\t\t * If not, default to 'rem'.\n\t\t\t */\n\t\t\tif ( ! [ 'px', 'rem', 'em' ].includes( parentColumnUnit ) ) {\n\t\t\t\tparentColumnUnit = 'rem';\n\t\t\t}\n\n\t\t\tconst defaultGapValue = parentColumnUnit === 'px' ? 24 : 1.5;\n\t\t\tconst containerQueryValue =\n\t\t\t\thighestNumber * parentColumnValue +\n\t\t\t\t( highestNumber - 1 ) * defaultGapValue;\n\t\t\t// If a span is set we want to preserve it as long as possible, otherwise we just reset the value.\n\t\t\tconst gridColumnValue = columnSpan ? '1/-1' : 'auto';\n\n\t\t\tcss += `@container (max-width: ${ containerQueryValue }${ parentColumnUnit }) {\n\t\t\t\t${ selector } {\n\t\t\t\t\tgrid-column: ${ gridColumnValue };\n\t\t\t\t}\n\t\t\t}`;\n\t\t}\n\t\tif ( rowStart && rowSpan ) {\n\t\t\tcss += `${ selector } {\n\t\t\t\tgrid-row: ${ rowStart } / span ${ rowSpan };\n\t\t\t}`;\n\t\t} else if ( rowStart ) {\n\t\t\tcss += `${ selector } {\n\t\t\t\tgrid-row: ${ rowStart };\n\t\t\t}`;\n\t\t} else if ( rowSpan ) {\n\t\t\tcss += `${ selector } {\n\t\t\t\tgrid-row: span ${ rowSpan };\n\t\t\t}`;\n\t\t}\n\t}\n\n\tuseStyleOverride( { css } );\n\n\t// Only attach a container class if there is generated CSS to be attached.\n\tif ( ! css ) {\n\t\treturn;\n\t}\n\n\t// Attach a `wp-container-content` id-based classname.\n\treturn { className: `wp-container-content-${ id }` };\n}\n\nfunction ChildLayoutControlsPure( { clientId, style, setAttributes } ) {\n\tconst {\n\t\ttype: parentLayoutType = 'default',\n\t\tallowSizingOnChildren = false,\n\t} = useLayout() || {};\n\n\tconst rootClientId = useSelect(\n\t\t( select ) => {\n\t\t\treturn select( blockEditorStore ).getBlockRootClientId( clientId );\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\t// Use useState() instead of useRef() so that GridItemResizer updates when ref is set.\n\tconst [ resizerBounds, setResizerBounds ] = useState();\n\n\tif ( parentLayoutType !== 'grid' ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<GridVisualizer\n\t\t\t\tclientId={ rootClientId }\n\t\t\t\tcontentRef={ setResizerBounds }\n\t\t\t/>\n\t\t\t{ allowSizingOnChildren && (\n\t\t\t\t<GridItemResizer\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t// Don't allow resizing beyond the grid visualizer.\n\t\t\t\t\tbounds={ resizerBounds }\n\t\t\t\t\tonChange={ ( { columnSpan, rowSpan } ) => {\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t\t...style,\n\t\t\t\t\t\t\t\tlayout: {\n\t\t\t\t\t\t\t\t\t...style?.layout,\n\t\t\t\t\t\t\t\t\tcolumnSpan,\n\t\t\t\t\t\t\t\t\trowSpan,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default {\n\tuseBlockProps: useBlockPropsChildLayoutStyles,\n\tedit: ChildLayoutControlsPure,\n\tattributeKeys: [ 'style' ],\n\thasSupport() {\n\t\treturn true;\n\t},\n};\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BAAQ,EAAC,CAAC;EAEtD,IAAKN,gBAAgB,KAAK,MAAM,EAAG;IAClC,OAAO,IAAI;EACZ;EAEA,oBACC,IAAA9C,WAAA,CAAAqD,IAAA,EAAArD,WAAA,CAAAsD,QAAA;IAAAC,QAAA,gBACC,IAAAvD,WAAA,CAAAwD,GAAA,EAACzD,eAAA,CAAA0D,cAAc;MACdd,QAAQ,EAAGK,YAAc;MACzBU,UAAU,EAAGP;IAAkB,CAC/B,CAAC,EACAJ,qBAAqB,iBACtB,IAAA/C,WAAA,CAAAwD,GAAA,EAACzD,eAAA,CAAA4D,eAAe;MACfhB,QAAQ,EAAGA;MACX;MAAA;MACAiB,MAAM,EAAGV,aAAe;MACxBW,QAAQ,EAAGA,CAAE;QAAE9C,UAAU;QAAEC;MAAQ,CAAC,KAAM;QACzC4B,aAAa,CAAE;UACd1C,KAAK,EAAE;YACN,GAAGA,KAAK;YACRQ,MAAM,EAAE;cACP,GAAGR,KAAK,EAAEQ,MAAM;cAChBK,UAAU;cACVC;YACD;UACD;QACD,CAAE,CAAC;MACJ;IAAG,CACH,CACD;EAAA,CACA,CAAC;AAEL;AAAC,IAAA8C,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc;EACdC,aAAa,EAAEhE,8BAA8B;EAC7CiE,IAAI,EAAExB,uBAAuB;EAC7ByB,aAAa,EAAE,CAAE,OAAO,CAAE;EAC1BC,UAAUA,CAAA,EAAG;IACZ,OAAO,IAAI;EACZ;AACD,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_compose","require","_data","_element","_store","_utils","_layout","_grid","_jsxRuntime","useBlockPropsChildLayoutStyles","style","_style$layout","shouldRenderChildLayoutStyles","useSelect","select","blockEditorStore","getSettings","disableLayoutStyles","layout","selfStretch","flexSize","columnStart","rowStart","columnSpan","rowSpan","parentLayout","useLayout","columnCount","minimumColumnWidth","id","useInstanceId","selector","css","columnSpanNumber","parseInt","columnStartNumber","highestNumber","Math","max","parentColumnValue","parseFloat","isNaN","parentColumnUnit","replace","includes","defaultGapValue","containerQueryValue","gridColumnValue","useStyleOverride","className","ChildLayoutControlsPure","clientId","setAttributes","type","parentLayoutType","allowSizingOnChildren","rootClientId","getBlockRootClientId","resizerBounds","setResizerBounds","useState","isManualGrid","updateLayout","jsxs","Fragment","children","jsx","GridVisualizer","contentRef","GridItemResizer","bounds","onChange","window","__experimentalEnableGridInteractivity","GridItemMovers","gridClientId","blockClientId","_default","exports","default","useBlockProps","edit","attributeKeys","hasSupport"],"sources":["@wordpress/block-editor/src/hooks/layout-child.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../store';\nimport { useStyleOverride } from './utils';\nimport { useLayout } from '../components/block-list/layout';\nimport {\n\tGridVisualizer,\n\tGridItemResizer,\n\tGridItemMovers,\n} from '../components/grid';\n\nfunction useBlockPropsChildLayoutStyles( { style } ) {\n\tconst shouldRenderChildLayoutStyles = useSelect( ( select ) => {\n\t\treturn ! select( blockEditorStore ).getSettings().disableLayoutStyles;\n\t} );\n\tconst layout = style?.layout ?? {};\n\tconst {\n\t\tselfStretch,\n\t\tflexSize,\n\t\tcolumnStart,\n\t\trowStart,\n\t\tcolumnSpan,\n\t\trowSpan,\n\t} = layout;\n\tconst parentLayout = useLayout() || {};\n\tconst { columnCount, minimumColumnWidth } = parentLayout;\n\tconst id = useInstanceId( useBlockPropsChildLayoutStyles );\n\tconst selector = `.wp-container-content-${ id }`;\n\n\tlet css = '';\n\tif ( shouldRenderChildLayoutStyles ) {\n\t\tif ( selfStretch === 'fixed' && flexSize ) {\n\t\t\tcss = `${ selector } {\n\t\t\t\tflex-basis: ${ flexSize };\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}`;\n\t\t} else if ( selfStretch === 'fill' ) {\n\t\t\tcss = `${ selector } {\n\t\t\t\tflex-grow: 1;\n\t\t\t}`;\n\t\t} else if ( columnStart && columnSpan ) {\n\t\t\tcss = `${ selector } {\n\t\t\t\tgrid-column: ${ columnStart } / span ${ columnSpan };\n\t\t\t}`;\n\t\t} else if ( columnStart ) {\n\t\t\tcss = `${ selector } {\n\t\t\t\tgrid-column: ${ columnStart };\n\t\t\t}`;\n\t\t} else if ( columnSpan ) {\n\t\t\tcss = `${ selector } {\n\t\t\t\tgrid-column: span ${ columnSpan };\n\t\t\t}`;\n\t\t}\n\t\t/**\n\t\t * If minimumColumnWidth is set on the parent, or if no\n\t\t * columnCount is set, the grid is responsive so a\n\t\t * container query is needed for the span to resize.\n\t\t */\n\t\tif (\n\t\t\t( columnSpan || columnStart ) &&\n\t\t\t( minimumColumnWidth || ! columnCount )\n\t\t) {\n\t\t\t// Check if columnSpan and columnStart are numbers so Math.max doesn't break.\n\t\t\tconst columnSpanNumber = columnSpan ? parseInt( columnSpan ) : null;\n\t\t\tconst columnStartNumber = columnStart\n\t\t\t\t? parseInt( columnStart )\n\t\t\t\t: null;\n\t\t\tconst highestNumber = Math.max(\n\t\t\t\tcolumnSpanNumber,\n\t\t\t\tcolumnStartNumber\n\t\t\t);\n\n\t\t\tlet parentColumnValue = parseFloat( minimumColumnWidth );\n\t\t\t/**\n\t\t\t * 12rem is the default minimumColumnWidth value.\n\t\t\t * If parentColumnValue is not a number, default to 12.\n\t\t\t */\n\t\t\tif ( isNaN( parentColumnValue ) ) {\n\t\t\t\tparentColumnValue = 12;\n\t\t\t}\n\n\t\t\tlet parentColumnUnit = minimumColumnWidth?.replace(\n\t\t\t\tparentColumnValue,\n\t\t\t\t''\n\t\t\t);\n\t\t\t/**\n\t\t\t * Check that parent column unit is either 'px', 'rem' or 'em'.\n\t\t\t * If not, default to 'rem'.\n\t\t\t */\n\t\t\tif ( ! [ 'px', 'rem', 'em' ].includes( parentColumnUnit ) ) {\n\t\t\t\tparentColumnUnit = 'rem';\n\t\t\t}\n\n\t\t\tconst defaultGapValue = parentColumnUnit === 'px' ? 24 : 1.5;\n\t\t\tconst containerQueryValue =\n\t\t\t\thighestNumber * parentColumnValue +\n\t\t\t\t( highestNumber - 1 ) * defaultGapValue;\n\t\t\t// If a span is set we want to preserve it as long as possible, otherwise we just reset the value.\n\t\t\tconst gridColumnValue = columnSpan ? '1/-1' : 'auto';\n\n\t\t\tcss += `@container (max-width: ${ containerQueryValue }${ parentColumnUnit }) {\n\t\t\t\t${ selector } {\n\t\t\t\t\tgrid-column: ${ gridColumnValue };\n\t\t\t\t}\n\t\t\t}`;\n\t\t}\n\t\tif ( rowStart && rowSpan ) {\n\t\t\tcss += `${ selector } {\n\t\t\t\tgrid-row: ${ rowStart } / span ${ rowSpan };\n\t\t\t}`;\n\t\t} else if ( rowStart ) {\n\t\t\tcss += `${ selector } {\n\t\t\t\tgrid-row: ${ rowStart };\n\t\t\t}`;\n\t\t} else if ( rowSpan ) {\n\t\t\tcss += `${ selector } {\n\t\t\t\tgrid-row: span ${ rowSpan };\n\t\t\t}`;\n\t\t}\n\t}\n\n\tuseStyleOverride( { css } );\n\n\t// Only attach a container class if there is generated CSS to be attached.\n\tif ( ! css ) {\n\t\treturn;\n\t}\n\n\t// Attach a `wp-container-content` id-based classname.\n\treturn { className: `wp-container-content-${ id }` };\n}\n\nfunction ChildLayoutControlsPure( { clientId, style, setAttributes } ) {\n\tconst parentLayout = useLayout() || {};\n\tconst {\n\t\ttype: parentLayoutType = 'default',\n\t\tallowSizingOnChildren = false,\n\t\tcolumnCount,\n\t} = parentLayout;\n\n\tconst rootClientId = useSelect(\n\t\t( select ) => {\n\t\t\treturn select( blockEditorStore ).getBlockRootClientId( clientId );\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\t// Use useState() instead of useRef() so that GridItemResizer updates when ref is set.\n\tconst [ resizerBounds, setResizerBounds ] = useState();\n\n\tif ( parentLayoutType !== 'grid' ) {\n\t\treturn null;\n\t}\n\n\tconst isManualGrid = !! columnCount;\n\n\tfunction updateLayout( layout ) {\n\t\tsetAttributes( {\n\t\t\tstyle: {\n\t\t\t\t...style,\n\t\t\t\tlayout: {\n\t\t\t\t\t...style?.layout,\n\t\t\t\t\t...layout,\n\t\t\t\t},\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<GridVisualizer\n\t\t\t\tclientId={ rootClientId }\n\t\t\t\tcontentRef={ setResizerBounds }\n\t\t\t\tparentLayout={ parentLayout }\n\t\t\t/>\n\t\t\t{ allowSizingOnChildren && (\n\t\t\t\t<GridItemResizer\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t// Don't allow resizing beyond the grid visualizer.\n\t\t\t\t\tbounds={ resizerBounds }\n\t\t\t\t\tonChange={ updateLayout }\n\t\t\t\t\tparentLayout={ parentLayout }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ isManualGrid && window.__experimentalEnableGridInteractivity && (\n\t\t\t\t<GridItemMovers\n\t\t\t\t\tlayout={ style?.layout }\n\t\t\t\t\tparentLayout={ parentLayout }\n\t\t\t\t\tonChange={ updateLayout }\n\t\t\t\t\tgridClientId={ rootClientId }\n\t\t\t\t\tblockClientId={ clientId }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default {\n\tuseBlockProps: useBlockPropsChildLayoutStyles,\n\tedit: ChildLayoutControlsPure,\n\tattributeKeys: [ 'style' ],\n\thasSupport() {\n\t\treturn true;\n\t},\n};\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAKA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AAI4B,IAAAO,WAAA,GAAAP,OAAA;AAjB5B;AACA;AACA;;AAKA;AACA;AACA;;AAUA,SAASQ,8BAA8BA,CAAE;EAAEC;AAAM,C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ACD;IACD,CAAE,CAAC;EACJ;EAEA,oBACC,IAAAV,WAAA,CAAAuD,IAAA,EAAAvD,WAAA,CAAAwD,QAAA;IAAAC,QAAA,gBACC,IAAAzD,WAAA,CAAA0D,GAAA,EAAC3D,KAAA,CAAA4D,cAAc;MACdhB,QAAQ,EAAGK,YAAc;MACzBY,UAAU,EAAGT,gBAAkB;MAC/BlC,YAAY,EAAGA;IAAc,CAC7B,CAAC,EACA8B,qBAAqB,iBACtB,IAAA/C,WAAA,CAAA0D,GAAA,EAAC3D,KAAA,CAAA8D,eAAe;MACflB,QAAQ,EAAGA;MACX;MAAA;MACAmB,MAAM,EAAGZ,aAAe;MACxBa,QAAQ,EAAGT,YAAc;MACzBrC,YAAY,EAAGA;IAAc,CAC7B,CACD,EACCoC,YAAY,IAAIW,MAAM,CAACC,qCAAqC,iBAC7D,IAAAjE,WAAA,CAAA0D,GAAA,EAAC3D,KAAA,CAAAmE,cAAc;MACdxD,MAAM,EAAGR,KAAK,EAAEQ,MAAQ;MACxBO,YAAY,EAAGA,YAAc;MAC7B8C,QAAQ,EAAGT,YAAc;MACzBa,YAAY,EAAGnB,YAAc;MAC7BoB,aAAa,EAAGzB;IAAU,CAC1B,CACD;EAAA,CACA,CAAC;AAEL;AAAC,IAAA0B,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc;EACdC,aAAa,EAAEvE,8BAA8B;EAC7CwE,IAAI,EAAE/B,uBAAuB;EAC7BgC,aAAa,EAAE,CAAE,OAAO,CAAE;EAC1BC,UAAUA,CAAA,EAAG;IACZ,OAAO,IAAI;EACZ;AACD,CAAC","ignoreList":[]}
|
package/build/hooks/utils.js
CHANGED
|
@@ -349,7 +349,8 @@ function createBlockListBlockFilter(features) {
|
|
|
349
349
|
const {
|
|
350
350
|
hasSupport,
|
|
351
351
|
attributeKeys = [],
|
|
352
|
-
useBlockProps
|
|
352
|
+
useBlockProps,
|
|
353
|
+
isMatch
|
|
353
354
|
} = feature;
|
|
354
355
|
const neededProps = {};
|
|
355
356
|
for (const key of attributeKeys) {
|
|
@@ -360,7 +361,7 @@ function createBlockListBlockFilter(features) {
|
|
|
360
361
|
if (
|
|
361
362
|
// Skip rendering if none of the needed attributes are
|
|
362
363
|
// set.
|
|
363
|
-
!Object.keys(neededProps).length || !hasSupport(props.name)) {
|
|
364
|
+
!Object.keys(neededProps).length || !hasSupport(props.name) || isMatch && !isMatch(neededProps)) {
|
|
364
365
|
return null;
|
|
365
366
|
}
|
|
366
367
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(BlockPropsPure
|
package/build/hooks/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blocks","require","_element","_data","_compose","_hooks","_context","_components","_hooks2","_object","_store","_lockUnlock","_clsx","_interopRequireDefault","_jsxRuntime","cleanEmptyObject","object","Array","isArray","cleanedNestedObjects","Object","entries","map","key","value","filter","undefined","length","fromEntries","exports","transformStyles","activeSupports","migrationPaths","result","source","index","results","values","every","isActive","innerBlocks","referenceBlockAttributes","attributes","returnBlock","forEach","support","path","styleValue","getValueFromObjectPath","setImmutably","shouldSkipSerialization","blockNameOrType","featureSet","feature","getBlockSupport","skipSerialization","__experimentalSkipSerialization","includes","pendingStyleOverrides","WeakMap","useStyleOverride","id","css","assets","__unstableType","clientId","setStyleOverride","deleteStyleOverride","unlock","useDispatch","blockEditorStore","registry","useRegistry","fallbackId","useId","useEffect","_id","override","get","set","push","window","queueMicrotask","batch","args","isPending","find","currentId","useBlockSettings","name","parentLayout","backgroundImage","backgroundSize","customFontFamilies","defaultFontFamilies","themeFontFamilies","defaultFontSizesEnabled","customFontSizes","defaultFontSizes","themeFontSizes","customFontSize","fontStyle","fontWeight","lineHeight","textAlign","textColumns","textDecoration","writingMode","textTransform","letterSpacing","padding","margin","blockGap","defaultSpacingSizesEnabled","customSpacingSize","userSpacingSizes","defaultSpacingSizes","themeSpacingSizes","units","aspectRatio","minHeight","layout","borderColor","borderRadius","borderStyle","borderWidth","customColorsEnabled","customColors","customDuotone","themeColors","defaultColors","defaultPalette","defaultDuotone","userDuotonePalette","themeDuotonePalette","defaultDuotonePalette","userGradientPalette","themeGradientPalette","defaultGradientPalette","defaultGradients","areCustomGradientsEnabled","isBackgroundEnabled","isLinkEnabled","isTextEnabled","isHeadingEnabled","isButtonEnabled","shadow","useSettings","rawSettings","useMemo","background","color","palette","custom","theme","default","gradients","duotone","customGradient","link","heading","button","text","typography","fontFamilies","fontSizes","spacing","spacingSizes","border","radius","style","width","dimensions","useSettingsForBlockElement","createBlockEditFilter","features","settings","Edit","memo","edit","withBlockEditHooks","createHigherOrderComponent","OriginalBlockEdit","props","context","useBlockEditContext","i","hasSupport","attributeKeys","shareWithChildBlocks","shouldDisplayControls","mayDisplayControlsKey","mayDisplayParentControlsKey","neededProps","jsx","isSelected","setAttributes","__unstableParentLayout","addFilter","BlockProps","useBlockProps","setAllWrapperProps","wrapperProps","setWrapperProps","next","prev","nextAll","BlockPropsPure","createBlockListBlockFilter","withBlockListBlockHooks","BlockListBlock","allWrapperProps","useState","fill","keys","Boolean","reduce","acc","className","clsx","createBlockSaveFilter","extraPropsFromHooks","accu","addSaveProps","neededAttributes","hasOwnProperty"],"sources":["@wordpress/block-editor/src/hooks/utils.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockSupport } from '@wordpress/blocks';\nimport { memo, useMemo, useEffect, useId, useState } from '@wordpress/element';\nimport { useDispatch, useRegistry } from '@wordpress/data';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport {\n\tuseBlockEditContext,\n\tmayDisplayControlsKey,\n\tmayDisplayParentControlsKey,\n} from '../components/block-edit/context';\nimport { useSettings } from '../components';\nimport { useSettingsForBlockElement } from '../components/global-styles/hooks';\nimport { getValueFromObjectPath, setImmutably } from '../utils/object';\nimport { store as blockEditorStore } from '../store';\nimport { unlock } from '../lock-unlock';\n/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * Removed falsy values from nested object.\n *\n * @param {*} object\n * @return {*} Object cleaned from falsy values\n */\nexport const cleanEmptyObject = ( object ) => {\n\tif (\n\t\tobject === null ||\n\t\ttypeof object !== 'object' ||\n\t\tArray.isArray( object )\n\t) {\n\t\treturn object;\n\t}\n\n\tconst cleanedNestedObjects = Object.entries( object )\n\t\t.map( ( [ key, value ] ) => [ key, cleanEmptyObject( value ) ] )\n\t\t.filter( ( [ , value ] ) => value !== undefined );\n\treturn ! cleanedNestedObjects.length\n\t\t? undefined\n\t\t: Object.fromEntries( cleanedNestedObjects );\n};\n\nexport function transformStyles(\n\tactiveSupports,\n\tmigrationPaths,\n\tresult,\n\tsource,\n\tindex,\n\tresults\n) {\n\t// If there are no active supports return early.\n\tif (\n\t\tObject.values( activeSupports ?? {} ).every(\n\t\t\t( isActive ) => ! isActive\n\t\t)\n\t) {\n\t\treturn result;\n\t}\n\t// If the condition verifies we are probably in the presence of a wrapping transform\n\t// e.g: nesting paragraphs in a group or columns and in that case the styles should not be transformed.\n\tif ( results.length === 1 && result.innerBlocks.length === source.length ) {\n\t\treturn result;\n\t}\n\t// For cases where we have a transform from one block to multiple blocks\n\t// or multiple blocks to one block we apply the styles of the first source block\n\t// to the result(s).\n\tlet referenceBlockAttributes = source[ 0 ]?.attributes;\n\t// If we are in presence of transform between more than one block in the source\n\t// that has more than one block in the result\n\t// we apply the styles on source N to the result N,\n\t// if source N does not exists we do nothing.\n\tif ( results.length > 1 && source.length > 1 ) {\n\t\tif ( source[ index ] ) {\n\t\t\treferenceBlockAttributes = source[ index ]?.attributes;\n\t\t} else {\n\t\t\treturn result;\n\t\t}\n\t}\n\tlet returnBlock = result;\n\tObject.entries( activeSupports ).forEach( ( [ support, isActive ] ) => {\n\t\tif ( isActive ) {\n\t\t\tmigrationPaths[ support ].forEach( ( path ) => {\n\t\t\t\tconst styleValue = getValueFromObjectPath(\n\t\t\t\t\treferenceBlockAttributes,\n\t\t\t\t\tpath\n\t\t\t\t);\n\t\t\t\tif ( styleValue ) {\n\t\t\t\t\treturnBlock = {\n\t\t\t\t\t\t...returnBlock,\n\t\t\t\t\t\tattributes: setImmutably(\n\t\t\t\t\t\t\treturnBlock.attributes,\n\t\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\tstyleValue\n\t\t\t\t\t\t),\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t} );\n\treturn returnBlock;\n}\n\n/**\n * Check whether serialization of specific block support feature or set should\n * be skipped.\n *\n * @param {string|Object} blockNameOrType Block name or block type object.\n * @param {string} featureSet Name of block support feature set.\n * @param {string} feature Name of the individual feature to check.\n *\n * @return {boolean} Whether serialization should occur.\n */\nexport function shouldSkipSerialization(\n\tblockNameOrType,\n\tfeatureSet,\n\tfeature\n) {\n\tconst support = getBlockSupport( blockNameOrType, featureSet );\n\tconst skipSerialization = support?.__experimentalSkipSerialization;\n\n\tif ( Array.isArray( skipSerialization ) ) {\n\t\treturn skipSerialization.includes( feature );\n\t}\n\n\treturn skipSerialization;\n}\n\nconst pendingStyleOverrides = new WeakMap();\n\nexport function useStyleOverride( {\n\tid,\n\tcss,\n\tassets,\n\t__unstableType,\n\tclientId,\n} = {} ) {\n\tconst { setStyleOverride, deleteStyleOverride } = unlock(\n\t\tuseDispatch( blockEditorStore )\n\t);\n\tconst registry = useRegistry();\n\tconst fallbackId = useId();\n\tuseEffect( () => {\n\t\t// Unmount if there is CSS and assets are empty.\n\t\tif ( ! css && ! assets ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst _id = id || fallbackId;\n\t\tconst override = {\n\t\t\tid,\n\t\t\tcss,\n\t\t\tassets,\n\t\t\t__unstableType,\n\t\t\tclientId,\n\t\t};\n\t\t// Batch updates to style overrides to avoid triggering cascading renders\n\t\t// for each style override block included in a tree and optimize initial render.\n\t\tif ( ! pendingStyleOverrides.get( registry ) ) {\n\t\t\tpendingStyleOverrides.set( registry, [] );\n\t\t}\n\t\tpendingStyleOverrides.get( registry ).push( [ _id, override ] );\n\t\twindow.queueMicrotask( () => {\n\t\t\tif ( pendingStyleOverrides.get( registry )?.length ) {\n\t\t\t\tregistry.batch( () => {\n\t\t\t\t\tpendingStyleOverrides.get( registry ).forEach( ( args ) => {\n\t\t\t\t\t\tsetStyleOverride( ...args );\n\t\t\t\t\t} );\n\t\t\t\t\tpendingStyleOverrides.set( registry, [] );\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t\treturn () => {\n\t\t\tconst isPending = pendingStyleOverrides\n\t\t\t\t.get( registry )\n\t\t\t\t?.find( ( [ currentId ] ) => currentId === _id );\n\t\t\tif ( isPending ) {\n\t\t\t\tpendingStyleOverrides.set(\n\t\t\t\t\tregistry,\n\t\t\t\t\tpendingStyleOverrides\n\t\t\t\t\t\t.get( registry )\n\t\t\t\t\t\t.filter( ( [ currentId ] ) => currentId !== _id )\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tdeleteStyleOverride( _id );\n\t\t\t}\n\t\t};\n\t}, [\n\t\tid,\n\t\tcss,\n\t\tclientId,\n\t\tassets,\n\t\t__unstableType,\n\t\tfallbackId,\n\t\tsetStyleOverride,\n\t\tdeleteStyleOverride,\n\t\tregistry,\n\t] );\n}\n\n/**\n * Based on the block and its context, returns an object of all the block settings.\n * This object can be passed as a prop to all the Styles UI components\n * (TypographyPanel, DimensionsPanel...).\n *\n * @param {string} name Block name.\n * @param {*} parentLayout Parent layout.\n *\n * @return {Object} Settings object.\n */\nexport function useBlockSettings( name, parentLayout ) {\n\tconst [\n\t\tbackgroundImage,\n\t\tbackgroundSize,\n\t\tcustomFontFamilies,\n\t\tdefaultFontFamilies,\n\t\tthemeFontFamilies,\n\t\tdefaultFontSizesEnabled,\n\t\tcustomFontSizes,\n\t\tdefaultFontSizes,\n\t\tthemeFontSizes,\n\t\tcustomFontSize,\n\t\tfontStyle,\n\t\tfontWeight,\n\t\tlineHeight,\n\t\ttextAlign,\n\t\ttextColumns,\n\t\ttextDecoration,\n\t\twritingMode,\n\t\ttextTransform,\n\t\tletterSpacing,\n\t\tpadding,\n\t\tmargin,\n\t\tblockGap,\n\t\tdefaultSpacingSizesEnabled,\n\t\tcustomSpacingSize,\n\t\tuserSpacingSizes,\n\t\tdefaultSpacingSizes,\n\t\tthemeSpacingSizes,\n\t\tunits,\n\t\taspectRatio,\n\t\tminHeight,\n\t\tlayout,\n\t\tborderColor,\n\t\tborderRadius,\n\t\tborderStyle,\n\t\tborderWidth,\n\t\tcustomColorsEnabled,\n\t\tcustomColors,\n\t\tcustomDuotone,\n\t\tthemeColors,\n\t\tdefaultColors,\n\t\tdefaultPalette,\n\t\tdefaultDuotone,\n\t\tuserDuotonePalette,\n\t\tthemeDuotonePalette,\n\t\tdefaultDuotonePalette,\n\t\tuserGradientPalette,\n\t\tthemeGradientPalette,\n\t\tdefaultGradientPalette,\n\t\tdefaultGradients,\n\t\tareCustomGradientsEnabled,\n\t\tisBackgroundEnabled,\n\t\tisLinkEnabled,\n\t\tisTextEnabled,\n\t\tisHeadingEnabled,\n\t\tisButtonEnabled,\n\t\tshadow,\n\t] = useSettings(\n\t\t'background.backgroundImage',\n\t\t'background.backgroundSize',\n\t\t'typography.fontFamilies.custom',\n\t\t'typography.fontFamilies.default',\n\t\t'typography.fontFamilies.theme',\n\t\t'typography.defaultFontSizes',\n\t\t'typography.fontSizes.custom',\n\t\t'typography.fontSizes.default',\n\t\t'typography.fontSizes.theme',\n\t\t'typography.customFontSize',\n\t\t'typography.fontStyle',\n\t\t'typography.fontWeight',\n\t\t'typography.lineHeight',\n\t\t'typography.textAlign',\n\t\t'typography.textColumns',\n\t\t'typography.textDecoration',\n\t\t'typography.writingMode',\n\t\t'typography.textTransform',\n\t\t'typography.letterSpacing',\n\t\t'spacing.padding',\n\t\t'spacing.margin',\n\t\t'spacing.blockGap',\n\t\t'spacing.defaultSpacingSizes',\n\t\t'spacing.customSpacingSize',\n\t\t'spacing.spacingSizes.custom',\n\t\t'spacing.spacingSizes.default',\n\t\t'spacing.spacingSizes.theme',\n\t\t'spacing.units',\n\t\t'dimensions.aspectRatio',\n\t\t'dimensions.minHeight',\n\t\t'layout',\n\t\t'border.color',\n\t\t'border.radius',\n\t\t'border.style',\n\t\t'border.width',\n\t\t'color.custom',\n\t\t'color.palette.custom',\n\t\t'color.customDuotone',\n\t\t'color.palette.theme',\n\t\t'color.palette.default',\n\t\t'color.defaultPalette',\n\t\t'color.defaultDuotone',\n\t\t'color.duotone.custom',\n\t\t'color.duotone.theme',\n\t\t'color.duotone.default',\n\t\t'color.gradients.custom',\n\t\t'color.gradients.theme',\n\t\t'color.gradients.default',\n\t\t'color.defaultGradients',\n\t\t'color.customGradient',\n\t\t'color.background',\n\t\t'color.link',\n\t\t'color.text',\n\t\t'color.heading',\n\t\t'color.button',\n\t\t'shadow'\n\t);\n\n\tconst rawSettings = useMemo( () => {\n\t\treturn {\n\t\t\tbackground: {\n\t\t\t\tbackgroundImage,\n\t\t\t\tbackgroundSize,\n\t\t\t},\n\t\t\tcolor: {\n\t\t\t\tpalette: {\n\t\t\t\t\tcustom: customColors,\n\t\t\t\t\ttheme: themeColors,\n\t\t\t\t\tdefault: defaultColors,\n\t\t\t\t},\n\t\t\t\tgradients: {\n\t\t\t\t\tcustom: userGradientPalette,\n\t\t\t\t\ttheme: themeGradientPalette,\n\t\t\t\t\tdefault: defaultGradientPalette,\n\t\t\t\t},\n\t\t\t\tduotone: {\n\t\t\t\t\tcustom: userDuotonePalette,\n\t\t\t\t\ttheme: themeDuotonePalette,\n\t\t\t\t\tdefault: defaultDuotonePalette,\n\t\t\t\t},\n\t\t\t\tdefaultGradients,\n\t\t\t\tdefaultPalette,\n\t\t\t\tdefaultDuotone,\n\t\t\t\tcustom: customColorsEnabled,\n\t\t\t\tcustomGradient: areCustomGradientsEnabled,\n\t\t\t\tcustomDuotone,\n\t\t\t\tbackground: isBackgroundEnabled,\n\t\t\t\tlink: isLinkEnabled,\n\t\t\t\theading: isHeadingEnabled,\n\t\t\t\tbutton: isButtonEnabled,\n\t\t\t\ttext: isTextEnabled,\n\t\t\t},\n\t\t\ttypography: {\n\t\t\t\tfontFamilies: {\n\t\t\t\t\tcustom: customFontFamilies,\n\t\t\t\t\tdefault: defaultFontFamilies,\n\t\t\t\t\ttheme: themeFontFamilies,\n\t\t\t\t},\n\t\t\t\tfontSizes: {\n\t\t\t\t\tcustom: customFontSizes,\n\t\t\t\t\tdefault: defaultFontSizes,\n\t\t\t\t\ttheme: themeFontSizes,\n\t\t\t\t},\n\t\t\t\tcustomFontSize,\n\t\t\t\tdefaultFontSizes: defaultFontSizesEnabled,\n\t\t\t\tfontStyle,\n\t\t\t\tfontWeight,\n\t\t\t\tlineHeight,\n\t\t\t\ttextAlign,\n\t\t\t\ttextColumns,\n\t\t\t\ttextDecoration,\n\t\t\t\ttextTransform,\n\t\t\t\tletterSpacing,\n\t\t\t\twritingMode,\n\t\t\t},\n\t\t\tspacing: {\n\t\t\t\tspacingSizes: {\n\t\t\t\t\tcustom: userSpacingSizes,\n\t\t\t\t\tdefault: defaultSpacingSizes,\n\t\t\t\t\ttheme: themeSpacingSizes,\n\t\t\t\t},\n\t\t\t\tcustomSpacingSize,\n\t\t\t\tdefaultSpacingSizes: defaultSpacingSizesEnabled,\n\t\t\t\tpadding,\n\t\t\t\tmargin,\n\t\t\t\tblockGap,\n\t\t\t\tunits,\n\t\t\t},\n\t\t\tborder: {\n\t\t\t\tcolor: borderColor,\n\t\t\t\tradius: borderRadius,\n\t\t\t\tstyle: borderStyle,\n\t\t\t\twidth: borderWidth,\n\t\t\t},\n\t\t\tdimensions: {\n\t\t\t\taspectRatio,\n\t\t\t\tminHeight,\n\t\t\t},\n\t\t\tlayout,\n\t\t\tparentLayout,\n\t\t\tshadow,\n\t\t};\n\t}, [\n\t\tbackgroundImage,\n\t\tbackgroundSize,\n\t\tcustomFontFamilies,\n\t\tdefaultFontFamilies,\n\t\tthemeFontFamilies,\n\t\tdefaultFontSizesEnabled,\n\t\tcustomFontSizes,\n\t\tdefaultFontSizes,\n\t\tthemeFontSizes,\n\t\tcustomFontSize,\n\t\tfontStyle,\n\t\tfontWeight,\n\t\tlineHeight,\n\t\ttextAlign,\n\t\ttextColumns,\n\t\ttextDecoration,\n\t\ttextTransform,\n\t\tletterSpacing,\n\t\twritingMode,\n\t\tpadding,\n\t\tmargin,\n\t\tblockGap,\n\t\tdefaultSpacingSizesEnabled,\n\t\tcustomSpacingSize,\n\t\tuserSpacingSizes,\n\t\tdefaultSpacingSizes,\n\t\tthemeSpacingSizes,\n\t\tunits,\n\t\taspectRatio,\n\t\tminHeight,\n\t\tlayout,\n\t\tparentLayout,\n\t\tborderColor,\n\t\tborderRadius,\n\t\tborderStyle,\n\t\tborderWidth,\n\t\tcustomColorsEnabled,\n\t\tcustomColors,\n\t\tcustomDuotone,\n\t\tthemeColors,\n\t\tdefaultColors,\n\t\tdefaultPalette,\n\t\tdefaultDuotone,\n\t\tuserDuotonePalette,\n\t\tthemeDuotonePalette,\n\t\tdefaultDuotonePalette,\n\t\tuserGradientPalette,\n\t\tthemeGradientPalette,\n\t\tdefaultGradientPalette,\n\t\tdefaultGradients,\n\t\tareCustomGradientsEnabled,\n\t\tisBackgroundEnabled,\n\t\tisLinkEnabled,\n\t\tisTextEnabled,\n\t\tisHeadingEnabled,\n\t\tisButtonEnabled,\n\t\tshadow,\n\t] );\n\n\treturn useSettingsForBlockElement( rawSettings, name );\n}\n\nexport function createBlockEditFilter( features ) {\n\t// We don't want block controls to re-render when typing inside a block.\n\t// `memo` will prevent re-renders unless props change, so only pass the\n\t// needed props and not the whole attributes object.\n\tfeatures = features.map( ( settings ) => {\n\t\treturn { ...settings, Edit: memo( settings.edit ) };\n\t} );\n\tconst withBlockEditHooks = createHigherOrderComponent(\n\t\t( OriginalBlockEdit ) => ( props ) => {\n\t\t\tconst context = useBlockEditContext();\n\t\t\t// CAUTION: code added before this line will be executed for all\n\t\t\t// blocks, not just those that support the feature! Code added\n\t\t\t// above this line should be carefully evaluated for its impact on\n\t\t\t// performance.\n\t\t\treturn [\n\t\t\t\t...features.map( ( feature, i ) => {\n\t\t\t\t\tconst {\n\t\t\t\t\t\tEdit,\n\t\t\t\t\t\thasSupport,\n\t\t\t\t\t\tattributeKeys = [],\n\t\t\t\t\t\tshareWithChildBlocks,\n\t\t\t\t\t} = feature;\n\t\t\t\t\tconst shouldDisplayControls =\n\t\t\t\t\t\tcontext[ mayDisplayControlsKey ] ||\n\t\t\t\t\t\t( context[ mayDisplayParentControlsKey ] &&\n\t\t\t\t\t\t\tshareWithChildBlocks );\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t! shouldDisplayControls ||\n\t\t\t\t\t\t! hasSupport( props.name )\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst neededProps = {};\n\t\t\t\t\tfor ( const key of attributeKeys ) {\n\t\t\t\t\t\tif ( props.attributes[ key ] ) {\n\t\t\t\t\t\t\tneededProps[ key ] = props.attributes[ key ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Edit\n\t\t\t\t\t\t\t// We can use the index because the array length\n\t\t\t\t\t\t\t// is fixed per page load right now.\n\t\t\t\t\t\t\tkey={ i }\n\t\t\t\t\t\t\tname={ props.name }\n\t\t\t\t\t\t\tisSelected={ props.isSelected }\n\t\t\t\t\t\t\tclientId={ props.clientId }\n\t\t\t\t\t\t\tsetAttributes={ props.setAttributes }\n\t\t\t\t\t\t\t__unstableParentLayout={\n\t\t\t\t\t\t\t\tprops.__unstableParentLayout\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// This component is pure, so only pass needed\n\t\t\t\t\t\t\t// props!!!\n\t\t\t\t\t\t\t{ ...neededProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} ),\n\t\t\t\t<OriginalBlockEdit key=\"edit\" { ...props } />,\n\t\t\t];\n\t\t},\n\t\t'withBlockEditHooks'\n\t);\n\taddFilter( 'editor.BlockEdit', 'core/editor/hooks', withBlockEditHooks );\n}\n\nfunction BlockProps( { index, useBlockProps, setAllWrapperProps, ...props } ) {\n\tconst wrapperProps = useBlockProps( props );\n\tconst setWrapperProps = ( next ) =>\n\t\tsetAllWrapperProps( ( prev ) => {\n\t\t\tconst nextAll = [ ...prev ];\n\t\t\tnextAll[ index ] = next;\n\t\t\treturn nextAll;\n\t\t} );\n\t// Setting state after every render is fine because this component is\n\t// pure and will only re-render when needed props change.\n\tuseEffect( () => {\n\t\t// We could shallow compare the props, but since this component only\n\t\t// changes when needed attributes change, the benefit is probably small.\n\t\tsetWrapperProps( wrapperProps );\n\t\treturn () => {\n\t\t\tsetWrapperProps( undefined );\n\t\t};\n\t} );\n\treturn null;\n}\n\nconst BlockPropsPure = memo( BlockProps );\n\nexport function createBlockListBlockFilter( features ) {\n\tconst withBlockListBlockHooks = createHigherOrderComponent(\n\t\t( BlockListBlock ) => ( props ) => {\n\t\t\tconst [ allWrapperProps, setAllWrapperProps ] = useState(\n\t\t\t\tArray( features.length ).fill( undefined )\n\t\t\t);\n\t\t\treturn [\n\t\t\t\t...features.map( ( feature, i ) => {\n\t\t\t\t\tconst {\n\t\t\t\t\t\thasSupport,\n\t\t\t\t\t\tattributeKeys = [],\n\t\t\t\t\t\tuseBlockProps,\n\t\t\t\t\t} = feature;\n\n\t\t\t\t\tconst neededProps = {};\n\t\t\t\t\tfor ( const key of attributeKeys ) {\n\t\t\t\t\t\tif ( props.attributes[ key ] ) {\n\t\t\t\t\t\t\tneededProps[ key ] = props.attributes[ key ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t// Skip rendering if none of the needed attributes are\n\t\t\t\t\t\t// set.\n\t\t\t\t\t\t! Object.keys( neededProps ).length ||\n\t\t\t\t\t\t! hasSupport( props.name )\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<BlockPropsPure\n\t\t\t\t\t\t\t// We can use the index because the array length\n\t\t\t\t\t\t\t// is fixed per page load right now.\n\t\t\t\t\t\t\tkey={ i }\n\t\t\t\t\t\t\tindex={ i }\n\t\t\t\t\t\t\tuseBlockProps={ useBlockProps }\n\t\t\t\t\t\t\t// This component is pure, so we must pass a stable\n\t\t\t\t\t\t\t// function reference.\n\t\t\t\t\t\t\tsetAllWrapperProps={ setAllWrapperProps }\n\t\t\t\t\t\t\tname={ props.name }\n\t\t\t\t\t\t\tclientId={ props.clientId }\n\t\t\t\t\t\t\t// This component is pure, so only pass needed\n\t\t\t\t\t\t\t// props!!!\n\t\t\t\t\t\t\t{ ...neededProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} ),\n\t\t\t\t<BlockListBlock\n\t\t\t\t\tkey=\"edit\"\n\t\t\t\t\t{ ...props }\n\t\t\t\t\twrapperProps={ allWrapperProps\n\t\t\t\t\t\t.filter( Boolean )\n\t\t\t\t\t\t.reduce( ( acc, wrapperProps ) => {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t...acc,\n\t\t\t\t\t\t\t\t...wrapperProps,\n\t\t\t\t\t\t\t\tclassName: clsx(\n\t\t\t\t\t\t\t\t\tacc.className,\n\t\t\t\t\t\t\t\t\twrapperProps.className\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t\t\t...acc.style,\n\t\t\t\t\t\t\t\t\t...wrapperProps.style,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}, props.wrapperProps || {} ) }\n\t\t\t\t/>,\n\t\t\t];\n\t\t},\n\t\t'withBlockListBlockHooks'\n\t);\n\taddFilter(\n\t\t'editor.BlockListBlock',\n\t\t'core/editor/hooks',\n\t\twithBlockListBlockHooks\n\t);\n}\n\nexport function createBlockSaveFilter( features ) {\n\tfunction extraPropsFromHooks( props, name, attributes ) {\n\t\treturn features.reduce( ( accu, feature ) => {\n\t\t\tconst { hasSupport, attributeKeys = [], addSaveProps } = feature;\n\n\t\t\tconst neededAttributes = {};\n\t\t\tfor ( const key of attributeKeys ) {\n\t\t\t\tif ( attributes[ key ] ) {\n\t\t\t\t\tneededAttributes[ key ] = attributes[ key ];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t// Skip rendering if none of the needed attributes are\n\t\t\t\t// set.\n\t\t\t\t! Object.keys( neededAttributes ).length ||\n\t\t\t\t! hasSupport( name )\n\t\t\t) {\n\t\t\t\treturn accu;\n\t\t\t}\n\n\t\t\treturn addSaveProps( accu, name, neededAttributes );\n\t\t}, props );\n\t}\n\taddFilter(\n\t\t'blocks.getSaveContent.extraProps',\n\t\t'core/editor/hooks',\n\t\textraPropsFromHooks,\n\t\t0\n\t);\n\taddFilter(\n\t\t'blocks.getSaveContent.extraProps',\n\t\t'core/editor/hooks',\n\t\t( props ) => {\n\t\t\t// Previously we had a filter deleting the className if it was an empty\n\t\t\t// string. That filter is no longer running, so now we need to delete it\n\t\t\t// here.\n\t\t\tif ( props.hasOwnProperty( 'className' ) && ! props.className ) {\n\t\t\t\tdelete props.className;\n\t\t\t}\n\n\t\t\treturn props;\n\t\t}\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAKA,IAAAK,QAAA,GAAAL,OAAA;AAKA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,WAAA,GAAAV,OAAA;AAIA,IAAAW,KAAA,GAAAC,sBAAA,CAAAZ,OAAA;AAAw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AAAJ,gBAAS,EACR,uBAAuB,EACvB,mBAAmB,EACnBW,uBACD,CAAC;AACF;AAEO,SAASW,qBAAqBA,CAAE7C,QAAQ,EAAG;EACjD,SAAS8C,mBAAmBA,CAAEtC,KAAK,EAAE9F,IAAI,EAAE/C,UAAU,EAAG;IACvD,OAAOqI,QAAQ,CAACyC,MAAM,CAAE,CAAEM,IAAI,EAAEzK,OAAO,KAAM;MAC5C,MAAM;QAAEsI,UAAU;QAAEC,aAAa,GAAG,EAAE;QAAEmC;MAAa,CAAC,GAAG1K,OAAO;MAEhE,MAAM2K,gBAAgB,GAAG,CAAC,CAAC;MAC3B,KAAM,MAAMzM,GAAG,IAAIqK,aAAa,EAAG;QAClC,IAAKlJ,UAAU,CAAEnB,GAAG,CAAE,EAAG;UACxByM,gBAAgB,CAAEzM,GAAG,CAAE,GAAGmB,UAAU,CAAEnB,GAAG,CAAE;QAC5C;MACD;MAEA;MACC;MACA;MACA,CAAEH,MAAM,CAACkM,IAAI,CAAEU,gBAAiB,CAAC,CAACrM,MAAM,IACxC,CAAEgK,UAAU,CAAElG,IAAK,CAAC,EACnB;QACD,OAAOqI,IAAI;MACZ;MAEA,OAAOC,YAAY,CAAED,IAAI,EAAErI,IAAI,EAAEuI,gBAAiB,CAAC;IACpD,CAAC,EAAEzC,KAAM,CAAC;EACX;EACA,IAAAe,gBAAS,EACR,kCAAkC,EAClC,mBAAmB,EACnBuB,mBAAmB,EACnB,CACD,CAAC;EACD,IAAAvB,gBAAS,EACR,kCAAkC,EAClC,mBAAmB,EACjBf,KAAK,IAAM;IACZ;IACA;IACA;IACA,IAAKA,KAAK,CAAC0C,cAAc,CAAE,WAAY,CAAC,IAAI,CAAE1C,KAAK,CAACmC,SAAS,EAAG;MAC/D,OAAOnC,KAAK,CAACmC,SAAS;IACvB;IAEA,OAAOnC,KAAK;EACb,CACD,CAAC;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_blocks","require","_element","_data","_compose","_hooks","_context","_components","_hooks2","_object","_store","_lockUnlock","_clsx","_interopRequireDefault","_jsxRuntime","cleanEmptyObject","object","Array","isArray","cleanedNestedObjects","Object","entries","map","key","value","filter","undefined","length","fromEntries","exports","transformStyles","activeSupports","migrationPaths","result","source","index","results","values","every","isActive","innerBlocks","referenceBlockAttributes","attributes","returnBlock","forEach","support","path","styleValue","getValueFromObjectPath","setImmutably","shouldSkipSerialization","blockNameOrType","featureSet","feature","getBlockSupport","skipSerialization","__experimentalSkipSerialization","includes","pendingStyleOverrides","WeakMap","useStyleOverride","id","css","assets","__unstableType","clientId","setStyleOverride","deleteStyleOverride","unlock","useDispatch","blockEditorStore","registry","useRegistry","fallbackId","useId","useEffect","_id","override","get","set","push","window","queueMicrotask","batch","args","isPending","find","currentId","useBlockSettings","name","parentLayout","backgroundImage","backgroundSize","customFontFamilies","defaultFontFamilies","themeFontFamilies","defaultFontSizesEnabled","customFontSizes","defaultFontSizes","themeFontSizes","customFontSize","fontStyle","fontWeight","lineHeight","textAlign","textColumns","textDecoration","writingMode","textTransform","letterSpacing","padding","margin","blockGap","defaultSpacingSizesEnabled","customSpacingSize","userSpacingSizes","defaultSpacingSizes","themeSpacingSizes","units","aspectRatio","minHeight","layout","borderColor","borderRadius","borderStyle","borderWidth","customColorsEnabled","customColors","customDuotone","themeColors","defaultColors","defaultPalette","defaultDuotone","userDuotonePalette","themeDuotonePalette","defaultDuotonePalette","userGradientPalette","themeGradientPalette","defaultGradientPalette","defaultGradients","areCustomGradientsEnabled","isBackgroundEnabled","isLinkEnabled","isTextEnabled","isHeadingEnabled","isButtonEnabled","shadow","useSettings","rawSettings","useMemo","background","color","palette","custom","theme","default","gradients","duotone","customGradient","link","heading","button","text","typography","fontFamilies","fontSizes","spacing","spacingSizes","border","radius","style","width","dimensions","useSettingsForBlockElement","createBlockEditFilter","features","settings","Edit","memo","edit","withBlockEditHooks","createHigherOrderComponent","OriginalBlockEdit","props","context","useBlockEditContext","i","hasSupport","attributeKeys","shareWithChildBlocks","shouldDisplayControls","mayDisplayControlsKey","mayDisplayParentControlsKey","neededProps","jsx","isSelected","setAttributes","__unstableParentLayout","addFilter","BlockProps","useBlockProps","setAllWrapperProps","wrapperProps","setWrapperProps","next","prev","nextAll","BlockPropsPure","createBlockListBlockFilter","withBlockListBlockHooks","BlockListBlock","allWrapperProps","useState","fill","isMatch","keys","Boolean","reduce","acc","className","clsx","createBlockSaveFilter","extraPropsFromHooks","accu","addSaveProps","neededAttributes","hasOwnProperty"],"sources":["@wordpress/block-editor/src/hooks/utils.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockSupport } from '@wordpress/blocks';\nimport { memo, useMemo, useEffect, useId, useState } from '@wordpress/element';\nimport { useDispatch, useRegistry } from '@wordpress/data';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport {\n\tuseBlockEditContext,\n\tmayDisplayControlsKey,\n\tmayDisplayParentControlsKey,\n} from '../components/block-edit/context';\nimport { useSettings } from '../components';\nimport { useSettingsForBlockElement } from '../components/global-styles/hooks';\nimport { getValueFromObjectPath, setImmutably } from '../utils/object';\nimport { store as blockEditorStore } from '../store';\nimport { unlock } from '../lock-unlock';\n/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * Removed falsy values from nested object.\n *\n * @param {*} object\n * @return {*} Object cleaned from falsy values\n */\nexport const cleanEmptyObject = ( object ) => {\n\tif (\n\t\tobject === null ||\n\t\ttypeof object !== 'object' ||\n\t\tArray.isArray( object )\n\t) {\n\t\treturn object;\n\t}\n\n\tconst cleanedNestedObjects = Object.entries( object )\n\t\t.map( ( [ key, value ] ) => [ key, cleanEmptyObject( value ) ] )\n\t\t.filter( ( [ , value ] ) => value !== undefined );\n\treturn ! cleanedNestedObjects.length\n\t\t? undefined\n\t\t: Object.fromEntries( cleanedNestedObjects );\n};\n\nexport function transformStyles(\n\tactiveSupports,\n\tmigrationPaths,\n\tresult,\n\tsource,\n\tindex,\n\tresults\n) {\n\t// If there are no active supports return early.\n\tif (\n\t\tObject.values( activeSupports ?? {} ).every(\n\t\t\t( isActive ) => ! isActive\n\t\t)\n\t) {\n\t\treturn result;\n\t}\n\t// If the condition verifies we are probably in the presence of a wrapping transform\n\t// e.g: nesting paragraphs in a group or columns and in that case the styles should not be transformed.\n\tif ( results.length === 1 && result.innerBlocks.length === source.length ) {\n\t\treturn result;\n\t}\n\t// For cases where we have a transform from one block to multiple blocks\n\t// or multiple blocks to one block we apply the styles of the first source block\n\t// to the result(s).\n\tlet referenceBlockAttributes = source[ 0 ]?.attributes;\n\t// If we are in presence of transform between more than one block in the source\n\t// that has more than one block in the result\n\t// we apply the styles on source N to the result N,\n\t// if source N does not exists we do nothing.\n\tif ( results.length > 1 && source.length > 1 ) {\n\t\tif ( source[ index ] ) {\n\t\t\treferenceBlockAttributes = source[ index ]?.attributes;\n\t\t} else {\n\t\t\treturn result;\n\t\t}\n\t}\n\tlet returnBlock = result;\n\tObject.entries( activeSupports ).forEach( ( [ support, isActive ] ) => {\n\t\tif ( isActive ) {\n\t\t\tmigrationPaths[ support ].forEach( ( path ) => {\n\t\t\t\tconst styleValue = getValueFromObjectPath(\n\t\t\t\t\treferenceBlockAttributes,\n\t\t\t\t\tpath\n\t\t\t\t);\n\t\t\t\tif ( styleValue ) {\n\t\t\t\t\treturnBlock = {\n\t\t\t\t\t\t...returnBlock,\n\t\t\t\t\t\tattributes: setImmutably(\n\t\t\t\t\t\t\treturnBlock.attributes,\n\t\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\tstyleValue\n\t\t\t\t\t\t),\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t} );\n\treturn returnBlock;\n}\n\n/**\n * Check whether serialization of specific block support feature or set should\n * be skipped.\n *\n * @param {string|Object} blockNameOrType Block name or block type object.\n * @param {string} featureSet Name of block support feature set.\n * @param {string} feature Name of the individual feature to check.\n *\n * @return {boolean} Whether serialization should occur.\n */\nexport function shouldSkipSerialization(\n\tblockNameOrType,\n\tfeatureSet,\n\tfeature\n) {\n\tconst support = getBlockSupport( blockNameOrType, featureSet );\n\tconst skipSerialization = support?.__experimentalSkipSerialization;\n\n\tif ( Array.isArray( skipSerialization ) ) {\n\t\treturn skipSerialization.includes( feature );\n\t}\n\n\treturn skipSerialization;\n}\n\nconst pendingStyleOverrides = new WeakMap();\n\nexport function useStyleOverride( {\n\tid,\n\tcss,\n\tassets,\n\t__unstableType,\n\tclientId,\n} = {} ) {\n\tconst { setStyleOverride, deleteStyleOverride } = unlock(\n\t\tuseDispatch( blockEditorStore )\n\t);\n\tconst registry = useRegistry();\n\tconst fallbackId = useId();\n\tuseEffect( () => {\n\t\t// Unmount if there is CSS and assets are empty.\n\t\tif ( ! css && ! assets ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst _id = id || fallbackId;\n\t\tconst override = {\n\t\t\tid,\n\t\t\tcss,\n\t\t\tassets,\n\t\t\t__unstableType,\n\t\t\tclientId,\n\t\t};\n\t\t// Batch updates to style overrides to avoid triggering cascading renders\n\t\t// for each style override block included in a tree and optimize initial render.\n\t\tif ( ! pendingStyleOverrides.get( registry ) ) {\n\t\t\tpendingStyleOverrides.set( registry, [] );\n\t\t}\n\t\tpendingStyleOverrides.get( registry ).push( [ _id, override ] );\n\t\twindow.queueMicrotask( () => {\n\t\t\tif ( pendingStyleOverrides.get( registry )?.length ) {\n\t\t\t\tregistry.batch( () => {\n\t\t\t\t\tpendingStyleOverrides.get( registry ).forEach( ( args ) => {\n\t\t\t\t\t\tsetStyleOverride( ...args );\n\t\t\t\t\t} );\n\t\t\t\t\tpendingStyleOverrides.set( registry, [] );\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t\treturn () => {\n\t\t\tconst isPending = pendingStyleOverrides\n\t\t\t\t.get( registry )\n\t\t\t\t?.find( ( [ currentId ] ) => currentId === _id );\n\t\t\tif ( isPending ) {\n\t\t\t\tpendingStyleOverrides.set(\n\t\t\t\t\tregistry,\n\t\t\t\t\tpendingStyleOverrides\n\t\t\t\t\t\t.get( registry )\n\t\t\t\t\t\t.filter( ( [ currentId ] ) => currentId !== _id )\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tdeleteStyleOverride( _id );\n\t\t\t}\n\t\t};\n\t}, [\n\t\tid,\n\t\tcss,\n\t\tclientId,\n\t\tassets,\n\t\t__unstableType,\n\t\tfallbackId,\n\t\tsetStyleOverride,\n\t\tdeleteStyleOverride,\n\t\tregistry,\n\t] );\n}\n\n/**\n * Based on the block and its context, returns an object of all the block settings.\n * This object can be passed as a prop to all the Styles UI components\n * (TypographyPanel, DimensionsPanel...).\n *\n * @param {string} name Block name.\n * @param {*} parentLayout Parent layout.\n *\n * @return {Object} Settings object.\n */\nexport function useBlockSettings( name, parentLayout ) {\n\tconst [\n\t\tbackgroundImage,\n\t\tbackgroundSize,\n\t\tcustomFontFamilies,\n\t\tdefaultFontFamilies,\n\t\tthemeFontFamilies,\n\t\tdefaultFontSizesEnabled,\n\t\tcustomFontSizes,\n\t\tdefaultFontSizes,\n\t\tthemeFontSizes,\n\t\tcustomFontSize,\n\t\tfontStyle,\n\t\tfontWeight,\n\t\tlineHeight,\n\t\ttextAlign,\n\t\ttextColumns,\n\t\ttextDecoration,\n\t\twritingMode,\n\t\ttextTransform,\n\t\tletterSpacing,\n\t\tpadding,\n\t\tmargin,\n\t\tblockGap,\n\t\tdefaultSpacingSizesEnabled,\n\t\tcustomSpacingSize,\n\t\tuserSpacingSizes,\n\t\tdefaultSpacingSizes,\n\t\tthemeSpacingSizes,\n\t\tunits,\n\t\taspectRatio,\n\t\tminHeight,\n\t\tlayout,\n\t\tborderColor,\n\t\tborderRadius,\n\t\tborderStyle,\n\t\tborderWidth,\n\t\tcustomColorsEnabled,\n\t\tcustomColors,\n\t\tcustomDuotone,\n\t\tthemeColors,\n\t\tdefaultColors,\n\t\tdefaultPalette,\n\t\tdefaultDuotone,\n\t\tuserDuotonePalette,\n\t\tthemeDuotonePalette,\n\t\tdefaultDuotonePalette,\n\t\tuserGradientPalette,\n\t\tthemeGradientPalette,\n\t\tdefaultGradientPalette,\n\t\tdefaultGradients,\n\t\tareCustomGradientsEnabled,\n\t\tisBackgroundEnabled,\n\t\tisLinkEnabled,\n\t\tisTextEnabled,\n\t\tisHeadingEnabled,\n\t\tisButtonEnabled,\n\t\tshadow,\n\t] = useSettings(\n\t\t'background.backgroundImage',\n\t\t'background.backgroundSize',\n\t\t'typography.fontFamilies.custom',\n\t\t'typography.fontFamilies.default',\n\t\t'typography.fontFamilies.theme',\n\t\t'typography.defaultFontSizes',\n\t\t'typography.fontSizes.custom',\n\t\t'typography.fontSizes.default',\n\t\t'typography.fontSizes.theme',\n\t\t'typography.customFontSize',\n\t\t'typography.fontStyle',\n\t\t'typography.fontWeight',\n\t\t'typography.lineHeight',\n\t\t'typography.textAlign',\n\t\t'typography.textColumns',\n\t\t'typography.textDecoration',\n\t\t'typography.writingMode',\n\t\t'typography.textTransform',\n\t\t'typography.letterSpacing',\n\t\t'spacing.padding',\n\t\t'spacing.margin',\n\t\t'spacing.blockGap',\n\t\t'spacing.defaultSpacingSizes',\n\t\t'spacing.customSpacingSize',\n\t\t'spacing.spacingSizes.custom',\n\t\t'spacing.spacingSizes.default',\n\t\t'spacing.spacingSizes.theme',\n\t\t'spacing.units',\n\t\t'dimensions.aspectRatio',\n\t\t'dimensions.minHeight',\n\t\t'layout',\n\t\t'border.color',\n\t\t'border.radius',\n\t\t'border.style',\n\t\t'border.width',\n\t\t'color.custom',\n\t\t'color.palette.custom',\n\t\t'color.customDuotone',\n\t\t'color.palette.theme',\n\t\t'color.palette.default',\n\t\t'color.defaultPalette',\n\t\t'color.defaultDuotone',\n\t\t'color.duotone.custom',\n\t\t'color.duotone.theme',\n\t\t'color.duotone.default',\n\t\t'color.gradients.custom',\n\t\t'color.gradients.theme',\n\t\t'color.gradients.default',\n\t\t'color.defaultGradients',\n\t\t'color.customGradient',\n\t\t'color.background',\n\t\t'color.link',\n\t\t'color.text',\n\t\t'color.heading',\n\t\t'color.button',\n\t\t'shadow'\n\t);\n\n\tconst rawSettings = useMemo( () => {\n\t\treturn {\n\t\t\tbackground: {\n\t\t\t\tbackgroundImage,\n\t\t\t\tbackgroundSize,\n\t\t\t},\n\t\t\tcolor: {\n\t\t\t\tpalette: {\n\t\t\t\t\tcustom: customColors,\n\t\t\t\t\ttheme: themeColors,\n\t\t\t\t\tdefault: defaultColors,\n\t\t\t\t},\n\t\t\t\tgradients: {\n\t\t\t\t\tcustom: userGradientPalette,\n\t\t\t\t\ttheme: themeGradientPalette,\n\t\t\t\t\tdefault: defaultGradientPalette,\n\t\t\t\t},\n\t\t\t\tduotone: {\n\t\t\t\t\tcustom: userDuotonePalette,\n\t\t\t\t\ttheme: themeDuotonePalette,\n\t\t\t\t\tdefault: defaultDuotonePalette,\n\t\t\t\t},\n\t\t\t\tdefaultGradients,\n\t\t\t\tdefaultPalette,\n\t\t\t\tdefaultDuotone,\n\t\t\t\tcustom: customColorsEnabled,\n\t\t\t\tcustomGradient: areCustomGradientsEnabled,\n\t\t\t\tcustomDuotone,\n\t\t\t\tbackground: isBackgroundEnabled,\n\t\t\t\tlink: isLinkEnabled,\n\t\t\t\theading: isHeadingEnabled,\n\t\t\t\tbutton: isButtonEnabled,\n\t\t\t\ttext: isTextEnabled,\n\t\t\t},\n\t\t\ttypography: {\n\t\t\t\tfontFamilies: {\n\t\t\t\t\tcustom: customFontFamilies,\n\t\t\t\t\tdefault: defaultFontFamilies,\n\t\t\t\t\ttheme: themeFontFamilies,\n\t\t\t\t},\n\t\t\t\tfontSizes: {\n\t\t\t\t\tcustom: customFontSizes,\n\t\t\t\t\tdefault: defaultFontSizes,\n\t\t\t\t\ttheme: themeFontSizes,\n\t\t\t\t},\n\t\t\t\tcustomFontSize,\n\t\t\t\tdefaultFontSizes: defaultFontSizesEnabled,\n\t\t\t\tfontStyle,\n\t\t\t\tfontWeight,\n\t\t\t\tlineHeight,\n\t\t\t\ttextAlign,\n\t\t\t\ttextColumns,\n\t\t\t\ttextDecoration,\n\t\t\t\ttextTransform,\n\t\t\t\tletterSpacing,\n\t\t\t\twritingMode,\n\t\t\t},\n\t\t\tspacing: {\n\t\t\t\tspacingSizes: {\n\t\t\t\t\tcustom: userSpacingSizes,\n\t\t\t\t\tdefault: defaultSpacingSizes,\n\t\t\t\t\ttheme: themeSpacingSizes,\n\t\t\t\t},\n\t\t\t\tcustomSpacingSize,\n\t\t\t\tdefaultSpacingSizes: defaultSpacingSizesEnabled,\n\t\t\t\tpadding,\n\t\t\t\tmargin,\n\t\t\t\tblockGap,\n\t\t\t\tunits,\n\t\t\t},\n\t\t\tborder: {\n\t\t\t\tcolor: borderColor,\n\t\t\t\tradius: borderRadius,\n\t\t\t\tstyle: borderStyle,\n\t\t\t\twidth: borderWidth,\n\t\t\t},\n\t\t\tdimensions: {\n\t\t\t\taspectRatio,\n\t\t\t\tminHeight,\n\t\t\t},\n\t\t\tlayout,\n\t\t\tparentLayout,\n\t\t\tshadow,\n\t\t};\n\t}, [\n\t\tbackgroundImage,\n\t\tbackgroundSize,\n\t\tcustomFontFamilies,\n\t\tdefaultFontFamilies,\n\t\tthemeFontFamilies,\n\t\tdefaultFontSizesEnabled,\n\t\tcustomFontSizes,\n\t\tdefaultFontSizes,\n\t\tthemeFontSizes,\n\t\tcustomFontSize,\n\t\tfontStyle,\n\t\tfontWeight,\n\t\tlineHeight,\n\t\ttextAlign,\n\t\ttextColumns,\n\t\ttextDecoration,\n\t\ttextTransform,\n\t\tletterSpacing,\n\t\twritingMode,\n\t\tpadding,\n\t\tmargin,\n\t\tblockGap,\n\t\tdefaultSpacingSizesEnabled,\n\t\tcustomSpacingSize,\n\t\tuserSpacingSizes,\n\t\tdefaultSpacingSizes,\n\t\tthemeSpacingSizes,\n\t\tunits,\n\t\taspectRatio,\n\t\tminHeight,\n\t\tlayout,\n\t\tparentLayout,\n\t\tborderColor,\n\t\tborderRadius,\n\t\tborderStyle,\n\t\tborderWidth,\n\t\tcustomColorsEnabled,\n\t\tcustomColors,\n\t\tcustomDuotone,\n\t\tthemeColors,\n\t\tdefaultColors,\n\t\tdefaultPalette,\n\t\tdefaultDuotone,\n\t\tuserDuotonePalette,\n\t\tthemeDuotonePalette,\n\t\tdefaultDuotonePalette,\n\t\tuserGradientPalette,\n\t\tthemeGradientPalette,\n\t\tdefaultGradientPalette,\n\t\tdefaultGradients,\n\t\tareCustomGradientsEnabled,\n\t\tisBackgroundEnabled,\n\t\tisLinkEnabled,\n\t\tisTextEnabled,\n\t\tisHeadingEnabled,\n\t\tisButtonEnabled,\n\t\tshadow,\n\t] );\n\n\treturn useSettingsForBlockElement( rawSettings, name );\n}\n\nexport function createBlockEditFilter( features ) {\n\t// We don't want block controls to re-render when typing inside a block.\n\t// `memo` will prevent re-renders unless props change, so only pass the\n\t// needed props and not the whole attributes object.\n\tfeatures = features.map( ( settings ) => {\n\t\treturn { ...settings, Edit: memo( settings.edit ) };\n\t} );\n\tconst withBlockEditHooks = createHigherOrderComponent(\n\t\t( OriginalBlockEdit ) => ( props ) => {\n\t\t\tconst context = useBlockEditContext();\n\t\t\t// CAUTION: code added before this line will be executed for all\n\t\t\t// blocks, not just those that support the feature! Code added\n\t\t\t// above this line should be carefully evaluated for its impact on\n\t\t\t// performance.\n\t\t\treturn [\n\t\t\t\t...features.map( ( feature, i ) => {\n\t\t\t\t\tconst {\n\t\t\t\t\t\tEdit,\n\t\t\t\t\t\thasSupport,\n\t\t\t\t\t\tattributeKeys = [],\n\t\t\t\t\t\tshareWithChildBlocks,\n\t\t\t\t\t} = feature;\n\t\t\t\t\tconst shouldDisplayControls =\n\t\t\t\t\t\tcontext[ mayDisplayControlsKey ] ||\n\t\t\t\t\t\t( context[ mayDisplayParentControlsKey ] &&\n\t\t\t\t\t\t\tshareWithChildBlocks );\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t! shouldDisplayControls ||\n\t\t\t\t\t\t! hasSupport( props.name )\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst neededProps = {};\n\t\t\t\t\tfor ( const key of attributeKeys ) {\n\t\t\t\t\t\tif ( props.attributes[ key ] ) {\n\t\t\t\t\t\t\tneededProps[ key ] = props.attributes[ key ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Edit\n\t\t\t\t\t\t\t// We can use the index because the array length\n\t\t\t\t\t\t\t// is fixed per page load right now.\n\t\t\t\t\t\t\tkey={ i }\n\t\t\t\t\t\t\tname={ props.name }\n\t\t\t\t\t\t\tisSelected={ props.isSelected }\n\t\t\t\t\t\t\tclientId={ props.clientId }\n\t\t\t\t\t\t\tsetAttributes={ props.setAttributes }\n\t\t\t\t\t\t\t__unstableParentLayout={\n\t\t\t\t\t\t\t\tprops.__unstableParentLayout\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// This component is pure, so only pass needed\n\t\t\t\t\t\t\t// props!!!\n\t\t\t\t\t\t\t{ ...neededProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} ),\n\t\t\t\t<OriginalBlockEdit key=\"edit\" { ...props } />,\n\t\t\t];\n\t\t},\n\t\t'withBlockEditHooks'\n\t);\n\taddFilter( 'editor.BlockEdit', 'core/editor/hooks', withBlockEditHooks );\n}\n\nfunction BlockProps( { index, useBlockProps, setAllWrapperProps, ...props } ) {\n\tconst wrapperProps = useBlockProps( props );\n\tconst setWrapperProps = ( next ) =>\n\t\tsetAllWrapperProps( ( prev ) => {\n\t\t\tconst nextAll = [ ...prev ];\n\t\t\tnextAll[ index ] = next;\n\t\t\treturn nextAll;\n\t\t} );\n\t// Setting state after every render is fine because this component is\n\t// pure and will only re-render when needed props change.\n\tuseEffect( () => {\n\t\t// We could shallow compare the props, but since this component only\n\t\t// changes when needed attributes change, the benefit is probably small.\n\t\tsetWrapperProps( wrapperProps );\n\t\treturn () => {\n\t\t\tsetWrapperProps( undefined );\n\t\t};\n\t} );\n\treturn null;\n}\n\nconst BlockPropsPure = memo( BlockProps );\n\nexport function createBlockListBlockFilter( features ) {\n\tconst withBlockListBlockHooks = createHigherOrderComponent(\n\t\t( BlockListBlock ) => ( props ) => {\n\t\t\tconst [ allWrapperProps, setAllWrapperProps ] = useState(\n\t\t\t\tArray( features.length ).fill( undefined )\n\t\t\t);\n\t\t\treturn [\n\t\t\t\t...features.map( ( feature, i ) => {\n\t\t\t\t\tconst {\n\t\t\t\t\t\thasSupport,\n\t\t\t\t\t\tattributeKeys = [],\n\t\t\t\t\t\tuseBlockProps,\n\t\t\t\t\t\tisMatch,\n\t\t\t\t\t} = feature;\n\n\t\t\t\t\tconst neededProps = {};\n\t\t\t\t\tfor ( const key of attributeKeys ) {\n\t\t\t\t\t\tif ( props.attributes[ key ] ) {\n\t\t\t\t\t\t\tneededProps[ key ] = props.attributes[ key ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t// Skip rendering if none of the needed attributes are\n\t\t\t\t\t\t// set.\n\t\t\t\t\t\t! Object.keys( neededProps ).length ||\n\t\t\t\t\t\t! hasSupport( props.name ) ||\n\t\t\t\t\t\t( isMatch && ! isMatch( neededProps ) )\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<BlockPropsPure\n\t\t\t\t\t\t\t// We can use the index because the array length\n\t\t\t\t\t\t\t// is fixed per page load right now.\n\t\t\t\t\t\t\tkey={ i }\n\t\t\t\t\t\t\tindex={ i }\n\t\t\t\t\t\t\tuseBlockProps={ useBlockProps }\n\t\t\t\t\t\t\t// This component is pure, so we must pass a stable\n\t\t\t\t\t\t\t// function reference.\n\t\t\t\t\t\t\tsetAllWrapperProps={ setAllWrapperProps }\n\t\t\t\t\t\t\tname={ props.name }\n\t\t\t\t\t\t\tclientId={ props.clientId }\n\t\t\t\t\t\t\t// This component is pure, so only pass needed\n\t\t\t\t\t\t\t// props!!!\n\t\t\t\t\t\t\t{ ...neededProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} ),\n\t\t\t\t<BlockListBlock\n\t\t\t\t\tkey=\"edit\"\n\t\t\t\t\t{ ...props }\n\t\t\t\t\twrapperProps={ allWrapperProps\n\t\t\t\t\t\t.filter( Boolean )\n\t\t\t\t\t\t.reduce( ( acc, wrapperProps ) => {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t...acc,\n\t\t\t\t\t\t\t\t...wrapperProps,\n\t\t\t\t\t\t\t\tclassName: clsx(\n\t\t\t\t\t\t\t\t\tacc.className,\n\t\t\t\t\t\t\t\t\twrapperProps.className\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t\t\t...acc.style,\n\t\t\t\t\t\t\t\t\t...wrapperProps.style,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}, props.wrapperProps || {} ) }\n\t\t\t\t/>,\n\t\t\t];\n\t\t},\n\t\t'withBlockListBlockHooks'\n\t);\n\taddFilter(\n\t\t'editor.BlockListBlock',\n\t\t'core/editor/hooks',\n\t\twithBlockListBlockHooks\n\t);\n}\n\nexport function createBlockSaveFilter( features ) {\n\tfunction extraPropsFromHooks( props, name, attributes ) {\n\t\treturn features.reduce( ( accu, feature ) => {\n\t\t\tconst { hasSupport, attributeKeys = [], addSaveProps } = feature;\n\n\t\t\tconst neededAttributes = {};\n\t\t\tfor ( const key of attributeKeys ) {\n\t\t\t\tif ( attributes[ key ] ) {\n\t\t\t\t\tneededAttributes[ key ] = attributes[ key ];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t// Skip rendering if none of the needed attributes are\n\t\t\t\t// set.\n\t\t\t\t! Object.keys( neededAttributes ).length ||\n\t\t\t\t! hasSupport( name )\n\t\t\t) {\n\t\t\t\treturn accu;\n\t\t\t}\n\n\t\t\treturn addSaveProps( accu, name, neededAttributes );\n\t\t}, props );\n\t}\n\taddFilter(\n\t\t'blocks.getSaveContent.extraProps',\n\t\t'core/editor/hooks',\n\t\textraPropsFromHooks,\n\t\t0\n\t);\n\taddFilter(\n\t\t'blocks.getSaveContent.extraProps',\n\t\t'core/editor/hooks',\n\t\t( props ) => {\n\t\t\t// Previously we had a filter deleting the className if it was an empty\n\t\t\t// string. That filter is no longer running, so now we need to delete it\n\t\t\t// here.\n\t\t\tif ( props.hasOwnProperty( 'className' ) && ! props.className ) {\n\t\t\t\tdelete props.className;\n\t\t\t}\n\n\t\t\treturn props;\n\t\t}\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAKA,IAAAK,QAAA,GAAAL,OAAA;AAKA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,WAAA,GAAAV,OAAA;AAIA,IAAAW,KAAA,GAAAC,sBAAA,CAAAZ,OAAA;AAAwB,IAAAa,WAAA,GAAAb,OAAA;AAzBxB;AACA;AACA;;AAOA;AACA;AACA;;AAWA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMc,gBAAgB,GAAKC,MAAM,IAAM;EAC7C,IACCA,MAAM,KAAK,IAAI,IACf,OAAOA,MAAM,KAAK,QAAQ,IAC1BC,KAAK,CAACC,OAAO,CAAEF,MAAO,CAAC,EACtB;IACD,OAAOA,MAAM;EACd;EAEA,MAAMG,oBAAoB,GAAGC,MAAM,CAACC,OAAO,CAAEL,MAAO,CAAC,CACnDM,GAAG,CAAE,CAAE,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AAEoC;MAAa,CAAC,GAAG3K,OAAO;MAEhE,MAAM4K,gBAAgB,GAAG,CAAC,CAAC;MAC3B,KAAM,MAAM1M,GAAG,IAAIqK,aAAa,EAAG;QAClC,IAAKlJ,UAAU,CAAEnB,GAAG,CAAE,EAAG;UACxB0M,gBAAgB,CAAE1M,GAAG,CAAE,GAAGmB,UAAU,CAAEnB,GAAG,CAAE;QAC5C;MACD;MAEA;MACC;MACA;MACA,CAAEH,MAAM,CAACmM,IAAI,CAAEU,gBAAiB,CAAC,CAACtM,MAAM,IACxC,CAAEgK,UAAU,CAAElG,IAAK,CAAC,EACnB;QACD,OAAOsI,IAAI;MACZ;MAEA,OAAOC,YAAY,CAAED,IAAI,EAAEtI,IAAI,EAAEwI,gBAAiB,CAAC;IACpD,CAAC,EAAE1C,KAAM,CAAC;EACX;EACA,IAAAe,gBAAS,EACR,kCAAkC,EAClC,mBAAmB,EACnBwB,mBAAmB,EACnB,CACD,CAAC;EACD,IAAAxB,gBAAS,EACR,kCAAkC,EAClC,mBAAmB,EACjBf,KAAK,IAAM;IACZ;IACA;IACA;IACA,IAAKA,KAAK,CAAC2C,cAAc,CAAE,WAAY,CAAC,IAAI,CAAE3C,KAAK,CAACoC,SAAS,EAAG;MAC/D,OAAOpC,KAAK,CAACoC,SAAS;IACvB;IAEA,OAAOpC,KAAK;EACb,CACD,CAAC;AACF","ignoreList":[]}
|
package/build/layouts/grid.js
CHANGED
|
@@ -11,7 +11,7 @@ var _utils = require("./utils");
|
|
|
11
11
|
var _gap = require("../hooks/gap");
|
|
12
12
|
var _utils2 = require("../hooks/utils");
|
|
13
13
|
var _definitions = require("./definitions");
|
|
14
|
-
var
|
|
14
|
+
var _grid = require("../components/grid");
|
|
15
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
16
|
/**
|
|
17
17
|
* WordPress dependencies
|
|
@@ -92,8 +92,12 @@ var _default = exports.default = {
|
|
|
92
92
|
toolBarControls: function GridLayoutToolbarControls({
|
|
93
93
|
clientId
|
|
94
94
|
}) {
|
|
95
|
-
return /*#__PURE__*/(0, _jsxRuntime.
|
|
96
|
-
|
|
95
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
96
|
+
children: [window.__experimentalEnableGridInteractivity && /*#__PURE__*/(0, _jsxRuntime.jsx)(GridLayoutSync, {
|
|
97
|
+
clientId: clientId
|
|
98
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_grid.GridVisualizer, {
|
|
99
|
+
clientId: clientId
|
|
100
|
+
})]
|
|
97
101
|
});
|
|
98
102
|
},
|
|
99
103
|
getLayoutStyle: function getLayoutStyle({
|
|
@@ -223,12 +227,9 @@ function GridLayoutColumnsAndRowsControl({
|
|
|
223
227
|
columnCount = 3,
|
|
224
228
|
rowCount
|
|
225
229
|
} = layout;
|
|
226
|
-
return /*#__PURE__*/(0, _jsxRuntime.
|
|
227
|
-
children:
|
|
228
|
-
children:
|
|
229
|
-
as: "legend",
|
|
230
|
-
children: (0, _i18n.__)('Columns')
|
|
231
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.Flex, {
|
|
230
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
231
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("fieldset", {
|
|
232
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.Flex, {
|
|
232
233
|
gap: 4,
|
|
233
234
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.FlexItem, {
|
|
234
235
|
isBlock: true,
|
|
@@ -247,35 +248,11 @@ function GridLayoutColumnsAndRowsControl({
|
|
|
247
248
|
},
|
|
248
249
|
value: columnCount,
|
|
249
250
|
min: 1,
|
|
250
|
-
label: (0, _i18n.__)('Columns')
|
|
251
|
-
hideLabelFromVision: true
|
|
251
|
+
label: (0, _i18n.__)('Columns')
|
|
252
252
|
})
|
|
253
253
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.FlexItem, {
|
|
254
254
|
isBlock: true,
|
|
255
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.
|
|
256
|
-
value: parseInt(columnCount, 10) // RangeControl can't deal with strings.
|
|
257
|
-
,
|
|
258
|
-
onChange: value => onChange({
|
|
259
|
-
...layout,
|
|
260
|
-
columnCount: value
|
|
261
|
-
}),
|
|
262
|
-
min: 1,
|
|
263
|
-
max: 16,
|
|
264
|
-
withInputField: false,
|
|
265
|
-
label: (0, _i18n.__)('Columns'),
|
|
266
|
-
hideLabelFromVision: true
|
|
267
|
-
})
|
|
268
|
-
})]
|
|
269
|
-
})]
|
|
270
|
-
}), allowSizingOnChildren && window.__experimentalEnableGridInteractivity && /*#__PURE__*/(0, _jsxRuntime.jsxs)("fieldset", {
|
|
271
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.BaseControl.VisualLabel, {
|
|
272
|
-
as: "legend",
|
|
273
|
-
children: (0, _i18n.__)('Rows')
|
|
274
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.Flex, {
|
|
275
|
-
gap: 4,
|
|
276
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.FlexItem, {
|
|
277
|
-
isBlock: true,
|
|
278
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalNumberControl, {
|
|
255
|
+
children: window.__experimentalEnableGridInteractivity && allowSizingOnChildren ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalNumberControl, {
|
|
279
256
|
size: "__unstable-large",
|
|
280
257
|
onChange: value => {
|
|
281
258
|
onChange({
|
|
@@ -285,27 +262,23 @@ function GridLayoutColumnsAndRowsControl({
|
|
|
285
262
|
},
|
|
286
263
|
value: rowCount,
|
|
287
264
|
min: 1,
|
|
288
|
-
label: (0, _i18n.__)('Rows')
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.FlexItem, {
|
|
292
|
-
isBlock: true,
|
|
293
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.RangeControl, {
|
|
294
|
-
value: parseInt(rowCount, 10) // RangeControl can't deal with strings.
|
|
265
|
+
label: (0, _i18n.__)('Rows')
|
|
266
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.RangeControl, {
|
|
267
|
+
value: parseInt(columnCount, 10) // RangeControl can't deal with strings.
|
|
295
268
|
,
|
|
296
269
|
onChange: value => onChange({
|
|
297
270
|
...layout,
|
|
298
|
-
|
|
271
|
+
columnCount: value
|
|
299
272
|
}),
|
|
300
273
|
min: 1,
|
|
301
274
|
max: 16,
|
|
302
275
|
withInputField: false,
|
|
303
|
-
label: (0, _i18n.__)('
|
|
276
|
+
label: (0, _i18n.__)('Columns'),
|
|
304
277
|
hideLabelFromVision: true
|
|
305
278
|
})
|
|
306
279
|
})]
|
|
307
|
-
})
|
|
308
|
-
})
|
|
280
|
+
})
|
|
281
|
+
})
|
|
309
282
|
});
|
|
310
283
|
}
|
|
311
284
|
|
|
@@ -340,10 +313,11 @@ function GridLayoutTypeControl({
|
|
|
340
313
|
};
|
|
341
314
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalToggleGroupControl, {
|
|
342
315
|
__nextHasNoMarginBottom: true,
|
|
343
|
-
label: (0, _i18n.__)('
|
|
316
|
+
label: (0, _i18n.__)('Grid item position'),
|
|
344
317
|
value: isManual,
|
|
345
318
|
onChange: onChangeType,
|
|
346
319
|
isBlock: true,
|
|
320
|
+
help: isManual === 'manual' ? (0, _i18n.__)('Grid items can be manually placed in any position on the grid.') : (0, _i18n.__)('Grid items are placed automatically depending on their order.'),
|
|
347
321
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToggleGroupControlOption, {
|
|
348
322
|
value: "auto",
|
|
349
323
|
label: (0, _i18n.__)('Auto')
|
|
@@ -353,4 +327,7 @@ function GridLayoutTypeControl({
|
|
|
353
327
|
}, "manual")]
|
|
354
328
|
});
|
|
355
329
|
}
|
|
330
|
+
function GridLayoutSync(props) {
|
|
331
|
+
(0, _grid.useGridLayoutSync)(props);
|
|
332
|
+
}
|
|
356
333
|
//# sourceMappingURL=grid.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_components","_element","_utils","_gap","_utils2","_definitions","_gridVisualizer","_jsxRuntime","RANGE_CONTROL_MAX_VALUES","px","vw","vh","em","rem","svw","lvw","dvw","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax","units","value","label","default","_default","exports","name","__","inspectorControls","GridLayoutInspectorControls","layout","onChange","layoutBlockSupport","allowSizingOnChildren","jsxs","Fragment","children","jsx","GridLayoutTypeControl","columnCount","GridLayoutColumnsAndRowsControl","GridLayoutMinimumWidthControl","toolBarControls","GridLayoutToolbarControls","clientId","GridVisualizer","getLayoutStyle","selector","style","blockName","hasBlockGapSupport","layoutDefinitions","LAYOUT_DEFINITIONS","minimumColumnWidth","rowCount","blockGapValue","spacing","blockGap","shouldSkipSerialization","getGapCSSValue","undefined","output","rules","push","length","appendSelectors","join","getBlockGapCSS","getOrientation","getAlignments","quantity","unit","parseQuantityAndUnitFromRawValue","handleSliderChange","next","handleUnitChange","newUnit","newValue","includes","toFixed","Math","round","BaseControl","VisualLabel","as","Flex","gap","FlexItem","isBlock","__experimentalUnitControl","size","onUnitChange","min","hideLabelFromVision","RangeControl","max","withInputField","__experimentalNumberControl","validValue","parseInt","window","__experimentalEnableGridInteractivity","tempColumnCount","setTempColumnCount","useState","tempMinimumColumnWidth","setTempMinimumColumnWidth","isManual","onChangeType","__experimentalToggleGroupControl","__nextHasNoMarginBottom","__experimentalToggleGroupControlOption"],"sources":["@wordpress/block-editor/src/layouts/grid.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\nimport {\n\tBaseControl,\n\tFlex,\n\tFlexItem,\n\tRangeControl,\n\t__experimentalNumberControl as NumberControl,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue,\n} from '@wordpress/components';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { appendSelectors, getBlockGapCSS } from './utils';\nimport { getGapCSSValue } from '../hooks/gap';\nimport { shouldSkipSerialization } from '../hooks/utils';\nimport { LAYOUT_DEFINITIONS } from './definitions';\nimport { GridVisualizer } from '../components/grid-visualizer';\n\nconst RANGE_CONTROL_MAX_VALUES = {\n\tpx: 600,\n\t'%': 100,\n\tvw: 100,\n\tvh: 100,\n\tem: 38,\n\trem: 38,\n\tsvw: 100,\n\tlvw: 100,\n\tdvw: 100,\n\tsvh: 100,\n\tlvh: 100,\n\tdvh: 100,\n\tvi: 100,\n\tsvi: 100,\n\tlvi: 100,\n\tdvi: 100,\n\tvb: 100,\n\tsvb: 100,\n\tlvb: 100,\n\tdvb: 100,\n\tvmin: 100,\n\tsvmin: 100,\n\tlvmin: 100,\n\tdvmin: 100,\n\tvmax: 100,\n\tsvmax: 100,\n\tlvmax: 100,\n\tdvmax: 100,\n};\n\nconst units = [\n\t{ value: 'px', label: 'px', default: 0 },\n\t{ value: 'rem', label: 'rem', default: 0 },\n\t{ value: 'em', label: 'em', default: 0 },\n];\n\nexport default {\n\tname: 'grid',\n\tlabel: __( 'Grid' ),\n\tinspectorControls: function GridLayoutInspectorControls( {\n\t\tlayout = {},\n\t\tonChange,\n\t\tlayoutBlockSupport = {},\n\t} ) {\n\t\tconst { allowSizingOnChildren = false } = layoutBlockSupport;\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<GridLayoutTypeControl\n\t\t\t\t\tlayout={ layout }\n\t\t\t\t\tonChange={ onChange }\n\t\t\t\t/>\n\t\t\t\t{ layout?.columnCount ? (\n\t\t\t\t\t<GridLayoutColumnsAndRowsControl\n\t\t\t\t\t\tlayout={ layout }\n\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\tallowSizingOnChildren={ allowSizingOnChildren }\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<GridLayoutMinimumWidthControl\n\t\t\t\t\t\tlayout={ layout }\n\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t},\n\ttoolBarControls: function GridLayoutToolbarControls( { clientId } ) {\n\t\treturn <GridVisualizer clientId={ clientId } />;\n\t},\n\tgetLayoutStyle: function getLayoutStyle( {\n\t\tselector,\n\t\tlayout,\n\t\tstyle,\n\t\tblockName,\n\t\thasBlockGapSupport,\n\t\tlayoutDefinitions = LAYOUT_DEFINITIONS,\n\t} ) {\n\t\tconst {\n\t\t\tminimumColumnWidth = '12rem',\n\t\t\tcolumnCount = null,\n\t\t\trowCount = null,\n\t\t} = layout;\n\n\t\t// If a block's block.json skips serialization for spacing or spacing.blockGap,\n\t\t// don't apply the user-defined value to the styles.\n\t\tconst blockGapValue =\n\t\t\tstyle?.spacing?.blockGap &&\n\t\t\t! shouldSkipSerialization( blockName, 'spacing', 'blockGap' )\n\t\t\t\t? getGapCSSValue( style?.spacing?.blockGap, '0.5em' )\n\t\t\t\t: undefined;\n\n\t\tlet output = '';\n\t\tconst rules = [];\n\n\t\tif ( columnCount ) {\n\t\t\trules.push(\n\t\t\t\t`grid-template-columns: repeat(${ columnCount }, minmax(0, 1fr))`\n\t\t\t);\n\t\t\tif ( rowCount ) {\n\t\t\t\trules.push(\n\t\t\t\t\t`grid-template-rows: repeat(${ rowCount }, minmax(0, 1fr))`\n\t\t\t\t);\n\t\t\t}\n\t\t} else if ( minimumColumnWidth ) {\n\t\t\trules.push(\n\t\t\t\t`grid-template-columns: repeat(auto-fill, minmax(min(${ minimumColumnWidth }, 100%), 1fr))`,\n\t\t\t\t'container-type: inline-size'\n\t\t\t);\n\t\t}\n\n\t\tif ( rules.length ) {\n\t\t\t// Reason to disable: the extra line breaks added by prettier mess with the unit tests.\n\t\t\t// eslint-disable-next-line prettier/prettier\n\t\t\toutput = `${ appendSelectors( selector ) } { ${ rules.join(\n\t\t\t\t'; '\n\t\t\t) }; }`;\n\t\t}\n\n\t\t// Output blockGap styles based on rules contained in layout definitions in theme.json.\n\t\tif ( hasBlockGapSupport && blockGapValue ) {\n\t\t\toutput += getBlockGapCSS(\n\t\t\t\tselector,\n\t\t\t\tlayoutDefinitions,\n\t\t\t\t'grid',\n\t\t\t\tblockGapValue\n\t\t\t);\n\t\t}\n\t\treturn output;\n\t},\n\tgetOrientation() {\n\t\treturn 'horizontal';\n\t},\n\tgetAlignments() {\n\t\treturn [];\n\t},\n};\n\n// Enables setting minimum width of grid items.\nfunction GridLayoutMinimumWidthControl( { layout, onChange } ) {\n\tconst { minimumColumnWidth: value = '12rem' } = layout;\n\tconst [ quantity, unit ] = parseQuantityAndUnitFromRawValue( value );\n\n\tconst handleSliderChange = ( next ) => {\n\t\tonChange( {\n\t\t\t...layout,\n\t\t\tminimumColumnWidth: [ next, unit ].join( '' ),\n\t\t} );\n\t};\n\n\t// Mostly copied from HeightControl.\n\tconst handleUnitChange = ( newUnit ) => {\n\t\t// Attempt to smooth over differences between currentUnit and newUnit.\n\t\t// This should slightly improve the experience of switching between unit types.\n\t\tlet newValue;\n\n\t\tif ( [ 'em', 'rem' ].includes( newUnit ) && unit === 'px' ) {\n\t\t\t// Convert pixel value to an approximate of the new unit, assuming a root size of 16px.\n\t\t\tnewValue = ( quantity / 16 ).toFixed( 2 ) + newUnit;\n\t\t} else if ( [ 'em', 'rem' ].includes( unit ) && newUnit === 'px' ) {\n\t\t\t// Convert to pixel value assuming a root size of 16px.\n\t\t\tnewValue = Math.round( quantity * 16 ) + newUnit;\n\t\t}\n\n\t\tonChange( {\n\t\t\t...layout,\n\t\t\tminimumColumnWidth: newValue,\n\t\t} );\n\t};\n\n\treturn (\n\t\t<fieldset>\n\t\t\t<BaseControl.VisualLabel as=\"legend\">\n\t\t\t\t{ __( 'Minimum column width' ) }\n\t\t\t</BaseControl.VisualLabel>\n\t\t\t<Flex gap={ 4 }>\n\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t<UnitControl\n\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t...layout,\n\t\t\t\t\t\t\t\tminimumColumnWidth: newValue,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tonUnitChange={ handleUnitChange }\n\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\tlabel={ __( 'Minimum column width' ) }\n\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t/>\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t<RangeControl\n\t\t\t\t\t\tonChange={ handleSliderChange }\n\t\t\t\t\t\tvalue={ quantity }\n\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\tmax={ RANGE_CONTROL_MAX_VALUES[ unit ] || 600 }\n\t\t\t\t\t\twithInputField={ false }\n\t\t\t\t\t\tlabel={ __( 'Minimum column width' ) }\n\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t/>\n\t\t\t\t</FlexItem>\n\t\t\t</Flex>\n\t\t</fieldset>\n\t);\n}\n\n// Enables setting number of grid columns\nfunction GridLayoutColumnsAndRowsControl( {\n\tlayout,\n\tonChange,\n\tallowSizingOnChildren,\n} ) {\n\tconst { columnCount = 3, rowCount } = layout;\n\n\treturn (\n\t\t<>\n\t\t\t<fieldset>\n\t\t\t\t<BaseControl.VisualLabel as=\"legend\">\n\t\t\t\t\t{ __( 'Columns' ) }\n\t\t\t\t</BaseControl.VisualLabel>\n\t\t\t\t<Flex gap={ 4 }>\n\t\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t\t<NumberControl\n\t\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t * If the input is cleared, avoid switching\n\t\t\t\t\t\t\t\t * back to \"Auto\" by setting a value of \"1\".\n\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\tconst validValue = value !== '' ? value : '1';\n\t\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t\t...layout,\n\t\t\t\t\t\t\t\t\tcolumnCount: validValue,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tvalue={ columnCount }\n\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\tvalue={ parseInt( columnCount, 10 ) } // RangeControl can't deal with strings.\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t\t...layout,\n\t\t\t\t\t\t\t\t\tcolumnCount: value,\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\tmax={ 16 }\n\t\t\t\t\t\t\twithInputField={ false }\n\t\t\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t</Flex>\n\t\t\t</fieldset>\n\t\t\t{ allowSizingOnChildren &&\n\t\t\t\twindow.__experimentalEnableGridInteractivity && (\n\t\t\t\t\t<fieldset>\n\t\t\t\t\t\t<BaseControl.VisualLabel as=\"legend\">\n\t\t\t\t\t\t\t{ __( 'Rows' ) }\n\t\t\t\t\t\t</BaseControl.VisualLabel>\n\t\t\t\t\t\t<Flex gap={ 4 }>\n\t\t\t\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t\t\t\t<NumberControl\n\t\t\t\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t\t\t\t...layout,\n\t\t\t\t\t\t\t\t\t\t\trowCount: value,\n\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tvalue={ rowCount }\n\t\t\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Rows' ) }\n\t\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t\t\tvalue={ parseInt( rowCount, 10 ) } // RangeControl can't deal with strings.\n\t\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t\t\t\t...layout,\n\t\t\t\t\t\t\t\t\t\t\trowCount: value,\n\t\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\t\t\tmax={ 16 }\n\t\t\t\t\t\t\t\t\twithInputField={ false }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Rows' ) }\n\t\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t</Flex>\n\t\t\t\t\t</fieldset>\n\t\t\t\t) }\n\t\t</>\n\t);\n}\n\n// Enables switching between grid types\nfunction GridLayoutTypeControl( { layout, onChange } ) {\n\tconst { columnCount, minimumColumnWidth } = layout;\n\n\t/**\n\t * When switching, temporarily save any custom values set on the\n\t * previous type so we can switch back without loss.\n\t */\n\tconst [ tempColumnCount, setTempColumnCount ] = useState(\n\t\tcolumnCount || 3\n\t);\n\tconst [ tempMinimumColumnWidth, setTempMinimumColumnWidth ] = useState(\n\t\tminimumColumnWidth || '12rem'\n\t);\n\n\tconst isManual = !! columnCount ? 'manual' : 'auto';\n\n\tconst onChangeType = ( value ) => {\n\t\tif ( value === 'manual' ) {\n\t\t\tsetTempMinimumColumnWidth( minimumColumnWidth || '12rem' );\n\t\t} else {\n\t\t\tsetTempColumnCount( columnCount || 3 );\n\t\t}\n\t\tonChange( {\n\t\t\t...layout,\n\t\t\tcolumnCount: value === 'manual' ? tempColumnCount : null,\n\t\t\tminimumColumnWidth:\n\t\t\t\tvalue === 'auto' ? tempMinimumColumnWidth : null,\n\t\t} );\n\t};\n\n\treturn (\n\t\t<ToggleGroupControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\tlabel={ __( 'Type' ) }\n\t\t\tvalue={ isManual }\n\t\t\tonChange={ onChangeType }\n\t\t\tisBlock\n\t\t>\n\t\t\t<ToggleGroupControlOption\n\t\t\t\tkey=\"auto\"\n\t\t\t\tvalue=\"auto\"\n\t\t\t\tlabel={ __( 'Auto' ) }\n\t\t\t/>\n\t\t\t<ToggleGroupControlOption\n\t\t\t\tkey=\"manual\"\n\t\t\t\tvalue=\"manual\"\n\t\t\t\tlabel={ __( 'Manual' ) }\n\t\t\t/>\n\t\t</ToggleGroupControl>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA;AAWA,IAAAE,QAAA,GAAAF,OAAA;AAKA,IAAAG,MAAA,GAAAH,OAAA;A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IAClB5E,QAAQ,EAAG6E,YAAc;IACzBpB,OAAO;IAAApD,QAAA,gBAEP,IAAA7C,WAAA,CAAA8C,GAAA,EAACrD,WAAA,CAAA+H,sCAAwB;MAExB1F,KAAK,EAAC,MAAM;MACZC,KAAK,EAAG,IAAAK,QAAE,EAAE,MAAO;IAAG,GAFlB,MAGJ,CAAC,eACF,IAAApC,WAAA,CAAA8C,GAAA,EAACrD,WAAA,CAAA+H,sCAAwB;MAExB1F,KAAK,EAAC,QAAQ;MACdC,KAAK,EAAG,IAAAK,QAAE,EAAE,QAAS;IAAG,GAFpB,QAGJ,CAAC;EAAA,CACiB,CAAC;AAEvB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_i18n","require","_components","_element","_utils","_gap","_utils2","_definitions","_grid","_jsxRuntime","RANGE_CONTROL_MAX_VALUES","px","vw","vh","em","rem","svw","lvw","dvw","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax","units","value","label","default","_default","exports","name","__","inspectorControls","GridLayoutInspectorControls","layout","onChange","layoutBlockSupport","allowSizingOnChildren","jsxs","Fragment","children","jsx","GridLayoutTypeControl","columnCount","GridLayoutColumnsAndRowsControl","GridLayoutMinimumWidthControl","toolBarControls","GridLayoutToolbarControls","clientId","window","__experimentalEnableGridInteractivity","GridLayoutSync","GridVisualizer","getLayoutStyle","selector","style","blockName","hasBlockGapSupport","layoutDefinitions","LAYOUT_DEFINITIONS","minimumColumnWidth","rowCount","blockGapValue","spacing","blockGap","shouldSkipSerialization","getGapCSSValue","undefined","output","rules","push","length","appendSelectors","join","getBlockGapCSS","getOrientation","getAlignments","quantity","unit","parseQuantityAndUnitFromRawValue","handleSliderChange","next","handleUnitChange","newUnit","newValue","includes","toFixed","Math","round","BaseControl","VisualLabel","as","Flex","gap","FlexItem","isBlock","__experimentalUnitControl","size","onUnitChange","min","hideLabelFromVision","RangeControl","max","withInputField","__experimentalNumberControl","validValue","parseInt","tempColumnCount","setTempColumnCount","useState","tempMinimumColumnWidth","setTempMinimumColumnWidth","isManual","onChangeType","__experimentalToggleGroupControl","__nextHasNoMarginBottom","help","__experimentalToggleGroupControlOption","props","useGridLayoutSync"],"sources":["@wordpress/block-editor/src/layouts/grid.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\nimport {\n\tBaseControl,\n\tFlex,\n\tFlexItem,\n\tRangeControl,\n\t__experimentalNumberControl as NumberControl,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue,\n} from '@wordpress/components';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { appendSelectors, getBlockGapCSS } from './utils';\nimport { getGapCSSValue } from '../hooks/gap';\nimport { shouldSkipSerialization } from '../hooks/utils';\nimport { LAYOUT_DEFINITIONS } from './definitions';\nimport { GridVisualizer, useGridLayoutSync } from '../components/grid';\n\nconst RANGE_CONTROL_MAX_VALUES = {\n\tpx: 600,\n\t'%': 100,\n\tvw: 100,\n\tvh: 100,\n\tem: 38,\n\trem: 38,\n\tsvw: 100,\n\tlvw: 100,\n\tdvw: 100,\n\tsvh: 100,\n\tlvh: 100,\n\tdvh: 100,\n\tvi: 100,\n\tsvi: 100,\n\tlvi: 100,\n\tdvi: 100,\n\tvb: 100,\n\tsvb: 100,\n\tlvb: 100,\n\tdvb: 100,\n\tvmin: 100,\n\tsvmin: 100,\n\tlvmin: 100,\n\tdvmin: 100,\n\tvmax: 100,\n\tsvmax: 100,\n\tlvmax: 100,\n\tdvmax: 100,\n};\n\nconst units = [\n\t{ value: 'px', label: 'px', default: 0 },\n\t{ value: 'rem', label: 'rem', default: 0 },\n\t{ value: 'em', label: 'em', default: 0 },\n];\n\nexport default {\n\tname: 'grid',\n\tlabel: __( 'Grid' ),\n\tinspectorControls: function GridLayoutInspectorControls( {\n\t\tlayout = {},\n\t\tonChange,\n\t\tlayoutBlockSupport = {},\n\t} ) {\n\t\tconst { allowSizingOnChildren = false } = layoutBlockSupport;\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<GridLayoutTypeControl\n\t\t\t\t\tlayout={ layout }\n\t\t\t\t\tonChange={ onChange }\n\t\t\t\t/>\n\t\t\t\t{ layout?.columnCount ? (\n\t\t\t\t\t<GridLayoutColumnsAndRowsControl\n\t\t\t\t\t\tlayout={ layout }\n\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\tallowSizingOnChildren={ allowSizingOnChildren }\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<GridLayoutMinimumWidthControl\n\t\t\t\t\t\tlayout={ layout }\n\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t},\n\ttoolBarControls: function GridLayoutToolbarControls( { clientId } ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ window.__experimentalEnableGridInteractivity && (\n\t\t\t\t\t<GridLayoutSync clientId={ clientId } />\n\t\t\t\t) }\n\t\t\t\t<GridVisualizer clientId={ clientId } />\n\t\t\t</>\n\t\t);\n\t},\n\tgetLayoutStyle: function getLayoutStyle( {\n\t\tselector,\n\t\tlayout,\n\t\tstyle,\n\t\tblockName,\n\t\thasBlockGapSupport,\n\t\tlayoutDefinitions = LAYOUT_DEFINITIONS,\n\t} ) {\n\t\tconst {\n\t\t\tminimumColumnWidth = '12rem',\n\t\t\tcolumnCount = null,\n\t\t\trowCount = null,\n\t\t} = layout;\n\n\t\t// If a block's block.json skips serialization for spacing or spacing.blockGap,\n\t\t// don't apply the user-defined value to the styles.\n\t\tconst blockGapValue =\n\t\t\tstyle?.spacing?.blockGap &&\n\t\t\t! shouldSkipSerialization( blockName, 'spacing', 'blockGap' )\n\t\t\t\t? getGapCSSValue( style?.spacing?.blockGap, '0.5em' )\n\t\t\t\t: undefined;\n\n\t\tlet output = '';\n\t\tconst rules = [];\n\n\t\tif ( columnCount ) {\n\t\t\trules.push(\n\t\t\t\t`grid-template-columns: repeat(${ columnCount }, minmax(0, 1fr))`\n\t\t\t);\n\t\t\tif ( rowCount ) {\n\t\t\t\trules.push(\n\t\t\t\t\t`grid-template-rows: repeat(${ rowCount }, minmax(0, 1fr))`\n\t\t\t\t);\n\t\t\t}\n\t\t} else if ( minimumColumnWidth ) {\n\t\t\trules.push(\n\t\t\t\t`grid-template-columns: repeat(auto-fill, minmax(min(${ minimumColumnWidth }, 100%), 1fr))`,\n\t\t\t\t'container-type: inline-size'\n\t\t\t);\n\t\t}\n\n\t\tif ( rules.length ) {\n\t\t\t// Reason to disable: the extra line breaks added by prettier mess with the unit tests.\n\t\t\t// eslint-disable-next-line prettier/prettier\n\t\t\toutput = `${ appendSelectors( selector ) } { ${ rules.join(\n\t\t\t\t'; '\n\t\t\t) }; }`;\n\t\t}\n\n\t\t// Output blockGap styles based on rules contained in layout definitions in theme.json.\n\t\tif ( hasBlockGapSupport && blockGapValue ) {\n\t\t\toutput += getBlockGapCSS(\n\t\t\t\tselector,\n\t\t\t\tlayoutDefinitions,\n\t\t\t\t'grid',\n\t\t\t\tblockGapValue\n\t\t\t);\n\t\t}\n\t\treturn output;\n\t},\n\tgetOrientation() {\n\t\treturn 'horizontal';\n\t},\n\tgetAlignments() {\n\t\treturn [];\n\t},\n};\n\n// Enables setting minimum width of grid items.\nfunction GridLayoutMinimumWidthControl( { layout, onChange } ) {\n\tconst { minimumColumnWidth: value = '12rem' } = layout;\n\tconst [ quantity, unit ] = parseQuantityAndUnitFromRawValue( value );\n\n\tconst handleSliderChange = ( next ) => {\n\t\tonChange( {\n\t\t\t...layout,\n\t\t\tminimumColumnWidth: [ next, unit ].join( '' ),\n\t\t} );\n\t};\n\n\t// Mostly copied from HeightControl.\n\tconst handleUnitChange = ( newUnit ) => {\n\t\t// Attempt to smooth over differences between currentUnit and newUnit.\n\t\t// This should slightly improve the experience of switching between unit types.\n\t\tlet newValue;\n\n\t\tif ( [ 'em', 'rem' ].includes( newUnit ) && unit === 'px' ) {\n\t\t\t// Convert pixel value to an approximate of the new unit, assuming a root size of 16px.\n\t\t\tnewValue = ( quantity / 16 ).toFixed( 2 ) + newUnit;\n\t\t} else if ( [ 'em', 'rem' ].includes( unit ) && newUnit === 'px' ) {\n\t\t\t// Convert to pixel value assuming a root size of 16px.\n\t\t\tnewValue = Math.round( quantity * 16 ) + newUnit;\n\t\t}\n\n\t\tonChange( {\n\t\t\t...layout,\n\t\t\tminimumColumnWidth: newValue,\n\t\t} );\n\t};\n\n\treturn (\n\t\t<fieldset>\n\t\t\t<BaseControl.VisualLabel as=\"legend\">\n\t\t\t\t{ __( 'Minimum column width' ) }\n\t\t\t</BaseControl.VisualLabel>\n\t\t\t<Flex gap={ 4 }>\n\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t<UnitControl\n\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t...layout,\n\t\t\t\t\t\t\t\tminimumColumnWidth: newValue,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tonUnitChange={ handleUnitChange }\n\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\tlabel={ __( 'Minimum column width' ) }\n\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t/>\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t<RangeControl\n\t\t\t\t\t\tonChange={ handleSliderChange }\n\t\t\t\t\t\tvalue={ quantity }\n\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\tmax={ RANGE_CONTROL_MAX_VALUES[ unit ] || 600 }\n\t\t\t\t\t\twithInputField={ false }\n\t\t\t\t\t\tlabel={ __( 'Minimum column width' ) }\n\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t/>\n\t\t\t\t</FlexItem>\n\t\t\t</Flex>\n\t\t</fieldset>\n\t);\n}\n\n// Enables setting number of grid columns\nfunction GridLayoutColumnsAndRowsControl( {\n\tlayout,\n\tonChange,\n\tallowSizingOnChildren,\n} ) {\n\tconst { columnCount = 3, rowCount } = layout;\n\n\treturn (\n\t\t<>\n\t\t\t<fieldset>\n\t\t\t\t<Flex gap={ 4 }>\n\t\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t\t<NumberControl\n\t\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t * If the input is cleared, avoid switching\n\t\t\t\t\t\t\t\t * back to \"Auto\" by setting a value of \"1\".\n\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\tconst validValue = value !== '' ? value : '1';\n\t\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t\t...layout,\n\t\t\t\t\t\t\t\t\tcolumnCount: validValue,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tvalue={ columnCount }\n\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\n\t\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t\t{ window.__experimentalEnableGridInteractivity &&\n\t\t\t\t\t\tallowSizingOnChildren ? (\n\t\t\t\t\t\t\t<NumberControl\n\t\t\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t\t\t...layout,\n\t\t\t\t\t\t\t\t\t\trowCount: value,\n\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tvalue={ rowCount }\n\t\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\t\tlabel={ __( 'Rows' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t\tvalue={ parseInt( columnCount, 10 ) } // RangeControl can't deal with strings.\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t\t\t...layout,\n\t\t\t\t\t\t\t\t\t\tcolumnCount: value,\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\t\tmax={ 16 }\n\t\t\t\t\t\t\t\twithInputField={ false }\n\t\t\t\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</FlexItem>\n\t\t\t\t</Flex>\n\t\t\t</fieldset>\n\t\t</>\n\t);\n}\n\n// Enables switching between grid types\nfunction GridLayoutTypeControl( { layout, onChange } ) {\n\tconst { columnCount, minimumColumnWidth } = layout;\n\n\t/**\n\t * When switching, temporarily save any custom values set on the\n\t * previous type so we can switch back without loss.\n\t */\n\tconst [ tempColumnCount, setTempColumnCount ] = useState(\n\t\tcolumnCount || 3\n\t);\n\tconst [ tempMinimumColumnWidth, setTempMinimumColumnWidth ] = useState(\n\t\tminimumColumnWidth || '12rem'\n\t);\n\n\tconst isManual = !! columnCount ? 'manual' : 'auto';\n\n\tconst onChangeType = ( value ) => {\n\t\tif ( value === 'manual' ) {\n\t\t\tsetTempMinimumColumnWidth( minimumColumnWidth || '12rem' );\n\t\t} else {\n\t\t\tsetTempColumnCount( columnCount || 3 );\n\t\t}\n\t\tonChange( {\n\t\t\t...layout,\n\t\t\tcolumnCount: value === 'manual' ? tempColumnCount : null,\n\t\t\tminimumColumnWidth:\n\t\t\t\tvalue === 'auto' ? tempMinimumColumnWidth : null,\n\t\t} );\n\t};\n\n\treturn (\n\t\t<ToggleGroupControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\tlabel={ __( 'Grid item position' ) }\n\t\t\tvalue={ isManual }\n\t\t\tonChange={ onChangeType }\n\t\t\tisBlock\n\t\t\thelp={\n\t\t\t\tisManual === 'manual'\n\t\t\t\t\t? __(\n\t\t\t\t\t\t\t'Grid items can be manually placed in any position on the grid.'\n\t\t\t\t\t )\n\t\t\t\t\t: __(\n\t\t\t\t\t\t\t'Grid items are placed automatically depending on their order.'\n\t\t\t\t\t )\n\t\t\t}\n\t\t>\n\t\t\t<ToggleGroupControlOption\n\t\t\t\tkey=\"auto\"\n\t\t\t\tvalue=\"auto\"\n\t\t\t\tlabel={ __( 'Auto' ) }\n\t\t\t/>\n\t\t\t<ToggleGroupControlOption\n\t\t\t\tkey=\"manual\"\n\t\t\t\tvalue=\"manual\"\n\t\t\t\tlabel={ __( 'Manual' ) }\n\t\t\t/>\n\t\t</ToggleGroupControl>\n\t);\n}\n\nfunction GridLayoutSync( props ) {\n\tuseGridLayoutSync( props );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA;AAWA,IAAAE,QAAA,GAAAF,OAAA;AAKA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AAAuE,IAAAQ,WAAA,GAAAR,OAAA;AAzBvE;AACA;AACA;;AAgBA;AACA;AACA;;AAOA,MAAMS,wBAAwB,GAAG;EAChCC,EAAE,EAAE,GAAG;EACP,GAAG,EAAE,GAAG;EACRC,EAAE,EAAE,GAAG;EACPC,E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YAAc;IACzBlB,OAAO;IACPqB,IAAI,EACHJ,QAAQ,KAAK,QAAQ,GAClB,IAAAjF,QAAE,EACF,gEACA,CAAC,GACD,IAAAA,QAAE,EACF,+DACA,CACH;IAAAS,QAAA,gBAED,IAAA7C,WAAA,CAAA8C,GAAA,EAACrD,WAAA,CAAAiI,sCAAwB;MAExB5F,KAAK,EAAC,MAAM;MACZC,KAAK,EAAG,IAAAK,QAAE,EAAE,MAAO;IAAG,GAFlB,MAGJ,CAAC,eACF,IAAApC,WAAA,CAAA8C,GAAA,EAACrD,WAAA,CAAAiI,sCAAwB;MAExB5F,KAAK,EAAC,QAAQ;MACdC,KAAK,EAAG,IAAAK,QAAE,EAAE,QAAS;IAAG,GAFpB,QAGJ,CAAC;EAAA,CACiB,CAAC;AAEvB;AAEA,SAASoB,cAAcA,CAAEmE,KAAK,EAAG;EAChC,IAAAC,uBAAiB,EAAED,KAAM,CAAC;AAC3B","ignoreList":[]}
|
package/build/lock-unlock.js
CHANGED
|
@@ -12,7 +12,7 @@ var _privateApis = require("@wordpress/private-apis");
|
|
|
12
12
|
const {
|
|
13
13
|
lock,
|
|
14
14
|
unlock
|
|
15
|
-
} = (0, _privateApis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I
|
|
15
|
+
} = (0, _privateApis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/block-editor');
|
|
16
16
|
exports.unlock = unlock;
|
|
17
17
|
exports.lock = lock;
|
|
18
18
|
//# sourceMappingURL=lock-unlock.js.map
|
package/build/lock-unlock.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_privateApis","require","lock","unlock","__dangerousOptInToUnstableAPIsOnlyForCoreModules","exports"],"sources":["@wordpress/block-editor/src/lock-unlock.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I
|
|
1
|
+
{"version":3,"names":["_privateApis","require","lock","unlock","__dangerousOptInToUnstableAPIsOnlyForCoreModules","exports"],"sources":["@wordpress/block-editor/src/lock-unlock.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.',\n\t\t'@wordpress/block-editor'\n\t);\n"],"mappings":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGO,MAAM;EAAEC,IAAI;EAAEC;AAAO,CAAC,GAC5B,IAAAC,6DAAgD,EAC/C,+HAA+H,EAC/H,yBACD,CAAC;AAACC,OAAA,CAAAF,MAAA,GAAAA,MAAA;AAAAE,OAAA,CAAAH,IAAA,GAAAA,IAAA","ignoreList":[]}
|