d2aura 23.0.15 → 23.0.16

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.
@@ -13,7 +13,6 @@ export default abstract class AbstractApp<P extends AbstractAppProps, S extends
13
13
  constructor(props: Readonly<P>);
14
14
  protected initialState: AbstractAppState;
15
15
  abstract getAppName(): string;
16
- abstract getDefaultPage(): string;
17
16
  abstract registerStateChangeHandler(d2Api: D2WebApiClient): void;
18
17
  componentDidMount(): void;
19
18
  protected renderChangePasswordModalDialog(): React.JSX.Element;
@@ -6,12 +6,11 @@ import AboutModalDialog from "./components/about/aboutModalDialog";
6
6
  import Spin from "antd/lib/spin";
7
7
  import { LoadingOutlined } from "@ant-design/icons";
8
8
  import ChangePasswordModalDialog from "./components/changePasswordModalDialog/changePasswordModalDialog";
9
- import { isStringEmpty } from "../core/util/isStringEmpty";
10
9
  export default class AbstractApp extends React.Component {
11
10
  constructor(props) {
12
11
  super(props);
13
12
  this.initialState = {
14
- location: isStringEmpty(window.location.hash) ? this.getDefaultPage() : window.location.hash.substring(1),
13
+ location: "",
15
14
  changePasswordModalDialogOpen: false,
16
15
  aboutModalDialogOpen: false,
17
16
  };
@@ -1 +1 @@
1
- {"version":3,"file":"abstractApp.js","sourceRoot":"","sources":["../../../coreui/abstractApp.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAW,cAAc,EAAqB,MAAM,SAAS,CAAC;AACrE,OAAO,WAAW,MAAM,+BAA+B,CAAC;AACxD,OAAO,oBAAoB,MAAM,wCAAwC,CAAC;AAC1E,OAAO,gBAAgB,MAAM,qCAAqC,CAAC;AACnE,OAAO,IAAI,MAAM,eAAe,CAAC;AACjC,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,yBAAyB,MAAM,kEAAkE,CAAC;AACzG,OAAO,EAAC,aAAa,EAAC,MAAM,4BAA4B,CAAC;AAczD,MAA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+B;QACrC,OAAO,CACH,oBAAC,yBAAyB,IACtB,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,6BAA6B,EAC9C,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,EAAG,EACrB,eAAe,QACf,QAAQ,EAAE,GAAG,EAAE;gBACX,IAAI,CAAC,QAAQ,CAAC,EAAC,6BAA6B,EAAE,KAAK,EAAC,CAAC,CAAA;YACzD,CAAC,GACH,CACL,CAAA;IACL,CAAC;IAES,sBAAsB;QAC5B,OAAO,CACH,oBAAC,gBAAgB,IACb,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,oBAAoB,EACxC,eAAe,EAAE,IAAI,CAAC,UAAU,EAAE,EAClC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,oBAAoB,EAAE,KAAK,EAAC,CAAC,GAC7D,CACL,CAAA;IACL,CAAC;IAES,aAAa;QACnB,OAAO,CACH,6BAAK,KAAK,EAAE,EAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAC;YACzF,oBAAC,IAAI,IAAC,SAAS,EAAE,oBAAC,eAAe,IAAC,IAAI,SAAE,EAAE,IAAI,EAAC,OAAO,EAAC,QAAQ,QAAC,OAAO,EAAC,MAAM,GAAE,CAC9E,CACT,CAAC;IACN,CAAC;CAEJ","sourcesContent":["import React from \"react\";\r\nimport {D2WebApi, D2WebApiClient, D2WebApiConnection} from \"d2jsapi\";\r\nimport reportError from \"../api/impl/utils/reportError\";\r\nimport reportServiceMessage from \"../api/impl/utils/reportServiceMessage\";\r\nimport AboutModalDialog from \"./components/about/aboutModalDialog\";\r\nimport Spin from \"antd/lib/spin\";\r\nimport {LoadingOutlined} from \"@ant-design/icons\";\r\nimport ChangePasswordModalDialog from \"./components/changePasswordModalDialog/changePasswordModalDialog\";\r\nimport {isStringEmpty} from \"../core/util/isStringEmpty\";\r\n\r\nexport interface AbstractAppProps {\r\n}\r\n\r\nexport interface AbstractAppState {\r\n d2?: D2WebApi\r\n connection?: D2WebApiConnection\r\n location: string\r\n\r\n changePasswordModalDialogOpen: boolean\r\n aboutModalDialogOpen: boolean\r\n}\r\n\r\nexport default abstract class AbstractApp<P extends AbstractAppProps, S extends AbstractAppState> extends React.Component<P, S> {\r\n constructor(props: Readonly<P>) {\r\n super(props);\r\n }\r\n\r\n protected initialState: AbstractAppState = {\r\n location: isStringEmpty(window.location.hash) ? this.getDefaultPage() : window.location.hash.substring(1),\r\n changePasswordModalDialogOpen: false,\r\n aboutModalDialogOpen: false,\r\n }\r\n\r\n abstract getAppName(): string;\r\n\r\n abstract getDefaultPage(): string;\r\n\r\n abstract registerStateChangeHandler(d2Api: D2WebApiClient): void;\r\n\r\n componentDidMount() {\r\n const d2Api = new D2WebApiClient({\r\n logLevel: window.location.href.indexOf(\"/dev/\") >= 0 ? \"debug\" : \"info\"\r\n });\r\n d2Api.registerErrorHandler((source, details) => {\r\n reportError(source, details)\r\n });\r\n d2Api.setServiceMessageHandler(serviceMessage => {\r\n reportServiceMessage(serviceMessage);\r\n });\r\n d2Api.setPasswordChangeHandler(() => {\r\n this.setState({changePasswordModalDialogOpen: true});\r\n })\r\n d2Api.connect();\r\n // @ts-ignore\r\n window.reportError = window.reportError.bind({d2: d2Api});\r\n\r\n this.registerStateChangeHandler(d2Api);\r\n }\r\n\r\n protected renderChangePasswordModalDialog() {\r\n return (\r\n <ChangePasswordModalDialog\r\n open={this.state.changePasswordModalDialogOpen}\r\n d2api={this.state.d2!}\r\n passwordExpired\r\n onCancel={() => {\r\n this.setState({changePasswordModalDialogOpen: false})\r\n }}\r\n />\r\n )\r\n }\r\n\r\n protected renderAboutModalDialog() {\r\n return (\r\n <AboutModalDialog\r\n visible={this.state.aboutModalDialogOpen}\r\n applicationName={this.getAppName()}\r\n onClose={() => this.setState({aboutModalDialogOpen: false})}\r\n />\r\n )\r\n }\r\n\r\n protected renderLoading() {\r\n return (\r\n <div style={{height: \"100%\", display: \"flex\", justifyContent: \"center\", alignItems: \"center\"}}>\r\n <Spin indicator={<LoadingOutlined spin/>} size=\"large\" spinning percent=\"auto\"/>\r\n </div>\r\n );\r\n }\r\n\r\n}"]}
1
+ {"version":3,"file":"abstractApp.js","sourceRoot":"","sources":["../../../coreui/abstractApp.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAW,cAAc,EAAqB,MAAM,SAAS,CAAC;AACrE,OAAO,WAAW,MAAM,+BAA+B,CAAC;AACxD,OAAO,oBAAoB,MAAM,wCAAwC,CAAC;AAC1E,OAAO,gBAAgB,MAAM,qCAAqC,CAAC;AACnE,OAAO,IAAI,MAAM,eAAe,CAAC;AACjC,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,yBAAyB,MAAM,kEAAkE,CAAC;AAczG,MAAM,CAAC,OAAO,OAAgB,WAAoE,SAAQ,KAAK,CAAC,SAAe;IAC3H,YAAY,KAAkB;QAC1B,KAAK,CAAC,KAAK,CAAC,CAAC;QAGP,iBAAY,GAAqB;YACvC,QAAQ,EAAE,EAAE;YACZ,6BAA6B,EAAE,KAAK;YACpC,oBAAoB,EAAE,KAAK;SAC9B,CAAA;IAND,CAAC;IAYD,iBAAiB;QACb,MAAM,KAAK,GAAG,IAAI,cAAc,CAAC;YAC7B,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM;SAC1E,CAAC,CAAC;QACH,KAAK,CAAC,oBAAoB,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE;YAC3C,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;QAChC,CAAC,CAAC,CAAC;QACH,KAAK,CAAC,wBAAwB,CAAC,cAAc,CAAC,EAAE;YAC5C,oB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,QAAC,OAAO,EAAC,MAAM,GAAE,CAC9E,CACT,CAAC;IACN,CAAC;CAEJ","sourcesContent":["import React from \"react\";\r\nimport {D2WebApi, D2WebApiClient, D2WebApiConnection} from \"d2jsapi\";\r\nimport reportError from \"../api/impl/utils/reportError\";\r\nimport reportServiceMessage from \"../api/impl/utils/reportServiceMessage\";\r\nimport AboutModalDialog from \"./components/about/aboutModalDialog\";\r\nimport Spin from \"antd/lib/spin\";\r\nimport {LoadingOutlined} from \"@ant-design/icons\";\r\nimport ChangePasswordModalDialog from \"./components/changePasswordModalDialog/changePasswordModalDialog\";\r\n\r\nexport interface AbstractAppProps {\r\n}\r\n\r\nexport interface AbstractAppState {\r\n d2?: D2WebApi\r\n connection?: D2WebApiConnection\r\n location: string\r\n\r\n changePasswordModalDialogOpen: boolean\r\n aboutModalDialogOpen: boolean\r\n}\r\n\r\nexport default abstract class AbstractApp<P extends AbstractAppProps, S extends AbstractAppState> extends React.Component<P, S> {\r\n constructor(props: Readonly<P>) {\r\n super(props);\r\n }\r\n\r\n protected initialState: AbstractAppState = {\r\n location: \"\",\r\n changePasswordModalDialogOpen: false,\r\n aboutModalDialogOpen: false,\r\n }\r\n\r\n abstract getAppName(): string;\r\n\r\n abstract registerStateChangeHandler(d2Api: D2WebApiClient): void;\r\n\r\n componentDidMount() {\r\n const d2Api = new D2WebApiClient({\r\n logLevel: window.location.href.indexOf(\"/dev/\") >= 0 ? \"debug\" : \"info\"\r\n });\r\n d2Api.registerErrorHandler((source, details) => {\r\n reportError(source, details)\r\n });\r\n d2Api.setServiceMessageHandler(serviceMessage => {\r\n reportServiceMessage(serviceMessage);\r\n });\r\n d2Api.setPasswordChangeHandler(() => {\r\n this.setState({changePasswordModalDialogOpen: true});\r\n })\r\n d2Api.connect();\r\n // @ts-ignore\r\n window.reportError = window.reportError.bind({d2: d2Api});\r\n\r\n this.registerStateChangeHandler(d2Api);\r\n }\r\n\r\n protected renderChangePasswordModalDialog() {\r\n return (\r\n <ChangePasswordModalDialog\r\n open={this.state.changePasswordModalDialogOpen}\r\n d2api={this.state.d2!}\r\n passwordExpired\r\n onCancel={() => {\r\n this.setState({changePasswordModalDialogOpen: false})\r\n }}\r\n />\r\n )\r\n }\r\n\r\n protected renderAboutModalDialog() {\r\n return (\r\n <AboutModalDialog\r\n visible={this.state.aboutModalDialogOpen}\r\n applicationName={this.getAppName()}\r\n onClose={() => this.setState({aboutModalDialogOpen: false})}\r\n />\r\n )\r\n }\r\n\r\n protected renderLoading() {\r\n return (\r\n <div style={{height: \"100%\", display: \"flex\", justifyContent: \"center\", alignItems: \"center\"}}>\r\n <Spin indicator={<LoadingOutlined spin/>} size=\"large\" spinning percent=\"auto\"/>\r\n </div>\r\n );\r\n }\r\n\r\n}"]}
@@ -0,0 +1,5 @@
1
+ interface Props {
2
+ onLocationChanged(location: string): void;
3
+ }
4
+ declare const RouteChangeListener: (props: Props) => null;
5
+ export default RouteChangeListener;
@@ -0,0 +1,11 @@
1
+ import { useEffect } from 'react';
2
+ import { useLocation } from 'react-router-dom';
3
+ const RouteChangeListener = (props) => {
4
+ const location = useLocation();
5
+ useEffect(() => {
6
+ props.onLocationChanged(location.pathname);
7
+ }, [location]);
8
+ return null;
9
+ };
10
+ export default RouteChangeListener;
11
+ //# sourceMappingURL=routeChangeListener.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routeChangeListener.js","sourceRoot":"","sources":["../../../coreui/routeChangeListener.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAM/C,MAAM,mBAAmB,GAAG,CAAC,KAAY,EAAE,EAAE;IACzC,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAE/B,SAAS,CAAC,GAAG,EAAE;QACX,KAAK,CAAC,iBAAiB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAC/C,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,OAAO,IAAI,CAAC;AAChB,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["import { useEffect } from 'react';\r\nimport { useLocation } from 'react-router-dom';\r\n\r\ninterface Props {\r\n onLocationChanged(location: string): void\r\n}\r\n\r\nconst RouteChangeListener = (props: Props) => {\r\n const location = useLocation();\r\n\r\n useEffect(() => {\r\n props.onLocationChanged(location.pathname);\r\n }, [location]);\r\n\r\n return null; // This component doesn't render anything\r\n};\r\n\r\nexport default RouteChangeListener;\r\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "d2aura",
3
- "version": "23.0.15",
3
+ "version": "23.0.16",
4
4
  "description": "D2 AURA - Advanced User Interface Resource Architecture",
5
5
  "author": "Ipesoft s.r.o.",
6
6
  "license": "MIT",