From 0316ddd9ae7d41dc42d03a912142c0ec47efee5d Mon Sep 17 00:00:00 2001 From: Michael Beckwith Date: Tue, 30 Dec 2025 13:57:47 -0600 Subject: [PATCH 01/14] commit our external library files --- src/vanilla-icon-picker/LICENSE | 21 ++ src/vanilla-icon-picker/README.md | 194 ++++++++++++++++++ .../dist/icon-picker.min.js | 3 + .../dist/icon-picker.min.map | 1 + .../dist/themes/bootstrap-5.min.css | 2 + .../dist/themes/default.min.css | 10 + 6 files changed, 231 insertions(+) create mode 100644 src/vanilla-icon-picker/LICENSE create mode 100644 src/vanilla-icon-picker/README.md create mode 100644 src/vanilla-icon-picker/dist/icon-picker.min.js create mode 100644 src/vanilla-icon-picker/dist/icon-picker.min.map create mode 100644 src/vanilla-icon-picker/dist/themes/bootstrap-5.min.css create mode 100644 src/vanilla-icon-picker/dist/themes/default.min.css diff --git a/src/vanilla-icon-picker/LICENSE b/src/vanilla-icon-picker/LICENSE new file mode 100644 index 00000000..046ae8b2 --- /dev/null +++ b/src/vanilla-icon-picker/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Appolo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/vanilla-icon-picker/README.md b/src/vanilla-icon-picker/README.md new file mode 100644 index 00000000..c3ddc554 --- /dev/null +++ b/src/vanilla-icon-picker/README.md @@ -0,0 +1,194 @@ +# Vanilla icon picker + +![GitHub package.json version](https://img.shields.io/github/package-json/v/appolodev/icon-picker?color=blue&style=flat-square) +![npm](https://img.shields.io/npm/dm/vanilla-icon-picker?color=%2325b5ba&style=flat-square) +![GitHub](https://img.shields.io/github/license/appolodev/icon-picker?style=flat-square) +[![pages-build-deployment](https://github.com/AppoloDev/vanilla-icon-picker/actions/workflows/pages/pages-build-deployment/badge.svg)](https://github.com/AppoloDev/vanilla-icon-picker/actions/workflows/pages/pages-build-deployment) + +### Icons includes: + +- FontAwesome 6&7 (Brands, Solid and Regular) +- Material Design Icons +- Iconoir + +## Installation + +➡️ Using a package manager + +```bash +npm i vanilla-icon-picker +``` +```js +// One of the following themes +import 'vanilla-icon-picker/dist/themes/default.min.css'; // 'default' theme +import 'vanilla-icon-picker/dist/themes/bootstrap-5.min.css'; // 'bootstrap-5' theme + +import IconPicker from 'vanilla-icon-picker'; +``` + +> ⚠️ Attention: If you use bootstrap theme don't forget to include bootstrap 5 css. + +➡️ Using script +```html + +``` + +and stylesheet +```html + + +``` + +## Usage + +```javascript +const iconPicker = new IconPicker('input', { + // Options +}); +``` + +[Live demo →](https://appolodev.github.io/vanilla-icon-picker/) + +## Options + +> 💙 You can find icons sets at [Iconify](https://github.com/iconify/icon-sets/tree/master/json) + + +```javascript +{ + // Change icon picker's theme + theme: 'default' | 'bootstrap-5', + + // Set icon(s) library(ies) + // iconSource: [ + // 'FontAwesome Brands 7', + // 'FontAwesome Solid 7', + // 'FontAwesome Regular 7', + // 'Material Design Icons', + // 'Iconoir', + // { + // key: 'academicons', + // prefix: 'ai ai-', + // url: 'https://raw.githubusercontent.com/iconify/icon-sets/master/json/academicons.json' + // } + // ] + iconSource: [], + + // Close icon picker modal when icon is selected + // If is `false` save button appear + closeOnSelect: true, + + // Set a default value, preselect for example + // icon's value and icon's name work + defaultValue: null, + + // Translatable text + i18n: { + 'input:placeholder': 'Search icon…', + + 'text:title': 'Select icon', + 'text:empty': 'No results found…', + + 'btn:save': 'Save' + } +} +``` + +## Events + +Use the `on(event, callback)` and `off(event, callback)` functions to bind / unbind eventlistener. + +| Event | Description | Arguments | +|----------|-------------------------------------------------------------------------------------------------------------------------------|----------------------| +| `select` | Icon is selected, return icon value, name, svg and unicode if exist | `Object` | +| `save` | Fired when saved with button or if `closeOnSelect` option is `true`, return return icon value, name, svg and unicode if exist | `Object` | +| `loaded` | All icons are loaded | `void` | +| `clear` | `clear()` method is called | `void` | +| `show` | Modal is shown | `IconPickerInstance` | +| `hide` | Modal picker is hidden | `IconPickerInstance` | + +```javascript +iconPicker.on('select', instance => { + console.log('Select:', instance); +}); +``` + +## Methods + +After we initialize IconPicker, we have access instance. Let's look list all available methods: + +| Method | Description | +|---------------------------|------------------------------------------------------------------------------| +| `on()` | Add event handler | +| `off()` | Remove event handler | +| `open()` | Open IconPicker's modal | +| `hide()` | Remove IconPicker's modal | +| `clear()` | Clear current icon | +| `isOpen()` | Check if open or not | +| `iconsLoaded()` | Check if the icons are loaded | +| `destroy(deleteInstance)` | Set it to false (by default it is true) to not to delete IconPicker instance | + +## Icon format setting in JSON files + +While this picker uses icon sets found at [Iconify](https://github.com/iconify/icon-sets/tree/master/json), it supports +an extension to their format to allow improved performance with large icon sets. + +By default, those icon sets include the actual SVG directly, and the picker includes the SVG markup inline. In cases +where the actual SVGs are not needed (e.g. if you're using Font Awesome and the required CSS / JavaScript is +included on the page), adding a new, optional `iconFormat` setting to the JSON file will allow you to remove the SVGs +and reduce file sizes by over 90%, making the loading of the picker much faster. + +`iconFormat` is optional and can be set to three different values: + +- `svg` (the default) - `body` must include the full SVG. + +- `i` - `body` is not needed at all. The picker will use markup like ``. + +Example JSON (snipped, `iconFormat` can be set to "i", `body` can be empty or missing entirely) +```json +{ + "prefix": "far fa-", + "iconFormat": "i", + "info": { + "name": "Font Awesome Regular" + }, + "lastModified": 1689174287, + "icons": { + "abacus": { + "body": "", + "width": 576 + }, + "acorn": { + "width": 448 + } + } +} +``` + +- `markup` - The picker uses the actual markup set in the `body`. This allows the use of different, custom markup for +icons, e.g. ``. + +Example JSON (snipped, `iconFormat` must be set to "markup", `body` must be set) +```json +{ + "prefix": "far fa-", + "iconFormat": "markup", + "info": { + "name": "Font Awesome Regular" + }, + "lastModified": 1689174287, + "icons": { + "abacus": { + "body": "", + "width": 576 + } + } +} +``` + +To take advantage of this, you could download the JSON file and use search-and-replace to remove the body values from +the file. Then, you would need to set `iconSource` per the Options section above to use your new JSON file. + +## Licence + +MIT Licence diff --git a/src/vanilla-icon-picker/dist/icon-picker.min.js b/src/vanilla-icon-picker/dist/icon-picker.min.js new file mode 100644 index 00000000..f4142f4f --- /dev/null +++ b/src/vanilla-icon-picker/dist/icon-picker.min.js @@ -0,0 +1,3 @@ +/*! Icon Picker 1.4.2 MIT | https://github.com/AppoloDev/icon-picker */ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.IconPicker=t():e.IconPicker=t()}(self,(()=>(()=>{"use strict";var e={d:(t,i)=>{for(var n in i)e.o(i,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:i[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},t={};function i(e,t,i,n){Array.isArray(t)||(t=[t]),Array.isArray(i)||(i=[i]);for(const s of t)for(const t of i)s[e](t,n);return[].slice.call(arguments,1)}e.d(t,{default:()=>m});const n=i.bind(null,"addEventListener"),s=i.bind(null,"removeEventListener");function o(e){if(window.DOMParser){return(new DOMParser).parseFromString(e,"text/html").body.firstElementChild}const t=document.createElement("div");return t.innerHTML=e,t.firstElementChild}function r(e){return e&&"object"==typeof e&&!Array.isArray(e)}function a(e,t){let i=Object.assign({},e);return r(e)&&r(t)&&Object.keys(t).forEach((n=>{r(t[n])?n in e?i[n]=a(e[n],t[n]):Object.assign(i,{[n]:t[n]}):Object.assign(i,{[n]:t[n]})})),i}function l(e,t){return Object.keys(e).find((i=>e[i]===t))}const c=e=>{const{theme:t,i18n:i,closeOnSelect:n}=e,s=function(e){const t=(e,t)=>{const i=e.getAttribute(t);return e.removeAttribute(t),i},i=(e,n={})=>{const s=t(e,"data-element");s&&(n[s]=e);for(const s of Array.from(e.children)){const e=t(s,"data-interaction");e&&e&&(n[e]=s),i(s,n)}return n};return i(o(e))}(`\n \n `);return t.includes("bootstrap")&&(s.save?.classList.add("btn","btn-primary"),s.search.classList.add("form-control")),s};const d="https://raw.githubusercontent.com/iconify/icon-sets/master/json",u={"Material Design Icons":{key:"mdi",prefix:"mdi mdi-",url:`${d}/mdi.json`},"FontAwesome Brands 6":{key:"fa6-brands",prefix:"fab fa-",url:`${d}/fa6-brands.json`},"FontAwesome Solid 6":{key:"fa6-solid",prefix:"fas fa-",url:`${d}/fa6-solid.json`},"FontAwesome Regular 6":{key:"fa6-regular",prefix:"far fa-",url:`${d}/fa6-regular.json`},"FontAwesome Brands 7":{key:"fa7-brands",prefix:"fab fa-",url:`${d}/fa7-brands.json`},"FontAwesome Solid 7":{key:"fa7-solid",prefix:"fas fa-",url:`${d}/fa7-solid.json`},"FontAwesome Regular 7":{key:"fa7-regular",prefix:"far fa-",url:`${d}/fa7-regular.json`},Iconoir:{key:"iconoir",prefix:"iconoir-",url:`${d}/iconoir.json`}};function h(e){let t=Object.create({});return Array.isArray(e)&&e.forEach((e=>{!function(e){return u.hasOwnProperty(e)}(e)?e.key&&(t[e.key]=e):t[u[e].key]=u[e]})),t}class m{static DEFAULT_OPTIONS={theme:"default",closeOnSelect:!0,defaultValue:null,iconSource:[],i18n:{"input:placeholder":"Search icon…","text:title":"Select icon","text:empty":"No results found…","text:loading":"Loading…","btn:save":"Save"}};_eventListener={select:[],save:[],show:[],clear:[],hide:[],loaded:[]};constructor(e,t={}){this.options=a(m.DEFAULT_OPTIONS,t),this.element=e,this.iconsLoading=!0,this._preBuild(),this.element&&this.options.iconSource.length>0?(this._binEvents(),this._renderdIcons(),this._createModal()):this._catchError("iconSourceMissing")}_preBuild(){var e;this.element=(e=this.element)instanceof HTMLElement?e:"string"==typeof e?document.querySelector(e):null,this.root=c(this.options),!Array.isArray(this.options.iconSource)&&this.options.iconSource.length>0&&(this.options.iconSource=[this.options.iconSource])}_binEvents(){const{options:e,root:t,element:i}=this;let s=[];var r,a,l;this._eventBindings=[n(i,"click",(()=>this.show())),n(t.close,"click",(()=>this.hide())),n(t.modal,"click",(e=>{e.target===t.modal&&this.hide()})),n(t.search,"keyup",(r=i=>{const n=this.availableIcons.filter((e=>e.value.includes(i.target.value.toLowerCase())||e.categories?.filter((e=>e.includes(i.target.value.toLowerCase()))).length>0));s.length||(s=document.querySelectorAll(".icon-element")),s.forEach((e=>{e.hidden=!0,n.forEach((t=>{e.classList.contains(t.value)&&(e.hidden=!1)}))}));const r=t.content.querySelector(".is-empty");n.length>0?r&&r.remove():r||t.content.appendChild(o(`
${e.i18n["text:empty"]}
`))},a=250,function(){var e=arguments,t=this;clearTimeout(l),l=setTimeout((function(){r.apply(t,e)}),a)}))],e.closeOnSelect||this._eventBindings.push(n(t.save,"click",(()=>this._onSave())))}hide(){return!!this.isOpen()&&(this.root.modal.classList.remove("is-visible"),this._emit("hide"),this)}show(){return!this.isOpen()&&(this.root.modal.classList.add("is-visible"),this._emit("show"),this)}clear(){this.initialized&&this.currentlySelectName&&(this.currentlySelectName=null,this._emit("clear"))}isOpen(){return this.root.modal.classList.contains("is-visible")}iconsLoaded(){return!this.loadingState}destroy(e=!0){this.initialized=!1,this._eventBindings.forEach((e=>s(...e))),e&&Object.keys(this).forEach((e=>delete this[e]))}_emit(e,...t){this._eventListener[e].forEach((e=>e(...t,this)))}on(e,t){return void 0!==this._eventListener[e]&&(this._eventListener[e].push(t),this)}off(e,t){const i=this._eventListener[e]||[],n=i.indexOf(t);return~n&&i.splice(n,1),this}_createModal(){document.body.appendChild(this.root.modal),this.initialized=!0}_onSave(){this._setValueInput(),this.hide(),this._emit("save",this.emitValues)}async _renderdIcons(){const{root:e,options:t}=this;let i=null,n=null,s=null;if(this.availableIcons=[],e.content.innerHTML=`
${t.i18n["text:loading"]}
`,(await this._getIcons()).forEach((o=>{let r=o.iconFormat?o.iconFormat:"svg";for(const[a,c]of Object.entries(o.icons)){const d=document.createElement("button");if(d.title=a,d.className=`icon-element ${a}`,d.dataset.value=o.prefix+a,o.categories&&Object.entries(o.categories).length>0){s=[];for(const[e]of Object.entries(o.categories))o.categories[e].includes(a)&&(s.length>0?s.push(e.toLowerCase()):s=[e.toLowerCase()])}let u;if(o.chars&&(d.dataset.unicode=l(o.chars,a)),"i"!==r&&c.body)if("markup"===r){let e=document.createElement("template");e.innerHTML=c.body,u=e.content}else u=document.createElementNS("http://www.w3.org/2000/svg","svg"),u.setAttribute("height","24"),u.setAttribute("width","24"),u.setAttribute("viewBox",`0 0 ${c.width?c.width:o.width} ${c.height?c.height:o.height}`),u.innerHTML=c.body;else u=document.createElement("i"),u.setAttribute("class",d.dataset.value);d.append(u),e.content.appendChild(d),this.availableIcons.push({value:a,body:u.outerHTML,...s?.length>0&&{categories:s}}),d.addEventListener("click",(e=>{this.currentlySelectName!==e.currentTarget.firstChild.className&&(e.currentTarget.classList.add("is-selected"),n=e.currentTarget,this.currentlySelectName=n.dataset.value,this.SVGString=u.outerHTML,this.emitValues={name:a,value:this.currentlySelectName,svg:this.SVGString},o.chars&&(this.emitValues.unicode=u.dataset.unicode),this._emit("select",this.emitValues)),i&&i.classList.remove("is-selected"),t.closeOnSelect&&this._onSave(),i=n}))}})),t.defaultValue||this.element.value){let e=document.querySelector(`[data-value="${t.defaultValue?t.defaultValue:this.element.value}"]`)?document.querySelector(`[data-value="${t.defaultValue?t.defaultValue:this.element.value}"]`):document.querySelector(`.${t.defaultValue?t.defaultValue:this.element.value}`),n=e?.dataset.value??"";e?.classList.add("is-selected"),i=e,this.currentlySelectName=n,this.element.value||this._setValueInput()}const o=e.content.querySelector(".is-loading");o&&o.remove(),this.iconsLoading=!1,this._emit("loaded")}async _getIcons(){const{options:e}=this,t=[];let i=h(e.iconSource);for(const e of Object.values(i))t.push(e.url);return await Promise.all(t.map((e=>fetch(e).then((e=>e.json()))))).then((e=>(e.forEach((e=>{i.hasOwnProperty(e.prefix)&&(e.prefix=i[e.prefix].prefix)})),e)))}_catchError(e){if("iconSourceMissing"===e)throw Error("No icon source was found.")}_setValueInput(e=this.currentlySelectName){const{element:t}=this;t instanceof HTMLInputElement&&this.currentlySelectName&&(t.value=e)}}return t=t.default})())); +//# sourceMappingURL=icon-picker.min.map \ No newline at end of file diff --git a/src/vanilla-icon-picker/dist/icon-picker.min.map b/src/vanilla-icon-picker/dist/icon-picker.min.map new file mode 100644 index 00000000..00448cf4 --- /dev/null +++ b/src/vanilla-icon-picker/dist/icon-picker.min.map @@ -0,0 +1 @@ +{"version":3,"file":"icon-picker.min.js","mappings":";CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAoB,WAAID,IAExBD,EAAiB,WAAIC,IARvB,CASGK,MAAM,I,mBCRT,IAAIC,EAAsB,CCA1BA,EAAwB,CAACL,EAASM,KACjC,IAAI,IAAIC,KAAOD,EACXD,EAAoBG,EAAEF,EAAYC,KAASF,EAAoBG,EAAER,EAASO,IAC5EE,OAAOC,eAAeV,EAASO,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3EF,EAAwB,CAACQ,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,I,KCAlF,SAASI,EAAcC,EAAQC,EAAUC,EAAQC,GACxCC,MAAMC,QAAQJ,KACfA,EAAW,CAACA,IAGXG,MAAMC,QAAQH,KACf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6C,KAAK8C,qBACxB,MAAM,QAAChF,GAAWkC,KAEdlC,aAAmB4I,kBAAoB1G,KAAK8C,sBAC5ChF,EAAQX,MAAQA,I","sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap","webpack:///webpack/runtime/define property getters","webpack:///webpack/runtime/hasOwnProperty shorthand","webpack:///./src/js/utlis/utils.js","webpack:///./src/js/template.js","webpack:///./src/js/utlis/collections.js","webpack:///./src/js/IconPicker.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"IconPicker\"] = factory();\n\telse\n\t\troot[\"IconPicker\"] = factory();\n})(self, () => {\nreturn ","// The require scope\nvar __webpack_require__ = {};\n\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))","function eventListener(method, elements, events, fn) {\n if (!Array.isArray(elements)) {\n elements = [elements];\n }\n\n if (!Array.isArray(events)) {\n events = [events];\n }\n\n for (const el of elements) {\n for (const ev of events) {\n el[method](ev, fn);\n }\n }\n\n return [].slice.call(arguments, 1);\n}\n\n/**\n * Add event to element.\n * @param elements DOM-Elements\n * @param events Event names\n * @param fn Callback\n * @param options Optional options\n * @return Array passed arguments\n */\nexport const addEvent = eventListener.bind(null, 'addEventListener');\n\n/**\n * Remove event from element.\n * @param elements DOM-Elements\n * @param events Event names\n * @param fn Callback\n * @param options Optional options\n * @return Array passed arguments\n */\nexport const removeEvent = eventListener.bind(null, 'removeEventListener');\n\n/**\n * Resolves a HTMLElement by query.\n * @param val\n * @returns {null|Document|Element}\n */\nexport function resolveElement(val) {\n if (val instanceof HTMLElement) {\n return val;\n } else if (typeof val === 'string') {\n return document.querySelector(val)\n }\n\n return null;\n}\n\n/**\n * Convert a template string into HTML DOM nodes\n * @param {String} str The template string\n * @return {Node} The template HTML\n */\nexport function stringToHTML(str) {\n if (window.DOMParser) {\n const parser = new DOMParser();\n const doc = parser.parseFromString(str, 'text/html');\n return doc.body.firstElementChild;\n }\n\n const dom = document.createElement('div');\n dom.innerHTML = str;\n return dom.firstElementChild;\n}\n\n/**\n * Check if item is an object\n * @param {Object} item\n * @returns {boolean}\n */\nexport function isObject(item) {\n return (item && typeof item === 'object' && !Array.isArray(item));\n}\n\n/**\n *\n * @param target\n * @param source\n * @returns {Object}\n */\nexport function mergeDeep(target, source) {\n let output = Object.assign({}, target);\n\n if (isObject(target) && isObject(source)) {\n Object.keys(source).forEach(key => {\n if (isObject(source[key])) {\n if (!(key in target))\n Object.assign(output, {[key]: source[key]});\n else\n output[key] = mergeDeep(target[key], source[key]);\n } else {\n Object.assign(output, {[key]: source[key]});\n }\n });\n }\n return output;\n}\n\n/**\n *\n * @param callback\n * @param delay\n * @returns {(function(): void)|*}\n */\nexport function debounce(callback, delay){\n var timer;\n return function(){\n var args = arguments;\n var context = this;\n clearTimeout(timer);\n timer = setTimeout(function(){\n callback.apply(context, args);\n }, delay)\n }\n}\n\n/**\n *\n * @param object\n * @param value\n * @returns {string}\n */\nexport function getKeyByValue(object, value) {\n return Object.keys(object).find(key => object[key] === value);\n}\n","import {stringToHTML} from \"./utlis/utils\";\n\nexport default options => {\n const {theme, i18n, closeOnSelect} = options;\n\n const modalElement = getHTMLElements(`\n
\n
\n
\n ${typeof i18n['text:title'] === 'string' && i18n['text:title'] !== '' ? `

${i18n['text:title']}

` : ''}\n \n \n
\n \n \n \n
\n \n ${!closeOnSelect ? `\n
\n \n
` : ''\n }\n
\n
\n `);\n\n if (theme.includes('bootstrap')) {\n modalElement.save?.classList.add('btn', 'btn-primary');\n modalElement.search.classList.add('form-control');\n }\n\n return modalElement;\n}\n\n\nfunction getHTMLElements(str) {\n const removeAttribute = (el, name) => {\n const value = el.getAttribute(name);\n el.removeAttribute(name);\n return value;\n };\n\n const resolve = (element, base = {}) => {\n const elementKey = removeAttribute(element, 'data-element');\n elementKey && (base[elementKey] = element);\n\n for (const child of Array.from(element.children)) {\n const childInteractionKey = removeAttribute(child, 'data-interaction');\n\n if (childInteractionKey) {\n childInteractionKey && (base[childInteractionKey] = child);\n }\n\n resolve(child, base);\n }\n\n return base;\n };\n\n return resolve(stringToHTML(str));\n}\n","const iconifyPath = 'https://raw.githubusercontent.com/iconify/icon-sets/master/json';\n\nexport const collections = {\n 'Material Design Icons': {\n key: 'mdi',\n prefix: 'mdi mdi-',\n url: `${iconifyPath}/mdi.json`\n },\n 'FontAwesome Brands 6': {\n key: 'fa6-brands',\n prefix: 'fab fa-',\n url: `${iconifyPath}/fa6-brands.json`\n },\n 'FontAwesome Solid 6': {\n key: 'fa6-solid',\n prefix: 'fas fa-',\n url: `${iconifyPath}/fa6-solid.json`\n\n },\n 'FontAwesome Regular 6': {\n key: 'fa6-regular',\n prefix: 'far fa-',\n url: `${iconifyPath}/fa6-regular.json`\n },\n 'FontAwesome Brands 7': {\n key: 'fa7-brands',\n prefix: 'fab fa-',\n url: `${iconifyPath}/fa7-brands.json`\n },\n 'FontAwesome Solid 7': {\n key: 'fa7-solid',\n prefix: 'fas fa-',\n url: `${iconifyPath}/fa7-solid.json`\n\n },\n 'FontAwesome Regular 7': {\n key: 'fa7-regular',\n prefix: 'far fa-',\n url: `${iconifyPath}/fa7-regular.json`\n },\n 'Iconoir': {\n key: 'iconoir',\n prefix: 'iconoir-',\n url: `${iconifyPath}/iconoir.json`\n }\n}\n\n/**\n *\n * @param {array} collectionsOptions\n */\nexport function resolveCollection(collectionsOptions) {\n let collectionResolved = Object.create({});\n\n if (Array.isArray(collectionsOptions)) {\n collectionsOptions.forEach((collection) => {\n if (hasCollection(collection)) {\n collectionResolved[collections[collection].key] = collections[collection]\n } else if (collection.key) {\n collectionResolved[collection.key] = collection\n }\n })\n }\n\n return collectionResolved;\n}\n\n/**\n *\n * @param {string} collection\n * @returns {boolean}\n */\nfunction hasCollection(collection) {\n return collections.hasOwnProperty(collection)\n}\n","import * as _ from \"./utlis/utils\";\nimport template from \"./template\";\nimport { resolveCollection } from \"./utlis/collections\";\n\nexport default class IconPicker {\n static DEFAULT_OPTIONS = {\n theme: 'default',\n closeOnSelect: true,\n defaultValue: null,\n iconSource: [],\n i18n: {\n 'input:placeholder': 'Search icon…',\n\n 'text:title': 'Select icon',\n 'text:empty': 'No results found…',\n 'text:loading' : 'Loading…',\n\n 'btn:save': 'Save'\n }\n }\n\n _eventListener = {\n select: [],\n save: [],\n show: [],\n clear: [],\n hide: [],\n loaded: []\n };\n\n /**\n *\n * @param {string | HTMLElement} el\n * @param {Object} options\n */\n constructor(el, options = {}) {\n this.options = _.mergeDeep(IconPicker.DEFAULT_OPTIONS, options);\n this.element = el;\n this.iconsLoading = true;\n\n // Initialize icon picker\n this._preBuild();\n\n if (this.element && this.options.iconSource.length > 0) {\n this._binEvents();\n this._renderdIcons();\n this._createModal();\n } else {\n this._catchError('iconSourceMissing');\n }\n }\n\n _preBuild() {\n this.element = _.resolveElement(this.element);\n this.root = template(this.options);\n\n if (!Array.isArray(this.options.iconSource) && this.options.iconSource.length > 0) {\n this.options.iconSource = [this.options.iconSource];\n }\n }\n\n _binEvents() {\n const {options, root, element} = this;\n let iconsElements = [];\n\n this._eventBindings = [\n _.addEvent(element, 'click', () => this.show()),\n _.addEvent(root.close, 'click', () => this.hide()),\n _.addEvent(root.modal, 'click', (evt) => {\n if (evt.target === root.modal) {\n this.hide();\n }\n }),\n _.addEvent(root.search, 'keyup', _.debounce((evt) => {\n const iconsResult = this.availableIcons.filter((obj) => {\n return obj.value.includes(evt.target.value.toLowerCase()) || obj.categories?.filter(c => c.includes(evt.target.value.toLowerCase())).length > 0\n });\n\n if (!iconsElements.length) {\n iconsElements = document.querySelectorAll('.icon-element');\n }\n\n iconsElements.forEach((iconElement) => {\n iconElement.hidden = true;\n\n iconsResult.forEach((result) => {\n if (iconElement.classList.contains(result.value)) {\n iconElement.hidden = false;\n }\n });\n });\n\n const emptyElement = root.content.querySelector('.is-empty');\n\n if (iconsResult.length > 0) {\n if (emptyElement) {\n emptyElement.remove();\n }\n } else {\n if (!emptyElement) {\n root.content.appendChild(_.stringToHTML(`
${options.i18n['text:empty']}
`));\n }\n }\n }, 250))\n ];\n\n if (!options.closeOnSelect) {\n this._eventBindings.push(_.addEvent(root.save, 'click', () => this._onSave()));\n }\n }\n\n /**\n * Hide icon picker modal\n */\n hide() {\n if (this.isOpen()) {\n this.root.modal.classList.remove('is-visible');\n this._emit('hide');\n\n return this;\n }\n\n return false\n }\n\n /**\n * Show icon picker modal\n */\n show() {\n if (!this.isOpen()) {\n this.root.modal.classList.add('is-visible');\n this._emit('show');\n\n return this;\n }\n\n return false\n }\n\n clear() {\n if (this.initialized && this.currentlySelectName) {\n this.currentlySelectName = null;\n\n this._emit('clear');\n }\n }\n\n /**\n * Check if modal is open\n * @returns {boolean}\n */\n isOpen() {\n return this.root.modal.classList.contains('is-visible');\n }\n\n /**\n * Check if the icons are loaded\n * @returns {boolean}\n */\n iconsLoaded(){\n return !this.loadingState;\n }\n\n /**\n * Destroy icon picker instance and detach all events listeners\n * @param {boolean} deleteInstance\n */\n destroy(deleteInstance = true) {\n this.initialized = false;\n\n // Remove elements events\n this._eventBindings.forEach(args => _.removeEvent(...args));\n\n // Delete instance\n if (deleteInstance) {\n Object.keys(this).forEach((key) => delete this[key]);\n }\n }\n\n _emit(event, ...args) {\n this._eventListener[event].forEach(cb => cb(...args, this));\n }\n\n on(event, callback) {\n if (this._eventListener[event] !== undefined) {\n this._eventListener[event].push(callback);\n return this;\n }\n\n return false\n }\n\n off(event, callback) {\n const callBacks = (this._eventListener[event] || []);\n const index = callBacks.indexOf(callback);\n\n if (~index) {\n callBacks.splice(index, 1);\n }\n\n return this;\n }\n\n _createModal() {\n document.body.appendChild(this.root.modal);\n\n this.initialized = true;\n }\n\n _onSave() {\n this._setValueInput()\n\n this.hide();\n this._emit('save', this.emitValues);\n }\n\n /**\n * Generate icons elements\n * @private\n */\n async _renderdIcons() {\n const {root, options} = this;\n let previousSelectedIcon = null;\n let currentlySelectElement = null;\n let categories = null;\n this.availableIcons = [];\n\n root.content.innerHTML = `
${options.i18n['text:loading']}
`;\n\n let icons = await this._getIcons();\n\n icons.forEach((library) => {\n let iconFormat = library.iconFormat ? library.iconFormat : 'svg';\n\n for (const [key, value] of Object.entries(library.icons)) {\n const iconTarget = document.createElement('button');\n iconTarget.title = key\n iconTarget.className = `icon-element ${key}`;\n iconTarget.dataset.value = library.prefix + key;\n\n if (library.categories && Object.entries(library.categories).length > 0) {\n categories = [];\n\n for (const [categoryKey] of Object.entries(library.categories)) {\n if (library.categories[categoryKey].includes(key)) {\n if (categories.length > 0) {\n categories.push(categoryKey.toLowerCase())\n } else {\n categories = [categoryKey.toLowerCase()]\n }\n }\n }\n }\n\n if (library.chars) {\n iconTarget.dataset.unicode = _.getKeyByValue(library.chars, key);\n }\n\n let iconElement;\n if (iconFormat === 'i' || !value.body) {\n iconElement = document.createElement('i');\n iconElement.setAttribute('class', iconTarget.dataset.value);\n } else if (iconFormat === 'markup') {\n let t = document.createElement('template');\n t.innerHTML = value.body;\n iconElement = t.content;\n } else {\n iconElement = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n iconElement.setAttribute('height', '24');\n iconElement.setAttribute('width', '24');\n iconElement.setAttribute('viewBox', `0 0 ${value.width ? value.width : library.width} ${value.height ? value.height : library.height}`);\n iconElement.innerHTML = value.body;\n }\n\n iconTarget.append(iconElement)\n\n root.content.appendChild(iconTarget);\n\n this.availableIcons.push({value: key, body: iconElement.outerHTML, ...(categories?.length > 0 && {categories})});\n\n // Icon click event\n iconTarget.addEventListener('click', (evt) => {\n if (this.currentlySelectName !== evt.currentTarget.firstChild.className) {\n evt.currentTarget.classList.add('is-selected');\n\n currentlySelectElement = evt.currentTarget;\n this.currentlySelectName = currentlySelectElement.dataset.value;\n this.SVGString = iconElement.outerHTML;\n\n this.emitValues = {\n name: key,\n value: this.currentlySelectName,\n svg: this.SVGString,\n }\n\n if (library.chars) {\n this.emitValues.unicode = iconElement.dataset.unicode\n }\n\n this._emit('select', this.emitValues);\n }\n\n if (previousSelectedIcon) {\n previousSelectedIcon.classList.remove('is-selected');\n }\n\n if (options.closeOnSelect) {\n this._onSave();\n }\n\n previousSelectedIcon = currentlySelectElement;\n });\n }\n });\n\n if (options.defaultValue || this.element.value) {\n // Check if icon name ou icon value is set\n let defaultValueElement = document.querySelector(`[data-value=\"${options.defaultValue ? options.defaultValue : this.element.value}\"]`) ?\n document.querySelector(`[data-value=\"${options.defaultValue ? options.defaultValue : this.element.value}\"]`) :\n document.querySelector(`.${options.defaultValue ? options.defaultValue : this.element.value}`);\n\n let iconValue = defaultValueElement?.dataset.value ?? '';\n defaultValueElement?.classList.add('is-selected');\n\n previousSelectedIcon = defaultValueElement;\n this.currentlySelectName = iconValue;\n\n if (!this.element.value) {\n this._setValueInput();\n }\n }\n\n const loadingElement = root.content.querySelector('.is-loading');\n if (loadingElement) {\n loadingElement.remove();\n }\n\n this.iconsLoading = false;\n this._emit('loaded');\n }\n\n /**\n *\n * @returns {string}\n * @private\n */\n async _getIcons() {\n const {options} = this\n const iconsURL = [];\n\n let sourceInformation = resolveCollection(options.iconSource);\n\n for (const source of Object.values(sourceInformation)) {\n iconsURL.push(source.url)\n }\n\n return await Promise.all(iconsURL.map((iconURL) => fetch(iconURL).then((response) => response.json())))\n .then((iconLibrary) => {\n iconLibrary.forEach((library) => {\n if (sourceInformation.hasOwnProperty(library.prefix)) {\n library.prefix = sourceInformation[library.prefix].prefix\n }\n });\n\n return iconLibrary;\n });\n }\n\n /**\n *\n * @param {string} exception\n * @private\n */\n _catchError(exception) {\n switch (exception) {\n case 'iconSourceMissing':\n throw Error('No icon source was found.');\n }\n }\n\n /**\n * Set value into input element\n * @param value\n * @private\n */\n _setValueInput(value = this.currentlySelectName) {\n const {element} = this;\n\n if (element instanceof HTMLInputElement && this.currentlySelectName) {\n element.value = value;\n }\n }\n}\n"],"names":["root","factory","exports","module","define","amd","self","__webpack_require__","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","eventListener","method","elements","events","fn","Array","isArray","el","ev","slice","arguments","addEvent","bind","removeEvent","stringToHTML","str","window","DOMParser","parseFromString","body","firstElementChild","dom","document","createElement","innerHTML","isObject","item","mergeDeep","target","source","output","assign","keys","forEach","getKeyByValue","object","value","find","options","theme","i18n","closeOnSelect","modalElement","removeAttribute","name","getAttribute","resolve","element","base","elementKey","child","from","children","childInteractionKey","getHTMLElements","includes","save","classList","add","search","iconifyPath","collections","prefix","url","resolveCollection","collectionsOptions","collectionResolved","create","collection","hasCollection","IconPicker","static","defaultValue","iconSource","_eventListener","select","show","clear","hide","loaded","constructor","this","DEFAULT_OPTIONS","iconsLoading","_preBuild","length","_binEvents","_renderdIcons","_createModal","_catchError","val","HTMLElement","querySelector","template","iconsElements","callback","delay","timer","_eventBindings","close","modal","evt","iconsResult","availableIcons","filter","toLowerCase","categories","c","querySelectorAll","iconElement","hidden","result","contains","emptyElement","content","remove","appendChild","args","context","clearTimeout","setTimeout","apply","push","_onSave","isOpen","_emit","initialized","currentlySelectName","iconsLoaded","loadingState","destroy","deleteInstance","event","cb","on","undefined","off","callBacks","index","indexOf","splice","_setValueInput","emitValues","async","previousSelectedIcon","currentlySelectElement","_getIcons","library","iconFormat","entries","icons","iconTarget","title","className","dataset","categoryKey","chars","unicode","t","createElementNS","setAttribute","width","height","append","outerHTML","addEventListener","currentTarget","firstChild","SVGString","svg","defaultValueElement","iconValue","loadingElement","iconsURL","sourceInformation","values","Promise","all","map","iconURL","fetch","then","response","json","iconLibrary","exception","Error","HTMLInputElement"],"sourceRoot":""} \ No newline at end of file diff --git a/src/vanilla-icon-picker/dist/themes/bootstrap-5.min.css b/src/vanilla-icon-picker/dist/themes/bootstrap-5.min.css new file mode 100644 index 00000000..ed0361fe --- /dev/null +++ b/src/vanilla-icon-picker/dist/themes/bootstrap-5.min.css @@ -0,0 +1,2 @@ +/*! Icon Picker 1.4.2 MIT | https://github.com/AppoloDev/icon-picker */ +.icon-picker-modal{position:fixed;left:0;top:0;bottom:0;right:0;z-index:100000;background-color:rgba(68,69,69,0);visibility:hidden;transition:background-color .3s ease-out,visibility .3s ease-out}.icon-picker-modal.is-visible{background-color:rgba(68,69,69,.6);visibility:visible}.icon-picker-modal.is-visible .icon-picker-modal__dialog{transform:translate(-50%, -50%);opacity:1}.icon-picker-modal__dialog{display:flex;flex-direction:column;position:absolute;left:50%;top:50%;z-index:1;height:440px;min-width:380px;opacity:0;transform:translate(-50%, -55%);transition:transform .3s ease-in-out,opacity .3s ease;padding:24px;background-color:#fff;border-radius:16px}.icon-picker-modal__header{display:flex;justify-content:space-between;align-items:center}.icon-picker-modal__header h2{margin-block-start:0;margin-block-end:0;font-size:24px}.icon-picker-modal__header .icon-picker-modal--close{cursor:pointer;margin-left:auto;-webkit-appearance:none;background:none;border:none;padding:2px;border-radius:4px;transition:background-color .3s ease}.icon-picker-modal__header .icon-picker-modal--close:hover{background-color:#f3f3f3}.icon-picker-modal__search{margin:32px 0 24px 0}.icon-picker-modal__content{display:grid;grid-template-columns:repeat(7, 40px);grid-gap:8px;overflow-y:scroll}.icon-picker-modal__content .is-empty,.icon-picker-modal__content .is-loading{text-align:center;grid-column:1/-1}.icon-picker-modal__content .icon-element{display:flex;align-items:center;justify-content:center;border:1px solid #ced4da;border-radius:4px;background-color:rgba(0,0,0,0);height:40px;width:40px;cursor:pointer;transition:background-color .3s ease,border-color .3s ease}.icon-picker-modal__content .icon-element i,.icon-picker-modal__content .icon-element svg{font-size:24px;color:#0983fd}.icon-picker-modal__content .icon-element:hover{background-color:#0983fd;border-color:#0983fd}.icon-picker-modal__content .icon-element:hover i,.icon-picker-modal__content .icon-element:hover svg{color:#fff}.icon-picker-modal__content .icon-element.is-selected{background-color:#0983fd;border-color:#0983fd}.icon-picker-modal__content .icon-element.is-selected i,.icon-picker-modal__content .icon-element.is-selected svg{color:#fff}.icon-picker-modal__content .icon-element[hidden]{display:none}.icon-picker-modal__footer{margin-top:auto;padding-top:24px;align-self:flex-end} diff --git a/src/vanilla-icon-picker/dist/themes/default.min.css b/src/vanilla-icon-picker/dist/themes/default.min.css new file mode 100644 index 00000000..463db798 --- /dev/null +++ b/src/vanilla-icon-picker/dist/themes/default.min.css @@ -0,0 +1,10 @@ +/*! Icon Picker 1.4.2 MIT | https://github.com/AppoloDev/icon-picker */ +.icon-picker-modal[data-theme=default] .icon-picker-modal__header h2{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Helvetica Neue",Arial,sans-serif}.icon-picker-modal[data-theme=default] .icon-picker-modal__search{background-color:#f6f9fd;border:1px solid #f4f7f9;border-radius:4px;padding:10px 16px;transition:border-color .3s ease,box-shadow .3s ease,background-color .3s ease}.icon-picker-modal[data-theme=default] .icon-picker-modal__search:focus,.icon-picker-modal[data-theme=default] .icon-picker-modal__search:focus-visible{box-shadow:0 0 0 4px rgba(9,131,253,.25);background-color:#fff;border-color:#086acc;outline:0}.icon-picker-modal[data-theme=default] .icon-picker-modal__footer .picker-save{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Helvetica Neue",Arial,sans-serif;color:#fff;background-color:#0983fd;border-radius:4px;padding:8px 16px;transition:background-color .3s ease}.icon-picker-modal[data-theme=default] .icon-picker-modal__footer .picker-save:hover{background-color:#0a72cc}.icon-picker-modal{position:fixed;left:0;top:0;bottom:0;right:0;z-index:100000;background-color:rgba(68,69,69,0);visibility:hidden;transition:background-color .3s ease-out,visibility .3s ease-out}.icon-picker-modal.is-visible{background-color:rgba(68,69,69,.6);visibility:visible}.icon-picker-modal.is-visible .icon-picker-modal__dialog{transform:translate(-50%, -50%);opacity:1}.icon-picker-modal__dialog{display:flex;flex-direction:column;position:absolute;left:50%;top:50%;z-index:1;height:440px;min-width:380px;opacity:0;transform:translate(-50%, -55%);transition:transform .3s ease-in-out,opacity .3s ease;padding:24px;background-color:#fff;border-radius:16px}.icon-picker-modal__header{display:flex;justify-content:space-between;align-items:center}.icon-picker-modal__header h2{margin-block-start:0;margin-block-end:0;font-size:24px}.icon-picker-modal__header .icon-picker-modal--close{cursor:pointer;margin-left:auto;-webkit-appearance:none;background:none;border:none;padding:2px;border-radius:4px;transition:background-color .3s ease}.icon-picker-modal__header .icon-picker-modal--close:hover{background-color:#f3f3f3}.icon-picker-modal__search{margin:32px 0 24px 0}.icon-picker-modal__content{display:grid;grid-template-columns:repeat(7, 40px);grid-gap:8px;overflow-y:scroll}.icon-picker-modal__content .is-empty,.icon-picker-modal__content .is-loading{text-align:center;grid-column:1/-1}.icon-picker-modal__content .icon-element{display:flex;align-items:center;justify-content:center;border:1px solid #ced4da;border-radius:4px;background-color:rgba(0,0,0,0);height:40px;width:40px;cursor:pointer;transition:background-color .3s ease,border-color .3s ease}.icon-picker-modal__content .icon-element i,.icon-picker-modal__content .icon-element svg{font-size:24px;color:#0983fd}.icon-picker-modal__content .icon-element:hover{background-color:#0983fd;border-color:#0983fd}.icon-picker-modal__content .icon-element:hover i,.icon-picker-modal__content .icon-element:hover svg{color:#fff}.icon-picker-modal__content .icon-element.is-selected{background-color:#0983fd;border-color:#0983fd}.icon-picker-modal__content .icon-element.is-selected i,.icon-picker-modal__content .icon-element.is-selected svg{color:#fff}.icon-picker-modal__content .icon-element[hidden]{display:none}.icon-picker-modal__footer{margin-top:auto;padding-top:24px;align-self:flex-end} + +.icon-element.filter, +.icon-element.tagcloud { + margin: 0; +} +.icon-element.menu { + padding-top: 0; +} From 0b716e204131883642fad8369efe6fc75e8360b2 Mon Sep 17 00:00:00 2001 From: Michael Beckwith Date: Tue, 30 Dec 2025 13:58:28 -0600 Subject: [PATCH 02/14] commit our new icon picker js data and scripts --- src/js/dashicons.json | 926 +++++++++++++++++++++++++++++++++ src/js/partials/icon-picker.js | 17 + 2 files changed, 943 insertions(+) create mode 100644 src/js/dashicons.json create mode 100644 src/js/partials/icon-picker.js diff --git a/src/js/dashicons.json b/src/js/dashicons.json new file mode 100644 index 00000000..d97a81e9 --- /dev/null +++ b/src/js/dashicons.json @@ -0,0 +1,926 @@ +{ + "prefix": "dashicons", + "info": { + "name": "WordPress Dashicons", + "total": 302, + "height": 32, + "displayHeight": 16, + "palette": false + }, + "lastModified": 1756960781, + "iconFormat": "markup", + "icons": { + "menu": { + "body": "" + }, + "dashboard": { + "body": "" + }, + "filter": { + "body": "" + }, + "admin-site": { + "body": "" + }, + "admin-media": { + "body": "" + }, + "admin-page": { + "body": "" + }, + "admin-comments": { + "body": "" + }, + "admin-appearance": { + "body": "" + }, + "admin-plugins": { + "body": "" + }, + "admin-users": { + "body": "" + }, + "admin-tools": { + "body": "" + }, + "admin-settings": { + "body": "" + }, + "admin-network": { + "body": "" + }, + "admin-generic": { + "body": "" + }, + "admin-home": { + "body": "" + }, + "admin-collapse": { + "body": "" + }, + "admin-customizer": { + "body": "" + }, + "admin-multisite": { + "body": "" + }, + "admin-links": { + "body": "" + }, + "admin-post": { + "body": "" + }, + "format-links": { + "body": "" + }, + "format-standard": { + "body": "" + }, + "format-image": { + "body": "" + }, + "format-gallery": { + "body": "" + }, + "format-audio": { + "body": "" + }, + "format-video": { + "body": "" + }, + "format-chat": { + "body": "" + }, + "format-status": { + "body": "" + }, + "format-aside": { + "body": "" + }, + "format-quote": { + "body": "" + }, + "welcome-write-blog": { + "body": "" + }, + "welcome-edit-page": { + "body": "" + }, + "welcome-add-page": { + "body": "" + }, + "welcome-view-site": { + "body": "" + }, + "welcome-widgets-menus": { + "body": "" + }, + "welcome-comments": { + "body": "" + }, + "welcome-learn-more": { + "body": "" + }, + "image-crop": { + "body": "" + }, + "image-rotate": { + "body": "" + }, + "image-rotate-left": { + "body": "" + }, + "image-rotate-right": { + "body": "" + }, + "image-flip-vertical": { + "body": "" + }, + "image-flip-horizontal": { + "body": "" + }, + "image-filter": { + "body": "" + }, + "undo": { + "body": "" + }, + "redo": { + "body": "" + }, + "editor-bold": { + "body": "" + }, + "editor-italic": { + "body": "" + }, + "editor-ul": { + "body": "" + }, + "editor-ol": { + "body": "" + }, + "editor-quote": { + "body": "" + }, + "editor-alignleft": { + "body": "" + }, + "editor-aligncenter": { + "body": "" + }, + "editor-alignright": { + "body": "" + }, + "editor-insertmore": { + "body": "" + }, + "editor-spellcheck": { + "body": "" + }, + "editor-distractionfree": { + "body": "" + }, + "editor-expand": { + "body": "" + }, + "editor-contract": { + "body": "" + }, + "editor-kitchensink": { + "body": "" + }, + "editor-underline": { + "body": "" + }, + "editor-justify": { + "body": "" + }, + "editor-textcolor": { + "body": "" + }, + "editor-paste-word": { + "body": "" + }, + "editor-paste-text": { + "body": "" + }, + "editor-removeformatting": { + "body": "" + }, + "editor-video": { + "body": "" + }, + "editor-customchar": { + "body": "" + }, + "editor-outdent": { + "body": "" + }, + "editor-indent": { + "body": "" + }, + "editor-help": { + "body": "" + }, + "editor-strikethrough": { + "body": "" + }, + "editor-unlink": { + "body": "" + }, + "editor-rtl": { + "body": "" + }, + "editor-break": { + "body": "" + }, + "editor-code": { + "body": "" + }, + "editor-paragraph": { + "body": "" + }, + "editor-table": { + "body": "" + }, + "align-left": { + "body": "" + }, + "align-right": { + "body": "" + }, + "align-center": { + "body": "" + }, + "align-none": { + "body": "" + }, + "lock": { + "body": "" + }, + "unlock": { + "body": "" + }, + "calendar": { + "body": "" + }, + "calendar-alt": { + "body": "" + }, + "visibility": { + "body": "" + }, + "hidden": { + "body": "" + }, + "post-status": { + "body": "" + }, + "post-trash": { + "body": "" + }, + "trash": { + "body": "" + }, + "sticky": { + "body": "" + }, + "external": { + "body": "" + }, + "arrow-up": { + "body": "" + }, + "arrow-down": { + "body": "" + }, + "arrow-left": { + "body": "" + }, + "arrow-right": { + "body": "" + }, + "arrow-up-alt": { + "body": "" + }, + "arrow-down-alt": { + "body": "" + }, + "arrow-left-alt": { + "body": "" + }, + "arrow-right-alt": { + "body": "" + }, + "arrow-up-alt2": { + "body": "" + }, + "arrow-down-alt2": { + "body": "" + }, + "arrow-left-alt2": { + "body": "" + }, + "arrow-right-alt2": { + "body": "" + }, + "leftright": { + "body": "" + }, + "sort": { + "body": "" + }, + "randomize": { + "body": "" + }, + "list-view": { + "body": "" + }, + "excerpt-view": { + "body": "" + }, + "grid-view": { + "body": "" + }, + "hammer": { + "body": "" + }, + "art": { + "body": "" + }, + "migrate": { + "body": "" + }, + "performance": { + "body": "" + }, + "universal-access": { + "body": "" + }, + "universal-access-alt": { + "body": "" + }, + "tickets": { + "body": "" + }, + "nametag": { + "body": "" + }, + "clipboard": { + "body": "" + }, + "heart": { + "body": "" + }, + "megaphone": { + "body": "" + }, + "schedule": { + "body": "" + }, + "wordpress": { + "body": "" + }, + "wordpress-alt": { + "body": "" + }, + "pressthis": { + "body": "" + }, + "update": { + "body": "" + }, + "screenoptions": { + "body": "" + }, + "cart": { + "body": "" + }, + "feedback": { + "body": "" + }, + "cloud": { + "body": "" + }, + "translation": { + "body": "" + }, + "tag": { + "body": "" + }, + "category": { + "body": "" + }, + "archive": { + "body": "" + }, + "tagcloud": { + "body": "" + }, + "text": { + "body": "" + }, + "media-archive": { + "body": "" + }, + "media-audio": { + "body": "" + }, + "media-code": { + "body": "" + }, + "media-default": { + "body": "" + }, + "media-document": { + "body": "" + }, + "media-interactive": { + "body": "" + }, + "media-spreadsheet": { + "body": "" + }, + "media-text": { + "body": "" + }, + "media-video": { + "body": "" + }, + "playlist-audio": { + "body": "" + }, + "playlist-video": { + "body": "" + }, + "controls-play": { + "body": "" + }, + "controls-pause": { + "body": "" + }, + "controls-forward": { + "body": "" + }, + "controls-skipforward": { + "body": "" + }, + "controls-back": { + "body": "" + }, + "controls-skipback": { + "body": "" + }, + "controls-repeat": { + "body": "" + }, + "controls-volumeon": { + "body": "" + }, + "controls-volumeoff": { + "body": "" + }, + "yes": { + "body": "" + }, + "no": { + "body": "" + }, + "no-alt": { + "body": "" + }, + "plus": { + "body": "" + }, + "plus-alt": { + "body": "" + }, + "plus-alt2": { + "body": "" + }, + "minus": { + "body": "" + }, + "dismiss": { + "body": "" + }, + "marker": { + "body": "" + }, + "star-filled": { + "body": "" + }, + "star-half": { + "body": "" + }, + "star-empty": { + "body": "" + }, + "flag": { + "body": "" + }, + "info": { + "body": "" + }, + "warning": { + "body": "" + }, + "share": { + "body": "" + }, + "share1": { + "body": "" + }, + "share-alt": { + "body": "" + }, + "share-alt2": { + "body": "" + }, + "twitter": { + "body": "" + }, + "rss": { + "body": "" + }, + "email": { + "body": "" + }, + "email-alt": { + "body": "" + }, + "facebook": { + "body": "" + }, + "facebook-alt": { + "body": "" + }, + "networking": { + "body": "" + }, + "googleplus": { + "body": "" + }, + "location": { + "body": "" + }, + "location-alt": { + "body": "" + }, + "camera": { + "body": "" + }, + "images-alt": { + "body": "" + }, + "images-alt2": { + "body": "" + }, + "video-alt": { + "body": "" + }, + "video-alt2": { + "body": "" + }, + "video-alt3": { + "body": "" + }, + "vault": { + "body": "" + }, + "shield": { + "body": "" + }, + "shield-alt": { + "body": "" + }, + "sos": { + "body": "" + }, + "search": { + "body": "" + }, + "slides": { + "body": "" + }, + "analytics": { + "body": "" + }, + "chart-pie": { + "body": "" + }, + "chart-bar": { + "body": "" + }, + "chart-line": { + "body": "" + }, + "chart-area": { + "body": "" + }, + "groups": { + "body": "" + }, + "businessman": { + "body": "" + }, + "id": { + "body": "" + }, + "id-alt": { + "body": "" + }, + "products": { + "body": "" + }, + "awards": { + "body": "" + }, + "forms": { + "body": "" + }, + "testimonial": { + "body": "" + }, + "portfolio": { + "body": "" + }, + "book": { + "body": "" + }, + "book-alt": { + "body": "" + }, + "download": { + "body": "" + }, + "upload": { + "body": "" + }, + "backup": { + "body": "" + }, + "clock": { + "body": "" + }, + "lightbulb": { + "body": "" + }, + "microphone": { + "body": "" + }, + "desktop": { + "body": "" + }, + "tablet": { + "body": "" + }, + "smartphone": { + "body": "" + }, + "phone": { + "body": "" + }, + "smiley": { + "body": "" + }, + "index-card": { + "body": "" + }, + "carrot": { + "body": "" + }, + "building": { + "body": "" + }, + "store": { + "body": "" + }, + "album": { + "body": "" + }, + "palmtree": { + "body": "" + }, + "tickets-alt": { + "body": "" + }, + "money": { + "body": "" + }, + "thumbs-up": { + "body": "" + }, + "thumbs-down": { + "body": "" + }, + "layout": { + "body": "" + }, + "align-pull-left": { + "body": "" + }, + "align-pull-right": { + "body": "" + }, + "block-default": { + "body": "" + }, + "cloud-saved": { + "body": "" + }, + "cloud-upload": { + "body": "" + }, + "columns": { + "body": "" + }, + "cover-image": { + "body": "" + }, + "embed-audio": { + "body": "" + }, + "embed-generic": { + "body": "" + }, + "embed-photo": { + "body": "" + }, + "embed-post": { + "body": "" + }, + "embed-video": { + "body": "" + }, + "edit": { + "body": "" + }, + "html": { + "body": "" + }, + "info-outline": { + "body": "" + }, + "insert-after": { + "body": "" + }, + "insert-before": { + "body": "" + }, + "insert": { + "body": "" + }, + "remove": { + "body": "" + }, + "shortcode": { + "body": "" + }, + "table-col-after": { + "body": "" + }, + "table-col-before": { + "body": "" + }, + "table-col-delete": { + "body": "" + }, + "table-row-after": { + "body": "" + }, + "table-row-before": { + "body": "" + }, + "table-row-delete": { + "body": "" + }, + "saved": { + "body": "" + }, + "amazon": { + "body": "" + }, + "google": { + "body": "" + }, + "linkedin": { + "body": "" + }, + "pinterest": { + "body": "" + }, + "podio": { + "body": "" + }, + "reddit": { + "body": "" + }, + "spotify": { + "body": "" + }, + "twitch": { + "body": "" + }, + "whatsapp": { + "body": "" + }, + "xing": { + "body": "" + }, + "youtube": { + "body": "" + }, + "database-add": { + "body": "" + }, + "database-export": { + "body": "" + }, + "database-import": { + "body": "" + }, + "database-remove": { + "body": "" + }, + "database-view": { + "body": "" + }, + "database": { + "body": "" + }, + "bell": { + "body": "" + }, + "airplane": { + "body": "" + }, + "car": { + "body": "" + }, + "calculator": { + "body": "" + }, + "games": { + "body": "" + }, + "printer": { + "body": "" + }, + "beer": { + "body": "" + }, + "drumstick": { + "body": "" + }, + "food": { + "body": "" + }, + "bank": { + "body": "" + }, + "hourglass": { + "body": "" + }, + "money-alt": { + "body": "" + }, + "open-folder": { + "body": "" + }, + "pdf": { + "body": "" + }, + "pets": { + "body": "" + }, + "privacy": { + "body": "" + }, + "superhero": { + "body": "" + }, + "superhero-alt": { + "body": "" + }, + "edit-page": { + "body": "" + }, + "fullscreen-alt": { + "body": "" + }, + "fullscreen-exit-alt": { + "body": "" + }, + "coffee": { + "body": "" + } + }, + "suffixes": { + "": "Regular", + "square": "Square" + }, + "width": 448, + "height": 512 +} diff --git a/src/js/partials/icon-picker.js b/src/js/partials/icon-picker.js new file mode 100644 index 00000000..3682d690 --- /dev/null +++ b/src/js/partials/icon-picker.js @@ -0,0 +1,17 @@ +'use strict'; +/* + * This file handles the icon picker instantiation + */ + +(() => { + const icons = cptuiIconPicker.iconsJSON; + const iconPicker = new IconPicker('#icon-picker', { + theme : 'default', + iconSource: [{ + key : 'dashicons', + prefix: 'dashicons-', + url : icons + }], + closeOnSelect: true, + }); +})(); From 09d6cf175d8ab8584cd0f7453186db8c8fe8360e Mon Sep 17 00:00:00 2001 From: Michael Beckwith Date: Tue, 30 Dec 2025 13:58:49 -0600 Subject: [PATCH 03/14] load our new icon picker in build process --- src/js/cptui.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/js/cptui.js b/src/js/cptui.js index eb3fb3b5..ed1229bd 100644 --- a/src/js/cptui.js +++ b/src/js/cptui.js @@ -10,5 +10,4 @@ import './partials/tax-required-post-type'; import './partials/autopopulate'; import './partials/back-to-top'; import './partials/toggle-panels'; - -//import './dashicons-picker'; +import './partials/icon-picker'; From 3b4248d6ee7347dfa0289a6bf62ad196ea943579 Mon Sep 17 00:00:00 2001 From: Michael Beckwith Date: Tue, 30 Dec 2025 14:00:23 -0600 Subject: [PATCH 04/14] unload old dashicons --- inc/post-types.php | 1 - 1 file changed, 1 deletion(-) diff --git a/inc/post-types.php b/inc/post-types.php index 39518b00..4ddb1f53 100644 --- a/inc/post-types.php +++ b/inc/post-types.php @@ -35,7 +35,6 @@ function cptui_post_type_enqueue_scripts( $hook ) { wp_enqueue_media(); wp_enqueue_script( 'cptui' ); - wp_enqueue_script( 'dashicons-picker' ); wp_enqueue_style( 'cptui-css' ); $core = get_post_types( [ '_builtin' => true ] ); From 82632287f142e8fe1620491a8d6889540d1785b9 Mon Sep 17 00:00:00 2001 From: Michael Beckwith Date: Tue, 30 Dec 2025 15:56:56 -0600 Subject: [PATCH 05/14] un-add these as we are reworking original menu icon file --- src/js/cptui.js | 1 - src/js/partials/icon-picker.js | 17 ----------------- 2 files changed, 18 deletions(-) delete mode 100644 src/js/partials/icon-picker.js diff --git a/src/js/cptui.js b/src/js/cptui.js index ed1229bd..a3d79eda 100644 --- a/src/js/cptui.js +++ b/src/js/cptui.js @@ -10,4 +10,3 @@ import './partials/tax-required-post-type'; import './partials/autopopulate'; import './partials/back-to-top'; import './partials/toggle-panels'; -import './partials/icon-picker'; diff --git a/src/js/partials/icon-picker.js b/src/js/partials/icon-picker.js deleted file mode 100644 index 3682d690..00000000 --- a/src/js/partials/icon-picker.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict'; -/* - * This file handles the icon picker instantiation - */ - -(() => { - const icons = cptuiIconPicker.iconsJSON; - const iconPicker = new IconPicker('#icon-picker', { - theme : 'default', - iconSource: [{ - key : 'dashicons', - prefix: 'dashicons-', - url : icons - }], - closeOnSelect: true, - }); -})(); From 3dee090dfa74c664a2475453b8a6528687246a0e Mon Sep 17 00:00:00 2001 From: Michael Beckwith Date: Tue, 30 Dec 2025 15:57:50 -0600 Subject: [PATCH 06/14] rework menu icon selection to finally remove jquery and migrate to new library --- src/js/partials/menu-icon.js | 88 ++++++++++++++++++++---------------- 1 file changed, 49 insertions(+), 39 deletions(-) diff --git a/src/js/partials/menu-icon.js b/src/js/partials/menu-icon.js index 8cda6eab..d48c500d 100644 --- a/src/js/partials/menu-icon.js +++ b/src/js/partials/menu-icon.js @@ -1,14 +1,10 @@ 'use strict'; -import {composePreviewContent} from './utils'; - /* * This file handles setting the menu icon preview for a given post type. - * - * @todo Finish converting away from jQuery. */ -(($) => { +(() => { let _custom_media; let _orig_send_attachment; @@ -17,41 +13,55 @@ import {composePreviewContent} from './utils'; _orig_send_attachment = wp.media.editor.send.attachment; } - $('#cptui_choose_icon').on('click', function (e) { - e.preventDefault(); + // Trigger the modal and load our icons. + const icons = cptuiIconPicker.iconsJSON; + const iconPicker = new IconPicker('#cptui_choose_dashicon', { + theme : 'default', + iconSource : [{ + key : 'dashicons', + prefix: 'dashicons-', + url : icons + }], + closeOnSelect: true, + }); + + const menuIconField = document.querySelector('#menu_icon'); + const menuIconPreview = document.querySelector('#menu_icon_preview'); + const regIcon = document.querySelector('#cptui_choose_icon'); + const dashIcon = document.querySelector('#cptui_choose_dashicon'); + const origText = dashIcon.value; + iconPicker.on('select', (icon) => { + menuIconField.value = icon.value; + menuIconPreview.innerHTML = ''; - let button = $(this); - let id = jQuery('#menu_icon').attr('id'); - _custom_media = true; - wp.media.editor.send.attachment = function (props, attachment) { - if (_custom_media) { - $("#" + id).val(attachment.url).change(); - } else { - return _orig_send_attachment.apply(this, [props, attachment]); - } - }; - - wp.media.editor.open(button); - return false; + let div = document.createElement('div'); + div.classList.add('dashicons', icon.value); + menuIconPreview.insertAdjacentElement('afterbegin', div); }); + iconPicker.on('hide', () => { + dashIcon.value = origText; + }) - // NOT DONE - /*const menuIcon = document.querySelector('#menu_icon'); - if (menuIcon) { - menuIcon.addEventListener('input', (e) => { - let value = e.currentTarget.value.trim(); - console.log(value); - let menuIconPreview = document.querySelector('#menu_icon_preview'); - console.log(menuIconPreview); - if (menuIconPreview) { - console.log(composePreviewContent(value)); - menuIconPreview.innerHTML = composePreviewContent(value); - } + if (regIcon) { + regIcon.addEventListener('click', (e) => { + e.preventDefault(); + + let button = e.currentTarget; + _custom_media = true; + wp.media.editor.send.attachment = function (props, attachment) { + if (_custom_media) { + menuIconField.value = attachment.url; + menuIconPreview.innerHTML = ''; + let img = document.createElement('img'); + img.src = attachment.url; + menuIconPreview.insertAdjacentElement('afterbegin', img); + } else { + return _orig_send_attachment.apply(this, [props, attachment]); + } + }; + + wp.media.editor.open(button); + return false; }); - }*/ - $('#menu_icon').on('change', function () { - var value = $(this).val(); - value = value.trim(); - $('#menu_icon_preview').html(composePreviewContent(value)); - }); -})(jQuery); + } +})(); From 4cc424e36d7e532303ad370b78bac560fecd6b91 Mon Sep 17 00:00:00 2001 From: Michael Beckwith Date: Tue, 30 Dec 2025 16:17:31 -0600 Subject: [PATCH 07/14] remove legacy dashicon picker --- build/dashiconsPicker.asset.php | 1 - build/dashiconsPicker.js | 94 ------- build/dashiconsPicker.js.map | 1 - build/dashiconsPicker.min.js | 1 - build/dashiconsPicker.min.js.map | 1 - src/js/dashiconsPicker.js | 419 ------------------------------- 6 files changed, 517 deletions(-) delete mode 100644 build/dashiconsPicker.asset.php delete mode 100644 build/dashiconsPicker.js delete mode 100644 build/dashiconsPicker.js.map delete mode 100644 build/dashiconsPicker.min.js delete mode 100644 build/dashiconsPicker.min.js.map delete mode 100644 src/js/dashiconsPicker.js diff --git a/build/dashiconsPicker.asset.php b/build/dashiconsPicker.asset.php deleted file mode 100644 index 873f0b8f..00000000 --- a/build/dashiconsPicker.asset.php +++ /dev/null @@ -1 +0,0 @@ - array(), 'version' => 'b838c68b2d331415d129'); diff --git a/build/dashiconsPicker.js b/build/dashiconsPicker.js deleted file mode 100644 index 886d23d1..00000000 --- a/build/dashiconsPicker.js +++ /dev/null @@ -1,94 +0,0 @@ -/******/ (() => { // webpackBootstrap -/** - * Dashicons Picker - * - * Based on: https://github.com/bradvin/dashicons-picker/ - */ - -(function ($) { - 'use strict'; - - /** - * - * @returns {void} - */ - $.fn.dashiconsPicker = function () { - /** - * Dashicons, in CSS order - * - * @type Array - */ - var icons = ['menu', 'admin-site', 'dashboard', 'admin-media', 'admin-page', 'admin-comments', 'admin-appearance', 'admin-plugins', 'admin-users', 'admin-tools', 'admin-settings', 'admin-network', 'admin-generic', 'admin-home', 'admin-collapse', 'filter', 'admin-customizer', 'admin-multisite', 'admin-links', 'format-links', 'admin-post', 'format-standard', 'format-image', 'format-gallery', 'format-audio', 'format-video', 'format-chat', 'format-status', 'format-aside', 'format-quote', 'welcome-write-blog', 'welcome-edit-page', 'welcome-add-page', 'welcome-view-site', 'welcome-widgets-menus', 'welcome-comments', 'welcome-learn-more', 'image-crop', 'image-rotate', 'image-rotate-left', 'image-rotate-right', 'image-flip-vertical', 'image-flip-horizontal', 'image-filter', 'undo', 'redo', 'editor-bold', 'editor-italic', 'editor-ul', 'editor-ol', 'editor-quote', 'editor-alignleft', 'editor-aligncenter', 'editor-alignright', 'editor-insertmore', 'editor-spellcheck', 'editor-distractionfree', 'editor-expand', 'editor-contract', 'editor-kitchensink', 'editor-underline', 'editor-justify', 'editor-textcolor', 'editor-paste-word', 'editor-paste-text', 'editor-removeformatting', 'editor-video', 'editor-customchar', 'editor-outdent', 'editor-indent', 'editor-help', 'editor-strikethrough', 'editor-unlink', 'editor-rtl', 'editor-break', 'editor-code', 'editor-paragraph', 'editor-table', 'align-left', 'align-right', 'align-center', 'align-none', 'lock', 'unlock', 'calendar', 'calendar-alt', 'visibility', 'hidden', 'post-status', 'edit', 'post-trash', 'trash', 'sticky', 'external', 'arrow-up', 'arrow-down', 'arrow-left', 'arrow-right', 'arrow-up-alt', 'arrow-down-alt', 'arrow-left-alt', 'arrow-right-alt', 'arrow-up-alt2', 'arrow-down-alt2', 'arrow-left-alt2', 'arrow-right-alt2', 'leftright', 'sort', 'randomize', 'list-view', 'excerpt-view', 'grid-view', 'hammer', 'art', 'migrate', 'performance', 'universal-access', 'universal-access-alt', 'tickets', 'nametag', 'clipboard', 'heart', 'megaphone', 'schedule', 'wordpress', 'wordpress-alt', 'pressthis', 'update', 'screenoptions', 'cart', 'feedback', 'cloud', 'translation', 'tag', 'category', 'archive', 'tagcloud', 'text', 'media-archive', 'media-audio', 'media-code', 'media-default', 'media-document', 'media-interactive', 'media-spreadsheet', 'media-text', 'media-video', 'playlist-audio', 'playlist-video', 'controls-play', 'controls-pause', 'controls-forward', 'controls-skipforward', 'controls-back', 'controls-skipback', 'controls-repeat', 'controls-volumeon', 'controls-volumeoff', 'yes', 'no', 'no-alt', 'plus', 'plus-alt', 'plus-alt2', 'minus', 'dismiss', 'marker', 'star-filled', 'star-half', 'star-empty', 'flag', 'info', 'warning', 'share', 'share1', 'share-alt', 'share-alt2', 'twitter', 'rss', 'email', 'email-alt', 'facebook', 'facebook-alt', 'networking', 'googleplus', 'location', 'location-alt', 'camera', 'images-alt', 'images-alt2', 'video-alt', 'video-alt2', 'video-alt3', 'vault', 'shield', 'shield-alt', 'sos', 'search', 'slides', 'analytics', 'chart-pie', 'chart-bar', 'chart-line', 'chart-area', 'groups', 'businessman', 'id', 'id-alt', 'products', 'awards', 'forms', 'testimonial', 'portfolio', 'book', 'book-alt', 'download', 'upload', 'backup', 'clock', 'lightbulb', 'microphone', 'desktop', 'tablet', 'smartphone', 'phone', 'smiley', 'index-card', 'carrot', 'building', 'store', 'album', 'palmtree', 'tickets-alt', 'money', 'thumbs-up', 'thumbs-down', 'layout', 'align-pull-left', 'align-pull-right', 'block-default', 'cloud-saved', 'cloud-upload', 'columns', 'cover-image', 'embed-audio', 'embed-generic', 'embed-photo', 'embed-post', 'embed-video', 'exit', 'html', 'info-outline', 'insert-after', 'insert-before', 'insert', 'remove', 'shortcode', 'table-col-after', 'table-col-before', 'table-col-delete', 'table-row-after', 'table-row-before', 'table-row-delete', 'saved', 'amazon', 'google', 'linkedin', 'pinterest', 'podio', 'reddit', 'spotify', 'twitch', 'whatsapp', 'xing', 'youtube', 'database-add', 'database-export', 'database-import', 'database-remove', 'database-view', 'database', 'bell', 'airplane', 'car', 'calculator', 'games', 'printer', 'beer', 'coffee', 'drumstick', 'food', 'bank', 'hourglass', 'money-alt', 'open-folder', 'pdf', 'pets', 'privacy', 'superhero', 'superhero-alt', 'edit-page', 'fullscreen-alt', 'fullscreen-exit-alt']; - return this.each(function () { - var button = $(this), - offsetTop, - offsetLeft; - button.on('click.dashiconsPicker', function (e) { - offsetTop = $(e.currentTarget).offset().top; - offsetLeft = $(e.currentTarget).offset().left; - createPopup(button); - }); - function createPopup(button) { - var target = $('#menu_icon'), - preview = $(button.data('preview')), - popup = $('
' + '
' + '
    ' + '
    ').css({ - 'top': offsetTop, - 'left': offsetLeft - }), - list = popup.find('.dashicon-picker-list'); - for (var i in icons) { - if (icons.hasOwnProperty(i)) { - list.append('
  • '); - } - } - $('a', list).on('click', function (e) { - e.preventDefault(); - var title = $(this).attr('title'); - target.val('dashicons-' + title).change(); - preview.prop('class', 'dashicons').addClass('dashicons-' + title); - removePopup(); - }); - var control = popup.find('.dashicon-picker-control'); - control.html('' + '' + '' + ''); - $('a', control).on('click', function (e) { - e.preventDefault(); - if ($(this).data('direction') === 'back') { - $('li:gt(' + (icons.length - 26) + ')', list).prependTo(list); - } else { - $('li:lt(25)', list).appendTo(list); - } - }); - popup.appendTo('body').show(); - $('input', control).on('keyup', function (e) { - var search = $(this).val(); - if (search === '') { - $('li:lt(25)', list).show(); - } else { - $('li', list).each(function () { - if ($(this).data('icon').toLowerCase().indexOf(search.toLowerCase()) !== -1) { - $(this).show(); - } else { - $(this).hide(); - } - }); - } - }); - $(document).on('mouseup.dashicons-picker', function (e) { - if (!popup.is(e.target) && popup.has(e.target).length === 0) { - removePopup(); - } - }); - } - function removePopup() { - $('.dashicon-picker-container').remove(); - $(document).off('.dashicons-picker'); - } - }); - }; - $(function () { - $('.dashicons-picker').dashiconsPicker(); - }); -})(jQuery); -/******/ })() -; -//# sourceMappingURL=dashiconsPicker.js.map \ No newline at end of file diff --git a/build/dashiconsPicker.js.map b/build/dashiconsPicker.js.map deleted file mode 100644 index dff02822..00000000 --- a/build/dashiconsPicker.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dashiconsPicker.js","mappings":";AAAA;AACA;AACA;AACA;AACA;;AAEG,WAAWA,CAAC,EAAG;EACjB,YAAY;;EACZ;AACD;AACA;AACA;EACCA,CAAC,CAACC,EAAE,CAACC,eAAe,GAAG,YAAY;IAElC;AACF;AACA;AACA;AACA;IACE,IAAIC,KAAK,GAAG,CACX,MAAM,EACN,YAAY,EACZ,WAAW,EACX,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,QAAQ,EACR,kBAAkB,EAClB,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,aAAa,EACb,eAAe,EACf,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,EACpB,YAAY,EACZ,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,cAAc,EACd,MAAM,EACN,MAAM,EACN,aAAa,EACb,eAAe,EACf,WAAW,EACX,WAAW,EACX,cAAc,EACd,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,wBAAwB,EACxB,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,yBAAyB,EACzB,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,sBAAsB,EACtB,eAAe,EACf,YAAY,EACZ,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,cAAc,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E,YAAY;IACdA,CAAC,CAAE,mBAAoB,CAAC,CAACE,eAAe,CAAC,CAAC;EAC3C,CAAE,CAAC;AAEJ,CAAC,EAAE8C,MAAO,CAAC,C","sources":["webpack://custom-post-type-ui/./src/js/dashiconsPicker.js"],"sourcesContent":["/**\n * Dashicons Picker\n *\n * Based on: https://github.com/bradvin/dashicons-picker/\n */\n\n ( function ( $ ) {\n\t'use strict';\n\t/**\n\t *\n\t * @returns {void}\n\t */\n\t$.fn.dashiconsPicker = function () {\n\n\t\t/**\n\t\t * Dashicons, in CSS order\n\t\t *\n\t\t * @type Array\n\t\t */\n\t\tvar icons = [\n\t\t\t'menu',\n\t\t\t'admin-site',\n\t\t\t'dashboard',\n\t\t\t'admin-media',\n\t\t\t'admin-page',\n\t\t\t'admin-comments',\n\t\t\t'admin-appearance',\n\t\t\t'admin-plugins',\n\t\t\t'admin-users',\n\t\t\t'admin-tools',\n\t\t\t'admin-settings',\n\t\t\t'admin-network',\n\t\t\t'admin-generic',\n\t\t\t'admin-home',\n\t\t\t'admin-collapse',\n\t\t\t'filter',\n\t\t\t'admin-customizer',\n\t\t\t'admin-multisite',\n\t\t\t'admin-links',\n\t\t\t'format-links',\n\t\t\t'admin-post',\n\t\t\t'format-standard',\n\t\t\t'format-image',\n\t\t\t'format-gallery',\n\t\t\t'format-audio',\n\t\t\t'format-video',\n\t\t\t'format-chat',\n\t\t\t'format-status',\n\t\t\t'format-aside',\n\t\t\t'format-quote',\n\t\t\t'welcome-write-blog',\n\t\t\t'welcome-edit-page',\n\t\t\t'welcome-add-page',\n\t\t\t'welcome-view-site',\n\t\t\t'welcome-widgets-menus',\n\t\t\t'welcome-comments',\n\t\t\t'welcome-learn-more',\n\t\t\t'image-crop',\n\t\t\t'image-rotate',\n\t\t\t'image-rotate-left',\n\t\t\t'image-rotate-right',\n\t\t\t'image-flip-vertical',\n\t\t\t'image-flip-horizontal',\n\t\t\t'image-filter',\n\t\t\t'undo',\n\t\t\t'redo',\n\t\t\t'editor-bold',\n\t\t\t'editor-italic',\n\t\t\t'editor-ul',\n\t\t\t'editor-ol',\n\t\t\t'editor-quote',\n\t\t\t'editor-alignleft',\n\t\t\t'editor-aligncenter',\n\t\t\t'editor-alignright',\n\t\t\t'editor-insertmore',\n\t\t\t'editor-spellcheck',\n\t\t\t'editor-distractionfree',\n\t\t\t'editor-expand',\n\t\t\t'editor-contract',\n\t\t\t'editor-kitchensink',\n\t\t\t'editor-underline',\n\t\t\t'editor-justify',\n\t\t\t'editor-textcolor',\n\t\t\t'editor-paste-word',\n\t\t\t'editor-paste-text',\n\t\t\t'editor-removeformatting',\n\t\t\t'editor-video',\n\t\t\t'editor-customchar',\n\t\t\t'editor-outdent',\n\t\t\t'editor-indent',\n\t\t\t'editor-help',\n\t\t\t'editor-strikethrough',\n\t\t\t'editor-unlink',\n\t\t\t'editor-rtl',\n\t\t\t'editor-break',\n\t\t\t'editor-code',\n\t\t\t'editor-paragraph',\n\t\t\t'editor-table',\n\t\t\t'align-left',\n\t\t\t'align-right',\n\t\t\t'align-center',\n\t\t\t'align-none',\n\t\t\t'lock',\n\t\t\t'unlock',\n\t\t\t'calendar',\n\t\t\t'calendar-alt',\n\t\t\t'visibility',\n\t\t\t'hidden',\n\t\t\t'post-status',\n\t\t\t'edit',\n\t\t\t'post-trash',\n\t\t\t'trash',\n\t\t\t'sticky',\n\t\t\t'external',\n\t\t\t'arrow-up',\n\t\t\t'arrow-down',\n\t\t\t'arrow-left',\n\t\t\t'arrow-right',\n\t\t\t'arrow-up-alt',\n\t\t\t'arrow-down-alt',\n\t\t\t'arrow-left-alt',\n\t\t\t'arrow-right-alt',\n\t\t\t'arrow-up-alt2',\n\t\t\t'arrow-down-alt2',\n\t\t\t'arrow-left-alt2',\n\t\t\t'arrow-right-alt2',\n\t\t\t'leftright',\n\t\t\t'sort',\n\t\t\t'randomize',\n\t\t\t'list-view',\n\t\t\t'excerpt-view',\n\t\t\t'grid-view',\n\t\t\t'hammer',\n\t\t\t'art',\n\t\t\t'migrate',\n\t\t\t'performance',\n\t\t\t'universal-access',\n\t\t\t'universal-access-alt',\n\t\t\t'tickets',\n\t\t\t'nametag',\n\t\t\t'clipboard',\n\t\t\t'heart',\n\t\t\t'megaphone',\n\t\t\t'schedule',\n\t\t\t'wordpress',\n\t\t\t'wordpress-alt',\n\t\t\t'pressthis',\n\t\t\t'update',\n\t\t\t'screenoptions',\n\t\t\t'cart',\n\t\t\t'feedback',\n\t\t\t'cloud',\n\t\t\t'translation',\n\t\t\t'tag',\n\t\t\t'category',\n\t\t\t'archive',\n\t\t\t'tagcloud',\n\t\t\t'text',\n\t\t\t'media-archive',\n\t\t\t'media-audio',\n\t\t\t'media-code',\n\t\t\t'media-default',\n\t\t\t'media-document',\n\t\t\t'media-interactive',\n\t\t\t'media-spreadsheet',\n\t\t\t'media-text',\n\t\t\t'media-video',\n\t\t\t'playlist-audio',\n\t\t\t'playlist-video',\n\t\t\t'controls-play',\n\t\t\t'controls-pause',\n\t\t\t'controls-forward',\n\t\t\t'controls-skipforward',\n\t\t\t'controls-back',\n\t\t\t'controls-skipback',\n\t\t\t'controls-repeat',\n\t\t\t'controls-volumeon',\n\t\t\t'controls-volumeoff',\n\t\t\t'yes',\n\t\t\t'no',\n\t\t\t'no-alt',\n\t\t\t'plus',\n\t\t\t'plus-alt',\n\t\t\t'plus-alt2',\n\t\t\t'minus',\n\t\t\t'dismiss',\n\t\t\t'marker',\n\t\t\t'star-filled',\n\t\t\t'star-half',\n\t\t\t'star-empty',\n\t\t\t'flag',\n\t\t\t'info',\n\t\t\t'warning',\n\t\t\t'share',\n\t\t\t'share1',\n\t\t\t'share-alt',\n\t\t\t'share-alt2',\n\t\t\t'twitter',\n\t\t\t'rss',\n\t\t\t'email',\n\t\t\t'email-alt',\n\t\t\t'facebook',\n\t\t\t'facebook-alt',\n\t\t\t'networking',\n\t\t\t'googleplus',\n\t\t\t'location',\n\t\t\t'location-alt',\n\t\t\t'camera',\n\t\t\t'images-alt',\n\t\t\t'images-alt2',\n\t\t\t'video-alt',\n\t\t\t'video-alt2',\n\t\t\t'video-alt3',\n\t\t\t'vault',\n\t\t\t'shield',\n\t\t\t'shield-alt',\n\t\t\t'sos',\n\t\t\t'search',\n\t\t\t'slides',\n\t\t\t'analytics',\n\t\t\t'chart-pie',\n\t\t\t'chart-bar',\n\t\t\t'chart-line',\n\t\t\t'chart-area',\n\t\t\t'groups',\n\t\t\t'businessman',\n\t\t\t'id',\n\t\t\t'id-alt',\n\t\t\t'products',\n\t\t\t'awards',\n\t\t\t'forms',\n\t\t\t'testimonial',\n\t\t\t'portfolio',\n\t\t\t'book',\n\t\t\t'book-alt',\n\t\t\t'download',\n\t\t\t'upload',\n\t\t\t'backup',\n\t\t\t'clock',\n\t\t\t'lightbulb',\n\t\t\t'microphone',\n\t\t\t'desktop',\n\t\t\t'tablet',\n\t\t\t'smartphone',\n\t\t\t'phone',\n\t\t\t'smiley',\n\t\t\t'index-card',\n\t\t\t'carrot',\n\t\t\t'building',\n\t\t\t'store',\n\t\t\t'album',\n\t\t\t'palmtree',\n\t\t\t'tickets-alt',\n\t\t\t'money',\n\t\t\t'thumbs-up',\n\t\t\t'thumbs-down',\n\t\t\t'layout',\n\t\t\t'align-pull-left',\n\t\t\t'align-pull-right',\n\t\t\t'block-default',\n\t\t\t'cloud-saved',\n\t\t\t'cloud-upload',\n\t\t\t'columns',\n\t\t\t'cover-image',\n\t\t\t'embed-audio',\n\t\t\t'embed-generic',\n\t\t\t'embed-photo',\n\t\t\t'embed-post',\n\t\t\t'embed-video',\n\t\t\t'exit',\n\t\t\t'html',\n\t\t\t'info-outline',\n\t\t\t'insert-after',\n\t\t\t'insert-before',\n\t\t\t'insert',\n\t\t\t'remove',\n\t\t\t'shortcode',\n\t\t\t'table-col-after',\n\t\t\t'table-col-before',\n\t\t\t'table-col-delete',\n\t\t\t'table-row-after',\n\t\t\t'table-row-before',\n\t\t\t'table-row-delete',\n\t\t\t'saved',\n\t\t\t'amazon',\n\t\t\t'google',\n\t\t\t'linkedin',\n\t\t\t'pinterest',\n\t\t\t'podio',\n\t\t\t'reddit',\n\t\t\t'spotify',\n\t\t\t'twitch',\n\t\t\t'whatsapp',\n\t\t\t'xing',\n\t\t\t'youtube',\n\t\t\t'database-add',\n\t\t\t'database-export',\n\t\t\t'database-import',\n\t\t\t'database-remove',\n\t\t\t'database-view',\n\t\t\t'database',\n\t\t\t'bell',\n\t\t\t'airplane',\n\t\t\t'car',\n\t\t\t'calculator',\n\t\t\t'games',\n\t\t\t'printer',\n\t\t\t'beer',\n\t\t\t'coffee',\n\t\t\t'drumstick',\n\t\t\t'food',\n\t\t\t'bank',\n\t\t\t'hourglass',\n\t\t\t'money-alt',\n\t\t\t'open-folder',\n\t\t\t'pdf',\n\t\t\t'pets',\n\t\t\t'privacy',\n\t\t\t'superhero',\n\t\t\t'superhero-alt',\n\t\t\t'edit-page',\n\t\t\t'fullscreen-alt',\n\t\t\t'fullscreen-exit-alt'\n\t\t];\n\n\t\treturn this.each( function () {\n\n\t\t\tvar button = $( this ),\n\t\t\t\toffsetTop,\n\t\t\t\toffsetLeft;\n\n\t\t\tbutton.on( 'click.dashiconsPicker', function ( e ) {\n\t\t\t\toffsetTop = $( e.currentTarget ).offset().top;\n\t\t\t\toffsetLeft = $( e.currentTarget ).offset().left;\n\t\t\t\tcreatePopup( button );\n\t\t\t} );\n\n\t\t\tfunction createPopup( button ) {\n\n\t\t\t\tvar target = $( '#menu_icon' ),\n\t\t\t\t\tpreview = $( button.data( 'preview' ) ),\n\t\t\t\t\tpopup = $( '
    ' +\n\t\t\t\t\t\t'
    ' +\n\t\t\t\t\t\t'
      ' +\n\t\t\t\t\t'
      ' ).css( {\n\t\t\t\t\t\t'top': offsetTop,\n\t\t\t\t\t\t'left': offsetLeft\n\t\t\t\t\t} ),\n\t\t\t\t\tlist = popup.find( '.dashicon-picker-list' );\n\n\t\t\t\tfor ( var i in icons ) {\n\t\t\t\t\tif ( icons.hasOwnProperty(i) ) {\n\t\t\t\t\t\tlist.append('
    • ');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$( 'a', list ).on( 'click', function ( e ) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tvar title = $( this ).attr( 'title' );\n\t\t\t\t\ttarget.val( 'dashicons-' + title ).change();\n\t\t\t\t\tpreview\n\t\t\t\t\t\t.prop('class', 'dashicons')\n\t\t\t\t\t\t.addClass( 'dashicons-' + title );\n\t\t\t\t\tremovePopup();\n\t\t\t\t} );\n\n\t\t\t\tvar control = popup.find( '.dashicon-picker-control' );\n\n\t\t\t\tcontrol.html( '' +\n\t\t\t\t\t'' +\n\t\t\t\t\t'' +\n\t\t\t\t\t''\n\t\t\t\t);\n\n\t\t\t\t$( 'a', control ).on( 'click', function ( e ) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tif ( $( this ).data( 'direction' ) === 'back' ) {\n\t\t\t\t\t\t$( 'li:gt(' + ( icons.length - 26 ) + ')', list ).prependTo( list );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$( 'li:lt(25)', list ).appendTo( list );\n\t\t\t\t\t}\n\t\t\t\t} );\n\n\t\t\t\tpopup.appendTo( 'body' ).show();\n\n\t\t\t\t$( 'input', control ).on( 'keyup', function ( e ) {\n\t\t\t\t\tvar search = $( this ).val();\n\t\t\t\t\tif ( search === '' ) {\n\t\t\t\t\t\t$( 'li:lt(25)', list ).show();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$( 'li', list ).each( function () {\n\t\t\t\t\t\t\tif ( $( this ).data( 'icon' ).toLowerCase().indexOf( search.toLowerCase() ) !== -1 ) {\n\t\t\t\t\t\t\t\t$( this ).show();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$( this ).hide();\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\n\t\t\t\t$( document ).on( 'mouseup.dashicons-picker', function ( e ) {\n\t\t\t\t\tif ( ! popup.is( e.target ) && popup.has( e.target ).length === 0 ) {\n\t\t\t\t\t\tremovePopup();\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tfunction removePopup() {\n\t\t\t\t$( '.dashicon-picker-container' ).remove();\n\t\t\t\t$( document ).off( '.dashicons-picker' );\n\t\t\t}\n\t\t} );\n\t};\n\n\t$( function () {\n\t\t$( '.dashicons-picker' ).dashiconsPicker();\n\t} );\n\n}( jQuery ) );\n"],"names":["$","fn","dashiconsPicker","icons","each","button","offsetTop","offsetLeft","on","e","currentTarget","offset","top","left","createPopup","target","preview","data","popup","css","list","find","i","hasOwnProperty","append","preventDefault","title","attr","val","change","prop","addClass","removePopup","control","html","length","prependTo","appendTo","show","search","toLowerCase","indexOf","hide","document","is","has","remove","off","jQuery"],"sourceRoot":""} \ No newline at end of file diff --git a/build/dashiconsPicker.min.js b/build/dashiconsPicker.min.js deleted file mode 100644 index b7614a60..00000000 --- a/build/dashiconsPicker.min.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{var m;(m=jQuery).fn.dashiconsPicker=function(){var c=["menu","admin-site","dashboard","admin-media","admin-page","admin-comments","admin-appearance","admin-plugins","admin-users","admin-tools","admin-settings","admin-network","admin-generic","admin-home","admin-collapse","filter","admin-customizer","admin-multisite","admin-links","format-links","admin-post","format-standard","format-image","format-gallery","format-audio","format-video","format-chat","format-status","format-aside","format-quote","welcome-write-blog","welcome-edit-page","welcome-add-page","welcome-view-site","welcome-widgets-menus","welcome-comments","welcome-learn-more","image-crop","image-rotate","image-rotate-left","image-rotate-right","image-flip-vertical","image-flip-horizontal","image-filter","undo","redo","editor-bold","editor-italic","editor-ul","editor-ol","editor-quote","editor-alignleft","editor-aligncenter","editor-alignright","editor-insertmore","editor-spellcheck","editor-distractionfree","editor-expand","editor-contract","editor-kitchensink","editor-underline","editor-justify","editor-textcolor","editor-paste-word","editor-paste-text","editor-removeformatting","editor-video","editor-customchar","editor-outdent","editor-indent","editor-help","editor-strikethrough","editor-unlink","editor-rtl","editor-break","editor-code","editor-paragraph","editor-table","align-left","align-right","align-center","align-none","lock","unlock","calendar","calendar-alt","visibility","hidden","post-status","edit","post-trash","trash","sticky","external","arrow-up","arrow-down","arrow-left","arrow-right","arrow-up-alt","arrow-down-alt","arrow-left-alt","arrow-right-alt","arrow-up-alt2","arrow-down-alt2","arrow-left-alt2","arrow-right-alt2","leftright","sort","randomize","list-view","excerpt-view","grid-view","hammer","art","migrate","performance","universal-access","universal-access-alt","tickets","nametag","clipboard","heart","megaphone","schedule","wordpress","wordpress-alt","pressthis","update","screenoptions","cart","feedback","cloud","translation","tag","category","archive","tagcloud","text","media-archive","media-audio","media-code","media-default","media-document","media-interactive","media-spreadsheet","media-text","media-video","playlist-audio","playlist-video","controls-play","controls-pause","controls-forward","controls-skipforward","controls-back","controls-skipback","controls-repeat","controls-volumeon","controls-volumeoff","yes","no","no-alt","plus","plus-alt","plus-alt2","minus","dismiss","marker","star-filled","star-half","star-empty","flag","info","warning","share","share1","share-alt","share-alt2","twitter","rss","email","email-alt","facebook","facebook-alt","networking","googleplus","location","location-alt","camera","images-alt","images-alt2","video-alt","video-alt2","video-alt3","vault","shield","shield-alt","sos","search","slides","analytics","chart-pie","chart-bar","chart-line","chart-area","groups","businessman","id","id-alt","products","awards","forms","testimonial","portfolio","book","book-alt","download","upload","backup","clock","lightbulb","microphone","desktop","tablet","smartphone","phone","smiley","index-card","carrot","building","store","album","palmtree","tickets-alt","money","thumbs-up","thumbs-down","layout","align-pull-left","align-pull-right","block-default","cloud-saved","cloud-upload","columns","cover-image","embed-audio","embed-generic","embed-photo","embed-post","embed-video","exit","html","info-outline","insert-after","insert-before","insert","remove","shortcode","table-col-after","table-col-before","table-col-delete","table-row-after","table-row-before","table-row-delete","saved","amazon","google","linkedin","pinterest","podio","reddit","spotify","twitch","whatsapp","xing","youtube","database-add","database-export","database-import","database-remove","database-view","database","bell","airplane","car","calculator","games","printer","beer","coffee","drumstick","food","bank","hourglass","money-alt","open-folder","pdf","pets","privacy","superhero","superhero-alt","edit-page","fullscreen-alt","fullscreen-exit-alt"];return this.each(function(){var s,l,n=m(this);function d(){m(".dashicon-picker-container").remove(),m(document).off(".dashicons-picker")}n.on("click.dashiconsPicker",function(e){s=m(e.currentTarget).offset().top,l=m(e.currentTarget).offset().left;var a,e=n,t=m("#menu_icon"),o=m(e.data("preview")),i=m('
        ').css({top:s,left:l}),r=i.find(".dashicon-picker-list");for(a in c)c.hasOwnProperty(a)&&r.append('
      • ');m("a",r).on("click",function(e){e.preventDefault();e=m(this).attr("title");t.val("dashicons-"+e).change(),o.prop("class","dashicons").addClass("dashicons-"+e),d()}),(e=i.find(".dashicon-picker-control")).html(''),m("a",e).on("click",function(e){e.preventDefault(),"back"===m(this).data("direction")?m("li:gt("+(c.length-26)+")",r).prependTo(r):m("li:lt(25)",r).appendTo(r)}),i.appendTo("body").show(),m("input",e).on("keyup",function(e){var a=m(this).val();""===a?m("li:lt(25)",r).show():m("li",r).each(function(){-1!==m(this).data("icon").toLowerCase().indexOf(a.toLowerCase())?m(this).show():m(this).hide()})}),m(document).on("mouseup.dashicons-picker",function(e){i.is(e.target)||0!==i.has(e.target).length||d()})})})},m(function(){m(".dashicons-picker").dashiconsPicker()})})(); \ No newline at end of file diff --git a/build/dashiconsPicker.min.js.map b/build/dashiconsPicker.min.js.map deleted file mode 100644 index e2079cc9..00000000 --- a/build/dashiconsPicker.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["build/dashiconsPicker.js"],"names":["$","jQuery","fn","dashiconsPicker","icons","this","each","offsetTop","offsetLeft","button","removePopup","remove","document","off","on","e","currentTarget","offset","top","left","createPopup","i","target","preview","data","popup","css","list","find","hasOwnProperty","append","preventDefault","title","attr","val","change","prop","addClass","control","html","length","prependTo","appendTo","show","search","toLowerCase","indexOf","hide","is","has"],"mappings":"CAAS,KAOT,IAAWA,GAAAA,EAmFRC,QA5ECC,GAAGC,gBAAkB,WAMrB,IAAIC,EAAQ,CAAC,OAAQ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,CAAC,EACjE7C,EAAEK,IAAI,EAAEsC,KAAK,EAEb3C,EAAEK,IAAI,EAAE0C,KAAK,CAEjB,CAAC,CAEL,CAAC,EACD/C,EAAEY,QAAQ,EAAEE,GAAG,2BAA4B,SAAUC,GAC9CU,EAAMuB,GAAGjC,EAAEO,MAAM,GAAoC,IAA/BG,EAAMwB,IAAIlC,EAAEO,MAAM,EAAEkB,QAC7C9B,EAAY,CAEhB,CAAC,CAlDH,CAAC,CAwDH,CAAC,CACH,EACAV,EAAE,WACAA,EAAE,mBAAmB,EAAEG,gBAAgB,CACzC,CAAC,CAEO,GAAE"} \ No newline at end of file diff --git a/src/js/dashiconsPicker.js b/src/js/dashiconsPicker.js deleted file mode 100644 index 4845e6c8..00000000 --- a/src/js/dashiconsPicker.js +++ /dev/null @@ -1,419 +0,0 @@ -/** - * Dashicons Picker - * - * Based on: https://github.com/bradvin/dashicons-picker/ - */ - - ( function ( $ ) { - 'use strict'; - /** - * - * @returns {void} - */ - $.fn.dashiconsPicker = function () { - - /** - * Dashicons, in CSS order - * - * @type Array - */ - var icons = [ - 'menu', - 'admin-site', - 'dashboard', - 'admin-media', - 'admin-page', - 'admin-comments', - 'admin-appearance', - 'admin-plugins', - 'admin-users', - 'admin-tools', - 'admin-settings', - 'admin-network', - 'admin-generic', - 'admin-home', - 'admin-collapse', - 'filter', - 'admin-customizer', - 'admin-multisite', - 'admin-links', - 'format-links', - 'admin-post', - 'format-standard', - 'format-image', - 'format-gallery', - 'format-audio', - 'format-video', - 'format-chat', - 'format-status', - 'format-aside', - 'format-quote', - 'welcome-write-blog', - 'welcome-edit-page', - 'welcome-add-page', - 'welcome-view-site', - 'welcome-widgets-menus', - 'welcome-comments', - 'welcome-learn-more', - 'image-crop', - 'image-rotate', - 'image-rotate-left', - 'image-rotate-right', - 'image-flip-vertical', - 'image-flip-horizontal', - 'image-filter', - 'undo', - 'redo', - 'editor-bold', - 'editor-italic', - 'editor-ul', - 'editor-ol', - 'editor-quote', - 'editor-alignleft', - 'editor-aligncenter', - 'editor-alignright', - 'editor-insertmore', - 'editor-spellcheck', - 'editor-distractionfree', - 'editor-expand', - 'editor-contract', - 'editor-kitchensink', - 'editor-underline', - 'editor-justify', - 'editor-textcolor', - 'editor-paste-word', - 'editor-paste-text', - 'editor-removeformatting', - 'editor-video', - 'editor-customchar', - 'editor-outdent', - 'editor-indent', - 'editor-help', - 'editor-strikethrough', - 'editor-unlink', - 'editor-rtl', - 'editor-break', - 'editor-code', - 'editor-paragraph', - 'editor-table', - 'align-left', - 'align-right', - 'align-center', - 'align-none', - 'lock', - 'unlock', - 'calendar', - 'calendar-alt', - 'visibility', - 'hidden', - 'post-status', - 'edit', - 'post-trash', - 'trash', - 'sticky', - 'external', - 'arrow-up', - 'arrow-down', - 'arrow-left', - 'arrow-right', - 'arrow-up-alt', - 'arrow-down-alt', - 'arrow-left-alt', - 'arrow-right-alt', - 'arrow-up-alt2', - 'arrow-down-alt2', - 'arrow-left-alt2', - 'arrow-right-alt2', - 'leftright', - 'sort', - 'randomize', - 'list-view', - 'excerpt-view', - 'grid-view', - 'hammer', - 'art', - 'migrate', - 'performance', - 'universal-access', - 'universal-access-alt', - 'tickets', - 'nametag', - 'clipboard', - 'heart', - 'megaphone', - 'schedule', - 'wordpress', - 'wordpress-alt', - 'pressthis', - 'update', - 'screenoptions', - 'cart', - 'feedback', - 'cloud', - 'translation', - 'tag', - 'category', - 'archive', - 'tagcloud', - 'text', - 'media-archive', - 'media-audio', - 'media-code', - 'media-default', - 'media-document', - 'media-interactive', - 'media-spreadsheet', - 'media-text', - 'media-video', - 'playlist-audio', - 'playlist-video', - 'controls-play', - 'controls-pause', - 'controls-forward', - 'controls-skipforward', - 'controls-back', - 'controls-skipback', - 'controls-repeat', - 'controls-volumeon', - 'controls-volumeoff', - 'yes', - 'no', - 'no-alt', - 'plus', - 'plus-alt', - 'plus-alt2', - 'minus', - 'dismiss', - 'marker', - 'star-filled', - 'star-half', - 'star-empty', - 'flag', - 'info', - 'warning', - 'share', - 'share1', - 'share-alt', - 'share-alt2', - 'twitter', - 'rss', - 'email', - 'email-alt', - 'facebook', - 'facebook-alt', - 'networking', - 'googleplus', - 'location', - 'location-alt', - 'camera', - 'images-alt', - 'images-alt2', - 'video-alt', - 'video-alt2', - 'video-alt3', - 'vault', - 'shield', - 'shield-alt', - 'sos', - 'search', - 'slides', - 'analytics', - 'chart-pie', - 'chart-bar', - 'chart-line', - 'chart-area', - 'groups', - 'businessman', - 'id', - 'id-alt', - 'products', - 'awards', - 'forms', - 'testimonial', - 'portfolio', - 'book', - 'book-alt', - 'download', - 'upload', - 'backup', - 'clock', - 'lightbulb', - 'microphone', - 'desktop', - 'tablet', - 'smartphone', - 'phone', - 'smiley', - 'index-card', - 'carrot', - 'building', - 'store', - 'album', - 'palmtree', - 'tickets-alt', - 'money', - 'thumbs-up', - 'thumbs-down', - 'layout', - 'align-pull-left', - 'align-pull-right', - 'block-default', - 'cloud-saved', - 'cloud-upload', - 'columns', - 'cover-image', - 'embed-audio', - 'embed-generic', - 'embed-photo', - 'embed-post', - 'embed-video', - 'exit', - 'html', - 'info-outline', - 'insert-after', - 'insert-before', - 'insert', - 'remove', - 'shortcode', - 'table-col-after', - 'table-col-before', - 'table-col-delete', - 'table-row-after', - 'table-row-before', - 'table-row-delete', - 'saved', - 'amazon', - 'google', - 'linkedin', - 'pinterest', - 'podio', - 'reddit', - 'spotify', - 'twitch', - 'whatsapp', - 'xing', - 'youtube', - 'database-add', - 'database-export', - 'database-import', - 'database-remove', - 'database-view', - 'database', - 'bell', - 'airplane', - 'car', - 'calculator', - 'games', - 'printer', - 'beer', - 'coffee', - 'drumstick', - 'food', - 'bank', - 'hourglass', - 'money-alt', - 'open-folder', - 'pdf', - 'pets', - 'privacy', - 'superhero', - 'superhero-alt', - 'edit-page', - 'fullscreen-alt', - 'fullscreen-exit-alt' - ]; - - return this.each( function () { - - var button = $( this ), - offsetTop, - offsetLeft; - - button.on( 'click.dashiconsPicker', function ( e ) { - offsetTop = $( e.currentTarget ).offset().top; - offsetLeft = $( e.currentTarget ).offset().left; - createPopup( button ); - } ); - - function createPopup( button ) { - - var target = $( '#menu_icon' ), - preview = $( button.data( 'preview' ) ), - popup = $( '
        ' + - '
        ' + - '
          ' + - '
          ' ).css( { - 'top': offsetTop, - 'left': offsetLeft - } ), - list = popup.find( '.dashicon-picker-list' ); - - for ( var i in icons ) { - if ( icons.hasOwnProperty(i) ) { - list.append('
        • '); - } - } - - $( 'a', list ).on( 'click', function ( e ) { - e.preventDefault(); - var title = $( this ).attr( 'title' ); - target.val( 'dashicons-' + title ).change(); - preview - .prop('class', 'dashicons') - .addClass( 'dashicons-' + title ); - removePopup(); - } ); - - var control = popup.find( '.dashicon-picker-control' ); - - control.html( '' + - '' + - '' + - '' - ); - - $( 'a', control ).on( 'click', function ( e ) { - e.preventDefault(); - if ( $( this ).data( 'direction' ) === 'back' ) { - $( 'li:gt(' + ( icons.length - 26 ) + ')', list ).prependTo( list ); - } else { - $( 'li:lt(25)', list ).appendTo( list ); - } - } ); - - popup.appendTo( 'body' ).show(); - - $( 'input', control ).on( 'keyup', function ( e ) { - var search = $( this ).val(); - if ( search === '' ) { - $( 'li:lt(25)', list ).show(); - } else { - $( 'li', list ).each( function () { - if ( $( this ).data( 'icon' ).toLowerCase().indexOf( search.toLowerCase() ) !== -1 ) { - $( this ).show(); - } else { - $( this ).hide(); - } - } ); - } - } ); - - $( document ).on( 'mouseup.dashicons-picker', function ( e ) { - if ( ! popup.is( e.target ) && popup.has( e.target ).length === 0 ) { - removePopup(); - } - } ); - } - - function removePopup() { - $( '.dashicon-picker-container' ).remove(); - $( document ).off( '.dashicons-picker' ); - } - } ); - }; - - $( function () { - $( '.dashicons-picker' ).dashiconsPicker(); - } ); - -}( jQuery ) ); From 5e337ab5e55ebca863003d9d911738163674865f Mon Sep 17 00:00:00 2001 From: Michael Beckwith Date: Tue, 30 Dec 2025 16:17:44 -0600 Subject: [PATCH 08/14] fresh build --- build/cptui.asset.php | 2 +- build/cptui.js | 124 +-- build/cptui.js.map | 2 +- build/cptui.min.js | 2 +- build/cptui.min.js.map | 2 +- build/dashicons.json | 926 ++++++++++++++++++ build/vanilla-icon-picker/LICENSE | 21 + build/vanilla-icon-picker/README.md | 194 ++++ .../dist/icon-picker.min.js | 3 + .../dist/icon-picker.min.map | 1 + .../dist/themes/bootstrap-5.min.css | 2 + .../dist/themes/default.min.css | 10 + 12 files changed, 1229 insertions(+), 60 deletions(-) create mode 100644 build/dashicons.json create mode 100644 build/vanilla-icon-picker/LICENSE create mode 100644 build/vanilla-icon-picker/README.md create mode 100644 build/vanilla-icon-picker/dist/icon-picker.min.js create mode 100644 build/vanilla-icon-picker/dist/icon-picker.min.map create mode 100644 build/vanilla-icon-picker/dist/themes/bootstrap-5.min.css create mode 100644 build/vanilla-icon-picker/dist/themes/default.min.css diff --git a/build/cptui.asset.php b/build/cptui.asset.php index 17e77397..bdb6abd5 100644 --- a/build/cptui.asset.php +++ b/build/cptui.asset.php @@ -1 +1 @@ - array(), 'version' => 'd000a5c9efc720ffeec4'); + array(), 'version' => 'd92f9759d0b19aeb5789'); diff --git a/build/cptui.js b/build/cptui.js index ab9169af..98ec97f7 100644 --- a/build/cptui.js +++ b/build/cptui.js @@ -303,6 +303,72 @@ postboxes.add_postbox_toggles(pagenow); /***/ }), +/***/ 698: +/***/ (() => { + + + +/* + * This file handles setting the menu icon preview for a given post type. + */ +(() => { + let _custom_media; + let _orig_send_attachment; + if (undefined !== wp.media) { + _custom_media = true; + _orig_send_attachment = wp.media.editor.send.attachment; + } + + // Trigger the modal and load our icons. + const icons = cptuiIconPicker.iconsJSON; + const iconPicker = new IconPicker('#cptui_choose_dashicon', { + theme: 'default', + iconSource: [{ + key: 'dashicons', + prefix: 'dashicons-', + url: icons + }], + closeOnSelect: true + }); + const menuIconField = document.querySelector('#menu_icon'); + const menuIconPreview = document.querySelector('#menu_icon_preview'); + const regIcon = document.querySelector('#cptui_choose_icon'); + const dashIcon = document.querySelector('#cptui_choose_dashicon'); + const origText = dashIcon.value; + iconPicker.on('select', icon => { + menuIconField.value = icon.value; + menuIconPreview.innerHTML = ''; + let div = document.createElement('div'); + div.classList.add('dashicons', icon.value); + menuIconPreview.insertAdjacentElement('afterbegin', div); + }); + iconPicker.on('hide', () => { + dashIcon.value = origText; + }); + if (regIcon) { + regIcon.addEventListener('click', e => { + e.preventDefault(); + let button = e.currentTarget; + _custom_media = true; + wp.media.editor.send.attachment = function (props, attachment) { + if (_custom_media) { + menuIconField.value = attachment.url; + menuIconPreview.innerHTML = ''; + let img = document.createElement('img'); + img.src = attachment.url; + menuIconPreview.insertAdjacentElement('afterbegin', img); + } else { + return _orig_send_attachment.apply(this, [props, attachment]); + } + }; + wp.media.editor.open(button); + return false; + }); + } +})(); + +/***/ }), + /***/ 706: /***/ (() => { @@ -661,60 +727,8 @@ var support_toggles = __webpack_require__(194); }); } })(); -;// ./src/js/partials/menu-icon.js - - - - -/* - * This file handles setting the menu icon preview for a given post type. - * - * @todo Finish converting away from jQuery. - */ - -($ => { - let _custom_media; - let _orig_send_attachment; - if (undefined !== wp.media) { - _custom_media = true; - _orig_send_attachment = wp.media.editor.send.attachment; - } - $('#cptui_choose_icon').on('click', function (e) { - e.preventDefault(); - let button = $(this); - let id = jQuery('#menu_icon').attr('id'); - _custom_media = true; - wp.media.editor.send.attachment = function (props, attachment) { - if (_custom_media) { - $("#" + id).val(attachment.url).change(); - } else { - return _orig_send_attachment.apply(this, [props, attachment]); - } - }; - wp.media.editor.open(button); - return false; - }); - - // NOT DONE - /*const menuIcon = document.querySelector('#menu_icon'); - if (menuIcon) { - menuIcon.addEventListener('input', (e) => { - let value = e.currentTarget.value.trim(); - console.log(value); - let menuIconPreview = document.querySelector('#menu_icon_preview'); - console.log(menuIconPreview); - if (menuIconPreview) { - console.log(composePreviewContent(value)); - menuIconPreview.innerHTML = composePreviewContent(value); - } - }); - }*/ - $('#menu_icon').on('change', function () { - var value = $(this).val(); - value = value.trim(); - $('#menu_icon_preview').html(composePreviewContent(value)); - }); -})(jQuery); +// EXTERNAL MODULE: ./src/js/partials/menu-icon.js +var menu_icon = __webpack_require__(698); // EXTERNAL MODULE: ./src/js/partials/tax-required-post-type.js var tax_required_post_type = __webpack_require__(376); // EXTERNAL MODULE: ./src/js/partials/autopopulate.js @@ -736,8 +750,6 @@ var toggle_panels = __webpack_require__(213); - -//import './dashicons-picker'; /******/ })() ; //# sourceMappingURL=cptui.js.map \ No newline at end of file diff --git a/build/cptui.js.map b/build/cptui.js.map index 71878773..f2bb6ffa 100644 --- a/build/cptui.js.map +++ b/build/cptui.js.map @@ -1 +1 @@ -{"version":3,"file":"cptui.js","mappings":";;;;;;;AAAa;;AAEb;AACA;AACA;AACA;AACA;AAEA,CAAC,MAAM;EACP;EACC,MAAMA,gBAAgB,GAAGC,QAAQ,CAACC,gBAAgB,CAAC,oBAAoB,CAAC;EACxEC,KAAK,CAACC,IAAI,CAACJ,gBAAgB,CAAC,CAACK,OAAO,CAAC,UAAUC,QAAQ,EAAEC,KAAK,EAAE;IAC/D,IAAIC,IAAI,GAAG,SAAAA,CAAUC,IAAI,EAAEC,QAAQ,EAAE;MACpC,IAAIC,QAAQ,GAAGF,IAAI,CAACG,kBAAkB;MAEtC,IAAI,CAACF,QAAQ,EAAE;QACd,OAAOC,QAAQ;MAChB;MAEA,IAAIA,QAAQ,IAAIA,QAAQ,CAACE,OAAO,CAACH,QAAQ,CAAC,EAAE;QAC3C,OAAOC,QAAQ;MAChB;MAEA,OAAO,IAAI;IACZ,CAAC;IAED,IAAIG,KAAK,GAAG,KAAK;IACjB,IAAIC,MAAM,GAAGP,IAAI,CAACF,QAAQ,EAAE,KAAK,CAAC;IAClCS,MAAM,CAACC,KAAK,CAACC,OAAO,GAAG,MAAM;IAE7B,CAAC,OAAO,EAAE,SAAS,CAAC,CAACZ,OAAO,CAAEa,QAAQ,IAAK;MAC1CZ,QAAQ,CAACa,gBAAgB,CAACD,QAAQ,EAAGE,CAAC,IAAK;QA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AC,IAAI,CAAC;IACxCV,aAAa,GAAG,IAAI;IACpBG,EAAE,CAACC,KAAK,CAACC,MAAM,CAACC,IAAI,CAACC,UAAU,GAAG,UAAUI,KAAK,EAAEJ,UAAU,EAAE;MAC9D,IAAIP,aAAa,EAAE;QAClB5G,CAAC,CAAC,GAAG,GAAGqH,EAAE,CAAC,CAACG,GAAG,CAACL,UAAU,CAACtD,GAAG,CAAC,CAAC4D,MAAM,CAAC,CAAC;MACzC,CAAC,MAAM;QACN,OAAOZ,qBAAqB,CAACa,KAAK,CAAC,IAAI,EAAE,CAACH,KAAK,EAAEJ,UAAU,CAAC,CAAC;MAC9D;IACD,CAAC;IAEDJ,EAAE,CAACC,KAAK,CAACC,MAAM,CAACU,IAAI,CAACP,MAAM,CAAC;IAC5B,OAAO,KAAK;EACb,CAAC,CAAC;;EAEF;EACA;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACCpH,CAAC,CAAC,YAAY,CAAC,CAACC,EAAE,CAAC,QAAQ,EAAE,YAAY;IACxC,IAAI0B,KAAK,GAAG3B,CAAC,CAAC,IAAI,CAAC,CAACwH,GAAG,CAAC,CAAC;IACzB7F,KAAK,GAAGA,KAAK,CAACiG,IAAI,CAAC,CAAC;IACpB5H,CAAC,CAAC,oBAAoB,CAAC,CAAC6H,IAAI,CAAC5C,qBAAqB,CAACtD,KAAK,CAAC,CAAC;EAC3D,CAAC,CAAC;AACH,CAAC,EAAEb,MAAM,CAAC;;;;;;;;;;ACxDgB;AACM;AACQ;AACT;AACI;AACC;AACN;AACA;AACa;AACV;AACD;AACE;;AAElC,8B","sources":["webpack://custom-post-type-ui/./src/js/partials/support-toggles.js","webpack://custom-post-type-ui/./src/js/partials/toggle-panels.js","webpack://custom-post-type-ui/./src/js/partials/confirm-delete.js","webpack://custom-post-type-ui/./src/js/partials/tax-required-post-type.js","webpack://custom-post-type-ui/./src/js/partials/autopopulate.js","webpack://custom-post-type-ui/./src/js/partials/toggle-hierarchical.js","webpack://custom-post-type-ui/./src/js/partials/autoswitch.js","webpack://custom-post-type-ui/./src/js/partials/hide-submit.js","webpack://custom-post-type-ui/./src/js/partials/back-to-top.js","webpack://custom-post-type-ui/webpack/bootstrap","webpack://custom-post-type-ui/./src/js/partials/utils.js","webpack://custom-post-type-ui/./src/js/partials/namefield.js","webpack://custom-post-type-ui/./src/js/partials/menu-icon.js","webpack://custom-post-type-ui/./src/js/cptui.js"],"sourcesContent":["'use strict';\n\n/*\n * This file handles accordian behavior on the Supports page with the various question/answer panels.\n *\n * The functionality includes keyboard and accessibility functionality to help those who need it.\n */\n\n(() => {\n// Toggles help/support accordions.\n\tconst supportQuestions = document.querySelectorAll('#support .question');\n\tArray.from(supportQuestions).forEach(function (question, index) {\n\t\tlet next = function (elem, selector) {\n\t\t\tlet nextElem = elem.nextElementSibling;\n\n\t\t\tif (!selector) {\n\t\t\t\treturn nextElem;\n\t\t\t}\n\n\t\t\tif (nextElem && nextElem.matches(selector)) {\n\t\t\t\treturn nextElem;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t};\n\n\t\tlet state = false;\n\t\tlet answer = next(question, 'div');\n\t\tanswer.style.display = 'none';\n\n\t\t['click', 'keydown'].forEach((theEvent) => {\n\t\t\tquestion.addEventListener(theEvent, (e) => {\n\t\t\t\t// Helps with accessibility and keyboard navigation.\n\t\t\t\tlet keys = ['Space', 'Enter'];\n\t\t\t\tif (e.type === 'keydown' && !keys.includes(e.code)) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\te.preventDefault();\n\t\t\t\tstate = !state;\n\t\t\t\tanswer.style.display = state ? 'block' : 'none';\n\t\t\t\te.currentTarget.classList.toggle('active')\n\t\t\t\te.currentTarget.setAttribute('aria-expanded', state.toString());\n\t\t\t\te.currentTarget.focus();\n\t\t\t});\n\t\t});\n\t});\n})();\n","'use strict';\n\n/*\n * This file handles storing the panel state for the post type and taxonomy edit screens.\n *\n * The open/closed state gets stored into localstorage and is remembered on future page refreshes.\n */\n\npostboxes.add_postbox_toggles(pagenow);\n\n(() => {\n\t// Toggle Panels State.\n\t// @todo. Localize the list of panel selectors so that we can filter in the CPTUI-Extended panel without hardcoding here.\n\tconst all_panels = [\"#cptui_panel_pt_basic_settings\", \"#cptui_panel_pt_additional_labels\", \"#cptui_panel_pt_advanced_settings\", \"#cptui_panel_tax_basic_settings\", \"#cptui_panel_tax_additional_labels\", \"#cptui_panel_tax_advanced_settings\"];\n\tall_panels.forEach((element, index) => {\n\t\tconst panel_id_item = document.querySelector(element);\n\t\tif (panel_id_item) {\n\t\t\tconst panel_id = panel_id_item.getAttribute('id');\n\t\t\tconst panel = document.querySelector('#' + panel_id);\n\n\t\t\t// check default state on page load\n\t\t\tif (!localStorage.getItem(panel_id) || localStorage.getItem(panel_id) === null) {\n\t\t\t\tpanel.classList.remove('closed');\n\t\t\t} else {\n\t\t\t\tpanel.classList.add('closed');\n\t\t\t}\n\n\t\t\tconst postbox = panel_id_item.querySelectorAll('.postbox-header');\n\t\t\tArray.from(postbox).forEach((el, i) => {\n\t\t\t\tel.addEventListener('click', (e) => {\n\t\t\t\t\tif (!localStorage.getItem(panel_id)) {\n\t\t\t\t\t\tlocalStorage.setItem(panel_id, '1');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlocalStorage.removeItem(panel_id);\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t});\n\t\t}\n\t});\n})();\n\n\n","'use strict';\n\n/*\n * This file handles confirming the deletion of a content type before continuing.\n *\n * @todo Finish converting away from jQuery.\n */\n\n(($) => {\n\t// NOT DONE\n\t/*['.cptui-delete-top', '.cptui-delete-bottom'].forEach( (element,index) => {\n\t\tlet theDialog = document.querySelector('#cptui-content-type-delete');\n\t\tlet theelement = document.querySelector(element);\n\t\ttheelement.addEventListener('click', async (e) => {\n\t\t\te.preventDefault();\n\t\t\tconst doPerformAction = await confirm();\n\t\t\tif ( doPerformAction ) {\n\t\t\t\tlet thing = document.querySelector('#cpt_submit_delete');\n\t\t\t\tconsole.log(thing);\n\t\t\t\tthing.click();\n\t\t\t\tthing.submit();\n\t\t\t\ttheDialog.close();\n\t\t\t} else {\n\t\t\t\ttheDialog.close();\n\t\t\t}\n\t\t});\n\t});\n\n\tlet closeBtnConfirm = document.querySelector('.cptui-confirm-deny-delete button');\n\tlet closeBtnDeny = document.querySelector('#cptui-content-type-deny-delete');\n\tfunction confirm() {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tdocument.querySelector('#cptui-content-type-delete').showModal();\n\t\t\tcloseBtnConfirm.focus();\n\n\t\t\tcloseBtnConfirm.addEventListener(\"click\", () => {\n\t\t\t\tresolve(true);\n\t\t\t\tdocument.querySelector('#cptui-content-type-delete').close()\n\t\t\t});\n\t\t\tcloseBtnDeny.addEventListener(\"click\", () => {\n\t\t\t\tresolve(false);\n\t\t\t\tdocument.querySelector('#cptui-content-type-delete').close()\n\t\t\t});\n\t\t});\n\t}*/\n\n\t// Confirm our deletions\n\t$('.cptui-delete-top, .cptui-delete-bottom').on('click', function (e) {\n\t\te.preventDefault();\n\t\tlet msg = '';\n\t\tif (typeof cptui_type_data !== 'undefined') {\n\t\t\tmsg = cptui_type_data.confirm;\n\t\t} else if (typeof cptui_tax_data !== 'undefined') {\n\t\t\tmsg = cptui_tax_data.confirm;\n\t\t}\n\t\tlet submit_delete_warning = $('
          ' + msg + '
          ').appendTo('#poststuff').dialog({\n\t\t\t'dialogClass': 'wp-dialog',\n\t\t\t'modal' : true,\n\t\t\t'autoOpen' : true,\n\t\t\t'buttons' : {\n\t\t\t\t\"OK\" : function () {\n\t\t\t\t\t$(this).dialog('close');\n\t\t\t\t\t$(e.target).off('click').click();\n\t\t\t\t},\n\t\t\t\t\"Cancel\": function () {\n\t\t\t\t\t$(this).dialog('close');\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n})(jQuery);\n","'use strict';\n\n/*\n * This file provides a dialog box to alert the user that at least one post type must be chosen\n * before they can save a taxonomy.\n *\n * This was added because taxonomies need to have a post type, meanwhile post types do NOT need\n * to have a taxonomy.\n */\n\n(() => {\n\t// Handles checking if a post type has been chosen or not when adding/saving a taxonomy.\n\t// Post type associations are a required attribute.\n\tconst taxSubmit = document.querySelectorAll('.cptui-taxonomy-submit');\n\tconst taxSubmitSelectCPTDialog = document.querySelector('#cptui-select-post-type-confirm');\n\tArray.from(taxSubmit).forEach((element, i) => {\n\t\telement.addEventListener('click', (e) => {\n\t\t\t// putting inside event listener to check every time clicked. Defining outside lost re-checking.\n\t\t\tlet taxCPTChecked = document.querySelectorAll('#cptui_panel_tax_basic_settings input[type=\"checkbox\"]:checked');\n\t\t\tif (taxCPTChecked.length === 0) {\n\t\t\t\te.preventDefault();\n\t\t\t\ttaxSubmitSelectCPTDialog.showModal();\n\t\t\t}\n\t\t});\n\t});\n\tlet taxSubmitSelectCPTConfirmCloseBtn = document.querySelector('#cptui-select-post-type-confirm-close');\n\tif (taxSubmitSelectCPTConfirmCloseBtn) {\n\t\ttaxSubmitSelectCPTConfirmCloseBtn.addEventListener('click', (e) => {\n\t\t\te.preventDefault();\n\t\t\ttaxSubmitSelectCPTDialog.close();\n\t\t});\n\t}\n})();\n","'use strict';\n\n/*\n * This file handles the automatic population as well as the automatic clearing of the label\n * fields, based on the provided singular and plural label values.\n */\n\n(() => {\n\tlet nameField = document.querySelector('#name');\n\tlet autoPopulate = document.querySelector('#auto-populate');\n\n\tconst autoLabels = document.querySelector('#autolabels');\n\tif (autoLabels) {\n\t\tautoLabels.style.display = 'table-row';\n\t}\n\n\tif (autoPopulate) {\n\t\t['click', 'tap'].forEach((eventName, index) => {\n\t\t\tautoPopulate.addEventListener(eventName, (e) => {\n\t\t\t\te.preventDefault();\n\n\t\t\t\tlet slug = nameField.value;\n\t\t\t\tlet plural = document.querySelector('#label').value;\n\t\t\t\tlet singular = document.querySelector('#singular_label').value;\n\t\t\t\tlet fields = document.querySelectorAll('.cptui-labels input[type=\"text\"]');\n\n\t\t\t\tif ('' === slug) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ('' === plural) {\n\t\t\t\t\tplural = slug;\n\t\t\t\t}\n\n\t\t\t\tif ('' === singular) {\n\t\t\t\t\tsingular = slug;\n\t\t\t\t}\n\n\t\t\t\tArray.from(fields).forEach(field => {\n\t\t\t\t\tlet newval = field.getAttribute('data-label');\n\t\t\t\t\tlet plurality = field.getAttribute('data-plurality');\n\t\t\t\t\tif (typeof newval !== 'undefined') {\n\t\t\t\t\t\t// \"slug\" is our placeholder from the labels.\n\t\t\t\t\t\tif ('plural' === plurality) {\n\t\t\t\t\t\t\tnewval = newval.replace(/item/gi, plural);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// using an else statement because we do not\n\t\t\t\t\t\t\t// want to mutate the original string by default.\n\t\t\t\t\t\t\tnewval = newval.replace(/item/gi, singular);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (field.value === '') {\n\t\t\t\t\t\t\tfield.value = newval;\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\n\tlet autoClear = document.querySelector('#auto-clear');\n\tif (autoClear) {\n\t\t['click', 'tap'].forEach((eventName, index) => {\n\t\t\tautoClear.addEventListener(eventName, (e) => {\n\t\t\t\te.preventDefault();\n\n\t\t\t\tconst fields = document.querySelectorAll('.cptui-labels input[type=\"text\"]');\n\t\t\t\tArray.from(fields).forEach(field => {\n\t\t\t\t\tfield.value = '';\n\t\t\t\t});\n\t\t\t})\n\t\t});\n\t}\n})();\n","'use strict';\n\n/*\n * This file handles automatically toggling the \"Page attributes\" option in the \"Supports\" section\n * when a user chooses to have their post type be hierarchical.\n *\n * The purpose is to help ensure that the \"parent\" and \"template\" metabox option shows up by default,\n * but we do not force that to remain checked. The user can still toggle it off after the fact.\n */\n\n(() => {\n\t// Automatically toggle the \"page attributes\" checkbox if\n\t// setting a hierarchical post type.\n\tconst hierarchicalSetting = document.querySelector('#hierarchical');\n\tif (hierarchicalSetting) {\n\t\thierarchicalSetting.addEventListener('change', (e) => {\n\t\t\tlet pageAttributesCheck = document.querySelector('#page-attributes');\n\t\t\tif (e.currentTarget && e.currentTarget.value === '1') {\n\t\t\t\tpageAttributesCheck.checked = true;\n\t\t\t} else {\n\t\t\t\tpageAttributesCheck.checked = false;\n\t\t\t}\n\t\t});\n\t}\n})();\n","'use strict';\n\n/*\n * This file handles automatically switching to a chosen content type when selecting from the\n * dropdown listing.\n */\n\n(() => {\n\t// Switch to newly selected post type or taxonomy automatically.\n\tconst postTypeDropdown = document.querySelector('#post_type');\n\tconst taxonomyDropdown = document.querySelector('#taxonomy');\n\n\tif (postTypeDropdown) {\n\t\tpostTypeDropdown.addEventListener('change', () => {\n\t\t\tconst postTypeSelectPostType = document.querySelector('#cptui_select_post_type');\n\t\t\tif (postTypeSelectPostType) {\n\t\t\t\tpostTypeSelectPostType.submit();\n\t\t\t}\n\t\t})\n\t}\n\tif (taxonomyDropdown) {\n\t\ttaxonomyDropdown.addEventListener('change', () => {\n\t\t\tconst taxonomySelectPostType = document.querySelector('#cptui_select_taxonomy');\n\t\t\tif (taxonomySelectPostType) {\n\t\t\t\ttaxonomySelectPostType.submit();\n\t\t\t}\n\t\t})\n\t}\n})();\n","'use strict';\n\n/*\n * This file visually removes the submit button to change content type being edited.\n *\n * If by chance javascript is disabled or somehow breaking, the button would show by default,\n * preventing issues with switching content types.\n */\n\n(() => {\n\tconst cptSelectSubmit = document.querySelector('#cptui_select_post_type_submit');\n\tif (cptSelectSubmit) {\n\t\tcptSelectSubmit.style.display = 'none';\n\t}\n\tconst taxSelectSubmit = document.querySelector('#cptui_select_taxonomy_submit');\n\tif (taxSelectSubmit) {\n\t\ttaxSelectSubmit.style.display = 'none';\n\t}\n})();\n","'use strict';\n\n/*\n * This file handles the back to top functionality as the user scrolls, for quick return to top.\n *\n * This includes some debouncing to prevent excessive scroll event listening.\n */\n\n(() => {\n\tconst back_to_top_btn = document.querySelector('.cptui-back-to-top');\n\tif (back_to_top_btn) {\n\t\tdocument.addEventListener('scroll', () => {\n\t\t\tcptuiDebounce(backToTop, 500);\n\t\t});\n\n\t\tback_to_top_btn.addEventListener('click', (e) => {\n\t\t\te.preventDefault();\n\t\t\twindow.scrollTo({\n\t\t\t\ttop : 0,\n\t\t\t\tbehavior: \"smooth\"\n\t\t\t})\n\t\t});\n\t}\n\n\tfunction backToTop() {\n\t\tif (window.scrollY > 300) {\n\t\t\tback_to_top_btn.classList.add('show');\n\t\t} else {\n\t\t\tback_to_top_btn.classList.remove('show');\n\t\t}\n\t}\n\n\tfunction cptuiDebounce(method, delay) {\n\t\tclearTimeout(method._tId);\n\t\tmethod._tId = setTimeout(function () {\n\t\t\tmethod();\n\t\t}, delay);\n\t}\n})();\n","// 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","'use strict';\n\n// Retrieve URL parameters by requested parameter name.\nexport function getParameterByName(name, url) {\n\tif (!url) url = window.location.href;\n\tname = name.replace(/[\\[\\]]/g, \"\\\\$&\");\n\tconst regex = new RegExp(\"[?&]\" + name + \"(=([^&#]*)|&|#|$)\"),\n\t\tresults = regex.exec(url);\n\tif (!results) return null;\n\tif (!results[2]) return '';\n\treturn decodeURIComponent(results[2].replace(/\\+/g, \" \"));\n}\n\n// Split, translate cyrillic characters, and then re-join the final result.\nexport function transliterate(word) {\n\treturn word.split('').map(function (char) {\n\t\treturn cyrillic[char] || char;\n\t}).join(\"\");\n}\n\n//Character encode special characters.\nexport function htmlEncode(str) {\n\treturn String(str).replace(/[^-\\w. ]/gi, function (c) {\n\t\treturn '&#' + c.charCodeAt(0) + ';';\n\t});\n}\n\n// Constructs miniture versions of uploaded media for admnin menu icon usage,\n// or displays the rendered dashicon.\nexport function composePreviewContent(value) {\n\tconst re = /(http|https):\\/\\/[\\w-]+(\\.[\\w-]+)+([\\w.,@?^=%&:\\/~+#-]*[\\w@?^=%&\\/~+#-])?/;\n\tconst isURL = re.test(value);\n\n\tif (!value) {\n\t\treturn '';\n\t} else if (0 === value.indexOf('dashicons-')) {\n\t\tconst dashDiv = document.createElement('div');\n\t\tdashDiv.classList.add('dashicons-before');\n\t\tdashDiv.innerHTML = '
          ';\n\t\tdashDiv.classList.add(htmlEncode(value));\n\t\treturn dashDiv;\n\t} else if (isURL) {\n\t\tconst imgsrc = encodeURI(value);\n\t\tconst theimg = document.createElement('IMG');\n\t\ttheimg.src = imgsrc;\n\t\treturn theimg;\n\t}\n}\n\n// Replace diacritic characters with latin characters.\nexport function replaceDiacritics(s) {\n\tconst diacritics = [\n\t\t/[\\300-\\306]/g, /[\\340-\\346]/g, // A, a\n\t\t/[\\310-\\313]/g, /[\\350-\\353]/g, // E, e\n\t\t/[\\314-\\317]/g, /[\\354-\\357]/g, // I, i\n\t\t/[\\322-\\330]/g, /[\\362-\\370]/g, // O, o\n\t\t/[\\331-\\334]/g, /[\\371-\\374]/g, // U, u\n\t\t/[\\321]/g, /[\\361]/g, // N, n\n\t\t/[\\307]/g, /[\\347]/g // C, c\n\t];\n\n\tlet chars = ['A', 'a', 'E', 'e', 'I', 'i', 'O', 'o', 'U', 'u', 'N', 'n', 'C', 'c'];\n\n\tfor (let i = 0; i < diacritics.length; i++) {\n\t\ts = s.replace(diacritics[i], chars[i]);\n\t}\n\n\treturn s;\n}\n\n// Converts non-alphanumeric or space characters to an underscore. Should ignore dashes, to allow\n// using dashes in slugs.\nexport function replaceSpecialCharacters(s) {\n\ts = s.replace(/[^a-z0-9\\s-]/gi, '_');\n\treturn s;\n}\n\n// List of available cyrillic characters and the value to translate to.\nexport const cyrillic = {\n\t\"Ё\": \"YO\",\n\t\"Й\": \"I\",\n\t\"Ц\": \"TS\",\n\t\"У\": \"U\",\n\t\"К\": \"K\",\n\t\"Е\": \"E\",\n\t\"Н\": \"N\",\n\t\"Г\": \"G\",\n\t\"Ш\": \"SH\",\n\t\"Щ\": \"SCH\",\n\t\"З\": \"Z\",\n\t\"Х\": \"H\",\n\t\"Ъ\": \"'\",\n\t\"ё\": \"yo\",\n\t\"й\": \"i\",\n\t\"ц\": \"ts\",\n\t\"у\": \"u\",\n\t\"к\": \"k\",\n\t\"е\": \"e\",\n\t\"н\": \"n\",\n\t\"г\": \"g\",\n\t\"ш\": \"sh\",\n\t\"щ\": \"sch\",\n\t\"з\": \"z\",\n\t\"х\": \"h\",\n\t\"ъ\": \"'\",\n\t\"Ф\": \"F\",\n\t\"Ы\": \"I\",\n\t\"В\": \"V\",\n\t\"А\": \"a\",\n\t\"П\": \"P\",\n\t\"Р\": \"R\",\n\t\"О\": \"O\",\n\t\"Л\": \"L\",\n\t\"Д\": \"D\",\n\t\"Ж\": \"ZH\",\n\t\"Э\": \"E\",\n\t\"ф\": \"f\",\n\t\"ы\": \"i\",\n\t\"в\": \"v\",\n\t\"а\": \"a\",\n\t\"п\": \"p\",\n\t\"р\": \"r\",\n\t\"о\": \"o\",\n\t\"л\": \"l\",\n\t\"д\": \"d\",\n\t\"ж\": \"zh\",\n\t\"э\": \"e\",\n\t\"Я\": \"Ya\",\n\t\"Ч\": \"CH\",\n\t\"С\": \"S\",\n\t\"М\": \"M\",\n\t\"И\": \"I\",\n\t\"Т\": \"T\",\n\t\"Ь\": \"'\",\n\t\"Б\": \"B\",\n\t\"Ю\": \"YU\",\n\t\"я\": \"ya\",\n\t\"ч\": \"ch\",\n\t\"с\": \"s\",\n\t\"м\": \"m\",\n\t\"и\": \"i\",\n\t\"т\": \"t\",\n\t\"ь\": \"'\",\n\t\"б\": \"b\",\n\t\"ю\": \"yu\"\n};\n","'use strict';\nimport { getParameterByName, replaceDiacritics, transliterate, replaceSpecialCharacters } from './utils'\n\n/*\n * This file handles all of the normalization of the name/slug field for a post type\n * or taxonomy being registered.\n *\n * That way we are only allowing latin characters and dashes/underscores.\n *\n * It also shows a hidden alert if the slug has been changed in some way when editing an existing\n * content type.\n *\n * Lastly it will also show a warning if the attempted slug has already been registered elsewhere,\n * to help avoid clashes. The only exception is if the checkbox is checked indicating that the user\n * is trying to convert TO using CPTUI, and the conflicting slug elsewhere will be removed soon.\n */\n\n(() => {\n\tlet nameField = document.querySelector('#name');\n\tlet original_slug;\n\n\tif ('edit' === getParameterByName('action')) {\n\t\tif (nameField) {\n\t\t\t// Store our original slug on page load for edit checking.\n\t\t\toriginal_slug = nameField.value;\n\t\t}\n\t}\n\n\tif (nameField) {\n\t\t// Switch spaces for underscores on our slug fields.\n\t\tnameField.addEventListener('keyup', (e) => {\n\t\t\tlet value, original_value;\n\n\t\t\tvalue = original_value = e.currentTarget.value;\n\t\t\tlet keys = ['Tab', 'ArrowLeft', 'ArrowUp', 'ArrowRight', 'ArrowDown'];\n\t\t\tif (!keys.includes(e.code)) {\n\t\t\t\tvalue = value.replace(/ /g, \"_\");\n\t\t\t\tvalue = value.toLowerCase();\n\t\t\t\tvalue = replaceDiacritics(value);\n\t\t\t\tvalue = transliterate(value);\n\t\t\t\tvalue = replaceSpecialCharacters(value);\n\t\t\t\tif (value !== original_value) {\n\t\t\t\t\te.currentTarget.value = value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//Displays a message if slug changes.\n\t\t\tif (typeof original_slug !== 'undefined') {\n\t\t\t\tlet slugchanged = document.querySelector('#slugchanged');\n\t\t\t\tif (value !== original_slug) {\n\t\t\t\t\tslugchanged.classList.remove('hidemessage');\n\t\t\t\t} else {\n\t\t\t\t\tslugchanged.classList.add('hidemessage');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet slugexists = document.querySelector('#slugexists');\n\t\t\tlet override = document.querySelector('#override_validation');\n\t\t\tlet override_validation = (override) ? override.checked : false;\n\t\t\tif (typeof cptui_type_data != 'undefined') {\n\t\t\t\tif (cptui_type_data.existing_post_types.hasOwnProperty(value) && value !== original_slug && override_validation === false) {\n\t\t\t\t\tslugexists.classList.remove('hidemessage');\n\t\t\t\t} else {\n\t\t\t\t\tslugexists.classList.add('hidemessage');\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (typeof cptui_tax_data != 'undefined') {\n\t\t\t\tif (cptui_tax_data.existing_taxonomies.hasOwnProperty(value) && value !== original_slug) {\n\t\t\t\t\tslugexists.classList.remove('hidemessage');\n\t\t\t\t} else {\n\t\t\t\t\tslugexists.classList.add('hidemessage');\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n})();\n","'use strict';\n\nimport {composePreviewContent} from './utils';\n\n/*\n * This file handles setting the menu icon preview for a given post type.\n *\n * @todo Finish converting away from jQuery.\n */\n\n(($) => {\n\tlet _custom_media;\n\tlet _orig_send_attachment;\n\n\tif (undefined !== wp.media) {\n\t\t_custom_media = true;\n\t\t_orig_send_attachment = wp.media.editor.send.attachment;\n\t}\n\n\t$('#cptui_choose_icon').on('click', function (e) {\n\t\te.preventDefault();\n\n\t\tlet button = $(this);\n\t\tlet id = jQuery('#menu_icon').attr('id');\n\t\t_custom_media = true;\n\t\twp.media.editor.send.attachment = function (props, attachment) {\n\t\t\tif (_custom_media) {\n\t\t\t\t$(\"#\" + id).val(attachment.url).change();\n\t\t\t} else {\n\t\t\t\treturn _orig_send_attachment.apply(this, [props, attachment]);\n\t\t\t}\n\t\t};\n\n\t\twp.media.editor.open(button);\n\t\treturn false;\n\t});\n\n\t// NOT DONE\n\t/*const menuIcon = document.querySelector('#menu_icon');\n\tif (menuIcon) {\n\t\tmenuIcon.addEventListener('input', (e) => {\n\t\t\tlet value = e.currentTarget.value.trim();\n\t\t\tconsole.log(value);\n\t\t\tlet menuIconPreview = document.querySelector('#menu_icon_preview');\n\t\t\tconsole.log(menuIconPreview);\n\t\t\tif (menuIconPreview) {\n\t\t\t\tconsole.log(composePreviewContent(value));\n\t\t\t\tmenuIconPreview.innerHTML = composePreviewContent(value);\n\t\t\t}\n\t\t});\n\t}*/\n\t$('#menu_icon').on('change', function () {\n\t\tvar value = $(this).val();\n\t\tvalue = value.trim();\n\t\t$('#menu_icon_preview').html(composePreviewContent(value));\n\t});\n})(jQuery);\n","import './partials/utils';\nimport './partials/hide-submit';\nimport './partials/toggle-hierarchical';\nimport './partials/autoswitch';\nimport './partials/confirm-delete';\nimport './partials/support-toggles';\nimport './partials/namefield';\nimport './partials/menu-icon';\nimport './partials/tax-required-post-type';\nimport './partials/autopopulate';\nimport './partials/back-to-top';\nimport './partials/toggle-panels';\n\n//import './dashicons-picker';\n"],"names":["supportQuestions","document","querySelectorAll","Array","from","forEach","question","index","next","elem","selector","nextElem","nextElementSibling","matches","state","answer","style","display","theEvent","addEventListener","e","keys","type","includes","code","preventDefault","currentTarget","classList","toggle","setAttribute","toString","focus","postboxes","add_postbox_toggles","pagenow","all_panels","element","panel_id_item","querySelector","panel_id","getAttribute","panel","localStorage","getItem","remove","add","postbox","el","i","setItem","removeItem","$","on","msg","cptui_type_data","confirm","cptui_tax_data","submit_delete_warning","appendTo","dialog","OK","target","off","click","Cancel","jQuery","taxSubmit","taxSubmitSelectCPTDialog","taxCPTChecked","length","showModal","taxSubmitSelectCPTConfirmCloseBtn","close","nameField","autoPopulate","autoLabels","eventName","slug","value","plural","singular","fields","field","newval","plurality","replace","autoClear","hierarchicalSetting","pageAttributesCheck","checked","postTypeDropdown","taxonomyDropdown","postTypeSelectPostType","submit","taxonomySelectPostType","cptSelectSubmit","taxSelectSubmit","back_to_top_btn","cptuiDebounce","backToTop","window","scrollTo","top","behavior","scrollY","method","delay","clearTimeout","_tId","setTimeout","getParameterByName","name","url","location","href","regex","RegExp","results","exec","decodeURIComponent","transliterate","word","split","map","char","cyrillic","join","htmlEncode","str","String","c","charCodeAt","composePreviewContent","re","isURL","test","indexOf","dashDiv","createElement","innerHTML","imgsrc","encodeURI","theimg","src","replaceDiacritics","s","diacritics","chars","replaceSpecialCharacters","original_slug","original_value","toLowerCase","slugchanged","slugexists","override","override_validation","existing_post_types","hasOwnProperty","existing_taxonomies","_custom_media","_orig_send_attachment","undefined","wp","media","editor","send","attachment","button","id","attr","props","val","change","apply","open","trim","html"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"cptui.js","mappings":";;;;;;;AAAa;;AAEb;AACA;AACA;AACA;AACA;AAEA,CAAC,MAAM;EACP;EACC,MAAMA,gBAAgB,GAAGC,QAAQ,CAACC,gBAAgB,CAAC,oBAAoB,CAAC;EACxEC,KAAK,CAACC,IAAI,CAACJ,gBAAgB,CAAC,CAACK,OAAO,CAAC,UAAUC,QAAQ,EAAEC,KAAK,EAAE;IAC/D,IAAIC,IAAI,GAAG,SAAAA,CAAUC,IAAI,EAAEC,QAAQ,EAAE;MACpC,IAAIC,QAAQ,GAAGF,IAAI,CAACG,kBAAkB;MAEtC,IAAI,CAACF,QAAQ,EAAE;QACd,OAAOC,QAAQ;MAChB;MAEA,IAAIA,QAAQ,IAAIA,QAAQ,CAACE,OAAO,CAACH,QAAQ,CAAC,EAAE;QAC3C,OAAOC,QAAQ;MAChB;MAEA,OAAO,IAAI;IACZ,CAAC;IAED,IAAIG,KAAK,GAAG,KAAK;IACjB,IAAIC,MAAM,GAAGP,IAAI,CAACF,QAAQ,EAAE,KAAK,CAAC;IAClCS,MAAM,CAACC,KAAK,CAACC,OAAO,GAAG,MAAM;IAE7B,CAAC,OAAO,EAAE,SAAS,CAAC,CAACZ,OAAO,CAAEa,QAAQ,IAAK;MAC1CZ,QAAQ,CAACa,gBAAgB,CAACD,QAAQ,EAAGE,CAAC,IAAK;QAC1C;QACA,IAAIC,IAAI,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC;QAC7B,IAAID,CAAC,CAACE,IAAI,KAAK,SAAS,IAAI,CAACD,IAAI,CAACE,QAAQ,CAACH,CAAC,CA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MACD;MACA,IAAI,OAAOW,cAAc,IAAI,WAAW,EAAE;QACzC,IAAIA,cAAc,CAACqI,mBAAmB,CAACD,cAAc,CAAC9G,KAAK,CAAC,IAAIA,KAAK,KAAKsG,aAAa,EAAE;UACxFI,UAAU,CAAC7J,SAAS,CAACiB,MAAM,CAAC,aAAa,CAAC;QAC3C,CAAC,MAAM;UACN4I,UAAU,CAAC7J,SAAS,CAACkB,GAAG,CAAC,aAAa,CAAC;QACxC;MACD;IACD,CAAC,CAAC;EACH;AACD,CAAC,EAAE,CAAC;;;;;;;;;;;;AC3EsB;AACM;AACQ;AACT;AACI;AACC;AACN;AACA;AACa;AACV;AACD","sources":["webpack://custom-post-type-ui/./src/js/partials/support-toggles.js","webpack://custom-post-type-ui/./src/js/partials/toggle-panels.js","webpack://custom-post-type-ui/./src/js/partials/confirm-delete.js","webpack://custom-post-type-ui/./src/js/partials/tax-required-post-type.js","webpack://custom-post-type-ui/./src/js/partials/autopopulate.js","webpack://custom-post-type-ui/./src/js/partials/toggle-hierarchical.js","webpack://custom-post-type-ui/./src/js/partials/menu-icon.js","webpack://custom-post-type-ui/./src/js/partials/autoswitch.js","webpack://custom-post-type-ui/./src/js/partials/hide-submit.js","webpack://custom-post-type-ui/./src/js/partials/back-to-top.js","webpack://custom-post-type-ui/webpack/bootstrap","webpack://custom-post-type-ui/./src/js/partials/utils.js","webpack://custom-post-type-ui/./src/js/partials/namefield.js","webpack://custom-post-type-ui/./src/js/cptui.js"],"sourcesContent":["'use strict';\n\n/*\n * This file handles accordian behavior on the Supports page with the various question/answer panels.\n *\n * The functionality includes keyboard and accessibility functionality to help those who need it.\n */\n\n(() => {\n// Toggles help/support accordions.\n\tconst supportQuestions = document.querySelectorAll('#support .question');\n\tArray.from(supportQuestions).forEach(function (question, index) {\n\t\tlet next = function (elem, selector) {\n\t\t\tlet nextElem = elem.nextElementSibling;\n\n\t\t\tif (!selector) {\n\t\t\t\treturn nextElem;\n\t\t\t}\n\n\t\t\tif (nextElem && nextElem.matches(selector)) {\n\t\t\t\treturn nextElem;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t};\n\n\t\tlet state = false;\n\t\tlet answer = next(question, 'div');\n\t\tanswer.style.display = 'none';\n\n\t\t['click', 'keydown'].forEach((theEvent) => {\n\t\t\tquestion.addEventListener(theEvent, (e) => {\n\t\t\t\t// Helps with accessibility and keyboard navigation.\n\t\t\t\tlet keys = ['Space', 'Enter'];\n\t\t\t\tif (e.type === 'keydown' && !keys.includes(e.code)) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\te.preventDefault();\n\t\t\t\tstate = !state;\n\t\t\t\tanswer.style.display = state ? 'block' : 'none';\n\t\t\t\te.currentTarget.classList.toggle('active')\n\t\t\t\te.currentTarget.setAttribute('aria-expanded', state.toString());\n\t\t\t\te.currentTarget.focus();\n\t\t\t});\n\t\t});\n\t});\n})();\n","'use strict';\n\n/*\n * This file handles storing the panel state for the post type and taxonomy edit screens.\n *\n * The open/closed state gets stored into localstorage and is remembered on future page refreshes.\n */\n\npostboxes.add_postbox_toggles(pagenow);\n\n(() => {\n\t// Toggle Panels State.\n\t// @todo. Localize the list of panel selectors so that we can filter in the CPTUI-Extended panel without hardcoding here.\n\tconst all_panels = [\"#cptui_panel_pt_basic_settings\", \"#cptui_panel_pt_additional_labels\", \"#cptui_panel_pt_advanced_settings\", \"#cptui_panel_tax_basic_settings\", \"#cptui_panel_tax_additional_labels\", \"#cptui_panel_tax_advanced_settings\"];\n\tall_panels.forEach((element, index) => {\n\t\tconst panel_id_item = document.querySelector(element);\n\t\tif (panel_id_item) {\n\t\t\tconst panel_id = panel_id_item.getAttribute('id');\n\t\t\tconst panel = document.querySelector('#' + panel_id);\n\n\t\t\t// check default state on page load\n\t\t\tif (!localStorage.getItem(panel_id) || localStorage.getItem(panel_id) === null) {\n\t\t\t\tpanel.classList.remove('closed');\n\t\t\t} else {\n\t\t\t\tpanel.classList.add('closed');\n\t\t\t}\n\n\t\t\tconst postbox = panel_id_item.querySelectorAll('.postbox-header');\n\t\t\tArray.from(postbox).forEach((el, i) => {\n\t\t\t\tel.addEventListener('click', (e) => {\n\t\t\t\t\tif (!localStorage.getItem(panel_id)) {\n\t\t\t\t\t\tlocalStorage.setItem(panel_id, '1');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlocalStorage.removeItem(panel_id);\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t});\n\t\t}\n\t});\n})();\n\n\n","'use strict';\n\n/*\n * This file handles confirming the deletion of a content type before continuing.\n *\n * @todo Finish converting away from jQuery.\n */\n\n(($) => {\n\t// NOT DONE\n\t/*['.cptui-delete-top', '.cptui-delete-bottom'].forEach( (element,index) => {\n\t\tlet theDialog = document.querySelector('#cptui-content-type-delete');\n\t\tlet theelement = document.querySelector(element);\n\t\ttheelement.addEventListener('click', async (e) => {\n\t\t\te.preventDefault();\n\t\t\tconst doPerformAction = await confirm();\n\t\t\tif ( doPerformAction ) {\n\t\t\t\tlet thing = document.querySelector('#cpt_submit_delete');\n\t\t\t\tconsole.log(thing);\n\t\t\t\tthing.click();\n\t\t\t\tthing.submit();\n\t\t\t\ttheDialog.close();\n\t\t\t} else {\n\t\t\t\ttheDialog.close();\n\t\t\t}\n\t\t});\n\t});\n\n\tlet closeBtnConfirm = document.querySelector('.cptui-confirm-deny-delete button');\n\tlet closeBtnDeny = document.querySelector('#cptui-content-type-deny-delete');\n\tfunction confirm() {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tdocument.querySelector('#cptui-content-type-delete').showModal();\n\t\t\tcloseBtnConfirm.focus();\n\n\t\t\tcloseBtnConfirm.addEventListener(\"click\", () => {\n\t\t\t\tresolve(true);\n\t\t\t\tdocument.querySelector('#cptui-content-type-delete').close()\n\t\t\t});\n\t\t\tcloseBtnDeny.addEventListener(\"click\", () => {\n\t\t\t\tresolve(false);\n\t\t\t\tdocument.querySelector('#cptui-content-type-delete').close()\n\t\t\t});\n\t\t});\n\t}*/\n\n\t// Confirm our deletions\n\t$('.cptui-delete-top, .cptui-delete-bottom').on('click', function (e) {\n\t\te.preventDefault();\n\t\tlet msg = '';\n\t\tif (typeof cptui_type_data !== 'undefined') {\n\t\t\tmsg = cptui_type_data.confirm;\n\t\t} else if (typeof cptui_tax_data !== 'undefined') {\n\t\t\tmsg = cptui_tax_data.confirm;\n\t\t}\n\t\tlet submit_delete_warning = $('
          ' + msg + '
          ').appendTo('#poststuff').dialog({\n\t\t\t'dialogClass': 'wp-dialog',\n\t\t\t'modal' : true,\n\t\t\t'autoOpen' : true,\n\t\t\t'buttons' : {\n\t\t\t\t\"OK\" : function () {\n\t\t\t\t\t$(this).dialog('close');\n\t\t\t\t\t$(e.target).off('click').click();\n\t\t\t\t},\n\t\t\t\t\"Cancel\": function () {\n\t\t\t\t\t$(this).dialog('close');\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n})(jQuery);\n","'use strict';\n\n/*\n * This file provides a dialog box to alert the user that at least one post type must be chosen\n * before they can save a taxonomy.\n *\n * This was added because taxonomies need to have a post type, meanwhile post types do NOT need\n * to have a taxonomy.\n */\n\n(() => {\n\t// Handles checking if a post type has been chosen or not when adding/saving a taxonomy.\n\t// Post type associations are a required attribute.\n\tconst taxSubmit = document.querySelectorAll('.cptui-taxonomy-submit');\n\tconst taxSubmitSelectCPTDialog = document.querySelector('#cptui-select-post-type-confirm');\n\tArray.from(taxSubmit).forEach((element, i) => {\n\t\telement.addEventListener('click', (e) => {\n\t\t\t// putting inside event listener to check every time clicked. Defining outside lost re-checking.\n\t\t\tlet taxCPTChecked = document.querySelectorAll('#cptui_panel_tax_basic_settings input[type=\"checkbox\"]:checked');\n\t\t\tif (taxCPTChecked.length === 0) {\n\t\t\t\te.preventDefault();\n\t\t\t\ttaxSubmitSelectCPTDialog.showModal();\n\t\t\t}\n\t\t});\n\t});\n\tlet taxSubmitSelectCPTConfirmCloseBtn = document.querySelector('#cptui-select-post-type-confirm-close');\n\tif (taxSubmitSelectCPTConfirmCloseBtn) {\n\t\ttaxSubmitSelectCPTConfirmCloseBtn.addEventListener('click', (e) => {\n\t\t\te.preventDefault();\n\t\t\ttaxSubmitSelectCPTDialog.close();\n\t\t});\n\t}\n})();\n","'use strict';\n\n/*\n * This file handles the automatic population as well as the automatic clearing of the label\n * fields, based on the provided singular and plural label values.\n */\n\n(() => {\n\tlet nameField = document.querySelector('#name');\n\tlet autoPopulate = document.querySelector('#auto-populate');\n\n\tconst autoLabels = document.querySelector('#autolabels');\n\tif (autoLabels) {\n\t\tautoLabels.style.display = 'table-row';\n\t}\n\n\tif (autoPopulate) {\n\t\t['click', 'tap'].forEach((eventName, index) => {\n\t\t\tautoPopulate.addEventListener(eventName, (e) => {\n\t\t\t\te.preventDefault();\n\n\t\t\t\tlet slug = nameField.value;\n\t\t\t\tlet plural = document.querySelector('#label').value;\n\t\t\t\tlet singular = document.querySelector('#singular_label').value;\n\t\t\t\tlet fields = document.querySelectorAll('.cptui-labels input[type=\"text\"]');\n\n\t\t\t\tif ('' === slug) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ('' === plural) {\n\t\t\t\t\tplural = slug;\n\t\t\t\t}\n\n\t\t\t\tif ('' === singular) {\n\t\t\t\t\tsingular = slug;\n\t\t\t\t}\n\n\t\t\t\tArray.from(fields).forEach(field => {\n\t\t\t\t\tlet newval = field.getAttribute('data-label');\n\t\t\t\t\tlet plurality = field.getAttribute('data-plurality');\n\t\t\t\t\tif (typeof newval !== 'undefined') {\n\t\t\t\t\t\t// \"slug\" is our placeholder from the labels.\n\t\t\t\t\t\tif ('plural' === plurality) {\n\t\t\t\t\t\t\tnewval = newval.replace(/item/gi, plural);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// using an else statement because we do not\n\t\t\t\t\t\t\t// want to mutate the original string by default.\n\t\t\t\t\t\t\tnewval = newval.replace(/item/gi, singular);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (field.value === '') {\n\t\t\t\t\t\t\tfield.value = newval;\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\n\tlet autoClear = document.querySelector('#auto-clear');\n\tif (autoClear) {\n\t\t['click', 'tap'].forEach((eventName, index) => {\n\t\t\tautoClear.addEventListener(eventName, (e) => {\n\t\t\t\te.preventDefault();\n\n\t\t\t\tconst fields = document.querySelectorAll('.cptui-labels input[type=\"text\"]');\n\t\t\t\tArray.from(fields).forEach(field => {\n\t\t\t\t\tfield.value = '';\n\t\t\t\t});\n\t\t\t})\n\t\t});\n\t}\n})();\n","'use strict';\n\n/*\n * This file handles automatically toggling the \"Page attributes\" option in the \"Supports\" section\n * when a user chooses to have their post type be hierarchical.\n *\n * The purpose is to help ensure that the \"parent\" and \"template\" metabox option shows up by default,\n * but we do not force that to remain checked. The user can still toggle it off after the fact.\n */\n\n(() => {\n\t// Automatically toggle the \"page attributes\" checkbox if\n\t// setting a hierarchical post type.\n\tconst hierarchicalSetting = document.querySelector('#hierarchical');\n\tif (hierarchicalSetting) {\n\t\thierarchicalSetting.addEventListener('change', (e) => {\n\t\t\tlet pageAttributesCheck = document.querySelector('#page-attributes');\n\t\t\tif (e.currentTarget && e.currentTarget.value === '1') {\n\t\t\t\tpageAttributesCheck.checked = true;\n\t\t\t} else {\n\t\t\t\tpageAttributesCheck.checked = false;\n\t\t\t}\n\t\t});\n\t}\n})();\n","'use strict';\n\n/*\n * This file handles setting the menu icon preview for a given post type.\n */\n\n(() => {\n\tlet _custom_media;\n\tlet _orig_send_attachment;\n\n\tif (undefined !== wp.media) {\n\t\t_custom_media = true;\n\t\t_orig_send_attachment = wp.media.editor.send.attachment;\n\t}\n\n\t// Trigger the modal and load our icons.\n\tconst icons = cptuiIconPicker.iconsJSON;\n\tconst iconPicker = new IconPicker('#cptui_choose_dashicon', {\n\t\ttheme : 'default',\n\t\ticonSource : [{\n\t\t\tkey : 'dashicons',\n\t\t\tprefix: 'dashicons-',\n\t\t\turl : icons\n\t\t}],\n\t\tcloseOnSelect: true,\n\t});\n\n\tconst menuIconField = document.querySelector('#menu_icon');\n\tconst menuIconPreview = document.querySelector('#menu_icon_preview');\n\tconst regIcon = document.querySelector('#cptui_choose_icon');\n\tconst dashIcon = document.querySelector('#cptui_choose_dashicon');\n\tconst origText = dashIcon.value;\n\ticonPicker.on('select', (icon) => {\n\t\tmenuIconField.value = icon.value;\n\t\tmenuIconPreview.innerHTML = '';\n\n\t\tlet div = document.createElement('div');\n\t\tdiv.classList.add('dashicons', icon.value);\n\t\tmenuIconPreview.insertAdjacentElement('afterbegin', div);\n\t});\n\ticonPicker.on('hide', () => {\n\t\tdashIcon.value = origText;\n\t})\n\n\tif (regIcon) {\n\t\tregIcon.addEventListener('click', (e) => {\n\t\t\te.preventDefault();\n\n\t\t\tlet button = e.currentTarget;\n\t\t\t_custom_media = true;\n\t\t\twp.media.editor.send.attachment = function (props, attachment) {\n\t\t\t\tif (_custom_media) {\n\t\t\t\t\tmenuIconField.value = attachment.url;\n\t\t\t\t\tmenuIconPreview.innerHTML = '';\n\t\t\t\t\tlet img = document.createElement('img');\n\t\t\t\t\timg.src = attachment.url;\n\t\t\t\t\tmenuIconPreview.insertAdjacentElement('afterbegin', img);\n\t\t\t\t} else {\n\t\t\t\t\treturn _orig_send_attachment.apply(this, [props, attachment]);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\twp.media.editor.open(button);\n\t\t\treturn false;\n\t\t});\n\t}\n})();\n","'use strict';\n\n/*\n * This file handles automatically switching to a chosen content type when selecting from the\n * dropdown listing.\n */\n\n(() => {\n\t// Switch to newly selected post type or taxonomy automatically.\n\tconst postTypeDropdown = document.querySelector('#post_type');\n\tconst taxonomyDropdown = document.querySelector('#taxonomy');\n\n\tif (postTypeDropdown) {\n\t\tpostTypeDropdown.addEventListener('change', () => {\n\t\t\tconst postTypeSelectPostType = document.querySelector('#cptui_select_post_type');\n\t\t\tif (postTypeSelectPostType) {\n\t\t\t\tpostTypeSelectPostType.submit();\n\t\t\t}\n\t\t})\n\t}\n\tif (taxonomyDropdown) {\n\t\ttaxonomyDropdown.addEventListener('change', () => {\n\t\t\tconst taxonomySelectPostType = document.querySelector('#cptui_select_taxonomy');\n\t\t\tif (taxonomySelectPostType) {\n\t\t\t\ttaxonomySelectPostType.submit();\n\t\t\t}\n\t\t})\n\t}\n})();\n","'use strict';\n\n/*\n * This file visually removes the submit button to change content type being edited.\n *\n * If by chance javascript is disabled or somehow breaking, the button would show by default,\n * preventing issues with switching content types.\n */\n\n(() => {\n\tconst cptSelectSubmit = document.querySelector('#cptui_select_post_type_submit');\n\tif (cptSelectSubmit) {\n\t\tcptSelectSubmit.style.display = 'none';\n\t}\n\tconst taxSelectSubmit = document.querySelector('#cptui_select_taxonomy_submit');\n\tif (taxSelectSubmit) {\n\t\ttaxSelectSubmit.style.display = 'none';\n\t}\n})();\n","'use strict';\n\n/*\n * This file handles the back to top functionality as the user scrolls, for quick return to top.\n *\n * This includes some debouncing to prevent excessive scroll event listening.\n */\n\n(() => {\n\tconst back_to_top_btn = document.querySelector('.cptui-back-to-top');\n\tif (back_to_top_btn) {\n\t\tdocument.addEventListener('scroll', () => {\n\t\t\tcptuiDebounce(backToTop, 500);\n\t\t});\n\n\t\tback_to_top_btn.addEventListener('click', (e) => {\n\t\t\te.preventDefault();\n\t\t\twindow.scrollTo({\n\t\t\t\ttop : 0,\n\t\t\t\tbehavior: \"smooth\"\n\t\t\t})\n\t\t});\n\t}\n\n\tfunction backToTop() {\n\t\tif (window.scrollY > 300) {\n\t\t\tback_to_top_btn.classList.add('show');\n\t\t} else {\n\t\t\tback_to_top_btn.classList.remove('show');\n\t\t}\n\t}\n\n\tfunction cptuiDebounce(method, delay) {\n\t\tclearTimeout(method._tId);\n\t\tmethod._tId = setTimeout(function () {\n\t\t\tmethod();\n\t\t}, delay);\n\t}\n})();\n","// 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","'use strict';\n\n// Retrieve URL parameters by requested parameter name.\nexport function getParameterByName(name, url) {\n\tif (!url) url = window.location.href;\n\tname = name.replace(/[\\[\\]]/g, \"\\\\$&\");\n\tconst regex = new RegExp(\"[?&]\" + name + \"(=([^&#]*)|&|#|$)\"),\n\t\tresults = regex.exec(url);\n\tif (!results) return null;\n\tif (!results[2]) return '';\n\treturn decodeURIComponent(results[2].replace(/\\+/g, \" \"));\n}\n\n// Split, translate cyrillic characters, and then re-join the final result.\nexport function transliterate(word) {\n\treturn word.split('').map(function (char) {\n\t\treturn cyrillic[char] || char;\n\t}).join(\"\");\n}\n\n//Character encode special characters.\nexport function htmlEncode(str) {\n\treturn String(str).replace(/[^-\\w. ]/gi, function (c) {\n\t\treturn '&#' + c.charCodeAt(0) + ';';\n\t});\n}\n\n// Constructs miniture versions of uploaded media for admnin menu icon usage,\n// or displays the rendered dashicon.\nexport function composePreviewContent(value) {\n\tconst re = /(http|https):\\/\\/[\\w-]+(\\.[\\w-]+)+([\\w.,@?^=%&:\\/~+#-]*[\\w@?^=%&\\/~+#-])?/;\n\tconst isURL = re.test(value);\n\n\tif (!value) {\n\t\treturn '';\n\t} else if (0 === value.indexOf('dashicons-')) {\n\t\tconst dashDiv = document.createElement('div');\n\t\tdashDiv.classList.add('dashicons-before');\n\t\tdashDiv.innerHTML = '
          ';\n\t\tdashDiv.classList.add(htmlEncode(value));\n\t\treturn dashDiv;\n\t} else if (isURL) {\n\t\tconst imgsrc = encodeURI(value);\n\t\tconst theimg = document.createElement('IMG');\n\t\ttheimg.src = imgsrc;\n\t\treturn theimg;\n\t}\n}\n\n// Replace diacritic characters with latin characters.\nexport function replaceDiacritics(s) {\n\tconst diacritics = [\n\t\t/[\\300-\\306]/g, /[\\340-\\346]/g, // A, a\n\t\t/[\\310-\\313]/g, /[\\350-\\353]/g, // E, e\n\t\t/[\\314-\\317]/g, /[\\354-\\357]/g, // I, i\n\t\t/[\\322-\\330]/g, /[\\362-\\370]/g, // O, o\n\t\t/[\\331-\\334]/g, /[\\371-\\374]/g, // U, u\n\t\t/[\\321]/g, /[\\361]/g, // N, n\n\t\t/[\\307]/g, /[\\347]/g // C, c\n\t];\n\n\tlet chars = ['A', 'a', 'E', 'e', 'I', 'i', 'O', 'o', 'U', 'u', 'N', 'n', 'C', 'c'];\n\n\tfor (let i = 0; i < diacritics.length; i++) {\n\t\ts = s.replace(diacritics[i], chars[i]);\n\t}\n\n\treturn s;\n}\n\n// Converts non-alphanumeric or space characters to an underscore. Should ignore dashes, to allow\n// using dashes in slugs.\nexport function replaceSpecialCharacters(s) {\n\ts = s.replace(/[^a-z0-9\\s-]/gi, '_');\n\treturn s;\n}\n\n// List of available cyrillic characters and the value to translate to.\nexport const cyrillic = {\n\t\"Ё\": \"YO\",\n\t\"Й\": \"I\",\n\t\"Ц\": \"TS\",\n\t\"У\": \"U\",\n\t\"К\": \"K\",\n\t\"Е\": \"E\",\n\t\"Н\": \"N\",\n\t\"Г\": \"G\",\n\t\"Ш\": \"SH\",\n\t\"Щ\": \"SCH\",\n\t\"З\": \"Z\",\n\t\"Х\": \"H\",\n\t\"Ъ\": \"'\",\n\t\"ё\": \"yo\",\n\t\"й\": \"i\",\n\t\"ц\": \"ts\",\n\t\"у\": \"u\",\n\t\"к\": \"k\",\n\t\"е\": \"e\",\n\t\"н\": \"n\",\n\t\"г\": \"g\",\n\t\"ш\": \"sh\",\n\t\"щ\": \"sch\",\n\t\"з\": \"z\",\n\t\"х\": \"h\",\n\t\"ъ\": \"'\",\n\t\"Ф\": \"F\",\n\t\"Ы\": \"I\",\n\t\"В\": \"V\",\n\t\"А\": \"a\",\n\t\"П\": \"P\",\n\t\"Р\": \"R\",\n\t\"О\": \"O\",\n\t\"Л\": \"L\",\n\t\"Д\": \"D\",\n\t\"Ж\": \"ZH\",\n\t\"Э\": \"E\",\n\t\"ф\": \"f\",\n\t\"ы\": \"i\",\n\t\"в\": \"v\",\n\t\"а\": \"a\",\n\t\"п\": \"p\",\n\t\"р\": \"r\",\n\t\"о\": \"o\",\n\t\"л\": \"l\",\n\t\"д\": \"d\",\n\t\"ж\": \"zh\",\n\t\"э\": \"e\",\n\t\"Я\": \"Ya\",\n\t\"Ч\": \"CH\",\n\t\"С\": \"S\",\n\t\"М\": \"M\",\n\t\"И\": \"I\",\n\t\"Т\": \"T\",\n\t\"Ь\": \"'\",\n\t\"Б\": \"B\",\n\t\"Ю\": \"YU\",\n\t\"я\": \"ya\",\n\t\"ч\": \"ch\",\n\t\"с\": \"s\",\n\t\"м\": \"m\",\n\t\"и\": \"i\",\n\t\"т\": \"t\",\n\t\"ь\": \"'\",\n\t\"б\": \"b\",\n\t\"ю\": \"yu\"\n};\n","'use strict';\nimport { getParameterByName, replaceDiacritics, transliterate, replaceSpecialCharacters } from './utils'\n\n/*\n * This file handles all of the normalization of the name/slug field for a post type\n * or taxonomy being registered.\n *\n * That way we are only allowing latin characters and dashes/underscores.\n *\n * It also shows a hidden alert if the slug has been changed in some way when editing an existing\n * content type.\n *\n * Lastly it will also show a warning if the attempted slug has already been registered elsewhere,\n * to help avoid clashes. The only exception is if the checkbox is checked indicating that the user\n * is trying to convert TO using CPTUI, and the conflicting slug elsewhere will be removed soon.\n */\n\n(() => {\n\tlet nameField = document.querySelector('#name');\n\tlet original_slug;\n\n\tif ('edit' === getParameterByName('action')) {\n\t\tif (nameField) {\n\t\t\t// Store our original slug on page load for edit checking.\n\t\t\toriginal_slug = nameField.value;\n\t\t}\n\t}\n\n\tif (nameField) {\n\t\t// Switch spaces for underscores on our slug fields.\n\t\tnameField.addEventListener('keyup', (e) => {\n\t\t\tlet value, original_value;\n\n\t\t\tvalue = original_value = e.currentTarget.value;\n\t\t\tlet keys = ['Tab', 'ArrowLeft', 'ArrowUp', 'ArrowRight', 'ArrowDown'];\n\t\t\tif (!keys.includes(e.code)) {\n\t\t\t\tvalue = value.replace(/ /g, \"_\");\n\t\t\t\tvalue = value.toLowerCase();\n\t\t\t\tvalue = replaceDiacritics(value);\n\t\t\t\tvalue = transliterate(value);\n\t\t\t\tvalue = replaceSpecialCharacters(value);\n\t\t\t\tif (value !== original_value) {\n\t\t\t\t\te.currentTarget.value = value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//Displays a message if slug changes.\n\t\t\tif (typeof original_slug !== 'undefined') {\n\t\t\t\tlet slugchanged = document.querySelector('#slugchanged');\n\t\t\t\tif (value !== original_slug) {\n\t\t\t\t\tslugchanged.classList.remove('hidemessage');\n\t\t\t\t} else {\n\t\t\t\t\tslugchanged.classList.add('hidemessage');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet slugexists = document.querySelector('#slugexists');\n\t\t\tlet override = document.querySelector('#override_validation');\n\t\t\tlet override_validation = (override) ? override.checked : false;\n\t\t\tif (typeof cptui_type_data != 'undefined') {\n\t\t\t\tif (cptui_type_data.existing_post_types.hasOwnProperty(value) && value !== original_slug && override_validation === false) {\n\t\t\t\t\tslugexists.classList.remove('hidemessage');\n\t\t\t\t} else {\n\t\t\t\t\tslugexists.classList.add('hidemessage');\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (typeof cptui_tax_data != 'undefined') {\n\t\t\t\tif (cptui_tax_data.existing_taxonomies.hasOwnProperty(value) && value !== original_slug) {\n\t\t\t\t\tslugexists.classList.remove('hidemessage');\n\t\t\t\t} else {\n\t\t\t\t\tslugexists.classList.add('hidemessage');\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n})();\n","import './partials/utils';\nimport './partials/hide-submit';\nimport './partials/toggle-hierarchical';\nimport './partials/autoswitch';\nimport './partials/confirm-delete';\nimport './partials/support-toggles';\nimport './partials/namefield';\nimport './partials/menu-icon';\nimport './partials/tax-required-post-type';\nimport './partials/autopopulate';\nimport './partials/back-to-top';\nimport './partials/toggle-panels';\n"],"names":["supportQuestions","document","querySelectorAll","Array","from","forEach","question","index","next","elem","selector","nextElem","nextElementSibling","matches","state","answer","style","display","theEvent","addEventListener","e","keys","type","includes","code","preventDefault","currentTarget","classList","toggle","setAttribute","toString","focus","postboxes","add_postbox_toggles","pagenow","all_panels","element","panel_id_item","querySelector","panel_id","getAttribute","panel","localStorage","getItem","remove","add","postbox","el","i","setItem","removeItem","$","on","msg","cptui_type_data","confirm","cptui_tax_data","submit_delete_warning","appendTo","dialog","OK","target","off","click","Cancel","jQuery","taxSubmit","taxSubmitSelectCPTDialog","taxCPTChecked","length","showModal","taxSubmitSelectCPTConfirmCloseBtn","close","nameField","autoPopulate","autoLabels","eventName","slug","value","plural","singular","fields","field","newval","plurality","replace","autoClear","hierarchicalSetting","pageAttributesCheck","checked","_custom_media","_orig_send_attachment","undefined","wp","media","editor","send","attachment","icons","cptuiIconPicker","iconsJSON","iconPicker","IconPicker","theme","iconSource","key","prefix","url","closeOnSelect","menuIconField","menuIconPreview","regIcon","dashIcon","origText","icon","innerHTML","div","createElement","insertAdjacentElement","button","props","img","src","apply","open","postTypeDropdown","taxonomyDropdown","postTypeSelectPostType","submit","taxonomySelectPostType","cptSelectSubmit","taxSelectSubmit","back_to_top_btn","cptuiDebounce","backToTop","window","scrollTo","top","behavior","scrollY","method","delay","clearTimeout","_tId","setTimeout","getParameterByName","name","location","href","regex","RegExp","results","exec","decodeURIComponent","transliterate","word","split","map","char","cyrillic","join","htmlEncode","str","String","c","charCodeAt","composePreviewContent","re","isURL","test","indexOf","dashDiv","imgsrc","encodeURI","theimg","replaceDiacritics","s","diacritics","chars","replaceSpecialCharacters","original_slug","original_value","toLowerCase","slugchanged","slugexists","override","override_validation","existing_post_types","hasOwnProperty","existing_taxonomies"],"sourceRoot":""} \ No newline at end of file diff --git a/build/cptui.min.js b/build/cptui.min.js index 011fcde5..3f210d16 100644 --- a/build/cptui.min.js +++ b/build/cptui.min.js @@ -1 +1 @@ -(()=>{var a={194:()=>{var e;e=document.querySelectorAll("#support .question"),Array.from(e).forEach(function(t,e){let a=!1,o=((e,t)=>(e=e.nextElementSibling,!t||e&&e.matches(t)?e:null))(t,"div");o.style.display="none",["click","keydown"].forEach(e=>{t.addEventListener(e,e=>{"keydown"===e.type&&!["Space","Enter"].includes(e.code)||(e.preventDefault(),a=!a,o.style.display=a?"block":"none",e.currentTarget.classList.toggle("active"),e.currentTarget.setAttribute("aria-expanded",a.toString()),e.currentTarget.focus())})})})},213:()=>{postboxes.add_postbox_toggles(pagenow),["#cptui_panel_pt_basic_settings","#cptui_panel_pt_additional_labels","#cptui_panel_pt_advanced_settings","#cptui_panel_tax_basic_settings","#cptui_panel_tax_additional_labels","#cptui_panel_tax_advanced_settings"].forEach((e,t)=>{e=document.querySelector(e);if(e){let a=e.getAttribute("id");var o=document.querySelector("#"+a),o=(localStorage.getItem(a)&&null!==localStorage.getItem(a)?o.classList.add("closed"):o.classList.remove("closed"),e.querySelectorAll(".postbox-header"));Array.from(o).forEach((e,t)=>{e.addEventListener("click",e=>{localStorage.getItem(a)?localStorage.removeItem(a):localStorage.setItem(a,"1")})})}})},285:()=>{var a;(a=jQuery)(".cptui-delete-top, .cptui-delete-bottom").on("click",function(e){e.preventDefault();let t="";"undefined"!=typeof cptui_type_data?t=cptui_type_data.confirm:"undefined"!=typeof cptui_tax_data&&(t=cptui_tax_data.confirm);a('
          '+t+"
          ").appendTo("#poststuff").dialog({dialogClass:"wp-dialog",modal:!0,autoOpen:!0,buttons:{OK:function(){a(this).dialog("close"),a(e.target).off("click").click()},Cancel:function(){a(this).dialog("close")}}})})},376:()=>{{var e=document.querySelectorAll(".cptui-taxonomy-submit");let a=document.querySelector("#cptui-select-post-type-confirm");Array.from(e).forEach((e,t)=>{e.addEventListener("click",e=>{0===document.querySelectorAll('#cptui_panel_tax_basic_settings input[type="checkbox"]:checked').length&&(e.preventDefault(),a.showModal())})}),(e=document.querySelector("#cptui-select-post-type-confirm-close"))&&e.addEventListener("click",e=>{e.preventDefault(),a.close()})}},464:()=>{{let a=document.querySelector("#name"),o=document.querySelector("#auto-populate");var e=document.querySelector("#autolabels");e&&(e.style.display="table-row"),o&&["click","tap"].forEach((e,t)=>{o.addEventListener(e,e=>{e.preventDefault();e=a.value;let o=document.querySelector("#label").value,r=document.querySelector("#singular_label").value;var t=document.querySelectorAll('.cptui-labels input[type="text"]');""!==e&&(""===o&&(o=e),""===r&&(r=e),Array.from(t).forEach(e=>{let t=e.getAttribute("data-label");var a=e.getAttribute("data-plurality");void 0!==t&&(t="plural"===a?t.replace(/item/gi,o):t.replace(/item/gi,r),""===e.value)&&(e.value=t)}))})});let r=document.querySelector("#auto-clear");r&&["click","tap"].forEach((e,t)=>{r.addEventListener(e,e=>{e.preventDefault();e=document.querySelectorAll('.cptui-labels input[type="text"]');Array.from(e).forEach(e=>{e.value=""})})})}},643:()=>{var e;(e=document.querySelector("#hierarchical"))&&e.addEventListener("change",e=>{var t=document.querySelector("#page-attributes");e.currentTarget&&"1"===e.currentTarget.value?t.checked=!0:t.checked=!1})},706:()=>{var e,t;e=document.querySelector("#post_type"),t=document.querySelector("#taxonomy"),e&&e.addEventListener("change",()=>{var e=document.querySelector("#cptui_select_post_type");e&&e.submit()}),t&&t.addEventListener("change",()=>{var e=document.querySelector("#cptui_select_taxonomy");e&&e.submit()})},710:()=>{var e;(e=document.querySelector("#cptui_select_post_type_submit"))&&(e.style.display="none"),(e=document.querySelector("#cptui_select_taxonomy_submit"))&&(e.style.display="none")},864:()=>{{let e=document.querySelector(".cptui-back-to-top");function a(){300{var e,t;e=a,t=500,clearTimeout(e._tId),e._tId=setTimeout(function(){e()},t)}),e.addEventListener("click",e=>{e.preventDefault(),window.scrollTo({top:0,behavior:"smooth"})}))}}},o={};function r(e){var t=o[e];return void 0!==t||(t=o[e]={exports:{}},a[e](t,t.exports,r)),t.exports}function t(e){var t,a=/(http|https):\/\/[\w-]+(\.[\w-]+)+([\w.,@?^=%&:\/~+#-]*[\w@?^=%&\/~+#-])?/.test(e);return e?0===e.indexOf("dashicons-")?((t=document.createElement("div")).classList.add("dashicons-before"),t.innerHTML="
          ",t.classList.add(String(e).replace(/[^-\w. ]/gi,function(e){return"&#"+e.charCodeAt(0)+";"})),t):a?(t=encodeURI(e),(a=document.createElement("IMG")).src=t,a):void 0:""}let c={"Ё":"YO","Й":"I","Ц":"TS","У":"U","К":"K","Е":"E","Н":"N","Г":"G","Ш":"SH","Щ":"SCH","З":"Z","Х":"H","Ъ":"'","ё":"yo","й":"i","ц":"ts","у":"u","к":"k","е":"e","н":"n","г":"g","ш":"sh","щ":"sch","з":"z","х":"h","ъ":"'","Ф":"F","Ы":"I","В":"V","А":"a","П":"P","Р":"R","О":"O","Л":"L","Д":"D","Ж":"ZH","Э":"E","ф":"f","ы":"i","в":"v","а":"a","п":"p","р":"r","о":"o","л":"l","д":"d","ж":"zh","э":"e","Я":"Ya","Ч":"CH","С":"S","М":"M","И":"I","Т":"T","Ь":"'","Б":"B","Ю":"YU","я":"ya","ч":"ch","с":"s","м":"m","и":"i","т":"t","ь":"'","б":"b","ю":"yu"};r(710),r(643),r(706),r(285),r(194);{var e,l,n=document.querySelector("#name");let r;"edit"===(e="action",l=l||window.location.href,e=e.replace(/[\[\]]/g,"\\$&"),(e=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)").exec(l))?e[2]?decodeURIComponent(e[2].replace(/\+/g," ")):"":null)&&n&&(r=n.value),n&&n.addEventListener("keyup",e=>{let t,a;t=a=e.currentTarget.value;["Tab","ArrowLeft","ArrowUp","ArrowRight","ArrowDown"].includes(e.code)||(t=(t=(t=>{var a=[/[\300-\306]/g,/[\340-\346]/g,/[\310-\313]/g,/[\350-\353]/g,/[\314-\317]/g,/[\354-\357]/g,/[\322-\330]/g,/[\362-\370]/g,/[\331-\334]/g,/[\371-\374]/g,/[\321]/g,/[\361]/g,/[\307]/g,/[\347]/g],o=["A","a","E","e","I","i","O","o","U","u","N","n","C","c"];for(let e=0;e{var a={194:()=>{var e;e=document.querySelectorAll("#support .question"),Array.from(e).forEach(function(t,e){let a=!1,c=((e,t)=>(e=e.nextElementSibling,!t||e&&e.matches(t)?e:null))(t,"div");c.style.display="none",["click","keydown"].forEach(e=>{t.addEventListener(e,e=>{"keydown"===e.type&&!["Space","Enter"].includes(e.code)||(e.preventDefault(),a=!a,c.style.display=a?"block":"none",e.currentTarget.classList.toggle("active"),e.currentTarget.setAttribute("aria-expanded",a.toString()),e.currentTarget.focus())})})})},213:()=>{postboxes.add_postbox_toggles(pagenow),["#cptui_panel_pt_basic_settings","#cptui_panel_pt_additional_labels","#cptui_panel_pt_advanced_settings","#cptui_panel_tax_basic_settings","#cptui_panel_tax_additional_labels","#cptui_panel_tax_advanced_settings"].forEach((e,t)=>{e=document.querySelector(e);if(e){let a=e.getAttribute("id");var c=document.querySelector("#"+a),c=(localStorage.getItem(a)&&null!==localStorage.getItem(a)?c.classList.add("closed"):c.classList.remove("closed"),e.querySelectorAll(".postbox-header"));Array.from(c).forEach((e,t)=>{e.addEventListener("click",e=>{localStorage.getItem(a)?localStorage.removeItem(a):localStorage.setItem(a,"1")})})}})},285:()=>{var a;(a=jQuery)(".cptui-delete-top, .cptui-delete-bottom").on("click",function(e){e.preventDefault();let t="";"undefined"!=typeof cptui_type_data?t=cptui_type_data.confirm:"undefined"!=typeof cptui_tax_data&&(t=cptui_tax_data.confirm);a('
          '+t+"
          ").appendTo("#poststuff").dialog({dialogClass:"wp-dialog",modal:!0,autoOpen:!0,buttons:{OK:function(){a(this).dialog("close"),a(e.target).off("click").click()},Cancel:function(){a(this).dialog("close")}}})})},376:()=>{{var e=document.querySelectorAll(".cptui-taxonomy-submit");let a=document.querySelector("#cptui-select-post-type-confirm");Array.from(e).forEach((e,t)=>{e.addEventListener("click",e=>{0===document.querySelectorAll('#cptui_panel_tax_basic_settings input[type="checkbox"]:checked').length&&(e.preventDefault(),a.showModal())})}),(e=document.querySelector("#cptui-select-post-type-confirm-close"))&&e.addEventListener("click",e=>{e.preventDefault(),a.close()})}},464:()=>{{let a=document.querySelector("#name"),c=document.querySelector("#auto-populate");var e=document.querySelector("#autolabels");e&&(e.style.display="table-row"),c&&["click","tap"].forEach((e,t)=>{c.addEventListener(e,e=>{e.preventDefault();e=a.value;let c=document.querySelector("#label").value,o=document.querySelector("#singular_label").value;var t=document.querySelectorAll('.cptui-labels input[type="text"]');""!==e&&(""===c&&(c=e),""===o&&(o=e),Array.from(t).forEach(e=>{let t=e.getAttribute("data-label");var a=e.getAttribute("data-plurality");void 0!==t&&(t="plural"===a?t.replace(/item/gi,c):t.replace(/item/gi,o),""===e.value)&&(e.value=t)}))})});let o=document.querySelector("#auto-clear");o&&["click","tap"].forEach((e,t)=>{o.addEventListener(e,e=>{e.preventDefault();e=document.querySelectorAll('.cptui-labels input[type="text"]');Array.from(e).forEach(e=>{e.value=""})})})}},643:()=>{var e;(e=document.querySelector("#hierarchical"))&&e.addEventListener("change",e=>{var t=document.querySelector("#page-attributes");e.currentTarget&&"1"===e.currentTarget.value?t.checked=!0:t.checked=!1})},698:()=>{{let a,c;void 0!==wp.media&&(a=!0,c=wp.media.editor.send.attachment);var l=cptuiIconPicker.iconsJSON,l=new IconPicker("#cptui_choose_dashicon",{theme:"default",iconSource:[{key:"dashicons",prefix:"dashicons-",url:l}],closeOnSelect:!0});let o=document.querySelector("#menu_icon"),r=document.querySelector("#menu_icon_preview");var n=document.querySelector("#cptui_choose_icon");let e=document.querySelector("#cptui_choose_dashicon"),t=e.value;l.on("select",e=>{o.value=e.value,r.innerHTML="";var t=document.createElement("div");t.classList.add("dashicons",e.value),r.insertAdjacentElement("afterbegin",t)}),l.on("hide",()=>{e.value=t}),n&&n.addEventListener("click",e=>{e.preventDefault();e=e.currentTarget;return a=!0,wp.media.editor.send.attachment=function(e,t){if(!a)return c.apply(this,[e,t]);o.value=t.url,r.innerHTML="";e=document.createElement("img");e.src=t.url,r.insertAdjacentElement("afterbegin",e)},wp.media.editor.open(e),!1})}},706:()=>{var e,t;e=document.querySelector("#post_type"),t=document.querySelector("#taxonomy"),e&&e.addEventListener("change",()=>{var e=document.querySelector("#cptui_select_post_type");e&&e.submit()}),t&&t.addEventListener("change",()=>{var e=document.querySelector("#cptui_select_taxonomy");e&&e.submit()})},710:()=>{var e;(e=document.querySelector("#cptui_select_post_type_submit"))&&(e.style.display="none"),(e=document.querySelector("#cptui_select_taxonomy_submit"))&&(e.style.display="none")},864:()=>{{let e=document.querySelector(".cptui-back-to-top");function a(){300{var e,t;e=a,t=500,clearTimeout(e._tId),e._tId=setTimeout(function(){e()},t)}),e.addEventListener("click",e=>{e.preventDefault(),window.scrollTo({top:0,behavior:"smooth"})}))}}},c={};function o(e){var t=c[e];return void 0!==t||(t=c[e]={exports:{}},a[e](t,t.exports,o)),t.exports}let r={"Ё":"YO","Й":"I","Ц":"TS","У":"U","К":"K","Е":"E","Н":"N","Г":"G","Ш":"SH","Щ":"SCH","З":"Z","Х":"H","Ъ":"'","ё":"yo","й":"i","ц":"ts","у":"u","к":"k","е":"e","н":"n","г":"g","ш":"sh","щ":"sch","з":"z","х":"h","ъ":"'","Ф":"F","Ы":"I","В":"V","А":"a","П":"P","Р":"R","О":"O","Л":"L","Д":"D","Ж":"ZH","Э":"E","ф":"f","ы":"i","в":"v","а":"a","п":"p","р":"r","о":"o","л":"l","д":"d","ж":"zh","э":"e","Я":"Ya","Ч":"CH","С":"S","М":"M","И":"I","Т":"T","Ь":"'","Б":"B","Ю":"YU","я":"ya","ч":"ch","с":"s","м":"m","и":"i","т":"t","ь":"'","б":"b","ю":"yu"};o(710),o(643),o(706),o(285),o(194);{var e,t,l=document.querySelector("#name");let o;"edit"===(e="action",t=t||window.location.href,e=e.replace(/[\[\]]/g,"\\$&"),(e=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)").exec(t))?e[2]?decodeURIComponent(e[2].replace(/\+/g," ")):"":null)&&l&&(o=l.value),l&&l.addEventListener("keyup",e=>{let t,a;t=a=e.currentTarget.value;["Tab","ArrowLeft","ArrowUp","ArrowRight","ArrowDown"].includes(e.code)||(t=(t=(t=>{var a=[/[\300-\306]/g,/[\340-\346]/g,/[\310-\313]/g,/[\350-\353]/g,/[\314-\317]/g,/[\354-\357]/g,/[\322-\330]/g,/[\362-\370]/g,/[\331-\334]/g,/[\371-\374]/g,/[\321]/g,/[\361]/g,/[\307]/g,/[\347]/g],c=["A","a","E","e","I","i","O","o","U","u","N","n","C","c"];for(let e=0;e" + }, + "dashboard": { + "body": "" + }, + "filter": { + "body": "" + }, + "admin-site": { + "body": "" + }, + "admin-media": { + "body": "" + }, + "admin-page": { + "body": "" + }, + "admin-comments": { + "body": "" + }, + "admin-appearance": { + "body": "" + }, + "admin-plugins": { + "body": "" + }, + "admin-users": { + "body": "" + }, + "admin-tools": { + "body": "" + }, + "admin-settings": { + "body": "" + }, + "admin-network": { + "body": "" + }, + "admin-generic": { + "body": "" + }, + "admin-home": { + "body": "" + }, + "admin-collapse": { + "body": "" + }, + "admin-customizer": { + "body": "" + }, + "admin-multisite": { + "body": "" + }, + "admin-links": { + "body": "" + }, + "admin-post": { + "body": "" + }, + "format-links": { + "body": "" + }, + "format-standard": { + "body": "" + }, + "format-image": { + "body": "" + }, + "format-gallery": { + "body": "" + }, + "format-audio": { + "body": "" + }, + "format-video": { + "body": "" + }, + "format-chat": { + "body": "" + }, + "format-status": { + "body": "" + }, + "format-aside": { + "body": "" + }, + "format-quote": { + "body": "" + }, + "welcome-write-blog": { + "body": "" + }, + "welcome-edit-page": { + "body": "" + }, + "welcome-add-page": { + "body": "" + }, + "welcome-view-site": { + "body": "" + }, + "welcome-widgets-menus": { + "body": "" + }, + "welcome-comments": { + "body": "" + }, + "welcome-learn-more": { + "body": "" + }, + "image-crop": { + "body": "" + }, + "image-rotate": { + "body": "" + }, + "image-rotate-left": { + "body": "" + }, + "image-rotate-right": { + "body": "" + }, + "image-flip-vertical": { + "body": "" + }, + "image-flip-horizontal": { + "body": "" + }, + "image-filter": { + "body": "" + }, + "undo": { + "body": "" + }, + "redo": { + "body": "" + }, + "editor-bold": { + "body": "" + }, + "editor-italic": { + "body": "" + }, + "editor-ul": { + "body": "" + }, + "editor-ol": { + "body": "" + }, + "editor-quote": { + "body": "" + }, + "editor-alignleft": { + "body": "" + }, + "editor-aligncenter": { + "body": "" + }, + "editor-alignright": { + "body": "" + }, + "editor-insertmore": { + "body": "" + }, + "editor-spellcheck": { + "body": "" + }, + "editor-distractionfree": { + "body": "" + }, + "editor-expand": { + "body": "" + }, + "editor-contract": { + "body": "" + }, + "editor-kitchensink": { + "body": "" + }, + "editor-underline": { + "body": "" + }, + "editor-justify": { + "body": "" + }, + "editor-textcolor": { + "body": "" + }, + "editor-paste-word": { + "body": "" + }, + "editor-paste-text": { + "body": "" + }, + "editor-removeformatting": { + "body": "" + }, + "editor-video": { + "body": "" + }, + "editor-customchar": { + "body": "" + }, + "editor-outdent": { + "body": "" + }, + "editor-indent": { + "body": "" + }, + "editor-help": { + "body": "" + }, + "editor-strikethrough": { + "body": "" + }, + "editor-unlink": { + "body": "" + }, + "editor-rtl": { + "body": "" + }, + "editor-break": { + "body": "" + }, + "editor-code": { + "body": "" + }, + "editor-paragraph": { + "body": "" + }, + "editor-table": { + "body": "" + }, + "align-left": { + "body": "" + }, + "align-right": { + "body": "" + }, + "align-center": { + "body": "" + }, + "align-none": { + "body": "" + }, + "lock": { + "body": "" + }, + "unlock": { + "body": "" + }, + "calendar": { + "body": "" + }, + "calendar-alt": { + "body": "" + }, + "visibility": { + "body": "" + }, + "hidden": { + "body": "" + }, + "post-status": { + "body": "" + }, + "post-trash": { + "body": "" + }, + "trash": { + "body": "" + }, + "sticky": { + "body": "" + }, + "external": { + "body": "" + }, + "arrow-up": { + "body": "" + }, + "arrow-down": { + "body": "" + }, + "arrow-left": { + "body": "" + }, + "arrow-right": { + "body": "" + }, + "arrow-up-alt": { + "body": "" + }, + "arrow-down-alt": { + "body": "" + }, + "arrow-left-alt": { + "body": "" + }, + "arrow-right-alt": { + "body": "" + }, + "arrow-up-alt2": { + "body": "" + }, + "arrow-down-alt2": { + "body": "" + }, + "arrow-left-alt2": { + "body": "" + }, + "arrow-right-alt2": { + "body": "" + }, + "leftright": { + "body": "" + }, + "sort": { + "body": "" + }, + "randomize": { + "body": "" + }, + "list-view": { + "body": "" + }, + "excerpt-view": { + "body": "" + }, + "grid-view": { + "body": "" + }, + "hammer": { + "body": "" + }, + "art": { + "body": "" + }, + "migrate": { + "body": "" + }, + "performance": { + "body": "" + }, + "universal-access": { + "body": "" + }, + "universal-access-alt": { + "body": "" + }, + "tickets": { + "body": "" + }, + "nametag": { + "body": "" + }, + "clipboard": { + "body": "" + }, + "heart": { + "body": "" + }, + "megaphone": { + "body": "" + }, + "schedule": { + "body": "" + }, + "wordpress": { + "body": "" + }, + "wordpress-alt": { + "body": "" + }, + "pressthis": { + "body": "" + }, + "update": { + "body": "" + }, + "screenoptions": { + "body": "" + }, + "cart": { + "body": "" + }, + "feedback": { + "body": "" + }, + "cloud": { + "body": "" + }, + "translation": { + "body": "" + }, + "tag": { + "body": "" + }, + "category": { + "body": "" + }, + "archive": { + "body": "" + }, + "tagcloud": { + "body": "" + }, + "text": { + "body": "" + }, + "media-archive": { + "body": "" + }, + "media-audio": { + "body": "" + }, + "media-code": { + "body": "" + }, + "media-default": { + "body": "" + }, + "media-document": { + "body": "" + }, + "media-interactive": { + "body": "" + }, + "media-spreadsheet": { + "body": "" + }, + "media-text": { + "body": "" + }, + "media-video": { + "body": "" + }, + "playlist-audio": { + "body": "" + }, + "playlist-video": { + "body": "" + }, + "controls-play": { + "body": "" + }, + "controls-pause": { + "body": "" + }, + "controls-forward": { + "body": "" + }, + "controls-skipforward": { + "body": "" + }, + "controls-back": { + "body": "" + }, + "controls-skipback": { + "body": "" + }, + "controls-repeat": { + "body": "" + }, + "controls-volumeon": { + "body": "" + }, + "controls-volumeoff": { + "body": "" + }, + "yes": { + "body": "" + }, + "no": { + "body": "" + }, + "no-alt": { + "body": "" + }, + "plus": { + "body": "" + }, + "plus-alt": { + "body": "" + }, + "plus-alt2": { + "body": "" + }, + "minus": { + "body": "" + }, + "dismiss": { + "body": "" + }, + "marker": { + "body": "" + }, + "star-filled": { + "body": "" + }, + "star-half": { + "body": "" + }, + "star-empty": { + "body": "" + }, + "flag": { + "body": "" + }, + "info": { + "body": "" + }, + "warning": { + "body": "" + }, + "share": { + "body": "" + }, + "share1": { + "body": "" + }, + "share-alt": { + "body": "" + }, + "share-alt2": { + "body": "" + }, + "twitter": { + "body": "" + }, + "rss": { + "body": "" + }, + "email": { + "body": "" + }, + "email-alt": { + "body": "" + }, + "facebook": { + "body": "" + }, + "facebook-alt": { + "body": "" + }, + "networking": { + "body": "" + }, + "googleplus": { + "body": "" + }, + "location": { + "body": "" + }, + "location-alt": { + "body": "" + }, + "camera": { + "body": "" + }, + "images-alt": { + "body": "" + }, + "images-alt2": { + "body": "" + }, + "video-alt": { + "body": "" + }, + "video-alt2": { + "body": "" + }, + "video-alt3": { + "body": "" + }, + "vault": { + "body": "" + }, + "shield": { + "body": "" + }, + "shield-alt": { + "body": "" + }, + "sos": { + "body": "" + }, + "search": { + "body": "" + }, + "slides": { + "body": "" + }, + "analytics": { + "body": "" + }, + "chart-pie": { + "body": "" + }, + "chart-bar": { + "body": "" + }, + "chart-line": { + "body": "" + }, + "chart-area": { + "body": "" + }, + "groups": { + "body": "" + }, + "businessman": { + "body": "" + }, + "id": { + "body": "" + }, + "id-alt": { + "body": "" + }, + "products": { + "body": "" + }, + "awards": { + "body": "" + }, + "forms": { + "body": "" + }, + "testimonial": { + "body": "" + }, + "portfolio": { + "body": "" + }, + "book": { + "body": "" + }, + "book-alt": { + "body": "" + }, + "download": { + "body": "" + }, + "upload": { + "body": "" + }, + "backup": { + "body": "" + }, + "clock": { + "body": "" + }, + "lightbulb": { + "body": "" + }, + "microphone": { + "body": "" + }, + "desktop": { + "body": "" + }, + "tablet": { + "body": "" + }, + "smartphone": { + "body": "" + }, + "phone": { + "body": "" + }, + "smiley": { + "body": "" + }, + "index-card": { + "body": "" + }, + "carrot": { + "body": "" + }, + "building": { + "body": "" + }, + "store": { + "body": "" + }, + "album": { + "body": "" + }, + "palmtree": { + "body": "" + }, + "tickets-alt": { + "body": "" + }, + "money": { + "body": "" + }, + "thumbs-up": { + "body": "" + }, + "thumbs-down": { + "body": "" + }, + "layout": { + "body": "" + }, + "align-pull-left": { + "body": "" + }, + "align-pull-right": { + "body": "" + }, + "block-default": { + "body": "" + }, + "cloud-saved": { + "body": "" + }, + "cloud-upload": { + "body": "" + }, + "columns": { + "body": "" + }, + "cover-image": { + "body": "" + }, + "embed-audio": { + "body": "" + }, + "embed-generic": { + "body": "" + }, + "embed-photo": { + "body": "" + }, + "embed-post": { + "body": "" + }, + "embed-video": { + "body": "" + }, + "edit": { + "body": "" + }, + "html": { + "body": "" + }, + "info-outline": { + "body": "" + }, + "insert-after": { + "body": "" + }, + "insert-before": { + "body": "" + }, + "insert": { + "body": "" + }, + "remove": { + "body": "" + }, + "shortcode": { + "body": "" + }, + "table-col-after": { + "body": "" + }, + "table-col-before": { + "body": "" + }, + "table-col-delete": { + "body": "" + }, + "table-row-after": { + "body": "" + }, + "table-row-before": { + "body": "" + }, + "table-row-delete": { + "body": "" + }, + "saved": { + "body": "" + }, + "amazon": { + "body": "" + }, + "google": { + "body": "" + }, + "linkedin": { + "body": "" + }, + "pinterest": { + "body": "" + }, + "podio": { + "body": "" + }, + "reddit": { + "body": "" + }, + "spotify": { + "body": "" + }, + "twitch": { + "body": "" + }, + "whatsapp": { + "body": "" + }, + "xing": { + "body": "" + }, + "youtube": { + "body": "" + }, + "database-add": { + "body": "" + }, + "database-export": { + "body": "" + }, + "database-import": { + "body": "" + }, + "database-remove": { + "body": "" + }, + "database-view": { + "body": "" + }, + "database": { + "body": "" + }, + "bell": { + "body": "" + }, + "airplane": { + "body": "" + }, + "car": { + "body": "" + }, + "calculator": { + "body": "" + }, + "games": { + "body": "" + }, + "printer": { + "body": "" + }, + "beer": { + "body": "" + }, + "drumstick": { + "body": "" + }, + "food": { + "body": "" + }, + "bank": { + "body": "" + }, + "hourglass": { + "body": "" + }, + "money-alt": { + "body": "" + }, + "open-folder": { + "body": "" + }, + "pdf": { + "body": "" + }, + "pets": { + "body": "" + }, + "privacy": { + "body": "" + }, + "superhero": { + "body": "" + }, + "superhero-alt": { + "body": "" + }, + "edit-page": { + "body": "" + }, + "fullscreen-alt": { + "body": "" + }, + "fullscreen-exit-alt": { + "body": "" + }, + "coffee": { + "body": "" + } + }, + "suffixes": { + "": "Regular", + "square": "Square" + }, + "width": 448, + "height": 512 +} diff --git a/build/vanilla-icon-picker/LICENSE b/build/vanilla-icon-picker/LICENSE new file mode 100644 index 00000000..046ae8b2 --- /dev/null +++ b/build/vanilla-icon-picker/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Appolo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/build/vanilla-icon-picker/README.md b/build/vanilla-icon-picker/README.md new file mode 100644 index 00000000..c3ddc554 --- /dev/null +++ b/build/vanilla-icon-picker/README.md @@ -0,0 +1,194 @@ +# Vanilla icon picker + +![GitHub package.json version](https://img.shields.io/github/package-json/v/appolodev/icon-picker?color=blue&style=flat-square) +![npm](https://img.shields.io/npm/dm/vanilla-icon-picker?color=%2325b5ba&style=flat-square) +![GitHub](https://img.shields.io/github/license/appolodev/icon-picker?style=flat-square) +[![pages-build-deployment](https://github.com/AppoloDev/vanilla-icon-picker/actions/workflows/pages/pages-build-deployment/badge.svg)](https://github.com/AppoloDev/vanilla-icon-picker/actions/workflows/pages/pages-build-deployment) + +### Icons includes: + +- FontAwesome 6&7 (Brands, Solid and Regular) +- Material Design Icons +- Iconoir + +## Installation + +➡️ Using a package manager + +```bash +npm i vanilla-icon-picker +``` +```js +// One of the following themes +import 'vanilla-icon-picker/dist/themes/default.min.css'; // 'default' theme +import 'vanilla-icon-picker/dist/themes/bootstrap-5.min.css'; // 'bootstrap-5' theme + +import IconPicker from 'vanilla-icon-picker'; +``` + +> ⚠️ Attention: If you use bootstrap theme don't forget to include bootstrap 5 css. + +➡️ Using script +```html + +``` + +and stylesheet +```html + + +``` + +## Usage + +```javascript +const iconPicker = new IconPicker('input', { + // Options +}); +``` + +[Live demo →](https://appolodev.github.io/vanilla-icon-picker/) + +## Options + +> 💙 You can find icons sets at [Iconify](https://github.com/iconify/icon-sets/tree/master/json) + + +```javascript +{ + // Change icon picker's theme + theme: 'default' | 'bootstrap-5', + + // Set icon(s) library(ies) + // iconSource: [ + // 'FontAwesome Brands 7', + // 'FontAwesome Solid 7', + // 'FontAwesome Regular 7', + // 'Material Design Icons', + // 'Iconoir', + // { + // key: 'academicons', + // prefix: 'ai ai-', + // url: 'https://raw.githubusercontent.com/iconify/icon-sets/master/json/academicons.json' + // } + // ] + iconSource: [], + + // Close icon picker modal when icon is selected + // If is `false` save button appear + closeOnSelect: true, + + // Set a default value, preselect for example + // icon's value and icon's name work + defaultValue: null, + + // Translatable text + i18n: { + 'input:placeholder': 'Search icon…', + + 'text:title': 'Select icon', + 'text:empty': 'No results found…', + + 'btn:save': 'Save' + } +} +``` + +## Events + +Use the `on(event, callback)` and `off(event, callback)` functions to bind / unbind eventlistener. + +| Event | Description | Arguments | +|----------|-------------------------------------------------------------------------------------------------------------------------------|----------------------| +| `select` | Icon is selected, return icon value, name, svg and unicode if exist | `Object` | +| `save` | Fired when saved with button or if `closeOnSelect` option is `true`, return return icon value, name, svg and unicode if exist | `Object` | +| `loaded` | All icons are loaded | `void` | +| `clear` | `clear()` method is called | `void` | +| `show` | Modal is shown | `IconPickerInstance` | +| `hide` | Modal picker is hidden | `IconPickerInstance` | + +```javascript +iconPicker.on('select', instance => { + console.log('Select:', instance); +}); +``` + +## Methods + +After we initialize IconPicker, we have access instance. Let's look list all available methods: + +| Method | Description | +|---------------------------|------------------------------------------------------------------------------| +| `on()` | Add event handler | +| `off()` | Remove event handler | +| `open()` | Open IconPicker's modal | +| `hide()` | Remove IconPicker's modal | +| `clear()` | Clear current icon | +| `isOpen()` | Check if open or not | +| `iconsLoaded()` | Check if the icons are loaded | +| `destroy(deleteInstance)` | Set it to false (by default it is true) to not to delete IconPicker instance | + +## Icon format setting in JSON files + +While this picker uses icon sets found at [Iconify](https://github.com/iconify/icon-sets/tree/master/json), it supports +an extension to their format to allow improved performance with large icon sets. + +By default, those icon sets include the actual SVG directly, and the picker includes the SVG markup inline. In cases +where the actual SVGs are not needed (e.g. if you're using Font Awesome and the required CSS / JavaScript is +included on the page), adding a new, optional `iconFormat` setting to the JSON file will allow you to remove the SVGs +and reduce file sizes by over 90%, making the loading of the picker much faster. + +`iconFormat` is optional and can be set to three different values: + +- `svg` (the default) - `body` must include the full SVG. + +- `i` - `body` is not needed at all. The picker will use markup like ``. + +Example JSON (snipped, `iconFormat` can be set to "i", `body` can be empty or missing entirely) +```json +{ + "prefix": "far fa-", + "iconFormat": "i", + "info": { + "name": "Font Awesome Regular" + }, + "lastModified": 1689174287, + "icons": { + "abacus": { + "body": "", + "width": 576 + }, + "acorn": { + "width": 448 + } + } +} +``` + +- `markup` - The picker uses the actual markup set in the `body`. This allows the use of different, custom markup for +icons, e.g. ``. + +Example JSON (snipped, `iconFormat` must be set to "markup", `body` must be set) +```json +{ + "prefix": "far fa-", + "iconFormat": "markup", + "info": { + "name": "Font Awesome Regular" + }, + "lastModified": 1689174287, + "icons": { + "abacus": { + "body": "", + "width": 576 + } + } +} +``` + +To take advantage of this, you could download the JSON file and use search-and-replace to remove the body values from +the file. Then, you would need to set `iconSource` per the Options section above to use your new JSON file. + +## Licence + +MIT Licence diff --git a/build/vanilla-icon-picker/dist/icon-picker.min.js b/build/vanilla-icon-picker/dist/icon-picker.min.js new file mode 100644 index 00000000..f4142f4f --- /dev/null +++ b/build/vanilla-icon-picker/dist/icon-picker.min.js @@ -0,0 +1,3 @@ +/*! Icon Picker 1.4.2 MIT | https://github.com/AppoloDev/icon-picker */ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.IconPicker=t():e.IconPicker=t()}(self,(()=>(()=>{"use strict";var e={d:(t,i)=>{for(var n in i)e.o(i,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:i[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},t={};function i(e,t,i,n){Array.isArray(t)||(t=[t]),Array.isArray(i)||(i=[i]);for(const s of t)for(const t of i)s[e](t,n);return[].slice.call(arguments,1)}e.d(t,{default:()=>m});const n=i.bind(null,"addEventListener"),s=i.bind(null,"removeEventListener");function o(e){if(window.DOMParser){return(new DOMParser).parseFromString(e,"text/html").body.firstElementChild}const t=document.createElement("div");return t.innerHTML=e,t.firstElementChild}function r(e){return e&&"object"==typeof e&&!Array.isArray(e)}function a(e,t){let i=Object.assign({},e);return r(e)&&r(t)&&Object.keys(t).forEach((n=>{r(t[n])?n in e?i[n]=a(e[n],t[n]):Object.assign(i,{[n]:t[n]}):Object.assign(i,{[n]:t[n]})})),i}function l(e,t){return Object.keys(e).find((i=>e[i]===t))}const c=e=>{const{theme:t,i18n:i,closeOnSelect:n}=e,s=function(e){const t=(e,t)=>{const i=e.getAttribute(t);return e.removeAttribute(t),i},i=(e,n={})=>{const s=t(e,"data-element");s&&(n[s]=e);for(const s of Array.from(e.children)){const e=t(s,"data-interaction");e&&e&&(n[e]=s),i(s,n)}return n};return i(o(e))}(`\n \n `);return t.includes("bootstrap")&&(s.save?.classList.add("btn","btn-primary"),s.search.classList.add("form-control")),s};const d="https://raw.githubusercontent.com/iconify/icon-sets/master/json",u={"Material Design Icons":{key:"mdi",prefix:"mdi mdi-",url:`${d}/mdi.json`},"FontAwesome Brands 6":{key:"fa6-brands",prefix:"fab fa-",url:`${d}/fa6-brands.json`},"FontAwesome Solid 6":{key:"fa6-solid",prefix:"fas fa-",url:`${d}/fa6-solid.json`},"FontAwesome Regular 6":{key:"fa6-regular",prefix:"far fa-",url:`${d}/fa6-regular.json`},"FontAwesome Brands 7":{key:"fa7-brands",prefix:"fab fa-",url:`${d}/fa7-brands.json`},"FontAwesome Solid 7":{key:"fa7-solid",prefix:"fas fa-",url:`${d}/fa7-solid.json`},"FontAwesome Regular 7":{key:"fa7-regular",prefix:"far fa-",url:`${d}/fa7-regular.json`},Iconoir:{key:"iconoir",prefix:"iconoir-",url:`${d}/iconoir.json`}};function h(e){let t=Object.create({});return Array.isArray(e)&&e.forEach((e=>{!function(e){return u.hasOwnProperty(e)}(e)?e.key&&(t[e.key]=e):t[u[e].key]=u[e]})),t}class m{static DEFAULT_OPTIONS={theme:"default",closeOnSelect:!0,defaultValue:null,iconSource:[],i18n:{"input:placeholder":"Search icon…","text:title":"Select icon","text:empty":"No results found…","text:loading":"Loading…","btn:save":"Save"}};_eventListener={select:[],save:[],show:[],clear:[],hide:[],loaded:[]};constructor(e,t={}){this.options=a(m.DEFAULT_OPTIONS,t),this.element=e,this.iconsLoading=!0,this._preBuild(),this.element&&this.options.iconSource.length>0?(this._binEvents(),this._renderdIcons(),this._createModal()):this._catchError("iconSourceMissing")}_preBuild(){var e;this.element=(e=this.element)instanceof HTMLElement?e:"string"==typeof e?document.querySelector(e):null,this.root=c(this.options),!Array.isArray(this.options.iconSource)&&this.options.iconSource.length>0&&(this.options.iconSource=[this.options.iconSource])}_binEvents(){const{options:e,root:t,element:i}=this;let s=[];var r,a,l;this._eventBindings=[n(i,"click",(()=>this.show())),n(t.close,"click",(()=>this.hide())),n(t.modal,"click",(e=>{e.target===t.modal&&this.hide()})),n(t.search,"keyup",(r=i=>{const n=this.availableIcons.filter((e=>e.value.includes(i.target.value.toLowerCase())||e.categories?.filter((e=>e.includes(i.target.value.toLowerCase()))).length>0));s.length||(s=document.querySelectorAll(".icon-element")),s.forEach((e=>{e.hidden=!0,n.forEach((t=>{e.classList.contains(t.value)&&(e.hidden=!1)}))}));const r=t.content.querySelector(".is-empty");n.length>0?r&&r.remove():r||t.content.appendChild(o(`
          ${e.i18n["text:empty"]}
          `))},a=250,function(){var e=arguments,t=this;clearTimeout(l),l=setTimeout((function(){r.apply(t,e)}),a)}))],e.closeOnSelect||this._eventBindings.push(n(t.save,"click",(()=>this._onSave())))}hide(){return!!this.isOpen()&&(this.root.modal.classList.remove("is-visible"),this._emit("hide"),this)}show(){return!this.isOpen()&&(this.root.modal.classList.add("is-visible"),this._emit("show"),this)}clear(){this.initialized&&this.currentlySelectName&&(this.currentlySelectName=null,this._emit("clear"))}isOpen(){return this.root.modal.classList.contains("is-visible")}iconsLoaded(){return!this.loadingState}destroy(e=!0){this.initialized=!1,this._eventBindings.forEach((e=>s(...e))),e&&Object.keys(this).forEach((e=>delete this[e]))}_emit(e,...t){this._eventListener[e].forEach((e=>e(...t,this)))}on(e,t){return void 0!==this._eventListener[e]&&(this._eventListener[e].push(t),this)}off(e,t){const i=this._eventListener[e]||[],n=i.indexOf(t);return~n&&i.splice(n,1),this}_createModal(){document.body.appendChild(this.root.modal),this.initialized=!0}_onSave(){this._setValueInput(),this.hide(),this._emit("save",this.emitValues)}async _renderdIcons(){const{root:e,options:t}=this;let i=null,n=null,s=null;if(this.availableIcons=[],e.content.innerHTML=`
          ${t.i18n["text:loading"]}
          `,(await this._getIcons()).forEach((o=>{let r=o.iconFormat?o.iconFormat:"svg";for(const[a,c]of Object.entries(o.icons)){const d=document.createElement("button");if(d.title=a,d.className=`icon-element ${a}`,d.dataset.value=o.prefix+a,o.categories&&Object.entries(o.categories).length>0){s=[];for(const[e]of Object.entries(o.categories))o.categories[e].includes(a)&&(s.length>0?s.push(e.toLowerCase()):s=[e.toLowerCase()])}let u;if(o.chars&&(d.dataset.unicode=l(o.chars,a)),"i"!==r&&c.body)if("markup"===r){let e=document.createElement("template");e.innerHTML=c.body,u=e.content}else u=document.createElementNS("http://www.w3.org/2000/svg","svg"),u.setAttribute("height","24"),u.setAttribute("width","24"),u.setAttribute("viewBox",`0 0 ${c.width?c.width:o.width} ${c.height?c.height:o.height}`),u.innerHTML=c.body;else u=document.createElement("i"),u.setAttribute("class",d.dataset.value);d.append(u),e.content.appendChild(d),this.availableIcons.push({value:a,body:u.outerHTML,...s?.length>0&&{categories:s}}),d.addEventListener("click",(e=>{this.currentlySelectName!==e.currentTarget.firstChild.className&&(e.currentTarget.classList.add("is-selected"),n=e.currentTarget,this.currentlySelectName=n.dataset.value,this.SVGString=u.outerHTML,this.emitValues={name:a,value:this.currentlySelectName,svg:this.SVGString},o.chars&&(this.emitValues.unicode=u.dataset.unicode),this._emit("select",this.emitValues)),i&&i.classList.remove("is-selected"),t.closeOnSelect&&this._onSave(),i=n}))}})),t.defaultValue||this.element.value){let e=document.querySelector(`[data-value="${t.defaultValue?t.defaultValue:this.element.value}"]`)?document.querySelector(`[data-value="${t.defaultValue?t.defaultValue:this.element.value}"]`):document.querySelector(`.${t.defaultValue?t.defaultValue:this.element.value}`),n=e?.dataset.value??"";e?.classList.add("is-selected"),i=e,this.currentlySelectName=n,this.element.value||this._setValueInput()}const o=e.content.querySelector(".is-loading");o&&o.remove(),this.iconsLoading=!1,this._emit("loaded")}async _getIcons(){const{options:e}=this,t=[];let i=h(e.iconSource);for(const e of Object.values(i))t.push(e.url);return await Promise.all(t.map((e=>fetch(e).then((e=>e.json()))))).then((e=>(e.forEach((e=>{i.hasOwnProperty(e.prefix)&&(e.prefix=i[e.prefix].prefix)})),e)))}_catchError(e){if("iconSourceMissing"===e)throw Error("No icon source was found.")}_setValueInput(e=this.currentlySelectName){const{element:t}=this;t instanceof HTMLInputElement&&this.currentlySelectName&&(t.value=e)}}return t=t.default})())); +//# sourceMappingURL=icon-picker.min.map \ No newline at end of file diff --git a/build/vanilla-icon-picker/dist/icon-picker.min.map b/build/vanilla-icon-picker/dist/icon-picker.min.map new file mode 100644 index 00000000..00448cf4 --- /dev/null +++ b/build/vanilla-icon-picker/dist/icon-picker.min.map @@ -0,0 +1 @@ +{"version":3,"file":"icon-picker.min.js","mappings":";CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAoB,WAAID,IAExBD,EAAiB,WAAIC,IARvB,CASGK,MAAM,I,mBCRT,IAAIC,EAAsB,CCA1BA,EAAwB,CAACL,EAASM,KACjC,IAAI,IAAIC,KAAOD,EACXD,EAAoBG,EAAEF,EAAYC,KAASF,EAAoBG,EAAER,EAASO,IAC5EE,OAAOC,eAAeV,EAASO,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3EF,EAAwB,CAACQ,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,I,KCAlF,SAASI,EAAcC,EAAQC,EAAUC,EAAQC,GACxCC,MAAMC,QAAQJ,KACfA,EAAW,CAACA,IAGXG,MAAMC,QAAQH,KACfA,EAAS,CAACA,IAGd,IAAK,MAAMI,KAAML,EACb,IAAK,MAAMM,KA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BAAoB1G,KAAK8C,sBAC5ChF,EAAQX,MAAQA,I","sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap","webpack:///webpack/runtime/define property getters","webpack:///webpack/runtime/hasOwnProperty shorthand","webpack:///./src/js/utlis/utils.js","webpack:///./src/js/template.js","webpack:///./src/js/utlis/collections.js","webpack:///./src/js/IconPicker.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"IconPicker\"] = factory();\n\telse\n\t\troot[\"IconPicker\"] = factory();\n})(self, () => {\nreturn ","// The require scope\nvar __webpack_require__ = {};\n\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))","function eventListener(method, elements, events, fn) {\n if (!Array.isArray(elements)) {\n elements = [elements];\n }\n\n if (!Array.isArray(events)) {\n events = [events];\n }\n\n for (const el of elements) {\n for (const ev of events) {\n el[method](ev, fn);\n }\n }\n\n return [].slice.call(arguments, 1);\n}\n\n/**\n * Add event to element.\n * @param elements DOM-Elements\n * @param events Event names\n * @param fn Callback\n * @param options Optional options\n * @return Array passed arguments\n */\nexport const addEvent = eventListener.bind(null, 'addEventListener');\n\n/**\n * Remove event from element.\n * @param elements DOM-Elements\n * @param events Event names\n * @param fn Callback\n * @param options Optional options\n * @return Array passed arguments\n */\nexport const removeEvent = eventListener.bind(null, 'removeEventListener');\n\n/**\n * Resolves a HTMLElement by query.\n * @param val\n * @returns {null|Document|Element}\n */\nexport function resolveElement(val) {\n if (val instanceof HTMLElement) {\n return val;\n } else if (typeof val === 'string') {\n return document.querySelector(val)\n }\n\n return null;\n}\n\n/**\n * Convert a template string into HTML DOM nodes\n * @param {String} str The template string\n * @return {Node} The template HTML\n */\nexport function stringToHTML(str) {\n if (window.DOMParser) {\n const parser = new DOMParser();\n const doc = parser.parseFromString(str, 'text/html');\n return doc.body.firstElementChild;\n }\n\n const dom = document.createElement('div');\n dom.innerHTML = str;\n return dom.firstElementChild;\n}\n\n/**\n * Check if item is an object\n * @param {Object} item\n * @returns {boolean}\n */\nexport function isObject(item) {\n return (item && typeof item === 'object' && !Array.isArray(item));\n}\n\n/**\n *\n * @param target\n * @param source\n * @returns {Object}\n */\nexport function mergeDeep(target, source) {\n let output = Object.assign({}, target);\n\n if (isObject(target) && isObject(source)) {\n Object.keys(source).forEach(key => {\n if (isObject(source[key])) {\n if (!(key in target))\n Object.assign(output, {[key]: source[key]});\n else\n output[key] = mergeDeep(target[key], source[key]);\n } else {\n Object.assign(output, {[key]: source[key]});\n }\n });\n }\n return output;\n}\n\n/**\n *\n * @param callback\n * @param delay\n * @returns {(function(): void)|*}\n */\nexport function debounce(callback, delay){\n var timer;\n return function(){\n var args = arguments;\n var context = this;\n clearTimeout(timer);\n timer = setTimeout(function(){\n callback.apply(context, args);\n }, delay)\n }\n}\n\n/**\n *\n * @param object\n * @param value\n * @returns {string}\n */\nexport function getKeyByValue(object, value) {\n return Object.keys(object).find(key => object[key] === value);\n}\n","import {stringToHTML} from \"./utlis/utils\";\n\nexport default options => {\n const {theme, i18n, closeOnSelect} = options;\n\n const modalElement = getHTMLElements(`\n
          \n
          \n
          \n ${typeof i18n['text:title'] === 'string' && i18n['text:title'] !== '' ? `

          ${i18n['text:title']}

          ` : ''}\n \n \n
          \n \n \n \n
          \n \n ${!closeOnSelect ? `\n
          \n \n
          ` : ''\n }\n
          \n
          \n `);\n\n if (theme.includes('bootstrap')) {\n modalElement.save?.classList.add('btn', 'btn-primary');\n modalElement.search.classList.add('form-control');\n }\n\n return modalElement;\n}\n\n\nfunction getHTMLElements(str) {\n const removeAttribute = (el, name) => {\n const value = el.getAttribute(name);\n el.removeAttribute(name);\n return value;\n };\n\n const resolve = (element, base = {}) => {\n const elementKey = removeAttribute(element, 'data-element');\n elementKey && (base[elementKey] = element);\n\n for (const child of Array.from(element.children)) {\n const childInteractionKey = removeAttribute(child, 'data-interaction');\n\n if (childInteractionKey) {\n childInteractionKey && (base[childInteractionKey] = child);\n }\n\n resolve(child, base);\n }\n\n return base;\n };\n\n return resolve(stringToHTML(str));\n}\n","const iconifyPath = 'https://raw.githubusercontent.com/iconify/icon-sets/master/json';\n\nexport const collections = {\n 'Material Design Icons': {\n key: 'mdi',\n prefix: 'mdi mdi-',\n url: `${iconifyPath}/mdi.json`\n },\n 'FontAwesome Brands 6': {\n key: 'fa6-brands',\n prefix: 'fab fa-',\n url: `${iconifyPath}/fa6-brands.json`\n },\n 'FontAwesome Solid 6': {\n key: 'fa6-solid',\n prefix: 'fas fa-',\n url: `${iconifyPath}/fa6-solid.json`\n\n },\n 'FontAwesome Regular 6': {\n key: 'fa6-regular',\n prefix: 'far fa-',\n url: `${iconifyPath}/fa6-regular.json`\n },\n 'FontAwesome Brands 7': {\n key: 'fa7-brands',\n prefix: 'fab fa-',\n url: `${iconifyPath}/fa7-brands.json`\n },\n 'FontAwesome Solid 7': {\n key: 'fa7-solid',\n prefix: 'fas fa-',\n url: `${iconifyPath}/fa7-solid.json`\n\n },\n 'FontAwesome Regular 7': {\n key: 'fa7-regular',\n prefix: 'far fa-',\n url: `${iconifyPath}/fa7-regular.json`\n },\n 'Iconoir': {\n key: 'iconoir',\n prefix: 'iconoir-',\n url: `${iconifyPath}/iconoir.json`\n }\n}\n\n/**\n *\n * @param {array} collectionsOptions\n */\nexport function resolveCollection(collectionsOptions) {\n let collectionResolved = Object.create({});\n\n if (Array.isArray(collectionsOptions)) {\n collectionsOptions.forEach((collection) => {\n if (hasCollection(collection)) {\n collectionResolved[collections[collection].key] = collections[collection]\n } else if (collection.key) {\n collectionResolved[collection.key] = collection\n }\n })\n }\n\n return collectionResolved;\n}\n\n/**\n *\n * @param {string} collection\n * @returns {boolean}\n */\nfunction hasCollection(collection) {\n return collections.hasOwnProperty(collection)\n}\n","import * as _ from \"./utlis/utils\";\nimport template from \"./template\";\nimport { resolveCollection } from \"./utlis/collections\";\n\nexport default class IconPicker {\n static DEFAULT_OPTIONS = {\n theme: 'default',\n closeOnSelect: true,\n defaultValue: null,\n iconSource: [],\n i18n: {\n 'input:placeholder': 'Search icon…',\n\n 'text:title': 'Select icon',\n 'text:empty': 'No results found…',\n 'text:loading' : 'Loading…',\n\n 'btn:save': 'Save'\n }\n }\n\n _eventListener = {\n select: [],\n save: [],\n show: [],\n clear: [],\n hide: [],\n loaded: []\n };\n\n /**\n *\n * @param {string | HTMLElement} el\n * @param {Object} options\n */\n constructor(el, options = {}) {\n this.options = _.mergeDeep(IconPicker.DEFAULT_OPTIONS, options);\n this.element = el;\n this.iconsLoading = true;\n\n // Initialize icon picker\n this._preBuild();\n\n if (this.element && this.options.iconSource.length > 0) {\n this._binEvents();\n this._renderdIcons();\n this._createModal();\n } else {\n this._catchError('iconSourceMissing');\n }\n }\n\n _preBuild() {\n this.element = _.resolveElement(this.element);\n this.root = template(this.options);\n\n if (!Array.isArray(this.options.iconSource) && this.options.iconSource.length > 0) {\n this.options.iconSource = [this.options.iconSource];\n }\n }\n\n _binEvents() {\n const {options, root, element} = this;\n let iconsElements = [];\n\n this._eventBindings = [\n _.addEvent(element, 'click', () => this.show()),\n _.addEvent(root.close, 'click', () => this.hide()),\n _.addEvent(root.modal, 'click', (evt) => {\n if (evt.target === root.modal) {\n this.hide();\n }\n }),\n _.addEvent(root.search, 'keyup', _.debounce((evt) => {\n const iconsResult = this.availableIcons.filter((obj) => {\n return obj.value.includes(evt.target.value.toLowerCase()) || obj.categories?.filter(c => c.includes(evt.target.value.toLowerCase())).length > 0\n });\n\n if (!iconsElements.length) {\n iconsElements = document.querySelectorAll('.icon-element');\n }\n\n iconsElements.forEach((iconElement) => {\n iconElement.hidden = true;\n\n iconsResult.forEach((result) => {\n if (iconElement.classList.contains(result.value)) {\n iconElement.hidden = false;\n }\n });\n });\n\n const emptyElement = root.content.querySelector('.is-empty');\n\n if (iconsResult.length > 0) {\n if (emptyElement) {\n emptyElement.remove();\n }\n } else {\n if (!emptyElement) {\n root.content.appendChild(_.stringToHTML(`
          ${options.i18n['text:empty']}
          `));\n }\n }\n }, 250))\n ];\n\n if (!options.closeOnSelect) {\n this._eventBindings.push(_.addEvent(root.save, 'click', () => this._onSave()));\n }\n }\n\n /**\n * Hide icon picker modal\n */\n hide() {\n if (this.isOpen()) {\n this.root.modal.classList.remove('is-visible');\n this._emit('hide');\n\n return this;\n }\n\n return false\n }\n\n /**\n * Show icon picker modal\n */\n show() {\n if (!this.isOpen()) {\n this.root.modal.classList.add('is-visible');\n this._emit('show');\n\n return this;\n }\n\n return false\n }\n\n clear() {\n if (this.initialized && this.currentlySelectName) {\n this.currentlySelectName = null;\n\n this._emit('clear');\n }\n }\n\n /**\n * Check if modal is open\n * @returns {boolean}\n */\n isOpen() {\n return this.root.modal.classList.contains('is-visible');\n }\n\n /**\n * Check if the icons are loaded\n * @returns {boolean}\n */\n iconsLoaded(){\n return !this.loadingState;\n }\n\n /**\n * Destroy icon picker instance and detach all events listeners\n * @param {boolean} deleteInstance\n */\n destroy(deleteInstance = true) {\n this.initialized = false;\n\n // Remove elements events\n this._eventBindings.forEach(args => _.removeEvent(...args));\n\n // Delete instance\n if (deleteInstance) {\n Object.keys(this).forEach((key) => delete this[key]);\n }\n }\n\n _emit(event, ...args) {\n this._eventListener[event].forEach(cb => cb(...args, this));\n }\n\n on(event, callback) {\n if (this._eventListener[event] !== undefined) {\n this._eventListener[event].push(callback);\n return this;\n }\n\n return false\n }\n\n off(event, callback) {\n const callBacks = (this._eventListener[event] || []);\n const index = callBacks.indexOf(callback);\n\n if (~index) {\n callBacks.splice(index, 1);\n }\n\n return this;\n }\n\n _createModal() {\n document.body.appendChild(this.root.modal);\n\n this.initialized = true;\n }\n\n _onSave() {\n this._setValueInput()\n\n this.hide();\n this._emit('save', this.emitValues);\n }\n\n /**\n * Generate icons elements\n * @private\n */\n async _renderdIcons() {\n const {root, options} = this;\n let previousSelectedIcon = null;\n let currentlySelectElement = null;\n let categories = null;\n this.availableIcons = [];\n\n root.content.innerHTML = `
          ${options.i18n['text:loading']}
          `;\n\n let icons = await this._getIcons();\n\n icons.forEach((library) => {\n let iconFormat = library.iconFormat ? library.iconFormat : 'svg';\n\n for (const [key, value] of Object.entries(library.icons)) {\n const iconTarget = document.createElement('button');\n iconTarget.title = key\n iconTarget.className = `icon-element ${key}`;\n iconTarget.dataset.value = library.prefix + key;\n\n if (library.categories && Object.entries(library.categories).length > 0) {\n categories = [];\n\n for (const [categoryKey] of Object.entries(library.categories)) {\n if (library.categories[categoryKey].includes(key)) {\n if (categories.length > 0) {\n categories.push(categoryKey.toLowerCase())\n } else {\n categories = [categoryKey.toLowerCase()]\n }\n }\n }\n }\n\n if (library.chars) {\n iconTarget.dataset.unicode = _.getKeyByValue(library.chars, key);\n }\n\n let iconElement;\n if (iconFormat === 'i' || !value.body) {\n iconElement = document.createElement('i');\n iconElement.setAttribute('class', iconTarget.dataset.value);\n } else if (iconFormat === 'markup') {\n let t = document.createElement('template');\n t.innerHTML = value.body;\n iconElement = t.content;\n } else {\n iconElement = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n iconElement.setAttribute('height', '24');\n iconElement.setAttribute('width', '24');\n iconElement.setAttribute('viewBox', `0 0 ${value.width ? value.width : library.width} ${value.height ? value.height : library.height}`);\n iconElement.innerHTML = value.body;\n }\n\n iconTarget.append(iconElement)\n\n root.content.appendChild(iconTarget);\n\n this.availableIcons.push({value: key, body: iconElement.outerHTML, ...(categories?.length > 0 && {categories})});\n\n // Icon click event\n iconTarget.addEventListener('click', (evt) => {\n if (this.currentlySelectName !== evt.currentTarget.firstChild.className) {\n evt.currentTarget.classList.add('is-selected');\n\n currentlySelectElement = evt.currentTarget;\n this.currentlySelectName = currentlySelectElement.dataset.value;\n this.SVGString = iconElement.outerHTML;\n\n this.emitValues = {\n name: key,\n value: this.currentlySelectName,\n svg: this.SVGString,\n }\n\n if (library.chars) {\n this.emitValues.unicode = iconElement.dataset.unicode\n }\n\n this._emit('select', this.emitValues);\n }\n\n if (previousSelectedIcon) {\n previousSelectedIcon.classList.remove('is-selected');\n }\n\n if (options.closeOnSelect) {\n this._onSave();\n }\n\n previousSelectedIcon = currentlySelectElement;\n });\n }\n });\n\n if (options.defaultValue || this.element.value) {\n // Check if icon name ou icon value is set\n let defaultValueElement = document.querySelector(`[data-value=\"${options.defaultValue ? options.defaultValue : this.element.value}\"]`) ?\n document.querySelector(`[data-value=\"${options.defaultValue ? options.defaultValue : this.element.value}\"]`) :\n document.querySelector(`.${options.defaultValue ? options.defaultValue : this.element.value}`);\n\n let iconValue = defaultValueElement?.dataset.value ?? '';\n defaultValueElement?.classList.add('is-selected');\n\n previousSelectedIcon = defaultValueElement;\n this.currentlySelectName = iconValue;\n\n if (!this.element.value) {\n this._setValueInput();\n }\n }\n\n const loadingElement = root.content.querySelector('.is-loading');\n if (loadingElement) {\n loadingElement.remove();\n }\n\n this.iconsLoading = false;\n this._emit('loaded');\n }\n\n /**\n *\n * @returns {string}\n * @private\n */\n async _getIcons() {\n const {options} = this\n const iconsURL = [];\n\n let sourceInformation = resolveCollection(options.iconSource);\n\n for (const source of Object.values(sourceInformation)) {\n iconsURL.push(source.url)\n }\n\n return await Promise.all(iconsURL.map((iconURL) => fetch(iconURL).then((response) => response.json())))\n .then((iconLibrary) => {\n iconLibrary.forEach((library) => {\n if (sourceInformation.hasOwnProperty(library.prefix)) {\n library.prefix = sourceInformation[library.prefix].prefix\n }\n });\n\n return iconLibrary;\n });\n }\n\n /**\n *\n * @param {string} exception\n * @private\n */\n _catchError(exception) {\n switch (exception) {\n case 'iconSourceMissing':\n throw Error('No icon source was found.');\n }\n }\n\n /**\n * Set value into input element\n * @param value\n * @private\n */\n _setValueInput(value = this.currentlySelectName) {\n const {element} = this;\n\n if (element instanceof HTMLInputElement && this.currentlySelectName) {\n element.value = value;\n }\n }\n}\n"],"names":["root","factory","exports","module","define","amd","self","__webpack_require__","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","eventListener","method","elements","events","fn","Array","isArray","el","ev","slice","arguments","addEvent","bind","removeEvent","stringToHTML","str","window","DOMParser","parseFromString","body","firstElementChild","dom","document","createElement","innerHTML","isObject","item","mergeDeep","target","source","output","assign","keys","forEach","getKeyByValue","object","value","find","options","theme","i18n","closeOnSelect","modalElement","removeAttribute","name","getAttribute","resolve","element","base","elementKey","child","from","children","childInteractionKey","getHTMLElements","includes","save","classList","add","search","iconifyPath","collections","prefix","url","resolveCollection","collectionsOptions","collectionResolved","create","collection","hasCollection","IconPicker","static","defaultValue","iconSource","_eventListener","select","show","clear","hide","loaded","constructor","this","DEFAULT_OPTIONS","iconsLoading","_preBuild","length","_binEvents","_renderdIcons","_createModal","_catchError","val","HTMLElement","querySelector","template","iconsElements","callback","delay","timer","_eventBindings","close","modal","evt","iconsResult","availableIcons","filter","toLowerCase","categories","c","querySelectorAll","iconElement","hidden","result","contains","emptyElement","content","remove","appendChild","args","context","clearTimeout","setTimeout","apply","push","_onSave","isOpen","_emit","initialized","currentlySelectName","iconsLoaded","loadingState","destroy","deleteInstance","event","cb","on","undefined","off","callBacks","index","indexOf","splice","_setValueInput","emitValues","async","previousSelectedIcon","currentlySelectElement","_getIcons","library","iconFormat","entries","icons","iconTarget","title","className","dataset","categoryKey","chars","unicode","t","createElementNS","setAttribute","width","height","append","outerHTML","addEventListener","currentTarget","firstChild","SVGString","svg","defaultValueElement","iconValue","loadingElement","iconsURL","sourceInformation","values","Promise","all","map","iconURL","fetch","then","response","json","iconLibrary","exception","Error","HTMLInputElement"],"sourceRoot":""} \ No newline at end of file diff --git a/build/vanilla-icon-picker/dist/themes/bootstrap-5.min.css b/build/vanilla-icon-picker/dist/themes/bootstrap-5.min.css new file mode 100644 index 00000000..ed0361fe --- /dev/null +++ b/build/vanilla-icon-picker/dist/themes/bootstrap-5.min.css @@ -0,0 +1,2 @@ +/*! Icon Picker 1.4.2 MIT | https://github.com/AppoloDev/icon-picker */ +.icon-picker-modal{position:fixed;left:0;top:0;bottom:0;right:0;z-index:100000;background-color:rgba(68,69,69,0);visibility:hidden;transition:background-color .3s ease-out,visibility .3s ease-out}.icon-picker-modal.is-visible{background-color:rgba(68,69,69,.6);visibility:visible}.icon-picker-modal.is-visible .icon-picker-modal__dialog{transform:translate(-50%, -50%);opacity:1}.icon-picker-modal__dialog{display:flex;flex-direction:column;position:absolute;left:50%;top:50%;z-index:1;height:440px;min-width:380px;opacity:0;transform:translate(-50%, -55%);transition:transform .3s ease-in-out,opacity .3s ease;padding:24px;background-color:#fff;border-radius:16px}.icon-picker-modal__header{display:flex;justify-content:space-between;align-items:center}.icon-picker-modal__header h2{margin-block-start:0;margin-block-end:0;font-size:24px}.icon-picker-modal__header .icon-picker-modal--close{cursor:pointer;margin-left:auto;-webkit-appearance:none;background:none;border:none;padding:2px;border-radius:4px;transition:background-color .3s ease}.icon-picker-modal__header .icon-picker-modal--close:hover{background-color:#f3f3f3}.icon-picker-modal__search{margin:32px 0 24px 0}.icon-picker-modal__content{display:grid;grid-template-columns:repeat(7, 40px);grid-gap:8px;overflow-y:scroll}.icon-picker-modal__content .is-empty,.icon-picker-modal__content .is-loading{text-align:center;grid-column:1/-1}.icon-picker-modal__content .icon-element{display:flex;align-items:center;justify-content:center;border:1px solid #ced4da;border-radius:4px;background-color:rgba(0,0,0,0);height:40px;width:40px;cursor:pointer;transition:background-color .3s ease,border-color .3s ease}.icon-picker-modal__content .icon-element i,.icon-picker-modal__content .icon-element svg{font-size:24px;color:#0983fd}.icon-picker-modal__content .icon-element:hover{background-color:#0983fd;border-color:#0983fd}.icon-picker-modal__content .icon-element:hover i,.icon-picker-modal__content .icon-element:hover svg{color:#fff}.icon-picker-modal__content .icon-element.is-selected{background-color:#0983fd;border-color:#0983fd}.icon-picker-modal__content .icon-element.is-selected i,.icon-picker-modal__content .icon-element.is-selected svg{color:#fff}.icon-picker-modal__content .icon-element[hidden]{display:none}.icon-picker-modal__footer{margin-top:auto;padding-top:24px;align-self:flex-end} diff --git a/build/vanilla-icon-picker/dist/themes/default.min.css b/build/vanilla-icon-picker/dist/themes/default.min.css new file mode 100644 index 00000000..463db798 --- /dev/null +++ b/build/vanilla-icon-picker/dist/themes/default.min.css @@ -0,0 +1,10 @@ +/*! Icon Picker 1.4.2 MIT | https://github.com/AppoloDev/icon-picker */ +.icon-picker-modal[data-theme=default] .icon-picker-modal__header h2{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Helvetica Neue",Arial,sans-serif}.icon-picker-modal[data-theme=default] .icon-picker-modal__search{background-color:#f6f9fd;border:1px solid #f4f7f9;border-radius:4px;padding:10px 16px;transition:border-color .3s ease,box-shadow .3s ease,background-color .3s ease}.icon-picker-modal[data-theme=default] .icon-picker-modal__search:focus,.icon-picker-modal[data-theme=default] .icon-picker-modal__search:focus-visible{box-shadow:0 0 0 4px rgba(9,131,253,.25);background-color:#fff;border-color:#086acc;outline:0}.icon-picker-modal[data-theme=default] .icon-picker-modal__footer .picker-save{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Helvetica Neue",Arial,sans-serif;color:#fff;background-color:#0983fd;border-radius:4px;padding:8px 16px;transition:background-color .3s ease}.icon-picker-modal[data-theme=default] .icon-picker-modal__footer .picker-save:hover{background-color:#0a72cc}.icon-picker-modal{position:fixed;left:0;top:0;bottom:0;right:0;z-index:100000;background-color:rgba(68,69,69,0);visibility:hidden;transition:background-color .3s ease-out,visibility .3s ease-out}.icon-picker-modal.is-visible{background-color:rgba(68,69,69,.6);visibility:visible}.icon-picker-modal.is-visible .icon-picker-modal__dialog{transform:translate(-50%, -50%);opacity:1}.icon-picker-modal__dialog{display:flex;flex-direction:column;position:absolute;left:50%;top:50%;z-index:1;height:440px;min-width:380px;opacity:0;transform:translate(-50%, -55%);transition:transform .3s ease-in-out,opacity .3s ease;padding:24px;background-color:#fff;border-radius:16px}.icon-picker-modal__header{display:flex;justify-content:space-between;align-items:center}.icon-picker-modal__header h2{margin-block-start:0;margin-block-end:0;font-size:24px}.icon-picker-modal__header .icon-picker-modal--close{cursor:pointer;margin-left:auto;-webkit-appearance:none;background:none;border:none;padding:2px;border-radius:4px;transition:background-color .3s ease}.icon-picker-modal__header .icon-picker-modal--close:hover{background-color:#f3f3f3}.icon-picker-modal__search{margin:32px 0 24px 0}.icon-picker-modal__content{display:grid;grid-template-columns:repeat(7, 40px);grid-gap:8px;overflow-y:scroll}.icon-picker-modal__content .is-empty,.icon-picker-modal__content .is-loading{text-align:center;grid-column:1/-1}.icon-picker-modal__content .icon-element{display:flex;align-items:center;justify-content:center;border:1px solid #ced4da;border-radius:4px;background-color:rgba(0,0,0,0);height:40px;width:40px;cursor:pointer;transition:background-color .3s ease,border-color .3s ease}.icon-picker-modal__content .icon-element i,.icon-picker-modal__content .icon-element svg{font-size:24px;color:#0983fd}.icon-picker-modal__content .icon-element:hover{background-color:#0983fd;border-color:#0983fd}.icon-picker-modal__content .icon-element:hover i,.icon-picker-modal__content .icon-element:hover svg{color:#fff}.icon-picker-modal__content .icon-element.is-selected{background-color:#0983fd;border-color:#0983fd}.icon-picker-modal__content .icon-element.is-selected i,.icon-picker-modal__content .icon-element.is-selected svg{color:#fff}.icon-picker-modal__content .icon-element[hidden]{display:none}.icon-picker-modal__footer{margin-top:auto;padding-top:24px;align-self:flex-end} + +.icon-element.filter, +.icon-element.tagcloud { + margin: 0; +} +.icon-element.menu { + padding-top: 0; +} From b53a7912948268a9034ecbd60b268e15c7c7f632 Mon Sep 17 00:00:00 2001 From: Michael Beckwith Date: Tue, 30 Dec 2025 16:18:26 -0600 Subject: [PATCH 09/14] new scripts and styles --- custom-post-type-ui.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/custom-post-type-ui.php b/custom-post-type-ui.php index 88f06c01..5dad1b0a 100644 --- a/custom-post-type-ui.php +++ b/custom-post-type-ui.php @@ -233,9 +233,14 @@ function cptui_add_styles() { return; } $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; - wp_register_script( 'cptui', plugins_url( "build/cptui$min.js", __FILE__ ), [ 'jquery', 'jquery-ui-dialog', 'postbox' ], CPTUI_VERSION, true ); - wp_register_script( 'dashicons-picker', plugins_url( "build/dashiconsPicker$min.js", __FILE__ ), [ 'jquery'], '1.0.0', true ); - wp_register_style( 'cptui-css', plugins_url( "build/cptui-styles$min.css", __FILE__ ), [ 'wp-jquery-ui-dialog' ], CPTUI_VERSION ); + wp_register_script( 'icon-picker', plugins_url( "build/vanilla-icon-picker/dist/icon-picker.min.js", __FILE__ ), [], '1.4.2', true ); + wp_register_style( 'icon-picker', plugins_url( "build/vanilla-icon-picker/dist/themes/default.min.css", __FILE__ ), [], '1.4.2' ); + wp_register_script( 'cptui', plugins_url( "build/cptui$min.js", __FILE__ ), [ 'jquery', 'jquery-ui-dialog', 'postbox', 'icon-picker' ], CPTUI_VERSION, true ); + wp_register_style( 'cptui-css', plugins_url( "build/cptui-styles$min.css", __FILE__ ), [ 'wp-jquery-ui-dialog', 'icon-picker' ], CPTUI_VERSION ); + + wp_localize_script( 'icon-picker', 'cptuiIconPicker', array( + 'iconsJSON' => plugins_url( 'build/dashicons.json', __FILE__ ), + ) ); } add_action( 'admin_enqueue_scripts', 'cptui_add_styles' ); From 4d337563955d45cbb12863139b5ab04c1a1348d5 Mon Sep 17 00:00:00 2001 From: Michael Beckwith Date: Tue, 30 Dec 2025 16:18:41 -0600 Subject: [PATCH 10/14] new script commands --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 60102266..eeb12ec2 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "dev": "wp-scripts start", "watch": "wp-scripts start --config webpack.config.js", "buildjs": "wp-scripts build --config webpack.config.js", - "build": "run-s buildjs uglify styles", + "build": "run-s buildjs dashicons uglify styles", "build:release": "run-s build create:release", "lint:css": "wp-scripts lint-style 'src/scss/*.scss'", "lint:js": "wp-scripts lint-js src/js/**", @@ -20,7 +20,8 @@ "styles": "run-s styles:compile styles:compress", "styles:compile": "sass src/scss/cptui-styles.scss build/cptui-styles.css", "styles:compress": "sass --style=compressed src/scss/cptui-styles.scss build/cptui-styles.min.css", - "uglify": "uglifyjs build/cptui.js -m -c --source-map -o build/cptui.min.js && uglifyjs build/dashiconsPicker.js -m -c --source-map -o build/dashiconsPicker.min.js", + "dashicons": "cp -R src/js/dashicons.json src/vanilla-icon-picker build", + "uglify": "uglifyjs build/cptui.js -m -c --source-map -o build/cptui.min.js", "create:release": "mkdirp release-build/custom-post-type-ui && cp -R build classes external images inc readme.txt LICENSE custom-post-type-ui.php wpml-config.xml release-build/custom-post-type-ui" }, "devDependencies": { From b808440a5285c1d7bbe475a0e44b757d157b3359 Mon Sep 17 00:00:00 2001 From: Michael Beckwith Date: Tue, 30 Dec 2025 16:18:59 -0600 Subject: [PATCH 11/14] remove dashiconspicker from webpack --- webpack.config.js | 1 - 1 file changed, 1 deletion(-) diff --git a/webpack.config.js b/webpack.config.js index 72710acc..f55d988c 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -4,7 +4,6 @@ module.exports = { ...defaultConfig, entry: { "cptui": './src/js/cptui.js', - "dashiconsPicker": './src/js/dashiconsPicker' }, optimization: { minimize: false From 4d1b9554e720d24e1f8b3d40be7a6d4d59098642 Mon Sep 17 00:00:00 2001 From: Michael Beckwith Date: Tue, 30 Dec 2025 16:29:56 -0600 Subject: [PATCH 12/14] make use of internationalization of the new icon picker --- src/js/partials/menu-icon.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/js/partials/menu-icon.js b/src/js/partials/menu-icon.js index d48c500d..9e0e6636 100644 --- a/src/js/partials/menu-icon.js +++ b/src/js/partials/menu-icon.js @@ -23,6 +23,13 @@ url : icons }], closeOnSelect: true, + i18n: { + 'input:placeholder': cptuiIconPicker.iconsPlaceholder, + 'text:title' : cptuiIconPicker.iconsTitle, + 'text:empty' : cptuiIconPicker.iconsEmpty, + 'text:loading' : cptuiIconPicker.iconsLoading, + 'btn:save' : cptuiIconPicker.iconsSave + } }); const menuIconField = document.querySelector('#menu_icon'); From 55ae4bcfee28be686bf29d3d10ae6c8d51524e7f Mon Sep 17 00:00:00 2001 From: Michael Beckwith Date: Tue, 30 Dec 2025 16:30:27 -0600 Subject: [PATCH 13/14] internationalize our default values for icon picker --- custom-post-type-ui.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/custom-post-type-ui.php b/custom-post-type-ui.php index 5dad1b0a..870bb71f 100644 --- a/custom-post-type-ui.php +++ b/custom-post-type-ui.php @@ -238,9 +238,14 @@ function cptui_add_styles() { wp_register_script( 'cptui', plugins_url( "build/cptui$min.js", __FILE__ ), [ 'jquery', 'jquery-ui-dialog', 'postbox', 'icon-picker' ], CPTUI_VERSION, true ); wp_register_style( 'cptui-css', plugins_url( "build/cptui-styles$min.css", __FILE__ ), [ 'wp-jquery-ui-dialog', 'icon-picker' ], CPTUI_VERSION ); - wp_localize_script( 'icon-picker', 'cptuiIconPicker', array( - 'iconsJSON' => plugins_url( 'build/dashicons.json', __FILE__ ), - ) ); + wp_localize_script( 'icon-picker', 'cptuiIconPicker', [ + 'iconsJSON' => plugins_url( 'build/dashicons.json', __FILE__ ), + 'iconsPlaceholder' => esc_attr__( 'Search icon …', 'custom-post-type-ui' ), + 'iconsTitle' => esc_attr__( 'Select icon', 'custom-post-type-ui' ), + 'iconsEmpty' => esc_attr__( 'No results found …', 'custom-post-type-ui' ), + 'iconsLoading' => esc_attr__( 'Loading …', 'custom-post-type-ui' ), + 'iconsSave' => esc_attr__( 'Save', 'custom-post-type-ui' ), + ] ); } add_action( 'admin_enqueue_scripts', 'cptui_add_styles' ); From 45f9c25b46b8f158099a360c60d29b0d70e8d717 Mon Sep 17 00:00:00 2001 From: Michael Beckwith Date: Tue, 30 Dec 2025 16:30:36 -0600 Subject: [PATCH 14/14] builds --- build/cptui.asset.php | 2 +- build/cptui.js | 9 ++++++++- build/cptui.js.map | 2 +- build/cptui.min.js | 2 +- build/cptui.min.js.map | 2 +- 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/build/cptui.asset.php b/build/cptui.asset.php index bdb6abd5..da25452a 100644 --- a/build/cptui.asset.php +++ b/build/cptui.asset.php @@ -1 +1 @@ - array(), 'version' => 'd92f9759d0b19aeb5789'); + array(), 'version' => '5e72e329ea97eeaf828a'); diff --git a/build/cptui.js b/build/cptui.js index 98ec97f7..3ff02976 100644 --- a/build/cptui.js +++ b/build/cptui.js @@ -328,7 +328,14 @@ postboxes.add_postbox_toggles(pagenow); prefix: 'dashicons-', url: icons }], - closeOnSelect: true + closeOnSelect: true, + i18n: { + 'input:placeholder': cptuiIconPicker.iconsPlaceholder, + 'text:title': cptuiIconPicker.iconsTitle, + 'text:empty': cptuiIconPicker.iconsEmpty, + 'text:loading': cptuiIconPicker.iconsLoading, + 'btn:save': cptuiIconPicker.iconsSave + } }); const menuIconField = document.querySelector('#menu_icon'); const menuIconPreview = document.querySelector('#menu_icon_preview'); diff --git a/build/cptui.js.map b/build/cptui.js.map index f2bb6ffa..49583482 100644 --- a/build/cptui.js.map +++ b/build/cptui.js.map @@ -1 +1 @@ -{"version":3,"file":"cptui.js","mappings":";;;;;;;AAAa;;AAEb;AACA;AACA;AACA;AACA;AAEA,CAAC,MAAM;EACP;EACC,MAAMA,gBAAgB,GAAGC,QAAQ,CAACC,gBAAgB,CAAC,oBAAoB,CAAC;EACxEC,KAAK,CAACC,IAAI,CAACJ,gBAAgB,CAAC,CAACK,OAAO,CAAC,UAAUC,QAAQ,EAAEC,KAAK,EAAE;IAC/D,IAAIC,IAAI,GAAG,SAAAA,CAAUC,IAAI,EAAEC,QAAQ,EAAE;MACpC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S,CAACiB,MAAM,CAAC,aAAa,CAAC;QAC5C,CAAC,MAAM;UACN2I,WAAW,CAAC5J,SAAS,CAACkB,GAAG,CAAC,aAAa,CAAC;QACzC;MACD;MAEA,IAAI2I,UAAU,GAAGvL,QAAQ,CAACqC,aAAa,CAAC,aAAa,CAAC;MACtD,IAAImJ,QAAQ,GAAGxL,QAAQ,CAACqC,aAAa,CAAC,sBAAsB,CAAC;MAC7D,IAAIoJ,mBAAmB,GAAID,QAAQ,GAAIA,QAAQ,CAAChG,OAAO,GAAG,KAAK;MAC/D,IAAI,OAAOnC,eAAe,IAAI,WAAW,EAAE;QAC1C,IAAIA,eAAe,CAACqI,mBAAmB,CAACC,cAAc,CAAC9G,KAAK,CAAC,IAAIA,KAAK,KAAKsG,aAAa,IAAIM,mBAAmB,KAAK,KAAK,EAAE;UAC1HF,UAAU,CAAC7J,SAAS,CAACiB,MAAM,CAAC,aAAa,CAAC;QAC3C,CAAC,MAAM;UACN4I,UAAU,CAAC7J,SAAS,CAACkB,GAAG,CAAC,aAAa,CAAC;QACxC;MACD;MACA,IAAI,OAAOW,cAAc,IAAI,WAAW,EAAE;QACzC,IAAIA,cAAc,CAACqI,mBAAmB,CAACD,cAAc,CAAC9G,KAAK,CAAC,IAAIA,KAAK,KAAKsG,aAAa,EAAE;UACxFI,UAAU,CAAC7J,SAAS,CAACiB,MAAM,CAAC,aAAa,CAAC;QAC3C,CAAC,MAAM;UACN4I,UAAU,CAAC7J,SAAS,CAACkB,GAAG,CAAC,aAAa,CAAC;QACxC;MACD;IACD,CAAC,CAAC;EACH;AACD,CAAC,EAAE,CAAC;;;;;;;;;;;;AC3EsB;AACM;AACQ;AACT;AACI;AACC;AACN;AACA;AACa;AACV;AACD","sources":["webpack://custom-post-type-ui/./src/js/partials/support-toggles.js","webpack://custom-post-type-ui/./src/js/partials/toggle-panels.js","webpack://custom-post-type-ui/./src/js/partials/confirm-delete.js","webpack://custom-post-type-ui/./src/js/partials/tax-required-post-type.js","webpack://custom-post-type-ui/./src/js/partials/autopopulate.js","webpack://custom-post-type-ui/./src/js/partials/toggle-hierarchical.js","webpack://custom-post-type-ui/./src/js/partials/menu-icon.js","webpack://custom-post-type-ui/./src/js/partials/autoswitch.js","webpack://custom-post-type-ui/./src/js/partials/hide-submit.js","webpack://custom-post-type-ui/./src/js/partials/back-to-top.js","webpack://custom-post-type-ui/webpack/bootstrap","webpack://custom-post-type-ui/./src/js/partials/utils.js","webpack://custom-post-type-ui/./src/js/partials/namefield.js","webpack://custom-post-type-ui/./src/js/cptui.js"],"sourcesContent":["'use strict';\n\n/*\n * This file handles accordian behavior on the Supports page with the various question/answer panels.\n *\n * The functionality includes keyboard and accessibility functionality to help those who need it.\n */\n\n(() => {\n// Toggles help/support accordions.\n\tconst supportQuestions = document.querySelectorAll('#support .question');\n\tArray.from(supportQuestions).forEach(function (question, index) {\n\t\tlet next = function (elem, selector) {\n\t\t\tlet nextElem = elem.nextElementSibling;\n\n\t\t\tif (!selector) {\n\t\t\t\treturn nextElem;\n\t\t\t}\n\n\t\t\tif (nextElem && nextElem.matches(selector)) {\n\t\t\t\treturn nextElem;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t};\n\n\t\tlet state = false;\n\t\tlet answer = next(question, 'div');\n\t\tanswer.style.display = 'none';\n\n\t\t['click', 'keydown'].forEach((theEvent) => {\n\t\t\tquestion.addEventListener(theEvent, (e) => {\n\t\t\t\t// Helps with accessibility and keyboard navigation.\n\t\t\t\tlet keys = ['Space', 'Enter'];\n\t\t\t\tif (e.type === 'keydown' && !keys.includes(e.code)) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\te.preventDefault();\n\t\t\t\tstate = !state;\n\t\t\t\tanswer.style.display = state ? 'block' : 'none';\n\t\t\t\te.currentTarget.classList.toggle('active')\n\t\t\t\te.currentTarget.setAttribute('aria-expanded', state.toString());\n\t\t\t\te.currentTarget.focus();\n\t\t\t});\n\t\t});\n\t});\n})();\n","'use strict';\n\n/*\n * This file handles storing the panel state for the post type and taxonomy edit screens.\n *\n * The open/closed state gets stored into localstorage and is remembered on future page refreshes.\n */\n\npostboxes.add_postbox_toggles(pagenow);\n\n(() => {\n\t// Toggle Panels State.\n\t// @todo. Localize the list of panel selectors so that we can filter in the CPTUI-Extended panel without hardcoding here.\n\tconst all_panels = [\"#cptui_panel_pt_basic_settings\", \"#cptui_panel_pt_additional_labels\", \"#cptui_panel_pt_advanced_settings\", \"#cptui_panel_tax_basic_settings\", \"#cptui_panel_tax_additional_labels\", \"#cptui_panel_tax_advanced_settings\"];\n\tall_panels.forEach((element, index) => {\n\t\tconst panel_id_item = document.querySelector(element);\n\t\tif (panel_id_item) {\n\t\t\tconst panel_id = panel_id_item.getAttribute('id');\n\t\t\tconst panel = document.querySelector('#' + panel_id);\n\n\t\t\t// check default state on page load\n\t\t\tif (!localStorage.getItem(panel_id) || localStorage.getItem(panel_id) === null) {\n\t\t\t\tpanel.classList.remove('closed');\n\t\t\t} else {\n\t\t\t\tpanel.classList.add('closed');\n\t\t\t}\n\n\t\t\tconst postbox = panel_id_item.querySelectorAll('.postbox-header');\n\t\t\tArray.from(postbox).forEach((el, i) => {\n\t\t\t\tel.addEventListener('click', (e) => {\n\t\t\t\t\tif (!localStorage.getItem(panel_id)) {\n\t\t\t\t\t\tlocalStorage.setItem(panel_id, '1');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlocalStorage.removeItem(panel_id);\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t});\n\t\t}\n\t});\n})();\n\n\n","'use strict';\n\n/*\n * This file handles confirming the deletion of a content type before continuing.\n *\n * @todo Finish converting away from jQuery.\n */\n\n(($) => {\n\t// NOT DONE\n\t/*['.cptui-delete-top', '.cptui-delete-bottom'].forEach( (element,index) => {\n\t\tlet theDialog = document.querySelector('#cptui-content-type-delete');\n\t\tlet theelement = document.querySelector(element);\n\t\ttheelement.addEventListener('click', async (e) => {\n\t\t\te.preventDefault();\n\t\t\tconst doPerformAction = await confirm();\n\t\t\tif ( doPerformAction ) {\n\t\t\t\tlet thing = document.querySelector('#cpt_submit_delete');\n\t\t\t\tconsole.log(thing);\n\t\t\t\tthing.click();\n\t\t\t\tthing.submit();\n\t\t\t\ttheDialog.close();\n\t\t\t} else {\n\t\t\t\ttheDialog.close();\n\t\t\t}\n\t\t});\n\t});\n\n\tlet closeBtnConfirm = document.querySelector('.cptui-confirm-deny-delete button');\n\tlet closeBtnDeny = document.querySelector('#cptui-content-type-deny-delete');\n\tfunction confirm() {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tdocument.querySelector('#cptui-content-type-delete').showModal();\n\t\t\tcloseBtnConfirm.focus();\n\n\t\t\tcloseBtnConfirm.addEventListener(\"click\", () => {\n\t\t\t\tresolve(true);\n\t\t\t\tdocument.querySelector('#cptui-content-type-delete').close()\n\t\t\t});\n\t\t\tcloseBtnDeny.addEventListener(\"click\", () => {\n\t\t\t\tresolve(false);\n\t\t\t\tdocument.querySelector('#cptui-content-type-delete').close()\n\t\t\t});\n\t\t});\n\t}*/\n\n\t// Confirm our deletions\n\t$('.cptui-delete-top, .cptui-delete-bottom').on('click', function (e) {\n\t\te.preventDefault();\n\t\tlet msg = '';\n\t\tif (typeof cptui_type_data !== 'undefined') {\n\t\t\tmsg = cptui_type_data.confirm;\n\t\t} else if (typeof cptui_tax_data !== 'undefined') {\n\t\t\tmsg = cptui_tax_data.confirm;\n\t\t}\n\t\tlet submit_delete_warning = $('
          ' + msg + '
          ').appendTo('#poststuff').dialog({\n\t\t\t'dialogClass': 'wp-dialog',\n\t\t\t'modal' : true,\n\t\t\t'autoOpen' : true,\n\t\t\t'buttons' : {\n\t\t\t\t\"OK\" : function () {\n\t\t\t\t\t$(this).dialog('close');\n\t\t\t\t\t$(e.target).off('click').click();\n\t\t\t\t},\n\t\t\t\t\"Cancel\": function () {\n\t\t\t\t\t$(this).dialog('close');\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n})(jQuery);\n","'use strict';\n\n/*\n * This file provides a dialog box to alert the user that at least one post type must be chosen\n * before they can save a taxonomy.\n *\n * This was added because taxonomies need to have a post type, meanwhile post types do NOT need\n * to have a taxonomy.\n */\n\n(() => {\n\t// Handles checking if a post type has been chosen or not when adding/saving a taxonomy.\n\t// Post type associations are a required attribute.\n\tconst taxSubmit = document.querySelectorAll('.cptui-taxonomy-submit');\n\tconst taxSubmitSelectCPTDialog = document.querySelector('#cptui-select-post-type-confirm');\n\tArray.from(taxSubmit).forEach((element, i) => {\n\t\telement.addEventListener('click', (e) => {\n\t\t\t// putting inside event listener to check every time clicked. Defining outside lost re-checking.\n\t\t\tlet taxCPTChecked = document.querySelectorAll('#cptui_panel_tax_basic_settings input[type=\"checkbox\"]:checked');\n\t\t\tif (taxCPTChecked.length === 0) {\n\t\t\t\te.preventDefault();\n\t\t\t\ttaxSubmitSelectCPTDialog.showModal();\n\t\t\t}\n\t\t});\n\t});\n\tlet taxSubmitSelectCPTConfirmCloseBtn = document.querySelector('#cptui-select-post-type-confirm-close');\n\tif (taxSubmitSelectCPTConfirmCloseBtn) {\n\t\ttaxSubmitSelectCPTConfirmCloseBtn.addEventListener('click', (e) => {\n\t\t\te.preventDefault();\n\t\t\ttaxSubmitSelectCPTDialog.close();\n\t\t});\n\t}\n})();\n","'use strict';\n\n/*\n * This file handles the automatic population as well as the automatic clearing of the label\n * fields, based on the provided singular and plural label values.\n */\n\n(() => {\n\tlet nameField = document.querySelector('#name');\n\tlet autoPopulate = document.querySelector('#auto-populate');\n\n\tconst autoLabels = document.querySelector('#autolabels');\n\tif (autoLabels) {\n\t\tautoLabels.style.display = 'table-row';\n\t}\n\n\tif (autoPopulate) {\n\t\t['click', 'tap'].forEach((eventName, index) => {\n\t\t\tautoPopulate.addEventListener(eventName, (e) => {\n\t\t\t\te.preventDefault();\n\n\t\t\t\tlet slug = nameField.value;\n\t\t\t\tlet plural = document.querySelector('#label').value;\n\t\t\t\tlet singular = document.querySelector('#singular_label').value;\n\t\t\t\tlet fields = document.querySelectorAll('.cptui-labels input[type=\"text\"]');\n\n\t\t\t\tif ('' === slug) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ('' === plural) {\n\t\t\t\t\tplural = slug;\n\t\t\t\t}\n\n\t\t\t\tif ('' === singular) {\n\t\t\t\t\tsingular = slug;\n\t\t\t\t}\n\n\t\t\t\tArray.from(fields).forEach(field => {\n\t\t\t\t\tlet newval = field.getAttribute('data-label');\n\t\t\t\t\tlet plurality = field.getAttribute('data-plurality');\n\t\t\t\t\tif (typeof newval !== 'undefined') {\n\t\t\t\t\t\t// \"slug\" is our placeholder from the labels.\n\t\t\t\t\t\tif ('plural' === plurality) {\n\t\t\t\t\t\t\tnewval = newval.replace(/item/gi, plural);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// using an else statement because we do not\n\t\t\t\t\t\t\t// want to mutate the original string by default.\n\t\t\t\t\t\t\tnewval = newval.replace(/item/gi, singular);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (field.value === '') {\n\t\t\t\t\t\t\tfield.value = newval;\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\n\tlet autoClear = document.querySelector('#auto-clear');\n\tif (autoClear) {\n\t\t['click', 'tap'].forEach((eventName, index) => {\n\t\t\tautoClear.addEventListener(eventName, (e) => {\n\t\t\t\te.preventDefault();\n\n\t\t\t\tconst fields = document.querySelectorAll('.cptui-labels input[type=\"text\"]');\n\t\t\t\tArray.from(fields).forEach(field => {\n\t\t\t\t\tfield.value = '';\n\t\t\t\t});\n\t\t\t})\n\t\t});\n\t}\n})();\n","'use strict';\n\n/*\n * This file handles automatically toggling the \"Page attributes\" option in the \"Supports\" section\n * when a user chooses to have their post type be hierarchical.\n *\n * The purpose is to help ensure that the \"parent\" and \"template\" metabox option shows up by default,\n * but we do not force that to remain checked. The user can still toggle it off after the fact.\n */\n\n(() => {\n\t// Automatically toggle the \"page attributes\" checkbox if\n\t// setting a hierarchical post type.\n\tconst hierarchicalSetting = document.querySelector('#hierarchical');\n\tif (hierarchicalSetting) {\n\t\thierarchicalSetting.addEventListener('change', (e) => {\n\t\t\tlet pageAttributesCheck = document.querySelector('#page-attributes');\n\t\t\tif (e.currentTarget && e.currentTarget.value === '1') {\n\t\t\t\tpageAttributesCheck.checked = true;\n\t\t\t} else {\n\t\t\t\tpageAttributesCheck.checked = false;\n\t\t\t}\n\t\t});\n\t}\n})();\n","'use strict';\n\n/*\n * This file handles setting the menu icon preview for a given post type.\n */\n\n(() => {\n\tlet _custom_media;\n\tlet _orig_send_attachment;\n\n\tif (undefined !== wp.media) {\n\t\t_custom_media = true;\n\t\t_orig_send_attachment = wp.media.editor.send.attachment;\n\t}\n\n\t// Trigger the modal and load our icons.\n\tconst icons = cptuiIconPicker.iconsJSON;\n\tconst iconPicker = new IconPicker('#cptui_choose_dashicon', {\n\t\ttheme : 'default',\n\t\ticonSource : [{\n\t\t\tkey : 'dashicons',\n\t\t\tprefix: 'dashicons-',\n\t\t\turl : icons\n\t\t}],\n\t\tcloseOnSelect: true,\n\t});\n\n\tconst menuIconField = document.querySelector('#menu_icon');\n\tconst menuIconPreview = document.querySelector('#menu_icon_preview');\n\tconst regIcon = document.querySelector('#cptui_choose_icon');\n\tconst dashIcon = document.querySelector('#cptui_choose_dashicon');\n\tconst origText = dashIcon.value;\n\ticonPicker.on('select', (icon) => {\n\t\tmenuIconField.value = icon.value;\n\t\tmenuIconPreview.innerHTML = '';\n\n\t\tlet div = document.createElement('div');\n\t\tdiv.classList.add('dashicons', icon.value);\n\t\tmenuIconPreview.insertAdjacentElement('afterbegin', div);\n\t});\n\ticonPicker.on('hide', () => {\n\t\tdashIcon.value = origText;\n\t})\n\n\tif (regIcon) {\n\t\tregIcon.addEventListener('click', (e) => {\n\t\t\te.preventDefault();\n\n\t\t\tlet button = e.currentTarget;\n\t\t\t_custom_media = true;\n\t\t\twp.media.editor.send.attachment = function (props, attachment) {\n\t\t\t\tif (_custom_media) {\n\t\t\t\t\tmenuIconField.value = attachment.url;\n\t\t\t\t\tmenuIconPreview.innerHTML = '';\n\t\t\t\t\tlet img = document.createElement('img');\n\t\t\t\t\timg.src = attachment.url;\n\t\t\t\t\tmenuIconPreview.insertAdjacentElement('afterbegin', img);\n\t\t\t\t} else {\n\t\t\t\t\treturn _orig_send_attachment.apply(this, [props, attachment]);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\twp.media.editor.open(button);\n\t\t\treturn false;\n\t\t});\n\t}\n})();\n","'use strict';\n\n/*\n * This file handles automatically switching to a chosen content type when selecting from the\n * dropdown listing.\n */\n\n(() => {\n\t// Switch to newly selected post type or taxonomy automatically.\n\tconst postTypeDropdown = document.querySelector('#post_type');\n\tconst taxonomyDropdown = document.querySelector('#taxonomy');\n\n\tif (postTypeDropdown) {\n\t\tpostTypeDropdown.addEventListener('change', () => {\n\t\t\tconst postTypeSelectPostType = document.querySelector('#cptui_select_post_type');\n\t\t\tif (postTypeSelectPostType) {\n\t\t\t\tpostTypeSelectPostType.submit();\n\t\t\t}\n\t\t})\n\t}\n\tif (taxonomyDropdown) {\n\t\ttaxonomyDropdown.addEventListener('change', () => {\n\t\t\tconst taxonomySelectPostType = document.querySelector('#cptui_select_taxonomy');\n\t\t\tif (taxonomySelectPostType) {\n\t\t\t\ttaxonomySelectPostType.submit();\n\t\t\t}\n\t\t})\n\t}\n})();\n","'use strict';\n\n/*\n * This file visually removes the submit button to change content type being edited.\n *\n * If by chance javascript is disabled or somehow breaking, the button would show by default,\n * preventing issues with switching content types.\n */\n\n(() => {\n\tconst cptSelectSubmit = document.querySelector('#cptui_select_post_type_submit');\n\tif (cptSelectSubmit) {\n\t\tcptSelectSubmit.style.display = 'none';\n\t}\n\tconst taxSelectSubmit = document.querySelector('#cptui_select_taxonomy_submit');\n\tif (taxSelectSubmit) {\n\t\ttaxSelectSubmit.style.display = 'none';\n\t}\n})();\n","'use strict';\n\n/*\n * This file handles the back to top functionality as the user scrolls, for quick return to top.\n *\n * This includes some debouncing to prevent excessive scroll event listening.\n */\n\n(() => {\n\tconst back_to_top_btn = document.querySelector('.cptui-back-to-top');\n\tif (back_to_top_btn) {\n\t\tdocument.addEventListener('scroll', () => {\n\t\t\tcptuiDebounce(backToTop, 500);\n\t\t});\n\n\t\tback_to_top_btn.addEventListener('click', (e) => {\n\t\t\te.preventDefault();\n\t\t\twindow.scrollTo({\n\t\t\t\ttop : 0,\n\t\t\t\tbehavior: \"smooth\"\n\t\t\t})\n\t\t});\n\t}\n\n\tfunction backToTop() {\n\t\tif (window.scrollY > 300) {\n\t\t\tback_to_top_btn.classList.add('show');\n\t\t} else {\n\t\t\tback_to_top_btn.classList.remove('show');\n\t\t}\n\t}\n\n\tfunction cptuiDebounce(method, delay) {\n\t\tclearTimeout(method._tId);\n\t\tmethod._tId = setTimeout(function () {\n\t\t\tmethod();\n\t\t}, delay);\n\t}\n})();\n","// 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","'use strict';\n\n// Retrieve URL parameters by requested parameter name.\nexport function getParameterByName(name, url) {\n\tif (!url) url = window.location.href;\n\tname = name.replace(/[\\[\\]]/g, \"\\\\$&\");\n\tconst regex = new RegExp(\"[?&]\" + name + \"(=([^&#]*)|&|#|$)\"),\n\t\tresults = regex.exec(url);\n\tif (!results) return null;\n\tif (!results[2]) return '';\n\treturn decodeURIComponent(results[2].replace(/\\+/g, \" \"));\n}\n\n// Split, translate cyrillic characters, and then re-join the final result.\nexport function transliterate(word) {\n\treturn word.split('').map(function (char) {\n\t\treturn cyrillic[char] || char;\n\t}).join(\"\");\n}\n\n//Character encode special characters.\nexport function htmlEncode(str) {\n\treturn String(str).replace(/[^-\\w. ]/gi, function (c) {\n\t\treturn '&#' + c.charCodeAt(0) + ';';\n\t});\n}\n\n// Constructs miniture versions of uploaded media for admnin menu icon usage,\n// or displays the rendered dashicon.\nexport function composePreviewContent(value) {\n\tconst re = /(http|https):\\/\\/[\\w-]+(\\.[\\w-]+)+([\\w.,@?^=%&:\\/~+#-]*[\\w@?^=%&\\/~+#-])?/;\n\tconst isURL = re.test(value);\n\n\tif (!value) {\n\t\treturn '';\n\t} else if (0 === value.indexOf('dashicons-')) {\n\t\tconst dashDiv = document.createElement('div');\n\t\tdashDiv.classList.add('dashicons-before');\n\t\tdashDiv.innerHTML = '
          ';\n\t\tdashDiv.classList.add(htmlEncode(value));\n\t\treturn dashDiv;\n\t} else if (isURL) {\n\t\tconst imgsrc = encodeURI(value);\n\t\tconst theimg = document.createElement('IMG');\n\t\ttheimg.src = imgsrc;\n\t\treturn theimg;\n\t}\n}\n\n// Replace diacritic characters with latin characters.\nexport function replaceDiacritics(s) {\n\tconst diacritics = [\n\t\t/[\\300-\\306]/g, /[\\340-\\346]/g, // A, a\n\t\t/[\\310-\\313]/g, /[\\350-\\353]/g, // E, e\n\t\t/[\\314-\\317]/g, /[\\354-\\357]/g, // I, i\n\t\t/[\\322-\\330]/g, /[\\362-\\370]/g, // O, o\n\t\t/[\\331-\\334]/g, /[\\371-\\374]/g, // U, u\n\t\t/[\\321]/g, /[\\361]/g, // N, n\n\t\t/[\\307]/g, /[\\347]/g // C, c\n\t];\n\n\tlet chars = ['A', 'a', 'E', 'e', 'I', 'i', 'O', 'o', 'U', 'u', 'N', 'n', 'C', 'c'];\n\n\tfor (let i = 0; i < diacritics.length; i++) {\n\t\ts = s.replace(diacritics[i], chars[i]);\n\t}\n\n\treturn s;\n}\n\n// Converts non-alphanumeric or space characters to an underscore. Should ignore dashes, to allow\n// using dashes in slugs.\nexport function replaceSpecialCharacters(s) {\n\ts = s.replace(/[^a-z0-9\\s-]/gi, '_');\n\treturn s;\n}\n\n// List of available cyrillic characters and the value to translate to.\nexport const cyrillic = {\n\t\"Ё\": \"YO\",\n\t\"Й\": \"I\",\n\t\"Ц\": \"TS\",\n\t\"У\": \"U\",\n\t\"К\": \"K\",\n\t\"Е\": \"E\",\n\t\"Н\": \"N\",\n\t\"Г\": \"G\",\n\t\"Ш\": \"SH\",\n\t\"Щ\": \"SCH\",\n\t\"З\": \"Z\",\n\t\"Х\": \"H\",\n\t\"Ъ\": \"'\",\n\t\"ё\": \"yo\",\n\t\"й\": \"i\",\n\t\"ц\": \"ts\",\n\t\"у\": \"u\",\n\t\"к\": \"k\",\n\t\"е\": \"e\",\n\t\"н\": \"n\",\n\t\"г\": \"g\",\n\t\"ш\": \"sh\",\n\t\"щ\": \"sch\",\n\t\"з\": \"z\",\n\t\"х\": \"h\",\n\t\"ъ\": \"'\",\n\t\"Ф\": \"F\",\n\t\"Ы\": \"I\",\n\t\"В\": \"V\",\n\t\"А\": \"a\",\n\t\"П\": \"P\",\n\t\"Р\": \"R\",\n\t\"О\": \"O\",\n\t\"Л\": \"L\",\n\t\"Д\": \"D\",\n\t\"Ж\": \"ZH\",\n\t\"Э\": \"E\",\n\t\"ф\": \"f\",\n\t\"ы\": \"i\",\n\t\"в\": \"v\",\n\t\"а\": \"a\",\n\t\"п\": \"p\",\n\t\"р\": \"r\",\n\t\"о\": \"o\",\n\t\"л\": \"l\",\n\t\"д\": \"d\",\n\t\"ж\": \"zh\",\n\t\"э\": \"e\",\n\t\"Я\": \"Ya\",\n\t\"Ч\": \"CH\",\n\t\"С\": \"S\",\n\t\"М\": \"M\",\n\t\"И\": \"I\",\n\t\"Т\": \"T\",\n\t\"Ь\": \"'\",\n\t\"Б\": \"B\",\n\t\"Ю\": \"YU\",\n\t\"я\": \"ya\",\n\t\"ч\": \"ch\",\n\t\"с\": \"s\",\n\t\"м\": \"m\",\n\t\"и\": \"i\",\n\t\"т\": \"t\",\n\t\"ь\": \"'\",\n\t\"б\": \"b\",\n\t\"ю\": \"yu\"\n};\n","'use strict';\nimport { getParameterByName, replaceDiacritics, transliterate, replaceSpecialCharacters } from './utils'\n\n/*\n * This file handles all of the normalization of the name/slug field for a post type\n * or taxonomy being registered.\n *\n * That way we are only allowing latin characters and dashes/underscores.\n *\n * It also shows a hidden alert if the slug has been changed in some way when editing an existing\n * content type.\n *\n * Lastly it will also show a warning if the attempted slug has already been registered elsewhere,\n * to help avoid clashes. The only exception is if the checkbox is checked indicating that the user\n * is trying to convert TO using CPTUI, and the conflicting slug elsewhere will be removed soon.\n */\n\n(() => {\n\tlet nameField = document.querySelector('#name');\n\tlet original_slug;\n\n\tif ('edit' === getParameterByName('action')) {\n\t\tif (nameField) {\n\t\t\t// Store our original slug on page load for edit checking.\n\t\t\toriginal_slug = nameField.value;\n\t\t}\n\t}\n\n\tif (nameField) {\n\t\t// Switch spaces for underscores on our slug fields.\n\t\tnameField.addEventListener('keyup', (e) => {\n\t\t\tlet value, original_value;\n\n\t\t\tvalue = original_value = e.currentTarget.value;\n\t\t\tlet keys = ['Tab', 'ArrowLeft', 'ArrowUp', 'ArrowRight', 'ArrowDown'];\n\t\t\tif (!keys.includes(e.code)) {\n\t\t\t\tvalue = value.replace(/ /g, \"_\");\n\t\t\t\tvalue = value.toLowerCase();\n\t\t\t\tvalue = replaceDiacritics(value);\n\t\t\t\tvalue = transliterate(value);\n\t\t\t\tvalue = replaceSpecialCharacters(value);\n\t\t\t\tif (value !== original_value) {\n\t\t\t\t\te.currentTarget.value = value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//Displays a message if slug changes.\n\t\t\tif (typeof original_slug !== 'undefined') {\n\t\t\t\tlet slugchanged = document.querySelector('#slugchanged');\n\t\t\t\tif (value !== original_slug) {\n\t\t\t\t\tslugchanged.classList.remove('hidemessage');\n\t\t\t\t} else {\n\t\t\t\t\tslugchanged.classList.add('hidemessage');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet slugexists = document.querySelector('#slugexists');\n\t\t\tlet override = document.querySelector('#override_validation');\n\t\t\tlet override_validation = (override) ? override.checked : false;\n\t\t\tif (typeof cptui_type_data != 'undefined') {\n\t\t\t\tif (cptui_type_data.existing_post_types.hasOwnProperty(value) && value !== original_slug && override_validation === false) {\n\t\t\t\t\tslugexists.classList.remove('hidemessage');\n\t\t\t\t} else {\n\t\t\t\t\tslugexists.classList.add('hidemessage');\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (typeof cptui_tax_data != 'undefined') {\n\t\t\t\tif (cptui_tax_data.existing_taxonomies.hasOwnProperty(value) && value !== original_slug) {\n\t\t\t\t\tslugexists.classList.remove('hidemessage');\n\t\t\t\t} else {\n\t\t\t\t\tslugexists.classList.add('hidemessage');\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n})();\n","import './partials/utils';\nimport './partials/hide-submit';\nimport './partials/toggle-hierarchical';\nimport './partials/autoswitch';\nimport './partials/confirm-delete';\nimport './partials/support-toggles';\nimport './partials/namefield';\nimport './partials/menu-icon';\nimport './partials/tax-required-post-type';\nimport './partials/autopopulate';\nimport './partials/back-to-top';\nimport './partials/toggle-panels';\n"],"names":["supportQuestions","document","querySelectorAll","Array","from","forEach","question","index","next","elem","selector","nextElem","nextElementSibling","matches","state","answer","style","display","theEvent","addEventListener","e","keys","type","includes","code","preventDefault","currentTarget","classList","toggle","setAttribute","toString","focus","postboxes","add_postbox_toggles","pagenow","all_panels","element","panel_id_item","querySelector","panel_id","getAttribute","panel","localStorage","getItem","remove","add","postbox","el","i","setItem","removeItem","$","on","msg","cptui_type_data","confirm","cptui_tax_data","submit_delete_warning","appendTo","dialog","OK","target","off","click","Cancel","jQuery","taxSubmit","taxSubmitSelectCPTDialog","taxCPTChecked","length","showModal","taxSubmitSelectCPTConfirmCloseBtn","close","nameField","autoPopulate","autoLabels","eventName","slug","value","plural","singular","fields","field","newval","plurality","replace","autoClear","hierarchicalSetting","pageAttributesCheck","checked","_custom_media","_orig_send_attachment","undefined","wp","media","editor","send","attachment","icons","cptuiIconPicker","iconsJSON","iconPicker","IconPicker","theme","iconSource","key","prefix","url","closeOnSelect","menuIconField","menuIconPreview","regIcon","dashIcon","origText","icon","innerHTML","div","createElement","insertAdjacentElement","button","props","img","src","apply","open","postTypeDropdown","taxonomyDropdown","postTypeSelectPostType","submit","taxonomySelectPostType","cptSelectSubmit","taxSelectSubmit","back_to_top_btn","cptuiDebounce","backToTop","window","scrollTo","top","behavior","scrollY","method","delay","clearTimeout","_tId","setTimeout","getParameterByName","name","location","href","regex","RegExp","results","exec","decodeURIComponent","transliterate","word","split","map","char","cyrillic","join","htmlEncode","str","String","c","charCodeAt","composePreviewContent","re","isURL","test","indexOf","dashDiv","imgsrc","encodeURI","theimg","replaceDiacritics","s","diacritics","chars","replaceSpecialCharacters","original_slug","original_value","toLowerCase","slugchanged","slugexists","override","override_validation","existing_post_types","hasOwnProperty","existing_taxonomies"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"cptui.js","mappings":";;;;;;;AAAa;;AAEb;AACA;AACA;AACA;AACA;AAEA,CAAC,MAAM;EACP;EACC,MAAMA,gBAAgB,GAAGC,QAAQ,CAACC,gBAAgB,CAAC,oBAAoB,CAAC;EACxEC,KAAK,CAACC,IAAI,CAACJ,gBAAgB,CAAC,CAACK,OAAO,CAAC,UAAUC,QAAQ,EAAEC,KAAK,EAAE;IAC/D,IAAIC,IAAI,GAAG,SAAAA,CAAUC,IAAI,EAAEC,QAAQ,EAAE;MACpC,IAAIC,QAAQ,GAAGF,IAAI,CAACG,kBAAkB;MAEtC,IAAI,CAACF,QAAQ,EAAE;QACd,OAAOC,QAAQ;MAChB;MAEA,IAAIA,QAAQ,IAAIA,QAAQ,CAACE,OAAO,CAACH,QAAQ,CAAC,EAAE;QAC3C,OAAOC,QAAQ;MAChB;MAEA,OAAO,IAAI;IACZ,CAAC;IAED,IAAIG,KAA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AAC;QAC5C,CAAC,MAAM;UACNiJ,WAAW,CAAClK,SAAS,CAACkB,GAAG,CAAC,aAAa,CAAC;QACzC;MACD;MAEA,IAAIiJ,UAAU,GAAG7L,QAAQ,CAACqC,aAAa,CAAC,aAAa,CAAC;MACtD,IAAIyJ,QAAQ,GAAG9L,QAAQ,CAACqC,aAAa,CAAC,sBAAsB,CAAC;MAC7D,IAAI0J,mBAAmB,GAAID,QAAQ,GAAIA,QAAQ,CAACtG,OAAO,GAAG,KAAK;MAC/D,IAAI,OAAOnC,eAAe,IAAI,WAAW,EAAE;QAC1C,IAAIA,eAAe,CAAC2I,mBAAmB,CAACC,cAAc,CAACpH,KAAK,CAAC,IAAIA,KAAK,KAAK4G,aAAa,IAAIM,mBAAmB,KAAK,KAAK,EAAE;UAC1HF,UAAU,CAACnK,SAAS,CAACiB,MAAM,CAAC,aAAa,CAAC;QAC3C,CAAC,MAAM;UACNkJ,UAAU,CAACnK,SAAS,CAACkB,GAAG,CAAC,aAAa,CAAC;QACxC;MACD;MACA,IAAI,OAAOW,cAAc,IAAI,WAAW,EAAE;QACzC,IAAIA,cAAc,CAAC2I,mBAAmB,CAACD,cAAc,CAACpH,KAAK,CAAC,IAAIA,KAAK,KAAK4G,aAAa,EAAE;UACxFI,UAAU,CAACnK,SAAS,CAACiB,MAAM,CAAC,aAAa,CAAC;QAC3C,CAAC,MAAM;UACNkJ,UAAU,CAACnK,SAAS,CAACkB,GAAG,CAAC,aAAa,CAAC;QACxC;MACD;IACD,CAAC,CAAC;EACH;AACD,CAAC,EAAE,CAAC;;;;;;;;;;;;AC3EsB;AACM;AACQ;AACT;AACI;AACC;AACN;AACA;AACa;AACV;AACD","sources":["webpack://custom-post-type-ui/./src/js/partials/support-toggles.js","webpack://custom-post-type-ui/./src/js/partials/toggle-panels.js","webpack://custom-post-type-ui/./src/js/partials/confirm-delete.js","webpack://custom-post-type-ui/./src/js/partials/tax-required-post-type.js","webpack://custom-post-type-ui/./src/js/partials/autopopulate.js","webpack://custom-post-type-ui/./src/js/partials/toggle-hierarchical.js","webpack://custom-post-type-ui/./src/js/partials/menu-icon.js","webpack://custom-post-type-ui/./src/js/partials/autoswitch.js","webpack://custom-post-type-ui/./src/js/partials/hide-submit.js","webpack://custom-post-type-ui/./src/js/partials/back-to-top.js","webpack://custom-post-type-ui/webpack/bootstrap","webpack://custom-post-type-ui/./src/js/partials/utils.js","webpack://custom-post-type-ui/./src/js/partials/namefield.js","webpack://custom-post-type-ui/./src/js/cptui.js"],"sourcesContent":["'use strict';\n\n/*\n * This file handles accordian behavior on the Supports page with the various question/answer panels.\n *\n * The functionality includes keyboard and accessibility functionality to help those who need it.\n */\n\n(() => {\n// Toggles help/support accordions.\n\tconst supportQuestions = document.querySelectorAll('#support .question');\n\tArray.from(supportQuestions).forEach(function (question, index) {\n\t\tlet next = function (elem, selector) {\n\t\t\tlet nextElem = elem.nextElementSibling;\n\n\t\t\tif (!selector) {\n\t\t\t\treturn nextElem;\n\t\t\t}\n\n\t\t\tif (nextElem && nextElem.matches(selector)) {\n\t\t\t\treturn nextElem;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t};\n\n\t\tlet state = false;\n\t\tlet answer = next(question, 'div');\n\t\tanswer.style.display = 'none';\n\n\t\t['click', 'keydown'].forEach((theEvent) => {\n\t\t\tquestion.addEventListener(theEvent, (e) => {\n\t\t\t\t// Helps with accessibility and keyboard navigation.\n\t\t\t\tlet keys = ['Space', 'Enter'];\n\t\t\t\tif (e.type === 'keydown' && !keys.includes(e.code)) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\te.preventDefault();\n\t\t\t\tstate = !state;\n\t\t\t\tanswer.style.display = state ? 'block' : 'none';\n\t\t\t\te.currentTarget.classList.toggle('active')\n\t\t\t\te.currentTarget.setAttribute('aria-expanded', state.toString());\n\t\t\t\te.currentTarget.focus();\n\t\t\t});\n\t\t});\n\t});\n})();\n","'use strict';\n\n/*\n * This file handles storing the panel state for the post type and taxonomy edit screens.\n *\n * The open/closed state gets stored into localstorage and is remembered on future page refreshes.\n */\n\npostboxes.add_postbox_toggles(pagenow);\n\n(() => {\n\t// Toggle Panels State.\n\t// @todo. Localize the list of panel selectors so that we can filter in the CPTUI-Extended panel without hardcoding here.\n\tconst all_panels = [\"#cptui_panel_pt_basic_settings\", \"#cptui_panel_pt_additional_labels\", \"#cptui_panel_pt_advanced_settings\", \"#cptui_panel_tax_basic_settings\", \"#cptui_panel_tax_additional_labels\", \"#cptui_panel_tax_advanced_settings\"];\n\tall_panels.forEach((element, index) => {\n\t\tconst panel_id_item = document.querySelector(element);\n\t\tif (panel_id_item) {\n\t\t\tconst panel_id = panel_id_item.getAttribute('id');\n\t\t\tconst panel = document.querySelector('#' + panel_id);\n\n\t\t\t// check default state on page load\n\t\t\tif (!localStorage.getItem(panel_id) || localStorage.getItem(panel_id) === null) {\n\t\t\t\tpanel.classList.remove('closed');\n\t\t\t} else {\n\t\t\t\tpanel.classList.add('closed');\n\t\t\t}\n\n\t\t\tconst postbox = panel_id_item.querySelectorAll('.postbox-header');\n\t\t\tArray.from(postbox).forEach((el, i) => {\n\t\t\t\tel.addEventListener('click', (e) => {\n\t\t\t\t\tif (!localStorage.getItem(panel_id)) {\n\t\t\t\t\t\tlocalStorage.setItem(panel_id, '1');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlocalStorage.removeItem(panel_id);\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t});\n\t\t}\n\t});\n})();\n\n\n","'use strict';\n\n/*\n * This file handles confirming the deletion of a content type before continuing.\n *\n * @todo Finish converting away from jQuery.\n */\n\n(($) => {\n\t// NOT DONE\n\t/*['.cptui-delete-top', '.cptui-delete-bottom'].forEach( (element,index) => {\n\t\tlet theDialog = document.querySelector('#cptui-content-type-delete');\n\t\tlet theelement = document.querySelector(element);\n\t\ttheelement.addEventListener('click', async (e) => {\n\t\t\te.preventDefault();\n\t\t\tconst doPerformAction = await confirm();\n\t\t\tif ( doPerformAction ) {\n\t\t\t\tlet thing = document.querySelector('#cpt_submit_delete');\n\t\t\t\tconsole.log(thing);\n\t\t\t\tthing.click();\n\t\t\t\tthing.submit();\n\t\t\t\ttheDialog.close();\n\t\t\t} else {\n\t\t\t\ttheDialog.close();\n\t\t\t}\n\t\t});\n\t});\n\n\tlet closeBtnConfirm = document.querySelector('.cptui-confirm-deny-delete button');\n\tlet closeBtnDeny = document.querySelector('#cptui-content-type-deny-delete');\n\tfunction confirm() {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tdocument.querySelector('#cptui-content-type-delete').showModal();\n\t\t\tcloseBtnConfirm.focus();\n\n\t\t\tcloseBtnConfirm.addEventListener(\"click\", () => {\n\t\t\t\tresolve(true);\n\t\t\t\tdocument.querySelector('#cptui-content-type-delete').close()\n\t\t\t});\n\t\t\tcloseBtnDeny.addEventListener(\"click\", () => {\n\t\t\t\tresolve(false);\n\t\t\t\tdocument.querySelector('#cptui-content-type-delete').close()\n\t\t\t});\n\t\t});\n\t}*/\n\n\t// Confirm our deletions\n\t$('.cptui-delete-top, .cptui-delete-bottom').on('click', function (e) {\n\t\te.preventDefault();\n\t\tlet msg = '';\n\t\tif (typeof cptui_type_data !== 'undefined') {\n\t\t\tmsg = cptui_type_data.confirm;\n\t\t} else if (typeof cptui_tax_data !== 'undefined') {\n\t\t\tmsg = cptui_tax_data.confirm;\n\t\t}\n\t\tlet submit_delete_warning = $('
          ' + msg + '
          ').appendTo('#poststuff').dialog({\n\t\t\t'dialogClass': 'wp-dialog',\n\t\t\t'modal' : true,\n\t\t\t'autoOpen' : true,\n\t\t\t'buttons' : {\n\t\t\t\t\"OK\" : function () {\n\t\t\t\t\t$(this).dialog('close');\n\t\t\t\t\t$(e.target).off('click').click();\n\t\t\t\t},\n\t\t\t\t\"Cancel\": function () {\n\t\t\t\t\t$(this).dialog('close');\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n})(jQuery);\n","'use strict';\n\n/*\n * This file provides a dialog box to alert the user that at least one post type must be chosen\n * before they can save a taxonomy.\n *\n * This was added because taxonomies need to have a post type, meanwhile post types do NOT need\n * to have a taxonomy.\n */\n\n(() => {\n\t// Handles checking if a post type has been chosen or not when adding/saving a taxonomy.\n\t// Post type associations are a required attribute.\n\tconst taxSubmit = document.querySelectorAll('.cptui-taxonomy-submit');\n\tconst taxSubmitSelectCPTDialog = document.querySelector('#cptui-select-post-type-confirm');\n\tArray.from(taxSubmit).forEach((element, i) => {\n\t\telement.addEventListener('click', (e) => {\n\t\t\t// putting inside event listener to check every time clicked. Defining outside lost re-checking.\n\t\t\tlet taxCPTChecked = document.querySelectorAll('#cptui_panel_tax_basic_settings input[type=\"checkbox\"]:checked');\n\t\t\tif (taxCPTChecked.length === 0) {\n\t\t\t\te.preventDefault();\n\t\t\t\ttaxSubmitSelectCPTDialog.showModal();\n\t\t\t}\n\t\t});\n\t});\n\tlet taxSubmitSelectCPTConfirmCloseBtn = document.querySelector('#cptui-select-post-type-confirm-close');\n\tif (taxSubmitSelectCPTConfirmCloseBtn) {\n\t\ttaxSubmitSelectCPTConfirmCloseBtn.addEventListener('click', (e) => {\n\t\t\te.preventDefault();\n\t\t\ttaxSubmitSelectCPTDialog.close();\n\t\t});\n\t}\n})();\n","'use strict';\n\n/*\n * This file handles the automatic population as well as the automatic clearing of the label\n * fields, based on the provided singular and plural label values.\n */\n\n(() => {\n\tlet nameField = document.querySelector('#name');\n\tlet autoPopulate = document.querySelector('#auto-populate');\n\n\tconst autoLabels = document.querySelector('#autolabels');\n\tif (autoLabels) {\n\t\tautoLabels.style.display = 'table-row';\n\t}\n\n\tif (autoPopulate) {\n\t\t['click', 'tap'].forEach((eventName, index) => {\n\t\t\tautoPopulate.addEventListener(eventName, (e) => {\n\t\t\t\te.preventDefault();\n\n\t\t\t\tlet slug = nameField.value;\n\t\t\t\tlet plural = document.querySelector('#label').value;\n\t\t\t\tlet singular = document.querySelector('#singular_label').value;\n\t\t\t\tlet fields = document.querySelectorAll('.cptui-labels input[type=\"text\"]');\n\n\t\t\t\tif ('' === slug) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ('' === plural) {\n\t\t\t\t\tplural = slug;\n\t\t\t\t}\n\n\t\t\t\tif ('' === singular) {\n\t\t\t\t\tsingular = slug;\n\t\t\t\t}\n\n\t\t\t\tArray.from(fields).forEach(field => {\n\t\t\t\t\tlet newval = field.getAttribute('data-label');\n\t\t\t\t\tlet plurality = field.getAttribute('data-plurality');\n\t\t\t\t\tif (typeof newval !== 'undefined') {\n\t\t\t\t\t\t// \"slug\" is our placeholder from the labels.\n\t\t\t\t\t\tif ('plural' === plurality) {\n\t\t\t\t\t\t\tnewval = newval.replace(/item/gi, plural);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// using an else statement because we do not\n\t\t\t\t\t\t\t// want to mutate the original string by default.\n\t\t\t\t\t\t\tnewval = newval.replace(/item/gi, singular);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (field.value === '') {\n\t\t\t\t\t\t\tfield.value = newval;\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\n\tlet autoClear = document.querySelector('#auto-clear');\n\tif (autoClear) {\n\t\t['click', 'tap'].forEach((eventName, index) => {\n\t\t\tautoClear.addEventListener(eventName, (e) => {\n\t\t\t\te.preventDefault();\n\n\t\t\t\tconst fields = document.querySelectorAll('.cptui-labels input[type=\"text\"]');\n\t\t\t\tArray.from(fields).forEach(field => {\n\t\t\t\t\tfield.value = '';\n\t\t\t\t});\n\t\t\t})\n\t\t});\n\t}\n})();\n","'use strict';\n\n/*\n * This file handles automatically toggling the \"Page attributes\" option in the \"Supports\" section\n * when a user chooses to have their post type be hierarchical.\n *\n * The purpose is to help ensure that the \"parent\" and \"template\" metabox option shows up by default,\n * but we do not force that to remain checked. The user can still toggle it off after the fact.\n */\n\n(() => {\n\t// Automatically toggle the \"page attributes\" checkbox if\n\t// setting a hierarchical post type.\n\tconst hierarchicalSetting = document.querySelector('#hierarchical');\n\tif (hierarchicalSetting) {\n\t\thierarchicalSetting.addEventListener('change', (e) => {\n\t\t\tlet pageAttributesCheck = document.querySelector('#page-attributes');\n\t\t\tif (e.currentTarget && e.currentTarget.value === '1') {\n\t\t\t\tpageAttributesCheck.checked = true;\n\t\t\t} else {\n\t\t\t\tpageAttributesCheck.checked = false;\n\t\t\t}\n\t\t});\n\t}\n})();\n","'use strict';\n\n/*\n * This file handles setting the menu icon preview for a given post type.\n */\n\n(() => {\n\tlet _custom_media;\n\tlet _orig_send_attachment;\n\n\tif (undefined !== wp.media) {\n\t\t_custom_media = true;\n\t\t_orig_send_attachment = wp.media.editor.send.attachment;\n\t}\n\n\t// Trigger the modal and load our icons.\n\tconst icons = cptuiIconPicker.iconsJSON;\n\tconst iconPicker = new IconPicker('#cptui_choose_dashicon', {\n\t\ttheme : 'default',\n\t\ticonSource : [{\n\t\t\tkey : 'dashicons',\n\t\t\tprefix: 'dashicons-',\n\t\t\turl : icons\n\t\t}],\n\t\tcloseOnSelect: true,\n\t\ti18n: {\n\t\t\t'input:placeholder': cptuiIconPicker.iconsPlaceholder,\n\t\t\t'text:title' : cptuiIconPicker.iconsTitle,\n\t\t\t'text:empty' : cptuiIconPicker.iconsEmpty,\n\t\t\t'text:loading': cptuiIconPicker.iconsLoading,\n\t\t\t'btn:save': cptuiIconPicker.iconsSave\n\t\t}\n\t});\n\n\tconst menuIconField = document.querySelector('#menu_icon');\n\tconst menuIconPreview = document.querySelector('#menu_icon_preview');\n\tconst regIcon = document.querySelector('#cptui_choose_icon');\n\tconst dashIcon = document.querySelector('#cptui_choose_dashicon');\n\tconst origText = dashIcon.value;\n\ticonPicker.on('select', (icon) => {\n\t\tmenuIconField.value = icon.value;\n\t\tmenuIconPreview.innerHTML = '';\n\n\t\tlet div = document.createElement('div');\n\t\tdiv.classList.add('dashicons', icon.value);\n\t\tmenuIconPreview.insertAdjacentElement('afterbegin', div);\n\t});\n\ticonPicker.on('hide', () => {\n\t\tdashIcon.value = origText;\n\t})\n\n\tif (regIcon) {\n\t\tregIcon.addEventListener('click', (e) => {\n\t\t\te.preventDefault();\n\n\t\t\tlet button = e.currentTarget;\n\t\t\t_custom_media = true;\n\t\t\twp.media.editor.send.attachment = function (props, attachment) {\n\t\t\t\tif (_custom_media) {\n\t\t\t\t\tmenuIconField.value = attachment.url;\n\t\t\t\t\tmenuIconPreview.innerHTML = '';\n\t\t\t\t\tlet img = document.createElement('img');\n\t\t\t\t\timg.src = attachment.url;\n\t\t\t\t\tmenuIconPreview.insertAdjacentElement('afterbegin', img);\n\t\t\t\t} else {\n\t\t\t\t\treturn _orig_send_attachment.apply(this, [props, attachment]);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\twp.media.editor.open(button);\n\t\t\treturn false;\n\t\t});\n\t}\n})();\n","'use strict';\n\n/*\n * This file handles automatically switching to a chosen content type when selecting from the\n * dropdown listing.\n */\n\n(() => {\n\t// Switch to newly selected post type or taxonomy automatically.\n\tconst postTypeDropdown = document.querySelector('#post_type');\n\tconst taxonomyDropdown = document.querySelector('#taxonomy');\n\n\tif (postTypeDropdown) {\n\t\tpostTypeDropdown.addEventListener('change', () => {\n\t\t\tconst postTypeSelectPostType = document.querySelector('#cptui_select_post_type');\n\t\t\tif (postTypeSelectPostType) {\n\t\t\t\tpostTypeSelectPostType.submit();\n\t\t\t}\n\t\t})\n\t}\n\tif (taxonomyDropdown) {\n\t\ttaxonomyDropdown.addEventListener('change', () => {\n\t\t\tconst taxonomySelectPostType = document.querySelector('#cptui_select_taxonomy');\n\t\t\tif (taxonomySelectPostType) {\n\t\t\t\ttaxonomySelectPostType.submit();\n\t\t\t}\n\t\t})\n\t}\n})();\n","'use strict';\n\n/*\n * This file visually removes the submit button to change content type being edited.\n *\n * If by chance javascript is disabled or somehow breaking, the button would show by default,\n * preventing issues with switching content types.\n */\n\n(() => {\n\tconst cptSelectSubmit = document.querySelector('#cptui_select_post_type_submit');\n\tif (cptSelectSubmit) {\n\t\tcptSelectSubmit.style.display = 'none';\n\t}\n\tconst taxSelectSubmit = document.querySelector('#cptui_select_taxonomy_submit');\n\tif (taxSelectSubmit) {\n\t\ttaxSelectSubmit.style.display = 'none';\n\t}\n})();\n","'use strict';\n\n/*\n * This file handles the back to top functionality as the user scrolls, for quick return to top.\n *\n * This includes some debouncing to prevent excessive scroll event listening.\n */\n\n(() => {\n\tconst back_to_top_btn = document.querySelector('.cptui-back-to-top');\n\tif (back_to_top_btn) {\n\t\tdocument.addEventListener('scroll', () => {\n\t\t\tcptuiDebounce(backToTop, 500);\n\t\t});\n\n\t\tback_to_top_btn.addEventListener('click', (e) => {\n\t\t\te.preventDefault();\n\t\t\twindow.scrollTo({\n\t\t\t\ttop : 0,\n\t\t\t\tbehavior: \"smooth\"\n\t\t\t})\n\t\t});\n\t}\n\n\tfunction backToTop() {\n\t\tif (window.scrollY > 300) {\n\t\t\tback_to_top_btn.classList.add('show');\n\t\t} else {\n\t\t\tback_to_top_btn.classList.remove('show');\n\t\t}\n\t}\n\n\tfunction cptuiDebounce(method, delay) {\n\t\tclearTimeout(method._tId);\n\t\tmethod._tId = setTimeout(function () {\n\t\t\tmethod();\n\t\t}, delay);\n\t}\n})();\n","// 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","'use strict';\n\n// Retrieve URL parameters by requested parameter name.\nexport function getParameterByName(name, url) {\n\tif (!url) url = window.location.href;\n\tname = name.replace(/[\\[\\]]/g, \"\\\\$&\");\n\tconst regex = new RegExp(\"[?&]\" + name + \"(=([^&#]*)|&|#|$)\"),\n\t\tresults = regex.exec(url);\n\tif (!results) return null;\n\tif (!results[2]) return '';\n\treturn decodeURIComponent(results[2].replace(/\\+/g, \" \"));\n}\n\n// Split, translate cyrillic characters, and then re-join the final result.\nexport function transliterate(word) {\n\treturn word.split('').map(function (char) {\n\t\treturn cyrillic[char] || char;\n\t}).join(\"\");\n}\n\n//Character encode special characters.\nexport function htmlEncode(str) {\n\treturn String(str).replace(/[^-\\w. ]/gi, function (c) {\n\t\treturn '&#' + c.charCodeAt(0) + ';';\n\t});\n}\n\n// Constructs miniture versions of uploaded media for admnin menu icon usage,\n// or displays the rendered dashicon.\nexport function composePreviewContent(value) {\n\tconst re = /(http|https):\\/\\/[\\w-]+(\\.[\\w-]+)+([\\w.,@?^=%&:\\/~+#-]*[\\w@?^=%&\\/~+#-])?/;\n\tconst isURL = re.test(value);\n\n\tif (!value) {\n\t\treturn '';\n\t} else if (0 === value.indexOf('dashicons-')) {\n\t\tconst dashDiv = document.createElement('div');\n\t\tdashDiv.classList.add('dashicons-before');\n\t\tdashDiv.innerHTML = '
          ';\n\t\tdashDiv.classList.add(htmlEncode(value));\n\t\treturn dashDiv;\n\t} else if (isURL) {\n\t\tconst imgsrc = encodeURI(value);\n\t\tconst theimg = document.createElement('IMG');\n\t\ttheimg.src = imgsrc;\n\t\treturn theimg;\n\t}\n}\n\n// Replace diacritic characters with latin characters.\nexport function replaceDiacritics(s) {\n\tconst diacritics = [\n\t\t/[\\300-\\306]/g, /[\\340-\\346]/g, // A, a\n\t\t/[\\310-\\313]/g, /[\\350-\\353]/g, // E, e\n\t\t/[\\314-\\317]/g, /[\\354-\\357]/g, // I, i\n\t\t/[\\322-\\330]/g, /[\\362-\\370]/g, // O, o\n\t\t/[\\331-\\334]/g, /[\\371-\\374]/g, // U, u\n\t\t/[\\321]/g, /[\\361]/g, // N, n\n\t\t/[\\307]/g, /[\\347]/g // C, c\n\t];\n\n\tlet chars = ['A', 'a', 'E', 'e', 'I', 'i', 'O', 'o', 'U', 'u', 'N', 'n', 'C', 'c'];\n\n\tfor (let i = 0; i < diacritics.length; i++) {\n\t\ts = s.replace(diacritics[i], chars[i]);\n\t}\n\n\treturn s;\n}\n\n// Converts non-alphanumeric or space characters to an underscore. Should ignore dashes, to allow\n// using dashes in slugs.\nexport function replaceSpecialCharacters(s) {\n\ts = s.replace(/[^a-z0-9\\s-]/gi, '_');\n\treturn s;\n}\n\n// List of available cyrillic characters and the value to translate to.\nexport const cyrillic = {\n\t\"Ё\": \"YO\",\n\t\"Й\": \"I\",\n\t\"Ц\": \"TS\",\n\t\"У\": \"U\",\n\t\"К\": \"K\",\n\t\"Е\": \"E\",\n\t\"Н\": \"N\",\n\t\"Г\": \"G\",\n\t\"Ш\": \"SH\",\n\t\"Щ\": \"SCH\",\n\t\"З\": \"Z\",\n\t\"Х\": \"H\",\n\t\"Ъ\": \"'\",\n\t\"ё\": \"yo\",\n\t\"й\": \"i\",\n\t\"ц\": \"ts\",\n\t\"у\": \"u\",\n\t\"к\": \"k\",\n\t\"е\": \"e\",\n\t\"н\": \"n\",\n\t\"г\": \"g\",\n\t\"ш\": \"sh\",\n\t\"щ\": \"sch\",\n\t\"з\": \"z\",\n\t\"х\": \"h\",\n\t\"ъ\": \"'\",\n\t\"Ф\": \"F\",\n\t\"Ы\": \"I\",\n\t\"В\": \"V\",\n\t\"А\": \"a\",\n\t\"П\": \"P\",\n\t\"Р\": \"R\",\n\t\"О\": \"O\",\n\t\"Л\": \"L\",\n\t\"Д\": \"D\",\n\t\"Ж\": \"ZH\",\n\t\"Э\": \"E\",\n\t\"ф\": \"f\",\n\t\"ы\": \"i\",\n\t\"в\": \"v\",\n\t\"а\": \"a\",\n\t\"п\": \"p\",\n\t\"р\": \"r\",\n\t\"о\": \"o\",\n\t\"л\": \"l\",\n\t\"д\": \"d\",\n\t\"ж\": \"zh\",\n\t\"э\": \"e\",\n\t\"Я\": \"Ya\",\n\t\"Ч\": \"CH\",\n\t\"С\": \"S\",\n\t\"М\": \"M\",\n\t\"И\": \"I\",\n\t\"Т\": \"T\",\n\t\"Ь\": \"'\",\n\t\"Б\": \"B\",\n\t\"Ю\": \"YU\",\n\t\"я\": \"ya\",\n\t\"ч\": \"ch\",\n\t\"с\": \"s\",\n\t\"м\": \"m\",\n\t\"и\": \"i\",\n\t\"т\": \"t\",\n\t\"ь\": \"'\",\n\t\"б\": \"b\",\n\t\"ю\": \"yu\"\n};\n","'use strict';\nimport { getParameterByName, replaceDiacritics, transliterate, replaceSpecialCharacters } from './utils'\n\n/*\n * This file handles all of the normalization of the name/slug field for a post type\n * or taxonomy being registered.\n *\n * That way we are only allowing latin characters and dashes/underscores.\n *\n * It also shows a hidden alert if the slug has been changed in some way when editing an existing\n * content type.\n *\n * Lastly it will also show a warning if the attempted slug has already been registered elsewhere,\n * to help avoid clashes. The only exception is if the checkbox is checked indicating that the user\n * is trying to convert TO using CPTUI, and the conflicting slug elsewhere will be removed soon.\n */\n\n(() => {\n\tlet nameField = document.querySelector('#name');\n\tlet original_slug;\n\n\tif ('edit' === getParameterByName('action')) {\n\t\tif (nameField) {\n\t\t\t// Store our original slug on page load for edit checking.\n\t\t\toriginal_slug = nameField.value;\n\t\t}\n\t}\n\n\tif (nameField) {\n\t\t// Switch spaces for underscores on our slug fields.\n\t\tnameField.addEventListener('keyup', (e) => {\n\t\t\tlet value, original_value;\n\n\t\t\tvalue = original_value = e.currentTarget.value;\n\t\t\tlet keys = ['Tab', 'ArrowLeft', 'ArrowUp', 'ArrowRight', 'ArrowDown'];\n\t\t\tif (!keys.includes(e.code)) {\n\t\t\t\tvalue = value.replace(/ /g, \"_\");\n\t\t\t\tvalue = value.toLowerCase();\n\t\t\t\tvalue = replaceDiacritics(value);\n\t\t\t\tvalue = transliterate(value);\n\t\t\t\tvalue = replaceSpecialCharacters(value);\n\t\t\t\tif (value !== original_value) {\n\t\t\t\t\te.currentTarget.value = value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//Displays a message if slug changes.\n\t\t\tif (typeof original_slug !== 'undefined') {\n\t\t\t\tlet slugchanged = document.querySelector('#slugchanged');\n\t\t\t\tif (value !== original_slug) {\n\t\t\t\t\tslugchanged.classList.remove('hidemessage');\n\t\t\t\t} else {\n\t\t\t\t\tslugchanged.classList.add('hidemessage');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet slugexists = document.querySelector('#slugexists');\n\t\t\tlet override = document.querySelector('#override_validation');\n\t\t\tlet override_validation = (override) ? override.checked : false;\n\t\t\tif (typeof cptui_type_data != 'undefined') {\n\t\t\t\tif (cptui_type_data.existing_post_types.hasOwnProperty(value) && value !== original_slug && override_validation === false) {\n\t\t\t\t\tslugexists.classList.remove('hidemessage');\n\t\t\t\t} else {\n\t\t\t\t\tslugexists.classList.add('hidemessage');\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (typeof cptui_tax_data != 'undefined') {\n\t\t\t\tif (cptui_tax_data.existing_taxonomies.hasOwnProperty(value) && value !== original_slug) {\n\t\t\t\t\tslugexists.classList.remove('hidemessage');\n\t\t\t\t} else {\n\t\t\t\t\tslugexists.classList.add('hidemessage');\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n})();\n","import './partials/utils';\nimport './partials/hide-submit';\nimport './partials/toggle-hierarchical';\nimport './partials/autoswitch';\nimport './partials/confirm-delete';\nimport './partials/support-toggles';\nimport './partials/namefield';\nimport './partials/menu-icon';\nimport './partials/tax-required-post-type';\nimport './partials/autopopulate';\nimport './partials/back-to-top';\nimport './partials/toggle-panels';\n"],"names":["supportQuestions","document","querySelectorAll","Array","from","forEach","question","index","next","elem","selector","nextElem","nextElementSibling","matches","state","answer","style","display","theEvent","addEventListener","e","keys","type","includes","code","preventDefault","currentTarget","classList","toggle","setAttribute","toString","focus","postboxes","add_postbox_toggles","pagenow","all_panels","element","panel_id_item","querySelector","panel_id","getAttribute","panel","localStorage","getItem","remove","add","postbox","el","i","setItem","removeItem","$","on","msg","cptui_type_data","confirm","cptui_tax_data","submit_delete_warning","appendTo","dialog","OK","target","off","click","Cancel","jQuery","taxSubmit","taxSubmitSelectCPTDialog","taxCPTChecked","length","showModal","taxSubmitSelectCPTConfirmCloseBtn","close","nameField","autoPopulate","autoLabels","eventName","slug","value","plural","singular","fields","field","newval","plurality","replace","autoClear","hierarchicalSetting","pageAttributesCheck","checked","_custom_media","_orig_send_attachment","undefined","wp","media","editor","send","attachment","icons","cptuiIconPicker","iconsJSON","iconPicker","IconPicker","theme","iconSource","key","prefix","url","closeOnSelect","i18n","iconsPlaceholder","iconsTitle","iconsEmpty","iconsLoading","iconsSave","menuIconField","menuIconPreview","regIcon","dashIcon","origText","icon","innerHTML","div","createElement","insertAdjacentElement","button","props","img","src","apply","open","postTypeDropdown","taxonomyDropdown","postTypeSelectPostType","submit","taxonomySelectPostType","cptSelectSubmit","taxSelectSubmit","back_to_top_btn","cptuiDebounce","backToTop","window","scrollTo","top","behavior","scrollY","method","delay","clearTimeout","_tId","setTimeout","getParameterByName","name","location","href","regex","RegExp","results","exec","decodeURIComponent","transliterate","word","split","map","char","cyrillic","join","htmlEncode","str","String","c","charCodeAt","composePreviewContent","re","isURL","test","indexOf","dashDiv","imgsrc","encodeURI","theimg","replaceDiacritics","s","diacritics","chars","replaceSpecialCharacters","original_slug","original_value","toLowerCase","slugchanged","slugexists","override","override_validation","existing_post_types","hasOwnProperty","existing_taxonomies"],"sourceRoot":""} \ No newline at end of file diff --git a/build/cptui.min.js b/build/cptui.min.js index 3f210d16..245b9743 100644 --- a/build/cptui.min.js +++ b/build/cptui.min.js @@ -1 +1 @@ -(()=>{var a={194:()=>{var e;e=document.querySelectorAll("#support .question"),Array.from(e).forEach(function(t,e){let a=!1,c=((e,t)=>(e=e.nextElementSibling,!t||e&&e.matches(t)?e:null))(t,"div");c.style.display="none",["click","keydown"].forEach(e=>{t.addEventListener(e,e=>{"keydown"===e.type&&!["Space","Enter"].includes(e.code)||(e.preventDefault(),a=!a,c.style.display=a?"block":"none",e.currentTarget.classList.toggle("active"),e.currentTarget.setAttribute("aria-expanded",a.toString()),e.currentTarget.focus())})})})},213:()=>{postboxes.add_postbox_toggles(pagenow),["#cptui_panel_pt_basic_settings","#cptui_panel_pt_additional_labels","#cptui_panel_pt_advanced_settings","#cptui_panel_tax_basic_settings","#cptui_panel_tax_additional_labels","#cptui_panel_tax_advanced_settings"].forEach((e,t)=>{e=document.querySelector(e);if(e){let a=e.getAttribute("id");var c=document.querySelector("#"+a),c=(localStorage.getItem(a)&&null!==localStorage.getItem(a)?c.classList.add("closed"):c.classList.remove("closed"),e.querySelectorAll(".postbox-header"));Array.from(c).forEach((e,t)=>{e.addEventListener("click",e=>{localStorage.getItem(a)?localStorage.removeItem(a):localStorage.setItem(a,"1")})})}})},285:()=>{var a;(a=jQuery)(".cptui-delete-top, .cptui-delete-bottom").on("click",function(e){e.preventDefault();let t="";"undefined"!=typeof cptui_type_data?t=cptui_type_data.confirm:"undefined"!=typeof cptui_tax_data&&(t=cptui_tax_data.confirm);a('
          '+t+"
          ").appendTo("#poststuff").dialog({dialogClass:"wp-dialog",modal:!0,autoOpen:!0,buttons:{OK:function(){a(this).dialog("close"),a(e.target).off("click").click()},Cancel:function(){a(this).dialog("close")}}})})},376:()=>{{var e=document.querySelectorAll(".cptui-taxonomy-submit");let a=document.querySelector("#cptui-select-post-type-confirm");Array.from(e).forEach((e,t)=>{e.addEventListener("click",e=>{0===document.querySelectorAll('#cptui_panel_tax_basic_settings input[type="checkbox"]:checked').length&&(e.preventDefault(),a.showModal())})}),(e=document.querySelector("#cptui-select-post-type-confirm-close"))&&e.addEventListener("click",e=>{e.preventDefault(),a.close()})}},464:()=>{{let a=document.querySelector("#name"),c=document.querySelector("#auto-populate");var e=document.querySelector("#autolabels");e&&(e.style.display="table-row"),c&&["click","tap"].forEach((e,t)=>{c.addEventListener(e,e=>{e.preventDefault();e=a.value;let c=document.querySelector("#label").value,o=document.querySelector("#singular_label").value;var t=document.querySelectorAll('.cptui-labels input[type="text"]');""!==e&&(""===c&&(c=e),""===o&&(o=e),Array.from(t).forEach(e=>{let t=e.getAttribute("data-label");var a=e.getAttribute("data-plurality");void 0!==t&&(t="plural"===a?t.replace(/item/gi,c):t.replace(/item/gi,o),""===e.value)&&(e.value=t)}))})});let o=document.querySelector("#auto-clear");o&&["click","tap"].forEach((e,t)=>{o.addEventListener(e,e=>{e.preventDefault();e=document.querySelectorAll('.cptui-labels input[type="text"]');Array.from(e).forEach(e=>{e.value=""})})})}},643:()=>{var e;(e=document.querySelector("#hierarchical"))&&e.addEventListener("change",e=>{var t=document.querySelector("#page-attributes");e.currentTarget&&"1"===e.currentTarget.value?t.checked=!0:t.checked=!1})},698:()=>{{let a,c;void 0!==wp.media&&(a=!0,c=wp.media.editor.send.attachment);var l=cptuiIconPicker.iconsJSON,l=new IconPicker("#cptui_choose_dashicon",{theme:"default",iconSource:[{key:"dashicons",prefix:"dashicons-",url:l}],closeOnSelect:!0});let o=document.querySelector("#menu_icon"),r=document.querySelector("#menu_icon_preview");var n=document.querySelector("#cptui_choose_icon");let e=document.querySelector("#cptui_choose_dashicon"),t=e.value;l.on("select",e=>{o.value=e.value,r.innerHTML="";var t=document.createElement("div");t.classList.add("dashicons",e.value),r.insertAdjacentElement("afterbegin",t)}),l.on("hide",()=>{e.value=t}),n&&n.addEventListener("click",e=>{e.preventDefault();e=e.currentTarget;return a=!0,wp.media.editor.send.attachment=function(e,t){if(!a)return c.apply(this,[e,t]);o.value=t.url,r.innerHTML="";e=document.createElement("img");e.src=t.url,r.insertAdjacentElement("afterbegin",e)},wp.media.editor.open(e),!1})}},706:()=>{var e,t;e=document.querySelector("#post_type"),t=document.querySelector("#taxonomy"),e&&e.addEventListener("change",()=>{var e=document.querySelector("#cptui_select_post_type");e&&e.submit()}),t&&t.addEventListener("change",()=>{var e=document.querySelector("#cptui_select_taxonomy");e&&e.submit()})},710:()=>{var e;(e=document.querySelector("#cptui_select_post_type_submit"))&&(e.style.display="none"),(e=document.querySelector("#cptui_select_taxonomy_submit"))&&(e.style.display="none")},864:()=>{{let e=document.querySelector(".cptui-back-to-top");function a(){300{var e,t;e=a,t=500,clearTimeout(e._tId),e._tId=setTimeout(function(){e()},t)}),e.addEventListener("click",e=>{e.preventDefault(),window.scrollTo({top:0,behavior:"smooth"})}))}}},c={};function o(e){var t=c[e];return void 0!==t||(t=c[e]={exports:{}},a[e](t,t.exports,o)),t.exports}let r={"Ё":"YO","Й":"I","Ц":"TS","У":"U","К":"K","Е":"E","Н":"N","Г":"G","Ш":"SH","Щ":"SCH","З":"Z","Х":"H","Ъ":"'","ё":"yo","й":"i","ц":"ts","у":"u","к":"k","е":"e","н":"n","г":"g","ш":"sh","щ":"sch","з":"z","х":"h","ъ":"'","Ф":"F","Ы":"I","В":"V","А":"a","П":"P","Р":"R","О":"O","Л":"L","Д":"D","Ж":"ZH","Э":"E","ф":"f","ы":"i","в":"v","а":"a","п":"p","р":"r","о":"o","л":"l","д":"d","ж":"zh","э":"e","Я":"Ya","Ч":"CH","С":"S","М":"M","И":"I","Т":"T","Ь":"'","Б":"B","Ю":"YU","я":"ya","ч":"ch","с":"s","м":"m","и":"i","т":"t","ь":"'","б":"b","ю":"yu"};o(710),o(643),o(706),o(285),o(194);{var e,t,l=document.querySelector("#name");let o;"edit"===(e="action",t=t||window.location.href,e=e.replace(/[\[\]]/g,"\\$&"),(e=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)").exec(t))?e[2]?decodeURIComponent(e[2].replace(/\+/g," ")):"":null)&&l&&(o=l.value),l&&l.addEventListener("keyup",e=>{let t,a;t=a=e.currentTarget.value;["Tab","ArrowLeft","ArrowUp","ArrowRight","ArrowDown"].includes(e.code)||(t=(t=(t=>{var a=[/[\300-\306]/g,/[\340-\346]/g,/[\310-\313]/g,/[\350-\353]/g,/[\314-\317]/g,/[\354-\357]/g,/[\322-\330]/g,/[\362-\370]/g,/[\331-\334]/g,/[\371-\374]/g,/[\321]/g,/[\361]/g,/[\307]/g,/[\347]/g],c=["A","a","E","e","I","i","O","o","U","u","N","n","C","c"];for(let e=0;e{var c={194:()=>{var e;e=document.querySelectorAll("#support .question"),Array.from(e).forEach(function(t,e){let c=!1,a=((e,t)=>(e=e.nextElementSibling,!t||e&&e.matches(t)?e:null))(t,"div");a.style.display="none",["click","keydown"].forEach(e=>{t.addEventListener(e,e=>{"keydown"===e.type&&!["Space","Enter"].includes(e.code)||(e.preventDefault(),c=!c,a.style.display=c?"block":"none",e.currentTarget.classList.toggle("active"),e.currentTarget.setAttribute("aria-expanded",c.toString()),e.currentTarget.focus())})})})},213:()=>{postboxes.add_postbox_toggles(pagenow),["#cptui_panel_pt_basic_settings","#cptui_panel_pt_additional_labels","#cptui_panel_pt_advanced_settings","#cptui_panel_tax_basic_settings","#cptui_panel_tax_additional_labels","#cptui_panel_tax_advanced_settings"].forEach((e,t)=>{e=document.querySelector(e);if(e){let c=e.getAttribute("id");var a=document.querySelector("#"+c),a=(localStorage.getItem(c)&&null!==localStorage.getItem(c)?a.classList.add("closed"):a.classList.remove("closed"),e.querySelectorAll(".postbox-header"));Array.from(a).forEach((e,t)=>{e.addEventListener("click",e=>{localStorage.getItem(c)?localStorage.removeItem(c):localStorage.setItem(c,"1")})})}})},285:()=>{var c;(c=jQuery)(".cptui-delete-top, .cptui-delete-bottom").on("click",function(e){e.preventDefault();let t="";"undefined"!=typeof cptui_type_data?t=cptui_type_data.confirm:"undefined"!=typeof cptui_tax_data&&(t=cptui_tax_data.confirm);c('
          '+t+"
          ").appendTo("#poststuff").dialog({dialogClass:"wp-dialog",modal:!0,autoOpen:!0,buttons:{OK:function(){c(this).dialog("close"),c(e.target).off("click").click()},Cancel:function(){c(this).dialog("close")}}})})},376:()=>{{var e=document.querySelectorAll(".cptui-taxonomy-submit");let c=document.querySelector("#cptui-select-post-type-confirm");Array.from(e).forEach((e,t)=>{e.addEventListener("click",e=>{0===document.querySelectorAll('#cptui_panel_tax_basic_settings input[type="checkbox"]:checked').length&&(e.preventDefault(),c.showModal())})}),(e=document.querySelector("#cptui-select-post-type-confirm-close"))&&e.addEventListener("click",e=>{e.preventDefault(),c.close()})}},464:()=>{{let c=document.querySelector("#name"),a=document.querySelector("#auto-populate");var e=document.querySelector("#autolabels");e&&(e.style.display="table-row"),a&&["click","tap"].forEach((e,t)=>{a.addEventListener(e,e=>{e.preventDefault();e=c.value;let a=document.querySelector("#label").value,o=document.querySelector("#singular_label").value;var t=document.querySelectorAll('.cptui-labels input[type="text"]');""!==e&&(""===a&&(a=e),""===o&&(o=e),Array.from(t).forEach(e=>{let t=e.getAttribute("data-label");var c=e.getAttribute("data-plurality");void 0!==t&&(t="plural"===c?t.replace(/item/gi,a):t.replace(/item/gi,o),""===e.value)&&(e.value=t)}))})});let o=document.querySelector("#auto-clear");o&&["click","tap"].forEach((e,t)=>{o.addEventListener(e,e=>{e.preventDefault();e=document.querySelectorAll('.cptui-labels input[type="text"]');Array.from(e).forEach(e=>{e.value=""})})})}},643:()=>{var e;(e=document.querySelector("#hierarchical"))&&e.addEventListener("change",e=>{var t=document.querySelector("#page-attributes");e.currentTarget&&"1"===e.currentTarget.value?t.checked=!0:t.checked=!1})},698:()=>{{let c,a;void 0!==wp.media&&(c=!0,a=wp.media.editor.send.attachment);var l=cptuiIconPicker.iconsJSON,l=new IconPicker("#cptui_choose_dashicon",{theme:"default",iconSource:[{key:"dashicons",prefix:"dashicons-",url:l}],closeOnSelect:!0,i18n:{"input:placeholder":cptuiIconPicker.iconsPlaceholder,"text:title":cptuiIconPicker.iconsTitle,"text:empty":cptuiIconPicker.iconsEmpty,"text:loading":cptuiIconPicker.iconsLoading,"btn:save":cptuiIconPicker.iconsSave}});let o=document.querySelector("#menu_icon"),r=document.querySelector("#menu_icon_preview");var n=document.querySelector("#cptui_choose_icon");let e=document.querySelector("#cptui_choose_dashicon"),t=e.value;l.on("select",e=>{o.value=e.value,r.innerHTML="";var t=document.createElement("div");t.classList.add("dashicons",e.value),r.insertAdjacentElement("afterbegin",t)}),l.on("hide",()=>{e.value=t}),n&&n.addEventListener("click",e=>{e.preventDefault();e=e.currentTarget;return c=!0,wp.media.editor.send.attachment=function(e,t){if(!c)return a.apply(this,[e,t]);o.value=t.url,r.innerHTML="";e=document.createElement("img");e.src=t.url,r.insertAdjacentElement("afterbegin",e)},wp.media.editor.open(e),!1})}},706:()=>{var e,t;e=document.querySelector("#post_type"),t=document.querySelector("#taxonomy"),e&&e.addEventListener("change",()=>{var e=document.querySelector("#cptui_select_post_type");e&&e.submit()}),t&&t.addEventListener("change",()=>{var e=document.querySelector("#cptui_select_taxonomy");e&&e.submit()})},710:()=>{var e;(e=document.querySelector("#cptui_select_post_type_submit"))&&(e.style.display="none"),(e=document.querySelector("#cptui_select_taxonomy_submit"))&&(e.style.display="none")},864:()=>{{let e=document.querySelector(".cptui-back-to-top");function c(){300{var e,t;e=c,t=500,clearTimeout(e._tId),e._tId=setTimeout(function(){e()},t)}),e.addEventListener("click",e=>{e.preventDefault(),window.scrollTo({top:0,behavior:"smooth"})}))}}},a={};function o(e){var t=a[e];return void 0!==t||(t=a[e]={exports:{}},c[e](t,t.exports,o)),t.exports}let r={"Ё":"YO","Й":"I","Ц":"TS","У":"U","К":"K","Е":"E","Н":"N","Г":"G","Ш":"SH","Щ":"SCH","З":"Z","Х":"H","Ъ":"'","ё":"yo","й":"i","ц":"ts","у":"u","к":"k","е":"e","н":"n","г":"g","ш":"sh","щ":"sch","з":"z","х":"h","ъ":"'","Ф":"F","Ы":"I","В":"V","А":"a","П":"P","Р":"R","О":"O","Л":"L","Д":"D","Ж":"ZH","Э":"E","ф":"f","ы":"i","в":"v","а":"a","п":"p","р":"r","о":"o","л":"l","д":"d","ж":"zh","э":"e","Я":"Ya","Ч":"CH","С":"S","М":"M","И":"I","Т":"T","Ь":"'","Б":"B","Ю":"YU","я":"ya","ч":"ch","с":"s","м":"m","и":"i","т":"t","ь":"'","б":"b","ю":"yu"};o(710),o(643),o(706),o(285),o(194);{var e,t,l=document.querySelector("#name");let o;"edit"===(e="action",t=t||window.location.href,e=e.replace(/[\[\]]/g,"\\$&"),(e=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)").exec(t))?e[2]?decodeURIComponent(e[2].replace(/\+/g," ")):"":null)&&l&&(o=l.value),l&&l.addEventListener("keyup",e=>{let t,c;t=c=e.currentTarget.value;["Tab","ArrowLeft","ArrowUp","ArrowRight","ArrowDown"].includes(e.code)||(t=(t=(t=>{var c=[/[\300-\306]/g,/[\340-\346]/g,/[\310-\313]/g,/[\350-\353]/g,/[\314-\317]/g,/[\354-\357]/g,/[\322-\330]/g,/[\362-\370]/g,/[\331-\334]/g,/[\371-\374]/g,/[\321]/g,/[\361]/g,/[\307]/g,/[\347]/g],a=["A","a","E","e","I","i","O","o","U","u","N","n","C","c"];for(let e=0;e