@janiscommerce/ui-web 1.11.0-beta.3 → 1.12.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/CHANGELOG.md CHANGED
@@ -7,24 +7,26 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
- ## [1.11.0-beta.3] - 2026-06-22
10
+ ## [1.12.0] - 2026-06-26
11
11
 
12
- ### Fixed
13
-
14
- - Pin `node-releases` to `2.0.19` via `resolutions` to keep the build installable on Node 14 (newer `browserslist` pulled `node-releases@2.0.48`, which requires Node >= 18)
15
-
16
- ## [1.11.0-beta.2] - 2026-06-22
12
+ ### Changed
17
13
 
18
- ### Fixed
14
+ - `DiagramCanvas` edge arrows now inherit their color from the edge `style.stroke` (removed `color` from `arrowStart`/`arrowEnd`); added optional `size` (default 20)
15
+ - Render node handles above the node content without `z-index` to prevent the connection arrow from being clipped
16
+ - Moved shared PropTypes shapes to their own modules (`DiagramNodeShape` in `Node.js`, edge shapes in `Edge.js`)
17
+ - Split `DiagramCanvas` stories into themed files (Overview, Interactions, Nodes, Edges, Ref API) with shared meta, shapes and styles
19
18
 
20
- - Add css build for rollup and custom plugin to include files for react-flow
21
-
22
- ## [1.11.0-beta.1] - 2026-06-22
19
+ ## [1.11.0] - 2026-06-25
23
20
 
24
21
  ### Added
25
22
 
26
23
  - `DiagramCanvas` component: controlled model with custom nodes, configurable edges, edit mode, node resize, delete confirmation via `onBeforeDelete`, external selection actions via `onSelectionChange`, and imperative zoom/selection API [JMV-4083](https://janiscommerce.atlassian.net/browse/JMV-4083)
27
24
 
25
+ ### Fixed
26
+
27
+ - Add css build for rollup and custom plugin to include files for react-flow
28
+ - Pin `node-releases` to `2.0.19` via `resolutions` to keep the build installable on Node 14 (newer `browserslist` pulled `node-releases@2.0.48`, which requires Node >= 18)
29
+
28
30
  ## [1.10.0] - 2026-06-05
29
31
 
30
32
  ### Added
package/dist/index.esm.js CHANGED
@@ -13855,6 +13855,10 @@ var withHandles = function withHandles(NodeComponent) {
13855
13855
  minWidth: 40,
13856
13856
  minHeight: 40,
13857
13857
  isVisible: selected
13858
+ }), /*#__PURE__*/React__default.createElement(NodeComponent, {
13859
+ data: nodeData,
13860
+ selected: selected,
13861
+ style: sizeStyle
13858
13862
  }), handles.map(function (id) {
13859
13863
  return /*#__PURE__*/React__default.createElement(Handle, {
13860
13864
  key: id,
@@ -13868,10 +13872,6 @@ var withHandles = function withHandles(NodeComponent) {
13868
13872
  border: '2px solid #fff'
13869
13873
  }
13870
13874
  });
13871
- }), /*#__PURE__*/React__default.createElement(NodeComponent, {
13872
- data: nodeData,
13873
- selected: selected,
13874
- style: sizeStyle
13875
13875
  }));
13876
13876
  };
13877
13877
 
@@ -13879,6 +13879,22 @@ var withHandles = function withHandles(NodeComponent) {
13879
13879
  return WrappedNode;
13880
13880
  };
13881
13881
 
13882
+ var DiagramNodeShape = PropTypes.shape({
13883
+ id: PropTypes.string.isRequired,
13884
+ type: PropTypes.string.isRequired,
13885
+ position: PropTypes.shape({
13886
+ x: PropTypes.number.isRequired,
13887
+ y: PropTypes.number.isRequired
13888
+ }).isRequired,
13889
+ width: PropTypes.number,
13890
+ height: PropTypes.number,
13891
+ handleConfig: PropTypes.shape({
13892
+ color: PropTypes.string,
13893
+ positions: PropTypes.arrayOf(PropTypes.oneOf(['top', 'right', 'bottom', 'left']))
13894
+ }),
13895
+ data: PropTypes.object
13896
+ });
13897
+
13882
13898
  var fails$d = fails$p;
13883
13899
 
13884
13900
  var arrayMethodIsStrict$2 = function (METHOD_NAME, argument) {
@@ -13936,6 +13952,25 @@ var EDGE_TYPES = {
13936
13952
  bezier: withSelected(BezierEdge),
13937
13953
  straight: withSelected(StraightEdge)
13938
13954
  };
13955
+ var ArrowShape = PropTypes.shape({
13956
+ type: PropTypes.oneOf(['outlined', 'contained']),
13957
+ size: PropTypes.number
13958
+ });
13959
+ var DiagramEdgeShape = PropTypes.shape({
13960
+ id: PropTypes.string.isRequired,
13961
+ source: PropTypes.string.isRequired,
13962
+ target: PropTypes.string.isRequired,
13963
+ sourceHandle: PropTypes.oneOf(['top', 'right', 'bottom', 'left']),
13964
+ targetHandle: PropTypes.oneOf(['top', 'right', 'bottom', 'left']),
13965
+ lineType: PropTypes.oneOf(['step', 'curved', 'straight']),
13966
+ animated: PropTypes.bool,
13967
+ label: PropTypes.string,
13968
+ style: PropTypes.object,
13969
+ selectedStyle: PropTypes.object,
13970
+ arrowStart: ArrowShape,
13971
+ arrowEnd: ArrowShape,
13972
+ data: PropTypes.object
13973
+ });
13939
13974
 
13940
13975
  var _excluded$e = ["width", "height", "handleConfig", "data"];
13941
13976
  var MARKER_MAP = {
@@ -13948,11 +13983,15 @@ var LINE_TYPE_MAP = {
13948
13983
  straight: 'straight'
13949
13984
  };
13950
13985
 
13951
- var formatMarker = function formatMarker(marker) {
13986
+ var formatMarker = function formatMarker(marker, style) {
13952
13987
  if (!marker) return undefined;
13988
+ var type = marker.type,
13989
+ size = marker.size;
13953
13990
  return {
13954
- type: MARKER_MAP[marker.type] || marker.type,
13955
- color: marker.color
13991
+ type: MARKER_MAP[type] || type,
13992
+ color: style === null || style === void 0 ? void 0 : style.stroke,
13993
+ width: size !== null && size !== void 0 ? size : 20,
13994
+ height: size !== null && size !== void 0 ? size : 20
13956
13995
  };
13957
13996
  };
13958
13997
 
@@ -14005,8 +14044,8 @@ var mapEdgesToRf = function mapEdgesToRf(edges) {
14005
14044
  selectedStyle: selectedStyle
14006
14045
  }),
14007
14046
  type: LINE_TYPE_MAP[lineType] || 'bezier',
14008
- markerStart: formatMarker(arrowStart),
14009
- markerEnd: formatMarker(arrowEnd)
14047
+ markerStart: formatMarker(arrowStart, style),
14048
+ markerEnd: formatMarker(arrowEnd, style)
14010
14049
  };
14011
14050
  });
14012
14051
  };
@@ -14096,82 +14135,6 @@ var defaultViewportOpts = {
14096
14135
  var defaultZoomOpts = {
14097
14136
  duration: 400
14098
14137
  };
14099
- var ArrowShape = PropTypes.shape({
14100
- type: PropTypes.oneOf(['outlined', 'contained']),
14101
- color: PropTypes.string
14102
- });
14103
- var DiagramNodeShape = PropTypes.shape({
14104
- id: PropTypes.string.isRequired,
14105
- type: PropTypes.string.isRequired,
14106
- position: PropTypes.shape({
14107
- x: PropTypes.number.isRequired,
14108
- y: PropTypes.number.isRequired
14109
- }).isRequired,
14110
- width: PropTypes.number,
14111
- height: PropTypes.number,
14112
- handleConfig: PropTypes.shape({
14113
- color: PropTypes.string,
14114
- positions: PropTypes.arrayOf(PropTypes.oneOf(['top', 'right', 'bottom', 'left']))
14115
- }),
14116
- data: PropTypes.object
14117
- });
14118
- var DiagramEdgeShape = PropTypes.shape({
14119
- id: PropTypes.string.isRequired,
14120
- source: PropTypes.string.isRequired,
14121
- target: PropTypes.string.isRequired,
14122
- sourceHandle: PropTypes.oneOf(['top', 'right', 'bottom', 'left']),
14123
- targetHandle: PropTypes.oneOf(['top', 'right', 'bottom', 'left']),
14124
- lineType: PropTypes.oneOf(['step', 'curved', 'straight']),
14125
- animated: PropTypes.bool,
14126
- label: PropTypes.string,
14127
- style: PropTypes.object,
14128
- selectedStyle: PropTypes.object,
14129
- arrowStart: ArrowShape,
14130
- arrowEnd: ArrowShape,
14131
- data: PropTypes.object
14132
- });
14133
- ({
14134
- /** Nodos a renderizar en el diagrama. */
14135
- nodes: PropTypes.arrayOf(DiagramNodeShape),
14136
-
14137
- /** Edges a renderizar en el diagrama. */
14138
- edges: PropTypes.arrayOf(DiagramEdgeShape),
14139
-
14140
- /** Map de tipo de nodo → componente React custom. */
14141
- nodeComponents: PropTypes.objectOf(PropTypes.elementType),
14142
-
14143
- /** Configuración del canvas. `readOnly` deshabilita drag y conexiones. `showControls` muestra los controles de zoom. `showMiniMap` muestra el minimapa. `resizableNodes` habilita el redimensionado de nodos. */
14144
- config: PropTypes.shape({
14145
- readOnly: PropTypes.bool,
14146
- showControls: PropTypes.bool,
14147
- showMiniMap: PropTypes.bool,
14148
- resizableNodes: PropTypes.bool
14149
- }),
14150
-
14151
- /** Cambios de posición (`{ type: 'position', id, position }`), dimensiones (`{ type: 'dimensions', id, width, height }`) o eliminación (`{ type: 'remove', id }`) de nodos. */
14152
- onNodesChange: PropTypes.func,
14153
-
14154
- /** Eliminación de edges (`{ type: 'remove', id }`). */
14155
- onEdgesChange: PropTypes.func,
14156
-
14157
- /** El usuario conectó dos nodos. Recibe `{ source, target, sourceHandle, targetHandle }`. */
14158
- onConnect: PropTypes.func,
14159
-
14160
- /** El usuario reconectó un edge a otro nodo. Recibe `(id, { source, target })`. */
14161
- onReconnect: PropTypes.func,
14162
-
14163
- /** El usuario hizo click en un nodo. Recibe `(id, data)`. */
14164
- onNodeClick: PropTypes.func,
14165
-
14166
- /** El usuario hizo click en un edge. Recibe `(id, data)`. */
14167
- onEdgeClick: PropTypes.func,
14168
-
14169
- /** Intercepta el borrado antes de que ocurra. Async: retornar `false` cancela el borrado. Recibe `{ nodes, edges }` con los elementos a borrar. */
14170
- onBeforeDelete: PropTypes.func,
14171
-
14172
- /** Se llama cuando cambia la selección. Recibe `{ nodes: [{id}], edges: [{id}] }` con los elementos seleccionados en ese momento. */
14173
- onSelectionChange: PropTypes.func
14174
- });
14175
14138
  var Canvas = /*#__PURE__*/forwardRef(function (_ref, ref) {
14176
14139
  var nodes = _ref.nodes,
14177
14140
  edges = _ref.edges,
@@ -14397,6 +14360,48 @@ var Canvas = /*#__PURE__*/forwardRef(function (_ref, ref) {
14397
14360
  }, /*#__PURE__*/React__default.createElement(Background, null), showControls && /*#__PURE__*/React__default.createElement(DiagramControls, null), showMiniMap && /*#__PURE__*/React__default.createElement(MiniMap, null)));
14398
14361
  });
14399
14362
  Canvas.displayName = 'Canvas';
14363
+ ({
14364
+ /** Nodos a renderizar en el diagrama. */
14365
+ nodes: PropTypes.arrayOf(DiagramNodeShape),
14366
+
14367
+ /** Edges a renderizar en el diagrama. */
14368
+ edges: PropTypes.arrayOf(DiagramEdgeShape),
14369
+
14370
+ /** Map de tipo de nodo → componente React custom. */
14371
+ nodeComponents: PropTypes.objectOf(PropTypes.elementType),
14372
+
14373
+ /** Configuración del canvas. `readOnly` deshabilita drag y conexiones. `showControls` muestra los controles de zoom. `showMiniMap` muestra el minimapa. `resizableNodes` habilita el redimensionado de nodos. */
14374
+ config: PropTypes.shape({
14375
+ readOnly: PropTypes.bool,
14376
+ showControls: PropTypes.bool,
14377
+ showMiniMap: PropTypes.bool,
14378
+ resizableNodes: PropTypes.bool
14379
+ }),
14380
+
14381
+ /** Cambios de posición (`{ type: 'position', id, position }`), dimensiones (`{ type: 'dimensions', id, width, height }`) o eliminación (`{ type: 'remove', id }`) de nodos. */
14382
+ onNodesChange: PropTypes.func,
14383
+
14384
+ /** Eliminación de edges (`{ type: 'remove', id }`). */
14385
+ onEdgesChange: PropTypes.func,
14386
+
14387
+ /** El usuario conectó dos nodos. Recibe `{ source, target, sourceHandle, targetHandle }`. */
14388
+ onConnect: PropTypes.func,
14389
+
14390
+ /** El usuario reconectó un edge a otro nodo. Recibe `(id, { source, target })`. */
14391
+ onReconnect: PropTypes.func,
14392
+
14393
+ /** El usuario hizo click en un nodo. Recibe `(id, data)`. */
14394
+ onNodeClick: PropTypes.func,
14395
+
14396
+ /** El usuario hizo click en un edge. Recibe `(id, data)`. */
14397
+ onEdgeClick: PropTypes.func,
14398
+
14399
+ /** Intercepta el borrado antes de que ocurra. Async: retornar `false` cancela el borrado. Recibe `{ nodes, edges }` con los elementos a borrar. */
14400
+ onBeforeDelete: PropTypes.func,
14401
+
14402
+ /** Se llama cuando cambia la selección. Recibe `{ nodes: [{id}], edges: [{id}] }` con los elementos seleccionados en ese momento. */
14403
+ onSelectionChange: PropTypes.func
14404
+ });
14400
14405
 
14401
14406
  var _excluded$c = ["nodes", "edges", "nodeComponents", "config"];
14402
14407
  var defaultConfig = {