@wordpress/block-editor 13.0.3 → 13.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -17
- package/README.md +1 -1
- package/build/components/block-lock/modal.js +67 -67
- package/build/components/block-lock/modal.js.map +1 -1
- package/build/components/block-mover/index.js +12 -6
- package/build/components/block-mover/index.js.map +1 -1
- package/build/components/child-layout-control/index.js +185 -127
- package/build/components/child-layout-control/index.js.map +1 -1
- package/build/components/date-format-picker/index.js +18 -10
- package/build/components/date-format-picker/index.js.map +1 -1
- package/build/components/grid/grid-item-movers.js +97 -0
- package/build/components/grid/grid-item-movers.js.map +1 -0
- package/build/components/{grid-visualizer → grid}/grid-item-resizer.js +18 -56
- package/build/components/grid/grid-item-resizer.js.map +1 -0
- package/build/components/grid/grid-visualizer.js +225 -0
- package/build/components/grid/grid-visualizer.js.map +1 -0
- package/build/components/{grid-visualizer → grid}/index.js +14 -0
- package/build/components/grid/index.js.map +1 -0
- package/build/components/grid/use-get-number-of-blocks-before-cell.js +40 -0
- package/build/components/grid/use-get-number-of-blocks-before-cell.js.map +1 -0
- package/build/components/grid/use-grid-layout-sync.js +162 -0
- package/build/components/grid/use-grid-layout-sync.js.map +1 -0
- package/build/components/grid/utils.js +145 -0
- package/build/components/grid/utils.js.map +1 -0
- package/build/components/inner-blocks/index.js +1 -1
- package/build/components/inner-blocks/index.js.map +1 -1
- package/build/components/inserter/block-types-tab.native.js +1 -1
- package/build/components/inserter/block-types-tab.native.js.map +1 -1
- package/build/components/link-control/link-preview.js +12 -1
- package/build/components/link-control/link-preview.js.map +1 -1
- package/build/components/provider/use-block-sync.js +1 -7
- package/build/components/provider/use-block-sync.js.map +1 -1
- package/build/components/rich-text/event-listeners/input-rules.js +1 -0
- package/build/components/rich-text/event-listeners/input-rules.js.map +1 -1
- package/build/components/rich-text/index.native.js +14 -4
- package/build/components/rich-text/index.native.js.map +1 -1
- package/build/components/rich-text/native/index.native.js +20 -4
- package/build/components/rich-text/native/index.native.js.map +1 -1
- package/build/hooks/block-style-variation.js +2 -2
- package/build/hooks/block-style-variation.js.map +1 -1
- package/build/hooks/layout-child.js +29 -21
- package/build/hooks/layout-child.js.map +1 -1
- package/build/layouts/grid.js +24 -47
- package/build/layouts/grid.js.map +1 -1
- package/build/store/private-actions.js +0 -34
- package/build/store/private-actions.js.map +1 -1
- package/build-module/components/block-lock/modal.js +67 -67
- package/build-module/components/block-lock/modal.js.map +1 -1
- package/build-module/components/block-mover/index.js +12 -6
- package/build-module/components/block-mover/index.js.map +1 -1
- package/build-module/components/child-layout-control/index.js +185 -127
- package/build-module/components/child-layout-control/index.js.map +1 -1
- package/build-module/components/date-format-picker/index.js +19 -11
- package/build-module/components/date-format-picker/index.js.map +1 -1
- package/build-module/components/grid/grid-item-movers.js +90 -0
- package/build-module/components/grid/grid-item-movers.js.map +1 -0
- package/build-module/components/{grid-visualizer → grid}/grid-item-resizer.js +13 -51
- package/build-module/components/grid/grid-item-resizer.js.map +1 -0
- package/build-module/components/grid/grid-visualizer.js +217 -0
- package/build-module/components/grid/grid-visualizer.js.map +1 -0
- package/build-module/components/grid/index.js +5 -0
- package/build-module/components/grid/index.js.map +1 -0
- package/build-module/components/grid/use-get-number-of-blocks-before-cell.js +33 -0
- package/build-module/components/grid/use-get-number-of-blocks-before-cell.js.map +1 -0
- package/build-module/components/grid/use-grid-layout-sync.js +155 -0
- package/build-module/components/grid/use-grid-layout-sync.js.map +1 -0
- package/build-module/components/grid/utils.js +131 -0
- package/build-module/components/grid/utils.js.map +1 -0
- package/build-module/components/inner-blocks/index.js +1 -1
- package/build-module/components/inner-blocks/index.js.map +1 -1
- package/build-module/components/inserter/block-types-tab.native.js +1 -1
- package/build-module/components/inserter/block-types-tab.native.js.map +1 -1
- package/build-module/components/link-control/link-preview.js +14 -1
- package/build-module/components/link-control/link-preview.js.map +1 -1
- package/build-module/components/provider/use-block-sync.js +1 -7
- package/build-module/components/provider/use-block-sync.js.map +1 -1
- package/build-module/components/rich-text/event-listeners/input-rules.js +1 -1
- package/build-module/components/rich-text/event-listeners/input-rules.js.map +1 -1
- package/build-module/components/rich-text/index.native.js +15 -5
- package/build-module/components/rich-text/index.native.js.map +1 -1
- package/build-module/components/rich-text/native/index.native.js +20 -4
- package/build-module/components/rich-text/native/index.native.js.map +1 -1
- package/build-module/hooks/block-style-variation.js +2 -2
- package/build-module/hooks/block-style-variation.js.map +1 -1
- package/build-module/hooks/layout-child.js +27 -19
- package/build-module/hooks/layout-child.js.map +1 -1
- package/build-module/layouts/grid.js +24 -47
- package/build-module/layouts/grid.js.map +1 -1
- package/build-module/store/private-actions.js +0 -33
- package/build-module/store/private-actions.js.map +1 -1
- package/build-style/style-rtl.css +38 -16
- package/build-style/style.css +38 -16
- package/package.json +31 -31
- package/src/components/block-lock/modal.js +95 -82
- package/src/components/block-lock/style.scss +11 -1
- package/src/components/block-mover/index.js +37 -24
- package/src/components/child-layout-control/index.js +224 -159
- package/src/components/date-format-picker/index.js +25 -13
- package/src/components/grid/grid-item-movers.js +128 -0
- package/src/components/{grid-visualizer → grid}/grid-item-resizer.js +14 -52
- package/src/components/grid/grid-visualizer.js +267 -0
- package/src/components/grid/index.js +4 -0
- package/src/components/grid/style.scss +63 -0
- package/src/components/grid/use-get-number-of-blocks-before-cell.js +30 -0
- package/src/components/grid/use-grid-layout-sync.js +167 -0
- package/src/components/grid/utils.js +178 -0
- package/src/components/inner-blocks/index.js +3 -1
- package/src/components/inserter/block-types-tab.native.js +2 -1
- package/src/components/link-control/link-preview.js +18 -1
- package/src/components/provider/use-block-sync.js +0 -6
- package/src/components/rich-text/event-listeners/input-rules.js +1 -1
- package/src/components/rich-text/index.native.js +14 -8
- package/src/components/rich-text/native/index.native.js +20 -1
- package/src/hooks/block-style-variation.js +2 -2
- package/src/hooks/layout-child.js +34 -14
- package/src/layouts/grid.js +54 -62
- package/src/store/private-actions.js +0 -29
- package/src/style.scss +1 -1
- package/build/components/grid-visualizer/grid-item-resizer.js.map +0 -1
- package/build/components/grid-visualizer/grid-visualizer.js +0 -92
- package/build/components/grid-visualizer/grid-visualizer.js.map +0 -1
- package/build/components/grid-visualizer/index.js.map +0 -1
- package/build/components/grid-visualizer/utils.js +0 -10
- package/build/components/grid-visualizer/utils.js.map +0 -1
- package/build/store/undo-ignore.js +0 -11
- package/build/store/undo-ignore.js.map +0 -1
- package/build-module/components/grid-visualizer/grid-item-resizer.js.map +0 -1
- package/build-module/components/grid-visualizer/grid-visualizer.js +0 -84
- package/build-module/components/grid-visualizer/grid-visualizer.js.map +0 -1
- package/build-module/components/grid-visualizer/index.js +0 -3
- package/build-module/components/grid-visualizer/index.js.map +0 -1
- package/build-module/components/grid-visualizer/utils.js +0 -4
- package/build-module/components/grid-visualizer/utils.js.map +0 -1
- package/build-module/store/undo-ignore.js +0 -5
- package/build-module/store/undo-ignore.js.map +0 -1
- package/src/components/grid-visualizer/grid-visualizer.js +0 -101
- package/src/components/grid-visualizer/index.js +0 -2
- package/src/components/grid-visualizer/style.scss +0 -34
- package/src/components/grid-visualizer/utils.js +0 -5
- package/src/store/undo-ignore.js +0 -4
- /package/src/components/font-sizes/{README.MD → README.md} +0 -0
|
@@ -8,11 +8,18 @@ exports.default = ChildLayoutControl;
|
|
|
8
8
|
var _components = require("@wordpress/components");
|
|
9
9
|
var _i18n = require("@wordpress/i18n");
|
|
10
10
|
var _element = require("@wordpress/element");
|
|
11
|
+
var _data = require("@wordpress/data");
|
|
12
|
+
var _useGetNumberOfBlocksBeforeCell = require("../grid/use-get-number-of-blocks-before-cell");
|
|
13
|
+
var _store = require("../../store");
|
|
11
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
15
|
/**
|
|
13
16
|
* WordPress dependencies
|
|
14
17
|
*/
|
|
15
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Internal dependencies
|
|
21
|
+
*/
|
|
22
|
+
|
|
16
23
|
function helpText(selfStretch, parentLayout) {
|
|
17
24
|
const {
|
|
18
25
|
orientation = 'horizontal'
|
|
@@ -47,22 +54,46 @@ function ChildLayoutControl({
|
|
|
47
54
|
isShownByDefault,
|
|
48
55
|
panelId
|
|
49
56
|
}) {
|
|
50
|
-
const {
|
|
51
|
-
selfStretch,
|
|
52
|
-
flexSize,
|
|
53
|
-
columnStart,
|
|
54
|
-
rowStart,
|
|
55
|
-
columnSpan,
|
|
56
|
-
rowSpan
|
|
57
|
-
} = childLayout;
|
|
58
57
|
const {
|
|
59
58
|
type: parentType,
|
|
60
59
|
default: {
|
|
61
60
|
type: defaultParentType = 'default'
|
|
62
|
-
} = {}
|
|
63
|
-
orientation = 'horizontal'
|
|
61
|
+
} = {}
|
|
64
62
|
} = parentLayout !== null && parentLayout !== void 0 ? parentLayout : {};
|
|
65
63
|
const parentLayoutType = parentType || defaultParentType;
|
|
64
|
+
if (parentLayoutType === 'flex') {
|
|
65
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(FlexControls, {
|
|
66
|
+
childLayout: childLayout,
|
|
67
|
+
onChange: onChange,
|
|
68
|
+
parentLayout: parentLayout,
|
|
69
|
+
isShownByDefault: isShownByDefault,
|
|
70
|
+
panelId: panelId
|
|
71
|
+
});
|
|
72
|
+
} else if (parentLayoutType === 'grid') {
|
|
73
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(GridControls, {
|
|
74
|
+
childLayout: childLayout,
|
|
75
|
+
onChange: onChange,
|
|
76
|
+
parentLayout: parentLayout,
|
|
77
|
+
isShownByDefault: isShownByDefault,
|
|
78
|
+
panelId: panelId
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
function FlexControls({
|
|
84
|
+
childLayout,
|
|
85
|
+
onChange,
|
|
86
|
+
parentLayout,
|
|
87
|
+
isShownByDefault,
|
|
88
|
+
panelId
|
|
89
|
+
}) {
|
|
90
|
+
const {
|
|
91
|
+
selfStretch,
|
|
92
|
+
flexSize
|
|
93
|
+
} = childLayout;
|
|
94
|
+
const {
|
|
95
|
+
orientation = 'horizontal'
|
|
96
|
+
} = parentLayout !== null && parentLayout !== void 0 ? parentLayout : {};
|
|
66
97
|
const hasFlexValue = () => !!selfStretch;
|
|
67
98
|
const flexResetLabel = orientation === 'horizontal' ? (0, _i18n.__)('Width') : (0, _i18n.__)('Height');
|
|
68
99
|
const resetFlex = () => {
|
|
@@ -71,6 +102,87 @@ function ChildLayoutControl({
|
|
|
71
102
|
flexSize: undefined
|
|
72
103
|
});
|
|
73
104
|
};
|
|
105
|
+
(0, _element.useEffect)(() => {
|
|
106
|
+
if (selfStretch === 'fixed' && !flexSize) {
|
|
107
|
+
onChange({
|
|
108
|
+
...childLayout,
|
|
109
|
+
selfStretch: 'fit'
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
}, []);
|
|
113
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalVStack, {
|
|
114
|
+
as: _components.__experimentalToolsPanelItem,
|
|
115
|
+
spacing: 2,
|
|
116
|
+
hasValue: hasFlexValue,
|
|
117
|
+
label: flexResetLabel,
|
|
118
|
+
onDeselect: resetFlex,
|
|
119
|
+
isShownByDefault: isShownByDefault,
|
|
120
|
+
panelId: panelId,
|
|
121
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalToggleGroupControl, {
|
|
122
|
+
__nextHasNoMarginBottom: true,
|
|
123
|
+
size: "__unstable-large",
|
|
124
|
+
label: childLayoutOrientation(parentLayout),
|
|
125
|
+
value: selfStretch || 'fit',
|
|
126
|
+
help: helpText(selfStretch, parentLayout),
|
|
127
|
+
onChange: value => {
|
|
128
|
+
const newFlexSize = value !== 'fixed' ? null : flexSize;
|
|
129
|
+
onChange({
|
|
130
|
+
selfStretch: value,
|
|
131
|
+
flexSize: newFlexSize
|
|
132
|
+
});
|
|
133
|
+
},
|
|
134
|
+
isBlock: true,
|
|
135
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToggleGroupControlOption, {
|
|
136
|
+
value: "fit",
|
|
137
|
+
label: (0, _i18n.__)('Fit')
|
|
138
|
+
}, "fit"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToggleGroupControlOption, {
|
|
139
|
+
value: "fill",
|
|
140
|
+
label: (0, _i18n.__)('Fill')
|
|
141
|
+
}, "fill"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToggleGroupControlOption, {
|
|
142
|
+
value: "fixed",
|
|
143
|
+
label: (0, _i18n.__)('Fixed')
|
|
144
|
+
}, "fixed")]
|
|
145
|
+
}), selfStretch === 'fixed' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalUnitControl, {
|
|
146
|
+
size: "__unstable-large",
|
|
147
|
+
onChange: value => {
|
|
148
|
+
onChange({
|
|
149
|
+
selfStretch,
|
|
150
|
+
flexSize: value
|
|
151
|
+
});
|
|
152
|
+
},
|
|
153
|
+
value: flexSize
|
|
154
|
+
})]
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
function childLayoutOrientation(parentLayout) {
|
|
158
|
+
const {
|
|
159
|
+
orientation = 'horizontal'
|
|
160
|
+
} = parentLayout;
|
|
161
|
+
return orientation === 'horizontal' ? (0, _i18n.__)('Width') : (0, _i18n.__)('Height');
|
|
162
|
+
}
|
|
163
|
+
function GridControls({
|
|
164
|
+
childLayout,
|
|
165
|
+
onChange,
|
|
166
|
+
parentLayout,
|
|
167
|
+
isShownByDefault,
|
|
168
|
+
panelId
|
|
169
|
+
}) {
|
|
170
|
+
const {
|
|
171
|
+
columnStart,
|
|
172
|
+
rowStart,
|
|
173
|
+
columnSpan,
|
|
174
|
+
rowSpan
|
|
175
|
+
} = childLayout;
|
|
176
|
+
const {
|
|
177
|
+
columnCount
|
|
178
|
+
} = parentLayout !== null && parentLayout !== void 0 ? parentLayout : {};
|
|
179
|
+
const gridColumnNumber = parseInt(columnCount, 10) || 3;
|
|
180
|
+
const rootClientId = (0, _data.useSelect)(select => select(_store.store).getBlockRootClientId(panelId));
|
|
181
|
+
const {
|
|
182
|
+
moveBlocksToPosition,
|
|
183
|
+
__unstableMarkNextChangeAsNotPersistent
|
|
184
|
+
} = (0, _data.useDispatch)(_store.store);
|
|
185
|
+
const getNumberOfBlocksBeforeCell = (0, _useGetNumberOfBlocksBeforeCell.useGetNumberOfBlocksBeforeCell)(rootClientId, gridColumnNumber);
|
|
74
186
|
const hasStartValue = () => !!columnStart || !!rowStart;
|
|
75
187
|
const hasSpanValue = () => !!columnSpan || !!rowSpan;
|
|
76
188
|
const resetGridStarts = () => {
|
|
@@ -85,155 +197,101 @@ function ChildLayoutControl({
|
|
|
85
197
|
rowSpan: undefined
|
|
86
198
|
});
|
|
87
199
|
};
|
|
88
|
-
(0, _element.useEffect)(() => {
|
|
89
|
-
if (selfStretch === 'fixed' && !flexSize) {
|
|
90
|
-
onChange({
|
|
91
|
-
...childLayout,
|
|
92
|
-
selfStretch: 'fit'
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
}, []);
|
|
96
200
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
97
|
-
children: [
|
|
201
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalHStack, {
|
|
98
202
|
as: _components.__experimentalToolsPanelItem,
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
onDeselect: resetFlex,
|
|
203
|
+
hasValue: hasSpanValue,
|
|
204
|
+
label: (0, _i18n.__)('Grid span'),
|
|
205
|
+
onDeselect: resetGridSpans,
|
|
103
206
|
isShownByDefault: isShownByDefault,
|
|
104
207
|
panelId: panelId,
|
|
105
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.
|
|
106
|
-
__nextHasNoMarginBottom: true,
|
|
208
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalInputControl, {
|
|
107
209
|
size: "__unstable-large",
|
|
108
|
-
label:
|
|
109
|
-
|
|
110
|
-
help: helpText(selfStretch, parentLayout),
|
|
210
|
+
label: (0, _i18n.__)('Column span'),
|
|
211
|
+
type: "number",
|
|
111
212
|
onChange: value => {
|
|
112
|
-
const newFlexSize = value !== 'fixed' ? null : flexSize;
|
|
113
213
|
onChange({
|
|
114
|
-
|
|
115
|
-
|
|
214
|
+
columnStart,
|
|
215
|
+
rowStart,
|
|
216
|
+
rowSpan,
|
|
217
|
+
columnSpan: value
|
|
116
218
|
});
|
|
117
219
|
},
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
label: (0, _i18n.__)('Fit')
|
|
122
|
-
}, "fit"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToggleGroupControlOption, {
|
|
123
|
-
value: "fill",
|
|
124
|
-
label: (0, _i18n.__)('Fill')
|
|
125
|
-
}, "fill"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToggleGroupControlOption, {
|
|
126
|
-
value: "fixed",
|
|
127
|
-
label: (0, _i18n.__)('Fixed')
|
|
128
|
-
}, "fixed")]
|
|
129
|
-
}), selfStretch === 'fixed' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalUnitControl, {
|
|
220
|
+
value: columnSpan,
|
|
221
|
+
min: 1
|
|
222
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalInputControl, {
|
|
130
223
|
size: "__unstable-large",
|
|
224
|
+
label: (0, _i18n.__)('Row span'),
|
|
225
|
+
type: "number",
|
|
131
226
|
onChange: value => {
|
|
132
227
|
onChange({
|
|
133
|
-
|
|
134
|
-
|
|
228
|
+
columnStart,
|
|
229
|
+
rowStart,
|
|
230
|
+
columnSpan,
|
|
231
|
+
rowSpan: value
|
|
135
232
|
});
|
|
136
233
|
},
|
|
137
|
-
value:
|
|
234
|
+
value: rowSpan,
|
|
235
|
+
min: 1
|
|
138
236
|
})]
|
|
139
|
-
}),
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
237
|
+
}), window.__experimentalEnableGridInteractivity && columnCount &&
|
|
238
|
+
/*#__PURE__*/
|
|
239
|
+
// Use Flex with an explicit width on the FlexItem instead of HStack to
|
|
240
|
+
// work around an issue in webkit where inputs with a max attribute are
|
|
241
|
+
// sized incorrectly.
|
|
242
|
+
(0, _jsxRuntime.jsxs)(_components.Flex, {
|
|
243
|
+
as: _components.__experimentalToolsPanelItem,
|
|
244
|
+
hasValue: hasStartValue,
|
|
245
|
+
label: (0, _i18n.__)('Grid placement'),
|
|
246
|
+
onDeselect: resetGridStarts,
|
|
247
|
+
isShownByDefault: false,
|
|
248
|
+
panelId: panelId,
|
|
249
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.FlexItem, {
|
|
250
|
+
style: {
|
|
251
|
+
width: '50%'
|
|
252
|
+
},
|
|
253
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalInputControl, {
|
|
148
254
|
size: "__unstable-large",
|
|
149
|
-
label: (0, _i18n.__)('Column
|
|
255
|
+
label: (0, _i18n.__)('Column'),
|
|
150
256
|
type: "number",
|
|
151
257
|
onChange: value => {
|
|
152
258
|
onChange({
|
|
153
|
-
columnStart,
|
|
259
|
+
columnStart: value,
|
|
154
260
|
rowStart,
|
|
155
|
-
|
|
156
|
-
|
|
261
|
+
columnSpan,
|
|
262
|
+
rowSpan
|
|
157
263
|
});
|
|
264
|
+
__unstableMarkNextChangeAsNotPersistent();
|
|
265
|
+
moveBlocksToPosition([panelId], rootClientId, rootClientId, getNumberOfBlocksBeforeCell(value, rowStart));
|
|
158
266
|
},
|
|
159
|
-
value:
|
|
160
|
-
min: 1
|
|
161
|
-
|
|
267
|
+
value: columnStart,
|
|
268
|
+
min: 1,
|
|
269
|
+
max: gridColumnNumber ? gridColumnNumber - (columnSpan !== null && columnSpan !== void 0 ? columnSpan : 1) + 1 : undefined
|
|
270
|
+
})
|
|
271
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.FlexItem, {
|
|
272
|
+
style: {
|
|
273
|
+
width: '50%'
|
|
274
|
+
},
|
|
275
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalInputControl, {
|
|
162
276
|
size: "__unstable-large",
|
|
163
|
-
label: (0, _i18n.__)('Row
|
|
277
|
+
label: (0, _i18n.__)('Row'),
|
|
164
278
|
type: "number",
|
|
165
279
|
onChange: value => {
|
|
166
280
|
onChange({
|
|
167
281
|
columnStart,
|
|
168
|
-
rowStart,
|
|
282
|
+
rowStart: value,
|
|
169
283
|
columnSpan,
|
|
170
|
-
rowSpan
|
|
284
|
+
rowSpan
|
|
171
285
|
});
|
|
286
|
+
__unstableMarkNextChangeAsNotPersistent();
|
|
287
|
+
moveBlocksToPosition([panelId], rootClientId, rootClientId, getNumberOfBlocksBeforeCell(columnStart, value));
|
|
172
288
|
},
|
|
173
|
-
value:
|
|
174
|
-
min: 1
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
/*#__PURE__*/
|
|
178
|
-
// Use Flex with an explicit width on the FlexItem instead of HStack to
|
|
179
|
-
// work around an issue in webkit where inputs with a max attribute are
|
|
180
|
-
// sized incorrectly.
|
|
181
|
-
(0, _jsxRuntime.jsxs)(_components.Flex, {
|
|
182
|
-
as: _components.__experimentalToolsPanelItem,
|
|
183
|
-
hasValue: hasStartValue,
|
|
184
|
-
label: (0, _i18n.__)('Grid placement'),
|
|
185
|
-
onDeselect: resetGridStarts,
|
|
186
|
-
isShownByDefault: false,
|
|
187
|
-
panelId: panelId,
|
|
188
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.FlexItem, {
|
|
189
|
-
style: {
|
|
190
|
-
width: '50%'
|
|
191
|
-
},
|
|
192
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalInputControl, {
|
|
193
|
-
size: "__unstable-large",
|
|
194
|
-
label: (0, _i18n.__)('Column'),
|
|
195
|
-
type: "number",
|
|
196
|
-
onChange: value => {
|
|
197
|
-
onChange({
|
|
198
|
-
columnStart: value,
|
|
199
|
-
rowStart,
|
|
200
|
-
columnSpan,
|
|
201
|
-
rowSpan
|
|
202
|
-
});
|
|
203
|
-
},
|
|
204
|
-
value: columnStart,
|
|
205
|
-
min: 1,
|
|
206
|
-
max: parentLayout?.columnCount ? parentLayout.columnCount - (columnSpan !== null && columnSpan !== void 0 ? columnSpan : 1) + 1 : undefined
|
|
207
|
-
})
|
|
208
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.FlexItem, {
|
|
209
|
-
style: {
|
|
210
|
-
width: '50%'
|
|
211
|
-
},
|
|
212
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalInputControl, {
|
|
213
|
-
size: "__unstable-large",
|
|
214
|
-
label: (0, _i18n.__)('Row'),
|
|
215
|
-
type: "number",
|
|
216
|
-
onChange: value => {
|
|
217
|
-
onChange({
|
|
218
|
-
columnStart,
|
|
219
|
-
rowStart: value,
|
|
220
|
-
columnSpan,
|
|
221
|
-
rowSpan
|
|
222
|
-
});
|
|
223
|
-
},
|
|
224
|
-
value: rowStart,
|
|
225
|
-
min: 1,
|
|
226
|
-
max: parentLayout?.rowCount ? parentLayout.rowCount - (rowSpan !== null && rowSpan !== void 0 ? rowSpan : 1) + 1 : undefined
|
|
227
|
-
})
|
|
228
|
-
})]
|
|
289
|
+
value: rowStart,
|
|
290
|
+
min: 1,
|
|
291
|
+
max: parentLayout?.rowCount ? parentLayout.rowCount - (rowSpan !== null && rowSpan !== void 0 ? rowSpan : 1) + 1 : undefined
|
|
292
|
+
})
|
|
229
293
|
})]
|
|
230
294
|
})]
|
|
231
295
|
});
|
|
232
296
|
}
|
|
233
|
-
function childLayoutOrientation(parentLayout) {
|
|
234
|
-
const {
|
|
235
|
-
orientation = 'horizontal'
|
|
236
|
-
} = parentLayout;
|
|
237
|
-
return orientation === 'horizontal' ? (0, _i18n.__)('Width') : (0, _i18n.__)('Height');
|
|
238
|
-
}
|
|
239
297
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_i18n","_element","_jsxRuntime","helpText","selfStretch","parentLayout","orientation","__","ChildLayoutControl","value","childLayout","onChange","isShownByDefault","panelId","flexSize","columnStart","rowStart","columnSpan","rowSpan","type","parentType","default","defaultParentType","parentLayoutType","hasFlexValue","flexResetLabel","resetFlex","undefined","hasStartValue","hasSpanValue","resetGridStarts","resetGridSpans","useEffect","jsxs","Fragment","children","__experimentalVStack","as","ToolsPanelItem","spacing","hasValue","label","onDeselect","__experimentalToggleGroupControl","__nextHasNoMarginBottom","size","childLayoutOrientation","help","newFlexSize","isBlock","jsx","__experimentalToggleGroupControlOption","__experimentalUnitControl","__experimentalHStack","__experimentalInputControl","min","window","__experimentalEnableGridInteractivity","Flex","FlexItem","style","width","max","columnCount","rowCount"],"sources":["@wordpress/block-editor/src/components/child-layout-control/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalInputControl as InputControl,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\tFlex,\n\tFlexItem,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useEffect } from '@wordpress/element';\n\nfunction helpText( selfStretch, parentLayout ) {\n\tconst { orientation = 'horizontal' } = parentLayout;\n\n\tif ( selfStretch === 'fill' ) {\n\t\treturn __( 'Stretch to fill available space.' );\n\t}\n\tif ( selfStretch === 'fixed' && orientation === 'horizontal' ) {\n\t\treturn __( 'Specify a fixed width.' );\n\t} else if ( selfStretch === 'fixed' ) {\n\t\treturn __( 'Specify a fixed height.' );\n\t}\n\treturn __( 'Fit contents.' );\n}\n\n/**\n * Form to edit the child layout value.\n *\n * @param {Object} props Props.\n * @param {Object} props.value The child layout value.\n * @param {Function} props.onChange Function to update the child layout value.\n * @param {Object} props.parentLayout The parent layout value.\n *\n * @param {boolean} props.isShownByDefault\n * @param {string} props.panelId\n * @return {Element} child layout edit element.\n */\nexport default function ChildLayoutControl( {\n\tvalue: childLayout = {},\n\tonChange,\n\tparentLayout,\n\tisShownByDefault,\n\tpanelId,\n} ) {\n\tconst {\n\t\tselfStretch,\n\t\tflexSize,\n\t\tcolumnStart,\n\t\trowStart,\n\t\tcolumnSpan,\n\t\trowSpan,\n\t} = childLayout;\n\tconst {\n\t\ttype: parentType,\n\t\tdefault: { type: defaultParentType = 'default' } = {},\n\t\torientation = 'horizontal',\n\t} = parentLayout ?? {};\n\tconst parentLayoutType = parentType || defaultParentType;\n\n\tconst hasFlexValue = () => !! selfStretch;\n\tconst flexResetLabel =\n\t\torientation === 'horizontal' ? __( 'Width' ) : __( 'Height' );\n\tconst resetFlex = () => {\n\t\tonChange( {\n\t\t\tselfStretch: undefined,\n\t\t\tflexSize: undefined,\n\t\t} );\n\t};\n\n\tconst hasStartValue = () => !! columnStart || !! rowStart;\n\tconst hasSpanValue = () => !! columnSpan || !! rowSpan;\n\tconst resetGridStarts = () => {\n\t\tonChange( {\n\t\t\tcolumnStart: undefined,\n\t\t\trowStart: undefined,\n\t\t} );\n\t};\n\tconst resetGridSpans = () => {\n\t\tonChange( {\n\t\t\tcolumnSpan: undefined,\n\t\t\trowSpan: undefined,\n\t\t} );\n\t};\n\n\tuseEffect( () => {\n\t\tif ( selfStretch === 'fixed' && ! flexSize ) {\n\t\t\tonChange( {\n\t\t\t\t...childLayout,\n\t\t\t\tselfStretch: 'fit',\n\t\t\t} );\n\t\t}\n\t}, [] );\n\n\treturn (\n\t\t<>\n\t\t\t{ parentLayoutType === 'flex' && (\n\t\t\t\t<VStack\n\t\t\t\t\tas={ ToolsPanelItem }\n\t\t\t\t\tspacing={ 2 }\n\t\t\t\t\thasValue={ hasFlexValue }\n\t\t\t\t\tlabel={ flexResetLabel }\n\t\t\t\t\tonDeselect={ resetFlex }\n\t\t\t\t\tisShownByDefault={ isShownByDefault }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<ToggleGroupControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\tlabel={ childLayoutOrientation( parentLayout ) }\n\t\t\t\t\t\tvalue={ selfStretch || 'fit' }\n\t\t\t\t\t\thelp={ helpText( selfStretch, parentLayout ) }\n\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\tconst newFlexSize =\n\t\t\t\t\t\t\t\tvalue !== 'fixed' ? null : flexSize;\n\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\tselfStretch: value,\n\t\t\t\t\t\t\t\tflexSize: newFlexSize,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tisBlock\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tkey=\"fit\"\n\t\t\t\t\t\t\tvalue=\"fit\"\n\t\t\t\t\t\t\tlabel={ __( 'Fit' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tkey=\"fill\"\n\t\t\t\t\t\t\tvalue=\"fill\"\n\t\t\t\t\t\t\tlabel={ __( 'Fill' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tkey=\"fixed\"\n\t\t\t\t\t\t\tvalue=\"fixed\"\n\t\t\t\t\t\t\tlabel={ __( 'Fixed' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToggleGroupControl>\n\t\t\t\t\t{ selfStretch === 'fixed' && (\n\t\t\t\t\t\t<UnitControl\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\tonChange( {\n\t\t\t\t\t\t\t\t\tselfStretch,\n\t\t\t\t\t\t\t\t\tflexSize: 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\tvalue={ flexSize }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</VStack>\n\t\t\t) }\n\t\t\t{ parentLayoutType === 'grid' && (\n\t\t\t\t<>\n\t\t\t\t\t<HStack\n\t\t\t\t\t\tas={ ToolsPanelItem }\n\t\t\t\t\t\thasValue={ hasSpanValue }\n\t\t\t\t\t\tlabel={ __( 'Grid span' ) }\n\t\t\t\t\t\tonDeselect={ resetGridSpans }\n\t\t\t\t\t\tisShownByDefault={ isShownByDefault }\n\t\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t\t>\n\t\t\t\t\t\t<InputControl\n\t\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t\tlabel={ __( 'Column span' ) }\n\t\t\t\t\t\t\ttype=\"number\"\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\tcolumnStart,\n\t\t\t\t\t\t\t\t\trowStart,\n\t\t\t\t\t\t\t\t\trowSpan,\n\t\t\t\t\t\t\t\t\tcolumnSpan: 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\tvalue={ columnSpan }\n\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<InputControl\n\t\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t\tlabel={ __( 'Row span' ) }\n\t\t\t\t\t\t\ttype=\"number\"\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\tcolumnStart,\n\t\t\t\t\t\t\t\t\trowStart,\n\t\t\t\t\t\t\t\t\tcolumnSpan,\n\t\t\t\t\t\t\t\t\trowSpan: 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\tvalue={ rowSpan }\n\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</HStack>\n\t\t\t\t\t{ window.__experimentalEnableGridInteractivity && (\n\t\t\t\t\t\t// Use Flex with an explicit width on the FlexItem instead of HStack to\n\t\t\t\t\t\t// work around an issue in webkit where inputs with a max attribute are\n\t\t\t\t\t\t// sized incorrectly.\n\t\t\t\t\t\t<Flex\n\t\t\t\t\t\t\tas={ ToolsPanelItem }\n\t\t\t\t\t\t\thasValue={ hasStartValue }\n\t\t\t\t\t\t\tlabel={ __( 'Grid placement' ) }\n\t\t\t\t\t\t\tonDeselect={ resetGridStarts }\n\t\t\t\t\t\t\tisShownByDefault={ false }\n\t\t\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<FlexItem style={ { width: '50%' } }>\n\t\t\t\t\t\t\t\t<InputControl\n\t\t\t\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Column' ) }\n\t\t\t\t\t\t\t\t\ttype=\"number\"\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\tcolumnStart: value,\n\t\t\t\t\t\t\t\t\t\t\trowStart,\n\t\t\t\t\t\t\t\t\t\t\tcolumnSpan,\n\t\t\t\t\t\t\t\t\t\t\trowSpan,\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={ columnStart }\n\t\t\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\t\t\tmax={\n\t\t\t\t\t\t\t\t\t\tparentLayout?.columnCount\n\t\t\t\t\t\t\t\t\t\t\t? parentLayout.columnCount -\n\t\t\t\t\t\t\t\t\t\t\t ( columnSpan ?? 1 ) +\n\t\t\t\t\t\t\t\t\t\t\t 1\n\t\t\t\t\t\t\t\t\t\t\t: undefined\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</FlexItem>\n\t\t\t\t\t\t\t<FlexItem style={ { width: '50%' } }>\n\t\t\t\t\t\t\t\t<InputControl\n\t\t\t\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Row' ) }\n\t\t\t\t\t\t\t\t\ttype=\"number\"\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\tcolumnStart,\n\t\t\t\t\t\t\t\t\t\t\trowStart: value,\n\t\t\t\t\t\t\t\t\t\t\tcolumnSpan,\n\t\t\t\t\t\t\t\t\t\t\trowSpan,\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={ rowStart }\n\t\t\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\t\t\tmax={\n\t\t\t\t\t\t\t\t\t\tparentLayout?.rowCount\n\t\t\t\t\t\t\t\t\t\t\t? parentLayout.rowCount -\n\t\t\t\t\t\t\t\t\t\t\t ( rowSpan ?? 1 ) +\n\t\t\t\t\t\t\t\t\t\t\t 1\n\t\t\t\t\t\t\t\t\t\t\t: undefined\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</FlexItem>\n\t\t\t\t\t\t</Flex>\n\t\t\t\t\t) }\n\t\t\t\t</>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport function childLayoutOrientation( parentLayout ) {\n\tconst { orientation = 'horizontal' } = parentLayout;\n\n\treturn orientation === 'horizont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AAwD,0BAAY;YACZT,IAAI,EAAC,kBAAkB;YACvBJ,KAAK,EAAG,IAAAlC,QAAE,EAAE,KAAM,CAAG;YACrBY,IAAI,EAAC,QAAQ;YACbR,QAAQ,EAAKF,KAAK,IAAM;cACvBE,QAAQ,CAAE;gBACTI,WAAW;gBACXC,QAAQ,EAAEP,KAAK;gBACfQ,UAAU;gBACVC;cACD,CAAE,CAAC;YACJ,CAAG;YACHT,KAAK,EAAGO,QAAU;YAClBuC,GAAG,EAAG,CAAG;YACTO,GAAG,EACFzD,YAAY,EAAE2D,QAAQ,GACnB3D,YAAY,CAAC2D,QAAQ,IACnB9C,OAAO,aAAPA,OAAO,cAAPA,OAAO,GAAI,CAAC,CAAE,GAChB,CAAC,GACDS;UACH,CACD;QAAC,CACO,CAAC;MAAA,CACN,CACN;IAAA,CACA,CACF;EAAA,CACA,CAAC;AAEL;AAEO,SAASmB,sBAAsBA,CAAEzC,YAAY,EAAG;EACtD,MAAM;IAAEC,WAAW,GAAG;EAAa,CAAC,GAAGD,YAAY;EAEnD,OAAOC,WAAW,KAAK,YAAY,GAAG,IAAAC,QAAE,EAAE,OAAQ,CAAC,GAAG,IAAAA,QAAE,EAAE,QAAS,CAAC;AACrE","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_components","require","_i18n","_element","_data","_useGetNumberOfBlocksBeforeCell","_store","_jsxRuntime","helpText","selfStretch","parentLayout","orientation","__","ChildLayoutControl","value","childLayout","onChange","isShownByDefault","panelId","type","parentType","default","defaultParentType","parentLayoutType","jsx","FlexControls","GridControls","flexSize","hasFlexValue","flexResetLabel","resetFlex","undefined","useEffect","jsxs","__experimentalVStack","as","ToolsPanelItem","spacing","hasValue","label","onDeselect","children","__experimentalToggleGroupControl","__nextHasNoMarginBottom","size","childLayoutOrientation","help","newFlexSize","isBlock","__experimentalToggleGroupControlOption","__experimentalUnitControl","columnStart","rowStart","columnSpan","rowSpan","columnCount","gridColumnNumber","parseInt","rootClientId","useSelect","select","blockEditorStore","getBlockRootClientId","moveBlocksToPosition","__unstableMarkNextChangeAsNotPersistent","useDispatch","getNumberOfBlocksBeforeCell","useGetNumberOfBlocksBeforeCell","hasStartValue","hasSpanValue","resetGridStarts","resetGridSpans","Fragment","__experimentalHStack","__experimentalInputControl","min","window","__experimentalEnableGridInteractivity","Flex","FlexItem","style","width","max","rowCount"],"sources":["@wordpress/block-editor/src/components/child-layout-control/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalInputControl as InputControl,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\tFlex,\n\tFlexItem,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useEffect } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useGetNumberOfBlocksBeforeCell } from '../grid/use-get-number-of-blocks-before-cell';\nimport { store as blockEditorStore } from '../../store';\n\nfunction helpText( selfStretch, parentLayout ) {\n\tconst { orientation = 'horizontal' } = parentLayout;\n\n\tif ( selfStretch === 'fill' ) {\n\t\treturn __( 'Stretch to fill available space.' );\n\t}\n\tif ( selfStretch === 'fixed' && orientation === 'horizontal' ) {\n\t\treturn __( 'Specify a fixed width.' );\n\t} else if ( selfStretch === 'fixed' ) {\n\t\treturn __( 'Specify a fixed height.' );\n\t}\n\treturn __( 'Fit contents.' );\n}\n\n/**\n * Form to edit the child layout value.\n *\n * @param {Object} props Props.\n * @param {Object} props.value The child layout value.\n * @param {Function} props.onChange Function to update the child layout value.\n * @param {Object} props.parentLayout The parent layout value.\n *\n * @param {boolean} props.isShownByDefault\n * @param {string} props.panelId\n * @return {Element} child layout edit element.\n */\nexport default function ChildLayoutControl( {\n\tvalue: childLayout = {},\n\tonChange,\n\tparentLayout,\n\tisShownByDefault,\n\tpanelId,\n} ) {\n\tconst {\n\t\ttype: parentType,\n\t\tdefault: { type: defaultParentType = 'default' } = {},\n\t} = parentLayout ?? {};\n\tconst parentLayoutType = parentType || defaultParentType;\n\n\tif ( parentLayoutType === 'flex' ) {\n\t\treturn (\n\t\t\t<FlexControls\n\t\t\t\tchildLayout={ childLayout }\n\t\t\t\tonChange={ onChange }\n\t\t\t\tparentLayout={ parentLayout }\n\t\t\t\tisShownByDefault={ isShownByDefault }\n\t\t\t\tpanelId={ panelId }\n\t\t\t/>\n\t\t);\n\t} else if ( parentLayoutType === 'grid' ) {\n\t\treturn (\n\t\t\t<GridControls\n\t\t\t\tchildLayout={ childLayout }\n\t\t\t\tonChange={ onChange }\n\t\t\t\tparentLayout={ parentLayout }\n\t\t\t\tisShownByDefault={ isShownByDefault }\n\t\t\t\tpanelId={ panelId }\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn null;\n}\n\nfunction FlexControls( {\n\tchildLayout,\n\tonChange,\n\tparentLayout,\n\tisShownByDefault,\n\tpanelId,\n} ) {\n\tconst { selfStretch, flexSize } = childLayout;\n\tconst { orientation = 'horizontal' } = parentLayout ?? {};\n\tconst hasFlexValue = () => !! selfStretch;\n\tconst flexResetLabel =\n\t\torientation === 'horizontal' ? __( 'Width' ) : __( 'Height' );\n\tconst resetFlex = () => {\n\t\tonChange( {\n\t\t\tselfStretch: undefined,\n\t\t\tflexSize: undefined,\n\t\t} );\n\t};\n\n\tuseEffect( () => {\n\t\tif ( selfStretch === 'fixed' && ! flexSize ) {\n\t\t\tonChange( {\n\t\t\t\t...childLayout,\n\t\t\t\tselfStretch: 'fit',\n\t\t\t} );\n\t\t}\n\t}, [] );\n\n\treturn (\n\t\t<VStack\n\t\t\tas={ ToolsPanelItem }\n\t\t\tspacing={ 2 }\n\t\t\thasValue={ hasFlexValue }\n\t\t\tlabel={ flexResetLabel }\n\t\t\tonDeselect={ resetFlex }\n\t\t\tisShownByDefault={ isShownByDefault }\n\t\t\tpanelId={ panelId }\n\t\t>\n\t\t\t<ToggleGroupControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\tlabel={ childLayoutOrientation( parentLayout ) }\n\t\t\t\tvalue={ selfStretch || 'fit' }\n\t\t\t\thelp={ helpText( selfStretch, parentLayout ) }\n\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\tconst newFlexSize = value !== 'fixed' ? null : flexSize;\n\t\t\t\t\tonChange( {\n\t\t\t\t\t\tselfStretch: value,\n\t\t\t\t\t\tflexSize: newFlexSize,\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t\tisBlock\n\t\t\t>\n\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\tkey=\"fit\"\n\t\t\t\t\tvalue=\"fit\"\n\t\t\t\t\tlabel={ __( 'Fit' ) }\n\t\t\t\t/>\n\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\tkey=\"fill\"\n\t\t\t\t\tvalue=\"fill\"\n\t\t\t\t\tlabel={ __( 'Fill' ) }\n\t\t\t\t/>\n\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\tkey=\"fixed\"\n\t\t\t\t\tvalue=\"fixed\"\n\t\t\t\t\tlabel={ __( 'Fixed' ) }\n\t\t\t\t/>\n\t\t\t</ToggleGroupControl>\n\t\t\t{ selfStretch === 'fixed' && (\n\t\t\t\t<UnitControl\n\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\tselfStretch,\n\t\t\t\t\t\t\tflexSize: value,\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tvalue={ flexSize }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n\nexport function childLayoutOrientation( parentLayout ) {\n\tconst { orientation = 'horizontal' } = parentLayout;\n\treturn orientation === 'horizontal' ? __( 'Width' ) : __( 'Height' );\n}\n\nfunction GridControls( {\n\tchildLayout,\n\tonChange,\n\tparentLayout,\n\tisShownByDefault,\n\tpanelId,\n} ) {\n\tconst { columnStart, rowStart, columnSpan, rowSpan } = childLayout;\n\tconst { columnCount } = parentLayout ?? {};\n\tconst gridColumnNumber = parseInt( columnCount, 10 ) || 3;\n\tconst rootClientId = useSelect( ( select ) =>\n\t\tselect( blockEditorStore ).getBlockRootClientId( panelId )\n\t);\n\tconst { moveBlocksToPosition, __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\tconst getNumberOfBlocksBeforeCell = useGetNumberOfBlocksBeforeCell(\n\t\trootClientId,\n\t\tgridColumnNumber\n\t);\n\tconst hasStartValue = () => !! columnStart || !! rowStart;\n\tconst hasSpanValue = () => !! columnSpan || !! rowSpan;\n\tconst resetGridStarts = () => {\n\t\tonChange( {\n\t\t\tcolumnStart: undefined,\n\t\t\trowStart: undefined,\n\t\t} );\n\t};\n\tconst resetGridSpans = () => {\n\t\tonChange( {\n\t\t\tcolumnSpan: undefined,\n\t\t\trowSpan: undefined,\n\t\t} );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<HStack\n\t\t\t\tas={ ToolsPanelItem }\n\t\t\t\thasValue={ hasSpanValue }\n\t\t\t\tlabel={ __( 'Grid span' ) }\n\t\t\t\tonDeselect={ resetGridSpans }\n\t\t\t\tisShownByDefault={ isShownByDefault }\n\t\t\t\tpanelId={ panelId }\n\t\t\t>\n\t\t\t\t<InputControl\n\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\tlabel={ __( 'Column span' ) }\n\t\t\t\t\ttype=\"number\"\n\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\tcolumnStart,\n\t\t\t\t\t\t\trowStart,\n\t\t\t\t\t\t\trowSpan,\n\t\t\t\t\t\t\tcolumnSpan: value,\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tvalue={ columnSpan }\n\t\t\t\t\tmin={ 1 }\n\t\t\t\t/>\n\t\t\t\t<InputControl\n\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\tlabel={ __( 'Row span' ) }\n\t\t\t\t\ttype=\"number\"\n\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\tcolumnStart,\n\t\t\t\t\t\t\trowStart,\n\t\t\t\t\t\t\tcolumnSpan,\n\t\t\t\t\t\t\trowSpan: value,\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tvalue={ rowSpan }\n\t\t\t\t\tmin={ 1 }\n\t\t\t\t/>\n\t\t\t</HStack>\n\t\t\t{ window.__experimentalEnableGridInteractivity && columnCount && (\n\t\t\t\t// Use Flex with an explicit width on the FlexItem instead of HStack to\n\t\t\t\t// work around an issue in webkit where inputs with a max attribute are\n\t\t\t\t// sized incorrectly.\n\t\t\t\t<Flex\n\t\t\t\t\tas={ ToolsPanelItem }\n\t\t\t\t\thasValue={ hasStartValue }\n\t\t\t\t\tlabel={ __( 'Grid placement' ) }\n\t\t\t\t\tonDeselect={ resetGridStarts }\n\t\t\t\t\tisShownByDefault={ false }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<FlexItem style={ { width: '50%' } }>\n\t\t\t\t\t\t<InputControl\n\t\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t\tlabel={ __( 'Column' ) }\n\t\t\t\t\t\t\ttype=\"number\"\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\tcolumnStart: value,\n\t\t\t\t\t\t\t\t\trowStart,\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\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t\t\t\t[ panelId ],\n\t\t\t\t\t\t\t\t\trootClientId,\n\t\t\t\t\t\t\t\t\trootClientId,\n\t\t\t\t\t\t\t\t\tgetNumberOfBlocksBeforeCell(\n\t\t\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t\t\t\trowStart\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} }\n\t\t\t\t\t\t\tvalue={ columnStart }\n\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\tmax={\n\t\t\t\t\t\t\t\tgridColumnNumber\n\t\t\t\t\t\t\t\t\t? gridColumnNumber - ( columnSpan ?? 1 ) + 1\n\t\t\t\t\t\t\t\t\t: undefined\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\t<FlexItem style={ { width: '50%' } }>\n\t\t\t\t\t\t<InputControl\n\t\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t\tlabel={ __( 'Row' ) }\n\t\t\t\t\t\t\ttype=\"number\"\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\tcolumnStart,\n\t\t\t\t\t\t\t\t\trowStart: value,\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\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t\t\t\t[ panelId ],\n\t\t\t\t\t\t\t\t\trootClientId,\n\t\t\t\t\t\t\t\t\trootClientId,\n\t\t\t\t\t\t\t\t\tgetNumberOfBlocksBeforeCell(\n\t\t\t\t\t\t\t\t\t\tcolumnStart,\n\t\t\t\t\t\t\t\t\t\tvalue\n\t\t\t\t\t\t\t\t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,KACD,CACD,CAAC;UACF,CAAG;UACHA,KAAK,EAAGsC,QAAU;UAClBuB,GAAG,EAAG,CAAG;UACTO,GAAG,EACFxE,YAAY,EAAEyE,QAAQ,GACnBzE,YAAY,CAACyE,QAAQ,IACnB7B,OAAO,aAAPA,OAAO,cAAPA,OAAO,GAAI,CAAC,CAAE,GAChB,CAAC,GACDvB;QACH,CACD;MAAC,CACO,CAAC;IAAA,CACN,CACN;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
|
|
@@ -13,11 +13,15 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
13
13
|
* WordPress dependencies
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
// So that we
|
|
17
|
-
//
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
// So that we illustrate the different formats in the dropdown properly, show a date that is
|
|
17
|
+
// somwhat recent, has a day greater than 12, and a month with more than three letters.
|
|
18
|
+
const exampleDate = new Date();
|
|
19
|
+
exampleDate.setDate(20);
|
|
20
|
+
exampleDate.setMonth(exampleDate.getMonth() - 3);
|
|
21
|
+
if (exampleDate.getMonth() === 4) {
|
|
22
|
+
// May has three letters, so use March.
|
|
23
|
+
exampleDate.setMonth(3);
|
|
24
|
+
}
|
|
21
25
|
|
|
22
26
|
/**
|
|
23
27
|
* The `DateFormatPicker` component renders controls that let the user choose a
|
|
@@ -54,7 +58,7 @@ function DateFormatPicker({
|
|
|
54
58
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
|
|
55
59
|
__nextHasNoMarginBottom: true,
|
|
56
60
|
label: (0, _i18n.__)('Default format'),
|
|
57
|
-
help: `${(0, _i18n.__)('Example:')} ${(0, _date.dateI18n)(defaultFormat,
|
|
61
|
+
help: `${(0, _i18n.__)('Example:')} ${(0, _date.dateI18n)(defaultFormat, exampleDate)}`,
|
|
58
62
|
checked: !format,
|
|
59
63
|
onChange: checked => onChange(checked ? null : defaultFormat)
|
|
60
64
|
}), format && /*#__PURE__*/(0, _jsxRuntime.jsx)(NonDefaultControls, {
|
|
@@ -83,18 +87,22 @@ function NonDefaultControls({
|
|
|
83
87
|
(0, _i18n._x)('M j, Y g:i A', 'medium date format with time'), /* translators: See https://www.php.net/manual/datetime.format.php */
|
|
84
88
|
(0, _i18n._x)('F j, Y', 'long date format'), /* translators: See https://www.php.net/manual/datetime.format.php */
|
|
85
89
|
(0, _i18n._x)('M j', 'short date format without the year')])];
|
|
86
|
-
const suggestedOptions = suggestedFormats.map((suggestedFormat, index) => ({
|
|
90
|
+
const suggestedOptions = [...suggestedFormats.map((suggestedFormat, index) => ({
|
|
87
91
|
key: `suggested-${index}`,
|
|
88
|
-
name: (0, _date.dateI18n)(suggestedFormat,
|
|
92
|
+
name: (0, _date.dateI18n)(suggestedFormat, exampleDate),
|
|
89
93
|
format: suggestedFormat
|
|
90
|
-
}))
|
|
94
|
+
})), {
|
|
95
|
+
key: 'human-diff',
|
|
96
|
+
name: (0, _date.humanTimeDiff)(exampleDate),
|
|
97
|
+
format: 'human-diff'
|
|
98
|
+
}];
|
|
91
99
|
const customOption = {
|
|
92
100
|
key: 'custom',
|
|
93
101
|
name: (0, _i18n.__)('Custom'),
|
|
94
102
|
className: 'block-editor-date-format-picker__custom-format-select-control__custom-option',
|
|
95
103
|
__experimentalHint: (0, _i18n.__)('Enter your own date format')
|
|
96
104
|
};
|
|
97
|
-
const [isCustom, setIsCustom] = (0, _element.useState)(() => !!format && !
|
|
105
|
+
const [isCustom, setIsCustom] = (0, _element.useState)(() => !!format && !suggestedOptions.some(option => option.format === format));
|
|
98
106
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalVStack, {
|
|
99
107
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.CustomSelectControl, {
|
|
100
108
|
label: (0, _i18n.__)('Choose a format'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_date","_element","_components","_jsxRuntime","EXAMPLE_DATE","Date","DateFormatPicker","format","defaultFormat","onChange","jsxs","className","children","jsx","VisuallyHidden","as","__","ToggleControl","__nextHasNoMarginBottom","label","help","dateI18n","checked","NonDefaultControls","_suggestedOptions$fin","suggestedFormats","Set","_x","suggestedOptions","map","suggestedFormat","index","key","name","customOption","__experimentalHint","isCustom","setIsCustom","useState","includes","__experimentalVStack","CustomSelectControl","options","value","find","option","selectedItem","TextControl","hideLabelFromVision","createInterpolateElement","Link","ExternalLink","href"],"sources":["@wordpress/block-editor/src/components/date-format-picker/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { _x, __ } from '@wordpress/i18n';\nimport { dateI18n } from '@wordpress/date';\nimport { useState, createInterpolateElement } from '@wordpress/element';\nimport {\n\tTextControl,\n\tExternalLink,\n\tVisuallyHidden,\n\tCustomSelectControl,\n\tToggleControl,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\n\n// So that we can illustrate the different formats in the dropdown properly,\n// show a date that has a day greater than 12 and a month with more than three\n// letters. Here we're using 2022-01-25 which is when WordPress 5.9 was\n// released.\nconst EXAMPLE_DATE = new Date( 2022, 0, 25 );\n\n/**\n * The `DateFormatPicker` component renders controls that let the user choose a\n * _date format_. That is, how they want their dates to be formatted.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/date-format-picker/README.md\n *\n * @param {Object} props\n * @param {string|null} props.format The selected date\n * format. If\n * `null`,\n * _Default_ is\n * selected.\n * @param {string} props.defaultFormat The date format that\n * will be used if the\n * user selects\n * 'Default'.\n * @param {( format: string|null ) => void} props.onChange Called when a\n * selection is\n * made. If `null`,\n * _Default_ is\n * selected.\n */\nexport default function DateFormatPicker( {\n\tformat,\n\tdefaultFormat,\n\tonChange,\n} ) {\n\treturn (\n\t\t<fieldset className=\"block-editor-date-format-picker\">\n\t\t\t<VisuallyHidden as=\"legend\">{ __( 'Date format' ) }</VisuallyHidden>\n\t\t\t<ToggleControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tlabel={ __( 'Default format' ) }\n\t\t\t\thelp={ `${ __( 'Example:' ) } ${ dateI18n(\n\t\t\t\t\tdefaultFormat,\n\t\t\t\t\tEXAMPLE_DATE\n\t\t\t\t) }` }\n\t\t\t\tchecked={ ! format }\n\t\t\t\tonChange={ ( checked ) =>\n\t\t\t\t\tonChange( checked ? null : defaultFormat )\n\t\t\t\t}\n\t\t\t/>\n\t\t\t{ format && (\n\t\t\t\t<NonDefaultControls format={ format } onChange={ onChange } />\n\t\t\t) }\n\t\t</fieldset>\n\t);\n}\n\nfunction NonDefaultControls( { format, onChange } ) {\n\t// Suggest a short format, medium format, long format, and a standardised\n\t// (YYYY-MM-DD) format. The short, medium, and long formats are localised as\n\t// different languages have different ways of writing these. For example, 'F\n\t// j, Y' (April 20, 2022) in American English (en_US) is 'j. F Y' (20. April\n\t// 2022) in German (de). The resultant array is de-duplicated as some\n\t// languages will use the same format string for short, medium, and long\n\t// formats.\n\tconst suggestedFormats = [\n\t\t...new Set( [\n\t\t\t/* translators: See https://www.php.net/manual/datetime.format.php */\n\t\t\t'Y-m-d',\n\t\t\t/* translators: See https://www.php.net/manual/datetime.format.php */\n\t\t\t_x( 'n/j/Y', 'short date format' ),\n\t\t\t/* translators: See https://www.php.net/manual/datetime.format.php */\n\t\t\t_x( 'n/j/Y g:i A', 'short date format with time' ),\n\t\t\t/* translators: See https://www.php.net/manual/datetime.format.php */\n\t\t\t_x( 'M j, Y', 'medium date format' ),\n\t\t\t/* translators: See https://www.php.net/manual/datetime.format.php */\n\t\t\t_x( 'M j, Y g:i A', 'medium date format with time' ),\n\t\t\t/* translators: See https://www.php.net/manual/datetime.format.php */\n\t\t\t_x( 'F j, Y', 'long date format' ),\n\t\t\t/* translators: See https://www.php.net/manual/datetime.format.php */\n\t\t\t_x( 'M j', 'short date format without the year' ),\n\t\t] ),\n\t];\n\n\tconst suggestedOptions = suggestedFormats.map(\n\t\t( suggestedFormat, index ) => ( {\n\t\t\tkey: `suggested-${ index }`,\n\t\t\tname: dateI18n( suggestedFormat, EXAMPLE_DATE ),\n\t\t\tformat: suggestedFormat,\n\t\t} )\n\t);\n\tconst customOption = {\n\t\tkey: 'custom',\n\t\tname: __( 'Custom' ),\n\t\tclassName:\n\t\t\t'block-editor-date-format-picker__custom-format-select-control__custom-option',\n\t\t__experimentalHint: __( 'Enter your own date format' ),\n\t};\n\n\tconst [ isCustom, setIsCustom ] = useState(\n\t\t() => !! format && ! suggestedFormats.includes( format )\n\t);\n\n\treturn (\n\t\t<VStack>\n\t\t\t<CustomSelectControl\n\t\t\t\tlabel={ __( 'Choose a format' ) }\n\t\t\t\toptions={ [ ...suggestedOptions, customOption ] }\n\t\t\t\tvalue={\n\t\t\t\t\tisCustom\n\t\t\t\t\t\t? customOption\n\t\t\t\t\t\t: suggestedOptions.find(\n\t\t\t\t\t\t\t\t( option ) => option.format === format\n\t\t\t\t\t\t ) ?? customOption\n\t\t\t\t}\n\t\t\t\tonChange={ ( { selectedItem } ) => {\n\t\t\t\t\tif ( selectedItem === customOption ) {\n\t\t\t\t\t\tsetIsCustom( true );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsetIsCustom( false );\n\t\t\t\t\t\tonChange( selectedItem.format );\n\t\t\t\t\t}\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t{ isCustom && (\n\t\t\t\t<TextControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Custom format' ) }\n\t\t\t\t\thideLabelFromVision\n\t\t\t\t\thelp={ createInterpolateElement(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'Enter a date or time <Link>format string</Link>.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tLink: (\n\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/customize-date-and-time-format/'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\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AAQ,CAAEkC,KAAM;IAAG,CAC3C,CACD;EAAA,CACM,CAAC;AAEX","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_i18n","require","_date","_element","_components","_jsxRuntime","exampleDate","Date","setDate","setMonth","getMonth","DateFormatPicker","format","defaultFormat","onChange","jsxs","className","children","jsx","VisuallyHidden","as","__","ToggleControl","__nextHasNoMarginBottom","label","help","dateI18n","checked","NonDefaultControls","_suggestedOptions$fin","suggestedFormats","Set","_x","suggestedOptions","map","suggestedFormat","index","key","name","humanTimeDiff","customOption","__experimentalHint","isCustom","setIsCustom","useState","some","option","__experimentalVStack","CustomSelectControl","options","value","find","selectedItem","TextControl","hideLabelFromVision","createInterpolateElement","Link","ExternalLink","href"],"sources":["@wordpress/block-editor/src/components/date-format-picker/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { _x, __ } from '@wordpress/i18n';\nimport { dateI18n, humanTimeDiff } from '@wordpress/date';\nimport { useState, createInterpolateElement } from '@wordpress/element';\nimport {\n\tTextControl,\n\tExternalLink,\n\tVisuallyHidden,\n\tCustomSelectControl,\n\tToggleControl,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\n\n// So that we illustrate the different formats in the dropdown properly, show a date that is\n// somwhat recent, has a day greater than 12, and a month with more than three letters.\nconst exampleDate = new Date();\nexampleDate.setDate( 20 );\nexampleDate.setMonth( exampleDate.getMonth() - 3 );\nif ( exampleDate.getMonth() === 4 ) {\n\t// May has three letters, so use March.\n\texampleDate.setMonth( 3 );\n}\n\n/**\n * The `DateFormatPicker` component renders controls that let the user choose a\n * _date format_. That is, how they want their dates to be formatted.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/date-format-picker/README.md\n *\n * @param {Object} props\n * @param {string|null} props.format The selected date\n * format. If\n * `null`,\n * _Default_ is\n * selected.\n * @param {string} props.defaultFormat The date format that\n * will be used if the\n * user selects\n * 'Default'.\n * @param {( format: string|null ) => void} props.onChange Called when a\n * selection is\n * made. If `null`,\n * _Default_ is\n * selected.\n */\nexport default function DateFormatPicker( {\n\tformat,\n\tdefaultFormat,\n\tonChange,\n} ) {\n\treturn (\n\t\t<fieldset className=\"block-editor-date-format-picker\">\n\t\t\t<VisuallyHidden as=\"legend\">{ __( 'Date format' ) }</VisuallyHidden>\n\t\t\t<ToggleControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tlabel={ __( 'Default format' ) }\n\t\t\t\thelp={ `${ __( 'Example:' ) } ${ dateI18n(\n\t\t\t\t\tdefaultFormat,\n\t\t\t\t\texampleDate\n\t\t\t\t) }` }\n\t\t\t\tchecked={ ! format }\n\t\t\t\tonChange={ ( checked ) =>\n\t\t\t\t\tonChange( checked ? null : defaultFormat )\n\t\t\t\t}\n\t\t\t/>\n\t\t\t{ format && (\n\t\t\t\t<NonDefaultControls format={ format } onChange={ onChange } />\n\t\t\t) }\n\t\t</fieldset>\n\t);\n}\n\nfunction NonDefaultControls( { format, onChange } ) {\n\t// Suggest a short format, medium format, long format, and a standardised\n\t// (YYYY-MM-DD) format. The short, medium, and long formats are localised as\n\t// different languages have different ways of writing these. For example, 'F\n\t// j, Y' (April 20, 2022) in American English (en_US) is 'j. F Y' (20. April\n\t// 2022) in German (de). The resultant array is de-duplicated as some\n\t// languages will use the same format string for short, medium, and long\n\t// formats.\n\tconst suggestedFormats = [\n\t\t...new Set( [\n\t\t\t/* translators: See https://www.php.net/manual/datetime.format.php */\n\t\t\t'Y-m-d',\n\t\t\t/* translators: See https://www.php.net/manual/datetime.format.php */\n\t\t\t_x( 'n/j/Y', 'short date format' ),\n\t\t\t/* translators: See https://www.php.net/manual/datetime.format.php */\n\t\t\t_x( 'n/j/Y g:i A', 'short date format with time' ),\n\t\t\t/* translators: See https://www.php.net/manual/datetime.format.php */\n\t\t\t_x( 'M j, Y', 'medium date format' ),\n\t\t\t/* translators: See https://www.php.net/manual/datetime.format.php */\n\t\t\t_x( 'M j, Y g:i A', 'medium date format with time' ),\n\t\t\t/* translators: See https://www.php.net/manual/datetime.format.php */\n\t\t\t_x( 'F j, Y', 'long date format' ),\n\t\t\t/* translators: See https://www.php.net/manual/datetime.format.php */\n\t\t\t_x( 'M j', 'short date format without the year' ),\n\t\t] ),\n\t];\n\n\tconst suggestedOptions = [\n\t\t...suggestedFormats.map( ( suggestedFormat, index ) => ( {\n\t\t\tkey: `suggested-${ index }`,\n\t\t\tname: dateI18n( suggestedFormat, exampleDate ),\n\t\t\tformat: suggestedFormat,\n\t\t} ) ),\n\t\t{\n\t\t\tkey: 'human-diff',\n\t\t\tname: humanTimeDiff( exampleDate ),\n\t\t\tformat: 'human-diff',\n\t\t},\n\t];\n\n\tconst customOption = {\n\t\tkey: 'custom',\n\t\tname: __( 'Custom' ),\n\t\tclassName:\n\t\t\t'block-editor-date-format-picker__custom-format-select-control__custom-option',\n\t\t__experimentalHint: __( 'Enter your own date format' ),\n\t};\n\n\tconst [ isCustom, setIsCustom ] = useState(\n\t\t() =>\n\t\t\t!! format &&\n\t\t\t! suggestedOptions.some( ( option ) => option.format === format )\n\t);\n\n\treturn (\n\t\t<VStack>\n\t\t\t<CustomSelectControl\n\t\t\t\tlabel={ __( 'Choose a format' ) }\n\t\t\t\toptions={ [ ...suggestedOptions, customOption ] }\n\t\t\t\tvalue={\n\t\t\t\t\tisCustom\n\t\t\t\t\t\t? customOption\n\t\t\t\t\t\t: suggestedOptions.find(\n\t\t\t\t\t\t\t\t( option ) => option.format === format\n\t\t\t\t\t\t ) ?? customOption\n\t\t\t\t}\n\t\t\t\tonChange={ ( { selectedItem } ) => {\n\t\t\t\t\tif ( selectedItem === customOption ) {\n\t\t\t\t\t\tsetIsCustom( true );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsetIsCustom( false );\n\t\t\t\t\t\tonChange( selectedItem.format );\n\t\t\t\t\t}\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t{ isCustom && (\n\t\t\t\t<TextControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Custom format' ) }\n\t\t\t\t\thideLabelFromVision\n\t\t\t\t\thelp={ createInterpolateElement(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'Enter a date or time <Link>format string</Link>.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tLink: (\n\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/customize-date-and-time-format/'\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),\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t\tvalue={ format }\n\t\t\t\t\tonChange={ ( value ) => onChange( value ) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAO+B,IAAAI,WAAA,GAAAJ,OAAA;AAb/B;AACA;AACA;;AAaA;AACA;AACA,MAAMK,WAAW,GAAG,IAAIC,IAAI,CAAC,CAAC;AAC9BD,WAAW,CAACE,OAAO,CAAE,EAAG,CAAC;AACzBF,WAAW,CAACG,QAAQ,CAAEH,WAAW,CAACI,QAAQ,CAAC,CAAC,GAAG,CAAE,CAAC;AAClD,IAAKJ,WAAW,CAACI,QAAQ,CAAC,CAAC,KAAK,CAAC,EAAG;EACnC;EACAJ,WAAW,CAACG,QAAQ,CAAE,CAAE,CAAC;AAC1B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASE,gBAAgBA,CAAE;EACzCC,MAAM;EACNC,aAAa;EACbC;AACD,CAAC,EAAG;EACH,o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