Skip to content

Commit ffc7d9c

Browse files
authored
Merge pull request #182 from Exabyte-io/feature/SOF-7607
update: switch off alert provider when wave used in other apps
2 parents 4ec747d + 5a22bde commit ffc7d9c

File tree

8 files changed

+24
-10
lines changed

8 files changed

+24
-10
lines changed

dist/components/ThreeDEditor.d.ts

+4
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ export namespace ThreeDEditor {
274274
unsetFileProps(): void;
275275
setBasis(textOrObject: string | import("@mat3ra/made/dist/js/basis/basis").BasisConfig, format?: string | undefined, unitz?: string | undefined): void;
276276
setBasisConstraints(constraints: import("@mat3ra/made/dist/js/constraints/constraints").Constraint[]): void;
277+
setBasisConstraintsFromArrayOfObjects(constraints: import("@mat3ra/esse/dist/js/types").AtomicConstraintsSchema): void;
277278
readonly basis: import("@mat3ra/made/dist/js/material").OptionallyConstrainedBasisConfig;
278279
readonly Basis: import("@mat3ra/made/dist/js/basis/constrained_basis").ConstrainedBasis;
279280
readonly uniqueElements: string[];
@@ -478,6 +479,7 @@ export namespace ThreeDEditor {
478479
let isConventionalCellShown: PropTypes.Requireable<boolean>;
479480
let boundaryConditions: PropTypes.Requireable<object>;
480481
let onUpdate: PropTypes.Requireable<(...args: any[]) => any>;
482+
let isStandalone: PropTypes.Requireable<boolean>;
481483
}
482484
namespace defaultProps {
483485
let boundaryConditions_1: {};
@@ -488,6 +490,8 @@ export namespace ThreeDEditor {
488490
export { onUpdate_1 as onUpdate };
489491
let editable_1: boolean;
490492
export { editable_1 as editable };
493+
let isStandalone_1: boolean;
494+
export { isStandalone_1 as isStandalone };
491495
}
492496
}
493497
import React from "react";

dist/components/ThreeDEditor.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,8 @@ export class ThreeDEditor extends React.Component {
636636
return (_jsxs("div", { className: "wave-component-holder", style: { position: "relative", height: "100%" }, children: [this.renderCoverDiv(), _jsx(IconsToolbar, { toolbarConfig: this.getToolbarConfig(), isInteractive: isInteractive, handleToggleInteractive: this.handleToggleInteractive }), this.renderWaveComponent()] }));
637637
}
638638
render() {
639-
return (_jsx(ThemeProvider, { theme: DarkMaterialUITheme, children: _jsx(ScopedCssBaseline, { enableColorScheme: true, style: { height: "100%" }, children: _jsx(AlertProvider, { children: this.renderWaveOrThreejsEditorModal() }) }) }));
639+
const { isStandalone } = this.props;
640+
return (_jsx(ThemeProvider, { theme: DarkMaterialUITheme, children: _jsx(ScopedCssBaseline, { enableColorScheme: true, style: { height: "100%" }, children: isStandalone ? (_jsx(AlertProvider, { children: this.renderWaveOrThreejsEditorModal() })) : (this.renderWaveOrThreejsEditorModal()) }) }));
640641
}
641642
}
642643
ThreeDEditor.propTypes = {
@@ -645,10 +646,12 @@ ThreeDEditor.propTypes = {
645646
isConventionalCellShown: PropTypes.bool, // eslint-disable-next-line react/forbid-prop-types
646647
boundaryConditions: PropTypes.object,
647648
onUpdate: PropTypes.func,
649+
isStandalone: PropTypes.bool,
648650
};
649651
ThreeDEditor.defaultProps = {
650652
boundaryConditions: {},
651653
isConventionalCellShown: false,
652654
onUpdate: undefined,
653655
editable: false,
656+
isStandalone: false,
654657
};

dist/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const renderThreeDEditor = (materialConfig, newDomElement) => {
1414
return;
1515
}
1616
const currentMaterial = new Made.Material(config);
17-
ReactDOM.render(_jsx(ThreeDEditor, { editable: true, material: currentMaterial }), domElement);
17+
ReactDOM.render(_jsx(ThreeDEditor, { editable: true, isStandalone: true, material: currentMaterial }), domElement);
1818
};
1919
window.renderThreeDEditor = renderThreeDEditor;
2020
export { renderThreeDEditor };

dist/utils.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export function ThreeDSceneDataToMaterial(scene: any): {
4646
unsetFileProps(): void;
4747
setBasis(textOrObject: string | import("@mat3ra/made/dist/js/basis/basis").BasisConfig, format?: string | undefined, unitz?: string | undefined): void;
4848
setBasisConstraints(constraints: import("@mat3ra/made/dist/js/constraints/constraints").Constraint[]): void;
49+
setBasisConstraintsFromArrayOfObjects(constraints: import("@mat3ra/esse/dist/js/types").AtomicConstraintsSchema): void;
4950
readonly basis: import("@mat3ra/made/dist/js/material").OptionallyConstrainedBasisConfig;
5051
readonly Basis: import("@mat3ra/made/dist/js/basis/constrained_basis").ConstrainedBasis;
5152
readonly uniqueElements: string[];

package-lock.json

+4-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"@exabyte-io/eslint-config": "^2025.1.15-0",
6565
"@mat3ra/code": "2025.4.27-0",
6666
"@mat3ra/esse": "2025.4.22-0",
67-
"@mat3ra/made": "git+https://github.com/Exabyte-io/made.git#cf284620644e9c1840ee381ae73c4a19e5a3fc15",
67+
"@mat3ra/made": "2025.4.30-0",
6868
"@mat3ra/tsconfig": "^2024.6.3-0",
6969
"@types/react": "^18.2.8",
7070
"@types/react-dom": "^18.2.4",

src/components/ThreeDEditor.jsx

+8-1
Original file line numberDiff line numberDiff line change
@@ -777,10 +777,15 @@ export class ThreeDEditor extends React.Component {
777777
}
778778

779779
render() {
780+
const { isStandalone } = this.props;
780781
return (
781782
<ThemeProvider theme={DarkMaterialUITheme}>
782783
<ScopedCssBaseline enableColorScheme style={{ height: "100%" }}>
783-
<AlertProvider>{this.renderWaveOrThreejsEditorModal()}</AlertProvider>
784+
{isStandalone ? (
785+
<AlertProvider>{this.renderWaveOrThreejsEditorModal()}</AlertProvider>
786+
) : (
787+
this.renderWaveOrThreejsEditorModal()
788+
)}
784789
</ScopedCssBaseline>
785790
</ThemeProvider>
786791
);
@@ -793,11 +798,13 @@ ThreeDEditor.propTypes = {
793798
isConventionalCellShown: PropTypes.bool, // eslint-disable-next-line react/forbid-prop-types
794799
boundaryConditions: PropTypes.object,
795800
onUpdate: PropTypes.func,
801+
isStandalone: PropTypes.bool,
796802
};
797803

798804
ThreeDEditor.defaultProps = {
799805
boundaryConditions: {},
800806
isConventionalCellShown: false,
801807
onUpdate: undefined,
802808
editable: false,
809+
isStandalone: false,
803810
};

src/index.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const renderThreeDEditor = (materialConfig, newDomElement) => {
1616
}
1717

1818
const currentMaterial = new Made.Material(config);
19-
ReactDOM.render(<ThreeDEditor editable material={currentMaterial} />, domElement);
19+
ReactDOM.render(<ThreeDEditor editable isStandalone material={currentMaterial} />, domElement);
2020
};
2121

2222
window.renderThreeDEditor = renderThreeDEditor;

0 commit comments

Comments
 (0)