@vitessce/plugins 3.0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2018
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/index.js ADDED
@@ -0,0 +1,59 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => {
4
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
+ return value;
6
+ };
7
+ class PluginViewType {
8
+ constructor(name, component, coordinationTypes) {
9
+ __publicField(this, "name");
10
+ __publicField(this, "component");
11
+ __publicField(this, "coordinationTypes");
12
+ this.name = name;
13
+ this.component = component;
14
+ this.coordinationTypes = coordinationTypes;
15
+ }
16
+ }
17
+ class PluginFileType {
18
+ constructor(name, dataType, dataLoaderClass, dataSourceClass, optionsSchema) {
19
+ __publicField(this, "name");
20
+ __publicField(this, "dataType");
21
+ __publicField(this, "dataLoaderClass");
22
+ __publicField(this, "dataSourceClass");
23
+ __publicField(this, "optionsSchema");
24
+ this.name = name;
25
+ this.dataType = dataType;
26
+ this.dataLoaderClass = dataLoaderClass;
27
+ this.dataSourceClass = dataSourceClass;
28
+ this.optionsSchema = optionsSchema;
29
+ }
30
+ getSourceAndLoader() {
31
+ return [this.dataSourceClass, this.dataLoaderClass];
32
+ }
33
+ }
34
+ class PluginJointFileType {
35
+ constructor(name, expandFunction, optionsSchema) {
36
+ __publicField(this, "name");
37
+ __publicField(this, "expandFunction");
38
+ __publicField(this, "optionsSchema");
39
+ this.name = name;
40
+ this.expandFunction = expandFunction;
41
+ this.optionsSchema = optionsSchema;
42
+ }
43
+ }
44
+ class PluginCoordinationType {
45
+ constructor(name, defaultValue, valueSchema) {
46
+ __publicField(this, "name");
47
+ __publicField(this, "defaultValue");
48
+ __publicField(this, "valueSchema");
49
+ this.name = name;
50
+ this.defaultValue = defaultValue;
51
+ this.valueSchema = valueSchema;
52
+ }
53
+ }
54
+ export {
55
+ PluginCoordinationType,
56
+ PluginFileType,
57
+ PluginJointFileType,
58
+ PluginViewType
59
+ };
@@ -0,0 +1,37 @@
1
+ import type { ComponentType } from 'react';
2
+ import { z } from 'zod';
3
+ export declare class PluginViewType {
4
+ name: string;
5
+ component: ComponentType;
6
+ coordinationTypes: string[];
7
+ constructor(name: string, component: ComponentType, coordinationTypes: string[]);
8
+ }
9
+ export interface DataLoader {
10
+ load: () => Promise<any>;
11
+ }
12
+ export interface DataSource {
13
+ }
14
+ export declare class PluginFileType<T1 extends DataLoader, T2 extends DataSource, T3 extends z.ZodTypeAny> {
15
+ name: string;
16
+ dataType: string;
17
+ dataLoaderClass: DataLoader;
18
+ dataSourceClass: DataSource;
19
+ optionsSchema: T3;
20
+ constructor(name: string, dataType: string, dataLoaderClass: T1, dataSourceClass: T2, optionsSchema: T3);
21
+ getSourceAndLoader(): [DataSource, DataLoader];
22
+ }
23
+ declare type ExpandFunction = (a: any) => Array<any>;
24
+ export declare class PluginJointFileType<T1 extends z.ZodTypeAny> {
25
+ name: string;
26
+ expandFunction: ExpandFunction;
27
+ optionsSchema: T1;
28
+ constructor(name: string, expandFunction: ExpandFunction, optionsSchema: T1);
29
+ }
30
+ export declare class PluginCoordinationType<T1 extends z.ZodTypeAny> {
31
+ name: string;
32
+ defaultValue: z.infer<T1>;
33
+ valueSchema: T1;
34
+ constructor(name: string, defaultValue: z.infer<T1>, valueSchema: T1);
35
+ }
36
+ export {};
37
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,qBAAa,cAAc;IACzB,IAAI,EAAE,MAAM,CAAC;IAEb,SAAS,EAAE,aAAa,CAAC;IAEzB,iBAAiB,EAAE,MAAM,EAAE,CAAC;gBAEhB,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,EAAE;CAKhF;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC;CAC1B;AAGD,MAAM,WAAW,UAAU;CAE1B;AAED,qBAAa,cAAc,CACzB,EAAE,SAAS,UAAU,EAAE,EAAE,SAAS,UAAU,EAAE,EAAE,SAAS,CAAC,CAAC,UAAU;IAErE,IAAI,EAAE,MAAM,CAAC;IAEb,QAAQ,EAAE,MAAM,CAAC;IAEjB,eAAe,EAAE,UAAU,CAAC;IAE5B,eAAe,EAAE,UAAU,CAAC;IAE5B,aAAa,EAAE,EAAE,CAAC;gBAGhB,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,eAAe,EAAE,EAAE,EAAE,eAAe,EAAE,EAAE,EAAE,aAAa,EAAE,EAAE;IAS7F,kBAAkB,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC;CAG/C;AAKD,aAAK,cAAc,GAAG,CAAC,CAAC,EAAE,GAAG,KAAK,KAAK,CAAC,GAAG,CAAC,CAAC;AAE7C,qBAAa,mBAAmB,CAAC,EAAE,SAAS,CAAC,CAAC,UAAU;IACtD,IAAI,EAAE,MAAM,CAAC;IAEb,cAAc,EAAE,cAAc,CAAC;IAE/B,aAAa,EAAE,EAAE,CAAC;gBAEN,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,EAAE;CAK5E;AAED,qBAAa,sBAAsB,CAAC,EAAE,SAAS,CAAC,CAAC,UAAU;IACzD,IAAI,EAAE,MAAM,CAAC;IAEb,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAE1B,WAAW,EAAE,EAAE,CAAC;gBAEJ,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,WAAW,EAAE,EAAE;CAKrE"}
@@ -0,0 +1,47 @@
1
+ export class PluginViewType {
2
+ name;
3
+ component;
4
+ coordinationTypes;
5
+ constructor(name, component, coordinationTypes) {
6
+ this.name = name;
7
+ this.component = component;
8
+ this.coordinationTypes = coordinationTypes;
9
+ }
10
+ }
11
+ export class PluginFileType {
12
+ name;
13
+ dataType;
14
+ dataLoaderClass;
15
+ dataSourceClass;
16
+ optionsSchema;
17
+ constructor(name, dataType, dataLoaderClass, dataSourceClass, optionsSchema) {
18
+ this.name = name;
19
+ this.dataType = dataType;
20
+ this.dataLoaderClass = dataLoaderClass;
21
+ this.dataSourceClass = dataSourceClass;
22
+ this.optionsSchema = optionsSchema;
23
+ }
24
+ getSourceAndLoader() {
25
+ return [this.dataSourceClass, this.dataLoaderClass];
26
+ }
27
+ }
28
+ export class PluginJointFileType {
29
+ name;
30
+ expandFunction;
31
+ optionsSchema;
32
+ constructor(name, expandFunction, optionsSchema) {
33
+ this.name = name;
34
+ this.expandFunction = expandFunction;
35
+ this.optionsSchema = optionsSchema;
36
+ }
37
+ }
38
+ export class PluginCoordinationType {
39
+ name;
40
+ defaultValue;
41
+ valueSchema;
42
+ constructor(name, defaultValue, valueSchema) {
43
+ this.name = name;
44
+ this.defaultValue = defaultValue;
45
+ this.valueSchema = valueSchema;
46
+ }
47
+ }
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "@vitessce/plugins",
3
+ "version": "3.0.0",
4
+ "author": "Gehlenborg Lab",
5
+ "homepage": "http://vitessce.io",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/vitessce/vitessce.git"
9
+ },
10
+ "license": "MIT",
11
+ "type": "module",
12
+ "main": "dist/index.js",
13
+ "files": [
14
+ "src",
15
+ "dist",
16
+ "dist-tsc"
17
+ ],
18
+ "dependencies": {
19
+ "zod": "^3.21.4"
20
+ },
21
+ "devDependencies": {
22
+ "@types/react": "^18.0.28",
23
+ "vite": "^4.3.0",
24
+ "vitest": "^0.23.4"
25
+ },
26
+ "scripts": {
27
+ "bundle": "pnpm exec vite build -c ../../scripts/vite.config.js",
28
+ "test": "pnpm exec vitest --run -r ../../ --dir ."
29
+ },
30
+ "module": "dist/index.js",
31
+ "exports": {
32
+ ".": {
33
+ "types": "./dist-tsc/index.d.ts",
34
+ "import": "./dist/index.js"
35
+ }
36
+ }
37
+ }
package/src/index.ts ADDED
@@ -0,0 +1,87 @@
1
+ import type { ComponentType } from 'react';
2
+ import { z } from 'zod';
3
+
4
+
5
+ export class PluginViewType {
6
+ name: string;
7
+
8
+ component: ComponentType;
9
+
10
+ coordinationTypes: string[];
11
+
12
+ constructor(name: string, component: ComponentType, coordinationTypes: string[]) {
13
+ this.name = name;
14
+ this.component = component;
15
+ this.coordinationTypes = coordinationTypes;
16
+ }
17
+ }
18
+
19
+ export interface DataLoader {
20
+ load: () => Promise<any>;
21
+ }
22
+
23
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
24
+ export interface DataSource {
25
+
26
+ }
27
+
28
+ export class PluginFileType<
29
+ T1 extends DataLoader, T2 extends DataSource, T3 extends z.ZodTypeAny,
30
+ > {
31
+ name: string;
32
+
33
+ dataType: string;
34
+
35
+ dataLoaderClass: DataLoader;
36
+
37
+ dataSourceClass: DataSource;
38
+
39
+ optionsSchema: T3;
40
+
41
+ constructor(
42
+ name: string, dataType: string, dataLoaderClass: T1, dataSourceClass: T2, optionsSchema: T3,
43
+ ) {
44
+ this.name = name;
45
+ this.dataType = dataType;
46
+ this.dataLoaderClass = dataLoaderClass;
47
+ this.dataSourceClass = dataSourceClass;
48
+ this.optionsSchema = optionsSchema;
49
+ }
50
+
51
+ getSourceAndLoader(): [DataSource, DataLoader] {
52
+ return [this.dataSourceClass, this.dataLoaderClass];
53
+ }
54
+ }
55
+
56
+ // TODO: cleaning up any type requires refactoring
57
+ // latestFileDefSchema out of @vitessce/schemas to avoid circular dependency
58
+ // eslint-disable-next-line no-unused-vars
59
+ type ExpandFunction = (a: any) => Array<any>;
60
+
61
+ export class PluginJointFileType<T1 extends z.ZodTypeAny> {
62
+ name: string;
63
+
64
+ expandFunction: ExpandFunction;
65
+
66
+ optionsSchema: T1;
67
+
68
+ constructor(name: string, expandFunction: ExpandFunction, optionsSchema: T1) {
69
+ this.name = name;
70
+ this.expandFunction = expandFunction;
71
+ this.optionsSchema = optionsSchema;
72
+ }
73
+ }
74
+
75
+ export class PluginCoordinationType<T1 extends z.ZodTypeAny> {
76
+ name: string;
77
+
78
+ defaultValue: z.infer<T1>;
79
+
80
+ valueSchema: T1;
81
+
82
+ constructor(name: string, defaultValue: z.infer<T1>, valueSchema: T1) {
83
+ this.name = name;
84
+ this.defaultValue = defaultValue;
85
+ this.valueSchema = valueSchema;
86
+ }
87
+ }