@calcit/procs 0.8.5 → 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.
@@ -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("Unknown structure to string, better use `console.log`", x);
373
+ console.warn("Non Calcit data in stringify", x);
374
374
  }
375
375
  return `(#js ${JSON.stringify(x)})`;
376
376
  };
@@ -1,6 +1,6 @@
1
1
  var _a;
2
2
  // CALCIT VERSION
3
- export const calcit_version = "0.8.5";
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";
@@ -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: "margin-left: 8px; display: flex;" },
105
- ["span", { style: "font-family: monospace; margin-right: 8px; color: hsl(280,80%,90%); flex-shrink: 0;" }, idx],
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@calcit/procs",
3
- "version": "0.8.5",
3
+ "version": "0.8.6",
4
4
  "main": "./lib/calcit.procs.mjs",
5
5
  "devDependencies": {
6
6
  "@types/node": "^20.6.2",
@@ -404,7 +404,7 @@ export let toString = (x: CalcitValue, escaped: boolean, disableJsDataWarning: b
404
404
  }
405
405
 
406
406
  if (!disableJsDataWarning) {
407
- console.warn("Unknown structure to string, better use `console.log`", x);
407
+ console.warn("Non Calcit data in stringify", x);
408
408
  }
409
409
  return `(#js ${JSON.stringify(x)})`;
410
410
  };
@@ -1,5 +1,5 @@
1
1
  // CALCIT VERSION
2
- export const calcit_version = "0.8.5";
2
+ export const calcit_version = "0.8.6";
3
3
 
4
4
  import { parse, ICirruNode } from "@cirru/parser.ts";
5
5
  import { writeCirruCode } from "@cirru/writer.ts";
@@ -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: "margin-left: 8px; display: flex;" },
120
- ["span", { style: "font-family: monospace; margin-right: 8px; color: hsl(280,80%,90%); flex-shrink: 0;" }, idx],
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[]