@progress/kendo-vue-editor 6.0.0-develop.7 → 6.0.1-develop.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/index.d.mts CHANGED
@@ -1926,1011 +1926,3 @@ preventDefault(e: any): void;
1926
1926
  }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
1927
1927
 
1928
1928
  export { }
1929
-
1930
-
1931
- /**
1932
- * Represents a wrapping namespace for the tool components, props, and functions of the Editor.
1933
- */
1934
- export declare namespace EditorTools {
1935
- /**
1936
- * The props for the Align tool component of the Editor.
1937
- */
1938
- interface AlignToolProps extends ToolProps {
1939
- }
1940
- /**
1941
- * The props for the AlignLeft tool component of the Editor.
1942
- */
1943
- interface AlignLeftProps extends AlignToolProps {
1944
- }
1945
- /**
1946
- * The props for the AlignRight tool component of the Editor.
1947
- */
1948
- interface AlignRightProps extends AlignToolProps {
1949
- }
1950
- /**
1951
- * The props for the AlignCenter tool component of the Editor.
1952
- */
1953
- interface AlignCenterProps extends AlignToolProps {
1954
- }
1955
- /**
1956
- * The props for the AlignJustify tool component of the Editor.
1957
- */
1958
- interface AlignJustifyProps extends AlignToolProps {
1959
- }
1960
- /**
1961
- * The props for the Print tool component of the Editor.
1962
- */
1963
- interface PrintProps extends PrintToolProps {
1964
- }
1965
- /**
1966
- * The props for the Export to PDF tool component of the Editor.
1967
- */
1968
- interface PdfProps extends PdfToolProps {
1969
- }
1970
- /**
1971
- * The props for the AddRowBefore tool component of the Editor.
1972
- */
1973
- interface AddRowBeforeProps extends TableEditNS.AddRowBeforeProps {
1974
- }
1975
- /**
1976
- * The props for the AddRowAfter tool component of the Editor.
1977
- */
1978
- interface AddRowAfterProps extends TableEditNS.AddRowAfterProps {
1979
- }
1980
- /**
1981
- * The props for the AddColumnBefore tool component of the Editor.
1982
- */
1983
- interface AddColumnBeforeProps extends TableEditNS.AddColumnBeforeProps {
1984
- }
1985
- /**
1986
- * The props for the AddColumnAfter tool component of the Editor.
1987
- */
1988
- interface AddColumnAfterProps extends TableEditNS.AddColumnAfterProps {
1989
- }
1990
- /**
1991
- * The props for the DeleteRow tool component of the Editor.
1992
- */
1993
- interface DeleteRowProps extends TableEditNS.DeleteRowProps {
1994
- }
1995
- /**
1996
- * The props for the DeleteColumn tool component of the Editor.
1997
- */
1998
- interface DeleteColumnProps extends TableEditNS.DeleteColumnProps {
1999
- }
2000
- /**
2001
- * The props for the DeleteTable tool component of the Editor.
2002
- */
2003
- interface DeleteTableProps extends TableEditNS.DeleteTableProps {
2004
- }
2005
- /**
2006
- * The props for the MergeCells tool component of the Editor.
2007
- */
2008
- interface MergeCellsProps extends TableEditNS.MergeCellsProps {
2009
- }
2010
- /**
2011
- * The props for the SplitCell tool component of the Editor.
2012
- */
2013
- interface SplitCellProps extends TableEditNS.SplitCellProps {
2014
- }
2015
- /**
2016
- * The props for the FindAndReplace tool component of the Editor.
2017
- */
2018
- interface FindAndReplaceProps extends FindAndReplaceToolProps {
2019
- }
2020
- }
2021
-
2022
-
2023
- /**
2024
- * Represents a wrapping namespace for the tool settings of the Editor.
2025
- */
2026
- export declare namespace EditorToolsSettings {
2027
- /**
2028
- * The type of the Editor command.
2029
- */
2030
- type Command = 'Bold' | 'Italic' | 'Underline' | 'Strikethrough' | 'Subscript' | 'Superscript' | 'Undo' | 'Redo' | 'Link' | 'Unlink' | 'InsertImage' | 'InsertFile' | 'AlignLeft' | 'AlignCenter' | 'AlignRight' | 'AlignJustify' | 'AlignRemove' | 'OrderedList' | 'UnorderedList' | 'Indent' | 'Outdent' | 'SetContent' | 'FontSize' | 'FontName' | 'ForeColor' | 'BackColor' | 'FormatBlock' | 'InsertTable' | 'AddRowBefore' | 'AddRowAfter' | 'AddColumnBefore' | 'AddColumnAfter' | 'DeleteRow' | 'DeleteColumn' | 'DeleteTable' | 'MergeCells' | 'SplitCell' | 'CleanFormatting' | 'Custom';
2031
- /**
2032
- * The settings of the toolbar tools.
2033
- */
2034
- interface ToolSettings {
2035
- /**
2036
- * The props which will be added to the Button component of the tool.
2037
- */
2038
- props: ButtonProps;
2039
- /**
2040
- * The keys of the messages that are used by the tool.
2041
- */
2042
- messages: {
2043
- [key: string]: string;
2044
- };
2045
- /**
2046
- * The name of the command that is used by the tool.
2047
- */
2048
- commandName?: Command;
2049
- command?: any;
2050
- }
2051
- /**
2052
- * The `AlignAction` object.
2053
- */
2054
- interface AlignAction {
2055
- /**
2056
- * The name of the target node.
2057
- */
2058
- node: string;
2059
- /**
2060
- * The styles that will be applied to the target node.
2061
- */
2062
- style: Array<{
2063
- name: string;
2064
- value: string;
2065
- }>;
2066
- }
2067
- /**
2068
- * The settings of the Align tool.
2069
- */
2070
- interface AlignSettings extends ToolSettings {
2071
- /**
2072
- * A collection of `AlignAction` objects which defines the behavior of the Align tool.
2073
- */
2074
- actions: Array<AlignAction>;
2075
- }
2076
- /**
2077
- * The settings of the Style tool which is presented by a DropDownList component.
2078
- */
2079
- interface StyleDropDownListSettings {
2080
- /**
2081
- * The name of the style which will be added or removed by the Style tool.
2082
- */
2083
- style: string;
2084
- /**
2085
- * The default item of the Style tool.
2086
- */
2087
- defaultItem: {
2088
- text: string;
2089
- value: string;
2090
- localizationKey?: string;
2091
- };
2092
- /**
2093
- * The data items of the Style tool.
2094
- */
2095
- items: Array<{
2096
- text: string;
2097
- value: string;
2098
- style?: {};
2099
- }>;
2100
- /**
2101
- * The name of the command that is used by the Style tool.
2102
- */
2103
- commandName?: Command;
2104
- }
2105
- /**
2106
- * The settings of the FormatBlock tool which is presented by a DropDownList.
2107
- */
2108
- interface FormatBlockDropDownListSettings {
2109
- /**
2110
- * The default item of the FormatBlock tool.
2111
- */
2112
- defaultItem: {
2113
- text: string;
2114
- value: string;
2115
- localizationKey?: string;
2116
- };
2117
- /**
2118
- * The data items of the FormatBlock tool.
2119
- */
2120
- items: Array<{
2121
- text: string;
2122
- value: string;
2123
- style?: {};
2124
- }>;
2125
- /**
2126
- * The name of the command that is used by the FormatBlock tool.
2127
- */
2128
- commandName?: Command;
2129
- }
2130
- /**
2131
- * The inline-formatting options.
2132
- */
2133
- interface InlineFormatOptions {
2134
- /**
2135
- * The mark which will be applied or stripped.
2136
- */
2137
- mark: string;
2138
- /**
2139
- * The additional marks which will be stripped.
2140
- */
2141
- altMarks?: Array<string>;
2142
- /**
2143
- * An object which holds the style that will be stripped by the tool.
2144
- */
2145
- altStyle?: {
2146
- /**
2147
- * The name of the style.
2148
- */
2149
- name: string;
2150
- /**
2151
- * The regular expression which will be matched with the value of the style.
2152
- */
2153
- value: RegExp;
2154
- };
2155
- }
2156
- /**
2157
- * The settings of the tool which applies inline formatting.
2158
- */
2159
- interface InlineFormatSettings extends ToolSettings, InlineFormatOptions {
2160
- }
2161
- /**
2162
- * The settings of the ForeColor and BackColor tools.
2163
- */
2164
- interface ApplyColorSettings {
2165
- /**
2166
- * The applied style by the tool (`color` or `background-color`).
2167
- */
2168
- color: string;
2169
- /**
2170
- * The props of the underlying [Kendo UI for Vue ColorPicker component]({% slug overview_colorpicker %}).
2171
- */
2172
- colorPickerProps: any;
2173
- /**
2174
- * The name of the applied command.
2175
- */
2176
- commandName: string;
2177
- /**
2178
- * The dir of the applied command.
2179
- */
2180
- dir?: String;
2181
- /**
2182
- * The ariaLabel of the applied command.
2183
- */
2184
- ariaLabel?: String;
2185
- }
2186
- /**
2187
- * The setting of the IndentAction tool.
2188
- */
2189
- interface IndentAction {
2190
- node: string;
2191
- style: string;
2192
- rtlStyle: string;
2193
- step: number;
2194
- unit: string;
2195
- }
2196
- /**
2197
- * The settings of the tool which applies indentation.
2198
- */
2199
- interface IndentationSettings extends ToolSettings {
2200
- actions: Array<IndentAction>;
2201
- /**
2202
- * The list node types of the Indent and Outdent tools.
2203
- */
2204
- listsTypes: {
2205
- orderedList: string;
2206
- bulletList: string;
2207
- listItem: string;
2208
- };
2209
- }
2210
- /**
2211
- * The settings of the Link tool or dialog.
2212
- */
2213
- interface LinkSettings extends ToolSettings {
2214
- mark: string;
2215
- linkTarget?: boolean;
2216
- }
2217
- /**
2218
- * The settings of the Unlink tool.
2219
- */
2220
- interface UnlinkSettings extends ToolSettings {
2221
- mark: string;
2222
- }
2223
- /**
2224
- * The settings of the InsertFile tool or dialog.
2225
- */
2226
- interface InsertFileSettings extends LinkSettings {
2227
- }
2228
- /**
2229
- * The settings of the tool which toggles lists.
2230
- */
2231
- interface ListSettings extends ToolSettings {
2232
- /**
2233
- * The list type of the tool.
2234
- */
2235
- listType: string;
2236
- /**
2237
- * The types of the list nodes that are used by the tool.
2238
- */
2239
- types: {
2240
- orderedList: string;
2241
- bulletList: string;
2242
- listItem: string;
2243
- };
2244
- }
2245
- /**
2246
- * The settings of the InsertTable tool.
2247
- */
2248
- interface InsertTableSettings extends ToolSettings {
2249
- }
2250
- /**
2251
- * The settings of the AddRowBefore tool.
2252
- */
2253
- interface AddRowBeforeSettings extends ToolSettings {
2254
- }
2255
- /**
2256
- * The settings of the AddRowAfter tool.
2257
- */
2258
- interface AddRowAfterSettings extends ToolSettings {
2259
- }
2260
- /**
2261
- * The settings of the AddColumnBefore tool.
2262
- */
2263
- interface AddColumnBeforeSettings extends ToolSettings {
2264
- }
2265
- /**
2266
- * The settings of the AddColumnAfter tool.
2267
- */
2268
- interface AddColumnAfterSettings extends ToolSettings {
2269
- }
2270
- /**
2271
- * The settings of the DeleteRow tool.
2272
- */
2273
- interface DeleteRowSettings extends ToolSettings {
2274
- }
2275
- /**
2276
- * The settings of the DeleteColumn tool.
2277
- */
2278
- interface DeleteColumnSettings extends ToolSettings {
2279
- }
2280
- /**
2281
- * The settings of the DeleteTable tool.
2282
- */
2283
- interface DeleteTableSettings extends ToolSettings {
2284
- }
2285
- /**
2286
- * The settings of the MergeCells tool.
2287
- */
2288
- interface MergeCellsSettings extends ToolSettings {
2289
- }
2290
- /**
2291
- * The settings of the SplitCell tool.
2292
- */
2293
- interface SplitCellSettings extends ToolSettings {
2294
- }
2295
- /**
2296
- * The settings of the Print tool.
2297
- */
2298
- interface PrintSettings extends ToolSettings {
2299
- }
2300
- /**
2301
- * The settings of the SelectAll tool.
2302
- */
2303
- interface SelectAllSettings extends ToolSettings {
2304
- }
2305
- /**
2306
- * The settings of the Pdf tool.
2307
- */
2308
- interface PdfSettings extends ToolSettings {
2309
- }
2310
- /**
2311
- * The settings of the CleanFormatting tool.
2312
- */
2313
- interface CleanFormattingSettings extends ToolSettings {
2314
- }
2315
- /**
2316
- * The settings of the InsertImage tool or dialog.
2317
- */
2318
- interface ImageSettings extends ToolSettings {
2319
- node: string;
2320
- }
2321
- /**
2322
- * The settings of the ViewHtml tool or dialog.
2323
- */
2324
- interface ViewHtmlSettings extends ToolSettings {
2325
- }
2326
- /**
2327
- * The settings of the Find and Replace tool or dialog.
2328
- */
2329
- interface FindReplaceSettings extends ToolSettings {
2330
- }
2331
- /**
2332
- * The object of the Bold tool settings.
2333
- */
2334
- const bold: InlineFormatSettings;
2335
- /**
2336
- * The object of the Italic tool settings.
2337
- */
2338
- const italic: InlineFormatSettings;
2339
- /**
2340
- * The object of the Underline tool settings.
2341
- */
2342
- const underline: InlineFormatSettings;
2343
- /**
2344
- * The object of the Strikethrough tool settings.
2345
- */
2346
- const strikethrough: InlineFormatSettings;
2347
- /**
2348
- * The object of the Subscript tool settings.
2349
- */
2350
- const subscript: InlineFormatSettings;
2351
- /**
2352
- * The object of the Superscript tool settings.
2353
- */
2354
- const superscript: InlineFormatSettings;
2355
- /**
2356
- * The object of the Link tool settings.
2357
- */
2358
- const link: LinkSettings;
2359
- /**
2360
- * The object of the Link tool settings.
2361
- */
2362
- const insertFile: InsertFileSettings;
2363
- /**
2364
- * The object of the InsertTable tool settings.
2365
- */
2366
- const insertTable: InsertTableSettings;
2367
- /**
2368
- * The object of the AddRowBefore tool settings.
2369
- */
2370
- const addRowBefore: AddRowBeforeSettings;
2371
- /**
2372
- * The object of the AddRowAfter tool settings.
2373
- */
2374
- const addRowAfter: AddRowAfterSettings;
2375
- /**
2376
- * The object of the AddColumnBefore tool settings.
2377
- */
2378
- const addColumnBefore: AddColumnBeforeSettings;
2379
- /**
2380
- * The object of the AddColumnAfter tool settings.
2381
- */
2382
- const addColumnAfter: AddColumnAfterSettings;
2383
- /**
2384
- * The object of the DeleteRow tool settings.
2385
- */
2386
- const deleteRow: DeleteRowSettings;
2387
- /**
2388
- * The object of the DeleteColumn tool settings.
2389
- */
2390
- const deleteColumn: DeleteColumnSettings;
2391
- /**
2392
- * The object of the DeleteTable tool settings.
2393
- */
2394
- const deleteTable: DeleteTableSettings;
2395
- /**
2396
- * The object of the MergeCells tool settings.
2397
- */
2398
- const mergeCells: MergeCellsSettings;
2399
- /**
2400
- * The object of the SplitCell tool settings.
2401
- */
2402
- const splitCell: SplitCellSettings;
2403
- /**
2404
- * The object of the Print tool settings.
2405
- */
2406
- const print: PrintSettings;
2407
- /**
2408
- * The object of the Print tool settings.
2409
- */
2410
- const selectAll: SelectAllSettings;
2411
- /**
2412
- * The object of the Print tool settings.
2413
- */
2414
- const pdf: PdfSettings;
2415
- /**
2416
- * The PDF export options.
2417
- *
2418
- * const savePdfOptions = {
2419
- * fileName: 'editor.pdf',
2420
- * paperSize: 'A4',
2421
- * margin: '1cm'
2422
- * };
2423
- */
2424
- const savePdfOptions: PDFExportProps;
2425
- /**
2426
- * The object of the CleanFormatting tool settings.
2427
- */
2428
- const cleanFormatting: CleanFormattingSettings;
2429
- /**
2430
- * The object of the InsertImage tool settings.
2431
- */
2432
- const image: ImageSettings;
2433
- /**
2434
- * The object of the ViewHtml tool settings.
2435
- */
2436
- const viewHtml: ViewHtmlSettings;
2437
- /**
2438
- * The object of the Find and Replace tool settings.
2439
- */
2440
- const findAndReplace: FindReplaceSettings;
2441
- /**
2442
- * The object of the Unlink tool settings.
2443
- */
2444
- const unlink: UnlinkSettings;
2445
- /**
2446
- * The object of the Undo tool settings.
2447
- */
2448
- const undo: ToolSettings;
2449
- /**
2450
- * The object of the Redo tool settings.
2451
- */
2452
- const redo: ToolSettings;
2453
- /**
2454
- * The object of the FontSize tool settings.
2455
- */
2456
- const fontSize: StyleDropDownListSettings;
2457
- /**
2458
- * The object of the FontName tool settings.
2459
- */
2460
- const fontName: StyleDropDownListSettings;
2461
- /**
2462
- * The object of the FormatBlock tool settings.
2463
- */
2464
- const formatBlock: FormatBlockDropDownListSettings;
2465
- /**
2466
- * The object of the ForeColor tool settings.
2467
- */
2468
- const foreColor: ApplyColorSettings;
2469
- /**
2470
- * The object of the BackColor tool settings.
2471
- */
2472
- const backColor: ApplyColorSettings;
2473
- /**
2474
- * The object of the AlignLeft tool settings.
2475
- */
2476
- const alignLeft: AlignSettings;
2477
- /**
2478
- * The object of the AlignRight tool settings.
2479
- */
2480
- const alignRight: AlignSettings;
2481
- /**
2482
- * The object of the AlignCenter tool settings.
2483
- */
2484
- const alignCenter: AlignSettings;
2485
- /**
2486
- * The object of the AlignJustify tool settings.
2487
- */
2488
- const alignJustify: AlignSettings;
2489
- /**
2490
- * The object of the AlignRemove tool settings.
2491
- */
2492
- const alignRemove: AlignSettings;
2493
- /**
2494
- * The object of the Indent tool settings.
2495
- */
2496
- const indent: IndentationSettings;
2497
- /**
2498
- * The object of the Outdent tool settings.
2499
- */
2500
- const outdent: IndentationSettings;
2501
- /**
2502
- * The object of the OrderedList tool settings.
2503
- */
2504
- const orderedList: ListSettings;
2505
- /**
2506
- * The object of the UnorderedList tool settings.
2507
- */
2508
- const bulletList: ListSettings;
2509
- }
2510
-
2511
-
2512
- /**
2513
- * Represents a wrapping namespace for the utility functions, `nodes`, and `marks` objects of the Editor.
2514
- */
2515
- export declare namespace EditorUtils {
2516
- /**
2517
- * Aligns the block elements in the selection.
2518
- *
2519
- * @returns {boolean} - If alignment is applied to any of the elements, returns `true`.
2520
- */
2521
- function alignBlocks(view: EditorView, actions: EditorToolsSettings.AlignAction[], command?: EditorToolsSettings.Command): boolean;
2522
- /**
2523
- * Wraps the selection in a `span` element with inline styles.
2524
- *
2525
- * @returns {boolean} - If a style is applied to any of the elements, returns `true`.
2526
- */
2527
- function applyInlineStyle(view: EditorView, options: {
2528
- style: string;
2529
- value: string;
2530
- }, command?: EditorToolsSettings.Command): boolean;
2531
- /**
2532
- * Applies the link mark.
2533
- *
2534
- * @returns {boolean} - If the link is applied, returns `true`.
2535
- */
2536
- function applyLink(view: any, options: {
2537
- mark: string;
2538
- attrs: any;
2539
- }, command?: EditorToolsSettings.Command): boolean;
2540
- /**
2541
- * Checks if any of the `list` elements in the selection can be indented.
2542
- *
2543
- * @returns {boolean}
2544
- */
2545
- function canIndentList(state: EditorState, nodeType: NodeType): boolean;
2546
- /**
2547
- * Checks if a node can be inserted in the current selection.
2548
- *
2549
- * @param {EditorState} state - The `state` object of the Editor.
2550
- * @param {NodeType} nodeType - The type of the node that will be inserted.
2551
- * @returns {boolean} - The node of this type can be inserted in the current selection.
2552
- */
2553
- function canInsert(state: EditorState, nodeType: NodeType): boolean;
2554
- /**
2555
- * Checks if any of the `list` elements in the selection can be outdented.
2556
- *
2557
- * @returns {boolean}
2558
- */
2559
- function canOutdentList(state: EditorState, listsTypes: {
2560
- listItem: string;
2561
- orderedList: string;
2562
- bulletList: string;
2563
- }): boolean;
2564
- /**
2565
- * Converts the MS Word lists into HTML lists.
2566
- *
2567
- * @param {string} html - The input HTML.
2568
- * @returns {string} - The result HTML.
2569
- */
2570
- function convertMsLists(html: string): string;
2571
- /**
2572
- * Creates an Editor document from HTML content.
2573
- *
2574
- * @param {Schema} schema - The `schema` object of the Editor.
2575
- * @param {string} html - The HTML content.
2576
- * @param {ParseOptions} parseOptions - The HTML parsing options. Defaults to `{ preserveWhitespace: 'full' }`.
2577
- * @returns {Node} - The `document` object of the Editor.
2578
- */
2579
- function createDocument(schema: Schema<any, any>, html: string, parseOptions?: ParseOptions): Node;
2580
- /**
2581
- * Creates a table.
2582
- *
2583
- * @param {object} tableTypes - An object which contains `table`, `table_row`, and `table_cell` node types.
2584
- * @param {number} rows - The number of rows.
2585
- * @param {number} columns - The number of columns.
2586
- * @returns {Node} - The generated table.
2587
- *
2588
- * @example
2589
- * ```jsx-no-run
2590
- * import { EditorUtils } from '@progress/kendo-vue-editor';
2591
- *
2592
- * const nodes = editorRef.view.state.schema.nodes;
2593
- * const rows = 3;
2594
- * const columns = 4;
2595
- *
2596
- * const table = EditorUtils.createTable(nodes, rows, columns);
2597
- * ```
2598
- */
2599
- function createTable(tableTypes: {
2600
- table: NodeType;
2601
- table_row: NodeType;
2602
- table_cell: NodeType;
2603
- }, rows: number, columns: number): Node;
2604
- /**
2605
- * Formats the paragraph and heading nodes in the selection.
2606
- *
2607
- * @returns {boolean} - If an element is formatted, returns `true`.
2608
- */
2609
- function formatBlockElements(view: EditorView, value: 'p' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6', commandName?: EditorToolsSettings.Command): boolean;
2610
- /**
2611
- * Returns the paragraph and heading nodes in the selection.
2612
- *
2613
- * @returns {string[]}
2614
- */
2615
- function getBlockFormats(state: EditorState): string[];
2616
- /**
2617
- * Gets the HTML from the `EditorState` object.
2618
- *
2619
- * @param {EditorState} state - The `state` object of the Editor or an object containing editor's `doc` and `schema`
2620
- * - { doc: value, schema: value.types.schema } where the `value` variable is the editor's value prop.
2621
- * @returns {string} - The HTML content.
2622
- */
2623
- function getHtml(state: EditorState | {
2624
- doc: Node;
2625
- schema: Schema;
2626
- }): string;
2627
- /**
2628
- * @returns {string[]} - An array of matched styles that are found in the selection.
2629
- */
2630
- function getInlineStyles(state: EditorState, style: {
2631
- name: string;
2632
- value: RegExp;
2633
- }): string[];
2634
- /**
2635
- * Returns a mark of the specified type from the nodes in selection.
2636
- *
2637
- * @returns {Mark}
2638
- */
2639
- function getMark(state: EditorState, markType: MarkType): Mark | undefined;
2640
- /**
2641
- * Checks if according to the specified `InlineFormatOptions` a node in the selection is present.
2642
- *
2643
- * @returns {boolean}
2644
- */
2645
- function hasMark(state: EditorState, options: EditorToolsSettings.InlineFormatOptions): boolean;
2646
- /**
2647
- * Checks if the selection contains a specific type of node.
2648
- *
2649
- * @returns {boolean}
2650
- */
2651
- function hasNode(state: EditorState, nodeType: NodeType): boolean;
2652
- /**
2653
- * Indents the block elements in the selection.
2654
- *
2655
- * @returns {boolean} - If indentation is applied to any of the elements, returns `true`.
2656
- */
2657
- function indentBlocks(view: EditorView, actions: EditorToolsSettings.IndentAction[], command?: EditorToolsSettings.Command, dir?: string): boolean;
2658
- /**
2659
- * Adds new lines after block elements and hard breaks.
2660
- *
2661
- * @param {string} content - The HTML content.
2662
- * @returns {string} - The indented HTML.
2663
- */
2664
- function indentHtml(content: string): string;
2665
- /**
2666
- * Inserts a node in the selection.
2667
- *
2668
- * @param {EditorView} view - The `view` object of the Editor.
2669
- * @param {Node} node - A `node` object of the Editor.
2670
- * @param {boolean} scrollIntoView - An optional parameter.
2671
- * Defines if the content element will be scrolled to the current selection.
2672
- */
2673
- function insertNode(view: EditorView | {
2674
- state: EditorState;
2675
- dispatch: (tr: Transaction) => void;
2676
- }, node: Node, scrollIntoView?: boolean | undefined): void;
2677
- /**
2678
- * Checks if any of the block elements in the selection is aligned.
2679
- *
2680
- * @returns {boolean}
2681
- */
2682
- function isAligned(state: EditorState, actions: EditorToolsSettings.AlignAction[]): boolean;
2683
- /**
2684
- * Checks if any of the block elements in the selection is indented.
2685
- *
2686
- * @returns {boolean}
2687
- */
2688
- function isIndented(state: any, actions: EditorToolsSettings.IndentAction[], dir?: string): boolean;
2689
- /**
2690
- * Removes the comments from the HTML.
2691
- *
2692
- * @param {string} html - The input HTML.
2693
- * @returns {string} - The result HTML.
2694
- *
2695
- * @example
2696
- * ```jsx-no-run
2697
- * import { EditorUtils } from '@progress/kendo-vue-editor';
2698
- * const html = EditorUtils.removeComments('<p>some content<!-- comment --></p>');
2699
- * ```
2700
- */
2701
- function removeComments(html: string): string;
2702
- /**
2703
- * Removes the specified tag from the HTML and keeps its child nodes.
2704
- *
2705
- * @param {string} html - The input HTML.
2706
- * @param {string} tag - A tag or multiple tags separated by a vertical slash which will be removed.
2707
- * For example, `span` or `b|i|u|span`.
2708
- * @returns {string} - The resulting HTML.
2709
- *
2710
- * @example
2711
- * ```jsx-no-run
2712
- * import { EditorUtils } from '@progress/kendo-vue-editor';
2713
- * const html = EditorUtils.removeTag('<p>some <span>content</span></p>', 'span|p');
2714
- * ```
2715
- */
2716
- function removeTag(html: string, tag: string): string;
2717
- /**
2718
- * A function for sanitizing the content on paste ([see example]({% slug paste_editor %})).
2719
- *
2720
- * @param {string} html - The input HTML.
2721
- * @param {PasteCleanupSettings} settings - The settings used for sanitizing the content.
2722
- * @returns {string} - The resulting HTML.
2723
- */
2724
- function pasteCleanup(html: string, settings: PasteCleanupSettings): string;
2725
- /**
2726
- * A function for sanitizing the CSS classes of the pasted from MS Word content ([see example]({% slug paste_editor %})).
2727
- * The function will remove any class attribute which value starts with `Mso`.
2728
- * For example `<p class="MsoNormal">pasted from MS Word</p>` will result in `<p>pasted from MS Word</p>`.
2729
- *
2730
- * @param {Attr} attr - The DOM class attribute that will be sanitized.
2731
- */
2732
- function sanitizeClassAttr(attr: Attr): void;
2733
- /**
2734
- * A function for sanitizing the style attributes of the pasted from MS Word content ([see example]({% slug paste_editor %})).
2735
- * The function will loop through all styles and will remove those that are invalid.
2736
- * For example `<p><span style='color:#7C7C7C;mso-themecolor:accent3;mso-themeshade:191;background:silver;'>content</span></p>`,
2737
- * will result in `<p><span style="color: #7C7C7C; background: silver;">content</span></p>`.
2738
- *
2739
- * @param {Attr} attr - The DOM style attribute that will be sanitized.
2740
- */
2741
- function sanitizeStyleAttr(attr: Attr): void;
2742
- /**
2743
- * A function that will remove a DOM attribute from the pasted content ([see example]({% slug paste_editor %})).
2744
- *
2745
- * @param {Attr} attr - The DOM attribute that will be removed.
2746
- */
2747
- function removeAttribute(attr: Attr): void;
2748
- /**
2749
- * Removes the invalid HTML.
2750
- *
2751
- * @param {string} html - The HTML which will be sanitized.
2752
- * @returns {string} - The sanitized HTML.
2753
- *
2754
- * @example
2755
- * ```jsx-no-run
2756
- * import { EditorUtils } from '@progress/kendo-vue-editor';
2757
- * const html = EditorUtils.sanitize('something pasted from MS Word, containing <o:p>, <w:sdtPr>, <v:shapes tags');
2758
- * ```
2759
- */
2760
- function sanitize(html: string): string;
2761
- /**
2762
- * If the input `html` contains images with 'src' pointing to local file system (it happens when pasting images and text from MS Word),
2763
- * the function will extract the images sources from the RTF in base64 format and replace them in the input `html`.
2764
- *
2765
- * @param html - The input HTML (pasted HTML).
2766
- * @param clipboardData - The paste event clipboardData object (event.clipboardData).
2767
- * @returns - The html with the replaced images sources.
2768
- */
2769
- function replaceImageSourcesFromRtf(html: string, clipboardData: DataTransfer): string;
2770
- /**
2771
- * Creates a plugin which highlights the matches of Find and Replace dialog.
2772
- *
2773
- * @param {PluginKey} key - The key of the plugin (Optional).
2774
- * @returns {Plugin} - The text highlight plugin.
2775
- */
2776
- function textHighlight(key?: PluginKey): Plugin;
2777
- /**
2778
- * The image resizing plugin options.
2779
- */
2780
- interface ImageResizeOptions extends ImageResizeOptionsCommon {
2781
- }
2782
- /**
2783
- * Creates a plugin which adds image resizing functionality.
2784
- *
2785
- * @param {ImageResizeOptions} options - The resizing option (Optional).
2786
- * @returns {Plugin} - The image resizing plugin.
2787
- */
2788
- function imageResizing(options?: ImageResizeOptions): Plugin;
2789
- /**
2790
- * Sets the HTML to the `EditorView`.
2791
- *
2792
- * @param {EditorView} view - The `view` object of the Editor.
2793
- * @param {string} html - The HTML content.
2794
- * @param {Command} command - An optional parameter.
2795
- * Defines the type of the command that will be set to the `setHtml` metadata of the transaction.
2796
- * Defaults to `SetContent`.
2797
- * @param {ParseOptions} parseOptions - An optional parameter.
2798
- * Defines the options that will be used for parsing the HTML. Defaults to `{ preserveWhitespace: 'full' }`.
2799
- */
2800
- function setHtml(view: EditorView, html: string, command?: EditorToolsSettings.Command, parseOptions?: ParseOptions): void;
2801
- /**
2802
- * Toggles the inline element formatting according to the `InlineFormatOptions` and `markAttrs` settings.
2803
- *
2804
- * @returns {boolean}
2805
- */
2806
- function toggleInlineFormat(view: {
2807
- state: EditorState;
2808
- dispatch: (tr: Transaction) => void;
2809
- }, options: EditorToolsSettings.InlineFormatOptions, transaction?: Transaction, markAttrs?: any): boolean;
2810
- /**
2811
- * Toggles a list of the specified type.
2812
- *
2813
- * @returns {boolean}
2814
- */
2815
- function toggleList(view: EditorView, types: {
2816
- listType: string;
2817
- orderedList: string;
2818
- bulletList: string;
2819
- listItem: string;
2820
- }, command?: EditorToolsSettings.Command): boolean;
2821
- /**
2822
- * Represents the `Shortcuts` object.
2823
- */
2824
- interface Shortcuts extends shortcuts.Shortcuts {
2825
- }
2826
- /**
2827
- * A function which returns the mapped `Shortcuts` object based on the passed settings.
2828
- * Useful when the default Editor nodes or tool settings are changed and the `Shortcuts` object has to be regenerated.
2829
- *
2830
- * @params - An object which holds specific types of nodes and tool settings that are used by the default `Shortcuts` handlers.
2831
- * @returns - An object which holds the shortcuts.
2832
- */
2833
- function getShortcuts(settings?: {
2834
- types?: {
2835
- listItem: string;
2836
- hardBreak: string;
2837
- };
2838
- toolsSettings?: {
2839
- bold?: EditorToolsSettings.InlineFormatOptions;
2840
- italic?: EditorToolsSettings.InlineFormatOptions;
2841
- underline?: EditorToolsSettings.InlineFormatOptions;
2842
- };
2843
- }): Shortcuts;
2844
- /**
2845
- * The `PluginKey` used in the Editor to pass editor props to the tools.
2846
- */
2847
- const propsKey: PluginKey;
2848
- /**
2849
- * The `PluginKey` used in the Editor by the image resizing plugin.
2850
- */
2851
- const imageResizeKey: PluginKey;
2852
- /**
2853
- * Represents the `marks` object of the Editor.
2854
- */
2855
- const marks: {
2856
- [mark: string]: MarkSpec;
2857
- };
2858
- /**
2859
- * Represents the `nodes` object of the Editor.
2860
- */
2861
- const nodes: {
2862
- [node: string]: NodeSpec;
2863
- };
2864
- }
2865
-
2866
-
2867
- /**
2868
- * @hidden
2869
- */
2870
- export declare namespace TableEditNS {
2871
- /**
2872
- * @hidden
2873
- */
2874
- interface AddRowBeforeProps extends ToolProps {
2875
- }
2876
- /**
2877
- * @hidden
2878
- */
2879
- interface AddRowAfterProps extends ToolProps {
2880
- }
2881
- /**
2882
- * @hidden
2883
- */
2884
- interface AddColumnBeforeProps extends ToolProps {
2885
- }
2886
- /**
2887
- * @hidden
2888
- */
2889
- interface AddColumnAfterProps extends ToolProps {
2890
- }
2891
- /**
2892
- * @hidden
2893
- */
2894
- interface DeleteRowProps extends ToolProps {
2895
- }
2896
- /**
2897
- * @hidden
2898
- */
2899
- interface DeleteColumnProps extends ToolProps {
2900
- }
2901
- /**
2902
- * @hidden
2903
- */
2904
- interface DeleteTableProps extends ToolProps {
2905
- }
2906
- /**
2907
- * @hidden
2908
- */
2909
- interface MergeCellsProps extends ToolProps {
2910
- }
2911
- /**
2912
- * @hidden
2913
- */
2914
- interface SplitCellProps extends ToolProps {
2915
- }
2916
- }
2917
-
2918
-
2919
- /**
2920
- * @hidden
2921
- */
2922
- export declare namespace HistoryToolNS {
2923
- /**
2924
- * @hidden
2925
- */
2926
- interface UndoProps extends ToolProps {
2927
- command?: any;
2928
- }
2929
- /**
2930
- * @hidden
2931
- */
2932
- interface RedoProps extends ToolProps {
2933
- command?: any;
2934
- }
2935
- }
2936
-