@pksep/yui 0.1.330 → 0.1.332

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.
@@ -0,0 +1,5 @@
1
+ import { Directive } from 'vue';
2
+
3
+ type TextField = HTMLInputElement | HTMLTextAreaElement;
4
+ export declare const vSpellcheck: Directive<TextField, boolean | undefined>;
5
+ export {};
@@ -0,0 +1,5 @@
1
+ export interface SpellingError {
2
+ from: number;
3
+ to: number;
4
+ }
5
+ export declare const checkSpelling: (text: string) => Promise<SpellingError[]>;
@@ -0,0 +1,5 @@
1
+ export interface ISpellcheckProps {
2
+ spellcheck?: boolean;
3
+ lang?: string;
4
+ }
5
+ export declare const getSpellcheckLanguage: (text: string) => "ru" | "en";
@@ -0,0 +1 @@
1
+ export {};
@@ -1,8 +1,12 @@
1
+ import { IStickerPickerItem } from './sticker-picker';
1
2
  import { IContentEditorSlots } from './interfaces/content-editor';
2
3
 
3
4
  declare function __VLS_template(): Readonly<IContentEditorSlots> & IContentEditorSlots;
4
5
  declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
5
6
  modelValue: import('vue').PropType<string>;
7
+ stickers: {
8
+ type: import('vue').PropType<readonly IStickerPickerItem[]>;
9
+ };
6
10
  attachmentDraftKey: {
7
11
  type: import('vue').PropType<string>;
8
12
  };
@@ -126,12 +130,16 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
126
130
  queueAttachFiles: (files: FileList | File[], onlyMedia: boolean) => Promise<void>;
127
131
  preloadEmojiPicker: () => boolean;
128
132
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
133
+ "unmount-sticker": (stickerId: string) => void;
129
134
  "unmount-send": (params: import('..').IContentEditorSendPayload) => void;
130
135
  "unmount-attach-file": (files: FileList, onlyMedia: boolean) => void;
131
136
  "mention-change": (search: string | null) => void;
132
137
  "slash-change": (search: string | null) => void;
133
138
  }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
134
139
  modelValue: import('vue').PropType<string>;
140
+ stickers: {
141
+ type: import('vue').PropType<readonly IStickerPickerItem[]>;
142
+ };
135
143
  attachmentDraftKey: {
136
144
  type: import('vue').PropType<string>;
137
145
  };
@@ -248,6 +256,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
248
256
  type: import('vue').PropType<(item: unknown) => string>;
249
257
  };
250
258
  }>> & Readonly<{
259
+ "onUnmount-sticker"?: ((stickerId: string) => any) | undefined;
251
260
  "onUnmount-send"?: ((params: import('..').IContentEditorSendPayload) => any) | undefined;
252
261
  "onUnmount-attach-file"?: ((files: FileList, onlyMedia: boolean) => any) | undefined;
253
262
  "onMention-change"?: ((search: string | null) => any) | undefined;
@@ -4,6 +4,7 @@ interface ContentEditorColorOption {
4
4
  }
5
5
  interface Props {
6
6
  colors: ContentEditorColorOption[];
7
+ textColors?: ContentEditorColorOption[];
7
8
  activeTextColor?: string | null;
8
9
  activeBackgroundColor?: string | null;
9
10
  }
@@ -30,8 +30,8 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
30
30
  onSelect?: ((index: number) => any) | undefined;
31
31
  "onUpdate:activeIndex"?: ((index: number) => any) | undefined;
32
32
  }>, {
33
- positionStyle: CSSProperties;
34
33
  id: string;
34
+ positionStyle: CSSProperties;
35
35
  activeIndex: number;
36
36
  emptyText: string;
37
37
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,38 @@
1
+ import { EmojiPickerSelection } from './emoji-picker-config';
2
+ import { IStickerPickerItem } from './sticker-picker';
3
+
4
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
5
+ stickers?: readonly IStickerPickerItem[];
6
+ }>, {
7
+ stickers: () => never[];
8
+ }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
9
+ select: (emoji: EmojiPickerSelection) => void;
10
+ "select-sticker": (sticker: IStickerPickerItem) => void;
11
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
12
+ stickers?: readonly IStickerPickerItem[];
13
+ }>, {
14
+ stickers: () => never[];
15
+ }>>> & Readonly<{
16
+ onSelect?: ((emoji: EmojiPickerSelection) => any) | undefined;
17
+ "onSelect-sticker"?: ((sticker: IStickerPickerItem) => any) | undefined;
18
+ }>, {
19
+ stickers: readonly IStickerPickerItem[];
20
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
21
+ export default _default;
22
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
23
+ type __VLS_TypePropsToRuntimeProps<T> = {
24
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
25
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
26
+ } : {
27
+ type: import('vue').PropType<T[K]>;
28
+ required: true;
29
+ };
30
+ };
31
+ type __VLS_WithDefaults<P, D> = {
32
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
33
+ default: D[K];
34
+ }> : P[K];
35
+ };
36
+ type __VLS_Prettify<T> = {
37
+ [K in keyof T]: T[K];
38
+ } & {};
@@ -0,0 +1,11 @@
1
+ export declare const DEFAULT_TEXT_COLOR = "var(--text-primary)";
2
+ export declare const TEXT_COLOR_ATTRIBUTE = "data-yui-color";
3
+ export declare const BACKGROUND_COLOR_ATTRIBUTE = "data-yui-background-color";
4
+ export declare const contentEditorColors: {
5
+ label: string;
6
+ value: string;
7
+ }[];
8
+ export declare const normalizeContentEditorColor: (value: unknown, allowDefault?: boolean) => string | null;
9
+ export declare const ContentEditorColor: import('@tiptap/core').Extension<import('@tiptap/extension-text-style').ColorOptions, any>;
10
+ export declare const ContentEditorBackgroundColor: import('@tiptap/core').Extension<import('@tiptap/extension-text-style').BackgroundColorOptions, any>;
11
+ export declare const normalizePastedContentEditorColors: (html: string) => string;
@@ -0,0 +1,3 @@
1
+ import { Extension } from '@tiptap/core';
2
+
3
+ export declare const ContentEditorSpellcheck: Extension<any, any>;
@@ -1,9 +1,12 @@
1
+ import { IStickerPickerItem } from '../sticker-picker';
2
+
1
3
  export interface IContentEditorSendPayload {
2
4
  content?: string;
3
5
  files?: FileList;
4
6
  mediaFiles?: FileList;
5
7
  }
6
8
  export interface IContentEditorEmit {
9
+ (e: 'unmount-sticker', stickerId: string): void;
7
10
  (e: 'unmount-send', params: IContentEditorSendPayload): void;
8
11
  (e: 'unmount-attach-file', files: FileList, onlyMedia: boolean): void;
9
12
  (e: 'mention-change', search: string | null): void;
@@ -17,6 +20,7 @@ export interface IContentEditorSlots {
17
20
  'desktop-right-action'?: () => unknown;
18
21
  }
19
22
  export interface IContentEditorProps {
23
+ stickers?: readonly IStickerPickerItem[];
20
24
  /** Разделяет несохранённые вложения разных черновиков в одном экземпляре редактора. */
21
25
  attachmentDraftKey?: string;
22
26
  /** Keeps the full toolbar in narrow embedded surfaces. Default: responsive. */
@@ -0,0 +1,8 @@
1
+ export interface IStickerPickerItem {
2
+ id: string;
3
+ label: string;
4
+ src: string;
5
+ previewSrc?: string;
6
+ keywords: readonly string[];
7
+ }
8
+ export declare const matchesStickerSearch: (sticker: IStickerPickerItem, query: string) => boolean;
@@ -4,6 +4,7 @@ import { TextFieldEnum } from '../Input/enum/enum';
4
4
  declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<IInputProps>, {
5
5
  type: TextFieldEnum;
6
6
  required: boolean;
7
+ spellcheck: boolean;
7
8
  inputMessage: string;
8
9
  modelValue: string;
9
10
  hideClearButton: boolean;
@@ -14,6 +15,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
14
15
  }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<IInputProps>, {
15
16
  type: TextFieldEnum;
16
17
  required: boolean;
18
+ spellcheck: boolean;
17
19
  inputMessage: string;
18
20
  modelValue: string;
19
21
  hideClearButton: boolean;
@@ -29,6 +31,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
29
31
  modelValue: string;
30
32
  modelModifiers: object;
31
33
  hideClearButton: boolean;
34
+ spellcheck: boolean;
32
35
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
33
36
  export default _default;
34
37
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
@@ -1,7 +1,8 @@
1
1
  import { TextFieldEnum } from '../enum/enum';
2
2
  import { IDataTestIdProp } from '../../../common/dataTestidProps';
3
+ import { ISpellcheckProps } from '../../../common/spellcheck';
3
4
 
4
- export interface IInputProps extends IDataTestIdProp {
5
+ export interface IInputProps extends IDataTestIdProp, ISpellcheckProps {
5
6
  placeholder?: string;
6
7
  inputId?: string;
7
8
  ariaLabel?: string;
@@ -12,6 +13,7 @@ export interface IInputProps extends IDataTestIdProp {
12
13
  modelValue?: string;
13
14
  hideClearButton?: boolean;
14
15
  autocomplete?: string;
16
+ maxlength?: number;
15
17
  modelModifiers?: object;
16
18
  }
17
19
  export interface IInputEmit {
@@ -4,6 +4,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
4
4
  placeholder: string;
5
5
  height: string;
6
6
  modelValue: string;
7
+ spellcheck: boolean;
7
8
  dataTestid: string;
8
9
  global: boolean;
9
10
  globalResultsFunction: () => never[];
@@ -18,6 +19,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
18
19
  placeholder: string;
19
20
  height: string;
20
21
  modelValue: string;
22
+ spellcheck: boolean;
21
23
  dataTestid: string;
22
24
  global: boolean;
23
25
  globalResultsFunction: () => never[];
@@ -33,6 +35,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
33
35
  dataTestid: string;
34
36
  placeholder: string;
35
37
  modelValue: string;
38
+ spellcheck: boolean;
36
39
  global: boolean;
37
40
  globalResultsFunction: ResultSearchType[];
38
41
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
@@ -1,5 +1,6 @@
1
1
  import { IconNameEnum } from '../../Icon/enum/enum';
2
2
  import { IDataTestIdProp } from '../../../common/dataTestidProps';
3
+ import { ISpellcheckProps } from '../../../common/spellcheck';
3
4
 
4
5
  export type ResultSearchType = {
5
6
  nameArea: string;
@@ -7,7 +8,7 @@ export type ResultSearchType = {
7
8
  icon?: IconNameEnum;
8
9
  [key: string]: unknown;
9
10
  };
10
- export interface ISearchProps extends IDataTestIdProp {
11
+ export interface ISearchProps extends IDataTestIdProp, ISpellcheckProps {
11
12
  defaultValue?: string;
12
13
  placeholder?: string;
13
14
  showHistory?: boolean;
@@ -5,6 +5,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
5
5
  required: boolean;
6
6
  modelValue: string;
7
7
  readonly: boolean;
8
+ spellcheck: boolean;
8
9
  dataTestid: string;
9
10
  type: TextareaTypeEnum;
10
11
  modelModifiers: () => {};
@@ -14,6 +15,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
14
15
  required: boolean;
15
16
  modelValue: string;
16
17
  readonly: boolean;
18
+ spellcheck: boolean;
17
19
  dataTestid: string;
18
20
  type: TextareaTypeEnum;
19
21
  modelModifiers: () => {};
@@ -25,6 +27,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
25
27
  required: boolean;
26
28
  modelValue: string;
27
29
  modelModifiers: object;
30
+ spellcheck: boolean;
28
31
  readonly: boolean;
29
32
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
30
33
  export default _default;
@@ -1,7 +1,8 @@
1
1
  import { TextareaTypeEnum } from '../enum';
2
2
  import { IDataTestIdProp } from '../../../common/dataTestidProps';
3
+ import { ISpellcheckProps } from '../../../common/spellcheck';
3
4
 
4
- export interface ITextareaProps extends IDataTestIdProp {
5
+ export interface ITextareaProps extends IDataTestIdProp, ISpellcheckProps {
5
6
  placeholder?: string;
6
7
  inputMessage?: string;
7
8
  required?: boolean;
package/dist/index.d.ts CHANGED
@@ -10,3 +10,5 @@ export * from '@floating-ui/vue';
10
10
  export * from '@vueuse/components';
11
11
  export { useSearch } from './extenstions/search';
12
12
  export { VueToolsCore };
13
+ export { vSpellcheck } from './common/spellcheck-directive';
14
+ export type { IStickerPickerItem } from './components/ContentEditor/sticker-picker';