Skip to content

Commit

Permalink
Merge pull request #93 from Exabyte-io/update/SOF-7161
Browse files Browse the repository at this point in the history
SOF-7161: deps versions
  • Loading branch information
k0stik authored Feb 20, 2024
2 parents 52f8dfd + 86ac6dc commit 9d6a42e
Show file tree
Hide file tree
Showing 100 changed files with 6,149 additions and 147 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
dist/
build/
node_modules/
.eslintcache
Expand Down
4 changes: 3 additions & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
npm run lint:fix
npm run transpile
git add dist
30 changes: 30 additions & 0 deletions dist/constants.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
export namespace coefficients {
const EV_TO_RY: number;
const BOHR_TO_ANGSTROM: number;
const ANGSTROM_TO_BOHR: number;
const EV_A_TO_RY_BOHR: number;
}
export namespace tolerance {
const length: number;
const lengthAngstrom: number;
const pointsDistance: number;
}
export namespace units {
const bohr: string;
const angstrom: string;
const degree: string;
const radian: string;
const alat: string;
}
export namespace ATOMIC_COORD_UNITS {
const crystal: string;
const cartesian: string;
}
export const HASH_TOLERANCE: 3;
declare namespace _default {
export { coefficients };
export { tolerance };
export { units };
export { ATOMIC_COORD_UNITS };
}
export default _default;
37 changes: 37 additions & 0 deletions dist/constants.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.HASH_TOLERANCE = exports.ATOMIC_COORD_UNITS = exports.units = exports.tolerance = exports.coefficients = void 0;
exports.coefficients = {
EV_TO_RY: 0.0734986176,
BOHR_TO_ANGSTROM: 0.52917721092,
ANGSTROM_TO_BOHR: 1 / 0.52917721092,
EV_A_TO_RY_BOHR: 1 / 25.71104309541616,
};
exports.tolerance = {
// in crystal coordinates
length: 0.01,
lengthAngstrom: 0.001,
pointsDistance: 0.001,
};
exports.units = {
bohr: "bohr",
angstrom: "angstrom",
degree: "degree",
radian: "radian",
alat: "alat",
};
/**
* @summary Coordinates units for a material's basis.
*/
exports.ATOMIC_COORD_UNITS = {
crystal: "crystal",
cartesian: "cartesian",
};
// Only 3 digits will be considered for lattice and basis params on hashing
exports.HASH_TOLERANCE = 3;
exports.default = {
coefficients: exports.coefficients,
tolerance: exports.tolerance,
units: exports.units,
ATOMIC_COORD_UNITS: exports.ATOMIC_COORD_UNITS,
};
6 changes: 6 additions & 0 deletions dist/context/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { JSONSchemaFormDataProvider } from "./json_schema_provider";
import { ApplicationContextMixin, JobContextMixin, MaterialContextMixin, MaterialsContextMixin, MaterialsSetContextMixin, MethodDataContextMixin, WorkflowContextMixin } from "./mixins";
import { JobContextPickKeysForMixin, WorkflowContextPickKeysForMixin } from "./pickers";
import { ContextProvider } from "./provider";
import { ContextProviderRegistryContainer, createAndPatchRegistry, extendAndPatchRegistry } from "./registry";
export { ContextProvider, ContextProviderRegistryContainer, extendAndPatchRegistry, createAndPatchRegistry, JobContextPickKeysForMixin, JSONSchemaFormDataProvider, WorkflowContextPickKeysForMixin, ApplicationContextMixin, MaterialContextMixin, MaterialsContextMixin, MaterialsSetContextMixin, MethodDataContextMixin, JobContextMixin, WorkflowContextMixin, };
22 changes: 22 additions & 0 deletions dist/context/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions dist/context/json_schema_provider.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { UiSchema } from "react-jsonschema-form";
import { ContextProvider, ContextProviderConfig } from "./provider";
interface JSONSchemaFormDataProviderConfig extends ContextProviderConfig {
isUsingJinjaVariables?: boolean;
}
/**
* @summary Provides jsonSchema and uiSchema for generating react-jsonschema-form
* See https://github.com/mozilla-services/react-jsonschema-form for Form UI.
* Form generation example:
* ```
* <Form schema={provider.jsonSchema}
* uiSchema={provider.uiSchema}
* formData={provider.getData(unit.important)} />
* ```
*/
declare class JSONSchemaFormDataProvider extends ContextProvider {
defaultClassNames: string;
isUsingJinjaVariables: boolean;
constructor(config: JSONSchemaFormDataProviderConfig);
get jsonSchema(): void;
get uiSchema(): UiSchema;
get fields(): {};
get defaultFieldStyles(): {
classNames: string;
};
fieldStyles(classNames: string, overrideDefault?: boolean): {
classNames: string;
};
get uiSchemaStyled(): UiSchema;
}
export { JSONSchemaFormDataProvider };
57 changes: 57 additions & 0 deletions dist/context/json_schema_provider.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.JSONSchemaFormDataProvider = void 0;
const underscore_1 = __importDefault(require("underscore"));
const provider_1 = require("./provider");
/**
* @summary Provides jsonSchema and uiSchema for generating react-jsonschema-form
* See https://github.com/mozilla-services/react-jsonschema-form for Form UI.
* Form generation example:
* ```
* <Form schema={provider.jsonSchema}
* uiSchema={provider.uiSchema}
* formData={provider.getData(unit.important)} />
* ```
*/
class JSONSchemaFormDataProvider extends provider_1.ContextProvider {
constructor(config) {
super(config);
this.defaultClassNames = "col-xs-12 col-sm-6 col-md-4 col-lg-3";
this.isUsingJinjaVariables = Boolean(config === null || config === void 0 ? void 0 : config.isUsingJinjaVariables);
}
// eslint-disable-next-line class-methods-use-this
get jsonSchema() {
throw new Error("Not implemented.");
}
// eslint-disable-next-line class-methods-use-this
get uiSchema() {
throw new Error("Not implemented.");
}
// eslint-disable-next-line class-methods-use-this
get fields() {
return {};
}
get defaultFieldStyles() {
return { classNames: this.defaultClassNames };
}
fieldStyles(classNames, overrideDefault = false) {
let names = classNames;
if (!overrideDefault)
names += " " + this.defaultClassNames;
return { classNames: names };
}
get uiSchemaStyled() {
const schema = this.uiSchema;
// @ts-ignore
return underscore_1.default.each(schema, (v, k, l) => {
l[k] = { ...v, ...this.defaultFieldStyles };
// @ts-ignore
l[k].classNames = `${v.classNames || ""} ${this.defaultClassNames || ""}`;
return null;
});
}
}
exports.JSONSchemaFormDataProvider = JSONSchemaFormDataProvider;
74 changes: 74 additions & 0 deletions dist/context/mixins.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import { ApplicationSchemaBase, JobSchema, MaterialSchema, WorkflowSchema } from "@mat3ra/esse/lib/js/types";
import { InMemoryEntity } from "../entity";
type Constructor<T = any> = new (...args: any[]) => T;
export declare function ApplicationContextMixin<T extends Constructor>(superclass: T): {
new (...args: any): {
[x: string]: any;
_application: ApplicationSchemaBase;
readonly application: ApplicationSchemaBase;
};
} & T;
type Material = InMemoryEntity & MaterialSchema & {
hash: string;
};
export declare function MaterialContextMixin<T extends Constructor>(superclass: T): {
new (...args: any): {
[x: string]: any;
_material: Material;
extraData?: {
materialHash: string;
} | undefined;
isEdited?: boolean | undefined;
readonly isEditedIsSetToFalseOnMaterialUpdate: boolean;
updateMaterialHash(): void;
readonly isMaterialCreatedDefault: boolean;
readonly isMaterialUpdated: boolean;
readonly material: Material;
};
} & T;
export declare function MaterialsSetContextMixin<T extends Constructor>(superclass: T): {
new (...params: any): {
[x: string]: any;
_materialsSet: any;
readonly materialsSet: any;
sortMaterialsByIndexInSet(materials?: never[]): never[];
};
} & T;
export declare function MaterialsContextMixin<T extends Constructor>(superclass: T): {
new (...params: any): {
[x: string]: any;
_materials: any;
readonly materials: any;
};
} & T;
export declare function MethodDataContextMixin<T extends Constructor>(superclass: T): {
new (...params: any): {
[x: string]: any;
_methodData: any;
isEdited: boolean;
methodDataHash?: string | undefined;
extraData?: {
methodDataHash?: string | undefined;
} | undefined;
_initMethodDataHash(): void;
readonly methodData: any;
readonly isMethodDataUpdated: boolean;
};
} & T;
export declare function WorkflowContextMixin<T extends Constructor>(superclass: T): {
new (...params: any): {
[x: string]: any;
_workflow: WorkflowSchema;
isEdited: boolean;
readonly workflow: WorkflowSchema;
};
} & T;
export declare function JobContextMixin<T extends Constructor>(superclass: T): {
new (...params: any): {
[x: string]: any;
_job: JobSchema;
isEdited: boolean;
readonly job: JobSchema;
};
} & T;
export {};
Loading

0 comments on commit 9d6a42e

Please sign in to comment.