@forge/bridge 2.1.3-next.0 → 2.2.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @forge/bridge
2
2
 
3
+ ## 2.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 6fe6082: Ability to disable close on escape and overlay click for modals
8
+
9
+ ## 2.2.0-next.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 6fe60823: Ability to disable close on escape and overlay click for modals
14
+
15
+ ## 2.1.3
16
+
17
+ ### Patch Changes
18
+
19
+ - 7c11b22: Improve error message for when the Custom UI bridge is not available
20
+
3
21
  ## 2.1.3-next.0
4
22
 
5
23
  ### Patch Changes
@@ -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.');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/bridge",
3
- "version": "2.1.3-next.0",
3
+ "version": "2.2.0",
4
4
  "description": "Forge bridge API for custom UI apps",
5
5
  "author": "Atlassian",
6
6
  "license": "UNLICENSED",