Skip to content

Commit 05313fb

Browse files
committed
bump release
1 parent df93855 commit 05313fb

File tree

4 files changed

+24
-82
lines changed

4 files changed

+24
-82
lines changed

dist/presenta.js

Lines changed: 14 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
// https://lib.presenta.cc v1.0.20 - BSD-3-Clause License - Copyright 2022 Fabio Franchino
1+
// https://lib.presenta.cc v1.0.21 - BSD-3-Clause License - Copyright 2022 Fabio Franchino
22
(function (global, factory) {
33
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
44
typeof define === 'function' && define.amd ? define(factory) :
55
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Presenta = factory());
66
})(this, (function () { 'use strict';
77

8-
var version = "1.0.20";
8+
var version = "1.0.21";
99

1010
function styleInject(css, ref) {
1111
if ( ref === void 0 ) ref = {};
@@ -1079,7 +1079,7 @@
10791079
}
10801080
};
10811081

1082-
const appendScriptTag$1 = (url, code, id) => {
1082+
const appendScriptTag = (url, code, id) => {
10831083
const ns = document.createElement('script');
10841084
ns.setAttribute('class', 'sdpmodulescriptcontainer' + id);
10851085
ns.setAttribute('type', 'module');
@@ -1144,7 +1144,7 @@ export default {}`; // add the code module
11441144
let url = URL.createObjectURL(new Blob([code], {
11451145
type: 'application/javascript'
11461146
}));
1147-
appendScriptTag$1(url, code, id); // add the last module for callback
1147+
appendScriptTag(url, code, id); // add the last module for callback
11481148

11491149
const lastModule = `
11501150
import _sdpPrivateInput from '${url}'
@@ -1153,7 +1153,7 @@ window._sdpcallbackfunc${id}()
11531153
url = URL.createObjectURL(new Blob([lastModule], {
11541154
type: 'application/javascript'
11551155
}));
1156-
appendScriptTag$1(url, lastModule, id);
1156+
appendScriptTag(url, lastModule, id);
11571157
});
11581158
};
11591159

@@ -1315,10 +1315,10 @@ window._sdpcallbackfunc${id}()
13151315
fsize -= vf;
13161316
return setTimeout(compute);
13171317
} else {
1318+
child.classList.remove(css$9.promise);
13181319
setTimeout(() => {
1319-
child.classList.remove(css$9.promise);
13201320
resolve(that);
1321-
});
1321+
}, 2);
13221322
}
13231323
};
13241324

@@ -2311,63 +2311,6 @@ window._sdpcallbackfunc${id}()
23112311
});
23122312
};
23132313

2314-
const appendScriptTag = (url, code, id) => {
2315-
const ns = document.createElement('script');
2316-
ns.setAttribute('class', 'sctcontrollerscriptcontainer' + id);
2317-
ns.setAttribute('type', 'module');
2318-
ns.setAttribute('async', '');
2319-
ns.innerHTML = code;
2320-
ns.src = url;
2321-
document.body.appendChild(ns);
2322-
};
2323-
2324-
const ScriptRun = function (config) {
2325-
return new Promise((resolve, reject) => {
2326-
if (config.mode === 'preview' || !config.script) return resolve();
2327-
const mod = config.script;
2328-
const id = '_JSCTRL_' + parseInt(Math.random() * 10000);
2329-
window['_sctconfigobject' + id] = config;
2330-
2331-
window['_sctcallbackfunc' + id] = () => {
2332-
window['_sctcallbackfunc' + id] = null;
2333-
window['_sctconfigobject' + id] = null;
2334-
const prev = [...document.querySelectorAll('.sctcontrollerscriptcontainer' + id)];
2335-
prev.forEach(d => document.body.removeChild(d));
2336-
resolve();
2337-
};
2338-
2339-
let code = `
2340-
const config = window._sctconfigobject${id}
2341-
`;
2342-
code += `
2343-
2344-
${mod.header}
2345-
2346-
try{
2347-
2348-
${mod.code}
2349-
2350-
}catch(err){
2351-
console.log('error in controller', err)
2352-
}
2353-
export default {}`; // add the code module
2354-
2355-
let url = URL.createObjectURL(new Blob([code], {
2356-
type: 'application/javascript'
2357-
}));
2358-
appendScriptTag(url, code, id); // add the last module for callback
2359-
2360-
const lastModule = `
2361-
import _sctPrivateInput from '${url}'
2362-
window._sctcallbackfunc${id}()
2363-
`;
2364-
url = URL.createObjectURL(new Blob([lastModule], {
2365-
type: 'application/javascript'
2366-
}));
2367-
appendScriptTag(url, lastModule, id);
2368-
});
2369-
};
2370-
23712314
var defaults = (config => {
23722315
const defaultConfig = {
23732316
aspect: 1.6,
@@ -2562,15 +2505,14 @@ window._sctcallbackfunc${id}()
25622505
config._root = root;
25632506
const splash = new Splash(root, config);
25642507
return new Promise((resolve, reject) => {
2565-
new ScriptRun(config).then(() => {
2566-
new Install(config.plugins).then(() => {
2567-
const all = pluginsInit(config);
2568-
Promise.all(all).then(values => {
2569-
resolve(new Container(root, config));
2570-
splash.destroy();
2571-
});
2508+
// new ScriptRun(config).then(() => {
2509+
new Install(config.plugins).then(() => {
2510+
const all = pluginsInit(config);
2511+
Promise.all(all).then(values => {
2512+
resolve(new Container(root, config));
2513+
splash.destroy();
25722514
});
2573-
});
2515+
}); // })
25742516
});
25752517
};
25762518

dist/presenta.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/blocks/text/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,10 @@ const text = function (el, config) {
121121
fsize -= vf
122122
return setTimeout(compute)
123123
} else {
124+
child.classList.remove(css.promise)
124125
setTimeout(() => {
125-
child.classList.remove(css.promise)
126126
resolve(that)
127-
})
127+
}, 2)
128128
}
129129
}
130130

src/index.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ const Presenta = function (el, config) {
4343
const splash = new Splash(root, config)
4444

4545
return new Promise((resolve, reject) => {
46-
new ScriptRun(config).then(() => {
47-
new Install(config.plugins).then(() => {
48-
const all = pluginsInit(config)
49-
Promise.all(all).then(values => {
50-
resolve(new Container(root, config))
51-
splash.destroy()
52-
})
46+
// new ScriptRun(config).then(() => {
47+
new Install(config.plugins).then(() => {
48+
const all = pluginsInit(config)
49+
Promise.all(all).then(values => {
50+
resolve(new Container(root, config))
51+
splash.destroy()
5352
})
5453
})
54+
// })
5555
})
5656
}
5757

0 commit comments

Comments
 (0)