@forge/bridge 3.4.0 → 3.5.0-next.0
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 +8 -0
- package/out/internal/index.d.ts +3 -0
- package/out/internal/index.d.ts.map +1 -0
- package/out/internal/index.js +9 -0
- package/out/view/frame.d.ts +7 -0
- package/out/view/frame.d.ts.map +1 -0
- package/out/view/frame.js +25 -0
- package/out/view/view.d.ts +3 -0
- package/out/view/view.d.ts.map +1 -1
- package/out/view/view.js +3 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @forge/bridge
|
|
2
2
|
|
|
3
|
+
## 3.5.0-next.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- ef55008: Add frame.onPropsUpdate to consume property changes for custom props enabled Frame components
|
|
8
|
+
|
|
9
|
+
For more information, see the [Frame component documentation](https://developer.atlassian.com/platform/forge/ui-kit/components/frame).
|
|
10
|
+
|
|
3
11
|
## 3.4.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/internal/index.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,UAAU,8BAEf,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getFrameId = void 0;
|
|
4
|
+
const bridge_1 = require("../bridge");
|
|
5
|
+
const callBridge = (0, bridge_1.getCallBridge)();
|
|
6
|
+
const getFrameId = () => {
|
|
7
|
+
return callBridge('getFrameId');
|
|
8
|
+
};
|
|
9
|
+
exports.getFrameId = getFrameId;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
declare type OnFramePropsUpdateHandler<TFrameProps> = (props: TFrameProps) => void;
|
|
2
|
+
declare type Unsubscribe = () => Promise<void>;
|
|
3
|
+
export declare const frame: {
|
|
4
|
+
onPropsUpdate: <TFrameProps extends Record<string, unknown>>(handler: OnFramePropsUpdateHandler<TFrameProps>) => Promise<Unsubscribe>;
|
|
5
|
+
};
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=frame.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frame.d.ts","sourceRoot":"","sources":["../../src/view/frame.ts"],"names":[],"mappings":"AAKA,aAAK,yBAAyB,CAAC,WAAW,IAAI,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;AAC3E,aAAK,WAAW,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;AA6BvC,eAAO,MAAM,KAAK;qHAjBf,QAAQ,WAAW,CAAC;CAmBtB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.frame = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const internal_1 = require("../internal");
|
|
6
|
+
const events_1 = require("../events");
|
|
7
|
+
const frameEventKey = (eventKey, frameId) => `frame:${eventKey}:${frameId}`;
|
|
8
|
+
const EVENT_KEY_FRAME_PROPS = 'props';
|
|
9
|
+
const EVENT_KEY_FRAME_LOADED = 'loaded';
|
|
10
|
+
const onPropsUpdate = (handler) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
11
|
+
const frameId = yield (0, internal_1.getFrameId)();
|
|
12
|
+
if (!frameId) {
|
|
13
|
+
throw new Error('Frame could not be found, please ensure the custom props enabled Frame component is set up correctly.');
|
|
14
|
+
}
|
|
15
|
+
const sub = events_1.events.on(frameEventKey(EVENT_KEY_FRAME_PROPS, frameId), handler);
|
|
16
|
+
const unsubscribe = () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
17
|
+
const subscription = yield sub;
|
|
18
|
+
subscription.unsubscribe();
|
|
19
|
+
});
|
|
20
|
+
void events_1.events.emit(frameEventKey(EVENT_KEY_FRAME_LOADED, frameId), { loaded: true });
|
|
21
|
+
return unsubscribe;
|
|
22
|
+
});
|
|
23
|
+
exports.frame = {
|
|
24
|
+
onPropsUpdate
|
|
25
|
+
};
|
package/out/view/view.d.ts
CHANGED
|
@@ -7,5 +7,8 @@ export declare const view: {
|
|
|
7
7
|
theme: {
|
|
8
8
|
enable: () => Promise<void>;
|
|
9
9
|
};
|
|
10
|
+
frame: {
|
|
11
|
+
onPropsUpdate: <TFrameProps extends Record<string, unknown>>(handler: (props: TFrameProps) => void) => Promise<() => Promise<void>>;
|
|
12
|
+
};
|
|
10
13
|
};
|
|
11
14
|
//# 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":"AAQA,eAAO,MAAM,IAAI;;;;;;;;;;;;CAQhB,CAAC"}
|
package/out/view/view.js
CHANGED
|
@@ -7,11 +7,13 @@ const refresh_1 = require("./refresh");
|
|
|
7
7
|
const createHistory_1 = require("./createHistory");
|
|
8
8
|
const getContext_1 = require("./getContext");
|
|
9
9
|
const theme_1 = require("./theme");
|
|
10
|
+
const frame_1 = require("./frame");
|
|
10
11
|
exports.view = {
|
|
11
12
|
submit: submit_1.submit,
|
|
12
13
|
close: close_1.close,
|
|
13
14
|
refresh: refresh_1.refresh,
|
|
14
15
|
createHistory: createHistory_1.createHistory,
|
|
15
16
|
getContext: getContext_1.getContext,
|
|
16
|
-
theme: theme_1.theme
|
|
17
|
+
theme: theme_1.theme,
|
|
18
|
+
frame: frame_1.frame
|
|
17
19
|
};
|