@forevka/wordcanvas 0.3.1 → 0.4.1

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.
@@ -921,7 +921,7 @@ class We {
921
921
  }
922
922
  }
923
923
  export {
924
- Ae as A,
924
+ E as A,
925
925
  $ as B,
926
926
  te as C,
927
927
  oe as D,
@@ -948,25 +948,25 @@ export {
948
948
  $e as c,
949
949
  Fe as d,
950
950
  Oe as e,
951
- De as f,
951
+ ee as f,
952
952
  ke as g,
953
- Me as h,
954
- me as i,
955
- O as j,
956
- se as k,
957
- Z as l,
958
- Re as m,
953
+ Ae as h,
954
+ Ie as i,
955
+ De as j,
956
+ Me as k,
957
+ me as l,
958
+ O as m,
959
959
  I as n,
960
- Pe as o,
961
- H as p,
962
- xe as q,
963
- ve as r,
960
+ Re as o,
961
+ se as p,
962
+ Z as q,
963
+ H as r,
964
964
  de as s,
965
965
  M as t,
966
- pe as u,
967
- Ne as v,
966
+ Pe as u,
967
+ xe as v,
968
968
  K as w,
969
- E as x,
970
- Ie as y,
971
- ee as z
969
+ ve as x,
970
+ pe as y,
971
+ Ne as z
972
972
  };
@@ -1,4 +1,4 @@
1
- class s {
1
+ class r {
2
2
  handle = null;
3
3
  ready;
4
4
  handlers = /* @__PURE__ */ new Map();
@@ -11,12 +11,16 @@ class s {
11
11
  collabId: e.docId ?? e.collabId,
12
12
  user: e.user,
13
13
  onShareLink: e.onShareLink,
14
+ readonly: e.readonly,
15
+ mode: e.mode,
16
+ allowedModes: e.allowedModes,
17
+ knownUsers: e.knownUsers,
14
18
  onReady: (n) => {
15
19
  this.handle = n, t(n);
16
20
  },
17
21
  onEvent: (n) => this.emit(n)
18
22
  };
19
- import("./editorApp-DYckquXo.js").then((n) => n.mountEditorApp(a));
23
+ import("./editorApp-DZ_5LIaR.js").then((n) => n.mountEditorApp(a));
20
24
  });
21
25
  }
22
26
  /** Subscribe to a collaboration event. Returns an unsubscribe function. */
@@ -52,6 +56,52 @@ class s {
52
56
  async share() {
53
57
  return (await this.ready).share();
54
58
  }
59
+ // ---- review layer (track changes + comments) ----------------------------
60
+ /** Current editor mode. Returns null before the editor is ready. */
61
+ getMode() {
62
+ return this.handle?.getMode() ?? null;
63
+ }
64
+ /** Switch mode. Resolves to false if the mode isn't allowed (or not ready). */
65
+ async setMode(e) {
66
+ return (await this.ready).setMode(e);
67
+ }
68
+ /** Snapshot of the review overlay (suggestions + comment threads). */
69
+ async getReview() {
70
+ return (await this.ready).getReview();
71
+ }
72
+ /** The effective @-mentionable roster: the configured base PLUS whoever is
73
+ * live-editing the document right now (auto-merged from presence). */
74
+ async getKnownUsers() {
75
+ return (await this.ready).getKnownUsers();
76
+ }
77
+ /** Replace the configured base roster (live editors are still merged on top). */
78
+ async setKnownUsers(e) {
79
+ (await this.ready).setKnownUsers(e);
80
+ }
81
+ async acceptSuggestion(e) {
82
+ (await this.ready).acceptSuggestion(e);
83
+ }
84
+ async rejectSuggestion(e) {
85
+ (await this.ready).rejectSuggestion(e);
86
+ }
87
+ async acceptAllSuggestions() {
88
+ (await this.ready).acceptAllSuggestions();
89
+ }
90
+ async rejectAllSuggestions() {
91
+ (await this.ready).rejectAllSuggestions();
92
+ }
93
+ /** Add a comment thread anchored to the current selection (a rich-text body;
94
+ * `mentions` are @-tagged users). Resolves to the thread id, or null if
95
+ * there's no selection. */
96
+ async addComment(e, t) {
97
+ return (await this.ready).addComment(e, t);
98
+ }
99
+ async replyToComment(e, t, a) {
100
+ (await this.ready).replyToComment(e, t, a);
101
+ }
102
+ async resolveThread(e, t = !0) {
103
+ (await this.ready).resolveThread(e, t);
104
+ }
55
105
  getDocId() {
56
106
  return this.handle?.getDocId() ?? null;
57
107
  }
@@ -63,5 +113,5 @@ class s {
63
113
  }
64
114
  }
65
115
  export {
66
- s as WordCanvas
116
+ r as WordCanvas
67
117
  };
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@forevka/wordcanvas",
3
- "version": "0.3.1",
3
+ "version": "0.4.1",
4
4
  "type": "module",
5
- "description": "Embeddable canvas-rendered, Word-compatible document editor with live collaboration and DOCX/PDF import & export. Self-contained, zero runtime dependencies.",
5
+ "description": "Open-source embeddable Word-style document editor: canvas-rendered, with live collaboration, track changes & comments, and DOCX/PDF import & export. A lightweight alternative to Syncfusion, OnlyOffice, and DevExpress document editors. Self-contained, zero runtime dependencies.",
6
6
  "license": "MIT",
7
7
  "author": "Bohdan Lushchyk",
8
8
  "homepage": "https://github.com/Forevka/canvas-word#readme",
@@ -17,13 +17,25 @@
17
17
  "keywords": [
18
18
  "word",
19
19
  "editor",
20
+ "word-editor",
21
+ "word-processor",
22
+ "document-editor",
20
23
  "docx",
24
+ "docx-editor",
21
25
  "pdf",
22
26
  "canvas",
23
27
  "wysiwyg",
24
28
  "rich-text",
25
29
  "document",
26
- "collaboration"
30
+ "collaboration",
31
+ "track-changes",
32
+ "comments",
33
+ "suggestions",
34
+ "embeddable",
35
+ "syncfusion-alternative",
36
+ "onlyoffice-alternative",
37
+ "devexpress-alternative",
38
+ "contenteditable-alternative"
27
39
  ],
28
40
  "module": "./dist-lib/wordcanvas.js",
29
41
  "types": "./types/wordcanvas.d.ts",