@i-vresse/haddock3-ui 0.2.2 → 0.3.0
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/README.md +21 -1
- package/dist/index.css +1 -1
- package/dist/report.bundle.js +5263 -0
- package/dist/report.d.ts +21 -0
- package/dist/report.d.ts.map +1 -0
- package/dist/report.js +27 -0
- package/dist/report.js.map +1 -0
- package/package.json +16 -2
- package/src/report.tsx +37 -0
package/dist/report.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type Container } from "react-dom/client";
|
|
2
|
+
import { type Cluster } from "./table/ClusterTable.js";
|
|
3
|
+
import type { Header } from "./table/SortableTable.js";
|
|
4
|
+
import { type Structure } from "./table/StructureTable.js";
|
|
5
|
+
/**
|
|
6
|
+
* Renders a `ClusterTable` component inside the specified container.
|
|
7
|
+
*
|
|
8
|
+
* @param container - The DOM container where the `ClusterTable` will be rendered.
|
|
9
|
+
* @param headers - An array of header objects to be used in the `ClusterTable`.
|
|
10
|
+
* @param clusters - An array of cluster objects to be displayed in the `ClusterTable`.
|
|
11
|
+
*/
|
|
12
|
+
export declare function renderClusterTable(container: Container, headers: Header[], clusters: Cluster[]): void;
|
|
13
|
+
/**
|
|
14
|
+
* Renders a `StructureTable` component inside the specified container.
|
|
15
|
+
*
|
|
16
|
+
* @param container - The DOM container where the `StructureTable` will be rendered.
|
|
17
|
+
* @param headers - An array of header objects to be used in the `StructureTable`.
|
|
18
|
+
* @param structures - An array of structure objects to be displayed in the `StructureTable`.
|
|
19
|
+
*/
|
|
20
|
+
export declare function renderStructureTable(container: Container, headers: Header[], structures: Structure[]): void;
|
|
21
|
+
//# sourceMappingURL=report.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../src/report.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAc,MAAM,kBAAkB,CAAC;AAE9D,OAAO,EAAE,KAAK,OAAO,EAAgB,MAAM,yBAAyB,CAAC;AACrE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,KAAK,SAAS,EAAkB,MAAM,2BAA2B,CAAC;AAE3E;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,MAAM,EAAE,EACjB,QAAQ,EAAE,OAAO,EAAE,QAIpB;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,MAAM,EAAE,EACjB,UAAU,EAAE,SAAS,EAAE,QAIxB"}
|
package/dist/report.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createRoot } from "react-dom/client";
|
|
3
|
+
import { ClusterTable } from "./table/ClusterTable.js";
|
|
4
|
+
import { StructureTable } from "./table/StructureTable.js";
|
|
5
|
+
/**
|
|
6
|
+
* Renders a `ClusterTable` component inside the specified container.
|
|
7
|
+
*
|
|
8
|
+
* @param container - The DOM container where the `ClusterTable` will be rendered.
|
|
9
|
+
* @param headers - An array of header objects to be used in the `ClusterTable`.
|
|
10
|
+
* @param clusters - An array of cluster objects to be displayed in the `ClusterTable`.
|
|
11
|
+
*/
|
|
12
|
+
export function renderClusterTable(container, headers, clusters) {
|
|
13
|
+
const root = createRoot(container);
|
|
14
|
+
root.render(_jsx(ClusterTable, { headers: headers, clusters: clusters }));
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Renders a `StructureTable` component inside the specified container.
|
|
18
|
+
*
|
|
19
|
+
* @param container - The DOM container where the `StructureTable` will be rendered.
|
|
20
|
+
* @param headers - An array of header objects to be used in the `StructureTable`.
|
|
21
|
+
* @param structures - An array of structure objects to be displayed in the `StructureTable`.
|
|
22
|
+
*/
|
|
23
|
+
export function renderStructureTable(container, headers, structures) {
|
|
24
|
+
const root = createRoot(container);
|
|
25
|
+
root.render(_jsx(StructureTable, { headers: headers, structures: structures }));
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=report.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report.js","sourceRoot":"","sources":["../src/report.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAkB,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9D,OAAO,EAAgB,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAErE,OAAO,EAAkB,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3E;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAChC,SAAoB,EACpB,OAAiB,EACjB,QAAmB;IAEnB,MAAM,IAAI,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC;IACnC,IAAI,CAAC,MAAM,CAAC,KAAC,YAAY,IAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,GAAI,CAAC,CAAC;AACtE,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAClC,SAAoB,EACpB,OAAiB,EACjB,UAAuB;IAEvB,MAAM,IAAI,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC;IACnC,IAAI,CAAC,MAAM,CAAC,KAAC,cAAc,IAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,GAAI,CAAC,CAAC;AAC5E,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@i-vresse/haddock3-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"@vitest/browser": "^2.0.5",
|
|
39
39
|
"@vitest/coverage-istanbul": "^2.0.5",
|
|
40
40
|
"autoprefixer": "^10.4.19",
|
|
41
|
+
"esbuild": "^0.23.1",
|
|
41
42
|
"playwright": "^1.46.0",
|
|
42
43
|
"postcss": "^8.4.40",
|
|
43
44
|
"sync-fetch": "^0.5.2",
|
|
@@ -115,6 +116,18 @@
|
|
|
115
116
|
"default": "./dist/molviewer.js"
|
|
116
117
|
}
|
|
117
118
|
},
|
|
119
|
+
"./report.bundle": {
|
|
120
|
+
"import": {
|
|
121
|
+
"types": "./dist/report.d.ts",
|
|
122
|
+
"default": "./dist/report.bundle.js"
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
"./report": {
|
|
126
|
+
"import": {
|
|
127
|
+
"types": "./dist/report.d.ts",
|
|
128
|
+
"default": "./dist/report.js"
|
|
129
|
+
}
|
|
130
|
+
},
|
|
118
131
|
"./toggles": {
|
|
119
132
|
"import": {
|
|
120
133
|
"types": "./dist/toggles.d.ts",
|
|
@@ -167,10 +180,11 @@
|
|
|
167
180
|
},
|
|
168
181
|
"scripts": {
|
|
169
182
|
"dev": "ladle serve",
|
|
170
|
-
"build": "pnpm run build:js && pnpm build:css && pnpm build:package",
|
|
183
|
+
"build": "pnpm run build:js && pnpm build:css && pnpm build:bundle && pnpm build:package",
|
|
171
184
|
"build:js": "tsc --project tsconfig.build.json",
|
|
172
185
|
"build:package": "node build.mjs && pnpm format package.json",
|
|
173
186
|
"build:css": "tailwindcss --content './src/**/*.{js,ts,jsx,tsx,mdx}' -i .ladle/index.css -o dist/index.css --minify",
|
|
187
|
+
"build:bundle": "esbuild --bundle --format=esm --minify src/report.tsx --outfile=dist/report.bundle.js",
|
|
174
188
|
"typecheck": "tsc --noEmit",
|
|
175
189
|
"docs:ladle": "ladle build",
|
|
176
190
|
"docs:api": "typedoc",
|
package/src/report.tsx
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type Container, createRoot } from "react-dom/client";
|
|
2
|
+
|
|
3
|
+
import { type Cluster, ClusterTable } from "./table/ClusterTable.js";
|
|
4
|
+
import type { Header } from "./table/SortableTable.js";
|
|
5
|
+
import { type Structure, StructureTable } from "./table/StructureTable.js";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Renders a `ClusterTable` component inside the specified container.
|
|
9
|
+
*
|
|
10
|
+
* @param container - The DOM container where the `ClusterTable` will be rendered.
|
|
11
|
+
* @param headers - An array of header objects to be used in the `ClusterTable`.
|
|
12
|
+
* @param clusters - An array of cluster objects to be displayed in the `ClusterTable`.
|
|
13
|
+
*/
|
|
14
|
+
export function renderClusterTable(
|
|
15
|
+
container: Container,
|
|
16
|
+
headers: Header[],
|
|
17
|
+
clusters: Cluster[],
|
|
18
|
+
) {
|
|
19
|
+
const root = createRoot(container);
|
|
20
|
+
root.render(<ClusterTable headers={headers} clusters={clusters} />);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Renders a `StructureTable` component inside the specified container.
|
|
25
|
+
*
|
|
26
|
+
* @param container - The DOM container where the `StructureTable` will be rendered.
|
|
27
|
+
* @param headers - An array of header objects to be used in the `StructureTable`.
|
|
28
|
+
* @param structures - An array of structure objects to be displayed in the `StructureTable`.
|
|
29
|
+
*/
|
|
30
|
+
export function renderStructureTable(
|
|
31
|
+
container: Container,
|
|
32
|
+
headers: Header[],
|
|
33
|
+
structures: Structure[],
|
|
34
|
+
) {
|
|
35
|
+
const root = createRoot(container);
|
|
36
|
+
root.render(<StructureTable headers={headers} structures={structures} />);
|
|
37
|
+
}
|