diff --git a/javascript/blocks/wpsi-menu/build/block.json b/javascript/blocks/wpsi-menu/build/block.json index 0d1bc4a..97d8ee4 100644 --- a/javascript/blocks/wpsi-menu/build/block.json +++ b/javascript/blocks/wpsi-menu/build/block.json @@ -2,7 +2,7 @@ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 3, "name": "massivedynamic/wpsi-menu", - "version": "0.1.0", + "version": "0.2.0", "title": "WP Social Icons Menu", "category": "widgets", "icon": "networking", @@ -38,7 +38,7 @@ "default": false } }, - "textdomain": "wpsi-menu", + "textdomain": "wpsocialicons", "editorScript": "file:./index.js", "editorStyle": "file:./index.css", "style": "file:./style-index.css", diff --git a/javascript/blocks/wpsi-menu/build/index-rtl.css b/javascript/blocks/wpsi-menu/build/index-rtl.css index 28c63bc..0ae9c77 100644 --- a/javascript/blocks/wpsi-menu/build/index-rtl.css +++ b/javascript/blocks/wpsi-menu/build/index-rtl.css @@ -1,31 +1 @@ -/*!****************************************************************************************************************************************************************************************************************************************!*\ - !*** 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/editor.scss ***! - \****************************************************************************************************************************************************************************************************************************************/ -.wpsi-menu { - padding: 2rem 0; -} -.wpsi-menu a { - text-decoration: none; -} -.wpsi-menu.align-left { - text-align: right; -} -.wpsi-menu.align-center { - text-align: center; -} -.wpsi-menu.align-right { - text-align: left; -} -.wpsi-menu.horizontal a:not(:last-of-type) { - margin-left: 2rem; -} -.wpsi-menu.vertical a { - display: block; -} -.wpsi-menu.vertical a:not(:last-of-type) { - margin-bottom: 2rem; -} -.wpsi-menu .wpsi { - font-size: 2rem; - color: #333; -} +.wpsi-menu{padding:2rem 0}.wpsi-menu a{text-decoration:none}.wpsi-menu.align-left{text-align:right}.wpsi-menu.align-center{text-align:center}.wpsi-menu.align-right{text-align:left}.wpsi-menu.horizontal a:not(:last-of-type){margin-left:2rem}.wpsi-menu.vertical a{display:block}.wpsi-menu.vertical a:not(:last-of-type){margin-bottom:2rem}.wpsi-menu .wpsi{color:#333;font-size:2rem} diff --git a/javascript/blocks/wpsi-menu/build/index.asset.php b/javascript/blocks/wpsi-menu/build/index.asset.php index 1f764f0..c0fc9e5 100644 --- a/javascript/blocks/wpsi-menu/build/index.asset.php +++ b/javascript/blocks/wpsi-menu/build/index.asset.php @@ -1 +1 @@ - array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '620ad439ae4501db362c'); + array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '3150b6ecc167e7e38de7'); diff --git a/javascript/blocks/wpsi-menu/build/index.css b/javascript/blocks/wpsi-menu/build/index.css index 808305b..0964d46 100644 --- a/javascript/blocks/wpsi-menu/build/index.css +++ b/javascript/blocks/wpsi-menu/build/index.css @@ -1,33 +1 @@ -/*!****************************************************************************************************************************************************************************************************************************************!*\ - !*** 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/editor.scss ***! - \****************************************************************************************************************************************************************************************************************************************/ -.wpsi-menu { - padding: 2rem 0; -} -.wpsi-menu a { - text-decoration: none; -} -.wpsi-menu.align-left { - text-align: left; -} -.wpsi-menu.align-center { - text-align: center; -} -.wpsi-menu.align-right { - text-align: right; -} -.wpsi-menu.horizontal a:not(:last-of-type) { - margin-right: 2rem; -} -.wpsi-menu.vertical a { - display: block; -} -.wpsi-menu.vertical a:not(:last-of-type) { - margin-bottom: 2rem; -} -.wpsi-menu .wpsi { - font-size: 2rem; - color: #333; -} - -/*# sourceMappingURL=index.css.map*/ \ No newline at end of file +.wpsi-menu{padding:2rem 0}.wpsi-menu a{text-decoration:none}.wpsi-menu.align-left{text-align:left}.wpsi-menu.align-center{text-align:center}.wpsi-menu.align-right{text-align:right}.wpsi-menu.horizontal a:not(:last-of-type){margin-right:2rem}.wpsi-menu.vertical a{display:block}.wpsi-menu.vertical a:not(:last-of-type){margin-bottom:2rem}.wpsi-menu .wpsi{color:#333;font-size:2rem} diff --git a/javascript/blocks/wpsi-menu/build/index.css.map b/javascript/blocks/wpsi-menu/build/index.css.map deleted file mode 100644 index b5e725f..0000000 --- a/javascript/blocks/wpsi-menu/build/index.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.css","mappings":";;;AAAA;EACC;AACD;AACC;EACC;AACF;AAEC;EACC;AAAF;AAEC;EACC;AAAF;AAEC;EACC;AAAF;AAKG;EACC;AAHJ;AASE;EACC;AAPH;AASG;EACC;AAPJ;AAYC;EACC;EACA;AAVF,C","sources":["webpack://wpsi-menu/./src/editor.scss"],"sourcesContent":[".wpsi-menu {\n\tpadding: 2rem 0;\n\n\ta {\n\t\ttext-decoration: none;\n\t}\n\n\t&.align-left {\n\t\ttext-align: left;\n\t}\n\t&.align-center {\n\t\ttext-align: center;\n\t}\n\t&.align-right {\n\t\ttext-align: right;\n\t}\n\n\t&.horizontal {\n\t\ta {\n\t\t\t&:not(:last-of-type) {\n\t\t\t\tmargin-right: 2rem;\n\t\t\t}\n\t\t}\n\t}\n\n\t&.vertical {\n\t\ta {\n\t\t\tdisplay: block;\n\t\t\t\n\t\t\t&:not(:last-of-type) {\n\t\t\t\tmargin-bottom: 2rem;\n\t\t\t}\n\t\t}\n\t}\n\n\t.wpsi {\n\t\tfont-size: 2rem;\n\t\tcolor: #333;\n\t}\n}"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/javascript/blocks/wpsi-menu/build/index.js b/javascript/blocks/wpsi-menu/build/index.js index cc40dd6..3f9e429 100644 --- a/javascript/blocks/wpsi-menu/build/index.js +++ b/javascript/blocks/wpsi-menu/build/index.js @@ -1,629 +1 @@ -/******/ (() => { // webpackBootstrap -/******/ "use strict"; -/******/ var __webpack_modules__ = ({ - -/***/ "./node_modules/@wordpress/icons/build-module/library/align-center.js": -/*!****************************************************************************!*\ - !*** ./node_modules/@wordpress/icons/build-module/library/align-center.js ***! - \****************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); -/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__); -/** - * WordPress dependencies - */ - - -const alignCenter = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { - d: "M7.5 5.5h9V4h-9v1.5Zm-3.5 7h16V11H4v1.5Zm3.5 7h9V18h-9v1.5Z" - }) -}); -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (alignCenter); -//# sourceMappingURL=align-center.js.map - -/***/ }), - -/***/ "./node_modules/@wordpress/icons/build-module/library/align-left.js": -/*!**************************************************************************!*\ - !*** ./node_modules/@wordpress/icons/build-module/library/align-left.js ***! - \**************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); -/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__); -/** - * WordPress dependencies - */ - - -const alignLeft = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { - d: "M13 5.5H4V4h9v1.5Zm7 7H4V11h16v1.5Zm-7 7H4V18h9v1.5Z" - }) -}); -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (alignLeft); -//# sourceMappingURL=align-left.js.map - -/***/ }), - -/***/ "./node_modules/@wordpress/icons/build-module/library/align-right.js": -/*!***************************************************************************!*\ - !*** ./node_modules/@wordpress/icons/build-module/library/align-right.js ***! - \***************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); -/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__); -/** - * WordPress dependencies - */ - - -const alignRight = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { - d: "M11.111 5.5H20V4h-8.889v1.5ZM4 12.5h16V11H4v1.5Zm7.111 7H20V18h-8.889v1.5Z" - }) -}); -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (alignRight); -//# sourceMappingURL=align-right.js.map - -/***/ }), - -/***/ "./node_modules/@wordpress/icons/build-module/library/justify-center-vertical.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/@wordpress/icons/build-module/library/justify-center-vertical.js ***! - \***************************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); -/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__); -/** - * WordPress dependencies - */ - - -const justifyCenterVertical = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { - d: "M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z" - }) -}); -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (justifyCenterVertical); -//# sourceMappingURL=justify-center-vertical.js.map - -/***/ }), - -/***/ "./node_modules/@wordpress/icons/build-module/library/justify-center.js": -/*!******************************************************************************!*\ - !*** ./node_modules/@wordpress/icons/build-module/library/justify-center.js ***! - \******************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/primitives */ "@wordpress/primitives"); -/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); -/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__); -/** - * WordPress dependencies - */ - - -const justifyCenter = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.SVG, { - xmlns: "http://www.w3.org/2000/svg", - viewBox: "0 0 24 24", - children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_0__.Path, { - d: "M12.5 15v5H11v-5H4V9h7V4h1.5v5h7v6h-7Z" - }) -}); -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (justifyCenter); -//# sourceMappingURL=justify-center.js.map - -/***/ }), - -/***/ "./src/block.json": -/*!************************!*\ - !*** ./src/block.json ***! - \************************/ -/***/ ((module) => { - -module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"massivedynamic/wpsi-menu","version":"0.0.1","title":"WP Social Icons Menu","category":"widgets","icon":"networking","description":"WP Social Icons Menu Block for Gutenberg","example":{},"supports":{"html":false},"attributes":{"orientation":{"type":"string","enum":["horizontal","vertical"],"default":"horizontal"},"alignment":{"type":"string","enum":["left","center","right"],"default":"center"},"exclude":{"type":"array","default":[]},"openInNewTab":{"type":"boolean","default":false}},"textdomain":"wpsi-menu","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","render":"file:./render.php"}'); - -/***/ }), - -/***/ "./src/edit.js": -/*!*********************!*\ - !*** ./src/edit.js ***! - \*********************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); -/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch"); -/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); -/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/justify-center.js"); -/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/justify-center-vertical.js"); -/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/align-left.js"); -/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/align-center.js"); -/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/icons */ "./node_modules/@wordpress/icons/build-module/library/align-right.js"); -/* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./editor.scss */ "./src/editor.scss"); -/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); -/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__); - - - - - - - - -const Edit = ({ - attributes, - setAttributes -}) => { - const [items, setItems] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)([]); - const { - alignment, - orientation, - exclude, - openInNewTab - } = attributes; - const iterator = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useMemo)(() => { - const out = []; - for (const [key, value] of Object.entries(items)) out.push({ - key, - value - }); - return out; - }, [items]); - const activeItems = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useMemo)(() => { - return iterator.filter(item => !exclude.includes(item.key)); - }, [iterator, exclude]); - const excludeService = service => { - setAttributes({ - exclude: exclude.includes(service) ? exclude.filter(item => item !== service) : [...exclude, service] - }); - }; - (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => { - _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_3___default()({ - path: "/wp-social-icons/items" - }).then(response => { - setItems(response); - }).catch(error => console.error("ERR", error)); - }, []); - return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("section", { - ...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)(), - children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InspectorControls, { - children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.PanelBody, { - title: "Active Services", - initialOpen: true, - children: iterator.map(item => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.PanelRow, { - children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.ToggleControl, { - label: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.Fragment, { - children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("span", { - className: `wpsi-${item.key}`, - style: { - fontSize: "1.2rem", - verticalAlign: "middle", - marginRight: "0.5rem" - } - }), " ", /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("span", { - style: { - verticalAlign: "middle" - }, - children: item.key - })] - }), - checked: !exclude.includes(item.key), - onChange: () => excludeService(item.key) - }) - })) - }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.PanelBody, { - title: "Link Behavior", - initialOpen: true, - children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.PanelRow, { - children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.ToggleControl, { - label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Open links in new tab", "wpsi-menu"), - checked: openInNewTab, - onChange: value => setAttributes({ - openInNewTab: value - }) - }) - }) - })] - }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.BlockControls, { - children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.ToolbarGroup, { - children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.ToolbarButton, { - isActive: orientation === "horizontal", - icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_7__["default"], - onClick: () => setAttributes({ - orientation: "horizontal" - }) - }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.ToolbarButton, { - isActive: orientation === "vertical", - icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_8__["default"], - title: "wdwdwd", - onClick: () => setAttributes({ - orientation: "vertical" - }) - })] - }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.ToolbarGroup, { - children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.ToolbarButton, { - isActive: alignment === "left", - icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_9__["default"], - title: "align left", - onClick: () => setAttributes({ - alignment: "left" - }) - }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.ToolbarButton, { - isActive: alignment === "center", - icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_10__["default"], - title: "align center", - onClick: () => setAttributes({ - alignment: "center" - }) - }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.ToolbarButton, { - isActive: alignment === "right", - icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_11__["default"], - title: "align right", - onClick: () => setAttributes({ - alignment: "right" - }) - })] - })] - }), activeItems.length < 1 ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("section", { - children: "No elements" - }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("nav", { - className: `wpsi-menu ${orientation} align-${alignment}`, - children: activeItems.map(item => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("a", { - href: item.value, - children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("span", { - className: `wpsi wpsi-${item.key}` - }) - })) - })] - }); -}; -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Edit); - -/***/ }), - -/***/ "./src/editor.scss": -/*!*************************!*\ - !*** ./src/editor.scss ***! - \*************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -// extracted by mini-css-extract-plugin - - -/***/ }), - -/***/ "./src/index.js": -/*!**********************!*\ - !*** ./src/index.js ***! - \**********************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); -/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./edit */ "./src/edit.js"); -/* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./block.json */ "./src/block.json"); -/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./style.scss */ "./src/style.scss"); - - - - -(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_2__.name, { - edit: _edit__WEBPACK_IMPORTED_MODULE_1__["default"] -}); - -/***/ }), - -/***/ "./src/style.scss": -/*!************************!*\ - !*** ./src/style.scss ***! - \************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -// extracted by mini-css-extract-plugin - - -/***/ }), - -/***/ "@wordpress/api-fetch": -/*!**********************************!*\ - !*** external ["wp","apiFetch"] ***! - \**********************************/ -/***/ ((module) => { - -module.exports = window["wp"]["apiFetch"]; - -/***/ }), - -/***/ "@wordpress/block-editor": -/*!*************************************!*\ - !*** external ["wp","blockEditor"] ***! - \*************************************/ -/***/ ((module) => { - -module.exports = window["wp"]["blockEditor"]; - -/***/ }), - -/***/ "@wordpress/blocks": -/*!********************************!*\ - !*** external ["wp","blocks"] ***! - \********************************/ -/***/ ((module) => { - -module.exports = window["wp"]["blocks"]; - -/***/ }), - -/***/ "@wordpress/components": -/*!************************************!*\ - !*** external ["wp","components"] ***! - \************************************/ -/***/ ((module) => { - -module.exports = window["wp"]["components"]; - -/***/ }), - -/***/ "@wordpress/element": -/*!*********************************!*\ - !*** external ["wp","element"] ***! - \*********************************/ -/***/ ((module) => { - -module.exports = window["wp"]["element"]; - -/***/ }), - -/***/ "@wordpress/i18n": -/*!******************************!*\ - !*** external ["wp","i18n"] ***! - \******************************/ -/***/ ((module) => { - -module.exports = window["wp"]["i18n"]; - -/***/ }), - -/***/ "@wordpress/primitives": -/*!************************************!*\ - !*** external ["wp","primitives"] ***! - \************************************/ -/***/ ((module) => { - -module.exports = window["wp"]["primitives"]; - -/***/ }), - -/***/ "react/jsx-runtime": -/*!**********************************!*\ - !*** external "ReactJSXRuntime" ***! - \**********************************/ -/***/ ((module) => { - -module.exports = window["ReactJSXRuntime"]; - -/***/ }) - -/******/ }); -/************************************************************************/ -/******/ // The module cache -/******/ var __webpack_module_cache__ = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ // Check if module is in cache -/******/ var cachedModule = __webpack_module_cache__[moduleId]; -/******/ if (cachedModule !== undefined) { -/******/ return cachedModule.exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = __webpack_module_cache__[moduleId] = { -/******/ // no module.id needed -/******/ // no module.loaded needed -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = __webpack_modules__; -/******/ -/************************************************************************/ -/******/ /* webpack/runtime/chunk loaded */ -/******/ (() => { -/******/ var deferred = []; -/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => { -/******/ if(chunkIds) { -/******/ priority = priority || 0; -/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; -/******/ deferred[i] = [chunkIds, fn, priority]; -/******/ return; -/******/ } -/******/ var notFulfilled = Infinity; -/******/ for (var i = 0; i < deferred.length; i++) { -/******/ var [chunkIds, fn, priority] = deferred[i]; -/******/ var fulfilled = true; -/******/ for (var j = 0; j < chunkIds.length; j++) { -/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) { -/******/ chunkIds.splice(j--, 1); -/******/ } else { -/******/ fulfilled = false; -/******/ if(priority < notFulfilled) notFulfilled = priority; -/******/ } -/******/ } -/******/ if(fulfilled) { -/******/ deferred.splice(i--, 1) -/******/ var r = fn(); -/******/ if (r !== undefined) result = r; -/******/ } -/******/ } -/******/ return result; -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/compat get default export */ -/******/ (() => { -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = (module) => { -/******/ var getter = module && module.__esModule ? -/******/ () => (module['default']) : -/******/ () => (module); -/******/ __webpack_require__.d(getter, { a: getter }); -/******/ return getter; -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/define property getters */ -/******/ (() => { -/******/ // define getter functions for harmony exports -/******/ __webpack_require__.d = (exports, definition) => { -/******/ for(var key in definition) { -/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { -/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); -/******/ } -/******/ } -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/hasOwnProperty shorthand */ -/******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) -/******/ })(); -/******/ -/******/ /* webpack/runtime/make namespace object */ -/******/ (() => { -/******/ // define __esModule on exports -/******/ __webpack_require__.r = (exports) => { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/jsonp chunk loading */ -/******/ (() => { -/******/ // no baseURI -/******/ -/******/ // object to store loaded and loading chunks -/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched -/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded -/******/ var installedChunks = { -/******/ "index": 0, -/******/ "./style-index": 0 -/******/ }; -/******/ -/******/ // no chunk on demand loading -/******/ -/******/ // no prefetching -/******/ -/******/ // no preloaded -/******/ -/******/ // no HMR -/******/ -/******/ // no HMR manifest -/******/ -/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0); -/******/ -/******/ // install a JSONP callback for chunk loading -/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { -/******/ var [chunkIds, moreModules, runtime] = data; -/******/ // add "moreModules" to the modules object, -/******/ // then flag all "chunkIds" as loaded and fire callback -/******/ var moduleId, chunkId, i = 0; -/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { -/******/ for(moduleId in moreModules) { -/******/ if(__webpack_require__.o(moreModules, moduleId)) { -/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; -/******/ } -/******/ } -/******/ if(runtime) var result = runtime(__webpack_require__); -/******/ } -/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); -/******/ for(;i < chunkIds.length; i++) { -/******/ chunkId = chunkIds[i]; -/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { -/******/ installedChunks[chunkId][0](); -/******/ } -/******/ installedChunks[chunkId] = 0; -/******/ } -/******/ return __webpack_require__.O(result); -/******/ } -/******/ -/******/ var chunkLoadingGlobal = globalThis["webpackChunkwpsi_menu"] = globalThis["webpackChunkwpsi_menu"] || []; -/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); -/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); -/******/ })(); -/******/ -/************************************************************************/ -/******/ -/******/ // startup -/******/ // Load entry module and return exports -/******/ // This entry module depends on other loaded chunks and execution need to be delayed -/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["./style-index"], () => (__webpack_require__("./src/index.js"))) -/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__); -/******/ -/******/ })() -; -//# sourceMappingURL=index.js.map \ No newline at end of file +(()=>{"use strict";var e,i={487:(e,i,n)=>{const o=window.wp.blocks,t=window.wp.i18n,s=window.wp.blockEditor,l=window.wp.element,r=window.wp.apiFetch;var a=n.n(r);const c=window.wp.components,h=window.wp.primitives,w=window.ReactJSXRuntime,v=(0,w.jsx)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,w.jsx)(h.Path,{d:"M12.5 15v5H11v-5H4V9h7V4h1.5v5h7v6h-7Z"})}),p=(0,w.jsx)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,w.jsx)(h.Path,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})}),d=(0,w.jsx)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,w.jsx)(h.Path,{d:"M13 5.5H4V4h9v1.5Zm7 7H4V11h16v1.5Zm-7 7H4V18h9v1.5Z"})}),x=(0,w.jsx)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,w.jsx)(h.Path,{d:"M7.5 5.5h9V4h-9v1.5Zm-3.5 7h16V11H4v1.5Zm3.5 7h9V18h-9v1.5Z"})}),u=(0,w.jsx)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,w.jsx)(h.Path,{d:"M11.111 5.5H20V4h-8.889v1.5ZM4 12.5h16V11H4v1.5Zm7.111 7H20V18h-8.889v1.5Z"})}),g=JSON.parse('{"UU":"massivedynamic/wpsi-menu"}');(0,o.registerBlockType)(g.UU,{edit:({attributes:e,setAttributes:i})=>{const[n,o]=(0,l.useState)([]),{alignment:r,orientation:h,exclude:g,openInNewTab:m}=e,j=(0,l.useMemo)((()=>{const e=[];for(const[i,o]of Object.entries(n))e.push({key:i,value:o});return e}),[n]),b=(0,l.useMemo)((()=>j.filter((e=>!g.includes(e.key)))),[j,g]);return(0,l.useEffect)((()=>{a()({path:"/wp-social-icons/items"}).then((e=>{o(e)})).catch((e=>console.error("ERR",e)))}),[]),(0,w.jsxs)("section",{...(0,s.useBlockProps)(),children:[(0,w.jsxs)(s.InspectorControls,{children:[(0,w.jsx)(c.PanelBody,{title:(0,t.__)("Active Services","wpsocialicons"),initialOpen:!0,children:j.map((e=>(0,w.jsx)(c.PanelRow,{children:(0,w.jsx)(c.ToggleControl,{label:(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)("span",{className:`wpsi-${e.key}`,style:{fontSize:"1.2rem",verticalAlign:"middle",marginRight:"0.5rem"}})," ",(0,w.jsx)("span",{style:{verticalAlign:"middle"},children:e.key})]}),checked:!g.includes(e.key),onChange:()=>{return n=e.key,void i({exclude:g.includes(n)?g.filter((e=>e!==n)):[...g,n]});var n}})})))}),(0,w.jsx)(c.PanelBody,{title:(0,t.__)("Link Behavior","wpsocialicons"),initialOpen:!0,children:(0,w.jsx)(c.PanelRow,{children:(0,w.jsx)(c.ToggleControl,{label:(0,t.__)("Open links in new tab","wpsocialicons"),checked:m,onChange:e=>i({openInNewTab:e})})})})]}),(0,w.jsxs)(s.BlockControls,{children:[(0,w.jsxs)(c.ToolbarGroup,{children:[(0,w.jsx)(c.ToolbarButton,{isActive:"horizontal"===h,icon:v,title:(0,t.__)("align horizontal","wpsocialicons"),onClick:()=>i({orientation:"horizontal"})}),(0,w.jsx)(c.ToolbarButton,{isActive:"vertical"===h,icon:p,title:(0,t.__)("align vertical","wpsocialicons"),onClick:()=>i({orientation:"vertical"})})]}),(0,w.jsxs)(c.ToolbarGroup,{children:[(0,w.jsx)(c.ToolbarButton,{isActive:"left"===r,icon:d,title:(0,t.__)("align left","wpsocialicons"),onClick:()=>i({alignment:"left"})}),(0,w.jsx)(c.ToolbarButton,{isActive:"center"===r,icon:x,title:(0,t.__)("align center","wpsocialicons"),onClick:()=>i({alignment:"center"})}),(0,w.jsx)(c.ToolbarButton,{isActive:"right"===r,icon:u,title:(0,t.__)("align right","wpsocialicons"),onClick:()=>i({alignment:"right"})})]})]}),b.length<1?(0,w.jsx)("section",{children:"No elements"}):(0,w.jsx)("nav",{className:`wpsi-menu ${h} align-${r}`,children:b.map((e=>(0,w.jsx)("a",{href:e.value,children:(0,w.jsx)("span",{className:`wpsi wpsi-${e.key}`})})))})]})}})}},n={};function o(e){var t=n[e];if(void 0!==t)return t.exports;var s=n[e]={exports:{}};return i[e](s,s.exports,o),s.exports}o.m=i,e=[],o.O=(i,n,t,s)=>{if(!n){var l=1/0;for(h=0;h=s)&&Object.keys(o.O).every((e=>o.O[e](n[a])))?n.splice(a--,1):(r=!1,s0&&e[h-1][2]>s;h--)e[h]=e[h-1];e[h]=[n,t,s]},o.n=e=>{var i=e&&e.__esModule?()=>e.default:()=>e;return o.d(i,{a:i}),i},o.d=(e,i)=>{for(var n in i)o.o(i,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:i[n]})},o.o=(e,i)=>Object.prototype.hasOwnProperty.call(e,i),(()=>{var e={57:0,350:0};o.O.j=i=>0===e[i];var i=(i,n)=>{var t,s,[l,r,a]=n,c=0;if(l.some((i=>0!==e[i]))){for(t in r)o.o(r,t)&&(o.m[t]=r[t]);if(a)var h=a(o)}for(i&&i(n);co(487)));t=o.O(t)})(); \ No newline at end of file diff --git a/javascript/blocks/wpsi-menu/build/index.js.map b/javascript/blocks/wpsi-menu/build/index.js.map deleted file mode 100644 index 5956ecd..0000000 --- a/javascript/blocks/wpsi-menu/build/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACkD;AACF;AAChD,iCAAiC,sDAAI,CAAC,sDAAG;AACzC;AACA;AACA,yBAAyB,sDAAI,CAAC,uDAAI;AAClC;AACA,GAAG;AACH,CAAC;AACD,iEAAe,WAAW,EAAC;AAC3B,wC;;;;;;;;;;;;;;;;;;ACbA;AACA;AACA;AACkD;AACF;AAChD,+BAA+B,sDAAI,CAAC,sDAAG;AACvC;AACA;AACA,yBAAyB,sDAAI,CAAC,uDAAI;AAClC;AACA,GAAG;AACH,CAAC;AACD,iEAAe,SAAS,EAAC;AACzB,sC;;;;;;;;;;;;;;;;;;ACbA;AACA;AACA;AACkD;AACF;AAChD,gCAAgC,sDAAI,CAAC,sDAAG;AACxC;AACA;AACA,yBAAyB,sDAAI,CAAC,uDAAI;AAClC;AACA,GAAG;AACH,CAAC;AACD,iEAAe,UAAU,EAAC;AAC1B,uC;;;;;;;;;;;;;;;;;;ACbA;AACA;AACA;AACkD;AACF;AAChD,2CAA2C,sDAAI,CAAC,sDAAG;AACnD;AACA;AACA,yBAAyB,sDAAI,CAAC,uDAAI;AAClC;AACA,GAAG;AACH,CAAC;AACD,iEAAe,qBAAqB,EAAC;AACrC,mD;;;;;;;;;;;;;;;;;;ACbA;AACA;AACA;AACkD;AACF;AAChD,mCAAmC,sDAAI,CAAC,sDAAG;AAC3C;AACA;AACA,yBAAyB,sDAAI,CAAC,uDAAI;AAClC;AACA,GAAG;AACH,CAAC;AACD,iEAAe,aAAa,EAAC;AAC7B,0C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACb6D;AAC0C;AACvC;AACE;AAkBnC;AAQL;AAEH;AAAA;AAEvB,MAAMqC,IAAI,GAAGA,CAAC;EAACC,UAAU;EAAEC;AAAa,CAAC,KAAK;EAC7C,MAAM,CAACC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WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA,E;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA,E;;;;;WCPA,wF;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D,E;;;;;WCNA;;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,MAAM,qBAAqB;WAC3B;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;WAEA;WACA;WACA,4G;;;;;UEjDA;UACA;UACA;UACA;UACA","sources":["webpack://wpsi-menu/./node_modules/@wordpress/icons/build-module/library/align-center.js","webpack://wpsi-menu/./node_modules/@wordpress/icons/build-module/library/align-left.js","webpack://wpsi-menu/./node_modules/@wordpress/icons/build-module/library/align-right.js","webpack://wpsi-menu/./node_modules/@wordpress/icons/build-module/library/justify-center-vertical.js","webpack://wpsi-menu/./node_modules/@wordpress/icons/build-module/library/justify-center.js","webpack://wpsi-menu/./src/edit.js","webpack://wpsi-menu/./src/editor.scss","webpack://wpsi-menu/./src/index.js","webpack://wpsi-menu/./src/style.scss","webpack://wpsi-menu/external window [\"wp\",\"apiFetch\"]","webpack://wpsi-menu/external window [\"wp\",\"blockEditor\"]","webpack://wpsi-menu/external window [\"wp\",\"blocks\"]","webpack://wpsi-menu/external window [\"wp\",\"components\"]","webpack://wpsi-menu/external window [\"wp\",\"element\"]","webpack://wpsi-menu/external window [\"wp\",\"i18n\"]","webpack://wpsi-menu/external window [\"wp\",\"primitives\"]","webpack://wpsi-menu/external window \"ReactJSXRuntime\"","webpack://wpsi-menu/webpack/bootstrap","webpack://wpsi-menu/webpack/runtime/chunk loaded","webpack://wpsi-menu/webpack/runtime/compat get default export","webpack://wpsi-menu/webpack/runtime/define property getters","webpack://wpsi-menu/webpack/runtime/hasOwnProperty shorthand","webpack://wpsi-menu/webpack/runtime/make namespace object","webpack://wpsi-menu/webpack/runtime/jsonp chunk loading","webpack://wpsi-menu/webpack/before-startup","webpack://wpsi-menu/webpack/startup","webpack://wpsi-menu/webpack/after-startup"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst alignCenter = /*#__PURE__*/_jsx(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n children: /*#__PURE__*/_jsx(Path, {\n d: \"M7.5 5.5h9V4h-9v1.5Zm-3.5 7h16V11H4v1.5Zm3.5 7h9V18h-9v1.5Z\"\n })\n});\nexport default alignCenter;\n//# sourceMappingURL=align-center.js.map","/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst alignLeft = /*#__PURE__*/_jsx(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n children: /*#__PURE__*/_jsx(Path, {\n d: \"M13 5.5H4V4h9v1.5Zm7 7H4V11h16v1.5Zm-7 7H4V18h9v1.5Z\"\n })\n});\nexport default alignLeft;\n//# sourceMappingURL=align-left.js.map","/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst alignRight = /*#__PURE__*/_jsx(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n children: /*#__PURE__*/_jsx(Path, {\n d: \"M11.111 5.5H20V4h-8.889v1.5ZM4 12.5h16V11H4v1.5Zm7.111 7H20V18h-8.889v1.5Z\"\n })\n});\nexport default alignRight;\n//# sourceMappingURL=align-right.js.map","/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst justifyCenterVertical = /*#__PURE__*/_jsx(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n children: /*#__PURE__*/_jsx(Path, {\n d: \"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z\"\n })\n});\nexport default justifyCenterVertical;\n//# sourceMappingURL=justify-center-vertical.js.map","/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst justifyCenter = /*#__PURE__*/_jsx(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n children: /*#__PURE__*/_jsx(Path, {\n d: \"M12.5 15v5H11v-5H4V9h7V4h1.5v5h7v6h-7Z\"\n })\n});\nexport default justifyCenter;\n//# sourceMappingURL=justify-center.js.map","import {__} from \"@wordpress/i18n\";\nimport {useBlockProps, BlockControls, InspectorControls} from \"@wordpress/block-editor\";\nimport {useState, useEffect, useMemo} from \"@wordpress/element\";\nimport apiFetch from \"@wordpress/api-fetch\";\n\nimport {\n\tSpinner,\n\tPanelBody,\n\tPanelRow,\n\tRangeControl,\n\tTextControl,\n\tToggleControl,\n\tToolbarButton,\n\tToolbarGroup,\n\tModal,\n\tButton,\n\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\t__experimentalText as Text,\n\t__experimentalHStack as HStack\n} from \"@wordpress/components\";\n\nimport {\n\tjustifyCenter,\n\tjustifyCenterVertical,\n\talignLeft,\n\talignCenter,\n\talignRight\n} from '@wordpress/icons';\n\nimport \"./editor.scss\";\n\nconst Edit = ({attributes, setAttributes}) => {\n\tconst [items, setItems] = useState([]);\n\n\tconst {alignment, orientation, exclude, openInNewTab} = attributes;\n\n\tconst iterator = useMemo(() => {\n\t\tconst out = [];\n\n\t\tfor (const [key, value] of Object.entries(items))\n\t\t\tout.push({key, value});\n\n\t\treturn out;\n\t}, [items]);\n\n\tconst activeItems = useMemo(() => {\n\t\treturn iterator.filter(item => !exclude.includes(item.key));\n\t}, [iterator, exclude]);\n\n\tconst excludeService = service => {\n\t\tsetAttributes({exclude : exclude.includes(service) ? exclude.filter(item => item !== service) : [...exclude, service]});\n\t};\n\n\tuseEffect(() => {\n\t\tapiFetch({path : \"/wp-social-icons/items\"}).then(response => {\n\t\t\tsetItems(response);\n\t\t}).catch(error => console.error(\"ERR\", error));\n\t}, []);\n\n\treturn (\n\t\t
\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\t{iterator.map(item => (\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t {item.key}} checked={!exclude.includes(item.key)} onChange={() => excludeService(item.key)} />\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t))}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t setAttributes({openInNewTab : value})} />\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t setAttributes({ orientation : \"horizontal\"})} />\n\t\t\t\t\t setAttributes({orientation : \"vertical\"})} />\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t setAttributes({alignment : \"left\"})} />\n\t\t\t\t\t setAttributes({alignment : \"center\"})} />\n\t\t\t\t\t setAttributes({alignment : \"right\"})} />\n\t\t\t\t\n\t\t\t\n\t\t\t{activeItems.length < 1 ?\n\t\t\t\t
No elements
:\n\t\t\t\t\n\t\t\t}\n\t\t
\n\t);\n};\n\nexport default Edit;","// extracted by mini-css-extract-plugin\nexport {};","import {registerBlockType} from \"@wordpress/blocks\";\n\nimport Edit from \"./edit\";\nimport metadata from \"./block.json\";\n\nimport \"./style.scss\";\n\nregisterBlockType(metadata.name, {\n\tedit : Edit\n} );\n","// extracted by mini-css-extract-plugin\nexport {};","module.exports = window[\"wp\"][\"apiFetch\"];","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","module.exports = window[\"wp\"][\"primitives\"];","module.exports = window[\"ReactJSXRuntime\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t\"index\": 0,\n\t\"./style-index\": 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = globalThis[\"webpackChunkwpsi_menu\"] = globalThis[\"webpackChunkwpsi_menu\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [\"./style-index\"], () => (__webpack_require__(\"./src/index.js\")))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n",""],"names":["__","useBlockProps","BlockControls","InspectorControls","useState","useEffect","useMemo","apiFetch","Spinner","PanelBody","PanelRow","RangeControl","TextControl","ToggleControl","ToolbarButton","ToolbarGroup","Modal","Button","__experimentalToggleGroupControl","ToggleGroupControl","__experimentalToggleGroupControlOption","ToggleGroupControlOption","__experimentalText","Text","__experimentalHStack","HStack","justifyCenter","justifyCenterVertical","alignLeft","alignCenter","alignRight","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","Edit","attributes","setAttributes","items","setItems","alignment","orientation","exclude","openInNewTab","iterator","out","key","value","Object","entries","push","activeItems","filter","item","includes","excludeService","service","path","then","response","catch","error","console","children","title","initialOpen","map","label","className","style","fontSize","verticalAlign","marginRight","checked","onChange","isActive","icon","onClick","length","href","registerBlockType","metadata","name","edit"],"sourceRoot":""} \ No newline at end of file diff --git a/javascript/blocks/wpsi-menu/build/style-index-rtl.css b/javascript/blocks/wpsi-menu/build/style-index-rtl.css index 5efa525..dc57504 100644 --- a/javascript/blocks/wpsi-menu/build/style-index-rtl.css +++ b/javascript/blocks/wpsi-menu/build/style-index-rtl.css @@ -1,36 +1 @@ -/*!***************************************************************************************************************************************************************************************************************************************!*\ - !*** 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/style.scss ***! - \***************************************************************************************************************************************************************************************************************************************/ -.wp-block-create-block-wpsi-menu { - background-color: #21759b; - color: #fff; - padding: 2px; -} - -nav.wp-social-icons { - display: flex; - padding: 2rem 0; - gap: 2rem; - align-items: center; -} -nav.wp-social-icons > a .wpsi { - font-size: 1.8rem; -} -nav.wp-social-icons.align-center { - justify-content: center; -} -nav.wp-social-icons.align-left { - justify-content: flex-start; -} -nav.wp-social-icons.align-right { - justify-content: flex-end; -} -nav.wp-social-icons.vertical { - flex-direction: column; -} -nav.wp-social-icons.vertical.align-left { - align-items: flex-start; -} -nav.wp-social-icons.vertical.align-right { - align-items: flex-end; -} +.wp-block-create-block-wpsi-menu{background-color:#21759b;color:#fff;padding:2px}nav.wp-social-icons{align-items:center;display:flex;gap:2rem;padding:2rem 0}nav.wp-social-icons>a .wpsi{font-size:1.8rem}nav.wp-social-icons.align-center{justify-content:center}nav.wp-social-icons.align-left{justify-content:flex-start}nav.wp-social-icons.align-right{justify-content:flex-end}nav.wp-social-icons.vertical{flex-direction:column}nav.wp-social-icons.vertical.align-left{align-items:flex-start}nav.wp-social-icons.vertical.align-right{align-items:flex-end} diff --git a/javascript/blocks/wpsi-menu/build/style-index.css b/javascript/blocks/wpsi-menu/build/style-index.css index c75f9f1..dc57504 100644 --- a/javascript/blocks/wpsi-menu/build/style-index.css +++ b/javascript/blocks/wpsi-menu/build/style-index.css @@ -1,38 +1 @@ -/*!***************************************************************************************************************************************************************************************************************************************!*\ - !*** 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/style.scss ***! - \***************************************************************************************************************************************************************************************************************************************/ -.wp-block-create-block-wpsi-menu { - background-color: #21759b; - color: #fff; - padding: 2px; -} - -nav.wp-social-icons { - display: flex; - padding: 2rem 0; - gap: 2rem; - align-items: center; -} -nav.wp-social-icons > a .wpsi { - font-size: 1.8rem; -} -nav.wp-social-icons.align-center { - justify-content: center; -} -nav.wp-social-icons.align-left { - justify-content: flex-start; -} -nav.wp-social-icons.align-right { - justify-content: flex-end; -} -nav.wp-social-icons.vertical { - flex-direction: column; -} -nav.wp-social-icons.vertical.align-left { - align-items: flex-start; -} -nav.wp-social-icons.vertical.align-right { - align-items: flex-end; -} - -/*# sourceMappingURL=style-index.css.map*/ \ No newline at end of file +.wp-block-create-block-wpsi-menu{background-color:#21759b;color:#fff;padding:2px}nav.wp-social-icons{align-items:center;display:flex;gap:2rem;padding:2rem 0}nav.wp-social-icons>a .wpsi{font-size:1.8rem}nav.wp-social-icons.align-center{justify-content:center}nav.wp-social-icons.align-left{justify-content:flex-start}nav.wp-social-icons.align-right{justify-content:flex-end}nav.wp-social-icons.vertical{flex-direction:column}nav.wp-social-icons.vertical.align-left{align-items:flex-start}nav.wp-social-icons.vertical.align-right{align-items:flex-end} diff --git a/javascript/blocks/wpsi-menu/build/style-index.css.map b/javascript/blocks/wpsi-menu/build/style-index.css.map deleted file mode 100644 index 9ed9aed..0000000 --- a/javascript/blocks/wpsi-menu/build/style-index.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"./style-index.css","mappings":";;;AAAA;EACC;EACA;EACA;AACD;;AAEA;EACC;EACA;EACA;EACA;AACD;AAEE;EACC;AAAH;AAIC;EACC;AAFF;AAKC;EACC;AAHF;AAMC;EACC;AAJF;AAOC;EACC;AALF;AAOE;EACC;AALH;AAQE;EACC;AANH,C","sources":["webpack://wpsi-menu/./src/style.scss"],"sourcesContent":[".wp-block-create-block-wpsi-menu {\n\tbackground-color: #21759b;\n\tcolor: #fff;\n\tpadding: 2px;\n}\n\nnav.wp-social-icons {\n\tdisplay: flex;\n\tpadding: 2rem 0;\n\tgap: 2rem;\n\talign-items: center;\n\n\t> a {\n\t\t.wpsi {\n\t\t\tfont-size: 1.8rem;\n\t\t}\n\t}\n\n\t&.align-center {\n\t\tjustify-content: center;\n\t}\n\n\t&.align-left {\n\t\tjustify-content: flex-start;\n\t}\n\n\t&.align-right {\n\t\tjustify-content: flex-end;\n\t}\n\n\t&.vertical {\n\t\tflex-direction: column;\n\n\t\t&.align-left {\n\t\t\talign-items: flex-start;\n\t\t}\n\t\t\n\t\t&.align-right {\n\t\t\talign-items: flex-end;\n\t\t}\n\t}\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/javascript/blocks/wpsi-menu/src/block.json b/javascript/blocks/wpsi-menu/src/block.json index 7cb754a..7f183d3 100644 --- a/javascript/blocks/wpsi-menu/src/block.json +++ b/javascript/blocks/wpsi-menu/src/block.json @@ -2,7 +2,7 @@ "$schema" : "https://schemas.wp.org/trunk/block.json", "apiVersion" : 3, "name" : "massivedynamic/wpsi-menu", - "version" : "0.1.0", + "version" : "0.2.0", "title" : "WP Social Icons Menu", "category" : "widgets", "icon" : "networking", @@ -31,7 +31,7 @@ "default" : false } }, - "textdomain" : "wpsi-menu", + "textdomain" : "wpsocialicons", "editorScript" : "file:./index.js", "editorStyle" : "file:./index.css", "style" : "file:./style-index.css", diff --git a/javascript/blocks/wpsi-menu/src/edit.js b/javascript/blocks/wpsi-menu/src/edit.js index 31c083e..adc46dc 100644 --- a/javascript/blocks/wpsi-menu/src/edit.js +++ b/javascript/blocks/wpsi-menu/src/edit.js @@ -62,28 +62,28 @@ const Edit = ({attributes, setAttributes}) => { return (
- + {iterator.map(item => ( {item.key}} checked={!exclude.includes(item.key)} onChange={() => excludeService(item.key)} /> ))} - + - setAttributes({openInNewTab : value})} /> + setAttributes({openInNewTab : value})} /> - setAttributes({ orientation : "horizontal"})} /> - setAttributes({orientation : "vertical"})} /> + setAttributes({ orientation : "horizontal"})} /> + setAttributes({orientation : "vertical"})} /> - setAttributes({alignment : "left"})} /> - setAttributes({alignment : "center"})} /> - setAttributes({alignment : "right"})} /> + setAttributes({alignment : "left"})} /> + setAttributes({alignment : "center"})} /> + setAttributes({alignment : "right"})} /> {activeItems.length < 1 ? diff --git a/lang/wpsocialicons-de_DE-massivedynamic-wpsi-menu-editor-script.json b/lang/wpsocialicons-de_DE-massivedynamic-wpsi-menu-editor-script.json new file mode 100644 index 0000000..3f85521 --- /dev/null +++ b/lang/wpsocialicons-de_DE-massivedynamic-wpsi-menu-editor-script.json @@ -0,0 +1 @@ +{"translation-revision-date":"2026-02-02 11:24+0100","generator":"WP-CLI\/2.12.0","source":"javascript\/blocks\/wpsi-menu\/src\/edit.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"de","plural-forms":"nplurals=2; plural=(n != 1);"},"Active Services":["Aktive Dienste"],"Link Behavior":["Linkverhalten"],"Open links in new tab":["Links in neuem Tab \u00f6ffnen"],"align horizontal":["horizontal ausrichten"],"align vertical":["vertikal ausrichten"],"align left":["Links ausrichten"],"align center":["mittig ausrichten"],"align right":["Rechts ausrichten"]}}} \ No newline at end of file diff --git a/lang/wpsocialicons-de_DE.mo b/lang/wpsocialicons-de_DE.mo new file mode 100644 index 0000000..7e8c07b Binary files /dev/null and b/lang/wpsocialicons-de_DE.mo differ diff --git a/lang/wpsocialicons-de_DE.po b/lang/wpsocialicons-de_DE.po new file mode 100644 index 0000000..9be7363 --- /dev/null +++ b/lang/wpsocialicons-de_DE.po @@ -0,0 +1,70 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-02-02 11:55+0100\n" +"PO-Revision-Date: 2026-02-02 11:55+0100\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 3.8\n" +"X-Poedit-Basepath: ..\n" +"X-Poedit-KeywordsList: __\n" +"X-Poedit-SearchPath-0: src\n" +"X-Poedit-SearchPath-1: javascript\n" +"X-Poedit-SearchPathExcluded-0: javascript/blocks/wpsi-menu/node_modules\n" + +#: javascript/blocks/wpsi-menu/src/edit.js:65 +msgid "Active Services" +msgstr "Aktive Dienste" + +#: javascript/blocks/wpsi-menu/src/edit.js:72 +msgid "Link Behavior" +msgstr "Linkverhalten" + +#: javascript/blocks/wpsi-menu/src/edit.js:74 +msgid "Open links in new tab" +msgstr "Links in neuem Tab öffnen" + +#: javascript/blocks/wpsi-menu/src/edit.js:80 +msgid "align horizontal" +msgstr "horizontal ausrichten" + +#: javascript/blocks/wpsi-menu/src/edit.js:81 +msgid "align vertical" +msgstr "vertikal ausrichten" + +#: javascript/blocks/wpsi-menu/src/edit.js:84 +msgid "align left" +msgstr "Links ausrichten" + +#: javascript/blocks/wpsi-menu/src/edit.js:85 +msgid "align center" +msgstr "mittig ausrichten" + +#: javascript/blocks/wpsi-menu/src/edit.js:86 +msgid "align right" +msgstr "Rechts ausrichten" + +#: src/Blocks.php:16 +msgid "WP Social Icons Menu" +msgstr "WP Social Icons Menü" + +#: src/Blocks.php:17 +msgid "WP Social Icons Menu Block for Gutenberg" +msgstr "Der WP Social Icons Menüblock für Gutenberg" + +#: src/Settings.php:18 src/Settings.php:19 +msgid "Social Icons" +msgstr "Social Icons" + +#: src/Settings.php:58 +msgid "" +"Just add the corresponding URL to your social media account to the field " +"below the service you want to activate." +msgstr "" +"Füge einfach die URL zu deinem respektiven Social Media Account in das " +"Textfeld unter dem Dienst ein, um Ihn zu aktivieren." diff --git a/src/Blocks.php b/src/Blocks.php index 3b6da28..2a6606c 100644 --- a/src/Blocks.php +++ b/src/Blocks.php @@ -3,6 +3,7 @@ namespace wpsocialicons; use WP_REST_Request; +use wpsocialicons\Plugin; class Blocks { public function __construct(private Settings $settings) { @@ -11,7 +12,11 @@ class Blocks { } public function registerBlocks() : void { - register_block_type(dirname(__FILE__)."/../javascript/blocks/wpsi-menu/build"); + register_block_type(dirname(__FILE__)."/../javascript/blocks/wpsi-menu/build", [ + "title" => __("WP Social Icons Menu", "wpsocialicons"), + "description" => __("WP Social Icons Menu Block for Gutenberg", "wpsocialicons") + ]); + wp_set_script_translations("massivedynamic-wpsi-menu-editor-script", Plugin::TEXTDOMAIN, dirname(__FILE__)."/../lang"); } public function registerAPIRoute() : void { diff --git a/src/Plugin.php b/src/Plugin.php index 3de9808..e65f0b0 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -8,6 +8,7 @@ use wpsocialicons\Frontend; use wpsocialicons\Settings; class Plugin { + const TEXTDOMAIN = "wpsocialicons"; const OPTIONS_KEY = "wpsi-services"; private Backend $backend; @@ -17,7 +18,7 @@ class Plugin { public readonly array $available; - public function __construct() { + public function __construct(private string $baseName) { spl_autoload_register([$this, "autoload"]); $this->loadAvailable(); @@ -25,6 +26,12 @@ class Plugin { $this->backend = new Backend(); $this->blocks = new Blocks($this->settings); $this->frontend = new Frontend($this->settings); + + add_action("init", [$this, "init"], 0); + } + + public function init() : void { + load_plugin_textdomain(self::TEXTDOMAIN, false, "$this->baseName/lang"); } public function autoload(string $className) : void { diff --git a/src/Settings.php b/src/Settings.php index dcd450f..36e7cdc 100644 --- a/src/Settings.php +++ b/src/Settings.php @@ -54,7 +54,8 @@ class Settings { } echo $template->render([ - "icons" => $icons + "icons" => $icons, + "description" => __("Just add the corresponding URL to your social media account to the field below the service you want to activate.", "wpsocialicons") ]); } diff --git a/views/settings.html b/views/settings.html index 34ac7f8..2330d39 100644 --- a/views/settings.html +++ b/views/settings.html @@ -1,8 +1,7 @@

WP Social Icons

- Just add the corresponding URL to your social media account to the - field below the service you want to activate. + {{description}}

{{icons}} diff --git a/wp-social-icons.php b/wp-social-icons.php index cb8cd0d..5e4dad4 100644 --- a/wp-social-icons.php +++ b/wp-social-icons.php @@ -7,11 +7,11 @@ * License: MIT * Text Domain: wpsocialicons * Domain Path: /lang - * Version: 0.1.0 + * Version: 0.2.0 */ require_once("src/Plugin.php"); use wpsocialicons\Plugin; - new Plugin; \ No newline at end of file +new Plugin(dirname(plugin_basename( __FILE__ ))); \ No newline at end of file