@calcit/procs 0.8.4 → 0.8.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/calcit-data.mjs
CHANGED
|
@@ -370,7 +370,7 @@ export let toString = (x, escaped, disableJsDataWarning = false) => {
|
|
|
370
370
|
return x.toString();
|
|
371
371
|
}
|
|
372
372
|
if (!disableJsDataWarning) {
|
|
373
|
-
console.warn("
|
|
373
|
+
console.warn("Non Calcit data in stringify", x);
|
|
374
374
|
}
|
|
375
375
|
return `(#js ${JSON.stringify(x)})`;
|
|
376
376
|
};
|
package/lib/calcit.procs.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var _a;
|
|
2
2
|
// CALCIT VERSION
|
|
3
|
-
export const calcit_version = "0.8.
|
|
3
|
+
export const calcit_version = "0.8.6";
|
|
4
4
|
import { parse } from "@cirru/parser.ts";
|
|
5
5
|
import { writeCirruCode } from "@cirru/writer.ts";
|
|
6
6
|
import { CalcitSymbol, CalcitTag, CalcitRef, CalcitRecur, newTag, refsRegistry, toString, getStringName, _$n__$e_, hashFunction, } from "./calcit-data.mjs";
|
package/lib/custom-formatter.mjs
CHANGED
|
@@ -16,6 +16,12 @@ let embedObject = (x) => {
|
|
|
16
16
|
},
|
|
17
17
|
];
|
|
18
18
|
};
|
|
19
|
+
let shortPreview = (x) => {
|
|
20
|
+
if (x.length > 102) {
|
|
21
|
+
return x.substring(0, 100) + "...";
|
|
22
|
+
}
|
|
23
|
+
return x;
|
|
24
|
+
};
|
|
19
25
|
export let load_console_formatter_$x_ = () => {
|
|
20
26
|
if (typeof window === "object") {
|
|
21
27
|
window["devtoolsFormatters"] = [
|
|
@@ -31,12 +37,12 @@ export let load_console_formatter_$x_ = () => {
|
|
|
31
37
|
return [
|
|
32
38
|
"div",
|
|
33
39
|
{ style: "color: hsl(280, 80%, 60%, 0.4)" },
|
|
34
|
-
obj.toString(true, true),
|
|
40
|
+
shortPreview(obj.toString(true, true)),
|
|
35
41
|
["span", { style: "font-size: 80%; vertical-align: 0.7em; color: hsl(280, 80%, 60%, 0.8)" }, `${obj.len()}`],
|
|
36
42
|
];
|
|
37
43
|
}
|
|
38
44
|
if (obj instanceof CalcitMap || obj instanceof CalcitSliceMap) {
|
|
39
|
-
return ["div", { style: "color: hsl(280, 80%, 60%, 0.4)" }, obj.toString(true, true)];
|
|
45
|
+
return ["div", { style: "color: hsl(280, 80%, 60%, 0.4)" }, shortPreview(obj.toString(true, true))];
|
|
40
46
|
}
|
|
41
47
|
if (obj instanceof CalcitSet) {
|
|
42
48
|
return ["div", { style: "color: hsl(280, 80%, 60%, 0.4)" }, obj.toString(true)];
|
|
@@ -98,11 +104,12 @@ export let load_console_formatter_$x_ = () => {
|
|
|
98
104
|
},
|
|
99
105
|
body: (obj, config) => {
|
|
100
106
|
if (obj instanceof CalcitList || obj instanceof CalcitSliceList) {
|
|
107
|
+
let flexMode = obj.len() > 40 ? "inline-flex" : "flex";
|
|
101
108
|
return ["div", { style: "color: hsl(280, 80%, 60%)" }].concat(obj.toArray().map((x, idx) => {
|
|
102
109
|
return [
|
|
103
110
|
"div",
|
|
104
|
-
{ style:
|
|
105
|
-
["span", { style: "font-family: monospace; margin-right: 8px; color: hsl(280,80%,
|
|
111
|
+
{ style: `margin-left: 8px; display: ${flexMode}; padding-right: 16px;` },
|
|
112
|
+
["span", { style: "font-family: monospace; margin-right: 8px; color: hsl(280,80%,85%); flex-shrink: 0; font-size: 10px;" }, idx],
|
|
106
113
|
embedObject(x),
|
|
107
114
|
];
|
|
108
115
|
}));
|
package/package.json
CHANGED
package/ts-src/calcit-data.mts
CHANGED
|
@@ -404,7 +404,7 @@ export let toString = (x: CalcitValue, escaped: boolean, disableJsDataWarning: b
|
|
|
404
404
|
}
|
|
405
405
|
|
|
406
406
|
if (!disableJsDataWarning) {
|
|
407
|
-
console.warn("
|
|
407
|
+
console.warn("Non Calcit data in stringify", x);
|
|
408
408
|
}
|
|
409
409
|
return `(#js ${JSON.stringify(x)})`;
|
|
410
410
|
};
|
package/ts-src/calcit.procs.mts
CHANGED
|
@@ -30,6 +30,13 @@ let embedObject = (x: CalcitValue) => {
|
|
|
30
30
|
];
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
+
let shortPreview = (x: string) => {
|
|
34
|
+
if (x.length > 102) {
|
|
35
|
+
return x.substring(0, 100) + "...";
|
|
36
|
+
}
|
|
37
|
+
return x;
|
|
38
|
+
};
|
|
39
|
+
|
|
33
40
|
export let load_console_formatter_$x_ = () => {
|
|
34
41
|
if (typeof window === "object") {
|
|
35
42
|
window["devtoolsFormatters"] = [
|
|
@@ -45,12 +52,12 @@ export let load_console_formatter_$x_ = () => {
|
|
|
45
52
|
return [
|
|
46
53
|
"div",
|
|
47
54
|
{ style: "color: hsl(280, 80%, 60%, 0.4)" },
|
|
48
|
-
obj.toString(true, true),
|
|
55
|
+
shortPreview(obj.toString(true, true)),
|
|
49
56
|
["span", { style: "font-size: 80%; vertical-align: 0.7em; color: hsl(280, 80%, 60%, 0.8)" }, `${obj.len()}`],
|
|
50
57
|
];
|
|
51
58
|
}
|
|
52
59
|
if (obj instanceof CalcitMap || obj instanceof CalcitSliceMap) {
|
|
53
|
-
return ["div", { style: "color: hsl(280, 80%, 60%, 0.4)" }, obj.toString(true, true)];
|
|
60
|
+
return ["div", { style: "color: hsl(280, 80%, 60%, 0.4)" }, shortPreview(obj.toString(true, true))];
|
|
54
61
|
}
|
|
55
62
|
if (obj instanceof CalcitSet) {
|
|
56
63
|
return ["div", { style: "color: hsl(280, 80%, 60%, 0.4)" }, obj.toString(true)];
|
|
@@ -112,12 +119,13 @@ export let load_console_formatter_$x_ = () => {
|
|
|
112
119
|
},
|
|
113
120
|
body: (obj, config) => {
|
|
114
121
|
if (obj instanceof CalcitList || obj instanceof CalcitSliceList) {
|
|
122
|
+
let flexMode = obj.len() > 40 ? "inline-flex" : "flex";
|
|
115
123
|
return ["div", { style: "color: hsl(280, 80%, 60%)" }].concat(
|
|
116
124
|
obj.toArray().map((x, idx) => {
|
|
117
125
|
return [
|
|
118
126
|
"div",
|
|
119
|
-
{ style:
|
|
120
|
-
["span", { style: "font-family: monospace; margin-right: 8px; color: hsl(280,80%,
|
|
127
|
+
{ style: `margin-left: 8px; display: ${flexMode}; padding-right: 16px;` },
|
|
128
|
+
["span", { style: "font-family: monospace; margin-right: 8px; color: hsl(280,80%,85%); flex-shrink: 0; font-size: 10px;" }, idx],
|
|
121
129
|
embedObject(x),
|
|
122
130
|
];
|
|
123
131
|
}) as any[]
|