@quadrats/common 0.5.1 → 0.5.10

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.
@@ -1,11 +1,27 @@
1
- import { isNodesTypeIn, toggleNodesType, Element, normalizeOnlyInlineOrTextInChildren } from '@quadrats/core';
1
+ import { isNodesTypeIn, toggleNodesType, Editor, Transforms, createParagraphElement, Element, normalizeOnlyInlineOrTextInChildren } from '@quadrats/core';
2
2
  import { BLOCKQUOTE_TYPE } from './constants.js';
3
3
 
4
4
  function createBlockquote({ type = BLOCKQUOTE_TYPE } = {}) {
5
5
  return {
6
6
  type,
7
7
  isSelectionInBlockquote: editor => isNodesTypeIn(editor, [type]),
8
- toggleBlockquote: editor => toggleNodesType(editor, type),
8
+ toggleBlockquote: (editor) => {
9
+ const actived = isNodesTypeIn(editor, [type]);
10
+ toggleNodesType(editor, type);
11
+ if (!actived) {
12
+ if (editor.selection) {
13
+ // Select to line end
14
+ const originPoint = Editor.point(editor, editor.selection.focus);
15
+ Transforms.move(editor, { unit: 'line', edge: 'end' });
16
+ Transforms.collapse(editor, { edge: 'end' });
17
+ // Only last block add paragraph automatically
18
+ if (!Editor.next(editor)) {
19
+ Transforms.insertNodes(editor, [createParagraphElement()]);
20
+ }
21
+ Transforms.select(editor, originPoint);
22
+ }
23
+ }
24
+ },
9
25
  with(editor) {
10
26
  const { normalizeNode } = editor;
11
27
  editor.normalizeNode = (entry) => {
@@ -10,7 +10,23 @@ function createBlockquote({ type = BLOCKQUOTE_TYPE } = {}) {
10
10
  return {
11
11
  type,
12
12
  isSelectionInBlockquote: editor => core.isNodesTypeIn(editor, [type]),
13
- toggleBlockquote: editor => core.toggleNodesType(editor, type),
13
+ toggleBlockquote: (editor) => {
14
+ const actived = core.isNodesTypeIn(editor, [type]);
15
+ core.toggleNodesType(editor, type);
16
+ if (!actived) {
17
+ if (editor.selection) {
18
+ // Select to line end
19
+ const originPoint = core.Editor.point(editor, editor.selection.focus);
20
+ core.Transforms.move(editor, { unit: 'line', edge: 'end' });
21
+ core.Transforms.collapse(editor, { edge: 'end' });
22
+ // Only last block add paragraph automatically
23
+ if (!core.Editor.next(editor)) {
24
+ core.Transforms.insertNodes(editor, [core.createParagraphElement()]);
25
+ }
26
+ core.Transforms.select(editor, originPoint);
27
+ }
28
+ }
29
+ },
14
30
  with(editor) {
15
31
  const { normalizeNode } = editor;
16
32
  editor.normalizeNode = (entry) => {
@@ -1,7 +1,7 @@
1
1
  import { Editor, QuadratsElement, Withable, WithElementType } from '@quadrats/core';
2
2
  export interface BlockquoteElement extends QuadratsElement, WithElementType {
3
3
  }
4
- export interface Blockquote extends WithElementType, Withable {
5
- isSelectionInBlockquote(editor: Editor): boolean;
6
- toggleBlockquote(editor: Editor): void;
4
+ export interface Blockquote<T extends Editor = Editor> extends WithElementType, Withable {
5
+ isSelectionInBlockquote(editor: T): boolean;
6
+ toggleBlockquote(editor: T): void;
7
7
  }
@@ -1 +1 @@
1
- export declare const createBold: (variant?: string | undefined) => ({ type, variant }?: import("@quadrats/common/toggle-mark").CreateToggleMarkOptions | undefined) => import("@quadrats/common/toggle-mark").ToggleMark;
1
+ export declare const createBold: (variant?: string | undefined) => ({ type, variant }?: import("@quadrats/common/toggle-mark").CreateToggleMarkOptions | undefined) => import("@quadrats/common/toggle-mark").ToggleMark<import("slate").BaseEditor>;
@@ -2,7 +2,7 @@ import { Editor, QuadratsElement, Text, Withable, WithElementType } from '@quadr
2
2
  export interface DividerElement extends QuadratsElement, WithElementType {
3
3
  children: [Text];
4
4
  }
5
- export interface Divider extends WithElementType, Withable {
5
+ export interface Divider<T extends Editor = Editor> extends WithElementType, Withable {
6
6
  createDividerElement(): DividerElement;
7
- insertDivider(editor: Editor): void;
7
+ insertDivider(editor: T): void;
8
8
  }
@@ -6,17 +6,18 @@ Object.defineProperty(exports, '__esModule', { value: true });
6
6
  const PodcastAppleEmbedStrategy = {
7
7
  serialize: (embedCode) => {
8
8
  var _a, _b;
9
- const result = (_b = (_a = /^https:\/\/embed.podcasts.apple.com\/[\w-]*\/podcast\/[\S]*\/id([\d]*)/i.exec(embedCode)) !== null && _a !== void 0 ? _a : /^https:\/\/embed.podcasts.apple.com\/[\w-]*\/podcast\/id([\d]*)/i.exec(embedCode)) !== null && _b !== void 0 ? _b : /^https:\/\/podcasts.apple.com\/[\w-]*\/podcast\/[\S]*\/id([\d]*)/i.exec(embedCode);
9
+ const result = (_b = (_a = /^https:\/\/embed.podcasts.apple.com\/([\w-]*)\/podcast\/[\S]*\/id([\d]*)/i.exec(embedCode)) !== null && _a !== void 0 ? _a : /^https:\/\/embed.podcasts.apple.com\/([\w-]*)\/podcast\/id([\d]*)/i.exec(embedCode)) !== null && _b !== void 0 ? _b : /^https:\/\/podcasts.apple.com\/([\w-]*)\/podcast\/[\S]*\/id([\d]*)/i.exec(embedCode);
10
10
  if (result) {
11
- const [, contextId] = result;
11
+ const [, language, contextId] = result;
12
12
  return {
13
13
  embedType: 'podcast-apple',
14
+ language,
14
15
  contextId,
15
16
  };
16
17
  }
17
18
  },
18
- deserialize: (data) => `https://embed.podcasts.apple.com/us/podcast/id${data.contextId}`,
19
- isElementDataValid: (data) => typeof data.contextId === 'string' && !!(data.contextId),
19
+ deserialize: data => { var _a; return `https://embed.podcasts.apple.com/${(_a = data.language) !== null && _a !== void 0 ? _a : 'us'}/podcast/id${data.contextId}`; },
20
+ isElementDataValid: data => typeof data.contextId === 'string' && !!(data.contextId),
20
21
  };
21
22
 
22
23
  exports.PodcastAppleEmbedStrategy = PodcastAppleEmbedStrategy;
@@ -2,6 +2,7 @@ import { EmbedElement, EmbedStrategy } from '@quadrats/common/embed';
2
2
  export declare type PodcastAppleEmbedType = 'podcast-apple';
3
3
  export declare type PodcastAppleEmbedElementData = {
4
4
  embedType: PodcastAppleEmbedType;
5
+ language?: string;
5
6
  contextId: string;
6
7
  };
7
8
  export declare type PodcastAppleEmbedElement = EmbedElement & PodcastAppleEmbedElementData;
@@ -2,17 +2,18 @@
2
2
  const PodcastAppleEmbedStrategy = {
3
3
  serialize: (embedCode) => {
4
4
  var _a, _b;
5
- const result = (_b = (_a = /^https:\/\/embed.podcasts.apple.com\/[\w-]*\/podcast\/[\S]*\/id([\d]*)/i.exec(embedCode)) !== null && _a !== void 0 ? _a : /^https:\/\/embed.podcasts.apple.com\/[\w-]*\/podcast\/id([\d]*)/i.exec(embedCode)) !== null && _b !== void 0 ? _b : /^https:\/\/podcasts.apple.com\/[\w-]*\/podcast\/[\S]*\/id([\d]*)/i.exec(embedCode);
5
+ const result = (_b = (_a = /^https:\/\/embed.podcasts.apple.com\/([\w-]*)\/podcast\/[\S]*\/id([\d]*)/i.exec(embedCode)) !== null && _a !== void 0 ? _a : /^https:\/\/embed.podcasts.apple.com\/([\w-]*)\/podcast\/id([\d]*)/i.exec(embedCode)) !== null && _b !== void 0 ? _b : /^https:\/\/podcasts.apple.com\/([\w-]*)\/podcast\/[\S]*\/id([\d]*)/i.exec(embedCode);
6
6
  if (result) {
7
- const [, contextId] = result;
7
+ const [, language, contextId] = result;
8
8
  return {
9
9
  embedType: 'podcast-apple',
10
+ language,
10
11
  contextId,
11
12
  };
12
13
  }
13
14
  },
14
- deserialize: (data) => `https://embed.podcasts.apple.com/us/podcast/id${data.contextId}`,
15
- isElementDataValid: (data) => typeof data.contextId === 'string' && !!(data.contextId),
15
+ deserialize: data => { var _a; return `https://embed.podcasts.apple.com/${(_a = data.language) !== null && _a !== void 0 ? _a : 'us'}/podcast/id${data.contextId}`; },
16
+ isElementDataValid: data => typeof data.contextId === 'string' && !!(data.contextId),
16
17
  };
17
18
 
18
19
  export { PodcastAppleEmbedStrategy };
@@ -20,7 +20,7 @@ export interface EmbedStrategy<EmbedData extends Record<string, unknown>, Render
20
20
  readonly isElementDataValid: (data: Record<keyof EmbedData, unknown>) => boolean;
21
21
  }
22
22
  export declare type EmbedStrategies<Provider extends string> = Record<Provider, EmbedStrategy<any, any>>;
23
- export interface Embed<P extends string> extends WithElementType, Withable {
23
+ export interface Embed<P extends string, T extends Editor = Editor> extends WithElementType, Withable {
24
24
  strategies: EmbedStrategies<P>;
25
- insertEmbed(editor: Editor, providers: P[], embedCode: string, defaultNode?: Node | string): void;
25
+ insertEmbed(editor: T, providers: P[], embedCode: string, defaultNode?: Node | string): void;
26
26
  }
@@ -1,5 +1,6 @@
1
+ import { Editor } from '@quadrats/core';
1
2
  import { FileUploader } from './typings';
2
3
  export interface CreateFileUploaderOptions {
3
4
  type?: string;
4
5
  }
5
- export declare function createFileUploader(options?: CreateFileUploaderOptions): FileUploader;
6
+ export declare function createFileUploader(options?: CreateFileUploaderOptions): FileUploader<Editor>;
@@ -74,8 +74,6 @@ function createFileUploader(options = {}) {
74
74
  createFileUploaderElement,
75
75
  upload,
76
76
  with(editor) {
77
- // const { isVoid } = editor;
78
- // editor.isVoid = element => element.type === type || isVoid(element);
79
77
  return editor;
80
78
  },
81
79
  };
@@ -128,8 +128,6 @@ function createFileUploader(options = {}) {
128
128
  createFileUploaderElement,
129
129
  upload,
130
130
  with(editor) {
131
- // const { isVoid } = editor;
132
- // editor.isVoid = element => element.type === type || isVoid(element);
133
131
  return editor;
134
132
  },
135
133
  };
@@ -30,8 +30,8 @@ export interface FileUploaderCreateFileUploaderElementOptions {
30
30
  getUrl: FileUploaderGetUrl;
31
31
  }
32
32
  export declare type FileUploaderUploadOptions = FileUploaderCreateFileUploaderElementOptions & GetFilesFromInputOptions & TransformsInsertNodesOptions;
33
- export interface FileUploader extends Withable {
33
+ export interface FileUploader<T extends Editor = Editor> extends Withable {
34
34
  type: string;
35
- createFileUploaderElement(editor: Editor, file: File, options: FileUploaderCreateFileUploaderElementOptions): Promise<FileUploaderElement | undefined>;
36
- upload(editor: Editor, options: FileUploaderUploadOptions): Promise<void>;
35
+ createFileUploaderElement(editor: T, file: File, options: FileUploaderCreateFileUploaderElementOptions): Promise<FileUploaderElement | undefined>;
36
+ upload(editor: T, options: FileUploaderUploadOptions): Promise<void>;
37
37
  }
@@ -18,11 +18,11 @@ export interface FootnoteWrapFootnoteOptions extends Omit<TransformsWrapNodesOpt
18
18
  export interface FootnoteUpsertFootnoteOptions {
19
19
  at?: Range;
20
20
  }
21
- export interface Footnote extends WithElementType, Withable {
22
- getFootnoteText(editor: Editor): string;
23
- isSelectionInFootnote(editor: Editor): boolean;
24
- unwrapFootnote(editor: Editor, options?: FootnoteUnwrapFootnoteOptions): void;
25
- updateFootnoteIndex(editor: Editor, options?: FootnoteUpdateFootnoteIndexOptions): void;
26
- upsertFootnoteAndUpdateIndex(editor: Editor, footnote: string, options?: FootnoteUpsertFootnoteOptions): void;
27
- wrapFootnote(editor: Editor, footnote: string, options?: FootnoteWrapFootnoteOptions): void;
21
+ export interface Footnote<T extends Editor = Editor> extends WithElementType, Withable {
22
+ getFootnoteText(editor: T): string;
23
+ isSelectionInFootnote(editor: T): boolean;
24
+ unwrapFootnote(editor: T, options?: FootnoteUnwrapFootnoteOptions): void;
25
+ updateFootnoteIndex(editor: T, options?: FootnoteUpdateFootnoteIndexOptions): void;
26
+ upsertFootnoteAndUpdateIndex(editor: T, footnote: string, options?: FootnoteUpsertFootnoteOptions): void;
27
+ wrapFootnote(editor: T, footnote: string, options?: FootnoteWrapFootnoteOptions): void;
28
28
  }
@@ -9,8 +9,8 @@ export interface WithEnabledHeadingLevels<L extends HeadingLevel> {
9
9
  */
10
10
  enabledLevels: ReadonlyArray<L>;
11
11
  }
12
- export interface Heading<L extends HeadingLevel> extends WithElementType, Withable, WithEnabledHeadingLevels<L> {
13
- getHeadingNodes(editor: Editor, level: L, options?: GetNodesOptions): Generator<NodeEntry<Node>>;
14
- isSelectionInHeading(editor: Editor, level: L, options?: GetNodesOptions): boolean;
15
- toggleHeadingNodes(editor: Editor, level: L, defaultType?: string): void;
12
+ export interface Heading<L extends HeadingLevel, T extends Editor = Editor> extends WithElementType, Withable, WithEnabledHeadingLevels<L> {
13
+ getHeadingNodes(editor: T, level: L, options?: GetNodesOptions): Generator<NodeEntry<Node>>;
14
+ isSelectionInHeading(editor: T, level: L, options?: GetNodesOptions): boolean;
15
+ toggleHeadingNodes(editor: T, level: L, defaultType?: string): void;
16
16
  }
@@ -1 +1 @@
1
- export declare const createHighlight: (variant?: string | undefined) => ({ type, variant }?: import("@quadrats/common/toggle-mark").CreateToggleMarkOptions | undefined) => import("@quadrats/common/toggle-mark").ToggleMark;
1
+ export declare const createHighlight: (variant?: string | undefined) => ({ type, variant }?: import("@quadrats/common/toggle-mark").CreateToggleMarkOptions | undefined) => import("@quadrats/common/toggle-mark").ToggleMark<import("slate").BaseEditor>;
@@ -37,7 +37,7 @@ export declare type ImageHostingResolvers<Hosting extends string> = Record<Hosti
37
37
  export declare type ImageSizeSteps = ReadonlyArray<number>;
38
38
  export declare type ImageGetAboveImageFigureOptions = GetAboveByTypesOptions;
39
39
  export declare type ImageGetAboveImageCaptionOptions = GetAboveByTypesOptions;
40
- export interface Image<Hosting extends string> extends Withable {
40
+ export interface Image<Hosting extends string, T extends Editor = Editor> extends Withable {
41
41
  /**
42
42
  * An object which keys are `figure`, `image`, 'caption` and values are the corresponding element types.
43
43
  */
@@ -51,15 +51,15 @@ export interface Image<Hosting extends string> extends Withable {
51
51
  */
52
52
  sizeSteps?: ImageSizeSteps;
53
53
  isImageUrl(url: string): boolean;
54
- getAboveImageFigure(editor: Editor, options?: ImageGetAboveImageFigureOptions): NodeEntry<ImageFigureElement> | undefined;
55
- getAboveImageCaption(editor: Editor, options?: ImageGetAboveImageCaptionOptions): NodeEntry<ImageCaptionElement> | undefined;
56
- isSelectionInImage(editor: Editor): boolean;
57
- isSelectionInImageCaption(editor: Editor): boolean;
58
- isCollapsedOnImage(editor: Editor): boolean;
54
+ getAboveImageFigure(editor: T, options?: ImageGetAboveImageFigureOptions): NodeEntry<ImageFigureElement> | undefined;
55
+ getAboveImageCaption(editor: T, options?: ImageGetAboveImageCaptionOptions): NodeEntry<ImageCaptionElement> | undefined;
56
+ isSelectionInImage(editor: T): boolean;
57
+ isSelectionInImageCaption(editor: T): boolean;
58
+ isCollapsedOnImage(editor: T): boolean;
59
59
  createImageElement(src: string, hosting?: Hosting): ImageFigureElement;
60
- insertImage(editor: Editor, src: string, options?: {
60
+ insertImage(editor: T, src: string, options?: {
61
61
  hosting?: Hosting;
62
62
  at?: Location;
63
63
  }): void;
64
- resizeImage(editor: Editor, entry: NodeEntry<QuadratsElement>, width: number): void;
64
+ resizeImage(editor: T, entry: NodeEntry<QuadratsElement>, width: number): void;
65
65
  }
@@ -3,9 +3,9 @@ import { InputWidgetConfig } from '@quadrats/common/input-widget';
3
3
  export interface InputBlockElement extends QuadratsElement, InputWidgetConfig {
4
4
  type: string;
5
5
  }
6
- export interface InputBlock extends Withable {
6
+ export interface InputBlock<T extends Editor = Editor> extends Withable {
7
7
  type: string;
8
- start(editor: Editor, config: InputWidgetConfig): void;
9
- remove(editor: Editor, entry: NodeEntry<InputBlockElement>, foucs: VoidFunction): void;
8
+ start(editor: T, config: InputWidgetConfig): void;
9
+ remove(editor: T, entry: NodeEntry<InputBlockElement>, foucs: VoidFunction): void;
10
10
  confirm(element: InputBlockElement, value: string, remove: VoidFunction): void;
11
11
  }
@@ -1 +1 @@
1
- export declare const createItalic: (variant?: string | undefined) => ({ type, variant }?: import("@quadrats/common/toggle-mark").CreateToggleMarkOptions | undefined) => import("@quadrats/common/toggle-mark").ToggleMark;
1
+ export declare const createItalic: (variant?: string | undefined) => ({ type, variant }?: import("@quadrats/common/toggle-mark").CreateToggleMarkOptions | undefined) => import("@quadrats/common/toggle-mark").ToggleMark<import("slate").BaseEditor>;
package/link/typings.d.ts CHANGED
@@ -10,18 +10,18 @@ export declare type LinkWrapLinkOptions = Omit<TransformsWrapNodesOptions, 'spli
10
10
  export interface LinkUpsertLinkOptions {
11
11
  at?: Range;
12
12
  }
13
- export interface Link extends WithElementType, Withable {
13
+ export interface Link<T extends Editor = Editor> extends WithElementType, Withable {
14
14
  isUrl(value: string): boolean;
15
15
  /**
16
16
  * To get the first previous text which is url and its range.
17
17
  */
18
- getFirstPrevTextAsUrlAndRange(editor: Editor, at: Location): {
18
+ getFirstPrevTextAsUrlAndRange(editor: T, at: Location): {
19
19
  url: string;
20
20
  at: Range;
21
21
  } | undefined;
22
- isSelectionInLink(editor: Editor): boolean;
23
- insertLink(editor: Editor, url: string, options?: LinkInsertLinkOptions): void;
24
- unwrapLink(editor: Editor, options?: LinkUnwrapLinkOptions): void;
25
- wrapLink(editor: Editor, url: string, options?: LinkWrapLinkOptions): void;
26
- upsertLink(editor: Editor, url: string, options?: LinkUpsertLinkOptions): void;
22
+ isSelectionInLink(editor: T): boolean;
23
+ insertLink(editor: T, url: string, options?: LinkInsertLinkOptions): void;
24
+ unwrapLink(editor: T, options?: LinkUnwrapLinkOptions): void;
25
+ wrapLink(editor: T, url: string, options?: LinkWrapLinkOptions): void;
26
+ upsertLink(editor: T, url: string, options?: LinkUpsertLinkOptions): void;
27
27
  }
package/list/typings.d.ts CHANGED
@@ -12,30 +12,30 @@ export interface ListAboveListAndItem {
12
12
  export interface ListGetAboveListEntriesOptions {
13
13
  at?: Location;
14
14
  }
15
- export interface List extends Withable {
15
+ export interface List<T extends Editor = Editor> extends Withable {
16
16
  /**
17
17
  * An object which keys are `ul`, `ol`, `li` and values are the corresponding element types.
18
18
  */
19
19
  types: ListTypes;
20
20
  isListElement(node: Node): node is QuadratsElement;
21
21
  isListItemElement(node: Node): node is QuadratsElement;
22
- isSelectionInList(editor: Editor, listTypeKey: ListRootTypeKey): boolean;
22
+ isSelectionInList(editor: T, listTypeKey: ListRootTypeKey): boolean;
23
23
  /**
24
24
  * If expanded, get the list wrapping the location.
25
25
  */
26
- getAboveListAndItem(editor: Editor, options?: ListGetAboveListEntriesOptions): ListAboveListAndItem | undefined;
27
- unwrapList(editor: Editor): void;
28
- toggleList(editor: Editor, listTypeKey: ListRootTypeKey, defaultType?: string): void;
26
+ getAboveListAndItem(editor: T, options?: ListGetAboveListEntriesOptions): ListAboveListAndItem | undefined;
27
+ unwrapList(editor: T): void;
28
+ toggleList(editor: T, listTypeKey: ListRootTypeKey, defaultType?: string): void;
29
29
  /**
30
30
  * Increase the depth of the first item in the location if increasable.
31
31
  */
32
- increaseListItemDepth(editor: Editor, entries: ListAboveListAndItem): void;
32
+ increaseListItemDepth(editor: T, entries: ListAboveListAndItem): void;
33
33
  /**
34
34
  * Decrease the depth of the first item in the location if decreasable.
35
35
  */
36
- decreaseListItemDepth(editor: Editor, entries: ListAboveListAndItem): void;
36
+ decreaseListItemDepth(editor: T, entries: ListAboveListAndItem): void;
37
37
  /**
38
38
  * Unwrap the list if at root, or decrease the depth of list item.
39
39
  */
40
- decreaseListItemDepthOrUnwrapIfNeed(editor: Editor, entries: ListAboveListAndItem): void;
40
+ decreaseListItemDepthOrUnwrapIfNeed(editor: T, entries: ListAboveListAndItem): void;
41
41
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quadrats/common",
3
- "version": "0.5.1",
3
+ "version": "0.5.10",
4
4
  "description": "",
5
5
  "author": "Rytass",
6
6
  "homepage": "https://github.com/Quadrats/quadrats#readme",
@@ -18,7 +18,7 @@
18
18
  "url": "https://github.com/Quadrats/quadrats/issues"
19
19
  },
20
20
  "dependencies": {
21
- "@quadrats/core": "^0.5.1",
21
+ "@quadrats/core": "^0.5.9",
22
22
  "@quadrats/locales": "^0.5.0",
23
23
  "@quadrats/utils": "^0.5.0"
24
24
  }
@@ -2,7 +2,7 @@ import { Editor, QuadratsElement, Text, Withable, WithElementType } from '@quadr
2
2
  export interface ReadMoreElement extends QuadratsElement, WithElementType {
3
3
  children: [Text];
4
4
  }
5
- export interface ReadMore extends WithElementType, Withable {
5
+ export interface ReadMore<T extends Editor = Editor> extends WithElementType, Withable {
6
6
  createReadMoreElement(): ReadMoreElement;
7
- insertReadMore(editor: Editor): void;
7
+ insertReadMore(editor: T): void;
8
8
  }
@@ -1 +1 @@
1
- export declare const createStrikethrough: (variant?: string | undefined) => ({ type, variant }?: import("@quadrats/common/toggle-mark").CreateToggleMarkOptions | undefined) => import("@quadrats/common/toggle-mark").ToggleMark;
1
+ export declare const createStrikethrough: (variant?: string | undefined) => ({ type, variant }?: import("@quadrats/common/toggle-mark").CreateToggleMarkOptions | undefined) => import("@quadrats/common/toggle-mark").ToggleMark<import("slate").BaseEditor>;
@@ -1,5 +1,5 @@
1
1
  import { Editor, WithMarkType } from '@quadrats/core';
2
- export interface ToggleMark extends WithMarkType {
3
- isToggleMarkActive(editor: Editor): boolean;
4
- toggleMark(editor: Editor): void;
2
+ export interface ToggleMark<T extends Editor = Editor> extends WithMarkType {
3
+ isToggleMarkActive(editor: T): boolean;
4
+ toggleMark(editor: T): void;
5
5
  }
@@ -1 +1 @@
1
- export declare const createUnderline: (variant?: string | undefined) => ({ type, variant }?: import("@quadrats/common/toggle-mark").CreateToggleMarkOptions | undefined) => import("@quadrats/common/toggle-mark").ToggleMark;
1
+ export declare const createUnderline: (variant?: string | undefined) => ({ type, variant }?: import("@quadrats/common/toggle-mark").CreateToggleMarkOptions | undefined) => import("@quadrats/common/toggle-mark").ToggleMark<import("slate").BaseEditor>;