@draftably/editor 0.1.0 → 0.3.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 +4 -5
- package/dist/assets/engine.worker-BY9GKt7x.js +7505 -0
- package/dist/element.js +1 -1
- package/dist/index.js +20202 -2
- package/dist/types/src/cli/raster-fonts.d.ts +3 -0
- package/dist/types/src/components/controls.d.ts +8 -5
- package/dist/types/src/dsl/compile.d.ts +13 -0
- package/dist/types/src/dsl/corridors.d.ts +38 -0
- package/dist/types/src/model/types.d.ts +9 -0
- package/dist/types/src/state/canvas-commands.d.ts +169 -0
- package/dist/types/src/state/canvas-keyboard.d.ts +15 -0
- package/dist/types/src/state/links.d.ts +4 -1
- package/dist/types/src/state/workspace.d.ts +3 -0
- package/package.json +1 -1
- package/dist/assets/engine.worker-DmHew5f6.js +0 -6813
- package/dist/assets/import-d2.worker-CnXfFXoa.js +0 -5395
- package/dist/chunks/abnfDiagram-WEYOIA3C-llcpthp5.js +0 -87
- package/dist/chunks/arc-rJj0TtXf.js +0 -83
- package/dist/chunks/architectureDiagram-ZHVYKT53-CfiXg0Lk.js +0 -4781
- package/dist/chunks/blockDiagram-RJAE7QA3-CO-14jWz.js +0 -1440
- package/dist/chunks/browser-iNhbPsGc.js +0 -40
- package/dist/chunks/c4Diagram-XDPPPE54-DYKuxA4n.js +0 -1524
- package/dist/chunks/channel-qMvPU6eH.js +0 -5
- package/dist/chunks/chunk-2E7WHVMD-BEZwsFS3.js +0 -670
- package/dist/chunks/chunk-2Q5K7J3B-gqtzQ8ux.js +0 -18
- package/dist/chunks/chunk-4EMNKR2T-MC54CXVe.js +0 -262
- package/dist/chunks/chunk-55XCU76K-DkZUAaqC.js +0 -68
- package/dist/chunks/chunk-5VM5RSS4-CaKe4sjM.js +0 -19
- package/dist/chunks/chunk-JWPE2WC7-CnAFS2xF.js +0 -8
- package/dist/chunks/chunk-VQ5W62QI-CXRv7FiX.js +0 -19
- package/dist/chunks/chunk-XXDRQBXY-B-AMQgD2.js +0 -8
- package/dist/chunks/chunk-ZCHMQSOR-BALpdc3g.js +0 -451
- package/dist/chunks/classDiagram-v2-4MYWR3UA-wPjgJTg4.js +0 -1570
- package/dist/chunks/cose-bilkent-JH36ORCC-Bbh5ggBc.js +0 -2608
- package/dist/chunks/cynefin-EF2NZ3EQ-Bt6b88hY.js +0 -22361
- package/dist/chunks/cynefinDiagram-WF24UDRP-BHWZvxoF.js +0 -299
- package/dist/chunks/cytoscape.esm-CRsF_JA3.js +0 -18791
- package/dist/chunks/dagre-NK4GIZVX-Cz37yPrT.js +0 -2157
- package/dist/chunks/defaultLocale-BgPVtth8.js +0 -171
- package/dist/chunks/diagram-CBK3MWTC-Q2R6FJ0B.js +0 -531
- package/dist/chunks/diagram-I5XIIV2D-a2Kdu_wA.js +0 -153
- package/dist/chunks/diagram-ODIL2UCW-DTWXxcOn.js +0 -346
- package/dist/chunks/diagram-PFBEJUXE-DIAQQ5KX.js +0 -480
- package/dist/chunks/diagram-RJA3I4VV-BPD0GghS.js +0 -219
- package/dist/chunks/diagram-TYUNFSNR-BmdkONfG.js +0 -2586
- package/dist/chunks/dot-importer-B23jwEkx.js +0 -1547
- package/dist/chunks/ebnfDiagram-V4P3TTPT-C5IKvYlb.js +0 -109
- package/dist/chunks/elk-QONTBCTQ-CtdQFvh2.js +0 -49229
- package/dist/chunks/erDiagram-KYQIGQAA-5wguK9Dx.js +0 -1064
- package/dist/chunks/flowDiagram-IUGLLWBU-BijvFPku.js +0 -1771
- package/dist/chunks/ganttDiagram-R7GPNTJY-BaqGPz-O.js +0 -2729
- package/dist/chunks/gitGraphDiagram-PDYL7XHY-DZfMGyHE.js +0 -815
- package/dist/chunks/graph-CKJmgLki.js +0 -1541
- package/dist/chunks/import-core-C-I1wGfw.js +0 -145
- package/dist/chunks/infoDiagram-MVDRKAX5-C2vH_59e.js +0 -24
- package/dist/chunks/init-DjUOC4st.js +0 -16
- package/dist/chunks/ishikawaDiagram-HPEHV2GE-q149MFlV.js +0 -624
- package/dist/chunks/journeyDiagram-BOSHW7O7-D-2Z3VtR.js +0 -834
- package/dist/chunks/kanban-definition-FNSA4HC5-wvAjV5ub.js +0 -724
- package/dist/chunks/katex-BsrBVQKd.js +0 -11314
- package/dist/chunks/linear-4t7D_ros.js +0 -259
- package/dist/chunks/mermaid-facade-BoLWBerE.js +0 -289
- package/dist/chunks/mermaid-importer-Cgx1IhmR.js +0 -478
- package/dist/chunks/mermaid.core-DXv6D2Sm.js +0 -19244
- package/dist/chunks/mindmap-definition-6OY57UG3-r9wTKul_.js +0 -837
- package/dist/chunks/mount-C1Xk_GQz.js +0 -22131
- package/dist/chunks/ordinal-DfAQgscy.js +0 -61
- package/dist/chunks/pegDiagram-ECIUJNBX-CmKlFWiP.js +0 -95
- package/dist/chunks/pieDiagram-GNMPY74T-DNTw_qan.js +0 -208
- package/dist/chunks/quadrantDiagram-D57K4MC3-CT_tvVub.js +0 -1029
- package/dist/chunks/railroadDiagram-Y72NRBL7-C5TUvZBe.js +0 -77
- package/dist/chunks/requirementDiagram-EQYSW5RA-C_c65aCa.js +0 -889
- package/dist/chunks/sankeyDiagram-SY24JHO5-CKcbizM1.js +0 -859
- package/dist/chunks/sequenceDiagram-BLEHNHQU-GpVnHOjf.js +0 -2972
- package/dist/chunks/sizeCapture-INFHLROL-CToN3JSu.js +0 -46
- package/dist/chunks/stateDiagram-v2-A6IESKWZ-rJYd2FfM.js +0 -1520
- package/dist/chunks/swimlanes-B3ENRKFQ-C7w5pfxG.js +0 -4991
- package/dist/chunks/swimlanesDiagram-AYQRV4AK-BpGY_bvE.js +0 -13
- package/dist/chunks/timeline-definition-JXYKGLGB-ChKFPBKc.js +0 -1058
- package/dist/chunks/usecaseDiagram-WPOLBNNX-skXH8Dcu.js +0 -7945
- package/dist/chunks/vennDiagram-Q3Y3IDCW-C5KknmJf.js +0 -1578
- package/dist/chunks/wardleyDiagram-IVAIDKWA-DY4Lkfpu.js +0 -678
- package/dist/chunks/xychartDiagram-4URNHDU4-BHScsL7h.js +0 -1536
- package/dist/types/src/cli/png.d.ts +0 -23
- package/dist/types/src/import/browser.d.ts +0 -3
- package/dist/types/src/import/detect.d.ts +0 -31
- package/dist/types/src/import/dot-importer.d.ts +0 -3
- package/dist/types/src/import/import-core.d.ts +0 -105
- package/dist/types/src/import/mermaid-facade.d.ts +0 -120
- package/dist/types/src/import/mermaid-importer.d.ts +0 -4
- package/dist/types/src/import/mermaid-sequence.d.ts +0 -8
- package/dist/types/src/import/scratch.d.ts +0 -3
- package/dist/types/src/lib/source-hash.d.ts +0 -7
- package/dist/types/src/model/candidates.d.ts +0 -53
- package/dist/types/src/model/embed.d.ts +0 -17
- package/dist/types/src/model/examples.d.ts +0 -15
- package/dist/types/src/model/label-hits.d.ts +0 -27
- package/dist/types/src/model/static-scene.d.ts +0 -15
- package/dist/types/src/state/commands.d.ts +0 -529
- package/dist/types/src/state/comparison.d.ts +0 -151
- package/dist/types/src/state/files.d.ts +0 -61
- package/dist/types/src/state/keyboard.d.ts +0 -6
- package/dist/types/src/state/launch.d.ts +0 -61
- package/dist/types/src/state/ui.d.ts +0 -39
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import type { PdfOptions } from '../cli/pdf';
|
|
2
|
-
/** How PNG, SVG and copied images look. The last choice is remembered in this browser. */
|
|
3
|
-
export interface ExportLook {
|
|
4
|
-
/** PNG pixels per drawing pixel. */
|
|
5
|
-
scale: number;
|
|
6
|
-
/** Leave out the canvas color behind the drawing. */
|
|
7
|
-
transparent: boolean;
|
|
8
|
-
/** Draw the title, subtitle and key round the drawing. */
|
|
9
|
-
heading: boolean;
|
|
10
|
-
/** Carry the open file's `.draft` source. */
|
|
11
|
-
source: boolean;
|
|
12
|
-
}
|
|
13
|
-
declare const exportLook: import("solid-js").Accessor<ExportLook>;
|
|
14
|
-
export { exportLook };
|
|
15
|
-
export declare function setExportLook(patch: Partial<ExportLook>): void;
|
|
16
|
-
/**
|
|
17
|
-
* Open a PNG or SVG export that carries `.draft` source as a new scratch diagram, which the
|
|
18
|
-
* example bar offers to save as a file. Resolves false when the image carries no source.
|
|
19
|
-
*/
|
|
20
|
-
export declare function openImageSource(file: File): Promise<boolean>;
|
|
21
|
-
export declare const sceneReady: () => boolean;
|
|
22
|
-
export declare const filename: (extension: string) => string;
|
|
23
|
-
/** Open diagram JSON, an editable SVG export, or a saved layout timeline. */
|
|
24
|
-
export declare function importText(text: string, name?: string): Promise<void>;
|
|
25
|
-
/** Embed an image as a new shape, or replace the image in an existing one. */
|
|
26
|
-
export declare function insertImage(file: File, replaceId?: string | null): Promise<void>;
|
|
27
|
-
export declare function openFile(file: File | undefined, replaceImageId?: string | null): Promise<void>;
|
|
28
|
-
/** Convert before switching files; failed or cancelled imports leave the current work in place. */
|
|
29
|
-
export declare function importForeignText(text: string, name?: string): Promise<void>;
|
|
30
|
-
/**
|
|
31
|
-
* Editable SVG: the drawing plus the full diagram in a metadata element. With `onlySelection` and
|
|
32
|
-
* something selected, the image is cropped to the selected objects with a margin and no heading.
|
|
33
|
-
*/
|
|
34
|
-
export declare function exportSvg(look?: ExportLook, onlySelection?: boolean): string;
|
|
35
|
-
/** The files the PDF dialog starts with checked, in order. */
|
|
36
|
-
declare const pdfFiles: import("solid-js").Accessor<string[]>;
|
|
37
|
-
export { pdfFiles };
|
|
38
|
-
/** Open the export dialog on PDF with `paths` chosen. */
|
|
39
|
-
export declare function openPdfExport(paths: string[]): void;
|
|
40
|
-
/**
|
|
41
|
-
* Ask the server for one PDF of `paths` in order, as `draftably pdf` makes it, and download it.
|
|
42
|
-
* Throws with the server's message, such as the file whose errors stopped the export.
|
|
43
|
-
*/
|
|
44
|
-
export declare function exportPdf(paths: string[], opts: PdfOptions): Promise<void>;
|
|
45
|
-
export type ExportFormat = 'json' | 'svg' | 'png';
|
|
46
|
-
export declare function exportDocument(format: ExportFormat, look?: ExportLook, onlySelection?: boolean): Promise<void>;
|
|
47
|
-
/** What Copy puts on the clipboard: every format at once, or one thing as text. */
|
|
48
|
-
export type CopyAs = 'image' | 'svg' | 'source' | 'link';
|
|
49
|
-
/**
|
|
50
|
-
* Copy the diagram, or the selection when something is selected. `image` writes one clipboard item
|
|
51
|
-
* with PNG, SVG, HTML and the SVG markup as text, so the app it is pasted into takes the format it
|
|
52
|
-
* reads; a browser that refuses some of them gets the richest set it accepts, down to PNG alone.
|
|
53
|
-
* The other kinds copy one thing as text.
|
|
54
|
-
*/
|
|
55
|
-
export declare function copyImage(kind?: CopyAs, look?: ExportLook, onlySelection?: boolean): Promise<void>;
|
|
56
|
-
/** Formats the export dialog makes. */
|
|
57
|
-
export type ExportKind = 'png' | 'svg' | 'pdf' | 'copy';
|
|
58
|
-
declare const exportKind: import("solid-js").Accessor<ExportKind>, setExportKind: import("solid-js").Setter<ExportKind>;
|
|
59
|
-
export { exportKind, setExportKind };
|
|
60
|
-
/** Open the export dialog on `kind`. */
|
|
61
|
-
export declare function openExport(kind: ExportKind): void;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/** Global keyboard shortcuts and clipboard handling for the editor. */
|
|
2
|
-
export declare function handleKeyDown(e: KeyboardEvent): void | null;
|
|
3
|
-
export declare function handleKeyUp(e: KeyboardEvent): void;
|
|
4
|
-
export declare function handleCopy(e: ClipboardEvent): void;
|
|
5
|
-
/** Paste images, copied objects, diagram JSON, or a list of titles to build from. */
|
|
6
|
-
export declare function handlePaste(e: ClipboardEvent): Promise<void>;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import type { WorkspaceFile, WorkspaceInfo } from '../server/workspace';
|
|
2
|
-
export type LaunchMode = 'static' | 'start' | 'file' | 'example';
|
|
3
|
-
/** The served folder, or null on the static site. */
|
|
4
|
-
export declare const workspace: import("solid-js").Accessor<WorkspaceInfo | null>;
|
|
5
|
-
/** The start screen shown over the editor (the static site's first run, or File › Start). */
|
|
6
|
-
export declare const startOpen: import("solid-js").Accessor<boolean>;
|
|
7
|
-
export declare const setStartOpen: import("solid-js").Setter<boolean>;
|
|
8
|
-
/** Why the requested file or example could not be opened. */
|
|
9
|
-
export declare const launchNotice: import("solid-js").Accessor<string>;
|
|
10
|
-
/** What the page shows: the start page, or the editor on a file, an example or browser storage. */
|
|
11
|
-
export declare const launchView: import("solid-js").Accessor<LaunchMode>;
|
|
12
|
-
export declare const fileUrl: (path: string) => string;
|
|
13
|
-
export declare const exampleUrl: (id: string) => string;
|
|
14
|
-
export declare const startUrl: () => string;
|
|
15
|
-
/**
|
|
16
|
-
* A page of the public site (docs, the Playground). `draftably open` and the dev server have no
|
|
17
|
-
* site, so their links go to draftably.dev.
|
|
18
|
-
*/
|
|
19
|
-
export declare const siteUrl: (path?: string) => string;
|
|
20
|
-
/** Home: the served folder's start page, or the public site's landing page. */
|
|
21
|
-
export declare const homeUrl: () => string;
|
|
22
|
-
/** The editor was opened from the Playground, as its "Open in the editor" does. */
|
|
23
|
-
export declare const cameFromPlayground: () => boolean;
|
|
24
|
-
/** What happens to the source when it goes to the Playground, said before it goes. */
|
|
25
|
-
export declare function playgroundNote(): string;
|
|
26
|
-
/**
|
|
27
|
-
* Show the current source in the Playground. A file stays open here and the Playground opens in
|
|
28
|
-
* a new tab; an example goes in this tab, since its source is all it has.
|
|
29
|
-
*/
|
|
30
|
-
export declare function openInPlayground(): Promise<undefined>;
|
|
31
|
-
/** List the folder's diagrams again. */
|
|
32
|
-
export declare function refreshWorkspace(): Promise<void>;
|
|
33
|
-
/**
|
|
34
|
-
* Keep the folder's list current while the page is visible, so diagrams an agent or the command
|
|
35
|
-
* line writes appear without a reload. Returns a function that stops watching.
|
|
36
|
-
*/
|
|
37
|
-
export declare function watchWorkspace(intervalMs?: number): () => void;
|
|
38
|
-
/** The served file drawn as SVG. The modified time makes a changed file a new image. */
|
|
39
|
-
export declare const thumbnailUrl: (file: WorkspaceFile) => string;
|
|
40
|
-
export declare function launch(): Promise<LaunchMode>;
|
|
41
|
-
/** Write a new diagram file in the served folder. Resolves its path, or throws the reason. */
|
|
42
|
-
export declare function createDiagramFile(path: string, source: string): Promise<string>;
|
|
43
|
-
/** A file name for a title: "Billing flow" → "billing-flow.draft". */
|
|
44
|
-
export declare const fileNameFor: (title: string) => string;
|
|
45
|
-
/** Source for a new, nearly empty diagram. */
|
|
46
|
-
export declare const newDiagramSource: (title: string) => string;
|
|
47
|
-
/** Register work to close before the page shows another file, such as an open Compare. */
|
|
48
|
-
export declare const onLeaveFile: (handler: () => void) => undefined;
|
|
49
|
-
/**
|
|
50
|
-
* Open a served file, or the start page, without reloading the page, so the current drawing
|
|
51
|
-
* stays on screen until the next one is ready. Anything else (an example, another site, an edited
|
|
52
|
-
* example that the browser should ask about) loads as a normal page.
|
|
53
|
-
*/
|
|
54
|
-
export declare function go(url: string, { push }?: {
|
|
55
|
-
push?: boolean | undefined;
|
|
56
|
-
}): Promise<void>;
|
|
57
|
-
/**
|
|
58
|
-
* Route plain clicks on links to served files and the start page through `go`, and follow the
|
|
59
|
-
* browser's back and forward buttons. Returns a function that stops.
|
|
60
|
-
*/
|
|
61
|
-
export declare function navigateInPlace(): () => void;
|
|
@@ -1,39 +0,0 @@
|
|
|
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;
|