Skip to content

Commit 9d6a42e

Browse files
authored
Merge pull request #93 from Exabyte-io/update/SOF-7161
SOF-7161: deps versions
2 parents 52f8dfd + 86ac6dc commit 9d6a42e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+6149
-147
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
dist/
21
build/
32
node_modules/
43
.eslintcache

.husky/pre-commit

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
npx lint-staged
4+
npm run lint:fix
5+
npm run transpile
6+
git add dist

dist/constants.d.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
export namespace coefficients {
2+
const EV_TO_RY: number;
3+
const BOHR_TO_ANGSTROM: number;
4+
const ANGSTROM_TO_BOHR: number;
5+
const EV_A_TO_RY_BOHR: number;
6+
}
7+
export namespace tolerance {
8+
const length: number;
9+
const lengthAngstrom: number;
10+
const pointsDistance: number;
11+
}
12+
export namespace units {
13+
const bohr: string;
14+
const angstrom: string;
15+
const degree: string;
16+
const radian: string;
17+
const alat: string;
18+
}
19+
export namespace ATOMIC_COORD_UNITS {
20+
const crystal: string;
21+
const cartesian: string;
22+
}
23+
export const HASH_TOLERANCE: 3;
24+
declare namespace _default {
25+
export { coefficients };
26+
export { tolerance };
27+
export { units };
28+
export { ATOMIC_COORD_UNITS };
29+
}
30+
export default _default;

dist/constants.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
"use strict";
2+
Object.defineProperty(exports, "__esModule", { value: true });
3+
exports.HASH_TOLERANCE = exports.ATOMIC_COORD_UNITS = exports.units = exports.tolerance = exports.coefficients = void 0;
4+
exports.coefficients = {
5+
EV_TO_RY: 0.0734986176,
6+
BOHR_TO_ANGSTROM: 0.52917721092,
7+
ANGSTROM_TO_BOHR: 1 / 0.52917721092,
8+
EV_A_TO_RY_BOHR: 1 / 25.71104309541616,
9+
};
10+
exports.tolerance = {
11+
// in crystal coordinates
12+
length: 0.01,
13+
lengthAngstrom: 0.001,
14+
pointsDistance: 0.001,
15+
};
16+
exports.units = {
17+
bohr: "bohr",
18+
angstrom: "angstrom",
19+
degree: "degree",
20+
radian: "radian",
21+
alat: "alat",
22+
};
23+
/**
24+
* @summary Coordinates units for a material's basis.
25+
*/
26+
exports.ATOMIC_COORD_UNITS = {
27+
crystal: "crystal",
28+
cartesian: "cartesian",
29+
};
30+
// Only 3 digits will be considered for lattice and basis params on hashing
31+
exports.HASH_TOLERANCE = 3;
32+
exports.default = {
33+
coefficients: exports.coefficients,
34+
tolerance: exports.tolerance,
35+
units: exports.units,
36+
ATOMIC_COORD_UNITS: exports.ATOMIC_COORD_UNITS,
37+
};

dist/context/index.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { JSONSchemaFormDataProvider } from "./json_schema_provider";
2+
import { ApplicationContextMixin, JobContextMixin, MaterialContextMixin, MaterialsContextMixin, MaterialsSetContextMixin, MethodDataContextMixin, WorkflowContextMixin } from "./mixins";
3+
import { JobContextPickKeysForMixin, WorkflowContextPickKeysForMixin } from "./pickers";
4+
import { ContextProvider } from "./provider";
5+
import { ContextProviderRegistryContainer, createAndPatchRegistry, extendAndPatchRegistry } from "./registry";
6+
export { ContextProvider, ContextProviderRegistryContainer, extendAndPatchRegistry, createAndPatchRegistry, JobContextPickKeysForMixin, JSONSchemaFormDataProvider, WorkflowContextPickKeysForMixin, ApplicationContextMixin, MaterialContextMixin, MaterialsContextMixin, MaterialsSetContextMixin, MethodDataContextMixin, JobContextMixin, WorkflowContextMixin, };

dist/context/index.js

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { UiSchema } from "react-jsonschema-form";
2+
import { ContextProvider, ContextProviderConfig } from "./provider";
3+
interface JSONSchemaFormDataProviderConfig extends ContextProviderConfig {
4+
isUsingJinjaVariables?: boolean;
5+
}
6+
/**
7+
* @summary Provides jsonSchema and uiSchema for generating react-jsonschema-form
8+
* See https://github.com/mozilla-services/react-jsonschema-form for Form UI.
9+
* Form generation example:
10+
* ```
11+
* <Form schema={provider.jsonSchema}
12+
* uiSchema={provider.uiSchema}
13+
* formData={provider.getData(unit.important)} />
14+
* ```
15+
*/
16+
declare class JSONSchemaFormDataProvider extends ContextProvider {
17+
defaultClassNames: string;
18+
isUsingJinjaVariables: boolean;
19+
constructor(config: JSONSchemaFormDataProviderConfig);
20+
get jsonSchema(): void;
21+
get uiSchema(): UiSchema;
22+
get fields(): {};
23+
get defaultFieldStyles(): {
24+
classNames: string;
25+
};
26+
fieldStyles(classNames: string, overrideDefault?: boolean): {
27+
classNames: string;
28+
};
29+
get uiSchemaStyled(): UiSchema;
30+
}
31+
export { JSONSchemaFormDataProvider };

dist/context/json_schema_provider.js

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
"use strict";
2+
var __importDefault = (this && this.__importDefault) || function (mod) {
3+
return (mod && mod.__esModule) ? mod : { "default": mod };
4+
};
5+
Object.defineProperty(exports, "__esModule", { value: true });
6+
exports.JSONSchemaFormDataProvider = void 0;
7+
const underscore_1 = __importDefault(require("underscore"));
8+
const provider_1 = require("./provider");
9+
/**
10+
* @summary Provides jsonSchema and uiSchema for generating react-jsonschema-form
11+
* See https://github.com/mozilla-services/react-jsonschema-form for Form UI.
12+
* Form generation example:
13+
* ```
14+
* <Form schema={provider.jsonSchema}
15+
* uiSchema={provider.uiSchema}
16+
* formData={provider.getData(unit.important)} />
17+
* ```
18+
*/
19+
class JSONSchemaFormDataProvider extends provider_1.ContextProvider {
20+
constructor(config) {
21+
super(config);
22+
this.defaultClassNames = "col-xs-12 col-sm-6 col-md-4 col-lg-3";
23+
this.isUsingJinjaVariables = Boolean(config === null || config === void 0 ? void 0 : config.isUsingJinjaVariables);
24+
}
25+
// eslint-disable-next-line class-methods-use-this
26+
get jsonSchema() {
27+
throw new Error("Not implemented.");
28+
}
29+
// eslint-disable-next-line class-methods-use-this
30+
get uiSchema() {
31+
throw new Error("Not implemented.");
32+
}
33+
// eslint-disable-next-line class-methods-use-this
34+
get fields() {
35+
return {};
36+
}
37+
get defaultFieldStyles() {
38+
return { classNames: this.defaultClassNames };
39+
}
40+
fieldStyles(classNames, overrideDefault = false) {
41+
let names = classNames;
42+
if (!overrideDefault)
43+
names += " " + this.defaultClassNames;
44+
return { classNames: names };
45+
}
46+
get uiSchemaStyled() {
47+
const schema = this.uiSchema;
48+
// @ts-ignore
49+
return underscore_1.default.each(schema, (v, k, l) => {
50+
l[k] = { ...v, ...this.defaultFieldStyles };
51+
// @ts-ignore
52+
l[k].classNames = `${v.classNames || ""} ${this.defaultClassNames || ""}`;
53+
return null;
54+
});
55+
}
56+
}
57+
exports.JSONSchemaFormDataProvider = JSONSchemaFormDataProvider;

dist/context/mixins.d.ts

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
import { ApplicationSchemaBase, JobSchema, MaterialSchema, WorkflowSchema } from "@mat3ra/esse/lib/js/types";
2+
import { InMemoryEntity } from "../entity";
3+
type Constructor<T = any> = new (...args: any[]) => T;
4+
export declare function ApplicationContextMixin<T extends Constructor>(superclass: T): {
5+
new (...args: any): {
6+
[x: string]: any;
7+
_application: ApplicationSchemaBase;
8+
readonly application: ApplicationSchemaBase;
9+
};
10+
} & T;
11+
type Material = InMemoryEntity & MaterialSchema & {
12+
hash: string;
13+
};
14+
export declare function MaterialContextMixin<T extends Constructor>(superclass: T): {
15+
new (...args: any): {
16+
[x: string]: any;
17+
_material: Material;
18+
extraData?: {
19+
materialHash: string;
20+
} | undefined;
21+
isEdited?: boolean | undefined;
22+
readonly isEditedIsSetToFalseOnMaterialUpdate: boolean;
23+
updateMaterialHash(): void;
24+
readonly isMaterialCreatedDefault: boolean;
25+
readonly isMaterialUpdated: boolean;
26+
readonly material: Material;
27+
};
28+
} & T;
29+
export declare function MaterialsSetContextMixin<T extends Constructor>(superclass: T): {
30+
new (...params: any): {
31+
[x: string]: any;
32+
_materialsSet: any;
33+
readonly materialsSet: any;
34+
sortMaterialsByIndexInSet(materials?: never[]): never[];
35+
};
36+
} & T;
37+
export declare function MaterialsContextMixin<T extends Constructor>(superclass: T): {
38+
new (...params: any): {
39+
[x: string]: any;
40+
_materials: any;
41+
readonly materials: any;
42+
};
43+
} & T;
44+
export declare function MethodDataContextMixin<T extends Constructor>(superclass: T): {
45+
new (...params: any): {
46+
[x: string]: any;
47+
_methodData: any;
48+
isEdited: boolean;
49+
methodDataHash?: string | undefined;
50+
extraData?: {
51+
methodDataHash?: string | undefined;
52+
} | undefined;
53+
_initMethodDataHash(): void;
54+
readonly methodData: any;
55+
readonly isMethodDataUpdated: boolean;
56+
};
57+
} & T;
58+
export declare function WorkflowContextMixin<T extends Constructor>(superclass: T): {
59+
new (...params: any): {
60+
[x: string]: any;
61+
_workflow: WorkflowSchema;
62+
isEdited: boolean;
63+
readonly workflow: WorkflowSchema;
64+
};
65+
} & T;
66+
export declare function JobContextMixin<T extends Constructor>(superclass: T): {
67+
new (...params: any): {
68+
[x: string]: any;
69+
_job: JobSchema;
70+
isEdited: boolean;
71+
readonly job: JobSchema;
72+
};
73+
} & T;
74+
export {};

0 commit comments

Comments
 (0)