diff --git a/build/cptui.asset.php b/build/cptui.asset.php
index 17e77397..da25452a 100644
--- a/build/cptui.asset.php
+++ b/build/cptui.asset.php
@@ -1 +1 @@
- array(), 'version' => 'd000a5c9efc720ffeec4');
+ array(), 'version' => '5e72e329ea97eeaf828a');
diff --git a/build/cptui.js b/build/cptui.js
index ab9169af..3ff02976 100644
--- a/build/cptui.js
+++ b/build/cptui.js
@@ -303,6 +303,79 @@ 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,
+ 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');
+ 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 +734,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 +757,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..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,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,CAACI,IAA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,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,CAACI,IAAI,CAAC,EAAE;UACnD;QACD;QACAJ,CAAC,CAACK,cAAc,CAAC,CAAC;QAClBX,KAAK,GAAG,CAACA,KAAK;QACdC,MAAM,CAACC,KAAK,CAACC,OAAO,GAAGH,KAAK,GAAG,OAAO,G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AU,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 011fcde5..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,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('
' ).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,aAAc,YAAa,cAAe,aAAc,iBAAkB,mBAAoB,gBAAiB,cAAe,cAAe,iBAAkB,gBAAiB,gBAAiB,aAAc,iBAAkB,SAAU,mBAAoB,kBAAmB,cAAe,eAAgB,aAAc,kBAAmB,eAAgB,iBAAkB,eAAgB,eAAgB,cAAe,gBAAiB,eAAgB,eAAgB,qBAAsB,oBAAqB,mBAAoB,oBAAqB,wBAAyB,mBAAoB,qBAAsB,aAAc,eAAgB,oBAAqB,qBAAsB,sBAAuB,wBAAyB,eAAgB,OAAQ,OAAQ,cAAe,gBAAiB,YAAa,YAAa,eAAgB,mBAAoB,qBAAsB,oBAAqB,oBAAqB,oBAAqB,yBAA0B,gBAAiB,kBAAmB,qBAAsB,mBAAoB,iBAAkB,mBAAoB,oBAAqB,oBAAqB,0BAA2B,eAAgB,oBAAqB,iBAAkB,gBAAiB,cAAe,uBAAwB,gBAAiB,aAAc,eAAgB,cAAe,mBAAoB,eAAgB,aAAc,cAAe,eAAgB,aAAc,OAAQ,SAAU,WAAY,eAAgB,aAAc,SAAU,cAAe,OAAQ,aAAc,QAAS,SAAU,WAAY,WAAY,aAAc,aAAc,cAAe,eAAgB,iBAAkB,iBAAkB,kBAAmB,gBAAiB,kBAAmB,kBAAmB,mBAAoB,YAAa,OAAQ,YAAa,YAAa,eAAgB,YAAa,SAAU,MAAO,UAAW,cAAe,mBAAoB,uBAAwB,UAAW,UAAW,YAAa,QAAS,YAAa,WAAY,YAAa,gBAAiB,YAAa,SAAU,gBAAiB,OAAQ,WAAY,QAAS,cAAe,MAAO,WAAY,UAAW,WAAY,OAA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AUC,GACxC,IAAI6B,EAAS5C,EAAEK,IAAI,EAAE6B,IAAI,EACV,KAAXU,EACF5C,EAAE,YAAa2B,CAAI,EAAEgB,KAAK,EAE1B3C,EAAE,KAAM2B,CAAI,EAAErB,KAAK,WACwD,CAAC,IAAtEN,EAAEK,IAAI,EAAEmB,KAAK,MAAM,EAAEqB,YAAY,EAAEC,QAAQF,EAAOC,YAAY,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/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
+
+
+
+
+[](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
' ).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 ) );
diff --git a/src/js/partials/menu-icon.js b/src/js/partials/menu-icon.js
index 8cda6eab..9e0e6636 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,62 @@ 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,
+ 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');
+ 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);
+ }
+})();
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
+
+
+
+
+[](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