@fastkit/vui 0.7.57 → 0.7.64

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.
Files changed (36) hide show
  1. package/dist/tool/index.js +1 -0
  2. package/dist/tool/vite-plugin.d.ts.map +1 -1
  3. package/dist/vui.cjs.js +615 -44
  4. package/dist/vui.cjs.prod.js +615 -44
  5. package/dist/vui.css +221 -0
  6. package/dist/vui.d.ts +139 -4
  7. package/dist/vui.min.css +1 -1
  8. package/dist/vui.min.css.map +1 -1
  9. package/dist/vui.mjs +605 -44
  10. package/package.json +7 -6
  11. package/src/components/VButton/VButtonGroup.scss +4 -0
  12. package/src/components/VButton/VButtonGroup.tsx +12 -1
  13. package/src/components/VWysiwygEditor/.DS_Store +0 -0
  14. package/src/components/VWysiwygEditor/VWysiwygEditor.scss +6 -0
  15. package/src/components/VWysiwygEditor/VWysiwygEditor.tsx +97 -56
  16. package/src/components/VWysiwygEditor/extensions/.DS_Store +0 -0
  17. package/src/components/VWysiwygEditor/extensions/color.ts +72 -0
  18. package/src/components/VWysiwygEditor/extensions/index.ts +2 -0
  19. package/src/components/VWysiwygEditor/extensions/linter/.DS_Store +0 -0
  20. package/src/components/VWysiwygEditor/extensions/linter/Linter.scss +140 -0
  21. package/src/components/VWysiwygEditor/extensions/linter/Linter.tsx +210 -0
  22. package/src/components/VWysiwygEditor/extensions/linter/LinterPlugin.ts +62 -0
  23. package/src/components/VWysiwygEditor/extensions/linter/index.ts +5 -0
  24. package/src/components/VWysiwygEditor/extensions/linter/plugins/BadWords.tsx +50 -0
  25. package/src/components/VWysiwygEditor/extensions/linter/plugins/HeadingLevel.ts +39 -0
  26. package/src/components/VWysiwygEditor/extensions/linter/plugins/Punctuation.ts +49 -0
  27. package/src/components/VWysiwygEditor/extensions/linter/plugins/index.ts +3 -0
  28. package/src/components/VWysiwygEditor/extensions/linter/utils.ts +28 -0
  29. package/src/components/VWysiwygEditor/index.ts +1 -0
  30. package/src/components/VWysiwygEditor/schemes.ts +190 -4
  31. package/src/components/VWysiwygEditor/tools/color.scss +140 -0
  32. package/src/components/VWysiwygEditor/tools/color.tsx +90 -0
  33. package/src/components/VWysiwygEditor/tools/index.ts +1 -1
  34. package/src/service.tsx +5 -0
  35. package/src/tool/vite-plugin.ts +1 -0
  36. package/src/components/VWysiwygEditor/tools/text-color.ts +0 -14
package/dist/vui.css CHANGED
@@ -2118,6 +2118,9 @@ thead th {
2118
2118
  .v-wysiwyg-editor__wrapper {
2119
2119
  position: relative;
2120
2120
  }
2121
+ .v-wysiwyg-editor .v-control-field__body {
2122
+ width: 100%;
2123
+ }
2121
2124
  .v-wysiwyg-editor__floating-toolbar {
2122
2125
  position: absolute;
2123
2126
  right: 0;
@@ -2126,6 +2129,7 @@ thead th {
2126
2129
  }
2127
2130
  .v-wysiwyg-editor__body {
2128
2131
  position: relative;
2132
+ width: 100%;
2129
2133
  max-height: var(--max-height);
2130
2134
  overflow: auto;
2131
2135
  }
@@ -2139,6 +2143,7 @@ thead th {
2139
2143
  margin: 0;
2140
2144
  }
2141
2145
  .v-wysiwyg-editor__input__prose {
2146
+ width: 100%;
2142
2147
  min-height: var(--min-height);
2143
2148
  outline: none;
2144
2149
  }
@@ -2148,6 +2153,222 @@ thead th {
2148
2153
  .v-wysiwyg-editor--disabled-max-heihgt .v-wysiwyg-editor__body {
2149
2154
  max-height: none;
2150
2155
  }
2156
+ .v-linter__problem {
2157
+ margin-bottom: -1px;
2158
+ cursor: help;
2159
+ background: var(--deep-color);
2160
+ border-bottom: 1px solid var(--main-color);
2161
+ }
2162
+ .v-linter__issue-icon {
2163
+ position: absolute;
2164
+ right: 2px;
2165
+ display: inline-flex;
2166
+ align-items: center;
2167
+ justify-content: center;
2168
+ width: 1.2em;
2169
+ height: 1.2em;
2170
+ margin-top: 0.2em;
2171
+ font-family: times, georgia, serif;
2172
+ font-size: 15px;
2173
+ font-weight: 700;
2174
+ line-height: 1;
2175
+ color: var(--text-color);
2176
+ text-align: center;
2177
+ cursor: pointer;
2178
+ background: var(--main-color);
2179
+ border-radius: 100px;
2180
+ }
2181
+ .v-linter__issue-icon::before {
2182
+ content: "!";
2183
+ }
2184
+ .v-linter__issue-menu-wrapper {
2185
+ position: relative;
2186
+ display: inline-block;
2187
+ width: 0px;
2188
+ height: 1em;
2189
+ overflow: visible;
2190
+ }
2191
+ .v-linter__issue-menu {
2192
+ font-size: 87.5%;
2193
+ line-height: 1.5;
2194
+ }
2195
+ .v-linter__issue-menu .v-dialog__body {
2196
+ padding: 0;
2197
+ font-size: inherit;
2198
+ }
2199
+ .v-linter__issue-menu__message {
2200
+ padding: 8px;
2201
+ }
2202
+ .v-linter__issue-menu__fixers {
2203
+ position: relative;
2204
+ padding: 4px 0;
2205
+ }
2206
+ .v-linter__issue-menu__fixers::before {
2207
+ position: absolute;
2208
+ top: 0;
2209
+ right: 0;
2210
+ left: 0;
2211
+ display: block;
2212
+ height: 1px;
2213
+ content: "";
2214
+ background: currentColor;
2215
+ opacity: 0.5;
2216
+ }
2217
+ .v-linter__issue-menu__fixer__button {
2218
+ position: relative;
2219
+ display: block;
2220
+ width: 100%;
2221
+ padding: 8px;
2222
+ font: inherit;
2223
+ font-size: 12px;
2224
+ text-align: left;
2225
+ cursor: pointer;
2226
+ background: transparent;
2227
+ border: 0;
2228
+ outline: 0;
2229
+ appearance: none;
2230
+ }
2231
+ .v-linter__issue-menu__fixer__button::before {
2232
+ position: absolute;
2233
+ top: 0;
2234
+ right: 0;
2235
+ bottom: 0;
2236
+ left: 0;
2237
+ display: block;
2238
+ content: "";
2239
+ background: currentColor;
2240
+ opacity: 0;
2241
+ transition: 0.15s;
2242
+ }
2243
+ .v-linter__issue-menu__fixer__button:hover::before, .v-linter__issue-menu__fixer__button:focus::before {
2244
+ opacity: 0.1;
2245
+ }
2246
+ .v-linter__issue-menu__fixer__button__message {
2247
+ position: relative;
2248
+ }
2249
+ .v-linter__issue-menu__fix {
2250
+ display: inline;
2251
+ margin-top: 8px;
2252
+ color: var(--palette-link);
2253
+ text-decoration: underline;
2254
+ cursor: pointer;
2255
+ background: transparent;
2256
+ border: 0;
2257
+ outline: 0;
2258
+ appearance: none;
2259
+ }
2260
+ :root {
2261
+ --v-wysiwyg-color-tool: 30px;
2262
+ }
2263
+
2264
+ .v-wysiwyg-color-tool__button {
2265
+ position: relative;
2266
+ display: inline-flex;
2267
+ align-items: center;
2268
+ justify-content: center;
2269
+ vertical-align: bottom;
2270
+ }
2271
+ .v-wysiwyg-color-tool__button__bar {
2272
+ position: absolute;
2273
+ right: 0;
2274
+ bottom: 0;
2275
+ left: 0;
2276
+ display: block;
2277
+ height: 2px;
2278
+ background: currentColor;
2279
+ }
2280
+ .v-wysiwyg-color-tool__menu .v-dialog__content {
2281
+ min-width: 0;
2282
+ }
2283
+ .v-wysiwyg-color-tool__menu .v-dialog__body {
2284
+ padding: 2px;
2285
+ }
2286
+ .v-wysiwyg-color-tool__items {
2287
+ --item-size: var(--v-wysiwyg-color-tool);
2288
+ display: inline-flex;
2289
+ flex-wrap: wrap;
2290
+ align-items: center;
2291
+ max-width: calc(var(--item-size) * 5);
2292
+ vertical-align: bottom;
2293
+ }
2294
+ .v-wysiwyg-color-tool__items--with-label {
2295
+ display: flex;
2296
+ flex-direction: column;
2297
+ align-items: flex-start;
2298
+ max-width: none;
2299
+ padding: 2px;
2300
+ }
2301
+ .v-wysiwyg-color-tool__item {
2302
+ --focus-offset: calc(var(--item-size) * 0.05);
2303
+ position: relative;
2304
+ display: flex;
2305
+ flex-basis: var(--item-size);
2306
+ align-items: center;
2307
+ width: var(--item-size);
2308
+ height: var(--item-size);
2309
+ padding: 0;
2310
+ margin: 0;
2311
+ cursor: pointer;
2312
+ background: transparent;
2313
+ border: 0;
2314
+ border-radius: 0;
2315
+ outline: 0;
2316
+ appearance: none;
2317
+ }
2318
+ .v-wysiwyg-color-tool__item__color {
2319
+ position: relative;
2320
+ flex: 0 0 var(--item-size);
2321
+ width: var(--item-size);
2322
+ height: var(--item-size);
2323
+ }
2324
+ .v-wysiwyg-color-tool__item__color::before {
2325
+ position: absolute;
2326
+ top: 0;
2327
+ right: 0;
2328
+ bottom: 0;
2329
+ left: 0;
2330
+ display: block;
2331
+ content: "";
2332
+ background: currentColor;
2333
+ border: solid 1px transparent;
2334
+ transition: all 0.15s;
2335
+ }
2336
+ .v-wysiwyg-color-tool__item__name {
2337
+ position: relative;
2338
+ padding: 0 8px;
2339
+ font-size: 12px;
2340
+ white-space: nowrap;
2341
+ }
2342
+ .v-wysiwyg-color-tool__item:hover .v-wysiwyg-color-tool__item__color::before, .v-wysiwyg-color-tool__item:focus .v-wysiwyg-color-tool__item__color::before {
2343
+ top: var(--focus-offset);
2344
+ right: var(--focus-offset);
2345
+ bottom: var(--focus-offset);
2346
+ left: var(--focus-offset);
2347
+ border-color: rgba(0, 0, 0, 0.1);
2348
+ }
2349
+ .v-wysiwyg-color-tool__items--with-label .v-wysiwyg-color-tool__item {
2350
+ flex-basis: auto;
2351
+ width: auto;
2352
+ width: 100%;
2353
+ }
2354
+ .v-wysiwyg-color-tool__items--with-label .v-wysiwyg-color-tool__item::before {
2355
+ position: absolute;
2356
+ top: 0;
2357
+ right: 0;
2358
+ bottom: 0;
2359
+ left: 0;
2360
+ display: block;
2361
+ content: "";
2362
+ background: currentColor;
2363
+ opacity: 0;
2364
+ transition: opacity 0.15s;
2365
+ }
2366
+ .v-wysiwyg-color-tool__items--with-label .v-wysiwyg-color-tool__item:hover::before, .v-wysiwyg-color-tool__items--with-label .v-wysiwyg-color-tool__item:focus::before {
2367
+ opacity: 0.1;
2368
+ }
2369
+ .v-wysiwyg-color-tool__items--with-label .v-wysiwyg-color-tool__item + .v-wysiwyg-color-tool__item {
2370
+ margin-top: 2px;
2371
+ }
2151
2372
  .v-tabs {
2152
2373
  position: relative;
2153
2374
  width: 100%;
package/dist/vui.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { AllowedComponentProps } from 'vue';
2
+ import { AnyExtension } from '@tiptap/vue-3';
2
3
  import { App } from 'vue';
3
4
  import { BoldOptions } from '@tiptap/extension-bold';
4
5
  import { BulletListOptions } from '@tiptap/extension-bullet-list';
@@ -10,8 +11,12 @@ import { ComputedRef } from 'vue';
10
11
  import { CSSProperties } from 'vue';
11
12
  import { DefineComponent } from 'vue';
12
13
  import { Editor } from '@tiptap/vue-3';
14
+ import { EditorOptions } from '@tiptap/vue-3';
15
+ import { EditorView } from 'prosemirror-view';
13
16
  import { EmitsOptions } from 'vue';
14
17
  import { EV } from '@fastkit/ev';
18
+ import { Extension } from '@tiptap/vue-3';
19
+ import { Extension as Extension_2 } from '@tiptap/core';
15
20
  import { Extensions } from '@tiptap/vue-3';
16
21
  import { ExtractPropInput } from '@fastkit/vue-utils';
17
22
  import { ExtractPropTypes } from 'vue';
@@ -40,9 +45,12 @@ import { InjectionKey } from 'vue';
40
45
  import { ItalicOptions } from '@tiptap/extension-italic';
41
46
  import { LinkOptions } from '@tiptap/extension-link';
42
47
  import { LocationService } from '@fastkit/vue-utils';
48
+ import { Mark } from '@tiptap/vue-3';
43
49
  import { MediaMatchKey } from '@fastkit/media-match';
44
50
  import { NavigationableInheritProps } from '@fastkit/vue-utils';
45
51
  import { NavigationFailure } from 'vue-router';
52
+ import { Node as Node_2 } from '@tiptap/vue-3';
53
+ import { Node as Node_3 } from 'prosemirror-model';
46
54
  import { Numberish } from '@fastkit/vue-kit';
47
55
  import { OrderedListOptions } from '@tiptap/extension-ordered-list';
48
56
  import { Prop } from 'vue';
@@ -469,6 +477,13 @@ export declare function createControlProps(): {
469
477
  loading: BooleanConstructor;
470
478
  };
471
479
 
480
+ export declare interface CreatedWysiwygExtension<Options = any, Storage = any> {
481
+ __isCreatedWysiwygExtension: true;
482
+ _configs: Partial<Options>[];
483
+ configure(options?: Partial<Options>): CreatedWysiwygExtension<Options, Storage>;
484
+ raw: WysiwygExtensionSource<Options, Storage>;
485
+ }
486
+
472
487
  export declare function createElevationProps(): {
473
488
  elevation: PropType<VuiElevationValue>;
474
489
  };
@@ -1043,6 +1058,15 @@ export declare function createVFormProps(): {
1043
1058
  errorMessages: PropType<string | string[]>;
1044
1059
  };
1045
1060
 
1061
+ export declare function createWysiwygColorTool(opts: CreateWysiwygColorToolOptions): WysiwygEditorToolFactory<void>;
1062
+
1063
+ export declare interface CreateWysiwygColorToolOptions {
1064
+ items: WysiwygColorItem[];
1065
+ withLabel?: boolean;
1066
+ }
1067
+
1068
+ export declare function createWysiwygExtension<Options = any, Storage = any>(extension: WysiwygExtensionSource<Options, Storage>): CreatedWysiwygExtension<Options, Storage>;
1069
+
1046
1070
  declare const DATA_TABLE_DEFAULTS: {
1047
1071
  itemKey: string;
1048
1072
  pageQuery: string;
@@ -1348,6 +1372,8 @@ declare const easings: {
1348
1372
 
1349
1373
  declare type EasingValues = [number, number, number, number];
1350
1374
 
1375
+ declare const EDITOR_EVENTS: readonly ["beforeCreate", "create", "update", "selectionUpdate", "transaction", "focus", "blur", "destroy"];
1376
+
1351
1377
  export declare type ElevationProps = ExtractPropTypes<ReturnType<typeof createElevationProps>>;
1352
1378
 
1353
1379
  declare type EmptyIconSymbol = '$empty';
@@ -1456,6 +1482,8 @@ export declare function paginationProps(): {
1456
1482
  color: PropType<ScopeName>;
1457
1483
  };
1458
1484
 
1485
+ declare type PrefixedEventName<S extends string> = `on${Capitalize<S>}`;
1486
+
1459
1487
  export declare type RawBreadcrumbsItem = string | BreadcrumbsItem;
1460
1488
 
1461
1489
  declare type RawGridValue<T extends number | string = number | string> = T | Partial<Record<MediaMatchKey, T>> | undefined;
@@ -1466,6 +1494,11 @@ export declare type RawIconProp = IconName | EmptyIconSymbol | ToggleableIconHoo
1466
1494
 
1467
1495
  export declare function rawIconProp(): PropType<RawIconProp>;
1468
1496
 
1497
+ declare interface RawLinterResult extends Omit<WysiwygLinterResult, 'level' | 'fix' | 'id'> {
1498
+ level?: WysiwygLinterResultLevel;
1499
+ fix?: WysiwygLinterFixer | WysiwygLinterFixer[];
1500
+ }
1501
+
1469
1502
  export declare type RawVButtonIcon = IconName | VButtonIcon;
1470
1503
 
1471
1504
  export declare type RawVButtonSpacer = boolean | VButtonSpacer;
@@ -1489,6 +1522,8 @@ export declare type RawVuiServiceUISettings = Partial<VuiServiceUISettings>;
1489
1522
 
1490
1523
  export declare type RawWysiwygEditorTool = WysiwygEditorTool | WysiwygEditorToolFactory<any>;
1491
1524
 
1525
+ export declare type RawWysiwygExtension<Options = any, Storage = any> = WysiwygExtensionSource<Options, Storage> | CreatedWysiwygExtension<Options, Storage>;
1526
+
1492
1527
  declare type RecursiveArray<T> = T | RecursiveArray<T>[];
1493
1528
 
1494
1529
  export declare function renderNavigationItemInput(input: NavigationItemInput, extraProps?: Record<string, unknown> & VNodeProps): JSX.Element;
@@ -1505,7 +1540,9 @@ export declare function resolveNavigationItemInput(input: NavigationItemInput):
1505
1540
 
1506
1541
  export declare function resolveRawIconProp(payload: boolean, prop?: RawIconProp, extraProps?: Record<string, unknown> & VNodeProps): VNodeChild;
1507
1542
 
1508
- export declare function resolveRawWysiwygEditorTools(raws: RawWysiwygEditorTool[], vui: VuiService): ResolvedWysiwygEditorSettings;
1543
+ export declare function resolveRawWysiwygEditorTools(rawTools: RawWysiwygEditorTool[], vui: VuiService): ResolvedWysiwygEditorSettings;
1544
+
1545
+ export declare function resolveRawWysiwygExtensions(raws: RawWysiwygExtension[], ctx: WysiwygEditorInitializeContext): AnyExtension[];
1509
1546
 
1510
1547
  declare interface Rule<C extends any = any> {
1511
1548
  <EC extends C = C>(constraints: Partial<EC>, overRides?: string | Partial<RuleSettings<EC>>): Rule<EC>;
@@ -9530,6 +9567,7 @@ export declare class VuiService {
9530
9567
  alert(...args: Parameters<VueStackService['alert']>): Promise<any>;
9531
9568
  confirm(...args: Parameters<VueStackService['confirm']>): Promise<any>;
9532
9569
  snackbar(...args: Parameters<VueStackService['snackbar']>): Promise<any>;
9570
+ menu(...args: Parameters<VueStackService['menu']>): Promise<any>;
9533
9571
  formPrompt<T extends {
9534
9572
  [key: string]: any;
9535
9573
  } = {
@@ -9578,6 +9616,7 @@ export declare interface VuiServiceUISettings {
9578
9616
  primaryScope: ScopeName;
9579
9617
  plainVariant: ColorVariant;
9580
9618
  containedVariant: ColorVariant;
9619
+ warningScope: ScopeName;
9581
9620
  errorScope: ScopeName;
9582
9621
  buttonDefault: {
9583
9622
  color: ScopeName;
@@ -9608,6 +9647,10 @@ export declare interface VuiServiceUISettings {
9608
9647
  export declare type VuiVNodeResolver = () => VNodeChild;
9609
9648
 
9610
9649
  export declare const VWysiwygEditor: DefineComponent<{
9650
+ extensions: {
9651
+ type: PropType<RawWysiwygExtension<any, any>[]>;
9652
+ default: () => never[];
9653
+ };
9611
9654
  tools: {
9612
9655
  type: PropType<RawWysiwygEditorTool[]>;
9613
9656
  default: () => never[];
@@ -9735,6 +9778,10 @@ export declare const VWysiwygEditor: DefineComponent<{
9735
9778
  focus: (ev: FocusEvent) => boolean;
9736
9779
  blur: (ev: FocusEvent) => boolean;
9737
9780
  }, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<{
9781
+ extensions: {
9782
+ type: PropType<RawWysiwygExtension<any, any>[]>;
9783
+ default: () => never[];
9784
+ };
9738
9785
  tools: {
9739
9786
  type: PropType<RawWysiwygEditorTool[]>;
9740
9787
  default: () => never[];
@@ -9839,6 +9886,7 @@ export declare const VWysiwygEditor: DefineComponent<{
9839
9886
  hiddenInfo: boolean;
9840
9887
  errors: FormNodeError[];
9841
9888
  loading: boolean;
9889
+ extensions: RawWysiwygExtension<any, any>[];
9842
9890
  tools: RawWysiwygEditorTool[];
9843
9891
  floatingToolbar: boolean;
9844
9892
  disabledMinHeight: boolean;
@@ -9847,14 +9895,47 @@ export declare const VWysiwygEditor: DefineComponent<{
9847
9895
 
9848
9896
  export declare const WysiwygBulletListTool: WysiwygEditorToolFactory<BulletListOptions>;
9849
9897
 
9898
+ export declare const WysiwygColorExtension: Extension_2<WysiwygColorOptions, any>;
9899
+
9900
+ export declare interface WysiwygColorItem {
9901
+ key?: string | number;
9902
+ name?: VNodeChild | ((vui: VuiService) => VNodeChild);
9903
+ color: string | null;
9904
+ }
9905
+
9906
+ export declare type WysiwygColorOptions = {
9907
+ types: string[];
9908
+ };
9909
+
9850
9910
  export declare interface WysiwygEditorContext {
9851
9911
  editor: Editor;
9852
9912
  vui: VuiService;
9853
9913
  }
9854
9914
 
9915
+ export declare type WysiwygEditorEvent = typeof EDITOR_EVENTS[number];
9916
+
9917
+ export declare type WysiwygEditorEventsBucket = {
9918
+ [EV in WysiwygEditorEvent]: NonNullable<WysiwygEditorEventsOptions[PrefixedEventName<EV>]>[];
9919
+ };
9920
+
9921
+ export declare interface WysiwygEditorEventsOptions extends Partial<Pick<EditorOptions, WysiwygEditorPrefixedEvent>> {
9922
+ }
9923
+
9924
+ export declare class WysiwygEditorInitializeContext {
9925
+ readonly listeners: WysiwygEditorEventsBucket;
9926
+ private readonly _vui;
9927
+ get vui(): VuiService;
9928
+ constructor(vuiGetter: () => VuiService, opts?: WysiwygEditorEventsOptions);
9929
+ on<EV extends WysiwygEditorEvent>(ev: EV, handler: NonNullable<WysiwygEditorEventsOptions[PrefixedEventName<EV>]>): () => void;
9930
+ off<EV extends WysiwygEditorEvent>(ev: EV, handler: NonNullable<WysiwygEditorEventsOptions[PrefixedEventName<EV>]>): void;
9931
+ editorOptions(): WysiwygEditorEventsOptions;
9932
+ }
9933
+
9934
+ export declare type WysiwygEditorPrefixedEvent = PrefixedEventName<WysiwygEditorEvent>;
9935
+
9855
9936
  export declare interface WysiwygEditorTool {
9856
9937
  key: string;
9857
- icon: IconName | ((ctx: WysiwygEditorContext) => IconName);
9938
+ icon: IconName | ((ctx: WysiwygEditorContext) => IconName | (() => VNodeChild));
9858
9939
  active?: boolean | ((ctx: WysiwygEditorContext) => boolean);
9859
9940
  disabled?: boolean | ((ctx: WysiwygEditorContext) => boolean);
9860
9941
  onClick: (ctx: WysiwygEditorContext, ev: MouseEvent) => any;
@@ -9864,6 +9945,10 @@ export declare interface WysiwygEditorTool {
9864
9945
 
9865
9946
  export declare type WysiwygEditorToolFactory<Options = void> = (vui: VuiService, options?: Options) => WysiwygEditorTool | WysiwygEditorTool[];
9866
9947
 
9948
+ export declare type WysiwygExtensionFactory<Options = any, Storage = any> = (ctx: WysiwygEditorInitializeContext) => Extension<Options, Storage> | Node_2<Options, Storage> | Mark<Options, Storage>;
9949
+
9950
+ export declare type WysiwygExtensionSource<Options = any, Storage = any> = Extension<Options, Storage> | Node_2<Options, Storage> | Mark<Options, Storage> | WysiwygExtensionFactory<Options, Storage>;
9951
+
9867
9952
  export declare const WysiwygFormatBoldTool: WysiwygEditorToolFactory<BoldOptions>;
9868
9953
 
9869
9954
  export declare const WysiwygFormatItalicTool: WysiwygEditorToolFactory<ItalicOptions>;
@@ -9874,9 +9959,59 @@ export declare const WysiwygHistoryTool: WysiwygEditorToolFactory<HistoryOptions
9874
9959
 
9875
9960
  export declare const WysiwygLinkTool: WysiwygEditorToolFactory<LinkOptions>;
9876
9961
 
9877
- export declare const WysiwygOrderedListTool: WysiwygEditorToolFactory<OrderedListOptions>;
9962
+ export declare const WysiwygLinter: CreatedWysiwygExtension<WysiwygLinterOptions, WysiwygLinterStorage>;
9963
+
9964
+ export declare function WysiwygLinterBadWords(words: string[]): typeof WysiwygLinterPlugin;
9965
+
9966
+ declare interface WysiwygLinterFixer {
9967
+ message: WysiwygLinterFixMessage;
9968
+ handler: WysiwygLinterFixFn;
9969
+ }
9970
+
9971
+ declare type WysiwygLinterFixFn = (view: EditorView, issue: WysiwygLinterResult) => any;
9972
+
9973
+ declare type WysiwygLinterFixMessage = string | (() => VNodeChild);
9974
+
9975
+ export declare class WysiwygLinterHeadingLevel extends WysiwygLinterPlugin {
9976
+ fixHeader(level: number): ({ state, dispatch }: EditorView, issue: WysiwygLinterResult) => void;
9977
+ scan(): this;
9978
+ }
9878
9979
 
9879
- export declare const WysiwygTextColorTool: WysiwygEditorToolFactory;
9980
+ export declare interface WysiwygLinterOptions {
9981
+ plugins: Array<typeof WysiwygLinterPlugin>;
9982
+ }
9983
+
9984
+ export declare class WysiwygLinterPlugin {
9985
+ protected doc: Node_3;
9986
+ private results;
9987
+ constructor(doc: Node_3);
9988
+ record(result: RawLinterResult): void;
9989
+ scan(): this;
9990
+ getResults(): WysiwygLinterResult[];
9991
+ }
9992
+
9993
+ export declare class WysiwygLinterPunctuation extends WysiwygLinterPlugin {
9994
+ regex: RegExp;
9995
+ fix(replacement: any): ({ state, dispatch }: EditorView, issue: WysiwygLinterResult) => void;
9996
+ scan(): this;
9997
+ }
9998
+
9999
+ declare interface WysiwygLinterResult {
10000
+ id: string;
10001
+ level: WysiwygLinterResultLevel;
10002
+ message: WysiwygLinterFixMessage;
10003
+ from: number;
10004
+ to: number;
10005
+ fix: WysiwygLinterFixer[];
10006
+ }
10007
+
10008
+ declare type WysiwygLinterResultLevel = 'warning' | 'error';
10009
+
10010
+ declare interface WysiwygLinterStorage {
10011
+ issues: WysiwygLinterResult[];
10012
+ }
10013
+
10014
+ export declare const WysiwygOrderedListTool: WysiwygEditorToolFactory<OrderedListOptions>;
9880
10015
 
9881
10016
 
9882
10017
  export * from "@fastkit/vue-kit";