@miyaoka/miyaoka-components
Advanced tools
Comparing version 0.2.1 to 0.2.2
@@ -113,3 +113,3 @@ 'use strict'; | ||
const miyaokaLightboxCss = ":host{display:block}.container{cursor:pointer;display:inline}.backdrop{position:fixed;top:0;right:0;left:0;bottom:0;z-index:100;background-color:rgba(64, 62, 62, 0.9);background-position:center center;background-size:contain;background-repeat:no-repeat}"; | ||
const miyaokaLightboxCss = ":host{display:block}.container{cursor:pointer;display:inline}.backdrop{position:fixed;top:0;right:0;left:0;bottom:0;z-index:100;background-color:rgba(64, 62, 62, 0.9)}.backdrop img{width:100%;height:100%;-o-object-fit:contain;object-fit:contain}"; | ||
@@ -125,5 +125,3 @@ const MiyaokaLightbox = class { | ||
this.visible = false; | ||
}, class: "backdrop", style: { | ||
'background-image': `url(${this.src})`, | ||
} })), index.h("slot", null)))); | ||
}, class: "backdrop" }, index.h("img", { src: this.src }))), index.h("slot", null)))); | ||
} | ||
@@ -130,0 +128,0 @@ }; |
@@ -12,5 +12,4 @@ import { Component, Host, h, Prop, State } from '@stencil/core'; | ||
this.visible = false; | ||
}, class: "backdrop", style: { | ||
'background-image': `url(${this.src})`, | ||
} })), | ||
}, class: "backdrop" }, | ||
h("img", { src: this.src }))), | ||
h("slot", null)))); | ||
@@ -17,0 +16,0 @@ } |
@@ -1,1 +0,1 @@ | ||
var __awaiter=this&&this.__awaiter||function(t,e,r,i){function n(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,o){function a(t){try{c(i.next(t))}catch(e){o(e)}}function s(t){try{c(i["throw"](t))}catch(e){o(e)}}function c(t){t.done?r(t.value):n(t.value).then(a,s)}c((i=i.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,n,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(t){return function(e){return c([t,e])}}function c(a){if(i)throw new TypeError("Generator is already executing.");while(r)try{if(i=1,n&&(o=a[0]&2?n["return"]:a[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;if(n=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:r.label++;return{value:a[1],done:false};case 5:r.label++;n=a[1];a=[0];continue;case 7:a=r.ops.pop();r.trys.pop();continue;default:if(!(o=r.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(a[0]===6&&r.label<o[1]){r.label=o[1];o=a;break}if(o&&r.label<o[2]){r.label=o[2];r.ops.push(a);break}if(o[2])r.ops.pop();r.trys.pop();continue}a=e.call(t,r)}catch(s){a=[6,s];n=0}finally{i=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,h,H as Host,g as getElement}from"./index-b55763d8.js";function loadScript(t){var e=t.src,r=t.id;var i=r?document.getElementById(r):null;return new Promise((function(t,n){if(i){t()}var o=document.createElement("script");o.setAttribute("src",e);document.head.appendChild(o);o.onload=function(){if(r)o.setAttribute("id",r);t()};o.onerror=function(t){return n(t)}}))}var miyaokaEmbedTweetCss=":host{display:block}";var twReg=new RegExp("https://twitter.com/[^/]+/status/(\\d+)");var twWidgetSrc="https://platform.twitter.com/widgets.js";var MiyaokaEmbedTweet=function(){function t(t){registerInstance(this,t);this.src=""}t.prototype.connectedCallback=function(){var t=this;var e=this.src.match(twReg);if(!e)return;var r=e[1];var i=new IntersectionObserver((function(e){e.forEach((function(e){if(!e.isIntersecting)return;i.unobserve(t.el);t.embedTweet(r)}))}),{rootMargin:"200%"});i.observe(this.el)};t.prototype.embedTweet=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,i,n;return __generator(this,(function(o){switch(o.label){case 0:n=window;if(!!((e=n.twttr)===null||e===void 0?void 0:e.ready))return[3,2];return[4,loadScript({src:twWidgetSrc,id:"twitter-widgets"})];case 1:o.sent();o.label=2;case 2:return[4,(i=(r=n.twttr)===null||r===void 0?void 0:r.widgets)===null||i===void 0?void 0:i.createTweet(t,this.el,{align:"center"})];case 3:o.sent();this.el.children[0].remove();this.el.classList.add("embedTweetLoaded");return[2]}}))}))};t.prototype.render=function(){return h(Host,null,h("p",null,h("a",{href:this.src,target:"_blank",rel:"noopener noreferrer"},this.src)))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();MiyaokaEmbedTweet.style=miyaokaEmbedTweetCss;var miyaokaImgLoaderCss=":host{width:100%;height:100%;overflow:hidden}img{width:100%;height:100%}";var MiyaokaImgLoader=function(){function t(t){registerInstance(this,t);this.alt="image";this.loading="lazy";this.scale=.5;this.rotate=90;this.opacity=0;this.duration=200;this.delay=50;this.isLoaded=false}t.prototype.componentDidLoad=function(){var t=this;if(!this.img)return;if(this.img.complete){requestAnimationFrame((function(){return t.resetTransform()}));return}this.img.onload=function(){t.resetTransform()}};t.prototype.resetTransform=function(){this.isLoaded=true};t.prototype.render=function(){var t=this;var e=this.isLoaded?{}:{transform:"scale("+this.scale+") rotate("+this.rotate+"deg)",opacity:""+this.opacity};return h(Host,null,h("img",{ref:function(e){t.img=e},src:this.src,alt:this.alt,loading:this.loading,style:Object.assign(Object.assign({},e),{transitionDuration:this.duration+"ms",transitionDelay:this.delay+"ms"})}))};return t}();MiyaokaImgLoader.style=miyaokaImgLoaderCss;var miyaokaLightboxCss=":host{display:block}.container{cursor:pointer;display:inline}.backdrop{position:fixed;top:0;right:0;left:0;bottom:0;z-index:100;background-color:rgba(64, 62, 62, 0.9);background-position:center center;background-size:contain;background-repeat:no-repeat}";var MiyaokaLightbox=function(){function t(t){registerInstance(this,t);this.visible=false}t.prototype.render=function(){var t=this;return h(Host,null,h("div",{onClick:function(){return t.visible=true},class:"container"},this.visible&&h("div",{onClick:function(e){e.stopPropagation();t.visible=false},class:"backdrop",style:{"background-image":"url("+this.src+")"}}),h("slot",null)))};return t}();MiyaokaLightbox.style=miyaokaLightboxCss;export{MiyaokaEmbedTweet as miyaoka_embed_tweet,MiyaokaImgLoader as miyaoka_img_loader,MiyaokaLightbox as miyaoka_lightbox}; | ||
var __awaiter=this&&this.__awaiter||function(t,e,i,r){function n(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,o){function a(t){try{c(r.next(t))}catch(e){o(e)}}function s(t){try{c(r["throw"](t))}catch(e){o(e)}}function c(t){t.done?i(t.value):n(t.value).then(a,s)}c((r=r.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,n,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(t){return function(e){return c([t,e])}}function c(a){if(r)throw new TypeError("Generator is already executing.");while(i)try{if(r=1,n&&(o=a[0]&2?n["return"]:a[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;if(n=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:i.label++;return{value:a[1],done:false};case 5:i.label++;n=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(o=i.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(a[0]===6&&i.label<o[1]){i.label=o[1];o=a;break}if(o&&i.label<o[2]){i.label=o[2];i.ops.push(a);break}if(o[2])i.ops.pop();i.trys.pop();continue}a=e.call(t,i)}catch(s){a=[6,s];n=0}finally{r=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,h,H as Host,g as getElement}from"./index-b55763d8.js";function loadScript(t){var e=t.src,i=t.id;var r=i?document.getElementById(i):null;return new Promise((function(t,n){if(r){t()}var o=document.createElement("script");o.setAttribute("src",e);document.head.appendChild(o);o.onload=function(){if(i)o.setAttribute("id",i);t()};o.onerror=function(t){return n(t)}}))}var miyaokaEmbedTweetCss=":host{display:block}";var twReg=new RegExp("https://twitter.com/[^/]+/status/(\\d+)");var twWidgetSrc="https://platform.twitter.com/widgets.js";var MiyaokaEmbedTweet=function(){function t(t){registerInstance(this,t);this.src=""}t.prototype.connectedCallback=function(){var t=this;var e=this.src.match(twReg);if(!e)return;var i=e[1];var r=new IntersectionObserver((function(e){e.forEach((function(e){if(!e.isIntersecting)return;r.unobserve(t.el);t.embedTweet(i)}))}),{rootMargin:"200%"});r.observe(this.el)};t.prototype.embedTweet=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r,n;return __generator(this,(function(o){switch(o.label){case 0:n=window;if(!!((e=n.twttr)===null||e===void 0?void 0:e.ready))return[3,2];return[4,loadScript({src:twWidgetSrc,id:"twitter-widgets"})];case 1:o.sent();o.label=2;case 2:return[4,(r=(i=n.twttr)===null||i===void 0?void 0:i.widgets)===null||r===void 0?void 0:r.createTweet(t,this.el,{align:"center"})];case 3:o.sent();this.el.children[0].remove();this.el.classList.add("embedTweetLoaded");return[2]}}))}))};t.prototype.render=function(){return h(Host,null,h("p",null,h("a",{href:this.src,target:"_blank",rel:"noopener noreferrer"},this.src)))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();MiyaokaEmbedTweet.style=miyaokaEmbedTweetCss;var miyaokaImgLoaderCss=":host{width:100%;height:100%;overflow:hidden}img{width:100%;height:100%}";var MiyaokaImgLoader=function(){function t(t){registerInstance(this,t);this.alt="image";this.loading="lazy";this.scale=.5;this.rotate=90;this.opacity=0;this.duration=200;this.delay=50;this.isLoaded=false}t.prototype.componentDidLoad=function(){var t=this;if(!this.img)return;if(this.img.complete){requestAnimationFrame((function(){return t.resetTransform()}));return}this.img.onload=function(){t.resetTransform()}};t.prototype.resetTransform=function(){this.isLoaded=true};t.prototype.render=function(){var t=this;var e=this.isLoaded?{}:{transform:"scale("+this.scale+") rotate("+this.rotate+"deg)",opacity:""+this.opacity};return h(Host,null,h("img",{ref:function(e){t.img=e},src:this.src,alt:this.alt,loading:this.loading,style:Object.assign(Object.assign({},e),{transitionDuration:this.duration+"ms",transitionDelay:this.delay+"ms"})}))};return t}();MiyaokaImgLoader.style=miyaokaImgLoaderCss;var miyaokaLightboxCss=":host{display:block}.container{cursor:pointer;display:inline}.backdrop{position:fixed;top:0;right:0;left:0;bottom:0;z-index:100;background-color:rgba(64, 62, 62, 0.9)}.backdrop img{width:100%;height:100%;-o-object-fit:contain;object-fit:contain}";var MiyaokaLightbox=function(){function t(t){registerInstance(this,t);this.visible=false}t.prototype.render=function(){var t=this;return h(Host,null,h("div",{onClick:function(){return t.visible=true},class:"container"},this.visible&&h("div",{onClick:function(e){e.stopPropagation();t.visible=false},class:"backdrop"},h("img",{src:this.src})),h("slot",null)))};return t}();MiyaokaLightbox.style=miyaokaLightboxCss;export{MiyaokaEmbedTweet as miyaoka_embed_tweet,MiyaokaImgLoader as miyaoka_img_loader,MiyaokaLightbox as miyaoka_lightbox}; |
@@ -109,3 +109,3 @@ import { r as registerInstance, h, H as Host, g as getElement } from './index-b55763d8.js'; | ||
const miyaokaLightboxCss = ":host{display:block}.container{cursor:pointer;display:inline}.backdrop{position:fixed;top:0;right:0;left:0;bottom:0;z-index:100;background-color:rgba(64, 62, 62, 0.9);background-position:center center;background-size:contain;background-repeat:no-repeat}"; | ||
const miyaokaLightboxCss = ":host{display:block}.container{cursor:pointer;display:inline}.backdrop{position:fixed;top:0;right:0;left:0;bottom:0;z-index:100;background-color:rgba(64, 62, 62, 0.9)}.backdrop img{width:100%;height:100%;-o-object-fit:contain;object-fit:contain}"; | ||
@@ -121,5 +121,3 @@ const MiyaokaLightbox = class { | ||
this.visible = false; | ||
}, class: "backdrop", style: { | ||
'background-image': `url(${this.src})`, | ||
} })), h("slot", null)))); | ||
}, class: "backdrop" }, h("img", { src: this.src }))), h("slot", null)))); | ||
} | ||
@@ -126,0 +124,0 @@ }; |
@@ -1,1 +0,1 @@ | ||
import{p as a,w as t,d as e,N as o,a as s,b as r}from"./p-6f554d76.js";(()=>{a.t=t.__cssshim;const r=Array.from(e.querySelectorAll("script")).find((a=>new RegExp(`/${o}(\\.esm)?\\.js($|\\?|#)`).test(a.src)||a.getAttribute("data-stencil-namespace")===o)),i=r["data-opts"]||{};return"onbeforeload"in r&&!history.scrollRestoration?{then(){}}:(i.resourcesUrl=new URL(".",new URL(r.getAttribute("data-resources-url")||r.src,t.location.href)).href,((a,s)=>{const r=`__sc_import_${o.replace(/\s|-/g,"_")}`;try{t[r]=new Function("w",`return import(w);//${Math.random()}`)}catch(i){const o=new Map;t[r]=i=>{const n=new URL(i,a).href;let c=o.get(n);if(!c){const a=e.createElement("script");a.type="module",a.crossOrigin=s.crossOrigin,a.src=URL.createObjectURL(new Blob([`import * as m from '${n}'; window.${r}.m = m;`],{type:"application/javascript"})),c=new Promise((e=>{a.onload=()=>{e(t[r].m),a.remove()}})),o.set(n,c),e.head.appendChild(a)}return c}}})(i.resourcesUrl,r),t.customElements?s(i):__sc_import_miyaoka_components("./p-db46d0d3.js").then((()=>i)))})().then((a=>r([["p-849d1415",[[0,"miyaoka-embed-tweet",{src:[1]}],[1,"miyaoka-img-loader",{src:[1],alt:[1],loading:[1],scale:[2],rotate:[2],opacity:[2],duration:[2],delay:[2],img:[32],isLoaded:[32]}],[1,"miyaoka-lightbox",{src:[1],visible:[32]}]]]],a))); | ||
import{p as a,w as t,d as e,N as o,a as s,b as r}from"./p-6f554d76.js";(()=>{a.t=t.__cssshim;const r=Array.from(e.querySelectorAll("script")).find((a=>new RegExp(`/${o}(\\.esm)?\\.js($|\\?|#)`).test(a.src)||a.getAttribute("data-stencil-namespace")===o)),i=r["data-opts"]||{};return"onbeforeload"in r&&!history.scrollRestoration?{then(){}}:(i.resourcesUrl=new URL(".",new URL(r.getAttribute("data-resources-url")||r.src,t.location.href)).href,((a,s)=>{const r=`__sc_import_${o.replace(/\s|-/g,"_")}`;try{t[r]=new Function("w",`return import(w);//${Math.random()}`)}catch(i){const o=new Map;t[r]=i=>{const n=new URL(i,a).href;let c=o.get(n);if(!c){const a=e.createElement("script");a.type="module",a.crossOrigin=s.crossOrigin,a.src=URL.createObjectURL(new Blob([`import * as m from '${n}'; window.${r}.m = m;`],{type:"application/javascript"})),c=new Promise((e=>{a.onload=()=>{e(t[r].m),a.remove()}})),o.set(n,c),e.head.appendChild(a)}return c}}})(i.resourcesUrl,r),t.customElements?s(i):__sc_import_miyaoka_components("./p-db46d0d3.js").then((()=>i)))})().then((a=>r([["p-70200f72",[[0,"miyaoka-embed-tweet",{src:[1]}],[1,"miyaoka-img-loader",{src:[1],alt:[1],loading:[1],scale:[2],rotate:[2],opacity:[2],duration:[2],delay:[2],img:[32],isLoaded:[32]}],[1,"miyaoka-lightbox",{src:[1],visible:[32]}]]]],a))); |
@@ -1,1 +0,1 @@ | ||
System.register(["./p-c026672b.system.js"],(function(e,r){"use strict";var t,n,i,s,a,o;return{setters:[function(e){t=e.p;n=e.w;i=e.d;s=e.N;a=e.a;o=e.b}],execute:function(){var e=function(e){return"__sc_import_"+e.replace(/\s|-/g,"_")};var c=function(){{t.$cssShim$=n.__cssshim}var e=Array.from(i.querySelectorAll("script")).find((function(e){return new RegExp("/"+s+"(\\.esm)?\\.js($|\\?|#)").test(e.src)||e.getAttribute("data-stencil-namespace")===s}));var o=e["data-opts"]||{};if("onbeforeload"in e&&!history.scrollRestoration){return{then:function(){}}}{o.resourcesUrl=new URL(".",new URL(e.getAttribute("data-resources-url")||e.src,n.location.href)).href;{u(o.resourcesUrl,e)}if(!n.customElements){return r.import("./p-9b1d8162.system.js").then((function(){return o}))}}return a(o)};var u=function(r,t){var a=e(s);try{n[a]=new Function("w","return import(w);//"+Math.random())}catch(c){var o=new Map;n[a]=function(e){var s=new URL(e,r).href;var c=o.get(s);if(!c){var u=i.createElement("script");u.type="module";u.crossOrigin=t.crossOrigin;u.src=URL.createObjectURL(new Blob(["import * as m from '"+s+"'; window."+a+".m = m;"],{type:"application/javascript"}));c=new Promise((function(e){u.onload=function(){e(n[a].m);u.remove()}}));o.set(s,c);i.head.appendChild(u)}return c}}};c().then((function(e){return o([["p-8a59a019.system",[[0,"miyaoka-embed-tweet",{src:[1]}],[1,"miyaoka-img-loader",{src:[1],alt:[1],loading:[1],scale:[2],rotate:[2],opacity:[2],duration:[2],delay:[2],img:[32],isLoaded:[32]}],[1,"miyaoka-lightbox",{src:[1],visible:[32]}]]]],e)}))}}})); | ||
System.register(["./p-c026672b.system.js"],(function(e,r){"use strict";var t,n,i,s,o,a;return{setters:[function(e){t=e.p;n=e.w;i=e.d;s=e.N;o=e.a;a=e.b}],execute:function(){var e=function(e){return"__sc_import_"+e.replace(/\s|-/g,"_")};var c=function(){{t.$cssShim$=n.__cssshim}var e=Array.from(i.querySelectorAll("script")).find((function(e){return new RegExp("/"+s+"(\\.esm)?\\.js($|\\?|#)").test(e.src)||e.getAttribute("data-stencil-namespace")===s}));var a=e["data-opts"]||{};if("onbeforeload"in e&&!history.scrollRestoration){return{then:function(){}}}{a.resourcesUrl=new URL(".",new URL(e.getAttribute("data-resources-url")||e.src,n.location.href)).href;{u(a.resourcesUrl,e)}if(!n.customElements){return r.import("./p-9b1d8162.system.js").then((function(){return a}))}}return o(a)};var u=function(r,t){var o=e(s);try{n[o]=new Function("w","return import(w);//"+Math.random())}catch(c){var a=new Map;n[o]=function(e){var s=new URL(e,r).href;var c=a.get(s);if(!c){var u=i.createElement("script");u.type="module";u.crossOrigin=t.crossOrigin;u.src=URL.createObjectURL(new Blob(["import * as m from '"+s+"'; window."+o+".m = m;"],{type:"application/javascript"}));c=new Promise((function(e){u.onload=function(){e(n[o].m);u.remove()}}));a.set(s,c);i.head.appendChild(u)}return c}}};c().then((function(e){return a([["p-075c098f.system",[[0,"miyaoka-embed-tweet",{src:[1]}],[1,"miyaoka-img-loader",{src:[1],alt:[1],loading:[1],scale:[2],rotate:[2],opacity:[2],duration:[2],delay:[2],img:[32],isLoaded:[32]}],[1,"miyaoka-lightbox",{src:[1],visible:[32]}]]]],e)}))}}})); |
{ | ||
"name": "@miyaoka/miyaoka-components", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "Stencil Component Starter", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
743240
8036