@forge/bridge 5.9.0-next.11 → 5.9.0-next.12

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,13 @@
1
1
  # @forge/bridge
2
2
 
3
+ ## 5.9.0-next.12
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [af4af6f]
8
+ - Updated dependencies [af4af6f]
9
+ - @forge/manifest@11.1.0-next.7
10
+
3
11
  ## 5.9.0-next.11
4
12
 
5
13
  ### Patch Changes
@@ -1,5 +1,5 @@
1
- import { DocNode } from '@atlaskit/adf-schema';
2
- export declare const createAdfRendererIframeProps: (adfDocument: DocNode, iframeId?: string) => Promise<{
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;
@@ -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,gBAAuB,OAAO,aAAa,MAAM;;;;EAsCzF,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,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createAdfRendererIframeProps = void 0;
4
4
  const uuid_1 = require("uuid");
5
- const createAdfRendererIframeProps = async (adfDocument, iframeId) => {
5
+ const createAdfRendererIframeProps = async (context, iframeId) => {
6
6
  const { iframeResizer } = await import('iframe-resizer');
7
7
  const origin = new URL(document.referrer).origin;
8
8
  const src = `${origin}/forge-apps/adf-renderer`;
@@ -14,13 +14,14 @@ const createAdfRendererIframeProps = async (adfDocument, iframeId) => {
14
14
  });
15
15
  const id = iframeId || `forge-adf-renderer-iframe-${(0, uuid_1.v4)()}`;
16
16
  const onLoad = () => {
17
- var _a;
17
+ var _a, _b;
18
18
  const iframe = document.getElementById(id);
19
19
  const message = {
20
20
  type: 'adf-document',
21
- document: adfDocument,
21
+ document: (_a = context.extension.macro) === null || _a === void 0 ? void 0 : _a.body,
22
22
  timestamp: Date.now(),
23
- source: 'forge-adf-renderer'
23
+ source: 'forge-adf-renderer',
24
+ localId: context.localId
24
25
  };
25
26
  iframeResizer({
26
27
  heightCalculationMethod: 'taggedElement',
@@ -30,7 +31,7 @@ const createAdfRendererIframeProps = async (adfDocument, iframeId) => {
30
31
  (_a = iframe === null || iframe === void 0 ? void 0 : iframe.iFrameResizer) === null || _a === void 0 ? void 0 : _a.resize();
31
32
  }
32
33
  }, iframe || '');
33
- (_a = iframe === null || iframe === void 0 ? void 0 : iframe.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(message, origin);
34
+ (_b = iframe === null || iframe === void 0 ? void 0 : iframe.contentWindow) === null || _b === void 0 ? void 0 : _b.postMessage(message, origin);
34
35
  };
35
36
  return {
36
37
  id,
@@ -10,7 +10,7 @@ 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) => Promise<{
13
+ createAdfRendererIframeProps: (context: import("../types").FullContext, iframeId?: string | undefined) => Promise<{
14
14
  id: string;
15
15
  src: string;
16
16
  onLoad: () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/bridge",
3
- "version": "5.9.0-next.11",
3
+ "version": "5.9.0-next.12",
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,7 @@
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-next.7",
23
23
  "@types/iframe-resizer": "^3.5.8",
24
24
  "iframe-resizer": "^4.4.5",
25
25
  "uuid": "^9.0.1"