@draftably/editor 0.0.0-stage → 0.1.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 (185) hide show
  1. package/README.md +26 -2
  2. package/dist/LICENSE +21 -0
  3. package/dist/assets/engine.worker-DmHew5f6.js +6813 -0
  4. package/dist/assets/import-d2.worker-CnXfFXoa.js +5395 -0
  5. package/dist/chunks/abnfDiagram-WEYOIA3C-llcpthp5.js +87 -0
  6. package/dist/chunks/arc-rJj0TtXf.js +83 -0
  7. package/dist/chunks/architectureDiagram-ZHVYKT53-CfiXg0Lk.js +4781 -0
  8. package/dist/chunks/blockDiagram-RJAE7QA3-CO-14jWz.js +1440 -0
  9. package/dist/chunks/browser-iNhbPsGc.js +40 -0
  10. package/dist/chunks/c4Diagram-XDPPPE54-DYKuxA4n.js +1524 -0
  11. package/dist/chunks/channel-qMvPU6eH.js +5 -0
  12. package/dist/chunks/chunk-2E7WHVMD-BEZwsFS3.js +670 -0
  13. package/dist/chunks/chunk-2Q5K7J3B-gqtzQ8ux.js +18 -0
  14. package/dist/chunks/chunk-4EMNKR2T-MC54CXVe.js +262 -0
  15. package/dist/chunks/chunk-55XCU76K-DkZUAaqC.js +68 -0
  16. package/dist/chunks/chunk-5VM5RSS4-CaKe4sjM.js +19 -0
  17. package/dist/chunks/chunk-JWPE2WC7-CnAFS2xF.js +8 -0
  18. package/dist/chunks/chunk-VQ5W62QI-CXRv7FiX.js +19 -0
  19. package/dist/chunks/chunk-XXDRQBXY-B-AMQgD2.js +8 -0
  20. package/dist/chunks/chunk-ZCHMQSOR-BALpdc3g.js +451 -0
  21. package/dist/chunks/classDiagram-v2-4MYWR3UA-wPjgJTg4.js +1570 -0
  22. package/dist/chunks/cose-bilkent-JH36ORCC-Bbh5ggBc.js +2608 -0
  23. package/dist/chunks/cynefin-EF2NZ3EQ-Bt6b88hY.js +22361 -0
  24. package/dist/chunks/cynefinDiagram-WF24UDRP-BHWZvxoF.js +299 -0
  25. package/dist/chunks/cytoscape.esm-CRsF_JA3.js +18791 -0
  26. package/dist/chunks/dagre-NK4GIZVX-Cz37yPrT.js +2157 -0
  27. package/dist/chunks/defaultLocale-BgPVtth8.js +171 -0
  28. package/dist/chunks/diagram-CBK3MWTC-Q2R6FJ0B.js +531 -0
  29. package/dist/chunks/diagram-I5XIIV2D-a2Kdu_wA.js +153 -0
  30. package/dist/chunks/diagram-ODIL2UCW-DTWXxcOn.js +346 -0
  31. package/dist/chunks/diagram-PFBEJUXE-DIAQQ5KX.js +480 -0
  32. package/dist/chunks/diagram-RJA3I4VV-BPD0GghS.js +219 -0
  33. package/dist/chunks/diagram-TYUNFSNR-BmdkONfG.js +2586 -0
  34. package/dist/chunks/dot-importer-B23jwEkx.js +1547 -0
  35. package/dist/chunks/ebnfDiagram-V4P3TTPT-C5IKvYlb.js +109 -0
  36. package/dist/chunks/elk-QONTBCTQ-CtdQFvh2.js +49229 -0
  37. package/dist/chunks/erDiagram-KYQIGQAA-5wguK9Dx.js +1064 -0
  38. package/dist/chunks/flowDiagram-IUGLLWBU-BijvFPku.js +1771 -0
  39. package/dist/chunks/ganttDiagram-R7GPNTJY-BaqGPz-O.js +2729 -0
  40. package/dist/chunks/gitGraphDiagram-PDYL7XHY-DZfMGyHE.js +815 -0
  41. package/dist/chunks/graph-CKJmgLki.js +1541 -0
  42. package/dist/chunks/import-core-C-I1wGfw.js +145 -0
  43. package/dist/chunks/infoDiagram-MVDRKAX5-C2vH_59e.js +24 -0
  44. package/dist/chunks/init-DjUOC4st.js +16 -0
  45. package/dist/chunks/ishikawaDiagram-HPEHV2GE-q149MFlV.js +624 -0
  46. package/dist/chunks/journeyDiagram-BOSHW7O7-D-2Z3VtR.js +834 -0
  47. package/dist/chunks/kanban-definition-FNSA4HC5-wvAjV5ub.js +724 -0
  48. package/dist/chunks/katex-BsrBVQKd.js +11314 -0
  49. package/dist/chunks/linear-4t7D_ros.js +259 -0
  50. package/dist/chunks/mermaid-facade-BoLWBerE.js +289 -0
  51. package/dist/chunks/mermaid-importer-Cgx1IhmR.js +478 -0
  52. package/dist/chunks/mermaid.core-DXv6D2Sm.js +19244 -0
  53. package/dist/chunks/mindmap-definition-6OY57UG3-r9wTKul_.js +837 -0
  54. package/dist/chunks/mount-C1Xk_GQz.js +22131 -0
  55. package/dist/chunks/ordinal-DfAQgscy.js +61 -0
  56. package/dist/chunks/pegDiagram-ECIUJNBX-CmKlFWiP.js +95 -0
  57. package/dist/chunks/pieDiagram-GNMPY74T-DNTw_qan.js +208 -0
  58. package/dist/chunks/quadrantDiagram-D57K4MC3-CT_tvVub.js +1029 -0
  59. package/dist/chunks/railroadDiagram-Y72NRBL7-C5TUvZBe.js +77 -0
  60. package/dist/chunks/requirementDiagram-EQYSW5RA-C_c65aCa.js +889 -0
  61. package/dist/chunks/sankeyDiagram-SY24JHO5-CKcbizM1.js +859 -0
  62. package/dist/chunks/sequenceDiagram-BLEHNHQU-GpVnHOjf.js +2972 -0
  63. package/dist/chunks/sizeCapture-INFHLROL-CToN3JSu.js +46 -0
  64. package/dist/chunks/stateDiagram-v2-A6IESKWZ-rJYd2FfM.js +1520 -0
  65. package/dist/chunks/swimlanes-B3ENRKFQ-C7w5pfxG.js +4991 -0
  66. package/dist/chunks/swimlanesDiagram-AYQRV4AK-BpGY_bvE.js +13 -0
  67. package/dist/chunks/timeline-definition-JXYKGLGB-ChKFPBKc.js +1058 -0
  68. package/dist/chunks/usecaseDiagram-WPOLBNNX-skXH8Dcu.js +7945 -0
  69. package/dist/chunks/vennDiagram-Q3Y3IDCW-C5KknmJf.js +1578 -0
  70. package/dist/chunks/wardleyDiagram-IVAIDKWA-DY4Lkfpu.js +678 -0
  71. package/dist/chunks/xychartDiagram-4URNHDU4-BHScsL7h.js +1536 -0
  72. package/dist/element.js +36 -0
  73. package/dist/index.js +4 -0
  74. package/dist/types/src/cli/links.d.ts +4 -0
  75. package/dist/types/src/cli/pdf.d.ts +29 -0
  76. package/dist/types/src/cli/png.d.ts +23 -0
  77. package/dist/types/src/cli/svg.d.ts +4 -0
  78. package/dist/types/src/components/Icon.d.ts +14 -0
  79. package/dist/types/src/components/LayoutPreviewBar.d.ts +2 -0
  80. package/dist/types/src/components/canvas/Canvas.d.ts +15 -0
  81. package/dist/types/src/components/canvas/Frame.d.ts +22 -0
  82. package/dist/types/src/components/canvas/InlineEditor.d.ts +2 -0
  83. package/dist/types/src/components/canvas/Notes.d.ts +5 -0
  84. package/dist/types/src/components/canvas/Overlay.d.ts +2 -0
  85. package/dist/types/src/components/canvas/StateBar.d.ts +5 -0
  86. package/dist/types/src/components/canvas/TextHits.d.ts +6 -0
  87. package/dist/types/src/components/canvas/ZoomControls.d.ts +1 -0
  88. package/dist/types/src/components/canvas/text-boxes.d.ts +24 -0
  89. package/dist/types/src/components/controls.d.ts +88 -0
  90. package/dist/types/src/components/scene/EdgeView.d.ts +22 -0
  91. package/dist/types/src/components/scene/GroupView.d.ts +22 -0
  92. package/dist/types/src/components/scene/Lifelines.d.ts +15 -0
  93. package/dist/types/src/components/scene/LinkMark.d.ts +11 -0
  94. package/dist/types/src/components/scene/NodeView.d.ts +18 -0
  95. package/dist/types/src/components/scene/parts.d.ts +50 -0
  96. package/dist/types/src/components/sculpt/BrushDock.d.ts +2 -0
  97. package/dist/types/src/components/sculpt/TimelineDeck.d.ts +2 -0
  98. package/dist/types/src/components/session-context.d.ts +486 -0
  99. package/dist/types/src/dsl/cells.d.ts +91 -0
  100. package/dist/types/src/dsl/channels.d.ts +53 -0
  101. package/dist/types/src/dsl/compile.d.ts +162 -0
  102. package/dist/types/src/dsl/frame.d.ts +38 -0
  103. package/dist/types/src/dsl/lanes.d.ts +23 -0
  104. package/dist/types/src/dsl/layout-edits.d.ts +58 -0
  105. package/dist/types/src/dsl/legend-notes.d.ts +3 -0
  106. package/dist/types/src/dsl/project.d.ts +39 -0
  107. package/dist/types/src/dsl/source-edits.d.ts +37 -0
  108. package/dist/types/src/dsl/syntax.d.ts +317 -0
  109. package/dist/types/src/dsl/translate.d.ts +69 -0
  110. package/dist/types/src/editor/Editor.d.ts +6 -0
  111. package/dist/types/src/editor/element.d.ts +15 -0
  112. package/dist/types/src/editor/mount.d.ts +23 -0
  113. package/dist/types/src/import/browser.d.ts +3 -0
  114. package/dist/types/src/import/detect.d.ts +31 -0
  115. package/dist/types/src/import/dot-importer.d.ts +3 -0
  116. package/dist/types/src/import/import-core.d.ts +105 -0
  117. package/dist/types/src/import/mermaid-facade.d.ts +120 -0
  118. package/dist/types/src/import/mermaid-importer.d.ts +4 -0
  119. package/dist/types/src/import/mermaid-sequence.d.ts +8 -0
  120. package/dist/types/src/import/scratch.d.ts +3 -0
  121. package/dist/types/src/lib/engine-tasks.d.ts +88 -0
  122. package/dist/types/src/lib/font-data.d.ts +9 -0
  123. package/dist/types/src/lib/saved-diagram.d.ts +4 -0
  124. package/dist/types/src/lib/scene-cache.d.ts +4 -0
  125. package/dist/types/src/lib/source-hash.d.ts +7 -0
  126. package/dist/types/src/lib/svg-export.d.ts +15 -0
  127. package/dist/types/src/model/appearance.d.ts +209 -0
  128. package/dist/types/src/model/bounds.d.ts +19 -0
  129. package/dist/types/src/model/camera.d.ts +21 -0
  130. package/dist/types/src/model/candidates.d.ts +53 -0
  131. package/dist/types/src/model/colors.d.ts +22 -0
  132. package/dist/types/src/model/document.d.ts +24 -0
  133. package/dist/types/src/model/edits.d.ts +133 -0
  134. package/dist/types/src/model/embed.d.ts +17 -0
  135. package/dist/types/src/model/examples.d.ts +15 -0
  136. package/dist/types/src/model/font-faces.d.ts +24 -0
  137. package/dist/types/src/model/fonts.d.ts +47 -0
  138. package/dist/types/src/model/footnote.d.ts +34 -0
  139. package/dist/types/src/model/frame.d.ts +71 -0
  140. package/dist/types/src/model/geometry.d.ts +29 -0
  141. package/dist/types/src/model/graph.d.ts +53 -0
  142. package/dist/types/src/model/heading.d.ts +38 -0
  143. package/dist/types/src/model/icons.d.ts +2 -0
  144. package/dist/types/src/model/label-hits.d.ts +27 -0
  145. package/dist/types/src/model/labels.d.ts +88 -0
  146. package/dist/types/src/model/legend.d.ts +25 -0
  147. package/dist/types/src/model/link.d.ts +63 -0
  148. package/dist/types/src/model/markers.d.ts +47 -0
  149. package/dist/types/src/model/note.d.ts +75 -0
  150. package/dist/types/src/model/panels.d.ts +11 -0
  151. package/dist/types/src/model/rich-text.d.ts +24 -0
  152. package/dist/types/src/model/routes.d.ts +170 -0
  153. package/dist/types/src/model/samples.d.ts +11 -0
  154. package/dist/types/src/model/stack.d.ts +8 -0
  155. package/dist/types/src/model/static-scene.d.ts +15 -0
  156. package/dist/types/src/model/status.d.ts +84 -0
  157. package/dist/types/src/model/styles.d.ts +13 -0
  158. package/dist/types/src/model/surface.d.ts +31 -0
  159. package/dist/types/src/model/types.d.ts +277 -0
  160. package/dist/types/src/runtime/svg-renderer.d.ts +38 -0
  161. package/dist/types/src/server/file-session.d.ts +19 -0
  162. package/dist/types/src/server/workspace.d.ts +21 -0
  163. package/dist/types/src/state/active-session.d.ts +479 -0
  164. package/dist/types/src/state/commands.d.ts +529 -0
  165. package/dist/types/src/state/comparison.d.ts +151 -0
  166. package/dist/types/src/state/files.d.ts +61 -0
  167. package/dist/types/src/state/keyboard.d.ts +6 -0
  168. package/dist/types/src/state/keys.d.ts +5 -0
  169. package/dist/types/src/state/launch.d.ts +61 -0
  170. package/dist/types/src/state/links.d.ts +11 -0
  171. package/dist/types/src/state/session/actions.d.ts +77 -0
  172. package/dist/types/src/state/session/canvas-text.d.ts +24 -0
  173. package/dist/types/src/state/session/document.d.ts +84 -0
  174. package/dist/types/src/state/session/editor.d.ts +81 -0
  175. package/dist/types/src/state/session/emphasis.d.ts +11 -0
  176. package/dist/types/src/state/session/file-session.d.ts +98 -0
  177. package/dist/types/src/state/session/index.d.ts +496 -0
  178. package/dist/types/src/state/session/layout.d.ts +79 -0
  179. package/dist/types/src/state/session/pointer.d.ts +19 -0
  180. package/dist/types/src/state/session/routing.d.ts +20 -0
  181. package/dist/types/src/state/session/scene.d.ts +144 -0
  182. package/dist/types/src/state/session/sculpt.d.ts +70 -0
  183. package/dist/types/src/state/toast.d.ts +14 -0
  184. package/dist/types/src/state/ui.d.ts +39 -0
  185. package/package.json +41 -3
@@ -0,0 +1,144 @@
1
+ import type { PriorRoute, RoutingResult } from '../../engines/routing-engine.js';
2
+ import { type VisibleGraph } from '../../model/graph';
3
+ import { type DrawnRoute } from '../../model/routes';
4
+ import type { NodeGeometry, NodeLayout, Rect } from '../../model/types';
5
+ import type { DocumentPart } from './document';
6
+ import type { FileSessionPart } from './file-session';
7
+ export declare function createScene(s: DocumentPart & FileSessionPart): {
8
+ sculptGeometry: import("solid-js").Accessor<NodeGeometry | null>;
9
+ setSculptGeometry: import("solid-js").Setter<NodeGeometry | null>;
10
+ animationGeometry: import("solid-js").Accessor<NodeGeometry | null>;
11
+ setAnimationGeometry: import("solid-js").Setter<NodeGeometry | null>;
12
+ setQuickRouting: import("solid-js").Setter<boolean>;
13
+ routePrior: import("solid-js").Accessor<PriorRoute[] | null>;
14
+ setRoutePrior: import("solid-js").Setter<PriorRoute[] | null>;
15
+ setAdoptedRoutes: import("solid-js").Setter<{
16
+ fingerprint: string;
17
+ result: RoutingResult;
18
+ } | null>;
19
+ geometry: (id: string) => NodeLayout;
20
+ visibleScene: import("solid-js").Accessor<VisibleGraph>;
21
+ nodeIds: import("solid-js").Accessor<string[]>;
22
+ groupIds: import("solid-js").Accessor<string[]>;
23
+ edgeIds: import("solid-js").Accessor<string[]>;
24
+ sceneRects: import("solid-js").Accessor<Map<string, Rect>>;
25
+ routing: import("solid-js").Accessor<import("../../model/routes").SceneRoutes>;
26
+ routesById: import("solid-js").Accessor<Map<string, DrawnRoute>>;
27
+ routeIds: import("solid-js").Accessor<string[]>;
28
+ routesPending: () => boolean;
29
+ resetRoutes: () => void;
30
+ routeInputFor: () => {
31
+ nodes: ({
32
+ shape: import("../../model/types").ShapeKind;
33
+ x: number;
34
+ y: number;
35
+ w: number;
36
+ h: number;
37
+ id: string;
38
+ title: string;
39
+ was?: string;
40
+ wasShape?: import("../../model/types").ShapeKind;
41
+ wasCount?: number | string;
42
+ href?: string;
43
+ count?: number | string;
44
+ span?: number | "var";
45
+ parentId?: string;
46
+ image?: string;
47
+ lifeline?: number;
48
+ } | {
49
+ parentId?: string | undefined;
50
+ frame?: boolean | undefined;
51
+ shape: import("../../model/types").ShapeKind;
52
+ x: number;
53
+ y: number;
54
+ w: number;
55
+ h: number;
56
+ id: string;
57
+ title: string;
58
+ })[];
59
+ groups: {
60
+ titleHeight?: number | undefined;
61
+ collapsed: boolean;
62
+ titleWidth: number;
63
+ x: number;
64
+ y: number;
65
+ w: number;
66
+ h: number;
67
+ id: string;
68
+ title: string;
69
+ was?: string;
70
+ href?: string;
71
+ parentId?: string;
72
+ frame?: "soft" | "none";
73
+ titleLines?: number;
74
+ hull?: Rect[];
75
+ }[];
76
+ edges: {
77
+ from: string;
78
+ to: string;
79
+ cfg: import("../../model/types").EdgeLayout;
80
+ a: string;
81
+ b: string;
82
+ id: string;
83
+ label: string;
84
+ was?: string;
85
+ directed: boolean;
86
+ head?: import("../../model/markers.js").EndMarker;
87
+ tail?: import("../../model/markers.js").EndMarker;
88
+ emphasis: boolean;
89
+ dashed: boolean;
90
+ status?: import("../../model/status").Status;
91
+ spot?: import("../../model/status").Spot;
92
+ }[];
93
+ };
94
+ routes: () => DrawnRoute[];
95
+ routingReport: () => import("../../engines/routing-engine.js").RoutingReport;
96
+ blockedRouteIds: () => string[];
97
+ sceneBounds: () => Rect;
98
+ viewerFrame: () => {
99
+ x: number;
100
+ y: number;
101
+ w: number;
102
+ h: number;
103
+ natural: number;
104
+ head: {
105
+ w: number;
106
+ h: number;
107
+ };
108
+ key: {
109
+ w: number;
110
+ h: number;
111
+ row: number;
112
+ items: {
113
+ x: number;
114
+ y: number;
115
+ legend?: import("../../model/appearance").LegendEntry;
116
+ status?: import("../../model/status").StatusCount;
117
+ label: string;
118
+ }[];
119
+ };
120
+ heading: {
121
+ x: number;
122
+ y: number;
123
+ wrap: number;
124
+ };
125
+ legend: {
126
+ x: number;
127
+ y: number;
128
+ };
129
+ foot: {
130
+ x: number;
131
+ y: number;
132
+ type: import("../../model/fonts.js").TypeProfile;
133
+ gutter: number;
134
+ items: {
135
+ note: import("../../model/footnote.js").Footnote;
136
+ lines: import("../../model/rich-text.js").Run[][];
137
+ y: number;
138
+ }[];
139
+ h: number;
140
+ };
141
+ notes: import("../../model/note").PlacedNote[];
142
+ };
143
+ };
144
+ export type ScenePart = ReturnType<typeof createScene>;
@@ -0,0 +1,70 @@
1
+ import { type BrushSettings, type DabResult, type Timeline } from '../../engines/sculpt-engine.js';
2
+ import type { Point } from '../../model/types';
3
+ import type { DocumentPart } from './document';
4
+ import type { LayoutPart } from './layout';
5
+ import type { ActionsPart } from './actions';
6
+ import type { EditorPart } from './editor';
7
+ import type { ScenePart } from './scene';
8
+ export type GhostMode = 'next' | 'final' | 'off';
9
+ export interface TimelineState {
10
+ signature: string;
11
+ scope: string;
12
+ algorithm: string;
13
+ busy: boolean;
14
+ index: number;
15
+ peek: number | null;
16
+ ghost: GhostMode;
17
+ data: Timeline | null;
18
+ }
19
+ export declare function validateTimeline(input: unknown): Timeline;
20
+ export declare function createSculpt(s: DocumentPart & LayoutPart & ActionsPart & EditorPart & ScenePart): {
21
+ importTimeline: (input: unknown) => void;
22
+ timeline: import("solid-js").Accessor<TimelineState | null>;
23
+ playing: import("solid-js").Accessor<boolean>;
24
+ brushActive: import("solid-js").Accessor<boolean>;
25
+ brushSettings: import("solid-js").Accessor<BrushSettings>;
26
+ brushPoint: import("solid-js").Accessor<Point | null>;
27
+ brushHover: import("solid-js").Accessor<DabResult | null>;
28
+ stroking: import("solid-js").Accessor<boolean>;
29
+ restoreKey: import("solid-js").Accessor<boolean>;
30
+ referenceLabel: import("solid-js").Accessor<string>;
31
+ timelineOpen: () => boolean;
32
+ sculptInteracting: () => boolean;
33
+ heldIds: () => string[];
34
+ restoreArchive: () => void;
35
+ openTimeline: (options?: Record<string, unknown>) => Promise<void>;
36
+ closeTimeline: () => void;
37
+ scrub: (index: number, { peek }?: {
38
+ peek?: boolean | undefined;
39
+ }) => number | undefined;
40
+ endPeek: () => void;
41
+ setGhost: (ghost: GhostMode) => void;
42
+ bookmarkStep: () => void;
43
+ keepStep: ({ brush }?: {
44
+ brush?: boolean | undefined;
45
+ }) => boolean;
46
+ stopPlayback: () => void;
47
+ togglePlayback: () => void;
48
+ fitTimelinePath: (reservedBottom: number) => void;
49
+ reopenTimeline: () => void;
50
+ saveTimelineFile: () => void;
51
+ activateBrush: (options?: Partial<BrushSettings>) => void;
52
+ deactivateBrush: () => void;
53
+ toggleBrush: () => void;
54
+ updateBrushSettings: (patch: Partial<BrushSettings>) => void;
55
+ useCurrentAsReference: () => void;
56
+ brushPointerDown: (e: PointerEvent, target: Element) => boolean;
57
+ brushPointerMove: (e: PointerEvent) => boolean;
58
+ brushPointerUp: (e?: PointerEvent) => boolean;
59
+ brushPointerLeave: () => void;
60
+ cancelStroke: () => boolean;
61
+ brushDab: (point?: Point) => DabResult;
62
+ clearHolds: () => void;
63
+ sculptUndo: () => boolean;
64
+ sculptKey: (e: KeyboardEvent) => boolean;
65
+ sculptBlur: () => void;
66
+ sculptBeforeUnload: () => void;
67
+ hasArchivedTimeline: import("solid-js").Accessor<boolean>;
68
+ setComparisonCloser: (fn: () => void) => () => void;
69
+ };
70
+ export type SculptPart = ReturnType<typeof createSculpt>;
@@ -0,0 +1,14 @@
1
+ /** A button on a toast, such as a way to take back what the message reports. */
2
+ export interface ToastAction {
3
+ label: string;
4
+ run: () => void;
5
+ }
6
+ export declare const toastMessage: import("solid-js").Accessor<{
7
+ text: string;
8
+ id: number;
9
+ action?: ToastAction;
10
+ } | null>;
11
+ /** Show a short status message at the bottom of the screen, with an optional button. */
12
+ export declare function toast(text: string, action?: ToastAction): void;
13
+ /** Hide the toast now. */
14
+ export declare function dismissToast(): void;
@@ -0,0 +1,39 @@
1
+ export type MenuId = 'file' | 'edit' | 'view' | 'layout' | 'help' | 'export' | 'context' | 'appearance' | 'tools';
2
+ export type RightTab = 'properties' | 'arrange' | 'source';
3
+ export type DialogId = 'help' | 'palette' | 'quick-build' | 'confirm' | 'error' | 'export';
4
+ export interface MenuState {
5
+ id: MenuId;
6
+ /** Element the menu is anchored to, or a point for context menus. */
7
+ anchor: HTMLElement | {
8
+ x: number;
9
+ y: number;
10
+ };
11
+ }
12
+ import type { ConfirmRequest } from './session';
13
+ export type { ConfirmRequest };
14
+ export declare const filesOpen: import("solid-js").Accessor<boolean>, inspectorOpen: import("solid-js").Accessor<boolean>, sidebarWidth: import("solid-js").Accessor<number>, inspectorWidth: import("solid-js").Accessor<number>, menu: import("solid-js").Accessor<MenuState | null>, dialog: import("solid-js").Accessor<DialogId | null>, confirmRequest: import("solid-js").Accessor<ConfirmRequest | null>, errorMessage: import("solid-js").Accessor<string>, quickBuildText: import("solid-js").Accessor<string>, rightTab: import("solid-js").Accessor<RightTab>, setRightTab: import("solid-js").Setter<RightTab>, creatingFile: import("solid-js").Accessor<boolean>, setCreatingFile: import("solid-js").Setter<boolean>, savingExample: import("solid-js").Accessor<boolean>, setSavingExample: import("solid-js").Setter<boolean>;
15
+ /** The files panel is on screen: open, with a served folder to list. */
16
+ export declare const filesShown: () => boolean;
17
+ /** The objects panel is on screen. It shares the sidebar with the files panel, which comes first. */
18
+ export declare const objectsOpen: () => boolean;
19
+ export declare const setSidebarWidth: (width: number) => number;
20
+ export declare const resetSidebarWidth: () => 264;
21
+ export declare const setInspectorWidth: (width: number) => number;
22
+ export declare const resetInspectorWidth: () => 280;
23
+ export declare function setObjectsOpen(open: boolean): void;
24
+ export declare function setFilesOpen(open: boolean): void;
25
+ export declare function setInspectorOpen(open: boolean): void;
26
+ export declare const propertiesOpen: () => boolean;
27
+ export declare const arrangeOpen: () => boolean;
28
+ export declare const sourceOpen: () => boolean;
29
+ /** Open the right panel on a tab, or close it if that tab is already showing. */
30
+ export declare function toggleRightTab(tab: RightTab): void;
31
+ /** Hide the side panels, or bring back the ones that were open. */
32
+ export declare function togglePanels(): void;
33
+ export declare function openMenu(id: MenuId, anchor: MenuState['anchor']): void;
34
+ export declare const closeMenu: () => null;
35
+ export declare function openDialog(id: DialogId): void;
36
+ export declare const closeDialog: () => null;
37
+ export declare function confirmAction(request: ConfirmRequest): void;
38
+ export declare function showError(message: string): void;
39
+ export declare function openQuickBuild(text?: string): void;
package/package.json CHANGED
@@ -1,6 +1,44 @@
1
1
  {
2
2
  "name": "@draftably/editor",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0",
4
+ "description": "The Draftably diagram editor: drag boxes and lines, and get the .draft source back.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "files": [
8
+ "dist",
9
+ "README.md"
10
+ ],
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/types/src/editor/mount.d.ts",
14
+ "import": "./dist/index.js",
15
+ "default": "./dist/index.js"
16
+ },
17
+ "./element": {
18
+ "types": "./dist/types/src/editor/element.d.ts",
19
+ "import": "./dist/element.js",
20
+ "default": "./dist/element.js"
21
+ },
22
+ "./package.json": "./package.json"
23
+ },
24
+ "sideEffects": [
25
+ "./dist/element.js",
26
+ "./dist/index.js",
27
+ "./dist/chunks/*.js"
28
+ ],
29
+ "engines": {
30
+ "node": ">=22.21.0"
31
+ },
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "git+https://github.com/byronwall/draftably.git",
35
+ "directory": "packages/editor"
36
+ },
37
+ "publishConfig": {
38
+ "access": "public",
39
+ "registry": "https://registry.npmjs.org"
40
+ },
41
+ "scripts": {
42
+ "build": "node ../../scripts/build-editor.ts"
43
+ }
6
44
  }