@draftably/editor 0.3.0 → 0.4.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 +5 -3
- package/dist/assets/engine.worker-C6o2x40z.js +7609 -0
- package/dist/element.js +171 -17
- package/dist/index.js +8564 -7844
- package/dist/types/src/components/canvas/Canvas.d.ts +4 -0
- package/dist/types/src/components/scene/NodeView.d.ts +7 -0
- package/dist/types/src/components/scene/parts.d.ts +7 -11
- package/dist/types/src/components/session-context.d.ts +4 -1
- package/dist/types/src/dsl/cells.d.ts +1 -0
- package/dist/types/src/dsl/compile.d.ts +2 -1
- package/dist/types/src/dsl/legend-notes.d.ts +14 -0
- package/dist/types/src/dsl/syntax.d.ts +3 -1
- package/dist/types/src/editor/css.d.ts +3 -0
- package/dist/types/src/editor/element.d.ts +8 -6
- package/dist/types/src/editor/internal.d.ts +483 -0
- package/dist/types/src/editor/mount.d.ts +70 -5
- package/dist/types/src/graph-api/core.d.ts +125 -0
- package/dist/types/src/model/appearance.d.ts +19 -0
- package/dist/types/src/model/colors.d.ts +10 -2
- package/dist/types/src/model/labels.d.ts +22 -6
- package/dist/types/src/runtime/anchors.d.ts +46 -0
- package/dist/types/src/runtime/camera.d.ts +41 -0
- package/dist/types/src/runtime/element-base.d.ts +40 -0
- package/dist/types/src/runtime/geometry.d.ts +72 -0
- package/dist/types/src/runtime/host.d.ts +46 -0
- package/dist/types/src/runtime/page-shared.d.ts +24 -0
- package/dist/types/src/runtime/policy.d.ts +7 -0
- package/dist/types/src/runtime/render.d.ts +10 -0
- package/dist/types/src/runtime/svg-renderer.d.ts +8 -0
- package/dist/types/src/runtime/types.d.ts +115 -0
- package/dist/types/src/runtime/version.d.ts +2 -0
- package/dist/types/src/runtime/viewer.d.ts +123 -0
- package/dist/types/src/state/active-session.d.ts +7 -1
- package/dist/types/src/state/dom-root.d.ts +8 -0
- package/dist/types/src/state/session/document.d.ts +3 -1
- package/dist/types/src/state/session/editor.d.ts +3 -2
- package/dist/types/src/state/session/index.d.ts +5 -1
- package/package.json +1 -1
- 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
|
|
20
|
-
the element a height; it is 28rem by default.
|
|
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 })`.
|