@streamlayer/web-os 0.8.5 → 0.9.0
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/lib/cjs/index.js +109 -107
- package/lib/cjs/polyfills.js +2 -0
- package/lib/cjs/style.css +1 -1
- package/lib/dist/es/index.js +4903 -0
- package/lib/dist/es/polyfills.js +92 -0
- package/lib/es/{index-DvqmgCor.js → index-CfSdnrfA.js} +1 -1
- package/lib/es/index2.js +7600 -7043
- package/lib/es/style.css +1 -1
- package/lib/source.css +1 -1
- package/package.json +35 -26
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import 'core-js/stable/index.js';
|
|
2
|
+
import 'regenerator-runtime/runtime.js';
|
|
3
|
+
import require$$2 from 'text-encoding-utf-8';
|
|
4
|
+
import 'intersection-observer';
|
|
5
|
+
import require$$4 from 'resize-observer-polyfill';
|
|
6
|
+
import require$$5 from 'web-streams-polyfill';
|
|
7
|
+
import 'whatwg-fetch';
|
|
8
|
+
import 'abortcontroller-polyfill/dist/polyfill-patch-fetch.js';
|
|
9
|
+
|
|
10
|
+
function getDefaultExportFromCjs (x) {
|
|
11
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
var polyfills$1 = {};
|
|
15
|
+
|
|
16
|
+
var hasRequiredPolyfills;
|
|
17
|
+
|
|
18
|
+
function requirePolyfills () {
|
|
19
|
+
if (hasRequiredPolyfills) return polyfills$1;
|
|
20
|
+
hasRequiredPolyfills = 1;
|
|
21
|
+
// TextEncoder/TextDecoder pure JS polyfill (Chrome 38)
|
|
22
|
+
// The package only exports classes; must assign globals for SDK compatibility
|
|
23
|
+
var _textEncoding = require$$2;
|
|
24
|
+
if (typeof window.TextEncoder === 'undefined') window.TextEncoder = _textEncoding.TextEncoder;
|
|
25
|
+
if (typeof window.TextDecoder === 'undefined') window.TextDecoder = _textEncoding.TextDecoder;
|
|
26
|
+
// IntersectionObserver polyfill (Chrome 51)
|
|
27
|
+
if (typeof window.ResizeObserver === 'undefined') { // ResizeObserver polyfill (Chrome 64)
|
|
28
|
+
var _RO = require$$4;
|
|
29
|
+
window.ResizeObserver = _RO.default || _RO;
|
|
30
|
+
}
|
|
31
|
+
var _streams = require$$5;
|
|
32
|
+
if (typeof window.ReadableStream === 'undefined') window.ReadableStream = _streams.ReadableStream;
|
|
33
|
+
if (typeof window.WritableStream === 'undefined') window.WritableStream = _streams.WritableStream;
|
|
34
|
+
if (typeof window.TransformStream === 'undefined') window.TransformStream = _streams.TransformStream;
|
|
35
|
+
// fetch/Response/Headers/Request polyfill (Chrome 42)
|
|
36
|
+
// AbortController + patched fetch (Chrome 66)
|
|
37
|
+
|
|
38
|
+
// whatwg-fetch does not implement Response.body (ReadableStream).
|
|
39
|
+
// ConnectRPC requires response.body to parse gRPC-Web frames.
|
|
40
|
+
// Wrap fetch to synthesize .body from .arrayBuffer().
|
|
41
|
+
(function() {
|
|
42
|
+
var origFetch = window.fetch;
|
|
43
|
+
window.fetch = function(input, init) {
|
|
44
|
+
return origFetch.apply(this, arguments).then(function(response) {
|
|
45
|
+
if (response.body) return response;
|
|
46
|
+
var _stream = null;
|
|
47
|
+
Object.defineProperty(response, 'body', {
|
|
48
|
+
get: function() {
|
|
49
|
+
if (!_stream) {
|
|
50
|
+
var clone = response.clone();
|
|
51
|
+
_stream = new ReadableStream({
|
|
52
|
+
start: function(controller) {
|
|
53
|
+
clone.arrayBuffer().then(function(buf) {
|
|
54
|
+
controller.enqueue(new Uint8Array(buf));
|
|
55
|
+
controller.close();
|
|
56
|
+
}, function(err) {
|
|
57
|
+
controller.error(err);
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
return _stream;
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
return response;
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
})();
|
|
69
|
+
|
|
70
|
+
// MediaQueryList.addEventListener/removeEventListener polyfill (Chrome 50)
|
|
71
|
+
// Chrome 32 only has the legacy addListener/removeListener API.
|
|
72
|
+
// MediaQueryList is not exposed as a global constructor in Chrome 32,
|
|
73
|
+
// so we obtain the prototype from an actual instance via matchMedia.
|
|
74
|
+
if (typeof window.matchMedia === 'function') {
|
|
75
|
+
var _mql = window.matchMedia('(min-width:0)');
|
|
76
|
+
if (_mql && !_mql.addEventListener) {
|
|
77
|
+
var _mqlProto = Object.getPrototypeOf(_mql);
|
|
78
|
+
_mqlProto.addEventListener = function (type, listener) {
|
|
79
|
+
if (type === 'change') this.addListener(listener);
|
|
80
|
+
};
|
|
81
|
+
_mqlProto.removeEventListener = function (type, listener) {
|
|
82
|
+
if (type === 'change') this.removeListener(listener);
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return polyfills$1;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
var polyfillsExports = requirePolyfills();
|
|
90
|
+
var polyfills = /*@__PURE__*/getDefaultExportFromCjs(polyfillsExports);
|
|
91
|
+
|
|
92
|
+
export { polyfills as default };
|