@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/dist/index.umd.js CHANGED
@@ -13880,6 +13880,10 @@
13880
13880
  minWidth: 40,
13881
13881
  minHeight: 40,
13882
13882
  isVisible: selected
13883
+ }), /*#__PURE__*/React__default["default"].createElement(NodeComponent, {
13884
+ data: nodeData,
13885
+ selected: selected,
13886
+ style: sizeStyle
13883
13887
  }), handles.map(function (id) {
13884
13888
  return /*#__PURE__*/React__default["default"].createElement(Handle, {
13885
13889
  key: id,
@@ -13893,10 +13897,6 @@
13893
13897
  border: '2px solid #fff'
13894
13898
  }
13895
13899
  });
13896
- }), /*#__PURE__*/React__default["default"].createElement(NodeComponent, {
13897
- data: nodeData,
13898
- selected: selected,
13899
- style: sizeStyle
13900
13900
  }));
13901
13901
  };
13902
13902
 
@@ -13904,6 +13904,22 @@
13904
13904
  return WrappedNode;
13905
13905
  };
13906
13906
 
13907
+ var DiagramNodeShape = PropTypes.shape({
13908
+ id: PropTypes.string.isRequired,
13909
+ type: PropTypes.string.isRequired,
13910
+ position: PropTypes.shape({
13911
+ x: PropTypes.number.isRequired,
13912
+ y: PropTypes.number.isRequired
13913
+ }).isRequired,
13914
+ width: PropTypes.number,
13915
+ height: PropTypes.number,
13916
+ handleConfig: PropTypes.shape({
13917
+ color: PropTypes.string,
13918
+ positions: PropTypes.arrayOf(PropTypes.oneOf(['top', 'right', 'bottom', 'left']))
13919
+ }),
13920
+ data: PropTypes.object
13921
+ });
13922
+
13907
13923
  var fails$d = fails$p;
13908
13924
 
13909
13925
  var arrayMethodIsStrict$2 = function (METHOD_NAME, argument) {
@@ -13961,6 +13977,25 @@
13961
13977
  bezier: withSelected(BezierEdge),
13962
13978
  straight: withSelected(StraightEdge)
13963
13979
  };
13980
+ var ArrowShape = PropTypes.shape({
13981
+ type: PropTypes.oneOf(['outlined', 'contained']),
13982
+ size: PropTypes.number
13983
+ });
13984
+ var DiagramEdgeShape = PropTypes.shape({
13985
+ id: PropTypes.string.isRequired,
13986
+ source: PropTypes.string.isRequired,
13987
+ target: PropTypes.string.isRequired,
13988
+ sourceHandle: PropTypes.oneOf(['top', 'right', 'bottom', 'left']),
13989
+ targetHandle: PropTypes.oneOf(['top', 'right', 'bottom', 'left']),
13990
+ lineType: PropTypes.oneOf(['step', 'curved', 'straight']),
13991
+ animated: PropTypes.bool,
13992
+ label: PropTypes.string,
13993
+ style: PropTypes.object,
13994
+ selectedStyle: PropTypes.object,
13995
+ arrowStart: ArrowShape,
13996
+ arrowEnd: ArrowShape,
13997
+ data: PropTypes.object
13998
+ });
13964
13999
 
13965
14000
  var _excluded$e = ["width", "height", "handleConfig", "data"];
13966
14001
  var MARKER_MAP = {
@@ -13973,11 +14008,15 @@
13973
14008
  straight: 'straight'
13974
14009
  };
13975
14010
 
13976
- var formatMarker = function formatMarker(marker) {
14011
+ var formatMarker = function formatMarker(marker, style) {
13977
14012
  if (!marker) return undefined;
14013
+ var type = marker.type,
14014
+ size = marker.size;
13978
14015
  return {
13979
- type: MARKER_MAP[marker.type] || marker.type,
13980
- color: marker.color
14016
+ type: MARKER_MAP[type] || type,
14017
+ color: style === null || style === void 0 ? void 0 : style.stroke,
14018
+ width: size !== null && size !== void 0 ? size : 20,
14019
+ height: size !== null && size !== void 0 ? size : 20
13981
14020
  };
13982
14021
  };
13983
14022
 
@@ -14030,8 +14069,8 @@
14030
14069
  selectedStyle: selectedStyle
14031
14070
  }),
14032
14071
  type: LINE_TYPE_MAP[lineType] || 'bezier',
14033
- markerStart: formatMarker(arrowStart),
14034
- markerEnd: formatMarker(arrowEnd)
14072
+ markerStart: formatMarker(arrowStart, style),
14073
+ markerEnd: formatMarker(arrowEnd, style)
14035
14074
  };
14036
14075
  });
14037
14076
  };
@@ -14121,82 +14160,6 @@
14121
14160
  var defaultZoomOpts = {
14122
14161
  duration: 400
14123
14162
  };
14124
- var ArrowShape = PropTypes.shape({
14125
- type: PropTypes.oneOf(['outlined', 'contained']),
14126
- color: PropTypes.string
14127
- });
14128
- var DiagramNodeShape = PropTypes.shape({
14129
- id: PropTypes.string.isRequired,
14130
- type: PropTypes.string.isRequired,
14131
- position: PropTypes.shape({
14132
- x: PropTypes.number.isRequired,
14133
- y: PropTypes.number.isRequired
14134
- }).isRequired,
14135
- width: PropTypes.number,
14136
- height: PropTypes.number,
14137
- handleConfig: PropTypes.shape({
14138
- color: PropTypes.string,
14139
- positions: PropTypes.arrayOf(PropTypes.oneOf(['top', 'right', 'bottom', 'left']))
14140
- }),
14141
- data: PropTypes.object
14142
- });
14143
- var DiagramEdgeShape = PropTypes.shape({
14144
- id: PropTypes.string.isRequired,
14145
- source: PropTypes.string.isRequired,
14146
- target: PropTypes.string.isRequired,
14147
- sourceHandle: PropTypes.oneOf(['top', 'right', 'bottom', 'left']),
14148
- targetHandle: PropTypes.oneOf(['top', 'right', 'bottom', 'left']),
14149
- lineType: PropTypes.oneOf(['step', 'curved', 'straight']),
14150
- animated: PropTypes.bool,
14151
- label: PropTypes.string,
14152
- style: PropTypes.object,
14153
- selectedStyle: PropTypes.object,
14154
- arrowStart: ArrowShape,
14155
- arrowEnd: ArrowShape,
14156
- data: PropTypes.object
14157
- });
14158
- ({
14159
- /** Nodos a renderizar en el diagrama. */
14160
- nodes: PropTypes.arrayOf(DiagramNodeShape),
14161
-
14162
- /** Edges a renderizar en el diagrama. */
14163
- edges: PropTypes.arrayOf(DiagramEdgeShape),
14164
-
14165
- /** Map de tipo de nodo → componente React custom. */
14166
- nodeComponents: PropTypes.objectOf(PropTypes.elementType),
14167
-
14168
- /** 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. */
14169
- config: PropTypes.shape({
14170
- readOnly: PropTypes.bool,
14171
- showControls: PropTypes.bool,
14172
- showMiniMap: PropTypes.bool,
14173
- resizableNodes: PropTypes.bool
14174
- }),
14175
-
14176
- /** Cambios de posición (`{ type: 'position', id, position }`), dimensiones (`{ type: 'dimensions', id, width, height }`) o eliminación (`{ type: 'remove', id }`) de nodos. */
14177
- onNodesChange: PropTypes.func,
14178
-
14179
- /** Eliminación de edges (`{ type: 'remove', id }`). */
14180
- onEdgesChange: PropTypes.func,
14181
-
14182
- /** El usuario conectó dos nodos. Recibe `{ source, target, sourceHandle, targetHandle }`. */
14183
- onConnect: PropTypes.func,
14184
-
14185
- /** El usuario reconectó un edge a otro nodo. Recibe `(id, { source, target })`. */
14186
- onReconnect: PropTypes.func,
14187
-
14188
- /** El usuario hizo click en un nodo. Recibe `(id, data)`. */
14189
- onNodeClick: PropTypes.func,
14190
-
14191
- /** El usuario hizo click en un edge. Recibe `(id, data)`. */
14192
- onEdgeClick: PropTypes.func,
14193
-
14194
- /** Intercepta el borrado antes de que ocurra. Async: retornar `false` cancela el borrado. Recibe `{ nodes, edges }` con los elementos a borrar. */
14195
- onBeforeDelete: PropTypes.func,
14196
-
14197
- /** Se llama cuando cambia la selección. Recibe `{ nodes: [{id}], edges: [{id}] }` con los elementos seleccionados en ese momento. */
14198
- onSelectionChange: PropTypes.func
14199
- });
14200
14163
  var Canvas = /*#__PURE__*/React$2.forwardRef(function (_ref, ref) {
14201
14164
  var nodes = _ref.nodes,
14202
14165
  edges = _ref.edges,
@@ -14422,6 +14385,48 @@
14422
14385
  }, /*#__PURE__*/React__default["default"].createElement(Background, null), showControls && /*#__PURE__*/React__default["default"].createElement(DiagramControls, null), showMiniMap && /*#__PURE__*/React__default["default"].createElement(MiniMap, null)));
14423
14386
  });
14424
14387
  Canvas.displayName = 'Canvas';
14388
+ ({
14389
+ /** Nodos a renderizar en el diagrama. */
14390
+ nodes: PropTypes.arrayOf(DiagramNodeShape),
14391
+
14392
+ /** Edges a renderizar en el diagrama. */
14393
+ edges: PropTypes.arrayOf(DiagramEdgeShape),
14394
+
14395
+ /** Map de tipo de nodo → componente React custom. */
14396
+ nodeComponents: PropTypes.objectOf(PropTypes.elementType),
14397
+
14398
+ /** 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. */
14399
+ config: PropTypes.shape({
14400
+ readOnly: PropTypes.bool,
14401
+ showControls: PropTypes.bool,
14402
+ showMiniMap: PropTypes.bool,
14403
+ resizableNodes: PropTypes.bool
14404
+ }),
14405
+
14406
+ /** Cambios de posición (`{ type: 'position', id, position }`), dimensiones (`{ type: 'dimensions', id, width, height }`) o eliminación (`{ type: 'remove', id }`) de nodos. */
14407
+ onNodesChange: PropTypes.func,
14408
+
14409
+ /** Eliminación de edges (`{ type: 'remove', id }`). */
14410
+ onEdgesChange: PropTypes.func,
14411
+
14412
+ /** El usuario conectó dos nodos. Recibe `{ source, target, sourceHandle, targetHandle }`. */
14413
+ onConnect: PropTypes.func,
14414
+
14415
+ /** El usuario reconectó un edge a otro nodo. Recibe `(id, { source, target })`. */
14416
+ onReconnect: PropTypes.func,
14417
+
14418
+ /** El usuario hizo click en un nodo. Recibe `(id, data)`. */
14419
+ onNodeClick: PropTypes.func,
14420
+
14421
+ /** El usuario hizo click en un edge. Recibe `(id, data)`. */
14422
+ onEdgeClick: PropTypes.func,
14423
+
14424
+ /** Intercepta el borrado antes de que ocurra. Async: retornar `false` cancela el borrado. Recibe `{ nodes, edges }` con los elementos a borrar. */
14425
+ onBeforeDelete: PropTypes.func,
14426
+
14427
+ /** Se llama cuando cambia la selección. Recibe `{ nodes: [{id}], edges: [{id}] }` con los elementos seleccionados en ese momento. */
14428
+ onSelectionChange: PropTypes.func
14429
+ });
14425
14430
 
14426
14431
  var _excluded$c = ["nodes", "edges", "nodeComponents", "config"];
14427
14432
  var defaultConfig = {