plggmatic 0.5.0 → 0.5.2
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.
|
@@ -60,6 +60,8 @@ export declare const embedParam: SoftStr;
|
|
|
60
60
|
export declare const embeddedAttr: SoftStr;
|
|
61
61
|
/** The frame a column from another site is shown in. */
|
|
62
62
|
export declare const frameClass: SoftStr;
|
|
63
|
+
/** Set on a partner's column once its page has answered. */
|
|
64
|
+
export declare const frameReadyAttr: SoftStr;
|
|
63
65
|
/** The structure of a column from another site, and of
|
|
64
66
|
* a page while it is shown as one. */
|
|
65
67
|
export declare const frameCss: (p: SoftStr) => SoftStr;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"marker.d.ts","sourceRoot":"","sources":["../../../src/Navigate/model/marker.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,MAAM,EAEZ,MAAM,MAAM,CAAC;AACd,OAAO,EACL,KAAK,IAAI,EAGV,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,KAAK,KAAK,EAGX,MAAM,sCAAsC,CAAC;AAG9C;;;;;;;GAOG;AAEH,+CAA+C;AAC/C,eAAO,MAAM,SAAS,EAAE,OAAmC,CAAC;AAE5D;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,OAAoC,CAAC;AAE9D;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,EAAE,OAAkC,CAAC;AAE1D;;;;;GAKG;AACH,eAAO,MAAM,WAAW,EAAE,OAA6B,CAAC;AAExD,uDAAuD;AACvD,eAAO,MAAM,KAAK,GAAI,GAAG,SAChB,KAAK,YACF,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KACjC,IAAI,CAAC,GAAG,CACsC,CAAC;AAElD;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,GAAI,GAAG,SACzB,OAAO,QACR,MAAM,CAAC,OAAO,CAAC,SACd,KAAK,YACF,aAAa,CAA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ACjC,IAAI,CAAC,GAAG,CAgBR,CAAC;AAEJ;;;;;;;;;GASG;AACH,eAAO,MAAM,YAAY,EAAE,OAAiC,CAAC;AAC7D,eAAO,MAAM,aAAa,EAAE,OAAkC,CAAC;AAC/D,wDAAwD;AACxD,eAAO,MAAM,UAAU,EAAE,OAA8B,CAAC;AACxD;yCACyC;AACzC,eAAO,MAAM,YAAY,EAAE,OAAsC,CAAC;AAClE,wDAAwD;AACxD,eAAO,MAAM,UAAU,EAAE,OAA8B,CAAC;AAExD,4DAA4D;AAC5D,eAAO,MAAM,cAAc,EAAE,OAAyC,CAAC;AAEvE;sCACsC;AACtC,eAAO,MAAM,QAAQ,MAAO,OAAO,KAAG,OAKrC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigationScript.d.ts","sourceRoot":"","sources":["../../../src/Navigate/usecase/navigationScript.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"navigationScript.d.ts","sourceRoot":"","sources":["../../../src/Navigate/usecase/navigationScript.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,MAAM,CAAC;AA8DpC;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,EAAE,OAuY1B,CAAC;AAEV;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,SAC3B,OAAO,KACZ,OAMO,CAAC"}
|
package/dist/index.es.js
CHANGED
|
@@ -2323,7 +2323,7 @@ exports.carouselInitScript = "(function(){" +
|
|
|
2323
2323
|
"src/Navigate/model/marker.ts": function (module, exports, require) {
|
|
2324
2324
|
"use strict";
|
|
2325
2325
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2326
|
-
exports.frameCss = exports.frameClass = exports.embeddedAttr = exports.embedParam = exports.embeddersMeta = exports.partnersMeta = exports.documentColumn = exports.strip = exports.navHookName = exports.spanAttr = exports.columnAttr = exports.stripAttr = void 0;
|
|
2326
|
+
exports.frameCss = exports.frameReadyAttr = exports.frameClass = exports.embeddedAttr = exports.embedParam = exports.embeddersMeta = exports.partnersMeta = exports.documentColumn = exports.strip = exports.navHookName = exports.spanAttr = exports.columnAttr = exports.stripAttr = void 0;
|
|
2327
2327
|
const plgg_1 = require("plgg");
|
|
2328
2328
|
const plgg_view_1 = require("plgg-view");
|
|
2329
2329
|
const combinators_1 = require("src/Layout/usecase/combinators.ts");
|
|
@@ -2346,10 +2346,12 @@ exports.embeddersMeta = `${identity_1.cssPrefix}-embedders`;
|
|
|
2346
2346
|
exports.embedParam = `${identity_1.cssPrefix}-embed`;
|
|
2347
2347
|
exports.embeddedAttr = `data-${identity_1.cssPrefix}-embedded`;
|
|
2348
2348
|
exports.frameClass = `${identity_1.cssPrefix}-frame`;
|
|
2349
|
+
exports.frameReadyAttr = `data-${identity_1.cssPrefix}-frame-ready`;
|
|
2349
2350
|
const frameCss = (p) => `
|
|
2350
2351
|
.${p}-frame{flex:1 1 auto;min-height:0;width:100%;border-style:none}
|
|
2351
2352
|
[data-${p}-embedded] :is(.${p}-shell-bar,.${p}-shell-side,.${p}-shell-backdrop,.${p}-shell-head,.${p}-trail){display:none}
|
|
2352
|
-
[data-${p}-embedded] .${p}-shell-page{flex:1 1
|
|
2353
|
+
[data-${p}-embedded] .${p}-shell-page{flex:1 1 0;width:100%;min-width:0;max-width:none}
|
|
2354
|
+
[data-${p}-embedded] .${p}-row{overflow-x:hidden}
|
|
2353
2355
|
`;
|
|
2354
2356
|
exports.frameCss = frameCss;
|
|
2355
2357
|
|
|
@@ -2739,6 +2741,7 @@ exports.navigationInitScript = "(function(){" +
|
|
|
2739
2741
|
`var R=${q(compositionUrl_1.restParam)},Q=${q(compositionUrl_1.spanParam)};` +
|
|
2740
2742
|
`var E=${q(compositionUrl_1.escapeChar)},N=${q(compositionUrl_1.entrySeparator)},F=${q(compositionUrl_1.fieldSeparator)};` +
|
|
2741
2743
|
`var PM=${q(marker_1.partnersMeta)},EM=${q(marker_1.embeddersMeta)},EP=${q(marker_1.embedParam)},EA=${q(marker_1.embeddedAttr)},FR=${q(marker_1.frameClass)};` +
|
|
2744
|
+
`var RD=${q(marker_1.frameReadyAttr)},FT=4000;` +
|
|
2742
2745
|
"function metaList(n){var m=document.querySelector('meta[name=\"'+n+'\"]');" +
|
|
2743
2746
|
"return m?(m.getAttribute('content')||'').split(' ').filter(Boolean):[];}" +
|
|
2744
2747
|
"var PT=metaList(PM),EB=metaList(EM);" +
|
|
@@ -2799,7 +2802,12 @@ exports.navigationInitScript = "(function(){" +
|
|
|
2799
2802
|
"f.setAttribute('sandbox','allow-scripts allow-same-origin');" +
|
|
2800
2803
|
"f.setAttribute('referrerpolicy','strict-origin-when-cross-origin');" +
|
|
2801
2804
|
"f.title=sp.textContent;var src=new URL(x.origin+x.pathname);src.searchParams.set(EP,'1');f.src=src.href;" +
|
|
2802
|
-
"col.appendChild(f);
|
|
2805
|
+
"col.appendChild(f);" +
|
|
2806
|
+
"setTimeout(function(){if(col.hasAttribute(RD)||!col.isConnected){return;}" +
|
|
2807
|
+
"var at=columnOf(col);if(at>0){truncate(at-1,true);" +
|
|
2808
|
+
"window.history.replaceState(null,'',urlFor(current().slice(1)));}" +
|
|
2809
|
+
"window.location.assign(x.origin+x.pathname);},FT);" +
|
|
2810
|
+
"return col;}" +
|
|
2803
2811
|
"function fetchCol(route,span){" +
|
|
2804
2812
|
"if(abs(route)){return partner(route)&&strip()&&cols().length" +
|
|
2805
2813
|
"?Promise.resolve(frameCol(route)):Promise.reject(new Error('nav'));}" +
|
|
@@ -2898,6 +2906,27 @@ exports.navigationInitScript = "(function(){" +
|
|
|
2898
2906
|
"if(l.getAttribute('data-home')===null){l.setAttribute('data-home',l.getAttribute('aria-current')==='page'?'1':'0');}" +
|
|
2899
2907
|
"if(c.length?bare(l.pathname)===r:l.getAttribute('data-home')==='1'){l.setAttribute('aria-current','page');}" +
|
|
2900
2908
|
"else if(l.getAttribute('aria-current')==='page'){l.removeAttribute('aria-current');}}}" +
|
|
2909
|
+
"function shade(col){var f=col.querySelector(':scope>iframe.'+FR);if(!f||!f.contentWindow){return;}" +
|
|
2910
|
+
"var o;try{o=new URL(col.getAttribute(C)||'').origin;}catch(e){return;}" +
|
|
2911
|
+
"if(PT.indexOf(o)<0){return;}" +
|
|
2912
|
+
"f.contentWindow.postMessage({type:'pm:scheme',scheme:document.documentElement.classList.contains('dark')?'dark':'light'},o);}" +
|
|
2913
|
+
"if(PT.length&&window.MutationObserver){new MutationObserver(function(){" +
|
|
2914
|
+
"var c=cols();for(var i=0;i<c.length;i++){shade(c[i]);}})" +
|
|
2915
|
+
".observe(document.documentElement,{attributes:true,attributeFilter:['class']});}" +
|
|
2916
|
+
"if(EMB){window.addEventListener('message',function(ev){" +
|
|
2917
|
+
"if(ev.source!==window.parent||EB.indexOf(ev.origin)<0||!ev.data||ev.data.type!=='pm:scheme'){return;}" +
|
|
2918
|
+
"if(ev.data.scheme==='dark'){document.documentElement.classList.add('dark');}" +
|
|
2919
|
+
"else if(ev.data.scheme==='light'){document.documentElement.classList.remove('dark');}});" +
|
|
2920
|
+
"window.addEventListener('wheel',function(ev){" +
|
|
2921
|
+
"var dx=ev.deltaX*(ev.deltaMode===1?16:1);" +
|
|
2922
|
+
"if(!dx||Math.abs(dx)<=Math.abs(ev.deltaY)){return;}" +
|
|
2923
|
+
"var e=ev.target;while(e&&e!==document&&e.nodeType===1){" +
|
|
2924
|
+
"var ox=window.getComputedStyle(e).overflowX;" +
|
|
2925
|
+
"if((ox==='auto'||ox==='scroll')&&e.scrollWidth>e.clientWidth+1){" +
|
|
2926
|
+
"if(dx<0?e.scrollLeft>0:e.scrollLeft+e.clientWidth<e.scrollWidth-1){return;}}" +
|
|
2927
|
+
"e=e.parentNode;}" +
|
|
2928
|
+
"ev.preventDefault();tell({type:'pm:scroll',dx:dx});},{passive:false});}" +
|
|
2929
|
+
"var SX=0,SL=0,SW=0;" +
|
|
2901
2930
|
"window.addEventListener('message',function(ev){" +
|
|
2902
2931
|
"if(PT.indexOf(ev.origin)<0||!ev.data||typeof ev.data!=='object'){return;}" +
|
|
2903
2932
|
"var c=cols(),at=-1;for(var i=0;i<c.length;i++){" +
|
|
@@ -2906,7 +2935,16 @@ exports.navigationInitScript = "(function(){" +
|
|
|
2906
2935
|
"try{if(new URL(c[at].getAttribute(C)||'').origin!==ev.origin){return;}}catch(e){return;}" +
|
|
2907
2936
|
"var d=ev.data;" +
|
|
2908
2937
|
"if(d.type==='pm:title'&&typeof d.title==='string'){" +
|
|
2938
|
+
"c[at].setAttribute(RD,'');shade(c[at]);" +
|
|
2909
2939
|
"var sp=c[at].querySelector(':scope>header>span');if(sp){sp.textContent=d.title.slice(0,120);}sync();return;}" +
|
|
2940
|
+
"if(d.type==='pm:scroll'&&typeof d.dx==='number'&&isFinite(d.dx)){" +
|
|
2941
|
+
"var now=Date.now();if(now<SW){return;}" +
|
|
2942
|
+
"if(now-SL>250){SX=0;}SL=now;SX+=Math.max(-600,Math.min(600,d.dx));" +
|
|
2943
|
+
"if(Math.abs(SX)<60){return;}" +
|
|
2944
|
+
"var to=c[at+(SX>0?1:-1)];SX=0;SW=now+450;" +
|
|
2945
|
+
"if(to){to.scrollIntoView({inline:'nearest',block:'nearest',behavior:R0?'auto':'smooth'});}" +
|
|
2946
|
+
"else{var st=strip();if(st){st.scrollBy({left:SX>0?st.clientWidth:-st.clientWidth,behavior:R0?'auto':'smooth'});}}" +
|
|
2947
|
+
"return;}" +
|
|
2910
2948
|
"if(d.type==='pm:open'&&typeof d.href==='string'){var u;try{u=new URL(d.href);}catch(e){return;}" +
|
|
2911
2949
|
"if(u.protocol!=='https:'&&u.protocol!=='http:'){return;}" +
|
|
2912
2950
|
"if(u.origin===window.location.origin){openFrom(at,u.pathname);}" +
|
package/dist/styleEntry.es.js
CHANGED
|
@@ -1699,7 +1699,7 @@ exports.carouselInitScript = "(function(){" +
|
|
|
1699
1699
|
"src/Navigate/model/marker.ts": function (module, exports, require) {
|
|
1700
1700
|
"use strict";
|
|
1701
1701
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1702
|
-
exports.frameCss = exports.frameClass = exports.embeddedAttr = exports.embedParam = exports.embeddersMeta = exports.partnersMeta = exports.documentColumn = exports.strip = exports.navHookName = exports.spanAttr = exports.columnAttr = exports.stripAttr = void 0;
|
|
1702
|
+
exports.frameCss = exports.frameReadyAttr = exports.frameClass = exports.embeddedAttr = exports.embedParam = exports.embeddersMeta = exports.partnersMeta = exports.documentColumn = exports.strip = exports.navHookName = exports.spanAttr = exports.columnAttr = exports.stripAttr = void 0;
|
|
1703
1703
|
const plgg_1 = require("plgg");
|
|
1704
1704
|
const plgg_view_1 = require("plgg-view");
|
|
1705
1705
|
const combinators_1 = require("src/Layout/usecase/combinators.ts");
|
|
@@ -1722,10 +1722,12 @@ exports.embeddersMeta = `${identity_1.cssPrefix}-embedders`;
|
|
|
1722
1722
|
exports.embedParam = `${identity_1.cssPrefix}-embed`;
|
|
1723
1723
|
exports.embeddedAttr = `data-${identity_1.cssPrefix}-embedded`;
|
|
1724
1724
|
exports.frameClass = `${identity_1.cssPrefix}-frame`;
|
|
1725
|
+
exports.frameReadyAttr = `data-${identity_1.cssPrefix}-frame-ready`;
|
|
1725
1726
|
const frameCss = (p) => `
|
|
1726
1727
|
.${p}-frame{flex:1 1 auto;min-height:0;width:100%;border-style:none}
|
|
1727
1728
|
[data-${p}-embedded] :is(.${p}-shell-bar,.${p}-shell-side,.${p}-shell-backdrop,.${p}-shell-head,.${p}-trail){display:none}
|
|
1728
|
-
[data-${p}-embedded] .${p}-shell-page{flex:1 1
|
|
1729
|
+
[data-${p}-embedded] .${p}-shell-page{flex:1 1 0;width:100%;min-width:0;max-width:none}
|
|
1730
|
+
[data-${p}-embedded] .${p}-row{overflow-x:hidden}
|
|
1729
1731
|
`;
|
|
1730
1732
|
exports.frameCss = frameCss;
|
|
1731
1733
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "plggmatic",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "A column-oriented UI design framework on the plgg family: pane alignment, a typed light/dark color scheme, and fundamental components as pure functions returning plgg-view Html",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.es.js",
|