@draftably/editor 0.0.0-stage → 0.2.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 (101) hide show
  1. package/README.md +25 -2
  2. package/dist/LICENSE +21 -0
  3. package/dist/assets/engine.worker-DwN9io_m.js +6856 -0
  4. package/dist/element.js +36 -0
  5. package/dist/index.js +19555 -0
  6. package/dist/types/src/cli/links.d.ts +4 -0
  7. package/dist/types/src/cli/pdf.d.ts +29 -0
  8. package/dist/types/src/cli/png.d.ts +23 -0
  9. package/dist/types/src/cli/svg.d.ts +4 -0
  10. package/dist/types/src/components/Icon.d.ts +14 -0
  11. package/dist/types/src/components/LayoutPreviewBar.d.ts +2 -0
  12. package/dist/types/src/components/canvas/Canvas.d.ts +15 -0
  13. package/dist/types/src/components/canvas/Frame.d.ts +22 -0
  14. package/dist/types/src/components/canvas/InlineEditor.d.ts +2 -0
  15. package/dist/types/src/components/canvas/Notes.d.ts +5 -0
  16. package/dist/types/src/components/canvas/Overlay.d.ts +2 -0
  17. package/dist/types/src/components/canvas/StateBar.d.ts +5 -0
  18. package/dist/types/src/components/canvas/TextHits.d.ts +6 -0
  19. package/dist/types/src/components/canvas/ZoomControls.d.ts +1 -0
  20. package/dist/types/src/components/canvas/text-boxes.d.ts +24 -0
  21. package/dist/types/src/components/controls.d.ts +91 -0
  22. package/dist/types/src/components/scene/EdgeView.d.ts +22 -0
  23. package/dist/types/src/components/scene/GroupView.d.ts +22 -0
  24. package/dist/types/src/components/scene/Lifelines.d.ts +15 -0
  25. package/dist/types/src/components/scene/LinkMark.d.ts +11 -0
  26. package/dist/types/src/components/scene/NodeView.d.ts +18 -0
  27. package/dist/types/src/components/scene/parts.d.ts +50 -0
  28. package/dist/types/src/components/sculpt/BrushDock.d.ts +2 -0
  29. package/dist/types/src/components/sculpt/TimelineDeck.d.ts +2 -0
  30. package/dist/types/src/components/session-context.d.ts +486 -0
  31. package/dist/types/src/dsl/cells.d.ts +91 -0
  32. package/dist/types/src/dsl/channels.d.ts +53 -0
  33. package/dist/types/src/dsl/compile.d.ts +162 -0
  34. package/dist/types/src/dsl/frame.d.ts +38 -0
  35. package/dist/types/src/dsl/lanes.d.ts +23 -0
  36. package/dist/types/src/dsl/layout-edits.d.ts +58 -0
  37. package/dist/types/src/dsl/legend-notes.d.ts +3 -0
  38. package/dist/types/src/dsl/project.d.ts +39 -0
  39. package/dist/types/src/dsl/source-edits.d.ts +37 -0
  40. package/dist/types/src/dsl/syntax.d.ts +317 -0
  41. package/dist/types/src/dsl/translate.d.ts +69 -0
  42. package/dist/types/src/editor/Editor.d.ts +6 -0
  43. package/dist/types/src/editor/element.d.ts +15 -0
  44. package/dist/types/src/editor/mount.d.ts +23 -0
  45. package/dist/types/src/lib/engine-tasks.d.ts +88 -0
  46. package/dist/types/src/lib/font-data.d.ts +9 -0
  47. package/dist/types/src/lib/saved-diagram.d.ts +4 -0
  48. package/dist/types/src/lib/scene-cache.d.ts +4 -0
  49. package/dist/types/src/lib/svg-export.d.ts +15 -0
  50. package/dist/types/src/model/appearance.d.ts +209 -0
  51. package/dist/types/src/model/bounds.d.ts +19 -0
  52. package/dist/types/src/model/camera.d.ts +21 -0
  53. package/dist/types/src/model/colors.d.ts +22 -0
  54. package/dist/types/src/model/document.d.ts +24 -0
  55. package/dist/types/src/model/edits.d.ts +133 -0
  56. package/dist/types/src/model/embed.d.ts +17 -0
  57. package/dist/types/src/model/font-faces.d.ts +24 -0
  58. package/dist/types/src/model/fonts.d.ts +47 -0
  59. package/dist/types/src/model/footnote.d.ts +34 -0
  60. package/dist/types/src/model/frame.d.ts +71 -0
  61. package/dist/types/src/model/geometry.d.ts +29 -0
  62. package/dist/types/src/model/graph.d.ts +53 -0
  63. package/dist/types/src/model/heading.d.ts +38 -0
  64. package/dist/types/src/model/icons.d.ts +2 -0
  65. package/dist/types/src/model/labels.d.ts +88 -0
  66. package/dist/types/src/model/legend.d.ts +25 -0
  67. package/dist/types/src/model/link.d.ts +63 -0
  68. package/dist/types/src/model/markers.d.ts +47 -0
  69. package/dist/types/src/model/note.d.ts +75 -0
  70. package/dist/types/src/model/panels.d.ts +11 -0
  71. package/dist/types/src/model/rich-text.d.ts +24 -0
  72. package/dist/types/src/model/routes.d.ts +170 -0
  73. package/dist/types/src/model/samples.d.ts +11 -0
  74. package/dist/types/src/model/stack.d.ts +8 -0
  75. package/dist/types/src/model/status.d.ts +84 -0
  76. package/dist/types/src/model/styles.d.ts +13 -0
  77. package/dist/types/src/model/surface.d.ts +31 -0
  78. package/dist/types/src/model/types.d.ts +277 -0
  79. package/dist/types/src/runtime/svg-renderer.d.ts +38 -0
  80. package/dist/types/src/server/file-session.d.ts +19 -0
  81. package/dist/types/src/server/workspace.d.ts +21 -0
  82. package/dist/types/src/state/active-session.d.ts +479 -0
  83. package/dist/types/src/state/canvas-commands.d.ts +169 -0
  84. package/dist/types/src/state/canvas-keyboard.d.ts +15 -0
  85. package/dist/types/src/state/keys.d.ts +5 -0
  86. package/dist/types/src/state/links.d.ts +14 -0
  87. package/dist/types/src/state/session/actions.d.ts +77 -0
  88. package/dist/types/src/state/session/canvas-text.d.ts +24 -0
  89. package/dist/types/src/state/session/document.d.ts +84 -0
  90. package/dist/types/src/state/session/editor.d.ts +81 -0
  91. package/dist/types/src/state/session/emphasis.d.ts +11 -0
  92. package/dist/types/src/state/session/file-session.d.ts +98 -0
  93. package/dist/types/src/state/session/index.d.ts +496 -0
  94. package/dist/types/src/state/session/layout.d.ts +79 -0
  95. package/dist/types/src/state/session/pointer.d.ts +19 -0
  96. package/dist/types/src/state/session/routing.d.ts +20 -0
  97. package/dist/types/src/state/session/scene.d.ts +144 -0
  98. package/dist/types/src/state/session/sculpt.d.ts +70 -0
  99. package/dist/types/src/state/toast.d.ts +14 -0
  100. package/dist/types/src/state/workspace.d.ts +3 -0
  101. package/package.json +41 -3
@@ -0,0 +1,14 @@
1
+ import type { DiagramSession } from './session';
2
+ /**
3
+ * Where a relative link starts: `config link-base=` from the diagram's folder, else its git root.
4
+ * Null when no file on disk is open.
5
+ */
6
+ export declare function linkBase(s: DiagramSession): string | null;
7
+ /** `href` joined to a URL `link-base`, or null. */
8
+ export declare const joined: (s: DiagramSession, href: string) => string | null;
9
+ /** What opening `href` does, for a tooltip or the Inspector. */
10
+ export declare function describeLink(s: DiagramSession, href: string): string;
11
+ /** A path inside the served folder, relative to it, or null. */
12
+ export declare function servedPath(file: string): string | null;
13
+ /** A link as an exported SVG carries it: file paths from the diagram's folder, URLs as written. */
14
+ export declare function exportHref(s: DiagramSession, href: string): string;
@@ -0,0 +1,77 @@
1
+ import { type AppearanceOverrides, type Shade, type ThemeId } from '../../model/appearance';
2
+ import * as edits from '../../model/edits';
3
+ import type { Diagram, IntentPlacement, IntentRole, Point, Side } from '../../model/types';
4
+ import { type Tool } from './editor';
5
+ import type { EditorPart } from './editor';
6
+ import type { DocumentPart } from './document';
7
+ import type { ScenePart } from './scene';
8
+ import type { LayoutPart } from './layout';
9
+ /** Inline-edit ids of the frame's title and subtitle; never valid object ids. */
10
+ export declare const HEADING_EDIT: {
11
+ readonly title: string;
12
+ readonly subtitle: string;
13
+ };
14
+ export declare function createActions(s: EditorPart & DocumentPart & ScenePart & LayoutPart): {
15
+ inlineDraft: import("solid-js").Accessor<string>;
16
+ setInlineDraft: import("solid-js").Setter<string>;
17
+ setToolInterceptor: (fn: (tool: Tool) => boolean) => (tool: Tool) => boolean;
18
+ setTool: (next: Tool) => void;
19
+ startInlineEdit: (id: string) => void;
20
+ finishInlineEdit: (save?: boolean) => void;
21
+ addNode: (partial?: edits.NewNode, at?: Point, edit?: boolean) => string;
22
+ addEdge: (partial: edits.NewEdge) => string;
23
+ completeConnection: (targetId: string, side?: Side | "auto") => void;
24
+ quickExtend: ({ side, sibling, at, from, }?: {
25
+ side?: Side | null;
26
+ sibling?: boolean;
27
+ at?: Point | null;
28
+ from?: string | null;
29
+ }) => string | undefined;
30
+ insertStep: (edgeId: string, at?: Point | null) => string | undefined;
31
+ buildFromList: (lines: string[], options?: {
32
+ mode?: edits.BuildMode;
33
+ title?: string;
34
+ source?: string | null;
35
+ parentId?: string | null;
36
+ }) => string[];
37
+ wrapSelection: () => string;
38
+ drawContainer: (rect: {
39
+ x: number;
40
+ y: number;
41
+ w: number;
42
+ h: number;
43
+ }) => void;
44
+ deleteSelection: (deep?: boolean) => void;
45
+ ungroupSelection: () => void;
46
+ togglePin: () => void;
47
+ clearManualMarkers: () => void;
48
+ alignSelection: (kind: edits.AlignKind) => void;
49
+ nudgeSelection: (dx: number, dy: number) => boolean;
50
+ setColor: (color: Diagram["styles"][string]["color"]) => void;
51
+ chooseTheme: (theme: ThemeId) => void;
52
+ setAppearanceOverrides: (patch: Partial<AppearanceOverrides>, label?: string) => void;
53
+ setShade: (shade: Shade | undefined) => void;
54
+ fitSelectedContainer: () => void;
55
+ toggleCollapse: (id?: string | undefined) => void;
56
+ reverseSelectedEdge: () => void;
57
+ resetSelectedBends: () => void;
58
+ setLayoutIntent: (role: IntentRole, id: string | null, placement?: IntentPlacement) => void;
59
+ markSelectedAs: (role: IntentRole) => void;
60
+ addWaypointAt: (edgeId: string, point?: Point) => void;
61
+ removeWaypoint: (edgeId: string, index: number) => void;
62
+ reroute: ({ auto }?: {
63
+ auto?: boolean | undefined;
64
+ }) => void;
65
+ toggleTheme: () => void;
66
+ copySelection: () => edits.ClipboardFragment | null;
67
+ hasClipboard: () => boolean;
68
+ pasteFragment: (part?: edits.ClipboardFragment | null) => void;
69
+ duplicateSelection: () => void;
70
+ openDocument: (input: unknown, { fit, label }?: {
71
+ fit?: boolean | undefined;
72
+ label?: string | undefined;
73
+ }) => Diagram;
74
+ newDocument: () => void;
75
+ openSample: (id: string) => Diagram | undefined;
76
+ };
77
+ export type ActionsPart = ReturnType<typeof createActions>;
@@ -0,0 +1,24 @@
1
+ import type { Diagram } from '../../model/types';
2
+ export type TextKind = 'title' | 'subtitle' | 'note' | 'footnote' | 'legend' | 'phase';
3
+ export declare const textId: (kind: TextKind, key?: string | number) => string;
4
+ /** The kind and key of a text id; undefined for an object id. */
5
+ export declare function parseTextId(id: string | null | undefined): {
6
+ kind: TextKind;
7
+ key: string;
8
+ } | undefined;
9
+ /** What the Inspector, undo steps and the editor call each kind. */
10
+ export declare const TEXT_NAMES: Record<TextKind, string>;
11
+ /** The text's current words, or undefined when the id names nothing in `d`. */
12
+ export declare function textValue(d: Diagram, id: string): string | undefined;
13
+ /**
14
+ * Write `value` to the text `id` names. An empty note or legend row is removed; a phase keeps its
15
+ * old label, since a phase needs one.
16
+ */
17
+ export declare function setTextValue(d: Diagram, id: string, value: string): void;
18
+ /** Remove the text: a note, footnote or legend row goes, a title or subtitle empties; a phase stays. */
19
+ export declare function removeText(d: Diagram, id: string): void;
20
+ export declare function createCanvasText(): {
21
+ selectedText: import("solid-js").Accessor<string | null>;
22
+ setSelectedText: import("solid-js").Setter<string | null>;
23
+ };
24
+ export type CanvasTextPart = ReturnType<typeof createCanvasText>;
@@ -0,0 +1,84 @@
1
+ import type { Camera, Diagram } from '../../model/types';
2
+ import type { CanvasTextPart } from './canvas-text';
3
+ import type { SessionOptions } from '.';
4
+ export interface HistoryEntry {
5
+ data: string;
6
+ label: string;
7
+ /** Local brush holds before and after this step; holds are session state, not document data. */
8
+ holds?: {
9
+ before: string[];
10
+ after: string[];
11
+ };
12
+ }
13
+ type SaveStatus = 'saved' | 'saving' | 'preview' | 'failed';
14
+ /**
15
+ * Handles every committed edit instead of the browser history while a diagram file is open, so
16
+ * the edit can be written to the file. Returns whether the edit was kept.
17
+ */
18
+ type CommitHandler = (before: string, label: string, kind: EditKind) => boolean;
19
+ /**
20
+ * `arrangement`: the edit is a drawing produced by a layout pass, a timeline step or the brush,
21
+ * saved as positions rather than translated move by move.
22
+ */
23
+ export type EditKind = 'edit' | 'arrangement';
24
+ /** Replaces the browser history while a diagram file is open: undo steps through its source. */
25
+ export interface HistoryHandler {
26
+ undo(): void;
27
+ redo(): void;
28
+ canUndo(): boolean;
29
+ canRedo(): boolean;
30
+ }
31
+ export declare function createDocument(s: CanvasTextPart, options: SessionOptions): {
32
+ options: SessionOptions;
33
+ doc: Diagram;
34
+ setDoc: import("solid-js/store").SetStoreFunction<Diagram>;
35
+ saveStatus: import("solid-js").Accessor<SaveStatus>;
36
+ undoStack: import("solid-js").Accessor<HistoryEntry[]>;
37
+ redoStack: import("solid-js").Accessor<HistoryEntry[]>;
38
+ revision: import("solid-js").Accessor<number>;
39
+ snapshotDoc: () => Diagram;
40
+ snapshot: () => string;
41
+ selection: import("solid-js").Accessor<ReadonlySet<string>>;
42
+ selectedIds: () => string[];
43
+ isSelected: (id: string) => boolean;
44
+ singleSelection: () => string | undefined;
45
+ setSelection: (ids: Iterable<string>) => void;
46
+ selectItems: (ids: string[], { add, toggle }?: {
47
+ add?: boolean | undefined;
48
+ toggle?: boolean | undefined;
49
+ }) => void;
50
+ clearSelection: () => void;
51
+ selectText: (id: string) => void;
52
+ onBeforeEdit: (handler: () => void) => void;
53
+ prepareForEdit: () => void;
54
+ onSourceIdMap: (handler: (mapId: (id: string) => string) => void) => void;
55
+ mapSourceIds: (mapId: (id: string) => string) => void;
56
+ setCommitHandler: (handler: CommitHandler | null) => CommitHandler | null;
57
+ editsGoToFile: () => boolean;
58
+ commit: (before: string, label?: string, kind?: EditKind) => boolean;
59
+ pushUndo: (entry: HistoryEntry) => void;
60
+ annotateLastUndo: (holds: HistoryEntry["holds"]) => void;
61
+ transact: (label: string, fn: (draft: Diagram) => void, kind?: EditKind) => boolean;
62
+ mutate: (fn: (draft: Diagram) => void) => void;
63
+ restoreDocument: (next: Diagram, { keepCamera }?: {
64
+ keepCamera?: boolean | undefined;
65
+ }) => void;
66
+ onHistoryStep: (handler: (entry: HistoryEntry, direction: "undo" | "redo") => void) => void;
67
+ setHistoryHandler: (handler: HistoryHandler | null) => HistoryHandler | null;
68
+ undo: () => void;
69
+ redo: () => void;
70
+ canUndo: () => boolean;
71
+ canRedo: () => boolean;
72
+ setCamera: (camera: Camera) => void;
73
+ disableBrowserStorage: () => boolean;
74
+ setPersistenceBlocked: (blocked: boolean) => void;
75
+ persist: () => void;
76
+ persistNow: () => void;
77
+ restoreSavedDocument: () => {
78
+ restored: boolean;
79
+ notice?: string;
80
+ };
81
+ watchOtherTabs: () => () => void;
82
+ };
83
+ export type DocumentPart = ReturnType<typeof createDocument>;
84
+ export {};
@@ -0,0 +1,81 @@
1
+ import type { NodeGeometry, Point, PortSide, Rect } from '../../model/types';
2
+ import type { DocumentPart } from './document';
3
+ import type { ScenePart } from './scene';
4
+ export type Tool = 'select' | 'pan' | 'box' | 'diamond' | 'circle' | 'text' | 'container' | 'connect' | 'brush';
5
+ export declare const DRAW_TOOLS: readonly ["box", "diamond", "circle", "text", "container"];
6
+ export type DrawTool = (typeof DRAW_TOOLS)[number];
7
+ export declare const isDrawTool: (tool: Tool) => tool is DrawTool;
8
+ export interface Guide {
9
+ axis: 'x' | 'y';
10
+ value: number;
11
+ from: number;
12
+ to: number;
13
+ }
14
+ /** Visual feedback for the gesture in progress. */
15
+ export interface DragFeedback {
16
+ kind: string;
17
+ marquee?: Rect;
18
+ draw?: Rect;
19
+ guides?: Guide[];
20
+ dropTargetId?: string | null;
21
+ resizingContainer?: boolean;
22
+ /** A note being dragged: its box, and the object it would sit beside if dropped. */
23
+ text?: {
24
+ rect: Rect;
25
+ near?: string;
26
+ };
27
+ }
28
+ export declare const MIN_ZOOM = 0.08;
29
+ export declare const MAX_ZOOM = 4;
30
+ export { NodeGeometry };
31
+ export declare function createEditor(s: DocumentPart & ScenePart): {
32
+ tool: import("solid-js").Accessor<Tool>;
33
+ setToolSignal: import("solid-js").Setter<Tool>;
34
+ connectFrom: import("solid-js").Accessor<{
35
+ id: string;
36
+ side: PortSide;
37
+ } | null>;
38
+ setConnectFrom: import("solid-js").Setter<{
39
+ id: string;
40
+ side: PortSide;
41
+ } | null>;
42
+ pointer: import("solid-js").Accessor<Point | null>;
43
+ setPointer: import("solid-js").Setter<Point | null>;
44
+ drag: import("solid-js").Accessor<DragFeedback | null>;
45
+ setDrag: import("solid-js").Setter<DragFeedback | null>;
46
+ inlineEditId: import("solid-js").Accessor<string | null>;
47
+ setInlineEditId: import("solid-js").Setter<string | null>;
48
+ spaceHeld: import("solid-js").Accessor<boolean>;
49
+ setSpaceHeld: import("solid-js").Setter<boolean>;
50
+ measuredStageSize: import("solid-js").Accessor<{
51
+ width: number;
52
+ height: number;
53
+ }>;
54
+ setMeasuredStageSize: import("solid-js").Setter<{
55
+ width: number;
56
+ height: number;
57
+ }>;
58
+ reducedMotion: import("solid-js").Accessor<boolean>;
59
+ setReducedMotion: import("solid-js").Setter<boolean>;
60
+ registerCanvas: (el: SVGSVGElement) => SVGSVGElement;
61
+ canvasElement: () => SVGSVGElement | undefined;
62
+ focusCanvas: () => void | undefined;
63
+ stageSize: () => {
64
+ width: number;
65
+ height: number;
66
+ };
67
+ screenToWorld: (clientX: number, clientY: number) => Point;
68
+ canvasCenter: () => Point;
69
+ zoomAt: (factor: number, clientX?: number, clientY?: number) => void;
70
+ panBy: (dx: number, dy: number) => void;
71
+ setStageSize: (size: {
72
+ width: number;
73
+ height: number;
74
+ }) => void;
75
+ fitView: () => void;
76
+ diagramClipped: () => boolean;
77
+ fitRects: (rects: Rect[], reservedBottom?: number) => void;
78
+ revealObject: (id: string) => void;
79
+ centerSelection: () => void;
80
+ };
81
+ export type EditorPart = ReturnType<typeof createEditor>;
@@ -0,0 +1,11 @@
1
+ import type { DocumentPart } from './document';
2
+ export declare function createEmphasis(s: DocumentPart): {
3
+ states: () => import("../../model/appearance").EmphasisState[];
4
+ activeState: () => string | null;
5
+ gridOpen: import("solid-js").Accessor<boolean>;
6
+ setGridOpen: import("solid-js").Setter<boolean>;
7
+ showState: (id: string | null) => void;
8
+ stepState: (by: 1 | -1) => boolean;
9
+ drawnDoc: () => import("../../model/types").Diagram;
10
+ };
11
+ export type EmphasisPart = ReturnType<typeof createEmphasis>;
@@ -0,0 +1,98 @@
1
+ import { type Diagnostic, type Scene } from '../../dsl/compile';
2
+ import { type ShapeChange, UnstorableLayout } from '../../dsl/layout-edits';
3
+ import type { RoutingResult } from '../../engines/routing-engine.js';
4
+ import type { Diagram, LayoutSettings, RoutingSettings } from '../../model/types';
5
+ import type { DocumentPart } from './document';
6
+ import type { CanvasTextPart } from './canvas-text';
7
+ export interface FileSessionInfo {
8
+ name: string;
9
+ path: string;
10
+ source: string;
11
+ revision: string;
12
+ /** Where the file's relative links start (files only). */
13
+ root?: string;
14
+ /** Set for an example: its id. The source is never written to disk. */
15
+ example?: string;
16
+ /** The file's path relative to the served folder (files only). */
17
+ file?: string;
18
+ }
19
+ export type FileStatus = 'saved' | 'saving' | 'invalid' | 'conflict' | 'failed' | 'offline';
20
+ /** The id of the blank draft that New opens: a scratch copy with no example behind it. */
21
+ export declare const DRAFT_ID = "untitled";
22
+ /** The source scope a layout scope maps to: `root`, a group, or null for a loose selection. */
23
+ export declare function sourceScope(scope: {
24
+ scope: string;
25
+ containerId?: string;
26
+ }): string | null;
27
+ export { UnstorableLayout };
28
+ export declare function createFileSession(s: DocumentPart & CanvasTextPart): {
29
+ openSource: (source: string, onChange?: (source: string) => void) => Promise<void>;
30
+ receiveSource: (source: string) => Promise<void>;
31
+ liveSource: import("solid-js").Accessor<string>;
32
+ sourceDraft: import("solid-js").Accessor<string | null>;
33
+ fileSession: import("solid-js").Accessor<FileSessionInfo | null>;
34
+ fileMode: () => boolean;
35
+ exampleMode: () => boolean;
36
+ scratchName: () => "Draft" | "Example";
37
+ exampleEdited: () => boolean;
38
+ leaveAgreed: () => boolean;
39
+ agreeToLeave: () => undefined;
40
+ fileStatus: import("solid-js").Accessor<FileStatus>;
41
+ sourceError: import("solid-js").Accessor<{
42
+ message: string;
43
+ line: number;
44
+ } | null>;
45
+ fileScene: import("solid-js").Accessor<Scene | null>;
46
+ fileDiagnostics: () => Diagnostic[];
47
+ conflictProposal: import("solid-js").Accessor<string | null>;
48
+ movedByChange: import("solid-js").Accessor<string[]>;
49
+ fileCompiling: import("solid-js").Accessor<boolean>;
50
+ exampleRestored: () => boolean;
51
+ currentSource: () => string;
52
+ setRouteSink: (sink: {
53
+ adopt: (routes: {
54
+ fingerprint: string;
55
+ result: RoutingResult;
56
+ }) => void;
57
+ quick: (on: boolean) => void;
58
+ /** A shown revision's full routes are still on their way from the worker. */
59
+ awaiting: (on: boolean) => void;
60
+ }) => {
61
+ adopt: (routes: {
62
+ fingerprint: string;
63
+ result: RoutingResult;
64
+ }) => void;
65
+ quick: (on: boolean) => void;
66
+ /** A shown revision's full routes are still on their way from the worker. */
67
+ awaiting: (on: boolean) => void;
68
+ };
69
+ showSource: (source: string, selection?: string[] | (() => string[]), mapId?: (id: string) => string) => Promise<Scene | null>;
70
+ keepDiskVersion: () => void;
71
+ saveProposalOverDisk: () => void;
72
+ retrySave: () => undefined;
73
+ typeSource: (next: string, burst: number) => Promise<null | undefined>;
74
+ commitSource: (next: string, label: string, message: string) => Promise<boolean>;
75
+ fileBlocked: () => string | null;
76
+ sourceWithRecipe: (scope: string, settings: LayoutSettings, direction?: "right" | "down") => {
77
+ source: string;
78
+ removed: number;
79
+ };
80
+ sourceWithShape: (scope: string, change: ShapeChange) => {
81
+ source: string;
82
+ removed: number;
83
+ };
84
+ changedLines: (source: string) => string[];
85
+ changedLine: (source: string) => string;
86
+ sourceWithRouting: (routing: RoutingSettings, base?: string) => string;
87
+ projectSource: (source: string) => Promise<Diagram>;
88
+ reflowSelectedGroup: (id: string) => void;
89
+ openFileSession: (file: string) => Promise<boolean>;
90
+ prefetchFile: (file: string) => Promise<void>;
91
+ settleSave: () => Promise<void>;
92
+ closeFileSession: () => void;
93
+ openExampleSession: (id: string, title: string, source: string, key?: string) => Promise<void>;
94
+ resetExample: () => void;
95
+ markExampleSaved: () => void;
96
+ fileStatusText: () => string;
97
+ };
98
+ export type FileSessionPart = ReturnType<typeof createFileSession>;