@contrail/extensions-sdk 1.0.10 → 1.0.12
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/lib/apps/boards.d.ts +3 -1
- package/lib/apps/boards.js +8 -0
- package/package.json +1 -1
package/lib/apps/boards.d.ts
CHANGED
|
@@ -3,7 +3,8 @@ export declare enum BoardCommand {
|
|
|
3
3
|
ADD_ELEMENTS = "board:add_elements",
|
|
4
4
|
DELETE_ELEMENTS = "board:delete_elements",
|
|
5
5
|
MODIFY_ELEMENTS = "board:modify_elements",
|
|
6
|
-
GET_ELEMENTS = "board:get_elements"
|
|
6
|
+
GET_ELEMENTS = "board:get_elements",
|
|
7
|
+
RECOLOR_IMAGES = "board:recolor_images"
|
|
7
8
|
}
|
|
8
9
|
export interface BoardDocumentElement extends DocumentElement {
|
|
9
10
|
[key: string]: any;
|
|
@@ -23,6 +24,7 @@ export declare class BoardsApp {
|
|
|
23
24
|
static deleteElements(elements: Array<BoardDocumentElement>): void;
|
|
24
25
|
static modifyElements(changeObjects: Array<BoardDocumentElementChanges>): void;
|
|
25
26
|
static getElements(criteria: object): Promise<Array<DocumentElement>>;
|
|
27
|
+
static recolorImages(imageElements: Array<DocumentElement>, hexCode: string): Promise<Array<DocumentElement>>;
|
|
26
28
|
private static validateBoardContext;
|
|
27
29
|
private static validateAndReturnResults;
|
|
28
30
|
}
|
package/lib/apps/boards.js
CHANGED
|
@@ -18,6 +18,7 @@ var BoardCommand;
|
|
|
18
18
|
BoardCommand["DELETE_ELEMENTS"] = "board:delete_elements";
|
|
19
19
|
BoardCommand["MODIFY_ELEMENTS"] = "board:modify_elements";
|
|
20
20
|
BoardCommand["GET_ELEMENTS"] = "board:get_elements";
|
|
21
|
+
BoardCommand["RECOLOR_IMAGES"] = "board:recolor_images";
|
|
21
22
|
})(BoardCommand = exports.BoardCommand || (exports.BoardCommand = {}));
|
|
22
23
|
class BoardsApp {
|
|
23
24
|
static getCurrentBoard() {
|
|
@@ -50,6 +51,13 @@ class BoardsApp {
|
|
|
50
51
|
return this.validateAndReturnResults(results);
|
|
51
52
|
});
|
|
52
53
|
}
|
|
54
|
+
static recolorImages(imageElements, hexCode) {
|
|
55
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
56
|
+
BoardsApp.validateBoardContext();
|
|
57
|
+
const results = yield (0, actions_1.getExtensionActions)().sendMessageToHost({ command: BoardCommand.RECOLOR_IMAGES, data: { imageElements, hexCode } });
|
|
58
|
+
return this.validateAndReturnResults(results);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
53
61
|
static validateBoardContext() {
|
|
54
62
|
const context = (0, app_context_1.getAppContext)();
|
|
55
63
|
if (context.appContext.vibeIQApp !== app_context_1.VibeIQAppType.BOARDS || !context.appContext.board) {
|
package/package.json
CHANGED