npm package diff
Package: @forge/bridge
Versions: 4.3.0 - 4.3.0-next.0-experimental-d6acbbd
Added: package/out/router/targets.js
Added: package/out/router/types.js
Added: package/out/router/targets.d.ts.map
Added: package/out/router/types.d.ts.map
Added: package/out/router/targets.d.ts
Added: package/out/router/types.d.ts
Modified: package/out/router/router.js
Index: package/out/router/router.js
===================================================================
--- package/out/router/router.js
+++ package/out/router/router.js
@@ -1,13 +1,35 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.router = void 0;
const bridge_1 = require("../bridge");
+const targets_1 = require("./targets");
const callBridge = (0, bridge_1.getCallBridge)();
-const navigate = async (url) => callBridge('navigate', { url, type: 'same-tab' });
-const open = async (url) => callBridge('navigate', { url, type: 'new-tab' });
+const navigate = async (location) => {
+ if (typeof location === 'string') {
+ return callBridge('navigate', { url: location, type: 'same-tab' });
+ }
+ else {
+ if (!(location === null || location === void 0 ? void 0 : location.target)) {
+ throw new Error('target is required for navigation');
+ }
+ return callBridge('navigate', { ...location, type: 'same-tab' });
+ }
+};
+const open = async (location) => {
+ if (typeof location === 'string') {
+ return callBridge('navigate', { url: location, type: 'new-tab' });
+ }
+ else {
+ if (!(location === null || location === void 0 ? void 0 : location.target)) {
+ throw new Error('target is required for navigation');
+ }
+ return callBridge('navigate', { ...location, type: 'new-tab' });
+ }
+};
const reload = async () => callBridge('reload');
exports.router = {
navigate,
open,
- reload
+ reload,
+ NAVIGATION_TARGET: targets_1.NAVIGATION_TARGET
};
Modified: package/package.json
Index: package/package.json
===================================================================
--- package/package.json
+++ package/package.json
@@ -1,7 +1,7 @@
{
"name": "@forge/bridge",
- "version": "4.3.0",
+ "version": "4.3.0-next.0-experimental-d6acbbd",
"description": "Forge bridge API for custom UI apps",
"author": "Atlassian",
"license": "UNLICENSED",
"main": "out/index.js",
Modified: package/out/router/router.d.ts.map
Index: package/out/router/router.d.ts.map
===================================================================
--- package/out/router/router.d.ts.map
+++ package/out/router/router.d.ts.map
@@ -1,1 +1,1 @@
-{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/router/router.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,MAAM;oBANG,MAAM,KAAK,QAAQ,IAAI,CAAC;gBAE5B,MAAM,KAAK,QAAQ,IAAI,CAAC;kBAEtB,QAAQ,IAAI,CAAC;CAMhC,CAAC"}
\ No newline at end of file
+{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/router/router.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAI7C,aAAK,QAAQ,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,kBAAkB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AA2CzE,eAAO,MAAM,MAAM;;;kBAFC,QAAQ,IAAI,CAAC;;;;;;;;;;;;CAOhC,CAAC"}
\ No newline at end of file
Modified: package/CHANGELOG.md
Index: package/CHANGELOG.md
===================================================================
--- package/CHANGELOG.md
+++ package/CHANGELOG.md
@@ -1,10 +1,11 @@
# @forge/bridge
-## 4.3.0
+## 4.3.0-next.0-experimental-d6acbbd
### Minor Changes
+- d516a64: Update router.navigate to allow navigation to an object containing a specified target and context properties
- e771326: Adding types for userAccess field as a part of license decoupling M1
## 4.3.0-next.0
Modified: package/out/router/router.d.ts
Index: package/out/router/router.d.ts
===================================================================
--- package/out/router/router.d.ts
+++ package/out/router/router.d.ts
@@ -1,6 +1,20 @@
+import { NavigationLocation } from './types';
+declare type Navigate = (location: string | NavigationLocation) => Promise<void>;
export declare const router: {
- navigate: (url: string) => Promise<void>;
- open: (url: string) => Promise<void>;
+ navigate: Navigate;
+ open: Navigate;
reload: () => Promise<void>;
+ NAVIGATION_TARGET: {
+ readonly CONTENT_VIEW: "contentView";
+ readonly CONTENT_EDIT: "contentEdit";
+ readonly CONTENT_LIST: "contentList";
+ readonly SPACE_VIEW: "spaceView";
+ readonly MODULE: "module";
+ readonly USER_PROFILE: "userProfile";
+ readonly DASHBOARD: "dashboard";
+ readonly ISSUE: "issue";
+ readonly PROJECT_SETTINGS_DETAILS: "projectSettingsDetails";
+ };
};
+export {};
//# sourceMappingURL=router.d.ts.map
\ No newline at end of file