Changeset 2870391
- Timestamp:
- 02/24/2023 03:32:34 AM (3 years ago)
- Location:
- sortable-block
- Files:
-
- 18 deleted
- 30 edited
-
tags/1.3.0/build/container/block.json (modified) (1 diff)
-
tags/1.3.0/build/container/index.asset.php (modified) (1 diff)
-
tags/1.3.0/build/container/index.css (modified) (1 diff)
-
tags/1.3.0/build/container/index.css.map (deleted)
-
tags/1.3.0/build/container/index.js (modified) (1 diff)
-
tags/1.3.0/build/container/index.js.map (deleted)
-
tags/1.3.0/build/container/style-index.css (modified) (1 diff)
-
tags/1.3.0/build/container/style-index.css.map (deleted)
-
tags/1.3.0/build/date/index.asset.php (modified) (1 diff)
-
tags/1.3.0/build/date/index.css (modified) (1 diff)
-
tags/1.3.0/build/date/index.css.map (deleted)
-
tags/1.3.0/build/date/index.js (modified) (1 diff)
-
tags/1.3.0/build/date/index.js.map (deleted)
-
tags/1.3.0/build/date/style-index.css (modified) (1 diff)
-
tags/1.3.0/build/date/style-index.css.map (deleted)
-
tags/1.3.0/build/entry/block.json (modified) (1 diff)
-
tags/1.3.0/build/entry/index.asset.php (modified) (1 diff)
-
tags/1.3.0/build/entry/index.css (modified) (1 diff)
-
tags/1.3.0/build/entry/index.css.map (deleted)
-
tags/1.3.0/build/entry/index.js (modified) (1 diff)
-
tags/1.3.0/build/entry/index.js.map (deleted)
-
tags/1.3.0/build/entry/style-index.css (modified) (1 diff)
-
tags/1.3.0/build/entry/style-index.css.map (deleted)
-
tags/1.3.0/readme.txt (modified) (1 diff)
-
trunk/build/container/block.json (modified) (1 diff)
-
trunk/build/container/index.asset.php (modified) (1 diff)
-
trunk/build/container/index.css (modified) (1 diff)
-
trunk/build/container/index.css.map (deleted)
-
trunk/build/container/index.js (modified) (1 diff)
-
trunk/build/container/index.js.map (deleted)
-
trunk/build/container/style-index.css (modified) (1 diff)
-
trunk/build/container/style-index.css.map (deleted)
-
trunk/build/date/index.asset.php (modified) (1 diff)
-
trunk/build/date/index.css (modified) (1 diff)
-
trunk/build/date/index.css.map (deleted)
-
trunk/build/date/index.js (modified) (1 diff)
-
trunk/build/date/index.js.map (deleted)
-
trunk/build/date/style-index.css (modified) (1 diff)
-
trunk/build/date/style-index.css.map (deleted)
-
trunk/build/entry/block.json (modified) (1 diff)
-
trunk/build/entry/index.asset.php (modified) (1 diff)
-
trunk/build/entry/index.css (modified) (1 diff)
-
trunk/build/entry/index.css.map (deleted)
-
trunk/build/entry/index.js (modified) (1 diff)
-
trunk/build/entry/index.js.map (deleted)
-
trunk/build/entry/style-index.css (modified) (1 diff)
-
trunk/build/entry/style-index.css.map (deleted)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
sortable-block/tags/1.3.0/build/container/block.json
r2870387 r2870391 3 3 "apiVersion": 2, 4 4 "name": "sortable/container", 5 "version": "1. 1.0",5 "version": "1.3.0", 6 6 "title": "Sortable", 7 7 "category": "widgets", -
sortable-block/tags/1.3.0/build/container/index.asset.php
r2870387 r2870391 1 <?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => ' 33ac81e99d207e9bc735');1 <?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '74446b512806f5e81057'); -
sortable-block/tags/1.3.0/build/container/index.css
r2870387 r2870391 1 /*!**************************************************************************************************************************************************************************************************************************************************!*\ 2 !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/container/editor.scss ***! 3 \**************************************************************************************************************************************************************************************************************************************************/ 4 /** 5 * The following styles get applied inside the editor only. 6 */ 7 .wp-block-sortable-container .block-editor-button-block-appender { 8 margin-block: 1rem; 9 } 10 .wp-block-sortable-container > .block-list-appender { 11 position: relative; 12 right: auto; 13 align-self: center; 14 list-style: none; 15 line-height: inherit; 16 } 17 .wp-block-sortable-container > .block-list-appender .block-editor-button-block-appender { 18 flex-direction: row; 19 } 20 .wp-block-sortable-container > .block-list-appender .block-editor-button-block-appender::after { 21 content: attr(aria-label); 22 font-weight: bold; 23 } 24 .wp-block-sortable-container.is-list > .block-list-appender { 25 width: 100%; 26 } 27 .wp-block-sortable-container.is-grid > .block-list-appender { 28 grid-column: 1/-1; 29 } 30 31 /*# sourceMappingURL=index.css.map*/ 1 .wp-block-sortable-container .block-editor-button-block-appender{margin-block:1rem}.wp-block-sortable-container>.block-list-appender{align-self:center;line-height:inherit;list-style:none;position:relative;right:auto}.wp-block-sortable-container>.block-list-appender .block-editor-button-block-appender{flex-direction:row}.wp-block-sortable-container>.block-list-appender .block-editor-button-block-appender:after{content:attr(aria-label);font-weight:700}.wp-block-sortable-container.is-list>.block-list-appender{width:100%}.wp-block-sortable-container.is-grid>.block-list-appender{grid-column:1/-1} -
sortable-block/tags/1.3.0/build/container/index.js
r2870387 r2870391 1 /******/ (function() { // webpackBootstrap 2 /******/ var __webpack_modules__ = ({ 3 4 /***/ "./node_modules/@wordpress/icons/build-module/library/grid.js": 5 /*!********************************************************************!*\ 6 !*** ./node_modules/@wordpress/icons/build-module/library/grid.js ***! 7 \********************************************************************/ 8 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 9 10 "use strict"; 11 __webpack_require__.r(__webpack_exports__); 12 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 13 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 14 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives"); 15 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 16 17 18 /** 19 * WordPress dependencies 20 */ 21 22 const grid = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__.SVG, { 23 xmlns: "http://www.w3.org/2000/svg", 24 viewBox: "0 0 24 24" 25 }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__.Path, { 26 d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7.8 16.5H5c-.3 0-.5-.2-.5-.5v-6.2h6.8v6.7zm0-8.3H4.5V5c0-.3.2-.5.5-.5h6.2v6.7zm8.3 7.8c0 .3-.2.5-.5.5h-6.2v-6.8h6.8V19zm0-7.8h-6.8V4.5H19c.3 0 .5.2.5.5v6.2z", 27 fillRule: "evenodd", 28 clipRule: "evenodd" 29 })); 30 /* harmony default export */ __webpack_exports__["default"] = (grid); 31 //# sourceMappingURL=grid.js.map 32 33 /***/ }), 34 35 /***/ "./node_modules/@wordpress/icons/build-module/library/list.js": 36 /*!********************************************************************!*\ 37 !*** ./node_modules/@wordpress/icons/build-module/library/list.js ***! 38 \********************************************************************/ 39 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 40 41 "use strict"; 42 __webpack_require__.r(__webpack_exports__); 43 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 44 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 45 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives"); 46 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 47 48 49 /** 50 * WordPress dependencies 51 */ 52 53 const list = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__.SVG, { 54 viewBox: "0 0 24 24", 55 xmlns: "http://www.w3.org/2000/svg" 56 }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__.Path, { 57 d: "M4 4v1.5h16V4H4zm8 8.5h8V11h-8v1.5zM4 20h16v-1.5H4V20zm4-8c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2z" 58 })); 59 /* harmony default export */ __webpack_exports__["default"] = (list); 60 //# sourceMappingURL=list.js.map 61 62 /***/ }), 63 64 /***/ "./src/container/edit.js": 65 /*!*******************************!*\ 66 !*** ./src/container/edit.js ***! 67 \*******************************/ 68 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 69 70 "use strict"; 71 __webpack_require__.r(__webpack_exports__); 72 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 73 /* harmony export */ "default": function() { return /* binding */ Edit; } 74 /* harmony export */ }); 75 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 76 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 77 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); 78 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); 79 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 80 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); 81 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); 82 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__); 83 /* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./editor.scss */ "./src/container/editor.scss"); 84 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 85 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__); 86 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 87 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__); 88 /* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/list.js"); 89 /* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/grid.js"); 90 91 92 93 /** 94 * Retrieves the translation of text. 95 * 96 * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-i18n/ 97 */ 98 99 100 /** 101 * React hook that is used to mark the block wrapper element. 102 * It provides all the necessary props like the class name. 103 * 104 * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-editor/#useblockprops 105 */ 106 107 108 /** 109 * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files. 110 * Those files can contain any CSS code that gets applied to the editor. 111 * 112 * @see https://www.npmjs.com/package/@wordpress/scripts#using-css 113 */ 114 115 116 /** 117 * WordPress dependencies. 118 * 119 * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-element/ 120 * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-data/ 121 */ 122 123 124 125 126 127 /** 128 * Allowed blocks constant is passed to InnerBlocks precisely as specified here. 129 * The contents of the array should never change. 130 * The array should contain the name of each block that is allowed. 131 * In sortable container block, the only block we allow is 'sortable/entry'. 132 * 133 * @constant 134 * @type {string[]} 135 */ 136 const ALLOWED_BLOCKS = ['sortable/entry']; 137 138 /** 139 * The edit function describes the structure of your block in the context of the 140 * editor. This represents what the editor will render when the block is used. 141 * 142 * @param {Object} props All props passed to this function. 143 * @return {WPElement} Element to render. 144 * 145 * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#edit 146 */ 147 function Edit(props) { 148 const { 149 clientId, 150 attributes, 151 setAttributes 152 } = props; 153 const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.useBlockProps)({ 154 className: classnames__WEBPACK_IMPORTED_MODULE_1___default()({ 155 'is-list': attributes.layout === 'list', 156 'is-grid': attributes.layout === 'grid', 157 [`columns-${attributes.columns}`]: attributes.layout === 'grid' 158 }) 159 }); 160 const { 161 replaceInnerBlocks 162 } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_5__.useDispatch)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.store); 163 const { 164 childBlocks 165 } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => { 166 const { 167 getBlocks 168 } = select(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.store); 169 return { 170 childBlocks: getBlocks(clientId) 171 }; 172 }, [clientId]); 173 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { 174 if (childBlocks.length > 0 && !attributes.orderBy || attributes.order) { 175 let sortedBlocks = []; 176 if (attributes.order === 'asc') { 177 sortedBlocks = [...childBlocks].sort((blockA, blockB) => { 178 const result = Number(new Date(blockA.attributes.dateTime)) - Number(new Date(blockB.attributes.dateTime)); 179 return result; 180 }); 181 } else { 182 sortedBlocks = [...childBlocks].sort((blockA, blockB) => { 183 const result = Number(new Date(blockB.attributes.dateTime)) - Number(new Date(blockA.attributes.dateTime)); 184 return result; 185 }); 186 } 187 setAttributes({ 188 orderBy: 'date' 189 }); 190 replaceInnerBlocks(clientId, sortedBlocks, false); 191 } 192 }, [attributes.orderBy, attributes.order]); 193 194 // Update order. 195 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { 196 // Make sure order attribute is set. 197 if (attributes.order === '') { 198 setAttributes({ 199 order: 'desc' 200 }); 201 } 202 }, [attributes.order]); 203 const layoutControls = [{ 204 icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_7__["default"], 205 title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('List view'), 206 onClick: () => setAttributes({ 207 layout: 'list' 208 }), 209 isActive: attributes.layout === 'list' 210 }, { 211 icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_8__["default"], 212 title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Grid view'), 213 onClick: () => setAttributes({ 214 layout: 'grid' 215 }), 216 isActive: attributes.layout === 'grid' 217 }]; 218 const innerBlocksProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.useInnerBlocksProps)(blockProps, { 219 allowedBlocks: ALLOWED_BLOCKS, 220 orientation: 'horizontal', 221 renderAppender: _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.InnerBlocks.ButtonBlockAppender 222 }); 223 return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.InspectorControls, null, attributes.layout === 'grid' && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__.PanelBody, { 224 title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Grid settings') 225 }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__.RangeControl, { 226 __nextHasNoMarginBottom: true, 227 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Columns'), 228 value: attributes.columns, 229 onChange: value => setAttributes({ 230 columns: value 231 }), 232 min: 2, 233 max: 6, 234 required: true 235 })), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__.PanelBody, { 236 title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Order settings') 237 }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__.SelectControl, { 238 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Order'), 239 value: attributes.order, 240 options: [{ 241 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Newest to oldest'), 242 value: 'desc' 243 }, { 244 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Oldest to newest'), 245 value: 'asc' 246 }], 247 onChange: value => setAttributes({ 248 order: value 249 }), 250 __nextHasNoMarginBottom: true 251 }))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.BlockControls, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__.ToolbarGroup, { 252 controls: layoutControls 253 })), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", innerBlocksProps)); 254 } 255 256 /***/ }), 257 258 /***/ "./src/container/index.js": 259 /*!********************************!*\ 260 !*** ./src/container/index.js ***! 261 \********************************/ 262 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 263 264 "use strict"; 265 __webpack_require__.r(__webpack_exports__); 266 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 267 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__); 268 /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./style.scss */ "./src/container/style.scss"); 269 /* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./edit */ "./src/container/edit.js"); 270 /* harmony import */ var _save__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./save */ "./src/container/save.js"); 271 /* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./block.json */ "./src/container/block.json"); 272 /** 273 * Registers a new block provided a unique name and an object defining its behavior. 274 * 275 * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/ 276 */ 277 278 279 /** 280 * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files. 281 * All files containing `style` keyword are bundled together. The code used 282 * gets applied both to the front of your site and to the editor. 283 * 284 * @see https://www.npmjs.com/package/@wordpress/scripts#using-css 285 */ 286 287 288 /** 289 * Internal dependencies 290 */ 291 292 293 294 295 /** 296 * Every block starts by registering a new block type definition. 297 * 298 * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/ 299 */ 300 (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_4__.name, { 301 /** 302 * @see ./edit.js 303 */ 304 edit: _edit__WEBPACK_IMPORTED_MODULE_2__["default"], 305 /** 306 * @see ./save.js 307 */ 308 save: _save__WEBPACK_IMPORTED_MODULE_3__["default"] 309 }); 310 311 /***/ }), 312 313 /***/ "./src/container/save.js": 314 /*!*******************************!*\ 315 !*** ./src/container/save.js ***! 316 \*******************************/ 317 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 318 319 "use strict"; 320 __webpack_require__.r(__webpack_exports__); 321 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 322 /* harmony export */ "default": function() { return /* binding */ save; } 323 /* harmony export */ }); 324 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 325 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 326 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); 327 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); 328 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); 329 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__); 330 331 332 333 /** 334 * React hook that is used to mark the block wrapper element. 335 * It provides all the necessary props like the class name. 336 * 337 * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-editor/#useblockprops 338 */ 339 340 341 /** 342 * The save function defines the way in which the different attributes should 343 * be combined into the final markup, which is then serialized by the block 344 * editor into `post_content`. 345 * 346 * @param {Object} props All props passed to this function. 347 * @return {WPElement} Element to render. 348 * 349 * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#save 350 */ 351 function save(props) { 352 const { 353 attributes 354 } = props; 355 const innerBlocksProps = _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.useInnerBlocksProps.save(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.useBlockProps.save({ 356 className: classnames__WEBPACK_IMPORTED_MODULE_1___default()({ 357 'is-list': attributes.layout === 'list', 358 'is-grid': attributes.layout === 'grid', 359 [`columns-${attributes.columns}`]: attributes.layout === 'grid' 360 }) 361 })); 362 return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", innerBlocksProps); 363 } 364 365 /***/ }), 366 367 /***/ "./node_modules/classnames/index.js": 368 /*!******************************************!*\ 369 !*** ./node_modules/classnames/index.js ***! 370 \******************************************/ 371 /***/ (function(module, exports) { 372 373 var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! 374 Copyright (c) 2018 Jed Watson. 375 Licensed under the MIT License (MIT), see 376 http://jedwatson.github.io/classnames 377 */ 378 /* global define */ 379 380 (function () { 381 'use strict'; 382 383 var hasOwn = {}.hasOwnProperty; 384 var nativeCodeString = '[native code]'; 385 386 function classNames() { 387 var classes = []; 388 389 for (var i = 0; i < arguments.length; i++) { 390 var arg = arguments[i]; 391 if (!arg) continue; 392 393 var argType = typeof arg; 394 395 if (argType === 'string' || argType === 'number') { 396 classes.push(arg); 397 } else if (Array.isArray(arg)) { 398 if (arg.length) { 399 var inner = classNames.apply(null, arg); 400 if (inner) { 401 classes.push(inner); 402 } 403 } 404 } else if (argType === 'object') { 405 if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) { 406 classes.push(arg.toString()); 407 continue; 408 } 409 410 for (var key in arg) { 411 if (hasOwn.call(arg, key) && arg[key]) { 412 classes.push(key); 413 } 414 } 415 } 416 } 417 418 return classes.join(' '); 419 } 420 421 if ( true && module.exports) { 422 classNames.default = classNames; 423 module.exports = classNames; 424 } else if (true) { 425 // register as 'classnames', consistent with npm package name 426 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { 427 return classNames; 428 }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), 429 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 430 } else {} 431 }()); 432 433 434 /***/ }), 435 436 /***/ "./src/container/editor.scss": 437 /*!***********************************!*\ 438 !*** ./src/container/editor.scss ***! 439 \***********************************/ 440 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 441 442 "use strict"; 443 __webpack_require__.r(__webpack_exports__); 444 // extracted by mini-css-extract-plugin 445 446 447 /***/ }), 448 449 /***/ "./src/container/style.scss": 450 /*!**********************************!*\ 451 !*** ./src/container/style.scss ***! 452 \**********************************/ 453 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 454 455 "use strict"; 456 __webpack_require__.r(__webpack_exports__); 457 // extracted by mini-css-extract-plugin 458 459 460 /***/ }), 461 462 /***/ "@wordpress/block-editor": 463 /*!*************************************!*\ 464 !*** external ["wp","blockEditor"] ***! 465 \*************************************/ 466 /***/ (function(module) { 467 468 "use strict"; 469 module.exports = window["wp"]["blockEditor"]; 470 471 /***/ }), 472 473 /***/ "@wordpress/blocks": 474 /*!********************************!*\ 475 !*** external ["wp","blocks"] ***! 476 \********************************/ 477 /***/ (function(module) { 478 479 "use strict"; 480 module.exports = window["wp"]["blocks"]; 481 482 /***/ }), 483 484 /***/ "@wordpress/components": 485 /*!************************************!*\ 486 !*** external ["wp","components"] ***! 487 \************************************/ 488 /***/ (function(module) { 489 490 "use strict"; 491 module.exports = window["wp"]["components"]; 492 493 /***/ }), 494 495 /***/ "@wordpress/data": 496 /*!******************************!*\ 497 !*** external ["wp","data"] ***! 498 \******************************/ 499 /***/ (function(module) { 500 501 "use strict"; 502 module.exports = window["wp"]["data"]; 503 504 /***/ }), 505 506 /***/ "@wordpress/element": 507 /*!*********************************!*\ 508 !*** external ["wp","element"] ***! 509 \*********************************/ 510 /***/ (function(module) { 511 512 "use strict"; 513 module.exports = window["wp"]["element"]; 514 515 /***/ }), 516 517 /***/ "@wordpress/i18n": 518 /*!******************************!*\ 519 !*** external ["wp","i18n"] ***! 520 \******************************/ 521 /***/ (function(module) { 522 523 "use strict"; 524 module.exports = window["wp"]["i18n"]; 525 526 /***/ }), 527 528 /***/ "@wordpress/primitives": 529 /*!************************************!*\ 530 !*** external ["wp","primitives"] ***! 531 \************************************/ 532 /***/ (function(module) { 533 534 "use strict"; 535 module.exports = window["wp"]["primitives"]; 536 537 /***/ }), 538 539 /***/ "./src/container/block.json": 540 /*!**********************************!*\ 541 !*** ./src/container/block.json ***! 542 \**********************************/ 543 /***/ (function(module) { 544 545 "use strict"; 546 module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"sortable/container","version":"1.1.0","title":"Sortable","category":"widgets","icon":"portfolio","description":"This block serves as a main container to hold sortable entries, and it also offers the option to order entries from newest to oldest or oldest to newest, as well as the option to switch the layout between list and grid.","attributes":{"layout":{"type":"string","default":"list"},"columns":{"type":"number","default":3},"orderBy":{"type":"string","default":"date"},"order":{"type":"string","default":"desc"}},"supports":{"anchor":true,"align":true,"html":false,"color":{"gradients":true,"link":true,"__experimentalDefaultControls":{"background":true,"text":true}},"spacing":{"margin":true,"padding":true},"__experimentalBorder":{"color":true,"radius":true,"style":true,"width":true,"__experimentalDefaultControls":{"color":true,"radius":true,"style":true,"width":true}}},"textdomain":"sortable","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css"}'); 547 548 /***/ }) 549 550 /******/ }); 551 /************************************************************************/ 552 /******/ // The module cache 553 /******/ var __webpack_module_cache__ = {}; 554 /******/ 555 /******/ // The require function 556 /******/ function __webpack_require__(moduleId) { 557 /******/ // Check if module is in cache 558 /******/ var cachedModule = __webpack_module_cache__[moduleId]; 559 /******/ if (cachedModule !== undefined) { 560 /******/ return cachedModule.exports; 561 /******/ } 562 /******/ // Create a new module (and put it into the cache) 563 /******/ var module = __webpack_module_cache__[moduleId] = { 564 /******/ // no module.id needed 565 /******/ // no module.loaded needed 566 /******/ exports: {} 567 /******/ }; 568 /******/ 569 /******/ // Execute the module function 570 /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); 571 /******/ 572 /******/ // Return the exports of the module 573 /******/ return module.exports; 574 /******/ } 575 /******/ 576 /******/ // expose the modules object (__webpack_modules__) 577 /******/ __webpack_require__.m = __webpack_modules__; 578 /******/ 579 /************************************************************************/ 580 /******/ /* webpack/runtime/chunk loaded */ 581 /******/ !function() { 582 /******/ var deferred = []; 583 /******/ __webpack_require__.O = function(result, chunkIds, fn, priority) { 584 /******/ if(chunkIds) { 585 /******/ priority = priority || 0; 586 /******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; 587 /******/ deferred[i] = [chunkIds, fn, priority]; 588 /******/ return; 589 /******/ } 590 /******/ var notFulfilled = Infinity; 591 /******/ for (var i = 0; i < deferred.length; i++) { 592 /******/ var chunkIds = deferred[i][0]; 593 /******/ var fn = deferred[i][1]; 594 /******/ var priority = deferred[i][2]; 595 /******/ var fulfilled = true; 596 /******/ for (var j = 0; j < chunkIds.length; j++) { 597 /******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every(function(key) { return __webpack_require__.O[key](chunkIds[j]); })) { 598 /******/ chunkIds.splice(j--, 1); 599 /******/ } else { 600 /******/ fulfilled = false; 601 /******/ if(priority < notFulfilled) notFulfilled = priority; 602 /******/ } 603 /******/ } 604 /******/ if(fulfilled) { 605 /******/ deferred.splice(i--, 1) 606 /******/ var r = fn(); 607 /******/ if (r !== undefined) result = r; 608 /******/ } 609 /******/ } 610 /******/ return result; 611 /******/ }; 612 /******/ }(); 613 /******/ 614 /******/ /* webpack/runtime/compat get default export */ 615 /******/ !function() { 616 /******/ // getDefaultExport function for compatibility with non-harmony modules 617 /******/ __webpack_require__.n = function(module) { 618 /******/ var getter = module && module.__esModule ? 619 /******/ function() { return module['default']; } : 620 /******/ function() { return module; }; 621 /******/ __webpack_require__.d(getter, { a: getter }); 622 /******/ return getter; 623 /******/ }; 624 /******/ }(); 625 /******/ 626 /******/ /* webpack/runtime/define property getters */ 627 /******/ !function() { 628 /******/ // define getter functions for harmony exports 629 /******/ __webpack_require__.d = function(exports, definition) { 630 /******/ for(var key in definition) { 631 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 632 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 633 /******/ } 634 /******/ } 635 /******/ }; 636 /******/ }(); 637 /******/ 638 /******/ /* webpack/runtime/hasOwnProperty shorthand */ 639 /******/ !function() { 640 /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } 641 /******/ }(); 642 /******/ 643 /******/ /* webpack/runtime/make namespace object */ 644 /******/ !function() { 645 /******/ // define __esModule on exports 646 /******/ __webpack_require__.r = function(exports) { 647 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 648 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 649 /******/ } 650 /******/ Object.defineProperty(exports, '__esModule', { value: true }); 651 /******/ }; 652 /******/ }(); 653 /******/ 654 /******/ /* webpack/runtime/jsonp chunk loading */ 655 /******/ !function() { 656 /******/ // no baseURI 657 /******/ 658 /******/ // object to store loaded and loading chunks 659 /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched 660 /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded 661 /******/ var installedChunks = { 662 /******/ "container/index": 0, 663 /******/ "container/style-index": 0 664 /******/ }; 665 /******/ 666 /******/ // no chunk on demand loading 667 /******/ 668 /******/ // no prefetching 669 /******/ 670 /******/ // no preloaded 671 /******/ 672 /******/ // no HMR 673 /******/ 674 /******/ // no HMR manifest 675 /******/ 676 /******/ __webpack_require__.O.j = function(chunkId) { return installedChunks[chunkId] === 0; }; 677 /******/ 678 /******/ // install a JSONP callback for chunk loading 679 /******/ var webpackJsonpCallback = function(parentChunkLoadingFunction, data) { 680 /******/ var chunkIds = data[0]; 681 /******/ var moreModules = data[1]; 682 /******/ var runtime = data[2]; 683 /******/ // add "moreModules" to the modules object, 684 /******/ // then flag all "chunkIds" as loaded and fire callback 685 /******/ var moduleId, chunkId, i = 0; 686 /******/ if(chunkIds.some(function(id) { return installedChunks[id] !== 0; })) { 687 /******/ for(moduleId in moreModules) { 688 /******/ if(__webpack_require__.o(moreModules, moduleId)) { 689 /******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; 690 /******/ } 691 /******/ } 692 /******/ if(runtime) var result = runtime(__webpack_require__); 693 /******/ } 694 /******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); 695 /******/ for(;i < chunkIds.length; i++) { 696 /******/ chunkId = chunkIds[i]; 697 /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { 698 /******/ installedChunks[chunkId][0](); 699 /******/ } 700 /******/ installedChunks[chunkId] = 0; 701 /******/ } 702 /******/ return __webpack_require__.O(result); 703 /******/ } 704 /******/ 705 /******/ var chunkLoadingGlobal = self["webpackChunksortable"] = self["webpackChunksortable"] || []; 706 /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); 707 /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); 708 /******/ }(); 709 /******/ 710 /************************************************************************/ 711 /******/ 712 /******/ // startup 713 /******/ // Load entry module and return exports 714 /******/ // This entry module depends on other loaded chunks and execution need to be delayed 715 /******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["container/style-index"], function() { return __webpack_require__("./src/container/index.js"); }) 716 /******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__); 717 /******/ 718 /******/ })() 719 ; 720 //# sourceMappingURL=index.js.map 1 !function(){var e,t={66:function(e,t,r){"use strict";var n=window.wp.blocks,o=window.wp.element,i=r(184),l=r.n(i),s=window.wp.i18n,a=window.wp.blockEditor,c=window.wp.data,u=window.wp.components,d=window.wp.primitives,v=(0,o.createElement)(d.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)(d.Path,{d:"M4 4v1.5h16V4H4zm8 8.5h8V11h-8v1.5zM4 20h16v-1.5H4V20zm4-8c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2z"})),p=(0,o.createElement)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(d.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7.8 16.5H5c-.3 0-.5-.2-.5-.5v-6.2h6.8v6.7zm0-8.3H4.5V5c0-.3.2-.5.5-.5h6.2v6.7zm8.3 7.8c0 .3-.2.5-.5.5h-6.2v-6.8h6.8V19zm0-7.8h-6.8V4.5H19c.3 0 .5.2.5.5v6.2z",fillRule:"evenodd",clipRule:"evenodd"}));const f=["sortable/entry"];var m=JSON.parse('{"u2":"sortable/container"}');(0,n.registerBlockType)(m.u2,{edit:function(e){const{clientId:t,attributes:r,setAttributes:n}=e,i=(0,a.useBlockProps)({className:l()({"is-list":"list"===r.layout,"is-grid":"grid"===r.layout,[`columns-${r.columns}`]:"grid"===r.layout})}),{replaceInnerBlocks:d}=(0,c.useDispatch)(a.store),{childBlocks:m}=(0,c.useSelect)((e=>{const{getBlocks:r}=e(a.store);return{childBlocks:r(t)}}),[t]);(0,o.useEffect)((()=>{if(m.length>0&&!r.orderBy||r.order){let e=[];e="asc"===r.order?[...m].sort(((e,t)=>Number(new Date(e.attributes.dateTime))-Number(new Date(t.attributes.dateTime)))):[...m].sort(((e,t)=>Number(new Date(t.attributes.dateTime))-Number(new Date(e.attributes.dateTime)))),n({orderBy:"date"}),d(t,e,!1)}}),[r.orderBy,r.order]),(0,o.useEffect)((()=>{""===r.order&&n({order:"desc"})}),[r.order]);const w=[{icon:v,title:(0,s.__)("List view"),onClick:()=>n({layout:"list"}),isActive:"list"===r.layout},{icon:p,title:(0,s.__)("Grid view"),onClick:()=>n({layout:"grid"}),isActive:"grid"===r.layout}],h=(0,a.useInnerBlocksProps)(i,{allowedBlocks:f,orientation:"horizontal",renderAppender:a.InnerBlocks.ButtonBlockAppender});return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(a.InspectorControls,null,"grid"===r.layout&&(0,o.createElement)(u.PanelBody,{title:(0,s.__)("Grid settings")},(0,o.createElement)(u.RangeControl,{__nextHasNoMarginBottom:!0,label:(0,s.__)("Columns"),value:r.columns,onChange:e=>n({columns:e}),min:2,max:6,required:!0})),(0,o.createElement)(u.PanelBody,{title:(0,s.__)("Order settings")},(0,o.createElement)(u.SelectControl,{label:(0,s.__)("Order"),value:r.order,options:[{label:(0,s.__)("Newest to oldest"),value:"desc"},{label:(0,s.__)("Oldest to newest"),value:"asc"}],onChange:e=>n({order:e}),__nextHasNoMarginBottom:!0}))),(0,o.createElement)(a.BlockControls,null,(0,o.createElement)(u.ToolbarGroup,{controls:w})),(0,o.createElement)("div",h))},save:function(e){const{attributes:t}=e,r=a.useInnerBlocksProps.save(a.useBlockProps.save({className:l()({"is-list":"list"===t.layout,"is-grid":"grid"===t.layout,[`columns-${t.columns}`]:"grid"===t.layout})}));return(0,o.createElement)("div",r)}})},184:function(e,t){var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var i=typeof r;if("string"===i||"number"===i)e.push(r);else if(Array.isArray(r)){if(r.length){var l=o.apply(null,r);l&&e.push(l)}}else if("object"===i){if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]")){e.push(r.toString());continue}for(var s in r)n.call(r,s)&&r[s]&&e.push(s)}}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()}},r={};function n(e){var o=r[e];if(void 0!==o)return o.exports;var i=r[e]={exports:{}};return t[e](i,i.exports,n),i.exports}n.m=t,e=[],n.O=function(t,r,o,i){if(!r){var l=1/0;for(u=0;u<e.length;u++){r=e[u][0],o=e[u][1],i=e[u][2];for(var s=!0,a=0;a<r.length;a++)(!1&i||l>=i)&&Object.keys(n.O).every((function(e){return n.O[e](r[a])}))?r.splice(a--,1):(s=!1,i<l&&(l=i));if(s){e.splice(u--,1);var c=o();void 0!==c&&(t=c)}}return t}i=i||0;for(var u=e.length;u>0&&e[u-1][2]>i;u--)e[u]=e[u-1];e[u]=[r,o,i]},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e={837:0,989:0};n.O.j=function(t){return 0===e[t]};var t=function(t,r){var o,i,l=r[0],s=r[1],a=r[2],c=0;if(l.some((function(t){return 0!==e[t]}))){for(o in s)n.o(s,o)&&(n.m[o]=s[o]);if(a)var u=a(n)}for(t&&t(r);c<l.length;c++)i=l[c],n.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return n.O(u)},r=self.webpackChunksortable=self.webpackChunksortable||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))}();var o=n.O(void 0,[989],(function(){return n(66)}));o=n.O(o)}(); -
sortable-block/tags/1.3.0/build/container/style-index.css
r2870387 r2870391 1 /*!*************************************************************************************************************************************************************************************************************************************************!*\ 2 !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/container/style.scss ***! 3 \*************************************************************************************************************************************************************************************************************************************************/ 4 /** 5 * The following styles get applied both on the front of a website 6 * and in the editor. 7 */ 8 .wp-block-sortable-container.is-list { 9 display: flex; 10 flex-direction: column; 11 gap: var(--wp--style--block-gap); 12 } 13 .wp-block-sortable-container.is-grid { 14 display: grid; 15 grid-template-columns: repeat(1, minmax(0, 1fr)); 16 gap: var(--wp--style--block-gap); 17 } 18 19 @media (min-width: 782px) { 20 .wp-block-sortable-container.is-grid.columns-2 { 21 grid-template-columns: repeat(2, minmax(0, 1fr)); 22 } 23 .wp-block-sortable-container.is-grid.columns-3 { 24 grid-template-columns: repeat(3, minmax(0, 1fr)); 25 } 26 .wp-block-sortable-container.is-grid.columns-4 { 27 grid-template-columns: repeat(4, minmax(0, 1fr)); 28 } 29 .wp-block-sortable-container.is-grid.columns-5 { 30 grid-template-columns: repeat(5, minmax(0, 1fr)); 31 } 32 .wp-block-sortable-container.is-grid.columns-6 { 33 grid-template-columns: repeat(6, minmax(0, 1fr)); 34 } 35 } 36 37 /*# sourceMappingURL=style-index.css.map*/ 1 .wp-block-sortable-container.is-list{display:flex;flex-direction:column;gap:var(--wp--style--block-gap)}.wp-block-sortable-container.is-grid{display:grid;gap:var(--wp--style--block-gap);grid-template-columns:repeat(1,minmax(0,1fr))}@media(min-width:782px){.wp-block-sortable-container.is-grid.columns-2{grid-template-columns:repeat(2,minmax(0,1fr))}.wp-block-sortable-container.is-grid.columns-3{grid-template-columns:repeat(3,minmax(0,1fr))}.wp-block-sortable-container.is-grid.columns-4{grid-template-columns:repeat(4,minmax(0,1fr))}.wp-block-sortable-container.is-grid.columns-5{grid-template-columns:repeat(5,minmax(0,1fr))}.wp-block-sortable-container.is-grid.columns-6{grid-template-columns:repeat(6,minmax(0,1fr))}} -
sortable-block/tags/1.3.0/build/date/index.asset.php
r2870387 r2870391 1 <?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-date', 'wp-element', 'wp-i18n'), 'version' => ' 67fcc7de9dd665ce8757');1 <?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-date', 'wp-element', 'wp-i18n'), 'version' => 'c4ac28f82b1ce9f52b48'); -
sortable-block/tags/1.3.0/build/date/index.css
r2870387 r2870391 1 /*!*********************************************************************************************************************************************************************************************************************************************!*\2 !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/date/editor.scss ***!3 \*********************************************************************************************************************************************************************************************************************************************/4 /**5 * The following styles get applied inside the editor only.6 */7 1 8 /*# sourceMappingURL=index.css.map*/ -
sortable-block/tags/1.3.0/build/date/index.js
r2870387 r2870391 1 /******/ (function() { // webpackBootstrap 2 /******/ "use strict"; 3 /******/ var __webpack_modules__ = ({ 4 5 /***/ "./src/date/edit.js": 6 /*!**************************!*\ 7 !*** ./src/date/edit.js ***! 8 \**************************/ 9 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 10 11 __webpack_require__.r(__webpack_exports__); 12 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 13 /* harmony export */ "default": function() { return /* binding */ Edit; }, 14 /* harmony export */ "is12HourFormat": function() { return /* binding */ is12HourFormat; } 15 /* harmony export */ }); 16 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 17 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 18 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 19 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); 20 /* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/core-data */ "@wordpress/core-data"); 21 /* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_2__); 22 /* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/date */ "@wordpress/date"); 23 /* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_date__WEBPACK_IMPORTED_MODULE_3__); 24 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); 25 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_4__); 26 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 27 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__); 28 /* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./editor.scss */ "./src/date/editor.scss"); 29 30 /** 31 * Retrieves the translation of text. 32 * 33 * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-i18n/ 34 */ 35 36 37 /** 38 * WordPress dependencies 39 */ 40 41 42 43 /** 44 * React hook that is used to mark the block wrapper element. 45 * It provides all the necessary props like the class name. 46 * 47 * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-editor/#useblockprops 48 */ 49 50 51 52 /** 53 * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files. 54 * Those files can contain any CSS code that gets applied to the editor. 55 * 56 * @see https://www.npmjs.com/package/@wordpress/scripts#using-css 57 */ 58 59 60 /** 61 * The edit function describes the structure of your block in the context of the 62 * editor. This represents what the editor will render when the block is used. 63 * 64 * @param {Object} props All props passed to this function. 65 * @return {WPElement} Element to render. 66 * 67 * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#edit 68 */ 69 function Edit(props) { 70 const { 71 context, 72 attributes, 73 setAttributes 74 } = props; 75 const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_4__.useBlockProps)(); 76 const dateSettings = (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_3__.getSettings)(); 77 const [siteFormat = dateSettings.formats.date] = (0,_wordpress_core_data__WEBPACK_IMPORTED_MODULE_2__.useEntityProp)('root', 'site', 'date_format'); 78 const [siteTimeFormat = dateSettings.formats.time] = (0,_wordpress_core_data__WEBPACK_IMPORTED_MODULE_2__.useEntityProp)('root', 'site', 'time_format'); 79 const date = context['sortable/entryDateTime']; 80 const entryDate = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("time", { 81 dateTime: (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_3__.format)('c', date) 82 }, (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_3__.format)(attributes.format || siteFormat, date)); 83 return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_4__.InspectorControls, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.PanelBody, { 84 title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Settings') 85 }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_4__.__experimentalDateFormatPicker, { 86 format: attributes.format, 87 defaultFormat: siteFormat, 88 is12Hour: is12HourFormat(siteTimeFormat), 89 onChange: nextFormat => setAttributes({ 90 format: nextFormat 91 }) 92 }))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", blockProps, entryDate)); 93 } 94 95 /** 96 * To know if the time format is a 12 hour time, look for any of the 12 hour 97 * format characters: 'a', 'A', 'g', and 'h'. The character must be 98 * unescaped, i.e. not preceded by a '\'. Coincidentally, 'aAgh' is how I 99 * feel when working with regular expressions. 100 * https://www.php.net/manual/en/datetime.format.php 101 * 102 * @param {string} dateFormat Date format. 103 */ 104 function is12HourFormat(dateFormat) { 105 return /(?:^|[^\\])[aAgh]/.test(dateFormat); 106 } 107 108 /***/ }), 109 110 /***/ "./src/date/index.js": 111 /*!***************************!*\ 112 !*** ./src/date/index.js ***! 113 \***************************/ 114 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 115 116 __webpack_require__.r(__webpack_exports__); 117 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 118 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__); 119 /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./style.scss */ "./src/date/style.scss"); 120 /* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./edit */ "./src/date/edit.js"); 121 /* harmony import */ var _save__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./save */ "./src/date/save.js"); 122 /* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./block.json */ "./src/date/block.json"); 123 /** 124 * Registers a new block provided a unique name and an object defining its behavior. 125 * 126 * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/ 127 */ 128 129 130 /** 131 * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files. 132 * All files containing `style` keyword are bundled together. The code used 133 * gets applied both to the front of your site and to the editor. 134 * 135 * @see https://www.npmjs.com/package/@wordpress/scripts#using-css 136 */ 137 138 139 /** 140 * Internal dependencies 141 */ 142 143 144 145 146 /** 147 * Every block starts by registering a new block type definition. 148 * 149 * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/ 150 */ 151 (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_4__.name, { 152 /** 153 * @see ./edit.js 154 */ 155 edit: _edit__WEBPACK_IMPORTED_MODULE_2__["default"], 156 /** 157 * @see ./save.js 158 */ 159 save: _save__WEBPACK_IMPORTED_MODULE_3__["default"] 160 }); 161 162 /***/ }), 163 164 /***/ "./src/date/save.js": 165 /*!**************************!*\ 166 !*** ./src/date/save.js ***! 167 \**************************/ 168 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 169 170 __webpack_require__.r(__webpack_exports__); 171 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 172 /* harmony export */ "default": function() { return /* binding */ save; } 173 /* harmony export */ }); 174 /** 175 * The save function defines the way in which the different attributes should 176 * be combined into the final markup, which is then serialized by the block 177 * editor into `post_content`. 178 * 179 * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#save 180 * 181 * @return {WPElement} Element to render. 182 */ 183 function save() { 184 return null; 185 } 186 187 /***/ }), 188 189 /***/ "./src/date/editor.scss": 190 /*!******************************!*\ 191 !*** ./src/date/editor.scss ***! 192 \******************************/ 193 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 194 195 __webpack_require__.r(__webpack_exports__); 196 // extracted by mini-css-extract-plugin 197 198 199 /***/ }), 200 201 /***/ "./src/date/style.scss": 202 /*!*****************************!*\ 203 !*** ./src/date/style.scss ***! 204 \*****************************/ 205 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 206 207 __webpack_require__.r(__webpack_exports__); 208 // extracted by mini-css-extract-plugin 209 210 211 /***/ }), 212 213 /***/ "@wordpress/block-editor": 214 /*!*************************************!*\ 215 !*** external ["wp","blockEditor"] ***! 216 \*************************************/ 217 /***/ (function(module) { 218 219 module.exports = window["wp"]["blockEditor"]; 220 221 /***/ }), 222 223 /***/ "@wordpress/blocks": 224 /*!********************************!*\ 225 !*** external ["wp","blocks"] ***! 226 \********************************/ 227 /***/ (function(module) { 228 229 module.exports = window["wp"]["blocks"]; 230 231 /***/ }), 232 233 /***/ "@wordpress/components": 234 /*!************************************!*\ 235 !*** external ["wp","components"] ***! 236 \************************************/ 237 /***/ (function(module) { 238 239 module.exports = window["wp"]["components"]; 240 241 /***/ }), 242 243 /***/ "@wordpress/core-data": 244 /*!**********************************!*\ 245 !*** external ["wp","coreData"] ***! 246 \**********************************/ 247 /***/ (function(module) { 248 249 module.exports = window["wp"]["coreData"]; 250 251 /***/ }), 252 253 /***/ "@wordpress/date": 254 /*!******************************!*\ 255 !*** external ["wp","date"] ***! 256 \******************************/ 257 /***/ (function(module) { 258 259 module.exports = window["wp"]["date"]; 260 261 /***/ }), 262 263 /***/ "@wordpress/element": 264 /*!*********************************!*\ 265 !*** external ["wp","element"] ***! 266 \*********************************/ 267 /***/ (function(module) { 268 269 module.exports = window["wp"]["element"]; 270 271 /***/ }), 272 273 /***/ "@wordpress/i18n": 274 /*!******************************!*\ 275 !*** external ["wp","i18n"] ***! 276 \******************************/ 277 /***/ (function(module) { 278 279 module.exports = window["wp"]["i18n"]; 280 281 /***/ }), 282 283 /***/ "./src/date/block.json": 284 /*!*****************************!*\ 285 !*** ./src/date/block.json ***! 286 \*****************************/ 287 /***/ (function(module) { 288 289 module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"sortable/date","version":"1.2.0","title":"Sortable Date","category":"widgets","icon":"calendar","description":"Since this block is dependent on the Sortable Entry block, it displays the date set in it and also allows to customize how the date is displayed by providing the option to change the date format.","ancestor":["sortable/entry"],"attributes":{"format":{"type":"string"}},"supports":{"html":false,"color":{"gradients":true,"link":false,"__experimentalDefaultControls":{"background":true,"text":true}},"spacing":{"padding":true},"typography":{"fontSize":true,"lineHeight":true,"__experimentalFontFamily":true,"__experimentalFontWeight":true,"__experimentalFontStyle":true,"__experimentalTextTransform":true,"__experimentalTextDecoration":true,"__experimentalLetterSpacing":true,"__experimentalDefaultControls":{"fontSize":true}}},"usesContext":["sortable/entryDateTime"],"textdomain":"sortable","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css"}'); 290 291 /***/ }) 292 293 /******/ }); 294 /************************************************************************/ 295 /******/ // The module cache 296 /******/ var __webpack_module_cache__ = {}; 297 /******/ 298 /******/ // The require function 299 /******/ function __webpack_require__(moduleId) { 300 /******/ // Check if module is in cache 301 /******/ var cachedModule = __webpack_module_cache__[moduleId]; 302 /******/ if (cachedModule !== undefined) { 303 /******/ return cachedModule.exports; 304 /******/ } 305 /******/ // Create a new module (and put it into the cache) 306 /******/ var module = __webpack_module_cache__[moduleId] = { 307 /******/ // no module.id needed 308 /******/ // no module.loaded needed 309 /******/ exports: {} 310 /******/ }; 311 /******/ 312 /******/ // Execute the module function 313 /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); 314 /******/ 315 /******/ // Return the exports of the module 316 /******/ return module.exports; 317 /******/ } 318 /******/ 319 /******/ // expose the modules object (__webpack_modules__) 320 /******/ __webpack_require__.m = __webpack_modules__; 321 /******/ 322 /************************************************************************/ 323 /******/ /* webpack/runtime/chunk loaded */ 324 /******/ !function() { 325 /******/ var deferred = []; 326 /******/ __webpack_require__.O = function(result, chunkIds, fn, priority) { 327 /******/ if(chunkIds) { 328 /******/ priority = priority || 0; 329 /******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; 330 /******/ deferred[i] = [chunkIds, fn, priority]; 331 /******/ return; 332 /******/ } 333 /******/ var notFulfilled = Infinity; 334 /******/ for (var i = 0; i < deferred.length; i++) { 335 /******/ var chunkIds = deferred[i][0]; 336 /******/ var fn = deferred[i][1]; 337 /******/ var priority = deferred[i][2]; 338 /******/ var fulfilled = true; 339 /******/ for (var j = 0; j < chunkIds.length; j++) { 340 /******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every(function(key) { return __webpack_require__.O[key](chunkIds[j]); })) { 341 /******/ chunkIds.splice(j--, 1); 342 /******/ } else { 343 /******/ fulfilled = false; 344 /******/ if(priority < notFulfilled) notFulfilled = priority; 345 /******/ } 346 /******/ } 347 /******/ if(fulfilled) { 348 /******/ deferred.splice(i--, 1) 349 /******/ var r = fn(); 350 /******/ if (r !== undefined) result = r; 351 /******/ } 352 /******/ } 353 /******/ return result; 354 /******/ }; 355 /******/ }(); 356 /******/ 357 /******/ /* webpack/runtime/compat get default export */ 358 /******/ !function() { 359 /******/ // getDefaultExport function for compatibility with non-harmony modules 360 /******/ __webpack_require__.n = function(module) { 361 /******/ var getter = module && module.__esModule ? 362 /******/ function() { return module['default']; } : 363 /******/ function() { return module; }; 364 /******/ __webpack_require__.d(getter, { a: getter }); 365 /******/ return getter; 366 /******/ }; 367 /******/ }(); 368 /******/ 369 /******/ /* webpack/runtime/define property getters */ 370 /******/ !function() { 371 /******/ // define getter functions for harmony exports 372 /******/ __webpack_require__.d = function(exports, definition) { 373 /******/ for(var key in definition) { 374 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 375 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 376 /******/ } 377 /******/ } 378 /******/ }; 379 /******/ }(); 380 /******/ 381 /******/ /* webpack/runtime/hasOwnProperty shorthand */ 382 /******/ !function() { 383 /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } 384 /******/ }(); 385 /******/ 386 /******/ /* webpack/runtime/make namespace object */ 387 /******/ !function() { 388 /******/ // define __esModule on exports 389 /******/ __webpack_require__.r = function(exports) { 390 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 391 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 392 /******/ } 393 /******/ Object.defineProperty(exports, '__esModule', { value: true }); 394 /******/ }; 395 /******/ }(); 396 /******/ 397 /******/ /* webpack/runtime/jsonp chunk loading */ 398 /******/ !function() { 399 /******/ // no baseURI 400 /******/ 401 /******/ // object to store loaded and loading chunks 402 /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched 403 /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded 404 /******/ var installedChunks = { 405 /******/ "date/index": 0, 406 /******/ "date/style-index": 0 407 /******/ }; 408 /******/ 409 /******/ // no chunk on demand loading 410 /******/ 411 /******/ // no prefetching 412 /******/ 413 /******/ // no preloaded 414 /******/ 415 /******/ // no HMR 416 /******/ 417 /******/ // no HMR manifest 418 /******/ 419 /******/ __webpack_require__.O.j = function(chunkId) { return installedChunks[chunkId] === 0; }; 420 /******/ 421 /******/ // install a JSONP callback for chunk loading 422 /******/ var webpackJsonpCallback = function(parentChunkLoadingFunction, data) { 423 /******/ var chunkIds = data[0]; 424 /******/ var moreModules = data[1]; 425 /******/ var runtime = data[2]; 426 /******/ // add "moreModules" to the modules object, 427 /******/ // then flag all "chunkIds" as loaded and fire callback 428 /******/ var moduleId, chunkId, i = 0; 429 /******/ if(chunkIds.some(function(id) { return installedChunks[id] !== 0; })) { 430 /******/ for(moduleId in moreModules) { 431 /******/ if(__webpack_require__.o(moreModules, moduleId)) { 432 /******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; 433 /******/ } 434 /******/ } 435 /******/ if(runtime) var result = runtime(__webpack_require__); 436 /******/ } 437 /******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); 438 /******/ for(;i < chunkIds.length; i++) { 439 /******/ chunkId = chunkIds[i]; 440 /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { 441 /******/ installedChunks[chunkId][0](); 442 /******/ } 443 /******/ installedChunks[chunkId] = 0; 444 /******/ } 445 /******/ return __webpack_require__.O(result); 446 /******/ } 447 /******/ 448 /******/ var chunkLoadingGlobal = self["webpackChunksortable"] = self["webpackChunksortable"] || []; 449 /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); 450 /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); 451 /******/ }(); 452 /******/ 453 /************************************************************************/ 454 /******/ 455 /******/ // startup 456 /******/ // Load entry module and return exports 457 /******/ // This entry module depends on other loaded chunks and execution need to be delayed 458 /******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["date/style-index"], function() { return __webpack_require__("./src/date/index.js"); }) 459 /******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__); 460 /******/ 461 /******/ })() 462 ; 463 //# sourceMappingURL=index.js.map 1 !function(){"use strict";var t,e={448:function(){var t=window.wp.blocks,e=window.wp.element,r=window.wp.i18n,n=window.wp.coreData,o=window.wp.date,a=window.wp.blockEditor,i=window.wp.components,u=JSON.parse('{"u2":"sortable/date"}');(0,t.registerBlockType)(u.u2,{edit:function(t){const{context:u,attributes:s,setAttributes:l}=t,c=(0,a.useBlockProps)(),f=(0,o.getSettings)(),[m=f.formats.date]=(0,n.useEntityProp)("root","site","date_format"),[p=f.formats.time]=(0,n.useEntityProp)("root","site","time_format"),w=u["sortable/entryDateTime"],d=(0,e.createElement)("time",{dateTime:(0,o.format)("c",w)},(0,o.format)(s.format||m,w));return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(a.InspectorControls,null,(0,e.createElement)(i.PanelBody,{title:(0,r.__)("Settings")},(0,e.createElement)(a.__experimentalDateFormatPicker,{format:s.format,defaultFormat:m,is12Hour:(v=p,/(?:^|[^\\])[aAgh]/.test(v)),onChange:t=>l({format:t})}))),(0,e.createElement)("div",c,d));var v},save:function(){return null}})}},r={};function n(t){var o=r[t];if(void 0!==o)return o.exports;var a=r[t]={exports:{}};return e[t](a,a.exports,n),a.exports}n.m=e,t=[],n.O=function(e,r,o,a){if(!r){var i=1/0;for(c=0;c<t.length;c++){r=t[c][0],o=t[c][1],a=t[c][2];for(var u=!0,s=0;s<r.length;s++)(!1&a||i>=a)&&Object.keys(n.O).every((function(t){return n.O[t](r[s])}))?r.splice(s--,1):(u=!1,a<i&&(i=a));if(u){t.splice(c--,1);var l=o();void 0!==l&&(e=l)}}return e}a=a||0;for(var c=t.length;c>0&&t[c-1][2]>a;c--)t[c]=t[c-1];t[c]=[r,o,a]},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},function(){var t={964:0,966:0};n.O.j=function(e){return 0===t[e]};var e=function(e,r){var o,a,i=r[0],u=r[1],s=r[2],l=0;if(i.some((function(e){return 0!==t[e]}))){for(o in u)n.o(u,o)&&(n.m[o]=u[o]);if(s)var c=s(n)}for(e&&e(r);l<i.length;l++)a=i[l],n.o(t,a)&&t[a]&&t[a][0](),t[a]=0;return n.O(c)},r=self.webpackChunksortable=self.webpackChunksortable||[];r.forEach(e.bind(null,0)),r.push=e.bind(null,r.push.bind(r))}();var o=n.O(void 0,[966],(function(){return n(448)}));o=n.O(o)}(); -
sortable-block/tags/1.3.0/build/date/style-index.css
r2870387 r2870391 1 /*!********************************************************************************************************************************************************************************************************************************************!*\2 !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/date/style.scss ***!3 \********************************************************************************************************************************************************************************************************************************************/4 /**5 * The following styles get applied both on the front of a website6 * and in the editor.7 */8 1 9 /*# sourceMappingURL=style-index.css.map*/ -
sortable-block/tags/1.3.0/build/entry/block.json
r2870387 r2870391 3 3 "apiVersion": 2, 4 4 "name": "sortable/entry", 5 "version": "1. 0.1",5 "version": "1.3.0", 6 6 "title": "Sortable Entry", 7 7 "category": "widgets", -
sortable-block/tags/1.3.0/build/entry/index.asset.php
r2870387 r2870391 1 <?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => ' 3dc95446178a2874c0fd');1 <?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => 'fb56f8d5a5bd9d88bda3'); -
sortable-block/tags/1.3.0/build/entry/index.css
r2870387 r2870391 1 /*!**********************************************************************************************************************************************************************************************************************************************!*\ 2 !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/entry/editor.scss ***! 3 \**********************************************************************************************************************************************************************************************************************************************/ 4 /** 5 * The following styles get applied inside the editor only. 6 */ 7 .wp-block-sortable-entry > .block-list-appender .block-editor-button-block-appender { 8 flex-direction: row; 9 box-shadow: none; 10 border: 1px dashed; 11 } 12 .wp-block-sortable-entry > .block-list-appender .block-editor-button-block-appender::after { 13 content: attr(aria-label); 14 } 15 16 /*# sourceMappingURL=index.css.map*/ 1 .wp-block-sortable-entry>.block-list-appender .block-editor-button-block-appender{border:1px dashed;box-shadow:none;flex-direction:row}.wp-block-sortable-entry>.block-list-appender .block-editor-button-block-appender:after{content:attr(aria-label)} -
sortable-block/tags/1.3.0/build/entry/index.js
r2870387 r2870391 1 /******/ (function() { // webpackBootstrap 2 /******/ "use strict"; 3 /******/ var __webpack_modules__ = ({ 4 5 /***/ "./src/entry/edit.js": 6 /*!***************************!*\ 7 !*** ./src/entry/edit.js ***! 8 \***************************/ 9 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 10 11 __webpack_require__.r(__webpack_exports__); 12 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 13 /* harmony export */ "default": function() { return /* binding */ Edit; } 14 /* harmony export */ }); 15 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 16 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 17 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 18 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); 19 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); 20 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__); 21 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 22 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__); 23 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 24 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__); 25 /* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./editor.scss */ "./src/entry/editor.scss"); 26 27 /** 28 * Retrieves the translation of text. 29 * 30 * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-i18n/ 31 */ 32 33 34 /** 35 * React hook that is used to mark the block wrapper element. 36 * It provides all the necessary props like the class name. 37 * 38 * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-editor/#useblockprops 39 */ 40 41 42 /** 43 * This package includes a library of generic WordPress components. 44 * 45 * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-components/ 46 */ 47 48 49 /** 50 * WordPress dependencies. 51 * 52 * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-element/ , 53 * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-data/ 54 */ 55 56 57 58 /** 59 * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files. 60 * Those files can contain any CSS code that gets applied to the editor. 61 * 62 * @see https://www.npmjs.com/package/@wordpress/scripts#using-css 63 */ 64 65 66 /** 67 * Allowed blocks constant is passed to InnerBlocks precisely as specified here. 68 * The contents of the array should never change. 69 * The array should contain the name of each block that is allowed. 70 * In columns block, the only block we allow is 'core/column'. 71 * 72 * @constant 73 * @type {string[]} 74 */ 75 const ALLOWED_BLOCKS = ['sortable/date', 'core/heading', 'core/paragraph', 'core/media-text', 'core/group', 'core/columns', 'core/block']; 76 77 /** 78 * The edit function describes the structure of your block in the context of the 79 * editor. This represents what the editor will render when the block is used. 80 * 81 * @param {Object} props All props passed to this function. 82 * @return {WPElement} Element to render. 83 * 84 * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#edit 85 */ 86 function Edit(props) { 87 const { 88 clientId, 89 attributes: { 90 dateTime 91 }, 92 setAttributes 93 } = props; 94 const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.useBlockProps)(); 95 const { 96 updateBlockAttributes 97 } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_4__.useDispatch)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.store); 98 const { 99 rootClientId, 100 hasChildBlocks 101 } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => { 102 const { 103 getBlockRootClientId, 104 getBlockOrder 105 } = select(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.store); 106 const rootId = getBlockRootClientId(clientId); 107 return { 108 rootClientId: rootId, 109 hasChildBlocks: getBlockOrder(clientId).length > 0 110 }; 111 }, [clientId]); 112 113 // Update date in block. 114 const updateDate = value => { 115 setAttributes({ 116 dateTime: value 117 }); 118 119 // Reset parent block sorting. 120 updateBlockAttributes(rootClientId, { 121 orderBy: '' 122 }); 123 }; 124 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { 125 if (!dateTime) { 126 setAttributes({ 127 dateTime: new Date() 128 }); 129 130 // Reset parent block sorting. 131 updateBlockAttributes(rootClientId, { 132 orderBy: '' 133 }); 134 } 135 }, [dateTime]); 136 const innerBlocksProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.useInnerBlocksProps)(blockProps, { 137 allowedBlocks: ALLOWED_BLOCKS, 138 orientation: 'horizontal', 139 renderAppender: hasChildBlocks ? undefined : _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.InnerBlocks.ButtonBlockAppender 140 }); 141 return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.InspectorControls, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.PanelBody, { 142 title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Date Settings', 'sortable') 143 }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.PanelRow, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.DateTimePicker, { 144 currentDate: dateTime, 145 onChange: updateDate, 146 is12Hour: true, 147 __nextRemoveHelpButton: true, 148 __nextRemoveResetButton: true 149 })))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", innerBlocksProps)); 150 } 151 152 /***/ }), 153 154 /***/ "./src/entry/index.js": 155 /*!****************************!*\ 156 !*** ./src/entry/index.js ***! 157 \****************************/ 158 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 159 160 __webpack_require__.r(__webpack_exports__); 161 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 162 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__); 163 /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./style.scss */ "./src/entry/style.scss"); 164 /* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./edit */ "./src/entry/edit.js"); 165 /* harmony import */ var _save__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./save */ "./src/entry/save.js"); 166 /* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./block.json */ "./src/entry/block.json"); 167 /** 168 * Registers a new block provided a unique name and an object defining its behavior. 169 * 170 * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/ 171 */ 172 173 174 /** 175 * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files. 176 * All files containing `style` keyword are bundled together. The code used 177 * gets applied both to the front of your site and to the editor. 178 * 179 * @see https://www.npmjs.com/package/@wordpress/scripts#using-css 180 */ 181 182 183 /** 184 * Internal dependencies 185 */ 186 187 188 189 190 /** 191 * Every block starts by registering a new block type definition. 192 * 193 * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/ 194 */ 195 (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_4__.name, { 196 /** 197 * @see ./edit.js 198 */ 199 edit: _edit__WEBPACK_IMPORTED_MODULE_2__["default"], 200 /** 201 * @see ./save.js 202 */ 203 save: _save__WEBPACK_IMPORTED_MODULE_3__["default"] 204 }); 205 206 /***/ }), 207 208 /***/ "./src/entry/save.js": 209 /*!***************************!*\ 210 !*** ./src/entry/save.js ***! 211 \***************************/ 212 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 213 214 __webpack_require__.r(__webpack_exports__); 215 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 216 /* harmony export */ "default": function() { return /* binding */ save; } 217 /* harmony export */ }); 218 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 219 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 220 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); 221 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__); 222 223 /** 224 * React hook that is used to mark the block wrapper element. 225 * It provides all the necessary props like the class name. 226 * 227 * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-editor/#useblockprops 228 */ 229 230 231 /** 232 * The save function defines the way in which the different attributes should 233 * be combined into the final markup, which is then serialized by the block 234 * editor into `post_content`. 235 * 236 * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#save 237 * 238 * @return {WPElement} Element to render. 239 */ 240 function save() { 241 const innerBlocksProps = _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useInnerBlocksProps.save(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps.save()); 242 return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", innerBlocksProps); 243 } 244 245 /***/ }), 246 247 /***/ "./src/entry/editor.scss": 248 /*!*******************************!*\ 249 !*** ./src/entry/editor.scss ***! 250 \*******************************/ 251 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 252 253 __webpack_require__.r(__webpack_exports__); 254 // extracted by mini-css-extract-plugin 255 256 257 /***/ }), 258 259 /***/ "./src/entry/style.scss": 260 /*!******************************!*\ 261 !*** ./src/entry/style.scss ***! 262 \******************************/ 263 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 264 265 __webpack_require__.r(__webpack_exports__); 266 // extracted by mini-css-extract-plugin 267 268 269 /***/ }), 270 271 /***/ "@wordpress/block-editor": 272 /*!*************************************!*\ 273 !*** external ["wp","blockEditor"] ***! 274 \*************************************/ 275 /***/ (function(module) { 276 277 module.exports = window["wp"]["blockEditor"]; 278 279 /***/ }), 280 281 /***/ "@wordpress/blocks": 282 /*!********************************!*\ 283 !*** external ["wp","blocks"] ***! 284 \********************************/ 285 /***/ (function(module) { 286 287 module.exports = window["wp"]["blocks"]; 288 289 /***/ }), 290 291 /***/ "@wordpress/components": 292 /*!************************************!*\ 293 !*** external ["wp","components"] ***! 294 \************************************/ 295 /***/ (function(module) { 296 297 module.exports = window["wp"]["components"]; 298 299 /***/ }), 300 301 /***/ "@wordpress/data": 302 /*!******************************!*\ 303 !*** external ["wp","data"] ***! 304 \******************************/ 305 /***/ (function(module) { 306 307 module.exports = window["wp"]["data"]; 308 309 /***/ }), 310 311 /***/ "@wordpress/element": 312 /*!*********************************!*\ 313 !*** external ["wp","element"] ***! 314 \*********************************/ 315 /***/ (function(module) { 316 317 module.exports = window["wp"]["element"]; 318 319 /***/ }), 320 321 /***/ "@wordpress/i18n": 322 /*!******************************!*\ 323 !*** external ["wp","i18n"] ***! 324 \******************************/ 325 /***/ (function(module) { 326 327 module.exports = window["wp"]["i18n"]; 328 329 /***/ }), 330 331 /***/ "./src/entry/block.json": 332 /*!******************************!*\ 333 !*** ./src/entry/block.json ***! 334 \******************************/ 335 /***/ (function(module) { 336 337 module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"sortable/entry","version":"1.0.1","title":"Sortable Entry","category":"widgets","icon":"media-document","description":"This block serves as an entry that needs to be sorted, and it is where you can set the date and keep specific content for the entry.","parent":["sortable/container"],"supports":{"html":false},"attributes":{"dateTime":{"type":"string"}},"providesContext":{"sortable/entryDateTime":"dateTime"},"textdomain":"sortable","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css"}'); 338 339 /***/ }) 340 341 /******/ }); 342 /************************************************************************/ 343 /******/ // The module cache 344 /******/ var __webpack_module_cache__ = {}; 345 /******/ 346 /******/ // The require function 347 /******/ function __webpack_require__(moduleId) { 348 /******/ // Check if module is in cache 349 /******/ var cachedModule = __webpack_module_cache__[moduleId]; 350 /******/ if (cachedModule !== undefined) { 351 /******/ return cachedModule.exports; 352 /******/ } 353 /******/ // Create a new module (and put it into the cache) 354 /******/ var module = __webpack_module_cache__[moduleId] = { 355 /******/ // no module.id needed 356 /******/ // no module.loaded needed 357 /******/ exports: {} 358 /******/ }; 359 /******/ 360 /******/ // Execute the module function 361 /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); 362 /******/ 363 /******/ // Return the exports of the module 364 /******/ return module.exports; 365 /******/ } 366 /******/ 367 /******/ // expose the modules object (__webpack_modules__) 368 /******/ __webpack_require__.m = __webpack_modules__; 369 /******/ 370 /************************************************************************/ 371 /******/ /* webpack/runtime/chunk loaded */ 372 /******/ !function() { 373 /******/ var deferred = []; 374 /******/ __webpack_require__.O = function(result, chunkIds, fn, priority) { 375 /******/ if(chunkIds) { 376 /******/ priority = priority || 0; 377 /******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; 378 /******/ deferred[i] = [chunkIds, fn, priority]; 379 /******/ return; 380 /******/ } 381 /******/ var notFulfilled = Infinity; 382 /******/ for (var i = 0; i < deferred.length; i++) { 383 /******/ var chunkIds = deferred[i][0]; 384 /******/ var fn = deferred[i][1]; 385 /******/ var priority = deferred[i][2]; 386 /******/ var fulfilled = true; 387 /******/ for (var j = 0; j < chunkIds.length; j++) { 388 /******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every(function(key) { return __webpack_require__.O[key](chunkIds[j]); })) { 389 /******/ chunkIds.splice(j--, 1); 390 /******/ } else { 391 /******/ fulfilled = false; 392 /******/ if(priority < notFulfilled) notFulfilled = priority; 393 /******/ } 394 /******/ } 395 /******/ if(fulfilled) { 396 /******/ deferred.splice(i--, 1) 397 /******/ var r = fn(); 398 /******/ if (r !== undefined) result = r; 399 /******/ } 400 /******/ } 401 /******/ return result; 402 /******/ }; 403 /******/ }(); 404 /******/ 405 /******/ /* webpack/runtime/compat get default export */ 406 /******/ !function() { 407 /******/ // getDefaultExport function for compatibility with non-harmony modules 408 /******/ __webpack_require__.n = function(module) { 409 /******/ var getter = module && module.__esModule ? 410 /******/ function() { return module['default']; } : 411 /******/ function() { return module; }; 412 /******/ __webpack_require__.d(getter, { a: getter }); 413 /******/ return getter; 414 /******/ }; 415 /******/ }(); 416 /******/ 417 /******/ /* webpack/runtime/define property getters */ 418 /******/ !function() { 419 /******/ // define getter functions for harmony exports 420 /******/ __webpack_require__.d = function(exports, definition) { 421 /******/ for(var key in definition) { 422 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 423 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 424 /******/ } 425 /******/ } 426 /******/ }; 427 /******/ }(); 428 /******/ 429 /******/ /* webpack/runtime/hasOwnProperty shorthand */ 430 /******/ !function() { 431 /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } 432 /******/ }(); 433 /******/ 434 /******/ /* webpack/runtime/make namespace object */ 435 /******/ !function() { 436 /******/ // define __esModule on exports 437 /******/ __webpack_require__.r = function(exports) { 438 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 439 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 440 /******/ } 441 /******/ Object.defineProperty(exports, '__esModule', { value: true }); 442 /******/ }; 443 /******/ }(); 444 /******/ 445 /******/ /* webpack/runtime/jsonp chunk loading */ 446 /******/ !function() { 447 /******/ // no baseURI 448 /******/ 449 /******/ // object to store loaded and loading chunks 450 /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched 451 /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded 452 /******/ var installedChunks = { 453 /******/ "entry/index": 0, 454 /******/ "entry/style-index": 0 455 /******/ }; 456 /******/ 457 /******/ // no chunk on demand loading 458 /******/ 459 /******/ // no prefetching 460 /******/ 461 /******/ // no preloaded 462 /******/ 463 /******/ // no HMR 464 /******/ 465 /******/ // no HMR manifest 466 /******/ 467 /******/ __webpack_require__.O.j = function(chunkId) { return installedChunks[chunkId] === 0; }; 468 /******/ 469 /******/ // install a JSONP callback for chunk loading 470 /******/ var webpackJsonpCallback = function(parentChunkLoadingFunction, data) { 471 /******/ var chunkIds = data[0]; 472 /******/ var moreModules = data[1]; 473 /******/ var runtime = data[2]; 474 /******/ // add "moreModules" to the modules object, 475 /******/ // then flag all "chunkIds" as loaded and fire callback 476 /******/ var moduleId, chunkId, i = 0; 477 /******/ if(chunkIds.some(function(id) { return installedChunks[id] !== 0; })) { 478 /******/ for(moduleId in moreModules) { 479 /******/ if(__webpack_require__.o(moreModules, moduleId)) { 480 /******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; 481 /******/ } 482 /******/ } 483 /******/ if(runtime) var result = runtime(__webpack_require__); 484 /******/ } 485 /******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); 486 /******/ for(;i < chunkIds.length; i++) { 487 /******/ chunkId = chunkIds[i]; 488 /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { 489 /******/ installedChunks[chunkId][0](); 490 /******/ } 491 /******/ installedChunks[chunkId] = 0; 492 /******/ } 493 /******/ return __webpack_require__.O(result); 494 /******/ } 495 /******/ 496 /******/ var chunkLoadingGlobal = self["webpackChunksortable"] = self["webpackChunksortable"] || []; 497 /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); 498 /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); 499 /******/ }(); 500 /******/ 501 /************************************************************************/ 502 /******/ 503 /******/ // startup 504 /******/ // Load entry module and return exports 505 /******/ // This entry module depends on other loaded chunks and execution need to be delayed 506 /******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["entry/style-index"], function() { return __webpack_require__("./src/entry/index.js"); }) 507 /******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__); 508 /******/ 509 /******/ })() 510 ; 511 //# sourceMappingURL=index.js.map 1 !function(){"use strict";var e,t={900:function(){var e=window.wp.blocks,t=window.wp.element,r=window.wp.i18n,n=window.wp.blockEditor,o=window.wp.components,l=window.wp.data;const c=["sortable/date","core/heading","core/paragraph","core/media-text","core/group","core/columns","core/block"];var i=JSON.parse('{"u2":"sortable/entry"}');(0,e.registerBlockType)(i.u2,{edit:function(e){const{clientId:i,attributes:{dateTime:s},setAttributes:a}=e,u=(0,n.useBlockProps)(),{updateBlockAttributes:d}=(0,l.useDispatch)(n.store),{rootClientId:p,hasChildBlocks:f}=(0,l.useSelect)((e=>{const{getBlockRootClientId:t,getBlockOrder:r}=e(n.store);return{rootClientId:t(i),hasChildBlocks:r(i).length>0}}),[i]);(0,t.useEffect)((()=>{s||(a({dateTime:new Date}),d(p,{orderBy:""}))}),[s]);const v=(0,n.useInnerBlocksProps)(u,{allowedBlocks:c,orientation:"horizontal",renderAppender:f?void 0:n.InnerBlocks.ButtonBlockAppender});return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(n.InspectorControls,null,(0,t.createElement)(o.PanelBody,{title:(0,r.__)("Date Settings","sortable")},(0,t.createElement)(o.PanelRow,null,(0,t.createElement)(o.DateTimePicker,{currentDate:s,onChange:e=>{a({dateTime:e}),d(p,{orderBy:""})},is12Hour:!0,__nextRemoveHelpButton:!0,__nextRemoveResetButton:!0})))),(0,t.createElement)("div",v))},save:function(){const e=n.useInnerBlocksProps.save(n.useBlockProps.save());return(0,t.createElement)("div",e)}})}},r={};function n(e){var o=r[e];if(void 0!==o)return o.exports;var l=r[e]={exports:{}};return t[e](l,l.exports,n),l.exports}n.m=t,e=[],n.O=function(t,r,o,l){if(!r){var c=1/0;for(u=0;u<e.length;u++){r=e[u][0],o=e[u][1],l=e[u][2];for(var i=!0,s=0;s<r.length;s++)(!1&l||c>=l)&&Object.keys(n.O).every((function(e){return n.O[e](r[s])}))?r.splice(s--,1):(i=!1,l<c&&(c=l));if(i){e.splice(u--,1);var a=o();void 0!==a&&(t=a)}}return t}l=l||0;for(var u=e.length;u>0&&e[u-1][2]>l;u--)e[u]=e[u-1];e[u]=[r,o,l]},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e={955:0,22:0};n.O.j=function(t){return 0===e[t]};var t=function(t,r){var o,l,c=r[0],i=r[1],s=r[2],a=0;if(c.some((function(t){return 0!==e[t]}))){for(o in i)n.o(i,o)&&(n.m[o]=i[o]);if(s)var u=s(n)}for(t&&t(r);a<c.length;a++)l=c[a],n.o(e,l)&&e[l]&&e[l][0](),e[l]=0;return n.O(u)},r=self.webpackChunksortable=self.webpackChunksortable||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))}();var o=n.O(void 0,[22],(function(){return n(900)}));o=n.O(o)}(); -
sortable-block/tags/1.3.0/build/entry/style-index.css
r2870387 r2870391 1 /*!*********************************************************************************************************************************************************************************************************************************************!*\ 2 !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/entry/style.scss ***! 3 \*********************************************************************************************************************************************************************************************************************************************/ 4 /** 5 * The following styles get applied both on the front of a website 6 * and in the editor. 7 */ 8 .wp-block-sortable-entry > :first-child { 9 -webkit-margin-before: 0; 10 margin-block-start: 0; 11 } 12 .wp-block-sortable-entry > :last-child { 13 -webkit-margin-after: 0; 14 margin-block-end: 0; 15 } 16 17 /*# sourceMappingURL=style-index.css.map*/ 1 .wp-block-sortable-entry>:first-child{-webkit-margin-before:0;margin-block-start:0}.wp-block-sortable-entry>:last-child{-webkit-margin-after:0;margin-block-end:0} -
sortable-block/tags/1.3.0/readme.txt
r2870387 r2870391 86 86 * Add: support for reusable blocks (note, it does not for reusable blocks with Sortable block in it); 87 87 * Add: support for Border options in Sortable block; 88 * Update: improve Insert buttons in the editor ";88 * Update: improve Insert buttons in the editor; 89 89 90 90 = 1.2.0 - January 06, 2023 -
sortable-block/trunk/build/container/block.json
r2870387 r2870391 3 3 "apiVersion": 2, 4 4 "name": "sortable/container", 5 "version": "1. 1.0",5 "version": "1.3.0", 6 6 "title": "Sortable", 7 7 "category": "widgets", -
sortable-block/trunk/build/container/index.asset.php
r2870387 r2870391 1 <?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => ' 33ac81e99d207e9bc735');1 <?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '74446b512806f5e81057'); -
sortable-block/trunk/build/container/index.css
r2870387 r2870391 1 /*!**************************************************************************************************************************************************************************************************************************************************!*\ 2 !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/container/editor.scss ***! 3 \**************************************************************************************************************************************************************************************************************************************************/ 4 /** 5 * The following styles get applied inside the editor only. 6 */ 7 .wp-block-sortable-container .block-editor-button-block-appender { 8 margin-block: 1rem; 9 } 10 .wp-block-sortable-container > .block-list-appender { 11 position: relative; 12 right: auto; 13 align-self: center; 14 list-style: none; 15 line-height: inherit; 16 } 17 .wp-block-sortable-container > .block-list-appender .block-editor-button-block-appender { 18 flex-direction: row; 19 } 20 .wp-block-sortable-container > .block-list-appender .block-editor-button-block-appender::after { 21 content: attr(aria-label); 22 font-weight: bold; 23 } 24 .wp-block-sortable-container.is-list > .block-list-appender { 25 width: 100%; 26 } 27 .wp-block-sortable-container.is-grid > .block-list-appender { 28 grid-column: 1/-1; 29 } 30 31 /*# sourceMappingURL=index.css.map*/ 1 .wp-block-sortable-container .block-editor-button-block-appender{margin-block:1rem}.wp-block-sortable-container>.block-list-appender{align-self:center;line-height:inherit;list-style:none;position:relative;right:auto}.wp-block-sortable-container>.block-list-appender .block-editor-button-block-appender{flex-direction:row}.wp-block-sortable-container>.block-list-appender .block-editor-button-block-appender:after{content:attr(aria-label);font-weight:700}.wp-block-sortable-container.is-list>.block-list-appender{width:100%}.wp-block-sortable-container.is-grid>.block-list-appender{grid-column:1/-1} -
sortable-block/trunk/build/container/index.js
r2870387 r2870391 1 /******/ (function() { // webpackBootstrap 2 /******/ var __webpack_modules__ = ({ 3 4 /***/ "./node_modules/@wordpress/icons/build-module/library/grid.js": 5 /*!********************************************************************!*\ 6 !*** ./node_modules/@wordpress/icons/build-module/library/grid.js ***! 7 \********************************************************************/ 8 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 9 10 "use strict"; 11 __webpack_require__.r(__webpack_exports__); 12 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 13 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 14 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives"); 15 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 16 17 18 /** 19 * WordPress dependencies 20 */ 21 22 const grid = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__.SVG, { 23 xmlns: "http://www.w3.org/2000/svg", 24 viewBox: "0 0 24 24" 25 }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__.Path, { 26 d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7.8 16.5H5c-.3 0-.5-.2-.5-.5v-6.2h6.8v6.7zm0-8.3H4.5V5c0-.3.2-.5.5-.5h6.2v6.7zm8.3 7.8c0 .3-.2.5-.5.5h-6.2v-6.8h6.8V19zm0-7.8h-6.8V4.5H19c.3 0 .5.2.5.5v6.2z", 27 fillRule: "evenodd", 28 clipRule: "evenodd" 29 })); 30 /* harmony default export */ __webpack_exports__["default"] = (grid); 31 //# sourceMappingURL=grid.js.map 32 33 /***/ }), 34 35 /***/ "./node_modules/@wordpress/icons/build-module/library/list.js": 36 /*!********************************************************************!*\ 37 !*** ./node_modules/@wordpress/icons/build-module/library/list.js ***! 38 \********************************************************************/ 39 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 40 41 "use strict"; 42 __webpack_require__.r(__webpack_exports__); 43 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 44 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 45 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives"); 46 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); 47 48 49 /** 50 * WordPress dependencies 51 */ 52 53 const list = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__.SVG, { 54 viewBox: "0 0 24 24", 55 xmlns: "http://www.w3.org/2000/svg" 56 }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__.Path, { 57 d: "M4 4v1.5h16V4H4zm8 8.5h8V11h-8v1.5zM4 20h16v-1.5H4V20zm4-8c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2z" 58 })); 59 /* harmony default export */ __webpack_exports__["default"] = (list); 60 //# sourceMappingURL=list.js.map 61 62 /***/ }), 63 64 /***/ "./src/container/edit.js": 65 /*!*******************************!*\ 66 !*** ./src/container/edit.js ***! 67 \*******************************/ 68 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 69 70 "use strict"; 71 __webpack_require__.r(__webpack_exports__); 72 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 73 /* harmony export */ "default": function() { return /* binding */ Edit; } 74 /* harmony export */ }); 75 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 76 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 77 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); 78 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); 79 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 80 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); 81 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); 82 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__); 83 /* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./editor.scss */ "./src/container/editor.scss"); 84 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 85 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__); 86 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 87 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__); 88 /* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/list.js"); 89 /* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/grid.js"); 90 91 92 93 /** 94 * Retrieves the translation of text. 95 * 96 * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-i18n/ 97 */ 98 99 100 /** 101 * React hook that is used to mark the block wrapper element. 102 * It provides all the necessary props like the class name. 103 * 104 * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-editor/#useblockprops 105 */ 106 107 108 /** 109 * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files. 110 * Those files can contain any CSS code that gets applied to the editor. 111 * 112 * @see https://www.npmjs.com/package/@wordpress/scripts#using-css 113 */ 114 115 116 /** 117 * WordPress dependencies. 118 * 119 * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-element/ 120 * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-data/ 121 */ 122 123 124 125 126 127 /** 128 * Allowed blocks constant is passed to InnerBlocks precisely as specified here. 129 * The contents of the array should never change. 130 * The array should contain the name of each block that is allowed. 131 * In sortable container block, the only block we allow is 'sortable/entry'. 132 * 133 * @constant 134 * @type {string[]} 135 */ 136 const ALLOWED_BLOCKS = ['sortable/entry']; 137 138 /** 139 * The edit function describes the structure of your block in the context of the 140 * editor. This represents what the editor will render when the block is used. 141 * 142 * @param {Object} props All props passed to this function. 143 * @return {WPElement} Element to render. 144 * 145 * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#edit 146 */ 147 function Edit(props) { 148 const { 149 clientId, 150 attributes, 151 setAttributes 152 } = props; 153 const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.useBlockProps)({ 154 className: classnames__WEBPACK_IMPORTED_MODULE_1___default()({ 155 'is-list': attributes.layout === 'list', 156 'is-grid': attributes.layout === 'grid', 157 [`columns-${attributes.columns}`]: attributes.layout === 'grid' 158 }) 159 }); 160 const { 161 replaceInnerBlocks 162 } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_5__.useDispatch)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.store); 163 const { 164 childBlocks 165 } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => { 166 const { 167 getBlocks 168 } = select(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.store); 169 return { 170 childBlocks: getBlocks(clientId) 171 }; 172 }, [clientId]); 173 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { 174 if (childBlocks.length > 0 && !attributes.orderBy || attributes.order) { 175 let sortedBlocks = []; 176 if (attributes.order === 'asc') { 177 sortedBlocks = [...childBlocks].sort((blockA, blockB) => { 178 const result = Number(new Date(blockA.attributes.dateTime)) - Number(new Date(blockB.attributes.dateTime)); 179 return result; 180 }); 181 } else { 182 sortedBlocks = [...childBlocks].sort((blockA, blockB) => { 183 const result = Number(new Date(blockB.attributes.dateTime)) - Number(new Date(blockA.attributes.dateTime)); 184 return result; 185 }); 186 } 187 setAttributes({ 188 orderBy: 'date' 189 }); 190 replaceInnerBlocks(clientId, sortedBlocks, false); 191 } 192 }, [attributes.orderBy, attributes.order]); 193 194 // Update order. 195 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { 196 // Make sure order attribute is set. 197 if (attributes.order === '') { 198 setAttributes({ 199 order: 'desc' 200 }); 201 } 202 }, [attributes.order]); 203 const layoutControls = [{ 204 icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_7__["default"], 205 title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('List view'), 206 onClick: () => setAttributes({ 207 layout: 'list' 208 }), 209 isActive: attributes.layout === 'list' 210 }, { 211 icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_8__["default"], 212 title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Grid view'), 213 onClick: () => setAttributes({ 214 layout: 'grid' 215 }), 216 isActive: attributes.layout === 'grid' 217 }]; 218 const innerBlocksProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.useInnerBlocksProps)(blockProps, { 219 allowedBlocks: ALLOWED_BLOCKS, 220 orientation: 'horizontal', 221 renderAppender: _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.InnerBlocks.ButtonBlockAppender 222 }); 223 return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.InspectorControls, null, attributes.layout === 'grid' && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__.PanelBody, { 224 title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Grid settings') 225 }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__.RangeControl, { 226 __nextHasNoMarginBottom: true, 227 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Columns'), 228 value: attributes.columns, 229 onChange: value => setAttributes({ 230 columns: value 231 }), 232 min: 2, 233 max: 6, 234 required: true 235 })), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__.PanelBody, { 236 title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Order settings') 237 }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__.SelectControl, { 238 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Order'), 239 value: attributes.order, 240 options: [{ 241 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Newest to oldest'), 242 value: 'desc' 243 }, { 244 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Oldest to newest'), 245 value: 'asc' 246 }], 247 onChange: value => setAttributes({ 248 order: value 249 }), 250 __nextHasNoMarginBottom: true 251 }))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.BlockControls, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__.ToolbarGroup, { 252 controls: layoutControls 253 })), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", innerBlocksProps)); 254 } 255 256 /***/ }), 257 258 /***/ "./src/container/index.js": 259 /*!********************************!*\ 260 !*** ./src/container/index.js ***! 261 \********************************/ 262 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 263 264 "use strict"; 265 __webpack_require__.r(__webpack_exports__); 266 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 267 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__); 268 /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./style.scss */ "./src/container/style.scss"); 269 /* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./edit */ "./src/container/edit.js"); 270 /* harmony import */ var _save__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./save */ "./src/container/save.js"); 271 /* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./block.json */ "./src/container/block.json"); 272 /** 273 * Registers a new block provided a unique name and an object defining its behavior. 274 * 275 * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/ 276 */ 277 278 279 /** 280 * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files. 281 * All files containing `style` keyword are bundled together. The code used 282 * gets applied both to the front of your site and to the editor. 283 * 284 * @see https://www.npmjs.com/package/@wordpress/scripts#using-css 285 */ 286 287 288 /** 289 * Internal dependencies 290 */ 291 292 293 294 295 /** 296 * Every block starts by registering a new block type definition. 297 * 298 * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/ 299 */ 300 (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_4__.name, { 301 /** 302 * @see ./edit.js 303 */ 304 edit: _edit__WEBPACK_IMPORTED_MODULE_2__["default"], 305 /** 306 * @see ./save.js 307 */ 308 save: _save__WEBPACK_IMPORTED_MODULE_3__["default"] 309 }); 310 311 /***/ }), 312 313 /***/ "./src/container/save.js": 314 /*!*******************************!*\ 315 !*** ./src/container/save.js ***! 316 \*******************************/ 317 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 318 319 "use strict"; 320 __webpack_require__.r(__webpack_exports__); 321 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 322 /* harmony export */ "default": function() { return /* binding */ save; } 323 /* harmony export */ }); 324 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 325 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 326 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); 327 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); 328 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); 329 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__); 330 331 332 333 /** 334 * React hook that is used to mark the block wrapper element. 335 * It provides all the necessary props like the class name. 336 * 337 * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-editor/#useblockprops 338 */ 339 340 341 /** 342 * The save function defines the way in which the different attributes should 343 * be combined into the final markup, which is then serialized by the block 344 * editor into `post_content`. 345 * 346 * @param {Object} props All props passed to this function. 347 * @return {WPElement} Element to render. 348 * 349 * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#save 350 */ 351 function save(props) { 352 const { 353 attributes 354 } = props; 355 const innerBlocksProps = _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.useInnerBlocksProps.save(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.useBlockProps.save({ 356 className: classnames__WEBPACK_IMPORTED_MODULE_1___default()({ 357 'is-list': attributes.layout === 'list', 358 'is-grid': attributes.layout === 'grid', 359 [`columns-${attributes.columns}`]: attributes.layout === 'grid' 360 }) 361 })); 362 return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", innerBlocksProps); 363 } 364 365 /***/ }), 366 367 /***/ "./node_modules/classnames/index.js": 368 /*!******************************************!*\ 369 !*** ./node_modules/classnames/index.js ***! 370 \******************************************/ 371 /***/ (function(module, exports) { 372 373 var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! 374 Copyright (c) 2018 Jed Watson. 375 Licensed under the MIT License (MIT), see 376 http://jedwatson.github.io/classnames 377 */ 378 /* global define */ 379 380 (function () { 381 'use strict'; 382 383 var hasOwn = {}.hasOwnProperty; 384 var nativeCodeString = '[native code]'; 385 386 function classNames() { 387 var classes = []; 388 389 for (var i = 0; i < arguments.length; i++) { 390 var arg = arguments[i]; 391 if (!arg) continue; 392 393 var argType = typeof arg; 394 395 if (argType === 'string' || argType === 'number') { 396 classes.push(arg); 397 } else if (Array.isArray(arg)) { 398 if (arg.length) { 399 var inner = classNames.apply(null, arg); 400 if (inner) { 401 classes.push(inner); 402 } 403 } 404 } else if (argType === 'object') { 405 if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) { 406 classes.push(arg.toString()); 407 continue; 408 } 409 410 for (var key in arg) { 411 if (hasOwn.call(arg, key) && arg[key]) { 412 classes.push(key); 413 } 414 } 415 } 416 } 417 418 return classes.join(' '); 419 } 420 421 if ( true && module.exports) { 422 classNames.default = classNames; 423 module.exports = classNames; 424 } else if (true) { 425 // register as 'classnames', consistent with npm package name 426 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { 427 return classNames; 428 }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), 429 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 430 } else {} 431 }()); 432 433 434 /***/ }), 435 436 /***/ "./src/container/editor.scss": 437 /*!***********************************!*\ 438 !*** ./src/container/editor.scss ***! 439 \***********************************/ 440 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 441 442 "use strict"; 443 __webpack_require__.r(__webpack_exports__); 444 // extracted by mini-css-extract-plugin 445 446 447 /***/ }), 448 449 /***/ "./src/container/style.scss": 450 /*!**********************************!*\ 451 !*** ./src/container/style.scss ***! 452 \**********************************/ 453 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 454 455 "use strict"; 456 __webpack_require__.r(__webpack_exports__); 457 // extracted by mini-css-extract-plugin 458 459 460 /***/ }), 461 462 /***/ "@wordpress/block-editor": 463 /*!*************************************!*\ 464 !*** external ["wp","blockEditor"] ***! 465 \*************************************/ 466 /***/ (function(module) { 467 468 "use strict"; 469 module.exports = window["wp"]["blockEditor"]; 470 471 /***/ }), 472 473 /***/ "@wordpress/blocks": 474 /*!********************************!*\ 475 !*** external ["wp","blocks"] ***! 476 \********************************/ 477 /***/ (function(module) { 478 479 "use strict"; 480 module.exports = window["wp"]["blocks"]; 481 482 /***/ }), 483 484 /***/ "@wordpress/components": 485 /*!************************************!*\ 486 !*** external ["wp","components"] ***! 487 \************************************/ 488 /***/ (function(module) { 489 490 "use strict"; 491 module.exports = window["wp"]["components"]; 492 493 /***/ }), 494 495 /***/ "@wordpress/data": 496 /*!******************************!*\ 497 !*** external ["wp","data"] ***! 498 \******************************/ 499 /***/ (function(module) { 500 501 "use strict"; 502 module.exports = window["wp"]["data"]; 503 504 /***/ }), 505 506 /***/ "@wordpress/element": 507 /*!*********************************!*\ 508 !*** external ["wp","element"] ***! 509 \*********************************/ 510 /***/ (function(module) { 511 512 "use strict"; 513 module.exports = window["wp"]["element"]; 514 515 /***/ }), 516 517 /***/ "@wordpress/i18n": 518 /*!******************************!*\ 519 !*** external ["wp","i18n"] ***! 520 \******************************/ 521 /***/ (function(module) { 522 523 "use strict"; 524 module.exports = window["wp"]["i18n"]; 525 526 /***/ }), 527 528 /***/ "@wordpress/primitives": 529 /*!************************************!*\ 530 !*** external ["wp","primitives"] ***! 531 \************************************/ 532 /***/ (function(module) { 533 534 "use strict"; 535 module.exports = window["wp"]["primitives"]; 536 537 /***/ }), 538 539 /***/ "./src/container/block.json": 540 /*!**********************************!*\ 541 !*** ./src/container/block.json ***! 542 \**********************************/ 543 /***/ (function(module) { 544 545 "use strict"; 546 module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"sortable/container","version":"1.1.0","title":"Sortable","category":"widgets","icon":"portfolio","description":"This block serves as a main container to hold sortable entries, and it also offers the option to order entries from newest to oldest or oldest to newest, as well as the option to switch the layout between list and grid.","attributes":{"layout":{"type":"string","default":"list"},"columns":{"type":"number","default":3},"orderBy":{"type":"string","default":"date"},"order":{"type":"string","default":"desc"}},"supports":{"anchor":true,"align":true,"html":false,"color":{"gradients":true,"link":true,"__experimentalDefaultControls":{"background":true,"text":true}},"spacing":{"margin":true,"padding":true},"__experimentalBorder":{"color":true,"radius":true,"style":true,"width":true,"__experimentalDefaultControls":{"color":true,"radius":true,"style":true,"width":true}}},"textdomain":"sortable","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css"}'); 547 548 /***/ }) 549 550 /******/ }); 551 /************************************************************************/ 552 /******/ // The module cache 553 /******/ var __webpack_module_cache__ = {}; 554 /******/ 555 /******/ // The require function 556 /******/ function __webpack_require__(moduleId) { 557 /******/ // Check if module is in cache 558 /******/ var cachedModule = __webpack_module_cache__[moduleId]; 559 /******/ if (cachedModule !== undefined) { 560 /******/ return cachedModule.exports; 561 /******/ } 562 /******/ // Create a new module (and put it into the cache) 563 /******/ var module = __webpack_module_cache__[moduleId] = { 564 /******/ // no module.id needed 565 /******/ // no module.loaded needed 566 /******/ exports: {} 567 /******/ }; 568 /******/ 569 /******/ // Execute the module function 570 /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); 571 /******/ 572 /******/ // Return the exports of the module 573 /******/ return module.exports; 574 /******/ } 575 /******/ 576 /******/ // expose the modules object (__webpack_modules__) 577 /******/ __webpack_require__.m = __webpack_modules__; 578 /******/ 579 /************************************************************************/ 580 /******/ /* webpack/runtime/chunk loaded */ 581 /******/ !function() { 582 /******/ var deferred = []; 583 /******/ __webpack_require__.O = function(result, chunkIds, fn, priority) { 584 /******/ if(chunkIds) { 585 /******/ priority = priority || 0; 586 /******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; 587 /******/ deferred[i] = [chunkIds, fn, priority]; 588 /******/ return; 589 /******/ } 590 /******/ var notFulfilled = Infinity; 591 /******/ for (var i = 0; i < deferred.length; i++) { 592 /******/ var chunkIds = deferred[i][0]; 593 /******/ var fn = deferred[i][1]; 594 /******/ var priority = deferred[i][2]; 595 /******/ var fulfilled = true; 596 /******/ for (var j = 0; j < chunkIds.length; j++) { 597 /******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every(function(key) { return __webpack_require__.O[key](chunkIds[j]); })) { 598 /******/ chunkIds.splice(j--, 1); 599 /******/ } else { 600 /******/ fulfilled = false; 601 /******/ if(priority < notFulfilled) notFulfilled = priority; 602 /******/ } 603 /******/ } 604 /******/ if(fulfilled) { 605 /******/ deferred.splice(i--, 1) 606 /******/ var r = fn(); 607 /******/ if (r !== undefined) result = r; 608 /******/ } 609 /******/ } 610 /******/ return result; 611 /******/ }; 612 /******/ }(); 613 /******/ 614 /******/ /* webpack/runtime/compat get default export */ 615 /******/ !function() { 616 /******/ // getDefaultExport function for compatibility with non-harmony modules 617 /******/ __webpack_require__.n = function(module) { 618 /******/ var getter = module && module.__esModule ? 619 /******/ function() { return module['default']; } : 620 /******/ function() { return module; }; 621 /******/ __webpack_require__.d(getter, { a: getter }); 622 /******/ return getter; 623 /******/ }; 624 /******/ }(); 625 /******/ 626 /******/ /* webpack/runtime/define property getters */ 627 /******/ !function() { 628 /******/ // define getter functions for harmony exports 629 /******/ __webpack_require__.d = function(exports, definition) { 630 /******/ for(var key in definition) { 631 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 632 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 633 /******/ } 634 /******/ } 635 /******/ }; 636 /******/ }(); 637 /******/ 638 /******/ /* webpack/runtime/hasOwnProperty shorthand */ 639 /******/ !function() { 640 /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } 641 /******/ }(); 642 /******/ 643 /******/ /* webpack/runtime/make namespace object */ 644 /******/ !function() { 645 /******/ // define __esModule on exports 646 /******/ __webpack_require__.r = function(exports) { 647 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 648 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 649 /******/ } 650 /******/ Object.defineProperty(exports, '__esModule', { value: true }); 651 /******/ }; 652 /******/ }(); 653 /******/ 654 /******/ /* webpack/runtime/jsonp chunk loading */ 655 /******/ !function() { 656 /******/ // no baseURI 657 /******/ 658 /******/ // object to store loaded and loading chunks 659 /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched 660 /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded 661 /******/ var installedChunks = { 662 /******/ "container/index": 0, 663 /******/ "container/style-index": 0 664 /******/ }; 665 /******/ 666 /******/ // no chunk on demand loading 667 /******/ 668 /******/ // no prefetching 669 /******/ 670 /******/ // no preloaded 671 /******/ 672 /******/ // no HMR 673 /******/ 674 /******/ // no HMR manifest 675 /******/ 676 /******/ __webpack_require__.O.j = function(chunkId) { return installedChunks[chunkId] === 0; }; 677 /******/ 678 /******/ // install a JSONP callback for chunk loading 679 /******/ var webpackJsonpCallback = function(parentChunkLoadingFunction, data) { 680 /******/ var chunkIds = data[0]; 681 /******/ var moreModules = data[1]; 682 /******/ var runtime = data[2]; 683 /******/ // add "moreModules" to the modules object, 684 /******/ // then flag all "chunkIds" as loaded and fire callback 685 /******/ var moduleId, chunkId, i = 0; 686 /******/ if(chunkIds.some(function(id) { return installedChunks[id] !== 0; })) { 687 /******/ for(moduleId in moreModules) { 688 /******/ if(__webpack_require__.o(moreModules, moduleId)) { 689 /******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; 690 /******/ } 691 /******/ } 692 /******/ if(runtime) var result = runtime(__webpack_require__); 693 /******/ } 694 /******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); 695 /******/ for(;i < chunkIds.length; i++) { 696 /******/ chunkId = chunkIds[i]; 697 /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { 698 /******/ installedChunks[chunkId][0](); 699 /******/ } 700 /******/ installedChunks[chunkId] = 0; 701 /******/ } 702 /******/ return __webpack_require__.O(result); 703 /******/ } 704 /******/ 705 /******/ var chunkLoadingGlobal = self["webpackChunksortable"] = self["webpackChunksortable"] || []; 706 /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); 707 /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); 708 /******/ }(); 709 /******/ 710 /************************************************************************/ 711 /******/ 712 /******/ // startup 713 /******/ // Load entry module and return exports 714 /******/ // This entry module depends on other loaded chunks and execution need to be delayed 715 /******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["container/style-index"], function() { return __webpack_require__("./src/container/index.js"); }) 716 /******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__); 717 /******/ 718 /******/ })() 719 ; 720 //# sourceMappingURL=index.js.map 1 !function(){var e,t={66:function(e,t,r){"use strict";var n=window.wp.blocks,o=window.wp.element,i=r(184),l=r.n(i),s=window.wp.i18n,a=window.wp.blockEditor,c=window.wp.data,u=window.wp.components,d=window.wp.primitives,v=(0,o.createElement)(d.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)(d.Path,{d:"M4 4v1.5h16V4H4zm8 8.5h8V11h-8v1.5zM4 20h16v-1.5H4V20zm4-8c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2z"})),p=(0,o.createElement)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(d.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7.8 16.5H5c-.3 0-.5-.2-.5-.5v-6.2h6.8v6.7zm0-8.3H4.5V5c0-.3.2-.5.5-.5h6.2v6.7zm8.3 7.8c0 .3-.2.5-.5.5h-6.2v-6.8h6.8V19zm0-7.8h-6.8V4.5H19c.3 0 .5.2.5.5v6.2z",fillRule:"evenodd",clipRule:"evenodd"}));const f=["sortable/entry"];var m=JSON.parse('{"u2":"sortable/container"}');(0,n.registerBlockType)(m.u2,{edit:function(e){const{clientId:t,attributes:r,setAttributes:n}=e,i=(0,a.useBlockProps)({className:l()({"is-list":"list"===r.layout,"is-grid":"grid"===r.layout,[`columns-${r.columns}`]:"grid"===r.layout})}),{replaceInnerBlocks:d}=(0,c.useDispatch)(a.store),{childBlocks:m}=(0,c.useSelect)((e=>{const{getBlocks:r}=e(a.store);return{childBlocks:r(t)}}),[t]);(0,o.useEffect)((()=>{if(m.length>0&&!r.orderBy||r.order){let e=[];e="asc"===r.order?[...m].sort(((e,t)=>Number(new Date(e.attributes.dateTime))-Number(new Date(t.attributes.dateTime)))):[...m].sort(((e,t)=>Number(new Date(t.attributes.dateTime))-Number(new Date(e.attributes.dateTime)))),n({orderBy:"date"}),d(t,e,!1)}}),[r.orderBy,r.order]),(0,o.useEffect)((()=>{""===r.order&&n({order:"desc"})}),[r.order]);const w=[{icon:v,title:(0,s.__)("List view"),onClick:()=>n({layout:"list"}),isActive:"list"===r.layout},{icon:p,title:(0,s.__)("Grid view"),onClick:()=>n({layout:"grid"}),isActive:"grid"===r.layout}],h=(0,a.useInnerBlocksProps)(i,{allowedBlocks:f,orientation:"horizontal",renderAppender:a.InnerBlocks.ButtonBlockAppender});return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(a.InspectorControls,null,"grid"===r.layout&&(0,o.createElement)(u.PanelBody,{title:(0,s.__)("Grid settings")},(0,o.createElement)(u.RangeControl,{__nextHasNoMarginBottom:!0,label:(0,s.__)("Columns"),value:r.columns,onChange:e=>n({columns:e}),min:2,max:6,required:!0})),(0,o.createElement)(u.PanelBody,{title:(0,s.__)("Order settings")},(0,o.createElement)(u.SelectControl,{label:(0,s.__)("Order"),value:r.order,options:[{label:(0,s.__)("Newest to oldest"),value:"desc"},{label:(0,s.__)("Oldest to newest"),value:"asc"}],onChange:e=>n({order:e}),__nextHasNoMarginBottom:!0}))),(0,o.createElement)(a.BlockControls,null,(0,o.createElement)(u.ToolbarGroup,{controls:w})),(0,o.createElement)("div",h))},save:function(e){const{attributes:t}=e,r=a.useInnerBlocksProps.save(a.useBlockProps.save({className:l()({"is-list":"list"===t.layout,"is-grid":"grid"===t.layout,[`columns-${t.columns}`]:"grid"===t.layout})}));return(0,o.createElement)("div",r)}})},184:function(e,t){var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var i=typeof r;if("string"===i||"number"===i)e.push(r);else if(Array.isArray(r)){if(r.length){var l=o.apply(null,r);l&&e.push(l)}}else if("object"===i){if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]")){e.push(r.toString());continue}for(var s in r)n.call(r,s)&&r[s]&&e.push(s)}}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()}},r={};function n(e){var o=r[e];if(void 0!==o)return o.exports;var i=r[e]={exports:{}};return t[e](i,i.exports,n),i.exports}n.m=t,e=[],n.O=function(t,r,o,i){if(!r){var l=1/0;for(u=0;u<e.length;u++){r=e[u][0],o=e[u][1],i=e[u][2];for(var s=!0,a=0;a<r.length;a++)(!1&i||l>=i)&&Object.keys(n.O).every((function(e){return n.O[e](r[a])}))?r.splice(a--,1):(s=!1,i<l&&(l=i));if(s){e.splice(u--,1);var c=o();void 0!==c&&(t=c)}}return t}i=i||0;for(var u=e.length;u>0&&e[u-1][2]>i;u--)e[u]=e[u-1];e[u]=[r,o,i]},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e={837:0,989:0};n.O.j=function(t){return 0===e[t]};var t=function(t,r){var o,i,l=r[0],s=r[1],a=r[2],c=0;if(l.some((function(t){return 0!==e[t]}))){for(o in s)n.o(s,o)&&(n.m[o]=s[o]);if(a)var u=a(n)}for(t&&t(r);c<l.length;c++)i=l[c],n.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return n.O(u)},r=self.webpackChunksortable=self.webpackChunksortable||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))}();var o=n.O(void 0,[989],(function(){return n(66)}));o=n.O(o)}(); -
sortable-block/trunk/build/container/style-index.css
r2870387 r2870391 1 /*!*************************************************************************************************************************************************************************************************************************************************!*\ 2 !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/container/style.scss ***! 3 \*************************************************************************************************************************************************************************************************************************************************/ 4 /** 5 * The following styles get applied both on the front of a website 6 * and in the editor. 7 */ 8 .wp-block-sortable-container.is-list { 9 display: flex; 10 flex-direction: column; 11 gap: var(--wp--style--block-gap); 12 } 13 .wp-block-sortable-container.is-grid { 14 display: grid; 15 grid-template-columns: repeat(1, minmax(0, 1fr)); 16 gap: var(--wp--style--block-gap); 17 } 18 19 @media (min-width: 782px) { 20 .wp-block-sortable-container.is-grid.columns-2 { 21 grid-template-columns: repeat(2, minmax(0, 1fr)); 22 } 23 .wp-block-sortable-container.is-grid.columns-3 { 24 grid-template-columns: repeat(3, minmax(0, 1fr)); 25 } 26 .wp-block-sortable-container.is-grid.columns-4 { 27 grid-template-columns: repeat(4, minmax(0, 1fr)); 28 } 29 .wp-block-sortable-container.is-grid.columns-5 { 30 grid-template-columns: repeat(5, minmax(0, 1fr)); 31 } 32 .wp-block-sortable-container.is-grid.columns-6 { 33 grid-template-columns: repeat(6, minmax(0, 1fr)); 34 } 35 } 36 37 /*# sourceMappingURL=style-index.css.map*/ 1 .wp-block-sortable-container.is-list{display:flex;flex-direction:column;gap:var(--wp--style--block-gap)}.wp-block-sortable-container.is-grid{display:grid;gap:var(--wp--style--block-gap);grid-template-columns:repeat(1,minmax(0,1fr))}@media(min-width:782px){.wp-block-sortable-container.is-grid.columns-2{grid-template-columns:repeat(2,minmax(0,1fr))}.wp-block-sortable-container.is-grid.columns-3{grid-template-columns:repeat(3,minmax(0,1fr))}.wp-block-sortable-container.is-grid.columns-4{grid-template-columns:repeat(4,minmax(0,1fr))}.wp-block-sortable-container.is-grid.columns-5{grid-template-columns:repeat(5,minmax(0,1fr))}.wp-block-sortable-container.is-grid.columns-6{grid-template-columns:repeat(6,minmax(0,1fr))}} -
sortable-block/trunk/build/date/index.asset.php
r2870387 r2870391 1 <?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-date', 'wp-element', 'wp-i18n'), 'version' => ' 67fcc7de9dd665ce8757');1 <?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-date', 'wp-element', 'wp-i18n'), 'version' => 'c4ac28f82b1ce9f52b48'); -
sortable-block/trunk/build/date/index.css
r2870387 r2870391 1 /*!*********************************************************************************************************************************************************************************************************************************************!*\2 !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/date/editor.scss ***!3 \*********************************************************************************************************************************************************************************************************************************************/4 /**5 * The following styles get applied inside the editor only.6 */7 1 8 /*# sourceMappingURL=index.css.map*/ -
sortable-block/trunk/build/date/index.js
r2870387 r2870391 1 /******/ (function() { // webpackBootstrap 2 /******/ "use strict"; 3 /******/ var __webpack_modules__ = ({ 4 5 /***/ "./src/date/edit.js": 6 /*!**************************!*\ 7 !*** ./src/date/edit.js ***! 8 \**************************/ 9 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 10 11 __webpack_require__.r(__webpack_exports__); 12 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 13 /* harmony export */ "default": function() { return /* binding */ Edit; }, 14 /* harmony export */ "is12HourFormat": function() { return /* binding */ is12HourFormat; } 15 /* harmony export */ }); 16 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 17 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 18 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 19 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); 20 /* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/core-data */ "@wordpress/core-data"); 21 /* harmony import */ var _wordpress_core_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_core_data__WEBPACK_IMPORTED_MODULE_2__); 22 /* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/date */ "@wordpress/date"); 23 /* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_date__WEBPACK_IMPORTED_MODULE_3__); 24 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); 25 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_4__); 26 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 27 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__); 28 /* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./editor.scss */ "./src/date/editor.scss"); 29 30 /** 31 * Retrieves the translation of text. 32 * 33 * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-i18n/ 34 */ 35 36 37 /** 38 * WordPress dependencies 39 */ 40 41 42 43 /** 44 * React hook that is used to mark the block wrapper element. 45 * It provides all the necessary props like the class name. 46 * 47 * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-editor/#useblockprops 48 */ 49 50 51 52 /** 53 * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files. 54 * Those files can contain any CSS code that gets applied to the editor. 55 * 56 * @see https://www.npmjs.com/package/@wordpress/scripts#using-css 57 */ 58 59 60 /** 61 * The edit function describes the structure of your block in the context of the 62 * editor. This represents what the editor will render when the block is used. 63 * 64 * @param {Object} props All props passed to this function. 65 * @return {WPElement} Element to render. 66 * 67 * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#edit 68 */ 69 function Edit(props) { 70 const { 71 context, 72 attributes, 73 setAttributes 74 } = props; 75 const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_4__.useBlockProps)(); 76 const dateSettings = (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_3__.getSettings)(); 77 const [siteFormat = dateSettings.formats.date] = (0,_wordpress_core_data__WEBPACK_IMPORTED_MODULE_2__.useEntityProp)('root', 'site', 'date_format'); 78 const [siteTimeFormat = dateSettings.formats.time] = (0,_wordpress_core_data__WEBPACK_IMPORTED_MODULE_2__.useEntityProp)('root', 'site', 'time_format'); 79 const date = context['sortable/entryDateTime']; 80 const entryDate = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("time", { 81 dateTime: (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_3__.format)('c', date) 82 }, (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_3__.format)(attributes.format || siteFormat, date)); 83 return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_4__.InspectorControls, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.PanelBody, { 84 title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Settings') 85 }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_4__.__experimentalDateFormatPicker, { 86 format: attributes.format, 87 defaultFormat: siteFormat, 88 is12Hour: is12HourFormat(siteTimeFormat), 89 onChange: nextFormat => setAttributes({ 90 format: nextFormat 91 }) 92 }))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", blockProps, entryDate)); 93 } 94 95 /** 96 * To know if the time format is a 12 hour time, look for any of the 12 hour 97 * format characters: 'a', 'A', 'g', and 'h'. The character must be 98 * unescaped, i.e. not preceded by a '\'. Coincidentally, 'aAgh' is how I 99 * feel when working with regular expressions. 100 * https://www.php.net/manual/en/datetime.format.php 101 * 102 * @param {string} dateFormat Date format. 103 */ 104 function is12HourFormat(dateFormat) { 105 return /(?:^|[^\\])[aAgh]/.test(dateFormat); 106 } 107 108 /***/ }), 109 110 /***/ "./src/date/index.js": 111 /*!***************************!*\ 112 !*** ./src/date/index.js ***! 113 \***************************/ 114 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 115 116 __webpack_require__.r(__webpack_exports__); 117 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 118 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__); 119 /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./style.scss */ "./src/date/style.scss"); 120 /* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./edit */ "./src/date/edit.js"); 121 /* harmony import */ var _save__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./save */ "./src/date/save.js"); 122 /* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./block.json */ "./src/date/block.json"); 123 /** 124 * Registers a new block provided a unique name and an object defining its behavior. 125 * 126 * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/ 127 */ 128 129 130 /** 131 * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files. 132 * All files containing `style` keyword are bundled together. The code used 133 * gets applied both to the front of your site and to the editor. 134 * 135 * @see https://www.npmjs.com/package/@wordpress/scripts#using-css 136 */ 137 138 139 /** 140 * Internal dependencies 141 */ 142 143 144 145 146 /** 147 * Every block starts by registering a new block type definition. 148 * 149 * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/ 150 */ 151 (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_4__.name, { 152 /** 153 * @see ./edit.js 154 */ 155 edit: _edit__WEBPACK_IMPORTED_MODULE_2__["default"], 156 /** 157 * @see ./save.js 158 */ 159 save: _save__WEBPACK_IMPORTED_MODULE_3__["default"] 160 }); 161 162 /***/ }), 163 164 /***/ "./src/date/save.js": 165 /*!**************************!*\ 166 !*** ./src/date/save.js ***! 167 \**************************/ 168 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 169 170 __webpack_require__.r(__webpack_exports__); 171 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 172 /* harmony export */ "default": function() { return /* binding */ save; } 173 /* harmony export */ }); 174 /** 175 * The save function defines the way in which the different attributes should 176 * be combined into the final markup, which is then serialized by the block 177 * editor into `post_content`. 178 * 179 * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#save 180 * 181 * @return {WPElement} Element to render. 182 */ 183 function save() { 184 return null; 185 } 186 187 /***/ }), 188 189 /***/ "./src/date/editor.scss": 190 /*!******************************!*\ 191 !*** ./src/date/editor.scss ***! 192 \******************************/ 193 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 194 195 __webpack_require__.r(__webpack_exports__); 196 // extracted by mini-css-extract-plugin 197 198 199 /***/ }), 200 201 /***/ "./src/date/style.scss": 202 /*!*****************************!*\ 203 !*** ./src/date/style.scss ***! 204 \*****************************/ 205 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 206 207 __webpack_require__.r(__webpack_exports__); 208 // extracted by mini-css-extract-plugin 209 210 211 /***/ }), 212 213 /***/ "@wordpress/block-editor": 214 /*!*************************************!*\ 215 !*** external ["wp","blockEditor"] ***! 216 \*************************************/ 217 /***/ (function(module) { 218 219 module.exports = window["wp"]["blockEditor"]; 220 221 /***/ }), 222 223 /***/ "@wordpress/blocks": 224 /*!********************************!*\ 225 !*** external ["wp","blocks"] ***! 226 \********************************/ 227 /***/ (function(module) { 228 229 module.exports = window["wp"]["blocks"]; 230 231 /***/ }), 232 233 /***/ "@wordpress/components": 234 /*!************************************!*\ 235 !*** external ["wp","components"] ***! 236 \************************************/ 237 /***/ (function(module) { 238 239 module.exports = window["wp"]["components"]; 240 241 /***/ }), 242 243 /***/ "@wordpress/core-data": 244 /*!**********************************!*\ 245 !*** external ["wp","coreData"] ***! 246 \**********************************/ 247 /***/ (function(module) { 248 249 module.exports = window["wp"]["coreData"]; 250 251 /***/ }), 252 253 /***/ "@wordpress/date": 254 /*!******************************!*\ 255 !*** external ["wp","date"] ***! 256 \******************************/ 257 /***/ (function(module) { 258 259 module.exports = window["wp"]["date"]; 260 261 /***/ }), 262 263 /***/ "@wordpress/element": 264 /*!*********************************!*\ 265 !*** external ["wp","element"] ***! 266 \*********************************/ 267 /***/ (function(module) { 268 269 module.exports = window["wp"]["element"]; 270 271 /***/ }), 272 273 /***/ "@wordpress/i18n": 274 /*!******************************!*\ 275 !*** external ["wp","i18n"] ***! 276 \******************************/ 277 /***/ (function(module) { 278 279 module.exports = window["wp"]["i18n"]; 280 281 /***/ }), 282 283 /***/ "./src/date/block.json": 284 /*!*****************************!*\ 285 !*** ./src/date/block.json ***! 286 \*****************************/ 287 /***/ (function(module) { 288 289 module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"sortable/date","version":"1.2.0","title":"Sortable Date","category":"widgets","icon":"calendar","description":"Since this block is dependent on the Sortable Entry block, it displays the date set in it and also allows to customize how the date is displayed by providing the option to change the date format.","ancestor":["sortable/entry"],"attributes":{"format":{"type":"string"}},"supports":{"html":false,"color":{"gradients":true,"link":false,"__experimentalDefaultControls":{"background":true,"text":true}},"spacing":{"padding":true},"typography":{"fontSize":true,"lineHeight":true,"__experimentalFontFamily":true,"__experimentalFontWeight":true,"__experimentalFontStyle":true,"__experimentalTextTransform":true,"__experimentalTextDecoration":true,"__experimentalLetterSpacing":true,"__experimentalDefaultControls":{"fontSize":true}}},"usesContext":["sortable/entryDateTime"],"textdomain":"sortable","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css"}'); 290 291 /***/ }) 292 293 /******/ }); 294 /************************************************************************/ 295 /******/ // The module cache 296 /******/ var __webpack_module_cache__ = {}; 297 /******/ 298 /******/ // The require function 299 /******/ function __webpack_require__(moduleId) { 300 /******/ // Check if module is in cache 301 /******/ var cachedModule = __webpack_module_cache__[moduleId]; 302 /******/ if (cachedModule !== undefined) { 303 /******/ return cachedModule.exports; 304 /******/ } 305 /******/ // Create a new module (and put it into the cache) 306 /******/ var module = __webpack_module_cache__[moduleId] = { 307 /******/ // no module.id needed 308 /******/ // no module.loaded needed 309 /******/ exports: {} 310 /******/ }; 311 /******/ 312 /******/ // Execute the module function 313 /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); 314 /******/ 315 /******/ // Return the exports of the module 316 /******/ return module.exports; 317 /******/ } 318 /******/ 319 /******/ // expose the modules object (__webpack_modules__) 320 /******/ __webpack_require__.m = __webpack_modules__; 321 /******/ 322 /************************************************************************/ 323 /******/ /* webpack/runtime/chunk loaded */ 324 /******/ !function() { 325 /******/ var deferred = []; 326 /******/ __webpack_require__.O = function(result, chunkIds, fn, priority) { 327 /******/ if(chunkIds) { 328 /******/ priority = priority || 0; 329 /******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; 330 /******/ deferred[i] = [chunkIds, fn, priority]; 331 /******/ return; 332 /******/ } 333 /******/ var notFulfilled = Infinity; 334 /******/ for (var i = 0; i < deferred.length; i++) { 335 /******/ var chunkIds = deferred[i][0]; 336 /******/ var fn = deferred[i][1]; 337 /******/ var priority = deferred[i][2]; 338 /******/ var fulfilled = true; 339 /******/ for (var j = 0; j < chunkIds.length; j++) { 340 /******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every(function(key) { return __webpack_require__.O[key](chunkIds[j]); })) { 341 /******/ chunkIds.splice(j--, 1); 342 /******/ } else { 343 /******/ fulfilled = false; 344 /******/ if(priority < notFulfilled) notFulfilled = priority; 345 /******/ } 346 /******/ } 347 /******/ if(fulfilled) { 348 /******/ deferred.splice(i--, 1) 349 /******/ var r = fn(); 350 /******/ if (r !== undefined) result = r; 351 /******/ } 352 /******/ } 353 /******/ return result; 354 /******/ }; 355 /******/ }(); 356 /******/ 357 /******/ /* webpack/runtime/compat get default export */ 358 /******/ !function() { 359 /******/ // getDefaultExport function for compatibility with non-harmony modules 360 /******/ __webpack_require__.n = function(module) { 361 /******/ var getter = module && module.__esModule ? 362 /******/ function() { return module['default']; } : 363 /******/ function() { return module; }; 364 /******/ __webpack_require__.d(getter, { a: getter }); 365 /******/ return getter; 366 /******/ }; 367 /******/ }(); 368 /******/ 369 /******/ /* webpack/runtime/define property getters */ 370 /******/ !function() { 371 /******/ // define getter functions for harmony exports 372 /******/ __webpack_require__.d = function(exports, definition) { 373 /******/ for(var key in definition) { 374 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 375 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 376 /******/ } 377 /******/ } 378 /******/ }; 379 /******/ }(); 380 /******/ 381 /******/ /* webpack/runtime/hasOwnProperty shorthand */ 382 /******/ !function() { 383 /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } 384 /******/ }(); 385 /******/ 386 /******/ /* webpack/runtime/make namespace object */ 387 /******/ !function() { 388 /******/ // define __esModule on exports 389 /******/ __webpack_require__.r = function(exports) { 390 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 391 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 392 /******/ } 393 /******/ Object.defineProperty(exports, '__esModule', { value: true }); 394 /******/ }; 395 /******/ }(); 396 /******/ 397 /******/ /* webpack/runtime/jsonp chunk loading */ 398 /******/ !function() { 399 /******/ // no baseURI 400 /******/ 401 /******/ // object to store loaded and loading chunks 402 /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched 403 /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded 404 /******/ var installedChunks = { 405 /******/ "date/index": 0, 406 /******/ "date/style-index": 0 407 /******/ }; 408 /******/ 409 /******/ // no chunk on demand loading 410 /******/ 411 /******/ // no prefetching 412 /******/ 413 /******/ // no preloaded 414 /******/ 415 /******/ // no HMR 416 /******/ 417 /******/ // no HMR manifest 418 /******/ 419 /******/ __webpack_require__.O.j = function(chunkId) { return installedChunks[chunkId] === 0; }; 420 /******/ 421 /******/ // install a JSONP callback for chunk loading 422 /******/ var webpackJsonpCallback = function(parentChunkLoadingFunction, data) { 423 /******/ var chunkIds = data[0]; 424 /******/ var moreModules = data[1]; 425 /******/ var runtime = data[2]; 426 /******/ // add "moreModules" to the modules object, 427 /******/ // then flag all "chunkIds" as loaded and fire callback 428 /******/ var moduleId, chunkId, i = 0; 429 /******/ if(chunkIds.some(function(id) { return installedChunks[id] !== 0; })) { 430 /******/ for(moduleId in moreModules) { 431 /******/ if(__webpack_require__.o(moreModules, moduleId)) { 432 /******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; 433 /******/ } 434 /******/ } 435 /******/ if(runtime) var result = runtime(__webpack_require__); 436 /******/ } 437 /******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); 438 /******/ for(;i < chunkIds.length; i++) { 439 /******/ chunkId = chunkIds[i]; 440 /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { 441 /******/ installedChunks[chunkId][0](); 442 /******/ } 443 /******/ installedChunks[chunkId] = 0; 444 /******/ } 445 /******/ return __webpack_require__.O(result); 446 /******/ } 447 /******/ 448 /******/ var chunkLoadingGlobal = self["webpackChunksortable"] = self["webpackChunksortable"] || []; 449 /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); 450 /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); 451 /******/ }(); 452 /******/ 453 /************************************************************************/ 454 /******/ 455 /******/ // startup 456 /******/ // Load entry module and return exports 457 /******/ // This entry module depends on other loaded chunks and execution need to be delayed 458 /******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["date/style-index"], function() { return __webpack_require__("./src/date/index.js"); }) 459 /******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__); 460 /******/ 461 /******/ })() 462 ; 463 //# sourceMappingURL=index.js.map 1 !function(){"use strict";var t,e={448:function(){var t=window.wp.blocks,e=window.wp.element,r=window.wp.i18n,n=window.wp.coreData,o=window.wp.date,a=window.wp.blockEditor,i=window.wp.components,u=JSON.parse('{"u2":"sortable/date"}');(0,t.registerBlockType)(u.u2,{edit:function(t){const{context:u,attributes:s,setAttributes:l}=t,c=(0,a.useBlockProps)(),f=(0,o.getSettings)(),[m=f.formats.date]=(0,n.useEntityProp)("root","site","date_format"),[p=f.formats.time]=(0,n.useEntityProp)("root","site","time_format"),w=u["sortable/entryDateTime"],d=(0,e.createElement)("time",{dateTime:(0,o.format)("c",w)},(0,o.format)(s.format||m,w));return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(a.InspectorControls,null,(0,e.createElement)(i.PanelBody,{title:(0,r.__)("Settings")},(0,e.createElement)(a.__experimentalDateFormatPicker,{format:s.format,defaultFormat:m,is12Hour:(v=p,/(?:^|[^\\])[aAgh]/.test(v)),onChange:t=>l({format:t})}))),(0,e.createElement)("div",c,d));var v},save:function(){return null}})}},r={};function n(t){var o=r[t];if(void 0!==o)return o.exports;var a=r[t]={exports:{}};return e[t](a,a.exports,n),a.exports}n.m=e,t=[],n.O=function(e,r,o,a){if(!r){var i=1/0;for(c=0;c<t.length;c++){r=t[c][0],o=t[c][1],a=t[c][2];for(var u=!0,s=0;s<r.length;s++)(!1&a||i>=a)&&Object.keys(n.O).every((function(t){return n.O[t](r[s])}))?r.splice(s--,1):(u=!1,a<i&&(i=a));if(u){t.splice(c--,1);var l=o();void 0!==l&&(e=l)}}return e}a=a||0;for(var c=t.length;c>0&&t[c-1][2]>a;c--)t[c]=t[c-1];t[c]=[r,o,a]},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},function(){var t={964:0,966:0};n.O.j=function(e){return 0===t[e]};var e=function(e,r){var o,a,i=r[0],u=r[1],s=r[2],l=0;if(i.some((function(e){return 0!==t[e]}))){for(o in u)n.o(u,o)&&(n.m[o]=u[o]);if(s)var c=s(n)}for(e&&e(r);l<i.length;l++)a=i[l],n.o(t,a)&&t[a]&&t[a][0](),t[a]=0;return n.O(c)},r=self.webpackChunksortable=self.webpackChunksortable||[];r.forEach(e.bind(null,0)),r.push=e.bind(null,r.push.bind(r))}();var o=n.O(void 0,[966],(function(){return n(448)}));o=n.O(o)}(); -
sortable-block/trunk/build/date/style-index.css
r2870387 r2870391 1 /*!********************************************************************************************************************************************************************************************************************************************!*\2 !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/date/style.scss ***!3 \********************************************************************************************************************************************************************************************************************************************/4 /**5 * The following styles get applied both on the front of a website6 * and in the editor.7 */8 1 9 /*# sourceMappingURL=style-index.css.map*/ -
sortable-block/trunk/build/entry/block.json
r2841375 r2870391 3 3 "apiVersion": 2, 4 4 "name": "sortable/entry", 5 "version": "1. 0.1",5 "version": "1.3.0", 6 6 "title": "Sortable Entry", 7 7 "category": "widgets", -
sortable-block/trunk/build/entry/index.asset.php
r2870387 r2870391 1 <?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => ' 3dc95446178a2874c0fd');1 <?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => 'fb56f8d5a5bd9d88bda3'); -
sortable-block/trunk/build/entry/index.css
r2870387 r2870391 1 /*!**********************************************************************************************************************************************************************************************************************************************!*\ 2 !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/entry/editor.scss ***! 3 \**********************************************************************************************************************************************************************************************************************************************/ 4 /** 5 * The following styles get applied inside the editor only. 6 */ 7 .wp-block-sortable-entry > .block-list-appender .block-editor-button-block-appender { 8 flex-direction: row; 9 box-shadow: none; 10 border: 1px dashed; 11 } 12 .wp-block-sortable-entry > .block-list-appender .block-editor-button-block-appender::after { 13 content: attr(aria-label); 14 } 15 16 /*# sourceMappingURL=index.css.map*/ 1 .wp-block-sortable-entry>.block-list-appender .block-editor-button-block-appender{border:1px dashed;box-shadow:none;flex-direction:row}.wp-block-sortable-entry>.block-list-appender .block-editor-button-block-appender:after{content:attr(aria-label)} -
sortable-block/trunk/build/entry/index.js
r2870387 r2870391 1 /******/ (function() { // webpackBootstrap 2 /******/ "use strict"; 3 /******/ var __webpack_modules__ = ({ 4 5 /***/ "./src/entry/edit.js": 6 /*!***************************!*\ 7 !*** ./src/entry/edit.js ***! 8 \***************************/ 9 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 10 11 __webpack_require__.r(__webpack_exports__); 12 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 13 /* harmony export */ "default": function() { return /* binding */ Edit; } 14 /* harmony export */ }); 15 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 16 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 17 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 18 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); 19 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); 20 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__); 21 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 22 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__); 23 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); 24 /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__); 25 /* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./editor.scss */ "./src/entry/editor.scss"); 26 27 /** 28 * Retrieves the translation of text. 29 * 30 * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-i18n/ 31 */ 32 33 34 /** 35 * React hook that is used to mark the block wrapper element. 36 * It provides all the necessary props like the class name. 37 * 38 * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-editor/#useblockprops 39 */ 40 41 42 /** 43 * This package includes a library of generic WordPress components. 44 * 45 * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-components/ 46 */ 47 48 49 /** 50 * WordPress dependencies. 51 * 52 * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-element/ , 53 * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-data/ 54 */ 55 56 57 58 /** 59 * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files. 60 * Those files can contain any CSS code that gets applied to the editor. 61 * 62 * @see https://www.npmjs.com/package/@wordpress/scripts#using-css 63 */ 64 65 66 /** 67 * Allowed blocks constant is passed to InnerBlocks precisely as specified here. 68 * The contents of the array should never change. 69 * The array should contain the name of each block that is allowed. 70 * In columns block, the only block we allow is 'core/column'. 71 * 72 * @constant 73 * @type {string[]} 74 */ 75 const ALLOWED_BLOCKS = ['sortable/date', 'core/heading', 'core/paragraph', 'core/media-text', 'core/group', 'core/columns', 'core/block']; 76 77 /** 78 * The edit function describes the structure of your block in the context of the 79 * editor. This represents what the editor will render when the block is used. 80 * 81 * @param {Object} props All props passed to this function. 82 * @return {WPElement} Element to render. 83 * 84 * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#edit 85 */ 86 function Edit(props) { 87 const { 88 clientId, 89 attributes: { 90 dateTime 91 }, 92 setAttributes 93 } = props; 94 const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.useBlockProps)(); 95 const { 96 updateBlockAttributes 97 } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_4__.useDispatch)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.store); 98 const { 99 rootClientId, 100 hasChildBlocks 101 } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => { 102 const { 103 getBlockRootClientId, 104 getBlockOrder 105 } = select(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.store); 106 const rootId = getBlockRootClientId(clientId); 107 return { 108 rootClientId: rootId, 109 hasChildBlocks: getBlockOrder(clientId).length > 0 110 }; 111 }, [clientId]); 112 113 // Update date in block. 114 const updateDate = value => { 115 setAttributes({ 116 dateTime: value 117 }); 118 119 // Reset parent block sorting. 120 updateBlockAttributes(rootClientId, { 121 orderBy: '' 122 }); 123 }; 124 (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { 125 if (!dateTime) { 126 setAttributes({ 127 dateTime: new Date() 128 }); 129 130 // Reset parent block sorting. 131 updateBlockAttributes(rootClientId, { 132 orderBy: '' 133 }); 134 } 135 }, [dateTime]); 136 const innerBlocksProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.useInnerBlocksProps)(blockProps, { 137 allowedBlocks: ALLOWED_BLOCKS, 138 orientation: 'horizontal', 139 renderAppender: hasChildBlocks ? undefined : _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.InnerBlocks.ButtonBlockAppender 140 }); 141 return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.InspectorControls, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.PanelBody, { 142 title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Date Settings', 'sortable') 143 }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.PanelRow, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.DateTimePicker, { 144 currentDate: dateTime, 145 onChange: updateDate, 146 is12Hour: true, 147 __nextRemoveHelpButton: true, 148 __nextRemoveResetButton: true 149 })))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", innerBlocksProps)); 150 } 151 152 /***/ }), 153 154 /***/ "./src/entry/index.js": 155 /*!****************************!*\ 156 !*** ./src/entry/index.js ***! 157 \****************************/ 158 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 159 160 __webpack_require__.r(__webpack_exports__); 161 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 162 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__); 163 /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./style.scss */ "./src/entry/style.scss"); 164 /* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./edit */ "./src/entry/edit.js"); 165 /* harmony import */ var _save__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./save */ "./src/entry/save.js"); 166 /* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./block.json */ "./src/entry/block.json"); 167 /** 168 * Registers a new block provided a unique name and an object defining its behavior. 169 * 170 * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/ 171 */ 172 173 174 /** 175 * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files. 176 * All files containing `style` keyword are bundled together. The code used 177 * gets applied both to the front of your site and to the editor. 178 * 179 * @see https://www.npmjs.com/package/@wordpress/scripts#using-css 180 */ 181 182 183 /** 184 * Internal dependencies 185 */ 186 187 188 189 190 /** 191 * Every block starts by registering a new block type definition. 192 * 193 * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/ 194 */ 195 (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_4__.name, { 196 /** 197 * @see ./edit.js 198 */ 199 edit: _edit__WEBPACK_IMPORTED_MODULE_2__["default"], 200 /** 201 * @see ./save.js 202 */ 203 save: _save__WEBPACK_IMPORTED_MODULE_3__["default"] 204 }); 205 206 /***/ }), 207 208 /***/ "./src/entry/save.js": 209 /*!***************************!*\ 210 !*** ./src/entry/save.js ***! 211 \***************************/ 212 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 213 214 __webpack_require__.r(__webpack_exports__); 215 /* harmony export */ __webpack_require__.d(__webpack_exports__, { 216 /* harmony export */ "default": function() { return /* binding */ save; } 217 /* harmony export */ }); 218 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 219 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 220 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); 221 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__); 222 223 /** 224 * React hook that is used to mark the block wrapper element. 225 * It provides all the necessary props like the class name. 226 * 227 * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-editor/#useblockprops 228 */ 229 230 231 /** 232 * The save function defines the way in which the different attributes should 233 * be combined into the final markup, which is then serialized by the block 234 * editor into `post_content`. 235 * 236 * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#save 237 * 238 * @return {WPElement} Element to render. 239 */ 240 function save() { 241 const innerBlocksProps = _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useInnerBlocksProps.save(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps.save()); 242 return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", innerBlocksProps); 243 } 244 245 /***/ }), 246 247 /***/ "./src/entry/editor.scss": 248 /*!*******************************!*\ 249 !*** ./src/entry/editor.scss ***! 250 \*******************************/ 251 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 252 253 __webpack_require__.r(__webpack_exports__); 254 // extracted by mini-css-extract-plugin 255 256 257 /***/ }), 258 259 /***/ "./src/entry/style.scss": 260 /*!******************************!*\ 261 !*** ./src/entry/style.scss ***! 262 \******************************/ 263 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 264 265 __webpack_require__.r(__webpack_exports__); 266 // extracted by mini-css-extract-plugin 267 268 269 /***/ }), 270 271 /***/ "@wordpress/block-editor": 272 /*!*************************************!*\ 273 !*** external ["wp","blockEditor"] ***! 274 \*************************************/ 275 /***/ (function(module) { 276 277 module.exports = window["wp"]["blockEditor"]; 278 279 /***/ }), 280 281 /***/ "@wordpress/blocks": 282 /*!********************************!*\ 283 !*** external ["wp","blocks"] ***! 284 \********************************/ 285 /***/ (function(module) { 286 287 module.exports = window["wp"]["blocks"]; 288 289 /***/ }), 290 291 /***/ "@wordpress/components": 292 /*!************************************!*\ 293 !*** external ["wp","components"] ***! 294 \************************************/ 295 /***/ (function(module) { 296 297 module.exports = window["wp"]["components"]; 298 299 /***/ }), 300 301 /***/ "@wordpress/data": 302 /*!******************************!*\ 303 !*** external ["wp","data"] ***! 304 \******************************/ 305 /***/ (function(module) { 306 307 module.exports = window["wp"]["data"]; 308 309 /***/ }), 310 311 /***/ "@wordpress/element": 312 /*!*********************************!*\ 313 !*** external ["wp","element"] ***! 314 \*********************************/ 315 /***/ (function(module) { 316 317 module.exports = window["wp"]["element"]; 318 319 /***/ }), 320 321 /***/ "@wordpress/i18n": 322 /*!******************************!*\ 323 !*** external ["wp","i18n"] ***! 324 \******************************/ 325 /***/ (function(module) { 326 327 module.exports = window["wp"]["i18n"]; 328 329 /***/ }), 330 331 /***/ "./src/entry/block.json": 332 /*!******************************!*\ 333 !*** ./src/entry/block.json ***! 334 \******************************/ 335 /***/ (function(module) { 336 337 module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"sortable/entry","version":"1.0.1","title":"Sortable Entry","category":"widgets","icon":"media-document","description":"This block serves as an entry that needs to be sorted, and it is where you can set the date and keep specific content for the entry.","parent":["sortable/container"],"supports":{"html":false},"attributes":{"dateTime":{"type":"string"}},"providesContext":{"sortable/entryDateTime":"dateTime"},"textdomain":"sortable","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css"}'); 338 339 /***/ }) 340 341 /******/ }); 342 /************************************************************************/ 343 /******/ // The module cache 344 /******/ var __webpack_module_cache__ = {}; 345 /******/ 346 /******/ // The require function 347 /******/ function __webpack_require__(moduleId) { 348 /******/ // Check if module is in cache 349 /******/ var cachedModule = __webpack_module_cache__[moduleId]; 350 /******/ if (cachedModule !== undefined) { 351 /******/ return cachedModule.exports; 352 /******/ } 353 /******/ // Create a new module (and put it into the cache) 354 /******/ var module = __webpack_module_cache__[moduleId] = { 355 /******/ // no module.id needed 356 /******/ // no module.loaded needed 357 /******/ exports: {} 358 /******/ }; 359 /******/ 360 /******/ // Execute the module function 361 /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); 362 /******/ 363 /******/ // Return the exports of the module 364 /******/ return module.exports; 365 /******/ } 366 /******/ 367 /******/ // expose the modules object (__webpack_modules__) 368 /******/ __webpack_require__.m = __webpack_modules__; 369 /******/ 370 /************************************************************************/ 371 /******/ /* webpack/runtime/chunk loaded */ 372 /******/ !function() { 373 /******/ var deferred = []; 374 /******/ __webpack_require__.O = function(result, chunkIds, fn, priority) { 375 /******/ if(chunkIds) { 376 /******/ priority = priority || 0; 377 /******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; 378 /******/ deferred[i] = [chunkIds, fn, priority]; 379 /******/ return; 380 /******/ } 381 /******/ var notFulfilled = Infinity; 382 /******/ for (var i = 0; i < deferred.length; i++) { 383 /******/ var chunkIds = deferred[i][0]; 384 /******/ var fn = deferred[i][1]; 385 /******/ var priority = deferred[i][2]; 386 /******/ var fulfilled = true; 387 /******/ for (var j = 0; j < chunkIds.length; j++) { 388 /******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every(function(key) { return __webpack_require__.O[key](chunkIds[j]); })) { 389 /******/ chunkIds.splice(j--, 1); 390 /******/ } else { 391 /******/ fulfilled = false; 392 /******/ if(priority < notFulfilled) notFulfilled = priority; 393 /******/ } 394 /******/ } 395 /******/ if(fulfilled) { 396 /******/ deferred.splice(i--, 1) 397 /******/ var r = fn(); 398 /******/ if (r !== undefined) result = r; 399 /******/ } 400 /******/ } 401 /******/ return result; 402 /******/ }; 403 /******/ }(); 404 /******/ 405 /******/ /* webpack/runtime/compat get default export */ 406 /******/ !function() { 407 /******/ // getDefaultExport function for compatibility with non-harmony modules 408 /******/ __webpack_require__.n = function(module) { 409 /******/ var getter = module && module.__esModule ? 410 /******/ function() { return module['default']; } : 411 /******/ function() { return module; }; 412 /******/ __webpack_require__.d(getter, { a: getter }); 413 /******/ return getter; 414 /******/ }; 415 /******/ }(); 416 /******/ 417 /******/ /* webpack/runtime/define property getters */ 418 /******/ !function() { 419 /******/ // define getter functions for harmony exports 420 /******/ __webpack_require__.d = function(exports, definition) { 421 /******/ for(var key in definition) { 422 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 423 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 424 /******/ } 425 /******/ } 426 /******/ }; 427 /******/ }(); 428 /******/ 429 /******/ /* webpack/runtime/hasOwnProperty shorthand */ 430 /******/ !function() { 431 /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } 432 /******/ }(); 433 /******/ 434 /******/ /* webpack/runtime/make namespace object */ 435 /******/ !function() { 436 /******/ // define __esModule on exports 437 /******/ __webpack_require__.r = function(exports) { 438 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 439 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 440 /******/ } 441 /******/ Object.defineProperty(exports, '__esModule', { value: true }); 442 /******/ }; 443 /******/ }(); 444 /******/ 445 /******/ /* webpack/runtime/jsonp chunk loading */ 446 /******/ !function() { 447 /******/ // no baseURI 448 /******/ 449 /******/ // object to store loaded and loading chunks 450 /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched 451 /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded 452 /******/ var installedChunks = { 453 /******/ "entry/index": 0, 454 /******/ "entry/style-index": 0 455 /******/ }; 456 /******/ 457 /******/ // no chunk on demand loading 458 /******/ 459 /******/ // no prefetching 460 /******/ 461 /******/ // no preloaded 462 /******/ 463 /******/ // no HMR 464 /******/ 465 /******/ // no HMR manifest 466 /******/ 467 /******/ __webpack_require__.O.j = function(chunkId) { return installedChunks[chunkId] === 0; }; 468 /******/ 469 /******/ // install a JSONP callback for chunk loading 470 /******/ var webpackJsonpCallback = function(parentChunkLoadingFunction, data) { 471 /******/ var chunkIds = data[0]; 472 /******/ var moreModules = data[1]; 473 /******/ var runtime = data[2]; 474 /******/ // add "moreModules" to the modules object, 475 /******/ // then flag all "chunkIds" as loaded and fire callback 476 /******/ var moduleId, chunkId, i = 0; 477 /******/ if(chunkIds.some(function(id) { return installedChunks[id] !== 0; })) { 478 /******/ for(moduleId in moreModules) { 479 /******/ if(__webpack_require__.o(moreModules, moduleId)) { 480 /******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; 481 /******/ } 482 /******/ } 483 /******/ if(runtime) var result = runtime(__webpack_require__); 484 /******/ } 485 /******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); 486 /******/ for(;i < chunkIds.length; i++) { 487 /******/ chunkId = chunkIds[i]; 488 /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { 489 /******/ installedChunks[chunkId][0](); 490 /******/ } 491 /******/ installedChunks[chunkId] = 0; 492 /******/ } 493 /******/ return __webpack_require__.O(result); 494 /******/ } 495 /******/ 496 /******/ var chunkLoadingGlobal = self["webpackChunksortable"] = self["webpackChunksortable"] || []; 497 /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); 498 /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); 499 /******/ }(); 500 /******/ 501 /************************************************************************/ 502 /******/ 503 /******/ // startup 504 /******/ // Load entry module and return exports 505 /******/ // This entry module depends on other loaded chunks and execution need to be delayed 506 /******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["entry/style-index"], function() { return __webpack_require__("./src/entry/index.js"); }) 507 /******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__); 508 /******/ 509 /******/ })() 510 ; 511 //# sourceMappingURL=index.js.map 1 !function(){"use strict";var e,t={900:function(){var e=window.wp.blocks,t=window.wp.element,r=window.wp.i18n,n=window.wp.blockEditor,o=window.wp.components,l=window.wp.data;const c=["sortable/date","core/heading","core/paragraph","core/media-text","core/group","core/columns","core/block"];var i=JSON.parse('{"u2":"sortable/entry"}');(0,e.registerBlockType)(i.u2,{edit:function(e){const{clientId:i,attributes:{dateTime:s},setAttributes:a}=e,u=(0,n.useBlockProps)(),{updateBlockAttributes:d}=(0,l.useDispatch)(n.store),{rootClientId:p,hasChildBlocks:f}=(0,l.useSelect)((e=>{const{getBlockRootClientId:t,getBlockOrder:r}=e(n.store);return{rootClientId:t(i),hasChildBlocks:r(i).length>0}}),[i]);(0,t.useEffect)((()=>{s||(a({dateTime:new Date}),d(p,{orderBy:""}))}),[s]);const v=(0,n.useInnerBlocksProps)(u,{allowedBlocks:c,orientation:"horizontal",renderAppender:f?void 0:n.InnerBlocks.ButtonBlockAppender});return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(n.InspectorControls,null,(0,t.createElement)(o.PanelBody,{title:(0,r.__)("Date Settings","sortable")},(0,t.createElement)(o.PanelRow,null,(0,t.createElement)(o.DateTimePicker,{currentDate:s,onChange:e=>{a({dateTime:e}),d(p,{orderBy:""})},is12Hour:!0,__nextRemoveHelpButton:!0,__nextRemoveResetButton:!0})))),(0,t.createElement)("div",v))},save:function(){const e=n.useInnerBlocksProps.save(n.useBlockProps.save());return(0,t.createElement)("div",e)}})}},r={};function n(e){var o=r[e];if(void 0!==o)return o.exports;var l=r[e]={exports:{}};return t[e](l,l.exports,n),l.exports}n.m=t,e=[],n.O=function(t,r,o,l){if(!r){var c=1/0;for(u=0;u<e.length;u++){r=e[u][0],o=e[u][1],l=e[u][2];for(var i=!0,s=0;s<r.length;s++)(!1&l||c>=l)&&Object.keys(n.O).every((function(e){return n.O[e](r[s])}))?r.splice(s--,1):(i=!1,l<c&&(c=l));if(i){e.splice(u--,1);var a=o();void 0!==a&&(t=a)}}return t}l=l||0;for(var u=e.length;u>0&&e[u-1][2]>l;u--)e[u]=e[u-1];e[u]=[r,o,l]},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e={955:0,22:0};n.O.j=function(t){return 0===e[t]};var t=function(t,r){var o,l,c=r[0],i=r[1],s=r[2],a=0;if(c.some((function(t){return 0!==e[t]}))){for(o in i)n.o(i,o)&&(n.m[o]=i[o]);if(s)var u=s(n)}for(t&&t(r);a<c.length;a++)l=c[a],n.o(e,l)&&e[l]&&e[l][0](),e[l]=0;return n.O(u)},r=self.webpackChunksortable=self.webpackChunksortable||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))}();var o=n.O(void 0,[22],(function(){return n(900)}));o=n.O(o)}(); -
sortable-block/trunk/build/entry/style-index.css
r2870387 r2870391 1 /*!*********************************************************************************************************************************************************************************************************************************************!*\ 2 !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/entry/style.scss ***! 3 \*********************************************************************************************************************************************************************************************************************************************/ 4 /** 5 * The following styles get applied both on the front of a website 6 * and in the editor. 7 */ 8 .wp-block-sortable-entry > :first-child { 9 -webkit-margin-before: 0; 10 margin-block-start: 0; 11 } 12 .wp-block-sortable-entry > :last-child { 13 -webkit-margin-after: 0; 14 margin-block-end: 0; 15 } 16 17 /*# sourceMappingURL=style-index.css.map*/ 1 .wp-block-sortable-entry>:first-child{-webkit-margin-before:0;margin-block-start:0}.wp-block-sortable-entry>:last-child{-webkit-margin-after:0;margin-block-end:0} -
sortable-block/trunk/readme.txt
r2870387 r2870391 86 86 * Add: support for reusable blocks (note, it does not for reusable blocks with Sortable block in it); 87 87 * Add: support for Border options in Sortable block; 88 * Update: improve Insert buttons in the editor ";88 * Update: improve Insert buttons in the editor; 89 89 90 90 = 1.2.0 - January 06, 2023
Note: See TracChangeset
for help on using the changeset viewer.