Skip to content

Commit

Permalink
refine custom formatter styles; tag 0.8.40
Browse files Browse the repository at this point in the history
  • Loading branch information
tiye committed Mar 12, 2024
1 parent a46d3e4 commit 3918e39
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "calcit"
version = "0.8.39"
version = "0.8.40"
authors = ["jiyinyiyong <jiyinyiyong@gmail.com>"]
edition = "2021"
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@calcit/procs",
"version": "0.8.39",
"version": "0.8.40",
"main": "./lib/calcit.procs.mjs",
"devDependencies": {
"@types/node": "^20.11.8",
Expand Down
24 changes: 12 additions & 12 deletions ts-src/custom-formatter.mts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ let embedObject = (x: CalcitValue) => {
if (x == null) {
return null;
}
if (typeof x === "string") {
return span({ whiteSpace: "pre-line", color: hsl(120, 70, 50), maxWidth: "100vw" }, `|${x}`);
}
return [
"object",
{
Expand Down Expand Up @@ -144,13 +147,13 @@ export let load_console_formatter_$x_ = () => {
break;
}
}
return div({ color: hasCollection ? hsl(280, 80, 60, 0.4) : undefined }, "{}", preview);
return div({ color: hasCollection ? hsl(280, 80, 60, 0.4) : undefined, maxWidth: "100%", whiteSpace: "normal" }, "{}", preview);
}
if (obj instanceof CalcitSet) {
return div({ color: hsl(280, 80, 60, 0.4) }, obj.toString(true));
}
if (obj instanceof CalcitRecord) {
let ret: any[] = div({ color: hsl(280, 80, 60, 0.4) }, `%{} ${obj.name} ...`);
let ret: any[] = div({ color: hsl(280, 80, 60, 0.4), maxWidth: "100%" }, `%{} ${obj.name} ...`);
return ret;
}
if (obj instanceof CalcitTuple) {
Expand Down Expand Up @@ -230,6 +233,7 @@ export let load_console_formatter_$x_ = () => {
color: hsl(280, 80, 90),
flexShrink: 0,
fontSize: "10px",
whiteSpace: "nowrap",
},
idx
),
Expand Down Expand Up @@ -265,11 +269,9 @@ export let load_console_formatter_$x_ = () => {
let [k, v] = pairs[idx];
ret.push(
tr(
{
marginLeft: "8px",
},
td({ marginLeft: "8px", verticalAlign: "top" }, embedObject(k)),
td({ marginLeft: "8px" }, embedObject(v))
{},
td({ paddingLeft: "8px", verticalAlign: "top", whiteSpace: "nowrap", minWidth: "40px" }, embedObject(k)),
td({ paddingLeft: "8px" }, embedObject(v))
)
);
}
Expand All @@ -280,11 +282,9 @@ export let load_console_formatter_$x_ = () => {
for (let idx = 0; idx < obj.fields.length; idx++) {
ret.push(
tr(
{
marginLeft: "8px",
},
td({ marginLeft: "8px", verticalAlign: "top" }, embedObject(obj.fields[idx])),
td({ marginLeft: "8px" }, embedObject(obj.values[idx]))
{},
td({ paddingLeft: "8px", verticalAlign: "top", whiteSpace: "pre", minWidth: "40px" }, embedObject(obj.fields[idx])),
td({ paddingLeft: "8px" }, embedObject(obj.values[idx]))
)
);
}
Expand Down

0 comments on commit 3918e39

Please sign in to comment.