@draftably/editor 0.3.0 → 0.5.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 (43) hide show
  1. package/README.md +5 -3
  2. package/dist/assets/engine.worker-BDrPGHQt.js +7634 -0
  3. package/dist/element.js +182 -17
  4. package/dist/index.js +8827 -7969
  5. package/dist/types/src/components/canvas/Canvas.d.ts +4 -0
  6. package/dist/types/src/components/scene/NodeView.d.ts +7 -0
  7. package/dist/types/src/components/scene/parts.d.ts +7 -11
  8. package/dist/types/src/components/session-context.d.ts +7 -1
  9. package/dist/types/src/dsl/cells.d.ts +1 -0
  10. package/dist/types/src/dsl/compile.d.ts +2 -1
  11. package/dist/types/src/dsl/legend-notes.d.ts +14 -0
  12. package/dist/types/src/dsl/syntax.d.ts +3 -1
  13. package/dist/types/src/dsl/translate.d.ts +1 -1
  14. package/dist/types/src/editor/css.d.ts +3 -0
  15. package/dist/types/src/editor/element.d.ts +8 -6
  16. package/dist/types/src/editor/internal.d.ts +486 -0
  17. package/dist/types/src/editor/mount.d.ts +77 -5
  18. package/dist/types/src/graph-api/core.d.ts +125 -0
  19. package/dist/types/src/model/appearance.d.ts +27 -1
  20. package/dist/types/src/model/colors.d.ts +10 -2
  21. package/dist/types/src/model/labels.d.ts +22 -6
  22. package/dist/types/src/runtime/anchors.d.ts +46 -0
  23. package/dist/types/src/runtime/camera.d.ts +41 -0
  24. package/dist/types/src/runtime/color-scheme.d.ts +15 -0
  25. package/dist/types/src/runtime/element-base.d.ts +40 -0
  26. package/dist/types/src/runtime/geometry.d.ts +72 -0
  27. package/dist/types/src/runtime/host.d.ts +78 -0
  28. package/dist/types/src/runtime/page-shared.d.ts +24 -0
  29. package/dist/types/src/runtime/policy.d.ts +7 -0
  30. package/dist/types/src/runtime/render.d.ts +10 -0
  31. package/dist/types/src/runtime/schemes.d.ts +2 -0
  32. package/dist/types/src/runtime/svg-renderer.d.ts +12 -0
  33. package/dist/types/src/runtime/types.d.ts +122 -0
  34. package/dist/types/src/runtime/version.d.ts +2 -0
  35. package/dist/types/src/runtime/viewer.d.ts +123 -0
  36. package/dist/types/src/state/active-session.d.ts +10 -1
  37. package/dist/types/src/state/dom-root.d.ts +8 -0
  38. package/dist/types/src/state/session/document.d.ts +3 -1
  39. package/dist/types/src/state/session/editor.d.ts +3 -2
  40. package/dist/types/src/state/session/emphasis.d.ts +3 -0
  41. package/dist/types/src/state/session/index.d.ts +13 -1
  42. package/package.json +1 -1
  43. package/dist/assets/engine.worker-BY9GKt7x.js +0 -7505
package/README.md CHANGED
@@ -5,19 +5,21 @@ The Draftably diagram editor. Drag boxes and lines, add shapes, edit labels, und
5
5
  document, selection, undo history and camera.
6
6
 
7
7
  ```sh
8
- pnpm add @draftably/editor
8
+ pnpm add @draftably/editor @draftably/runtime
9
9
  ```
10
10
 
11
11
  ```ts
12
12
  import '@draftably/editor/element';
13
+ import '@draftably/runtime/host.css'; // once per page
13
14
  ```
14
15
 
15
16
  ```html
16
17
  <draft-editor source='node api "API"'></draft-editor>
17
18
  ```
18
19
 
19
- Listen for `draft-change`; its `detail` is the new source. Set `source` to load other text. Give
20
- the element a height; it is 28rem by default. Its styles apply only inside the editor.
20
+ Listen for `draft-change`; its `detail` is `{ source }`. Set `source` to load other text. Give
21
+ the element a height; it is 28rem by default. It renders in a shadow root, so its styles apply only inside the editor. Put your own content on
22
+ a node with a child marked `data-draft-slot="body:<id>"`.
21
23
 
22
24
  In React, Solid, Vue or Svelte, use `DraftEditor` from `@draftably/react/editor` and the
23
25
  others. For your own lifecycle, call `mountEditor(host, { source, onChange })`.