@youtyan/code-viewer 0.8.3 → 0.8.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@youtyan/code-viewer",
3
- "version": "0.8.3",
3
+ "version": "0.8.4",
4
4
  "description": "Local browser-based code and git diff viewer",
5
5
  "type": "module",
6
6
  "bin": {
package/web/app.js CHANGED
@@ -13336,6 +13336,19 @@ ${frontmatter.yaml}
13336
13336
  return btn;
13337
13337
  }
13338
13338
 
13339
+ // web-src/views/database/query-value.ts
13340
+ function formatQueryValue(value) {
13341
+ if (value === null)
13342
+ return "NULL";
13343
+ if (value instanceof Uint8Array)
13344
+ return `<blob ${value.byteLength} bytes>`;
13345
+ if (typeof value === "boolean")
13346
+ return value ? "true" : "false";
13347
+ if (typeof value === "object")
13348
+ return JSON.stringify(value);
13349
+ return String(value);
13350
+ }
13351
+
13339
13352
  // web-src/views/database/shiki-sql.ts
13340
13353
  function highlightSqlToInnerHtml(code2, highlighter) {
13341
13354
  if (!highlighter || !code2)
@@ -13517,7 +13530,7 @@ ${frontmatter.yaml}
13517
13530
  tr.appendChild(tdNum);
13518
13531
  for (const value of row) {
13519
13532
  const td = document.createElement("td");
13520
- td.textContent = formatValue(value);
13533
+ td.textContent = formatQueryValue(value);
13521
13534
  if (value === null)
13522
13535
  td.classList.add("null");
13523
13536
  tr.appendChild(td);
@@ -13677,17 +13690,6 @@ ${frontmatter.yaml}
13677
13690
  localize
13678
13691
  };
13679
13692
  }
13680
- function formatValue(value) {
13681
- if (value === null)
13682
- return "NULL";
13683
- if (value instanceof Uint8Array)
13684
- return `<blob ${value.byteLength} bytes>`;
13685
- if (typeof value === "boolean")
13686
- return value ? "true" : "false";
13687
- if (typeof value === "object")
13688
- return JSON.stringify(value);
13689
- return String(value);
13690
- }
13691
13693
 
13692
13694
  // web-src/views/database/query-history-view.ts
13693
13695
  function createQueryHistoryView(callbacks) {
@@ -13996,7 +13998,7 @@ ${frontmatter.yaml}
13996
13998
  tr.appendChild(tdNum);
13997
13999
  for (const value of row) {
13998
14000
  const td = document.createElement("td");
13999
- td.textContent = formatValue2(value);
14001
+ td.textContent = formatQueryValue(value);
14000
14002
  if (value === null)
14001
14003
  td.classList.add("null");
14002
14004
  tr.appendChild(td);
@@ -14131,17 +14133,6 @@ ${frontmatter.yaml}
14131
14133
  return iso;
14132
14134
  }
14133
14135
  }
14134
- function formatValue2(value) {
14135
- if (value === null)
14136
- return "NULL";
14137
- if (value instanceof Uint8Array)
14138
- return `<blob ${value.byteLength} bytes>`;
14139
- if (typeof value === "boolean")
14140
- return value ? "true" : "false";
14141
- if (typeof value === "object")
14142
- return JSON.stringify(value);
14143
- return String(value);
14144
- }
14145
14136
 
14146
14137
  // web-src/views/database/redis-explorer.ts
14147
14138
  function isBinaryItem(item) {
@@ -19042,7 +19033,7 @@ ${entry.message}` : entry.detail ?? entry.message ?? "";
19042
19033
  }
19043
19034
  for (let c2 = 0;c2 < columnNames.length; c2++) {
19044
19035
  const original = rowData[c2];
19045
- const originalShown = original === null ? null : original instanceof Uint8Array ? formatValue3(original) : String(original);
19036
+ const originalShown = original === null ? null : original instanceof Uint8Array ? formatValue(original) : String(original);
19046
19037
  const hasOverride = pendingForRow?.edits.has(c2) ?? false;
19047
19038
  const shown = hasOverride ? pendingForRow?.edits.get(c2) ?? null : originalShown;
19048
19039
  const ro = !editableRow || columns[c2]?.primaryKey === true || original instanceof Uint8Array;
@@ -19118,7 +19109,7 @@ ${entry.message}` : entry.detail ?? entry.message ?? "";
19118
19109
  cell.className = "db-grid-cell";
19119
19110
  cell.style.width = `${getColWidth(columnNames[c2])}px`;
19120
19111
  const val = rowData[c2];
19121
- cell.textContent = formatValue3(val);
19112
+ cell.textContent = formatValue(val);
19122
19113
  if (val === null)
19123
19114
  cell.classList.add("null");
19124
19115
  else if (val instanceof Uint8Array)
@@ -19715,7 +19706,7 @@ ${entry.message}` : entry.detail ?? entry.message ?? "";
19715
19706
  onEditModeChange
19716
19707
  };
19717
19708
  }
19718
- function formatValue3(value) {
19709
+ function formatValue(value) {
19719
19710
  if (value === null)
19720
19711
  return "NULL";
19721
19712
  if (value instanceof Uint8Array)