lucid-extension-sdk 0.0.68 → 0.0.69
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 +1 -1
- package/sdk/commandtypes.d.ts +10 -0
- package/sdk/commandtypes.js +1 -0
- package/sdk/core/cardintegration/cardintegration.d.ts +3 -6
- package/sdk/document/documentelement/cardconfigproxy.d.ts +10 -0
- package/sdk/document/documentelement/cardconfigproxy.js +15 -0
- package/sdk/document/documentelement/documentelementproxy.d.ts +10 -0
- package/sdk/document/documentelement/documentelementproxy.js +15 -0
- package/sdk/document/documentelement/documentelementtype.d.ts +15 -0
- package/sdk/document/documentelement/documentelementtype.js +19 -0
- package/sdk/document/documentproxy.d.ts +2 -0
- package/sdk/document/documentproxy.js +3 -0
- package/sdk/document/taskmanagementcardintegration.js +3 -4
package/package.json
CHANGED
package/sdk/commandtypes.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ 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 { DocumentElementType } from './document/documentelement/documentelementtype';
|
|
8
9
|
import { SerializedLineTextAreaPositioning } from './document/linetextareapositioning';
|
|
9
10
|
import { Box, Point } from './math';
|
|
10
11
|
import { MenuLocation, MenuType } from './ui/menu';
|
|
@@ -64,6 +65,7 @@ export declare const enum CommandName {
|
|
|
64
65
|
ListCollections = "lc",
|
|
65
66
|
ListDataItems = "ldi",
|
|
66
67
|
ListDataSources = "lds",
|
|
68
|
+
ListDocumentElements = "lde",
|
|
67
69
|
ListGroups = "lg",
|
|
68
70
|
ListLines = "ll",
|
|
69
71
|
ListPages = "lp",
|
|
@@ -292,6 +294,10 @@ export declare type CommandArgs = {
|
|
|
292
294
|
query: ListDataSourcesQuery;
|
|
293
295
|
result: ListDataSourcesResult;
|
|
294
296
|
};
|
|
297
|
+
[CommandName.ListDocumentElements]: {
|
|
298
|
+
query: ListDocumentElementsQuery;
|
|
299
|
+
result: ListDocumentElementsResult;
|
|
300
|
+
};
|
|
295
301
|
[CommandName.ListGroups]: {
|
|
296
302
|
query: ListChildrenQuery;
|
|
297
303
|
result: ListChildrenResult;
|
|
@@ -806,6 +812,10 @@ export declare type ListCollectionFieldsQuery = {
|
|
|
806
812
|
export declare type ListCollectionFieldsResult = string[];
|
|
807
813
|
export declare type ListDataSourcesQuery = undefined;
|
|
808
814
|
export declare type ListDataSourcesResult = string[];
|
|
815
|
+
export declare type ListDocumentElementsQuery = {
|
|
816
|
+
't': DocumentElementType;
|
|
817
|
+
};
|
|
818
|
+
export declare type ListDocumentElementsResult = string[];
|
|
809
819
|
export declare type ListPagesQuery = void;
|
|
810
820
|
export declare type ListPagesResult = string[];
|
|
811
821
|
export declare type ListReferenceKeysQuery = {
|
package/sdk/commandtypes.js
CHANGED
|
@@ -49,6 +49,7 @@ exports.commandTitles = new Map([
|
|
|
49
49
|
["lc" /* CommandName.ListCollections */, 'ListCollections'],
|
|
50
50
|
["ldi" /* CommandName.ListDataItems */, 'ListDataItems'],
|
|
51
51
|
["lds" /* CommandName.ListDataSources */, 'ListDataSources'],
|
|
52
|
+
["lde" /* CommandName.ListDocumentElements */, 'ListDocumentElements'],
|
|
52
53
|
["lg" /* CommandName.ListGroups */, 'ListGroups'],
|
|
53
54
|
["ll" /* CommandName.ListLines */, 'ListLines'],
|
|
54
55
|
["lp" /* CommandName.ListPages */, 'ListPages'],
|
|
@@ -111,17 +111,14 @@ export interface CardIntegration {
|
|
|
111
111
|
dataConnectorName: string;
|
|
112
112
|
fieldConfiguration: {
|
|
113
113
|
/**
|
|
114
|
-
* Callback to provide a list of all supported field
|
|
115
|
-
*
|
|
116
|
-
* Any fields on the schema of the collection that you don't provide a ExtensionCardFieldDefinition
|
|
117
|
-
* for will have a default definition generated based on the type specified in the schema.
|
|
114
|
+
* Callback to provide a list of all supported field names for the card integration.
|
|
118
115
|
*/
|
|
119
|
-
getAllFields: (collection: CollectionProxy) => Promise<
|
|
116
|
+
getAllFields: (collection: CollectionProxy) => Promise<string[]>;
|
|
120
117
|
/**
|
|
121
118
|
* Callback that handled changes in the fields the user wants to be displayed in the card integration.
|
|
122
119
|
* If this callback is not provided then the user will not be shown the modal to configure fields.
|
|
123
120
|
*/
|
|
124
|
-
onSelectedFieldsChange?: (dataSource: DataSourceProxy, selectedFields: string[]) => void
|
|
121
|
+
onSelectedFieldsChange?: (dataSource: DataSourceProxy, selectedFields: string[]) => Promise<void>;
|
|
125
122
|
};
|
|
126
123
|
/**
|
|
127
124
|
* If specified, and the user hasn't yet authorized the data connector for this extension,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { EditorClient } from '../../editorclient';
|
|
2
|
+
import { DocumentElementProxy } from './documentelementproxy';
|
|
3
|
+
export declare class CardConfigProxy extends DocumentElementProxy {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
/**
|
|
6
|
+
* @param id The ID of this card config element
|
|
7
|
+
* @param client
|
|
8
|
+
*/
|
|
9
|
+
constructor(id: string, client: EditorClient);
|
|
10
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CardConfigProxy = void 0;
|
|
4
|
+
const documentelementproxy_1 = require("./documentelementproxy");
|
|
5
|
+
class CardConfigProxy extends documentelementproxy_1.DocumentElementProxy {
|
|
6
|
+
/**
|
|
7
|
+
* @param id The ID of this card config element
|
|
8
|
+
* @param client
|
|
9
|
+
*/
|
|
10
|
+
constructor(id, client) {
|
|
11
|
+
super(id, client);
|
|
12
|
+
this.id = id;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.CardConfigProxy = CardConfigProxy;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { EditorClient } from '../../editorclient';
|
|
2
|
+
import { PropertyStoreProxy } from '../propertystoreproxy';
|
|
3
|
+
export declare class DocumentElementProxy extends PropertyStoreProxy {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
/**
|
|
6
|
+
* @param id The ID of this document element
|
|
7
|
+
* @param client
|
|
8
|
+
*/
|
|
9
|
+
constructor(id: string, client: EditorClient);
|
|
10
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DocumentElementProxy = void 0;
|
|
4
|
+
const propertystoreproxy_1 = require("../propertystoreproxy");
|
|
5
|
+
class DocumentElementProxy extends propertystoreproxy_1.PropertyStoreProxy {
|
|
6
|
+
/**
|
|
7
|
+
* @param id The ID of this document element
|
|
8
|
+
* @param client
|
|
9
|
+
*/
|
|
10
|
+
constructor(id, client) {
|
|
11
|
+
super(id, client);
|
|
12
|
+
this.id = id;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.DocumentElementProxy = DocumentElementProxy;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An enumeration of document element types. A Document element represents a collection of data that is stored on a document.
|
|
3
|
+
*/
|
|
4
|
+
export declare enum DocumentElementType {
|
|
5
|
+
DerivedStructure = "DerivedStructure",
|
|
6
|
+
Path = "Path",
|
|
7
|
+
Tag = "Tag",
|
|
8
|
+
CommentThreadMetadata = "ThreadMetadata",
|
|
9
|
+
FontStylePreset = "FontStylePreset",
|
|
10
|
+
IntraDocumentMutex = "Mutex",
|
|
11
|
+
Rule = "Rule",
|
|
12
|
+
RuleGroup = "RuleGroup",
|
|
13
|
+
DocumentFormula = "Formula",
|
|
14
|
+
TaskCardFieldsConfig = "TaskCardFieldsConfig"
|
|
15
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DocumentElementType = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* An enumeration of document element types. A Document element represents a collection of data that is stored on a document.
|
|
6
|
+
*/
|
|
7
|
+
var DocumentElementType;
|
|
8
|
+
(function (DocumentElementType) {
|
|
9
|
+
DocumentElementType["DerivedStructure"] = "DerivedStructure";
|
|
10
|
+
DocumentElementType["Path"] = "Path";
|
|
11
|
+
DocumentElementType["Tag"] = "Tag";
|
|
12
|
+
DocumentElementType["CommentThreadMetadata"] = "ThreadMetadata";
|
|
13
|
+
DocumentElementType["FontStylePreset"] = "FontStylePreset";
|
|
14
|
+
DocumentElementType["IntraDocumentMutex"] = "Mutex";
|
|
15
|
+
DocumentElementType["Rule"] = "Rule";
|
|
16
|
+
DocumentElementType["RuleGroup"] = "RuleGroup";
|
|
17
|
+
DocumentElementType["DocumentFormula"] = "Formula";
|
|
18
|
+
DocumentElementType["TaskCardFieldsConfig"] = "TaskCardFieldsConfig";
|
|
19
|
+
})(DocumentElementType = exports.DocumentElementType || (exports.DocumentElementType = {}));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EditorClient } from '../editorclient';
|
|
2
|
+
import { CardConfigProxy } from './documentelement/cardconfigproxy';
|
|
2
3
|
import { ElementProxy } from './elementproxy';
|
|
3
4
|
import { ItemProxy } from './itemproxy';
|
|
4
5
|
import { MapProxy } from './mapproxy';
|
|
@@ -51,4 +52,5 @@ export declare class DocumentProxy extends ElementProxy {
|
|
|
51
52
|
* @param handle Return value from `hookCreateItems`
|
|
52
53
|
*/
|
|
53
54
|
unhookCreateItems(handle: string): void;
|
|
55
|
+
readonly cardIntegrationConfigs: MapProxy<string, CardConfigProxy>;
|
|
54
56
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DocumentProxy = void 0;
|
|
4
|
+
const cardconfigproxy_1 = require("./documentelement/cardconfigproxy");
|
|
5
|
+
const documentelementtype_1 = require("./documentelement/documentelementtype");
|
|
4
6
|
const elementproxy_1 = require("./elementproxy");
|
|
5
7
|
const mapproxy_1 = require("./mapproxy");
|
|
6
8
|
const pageproxy_1 = require("./pageproxy");
|
|
@@ -14,6 +16,7 @@ class DocumentProxy extends elementproxy_1.ElementProxy {
|
|
|
14
16
|
* The set of pages on this document, organized by ID
|
|
15
17
|
*/
|
|
16
18
|
this.pages = new mapproxy_1.MapProxy(() => this.client.sendCommand("lp" /* CommandName.ListPages */, undefined), (pageId) => new pageproxy_1.PageProxy(pageId, this.client));
|
|
19
|
+
this.cardIntegrationConfigs = new mapproxy_1.MapProxy(() => this.client.sendCommand("lde" /* CommandName.ListDocumentElements */, { 't': documentelementtype_1.DocumentElementType.TaskCardFieldsConfig }), (id) => new cardconfigproxy_1.CardConfigProxy(id, this.client));
|
|
17
20
|
}
|
|
18
21
|
static getNextHookName() {
|
|
19
22
|
return '__documentproxy__hook' + DocumentProxy.nextHookId++;
|
|
@@ -38,16 +38,15 @@ class TaskManagementCardIntegration {
|
|
|
38
38
|
this.client.registerAction(getFieldsActionName, async (param) => {
|
|
39
39
|
const collection = new collectionproxy_1.CollectionProxy(param['c'], this.client);
|
|
40
40
|
const fields = await card.fieldConfiguration.getAllFields(collection);
|
|
41
|
-
|
|
42
|
-
return serializedFields;
|
|
41
|
+
return fields;
|
|
43
42
|
});
|
|
44
43
|
let onSelectedFieldsChangeActionName = undefined;
|
|
45
44
|
const onSelectedFieldsChange = card.fieldConfiguration.onSelectedFieldsChange;
|
|
46
45
|
if (onSelectedFieldsChange) {
|
|
47
46
|
onSelectedFieldsChangeActionName = TaskManagementCardIntegration.nextHookName();
|
|
48
|
-
this.client.registerAction(onSelectedFieldsChangeActionName, (param) => {
|
|
47
|
+
this.client.registerAction(onSelectedFieldsChangeActionName, async (param) => {
|
|
49
48
|
const dataSource = new datasourceproxy_1.DataSourceProxy(param['ds'], this.client);
|
|
50
|
-
onSelectedFieldsChange(dataSource, param['sf']);
|
|
49
|
+
await onSelectedFieldsChange(dataSource, param['sf']);
|
|
51
50
|
});
|
|
52
51
|
}
|
|
53
52
|
const getDefaultConfigActionName = TaskManagementCardIntegration.nextHookName();
|