@knotx/plugins-base-render 0.2.6 → 0.2.7

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.cjs CHANGED
@@ -261,13 +261,10 @@ __publicField(_BaseRender, "DEFAULT_EDGE_WRAPPER", ({
261
261
  }) => {
262
262
  var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
263
263
  const edge = useEdge(id);
264
- if (!edge) {
265
- return null;
266
- }
267
- const EdgeRenderer = getEdgeRenderer(edge.type);
268
- const source = useNode(edge.source);
269
- const target = useNode(edge.target);
270
- if (!source || !target) {
264
+ const EdgeRenderer = getEdgeRenderer(edge == null ? void 0 : edge.type);
265
+ const source = useNode((edge == null ? void 0 : edge.source) || "");
266
+ const target = useNode((edge == null ? void 0 : edge.target) || "");
267
+ if (!edge || !source || !target) {
271
268
  return null;
272
269
  }
273
270
  const sourceX = ((_b = (_a2 = source.position) == null ? void 0 : _a2.x) != null ? _b : 0) + ((_d = (_c = source.measured) == null ? void 0 : _c.width) != null ? _d : 0);
package/dist/index.js CHANGED
@@ -259,13 +259,10 @@ __publicField(_BaseRender, "DEFAULT_EDGE_WRAPPER", ({
259
259
  }) => {
260
260
  var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
261
261
  const edge = useEdge(id);
262
- if (!edge) {
263
- return null;
264
- }
265
- const EdgeRenderer = getEdgeRenderer(edge.type);
266
- const source = useNode(edge.source);
267
- const target = useNode(edge.target);
268
- if (!source || !target) {
262
+ const EdgeRenderer = getEdgeRenderer(edge == null ? void 0 : edge.type);
263
+ const source = useNode((edge == null ? void 0 : edge.source) || "");
264
+ const target = useNode((edge == null ? void 0 : edge.target) || "");
265
+ if (!edge || !source || !target) {
269
266
  return null;
270
267
  }
271
268
  const sourceX = ((_b = (_a2 = source.position) == null ? void 0 : _a2.x) != null ? _b : 0) + ((_d = (_c = source.measured) == null ? void 0 : _c.width) != null ? _d : 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knotx/plugins-base-render",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
4
4
  "description": "Base Render Plugin for Knotx",
5
5
  "author": "boenfu",
6
6
  "license": "MIT",