@visuallyjs/browser-ui-svelte 1.2.6 → 1.2.8

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/definitions.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { type Snippet } from "svelte";
2
2
  import type { DOMAttributes } from "svelte/elements";
3
- import { SurfaceOptions, Vertex, Group, Node, ControlsComponentButtons, DataGeneratorFunction, type BrowserElement, Base, Size, ObjectData, PaletteMode, SvgExportUIOptions, ImageExportUIOptions, ShapeLibraryImpl, ModelOptions, DiagramOptions, Diagram, DiagramCell, NodeMapping, GroupMapping, PortMapping, BrowserUI, EdgeMapping, OnVertexAddedCallback, CanvasDropFilter, FontSpec, BrowserUIModel, PreparedShape, PointXY, FixedElementConstraints, PopupPosition, OverlaySpec, PaperOptions, TilingStrategy, type GridType, Grid, type AutoEdgeConnectOptions, CanDropOnEdgeFilter, LabelPosition } from "@visuallyjs/browser-ui";
3
+ import { SurfaceOptions, Vertex, Group, Node, ControlsComponentButtons, DataGeneratorFunction, Base, Size, ObjectData, PaletteMode, SvgExportUIOptions, ImageExportUIOptions, ShapeLibraryImpl, ModelOptions, DiagramOptions, Diagram, DiagramCell, NodeMapping, GroupMapping, PortMapping, BrowserUI, EdgeMapping, EdgePropertyMappings, PropertyMapping, OnVertexAddedCallback, CanvasDropFilter, FontSpec, BrowserUIModel, PreparedShape, PointXY, FixedElementConstraints, PopupPosition, OverlaySpec, PaperOptions, TilingStrategy, type GridType, Grid, type AutoEdgeConnectOptions, CanDropOnEdgeFilter, LabelPosition } from "@visuallyjs/browser-ui";
4
4
  /**
5
5
  * Render options for a SurfaceComponent. This interface is the same as SurfaceOptions but with several vanilla-only options removed.
6
6
  */
@@ -302,7 +302,7 @@ export interface PaletteComponentProps extends DOMAttributes<HTMLDivElement> {
302
302
  /**
303
303
  * Function to invoke to get a payload for an element that is being dragged/has been tapped. Defaults to a function that extracts `type` from the element via its `data-vjs-type` attribute.
304
304
  */
305
- dataGenerator?: DataGeneratorFunction<BrowserElement>;
305
+ dataGenerator?: DataGeneratorFunction;
306
306
  /**
307
307
  * Optional function to invoke after a vertex has been added
308
308
  */
@@ -318,7 +318,7 @@ export interface PaletteComponentProps extends DOMAttributes<HTMLDivElement> {
318
318
  /**
319
319
  * Optional filter to use to decide at run time which elements may be dragged/dropped
320
320
  */
321
- canvasDropFilter?: CanvasDropFilter<BrowserElement>;
321
+ canvasDropFilter?: CanvasDropFilter;
322
322
  /**
323
323
  * Mode to operate in - 'drag', 'tap' or 'draw'. Defaults to 'drag'.
324
324
  */
@@ -334,7 +334,7 @@ export interface PaletteComponentProps extends DOMAttributes<HTMLDivElement> {
334
334
  /**
335
335
  * Whether or not to allow drop on edge. Defaults to false.
336
336
  */
337
- allowDropOnEdge?: boolean | CanDropOnEdgeFilter<any>;
337
+ allowDropOnEdge?: boolean | CanDropOnEdgeFilter;
338
338
  /**
339
339
  * Whether or not to allow drop on whitespace in the canvas. Defaults to true.
340
340
  */
@@ -442,7 +442,7 @@ export interface ShapePaletteComponentProps extends DOMAttributes<HTMLDivElement
442
442
  /**
443
443
  * Optional data generator to allow you to specify initial data for some element to be dragged. Note that you cannot override the object's `type` with this function. The palette will set the new object's type to match the type of the element that the user is dragging from the palette.
444
444
  */
445
- dataGenerator?: DataGeneratorFunction<ObjectData>;
445
+ dataGenerator?: DataGeneratorFunction;
446
446
  /**
447
447
  * Optional size to use for icons. Defaults to 150x100 pixels. If you provide this but not `dragSize` this size will also be used for an icon that is being dragged.
448
448
  */
@@ -489,7 +489,7 @@ export interface ShapePaletteComponentProps extends DOMAttributes<HTMLDivElement
489
489
  /**
490
490
  * Whether or not to allow drop on edge. Defaults to false.
491
491
  */
492
- allowDropOnEdge?: boolean | CanDropOnEdgeFilter<any>;
492
+ allowDropOnEdge?: boolean | CanDropOnEdgeFilter;
493
493
  /**
494
494
  * Whether or not to allow rotation of elements being dragged. Defaults to true.
495
495
  */
@@ -545,6 +545,27 @@ export interface EdgeTypePickerComponentProps extends DOMAttributes<HTMLDivEleme
545
545
  */
546
546
  propertyName: string;
547
547
  }
548
+ /**
549
+ * @group Props
550
+ */
551
+ export interface EdgePropertyMappingsInspectorProps extends DOMAttributes<HTMLDivElement> {
552
+ /**
553
+ * Optional, you can implement this method to return your own names to use for properties in the inspector.
554
+ */
555
+ getPropertyName?: (pm: PropertyMapping<EdgeMapping>) => string;
556
+ /**
557
+ * Optional, whether or not to show property names. Defaults to true.
558
+ */
559
+ showName?: boolean;
560
+ /**
561
+ * Optional class name to use on the wrapper div. Defaults to `vjs-inspector-section`.
562
+ */
563
+ cssClass?: string;
564
+ /**
565
+ * Optional property mappings to render a form for. The default behaviour is to retrieve the property mappings from the inspector context
566
+ */
567
+ mappings?: EdgePropertyMappings;
568
+ }
548
569
  /**
549
570
  * @group Props
550
571
  */
@@ -817,7 +838,7 @@ export interface DiagramPaletteProps extends DOMAttributes<HTMLDivElement> {
817
838
  /**
818
839
  * Whether or not to allow drop on edge. Defaults to false.
819
840
  */
820
- allowDropOnEdge?: boolean | CanDropOnEdgeFilter<any>;
841
+ allowDropOnEdge?: boolean | CanDropOnEdgeFilter;
821
842
  /**
822
843
  * Whether or not to allow rotation of elements being dragged. Defaults to true.
823
844
  */
@@ -899,3 +920,17 @@ export interface SurfacePopupProps {
899
920
  */
900
921
  popup: Snippet<[Vertex | null, BrowserUIModel, BrowserUI, (() => any)]>;
901
922
  }
923
+ /**
924
+ * Props for ShapePropertiesInspector
925
+ * @group Props
926
+ */
927
+ export interface ShapePropertiesInspectorProps extends DOMAttributes<HTMLDivElement> {
928
+ /**
929
+ * vertex to inspector
930
+ */
931
+ vertex: Vertex;
932
+ /**
933
+ * The maximum number of radio buttons to show for a value list before switching to a select dropdown. Defaults to 7.
934
+ */
935
+ maxRadios?: number;
936
+ }
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@visuallyjs/browser-ui-svelte","version":"1.2.6","description":"VisuallyJS Svelte integration for Browser UI renderer","module":"index.js","main":"index.js","types":"index.d.ts","svelte":"index.js","files":["**/*.d.ts","**/*.js","SurfaceComponent.svelte","PaperComponent.svelte","DecoratorComponent.svelte","DefaultGroupComponent.svelte","DefaultNodeComponent.svelte","MiniviewComponent.svelte","ControlsComponent.svelte","SurfaceProvider.svelte","PaperProvider.svelte","PaletteComponent.svelte","InspectorComponent.svelte","EdgeTypePickerComponent.svelte","ShapePaletteComponent.svelte","ExportControlsComponent.svelte","ShapeComponent.svelte","DiagramComponent.svelte","BarChartComponent.svelte","ColumnChartComponent.svelte","XYChartComponent.svelte","LineChartComponent.svelte","AreaChartComponent.svelte","PieChartComponent.svelte","WrapperComponent.svelte","OverlayWrapperComponent.svelte","DiagramProvider.svelte","DiagramPaletteComponent.svelte","ColorPickerComponent.svelte","ScatterChartComponent.svelte","BubbleChartComponent.svelte","GaugeChartComponent.svelte","SankeyChartComponent.svelte","SurfacePopup.svelte","GridBackgroundComponent.svelte","ImageBackgroundComponent.svelte","TiledImageBackgroundComponent.svelte"],"author":"VisuallyJs <hello@visuallyjs.com> (https://visuallyjs.com)","license":"Commercial","dependencies":{"@visuallyjs/browser-ui":"1.2.6"},"homepage":"https://visuallyjs.com/svelte","bugs":"https://github.com/visuallyjs/visuallyjs/issues"}
1
+ {"name":"@visuallyjs/browser-ui-svelte","version":"1.2.8","description":"VisuallyJS Svelte integration for Browser UI renderer","module":"index.js","main":"index.js","types":"index.d.ts","svelte":"index.js","files":["**/*.d.ts","**/*.js","SurfaceComponent.svelte","PaperComponent.svelte","DecoratorComponent.svelte","DefaultGroupComponent.svelte","DefaultNodeComponent.svelte","MiniviewComponent.svelte","ControlsComponent.svelte","SurfaceProvider.svelte","PaperProvider.svelte","PaletteComponent.svelte","InspectorComponent.svelte","EdgeTypePickerComponent.svelte","EdgePropertyMappingsInspector.svelte","ShapePaletteComponent.svelte","ExportControlsComponent.svelte","ShapeComponent.svelte","DiagramComponent.svelte","BarChartComponent.svelte","ColumnChartComponent.svelte","XYChartComponent.svelte","LineChartComponent.svelte","AreaChartComponent.svelte","PieChartComponent.svelte","WrapperComponent.svelte","OverlayWrapperComponent.svelte","DiagramProvider.svelte","DiagramPaletteComponent.svelte","ColorPickerComponent.svelte","ScatterChartComponent.svelte","BubbleChartComponent.svelte","GaugeChartComponent.svelte","SankeyChartComponent.svelte","SurfacePopup.svelte","GridBackgroundComponent.svelte","ImageBackgroundComponent.svelte","TiledImageBackgroundComponent.svelte","ShapePropertiesInspector.svelte"],"author":"VisuallyJs <hello@visuallyjs.com> (https://visuallyjs.com)","license":"Commercial","dependencies":{"@visuallyjs/browser-ui":"1.2.8"},"homepage":"https://visuallyjs.com/svelte","bugs":"https://github.com/visuallyjs/visuallyjs/issues"}