diff --git a/javascript/blocks/wpsi-menu/build/block.json b/javascript/blocks/wpsi-menu/build/block.json index a38f229..0d1bc4a 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.0.1", + "version": "0.1.0", "title": "WP Social Icons Menu", "category": "widgets", "icon": "networking", @@ -32,6 +32,10 @@ "exclude": { "type": "array", "default": [] + }, + "openInNewTab": { + "type": "boolean", + "default": false } }, "textdomain": "wpsi-menu", diff --git a/javascript/blocks/wpsi-menu/build/index.asset.php b/javascript/blocks/wpsi-menu/build/index.asset.php index 27d54bd..1f764f0 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' => '0f8272dc7fc5d65bc4e2'); + array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '620ad439ae4501db362c'); diff --git a/javascript/blocks/wpsi-menu/build/index.js b/javascript/blocks/wpsi-menu/build/index.js index f696279..cc40dd6 100644 --- a/javascript/blocks/wpsi-menu/build/index.js +++ b/javascript/blocks/wpsi-menu/build/index.js @@ -163,7 +163,7 @@ const justifyCenter = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE \************************/ /***/ ((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":[]}},"textdomain":"wpsi-menu","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","render":"file:./render.php"}'); +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"}'); /***/ }), @@ -211,7 +211,8 @@ const Edit = ({ const { alignment, orientation, - exclude + exclude, + openInNewTab } = attributes; const iterator = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useMemo)(() => { const out = []; @@ -238,8 +239,8 @@ const Edit = ({ }, []); 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__.jsx)(_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, { + 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, { @@ -263,7 +264,19 @@ const Edit = ({ 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, { diff --git a/javascript/blocks/wpsi-menu/build/index.js.map b/javascript/blocks/wpsi-menu/build/index.js.map index fdf9822..5956ecd 100644 --- a/javascript/blocks/wpsi-menu/build/index.js.map +++ b/javascript/blocks/wpsi-menu/build/index.js.map @@ -1 +1 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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?0339","webpack://wpsi-menu/./src/index.js","webpack://wpsi-menu/./src/style.scss?75bd","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} = 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\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","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 +{"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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;;;ACAA,sC;;;;;;;;;;ACAA,4C;;;;;;;;;;ACAA,2C;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;UAEA;UACA;;;;;WCzBA;WACA;WACA;WACA;WACA,+BAA+B,wCAAwC;WACvE;WACA;WACA;WACA;WACA,iBAAiB,qBAAqB;WACtC;WACA;WACA,kBAAkB,qBAAqB;WACvC;WACA;WACA,KAAK;WACL;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,E;;;;;WC3BA;WACA;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/render.php b/javascript/blocks/wpsi-menu/build/render.php index ca825f3..72bc64a 100644 --- a/javascript/blocks/wpsi-menu/build/render.php +++ b/javascript/blocks/wpsi-menu/build/render.php @@ -2,10 +2,11 @@ use wpsocialicons\Settings; -["exclude" => $exclude, "orientation" => $orientation, "alignment" => $alignment] = $attributes ?? []; +["exclude" => $exclude, "orientation" => $orientation, "alignment" => $alignment, "openInNewTab" => $openInNewTab] = $attributes ?? []; $services = array_filter((array) Settings::Services(), fn ($value, $key) => !in_array($key, $exclude), ARRAY_FILTER_USE_BOTH); the_wp_social_icons([ "exclude" => $exclude, "container_class" => "wp-social-icons $orientation align-$alignment", + "openInNewTab" => $openInNewTab ]); \ 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 1d685d5..7cb754a 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.0.1", + "version" : "0.1.0", "title" : "WP Social Icons Menu", "category" : "widgets", "icon" : "networking", @@ -25,6 +25,10 @@ "exclude" : { "type" : "array", "default" : [] + }, + "openInNewTab" : { + "type" : "boolean", + "default" : false } }, "textdomain" : "wpsi-menu", diff --git a/javascript/blocks/wpsi-menu/src/edit.js b/javascript/blocks/wpsi-menu/src/edit.js index 1ada6ce..31c083e 100644 --- a/javascript/blocks/wpsi-menu/src/edit.js +++ b/javascript/blocks/wpsi-menu/src/edit.js @@ -34,7 +34,7 @@ import "./editor.scss"; const Edit = ({attributes, setAttributes}) => { const [items, setItems] = useState([]); - const {alignment, orientation, exclude} = attributes; + const {alignment, orientation, exclude, openInNewTab} = attributes; const iterator = useMemo(() => { const out = []; @@ -68,7 +68,12 @@ const Edit = ({attributes, setAttributes}) => { {item.key}} checked={!exclude.includes(item.key)} onChange={() => excludeService(item.key)} /> ))} - + + + + setAttributes({openInNewTab : value})} /> + + diff --git a/javascript/blocks/wpsi-menu/src/render.php b/javascript/blocks/wpsi-menu/src/render.php index ca825f3..72bc64a 100644 --- a/javascript/blocks/wpsi-menu/src/render.php +++ b/javascript/blocks/wpsi-menu/src/render.php @@ -2,10 +2,11 @@ use wpsocialicons\Settings; -["exclude" => $exclude, "orientation" => $orientation, "alignment" => $alignment] = $attributes ?? []; +["exclude" => $exclude, "orientation" => $orientation, "alignment" => $alignment, "openInNewTab" => $openInNewTab] = $attributes ?? []; $services = array_filter((array) Settings::Services(), fn ($value, $key) => !in_array($key, $exclude), ARRAY_FILTER_USE_BOTH); the_wp_social_icons([ "exclude" => $exclude, "container_class" => "wp-social-icons $orientation align-$alignment", + "openInNewTab" => $openInNewTab ]); \ No newline at end of file diff --git a/javascript/blocks/wpsi-menu/src/save.js b/javascript/blocks/wpsi-menu/src/save.js index 588ac94..0d01fe5 100644 --- a/javascript/blocks/wpsi-menu/src/save.js +++ b/javascript/blocks/wpsi-menu/src/save.js @@ -15,7 +15,7 @@ export default function save({attributes}) { }).catch(error => console.error("ERR", error)); }, []); */ - const {orientation, alignment} = attributes; + const {orientation, alignment, openInNewTab} = attributes; const props = useBlockProps.save(); console.log("SAVE PROPS", attributes); diff --git a/src/Frontend.php b/src/Frontend.php index 9b3ff65..3305da6 100644 --- a/src/Frontend.php +++ b/src/Frontend.php @@ -10,7 +10,8 @@ class Frontend { "after" => "", "icon_before" => "", "icon_after" => "", - "exclude" => [] + "exclude" => [], + "openInNewTab" => false ]; public function __construct(private Settings $settings) { add_action("wp_enqueue_scripts", [$this, "enqueueFont"]); @@ -29,7 +30,9 @@ class Frontend { $iconBefore = $args["icon_before"]; $iconAfter = $args["icon_after"]; $exclude = $args["exclude"]; + $openInNewTab = $args["openInNewTab"]; + $newTab = $openInNewTab ? " target='_blank'" : ""; $out = "<$container class='$containerClass'>"; $services = Settings::Services(); @@ -38,7 +41,7 @@ class Frontend { continue; $out .= sprintf( - "$before$iconBefore$iconAfter$after\n", + "$before$iconBefore$iconAfter$after\n", $url, $service ); diff --git a/wp-social-icons.php b/wp-social-icons.php index 31891d6..cb8cd0d 100644 --- a/wp-social-icons.php +++ b/wp-social-icons.php @@ -7,7 +7,7 @@ * License: MIT * Text Domain: wpsocialicons * Domain Path: /lang - * Version: 0.0.1 + * Version: 0.1.0 */ require_once("src/Plugin.php");