@briklab/lib 1.2.0-test → 1.2.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/dist/cli-john/index.d.ts +6 -2
- package/dist/cli-john/index.js +15 -459
- package/dist/cli-john/index.js.map +2 -2
- package/dist/color/index.js +7 -205
- package/dist/color/index.js.map +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/jstc/index.js +5 -97
- package/dist/jstc/index.js.map +2 -2
- package/dist/stylesheet/index.js +14 -251
- package/dist/stylesheet/index.js.map +2 -2
- package/dist/warner/index.d.ts +1 -0
- package/dist/warner/index.js +4 -169
- package/dist/warner/index.js.map +2 -2
- package/package.json +2 -2
package/dist/stylesheet/index.js
CHANGED
|
@@ -1,251 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
};
|
|
16
|
-
var _InlineStyle_instances, _InlineStyle_cssStyleDec, _InlineStyle_convertFieldToHyphenCase, _InlineStyle_convertKeysToValidCSS, _InlineStyle_styleObject, _StyleSheet_styles;
|
|
17
|
-
import JSTC from "../jstc/index.js";
|
|
18
|
-
import { warner } from "../warner/index.js";
|
|
19
|
-
import { CSSStyleDeclaration as UUIII } from "cssom";
|
|
20
|
-
import Color from "../color/index.js";
|
|
21
|
-
/**
|
|
22
|
-
* # InlineStyle
|
|
23
|
-
* @classdesc Create a CSS Inline style.
|
|
24
|
-
* @class
|
|
25
|
-
*/
|
|
26
|
-
class InlineStyle {
|
|
27
|
-
/**
|
|
28
|
-
* ## constructor
|
|
29
|
-
* construct a InlineStyle
|
|
30
|
-
*/
|
|
31
|
-
constructor(styleObject) {
|
|
32
|
-
_InlineStyle_instances.add(this);
|
|
33
|
-
_InlineStyle_cssStyleDec.set(this, void 0);
|
|
34
|
-
_InlineStyle_styleObject.set(this, void 0);
|
|
35
|
-
if (!JSTC.for([styleObject]).check(["object|undefined"])) {
|
|
36
|
-
warner.warn({ message: `[InlineStyle class] @briklab/lib/stylesheet: Invalid first argument!
|
|
37
|
-
Hint: The first argument must be a valid style object or not be given!
|
|
38
|
-
Using {"imeMode":${styleObject}} as fallback` });
|
|
39
|
-
styleObject = { imeMode: `${styleObject}` };
|
|
40
|
-
}
|
|
41
|
-
__classPrivateFieldSet(this, _InlineStyle_styleObject, styleObject, "f");
|
|
42
|
-
__classPrivateFieldSet(this, _InlineStyle_cssStyleDec, new UUIII(), "f");
|
|
43
|
-
}
|
|
44
|
-
generate() {
|
|
45
|
-
let a = __classPrivateFieldGet(this, _InlineStyle_cssStyleDec, "f");
|
|
46
|
-
let b = __classPrivateFieldGet(this, _InlineStyle_styleObject, "f");
|
|
47
|
-
let c = Object.keys(b);
|
|
48
|
-
let d = Object.values(b);
|
|
49
|
-
for (let i = 0; i < c.length; i++) {
|
|
50
|
-
const prop = c[i];
|
|
51
|
-
let val = d[i];
|
|
52
|
-
if (val == null) {
|
|
53
|
-
warner.warn({ message: `[InlineStyle.generate] @briklab/lib/stylesheet: Skipping property "${prop}" with ${String(val)} value. Hint: avoid null/undefined style values.` });
|
|
54
|
-
continue;
|
|
55
|
-
}
|
|
56
|
-
if (typeof val !== "string") {
|
|
57
|
-
warner.warn({ message: `[InlineStyle.generate] @briklab/lib/stylesheet: Non-string style value for "${prop}" (type=${typeof val}). Coercing to string.` });
|
|
58
|
-
val = String(val);
|
|
59
|
-
}
|
|
60
|
-
a.setProperty(prop, val);
|
|
61
|
-
}
|
|
62
|
-
return a.cssText;
|
|
63
|
-
}
|
|
64
|
-
get text() {
|
|
65
|
-
return this.generate();
|
|
66
|
-
}
|
|
67
|
-
get ansi() {
|
|
68
|
-
const s = __classPrivateFieldGet(this, _InlineStyle_styleObject, "f") || {};
|
|
69
|
-
let parts = [];
|
|
70
|
-
if (s["font-weight"] === "bold" || s.fontWeight === "bold")
|
|
71
|
-
parts.push(Color.BOLD);
|
|
72
|
-
if ((s["text-decoration"] || s.textDecoration || "").includes("underline"))
|
|
73
|
-
parts.push(Color.UNDERLINE);
|
|
74
|
-
const colorVal = s.color || s["color"];
|
|
75
|
-
if (colorVal) {
|
|
76
|
-
try {
|
|
77
|
-
const c = new Color(String(colorVal));
|
|
78
|
-
parts.push(c.ansiTruecolor());
|
|
79
|
-
}
|
|
80
|
-
catch (e) {
|
|
81
|
-
warner.warn({ message: `[InlineStyle.ansi] @briklab/lib/stylesheet: Invalid color value "${String(colorVal)}" — ignoring. Hint: use a valid hex, rgb(), hsl() or named color.` });
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
const bgVal = s["background-color"] || s.backgroundColor;
|
|
85
|
-
if (bgVal) {
|
|
86
|
-
try {
|
|
87
|
-
const c = new Color(String(bgVal));
|
|
88
|
-
parts.push(c.ansiTruecolorBg());
|
|
89
|
-
}
|
|
90
|
-
catch (e) {
|
|
91
|
-
warner.warn({ message: `[InlineStyle.ansi] @briklab/lib/stylesheet: Invalid background-color value "${String(bgVal)}" — ignoring. Hint: use a valid hex, rgb(), hsl() or named color.` });
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
return parts.join("");
|
|
95
|
-
}
|
|
96
|
-
addStyleWithObject(styleObject) {
|
|
97
|
-
if (!JSTC.for([styleObject]).check(["object"])) {
|
|
98
|
-
warner.warn({ message: `[InlineStyle.addStyleWithObject] @briklab/lib/stylesheet: Invalid first argument!\n` +
|
|
99
|
-
`Hint: expected a plain object with CSS properties. Received: ${String(styleObject)}\n` +
|
|
100
|
-
`Returned with no operations.` });
|
|
101
|
-
return this;
|
|
102
|
-
}
|
|
103
|
-
__classPrivateFieldSet(this, _InlineStyle_styleObject, { ...__classPrivateFieldGet(this, _InlineStyle_styleObject, "f"), ...styleObject }, "f");
|
|
104
|
-
this.generate();
|
|
105
|
-
return this;
|
|
106
|
-
}
|
|
107
|
-
addStyleWithInlineCSS(inlineCSS) {
|
|
108
|
-
if (!JSTC.for([inlineCSS]).check(["string"])) {
|
|
109
|
-
warner.warn({ message: `[InlineStyle.addStyleWithInlineCSS] @briklab/lib/stylesheet: Invalid first argument!
|
|
110
|
-
Hint: The first argument must be a valid inline css string!
|
|
111
|
-
Returned with no operations.` });
|
|
112
|
-
return this;
|
|
113
|
-
}
|
|
114
|
-
let s = new UUIII();
|
|
115
|
-
s.cssText = __classPrivateFieldGet(this, _InlineStyle_instances, "m", _InlineStyle_convertKeysToValidCSS).call(this, inlineCSS);
|
|
116
|
-
let o = {};
|
|
117
|
-
for (let i = 0; i < s.length; i++) {
|
|
118
|
-
const a = s[i];
|
|
119
|
-
const v = s.getPropertyValue(a);
|
|
120
|
-
o[a] = v;
|
|
121
|
-
}
|
|
122
|
-
this.addStyleWithObject(o);
|
|
123
|
-
return this;
|
|
124
|
-
}
|
|
125
|
-
removeStyle(styles) {
|
|
126
|
-
if (!JSTC.for([styles]).check(["string[]|string"])) {
|
|
127
|
-
warner.warn({ message: `[InlineStyle.removeStyle] @briklab/lib/stylesheet: Invalid first argument!\n` +
|
|
128
|
-
`Hint: expected a string or array of strings. Returned with no operations. Received: ${String(styles)}` });
|
|
129
|
-
return this;
|
|
130
|
-
}
|
|
131
|
-
if (typeof styles === "string") {
|
|
132
|
-
styles = [styles];
|
|
133
|
-
}
|
|
134
|
-
for (let i = 0; i < styles.length; i++) {
|
|
135
|
-
const prop = styles[i];
|
|
136
|
-
if (typeof prop !== "string") {
|
|
137
|
-
warner.warn({ message: `[InlineStyle.removeStyle] @briklab/lib/stylesheet: Ignoring non-string style name at index ${i}: ${String(prop)}` });
|
|
138
|
-
continue;
|
|
139
|
-
}
|
|
140
|
-
delete __classPrivateFieldGet(this, _InlineStyle_styleObject, "f")[prop];
|
|
141
|
-
}
|
|
142
|
-
return this;
|
|
143
|
-
}
|
|
144
|
-
applyTo(element) {
|
|
145
|
-
if (!JSTC.for([element]).check(["object"])) {
|
|
146
|
-
warner.warn({ message: `[InlineStyle.applyTo] @briklab/lib/stylesheet: Invalid first argument!\n` +
|
|
147
|
-
`Hint: expected an HTMLElement. No operation was performed.` });
|
|
148
|
-
return this;
|
|
149
|
-
}
|
|
150
|
-
if (!element || typeof element.style !== "object") {
|
|
151
|
-
warner.warn({ message: `[InlineStyle.applyTo] @briklab/lib/stylesheet: Given object does not look like an HTMLElement (missing .style). No operation was performed.` });
|
|
152
|
-
return this;
|
|
153
|
-
}
|
|
154
|
-
element.style.cssText = this.generate();
|
|
155
|
-
return this;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
_InlineStyle_cssStyleDec = new WeakMap(), _InlineStyle_styleObject = new WeakMap(), _InlineStyle_instances = new WeakSet(), _InlineStyle_convertFieldToHyphenCase = function _InlineStyle_convertFieldToHyphenCase(string) {
|
|
159
|
-
return string.replace(/([A-Z])/g, (match) => `-${match.toLowerCase()}`);
|
|
160
|
-
}, _InlineStyle_convertKeysToValidCSS = function _InlineStyle_convertKeysToValidCSS(string) {
|
|
161
|
-
const parts = String(string).split(";");
|
|
162
|
-
let out = "";
|
|
163
|
-
for (let i = 0; i < parts.length; i++) {
|
|
164
|
-
const raw = parts[i].trim();
|
|
165
|
-
if (!raw)
|
|
166
|
-
continue;
|
|
167
|
-
const kv = raw.split(":");
|
|
168
|
-
if (kv.length < 2) {
|
|
169
|
-
warner.warn({ message: `[InlineStyle.#convertKeysToValidCSS] @briklab/lib/stylesheet: Skipping malformed rule: "${raw}". ` +
|
|
170
|
-
`Hint: expected "property: value" pairs separated by ";"` });
|
|
171
|
-
continue;
|
|
172
|
-
}
|
|
173
|
-
const k = kv[0].trim();
|
|
174
|
-
const v = kv.slice(1).join(":").trim();
|
|
175
|
-
if (!k || !v) {
|
|
176
|
-
warner.warn({ message: `[InlineStyle.#convertKeysToValidCSS] @briklab/lib/stylesheet: Skipping empty property or value in rule: "${raw}".` });
|
|
177
|
-
continue;
|
|
178
|
-
}
|
|
179
|
-
out += `${__classPrivateFieldGet(this, _InlineStyle_instances, "m", _InlineStyle_convertFieldToHyphenCase).call(this, k)}:${v};`;
|
|
180
|
-
}
|
|
181
|
-
return out;
|
|
182
|
-
};
|
|
183
|
-
export default InlineStyle;
|
|
184
|
-
export class StyleSheet {
|
|
185
|
-
constructor() {
|
|
186
|
-
_StyleSheet_styles.set(this, void 0);
|
|
187
|
-
__classPrivateFieldSet(this, _StyleSheet_styles, {}, "f");
|
|
188
|
-
}
|
|
189
|
-
/**
|
|
190
|
-
* Add or update a rule in the stylesheet.
|
|
191
|
-
* @param name The rule name or selector (string).
|
|
192
|
-
* @param style An InlineStyle instance.
|
|
193
|
-
*/
|
|
194
|
-
set(name, style) {
|
|
195
|
-
if (!JSTC.for([name, style]).check(["string", "object"])) {
|
|
196
|
-
warner.warn({ message: `[StyleSheet.set] @briklab/lib/stylesheet: Invalid arguments!\n` +
|
|
197
|
-
`Hint: call .set("ruleName", new InlineStyle({...})). Received name=${String(name)}, style=${String(style)}. Returned with no operations.` });
|
|
198
|
-
return this;
|
|
199
|
-
}
|
|
200
|
-
if (!(style instanceof InlineStyle)) {
|
|
201
|
-
warner.warn({ message: `[StyleSheet.set] @briklab/lib/stylesheet: Provided style is not an InlineStyle instance!\n` +
|
|
202
|
-
`Hint: create the style with new InlineStyle({...}). Received: ${String(style)}. Returned with no operations.` });
|
|
203
|
-
return this;
|
|
204
|
-
}
|
|
205
|
-
__classPrivateFieldGet(this, _StyleSheet_styles, "f")[name] = style;
|
|
206
|
-
return this;
|
|
207
|
-
}
|
|
208
|
-
/**
|
|
209
|
-
* Get a rule by name.
|
|
210
|
-
*/
|
|
211
|
-
get(name) {
|
|
212
|
-
if (!JSTC.for([name]).check(["string"])) {
|
|
213
|
-
warner.warn({ message: `[StyleSheet.get] @briklab/lib/stylesheet: Invalid argument!\n` +
|
|
214
|
-
`Hint: name must be a string. Received: ${String(name)}. Returned undefined.` });
|
|
215
|
-
return undefined;
|
|
216
|
-
}
|
|
217
|
-
return __classPrivateFieldGet(this, _StyleSheet_styles, "f")[name];
|
|
218
|
-
}
|
|
219
|
-
/**
|
|
220
|
-
* Remove a rule by name.
|
|
221
|
-
*/
|
|
222
|
-
remove(name) {
|
|
223
|
-
if (!JSTC.for([name]).check(["string"])) {
|
|
224
|
-
warner.warn({ message: `[StyleSheet.remove] @briklab/lib/stylesheet: Invalid argument!\n` +
|
|
225
|
-
`Hint: name must be a string. Received: ${String(name)}. No-op.` });
|
|
226
|
-
return this;
|
|
227
|
-
}
|
|
228
|
-
delete __classPrivateFieldGet(this, _StyleSheet_styles, "f")[name];
|
|
229
|
-
return this;
|
|
230
|
-
}
|
|
231
|
-
/**
|
|
232
|
-
* Generate CSS text for the whole stylesheet.
|
|
233
|
-
*/
|
|
234
|
-
generate() {
|
|
235
|
-
let css = "";
|
|
236
|
-
for (const key in __classPrivateFieldGet(this, _StyleSheet_styles, "f")) {
|
|
237
|
-
const style = __classPrivateFieldGet(this, _StyleSheet_styles, "f")[key];
|
|
238
|
-
if (style) {
|
|
239
|
-
css += `${key} { ${style.text} }\n`;
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
return css.trim();
|
|
243
|
-
}
|
|
244
|
-
/**
|
|
245
|
-
* Export as a string for inline style usage or injection.
|
|
246
|
-
*/
|
|
247
|
-
toString() {
|
|
248
|
-
return this.generate();
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
_StyleSheet_styles = new WeakMap();
|
|
1
|
+
var u=function(l,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?l!==e||!i:!e.has(l))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(l,t):i?i.value=t:e.set(l,t),t},o=function(l,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?l!==e||!n:!e.has(l))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(l):n?n.value:e.get(l)},y,f,p,m,h,g;import d from"../jstc/index.js";import{CSSStyleDeclaration as w}from"cssom";import b from"../color/index.js";import{createWarner as I}from"../warner/index.js";const s=I("@briklab/lib/stylesheet");class v{constructor(e){y.add(this),f.set(this,void 0),h.set(this,void 0),d.for([e]).check(["object|undefined"])||(s.warn({message:`[InlineStyle class] @briklab/lib/stylesheet: Invalid first argument!
|
|
2
|
+
Hint: The first argument must be a valid style object or not be given!
|
|
3
|
+
Using {"imeMode":${e}} as fallback`}),e={imeMode:`${e}`}),u(this,h,e,"f"),u(this,f,new w,"f")}generate(){let e=o(this,f,"f"),t=o(this,h,"f"),n=Object.keys(t),i=Object.values(t);for(let r=0;r<n.length;r++){const c=n[r];let a=i[r];if(a==null){s.warn({message:`[InlineStyle.generate] @briklab/lib/stylesheet: Skipping property "${c}" with ${String(a)} value. Hint: avoid null/undefined style values.`});continue}typeof a!="string"&&(s.warn({message:`[InlineStyle.generate] @briklab/lib/stylesheet: Non-string style value for "${c}" (type=${typeof a}). Coercing to string.`}),a=String(a)),e.setProperty(c,a)}return e.cssText}get text(){return this.generate()}get ansi(){const e=o(this,h,"f")||{};let t=[];(e["font-weight"]==="bold"||e.fontWeight==="bold")&&t.push(b.BOLD),(e["text-decoration"]||e.textDecoration||"").includes("underline")&&t.push(b.UNDERLINE);const n=e.color||e.color;if(n)try{const r=new b(String(n));t.push(r.ansiTruecolor())}catch{s.warn({message:`[InlineStyle.ansi] @briklab/lib/stylesheet: Invalid color value "${String(n)}" \u2014 ignoring. Hint: use a valid hex, rgb(), hsl() or named color.`})}const i=e["background-color"]||e.backgroundColor;if(i)try{const r=new b(String(i));t.push(r.ansiTruecolorBg())}catch{s.warn({message:`[InlineStyle.ansi] @briklab/lib/stylesheet: Invalid background-color value "${String(i)}" \u2014 ignoring. Hint: use a valid hex, rgb(), hsl() or named color.`})}return t.join("")}addStyleWithObject(e){return d.for([e]).check(["object"])?(u(this,h,{...o(this,h,"f"),...e},"f"),this.generate(),this):(s.warn({message:`[InlineStyle.addStyleWithObject] @briklab/lib/stylesheet: Invalid first argument!
|
|
4
|
+
Hint: expected a plain object with CSS properties. Received: ${String(e)}
|
|
5
|
+
Returned with no operations.`}),this)}addStyleWithInlineCSS(e){if(!d.for([e]).check(["string"]))return s.warn({message:`[InlineStyle.addStyleWithInlineCSS] @briklab/lib/stylesheet: Invalid first argument!
|
|
6
|
+
Hint: The first argument must be a valid inline css string!
|
|
7
|
+
Returned with no operations.`}),this;let t=new w;t.cssText=o(this,y,"m",m).call(this,e);let n={};for(let i=0;i<t.length;i++){const r=t[i],c=t.getPropertyValue(r);n[r]=c}return this.addStyleWithObject(n),this}removeStyle(e){if(!d.for([e]).check(["string[]|string"]))return s.warn({message:`[InlineStyle.removeStyle] @briklab/lib/stylesheet: Invalid first argument!
|
|
8
|
+
Hint: expected a string or array of strings. Returned with no operations. Received: ${String(e)}`}),this;typeof e=="string"&&(e=[e]);for(let t=0;t<e.length;t++){const n=e[t];if(typeof n!="string"){s.warn({message:`[InlineStyle.removeStyle] @briklab/lib/stylesheet: Ignoring non-string style name at index ${t}: ${String(n)}`});continue}delete o(this,h,"f")[n]}return this}applyTo(e){return d.for([e]).check(["object"])?!e||typeof e.style!="object"?(s.warn({message:"[InlineStyle.applyTo] @briklab/lib/stylesheet: Given object does not look like an HTMLElement (missing .style). No operation was performed."}),this):(e.style.cssText=this.generate(),this):(s.warn({message:`[InlineStyle.applyTo] @briklab/lib/stylesheet: Invalid first argument!
|
|
9
|
+
Hint: expected an HTMLElement. No operation was performed.`}),this)}}f=new WeakMap,h=new WeakMap,y=new WeakSet,p=function(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)},m=function(e){const t=String(e).split(";");let n="";for(let i=0;i<t.length;i++){const r=t[i].trim();if(!r)continue;const c=r.split(":");if(c.length<2){s.warn({message:`[InlineStyle.#convertKeysToValidCSS] @briklab/lib/stylesheet: Skipping malformed rule: "${r}". Hint: expected "property: value" pairs separated by ";"`});continue}const a=c[0].trim(),S=c.slice(1).join(":").trim();if(!a||!S){s.warn({message:`[InlineStyle.#convertKeysToValidCSS] @briklab/lib/stylesheet: Skipping empty property or value in rule: "${r}".`});continue}n+=`${o(this,y,"m",p).call(this,a)}:${S};`}return n};var H=v;class x{constructor(){g.set(this,void 0),u(this,g,{},"f")}set(e,t){return d.for([e,t]).check(["string","object"])?t instanceof v?(o(this,g,"f")[e]=t,this):(s.warn({message:`[StyleSheet.set] @briklab/lib/stylesheet: Provided style is not an InlineStyle instance!
|
|
10
|
+
Hint: create the style with new InlineStyle({...}). Received: ${String(t)}. Returned with no operations.`}),this):(s.warn({message:`[StyleSheet.set] @briklab/lib/stylesheet: Invalid arguments!
|
|
11
|
+
Hint: call .set("ruleName", new InlineStyle({...})). Received name=${String(e)}, style=${String(t)}. Returned with no operations.`}),this)}get(e){if(!d.for([e]).check(["string"])){s.warn({message:`[StyleSheet.get] @briklab/lib/stylesheet: Invalid argument!
|
|
12
|
+
Hint: name must be a string. Received: ${String(e)}. Returned undefined.`});return}return o(this,g,"f")[e]}remove(e){return d.for([e]).check(["string"])?(delete o(this,g,"f")[e],this):(s.warn({message:`[StyleSheet.remove] @briklab/lib/stylesheet: Invalid argument!
|
|
13
|
+
Hint: name must be a string. Received: ${String(e)}. No-op.`}),this)}generate(){let e="";for(const t in o(this,g,"f")){const n=o(this,g,"f")[t];n&&(e+=`${t} { ${n.text} }
|
|
14
|
+
`)}return e.trim()}toString(){return this.generate()}}g=new WeakMap;export{x as StyleSheet,H as default};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["index.js"],
|
|
4
|
-
"mappings": "AAIA,IAAIA,EAAkE,SAAUC,EAAUC,EAAOC,EAAOC,EAAMC,EAAG,CAC7G,GAAID,IAAS,IAAK,MAAM,IAAI,UAAU,gCAAgC,EACtE,GAAIA,IAAS,KAAO,CAACC,EAAG,MAAM,IAAI,UAAU,+CAA+C,EAC3F,GAAI,OAAOH,GAAU,WAAaD,IAAaC,GAAS,CAACG,EAAI,CAACH,EAAM,IAAID,CAAQ,EAAG,MAAM,IAAI,UAAU,yEAAyE,EAChL,OAAQG,IAAS,IAAMC,EAAE,KAAKJ,EAAUE,CAAK,EAAIE,EAAIA,EAAE,MAAQF,EAAQD,EAAM,IAAID,EAAUE,CAAK,EAAIA,CACxG,EACIG,EAAkE,SAAUL,EAAUC,EAAOE,EAAMC,EAAG,CACtG,GAAID,IAAS,KAAO,CAACC,EAAG,MAAM,IAAI,UAAU,+CAA+C,EAC3F,GAAI,OAAOH,GAAU,WAAaD,IAAaC,GAAS,CAACG,EAAI,CAACH,EAAM,IAAID,CAAQ,EAAG,MAAM,IAAI,UAAU,0EAA0E,EACjL,OAAOG,IAAS,IAAMC,EAAID,IAAS,IAAMC,EAAE,KAAKJ,CAAQ,EAAII,EAAIA,EAAE,MAAQH,EAAM,IAAID,CAAQ,CAChG,EACIM,EAAwBC,EAA0BC,EAAuCC,EAAoCC,EAA0BC,EAC3J,OAAOC,MAAU,mBACjB,OAAS,
|
|
5
|
-
"names": ["__classPrivateFieldSet", "receiver", "state", "value", "kind", "f", "__classPrivateFieldGet", "_InlineStyle_instances", "_InlineStyle_cssStyleDec", "_InlineStyle_convertFieldToHyphenCase", "_InlineStyle_convertKeysToValidCSS", "_InlineStyle_styleObject", "_StyleSheet_styles", "JSTC", "
|
|
4
|
+
"mappings": "AAIA,IAAIA,EAAkE,SAAUC,EAAUC,EAAOC,EAAOC,EAAMC,EAAG,CAC7G,GAAID,IAAS,IAAK,MAAM,IAAI,UAAU,gCAAgC,EACtE,GAAIA,IAAS,KAAO,CAACC,EAAG,MAAM,IAAI,UAAU,+CAA+C,EAC3F,GAAI,OAAOH,GAAU,WAAaD,IAAaC,GAAS,CAACG,EAAI,CAACH,EAAM,IAAID,CAAQ,EAAG,MAAM,IAAI,UAAU,yEAAyE,EAChL,OAAQG,IAAS,IAA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AAWC,KAAOzC,EAAuB,KAAMM,EAAoB,GAAG,EAAG,CACrE,MAAMiC,EAAQvC,EAAuB,KAAMM,EAAoB,GAAG,EAAEmC,CAAG,EACnEF,IACAC,GAAO,GAAGC,CAAG,MAAMF,EAAM,IAAI;AAAA,EAErC,CACA,OAAOC,EAAI,KAAK,CACpB,CAIA,UAAW,CACP,OAAO,KAAK,SAAS,CACzB,CACJ,CACAlC,EAAqB,IAAI",
|
|
5
|
+
"names": ["__classPrivateFieldSet", "receiver", "state", "value", "kind", "f", "__classPrivateFieldGet", "_InlineStyle_instances", "_InlineStyle_cssStyleDec", "_InlineStyle_convertFieldToHyphenCase", "_InlineStyle_convertKeysToValidCSS", "_InlineStyle_styleObject", "_StyleSheet_styles", "JSTC", "UUIII", "Color", "createWarner", "stylesheetWarner", "InlineStyle", "styleObject", "a", "b", "c", "d", "i", "prop", "val", "s", "parts", "colorVal", "bgVal", "inlineCSS", "o", "v", "styles", "element", "string", "match", "out", "raw", "kv", "k", "index_default", "StyleSheet", "name", "style", "css", "key"]
|
|
6
6
|
}
|
package/dist/warner/index.d.ts
CHANGED
package/dist/warner/index.js
CHANGED
|
@@ -1,169 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
6
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
7
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
8
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
9
|
-
};
|
|
10
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
11
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
12
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
13
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
14
|
-
};
|
|
15
|
-
var _Warner_instances, _Warner_warnings, _Warner_options, _Warner_formatForBrowser, _Warner_formatForNode, _Warner_print;
|
|
16
|
-
import JSTC from "../jstc/index.js";
|
|
17
|
-
const IS_BROWSER = typeof window !== "undefined" && typeof window?.console !== "undefined";
|
|
18
|
-
const IS_NODE = typeof process !== "undefined" && !!process.stdout;
|
|
19
|
-
const NODE_STYLES = {
|
|
20
|
-
label: "\x1b[35m",
|
|
21
|
-
tag: "\x1b[36m",
|
|
22
|
-
msg: "\x1b[0m",
|
|
23
|
-
hint: "\x1b[2m",
|
|
24
|
-
reset: "\x1b[0m",
|
|
25
|
-
bold: "\x1b[1m",
|
|
26
|
-
};
|
|
27
|
-
JSTC.addCustomHandler("WarnerOptions", (p) => {
|
|
28
|
-
return (p &&
|
|
29
|
-
typeof p === "object" &&
|
|
30
|
-
((typeof p.level === "string" && "silent summary full".split(" ").includes(p.level)) || !(p.level)) &&
|
|
31
|
-
(typeof p.maxWarnings === "number" || !(p.maxWarnings)) &&
|
|
32
|
-
(typeof p.onWarn === "function" || !(p.onWarn)) &&
|
|
33
|
-
(typeof p.onSummary === "function" || !(p.onSummary)) &&
|
|
34
|
-
(typeof p.packageName === "string" || !(p.packageName)));
|
|
35
|
-
});
|
|
36
|
-
JSTC.addCustomHandler("Warning", (p) => {
|
|
37
|
-
return (p &&
|
|
38
|
-
typeof p.message === "string" &&
|
|
39
|
-
(typeof p.source === "string" || !p.source) &&
|
|
40
|
-
(typeof p.hint === "string" || !p.hint) &&
|
|
41
|
-
(typeof p.instantlyWarn === "boolean" || !p.instantlyWarn) &&
|
|
42
|
-
(typeof p.tag === "string" || !p.tag) &&
|
|
43
|
-
(typeof p.documentation === "string" || !p.documentation));
|
|
44
|
-
});
|
|
45
|
-
/**
|
|
46
|
-
* A Warner instance
|
|
47
|
-
*/
|
|
48
|
-
class Warner {
|
|
49
|
-
constructor(options = {}) {
|
|
50
|
-
_Warner_instances.add(this);
|
|
51
|
-
_Warner_warnings.set(this, []);
|
|
52
|
-
_Warner_options.set(this, {});
|
|
53
|
-
options.level = options.level ?? "summary";
|
|
54
|
-
options.maxWarnings = Number(options.maxWarnings ?? 20);
|
|
55
|
-
options.onWarn = options.onWarn ?? (() => { });
|
|
56
|
-
options.onSummary = options.onSummary ?? (() => { });
|
|
57
|
-
options.packageName = options.packageName ?? "";
|
|
58
|
-
__classPrivateFieldSet(this, _Warner_options, options, "f");
|
|
59
|
-
}
|
|
60
|
-
get warnings() {
|
|
61
|
-
return __classPrivateFieldGet(this, _Warner_warnings, "f");
|
|
62
|
-
}
|
|
63
|
-
setLevel(level) {
|
|
64
|
-
if (["silent", "summary", "full"].includes(level))
|
|
65
|
-
__classPrivateFieldGet(this, _Warner_options, "f").level = level;
|
|
66
|
-
}
|
|
67
|
-
setPackageName(name) {
|
|
68
|
-
__classPrivateFieldGet(this, _Warner_options, "f").packageName = String(name);
|
|
69
|
-
}
|
|
70
|
-
clear() {
|
|
71
|
-
__classPrivateFieldSet(this, _Warner_warnings, [], "f");
|
|
72
|
-
}
|
|
73
|
-
count() {
|
|
74
|
-
return __classPrivateFieldGet(this, _Warner_warnings, "f").length;
|
|
75
|
-
}
|
|
76
|
-
warn(warning) {
|
|
77
|
-
if (!JSTC.for([warning]).check(["Warning"]))
|
|
78
|
-
return;
|
|
79
|
-
if (__classPrivateFieldGet(this, _Warner_options, "f").maxWarnings && __classPrivateFieldGet(this, _Warner_warnings, "f").length < __classPrivateFieldGet(this, _Warner_options, "f").maxWarnings) {
|
|
80
|
-
__classPrivateFieldGet(this, _Warner_warnings, "f").push(warning);
|
|
81
|
-
}
|
|
82
|
-
try {
|
|
83
|
-
__classPrivateFieldGet(this, _Warner_options, "f").onWarn?.(warning);
|
|
84
|
-
}
|
|
85
|
-
catch (e) {
|
|
86
|
-
}
|
|
87
|
-
if (warning.instantlyWarn) {
|
|
88
|
-
__classPrivateFieldGet(this, _Warner_instances, "m", _Warner_print).call(this, warning);
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
if (__classPrivateFieldGet(this, _Warner_options, "f").level === "full")
|
|
92
|
-
__classPrivateFieldGet(this, _Warner_instances, "m", _Warner_print).call(this, warning);
|
|
93
|
-
if (__classPrivateFieldGet(this, _Warner_options, "f").level === "summary") {
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Finalize all warnings and log summary if needed
|
|
98
|
-
*/
|
|
99
|
-
finalize() {
|
|
100
|
-
this.flush();
|
|
101
|
-
}
|
|
102
|
-
flush() {
|
|
103
|
-
if (__classPrivateFieldGet(this, _Warner_options, "f").level === "full") {
|
|
104
|
-
__classPrivateFieldGet(this, _Warner_warnings, "f").forEach((w) => __classPrivateFieldGet(this, _Warner_instances, "m", _Warner_print).call(this, w));
|
|
105
|
-
}
|
|
106
|
-
if (__classPrivateFieldGet(this, _Warner_options, "f").level === "summary") {
|
|
107
|
-
try {
|
|
108
|
-
__classPrivateFieldGet(this, _Warner_options, "f").onSummary?.(__classPrivateFieldGet(this, _Warner_warnings, "f").length, [...__classPrivateFieldGet(this, _Warner_warnings, "f")]);
|
|
109
|
-
}
|
|
110
|
-
catch (e) { }
|
|
111
|
-
const count = __classPrivateFieldGet(this, _Warner_warnings, "f").length;
|
|
112
|
-
const max = __classPrivateFieldGet(this, _Warner_options, "f").maxWarnings;
|
|
113
|
-
if (IS_BROWSER) {
|
|
114
|
-
console.log(`${max ? (count > max ? `${max}+` : String(count)) : String(count)} warnings collected`);
|
|
115
|
-
}
|
|
116
|
-
else {
|
|
117
|
-
console.log(`${count} warnings collected`);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
_Warner_warnings = new WeakMap(), _Warner_options = new WeakMap(), _Warner_instances = new WeakSet(), _Warner_formatForBrowser = function _Warner_formatForBrowser(w) {
|
|
123
|
-
const lines = [];
|
|
124
|
-
const label = __classPrivateFieldGet(this, _Warner_options, "f").packageName ? `${__classPrivateFieldGet(this, _Warner_options, "f").packageName}: ` : "";
|
|
125
|
-
const tagOrSource = w.tag ? `[${w.tag}] ` : w.source ? `[${w.source}] ` : "";
|
|
126
|
-
const header = `${tagOrSource}${label}${w.message}`;
|
|
127
|
-
const cssHeader = "background:#222;color:#fff;padding:2px 6px;border-radius:4px;font-weight:700;";
|
|
128
|
-
lines.push(header, cssHeader);
|
|
129
|
-
if (w.hint) {
|
|
130
|
-
lines.push(`\nHint: ${w.hint}`, "color:#888;font-style:italic;");
|
|
131
|
-
}
|
|
132
|
-
if (w.documentation) {
|
|
133
|
-
lines.push(`\nDocumentation: ${w.documentation}`, "color:#0af;font-weight:600;");
|
|
134
|
-
}
|
|
135
|
-
return lines;
|
|
136
|
-
}, _Warner_formatForNode = function _Warner_formatForNode(w) {
|
|
137
|
-
const parts = [];
|
|
138
|
-
const t = w.tag ? `${NODE_STYLES.tag}[${w.tag}]${NODE_STYLES.reset} ` : w.source ? `${NODE_STYLES.tag}[${w.source}]${NODE_STYLES.reset} ` : "";
|
|
139
|
-
const pkg = __classPrivateFieldGet(this, _Warner_options, "f").packageName ? `${NODE_STYLES.label}${__classPrivateFieldGet(this, _Warner_options, "f").packageName}${NODE_STYLES.reset}: ` : "";
|
|
140
|
-
parts.push(`${t}${pkg}${NODE_STYLES.bold}${w.message}${NODE_STYLES.reset}`);
|
|
141
|
-
if (w.hint)
|
|
142
|
-
parts.push(`${NODE_STYLES.hint}Hint: ${w.hint}${NODE_STYLES.reset}`);
|
|
143
|
-
if (w.documentation)
|
|
144
|
-
parts.push(`Documentation: ${w.documentation}`);
|
|
145
|
-
return parts.join("\n");
|
|
146
|
-
}, _Warner_print = function _Warner_print(w) {
|
|
147
|
-
if (IS_BROWSER) {
|
|
148
|
-
const args = __classPrivateFieldGet(this, _Warner_instances, "m", _Warner_formatForBrowser).call(this, w);
|
|
149
|
-
let fmt = "%c" + args[0];
|
|
150
|
-
const cssArgs = [args[1]];
|
|
151
|
-
let extraFmt = "";
|
|
152
|
-
for (let i = 2; i < args.length; i += 2) {
|
|
153
|
-
extraFmt += "%c" + args[i - 1];
|
|
154
|
-
cssArgs.push(args[i]);
|
|
155
|
-
}
|
|
156
|
-
if (extraFmt)
|
|
157
|
-
fmt += extraFmt;
|
|
158
|
-
console.warn(fmt, ...cssArgs);
|
|
159
|
-
return;
|
|
160
|
-
}
|
|
161
|
-
if (IS_NODE) {
|
|
162
|
-
console.warn(__classPrivateFieldGet(this, _Warner_instances, "m", _Warner_formatForNode).call(this, w));
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
165
|
-
console.warn(`${__classPrivateFieldGet(this, _Warner_options, "f").packageName ? __classPrivateFieldGet(this, _Warner_options, "f").packageName + ': ' : ''}${w.message}`);
|
|
166
|
-
};
|
|
167
|
-
export default Warner;
|
|
168
|
-
export const warner = new Warner({ level: "summary" });
|
|
169
|
-
// TODO: complete this warner bro
|
|
1
|
+
var d=function(e,t,r,s,i){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},n=function(e,t,r,s){if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?s:r==="a"?s.call(e):s?s.value:t.get(e)},l,c,a,y,_,p,W,u;import h from"../jstc/index.js";const $=typeof window<"u"&&typeof window?.console<"u",x=typeof process<"u"&&!!process.stdout,o={label:"\x1B[35m",tag:"\x1B[36m",msg:"\x1B[0m",hint:"\x1B[2m",reset:"\x1B[0m",bold:"\x1B[1m"};h.addCustomHandler("WarnerOptions",e=>e&&typeof e=="object"&&(typeof e.level=="string"&&"silent summary full".split(" ").includes(e.level)||!e.level)&&(typeof e.maxWarnings=="number"||!e.maxWarnings)&&(typeof e.onWarn=="function"||!e.onWarn)&&(typeof e.onSummary=="function"||!e.onSummary)&&(typeof e.packageName=="string"||!e.packageName)),h.addCustomHandler("Warning",e=>e&&typeof e.message=="string"&&(typeof e.source=="string"||!e.source)&&(typeof e.hint=="string"||!e.hint)&&(typeof e.instantlyWarn=="boolean"||!e.instantlyWarn)&&(typeof e.tag=="string"||!e.tag)&&(typeof e.documentation=="string"||!e.documentation));class g{constructor(t={}){l.add(this),c.set(this,[]),a.set(this,{}),t.level=t.level??"summary",t.maxWarnings=Number(t.maxWarnings??20),t.onWarn=t.onWarn??(()=>{}),t.onSummary=t.onSummary??(()=>{}),t.packageName=t.packageName??"",d(this,a,t,"f")}get warnings(){return n(this,c,"f")}setLevel(t){["silent","summary","full"].includes(t)&&(n(this,a,"f").level=t)}setPackageName(t){n(this,a,"f").packageName=String(t)}clear(){d(this,c,[],"f")}count(){return n(this,c,"f").length}warn(t){if(h.for([t]).check(["Warning"])){n(this,a,"f").maxWarnings&&n(this,c,"f").length<n(this,a,"f").maxWarnings&&n(this,c,"f").push(t);try{n(this,a,"f").onWarn?.(t)}catch{}if(t.instantlyWarn){n(this,l,"m",u).call(this,t);return}n(this,a,"f").level==="full"&&n(this,l,"m",u).call(this,t),n(this,a,"f").level}}finalize(){this.flush()}flush(){if(n(this,a,"f").level==="full"&&n(this,c,"f").forEach(t=>n(this,l,"m",u).call(this,t)),n(this,a,"f").level==="summary"){try{n(this,a,"f").onSummary?.(n(this,c,"f").length,[...n(this,c,"f")])}catch{}if($){const[t,r]=n(this,l,"m",_).call(this);console.log(`%c${t}`,r)}else console.log(n(this,l,"m",p).call(this))}}}c=new WeakMap,a=new WeakMap,l=new WeakSet,y=function(t){const r=[],s=n(this,a,"f").packageName?`${n(this,a,"f").packageName}: `:"",f=`${t.tag?`[${t.tag}] `:t.source?`[${t.source}] `:""}${s}${t.message}`;return r.push(f,"background:#222;color:#fff;padding:2px 6px;border-radius:4px;font-weight:700;"),t.hint&&r.push(`
|
|
2
|
+
Hint: ${t.hint}`,"color:#888;font-style:italic;"),t.documentation&&r.push(`
|
|
3
|
+
Documentation: ${t.documentation}`,"color:#0af;font-weight:600;"),r},_=function(){const t=n(this,c,"f").length,r=n(this,a,"f").maxWarnings;return[`${r&&t>r?`${r}+`:String(t)} warnings collected`,"background:#f9a825;color:#000;padding:4px 8px;border-radius:4px;font-weight:700;"]},p=function(){const t=n(this,c,"f").length,r=n(this,a,"f").maxWarnings,s=r&&t>r?`${r}+`:String(t);return`${o.bold}${o.label}[SUMMARY]${o.reset} ${s} warnings collected${o.reset}`},W=function(t){const r=[],s=t.tag?`${o.tag}[${t.tag}]${o.reset} `:t.source?`${o.tag}[${t.source}]${o.reset} `:"",i=n(this,a,"f").packageName?`${o.label}${n(this,a,"f").packageName}${o.reset}: `:"";return r.push(`${s}${i}${o.bold}${t.message}${o.reset}`),t.hint&&r.push(`${o.hint}Hint: ${t.hint}${o.reset}`),t.documentation&&r.push(`Documentation: ${t.documentation}`),r.join(`
|
|
4
|
+
`)},u=function(t){if($){const r=n(this,l,"m",y).call(this,t);let s="%c"+r[0];const i=[r[1]];let f="";for(let m=2;m<r.length;m+=2)f+="%c"+r[m-1],i.push(r[m]);f&&(s+=f),console.warn(s,...i);return}if(x){console.warn(n(this,l,"m",W).call(this,t));return}console.warn(`${n(this,a,"f").packageName?n(this,a,"f").packageName+": ":""}${t.message}`)};var N=g;const b=()=>{if(typeof process<"u"&&process.env?.BRIKLAB_WARNING_LEVEL){const e=process.env.BRIKLAB_WARNING_LEVEL.toLowerCase();if(["silent","summary","full"].includes(e))return e}return"summary"},v=new g({level:b()});function w(e,t){return new g({packageName:e,level:t??b()})}export{w as createWarner,N as default,v as warner};
|
package/dist/warner/index.js.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["index.js"],
|
|
4
|
-
"mappings": "AAGA,IAAIA,EAAkE,SAAUC,EAAUC,EAAOC,EAAOC,EAAMC,EAAG,CAC7G,GAAID,IAAS,IAAK,MAAM,IAAI,UAAU,gCAAgC,EACtE,GAAIA,IAAS,KAAO,CAACC,EAAG,MAAM,IAAI,UAAU,+CAA+C,EAC3F,GAAI,OAAOH,GAAU,WAAaD,IAAaC,GAAS,CAACG,EAAI,CAACH,EAAM,IAAID,CAAQ,EAAG,MAAM,IAAI,UAAU,yEAAyE,EAChL,OAAQG,IAAS,IAAMC,EAAE,KAAKJ,EAAUE,CAAK,EAAIE,EAAIA,EAAE,MAAQF,EAAQD,EAAM,IAAID,EAAUE,CAAK,EAAIA,CACxG,EACIG,EAAkE,SAAUL,EAAUC,EAAOE,EAAMC,EAAG,CACtG,GAAID,IAAS,KAAO,CAACC,EAAG,MAAM,IAAI,UAAU,+CAA+C,EAC3F,GAAI,OAAOH,GAAU,WAAaD,IAAaC,GAAS,CAACG,EAAI,CAACH,EAAM,IAAID,CAAQ,EAAG,MAAM,IAAI,UAAU,0EAA0E,EACjL,OAAOG,IAAS,IAAMC,EAAID,IAAS,IAAMC,EAAE,KAAKJ,CAAQ,EAAII,EAAIA,EAAE,MAAQH,EAAM,IAAID,CAAQ,CAChG,EACIM,EAAmBC,EAAkBC,EAAiBC,EAA0BC,EAAuBC,
|
|
5
|
-
"names": ["__classPrivateFieldSet", "receiver", "state", "value", "kind", "f", "__classPrivateFieldGet", "_Warner_instances", "_Warner_warnings", "_Warner_options", "_Warner_formatForBrowser", "_Warner_formatForNode", "_Warner_print", "JSTC", "IS_BROWSER", "IS_NODE", "NODE_STYLES", "p", "Warner", "options", "level", "name", "warning", "w", "
|
|
4
|
+
"mappings": "AAGA,IAAIA,EAAkE,SAAUC,EAAUC,EAAOC,EAAOC,EAAMC,EAAG,CAC7G,GAAID,IAAS,IAAK,MAAM,IAAI,UAAU,gCAAgC,EACtE,GAAIA,IAAS,KAAO,CAACC,EAAG,MAAM,IAAI,UA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CAC7K,EACA,IAAOiB,EAAQtB,EACf,MAAMuB,EAAkB,IAAM,CAC1B,GAAI,OAAO,QAAY,KAAe,QAAQ,KAAK,sBAAuB,CACtE,MAAMrB,EAAQ,QAAQ,IAAI,sBAAsB,YAAY,EAC5D,GAAI,CAAC,SAAU,UAAW,MAAM,EAAE,SAASA,CAAK,EAC5C,OAAOA,CACf,CACA,MAAO,SACX,EACasB,EAAS,IAAIxB,EAAO,CAAE,MAAOuB,EAAgB,CAAE,CAAC,EACtD,SAASE,EAAaC,EAAaxB,EAAO,CAC7C,OAAO,IAAIF,EAAO,CACd,YAAA0B,EACA,MAAOxB,GAASqB,EAAgB,CACpC,CAAC,CACL",
|
|
5
|
+
"names": ["__classPrivateFieldSet", "receiver", "state", "value", "kind", "f", "__classPrivateFieldGet", "_Warner_instances", "_Warner_warnings", "_Warner_options", "_Warner_formatForBrowser", "_Warner_formatSummaryForBrowser", "_Warner_formatSummaryForNode", "_Warner_formatForNode", "_Warner_print", "JSTC", "IS_BROWSER", "IS_NODE", "NODE_STYLES", "p", "Warner", "options", "level", "name", "warning", "w", "msg", "css", "lines", "label", "header", "count", "max", "displayCount", "parts", "t", "pkg", "args", "fmt", "cssArgs", "extraFmt", "i", "index_default", "getDefaultLevel", "warner", "createWarner", "packageName"]
|
|
6
6
|
}
|
package/package.json
CHANGED
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"repository": {
|
|
35
35
|
"url": "https://github.com/EkaanshPC/briklab-stdlib"
|
|
36
36
|
},
|
|
37
|
-
"version": "1.2.0
|
|
37
|
+
"version": "1.2.0",
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/cssom": "^0.4.3",
|
|
40
40
|
"@types/node": "^25.1.0",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"cssom": "^0.5.0"
|
|
72
72
|
},
|
|
73
73
|
"scripts": {
|
|
74
|
-
"build": "tsc",
|
|
74
|
+
"build": "tsc && node build.js",
|
|
75
75
|
"test:smoke": "pnpm run build && node ./test-dist.js"
|
|
76
76
|
}
|
|
77
77
|
}
|