@dineug/erd-editor 3.3.1 → 3.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.
- package/README.md +197 -17
- package/dist/components/appContext.d.ts +8 -1
- package/dist/components/erd/automatic-table-placement/createAutomaticTablePlacement.d.ts +17 -1
- package/dist/components/erd/canvas/Canvas.d.ts +5 -0
- package/dist/components/erd/canvas/Canvas.styles.d.ts +11 -0
- package/dist/components/erd/canvas/CanvasScene.d.ts +18 -0
- package/dist/components/erd/canvas/EditOverlay.d.ts +8 -0
- package/dist/components/erd/canvas/EditOverlay.styles.d.ts +6 -0
- package/dist/components/erd/canvas/SceneIcon.template.d.ts +21 -0
- package/dist/components/erd/canvas/altDragDuplicate.d.ts +3 -0
- package/dist/components/erd/canvas/drag-select/DragSelect.d.ts +11 -0
- package/dist/components/erd/canvas/duplicate-ghost/DuplicateGhost.d.ts +9 -0
- package/dist/components/erd/canvas/entityDrag.d.ts +4 -0
- package/dist/components/erd/canvas/high-level-table/HighLevelTable.d.ts +4 -0
- package/dist/components/erd/canvas/memo/Memo.d.ts +2 -0
- package/dist/components/erd/canvas/memo/memo-sash/MemoSash.d.ts +11 -1
- package/dist/components/erd/canvas/memo/memoCaret.d.ts +26 -0
- package/dist/components/erd/canvas/memo/memoScroll.d.ts +28 -0
- package/dist/components/erd/canvas/memo/memoText.d.ts +33 -0
- package/dist/components/erd/canvas/memo/useMoveMemo.d.ts +6 -0
- package/dist/components/erd/canvas/relationship-group/RelationshipGroup.d.ts +15 -0
- package/dist/components/erd/canvas/relationship-group/relationship/Relationship.template.d.ts +17 -0
- package/dist/components/erd/canvas/sceneHit.d.ts +18 -0
- package/dist/components/erd/canvas/sceneKind.d.ts +11 -0
- package/dist/components/erd/canvas/sceneRetention.d.ts +31 -0
- package/dist/components/erd/canvas/sceneTokens.d.ts +67 -0
- package/dist/components/erd/canvas/shared-drag-select/SharedDragSelect.d.ts +8 -0
- package/dist/components/erd/canvas/shared-mouse-tracker/SharedMouseTracker.d.ts +1 -0
- package/dist/components/erd/canvas/shared-mouse-tracker/shared-mouse-cursor/SharedMouseCursor.d.ts +5 -0
- package/dist/components/erd/canvas/table/Table.d.ts +8 -0
- package/dist/components/erd/canvas/table/cellLayout.d.ts +63 -0
- package/dist/components/erd/canvas/table/column/Column.d.ts +23 -6
- package/dist/components/erd/canvas/table/doubleClick.d.ts +14 -0
- package/dist/components/erd/canvas/table/useMoveTable.d.ts +1 -1
- package/dist/components/erd/canvas/table/useSharedFocusTable.d.ts +6 -0
- package/dist/components/erd/canvas/useMoveEntity.d.ts +18 -0
- package/dist/components/erd/canvas/useSharedSelectEntity.d.ts +4 -0
- package/dist/components/erd/erd-context-menu/ErdContextMenu.d.ts +1 -2
- package/dist/components/erd/erd-context-menu/menus/drawRelationshipMenus.d.ts +3 -2
- package/dist/components/erd/erd-context-menu/menus/exportMenus.d.ts +7 -6
- package/dist/components/erd/erd-context-menu/menus/importMenus.d.ts +6 -6
- package/dist/components/erd/erd-context-menu/menus/relationshipMenus.d.ts +1 -1
- package/dist/components/erd/hide-sign/hideSignBounds.d.ts +9 -0
- package/dist/components/erd/hitTest.d.ts +22 -0
- package/dist/components/erd/minimap/Minimap.styles.d.ts +0 -1
- package/dist/components/erd/minimap/MinimapScene.d.ts +16 -0
- package/dist/components/erd/minimap/memo/Memo.d.ts +5 -0
- package/dist/components/erd/minimap/minimapGeometry.d.ts +52 -0
- package/dist/components/erd/minimap/table/Table.d.ts +5 -0
- package/dist/components/erd/table-properties/table-properties-indexes/indexes-checkbox-column/IndexesCheckboxColumn.d.ts +1 -1
- package/dist/components/erd/virtual-scroll/useVirtualScroll.d.ts +19 -0
- package/dist/components/erd-editor/ErdEditor.d.ts +4 -0
- package/dist/components/erd-editor/ErdEditor.stories.d.ts +1 -1
- package/dist/components/global-styles/GlobalStyles.d.ts +5 -0
- package/dist/components/primitives/button/Button.stories.d.ts +4 -4
- package/dist/components/primitives/code-block/CodeBlock.stories.d.ts +4 -4
- package/dist/components/primitives/code-block/CodeBlock.styles.d.ts +6 -1
- package/dist/components/primitives/color-picker/ColorPicker.d.ts +1 -1
- package/dist/components/primitives/color-picker/ColorPicker.stories.d.ts +1 -1
- package/dist/components/primitives/context-menu/ContextMenu.stories.d.ts +1 -1
- package/dist/components/primitives/context-menu/context-menu-item/ContextMenuItem.d.ts +1 -1
- package/dist/components/primitives/context-menu/menu/Menu.d.ts +2 -2
- package/dist/components/primitives/edit-input/EditInput.d.ts +2 -2
- package/dist/components/primitives/edit-input/EditInput.stories.d.ts +6 -6
- package/dist/components/primitives/highlighted-text/HighlightedText.stories.d.ts +1 -1
- package/dist/components/primitives/icon/Icon.d.ts +2 -3
- package/dist/components/primitives/icon/Icon.stories.d.ts +3 -1
- package/dist/components/primitives/icon/icons.d.ts +95 -26
- package/dist/components/primitives/kbd/Kbd.stories.d.ts +3 -3
- package/dist/components/primitives/sash/Sash.stories.d.ts +6 -6
- package/dist/components/primitives/separator/Separator.stories.d.ts +3 -3
- package/dist/components/primitives/slider/Slider.stories.d.ts +4 -4
- package/dist/components/primitives/switch/Switch.stories.d.ts +3 -3
- package/dist/components/primitives/text-input/TextInput.d.ts +1 -1
- package/dist/components/primitives/text-input/TextInput.stories.d.ts +7 -7
- package/dist/components/primitives/toast/Toast.d.ts +4 -0
- package/dist/components/primitives/toast/Toast.stories.d.ts +17 -4
- package/dist/components/primitives/toast/Toast.styles.d.ts +5 -0
- package/dist/components/{erd/canvas/table → table-view}/column/column-data-type/ColumnDataType.d.ts +4 -4
- package/dist/components/{erd/canvas/table → table-view}/column/column-not-null/ColumnNotNull.d.ts +1 -1
- package/dist/components/{erd/canvas/table → table-view}/column/column-option/ColumnOption.d.ts +1 -1
- package/dist/components/table-view/column/useColumnCell.d.ts +23 -0
- package/dist/components/themeContext.d.ts +9 -0
- package/dist/components/toast-container/openToastWhileRunning.d.ts +11 -0
- package/dist/components/visualization/Visualization.d.ts +6 -0
- package/dist/components/visualization/Visualization.styles.d.ts +6 -0
- package/dist/components/visualization/VisualizationScene.d.ts +21 -0
- package/dist/components/visualization/createVisualization.d.ts +67 -8
- package/dist/components/visualization/graph-node/GraphNode.d.ts +23 -0
- package/dist/components/visualization/table/Table.d.ts +0 -1
- package/dist/components/visualization/table/column/Column.d.ts +0 -1
- package/dist/components/visualization/visualizationView.d.ts +90 -0
- package/dist/constants/language.d.ts +7 -1
- package/dist/constants/layout.d.ts +13 -0
- package/dist/constants/schema.d.ts +12 -3
- package/dist/constants/sql/dataType/Databricks.d.ts +5 -0
- package/dist/constants/sql/dataType/MSSQL.d.ts +1 -1
- package/dist/constants/sql/dataType/MySQL.d.ts +1 -1
- package/dist/constants/sql/dataType/Oracle.d.ts +1 -1
- package/dist/constants/sql/dataType/Snowflake.d.ts +5 -0
- package/dist/constants/sql/database.d.ts +2 -0
- package/dist/engine/history.d.ts +5 -3
- package/dist/engine/hooks.d.ts +3 -3
- package/dist/engine/modules/editor/actions.d.ts +30 -1
- package/dist/engine/modules/editor/atom.actions.d.ts +131 -0
- package/dist/engine/modules/editor/generator.actions.d.ts +18 -0
- package/dist/engine/modules/editor/state.d.ts +43 -0
- package/dist/engine/modules/editor/utils/duplicate.d.ts +13 -0
- package/dist/engine/modules/memo/actions.d.ts +3 -0
- package/dist/engine/modules/memo/atom.actions.d.ts +12 -0
- package/dist/engine/modules/settings/atom.actions.d.ts +24 -0
- package/dist/engine/modules/table/actions.d.ts +1 -0
- package/dist/engine/modules/table/atom.actions.d.ts +4 -0
- package/dist/engine.js +40 -51
- package/dist/erd-editor.js +40775 -26895
- package/dist/konva/batchDraw.d.ts +41 -0
- package/dist/konva/host.d.ts +29 -0
- package/dist/konva/scene/columnDropTarget.d.ts +13 -0
- package/dist/konva/scene/konvaFlip.d.ts +18 -0
- package/dist/konva/scene/metrics.d.ts +29 -0
- package/dist/konva/scene/renderScene.d.ts +34 -0
- package/dist/konva/scene/viewport.d.ts +38 -0
- package/dist/konva/testHandle.d.ts +22 -0
- package/dist/konva/theme.d.ts +31 -0
- package/dist/konva/workerDomStubs.d.ts +1 -0
- package/dist/schemaGCService-DrlqIen8.js +17549 -0
- package/dist/services/export-png/ExportScene.d.ts +9 -0
- package/dist/services/export-png/documentScene.d.ts +20 -0
- package/dist/services/export-png/exportPng.shared-worker.d.ts +0 -0
- package/dist/services/export-png/exportPngService.d.ts +24 -0
- package/dist/services/export-png/index.d.ts +48 -0
- package/dist/services/export-png/pixelRatio.d.ts +21 -0
- package/dist/services/export-png/renderPng.d.ts +37 -0
- package/dist/services/export-png/textWidth.d.ts +27 -0
- package/dist/services/schema-gc/index.d.ts +5 -0
- package/dist/services/shikiService.d.ts +1 -1
- package/dist/styles/colorPicker.style.d.ts +6 -1
- package/dist/styles/fonts.styles.d.ts +2 -1
- package/dist/styles/reset.styles.d.ts +5 -1
- package/dist/styles/scrollbar.styles.d.ts +6 -1
- package/dist/styles/typography.styles.d.ts +2 -1
- package/dist/themes/radix-ui-theme.d.ts +1 -1
- package/dist/themes/tokens.d.ts +6 -2
- package/dist/utils/calcTable.d.ts +7 -0
- package/dist/utils/draw-relationship/chamfer.d.ts +2 -0
- package/dist/utils/draw-relationship/incremental.d.ts +70 -0
- package/dist/utils/draw-relationship/index.d.ts +78 -14
- package/dist/utils/draw-relationship/nudge.d.ts +4 -0
- package/dist/utils/draw-relationship/pathFinding.d.ts +7 -1
- package/dist/utils/draw-relationship/route.d.ts +27 -0
- package/dist/utils/draw-relationship/stub.d.ts +36 -0
- package/dist/utils/emitter.d.ts +32 -0
- package/dist/utils/file/exportFile.d.ts +10 -1
- package/dist/utils/file/importFile.d.ts +4 -1
- package/dist/utils/focus.d.ts +5 -3
- package/dist/utils/generator-code/aml.d.ts +4 -0
- package/dist/utils/generator-code/dbml.d.ts +4 -0
- package/dist/utils/generator-code/drizzle.d.ts +4 -0
- package/dist/utils/generator-code/go.d.ts +4 -0
- package/dist/utils/generator-code/sequelize.d.ts +4 -0
- package/dist/utils/generator-code/sqlalchemy.d.ts +4 -0
- package/dist/utils/generator-code/typeorm.d.ts +4 -0
- package/dist/utils/globalEventObservable.d.ts +13 -12
- package/dist/utils/icon.d.ts +9 -1
- package/dist/utils/keyboard-shortcut/index.d.ts +7 -1
- package/dist/utils/promise.d.ts +1 -0
- package/dist/utils/schema-aml-parser/convert.d.ts +4 -0
- package/dist/utils/schema-aml-parser/dataType.d.ts +12 -0
- package/dist/utils/schema-aml-parser/index.d.ts +3 -0
- package/dist/utils/schema-aml-parser/parser.d.ts +2 -0
- package/dist/utils/schema-aml-parser/tokenizer.d.ts +23 -0
- package/dist/utils/schema-aml-parser/types.d.ts +78 -0
- package/dist/utils/schema-dbml-parser/convert.d.ts +4 -0
- package/dist/utils/schema-dbml-parser/dataType.d.ts +7 -0
- package/dist/utils/schema-dbml-parser/index.d.ts +3 -0
- package/dist/utils/schema-dbml-parser/parser.d.ts +2 -0
- package/dist/utils/schema-dbml-parser/tokenizer.d.ts +16 -0
- package/dist/utils/schema-dbml-parser/types.d.ts +62 -0
- package/dist/utils/schema-graphql-parser/convert.d.ts +4 -0
- package/dist/utils/schema-graphql-parser/dataType.d.ts +7 -0
- package/dist/utils/schema-graphql-parser/index.d.ts +3 -0
- package/dist/utils/schema-graphql-parser/parser.d.ts +2 -0
- package/dist/utils/schema-graphql-parser/types.d.ts +58 -0
- package/dist/utils/schema-sql/Databricks.d.ts +5 -0
- package/dist/utils/schema-sql/Snowflake.d.ts +5 -0
- package/dist/utils/sharedColor.d.ts +2 -0
- package/dist/utils/table-clipboard/copy.d.ts +7 -0
- package/dist/utils/table-clipboard/index.d.ts +2 -0
- package/dist/utils/table-clipboard/paste.d.ts +3 -0
- package/dist/utils/table-clipboard/payload.d.ts +83 -0
- package/dist/utils/table-clipboard/placement.d.ts +30 -0
- package/dist/utils/validation.d.ts +1 -0
- package/package.json +34 -29
- package/dist/components/erd/canvas/canvas-svg/CanvasSvg.d.ts +0 -7
- package/dist/components/erd/canvas/canvas-svg/relationship/Relationship.template.d.ts +0 -3
- package/dist/components/erd/canvas/draw-relationship/DrawRelationship.styles.d.ts +0 -1
- package/dist/components/erd/canvas/high-level-table/HighLevelTable.styles.d.ts +0 -1
- package/dist/components/erd/canvas/memo/Memo.styles.d.ts +0 -6
- package/dist/components/erd/canvas/shared-mouse-tracker/shared-mouse-cursor/SharedMouseCursor.styles.d.ts +0 -1
- package/dist/components/erd/canvas/table/column/Column.styles.d.ts +0 -2
- package/dist/components/erd/drag-select/DragSelect.d.ts +0 -9
- package/dist/components/erd/drag-select/DragSelect.styles.d.ts +0 -1
- package/dist/schemaGCService-Br6jn6B2.js +0 -15866
- /package/dist/components/erd/canvas/{canvas-svg → relationship-group}/relationship/Relationship.d.ts +0 -0
- /package/dist/components/{erd/canvas/table → table-view}/Table.styles.d.ts +0 -0
- /package/dist/components/{erd/canvas/canvas-svg/CanvasSvg.styles.d.ts → table-view/column/Column.styles.d.ts} +0 -0
- /package/dist/components/{erd/canvas/table → table-view}/column/column-data-type/ColumnDataType.styles.d.ts +0 -0
- /package/dist/components/{erd/canvas/table → table-view}/column/column-key/ColumnKey.d.ts +0 -0
- /package/dist/components/{erd/canvas/table → table-view}/column/column-key/ColumnKey.styles.d.ts +0 -0
- /package/dist/components/{erd/canvas/table → table-view}/column/column-not-null/ColumnNotNull.styles.d.ts +0 -0
- /package/dist/components/{erd/canvas/table → table-view}/column/column-option/ColumnOption.styles.d.ts +0 -0
- /package/dist/{services/schema-gc/schemaGC.worker.d.ts → konva/jsx-types.test-d.d.ts} +0 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FC } from '@dineug/r-html';
|
|
2
|
+
export type ExportSceneProps = {};
|
|
3
|
+
/**
|
|
4
|
+
* The whole canvas box on one layer, with no culling and no zoom. An exported
|
|
5
|
+
* image is not a picture of the screen, so nothing here reads the scroll, the
|
|
6
|
+
* zoom or the viewport the editor's own scene is placed with.
|
|
7
|
+
*/
|
|
8
|
+
declare const ExportScene: FC<ExportSceneProps>;
|
|
9
|
+
export default ExportScene;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Stage } from 'konva/lib/Stage';
|
|
2
|
+
import { Theme } from '../../themes/tokens';
|
|
3
|
+
export type DocumentSceneOptions = {
|
|
4
|
+
doc: string;
|
|
5
|
+
theme: Theme;
|
|
6
|
+
toWidth: (text: string) => number;
|
|
7
|
+
};
|
|
8
|
+
export type DocumentScene = {
|
|
9
|
+
stage: Stage;
|
|
10
|
+
destroy: () => void;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* The whole document on a Stage of its own, off any screen. The store is built
|
|
14
|
+
* here rather than borrowed so the editor's scroll, zoom and selection cannot
|
|
15
|
+
* reach the image, which is the whole difference between this and a screenshot.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* const scene = await renderDocumentScene({ doc, theme, toWidth });
|
|
19
|
+
*/
|
|
20
|
+
export declare function renderDocumentScene({ doc, theme, toWidth, }: DocumentSceneOptions): Promise<DocumentScene>;
|
|
File without changes
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { RenderPngRequest, RenderPngResult } from './renderPng';
|
|
2
|
+
/**
|
|
3
|
+
* A png request as it crosses a realm boundary. The measurement itself cannot
|
|
4
|
+
* cross, so what travels is the widths the asking realm read for the probe
|
|
5
|
+
* strings and the answering realm has to reproduce them.
|
|
6
|
+
*/
|
|
7
|
+
export type ExportPngRequest = RenderPngRequest & {
|
|
8
|
+
fontProbe: number[];
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Draws a document off the thread that asked for it. Text is measured here
|
|
12
|
+
* rather than sent, because a table's reserved widths were laid out by a
|
|
13
|
+
* measurement, and a picture drawn by a different one does not fit them.
|
|
14
|
+
*/
|
|
15
|
+
export declare class ExportPngService {
|
|
16
|
+
/**
|
|
17
|
+
* What this realm lays the probe strings out to. Answering it at all proves
|
|
18
|
+
* the module graph evaluated here, which is the failure a shared worker
|
|
19
|
+
* reports to nobody: its port stays open and every call after it hangs.
|
|
20
|
+
*/
|
|
21
|
+
probeFontWidths(): Promise<number[]>;
|
|
22
|
+
render(request: ExportPngRequest): Promise<RenderPngResult>;
|
|
23
|
+
private createToWidth;
|
|
24
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Theme } from '../../themes/tokens';
|
|
2
|
+
import { ResolutionReduction } from './renderPng';
|
|
3
|
+
import { ToWidth } from './textWidth';
|
|
4
|
+
export type { ResolutionReduction };
|
|
5
|
+
/** Which thread drew the image, which is the one thing a Promise cannot say. */
|
|
6
|
+
export type ExportPngRealm = 'worker' | 'main';
|
|
7
|
+
/**
|
|
8
|
+
* Where an export has got to. Started fires before any drawing begins, and
|
|
9
|
+
* again naming the main thread if the worker it first named gave way; finished
|
|
10
|
+
* fires once, and only after a blob exists.
|
|
11
|
+
*/
|
|
12
|
+
export type ExportPngProgress = {
|
|
13
|
+
phase: 'started';
|
|
14
|
+
realm: ExportPngRealm;
|
|
15
|
+
} | {
|
|
16
|
+
phase: 'finished';
|
|
17
|
+
realm: ExportPngRealm;
|
|
18
|
+
width: number;
|
|
19
|
+
height: number;
|
|
20
|
+
};
|
|
21
|
+
export type DocumentPngOptions = {
|
|
22
|
+
doc: string;
|
|
23
|
+
theme: Theme;
|
|
24
|
+
/**
|
|
25
|
+
* How the editor measures a string. A realm that draws the document has to
|
|
26
|
+
* reproduce this to the pixel, so it is passed to be compared against rather
|
|
27
|
+
* than to be called across a boundary a function does not cross.
|
|
28
|
+
*/
|
|
29
|
+
toWidth: ToWidth;
|
|
30
|
+
pixelRatio?: number;
|
|
31
|
+
/**
|
|
32
|
+
* Called once, after a file exists, when the box outran what a canvas holds
|
|
33
|
+
* and the image had to be scaled down. A caller with somewhere to put it is
|
|
34
|
+
* what turns a silent loss of resolution into something the author is told.
|
|
35
|
+
*/
|
|
36
|
+
onResolutionReduced?: (reduction: ResolutionReduction) => void;
|
|
37
|
+
/** Called as the export moves, for a caller that shows it is running. */
|
|
38
|
+
onProgress?: (progress: ExportPngProgress) => void;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* A png of the whole canvas box, whatever the editor is scrolled or zoomed to.
|
|
42
|
+
* The scene is drawn again from the document rather than read off the screen,
|
|
43
|
+
* which is what makes the image the same however the editor is being viewed.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* const blob = await createDocumentPng({ doc: toJson(store.state), theme, toWidth });
|
|
47
|
+
*/
|
|
48
|
+
export declare function createDocumentPng({ doc, theme, toWidth, pixelRatio, onResolutionReduced, onProgress, }: DocumentPngOptions): Promise<Blob>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The largest raster a browser canvas will hold, as area rather than as one
|
|
3
|
+
* side. Chromium and WebKit both stop at exactly this many pixels however the
|
|
4
|
+
* box is shaped, and Firefox stops well above it, so this is the shared floor.
|
|
5
|
+
*/
|
|
6
|
+
export declare const CANVAS_AREA_MAX: number;
|
|
7
|
+
/**
|
|
8
|
+
* The longest single side, kept at half of the 65535 every engine measured here
|
|
9
|
+
* accepted. The margin is spent on the side rather than the area because no box
|
|
10
|
+
* the schema allows reaches it at one image pixel per canvas unit.
|
|
11
|
+
*/
|
|
12
|
+
export declare const CANVAS_SIDE_MAX = 32767;
|
|
13
|
+
/**
|
|
14
|
+
* The ratio that keeps a raster of that box inside what a canvas can hold. A
|
|
15
|
+
* tall box is bounded by its area, so a document narrow enough to fit under the
|
|
16
|
+
* ceiling keeps every pixel it was written with instead of being scaled down.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* fitPixelRatio(1, 20000, 20000);
|
|
20
|
+
*/
|
|
21
|
+
export declare function fitPixelRatio(pixelRatio: number, width: number, height: number): number;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Theme } from '../../themes/tokens';
|
|
2
|
+
import { ToWidth } from './textWidth';
|
|
3
|
+
/** The box that was asked for and the raster that fitted inside a canvas. */
|
|
4
|
+
export type ResolutionReduction = {
|
|
5
|
+
documentWidth: number;
|
|
6
|
+
documentHeight: number;
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
};
|
|
10
|
+
/** Everything a png needs that survives a structured clone to another realm. */
|
|
11
|
+
export type RenderPngRequest = {
|
|
12
|
+
doc: string;
|
|
13
|
+
theme: Theme;
|
|
14
|
+
pixelRatio: number;
|
|
15
|
+
};
|
|
16
|
+
export type RenderPngResult = {
|
|
17
|
+
blob: Blob;
|
|
18
|
+
width: number;
|
|
19
|
+
height: number;
|
|
20
|
+
/**
|
|
21
|
+
* Null when the box kept every pixel it was written with. A realm that drew
|
|
22
|
+
* the image is the only one that knows this, so it is carried back rather
|
|
23
|
+
* than recomputed by whoever asked for the file.
|
|
24
|
+
*/
|
|
25
|
+
reduction: ResolutionReduction | null;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* The whole document rastered, in whichever realm calls it. Nothing here reads
|
|
29
|
+
* a window, a screen or a stylesheet, so the same code answers on the main
|
|
30
|
+
* thread and inside the worker that keeps the main thread free.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* const { blob } = await renderDocumentPng({ doc, theme, pixelRatio: 1, toWidth });
|
|
34
|
+
*/
|
|
35
|
+
export declare function renderDocumentPng({ doc, theme, pixelRatio, toWidth, }: RenderPngRequest & {
|
|
36
|
+
toWidth: ToWidth;
|
|
37
|
+
}): Promise<RenderPngResult>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** How the editor measures a string, which is what a table reserves room by. */
|
|
2
|
+
export type ToWidth = (text: string) => number;
|
|
3
|
+
/** The shorthand utils/text.ts sets on the context it measures with. */
|
|
4
|
+
export declare const SCENE_FONT: string;
|
|
5
|
+
/**
|
|
6
|
+
* Strings a divergence in font resolution shows up in. Latin covers the head of
|
|
7
|
+
* the family list, the ideographs cover whatever the host falls through to for
|
|
8
|
+
* them, and the punctuation covers a face that carries only part of the range.
|
|
9
|
+
*/
|
|
10
|
+
export declare const FONT_PROBE_TEXTS: readonly ["ERD editor 0123456789", "가나다 漢字 テスト", "—…€· iIlL1"];
|
|
11
|
+
/**
|
|
12
|
+
* The same measurement utils/text.ts makes, on a canvas no document holds. A
|
|
13
|
+
* realm off the screen has no element to fall back to, so a realm with no 2d
|
|
14
|
+
* context has no way to lay a document out and says so rather than guessing.
|
|
15
|
+
*/
|
|
16
|
+
export declare function createOffscreenToWidth(): ToWidth | null;
|
|
17
|
+
/**
|
|
18
|
+
* What the probe strings measure under one realm's font resolution. Comparing
|
|
19
|
+
* two of these is the only gate that fires: a worker's fonts.load resolves for
|
|
20
|
+
* a family it does not have, and fonts.check answers true for one nobody has.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* measureFontProbe(toWidth);
|
|
24
|
+
*/
|
|
25
|
+
export declare function measureFontProbe(toWidth: ToWidth): number[];
|
|
26
|
+
/** Whether two realms lay the probe strings out to the same pixel. */
|
|
27
|
+
export declare function sameFontProbe(a: number[], b: number[]): boolean;
|
|
@@ -7,4 +7,9 @@ export type GCIds = {
|
|
|
7
7
|
indexColumnIds: string[];
|
|
8
8
|
memoIds: string[];
|
|
9
9
|
};
|
|
10
|
+
/**
|
|
11
|
+
* Runs the collector off the main thread where a host builds a shared worker.
|
|
12
|
+
* There is no dedicated Worker rung between the two, because an inline worker
|
|
13
|
+
* import is a second copy of this whole service in the bundle.
|
|
14
|
+
*/
|
|
10
15
|
export declare function getSchemaGCService(): SchemaGCService | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type ShikiService = {
|
|
2
2
|
codeToHtml(code: string, { lang, theme, }: {
|
|
3
|
-
lang: 'sql' | 'typescript' | 'graphql' | 'csharp' | 'java' | 'kotlin' | 'scala';
|
|
3
|
+
lang: 'sql' | 'typescript' | 'graphql' | 'csharp' | 'java' | 'kotlin' | 'scala' | 'go' | 'python';
|
|
4
4
|
theme?: 'dark' | 'light';
|
|
5
5
|
}): Promise<string>;
|
|
6
6
|
};
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Vendored from https://github.com/easylogic/colorpicker. Global, not scoped:
|
|
3
|
+
* the upstream library builds its own markup at runtime, so every selector below
|
|
4
|
+
* matches literal class names that scoping would rename out from under it.
|
|
5
|
+
*/
|
|
6
|
+
export declare const colorPickerStyle: import('@dineug/r-html').CSSTemplateLiterals;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export declare const TextFontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', 'Open Sans', system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'";
|
|
2
2
|
export declare const CodeFontFamily: "'Menlo', 'Consolas', 'Bitstream Vera Sans Mono', monospace, 'Apple Color Emoji', 'Segoe UI Emoji'";
|
|
3
|
-
|
|
3
|
+
/** Global, not scoped: :host is the shadow host, which no component class matches. */
|
|
4
|
+
export declare const fontsStyle: import('@dineug/r-html').CSSTemplateLiterals;
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Global, not scoped: every selector here is a type selector, the universal selector or :host,
|
|
3
|
+
* none of which survives having a component class prepended to it.
|
|
4
|
+
*/
|
|
5
|
+
export declare const resetStyle: import('@dineug/r-html').CSSTemplateLiterals;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Global, not scoped. The ::-webkit-scrollbar* pseudo elements have no element of their own to
|
|
3
|
+
* hang a component class on, and .scrollbar is a hook class seven components opt into by
|
|
4
|
+
* literal name (class=${['scrollbar', ...]}) — scoping it would rename it out from under them.
|
|
5
|
+
*/
|
|
6
|
+
export declare const scrollbarStyle: import('@dineug/r-html').CSSTemplateLiterals;
|
|
@@ -11,4 +11,5 @@ export declare const typography: {
|
|
|
11
11
|
readonly normal: import('@dineug/r-html').CSSTemplateLiterals;
|
|
12
12
|
readonly paragraph: import('@dineug/r-html').CSSTemplateLiterals;
|
|
13
13
|
};
|
|
14
|
-
|
|
14
|
+
/** Global, not scoped: :host is the shadow host, which no component class matches. */
|
|
15
|
+
export declare const typographyStyle: import('@dineug/r-html').CSSTemplateLiterals;
|
|
@@ -1783,7 +1783,7 @@ export declare const AccentColor: {
|
|
|
1783
1783
|
readonly sky: "sky";
|
|
1784
1784
|
};
|
|
1785
1785
|
export type AccentColor = ValuesType<typeof AccentColor>;
|
|
1786
|
-
export declare const AccentColorList: ("gray" | "gold" | "bronze" | "brown" | "yellow" | "amber" | "orange" | "tomato" | "red" | "
|
|
1786
|
+
export declare const AccentColorList: ("ruby" | "gray" | "gold" | "bronze" | "brown" | "yellow" | "amber" | "orange" | "tomato" | "red" | "crimson" | "pink" | "plum" | "purple" | "violet" | "iris" | "indigo" | "blue" | "cyan" | "teal" | "jade" | "green" | "grass" | "lime" | "mint" | "sky")[];
|
|
1787
1787
|
export type ThemeOptions = {
|
|
1788
1788
|
appearance: Appearance;
|
|
1789
1789
|
grayColor: GrayColor;
|
package/dist/themes/tokens.d.ts
CHANGED
|
@@ -45,8 +45,8 @@ export type Theme = {
|
|
|
45
45
|
minimapViewportBorderHover: string;
|
|
46
46
|
toastBackground: string;
|
|
47
47
|
toastBorder: string;
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
dragSelectBackground: string;
|
|
49
|
+
dragSelectBorder: string;
|
|
50
50
|
scrollbarTrack: string;
|
|
51
51
|
scrollbarThumb: string;
|
|
52
52
|
scrollbarThumbHover: string;
|
|
@@ -66,4 +66,8 @@ export type Theme = {
|
|
|
66
66
|
diffCrossForeground: string;
|
|
67
67
|
};
|
|
68
68
|
export declare const ThemeTokens: ReadonlyArray<keyof Theme>;
|
|
69
|
+
/** The custom property one token is published under on :host. */
|
|
70
|
+
export declare const toThemeVariableName: (token: string) => string;
|
|
71
|
+
/** The custom property a host document overrides that token through. */
|
|
72
|
+
export declare const toThemeOverrideVariableName: (token: string) => string;
|
|
69
73
|
export declare const themeToTokensString: (theme: Theme) => string;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { EngineContext } from '../engine/context';
|
|
2
2
|
import { RootState } from '../engine/state';
|
|
3
3
|
import { Table } from '../internal-types';
|
|
4
|
+
export declare function getWidthGeneration(): number;
|
|
5
|
+
/**
|
|
6
|
+
* Invalidates every cached table size. Called from recalculateTableWidth,
|
|
7
|
+
* which rewrites widths without dispatching an action, and from the
|
|
8
|
+
* relationship-sort hook for any action that is not a pure move.
|
|
9
|
+
*/
|
|
10
|
+
export declare function invalidateTableWidths(): void;
|
|
4
11
|
export declare function calcTableWidths(table: Table, { settings: { show, maxWidthComment }, collections }: RootState): ColumnWidth;
|
|
5
12
|
export type ColumnWidth = {
|
|
6
13
|
width: number;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { RootState } from '../../engine/state';
|
|
2
|
+
import { Point } from '../../internal-types';
|
|
3
|
+
import { Obstacles } from './route';
|
|
4
|
+
export type DirtyBox = {
|
|
5
|
+
left: number;
|
|
6
|
+
top: number;
|
|
7
|
+
right: number;
|
|
8
|
+
bottom: number;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* A route and the inputs it was computed from, so the next sort can tell whether
|
|
12
|
+
* anything it reads has moved. Anchors are recomputed in full every sort, so the
|
|
13
|
+
* turning points below are what a changed anchor shows up as.
|
|
14
|
+
*/
|
|
15
|
+
export type RouteEntry = {
|
|
16
|
+
mx: number;
|
|
17
|
+
my: number;
|
|
18
|
+
mDirection: number;
|
|
19
|
+
lx: number;
|
|
20
|
+
ly: number;
|
|
21
|
+
lDirection: number;
|
|
22
|
+
startTableId: string;
|
|
23
|
+
endTableId: string;
|
|
24
|
+
/** The router's own output, before nudgeRoutes pushed anything apart. */
|
|
25
|
+
pristine: Point[];
|
|
26
|
+
/** What was finally drawn, which is what a reused group is put back onto. */
|
|
27
|
+
nudged: Point[];
|
|
28
|
+
bounds: DirtyBox;
|
|
29
|
+
};
|
|
30
|
+
export type SortCache = {
|
|
31
|
+
boxes: Map<string, DirtyBox>;
|
|
32
|
+
entries: Map<string, RouteEntry>;
|
|
33
|
+
};
|
|
34
|
+
export declare function getSortCache(state: RootState): SortCache;
|
|
35
|
+
export declare function boundsOfPoints(points: Point[]): DirtyBox;
|
|
36
|
+
/**
|
|
37
|
+
* Whether a moved table can change a route. The bounding box rather than the
|
|
38
|
+
* runs inside it: the router picks its lanes from every table reaching into the
|
|
39
|
+
* band between the two anchors, not only from the ones the route passes.
|
|
40
|
+
*/
|
|
41
|
+
export declare function routeTouches(bounds: DirtyBox, boxes: DirtyBox[]): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Where this sort changed something, as lanes rather than as areas. Everything
|
|
44
|
+
* nudgeRoutes decides is decided one axis at a time, so a change is only ever
|
|
45
|
+
* felt by segments sharing that axis within a few lanes of it.
|
|
46
|
+
*/
|
|
47
|
+
export type DirtyLanes = {
|
|
48
|
+
markSpan(vertical: boolean, from: number, to: number, low: number, high: number): void;
|
|
49
|
+
markBox(box: DirtyBox): void;
|
|
50
|
+
hits(vertical: boolean, from: number, to: number, low: number, high: number): boolean;
|
|
51
|
+
};
|
|
52
|
+
export declare function createDirtyLanes(): DirtyLanes;
|
|
53
|
+
/** Marks every axis-aligned run of a polyline as changed. */
|
|
54
|
+
export declare function markRoute(lanes: DirtyLanes, points: Point[]): void;
|
|
55
|
+
/**
|
|
56
|
+
* What nudgeRoutes needs to leave an untouched group where it already was: the
|
|
57
|
+
* routes this sort re-routed, the lanes they and the moved tables changed, and
|
|
58
|
+
* the coordinate every segment was last drawn at.
|
|
59
|
+
*/
|
|
60
|
+
export type NudgeMemo = {
|
|
61
|
+
dirty: Set<string>;
|
|
62
|
+
lanes: DirtyLanes;
|
|
63
|
+
coordinate(relationshipId: string, index: number, vertical: boolean): number | undefined;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Which table boxes moved since the last sort, or null when so much changed that
|
|
67
|
+
* filtering costs more than re-routing. The cache's own snapshot is replaced
|
|
68
|
+
* here, so this runs once per sort.
|
|
69
|
+
*/
|
|
70
|
+
export declare function diffTableBoxes(cache: SortCache, obstacles: Obstacles): DirtyBox[] | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Point,
|
|
1
|
+
import { Point, Relationship, ValuesType } from '../../internal-types';
|
|
2
2
|
export declare const DirectionName: {
|
|
3
3
|
readonly left: "left";
|
|
4
4
|
readonly right: "right";
|
|
@@ -78,15 +78,6 @@ export type RelationshipPath = {
|
|
|
78
78
|
startCircle: Circle;
|
|
79
79
|
};
|
|
80
80
|
};
|
|
81
|
-
export type RelationshipMarginPoint = {
|
|
82
|
-
xArray: number[];
|
|
83
|
-
yArray: number[];
|
|
84
|
-
};
|
|
85
|
-
export type RelationshipOrder = {
|
|
86
|
-
start: RelationshipPoint;
|
|
87
|
-
end: RelationshipPoint;
|
|
88
|
-
distance: number;
|
|
89
|
-
};
|
|
90
81
|
export type ObjectPoint = {
|
|
91
82
|
width: number;
|
|
92
83
|
height: number;
|
|
@@ -102,7 +93,80 @@ export type ObjectPoint = {
|
|
|
102
93
|
export declare const isDirection: (value: string) => boolean;
|
|
103
94
|
export declare const PATH_HEIGHT = 30;
|
|
104
95
|
export declare const PATH_END_HEIGHT: number;
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
96
|
+
/**
|
|
97
|
+
* The cardinality decoration, measured outward from the anchor. The four are one
|
|
98
|
+
* shape and cannot be set independently: the ring shares a centre with the
|
|
99
|
+
* second tick and has to clear both the first tick and the guide line.
|
|
100
|
+
*/
|
|
101
|
+
export declare const LINE_SIZE = 7;
|
|
102
|
+
export declare const LINE_HEIGHT = 11;
|
|
103
|
+
export declare const CIRCLE_HEIGHT: number;
|
|
104
|
+
export declare const CIRCLE_RADIUS = 6;
|
|
105
|
+
export declare const PATH_LINE_HEIGHT: number;
|
|
106
|
+
/**
|
|
107
|
+
* How far apart the corridors of two relationships leaving the same table side
|
|
108
|
+
* sit. Without it every path on a side turns at the same coordinate and their
|
|
109
|
+
* first segments run down one another however far the anchors are spread.
|
|
110
|
+
*/
|
|
111
|
+
export declare const STUB_STEP = 12;
|
|
112
|
+
/**
|
|
113
|
+
* Corridors repeat every fourth slot. An unbounded stub walks a busy side's
|
|
114
|
+
* paths ever further from the table; wrapping caps the longest one and still
|
|
115
|
+
* leaves four slots between any two that share a corridor.
|
|
116
|
+
*/
|
|
117
|
+
export declare const STUB_CYCLE = 4;
|
|
118
|
+
/**
|
|
119
|
+
* The shortest a stub may be clamped to. It has to clear PATH_LINE_HEIGHT or the
|
|
120
|
+
* guide line is drawn backwards, but it is not derived from it: this is where
|
|
121
|
+
* the routing was measured, and following the decorations down cost overlap.
|
|
122
|
+
*/
|
|
123
|
+
export declare const MIN_STUB = 36;
|
|
124
|
+
/**
|
|
125
|
+
* The widest gap allowed between two anchors on the same table side. Capping the
|
|
126
|
+
* pitch keeps a side's anchors together as a group, so a tall table's edge is
|
|
127
|
+
* only filled when it genuinely has that many relationships.
|
|
128
|
+
*/
|
|
129
|
+
export declare const ANCHOR_MAX_PITCH = 120;
|
|
130
|
+
/** Keeps the outermost anchor of a side clear of the table's corners. */
|
|
131
|
+
export declare const ANCHOR_EDGE_INSET = 12;
|
|
132
|
+
/**
|
|
133
|
+
* How far back from a corner a connector turns when the corner is cut to 45
|
|
134
|
+
* degrees. A ceiling rather than a length: each cut is clamped to half the
|
|
135
|
+
* shorter run it touches, so a short run keeps its right angle.
|
|
136
|
+
*/
|
|
137
|
+
export declare const ROUTE_CHAMFER = 8;
|
|
138
|
+
export declare function setStubSlots(relationship: Relationship, slots: readonly [number, number]): void;
|
|
139
|
+
/** Falls back to slot zero, which reproduces the pre-stagger geometry. */
|
|
140
|
+
export declare function getStubSlots(relationship: Relationship): readonly [number, number];
|
|
141
|
+
export declare function setRoute(relationship: Relationship, points: Point[]): void;
|
|
142
|
+
export declare function getRoute(relationship: Relationship): Point[] | undefined;
|
|
143
|
+
/**
|
|
144
|
+
* How far a connector reaches past its anchor, whichever decoration is furthest
|
|
145
|
+
* out. The ring shares a centre with the second tick, so its outer edge and the
|
|
146
|
+
* start of the guide line are the two candidates.
|
|
147
|
+
*/
|
|
148
|
+
export declare const ROUTE_BBOX_REACH: number;
|
|
149
|
+
/**
|
|
150
|
+
* The longest stub a slot can ask for. It bounds where the turning points of an
|
|
151
|
+
* unrouted relationship can be, which is the only thing the route itself would
|
|
152
|
+
* have told us.
|
|
153
|
+
*/
|
|
154
|
+
export declare const MAX_STUB: number;
|
|
155
|
+
export type BBox = {
|
|
156
|
+
x: number;
|
|
157
|
+
y: number;
|
|
158
|
+
width: number;
|
|
159
|
+
height: number;
|
|
160
|
+
};
|
|
161
|
+
/**
|
|
162
|
+
* Opens a sort, retiring every route box the previous one wrote. Identity
|
|
163
|
+
* outlives a sort, so the stamp a route carries is what separates a box for the
|
|
164
|
+
* current routes from one the next sort has already replaced.
|
|
165
|
+
*/
|
|
166
|
+
export declare function nextSortEpoch(): void;
|
|
167
|
+
/**
|
|
168
|
+
* Everywhere a relationship can be drawn, for a culling test that must not lose
|
|
169
|
+
* a connector whose anchors are on screen and whose route is not. Without a
|
|
170
|
+
* route from this sort the stub ends are unknown, so the padding carries them.
|
|
171
|
+
*/
|
|
172
|
+
export declare function getRouteBBox(relationship: Relationship, strokeWidth?: number): BBox;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Point } from '../../internal-types';
|
|
2
|
+
import { NudgeMemo } from './incremental';
|
|
3
|
+
import { Obstacles } from './route';
|
|
4
|
+
export declare function nudgeRoutes(routes: Map<string, Point[]>, obstacles: Obstacles, endpoints: Map<string, [string, string]>, memo?: NudgeMemo): void;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
import { Relationship } from '../../internal-types';
|
|
1
|
+
import { Point, Relationship } from '../../internal-types';
|
|
2
2
|
import { RelationshipPath } from '.';
|
|
3
3
|
export declare function getRelationshipPath(relationship: Relationship): RelationshipPath;
|
|
4
|
+
/**
|
|
5
|
+
* The routing polyline as one d, so a connector is a single element whatever the
|
|
6
|
+
* router and the corner cuts made of it. The segments are contiguous by
|
|
7
|
+
* construction, so each contributes its far end and nothing else.
|
|
8
|
+
*/
|
|
9
|
+
export declare function toPathD(segments: Array<[Point, Point]>): string;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { RootState } from '../../engine/state';
|
|
2
|
+
import { Point } from '../../internal-types';
|
|
3
|
+
export type Obstacles = {
|
|
4
|
+
ids: string[];
|
|
5
|
+
left: Float64Array;
|
|
6
|
+
top: Float64Array;
|
|
7
|
+
right: Float64Array;
|
|
8
|
+
bottom: Float64Array;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Every table in the document, not only those carrying a relationship: a table
|
|
12
|
+
* with no relationships at all still blocks the view.
|
|
13
|
+
*/
|
|
14
|
+
export declare function collectObstacles(state: RootState): Obstacles;
|
|
15
|
+
/** Liang–Barsky, with no divisions until a slab actually clips. */
|
|
16
|
+
export declare function segmentHitsBox(ax: number, ay: number, bx: number, by: number, left: number, top: number, right: number, bottom: number): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* How many tables a polyline passes through, ignoring the two it connects. The
|
|
19
|
+
* hot function of the router, so the polyline's own box is computed once to skip
|
|
20
|
+
* tables outright; every segment's box sits inside it, so the count is the same.
|
|
21
|
+
*/
|
|
22
|
+
export declare function countBlocked(points: Point[], obstacles: Obstacles, skipA: string, skipB: string): number;
|
|
23
|
+
/**
|
|
24
|
+
* The cheapest orthogonal polyline from m to l, or a two-bend fallback when
|
|
25
|
+
* nothing is feasible — a connector always has to be drawn.
|
|
26
|
+
*/
|
|
27
|
+
export declare function routeOrthogonal(m: Point, mDirection: number, l: Point, lDirection: number, obstacles: Obstacles, skipA: string, skipB: string): Point[];
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Point, Relationship } from '../../internal-types';
|
|
2
|
+
/**
|
|
3
|
+
* Slot zero keeps the historical PATH_END_HEIGHT, so a relationship that never
|
|
4
|
+
* went through relationshipSort draws exactly as it did before.
|
|
5
|
+
*/
|
|
6
|
+
export declare function stubFor(slot: number): number;
|
|
7
|
+
/**
|
|
8
|
+
* The axis-aligned distance between two anchors that point at each other, or
|
|
9
|
+
* null when they do not. Only this arrangement can collapse: a gap of twice the
|
|
10
|
+
* stub puts both turning points on one spot, and a smaller gap inverts the path.
|
|
11
|
+
*/
|
|
12
|
+
export declare function facingGap(start: Relationship['start'], end: Relationship['end']): number | null;
|
|
13
|
+
/**
|
|
14
|
+
* Below roughly 2 * MIN_STUB the two cardinality decorations already overlap
|
|
15
|
+
* each other, which no stub length can fix; the clamp stops short of making it
|
|
16
|
+
* worse by drawing the guide line backwards.
|
|
17
|
+
*/
|
|
18
|
+
export declare function clampStub(stub: number, gap: number | null): number;
|
|
19
|
+
export type StubEnds = {
|
|
20
|
+
/** Turning point on the start side. */
|
|
21
|
+
m: Point;
|
|
22
|
+
/** Turning point on the end side. */
|
|
23
|
+
l: Point;
|
|
24
|
+
startStub: number;
|
|
25
|
+
endStub: number;
|
|
26
|
+
};
|
|
27
|
+
export declare function isHorizontal(direction: number): direction is 1 | 2;
|
|
28
|
+
/** +1 when the anchor's outward normal points right or down. */
|
|
29
|
+
export declare function outwardSign(direction: number): 1 | -1;
|
|
30
|
+
/** The two points a route has to join, given the anchors and their slots. */
|
|
31
|
+
export declare function stubEnds(relationship: Relationship): StubEnds;
|
|
32
|
+
/**
|
|
33
|
+
* Where the guide line begins — the short run between the cardinality
|
|
34
|
+
* decorations and the routed polyline.
|
|
35
|
+
*/
|
|
36
|
+
export declare const GUIDE_START: number;
|
package/dist/utils/emitter.d.ts
CHANGED
|
@@ -17,6 +17,8 @@ declare const InternalActionType: {
|
|
|
17
17
|
readonly mouseTrackerStart: "mouseTrackerStart";
|
|
18
18
|
readonly mouseTrackerEnd: "mouseTrackerEnd";
|
|
19
19
|
readonly openDiffViewer: "openDiffViewer";
|
|
20
|
+
readonly duplicateDragStart: "duplicateDragStart";
|
|
21
|
+
readonly dragSelectStart: "dragSelectStart";
|
|
20
22
|
};
|
|
21
23
|
type InternalActionType = ValuesType<typeof InternalActionType>;
|
|
22
24
|
type InternalActionMap = {
|
|
@@ -50,6 +52,14 @@ type InternalActionMap = {
|
|
|
50
52
|
[InternalActionType.openDiffViewer]: {
|
|
51
53
|
value: string;
|
|
52
54
|
};
|
|
55
|
+
[InternalActionType.duplicateDragStart]: {
|
|
56
|
+
tableIds: string[];
|
|
57
|
+
memoIds: string[];
|
|
58
|
+
} | void;
|
|
59
|
+
[InternalActionType.dragSelectStart]: {
|
|
60
|
+
x: number;
|
|
61
|
+
y: number;
|
|
62
|
+
};
|
|
53
63
|
};
|
|
54
64
|
type ListenerRecord = {
|
|
55
65
|
[P in keyof InternalActionMap]: (action: Action<P, InternalActionMap>) => void;
|
|
@@ -165,4 +175,26 @@ export declare const openDiffViewerAction: {
|
|
|
165
175
|
toString(): string;
|
|
166
176
|
type: string;
|
|
167
177
|
};
|
|
178
|
+
export declare const duplicateDragStartAction: {
|
|
179
|
+
(payload: void | {
|
|
180
|
+
tableIds: string[];
|
|
181
|
+
memoIds: string[];
|
|
182
|
+
}): AnyAction<void | {
|
|
183
|
+
tableIds: string[];
|
|
184
|
+
memoIds: string[];
|
|
185
|
+
}>;
|
|
186
|
+
toString(): string;
|
|
187
|
+
type: string;
|
|
188
|
+
};
|
|
189
|
+
export declare const dragSelectStartAction: {
|
|
190
|
+
(payload: {
|
|
191
|
+
x: number;
|
|
192
|
+
y: number;
|
|
193
|
+
}): AnyAction<{
|
|
194
|
+
x: number;
|
|
195
|
+
y: number;
|
|
196
|
+
}>;
|
|
197
|
+
toString(): string;
|
|
198
|
+
type: string;
|
|
199
|
+
};
|
|
168
200
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DocumentPngOptions } from '../../services/export-png';
|
|
1
2
|
type ExportOptions = {
|
|
2
3
|
fileName: string;
|
|
3
4
|
};
|
|
@@ -5,5 +6,13 @@ type ExportFileCallback = (blob: Blob, options: ExportOptions) => void;
|
|
|
5
6
|
export declare function setExportFileCallback(callback: ExportFileCallback | null): void;
|
|
6
7
|
export declare function exportJSON(json: string, name?: string): void;
|
|
7
8
|
export declare function exportSchemaSQL(sql: string, name?: string): void;
|
|
8
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Writes the whole document out as an image. What is on screen is not an input:
|
|
11
|
+
* the scene is rendered again off screen from the document alone, so the file a
|
|
12
|
+
* reader opens does not depend on where the author had scrolled or zoomed to.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* exportPNG({ doc: toJson(store.state), theme, toWidth }, databaseName);
|
|
16
|
+
*/
|
|
17
|
+
export declare function exportPNG(options: DocumentPngOptions, name?: string): Promise<void>;
|
|
9
18
|
export {};
|