@visuallyjs/browser-ui 1.0.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/css/visuallyjs-theme.css +148 -0
- package/css/visuallyjs.css +1879 -0
- package/js/visuallyjs.browser-ui.cjs.js +143 -0
- package/js/visuallyjs.browser-ui.esm.js +143 -0
- package/package.json +16 -0
- package/types/browser-ui/base-dom-ui-layout-adapter.d.ts +14 -0
- package/types/browser-ui/browser-ui.d.ts +95 -0
- package/types/browser-ui/browser-util.d.ts +233 -0
- package/types/browser-ui/browser-visuallyjs-instance.d.ts +881 -0
- package/types/browser-ui/canvas-layout-adapter.d.ts +15 -0
- package/types/browser-ui/collicat.d.ts +245 -0
- package/types/browser-ui/components/controls/controls-component.d.ts +137 -0
- package/types/browser-ui/components/controls/copy-paste-controls-component.d.ts +9 -0
- package/types/browser-ui/components/controls/css-classes.d.ts +79 -0
- package/types/browser-ui/components/controls/index.d.ts +4 -0
- package/types/browser-ui/components/controls/svg-export-component.d.ts +60 -0
- package/types/browser-ui/components/edge-type-picker/edge-type-picker.d.ts +37 -0
- package/types/browser-ui/components/edge-type-picker/index.d.ts +1 -0
- package/types/browser-ui/components/index.d.ts +4 -0
- package/types/browser-ui/components/inspector/color-picker-tag.d.ts +32 -0
- package/types/browser-ui/components/inspector/definitions.d.ts +114 -0
- package/types/browser-ui/components/inspector/edge-type-tag.d.ts +15 -0
- package/types/browser-ui/components/inspector/index.d.ts +6 -0
- package/types/browser-ui/components/inspector/inspector.d.ts +138 -0
- package/types/browser-ui/components/inspector/shape-type-inspector.d.ts +43 -0
- package/types/browser-ui/components/inspector/vanilla-inspector.d.ts +39 -0
- package/types/browser-ui/components/palette/index.d.ts +2 -0
- package/types/browser-ui/components/palette/palette-content-generator.d.ts +14 -0
- package/types/browser-ui/components/palette/palette-options.d.ts +159 -0
- package/types/browser-ui/components/palette/palette.d.ts +126 -0
- package/types/browser-ui/connector-editor.d.ts +65 -0
- package/types/browser-ui/connector-editors/anchors.d.ts +31 -0
- package/types/browser-ui/connector-editors/css-constants.d.ts +33 -0
- package/types/browser-ui/connector-editors/definitions.d.ts +74 -0
- package/types/browser-ui/connector-editors/editor-base.d.ts +177 -0
- package/types/browser-ui/connector-editors/index.d.ts +52 -0
- package/types/browser-ui/connector-editors/util.d.ts +33 -0
- package/types/browser-ui/connector-editors-bezier/bezier-editor.d.ts +82 -0
- package/types/browser-ui/connector-editors-bezier/css-constants.d.ts +42 -0
- package/types/browser-ui/connector-editors-bezier/index.d.ts +9 -0
- package/types/browser-ui/connector-editors-orthogonal/css-constants.d.ts +28 -0
- package/types/browser-ui/connector-editors-orthogonal/index.d.ts +9 -0
- package/types/browser-ui/connector-editors-orthogonal/orthogonal-editor.d.ts +86 -0
- package/types/browser-ui/connector-editors-straight/auto-split-mode.d.ts +24 -0
- package/types/browser-ui/connector-editors-straight/click-split-mode.d.ts +20 -0
- package/types/browser-ui/connector-editors-straight/css-constants.d.ts +30 -0
- package/types/browser-ui/connector-editors-straight/definitions.d.ts +69 -0
- package/types/browser-ui/connector-editors-straight/index.d.ts +11 -0
- package/types/browser-ui/connector-editors-straight/straight-editor.d.ts +42 -0
- package/types/browser-ui/constants.d.ts +79 -0
- package/types/browser-ui/copy-paste/clipboard.d.ts +34 -0
- package/types/browser-ui/copy-paste/index.d.ts +2 -0
- package/types/browser-ui/copy-paste/transformer.d.ts +14 -0
- package/types/browser-ui/css-constants.d.ts +436 -0
- package/types/browser-ui/d.d.ts +2 -0
- package/types/browser-ui/definitions.d.ts +442 -0
- package/types/browser-ui/dialogs/binder.d.ts +49 -0
- package/types/browser-ui/dialogs/constants.d.ts +51 -0
- package/types/browser-ui/dialogs/dialogs.d.ts +30 -0
- package/types/browser-ui/dialogs/index.d.ts +3 -0
- package/types/browser-ui/drag-manager-2.d.ts +54 -0
- package/types/browser-ui/edge-handler-base.d.ts +168 -0
- package/types/browser-ui/edge-input-handler.d.ts +116 -0
- package/types/browser-ui/edge-mappings/flowchart-basic.d.ts +22 -0
- package/types/browser-ui/edge-mappings/index.d.ts +1 -0
- package/types/browser-ui/edge-relocate-handler.d.ts +51 -0
- package/types/browser-ui/element-drag-handler-2.d.ts +254 -0
- package/types/browser-ui/element-dragger.d.ts +45 -0
- package/types/browser-ui/element-facade.d.ts +11 -0
- package/types/browser-ui/event-manager.d.ts +50 -0
- package/types/browser-ui/fixed-layer.d.ts +107 -0
- package/types/browser-ui/group-layout-adapter.d.ts +19 -0
- package/types/browser-ui/html-element-overlay.d.ts +32 -0
- package/types/browser-ui/icons/definitions.d.ts +59 -0
- package/types/browser-ui/icons/icon-renderer.d.ts +43 -0
- package/types/browser-ui/icons/index.d.ts +2 -0
- package/types/browser-ui/index.d.ts +48 -0
- package/types/browser-ui/pan-zoom-options.d.ts +262 -0
- package/types/browser-ui/pan-zoom.d.ts +674 -0
- package/types/browser-ui/paper-renderer/definitions.d.ts +83 -0
- package/types/browser-ui/paper-renderer/index.d.ts +2 -0
- package/types/browser-ui/paper-renderer/paper.d.ts +50 -0
- package/types/browser-ui/pinch-listener.d.ts +33 -0
- package/types/browser-ui/plugins/background/available-backgrounds.d.ts +12 -0
- package/types/browser-ui/plugins/background/background-options.d.ts +62 -0
- package/types/browser-ui/plugins/background/background-plugin.d.ts +62 -0
- package/types/browser-ui/plugins/background/generated-grid-background.d.ts +230 -0
- package/types/browser-ui/plugins/background/index.d.ts +6 -0
- package/types/browser-ui/plugins/background/simple-background.d.ts +33 -0
- package/types/browser-ui/plugins/background/tiled-background.d.ts +118 -0
- package/types/browser-ui/plugins/browser-ui-plugin.d.ts +90 -0
- package/types/browser-ui/plugins/edge-routing/index.d.ts +66 -0
- package/types/browser-ui/plugins/index.d.ts +5 -0
- package/types/browser-ui/plugins/selected-edge-highlight/index.d.ts +1 -0
- package/types/browser-ui/plugins/selected-edge-highlight/selected-edge-highlight-plugin.d.ts +36 -0
- package/types/browser-ui/plugins/ui-states/index.d.ts +2 -0
- package/types/browser-ui/plugins/ui-states/ui-state.d.ts +14 -0
- package/types/browser-ui/plugins/ui-states/ui-states-plugin.d.ts +69 -0
- package/types/browser-ui/positioning-and-sizing-utils.d.ts +103 -0
- package/types/browser-ui/shape-library/index.d.ts +4 -0
- package/types/browser-ui/shape-library/shape-library-definitions.d.ts +243 -0
- package/types/browser-ui/shape-library/shape-library.d.ts +266 -0
- package/types/browser-ui/shape-library/shapes-basic.d.ts +7 -0
- package/types/browser-ui/shape-library/shapes-flowchart.d.ts +7 -0
- package/types/browser-ui/storage.d.ts +8 -0
- package/types/browser-ui/surface-renderer/anim/anim.d.ts +64 -0
- package/types/browser-ui/surface-renderer/anim/constants.d.ts +74 -0
- package/types/browser-ui/surface-renderer/anim/definitions.d.ts +134 -0
- package/types/browser-ui/surface-renderer/anim/index.d.ts +4 -0
- package/types/browser-ui/surface-renderer/anim/path-transport.d.ts +23 -0
- package/types/browser-ui/surface-renderer/css-classes.d.ts +64 -0
- package/types/browser-ui/surface-renderer/decorators.d.ts +162 -0
- package/types/browser-ui/surface-renderer/definitions.d.ts +83 -0
- package/types/browser-ui/surface-renderer/diagrams/constants.d.ts +28 -0
- package/types/browser-ui/surface-renderer/diagrams/definitions.d.ts +528 -0
- package/types/browser-ui/surface-renderer/diagrams/diagram-cell.d.ts +123 -0
- package/types/browser-ui/surface-renderer/diagrams/diagram-link.d.ts +116 -0
- package/types/browser-ui/surface-renderer/diagrams/diagram-palette.d.ts +11 -0
- package/types/browser-ui/surface-renderer/diagrams/diagram-tools.d.ts +112 -0
- package/types/browser-ui/surface-renderer/diagrams/diagram.d.ts +221 -0
- package/types/browser-ui/surface-renderer/diagrams/index.d.ts +25 -0
- package/types/browser-ui/surface-renderer/diagrams/mediator.d.ts +59 -0
- package/types/browser-ui/surface-renderer/diagrams/util.d.ts +15 -0
- package/types/browser-ui/surface-renderer/elastic-group-manager.d.ts +102 -0
- package/types/browser-ui/surface-renderer/index.d.ts +34 -0
- package/types/browser-ui/surface-renderer/params.d.ts +175 -0
- package/types/browser-ui/surface-renderer/plugins/controls/controls-plugin.d.ts +26 -0
- package/types/browser-ui/surface-renderer/plugins/controls/index.d.ts +1 -0
- package/types/browser-ui/surface-renderer/plugins/drag-groups/drag-groups-plugin.d.ts +78 -0
- package/types/browser-ui/surface-renderer/plugins/drag-groups/index.d.ts +1 -0
- package/types/browser-ui/surface-renderer/plugins/export-controls/export-controls-plugin.d.ts +25 -0
- package/types/browser-ui/surface-renderer/plugins/export-controls/index.d.ts +1 -0
- package/types/browser-ui/surface-renderer/plugins/index.d.ts +10 -0
- package/types/browser-ui/surface-renderer/plugins/lasso/index.d.ts +2 -0
- package/types/browser-ui/surface-renderer/plugins/lasso/lasso-plugin.d.ts +78 -0
- package/types/browser-ui/surface-renderer/plugins/lasso/lasso.d.ts +74 -0
- package/types/browser-ui/surface-renderer/plugins/miniview/index.d.ts +1 -0
- package/types/browser-ui/surface-renderer/plugins/miniview/miniview-plugin.d.ts +235 -0
- package/types/browser-ui/surface-renderer/plugins/palette/index.d.ts +1 -0
- package/types/browser-ui/surface-renderer/plugins/palette/palette-plugin.d.ts +17 -0
- package/types/browser-ui/surface-renderer/plugins/pan-buttons/index.d.ts +1 -0
- package/types/browser-ui/surface-renderer/plugins/pan-buttons/pan-buttons-plugin.d.ts +55 -0
- package/types/browser-ui/surface-renderer/plugins/resizing-tools/border-drag-handlers.d.ts +3 -0
- package/types/browser-ui/surface-renderer/plugins/resizing-tools/definitions.d.ts +411 -0
- package/types/browser-ui/surface-renderer/plugins/resizing-tools/drag-handlers.d.ts +3 -0
- package/types/browser-ui/surface-renderer/plugins/resizing-tools/handle-gen.d.ts +15 -0
- package/types/browser-ui/surface-renderer/plugins/resizing-tools/index.d.ts +4 -0
- package/types/browser-ui/surface-renderer/plugins/resizing-tools/resizing-tools-plugin.d.ts +185 -0
- package/types/browser-ui/surface-renderer/plugins/resizing-tools/util.d.ts +16 -0
- package/types/browser-ui/surface-renderer/plugins/snaplines/index.d.ts +1 -0
- package/types/browser-ui/surface-renderer/plugins/snaplines/snaplines-plugin.d.ts +128 -0
- package/types/browser-ui/surface-renderer/plugins/vertex-drawing/definitions.d.ts +90 -0
- package/types/browser-ui/surface-renderer/plugins/vertex-drawing/index.d.ts +2 -0
- package/types/browser-ui/surface-renderer/plugins/vertex-drawing/vertex-drawing-plugin.d.ts +64 -0
- package/types/browser-ui/surface-renderer/shape-palette-options.d.ts +127 -0
- package/types/browser-ui/surface-renderer/shape-palette.d.ts +55 -0
- package/types/browser-ui/surface-renderer/surface-decorator.d.ts +35 -0
- package/types/browser-ui/surface-renderer/surface-events.d.ts +9 -0
- package/types/browser-ui/surface-renderer/surface-render-options.d.ts +125 -0
- package/types/browser-ui/surface-renderer/surface.d.ts +665 -0
- package/types/browser-ui/svg-component.d.ts +6 -0
- package/types/browser-ui/svg-element-connector.d.ts +16 -0
- package/types/browser-ui/svg-element-overlay.d.ts +55 -0
- package/types/browser-ui/svg-export/definitions.d.ts +153 -0
- package/types/browser-ui/svg-export/image-export-ui.d.ts +20 -0
- package/types/browser-ui/svg-export/image-exporter.d.ts +15 -0
- package/types/browser-ui/svg-export/index.d.ts +6 -0
- package/types/browser-ui/svg-export/svg-export-ui.d.ts +11 -0
- package/types/browser-ui/svg-export/svg-exporter.d.ts +8 -0
- package/types/browser-ui/svg-export/util.d.ts +23 -0
- package/types/browser-ui/svg-util.d.ts +27 -0
- package/types/browser-ui/templating/browser-ui-recado.d.ts +48 -0
- package/types/browser-ui/templating/custom-tag-definition.d.ts +32 -0
- package/types/browser-ui/templating/index.d.ts +11 -0
- package/types/browser-ui/templating/recado-template-renderer.d.ts +69 -0
- package/types/browser-ui/ui-path.d.ts +57 -0
- package/types/browser-ui/util.d.ts +4 -0
- package/types/browser-ui/wheel-listener.d.ts +2 -0
- package/types/charts/area/area-chart.d.ts +85 -0
- package/types/charts/area/index.d.ts +1 -0
- package/types/charts/bar-and-column/bar-chart.d.ts +34 -0
- package/types/charts/bar-and-column/bar-plot.d.ts +90 -0
- package/types/charts/bar-and-column/column-chart.d.ts +35 -0
- package/types/charts/bar-and-column/index.d.ts +3 -0
- package/types/charts/base-chart.d.ts +395 -0
- package/types/charts/base-xy-chart.d.ts +224 -0
- package/types/charts/bubble/bubble-chart.d.ts +30 -0
- package/types/charts/bubble/definitions.d.ts +32 -0
- package/types/charts/bubble/index.d.ts +2 -0
- package/types/charts/category-value-chart.d.ts +146 -0
- package/types/charts/chart-exporter.d.ts +38 -0
- package/types/charts/chart-zoom-controls.d.ts +23 -0
- package/types/charts/constants.d.ts +16 -0
- package/types/charts/css-classes.d.ts +312 -0
- package/types/charts/datasource.d.ts +61 -0
- package/types/charts/definitions.d.ts +261 -0
- package/types/charts/domain_scale_utilities.d.ts +72 -0
- package/types/charts/dual-value-chart.d.ts +60 -0
- package/types/charts/gauge/definitions.d.ts +108 -0
- package/types/charts/gauge/gauge-chart.d.ts +91 -0
- package/types/charts/gauge/index.d.ts +2 -0
- package/types/charts/index.d.ts +25 -0
- package/types/charts/legend.d.ts +120 -0
- package/types/charts/line/index.d.ts +1 -0
- package/types/charts/line/line-chart.d.ts +79 -0
- package/types/charts/markers.d.ts +13 -0
- package/types/charts/pie/index.d.ts +1 -0
- package/types/charts/pie/pie-chart.d.ts +146 -0
- package/types/charts/plot.d.ts +75 -0
- package/types/charts/sankey/index.d.ts +1 -0
- package/types/charts/sankey/preprocessor.d.ts +37 -0
- package/types/charts/sankey/sankey.d.ts +208 -0
- package/types/charts/scatter/definitions.d.ts +6 -0
- package/types/charts/scatter/index.d.ts +2 -0
- package/types/charts/scatter/scatter-chart.d.ts +16 -0
- package/types/charts/series/array-based-series.d.ts +95 -0
- package/types/charts/series/collation-series.d.ts +24 -0
- package/types/charts/series/definitions.d.ts +52 -0
- package/types/charts/series/dual-value-chart-series.d.ts +26 -0
- package/types/charts/series/index.d.ts +7 -0
- package/types/charts/series/record-based-series.d.ts +58 -0
- package/types/charts/series/series.d.ts +66 -0
- package/types/charts/series/summing-collation-series.d.ts +31 -0
- package/types/charts/series/summing-series.d.ts +19 -0
- package/types/charts/series-based-chart.d.ts +59 -0
- package/types/charts/tooltip.d.ts +167 -0
- package/types/charts/util.d.ts +149 -0
- package/types/core/astar/astar-path-finder.d.ts +37 -0
- package/types/core/astar/astar-util.d.ts +100 -0
- package/types/core/astar/candidate-finder.d.ts +16 -0
- package/types/core/astar/candidate-sorter.d.ts +10 -0
- package/types/core/astar/definitions.d.ts +185 -0
- package/types/core/astar/index.d.ts +3 -0
- package/types/core/astar/path-to-segments.d.ts +45 -0
- package/types/core/autosaver.d.ts +67 -0
- package/types/core/color-generator.d.ts +66 -0
- package/types/core/constants.d.ts +181 -0
- package/types/core/csv-loader.d.ts +84 -0
- package/types/core/datamodel/data-model.d.ts +23 -0
- package/types/core/datamodel/vertex-definition.d.ts +40 -0
- package/types/core/datasource.d.ts +87 -0
- package/types/core/event-constants.d.ts +308 -0
- package/types/core/event-generator.d.ts +102 -0
- package/types/core/filterable-dataset.d.ts +38 -0
- package/types/core/geom.d.ts +278 -0
- package/types/core/index.d.ts +39 -0
- package/types/core/io.d.ts +106 -0
- package/types/core/layout/absolute-layout.d.ts +91 -0
- package/types/core/layout/abstract-layout-adapter.d.ts +17 -0
- package/types/core/layout/abstract-layout.d.ts +192 -0
- package/types/core/layout/circular/circular-layout.d.ts +31 -0
- package/types/core/layout/circular/index.d.ts +1 -0
- package/types/core/layout/empty-layout.d.ts +17 -0
- package/types/core/layout/force-directed/force-directed-layout.d.ts +148 -0
- package/types/core/layout/force-directed/index.d.ts +1 -0
- package/types/core/layout/grid/definitions.d.ts +81 -0
- package/types/core/layout/grid/grid-layout.d.ts +60 -0
- package/types/core/layout/grid/index.d.ts +2 -0
- package/types/core/layout/hierarchical/abstract-hierarchical-layout.d.ts +90 -0
- package/types/core/layout/hierarchical/balloon-layout.d.ts +62 -0
- package/types/core/layout/hierarchical/definitions.d.ts +45 -0
- package/types/core/layout/hierarchical/hierarchical-layout.d.ts +102 -0
- package/types/core/layout/hierarchical/index.d.ts +5 -0
- package/types/core/layout/hierarchical/parent-relative-placement.d.ts +96 -0
- package/types/core/layout/hierarchy/assign-layers-stage.d.ts +26 -0
- package/types/core/layout/hierarchy/crossing-stage.d.ts +78 -0
- package/types/core/layout/hierarchy/definitions.d.ts +261 -0
- package/types/core/layout/hierarchy/edge-routing.d.ts +25 -0
- package/types/core/layout/hierarchy/hierarchy-layout-stage.d.ts +9 -0
- package/types/core/layout/hierarchy/hierarchy-layout.d.ts +87 -0
- package/types/core/layout/hierarchy/index.d.ts +11 -0
- package/types/core/layout/hierarchy/model.d.ts +167 -0
- package/types/core/layout/hierarchy/parent-relative-placement.d.ts +69 -0
- package/types/core/layout/hierarchy/placement-stage.d.ts +82 -0
- package/types/core/layout/hierarchy/util.d.ts +13 -0
- package/types/core/layout/hierarchy/vertex-set.d.ts +45 -0
- package/types/core/layout/index.d.ts +10 -0
- package/types/core/layout/layouts.d.ts +10 -0
- package/types/core/magnetizer.d.ts +232 -0
- package/types/core/model/anchor.d.ts +38 -0
- package/types/core/model/cluster.d.ts +19 -0
- package/types/core/model/defs.d.ts +8 -0
- package/types/core/model/djikstra.d.ts +26 -0
- package/types/core/model/floyd-warshall.d.ts +15 -0
- package/types/core/model/graph.d.ts +1166 -0
- package/types/core/model/path.d.ts +227 -0
- package/types/core/params.d.ts +476 -0
- package/types/core/renderer.d.ts +74 -0
- package/types/core/router/common.d.ts +104 -0
- package/types/core/router/direct-router.d.ts +12 -0
- package/types/core/router/index.d.ts +3 -0
- package/types/core/router/orthogonal-router.d.ts +46 -0
- package/types/core/rtree/definitions.d.ts +24 -0
- package/types/core/rtree/hilbert.d.ts +9 -0
- package/types/core/rtree/index.d.ts +4 -0
- package/types/core/rtree/rtree.d.ts +102 -0
- package/types/core/rtree/util.d.ts +55 -0
- package/types/core/search/index.d.ts +1 -0
- package/types/core/search/visuallyjs-search.d.ts +167 -0
- package/types/core/selection.d.ts +394 -0
- package/types/core/templates/abstract-entry.d.ts +19 -0
- package/types/core/templates/comment-entry.d.ts +11 -0
- package/types/core/templates/core.d.ts +162 -0
- package/types/core/templates/custom-tag.d.ts +74 -0
- package/types/core/templates/defs.d.ts +123 -0
- package/types/core/templates/each-entry.d.ts +23 -0
- package/types/core/templates/element-entry.d.ts +18 -0
- package/types/core/templates/elements.d.ts +14 -0
- package/types/core/templates/executions.d.ts +100 -0
- package/types/core/templates/expressions.d.ts +47 -0
- package/types/core/templates/fake-dom.d.ts +42 -0
- package/types/core/templates/headless.d.ts +15 -0
- package/types/core/templates/if-entry.d.ts +25 -0
- package/types/core/templates/index.d.ts +14 -0
- package/types/core/templates/parser.d.ts +84 -0
- package/types/core/templates/text-entry.d.ts +17 -0
- package/types/core/templates/tmpl-entry.d.ts +13 -0
- package/types/core/toolkit.d.ts +1314 -0
- package/types/core/undo-redo/compound-action.d.ts +19 -0
- package/types/core/undo-redo/edge-action.d.ts +62 -0
- package/types/core/undo-redo/group-action.d.ts +60 -0
- package/types/core/undo-redo/move-action.d.ts +18 -0
- package/types/core/undo-redo/node-group-action.d.ts +62 -0
- package/types/core/undo-redo/port-action.d.ts +29 -0
- package/types/core/undo-redo/renderer-vertex-removed-action.d.ts +17 -0
- package/types/core/undo-redo/set-type-action.d.ts +14 -0
- package/types/core/undo-redo/undo-redo.d.ts +203 -0
- package/types/core/undo-redo/update-action.d.ts +20 -0
- package/types/core/undo-redo/vertex-update-action.d.ts +12 -0
- package/types/core/util.d.ts +661 -0
- package/types/index.d.ts +16 -0
- package/types/l.d.ts +2 -0
- package/types/test-support/index.d.ts +1 -0
- package/types/test-support/test-support.d.ts +833 -0
- package/types/ui/common/abstract-segment.d.ts +88 -0
- package/types/ui/common/anchor.d.ts +280 -0
- package/types/ui/common/connector.d.ts +106 -0
- package/types/ui/common/index.d.ts +5 -0
- package/types/ui/common/overlay.d.ts +117 -0
- package/types/ui/common/paint-style.d.ts +33 -0
- package/types/ui/connector-bezier/abstract-bezier-connector.d.ts +68 -0
- package/types/ui/connector-bezier/bezier-connector.d.ts +34 -0
- package/types/ui/connector-bezier/bezier-segment.d.ts +31 -0
- package/types/ui/connector-bezier/bezier.d.ts +129 -0
- package/types/ui/connector-bezier/index.d.ts +6 -0
- package/types/ui/connector-bezier/operations.d.ts +18 -0
- package/types/ui/connector-bezier/quadratic-bezier-connector.d.ts +35 -0
- package/types/ui/connector-orthogonal/default-orthogonal-path-compute.d.ts +11 -0
- package/types/ui/connector-orthogonal/definitions.d.ts +120 -0
- package/types/ui/connector-orthogonal/index.d.ts +7 -0
- package/types/ui/connector-orthogonal/modern-source-target-relocator.d.ts +37 -0
- package/types/ui/connector-orthogonal/operations.d.ts +49 -0
- package/types/ui/connector-orthogonal/stub-calculators.d.ts +12 -0
- package/types/ui/connector-orthogonal/utils.d.ts +134 -0
- package/types/ui/connector-orthogonal/vertex-avoidance.d.ts +29 -0
- package/types/ui/connector-straight/index.d.ts +2 -0
- package/types/ui/connector-straight/operations.d.ts +55 -0
- package/types/ui/connector-straight/straight-connector.d.ts +121 -0
- package/types/ui/copy-paste/clipboard.d.ts +45 -0
- package/types/ui/copy-paste/copy-data.d.ts +93 -0
- package/types/ui/copy-paste/index.d.ts +2 -0
- package/types/ui/core/callbacks.d.ts +48 -0
- package/types/ui/core/component/component.d.ts +115 -0
- package/types/ui/core/connector/abstract-connector.d.ts +66 -0
- package/types/ui/core/connector/arc-segment.d.ts +39 -0
- package/types/ui/core/connector/connection-impl.d.ts +81 -0
- package/types/ui/core/connector/connections.d.ts +113 -0
- package/types/ui/core/connector/connectors.d.ts +205 -0
- package/types/ui/core/connector/operations.d.ts +0 -0
- package/types/ui/core/connector/segments.d.ts +24 -0
- package/types/ui/core/connector/straight-segment.d.ts +32 -0
- package/types/ui/core/constants.d.ts +181 -0
- package/types/ui/core/context.d.ts +26 -0
- package/types/ui/core/core-events.d.ts +7 -0
- package/types/ui/core/core.d.ts +1734 -0
- package/types/ui/core/css-constants.d.ts +149 -0
- package/types/ui/core/defaults.d.ts +242 -0
- package/types/ui/core/definitions.d.ts +540 -0
- package/types/ui/core/event-constants.d.ts +510 -0
- package/types/ui/core/factory/anchor-record-factory.d.ts +17 -0
- package/types/ui/core/factory/continuous-anchors.d.ts +27 -0
- package/types/ui/core/factory/overlay-factory.d.ts +8 -0
- package/types/ui/core/grid-profile.d.ts +28 -0
- package/types/ui/core/group-collapse-expand.d.ts +23 -0
- package/types/ui/core/group-sizer.d.ts +9 -0
- package/types/ui/core/index.d.ts +45 -0
- package/types/ui/core/magnetize-profile.d.ts +82 -0
- package/types/ui/core/overlay/arrow-overlay.d.ts +34 -0
- package/types/ui/core/overlay/custom-overlay.d.ts +38 -0
- package/types/ui/core/overlay/diamond-overlay.d.ts +14 -0
- package/types/ui/core/overlay/dot-overlay.d.ts +54 -0
- package/types/ui/core/overlay/ellipse-overlay.d.ts +60 -0
- package/types/ui/core/overlay/label-overlay.d.ts +37 -0
- package/types/ui/core/overlay/overlay.d.ts +131 -0
- package/types/ui/core/overlay/plain-arrow-overlay.d.ts +15 -0
- package/types/ui/core/overlay/rectangle-overlay.d.ts +66 -0
- package/types/ui/core/params.d.ts +223 -0
- package/types/ui/core/router/astar-path-finder.d.ts +29 -0
- package/types/ui/core/router/base-router.d.ts +100 -0
- package/types/ui/core/router/default-router.d.ts +38 -0
- package/types/ui/core/router/index.d.ts +5 -0
- package/types/ui/core/router/router-utils.d.ts +118 -0
- package/types/ui/core/router/router.d.ts +30 -0
- package/types/ui/core/type-descriptors.d.ts +83 -0
- package/types/ui/core/ui-model.d.ts +65 -0
- package/types/ui/core/view/common-options.d.ts +15 -0
- package/types/ui/core/view/edge-options.d.ts +126 -0
- package/types/ui/core/view/events.d.ts +159 -0
- package/types/ui/core/view/group-options.d.ts +75 -0
- package/types/ui/core/view/index.d.ts +35 -0
- package/types/ui/core/view/node-options.d.ts +20 -0
- package/types/ui/core/view/node-or-port-options.d.ts +28 -0
- package/types/ui/core/view/port-options.d.ts +51 -0
- package/types/ui/core/view/vertex-options.d.ts +28 -0
- package/types/ui/core/viewport.d.ts +297 -0
- package/types/ui/index.d.ts +9 -0
- package/types/ui/plugins/definitions.d.ts +118 -0
- package/types/ui/plugins/index.d.ts +2 -0
- package/types/ui/plugins/plugins.d.ts +7 -0
- package/types/ui/property-mappings/definitions.d.ts +28 -0
- package/types/ui/property-mappings/index.d.ts +2 -0
- package/types/ui/property-mappings/property-mapper.d.ts +16 -0
- package/types/ui/util/index.d.ts +3 -0
- package/types/ui/util/property-tracker.d.ts +8 -0
- package/types/ui/util/svg-constants.d.ts +111 -0
- package/types/ui/util/util.d.ts +69 -0
- package/types/version.d.ts +1 -0
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { Surface } from "./surface-renderer";
|
|
2
|
+
import { BrowserElement } from "./util";
|
|
3
|
+
import { VisuallyJSDOMElement } from "./element-facade";
|
|
4
|
+
import { Vertex, BoundingBox, PointXY, RectangleXY, RTree, AnchorOrientationHint, ObjectAnchorSpec } from "../core";
|
|
5
|
+
import { EdgeInputMethod } from "./edge-input-handler";
|
|
6
|
+
import { ElementModelInfo } from "./definitions";
|
|
7
|
+
/**
|
|
8
|
+
* Defines the default behaviour for edge snap to target - for small targets (width + height is less than 30 pixels), snap to the center. For larger targets, snap to the perimeter. When the mouse is over the target, do not snap.
|
|
9
|
+
* @group Edges
|
|
10
|
+
* @category Edge Snapping
|
|
11
|
+
* @constant
|
|
12
|
+
*/
|
|
13
|
+
export declare const EDGE_SNAP_DEFAULT = "default";
|
|
14
|
+
/**
|
|
15
|
+
* Defines the 'center' behaviour for edge snap to target - always snap to the center, regardless of the size of the target
|
|
16
|
+
* @group Edges
|
|
17
|
+
* @category Edge Snapping
|
|
18
|
+
* @constant
|
|
19
|
+
*/
|
|
20
|
+
export declare const EDGE_SNAP_CENTER = "center";
|
|
21
|
+
/**
|
|
22
|
+
* Defines the 'center' behaviour for edge snap to target - always snap to the perimeter, regardless of the size of the target
|
|
23
|
+
* @group Edges
|
|
24
|
+
* @category Edge Snapping
|
|
25
|
+
* @constant
|
|
26
|
+
*/
|
|
27
|
+
export declare const EDGE_SNAP_PERIMETER = "perimeter";
|
|
28
|
+
/**
|
|
29
|
+
* Types of edge snap available.
|
|
30
|
+
* @group Edges
|
|
31
|
+
* @category Edge Snapping
|
|
32
|
+
*/
|
|
33
|
+
export type EdgeSnapType = typeof EDGE_SNAP_DEFAULT | typeof EDGE_SNAP_CENTER | typeof EDGE_SNAP_PERIMETER;
|
|
34
|
+
/**
|
|
35
|
+
* Options for edge snap.
|
|
36
|
+
* @group Components
|
|
37
|
+
* @category Surface
|
|
38
|
+
*/
|
|
39
|
+
export interface EdgeSnapOptions {
|
|
40
|
+
/**
|
|
41
|
+
* How to snap - see docs for {@link EdgeSnapType}
|
|
42
|
+
*/
|
|
43
|
+
type?: EdgeSnapType;
|
|
44
|
+
/**
|
|
45
|
+
* Threshold in pixels for snapping to targets.
|
|
46
|
+
*/
|
|
47
|
+
threshold?: number;
|
|
48
|
+
/**
|
|
49
|
+
* Threshold in pixels for what determines a small vs a large target. See {@link EdgeSnapType} for discussion.
|
|
50
|
+
*/
|
|
51
|
+
sizeThreshold?: number;
|
|
52
|
+
/**
|
|
53
|
+
* Whether or not snap is enabled. Required.
|
|
54
|
+
*/
|
|
55
|
+
enabled: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* If true, snapping will only operate on elements in the DOM that have been marked as magnets via the {@link ATTRIBUTE_VJS_MAGNET} attribute. Otherwise snapping will operate on all targets.
|
|
58
|
+
*/
|
|
59
|
+
requireMagnets?: boolean;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* @internal
|
|
63
|
+
*/
|
|
64
|
+
export declare const sourceElementSelector: string;
|
|
65
|
+
/**
|
|
66
|
+
* @internal
|
|
67
|
+
*/
|
|
68
|
+
export declare const targetElementSelector: string;
|
|
69
|
+
/**
|
|
70
|
+
* @internal
|
|
71
|
+
*/
|
|
72
|
+
export interface EdgeHandlerBaseOptions {
|
|
73
|
+
method?: EdgeInputMethod;
|
|
74
|
+
instance: Surface;
|
|
75
|
+
activeFiltering: boolean;
|
|
76
|
+
edgeSnap: EdgeSnapOptions;
|
|
77
|
+
allowLoopbackEdges: boolean;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* @internal
|
|
81
|
+
*/
|
|
82
|
+
export type DropTarget = {
|
|
83
|
+
modelInfo: ElementModelInfo;
|
|
84
|
+
r: BoundingBox;
|
|
85
|
+
isGroup: boolean;
|
|
86
|
+
anchor?: ObjectAnchorSpec;
|
|
87
|
+
anchorIndex?: number;
|
|
88
|
+
targetEl: VisuallyJSDOMElement;
|
|
89
|
+
targetPortType?: string;
|
|
90
|
+
magnet?: boolean;
|
|
91
|
+
positionOnElement?: PointXY;
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* Find target zones in the given surface
|
|
95
|
+
* @param surface
|
|
96
|
+
* @internal
|
|
97
|
+
*/
|
|
98
|
+
export declare function _findTargetZones(surface: Surface): Array<BrowserElement>;
|
|
99
|
+
/**
|
|
100
|
+
* For a given drag selector, find the current list of target elements that match, according to the selector's redrop policy.
|
|
101
|
+
* @param surface
|
|
102
|
+
* @internal
|
|
103
|
+
*/
|
|
104
|
+
export declare function _findSourceZones(surface: Surface): Array<BrowserElement>;
|
|
105
|
+
export declare function _findZones(surface: Surface, selector: string): Array<BrowserElement>;
|
|
106
|
+
/**
|
|
107
|
+
* Gets vertex info for the given element.
|
|
108
|
+
* @param surface
|
|
109
|
+
* @param el
|
|
110
|
+
* @param asSource
|
|
111
|
+
* @internal
|
|
112
|
+
*/
|
|
113
|
+
export declare function _getVertexInfo(surface: Surface, el: BrowserElement, asSource: boolean): ElementModelInfo | null;
|
|
114
|
+
/**
|
|
115
|
+
* @internal
|
|
116
|
+
* @param surface
|
|
117
|
+
* @param dropTargets
|
|
118
|
+
* @param boundingRect
|
|
119
|
+
* @param e
|
|
120
|
+
*/
|
|
121
|
+
export declare function testIntersectingDropTarget(surface: Surface, dropTargets: Array<DropTarget>, boundingRect: RectangleXY, e: MouseEvent): DropTarget;
|
|
122
|
+
export declare function _populateTargetZones(surface: Surface, activeFiltering: boolean, focusVertex: Vertex, loopbackAllowed: boolean, scope?: string): {
|
|
123
|
+
dropTargets: Array<DropTarget>;
|
|
124
|
+
disabledDropTargets: Array<VisuallyJSDOMElement>;
|
|
125
|
+
};
|
|
126
|
+
export declare function _populateSourceZones(surface: Surface, activeFiltering: boolean, focusVertex: Vertex, loopbackAllowed: boolean, scope?: string): {
|
|
127
|
+
dropTargets: Array<DropTarget>;
|
|
128
|
+
disabledDropTargets: Array<VisuallyJSDOMElement>;
|
|
129
|
+
};
|
|
130
|
+
export declare function _populateZones(surface: Surface, activeFiltering: boolean, focusVertex: Vertex, focusVertexIsTarget: boolean, loopbackAllowed: boolean, scope?: string): {
|
|
131
|
+
dropTargets: Array<DropTarget>;
|
|
132
|
+
disabledDropTargets: Array<VisuallyJSDOMElement>;
|
|
133
|
+
};
|
|
134
|
+
/**
|
|
135
|
+
* @internal
|
|
136
|
+
*/
|
|
137
|
+
export declare class EdgeHandlerBase {
|
|
138
|
+
protected surface: Surface;
|
|
139
|
+
protected container: BrowserElement;
|
|
140
|
+
protected edgeSnap: boolean;
|
|
141
|
+
protected edgeSnapRequiresMagnets: boolean;
|
|
142
|
+
protected edgeSnapSizeThreshold: number;
|
|
143
|
+
protected edgeSnapThreshold: number;
|
|
144
|
+
protected edgeSnapType: EdgeSnapType;
|
|
145
|
+
protected allowLoopbackEdges: boolean;
|
|
146
|
+
activeFiltering: boolean;
|
|
147
|
+
protected rtree: RTree;
|
|
148
|
+
disabledDropTargets: Array<BrowserElement>;
|
|
149
|
+
dropTargets: Array<DropTarget>;
|
|
150
|
+
currentDropTarget: DropTarget;
|
|
151
|
+
constructor(options: EdgeHandlerBaseOptions);
|
|
152
|
+
/**
|
|
153
|
+
* For the given point, test if it intersects the bounding rect of any of our drop targets (with a 50 pixels buffer). If so,
|
|
154
|
+
* test if the point is inside the rectangle, in which case we return the point unchanged. But otherwise it must be in the
|
|
155
|
+
* buffer, so we find the closest face midpoint to that point and snap to there.
|
|
156
|
+
* @param p Point to test
|
|
157
|
+
* @param edgeSnapThreshold Buffer to set around point when testing for intersections, defaults to 50.
|
|
158
|
+
* @param edgeSnapSizeThreshold Threshold that defines a small vs large target. If a target exceeds this value in either axis it is
|
|
159
|
+
* deemed large, and then we may snap to midpoints.
|
|
160
|
+
* @param edgeSnapType Type of snap to perform.
|
|
161
|
+
* @internal
|
|
162
|
+
*/
|
|
163
|
+
_magnetizeToTarget(p: PointXY, edgeSnapThreshold: number, edgeSnapSizeThreshold: number, edgeSnapType: EdgeSnapType): PointXY;
|
|
164
|
+
}
|
|
165
|
+
export declare function _findAnchorOrientation(p: PointXY): {
|
|
166
|
+
ox: AnchorOrientationHint;
|
|
167
|
+
oy: AnchorOrientationHint;
|
|
168
|
+
};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { LightweightAnchor, Connection, ViewportElement } from "../ui";
|
|
2
|
+
import { BrowserElement } from "./util";
|
|
3
|
+
import { Edge, Node, Vertex } from "../core";
|
|
4
|
+
import { PointXY } from "../core";
|
|
5
|
+
import { EdgeHandlerBase, EdgeHandlerBaseOptions } from "./edge-handler-base";
|
|
6
|
+
/**
|
|
7
|
+
* Added to placeholder elements used when relocating edges by dragging, or when an edge exists in the
|
|
8
|
+
* dataset but has no source or no target
|
|
9
|
+
* @group Edges
|
|
10
|
+
* @category CSS Classes
|
|
11
|
+
*/
|
|
12
|
+
export declare const CLASS_TRANSIENT_VERTEX = "vjs-transient-vertex";
|
|
13
|
+
export declare const EVENT_KEYUP = "keyup";
|
|
14
|
+
/**
|
|
15
|
+
* Defines the drag method of creating new edges with the mouse/touch events
|
|
16
|
+
* @group Edges
|
|
17
|
+
* @constant
|
|
18
|
+
*/
|
|
19
|
+
export declare const EDGE_INPUT_METHOD_DRAG = "drag";
|
|
20
|
+
/**
|
|
21
|
+
* Defines the click method of creating new edges with the mouse/touch events
|
|
22
|
+
* @group Edges
|
|
23
|
+
* @constant
|
|
24
|
+
*/
|
|
25
|
+
export declare const EDGE_INPUT_METHOD_CLICK = "click";
|
|
26
|
+
/**
|
|
27
|
+
* Defines the available methods of edge creation with mouse/touch events
|
|
28
|
+
* @group Edges
|
|
29
|
+
*/
|
|
30
|
+
export type EdgeInputMethod = typeof EDGE_INPUT_METHOD_CLICK | typeof EDGE_INPUT_METHOD_DRAG;
|
|
31
|
+
export declare const EDGE_INPUT_STATE_IDLE = "idle";
|
|
32
|
+
declare const EDGE_INPUT_STATE_DRAGGING = "dragging";
|
|
33
|
+
declare const EDGE_INPUT_STATE_AWAITING_CLICK = "awaitingClick";
|
|
34
|
+
export declare const EDGE_INPUT_STATE_LOCKED = "locked";
|
|
35
|
+
export type EdgeInputState = typeof EDGE_INPUT_STATE_IDLE | typeof EDGE_INPUT_STATE_DRAGGING | typeof EDGE_INPUT_STATE_AWAITING_CLICK | typeof EDGE_INPUT_STATE_LOCKED;
|
|
36
|
+
/**
|
|
37
|
+
* @internal
|
|
38
|
+
*/
|
|
39
|
+
export interface EdgeInputHandlerOptions extends EdgeHandlerBaseOptions {
|
|
40
|
+
_edgeDragStart: (edge: Edge) => void;
|
|
41
|
+
_edgeDragging: (edge: Edge) => void;
|
|
42
|
+
_edgeDragEnd: (edge: Edge) => void;
|
|
43
|
+
_edgeAbort: (edge: Edge, originalEvent?: Event) => void;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Handler for the input of new edges via drag or tap events.
|
|
47
|
+
* @internal
|
|
48
|
+
*/
|
|
49
|
+
export declare class EdgeInputHandler extends EdgeHandlerBase {
|
|
50
|
+
pageDownAt: PointXY;
|
|
51
|
+
canvasPositionAtDown: PointXY;
|
|
52
|
+
currentPagePosition: PointXY;
|
|
53
|
+
scrollAtPageDown: PointXY;
|
|
54
|
+
currentSource: Vertex;
|
|
55
|
+
currentPoints: Array<PointXY>;
|
|
56
|
+
mousemoveHandler: (e: MouseEvent) => void;
|
|
57
|
+
tapHandler: (e: MouseEvent) => void;
|
|
58
|
+
canvasTapHandler: (e: MouseEvent) => any;
|
|
59
|
+
documentKeypressHandler: (e: KeyboardEvent) => any;
|
|
60
|
+
currentMethod: EdgeInputMethod;
|
|
61
|
+
currentState: EdgeInputState;
|
|
62
|
+
private _edgeDragStart;
|
|
63
|
+
private _edgeDragging;
|
|
64
|
+
private _edgeDragEnd;
|
|
65
|
+
private _edgeAbort;
|
|
66
|
+
transientInfo: {
|
|
67
|
+
vertex: Node;
|
|
68
|
+
el: ViewportElement<BrowserElement>;
|
|
69
|
+
};
|
|
70
|
+
transientEdge: Edge;
|
|
71
|
+
transientConnection: Connection<BrowserElement>;
|
|
72
|
+
transientTargetAnchor: LightweightAnchor;
|
|
73
|
+
private _dragContext;
|
|
74
|
+
method: EdgeInputMethod;
|
|
75
|
+
private _autoPanObserver;
|
|
76
|
+
constructor(options: EdgeInputHandlerOptions);
|
|
77
|
+
private _cleanup;
|
|
78
|
+
private _addTransientEdge;
|
|
79
|
+
private _updateTransientEdge;
|
|
80
|
+
private _refreshTransientEdge;
|
|
81
|
+
/**
|
|
82
|
+
* Determines whether or not a new edge could be added to the given vertex.
|
|
83
|
+
* @param vertexInfo
|
|
84
|
+
* @private
|
|
85
|
+
*/
|
|
86
|
+
private _canStartNewEdgeInput;
|
|
87
|
+
private _start;
|
|
88
|
+
private _finaliseTransientEdge;
|
|
89
|
+
private _stop;
|
|
90
|
+
/**
|
|
91
|
+
* Common mouse move functionality. This method calls back to get a bounding box,
|
|
92
|
+
* and expects the mouse event that instigated the move
|
|
93
|
+
* @param getbb
|
|
94
|
+
* @param e
|
|
95
|
+
* @internal
|
|
96
|
+
*/
|
|
97
|
+
private __move;
|
|
98
|
+
/**
|
|
99
|
+
* Handler for mouse move when in tap mode.
|
|
100
|
+
* @param e
|
|
101
|
+
* @internal
|
|
102
|
+
*/
|
|
103
|
+
private _mousemoveHandler;
|
|
104
|
+
/**
|
|
105
|
+
* Handler for mouse move when in drag mode.
|
|
106
|
+
* @param p
|
|
107
|
+
* @internal
|
|
108
|
+
*/
|
|
109
|
+
private _drag;
|
|
110
|
+
private _ensureTransientConnection;
|
|
111
|
+
private _tapHandler;
|
|
112
|
+
private $_exitTapMode;
|
|
113
|
+
private _canvasTapHandler;
|
|
114
|
+
private _documentKeypressListener;
|
|
115
|
+
}
|
|
116
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { EdgePropertyMappings } from "../../ui";
|
|
2
|
+
export declare const DEFAULT_FLOWCHART_ARROW_WIDTH = 15;
|
|
3
|
+
export declare const DEFAULT_FLOWCHART_ARROW_LENGTH = 10;
|
|
4
|
+
export declare const DEFAULT_FLOWCHART_PROPERTY_MARKERS = "markers";
|
|
5
|
+
export declare const DEFAULT_FLOWCHART_PROPERTY_LINE_STYLE = "lineStyle";
|
|
6
|
+
export declare const FLOWCHART_EDGE_TYPE_SOURCE_ARROW = "sourceArrow";
|
|
7
|
+
export declare const FLOWCHART_EDGE_TYPE_TARGET_ARROW = "targetArrow";
|
|
8
|
+
export declare const FLOWCHART_EDGE_TYPE_BOTH_ARROWS = "bothArrows";
|
|
9
|
+
export declare const FLOWCHART_EDGE_TYPE_PLAIN = "plain";
|
|
10
|
+
export declare const FLOWCHART_EDGE_TYPE_DASHED = "dashed";
|
|
11
|
+
/**
|
|
12
|
+
* Basic edge mappings for flowcharts - a 'dashed' or 'plain' line style, and source/target/both/none arrow markers, with a configurable width/height
|
|
13
|
+
* @param options
|
|
14
|
+
* @constructor
|
|
15
|
+
* @edgeMapping
|
|
16
|
+
*/
|
|
17
|
+
export declare function FlowchartBasicEdgeMappings(options?: {
|
|
18
|
+
lineStyleProperty?: string;
|
|
19
|
+
markersProperty?: string;
|
|
20
|
+
arrowWidth?: number;
|
|
21
|
+
arrowLength?: number;
|
|
22
|
+
}): EdgePropertyMappings;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./flowchart-basic";
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { BrowserElement } from "./util";
|
|
2
|
+
import { Edge, Node, PointXY, ProxyLocation } from "../core";
|
|
3
|
+
import { Connection, ViewportElement } from "../ui";
|
|
4
|
+
import { EdgeHandlerBase, EdgeHandlerBaseOptions } from "./edge-handler-base";
|
|
5
|
+
import { EdgeInputHandler } from "./edge-input-handler";
|
|
6
|
+
/**
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export interface EdgeRelocateHandlerOptions extends EdgeHandlerBaseOptions {
|
|
10
|
+
inputHandler: EdgeInputHandler;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Handler for edge relocation via mouse/touch.
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
export declare class EdgeRelocateHandler extends EdgeHandlerBase {
|
|
17
|
+
private _inputHandler;
|
|
18
|
+
private _inputMethod;
|
|
19
|
+
private _currentMode;
|
|
20
|
+
transientVertex: {
|
|
21
|
+
vertex: Node;
|
|
22
|
+
el: ViewportElement<BrowserElement>;
|
|
23
|
+
};
|
|
24
|
+
currentEdge: Edge;
|
|
25
|
+
currentConnection: Connection<BrowserElement>;
|
|
26
|
+
currentIndex: ProxyLocation;
|
|
27
|
+
mouseMoveHandler: (e: MouseEvent) => void;
|
|
28
|
+
mouseUpHandler: (e: MouseEvent) => void;
|
|
29
|
+
documentKeypressHandler: (e: KeyboardEvent) => any;
|
|
30
|
+
private _canvasShift;
|
|
31
|
+
private _autoPanObserver;
|
|
32
|
+
currentPosition: PointXY;
|
|
33
|
+
currentPagePosition: PointXY;
|
|
34
|
+
private _hasMoved;
|
|
35
|
+
private _transientAnchor;
|
|
36
|
+
private _suspendedVertex;
|
|
37
|
+
constructor(options: EdgeRelocateHandlerOptions);
|
|
38
|
+
private _updateTransientVertex;
|
|
39
|
+
/**
|
|
40
|
+
* Perhaps abort a relocate, perhaps reattaching the edge, perhaps detaching it into whitespace.
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
43
|
+
private _abort;
|
|
44
|
+
/**
|
|
45
|
+
* Clean everything up after a drag - or an aborted drag
|
|
46
|
+
* @private
|
|
47
|
+
*/
|
|
48
|
+
private _cleanup;
|
|
49
|
+
private _populateTargets;
|
|
50
|
+
private _documentKeypressListener;
|
|
51
|
+
}
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import { SupportsElementDragging, VertexDragFilter, ViewportGroupElement, ViewportNodeElement, ViewportElement } from "../ui";
|
|
2
|
+
import { BrowserElement } from "./util";
|
|
3
|
+
import { PointXY, Grid } from "../core";
|
|
4
|
+
import { BrowserUI } from "./browser-visuallyjs-instance";
|
|
5
|
+
declare enum DragStates {
|
|
6
|
+
idle = "idle",
|
|
7
|
+
dragging = "dragging"
|
|
8
|
+
}
|
|
9
|
+
export type DragState = keyof typeof DragStates;
|
|
10
|
+
/**
|
|
11
|
+
* Flag indicating a drag group member was assigned automatically
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export declare const DRAG_GROUP_MEMBERSHIP_ASSIGNED = "assigned";
|
|
15
|
+
/**
|
|
16
|
+
* Flag indicating a drag group member was assigned by the user
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
export declare const DRAG_GROUP_MEMBERSHIP_ADDED = "added";
|
|
20
|
+
/**
|
|
21
|
+
* Types of drag group membership
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
24
|
+
export type DragGroupMembership = typeof DRAG_GROUP_MEMBERSHIP_ADDED | typeof DRAG_GROUP_MEMBERSHIP_ASSIGNED;
|
|
25
|
+
/**
|
|
26
|
+
* Spec for some member of a drag group
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
type DragGroupMemberSpec<E> = {
|
|
30
|
+
el: ViewportNodeElement<E> | ViewportGroupElement<E>;
|
|
31
|
+
active: boolean;
|
|
32
|
+
membership: DragGroupMembership;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Model of a drag group
|
|
36
|
+
* @internal
|
|
37
|
+
*/
|
|
38
|
+
type DragGroup<E> = {
|
|
39
|
+
id: string;
|
|
40
|
+
members: Set<DragGroupMemberSpec<E>>;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Internal model of a drag group spec - used when adding members by various internal methods
|
|
44
|
+
* @internal
|
|
45
|
+
*/
|
|
46
|
+
export type InternalDragGroupSpec = {
|
|
47
|
+
id: string;
|
|
48
|
+
active: boolean;
|
|
49
|
+
membership: DragGroupMembership;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* @internal
|
|
53
|
+
*/
|
|
54
|
+
export interface IntersectionObserverImpl {
|
|
55
|
+
observe(el: Element): void;
|
|
56
|
+
disconnect(): void;
|
|
57
|
+
unobserve(el: Element): void;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* @internal
|
|
61
|
+
*/
|
|
62
|
+
export type IntersectionObserverEntry = {
|
|
63
|
+
target: Element;
|
|
64
|
+
intersectionRect: {
|
|
65
|
+
x: number;
|
|
66
|
+
y: number;
|
|
67
|
+
width: number;
|
|
68
|
+
height: number;
|
|
69
|
+
};
|
|
70
|
+
boundingClientRect: {
|
|
71
|
+
x: number;
|
|
72
|
+
y: number;
|
|
73
|
+
width: number;
|
|
74
|
+
height: number;
|
|
75
|
+
};
|
|
76
|
+
rootBounds: {
|
|
77
|
+
x: number;
|
|
78
|
+
y: number;
|
|
79
|
+
width: number;
|
|
80
|
+
height: number;
|
|
81
|
+
};
|
|
82
|
+
isIntersecting: boolean;
|
|
83
|
+
intersectionRatio: number;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* @internal
|
|
87
|
+
*/
|
|
88
|
+
export type IntersectionObserverEntries = Array<IntersectionObserverEntry>;
|
|
89
|
+
/**
|
|
90
|
+
* @internal
|
|
91
|
+
* @param spec
|
|
92
|
+
*/
|
|
93
|
+
export declare function decodeDragGroupSpec(spec: InternalDragGroupSpec | string): InternalDragGroupSpec;
|
|
94
|
+
export interface ElementDragHandler2Options<E> {
|
|
95
|
+
ui: BrowserUI;
|
|
96
|
+
draggableInstance: SupportsElementDragging<E>;
|
|
97
|
+
resolveGrid: () => Grid | null;
|
|
98
|
+
inputFilterSelector?: string;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Drag handler for elements.
|
|
102
|
+
*
|
|
103
|
+
*
|
|
104
|
+
*
|
|
105
|
+
* @internal
|
|
106
|
+
*/
|
|
107
|
+
export declare class ElementDragHandler2 {
|
|
108
|
+
inputFilterSelector: string;
|
|
109
|
+
private _dragStartFilters;
|
|
110
|
+
private _vertexDragFilters;
|
|
111
|
+
activeGrid: Grid;
|
|
112
|
+
downAt: PointXY;
|
|
113
|
+
viewportPositionAtDown: PointXY;
|
|
114
|
+
relativePositionAtDown: PointXY;
|
|
115
|
+
newPosition: PointXY;
|
|
116
|
+
private _ignoreCanvasShift;
|
|
117
|
+
private _canvasShift;
|
|
118
|
+
tapHandler: (e: MouseEvent) => void;
|
|
119
|
+
canvasTapHandler: (e: MouseEvent) => any;
|
|
120
|
+
documentKeypressHandler: (e: KeyboardEvent) => any;
|
|
121
|
+
private _currentSurfaceZoom;
|
|
122
|
+
private _activeEffectiveZoom;
|
|
123
|
+
/**
|
|
124
|
+
* This is the current element (and associated model object) that is being dragged.
|
|
125
|
+
*/
|
|
126
|
+
private _dragContext;
|
|
127
|
+
/**
|
|
128
|
+
* This is the parent group of the current drag object. This is only set if the drag object was in a group at the start of the drag
|
|
129
|
+
*/
|
|
130
|
+
private _dragParentGroup;
|
|
131
|
+
/**
|
|
132
|
+
* This is set if _dragParentGroup is set. It is the details of the group content element in the parent group, which has an offset from the group origin (although that can be [0,0] in groups whose content area is the group element itself).
|
|
133
|
+
*/
|
|
134
|
+
private _dragParentGroupContentInfo;
|
|
135
|
+
/**
|
|
136
|
+
* This is set of _dragParentGroup is set. It is the UI's group definition for the parent group. We use it to check if drag is constrained to a group, or to see if an element dragged outside a group should revert, etc.
|
|
137
|
+
*/
|
|
138
|
+
private _dragParentGroupDef;
|
|
139
|
+
/**
|
|
140
|
+
* Set when there was a parent group at drag start and the vertex has left that group at least one time. This flag is used to implement a more user friendly strategy for adding hover/active drag classes on the original group.
|
|
141
|
+
* @internal
|
|
142
|
+
*/
|
|
143
|
+
private _hasExitedOriginalGroup;
|
|
144
|
+
/**
|
|
145
|
+
* Set when there is a parent group at drag start but the shift key was held - the group does not get resized at the end of the drag
|
|
146
|
+
* @private
|
|
147
|
+
*/
|
|
148
|
+
private _ignoreOriginalGroupResize;
|
|
149
|
+
/**
|
|
150
|
+
* @internal
|
|
151
|
+
*/
|
|
152
|
+
private _currentElasticGroup;
|
|
153
|
+
/**
|
|
154
|
+
* List of groups that the current drag object could be dropped on.
|
|
155
|
+
*/
|
|
156
|
+
private _groupTargets;
|
|
157
|
+
/**
|
|
158
|
+
* Whether or not the current drag vertex can be dropped on the canvas.
|
|
159
|
+
* @private
|
|
160
|
+
*/
|
|
161
|
+
private _canDropOnCanvas;
|
|
162
|
+
private _suppressRootElementClasses;
|
|
163
|
+
/**
|
|
164
|
+
* List of group targets whose location intersects the drag object's current position. We push a bunch of groups onto this array and sort them by nested depth to find which one should be the current drop target.
|
|
165
|
+
*/
|
|
166
|
+
private _hoverGroupTargets;
|
|
167
|
+
currentState: DragState;
|
|
168
|
+
private readonly _autoPanObserver;
|
|
169
|
+
private _dragGroupByElementIdMap;
|
|
170
|
+
private _dragGroupMap;
|
|
171
|
+
private _currentDragGroup;
|
|
172
|
+
private _currentDragGroupInfo;
|
|
173
|
+
private _otherMagnetizedElements;
|
|
174
|
+
ui: BrowserUI<BrowserElement>;
|
|
175
|
+
draggableInstance: SupportsElementDragging<BrowserElement>;
|
|
176
|
+
resolveGrid: () => Grid | null;
|
|
177
|
+
constructor(options: ElementDragHandler2Options<BrowserElement>);
|
|
178
|
+
private _testFilter;
|
|
179
|
+
/**
|
|
180
|
+
* @internal
|
|
181
|
+
* @param f
|
|
182
|
+
* @param _handle
|
|
183
|
+
* @param _exclude
|
|
184
|
+
*/
|
|
185
|
+
addDragFilter(f: (e: MouseEvent) => boolean, _handle: string, _exclude?: boolean): void;
|
|
186
|
+
removeFilter(f: Function | string): void;
|
|
187
|
+
addSelectorFilter(selector: string, _exclude?: boolean): void;
|
|
188
|
+
addClassnameFilter(clazz: string | Array<string>, _exclude?: boolean): void;
|
|
189
|
+
/**
|
|
190
|
+
* @internal
|
|
191
|
+
* @param clazz
|
|
192
|
+
* @private
|
|
193
|
+
*/
|
|
194
|
+
private _removeOneClassnameFilter;
|
|
195
|
+
/**
|
|
196
|
+
* Removes a class filter.
|
|
197
|
+
* @param clazz
|
|
198
|
+
*/
|
|
199
|
+
removeClassnameFilter(clazz: string | Array<string>): void;
|
|
200
|
+
clearAllFilters(): void;
|
|
201
|
+
private _cleanup;
|
|
202
|
+
private _cleanupGroupTargetHoverState;
|
|
203
|
+
private _findDraggableVertex;
|
|
204
|
+
private _start;
|
|
205
|
+
private _unobservePanRepeat;
|
|
206
|
+
private _addGroupClass;
|
|
207
|
+
private _removeGroupClass;
|
|
208
|
+
private _stop;
|
|
209
|
+
/**
|
|
210
|
+
* For the current drag group, compute a position for each of the elements such that each element is gathered around the focus position. This is used when dropping a vertex on a group: the focus vertex goes where it was dropped, and the rest of the drag group are pulled in around that focus element. The gather operation should try to maintain the original orientation between the focus element and the other members of the group, but obviously we want to pull them right in close in order to drop them as a unit.
|
|
211
|
+
* @param focusPosition
|
|
212
|
+
* @param dropGroup
|
|
213
|
+
* @param dropGroupContentArea
|
|
214
|
+
* @private
|
|
215
|
+
*/
|
|
216
|
+
private _gatherDragGroup;
|
|
217
|
+
/**
|
|
218
|
+
* Reverts a drag in its entirety - everything, including elements that were
|
|
219
|
+
* @private
|
|
220
|
+
*/
|
|
221
|
+
private _revert;
|
|
222
|
+
private _isOriginalGroup;
|
|
223
|
+
private _moveToNewPosition;
|
|
224
|
+
private _drag;
|
|
225
|
+
private _setRelativePositionAtDown;
|
|
226
|
+
/**
|
|
227
|
+
* @internal
|
|
228
|
+
*/
|
|
229
|
+
_addToDragGroup(spec: InternalDragGroupSpec | string, ...els: Array<ViewportNodeElement<BrowserElement>>): void;
|
|
230
|
+
/**
|
|
231
|
+
* @internal
|
|
232
|
+
*/
|
|
233
|
+
removeFromDragGroup(...els: Array<ViewportElement<BrowserElement>>): void;
|
|
234
|
+
/**
|
|
235
|
+
* @internal
|
|
236
|
+
*/
|
|
237
|
+
$setDragGroupState(active: boolean, ...els: Array<ViewportElement<BrowserElement>>): void;
|
|
238
|
+
/**
|
|
239
|
+
* @internal
|
|
240
|
+
* @param name
|
|
241
|
+
*/
|
|
242
|
+
$clearDragGroup(name: string): void;
|
|
243
|
+
/**
|
|
244
|
+
* Resolve the DragGroup the element with the given id is currently in, may be null.
|
|
245
|
+
* @param elementId
|
|
246
|
+
* @returns
|
|
247
|
+
* @internal
|
|
248
|
+
*/
|
|
249
|
+
$resolveDragGroup(elementId: string): DragGroup<BrowserElement> | null;
|
|
250
|
+
private _sizeElasticGroupFrame;
|
|
251
|
+
private _canDragVertex;
|
|
252
|
+
$addVertexDragFilter(filter: VertexDragFilter<BrowserElement>): void;
|
|
253
|
+
}
|
|
254
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ContainmentType } from "./collicat";
|
|
2
|
+
import { BrowserElement } from "./util";
|
|
3
|
+
import { ConstrainFunction } from "../ui";
|
|
4
|
+
/**
|
|
5
|
+
* Options for an ElementDragger
|
|
6
|
+
* @group Components
|
|
7
|
+
* @category Element Dragger
|
|
8
|
+
*/
|
|
9
|
+
export interface ElementDraggerOptions {
|
|
10
|
+
/**
|
|
11
|
+
* CSS3 filter identifying parts of the elements that should not allow drag
|
|
12
|
+
*/
|
|
13
|
+
filter?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Function to constrain movement of the elements.
|
|
16
|
+
*/
|
|
17
|
+
constrain?: ConstrainFunction<BrowserElement, MouseEvent>;
|
|
18
|
+
/**
|
|
19
|
+
* Shortcut for some basic constrain scenarios - constrain to parent, constrain entirely to parent, dont allow movement into negative axes.
|
|
20
|
+
*/
|
|
21
|
+
containment?: ContainmentType;
|
|
22
|
+
/**
|
|
23
|
+
* If `containment` is set, you can provide a value for padding here. Currently the default is 5 pixels.
|
|
24
|
+
*/
|
|
25
|
+
containmentPadding?: number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* A helper class that uses VisuallyJs's drag management classes to offer a means to
|
|
29
|
+
* make arbitrary DOM elements draggable. They do not need to be children of a Surface canvas.
|
|
30
|
+
*
|
|
31
|
+
* You can pass a single element or an array of elements to the constructor. SVG/HTML elements
|
|
32
|
+
* are supported. SVG child elements - such as `circle`, `rect`, `g` etc - are not.
|
|
33
|
+
*
|
|
34
|
+
* @group Components
|
|
35
|
+
* @category Element Dragger
|
|
36
|
+
*/
|
|
37
|
+
export declare class ElementDragger {
|
|
38
|
+
private collicat;
|
|
39
|
+
private drags;
|
|
40
|
+
constructor(el: ArrayLike<Element> | Element, options?: ElementDraggerOptions);
|
|
41
|
+
/**
|
|
42
|
+
* Unregister all event handlers etc and release resources.
|
|
43
|
+
*/
|
|
44
|
+
destroy(): void;
|
|
45
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Drag } from "./collicat";
|
|
2
|
+
import { VisuallyJsDOMInformation } from "./definitions";
|
|
3
|
+
export interface VisuallyJSDOMElement extends HTMLElement {
|
|
4
|
+
offsetParent: VisuallyJSDOMElement;
|
|
5
|
+
parentNode: VisuallyJSDOMElement;
|
|
6
|
+
parentElement: VisuallyJSDOMElement;
|
|
7
|
+
jtk: VisuallyJsDOMInformation;
|
|
8
|
+
_katavorioDrag?: Drag;
|
|
9
|
+
cloneNode: (deep?: boolean) => VisuallyJSDOMElement;
|
|
10
|
+
getAttribute(name: string): string;
|
|
11
|
+
}
|