@acrolinx/sidebar-sdk 2.0.0-dev1 → 2.0.1
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/README.md +3 -4
- package/dist/index.d.ts +45 -0
- package/dist/index.js +1985 -1736
- package/package.json +25 -22
package/README.md
CHANGED
|
@@ -89,11 +89,10 @@ The process to update your existing integration is straightforward and involves
|
|
|
89
89
|
- Run `npm i`
|
|
90
90
|
- Run `npm run build` to run all tests and build distribution
|
|
91
91
|
|
|
92
|
-
## Serve for Development
|
|
92
|
+
## Serve Tests for Development
|
|
93
93
|
|
|
94
|
-
- Run 'npm run
|
|
95
|
-
-
|
|
96
|
-
- Check the output of the above npm task and correct the host port if needed.
|
|
94
|
+
- Run 'npm run test'
|
|
95
|
+
- Browser with ViTest running will open
|
|
97
96
|
|
|
98
97
|
## License
|
|
99
98
|
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { CheckResult } from '@acrolinx/sidebar-interface';
|
|
|
7
7
|
import { default as default_2 } from '@ckeditor/ckeditor5-build-inline';
|
|
8
8
|
import { DocumentSelection } from '@acrolinx/sidebar-interface';
|
|
9
9
|
import { Editor } from 'tinymce';
|
|
10
|
+
import { EditorFromTextArea } from 'codemirror';
|
|
10
11
|
import { EditorView } from '@codemirror/view';
|
|
11
12
|
import { ExternalContent } from '@acrolinx/sidebar-interface';
|
|
12
13
|
import { InitParameters } from '@acrolinx/sidebar-interface';
|
|
@@ -96,7 +97,9 @@ export declare interface AcrolinxSidebarIntegration {
|
|
|
96
97
|
AutoBindAdapter: typeof AutoBindAdapter;
|
|
97
98
|
AsyncAutoBindAdapter: typeof AsyncAutoBindAdapter;
|
|
98
99
|
CKEditor5Adapter: typeof CKEditor5Adapter;
|
|
100
|
+
CKEditorAdapter: typeof CKEditorAdapter;
|
|
99
101
|
CodeMirror6Adapter: typeof CodeMirror6Adapter;
|
|
102
|
+
CodeMirrorAdapter: typeof CodeMirrorAdapter;
|
|
100
103
|
ContentEditableAdapter: typeof ContentEditableAdapter;
|
|
101
104
|
AsyncContentEditableAdapter: typeof StateBasedContentEditableAdapter;
|
|
102
105
|
InputAdapter: typeof InputAdapter;
|
|
@@ -226,6 +229,18 @@ export declare class CKEditor5Adapter extends AbstractRichtextEditorAdapter {
|
|
|
226
229
|
isInSourceEditingMode(): boolean;
|
|
227
230
|
}
|
|
228
231
|
|
|
232
|
+
export declare class CKEditorAdapter extends AbstractRichtextEditorAdapter {
|
|
233
|
+
editorId: string;
|
|
234
|
+
constructor(conf: HasEditorID);
|
|
235
|
+
getEditor(): CKEDITOR.editor;
|
|
236
|
+
getEditorDocument(): Document;
|
|
237
|
+
getContent(): string;
|
|
238
|
+
extractContentForCheck(): ContentExtractionResult;
|
|
239
|
+
selectRanges(checkId: string, matches: Match[]): void;
|
|
240
|
+
replaceRanges(checkId: string, matchesWithReplacementArg: MatchWithReplacement[]): void;
|
|
241
|
+
isInWysiwygMode(): boolean;
|
|
242
|
+
}
|
|
243
|
+
|
|
229
244
|
export declare class CodeMirror6Adapter implements AdapterInterface {
|
|
230
245
|
private config;
|
|
231
246
|
private currentContentChecking?;
|
|
@@ -254,6 +269,36 @@ declare type CodeMirror6AdapterConf = {
|
|
|
254
269
|
format?: string;
|
|
255
270
|
};
|
|
256
271
|
|
|
272
|
+
export declare class CodeMirrorAdapter implements AdapterInterface {
|
|
273
|
+
private config;
|
|
274
|
+
private currentContentChecking?;
|
|
275
|
+
private lastContentChecked?;
|
|
276
|
+
private formatDetectedByCheck;
|
|
277
|
+
constructor(conf: CodeMirrorAdapterConf);
|
|
278
|
+
configure(partialConfig: Partial<CodeMirrorAdapterConf>): void;
|
|
279
|
+
private validateConf;
|
|
280
|
+
getContent(): string;
|
|
281
|
+
getFormat(): string;
|
|
282
|
+
private getFormatFromCodeMirror;
|
|
283
|
+
extractContentForCheck(opts: ExtractContentForCheckOpts): ContentExtractionResult;
|
|
284
|
+
private getSelection;
|
|
285
|
+
registerCheckResult(checkResult: SuccessfulCheckResult): void;
|
|
286
|
+
registerCheckCall(_checkInfo: Check): void;
|
|
287
|
+
private lookupMatchesOrThrow;
|
|
288
|
+
selectRanges(_checkId: string, matches: Match[]): void;
|
|
289
|
+
replaceRanges(_checkId: string, matchesWithReplacement: MatchWithReplacement[]): void;
|
|
290
|
+
private getEscapeFunction;
|
|
291
|
+
private getDoc;
|
|
292
|
+
private selectRange;
|
|
293
|
+
private selectRangeAndScroll;
|
|
294
|
+
private cmSelectionToRange;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
declare type CodeMirrorAdapterConf = {
|
|
298
|
+
editor: CodeMirror.Editor | EditorFromTextArea;
|
|
299
|
+
format?: string;
|
|
300
|
+
};
|
|
301
|
+
|
|
257
302
|
declare interface CommonAdapterConf {
|
|
258
303
|
scrollOffsetY?: number;
|
|
259
304
|
disableInputEventSimulation?: boolean;
|