@forge/bridge
Advanced tools
Comparing version 4.3.0-next.0 to 4.3.0-next.0-experimental-d6acbbd
# @forge/bridge | ||
## 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 | ||
@@ -4,0 +11,0 @@ |
@@ -0,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 |
@@ -5,5 +5,26 @@ "use strict"; | ||
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'); | ||
@@ -13,3 +34,4 @@ exports.router = { | ||
open, | ||
reload | ||
reload, | ||
NAVIGATION_TARGET: targets_1.NAVIGATION_TARGET | ||
}; |
{ | ||
"name": "@forge/bridge", | ||
"version": "4.3.0-next.0", | ||
"version": "4.3.0-next.0-experimental-d6acbbd", | ||
"description": "Forge bridge API for custom UI apps", | ||
@@ -5,0 +5,0 @@ "author": "Atlassian", |
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
58626
102
786
5