lucid-extension-sdk 0.0.100 → 0.0.101
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/package.json
CHANGED
package/sdk/commandtypes.d.ts
CHANGED
|
@@ -62,6 +62,7 @@ export declare const enum CommandName {
|
|
|
62
62
|
HideModal = "hm",
|
|
63
63
|
HidePanel = "hp",
|
|
64
64
|
HookCreateItems = "hci",
|
|
65
|
+
HookDeleteItems = "hdi",
|
|
65
66
|
HookSelection = "hs",
|
|
66
67
|
HookTextEdit = "hte",
|
|
67
68
|
ImportCards = "ic",
|
|
@@ -103,6 +104,7 @@ export declare const enum CommandName {
|
|
|
103
104
|
StartPDFUploadRequest = "pdf",
|
|
104
105
|
ThrowForTestCase = "throw",
|
|
105
106
|
UnhookCreateItems = "uci",
|
|
107
|
+
UnhookDeleteItems = "udi",
|
|
106
108
|
UnhookSelection = "us",
|
|
107
109
|
UnhookTextEdit = "ute"
|
|
108
110
|
}
|
|
@@ -286,6 +288,10 @@ export declare type CommandArgs = {
|
|
|
286
288
|
query: HookCreateItemsQuery;
|
|
287
289
|
result: HookCreateItemsResult;
|
|
288
290
|
};
|
|
291
|
+
[CommandName.HookDeleteItems]: {
|
|
292
|
+
query: HookDeleteItemsQuery;
|
|
293
|
+
result: HookDeleteItemsResult;
|
|
294
|
+
};
|
|
289
295
|
[CommandName.HookSelection]: {
|
|
290
296
|
query: HookSelectionQuery;
|
|
291
297
|
result: HookSelectionResult;
|
|
@@ -450,6 +456,10 @@ export declare type CommandArgs = {
|
|
|
450
456
|
query: UnhookCreateItemsQuery;
|
|
451
457
|
result: UnhookCreateItemsResult;
|
|
452
458
|
};
|
|
459
|
+
[CommandName.UnhookDeleteItems]: {
|
|
460
|
+
query: UnhookDeleteItemsQuery;
|
|
461
|
+
result: UnhookDeleteItemsResult;
|
|
462
|
+
};
|
|
453
463
|
[CommandName.UnhookSelection]: {
|
|
454
464
|
query: UnhookSelectionQuery;
|
|
455
465
|
result: UnhookSelectionResult;
|
|
@@ -824,6 +834,11 @@ export declare type HookCreateItemsQuery = {
|
|
|
824
834
|
'n': string;
|
|
825
835
|
};
|
|
826
836
|
export declare type HookCreateItemsResult = undefined;
|
|
837
|
+
export declare type HookDeleteItemsQuery = {
|
|
838
|
+
/** Name of the action for receiving events. Will be called with an array of strings of all recently deleted item IDs. */
|
|
839
|
+
'n': string;
|
|
840
|
+
};
|
|
841
|
+
export declare type HookDeleteItemsResult = undefined;
|
|
827
842
|
export declare type HookSelectionQuery = {
|
|
828
843
|
/** Name of the action for receiving events. Will be called with an array of strings of all selected item IDs. */
|
|
829
844
|
'n': string;
|
|
@@ -1092,6 +1107,11 @@ export declare type UnhookCreateItemsQuery = {
|
|
|
1092
1107
|
'n': string;
|
|
1093
1108
|
};
|
|
1094
1109
|
export declare type UnhookCreateItemsResult = undefined;
|
|
1110
|
+
export declare type UnhookDeleteItemsQuery = {
|
|
1111
|
+
/** Name of the action passed to HookDeleteItems */
|
|
1112
|
+
'n': string;
|
|
1113
|
+
};
|
|
1114
|
+
export declare type UnhookDeleteItemsResult = undefined;
|
|
1095
1115
|
export declare type UnhookSelectionQuery = {
|
|
1096
1116
|
/** Name of the action for receiving these events */
|
|
1097
1117
|
'n': string;
|
package/sdk/commandtypes.js
CHANGED
|
@@ -45,6 +45,7 @@ exports.commandTitles = new Map([
|
|
|
45
45
|
["hm" /* CommandName.HideModal */, 'HideModal'],
|
|
46
46
|
["hp" /* CommandName.HidePanel */, 'HidePanel'],
|
|
47
47
|
["hci" /* CommandName.HookCreateItems */, 'HookCreateItems'],
|
|
48
|
+
["hdi" /* CommandName.HookDeleteItems */, 'HookDeleteItems'],
|
|
48
49
|
["hs" /* CommandName.HookSelection */, 'HookSelection'],
|
|
49
50
|
["hte" /* CommandName.HookTextEdit */, 'HookTextEdit'],
|
|
50
51
|
["ic" /* CommandName.ImportCards */, 'ImportCards'],
|
|
@@ -84,6 +85,7 @@ exports.commandTitles = new Map([
|
|
|
84
85
|
["pdf" /* CommandName.StartPDFUploadRequest */, 'StartPDFUploadRequest'],
|
|
85
86
|
["throw" /* CommandName.ThrowForTestCase */, 'ThrowForTestCase'],
|
|
86
87
|
["uci" /* CommandName.UnhookCreateItems */, 'UnhookCreateItems'],
|
|
88
|
+
["udi" /* CommandName.UnhookDeleteItems */, 'UnhookDeleteItems'],
|
|
87
89
|
["us" /* CommandName.UnhookSelection */, 'UnhookSelection'],
|
|
88
90
|
["ute" /* CommandName.UnhookTextEdit */, 'UnhookTextEdit'],
|
|
89
91
|
]);
|
|
@@ -41,7 +41,6 @@ export declare class DocumentProxy extends ElementProxy {
|
|
|
41
41
|
* created
|
|
42
42
|
*
|
|
43
43
|
* - As part of a generated diagram, e.g. org chart
|
|
44
|
-
* - As a result of undo or redo
|
|
45
44
|
* - By another user on the same document
|
|
46
45
|
*
|
|
47
46
|
* @param callback
|
|
@@ -53,4 +52,20 @@ export declare class DocumentProxy extends ElementProxy {
|
|
|
53
52
|
*/
|
|
54
53
|
unhookCreateItems(handle: string): void;
|
|
55
54
|
readonly cardIntegrationConfigs: MapProxy<string, CardConfigProxy>;
|
|
55
|
+
/**
|
|
56
|
+
* Watch for new blocks, lines, or groups deleted from this document. The callback will
|
|
57
|
+
* be called with items deleted by the current user, but will not be called with items
|
|
58
|
+
* deleted
|
|
59
|
+
*
|
|
60
|
+
* - As part of a generated diagram, e.g. org chart
|
|
61
|
+
* - By another user on the same document
|
|
62
|
+
*
|
|
63
|
+
* @param callback
|
|
64
|
+
* @returns A handle that can be passed to `unhookDeleteItems`
|
|
65
|
+
*/
|
|
66
|
+
hookDeleteItems(callback: (itemIds: string[]) => void): string;
|
|
67
|
+
/**
|
|
68
|
+
* @param handle Return value from `hookDeleteItems`
|
|
69
|
+
*/
|
|
70
|
+
unhookDeleteItems(handle: string): void;
|
|
56
71
|
}
|
|
@@ -61,7 +61,6 @@ class DocumentProxy extends elementproxy_1.ElementProxy {
|
|
|
61
61
|
* created
|
|
62
62
|
*
|
|
63
63
|
* - As part of a generated diagram, e.g. org chart
|
|
64
|
-
* - As a result of undo or redo
|
|
65
64
|
* - By another user on the same document
|
|
66
65
|
*
|
|
67
66
|
* @param callback
|
|
@@ -82,6 +81,32 @@ class DocumentProxy extends elementproxy_1.ElementProxy {
|
|
|
82
81
|
this.client.deleteAction(handle);
|
|
83
82
|
this.client.sendCommand("uci" /* CommandName.UnhookCreateItems */, { 'n': handle });
|
|
84
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* Watch for new blocks, lines, or groups deleted from this document. The callback will
|
|
86
|
+
* be called with items deleted by the current user, but will not be called with items
|
|
87
|
+
* deleted
|
|
88
|
+
*
|
|
89
|
+
* - As part of a generated diagram, e.g. org chart
|
|
90
|
+
* - By another user on the same document
|
|
91
|
+
*
|
|
92
|
+
* @param callback
|
|
93
|
+
* @returns A handle that can be passed to `unhookDeleteItems`
|
|
94
|
+
*/
|
|
95
|
+
hookDeleteItems(callback) {
|
|
96
|
+
const actionName = DocumentProxy.getNextHookName();
|
|
97
|
+
this.client.registerAction(actionName, (msg) => {
|
|
98
|
+
callback(msg['ids']);
|
|
99
|
+
});
|
|
100
|
+
this.client.sendCommand("hdi" /* CommandName.HookDeleteItems */, { 'n': actionName });
|
|
101
|
+
return actionName;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* @param handle Return value from `hookDeleteItems`
|
|
105
|
+
*/
|
|
106
|
+
unhookDeleteItems(handle) {
|
|
107
|
+
this.client.deleteAction(handle);
|
|
108
|
+
this.client.sendCommand("udi" /* CommandName.UnhookDeleteItems */, { 'n': handle });
|
|
109
|
+
}
|
|
85
110
|
}
|
|
86
111
|
exports.DocumentProxy = DocumentProxy;
|
|
87
112
|
DocumentProxy.nextHookId = 0;
|