lucid-extension-sdk 0.0.6 → 0.0.13
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/interop.d.ts +4 -0
- package/package.json +3 -3
- package/sdk/commandtypes.d.ts +241 -5
- package/sdk/commandtypes.js +6 -0
- package/sdk/core/data/referencekeys/serializedreferencekey.d.ts +6 -0
- package/sdk/core/data/referencekeys/serializedreferencekey.js +17 -1
- package/sdk/core/jsonserializable.d.ts +4 -0
- package/sdk/data/collectionproxy.d.ts +2 -2
- package/sdk/data/collectionproxy.js +2 -2
- package/sdk/data/datasourceproxy.d.ts +9 -3
- package/sdk/data/datasourceproxy.js +9 -3
- package/sdk/data/referencekeydefinition.d.ts +30 -2
- package/sdk/data/referencekeydefinition.js +26 -1
- package/sdk/data/referencekeyproxy.d.ts +4 -0
- package/sdk/data/referencekeyproxy.js +25 -0
- package/sdk/data/schemadefinition.d.ts +13 -0
- package/sdk/data/schemadefinition.js +13 -1
- package/sdk/document/blockclasses/blockproxyregistry.js +2 -1
- package/sdk/document/blockclasses/customblockproxy.d.ts +6 -0
- package/sdk/document/blockclasses/customblockproxy.js +24 -0
- package/sdk/document/blockdefinition.d.ts +4 -2
- package/sdk/document/blockproxy.d.ts +20 -4
- package/sdk/document/blockproxy.js +31 -4
- package/sdk/document/documentproxy.d.ts +22 -2
- package/sdk/document/documentproxy.js +33 -2
- package/sdk/document/elementproxy.d.ts +26 -18
- package/sdk/document/elementproxy.js +26 -29
- package/sdk/document/groupproxy.d.ts +1 -1
- package/sdk/document/groupproxy.js +1 -1
- package/sdk/document/itemproxy.d.ts +5 -5
- package/sdk/document/itemproxy.js +5 -5
- package/sdk/document/lineproxy.d.ts +32 -6
- package/sdk/document/lineproxy.js +52 -6
- package/sdk/document/linetextareapositioning.d.ts +31 -0
- package/sdk/document/linetextareapositioning.js +30 -0
- package/sdk/document/mapproxy.d.ts +7 -1
- package/sdk/document/mapproxy.js +8 -0
- package/sdk/document/propertystoreproxy.d.ts +21 -0
- package/sdk/document/propertystoreproxy.js +37 -0
- package/sdk/document/shapedataproxy.d.ts +5 -0
- package/sdk/document/shapedataproxy.js +5 -0
- package/sdk/editorclient.d.ts +8 -2
- package/sdk/editorclient.js +51 -9
- package/sdk/index.d.ts +1 -0
- package/sdk/index.js +1 -0
- package/sdk/ui/alertmodal.d.ts +2 -3
- package/sdk/ui/alertmodal.js +2 -3
- package/sdk/ui/iframeui.d.ts +57 -0
- package/sdk/ui/iframeui.js +82 -0
- package/sdk/ui/modal.d.ts +11 -33
- package/sdk/ui/modal.js +9 -46
- package/sdk/ui/panel.d.ts +43 -0
- package/sdk/ui/panel.js +50 -0
- package/sdk/ui/viewport.d.ts +45 -0
- package/sdk/ui/viewport.js +80 -0
package/interop.d.ts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
/** @ignore */
|
|
1
2
|
declare namespace lucid {
|
|
2
3
|
export function executeCommand(name: string, params: any): any;
|
|
3
4
|
export function listen(msg: any): void;
|
|
5
|
+
export function getPackageId(): string;
|
|
6
|
+
export function getVersion(): string;
|
|
4
7
|
}
|
|
5
8
|
|
|
9
|
+
/** @ignore */
|
|
6
10
|
declare namespace console {
|
|
7
11
|
export function log(...args: any[]): void;
|
|
8
12
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lucid-extension-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
4
|
"description": "Utility classes for writing Lucid Software editor extensions",
|
|
5
5
|
"main": "sdk/index.js",
|
|
6
6
|
"types": "sdk/index.d.ts",
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
"license": "Apache-2.0",
|
|
9
9
|
"declaration": true,
|
|
10
10
|
"devDependencies": {
|
|
11
|
-
"@bazel/typescript": "2.0.1",
|
|
12
11
|
"@types/jasmine": "^3.10.3",
|
|
13
12
|
"@types/node": "^16.11.11",
|
|
14
|
-
"typedoc": "^0.22.
|
|
13
|
+
"typedoc": "^0.22.15",
|
|
14
|
+
"typedoc-plugin-markdown": "^3.12.1",
|
|
15
15
|
"typescript": "4.3.5"
|
|
16
16
|
}
|
|
17
17
|
}
|
package/sdk/commandtypes.d.ts
CHANGED
|
@@ -5,9 +5,19 @@ import { JsonObject, JsonSerializable } from './core/jsonserializable';
|
|
|
5
5
|
import { LinearOffsetType } from './core/offsettype';
|
|
6
6
|
import { SerializedDataError } from './core/serializeddataerror';
|
|
7
7
|
import { ShapeDataInheritance } from './core/shapedatainheritance';
|
|
8
|
+
import { SerializedLineTextAreaPositioning } from './document/linetextareapositioning';
|
|
8
9
|
import { Box, Point } from './math';
|
|
9
10
|
import { MenuLocation, MenuType } from './ui/menu';
|
|
11
|
+
import { PanelLocation } from './ui/panel';
|
|
12
|
+
/**
|
|
13
|
+
* The lucid-extension-sdk library interacts with core Lucid products through this set of possible commands.
|
|
14
|
+
* Typically, an extension author will not need to access any of these commands directly, as they are all
|
|
15
|
+
* exposed through appropriate classes and methods elsewhere in this SDK.
|
|
16
|
+
*
|
|
17
|
+
* To use these directly, use [EditorClient.sendCommand](#classes_editorclient-EditorClient_sendcommand).
|
|
18
|
+
*/
|
|
10
19
|
export declare const enum CommandName {
|
|
20
|
+
AddLineTextArea = "alta",
|
|
11
21
|
AddMenuItem = "ami",
|
|
12
22
|
AddShapeData = "asd",
|
|
13
23
|
AnimateViewport = "av",
|
|
@@ -35,6 +45,10 @@ export declare const enum CommandName {
|
|
|
35
45
|
GetSelection = "gs",
|
|
36
46
|
GetShapeData = "gsd",
|
|
37
47
|
HideModal = "hm",
|
|
48
|
+
HidePanel = "hp",
|
|
49
|
+
HookCreateItems = "hci",
|
|
50
|
+
HookSelection = "hs",
|
|
51
|
+
HookTextEdit = "hte",
|
|
38
52
|
KillExtension = "k",
|
|
39
53
|
ListBlocks = "lb",
|
|
40
54
|
ListCollectionFields = "lcf",
|
|
@@ -52,7 +66,9 @@ export declare const enum CommandName {
|
|
|
52
66
|
LogForTestCase = "log",
|
|
53
67
|
OffsetItems = "oi",
|
|
54
68
|
PatchDataItems = "pdi",
|
|
69
|
+
RegisterPanel = "rp",
|
|
55
70
|
ReloadExtension = "r",
|
|
71
|
+
SendOAuthRequest = "oauth",
|
|
56
72
|
SendUIMessage = "suim",
|
|
57
73
|
SendXHR = "xhr",
|
|
58
74
|
SetCurrentPage = "scp",
|
|
@@ -60,12 +76,21 @@ export declare const enum CommandName {
|
|
|
60
76
|
SetReferenceKey = "srk",
|
|
61
77
|
SetShapeData = "ssd",
|
|
62
78
|
ShowModal = "sm",
|
|
63
|
-
|
|
79
|
+
ShowPanel = "spn",
|
|
80
|
+
SleepForTestCase = "sleep",
|
|
81
|
+
UnhookCreateItems = "uci",
|
|
82
|
+
UnhookSelection = "us",
|
|
83
|
+
UnhookTextEdit = "ute"
|
|
64
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* This is a type declaration whose purpose is to allow TypeScript to enforce the correct parameter and
|
|
87
|
+
* return types from [EditorClient.sendCommand](#classes_editorclient-EditorClient_sendcommand) based on
|
|
88
|
+
* which command name you pass in as the first parameter.
|
|
89
|
+
*/
|
|
65
90
|
export declare type CommandArgs = {
|
|
66
|
-
[CommandName.
|
|
67
|
-
query:
|
|
68
|
-
result:
|
|
91
|
+
[CommandName.AddLineTextArea]: {
|
|
92
|
+
query: AddLineTextAreaQuery;
|
|
93
|
+
result: AddLineTextAreaResult;
|
|
69
94
|
};
|
|
70
95
|
[CommandName.AddMenuItem]: {
|
|
71
96
|
query: AddMenuItemQuery;
|
|
@@ -75,6 +100,10 @@ export declare type CommandArgs = {
|
|
|
75
100
|
query: AddShapeDataQuery;
|
|
76
101
|
result: AddShapeDataResult;
|
|
77
102
|
};
|
|
103
|
+
[CommandName.AnimateViewport]: {
|
|
104
|
+
query: AnimateViewportQuery;
|
|
105
|
+
result: AnimateViewportResult;
|
|
106
|
+
};
|
|
78
107
|
[CommandName.Bootstrap]: {
|
|
79
108
|
query: BootstrapQuery;
|
|
80
109
|
result: BootstrapResult;
|
|
@@ -171,6 +200,22 @@ export declare type CommandArgs = {
|
|
|
171
200
|
query: HideModalQuery;
|
|
172
201
|
result: HideModalResult;
|
|
173
202
|
};
|
|
203
|
+
[CommandName.HidePanel]: {
|
|
204
|
+
query: HidePanelQuery;
|
|
205
|
+
result: HidePanelResult;
|
|
206
|
+
};
|
|
207
|
+
[CommandName.HookCreateItems]: {
|
|
208
|
+
query: HookCreateItemsQuery;
|
|
209
|
+
result: HookCreateItemsResult;
|
|
210
|
+
};
|
|
211
|
+
[CommandName.HookSelection]: {
|
|
212
|
+
query: HookSelectionQuery;
|
|
213
|
+
result: HookSelectionResult;
|
|
214
|
+
};
|
|
215
|
+
[CommandName.HookTextEdit]: {
|
|
216
|
+
query: HookTextEditQuery;
|
|
217
|
+
result: HookTextEditResult;
|
|
218
|
+
};
|
|
174
219
|
[CommandName.KillExtension]: {
|
|
175
220
|
query: KillExtensionQuery;
|
|
176
221
|
result: KillExtensionResult;
|
|
@@ -229,7 +274,7 @@ export declare type CommandArgs = {
|
|
|
229
274
|
};
|
|
230
275
|
[CommandName.LogForTestCase]: {
|
|
231
276
|
query: JsonSerializable;
|
|
232
|
-
result:
|
|
277
|
+
result: JsonSerializable;
|
|
233
278
|
};
|
|
234
279
|
[CommandName.OffsetItems]: {
|
|
235
280
|
query: OffsetItemsQuery;
|
|
@@ -239,10 +284,18 @@ export declare type CommandArgs = {
|
|
|
239
284
|
query: PatchDataItemsQuery;
|
|
240
285
|
result: PatchDataItemsResult;
|
|
241
286
|
};
|
|
287
|
+
[CommandName.RegisterPanel]: {
|
|
288
|
+
query: RegisterPanelQuery;
|
|
289
|
+
result: RegisterPanelResult;
|
|
290
|
+
};
|
|
242
291
|
[CommandName.ReloadExtension]: {
|
|
243
292
|
query: ReloadExtensionQuery;
|
|
244
293
|
result: ReloadExtensionResult;
|
|
245
294
|
};
|
|
295
|
+
[CommandName.SendOAuthRequest]: {
|
|
296
|
+
query: SendOAuthRequestQuery;
|
|
297
|
+
result: SendOAuthRequestResponse;
|
|
298
|
+
};
|
|
246
299
|
[CommandName.SendUIMessage]: {
|
|
247
300
|
query: SendUIMessageQuery;
|
|
248
301
|
result: SendUIMessageResult;
|
|
@@ -271,25 +324,62 @@ export declare type CommandArgs = {
|
|
|
271
324
|
query: ShowModalQuery;
|
|
272
325
|
result: ShowModalResult;
|
|
273
326
|
};
|
|
327
|
+
[CommandName.ShowPanel]: {
|
|
328
|
+
query: ShowPanelQuery;
|
|
329
|
+
result: ShowPanelResult;
|
|
330
|
+
};
|
|
274
331
|
[CommandName.SleepForTestCase]: {
|
|
275
332
|
query: SleepForTestCaseQuery;
|
|
276
333
|
result: SleepForTestCaseResult;
|
|
277
334
|
};
|
|
335
|
+
[CommandName.UnhookCreateItems]: {
|
|
336
|
+
query: UnhookCreateItemsQuery;
|
|
337
|
+
result: UnhookCreateItemsResult;
|
|
338
|
+
};
|
|
339
|
+
[CommandName.UnhookSelection]: {
|
|
340
|
+
query: UnhookSelectionQuery;
|
|
341
|
+
result: UnhookSelectionResult;
|
|
342
|
+
};
|
|
343
|
+
[CommandName.UnhookTextEdit]: {
|
|
344
|
+
query: UnhookTextEditQuery;
|
|
345
|
+
result: UnhookTextEditResult;
|
|
346
|
+
};
|
|
347
|
+
};
|
|
348
|
+
export declare type AddLineTextAreaQuery = {
|
|
349
|
+
/** Which line */
|
|
350
|
+
'id': string;
|
|
351
|
+
/** Where to place the text along the line */
|
|
352
|
+
'p': SerializedLineTextAreaPositioning;
|
|
353
|
+
/** Plain text to put at this location (will be styled with document theme) */
|
|
354
|
+
't': string;
|
|
278
355
|
};
|
|
356
|
+
/** The name of the created text area */
|
|
357
|
+
export declare type AddLineTextAreaResult = string;
|
|
358
|
+
/** @ignore */
|
|
279
359
|
export declare type UnionToIntersection<T> = (T extends any ? (x: T) => unknown : never) extends (x: infer R) => unknown ? R : never;
|
|
280
360
|
export declare type AddMenuItemQuery = {
|
|
361
|
+
/** Label to display on the menu item */
|
|
281
362
|
'l': string;
|
|
363
|
+
/** Named action to run when the menu item is clicked */
|
|
282
364
|
'a': string;
|
|
365
|
+
/** Named action that returns whether the menu item should be visible */
|
|
283
366
|
'v'?: string;
|
|
367
|
+
/** Named action that returns whether the menu item should be disabled */
|
|
284
368
|
'd'?: string;
|
|
369
|
+
/** Which menu to put the item in */
|
|
285
370
|
't': MenuType;
|
|
371
|
+
/** If specified, where to place the menu item; defaults to MenuLocation.Extension */
|
|
286
372
|
'loc'?: MenuLocation;
|
|
287
373
|
};
|
|
288
374
|
export declare type AddMenuItemResult = undefined;
|
|
289
375
|
export declare type AddShapeDataQuery = {
|
|
376
|
+
/** ID of the element to add this shape data to */
|
|
290
377
|
'id'?: string | undefined;
|
|
378
|
+
/** Name for this shape data */
|
|
291
379
|
'n': string;
|
|
380
|
+
/** Inheritance setting for the new shape data */
|
|
292
381
|
'i': ShapeDataInheritance;
|
|
382
|
+
/** Initial value of this shape data; use a string beginning with '=' for a formula */
|
|
293
383
|
'v'?: SerializedFieldType;
|
|
294
384
|
};
|
|
295
385
|
export declare type AddShapeDataResult = undefined;
|
|
@@ -302,30 +392,48 @@ export declare type BootstrapQuery = {
|
|
|
302
392
|
};
|
|
303
393
|
export declare type BootstrapResult = Promise<void>;
|
|
304
394
|
export declare type CreateBlockQuery = {
|
|
395
|
+
/**
|
|
396
|
+
* By default, we add the block to the current page & currently active group. If specified, the
|
|
397
|
+
* block will instead be created as a direct child of the given page.
|
|
398
|
+
*/
|
|
305
399
|
'p'?: string;
|
|
400
|
+
/** Class name of the block to create */
|
|
306
401
|
'c': string;
|
|
402
|
+
/** If specified, the stencil for a custom shape. Only valid if the class name is 'CustomBlock' */
|
|
307
403
|
's'?: JsonSerializable | undefined;
|
|
308
404
|
};
|
|
309
405
|
export declare type CreateBlockResult = string;
|
|
310
406
|
export declare type CreateCollectionFieldDefinition = {
|
|
407
|
+
/** Name of the field */
|
|
311
408
|
'n': string;
|
|
409
|
+
/** Type of the values in this field */
|
|
312
410
|
't': SerializedFieldTypeDefinition;
|
|
313
411
|
};
|
|
314
412
|
export declare type CreateCollectionQuery = {
|
|
413
|
+
/** ID of the data source to add this collection to */
|
|
315
414
|
's': string;
|
|
415
|
+
/** Name of the collection */
|
|
316
416
|
'n': string;
|
|
417
|
+
/** Fields that can be set on data items in this collection */
|
|
317
418
|
'f': CreateCollectionFieldDefinition[];
|
|
419
|
+
/** Field(s) to use as the primary key of this collection */
|
|
318
420
|
'p': string[];
|
|
319
421
|
};
|
|
320
422
|
export declare type CreateCollectionResult = string;
|
|
321
423
|
export declare type CreateDataSourceQuery = {
|
|
424
|
+
/** Name of the data source */
|
|
322
425
|
'n': string;
|
|
426
|
+
/** Source configuration for this data source--information about where it came from, or any metadata that might be useful */
|
|
323
427
|
's': {
|
|
324
428
|
[key: string]: JsonSerializable;
|
|
325
429
|
};
|
|
326
430
|
};
|
|
327
431
|
export declare type CreateDataSourceResult = string;
|
|
328
432
|
export declare type CreateLineQuery = {
|
|
433
|
+
/**
|
|
434
|
+
* By default, we add the line to the current page & currently active group. If specified, the
|
|
435
|
+
* line will instead be created as a direct child of the given page.
|
|
436
|
+
*/
|
|
329
437
|
'p'?: string;
|
|
330
438
|
};
|
|
331
439
|
export declare type CreateLineResult = string;
|
|
@@ -336,14 +444,20 @@ export declare type DeleteItemResult = boolean;
|
|
|
336
444
|
export declare type DeletePageQuery = string;
|
|
337
445
|
export declare type DeletePageResult = boolean;
|
|
338
446
|
export declare type DeleteShapeDataQuery = {
|
|
447
|
+
/** ID of the element to delete this shape data from */
|
|
339
448
|
'id'?: string | undefined;
|
|
449
|
+
/** Name for this shape data */
|
|
340
450
|
'n': string;
|
|
341
451
|
};
|
|
342
452
|
export declare type DeleteShapeDataResult = undefined;
|
|
343
453
|
export declare type DownloadQuery = {
|
|
454
|
+
/** Filename of the download */
|
|
344
455
|
'f': string;
|
|
456
|
+
/** Data to put in the file */
|
|
345
457
|
'd': string;
|
|
458
|
+
/** MIME type for the download */
|
|
346
459
|
'm': string;
|
|
460
|
+
/** If true, data is base64-encoded and should be converted to binary for download */
|
|
347
461
|
'b64': boolean;
|
|
348
462
|
};
|
|
349
463
|
export declare type DownloadResult = undefined;
|
|
@@ -352,12 +466,16 @@ export declare type ElementExistsQuery = {
|
|
|
352
466
|
};
|
|
353
467
|
export declare type ElementExistsResult = boolean;
|
|
354
468
|
export declare type ExecuteFormulaQuery = {
|
|
469
|
+
/** ID of the element to execute a formula on */
|
|
355
470
|
'id': string;
|
|
471
|
+
/** Formula to execute, e.g. '@a + @b' or 'CONTAINEDBY' */
|
|
356
472
|
'f': string;
|
|
357
473
|
};
|
|
358
474
|
export declare type ExecuteFormulaResult = SerializedFieldType | SerializedDataError;
|
|
359
475
|
export declare type AnimateViewportQuery = {
|
|
476
|
+
/** ID of the page to view */
|
|
360
477
|
'p': string;
|
|
478
|
+
/** Bounding box on that page that will fill as much of the viewport as possible */
|
|
361
479
|
'bb': Box;
|
|
362
480
|
};
|
|
363
481
|
export declare type AnimateViewportResult = Promise<void>;
|
|
@@ -370,66 +488,109 @@ export declare type GetConnectedLinesResult = string[];
|
|
|
370
488
|
export declare type GetCurrentPageQuery = void;
|
|
371
489
|
export declare type GetCurrentPageResult = string | undefined;
|
|
372
490
|
export declare type GetCustomShapeQuery = {
|
|
491
|
+
/** Name of the custom shape library in this same extension package */
|
|
373
492
|
'l': string;
|
|
493
|
+
/** Name of the shape in that library to find */
|
|
374
494
|
's': string;
|
|
375
495
|
};
|
|
376
496
|
export declare type GetCustomShapeResult = Promise<{
|
|
497
|
+
/** Value which can be used as the Stencil property on a dynamic shape */
|
|
377
498
|
's': JsonSerializable;
|
|
499
|
+
/** Default size (x:0, y:0) of this custom shape */
|
|
378
500
|
'bb': Box;
|
|
501
|
+
/** Other default property values */
|
|
379
502
|
'p': JsonObject;
|
|
380
503
|
} | undefined>;
|
|
381
504
|
export declare type GetDataItemFieldQuery = {
|
|
505
|
+
/** Collection ID to query */
|
|
382
506
|
'c': string;
|
|
507
|
+
/** Primary key of the data item to read */
|
|
383
508
|
'pk': string;
|
|
509
|
+
/** Name of field to read */
|
|
384
510
|
'f': string;
|
|
385
511
|
};
|
|
386
512
|
export declare type GetDataItemFieldResult = SerializedFieldType;
|
|
387
513
|
export declare type GetItemPageIdQuery = string;
|
|
388
514
|
export declare type GetItemPageIdResult = string;
|
|
389
515
|
export declare type GetReferenceKeyQuery = {
|
|
516
|
+
/** ID of the LucidElement to read a reference key from, or undefined to read from the LucidDocument */
|
|
390
517
|
'id'?: string;
|
|
518
|
+
/** Reference key to get */
|
|
391
519
|
'k': number | string;
|
|
392
520
|
};
|
|
393
521
|
export declare type GetReferenceKeyResult = SerializedReferenceKeyType;
|
|
394
522
|
export declare type GetPropertyQuery = {
|
|
523
|
+
/** ID of the LucidElement to read a property from, or undefined to read from the LucidDocument */
|
|
395
524
|
'id'?: string | undefined;
|
|
525
|
+
/** Name of the property to read */
|
|
396
526
|
'p': string;
|
|
397
527
|
};
|
|
398
528
|
export declare type GetPropertyResult = JsonSerializable;
|
|
399
529
|
export declare type GetRelativeLinePositionQuery = {
|
|
530
|
+
/** Block or line ID to check the connections on */
|
|
400
531
|
'id': string;
|
|
532
|
+
/** Relative position in range of [0,1] along the line */
|
|
401
533
|
'p': number;
|
|
402
534
|
};
|
|
403
535
|
export declare type GetRelativeLinePositionResult = Point;
|
|
404
536
|
export declare type GetSelectionQuery = {
|
|
537
|
+
/** If set, additionally return all items inside selected groups */
|
|
405
538
|
'd'?: boolean;
|
|
406
539
|
};
|
|
407
540
|
export declare type GetSelectionResult = string[];
|
|
408
541
|
export declare type GetShapeDataQuery = {
|
|
542
|
+
/** ID of the element to query shape data from */
|
|
409
543
|
'id'?: string | undefined;
|
|
544
|
+
/** Name of the shape data to read */
|
|
410
545
|
'n': string;
|
|
411
546
|
};
|
|
412
547
|
export declare type GetShapeDataResult = SerializedFieldType | SerializedDataError;
|
|
413
548
|
export declare type HideModalQuery = {
|
|
549
|
+
/** Name of the modal's action for receiving events, i.e. ShowModalQuery['n'] */
|
|
414
550
|
'n': string;
|
|
415
551
|
};
|
|
416
552
|
export declare type HideModalResult = undefined;
|
|
553
|
+
export declare type HidePanelQuery = {
|
|
554
|
+
/** Name of the panel's action for receiving events, i.e. RegisterPanelQuery['n'] */
|
|
555
|
+
'n': string;
|
|
556
|
+
};
|
|
557
|
+
export declare type HidePanelResult = undefined;
|
|
558
|
+
export declare type HookCreateItemsQuery = {
|
|
559
|
+
/** Name of the action for receiving events. Will be called with an array of strings of all recently created item IDs. */
|
|
560
|
+
'n': string;
|
|
561
|
+
};
|
|
562
|
+
export declare type HookCreateItemsResult = undefined;
|
|
563
|
+
export declare type HookSelectionQuery = {
|
|
564
|
+
/** Name of the action for receiving events. Will be called with an array of strings of all selected item IDs. */
|
|
565
|
+
'n': string;
|
|
566
|
+
};
|
|
567
|
+
export declare type HookSelectionResult = undefined;
|
|
568
|
+
export declare type HookTextEditQuery = {
|
|
569
|
+
/** Name of the action for receiving these events */
|
|
570
|
+
'n': string;
|
|
571
|
+
};
|
|
572
|
+
export declare type HookTextEditResult = undefined;
|
|
417
573
|
export declare type KillExtensionQuery = void;
|
|
418
574
|
export declare type KillExtensionResult = undefined;
|
|
419
575
|
export declare type ListChildrenQuery = {
|
|
576
|
+
/** Parent ID to search inside */
|
|
420
577
|
'id': string;
|
|
578
|
+
/** "deep" - If true, get all children at any level of group nesting; otherwise only immediate children */
|
|
421
579
|
'd'?: boolean;
|
|
422
580
|
};
|
|
423
581
|
export declare type ListChildrenResult = string[];
|
|
424
582
|
export declare type ListCollectionsQuery = {
|
|
583
|
+
/** ID of the data source to list collections for */
|
|
425
584
|
'id': string;
|
|
426
585
|
};
|
|
427
586
|
export declare type ListCollectionsResult = string[];
|
|
428
587
|
export declare type ListDataItemsQuery = {
|
|
588
|
+
/** Collection ID to list items from */
|
|
429
589
|
'id': string;
|
|
430
590
|
};
|
|
431
591
|
export declare type ListDataItemsResult = string[];
|
|
432
592
|
export declare type ListCollectionFieldsQuery = {
|
|
593
|
+
/** Collection ID to query */
|
|
433
594
|
'id': string;
|
|
434
595
|
};
|
|
435
596
|
export declare type ListCollectionFieldsResult = string[];
|
|
@@ -438,8 +599,10 @@ export declare type ListDataSourcesResult = string[];
|
|
|
438
599
|
export declare type ListPagesQuery = void;
|
|
439
600
|
export declare type ListPagesResult = string[];
|
|
440
601
|
export declare type ListReferenceKeysQuery = {
|
|
602
|
+
/** ID of the element to list reference keys for, or undefined for the document */
|
|
441
603
|
'id'?: string | undefined;
|
|
442
604
|
};
|
|
605
|
+
/** Reference key IDs */
|
|
443
606
|
export declare type ListReferenceKeysResult = (string | number)[];
|
|
444
607
|
export declare type ListPropertiesQuery = {
|
|
445
608
|
'id'?: string | undefined;
|
|
@@ -447,6 +610,7 @@ export declare type ListPropertiesQuery = {
|
|
|
447
610
|
export declare type ListPropertiesResult = string[];
|
|
448
611
|
export declare type ListShapeDataQuery = {
|
|
449
612
|
'id'?: string | undefined;
|
|
613
|
+
/** True to include inherited shape data from containing groups and/or page */
|
|
450
614
|
'i'?: boolean | undefined;
|
|
451
615
|
};
|
|
452
616
|
export declare type ListShapeDataResult = string[];
|
|
@@ -455,27 +619,57 @@ export declare type ListTextAreasResult = string[];
|
|
|
455
619
|
export declare type LoadBlockClassesQuery = string[];
|
|
456
620
|
export declare type LoadBlockClassesResult = Promise<undefined>;
|
|
457
621
|
export declare type OffsetItemsQuery = {
|
|
622
|
+
/** IDs of the items (blocks, lines, groups) to move */
|
|
458
623
|
'ids': string[];
|
|
624
|
+
/** What kind of offset to perform */
|
|
459
625
|
't': LinearOffsetType;
|
|
626
|
+
/** How far to offset */
|
|
460
627
|
'o': Point;
|
|
461
628
|
};
|
|
462
629
|
export declare type OffsetItemsResult = undefined;
|
|
463
630
|
export declare type PatchDataItemsQuery = {
|
|
631
|
+
/** ID of the data collection to patch */
|
|
464
632
|
'id': string;
|
|
633
|
+
/** Data items to add to the collection */
|
|
465
634
|
'a': Record<string, SerializedFieldType>[];
|
|
635
|
+
/** Data items to change field values on, keyed by primary key */
|
|
466
636
|
'c': Record<string, Record<string, SerializedFieldType>>;
|
|
637
|
+
/** Primary keys of items to delete */
|
|
467
638
|
'd': string[];
|
|
468
639
|
};
|
|
469
640
|
export declare type PatchDataItemsResult = undefined;
|
|
641
|
+
export declare type RegisterPanelQuery = {
|
|
642
|
+
/** Name of the panel's action for receiving events; generated automatically by Panel base class */
|
|
643
|
+
'n': string;
|
|
644
|
+
/** Title to show on the panel */
|
|
645
|
+
't': string;
|
|
646
|
+
/** Where to display the panel */
|
|
647
|
+
'l': PanelLocation;
|
|
648
|
+
/** Named action that returns whether the button to open the panel should be visible */
|
|
649
|
+
'v'?: string;
|
|
650
|
+
/** Content to display in the panel; full HTML page preferred */
|
|
651
|
+
'c': string;
|
|
652
|
+
/** Icon URL, preferably a base64-encoded URL */
|
|
653
|
+
'i': string;
|
|
654
|
+
};
|
|
655
|
+
export declare type RegisterPanelResult = undefined;
|
|
470
656
|
export declare type ReloadExtensionQuery = void;
|
|
471
657
|
export declare type ReloadExtensionResult = undefined;
|
|
658
|
+
export declare type SendOAuthRequestQuery = SendXHRQuery & {
|
|
659
|
+
/** OAuth provider name as specified in the package manifest */
|
|
660
|
+
'p': string;
|
|
661
|
+
};
|
|
662
|
+
export declare type SendOAuthRequestResponse = SendXHRResponse;
|
|
472
663
|
export declare type SendUIMessageQuery = {
|
|
664
|
+
/** Name of the UI component's action for receiving events, e.g. ShowModalQuery['n'] */
|
|
473
665
|
'n': string;
|
|
666
|
+
/** Content of the message to send to the custom UI component */
|
|
474
667
|
'd'?: JsonSerializable;
|
|
475
668
|
};
|
|
476
669
|
export declare type SendUIMessageResult = undefined;
|
|
477
670
|
export declare type SendXHRQuery = {
|
|
478
671
|
'url': string;
|
|
672
|
+
/** HTTP method, e.g. 'GET', 'FETCH', etc. Defaults to GET */
|
|
479
673
|
'm'?: string;
|
|
480
674
|
/**
|
|
481
675
|
* The data to send with the request.
|
|
@@ -486,48 +680,90 @@ export declare type SendXHRQuery = {
|
|
|
486
680
|
* no 'Content-Type' header is specified, a 'text/plain; charset=utf-8' content type is sent.
|
|
487
681
|
*/
|
|
488
682
|
'd'?: string;
|
|
683
|
+
/** Headers to send with the request */
|
|
489
684
|
'h'?: {
|
|
490
685
|
[key: string]: string | string[];
|
|
491
686
|
};
|
|
687
|
+
/** Timeout in milliseconds, if specified */
|
|
492
688
|
'ms'?: number;
|
|
493
689
|
};
|
|
494
690
|
export declare type RawSendXHRResponse = {
|
|
691
|
+
/** URL of the response after any redirects */
|
|
495
692
|
'url': string;
|
|
693
|
+
/** Plain-text response body */
|
|
496
694
|
't': string;
|
|
695
|
+
/** Status code of the response */
|
|
497
696
|
's': number;
|
|
697
|
+
/** Headers sent with the response */
|
|
498
698
|
'h': {
|
|
499
699
|
[key: string]: string;
|
|
500
700
|
};
|
|
701
|
+
/** true if the request timed out */
|
|
501
702
|
'to'?: boolean;
|
|
502
703
|
};
|
|
503
704
|
export declare type SendXHRResponse = Promise<RawSendXHRResponse>;
|
|
705
|
+
export declare function isRawSendXHRResponse(val: any): val is RawSendXHRResponse;
|
|
504
706
|
export declare type SetCurrentPageQuery = string;
|
|
505
707
|
export declare type SetCurrentPageResult = Promise<void>;
|
|
506
708
|
export declare type SetPropertyQuery = {
|
|
709
|
+
/** ID of the element to change */
|
|
507
710
|
'id'?: string | undefined;
|
|
711
|
+
/** Name of the property to change */
|
|
508
712
|
'p': string;
|
|
713
|
+
/** New value of the property */
|
|
509
714
|
'v'?: JsonSerializable;
|
|
510
715
|
};
|
|
511
716
|
export declare type SetPropertyResult = undefined;
|
|
512
717
|
export declare type SetReferenceKeyQuery = {
|
|
718
|
+
/** ID of the element to set the reference key on */
|
|
513
719
|
'id'?: string | undefined;
|
|
720
|
+
/** ID of the reference key to set */
|
|
514
721
|
'k': string | number;
|
|
722
|
+
/** New reference key settings, or undefined to remove the reference key */
|
|
515
723
|
'v'?: SerializedReferenceKeyType;
|
|
516
724
|
};
|
|
517
725
|
export declare type SetReferenceKeyResult = undefined;
|
|
518
726
|
export declare type SetShapeDataQuery = {
|
|
727
|
+
/** ID of the element to set this shape data on */
|
|
519
728
|
'id'?: string | undefined;
|
|
729
|
+
/** Name for the already-existing shape data to update */
|
|
520
730
|
'n': string;
|
|
731
|
+
/** Value to set; use a string beginning with '=' for a formula */
|
|
521
732
|
'v'?: SerializedFieldType;
|
|
522
733
|
};
|
|
523
734
|
export declare type SetShapeDataResult = undefined;
|
|
524
735
|
export declare type ShowModalQuery = {
|
|
736
|
+
/** Name of the modal's action for receiving events; generated automatically by Modal base class */
|
|
525
737
|
'n': string;
|
|
738
|
+
/** Title to show on the modal */
|
|
526
739
|
't': string;
|
|
740
|
+
/** Desired modal width */
|
|
527
741
|
'w': number;
|
|
742
|
+
/** Desired modal height */
|
|
528
743
|
'h': number;
|
|
744
|
+
/** Content to display in the modal; full HTML page preferred */
|
|
529
745
|
'c': string;
|
|
530
746
|
};
|
|
531
747
|
export declare type ShowModalResult = undefined;
|
|
748
|
+
export declare type ShowPanelQuery = {
|
|
749
|
+
/** Name of the panel's action for receiving events, i.e. RegisterPanelQuery['n'] */
|
|
750
|
+
'n': string;
|
|
751
|
+
};
|
|
752
|
+
export declare type ShowPanelResult = undefined;
|
|
532
753
|
export declare type SleepForTestCaseQuery = number;
|
|
533
754
|
export declare type SleepForTestCaseResult = Promise<void>;
|
|
755
|
+
export declare type UnhookCreateItemsQuery = {
|
|
756
|
+
/** Name of the action passed to HookCreateItems */
|
|
757
|
+
'n': string;
|
|
758
|
+
};
|
|
759
|
+
export declare type UnhookCreateItemsResult = undefined;
|
|
760
|
+
export declare type UnhookSelectionQuery = {
|
|
761
|
+
/** Name of the action for receiving these events */
|
|
762
|
+
'n': string;
|
|
763
|
+
};
|
|
764
|
+
export declare type UnhookSelectionResult = undefined;
|
|
765
|
+
export declare type UnhookTextEditQuery = {
|
|
766
|
+
/** Name of the action for receiving these events */
|
|
767
|
+
'n': string;
|
|
768
|
+
};
|
|
769
|
+
export declare type UnhookTextEditResult = undefined;
|
package/sdk/commandtypes.js
CHANGED
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isRawSendXHRResponse = void 0;
|
|
4
|
+
const checks_1 = require("./core/checks");
|
|
5
|
+
function isRawSendXHRResponse(val) {
|
|
6
|
+
return (0, checks_1.isString)(val['url']) && (0, checks_1.isString)(val['t']) && (0, checks_1.isNumber)(val['s']) && (0, checks_1.isObject)(val['h']);
|
|
7
|
+
}
|
|
8
|
+
exports.isRawSendXHRResponse = isRawSendXHRResponse;
|
|
@@ -22,3 +22,9 @@ export declare type UnTypedSerializedFlattenedReference = {
|
|
|
22
22
|
};
|
|
23
23
|
export declare type SerializedFlattenedReference = TypedSerializedFlattenedReference | UnTypedSerializedFlattenedReference;
|
|
24
24
|
export declare type SerializedReferenceKeyType = SerializedReferenceKey | SerializedFlattenedReference;
|
|
25
|
+
/** @ignore */
|
|
26
|
+
export declare function isTypedSerializedFlattenedReference(data: unknown): data is TypedSerializedFlattenedReference;
|
|
27
|
+
/** @ignore */
|
|
28
|
+
export declare function isUnTypedSerializedFlattenedReference(data: unknown): data is UnTypedSerializedFlattenedReference;
|
|
29
|
+
/** @ignore */
|
|
30
|
+
export declare function isSerializedFlattenedReference(data: unknown): data is SerializedFlattenedReference;
|
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FlattenedReferenceKeyName = exports.FlattenedReferenceKeyId = void 0;
|
|
3
|
+
exports.isSerializedFlattenedReference = exports.isUnTypedSerializedFlattenedReference = exports.isTypedSerializedFlattenedReference = exports.FlattenedReferenceKeyName = exports.FlattenedReferenceKeyId = void 0;
|
|
4
|
+
const checks_1 = require("../../checks");
|
|
4
5
|
exports.FlattenedReferenceKeyId = '192d0e9f-2f5a-4032-9f03-59bbf1ea5891';
|
|
5
6
|
exports.FlattenedReferenceKeyName = '192d0e9f-2f5a-4032-9f03-59bbf1ea5891_n';
|
|
7
|
+
/** @ignore */
|
|
8
|
+
function isTypedSerializedFlattenedReference(data) {
|
|
9
|
+
return (0, checks_1.isObject)(data) && (0, checks_1.isObject)(data['sc']) && (0, checks_1.isObject)(data['d']);
|
|
10
|
+
}
|
|
11
|
+
exports.isTypedSerializedFlattenedReference = isTypedSerializedFlattenedReference;
|
|
12
|
+
/** @ignore */
|
|
13
|
+
function isUnTypedSerializedFlattenedReference(data) {
|
|
14
|
+
return (0, checks_1.isObject)(data) && data[exports.FlattenedReferenceKeyId] === true;
|
|
15
|
+
}
|
|
16
|
+
exports.isUnTypedSerializedFlattenedReference = isUnTypedSerializedFlattenedReference;
|
|
17
|
+
/** @ignore */
|
|
18
|
+
function isSerializedFlattenedReference(data) {
|
|
19
|
+
return isUnTypedSerializedFlattenedReference(data) || isTypedSerializedFlattenedReference(data);
|
|
20
|
+
}
|
|
21
|
+
exports.isSerializedFlattenedReference = isSerializedFlattenedReference;
|
|
@@ -2,6 +2,10 @@ export declare type JsonArray = Array<JsonSerializable>;
|
|
|
2
2
|
export interface JsonObject {
|
|
3
3
|
[key: string]: JsonSerializable;
|
|
4
4
|
}
|
|
5
|
+
/**
|
|
6
|
+
* 'json-able' but specificallyfor json objects
|
|
7
|
+
* @ignore
|
|
8
|
+
*/
|
|
5
9
|
export interface JsonObjectConvertible {
|
|
6
10
|
toJsonObject(): JsonObject;
|
|
7
11
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { SerializedFieldType } from '../core/data/serializedfield/serializedfields';
|
|
2
|
-
import { ElementProxy } from '../document/elementproxy';
|
|
3
2
|
import { MapProxy } from '../document/mapproxy';
|
|
3
|
+
import { PropertyStoreProxy } from '../document/propertystoreproxy';
|
|
4
4
|
import { EditorClient } from '../editorclient';
|
|
5
5
|
import { DataItemProxy } from './dataitemproxy';
|
|
6
6
|
/**
|
|
7
7
|
* A collection is a set of data items, each with the same set of fields (though some data items may not have all
|
|
8
8
|
* fields defined).
|
|
9
9
|
*/
|
|
10
|
-
export declare class CollectionProxy extends
|
|
10
|
+
export declare class CollectionProxy extends PropertyStoreProxy {
|
|
11
11
|
readonly id: string;
|
|
12
12
|
/**
|
|
13
13
|
*
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CollectionProxy = void 0;
|
|
4
|
-
const elementproxy_1 = require("../document/elementproxy");
|
|
5
4
|
const mapproxy_1 = require("../document/mapproxy");
|
|
5
|
+
const propertystoreproxy_1 = require("../document/propertystoreproxy");
|
|
6
6
|
const dataitemproxy_1 = require("./dataitemproxy");
|
|
7
7
|
/**
|
|
8
8
|
* A collection is a set of data items, each with the same set of fields (though some data items may not have all
|
|
9
9
|
* fields defined).
|
|
10
10
|
*/
|
|
11
|
-
class CollectionProxy extends
|
|
11
|
+
class CollectionProxy extends propertystoreproxy_1.PropertyStoreProxy {
|
|
12
12
|
/**
|
|
13
13
|
*
|
|
14
14
|
* @param id ID of this collection on the current document
|