@norio-office/rich-text 0.8.0 → 0.8.3

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 (50) hide show
  1. package/LICENSE +5 -19
  2. package/README.md +102 -2310
  3. package/dist/ai/index.js +58 -57
  4. package/dist/collaboration-presence.d.ts +11 -0
  5. package/dist/components/BlockColorPanel.vue.d.ts +2 -2
  6. package/dist/components/CollaborationPresence.vue.d.ts +6 -0
  7. package/dist/components/RichTextEditor.vue.d.ts +10 -2
  8. package/dist/components/TableThemePanel.vue.d.ts +4 -4
  9. package/dist/composables/useDocumentName.d.ts +15 -0
  10. package/dist/index.d.ts +2 -1
  11. package/dist/index.js +7278 -7011
  12. package/dist/index.umd.cjs +104 -54
  13. package/dist/style.css +1 -1
  14. package/dist/types.d.ts +12 -0
  15. package/docs/file-header.md +50 -0
  16. package/docs/usage.md +5 -0
  17. package/examples/ai/browser/App.vue +106 -0
  18. package/examples/ai/browser/README.md +30 -0
  19. package/examples/ai/browser/ai-proxy.d.mts +3 -0
  20. package/examples/ai/browser/ai-proxy.mjs +89 -0
  21. package/examples/ai/browser/vite.config.ts +3 -2
  22. package/package.json +5 -4
  23. package/skills/README.md +23 -0
  24. package/skills/assets/editor-screenshot.png +0 -0
  25. package/skills/norio-rich-text/SKILL.md +36 -0
  26. package/skills/norio-rich-text/examples/basic-document.json +7 -0
  27. package/skills/norio-rich-text/examples/custom-blocks-document.json +14 -0
  28. package/skills/norio-rich-text/examples/embedded-file-document.json +6 -0
  29. package/skills/norio-rich-text/examples/local-edit.json +10 -0
  30. package/skills/norio-rich-text/examples/media-reference-document.json +8 -0
  31. package/skills/norio-rich-text/examples/resource-map.json +7 -0
  32. package/skills/norio-rich-text/examples/sample-attachment.txt +1 -0
  33. package/skills/norio-rich-text/examples/streamed-document.ndjson +9 -0
  34. package/skills/norio-rich-text/examples/streamed-selection-edit.ndjson +3 -0
  35. package/skills/norio-rich-text/examples/styled-document.json +10 -0
  36. package/skills/norio-rich-text/examples/table-cell-edit.json +10 -0
  37. package/skills/norio-rich-text/references/document-format.md +17 -0
  38. package/skills/norio-rich-text/references/integration.md +46 -0
  39. package/skills/norio-rich-text/references/nordox-format.md +7 -0
  40. package/skills/norio-rich-text/references/operations.md +13 -0
  41. package/skills/norio-rich-text/references/streaming.md +15 -0
  42. package/skills/norio-rich-text/runtime-manifest.json +39 -0
  43. package/skills/norio-rich-text/schemas/document.schema.json +1580 -0
  44. package/skills/norio-rich-text/schemas/nordox-manifest.schema.json +105 -0
  45. package/skills/norio-rich-text/schemas/patch.schema.json +3164 -0
  46. package/skills/norio-rich-text/schemas/stream-event.schema.json +3409 -0
  47. package/skills/norio-rich-text/schemas/tool-inputs.schema.json +6028 -0
  48. package/skills/norio-rich-text/scripts/check-package.mjs +57 -0
  49. package/skills/norio-rich-text/scripts/generate-schemas.mjs +35 -0
  50. package/skills/norio-rich-text/scripts/rich-text.mjs +152 -0
@@ -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';