@forge/bridge 0.0.0-experimental-64caa5a → 0.0.0-experimental-e1cefc4

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,6 +1,32 @@
1
1
  # @forge/bridge
2
2
 
3
- ## 0.0.0-experimental-64caa5a
3
+ ## 0.0.0-experimental-e1cefc4
4
+
5
+ ### Patch Changes
6
+
7
+ - 869511d: Change
8
+ - 97ce1f3: update history.location in bridge when route changes
9
+ - 869511d: Add
10
+
11
+ ## 2.2.1-next.0
12
+
13
+ ### Patch Changes
14
+
15
+ - 97ce1f3: update history.location in bridge when route changes
16
+
17
+ ## 2.2.0
18
+
19
+ ### Minor Changes
20
+
21
+ - 6fe6082: Ability to disable close on escape and overlay click for modals
22
+
23
+ ## 2.2.0-next.0
24
+
25
+ ### Minor Changes
26
+
27
+ - 6fe60823: Ability to disable close on escape and overlay click for modals
28
+
29
+ ## 2.1.3
4
30
 
5
31
  ### Patch Changes
6
32
 
package/out/bridge.js CHANGED
@@ -6,11 +6,11 @@ function isBridgeAvailable(bridge) {
6
6
  return !!(bridge === null || bridge === void 0 ? void 0 : bridge.callBridge);
7
7
  }
8
8
  exports.getCallBridge = () => {
9
- if (!isBridgeAvailable(window.__bridge)) {
9
+ if (!isBridgeAvailable(self.__bridge)) {
10
10
  throw new errors_1.BridgeAPIError(`
11
11
  Unable to establish a connection with the Custom UI bridge.
12
12
  If you are trying to run your app locally, Forge apps only work in the context of Atlassian products. Refer to https://go.atlassian.com/forge-tunneling-with-custom-ui for how to tunnel when using a local development server.
13
13
  `);
14
14
  }
15
- return window.__bridge.callBridge;
15
+ return self.__bridge.callBridge;
16
16
  };
@@ -3,12 +3,16 @@ export interface ModalOptions {
3
3
  onClose?: (payload: any) => any;
4
4
  size?: string;
5
5
  context?: any;
6
+ closeOnEscape?: boolean;
7
+ closeOnOverlayClick?: boolean;
6
8
  }
7
9
  export declare class Modal {
8
10
  resource: string | null;
9
11
  onClose: NonNullable<ModalOptions['onClose']>;
10
12
  size: string;
11
13
  context: any;
14
+ closeOnEscape: boolean;
15
+ closeOnOverlayClick: boolean;
12
16
  constructor(opts?: ModalOptions);
13
17
  open(): Promise<void>;
14
18
  }
@@ -1 +1 @@
1
- {"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../src/modal/modal.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,GAAG,CAAC;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,GAAG,CAAC;CACf;AAKD,qBAAa,KAAK;IAChB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,EAAE,WAAW,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,GAAG,CAAC;gBACD,IAAI,CAAC,EAAE,YAAY;IAOzB,IAAI;CAgBX"}
1
+ {"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../src/modal/modal.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,GAAG,CAAC;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAKD,qBAAa,KAAK;IAChB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,EAAE,WAAW,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,GAAG,CAAC;IACb,aAAa,EAAE,OAAO,CAAC;IACvB,mBAAmB,EAAE,OAAO,CAAC;gBACjB,IAAI,CAAC,EAAE,YAAY;IASzB,IAAI;CAkBX"}
@@ -8,10 +8,13 @@ const callBridge = bridge_1.getCallBridge();
8
8
  const noop = () => { };
9
9
  class Modal {
10
10
  constructor(opts) {
11
+ var _a, _b;
11
12
  this.resource = (opts === null || opts === void 0 ? void 0 : opts.resource) || null;
12
13
  this.onClose = (opts === null || opts === void 0 ? void 0 : opts.onClose) || noop;
13
14
  this.size = (opts === null || opts === void 0 ? void 0 : opts.size) || 'medium';
14
15
  this.context = (opts === null || opts === void 0 ? void 0 : opts.context) || {};
16
+ this.closeOnEscape = (_a = opts === null || opts === void 0 ? void 0 : opts.closeOnEscape) !== null && _a !== void 0 ? _a : true;
17
+ this.closeOnOverlayClick = (_b = opts === null || opts === void 0 ? void 0 : opts.closeOnOverlayClick) !== null && _b !== void 0 ? _b : true;
15
18
  }
16
19
  open() {
17
20
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
@@ -20,7 +23,9 @@ class Modal {
20
23
  resource: this.resource,
21
24
  onClose: this.onClose,
22
25
  size: this.size,
23
- context: this.context
26
+ context: this.context,
27
+ closeOnEscape: this.closeOnEscape,
28
+ closeOnOverlayClick: this.closeOnOverlayClick
24
29
  });
25
30
  if (success === false) {
26
31
  throw new errors_1.BridgeAPIError('Unable to open modal.');
@@ -1 +1 @@
1
- {"version":3,"file":"createHistory.d.ts","sourceRoot":"","sources":["../../src/view/createHistory.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAIvC,eAAO,MAAM,aAAa,QAAO,OAAO,CAAC,OAAO,CAE/C,CAAC"}
1
+ {"version":3,"file":"createHistory.d.ts","sourceRoot":"","sources":["../../src/view/createHistory.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAIvC,eAAO,MAAM,aAAa,QAAa,OAAO,CAAC,OAAO,CAOrD,CAAC"}
@@ -1,8 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createHistory = void 0;
4
+ const tslib_1 = require("tslib");
4
5
  const bridge_1 = require("../bridge");
5
6
  const callBridge = bridge_1.getCallBridge();
6
- exports.createHistory = () => {
7
- return callBridge('createHistory');
8
- };
7
+ exports.createHistory = () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
8
+ const history = yield callBridge('createHistory');
9
+ history.listen((location) => {
10
+ history.location = location;
11
+ });
12
+ return history;
13
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/bridge",
3
- "version": "0.0.0-experimental-64caa5a",
3
+ "version": "0.0.0-experimental-e1cefc4",
4
4
  "description": "Forge bridge API for custom UI apps",
5
5
  "author": "Atlassian",
6
6
  "license": "UNLICENSED",