@draftably/runtime 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 (38) hide show
  1. package/README.md +2 -1
  2. package/dist/assets/render.worker-D11vTqoO.js +8548 -0
  3. package/dist/compile-BAIrdu-8.js +7405 -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 +24 -0
  10. package/dist/index.js +3 -3
  11. package/dist/render-CsJYFD3o.js +1188 -0
  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 +27 -1
  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/color-scheme.d.ts +15 -0
  22. package/dist/types/src/runtime/element-base.d.ts +40 -0
  23. package/dist/types/src/runtime/element.d.ts +7 -0
  24. package/dist/types/src/runtime/geometry.d.ts +72 -0
  25. package/dist/types/src/runtime/host.d.ts +78 -0
  26. package/dist/types/src/runtime/index.d.ts +1 -0
  27. package/dist/types/src/runtime/page-shared.d.ts +24 -0
  28. package/dist/types/src/runtime/schemes.d.ts +2 -0
  29. package/dist/types/src/runtime/svg-renderer.d.ts +12 -0
  30. package/dist/types/src/runtime/types.d.ts +13 -0
  31. package/dist/types/src/runtime/viewer.d.ts +41 -7
  32. package/dist/version-CO7i33cq.js +4 -0
  33. package/dist/viewer.css +72 -9
  34. package/dist/viewer.js +713 -346
  35. package/package.json +6 -1
  36. package/dist/assets/render.worker-dvseyGmC.js +0 -8310
  37. package/dist/compile-Csfz4rk4.js +0 -7267
  38. package/dist/render-Dgo42PR4.js +0 -1146
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,24 @@
1
+ const n = [
2
+ "anchors",
3
+ "update",
4
+ "render",
5
+ "diagnostics",
6
+ "camera",
7
+ "itemactivate",
8
+ "link",
9
+ "contextmenu",
10
+ "select",
11
+ "change"
12
+ ], a = [
13
+ "link",
14
+ "contextmenu"
15
+ ];
16
+ function c(e) {
17
+ const { detail: t } = e;
18
+ return e.cancelable ? { ...t, preventDefault: () => e.preventDefault() } : t;
19
+ }
20
+ export {
21
+ a as CANCELABLE_EVENTS,
22
+ n as HOST_EVENTS,
23
+ c as hostDetail
24
+ };
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-CsJYFD3o.js";
2
+ import { r as i } from "./version-CO7i33cq.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,