@modern-js/utils 0.0.0-nightly-20231002160628 → 0.0.0-nightly-20231003160547
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/cli/logger.js +4 -127
- package/dist/esm/cli/logger.js +2 -129
- package/dist/esm-node/cli/logger.js +2 -114
- package/dist/types/cli/logger.d.ts +1 -69
- package/package.json +5 -8
- package/dist/compiled/gradient-string/index.d.ts +0 -1
- package/dist/compiled/gradient-string/index.js +0 -1
- package/dist/compiled/gradient-string/license +0 -21
- package/dist/compiled/gradient-string/package.json +0 -1
package/dist/cjs/cli/logger.js
CHANGED
@@ -1,9 +1,7 @@
|
|
1
1
|
"use strict";
|
2
|
-
var __create = Object.create;
|
3
2
|
var __defProp = Object.defineProperty;
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
8
6
|
var __export = (target, all) => {
|
9
7
|
for (var name in all)
|
@@ -17,137 +15,16 @@ var __copyProps = (to, from, except, desc) => {
|
|
17
15
|
}
|
18
16
|
return to;
|
19
17
|
};
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
26
|
-
mod
|
27
|
-
));
|
28
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
29
19
|
var logger_exports = {};
|
30
20
|
__export(logger_exports, {
|
31
|
-
|
32
|
-
|
33
|
-
logger: () => logger
|
21
|
+
createLogger: () => import_rslog.createLogger,
|
22
|
+
logger: () => import_rslog.logger
|
34
23
|
});
|
35
24
|
module.exports = __toCommonJS(logger_exports);
|
36
|
-
var
|
37
|
-
const LOG_LEVEL = {
|
38
|
-
error: 0,
|
39
|
-
warn: 1,
|
40
|
-
info: 2,
|
41
|
-
debug: 3,
|
42
|
-
log: 4
|
43
|
-
};
|
44
|
-
const LOG_TYPES = {
|
45
|
-
error: {
|
46
|
-
color: "red",
|
47
|
-
label: "error",
|
48
|
-
level: "error"
|
49
|
-
},
|
50
|
-
info: {
|
51
|
-
color: "cyan",
|
52
|
-
label: "info",
|
53
|
-
level: "info"
|
54
|
-
},
|
55
|
-
ready: {
|
56
|
-
color: "green",
|
57
|
-
label: "ready",
|
58
|
-
level: "info"
|
59
|
-
},
|
60
|
-
success: {
|
61
|
-
color: "green",
|
62
|
-
label: "success",
|
63
|
-
level: "info"
|
64
|
-
},
|
65
|
-
warn: {
|
66
|
-
color: "yellow",
|
67
|
-
label: "warn",
|
68
|
-
level: "warn"
|
69
|
-
},
|
70
|
-
debug: {
|
71
|
-
color: "red",
|
72
|
-
label: "debug",
|
73
|
-
level: "debug"
|
74
|
-
},
|
75
|
-
log: {
|
76
|
-
level: "log"
|
77
|
-
}
|
78
|
-
};
|
79
|
-
const DEFAULT_CONFIG = {
|
80
|
-
displayLabel: true,
|
81
|
-
uppercaseLabel: false
|
82
|
-
};
|
83
|
-
const errorStackRegExp = /^\s*at\s.*:\d+:\d+[\s)]*$/;
|
84
|
-
const anonymousErrorStackRegExp = /^\s*at\s.*\(<anonymous>\)$/;
|
85
|
-
const isErrorStackMessage = (message) => errorStackRegExp.test(message) || anonymousErrorStackRegExp.test(message);
|
86
|
-
class Logger {
|
87
|
-
_log(type, message, ...args) {
|
88
|
-
if (message === void 0 || message === null) {
|
89
|
-
console.log();
|
90
|
-
return;
|
91
|
-
}
|
92
|
-
if (LOG_LEVEL[type] > LOG_LEVEL[this.level]) {
|
93
|
-
return;
|
94
|
-
}
|
95
|
-
let label = "";
|
96
|
-
let text = "";
|
97
|
-
const logType = this.types[type];
|
98
|
-
if (this.config.displayLabel && logType.label) {
|
99
|
-
label = this.config.uppercaseLabel ? logType.label.toUpperCase() : logType.label;
|
100
|
-
label = label.padEnd(this.longestLabel.length);
|
101
|
-
label = import_chalk.default.bold(logType.color ? import_chalk.default[logType.color](label) : label);
|
102
|
-
}
|
103
|
-
if (message instanceof Error) {
|
104
|
-
if (message.stack) {
|
105
|
-
const [name, ...rest] = message.stack.split("\n");
|
106
|
-
text = `${name}
|
107
|
-
${import_chalk.default.grey(rest.join("\n"))}`;
|
108
|
-
} else {
|
109
|
-
text = message.message;
|
110
|
-
}
|
111
|
-
} else if (logType.level === "error" && typeof message === "string") {
|
112
|
-
const lines = message.split("\n");
|
113
|
-
text = lines.map((line) => isErrorStackMessage(line) ? import_chalk.default.gray(line) : line).join("\n");
|
114
|
-
} else {
|
115
|
-
text = `${message}`;
|
116
|
-
}
|
117
|
-
const log = label.length > 0 ? `${label} ${text}` : text;
|
118
|
-
console.log(log, ...args);
|
119
|
-
}
|
120
|
-
getLongestLabel() {
|
121
|
-
let longestLabel = "";
|
122
|
-
Object.keys(this.types).forEach((type) => {
|
123
|
-
const { label = "" } = this.types[type];
|
124
|
-
if (label.length > longestLabel.length) {
|
125
|
-
longestLabel = label;
|
126
|
-
}
|
127
|
-
});
|
128
|
-
return longestLabel;
|
129
|
-
}
|
130
|
-
constructor(options = {}) {
|
131
|
-
this.level = options.level || LOG_TYPES.log.level;
|
132
|
-
this.config = {
|
133
|
-
...DEFAULT_CONFIG,
|
134
|
-
...options.config || {}
|
135
|
-
};
|
136
|
-
this.types = {
|
137
|
-
...LOG_TYPES,
|
138
|
-
...options.types || {}
|
139
|
-
};
|
140
|
-
this.longestLabel = this.getLongestLabel();
|
141
|
-
Object.keys(this.types).forEach((type) => {
|
142
|
-
this[type] = this._log.bind(this, type);
|
143
|
-
});
|
144
|
-
}
|
145
|
-
}
|
146
|
-
const logger = new Logger();
|
147
|
-
logger.Logger = Logger;
|
25
|
+
var import_rslog = require("rslog");
|
148
26
|
// Annotate the CommonJS export names for ESM import in node:
|
149
27
|
0 && (module.exports = {
|
150
|
-
|
151
|
-
isErrorStackMessage,
|
28
|
+
createLogger,
|
152
29
|
logger
|
153
30
|
});
|
package/dist/esm/cli/logger.js
CHANGED
@@ -1,132 +1,5 @@
|
|
1
|
-
import {
|
2
|
-
import { _ as _instanceof } from "@swc/helpers/_/_instanceof";
|
3
|
-
import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
4
|
-
import { _ as _to_array } from "@swc/helpers/_/_to_array";
|
5
|
-
import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
|
6
|
-
import chalk from "../../compiled/chalk";
|
7
|
-
var LOG_LEVEL = {
|
8
|
-
error: 0,
|
9
|
-
warn: 1,
|
10
|
-
info: 2,
|
11
|
-
debug: 3,
|
12
|
-
log: 4
|
13
|
-
};
|
14
|
-
var LOG_TYPES = {
|
15
|
-
error: {
|
16
|
-
color: "red",
|
17
|
-
label: "error",
|
18
|
-
level: "error"
|
19
|
-
},
|
20
|
-
info: {
|
21
|
-
color: "cyan",
|
22
|
-
label: "info",
|
23
|
-
level: "info"
|
24
|
-
},
|
25
|
-
ready: {
|
26
|
-
color: "green",
|
27
|
-
label: "ready",
|
28
|
-
level: "info"
|
29
|
-
},
|
30
|
-
success: {
|
31
|
-
color: "green",
|
32
|
-
label: "success",
|
33
|
-
level: "info"
|
34
|
-
},
|
35
|
-
warn: {
|
36
|
-
color: "yellow",
|
37
|
-
label: "warn",
|
38
|
-
level: "warn"
|
39
|
-
},
|
40
|
-
debug: {
|
41
|
-
color: "red",
|
42
|
-
label: "debug",
|
43
|
-
level: "debug"
|
44
|
-
},
|
45
|
-
log: {
|
46
|
-
level: "log"
|
47
|
-
}
|
48
|
-
};
|
49
|
-
var DEFAULT_CONFIG = {
|
50
|
-
displayLabel: true,
|
51
|
-
uppercaseLabel: false
|
52
|
-
};
|
53
|
-
var errorStackRegExp = /^\s*at\s.*:\d+:\d+[\s)]*$/;
|
54
|
-
var anonymousErrorStackRegExp = /^\s*at\s.*\(<anonymous>\)$/;
|
55
|
-
var isErrorStackMessage = function(message) {
|
56
|
-
return errorStackRegExp.test(message) || anonymousErrorStackRegExp.test(message);
|
57
|
-
};
|
58
|
-
var Logger = /* @__PURE__ */ function() {
|
59
|
-
"use strict";
|
60
|
-
function Logger2() {
|
61
|
-
var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
62
|
-
var _this = this;
|
63
|
-
_class_call_check(this, Logger2);
|
64
|
-
this.level = options.level || LOG_TYPES.log.level;
|
65
|
-
this.config = _object_spread({}, DEFAULT_CONFIG, options.config || {});
|
66
|
-
this.types = _object_spread({}, LOG_TYPES, options.types || {});
|
67
|
-
this.longestLabel = this.getLongestLabel();
|
68
|
-
Object.keys(this.types).forEach(function(type) {
|
69
|
-
_this[type] = _this._log.bind(_this, type);
|
70
|
-
});
|
71
|
-
}
|
72
|
-
var _proto = Logger2.prototype;
|
73
|
-
_proto._log = function _log(type, message) {
|
74
|
-
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
75
|
-
args[_key - 2] = arguments[_key];
|
76
|
-
}
|
77
|
-
var _console;
|
78
|
-
if (message === void 0 || message === null) {
|
79
|
-
console.log();
|
80
|
-
return;
|
81
|
-
}
|
82
|
-
if (LOG_LEVEL[type] > LOG_LEVEL[this.level]) {
|
83
|
-
return;
|
84
|
-
}
|
85
|
-
var label = "";
|
86
|
-
var text = "";
|
87
|
-
var logType = this.types[type];
|
88
|
-
if (this.config.displayLabel && logType.label) {
|
89
|
-
label = this.config.uppercaseLabel ? logType.label.toUpperCase() : logType.label;
|
90
|
-
label = label.padEnd(this.longestLabel.length);
|
91
|
-
label = chalk.bold(logType.color ? chalk[logType.color](label) : label);
|
92
|
-
}
|
93
|
-
if (_instanceof(message, Error)) {
|
94
|
-
if (message.stack) {
|
95
|
-
var _message_stack_split = _to_array(message.stack.split("\n")), name = _message_stack_split[0], rest = _message_stack_split.slice(1);
|
96
|
-
text = "".concat(name, "\n").concat(chalk.grey(rest.join("\n")));
|
97
|
-
} else {
|
98
|
-
text = message.message;
|
99
|
-
}
|
100
|
-
} else if (logType.level === "error" && typeof message === "string") {
|
101
|
-
var lines = message.split("\n");
|
102
|
-
text = lines.map(function(line) {
|
103
|
-
return isErrorStackMessage(line) ? chalk.gray(line) : line;
|
104
|
-
}).join("\n");
|
105
|
-
} else {
|
106
|
-
text = "".concat(message);
|
107
|
-
}
|
108
|
-
var log = label.length > 0 ? "".concat(label, " ").concat(text) : text;
|
109
|
-
(_console = console).log.apply(_console, [
|
110
|
-
log
|
111
|
-
].concat(_to_consumable_array(args)));
|
112
|
-
};
|
113
|
-
_proto.getLongestLabel = function getLongestLabel() {
|
114
|
-
var _this = this;
|
115
|
-
var longestLabel = "";
|
116
|
-
Object.keys(this.types).forEach(function(type) {
|
117
|
-
var _this_types_type = _this.types[type], _this_types_type_label = _this_types_type.label, label = _this_types_type_label === void 0 ? "" : _this_types_type_label;
|
118
|
-
if (label.length > longestLabel.length) {
|
119
|
-
longestLabel = label;
|
120
|
-
}
|
121
|
-
});
|
122
|
-
return longestLabel;
|
123
|
-
};
|
124
|
-
return Logger2;
|
125
|
-
}();
|
126
|
-
var logger = new Logger();
|
127
|
-
logger.Logger = Logger;
|
1
|
+
import { logger, createLogger } from "rslog";
|
128
2
|
export {
|
129
|
-
|
130
|
-
isErrorStackMessage,
|
3
|
+
createLogger,
|
131
4
|
logger
|
132
5
|
};
|
@@ -1,117 +1,5 @@
|
|
1
|
-
import
|
2
|
-
const LOG_LEVEL = {
|
3
|
-
error: 0,
|
4
|
-
warn: 1,
|
5
|
-
info: 2,
|
6
|
-
debug: 3,
|
7
|
-
log: 4
|
8
|
-
};
|
9
|
-
const LOG_TYPES = {
|
10
|
-
error: {
|
11
|
-
color: "red",
|
12
|
-
label: "error",
|
13
|
-
level: "error"
|
14
|
-
},
|
15
|
-
info: {
|
16
|
-
color: "cyan",
|
17
|
-
label: "info",
|
18
|
-
level: "info"
|
19
|
-
},
|
20
|
-
ready: {
|
21
|
-
color: "green",
|
22
|
-
label: "ready",
|
23
|
-
level: "info"
|
24
|
-
},
|
25
|
-
success: {
|
26
|
-
color: "green",
|
27
|
-
label: "success",
|
28
|
-
level: "info"
|
29
|
-
},
|
30
|
-
warn: {
|
31
|
-
color: "yellow",
|
32
|
-
label: "warn",
|
33
|
-
level: "warn"
|
34
|
-
},
|
35
|
-
debug: {
|
36
|
-
color: "red",
|
37
|
-
label: "debug",
|
38
|
-
level: "debug"
|
39
|
-
},
|
40
|
-
log: {
|
41
|
-
level: "log"
|
42
|
-
}
|
43
|
-
};
|
44
|
-
const DEFAULT_CONFIG = {
|
45
|
-
displayLabel: true,
|
46
|
-
uppercaseLabel: false
|
47
|
-
};
|
48
|
-
const errorStackRegExp = /^\s*at\s.*:\d+:\d+[\s)]*$/;
|
49
|
-
const anonymousErrorStackRegExp = /^\s*at\s.*\(<anonymous>\)$/;
|
50
|
-
const isErrorStackMessage = (message) => errorStackRegExp.test(message) || anonymousErrorStackRegExp.test(message);
|
51
|
-
class Logger {
|
52
|
-
_log(type, message, ...args) {
|
53
|
-
if (message === void 0 || message === null) {
|
54
|
-
console.log();
|
55
|
-
return;
|
56
|
-
}
|
57
|
-
if (LOG_LEVEL[type] > LOG_LEVEL[this.level]) {
|
58
|
-
return;
|
59
|
-
}
|
60
|
-
let label = "";
|
61
|
-
let text = "";
|
62
|
-
const logType = this.types[type];
|
63
|
-
if (this.config.displayLabel && logType.label) {
|
64
|
-
label = this.config.uppercaseLabel ? logType.label.toUpperCase() : logType.label;
|
65
|
-
label = label.padEnd(this.longestLabel.length);
|
66
|
-
label = chalk.bold(logType.color ? chalk[logType.color](label) : label);
|
67
|
-
}
|
68
|
-
if (message instanceof Error) {
|
69
|
-
if (message.stack) {
|
70
|
-
const [name, ...rest] = message.stack.split("\n");
|
71
|
-
text = `${name}
|
72
|
-
${chalk.grey(rest.join("\n"))}`;
|
73
|
-
} else {
|
74
|
-
text = message.message;
|
75
|
-
}
|
76
|
-
} else if (logType.level === "error" && typeof message === "string") {
|
77
|
-
const lines = message.split("\n");
|
78
|
-
text = lines.map((line) => isErrorStackMessage(line) ? chalk.gray(line) : line).join("\n");
|
79
|
-
} else {
|
80
|
-
text = `${message}`;
|
81
|
-
}
|
82
|
-
const log = label.length > 0 ? `${label} ${text}` : text;
|
83
|
-
console.log(log, ...args);
|
84
|
-
}
|
85
|
-
getLongestLabel() {
|
86
|
-
let longestLabel = "";
|
87
|
-
Object.keys(this.types).forEach((type) => {
|
88
|
-
const { label = "" } = this.types[type];
|
89
|
-
if (label.length > longestLabel.length) {
|
90
|
-
longestLabel = label;
|
91
|
-
}
|
92
|
-
});
|
93
|
-
return longestLabel;
|
94
|
-
}
|
95
|
-
constructor(options = {}) {
|
96
|
-
this.level = options.level || LOG_TYPES.log.level;
|
97
|
-
this.config = {
|
98
|
-
...DEFAULT_CONFIG,
|
99
|
-
...options.config || {}
|
100
|
-
};
|
101
|
-
this.types = {
|
102
|
-
...LOG_TYPES,
|
103
|
-
...options.types || {}
|
104
|
-
};
|
105
|
-
this.longestLabel = this.getLongestLabel();
|
106
|
-
Object.keys(this.types).forEach((type) => {
|
107
|
-
this[type] = this._log.bind(this, type);
|
108
|
-
});
|
109
|
-
}
|
110
|
-
}
|
111
|
-
const logger = new Logger();
|
112
|
-
logger.Logger = Logger;
|
1
|
+
import { logger, createLogger } from "rslog";
|
113
2
|
export {
|
114
|
-
|
115
|
-
isErrorStackMessage,
|
3
|
+
createLogger,
|
116
4
|
logger
|
117
5
|
};
|
@@ -1,69 +1 @@
|
|
1
|
-
|
2
|
-
type LogLevel = 'debug' | 'info' | 'warn' | 'error';
|
3
|
-
type LogMsg = number | string | Error | null;
|
4
|
-
interface LoggerConfiguration {
|
5
|
-
color?: typeof Color;
|
6
|
-
label?: string;
|
7
|
-
level?: LogLevel;
|
8
|
-
}
|
9
|
-
interface InstanceConfiguration {
|
10
|
-
displayLabel?: boolean;
|
11
|
-
uppercaseLabel?: boolean;
|
12
|
-
}
|
13
|
-
interface ConstructorOptions {
|
14
|
-
config?: InstanceConfiguration;
|
15
|
-
level?: string;
|
16
|
-
types?: Record<string, LoggerConfiguration>;
|
17
|
-
}
|
18
|
-
type LoggerFunction = (message?: LogMsg, ...args: any[]) => void;
|
19
|
-
declare const LOG_TYPES: {
|
20
|
-
error: {
|
21
|
-
color: string;
|
22
|
-
label: string;
|
23
|
-
level: string;
|
24
|
-
};
|
25
|
-
info: {
|
26
|
-
color: string;
|
27
|
-
label: string;
|
28
|
-
level: string;
|
29
|
-
};
|
30
|
-
ready: {
|
31
|
-
color: string;
|
32
|
-
label: string;
|
33
|
-
level: string;
|
34
|
-
};
|
35
|
-
success: {
|
36
|
-
color: string;
|
37
|
-
label: string;
|
38
|
-
level: string;
|
39
|
-
};
|
40
|
-
warn: {
|
41
|
-
color: string;
|
42
|
-
label: string;
|
43
|
-
level: string;
|
44
|
-
};
|
45
|
-
debug: {
|
46
|
-
color: string;
|
47
|
-
label: string;
|
48
|
-
level: string;
|
49
|
-
};
|
50
|
-
log: {
|
51
|
-
level: string;
|
52
|
-
};
|
53
|
-
};
|
54
|
-
export declare const isErrorStackMessage: (message: string) => boolean;
|
55
|
-
declare class Logger {
|
56
|
-
private readonly level;
|
57
|
-
private readonly config;
|
58
|
-
private readonly types;
|
59
|
-
private readonly longestLabel;
|
60
|
-
[key: string]: any;
|
61
|
-
constructor(options?: ConstructorOptions);
|
62
|
-
private _log;
|
63
|
-
private getLongestLabel;
|
64
|
-
}
|
65
|
-
type LoggerInterface = { [key in keyof typeof LOG_TYPES]: LoggerFunction };
|
66
|
-
declare const logger: Logger & LoggerInterface;
|
67
|
-
export { Logger };
|
68
|
-
export { logger };
|
69
|
-
export type { LoggerInterface };
|
1
|
+
export { logger, createLogger, type Logger } from 'rslog';
|
package/package.json
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
"modern",
|
16
16
|
"modern.js"
|
17
17
|
],
|
18
|
-
"version": "0.0.0-nightly-
|
18
|
+
"version": "0.0.0-nightly-20231003160547",
|
19
19
|
"jsnext:source": "./src/index.ts",
|
20
20
|
"types": "./dist/types/index.d.ts",
|
21
21
|
"main": "./dist/cjs/index.js",
|
@@ -68,7 +68,6 @@
|
|
68
68
|
"./browserslist": "./dist/compiled/browserslist/index.js",
|
69
69
|
"./webpack-chain": "./dist/compiled/webpack-chain/index.js",
|
70
70
|
"./tsconfig-paths": "./dist/compiled/tsconfig-paths/index.js",
|
71
|
-
"./gradient-string": "./dist/compiled/gradient-string/index.js",
|
72
71
|
"./better-ajv-errors": "./dist/compiled/better-ajv-errors/index.js"
|
73
72
|
},
|
74
73
|
"publishConfig": {
|
@@ -147,9 +146,6 @@
|
|
147
146
|
"tsconfig-paths": [
|
148
147
|
"./dist/compiled/tsconfig-paths/lib/index.d.ts"
|
149
148
|
],
|
150
|
-
"gradient-string": [
|
151
|
-
"./dist/compiled/gradient-string/index.d.ts"
|
152
|
-
],
|
153
149
|
"better-ajv-errors": [
|
154
150
|
"./dist/compiled/better-ajv-errors/index.d.ts"
|
155
151
|
],
|
@@ -164,6 +160,7 @@
|
|
164
160
|
"dependencies": {
|
165
161
|
"caniuse-lite": "^1.0.30001520",
|
166
162
|
"lodash": "^4.17.21",
|
163
|
+
"rslog": "^1.0.0",
|
167
164
|
"@swc/helpers": "0.5.1"
|
168
165
|
},
|
169
166
|
"devDependencies": {
|
@@ -172,9 +169,9 @@
|
|
172
169
|
"jest": "^29",
|
173
170
|
"typescript": "^5",
|
174
171
|
"webpack": "^5.88.1",
|
175
|
-
"@modern-js/types": "0.0.0-nightly-
|
176
|
-
"@scripts/build": "0.0.0-nightly-
|
177
|
-
"@scripts/jest-config": "0.0.0-nightly-
|
172
|
+
"@modern-js/types": "0.0.0-nightly-20231003160547",
|
173
|
+
"@scripts/build": "0.0.0-nightly-20231003160547",
|
174
|
+
"@scripts/jest-config": "0.0.0-nightly-20231003160547"
|
178
175
|
},
|
179
176
|
"sideEffects": false,
|
180
177
|
"scripts": {
|
@@ -1 +0,0 @@
|
|
1
|
-
export = any;
|
@@ -1 +0,0 @@
|
|
1
|
-
(()=>{var t={743:(t,r,e)=>{"use strict";const o=e(234);const n=e(960);const i=/\s/g;function InitGradient(...t){const r=n.apply(this,t);const ret=(t,e)=>applyGradient(t?t.toString():"",r,e);ret.multiline=(t,e)=>multilineGradient(t?t.toString():"",r,e);return ret}const getColors=(t,r,e)=>r.interpolation.toLowerCase()==="hsv"?t.hsv(e,r.hsvSpin.toLowerCase()):t.rgb(e);function applyGradient(t,r,e){const n=validateOptions(e);const a=Math.max(t.replace(i,"").length,r.stops.length);const s=getColors(r,n,a);let l="";for(const r of t){l+=r.match(i)?r:o.hex(s.shift().toHex())(r)}return l}function multilineGradient(t,r,e){const n=validateOptions(e);const i=t.split("\n");const a=Math.max.apply(null,i.map((t=>t.length)).concat([r.stops.length]));const s=getColors(r,n,a);const l=[];for(const t of i){const r=s.slice(0);let e="";for(const n of t){e+=o.hex(r.shift().toHex())(n)}l.push(e)}return l.join("\n")}function validateOptions(t){const r={interpolation:"rgb",hsvSpin:"short",...t};if(t!==undefined&&typeof t!=="object"){throw new TypeError(`Expected \`options\` to be an \`object\`, got \`${typeof t}\``)}if(typeof r.interpolation!=="string"){throw new TypeError(`Expected \`options.interpolation\` to be a \`string\`, got \`${typeof r.interpolation}\``)}if(r.interpolation.toLowerCase()==="hsv"&&typeof r.hsvSpin!=="string"){throw new TypeError(`Expected \`options.hsvSpin\` to be a \`string\`, got \`${typeof r.hsvSpin}\``)}return r}const a={atlas:{colors:["#feac5e","#c779d0","#4bc0c8"],options:{}},cristal:{colors:["#bdfff3","#4ac29a"],options:{}},teen:{colors:["#77a1d3","#79cbca","#e684ae"],options:{}},mind:{colors:["#473b7b","#3584a7","#30d2be"],options:{}},morning:{colors:["#ff5f6d","#ffc371"],options:{interpolation:"hsv"}},vice:{colors:["#5ee7df","#b490ca"],options:{interpolation:"hsv"}},passion:{colors:["#f43b47","#453a94"],options:{}},fruit:{colors:["#ff4e50","#f9d423"],options:{}},instagram:{colors:["#833ab4","#fd1d1d","#fcb045"],options:{}},retro:{colors:["#3f51b1","#5a55ae","#7b5fac","#8f6aae","#a86aa4","#cc6b8e","#f18271","#f3a469","#f7c978"],options:{}},summer:{colors:["#fdbb2d","#22c1c3"],options:{}},rainbow:{colors:["#ff0000","#ff0100"],options:{interpolation:"hsv",hsvSpin:"long"}},pastel:{colors:["#74ebd5","#74ecd5"],options:{interpolation:"hsv",hsvSpin:"long"}}};t.exports=InitGradient;for(const r in a){t.exports[r]=t=>new InitGradient(a[r].colors)(t,a[r].options);t.exports[r].multiline=t=>new InitGradient(a[r].colors).multiline(t,a[r].options)}},960:(t,r,e)=>{const o=e(677);const n={r:256,g:256,b:256,a:1};const i={h:360,s:1,v:1,a:1};function stepize(t,r,e){let o={};for(let n in t){if(t.hasOwnProperty(n)){o[n]=e===0?0:(r[n]-t[n])/e}}return o}function interpolate(t,r,e,o){let n={};for(let i in r){if(r.hasOwnProperty(i)){n[i]=t[i]*e+r[i];n[i]=n[i]<0?n[i]+o[i]:o[i]!==1?n[i]%o[i]:n[i]}}return n}function interpolateRgb(t,r,e){const i=t.color.toRgb();const a=r.color.toRgb();const s=stepize(i,a,e);let l=[t.color];for(let t=1;t<e;t++){const r=interpolate(s,i,t,n);l.push(o(r))}return l}function interpolateHsv(t,r,e,n){const a=t.color.toHsv();const s=r.color.toHsv();if(a.s===0||s.s===0){return interpolateRgb(t,r,e)}let l;if(typeof n==="boolean"){l=n}else{const t=a.h<s.h&&s.h-a.h<180||a.h>s.h&&a.h-s.h>180;l=n==="long"&&t||n==="short"&&!t}const c=stepize(a,s,e);let f=[t.color];let h;if(a.h<=s.h&&!l||a.h>=s.h&&l){h=s.h-a.h}else if(l){h=360-s.h+a.h}else{h=360-a.h+s.h}c.h=Math.pow(-1,l?1:0)*Math.abs(h)/e;for(let t=1;t<e;t++){const r=interpolate(c,a,t,i);f.push(o(r))}return f}function computeSubsteps(t,r){const e=t.length;r=parseInt(r,10);if(isNaN(r)||r<2){throw new Error("Invalid number of steps (< 2)")}if(r<e){throw new Error("Number of steps cannot be inferior to number of stops")}let o=[];for(let n=1;n<e;n++){const e=(r-1)*(t[n].pos-t[n-1].pos);o.push(Math.max(1,Math.round(e)))}let n=1;for(let t=e-1;t--;)n+=o[t];while(n!==r){if(n<r){const t=Math.min.apply(null,o);o[o.indexOf(t)]++;n++}else{const t=Math.max.apply(null,o);o[o.indexOf(t)]--;n--}}return o}function computeAt(t,r,e,n){if(r<0||r>1){throw new Error("Position must be between 0 and 1")}let i,a;for(let e=0,o=t.length;e<o-1;e++){if(r>=t[e].pos&&r<t[e+1].pos){i=t[e];a=t[e+1];break}}if(!i){i=a=t[t.length-1]}const s=stepize(i.color[e](),a.color[e](),(a.pos-i.pos)*100);const l=interpolate(s,i.color[e](),(r-i.pos)*100,n);return o(l)}class TinyGradient{constructor(t){if(t.length<2){throw new Error("Invalid number of stops (< 2)")}const r=t[0].pos!==undefined;let e=t.length;let n=-1;let i=false;this.stops=t.map(((t,a)=>{const s=t.pos!==undefined;if(r^s){throw new Error("Cannot mix positionned and not posionned color stops")}if(s){const r=t.color!==undefined;if(!r&&(i||a===0||a===e-1)){throw new Error("Cannot define two consecutive position-only stops")}i=!r;t={color:r?o(t.color):null,colorLess:!r,pos:t.pos};if(t.pos<0||t.pos>1){throw new Error("Color stops positions must be between 0 and 1")}else if(t.pos<n){throw new Error("Color stops positions are not ordered")}n=t.pos}else{t={color:o(t.color!==undefined?t.color:t),pos:a/(e-1)}}return t}));if(this.stops[0].pos!==0){this.stops.unshift({color:this.stops[0].color,pos:0});e++}if(this.stops[e-1].pos!==1){this.stops.push({color:this.stops[e-1].color,pos:1})}}reverse(){let t=[];this.stops.forEach((function(r){t.push({color:r.color,pos:1-r.pos})}));return new TinyGradient(t.reverse())}loop(){let t=[];let r=[];this.stops.forEach((r=>{t.push({color:r.color,pos:r.pos/2})}));this.stops.slice(0,-1).forEach((t=>{r.push({color:t.color,pos:1-t.pos/2})}));return new TinyGradient(t.concat(r.reverse()))}rgb(t){const r=computeSubsteps(this.stops,t);let e=[];this.stops.forEach(((t,r)=>{if(t.colorLess){t.color=interpolateRgb(this.stops[r-1],this.stops[r+1],2)[1]}}));for(let t=0,o=this.stops.length;t<o-1;t++){const o=interpolateRgb(this.stops[t],this.stops[t+1],r[t]);e.splice(e.length,0,...o)}e.push(this.stops[this.stops.length-1].color);return e}hsv(t,r){const e=computeSubsteps(this.stops,t);let o=[];this.stops.forEach(((t,e)=>{if(t.colorLess){t.color=interpolateHsv(this.stops[e-1],this.stops[e+1],2,r)[1]}}));for(let t=0,n=this.stops.length;t<n-1;t++){const n=interpolateHsv(this.stops[t],this.stops[t+1],e[t],r);o.splice(o.length,0,...n)}o.push(this.stops[this.stops.length-1].color);return o}css(t,r){t=t||"linear";r=r||(t==="linear"?"to right":"ellipse at center");let e=t+"-gradient("+r;this.stops.forEach((function(t){e+=", "+(t.colorLess?"":t.color.toRgbString()+" ")+t.pos*100+"%"}));e+=")";return e}rgbAt(t){return computeAt(this.stops,t,"toRgb",n)}hsvAt(t){return computeAt(this.stops,t,"toHsv",i)}}t.exports=function(t){if(arguments.length===1){if(!Array.isArray(arguments[0])){throw new Error('"stops" is not an array')}t=arguments[0]}else{t=Array.prototype.slice.call(arguments)}return new TinyGradient(t)}},234:t=>{"use strict";t.exports=require("../chalk")},677:function(t){(function(r,e){true?t.exports=e():0})(this,(function(){"use strict";function _typeof(t){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}var t=/^\s+/;var r=/\s+$/;function tinycolor(t,r){t=t?t:"";r=r||{};if(t instanceof tinycolor){return t}if(!(this instanceof tinycolor)){return new tinycolor(t,r)}var e=inputToRGB(t);this._originalInput=t,this._r=e.r,this._g=e.g,this._b=e.b,this._a=e.a,this._roundA=Math.round(100*this._a)/100,this._format=r.format||e.format;this._gradientType=r.gradientType;if(this._r<1)this._r=Math.round(this._r);if(this._g<1)this._g=Math.round(this._g);if(this._b<1)this._b=Math.round(this._b);this._ok=e.ok}tinycolor.prototype={isDark:function isDark(){return this.getBrightness()<128},isLight:function isLight(){return!this.isDark()},isValid:function isValid(){return this._ok},getOriginalInput:function getOriginalInput(){return this._originalInput},getFormat:function getFormat(){return this._format},getAlpha:function getAlpha(){return this._a},getBrightness:function getBrightness(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},getLuminance:function getLuminance(){var t=this.toRgb();var r,e,o,n,i,a;r=t.r/255;e=t.g/255;o=t.b/255;if(r<=.03928)n=r/12.92;else n=Math.pow((r+.055)/1.055,2.4);if(e<=.03928)i=e/12.92;else i=Math.pow((e+.055)/1.055,2.4);if(o<=.03928)a=o/12.92;else a=Math.pow((o+.055)/1.055,2.4);return.2126*n+.7152*i+.0722*a},setAlpha:function setAlpha(t){this._a=boundAlpha(t);this._roundA=Math.round(100*this._a)/100;return this},toHsv:function toHsv(){var t=rgbToHsv(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString:function toHsvString(){var t=rgbToHsv(this._r,this._g,this._b);var r=Math.round(t.h*360),e=Math.round(t.s*100),o=Math.round(t.v*100);return this._a==1?"hsv("+r+", "+e+"%, "+o+"%)":"hsva("+r+", "+e+"%, "+o+"%, "+this._roundA+")"},toHsl:function toHsl(){var t=rgbToHsl(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function toHslString(){var t=rgbToHsl(this._r,this._g,this._b);var r=Math.round(t.h*360),e=Math.round(t.s*100),o=Math.round(t.l*100);return this._a==1?"hsl("+r+", "+e+"%, "+o+"%)":"hsla("+r+", "+e+"%, "+o+"%, "+this._roundA+")"},toHex:function toHex(t){return rgbToHex(this._r,this._g,this._b,t)},toHexString:function toHexString(t){return"#"+this.toHex(t)},toHex8:function toHex8(t){return rgbaToHex(this._r,this._g,this._b,this._a,t)},toHex8String:function toHex8String(t){return"#"+this.toHex8(t)},toRgb:function toRgb(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function toRgbString(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function toPercentageRgb(){return{r:Math.round(bound01(this._r,255)*100)+"%",g:Math.round(bound01(this._g,255)*100)+"%",b:Math.round(bound01(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function toPercentageRgbString(){return this._a==1?"rgb("+Math.round(bound01(this._r,255)*100)+"%, "+Math.round(bound01(this._g,255)*100)+"%, "+Math.round(bound01(this._b,255)*100)+"%)":"rgba("+Math.round(bound01(this._r,255)*100)+"%, "+Math.round(bound01(this._g,255)*100)+"%, "+Math.round(bound01(this._b,255)*100)+"%, "+this._roundA+")"},toName:function toName(){if(this._a===0){return"transparent"}if(this._a<1){return false}return o[rgbToHex(this._r,this._g,this._b,true)]||false},toFilter:function toFilter(t){var r="#"+rgbaToArgbHex(this._r,this._g,this._b,this._a);var e=r;var o=this._gradientType?"GradientType = 1, ":"";if(t){var n=tinycolor(t);e="#"+rgbaToArgbHex(n._r,n._g,n._b,n._a)}return"progid:DXImageTransform.Microsoft.gradient("+o+"startColorstr="+r+",endColorstr="+e+")"},toString:function toString(t){var r=!!t;t=t||this._format;var e=false;var o=this._a<1&&this._a>=0;var n=!r&&o&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");if(n){if(t==="name"&&this._a===0){return this.toName()}return this.toRgbString()}if(t==="rgb"){e=this.toRgbString()}if(t==="prgb"){e=this.toPercentageRgbString()}if(t==="hex"||t==="hex6"){e=this.toHexString()}if(t==="hex3"){e=this.toHexString(true)}if(t==="hex4"){e=this.toHex8String(true)}if(t==="hex8"){e=this.toHex8String()}if(t==="name"){e=this.toName()}if(t==="hsl"){e=this.toHslString()}if(t==="hsv"){e=this.toHsvString()}return e||this.toHexString()},clone:function clone(){return tinycolor(this.toString())},_applyModification:function _applyModification(t,r){var e=t.apply(null,[this].concat([].slice.call(r)));this._r=e._r;this._g=e._g;this._b=e._b;this.setAlpha(e._a);return this},lighten:function lighten(){return this._applyModification(_lighten,arguments)},brighten:function brighten(){return this._applyModification(_brighten,arguments)},darken:function darken(){return this._applyModification(_darken,arguments)},desaturate:function desaturate(){return this._applyModification(_desaturate,arguments)},saturate:function saturate(){return this._applyModification(_saturate,arguments)},greyscale:function greyscale(){return this._applyModification(_greyscale,arguments)},spin:function spin(){return this._applyModification(_spin,arguments)},_applyCombination:function _applyCombination(t,r){return t.apply(null,[this].concat([].slice.call(r)))},analogous:function analogous(){return this._applyCombination(_analogous,arguments)},complement:function complement(){return this._applyCombination(_complement,arguments)},monochromatic:function monochromatic(){return this._applyCombination(_monochromatic,arguments)},splitcomplement:function splitcomplement(){return this._applyCombination(_splitcomplement,arguments)},triad:function triad(){return this._applyCombination(polyad,[3])},tetrad:function tetrad(){return this._applyCombination(polyad,[4])}};tinycolor.fromRatio=function(t,r){if(_typeof(t)=="object"){var e={};for(var o in t){if(t.hasOwnProperty(o)){if(o==="a"){e[o]=t[o]}else{e[o]=convertToPercentage(t[o])}}}t=e}return tinycolor(t,r)};function inputToRGB(t){var r={r:0,g:0,b:0};var e=1;var o=null;var n=null;var i=null;var a=false;var s=false;if(typeof t=="string"){t=stringInputToObject(t)}if(_typeof(t)=="object"){if(isValidCSSUnit(t.r)&&isValidCSSUnit(t.g)&&isValidCSSUnit(t.b)){r=rgbToRgb(t.r,t.g,t.b);a=true;s=String(t.r).substr(-1)==="%"?"prgb":"rgb"}else if(isValidCSSUnit(t.h)&&isValidCSSUnit(t.s)&&isValidCSSUnit(t.v)){o=convertToPercentage(t.s);n=convertToPercentage(t.v);r=hsvToRgb(t.h,o,n);a=true;s="hsv"}else if(isValidCSSUnit(t.h)&&isValidCSSUnit(t.s)&&isValidCSSUnit(t.l)){o=convertToPercentage(t.s);i=convertToPercentage(t.l);r=hslToRgb(t.h,o,i);a=true;s="hsl"}if(t.hasOwnProperty("a")){e=t.a}}e=boundAlpha(e);return{ok:a,format:t.format||s,r:Math.min(255,Math.max(r.r,0)),g:Math.min(255,Math.max(r.g,0)),b:Math.min(255,Math.max(r.b,0)),a:e}}function rgbToRgb(t,r,e){return{r:bound01(t,255)*255,g:bound01(r,255)*255,b:bound01(e,255)*255}}function rgbToHsl(t,r,e){t=bound01(t,255);r=bound01(r,255);e=bound01(e,255);var o=Math.max(t,r,e),n=Math.min(t,r,e);var i,a,s=(o+n)/2;if(o==n){i=a=0}else{var l=o-n;a=s>.5?l/(2-o-n):l/(o+n);switch(o){case t:i=(r-e)/l+(r<e?6:0);break;case r:i=(e-t)/l+2;break;case e:i=(t-r)/l+4;break}i/=6}return{h:i,s:a,l:s}}function hslToRgb(t,r,e){var o,n,i;t=bound01(t,360);r=bound01(r,100);e=bound01(e,100);function hue2rgb(t,r,e){if(e<0)e+=1;if(e>1)e-=1;if(e<1/6)return t+(r-t)*6*e;if(e<1/2)return r;if(e<2/3)return t+(r-t)*(2/3-e)*6;return t}if(r===0){o=n=i=e}else{var a=e<.5?e*(1+r):e+r-e*r;var s=2*e-a;o=hue2rgb(s,a,t+1/3);n=hue2rgb(s,a,t);i=hue2rgb(s,a,t-1/3)}return{r:o*255,g:n*255,b:i*255}}function rgbToHsv(t,r,e){t=bound01(t,255);r=bound01(r,255);e=bound01(e,255);var o=Math.max(t,r,e),n=Math.min(t,r,e);var i,a,s=o;var l=o-n;a=o===0?0:l/o;if(o==n){i=0}else{switch(o){case t:i=(r-e)/l+(r<e?6:0);break;case r:i=(e-t)/l+2;break;case e:i=(t-r)/l+4;break}i/=6}return{h:i,s:a,v:s}}function hsvToRgb(t,r,e){t=bound01(t,360)*6;r=bound01(r,100);e=bound01(e,100);var o=Math.floor(t),n=t-o,i=e*(1-r),a=e*(1-n*r),s=e*(1-(1-n)*r),l=o%6,c=[e,a,i,i,s,e][l],f=[s,e,e,a,i,i][l],h=[i,i,s,e,e,a][l];return{r:c*255,g:f*255,b:h*255}}function rgbToHex(t,r,e,o){var n=[pad2(Math.round(t).toString(16)),pad2(Math.round(r).toString(16)),pad2(Math.round(e).toString(16))];if(o&&n[0].charAt(0)==n[0].charAt(1)&&n[1].charAt(0)==n[1].charAt(1)&&n[2].charAt(0)==n[2].charAt(1)){return n[0].charAt(0)+n[1].charAt(0)+n[2].charAt(0)}return n.join("")}function rgbaToHex(t,r,e,o,n){var i=[pad2(Math.round(t).toString(16)),pad2(Math.round(r).toString(16)),pad2(Math.round(e).toString(16)),pad2(convertDecimalToHex(o))];if(n&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)&&i[3].charAt(0)==i[3].charAt(1)){return i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0)}return i.join("")}function rgbaToArgbHex(t,r,e,o){var n=[pad2(convertDecimalToHex(o)),pad2(Math.round(t).toString(16)),pad2(Math.round(r).toString(16)),pad2(Math.round(e).toString(16))];return n.join("")}tinycolor.equals=function(t,r){if(!t||!r)return false;return tinycolor(t).toRgbString()==tinycolor(r).toRgbString()};tinycolor.random=function(){return tinycolor.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function _desaturate(t,r){r=r===0?0:r||10;var e=tinycolor(t).toHsl();e.s-=r/100;e.s=clamp01(e.s);return tinycolor(e)}function _saturate(t,r){r=r===0?0:r||10;var e=tinycolor(t).toHsl();e.s+=r/100;e.s=clamp01(e.s);return tinycolor(e)}function _greyscale(t){return tinycolor(t).desaturate(100)}function _lighten(t,r){r=r===0?0:r||10;var e=tinycolor(t).toHsl();e.l+=r/100;e.l=clamp01(e.l);return tinycolor(e)}function _brighten(t,r){r=r===0?0:r||10;var e=tinycolor(t).toRgb();e.r=Math.max(0,Math.min(255,e.r-Math.round(255*-(r/100))));e.g=Math.max(0,Math.min(255,e.g-Math.round(255*-(r/100))));e.b=Math.max(0,Math.min(255,e.b-Math.round(255*-(r/100))));return tinycolor(e)}function _darken(t,r){r=r===0?0:r||10;var e=tinycolor(t).toHsl();e.l-=r/100;e.l=clamp01(e.l);return tinycolor(e)}function _spin(t,r){var e=tinycolor(t).toHsl();var o=(e.h+r)%360;e.h=o<0?360+o:o;return tinycolor(e)}function _complement(t){var r=tinycolor(t).toHsl();r.h=(r.h+180)%360;return tinycolor(r)}function polyad(t,r){if(isNaN(r)||r<=0){throw new Error("Argument to polyad must be a positive number")}var e=tinycolor(t).toHsl();var o=[tinycolor(t)];var n=360/r;for(var i=1;i<r;i++){o.push(tinycolor({h:(e.h+i*n)%360,s:e.s,l:e.l}))}return o}function _splitcomplement(t){var r=tinycolor(t).toHsl();var e=r.h;return[tinycolor(t),tinycolor({h:(e+72)%360,s:r.s,l:r.l}),tinycolor({h:(e+216)%360,s:r.s,l:r.l})]}function _analogous(t,r,e){r=r||6;e=e||30;var o=tinycolor(t).toHsl();var n=360/e;var i=[tinycolor(t)];for(o.h=(o.h-(n*r>>1)+720)%360;--r;){o.h=(o.h+n)%360;i.push(tinycolor(o))}return i}function _monochromatic(t,r){r=r||6;var e=tinycolor(t).toHsv();var o=e.h,n=e.s,i=e.v;var a=[];var s=1/r;while(r--){a.push(tinycolor({h:o,s:n,v:i}));i=(i+s)%1}return a}tinycolor.mix=function(t,r,e){e=e===0?0:e||50;var o=tinycolor(t).toRgb();var n=tinycolor(r).toRgb();var i=e/100;var a={r:(n.r-o.r)*i+o.r,g:(n.g-o.g)*i+o.g,b:(n.b-o.b)*i+o.b,a:(n.a-o.a)*i+o.a};return tinycolor(a)};tinycolor.readability=function(t,r){var e=tinycolor(t);var o=tinycolor(r);return(Math.max(e.getLuminance(),o.getLuminance())+.05)/(Math.min(e.getLuminance(),o.getLuminance())+.05)};tinycolor.isReadable=function(t,r,e){var o=tinycolor.readability(t,r);var n,i;i=false;n=validateWCAG2Parms(e);switch(n.level+n.size){case"AAsmall":case"AAAlarge":i=o>=4.5;break;case"AAlarge":i=o>=3;break;case"AAAsmall":i=o>=7;break}return i};tinycolor.mostReadable=function(t,r,e){var o=null;var n=0;var i;var a,s,l;e=e||{};a=e.includeFallbackColors;s=e.level;l=e.size;for(var c=0;c<r.length;c++){i=tinycolor.readability(t,r[c]);if(i>n){n=i;o=tinycolor(r[c])}}if(tinycolor.isReadable(t,o,{level:s,size:l})||!a){return o}else{e.includeFallbackColors=false;return tinycolor.mostReadable(t,["#fff","#000"],e)}};var e=tinycolor.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};var o=tinycolor.hexNames=flip(e);function flip(t){var r={};for(var e in t){if(t.hasOwnProperty(e)){r[t[e]]=e}}return r}function boundAlpha(t){t=parseFloat(t);if(isNaN(t)||t<0||t>1){t=1}return t}function bound01(t,r){if(isOnePointZero(t))t="100%";var e=isPercentage(t);t=Math.min(r,Math.max(0,parseFloat(t)));if(e){t=parseInt(t*r,10)/100}if(Math.abs(t-r)<1e-6){return 1}return t%r/parseFloat(r)}function clamp01(t){return Math.min(1,Math.max(0,t))}function parseIntFromHex(t){return parseInt(t,16)}function isOnePointZero(t){return typeof t=="string"&&t.indexOf(".")!=-1&&parseFloat(t)===1}function isPercentage(t){return typeof t==="string"&&t.indexOf("%")!=-1}function pad2(t){return t.length==1?"0"+t:""+t}function convertToPercentage(t){if(t<=1){t=t*100+"%"}return t}function convertDecimalToHex(t){return Math.round(parseFloat(t)*255).toString(16)}function convertHexToDecimal(t){return parseIntFromHex(t)/255}var n=function(){var t="[-\\+]?\\d+%?";var r="[-\\+]?\\d*\\.\\d+%?";var e="(?:"+r+")|(?:"+t+")";var o="[\\s|\\(]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")\\s*\\)?";var n="[\\s|\\(]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")\\s*\\)?";return{CSS_UNIT:new RegExp(e),rgb:new RegExp("rgb"+o),rgba:new RegExp("rgba"+n),hsl:new RegExp("hsl"+o),hsla:new RegExp("hsla"+n),hsv:new RegExp("hsv"+o),hsva:new RegExp("hsva"+n),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function isValidCSSUnit(t){return!!n.CSS_UNIT.exec(t)}function stringInputToObject(o){o=o.replace(t,"").replace(r,"").toLowerCase();var i=false;if(e[o]){o=e[o];i=true}else if(o=="transparent"){return{r:0,g:0,b:0,a:0,format:"name"}}var a;if(a=n.rgb.exec(o)){return{r:a[1],g:a[2],b:a[3]}}if(a=n.rgba.exec(o)){return{r:a[1],g:a[2],b:a[3],a:a[4]}}if(a=n.hsl.exec(o)){return{h:a[1],s:a[2],l:a[3]}}if(a=n.hsla.exec(o)){return{h:a[1],s:a[2],l:a[3],a:a[4]}}if(a=n.hsv.exec(o)){return{h:a[1],s:a[2],v:a[3]}}if(a=n.hsva.exec(o)){return{h:a[1],s:a[2],v:a[3],a:a[4]}}if(a=n.hex8.exec(o)){return{r:parseIntFromHex(a[1]),g:parseIntFromHex(a[2]),b:parseIntFromHex(a[3]),a:convertHexToDecimal(a[4]),format:i?"name":"hex8"}}if(a=n.hex6.exec(o)){return{r:parseIntFromHex(a[1]),g:parseIntFromHex(a[2]),b:parseIntFromHex(a[3]),format:i?"name":"hex"}}if(a=n.hex4.exec(o)){return{r:parseIntFromHex(a[1]+""+a[1]),g:parseIntFromHex(a[2]+""+a[2]),b:parseIntFromHex(a[3]+""+a[3]),a:convertHexToDecimal(a[4]+""+a[4]),format:i?"name":"hex8"}}if(a=n.hex3.exec(o)){return{r:parseIntFromHex(a[1]+""+a[1]),g:parseIntFromHex(a[2]+""+a[2]),b:parseIntFromHex(a[3]+""+a[3]),format:i?"name":"hex"}}return false}function validateWCAG2Parms(t){var r,e;t=t||{level:"AA",size:"small"};r=(t.level||"AA").toUpperCase();e=(t.size||"small").toLowerCase();if(r!=="AA"&&r!=="AAA"){r="AA"}if(e!=="small"&&e!=="large"){e="small"}return{level:r,size:e}}return tinycolor}))}};var r={};function __nccwpck_require__(e){var o=r[e];if(o!==undefined){return o.exports}var n=r[e]={exports:{}};var i=true;try{t[e].call(n.exports,n,n.exports,__nccwpck_require__);i=false}finally{if(i)delete r[e]}return n.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var e=__nccwpck_require__(743);module.exports=e})();
|
@@ -1,21 +0,0 @@
|
|
1
|
-
MIT License
|
2
|
-
|
3
|
-
Copyright (c) 2017 Boris K
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
13
|
-
copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
-
SOFTWARE.
|
@@ -1 +0,0 @@
|
|
1
|
-
{"name":"gradient-string","author":"Boris K","version":"2.0.2","license":"MIT","types":"index.d.ts"}
|