@servicetitan/confirm-navigation 41.2.0 → 42.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.
@@ -6,19 +6,26 @@ function _define_property(obj, key, value) {
6
6
  configurable: true,
7
7
  writable: true
8
8
  });
9
- } else {
10
- obj[key] = value;
11
- }
9
+ } else obj[key] = value;
12
10
  return obj;
13
11
  }
14
12
  function _ts_decorate(decorators, target, key, desc) {
15
13
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
16
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
17
- else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
14
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
15
+ r = Reflect.decorate(decorators, target, key, desc);
16
+ } else {
17
+ for(var i = decorators.length - 1; i >= 0; i--){
18
+ if (d = decorators[i]) {
19
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
20
+ }
21
+ }
22
+ }
18
23
  return c > 3 && r && Object.defineProperty(target, key, r), r;
19
24
  }
20
- function _ts_metadata(k, v) {
21
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
+ function _ts_metadata(metadataKey, metadataValue) {
26
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
27
+ return Reflect.metadata(metadataKey, metadataValue);
28
+ }
22
29
  }
23
30
  import { jsx as _jsx } from "react/jsx-runtime";
24
31
  import { Component } from 'react';
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/confirm-navigation.tsx"],"sourcesContent":["import type { ComponentType, FC } from 'react';\nimport { Component } from 'react';\nimport type { RouteComponentProps } from 'react-router-dom';\nimport { withRouter } from 'react-router-dom';\n\nimport { observable, action, runInAction, comparer, makeObservable } from 'mobx';\nimport { observer } from 'mobx-react';\n\nimport type { History, Location, UnregisterCallback } from 'history';\n\nimport { Dialog } from '@servicetitan/design-system';\n\nimport { injectDependency, optional } from '@servicetitan/react-ioc';\nimport { HistoryManager } from '@servicetitan/web-components';\n\n// TODO: refactor this. External package should not do any assumptions about window.App.\ndeclare global {\n export interface Window {\n App: any;\n }\n}\n\ninterface ConfirmNavigationRenderProps {\n isOpen: boolean;\n title?: string;\n description?: string;\n onConfirm(): void;\n onCancel(): void;\n}\n\nexport interface ConfirmNavigationOwnProps {\n when?: boolean;\n ignoreSearchChanges?: boolean;\n title?: string;\n description?: string;\n component?: ComponentType<ConfirmNavigationRenderProps> | FC<ConfirmNavigationRenderProps>;\n}\n\nexport type ConfirmNavigationProps = ConfirmNavigationOwnProps & RouteComponentProps;\n\nconst DefaultConfirmComponent: FC<ConfirmNavigationRenderProps> = ({\n title,\n description,\n isOpen,\n onConfirm,\n onCancel,\n}) => (\n <Dialog\n negative\n open={isOpen}\n title={title}\n onPrimaryActionClick={onConfirm}\n primaryActionName=\"Leave\"\n onSecondaryActionClick={onCancel}\n secondaryActionName=\"Stay\"\n onClose={onCancel}\n >\n {description}\n </Dialog>\n);\n\n@observer\nclass ConfirmNavigationUnwrapped extends Component<ConfirmNavigationProps> {\n static defaultProps: Partial<ConfirmNavigationProps> = {\n title: 'Are you sure you want to leave?',\n description: \"You'll lose all your changes if you do.\",\n };\n\n @optional()\n @injectDependency(HistoryManager)\n declare historyManager?: HistoryManager;\n\n @observable isOpen = false;\n\n isRedirecting = false;\n\n suspended?: {\n history: History;\n currentLocation: Location;\n targetLocation: Location;\n };\n\n unblock!: UnregisterCallback;\n\n constructor(props: ConfirmNavigationProps) {\n super(props);\n makeObservable(this);\n }\n\n @action\n reset() {\n this.isOpen = false;\n this.isRedirecting = false;\n this.suspended = undefined;\n }\n\n componentDidMount() {\n this.block();\n\n if (window.App?.Instance?.before) {\n window.App.Instance.before(this.onBefore);\n }\n }\n\n componentDidUpdate(prevProps: RouteComponentProps) {\n const { history: prevHistory } = prevProps;\n const { history } = this.props;\n\n if (!comparer.structural(prevHistory.location, history.location)) {\n this.unblock();\n this.block();\n }\n }\n\n componentWillUnmount() {\n this.unblock();\n\n if (window.App?.Instance?.befores) {\n window.App.Instance.befores = window.App.Instance.befores.filter(\n ([, callback]: [any, Function]) => callback !== this.onBefore\n );\n }\n }\n\n // We should terminate Sammy navigation and fix URL of the current page\n onBefore = () => {\n if (this.isOpen && this.suspended) {\n this.isRedirecting = true;\n window.App.Instance.setLocation('#' + this.suspended.currentLocation.pathname);\n }\n\n return !this.isOpen;\n };\n\n block = () => {\n const getTransitionHook = (history: History) => {\n return (targetLocation: Location) => {\n // We shouldn't memorize new locations if it is navigation just for fix URL of the current page\n if (this.isRedirecting) {\n this.isRedirecting = false;\n return false;\n }\n\n const hasChanged =\n history.location.pathname !== targetLocation.pathname ||\n (!this.props.ignoreSearchChanges &&\n history.location.search !== targetLocation.search);\n\n if (hasChanged) {\n runInAction(() => {\n this.isOpen = true;\n this.suspended = {\n history,\n targetLocation,\n currentLocation: history.location,\n };\n });\n\n return false;\n }\n };\n };\n\n const { history } = this.props;\n\n const unblock = history.block(getTransitionHook(history));\n const restUnblocks = Array.from(this.historyManager?.storage.keys() ?? [])\n .filter(item => item !== history)\n .map(history => history.block(getTransitionHook(history)));\n\n this.unblock = () => {\n for (const unblock of restUnblocks) {\n unblock();\n }\n\n unblock();\n };\n };\n\n handleConfirm = () => {\n if (!this.suspended) {\n return;\n }\n\n const { history, currentLocation, targetLocation } = this.suspended;\n\n this.reset();\n\n this.unblock();\n // Fixing URL of the current page if it was changed manually\n history.replace(currentLocation.pathname + currentLocation.search);\n history.push(targetLocation);\n };\n\n handleCancel = () => {\n if (!this.suspended) {\n return;\n }\n\n const { history, currentLocation } = this.suspended;\n\n this.reset();\n\n this.unblock();\n // Fixing URL of the current page if it was changed manually\n history.replace(currentLocation.pathname + currentLocation.search);\n this.block();\n };\n\n render() {\n const { title, description, component: Component = DefaultConfirmComponent } = this.props;\n\n return (\n <Component\n isOpen={this.isOpen}\n title={title}\n description={description}\n onConfirm={this.handleConfirm}\n onCancel={this.handleCancel}\n />\n );\n }\n}\n\nexport const ConfirmNavigation = withRouter(({ when = true, ...props }: ConfirmNavigationProps) =>\n when ? <ConfirmNavigationUnwrapped {...props} /> : null\n);\n"],"names":["Component","withRouter","observable","action","runInAction","comparer","makeObservable","observer","Dialog","injectDependency","optional","HistoryManager","DefaultConfirmComponent","title","description","isOpen","onConfirm","onCancel","negative","open","onPrimaryActionClick","primaryActionName","onSecondaryActionClick","secondaryActionName","onClose","ConfirmNavigationUnwrapped","reset","isRedirecting","suspended","undefined","componentDidMount","window","block","App","Instance","before","onBefore","componentDidUpdate","prevProps","history","prevHistory","props","structural","location","unblock","componentWillUnmount","befores","filter","callback","render","component","handleConfirm","handleCancel","setLocation","currentLocation","pathname","getTransitionHook","targetLocation","hasChanged","ignoreSearchChanges","search","restUnblocks","Array","from","historyManager","storage","keys","item","map","replace","push","defaultProps","ConfirmNavigation","when"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA,SAASA,SAAS,QAAQ,QAAQ;AAElC,SAASC,UAAU,QAAQ,mBAAmB;AAE9C,SAASC,UAAU,EAAEC,MAAM,EAAEC,WAAW,EAAEC,QAAQ,EAAEC,cAAc,QAAQ,OAAO;AACjF,SAASC,QAAQ,QAAQ,aAAa;AAItC,SAASC,MAAM,QAAQ,8BAA8B;AAErD,SAASC,gBAAgB,EAAEC,QAAQ,QAAQ,0BAA0B;AACrE,SAASC,cAAc,QAAQ,+BAA+B;AA2B9D,MAAMC,0BAA4D,CAAC,EAC/DC,KAAK,EACLC,WAAW,EACXC,MAAM,EACNC,SAAS,EACTC,QAAQ,EACX,iBACG,KAACT;QACGU,QAAQ;QACRC,MAAMJ;QACNF,OAAOA;QACPO,sBAAsBJ;QACtBK,mBAAkB;QAClBC,wBAAwBL;QACxBM,qBAAoB;QACpBC,SAASP;kBAERH;;AAIT,M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{ ComponentType, FC } from 'react';\nimport { Component } from 'react';\nimport type { RouteComponentProps } from 'react-router-dom';\nimport { withRouter } from 'react-router-dom';\n\nimport { observable, action, runInAction, comparer, makeObservable } from 'mobx';\nimport { observer } from 'mobx-react';\n\nimport type { History, Location, UnregisterCallback } from 'history';\n\nimport { Dialog } from '@servicetitan/design-system';\n\nimport { injectDependency, optional } from '@servicetitan/react-ioc';\nimport { HistoryManager } from '@servicetitan/web-components';\n\n// TODO: refactor this. External package should not do any assumptions about window.App.\ndeclare global {\n export interface Window {\n App: any;\n }\n}\n\ninterface ConfirmNavigationRenderProps {\n isOpen: boolean;\n title?: string;\n description?: string;\n onConfirm(): void;\n onCancel(): void;\n}\n\nexport interface ConfirmNavigationOwnProps {\n when?: boolean;\n ignoreSearchChanges?: boolean;\n title?: string;\n description?: string;\n component?: ComponentType<ConfirmNavigationRenderProps> | FC<ConfirmNavigationRenderProps>;\n}\n\nexport type ConfirmNavigationProps = ConfirmNavigationOwnProps & RouteComponentProps;\n\nconst DefaultConfirmComponent: FC<ConfirmNavigationRenderProps> = ({\n title,\n description,\n isOpen,\n onConfirm,\n onCancel,\n}) => (\n <Dialog\n negative\n open={isOpen}\n title={title}\n onPrimaryActionClick={onConfirm}\n primaryActionName=\"Leave\"\n onSecondaryActionClick={onCancel}\n secondaryActionName=\"Stay\"\n onClose={onCancel}\n >\n {description}\n </Dialog>\n);\n\n@observer\nclass ConfirmNavigationUnwrapped extends Component<ConfirmNavigationProps> {\n static defaultProps: Partial<ConfirmNavigationProps> = {\n title: 'Are you sure you want to leave?',\n description: \"You'll lose all your changes if you do.\",\n };\n\n @optional()\n @injectDependency(HistoryManager)\n declare historyManager?: HistoryManager;\n\n @observable isOpen = false;\n\n isRedirecting = false;\n\n suspended?: {\n history: History;\n currentLocation: Location;\n targetLocation: Location;\n };\n\n unblock!: UnregisterCallback;\n\n constructor(props: ConfirmNavigationProps) {\n super(props);\n makeObservable(this);\n }\n\n @action\n reset() {\n this.isOpen = false;\n this.isRedirecting = false;\n this.suspended = undefined;\n }\n\n componentDidMount() {\n this.block();\n\n if (window.App?.Instance?.before) {\n window.App.Instance.before(this.onBefore);\n }\n }\n\n componentDidUpdate(prevProps: RouteComponentProps) {\n const { history: prevHistory } = prevProps;\n const { history } = this.props;\n\n if (!comparer.structural(prevHistory.location, history.location)) {\n this.unblock();\n this.block();\n }\n }\n\n componentWillUnmount() {\n this.unblock();\n\n if (window.App?.Instance?.befores) {\n window.App.Instance.befores = window.App.Instance.befores.filter(\n ([, callback]: [any, Function]) => callback !== this.onBefore\n );\n }\n }\n\n // We should terminate Sammy navigation and fix URL of the current page\n onBefore = () => {\n if (this.isOpen && this.suspended) {\n this.isRedirecting = true;\n window.App.Instance.setLocation('#' + this.suspended.currentLocation.pathname);\n }\n\n return !this.isOpen;\n };\n\n block = () => {\n const getTransitionHook = (history: History) => {\n return (targetLocation: Location) => {\n // We shouldn't memorize new locations if it is navigation just for fix URL of the current page\n if (this.isRedirecting) {\n this.isRedirecting = false;\n return false;\n }\n\n const hasChanged =\n history.location.pathname !== targetLocation.pathname ||\n (!this.props.ignoreSearchChanges &&\n history.location.search !== targetLocation.search);\n\n if (hasChanged) {\n runInAction(() => {\n this.isOpen = true;\n this.suspended = {\n history,\n targetLocation,\n currentLocation: history.location,\n };\n });\n\n return false;\n }\n };\n };\n\n const { history } = this.props;\n\n const unblock = history.block(getTransitionHook(history));\n const restUnblocks = Array.from(this.historyManager?.storage.keys() ?? [])\n .filter(item => item !== history)\n .map(history => history.block(getTransitionHook(history)));\n\n this.unblock = () => {\n for (const unblock of restUnblocks) {\n unblock();\n }\n\n unblock();\n };\n };\n\n handleConfirm = () => {\n if (!this.suspended) {\n return;\n }\n\n const { history, currentLocation, targetLocation } = this.suspended;\n\n this.reset();\n\n this.unblock();\n // Fixing URL of the current page if it was changed manually\n history.replace(currentLocation.pathname + currentLocation.search);\n history.push(targetLocation);\n };\n\n handleCancel = () => {\n if (!this.suspended) {\n return;\n }\n\n const { history, currentLocation } = this.suspended;\n\n this.reset();\n\n this.unblock();\n // Fixing URL of the current page if it was changed manually\n history.replace(currentLocation.pathname + currentLocation.search);\n this.block();\n };\n\n render() {\n const { title, description, component: Component = DefaultConfirmComponent } = this.props;\n\n return (\n <Component\n isOpen={this.isOpen}\n title={title}\n description={description}\n onConfirm={this.handleConfirm}\n onCancel={this.handleCancel}\n />\n );\n }\n}\n\nexport const ConfirmNavigation = withRouter(({ when = true, ...props }: ConfirmNavigationProps) =>\n when ? <ConfirmNavigationUnwrapped {...props} /> : null\n);\n"],"names":["Component","withRouter","observable","action","runInAction","comparer","makeObservable","observer","Dialog","injectDependency","optional","HistoryManager","DefaultConfirmComponent","title","description","isOpen","onConfirm","onCancel","negative","open","onPrimaryActionClick","primaryActionName","onSecondaryActionClick","secondaryActionName","onClose","ConfirmNavigationUnwrapped","reset","isRedirecting","suspended","undefined","componentDidMount","window","block","App","Instance","before","onBefore","componentDidUpdate","prevProps","history","prevHistory","props","structural","location","unblock","componentWillUnmount","befores","filter","callback","render","component","handleConfirm","handleCancel","setLocation","currentLocation","pathname","getTransitionHook","targetLocation","hasChanged","ignoreSearchChanges","search","restUnblocks","Array","from","historyManager","storage","keys","item","map","replace","push","defaultProps","ConfirmNavigation","when"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,SAASA,SAAS,QAAQ,QAAQ;AAElC,SAASC,UAAU,QAAQ,mBAAmB;AAE9C,SAASC,UAAU,EAAEC,MAAM,EAAEC,WAAW,EAAEC,QAAQ,EAAEC,cAAc,QAAQ,OAAO;AACjF,SAASC,QAAQ,QAAQ,aAAa;AAItC,SAASC,MAAM,QAAQ,8BAA8B;AAErD,SAASC,gBAAgB,EAAEC,QAAQ,QAAQ,0BAA0B;AACrE,SAASC,cAAc,QAAQ,+BAA+B;AA2B9D,MAAMC,0BAA4D,CAAC,EAC/DC,KAAK,EACLC,WAAW,EACXC,MAAM,EACNC,SAAS,EACTC,QAAQ,EACX,iBACG,KAACT;QAC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EAAE,GAAGhC,OAA+B,GAC1FgC,qBAAO,KAAChD;QAA4B,GAAGgB,KAAK;SAAO,MACrD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@servicetitan/confirm-navigation",
3
- "version": "41.2.0",
3
+ "version": "42.0.0",
4
4
  "description": "",
5
5
  "homepage": "https://docs.st.dev/docs/frontend/confirm-navigation",
6
6
  "repository": {
@@ -16,10 +16,10 @@
16
16
  "src"
17
17
  ],
18
18
  "devDependencies": {
19
- "@servicetitan/design-system": "~14.5.1",
20
- "@servicetitan/log-service": "^38.0.0",
21
- "@servicetitan/react-ioc": "^38.0.0",
22
- "@servicetitan/web-components": "^38.0.0",
19
+ "@servicetitan/design-system": "~14.5.3",
20
+ "@servicetitan/log-service": "^38.1.0",
21
+ "@servicetitan/react-ioc": "^38.1.0",
22
+ "@servicetitan/web-components": "^38.1.0",
23
23
  "@types/history": "~4.7.10",
24
24
  "@types/react": "~18.2.55",
25
25
  "@types/react-router": "^5.1.20",
@@ -46,5 +46,5 @@
46
46
  "cli": {
47
47
  "webpack": false
48
48
  },
49
- "gitHead": "a27c08d5c4a695eb24110ec1477fa23ccf28a148"
49
+ "gitHead": "af4dee1e6d65f7b611a03a15771adf5a6fa6f45d"
50
50
  }