@htmlbricks/hb-modal-video 0.7.7 → 0.7.8
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/package.json +3 -3
- package/release/release.js +1 -1
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@htmlbricks/hb-modal-video",
|
|
3
3
|
"displayName": "Svelte-Bootstrap Video Modal WebComponent",
|
|
4
4
|
"description": "Svelte-Bootstrap Video Modal WebComponent",
|
|
5
|
-
"version": "0.7.
|
|
5
|
+
"version": "0.7.8",
|
|
6
6
|
"main": "release/release.js",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"prepublish": "npm run build:release"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@htmlbricks/hb-jsutils": "^0.7.
|
|
30
|
+
"@htmlbricks/hb-jsutils": "^0.7.8",
|
|
31
31
|
"@rollup/plugin-alias": "^3.1.2",
|
|
32
32
|
"@rollup/plugin-commonjs": "^18.0.0",
|
|
33
33
|
"@rollup/plugin-json": "^4.1.0",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"webcomponents"
|
|
72
72
|
],
|
|
73
73
|
"contributors": [],
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "8d5d3227354adbee75d50012b9c05fe0e8a7304d"
|
|
75
75
|
}
|
package/release/release.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var release=function(){"use strict";function t(){}function e(t){return t()}function n(){return Object.create(null)}function o(t){t.forEach(e)}function r(t){return"function"==typeof t}function i(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}let s,c;function a(t,e){return s||(s=document.createElement("a")),s.href=e,t===s.href}function l(t,e){t.appendChild(e)}function u(t,e,n){t.insertBefore(e,n||null)}function d(t){t.parentNode.removeChild(t)}function f(t){return document.createElement(t)}function h(t){return document.createTextNode(t)}function p(){return h(" ")}function m(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function g(t,e,n){e in t?t[e]="boolean"==typeof t[e]&&""===n||n:m(t,e,n)}function v(t,e,n,o){null===n?t.style.removeProperty(e):t.style.setProperty(e,n,o?"important":"")}function $(t){const e={};for(const n of t)e[n.name]=n.value;return e}function y(t){c=t}function b(){if(!c)throw new Error("Function called outside component initialization");return c}function w(){const t=b();return(e,n)=>{const o=t.$$.callbacks[e];if(o){const r=function(t,e,n=!1){const o=document.createEvent("CustomEvent");return o.initCustomEvent(t,n,!1,e),o}(e,n);o.slice().forEach((e=>{e.call(t,r)}))}}}const E=[],x=[],_=[],k=[],C=Promise.resolve();let L=!1;function T(t){_.push(t)}const D=new Set;let j=0;function M(){const t=c;do{for(;j<E.length;){const t=E[j];j++,y(t),O(t.$$)}for(y(null),E.length=0,j=0;x.length;)x.pop()();for(let t=0;t<_.length;t+=1){const e=_[t];D.has(e)||(D.add(e),e())}_.length=0}while(E.length);for(;k.length;)k.pop()();L=!1,D.clear(),y(t)}function O(t){if(null!==t.fragment){t.update(),o(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(T)}}const S=new Set;function A(t,e){-1===t.$$.dirty[0]&&(E.push(t),L||(L=!0,C.then(M)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function P(i,s,a,l,u,f,h,p=[-1]){const m=c;y(i);const g=i.$$={fragment:null,ctx:null,props:f,update:t,not_equal:u,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(s.context||(m?m.$$.context:[])),callbacks:n(),dirty:p,skip_bound:!1,root:s.target||m.$$.root};h&&h(g.root);let v=!1;if(g.ctx=a?a(i,s.props||{},((t,e,...n)=>{const o=n.length?n[0]:e;return g.ctx&&u(g.ctx[t],g.ctx[t]=o)&&(!g.skip_bound&&g.bound[t]&&g.bound[t](o),v&&A(i,t)),e})):[],g.update(),v=!0,o(g.before_update),g.fragment=!!l&&l(g.ctx),s.target){if(s.hydrate){const t=function(t){return Array.from(t.childNodes)}(s.target);g.fragment&&g.fragment.l(t),t.forEach(d)}else g.fragment&&g.fragment.c();s.intro&&(($=i.$$.fragment)&&$.i&&(S.delete($),$.i(b))),function(t,n,i,s){const{fragment:c,on_mount:a,on_destroy:l,after_update:u}=t.$$;c&&c.m(n,i),s||T((()=>{const n=a.map(e).filter(r);l?l.push(...n):o(n),t.$$.on_mount=[]})),u.forEach(T)}(i,s.target,s.anchor,s.customElement),M()}var $,b;y(m)}let N;"function"==typeof HTMLElement&&(N=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(e).filter(r);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){o(this.$$.on_disconnect)}$destroy(){!function(t,e){const n=t.$$;null!==n.fragment&&(o(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}(this,1),this.$destroy=t}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});var R,F,H=(R=function(t,e){e.__esModule=!0,e.LanguageTranslator=e.addComponent=e.getChildStyleToPass=void 0,e.getChildStyleToPass=function(t,e){var n,o,r="";if(t&&(null==e?void 0:e.length)&&(null===(n=Object.keys(t))||void 0===n?void 0:n.length)&&(null===(o=null==e?void 0:e.filter((function(e){return Object.keys(t).includes(e.name)})))||void 0===o?void 0:o.length))for(var i=function(n){(null==e?void 0:e.filter((function(e){return e.name===n&&e.defaultValue!==t[n]})))&&(r+="".concat(n,":").concat(t[n],";"))},s=0,c=Object.keys(t);s<c.length;s++)i(c[s]);return r},e.addComponent=function(t,e,n){if(!document.getElementById("hb-"+t+"-script")){var o=document.createElement("script");o.id="hb-"+t+"-script",o.src="https://cdn.jsdelivr.net/npm/@htmlbricks/hb-".concat(t,"@").concat(e,"/release/release.js"),n&&location.href.includes("localhost")&&(o.src="http://localhost:6006/".concat(t,"/dist/release.js")),document.head.appendChild(o)}};var n=function(){function t(t){if(!(null==t?void 0:t.dictionary))throw new Error("no dictionary provided");this.dictionary=t.dictionary,this.setLang(null==t?void 0:t.lang)}return t.prototype.setLang=function(e){e||(e=t.getDefaultLang()),this.lang=e},t.prototype.translateWord=function(e,n){return t.getDictionaryWord(e,this.dictionary,n||this.lang)},t.prototype.translateDate=function(e,n,o){return t.formatDate(e,n,o||this.lang)},t.getDefaultLang=function(){var t,e,n,o,r,i="en";return(null===navigator||void 0===navigator?void 0:navigator.languages)&&(null===(n=null===(e=null===(t=navigator.languages[0])||void 0===t?void 0:t.split("-")[0])||void 0===e?void 0:e.toLowerCase())||void 0===n?void 0:n.length)&&(i=null===(r=null===(o=navigator.languages[0])||void 0===o?void 0:o.split("-")[0])||void 0===r?void 0:r.toLowerCase()),i},t.getDictionaryWord=function(e,n,o){var r;if(!e)throw new Error("no wordKey provided");if(!n)throw new Error("no dictionary provided");if(o&&(null===(r=n[o])||void 0===r?void 0:r[e]))return n[o][e];var i="",s=t.getDefaultLang();if(!o||s!==o){var c=null==n?void 0:n[s];(null==c?void 0:c[e])&&(i=c[e])}return i},t.formatDate=function(e,n,o){if(!e)throw new Error("no date provided");if("function"!=typeof e.getMonth)throw new Error("wrong date format");return new Intl.DateTimeFormat(o||t.getDefaultLang(),n).format(e)},t}();e.LanguageTranslator=n},R(F={exports:{}},F.exports),F.exports),W="0.7.
|
|
1
|
+
var release=function(){"use strict";function t(){}function e(t){return t()}function n(){return Object.create(null)}function o(t){t.forEach(e)}function r(t){return"function"==typeof t}function i(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}let s,c;function a(t,e){return s||(s=document.createElement("a")),s.href=e,t===s.href}function l(t,e){t.appendChild(e)}function u(t,e,n){t.insertBefore(e,n||null)}function d(t){t.parentNode.removeChild(t)}function f(t){return document.createElement(t)}function h(t){return document.createTextNode(t)}function p(){return h(" ")}function m(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function g(t,e,n){e in t?t[e]="boolean"==typeof t[e]&&""===n||n:m(t,e,n)}function v(t,e,n,o){null===n?t.style.removeProperty(e):t.style.setProperty(e,n,o?"important":"")}function $(t){const e={};for(const n of t)e[n.name]=n.value;return e}function y(t){c=t}function b(){if(!c)throw new Error("Function called outside component initialization");return c}function w(){const t=b();return(e,n)=>{const o=t.$$.callbacks[e];if(o){const r=function(t,e,n=!1){const o=document.createEvent("CustomEvent");return o.initCustomEvent(t,n,!1,e),o}(e,n);o.slice().forEach((e=>{e.call(t,r)}))}}}const E=[],x=[],_=[],k=[],C=Promise.resolve();let L=!1;function T(t){_.push(t)}const D=new Set;let j=0;function M(){const t=c;do{for(;j<E.length;){const t=E[j];j++,y(t),O(t.$$)}for(y(null),E.length=0,j=0;x.length;)x.pop()();for(let t=0;t<_.length;t+=1){const e=_[t];D.has(e)||(D.add(e),e())}_.length=0}while(E.length);for(;k.length;)k.pop()();L=!1,D.clear(),y(t)}function O(t){if(null!==t.fragment){t.update(),o(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(T)}}const S=new Set;function A(t,e){-1===t.$$.dirty[0]&&(E.push(t),L||(L=!0,C.then(M)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function P(i,s,a,l,u,f,h,p=[-1]){const m=c;y(i);const g=i.$$={fragment:null,ctx:null,props:f,update:t,not_equal:u,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(s.context||(m?m.$$.context:[])),callbacks:n(),dirty:p,skip_bound:!1,root:s.target||m.$$.root};h&&h(g.root);let v=!1;if(g.ctx=a?a(i,s.props||{},((t,e,...n)=>{const o=n.length?n[0]:e;return g.ctx&&u(g.ctx[t],g.ctx[t]=o)&&(!g.skip_bound&&g.bound[t]&&g.bound[t](o),v&&A(i,t)),e})):[],g.update(),v=!0,o(g.before_update),g.fragment=!!l&&l(g.ctx),s.target){if(s.hydrate){const t=function(t){return Array.from(t.childNodes)}(s.target);g.fragment&&g.fragment.l(t),t.forEach(d)}else g.fragment&&g.fragment.c();s.intro&&(($=i.$$.fragment)&&$.i&&(S.delete($),$.i(b))),function(t,n,i,s){const{fragment:c,on_mount:a,on_destroy:l,after_update:u}=t.$$;c&&c.m(n,i),s||T((()=>{const n=a.map(e).filter(r);l?l.push(...n):o(n),t.$$.on_mount=[]})),u.forEach(T)}(i,s.target,s.anchor,s.customElement),M()}var $,b;y(m)}let N;"function"==typeof HTMLElement&&(N=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(e).filter(r);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){o(this.$$.on_disconnect)}$destroy(){!function(t,e){const n=t.$$;null!==n.fragment&&(o(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}(this,1),this.$destroy=t}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});var R,F,H=(R=function(t,e){e.__esModule=!0,e.LanguageTranslator=e.addComponent=e.getChildStyleToPass=void 0,e.getChildStyleToPass=function(t,e){var n,o,r="";if(t&&(null==e?void 0:e.length)&&(null===(n=Object.keys(t))||void 0===n?void 0:n.length)&&(null===(o=null==e?void 0:e.filter((function(e){return Object.keys(t).includes(e.name)})))||void 0===o?void 0:o.length))for(var i=function(n){(null==e?void 0:e.filter((function(e){return e.name===n&&e.defaultValue!==t[n]})))&&(r+="".concat(n,":").concat(t[n],";"))},s=0,c=Object.keys(t);s<c.length;s++)i(c[s]);return r},e.addComponent=function(t,e,n){if(!document.getElementById("hb-"+t+"-script")){var o=document.createElement("script");o.id="hb-"+t+"-script",o.src="https://cdn.jsdelivr.net/npm/@htmlbricks/hb-".concat(t,"@").concat(e,"/release/release.js"),n&&location.href.includes("localhost")&&(o.src="http://localhost:6006/".concat(t,"/dist/release.js")),document.head.appendChild(o)}};var n=function(){function t(t){if(!(null==t?void 0:t.dictionary))throw new Error("no dictionary provided");this.dictionary=t.dictionary,this.setLang(null==t?void 0:t.lang)}return t.prototype.setLang=function(e){e||(e=t.getDefaultLang()),this.lang=e},t.prototype.translateWord=function(e,n){return t.getDictionaryWord(e,this.dictionary,n||this.lang)},t.prototype.translateDate=function(e,n,o){return t.formatDate(e,n,o||this.lang)},t.getDefaultLang=function(){var t,e,n,o,r,i="en";return(null===navigator||void 0===navigator?void 0:navigator.languages)&&(null===(n=null===(e=null===(t=navigator.languages[0])||void 0===t?void 0:t.split("-")[0])||void 0===e?void 0:e.toLowerCase())||void 0===n?void 0:n.length)&&(i=null===(r=null===(o=navigator.languages[0])||void 0===o?void 0:o.split("-")[0])||void 0===r?void 0:r.toLowerCase()),i},t.getDictionaryWord=function(e,n,o){var r;if(!e)throw new Error("no wordKey provided");if(!n)throw new Error("no dictionary provided");if(o&&(null===(r=n[o])||void 0===r?void 0:r[e]))return n[o][e];var i="",s=t.getDefaultLang();if(!o||s!==o){var c=null==n?void 0:n[s];(null==c?void 0:c[e])&&(i=c[e])}return i},t.formatDate=function(e,n,o){if(!e)throw new Error("no date provided");if("function"!=typeof e.getMonth)throw new Error("wrong date format");return new Intl.DateTimeFormat(o||t.getDefaultLang(),n).format(e)},t}();e.LanguageTranslator=n},R(F={exports:{}},F.exports),F.exports),W="0.7.8";function B(t){let e,n,o,r;return{c(){e=f("span"),n=f("slot"),o=h("Video: "),r=h(t[2]),m(n,"name","title"),m(e,"slot","title")},m(t,i){u(t,e,i),l(e,n),l(n,o),l(n,r)},p(t,e){4&e&&function(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}(r,t[2])},d(t){t&&d(e)}}}function I(t){let e;function n(t,e){return"youtube"===t[3]?Y:V}let o=n(t),r=o(t);return{c(){r.c(),e=h("")},m(t,n){r.m(t,n),u(t,e,n)},p(t,i){o===(o=n(t))&&r?r.p(t,i):(r.d(1),r=o(t),r&&(r.c(),r.m(e.parentNode,e)))},d(t){r.d(t),t&&d(e)}}}function V(t){let e,n,o,r,i,s;return{c(){e=f("div"),n=f("video"),o=f("track"),r=f("source"),s=h("\n\t\t\t\t\t\tYour browser does not support the video tag."),m(o,"kind","captions"),a(r.src,i=t[1])||m(r,"src",i),m(r,"type","video/mp4"),n.controls=!0,v(n,"aspect-ratio","16 / 9"),v(n,"width","100%"),v(e,"aspect-ratio","16 / 9"),v(e,"width","100%"),v(e,"text-align","center"),v(e,"background-color","black")},m(t,i){u(t,e,i),l(e,n),l(n,o),l(n,r),l(n,s)},p(t,e){2&e&&!a(r.src,i=t[1])&&m(r,"src",i)},d(t){t&&d(e)}}}function Y(t){let e,n,o;return{c(){e=f("div"),n=f("iframe"),v(n,"border","0"),v(n,"aspect-ratio","16 / 9"),v(n,"width","100%"),a(n.src,o=t[1])||m(n,"src",o),m(n,"title","YouTube video"),n.allowFullscreen=!0,v(e,"ratio","16/9"),v(e,"width","100%"),v(e,"text-align","center")},m(t,o){u(t,e,o),l(e,n)},p(t,e){2&e&&!a(n.src,o=t[1])&&m(n,"src",o)},d(t){t&&d(e)}}}function q(e){let n,o,r,i,s,c,a,h,v=e[2]&&B(e),$=e[1]&&I(e);return{c(){n=f("hb-dialog"),v&&v.c(),o=p(),r=f("div"),$&&$.c(),i=p(),s=f("span"),this.c=t,m(r,"slot","body-content"),m(s,"slot","modal-footer"),g(n,"id",e[0]),g(n,"show",c=e[1]?"yes":"no")},m(t,c){var d,f,p,m;u(t,n,c),v&&v.m(n,null),l(n,o),l(n,r),$&&$.m(r,null),l(n,i),l(n,s),a||(d=n,f="modalShow",p=e[6],d.addEventListener(f,p,m),h=()=>d.removeEventListener(f,p,m),a=!0)},p(t,[e]){t[2]?v?v.p(t,e):(v=B(t),v.c(),v.m(n,o)):v&&(v.d(1),v=null),t[1]?$?$.p(t,e):($=I(t),$.c(),$.m(r,null)):$&&($.d(1),$=null),1&e&&g(n,"id",t[0]),2&e&&c!==(c=t[1]?"yes":"no")&&g(n,"show",c)},i:t,o:t,d(t){t&&d(n),v&&v.d(),$&&$.d(),a=!1,h()}}}function z(t,e,n){const o=b(),r=w();H.addComponent("dialog",W);let{id:i}=e,{item:s}=e,{uri:c}=e,{title:a}=e,{provider:l}=e;function u(t){t.show?n(0,s=t.id):(n(0,s=""),n(1,c=""),n(2,a="")),function(t,e){r(t,e),o.dispatchEvent&&o.dispatchEvent(new CustomEvent(t,{detail:e}))}("videoModalEvent",{id:s,show:t.show})}return t.$$set=t=>{"id"in t&&n(5,i=t.id),"item"in t&&n(0,s=t.item),"uri"in t&&n(1,c=t.uri),"title"in t&&n(2,a=t.title),"provider"in t&&n(3,l=t.provider)},t.$$.update=()=>{47&t.$$.dirty&&(i||n(5,i=null),s||n(0,s=""),c||n(1,c=""),a||n(2,a=""),l||n(3,l=""))},[s,c,a,l,u,i,t=>u(t.detail)]}class K extends N{constructor(t){super(),this.shadowRoot.innerHTML='<style>@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");:host{font-family:"Roboto", sans-serif}</style>',P(this,{target:this.shadowRoot,props:$(this.attributes),customElement:!0},z,q,i,{id:5,item:0,uri:1,title:2,provider:3},null),t&&(t.target&&u(t.target,this,t.anchor),t.props&&(this.$set(t.props),M()))}static get observedAttributes(){return["id","item","uri","title","provider"]}get id(){return this.$$.ctx[5]}set id(t){this.$$set({id:t}),M()}get item(){return this.$$.ctx[0]}set item(t){this.$$set({item:t}),M()}get uri(){return this.$$.ctx[1]}set uri(t){this.$$set({uri:t}),M()}get title(){return this.$$.ctx[2]}set title(t){this.$$set({title:t}),M()}get provider(){return this.$$.ctx[3]}set provider(t){this.$$set({provider:t}),M()}}return customElements.define("hb-modal-video",K),K}();
|
|
2
2
|
//# sourceMappingURL=release.js.map
|