@everymatrix/general-stories 0.0.1
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/dist/cjs/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/general-stories-34fcd4f4.js +290 -0
- package/dist/cjs/general-stories.cjs.entry.js +10 -0
- package/dist/cjs/general-stories.cjs.js +25 -0
- package/dist/cjs/index-839683a3.js +1317 -0
- package/dist/cjs/index.cjs.js +10 -0
- package/dist/cjs/loader.cjs.js +15 -0
- package/dist/collection/collection-manifest.json +12 -0
- package/dist/collection/components/general-stories/general-stories.css +124 -0
- package/dist/collection/components/general-stories/general-stories.js +379 -0
- package/dist/collection/components/general-stories/general-stories.types.js +1 -0
- package/dist/collection/components/general-stories/index.js +1 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/utils/locale.utils.js +54 -0
- package/dist/collection/utils/utils.js +30 -0
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/general-stories-0e155a93.js +288 -0
- package/dist/esm/general-stories.entry.js +2 -0
- package/dist/esm/general-stories.js +20 -0
- package/dist/esm/index-1b3a1a31.js +1291 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/loader.js +11 -0
- package/dist/general-stories/general-stories.esm.js +1 -0
- package/dist/general-stories/index.esm.js +1 -0
- package/dist/general-stories/p-30c1a94b.js +2 -0
- package/dist/general-stories/p-5d17c3bf.js +1 -0
- package/dist/general-stories/p-9adad3b4.entry.js +1 -0
- package/dist/general-stories/p-e1255160.js +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/stencil.config.dev.js +17 -0
- package/dist/stencil.config.js +17 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/general-stories/.stencil/packages/stencil/general-stories/stencil.config.d.ts +2 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/general-stories/.stencil/packages/stencil/general-stories/stencil.config.dev.d.ts +2 -0
- package/dist/types/components/general-stories/general-stories.d.ts +68 -0
- package/dist/types/components/general-stories/general-stories.types.d.ts +11 -0
- package/dist/types/components/general-stories/index.d.ts +1 -0
- package/dist/types/components.d.ts +93 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +1674 -0
- package/dist/types/utils/locale.utils.d.ts +2 -0
- package/dist/types/utils/utils.d.ts +3 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/loader/package.json +11 -0
- package/package.json +26 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { b as bootstrapLazy } from './index-1b3a1a31.js';
|
|
2
|
+
export { s as setNonce } from './index-1b3a1a31.js';
|
|
3
|
+
import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
4
|
+
|
|
5
|
+
const defineCustomElements = async (win, options) => {
|
|
6
|
+
if (typeof window === 'undefined') return undefined;
|
|
7
|
+
await globalScripts();
|
|
8
|
+
return bootstrapLazy([["general-stories",[[1,"general-stories",{"cmsEndpoint":[513,"cms-endpoint"],"language":[513],"cmsEnv":[513,"cms-env"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"progressBarDuration":[514,"progress-bar-duration"],"currentStory":[32],"currentStoryId":[32],"progress":[32],"touchPosStart":[32],"touchPosEnd":[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]],{"clientStyling":["handleStylingUpdate"],"clientStylingUrl":["handleStylingUpdate"],"translationUrl":["handleNewTranslations"],"progress":["handleTimeEnds"]}]]]], options);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { defineCustomElements };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as t,b as n}from"./p-30c1a94b.js";export{s as setNonce}from"./p-30c1a94b.js";import{g as r}from"./p-e1255160.js";(()=>{const n=import.meta.url,r={};return""!==n&&(r.resourcesUrl=new URL(".",n).href),t(r)})().then((async t=>(await r(),n([["p-9adad3b4",[[1,"general-stories",{cmsEndpoint:[513,"cms-endpoint"],language:[513],cmsEnv:[513,"cms-env"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],translationUrl:[513,"translation-url"],progressBarDuration:[514,"progress-bar-duration"],currentStory:[32],currentStoryId:[32],progress:[32],touchPosStart:[32],touchPosEnd:[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]],{clientStyling:["handleStylingUpdate"],clientStylingUrl:["handleStylingUpdate"],translationUrl:["handleNewTranslations"],progress:["handleTimeEnds"]}]]]],t))));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{G as GeneralStories}from"./p-5d17c3bf.js";import"./p-30c1a94b.js";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var t=Object.defineProperty,e=new WeakMap,n=t=>e.get(t),o=(t,n)=>e.set(n.t=t,n),l=(t,e)=>e in t,r=(t,e)=>(0,console.error)(t,e),s=new Map,i=new Map,c="slot-fb{display:contents}slot-fb[hidden]{display:none}",u="undefined"!=typeof window?window:{},a=u.document||{head:{}},f={o:0,l:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,o)=>t.addEventListener(e,n,o),rel:(t,e,n,o)=>t.removeEventListener(e,n,o),ce:(t,e)=>new CustomEvent(t,e)},h=t=>Promise.resolve(t),p=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(t){}return!1})(),m=!1,d=[],v=[],y=(t,e)=>n=>{t.push(n),m||(m=!0,e&&4&f.o?b($):f.raf($))},w=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){r(t)}t.length=0},$=()=>{w(d),w(v),(m=d.length>0)&&f.raf($)},b=t=>h().then(t),g=y(v,!0),S={},j=t=>"object"==(t=typeof t)||"function"===t;function O(t){var e,n,o;return null!=(o=null==(n=null==(e=t.head)?void 0:e.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?o:void 0}((e,n)=>{for(var o in n)t(e,o,{get:n[o],enumerable:!0})})({},{err:()=>k,map:()=>C,ok:()=>E,unwrap:()=>x,unwrapErr:()=>P});var E=t=>({isOk:!0,isErr:!1,value:t}),k=t=>({isOk:!1,isErr:!0,value:t});function C(t,e){if(t.isOk){const n=e(t.value);return n instanceof Promise?n.then((t=>E(t))):E(n)}if(t.isErr)return k(t.value);throw"should never get here"}var M,x=t=>{if(t.isOk)return t.value;throw t.value},P=t=>{if(t.isErr)return t.value;throw t.value},A=(t,e,...n)=>{let o=null,l=!1,r=!1;const s=[],i=e=>{for(let n=0;n<e.length;n++)o=e[n],Array.isArray(o)?i(o):null!=o&&"boolean"!=typeof o&&((l="function"!=typeof t&&!j(o))&&(o+=""),l&&r?s[s.length-1].i+=o:s.push(l?R(null,o):o),r=l)};if(i(n),e){const t=e.className||e.class;t&&(e.class="object"!=typeof t?t:Object.keys(t).filter((e=>t[e])).join(" "))}if("function"==typeof t)return t(null===e?{}:e,s,F);const c=R(t,null);return c.u=e,s.length>0&&(c.h=s),c},R=(t,e)=>({o:0,p:t,i:e,m:null,h:null,u:null}),T={},F={forEach:(t,e)=>t.map(H).forEach(e),map:(t,e)=>t.map(H).map(e).map(L)},H=t=>({vattrs:t.u,vchildren:t.h,vkey:t.v,vname:t.$,vtag:t.p,vtext:t.i}),L=t=>{if("function"==typeof t.vtag){const e={...t.vattrs};return t.vkey&&(e.key=t.vkey),t.vname&&(e.name=t.vname),A(t.vtag,e,...t.vchildren||[])}const e=R(t.vtag,t.vtext);return e.u=t.vattrs,e.h=t.vchildren,e.v=t.vkey,e.$=t.vname,e},N=new WeakMap,U=t=>"sc-"+t.S,W=(t,e,n,o,r,s)=>{if(n!==o){let i=l(t,e),c=e.toLowerCase();if("class"===e){const e=t.classList,l=q(n),r=q(o);e.remove(...l.filter((t=>t&&!r.includes(t)))),e.add(...r.filter((t=>t&&!l.includes(t))))}else if("style"===e){for(const e in n)o&&null!=o[e]||(e.includes("-")?t.style.removeProperty(e):t.style[e]="");for(const e in o)n&&o[e]===n[e]||(e.includes("-")?t.style.setProperty(e,o[e]):t.style[e]=o[e])}else if("ref"===e)o&&o(t);else if(i||"o"!==e[0]||"n"!==e[1]){const l=j(o);if((i||l&&null!==o)&&!r)try{if(t.tagName.includes("-"))t[e]=o;else{const l=null==o?"":o;"list"===e?i=!1:null!=n&&t[e]==l||(t[e]=l)}}catch(t){}null==o||!1===o?!1===o&&""!==t.getAttribute(e)||t.removeAttribute(e):(!i||4&s||r)&&!l&&t.setAttribute(e,o=!0===o?"":o)}else if(e="-"===e[2]?e.slice(3):l(u,c)?c.slice(2):c[2]+e.slice(3),n||o){const l=e.endsWith(G);e=e.replace(V,""),n&&f.rel(t,e,n,l),o&&f.ael(t,e,o,l)}}},D=/\s/,q=t=>t?t.split(D):[],G="Capture",V=RegExp(G+"$"),_=(t,e,n)=>{const o=11===e.m.nodeType&&e.m.host?e.m.host:e.m,l=t&&t.u||S,r=e.u||S;for(const t of z(Object.keys(l)))t in r||W(o,t,l[t],void 0,n,e.o);for(const t of z(Object.keys(r)))W(o,t,l[t],r[t],n,e.o)};function z(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var B=!1,I=(t,e,n)=>{const o=e.h[n];let l,r,s=0;if(null!==o.i)l=o.m=a.createTextNode(o.i);else{if(B||(B="svg"===o.p),l=o.m=a.createElementNS(B?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",o.p),B&&"foreignObject"===o.p&&(B=!1),_(null,o,B),l.getRootNode().querySelector("body"),o.h)for(s=0;s<o.h.length;++s)r=I(t,o,s),r&&l.appendChild(r);"svg"===o.p?B=!1:"foreignObject"===l.tagName&&(B=!0)}return l["s-hn"]=M,l},J=(t,e,n,o,l,r)=>{let s,i=t;for(i.shadowRoot&&i.tagName===M&&(i=i.shadowRoot);l<=r;++l)o[l]&&(s=I(null,n,l),s&&(o[l].m=s,Z(i,s,e)))},K=(t,e,n)=>{for(let o=e;o<=n;++o){const e=t[o];if(e){const t=e.m;Y(e),t&&t.remove()}}},Q=(t,e)=>t.p===e.p,X=(t,e,n=!1)=>{const o=e.m=t.m,l=t.h,r=e.h,s=e.p,i=e.i;null===i?(_(t,e,B="svg"===s||"foreignObject"!==s&&B),null!==l&&null!==r?((t,e,n,o,l=!1)=>{let r,s=0,i=0,c=e.length-1,u=e[0],a=e[c],f=o.length-1,h=o[0],p=o[f];for(;s<=c&&i<=f;)null==u?u=e[++s]:null==a?a=e[--c]:null==h?h=o[++i]:null==p?p=o[--f]:Q(u,h)?(X(u,h,l),u=e[++s],h=o[++i]):Q(a,p)?(X(a,p,l),a=e[--c],p=o[--f]):Q(u,p)?(X(u,p,l),Z(t,u.m,a.m.nextSibling),u=e[++s],p=o[--f]):Q(a,h)?(X(a,h,l),Z(t,a.m,u.m),a=e[--c],h=o[++i]):(r=I(e&&e[i],n,i),h=o[++i],r&&Z(u.m.parentNode,r,u.m));s>c?J(t,null==o[f+1]?null:o[f+1].m,n,o,i,f):i>f&&K(e,s,c)})(o,l,e,r,n):null!==r?(null!==t.i&&(o.textContent=""),J(o,null,e,r,0,r.length-1)):!n&&null!==l&&K(l,0,l.length-1),B&&"svg"===s&&(B=!1)):t.i!==i&&(o.data=i)},Y=t=>{t.u&&t.u.ref&&t.u.ref(null),t.h&&t.h.map(Y)},Z=(t,e,n)=>null==t?void 0:t.insertBefore(e,n),tt=(t,e)=>{e&&!t.j&&e["s-p"]&&e["s-p"].push(new Promise((e=>t.j=e)))},et=(t,e)=>{if(t.o|=16,!(4&t.o))return tt(t,t.O),g((()=>nt(t,e)));t.o|=512},nt=(t,e)=>{const n=t.t;if(!n)throw Error(`Can't render component <${t.$hostElement$.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let o;return e&&(t.o|=256,t.k&&(t.k.map((([t,e])=>ut(n,t,e))),t.k=void 0),o=ut(n,"componentWillLoad")),ot(o,(()=>rt(t,n,e)))},ot=(t,e)=>lt(t)?t.then(e).catch((t=>{console.error(t),e()})):e(),lt=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,rt=async(t,e,n)=>{var o;const l=t.$hostElement$,r=l["s-rc"];n&&(t=>{const e=t.C,n=t.$hostElement$,o=e.o,l=((t,e)=>{var n;const o=U(e),l=i.get(o);if(t=11===t.nodeType?t:a,l)if("string"==typeof l){let r,s=N.get(t=t.head||t);if(s||N.set(t,s=new Set),!s.has(o)){{r=a.createElement("style"),r.innerHTML=l;const o=null!=(n=f.M)?n:O(a);null!=o&&r.setAttribute("nonce",o),(!(1&e.o)||1&e.o&&"HEAD"!==t.nodeName)&&t.insertBefore(r,t.querySelector("link"))}4&e.o&&(r.innerHTML+=c),s&&s.add(o)}}else t.adoptedStyleSheets.includes(l)||(t.adoptedStyleSheets=[...t.adoptedStyleSheets,l]);return o})(n.shadowRoot?n.shadowRoot:n.getRootNode(),e);10&o&&2&o&&(n["s-sc"]=l,n.classList.add(l+"-h"))})(t);st(t,e,l,n),r&&(r.map((t=>t())),l["s-rc"]=void 0);{const e=null!=(o=l["s-p"])?o:[],n=()=>it(t);0===e.length?n():(Promise.all(e).then(n),t.o|=4,e.length=0)}},st=(t,e,n,o)=>{try{e=e.render(),t.o&=-17,t.o|=2,((t,e,n=!1)=>{const o=t.$hostElement$,l=t.C,r=t.P||R(null,null),s=(t=>t&&t.p===T)(e)?e:A(null,null,e);if(M=o.tagName,l.A&&(s.u=s.u||{},l.A.map((([t,e])=>s.u[e]=o[t]))),n&&s.u)for(const t of Object.keys(s.u))o.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(s.u[t]=o[t]);s.p=null,s.o|=4,t.P=s,s.m=r.m=o.shadowRoot||o,X(r,s,n)})(t,e,o)}catch(e){r(e,t.$hostElement$)}return null},it=t=>{const e=t.$hostElement$,n=t.O;64&t.o||(t.o|=64,at(e),t.R(e),n||ct()),t.j&&(t.j(),t.j=void 0),512&t.o&&b((()=>et(t,!1))),t.o&=-517},ct=()=>{at(a.documentElement),b((()=>(t=>{const e=f.ce("appload",{detail:{namespace:"general-stories"}});return t.dispatchEvent(e),e})(u)))},ut=(t,e,n)=>{if(t&&t[e])try{return t[e](n)}catch(t){r(t)}},at=t=>t.classList.add("hydrated"),ft=(t,e,o)=>{var l,s;const i=t.prototype;if(e.T||e.F||t.watchers){t.watchers&&!e.F&&(e.F=t.watchers);const c=Object.entries(null!=(l=e.T)?l:{});if(c.map((([t,[l]])=>{(31&l||2&o&&32&l)&&Object.defineProperty(i,t,{get(){return((t,e)=>n(this).H.get(e))(0,t)},set(o){((t,e,o,l)=>{const s=n(t);if(!s)throw Error(`Couldn't find host element for "${l.S}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/ionic-team/stencil/issues/5457).`);const i=s.$hostElement$,c=s.H.get(e),u=s.o,a=s.t;if(o=((t,e)=>null==t||j(t)?t:2&e?parseFloat(t):1&e?t+"":t)(o,l.T[e][0]),(!(8&u)||void 0===c)&&o!==c&&(!Number.isNaN(c)||!Number.isNaN(o))&&(s.H.set(e,o),a)){if(l.F&&128&u){const t=l.F[e];t&&t.map((t=>{try{a[t](o,c,e)}catch(t){r(t,i)}}))}2==(18&u)&&et(s,!1)}})(this,t,o,e)},configurable:!0,enumerable:!0})})),1&o){const o=new Map;i.attributeChangedCallback=function(t,l,r){f.jmp((()=>{var s;const c=o.get(t);if(this.hasOwnProperty(c))r=this[c],delete this[c];else{if(i.hasOwnProperty(c)&&"number"==typeof this[c]&&this[c]==r)return;if(null==c){const o=n(this),i=null==o?void 0:o.o;if(i&&!(8&i)&&128&i&&r!==l){const n=o.t,i=null==(s=e.F)?void 0:s[t];null==i||i.forEach((e=>{null!=n[e]&&n[e].call(n,r,l,t)}))}return}}this[c]=(null!==r||"boolean"!=typeof this[c])&&r}))},t.observedAttributes=Array.from(new Set([...Object.keys(null!=(s=e.F)?s:{}),...c.filter((([t,e])=>15&e[0])).map((([t,n])=>{var l;const r=n[1]||t;return o.set(r,t),512&n[0]&&(null==(l=e.A)||l.push([t,r])),r}))]))}}return t},ht=(t,o={})=>{var l;const h=[],m=o.exclude||[],d=u.customElements,v=a.head,y=v.querySelector("meta[charset]"),w=a.createElement("style"),$=[];let b,g=!0;Object.assign(f,o),f.l=new URL(o.resourcesUrl||"./",a.baseURI).href;let S=!1;if(t.map((t=>{t[1].map((o=>{var l;const c={o:o[0],S:o[1],T:o[2],L:o[3]};4&c.o&&(S=!0),c.T=o[2],c.L=o[3],c.A=[],c.F=null!=(l=o[4])?l:{};const u=c.S,a=class extends HTMLElement{constructor(t){if(super(t),this.hasRegisteredEventListeners=!1,((t,n)=>{const o={o:0,$hostElement$:t,C:n,H:new Map};o.N=new Promise((t=>o.R=t)),t["s-p"]=[],t["s-rc"]=[],e.set(t,o)})(t=this,c),1&c.o)if(t.shadowRoot){if("open"!==t.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${c.S}! Mode is set to ${t.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else t.attachShadow({mode:"open"})}connectedCallback(){const t=n(this);this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0,pt(this,t,c.L)),b&&(clearTimeout(b),b=null),g?$.push(this):f.jmp((()=>(t=>{if(!(1&f.o)){const e=n(t),o=e.C,l=()=>{};if(1&e.o)pt(t,e,o.L),(null==e?void 0:e.t)||(null==e?void 0:e.N)&&e.N.then((()=>{}));else{e.o|=1;{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){tt(e,e.O=n);break}}o.T&&Object.entries(o.T).map((([e,[n]])=>{if(31&n&&t.hasOwnProperty(e)){const n=t[e];delete t[e],t[e]=n}})),(async(t,e,n)=>{let o;if(!(32&e.o)){if(e.o|=32,n.U){const t=(t=>{const e=t.S.replace(/-/g,"_"),n=t.U;if(!n)return;const o=s.get(n);return o?o[e]:import(`./${n}.entry.js`).then((t=>(s.set(n,t),t[e])),r)
|
|
2
|
+
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/})(n);if(t&&"then"in t){const e=()=>{};o=await t,e()}else o=t;if(!o)throw Error(`Constructor for "${n.S}#${e.W}" was not found`);o.isProxied||(n.F=o.watchers,ft(o,n,2),o.isProxied=!0);const l=()=>{};e.o|=8;try{new o(e)}catch(t){r(t)}e.o&=-9,e.o|=128,l()}else o=t.constructor,customElements.whenDefined(t.localName).then((()=>e.o|=128));if(o&&o.style){let t;"string"==typeof o.style&&(t=o.style);const e=U(n);if(!i.has(e)){const o=()=>{};((t,e,n)=>{let o=i.get(t);p&&n?(o=o||new CSSStyleSheet,"string"==typeof o?o=e:o.replaceSync(e)):o=e,i.set(t,o)})(e,t,!!(1&n.o)),o()}}}const l=e.O,c=()=>et(e,!0);l&&l["s-rc"]?l["s-rc"].push(c):c()})(t,e,o)}l()}})(this)))}disconnectedCallback(){f.jmp((()=>(async()=>{if(!(1&f.o)){const t=n(this);t.D&&(t.D.map((t=>t())),t.D=void 0),(null==t?void 0:t.t)||(null==t?void 0:t.N)&&t.N.then((()=>{}))}})()))}componentOnReady(){return n(this).N}};c.U=t[0],m.includes(u)||d.get(u)||(h.push(u),d.define(u,ft(a,c,1)))}))})),h.length>0&&(S&&(w.textContent+=c),w.textContent+=h.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",w.innerHTML.length)){w.setAttribute("data-styles","");const t=null!=(l=f.M)?l:O(a);null!=t&&w.setAttribute("nonce",t),v.insertBefore(w,y?y.nextSibling:v.firstChild)}g=!1,$.length?$.map((t=>t.connectedCallback())):f.jmp((()=>b=setTimeout(ct,30)))},pt=(t,e,n)=>{n&&n.map((([n,o,l])=>{const r=t,s=mt(e,l),i=dt(n);f.ael(r,o,s,i),(e.D=e.D||[]).push((()=>f.rel(r,o,s,i)))}))},mt=(t,e)=>n=>{var o;try{256&t.o?null==(o=t.t)||o[e](n):(t.k=t.k||[]).push([e,n])}catch(t){r(t)}},dt=t=>({passive:!!(1&t),capture:!!(2&t)}),vt=t=>f.M=t;export{ht as b,A as h,h as p,o as r,vt as s}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,h as i}from"./p-30c1a94b.js";const e={en:{error:"Error",generalStoriesLoading:"Loading, please wait ...",loadMore:"Load More"},hu:{error:"Hiba",generalStoriesLoading:"Betöltés, kérjük várjon ...",loadMore:"Továbbiak betöltése"},ro:{error:"Eroare",generalStoriesLoading:"Se încarcă, vă rugăm așteptați ...",loadMore:"Încarcă mai multe"},fr:{error:"Erreur",generalStoriesLoading:"Chargement, veuillez patienter ...",loadMore:"Charger plus"},ar:{error:"خطأ",generalStoriesLoading:"جار التحميل، يرجى الانتظار ...",loadMore:"تحميل المزيد"},hr:{error:"Greška",generalStoriesLoading:"Učitavanje, molimo pričekajte ...",loadMore:"Učitaj više"}},o=t=>new Promise((i=>{fetch(t).then((t=>t.json())).then((t=>{Object.keys(t).forEach((i=>{e[i]||(e[i]={});for(let o in t[i])e[i][o]=t[i][o]})),i(!0)}))})),r=(t,i)=>e[void 0!==i&&i in e?i:"en"][t],s=class{constructor(e){t(this,e),this.hasErrors=!1,this.isLoading=!0,this.isSwipe=!1,this.getStories=()=>{let t=new URL(`${this.cmsEndpoint}/${this.language}/stories`);return t.searchParams.append("env",this.cmsEnv),t.searchParams.append("device",(()=>{const t=(()=>{let t=window.navigator.userAgent;return t.toLowerCase().match(/android/i)?"Android":t.toLowerCase().match(/iphone/i)?"iPhone":t.toLowerCase().match(/ipad|ipod/i)?"iPad":"PC"})();if(t)return"PC"===t?"dk":"mtWeb"})()),t.searchParams.append("language",this.language),new Promise(((i,e)=>{this.isLoading=!0,fetch(t.href).then((t=>t.json())).then((t=>{this.stories=t,this.stories.forEach((t=>{t.viewed=!1})),this.isLoading=!1,i(!0)})).catch((t=>{console.log(t),this.isLoading=!1,this.hasErrors=!0,e(t)}))}))},this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.stylingContainer.prepend(t)},this.setClientStylingURL=()=>{let t=new URL(this.clientStylingUrl),i=document.createElement("style");fetch(t.href).then((t=>t.text())).then((t=>{i.innerHTML=t,setTimeout((()=>{this.stylingContainer.prepend(i)}),1)})).catch((t=>{console.log("error ",t)}))},this.navigateToExternalStoryLink=()=>{window.postMessage({type:"OpenStoryLink",url:this.currentStory.storyUrl},window.location.href)},this.openFullScreenStory=t=>{this.currentStoryId=t,this.currentStory=this.stories.find((i=>i.id===t)),this.markStoryAsViewed(t),this.startProgress()},this.closeFullScreenView=()=>{this.markStoryAsViewed(this.currentStoryId.toString()),this.currentStoryId=null,this.progress=0,clearInterval(this.intervalId)},this.markStoryAsViewed=t=>{const i=this.stories.findIndex((i=>i.id===t));if(i>-1){const[t]=this.stories.splice(i,1);t.viewed=!0,this.stories=[...this.stories,t]}},this.changeStory=(t,i)=>{const e="next"===i?Number(t.index)+1:Number(t.index)-1;if(e>this.stories.length-1||e<0)this.markStoryAsViewed(t.index),this.closeFullScreenView();else{const t=this.stories.find((t=>t.index===e));this.currentStory=t,this.currentStoryId=t.id,this.progress=0,this.markStoryAsViewed(t.id)}},this.startProgress=()=>{const t=100/(1e3*this.progressBarDuration)*100;this.intervalId=setInterval((()=>{this.progress>=100?clearInterval(this.intervalId):this.progress+=t}),100)},this.Thumbnail=({props:t})=>i("div",{class:"StoryThumbnailContainer "+(t.viewed?"Viewed":"Highlighted"),onTouchStart:()=>this.openFullScreenStory(t.id)},i("img",{class:"StoryThumbnailImage "+(t.viewed?"Viewed":"Highlighted"),src:t.icon,alt:"story-icon"})),this.cmsEndpoint=void 0,this.language="en",this.cmsEnv="stage",this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.progressBarDuration=10,this.currentStory=void 0,this.currentStoryId=null,this.progress=0,this.touchPosStart=void 0,this.touchPosEnd=void 0}handleStylingUpdate(){this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL()}handleNewTranslations(){this.isLoading=!0,o(this.translationUrl).then((()=>{this.isLoading=!1}))}handleTimeEnds(t){t>=100&&this.changeStory(this.currentStory,"next")}async componentWillLoad(){this.cmsEndpoint&&this.language&&await this.getStories(),this.translationUrl.length>2&&await o(this.translationUrl)}onTouchStart(t){this.touchPosStart={clientX:t.touches[0].clientX,clientY:t.touches[0].clientY}}onTouchMove(t){this.touchPosEnd={clientX:t.touches[0].clientX,clientY:t.touches[0].clientY},Math.abs(this.touchPosEnd.clientX-this.touchPosStart.clientX)>50&&(this.isSwipe=!0)}onTouchEnd(t){if(this.isSwipe)this.touchPosEnd={clientX:t.changedTouches[0].clientX,clientY:t.changedTouches[0].clientY},this.changeStory(this.currentStory,this.touchPosEnd.clientX-this.touchPosStart.clientX>0?"previous":"next");else{const i=window.innerWidth;this.changeStory(this.currentStory,t.changedTouches[0].clientX>i/2?"next":"previous")}}render(){return this.hasErrors?i("div",{class:"GeneralStoriesError"},i("div",{class:"Title"},r("error",this.language))):this.isLoading?i("div",{class:"GeneralStoriesLoading"},i("div",{class:"Title"},r("generalStoriesLoading",this.language))):this.isLoading?void 0:i("div",{ref:t=>this.stylingContainer=t},this.currentStoryId?i("div",{class:"FullScreenStory"},i("div",{class:"FullScreenHeader"},i("div",{class:"ProgressBarContainer"},i("div",{class:"ProgressBar",style:{width:`${this.progress}%`}})),i("div",{id:"close",class:"CloseStoryButton",onTouchStart:this.closeFullScreenView},i("svg",{fill:"none",stroke:"#ffffff",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},i("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})))),"video"===this.currentStory.type?i("video",{autoPlay:!0},i("source",{src:this.currentStory.url,type:"video/mp4"})):i("img",{src:this.currentStory.url,alt:"story-image"}),this.currentStory.storyUrl&&i("div",{class:"LoadMoreButtonBackground"},i("button",{onTouchStart:this.navigateToExternalStoryLink,class:"LoadMoreButton"},r("loadMore",this.language)))):i("div",{class:"ImageContainer"},this.stories.map((t=>i(this.Thumbnail,{props:t})))))}static get watchers(){return{clientStyling:["handleStylingUpdate"],clientStylingUrl:["handleStylingUpdate"],translationUrl:["handleNewTranslations"],progress:["handleTimeEnds"]}}};s.style='.ImageContainer{display:flex;flex-direction:row;background-color:var(--emw--color-background, #0E1511);overflow:auto}.StoryThumbnailContainer{margin:5px;position:relative;display:inline-block;border-radius:50%}.StoryThumbnailContainer.Highlighted::before{content:"";position:absolute;border-radius:50%;background:linear-gradient(to bottom, var(--emw--color-primary, #22B04E), var(--emw--color-secondary, #E1A749));top:-3px;left:-3px;width:111%;height:103%}.StoryThumbnailContainer.Viewed::before{content:"";position:absolute;border-radius:50%;height:50px;width:50px;background:var(--emw--color-grey-150, #828282);top:-3px;left:-3px;width:111%;height:103%}.StoryThumbnailImage{height:50px;width:50px;border-radius:50%;position:relative;z-index:1}.StoryThumbnailImage.Highlighted,.StoryThumbnailImage.Viewed{border:2px solid var(--emw--color-white, #ffffff)}.FullScreenHeader{position:fixed;background:linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));top:0px;width:100%;display:flex;flex-direction:column;padding:10px 0;z-index:5;height:30px}.FullScreenHeader .CloseStoryButton{position:absolute;right:0;width:20px;margin-right:20px;margin-top:8px;z-index:50}.FullScreenHeader .ProgressBarContainer{width:90%;height:2px;position:relative;top:0;background-color:var(--emw--color-grey-150, #828282);border-radius:10px;overflow:hidden;margin:0 auto}.FullScreenHeader .ProgressBarContainer .ProgressBar{height:100%;background:var(--emw--color-white, #ffffff);width:0%;transition:width 0.1s linear}.FullScreenStory{position:fixed;width:100vw;height:100vh;background-color:var(--emw--color-grey-400, #24211f);display:flex;align-items:center;justify-content:center;overflow:hidden;z-index:300}.FullScreenStory video{height:100vh;width:100vw}.FullScreenStory img{width:100%;height:100%;object-fit:contain}.FullScreenStory .LoadMoreButtonBackground{width:100vw;height:15%;background:linear-gradient(to top, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));position:absolute;bottom:0;display:flex;justify-content:center}.FullScreenStory .LoadMoreButtonBackground .LoadMoreButton{width:auto;font-size:var(--emw--font-size-small, 14px);font-family:inherit;background-color:var(--emw--color-grey-50, #F9F8F8);box-shadow:0px 0px 7px 1px var(--emw--color-grey-400, #24211f);color:var(--emw--color-black, #000000);border-radius:50px;position:absolute;bottom:15px;padding:10px 20px}';export{s as G}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{G as general_stories}from"./p-5d17c3bf.js";import"./p-30c1a94b.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const o=()=>{};export{o as g}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./cjs/index.cjs.js');
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './esm/index.js';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { sass } from "@stencil/sass";
|
|
2
|
+
export const config = {
|
|
3
|
+
namespace: 'general-stories',
|
|
4
|
+
taskQueue: 'async',
|
|
5
|
+
sourceMap: false,
|
|
6
|
+
minifyJs: true,
|
|
7
|
+
extras: {
|
|
8
|
+
experimentalImportInjection: true
|
|
9
|
+
},
|
|
10
|
+
plugins: [sass()],
|
|
11
|
+
outputTargets: [
|
|
12
|
+
{
|
|
13
|
+
type: 'www',
|
|
14
|
+
serviceWorker: null // disable service workers
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { sass } from "@stencil/sass";
|
|
2
|
+
export const config = {
|
|
3
|
+
namespace: 'general-stories',
|
|
4
|
+
taskQueue: 'async',
|
|
5
|
+
sourceMap: false,
|
|
6
|
+
minifyJs: true,
|
|
7
|
+
extras: {
|
|
8
|
+
experimentalImportInjection: true
|
|
9
|
+
},
|
|
10
|
+
plugins: [sass()],
|
|
11
|
+
outputTargets: [
|
|
12
|
+
{
|
|
13
|
+
type: 'dist',
|
|
14
|
+
esmLoaderPath: '../loader'
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Story } from './general-stories.types';
|
|
2
|
+
export declare class GeneralStories {
|
|
3
|
+
/**
|
|
4
|
+
* Endpoint URL for the source of data
|
|
5
|
+
*/
|
|
6
|
+
cmsEndpoint: string;
|
|
7
|
+
/**
|
|
8
|
+
* Language of the widget
|
|
9
|
+
*/
|
|
10
|
+
language: string;
|
|
11
|
+
/**
|
|
12
|
+
* CMS Endpoint stage
|
|
13
|
+
*/
|
|
14
|
+
cmsEnv: string;
|
|
15
|
+
/**
|
|
16
|
+
* Client custom styling via string
|
|
17
|
+
*/
|
|
18
|
+
clientStyling: string;
|
|
19
|
+
/**
|
|
20
|
+
* Client custom styling via url
|
|
21
|
+
*/
|
|
22
|
+
clientStylingUrl: string;
|
|
23
|
+
/**
|
|
24
|
+
* Translations via URL
|
|
25
|
+
*/
|
|
26
|
+
translationUrl: string;
|
|
27
|
+
/**
|
|
28
|
+
* Duration of progress bar
|
|
29
|
+
*/
|
|
30
|
+
progressBarDuration: number;
|
|
31
|
+
private stylingContainer;
|
|
32
|
+
private stories;
|
|
33
|
+
intervalId: ReturnType<typeof setInterval>;
|
|
34
|
+
hasErrors: boolean;
|
|
35
|
+
isLoading: boolean;
|
|
36
|
+
isSwipe: boolean;
|
|
37
|
+
currentStory: Story;
|
|
38
|
+
currentStoryId: number | null;
|
|
39
|
+
progress: number;
|
|
40
|
+
touchPosStart: {
|
|
41
|
+
clientX: number;
|
|
42
|
+
clientY: number;
|
|
43
|
+
};
|
|
44
|
+
touchPosEnd: {
|
|
45
|
+
clientX: number;
|
|
46
|
+
clientY: number;
|
|
47
|
+
};
|
|
48
|
+
handleStylingUpdate(): void;
|
|
49
|
+
handleNewTranslations(): void;
|
|
50
|
+
handleTimeEnds(newValue: number): void;
|
|
51
|
+
componentWillLoad(): Promise<void>;
|
|
52
|
+
getStories: () => Promise<any>;
|
|
53
|
+
setClientStyling: () => void;
|
|
54
|
+
setClientStylingURL: () => void;
|
|
55
|
+
navigateToExternalStoryLink: () => void;
|
|
56
|
+
openFullScreenStory: (id: any) => void;
|
|
57
|
+
closeFullScreenView: () => void;
|
|
58
|
+
markStoryAsViewed: (storyId: string) => void;
|
|
59
|
+
changeStory: (story: any, direction: any) => void;
|
|
60
|
+
startProgress: () => void;
|
|
61
|
+
onTouchStart(e: TouchEvent): void;
|
|
62
|
+
onTouchMove(e: TouchEvent): void;
|
|
63
|
+
onTouchEnd(e: TouchEvent): void;
|
|
64
|
+
Thumbnail: ({ props }: {
|
|
65
|
+
props: any;
|
|
66
|
+
}) => any;
|
|
67
|
+
render(): any;
|
|
68
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { GeneralStories } from './general-stories';
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/**
|
|
4
|
+
* This is an autogenerated file created by the Stencil compiler.
|
|
5
|
+
* It contains typing information for all components that exist in this project.
|
|
6
|
+
*/
|
|
7
|
+
import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
|
|
8
|
+
export namespace Components {
|
|
9
|
+
interface GeneralStories {
|
|
10
|
+
/**
|
|
11
|
+
* Client custom styling via string
|
|
12
|
+
*/
|
|
13
|
+
"clientStyling": string;
|
|
14
|
+
/**
|
|
15
|
+
* Client custom styling via url
|
|
16
|
+
*/
|
|
17
|
+
"clientStylingUrl": string;
|
|
18
|
+
/**
|
|
19
|
+
* Endpoint URL for the source of data
|
|
20
|
+
*/
|
|
21
|
+
"cmsEndpoint": string;
|
|
22
|
+
/**
|
|
23
|
+
* CMS Endpoint stage
|
|
24
|
+
*/
|
|
25
|
+
"cmsEnv": string;
|
|
26
|
+
/**
|
|
27
|
+
* Language of the widget
|
|
28
|
+
*/
|
|
29
|
+
"language": string;
|
|
30
|
+
/**
|
|
31
|
+
* Duration of progress bar
|
|
32
|
+
*/
|
|
33
|
+
"progressBarDuration": number;
|
|
34
|
+
/**
|
|
35
|
+
* Translations via URL
|
|
36
|
+
*/
|
|
37
|
+
"translationUrl": string;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
declare global {
|
|
41
|
+
interface HTMLGeneralStoriesElement extends Components.GeneralStories, HTMLStencilElement {
|
|
42
|
+
}
|
|
43
|
+
var HTMLGeneralStoriesElement: {
|
|
44
|
+
prototype: HTMLGeneralStoriesElement;
|
|
45
|
+
new (): HTMLGeneralStoriesElement;
|
|
46
|
+
};
|
|
47
|
+
interface HTMLElementTagNameMap {
|
|
48
|
+
"general-stories": HTMLGeneralStoriesElement;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
declare namespace LocalJSX {
|
|
52
|
+
interface GeneralStories {
|
|
53
|
+
/**
|
|
54
|
+
* Client custom styling via string
|
|
55
|
+
*/
|
|
56
|
+
"clientStyling"?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Client custom styling via url
|
|
59
|
+
*/
|
|
60
|
+
"clientStylingUrl"?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Endpoint URL for the source of data
|
|
63
|
+
*/
|
|
64
|
+
"cmsEndpoint"?: string;
|
|
65
|
+
/**
|
|
66
|
+
* CMS Endpoint stage
|
|
67
|
+
*/
|
|
68
|
+
"cmsEnv"?: string;
|
|
69
|
+
/**
|
|
70
|
+
* Language of the widget
|
|
71
|
+
*/
|
|
72
|
+
"language"?: string;
|
|
73
|
+
/**
|
|
74
|
+
* Duration of progress bar
|
|
75
|
+
*/
|
|
76
|
+
"progressBarDuration"?: number;
|
|
77
|
+
/**
|
|
78
|
+
* Translations via URL
|
|
79
|
+
*/
|
|
80
|
+
"translationUrl"?: string;
|
|
81
|
+
}
|
|
82
|
+
interface IntrinsicElements {
|
|
83
|
+
"general-stories": GeneralStories;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
export { LocalJSX as JSX };
|
|
87
|
+
declare module "@stencil/core" {
|
|
88
|
+
export namespace JSX {
|
|
89
|
+
interface IntrinsicElements {
|
|
90
|
+
"general-stories": LocalJSX.GeneralStories & JSXBase.HTMLAttributes<HTMLGeneralStoriesElement>;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components/general-stories';
|