@lukekaalim/act-insight 2.0.3 → 2.0.5
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/AttributeTag.ts +5 -5
- package/CHANGELOG.md +14 -0
- package/TreeViewer.ts +4 -5
- package/Virtual.ts +6 -6
- package/components/CommitTree.ts +1 -1
- package/package.json +2 -2
package/AttributeTag.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Component } from "@lukekaalim/act";
|
|
1
|
+
import { Component, h } from "@lukekaalim/act";
|
|
2
2
|
import classes from './AttributeTag.module.css';
|
|
3
3
|
import stringHash from "@sindresorhus/string-hash";
|
|
4
|
-
import {
|
|
4
|
+
import { html } from "@lukekaalim/act-web";
|
|
5
5
|
|
|
6
6
|
export type CommitAttributeTagProps = {
|
|
7
7
|
name: string,
|
|
@@ -10,8 +10,8 @@ export type CommitAttributeTagProps = {
|
|
|
10
10
|
|
|
11
11
|
export const CommitAttributeTag: Component<CommitAttributeTagProps> = ({ name, value }) => {
|
|
12
12
|
const background = `hsl(${stringHash(name) % 360}deg, 50%, 50%)`;
|
|
13
|
-
return
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
return h(html.span, { className: classes.commitAttributeTag, style: { background } }, [
|
|
14
|
+
h('span', { className: classes.commitAttributeTagName }, name),
|
|
15
|
+
h('span', { className: classes.commitAttributeTagValue }, value),
|
|
16
16
|
])
|
|
17
17
|
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @lukekaalim/act-insight
|
|
2
2
|
|
|
3
|
+
## 2.0.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [1b7eec1]
|
|
8
|
+
- @lukekaalim/act-web@6.1.0
|
|
9
|
+
|
|
10
|
+
## 2.0.4
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies [0f734f5]
|
|
15
|
+
- @lukekaalim/act-web@6.0.1
|
|
16
|
+
|
|
3
17
|
## 2.0.3
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/TreeViewer.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Component, h, Node } from "@lukekaalim/act";
|
|
2
|
-
import { hs } from "@lukekaalim/act-web";
|
|
3
2
|
import stringHash from '@sindresorhus/string-hash';
|
|
4
3
|
|
|
5
4
|
import classes from './TreeViewer.module.css';
|
|
@@ -59,17 +58,17 @@ export const CommitPreview: Component<CommitPreviewProps> = ({
|
|
|
59
58
|
const lineColor = `hsl(${stringHash(commit.id.toString()) % 360}, 100%, 20%)`
|
|
60
59
|
|
|
61
60
|
|
|
62
|
-
return
|
|
61
|
+
return h('div', { classList: [classes.commit, className], style: { position: 'relative' }, id: `commit:${commit.id}` }, [
|
|
63
62
|
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
h('div', { className: [classes.elementBar].join(' '), style: { 'position': 'relative' } }, [
|
|
64
|
+
h('button', { onClick, className: classes.elementName, style: { background: elementBackground, border } },
|
|
66
65
|
text),
|
|
67
66
|
//h(CommitAttributeTag, { name: 'Id', value: commit.id.toString() }),
|
|
68
67
|
attributes.map(([name, value]) => h(CommitAttributeTag, { name, value }))
|
|
69
68
|
//h(CommitAttributeTag, { name: 'Version', value: commit.version.toString() }),
|
|
70
69
|
]),
|
|
71
70
|
|
|
72
|
-
!!renderCommit &&
|
|
71
|
+
!!renderCommit && h('ol', { className: classes.commitList }, commit.children.map(childId => h('li', { key: childId, style: { position: 'relative' } }, [
|
|
73
72
|
renderCommit(childId),
|
|
74
73
|
h('div', { style: {
|
|
75
74
|
top: 0,
|
package/Virtual.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, h, Node,
|
|
1
|
+
import { Component, h, Node, ReadOnlyRef, useEffect, useRef, useState } from "@lukekaalim/act";
|
|
2
2
|
import { debounce } from 'lodash-es';
|
|
3
3
|
|
|
4
4
|
export type VirtualTreeItem = {
|
|
@@ -12,7 +12,7 @@ export type VirtualTreeProps = {
|
|
|
12
12
|
|
|
13
13
|
renderChunk(index: number, width: number): Node,
|
|
14
14
|
|
|
15
|
-
viewportRef?:
|
|
15
|
+
viewportRef?: ReadOnlyRef<HTMLElement | null>,
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
export const Virtual1D: Component<VirtualTreeProps> = ({ chunkSize, chunkCount, renderChunk, viewportRef: propViewportRef }) => {
|
|
@@ -25,10 +25,10 @@ export const Virtual1D: Component<VirtualTreeProps> = ({ chunkSize, chunkCount,
|
|
|
25
25
|
const listRef = useRef<HTMLElement | null>(null);
|
|
26
26
|
|
|
27
27
|
useEffect(() => {
|
|
28
|
-
|
|
28
|
+
const viewport = viewportRef.get();
|
|
29
|
+
if (!viewport)
|
|
29
30
|
return;
|
|
30
31
|
|
|
31
|
-
const viewport = viewportRef.current;
|
|
32
32
|
|
|
33
33
|
const setViewport = () => {
|
|
34
34
|
const rect = viewport.getBoundingClientRect();
|
|
@@ -58,8 +58,8 @@ export const Virtual1D: Component<VirtualTreeProps> = ({ chunkSize, chunkCount,
|
|
|
58
58
|
const [width, setWidth] = useState(0);
|
|
59
59
|
|
|
60
60
|
useEffect(() => {
|
|
61
|
-
const list = listRef.
|
|
62
|
-
const viewport = viewportRef.
|
|
61
|
+
const list = listRef.get();
|
|
62
|
+
const viewport = viewportRef.get();
|
|
63
63
|
if (!list || !viewport)
|
|
64
64
|
return;
|
|
65
65
|
const rect = viewport.getBoundingClientRect();
|
package/components/CommitTree.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lukekaalim/act-insight",
|
|
3
3
|
"main": "index.ts",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.5",
|
|
5
5
|
"scripts": {},
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@lukekaalim/act": "*",
|
|
8
8
|
"@lukekaalim/act-recon": "4.0.1",
|
|
9
|
-
"@lukekaalim/act-web": "6.
|
|
9
|
+
"@lukekaalim/act-web": "6.1.0",
|
|
10
10
|
"@lukekaalim/act-debug": "2.0.0",
|
|
11
11
|
"@sindresorhus/string-hash": "^2.0.0",
|
|
12
12
|
"@types/firefox-webext-browser": "^120.0.4",
|