@forge/bridge
Advanced tools
Comparing version 1.3.0-next.1 to 1.3.0-next.2
# @forge/bridge | ||
## 1.3.0-next.2 | ||
### Minor Changes | ||
- 69e2a9e: Expose router.open for opening external links in new tabs | ||
## 1.3.0-next.1 | ||
@@ -4,0 +10,0 @@ |
export declare const router: { | ||
navigate: (url: string) => Promise<void>; | ||
open: (url: string) => Promise<void>; | ||
}; | ||
//# sourceMappingURL=router.d.ts.map |
@@ -8,4 +8,4 @@ "use strict"; | ||
var callBridge = bridge_1.getCallBridge(); | ||
var navigate = function (url) { return tslib_1.__awaiter(void 0, void 0, void 0, function () { | ||
var context, type, product; | ||
var genericRoute = function (url, type) { return tslib_1.__awaiter(void 0, void 0, void 0, function () { | ||
var context, extensionType, product; | ||
var _a; | ||
@@ -17,9 +17,9 @@ return tslib_1.__generator(this, function (_b) { | ||
context = _b.sent(); | ||
type = (_a = context === null || context === void 0 ? void 0 : context.extension) === null || _a === void 0 ? void 0 : _a.type; | ||
product = (type ? type.split(':') : [undefined])[0]; | ||
extensionType = (_a = context === null || context === void 0 ? void 0 : context.extension) === null || _a === void 0 ? void 0 : _a.type; | ||
product = (extensionType ? extensionType.split(':') : [undefined])[0]; | ||
if (product === 'confluence') { | ||
throw new errors_1.BridgeAPIError('router.navigate is not implemented yet in Confluence'); | ||
throw new errors_1.BridgeAPIError('router is not implemented yet in Confluence'); | ||
} | ||
return [2, callBridge('navigate', { | ||
type: 'same-tab', | ||
type: type, | ||
url: url | ||
@@ -30,4 +30,11 @@ })]; | ||
}); }; | ||
var navigate = function (url) { return tslib_1.__awaiter(void 0, void 0, void 0, function () { return tslib_1.__generator(this, function (_a) { | ||
return [2, genericRoute(url, 'same-tab')]; | ||
}); }); }; | ||
var open = function (url) { return tslib_1.__awaiter(void 0, void 0, void 0, function () { return tslib_1.__generator(this, function (_a) { | ||
return [2, genericRoute(url, 'new-tab')]; | ||
}); }); }; | ||
exports.router = { | ||
navigate: navigate | ||
navigate: navigate, | ||
open: open | ||
}; |
{ | ||
"name": "@forge/bridge", | ||
"version": "1.3.0-next.1", | ||
"version": "1.3.0-next.2", | ||
"description": "Forge bridge API for custom UI apps", | ||
@@ -5,0 +5,0 @@ "author": "Atlassian", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15496
225