@visuallyjs/browser-ui 1.0.2 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/js/visuallyjs.browser-ui.cjs.js +56 -56
  2. package/js/visuallyjs.browser-ui.esm.js +57 -57
  3. package/package.json +1 -1
  4. package/types/browser-ui/browser-ui.d.ts +4 -7
  5. package/types/browser-ui/browser-util.d.ts +1 -0
  6. package/types/browser-ui/browser-visuallyjs-instance.d.ts +12 -6
  7. package/types/browser-ui/components/controls/css-classes.d.ts +24 -0
  8. package/types/browser-ui/components/inspector/color-picker-tag.d.ts +6 -0
  9. package/types/browser-ui/components/palette/palette.d.ts +1 -0
  10. package/types/browser-ui/connector-editors/editor-base.d.ts +0 -1
  11. package/types/browser-ui/connector-editors/util.d.ts +0 -2
  12. package/types/browser-ui/connector-editors-bezier/css-constants.d.ts +0 -12
  13. package/types/browser-ui/constants.d.ts +4 -10
  14. package/types/browser-ui/css-constants.d.ts +57 -8
  15. package/types/browser-ui/definitions.d.ts +27 -6
  16. package/types/browser-ui/dialogs/binder.d.ts +0 -11
  17. package/types/browser-ui/edge-handler-base.d.ts +9 -16
  18. package/types/browser-ui/edge-input-handler.d.ts +3 -10
  19. package/types/browser-ui/edge-mappings/flowchart-basic.d.ts +2 -1
  20. package/types/browser-ui/element-drag-handler-2.d.ts +0 -3
  21. package/types/browser-ui/icons/definitions.d.ts +20 -0
  22. package/types/browser-ui/pan-zoom-options.d.ts +10 -21
  23. package/types/browser-ui/pan-zoom.d.ts +29 -114
  24. package/types/browser-ui/paper-renderer/definitions.d.ts +2 -0
  25. package/types/browser-ui/paper-renderer/paper.d.ts +1 -0
  26. package/types/browser-ui/plugins/background/background-options.d.ts +4 -0
  27. package/types/browser-ui/plugins/background/tiled-background.d.ts +2 -0
  28. package/types/browser-ui/plugins/browser-ui-plugin.d.ts +6 -1
  29. package/types/browser-ui/positioning-and-sizing-utils.d.ts +21 -1
  30. package/types/browser-ui/shape-library/shape-library-definitions.d.ts +26 -11
  31. package/types/browser-ui/shape-library/shape-library.d.ts +14 -3
  32. package/types/browser-ui/shape-library/shapes-basic.d.ts +1 -1
  33. package/types/browser-ui/shape-library/shapes-flowchart.d.ts +1 -1
  34. package/types/browser-ui/surface-renderer/anim/definitions.d.ts +13 -4
  35. package/types/browser-ui/surface-renderer/anim/path-transport.d.ts +0 -1
  36. package/types/browser-ui/surface-renderer/definitions.d.ts +14 -3
  37. package/types/browser-ui/surface-renderer/diagrams/definitions.d.ts +16 -6
  38. package/types/browser-ui/surface-renderer/diagrams/diagram-link.d.ts +2 -0
  39. package/types/browser-ui/surface-renderer/diagrams/diagram-tools.d.ts +4 -0
  40. package/types/browser-ui/surface-renderer/diagrams/diagram.d.ts +4 -1
  41. package/types/browser-ui/surface-renderer/diagrams/index.d.ts +4 -2
  42. package/types/browser-ui/surface-renderer/diagrams/mediator.d.ts +14 -0
  43. package/types/browser-ui/surface-renderer/plugins/controls/controls-plugin.d.ts +2 -0
  44. package/types/browser-ui/surface-renderer/plugins/export-controls/export-controls-plugin.d.ts +3 -1
  45. package/types/browser-ui/surface-renderer/plugins/index.d.ts +1 -0
  46. package/types/browser-ui/surface-renderer/plugins/list-manager/index.d.ts +1 -0
  47. package/types/browser-ui/surface-renderer/plugins/list-manager/list-manager-plugin.d.ts +34 -0
  48. package/types/browser-ui/surface-renderer/plugins/palette/palette-plugin.d.ts +2 -0
  49. package/types/browser-ui/surface-renderer/plugins/pan-buttons/pan-buttons-plugin.d.ts +1 -2
  50. package/types/browser-ui/surface-renderer/plugins/resizing-tools/definitions.d.ts +9 -0
  51. package/types/browser-ui/surface-renderer/plugins/snaplines/snaplines-plugin.d.ts +12 -0
  52. package/types/browser-ui/surface-renderer/plugins/vertex-drawing/vertex-drawing-plugin.d.ts +0 -2
  53. package/types/browser-ui/surface-renderer/shape-palette-options.d.ts +5 -2
  54. package/types/browser-ui/surface-renderer/shape-palette.d.ts +1 -1
  55. package/types/browser-ui/surface-renderer/surface-render-options.d.ts +1 -31
  56. package/types/browser-ui/surface-renderer/surface.d.ts +47 -38
  57. package/types/browser-ui/svg-export/definitions.d.ts +12 -0
  58. package/types/browser-ui/svg-export/image-exporter.d.ts +2 -0
  59. package/types/browser-ui/svg-export/svg-exporter.d.ts +3 -0
  60. package/types/browser-ui/templating/custom-tag-definition.d.ts +1 -2
  61. package/types/browser-ui/util.d.ts +2 -0
  62. package/types/charts/bar-and-column/bar-plot.d.ts +2 -0
  63. package/types/charts/base-chart.d.ts +62 -6
  64. package/types/charts/chart-exporter.d.ts +3 -0
  65. package/types/charts/datasource.d.ts +11 -0
  66. package/types/charts/definitions.d.ts +10 -0
  67. package/types/charts/domain_scale_utilities.d.ts +4 -0
  68. package/types/charts/legend.d.ts +2 -0
  69. package/types/charts/pie/pie-chart.d.ts +2 -0
  70. package/types/charts/sankey/sankey.d.ts +1 -0
  71. package/types/charts/scatter/definitions.d.ts +1 -0
  72. package/types/charts/series/array-based-series.d.ts +2 -0
  73. package/types/charts/series/definitions.d.ts +1 -0
  74. package/types/charts/series/series.d.ts +2 -0
  75. package/types/charts/series-based-chart.d.ts +1 -0
  76. package/types/charts/tooltip.d.ts +7 -2
  77. package/types/charts/util.d.ts +10 -3
  78. package/types/core/autosaver.d.ts +2 -1
  79. package/types/core/csv-loader.d.ts +8 -2
  80. package/types/core/event-constants.d.ts +44 -2
  81. package/types/core/geom.d.ts +1 -0
  82. package/types/core/io.d.ts +31 -7
  83. package/types/core/layout/abstract-layout.d.ts +1 -0
  84. package/types/core/layout/grid/definitions.d.ts +10 -19
  85. package/types/core/layout/grid/grid-layout.d.ts +2 -2
  86. package/types/core/layout/hierarchy/util.d.ts +1 -7
  87. package/types/core/magnetizer.d.ts +1 -0
  88. package/types/core/model/anchor.d.ts +1 -0
  89. package/types/core/model/graph.d.ts +3 -11
  90. package/types/core/model/group-template.d.ts +15 -0
  91. package/types/core/params.d.ts +2 -2
  92. package/types/core/renderer.d.ts +3 -0
  93. package/types/core/rtree/rtree.d.ts +15 -0
  94. package/types/core/selection.d.ts +2 -6
  95. package/types/core/templates/core.d.ts +1 -1
  96. package/types/core/toolkit.d.ts +30 -10
  97. package/types/core/undo-redo/undo-redo.d.ts +0 -22
  98. package/types/core/util.d.ts +4 -1
  99. package/types/ui/common/overlay.d.ts +3 -1
  100. package/types/ui/common/paint-style.d.ts +2 -0
  101. package/types/ui/connector-orthogonal/operations.d.ts +1 -18
  102. package/types/ui/connector-orthogonal/utils.d.ts +0 -6
  103. package/types/ui/connector-straight/straight-connector.d.ts +2 -5
  104. package/types/ui/core/component/component.d.ts +1 -4
  105. package/types/ui/core/connector/connection-impl.d.ts +1 -0
  106. package/types/ui/core/connector/connections.d.ts +0 -29
  107. package/types/ui/core/connector/straight-segment.d.ts +0 -6
  108. package/types/ui/core/constants.d.ts +0 -4
  109. package/types/ui/core/core-events.d.ts +5 -3
  110. package/types/ui/core/core.d.ts +19 -21
  111. package/types/ui/core/defaults.d.ts +43 -9
  112. package/types/ui/core/definitions.d.ts +39 -20
  113. package/types/ui/core/event-constants.d.ts +1 -0
  114. package/types/ui/core/factory/continuous-anchors.d.ts +0 -6
  115. package/types/ui/core/grid-profile.d.ts +3 -1
  116. package/types/ui/core/magnetize-profile.d.ts +1 -3
  117. package/types/ui/core/overlay/overlay.d.ts +2 -0
  118. package/types/ui/core/params.d.ts +8 -99
  119. package/types/ui/core/router/default-router.d.ts +89 -18
  120. package/types/ui/core/router/index.d.ts +0 -1
  121. package/types/ui/core/router/router-utils.d.ts +0 -24
  122. package/types/ui/core/router/router.d.ts +29 -20
  123. package/types/ui/core/type-descriptors.d.ts +2 -0
  124. package/types/ui/core/ui-model.d.ts +3 -0
  125. package/types/ui/core/view/edge-options.d.ts +1 -0
  126. package/types/ui/core/view/events.d.ts +22 -0
  127. package/types/ui/core/view/node-or-port-options.d.ts +6 -0
  128. package/types/ui/core/view/vertex-options.d.ts +2 -0
  129. package/types/ui/core/viewport.d.ts +7 -1
  130. package/types/ui/plugins/definitions.d.ts +6 -1
  131. package/types/ui/plugins/plugins.d.ts +4 -0
  132. package/types/ui/property-mappings/definitions.d.ts +6 -0
  133. package/types/ui/util/util.d.ts +3 -16
  134. package/types/version.d.ts +1 -1
  135. package/types/ui/core/router/base-router.d.ts +0 -100
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visuallyjs/browser-ui",
3
- "version": "1.0.2",
3
+ "version": "1.1.0",
4
4
  "license": "Commercial",
5
5
  "main": "js/visuallyjs.browser-ui.cjs.js",
6
6
  "module": "js/visuallyjs.browser-ui.esm.js",
@@ -37,7 +37,7 @@ export interface TemplateRenderer<E> {
37
37
  export declare class BrowserUIModel extends VisuallyJsModel {
38
38
  fetchUrl(options: UrlFetchOptions): void;
39
39
  /**
40
- * Configures the given element as a Surface, registering it so that it reflects any changes to the underlying data. If there is any data in the model at the time of this call it is rendered; any data subsequently loaded is automatically rendered. You can supply layout arguments to this method (layout type + layout specific parameters), as well as rules for endpoints, paint styles etc.
40
+ * Configures the given element as a Surface, registering it so that it reflects any changes to the underlying data. If there is any data in the model at the time of this call it is rendered; any data subsequently loaded is automatically rendered. You can supply layout arguments to this method (layout type + layout specific parameters), as well as rules for paint styles etc.
41
41
  * @param container The Element to render into
42
42
  * @param options Render options
43
43
  * @param templateRenderer
@@ -50,7 +50,7 @@ export declare class BrowserUIModel extends VisuallyJsModel {
50
50
  */
51
51
  renderDiagram(container: BrowserElement, options?: DiagramOptions): Diagram;
52
52
  /**
53
- * Configures the given element as a {@link Paper}, registering it so that it reflects any changes to the underlying data. If there is any data in the model at the time of this call it is rendered; any data subsequently loaded is automatically rendered. You can supply layout arguments to this method (layout type + layout specific parameters), as well as rules for endpoints, paint styles etc.
53
+ * Configures the given element as a {@link Paper}, registering it so that it reflects any changes to the underlying data. If there is any data in the model at the time of this call it is rendered; any data subsequently loaded is automatically rendered. You can supply layout arguments to this method (layout type + layout specific parameters), as well as rules for paint styles etc.
54
54
  * @param container The Element to render into
55
55
  * @param options Render options
56
56
  * @param defaults
@@ -67,10 +67,7 @@ export declare function newInstance(options?: ModelOptions): BrowserUIModel;
67
67
  /**
68
68
  * This method is not intended to be used by a library user - you should use the `render` method on the model instance instead.
69
69
  *
70
- * Configures the given element as a Surface, registering it so that it reflects any changes to the underlying data. If
71
- * there is any data in the model at the time of this call it is rendered; any data subsequently loaded is automatically
72
- * rendered. You can supply layout arguments to this method (layout type + layout specific parameters), as well as UI rules for
73
- * endpoints, paint styles etc.
70
+ * Configures the given element as a Surface, registering it so that it reflects any changes to the underlying data. If there is any data in the model at the time of this call it is rendered; any data subsequently loaded is automatically rendered. You can supply layout arguments to this method (layout type + layout specific parameters), as well as UI rules for paint styles etc.
74
71
  * @param model The model to render
75
72
  * @param container The Element to render into
76
73
  * @param templateRenderer Template renderer to use - abstracts out the default VisuallyJs template renderer vs Angular/React/Vue etc
@@ -84,7 +81,7 @@ export declare function renderSurface(model: BrowserUIModel, container: BrowserE
84
81
  * Configures the given element as a Paper, registering it so that it reflects any changes to the underlying data. If
85
82
  * there is any data in the model at the time of this call it is rendered; any data subsequently loaded is automatically
86
83
  * rendered. You can supply layout arguments to this method (layout type + layout specific parameters), as well as UI rules for
87
- * endpoints, paint styles etc.
84
+ * paint styles etc.
88
85
  * @param model The model to render
89
86
  * @param container The Element to render into
90
87
  * @param templateRenderer Template renderer to use - abstracts out the default VisuallyJs template renderer vs Angular/React/Vue etc
@@ -218,6 +218,7 @@ export declare function isTextNode(o: any): boolean;
218
218
  export declare function attWithValue(att: string, value: any): string;
219
219
  /**
220
220
  * Returns whether or not the current user prefers dark mode.
221
+ * @internal
221
222
  */
222
223
  export declare function prefersDarkMode(): boolean;
223
224
  /**
@@ -8,6 +8,8 @@ import { ShapeLibrary } from "./shape-library";
8
8
  import { BrowserUIClipboard } from "./copy-paste";
9
9
  /**
10
10
  * An event that the BrowserUI renderer may fire.
11
+ * @group Events
12
+ * @category UI Events
11
13
  */
12
14
  export type BrowserUIEvent = typeof EVENT_EDGE_MOUSEUP | typeof EVENT_EDGE_MOUSEDOWN | typeof EVENT_VERTEX_CLICK | typeof EVENT_VERTEX_DBLCLICK | typeof EVENT_EDGE_CONTEXTMENU | typeof EVENT_EDGE_CLICK | typeof EVENT_EDGE_DBLCLICK | typeof EVENT_VERTEX_DBLTAP | typeof EVENT_VERTEX_TAP | typeof EVENT_VERTEX_MOUSEOVER | typeof EVENT_VERTEX_MOUSEOUT | typeof EVENT_VERTEX_MOUSEMOVE | typeof EVENT_VERTEX_MOUSEDOWN | typeof EVENT_VERTEX_MOUSEUP | typeof EVENT_VERTEX_CONTEXTMENU | typeof EVENT_VERTEX_MOUSEOVER | typeof EVENT_EDGE_MOUSEOVER | typeof EVENT_EDGE_MOUSEOUT | typeof EVENT_GROUP_MOVE;
13
15
  /**
@@ -17,7 +19,6 @@ export type BrowserUIEvent = typeof EVENT_EDGE_MOUSEUP | typeof EVENT_EDGE_MOUSE
17
19
  *
18
20
  */
19
21
  export declare abstract class BrowserUI<EVT = any> extends UICore<BrowserElement, EVT | BrowserUIEvent> {
20
- model: VisuallyJsModel;
21
22
  protected $suspendRendering: boolean;
22
23
  /**
23
24
  * Clipboard for copy/paste of data.
@@ -80,6 +81,12 @@ export declare abstract class BrowserUI<EVT = any> extends UICore<BrowserElement
80
81
  * @internal
81
82
  */
82
83
  private _setupShapeDefs;
84
+ /**
85
+ * Iterates through the shape library and registers any shapes that define 'members'
86
+ * as group templates in the model.
87
+ * @private
88
+ */
89
+ private _registerGroupTemplates;
83
90
  /**
84
91
  * Fire an event for an overlay, and for its related component.
85
92
  * @internal
@@ -258,7 +265,7 @@ export declare abstract class BrowserUI<EVT = any> extends UICore<BrowserElement
258
265
  * - refreshElement method of Viewport
259
266
  *
260
267
  */
261
- $getElementPositionInUIRelativeToCanvasOrigin(el: BrowserElement, knownElementSize?: Size): PointXY;
268
+ $getElementPositionInUIRelativeToCanvasOrigin(el: ViewportElement<BrowserElement>, knownElementSize: Size): PointXY;
262
269
  $setElementSizeInUI(el: BrowserElement, width: number, height: number): void;
263
270
  $setElementWidth(el: BrowserElement, width: number): void;
264
271
  $setElementHeight(el: BrowserElement, height: number): void;
@@ -478,7 +485,7 @@ export declare abstract class BrowserUI<EVT = any> extends UICore<BrowserElement
478
485
  */
479
486
  setContainer(newContainer: BrowserElement): void;
480
487
  /**
481
- * Clears all endpoints and connections and managed elements from the instance of the UI. Does not also clear out
488
+ * Clears all connections and managed elements from the instance of the UI. Does not also clear out
482
489
  * event listeners, selectors, or connection types - for that, use `destroy()`.
483
490
  */
484
491
  reset(): void;
@@ -711,7 +718,7 @@ export declare abstract class BrowserUI<EVT = any> extends UICore<BrowserElement
711
718
  */
712
719
  $setConnectionVisible(c: Connection<BrowserElement>, v: boolean): void;
713
720
  /**
714
- * Manage an element. Adds the element to the viewport and sets up tracking for endpoints/connections for the element, as well as enabling dragging for the element. This method is called internally by various methods of the UI, such as `connect`, `addEndpoint`, `makeSource` and `makeTarget`, so if you use those methods to setup your UI then you may not need to call this. However, if you use the `addSourceSelector` and `addTargetSelector` methods to configure your UI then you will need to register elements using this method, or they will not be draggable.
721
+ * Manage an element. Adds the element to the viewport and sets up tracking for connections for the element, as well as enabling dragging for the element. This method is called internally by various methods of the UI, such as `connect`, `addEndpoint`, `makeSource` and `makeTarget`, so if you use those methods to setup your UI then you may not need to call this. However, if you use the `addSourceSelector` and `addTargetSelector` methods to configure your UI then you will need to register elements using this method, or they will not be draggable.
715
722
  * @param element - Element to manage. This method does not accept a DOM element ID as argument. If you wish to manage elements via their DOM element ID, you should use `manageAll` and pass in an appropriate CSS selector that represents your element, eg `#myElementId`.
716
723
  * @param modelObject
717
724
  * @param position
@@ -827,8 +834,7 @@ export declare abstract class BrowserUI<EVT = any> extends UICore<BrowserElement
827
834
  */
828
835
  toBack(v: string | Vertex | BrowserElement, alsoSendAncestorsToBack?: boolean): void;
829
836
  /**
830
- * Brings the specified element or vertex to the front within its parent container.
831
- * Optionally, this method can also ensure all ancestor elements are brought to the front.
837
+ * Brings the specified element or vertex to the front within its parent container. Optionally, this method can also ensure all ancestor elements are brought to the front.
832
838
  * @param {string | Vertex | BrowserElement} v - The element or vertex to be brought to the front. This can be a string identifier, a `Vertex` object, or a `BrowserElement`.
833
839
  * @param {boolean} [alsoBringAncestorsToFront=false] - Indicates whether the ancestors of the specified element should also be brought to the front. Defaults to `false`.
834
840
  * @return {void} This method does not return a value.
@@ -2,72 +2,96 @@
2
2
  * Assigned to the Pan mode button
3
3
  * @cssClass
4
4
  * @context controls
5
+ * @group Components
6
+ * @category Controls
5
7
  */
6
8
  export declare const CLASS_CONTROLS_PAN_MODE = "vjs-pan-mode";
7
9
  /**
8
10
  * Assigned to the Zoom to fit button
9
11
  * @cssClass
10
12
  * @context controls
13
+ * @group Components
14
+ * @category Controls
11
15
  */
12
16
  export declare const CLASS_CONTROLS_ZOOM_TO_FIT = "vjs-zoom-to-fit";
13
17
  /**
14
18
  * Assigned to the Zoom in button
15
19
  * @cssClass
16
20
  * @context controls
21
+ * @group Components
22
+ * @category Controls
17
23
  */
18
24
  export declare const CLASS_CONTROLS_ZOOM_IN = "vjs-zoom-in";
19
25
  /**
20
26
  * Assigned to the Zoom out button
21
27
  * @cssClass
22
28
  * @context controls
29
+ * @group Components
30
+ * @category Controls
23
31
  */
24
32
  export declare const CLASS_CONTROLS_ZOOM_OUT = "vjs-zoom-out";
25
33
  /**
26
34
  * Assigned to the Select mode button
27
35
  * @cssClass
28
36
  * @context controls
37
+ * @group Components
38
+ * @category Controls
29
39
  */
30
40
  export declare const CLASS_CONTROLS_SELECT_MODE = "vjs-select-mode";
31
41
  /**
32
42
  * Assigned to the Undo button
33
43
  * @cssClass
34
44
  * @context controls
45
+ * @group Components
46
+ * @category Controls
35
47
  */
36
48
  export declare const CLASS_CONTROLS_UNDO = "vjs-undo";
37
49
  /**
38
50
  * Assigned to the Redo button
39
51
  * @cssClass
40
52
  * @context controls
53
+ * @group Components
54
+ * @category Controls
41
55
  */
42
56
  export declare const CLASS_CONTROLS_REDO = "vjs-redo";
43
57
  /**
44
58
  * Assigned to the Clear dataset button
45
59
  * @cssClass
46
60
  * @context controls
61
+ * @group Components
62
+ * @category Controls
47
63
  */
48
64
  export declare const CLASS_CONTROLS_CLEAR = "vjs-clear-dataset";
49
65
  /**
50
66
  * Assigned to either the pan/select mode button, when that mode is active.
51
67
  * @cssClass
52
68
  * @context controls
69
+ * @group Components
70
+ * @category Controls
53
71
  */
54
72
  export declare const CLASS_SELECTED_MODE = "vjs-selected-mode";
55
73
  /**
56
74
  * This class is written to the container element for a controls component.
57
75
  * @cssClass
58
76
  * @context controls
77
+ * @group Components
78
+ * @category Controls
59
79
  */
60
80
  export declare const CLASS_CONTROLS = "vjs-controls";
61
81
  /**
62
82
  * This class is written to the container element for an export controls component.
63
83
  * @cssClass
64
84
  * @context controls
85
+ * @group Components
86
+ * @category Controls
65
87
  */
66
88
  export declare const CLASS_EXPORT_CONTROLS = "vjs-export-controls";
67
89
  /**
68
90
  * Assigned to the reset selection button
69
91
  * @cssClass
70
92
  * @context controls
93
+ * @group Components
94
+ * @category Controls
71
95
  */
72
96
  export declare const CLASS_CONTROLS_RESET_SELECTION = "vjs-controls-reset-selection";
73
97
  /**
@@ -3,18 +3,24 @@ import { VanillaInspector } from "./vanilla-inspector";
3
3
  * Assigned to the root element of a color picker
4
4
  * @cssClass
5
5
  * @context color-picker
6
+ * @group Components
7
+ * @category Inspector
6
8
  */
7
9
  export declare const CLASS_COLOR_PICKER = "vjs-color-picker";
8
10
  /**
9
11
  * Assigned to the element of a color picker that contains swatches
10
12
  * @cssClass
11
13
  * @context color-picker
14
+ * @group Components
15
+ * @category Inspector
12
16
  */
13
17
  export declare const CLASS_COLOR_PICKER_SWATCHES = "vjs-color-picker-swatches";
14
18
  /**
15
19
  * Assigned to each swatch element in a color picker
16
20
  * @cssClass
17
21
  * @context color-picker
22
+ * @group Components
23
+ * @category Inspector
18
24
  */
19
25
  export declare const CLASS_COLOR_PICKER_SWATCH = "vjs-color-picker-swatch";
20
26
  /**
@@ -5,6 +5,7 @@ import { BrowserUI } from "../../browser-visuallyjs-instance";
5
5
  /**
6
6
  * Default data generator for palettes. Extract `data-vjs-***` attributes from element.
7
7
  * @param el
8
+ * @internal
8
9
  */
9
10
  export declare function defaultDataGenerator<T = any>(el: BrowserElement): T;
10
11
  /**
@@ -17,7 +17,6 @@ export declare abstract class EditorBase<ConnectorType extends Connector> implem
17
17
  protected currentEdge: Edge;
18
18
  private _currentEdgeType;
19
19
  private _currentEdgeTypeMapping;
20
- $currentEdgeFrame: SVGElement;
21
20
  $generatedGeometry: any;
22
21
  $hasEdits: boolean;
23
22
  private _anchorCandidates;
@@ -1,4 +1,3 @@
1
- import { BrowserElement } from "../util";
2
1
  import { BrowserUI } from "../browser-visuallyjs-instance";
3
2
  /**
4
3
  * @internal
@@ -8,7 +7,6 @@ import { BrowserUI } from "../browser-visuallyjs-instance";
8
7
  */
9
8
  export declare function $makeCircularHandle(radius: number, clazz: string, atts: Record<string, any>, visible?: boolean): SVGElement;
10
9
  export declare function $makeRectangularHandle(width: number, height: number, rx: number, ry: number, clazz: string, atts: Record<string, any>, visible?: boolean): SVGElement;
11
- export declare function $makeSvgAnchorPlaceholder<E extends HTMLElement>(ui: BrowserUI, parent: BrowserElement, x: number, y: number, width: number, height: number, clazz: string, visible?: boolean): E;
12
10
  /**
13
11
  * Make a circular svg handle, appends it to the tools layer for the given surface, then returns the element.
14
12
  * @param ui
@@ -22,18 +22,6 @@ export declare const CLASS_BEZIER_HANDLE_CONTROL_POINT_1 = "vjs-bezier-handle-co
22
22
  * @category Path Editors
23
23
  */
24
24
  export declare const CLASS_BEZIER_HANDLE_CONTROL_POINT_2 = "vjs-bezier-handle-control-point-2";
25
- /**
26
- * @internal
27
- */
28
- export declare const CLASS_BEZIER_SECONDARY_HANDLE = "vjs-bezier-handle-secondary";
29
- /**
30
- * @internal
31
- */
32
- export declare const CLASS_BEZIER_SECONDARY_SOURCE_HANDLE = "vjs-bezier-handle-secondary-source";
33
- /**
34
- * @internal
35
- */
36
- export declare const CLASS_BEZIER_SECONDARY_TARGET_HANDLE = "vjs-bezier-handle-secondary-target";
37
25
  /**
38
26
  * CSS class assigned to the guidelines linking the anchor points with the control point markers in the bezier edge editor.
39
27
  * @group Edges
@@ -10,12 +10,14 @@ export declare const ATTRIBUTE_CONTAINER = "data-vjs-container";
10
10
  export declare const ATTRIBUTE_GROUP_CONTENT = "data-vjs-group-content";
11
11
  /**
12
12
  * Written onto the part of a group that represents its expanded content, when the group has declared a separate collapsedTemplate.
13
- * @internal.
13
+ * @group Nodes and Groups
14
+ * @category DOM Attributes
14
15
  */
15
16
  export declare const ATTRIBUTE_GROUP_EXPANDED_CONTENT = "data-vjs-expanded-content";
16
17
  /**
17
18
  * Written onto the part of a group that represents its collapsed content, when the group has declared a separate collapsedTemplate.
18
- * @internal.
19
+ * @group Nodes and Groups
20
+ * @category DOM Attributes
19
21
  */
20
22
  export declare const ATTRIBUTE_GROUP_COLLAPSED_CONTENT = "data-vjs-collapsed-content";
21
23
  /**
@@ -37,10 +39,6 @@ export declare const ATTRIBUTE_VJS_SCOPE = "data-vjs-scope";
37
39
  * @category DOM Attributes
38
40
  */
39
41
  export declare const ATTRIBUTE_IS_GROUP = "data-vjs-is-group";
40
- /**
41
- * @internal
42
- */
43
- export declare const ENDPOINT = "endpoint";
44
42
  /**
45
43
  * @internal
46
44
  */
@@ -61,10 +59,6 @@ export declare const PROPERTY_POSITION = "position";
61
59
  * @internal
62
60
  */
63
61
  export declare const SELECTOR_CONNECTOR: string;
64
- /**
65
- * @internal
66
- */
67
- export declare const SELECTOR_GROUP: string;
68
62
  /**
69
63
  * @internal
70
64
  */
@@ -368,69 +368,118 @@ export declare const CLASS_PALETTE_SELECTED_ELEMENT = "vjs-palette-selected-elem
368
368
  * Assigned to the surface canvas when a user has tapped an element in a palette in tap mode. this class can be used to show the user that a vertex can be dropped via click or drawn on the canvas
369
369
  * @cssClass
370
370
  * @context palette
371
+ * @group Components
372
+ * @category Shape Palette
371
373
  */
372
374
  export declare const CLASS_PALETTE_TAP_MODE_ACTIVE = "vjs-palette-tap-mode-active";
373
375
  /**
374
- * Assigned to an element when it is being dragged from a palette
376
+ * Assigned to possible drop targets when an element is being dragged from the Palette
375
377
  * @cssClass
376
378
  * @context palette
379
+ * @group Components
380
+ * @category Shape Palette
377
381
  */
378
- export declare const CLASS_PALETTE_ELEMENT_CURRENT = "vjs-palette-current";
382
+ export declare const CLASS_PALETTE_DRAG_ACTIVE = "vjs-palette-drag-active";
379
383
  /**
380
- * Assigned to a shape in a ShapePalette that matches the type of the model's currently selected shape.
384
+ * Assigned to a drop target when an element that is being dragged from the Palette is hovering over it.
381
385
  * @cssClass
382
386
  * @context palette
387
+ * @group Components
388
+ * @category Shape Palette
383
389
  */
384
- export declare const CLASS_PALETTE_CURRENT_SHAPE_TYPE = "vjs-palette-current-shape-type";
390
+ export declare const CLASS_PALETTE_DRAG_HOVER = "vjs-palette-drag-hover";
391
+ /**
392
+ * Assigned to a vertex or the canvas when an element that is being dragged from the palette is hovering over it but drop is not allowed.
393
+ * @cssClass
394
+ * @context palette,nodes-and-groups
395
+ * @group Components
396
+ * @category Surface
397
+ */
398
+ export declare const CLASS_PALETTE_DRAG_HOVER_CANNOT_DROP = "vjs-palette-drag-hover-cannot-drop";
385
399
  /**
386
- * Assigned to all elements that could be the target for some element that is being dragged from a palette
400
+ * Assigned to an element when it is being dragged from a palette
387
401
  * @cssClass
388
402
  * @context palette
403
+ * @group Components
404
+ * @category Shape Palette
389
405
  */
406
+ export declare const CLASS_PALETTE_ELEMENT_CURRENT = "vjs-palette-current";
390
407
  /**
391
- * Assigned to the current drop target for some element that is being dragged from a palette. This may be the surface's canvas itself, or it may be a group.
408
+ * Assigned to a shape in a ShapePalette that matches the type of the model's currently selected shape.
392
409
  * @cssClass
393
410
  * @context palette
411
+ * @group Components
412
+ * @category Shape Palette
394
413
  */
414
+ export declare const CLASS_PALETTE_CURRENT_SHAPE_TYPE = "vjs-palette-current-shape-type";
395
415
  /**
396
- * Assigned to a vertex or the canvas when an element (either from the palette or having been dragged on the canvas) is hovering over it but drop is not allowed.
416
+ * Assigned to a vertex or the canvas when an element that is being dragged on the canvas is hovering over it but drop is not allowed.
397
417
  * @cssClass
398
- * @context element-dragging,palette,nodes-and-groups
418
+ * @context element-dragging,nodes-and-groups
419
+ * @group Components
420
+ * @category Surface
399
421
  */
400
422
  export declare const CLASS_DRAG_HOVER_CANNOT_DROP = "vjs-drag-hover-cannot-drop";
401
423
  /**
402
424
  * Assigned to a group element when one of its children is being dragged. This can be useful to help manage z-index: we recommend using this class to set a z-index for the drag parent group above that of the other groups, which will ensure that the element you are dragging will appear on top of other groups.
403
425
  * @cssClass
404
426
  * @context element-dragging
427
+ * @group Components
428
+ * @category Surface
405
429
  */
406
430
  export declare const CLASS_DRAG_ORIGINAL_GROUP = "vjs-drag-original-group";
407
431
  /**
408
432
  * Assigned to any element that is a candidate drop target for an edge that is being dragged
409
433
  * @cssClass
410
434
  * @context element-dragging,palette,nodes-and-groups
435
+ * @group Components
436
+ * @category Surface
411
437
  */
412
438
  export declare const CLASS_DRAG_ACTIVE = "vjs-drag-active";
413
439
  /**
414
440
  * Assigned to any element that is the current drop target for an edge that is being dragged
415
441
  * @cssClass
416
442
  * @context element-dragging,palette,nodes-and-groups
443
+ * @group Components
444
+ * @category Surface
417
445
  */
418
446
  export declare const CLASS_DRAG_HOVER = "vjs-drag-hover";
419
447
  /**
420
448
  * Assigned to the source element of an edge when the mouse is hovering over the edge
421
449
  * @cssClass
422
450
  * @context edges, nodes-and-groups
451
+ * @group Components
452
+ * @category Surface
423
453
  */
424
454
  export declare const CLASS_SOURCE_HOVER = "vjs-source-hover";
425
455
  /**
426
456
  * Assigned to the target element of an edge when the mouse is hovering over the edge
427
457
  * @cssClass
428
458
  * @context edges, nodes-and-groups
459
+ * @group Components
460
+ * @category Surface
429
461
  */
430
462
  export declare const CLASS_TARGET_HOVER = "vjs-target-hover";
431
463
  /**
432
464
  * Assigned to the element representing an overlay when the mouse is hovering over the associated edge, and to the edge's connector element.
433
465
  * @cssClass
434
466
  * @context edges, overlays
467
+ * @group Components
468
+ * @category Surface
435
469
  */
436
470
  export declare const CLASS_HOVER = "vjs-hover";
471
+ /**
472
+ * Added to placeholder elements used when relocating edges by dragging, or when an edge exists in the dataset but has no source or no target
473
+ * @group Edges
474
+ * @category CSS Classes
475
+ * @cssClass
476
+ */
477
+ export declare const CLASS_TRANSIENT_VERTEX = "vjs-transient-vertex";
478
+ /**
479
+ * Added to the document body when in click mode for edges, and the user has clicked/tapped a source.
480
+ * @group Edges
481
+ * @category CSS Classes
482
+ * @cssClass
483
+ * @context click-to-add-edges
484
+ */
485
+ export declare const CLASS_EDGE_CLICK_ENTRY = "vjs-edge-click-entry-method";
@@ -77,6 +77,8 @@ export type OnVertexAddedCallback = (p: {
77
77
  }) => any;
78
78
  /**
79
79
  * Defines a function you can call from a vertex added callback to run some model updates that will be included in the same transaction as the one that just added the new vertex. You pass a function in to this method, which contains the model updates you wish to make. Your update function will be passed the UI, its model, and any `context` you provided as a second argument when you called doModelUpdate inside the vertex added callback.
80
+ * @group Components
81
+ * @category Palette
80
82
  */
81
83
  export type ModelUpdateFunction = (updateFunction: (ui: BrowserUI, model: VisuallyJsModel, context?: any) => any) => void;
82
84
  /**
@@ -99,9 +101,7 @@ export type DropTargetInfo = {
99
101
  size: Size;
100
102
  };
101
103
  /**
102
- * Definition of a drag group membership - either just the id of a drag group, or the id of a drag group and whether or not
103
- * this element plays an `active` role in the drag group.
104
- *
104
+ * Definition of a drag group membership - either just the id of a drag group, or the id of a drag group and whether or not this element plays an `active` role in the drag group.
105
105
  * @group Components
106
106
  * @category Element dragging
107
107
  */
@@ -111,10 +111,12 @@ export type DragGroupSpec = string | {
111
111
  };
112
112
  /**
113
113
  * Models some discrete object whose class, in the UI, can be manipulated. This can be an edge/vertex, an element in the UI, or the ID of some edge/vertex.
114
+ * @internal
114
115
  */
115
116
  export type SupportsClassManipulationElement = Edge | Vertex | BrowserElement | string;
116
117
  /**
117
118
  * List of object whose css class, in the UI, can be manipulated. This means either some object that itself satisfies {@link SupportsClassManipulationElement}, or an array of these, or a NodeList of DOM elements.
119
+ * @internal
118
120
  */
119
121
  export type SupportsClassManipulation = SupportsClassManipulationElement | ArrayLike<SupportsClassManipulationElement> | NodeListOf<any>;
120
122
  /**
@@ -175,7 +177,7 @@ export interface BrowserUIOptions<O extends BrowserUIDefaults = BrowserUIDefault
175
177
  */
176
178
  useSvgContainer?: boolean;
177
179
  /**
178
- * Optional Selection - or generator - to use as the dataset to render. If you supply this the Surface will render the contents of the selection, or the list of vertices that the given function returns. This is useful for such things as inspector windows for parts of your UI.
180
+ * Optional Selection - or generator - to use as the dataset to render. If you supply this the UI will render the contents of the selection, or the list of vertices that the given function returns. This is useful for such things as inspector windows for parts of your UI.
179
181
  */
180
182
  selection?: VisuallyJsSelection | Function;
181
183
  /**
@@ -256,7 +258,7 @@ export interface ShapesOptions {
256
258
  * @group Components
257
259
  * @category Defaults
258
260
  */
259
- export interface BrowserUIDefaults extends UICoreDefaults<BrowserElement> {
261
+ export interface BrowserUIDefaults extends UICoreDefaults {
260
262
  /**
261
263
  * Whether or not elements should be draggable. Default value is `true`.
262
264
  */
@@ -266,7 +268,7 @@ export interface BrowserUIDefaults extends UICoreDefaults<BrowserElement> {
266
268
  */
267
269
  resizeObserver?: boolean;
268
270
  /**
269
- * Defaults to false. When true, VisuallyJs tracks mouseover/mouseout/mouseenter/mouseexit events for overlays, endpoints, elements and connections. Most of the reasoning for having this ability was related to the initial canvas renderer, and with SVG/CSS this functionality is, for the most part, not needed. But you can switch it on if you need to.
271
+ * Defaults to false. When true, VisuallyJs tracks mouseover/mouseout/mouseenter/mouseexit events for overlays, elements and connections. Most of the reasoning for having this ability was related to the initial canvas renderer, and with SVG/CSS this functionality is, for the most part, not needed. But you can switch it on if you need to.
270
272
  */
271
273
  hoverEvents?: boolean;
272
274
  useSvgContainer?: boolean;
@@ -358,14 +360,20 @@ export interface ImageBackground extends Background {
358
360
  }
359
361
  /**
360
362
  * Style for a font - oblique, italic or normal.
363
+ * @group UI
364
+ * @category Definitions
361
365
  */
362
366
  export type FontStyle = "normal" | "oblique" | "italic";
363
367
  /**
364
368
  * Font weight to use (e.g., "normal", "bold", "100", "300").
369
+ * @group UI
370
+ * @category Definitions
365
371
  */
366
372
  export type FontWeight = string | number;
367
373
  /**
368
374
  * Specs for a font. The default values depend on the context.
375
+ * @group UI
376
+ * @category Definitions
369
377
  */
370
378
  export interface FontSpec {
371
379
  /**
@@ -385,9 +393,16 @@ export interface FontSpec {
385
393
  */
386
394
  family?: string;
387
395
  }
396
+ /**
397
+ * @internal
398
+ * @param o
399
+ */
388
400
  export declare function supportsPathEditing(o: any): o is SupportsPathEditing;
389
401
  /**
390
402
  * Definition of a UI that supports path editing
403
+ * @group UI
404
+ * @category Definitions
405
+ * @internal
391
406
  */
392
407
  export interface SupportsPathEditing {
393
408
  /**
@@ -405,6 +420,8 @@ export interface SupportsPathEditing {
405
420
  }
406
421
  /**
407
422
  * Options for the zoomToExtents method
423
+ * @group Components
424
+ * @category Surface
408
425
  */
409
426
  export interface ZoomToExtentsOptions {
410
427
  /**
@@ -432,6 +449,10 @@ export interface ZoomToExtentsOptions {
432
449
  */
433
450
  doNotFirePanEvent?: boolean;
434
451
  }
452
+ /**
453
+ * Defines a renderer that supports setting pan/zoom/alignment
454
+ * @internal
455
+ */
435
456
  export interface SupportsViewportManipulation {
436
457
  setPan(x: number, y: number, animate?: boolean): void;
437
458
  setZoom(zoom: number, animate?: boolean): number;
@@ -1,14 +1,3 @@
1
- /**
2
- * Searches children of the given element to find elements that have a `vjs-att` set. For each of those, if the `checkValidity` method is defined,
3
- * this method executes it. If it returns false, this method returns false. If no elements have `checkValidity` or no `checkValidity()` call
4
- * returns false, this method returns true.
5
- *
6
- * `checkValidity` is a method defined in input elements and textareas, when a `pattern` is defined on the element (or if it is marked
7
- * required and has no valuer set)
8
- * @param el
9
- * @internal
10
- */
11
- export declare function checkValidity(el: HTMLElement): boolean;
12
1
  /**
13
2
  * Extracts a dataset from the given element by finding child elements that have a `vjs-att` attribute set, and extracting from those elements
14
3
  * their value. When the same `vjs-att` value appears more than once as a child of `el`, the values are stored in an array for that field.