@draftably/runtime 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.
Files changed (35) hide show
  1. package/README.md +1 -0
  2. package/dist/assets/render.worker-BXjS76Gy.js +8485 -0
  3. package/dist/compile-C2lvlbqE.js +7369 -0
  4. package/dist/element.js +275 -125
  5. package/dist/{font-data-DLXJur0j.js → font-data-DME3E71S.js} +1 -1
  6. package/dist/geometry-DfUVE8b2.js +79 -0
  7. package/dist/graph.js +336 -373
  8. package/dist/host.css +37 -0
  9. package/dist/host.js +16 -0
  10. package/dist/index.js +3 -3
  11. package/dist/{render-Dgo42PR4.js → render-CFWEEKPT.js} +339 -325
  12. package/dist/types/src/dsl/cells.d.ts +1 -0
  13. package/dist/types/src/dsl/compile.d.ts +2 -1
  14. package/dist/types/src/dsl/legend-notes.d.ts +14 -0
  15. package/dist/types/src/dsl/syntax.d.ts +2 -0
  16. package/dist/types/src/model/appearance.d.ts +19 -0
  17. package/dist/types/src/model/colors.d.ts +10 -2
  18. package/dist/types/src/model/labels.d.ts +22 -6
  19. package/dist/types/src/runtime/anchors.d.ts +46 -0
  20. package/dist/types/src/runtime/camera.d.ts +41 -0
  21. package/dist/types/src/runtime/element-base.d.ts +40 -0
  22. package/dist/types/src/runtime/element.d.ts +7 -0
  23. package/dist/types/src/runtime/geometry.d.ts +72 -0
  24. package/dist/types/src/runtime/host.d.ts +46 -0
  25. package/dist/types/src/runtime/index.d.ts +1 -0
  26. package/dist/types/src/runtime/page-shared.d.ts +24 -0
  27. package/dist/types/src/runtime/svg-renderer.d.ts +8 -0
  28. package/dist/types/src/runtime/types.d.ts +6 -0
  29. package/dist/types/src/runtime/viewer.d.ts +41 -7
  30. package/dist/version-CKs2Vl8m.js +4 -0
  31. package/dist/viewer.css +66 -9
  32. package/dist/viewer.js +689 -343
  33. package/package.json +6 -1
  34. package/dist/assets/render.worker-dvseyGmC.js +0 -8310
  35. package/dist/compile-Csfz4rk4.js +0 -7267
package/dist/host.css ADDED
@@ -0,0 +1,37 @@
1
+ /*
2
+ * @draftably/runtime/host.css: import it once in every page that uses <draft-diagram> or
3
+ * <draft-editor>. These rules must work before the elements are defined.
4
+ */
5
+
6
+ /* Slot content waits for its element, so nothing flashes before the drawing. */
7
+ draft-diagram:not(:defined) > [data-draft-slot],
8
+ draft-editor:not(:defined) > [data-draft-slot] {
9
+ display: none;
10
+ }
11
+
12
+ /* The elements' own heights, held before they define, so the page does not shift. */
13
+ draft-diagram:not(:defined) {
14
+ display: block;
15
+ height: 26rem;
16
+ }
17
+ draft-editor:not(:defined) {
18
+ display: block;
19
+ height: 28rem;
20
+ }
21
+
22
+ /* Slot content takes no pointer input, so a click reaches the drawing. Marked content does. */
23
+ draft-diagram [data-draft-input],
24
+ draft-editor [data-draft-input] {
25
+ pointer-events: auto;
26
+ }
27
+
28
+ /* An editor that could not load says why. */
29
+ draft-editor[status='error']::before {
30
+ content: attr(data-error);
31
+ display: block;
32
+ margin: 0.35rem;
33
+ color: #9a3412;
34
+ font:
35
+ 14px/1.45 system-ui,
36
+ sans-serif;
37
+ }
package/dist/host.js ADDED
@@ -0,0 +1,16 @@
1
+ const e = [
2
+ "anchors",
3
+ "update",
4
+ "render",
5
+ "diagnostics",
6
+ "camera",
7
+ "itemactivate",
8
+ "link",
9
+ "contextmenu",
10
+ "select",
11
+ "change"
12
+ ], t = ["link", "contextmenu"];
13
+ export {
14
+ t as CANCELABLE_EVENTS,
15
+ e as HOST_EVENTS
16
+ };
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { r, v as e } from "./render-Dgo42PR4.js";
2
- import { a as i } from "./render-Dgo42PR4.js";
3
- import { h as v } from "./compile-Csfz4rk4.js";
1
+ import { renderSvg as r, validate as e } from "./render-CFWEEKPT.js";
2
+ import { r as i } from "./version-CKs2Vl8m.js";
3
+ import { f as v } from "./geometry-DfUVE8b2.js";
4
4
  const t = r, a = e;
5
5
  export {
6
6
  v as fontMetricsVersion,