@likec4/diagram 1.40.0 → 1.42.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.
Files changed (615) hide show
  1. package/README.md +1 -1
  2. package/bundle/index.js +44253 -25320
  3. package/bundle/package.json +4 -0
  4. package/custom/package.json +4 -0
  5. package/dist/LikeC4Diagram.d.ts +7 -1
  6. package/dist/LikeC4Diagram.js +35 -28
  7. package/dist/LikeC4Diagram.props.d.ts +40 -30
  8. package/dist/LikeC4ModelProvider.js +1 -1
  9. package/dist/LikeC4ProjectsProvider.js +1 -1
  10. package/dist/LikeC4Styles.d.ts +6 -2
  11. package/dist/LikeC4Styles.js +22 -54
  12. package/dist/{bundle/LikeC4View.props.d.ts → LikeC4View.d.ts} +29 -25
  13. package/dist/LikeC4View.js +173 -0
  14. package/dist/{bundle/ReactLikeC4.d.ts → ReactLikeC4.d.ts} +15 -9
  15. package/dist/ReactLikeC4.js +65 -0
  16. package/dist/StaticLikeC4Diagram.d.ts +7 -1
  17. package/dist/StaticLikeC4Diagram.js +0 -1
  18. package/dist/base/BaseXYFlow.d.ts +3 -3
  19. package/dist/base/BaseXYFlow.js +11 -9
  20. package/dist/base/index.d.ts +1 -1
  21. package/dist/base/types.d.ts +65 -65
  22. package/dist/base/types.js +44 -45
  23. package/dist/base/updateEdges.d.ts +3 -3
  24. package/dist/base/updateNodes.d.ts +3 -3
  25. package/dist/{base/primitives/MarkdownBlock.d.ts → base-primitives/Markdown.d.ts} +4 -4
  26. package/dist/{base/primitives/MarkdownBlock.js → base-primitives/Markdown.js} +8 -5
  27. package/dist/{base/primitives → base-primitives}/NodeHandles.js +8 -1
  28. package/dist/{base/primitives → base-primitives}/compound/CompoundActionButton.d.ts +2 -2
  29. package/dist/{base/primitives → base-primitives}/compound/CompoundActionButton.js +2 -2
  30. package/dist/{base/primitives → base-primitives}/compound/CompoundDetailsButton.d.ts +2 -2
  31. package/dist/{base/primitives → base-primitives}/compound/CompoundDetailsButton.js +2 -2
  32. package/dist/{base/primitives → base-primitives}/compound/CompoundNodeContainer.d.ts +3 -3
  33. package/dist/{base/primitives → base-primitives}/compound/CompoundNodeContainer.js +1 -2
  34. package/dist/base-primitives/compound/CompoundTitle.d.ts +13 -0
  35. package/dist/{base/primitives → base-primitives}/compound/CompoundTitle.js +3 -7
  36. package/dist/{base/primitives → base-primitives}/compound/actionbtns.css.d.ts +1 -1
  37. package/dist/{base/primitives → base-primitives}/edge/EdgeActionButton.js +2 -2
  38. package/dist/{base/primitives → base-primitives}/edge/EdgeContainer.d.ts +2 -2
  39. package/dist/{base/primitives → base-primitives}/edge/EdgeLabel.d.ts +2 -2
  40. package/dist/{base/primitives → base-primitives}/edge/EdgeLabel.js +2 -1
  41. package/dist/{base/primitives → base-primitives}/edge/EdgeLabelContainer.d.ts +2 -2
  42. package/dist/{base/primitives → base-primitives}/edge/EdgeLabelContainer.js +2 -2
  43. package/dist/{base/primitives → base-primitives}/edge/EdgePath.d.ts +2 -2
  44. package/dist/base-primitives/element/ElementActionButtons.d.ts +40 -0
  45. package/dist/base-primitives/element/ElementActionButtons.js +86 -0
  46. package/dist/base-primitives/element/ElementData.d.ts +65 -0
  47. package/dist/base-primitives/element/ElementData.js +121 -0
  48. package/dist/{base/primitives → base-primitives}/element/ElementDetailsButton.d.ts +4 -2
  49. package/dist/{base/primitives → base-primitives}/element/ElementDetailsButton.js +2 -2
  50. package/dist/{base/primitives → base-primitives}/element/ElementNodeContainer.d.ts +8 -13
  51. package/dist/base-primitives/element/ElementShape.d.ts +18 -0
  52. package/dist/{base/primitives → base-primitives}/element/ElementShape.js +31 -43
  53. package/dist/{base/primitives → base-primitives}/element/ElementTags.d.ts +2 -2
  54. package/dist/{base/primitives → base-primitives}/element/ElementTags.js +4 -4
  55. package/dist/{base/primitives → base-primitives}/index.d.ts +4 -4
  56. package/dist/base-primitives/memoEdge.d.ts +3 -0
  57. package/dist/{base/primitives/customEdge.js → base-primitives/memoEdge.js} +2 -2
  58. package/dist/base-primitives/memoNode.d.ts +3 -0
  59. package/dist/{base/primitives/customNode.js → base-primitives/memoNode.js} +12 -3
  60. package/dist/bundle/index.d.ts +1 -8
  61. package/dist/components/ErrorFallback.js +36 -17
  62. package/dist/components/Link.js +30 -22
  63. package/dist/components/Logo.d.ts +5 -0
  64. package/dist/components/PortalToContainer.d.ts +6 -0
  65. package/dist/components/PortalToContainer.js +14 -0
  66. package/dist/{context → components}/RootContainer.d.ts +1 -6
  67. package/dist/{context → components}/RootContainer.js +12 -11
  68. package/dist/{bundle → components}/ViewNotFound.js +2 -2
  69. package/dist/context/DiagramEventHandlers.d.ts +3 -3
  70. package/dist/context/DiagramEventHandlers.js +20 -16
  71. package/dist/context/DiagramFeatures.d.ts +1 -1
  72. package/dist/context/DiagramFeatures.js +0 -1
  73. package/dist/context/IconRenderer.d.ts +4 -3
  74. package/dist/context/IconRenderer.js +10 -8
  75. package/dist/context/RootContainerContext.d.ts +11 -0
  76. package/dist/context/RootContainerContext.js +18 -0
  77. package/dist/context/TagStylesContext.js +22 -25
  78. package/dist/context/index.d.ts +1 -1
  79. package/dist/custom/builtins.d.ts +1 -0
  80. package/dist/custom/customNodes.d.ts +30 -43
  81. package/dist/custom/customNodes.js +21 -10
  82. package/dist/custom/hooks.d.ts +5 -6
  83. package/dist/custom/index.d.ts +11 -1
  84. package/dist/custom/index.js +25 -20
  85. package/dist/custom/primitives.d.ts +1 -0
  86. package/dist/hooks/index.d.ts +6 -0
  87. package/dist/hooks/safeContext.d.ts +1 -1
  88. package/dist/{likec4model → hooks}/useCurrentViewModel.d.ts +2 -1
  89. package/dist/hooks/useCurrentViewModel.js +12 -0
  90. package/dist/hooks/useDiagram.d.ts +23 -15
  91. package/dist/hooks/useDiagram.js +1 -1
  92. package/dist/{likec4model → hooks}/useLikeC4Model.d.ts +1 -0
  93. package/dist/{likec4model → hooks}/useLikeC4Model.js +5 -2
  94. package/dist/{likec4model → hooks}/useLikeC4Project.d.ts +1 -1
  95. package/dist/{likec4model → hooks}/useLikeC4Project.js +2 -2
  96. package/dist/hooks/useLikeC4Styles.d.ts +2 -0
  97. package/dist/hooks/useLikeC4Styles.js +18 -0
  98. package/dist/hooks/useMantinePortalProps.js +2 -2
  99. package/dist/hooks/useXYFlow.d.ts +10 -10
  100. package/dist/hooks/useXYFlow.js +11 -5
  101. package/dist/index.d.ts +14 -5
  102. package/dist/index.js +9 -13
  103. package/dist/likec4diagram/DiagramUI.d.ts +1 -1
  104. package/dist/likec4diagram/DiagramUI.js +10 -16
  105. package/dist/likec4diagram/DiagramXYFlow.js +131 -117
  106. package/dist/likec4diagram/convert-to-xyflow.js +2 -2
  107. package/dist/likec4diagram/custom/edges/RelationshipEdge.d.ts +3 -51
  108. package/dist/likec4diagram/custom/edges/RelationshipEdge.js +8 -9
  109. package/dist/likec4diagram/custom/edges/SequenceStepEdge.d.ts +1 -2
  110. package/dist/likec4diagram/custom/edges/SequenceStepEdge.js +5 -5
  111. package/dist/likec4diagram/custom/index.d.ts +16 -0
  112. package/dist/likec4diagram/custom/index.js +12 -12
  113. package/dist/likec4diagram/custom/nodes/CompoundActions.d.ts +1 -2
  114. package/dist/likec4diagram/custom/nodes/CompoundActions.js +1 -1
  115. package/dist/likec4diagram/custom/nodes/ElementActions.d.ts +61 -5
  116. package/dist/likec4diagram/custom/nodes/ElementActions.js +8 -8
  117. package/dist/likec4diagram/custom/nodes/SequenceActorNode.d.ts +2 -3
  118. package/dist/likec4diagram/custom/nodes/SequenceActorNode.js +12 -24
  119. package/dist/likec4diagram/custom/nodes/nodes.d.ts +10 -10
  120. package/dist/likec4diagram/custom/nodes/nodes.js +25 -28
  121. package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.d.ts +3 -2
  122. package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.js +17 -12
  123. package/dist/likec4diagram/custom/nodes/toolbar/CompoundToolbar.d.ts +2 -6
  124. package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.d.ts +2 -6
  125. package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.js +3 -3
  126. package/dist/likec4diagram/custom/nodes/toolbar/Toolbar.d.ts +2 -3
  127. package/dist/likec4diagram/custom/nodes/toolbar/_shared.d.ts +5 -19
  128. package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +11 -22
  129. package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +50 -49
  130. package/dist/likec4diagram/relationship-popover/actor.d.ts +1 -1
  131. package/dist/{state → likec4diagram/state}/DiagramActorProvider.d.ts +1 -1
  132. package/dist/{state → likec4diagram/state}/DiagramActorProvider.js +55 -37
  133. package/dist/{state → likec4diagram/state}/assign.d.ts +1 -1
  134. package/dist/{state → likec4diagram/state}/assign.js +3 -4
  135. package/dist/{state → likec4diagram/state}/diagram-machine.d.ts +178 -138
  136. package/dist/{state → likec4diagram/state}/diagram-machine.js +34 -24
  137. package/dist/{state → likec4diagram/state}/persistence.d.ts +1 -1
  138. package/dist/{state → likec4diagram/state}/syncManualLayoutActor.d.ts +1 -1
  139. package/dist/{state → likec4diagram/state}/syncManualLayoutActor.js +2 -2
  140. package/dist/{state → likec4diagram/state}/types.d.ts +2 -2
  141. package/dist/{state → likec4diagram/state}/utils.d.ts +2 -2
  142. package/dist/likec4diagram/types.d.ts +51 -34
  143. package/dist/likec4diagram/ui/index.d.ts +0 -3
  144. package/dist/likec4diagram/ui/notation/NotationPanel.css.js +4 -1
  145. package/dist/likec4diagram/ui/notation/NotationPanel.js +6 -6
  146. package/dist/likec4diagram/useLayoutConstraints.d.ts +1 -1
  147. package/dist/likec4diagram/xyflow-diagram/diagram-view.d.ts +1 -1
  148. package/dist/likec4diagram/xyflow-diagram/diagram-view.js +12 -9
  149. package/dist/likec4diagram/xyflow-sequence/const.js +1 -8
  150. package/dist/likec4diagram/xyflow-sequence/sequence-layout.d.ts +7 -0
  151. package/dist/likec4diagram/xyflow-sequence/sequence-layout.js +181 -0
  152. package/dist/navigationpanel/NavigationPanel.js +5 -6
  153. package/dist/navigationpanel/NavigationPanelControls.js +1 -2
  154. package/dist/navigationpanel/NavigationPanelDropdown.js +7 -7
  155. package/dist/navigationpanel/_common.js +1 -1
  156. package/dist/navigationpanel/actor.d.ts +1 -1
  157. package/dist/navigationpanel/controls/BurgerButton.js +1 -1
  158. package/dist/navigationpanel/controls/NavigationButtons.js +2 -2
  159. package/dist/navigationpanel/controls/OpenSource.js +1 -1
  160. package/dist/navigationpanel/controls/SearchControl.js +1 -1
  161. package/dist/navigationpanel/controls/ToggleReadonly.js +2 -2
  162. package/dist/navigationpanel/controls/ViewDetailsCard.js +30 -20
  163. package/dist/navigationpanel/dropdown/ProjectsMenu.js +2 -2
  164. package/dist/navigationpanel/editorpanel/CenterCamera.js +1 -1
  165. package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.js +1 -1
  166. package/dist/navigationpanel/editorpanel/LayoutDriftNotification.js +1 -1
  167. package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.js +9 -9
  168. package/dist/navigationpanel/hooks.d.ts +3 -3
  169. package/dist/navigationpanel/hooks.js +2 -2
  170. package/dist/navigationpanel/styles.css.d.ts +1 -1
  171. package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +3 -3
  172. package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +107 -107
  173. package/dist/navigationpanel/walkthrough/DynamicViewControls.js +3 -13
  174. package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +2 -2
  175. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/createReactComponent.js +1 -1
  176. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.js +1 -1
  177. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertTriangle.js +1 -1
  178. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowDownRight.js +1 -1
  179. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowLeft.js +1 -1
  180. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js +1 -1
  181. package/dist/node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconBolt.js +14 -0
  182. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconBrowser.js +1 -1
  183. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js +1 -1
  184. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronDown.js +1 -1
  185. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronLeft.js +1 -1
  186. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js +1 -1
  187. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js +1 -1
  188. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconCylinder.js +1 -1
  189. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconDeviceMobile.js +1 -1
  190. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconExternalLink.js +1 -1
  191. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js +1 -1
  192. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconFocusCentered.js +1 -1
  193. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconFolderFilled.js +1 -1
  194. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconHelpCircle.js +1 -1
  195. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js +1 -1
  196. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircle.js +1 -1
  197. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignBottom.js +1 -1
  198. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignCenter.js +1 -1
  199. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignLeft.js +1 -1
  200. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignMiddle.js +1 -1
  201. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignRight.js +1 -1
  202. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignTop.js +1 -1
  203. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutBoardSplit.js +1 -1
  204. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutCollage.js +1 -1
  205. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutDashboard.js +1 -1
  206. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLink.js +1 -1
  207. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLock.js +1 -1
  208. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconLockOpen2.js +1 -1
  209. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconMenu2.js +1 -1
  210. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerPlayFilled.js +1 -1
  211. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipBackFilled.js +1 -1
  212. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipForwardFilled.js +1 -1
  213. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerStopFilled.js +1 -1
  214. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconRectangularPrism.js +1 -1
  215. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconReorder.js +1 -1
  216. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.js +1 -1
  217. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js +1 -1
  218. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.js +1 -1
  219. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconStack2.js +1 -1
  220. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconStarFilled.js +1 -1
  221. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconTarget.js +1 -1
  222. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js +1 -1
  223. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconUser.js +1 -1
  224. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js +1 -1
  225. package/dist/node_modules/.pnpm/{@tabler_icons-react@3.34.1_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.1.1}/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js +1 -1
  226. package/dist/overlays/element-details/ElementDetailsCard.css.js +8 -2
  227. package/dist/overlays/element-details/ElementDetailsCard.js +45 -43
  228. package/dist/overlays/element-details/TabPanelDeployments.js +4 -4
  229. package/dist/overlays/element-details/TabPanelRelationships.js +5 -7
  230. package/dist/overlays/element-details/TabPanelStructure.js +1 -1
  231. package/dist/overlays/element-details/actor.d.ts +14 -16620
  232. package/dist/overlays/element-details/actor.js +2 -1
  233. package/dist/overlays/overlay/Overlay.js +9 -6
  234. package/dist/overlays/relationship-details/RelationshipDetails.d.ts +3 -43
  235. package/dist/overlays/relationship-details/RelationshipDetails.js +6 -6
  236. package/dist/overlays/relationship-details/SelectEdge.js +2 -2
  237. package/dist/overlays/relationship-details/_types.d.ts +29 -12
  238. package/dist/overlays/relationship-details/actor.d.ts +14 -54
  239. package/dist/overlays/relationship-details/actor.js +4 -3
  240. package/dist/overlays/relationship-details/compute.d.ts +2 -1
  241. package/dist/overlays/relationship-details/custom/ElementActions.d.ts +1 -4
  242. package/dist/overlays/relationship-details/custom/ElementActions.js +4 -4
  243. package/dist/overlays/relationship-details/custom/edgeTypes.d.ts +3 -43
  244. package/dist/overlays/relationship-details/custom/edgeTypes.js +7 -9
  245. package/dist/overlays/relationship-details/custom/nodeTypes.d.ts +10 -0
  246. package/dist/overlays/relationship-details/custom/nodeTypes.js +19 -17
  247. package/dist/overlays/relationship-details/hooks.d.ts +5 -377
  248. package/dist/overlays/relationship-details/layout-to-xyflow.js +11 -10
  249. package/dist/overlays/relationship-details/layout.d.ts +5 -4
  250. package/dist/overlays/relationship-details/layout.js +7 -8
  251. package/dist/overlays/relationships-browser/RelationshipsBrowser.d.ts +3 -44
  252. package/dist/overlays/relationships-browser/RelationshipsBrowser.js +14 -9
  253. package/dist/overlays/relationships-browser/SelectElement.js +4 -4
  254. package/dist/overlays/relationships-browser/_types.d.ts +30 -13
  255. package/dist/overlays/relationships-browser/actor.d.ts +17 -523
  256. package/dist/overlays/relationships-browser/actor.js +5 -4
  257. package/dist/overlays/relationships-browser/const.d.ts +6 -2
  258. package/dist/overlays/relationships-browser/custom/ElementActions.d.ts +1 -4
  259. package/dist/overlays/relationships-browser/custom/ElementActions.js +4 -4
  260. package/dist/overlays/relationships-browser/custom/EmptyNode.d.ts +1 -4
  261. package/dist/overlays/relationships-browser/custom/edgeTypes.d.ts +3 -44
  262. package/dist/overlays/relationships-browser/custom/edgeTypes.js +7 -8
  263. package/dist/overlays/relationships-browser/custom/index.d.ts +2 -1
  264. package/dist/overlays/relationships-browser/custom/nodeTypes.d.ts +5 -12
  265. package/dist/overlays/relationships-browser/custom/nodeTypes.js +16 -21
  266. package/dist/overlays/relationships-browser/layout.js +13 -12
  267. package/dist/overlays/relationships-browser/useViewToNodesEdges.d.ts +2 -2
  268. package/dist/overlays/relationships-browser/useViewToNodesEdges.js +11 -10
  269. package/dist/search/components/ElementsColumn.js +6 -5
  270. package/dist/search/components/PickView.js +2 -2
  271. package/dist/search/components/SearchByTags.js +3 -3
  272. package/dist/search/components/SearchInput.js +2 -2
  273. package/dist/search/components/ViewsColum.js +4 -4
  274. package/dist/search/components/_shared.css.d.ts +2 -2
  275. package/dist/{bundle → shadowroot}/ShadowRoot.d.ts +5 -1
  276. package/dist/shadowroot/ShadowRoot.js +69 -0
  277. package/dist/{bundle → shadowroot}/styles.css.d.ts +4 -4
  278. package/dist/{bundle → shadowroot}/styles.css.js +17 -24
  279. package/dist/styles.css2.js +1 -1
  280. package/dist/utils/get-view-bounds.d.ts +3 -0
  281. package/dist/utils/get-view-bounds.js +14 -0
  282. package/dist/utils/index.d.ts +1 -0
  283. package/dist/utils/xyflow.d.ts +5 -2
  284. package/dist/utils/xyflow.js +2 -0
  285. package/package.json +46 -37
  286. package/panda.buildinfo.json +137 -192
  287. package/{dist/styles-min.css → styles-min.css} +1 -1
  288. package/styles.css +1 -0
  289. package/bundle/chunk-CDr-4Ymp.js +0 -21862
  290. package/bundle/custom.js +0 -82
  291. package/dist/base/primitives/compound/CompoundTitle.d.ts +0 -6
  292. package/dist/base/primitives/customEdge.d.ts +0 -4
  293. package/dist/base/primitives/customNode.d.ts +0 -4
  294. package/dist/base/primitives/edge/xyvars.d.ts +0 -24
  295. package/dist/base/primitives/element/ElementActionButtons.d.ts +0 -13
  296. package/dist/base/primitives/element/ElementActionButtons.js +0 -79
  297. package/dist/base/primitives/element/ElementShape.d.ts +0 -32
  298. package/dist/base/primitives/element/ElementTitle.d.ts +0 -12
  299. package/dist/base/primitives/element/ElementTitle.js +0 -76
  300. package/dist/bundle/LikeC4ModelProvider.d.ts +0 -9
  301. package/dist/bundle/LikeC4ModelProvider.js +0 -5
  302. package/dist/bundle/LikeC4View.d.ts +0 -3
  303. package/dist/bundle/LikeC4View.js +0 -186
  304. package/dist/bundle/ReactLikeC4.js +0 -91
  305. package/dist/bundle/ShadowRoot.js +0 -46
  306. package/dist/bundle/custom.d.ts +0 -1
  307. package/dist/bundle/custom.js +0 -33
  308. package/dist/bundle/index.js +0 -17
  309. package/dist/components/SearchControl.css.js +0 -79
  310. package/dist/components/SearchControl.js +0 -17
  311. package/dist/custom/components.d.ts +0 -5
  312. package/dist/likec4diagram/ui/controls/ChangeAutoLayoutButton.d.ts +0 -2
  313. package/dist/likec4diagram/ui/controls/ChangeAutoLayoutButton.js +0 -159
  314. package/dist/likec4diagram/ui/controls/Controls.d.ts +0 -2
  315. package/dist/likec4diagram/ui/controls/Controls.js +0 -154
  316. package/dist/likec4diagram/ui/controls/LayoutDriftNotification.d.ts +0 -2
  317. package/dist/likec4diagram/ui/controls/LayoutDriftNotification.js +0 -50
  318. package/dist/likec4diagram/ui/controls/ManualLayoutToolsButton.d.ts +0 -2
  319. package/dist/likec4diagram/ui/controls/ManualLayoutToolsButton.js +0 -145
  320. package/dist/likec4diagram/ui/controls/NavigationButtons.d.ts +0 -1
  321. package/dist/likec4diagram/ui/controls/NavigationButtons.js +0 -61
  322. package/dist/likec4diagram/ui/controls/ToggleReadonly.d.ts +0 -1
  323. package/dist/likec4diagram/ui/controls/ToggleReadonly.js +0 -29
  324. package/dist/likec4diagram/ui/controls/_shared.d.ts +0 -7
  325. package/dist/likec4diagram/ui/controls/_shared.js +0 -22
  326. package/dist/likec4diagram/ui/controls/styles.css.d.ts +0 -8
  327. package/dist/likec4diagram/ui/controls/styles.css.js +0 -79
  328. package/dist/likec4diagram/ui/diagram-title/DiagramTitlePanel.css.d.ts +0 -3
  329. package/dist/likec4diagram/ui/diagram-title/DiagramTitlePanel.css.js +0 -49
  330. package/dist/likec4diagram/ui/diagram-title/DiagramTitlePanel.d.ts +0 -1
  331. package/dist/likec4diagram/ui/diagram-title/DiagramTitlePanel.js +0 -164
  332. package/dist/likec4diagram/ui/diagram-title/Link.d.ts +0 -4
  333. package/dist/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.css.d.ts +0 -4
  334. package/dist/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.css.js +0 -67
  335. package/dist/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.d.ts +0 -1
  336. package/dist/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.js +0 -124
  337. package/dist/likec4diagram/xyflow-sequence/layouter.js +0 -408
  338. package/dist/likec4diagram/xyflow-sequence/sequence-view.js +0 -273
  339. package/dist/likec4diagram/xyflow-sequence/utils.js +0 -92
  340. package/dist/likec4model/index.d.ts +0 -4
  341. package/dist/likec4model/useCurrentViewModel.js +0 -15
  342. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconMenu.js +0 -14
  343. package/dist/overlays/overlay/Overlay.css.d.ts +0 -60
  344. package/dist/overlays/overlay/Overlay.css.js +0 -122
  345. package/dist/src/index.ts.d.ts +0 -2
  346. package/dist/styles.css +0 -1
  347. package/src/LikeC4Diagram.props.ts +0 -350
  348. package/src/LikeC4Diagram.tsx +0 -172
  349. package/src/LikeC4ModelProvider.tsx +0 -22
  350. package/src/LikeC4ProjectsProvider.tsx +0 -41
  351. package/src/LikeC4Styles.tsx +0 -137
  352. package/src/StaticLikeC4Diagram.tsx +0 -62
  353. package/src/base/Background.tsx +0 -31
  354. package/src/base/BaseXYFlow.tsx +0 -218
  355. package/src/base/const.ts +0 -22
  356. package/src/base/index.ts +0 -12
  357. package/src/base/primitives/MarkdownBlock.tsx +0 -80
  358. package/src/base/primitives/NodeHandles.tsx +0 -18
  359. package/src/base/primitives/compound/CompoundActionButton.tsx +0 -62
  360. package/src/base/primitives/compound/CompoundDetailsButton.tsx +0 -56
  361. package/src/base/primitives/compound/CompoundNodeContainer.tsx +0 -83
  362. package/src/base/primitives/compound/CompoundTitle.tsx +0 -34
  363. package/src/base/primitives/compound/actionbtns.css.ts +0 -18
  364. package/src/base/primitives/customEdge.ts +0 -34
  365. package/src/base/primitives/customNode.tsx +0 -29
  366. package/src/base/primitives/edge/EdgeActionButton.tsx +0 -24
  367. package/src/base/primitives/edge/EdgeContainer.tsx +0 -68
  368. package/src/base/primitives/edge/EdgeLabel.tsx +0 -94
  369. package/src/base/primitives/edge/EdgeLabelContainer.tsx +0 -102
  370. package/src/base/primitives/edge/EdgeMarkers.tsx +0 -198
  371. package/src/base/primitives/edge/EdgePath.tsx +0 -126
  372. package/src/base/primitives/edge/edge.css.ts +0 -74
  373. package/src/base/primitives/edge/xyvars.ts +0 -31
  374. package/src/base/primitives/element/ElementActionButtons.tsx +0 -95
  375. package/src/base/primitives/element/ElementDetailsButton.tsx +0 -80
  376. package/src/base/primitives/element/ElementNodeContainer.css.ts +0 -51
  377. package/src/base/primitives/element/ElementNodeContainer.tsx +0 -98
  378. package/src/base/primitives/element/ElementShape.tsx +0 -250
  379. package/src/base/primitives/element/ElementTags.tsx +0 -190
  380. package/src/base/primitives/element/ElementTitle.tsx +0 -94
  381. package/src/base/primitives/index.ts +0 -20
  382. package/src/base/types.ts +0 -174
  383. package/src/base/updateEdges.ts +0 -38
  384. package/src/base/updateNodes.ts +0 -43
  385. package/src/bundle/LikeC4ModelProvider.tsx +0 -12
  386. package/src/bundle/LikeC4View.props.ts +0 -288
  387. package/src/bundle/LikeC4View.tsx +0 -194
  388. package/src/bundle/ReactLikeC4.tsx +0 -127
  389. package/src/bundle/ShadowRoot.tsx +0 -54
  390. package/src/bundle/ViewNotFound.tsx +0 -25
  391. package/src/bundle/custom.ts +0 -1
  392. package/src/bundle/index.ts +0 -27
  393. package/src/bundle/react-dom-server-mock.ts +0 -3
  394. package/src/bundle/styles.css.ts +0 -172
  395. package/src/components/ErrorFallback.tsx +0 -45
  396. package/src/components/GithubIcon.tsx +0 -16
  397. package/src/components/Link.tsx +0 -109
  398. package/src/components/NavigationLink.tsx +0 -32
  399. package/src/components/SearchControl.css.ts +0 -79
  400. package/src/components/SearchControl.tsx +0 -30
  401. package/src/context/ControlsCustomLayout.ts +0 -15
  402. package/src/context/DiagramEventHandlers.tsx +0 -68
  403. package/src/context/DiagramFeatures.tsx +0 -141
  404. package/src/context/EnsureMantine.tsx +0 -25
  405. package/src/context/FramerMotionConfig.tsx +0 -25
  406. package/src/context/IconRenderer.tsx +0 -117
  407. package/src/context/ReduceGraphics.tsx +0 -42
  408. package/src/context/RootContainer.tsx +0 -54
  409. package/src/context/TagStylesContext.tsx +0 -98
  410. package/src/context/index.ts +0 -13
  411. package/src/custom/components.ts +0 -51
  412. package/src/custom/customNodes.ts +0 -282
  413. package/src/custom/hooks.ts +0 -52
  414. package/src/custom/index.ts +0 -5
  415. package/src/hooks/index.ts +0 -6
  416. package/src/hooks/safeContext.tsx +0 -18
  417. package/src/hooks/useCurrentViewId.ts +0 -15
  418. package/src/hooks/useDiagram.ts +0 -310
  419. package/src/hooks/useId.ts +0 -5
  420. package/src/hooks/useMantinePortalProps.ts +0 -17
  421. package/src/hooks/useOverlaysActor.ts +0 -11
  422. package/src/hooks/useReducedGraphics.ts +0 -1
  423. package/src/hooks/useSearchActor.ts +0 -11
  424. package/src/hooks/useSetState.ts +0 -19
  425. package/src/hooks/useUpdateEffect.ts +0 -46
  426. package/src/hooks/useXYFlow.ts +0 -41
  427. package/src/index.ts +0 -50
  428. package/src/likec4diagram/DiagramUI.tsx +0 -46
  429. package/src/likec4diagram/DiagramXYFlow.tsx +0 -240
  430. package/src/likec4diagram/convert-to-xyflow.ts +0 -45
  431. package/src/likec4diagram/custom/edges/RelationshipEdge.tsx +0 -373
  432. package/src/likec4diagram/custom/edges/SequenceStepEdge.tsx +0 -65
  433. package/src/likec4diagram/custom/edges/edges.css.ts +0 -45
  434. package/src/likec4diagram/custom/edges/utils.ts +0 -125
  435. package/src/likec4diagram/custom/index.ts +0 -28
  436. package/src/likec4diagram/custom/nodes/CompoundActions.tsx +0 -27
  437. package/src/likec4diagram/custom/nodes/ElementActions.tsx +0 -120
  438. package/src/likec4diagram/custom/nodes/SequenceActorNode.tsx +0 -175
  439. package/src/likec4diagram/custom/nodes/index.ts +0 -18
  440. package/src/likec4diagram/custom/nodes/nodes.tsx +0 -129
  441. package/src/likec4diagram/custom/nodes/toolbar/ColorButton.tsx +0 -175
  442. package/src/likec4diagram/custom/nodes/toolbar/CompoundToolbar.tsx +0 -122
  443. package/src/likec4diagram/custom/nodes/toolbar/ElementToolbar.tsx +0 -140
  444. package/src/likec4diagram/custom/nodes/toolbar/Toolbar.tsx +0 -82
  445. package/src/likec4diagram/custom/nodes/toolbar/_shared.tsx +0 -151
  446. package/src/likec4diagram/custom/nodes/toolbar/styles.css.ts +0 -13
  447. package/src/likec4diagram/relationship-popover/RelationshipPopover.tsx +0 -549
  448. package/src/likec4diagram/relationship-popover/actor.ts +0 -192
  449. package/src/likec4diagram/relationship-popover/styles.css.ts +0 -27
  450. package/src/likec4diagram/types.ts +0 -240
  451. package/src/likec4diagram/ui/controls/ChangeAutoLayoutButton.tsx +0 -202
  452. package/src/likec4diagram/ui/controls/Controls.tsx +0 -153
  453. package/src/likec4diagram/ui/controls/LayoutDriftNotification.tsx +0 -50
  454. package/src/likec4diagram/ui/controls/ManualLayoutToolsButton.tsx +0 -125
  455. package/src/likec4diagram/ui/controls/NavigationButtons.tsx +0 -61
  456. package/src/likec4diagram/ui/controls/ToggleReadonly.tsx +0 -30
  457. package/src/likec4diagram/ui/controls/_shared.ts +0 -21
  458. package/src/likec4diagram/ui/controls/styles.css.ts +0 -84
  459. package/src/likec4diagram/ui/diagram-title/DiagramTitlePanel.css.ts +0 -51
  460. package/src/likec4diagram/ui/diagram-title/DiagramTitlePanel.tsx +0 -175
  461. package/src/likec4diagram/ui/diagram-title/Link.tsx +0 -40
  462. package/src/likec4diagram/ui/index.ts +0 -4
  463. package/src/likec4diagram/ui/notation/NotationPanel.css.ts +0 -99
  464. package/src/likec4diagram/ui/notation/NotationPanel.tsx +0 -252
  465. package/src/likec4diagram/ui/notation/index.ts +0 -1
  466. package/src/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.css.ts +0 -70
  467. package/src/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.tsx +0 -130
  468. package/src/likec4diagram/useLayoutConstraints.ts +0 -281
  469. package/src/likec4diagram/xyflow-diagram/diagram-view.ts +0 -275
  470. package/src/likec4diagram/xyflow-sequence/_types.ts +0 -45
  471. package/src/likec4diagram/xyflow-sequence/const.ts +0 -37
  472. package/src/likec4diagram/xyflow-sequence/layouter.ts +0 -567
  473. package/src/likec4diagram/xyflow-sequence/sequence-view.ts +0 -337
  474. package/src/likec4diagram/xyflow-sequence/utils.ts +0 -112
  475. package/src/likec4model/LikeC4ModelContext.tsx +0 -19
  476. package/src/likec4model/LikeC4ProjectsContext.ts +0 -9
  477. package/src/likec4model/index.ts +0 -19
  478. package/src/likec4model/useCurrentViewModel.ts +0 -14
  479. package/src/likec4model/useLikeC4ElementsTree.ts +0 -39
  480. package/src/likec4model/useLikeC4Model.ts +0 -35
  481. package/src/likec4model/useLikeC4Project.ts +0 -61
  482. package/src/navigationpanel/NavigationPanel.tsx +0 -136
  483. package/src/navigationpanel/NavigationPanelControls.tsx +0 -133
  484. package/src/navigationpanel/NavigationPanelDropdown.tsx +0 -547
  485. package/src/navigationpanel/_common.tsx +0 -84
  486. package/src/navigationpanel/actor.ts +0 -320
  487. package/src/navigationpanel/controls/BurgerButton.tsx +0 -30
  488. package/src/navigationpanel/controls/NavigationButtons.tsx +0 -40
  489. package/src/navigationpanel/controls/OpenSource.tsx +0 -28
  490. package/src/navigationpanel/controls/SearchControl.tsx +0 -66
  491. package/src/navigationpanel/controls/ToggleReadonly.tsx +0 -66
  492. package/src/navigationpanel/controls/ViewDetailsCard.tsx +0 -249
  493. package/src/navigationpanel/controls/index.ts +0 -6
  494. package/src/navigationpanel/dropdown/ProjectsMenu.tsx +0 -78
  495. package/src/navigationpanel/editorpanel/CenterCamera.tsx +0 -15
  496. package/src/navigationpanel/editorpanel/ChangeAutoLayoutButton.tsx +0 -199
  497. package/src/navigationpanel/editorpanel/EditorPanel.tsx +0 -49
  498. package/src/navigationpanel/editorpanel/LayoutDriftNotification.tsx +0 -56
  499. package/src/navigationpanel/editorpanel/ManualLayoutToolsButton.tsx +0 -148
  500. package/src/navigationpanel/editorpanel/_common.tsx +0 -14
  501. package/src/navigationpanel/editorpanel/index.ts +0 -1
  502. package/src/navigationpanel/editorpanel/styles.ts +0 -84
  503. package/src/navigationpanel/hooks.tsx +0 -70
  504. package/src/navigationpanel/index.ts +0 -1
  505. package/src/navigationpanel/styles.css.ts +0 -28
  506. package/src/navigationpanel/walkthrough/ActiveWalkthroughControls.tsx +0 -132
  507. package/src/navigationpanel/walkthrough/DynamicViewControls.tsx +0 -125
  508. package/src/navigationpanel/walkthrough/WalkthroughPanel.css.ts +0 -21
  509. package/src/navigationpanel/walkthrough/WalkthroughPanel.tsx +0 -88
  510. package/src/navigationpanel/walkthrough/index.tsx +0 -2
  511. package/src/overlays/Overlays.tsx +0 -121
  512. package/src/overlays/element-details/ElementDetails.tsx +0 -33
  513. package/src/overlays/element-details/ElementDetailsCard.css.ts +0 -257
  514. package/src/overlays/element-details/ElementDetailsCard.tsx +0 -666
  515. package/src/overlays/element-details/TabPanelDeployments.css.ts +0 -64
  516. package/src/overlays/element-details/TabPanelDeployments.tsx +0 -220
  517. package/src/overlays/element-details/TabPanelRelationships.css.ts +0 -102
  518. package/src/overlays/element-details/TabPanelRelationships.tsx +0 -186
  519. package/src/overlays/element-details/TabPanelStructure.css.ts +0 -36
  520. package/src/overlays/element-details/TabPanelStructure.tsx +0 -121
  521. package/src/overlays/element-details/actor.ts +0 -104
  522. package/src/overlays/element-details/actorContext.tsx +0 -16
  523. package/src/overlays/overlay/Overlay.css.ts +0 -123
  524. package/src/overlays/overlay/Overlay.tsx +0 -169
  525. package/src/overlays/overlaysActor.ts +0 -284
  526. package/src/overlays/relationship-details/RelationshipDetails.tsx +0 -334
  527. package/src/overlays/relationship-details/SelectEdge.css.ts +0 -88
  528. package/src/overlays/relationship-details/SelectEdge.tsx +0 -141
  529. package/src/overlays/relationship-details/_types.ts +0 -88
  530. package/src/overlays/relationship-details/actor.ts +0 -397
  531. package/src/overlays/relationship-details/compute.ts +0 -177
  532. package/src/overlays/relationship-details/custom/ElementActions.tsx +0 -53
  533. package/src/overlays/relationship-details/custom/edgeTypes.tsx +0 -49
  534. package/src/overlays/relationship-details/custom/index.ts +0 -2
  535. package/src/overlays/relationship-details/custom/nodeTypes.tsx +0 -126
  536. package/src/overlays/relationship-details/custom/styles.css.ts +0 -13
  537. package/src/overlays/relationship-details/hooks.ts +0 -51
  538. package/src/overlays/relationship-details/layout-to-xyflow.ts +0 -173
  539. package/src/overlays/relationship-details/layout.ts +0 -476
  540. package/src/overlays/relationships-browser/RelationshipsBrowser.tsx +0 -281
  541. package/src/overlays/relationships-browser/SelectElement.css.ts +0 -22
  542. package/src/overlays/relationships-browser/SelectElement.tsx +0 -229
  543. package/src/overlays/relationships-browser/_types.ts +0 -102
  544. package/src/overlays/relationships-browser/actor.ts +0 -592
  545. package/src/overlays/relationships-browser/const.ts +0 -8
  546. package/src/overlays/relationships-browser/custom/ElementActions.tsx +0 -57
  547. package/src/overlays/relationships-browser/custom/EmptyNode.tsx +0 -18
  548. package/src/overlays/relationships-browser/custom/edgeTypes.tsx +0 -103
  549. package/src/overlays/relationships-browser/custom/index.ts +0 -2
  550. package/src/overlays/relationships-browser/custom/nodeTypes.tsx +0 -146
  551. package/src/overlays/relationships-browser/custom/styles.css.ts +0 -12
  552. package/src/overlays/relationships-browser/hooks.ts +0 -63
  553. package/src/overlays/relationships-browser/layout.ts +0 -630
  554. package/src/overlays/relationships-browser/useViewToNodesEdges.ts +0 -210
  555. package/src/overlays/types.ts +0 -39
  556. package/src/search/Search.tsx +0 -220
  557. package/src/search/components/ElementsColumn.css.ts +0 -84
  558. package/src/search/components/ElementsColumn.tsx +0 -318
  559. package/src/search/components/PickView.tsx +0 -134
  560. package/src/search/components/SearchByTags.tsx +0 -112
  561. package/src/search/components/SearchInput.tsx +0 -265
  562. package/src/search/components/ViewsColum.tsx +0 -167
  563. package/src/search/components/ViewsColumn.css.ts +0 -34
  564. package/src/search/components/_shared.css.ts +0 -176
  565. package/src/search/components/styles.css.ts +0 -72
  566. package/src/search/components/utils.ts +0 -64
  567. package/src/search/hooks.ts +0 -38
  568. package/src/search/searchActor.ts +0 -99
  569. package/src/state/DiagramActorProvider.tsx +0 -176
  570. package/src/state/aligners.ts +0 -500
  571. package/src/state/assign.ts +0 -425
  572. package/src/state/diagram-machine.ts +0 -1422
  573. package/src/state/hotkeyActor.ts +0 -41
  574. package/src/state/inspector.ts +0 -5
  575. package/src/state/persistence.ts +0 -22
  576. package/src/state/syncManualLayoutActor.ts +0 -218
  577. package/src/state/types.ts +0 -34
  578. package/src/state/utils.ts +0 -152
  579. package/src/styles-font.css +0 -251
  580. package/src/styles-min.css +0 -2
  581. package/src/styles-xyflow.css +0 -1
  582. package/src/styles.css +0 -3
  583. package/src/utils/css.ts +0 -7
  584. package/src/utils/index.ts +0 -15
  585. package/src/utils/roundDpr.ts +0 -27
  586. package/src/utils/vector.ts +0 -57
  587. package/src/utils/xyflow.ts +0 -105
  588. /package/dist/{base/primitives → base-primitives}/NodeHandles.d.ts +0 -0
  589. /package/dist/{base/primitives → base-primitives}/compound/actionbtns.css.js +0 -0
  590. /package/dist/{base/primitives → base-primitives}/edge/EdgeActionButton.d.ts +0 -0
  591. /package/dist/{base/primitives → base-primitives}/edge/EdgeContainer.js +0 -0
  592. /package/dist/{base/primitives → base-primitives}/edge/EdgeMarkers.d.ts +0 -0
  593. /package/dist/{base/primitives → base-primitives}/edge/EdgeMarkers.js +0 -0
  594. /package/dist/{base/primitives → base-primitives}/edge/EdgePath.js +0 -0
  595. /package/dist/{base/primitives → base-primitives}/edge/edge.css.d.ts +0 -0
  596. /package/dist/{base/primitives → base-primitives}/edge/edge.css.js +0 -0
  597. /package/dist/{base/primitives → base-primitives}/element/ElementNodeContainer.css.d.ts +0 -0
  598. /package/dist/{base/primitives → base-primitives}/element/ElementNodeContainer.css.js +0 -0
  599. /package/dist/{base/primitives → base-primitives}/element/ElementNodeContainer.js +0 -0
  600. /package/dist/{bundle → components}/ViewNotFound.d.ts +0 -0
  601. /package/dist/{likec4model → context}/LikeC4ModelContext.d.ts +0 -0
  602. /package/dist/{likec4model → context}/LikeC4ModelContext.js +0 -0
  603. /package/dist/{likec4model → context}/LikeC4ProjectsContext.d.ts +0 -0
  604. /package/dist/{likec4model → context}/LikeC4ProjectsContext.js +0 -0
  605. /package/dist/{likec4model → hooks}/useLikeC4ElementsTree.d.ts +0 -0
  606. /package/dist/{likec4model → hooks}/useLikeC4ElementsTree.js +0 -0
  607. /package/dist/{state → likec4diagram/state}/aligners.d.ts +0 -0
  608. /package/dist/{state → likec4diagram/state}/aligners.js +0 -0
  609. /package/dist/{state → likec4diagram/state}/hotkeyActor.d.ts +0 -0
  610. /package/dist/{state → likec4diagram/state}/hotkeyActor.js +0 -0
  611. /package/dist/{state → likec4diagram/state}/inspector.d.ts +0 -0
  612. /package/dist/{state → likec4diagram/state}/persistence.js +0 -0
  613. /package/dist/{state → likec4diagram/state}/utils.js +0 -0
  614. /package/{dist/styles-font.css → styles-font.css} +0 -0
  615. /package/{dist/styles-xyflow.css → styles-xyflow.css} +0 -0
@@ -1,194 +0,0 @@
1
- import type * as t from '@likec4/core/types'
2
- import { cx } from '@likec4/styles/css'
3
- import { ActionIcon, Box } from '@mantine/core'
4
- import { shallowEqual, useCallbackRef } from '@mantine/hooks'
5
- import { IconX } from '@tabler/icons-react'
6
- import { memo, useState } from 'react'
7
- import { isBoolean } from 'remeda'
8
- import { FitViewPaddings } from '../base/const'
9
- import { FramerMotionConfig } from '../context/FramerMotionConfig'
10
- import { LikeC4Diagram } from '../LikeC4Diagram'
11
- import { useLikeC4Model } from '../likec4model/useLikeC4Model'
12
- import { Overlay } from '../overlays/overlay/Overlay'
13
- import type { LikeC4ViewProps } from './LikeC4View.props'
14
- import { ShadowRoot } from './ShadowRoot'
15
- import { cssInteractive, useColorScheme, useShadowRootStyle } from './styles.css'
16
- import { ErrorMessage, ViewNotFound } from './ViewNotFound'
17
-
18
- export function LikeC4View<A extends t.aux.Any = t.aux.UnknownLayouted>({
19
- viewId,
20
- ...props
21
- }: LikeC4ViewProps<A>) {
22
- const likec4model = useLikeC4Model()
23
- const view = likec4model.findView(viewId)
24
-
25
- if (!view) {
26
- return <ViewNotFound viewId={viewId} />
27
- }
28
-
29
- if (!view.isDiagram()) {
30
- return (
31
- <ErrorMessage>
32
- LikeC4 View "${viewId}" is not layouted. Make sure you have LikeC4ModelProvider with layouted model.
33
- </ErrorMessage>
34
- )
35
- }
36
-
37
- return <LikeC4ViewInner view={view.$view} {...props} />
38
- }
39
-
40
- type LikeC4ViewInnerProps<A extends t.aux.Any> = Omit<LikeC4ViewProps<A>, 'viewId'> & {
41
- view: t.DiagramView<A>
42
- }
43
- const LikeC4ViewInner = memo<LikeC4ViewInnerProps<t.aux.UnknownLayouted>>(({
44
- view,
45
- className,
46
- pannable = false,
47
- zoomable = false,
48
- keepAspectRatio = true,
49
- colorScheme: explicitColorScheme,
50
- injectFontCss = true,
51
- controls = false,
52
- background = 'transparent',
53
- browser = true,
54
- showDiagramTitle = false,
55
- showNavigationButtons = false,
56
- showNotations = false,
57
- enableFocusMode = false,
58
- enableDynamicViewWalkthrough = enableFocusMode,
59
- enableElementDetails = false,
60
- enableRelationshipBrowser = enableElementDetails,
61
- enableRelationshipDetails = enableRelationshipBrowser,
62
- reduceGraphics = 'auto',
63
- mantineTheme,
64
- styleNonce,
65
- style,
66
- reactFlowProps = {},
67
- renderNodes,
68
- ...props
69
- }) => {
70
- const likec4model = useLikeC4Model()
71
- const colorScheme = useColorScheme(explicitColorScheme)
72
-
73
- const [shadowRootProps, cssstyle] = useShadowRootStyle(keepAspectRatio, view)
74
-
75
- const [browserViewId, onNavigateTo] = useState(null as t.aux.ViewId<t.aux.UnknownLayouted> | null)
76
-
77
- const onNavigateToThisView = useCallbackRef(() => {
78
- onNavigateTo(view.id)
79
- })
80
-
81
- const browserView = browserViewId ? likec4model.findView(browserViewId)?.$view : null
82
-
83
- const notations = view.notation?.nodes ?? []
84
- const hasNotations = notations.length > 0
85
-
86
- let nonce
87
- if (typeof styleNonce === 'string') {
88
- nonce = styleNonce
89
- } else if (typeof styleNonce === 'function') {
90
- nonce = styleNonce()
91
- }
92
-
93
- const isBrowserEnabled = browser !== false
94
-
95
- const browserProps = isBoolean(browser) ? {} : browser
96
-
97
- return (
98
- <>
99
- <style
100
- type="text/css"
101
- nonce={nonce}
102
- dangerouslySetInnerHTML={{
103
- __html: cssstyle,
104
- }} />
105
- <ShadowRoot
106
- {...shadowRootProps}
107
- injectFontCss={injectFontCss}
108
- theme={mantineTheme}
109
- colorScheme={colorScheme}
110
- styleNonce={styleNonce}
111
- className={cx(
112
- 'likec4-view',
113
- className,
114
- )}
115
- style={style}>
116
- <FramerMotionConfig>
117
- <LikeC4Diagram
118
- view={view}
119
- readonly
120
- pannable={pannable}
121
- zoomable={zoomable}
122
- background={background}
123
- fitView={true}
124
- fitViewPadding={FitViewPaddings.default}
125
- showDiagramTitle={showDiagramTitle}
126
- showNotations={showNotations && hasNotations}
127
- enableDynamicViewWalkthrough={enableDynamicViewWalkthrough}
128
- showNavigationButtons={showNavigationButtons}
129
- experimentalEdgeEditing={false}
130
- enableFocusMode={enableFocusMode}
131
- enableRelationshipDetails={enableRelationshipDetails}
132
- enableElementDetails={enableElementDetails}
133
- enableRelationshipBrowser={enableRelationshipBrowser}
134
- enableElementTags={false}
135
- controls={controls}
136
- nodesDraggable={false}
137
- reduceGraphics={reduceGraphics}
138
- className={cx(
139
- 'likec4-static-view',
140
- isBrowserEnabled && cssInteractive,
141
- )}
142
- // We may have multiple embedded views on the same page
143
- // so we don't want enable search and hotkeys
144
- enableSearch={false}
145
- {...isBrowserEnabled && {
146
- onCanvasClick: onNavigateToThisView,
147
- onNodeClick: onNavigateToThisView,
148
- }}
149
- reactFlowProps={reactFlowProps}
150
- renderNodes={renderNodes}
151
- {...props}
152
- />
153
- {browserView && (
154
- <Overlay openDelay={0} onClose={() => onNavigateTo(null)}>
155
- <LikeC4Diagram
156
- view={browserView}
157
- background="dots"
158
- onNavigateTo={onNavigateTo}
159
- enableDynamicViewWalkthrough
160
- enableFocusMode
161
- enableRelationshipBrowser
162
- enableElementDetails
163
- enableRelationshipDetails
164
- enableSearch
165
- enableElementTags
166
- controls="next"
167
- readonly
168
- fitView
169
- {...props}
170
- fitViewPadding={FitViewPaddings.withControls}
171
- {...browserProps}
172
- showNotations={(browserProps.showNotations ?? true) &&
173
- (browserView.notation?.nodes.length ?? 0) > 0}
174
- renderNodes={renderNodes}
175
- />
176
- <Box pos="absolute" top={'1rem'} right={'1rem'}>
177
- <ActionIcon
178
- variant="default"
179
- color="gray"
180
- onClick={(e) => {
181
- e.stopPropagation()
182
- onNavigateTo(null)
183
- }}>
184
- <IconX />
185
- </ActionIcon>
186
- </Box>
187
- </Overlay>
188
- )}
189
- </FramerMotionConfig>
190
- </ShadowRoot>
191
- </>
192
- )
193
- }, shallowEqual)
194
- LikeC4ViewInner.displayName = 'LikeC4ViewInner'
@@ -1,127 +0,0 @@
1
- import type * as t from '@likec4/core/types'
2
- import { cx } from '@likec4/styles/css'
3
- import { type CSSProperties } from 'react'
4
- import { isFunction, isString } from 'remeda'
5
- import { type LikeC4DiagramProps, LikeC4Diagram } from '../LikeC4Diagram'
6
- import { useLikeC4Model } from '../likec4model/useLikeC4Model'
7
- import { ShadowRoot } from './ShadowRoot'
8
- import { useColorScheme, useShadowRootStyle } from './styles.css'
9
- import { ErrorMessage, ViewNotFound } from './ViewNotFound'
10
-
11
- export type ReactLikeC4Props<A extends t.aux.Any = t.aux.UnknownLayouted> = Omit<LikeC4DiagramProps<A>, 'view'> & {
12
- viewId: t.aux.ViewId<A>
13
-
14
- /**
15
- * Keep aspect ratio of the diagram
16
- * Disable if you need to manage the viewport (use className)
17
- *
18
- * @default true
19
- */
20
- keepAspectRatio?: boolean | undefined
21
-
22
- /**
23
- * By default determined by the user's system preferences.
24
- */
25
- colorScheme?: 'light' | 'dark' | undefined
26
-
27
- /**
28
- * LikeC4 views are using 'IBM Plex Sans' font.
29
- * By default, component injects the CSS to document head.
30
- * Set to false if you want to handle the font yourself.
31
- *
32
- * @default true
33
- */
34
- injectFontCss?: boolean | undefined
35
-
36
- style?: CSSProperties | undefined
37
-
38
- mantineTheme?: any
39
-
40
- /** Function to generate nonce attribute added to all generated `<style />` tags */
41
- styleNonce?: string | (() => string) | undefined
42
- }
43
-
44
- export function ReactLikeC4<A extends t.aux.Any = t.aux.UnknownLayouted>({
45
- viewId,
46
- ...props
47
- }: ReactLikeC4Props<A>) {
48
- const likec4model = useLikeC4Model()
49
- const view = likec4model.findView(viewId)
50
-
51
- if (!view) {
52
- return <ViewNotFound viewId={viewId} />
53
- }
54
-
55
- if (!view.isDiagram()) {
56
- return (
57
- <ErrorMessage>
58
- LikeC4 View "${viewId}" is not layouted. Make sure you have LikeC4ModelProvider with layouted model.
59
- </ErrorMessage>
60
- )
61
- }
62
-
63
- return <ReactLikeC4Inner view={view.$view} {...props} />
64
- }
65
-
66
- type ReactLikeC4InnerProps<A extends t.aux.Any> = Omit<ReactLikeC4Props<A>, 'viewId'> & {
67
- view: t.DiagramView<A>
68
- }
69
- function ReactLikeC4Inner<A extends t.aux.Any>({
70
- className,
71
- view,
72
- colorScheme: explicitColorScheme,
73
- injectFontCss = true,
74
- keepAspectRatio = true,
75
- showNotations = true,
76
- onNavigateTo,
77
- background = 'transparent',
78
- style,
79
- mantineTheme,
80
- styleNonce,
81
- ...props
82
- }: ReactLikeC4InnerProps<A>) {
83
- const colorScheme = useColorScheme(explicitColorScheme)
84
-
85
- const [shadowRootProps, cssstyle] = useShadowRootStyle(keepAspectRatio, view)
86
-
87
- const notations = view.notation?.nodes ?? []
88
- const hasNotations = notations.length > 0
89
-
90
- let nonce
91
- if (isString(styleNonce)) {
92
- nonce = styleNonce
93
- } else if (isFunction(styleNonce)) {
94
- nonce = styleNonce()
95
- }
96
-
97
- return (
98
- <>
99
- <style
100
- type="text/css"
101
- nonce={nonce}
102
- dangerouslySetInnerHTML={{ __html: cssstyle }}
103
- />
104
- <ShadowRoot
105
- {...shadowRootProps}
106
- injectFontCss={injectFontCss}
107
- theme={mantineTheme}
108
- colorScheme={colorScheme}
109
- styleNonce={styleNonce}
110
- className={cx(
111
- 'likec4-view',
112
- className,
113
- )}
114
- style={style}>
115
- <LikeC4Diagram
116
- view={view as any}
117
- showNotations={showNotations && hasNotations}
118
- onNavigateTo={onNavigateTo as any}
119
- background={background}
120
- enableElementTags={false}
121
- {...props}
122
- />
123
- </ShadowRoot>
124
- </>
125
- )
126
- }
127
- ReactLikeC4.displayName = 'ReactLikeC4'
@@ -1,54 +0,0 @@
1
- import { type MantineThemeOverride, MantineProvider } from '@mantine/core'
2
- import { type HTMLAttributes, useCallback, useRef } from 'react'
3
- import root from 'react-shadow'
4
- import { isDefined } from 'remeda'
5
- import { DefaultTheme, useBundledStyleSheet } from './styles.css'
6
-
7
- const Root = root['div']!
8
-
9
- type ShadowRootProps = HTMLAttributes<HTMLDivElement> & {
10
- injectFontCss?: boolean | undefined
11
- styleNonce?: string | (() => string) | undefined
12
- mode?: 'open' | 'closed'
13
- delegatesFocus?: boolean
14
- colorScheme?: 'light' | 'dark' | undefined
15
- theme?: MantineThemeOverride | undefined
16
- }
17
-
18
- export function ShadowRoot({
19
- children,
20
- theme = DefaultTheme,
21
- injectFontCss = true,
22
- styleNonce,
23
- colorScheme,
24
- ...props
25
- }: ShadowRootProps) {
26
- const rootRef = useRef<HTMLDivElement>(null)
27
- const styleSheets = useBundledStyleSheet(injectFontCss, styleNonce)
28
- const getRootElement = useCallback(() => rootRef.current ?? undefined, [rootRef])
29
-
30
- let getStyleNonce
31
- if (isDefined(styleNonce)) {
32
- getStyleNonce = typeof styleNonce === 'function' ? styleNonce : () => styleNonce
33
- }
34
-
35
- return (
36
- <Root ssr={false} styleSheets={styleSheets} {...props}>
37
- <div
38
- ref={rootRef}
39
- {...(colorScheme && { 'data-mantine-color-scheme': colorScheme })}
40
- className={'likec4-shadow-root'}
41
- >
42
- <MantineProvider
43
- {...(colorScheme && { forceColorScheme: colorScheme })}
44
- defaultColorScheme={'auto'}
45
- getRootElement={getRootElement}
46
- {...getStyleNonce && { getStyleNonce }}
47
- cssVariablesSelector={'.likec4-shadow-root'}
48
- theme={theme}>
49
- {children}
50
- </MantineProvider>
51
- </div>
52
- </Root>
53
- )
54
- }
@@ -1,25 +0,0 @@
1
- import type { PropsWithChildren } from 'react'
2
-
3
- export const ErrorMessage = ({ children }: PropsWithChildren) => (
4
- <div
5
- style={{
6
- margin: '[1rem 0]',
7
- }}>
8
- <div
9
- style={{
10
- margin: '0 auto',
11
- display: 'inline-block',
12
- padding: '2rem',
13
- background: 'rgba(250,82,82,.15)',
14
- color: '#ffa8a8',
15
- }}>
16
- {children}
17
- </div>
18
- </div>
19
- )
20
-
21
- export const ViewNotFound = ({ viewId }: { viewId: string }) => (
22
- <ErrorMessage>
23
- View <code>{viewId}</code> not found
24
- </ErrorMessage>
25
- )
@@ -1 +0,0 @@
1
- export * from '../custom'
@@ -1,27 +0,0 @@
1
- export type {
2
- ChangeEvent,
3
- CustomNodes,
4
- DiagramNodeWithNavigate,
5
- ElementIconRenderer,
6
- LikeC4ColorScheme,
7
- LikeC4DiagramEventHandlers,
8
- OnCanvasClick,
9
- OnChange,
10
- OnEdgeClick,
11
- OnNavigateTo,
12
- OnNodeClick,
13
- OpenSourceParams,
14
- PaddingUnit,
15
- PaddingWithUnit,
16
- WhereOperator,
17
- } from '../LikeC4Diagram.props'
18
- export { LikeC4View } from './LikeC4View'
19
- export type { LikeC4BrowserProps, LikeC4ViewProps } from './LikeC4View.props'
20
- export { ReactLikeC4, type ReactLikeC4Props } from './ReactLikeC4'
21
-
22
- export { LikeC4ProjectsProvider, type LikeC4ProjectsProviderProps } from '../LikeC4ProjectsProvider'
23
- export { LikeC4ModelProvider, type LikeC4ModelProviderProps } from './LikeC4ModelProvider'
24
-
25
- export { ViewNotFound } from './ViewNotFound'
26
-
27
- export * from '../custom/hooks'
@@ -1,3 +0,0 @@
1
- export const renderToString = (_view: any) => {
2
- throw new Error('LikeC4View is not available SSR')
3
- }
@@ -1,172 +0,0 @@
1
- import type { DiagramView } from '@likec4/core'
2
- import { css } from '@likec4/styles/css'
3
- import { type MantineThemeOverride, createTheme, Portal } from '@mantine/core'
4
- import {
5
- useColorScheme as usePreferredColorScheme,
6
- useDebouncedCallback,
7
- useMutationObserver,
8
- } from '@mantine/hooks'
9
- import { useIsomorphicLayoutEffect } from '@react-hookz/web'
10
- import { useState } from 'react'
11
- import { first, isFunction, isString } from 'remeda'
12
- import { useId } from '../hooks/useId'
13
- import fontsCss from '../styles-font.css?inline'
14
- import inlinedStyles from '../styles.css?inline'
15
-
16
- export const DefaultTheme = createTheme({
17
- autoContrast: true,
18
- primaryColor: 'indigo',
19
- cursorType: 'pointer',
20
- defaultRadius: 'sm',
21
- fontFamily: 'var(--likec4-app-font, var(--likec4-app-font-default))',
22
- headings: {
23
- fontWeight: '500',
24
- sizes: {
25
- h1: {
26
- // fontSize: '2rem',
27
- fontWeight: '600',
28
- },
29
- h2: {
30
- fontWeight: '500',
31
- // fontSize: '1.85rem',
32
- },
33
- },
34
- },
35
- components: {
36
- Portal: Portal.extend({
37
- defaultProps: {
38
- reuseTargetNode: true,
39
- },
40
- }),
41
- },
42
- }) as MantineThemeOverride
43
-
44
- export const cssInteractive = css({
45
- cursor: 'pointer',
46
- ['--mantine-cursor-pointer']: 'pointer',
47
- '& :where(.likec4-diagram, .likec4-compound-node, .likec4-element-node)': {
48
- cursor: 'pointer',
49
- },
50
- })
51
-
52
- export function useBundledStyleSheet(injectFontCss: boolean, styleNonce?: string | (() => string) | undefined) {
53
- const [styleSheets, setStyleSheets] = useState([] as CSSStyleSheet[])
54
-
55
- useIsomorphicLayoutEffect(() => {
56
- if (injectFontCss && !document.querySelector(`style[data-likec4-font]`)) {
57
- const style = document.createElement('style')
58
- style.setAttribute('type', 'text/css')
59
- style.setAttribute('data-likec4-font', '')
60
- if (isString(styleNonce)) {
61
- style.setAttribute('nonce', styleNonce)
62
- }
63
- if (isFunction(styleNonce)) {
64
- style.setAttribute('nonce', styleNonce())
65
- }
66
- style.appendChild(document.createTextNode(fontsCss))
67
- document.head.appendChild(style)
68
- }
69
- }, [injectFontCss])
70
-
71
- useIsomorphicLayoutEffect(() => {
72
- const css = new CSSStyleSheet()
73
- css.replaceSync(
74
- inlinedStyles
75
- .replaceAll(':where(:root,:host)', `.likec4-shadow-root`)
76
- .replaceAll(':root', `.likec4-shadow-root`)
77
- .replaceAll('body {', `.likec4-shadow-root{`)
78
- .replaceAll('body{', `.likec4-shadow-root{`),
79
- )
80
- setStyleSheets([css])
81
- return () => {
82
- css.replaceSync('')
83
- }
84
- }, [inlinedStyles])
85
-
86
- return styleSheets
87
- }
88
-
89
- const getComputedColorScheme = (): ColorScheme | null => {
90
- try {
91
- const htmlScheme = window.getComputedStyle(document.documentElement).colorScheme ?? ''
92
- const colorScheme = first(htmlScheme.split(' '))
93
- if (colorScheme === 'light' || colorScheme === 'dark') {
94
- return colorScheme
95
- }
96
- } catch (_e) {
97
- // noop
98
- }
99
- return null
100
- }
101
-
102
- export type ColorScheme = 'light' | 'dark'
103
- export function useColorScheme(explicit?: ColorScheme): ColorScheme {
104
- const preferred = usePreferredColorScheme()
105
- const [computed, setComputed] = useState(getComputedColorScheme)
106
- useMutationObserver(
107
- useDebouncedCallback(() => setComputed(getComputedColorScheme), 100),
108
- {
109
- attributes: true,
110
- childList: false,
111
- subtree: false,
112
- },
113
- () => document.documentElement,
114
- )
115
-
116
- return explicit ?? computed ?? preferred
117
- }
118
-
119
- export function useShadowRootStyle(
120
- keepAspectRatio: boolean,
121
- view: DiagramView,
122
- ): [{ 'data-likec4-instance': string }, style: string] {
123
- const id = useId()
124
-
125
- if (keepAspectRatio === false) {
126
- return [
127
- { 'data-likec4-instance': id },
128
- `
129
- :where([data-likec4-instance="${id}"]) {
130
- display: block;
131
- box-sizing: border-box;
132
- border: 0 solid transparent;
133
- background: transparent;
134
- padding: 0;
135
- margin: 0;
136
- overflow: hidden;
137
- width: 100%;
138
- height: 100%;
139
- min-width: 80px;
140
- min-height: 80px;
141
- }
142
- `.trim(),
143
- ]
144
- }
145
-
146
- const isLandscape = view.bounds.width > view.bounds.height
147
-
148
- return [
149
- { 'data-likec4-instance': id },
150
- `
151
- :where([data-likec4-instance="${id}"]) {
152
- display: block;
153
- box-sizing: border-box;
154
- border: 0 solid transparent;
155
- background: transparent;
156
- padding: 0;
157
- overflow: hidden;
158
- aspect-ratio: ${Math.ceil(view.bounds.width)} / ${Math.ceil(view.bounds.height)};
159
- ${
160
- isLandscape ? '' : `
161
- max-width: min(100%, var(--likec4-view-max-width, ${Math.ceil(view.bounds.width)}px));
162
- margin-left: auto;
163
- margin-right: auto;`
164
- }
165
- width: ${isLandscape ? '100%' : 'auto'};
166
- height: ${isLandscape ? 'auto' : '100%'};
167
- ${isLandscape ? `min-width: 80px;` : `min-height: 80px;`}
168
- max-height: min(100%, var(--likec4-view-max-height, ${Math.ceil(view.bounds.height)}px));
169
- }
170
- `.trim(),
171
- ]
172
- }
@@ -1,45 +0,0 @@
1
- import { Box } from '@likec4/styles/jsx'
2
- import { Button, Code, Group, Notification, ScrollAreaAutosize } from '@mantine/core'
3
- import { IconX } from '@tabler/icons-react'
4
- import {
5
- type ErrorBoundaryProps,
6
- type FallbackProps,
7
- ErrorBoundary as ErrorBoundaryComponent,
8
- } from 'react-error-boundary'
9
-
10
- export function ErrorFallback({ error, resetErrorBoundary }: FallbackProps) {
11
- const errorString = error instanceof Error ? error.message : 'Unknown error'
12
- return (
13
- <Box pos={'fixed'} top={'0'} left={'0'} w={'100%'} p={'0'} style={{ zIndex: 1000 }}>
14
- <Notification
15
- icon={<IconX style={{ width: 16, height: 16 }} />}
16
- styles={{
17
- icon: {
18
- alignSelf: 'flex-start',
19
- },
20
- }}
21
- color={'red'}
22
- title={'Oops, something went wrong'}
23
- p={'xl'}
24
- withCloseButton={false}>
25
- <ScrollAreaAutosize maw={'100%'} mah={400}>
26
- <Code block>{errorString}</Code>
27
- </ScrollAreaAutosize>
28
- <Group gap={'xs'} mt="xl">
29
- <Button color="gray" size="xs" variant="light" onClick={() => resetErrorBoundary()}>Reset</Button>
30
- </Group>
31
- </Notification>
32
- </Box>
33
- )
34
- }
35
-
36
- export function ErrorBoundary(props: Pick<ErrorBoundaryProps, 'onReset' | 'onError' | 'children'>) {
37
- return (
38
- <ErrorBoundaryComponent
39
- FallbackComponent={ErrorFallback}
40
- onError={(err, info) => {
41
- console.error(err, info)
42
- }}
43
- {...props} />
44
- )
45
- }
@@ -1,16 +0,0 @@
1
- import type { SVGProps } from 'react'
2
- import { forwardRef } from 'react'
3
-
4
- export const GithubIcon = forwardRef<SVGSVGElement, SVGProps<SVGSVGElement>>((props, ref) => (
5
- <svg
6
- height="24"
7
- width="24"
8
- fill="currentColor"
9
- {...props}
10
- viewBox="0 0 24 24"
11
- ref={ref}
12
- >
13
- <path d="M12 1C5.923 1 1 5.923 1 12c0 4.867 3.149 8.979 7.521 10.436.55.096.756-.233.756-.522 0-.262-.013-1.128-.013-2.049-2.764.509-3.479-.674-3.699-1.292-.124-.317-.66-1.293-1.127-1.554-.385-.207-.936-.715-.014-.729.866-.014 1.485.797 1.691 1.128.99 1.663 2.571 1.196 3.204.907.096-.715.385-1.196.701-1.471-2.448-.275-5.005-1.224-5.005-5.432 0-1.196.426-2.186 1.128-2.956-.111-.275-.496-1.402.11-2.915 0 0 .921-.288 3.024 1.128a10.193 10.193 0 0 1 2.75-.371c.936 0 1.871.123 2.75.371 2.104-1.43 3.025-1.128 3.025-1.128.605 1.513.221 2.64.111 2.915.701.77 1.127 1.747 1.127 2.956 0 4.222-2.571 5.157-5.019 5.432.399.344.743 1.004.743 2.035 0 1.471-.014 2.654-.014 3.025 0 .289.206.632.756.522C19.851 20.979 23 16.854 23 12c0-6.077-4.922-11-11-11Z">
14
- </path>
15
- </svg>
16
- ))