@paroicms/public-menu-plugin 0.6.1 → 0.7.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,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const node_path_1 = require("node:path");
|
|
4
3
|
const data_formatters_lib_1 = require("@paroi/data-formatters-lib");
|
|
5
4
|
const public_server_lib_1 = require("@paroicms/public-server-lib");
|
|
5
|
+
const node_path_1 = require("node:path");
|
|
6
6
|
const projectDir = (0, node_path_1.dirname)(__dirname);
|
|
7
7
|
const packageDir = (0, node_path_1.dirname)(projectDir);
|
|
8
8
|
const version = (0, data_formatters_lib_1.strVal)(require((0, node_path_1.join)(packageDir, "package.json")).version);
|
|
@@ -11,7 +11,7 @@ const plugin = {
|
|
|
11
11
|
slug: "public-menu",
|
|
12
12
|
async siteInit(service) {
|
|
13
13
|
service.setPublicAssetsDirectory((0, node_path_1.join)(packageDir, "public-front", "dist"));
|
|
14
|
-
service.addHeadTag(`<link rel="stylesheet" href="${(0, public_server_lib_1.escapeHtml)(`${service.pluginAssetsUrl}/
|
|
14
|
+
service.addHeadTag(`<link rel="stylesheet" href="${(0, public_server_lib_1.escapeHtml)(`${service.pluginAssetsUrl}/public-front-plugin.css`)}">`, `<script type="module" src="${(0, public_server_lib_1.escapeHtml)(`${service.pluginAssetsUrl}/public-front-plugin.mjs`)}"></script>`);
|
|
15
15
|
},
|
|
16
16
|
};
|
|
17
17
|
exports.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.7.0",
|
|
4
4
|
"description": "Public menu plugin for ParoiCMS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"paroicms",
|
|
@@ -34,9 +34,8 @@
|
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@paroicms/public-anywhere-lib": "0.14.0",
|
|
36
36
|
"@paroicms/public-server-lib": "0.22.1",
|
|
37
|
+
"@paroicms/tiny-modal": "0.1.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",
|
|
@@ -0,0 +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)}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.modal{font-family:-apple-system,BlinkMacSystemFont,avenir next,avenir,helvetica neue,helvetica,ubuntu,roboto,noto,segoe ui,arial,sans-serif}.modal__overlay{background:#0009;inset:0;position:fixed;z-index:1001}.modal__container{background-color:#fff;border-radius:4px;box-sizing:border-box;max-height:100vh;max-width:500px;overflow-y:auto}.modal__header{align-items:center;display:flex;justify-content:space-between}.modal__title{box-sizing:border-box;color:#00449e;font-size:1.25rem;font-weight:600;line-height:1.25;margin-bottom:0;margin-top:0}.modal__close{background:transparent;border:0}.modal__header .modal__close:before{content:"✕"}.modal__content{color:#000c;line-height:1.5;width:100%}.modal__btn{backface-visibility:hidden;background-color:#e6e6e6;border-radius:.25rem;border-style:none;border-width:0;color:#000c;cursor:pointer;font-size:.875rem;line-height:1.15;margin:0;overflow:visible;padding:.5rem 1rem;text-transform:none;transform:translateZ(0);transition:transform .25s ease-out;will-change:transform}.modal__btn:focus,.modal__btn:hover{transform:scale(1.05)}.modal__btn-primary{background-color:#00449e;color:#fff}@keyframes mmfadeIn{0%{opacity:0}to{opacity:1}}@keyframes mmfadeOut{0%{opacity:1}to{opacity:0}}@keyframes mmslideIn{0%{transform:translateY(15%)}to{transform:translateY(0)}}@keyframes mmslideOut{0%{transform:translateY(0)}to{transform:translateY(-10%)}}.micromodal-slide{display:none}.micromodal-slide.is-open{display:block}.micromodal-slide[aria-hidden=false] .modal__overlay{animation:mmfadeIn .3s cubic-bezier(0,0,.2,1)}.micromodal-slide[aria-hidden=false] .modal__container{animation:mmslideIn .3s cubic-bezier(0,0,.2,1)}.micromodal-slide[aria-hidden=true] .modal__overlay{animation:mmfadeOut .3s cubic-bezier(0,0,.2,1)}.micromodal-slide[aria-hidden=true] .modal__container{animation:mmslideOut .3s cubic-bezier(0,0,.2,1)}.micromodal-slide .modal__container,.micromodal-slide .modal__overlay{will-change:transform}.MobileMenu{height:100%;padding:20px;position:relative;width:100%}.MobileMenu-closeBtn{display:block;font-size:32px;height:50px;position:absolute;right:10px;top:10px;width:50px}
|