y-mxgraph 0.1.3 → 0.1.4
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 +9 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -29,8 +29,8 @@ import { Binding, LOCAL_ORIGIN } from 'y-mxgraph';
|
|
|
29
29
|
const doc = new Y.Doc();
|
|
30
30
|
|
|
31
31
|
App.main((app) => {
|
|
32
|
-
//
|
|
33
|
-
//
|
|
32
|
+
// Ensure consistent initial files across clients. draw.io generates random diagram ids by default,
|
|
33
|
+
// which can cause sync issues if clients start from different states. Use generateFileTemplate to create a unified template.
|
|
34
34
|
if (!app.currentFile.data) {
|
|
35
35
|
app.currentFile.data = Binding.generateFileTemplate('diagram-0');
|
|
36
36
|
}
|
|
@@ -62,21 +62,22 @@ pnpm --filter y-mxgraph build
|
|
|
62
62
|
|
|
63
63
|
# Test
|
|
64
64
|
pnpm --filter y-mxgraph test
|
|
65
|
+
```
|
|
65
66
|
|
|
66
|
-
|
|
67
|
+
## Demo
|
|
67
68
|
|
|
68
69
|
```bash
|
|
69
|
-
#
|
|
70
|
+
# Single-page mode (draw.io loaded directly in the current page)
|
|
70
71
|
pnpm --filter @y-mxgraph/demo dev
|
|
71
72
|
|
|
72
|
-
# iframe
|
|
73
|
-
#
|
|
73
|
+
# iframe mode (parent page runs WebRTC Provider, two iframes each run draw.io + y-mxgraph, synced via postMessage)
|
|
74
|
+
# Visit http://localhost:5173/iframe-mode.html
|
|
74
75
|
```
|
|
75
76
|
|
|
76
|
-
|
|
77
|
+
## Docs
|
|
77
78
|
|
|
79
|
+
```bash
|
|
78
80
|
pnpm --filter @y-mxgraph/docs dev
|
|
79
|
-
|
|
80
81
|
```
|
|
81
82
|
|
|
82
83
|
## License
|