@teselagen/bounce-loader 0.0.2 → 0.0.4
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/index.js +4 -7
- package/index.mjs +5 -50
- package/index.umd.js +68 -0
- package/package.json +1 -1
- package/index.html +0 -13
package/index.js
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
var __defProp = Object.defineProperty;
|
3
3
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
4
|
-
|
5
|
-
const
|
4
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
5
|
+
const React = require("react");
|
6
6
|
function getDefaultExportFromCjs(x) {
|
7
7
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
8
8
|
}
|
@@ -59,10 +59,7 @@ var classnamesExports = classnames.exports;
|
|
59
59
|
const classNames = /* @__PURE__ */ getDefaultExportFromCjs(classnamesExports);
|
60
60
|
const style = "";
|
61
61
|
function BounceLoader({ style: style2, className }) {
|
62
|
-
return /* @__PURE__ */ React
|
62
|
+
return /* @__PURE__ */ React.createElement("div", { className: classNames("tg-bounce-loader", className), style: style2 }, /* @__PURE__ */ React.createElement("div", { className: "rect1" }), /* @__PURE__ */ React.createElement("div", { className: "rect2" }), /* @__PURE__ */ React.createElement("div", { className: "rect3" }), /* @__PURE__ */ React.createElement("div", { className: "rect4" }), /* @__PURE__ */ React.createElement("div", { className: "rect5" }));
|
63
63
|
}
|
64
64
|
__name(BounceLoader, "BounceLoader");
|
65
|
-
|
66
|
-
renderDemo(() => {
|
67
|
-
return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(BounceLoader, null));
|
68
|
-
});
|
65
|
+
exports.BounceLoader = BounceLoader;
|
package/index.mjs
CHANGED
@@ -1,50 +1,6 @@
|
|
1
1
|
var __defProp = Object.defineProperty;
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
3
|
-
import React
|
4
|
-
import { render } from "react-dom";
|
5
|
-
(/* @__PURE__ */ __name(function polyfill() {
|
6
|
-
const relList = document.createElement("link").relList;
|
7
|
-
if (relList && relList.supports && relList.supports("modulepreload")) {
|
8
|
-
return;
|
9
|
-
}
|
10
|
-
for (const link of document.querySelectorAll('link[rel="modulepreload"]')) {
|
11
|
-
processPreload(link);
|
12
|
-
}
|
13
|
-
new MutationObserver((mutations) => {
|
14
|
-
for (const mutation of mutations) {
|
15
|
-
if (mutation.type !== "childList") {
|
16
|
-
continue;
|
17
|
-
}
|
18
|
-
for (const node of mutation.addedNodes) {
|
19
|
-
if (node.tagName === "LINK" && node.rel === "modulepreload")
|
20
|
-
processPreload(node);
|
21
|
-
}
|
22
|
-
}
|
23
|
-
}).observe(document, { childList: true, subtree: true });
|
24
|
-
function getFetchOpts(link) {
|
25
|
-
const fetchOpts = {};
|
26
|
-
if (link.integrity)
|
27
|
-
fetchOpts.integrity = link.integrity;
|
28
|
-
if (link.referrerPolicy)
|
29
|
-
fetchOpts.referrerPolicy = link.referrerPolicy;
|
30
|
-
if (link.crossOrigin === "use-credentials")
|
31
|
-
fetchOpts.credentials = "include";
|
32
|
-
else if (link.crossOrigin === "anonymous")
|
33
|
-
fetchOpts.credentials = "omit";
|
34
|
-
else
|
35
|
-
fetchOpts.credentials = "same-origin";
|
36
|
-
return fetchOpts;
|
37
|
-
}
|
38
|
-
__name(getFetchOpts, "getFetchOpts");
|
39
|
-
function processPreload(link) {
|
40
|
-
if (link.ep)
|
41
|
-
return;
|
42
|
-
link.ep = true;
|
43
|
-
const fetchOpts = getFetchOpts(link);
|
44
|
-
fetch(link.href, fetchOpts);
|
45
|
-
}
|
46
|
-
__name(processPreload, "processPreload");
|
47
|
-
}, "polyfill"))();
|
3
|
+
import React from "react";
|
48
4
|
function getDefaultExportFromCjs(x) {
|
49
5
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
50
6
|
}
|
@@ -101,10 +57,9 @@ var classnamesExports = classnames.exports;
|
|
101
57
|
const classNames = /* @__PURE__ */ getDefaultExportFromCjs(classnamesExports);
|
102
58
|
const style = "";
|
103
59
|
function BounceLoader({ style: style2, className }) {
|
104
|
-
return /* @__PURE__ */ React
|
60
|
+
return /* @__PURE__ */ React.createElement("div", { className: classNames("tg-bounce-loader", className), style: style2 }, /* @__PURE__ */ React.createElement("div", { className: "rect1" }), /* @__PURE__ */ React.createElement("div", { className: "rect2" }), /* @__PURE__ */ React.createElement("div", { className: "rect3" }), /* @__PURE__ */ React.createElement("div", { className: "rect4" }), /* @__PURE__ */ React.createElement("div", { className: "rect5" }));
|
105
61
|
}
|
106
62
|
__name(BounceLoader, "BounceLoader");
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
});
|
63
|
+
export {
|
64
|
+
BounceLoader
|
65
|
+
};
|
package/index.umd.js
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
(function(global, factory) {
|
2
|
+
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react")) : typeof define === "function" && define.amd ? define(["exports", "react"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.bounceLoader = {}, global.React));
|
3
|
+
})(this, function(exports2, React) {
|
4
|
+
"use strict";var __defProp = Object.defineProperty;
|
5
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
6
|
+
|
7
|
+
function getDefaultExportFromCjs(x) {
|
8
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
9
|
+
}
|
10
|
+
__name(getDefaultExportFromCjs, "getDefaultExportFromCjs");
|
11
|
+
var classnames = { exports: {} };
|
12
|
+
/*!
|
13
|
+
Copyright (c) 2018 Jed Watson.
|
14
|
+
Licensed under the MIT License (MIT), see
|
15
|
+
http://jedwatson.github.io/classnames
|
16
|
+
*/
|
17
|
+
(function(module2) {
|
18
|
+
(function() {
|
19
|
+
var hasOwn = {}.hasOwnProperty;
|
20
|
+
function classNames2() {
|
21
|
+
var classes = [];
|
22
|
+
for (var i = 0; i < arguments.length; i++) {
|
23
|
+
var arg = arguments[i];
|
24
|
+
if (!arg)
|
25
|
+
continue;
|
26
|
+
var argType = typeof arg;
|
27
|
+
if (argType === "string" || argType === "number") {
|
28
|
+
classes.push(arg);
|
29
|
+
} else if (Array.isArray(arg)) {
|
30
|
+
if (arg.length) {
|
31
|
+
var inner = classNames2.apply(null, arg);
|
32
|
+
if (inner) {
|
33
|
+
classes.push(inner);
|
34
|
+
}
|
35
|
+
}
|
36
|
+
} else if (argType === "object") {
|
37
|
+
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
|
38
|
+
classes.push(arg.toString());
|
39
|
+
continue;
|
40
|
+
}
|
41
|
+
for (var key in arg) {
|
42
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
43
|
+
classes.push(key);
|
44
|
+
}
|
45
|
+
}
|
46
|
+
}
|
47
|
+
}
|
48
|
+
return classes.join(" ");
|
49
|
+
}
|
50
|
+
__name(classNames2, "classNames");
|
51
|
+
if (module2.exports) {
|
52
|
+
classNames2.default = classNames2;
|
53
|
+
module2.exports = classNames2;
|
54
|
+
} else {
|
55
|
+
window.classNames = classNames2;
|
56
|
+
}
|
57
|
+
})();
|
58
|
+
})(classnames);
|
59
|
+
var classnamesExports = classnames.exports;
|
60
|
+
const classNames = /* @__PURE__ */ getDefaultExportFromCjs(classnamesExports);
|
61
|
+
const style = "";
|
62
|
+
function BounceLoader({ style: style2, className }) {
|
63
|
+
return /* @__PURE__ */ React.createElement("div", { className: classNames("tg-bounce-loader", className), style: style2 }, /* @__PURE__ */ React.createElement("div", { className: "rect1" }), /* @__PURE__ */ React.createElement("div", { className: "rect2" }), /* @__PURE__ */ React.createElement("div", { className: "rect3" }), /* @__PURE__ */ React.createElement("div", { className: "rect4" }), /* @__PURE__ */ React.createElement("div", { className: "rect5" }));
|
64
|
+
}
|
65
|
+
__name(BounceLoader, "BounceLoader");
|
66
|
+
exports2.BounceLoader = BounceLoader;
|
67
|
+
Object.defineProperty(exports2, Symbol.toStringTag, { value: "Module" });
|
68
|
+
});
|
package/package.json
CHANGED
package/index.html
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
|
2
|
-
<!DOCTYPE html>
|
3
|
-
<html lang="en">
|
4
|
-
<head>
|
5
|
-
<meta charset="UTF-8">
|
6
|
-
<title>bounce-loader demo</title>
|
7
|
-
|
8
|
-
<script type="module" crossorigin src="/index.js"></script>
|
9
|
-
</head>
|
10
|
-
<body>
|
11
|
-
<div id="app"><div id="demo"></div></div>
|
12
|
-
</body>
|
13
|
-
</html>
|