@forge/dashboards-bridge 0.0.1-experimental-2cc5dec → 0.1.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/out/widgets/edit/index.d.ts +11 -0
- package/out/widgets/edit/index.d.ts.map +1 -0
- package/out/widgets/edit/index.js +13 -0
- package/out/widgets/edit/onProductSave.d.ts +3 -0
- package/out/widgets/edit/onProductSave.d.ts.map +1 -0
- package/out/widgets/edit/onProductSave.js +17 -0
- package/out/widgets/edit/onSave.d.ts +3 -0
- package/out/widgets/edit/onSave.d.ts.map +1 -0
- package/out/widgets/edit/onSave.js +20 -0
- package/out/widgets/edit/onSaveError.d.ts +3 -0
- package/out/widgets/edit/onSaveError.d.ts.map +1 -0
- package/out/widgets/edit/onSaveError.js +17 -0
- package/out/widgets/edit/updateConfig.d.ts +3 -0
- package/out/widgets/edit/updateConfig.d.ts.map +1 -0
- package/out/widgets/edit/updateConfig.js +15 -0
- package/out/widgets/edit/utils/get-context-extension.d.ts +12 -0
- package/out/widgets/edit/utils/get-context-extension.d.ts.map +1 -0
- package/out/widgets/edit/utils/get-context-extension.js +12 -0
- package/out/widgets/edit/utils/get-widget-edit-bridge.d.ts +7 -0
- package/out/widgets/edit/utils/get-widget-edit-bridge.d.ts.map +1 -0
- package/out/widgets/edit/utils/get-widget-edit-bridge.js +6 -0
- package/out/widgets/index.d.ts +3 -4
- package/out/widgets/index.d.ts.map +1 -1
- package/out/widgets/index.js +5 -7
- package/out/widgets/types.d.ts +20 -2
- package/out/widgets/types.d.ts.map +1 -1
- package/out/widgets/view/index.d.ts +5 -0
- package/out/widgets/view/index.d.ts.map +1 -0
- package/out/widgets/view/index.js +7 -0
- package/out/widgets/view/setPreviewConfig.d.ts +3 -0
- package/out/widgets/view/setPreviewConfig.d.ts.map +1 -0
- package/out/widgets/view/setPreviewConfig.js +15 -0
- package/out/widgets/view/utils/get-widget-bridge.d.ts +4 -0
- package/out/widgets/view/utils/get-widget-bridge.d.ts.map +1 -0
- package/out/widgets/view/utils/get-widget-bridge.js +6 -0
- package/package.json +5 -2
- package/out/widgets/setOnSave.d.ts +0 -3
- package/out/widgets/setOnSave.d.ts.map +0 -1
- package/out/widgets/setOnSave.js +0 -15
- package/out/widgets/setPreviewData.d.ts +0 -3
- package/out/widgets/setPreviewData.d.ts.map +0 -1
- package/out/widgets/setPreviewData.js +0 -15
- package/out/widgets/updateData.d.ts +0 -3
- package/out/widgets/updateData.d.ts.map +0 -1
- package/out/widgets/updateData.js +0 -15
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { onSave } from './onSave';
|
|
2
|
+
import { onProductSave } from './onProductSave';
|
|
3
|
+
import { onSaveError } from './onSaveError';
|
|
4
|
+
import { updateConfig } from './updateConfig';
|
|
5
|
+
export declare const widgetEdit: {
|
|
6
|
+
onSave: typeof onSave;
|
|
7
|
+
onProductSave: typeof onProductSave;
|
|
8
|
+
onSaveError: typeof onSaveError;
|
|
9
|
+
updateConfig: typeof updateConfig;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/widgets/edit/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,eAAO,MAAM,UAAU;;;;;CAKtB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.widgetEdit = void 0;
|
|
4
|
+
const onSave_1 = require("./onSave");
|
|
5
|
+
const onProductSave_1 = require("./onProductSave");
|
|
6
|
+
const onSaveError_1 = require("./onSaveError");
|
|
7
|
+
const updateConfig_1 = require("./updateConfig");
|
|
8
|
+
exports.widgetEdit = {
|
|
9
|
+
onSave: onSave_1.onSave,
|
|
10
|
+
onProductSave: onProductSave_1.onProductSave,
|
|
11
|
+
onSaveError: onSaveError_1.onSaveError,
|
|
12
|
+
updateConfig: updateConfig_1.updateConfig
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onProductSave.d.ts","sourceRoot":"","sources":["../../../src/widgets/edit/onProductSave.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAqBzC,wBAAsB,aAAa,CAAC,aAAa,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAW/E"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.onProductSave = void 0;
|
|
4
|
+
const errors_1 = require("../../errors");
|
|
5
|
+
const get_widget_edit_bridge_1 = require("./utils/get-widget-edit-bridge");
|
|
6
|
+
const get_context_extension_1 = require("./utils/get-context-extension");
|
|
7
|
+
async function onProductSave(onProductSave) {
|
|
8
|
+
try {
|
|
9
|
+
const { extension: { context: widgetContext }, context } = await (0, get_context_extension_1.getSplitContextExtension)();
|
|
10
|
+
const bridge = await (0, get_widget_edit_bridge_1.getWidgetEditBridge)();
|
|
11
|
+
bridge.onProductSave((config) => onProductSave(config, widgetContext, context));
|
|
12
|
+
}
|
|
13
|
+
catch (err) {
|
|
14
|
+
throw new errors_1.BridgeAPIError('Unable to set widgetEdit.onProductSave: ' + err.message);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.onProductSave = onProductSave;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onSave.d.ts","sourceRoot":"","sources":["../../../src/widgets/edit/onSave.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAclC,wBAAsB,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAoB1D"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.onSave = void 0;
|
|
4
|
+
const errors_1 = require("../../errors");
|
|
5
|
+
const get_widget_edit_bridge_1 = require("./utils/get-widget-edit-bridge");
|
|
6
|
+
const get_context_extension_1 = require("./utils/get-context-extension");
|
|
7
|
+
async function onSave(onSave) {
|
|
8
|
+
try {
|
|
9
|
+
const { extension: { context: widgetContext }, context } = await (0, get_context_extension_1.getSplitContextExtension)();
|
|
10
|
+
const bridge = await (0, get_widget_edit_bridge_1.getWidgetEditBridge)();
|
|
11
|
+
bridge.onSave((config, widgetId) => onSave(config, {
|
|
12
|
+
...widgetContext,
|
|
13
|
+
widgetId
|
|
14
|
+
}, context));
|
|
15
|
+
}
|
|
16
|
+
catch (err) {
|
|
17
|
+
throw new errors_1.BridgeAPIError('Unable to set widgetEdit.onSave: ' + err.message);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.onSave = onSave;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onSaveError.d.ts","sourceRoot":"","sources":["../../../src/widgets/edit/onSaveError.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAevC,wBAAsB,WAAW,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAYzE"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.onSaveError = void 0;
|
|
4
|
+
const errors_1 = require("../../errors");
|
|
5
|
+
const get_widget_edit_bridge_1 = require("./utils/get-widget-edit-bridge");
|
|
6
|
+
const get_context_extension_1 = require("./utils/get-context-extension");
|
|
7
|
+
async function onSaveError(onSaveError) {
|
|
8
|
+
try {
|
|
9
|
+
const { extension: { context: widgetContext }, context } = await (0, get_context_extension_1.getSplitContextExtension)();
|
|
10
|
+
const bridge = await (0, get_widget_edit_bridge_1.getWidgetEditBridge)();
|
|
11
|
+
bridge.onSaveError((error) => onSaveError(error, widgetContext, context));
|
|
12
|
+
}
|
|
13
|
+
catch (err) {
|
|
14
|
+
throw new errors_1.BridgeAPIError('Unable to set widgetEdit.onSaveError: ' + err.message);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.onSaveError = onSaveError;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"updateConfig.d.ts","sourceRoot":"","sources":["../../../src/widgets/edit/updateConfig.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAc7C,wBAAsB,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAOtE"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateConfig = void 0;
|
|
4
|
+
const errors_1 = require("../../errors");
|
|
5
|
+
const get_widget_edit_bridge_1 = require("./utils/get-widget-edit-bridge");
|
|
6
|
+
async function updateConfig(config) {
|
|
7
|
+
try {
|
|
8
|
+
const bridge = await (0, get_widget_edit_bridge_1.getWidgetEditBridge)();
|
|
9
|
+
bridge.updateConfig(config);
|
|
10
|
+
}
|
|
11
|
+
catch (err) {
|
|
12
|
+
throw new errors_1.BridgeAPIError('Unable to update config: ' + err.message);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.updateConfig = updateConfig;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Layout, WidgetConfig, WidgetContext, Context } from '../../types';
|
|
2
|
+
export declare type WidgetContextExtension<Config extends WidgetConfig = WidgetConfig> = {
|
|
3
|
+
layout: Layout;
|
|
4
|
+
context: WidgetContext;
|
|
5
|
+
entryPoint?: 'edit';
|
|
6
|
+
config: Config;
|
|
7
|
+
};
|
|
8
|
+
export declare const getSplitContextExtension: <Config extends WidgetConfig>() => Promise<{
|
|
9
|
+
extension: WidgetContextExtension<Config>;
|
|
10
|
+
context: Context;
|
|
11
|
+
}>;
|
|
12
|
+
//# sourceMappingURL=get-context-extension.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-context-extension.d.ts","sourceRoot":"","sources":["../../../../src/widgets/edit/utils/get-context-extension.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAGhF,oBAAY,sBAAsB,CAAC,MAAM,SAAS,YAAY,GAAG,YAAY,IAAI;IAC/E,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,aAAa,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,wBAAwB;;aAE1B,OAAO;EAOjB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSplitContextExtension = void 0;
|
|
4
|
+
const bridge_1 = require("@forge/bridge");
|
|
5
|
+
const getSplitContextExtension = async () => {
|
|
6
|
+
const { extension, ...rest } = await bridge_1.view.getContext();
|
|
7
|
+
return {
|
|
8
|
+
extension: extension,
|
|
9
|
+
context: rest
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
exports.getSplitContextExtension = getSplitContextExtension;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const getWidgetEditBridge: () => Promise<{
|
|
2
|
+
onSave: (onSave: import("../../types").OnSaveBridge) => void;
|
|
3
|
+
onProductSave: (onProductSave: import("../../types").OnProductSaveBridge) => void;
|
|
4
|
+
onSaveError: (onSaveError: import("../../types").OnSaveErrorBridge) => void;
|
|
5
|
+
updateConfig: (config: import("../../types").WidgetConfig) => void;
|
|
6
|
+
}>;
|
|
7
|
+
//# sourceMappingURL=get-widget-edit-bridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-widget-edit-bridge.d.ts","sourceRoot":"","sources":["../../../../src/widgets/edit/utils/get-widget-edit-bridge.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB;;;;;EAA4C,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getWidgetEditBridge = void 0;
|
|
4
|
+
const bridge_1 = require("../../../bridge");
|
|
5
|
+
const getWidgetEditBridge = () => (0, bridge_1.getCallBridge)()('getWidgetEditApi');
|
|
6
|
+
exports.getWidgetEditBridge = getWidgetEditBridge;
|
package/out/widgets/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export type { WidgetData, OnSave } from './types';
|
|
1
|
+
export { widgetEdit } from './edit';
|
|
2
|
+
export { widget } from './view';
|
|
3
|
+
export type { WidgetConfig, Layout, WidgetContext, OnSave, OnProductSave, OnSaveError } from './types';
|
|
5
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/widgets/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/widgets/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,YAAY,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC"}
|
package/out/widgets/index.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
var
|
|
5
|
-
Object.defineProperty(exports, "
|
|
6
|
-
var
|
|
7
|
-
Object.defineProperty(exports, "
|
|
8
|
-
var updateData_1 = require("./updateData");
|
|
9
|
-
Object.defineProperty(exports, "updateData", { enumerable: true, get: function () { return updateData_1.updateData; } });
|
|
3
|
+
exports.widget = exports.widgetEdit = void 0;
|
|
4
|
+
var edit_1 = require("./edit");
|
|
5
|
+
Object.defineProperty(exports, "widgetEdit", { enumerable: true, get: function () { return edit_1.widgetEdit; } });
|
|
6
|
+
var view_1 = require("./view");
|
|
7
|
+
Object.defineProperty(exports, "widget", { enumerable: true, get: function () { return view_1.widget; } });
|
package/out/widgets/types.d.ts
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
-
export declare type
|
|
2
|
-
export declare type
|
|
1
|
+
export declare type WidgetConfig = Record<string, unknown>;
|
|
2
|
+
export declare type Layout = {
|
|
3
|
+
width: number;
|
|
4
|
+
height: number;
|
|
5
|
+
rowSpan?: 'xsmall' | 'small' | 'medium' | 'large';
|
|
6
|
+
columnSpan?: 3 | 4 | 6 | 8 | 12;
|
|
7
|
+
};
|
|
8
|
+
export declare type WidgetContext = {
|
|
9
|
+
widgetId?: string;
|
|
10
|
+
dashboardId: string;
|
|
11
|
+
};
|
|
12
|
+
export declare type Context = Record<string, unknown>;
|
|
13
|
+
export declare type OnSave = (config: WidgetConfig, widgetContext: Omit<WidgetContext, 'widgetId'> & {
|
|
14
|
+
widgetId: string;
|
|
15
|
+
}, context: Context) => Promise<void>;
|
|
16
|
+
export declare type OnSaveBridge = (config: WidgetConfig, widgetId: string, context: Context) => Promise<void>;
|
|
17
|
+
export declare type OnProductSave = (config: WidgetConfig, widgetContext: WidgetContext, context: Context) => Promise<WidgetConfig | null | undefined>;
|
|
18
|
+
export declare type OnProductSaveBridge = (config: WidgetConfig) => Promise<WidgetConfig | null | undefined>;
|
|
19
|
+
export declare type OnSaveError = (error: Error, widgetContext: WidgetContext, context: Context) => void;
|
|
20
|
+
export declare type OnSaveErrorBridge = (error: Error) => void;
|
|
3
21
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/widgets/types.ts"],"names":[],"mappings":"AAAA,oBAAY,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/widgets/types.ts"],"names":[],"mappings":"AAAA,oBAAY,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEnD,oBAAY,MAAM,GAAG;IAInB,KAAK,EAAE,MAAM,CAAC;IAId,MAAM,EAAE,MAAM,CAAC;IAIf,OAAO,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IAIlD,UAAU,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;CACjC,CAAC;AAEF,oBAAY,aAAa,GAAG;IAK1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAIlB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,oBAAY,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE9C,oBAAY,MAAM,GAAG,CACnB,MAAM,EAAE,YAAY,EACpB,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,EACrE,OAAO,EAAE,OAAO,KACb,OAAO,CAAC,IAAI,CAAC,CAAC;AACnB,oBAAY,YAAY,GAAG,CAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAEvG,oBAAY,aAAa,GAAG,CAC1B,MAAM,EAAE,YAAY,EACpB,aAAa,EAAE,aAAa,EAC5B,OAAO,EAAE,OAAO,KACb,OAAO,CAAC,YAAY,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;AAC9C,oBAAY,mBAAmB,GAAG,CAAC,MAAM,EAAE,YAAY,KAAK,OAAO,CAAC,YAAY,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;AAErG,oBAAY,WAAW,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;AACjG,oBAAY,iBAAiB,GAAG,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/widgets/view/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,eAAO,MAAM,MAAM;;CAElB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setPreviewConfig.d.ts","sourceRoot":"","sources":["../../../src/widgets/view/setPreviewConfig.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAe7C,wBAAsB,gBAAgB,CAAC,aAAa,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAOjF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setPreviewConfig = void 0;
|
|
4
|
+
const errors_1 = require("../../errors");
|
|
5
|
+
const get_widget_bridge_1 = require("./utils/get-widget-bridge");
|
|
6
|
+
async function setPreviewConfig(previewConfig) {
|
|
7
|
+
try {
|
|
8
|
+
const bridge = await (0, get_widget_bridge_1.getWidgetBridge)();
|
|
9
|
+
bridge.setPreviewConfig(previewConfig);
|
|
10
|
+
}
|
|
11
|
+
catch (err) {
|
|
12
|
+
throw new errors_1.BridgeAPIError('Unable to set preview config: ' + err.message);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.setPreviewConfig = setPreviewConfig;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-widget-bridge.d.ts","sourceRoot":"","sources":["../../../../src/widgets/view/utils/get-widget-bridge.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe;;EAAwC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getWidgetBridge = void 0;
|
|
4
|
+
const bridge_1 = require("../../../bridge");
|
|
5
|
+
const getWidgetBridge = () => (0, bridge_1.getCallBridge)()('getWidgetApi');
|
|
6
|
+
exports.getWidgetBridge = getWidgetBridge;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/dashboards-bridge",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.1.0-next.0",
|
|
4
4
|
"description": "Forge Dashboards custom bridge API",
|
|
5
5
|
"author": "Atlassian",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
@@ -13,5 +13,8 @@
|
|
|
13
13
|
},
|
|
14
14
|
"publishConfig": {
|
|
15
15
|
"registry": "https://packages.atlassian.com/api/npm/npm-public/"
|
|
16
|
+
},
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@forge/bridge": "^5.2.0-next.0"
|
|
16
19
|
}
|
|
17
|
-
}
|
|
20
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setOnSave.d.ts","sourceRoot":"","sources":["../../src/widgets/setOnSave.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEjC,wBAAsB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAQ7D"}
|
package/out/widgets/setOnSave.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setOnSave = void 0;
|
|
4
|
-
const errors_1 = require("../errors");
|
|
5
|
-
const bridge_1 = require("../bridge");
|
|
6
|
-
async function setOnSave(onSave) {
|
|
7
|
-
const callBridge = (0, bridge_1.getCallBridge)();
|
|
8
|
-
try {
|
|
9
|
-
await callBridge('setOnSave', onSave);
|
|
10
|
-
}
|
|
11
|
-
catch (err) {
|
|
12
|
-
throw new errors_1.BridgeAPIError('Unable to set save action: ' + err.message);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
exports.setOnSave = setOnSave;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setPreviewData.d.ts","sourceRoot":"","sources":["../../src/widgets/setPreviewData.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,wBAAsB,cAAc,CAAC,WAAW,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAQ3E"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setPreviewData = void 0;
|
|
4
|
-
const errors_1 = require("../errors");
|
|
5
|
-
const bridge_1 = require("../bridge");
|
|
6
|
-
async function setPreviewData(previewData) {
|
|
7
|
-
const callBridge = (0, bridge_1.getCallBridge)();
|
|
8
|
-
try {
|
|
9
|
-
await callBridge('setPreviewData', previewData);
|
|
10
|
-
}
|
|
11
|
-
catch (err) {
|
|
12
|
-
throw new errors_1.BridgeAPIError('Unable to set preview data: ' + err.message);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
exports.setPreviewData = setPreviewData;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"updateData.d.ts","sourceRoot":"","sources":["../../src/widgets/updateData.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,wBAAsB,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAQhE"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateData = void 0;
|
|
4
|
-
const errors_1 = require("../errors");
|
|
5
|
-
const bridge_1 = require("../bridge");
|
|
6
|
-
async function updateData(data) {
|
|
7
|
-
const callBridge = (0, bridge_1.getCallBridge)();
|
|
8
|
-
try {
|
|
9
|
-
await callBridge('updateData', data);
|
|
10
|
-
}
|
|
11
|
-
catch (err) {
|
|
12
|
-
throw new errors_1.BridgeAPIError('Unable to update data: ' + err.message);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
exports.updateData = updateData;
|