@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.
- package/README.md +26 -2
- package/dist/LICENSE +21 -0
- package/dist/assets/engine.worker-DmHew5f6.js +6813 -0
- package/dist/assets/import-d2.worker-CnXfFXoa.js +5395 -0
- package/dist/chunks/abnfDiagram-WEYOIA3C-llcpthp5.js +87 -0
- package/dist/chunks/arc-rJj0TtXf.js +83 -0
- package/dist/chunks/architectureDiagram-ZHVYKT53-CfiXg0Lk.js +4781 -0
- package/dist/chunks/blockDiagram-RJAE7QA3-CO-14jWz.js +1440 -0
- package/dist/chunks/browser-iNhbPsGc.js +40 -0
- package/dist/chunks/c4Diagram-XDPPPE54-DYKuxA4n.js +1524 -0
- package/dist/chunks/channel-qMvPU6eH.js +5 -0
- package/dist/chunks/chunk-2E7WHVMD-BEZwsFS3.js +670 -0
- package/dist/chunks/chunk-2Q5K7J3B-gqtzQ8ux.js +18 -0
- package/dist/chunks/chunk-4EMNKR2T-MC54CXVe.js +262 -0
- package/dist/chunks/chunk-55XCU76K-DkZUAaqC.js +68 -0
- package/dist/chunks/chunk-5VM5RSS4-CaKe4sjM.js +19 -0
- package/dist/chunks/chunk-JWPE2WC7-CnAFS2xF.js +8 -0
- package/dist/chunks/chunk-VQ5W62QI-CXRv7FiX.js +19 -0
- package/dist/chunks/chunk-XXDRQBXY-B-AMQgD2.js +8 -0
- package/dist/chunks/chunk-ZCHMQSOR-BALpdc3g.js +451 -0
- package/dist/chunks/classDiagram-v2-4MYWR3UA-wPjgJTg4.js +1570 -0
- package/dist/chunks/cose-bilkent-JH36ORCC-Bbh5ggBc.js +2608 -0
- package/dist/chunks/cynefin-EF2NZ3EQ-Bt6b88hY.js +22361 -0
- package/dist/chunks/cynefinDiagram-WF24UDRP-BHWZvxoF.js +299 -0
- package/dist/chunks/cytoscape.esm-CRsF_JA3.js +18791 -0
- package/dist/chunks/dagre-NK4GIZVX-Cz37yPrT.js +2157 -0
- package/dist/chunks/defaultLocale-BgPVtth8.js +171 -0
- package/dist/chunks/diagram-CBK3MWTC-Q2R6FJ0B.js +531 -0
- package/dist/chunks/diagram-I5XIIV2D-a2Kdu_wA.js +153 -0
- package/dist/chunks/diagram-ODIL2UCW-DTWXxcOn.js +346 -0
- package/dist/chunks/diagram-PFBEJUXE-DIAQQ5KX.js +480 -0
- package/dist/chunks/diagram-RJA3I4VV-BPD0GghS.js +219 -0
- package/dist/chunks/diagram-TYUNFSNR-BmdkONfG.js +2586 -0
- package/dist/chunks/dot-importer-B23jwEkx.js +1547 -0
- package/dist/chunks/ebnfDiagram-V4P3TTPT-C5IKvYlb.js +109 -0
- package/dist/chunks/elk-QONTBCTQ-CtdQFvh2.js +49229 -0
- package/dist/chunks/erDiagram-KYQIGQAA-5wguK9Dx.js +1064 -0
- package/dist/chunks/flowDiagram-IUGLLWBU-BijvFPku.js +1771 -0
- package/dist/chunks/ganttDiagram-R7GPNTJY-BaqGPz-O.js +2729 -0
- package/dist/chunks/gitGraphDiagram-PDYL7XHY-DZfMGyHE.js +815 -0
- package/dist/chunks/graph-CKJmgLki.js +1541 -0
- package/dist/chunks/import-core-C-I1wGfw.js +145 -0
- package/dist/chunks/infoDiagram-MVDRKAX5-C2vH_59e.js +24 -0
- package/dist/chunks/init-DjUOC4st.js +16 -0
- package/dist/chunks/ishikawaDiagram-HPEHV2GE-q149MFlV.js +624 -0
- package/dist/chunks/journeyDiagram-BOSHW7O7-D-2Z3VtR.js +834 -0
- package/dist/chunks/kanban-definition-FNSA4HC5-wvAjV5ub.js +724 -0
- package/dist/chunks/katex-BsrBVQKd.js +11314 -0
- package/dist/chunks/linear-4t7D_ros.js +259 -0
- package/dist/chunks/mermaid-facade-BoLWBerE.js +289 -0
- package/dist/chunks/mermaid-importer-Cgx1IhmR.js +478 -0
- package/dist/chunks/mermaid.core-DXv6D2Sm.js +19244 -0
- package/dist/chunks/mindmap-definition-6OY57UG3-r9wTKul_.js +837 -0
- package/dist/chunks/mount-C1Xk_GQz.js +22131 -0
- package/dist/chunks/ordinal-DfAQgscy.js +61 -0
- package/dist/chunks/pegDiagram-ECIUJNBX-CmKlFWiP.js +95 -0
- package/dist/chunks/pieDiagram-GNMPY74T-DNTw_qan.js +208 -0
- package/dist/chunks/quadrantDiagram-D57K4MC3-CT_tvVub.js +1029 -0
- package/dist/chunks/railroadDiagram-Y72NRBL7-C5TUvZBe.js +77 -0
- package/dist/chunks/requirementDiagram-EQYSW5RA-C_c65aCa.js +889 -0
- package/dist/chunks/sankeyDiagram-SY24JHO5-CKcbizM1.js +859 -0
- package/dist/chunks/sequenceDiagram-BLEHNHQU-GpVnHOjf.js +2972 -0
- package/dist/chunks/sizeCapture-INFHLROL-CToN3JSu.js +46 -0
- package/dist/chunks/stateDiagram-v2-A6IESKWZ-rJYd2FfM.js +1520 -0
- package/dist/chunks/swimlanes-B3ENRKFQ-C7w5pfxG.js +4991 -0
- package/dist/chunks/swimlanesDiagram-AYQRV4AK-BpGY_bvE.js +13 -0
- package/dist/chunks/timeline-definition-JXYKGLGB-ChKFPBKc.js +1058 -0
- package/dist/chunks/usecaseDiagram-WPOLBNNX-skXH8Dcu.js +7945 -0
- package/dist/chunks/vennDiagram-Q3Y3IDCW-C5KknmJf.js +1578 -0
- package/dist/chunks/wardleyDiagram-IVAIDKWA-DY4Lkfpu.js +678 -0
- package/dist/chunks/xychartDiagram-4URNHDU4-BHScsL7h.js +1536 -0
- package/dist/element.js +36 -0
- package/dist/index.js +4 -0
- package/dist/types/src/cli/links.d.ts +4 -0
- package/dist/types/src/cli/pdf.d.ts +29 -0
- package/dist/types/src/cli/png.d.ts +23 -0
- package/dist/types/src/cli/svg.d.ts +4 -0
- package/dist/types/src/components/Icon.d.ts +14 -0
- package/dist/types/src/components/LayoutPreviewBar.d.ts +2 -0
- package/dist/types/src/components/canvas/Canvas.d.ts +15 -0
- package/dist/types/src/components/canvas/Frame.d.ts +22 -0
- package/dist/types/src/components/canvas/InlineEditor.d.ts +2 -0
- package/dist/types/src/components/canvas/Notes.d.ts +5 -0
- package/dist/types/src/components/canvas/Overlay.d.ts +2 -0
- package/dist/types/src/components/canvas/StateBar.d.ts +5 -0
- package/dist/types/src/components/canvas/TextHits.d.ts +6 -0
- package/dist/types/src/components/canvas/ZoomControls.d.ts +1 -0
- package/dist/types/src/components/canvas/text-boxes.d.ts +24 -0
- package/dist/types/src/components/controls.d.ts +88 -0
- package/dist/types/src/components/scene/EdgeView.d.ts +22 -0
- package/dist/types/src/components/scene/GroupView.d.ts +22 -0
- package/dist/types/src/components/scene/Lifelines.d.ts +15 -0
- package/dist/types/src/components/scene/LinkMark.d.ts +11 -0
- package/dist/types/src/components/scene/NodeView.d.ts +18 -0
- package/dist/types/src/components/scene/parts.d.ts +50 -0
- package/dist/types/src/components/sculpt/BrushDock.d.ts +2 -0
- package/dist/types/src/components/sculpt/TimelineDeck.d.ts +2 -0
- package/dist/types/src/components/session-context.d.ts +486 -0
- package/dist/types/src/dsl/cells.d.ts +91 -0
- package/dist/types/src/dsl/channels.d.ts +53 -0
- package/dist/types/src/dsl/compile.d.ts +162 -0
- package/dist/types/src/dsl/frame.d.ts +38 -0
- package/dist/types/src/dsl/lanes.d.ts +23 -0
- package/dist/types/src/dsl/layout-edits.d.ts +58 -0
- package/dist/types/src/dsl/legend-notes.d.ts +3 -0
- package/dist/types/src/dsl/project.d.ts +39 -0
- package/dist/types/src/dsl/source-edits.d.ts +37 -0
- package/dist/types/src/dsl/syntax.d.ts +317 -0
- package/dist/types/src/dsl/translate.d.ts +69 -0
- package/dist/types/src/editor/Editor.d.ts +6 -0
- package/dist/types/src/editor/element.d.ts +15 -0
- package/dist/types/src/editor/mount.d.ts +23 -0
- package/dist/types/src/import/browser.d.ts +3 -0
- package/dist/types/src/import/detect.d.ts +31 -0
- package/dist/types/src/import/dot-importer.d.ts +3 -0
- package/dist/types/src/import/import-core.d.ts +105 -0
- package/dist/types/src/import/mermaid-facade.d.ts +120 -0
- package/dist/types/src/import/mermaid-importer.d.ts +4 -0
- package/dist/types/src/import/mermaid-sequence.d.ts +8 -0
- package/dist/types/src/import/scratch.d.ts +3 -0
- package/dist/types/src/lib/engine-tasks.d.ts +88 -0
- package/dist/types/src/lib/font-data.d.ts +9 -0
- package/dist/types/src/lib/saved-diagram.d.ts +4 -0
- package/dist/types/src/lib/scene-cache.d.ts +4 -0
- package/dist/types/src/lib/source-hash.d.ts +7 -0
- package/dist/types/src/lib/svg-export.d.ts +15 -0
- package/dist/types/src/model/appearance.d.ts +209 -0
- package/dist/types/src/model/bounds.d.ts +19 -0
- package/dist/types/src/model/camera.d.ts +21 -0
- package/dist/types/src/model/candidates.d.ts +53 -0
- package/dist/types/src/model/colors.d.ts +22 -0
- package/dist/types/src/model/document.d.ts +24 -0
- package/dist/types/src/model/edits.d.ts +133 -0
- package/dist/types/src/model/embed.d.ts +17 -0
- package/dist/types/src/model/examples.d.ts +15 -0
- package/dist/types/src/model/font-faces.d.ts +24 -0
- package/dist/types/src/model/fonts.d.ts +47 -0
- package/dist/types/src/model/footnote.d.ts +34 -0
- package/dist/types/src/model/frame.d.ts +71 -0
- package/dist/types/src/model/geometry.d.ts +29 -0
- package/dist/types/src/model/graph.d.ts +53 -0
- package/dist/types/src/model/heading.d.ts +38 -0
- package/dist/types/src/model/icons.d.ts +2 -0
- package/dist/types/src/model/label-hits.d.ts +27 -0
- package/dist/types/src/model/labels.d.ts +88 -0
- package/dist/types/src/model/legend.d.ts +25 -0
- package/dist/types/src/model/link.d.ts +63 -0
- package/dist/types/src/model/markers.d.ts +47 -0
- package/dist/types/src/model/note.d.ts +75 -0
- package/dist/types/src/model/panels.d.ts +11 -0
- package/dist/types/src/model/rich-text.d.ts +24 -0
- package/dist/types/src/model/routes.d.ts +170 -0
- package/dist/types/src/model/samples.d.ts +11 -0
- package/dist/types/src/model/stack.d.ts +8 -0
- package/dist/types/src/model/static-scene.d.ts +15 -0
- package/dist/types/src/model/status.d.ts +84 -0
- package/dist/types/src/model/styles.d.ts +13 -0
- package/dist/types/src/model/surface.d.ts +31 -0
- package/dist/types/src/model/types.d.ts +277 -0
- package/dist/types/src/runtime/svg-renderer.d.ts +38 -0
- package/dist/types/src/server/file-session.d.ts +19 -0
- package/dist/types/src/server/workspace.d.ts +21 -0
- package/dist/types/src/state/active-session.d.ts +479 -0
- package/dist/types/src/state/commands.d.ts +529 -0
- package/dist/types/src/state/comparison.d.ts +151 -0
- package/dist/types/src/state/files.d.ts +61 -0
- package/dist/types/src/state/keyboard.d.ts +6 -0
- package/dist/types/src/state/keys.d.ts +5 -0
- package/dist/types/src/state/launch.d.ts +61 -0
- package/dist/types/src/state/links.d.ts +11 -0
- package/dist/types/src/state/session/actions.d.ts +77 -0
- package/dist/types/src/state/session/canvas-text.d.ts +24 -0
- package/dist/types/src/state/session/document.d.ts +84 -0
- package/dist/types/src/state/session/editor.d.ts +81 -0
- package/dist/types/src/state/session/emphasis.d.ts +11 -0
- package/dist/types/src/state/session/file-session.d.ts +98 -0
- package/dist/types/src/state/session/index.d.ts +496 -0
- package/dist/types/src/state/session/layout.d.ts +79 -0
- package/dist/types/src/state/session/pointer.d.ts +19 -0
- package/dist/types/src/state/session/routing.d.ts +20 -0
- package/dist/types/src/state/session/scene.d.ts +144 -0
- package/dist/types/src/state/session/sculpt.d.ts +70 -0
- package/dist/types/src/state/toast.d.ts +14 -0
- package/dist/types/src/state/ui.d.ts +39 -0
- 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.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
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
|
}
|