@norio-office/rich-text 0.6.0 → 0.7.0

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,21 @@
1
+ export type BlockColorKind = 'text' | 'background' | 'border' | 'fill';
2
+ type __VLS_Props = {
3
+ textColor?: string | null;
4
+ backgroundColor?: string | null;
5
+ color?: string | null;
6
+ kind?: 'border' | 'fill';
7
+ label?: string;
8
+ presetColors?: readonly string[];
9
+ customKind: BlockColorKind | null;
10
+ hoverEnabled: boolean;
11
+ };
12
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
13
+ change: (kind: BlockColorKind, color: string | null) => any;
14
+ reset: () => any;
15
+ custom: (kind: BlockColorKind, anchor: HTMLElement) => any;
16
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
17
+ onChange?: ((kind: BlockColorKind, color: string | null) => any) | undefined;
18
+ onReset?: (() => any) | undefined;
19
+ onCustom?: ((kind: BlockColorKind, anchor: HTMLElement) => any) | undefined;
20
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
21
+ export default _default;
@@ -0,0 +1,13 @@
1
+ type __VLS_Props = {
2
+ color: string;
3
+ defaultColor: string;
4
+ recentColors: string[];
5
+ };
6
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
7
+ change: (color: string) => any;
8
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
9
+ onChange?: ((color: string) => any) | undefined;
10
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
11
+ pickerRef: HTMLInputElement;
12
+ }, HTMLDivElement>;
13
+ export default _default;
@@ -5,11 +5,11 @@ type __VLS_Props = {
5
5
  submitLabel?: string;
6
6
  };
7
7
  declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
8
- close: () => any;
9
8
  submit: (value: string) => any;
9
+ close: () => any;
10
10
  }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
11
- onClose?: (() => any) | undefined;
12
11
  onSubmit?: ((value: string) => any) | undefined;
12
+ onClose?: (() => any) | undefined;
13
13
  }>, {
14
14
  title: string;
15
15
  value: string;
@@ -1,6 +1,9 @@
1
1
  import { NodeViewProps } from '@tiptap/vue-3';
2
2
  declare const _default: import('vue').DefineComponent<NodeViewProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<NodeViewProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
3
3
  alignDropdownRef: HTMLDivElement;
4
+ linkTriggerRef: HTMLButtonElement;
4
5
  inputRef: HTMLInputElement;
6
+ linkPopoverRef: HTMLFormElement;
7
+ linkInputRef: HTMLInputElement;
5
8
  }, any>;
6
9
  export default _default;
@@ -62,8 +62,10 @@ declare const _default: import('vue').DefineComponent<RichTextEditorProps, {
62
62
  "onComment-mention-item-click"?: ((value: RichTextEditorMentionItem) => any) | undefined;
63
63
  "onComment-mention-submit"?: ((value: RichTextEditorMentionItem) => any) | undefined;
64
64
  }>, {
65
- placeholder: string;
66
65
  mode: "edit" | "preview";
66
+ placeholder: string;
67
+ comments: RichTextEditorCommentThread[] | null;
68
+ watermark: RichTextEditorWatermarkOptions | null;
67
69
  mention: boolean;
68
70
  editable: boolean;
69
71
  uploadImage: import('..').RichTextEditorUploadHook | null;
@@ -71,11 +73,12 @@ declare const _default: import('vue').DefineComponent<RichTextEditorProps, {
71
73
  uploadVideo: import('..').RichTextEditorUploadHook | null;
72
74
  modelValue: JSONContent | null;
73
75
  documentName: string;
74
- watermark: RichTextEditorWatermarkOptions | null;
76
+ showToolbar: boolean;
75
77
  showOutline: boolean;
76
- outlinePlacement: "left" | "right";
78
+ outlinePlacement: import('../feature-codes').RichTextEditorOutlinePlacement;
77
79
  messages: import('..').RichTextEditorMessages | null;
78
- comments: RichTextEditorCommentThread[] | null;
80
+ featureCodes: import('..').RichTextEditorCode[] | null;
81
+ enabledFeatureItems: import('..').RichTextEditorFeatureItemKey[] | null;
79
82
  commentUser: RichTextEditorCommentUser | null;
80
83
  showComments: boolean;
81
84
  commentMention: boolean;
@@ -93,26 +96,31 @@ declare const _default: import('vue').DefineComponent<RichTextEditorProps, {
93
96
  fontFamilyMenuRef: HTMLDivElement;
94
97
  fontSizeMenuRef: HTMLDivElement;
95
98
  colorMenuRef: HTMLDivElement;
96
- colorPickerRef: HTMLInputElement;
97
99
  highlightMenuRef: HTMLDivElement;
98
- highlightPickerRef: HTMLInputElement;
99
100
  scriptMenuRef: HTMLDivElement;
100
101
  alignMenuRef: HTMLDivElement;
101
102
  quoteMenuRef: HTMLDivElement;
102
103
  emojiToolbarMenuRef: HTMLDivElement;
103
- exportMenuRef: HTMLDivElement;
104
+ outlineTriggerRef: HTMLButtonElement;
104
105
  pageRef: HTMLDivElement;
105
106
  tableHeadingMenuRef: HTMLDivElement;
106
107
  tableListMenuRef: HTMLDivElement;
107
108
  tableColorMenuRef: HTMLDivElement;
108
109
  tableHighlightMenuRef: HTMLDivElement;
109
110
  tableActionColorMenuRef: HTMLDivElement;
110
- highlightBlockColorMenuRef: HTMLDivElement;
111
- highlightBlockSettingsMenuRef: HTMLDivElement;
111
+ tableThemeMenuRef: HTMLDivElement;
112
112
  countdownBubbleMenuRef: HTMLDivElement;
113
113
  countdownBubbleEditButtonRef: HTMLButtonElement;
114
114
  mentionPanelRef: HTMLDivElement;
115
- blockSideColorPickerRef: HTMLInputElement;
115
+ blockSideMenuRef: HTMLDivElement;
116
+ blockSidePropertiesTriggerRef: HTMLButtonElement;
117
+ blockSideColorTriggerRef: HTMLButtonElement;
118
+ blockSideTableThemeTriggerRef: HTMLButtonElement;
119
+ blockSideSurfaceBorderTriggerRef: HTMLButtonElement;
120
+ blockSideSurfaceFillTriggerRef: HTMLButtonElement;
121
+ blockSideHighlightSettingsTriggerRef: HTMLButtonElement;
122
+ blockSideDividerStyleTriggerRef: HTMLButtonElement;
123
+ blockSideDividerColorTriggerRef: HTMLButtonElement;
116
124
  commentPanelRef: HTMLElement;
117
125
  commentMentionPanelRef: HTMLDivElement;
118
126
  markdownImportInputRef: HTMLInputElement;
@@ -120,5 +128,6 @@ declare const _default: import('vue').DefineComponent<RichTextEditorProps, {
120
128
  imageUploadInputRef: HTMLInputElement;
121
129
  videoUploadInputRef: HTMLInputElement;
122
130
  commentImageInputRef: HTMLInputElement;
131
+ statusbarExportMenuRef: HTMLDivElement;
123
132
  }, HTMLDivElement>;
124
133
  export default _default;
@@ -12,12 +12,12 @@ type __VLS_Props = {
12
12
  };
13
13
  declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
14
14
  select: (pos: number) => any;
15
- toggle: () => any;
16
15
  change: (state: RichTextEditorOutlineState) => any;
16
+ toggle: () => any;
17
17
  }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
18
18
  onSelect?: ((pos: number) => any) | undefined;
19
- onToggle?: (() => any) | undefined;
20
19
  onChange?: ((state: RichTextEditorOutlineState) => any) | undefined;
20
+ onToggle?: (() => any) | undefined;
21
21
  }>, {
22
22
  title: string;
23
23
  open: boolean;
@@ -0,0 +1,25 @@
1
+ import { TableThemeColors } from '../utils/table-theme';
2
+ type __VLS_Props = {
3
+ theme: TableThemeColors | null;
4
+ recentColors: string[];
5
+ };
6
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
7
+ change: (theme: TableThemeColors) => any;
8
+ clear: () => any;
9
+ resize: (height: number) => any;
10
+ close: () => any;
11
+ colorUsed: (color: string) => any;
12
+ reposition: () => any;
13
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
14
+ onChange?: ((theme: TableThemeColors) => any) | undefined;
15
+ onClear?: (() => any) | undefined;
16
+ onResize?: ((height: number) => any) | undefined;
17
+ onClose?: (() => any) | undefined;
18
+ onColorUsed?: ((color: string) => any) | undefined;
19
+ onReposition?: (() => any) | undefined;
20
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
21
+ panelRef: HTMLDivElement;
22
+ surfaceRef: HTMLDivElement;
23
+ paletteRef: HTMLDivElement;
24
+ }, HTMLDivElement>;
25
+ export default _default;
@@ -0,0 +1,28 @@
1
+ import { Editor } from '@tiptap/core';
2
+ export type TextSelectionAction = {
3
+ key: string;
4
+ label: string;
5
+ icon?: string;
6
+ text?: string;
7
+ active?: boolean;
8
+ disabled?: boolean;
9
+ run?: () => void;
10
+ options?: TextSelectionAction[];
11
+ color?: string;
12
+ defaultColor?: string;
13
+ recentColors?: string[];
14
+ setColor?: (color: string) => void;
15
+ divider?: boolean;
16
+ fontFamily?: string;
17
+ };
18
+ type __VLS_Props = {
19
+ editor: Editor;
20
+ actions: TextSelectionAction[];
21
+ enabled: boolean;
22
+ };
23
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
24
+ menuRef: HTMLDivElement;
25
+ panelRef: HTMLDivElement;
26
+ nestedPanelRef: HTMLDivElement;
27
+ }, any>;
28
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import { Editor } from '@tiptap/core';
2
+ export declare function useNodeViewEditable(editor: Editor): Readonly<import('vue').Ref<boolean, boolean>>;
@@ -0,0 +1 @@
1
+ export declare const StyledHorizontalRule: import('@tiptap/core').Node<import('@tiptap/extension-horizontal-rule').HorizontalRuleOptions, any>;
@@ -0,0 +1 @@
1
+ export declare const ThemedTable: import('@tiptap/core').Node<import('@tiptap/extension-table').TableOptions, any>;
@@ -0,0 +1,45 @@
1
+ export declare const RICH_TEXT_EDITOR_FEATURE_CODES: {
2
+ readonly comments: "comments";
3
+ readonly outlineLeft: "outlineLeft";
4
+ readonly outlineRight: "outlineRight";
5
+ readonly watermark: "watermark";
6
+ readonly collaboration: "collaboration";
7
+ readonly mention: "mention";
8
+ };
9
+ export type RichTextEditorFeatureCode = (typeof RICH_TEXT_EDITOR_FEATURE_CODES)[keyof typeof RICH_TEXT_EDITOR_FEATURE_CODES];
10
+ export type RichTextEditorLegacyFeatureItemKey = 'comments' | 'outline' | 'watermark' | 'collaboration' | 'mention';
11
+ export type RichTextEditorFeatureItemKey = RichTextEditorFeatureCode | RichTextEditorLegacyFeatureItemKey;
12
+ export type RichTextEditorOutlinePlacement = 'left' | 'right';
13
+ export declare const RICH_TEXT_EDITOR_EXPORT_CODES: {
14
+ readonly pdf: "pdf";
15
+ readonly html: "html";
16
+ readonly image: "image";
17
+ readonly print: "print";
18
+ };
19
+ export type RichTextEditorExportItemKey = (typeof RICH_TEXT_EDITOR_EXPORT_CODES)[keyof typeof RICH_TEXT_EDITOR_EXPORT_CODES];
20
+ export declare const RICH_TEXT_EDITOR_INSERT_MENU_CODES: {
21
+ readonly image: "image";
22
+ readonly video: "video";
23
+ readonly table: "table";
24
+ readonly localFile: "local-file";
25
+ readonly columns: "columns";
26
+ readonly highlightBlock: "highlight-block";
27
+ readonly date: "date";
28
+ readonly codeBlock: "code-block";
29
+ readonly formula: "formula";
30
+ readonly blockquote: "blockquote";
31
+ readonly emoji: "emoji";
32
+ readonly link: "link";
33
+ readonly divider: "divider";
34
+ readonly countdown: "countdown";
35
+ readonly markdownImport: "markdown-import";
36
+ };
37
+ export type RichTextEditorInsertMenuItemKey = (typeof RICH_TEXT_EDITOR_INSERT_MENU_CODES)[keyof typeof RICH_TEXT_EDITOR_INSERT_MENU_CODES];
38
+ export declare const RICH_TEXT_EDITOR_TOOLBAR_ACTION_CODES: {
39
+ readonly blockquote: "blockquote";
40
+ };
41
+ export type RichTextEditorToolbarActionKey = (typeof RICH_TEXT_EDITOR_TOOLBAR_ACTION_CODES)[keyof typeof RICH_TEXT_EDITOR_TOOLBAR_ACTION_CODES];
42
+ export type RichTextEditorCode = RichTextEditorFeatureItemKey | RichTextEditorExportItemKey | RichTextEditorInsertMenuItemKey | RichTextEditorToolbarActionKey;
43
+ export declare function isRichTextCodeEnabled(code: string, codes?: readonly string[] | null): boolean;
44
+ export declare function isRichTextFeatureCodeEnabled(code: RichTextEditorFeatureItemKey, featureCodes?: readonly RichTextEditorCode[] | null): boolean;
45
+ export declare function resolveRichTextOutlinePlacement(preferredPlacement: RichTextEditorOutlinePlacement, featureCodes?: readonly RichTextEditorCode[] | null): RichTextEditorOutlinePlacement | null;
package/dist/index.d.ts CHANGED
@@ -5,5 +5,7 @@ import { default as RichTextOutline } from './components/RichTextOutline.vue';
5
5
  import { default as ScrollArea } from './components/ScrollArea.vue';
6
6
  export { OfficeColorIcon, OfficeIcon, RichTextEditor, RichTextOutline, ScrollArea };
7
7
  export { colorIconNames, monoIconNames } from './icons';
8
- export type { OfficeColorIconProps, OfficeIconProps, RichTextEditorAlign, RichTextEditorCollaborationAwareness, RichTextEditorCollaborationDocument, RichTextEditorCollaborationOptions, RichTextEditorCollaborationProvider, RichTextEditorCollaborationUser, RichTextEditorCommentCreatePayload, RichTextEditorCommentDeletePayload, RichTextEditorCommentImage, RichTextEditorCommentItem, RichTextEditorCommentMentionItem, RichTextEditorCommentMentionProvider, RichTextEditorCommentMentionProviderPayload, RichTextEditorCommentReplyPayload, RichTextEditorCommentResolvePayload, RichTextEditorCommentSubmitPayload, RichTextEditorCommentThread, RichTextEditorCommentUpdatePayload, RichTextEditorCommentUser, RichTextEditorCollectedFilePayload, RichTextEditorFilePayload, RichTextEditorExportItemKey, RichTextEditorImageExportOptions, RichTextEditorImagePayload, RichTextEditorInstance, RichTextEditorInsertMenuItemKey, RichTextEditorLocalFilePayload, RichTextEditorMessages, RichTextEditorMentionItem, RichTextEditorMentionProvider, RichTextEditorMentionProviderPayload, RichTextEditorMentionType, RichTextEditorOutlineChangeHandler, RichTextEditorOutlineItem, RichTextEditorOutlineState, RichTextEditorProps, RichTextEditorToolbarActionKey, RichTextEditorUploadHook, RichTextEditorUploadErrorHandler, RichTextEditorUploadErrorPayload, RichTextEditorUploadInput, RichTextEditorUploadKind, RichTextEditorUploadResult, RichTextEditorWatermarkOptions, RichTextEditorVideoPayload, } from './types';
8
+ export { isRichTextCodeEnabled, isRichTextFeatureCodeEnabled, RICH_TEXT_EDITOR_EXPORT_CODES, RICH_TEXT_EDITOR_FEATURE_CODES, RICH_TEXT_EDITOR_INSERT_MENU_CODES, RICH_TEXT_EDITOR_TOOLBAR_ACTION_CODES, resolveRichTextOutlinePlacement, } from './feature-codes';
9
+ export type { RichTextEditorCode, RichTextEditorExportItemKey, RichTextEditorFeatureCode, RichTextEditorFeatureItemKey, RichTextEditorInsertMenuItemKey, RichTextEditorToolbarActionKey, } from './feature-codes';
10
+ export type { OfficeColorIconProps, OfficeIconProps, RichTextEditorAlign, RichTextEditorCollaborationAwareness, RichTextEditorCollaborationDocument, RichTextEditorCollaborationOptions, RichTextEditorCollaborationProvider, RichTextEditorCollaborationUser, RichTextEditorCommentCreatePayload, RichTextEditorCommentDeletePayload, RichTextEditorCommentImage, RichTextEditorCommentItem, RichTextEditorCommentMentionItem, RichTextEditorCommentMentionProvider, RichTextEditorCommentMentionProviderPayload, RichTextEditorCommentReplyPayload, RichTextEditorCommentResolvePayload, RichTextEditorCommentSubmitPayload, RichTextEditorCommentThread, RichTextEditorCommentUpdatePayload, RichTextEditorCommentUser, RichTextEditorCollectedFilePayload, RichTextEditorFilePayload, RichTextEditorImageExportOptions, RichTextEditorImagePayload, RichTextEditorInstance, RichTextEditorLocalFilePayload, RichTextEditorMessages, RichTextEditorMentionItem, RichTextEditorMentionProvider, RichTextEditorMentionProviderPayload, RichTextEditorMentionType, RichTextEditorOutlineChangeHandler, RichTextEditorOutlineItem, RichTextEditorOutlineState, RichTextEditorProps, RichTextEditorUploadHook, RichTextEditorUploadErrorHandler, RichTextEditorUploadErrorPayload, RichTextEditorUploadInput, RichTextEditorUploadKind, RichTextEditorUploadResult, RichTextEditorWatermarkOptions, RichTextEditorVideoPayload, } from './types';
9
11
  export default RichTextEditor;