@forge/bridge 4.1.1 → 4.2.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 +12 -0
- package/out/view/view.d.ts +0 -3
- package/out/view/view.d.ts.map +1 -1
- package/out/view/view.js +0 -2
- package/package.json +1 -1
- package/out/view/frame.d.ts +0 -7
- package/out/view/frame.d.ts.map +0 -1
- package/out/view/frame.js +0 -24
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @forge/bridge
|
|
2
2
|
|
|
3
|
+
## 4.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 88de75c: Frame methods on `view` is no longer supported and are being removed for the release of the Frame component into Preview.
|
|
8
|
+
|
|
9
|
+
## 4.2.0-next.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 88de75c: Frame methods on `view` is no longer supported and are being removed for the release of the Frame component into Preview.
|
|
14
|
+
|
|
3
15
|
## 4.1.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/out/view/view.d.ts
CHANGED
|
@@ -7,9 +7,6 @@ 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
|
-
};
|
|
13
10
|
changeWindowTitle: (title: string) => Promise<void>;
|
|
14
11
|
};
|
|
15
12
|
//# 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
|
@@ -8,7 +8,6 @@ const createHistory_1 = require("./createHistory");
|
|
|
8
8
|
const getContext_1 = require("./getContext");
|
|
9
9
|
const changeWindowTitle_1 = require("./changeWindowTitle");
|
|
10
10
|
const theme_1 = require("./theme");
|
|
11
|
-
const frame_1 = require("./frame");
|
|
12
11
|
exports.view = {
|
|
13
12
|
submit: submit_1.submit,
|
|
14
13
|
close: close_1.close,
|
|
@@ -16,6 +15,5 @@ exports.view = {
|
|
|
16
15
|
createHistory: createHistory_1.createHistory,
|
|
17
16
|
getContext: getContext_1.getContext,
|
|
18
17
|
theme: theme_1.theme,
|
|
19
|
-
frame: frame_1.frame,
|
|
20
18
|
changeWindowTitle: changeWindowTitle_1.changeWindowTitle
|
|
21
19
|
};
|
package/package.json
CHANGED
package/out/view/frame.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
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
|
package/out/view/frame.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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"}
|
package/out/view/frame.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.frame = void 0;
|
|
4
|
-
const internal_1 = require("../internal");
|
|
5
|
-
const events_1 = require("../events");
|
|
6
|
-
const frameEventKey = (eventKey, frameId) => `frame:${eventKey}:${frameId}`;
|
|
7
|
-
const EVENT_KEY_FRAME_PROPS = 'props';
|
|
8
|
-
const EVENT_KEY_FRAME_LOADED = 'loaded';
|
|
9
|
-
const onPropsUpdate = async (handler) => {
|
|
10
|
-
const frameId = await (0, internal_1.getFrameId)();
|
|
11
|
-
if (!frameId) {
|
|
12
|
-
throw new Error('Frame could not be found, please ensure the custom props enabled Frame component is set up correctly.');
|
|
13
|
-
}
|
|
14
|
-
const sub = events_1.events.on(frameEventKey(EVENT_KEY_FRAME_PROPS, frameId), handler);
|
|
15
|
-
const unsubscribe = async () => {
|
|
16
|
-
const subscription = await sub;
|
|
17
|
-
subscription.unsubscribe();
|
|
18
|
-
};
|
|
19
|
-
void events_1.events.emit(frameEventKey(EVENT_KEY_FRAME_LOADED, frameId), { loaded: true });
|
|
20
|
-
return unsubscribe;
|
|
21
|
-
};
|
|
22
|
-
exports.frame = {
|
|
23
|
-
onPropsUpdate
|
|
24
|
-
};
|