@paroicms/public-menu-plugin 0.19.16 → 0.19.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/backend/dist/index.js
CHANGED
|
@@ -9,12 +9,16 @@ const plugin = {
|
|
|
9
9
|
async siteInit(service) {
|
|
10
10
|
service.setPublicAssetsDirectory(join(packageDir, "frontend", "dist"));
|
|
11
11
|
service.registerHeadTags(({ html }) => {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
const withMobileMenu = html.includes(`data-effect="paMobileMenu"`);
|
|
13
|
+
if (html.includes("data-activate-menu-items") || withMobileMenu) {
|
|
14
|
+
const tags = [
|
|
14
15
|
makeStylesheetLinkAsyncTag(`${service.pluginAssetsUrl}/public-menu-plugin.css`),
|
|
15
16
|
`<script type="module" src="${escapeHtml(`${service.pluginAssetsUrl}/public-menu-plugin.mjs`)}" async></script>`,
|
|
16
|
-
`<style>@media(max-width:992px){[data-mobile-menu-action="move"]{display:none}}</style>`,
|
|
17
17
|
];
|
|
18
|
+
if (withMobileMenu) {
|
|
19
|
+
tags.push(`<style>@media(max-width:992px){[data-mobile-menu-action="move"]{display:none}}@media(min-width:992px){[data-mobile-menu]{display:none}}</style>`);
|
|
20
|
+
}
|
|
21
|
+
return tags;
|
|
18
22
|
}
|
|
19
23
|
});
|
|
20
24
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.PaMobileMenu{width:
|
|
1
|
+
.PaMobileMenu{width:100%;height:100%}._paMobileMenu .TinyModal-closeButton{top:5px;right:5px}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{template as d,insert as u}from"https://cdn.jsdelivr.net/npm/solid-js@1.9.10/web/+esm";import r from"https://cdn.jsdelivr.net/npm/@paroicms/tiny-modal@0.8.
|
|
1
|
+
import{template as d,insert as u}from"https://cdn.jsdelivr.net/npm/solid-js@1.9.10/web/+esm";import r from"https://cdn.jsdelivr.net/npm/@paroicms/tiny-modal@0.8.2/+esm";function m(t){const n=t.dataset.activateMenuItems?.trim();if(!n)return;const{id:e,parents:a}=JSON.parse(n),i=new Set(a);i.add(e);const o=t.querySelectorAll("[data-menu-item-id]");for(const c of o){const l=c.dataset.menuItemId;l!==void 0&&i.has(l)&&c.classList.add("active")}}var p=d("<div class=PaMobileMenu>"),f=d('<button class=PaMobileMenuButton type=button><svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=currentColor width=35 height=35><title>BurgerIcon</title><path d="M4 18h16c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1 .45-1 1s.45 1 1 1zm0-5h16c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1 .45-1 1s.45 1 1 1zM3 7c0 .55.45 1 1 1h16c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1 .45-1 1z">');function M(t,n){if(!window.matchMedia("(max-width: 992px)").matches)return;const a=document.querySelector('[data-mobile-menu="button"]');if(!a)return;b(t);const i=(()=>{var l=p();return u(l,t),l})();t.style.display==="none"&&t.style.removeProperty("display");const o=f();a.appendChild(o);const c=r({openButton:o,dialogContent:i,modalClass:"_paMobileMenu",loadCss:!0});window.paMobileMenu=c}function b(t){const n=document.querySelectorAll("[data-mobile-menu-part]");for(const e of n){const a=e.dataset.mobileMenuPart,i=e.dataset.mobileMenuAction!=="move",o=t.querySelector(`[data-inject="${a}"]`);o&&(o.appendChild(i?e.cloneNode(!0):e),e.removeAttribute("data-mobile-menu-action"))}}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",s):s();function s(){document.documentElement.lang;const t=document.querySelectorAll("[data-effect='paMobileMenu']");for(const e of t)M(e);const n=document.querySelectorAll("[data-activate-menu-items]");for(const e of n)m(e)}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paroicms/public-menu-plugin",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.17",
|
|
4
4
|
"description": "Public menu plugin for ParoiCMS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"paroicms",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@paroicms/public-anywhere-lib": "0.41.3",
|
|
36
|
-
"@paroicms/public-server-lib": "0.
|
|
37
|
-
"@paroicms/tiny-modal": "0.8.
|
|
36
|
+
"@paroicms/public-server-lib": "0.51.0",
|
|
37
|
+
"@paroicms/tiny-modal": "0.8.2",
|
|
38
38
|
"@types/node": "~24.10.7",
|
|
39
39
|
"rimraf": "~6.1.2",
|
|
40
40
|
"typescript": "~5.9.3"
|