@w100n/documents 0.4.0 → 0.11.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 (61) hide show
  1. package/dist/SheetView-3XTEV2VT.css +319 -0
  2. package/dist/SheetView-3XTEV2VT.css.map +1 -0
  3. package/dist/SheetView-TXHS5WJC.js +928 -0
  4. package/dist/SheetView-TXHS5WJC.js.map +1 -0
  5. package/dist/TextEditor-4YETNX4T.js +983 -0
  6. package/dist/TextEditor-4YETNX4T.js.map +1 -0
  7. package/dist/caveat-cyrillic-XVO43JCM.woff2 +0 -0
  8. package/dist/caveat-latin-IUBKKMHQ.woff2 +0 -0
  9. package/dist/caveat-latin-ext-5S7R5SZN.woff2 +0 -0
  10. package/dist/chunk-EM4U6OC5.js +3447 -0
  11. package/dist/chunk-EM4U6OC5.js.map +1 -0
  12. package/dist/chunk-FPGPEIW5.js +196 -0
  13. package/dist/chunk-FPGPEIW5.js.map +1 -0
  14. package/dist/chunk-ISOOUYLI.js +150 -0
  15. package/dist/chunk-ISOOUYLI.js.map +1 -0
  16. package/dist/{chunk-KEV4R7W5.js → chunk-L765DZPO.js} +9 -1
  17. package/dist/chunk-L765DZPO.js.map +1 -0
  18. package/dist/chunk-QDH7EZAF.js +27 -0
  19. package/dist/chunk-QDH7EZAF.js.map +1 -0
  20. package/dist/chunk-TDP6OJET.js +31 -0
  21. package/dist/chunk-TDP6OJET.js.map +1 -0
  22. package/dist/chunk-TNSN4ZQ5.js +2909 -0
  23. package/dist/chunk-TNSN4ZQ5.js.map +1 -0
  24. package/dist/collab.cjs +6312 -0
  25. package/dist/collab.cjs.map +1 -0
  26. package/dist/collab.d.cts +39 -0
  27. package/dist/collab.d.ts +39 -0
  28. package/dist/collab.js +30 -0
  29. package/dist/collab.js.map +1 -0
  30. package/dist/grid-EI5JNZAA.js +88 -0
  31. package/dist/grid-EI5JNZAA.js.map +1 -0
  32. package/dist/index.cjs +12191 -486
  33. package/dist/index.cjs.map +1 -1
  34. package/dist/index.css +3632 -728
  35. package/dist/index.css.map +1 -1
  36. package/dist/index.d.cts +144 -11
  37. package/dist/index.d.ts +144 -11
  38. package/dist/index.js +3389 -439
  39. package/dist/index.js.map +1 -1
  40. package/dist/kinds.cjs +71 -0
  41. package/dist/kinds.cjs.map +1 -0
  42. package/dist/kinds.d.cts +11 -0
  43. package/dist/kinds.d.ts +11 -0
  44. package/dist/kinds.js +14 -0
  45. package/dist/kinds.js.map +1 -0
  46. package/dist/memory.cjs +59 -7
  47. package/dist/memory.cjs.map +1 -1
  48. package/dist/memory.d.cts +7 -2
  49. package/dist/memory.d.ts +7 -2
  50. package/dist/memory.js +57 -8
  51. package/dist/memory.js.map +1 -1
  52. package/dist/pdfWrite-EM6GJDBF.js +76 -0
  53. package/dist/pdfWrite-EM6GJDBF.js.map +1 -0
  54. package/dist/types-B5oF25dn.d.cts +165 -0
  55. package/dist/types-B5oF25dn.d.ts +165 -0
  56. package/dist/write-DaVtTJCS.d.cts +6 -0
  57. package/dist/write-DaVtTJCS.d.ts +6 -0
  58. package/package.json +50 -3
  59. package/dist/chunk-KEV4R7W5.js.map +0 -1
  60. package/dist/types-DshXPnWA.d.cts +0 -62
  61. package/dist/types-DshXPnWA.d.ts +0 -62
package/dist/index.d.ts CHANGED
@@ -1,25 +1,158 @@
1
1
  import * as react from 'react';
2
- import { ReactNode } from 'react';
3
- import { D as DocumentsHost, L as Language, P as Place, a as DocumentFile, b as DocumentKind } from './types-DshXPnWA.js';
4
- export { c as DocumentSummary, d as DocumentVersion, F as Fetch, e as Person, R as Rights, S as Space } from './types-DshXPnWA.js';
2
+ import { ReactNode, RefObject } from 'react';
3
+ import { L as Language, D as DocumentsHost, P as Place, a as DocumentFile, G as GuestHost, R as Rights } from './types-B5oF25dn.js';
4
+ export { C as Comment, b as DocumentKind, c as DocumentSummary, d as DocumentVersion, F as Fetch, e as GuestFile, f as GuestLink, g as LinkEntry, h as Person, S as Signature, i as SignatureMethod, j as Space } from './types-B5oF25dn.js';
5
+ import { JSONContent } from '@tiptap/core';
6
+ import { I as Img } from './write-DaVtTJCS.js';
7
+ export { kindOf, kinds, matches, readable } from './kinds.js';
5
8
 
9
+ type DocxModel = {
10
+ doc: JSONContent;
11
+ styles: {
12
+ name: string;
13
+ id: string;
14
+ heading: number | null;
15
+ }[];
16
+ page: {
17
+ width: number;
18
+ height: number;
19
+ margins: [number, number, number, number];
20
+ };
21
+ };
22
+ declare function readDocx(bytes: ArrayBuffer): Promise<DocxModel>;
23
+ declare function writeDocx(original: ArrayBuffer, doc: JSONContent, load?: (src: string) => Promise<Img>): Promise<ArrayBuffer>;
24
+
25
+ declare function DocumentOverlay({ source, name, mimeType, info, download, actions, onClose, onOpen, language, theme, worker, host, documentId }: {
26
+ source: ArrayBuffer | Blob | string;
27
+ name: string;
28
+ mimeType?: string;
29
+ info?: string;
30
+ download?: string;
31
+ actions?: ReactNode;
32
+ onClose: () => void;
33
+ onOpen?: () => void;
34
+ language?: Language;
35
+ theme?: 'light' | 'dark';
36
+ worker?: () => Worker;
37
+ host?: DocumentsHost;
38
+ documentId?: string;
39
+ }): react.ReactPortal;
40
+
41
+ type Slot = ReactNode | ((leave: (then: () => void) => void) => ReactNode);
6
42
  declare function DocumentsWorkspace({ host, language, theme, place, onPlace, start, end, aside, actions }: {
7
43
  host: DocumentsHost;
8
44
  language?: Language;
9
45
  theme?: 'light' | 'dark';
10
46
  place?: Place;
11
47
  onPlace?: (place: Place) => void;
12
- start?: ReactNode;
13
- end?: ReactNode;
48
+ start?: Slot;
49
+ end?: Slot;
14
50
  aside?: (doc: DocumentFile) => ReactNode;
15
51
  actions?: (doc: DocumentFile) => ReactNode;
16
52
  }): react.JSX.Element;
17
53
 
18
- declare const kinds: DocumentKind[];
19
- declare function kindOf(name: string, mimeType?: string | null): DocumentKind | null;
20
- declare function matches(doc: {
54
+ type GuestRefusal = 'missing' | 'ended' | 'password' | 'wrong' | 'name' | 'busy';
55
+ declare class GuestRefused extends Error {
56
+ readonly reason: GuestRefusal;
57
+ readonly file: string;
58
+ readonly sharedBy: string;
59
+ constructor(reason: GuestRefusal, file?: string, sharedBy?: string);
60
+ }
61
+ declare function GuestDocument({ host, language, theme, brand }: {
62
+ host: GuestHost;
63
+ language?: Language;
64
+ theme?: 'light' | 'dark';
65
+ brand?: ReactNode;
66
+ }): react.JSX.Element;
67
+
68
+ type Attr = {
69
+ value: string;
70
+ at: [number, number] | null;
71
+ };
72
+ type Text = {
73
+ text: true;
74
+ start: number;
75
+ end: number;
76
+ };
77
+ type El = {
78
+ text?: undefined;
79
+ tag: string;
80
+ attrs: Map<string, Attr>;
81
+ start: number;
82
+ open: number;
83
+ close: number;
84
+ end: number;
85
+ children: (El | Text)[];
86
+ parent: El | null;
87
+ };
88
+
89
+ type DeckKind = 'reveal' | 'marked' | 'sections' | 'page';
90
+ type Block = {
91
+ id: number;
92
+ html: string;
93
+ };
94
+ type Slide = {
95
+ key: string;
96
+ from: number;
97
+ stack: number | null;
98
+ title: string;
99
+ head: number | null;
100
+ notes: string;
101
+ blocks: Block[];
102
+ };
103
+ type Deck = {
104
+ kind: DeckKind;
105
+ width: number;
106
+ height: number;
107
+ center: boolean;
108
+ slides: Slide[];
109
+ };
110
+ type Spot = {
111
+ el: El;
112
+ stack: number | null;
113
+ notes: El | null;
114
+ attr: Attr | null;
115
+ blocks: El[];
116
+ };
117
+ type Shape = {
118
+ kind: DeckKind;
119
+ width: number;
120
+ height: number;
121
+ center: boolean;
122
+ root: El;
123
+ box: El;
124
+ units: El[];
125
+ stacks: El[];
126
+ spots: Spot[];
127
+ scripts: El[];
128
+ refresh: El[];
129
+ head: number;
130
+ body: El | null;
131
+ };
132
+ declare function readDeck(html: string, known?: Shape): Deck;
133
+ declare function writeDeck(original: string, deck: Deck, known?: Shape): string;
134
+
135
+ type Guard = RefObject<(() => Promise<boolean>) | null>;
136
+
137
+ type Heading = {
138
+ id: string;
139
+ level: number;
140
+ text: string;
141
+ go?: () => void;
142
+ };
143
+
144
+ declare function SlidesView({ html, name, rights, language, theme, baseUrl, scripts, onChange, onSaveRequest, onOutline, guard }: {
145
+ html: string;
21
146
  name: string;
22
- kind: DocumentKind;
23
- }, query: string, kind: DocumentKind | 'all'): boolean;
147
+ rights: Rights;
148
+ language?: Language;
149
+ theme?: 'light' | 'dark';
150
+ baseUrl?: string;
151
+ scripts?: boolean;
152
+ onChange?: (dirty: boolean) => void;
153
+ onSaveRequest?: (bytes: ArrayBuffer, note: string) => Promise<unknown>;
154
+ onOutline?: (list: Heading[]) => void;
155
+ guard?: Guard;
156
+ }): react.JSX.Element;
24
157
 
25
- export { DocumentFile, DocumentKind, DocumentsHost, DocumentsWorkspace, Language, Place, kindOf, kinds, matches };
158
+ export { type Deck, type DeckKind, DocumentFile, DocumentOverlay, DocumentsHost, DocumentsWorkspace, type DocxModel, GuestDocument, GuestHost, type GuestRefusal, GuestRefused, Language, Place, Rights, type Slide, SlidesView, readDeck, readDocx, writeDeck, writeDocx };