@likec4/diagram 1.55.0 → 1.55.1

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.
@@ -14,6 +14,6 @@ type EdgeLabelContainerProps = HTMLAttributes<HTMLDivElement> & {
14
14
  } | undefined;
15
15
  edgeProps: BaseEdgePropsWithData<Data>;
16
16
  };
17
- export declare function EdgeLabelContainer({ edgeProps: { id, selected, data: { hovered: isHovered, active: isActive, dimmed: isDimmed, labelBBox, color, }, animated, }, labelPosition: labelXY, className, style: _, // omit styles for container
17
+ export declare function EdgeLabelContainer({ edgeProps: { id, selected, data: { hovered: isHovered, active: isActive, dimmed: isDimmed, labelBBox, color, }, animated, }, labelPosition: labelXY, className, style: contentStyle, // applied to inner content div, not the positioned container
18
18
  children, ...rest }: EdgeLabelContainerProps): import("react/jsx-runtime").JSX.Element | null;
19
19
  export {};
@@ -22,8 +22,8 @@ function EdgeLabelContainer({
22
22
  },
23
23
  labelPosition: labelXY,
24
24
  className,
25
- style: _,
26
- // omit styles for container
25
+ style: contentStyle,
26
+ // applied to inner content div, not the positioned container
27
27
  children,
28
28
  ...rest
29
29
  }) {
@@ -61,9 +61,10 @@ function EdgeLabelContainer({
61
61
  children: /* @__PURE__ */ jsx(
62
62
  "div",
63
63
  {
64
- style: labelBBox ? {
65
- maxWidth: labelBBox.width + 20
66
- } : void 0,
64
+ style: {
65
+ ...contentStyle,
66
+ ...labelBBox && { maxWidth: labelBBox.width + 20 }
67
+ },
67
68
  children
68
69
  }
69
70
  )
@@ -484,11 +484,18 @@ const Relationship = forwardRef(({
484
484
  ] }),
485
485
  r.kind && /* @__PURE__ */ jsxs(HStack, { gap: "2", children: [
486
486
  /* @__PURE__ */ jsx(Label, { children: "kind" }),
487
- /* @__PURE__ */ jsx(Text, { size: "xs", className: css({ userSelect: "all" }), children: r.kind })
487
+ /* @__PURE__ */ jsx(Text, { size: "xs", className: css({ userSelect: "all", wordBreak: "break-word", minWidth: 0 }), children: r.kind })
488
488
  ] }),
489
489
  r.technology && /* @__PURE__ */ jsxs(HStack, { gap: "2", children: [
490
490
  /* @__PURE__ */ jsx(Label, { children: "technology" }),
491
- /* @__PURE__ */ jsx(Text, { size: "xs", className: css({ userSelect: "all" }), children: r.technology })
491
+ /* @__PURE__ */ jsx(
492
+ Text,
493
+ {
494
+ size: "xs",
495
+ className: css({ userSelect: "all", wordBreak: "break-word", minWidth: 0 }),
496
+ children: r.technology
497
+ }
498
+ )
492
499
  ] }),
493
500
  r.summary.nonEmpty && /* @__PURE__ */ jsxs(Fragment$1, { children: [
494
501
  /* @__PURE__ */ jsx(Label, { children: "description" }),
@@ -11,6 +11,9 @@ const Endpoint = ({ children, likec4color }) => {
11
11
  size: "xxs",
12
12
  fontWeight: "medium",
13
13
  whiteSpace: "nowrap",
14
+ overflow: "hidden",
15
+ textOverflow: "ellipsis",
16
+ maxWidth: "160px",
14
17
  paddingX: "1",
15
18
  paddingY: "0.5",
16
19
  rounded: "xs",
@@ -32,7 +35,10 @@ const RelationshipTitle = styled("div", {
32
35
  whiteSpaceCollapse: "preserve-breaks",
33
36
  fontSize: "sm",
34
37
  lineHeight: "sm",
35
- userSelect: "all"
38
+ userSelect: "all",
39
+ overflowWrap: "anywhere",
40
+ wordBreak: "break-word",
41
+ minWidth: 0
36
42
  }
37
43
  });
38
44
 
@@ -58,9 +58,11 @@ const title = css({
58
58
  fontStyle: "normal",
59
59
  fontWeight: "bold",
60
60
  fontSize: "24px",
61
- // lineHeight: 1.15,
62
- lineHeight: "xs"
63
- // color: vars.element.hiContrast
61
+ lineHeight: "xs",
62
+ overflow: "hidden",
63
+ textOverflow: "ellipsis",
64
+ wordBreak: "break-word",
65
+ lineClamp: 2
64
66
  });
65
67
  const iconSize = "40px";
66
68
  const elementIcon = css({
@@ -1,7 +1,7 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import { cx, css } from '@likec4/styles/css';
3
3
  import { HStack } from '@likec4/styles/jsx';
4
- import { RemoveScroll, Text, CloseButton, Badge, ActionIconGroup, ActionIcon, Tabs, TabsList, TabsTab, TabsPanel, ScrollArea, Box, Stack, Flex, Tooltip as Tooltip$1, Divider as Divider$1, UnstyledButton, Group, ThemeIcon } from '@mantine/core';
4
+ import { RemoveScroll, Text, CloseButton, Badge, ActionIconGroup, ActionIcon, Tabs, TabsList, TabsTab, TabsPanel, ScrollArea, Box, Stack, Tooltip as Tooltip$1, Flex, Divider as Divider$1, UnstyledButton, Group, ThemeIcon } from '@mantine/core';
5
5
  import { useViewportSize, useSessionStorage } from '@mantine/hooks';
6
6
  import { useDebouncedCallback, useTimeoutEffect } from '@react-hookz/web';
7
7
  import { useDragControls, useMotionValue, m } from 'motion/react';
@@ -226,20 +226,29 @@ function ElementDetailsCard({
226
226
  children: [
227
227
  /* @__PURE__ */ jsxs("div", { className: cardHeader, onPointerDown: (e) => controls.start(e), children: [
228
228
  /* @__PURE__ */ jsxs(HStack, { alignItems: "start", justify: "space-between", gap: "sm", mb: "sm", flexWrap: "nowrap", children: [
229
- /* @__PURE__ */ jsxs(HStack, { alignItems: "start", gap: "sm", style: { cursor: "default" }, flexWrap: "nowrap", children: [
230
- elementIcon$1,
231
- /* @__PURE__ */ jsxs("div", { children: [
232
- /* @__PURE__ */ jsx(
233
- Text,
234
- {
235
- component: "div",
236
- className: title,
237
- children: elementModel.title
238
- }
239
- ),
240
- notation && /* @__PURE__ */ jsx(Text, { component: "div", c: "dimmed", fz: "sm", fw: 500, lh: 1.3, lineClamp: 1, children: notation })
241
- ] })
242
- ] }),
229
+ /* @__PURE__ */ jsxs(
230
+ HStack,
231
+ {
232
+ alignItems: "start",
233
+ gap: "sm",
234
+ style: { cursor: "default", minWidth: 0, overflow: "hidden" },
235
+ flexWrap: "nowrap",
236
+ children: [
237
+ elementIcon$1,
238
+ /* @__PURE__ */ jsxs("div", { style: { minWidth: 0, overflow: "hidden" }, children: [
239
+ /* @__PURE__ */ jsx(Tooltip, { label: elementModel.title, openDelay: 600, position: "bottom-start", children: /* @__PURE__ */ jsx(
240
+ Text,
241
+ {
242
+ component: "div",
243
+ className: title,
244
+ children: elementModel.title
245
+ }
246
+ ) }),
247
+ notation && /* @__PURE__ */ jsx(Text, { component: "div", c: "dimmed", fz: "sm", fw: 500, lh: 1.3, lineClamp: 1, children: notation })
248
+ ] })
249
+ ]
250
+ }
251
+ ),
243
252
  /* @__PURE__ */ jsx(CloseButton, { size: "lg", onClick: triggerClose })
244
253
  ] }),
245
254
  /* @__PURE__ */ jsxs(HStack, { alignItems: "baseline", gap: "sm", flexWrap: "nowrap", children: [
@@ -263,7 +272,7 @@ function ElementDetailsCard({
263
272
  }
264
273
  )
265
274
  ] }),
266
- /* @__PURE__ */ jsxs("div", { style: { flex: 1 }, children: [
275
+ /* @__PURE__ */ jsxs("div", { style: { flex: 1, minWidth: 0, overflow: "hidden" }, children: [
267
276
  /* @__PURE__ */ jsx(SmallLabel, { children: "tags" }),
268
277
  /* @__PURE__ */ jsx(
269
278
  ElementTags,
@@ -43,6 +43,13 @@ const Overlay = forwardRef(({
43
43
  if (!dialogRef.current?.open) {
44
44
  dialogRef.current?.showModal();
45
45
  }
46
+ const dialog = dialogRef.current;
47
+ return () => {
48
+ if (dialog?.open) {
49
+ isClosingRef.current = true;
50
+ dialog.close();
51
+ }
52
+ };
46
53
  }, []);
47
54
  useTimeoutEffect(() => {
48
55
  setOpened(true);
@@ -12,7 +12,7 @@ const Sizes = {
12
12
  },
13
13
  edgeLabel: {
14
14
  width: 220,
15
- height: 14
15
+ height: 55
16
16
  // minlen: 1,
17
17
  },
18
18
  nodeWidth: 330,