@fastkit/vui 0.7.59 → 0.7.65

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 +616 -39
  4. package/dist/vui.cjs.prod.js +616 -39
  5. package/dist/vui.css +219 -0
  6. package/dist/vui.d.ts +141 -4
  7. package/dist/vui.min.css +1 -1
  8. package/dist/vui.min.css.map +1 -1
  9. package/dist/vui.mjs +606 -39
  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 +4 -0
  15. package/src/components/VWysiwygEditor/VWysiwygEditor.tsx +65 -22
  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 +214 -0
  22. package/src/components/VWysiwygEditor/extensions/linter/LinterPlugin.ts +65 -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;
@@ -2150,6 +2153,222 @@ thead th {
2150
2153
  .v-wysiwyg-editor--disabled-max-heihgt .v-wysiwyg-editor__body {
2151
2154
  max-height: none;
2152
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
+ }
2153
2372
  .v-tabs {
2154
2373
  position: relative;
2155
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,12 @@ 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' | 'icon'> {
1498
+ level?: WysiwygLinterResultLevel;
1499
+ icon?: boolean;
1500
+ fix?: WysiwygLinterFixer | WysiwygLinterFixer[];
1501
+ }
1502
+
1469
1503
  export declare type RawVButtonIcon = IconName | VButtonIcon;
1470
1504
 
1471
1505
  export declare type RawVButtonSpacer = boolean | VButtonSpacer;
@@ -1489,6 +1523,8 @@ export declare type RawVuiServiceUISettings = Partial<VuiServiceUISettings>;
1489
1523
 
1490
1524
  export declare type RawWysiwygEditorTool = WysiwygEditorTool | WysiwygEditorToolFactory<any>;
1491
1525
 
1526
+ export declare type RawWysiwygExtension<Options = any, Storage = any> = WysiwygExtensionSource<Options, Storage> | CreatedWysiwygExtension<Options, Storage>;
1527
+
1492
1528
  declare type RecursiveArray<T> = T | RecursiveArray<T>[];
1493
1529
 
1494
1530
  export declare function renderNavigationItemInput(input: NavigationItemInput, extraProps?: Record<string, unknown> & VNodeProps): JSX.Element;
@@ -1505,7 +1541,9 @@ export declare function resolveNavigationItemInput(input: NavigationItemInput):
1505
1541
 
1506
1542
  export declare function resolveRawIconProp(payload: boolean, prop?: RawIconProp, extraProps?: Record<string, unknown> & VNodeProps): VNodeChild;
1507
1543
 
1508
- export declare function resolveRawWysiwygEditorTools(raws: RawWysiwygEditorTool[], vui: VuiService): ResolvedWysiwygEditorSettings;
1544
+ export declare function resolveRawWysiwygEditorTools(rawTools: RawWysiwygEditorTool[], vui: VuiService): ResolvedWysiwygEditorSettings;
1545
+
1546
+ export declare function resolveRawWysiwygExtensions(raws: RawWysiwygExtension[], ctx: WysiwygEditorInitializeContext): AnyExtension[];
1509
1547
 
1510
1548
  declare interface Rule<C extends any = any> {
1511
1549
  <EC extends C = C>(constraints: Partial<EC>, overRides?: string | Partial<RuleSettings<EC>>): Rule<EC>;
@@ -9530,6 +9568,7 @@ export declare class VuiService {
9530
9568
  alert(...args: Parameters<VueStackService['alert']>): Promise<any>;
9531
9569
  confirm(...args: Parameters<VueStackService['confirm']>): Promise<any>;
9532
9570
  snackbar(...args: Parameters<VueStackService['snackbar']>): Promise<any>;
9571
+ menu(...args: Parameters<VueStackService['menu']>): Promise<any>;
9533
9572
  formPrompt<T extends {
9534
9573
  [key: string]: any;
9535
9574
  } = {
@@ -9578,6 +9617,7 @@ export declare interface VuiServiceUISettings {
9578
9617
  primaryScope: ScopeName;
9579
9618
  plainVariant: ColorVariant;
9580
9619
  containedVariant: ColorVariant;
9620
+ warningScope: ScopeName;
9581
9621
  errorScope: ScopeName;
9582
9622
  buttonDefault: {
9583
9623
  color: ScopeName;
@@ -9608,6 +9648,10 @@ export declare interface VuiServiceUISettings {
9608
9648
  export declare type VuiVNodeResolver = () => VNodeChild;
9609
9649
 
9610
9650
  export declare const VWysiwygEditor: DefineComponent<{
9651
+ extensions: {
9652
+ type: PropType<RawWysiwygExtension<any, any>[]>;
9653
+ default: () => never[];
9654
+ };
9611
9655
  tools: {
9612
9656
  type: PropType<RawWysiwygEditorTool[]>;
9613
9657
  default: () => never[];
@@ -9735,6 +9779,10 @@ export declare const VWysiwygEditor: DefineComponent<{
9735
9779
  focus: (ev: FocusEvent) => boolean;
9736
9780
  blur: (ev: FocusEvent) => boolean;
9737
9781
  }, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<{
9782
+ extensions: {
9783
+ type: PropType<RawWysiwygExtension<any, any>[]>;
9784
+ default: () => never[];
9785
+ };
9738
9786
  tools: {
9739
9787
  type: PropType<RawWysiwygEditorTool[]>;
9740
9788
  default: () => never[];
@@ -9839,6 +9887,7 @@ export declare const VWysiwygEditor: DefineComponent<{
9839
9887
  hiddenInfo: boolean;
9840
9888
  errors: FormNodeError[];
9841
9889
  loading: boolean;
9890
+ extensions: RawWysiwygExtension<any, any>[];
9842
9891
  tools: RawWysiwygEditorTool[];
9843
9892
  floatingToolbar: boolean;
9844
9893
  disabledMinHeight: boolean;
@@ -9847,14 +9896,47 @@ export declare const VWysiwygEditor: DefineComponent<{
9847
9896
 
9848
9897
  export declare const WysiwygBulletListTool: WysiwygEditorToolFactory<BulletListOptions>;
9849
9898
 
9899
+ export declare const WysiwygColorExtension: Extension_2<WysiwygColorOptions, any>;
9900
+
9901
+ export declare interface WysiwygColorItem {
9902
+ key?: string | number;
9903
+ name?: VNodeChild | ((vui: VuiService) => VNodeChild);
9904
+ color: string | null;
9905
+ }
9906
+
9907
+ export declare type WysiwygColorOptions = {
9908
+ types: string[];
9909
+ };
9910
+
9850
9911
  export declare interface WysiwygEditorContext {
9851
9912
  editor: Editor;
9852
9913
  vui: VuiService;
9853
9914
  }
9854
9915
 
9916
+ export declare type WysiwygEditorEvent = typeof EDITOR_EVENTS[number];
9917
+
9918
+ export declare type WysiwygEditorEventsBucket = {
9919
+ [EV in WysiwygEditorEvent]: NonNullable<WysiwygEditorEventsOptions[PrefixedEventName<EV>]>[];
9920
+ };
9921
+
9922
+ export declare interface WysiwygEditorEventsOptions extends Partial<Pick<EditorOptions, WysiwygEditorPrefixedEvent>> {
9923
+ }
9924
+
9925
+ export declare class WysiwygEditorInitializeContext {
9926
+ readonly listeners: WysiwygEditorEventsBucket;
9927
+ private readonly _vui;
9928
+ get vui(): VuiService;
9929
+ constructor(vuiGetter: () => VuiService, opts?: WysiwygEditorEventsOptions);
9930
+ on<EV extends WysiwygEditorEvent>(ev: EV, handler: NonNullable<WysiwygEditorEventsOptions[PrefixedEventName<EV>]>): () => void;
9931
+ off<EV extends WysiwygEditorEvent>(ev: EV, handler: NonNullable<WysiwygEditorEventsOptions[PrefixedEventName<EV>]>): void;
9932
+ editorOptions(): WysiwygEditorEventsOptions;
9933
+ }
9934
+
9935
+ export declare type WysiwygEditorPrefixedEvent = PrefixedEventName<WysiwygEditorEvent>;
9936
+
9855
9937
  export declare interface WysiwygEditorTool {
9856
9938
  key: string;
9857
- icon: IconName | ((ctx: WysiwygEditorContext) => IconName);
9939
+ icon: IconName | ((ctx: WysiwygEditorContext) => IconName | (() => VNodeChild));
9858
9940
  active?: boolean | ((ctx: WysiwygEditorContext) => boolean);
9859
9941
  disabled?: boolean | ((ctx: WysiwygEditorContext) => boolean);
9860
9942
  onClick: (ctx: WysiwygEditorContext, ev: MouseEvent) => any;
@@ -9864,6 +9946,10 @@ export declare interface WysiwygEditorTool {
9864
9946
 
9865
9947
  export declare type WysiwygEditorToolFactory<Options = void> = (vui: VuiService, options?: Options) => WysiwygEditorTool | WysiwygEditorTool[];
9866
9948
 
9949
+ export declare type WysiwygExtensionFactory<Options = any, Storage = any> = (ctx: WysiwygEditorInitializeContext) => Extension<Options, Storage> | Node_2<Options, Storage> | Mark<Options, Storage>;
9950
+
9951
+ export declare type WysiwygExtensionSource<Options = any, Storage = any> = Extension<Options, Storage> | Node_2<Options, Storage> | Mark<Options, Storage> | WysiwygExtensionFactory<Options, Storage>;
9952
+
9867
9953
  export declare const WysiwygFormatBoldTool: WysiwygEditorToolFactory<BoldOptions>;
9868
9954
 
9869
9955
  export declare const WysiwygFormatItalicTool: WysiwygEditorToolFactory<ItalicOptions>;
@@ -9874,9 +9960,60 @@ export declare const WysiwygHistoryTool: WysiwygEditorToolFactory<HistoryOptions
9874
9960
 
9875
9961
  export declare const WysiwygLinkTool: WysiwygEditorToolFactory<LinkOptions>;
9876
9962
 
9877
- export declare const WysiwygOrderedListTool: WysiwygEditorToolFactory<OrderedListOptions>;
9963
+ export declare const WysiwygLinter: CreatedWysiwygExtension<WysiwygLinterOptions, WysiwygLinterStorage>;
9964
+
9965
+ export declare function WysiwygLinterBadWords(words: string[]): typeof WysiwygLinterPlugin;
9966
+
9967
+ declare interface WysiwygLinterFixer {
9968
+ message: WysiwygLinterFixMessage;
9969
+ handler: WysiwygLinterFixFn;
9970
+ }
9971
+
9972
+ declare type WysiwygLinterFixFn = (view: EditorView, issue: WysiwygLinterResult) => any;
9973
+
9974
+ declare type WysiwygLinterFixMessage = string | (() => VNodeChild);
9975
+
9976
+ export declare class WysiwygLinterHeadingLevel extends WysiwygLinterPlugin {
9977
+ fixHeader(level: number): ({ state, dispatch }: EditorView, issue: WysiwygLinterResult) => void;
9978
+ scan(): this;
9979
+ }
9878
9980
 
9879
- export declare const WysiwygTextColorTool: WysiwygEditorToolFactory;
9981
+ export declare interface WysiwygLinterOptions {
9982
+ plugins: Array<typeof WysiwygLinterPlugin>;
9983
+ }
9984
+
9985
+ export declare class WysiwygLinterPlugin {
9986
+ protected doc: Node_3;
9987
+ private results;
9988
+ constructor(doc: Node_3);
9989
+ record(result: RawLinterResult): void;
9990
+ scan(): this;
9991
+ getResults(): WysiwygLinterResult[];
9992
+ }
9993
+
9994
+ export declare class WysiwygLinterPunctuation extends WysiwygLinterPlugin {
9995
+ regex: RegExp;
9996
+ fix(replacement: any): ({ state, dispatch }: EditorView, issue: WysiwygLinterResult) => void;
9997
+ scan(): this;
9998
+ }
9999
+
10000
+ declare interface WysiwygLinterResult {
10001
+ id: string;
10002
+ icon: boolean;
10003
+ level: WysiwygLinterResultLevel;
10004
+ message: WysiwygLinterFixMessage;
10005
+ from: number;
10006
+ to: number;
10007
+ fix: WysiwygLinterFixer[];
10008
+ }
10009
+
10010
+ declare type WysiwygLinterResultLevel = 'warning' | 'error';
10011
+
10012
+ declare interface WysiwygLinterStorage {
10013
+ issues: WysiwygLinterResult[];
10014
+ }
10015
+
10016
+ export declare const WysiwygOrderedListTool: WysiwygEditorToolFactory<OrderedListOptions>;
9880
10017
 
9881
10018
 
9882
10019
  export * from "@fastkit/vue-kit";