From faef2679a56f24705b88a5f19040c16295fdf39e Mon Sep 17 00:00:00 2001 From: Ahmed Abdelsalam Date: Mon, 11 Apr 2022 15:23:59 +0200 Subject: [PATCH 1/6] DEV-29518; feat: Updated Match interface with external content matches --- src/index.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/index.ts b/src/index.ts index e5a2a52..fe3deb0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -417,6 +417,24 @@ export interface Match { * Available since the 5.2.1 server. */ locations?: MatchLocation[]; + + externalContentMatches?: ExternalContentMatch[]; + + +} + +export interface ExternalContentMatch { + id: string; + type: ExternalContentType; + range: [number, number]; + externalContentMatches: ExternalContentMatch[] +} + +export enum ExternalContentType { + entities = 'entities', + textReplacements = 'textReplacements', + ditaReferences = 'ditaReferences', + xincludeReferences = 'xincludeReferences' } export interface MatchLocation { From 2ff3e19604c26dcbd64b4638b95881ae25e28978 Mon Sep 17 00:00:00 2001 From: Ahmed Abdelsalam Date: Mon, 11 Apr 2022 15:40:17 +0200 Subject: [PATCH 2/6] DEV-29518; feat: Update version to 15.2.0 --- package.json | 2 +- src/index.ts | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/package.json b/package.json index 6d9eaeb..796be45 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@acrolinx/sidebar-interface", "description": "The interface of the Acrolinx Sidebar", - "version": "15.1.0", + "version": "15.2.0", "license": "Apache-2.0", "author": "Acrolinx", "url": "https://www.acrolinx.com", diff --git a/src/index.ts b/src/index.ts index fe3deb0..fb78284 100644 --- a/src/index.ts +++ b/src/index.ts @@ -419,8 +419,6 @@ export interface Match { locations?: MatchLocation[]; externalContentMatches?: ExternalContentMatch[]; - - } export interface ExternalContentMatch { From 6f533f6a7c5de4d7ca31f3143bbc66f38d4bc1d6 Mon Sep 17 00:00:00 2001 From: Ahmed Abdelsalam Date: Wed, 13 Apr 2022 19:05:35 +0200 Subject: [PATCH 3/6] DEV-29518; feat: Added AugmentedExternalContent - Updated type of external content match to string - Added AugmentedExternalContent to simplify adding new types of External Content --- src/index.ts | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/index.ts b/src/index.ts index fb78284..c8e8137 100644 --- a/src/index.ts +++ b/src/index.ts @@ -340,6 +340,12 @@ export interface ExternalContent { entities?: ExternalContentField[]; ditaReferences?: ExternalContentField[]; xincludeReferences? : ExternalContentField[]; + references?: AugmentedExternalContent[]; +} + +export interface AugmentedExternalContent { + type: string, + value: ExternalContentField[], } /** @@ -418,22 +424,19 @@ export interface Match { */ locations?: MatchLocation[]; + /** + * Available since the x.x server. + */ externalContentMatches?: ExternalContentMatch[]; } export interface ExternalContentMatch { id: string; - type: ExternalContentType; + type: string; range: [number, number]; - externalContentMatches: ExternalContentMatch[] + externalContentMatches?: ExternalContentMatch[] } -export enum ExternalContentType { - entities = 'entities', - textReplacements = 'textReplacements', - ditaReferences = 'ditaReferences', - xincludeReferences = 'xincludeReferences' -} export interface MatchLocation { type: string; From fae8f4947d7131c0c5c2d839353fcfcb52de3666 Mon Sep 17 00:00:00 2001 From: Ahmed Abdelsalam Date: Fri, 22 Apr 2022 17:07:24 +0200 Subject: [PATCH 4/6] DEV-29518; feat: Updated CheckedDocumentPart to support external content matches - Updated range of ExternalContentMatch interface --- src/index.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index c8e8137..bb1aa2d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -399,8 +399,17 @@ export interface CheckedDocumentPart { * A range are two numbers: A start offset and an end offset. */ range: [number, number]; + + externalContent?: CheckedExternalDocumentPart[]; } +export interface CheckedExternalDocumentPart { + + id: string; + + range: [number, number]; + +} export type InvalidDocumentPart = CheckedDocumentPart; export type CheckedDocumentRange = CheckedDocumentPart; @@ -430,10 +439,12 @@ export interface Match { externalContentMatches?: ExternalContentMatch[]; } +//TODO: Use sdk.js ? export interface ExternalContentMatch { id: string; type: string; - range: [number, number]; + originalBegin: number; + originalEnd: number; externalContentMatches?: ExternalContentMatch[] } From 6c3d7e55fa632b91387e6c26f057a82524d72e37 Mon Sep 17 00:00:00 2001 From: Ahmed Abdelsalam Date: Tue, 3 May 2022 17:43:48 +0200 Subject: [PATCH 5/6] DEV-29518; feat: Undo restructuring of external content in CheckedDocumentPart --- src/index.ts | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/index.ts b/src/index.ts index bb1aa2d..a930d4e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -400,15 +400,7 @@ export interface CheckedDocumentPart { */ range: [number, number]; - externalContent?: CheckedExternalDocumentPart[]; -} - -export interface CheckedExternalDocumentPart { - - id: string; - - range: [number, number]; - + externalContent?: ExternalContentMatch[]; } export type InvalidDocumentPart = CheckedDocumentPart; From 378cb2b9b7973fec4f2918b27680b8b4ba8a4663 Mon Sep 17 00:00:00 2001 From: Ahmed Abdelsalam Date: Tue, 10 May 2022 17:11:20 +0200 Subject: [PATCH 6/6] DEV-29518; style: Remove unneccessary comments, add server version in comment for external content --- src/index.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index a930d4e..8a050ee 100644 --- a/src/index.ts +++ b/src/index.ts @@ -426,12 +426,11 @@ export interface Match { locations?: MatchLocation[]; /** - * Available since the x.x server. + * Available since the 2022.05 server. */ externalContentMatches?: ExternalContentMatch[]; } -//TODO: Use sdk.js ? export interface ExternalContentMatch { id: string; type: string;