Skip to content

Commit 947423d

Browse files
committed
bump release
1 parent e996821 commit 947423d

File tree

2 files changed

+4
-87
lines changed

2 files changed

+4
-87
lines changed

dist/presenta.js

Lines changed: 3 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
// https://lib.presenta.cc v1.0.22 - BSD-3-Clause License - Copyright 2022 Fabio Franchino
1+
// https://lib.presenta.cc v1.0.23 - 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.22";
8+
var version = "1.0.23";
99

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

1082-
const appendScriptTag = (url, code, id) => {
1083-
const ns = document.createElement('script');
1084-
ns.setAttribute('class', 'sdpmodulescriptcontainer' + id);
1085-
ns.setAttribute('type', 'module');
1086-
ns.setAttribute('async', '');
1087-
ns.innerHTML = code;
1088-
ns.src = url;
1089-
document.body.appendChild(ns);
1090-
};
1091-
1092-
const script = function (element, mod, config) {
1093-
if (!mod.forceRun && config._mode === 'preview') return;
1094-
if (!mod.code) return;
1095-
if (config.contextType !== 'scene') return;
1096-
const id = '_JSMOD_' + parseInt(Math.random() * 10000);
1097-
const that = this;
1098-
1099-
this.destroy = () => {
1100-
const prev = [...document.querySelectorAll('.sdpmodulescriptcontainer' + id)];
1101-
prev.forEach(d => document.body.removeChild(d));
1102-
};
1103-
1104-
return new Promise((resolve, reject) => {
1105-
const blink = {};
1106-
config.blocks.forEach(b => {
1107-
blink[b.ukey] = b;
1108-
});
1109-
blink._otherParams = config.otherParams;
1110-
window['_sdpconfigobject' + id] = blink; // window['_sdpscriptexportedresult' + id] = {}
1111-
1112-
window['_sdpcallbackfunc' + id] = () => {
1113-
console.log('_sdpcallbackfunc' + id);
1114-
window['_sdpcallbackfunc' + id] = null;
1115-
window['_sdpconfigobject' + id] = null;
1116-
resolve(that);
1117-
};
1118-
1119-
let code = `
1120-
const index = ${config.index}
1121-
//const exportedResult = window._sdpscriptexportedresult${id}
1122-
1123-
const params = window._sdpconfigobject${id}._otherParams
1124-
`;
1125-
config.blocks.forEach(b => {
1126-
if (b.ukey) {
1127-
code += `
1128-
const ${b.ukey} = window._sdpconfigobject${id}.${b.ukey}
1129-
`;
1130-
}
1131-
});
1132-
code += `
1133-
1134-
${mod.header}
1135-
1136-
try{
1137-
1138-
${mod.code}
1139-
1140-
}catch(err){
1141-
console.log('error in module', err)
1142-
}
1143-
export default {}`; // add the code module
1144-
1145-
let url = URL.createObjectURL(new Blob([code], {
1146-
type: 'application/javascript'
1147-
}));
1148-
appendScriptTag(url, code, id); // add the last module for callback
1149-
1150-
const lastModule = `
1151-
import _sdpPrivateInput from '${url}'
1152-
window._sdpcallbackfunc${id}()
1153-
`;
1154-
url = URL.createObjectURL(new Blob([lastModule], {
1155-
type: 'application/javascript'
1156-
}));
1157-
appendScriptTag(url, lastModule, id);
1158-
});
1159-
};
1160-
1161-
script.runBefore = true;
1162-
11631082
const showif = function (element, mod, config) {
11641083
const {
11651084
key,
@@ -1204,7 +1123,6 @@ window._sdpcallbackfunc${id}()
12041123
autoplay,
12051124
reveal,
12061125
enters,
1207-
script,
12081126
link,
12091127
showif,
12101128
hidden
@@ -2506,14 +2424,13 @@ window._sdpcallbackfunc${id}()
25062424
config._root = root;
25072425
const splash = new Splash(root, config);
25082426
return new Promise((resolve, reject) => {
2509-
// new ScriptRun(config).then(() => {
25102427
new Install(config.plugins).then(() => {
25112428
const all = pluginsInit(config);
25122429
Promise.all(all).then(values => {
25132430
resolve(new Container(root, config));
25142431
splash.destroy();
25152432
});
2516-
}); // })
2433+
});
25172434
});
25182435
};
25192436

0 commit comments

Comments
 (0)