@norio-office/rich-text 0.7.1 → 0.8.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.
Files changed (60) hide show
  1. package/README.md +895 -824
  2. package/dist/ai/bridge.d.ts +335 -0
  3. package/dist/ai/consume-stream.d.ts +8 -0
  4. package/dist/ai/executor.d.ts +19 -0
  5. package/dist/ai/index.d.ts +8 -0
  6. package/dist/ai/index.js +4106 -0
  7. package/dist/ai/tools.d.ts +158 -0
  8. package/dist/ai-protocol/index.d.ts +12 -0
  9. package/dist/ai-protocol/index.js +2372 -0
  10. package/dist/ai-protocol/json-schema.d.ts +5 -0
  11. package/dist/ai-protocol/patch.d.ts +77 -0
  12. package/dist/ai-protocol/references.d.ts +11 -0
  13. package/dist/ai-protocol/stream.d.ts +94 -0
  14. package/dist/ai-protocol/tools.d.ts +8 -0
  15. package/dist/ai-protocol/validation.d.ts +20 -0
  16. package/dist/components/RichTextEditor.vue.d.ts +11 -4
  17. package/dist/document/ai-identity.d.ts +4 -0
  18. package/dist/document/nodes/columns-block.d.ts +2 -0
  19. package/dist/document/nodes/countdown-block.d.ts +2 -0
  20. package/dist/document/nodes/formula-block.d.ts +2 -0
  21. package/dist/document/nodes/highlight-block.d.ts +2 -0
  22. package/dist/document/nodes/image-block.d.ts +8 -0
  23. package/dist/document/nodes/link-block.d.ts +2 -0
  24. package/dist/document/nodes/local-file-block.d.ts +2 -0
  25. package/dist/document/nodes/mention.d.ts +2 -0
  26. package/dist/document/nodes/office-code-block.d.ts +1 -0
  27. package/dist/document/nodes/table-cells.d.ts +2 -0
  28. package/dist/document/nodes/themed-table.d.ts +1 -0
  29. package/dist/document/nodes/video-block.d.ts +8 -0
  30. package/dist/document/schema.d.ts +17 -0
  31. package/dist/extensions/ai-identity.d.ts +1 -0
  32. package/dist/extensions/columns-block.d.ts +1 -2
  33. package/dist/extensions/countdown-block.d.ts +1 -2
  34. package/dist/extensions/formula-block.d.ts +1 -2
  35. package/dist/extensions/highlight-block.d.ts +1 -2
  36. package/dist/extensions/image-block.d.ts +4 -8
  37. package/dist/extensions/link-block.d.ts +1 -2
  38. package/dist/extensions/local-file-block.d.ts +1 -2
  39. package/dist/extensions/mention.d.ts +1 -2
  40. package/dist/extensions/video-block.d.ts +4 -8
  41. package/dist/{html2canvas-4hiP1s1t.js → html2canvas-BnDzIoab.js} +112 -126
  42. package/dist/index.js +8343 -7407
  43. package/dist/index.umd.cjs +2196 -1995
  44. package/dist/nordox/index.d.ts +95 -0
  45. package/dist/nordox/index.js +2094 -0
  46. package/dist/{chunk-C_CI6nMA.js → rolldown-runtime-VHNaYcLd.js} +3 -3
  47. package/dist/style.css +1 -1
  48. package/dist/types.d.ts +9 -1
  49. package/docs/ai/README.md +108 -0
  50. package/docs/ai/acceptance-report.md +88 -0
  51. package/docs/ai/capability-matrix.md +43 -0
  52. package/docs/ai/compatibility.md +9 -0
  53. package/docs/icons.md +21 -0
  54. package/examples/ai/browser/App.vue +151 -0
  55. package/examples/ai/browser/index.html +12 -0
  56. package/examples/ai/browser/main.ts +5 -0
  57. package/examples/ai/browser/tsconfig.json +7 -0
  58. package/examples/ai/browser/vite.config.ts +14 -0
  59. package/examples/ai/node.mjs +28 -0
  60. package/package.json +15 -1
@@ -0,0 +1,95 @@
1
+ import { JSONContent } from '@tiptap/core';
2
+ export declare const NORDOX_FORMAT_VERSION = 1;
3
+ export declare function getNordoxManifestJsonSchema(): Record<string, unknown>;
4
+ export type RichTextAssetPackaging = {
5
+ images?: 'embed' | 'reference';
6
+ videos?: 'embed' | 'reference';
7
+ files?: 'embed' | 'reference';
8
+ };
9
+ export type NordoxResourceKind = 'image' | 'video' | 'file';
10
+ export type NordoxResource = {
11
+ id: string;
12
+ kind: NordoxResourceKind;
13
+ storage: 'embedded' | 'external';
14
+ path?: string;
15
+ source?: string;
16
+ mimeType?: string;
17
+ name?: string;
18
+ byteLength?: number;
19
+ };
20
+ export type NordoxManifest = {
21
+ format: 'nordox';
22
+ formatVersion: 1;
23
+ schemaVersion: string;
24
+ title: string;
25
+ assetPackaging: Required<RichTextAssetPackaging>;
26
+ resources: NordoxResource[];
27
+ };
28
+ export type NordoxResourceRef = {
29
+ id: string;
30
+ kind: NordoxResourceKind;
31
+ source: string;
32
+ mimeType?: string;
33
+ name?: string;
34
+ };
35
+ export type NordoxResourceResolver = {
36
+ readBytes(ref: NordoxResourceRef, options: {
37
+ signal?: AbortSignal;
38
+ maxBytes: number;
39
+ }): Promise<{
40
+ bytes: Uint8Array;
41
+ mimeType?: string;
42
+ name?: string;
43
+ }>;
44
+ resolveReference?(ref: NordoxResourceRef): Promise<string> | string;
45
+ };
46
+ export type NordoxLimits = {
47
+ maxArchiveBytes: number;
48
+ maxEntries: number;
49
+ maxResourceBytes: number;
50
+ maxUncompressedBytes: number;
51
+ maxCompressionRatio: number;
52
+ };
53
+ export declare const DEFAULT_NORDOX_LIMITS: NordoxLimits;
54
+ export type NordoxErrorCode = 'INVALID_NORDOX_PACKAGE' | 'NORDOX_VERSION_UNSUPPORTED' | 'NORDOX_RESOURCE_MISSING' | 'NORDOX_LIMIT_EXCEEDED' | 'ASSET_REFERENCE_NOT_PERSISTABLE' | 'ASSET_EMBED_FAILED' | 'INVALID_DOCUMENT' | 'CANCELLED';
55
+ export declare class NordoxError extends Error {
56
+ readonly code: NordoxErrorCode;
57
+ constructor(code: NordoxErrorCode, message: string);
58
+ }
59
+ export type PackNordoxOptions = {
60
+ title?: string;
61
+ assetPackaging?: RichTextAssetPackaging;
62
+ resourceResolver?: NordoxResourceResolver;
63
+ existingResources?: Map<string, {
64
+ resource: NordoxResource;
65
+ bytes?: Uint8Array;
66
+ displayUrl?: string;
67
+ }>;
68
+ limits?: Partial<NordoxLimits>;
69
+ signal?: AbortSignal;
70
+ onProgress?: (progress: {
71
+ completed: number;
72
+ total: number;
73
+ phase: 'prepare' | 'zip';
74
+ }) => void;
75
+ };
76
+ export type UnpackNordoxOptions = {
77
+ limits?: Partial<NordoxLimits>;
78
+ signal?: AbortSignal;
79
+ onProgress?: (progress: {
80
+ completed: number;
81
+ total: number;
82
+ phase: 'scan' | 'complete';
83
+ }) => void;
84
+ };
85
+ export type UnpackedNordox = {
86
+ manifest: NordoxManifest;
87
+ document: JSONContent;
88
+ resources: Map<string, {
89
+ resource: NordoxResource;
90
+ bytes?: Uint8Array;
91
+ displayUrl?: string;
92
+ }>;
93
+ };
94
+ export declare function packNordox(documentSnapshot: unknown, options?: PackNordoxOptions): Promise<Uint8Array>;
95
+ export declare function unpackNordox(bytes: Uint8Array | ArrayBuffer, options?: UnpackNordoxOptions): Promise<UnpackedNordox>;