appscms-tools-theme 3.2.0 → 3.2.1
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.
- checksums.yaml +4 -4
- data/assets/js/partytown/debug/partytown-atomics.js +1 -1
- data/assets/js/partytown/debug/partytown-sandbox-sw.js +900 -539
- data/assets/js/partytown/debug/partytown.js +108 -69
- data/assets/js/partytown/partytown-atomics.js +599 -1
- data/assets/js/partytown/partytown-sw.js +49 -1
- metadata +2 -2
@@ -1,75 +1,114 @@
|
|
1
1
|
/* Partytown 0.7.5 - MIT builder.io */
|
2
|
-
!function(
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
2
|
+
!(function (
|
3
|
+
win,
|
4
|
+
doc,
|
5
|
+
nav,
|
6
|
+
top,
|
7
|
+
useAtomics,
|
8
|
+
config,
|
9
|
+
libPath,
|
10
|
+
timeout,
|
11
|
+
scripts,
|
12
|
+
sandbox,
|
13
|
+
mainForwardFn,
|
14
|
+
isReady
|
15
|
+
) {
|
16
|
+
function ready() {
|
17
|
+
if (!isReady) {
|
18
|
+
isReady = 1;
|
19
|
+
libPath =
|
20
|
+
(config.lib || "/~partytown/") +
|
21
|
+
(false !== config.debug ? "debug/" : "");
|
22
|
+
if ("/" == libPath[0]) {
|
23
|
+
scripts = doc.querySelectorAll('script[type="text/partytown"]');
|
24
|
+
if (top != win) {
|
25
|
+
top.dispatchEvent(
|
26
|
+
new CustomEvent("pt1", {
|
27
|
+
detail: win,
|
28
|
+
})
|
29
|
+
);
|
30
|
+
} else {
|
31
|
+
timeout = setTimeout(fallback, 1e4);
|
32
|
+
doc.addEventListener("pt0", clearFallback);
|
33
|
+
useAtomics
|
34
|
+
? loadSandbox(1)
|
35
|
+
: nav.serviceWorker
|
36
|
+
? nav.serviceWorker
|
37
|
+
.register(libPath + (config.swPath || "partytown-sw.js"), {
|
38
|
+
scope: libPath,
|
39
|
+
})
|
40
|
+
.then(function (swRegistration) {
|
41
|
+
if (swRegistration.active) {
|
42
|
+
loadSandbox();
|
43
|
+
} else if (swRegistration.installing) {
|
44
|
+
swRegistration.installing.addEventListener(
|
45
|
+
"statechange",
|
46
|
+
function (ev) {
|
47
|
+
"activated" == ev.target.state && loadSandbox();
|
48
|
+
}
|
49
|
+
);
|
50
|
+
} else {
|
51
|
+
console.warn(swRegistration);
|
52
|
+
}
|
53
|
+
}, console.error)
|
54
|
+
: fallback();
|
33
55
|
}
|
56
|
+
} else {
|
57
|
+
console.warn('Partytown config.lib url must start with "/"');
|
58
|
+
}
|
34
59
|
}
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
function fallback(i, script) {
|
45
|
-
console.warn("Partytown script fallback");
|
46
|
-
clearFallback();
|
47
|
-
top == win && (config.forward || []).map((function(forwardProps) {
|
48
|
-
delete win[forwardProps.split(".")[0]];
|
49
|
-
}));
|
50
|
-
for (i = 0; i < scripts.length; i++) {
|
51
|
-
script = doc.createElement("script");
|
52
|
-
script.innerHTML = scripts[i].innerHTML;
|
53
|
-
doc.head.appendChild(script);
|
54
|
-
}
|
55
|
-
sandbox && sandbox.parentNode.removeChild(sandbox);
|
60
|
+
}
|
61
|
+
function loadSandbox(isAtomics) {
|
62
|
+
sandbox = doc.createElement(isAtomics ? "script" : "iframe");
|
63
|
+
if (!isAtomics) {
|
64
|
+
sandbox.setAttribute(
|
65
|
+
"style",
|
66
|
+
"display:block;width:0;height:0;border:0;visibility:hidden"
|
67
|
+
);
|
68
|
+
sandbox.setAttribute("aria-hidden", !0);
|
56
69
|
}
|
57
|
-
|
58
|
-
|
70
|
+
sandbox.src =
|
71
|
+
libPath +
|
72
|
+
"partytown-" +
|
73
|
+
(isAtomics ? "atomics.js?v=0.7.5" : "sandbox-sw.html?" + Date.now());
|
74
|
+
doc.body.appendChild(sandbox);
|
75
|
+
}
|
76
|
+
function fallback(i, script) {
|
77
|
+
console.warn("Partytown script fallback");
|
78
|
+
clearFallback();
|
79
|
+
top == win &&
|
80
|
+
(config.forward || []).map(function (forwardProps) {
|
81
|
+
delete win[forwardProps.split(".")[0]];
|
82
|
+
});
|
83
|
+
for (i = 0; i < scripts.length; i++) {
|
84
|
+
script = doc.createElement("script");
|
85
|
+
script.innerHTML = scripts[i].innerHTML;
|
86
|
+
doc.head.appendChild(script);
|
59
87
|
}
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
88
|
+
sandbox && sandbox.parentNode.removeChild(sandbox);
|
89
|
+
}
|
90
|
+
function clearFallback() {
|
91
|
+
clearTimeout(timeout);
|
92
|
+
}
|
93
|
+
config = win.partytown || {};
|
94
|
+
top == win &&
|
95
|
+
(config.forward || []).map(function (forwardProps) {
|
96
|
+
mainForwardFn = win;
|
97
|
+
forwardProps.split(".").map(function (_, i, forwardPropsArr) {
|
98
|
+
mainForwardFn = mainForwardFn[forwardPropsArr[i]] =
|
99
|
+
i + 1 < forwardPropsArr.length
|
100
|
+
? "push" == forwardPropsArr[i + 1]
|
101
|
+
? []
|
102
|
+
: mainForwardFn[forwardPropsArr[i]] || {}
|
103
|
+
: function () {
|
65
104
|
(win._ptf = win._ptf || []).push(forwardPropsArr, arguments);
|
66
|
-
|
67
|
-
|
68
|
-
})
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
}(window, document, navigator, top, window.crossOriginIsolated);
|
105
|
+
};
|
106
|
+
});
|
107
|
+
});
|
108
|
+
if ("complete" == doc.readyState) {
|
109
|
+
ready();
|
110
|
+
} else {
|
111
|
+
win.addEventListener("DOMContentLoaded", ready);
|
112
|
+
win.addEventListener("load", ready);
|
113
|
+
}
|
114
|
+
})(window, document, navigator, top, window.crossOriginIsolated);
|