@paroicms/public-menu-plugin 0.6.2 → 0.8.0
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/plugin.js
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const version = (0, data_formatters_lib_1.strVal)(require((0, node_path_1.join)(packageDir, "package.json")).version);
|
|
1
|
+
import { strVal } from "@paroi/data-formatters-lib";
|
|
2
|
+
import { escapeHtml, resolveModuleDirectory, } from "@paroicms/public-server-lib";
|
|
3
|
+
import { readFileSync } from "node:fs";
|
|
4
|
+
import { dirname, join } from "node:path";
|
|
5
|
+
const projectDir = resolveModuleDirectory(import.meta.url, { parent: true });
|
|
6
|
+
const packageDir = dirname(projectDir);
|
|
7
|
+
const version = strVal(JSON.parse(readFileSync(join(packageDir, "package.json"), "utf-8")).version);
|
|
9
8
|
const plugin = {
|
|
10
9
|
version,
|
|
11
10
|
slug: "public-menu",
|
|
12
11
|
async siteInit(service) {
|
|
13
|
-
service.setPublicAssetsDirectory(
|
|
14
|
-
service.addHeadTag(`<link rel="stylesheet" href="${
|
|
12
|
+
service.setPublicAssetsDirectory(join(packageDir, "public-front", "dist"));
|
|
13
|
+
service.addHeadTag(`<link rel="stylesheet" href="${escapeHtml(`${service.pluginAssetsUrl}/public-front-plugin.css`)}">`, `<script type="module" src="${escapeHtml(`${service.pluginAssetsUrl}/public-front-plugin.mjs`)}"></script>`);
|
|
15
14
|
},
|
|
16
15
|
};
|
|
17
|
-
|
|
16
|
+
export default plugin;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paroicms/public-menu-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Public menu plugin for ParoiCMS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"paroicms",
|
|
@@ -32,11 +32,10 @@
|
|
|
32
32
|
"@paroicms/public-server-lib": "0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@paroicms/public-anywhere-lib": "0.
|
|
36
|
-
"@paroicms/public-server-lib": "0.
|
|
35
|
+
"@paroicms/public-anywhere-lib": "0.15.0",
|
|
36
|
+
"@paroicms/public-server-lib": "0.23.0",
|
|
37
|
+
"@paroicms/tiny-modal": "0.2.0",
|
|
37
38
|
"@types/node": "~22.10.7",
|
|
38
|
-
"@types/micromodal": "~0.3.5",
|
|
39
|
-
"micromodal": "~0.4.10",
|
|
40
39
|
"rimraf": "~6.0.1",
|
|
41
40
|
"sass": "~1.83.4",
|
|
42
41
|
"solid-devtools": "~0.33.0",
|
|
@@ -46,6 +45,7 @@
|
|
|
46
45
|
"vite-plugin-solid": "~2.11.0",
|
|
47
46
|
"terser": "~5.37.0"
|
|
48
47
|
},
|
|
48
|
+
"type": "module",
|
|
49
49
|
"main": "backend/dist/plugin.js",
|
|
50
50
|
"files": [
|
|
51
51
|
"backend/dist",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
@charset "UTF-8";.TinyModal{background:transparent;border:none;margin:0;max-width:none;padding:0}.TinyModal::backdrop{background-color:transparent}.TinyModal-closeBtn{align-items:center;background-color:#bbb;border-radius:50%;cursor:pointer;display:flex;font-size:30px;font-weight:700;height:40px;justify-content:center;line-height:1;position:absolute;right:50px;top:10px;width:40px;z-index:2}.TinyModal-closeBtn:before{content:"×"}.TinyModal-closeBtn:hover,.TinyModal-closeBtn:focus{background-color:#888}.HiddenForTinyModal{display:none!important}.MobileMenu{height:100vh;padding:20px;max-height:100vh;max-width:500px;width:100vw;background-color:#fff}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{insert as M,template as p}from"https://esm.sh/solid-js@1.9.4/web";function y(t){const c=t.dataset.activateMenuItems?.trim();if(!c)return;const{id:s,parents:n}=JSON.parse(c),e=new Set(n);e.add(s);const o=t.querySelectorAll("[data-menu-item-id]");for(const i of o){const l=i.dataset.menuItemId;l!==void 0&&e.has(l)&&i.classList.add("active")}}function h({openButton:t,dialogContent:c}){const s=t?typeof t=="string"?document.querySelector(t):t:void 0,n=typeof c=="string"?document.querySelector(c):c;if(!n)return;n instanceof HTMLTemplateElement||n.classList.remove("HiddenForTinyModal");const e=document.createElement("dialog");e.classList.add("TinyModal");const o=document.createElement("button");o.classList.add("TinyModal-closeBtn"),e.appendChild(o);const i=document.createElement("div");i.classList.add("TinyModal-wrapper"),i.appendChild(n instanceof HTMLTemplateElement?n.content.cloneNode(!0):n),e.appendChild(i),document.body.appendChild(e);const l=new Map;function d(a,r){l.has(a)||l.set(a,[]),l.get(a)?.push(r)}function u(a){l.has(a)&&l.get(a)?.forEach((r=>r()))}function m(){e.showModal(),document.body.style.overflow="hidden",u("open")}function f(){e.close()}return s?.addEventListener("click",m),o.addEventListener("click",f),e.addEventListener("close",(()=>{document.body.style.overflow="",u("close")})),{open:m,close:f,on:d}}var v=p("<div class=MobileMenu>"),b=p('<button class=MobileMenuBtn type=button><svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=currentColor data-testid=IconBurger width=35 height=35><title>IconBurger</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 g(t,c){const n=window.getComputedStyle(t).getPropertyValue("--siteAppMobileMenuMaxWidth");if(!window.matchMedia(`(max-width: ${n})`).matches)return;const o=document.querySelector('[data-mobile-menu="button"]');if(!o)return;E(t);const i=(()=>{var d=v();return M(d,t),d})();t.style.display==="none"&&t.style.removeProperty("display");const l=b();o.appendChild(l),h({openButton:l,dialogContent:i})}function E(t){const c=document.querySelectorAll("[data-mobile-menu-part]");for(const s of c){const n=s.dataset.mobileMenuPart,e=s.dataset.mobileMenuAction!=="move",o=t.querySelector(`[data-inject="${n}"]`);o&&o.appendChild(e?s.cloneNode(!0):s)}}document.addEventListener("DOMContentLoaded",(()=>{const t=document.documentElement.lang,c={mobileMenu:g},s=document.querySelectorAll("[data-effect]");for(const e of s){const o=e.dataset.effect;if(!o)continue;const i=c[o];i&&i(e,{language:t})}const n=document.querySelectorAll("[data-activate-menu-items]");for(const e of n)y(e)}));
|