Formatting and build assets

This commit is contained in:
Wout De Puysseleir 2023-07-30 09:15:44 -07:00
parent 075188e631
commit 11c5e09777
No known key found for this signature in database
GPG key ID: 3DE9371B50FEC46A
8 changed files with 22 additions and 22 deletions

View file

@ -22,7 +22,7 @@ let optsClient = {
importGlobPlugin(),
sveltePlugin({
preprocess: sveltePreprocess(),
compilerOptions: {hydratable: true, css: 'injected'},
compilerOptions: {hydratable: true, css: "injected"},
}),
],
}

View file

@ -22,7 +22,7 @@ let optsClient = {
importGlobPlugin(),
sveltePlugin({
preprocess: sveltePreprocess(),
compilerOptions: {hydratable: true, css: 'injected'},
compilerOptions: {hydratable: true, css: "injected"},
}),
],
}

View file

@ -161,7 +161,7 @@ function exportSvelteComponents(components) {
// js/live_svelte/hooks.js
function base64ToElement(base64) {
let template = document.createElement("div");
const template = document.createElement("div");
template.innerHTML = atob(base64).trim();
return template;
}
@ -206,12 +206,12 @@ function createSlots(slots, ref) {
return svelteSlots;
}
function getLiveJsonProps(ref) {
json = dataAttributeToJson("data-live-json", ref.el);
const json = dataAttributeToJson("data-live-json", ref.el);
if (typeof json === "object" && json !== null && !Array.isArray(json))
return json;
liveJsonData = {};
const liveJsonData = {};
for (const liveJsonVariable of json) {
let data = window[liveJsonVariable];
const data = window[liveJsonVariable];
if (data)
liveJsonData[liveJsonVariable] = data;
}
@ -249,7 +249,7 @@ function getHooks(Components) {
this._instance = new Component({
target: this.el,
props: getProps(this),
hydrate: true
hydrate: this.el.hasAttribute("data-ssr")
});
},
updated() {

File diff suppressed because one or more lines are too long

View file

@ -142,7 +142,7 @@ function exportSvelteComponents(components) {
// js/live_svelte/hooks.js
function base64ToElement(base64) {
let template = document.createElement("div");
const template = document.createElement("div");
template.innerHTML = atob(base64).trim();
return template;
}
@ -187,12 +187,12 @@ function createSlots(slots, ref) {
return svelteSlots;
}
function getLiveJsonProps(ref) {
json = dataAttributeToJson("data-live-json", ref.el);
const json = dataAttributeToJson("data-live-json", ref.el);
if (typeof json === "object" && json !== null && !Array.isArray(json))
return json;
liveJsonData = {};
const liveJsonData = {};
for (const liveJsonVariable of json) {
let data = window[liveJsonVariable];
const data = window[liveJsonVariable];
if (data)
liveJsonData[liveJsonVariable] = data;
}
@ -230,7 +230,7 @@ function getHooks(Components) {
this._instance = new Component({
target: this.el,
props: getProps(this),
hydrate: true
hydrate: this.el.hasAttribute("data-ssr")
});
},
updated() {

File diff suppressed because one or more lines are too long

View file

@ -185,7 +185,7 @@ var LiveSvelte = (() => {
// js/live_svelte/hooks.js
function base64ToElement(base64) {
let template = document.createElement("div");
const template = document.createElement("div");
template.innerHTML = atob(base64).trim();
return template;
}
@ -230,12 +230,12 @@ var LiveSvelte = (() => {
return svelteSlots;
}
function getLiveJsonProps(ref) {
json = dataAttributeToJson("data-live-json", ref.el);
const json = dataAttributeToJson("data-live-json", ref.el);
if (typeof json === "object" && json !== null && !Array.isArray(json))
return json;
liveJsonData = {};
const liveJsonData = {};
for (const liveJsonVariable of json) {
let data = window[liveJsonVariable];
const data = window[liveJsonVariable];
if (data)
liveJsonData[liveJsonVariable] = data;
}
@ -271,7 +271,7 @@ var LiveSvelte = (() => {
this._instance = new Component({
target: this.el,
props: getProps(this),
hydrate: true
hydrate: this.el.hasAttribute("data-ssr")
});
},
updated() {

View file

@ -1 +1 @@
var LiveSvelte=(()=>{var f=Object.defineProperty,C=Object.defineProperties,D=Object.getOwnPropertyDescriptor,T=Object.getOwnPropertyDescriptors,M=Object.getOwnPropertyNames,$=Object.getOwnPropertySymbols;var w=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable;var v=(t,e,n)=>e in t?f(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,h=(t,e)=>{for(var n in e||(e={}))w.call(e,n)&&v(t,n,e[n]);if($)for(var n of $(e))N.call(e,n)&&v(t,n,e[n]);return t},F=(t,e)=>C(t,T(e));var x=(t=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(t,{get:(e,n)=>(typeof require!="undefined"?require:e)[n]}):t)(function(t){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')});var L=(t,e)=>{for(var n in e)f(t,n,{get:e[n],enumerable:!0})},q=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of M(e))!w.call(t,o)&&o!==n&&f(t,o,{get:()=>e[o],enumerable:!(i=D(e,o))||i.enumerable});return t};var P=t=>q(f({},"__esModule",{value:!0}),t);var U={};L(U,{exportSvelteComponents:()=>d,getHooks:()=>j,render:()=>E});function E(t,e={},n=null){let i=x(__filename)[t],o=Object.fromEntries(Object.entries(n).map(([r,c])=>[r,()=>c]))||{};return i.render(e,{$$slots:o,context:new Map})}function l(){}function O(t){return t()}function A(t){t.forEach(O)}function k(t){return typeof t=="function"}function R(t){return Object.keys(t).length===0}function p(t,e,n){t.insertBefore(e,n||null)}function m(t){t.parentNode&&t.parentNode.removeChild(t)}var S=[];function I(t){let e=[],n=[];S.forEach(i=>t.indexOf(i)===-1?e.push(i):n.push(i)),n.forEach(i=>i()),S=e}var Q=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global;var B=["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","inert","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"],Z=new Set([...B]);function H(t,e){let n=t.$$;n.fragment!==null&&(I(n.after_update),A(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}var z;typeof HTMLElement=="function"&&(z=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){let{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(O).filter(k);for(let e in this.$$.slotted)this.appendChild(this.$$.slotted[e])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){A(this.$$.on_disconnect)}$destroy(){H(this,1),this.$destroy=l}$on(t,e){if(!k(e))return l;let n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{let i=n.indexOf(e);i!==-1&&n.splice(i,1)}}$set(t){this.$$set&&!R(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});function d(t){let{default:e,filenames:n}=t;return n=n.map(i=>i.replace("../svelte/","")).map(i=>i.replace(".svelte","")),Object.assign({},...e.map((i,o)=>({[n[o]]:i.default})))}function J(t){let e=document.createElement("div");return e.innerHTML=atob(t).trim(),e}function u(t,e){let n=e.getAttribute(t);return n?JSON.parse(n):{}}function G(t,e){let n=(o,r)=>{let c,y,a;return()=>({getElement(){return J(u("data-slots",r.el)[o])},update(){let s=this.getElement();m(a),p(c,s,y),a=s},c:l,m(s,g){let b=this.getElement();c=s,y=g,a=b,p(s,b,g)},d(s){s&&m(a)},l})},i={};for(let o in t)i[o]=[n(o,e)];return i}function W(t){if(json=u("data-live-json",t.el),typeof json=="object"&&json!==null&&!Array.isArray(json))return json;liveJsonData={};for(let e of json){let n=window[e];n&&(liveJsonData[e]=n)}return liveJsonData}function _(t){return F(h(h({},u("data-props",t.el)),W(t)),{pushEvent:(e,n,i)=>t.pushEvent(e,n,i),pushEventTo:(e,n,i,o)=>t.pushEventTo(e,n,i,o),$$slots:G(u("data-slots",t.el),t),$$scope:{}})}function V(t){return t.$$.ctx.find(e=>e==null?void 0:e.default)}function j(t){let e=d(t);return{SvelteHook:{mounted(){let i=this.el.getAttribute("data-name");if(!i)throw new Error("Component name must be provided");let o=e[i];if(!o)throw new Error(`Unable to find ${i} component.`);for(let r of Object.keys(u("data-live-json",this.el)))window.addEventListener(`${r}_initialized`,c=>this._instance.$set(_(this)),!1),window.addEventListener(`${r}_patched`,c=>this._instance.$set(_(this)),!1);this._instance=new o({target:this.el,props:_(this),hydrate:!0})},updated(){this._instance.$set(_(this));let i=V(this._instance);for(let o in i)i[o][0]().update()},destroyed(){}}}}return P(U);})();
var LiveSvelte=(()=>{var f=Object.defineProperty,T=Object.defineProperties,D=Object.getOwnPropertyDescriptor,M=Object.getOwnPropertyDescriptors,j=Object.getOwnPropertyNames,$=Object.getOwnPropertySymbols;var v=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable;var w=(t,e,n)=>e in t?f(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,h=(t,e)=>{for(var n in e||(e={}))v.call(e,n)&&w(t,n,e[n]);if($)for(var n of $(e))N.call(e,n)&&w(t,n,e[n]);return t},F=(t,e)=>T(t,M(e));var x=(t=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(t,{get:(e,n)=>(typeof require!="undefined"?require:e)[n]}):t)(function(t){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')});var L=(t,e)=>{for(var n in e)f(t,n,{get:e[n],enumerable:!0})},q=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of j(e))!v.call(t,o)&&o!==n&&f(t,o,{get:()=>e[o],enumerable:!(i=D(e,o))||i.enumerable});return t};var P=t=>q(f({},"__esModule",{value:!0}),t);var U={};L(U,{exportSvelteComponents:()=>d,getHooks:()=>C,render:()=>E});function E(t,e={},n=null){let i=x(__filename)[t],o=Object.fromEntries(Object.entries(n).map(([r,c])=>[r,()=>c]))||{};return i.render(e,{$$slots:o,context:new Map})}function l(){}function O(t){return t()}function A(t){t.forEach(O)}function k(t){return typeof t=="function"}function R(t){return Object.keys(t).length===0}function p(t,e,n){t.insertBefore(e,n||null)}function m(t){t.parentNode&&t.parentNode.removeChild(t)}var S=[];function I(t){let e=[],n=[];S.forEach(i=>t.indexOf(i)===-1?e.push(i):n.push(i)),n.forEach(i=>i()),S=e}var Q=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global;var B=["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","inert","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"],Z=new Set([...B]);function H(t,e){let n=t.$$;n.fragment!==null&&(I(n.after_update),A(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}var z;typeof HTMLElement=="function"&&(z=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){let{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(O).filter(k);for(let e in this.$$.slotted)this.appendChild(this.$$.slotted[e])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){A(this.$$.on_disconnect)}$destroy(){H(this,1),this.$destroy=l}$on(t,e){if(!k(e))return l;let n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{let i=n.indexOf(e);i!==-1&&n.splice(i,1)}}$set(t){this.$$set&&!R(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});function d(t){let{default:e,filenames:n}=t;return n=n.map(i=>i.replace("../svelte/","")).map(i=>i.replace(".svelte","")),Object.assign({},...e.map((i,o)=>({[n[o]]:i.default})))}function J(t){let e=document.createElement("div");return e.innerHTML=atob(t).trim(),e}function u(t,e){let n=e.getAttribute(t);return n?JSON.parse(n):{}}function G(t,e){let n=(o,r)=>{let c,y,a;return()=>({getElement(){return J(u("data-slots",r.el)[o])},update(){let s=this.getElement();m(a),p(c,s,y),a=s},c:l,m(s,g){let b=this.getElement();c=s,y=g,a=b,p(s,b,g)},d(s){s&&m(a)},l})},i={};for(let o in t)i[o]=[n(o,e)];return i}function W(t){let e=u("data-live-json",t.el);if(typeof e=="object"&&e!==null&&!Array.isArray(e))return e;let n={};for(let i of e){let o=window[i];o&&(n[i]=o)}return n}function _(t){return F(h(h({},u("data-props",t.el)),W(t)),{pushEvent:(e,n,i)=>t.pushEvent(e,n,i),pushEventTo:(e,n,i,o)=>t.pushEventTo(e,n,i,o),$$slots:G(u("data-slots",t.el),t),$$scope:{}})}function V(t){return t.$$.ctx.find(e=>e==null?void 0:e.default)}function C(t){let e=d(t);return{SvelteHook:{mounted(){let i=this.el.getAttribute("data-name");if(!i)throw new Error("Component name must be provided");let o=e[i];if(!o)throw new Error(`Unable to find ${i} component.`);for(let r of Object.keys(u("data-live-json",this.el)))window.addEventListener(`${r}_initialized`,c=>this._instance.$set(_(this)),!1),window.addEventListener(`${r}_patched`,c=>this._instance.$set(_(this)),!1);this._instance=new o({target:this.el,props:_(this),hydrate:this.el.hasAttribute("data-ssr")})},updated(){this._instance.$set(_(this));let i=V(this._instance);for(let o in i)i[o][0]().update()},destroyed(){}}}}return P(U);})();