vuehex 0.5.6 → 0.5.8
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/index.js +295 -264
- package/package.json +1 -1
- package/dist/screenshot001.png +0 -0
- package/dist/screenshot002.png +0 -0
package/dist/index.js
CHANGED
|
@@ -52,99 +52,111 @@ function normalizeThemeKey(e) {
|
|
|
52
52
|
return t && t.toLowerCase().replace(/[^a-z0-9_-]+/g, "-").replace(/-{2,}/g, "-").replace(/^-+|-+$/g, "") || null;
|
|
53
53
|
}
|
|
54
54
|
function useChunking(e) {
|
|
55
|
-
let n = ref(0)
|
|
55
|
+
let n = ref(0);
|
|
56
|
+
function r() {
|
|
57
|
+
let e = o.value;
|
|
58
|
+
return Number.isFinite(e) && e > 0 ? e : null;
|
|
59
|
+
}
|
|
60
|
+
function i(e) {
|
|
61
|
+
return Math.max(e - 1, 0);
|
|
62
|
+
}
|
|
63
|
+
let a = computed(() => {
|
|
56
64
|
let t = e.totalBytes.value;
|
|
57
65
|
return t <= 0 ? 0 : Math.ceil(t / Math.max(e.bytesPerRow.value, 1));
|
|
58
|
-
}),
|
|
66
|
+
}), o = computed(() => {
|
|
59
67
|
let t = e.maxVirtualHeight.value;
|
|
60
68
|
if (!Number.isFinite(t) || t <= 0) return Infinity;
|
|
61
69
|
let n = e.rowHeightValue.value;
|
|
62
70
|
if (!Number.isFinite(n) || n <= 0) return Infinity;
|
|
63
71
|
let r = Math.floor(t / n);
|
|
64
72
|
return r > 0 ? r : Infinity;
|
|
65
|
-
}),
|
|
66
|
-
let e =
|
|
67
|
-
return
|
|
68
|
-
}), o = computed(() => a.value ? Math.max(1, Math.ceil(r.value / i.value)) : 1), s = computed(() => {
|
|
69
|
-
if (!a.value) return 0;
|
|
70
|
-
let e = i.value;
|
|
71
|
-
return !Number.isFinite(e) || e <= 0 ? 0 : clamp(Math.floor(Math.max(0, n.value) / e), 0, Math.max(o.value - 1, 0));
|
|
73
|
+
}), s = computed(() => {
|
|
74
|
+
let e = r();
|
|
75
|
+
return e !== null && a.value > e;
|
|
72
76
|
}), c = computed(() => {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
let t = i.value;
|
|
77
|
-
if (!Number.isFinite(t) || t <= 0) return e;
|
|
78
|
-
let o = Math.max(e - Math.max(0, n.value), 0);
|
|
79
|
-
return Math.min(o, t);
|
|
77
|
+
if (!s.value) return 1;
|
|
78
|
+
let e = r();
|
|
79
|
+
return e ? Math.max(1, Math.ceil(a.value / e)) : 1;
|
|
80
80
|
}), l = computed(() => {
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
if (!s.value) return 0;
|
|
82
|
+
let e = r();
|
|
83
|
+
return e ? clamp(Math.floor(Math.max(0, n.value) / e), 0, Math.max(c.value - 1, 0)) : 0;
|
|
83
84
|
}), u = computed(() => {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
if (
|
|
87
|
-
let
|
|
88
|
-
|
|
85
|
+
let e = a.value;
|
|
86
|
+
if (e <= 0) return 0;
|
|
87
|
+
if (!s.value) return e;
|
|
88
|
+
let t = r();
|
|
89
|
+
if (!t) return e;
|
|
90
|
+
let i = Math.max(e - Math.max(0, n.value), 0);
|
|
91
|
+
return Math.min(i, t);
|
|
92
|
+
}), d = computed(() => {
|
|
93
|
+
let t = u.value;
|
|
94
|
+
return t <= 0 ? 0 : t * e.rowHeightValue.value;
|
|
95
|
+
}), f = computed(() => {
|
|
96
|
+
if (!e.showNavigator.value || !s.value) return [];
|
|
97
|
+
let t = a.value, n = r();
|
|
98
|
+
if (t <= 0 || !n) return [];
|
|
99
|
+
let i = Math.max(e.bytesPerRow.value, 1), o = e.totalBytes.value, l = !!e.uppercase.value, u = [];
|
|
100
|
+
for (let e = 0; e < c.value; e += 1) {
|
|
89
101
|
let r = e * n;
|
|
90
102
|
if (r >= t) break;
|
|
91
|
-
let
|
|
103
|
+
let a = Math.min(n, t - r), s = r * i, c = Math.min(a * i, Math.max(o - s, 0)), d = c > 0 ? s + c - 1 : s;
|
|
92
104
|
u.push({
|
|
93
105
|
index: e,
|
|
94
106
|
label: `Chunk ${e + 1}`,
|
|
95
|
-
range: `${formatOffsetPlain(
|
|
107
|
+
range: `${formatOffsetPlain(s, l)} - ${formatOffsetPlain(d, l)}`
|
|
96
108
|
});
|
|
97
109
|
}
|
|
98
110
|
return u;
|
|
99
111
|
});
|
|
100
|
-
function
|
|
101
|
-
let e =
|
|
112
|
+
function p() {
|
|
113
|
+
let e = a.value;
|
|
102
114
|
if (e <= 0) {
|
|
103
115
|
n.value = 0;
|
|
104
116
|
return;
|
|
105
117
|
}
|
|
106
|
-
if (!
|
|
118
|
+
if (!s.value) {
|
|
107
119
|
n.value = 0;
|
|
108
120
|
return;
|
|
109
121
|
}
|
|
110
|
-
let t =
|
|
111
|
-
if (!
|
|
112
|
-
n.value =
|
|
122
|
+
let t = r(), o = i(e), c = clamp(Math.max(0, Math.trunc(n.value)), 0, o);
|
|
123
|
+
if (!t) {
|
|
124
|
+
n.value = c;
|
|
113
125
|
return;
|
|
114
126
|
}
|
|
115
|
-
n.value = clamp(Math.floor(
|
|
127
|
+
n.value = clamp(Math.floor(c / t) * t, 0, o);
|
|
116
128
|
}
|
|
117
|
-
function
|
|
118
|
-
if (Number.isFinite(e) || (e = 0),
|
|
119
|
-
let t =
|
|
120
|
-
if (!
|
|
121
|
-
let o =
|
|
129
|
+
function m(e) {
|
|
130
|
+
if (Number.isFinite(e) || (e = 0), p(), !s.value) return !1;
|
|
131
|
+
let t = r();
|
|
132
|
+
if (!t) return !1;
|
|
133
|
+
let o = a.value;
|
|
122
134
|
if (o <= 0) return !1;
|
|
123
|
-
let
|
|
124
|
-
return l === n.value ? !1 : (n.value = l, !0);
|
|
125
|
-
}
|
|
126
|
-
function p(e) {
|
|
127
|
-
if (!Number.isFinite(e) || !a.value) return !1;
|
|
128
|
-
let t = i.value;
|
|
129
|
-
if (!Number.isFinite(t) || t <= 0) return !1;
|
|
130
|
-
let s = r.value;
|
|
131
|
-
if (s <= 0) return !1;
|
|
132
|
-
let c = Math.max(s - 1, 0), l = Math.max(o.value - 1, 0), u = clamp(clamp(Math.floor(e), 0, l) * t, 0, c);
|
|
135
|
+
let c = i(o), l = clamp(Math.floor(e), 0, c), u = clamp(Math.floor(l / t) * t, 0, c);
|
|
133
136
|
return u === n.value ? !1 : (n.value = u, !0);
|
|
134
137
|
}
|
|
138
|
+
function h(e) {
|
|
139
|
+
if (!Number.isFinite(e) || !s.value) return !1;
|
|
140
|
+
let t = r();
|
|
141
|
+
if (!t) return !1;
|
|
142
|
+
let o = a.value;
|
|
143
|
+
if (o <= 0) return !1;
|
|
144
|
+
let l = i(o), u = Math.max(c.value - 1, 0), d = clamp(clamp(Math.floor(e), 0, u) * t, 0, l);
|
|
145
|
+
return d === n.value ? !1 : (n.value = d, !0);
|
|
146
|
+
}
|
|
135
147
|
return {
|
|
136
148
|
chunkStartRow: n,
|
|
137
|
-
totalRows:
|
|
138
|
-
chunkRowCapacity:
|
|
139
|
-
isChunking:
|
|
140
|
-
chunkCount:
|
|
141
|
-
activeChunkIndex:
|
|
142
|
-
chunkRowCount:
|
|
143
|
-
chunkHeight:
|
|
144
|
-
chunkItems:
|
|
145
|
-
clampChunkStartToBounds:
|
|
146
|
-
ensureChunkForRow:
|
|
147
|
-
selectChunk:
|
|
149
|
+
totalRows: a,
|
|
150
|
+
chunkRowCapacity: o,
|
|
151
|
+
isChunking: s,
|
|
152
|
+
chunkCount: c,
|
|
153
|
+
activeChunkIndex: l,
|
|
154
|
+
chunkRowCount: u,
|
|
155
|
+
chunkHeight: d,
|
|
156
|
+
chunkItems: f,
|
|
157
|
+
clampChunkStartToBounds: p,
|
|
158
|
+
ensureChunkForRow: m,
|
|
159
|
+
selectChunk: h
|
|
148
160
|
};
|
|
149
161
|
}
|
|
150
162
|
var CURSOR_CLASS = "vuehex-cursor";
|
|
@@ -302,24 +314,24 @@ function escapeClassAttribute(e) {
|
|
|
302
314
|
return n.join(" ");
|
|
303
315
|
}
|
|
304
316
|
function useHexWindow(e) {
|
|
305
|
-
let n = shallowRef(""), r = shallowRef(new Uint8Array()), i = shallowRef("."), a = ref(0), o = ref(null), s = ref(!1), c = shallowRef(null), u = computed(() => {
|
|
317
|
+
let n = shallowRef(""), r = shallowRef(new Uint8Array()), i = shallowRef("."), a = ref(0), o = ref(null), s = ref(!1), c = shallowRef(null), u = ref(null), d = computed(() => {
|
|
306
318
|
let t = e.getWindowState();
|
|
307
319
|
return Math.floor(t.offset / Math.max(e.bytesPerRow.value, 1));
|
|
308
|
-
}),
|
|
320
|
+
}), f = computed(() => {
|
|
309
321
|
let t = r.value.length;
|
|
310
322
|
return t === 0 ? 0 : Math.max(1, Math.ceil(t / Math.max(e.bytesPerRow.value, 1)));
|
|
311
323
|
});
|
|
312
|
-
function
|
|
324
|
+
function p() {
|
|
313
325
|
e.clampChunkStartToBounds();
|
|
314
326
|
let t = e.getWindowState(), n = normalizeSource(t.data);
|
|
315
327
|
r.value = n, i.value = resolveFallbackChar(e.getNonPrintableChar()), c.value = {
|
|
316
328
|
offset: t.offset,
|
|
317
329
|
length: n.length
|
|
318
|
-
},
|
|
319
|
-
|
|
330
|
+
}, w(), nextTick(() => {
|
|
331
|
+
C(), h();
|
|
320
332
|
});
|
|
321
333
|
}
|
|
322
|
-
function
|
|
334
|
+
function m(t) {
|
|
323
335
|
let n = e.containerEl.value;
|
|
324
336
|
if (!n) return !1;
|
|
325
337
|
let r = Math.max(e.bytesPerRow.value, 1), i = Math.floor(t / r);
|
|
@@ -327,35 +339,47 @@ function useHexWindow(e) {
|
|
|
327
339
|
let a = i - e.chunkStartRow.value, o = e.rowHeightValue.value;
|
|
328
340
|
return o > 0 && (n.scrollTop = Math.max(a * o, 0)), !0;
|
|
329
341
|
}
|
|
330
|
-
function
|
|
342
|
+
function h() {
|
|
331
343
|
if (s.value) return;
|
|
332
344
|
s.value = !0;
|
|
333
345
|
let e = typeof window < "u" && typeof window.requestAnimationFrame == "function", t = () => {
|
|
334
|
-
s.value = !1,
|
|
346
|
+
s.value = !1, S(), v(), w(), D();
|
|
335
347
|
};
|
|
336
348
|
e ? window.requestAnimationFrame(t) : nextTick(t);
|
|
337
349
|
}
|
|
338
|
-
function
|
|
339
|
-
|
|
350
|
+
function _() {
|
|
351
|
+
h();
|
|
340
352
|
}
|
|
341
|
-
function
|
|
342
|
-
|
|
353
|
+
function v() {
|
|
354
|
+
if (!e.isSelfManagedData.value) return;
|
|
355
|
+
let t = e.containerEl.value;
|
|
356
|
+
if (!t) return;
|
|
357
|
+
let n = e.rowHeightValue.value;
|
|
358
|
+
if (!(n > 0)) return;
|
|
359
|
+
let r = Math.max(e.bytesPerRow.value, 1), i = t.scrollTop, a = Math.floor(i / n), o = e.chunkStartRow.value + a, s = Math.max(0, o * r);
|
|
360
|
+
s !== e.windowOffset.value && (u.value = s, e.windowOffset.value = s);
|
|
361
|
+
}
|
|
362
|
+
watch(() => e.windowOffset.value, (t, n) => {
|
|
363
|
+
e.isSelfManagedData.value && t !== n && t !== u.value && t != null && Number.isFinite(t) && t >= 0 && b(t);
|
|
364
|
+
});
|
|
365
|
+
function b(e) {
|
|
366
|
+
o.value = Math.max(0, Math.trunc(e)), h();
|
|
343
367
|
}
|
|
344
|
-
function
|
|
368
|
+
function x(e) {
|
|
345
369
|
if (!Number.isFinite(e)) return;
|
|
346
370
|
let t = Math.max(0, Math.trunc(e));
|
|
347
|
-
if (!
|
|
348
|
-
|
|
371
|
+
if (!m(t)) {
|
|
372
|
+
b(t);
|
|
349
373
|
return;
|
|
350
374
|
}
|
|
351
|
-
o.value = null,
|
|
375
|
+
o.value = null, h();
|
|
352
376
|
}
|
|
353
|
-
function
|
|
377
|
+
function S() {
|
|
354
378
|
if (o.value == null) return;
|
|
355
379
|
let e = o.value;
|
|
356
|
-
|
|
380
|
+
m(e) && (o.value = null);
|
|
357
381
|
}
|
|
358
|
-
function
|
|
382
|
+
function C() {
|
|
359
383
|
let t = e.tbodyEl.value;
|
|
360
384
|
if (!t) return;
|
|
361
385
|
let n = t.querySelector("tr");
|
|
@@ -363,7 +387,7 @@ function useHexWindow(e) {
|
|
|
363
387
|
let r = n.getBoundingClientRect().height;
|
|
364
388
|
r > 0 && r !== e.rowHeight.value && (e.rowHeight.value = r);
|
|
365
389
|
}
|
|
366
|
-
function
|
|
390
|
+
function w() {
|
|
367
391
|
let t = r.value, o = Math.max(e.bytesPerRow.value, 1), s = e.getWindowState().offset;
|
|
368
392
|
if (t.length === 0) {
|
|
369
393
|
n.value = "", a.value = Math.floor(s / o), e.clearHoverState();
|
|
@@ -384,10 +408,10 @@ function useHexWindow(e) {
|
|
|
384
408
|
}
|
|
385
409
|
let m = l - s, h = Math.min(t.length, m + (u - l)), g = t.subarray(m, h);
|
|
386
410
|
a.value = Math.floor(l / o);
|
|
387
|
-
let _ = e.getPrintableChecker(), v = e.getAsciiRenderer(), y = e.getSelectionRange(), b =
|
|
411
|
+
let _ = e.getPrintableChecker(), v = e.getAsciiRenderer(), y = e.getSelectionRange(), b = T(g, o, e.getUppercase(), i.value, l, _, v, y, e.getCellClassResolver());
|
|
388
412
|
n.value !== b && (e.clearHoverState(), n.value = b);
|
|
389
413
|
}
|
|
390
|
-
function
|
|
414
|
+
function T(e, t, n, r, i, a, o, s, c) {
|
|
391
415
|
if (e.length === 0) return "";
|
|
392
416
|
let l = n ? HEX_UPPER : HEX_LOWER, u = t % 2 == 0, d = u ? t / 2 : -1, f = Array(t);
|
|
393
417
|
for (let e = 0; e < t; e++) {
|
|
@@ -450,7 +474,7 @@ function useHexWindow(e) {
|
|
|
450
474
|
}
|
|
451
475
|
return _.length = v, _.join("");
|
|
452
476
|
}
|
|
453
|
-
function
|
|
477
|
+
function D() {
|
|
454
478
|
if (e.viewportRows.value === 0) return;
|
|
455
479
|
let t = e.containerEl.value;
|
|
456
480
|
if (!t) return;
|
|
@@ -458,12 +482,12 @@ function useHexWindow(e) {
|
|
|
458
482
|
if (n <= 0 || r <= 0) return;
|
|
459
483
|
let i = e.chunkRowCount.value;
|
|
460
484
|
if (i <= 0) return;
|
|
461
|
-
let a = e.chunkStartRow.value, o = a + i, s = e.overscanRows.value, l = t.scrollTop,
|
|
485
|
+
let a = e.chunkStartRow.value, o = a + i, s = e.overscanRows.value, l = t.scrollTop, u = clamp(clamp(a + Math.floor(l / n), a, Math.max(o - 1, a)) - s, a, Math.max(o - 1, a)), p = Math.max(e.viewportRows.value + s * 2, 1), m = Math.max(o - u, 0), h = Math.min(m, p);
|
|
462
486
|
if (h <= 0) return;
|
|
463
|
-
let g =
|
|
487
|
+
let g = u * r, _ = Math.max(e.totalBytes.value - g, 0), v = Math.min(_, h * r);
|
|
464
488
|
if (v <= 0) return;
|
|
465
|
-
let y =
|
|
466
|
-
b <=
|
|
489
|
+
let y = u + Math.ceil(v / r), b = d.value, x = b + f.value;
|
|
490
|
+
b <= u && x >= y || c.value && c.value.offset === g && c.value.length === v || (c.value = {
|
|
467
491
|
offset: g,
|
|
468
492
|
length: v
|
|
469
493
|
}, e.requestWindow(c.value));
|
|
@@ -473,15 +497,15 @@ function useHexWindow(e) {
|
|
|
473
497
|
normalizedBytes: r,
|
|
474
498
|
fallbackAsciiChar: i,
|
|
475
499
|
renderStartRow: a,
|
|
476
|
-
renderedRows:
|
|
477
|
-
startRow:
|
|
478
|
-
scheduleWindowEvaluation:
|
|
479
|
-
handleScroll:
|
|
480
|
-
scrollToByte:
|
|
481
|
-
queueScrollToOffset:
|
|
482
|
-
updateFromWindowState:
|
|
483
|
-
updateRenderedSlice:
|
|
484
|
-
measureRowHeight:
|
|
500
|
+
renderedRows: f,
|
|
501
|
+
startRow: d,
|
|
502
|
+
scheduleWindowEvaluation: h,
|
|
503
|
+
handleScroll: _,
|
|
504
|
+
scrollToByte: x,
|
|
505
|
+
queueScrollToOffset: b,
|
|
506
|
+
updateFromWindowState: p,
|
|
507
|
+
updateRenderedSlice: w,
|
|
508
|
+
measureRowHeight: C
|
|
485
509
|
};
|
|
486
510
|
}
|
|
487
511
|
function useHoverLinking(e) {
|
|
@@ -755,6 +779,27 @@ function useSelection(e) {
|
|
|
755
779
|
selectionCount: o
|
|
756
780
|
};
|
|
757
781
|
}
|
|
782
|
+
function useVueHexTheme(e) {
|
|
783
|
+
let n = computed(() => normalizeThemeKey(e.theme.value)), r = computed(() => {
|
|
784
|
+
let e = n.value;
|
|
785
|
+
return !e || e === "auto" ? ["vuehex-theme-auto"] : [`vuehex-theme-${e}`];
|
|
786
|
+
}), i = computed(() => {
|
|
787
|
+
let t = ["vuehex"];
|
|
788
|
+
return t.push(...r.value), e.isExpandToContent.value && t.push("vuehex--expand-to-content"), e.selectionEnabled.value || t.push("vuehex-selection-disabled"), t;
|
|
789
|
+
}), a = computed(() => [...r.value]), o = computed(() => e.statusbar.value === "top" || e.statusbar.value === "bottom" ? e.statusbar.value : null);
|
|
790
|
+
return {
|
|
791
|
+
themeKey: n,
|
|
792
|
+
themeClass: r,
|
|
793
|
+
containerClass: i,
|
|
794
|
+
rootClassExtra: a,
|
|
795
|
+
showStatusBar: computed(() => o.value != null),
|
|
796
|
+
statusBarPlacement: o,
|
|
797
|
+
viewerClassExtra: computed(() => {
|
|
798
|
+
let e = o.value;
|
|
799
|
+
return e ? ["vuehex-viewer--with-statusbar", e === "top" ? "vuehex-viewer--statusbar-top" : "vuehex-viewer--statusbar-bottom"] : [];
|
|
800
|
+
})
|
|
801
|
+
};
|
|
802
|
+
}
|
|
758
803
|
var _hoisted_1$2 = { class: "vuehex-chunk-nav__header" }, _hoisted_2$2 = { class: "vuehex-chunk-nav__summary" }, _hoisted_3$1 = {
|
|
759
804
|
class: "vuehex-chunk-list",
|
|
760
805
|
role: "listbox"
|
|
@@ -824,7 +869,15 @@ var _hoisted_1$2 = { class: "vuehex-chunk-nav__header" }, _hoisted_2$2 = { class
|
|
|
824
869
|
select: () => S(e.index)
|
|
825
870
|
}, () => [createElementVNode("span", _hoisted_5$1, toDisplayString(e.label), 1), createElementVNode("span", _hoisted_6$1, toDisplayString(e.range), 1)])], 10, _hoisted_4$1))), 128))])], 2)) : createCommentVNode("", !0), createElementVNode("div", { class: normalizeClass(y.value) }, [renderSlot(t.$slots, "default")], 2)], 2));
|
|
826
871
|
}
|
|
827
|
-
})
|
|
872
|
+
});
|
|
873
|
+
const VUE_HEX_BUILTIN_THEME_KEYS = [
|
|
874
|
+
"auto",
|
|
875
|
+
"light",
|
|
876
|
+
"dark",
|
|
877
|
+
"terminal",
|
|
878
|
+
"sunset"
|
|
879
|
+
];
|
|
880
|
+
var VUEHEX_CATEGORY_DIGIT_CLASS = "vuehex-category-digit", VUEHEX_CATEGORY_UPPERCASE_CLASS = "vuehex-category-uppercase", VUEHEX_CATEGORY_LOWERCASE_CLASS = "vuehex-category-lowercase", VUEHEX_CATEGORY_NULL_CLASS = "vuehex-category-null", VUEHEX_CATEGORY_ERASED_CLASS = "vuehex-category-erased", VUEHEX_CATEGORY_CONTROL_CLASS = "vuehex-category-control", VUEHEX_CATEGORY_HIGHBIT_CLASS = "vuehex-category-highbit";
|
|
828
881
|
const DEFAULT_ASCII_CATEGORY_CELL_CLASS_RESOLVER = ({ byte: e }) => {
|
|
829
882
|
if (e >= 48 && e <= 57) return VUEHEX_CATEGORY_DIGIT_CLASS;
|
|
830
883
|
if (e >= 65 && e <= 90) return VUEHEX_CATEGORY_UPPERCASE_CLASS;
|
|
@@ -970,34 +1023,34 @@ var _hoisted_1$1 = { class: "vuehex-statusbar__section vuehex-statusbar__section
|
|
|
970
1023
|
let n = e[t];
|
|
971
1024
|
return typeof n == "number" && Number.isFinite(n) ? n : null;
|
|
972
1025
|
}
|
|
973
|
-
function
|
|
1026
|
+
function N(e, t) {
|
|
974
1027
|
if (e === null) return "";
|
|
975
1028
|
if (A(t, "format") === "decimal") return String(Math.max(0, Math.trunc(e)));
|
|
976
1029
|
let n = !!o.uppercase, r = Math.max(0, Math.trunc(M(t, "pad") ?? 0)), i = Math.max(0, Math.trunc(e)).toString(16), a = (n ? i.toUpperCase() : i).padStart(r, "0");
|
|
977
1030
|
return j(t, "prefix") ?? !0 ? `0x${a}` : a;
|
|
978
1031
|
}
|
|
979
|
-
function
|
|
1032
|
+
function P(e, t) {
|
|
980
1033
|
return e ? j(t, "prefix") ? `0x${e}` : e : "";
|
|
981
1034
|
}
|
|
982
|
-
function
|
|
1035
|
+
function F(e, t) {
|
|
983
1036
|
return e ? j(t, "quote") ? `'${e}'` : e : "";
|
|
984
1037
|
}
|
|
985
|
-
function
|
|
1038
|
+
function I(e) {
|
|
986
1039
|
return e === "left" ? "statusbar-left" : e === "middle" ? "statusbar-middle" : "statusbar-right";
|
|
987
1040
|
}
|
|
988
|
-
function
|
|
1041
|
+
function L(e) {
|
|
989
1042
|
return e === "slot" ? null : e === "offset" ? "10ch" : e === "hex" ? "4ch" : e === "ascii" ? "3ch" : null;
|
|
990
1043
|
}
|
|
991
|
-
function
|
|
1044
|
+
function R(e, t) {
|
|
992
1045
|
if (e === "slot") return;
|
|
993
|
-
let n = A(t, "valueWidth"), r = A(t, "valueMinWidth"), i =
|
|
1046
|
+
let n = A(t, "valueWidth"), r = A(t, "valueMinWidth"), i = L(e), a = {};
|
|
994
1047
|
return n && (a.width = n), r ? a.minWidth = r : !n && i && (a.minWidth = i), (a.width || a.minWidth) && (a.whiteSpace = "nowrap", a.overflow = "hidden", a.textOverflow = "ellipsis"), Object.keys(a).length ? a : void 0;
|
|
995
1048
|
}
|
|
996
|
-
function
|
|
1049
|
+
function z(e, t, n) {
|
|
997
1050
|
let r = e.name.trim();
|
|
998
1051
|
if (!k(r)) return null;
|
|
999
1052
|
if (r === "slot") {
|
|
1000
|
-
let e =
|
|
1053
|
+
let e = I(t);
|
|
1001
1054
|
return {
|
|
1002
1055
|
kind: "slot",
|
|
1003
1056
|
key: n,
|
|
@@ -1011,27 +1064,27 @@ var _hoisted_1$1 = { class: "vuehex-statusbar__section vuehex-statusbar__section
|
|
|
1011
1064
|
key: n,
|
|
1012
1065
|
name: r,
|
|
1013
1066
|
label: i,
|
|
1014
|
-
value:
|
|
1067
|
+
value: N(d.value, e.config),
|
|
1015
1068
|
visible: !0,
|
|
1016
|
-
valueStyle:
|
|
1069
|
+
valueStyle: R(r, e.config)
|
|
1017
1070
|
};
|
|
1018
1071
|
if (r === "hex") return {
|
|
1019
1072
|
kind: "builtin",
|
|
1020
1073
|
key: n,
|
|
1021
1074
|
name: r,
|
|
1022
1075
|
label: i,
|
|
1023
|
-
value:
|
|
1076
|
+
value: P(p.value, e.config),
|
|
1024
1077
|
visible: !0,
|
|
1025
|
-
valueStyle:
|
|
1078
|
+
valueStyle: R(r, e.config)
|
|
1026
1079
|
};
|
|
1027
1080
|
if (r === "ascii") return {
|
|
1028
1081
|
kind: "builtin",
|
|
1029
1082
|
key: n,
|
|
1030
1083
|
name: r,
|
|
1031
1084
|
label: i,
|
|
1032
|
-
value:
|
|
1085
|
+
value: F(m.value, e.config),
|
|
1033
1086
|
visible: !0,
|
|
1034
|
-
valueStyle:
|
|
1087
|
+
valueStyle: R(r, e.config)
|
|
1035
1088
|
};
|
|
1036
1089
|
let a = y.value;
|
|
1037
1090
|
return {
|
|
@@ -1041,16 +1094,16 @@ var _hoisted_1$1 = { class: "vuehex-statusbar__section vuehex-statusbar__section
|
|
|
1041
1094
|
label: i,
|
|
1042
1095
|
value: a,
|
|
1043
1096
|
visible: j(e.config, "showWhenEmpty") ? !0 : !!a,
|
|
1044
|
-
valueStyle:
|
|
1097
|
+
valueStyle: R(r, e.config)
|
|
1045
1098
|
};
|
|
1046
1099
|
}
|
|
1047
|
-
function
|
|
1048
|
-
return O.value[e].map((t, n) =>
|
|
1100
|
+
function B(e) {
|
|
1101
|
+
return O.value[e].map((t, n) => z(t, e, `${e}-${n}`)).filter((e) => e !== null);
|
|
1049
1102
|
}
|
|
1050
|
-
let
|
|
1051
|
-
left:
|
|
1052
|
-
middle:
|
|
1053
|
-
right:
|
|
1103
|
+
let V = computed(() => ({
|
|
1104
|
+
left: B("left"),
|
|
1105
|
+
middle: B("middle"),
|
|
1106
|
+
right: B("right")
|
|
1054
1107
|
}));
|
|
1055
1108
|
return (t, n) => (openBlock(), createElementBlock("div", {
|
|
1056
1109
|
class: normalizeClass(x.value),
|
|
@@ -1058,21 +1111,21 @@ var _hoisted_1$1 = { class: "vuehex-statusbar__section vuehex-statusbar__section
|
|
|
1058
1111
|
role: "status",
|
|
1059
1112
|
"aria-live": "polite"
|
|
1060
1113
|
}, [
|
|
1061
|
-
createElementVNode("div", _hoisted_1$1, [(openBlock(!0), createElementBlock(Fragment, null, renderList(
|
|
1114
|
+
createElementVNode("div", _hoisted_1$1, [(openBlock(!0), createElementBlock(Fragment, null, renderList(V.value.left, (n) => withDirectives((openBlock(), createElementBlock("span", {
|
|
1062
1115
|
key: n.key,
|
|
1063
1116
|
class: "vuehex-statusbar__item"
|
|
1064
1117
|
}, [n.kind === "slot" ? renderSlot(t.$slots, n.slotName, { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createElementVNode("span", _hoisted_2$1, toDisplayString(n.label), 1), createElementVNode("span", {
|
|
1065
1118
|
class: "vuehex-statusbar__value",
|
|
1066
1119
|
style: normalizeStyle(n.valueStyle)
|
|
1067
1120
|
}, toDisplayString(n.value), 5)], 64))])), [[vShow, n.visible]])), 128))]),
|
|
1068
|
-
createElementVNode("div", _hoisted_3, [(openBlock(!0), createElementBlock(Fragment, null, renderList(
|
|
1121
|
+
createElementVNode("div", _hoisted_3, [(openBlock(!0), createElementBlock(Fragment, null, renderList(V.value.middle, (n) => withDirectives((openBlock(), createElementBlock("span", {
|
|
1069
1122
|
key: n.key,
|
|
1070
1123
|
class: "vuehex-statusbar__item"
|
|
1071
1124
|
}, [n.kind === "slot" ? renderSlot(t.$slots, n.slotName, { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createElementVNode("span", _hoisted_4, toDisplayString(n.label), 1), createElementVNode("span", {
|
|
1072
1125
|
class: "vuehex-statusbar__value",
|
|
1073
1126
|
style: normalizeStyle(n.valueStyle)
|
|
1074
1127
|
}, toDisplayString(n.value), 5)], 64))])), [[vShow, n.visible]])), 128))]),
|
|
1075
|
-
createElementVNode("div", _hoisted_5, [(openBlock(!0), createElementBlock(Fragment, null, renderList(
|
|
1128
|
+
createElementVNode("div", _hoisted_5, [(openBlock(!0), createElementBlock(Fragment, null, renderList(V.value.right, (n) => withDirectives((openBlock(), createElementBlock("span", {
|
|
1076
1129
|
key: n.key,
|
|
1077
1130
|
class: "vuehex-statusbar__item"
|
|
1078
1131
|
}, [n.kind === "slot" ? renderSlot(t.$slots, n.slotName, { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createElementVNode("span", _hoisted_6, toDisplayString(n.label), 1), createElementVNode("span", {
|
|
@@ -1081,7 +1134,25 @@ var _hoisted_1$1 = { class: "vuehex-statusbar__section vuehex-statusbar__section
|
|
|
1081
1134
|
}, toDisplayString(n.value), 5)], 64))])), [[vShow, n.visible]])), 128))])
|
|
1082
1135
|
], 6));
|
|
1083
1136
|
}
|
|
1084
|
-
})
|
|
1137
|
+
});
|
|
1138
|
+
function normalizeCellClassForByteResolver(e) {
|
|
1139
|
+
if (e === void 0) return DEFAULT_ASCII_CATEGORY_CELL_CLASS_RESOLVER;
|
|
1140
|
+
if (e !== null) {
|
|
1141
|
+
if (typeof e == "function") return e;
|
|
1142
|
+
if (Array.isArray(e)) {
|
|
1143
|
+
let t = e.filter((e) => typeof e == "function");
|
|
1144
|
+
return t.length === 0 ? void 0 : (e) => {
|
|
1145
|
+
let n = [];
|
|
1146
|
+
for (let r of t) {
|
|
1147
|
+
let t = r(e);
|
|
1148
|
+
t != null && n.push(t);
|
|
1149
|
+
}
|
|
1150
|
+
if (n.length !== 0) return n.flat();
|
|
1151
|
+
};
|
|
1152
|
+
}
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
1155
|
+
var _hoisted_1 = ["aria-disabled", "tabindex"], _hoisted_2 = ["innerHTML"], DEFAULT_ROW_HEIGHT = 24, MAX_VIRTUAL_HEIGHT = 8e6, VueHex_default = /* @__PURE__ */ defineComponent({
|
|
1085
1156
|
__name: "VueHex",
|
|
1086
1157
|
props: /* @__PURE__ */ mergeModels({
|
|
1087
1158
|
dataMode: { default: "auto" },
|
|
@@ -1143,12 +1214,12 @@ var _hoisted_1$1 = { class: "vuehex-statusbar__section vuehex-statusbar__section
|
|
|
1143
1214
|
"update:cursorLocation"
|
|
1144
1215
|
]),
|
|
1145
1216
|
setup(e, { expose: i, emit: o }) {
|
|
1146
|
-
let c = useModel(e, "windowOffset"), l = useModel(e, "modelValue"), _ = useModel(e, "cursorLocation"), y = e, b = o, w = computed(() => !!y.expandToContent), T = computed(() => w.value ? 0 : Math.max(0, Math.trunc(c.value ?? 0))),
|
|
1217
|
+
let c = useModel(e, "windowOffset"), l = useModel(e, "modelValue"), _ = useModel(e, "cursorLocation"), y = e, b = o, w = computed(() => !!y.expandToContent), T = computed(() => w.value ? 0 : Math.max(0, Math.trunc(c.value ?? 0))), pe = computed(() => l.value?.length ?? 0), { isWindowed: O, isSelfManaged: k } = useDataMode({
|
|
1147
1218
|
dataMode: toRef(y, "dataMode"),
|
|
1148
1219
|
isExpandToContent: w,
|
|
1149
1220
|
windowOffset: T,
|
|
1150
1221
|
totalSize: toRef(y, "totalSize"),
|
|
1151
|
-
dataLength:
|
|
1222
|
+
dataLength: pe
|
|
1152
1223
|
}), j = computed(() => ({
|
|
1153
1224
|
offset: k.value ? 0 : T.value,
|
|
1154
1225
|
data: l.value
|
|
@@ -1156,136 +1227,96 @@ var _hoisted_1$1 = { class: "vuehex-statusbar__section vuehex-statusbar__section
|
|
|
1156
1227
|
if (w.value) return j.value.data.length;
|
|
1157
1228
|
let e = y.totalSize;
|
|
1158
1229
|
return typeof e == "number" && Number.isFinite(e) ? Math.max(0, Math.trunc(e)) : j.value.data.length;
|
|
1159
|
-
}),
|
|
1160
|
-
let e = normalizeThemeKey(y.theme);
|
|
1161
|
-
return e ? [
|
|
1162
|
-
"default",
|
|
1163
|
-
"deep-space",
|
|
1164
|
-
"deep_space",
|
|
1165
|
-
"deepspace",
|
|
1166
|
-
"dark-mode",
|
|
1167
|
-
"darkmode"
|
|
1168
|
-
].includes(e) ? "dark" : [
|
|
1169
|
-
"light",
|
|
1170
|
-
"daylight",
|
|
1171
|
-
"light-mode",
|
|
1172
|
-
"lightmode"
|
|
1173
|
-
].includes(e) ? "light" : e : null;
|
|
1174
|
-
}), J = computed(() => {
|
|
1175
|
-
let e = ge.value;
|
|
1176
|
-
return !e || e === "auto" ? ["vuehex-theme-auto"] : [`vuehex-theme-${e}`];
|
|
1177
|
-
}), _e = computed(() => {
|
|
1178
|
-
let e = ["vuehex"];
|
|
1179
|
-
return e.push(...J.value), w.value && e.push("vuehex--expand-to-content"), He.value || e.push("vuehex-selection-disabled"), e;
|
|
1180
|
-
}), ve = computed(() => ["vuehex-table"]), { chunkStartRow: Y, activeChunkIndex: ye, chunkRowCount: be, chunkHeight: xe, chunkItems: Se, clampChunkStartToBounds: Ce, ensureChunkForRow: we, selectChunk: Te } = useChunking({
|
|
1230
|
+
}), N = computed(() => O.value), P = computed(() => !!y.uppercase), F = computed(() => y.isPrintable ?? DEFAULT_PRINTABLE_CHECK), I = computed(() => y.renderAscii ?? DEFAULT_ASCII_RENDERER), L = computed(() => y.nonPrintableChar ?? "."), z = computed(() => w.value ? Infinity : MAX_VIRTUAL_HEIGHT), H = ref(), U = ref(), W = ref(null), G = ref(0), K = computed(() => clampBytesPerRow(y.bytesPerRow)), q = computed(() => W.value ?? DEFAULT_ROW_HEIGHT), J = computed(() => w.value || G.value <= 0 ? 0 : Math.max(1, Math.ceil(G.value / q.value))), me = computed(() => Math.max(0, Math.trunc(y.overscan))), he = computed(() => ["vuehex-table"]), { chunkStartRow: Y, activeChunkIndex: ge, chunkRowCount: _e, chunkHeight: ve, chunkItems: ye, clampChunkStartToBounds: be, ensureChunkForRow: xe, selectChunk: Se } = useChunking({
|
|
1181
1231
|
showNavigator: computed(() => !!y.showChunkNavigator),
|
|
1182
1232
|
totalBytes: M,
|
|
1183
|
-
bytesPerRow:
|
|
1184
|
-
rowHeightValue:
|
|
1185
|
-
maxVirtualHeight:
|
|
1186
|
-
uppercase:
|
|
1187
|
-
}),
|
|
1188
|
-
let e = [];
|
|
1189
|
-
return De.value && (e.push("vuehex-viewer--with-statusbar"), e.push(Oe.value === "top" ? "vuehex-viewer--statusbar-top" : "vuehex-viewer--statusbar-bottom")), e;
|
|
1190
|
-
}), Ae = ref(null), { handlePointerOver: je, handlePointerOut: Me, clearHoverState: Ne } = useHoverLinking({
|
|
1233
|
+
bytesPerRow: K,
|
|
1234
|
+
rowHeightValue: q,
|
|
1235
|
+
maxVirtualHeight: z,
|
|
1236
|
+
uppercase: P
|
|
1237
|
+
}), Ce = ref(null), { handlePointerOver: we, handlePointerOut: Te, clearHoverState: Ee } = useHoverLinking({
|
|
1191
1238
|
emit: (e, t) => {
|
|
1192
|
-
|
|
1239
|
+
Ce.value?.handleHoverEvent(e, t), b(e, t);
|
|
1193
1240
|
},
|
|
1194
|
-
tbodyEl:
|
|
1195
|
-
}),
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
let n = [];
|
|
1204
|
-
for (let r of t) {
|
|
1205
|
-
let t = r(e);
|
|
1206
|
-
t != null && n.push(t);
|
|
1207
|
-
}
|
|
1208
|
-
if (n.length !== 0) return n.flat();
|
|
1209
|
-
};
|
|
1210
|
-
}
|
|
1211
|
-
}
|
|
1212
|
-
}), { markup: X, renderStartRow: Fe, scheduleWindowEvaluation: Z, handleScroll: Ie, scrollToByte: Le, queueScrollToOffset: Re, updateFromWindowState: ze, updateRenderedSlice: Be, measureRowHeight: Ve } = useHexWindow({
|
|
1213
|
-
containerEl: V,
|
|
1214
|
-
tbodyEl: H,
|
|
1215
|
-
bytesPerRow: W,
|
|
1216
|
-
rowHeight: he,
|
|
1217
|
-
rowHeightValue: G,
|
|
1218
|
-
viewportRows: K,
|
|
1219
|
-
overscanRows: q,
|
|
1241
|
+
tbodyEl: U
|
|
1242
|
+
}), De = computed(() => normalizeCellClassForByteResolver(y.cellClassForByte)), X = ref(null), { markup: Z, renderStartRow: Oe, scheduleWindowEvaluation: Q, handleScroll: ke, scrollToByte: Ae, queueScrollToOffset: je, updateFromWindowState: Me, updateRenderedSlice: Ne, measureRowHeight: Pe } = useHexWindow({
|
|
1243
|
+
containerEl: H,
|
|
1244
|
+
tbodyEl: U,
|
|
1245
|
+
bytesPerRow: K,
|
|
1246
|
+
rowHeight: W,
|
|
1247
|
+
rowHeightValue: q,
|
|
1248
|
+
viewportRows: J,
|
|
1249
|
+
overscanRows: me,
|
|
1220
1250
|
chunkStartRow: Y,
|
|
1221
|
-
chunkRowCount:
|
|
1251
|
+
chunkRowCount: _e,
|
|
1222
1252
|
totalBytes: M,
|
|
1223
|
-
|
|
1224
|
-
|
|
1253
|
+
isSelfManagedData: k,
|
|
1254
|
+
windowOffset: c,
|
|
1255
|
+
ensureChunkForRow: xe,
|
|
1256
|
+
clampChunkStartToBounds: be,
|
|
1225
1257
|
getWindowState: () => j.value,
|
|
1226
|
-
getUppercase: () =>
|
|
1227
|
-
getPrintableChecker: () =>
|
|
1228
|
-
getAsciiRenderer: () =>
|
|
1229
|
-
getCellClassResolver: () =>
|
|
1258
|
+
getUppercase: () => P.value,
|
|
1259
|
+
getPrintableChecker: () => F.value,
|
|
1260
|
+
getAsciiRenderer: () => I.value,
|
|
1261
|
+
getCellClassResolver: () => De.value,
|
|
1230
1262
|
getNonPrintableChar: () => L.value,
|
|
1231
|
-
getSelectionRange: () =>
|
|
1263
|
+
getSelectionRange: () => Ie.value,
|
|
1232
1264
|
requestWindow: (e) => {
|
|
1233
|
-
|
|
1265
|
+
N.value && (X.value = e.offset, c.value = e.offset, b("updateVirtualData", e));
|
|
1234
1266
|
},
|
|
1235
|
-
clearHoverState:
|
|
1236
|
-
}), { selectionEnabled:
|
|
1237
|
-
containerEl:
|
|
1238
|
-
tbodyEl:
|
|
1239
|
-
markup:
|
|
1267
|
+
clearHoverState: Ee
|
|
1268
|
+
}), { selectionEnabled: Fe, selectionRange: Ie, selectionCount: Le } = useSelection({
|
|
1269
|
+
containerEl: H,
|
|
1270
|
+
tbodyEl: U,
|
|
1271
|
+
markup: Z,
|
|
1240
1272
|
getSelectionDataProp: () => y.getSelectionData,
|
|
1241
1273
|
isSelfManagedData: k,
|
|
1242
1274
|
totalBytes: M,
|
|
1243
1275
|
getSelfManagedBytes: () => j.value.data,
|
|
1244
|
-
getUppercase: () =>
|
|
1245
|
-
getPrintableChecker: () =>
|
|
1246
|
-
getAsciiRenderer: () =>
|
|
1276
|
+
getUppercase: () => P.value,
|
|
1277
|
+
getPrintableChecker: () => F.value,
|
|
1278
|
+
getAsciiRenderer: () => I.value,
|
|
1247
1279
|
getNonPrintableChar: () => L.value,
|
|
1248
|
-
updateRenderedSlice:
|
|
1280
|
+
updateRenderedSlice: Ne,
|
|
1249
1281
|
emitByteClick: (e) => b("byte-click", e),
|
|
1250
1282
|
emitSelectionChange: (e) => b("selection-change", e)
|
|
1251
|
-
}),
|
|
1283
|
+
}), { containerClass: Re, rootClassExtra: ze, showStatusBar: Be, statusBarPlacement: Ve, viewerClassExtra: He } = useVueHexTheme({
|
|
1284
|
+
theme: toRef(y, "theme"),
|
|
1285
|
+
isExpandToContent: w,
|
|
1286
|
+
selectionEnabled: Fe,
|
|
1287
|
+
statusbar: toRef(y, "statusbar")
|
|
1288
|
+
}), Ue = computed(() => !!y.cursor);
|
|
1252
1289
|
useCursor({
|
|
1253
|
-
enabled:
|
|
1290
|
+
enabled: Ue,
|
|
1254
1291
|
isExpandToContent: w,
|
|
1255
|
-
containerEl:
|
|
1256
|
-
tbodyEl:
|
|
1257
|
-
markup:
|
|
1292
|
+
containerEl: H,
|
|
1293
|
+
tbodyEl: U,
|
|
1294
|
+
markup: Z,
|
|
1258
1295
|
totalBytes: M,
|
|
1259
|
-
bytesPerRow:
|
|
1260
|
-
rowHeightValue:
|
|
1261
|
-
viewportRows:
|
|
1296
|
+
bytesPerRow: K,
|
|
1297
|
+
rowHeightValue: q,
|
|
1298
|
+
viewportRows: J,
|
|
1262
1299
|
chunkStartRow: Y,
|
|
1263
|
-
ensureChunkForRow:
|
|
1264
|
-
scheduleWindowEvaluation:
|
|
1300
|
+
ensureChunkForRow: xe,
|
|
1301
|
+
scheduleWindowEvaluation: Q,
|
|
1265
1302
|
cursorLocation: _,
|
|
1266
|
-
scrollToByte:
|
|
1303
|
+
scrollToByte: Ae
|
|
1267
1304
|
});
|
|
1268
|
-
let
|
|
1269
|
-
function
|
|
1270
|
-
|
|
1271
|
-
let e = V.value;
|
|
1272
|
-
if (e) {
|
|
1273
|
-
let t = e.scrollTop, n = Math.floor(t / G.value), r = (Y.value + n) * W.value;
|
|
1274
|
-
r !== c.value && (c.value = r);
|
|
1275
|
-
}
|
|
1276
|
-
}
|
|
1305
|
+
let We = computed(() => Fe.value || Ue.value);
|
|
1306
|
+
function Ge() {
|
|
1307
|
+
w.value || ke();
|
|
1277
1308
|
}
|
|
1278
|
-
let
|
|
1309
|
+
let Ke = computed(() => w.value ? 0 : (Oe.value - Y.value) * q.value), qe = computed(() => ({
|
|
1279
1310
|
position: "relative",
|
|
1280
1311
|
width: "100%",
|
|
1281
|
-
...w.value ? {} : { height: `${Math.max(
|
|
1282
|
-
})),
|
|
1312
|
+
...w.value ? {} : { height: `${Math.max(ve.value, 0)}px` }
|
|
1313
|
+
})), Je = computed(() => {
|
|
1283
1314
|
if (w.value) return {
|
|
1284
1315
|
position: "static",
|
|
1285
1316
|
width: "100%",
|
|
1286
1317
|
transform: "none"
|
|
1287
1318
|
};
|
|
1288
|
-
let e =
|
|
1319
|
+
let e = Ke.value;
|
|
1289
1320
|
return {
|
|
1290
1321
|
position: "absolute",
|
|
1291
1322
|
top: "0px",
|
|
@@ -1295,74 +1326,74 @@ var _hoisted_1$1 = { class: "vuehex-statusbar__section vuehex-statusbar__section
|
|
|
1295
1326
|
transform: Number.isFinite(e) ? `translateY(${e}px)` : "translateY(0px)"
|
|
1296
1327
|
};
|
|
1297
1328
|
});
|
|
1298
|
-
function
|
|
1299
|
-
if (!
|
|
1300
|
-
let t =
|
|
1301
|
-
t && (t.scrollTop = 0), k.value && (c.value = Y.value *
|
|
1329
|
+
function Ye(e) {
|
|
1330
|
+
if (!Se(e)) return;
|
|
1331
|
+
let t = H.value;
|
|
1332
|
+
t && (t.scrollTop = 0), k.value && (c.value = Y.value * K.value), Q();
|
|
1302
1333
|
}
|
|
1303
1334
|
watch(() => ({
|
|
1304
1335
|
data: j.value.data,
|
|
1305
1336
|
offset: j.value.offset,
|
|
1306
|
-
bytesPerRow:
|
|
1337
|
+
bytesPerRow: K.value,
|
|
1307
1338
|
uppercase: y.uppercase,
|
|
1308
1339
|
nonPrintableChar: y.nonPrintableChar,
|
|
1309
1340
|
isPrintable: y.isPrintable,
|
|
1310
1341
|
renderAscii: y.renderAscii,
|
|
1311
|
-
cellClassForByte:
|
|
1342
|
+
cellClassForByte: De.value
|
|
1312
1343
|
}), () => {
|
|
1313
|
-
|
|
1344
|
+
Me();
|
|
1314
1345
|
}, { immediate: !0 }), watch(() => c.value, (e, t) => {
|
|
1315
|
-
e !== t && e != null && Number.isFinite(e) && e >= 0 &&
|
|
1346
|
+
e !== t && (k.value || X.value != null && e === X.value || e != null && Number.isFinite(e) && e >= 0 && je(e));
|
|
1316
1347
|
}), watch([
|
|
1317
1348
|
M,
|
|
1318
|
-
W,
|
|
1319
1349
|
K,
|
|
1320
|
-
|
|
1321
|
-
|
|
1350
|
+
J,
|
|
1351
|
+
me,
|
|
1352
|
+
z,
|
|
1322
1353
|
Y
|
|
1323
1354
|
], () => {
|
|
1324
|
-
|
|
1355
|
+
be(), Q();
|
|
1325
1356
|
});
|
|
1326
1357
|
let $ = null;
|
|
1327
1358
|
return onMounted(() => {
|
|
1328
|
-
let e =
|
|
1329
|
-
e && (
|
|
1359
|
+
let e = H.value;
|
|
1360
|
+
e && (G.value = e.clientHeight, $ = new ResizeObserver((e) => {
|
|
1330
1361
|
let t = e[0];
|
|
1331
|
-
t && (
|
|
1362
|
+
t && (G.value = t.contentRect.height, Q(), Pe());
|
|
1332
1363
|
}), $.observe(e));
|
|
1333
|
-
let t =
|
|
1334
|
-
t && (t.addEventListener("pointerover",
|
|
1364
|
+
let t = U.value;
|
|
1365
|
+
t && (t.addEventListener("pointerover", we), t.addEventListener("pointerout", Te)), je(j.value.offset);
|
|
1335
1366
|
}), onBeforeUnmount(() => {
|
|
1336
1367
|
$?.disconnect(), $ = null;
|
|
1337
|
-
let e =
|
|
1338
|
-
e && (e.removeEventListener("pointerover",
|
|
1368
|
+
let e = U.value;
|
|
1369
|
+
e && (e.removeEventListener("pointerover", we), e.removeEventListener("pointerout", Te)), Ee();
|
|
1339
1370
|
}), i({
|
|
1340
|
-
scrollToByte:
|
|
1341
|
-
selectChunk:
|
|
1371
|
+
scrollToByte: Ae,
|
|
1372
|
+
selectChunk: Se
|
|
1342
1373
|
}), (e, t) => (openBlock(), createBlock(VueHexChunkNavigator_default, {
|
|
1343
1374
|
show: y.showChunkNavigator,
|
|
1344
1375
|
placement: y.chunkNavigatorPlacement,
|
|
1345
|
-
chunks: unref(
|
|
1346
|
-
"active-index": unref(
|
|
1347
|
-
"root-class-extra":
|
|
1348
|
-
"viewer-class-extra":
|
|
1376
|
+
chunks: unref(ye),
|
|
1377
|
+
"active-index": unref(ge),
|
|
1378
|
+
"root-class-extra": unref(ze),
|
|
1379
|
+
"viewer-class-extra": unref(He),
|
|
1349
1380
|
"expand-to-content": w.value,
|
|
1350
|
-
onSelect:
|
|
1381
|
+
onSelect: Ye
|
|
1351
1382
|
}, {
|
|
1352
1383
|
"chunk-navigator-header": withCtx((t) => [renderSlot(e.$slots, "chunk-navigator-header", normalizeProps(guardReactiveProps(t)))]),
|
|
1353
1384
|
"chunk-navigator-item": withCtx((t) => [renderSlot(e.$slots, "chunk-navigator-item", normalizeProps(guardReactiveProps(t)))]),
|
|
1354
|
-
default: withCtx(() => [
|
|
1385
|
+
default: withCtx(() => [unref(Be) ? (openBlock(), createBlock(VueHexStatusBar_default, {
|
|
1355
1386
|
key: 0,
|
|
1356
1387
|
ref_key: "statusBarRef",
|
|
1357
|
-
ref:
|
|
1358
|
-
placement:
|
|
1388
|
+
ref: Ce,
|
|
1389
|
+
placement: unref(Ve) ?? "bottom",
|
|
1359
1390
|
layout: y.statusbarLayout,
|
|
1360
1391
|
uppercase: y.uppercase,
|
|
1361
1392
|
"is-printable": y.isPrintable,
|
|
1362
1393
|
"render-ascii": y.renderAscii,
|
|
1363
1394
|
"non-printable-char": y.nonPrintableChar,
|
|
1364
|
-
"selection-range": unref(
|
|
1365
|
-
"selection-count": unref(
|
|
1395
|
+
"selection-range": unref(Ie),
|
|
1396
|
+
"selection-count": unref(Le)
|
|
1366
1397
|
}, {
|
|
1367
1398
|
"statusbar-left": withCtx(() => [renderSlot(e.$slots, "statusbar-left")]),
|
|
1368
1399
|
"statusbar-middle": withCtx(() => [renderSlot(e.$slots, "statusbar-middle")]),
|
|
@@ -1379,25 +1410,25 @@ var _hoisted_1$1 = { class: "vuehex-statusbar__section vuehex-statusbar__section
|
|
|
1379
1410
|
"selection-count"
|
|
1380
1411
|
])) : createCommentVNode("", !0), createElementVNode("div", {
|
|
1381
1412
|
ref_key: "containerEl",
|
|
1382
|
-
ref:
|
|
1383
|
-
class: normalizeClass(
|
|
1413
|
+
ref: H,
|
|
1414
|
+
class: normalizeClass(unref(Re)),
|
|
1384
1415
|
role: "table",
|
|
1385
1416
|
"aria-label": "Hex viewer",
|
|
1386
|
-
"aria-disabled":
|
|
1387
|
-
tabindex:
|
|
1388
|
-
onScroll:
|
|
1417
|
+
"aria-disabled": We.value ? void 0 : "true",
|
|
1418
|
+
tabindex: We.value ? 0 : void 0,
|
|
1419
|
+
onScroll: Ge
|
|
1389
1420
|
}, [createElementVNode("div", {
|
|
1390
1421
|
class: "vuehex-inner",
|
|
1391
|
-
style: normalizeStyle(
|
|
1422
|
+
style: normalizeStyle(qe.value),
|
|
1392
1423
|
role: "presentation"
|
|
1393
1424
|
}, [createElementVNode("table", {
|
|
1394
|
-
class: normalizeClass(
|
|
1395
|
-
style: normalizeStyle(
|
|
1425
|
+
class: normalizeClass(he.value),
|
|
1426
|
+
style: normalizeStyle(Je.value),
|
|
1396
1427
|
role: "presentation"
|
|
1397
1428
|
}, [createElementVNode("tbody", {
|
|
1398
1429
|
ref_key: "tbodyEl",
|
|
1399
|
-
ref:
|
|
1400
|
-
innerHTML: unref(
|
|
1430
|
+
ref: U,
|
|
1431
|
+
innerHTML: unref(Z)
|
|
1401
1432
|
}, null, 8, _hoisted_2)], 6)], 4)], 42, _hoisted_1)]),
|
|
1402
1433
|
_: 3
|
|
1403
1434
|
}, 8, [
|
|
@@ -1416,4 +1447,4 @@ function install(e, t = {}) {
|
|
|
1416
1447
|
e.component(n, VueHex_default);
|
|
1417
1448
|
}
|
|
1418
1449
|
var src_default = { install };
|
|
1419
|
-
export { DEFAULT_ASCII_CATEGORY_CELL_CLASS_RESOLVER, DEFAULT_ASCII_RENDERER, DEFAULT_PRINTABLE_CHECK, VUE_HEX_ASCII_PRESETS, VueHex_default as VueHex, src_default as default, install };
|
|
1450
|
+
export { DEFAULT_ASCII_CATEGORY_CELL_CLASS_RESOLVER, DEFAULT_ASCII_RENDERER, DEFAULT_PRINTABLE_CHECK, VUE_HEX_ASCII_PRESETS, VUE_HEX_BUILTIN_THEME_KEYS, VueHex_default as VueHex, src_default as default, install };
|
package/package.json
CHANGED
package/dist/screenshot001.png
DELETED
|
Binary file
|
package/dist/screenshot002.png
DELETED
|
Binary file
|