@forge/bridge 5.9.0-next.9 → 5.9.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,61 @@
1
1
  # @forge/bridge
2
2
 
3
+ ## 5.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - d211acd: Add iframe resizer support in forge adf renderer bridge package
8
+ - 63997f2: Add requestRemote API to the Forge bridge
9
+ - dc95e42: Add adf renderer wrapper function
10
+ - 34aea87: Add support for rovo open bridge api
11
+
12
+ ### Patch Changes
13
+
14
+ - 4acf2e9: Change createAdfRendererIframeProps param to accept the full product context.
15
+ - Updated dependencies [559c541]
16
+ - Updated dependencies [b5f0775]
17
+ - Updated dependencies [af4af6f]
18
+ - Updated dependencies [2f0c3c2]
19
+ - Updated dependencies [c50eeb5]
20
+ - Updated dependencies [beefc94]
21
+ - Updated dependencies [00eaa35]
22
+ - Updated dependencies [b9cefff]
23
+ - Updated dependencies [b5f0775]
24
+ - Updated dependencies [069288e]
25
+ - Updated dependencies [d317f2e]
26
+ - Updated dependencies [bf0e0f6]
27
+ - Updated dependencies [af4af6f]
28
+ - Updated dependencies [bb6e58a]
29
+ - @forge/manifest@11.1.0
30
+
31
+ ## 5.9.0-next.13
32
+
33
+ ### Patch Changes
34
+
35
+ - Updated dependencies [c50eeb5]
36
+ - Updated dependencies [beefc94]
37
+ - @forge/manifest@11.1.0-next.8
38
+
39
+ ## 5.9.0-next.12
40
+
41
+ ### Patch Changes
42
+
43
+ - Updated dependencies [af4af6f]
44
+ - Updated dependencies [af4af6f]
45
+ - @forge/manifest@11.1.0-next.7
46
+
47
+ ## 5.9.0-next.11
48
+
49
+ ### Patch Changes
50
+
51
+ - 4acf2e9: Change createAdfRendererIframeProps param to accept the full product context.
52
+
53
+ ## 5.9.0-next.10
54
+
55
+ ### Minor Changes
56
+
57
+ - d211acd: Add iframe resizer support in forge adf renderer bridge package
58
+
3
59
  ## 5.9.0-next.9
4
60
 
5
61
  ### Minor Changes
@@ -1,7 +1,7 @@
1
- import { DocNode } from '@atlaskit/adf-schema';
2
- export declare const createAdfRendererIframeProps: (adfDocument: DocNode, iframeId?: string) => {
1
+ import type { FullContext } from '../types';
2
+ export declare const createAdfRendererIframeProps: (context: FullContext, iframeId?: string) => Promise<{
3
3
  id: string;
4
4
  src: string;
5
5
  onLoad: () => void;
6
- };
6
+ }>;
7
7
  //# sourceMappingURL=adf-renderer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"adf-renderer.d.ts","sourceRoot":"","sources":["../../src/view/adf-renderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAU/C,eAAO,MAAM,4BAA4B,gBAAiB,OAAO,aAAa,MAAM;;;;CAuBnF,CAAC"}
1
+ {"version":3,"file":"adf-renderer.d.ts","sourceRoot":"","sources":["../../src/view/adf-renderer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAU5C,eAAO,MAAM,4BAA4B,YAAmB,WAAW,aAAa,MAAM;;;;EAwCzF,CAAC"}
@@ -2,20 +2,36 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createAdfRendererIframeProps = void 0;
4
4
  const uuid_1 = require("uuid");
5
- const createAdfRendererIframeProps = (adfDocument, iframeId) => {
5
+ const createAdfRendererIframeProps = async (context, iframeId) => {
6
+ const { iframeResizer } = await import('iframe-resizer');
6
7
  const origin = new URL(document.referrer).origin;
7
8
  const src = `${origin}/forge-apps/adf-renderer`;
9
+ window.addEventListener('load', () => {
10
+ setTimeout(() => {
11
+ document.documentElement.style.height = 'auto';
12
+ document.body.style.height = 'auto';
13
+ }, 200);
14
+ });
8
15
  const id = iframeId || `forge-adf-renderer-iframe-${(0, uuid_1.v4)()}`;
9
16
  const onLoad = () => {
10
- var _a;
17
+ var _a, _b;
11
18
  const iframe = document.getElementById(id);
12
19
  const message = {
13
20
  type: 'adf-document',
14
- document: adfDocument,
21
+ document: (_a = context.extension.macro) === null || _a === void 0 ? void 0 : _a.body,
15
22
  timestamp: Date.now(),
16
- source: 'forge-adf-renderer'
23
+ source: 'forge-adf-renderer',
24
+ localId: context.localId
17
25
  };
18
- (_a = iframe === null || iframe === void 0 ? void 0 : iframe.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(message, origin);
26
+ iframeResizer({
27
+ heightCalculationMethod: 'taggedElement',
28
+ widthCalculationMethod: 'bodyScroll',
29
+ initCallback: (iframe) => {
30
+ var _a;
31
+ (_a = iframe === null || iframe === void 0 ? void 0 : iframe.iFrameResizer) === null || _a === void 0 ? void 0 : _a.resize();
32
+ }
33
+ }, iframe || '');
34
+ (_b = iframe === null || iframe === void 0 ? void 0 : iframe.contentWindow) === null || _b === void 0 ? void 0 : _b.postMessage(message, origin);
19
35
  };
20
36
  return {
21
37
  id,
@@ -10,10 +10,10 @@ export declare const view: {
10
10
  };
11
11
  changeWindowTitle: (title: string) => Promise<void>;
12
12
  emitReadyEvent: () => Promise<void>;
13
- createAdfRendererIframeProps: (adfDocument: import("@atlaskit/adf-schema").DocNode, iframeId?: string | undefined) => {
13
+ createAdfRendererIframeProps: (context: import("../types").FullContext, iframeId?: string | undefined) => Promise<{
14
14
  id: string;
15
15
  src: string;
16
16
  onLoad: () => void;
17
- };
17
+ }>;
18
18
  };
19
19
  //# sourceMappingURL=view.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/bridge",
3
- "version": "5.9.0-next.9",
3
+ "version": "5.9.0",
4
4
  "description": "Forge bridge API for custom UI apps",
5
5
  "author": "Atlassian",
6
6
  "license": "SEE LICENSE IN LICENSE.txt",
@@ -19,7 +19,9 @@
19
19
  "@forge/resolver": "1.7.1",
20
20
  "@statsig/js-client": "3.18.2",
21
21
  "@types/history": "^4.7.11",
22
- "@forge/manifest": "11.1.0-next.6",
22
+ "@forge/manifest": "11.1.0",
23
+ "@types/iframe-resizer": "^3.5.8",
24
+ "iframe-resizer": "^4.4.5",
23
25
  "uuid": "^9.0.1"
24
26
  },
25
27
  "devDependencies": {