@cloudpdf/engine 3.0.0-next.13 → 3.0.0-next.14
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/dist/index.cjs +50 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18 -1
- package/dist/index.d.ts +18 -1
- package/dist/index.js +51 -2
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AbortError, AbortablePromise, AbortablePromise as AbortablePromise$1, AnnotationAppearanceImageOptions, AnnotationAppearanceImagesResult, AnnotationAppearanceRenderOptions, AnnotationAppearancesResult, AnnotationCreateResult, AnnotationDeleteResult, AnnotationDraft, AnnotationFlattenResult, AnnotationListPageSnapshot, AnnotationListSnapshotAllPages, AnnotationMoveResult, AnnotationPatch, AnnotationRef, AnnotationUpdateResult, AttachmentContent, AttachmentsCache, DocumentAccessInfo, DocumentActionsService, DocumentAnnotationsService, DocumentAnnotationsService as DocumentAnnotationsService$1, DocumentAttachmentsService, DocumentCapabilities, DocumentEventStream, DocumentFormsService, DocumentHandle, DocumentHandle as DocumentHandle$1, DocumentIdentity, DocumentMetadata, DocumentPagesService, DocumentPagesService as DocumentPagesService$1, DocumentRedactionService, DocumentRenderService, DocumentSearchService, DocumentSecurityService, DocumentSecurityService as DocumentSecurityService$1, DocumentSecurityState, DocumentSignaturesService, DocumentUnlockInput, DocumentUnlockResult, Engine, Engine as Engine$1, EngineError, EngineError as EngineError$1, EngineErrorCode, EngineFactory, MetadataCache, MetadataPatch, MetadataService, MetadataService as MetadataService$1, MetadataUpdateResult, MutationMeta, OpenInput, OpenInput as OpenInput$1, OpenInputShare, OpenOptions, OpenOptions as OpenOptions$1, PageAnnotationsService, PageAnnotationsService as PageAnnotationsService$1, PageDeleteResult, PageFlattenResult, PageFlattenUsage, PageGeometryService, PageGeometryService as PageGeometryService$1, PageGeometrySnapshot, PageHandle, PageHandle as PageHandle$1, PageImageHandle, PageImageOptions, PageInsertBlankSpec, PageInsertResult, PageListSnapshot, PageMoveResult, PageNameInput, PageNameResult, PageObjectNumber, PageRaster, PageRemoveNameInput, PageRenderOptions, PageRenderService, PageRenderService as PageRenderService$1, PageRotateResult, PageRotation, PageStructureCache, PageTextService, PageTextService as PageTextService$1, PageTextSnapshot, PdfSaveMode, PdfSaveMode as PdfSaveMode$1, SearchRequest, SearchSlice, TokenSource, WeakAnnotationEditSession } from "@embedpdf/engine-core/runtime";
|
|
1
|
+
import { AbortError, AbortablePromise, AbortablePromise as AbortablePromise$1, AnnotationAppearanceImageOptions, AnnotationAppearanceImagesResult, AnnotationAppearanceRenderOptions, AnnotationAppearancesResult, AnnotationCreateResult, AnnotationDeleteResult, AnnotationDraft, AnnotationFlattenResult, AnnotationListPageSnapshot, AnnotationListSnapshotAllPages, AnnotationMoveResult, AnnotationPatch, AnnotationRef, AnnotationUpdateResult, AttachmentContent, AttachmentsCache, DocumentAccessInfo, DocumentActionsService, DocumentAnnotationsService, DocumentAnnotationsService as DocumentAnnotationsService$1, DocumentAttachmentsService, DocumentCapabilities, DocumentEventStream, DocumentFormsService, DocumentHandle, DocumentHandle as DocumentHandle$1, DocumentIdentity, DocumentMetadata, DocumentPagesService, DocumentPagesService as DocumentPagesService$1, DocumentRedactionService, DocumentRenderService, DocumentSearchService, DocumentSecurityService, DocumentSecurityService as DocumentSecurityService$1, DocumentSecurityState, DocumentSignaturesService, DocumentUnlockInput, DocumentUnlockResult, Engine, Engine as Engine$1, EngineError, EngineError as EngineError$1, EngineErrorCode, EngineFactory, MetadataCache, MetadataPatch, MetadataService, MetadataService as MetadataService$1, MetadataUpdateResult, MutationMeta, OpenInput, OpenInput as OpenInput$1, OpenInputShare, OpenOptions, OpenOptions as OpenOptions$1, PageAnnotationsService, PageAnnotationsService as PageAnnotationsService$1, PageDeleteResult, PageFlattenResult, PageFlattenUsage, PageGeometryService, PageGeometryService as PageGeometryService$1, PageGeometrySnapshot, PageHandle, PageHandle as PageHandle$1, PageImageHandle, PageImageOptions, PageInsertBlankSpec, PageInsertResult, PageListSnapshot, PageMeasureService, PageMeasurementViewport, PageMoveResult, PageNameInput, PageNameResult, PageObjectNumber, PageRaster, PageRemoveNameInput, PageRenderOptions, PageRenderService, PageRenderService as PageRenderService$1, PageRotateResult, PageRotation, PageStructureCache, PageTextService, PageTextService as PageTextService$1, PageTextSnapshot, PdfMeasure, PdfSaveMode, PdfSaveMode as PdfSaveMode$1, SearchRequest, SearchSlice, TokenSource, WeakAnnotationEditSession } from "@embedpdf/engine-core/runtime";
|
|
2
2
|
import { CdnAccessInfoForApply, DocumentHead, DocumentManifest, LayerScopePlane } from "@embedpdf/engine-core/wire";
|
|
3
3
|
import { SessionEventPublisher } from "@embedpdf/engine-services";
|
|
4
4
|
//#region src/transport/HttpClient.d.ts
|
|
@@ -179,6 +179,7 @@ declare class HttpClient {
|
|
|
179
179
|
/** PATCH counterpart of {@link postMultipartJson} (binary-carrying mutations). */
|
|
180
180
|
patchMultipartJson<T>(path: string, body: FormData, parser: (raw: unknown) => T, signal: AbortSignal): Promise<T>;
|
|
181
181
|
postJson<T>(path: string, body: unknown, parser: (raw: unknown) => T, signal: AbortSignal): Promise<T>;
|
|
182
|
+
putJson<T>(path: string, body: unknown, parser: (raw: unknown) => T, signal: AbortSignal): Promise<T>;
|
|
182
183
|
/** POST a JSON body and return the raw binary response (pages.extract). */
|
|
183
184
|
postJsonBytes(path: string, body: unknown, signal: AbortSignal): Promise<Uint8Array>;
|
|
184
185
|
/** POST a raw binary body (FDF/XFDF import) and parse the JSON response. */
|
|
@@ -625,6 +626,21 @@ declare class CloudPageTextService implements PageTextService$1 {
|
|
|
625
626
|
read(): AbortablePromise$1<PageTextSnapshot>;
|
|
626
627
|
}
|
|
627
628
|
//#endregion
|
|
629
|
+
//#region src/document/CloudPageMeasureService.d.ts
|
|
630
|
+
declare class CloudPageMeasureService implements PageMeasureService {
|
|
631
|
+
private readonly http;
|
|
632
|
+
private readonly docId;
|
|
633
|
+
private readonly layerName;
|
|
634
|
+
private readonly pon;
|
|
635
|
+
private readonly isClosed;
|
|
636
|
+
private readonly manifest;
|
|
637
|
+
private readonly publisher;
|
|
638
|
+
constructor(http: HttpClient, docId: string, layerName: string, pon: number, isClosed: () => boolean, manifest: ManifestAccessor, publisher: SessionEventPublisher);
|
|
639
|
+
viewports(): AbortablePromise$1<PageMeasurementViewport[]>;
|
|
640
|
+
setScale(measure: PdfMeasure | null): AbortablePromise$1<void>;
|
|
641
|
+
private check;
|
|
642
|
+
}
|
|
643
|
+
//#endregion
|
|
628
644
|
//#region src/document/CloudPageHandle.d.ts
|
|
629
645
|
declare class CloudPageHandle implements PageHandle$1 {
|
|
630
646
|
readonly pageObjectNumber: PageObjectNumber;
|
|
@@ -633,6 +649,7 @@ declare class CloudPageHandle implements PageHandle$1 {
|
|
|
633
649
|
readonly text: CloudPageTextService;
|
|
634
650
|
readonly geometry: CloudPageGeometryService;
|
|
635
651
|
readonly render: CloudPageRenderService;
|
|
652
|
+
readonly measure: CloudPageMeasureService;
|
|
636
653
|
constructor(pageObjectNumber: PageObjectNumber, pageIndex: number, http: HttpClient, docId: string, layerName: string, isClosed: () => boolean, manifest: ManifestAccessor, publisher: SessionEventPublisher);
|
|
637
654
|
}
|
|
638
655
|
//#endregion
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AbortError, AbortablePromise, AbortablePromise as AbortablePromise$1, AnnotationAppearanceImageOptions, AnnotationAppearanceImagesResult, AnnotationAppearanceRenderOptions, AnnotationAppearancesResult, AnnotationCreateResult, AnnotationDeleteResult, AnnotationDraft, AnnotationFlattenResult, AnnotationListPageSnapshot, AnnotationListSnapshotAllPages, AnnotationMoveResult, AnnotationPatch, AnnotationRef, AnnotationUpdateResult, AttachmentContent, AttachmentsCache, DocumentAccessInfo, DocumentActionsService, DocumentAnnotationsService, DocumentAnnotationsService as DocumentAnnotationsService$1, DocumentAttachmentsService, DocumentCapabilities, DocumentEventStream, DocumentFormsService, DocumentHandle, DocumentHandle as DocumentHandle$1, DocumentIdentity, DocumentMetadata, DocumentPagesService, DocumentPagesService as DocumentPagesService$1, DocumentRedactionService, DocumentRenderService, DocumentSearchService, DocumentSecurityService, DocumentSecurityService as DocumentSecurityService$1, DocumentSecurityState, DocumentSignaturesService, DocumentUnlockInput, DocumentUnlockResult, Engine, Engine as Engine$1, EngineError, EngineError as EngineError$1, EngineErrorCode, EngineFactory, MetadataCache, MetadataPatch, MetadataService, MetadataService as MetadataService$1, MetadataUpdateResult, MutationMeta, OpenInput, OpenInput as OpenInput$1, OpenInputShare, OpenOptions, OpenOptions as OpenOptions$1, PageAnnotationsService, PageAnnotationsService as PageAnnotationsService$1, PageDeleteResult, PageFlattenResult, PageFlattenUsage, PageGeometryService, PageGeometryService as PageGeometryService$1, PageGeometrySnapshot, PageHandle, PageHandle as PageHandle$1, PageImageHandle, PageImageOptions, PageInsertBlankSpec, PageInsertResult, PageListSnapshot, PageMoveResult, PageNameInput, PageNameResult, PageObjectNumber, PageRaster, PageRemoveNameInput, PageRenderOptions, PageRenderService, PageRenderService as PageRenderService$1, PageRotateResult, PageRotation, PageStructureCache, PageTextService, PageTextService as PageTextService$1, PageTextSnapshot, PdfSaveMode, PdfSaveMode as PdfSaveMode$1, SearchRequest, SearchSlice, TokenSource, WeakAnnotationEditSession } from "@embedpdf/engine-core/runtime";
|
|
1
|
+
import { AbortError, AbortablePromise, AbortablePromise as AbortablePromise$1, AnnotationAppearanceImageOptions, AnnotationAppearanceImagesResult, AnnotationAppearanceRenderOptions, AnnotationAppearancesResult, AnnotationCreateResult, AnnotationDeleteResult, AnnotationDraft, AnnotationFlattenResult, AnnotationListPageSnapshot, AnnotationListSnapshotAllPages, AnnotationMoveResult, AnnotationPatch, AnnotationRef, AnnotationUpdateResult, AttachmentContent, AttachmentsCache, DocumentAccessInfo, DocumentActionsService, DocumentAnnotationsService, DocumentAnnotationsService as DocumentAnnotationsService$1, DocumentAttachmentsService, DocumentCapabilities, DocumentEventStream, DocumentFormsService, DocumentHandle, DocumentHandle as DocumentHandle$1, DocumentIdentity, DocumentMetadata, DocumentPagesService, DocumentPagesService as DocumentPagesService$1, DocumentRedactionService, DocumentRenderService, DocumentSearchService, DocumentSecurityService, DocumentSecurityService as DocumentSecurityService$1, DocumentSecurityState, DocumentSignaturesService, DocumentUnlockInput, DocumentUnlockResult, Engine, Engine as Engine$1, EngineError, EngineError as EngineError$1, EngineErrorCode, EngineFactory, MetadataCache, MetadataPatch, MetadataService, MetadataService as MetadataService$1, MetadataUpdateResult, MutationMeta, OpenInput, OpenInput as OpenInput$1, OpenInputShare, OpenOptions, OpenOptions as OpenOptions$1, PageAnnotationsService, PageAnnotationsService as PageAnnotationsService$1, PageDeleteResult, PageFlattenResult, PageFlattenUsage, PageGeometryService, PageGeometryService as PageGeometryService$1, PageGeometrySnapshot, PageHandle, PageHandle as PageHandle$1, PageImageHandle, PageImageOptions, PageInsertBlankSpec, PageInsertResult, PageListSnapshot, PageMeasureService, PageMeasurementViewport, PageMoveResult, PageNameInput, PageNameResult, PageObjectNumber, PageRaster, PageRemoveNameInput, PageRenderOptions, PageRenderService, PageRenderService as PageRenderService$1, PageRotateResult, PageRotation, PageStructureCache, PageTextService, PageTextService as PageTextService$1, PageTextSnapshot, PdfMeasure, PdfSaveMode, PdfSaveMode as PdfSaveMode$1, SearchRequest, SearchSlice, TokenSource, WeakAnnotationEditSession } from "@embedpdf/engine-core/runtime";
|
|
2
2
|
import { CdnAccessInfoForApply, DocumentHead, DocumentManifest, LayerScopePlane } from "@embedpdf/engine-core/wire";
|
|
3
3
|
import { SessionEventPublisher } from "@embedpdf/engine-services";
|
|
4
4
|
//#region src/transport/HttpClient.d.ts
|
|
@@ -179,6 +179,7 @@ declare class HttpClient {
|
|
|
179
179
|
/** PATCH counterpart of {@link postMultipartJson} (binary-carrying mutations). */
|
|
180
180
|
patchMultipartJson<T>(path: string, body: FormData, parser: (raw: unknown) => T, signal: AbortSignal): Promise<T>;
|
|
181
181
|
postJson<T>(path: string, body: unknown, parser: (raw: unknown) => T, signal: AbortSignal): Promise<T>;
|
|
182
|
+
putJson<T>(path: string, body: unknown, parser: (raw: unknown) => T, signal: AbortSignal): Promise<T>;
|
|
182
183
|
/** POST a JSON body and return the raw binary response (pages.extract). */
|
|
183
184
|
postJsonBytes(path: string, body: unknown, signal: AbortSignal): Promise<Uint8Array>;
|
|
184
185
|
/** POST a raw binary body (FDF/XFDF import) and parse the JSON response. */
|
|
@@ -625,6 +626,21 @@ declare class CloudPageTextService implements PageTextService$1 {
|
|
|
625
626
|
read(): AbortablePromise$1<PageTextSnapshot>;
|
|
626
627
|
}
|
|
627
628
|
//#endregion
|
|
629
|
+
//#region src/document/CloudPageMeasureService.d.ts
|
|
630
|
+
declare class CloudPageMeasureService implements PageMeasureService {
|
|
631
|
+
private readonly http;
|
|
632
|
+
private readonly docId;
|
|
633
|
+
private readonly layerName;
|
|
634
|
+
private readonly pon;
|
|
635
|
+
private readonly isClosed;
|
|
636
|
+
private readonly manifest;
|
|
637
|
+
private readonly publisher;
|
|
638
|
+
constructor(http: HttpClient, docId: string, layerName: string, pon: number, isClosed: () => boolean, manifest: ManifestAccessor, publisher: SessionEventPublisher);
|
|
639
|
+
viewports(): AbortablePromise$1<PageMeasurementViewport[]>;
|
|
640
|
+
setScale(measure: PdfMeasure | null): AbortablePromise$1<void>;
|
|
641
|
+
private check;
|
|
642
|
+
}
|
|
643
|
+
//#endregion
|
|
628
644
|
//#region src/document/CloudPageHandle.d.ts
|
|
629
645
|
declare class CloudPageHandle implements PageHandle$1 {
|
|
630
646
|
readonly pageObjectNumber: PageObjectNumber;
|
|
@@ -633,6 +649,7 @@ declare class CloudPageHandle implements PageHandle$1 {
|
|
|
633
649
|
readonly text: CloudPageTextService;
|
|
634
650
|
readonly geometry: CloudPageGeometryService;
|
|
635
651
|
readonly render: CloudPageRenderService;
|
|
652
|
+
readonly measure: CloudPageMeasureService;
|
|
636
653
|
constructor(pageObjectNumber: PageObjectNumber, pageIndex: number, http: HttpClient, docId: string, layerName: string, isClosed: () => boolean, manifest: ManifestAccessor, publisher: SessionEventPublisher);
|
|
637
654
|
}
|
|
638
655
|
//#endregion
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AbortError, AbortError as AbortError$1, AbortablePromise, AbortablePromise as AbortablePromise$1, CONTINUOUS_RENDER_POLICY, DEFAULT_PDF_SAVE_MODE, EngineError, EngineError as EngineError$1, EngineErrorCode, EngineErrorCode as EngineErrorCode$1, canonicalSearchQuery, checkCapability, checkCollab, checkSetGroup, createPageImageHandle, decodePdfBits, encodeFieldRefKey, encodeStableIdKey, expandRawScope, normalizeAnnotationDraft, normalizeAnnotationPatch, normalizeAttachmentFileSource, passwordPromptFromState, searchContentEpoch, securityStateFromHead } from "@embedpdf/engine-core/runtime";
|
|
2
|
-
import { AccessResponseSchema, AnnotationAppearanceManifestSchema, AnnotationCreateResultSchema, AnnotationDeleteResultSchema, AnnotationFlattenResultSchema, AnnotationListPageSnapshotSchema, AnnotationListSnapshotAllPagesSchema, AnnotationMoveResultSchema, AnnotationUpdateResultSchema, AttachmentCreateResultSchema, AttachmentDeleteResultSchema, ChangeAnalysisSchema, DEFAULT_LAYER_NAME, DocumentActionsSnapshotSchema, DocumentHeadSchema, DocumentManifestSchema, DocumentMetadataSchema, EmbeddedFileItemSchema, EngineErrorPayloadSchema, FormEffectsResultSchema, FormFieldCreateResultSchema, FormFieldDTOSchema, FormFieldDeleteResultSchema, FormFieldUpdateResultSchema, FormImportResultSchema, FormRepairResultSchema, FormSetValueResultSchema, FormSnapshotSchema, FormWidgetLinkResultSchema, MetadataUpdateResultSchema, PageDeleteResultSchema, PageFlattenResultSchema, PageGeometrySnapshotSchema, PageInsertResultSchema, PageListSnapshotSchema, PageMoveResultSchema, PageNameResultSchema, PageRotateResultSchema, PageTextSnapshotSchema, RedactionApplyResultSchema, SearchSliceSchema, SignatureAbortResultSchema, SignatureCompleteResultSchema, SignaturePreparedWireSchema, SignatureSnapshotSchema, WeakAnnotationSessionResponseSchema, annotationAppearancesImageOptionsToWire, applyCdnAccess, decodePrepared, decodeSearchToken, decodeTokenText, encodeSearchToken, renderImageOptionsToWire, toBase64, wirePaths } from "@embedpdf/engine-core/wire";
|
|
2
|
+
import { AccessResponseSchema, AnnotationAppearanceManifestSchema, AnnotationCreateResultSchema, AnnotationDeleteResultSchema, AnnotationFlattenResultSchema, AnnotationListPageSnapshotSchema, AnnotationListSnapshotAllPagesSchema, AnnotationMoveResultSchema, AnnotationUpdateResultSchema, AttachmentCreateResultSchema, AttachmentDeleteResultSchema, ChangeAnalysisSchema, DEFAULT_LAYER_NAME, DocumentActionsSnapshotSchema, DocumentHeadSchema, DocumentManifestSchema, DocumentMetadataSchema, EmbeddedFileItemSchema, EngineErrorPayloadSchema, FormEffectsResultSchema, FormFieldCreateResultSchema, FormFieldDTOSchema, FormFieldDeleteResultSchema, FormFieldUpdateResultSchema, FormImportResultSchema, FormRepairResultSchema, FormSetValueResultSchema, FormSnapshotSchema, FormWidgetLinkResultSchema, MetadataUpdateResultSchema, PageDeleteResultSchema, PageFlattenResultSchema, PageGeometrySnapshotSchema, PageInsertResultSchema, PageListSnapshotSchema, PageMeasurementViewportSchema, PageMoveResultSchema, PageNameResultSchema, PageRotateResultSchema, PageScaleResultSchema, PageTextSnapshotSchema, RedactionApplyResultSchema, SearchSliceSchema, SignatureAbortResultSchema, SignatureCompleteResultSchema, SignaturePreparedWireSchema, SignatureSnapshotSchema, WeakAnnotationSessionResponseSchema, annotationAppearancesImageOptionsToWire, applyCdnAccess, decodePrepared, decodeSearchToken, decodeTokenText, encodeSearchToken, renderImageOptionsToWire, toBase64, wirePaths } from "@embedpdf/engine-core/wire";
|
|
3
3
|
import { EventHub, SessionEventPublisher, generateUuid } from "@embedpdf/engine-services";
|
|
4
4
|
//#region src/document/planes.ts
|
|
5
5
|
/**
|
|
@@ -793,7 +793,8 @@ function queryIdentity(query) {
|
|
|
793
793
|
query.text,
|
|
794
794
|
query.matchCase ? 1 : 0,
|
|
795
795
|
query.matchDiacritics ? 1 : 0,
|
|
796
|
-
query.wholeWord ? 1 : 0
|
|
796
|
+
query.wholeWord ? 1 : 0,
|
|
797
|
+
query.ignoreWhitespace ? 1 : 0
|
|
797
798
|
]);
|
|
798
799
|
}
|
|
799
800
|
//#endregion
|
|
@@ -1614,6 +1615,41 @@ var CloudPageTextService = class {
|
|
|
1614
1615
|
}
|
|
1615
1616
|
};
|
|
1616
1617
|
//#endregion
|
|
1618
|
+
//#region src/document/CloudPageMeasureService.ts
|
|
1619
|
+
var CloudPageMeasureService = class {
|
|
1620
|
+
constructor(http, docId, layerName, pon, isClosed, manifest, publisher) {
|
|
1621
|
+
this.http = http;
|
|
1622
|
+
this.docId = docId;
|
|
1623
|
+
this.layerName = layerName;
|
|
1624
|
+
this.pon = pon;
|
|
1625
|
+
this.isClosed = isClosed;
|
|
1626
|
+
this.manifest = manifest;
|
|
1627
|
+
this.publisher = publisher;
|
|
1628
|
+
}
|
|
1629
|
+
viewports() {
|
|
1630
|
+
return AbortablePromise$1.run(async (signal) => {
|
|
1631
|
+
this.check();
|
|
1632
|
+
return this.http.getJson(wirePaths.layerPageViewports(this.docId, this.layerName, this.pon), (raw) => PageMeasurementViewportSchema.array().parse(raw), signal);
|
|
1633
|
+
});
|
|
1634
|
+
}
|
|
1635
|
+
setScale(measure) {
|
|
1636
|
+
return AbortablePromise$1.run(async (signal) => {
|
|
1637
|
+
await Promise.resolve();
|
|
1638
|
+
signal.throwIfAborted();
|
|
1639
|
+
this.check();
|
|
1640
|
+
const result = await this.http.putJson(wirePaths.layerPageScale(this.docId, this.layerName, this.pon), { measure }, (raw) => PageScaleResultSchema.parse(raw), signal);
|
|
1641
|
+
this.manifest.apply(result.meta, []);
|
|
1642
|
+
this.publisher.publishLocal({
|
|
1643
|
+
type: "page.viewportsChanged",
|
|
1644
|
+
...result
|
|
1645
|
+
});
|
|
1646
|
+
});
|
|
1647
|
+
}
|
|
1648
|
+
check() {
|
|
1649
|
+
if (this.isClosed()) throw new EngineError$1(EngineErrorCode$1.DocNotOpen, `Document not open: ${this.docId}`);
|
|
1650
|
+
}
|
|
1651
|
+
};
|
|
1652
|
+
//#endregion
|
|
1617
1653
|
//#region src/document/CloudPageHandle.ts
|
|
1618
1654
|
var CloudPageHandle = class {
|
|
1619
1655
|
constructor(pageObjectNumber, pageIndex, http, docId, layerName, isClosed, manifest, publisher) {
|
|
@@ -1623,6 +1659,8 @@ var CloudPageHandle = class {
|
|
|
1623
1659
|
_defineProperty(this, "text", void 0);
|
|
1624
1660
|
_defineProperty(this, "geometry", void 0);
|
|
1625
1661
|
_defineProperty(this, "render", void 0);
|
|
1662
|
+
_defineProperty(this, "measure", void 0);
|
|
1663
|
+
this.measure = new CloudPageMeasureService(http, docId, layerName, pageObjectNumber, isClosed, manifest, publisher);
|
|
1626
1664
|
this.annotations = new CloudPageAnnotationsService(http, docId, layerName, pageObjectNumber, isClosed, manifest, publisher);
|
|
1627
1665
|
this.text = new CloudPageTextService(http, docId, layerName, pageObjectNumber, isClosed, manifest);
|
|
1628
1666
|
this.geometry = new CloudPageGeometryService(http, docId, layerName, pageObjectNumber, isClosed, manifest);
|
|
@@ -1655,6 +1693,11 @@ function auditRowToEvent(row, mySessionId) {
|
|
|
1655
1693
|
serverId: row.id
|
|
1656
1694
|
};
|
|
1657
1695
|
switch (row.kind) {
|
|
1696
|
+
case "measure.setScale": return {
|
|
1697
|
+
type: "page.viewportsChanged",
|
|
1698
|
+
origin,
|
|
1699
|
+
...row.payload
|
|
1700
|
+
};
|
|
1658
1701
|
case "annot.create": return {
|
|
1659
1702
|
type: "annotation.created",
|
|
1660
1703
|
pageObjectNumber: row.pageObjectNumber ?? row.affectedPages[0] ?? 0,
|
|
@@ -2274,6 +2317,9 @@ var CloudDocumentHandle = class {
|
|
|
2274
2317
|
* whose hand caused the change. */
|
|
2275
2318
|
absorbRemoteEvent(event) {
|
|
2276
2319
|
switch (event.type) {
|
|
2320
|
+
case "page.viewportsChanged":
|
|
2321
|
+
this.absorbMutation(event.meta, []);
|
|
2322
|
+
return;
|
|
2277
2323
|
case "annotation.created":
|
|
2278
2324
|
case "annotation.updated":
|
|
2279
2325
|
case "annotation.deleted":
|
|
@@ -2690,6 +2736,9 @@ var HttpClient = class HttpClient {
|
|
|
2690
2736
|
const res = await this.requestJson(path, "POST", body, signal);
|
|
2691
2737
|
return await this.parseJsonResponse(res, parser);
|
|
2692
2738
|
}
|
|
2739
|
+
async putJson(path, body, parser, signal) {
|
|
2740
|
+
return this.parseJsonResponse(await this.requestJson(path, "PUT", body, signal), parser);
|
|
2741
|
+
}
|
|
2693
2742
|
/** POST a JSON body and return the raw binary response (pages.extract). */
|
|
2694
2743
|
async postJsonBytes(path, body, signal) {
|
|
2695
2744
|
const res = await this.requestJson(path, "POST", body, signal);
|