@lax-wp/editor 0.3.17 → 0.3.19
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/config/EditorConfig.d.ts +7 -0
- package/dist/index.es.js +5172 -5169
- package/dist/index.umd.js +55 -55
- package/package.json +1 -1
|
@@ -82,6 +82,8 @@ export interface AIAutocompletionConfig {
|
|
|
82
82
|
/** Required: Custom fetch function for API calls. AI autocompletion only works when this is provided. */
|
|
83
83
|
fetchCompletion?: (text: string) => Promise<string>;
|
|
84
84
|
}
|
|
85
|
+
/** Pass scan/API JSON or an HTML string into the editor (used with {@link EditorConfig.onScanComplete}). */
|
|
86
|
+
export type ApplyScanCompleteContent = (editorContent: string | Record<string, unknown>) => void;
|
|
85
87
|
export interface EditorConfig {
|
|
86
88
|
/** Editor mode */
|
|
87
89
|
mode?: TEditorMode;
|
|
@@ -162,6 +164,11 @@ export interface EditorConfig {
|
|
|
162
164
|
settings?: PiiDetectionConfig;
|
|
163
165
|
onSaveAnonymizationSettings?: (payload: AnonymizationSavePayload) => void;
|
|
164
166
|
onScanDocument?: (json: Record<string, unknown>) => Promise<ScanDocumentResult | void>;
|
|
167
|
+
/**
|
|
168
|
+
* Called once when the editor is ready. You receive {@link ApplyScanCompleteContent};
|
|
169
|
+
* call it after a scan/API returns to load new document JSON (normalized for anonymization) or HTML.
|
|
170
|
+
*/
|
|
171
|
+
onScanComplete?: (applyScanCompleteContent: ApplyScanCompleteContent) => void;
|
|
165
172
|
onRevertAnonymization?: () => void;
|
|
166
173
|
onAnonymizeDocument?: () => void;
|
|
167
174
|
isAnonymized?: boolean;
|