npm package diff

Package: @forge/bridge

Versions: 3.5.1-next.3-experimental-c7a7d36 - 4.0.0-next.6

Added:package/out/i18n/index.js

Added:package/out/i18n/index.d.ts.map

Added:package/out/i18n/index.d.ts

Modified:package/out/view/getContext.js

Index: package/out/view/getContext.js
===================================================================
--- package/out/view/getContext.js
+++ package/out/view/getContext.js
@@ -1,9 +1,17 @@
 "use strict";
 Object.defineProperty(exports, "__esModule", { value: true });
 exports.getContext = void 0;
+const tslib_1 = require("tslib");
 const bridge_1 = require("../bridge");
+const i18n_1 = require("@forge/i18n");
 const callBridge = (0, bridge_1.getCallBridge)();
-const getContext = () => {
-    return callBridge('getContext');
-};
+const getContext = () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
+    var _a;
+    const context = yield callBridge('getContext');
+    const locale = context === null || context === void 0 ? void 0 : context.locale;
+    if (locale) {
+        context.locale = (_a = (0, i18n_1.ensureLocale)(locale)) !== null && _a !== void 0 ? _a : locale;
+    }
+    return context;
+});
 exports.getContext = getContext;

Modified:package/out/index.js

Index: package/out/index.js
===================================================================
--- package/out/index.js
+++ package/out/index.js
@@ -1,6 +1,7 @@
 "use strict";
 Object.defineProperty(exports, "__esModule", { value: true });
+exports.i18n = void 0;
 const tslib_1 = require("tslib");
 tslib_1.__exportStar(require("./invoke"), exports);
 tslib_1.__exportStar(require("./invoke-remote"), exports);
 tslib_1.__exportStar(require("./view"), exports);
@@ -8,4 +9,5 @@
 tslib_1.__exportStar(require("./modal"), exports);
 tslib_1.__exportStar(require("./fetch"), exports);
 tslib_1.__exportStar(require("./flag"), exports);
 tslib_1.__exportStar(require("./events"), exports);
+exports.i18n = tslib_1.__importStar(require("./i18n"));

Modified:package/package.json

Index: package/package.json
===================================================================
--- package/package.json
+++ package/package.json
@@ -1,7 +1,7 @@
 {
   "name": "@forge/bridge",
-  "version": "3.5.1-next.3-experimental-c7a7d36",
+  "version": "4.0.0-next.6",
   "description": "Forge bridge API for custom UI apps",
   "author": "Atlassian",
   "license": "UNLICENSED",
   "main": "out/index.js",
@@ -13,9 +13,9 @@
     "compile": "tsc -b -v"
   },
   "dependencies": {
     "@types/history": "^4.7.11",
-    "@forge/i18n": "0.0.1-next.7-experimental-c7a7d36"
+    "@forge/i18n": "0.0.1-next.10"
   },
   "devDependencies": {
     "history": "5.3.0",
     "isomorphic-fetch": "^3.0.0",

Modified:package/out/view/getContext.d.ts.map

Index: package/out/view/getContext.d.ts.map
===================================================================
--- package/out/view/getContext.d.ts.map
+++ package/out/view/getContext.d.ts.map
@@ -1,1 +1,1 @@
-{"version":3,"file":"getContext.d.ts","sourceRoot":"","sources":["../../src/view/getContext.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAIvC,eAAO,MAAM,UAAU,QAAO,QAAQ,WAAW,CAEhD,CAAC"}
\ No newline at end of file
+{"version":3,"file":"getContext.d.ts","sourceRoot":"","sources":["../../src/view/getContext.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAKvC,eAAO,MAAM,UAAU,QAAa,QAAQ,WAAW,CAStD,CAAC"}
\ No newline at end of file

Modified:package/out/index.d.ts.map

Index: package/out/index.d.ts.map
===================================================================
--- package/out/index.d.ts.map
+++ package/out/index.d.ts.map
@@ -1,1 +1,1 @@
-{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC"}
\ No newline at end of file
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC"}
\ No newline at end of file

Modified:package/out/types.d.ts.map

Index: package/out/types.d.ts.map
===================================================================
--- package/out/types.d.ts.map
+++ package/out/types.d.ts.map
@@ -1,1 +1,1 @@
-{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,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,oBAAY,oBAAoB,GAAG;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IACnC,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,GAAG,IAAI,CAAC,YAAY,EAAE,QAAQ,GAAG,YAAY,CAAC,CAAC;AAEhD,MAAM,WAAW,WAAW;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,aAAa,CAAC;IACzB,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB;AACD,UAAU,aAAa;IACrB,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,OAAO,CAAC;I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IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB;AACD,UAAU,aAAa;IACrB,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,OAAO,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,YAAY,EAAE,OAAO,CAAC;IACtB,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,wBAAwB,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,oBAAY,YAAY,GAAG;IACzB,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB,CAAC"}
\ No newline at end of file

Modified:package/CHANGELOG.md

Index: package/CHANGELOG.md
===================================================================
--- package/CHANGELOG.md
+++ package/CHANGELOG.md
@@ -1,15 +1,34 @@
 # @forge/bridge
 
-## 3.5.1-next.3-experimental-c7a7d36
+## 4.0.0-next.6
 
+### Major Changes
+
+- a27f856: Ensure locale returned from getContext() is in the correct format and confirms the Forge Supported Locale Codes.
+
+  Additionally, add new APIs for Forge i18n support.
+
+  - `i18n.getTranslations` - Add i18n.getTranslations api to fetch i18n resources from Forge apps
+  - `i18n.createTranslationFunction` - Creates a translation function (i.e. `t`) to support content translation for Forge apps
+
 ### Patch Changes
 
-- 7e506ec: Add @forge/i18n dependency to bridge
-- Updated dependencies [7e506ec]
-- Updated dependencies [7e506ec]
-  - @forge/[email protected]
+- Updated dependencies [c81fa57]
+  - @forge/[email protected]
 
+## 3.5.1-next.5
+
+### Patch Changes
+
+- @forge/[email protected]
+
+## 3.5.1-next.4
+
+### Patch Changes
+
+- @forge/[email protected]
+
 ## 3.5.1-next.3
 
 ### Patch Changes

Modified:package/out/index.d.ts

Index: package/out/index.d.ts
===================================================================
--- package/out/index.d.ts
+++ package/out/index.d.ts
@@ -5,5 +5,6 @@
 export * from './modal';
 export * from './fetch';
 export * from './flag';
 export * from './events';
+export * as i18n from './i18n';
 //# sourceMappingURL=index.d.ts.map
\ No newline at end of file

Modified:package/out/types.d.ts

Index: package/out/types.d.ts
===================================================================
--- package/out/types.d.ts
+++ package/out/types.d.ts
@@ -1,4 +1,5 @@
+import { type ForgeSupportedLocaleCode } from '@forge/i18n';
 export declare type InvokePayload = {
     [key in number | string]: any;
 };
 export declare type InvokeResponse = Record<string, any> | void;
@@ -15,9 +16,9 @@
     workspaceId?: string;
     extension: ExtensionData;
     license?: LicenseDetails;
     localId: string;
-    locale: string;
+    locale: ForgeSupportedLocaleCode;
     moduleKey: string;
     siteUrl: string;
     timezone: string;
 }