@norio-office/rich-text 0.8.2 → 0.8.5

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,11 @@
1
+ /** Host-owned presentation data. enabled explicitly declares collaboration mode. */
2
+ export type CollaborationPresenceMember = {
3
+ userId: string;
4
+ name?: string;
5
+ avatar?: string;
6
+ };
7
+ export type CollaborationPresence = {
8
+ enabled: boolean;
9
+ status: 'connected' | 'offline' | 'connecting';
10
+ members: readonly CollaborationPresenceMember[];
11
+ };
@@ -10,12 +10,12 @@ type __VLS_Props = {
10
10
  hoverEnabled: boolean;
11
11
  };
12
12
  declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
13
- change: (kind: BlockColorKind, color: string | null) => any;
14
13
  reset: () => any;
14
+ change: (kind: BlockColorKind, color: string | null) => any;
15
15
  custom: (kind: BlockColorKind, anchor: HTMLElement) => any;
16
16
  }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
17
- onChange?: ((kind: BlockColorKind, color: string | null) => any) | undefined;
18
17
  onReset?: (() => any) | undefined;
18
+ onChange?: ((kind: BlockColorKind, color: string | null) => any) | undefined;
19
19
  onCustom?: ((kind: BlockColorKind, anchor: HTMLElement) => any) | undefined;
20
20
  }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
21
21
  export default _default;
@@ -0,0 +1,6 @@
1
+ import { CollaborationPresence } from '../collaboration-presence';
2
+ type __VLS_Props = {
3
+ presence?: CollaborationPresence | null;
4
+ };
5
+ 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, {}, any>;
6
+ export default _default;
@@ -1,7 +1,9 @@
1
1
  import { JSONContent } from '@tiptap/core';
2
- import { RichTextEditorFilePayload, RichTextEditorCollectedFilePayload, RichTextEditorCommentCreatePayload, RichTextEditorCommentDeletePayload, RichTextEditorCommentMentionProviderPayload, RichTextEditorCommentReplyPayload, RichTextEditorCommentResolvePayload, RichTextEditorCommentSubmitPayload, RichTextEditorCommentThread, RichTextEditorCommentUpdatePayload, RichTextEditorCommentUser, RichTextEditorImageExportOptions, RichTextEditorImagePayload, RichTextEditorLocalFilePayload, RichTextEditorMentionItem, RichTextEditorOutlineChangeHandler, RichTextEditorOutlineItem, RichTextEditorOutlineState, RichTextEditorProps, RichTextEditorUploadErrorPayload, RichTextEditorWatermarkOptions, RichTextEditorVideoPayload } from '../types';
2
+ import { RichTextEditorFilePayload, RichTextEditorFileNameChangePayload, RichTextEditorCollectedFilePayload, RichTextEditorCommentCreatePayload, RichTextEditorCommentDeletePayload, RichTextEditorCommentMentionProviderPayload, RichTextEditorCommentReplyPayload, RichTextEditorCommentResolvePayload, RichTextEditorCommentSubmitPayload, RichTextEditorCommentThread, RichTextEditorCommentUpdatePayload, RichTextEditorCommentUser, RichTextEditorImageExportOptions, RichTextEditorImagePayload, RichTextEditorLocalFilePayload, RichTextEditorMentionItem, RichTextEditorOutlineChangeHandler, RichTextEditorOutlineItem, RichTextEditorOutlineState, RichTextEditorProps, RichTextEditorUploadErrorPayload, RichTextEditorWatermarkOptions, RichTextEditorVideoPayload } from '../types';
3
3
  import { NordoxResourceResolver, PackNordoxOptions, UnpackedNordox } from '../nordox';
4
4
  declare const _default: import('vue').DefineComponent<RichTextEditorProps, {
5
+ getFileName: () => string;
6
+ setFileName: (fileName: string) => void;
5
7
  exportPdf: () => Promise<Blob | null>;
6
8
  exportImage: (options?: RichTextEditorImageExportOptions) => Promise<Blob | null>;
7
9
  exportHtml: () => string | null;
@@ -30,6 +32,8 @@ declare const _default: import('vue').DefineComponent<RichTextEditorProps, {
30
32
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
31
33
  change: (value: JSONContent) => any;
32
34
  "update:modelValue": (value: JSONContent) => any;
35
+ "update:documentName": (value: string) => any;
36
+ "file-name-change": (value: RichTextEditorFileNameChangePayload) => any;
33
37
  "local-file-upload": (value: RichTextEditorLocalFilePayload) => any;
34
38
  "local-file-click": (value: RichTextEditorLocalFilePayload) => any;
35
39
  "local-file-download": (value: RichTextEditorLocalFilePayload) => any;
@@ -50,6 +54,8 @@ declare const _default: import('vue').DefineComponent<RichTextEditorProps, {
50
54
  }, string, import('vue').PublicProps, Readonly<RichTextEditorProps> & Readonly<{
51
55
  onChange?: ((value: JSONContent) => any) | undefined;
52
56
  "onUpdate:modelValue"?: ((value: JSONContent) => any) | undefined;
57
+ "onUpdate:documentName"?: ((value: string) => any) | undefined;
58
+ "onFile-name-change"?: ((value: RichTextEditorFileNameChangePayload) => any) | undefined;
53
59
  "onLocal-file-upload"?: ((value: RichTextEditorLocalFilePayload) => any) | undefined;
54
60
  "onLocal-file-click"?: ((value: RichTextEditorLocalFilePayload) => any) | undefined;
55
61
  "onLocal-file-download"?: ((value: RichTextEditorLocalFilePayload) => any) | undefined;
@@ -68,8 +74,8 @@ declare const _default: import('vue').DefineComponent<RichTextEditorProps, {
68
74
  "onComment-mention-item-click"?: ((value: RichTextEditorMentionItem) => any) | undefined;
69
75
  "onComment-mention-submit"?: ((value: RichTextEditorMentionItem) => any) | undefined;
70
76
  }>, {
71
- mode: "edit" | "preview";
72
77
  placeholder: string;
78
+ mode: "edit" | "preview";
73
79
  mention: boolean;
74
80
  uploadImage: import('..').RichTextEditorUploadHook | null;
75
81
  onUploadError: import('..').RichTextEditorUploadErrorHandler | null;
@@ -79,6 +85,7 @@ declare const _default: import('vue').DefineComponent<RichTextEditorProps, {
79
85
  watermark: RichTextEditorWatermarkOptions | null;
80
86
  modelValue: JSONContent | null;
81
87
  documentName: string;
88
+ showFileHeader: boolean;
82
89
  showToolbar: boolean;
83
90
  showAiTargetButton: boolean;
84
91
  showOutline: boolean;
@@ -95,6 +102,7 @@ declare const _default: import('vue').DefineComponent<RichTextEditorProps, {
95
102
  onCommentMentionSearch: import('..').RichTextEditorCommentMentionProvider | null;
96
103
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
97
104
  rootRef: HTMLDivElement;
105
+ fileNameInput: HTMLInputElement;
98
106
  insertMenuRef: HTMLDivElement;
99
107
  insertMenuPanelRef: HTMLDivElement;
100
108
  countdownDateTriggerRef: HTMLButtonElement;
@@ -4,17 +4,17 @@ type __VLS_Props = {
4
4
  recentColors: string[];
5
5
  };
6
6
  declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
7
- change: (theme: TableThemeColors) => any;
8
7
  clear: () => any;
9
- resize: (height: number) => any;
8
+ change: (theme: TableThemeColors) => any;
10
9
  close: () => any;
10
+ resize: (height: number) => any;
11
11
  colorUsed: (color: string) => any;
12
12
  reposition: () => any;
13
13
  }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
14
- onChange?: ((theme: TableThemeColors) => any) | undefined;
15
14
  onClear?: (() => any) | undefined;
16
- onResize?: ((height: number) => any) | undefined;
15
+ onChange?: ((theme: TableThemeColors) => any) | undefined;
17
16
  onClose?: (() => any) | undefined;
17
+ onResize?: ((height: number) => any) | undefined;
18
18
  onColorUsed?: ((color: string) => any) | undefined;
19
19
  onReposition?: (() => any) | undefined;
20
20
  }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
@@ -0,0 +1,15 @@
1
+ import { RichTextEditorFileNameChangePayload, RichTextEditorProps } from '../types';
2
+ export declare function normalizeDocumentName(value: string): string;
3
+ /** Name metadata is deliberately separate from the body and its undo history. */
4
+ export declare function useDocumentName(props: Readonly<RichTextEditorProps>, notify: (event: RichTextEditorFileNameChangePayload) => void, update: (name: string) => void): {
5
+ fileName: import('vue').Ref<string, string>;
6
+ editing: import('vue').Ref<boolean, boolean>;
7
+ draft: import('vue').Ref<string, string>;
8
+ error: import('vue').Ref<string, string>;
9
+ input: import('vue').Ref<HTMLInputElement | null, HTMLInputElement | null>;
10
+ start: () => void;
11
+ commit: () => void;
12
+ cancel: () => void;
13
+ keydown: (event: KeyboardEvent) => void;
14
+ setFileName: (value: string) => void;
15
+ };
package/dist/index.d.ts CHANGED
@@ -7,5 +7,6 @@ export { OfficeColorIcon, OfficeIcon, RichTextEditor, RichTextOutline, ScrollAre
7
7
  export { colorIconNames, monoIconNames } from './icons';
8
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
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';
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, RichTextEditorFileNameChangePayload, RichTextEditorImageExportOptions, RichTextEditorImagePayload, RichTextEditorInstance, RichTextEditorLocalFilePayload, RichTextEditorMessages, RichTextEditorMentionItem, RichTextEditorMentionProvider, RichTextEditorMentionProviderPayload, RichTextEditorMentionType, RichTextEditorOutlineChangeHandler, RichTextEditorOutlineItem, RichTextEditorOutlineState, RichTextEditorProps, RichTextEditorUploadHook, RichTextEditorUploadErrorHandler, RichTextEditorUploadErrorPayload, RichTextEditorUploadInput, RichTextEditorUploadKind, RichTextEditorUploadResult, RichTextEditorWatermarkOptions, RichTextEditorVideoPayload, } from './types';
11
11
  export default RichTextEditor;
12
+ export type { CollaborationPresence, CollaborationPresenceMember } from './collaboration-presence';