@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,67 @@
|
|
|
1
|
+
import { KonvaEventObject } from 'konva/lib/Node';
|
|
2
|
+
/** A pointer event as konva hands it to a listener bound on a scene node. */
|
|
3
|
+
export type SceneMouseEvent = KonvaEventObject<MouseEvent>;
|
|
4
|
+
export type SceneTouchEvent = KonvaEventObject<TouchEvent>;
|
|
5
|
+
export type ScenePointerEvent = SceneMouseEvent | SceneTouchEvent;
|
|
6
|
+
/**
|
|
7
|
+
* The face utils/text.ts measures a string with. Drawing in anything else would
|
|
8
|
+
* make a cell wider or narrower than the width the layout reserved for it.
|
|
9
|
+
*/
|
|
10
|
+
export declare const SCENE_FONT_FAMILY: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', 'Open Sans', system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'";
|
|
11
|
+
/** The px behind font-size-1, which is what typography.paragraph resolves to. */
|
|
12
|
+
export declare const SCENE_FONT_SIZE = 12;
|
|
13
|
+
/** The css font shorthand konva builds for a cell's text, and measures it with. */
|
|
14
|
+
export declare const SCENE_FONT: string;
|
|
15
|
+
/** The pair a canvas centres a drawn line by, which no line box is involved in. */
|
|
16
|
+
export type SceneFontMetrics = {
|
|
17
|
+
ascent: number;
|
|
18
|
+
descent: number;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* The ascent and descent konva centres a drawn line by, read with the measure
|
|
22
|
+
* call konva makes itself. A canvas has no line box to lean on, so this pair is
|
|
23
|
+
* the whole of where a baseline lands, and the editor has to read the same one.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* const { ascent, descent } = getSceneFontMetrics();
|
|
27
|
+
*/
|
|
28
|
+
export declare function getSceneFontMetrics(): SceneFontMetrics;
|
|
29
|
+
/**
|
|
30
|
+
* The px behind font-size-5 through font-size-9, in the order HighLevelTable
|
|
31
|
+
* steps through them as the zoom falls. The scale itself is a CSS custom
|
|
32
|
+
* property, and a canvas has no way to read one.
|
|
33
|
+
*/
|
|
34
|
+
export declare const HIGH_LEVEL_FONT_SIZES: readonly [20, 24, 28, 35, 60];
|
|
35
|
+
/** Border plus padding on one side, which is where a table's own content starts. */
|
|
36
|
+
export declare const TABLE_INSET: number;
|
|
37
|
+
/** The radius Table.styles rounds a table box with. */
|
|
38
|
+
export declare const TABLE_CORNER_RADIUS = 6;
|
|
39
|
+
/** The min-height Table.styles gives the colour bar across a table header. */
|
|
40
|
+
export declare const HEADER_COLOR_HEIGHT = 4;
|
|
41
|
+
/** The 1.5px underline EditInput draws for a focused, edited or shared cell. */
|
|
42
|
+
export declare const FOCUS_BORDER_HEIGHT = 1.5;
|
|
43
|
+
/** What the ring outside a table box costs, as outline and box-shadow both do. */
|
|
44
|
+
export declare const RING_WIDTH = 1;
|
|
45
|
+
/** The side of the square viewBox every icon is authored in. */
|
|
46
|
+
export declare const ICON_VIEW_SIZE: number;
|
|
47
|
+
/** What a colour is when the scene paints nothing, as a CSS keyword konva takes. */
|
|
48
|
+
export declare const TRANSPARENT = "transparent";
|
|
49
|
+
/**
|
|
50
|
+
* A fill that paints nothing and still answers a hit test, which is how a cell
|
|
51
|
+
* keeps the whole padded box clickable the way its div did.
|
|
52
|
+
*/
|
|
53
|
+
export declare const HIT_FILL = "transparent";
|
|
54
|
+
/** The hand a clickable scene node asks for, as the dom scene spelt it in css. */
|
|
55
|
+
export declare const CURSOR_POINTER = "pointer";
|
|
56
|
+
/** The beam a textarea carried on its own, which a drawn body has to ask for. */
|
|
57
|
+
export declare const CURSOR_TEXT = "text";
|
|
58
|
+
/** What a node hands back on the way out, leaving the container its own cursor. */
|
|
59
|
+
export declare const CURSOR_INHERIT = "";
|
|
60
|
+
/**
|
|
61
|
+
* Points the stage container at a cursor. A konva node carries none of its own,
|
|
62
|
+
* so the container is where the css the dom scene put on an element now lives.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* on:mouseenter={(event) => setSceneCursor(event, CURSOR_POINTER)}
|
|
66
|
+
*/
|
|
67
|
+
export declare function setSceneCursor(event: ScenePointerEvent, cursor: string): void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC } from '@dineug/r-html';
|
|
2
|
+
export type SharedDragSelectProps = {};
|
|
3
|
+
/**
|
|
4
|
+
* A peer's marquee, in the schema coordinates their editor shared. Fainter than
|
|
5
|
+
* the local one because several may be open at once over the same tables.
|
|
6
|
+
*/
|
|
7
|
+
declare const SharedDragSelect: FC<SharedDragSelectProps>;
|
|
8
|
+
export default SharedDragSelect;
|
package/dist/components/erd/canvas/shared-mouse-tracker/shared-mouse-cursor/SharedMouseCursor.d.ts
CHANGED
|
@@ -3,5 +3,10 @@ import { SharedMouseTracker } from '../../../../../engine/modules/editor/state';
|
|
|
3
3
|
export type SharedMouseCursorProps = {
|
|
4
4
|
tracker: SharedMouseTracker;
|
|
5
5
|
};
|
|
6
|
+
/**
|
|
7
|
+
* One peer's pointer and nickname, eased toward the position they last shared.
|
|
8
|
+
* The colour identifies the editor rather than the theme, so it comes from the
|
|
9
|
+
* shared palette instead of a resolved token.
|
|
10
|
+
*/
|
|
6
11
|
declare const SharedMouseCursor: FC<SharedMouseCursorProps>;
|
|
7
12
|
export default SharedMouseCursor;
|
|
@@ -2,6 +2,14 @@ import { FC } from '@dineug/r-html';
|
|
|
2
2
|
import { Table } from '../../../../internal-types';
|
|
3
3
|
export type TableProps = {
|
|
4
4
|
table: Table;
|
|
5
|
+
/** A drawn copy rather than the table itself, so nothing in it takes an id. */
|
|
6
|
+
preview?: boolean;
|
|
7
|
+
hovered?: boolean;
|
|
8
|
+
hoveredColumnId?: string | null;
|
|
9
|
+
ghostColumnId?: string | null;
|
|
10
|
+
editorFocused?: boolean;
|
|
11
|
+
/** Off while the table is kept built but scrolled out of the culling rect. */
|
|
12
|
+
visible?: boolean;
|
|
5
13
|
};
|
|
6
14
|
declare const Table: FC<TableProps>;
|
|
7
15
|
export default Table;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { FocusType } from '../../../../engine/modules/editor/state';
|
|
2
|
+
import { RootState } from '../../../../engine/state';
|
|
3
|
+
import { Table } from '../../../../internal-types';
|
|
4
|
+
import { Theme } from '../../../../themes/tokens';
|
|
5
|
+
import { ColumnWidth } from '../../../../utils/calcTable';
|
|
6
|
+
/** The four widths a column row measures from its table; the rest are fixed. */
|
|
7
|
+
export type ColumnCellWidths = Pick<ColumnWidth, 'comment' | 'dataType' | 'default' | 'name'>;
|
|
8
|
+
/** One editable box on a table, positioned inside the table's own group. */
|
|
9
|
+
export type CellSlot = {
|
|
10
|
+
focusType: FocusType;
|
|
11
|
+
x: number;
|
|
12
|
+
width: number;
|
|
13
|
+
};
|
|
14
|
+
export type ColumnCellSlot = CellSlot & {
|
|
15
|
+
columnType: number;
|
|
16
|
+
};
|
|
17
|
+
/** Where the header cell row starts inside a table group. */
|
|
18
|
+
export declare const HEADER_CELLS_X: number;
|
|
19
|
+
export declare const HEADER_CELLS_Y: number;
|
|
20
|
+
/** The text line inside a header cell and inside a column cell. */
|
|
21
|
+
export declare const HEADER_TEXT_Y = 2;
|
|
22
|
+
export declare const COLUMN_TEXT_Y = 2;
|
|
23
|
+
/** Where the scene runs its focus rect inside a cell, header and column both. */
|
|
24
|
+
export declare const CELL_UNDERLINE_Y: number;
|
|
25
|
+
/**
|
|
26
|
+
* The paint that focus rect takes, header and column both: the input colour
|
|
27
|
+
* while the cell is being edited, and greyed out with the rest of the focus
|
|
28
|
+
* while the editor is not the one holding the keyboard.
|
|
29
|
+
*/
|
|
30
|
+
export declare function focusBorderFill(theme: Theme, edit: boolean, editorFocused: boolean | undefined): string;
|
|
31
|
+
/**
|
|
32
|
+
* The baseline one line of cell text is drawn on, down from the top of the
|
|
33
|
+
* cell. Blink puts a painted baseline on the device grid before the zoom scales
|
|
34
|
+
* it, so only a whole pixel survives both rasterisers unchanged.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* const baseline = getCellTextBaseline();
|
|
38
|
+
*/
|
|
39
|
+
export declare function getCellTextBaseline(): number;
|
|
40
|
+
/**
|
|
41
|
+
* The box one line of cell text is centred in. The scene hands konva this
|
|
42
|
+
* height with verticalAlign middle and the editor gives its input the same one,
|
|
43
|
+
* which is what puts the two baselines on one whole pixel instead of two.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* const height = getCellTextHeight();
|
|
47
|
+
*/
|
|
48
|
+
export declare function getCellTextHeight(): number;
|
|
49
|
+
/** Where a column row's cells start, past the key badge. */
|
|
50
|
+
export declare const COLUMN_CELLS_X: number;
|
|
51
|
+
/** The comment width a table draws at, clamped by the setting when it is set. */
|
|
52
|
+
export declare function getWidthComment(state: RootState, table: Table): number;
|
|
53
|
+
/**
|
|
54
|
+
* The name and comment boxes across a table header. One list feeds both the
|
|
55
|
+
* scene that draws them and the overlay that edits them, so an editor can never
|
|
56
|
+
* sit anywhere but on the text it replaces.
|
|
57
|
+
*/
|
|
58
|
+
export declare function getHeaderCellSlots(state: RootState, table: Table): CellSlot[];
|
|
59
|
+
/**
|
|
60
|
+
* The cells of one column row, in the order the settings put them and at the x
|
|
61
|
+
* each lands on once the ones before it have taken their width.
|
|
62
|
+
*/
|
|
63
|
+
export declare function getColumnCellSlots(state: RootState, widths: ColumnCellWidths): ColumnCellSlot[];
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { FC
|
|
2
|
-
import {
|
|
1
|
+
import { FC } from '@dineug/r-html';
|
|
2
|
+
import { SceneMouseEvent } from '../../sceneTokens';
|
|
3
3
|
import { Column } from '../../../../../internal-types';
|
|
4
4
|
export type ColumnProps = {
|
|
5
|
-
app: Ref<AppContext>;
|
|
6
5
|
column: Column;
|
|
6
|
+
y: number;
|
|
7
|
+
width: number;
|
|
7
8
|
selected: boolean;
|
|
8
9
|
widthName: number;
|
|
9
10
|
widthDataType: number;
|
|
@@ -16,14 +17,30 @@ export type ColumnProps = {
|
|
|
16
17
|
focusComment: boolean;
|
|
17
18
|
focusUnique: boolean;
|
|
18
19
|
focusAutoIncrement: boolean;
|
|
20
|
+
sharedFocusName: string | null;
|
|
21
|
+
sharedFocusDataType: string | null;
|
|
22
|
+
sharedFocusNotNull: string | null;
|
|
23
|
+
sharedFocusDefault: string | null;
|
|
24
|
+
sharedFocusComment: string | null;
|
|
25
|
+
sharedFocusUnique: string | null;
|
|
26
|
+
sharedFocusAutoIncrement: string | null;
|
|
19
27
|
editName: boolean;
|
|
20
28
|
editDataType: boolean;
|
|
21
29
|
editDefault: boolean;
|
|
22
30
|
editComment: boolean;
|
|
23
|
-
|
|
31
|
+
hovered?: boolean;
|
|
32
|
+
/** The placeholder row for a column dragged in from another table. */
|
|
24
33
|
ghost?: boolean;
|
|
25
|
-
|
|
26
|
-
|
|
34
|
+
/** Drawn inside a copy of the table, which owns none of its ids. */
|
|
35
|
+
preview?: boolean;
|
|
36
|
+
editorFocused?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* The one pair of callbacks the scene keeps. A drop lands between siblings,
|
|
39
|
+
* so the table that owns the order is the only thing that can judge one, and
|
|
40
|
+
* the row can only say that a drag of it started and that it ended.
|
|
41
|
+
*/
|
|
42
|
+
onDragstart?: (columnId: string, event: SceneMouseEvent) => void;
|
|
43
|
+
onDragend?: () => void;
|
|
27
44
|
};
|
|
28
45
|
declare const Column: FC<ColumnProps>;
|
|
29
46
|
export default Column;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SceneMouseEvent } from '../sceneTokens';
|
|
2
|
+
import { FocusType } from '../../../../engine/modules/editor/state';
|
|
3
|
+
export type DoubleClickGuard = {
|
|
4
|
+
/** Records the cell a click opened a pair on. */
|
|
5
|
+
track(cell: FocusType, event: SceneMouseEvent): void;
|
|
6
|
+
/** Whether a konva dblclick closes a pair that began on this same cell. */
|
|
7
|
+
isDouble(cell: FocusType, event: SceneMouseEvent): boolean;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Tells a real double click from the one konva invents. Konva fires dblclick on
|
|
11
|
+
* whatever the second click of any pair inside its window lands on, wherever
|
|
12
|
+
* the first one was, so the cell that opened the pair is remembered here.
|
|
13
|
+
*/
|
|
14
|
+
export declare function createDoubleClickGuard(): DoubleClickGuard;
|
|
@@ -2,5 +2,5 @@ import { Ctx, Table } from '../../../../internal-types';
|
|
|
2
2
|
export declare function useMoveTable(ctx: Ctx, props: {
|
|
3
3
|
table: Table;
|
|
4
4
|
}): {
|
|
5
|
-
onMoveStart: (event:
|
|
5
|
+
onMoveStart: (event: import('../sceneTokens').ScenePointerEvent) => void;
|
|
6
6
|
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { FocusType } from '../../../../engine/modules/editor/state';
|
|
2
|
+
import { Ctx } from '../../../../internal-types';
|
|
3
|
+
export declare function useSharedFocusTable(ctx: Ctx, tableId: string): {
|
|
4
|
+
sharedFocusTableColor: () => string | null;
|
|
5
|
+
sharedFocusColor: (focusType: FocusType, columnId?: string) => string | null;
|
|
6
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ScenePointerEvent } from './sceneTokens';
|
|
2
|
+
import { SelectType } from '../../../engine/modules/editor/state';
|
|
3
|
+
import { Ctx } from '../../../internal-types';
|
|
4
|
+
export type MoveEntityOptions = {
|
|
5
|
+
/** Read late, because repeat hands a component a new entity in place. */
|
|
6
|
+
entityId: () => string;
|
|
7
|
+
selectType: SelectType;
|
|
8
|
+
/** The scene kinds a drag never starts from, as closest read their classes. */
|
|
9
|
+
blockedKinds: readonly string[];
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* The pointer start every draggable entity shares: select it, hand an Alt drag
|
|
13
|
+
* to the duplicate ghost, and otherwise move the whole selection with the
|
|
14
|
+
* pointer. Only the entity kind and the blocked areas differ between them.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useMoveEntity(ctx: Ctx, options: MoveEntityOptions): {
|
|
17
|
+
onMoveStart: (event: ScenePointerEvent) => void;
|
|
18
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FC
|
|
1
|
+
import { FC } from '@dineug/r-html';
|
|
2
2
|
import { ValuesType } from '../../../internal-types';
|
|
3
3
|
export declare const ErdContextMenuType: {
|
|
4
4
|
readonly ERD: "ERD";
|
|
@@ -8,7 +8,6 @@ export declare const ErdContextMenuType: {
|
|
|
8
8
|
export type ErdContextMenuType = ValuesType<typeof ErdContextMenuType>;
|
|
9
9
|
export type ErdContextMenuProps = {
|
|
10
10
|
type: ErdContextMenuType;
|
|
11
|
-
canvas: Ref<HTMLDivElement>;
|
|
12
11
|
relationshipId?: string;
|
|
13
12
|
tableId?: string;
|
|
14
13
|
onClose: () => void;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { AppContext } from '../../../appContext';
|
|
2
|
+
import { NotationIconName } from '../../../primitives/icon/icons';
|
|
2
3
|
import { KeyBindingName } from '../../../../utils/keyboard-shortcut';
|
|
3
4
|
type Menu = {
|
|
4
|
-
iconName:
|
|
5
|
+
iconName: NotationIconName;
|
|
5
6
|
name: string;
|
|
6
7
|
keyBindingName: KeyBindingName;
|
|
7
8
|
relationshipType: number;
|
|
8
9
|
};
|
|
9
10
|
export declare const menus: Menu[];
|
|
10
11
|
export declare function createDrawRelationshipMenus({ store, keyBindingMap }: AppContext, onClose: () => void): {
|
|
11
|
-
iconName:
|
|
12
|
+
iconName: "ZeroOneN" | "ZeroOne" | "ZeroN" | "OneOnly" | "OneN" | "One" | "N";
|
|
12
13
|
name: string;
|
|
13
14
|
shortcut: string;
|
|
14
15
|
onClick: () => void;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { AppContext } from '../../../appContext';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
2
|
+
import { IconName } from '../../../primitives/icon/icons';
|
|
3
|
+
import { Theme } from '../../../../themes/tokens';
|
|
4
|
+
type Menu = {
|
|
5
|
+
icon: IconName;
|
|
7
6
|
name: string;
|
|
8
7
|
onClick: () => void;
|
|
9
|
-
}
|
|
8
|
+
};
|
|
9
|
+
export declare function createExportMenus(app: AppContext, onClose: () => void, theme: Theme): Menu[];
|
|
10
|
+
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { AppContext } from '../../../appContext';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
name: string;
|
|
6
|
-
};
|
|
2
|
+
import { IconName } from '../../../primitives/icon/icons';
|
|
3
|
+
type Menu = {
|
|
4
|
+
icon: IconName;
|
|
7
5
|
name: string;
|
|
8
6
|
onClick: () => void;
|
|
9
|
-
}
|
|
7
|
+
};
|
|
8
|
+
export declare function createImportMenus(app: AppContext, onClose: () => void): Menu[];
|
|
9
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AppContext } from '../../../appContext';
|
|
2
2
|
export declare function createRelationshipMenus({ store }: AppContext, relationshipId?: string): {
|
|
3
3
|
checked: boolean;
|
|
4
|
-
iconName:
|
|
4
|
+
iconName: "ZeroOneN" | "ZeroOne" | "ZeroN" | "OneOnly" | "OneN" | "One" | "N";
|
|
5
5
|
name: string;
|
|
6
6
|
onClick: () => void;
|
|
7
7
|
}[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Viewport } from '../../../engine/modules/editor/state';
|
|
2
|
+
import { ScrollTransform } from '../../../engine/modules/settings/atom.actions';
|
|
3
|
+
import { Rect } from '../../../utils/dragSelect';
|
|
4
|
+
/**
|
|
5
|
+
* The scene a reader can still get to: what the screen shows, taken over every
|
|
6
|
+
* scroll offset the current zoom allows. A magnifying zoom sees less at once
|
|
7
|
+
* but reaches the same document, so the bound has to follow the travel.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getReachableRect(settings: ScrollTransform, viewport: Viewport): Rect;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Stage } from 'konva/lib/Stage';
|
|
2
|
+
/** The scene entities the erd routing tells apart from one another. */
|
|
3
|
+
export type SceneEntityKind = 'table' | 'memo' | 'relationship';
|
|
4
|
+
export type SceneHit = {
|
|
5
|
+
kind: SceneEntityKind;
|
|
6
|
+
id: string;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Records the entity konva hit for every press a stage dispatches, and returns
|
|
10
|
+
* the teardown. Konva resolves the node while the hit canvas still matches the
|
|
11
|
+
* scene, so the walk up to the entity runs there too.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* addUnsubscribe(trackSceneHits(stage));
|
|
15
|
+
*/
|
|
16
|
+
export declare function trackSceneHits(stage: Stage): () => void;
|
|
17
|
+
/**
|
|
18
|
+
* The scene entity a pointer event landed on, or null for bare canvas and for a
|
|
19
|
+
* target outside the stage. Konva resolved it as it dispatched that same event,
|
|
20
|
+
* because the press has re-rendered the scene by the time this is asked.
|
|
21
|
+
*/
|
|
22
|
+
export declare function sceneHit(container: HTMLElement | null | undefined, event: MouseEvent | TouchEvent): SceneHit | null;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FC } from '@dineug/r-html';
|
|
2
|
+
import { Stage } from 'konva/lib/Stage';
|
|
3
|
+
export type MinimapSceneProps = {};
|
|
4
|
+
/**
|
|
5
|
+
* The whole document on one layer, with no culling: a thumbnail that dropped
|
|
6
|
+
* what is off screen would stop being a map of where the rest of it is. Boxes
|
|
7
|
+
* only, because a connector between two of them is noise at this size.
|
|
8
|
+
*/
|
|
9
|
+
declare const MinimapScene: FC<MinimapSceneProps>;
|
|
10
|
+
/**
|
|
11
|
+
* Renders the minimap scene as the root of its Stage. Named in lower case on
|
|
12
|
+
* purpose: an all-upper-case export list makes r-html's refresh treat this as a
|
|
13
|
+
* component module and self-accept it, which kills hmr for the whole scene.
|
|
14
|
+
*/
|
|
15
|
+
export declare function renderMinimapScene(stage: Stage): void;
|
|
16
|
+
export default MinimapScene;
|
|
@@ -3,5 +3,10 @@ import { Memo } from '../../../../internal-types';
|
|
|
3
3
|
export type MemoProps = {
|
|
4
4
|
memo: Memo;
|
|
5
5
|
};
|
|
6
|
+
/**
|
|
7
|
+
* A memo as the minimap draws it: the box and nothing in it. The id rides in
|
|
8
|
+
* the name, the way a relationship carries its own, because an id on a second
|
|
9
|
+
* stage would make an id scan over the live stages ambiguous.
|
|
10
|
+
*/
|
|
6
11
|
declare const Memo: FC<MemoProps>;
|
|
7
12
|
export default Memo;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Point } from '../../../internal-types';
|
|
2
|
+
import { SceneTransform } from '../../../konva/scene/viewport';
|
|
3
|
+
/** The canvas box the minimap draws, plus the screen that is looking at it. */
|
|
4
|
+
export type MinimapTransform = SceneTransform & {
|
|
5
|
+
viewportWidth: number;
|
|
6
|
+
viewportHeight: number;
|
|
7
|
+
};
|
|
8
|
+
export type MinimapRect = {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
width: number;
|
|
12
|
+
height: number;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* The whole canvas box scaled into the minimap square, with no zoom term. Fixed
|
|
16
|
+
* on purpose: the thumbnail stays a map of the document at one size, and the
|
|
17
|
+
* zoom shows up in the rectangle drawn over it instead.
|
|
18
|
+
*/
|
|
19
|
+
export declare function getMinimapRatio(width: number): number;
|
|
20
|
+
/**
|
|
21
|
+
* The canvas the screen actually covers, read back through the very origin
|
|
22
|
+
* getSceneOrigin places the scene layer at. One screen pixel buys one over the
|
|
23
|
+
* zoom in canvas units, so zooming out widens this with the scroll standing still.
|
|
24
|
+
*/
|
|
25
|
+
export declare function getVisibleCanvasRect(transform: MinimapTransform): MinimapRect;
|
|
26
|
+
/** That same rectangle in the minimap's own pixels, which is where it is drawn. */
|
|
27
|
+
export declare function getMinimapViewportRect(transform: MinimapTransform): MinimapRect;
|
|
28
|
+
/** The thumbnail's own box: the canvas box at the minimap ratio, 150 wide. */
|
|
29
|
+
export declare function getMinimapBoxSize(width: number, height: number): {
|
|
30
|
+
width: number;
|
|
31
|
+
height: number;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* The rectangle as drawn, trimmed to the thumbnail box. Zooming out far enough
|
|
35
|
+
* makes the screen reach past the canvas on every side, and this box is a
|
|
36
|
+
* pointer target, so what leaves the map is dropped instead of laid over it.
|
|
37
|
+
*/
|
|
38
|
+
export declare function getMinimapHandleRect(transform: MinimapTransform): MinimapRect;
|
|
39
|
+
/**
|
|
40
|
+
* A canvas distance as the scroll that travels it. Scroll is measured in screen
|
|
41
|
+
* pixels and moves the view the opposite way, so it carries both the zoom and
|
|
42
|
+
* the sign that a minimap coordinate does not.
|
|
43
|
+
*/
|
|
44
|
+
export declare function toScrollDistance(distance: number, zoomLevel: number): number;
|
|
45
|
+
/** Minimap travel as the scroll that keeps the rectangle under the pointer. */
|
|
46
|
+
export declare function toScrollMovement(movement: number, ratio: number, zoomLevel: number): number;
|
|
47
|
+
/**
|
|
48
|
+
* The scroll that puts a canvas point in the middle of the screen. Stated as a
|
|
49
|
+
* step away from where the scroll stands now, so the origin is read once through
|
|
50
|
+
* getVisibleCanvasRect rather than restated inverted here.
|
|
51
|
+
*/
|
|
52
|
+
export declare function getScrollToCenter(transform: MinimapTransform, center: Point): Point;
|
|
@@ -3,5 +3,10 @@ import { Table } from '../../../../internal-types';
|
|
|
3
3
|
export type TableProps = {
|
|
4
4
|
table: Table;
|
|
5
5
|
};
|
|
6
|
+
/**
|
|
7
|
+
* A table as the minimap draws it: the box and nothing in it. The id stays off
|
|
8
|
+
* the node because two stages spelling one id make an id scan ambiguous, so a
|
|
9
|
+
* minimap node is found by its name and the table it carries.
|
|
10
|
+
*/
|
|
6
11
|
declare const Table: FC<TableProps>;
|
|
7
12
|
export default Table;
|
|
@@ -2,7 +2,7 @@ import { FC } from '@dineug/r-html';
|
|
|
2
2
|
import { Index } from '../../../../../internal-types';
|
|
3
3
|
export type IndexesCheckboxColumnProps = {
|
|
4
4
|
tableId: string;
|
|
5
|
-
index: Index;
|
|
5
|
+
index: Index | null;
|
|
6
6
|
};
|
|
7
7
|
declare const IndexesCheckboxColumn: FC<IndexesCheckboxColumnProps>;
|
|
8
8
|
export default IndexesCheckboxColumn;
|
|
@@ -1,4 +1,21 @@
|
|
|
1
|
+
import { ScrollRange } from '../../../engine/modules/settings/atom.actions';
|
|
1
2
|
import { Ctx } from '../../../internal-types';
|
|
3
|
+
/** One scrollbar as drawn: a track a viewport wide over the content behind it. */
|
|
4
|
+
export type ScrollbarTrack = {
|
|
5
|
+
range: ScrollRange;
|
|
6
|
+
ratio: number;
|
|
7
|
+
thumb: number;
|
|
8
|
+
offset: number;
|
|
9
|
+
scrollable: boolean;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* The bar for one axis, sized from the travel the engine allows rather than from
|
|
13
|
+
* the canvas box. The content behind the track is a viewport plus that travel,
|
|
14
|
+
* which is the only place the zoom enters, and at zoom 1 the two read the same.
|
|
15
|
+
*/
|
|
16
|
+
export declare function getScrollbarTrack(range: ScrollRange, scroll: number, viewportLength: number): ScrollbarTrack;
|
|
17
|
+
/** The scroll that centres the viewport on a point pressed on a track. */
|
|
18
|
+
export declare function trackPointToScroll({ range, ratio }: ScrollbarTrack, point: number, viewportLength: number): number;
|
|
2
19
|
export declare function useVirtualScroll(ctx: Ctx): {
|
|
3
20
|
state: {
|
|
4
21
|
selected: null | "horizontal" | "vertical";
|
|
@@ -7,4 +24,6 @@ export declare function useVirtualScroll(ctx: Ctx): {
|
|
|
7
24
|
onScrollTopStart: (event: MouseEvent) => void;
|
|
8
25
|
getWidthRatio: () => number;
|
|
9
26
|
getHeightRatio: () => number;
|
|
27
|
+
getHorizontalTrack: () => ScrollbarTrack;
|
|
28
|
+
getVerticalTrack: () => ScrollbarTrack;
|
|
10
29
|
};
|
|
@@ -24,9 +24,13 @@ export interface ErdEditorElement extends ErdEditorProps, HTMLElement {
|
|
|
24
24
|
setTheme: (theme: Partial<ThemeType>) => void;
|
|
25
25
|
setKeyBindingMap: (keyBindingMap: Partial<Omit<KeyBindingMap, typeof KeyBindingName.edit | typeof KeyBindingName.stop | typeof KeyBindingName.search | typeof KeyBindingName.undo | typeof KeyBindingName.redo | typeof KeyBindingName.zoomIn | typeof KeyBindingName.zoomOut>>) => void;
|
|
26
26
|
setSchemaSQL: (value: string) => void;
|
|
27
|
+
setSchemaGraphQL: (value: string) => void;
|
|
28
|
+
setSchemaDBML: (value: string) => void;
|
|
29
|
+
setSchemaAML: (value: string) => void;
|
|
27
30
|
getSchemaSQL: (databaseVendor?: DatabaseVendor) => string;
|
|
28
31
|
getSharedStore: (config?: SharedStoreConfig & {
|
|
29
32
|
mouseTracker?: boolean;
|
|
33
|
+
focusTracker?: boolean;
|
|
30
34
|
}) => SharedStore;
|
|
31
35
|
setDiffValue: (value: string) => void;
|
|
32
36
|
}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { FC } from '@dineug/r-html';
|
|
2
2
|
export type GlobalStylesProps = {};
|
|
3
|
+
/**
|
|
4
|
+
* Renders nothing, and stays anyway. What is left is the setGlobalStyleOrder
|
|
5
|
+
* call above, a module side effect, and being a component is what keeps its
|
|
6
|
+
* import load-bearing on its face rather than a naked side-effect import.
|
|
7
|
+
*/
|
|
3
8
|
declare const GlobalStyles: FC<GlobalStylesProps>;
|
|
4
9
|
export default GlobalStyles;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { StoryObj } from '@storybook/html';
|
|
1
|
+
import { StoryObj } from '@storybook/html-vite';
|
|
2
2
|
import { ButtonProps } from './Button';
|
|
3
3
|
declare const meta: {
|
|
4
4
|
title: string;
|
|
5
5
|
render: (args: ButtonProps) => DocumentFragment;
|
|
6
6
|
argTypes: {
|
|
7
7
|
size: {
|
|
8
|
-
control:
|
|
8
|
+
control: "radio";
|
|
9
9
|
options: string[];
|
|
10
10
|
};
|
|
11
11
|
variant: {
|
|
12
|
-
control:
|
|
12
|
+
control: "radio";
|
|
13
13
|
options: string[];
|
|
14
14
|
};
|
|
15
15
|
text: {
|
|
16
|
-
control:
|
|
16
|
+
control: "text";
|
|
17
17
|
};
|
|
18
18
|
onClick: {
|
|
19
19
|
action: string;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { StoryObj } from '@storybook/html';
|
|
1
|
+
import { StoryObj } from '@storybook/html-vite';
|
|
2
2
|
import { CodeBlockProps } from './CodeBlock';
|
|
3
3
|
declare const meta: {
|
|
4
4
|
title: string;
|
|
5
5
|
render: (args: CodeBlockProps) => DocumentFragment;
|
|
6
6
|
argTypes: {
|
|
7
7
|
value: {
|
|
8
|
-
control:
|
|
8
|
+
control: "text";
|
|
9
9
|
};
|
|
10
10
|
lang: {
|
|
11
|
-
control:
|
|
11
|
+
control: "select";
|
|
12
12
|
options: string[];
|
|
13
13
|
};
|
|
14
14
|
theme: {
|
|
15
|
-
control:
|
|
15
|
+
control: "radio";
|
|
16
16
|
options: string[];
|
|
17
17
|
};
|
|
18
18
|
onCopy: {
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
export declare const clipboard: import('@dineug/r-html').CSSTemplateLiterals;
|
|
2
2
|
export declare const root: import('@dineug/r-html').CSSTemplateLiterals;
|
|
3
|
-
|
|
3
|
+
/** Out of flow, the root loses its content height and collapses to min-height. */
|
|
4
|
+
export declare const scroller: import('@dineug/r-html').CSSTemplateLiterals;
|
|
5
|
+
/** Sized by the preview, so the overlay stretched onto it has no scroll of its own to desync. */
|
|
6
|
+
export declare const layers: import('@dineug/r-html').CSSTemplateLiterals;
|
|
7
|
+
export declare const preview: import('@dineug/r-html').CSSTemplateLiterals;
|
|
8
|
+
export declare const textarea: import('@dineug/r-html').CSSTemplateLiterals;
|