From c732f3576a55d75c91daf5429f59f027d28914fa Mon Sep 17 00:00:00 2001 From: Troy Chaplin Date: Mon, 22 Dec 2025 15:27:26 -0500 Subject: [PATCH 1/3] add: baseline --- build/index.asset.php | 2 +- build/index.js | 2 +- build/index.js.map | 1 - build/style-index.css.map | 1 - build/view.js.map | 1 - classes/class-enqueues.php | 10 +++++++ priority-nav.php => priority-plus-nav.php | 2 +- src/_variables.scss | 10 +++++++ src/editor.scss | 35 +++++++++++++++++++++++ src/extend.js | 6 ++-- src/style.scss | 11 +------ 11 files changed, 63 insertions(+), 18 deletions(-) delete mode 100644 build/index.js.map delete mode 100644 build/style-index.css.map delete mode 100644 build/view.js.map rename priority-nav.php => priority-plus-nav.php (96%) create mode 100755 src/_variables.scss create mode 100755 src/editor.scss diff --git a/build/index.asset.php b/build/index.asset.php index 99e860e..9c575ae 100644 --- a/build/index.asset.php +++ b/build/index.asset.php @@ -1 +1 @@ - array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-hooks', 'wp-i18n', 'wp-primitives'), 'version' => 'ef033ea779e09cc8622b'); + array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-hooks', 'wp-i18n', 'wp-primitives'), 'version' => 'f70bf9cfc5a50eb84d64'); diff --git a/build/index.js b/build/index.js index 764dd8b..fab8d32 100644 --- a/build/index.js +++ b/build/index.js @@ -1 +1 @@ -(()=>{"use strict";var r,o={698(){const r=window.wp.i18n,o=window.wp.hooks,e=window.wp.blockEditor,i=window.wp.components,t=window.wp.compose,n=window.wp.blocks,a=window.wp.primitives,l=window.ReactJSXRuntime;var v=(0,l.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,l.jsx)(a.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M7.404 16.596a6.5 6.5 0 1 0 9.192-9.192 6.5 6.5 0 0 0-9.192 9.192ZM6.344 6.343a8 8 0 1 0 11.313 11.314A8 8 0 0 0 6.343 6.343Zm4.906 9.407v-3h-3v-1.5h3v-3h1.5v3h3v1.5h-3v3h-1.5Z"})});(0,o.addFilter)("blocks.registerBlockType","priority-nav/extend-core-navigation",(r,o)=>"core/navigation"!==o?r:{...r,attributes:{...r.attributes,priorityNavEnabled:{type:"boolean",default:!1},priorityNavMoreLabel:{type:"string",default:"Browse"},priorityNavMoreIcon:{type:"string",default:"none"}}});const s=(0,t.createHigherOrderComponent)(o=>t=>{const{name:n,attributes:a,setAttributes:v}=t;if("core/navigation"!==n)return(0,l.jsx)(o,{...t});const{priorityNavEnabled:s,priorityNavMoreLabel:p,priorityNavMoreIcon:c}=a;return s?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(o,{...t}),(0,l.jsx)(e.InspectorControls,{children:(0,l.jsxs)(i.PanelBody,{title:(0,r.__)("Priority+ Settings","priority-nav"),children:[(0,l.jsx)(i.TextControl,{label:(0,r.__)("More Button Label","priority-nav"),value:p,onChange:r=>v({priorityNavMoreLabel:r}),help:(0,r.__)('Text displayed on the "More" button',"priority-nav")}),(0,l.jsx)(i.SelectControl,{label:(0,r.__)("More Button Icon","priority-nav"),value:c,options:[{label:(0,r.__)("None","priority-nav"),value:"none"},{label:(0,r.__)("Chevron Down (▼)","priority-nav"),value:"chevron"},{label:(0,r.__)("Plus (+)","priority-nav"),value:"plus"},{label:(0,r.__)("Menu (≡)","priority-nav"),value:"menu"}],onChange:r=>v({priorityNavMoreIcon:r})})]})})]}):(0,l.jsx)(o,{...t})},"withPriorityNavControls");(0,o.addFilter)("editor.BlockEdit","priority-nav/add-priority-nav-controls",s),(0,n.registerBlockVariation)("core/navigation",{name:"lumen-priority-nav",title:(0,r.__)("Priority+ Nav","priority-nav"),description:(0,r.__)('A responsive navigation that automatically moves overflow items to a "More" dropdown.',"priority-nav"),icon:v,attributes:{priorityNavEnabled:!0,priorityNavMoreLabel:"Browse",priorityNavMoreIcon:"none"},scope:["inserter","block"],isActive:r=>!!r.priorityNavEnabled})}},e={};function i(r){var t=e[r];if(void 0!==t)return t.exports;var n=e[r]={exports:{}};return o[r](n,n.exports,i),n.exports}i.m=o,r=[],i.O=(o,e,t,n)=>{if(!e){var a=1/0;for(p=0;p=n)&&Object.keys(i.O).every(r=>i.O[r](e[v]))?e.splice(v--,1):(l=!1,n0&&r[p-1][2]>n;p--)r[p]=r[p-1];r[p]=[e,t,n]},i.o=(r,o)=>Object.prototype.hasOwnProperty.call(r,o),(()=>{var r={57:0,350:0};i.O.j=o=>0===r[o];var o=(o,e)=>{var t,n,[a,l,v]=e,s=0;if(a.some(o=>0!==r[o])){for(t in l)i.o(l,t)&&(i.m[t]=l[t]);if(v)var p=v(i)}for(o&&o(e);si(698));t=i.O(t)})(); \ No newline at end of file +(()=>{"use strict";var r,o={698(){const r=window.wp.i18n,o=window.wp.hooks,e=window.wp.blockEditor,i=window.wp.components,t=window.wp.compose,n=window.wp.blocks,a=window.wp.primitives,l=window.ReactJSXRuntime;var v=(0,l.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,l.jsx)(a.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M7.404 16.596a6.5 6.5 0 1 0 9.192-9.192 6.5 6.5 0 0 0-9.192 9.192ZM6.344 6.343a8 8 0 1 0 11.313 11.314A8 8 0 0 0 6.343 6.343Zm4.906 9.407v-3h-3v-1.5h3v-3h1.5v3h3v1.5h-3v3h-1.5Z"})});(0,o.addFilter)("blocks.registerBlockType","priority-nav/extend-core-navigation",(r,o)=>"core/navigation"!==o?r:{...r,attributes:{...r.attributes,priorityNavEnabled:{type:"boolean",default:!1},priorityNavMoreLabel:{type:"string",default:"Browse"},priorityNavMoreIcon:{type:"string",default:"none"}}});const s=(0,t.createHigherOrderComponent)(o=>t=>{const{name:n,attributes:a,setAttributes:v}=t;if("core/navigation"!==n)return(0,l.jsx)(o,{...t});const{priorityNavEnabled:s,priorityNavMoreLabel:p,priorityNavMoreIcon:c}=a;return s?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"priority-nav-editor-wrapper",children:(0,l.jsx)(o,{...t})}),(0,l.jsx)(e.InspectorControls,{children:(0,l.jsxs)(i.PanelBody,{title:(0,r.__)("Priority+ Settings","priority-nav"),children:[(0,l.jsx)(i.TextControl,{label:(0,r.__)("More Button Label","priority-nav"),value:p,onChange:r=>v({priorityNavMoreLabel:r}),help:(0,r.__)('Text displayed on the "More" button',"priority-nav")}),(0,l.jsx)(i.SelectControl,{label:(0,r.__)("More Button Icon","priority-nav"),value:c,options:[{label:(0,r.__)("None","priority-nav"),value:"none"},{label:(0,r.__)("Chevron Down (▼)","priority-nav"),value:"chevron"},{label:(0,r.__)("Plus (+)","priority-nav"),value:"plus"},{label:(0,r.__)("Menu (≡)","priority-nav"),value:"menu"}],onChange:r=>v({priorityNavMoreIcon:r})})]})})]}):(0,l.jsx)(o,{...t})},"withPriorityNavControls");(0,o.addFilter)("editor.BlockEdit","priority-nav/add-priority-nav-controls",s),(0,n.registerBlockVariation)("core/navigation",{name:"lumen-priority-nav",title:(0,r.__)("Priority+ Nav","priority-nav"),description:(0,r.__)('A responsive navigation that automatically moves overflow items to a "More" dropdown.',"priority-nav"),icon:v,attributes:{priorityNavEnabled:!0,priorityNavMoreLabel:"Browse",priorityNavMoreIcon:"none"},scope:["inserter","block"],isActive:r=>!!r.priorityNavEnabled})}},e={};function i(r){var t=e[r];if(void 0!==t)return t.exports;var n=e[r]={exports:{}};return o[r](n,n.exports,i),n.exports}i.m=o,r=[],i.O=(o,e,t,n)=>{if(!e){var a=1/0;for(p=0;p=n)&&Object.keys(i.O).every(r=>i.O[r](e[v]))?e.splice(v--,1):(l=!1,n0&&r[p-1][2]>n;p--)r[p]=r[p-1];r[p]=[e,t,n]},i.o=(r,o)=>Object.prototype.hasOwnProperty.call(r,o),(()=>{var r={57:0,350:0};i.O.j=o=>0===r[o];var o=(o,e)=>{var t,n,[a,l,v]=e,s=0;if(a.some(o=>0!==r[o])){for(t in l)i.o(l,t)&&(i.m[t]=l[t]);if(v)var p=v(i)}for(o&&o(e);si(698));t=i.O(t)})(); \ No newline at end of file diff --git a/build/index.js.map b/build/index.js.map deleted file mode 100644 index 3d451f2..0000000 --- a/build/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;AAAA;AACkD;AACV;AACxC,0CAA0C,sDAAG,CAAC,sDAAG,IAAI,qFAAqF,sDAAG;AAC7I,EAAE,uDAAI;AACN;AACA;AACA;AACA;AACA;AACA,GAAG;AAGD;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;ACdA;AACA;AACA;AACqC;AACQ;AACe;AACkB;AACd;AACL;AACb;;AAE9C;AACA;AACA;AAFA;AAGAC,2DAAS,CACR,0BAA0B,EAC1B,qCAAqC,EACrC,CAAEc,QAAQ,EAAEC,IAAI,KAAM;EACrB,IAAKA,IAAI,KAAK,iBAAiB,EAAG;IACjC,OAAOD,QAAQ;EAChB;EAEA,OAAO;IACN,GAAGA,QAAQ;IACXE,UAAU,EAAE;MACX,GAAGF,QAAQ,CAACE,UAAU;MACtBC,kBAAkB,EAAE;QACnBC,IAAI,EAAE,SAAS;QACfC,OAAO,EAAE;MACV,CAAC;MACDC,oBAAoB,EAAE;QACrBF,IAAI,EAAE,QAAQ;QACdC,OAAO,EAAE;MACV,CAAC;MACDE,mBAAmB,EAAE;QACpBH,IAAI,EAAE,QAAQ;QACdC,OAAO,EAAE;MACV;IACD;EACD,CAAC;AACF,CACD,CAAC;;AAED;AACA;AACA;AACA,MAAMG,uBAAuB,GAAGjB,8EAA0B,CAAIkB,SAAS,IAAM;EAC5E,OAASC,KAAK,IAAM;IACnB,MAAM;MAAET,IAAI;MAAEC,UAAU;MAAES;IAAc,CAAC,GAAGD,KAAK;IAEjD,IAAKT,IAAI,KAAK,iBAAiB,EAAG;MACjC,oBAAON,sDAAA,CAACc,SAAS;QAAA,GAAMC;MAAK,CAAI,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;WACA;WACA;WACA;WACA,+BAA+B,wCAAwC;WACvE;WACA;WACA;WACA;WACA,iBAAiB,qBAAqB;WACtC;WACA;WACA,kBAAkB,qBAAqB;WACvC;WACA;WACA,KAAK;WACL;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,E;;;;;WC3BA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA,E;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA,E;;;;;WCPA,wF;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D,E;;;;;WCNA;;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,MAAM,qBAAqB;WAC3B;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;WAEA;WACA;WACA,4G;;;;;UEjDA;UACA;UACA;UACA;UACA","sources":["webpack://priority-plus-nav-block/./node_modules/@wordpress/icons/build-module/library/plus-circle.js","webpack://priority-plus-nav-block/./src/extend.js","webpack://priority-plus-nav-block/./src/index.js","webpack://priority-plus-nav-block/./src/style.scss","webpack://priority-plus-nav-block/external window [\"wp\",\"blockEditor\"]","webpack://priority-plus-nav-block/external window [\"wp\",\"blocks\"]","webpack://priority-plus-nav-block/external window [\"wp\",\"components\"]","webpack://priority-plus-nav-block/external window [\"wp\",\"compose\"]","webpack://priority-plus-nav-block/external window [\"wp\",\"hooks\"]","webpack://priority-plus-nav-block/external window [\"wp\",\"i18n\"]","webpack://priority-plus-nav-block/external window [\"wp\",\"primitives\"]","webpack://priority-plus-nav-block/external window \"ReactJSXRuntime\"","webpack://priority-plus-nav-block/webpack/bootstrap","webpack://priority-plus-nav-block/webpack/runtime/chunk loaded","webpack://priority-plus-nav-block/webpack/runtime/compat get default export","webpack://priority-plus-nav-block/webpack/runtime/define property getters","webpack://priority-plus-nav-block/webpack/runtime/hasOwnProperty shorthand","webpack://priority-plus-nav-block/webpack/runtime/make namespace object","webpack://priority-plus-nav-block/webpack/runtime/jsonp chunk loading","webpack://priority-plus-nav-block/webpack/before-startup","webpack://priority-plus-nav-block/webpack/startup","webpack://priority-plus-nav-block/webpack/after-startup"],"sourcesContent":["// packages/icons/src/library/plus-circle.tsx\nimport { Path, SVG } from \"@wordpress/primitives\";\nimport { jsx } from \"react/jsx-runtime\";\nvar plus_circle_default = /* @__PURE__ */ jsx(SVG, { xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 24 24\", children: /* @__PURE__ */ jsx(\n Path,\n {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M7.404 16.596a6.5 6.5 0 1 0 9.192-9.192 6.5 6.5 0 0 0-9.192 9.192ZM6.344 6.343a8 8 0 1 0 11.313 11.314A8 8 0 0 0 6.343 6.343Zm4.906 9.407v-3h-3v-1.5h3v-3h1.5v3h3v1.5h-3v3h-1.5Z\"\n }\n) });\nexport {\n plus_circle_default as default\n};\n//# sourceMappingURL=plus-circle.js.map\n","/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { addFilter } from '@wordpress/hooks';\nimport { InspectorControls } from '@wordpress/block-editor';\nimport { PanelBody, TextControl, SelectControl } from '@wordpress/components';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { registerBlockVariation } from '@wordpress/blocks';\nimport { plusCircle } from '@wordpress/icons';\n\n/**\n * Add Priority+ attributes to core/navigation block\n */\naddFilter(\n\t'blocks.registerBlockType',\n\t'priority-nav/extend-core-navigation',\n\t( settings, name ) => {\n\t\tif ( name !== 'core/navigation' ) {\n\t\t\treturn settings;\n\t\t}\n\n\t\treturn {\n\t\t\t...settings,\n\t\t\tattributes: {\n\t\t\t\t...settings.attributes,\n\t\t\t\tpriorityNavEnabled: {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: false,\n\t\t\t\t},\n\t\t\t\tpriorityNavMoreLabel: {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: 'More',\n\t\t\t\t},\n\t\t\t\tpriorityNavMoreIcon: {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: 'dots',\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t}\n);\n\n/**\n * Add Inspector Controls to core/navigation block\n */\nconst withPriorityNavControls = createHigherOrderComponent( ( BlockEdit ) => {\n\treturn ( props ) => {\n\t\tconst { name, attributes, setAttributes } = props;\n\n\t\tif ( name !== 'core/navigation' ) {\n\t\t\treturn ;\n\t\t}\n\n\t\tconst {\n\t\t\tpriorityNavEnabled,\n\t\t\tpriorityNavMoreLabel,\n\t\t\tpriorityNavMoreIcon,\n\t\t} = attributes;\n\n\t\t// Only show controls if Priority Nav is enabled\n\t\tif ( ! priorityNavEnabled ) {\n\t\t\treturn ;\n\t\t}\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tsetAttributes( { priorityNavMoreLabel: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Text displayed on the \"More\" button',\n\t\t\t\t\t\t\t\t'priority-nav'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tsetAttributes( { priorityNavMoreIcon: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t);\n\t};\n}, 'withPriorityNavControls' );\n\naddFilter(\n\t'editor.BlockEdit',\n\t'priority-nav/add-priority-nav-controls',\n\twithPriorityNavControls\n);\n\n/**\n * Register block variation for Priority+ Navigation\n */\nregisterBlockVariation( 'core/navigation', {\n\tname: 'lumen-priority-nav',\n\ttitle: __( 'Priority+ Nav', 'priority-nav' ),\n\tdescription: __(\n\t\t'A responsive navigation that automatically moves overflow items to a \"More\" dropdown.',\n\t\t'priority-nav'\n\t),\n\ticon: plusCircle,\n\tattributes: {\n\t\tpriorityNavEnabled: true,\n\t\tpriorityNavMoreLabel: 'Browse',\n\t\tpriorityNavMoreIcon: 'none',\n\t},\n\tscope: [ 'inserter', 'block' ],\n\tisActive: ( blockAttributes ) => {\n\t\treturn !! blockAttributes.priorityNavEnabled;\n\t},\n} );\n","import './extend';\nimport './style.scss';\n","// extracted by mini-css-extract-plugin\nexport {};","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"compose\"];","module.exports = window[\"wp\"][\"hooks\"];","module.exports = window[\"wp\"][\"i18n\"];","module.exports = window[\"wp\"][\"primitives\"];","module.exports = window[\"ReactJSXRuntime\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Check if module exists (development only)\n\tif (__webpack_modules__[moduleId] === undefined) {\n\t\tvar e = new Error(\"Cannot find module '\" + moduleId + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t\"index\": 0,\n\t\"./style-index\": 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = globalThis[\"webpackChunkpriority_plus_nav_block\"] = globalThis[\"webpackChunkpriority_plus_nav_block\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [\"./style-index\"], () => (__webpack_require__(\"./src/index.js\")))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n",""],"names":["__","addFilter","InspectorControls","PanelBody","TextControl","SelectControl","createHigherOrderComponent","registerBlockVariation","plusCircle","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","settings","name","attributes","priorityNavEnabled","type","default","priorityNavMoreLabel","priorityNavMoreIcon","withPriorityNavControls","BlockEdit","props","setAttributes","children","title","label","value","onChange","help","options","description","icon","scope","isActive","blockAttributes"],"ignoreList":[],"sourceRoot":""} \ No newline at end of file diff --git a/build/style-index.css.map b/build/style-index.css.map deleted file mode 100644 index 78cc1e9..0000000 --- a/build/style-index.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"./style-index.css","mappings":";;;AAAA;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACH;AACD;;AAEA;EACC;AACD;;AACC;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AACF;;AACE;EACC;AACH;;AAEE;EACC;EACA;AAAH;;AAIG;EACC;AAFJ;;AAOC;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AALF;;AAOE;EACC;EACA;EACA;AALH;;AAQE;EACC;EACA;AANH;;AAQG;EACC;EACA;EACA;EACA;EACA;AANJ;;AAQI;EACC;AANL;;AAcE;EACC;EACA;EACA;EACA;EACA;AAZH;;AAcG;EACC;AAZJ;;AAeG;EACC;AAbJ;;AAiBG;EACC;AAfJ;;AAoBE;EACC;EACA;EACA;EACA;AAlBH;;AAsBE;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AApBH;;AAsBG;EACC;AApBJ;;AAuBG;EACC;EACA;AArBJ;;AA0BI;EACC;AAxBL;;AA8BE;EACC;EACA;AA5BH;;AA+BE;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AA7BH;;AA+BG;EACC;EACA;AA7BJ;;AAkCI;EACC;AAhCL;;AAwCE;EACC;AAtCH,C","sources":["webpack://priority-plus-nav-block/./src/style.scss"],"sourcesContent":[":root {\n --priority-nav--background: transparent;\n --priority-nav--background-hover: rgba(0, 0, 0, 0.05);\n --priority-nav--border: none;\n --priority-nav--border-radius: 4px;\n --priority-nav--color: inherit;\n --priority-nav--font-family: inherit;\n --priority-nav--font-size: inherit;\n\t--priority-nav--padding: 0.5rem 0.75rem;\n}\n\n.wp-block-navigation[data-priority-nav] {\n\tposition: relative;\n\n\t.priority-nav-more-button {\n\t\tdisplay: flex;\n\t\tgap: 0.5rem;\n\t\talign-items: center;\n\t\tfont-family: var(--priority-nav--font-family);\n\t\tfont-size: var(--priority-nav--font-size);\n\t\tcolor: var(--priority-nav--color);\n\t\tpadding: var(--priority-nav--padding);\n\t\tbackground: var(--priority-nav--background);\n\t\tborder: var(--priority-nav--border);\n\t\tborder-radius: var(--priority-nav--border-radius);\n\t\ttransition: all 0.2s ease;\n\t\tcursor: pointer;\n\n\t\t&:hover {\n\t\t\tbackground: var(--priority-nav--background-hover);\n\t\t}\n\n\t\t.icon {\n\t\t\tdisplay: inline-block;\n\t\t\tline-height: 1;\n\t\t}\n\n\t\t&[aria-expanded=\"true\"] {\n\t\t\t.icon {\n\t\t\t\ttransform: rotate(180deg);\n\t\t\t}\n\t\t}\n\t}\n\n\t.priority-nav-dropdown {\n\t\tposition: absolute;\n\t\ttop: calc(100% + 0.5rem);\n\t\tright: 0;\n\t\tmin-width: 200px;\n\t\tbackground: #fff;\n\t\tborder: 1px solid #ddd;\n\t\tborder-radius: 4px;\n\t\tbox-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n\t\tlist-style: none;\n\t\tmargin: 0;\n\t\tpadding: 0.5rem 0;\n\t\tz-index: 1000;\n\t\topacity: 0;\n\t\tvisibility: hidden;\n\t\ttransform: translateY(-10px);\n\t\ttransition: all 0.2s ease;\n\n\t\t&.is-open {\n\t\t\topacity: 1;\n\t\t\tvisibility: visible;\n\t\t\ttransform: translateY(0);\n\t\t}\n\n\t\tli {\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\n\n\t\t\ta {\n\t\t\t\tdisplay: block;\n\t\t\t\tpadding: 0.75rem 1rem;\n\t\t\t\tcolor: inherit;\n\t\t\t\ttext-decoration: none;\n\t\t\t\ttransition: background 0.2s ease;\n\n\t\t\t\t&:hover {\n\t\t\t\t\tbackground: rgba(0, 0, 0, 0.05);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Accordion styles - simplified, using only our custom classes\n\n\t\t// Accordion content - hidden by default, shown when .is-open\n\t\t.priority-nav-accordion-content {\n\t\t\tdisplay: none;\n\t\t\tlist-style: none;\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\n\t\t\tbackground: transparent;\n\n\t\t\t&[aria-hidden=\"true\"] {\n\t\t\t\tdisplay: none !important;\n\t\t\t}\n\n\t\t\t&.is-open {\n\t\t\t\tdisplay: block !important;\n\t\t\t}\n\n\t\t\t// Nested level indentation\n\t\t\t.priority-nav-accordion-content {\n\t\t\t\tpadding-left: 1rem;\n\t\t\t}\n\t\t}\n\n\t\t// Wrapper for link + arrow mode\n\t\t.priority-nav-accordion-wrapper {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: space-between;\n\t\t\twidth: 100%;\n\t\t}\n\n\t\t// Click mode: entire button is clickable\n\t\t.priority-nav-accordion-toggle-full {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: space-between;\n\t\t\twidth: 100%;\n\t\t\tpadding: 0.75rem 1rem;\n\t\t\tbackground: transparent;\n\t\t\tborder: none;\n\t\t\tcursor: pointer;\n\t\t\tfont-size: inherit;\n\t\t\tfont-family: inherit;\n\t\t\tcolor: inherit;\n\t\t\ttext-align: left;\n\n\t\t\t.priority-nav-accordion-text {\n\t\t\t\tflex: 1;\n\t\t\t}\n\n\t\t\t.priority-nav-accordion-arrow {\n\t\t\t\tmargin-left: 0.5rem;\n\t\t\t\ttransition: transform 0.2s ease;\n\t\t\t}\n\n\t\t\t&[aria-expanded=\"true\"] {\n\n\t\t\t\t.priority-nav-accordion-arrow {\n\t\t\t\t\ttransform: rotate(90deg);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Arrow mode: link stays functional, separate arrow button\n\t\t.priority-nav-accordion-link {\n\t\t\tflex: 1;\n\t\t\tpadding: 0.75rem 1rem;\n\t\t}\n\n\t\t.priority-nav-accordion-toggle-arrow {\n\t\t\tpadding: 0.75rem;\n\t\t\tbackground: transparent;\n\t\t\tborder: none;\n\t\t\tcursor: pointer;\n\t\t\tfont-size: inherit;\n\t\t\tfont-family: inherit;\n\t\t\tcolor: inherit;\n\t\t\tflex-shrink: 0;\n\n\t\t\t.priority-nav-accordion-arrow {\n\t\t\t\ttransition: transform 0.2s ease;\n\t\t\t\tdisplay: inline-block;\n\t\t\t}\n\n\t\t\t&[aria-expanded=\"true\"] {\n\n\t\t\t\t.priority-nav-accordion-arrow {\n\t\t\t\t\ttransform: rotate(90deg);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t&[data-more-hidden=\"true\"] {\n\n\t\t.priority-nav-more {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n}\n"],"names":[],"ignoreList":[],"sourceRoot":""} \ No newline at end of file diff --git a/build/view.js.map b/build/view.js.map deleted file mode 100644 index 877c2d9..0000000 --- a/build/view.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"view.js","mappings":";;;;AAAA,MAAMA,WAAW,CAAC;EACjB;EACA,OAAOC,eAAe,GAAG,CAAC;EAE1BC,WAAWA,CAAEC,OAAO,EAAG;IACtB;IACA,IAAI,CAACC,UAAU,GAAG,gBAAiBJ,WAAW,CAACC,eAAe,EAAE,EAAG;;IAEnE;IACA;IACA;IACA,IACCE,OAAO,CAACE,SAAS,CAACC,QAAQ,CAAE,qBAAsB,CAAC,IACnDH,OAAO,CAACI,YAAY,CAAE,mBAAoB,CAAC,EAC1C;MACD;MACA,IAAI,CAACC,GAAG,GAAGL,OAAO;MAClB,IAAI,CAACM,OAAO,GAAGN,OAAO,CAAC,CAAC;IACzB,CAAC,MAAM;MACN;MACA,IAAI,CAACM,OAAO,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AgB,CAACuJ,UAAU,CAAC,CAAC;MAClC,IAAI,CAACvJ,gBAAgB,GAAG,IAAI;IAC7B;IAEA,IAAK,IAAI,CAACC,YAAY,EAAG;MACxBsD,YAAY,CAAE,IAAI,CAACtD,YAAa,CAAC;MACjC,IAAI,CAACA,YAAY,GAAG,IAAI;IACzB;EACD;AACD;;AAEA;AACAI,QAAQ,CAAC+D,gBAAgB,CAAE,kBAAkB,EAAE,MAAM;EACpD;EACA;EACA;EACA,MAAMoF,eAAe,GAAGnJ,QAAQ,CAACkH,gBAAgB,CAChD,+CACD,CAAC;EACD,MAAMkC,iBAAiB,GAAGpJ,QAAQ,CAACkH,gBAAgB,CAClD,yCACD,CAAC;;EAED;EACAiC,eAAe,CAACzG,OAAO,CAAIjF,OAAO,IAAM,IAAIH,WAAW,CAAEG,OAAQ,CAAE,CAAC;;EAEpE;EACA2L,iBAAiB,CAAC1G,OAAO,CAAIjF,OAAO,IAAM,IAAIH,WAAW,CAAEG,OAAQ,CAAE,CAAC;AACvE,CAAE,CAAC,C","sources":["webpack://priority-plus-nav-block/./src/view.js"],"sourcesContent":["class PriorityNav {\n\t// Static counter for generating unique instance IDs\n\tstatic instanceCounter = 0;\n\n\tconstructor( element ) {\n\t\t// Generate unique instance ID for this PriorityNav instance\n\t\tthis.instanceId = `priority-nav-${ PriorityNav.instanceCounter++ }`;\n\n\t\t// Support both wrapper mode and direct mode\n\t\t// Wrapper mode: element has [data-priority-nav] and contains .wp-block-navigation\n\t\t// Direct mode: element IS .wp-block-navigation with [data-priority-nav]\n\t\tif (\n\t\t\telement.classList.contains( 'wp-block-navigation' ) &&\n\t\t\telement.hasAttribute( 'data-priority-nav' )\n\t\t) {\n\t\t\t// Direct mode: element is the nav itself\n\t\t\tthis.nav = element;\n\t\t\tthis.wrapper = element; // Use nav as wrapper for compatibility\n\t\t} else {\n\t\t\t// Wrapper mode: look for nav inside\n\t\t\tthis.wrapper = element;\n\t\t\tthis.nav = element.querySelector( '.wp-block-navigation' );\n\t\t}\n\n\t\tif ( ! this.nav ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.list = this.nav.querySelector( '.wp-block-navigation__container' );\n\t\t// Get attributes from nav element (works for both modes since we inject on nav)\n\t\tthis.moreLabel = this.nav.getAttribute( 'data-more-label' ) || 'More';\n\t\tthis.moreIcon = this.nav.getAttribute( 'data-more-icon' ) || 'dots';\n\n\t\t// Check if navigation has openSubmenusOnClick setting\n\t\t// WordPress stores this as data attribute on the nav block\n\t\t// Check all possible attribute name formats\n\t\tlet openSubmenusOnClickAttr = null;\n\n\t\t// Check all data attributes on nav element\n\t\tif ( this.nav.attributes ) {\n\t\t\tfor ( let i = 0; i < this.nav.attributes.length; i++ ) {\n\t\t\t\tconst attr = this.nav.attributes[ i ];\n\t\t\t\tconst name = attr.name.toLowerCase();\n\t\t\t\t// WordPress may use various formats\n\t\t\t\tif (\n\t\t\t\t\tname.includes( 'open' ) &&\n\t\t\t\t\tname.includes( 'submenu' ) &&\n\t\t\t\t\tname.includes( 'click' )\n\t\t\t\t) {\n\t\t\t\t\topenSubmenusOnClickAttr = attr.value;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t// Also check for \"opensubmenusonclick\" variations\n\t\t\t\tif (\n\t\t\t\t\tname === 'data-opensubmenusonclick' ||\n\t\t\t\t\tname === 'data-open-submenus-on-click'\n\t\t\t\t) {\n\t\t\t\t\topenSubmenusOnClickAttr = attr.value;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Also check for class-based indicators\n\t\t// WordPress might use class names like \"open-on-click\" or \"open-submenus-on-click\"\n\t\tif ( openSubmenusOnClickAttr === null ) {\n\t\t\tif (\n\t\t\t\tthis.nav.classList.contains( 'open-on-click' ) ||\n\t\t\t\tthis.nav.classList.contains( 'open-submenus-on-click' ) ||\n\t\t\t\tthis.nav.classList.contains( 'has-open-submenus-on-click' )\n\t\t\t) {\n\t\t\t\topenSubmenusOnClickAttr = 'true';\n\t\t\t}\n\t\t}\n\n\t\t// Check list items for the class too (WordPress might set it on individual items)\n\t\tif ( openSubmenusOnClickAttr === null && this.list ) {\n\t\t\tconst firstItem = this.list.querySelector(\n\t\t\t\t'li.has-child, li.open-on-click'\n\t\t\t);\n\t\t\tif (\n\t\t\t\tfirstItem &&\n\t\t\t\t( firstItem.classList.contains( 'open-on-click' ) ||\n\t\t\t\t\tfirstItem.classList.contains( 'open-submenus-on-click' ) )\n\t\t\t) {\n\t\t\t\topenSubmenusOnClickAttr = 'true';\n\t\t\t}\n\t\t}\n\n\t\t// WordPress may use '1' for true, '0' for false, or boolean strings\n\t\t// Default to false if not found\n\t\tthis.openSubmenusOnClick =\n\t\t\topenSubmenusOnClickAttr === 'true' ||\n\t\t\topenSubmenusOnClickAttr === '1' ||\n\t\t\topenSubmenusOnClickAttr === '';\n\n\t\t// (Debug logging removed for production.)\n\n\t\tif ( ! this.list ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Create More button and dropdown\n\t\tthis.createMoreButton();\n\n\t\tthis.items = Array.from( this.list.children );\n\t\tthis.itemWidths = [];\n\t\tthis.isOpen = false;\n\t\tthis.isCalculating = false;\n\t\tthis.openAccordions = [];\n\t\tthis.submenuCounter = 0; // For generating unique IDs\n\n\t\t// Track responsive container for hamburger mode detection\n\t\tthis.responsiveContainer = this.nav.querySelector(\n\t\t\t'.wp-block-navigation__responsive-container'\n\t\t);\n\t\tthis.mutationObserver = null;\n\t\tthis.retryTimeout = null;\n\t\tthis.isEnabled = true; // Track if Priority Nav should be active\n\n\t\tthis.init();\n\t}\n\n\tcreateMoreButton() {\n\t\t// Create the more container\n\t\tthis.moreContainer = document.createElement( 'div' );\n\t\tthis.moreContainer.className = 'priority-nav-more';\n\n\t\t// Create button\n\t\tthis.moreButton = document.createElement( 'button' );\n\t\tthis.moreButton.type = 'button';\n\t\tthis.moreButton.className =\n\t\t\t'priority-nav-more-button wp-block-navigation-item';\n\t\tthis.moreButton.setAttribute( 'aria-expanded', 'false' );\n\t\tthis.moreButton.setAttribute( 'aria-haspopup', 'true' );\n\t\tthis.moreButton.setAttribute( 'aria-label', this.moreLabel );\n\n\t\tconst iconMap = {\n\t\t\tdots: '•••',\n\t\t\tchevron: '▼',\n\t\t\tplus: '+',\n\t\t\tmenu: '≡',\n\t\t};\n\n\t\tthis.moreButton.innerHTML = `\n\t\t\t${ this.moreLabel }\n\t\t\t${\n\t\t\t\ticonMap[ this.moreIcon ] || iconMap.dots\n\t\t\t}\n\t\t`;\n\n\t\t// Create dropdown\n\t\tthis.dropdown = document.createElement( 'ul' );\n\t\tthis.dropdown.className =\n\t\t\t'priority-nav-dropdown wp-block-navigation__submenu-container';\n\t\tthis.dropdown.setAttribute( 'role', 'menu' );\n\n\t\tthis.moreContainer.appendChild( this.moreButton );\n\t\tthis.moreContainer.appendChild( this.dropdown );\n\n\t\t// Insert after the navigation list\n\t\tthis.list.parentNode.appendChild( this.moreContainer );\n\t\tthis.moreContainer.style.display = 'none';\n\t}\n\n\tinit() {\n\t\tthis.setupEventListeners();\n\t\tthis.setupResponsiveObserver();\n\n\t\t// Check if we should enable Priority Nav\n\t\tif ( this.isInHamburgerMode() ) {\n\t\t\tthis.disablePriorityNav();\n\t\t} else {\n\t\t\tthis.enablePriorityNav();\n\t\t}\n\n\t\tconst resizeObserver = new ResizeObserver( () => {\n\t\t\tif ( ! this.isCalculating ) {\n\t\t\t\t// Check if we've transitioned between hamburger and desktop mode\n\t\t\t\tconst wasEnabled = this.isEnabled;\n\t\t\t\tconst inHamburger = this.isInHamburgerMode();\n\n\t\t\t\tif ( inHamburger && wasEnabled ) {\n\t\t\t\t\tthis.disablePriorityNav();\n\t\t\t\t} else if ( ! inHamburger && ! wasEnabled ) {\n\t\t\t\t\tthis.enablePriorityNav();\n\t\t\t\t} else if ( ! inHamburger && wasEnabled ) {\n\t\t\t\t\t// Still in desktop mode, just recalculate\n\t\t\t\t\trequestAnimationFrame( () => this.checkOverflow() );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t\tresizeObserver.observe( this.wrapper );\n\t}\n\n\t/**\n\t * Check if navigation is in hamburger/responsive mode\n\t * Returns true if the menu container is hidden or in responsive overlay mode\n\t */\n\tisInHamburgerMode() {\n\t\t// Check if responsive container exists and is the active one\n\t\tif ( this.responsiveContainer ) {\n\t\t\tconst containerStyles = window.getComputedStyle(\n\t\t\t\tthis.responsiveContainer\n\t\t\t);\n\t\t\tconst isHidden =\n\t\t\t\tcontainerStyles.display === 'none' ||\n\t\t\t\tcontainerStyles.visibility === 'hidden' ||\n\t\t\t\tthis.responsiveContainer.getAttribute( 'aria-hidden' ) ===\n\t\t\t\t\t'true';\n\n\t\t\t// If responsive container exists and is hidden, we're in hamburger mode\n\t\t\tif ( isHidden ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\t// Check if the main list container is hidden (fallback detection)\n\t\tif ( this.list ) {\n\t\t\tconst listStyles = window.getComputedStyle( this.list );\n\t\t\tconst listRect = this.list.getBoundingClientRect();\n\n\t\t\t// If list is hidden or has zero width, likely in hamburger mode\n\t\t\tif (\n\t\t\t\tlistStyles.display === 'none' ||\n\t\t\t\tlistStyles.visibility === 'hidden' ||\n\t\t\t\tlistRect.width === 0\n\t\t\t) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Check if the navigation list is measurable (visible and has dimensions)\n\t */\n\tisMeasurable() {\n\t\tif ( ! this.list ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst styles = window.getComputedStyle( this.list );\n\t\tconst rect = this.list.getBoundingClientRect();\n\n\t\t// Must be visible and have actual width\n\t\treturn (\n\t\t\tstyles.display !== 'none' &&\n\t\t\tstyles.visibility !== 'hidden' &&\n\t\t\trect.width > 0 &&\n\t\t\trect.height > 0\n\t\t);\n\t}\n\n\t/**\n\t * Disable Priority Nav when in hamburger mode\n\t */\n\tdisablePriorityNav() {\n\t\tthis.isEnabled = false;\n\n\t\t// Show all items\n\t\tthis.items.forEach( ( item ) => {\n\t\t\titem.style.display = '';\n\t\t} );\n\n\t\t// Hide the More button\n\t\tif ( this.moreContainer ) {\n\t\t\tthis.moreContainer.style.display = 'none';\n\t\t}\n\n\t\t// Close dropdown if open\n\t\tthis.closeDropdown();\n\t}\n\n\t/**\n\t * Enable Priority Nav and recalculate\n\t */\n\tenablePriorityNav() {\n\t\tthis.isEnabled = true;\n\n\t\t// Only proceed if measurable\n\t\tif ( ! this.isMeasurable() ) {\n\t\t\t// Schedule retry\n\t\t\tthis.scheduleRetry();\n\t\t\treturn;\n\t\t}\n\n\t\t// Cache widths if needed (or if they contain zeros from previous hidden state)\n\t\tconst needsRecache =\n\t\t\tthis.itemWidths.length === 0 ||\n\t\t\tthis.itemWidths.some( ( width ) => width === 0 );\n\n\t\tif ( needsRecache ) {\n\t\t\tthis.cacheItemWidths();\n\t\t}\n\n\t\t// Recalculate overflow\n\t\trequestAnimationFrame( () => {\n\t\t\tthis.checkOverflow();\n\t\t} );\n\t}\n\n\t/**\n\t * Schedule a retry when menu becomes visible\n\t * @param maxAttempts\n\t */\n\tscheduleRetry( maxAttempts = 20 ) {\n\t\tif ( this.retryTimeout ) {\n\t\t\tclearTimeout( this.retryTimeout );\n\t\t}\n\n\t\tlet attempts = 0;\n\t\tconst tryEnable = () => {\n\t\t\tattempts++;\n\n\t\t\tif ( this.isMeasurable() && ! this.isInHamburgerMode() ) {\n\t\t\t\tthis.enablePriorityNav();\n\t\t\t\tthis.retryTimeout = null;\n\t\t\t} else if ( attempts < maxAttempts ) {\n\t\t\t\tthis.retryTimeout = setTimeout( tryEnable, 100 );\n\t\t\t} else {\n\t\t\t\t// Give up after max attempts\n\t\t\t\tthis.retryTimeout = null;\n\t\t\t}\n\t\t};\n\n\t\tthis.retryTimeout = setTimeout( tryEnable, 100 );\n\t}\n\n\t/**\n\t * Set up observer for responsive container changes\n\t */\n\tsetupResponsiveObserver() {\n\t\tif ( ! this.responsiveContainer ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Watch for attribute and class changes on responsive container\n\t\tthis.mutationObserver = new MutationObserver( ( mutations ) => {\n\t\t\tlet shouldCheck = false;\n\n\t\t\tmutations.forEach( ( mutation ) => {\n\t\t\t\tif (\n\t\t\t\t\tmutation.type === 'attributes' &&\n\t\t\t\t\t( mutation.attributeName === 'aria-hidden' ||\n\t\t\t\t\t\tmutation.attributeName === 'class' )\n\t\t\t\t) {\n\t\t\t\t\tshouldCheck = true;\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\tif ( shouldCheck ) {\n\t\t\t\tconst inHamburger = this.isInHamburgerMode();\n\n\t\t\t\tif ( inHamburger && this.isEnabled ) {\n\t\t\t\t\tthis.disablePriorityNav();\n\t\t\t\t} else if ( ! inHamburger && ! this.isEnabled ) {\n\t\t\t\t\tthis.enablePriorityNav();\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\n\t\tthis.mutationObserver.observe( this.responsiveContainer, {\n\t\t\tattributes: true,\n\t\t\tattributeFilter: [ 'aria-hidden', 'class' ],\n\t\t} );\n\n\t\t// Also observe the list container for visibility changes\n\t\tif ( this.list ) {\n\t\t\tthis.mutationObserver.observe( this.list, {\n\t\t\t\tattributes: true,\n\t\t\t\tattributeFilter: [ 'style', 'class' ],\n\t\t\t\tattributeOldValue: false,\n\t\t\t} );\n\t\t}\n\t}\n\n\tcacheItemWidths() {\n\t\t// Only cache if measurable\n\t\tif ( ! this.isMeasurable() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.items.forEach( ( item ) => {\n\t\t\titem.style.display = '';\n\t\t} );\n\n\t\t// Force a reflow to ensure accurate measurements\n\t\tvoid this.list.offsetHeight;\n\n\t\tthis.itemWidths = this.items.map( ( item ) => {\n\t\t\tconst rect = item.getBoundingClientRect();\n\t\t\treturn rect.width > 0 ? rect.width : 0;\n\t\t} );\n\n\t\t// If we got zero widths, schedule a retry\n\t\tif ( this.itemWidths.some( ( width ) => width === 0 ) ) {\n\t\t\tthis.scheduleRetry();\n\t\t}\n\t}\n\n\tsetupEventListeners() {\n\t\tthis.moreButton.addEventListener( 'click', ( e ) => {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\tthis.toggleDropdown();\n\t\t} );\n\n\t\tdocument.addEventListener( 'click', ( e ) => {\n\t\t\tif ( ! this.moreContainer.contains( e.target ) && this.isOpen ) {\n\t\t\t\tthis.closeDropdown();\n\t\t\t}\n\t\t} );\n\n\t\tdocument.addEventListener( 'keydown', ( e ) => {\n\t\t\tif ( e.key === 'Escape' && this.isOpen ) {\n\t\t\t\t// If accordions are open, close them first, otherwise close dropdown\n\t\t\t\tif ( this.openAccordions.length > 0 ) {\n\t\t\t\t\tthis.closeAllAccordions();\n\t\t\t\t\te.preventDefault();\n\t\t\t\t} else {\n\t\t\t\t\tthis.closeDropdown();\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\n\t\t// Event delegation for accordion toggles\n\t\tthis.dropdown.addEventListener( 'click', ( e ) => {\n\t\t\tconst toggle = e.target.closest( '.priority-nav-accordion-toggle' );\n\t\t\tif ( toggle ) {\n\t\t\t\te.preventDefault();\n\t\t\t\te.stopPropagation();\n\t\t\t\tconst submenuId = toggle.getAttribute( 'aria-controls' );\n\t\t\t\t// Use scoped lookup within this instance's dropdown to avoid cross-instance collisions\n\t\t\t\tconst submenu = this.dropdown.querySelector( `#${ submenuId }` );\n\t\t\t\tif ( submenu ) {\n\t\t\t\t\tthis.toggleAccordionItem( toggle, submenu );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\n\tcheckOverflow() {\n\t\t// Don't run if disabled (hamburger mode) or not measurable\n\t\tif ( ! this.isEnabled || ! this.isMeasurable() ) {\n\t\t\tthis.isCalculating = false;\n\t\t\treturn;\n\t\t}\n\n\t\tthis.isCalculating = true;\n\n\t\t// Get actual visible container width - prefer the nav element itself\n\t\tconst navRect = this.nav.getBoundingClientRect();\n\t\tconst navStyles = window.getComputedStyle( this.nav );\n\t\tconst padding =\n\t\t\tparseFloat( navStyles.paddingLeft ) +\n\t\t\tparseFloat( navStyles.paddingRight );\n\n\t\t// Get gap from the container that actually has it (usually the list container)\n\t\tconst listStyles = window.getComputedStyle( this.list );\n\t\tconst gap =\n\t\t\tparseFloat( listStyles.gap ) || parseFloat( navStyles.gap ) || 8; // Fallback\n\n\t\t// Use nav width if available, otherwise fall back to wrapper\n\t\tconst availableWidth =\n\t\t\tnavRect.width > 0\n\t\t\t\t? navRect.width - padding\n\t\t\t\t: this.wrapper.getBoundingClientRect().width - padding;\n\n\t\t// Temporarily show more button to measure it\n\t\tthis.moreContainer.style.display = '';\n\t\t// Force a reflow for accurate measurement\n\t\tvoid this.moreButton.offsetHeight;\n\t\tconst moreButtonWidth = this.moreButton.getBoundingClientRect().width;\n\n\t\t// Ensure we have valid item widths\n\t\tif (\n\t\t\tthis.itemWidths.length === 0 ||\n\t\t\tthis.itemWidths.some( ( width ) => width === 0 )\n\t\t) {\n\t\t\tthis.cacheItemWidths();\n\t\t\t// If still invalid, abort\n\t\t\tif (\n\t\t\t\tthis.itemWidths.length === 0 ||\n\t\t\t\tthis.itemWidths.some( ( width ) => width === 0 )\n\t\t\t) {\n\t\t\t\tthis.isCalculating = false;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tlet visibleCount = 0;\n\n\t\t// First pass: try to fit all items\n\t\tlet totalWidth = 0;\n\t\tfor ( let i = 0; i < this.items.length; i++ ) {\n\t\t\tconst itemWidth = this.itemWidths[ i ];\n\t\t\tconst gapWidth = i > 0 ? gap : 0; // Gap before item (not for first item)\n\t\t\ttotalWidth += gapWidth + itemWidth;\n\t\t}\n\n\t\t// If everything fits, show all items and hide the More button\n\t\tif ( totalWidth <= availableWidth ) {\n\t\t\tthis.items.forEach( ( item ) => ( item.style.display = '' ) );\n\t\t\tthis.moreContainer.style.display = 'none';\n\t\t\tthis.closeDropdown();\n\t\t\tthis.isCalculating = false;\n\t\t\treturn;\n\t\t}\n\n\t\t// Calculate how many items fit with the More button visible\n\t\tlet usedWidth = 0;\n\t\tfor ( let i = 0; i < this.items.length; i++ ) {\n\t\t\tconst itemWidth = this.itemWidths[ i ];\n\t\t\tconst gapWidth = i > 0 ? gap : 0;\n\t\t\tconst moreButtonGap = gap; // Gap before the More button\n\t\t\tconst itemTotalWidth = gapWidth + itemWidth;\n\n\t\t\t// Check if this item + more button would fit\n\t\t\tconst wouldFit =\n\t\t\t\tusedWidth + itemTotalWidth + moreButtonGap + moreButtonWidth <=\n\t\t\t\tavailableWidth;\n\n\t\t\t// Always show at least one item\n\t\t\tif ( wouldFit || i === 0 ) {\n\t\t\t\tthis.items[ i ].style.display = '';\n\t\t\t\tusedWidth += itemTotalWidth;\n\t\t\t\tvisibleCount++;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// Move overflow items to dropdown - build fresh accordion HTML\n\t\tthis.dropdown.innerHTML = '';\n\t\tthis.submenuCounter = 0; // Reset counter\n\t\tlet hasHiddenItems = false;\n\n\t\tfor ( let i = visibleCount; i < this.items.length; i++ ) {\n\t\t\tthis.items[ i ].style.display = 'none';\n\n\t\t\t// Extract data from the item\n\t\t\tconst itemData = this.extractNavItemData( this.items[ i ] );\n\n\t\t\t// Build fresh accordion HTML\n\t\t\tconst accordionHTML = this.buildAccordionHTML( itemData, 0 );\n\n\t\t\t// Create container and insert HTML\n\t\t\tconst container = document.createElement( 'li' );\n\t\t\tcontainer.innerHTML = accordionHTML;\n\n\t\t\tthis.dropdown.appendChild( container );\n\t\t\thasHiddenItems = true;\n\t\t}\n\n\t\t// Show/hide More button (should always be visible here since we broke out of the first check)\n\t\tif ( hasHiddenItems ) {\n\t\t\tthis.moreContainer.style.display = '';\n\t\t} else {\n\t\t\tthis.moreContainer.style.display = 'none';\n\t\t\tthis.closeDropdown();\n\t\t}\n\n\t\tthis.isCalculating = false;\n\t}\n\n\ttoggleDropdown() {\n\t\tif ( this.isOpen ) {\n\t\t\tthis.closeDropdown();\n\t\t} else {\n\t\t\tthis.openDropdown();\n\t\t}\n\t}\n\n\topenDropdown() {\n\t\tthis.isOpen = true;\n\t\tthis.dropdown.classList.add( 'is-open' );\n\t\tthis.moreButton.setAttribute( 'aria-expanded', 'true' );\n\t}\n\n\tcloseDropdown() {\n\t\tthis.isOpen = false;\n\t\tthis.dropdown.classList.remove( 'is-open' );\n\t\tthis.moreButton.setAttribute( 'aria-expanded', 'false' );\n\t\t// Close all open accordions\n\t\tthis.closeAllAccordions();\n\t}\n\n\textractNavItemData( item ) {\n\t\t// Extract data from a navigation list item\n\t\tconst data = {\n\t\t\ttext: '',\n\t\t\turl: '#',\n\t\t\thasSubmenu: false,\n\t\t\tchildren: [],\n\t\t};\n\n\t\t// Check for submenu FIRST - if it exists, we need to get text differently\n\t\tconst submenuContainer = item.querySelector(\n\t\t\t':scope > .wp-block-navigation__submenu-container'\n\t\t);\n\n\t\t// Find the link element\n\t\tlet linkElement = item.querySelector( ':scope > a' );\n\t\tif ( ! linkElement ) {\n\t\t\tlinkElement = item.querySelector(\n\t\t\t\t':scope > .wp-block-navigation-item__content a'\n\t\t\t);\n\t\t}\n\t\tif ( ! linkElement ) {\n\t\t\t// Fallback: try to get text from item directly, but exclude submenu text\n\t\t\tif ( submenuContainer ) {\n\t\t\t\t// Clone item, remove submenu, then get text\n\t\t\t\tconst clone = item.cloneNode( true );\n\t\t\t\tconst cloneSubmenu = clone.querySelector(\n\t\t\t\t\t'.wp-block-navigation__submenu-container'\n\t\t\t\t);\n\t\t\t\tif ( cloneSubmenu ) {\n\t\t\t\t\tcloneSubmenu.remove();\n\t\t\t\t}\n\t\t\t\tdata.text = clone.textContent.trim();\n\t\t\t} else {\n\t\t\t\tdata.text = item.textContent.trim();\n\t\t\t}\n\t\t\tif ( submenuContainer ) {\n\t\t\t\tdata.hasSubmenu = true;\n\t\t\t\tconst childItems =\n\t\t\t\t\tsubmenuContainer.querySelectorAll( ':scope > li' );\n\t\t\t\tchildItems.forEach( ( childItem ) => {\n\t\t\t\t\tdata.children.push( this.extractNavItemData( childItem ) );\n\t\t\t\t} );\n\t\t\t}\n\t\t\treturn data;\n\t\t}\n\n\t\t// Extract text - only get direct text content, not from nested elements or submenu\n\t\t// Get the label element if it exists (WordPress navigation uses this)\n\t\tconst label = linkElement.querySelector(\n\t\t\t'.wp-block-navigation-item__label'\n\t\t);\n\t\tif ( label ) {\n\t\t\tdata.text = label.textContent.trim();\n\t\t} else {\n\t\t\t// No label - extract only direct text nodes, not from nested elements\n\t\t\t// Clone link and remove all child elements to get only text\n\t\t\tconst linkClone = linkElement.cloneNode( true );\n\t\t\tconst allChildren = linkClone.querySelectorAll( '*' );\n\t\t\tallChildren.forEach( ( child ) => child.remove() );\n\t\t\tdata.text = linkClone.textContent.trim();\n\n\t\t\t// If that didn't work, try getting first text node only\n\t\t\tif ( ! data.text ) {\n\t\t\t\tconst textNodes = Array.from( linkElement.childNodes ).filter(\n\t\t\t\t\t( node ) => node.nodeType === Node.TEXT_NODE\n\t\t\t\t);\n\t\t\t\tif ( textNodes.length > 0 ) {\n\t\t\t\t\tdata.text = textNodes\n\t\t\t\t\t\t.map( ( node ) => node.textContent.trim() )\n\t\t\t\t\t\t.filter( ( t ) => t )\n\t\t\t\t\t\t.join( ' ' );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Ensure we don't have submenu text mixed in (safety check)\n\t\tif ( submenuContainer && data.text ) {\n\t\t\t// If text seems unusually long or contains child item text, try to clean it\n\t\t\tconst childTexts = [];\n\t\t\tsubmenuContainer\n\t\t\t\t.querySelectorAll( 'li a' )\n\t\t\t\t.forEach( ( childLink ) => {\n\t\t\t\t\tconst childText = childLink.textContent.trim();\n\t\t\t\t\tif ( childText && data.text.includes( childText ) ) {\n\t\t\t\t\t\tchildTexts.push( childText );\n\t\t\t\t\t}\n\t\t\t\t} );\n\n\t\t\t// Remove child texts from parent text if they're found\n\t\t\tif ( childTexts.length > 0 ) {\n\t\t\t\tchildTexts.forEach( ( childText ) => {\n\t\t\t\t\tdata.text = data.text.replace( childText, '' ).trim();\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\n\t\tdata.url = linkElement.getAttribute( 'href' ) || '#';\n\n\t\t// Extract children if submenu exists\n\t\tif ( submenuContainer ) {\n\t\t\tdata.hasSubmenu = true;\n\n\t\t\t// Extract children recursively\n\t\t\tconst childItems =\n\t\t\t\tsubmenuContainer.querySelectorAll( ':scope > li' );\n\t\t\tchildItems.forEach( ( childItem ) => {\n\t\t\t\tdata.children.push( this.extractNavItemData( childItem ) );\n\t\t\t} );\n\t\t}\n\n\t\treturn data;\n\t}\n\n\tbuildAccordionHTML( data, level ) {\n\t\tconst submenuId = `${ this.instanceId }-submenu-${ this.submenuCounter++ }`;\n\t\tlet html = '';\n\n\t\tif ( data.hasSubmenu ) {\n\t\t\t// Item has children - build accordion\n\t\t\tif ( this.openSubmenusOnClick ) {\n\t\t\t\t// Click mode: entire item is clickable\n\t\t\t\thtml = `\n\t\t\t\t\t\n\t\t\t\t\t
    \n\t\t\t\t`;\n\t\t\t} else {\n\t\t\t\t// Arrow mode: link stays functional, separate arrow button\n\t\t\t\thtml = `\n\t\t\t\t\t\n\t\t\t\t\t\t${ this.escapeHtml(\n\t\t\t\t\t\t\tdata.text\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
      \n\t\t\t\t`;\n\t\t\t}\n\n\t\t\t// Build children\n\t\t\tdata.children.forEach( ( child ) => {\n\t\t\t\thtml += `
    • ${ this.buildAccordionHTML(\n\t\t\t\t\tchild,\n\t\t\t\t\tlevel + 1\n\t\t\t\t) }
    • `;\n\t\t\t} );\n\n\t\t\thtml += '
    ';\n\t\t} else {\n\t\t\t// No submenu - just a link\n\t\t\thtml = `${ this.escapeHtml( data.text ) }`;\n\t\t}\n\n\t\treturn html;\n\t}\n\n\tescapeHtml( text ) {\n\t\tconst div = document.createElement( 'div' );\n\t\tdiv.textContent = text;\n\t\treturn div.innerHTML;\n\t}\n\n\ttoggleAccordionItem( button, submenu ) {\n\t\tconst isExpanded = button.getAttribute( 'aria-expanded' ) === 'true';\n\n\t\tif ( isExpanded ) {\n\t\t\t// Close this accordion\n\t\t\tbutton.setAttribute( 'aria-expanded', 'false' );\n\t\t\tsubmenu.style.setProperty( 'display', 'none', 'important' );\n\t\t\tsubmenu.classList.remove( 'is-open' );\n\t\t\tsubmenu.setAttribute( 'aria-hidden', 'true' );\n\n\t\t\t// Remove from open accordions array\n\t\t\tthis.openAccordions = this.openAccordions.filter(\n\t\t\t\t( item ) => item.button !== button\n\t\t\t);\n\n\t\t\t// Close any nested accordions\n\t\t\tconst nestedAccordions = submenu.querySelectorAll(\n\t\t\t\t'.priority-nav-accordion-toggle[aria-expanded=\"true\"]'\n\t\t\t);\n\t\t\tnestedAccordions.forEach( ( nestedButton ) => {\n\t\t\t\tconst nestedSubmenuId =\n\t\t\t\t\tnestedButton.getAttribute( 'aria-controls' );\n\t\t\t\t// Use scoped lookup within this instance's dropdown to avoid cross-instance collisions\n\t\t\t\tconst nestedSubmenu = this.dropdown.querySelector(\n\t\t\t\t\t`#${ nestedSubmenuId }`\n\t\t\t\t);\n\t\t\t\tif ( nestedSubmenu ) {\n\t\t\t\t\tnestedButton.setAttribute( 'aria-expanded', 'false' );\n\t\t\t\t\tnestedSubmenu.style.setProperty(\n\t\t\t\t\t\t'display',\n\t\t\t\t\t\t'none',\n\t\t\t\t\t\t'important'\n\t\t\t\t\t);\n\t\t\t\t\tnestedSubmenu.classList.remove( 'is-open' );\n\t\t\t\t\tnestedSubmenu.setAttribute( 'aria-hidden', 'true' );\n\t\t\t\t}\n\t\t\t} );\n\t\t} else {\n\t\t\t// Open this accordion\n\t\t\tbutton.setAttribute( 'aria-expanded', 'true' );\n\t\t\t// Force display block with !important via style\n\t\t\tsubmenu.style.setProperty( 'display', 'block', 'important' );\n\t\t\tsubmenu.style.setProperty( 'opacity', '1', 'important' );\n\t\t\tsubmenu.style.setProperty( 'visibility', 'visible', 'important' );\n\t\t\tsubmenu.style.setProperty( 'position', 'static', 'important' );\n\t\t\tsubmenu.classList.add( 'is-open' );\n\t\t\tsubmenu.setAttribute( 'aria-hidden', 'false' );\n\n\t\t\t// Add to open accordions array\n\t\t\tthis.openAccordions.push( { button, submenu } );\n\t\t}\n\t}\n\n\tcloseAllAccordions() {\n\t\tthis.openAccordions.forEach( ( { button, submenu } ) => {\n\t\t\tbutton.setAttribute( 'aria-expanded', 'false' );\n\t\t\tsubmenu.style.setProperty( 'display', 'none', 'important' );\n\t\t\tsubmenu.classList.remove( 'is-open' );\n\t\t\tsubmenu.setAttribute( 'aria-hidden', 'true' );\n\t\t} );\n\t\tthis.openAccordions = [];\n\t}\n\n\t/**\n\t * Cleanup observers and timeouts\n\t */\n\tdestroy() {\n\t\tif ( this.mutationObserver ) {\n\t\t\tthis.mutationObserver.disconnect();\n\t\t\tthis.mutationObserver = null;\n\t\t}\n\n\t\tif ( this.retryTimeout ) {\n\t\t\tclearTimeout( this.retryTimeout );\n\t\t\tthis.retryTimeout = null;\n\t\t}\n\t}\n}\n\n// Initialize on DOM ready\ndocument.addEventListener( 'DOMContentLoaded', () => {\n\t// Support both wrapper mode and direct mode\n\t// Wrapper mode: [data-priority-nav] containing .wp-block-navigation\n\t// Direct mode: .wp-block-navigation[data-priority-nav]\n\tconst wrapperElements = document.querySelectorAll(\n\t\t'[data-priority-nav]:not(.wp-block-navigation)'\n\t);\n\tconst directNavElements = document.querySelectorAll(\n\t\t'.wp-block-navigation[data-priority-nav]'\n\t);\n\n\t// Initialize wrapper mode (backward compatibility)\n\twrapperElements.forEach( ( element ) => new PriorityNav( element ) );\n\n\t// Initialize direct mode (new variation approach)\n\tdirectNavElements.forEach( ( element ) => new PriorityNav( element ) );\n} );\n"],"names":["PriorityNav","instanceCounter","constructor","element","instanceId","classList","contains","hasAttribute","nav","wrapper","querySelector","list","moreLabel","getAttribute","moreIcon","openSubmenusOnClickAttr","attributes","i","length","attr","name","toLowerCase","includes","value","firstItem","openSubmenusOnClick","createMoreButton","items","Array","from","children","itemWidths","isOpen","isCalculating","openAccordions","submenuCounter","responsiveContainer","mutationObserver","retryTimeout","isEnabled","init","moreContainer","document","createElement","className","moreButton","type","setAttribute","iconMap","dots","chevron","plus","menu","innerHTML","dropdown","appendChild","parentNode","style","display","setupEventListeners","setupResponsiveObserver","isInHamburgerMode","disablePriorityNav","enablePriorityNav","resizeObserver","ResizeObserver","wasEnabled","inHamburger","requestAnimationFrame","checkOverflow","observe","containerStyles","window","getComputedStyle","isHidden","visibility","listStyles","listRect","getBoundingClientRect","width","isMeasurable","styles","rect","height","forEach","item","closeDropdown","scheduleRetry","needsRecache","some","cacheItemWidths","maxAttempts","clearTimeout","attempts","tryEnable","setTimeout","MutationObserver","mutations","shouldCheck","mutation","attributeName","attributeFilter","attributeOldValue","offsetHeight","map","addEventListener","e","preventDefault","stopPropagation","toggleDropdown","target","key","closeAllAccordions","toggle","closest","submenuId","submenu","toggleAccordionItem","navRect","navStyles","padding","parseFloat","paddingLeft","paddingRight","gap","availableWidth","moreButtonWidth","visibleCount","totalWidth","itemWidth","gapWidth","usedWidth","moreButtonGap","itemTotalWidth","wouldFit","hasHiddenItems","itemData","extractNavItemData","accordionHTML","buildAccordionHTML","container","openDropdown","add","remove","data","text","url","hasSubmenu","submenuContainer","linkElement","clone","cloneNode","cloneSubmenu","textContent","trim","childItems","querySelectorAll","childItem","push","label","linkClone","allChildren","child","textNodes","childNodes","filter","node","nodeType","Node","TEXT_NODE","t","join","childTexts","childLink","childText","replace","level","html","escapeHtml","div","button","isExpanded","setProperty","nestedAccordions","nestedButton","nestedSubmenuId","nestedSubmenu","destroy","disconnect","wrapperElements","directNavElements"],"ignoreList":[],"sourceRoot":""} \ No newline at end of file diff --git a/classes/class-enqueues.php b/classes/class-enqueues.php index de32f75..e282ac9 100644 --- a/classes/class-enqueues.php +++ b/classes/class-enqueues.php @@ -54,6 +54,7 @@ public function init() { */ public function enqueue_editor_assets(): void { $asset_meta = $this->build_dir->get_asset_meta( 'index.js' ); + $style_path = $this->build_dir->get_path( 'index.css' ); if ( ! $asset_meta ) { return; @@ -66,6 +67,15 @@ public function enqueue_editor_assets(): void { $asset_meta['version'], true ); + + if ( file_exists( $style_path ) ) { + wp_enqueue_style( + 'priority-nav-editor-style', + $this->build_dir->get_url( 'index.css' ), + array(), + $asset_meta['version'] + ); + } } /** diff --git a/priority-nav.php b/priority-plus-nav.php similarity index 96% rename from priority-nav.php rename to priority-plus-nav.php index 697495d..8d15698 100755 --- a/priority-nav.php +++ b/priority-plus-nav.php @@ -1,6 +1,6 @@ { priorityNavMoreIcon, } = attributes; - // Only show controls if Priority Nav is enabled + // Only show controls and wrap if Priority Nav is enabled if ( ! priorityNavEnabled ) { return ; } return ( <> - +
    + +
    Date: Mon, 22 Dec 2025 17:35:14 -0500 Subject: [PATCH 2/3] refactored structure --- .stylelintignore | 5 ++ .stylelintrc.json | 10 +++ build/block.json | 31 ------- build/blocks-manifest.php | 35 -------- build/index.js | 1 - build/ppn-editor-rtl.css | 1 + .../{index.asset.php => ppn-editor.asset.php} | 2 +- build/ppn-editor.css | 1 + build/ppn-editor.js | 1 + build/priority-plus-nav.asset.php | 1 + build/priority-plus-nav.js | 1 + build/style-index-rtl.css | 1 - build/style-index.css | 1 - build/style-priority-plus-nav-rtl.css | 1 + build/style-priority-plus-nav.css | 1 + build/view.asset.php | 1 - build/view.js | 1 - classes/class-enqueues.php | 63 +++++++-------- package-lock.json | 81 +++++++++---------- package.json | 15 ++-- src/block.json | 27 ------- src/index.js | 2 - src/ppn-editor.js | 6 ++ src/{view.js => priority-plus-nav.js} | 50 ++++++------ src/{ => styles}/_variables.scss | 2 +- src/{ => styles}/editor.scss | 13 +-- src/{ => styles}/style.scss | 5 +- src/variation/block.js | 65 +++++++++++++++ src/{extend.js => variation/controls.js} | 70 ++-------------- webpack.config.js | 15 ++++ 30 files changed, 223 insertions(+), 286 deletions(-) create mode 100644 .stylelintignore create mode 100644 .stylelintrc.json delete mode 100644 build/block.json delete mode 100644 build/blocks-manifest.php delete mode 100644 build/index.js create mode 100644 build/ppn-editor-rtl.css rename build/{index.asset.php => ppn-editor.asset.php} (62%) create mode 100644 build/ppn-editor.css create mode 100644 build/ppn-editor.js create mode 100644 build/priority-plus-nav.asset.php create mode 100644 build/priority-plus-nav.js delete mode 100644 build/style-index-rtl.css delete mode 100644 build/style-index.css create mode 100644 build/style-priority-plus-nav-rtl.css create mode 100644 build/style-priority-plus-nav.css delete mode 100644 build/view.asset.php delete mode 100644 build/view.js delete mode 100644 src/block.json delete mode 100755 src/index.js create mode 100755 src/ppn-editor.js rename src/{view.js => priority-plus-nav.js} (95%) rename src/{ => styles}/_variables.scss (99%) rename src/{ => styles}/editor.scss (72%) rename src/{ => styles}/style.scss (98%) create mode 100644 src/variation/block.js rename src/{extend.js => variation/controls.js} (58%) create mode 100644 webpack.config.js diff --git a/.stylelintignore b/.stylelintignore new file mode 100644 index 0000000..3e90af5 --- /dev/null +++ b/.stylelintignore @@ -0,0 +1,5 @@ +build/ +node_modules/ +vendor/ +*.min.css +*.min.scss \ No newline at end of file diff --git a/.stylelintrc.json b/.stylelintrc.json new file mode 100644 index 0000000..aec83c0 --- /dev/null +++ b/.stylelintrc.json @@ -0,0 +1,10 @@ +{ + "extends": ["@wordpress/stylelint-config/scss"], + "rules": { + "at-rule-empty-line-before": null, + "at-rule-no-unknown": null, + "rule-empty-line-before": null, + "selector-class-pattern": null, + "scss/at-rule-no-unknown": true + } +} diff --git a/build/block.json b/build/block.json deleted file mode 100644 index a36f3f9..0000000 --- a/build/block.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "$schema": "https://schemas.wp.org/trunk/block.json", - "apiVersion": 3, - "name": "lumen/priority-nav", - "version": "0.1.0", - "title": "Priority+ Navigation", - "category": "theme", - "icon": "menu-alt", - "description": "A responsive navigation wrapper that implements the Priority+ pattern, automatically moving items to a More dropdown.", - "keywords": [ - "navigation", - "menu", - "priority", - "responsive" - ], - "attributes": { - "moreLabel": { - "type": "string", - "default": "More" - }, - "moreIcon": { - "type": "string", - "default": "dots" - } - }, - "editorScript": "file:./index.js", - "editorStyle": "file:./index.css", - "style": "file:./style-index.css", - "viewScript": "file:./view.js", - "textdomain": "priority-nav" -} \ No newline at end of file diff --git a/build/blocks-manifest.php b/build/blocks-manifest.php deleted file mode 100644 index 3948506..0000000 --- a/build/blocks-manifest.php +++ /dev/null @@ -1,35 +0,0 @@ - array( - '$schema' => 'https://schemas.wp.org/trunk/block.json', - 'apiVersion' => 3, - 'name' => 'lumen/priority-nav', - 'version' => '0.1.0', - 'title' => 'Priority+ Navigation', - 'category' => 'theme', - 'icon' => 'menu-alt', - 'description' => 'A responsive navigation wrapper that implements the Priority+ pattern, automatically moving items to a More dropdown.', - 'keywords' => array( - 'navigation', - 'menu', - 'priority', - 'responsive' - ), - 'attributes' => array( - 'moreLabel' => array( - 'type' => 'string', - 'default' => 'More' - ), - 'moreIcon' => array( - 'type' => 'string', - 'default' => 'dots' - ) - ), - 'editorScript' => 'file:./index.js', - 'editorStyle' => 'file:./index.css', - 'style' => 'file:./style-index.css', - 'viewScript' => 'file:./view.js', - 'textdomain' => 'priority-nav' - ) -); diff --git a/build/index.js b/build/index.js deleted file mode 100644 index fab8d32..0000000 --- a/build/index.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{"use strict";var r,o={698(){const r=window.wp.i18n,o=window.wp.hooks,e=window.wp.blockEditor,i=window.wp.components,t=window.wp.compose,n=window.wp.blocks,a=window.wp.primitives,l=window.ReactJSXRuntime;var v=(0,l.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,l.jsx)(a.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M7.404 16.596a6.5 6.5 0 1 0 9.192-9.192 6.5 6.5 0 0 0-9.192 9.192ZM6.344 6.343a8 8 0 1 0 11.313 11.314A8 8 0 0 0 6.343 6.343Zm4.906 9.407v-3h-3v-1.5h3v-3h1.5v3h3v1.5h-3v3h-1.5Z"})});(0,o.addFilter)("blocks.registerBlockType","priority-nav/extend-core-navigation",(r,o)=>"core/navigation"!==o?r:{...r,attributes:{...r.attributes,priorityNavEnabled:{type:"boolean",default:!1},priorityNavMoreLabel:{type:"string",default:"Browse"},priorityNavMoreIcon:{type:"string",default:"none"}}});const s=(0,t.createHigherOrderComponent)(o=>t=>{const{name:n,attributes:a,setAttributes:v}=t;if("core/navigation"!==n)return(0,l.jsx)(o,{...t});const{priorityNavEnabled:s,priorityNavMoreLabel:p,priorityNavMoreIcon:c}=a;return s?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"priority-nav-editor-wrapper",children:(0,l.jsx)(o,{...t})}),(0,l.jsx)(e.InspectorControls,{children:(0,l.jsxs)(i.PanelBody,{title:(0,r.__)("Priority+ Settings","priority-nav"),children:[(0,l.jsx)(i.TextControl,{label:(0,r.__)("More Button Label","priority-nav"),value:p,onChange:r=>v({priorityNavMoreLabel:r}),help:(0,r.__)('Text displayed on the "More" button',"priority-nav")}),(0,l.jsx)(i.SelectControl,{label:(0,r.__)("More Button Icon","priority-nav"),value:c,options:[{label:(0,r.__)("None","priority-nav"),value:"none"},{label:(0,r.__)("Chevron Down (▼)","priority-nav"),value:"chevron"},{label:(0,r.__)("Plus (+)","priority-nav"),value:"plus"},{label:(0,r.__)("Menu (≡)","priority-nav"),value:"menu"}],onChange:r=>v({priorityNavMoreIcon:r})})]})})]}):(0,l.jsx)(o,{...t})},"withPriorityNavControls");(0,o.addFilter)("editor.BlockEdit","priority-nav/add-priority-nav-controls",s),(0,n.registerBlockVariation)("core/navigation",{name:"lumen-priority-nav",title:(0,r.__)("Priority+ Nav","priority-nav"),description:(0,r.__)('A responsive navigation that automatically moves overflow items to a "More" dropdown.',"priority-nav"),icon:v,attributes:{priorityNavEnabled:!0,priorityNavMoreLabel:"Browse",priorityNavMoreIcon:"none"},scope:["inserter","block"],isActive:r=>!!r.priorityNavEnabled})}},e={};function i(r){var t=e[r];if(void 0!==t)return t.exports;var n=e[r]={exports:{}};return o[r](n,n.exports,i),n.exports}i.m=o,r=[],i.O=(o,e,t,n)=>{if(!e){var a=1/0;for(p=0;p=n)&&Object.keys(i.O).every(r=>i.O[r](e[v]))?e.splice(v--,1):(l=!1,n0&&r[p-1][2]>n;p--)r[p]=r[p-1];r[p]=[e,t,n]},i.o=(r,o)=>Object.prototype.hasOwnProperty.call(r,o),(()=>{var r={57:0,350:0};i.O.j=o=>0===r[o];var o=(o,e)=>{var t,n,[a,l,v]=e,s=0;if(a.some(o=>0!==r[o])){for(t in l)i.o(l,t)&&(i.m[t]=l[t]);if(v)var p=v(i)}for(o&&o(e);si(698));t=i.O(t)})(); \ No newline at end of file diff --git a/build/ppn-editor-rtl.css b/build/ppn-editor-rtl.css new file mode 100644 index 0000000..75a8f61 --- /dev/null +++ b/build/ppn-editor-rtl.css @@ -0,0 +1 @@ +:root{--priority-nav--background:transparent;--priority-nav--background-hover:rgba(0,0,0,.05);--priority-nav--border:none;--priority-nav--border-radius:4px;--priority-nav--color:inherit;--priority-nav--font-family:inherit;--priority-nav--font-size:inherit;--priority-nav--padding:0.5rem 0.75rem}.editor-styles-wrapper .priority-nav-editor-wrapper{align-items:center;display:flex;flex-wrap:nowrap;width:100%} diff --git a/build/index.asset.php b/build/ppn-editor.asset.php similarity index 62% rename from build/index.asset.php rename to build/ppn-editor.asset.php index 9c575ae..1464eff 100644 --- a/build/index.asset.php +++ b/build/ppn-editor.asset.php @@ -1 +1 @@ - array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-hooks', 'wp-i18n', 'wp-primitives'), 'version' => 'f70bf9cfc5a50eb84d64'); + array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-hooks', 'wp-i18n', 'wp-primitives'), 'version' => '24c49a6e8865864b66e4'); diff --git a/build/ppn-editor.css b/build/ppn-editor.css new file mode 100644 index 0000000..75a8f61 --- /dev/null +++ b/build/ppn-editor.css @@ -0,0 +1 @@ +:root{--priority-nav--background:transparent;--priority-nav--background-hover:rgba(0,0,0,.05);--priority-nav--border:none;--priority-nav--border-radius:4px;--priority-nav--color:inherit;--priority-nav--font-family:inherit;--priority-nav--font-size:inherit;--priority-nav--padding:0.5rem 0.75rem}.editor-styles-wrapper .priority-nav-editor-wrapper{align-items:center;display:flex;flex-wrap:nowrap;width:100%} diff --git a/build/ppn-editor.js b/build/ppn-editor.js new file mode 100644 index 0000000..9320099 --- /dev/null +++ b/build/ppn-editor.js @@ -0,0 +1 @@ +(()=>{"use strict";const o=window.wp.i18n,e=window.wp.blocks,r=window.wp.primitives,i=window.ReactJSXRuntime;var t=(0,i.jsx)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(r.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M7.404 16.596a6.5 6.5 0 1 0 9.192-9.192 6.5 6.5 0 0 0-9.192 9.192ZM6.344 6.343a8 8 0 1 0 11.313 11.314A8 8 0 0 0 6.343 6.343Zm4.906 9.407v-3h-3v-1.5h3v-3h1.5v3h3v1.5h-3v3h-1.5Z"})});const n=window.wp.hooks;(0,e.registerBlockVariation)("core/navigation",{name:"priority-nav",title:(0,o.__)("Priority+ Nav","priority-nav"),description:(0,o.__)('A responsive navigation that automatically moves overflow items to a "More" dropdown.',"priority-nav"),icon:t,scope:["inserter","transform"],attributes:{className:"is-style-priority-nav",overlayMenu:"never",priorityNavEnabled:!0,priorityNavMoreLabel:"Browse",priorityNavMoreIcon:"none"},isActive:(o,e)=>o.className?.includes(e.className)}),(0,n.addFilter)("blocks.registerBlockType","priority-nav/extend-core-navigation",(o,e)=>"core/navigation"!==e?o:{...o,attributes:{...o.attributes,priorityNavEnabled:{type:"boolean",default:!1},priorityNavMoreLabel:{type:"string",default:"Browse"},priorityNavMoreIcon:{type:"string",default:"none"}}});const a=window.wp.blockEditor,l=window.wp.components,s=(0,window.wp.compose.createHigherOrderComponent)(e=>r=>{const{name:t,attributes:n,setAttributes:s}=r;if("core/navigation"!==t)return(0,i.jsx)(e,{...r});const{priorityNavEnabled:v,priorityNavMoreLabel:p,priorityNavMoreIcon:c}=n;return(0,i.jsxs)(i.Fragment,{children:[v&&(0,i.jsx)("div",{className:"priority-nav-editor-wrapper",children:(0,i.jsx)(e,{...r})}),!v&&(0,i.jsx)(e,{...r}),(0,i.jsx)(a.InspectorControls,{children:(0,i.jsxs)(l.PanelBody,{title:(0,o.__)("Priority+ Settings","priority-nav"),children:[(0,i.jsx)(l.TextControl,{label:(0,o.__)("More Button Label","priority-nav"),value:p,onChange:o=>s({priorityNavMoreLabel:o}),help:(0,o.__)('Text displayed on the "More" button',"priority-nav")}),(0,i.jsx)(l.SelectControl,{label:(0,o.__)("More Button Icon","priority-nav"),value:c,options:[{label:(0,o.__)("None","priority-nav"),value:"none"},{label:(0,o.__)("Chevron Down (▼)","priority-nav"),value:"chevron"},{label:(0,o.__)("Plus (+)","priority-nav"),value:"plus"},{label:(0,o.__)("Menu (≡)","priority-nav"),value:"menu"}],onChange:o=>s({priorityNavMoreIcon:o})})]})})]})},"withPriorityNavControls");(0,n.addFilter)("editor.BlockEdit","priority-nav/add-priority-nav-controls",s)})(); \ No newline at end of file diff --git a/build/priority-plus-nav.asset.php b/build/priority-plus-nav.asset.php new file mode 100644 index 0000000..8d819ce --- /dev/null +++ b/build/priority-plus-nav.asset.php @@ -0,0 +1 @@ + array(), 'version' => '51fcd302839f0a1322ce'); diff --git a/build/priority-plus-nav.js b/build/priority-plus-nav.js new file mode 100644 index 0000000..a34549d --- /dev/null +++ b/build/priority-plus-nav.js @@ -0,0 +1 @@ +(()=>{"use strict";var t,e={103(){class t{static instanceCounter=0;static DEFAULT_MORE_LABEL="Browse";static DEFAULT_MORE_ICON="none";static DEFAULT_GAP=8;static RETRY_INTERVAL=100;static MAX_RETRY_ATTEMPTS=20;constructor(e){"true"!==e.dataset.priorityNavInitialized&&(this.instanceId="priority-nav-"+t.instanceCounter++,e.classList.contains("wp-block-navigation")&&e.classList.contains("is-style-priority-nav")&&(e.dataset.priorityNavInitialized="true",this.nav=e,this.wrapper=e,this.nav&&(this.list=this.nav.querySelector(".wp-block-navigation__container"),this.moreLabel=this.nav.getAttribute("data-more-label")||t.DEFAULT_MORE_LABEL,this.moreIcon=this.nav.getAttribute("data-more-icon")||t.DEFAULT_MORE_ICON,this.openSubmenusOnClick=this.detectOpenSubmenusOnClick(),this.list&&(this.createMoreButton(),this.items=Array.from(this.list.children),this.itemWidths=[],this.isOpen=!1,this.isCalculating=!1,this.openAccordions=[],this.submenuCounter=0,this.responsiveContainer=this.nav.querySelector(".wp-block-navigation__responsive-container"),this.mutationObserver=null,this.retryTimeout=null,this.isEnabled=!0,this.moreButtonWidth=null,this.init()))))}detectOpenSubmenusOnClick(){let t=null;if(this.nav.attributes)for(let e=0;e0&&i.height>0}getElementWidth(t){return this.isElementVisible(t)?t.getBoundingClientRect().width:0}createMoreButton(){this.moreContainer=document.createElement("div"),this.moreContainer.className="priority-nav-more",this.moreButton=document.createElement("button"),this.moreButton.type="button",this.moreButton.className="priority-nav-more-button wp-block-navigation-item",this.moreButton.setAttribute("aria-expanded","false"),this.moreButton.setAttribute("aria-haspopup","true"),this.moreButton.setAttribute("aria-label",this.moreLabel);const t={chevron:"▼",plus:"+",menu:"≡"},e=t[this.moreIcon]?`${t[this.moreIcon]}`:"";this.moreButton.innerHTML=`\n\t\t\t${this.moreLabel}\n\t\t\t${e}\n\t\t`,this.dropdown=document.createElement("ul"),this.dropdown.className="priority-nav-dropdown wp-block-navigation__submenu-container",this.dropdown.setAttribute("role","menu"),this.moreContainer.appendChild(this.moreButton),this.moreContainer.appendChild(this.dropdown),this.list.parentNode.appendChild(this.moreContainer),this.moreContainer.style.display="none"}init(){this.wrapper&&document.body.contains(this.wrapper)&&(this.setupEventListeners(),this.setupResponsiveObserver(),this.isInHamburgerMode()?this.disablePriorityNav():this.enablePriorityNav(),"undefined"!=typeof ResizeObserver&&(this.resizeObserver=new ResizeObserver(()=>{if(document.body.contains(this.wrapper)&&!this.isCalculating){const t=this.isEnabled,e=this.isInHamburgerMode();e&&t?this.disablePriorityNav():e||t?!e&&t&&requestAnimationFrame(()=>this.checkOverflow()):this.enablePriorityNav()}}),this.resizeObserver.observe(this.wrapper)))}isInHamburgerMode(){return!(!this.responsiveContainer||this.isElementVisible(this.responsiveContainer)&&"true"!==this.responsiveContainer.getAttribute("aria-hidden"))||!(!this.list||this.isElementVisible(this.list))}isMeasurable(){return this.isElementVisible(this.list)}disablePriorityNav(){this.items&&Array.isArray(this.items)&&(this.isEnabled=!1,this.items.forEach(t=>{t&&t.style&&(t.style.display="")}),this.moreContainer&&this.moreContainer.style&&(this.moreContainer.style.display="none"),this.closeDropdown())}enablePriorityNav(){this.isEnabled=!0,this.isMeasurable()?((0===this.itemWidths.length||this.itemWidths.some(t=>0===t))&&this.cacheItemWidths(),requestAnimationFrame(()=>{this.checkOverflow()})):this.scheduleRetry()}scheduleRetry(e=t.MAX_RETRY_ATTEMPTS){this.retryTimeout&&clearTimeout(this.retryTimeout);let i=0;const s=()=>{i++,this.isMeasurable()&&!this.isInHamburgerMode()?(this.enablePriorityNav(),this.retryTimeout=null):this.retryTimeout=i{if(!document.body.contains(this.nav))return;let e=!1;if(t.forEach(t=>{"attributes"!==t.type||"aria-hidden"!==t.attributeName&&"class"!==t.attributeName||(e=!0)}),e){const t=this.isInHamburgerMode();t&&this.isEnabled?this.disablePriorityNav():t||this.isEnabled||this.enablePriorityNav()}}),this.mutationObserver.observe(this.responsiveContainer,{attributes:!0,attributeFilter:["aria-hidden","class"]}),this.list&&document.body.contains(this.list)&&this.mutationObserver.observe(this.list,{attributes:!0,attributeFilter:["style","class"],attributeOldValue:!1}))}hasValidWidthCache(){return this.itemWidths.length===this.items.length&&!this.itemWidths.some(t=>0===t)}cacheItemWidths(){this.isMeasurable()&&(this.items.forEach(t=>{t.style.display=""}),this.list.offsetHeight,this.itemWidths=this.items.map(t=>{const e=this.getElementWidth(t);return e>0?e:0}),this.itemWidths.some(t=>0===t)&&this.scheduleRetry())}cacheMoreButtonWidth(){if(null!==this.moreButtonWidth)return this.moreButtonWidth;const t="none"===this.moreContainer.style.display;return t&&(this.moreContainer.style.display=""),this.moreButton.offsetHeight,this.moreButtonWidth=this.getElementWidth(this.moreButton),t&&(this.moreContainer.style.display="none"),this.moreButtonWidth}setupEventListeners(){this.moreButtonClickHandler=t=>{t.preventDefault(),t.stopPropagation(),this.toggleDropdown()},this.moreButton.addEventListener("click",this.moreButtonClickHandler),this.documentClickHandler=t=>{this.moreContainer&&!this.moreContainer.contains(t.target)&&this.isOpen&&this.closeDropdown()},document.addEventListener("click",this.documentClickHandler,!0),this.documentKeydownHandler=t=>{"Escape"===t.key&&this.isOpen&&(this.openAccordions.length>0?(this.closeAllAccordions(),t.preventDefault()):this.closeDropdown())},document.addEventListener("keydown",this.documentKeydownHandler),this.dropdownClickHandler=t=>{const e=t.target.closest(".priority-nav-accordion-toggle");if(e){t.preventDefault(),t.stopPropagation();const i=e.getAttribute("aria-controls"),s=this.dropdown.querySelector(`#${i}`);s&&this.toggleAccordionItem(e,s)}},this.dropdown.addEventListener("click",this.dropdownClickHandler)}calculateAvailableWidth(){const t=this.nav.getBoundingClientRect(),e=window.getComputedStyle(this.nav),i=parseFloat(e.paddingLeft)+parseFloat(e.paddingRight),s=t.width>0?t.width:this.getElementWidth(this.wrapper);return s>0?s-i:0}getGap(){const e=window.getComputedStyle(this.list),i=window.getComputedStyle(this.nav);return parseFloat(e.gap)||parseFloat(i.gap)||t.DEFAULT_GAP}calculateVisibleItems(t,e,i){let s=0;for(let t=0;t0?i:0)+this.itemWidths[t];if(s<=t)return this.items.length;let n=0,r=0;for(let s=0;s0?i:0)+this.itemWidths[s];if(!(n+o+i+e<=t)&&0!==s)break;n+=o,r++}return r}buildDropdownFromOverflow(t){this.dropdown.innerHTML="",this.submenuCounter=0;for(let e=t;e=t)return this.items.forEach(t=>t.style.display="none"),this.moreContainer.style.display="",void(this.isCalculating=!1);const i=this.getGap(),s=this.calculateVisibleItems(t,e,i);if(s===this.items.length)this.items.forEach(t=>t.style.display=""),this.moreContainer.style.display="none",this.closeDropdown();else{this.moreContainer.style.display="none";for(let t=s;tt.remove());let s=i.textContent.trim();if(!s){const e=Array.from(t.childNodes).filter(t=>t.nodeType===Node.TEXT_NODE);e.length>0&&(s=e.map(t=>t.textContent.trim()).filter(t=>t).join(" "))}return s}removeChildTextFromParent(t,e){if(!t||!e)return t;const i=[];if(e.querySelectorAll("li a").forEach(e=>{const s=e.textContent.trim();s&&t.includes(s)&&i.push(s)}),i.length>0){let e=t;return i.forEach(t=>{e=e.replace(t,"").trim()}),e}return t}extractNavItemData(t){const e={text:"",url:"#",hasSubmenu:!1,children:[]},i=t.querySelector(":scope > .wp-block-navigation__submenu-container");let s=t.querySelector(":scope > a");if(s||(s=t.querySelector(":scope > .wp-block-navigation-item__content a")),!s){if(i){const i=t.cloneNode(!0),s=i.querySelector(".wp-block-navigation__submenu-container");s&&s.remove(),e.text=i.textContent.trim()}else e.text=t.textContent.trim();return i&&(e.hasSubmenu=!0,i.querySelectorAll(":scope > li").forEach(t=>{e.children.push(this.extractNavItemData(t))})),e}return e.text=this.extractLinkText(s),i&&e.text&&(e.text=this.removeChildTextFromParent(e.text,i)),e.url=s.getAttribute("href")||"#",i&&(e.hasSubmenu=!0,i.querySelectorAll(":scope > li").forEach(t=>{e.children.push(this.extractNavItemData(t))})),e}buildAccordionHTML(t,e){const i=`${this.instanceId}-submenu-${this.submenuCounter++}`;let s="";return t.hasSubmenu?(s=this.openSubmenusOnClick?`\n\t\t\t\t\t\n\t\t\t\t\t