@forevka/wordcanvas 0.1.0 → 0.3.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.
package/README.md CHANGED
@@ -65,8 +65,9 @@ const editor = new WordCanvas({
65
65
  container: document.getElementById("editor")!,
66
66
  backendUrl: "https://api.example.com",
67
67
  user: { id: "u-42", firstName: "Ada", lastName: "Lovelace" },
68
- // Join an existing session if the share link carried one:
69
- docId: params.get("doc") ?? undefined,
68
+ // Join an existing session if the share link carried one (the editor's own
69
+ // share links use ?collab=<docId>):
70
+ docId: params.get("collab") ?? undefined,
70
71
  });
71
72
 
72
73
  editor.on("shared", ({ url }) => navigator.clipboard.writeText(url));
@@ -105,8 +106,10 @@ input.addEventListener("change", async () => {
105
106
 
106
107
  ## Notes & limitations
107
108
 
108
- - **One instance per page** in this version — the chrome uses id-based CSS and the
109
- app bootstraps once on import. Constructing a second `WordCanvas` throws.
109
+ - **Multiple instances per page are supported** — the chrome is class-scoped under
110
+ a per-instance root and each instance mounts independently, so you can run several
111
+ editors at once. `destroy()` removes an instance's chrome and its floating panels.
112
+ See the [`embed-multi`](../examples/embed-multi) example.
110
113
  - The editor injects its own stylesheet and mounts its full chrome (ribbon, ruler,
111
114
  outline, status bar) inside the container; give it a sized element.
112
115
  - The bundle is large on disk (~20 MB unminified, code-split) because it ships a