lucid-extension-sdk 0.0.251 → 0.0.255
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.
|
@@ -69,9 +69,9 @@ export declare class ItemsPatchInexhaustive {
|
|
|
69
69
|
}
|
|
70
70
|
export declare class ItemsPatchExhaustive {
|
|
71
71
|
items: Map<string, SerializedFields>;
|
|
72
|
-
|
|
72
|
+
rekeyingMap?: Map<string, string | null> | undefined;
|
|
73
73
|
errors?: Map<string, SerializedLucidDictionary> | undefined;
|
|
74
|
-
constructor(items: Map<string, SerializedFields>,
|
|
74
|
+
constructor(items: Map<string, SerializedFields>, rekeyingMap?: Map<string, string | null> | undefined, errors?: Map<string, SerializedLucidDictionary> | undefined);
|
|
75
75
|
}
|
|
76
76
|
export type ItemsPatch = {
|
|
77
77
|
/**
|
|
@@ -90,7 +90,7 @@ export type SerializedItemsPatch = {
|
|
|
90
90
|
'errors'?: Record<string, SerializedLucidDictionary>;
|
|
91
91
|
} | {
|
|
92
92
|
'exhaustiveItems': Record<string, SerializedFields>;
|
|
93
|
-
'
|
|
93
|
+
'rekeyingMap'?: Record<string, string | null>;
|
|
94
94
|
'errors'?: Record<string, SerializedLucidDictionary>;
|
|
95
95
|
};
|
|
96
96
|
export declare function serializeItemsPatch(patch: ItemsPatch): SerializedItemsPatch;
|
|
@@ -20,9 +20,9 @@ class ItemsPatchInexhaustive {
|
|
|
20
20
|
}
|
|
21
21
|
exports.ItemsPatchInexhaustive = ItemsPatchInexhaustive;
|
|
22
22
|
class ItemsPatchExhaustive {
|
|
23
|
-
constructor(items,
|
|
23
|
+
constructor(items, rekeyingMap, errors) {
|
|
24
24
|
this.items = items;
|
|
25
|
-
this.
|
|
25
|
+
this.rekeyingMap = rekeyingMap;
|
|
26
26
|
this.errors = errors;
|
|
27
27
|
}
|
|
28
28
|
}
|
|
@@ -30,13 +30,13 @@ exports.ItemsPatchExhaustive = ItemsPatchExhaustive;
|
|
|
30
30
|
function serializeErrors(errors) {
|
|
31
31
|
return errors && { 'errors': (0, object_1.fromEntries)(errors) };
|
|
32
32
|
}
|
|
33
|
-
function
|
|
34
|
-
return
|
|
33
|
+
function serializeRekeyingMap(rekeyingMap) {
|
|
34
|
+
return rekeyingMap && { 'rekeyingMap': (0, object_1.fromEntries)(rekeyingMap) };
|
|
35
35
|
}
|
|
36
36
|
function serializeItemsPatch(patch) {
|
|
37
37
|
var _a;
|
|
38
38
|
if (patch instanceof ItemsPatchExhaustive) {
|
|
39
|
-
return Object.assign(Object.assign({ 'exhaustiveItems': (0, object_1.fromEntries)(patch.items.entries()) },
|
|
39
|
+
return Object.assign(Object.assign({ 'exhaustiveItems': (0, object_1.fromEntries)(patch.items.entries()) }, serializeRekeyingMap(patch.rekeyingMap)), serializeErrors(patch.errors));
|
|
40
40
|
}
|
|
41
41
|
else {
|
|
42
42
|
return Object.assign({ 'items': (0, object_1.fromEntries)(patch.items.entries()), 'itemsDeleted': (_a = patch.itemsDeleted) !== null && _a !== void 0 ? _a : [] }, serializeErrors(patch.errors));
|
package/document/pageproxy.d.ts
CHANGED
|
@@ -166,4 +166,12 @@ export declare class PageProxy extends ElementProxy {
|
|
|
166
166
|
* @returns A promise resolving to an SVG string
|
|
167
167
|
*/
|
|
168
168
|
getSvg(items?: ItemProxy[], includeBackground?: boolean, viewBox?: Box): import("../commandtypes").GetSvgResult;
|
|
169
|
+
/**
|
|
170
|
+
* @returns the page number of this page
|
|
171
|
+
*/
|
|
172
|
+
getPageNumber(): number;
|
|
173
|
+
/**
|
|
174
|
+
* Duplicates the page represented by the page proxy
|
|
175
|
+
*/
|
|
176
|
+
duplicate(): Promise<void>;
|
|
169
177
|
}
|
package/document/pageproxy.js
CHANGED
|
@@ -260,5 +260,17 @@ class PageProxy extends elementproxy_1.ElementProxy {
|
|
|
260
260
|
'i': items === null || items === void 0 ? void 0 : items.map((item) => item.id),
|
|
261
261
|
});
|
|
262
262
|
}
|
|
263
|
+
/**
|
|
264
|
+
* @returns the page number of this page
|
|
265
|
+
*/
|
|
266
|
+
getPageNumber() {
|
|
267
|
+
return this.properties.get('Order');
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Duplicates the page represented by the page proxy
|
|
271
|
+
*/
|
|
272
|
+
async duplicate() {
|
|
273
|
+
await this.client.duplicatePages([this.getPageNumber()]);
|
|
274
|
+
}
|
|
263
275
|
}
|
|
264
276
|
exports.PageProxy = PageProxy;
|
package/editorclient.d.ts
CHANGED
|
@@ -256,6 +256,14 @@ export declare class EditorClient {
|
|
|
256
256
|
* the import failed
|
|
257
257
|
*/
|
|
258
258
|
importPage(documentId: string, pageNums: number[]): Promise<void>;
|
|
259
|
+
/**
|
|
260
|
+
* Duplicates one or more pages of the current document as new pages.
|
|
261
|
+
*
|
|
262
|
+
* @param pageNums An array of zero-indexed page indices to duplicate from the current document
|
|
263
|
+
* @returns a promise that resolves to void when the pages have been duplicated or the
|
|
264
|
+
* the duplication failed
|
|
265
|
+
*/
|
|
266
|
+
duplicatePages(pageNums: number[]): Promise<void>;
|
|
259
267
|
/**
|
|
260
268
|
* Load the requested shape library's content, and if it was found, return a block definition ready to be
|
|
261
269
|
* created.
|
package/editorclient.js
CHANGED
|
@@ -449,6 +449,19 @@ class EditorClient {
|
|
|
449
449
|
async importPage(documentId, pageNums) {
|
|
450
450
|
return await this.sendCommand("imp" /* CommandName.ImportPage */, { 'id': documentId, 'n': pageNums });
|
|
451
451
|
}
|
|
452
|
+
/**
|
|
453
|
+
* Duplicates one or more pages of the current document as new pages.
|
|
454
|
+
*
|
|
455
|
+
* @param pageNums An array of zero-indexed page indices to duplicate from the current document
|
|
456
|
+
* @returns a promise that resolves to void when the pages have been duplicated or the
|
|
457
|
+
* the duplication failed
|
|
458
|
+
*/
|
|
459
|
+
async duplicatePages(pageNums) {
|
|
460
|
+
return await this.sendCommand("imp" /* CommandName.ImportPage */, {
|
|
461
|
+
'id': this.sendCommand("gdid" /* CommandName.GetDocumentId */, undefined),
|
|
462
|
+
'n': pageNums,
|
|
463
|
+
});
|
|
464
|
+
}
|
|
452
465
|
/**
|
|
453
466
|
* Load the requested shape library's content, and if it was found, return a block definition ready to be
|
|
454
467
|
* created.
|