@fastkit/vui 0.7.61 → 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 +437 -228
  4. package/dist/vui.cjs.prod.js +437 -228
  5. package/dist/vui.css +166 -12
  6. package/dist/vui.d.ts +101 -54
  7. package/dist/vui.min.css +1 -1
  8. package/dist/vui.min.css.map +1 -1
  9. package/dist/vui.mjs +431 -225
  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/VWysiwygEditor.scss +4 -0
  14. package/src/components/VWysiwygEditor/VWysiwygEditor.tsx +19 -9
  15. package/src/components/VWysiwygEditor/extensions/.DS_Store +0 -0
  16. package/src/components/VWysiwygEditor/extensions/color.ts +72 -0
  17. package/src/components/VWysiwygEditor/extensions/index.ts +1 -0
  18. package/src/components/VWysiwygEditor/extensions/linter/.DS_Store +0 -0
  19. package/src/components/VWysiwygEditor/extensions/linter/Linter.scss +80 -15
  20. package/src/components/VWysiwygEditor/extensions/linter/Linter.tsx +210 -0
  21. package/src/components/VWysiwygEditor/extensions/linter/LinterPlugin.ts +29 -11
  22. package/src/components/VWysiwygEditor/extensions/linter/index.ts +3 -3
  23. package/src/components/VWysiwygEditor/extensions/linter/plugins/BadWords.tsx +50 -0
  24. package/src/components/VWysiwygEditor/extensions/linter/plugins/HeadingLevel.ts +9 -3
  25. package/src/components/VWysiwygEditor/extensions/linter/plugins/Punctuation.ts +9 -3
  26. package/src/components/VWysiwygEditor/extensions/linter/plugins/index.ts +3 -3
  27. package/src/components/VWysiwygEditor/extensions/linter/utils.ts +28 -0
  28. package/src/components/VWysiwygEditor/schemes.ts +87 -5
  29. package/src/components/VWysiwygEditor/tools/color.scss +140 -0
  30. package/src/components/VWysiwygEditor/tools/color.tsx +90 -0
  31. package/src/components/VWysiwygEditor/tools/index.ts +1 -1
  32. package/src/service.tsx +5 -0
  33. package/src/tool/vite-plugin.ts +1 -0
  34. package/src/components/VWysiwygEditor/extensions/linter/Linter.ts +0 -262
  35. package/src/components/VWysiwygEditor/extensions/linter/plugins/BadWords.ts +0 -34
  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;
@@ -2186,23 +2189,62 @@ thead th {
2186
2189
  overflow: visible;
2187
2190
  }
2188
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 {
2189
2207
  position: absolute;
2190
- top: calc(100% + 8px);
2208
+ top: 0;
2209
+ right: 0;
2191
2210
  left: 0;
2192
- min-width: 200px;
2193
- max-width: calc(100vw - 40px);
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%;
2194
2221
  padding: 8px;
2195
- font-size: 87.5%;
2196
- line-height: 1.5;
2197
- pointer-events: none;
2198
- background: #fff;
2199
- border-radius: 4px;
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;
2200
2240
  opacity: 0;
2201
- transition: opacity 0.15s;
2241
+ transition: 0.15s;
2202
2242
  }
2203
- .v-linter__issue-menu--active {
2204
- pointer-events: auto;
2205
- opacity: 1;
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;
2206
2248
  }
2207
2249
  .v-linter__issue-menu__fix {
2208
2250
  display: inline;
@@ -2215,6 +2257,118 @@ thead th {
2215
2257
  outline: 0;
2216
2258
  appearance: none;
2217
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
+ }
2218
2372
  .v-tabs {
2219
2373
  position: relative;
2220
2374
  width: 100%;
package/dist/vui.d.ts CHANGED
@@ -15,7 +15,8 @@ import { EditorOptions } from '@tiptap/vue-3';
15
15
  import { EditorView } from 'prosemirror-view';
16
16
  import { EmitsOptions } from 'vue';
17
17
  import { EV } from '@fastkit/ev';
18
- import { Extension } from '@tiptap/core';
18
+ import { Extension } from '@tiptap/vue-3';
19
+ import { Extension as Extension_2 } from '@tiptap/core';
19
20
  import { Extensions } from '@tiptap/vue-3';
20
21
  import { ExtractPropInput } from '@fastkit/vue-utils';
21
22
  import { ExtractPropTypes } from 'vue';
@@ -44,10 +45,12 @@ import { InjectionKey } from 'vue';
44
45
  import { ItalicOptions } from '@tiptap/extension-italic';
45
46
  import { LinkOptions } from '@tiptap/extension-link';
46
47
  import { LocationService } from '@fastkit/vue-utils';
48
+ import { Mark } from '@tiptap/vue-3';
47
49
  import { MediaMatchKey } from '@fastkit/media-match';
48
50
  import { NavigationableInheritProps } from '@fastkit/vue-utils';
49
51
  import { NavigationFailure } from 'vue-router';
50
- import { Node as Node_2 } from 'prosemirror-model';
52
+ import { Node as Node_2 } from '@tiptap/vue-3';
53
+ import { Node as Node_3 } from 'prosemirror-model';
51
54
  import { Numberish } from '@fastkit/vue-kit';
52
55
  import { OrderedListOptions } from '@tiptap/extension-ordered-list';
53
56
  import { Prop } from 'vue';
@@ -106,8 +109,6 @@ export declare const AVATAR_SIZES: readonly ["sm", "md", "lg"];
106
109
 
107
110
  export declare type AvatarSize = typeof AVATAR_SIZES[number];
108
111
 
109
- export declare function BadWords(words: string[]): typeof LinterPlugin;
110
-
111
112
  export declare interface BreadcrumbsItem extends Pick<NavigationableInheritProps, 'to' | 'disabled'> {
112
113
  /**
113
114
  * "正確なマッチモード" を強制する場合true
@@ -476,6 +477,13 @@ export declare function createControlProps(): {
476
477
  loading: BooleanConstructor;
477
478
  };
478
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
+
479
487
  export declare function createElevationProps(): {
480
488
  elevation: PropType<VuiElevationValue>;
481
489
  };
@@ -1050,6 +1058,15 @@ export declare function createVFormProps(): {
1050
1058
  errorMessages: PropType<string | string[]>;
1051
1059
  };
1052
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
+
1053
1070
  declare const DATA_TABLE_DEFAULTS: {
1054
1071
  itemKey: string;
1055
1072
  pageQuery: string;
@@ -1361,8 +1378,6 @@ export declare type ElevationProps = ExtractPropTypes<ReturnType<typeof createEl
1361
1378
 
1362
1379
  declare type EmptyIconSymbol = '$empty';
1363
1380
 
1364
- declare type FixFn = (view: EditorView, issue: LinterResult) => any;
1365
-
1366
1381
  export declare type GridContainerAlignContentValue = 'flex-start' | 'flex-end' | 'start' | 'end' | 'stretch' | 'baseline' | 'center' | 'self-start' | 'self-end';
1367
1382
 
1368
1383
  export declare type GridContainerDirectionValue = 'row' | 'row-reverse' | 'column' | 'column-reverse';
@@ -1381,11 +1396,6 @@ export declare type GridItemNumberSizeValue = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
1381
1396
 
1382
1397
  export declare type GridItemSizeValue = GridItemNumberSizeValue | 'auto';
1383
1398
 
1384
- export declare class HeadingLevel extends LinterPlugin {
1385
- fixHeader(level: number): ({ state, dispatch }: EditorView, issue: LinterResult) => void;
1386
- scan(): this;
1387
- }
1388
-
1389
1399
  export { ICON_NAMES }
1390
1400
 
1391
1401
  declare type IconGenerator = (input: IconPropInout) => VNodeChild;
@@ -1416,32 +1426,6 @@ declare interface InputBoxSlots {
1416
1426
 
1417
1427
  export declare function installVuiPlugin(app: App, opts: VuiPluginOptions): App<any>;
1418
1428
 
1419
- export declare const Linter: Extension<LinterOptions, any>;
1420
-
1421
- export declare interface LinterOptions {
1422
- plugins: Array<typeof LinterPlugin>;
1423
- }
1424
-
1425
- export declare class LinterPlugin {
1426
- protected doc: Node_2;
1427
- private results;
1428
- constructor(doc: Node_2);
1429
- record(result: RawLinterResult): void;
1430
- scan(): this;
1431
- getResults(): LinterResult[];
1432
- }
1433
-
1434
- declare interface LinterResult {
1435
- level: LinterResultLevel;
1436
- message: string;
1437
- from: number;
1438
- to: number;
1439
- fix?: FixFn;
1440
- fixMessage?: string;
1441
- }
1442
-
1443
- declare type LinterResultLevel = 'warning' | 'error';
1444
-
1445
1429
  export declare const listTileEmits: {
1446
1430
  changeActive: (isActive: boolean) => boolean;
1447
1431
  };
@@ -1500,12 +1484,6 @@ export declare function paginationProps(): {
1500
1484
 
1501
1485
  declare type PrefixedEventName<S extends string> = `on${Capitalize<S>}`;
1502
1486
 
1503
- export declare class Punctuation extends LinterPlugin {
1504
- regex: RegExp;
1505
- fix(replacement: any): ({ state, dispatch }: EditorView, issue: LinterResult) => void;
1506
- scan(): this;
1507
- }
1508
-
1509
1487
  export declare type RawBreadcrumbsItem = string | BreadcrumbsItem;
1510
1488
 
1511
1489
  declare type RawGridValue<T extends number | string = number | string> = T | Partial<Record<MediaMatchKey, T>> | undefined;
@@ -1516,8 +1494,9 @@ export declare type RawIconProp = IconName | EmptyIconSymbol | ToggleableIconHoo
1516
1494
 
1517
1495
  export declare function rawIconProp(): PropType<RawIconProp>;
1518
1496
 
1519
- declare interface RawLinterResult extends Omit<LinterResult, 'level'> {
1520
- level?: LinterResultLevel;
1497
+ declare interface RawLinterResult extends Omit<WysiwygLinterResult, 'level' | 'fix' | 'id'> {
1498
+ level?: WysiwygLinterResultLevel;
1499
+ fix?: WysiwygLinterFixer | WysiwygLinterFixer[];
1521
1500
  }
1522
1501
 
1523
1502
  export declare type RawVButtonIcon = IconName | VButtonIcon;
@@ -1543,7 +1522,7 @@ export declare type RawVuiServiceUISettings = Partial<VuiServiceUISettings>;
1543
1522
 
1544
1523
  export declare type RawWysiwygEditorTool = WysiwygEditorTool | WysiwygEditorToolFactory<any>;
1545
1524
 
1546
- export declare type RawWysiwygExtension = AnyExtension | WysiwygExtensionFactory;
1525
+ export declare type RawWysiwygExtension<Options = any, Storage = any> = WysiwygExtensionSource<Options, Storage> | CreatedWysiwygExtension<Options, Storage>;
1547
1526
 
1548
1527
  declare type RecursiveArray<T> = T | RecursiveArray<T>[];
1549
1528
 
@@ -9588,6 +9567,7 @@ export declare class VuiService {
9588
9567
  alert(...args: Parameters<VueStackService['alert']>): Promise<any>;
9589
9568
  confirm(...args: Parameters<VueStackService['confirm']>): Promise<any>;
9590
9569
  snackbar(...args: Parameters<VueStackService['snackbar']>): Promise<any>;
9570
+ menu(...args: Parameters<VueStackService['menu']>): Promise<any>;
9591
9571
  formPrompt<T extends {
9592
9572
  [key: string]: any;
9593
9573
  } = {
@@ -9636,6 +9616,7 @@ export declare interface VuiServiceUISettings {
9636
9616
  primaryScope: ScopeName;
9637
9617
  plainVariant: ColorVariant;
9638
9618
  containedVariant: ColorVariant;
9619
+ warningScope: ScopeName;
9639
9620
  errorScope: ScopeName;
9640
9621
  buttonDefault: {
9641
9622
  color: ScopeName;
@@ -9667,7 +9648,7 @@ export declare type VuiVNodeResolver = () => VNodeChild;
9667
9648
 
9668
9649
  export declare const VWysiwygEditor: DefineComponent<{
9669
9650
  extensions: {
9670
- type: PropType<RawWysiwygExtension[]>;
9651
+ type: PropType<RawWysiwygExtension<any, any>[]>;
9671
9652
  default: () => never[];
9672
9653
  };
9673
9654
  tools: {
@@ -9798,7 +9779,7 @@ export declare const VWysiwygEditor: DefineComponent<{
9798
9779
  blur: (ev: FocusEvent) => boolean;
9799
9780
  }, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<{
9800
9781
  extensions: {
9801
- type: PropType<RawWysiwygExtension[]>;
9782
+ type: PropType<RawWysiwygExtension<any, any>[]>;
9802
9783
  default: () => never[];
9803
9784
  };
9804
9785
  tools: {
@@ -9905,7 +9886,7 @@ export declare const VWysiwygEditor: DefineComponent<{
9905
9886
  hiddenInfo: boolean;
9906
9887
  errors: FormNodeError[];
9907
9888
  loading: boolean;
9908
- extensions: RawWysiwygExtension[];
9889
+ extensions: RawWysiwygExtension<any, any>[];
9909
9890
  tools: RawWysiwygEditorTool[];
9910
9891
  floatingToolbar: boolean;
9911
9892
  disabledMinHeight: boolean;
@@ -9914,6 +9895,18 @@ export declare const VWysiwygEditor: DefineComponent<{
9914
9895
 
9915
9896
  export declare const WysiwygBulletListTool: WysiwygEditorToolFactory<BulletListOptions>;
9916
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
+
9917
9910
  export declare interface WysiwygEditorContext {
9918
9911
  editor: Editor;
9919
9912
  vui: VuiService;
@@ -9930,7 +9923,9 @@ export declare interface WysiwygEditorEventsOptions extends Partial<Pick<EditorO
9930
9923
 
9931
9924
  export declare class WysiwygEditorInitializeContext {
9932
9925
  readonly listeners: WysiwygEditorEventsBucket;
9933
- constructor(opts?: WysiwygEditorEventsOptions);
9926
+ private readonly _vui;
9927
+ get vui(): VuiService;
9928
+ constructor(vuiGetter: () => VuiService, opts?: WysiwygEditorEventsOptions);
9934
9929
  on<EV extends WysiwygEditorEvent>(ev: EV, handler: NonNullable<WysiwygEditorEventsOptions[PrefixedEventName<EV>]>): () => void;
9935
9930
  off<EV extends WysiwygEditorEvent>(ev: EV, handler: NonNullable<WysiwygEditorEventsOptions[PrefixedEventName<EV>]>): void;
9936
9931
  editorOptions(): WysiwygEditorEventsOptions;
@@ -9940,7 +9935,7 @@ export declare type WysiwygEditorPrefixedEvent = PrefixedEventName<WysiwygEditor
9940
9935
 
9941
9936
  export declare interface WysiwygEditorTool {
9942
9937
  key: string;
9943
- icon: IconName | ((ctx: WysiwygEditorContext) => IconName);
9938
+ icon: IconName | ((ctx: WysiwygEditorContext) => IconName | (() => VNodeChild));
9944
9939
  active?: boolean | ((ctx: WysiwygEditorContext) => boolean);
9945
9940
  disabled?: boolean | ((ctx: WysiwygEditorContext) => boolean);
9946
9941
  onClick: (ctx: WysiwygEditorContext, ev: MouseEvent) => any;
@@ -9950,7 +9945,9 @@ export declare interface WysiwygEditorTool {
9950
9945
 
9951
9946
  export declare type WysiwygEditorToolFactory<Options = void> = (vui: VuiService, options?: Options) => WysiwygEditorTool | WysiwygEditorTool[];
9952
9947
 
9953
- export declare type WysiwygExtensionFactory = (ctx: WysiwygEditorInitializeContext) => AnyExtension;
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>;
9954
9951
 
9955
9952
  export declare const WysiwygFormatBoldTool: WysiwygEditorToolFactory<BoldOptions>;
9956
9953
 
@@ -9962,9 +9959,59 @@ export declare const WysiwygHistoryTool: WysiwygEditorToolFactory<HistoryOptions
9962
9959
 
9963
9960
  export declare const WysiwygLinkTool: WysiwygEditorToolFactory<LinkOptions>;
9964
9961
 
9965
- 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;
9966
9972
 
9967
- export declare const WysiwygTextColorTool: WysiwygEditorToolFactory;
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
+ }
9979
+
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>;
9968
10015
 
9969
10016
 
9970
10017
  export * from "@fastkit/vue-kit";