@forge/bridge 5.8.1-next.5 → 5.9.0-next.11
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 +37 -0
- package/out/fetch/fetch.d.ts +5 -0
- package/out/fetch/fetch.d.ts.map +1 -1
- package/out/fetch/fetch.js +19 -1
- package/out/fetch/index.d.ts +3 -0
- package/out/fetch/index.d.ts.map +1 -1
- package/out/fetch/index.js +2 -1
- package/out/index.d.ts +1 -0
- package/out/index.d.ts.map +1 -1
- package/out/index.js +1 -0
- package/out/rovo/index.d.ts +2 -0
- package/out/rovo/index.d.ts.map +1 -0
- package/out/rovo/index.js +4 -0
- package/out/rovo/open.d.ts +4 -0
- package/out/rovo/open.d.ts.map +1 -0
- package/out/rovo/open.js +41 -0
- package/out/rovo/rovo.d.ts +4 -0
- package/out/rovo/rovo.d.ts.map +1 -0
- package/out/rovo/rovo.js +7 -0
- package/out/rovo/types.d.ts +18 -0
- package/out/rovo/types.d.ts.map +1 -0
- package/out/rovo/types.js +2 -0
- package/out/types.d.ts +3 -1
- package/out/types.d.ts.map +1 -1
- package/out/view/adf-renderer.d.ts +7 -0
- package/out/view/adf-renderer.d.ts.map +1 -0
- package/out/view/adf-renderer.js +41 -0
- package/out/view/view.d.ts +5 -0
- package/out/view/view.d.ts.map +1 -1
- package/out/view/view.js +3 -1
- package/package.json +6 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,42 @@
|
|
|
1
1
|
# @forge/bridge
|
|
2
2
|
|
|
3
|
+
## 5.9.0-next.11
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 4acf2e9: Change createAdfRendererIframeProps param to accept the full product context.
|
|
8
|
+
|
|
9
|
+
## 5.9.0-next.10
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- d211acd: Add iframe resizer support in forge adf renderer bridge package
|
|
14
|
+
|
|
15
|
+
## 5.9.0-next.9
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- 63997f2: Add requestRemote API to the Forge bridge
|
|
20
|
+
|
|
21
|
+
## 5.9.0-next.8
|
|
22
|
+
|
|
23
|
+
### Minor Changes
|
|
24
|
+
|
|
25
|
+
- 34aea87: Add support for rovo open bridge api
|
|
26
|
+
|
|
27
|
+
## 5.9.0-next.7
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- Updated dependencies [bb6e58a]
|
|
32
|
+
- @forge/manifest@11.1.0-next.6
|
|
33
|
+
|
|
34
|
+
## 5.9.0-next.6
|
|
35
|
+
|
|
36
|
+
### Minor Changes
|
|
37
|
+
|
|
38
|
+
- dc95e42: Add adf renderer wrapper function
|
|
39
|
+
|
|
3
40
|
## 5.8.1-next.5
|
|
4
41
|
|
|
5
42
|
### Patch Changes
|
package/out/fetch/fetch.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { getCallBridge } from '../bridge';
|
|
2
2
|
import { ForgeRequestInit } from '../types';
|
|
3
|
+
export declare const remoteFetchApi: (callBridge: ReturnType<typeof getCallBridge>) => {
|
|
4
|
+
requestRemote: (remoteKey: string, fetchOptions?: ForgeRequestInit & {
|
|
5
|
+
path?: string;
|
|
6
|
+
}) => Promise<Response>;
|
|
7
|
+
};
|
|
3
8
|
export declare const productFetchApi: (callBridge: ReturnType<typeof getCallBridge>) => {
|
|
4
9
|
requestConfluence: (restPath: string, fetchOptions?: ForgeRequestInit) => Promise<Response>;
|
|
5
10
|
requestJira: (restPath: string, fetchOptions?: ForgeRequestInit) => Promise<Response>;
|
package/out/fetch/fetch.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../src/fetch/fetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAoE5C,eAAO,MAAM,eAAe,eAAgB,WAAW,oBAAoB,CAAC;kCA8B1C,MAAM,iBAAiB,gBAAgB,KAAG,QAAQ,QAAQ,CAAC;4BAGjE,MAAM,iBAAiB,gBAAgB,KAAG,QAAQ,QAAQ,CAAC;iCAGtD,MAAM,iBAAiB,gBAAgB,KAAG,QAAQ,QAAQ,CAAC;CAG3F,CAAC"}
|
|
1
|
+
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../src/fetch/fetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAoE5C,eAAO,MAAM,cAAc,eAAgB,WAAW,oBAAoB,CAAC;+BAc5C,MAAM,iBAAiB,gBAAgB,GAAG;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,KAAG,QAAQ,QAAQ,CAAC;CAG7G,CAAC;AAEF,eAAO,MAAM,eAAe,eAAgB,WAAW,oBAAoB,CAAC;kCA8B1C,MAAM,iBAAiB,gBAAgB,KAAG,QAAQ,QAAQ,CAAC;4BAGjE,MAAM,iBAAiB,gBAAgB,KAAG,QAAQ,QAAQ,CAAC;iCAGtD,MAAM,iBAAiB,gBAAgB,KAAG,QAAQ,QAAQ,CAAC;CAG3F,CAAC"}
|
package/out/fetch/fetch.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.productFetchApi = void 0;
|
|
3
|
+
exports.productFetchApi = exports.remoteFetchApi = void 0;
|
|
4
4
|
const blobParser_1 = require("../utils/blobParser");
|
|
5
5
|
const parseFormData = async (form) => {
|
|
6
6
|
const parsed = {};
|
|
@@ -41,6 +41,24 @@ const parseRequest = async (init) => {
|
|
|
41
41
|
isMultipartFormData: isFormData
|
|
42
42
|
};
|
|
43
43
|
};
|
|
44
|
+
const remoteFetchApi = (callBridge) => {
|
|
45
|
+
const fetch = async (remoteKey, init) => {
|
|
46
|
+
const validatedInit = validateFetchOptions(init);
|
|
47
|
+
const { body: requestBody, headers: requestHeaders, isMultipartFormData } = await parseRequest(validatedInit);
|
|
48
|
+
const fetchPayload = {
|
|
49
|
+
remoteKey,
|
|
50
|
+
fetchRequestInit: { ...validatedInit, body: requestBody, headers: [...requestHeaders.entries()] },
|
|
51
|
+
isMultipartFormData
|
|
52
|
+
};
|
|
53
|
+
const { body, headers, statusText, status, isAttachment } = await callBridge('fetchRemote', fetchPayload);
|
|
54
|
+
const responseBody = isAttachment ? (0, blobParser_1.base64ToBlob)(body, headers['content-type']) : body;
|
|
55
|
+
return new Response(responseBody || null, { headers, status, statusText });
|
|
56
|
+
};
|
|
57
|
+
return {
|
|
58
|
+
requestRemote: (remoteKey, fetchOptions) => fetch(remoteKey, fetchOptions)
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
exports.remoteFetchApi = remoteFetchApi;
|
|
44
62
|
const productFetchApi = (callBridge) => {
|
|
45
63
|
const fetch = async (product, restPath, init) => {
|
|
46
64
|
const validatedInit = validateFetchOptions(init);
|
package/out/fetch/index.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import { ForgeRequestInit } from '../types';
|
|
2
2
|
export declare const requestConfluence: (restPath: string, fetchOptions?: ForgeRequestInit) => Promise<Response>, requestJira: (restPath: string, fetchOptions?: ForgeRequestInit) => Promise<Response>, requestBitbucket: (restPath: string, fetchOptions?: ForgeRequestInit) => Promise<Response>;
|
|
3
|
+
export declare const requestRemote: (remoteKey: string, fetchOptions?: ForgeRequestInit & {
|
|
4
|
+
path?: string;
|
|
5
|
+
}) => Promise<Response>;
|
|
3
6
|
//# sourceMappingURL=index.d.ts.map
|
package/out/fetch/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fetch/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fetch/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAY5C,eAAO,MAAQ,iBAAiB,aATA,MAAM,iBAAiB,gBAAgB,KAAK,QAAQ,QAAQ,CAAC,EAS3D,WAAW,aARnB,MAAM,iBAAiB,gBAAgB,KAAK,QAAQ,QAAQ,CAAC,EAQxC,gBAAgB,aAPhC,MAAM,iBAAiB,gBAAgB,KAAK,QAAQ,QAAQ,CAO4B,CAAC;AACxH,eAAO,MAAQ,aAAa,cAJC,MAAM,iBAAiB,gBAAgB,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,KAAK,QAAQ,QAAQ,CAI3B,CAAC"}
|
package/out/fetch/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.requestBitbucket = exports.requestJira = exports.requestConfluence = void 0;
|
|
4
|
+
exports.requestRemote = exports.requestBitbucket = exports.requestJira = exports.requestConfluence = void 0;
|
|
5
5
|
const bridge_1 = require("../bridge");
|
|
6
6
|
const fetch_1 = require("./fetch");
|
|
7
7
|
_a = (0, fetch_1.productFetchApi)((0, bridge_1.getCallBridge)()), exports.requestConfluence = _a.requestConfluence, exports.requestJira = _a.requestJira, exports.requestBitbucket = _a.requestBitbucket;
|
|
8
|
+
exports.requestRemote = (0, fetch_1.remoteFetchApi)((0, bridge_1.getCallBridge)()).requestRemote;
|
package/out/index.d.ts
CHANGED
package/out/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,cAAc,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,cAAc,gBAAgB,CAAC"}
|
package/out/index.js
CHANGED
|
@@ -13,6 +13,7 @@ tslib_1.__exportStar(require("./fetch"), exports);
|
|
|
13
13
|
tslib_1.__exportStar(require("./flag"), exports);
|
|
14
14
|
tslib_1.__exportStar(require("./events"), exports);
|
|
15
15
|
tslib_1.__exportStar(require("./realtime"), exports);
|
|
16
|
+
tslib_1.__exportStar(require("./rovo"), exports);
|
|
16
17
|
exports.i18n = tslib_1.__importStar(require("./i18n"));
|
|
17
18
|
tslib_1.__exportStar(require("./object-store"), exports);
|
|
18
19
|
tslib_1.__exportStar(require("./featureFlags"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/rovo/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { OpenRovoPayload } from './types';
|
|
2
|
+
export declare const OPEN_ROVO_BRIDGE_ERROR_MESSAGE = "Unable to open Rovo Chat due to usage in an unsupported product. Only Confluence, Jira and some Jira Service Management modules are supported at this point. See https://developer.atlassian.com/platform/forge/apis-reference/ui-api-bridge/rovo/";
|
|
3
|
+
export declare const open: (openRovoPayload: OpenRovoPayload) => Promise<void>;
|
|
4
|
+
//# sourceMappingURL=open.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"open.d.ts","sourceRoot":"","sources":["../../src/rovo/open.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAO1C,eAAO,MAAM,8BAA8B,uPAC2M,CAAC;AA4BvP,eAAO,MAAM,IAAI,oBAA2B,eAAe,kBAiB1D,CAAC"}
|
package/out/rovo/open.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.open = exports.OPEN_ROVO_BRIDGE_ERROR_MESSAGE = void 0;
|
|
4
|
+
const bridge_1 = require("../bridge");
|
|
5
|
+
const errors_1 = require("../errors");
|
|
6
|
+
const MAX_AGENT_LENGTH = 30;
|
|
7
|
+
const callBridge = (0, bridge_1.getCallBridge)();
|
|
8
|
+
exports.OPEN_ROVO_BRIDGE_ERROR_MESSAGE = 'Unable to open Rovo Chat due to usage in an unsupported product. Only Confluence, Jira and some Jira Service Management modules are supported at this point. See https://developer.atlassian.com/platform/forge/apis-reference/ui-api-bridge/rovo/';
|
|
9
|
+
const transformRovoPayload = (openRovoPayload) => {
|
|
10
|
+
switch (openRovoPayload.type) {
|
|
11
|
+
case 'forge':
|
|
12
|
+
return {
|
|
13
|
+
agentName: openRovoPayload.agentName,
|
|
14
|
+
agentKey: openRovoPayload.agentKey,
|
|
15
|
+
prompt: openRovoPayload.prompt
|
|
16
|
+
};
|
|
17
|
+
case 'atlassian':
|
|
18
|
+
return {
|
|
19
|
+
agentName: openRovoPayload.agentName,
|
|
20
|
+
prompt: openRovoPayload.prompt
|
|
21
|
+
};
|
|
22
|
+
default:
|
|
23
|
+
return { prompt: openRovoPayload.prompt };
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
const open = async (openRovoPayload) => {
|
|
27
|
+
if (openRovoPayload.type === 'forge') {
|
|
28
|
+
if (openRovoPayload.agentName.length > MAX_AGENT_LENGTH) {
|
|
29
|
+
throw new Error('rovo agent name too long');
|
|
30
|
+
}
|
|
31
|
+
if (openRovoPayload.agentKey.length > MAX_AGENT_LENGTH) {
|
|
32
|
+
throw new Error('rovo agent key too long');
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
const rovoArgs = transformRovoPayload(openRovoPayload);
|
|
36
|
+
const success = await callBridge('openRovo', rovoArgs);
|
|
37
|
+
if (success === false) {
|
|
38
|
+
throw new errors_1.BridgeAPIError(exports.OPEN_ROVO_BRIDGE_ERROR_MESSAGE);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
exports.open = open;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rovo.d.ts","sourceRoot":"","sources":["../../src/rovo/rovo.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,IAAI;;CAEhB,CAAC"}
|
package/out/rovo/rovo.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
declare type ForgeAgentPayload = {
|
|
2
|
+
type: 'forge';
|
|
3
|
+
agentKey: string;
|
|
4
|
+
agentName: string;
|
|
5
|
+
prompt?: string;
|
|
6
|
+
};
|
|
7
|
+
declare type AtlassianAgentPayload = {
|
|
8
|
+
type: 'atlassian';
|
|
9
|
+
agentName: string;
|
|
10
|
+
prompt?: string;
|
|
11
|
+
};
|
|
12
|
+
declare type DefaultAgentPayload = {
|
|
13
|
+
type: 'default';
|
|
14
|
+
prompt?: string;
|
|
15
|
+
};
|
|
16
|
+
export declare type OpenRovoPayload = ForgeAgentPayload | AtlassianAgentPayload | DefaultAgentPayload;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/rovo/types.ts"],"names":[],"mappings":"AAAA,aAAK,iBAAiB,GAAG;IACvB,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,aAAK,qBAAqB,GAAG;IAC3B,IAAI,EAAE,WAAW,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,aAAK,mBAAmB,GAAG;IACzB,IAAI,EAAE,SAAS,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,oBAAY,eAAe,GAAG,iBAAiB,GAAG,qBAAqB,GAAG,mBAAmB,CAAC"}
|
package/out/types.d.ts
CHANGED
|
@@ -6,13 +6,15 @@ export declare type InvokePayload = {
|
|
|
6
6
|
[key in number | string]: any;
|
|
7
7
|
};
|
|
8
8
|
export declare type InvokeResponse = Record<string, any> | void;
|
|
9
|
-
|
|
9
|
+
declare type FetchResponse = {
|
|
10
10
|
body?: string;
|
|
11
11
|
headers: {
|
|
12
12
|
[key: string]: string;
|
|
13
13
|
};
|
|
14
14
|
isAttachment?: boolean;
|
|
15
15
|
} & Pick<ResponseInit, 'status' | 'statusText'>;
|
|
16
|
+
export declare type ProductFetchResponse = FetchResponse;
|
|
17
|
+
export declare type RemoteFetchResponse = FetchResponse;
|
|
16
18
|
export declare enum ExtensionEnvironment {
|
|
17
19
|
DEVELOPMENT = "DEVELOPMENT",
|
|
18
20
|
STAGING = "STAGING",
|
package/out/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE7D,oBAAY,aAAa,GAAG;KACzB,GAAG,IAAI,MAAM,GAAG,MAAM,GAAG,GAAG;CAC9B,CAAC;AAEF,oBAAY,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;AAExD,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE7D,oBAAY,aAAa,GAAG;KACzB,GAAG,IAAI,MAAM,GAAG,MAAM,GAAG,GAAG;CAC9B,CAAC;AAEF,oBAAY,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,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AC,CAAC"}
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createAdfRendererIframeProps = void 0;
|
|
4
|
+
const uuid_1 = require("uuid");
|
|
5
|
+
const createAdfRendererIframeProps = async (adfDocument, iframeId) => {
|
|
6
|
+
const { iframeResizer } = await import('iframe-resizer');
|
|
7
|
+
const origin = new URL(document.referrer).origin;
|
|
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
|
+
});
|
|
15
|
+
const id = iframeId || `forge-adf-renderer-iframe-${(0, uuid_1.v4)()}`;
|
|
16
|
+
const onLoad = () => {
|
|
17
|
+
var _a;
|
|
18
|
+
const iframe = document.getElementById(id);
|
|
19
|
+
const message = {
|
|
20
|
+
type: 'adf-document',
|
|
21
|
+
document: adfDocument,
|
|
22
|
+
timestamp: Date.now(),
|
|
23
|
+
source: 'forge-adf-renderer'
|
|
24
|
+
};
|
|
25
|
+
iframeResizer({
|
|
26
|
+
heightCalculationMethod: 'taggedElement',
|
|
27
|
+
widthCalculationMethod: 'bodyScroll',
|
|
28
|
+
initCallback: (iframe) => {
|
|
29
|
+
var _a;
|
|
30
|
+
(_a = iframe === null || iframe === void 0 ? void 0 : iframe.iFrameResizer) === null || _a === void 0 ? void 0 : _a.resize();
|
|
31
|
+
}
|
|
32
|
+
}, iframe || '');
|
|
33
|
+
(_a = iframe === null || iframe === void 0 ? void 0 : iframe.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(message, origin);
|
|
34
|
+
};
|
|
35
|
+
return {
|
|
36
|
+
id,
|
|
37
|
+
src,
|
|
38
|
+
onLoad
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
exports.createAdfRendererIframeProps = createAdfRendererIframeProps;
|
package/out/view/view.d.ts
CHANGED
|
@@ -10,5 +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) => Promise<{
|
|
14
|
+
id: string;
|
|
15
|
+
src: string;
|
|
16
|
+
onLoad: () => void;
|
|
17
|
+
}>;
|
|
13
18
|
};
|
|
14
19
|
//# sourceMappingURL=view.d.ts.map
|
package/out/view/view.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../src/view/view.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../src/view/view.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;CAWhB,CAAC"}
|
package/out/view/view.js
CHANGED
|
@@ -10,6 +10,7 @@ const getContext_1 = require("./getContext");
|
|
|
10
10
|
const changeWindowTitle_1 = require("./changeWindowTitle");
|
|
11
11
|
const theme_1 = require("./theme");
|
|
12
12
|
const emitReadyEvent_1 = require("./emitReadyEvent");
|
|
13
|
+
const adf_renderer_1 = require("./adf-renderer");
|
|
13
14
|
exports.view = {
|
|
14
15
|
submit: submit_1.submit,
|
|
15
16
|
close: close_1.close,
|
|
@@ -19,5 +20,6 @@ exports.view = {
|
|
|
19
20
|
getContext: getContext_1.getContext,
|
|
20
21
|
theme: theme_1.theme,
|
|
21
22
|
changeWindowTitle: changeWindowTitle_1.changeWindowTitle,
|
|
22
|
-
emitReadyEvent: emitReadyEvent_1.emitReadyEvent
|
|
23
|
+
emitReadyEvent: emitReadyEvent_1.emitReadyEvent,
|
|
24
|
+
createAdfRendererIframeProps: adf_renderer_1.createAdfRendererIframeProps
|
|
23
25
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/bridge",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.9.0-next.11",
|
|
4
4
|
"description": "Forge bridge API for custom UI apps",
|
|
5
5
|
"author": "Atlassian",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
@@ -13,12 +13,16 @@
|
|
|
13
13
|
"compile": "tsc -b -v"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
+
"@atlaskit/adf-schema": "^48.0.0",
|
|
16
17
|
"@atlaskit/tokens": "^1.58.0",
|
|
17
18
|
"@forge/i18n": "0.0.7",
|
|
18
19
|
"@forge/resolver": "1.7.1",
|
|
19
20
|
"@statsig/js-client": "3.18.2",
|
|
20
21
|
"@types/history": "^4.7.11",
|
|
21
|
-
"@forge/manifest": "11.1.0-next.
|
|
22
|
+
"@forge/manifest": "11.1.0-next.6",
|
|
23
|
+
"@types/iframe-resizer": "^3.5.8",
|
|
24
|
+
"iframe-resizer": "^4.4.5",
|
|
25
|
+
"uuid": "^9.0.1"
|
|
22
26
|
},
|
|
23
27
|
"devDependencies": {
|
|
24
28
|
"history": "5.3.0",
|