bigpipe-util 0.2.13 → 0.2.14
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/README.md +124 -124
- package/{src → dist}/BigPipe.js +148 -170
- package/dist/Pagelet.js +111 -0
- package/dist/Primer.js +117 -0
- package/{src → dist}/ServerJS.js +40 -40
- package/dist/async/AsyncDOM.js +58 -0
- package/{src → dist}/async/AsyncRequest.js +182 -210
- package/dist/async/AsyncResponse.js +28 -0
- package/dist/core/$.js +9 -0
- package/{src → dist}/core/Arbiter.js +53 -53
- package/{src → dist}/core/DOM.js +39 -41
- package/{src → dist}/core/Dialog.js +129 -142
- package/dist/core/Parent.js +39 -0
- package/dist/core/ReloadPage.js +15 -0
- package/dist/core/ServerRedirect.js +14 -0
- package/{src → dist}/core/copyProperties.js +32 -31
- package/dist/core/onAfterLoad.js +18 -0
- package/{src → dist}/core/replaceTransportMarkers.js +32 -27
- package/{src → dist}/core/waitForLoad.js +13 -24
- package/package.json +21 -2
- package/.editorconfig +0 -9
- package/CHANGELOG.md +0 -109
- package/bigpipe.svg +0 -13
- package/src/Pagelet.js +0 -131
- package/src/Primer.js +0 -160
- package/src/async/AsyncDOM.js +0 -55
- package/src/async/AsyncResponse.js +0 -21
- package/src/core/$.js +0 -3
- package/src/core/Parent.js +0 -38
- package/src/core/ReloadPage.js +0 -9
- package/src/core/ServerRedirect.js +0 -7
- package/src/core/onAfterLoad.js +0 -13
package/src/core/$.js
DELETED
package/src/core/Parent.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import CSSCore from "fbjs/lib/CSSCore";
|
|
2
|
-
|
|
3
|
-
export function byTag(node, tagName) {
|
|
4
|
-
tagName = tagName.toUpperCase();
|
|
5
|
-
node = find(node, function (el) {
|
|
6
|
-
return el.nodeName === tagName;
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
return node instanceof Element ? node : null;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export function byClass(node, className) {
|
|
13
|
-
node = find(node, function (el) {
|
|
14
|
-
return el instanceof Element && CSSCore.hasClass(el, className);
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
return node instanceof Element ? node : null;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export function byAttribute(node, attribute) {
|
|
21
|
-
node = find(node, function (el) {
|
|
22
|
-
return el instanceof Element && el.hasAttribute(attribute);
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
return node instanceof Element ? node : null;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export function find(node, callback) {
|
|
29
|
-
while (node) {
|
|
30
|
-
if (callback(node)) {
|
|
31
|
-
return node;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
node = node.parentNode;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return null;
|
|
38
|
-
}
|
package/src/core/ReloadPage.js
DELETED
package/src/core/onAfterLoad.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import EventListener from 'fbjs/lib/EventListener';
|
|
2
|
-
|
|
3
|
-
export default function onAfterLoad(callback) {
|
|
4
|
-
if (document.readyState === 'complete') {
|
|
5
|
-
setTimeout(callback, 0);
|
|
6
|
-
} else {
|
|
7
|
-
const event = EventListener.capture(window, 'load', () => {
|
|
8
|
-
event.remove();
|
|
9
|
-
|
|
10
|
-
callback();
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
}
|