diff --git a/.plugin-data b/.plugin-data index 9ed8c91..ce39b1c 100644 --- a/.plugin-data +++ b/.plugin-data @@ -1,4 +1,4 @@ { - "version": "0.1.2", + "version": "0.1.3", "slug": "mosne-dark-palette" } diff --git a/README.md b/README.md index 20bda18..db15be9 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,9 @@ You can change the icons using CSS in your theme or in the customizer. ![screenshot-3](https://github.com/mosne/mosne-dark-palette/blob/main/_wordpress-org/screenshot-3.gif) ## Changelog +### 0.1.3 - 2023-06-09 + +* Fix escaping via wp_kses_data and changelogs ### 0.1.2 - 2023-06-01 diff --git a/build/index.css.map b/build/index.css.map new file mode 100644 index 0000000..257786d --- /dev/null +++ b/build/index.css.map @@ -0,0 +1 @@ +{"version":3,"file":"index.css","mappings":";;;AAAA;;;;EAAA;AAQC;EACC;EACA;AAFF;AAIE;EACC;AAFH,C","sources":["webpack://mosne-dark-palette/./src/editor.scss"],"sourcesContent":["/**\n * The following styles get applied inside the editor only.\n *\n * Replace them with your own styles or remove the file completely.\n */\n\n.wp-block-mosne-dark-palette {\n\n\t&__parlette {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\n\t\t&-item {\n\t\t\tflex: 1 1 50%;\n\t\t}\n\t}\n}\n\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/build/index.js.map b/build/index.js.map new file mode 100644 index 0000000..b958789 --- /dev/null +++ b/build/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;;;;AAAA;AACA;AACA;AAC8D;;AAE9D,eAAe,kCAAkC,4CAA4C;;AAE7F;AACA;AACA;AACA,WAAW,2CAA2C;AACtD;AACA;AACA,WAAW,2CAA2C;AACtD;AACA,YAAY,cAAc;AAC1B;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,SAAS,gEAAY;AACrB;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,iEAAe,8DAAU,MAAM,EAAC;AAChC;;;;;;;;;;;;;;;;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AQmE,YAAoB,CACrB,CACL,CACH,CAAC;AAEL;;;;;;;;;;;;;;;;;AC1GsD;AAChC;AACI;AACmB;AACT;AAEpCY,oEAAiB,CAAEC,6CAAa,EAAE;EACjCpC,IAAI,EAAEK,4DAAQ;EACdgC,IAAI,EAAElB,6CAAIA;AACX,CAAE,CAAC;;;;;;;;;;;ACTH;;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;;;;;;;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;;;;;WC3BA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;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;;;;;UEjDA;UACA;UACA;UACA;UACA","sources":["webpack://mosne-dark-palette/./node_modules/@wordpress/icons/build-module/icon/index.js","webpack://mosne-dark-palette/./node_modules/@wordpress/icons/build-module/library/arrow-right.js","webpack://mosne-dark-palette/./src/components/ButtonColorPopover.js","webpack://mosne-dark-palette/./src/components/DarkColorPalette.js","webpack://mosne-dark-palette/./src/components/iconAuto.js","webpack://mosne-dark-palette/./src/edit.js","webpack://mosne-dark-palette/./src/index.js","webpack://mosne-dark-palette/./src/editor.scss?0339","webpack://mosne-dark-palette/./src/style.scss?75bd","webpack://mosne-dark-palette/external window \"React\"","webpack://mosne-dark-palette/external window [\"wp\",\"blockEditor\"]","webpack://mosne-dark-palette/external window [\"wp\",\"blocks\"]","webpack://mosne-dark-palette/external window [\"wp\",\"components\"]","webpack://mosne-dark-palette/external window [\"wp\",\"element\"]","webpack://mosne-dark-palette/external window [\"wp\",\"i18n\"]","webpack://mosne-dark-palette/external window [\"wp\",\"primitives\"]","webpack://mosne-dark-palette/webpack/bootstrap","webpack://mosne-dark-palette/webpack/runtime/chunk loaded","webpack://mosne-dark-palette/webpack/runtime/compat get default export","webpack://mosne-dark-palette/webpack/runtime/define property getters","webpack://mosne-dark-palette/webpack/runtime/hasOwnProperty shorthand","webpack://mosne-dark-palette/webpack/runtime/make namespace object","webpack://mosne-dark-palette/webpack/runtime/jsonp chunk loading","webpack://mosne-dark-palette/webpack/before-startup","webpack://mosne-dark-palette/webpack/startup","webpack://mosne-dark-palette/webpack/after-startup"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { cloneElement, forwardRef } from '@wordpress/element';\n\n/** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */\n\n/**\n * Return an SVG icon.\n *\n * @param {IconProps} props icon is the SVG component to render\n * size is a number specifiying the icon size in pixels\n * Other props will be passed to wrapped SVG component\n * @param {import('react').ForwardedRef} ref The forwarded ref to the SVG element.\n *\n * @return {JSX.Element} Icon component\n */\nfunction Icon({\n icon,\n size = 24,\n ...props\n}, ref) {\n return cloneElement(icon, {\n width: size,\n height: size,\n ...props,\n ref\n });\n}\nexport default forwardRef(Icon);\n//# sourceMappingURL=index.js.map","import { createElement } from \"react\";\n/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nconst arrowRight = createElement(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\"\n}, createElement(Path, {\n d: \"m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z\"\n}));\nexport default arrowRight;\n//# sourceMappingURL=arrow-right.js.map","/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tColorIndicator,\n\tColorPalette,\n\tPopover,\n} from '@wordpress/components';\nimport { useState } from '@wordpress/element';\n\nconst ButtonColorPopover = ( {\n\tcurrentColor,\n\tcolors,\n\tcurrentSlug,\n\thandeSetAttribute,\n\tdarkPalette,\n} ) => {\n\tconst [ isVisible, setIsVisible ] = useState( false );\n\tconst toggleVisible = () => {\n\t\tsetIsVisible( ( state ) => ! state );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t\n\t\t\t{ isVisible && (\n\t\t\t\t {\n\t\t\t\t\t\tif ( isVisible ) {\n\t\t\t\t\t\t\tsetIsVisible( false );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t
\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t// Update the color value in darkPalette\n\t\t\t\t\t\t\t\tconst newDarkPalette = darkPalette.map(\n\t\t\t\t\t\t\t\t\t( item ) => {\n\t\t\t\t\t\t\t\t\t\tif ( item.slug === currentSlug ) {\n\t\t\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\t\t\t...item,\n\t\t\t\t\t\t\t\t\t\t\t\tcolor: value,\n\t\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\treturn item;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\thandeSetAttribute( {\n\t\t\t\t\t\t\t\t\tdarkColorsPalette: newDarkPalette,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t
\n\t\t\t\t\n\t\t\t) }\n\t\t\n\t);\n};\nexport { ButtonColorPopover };\n","import { ColorIndicator } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useSetting } from '@wordpress/block-editor';\nimport { arrowRight, Icon } from '@wordpress/icons';\nimport { ButtonColorPopover } from './ButtonColorPopover';\n\nconst DarkColorPalette = ( { darkColors, handeSetAttribute } ) => {\n\t// Color state\n\tconst colorsTheme = useSetting( 'color.palette.theme' ) || [];\n\tconst colorsCustom = useSetting( 'color.palette.custom' ) || [];\n\tconst colors = colorsTheme.concat( colorsCustom );\n\n\t// if darkcolors is empty copy colors to darkcolors\n\tconst darkPalette = colors.map( ( item1 ) => {\n\t\tconst item2 = darkColors.find( ( item ) => item.slug === item1.slug );\n\t\treturn item2 ? { ...item1, ...item2 } : item1;\n\t} );\n\n\t//CSS styles\n\tconst paletteStyle = {\n\t\tdisplay: 'grid',\n\t\tgridTemplateColumns: '1fr 1fr',\n\t\tgap: 8,\n\t};\n\tconst paletteItemStyle = {\n\t\tborder: '1px solid #ddd',\n\t\tborderRadius: 8,\n\t\tpadding: 8,\n\t};\n\tconst paletteItemNameStyle = {\n\t\toverflow: 'hidden',\n\t\ttextOverflow: 'ellipsis',\n\t\twhiteSpace: 'nowrap',\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t

{ __( 'Dark Palette', 'mosne-dark-palette' ) }

\n\t\t\t\n\t\t\n\t);\n};\nexport { DarkColorPalette };\n","function IconAuto() {\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t);\n}\n\nexport default IconAuto;\n","/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useBlockProps, InspectorControls } from '@wordpress/block-editor';\nimport {\n\t__experimentalToggleGroupControl as ToggleGroupControl, // eslint-disable-line\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption, // eslint-disable-line\n\tPanelBody,\n\tTextControl,\n} from '@wordpress/components';\nimport { DarkColorPalette } from './components/DarkColorPalette';\nimport './editor.scss';\n\nexport default function Edit( { attributes, setAttributes } ) {\n\tconst {\n\t\tclassOptions,\n\t\tdefaultLabel,\n\t\tautoLabel,\n\t\tdarkLabel,\n\t\tlightLabel,\n\t\tdarkColorsPalette,\n\t} = attributes;\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classOptions,\n\t} );\n\tconst textGrigStyle = {\n\t\tdisplay: 'grid',\n\t\tgridTemplateColumns: '1fr 1fr',\n\t\tgap: 8,\n\t};\n\treturn (\n\t\t<>\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\tsetAttributes( { classOptions: value } )\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tsetAttributes( { defaultLabel: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tsetAttributes( { autoLabel: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tsetAttributes( { darkLabel: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tsetAttributes( { lightLabel: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t\t
  • \n\t\t\t\t\n\t\t\t
  • \n\t\t\n\t);\n}\n","import { registerBlockType } from '@wordpress/blocks';\nimport './style.scss';\nimport Edit from './edit';\nimport IconAuto from './components/iconAuto';\nimport metadata from './block.json';\n\nregisterBlockType( metadata.name, {\n\ticon: IconAuto,\n\tedit: Edit,\n} );\n","// extracted by mini-css-extract-plugin\nexport {};","// extracted by mini-css-extract-plugin\nexport {};","module.exports = window[\"React\"];","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\"];","// 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[\"webpackChunkmosne_dark_palette\"] = globalThis[\"webpackChunkmosne_dark_palette\"] || [];\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":["Button","ColorIndicator","ColorPalette","Popover","useState","ButtonColorPopover","currentColor","colors","currentSlug","handeSetAttribute","darkPalette","isVisible","setIsVisible","toggleVisible","state","createElement","Fragment","onClick","style","padding","colorValue","position","onFocusOutside","clearable","value","onChange","newDarkPalette","map","item","slug","color","darkColorsPalette","__","useSetting","arrowRight","Icon","DarkColorPalette","darkColors","colorsTheme","colorsCustom","concat","item1","item2","find","paletteStyle","display","gridTemplateColumns","gap","paletteItemStyle","border","borderRadius","paletteItemNameStyle","overflow","textOverflow","whiteSpace","length","colorItem","key","name","icon","paddingLeft","paddingRight","height","darkcolors","IconAuto","xmlns","width","viewBox","fill","d","useBlockProps","InspectorControls","__experimentalToggleGroupControl","ToggleGroupControl","__experimentalToggleGroupControlOption","ToggleGroupControlOption","PanelBody","TextControl","Edit","attributes","setAttributes","classOptions","defaultLabel","autoLabel","darkLabel","lightLabel","blockProps","className","textGrigStyle","title","__nextHasNoMarginBottom","isBlock","label","type","registerBlockType","metadata","edit"],"sourceRoot":""} \ No newline at end of file diff --git a/build/render.php b/build/render.php index b6de959..ff60873 100644 --- a/build/render.php +++ b/build/render.php @@ -52,10 +52,11 @@ $unique_id = wp_unique_id( 'p-' ); $class_options = $attributes['classOptions'] ?? ''; -$additional_classes = $class_options . ' wp-block-navigation-item open-on-hover-click wp-block-navigation-submenu'; +$additional_classes = $class_options . ' wp-block-navigation-item open-on-hover-click toto wp-block-navigation-submenu'; -sprintf( - '
  • $additional_classes ] ) ); ?>> + + +
  • + + diff --git a/build/style-index.css.map b/build/style-index.css.map new file mode 100644 index 0000000..c17b64c --- /dev/null +++ b/build/style-index.css.map @@ -0,0 +1 @@ +{"version":3,"file":"./style-index.css","mappings":";;;AAAA;;;;;EAAA;AASC;;EAEC;AAFF;AAKC;EACC;KAAA;UAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAHF;AAKE;EACC;AAHH;AAOC;EACC;EACA;EACA;AALF;AASE;EACC;AAPH;AAaG;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;UAAA;EACA;UAAA;EACA;UAAA;AAXJ;AAeI;EACC;UAAA;AAbL;AAkBI;EACC;UAAA;AAhBL;AA2BG;;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAxBJ;AA2BG;;EACC;AAxBJ,C","sources":["webpack://mosne-dark-palette/./src/style.scss"],"sourcesContent":["/**\n * The following styles get applied both on the front of your site\n * and in the editor.\n *\n * Replace them with your own styles or remove the file completely.\n */\n\n.wp-block-mosne-dark-palette {\n\n\t&,\n\tli {\n\t\tlist-style: none;\n\t}\n\n\tbutton {\n\t\tappearance: none;\n\t\tpadding: 0;\n\t\tborder: 0;\n\t\tfont: inherit;\n\t\tcolor: inherit;\n\t\tbackground: inherit;\n\t\tline-height: inherit;\n\t\tcursor: pointer;\n\t\twhite-space: nowrap;\n\n\t\t&:hover span {\n\t\t\ttext-decoration: underline;\n\t\t}\n\t}\n\n\tul li button {\n\t\tpadding: 0.5em 1em;\n\t\twidth: 100%;\n\t\ttext-align: left;\n\t}\n\n\t&.hide-icon {\n\t\tbutton::before {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\n\t&.has-icon {\n\t\tbutton {\n\t\t\t&::before {\n\t\t\t\tcontent: '';\n\t\t\t\twidth: .8lh;\n\t\t\t\theight: .8lh;\n\t\t\t\tmargin-top: .1lh;\n\t\t\t\taspect-ratio: 1;\n\t\t\t\tmargin-right: .25lh;\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tbackground: currentColor;\n\t\t\t\tvertical-align: top;\n\t\t\t\tmask: url(\"../assets/auto.svg\") no-repeat;\n\t\t\t\tmask-size: auto 100%;\n\t\t\t\tmask-position: center center;\n\t\t\t}\n\n\t\t\t&.has-icon--light {\n\t\t\t\t&::before {\n\t\t\t\t\tmask: url(\"../assets/light.svg\") no-repeat;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t&.has-icon--dark {\n\t\t\t\t&::before {\n\t\t\t\t\tmask: url(\"../assets/dark.svg\") no-repeat;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t&.hide-label {\n\t\t// sr-only\n\t\t> button,\n\t\t.has-child > button {\n\n\t\t\t> span {\n\t\t\t\twidth: 1px;\n\t\t\t\theight: 1px;\n\t\t\t\tpadding: 0;\n\t\t\t\tmargin: -1px;\n\t\t\t\toverflow: hidden;\n\t\t\t\tclip: rect(0, 0, 0, 0);\n\t\t\t\twhite-space: nowrap;\n\t\t\t\tborder-width: 0;\n\t\t\t\tdisplay: inline-block;\n\t\t\t}\n\n\t\t\t&::before {\n\t\t\t\tmargin-right: 0;\n\t\t\t}\n\t\t}\n\t}\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/build/view.js.map b/build/view.js.map new file mode 100644 index 0000000..e2b6712 --- /dev/null +++ b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C,MAAM,IAAKM,QAAQ,KAAK,MAAM,EAAG;QACjC1B,+DAAK,CAAE,oBAAqB,CAAC,CAACE,OAAO,CAACC,QAAQ,CAAC,CAAC;MACjD,CAAC,MAAM;QACNH,+DAAK,CAAE,oBAAqB,CAAC,CAACE,OAAO,CAACiB,SAAS,CAAC,CAAC;MAClD;IACD;EACD;AACD,CAAE,CAAC,C","sources":["webpack://mosne-dark-palette/external module \"@wordpress/interactivity\"","webpack://mosne-dark-palette/webpack/bootstrap","webpack://mosne-dark-palette/webpack/runtime/make namespace object","webpack://mosne-dark-palette/./src/view.js"],"sourcesContent":["var x = (y) => {\n\tvar x = {}; __webpack_require__.d(x, y); return x\n} \nvar y = (x) => (() => (x))\nmodule.exports = __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__;","// 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","// 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};","/**\n * WordPress dependencies\n */\nimport { store, getContext } from '@wordpress/interactivity';\n\nstore( 'mosne/dark-palette', {\n\tactions: {\n\t\tmakeAuto: () => {\n\t\t\tconst context = getContext();\n\t\t\tcontext.mode = 'auto';\n\t\t\tcontext.current =\n\t\t\t\t'has-icon--auto wp-block-navigation-submenu__toggle';\n\t\t\tif ( window.matchMedia( '(prefers-color-scheme: dark)' ).matches )\n\t\t\t\tdocument.body.setAttribute( 'data-theme', 'dark' );\n\t\t\telse document.body.removeAttribute( 'data-theme' );\n\t\t\ttry {\n\t\t\t\twindow.localStorage.setItem( 'mosne-dark-palette', 'auto' );\n\t\t\t} catch ( error ) {\n\t\t\t\tconsole.error( error.message ); // eslint-disable-line no-console\n\t\t\t}\n\t\t},\n\t\tmakeLight: () => {\n\t\t\tconst context = getContext();\n\t\t\tcontext.mode = 'light';\n\t\t\tcontext.current =\n\t\t\t\t'has-icon--light wp-block-navigation-submenu__toggle';\n\t\t\tdocument.body.removeAttribute( 'data-theme' );\n\t\t\ttry {\n\t\t\t\twindow.localStorage.setItem( 'mosne-dark-palette', 'false' );\n\t\t\t} catch ( error ) {\n\t\t\t\tconsole.error( error.message ); // eslint-disable-line no-console\n\t\t\t}\n\t\t},\n\t\tmakeDark: () => {\n\t\t\tconst context = getContext();\n\t\t\tcontext.mode = 'dark';\n\t\t\tcontext.current =\n\t\t\t\t'has-icon--dark wp-block-navigation-submenu__toggle';\n\t\t\tdocument.body.setAttribute( 'data-theme', 'dark' );\n\t\t\ttry {\n\t\t\t\twindow.localStorage.setItem( 'mosne-dark-palette', 'true' );\n\t\t\t} catch ( error ) {\n\t\t\t\tconsole.error( error.message ); // eslint-disable-line no-console\n\t\t\t}\n\t\t},\n\t\tshowSubmenu: () => {\n\t\t\tconst context = getContext();\n\t\t\tcontext.submenu = true;\n\t\t},\n\t\thideSubmenu: () => {\n\t\t\tconst context = getContext();\n\t\t\tcontext.submenu = false;\n\t\t},\n\t},\n\tcallbacks: {\n\t\tcolorInit: () => {\n\t\t\tlet darkMode = 'auto';\n\t\t\ttry {\n\t\t\t\tdarkMode =\n\t\t\t\t\twindow.localStorage.getItem( 'mosne-dark-palette' ) ||\n\t\t\t\t\t'auto';\n\t\t\t} catch ( error ) {\n\t\t\t\tconsole.error( error.message ); // eslint-disable-line no-console\n\t\t\t}\n\t\t\tif ( darkMode === 'true' ) {\n\t\t\t\tstore( 'mosne/dark-palette' ).actions.makeDark();\n\t\t\t} else if ( darkMode === 'auto' ) {\n\t\t\t\tstore( 'mosne/dark-palette' ).actions.makeAuto();\n\t\t\t} else {\n\t\t\t\tstore( 'mosne/dark-palette' ).actions.makeLight();\n\t\t\t}\n\t\t},\n\t},\n} );\n"],"names":["store","getContext","actions","makeAuto","context","mode","current","window","matchMedia","matches","document","body","setAttribute","removeAttribute","localStorage","setItem","error","console","message","makeLight","makeDark","showSubmenu","submenu","hideSubmenu","callbacks","colorInit","darkMode","getItem"],"sourceRoot":""} \ No newline at end of file diff --git a/mosne-dark-palette.php b/mosne-dark-palette.php index 9172342..7a8e224 100644 --- a/mosne-dark-palette.php +++ b/mosne-dark-palette.php @@ -4,7 +4,7 @@ * Description: Create and apply your dark palette in an accessibility-friendly manner using the new Interactivity API. * Requires at least: 6.5 * Requires PHP: 7.4 - * Version: 0.1.2 + * Version: 0.1.3 * Author: Mosne * License: GPL-2.0-or-later * License URI: https://www.gnu.org/licenses/gpl-2.0.html diff --git a/package.json b/package.json index 5aac71e..2f65751 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mosne-dark-palette", - "version": "0.1.2", + "version": "0.1.3", "description": "Create and apply your dark palette in an a11y friendly way using the new Interactivity API.", "author": "mosne", "license": "GPL-2s.0-or-later", diff --git a/readme.txt b/readme.txt index 4432dcf..f72e0af 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: block, palette, dark, color, accessibility Requires at least: 6.5 Requires PHP: 7.4 Tested up to: 6.5 -Stable tag: 0.1.2 +Stable tag: 0.1.3 License: GPL-2.0-or-later License URI: https://www.gnu.org/licenses/gpl-2.0.html @@ -77,6 +77,10 @@ You can change the icons using CSS in your theme or in the customizer. 3. Edit the dark palette == Changelog == += 0.1.2 - 2023-06-09 = + +* Fix escaping via wp_kses_data and changelogs + = 0.1.2 - 2023-06-01 = * Fix escaping and changelogs diff --git a/src/render.php b/src/render.php index b6de959..d0b1d0b 100644 --- a/src/render.php +++ b/src/render.php @@ -54,8 +54,9 @@ $class_options = $attributes['classOptions'] ?? ''; $additional_classes = $class_options . ' wp-block-navigation-item open-on-hover-click wp-block-navigation-submenu'; -sprintf( - '
  • $additional_classes ] ) ); ?>> + + +
  • + +