@forge/bridge 5.11.0-next.3 → 5.11.0-next.4

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @forge/bridge
2
2
 
3
+ ## 5.11.0-next.4
4
+
5
+ ### Minor Changes
6
+
7
+ - 140f500: Add view.onClose bridge method
8
+
3
9
  ## 5.11.0-next.3
4
10
 
5
11
  ### Patch Changes
@@ -0,0 +1,2 @@
1
+ export declare const onClose: (payload: () => Promise<void>) => Promise<void>;
2
+ //# sourceMappingURL=onClose.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"onClose.d.ts","sourceRoot":"","sources":["../../src/view/onClose.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,OAAO,YAAmB,MAAM,QAAQ,IAAI,CAAC,kBASzD,CAAC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.onClose = void 0;
4
+ const bridge_1 = require("../bridge");
5
+ const errors_1 = require("../errors");
6
+ const callBridge = (0, bridge_1.getCallBridge)();
7
+ const onClose = async (payload) => {
8
+ try {
9
+ const success = await callBridge('onClose', payload);
10
+ if (success === false) {
11
+ throw new errors_1.BridgeAPIError('`onClose` call has failed.');
12
+ }
13
+ }
14
+ catch (e) {
15
+ throw new errors_1.BridgeAPIError("`onClose` failed because this resource's view is not closable.");
16
+ }
17
+ };
18
+ exports.onClose = onClose;
@@ -1,6 +1,7 @@
1
1
  export declare const view: {
2
2
  submit: (payload?: any) => Promise<void>;
3
3
  close: (payload?: any) => Promise<void>;
4
+ onClose: (payload: () => Promise<void>) => Promise<void>;
4
5
  open: () => Promise<void>;
5
6
  refresh: (payload?: any) => Promise<void>;
6
7
  createHistory: () => Promise<import("history").History>;
@@ -1 +1 @@
1
- {"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../src/view/view.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;CAWhB,CAAC"}
1
+ {"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../src/view/view.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;CAYhB,CAAC"}
package/out/view/view.js CHANGED
@@ -11,9 +11,11 @@ const changeWindowTitle_1 = require("./changeWindowTitle");
11
11
  const theme_1 = require("./theme");
12
12
  const emitReadyEvent_1 = require("./emitReadyEvent");
13
13
  const adf_renderer_1 = require("./adf-renderer");
14
+ const onClose_1 = require("./onClose");
14
15
  exports.view = {
15
16
  submit: submit_1.submit,
16
17
  close: close_1.close,
18
+ onClose: onClose_1.onClose,
17
19
  open: open_1.open,
18
20
  refresh: refresh_1.refresh,
19
21
  createHistory: createHistory_1.createHistory,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/bridge",
3
- "version": "5.11.0-next.3",
3
+ "version": "5.11.0-next.4",
4
4
  "description": "Forge bridge API for custom UI apps",
5
5
  "author": "Atlassian",
6
6
  "license": "SEE LICENSE IN LICENSE.txt",