@api-client/ui 0.2.2 → 0.2.4

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 (371) hide show
  1. package/.vscode/settings.json +3 -3
  2. package/build/src/elements/authorization/ui/ApiKeyAuthorization.d.ts +1 -1
  3. package/build/src/elements/authorization/ui/ApiKeyAuthorization.d.ts.map +1 -1
  4. package/build/src/elements/authorization/ui/ApiKeyAuthorization.js +7 -7
  5. package/build/src/elements/authorization/ui/ApiKeyAuthorization.js.map +1 -1
  6. package/build/src/elements/authorization/ui/Authorization.styles.js +4 -4
  7. package/build/src/elements/authorization/ui/Authorization.styles.js.map +1 -1
  8. package/build/src/elements/authorization/ui/BasicAuthorization.d.ts +1 -1
  9. package/build/src/elements/authorization/ui/BasicAuthorization.d.ts.map +1 -1
  10. package/build/src/elements/authorization/ui/BasicAuthorization.js +5 -5
  11. package/build/src/elements/authorization/ui/BasicAuthorization.js.map +1 -1
  12. package/build/src/elements/authorization/ui/BearerAuthorization.d.ts +1 -1
  13. package/build/src/elements/authorization/ui/BearerAuthorization.d.ts.map +1 -1
  14. package/build/src/elements/authorization/ui/BearerAuthorization.js +3 -3
  15. package/build/src/elements/authorization/ui/BearerAuthorization.js.map +1 -1
  16. package/build/src/elements/authorization/ui/NtlmAuthorization.d.ts +1 -1
  17. package/build/src/elements/authorization/ui/NtlmAuthorization.d.ts.map +1 -1
  18. package/build/src/elements/authorization/ui/NtlmAuthorization.js +7 -7
  19. package/build/src/elements/authorization/ui/NtlmAuthorization.js.map +1 -1
  20. package/build/src/elements/authorization/ui/OAuth2Authorization.d.ts +1 -1
  21. package/build/src/elements/authorization/ui/OAuth2Authorization.d.ts.map +1 -1
  22. package/build/src/elements/authorization/ui/OAuth2Authorization.js +32 -27
  23. package/build/src/elements/authorization/ui/OAuth2Authorization.js.map +1 -1
  24. package/build/src/elements/authorization/ui/OidcAuthorization.js +4 -4
  25. package/build/src/elements/authorization/ui/OidcAuthorization.js.map +1 -1
  26. package/build/src/elements/autocomplete/autocomplete-input.d.ts +10 -0
  27. package/build/src/elements/autocomplete/autocomplete-input.d.ts.map +1 -0
  28. package/build/src/{md/text-field/ui-text-field.js → elements/autocomplete/autocomplete-input.js} +9 -9
  29. package/build/src/elements/autocomplete/autocomplete-input.js.map +1 -0
  30. package/build/src/elements/autocomplete/internals/autocomplete.d.ts +209 -0
  31. package/build/src/elements/autocomplete/internals/autocomplete.d.ts.map +1 -0
  32. package/build/src/elements/autocomplete/internals/autocomplete.js +493 -0
  33. package/build/src/elements/autocomplete/internals/autocomplete.js.map +1 -0
  34. package/build/src/elements/autocomplete/internals/autocomplete.styles.d.ts +3 -0
  35. package/build/src/elements/autocomplete/internals/autocomplete.styles.d.ts.map +1 -0
  36. package/build/src/elements/autocomplete/internals/autocomplete.styles.js +25 -0
  37. package/build/src/elements/autocomplete/internals/autocomplete.styles.js.map +1 -0
  38. package/build/src/elements/dialog/internals/DeleteCookieAction.element.d.ts +1 -1
  39. package/build/src/elements/dialog/internals/DeleteCookieAction.element.d.ts.map +1 -1
  40. package/build/src/elements/dialog/internals/DeleteCookieAction.element.js +5 -5
  41. package/build/src/elements/dialog/internals/DeleteCookieAction.element.js.map +1 -1
  42. package/build/src/elements/dialog/internals/Rename.d.ts +1 -1
  43. package/build/src/elements/dialog/internals/Rename.d.ts.map +1 -1
  44. package/build/src/elements/dialog/internals/Rename.js +3 -3
  45. package/build/src/elements/dialog/internals/Rename.js.map +1 -1
  46. package/build/src/elements/dialog/internals/SetCookieAction.element.d.ts +1 -1
  47. package/build/src/elements/dialog/internals/SetCookieAction.element.d.ts.map +1 -1
  48. package/build/src/elements/dialog/internals/SetCookieAction.element.js +9 -9
  49. package/build/src/elements/dialog/internals/SetCookieAction.element.js.map +1 -1
  50. package/build/src/elements/environment/EnvironmentEditor.d.ts +1 -1
  51. package/build/src/elements/environment/EnvironmentEditor.d.ts.map +1 -1
  52. package/build/src/elements/environment/EnvironmentEditor.js +3 -3
  53. package/build/src/elements/environment/EnvironmentEditor.js.map +1 -1
  54. package/build/src/elements/environment/EnvironmentEditor.styles.js +1 -1
  55. package/build/src/elements/environment/EnvironmentEditor.styles.js.map +1 -1
  56. package/build/src/elements/environment/ServerEditor.d.ts +1 -1
  57. package/build/src/elements/environment/ServerEditor.d.ts.map +1 -1
  58. package/build/src/elements/environment/ServerEditor.js +7 -7
  59. package/build/src/elements/environment/ServerEditor.js.map +1 -1
  60. package/build/src/elements/environment/ServerEditor.styles.js +1 -1
  61. package/build/src/elements/environment/ServerEditor.styles.js.map +1 -1
  62. package/build/src/elements/http/BodyMultipartEditor.d.ts.map +1 -1
  63. package/build/src/elements/http/BodyMultipartEditor.js +4 -0
  64. package/build/src/elements/http/BodyMultipartEditor.js.map +1 -1
  65. package/build/src/elements/http/CertificateAdd.element.d.ts +1 -1
  66. package/build/src/elements/http/CertificateAdd.element.d.ts.map +1 -1
  67. package/build/src/elements/http/CertificateAdd.element.js +8 -8
  68. package/build/src/elements/http/CertificateAdd.element.js.map +1 -1
  69. package/build/src/elements/http/CertificateAdd.styles.js +1 -1
  70. package/build/src/elements/http/CertificateAdd.styles.js.map +1 -1
  71. package/build/src/elements/http/HttpAssertions.element.js +3 -3
  72. package/build/src/elements/http/HttpAssertions.element.js.map +1 -1
  73. package/build/src/elements/http/HttpFlows.element.js +3 -3
  74. package/build/src/elements/http/HttpFlows.element.js.map +1 -1
  75. package/build/src/elements/http/HttpFlowsUi.d.ts +1 -1
  76. package/build/src/elements/http/HttpFlowsUi.d.ts.map +1 -1
  77. package/build/src/elements/http/HttpFlowsUi.js +31 -31
  78. package/build/src/elements/http/HttpFlowsUi.js.map +1 -1
  79. package/build/src/elements/http/RequestConfigElement.d.ts +1 -1
  80. package/build/src/elements/http/RequestConfigElement.d.ts.map +1 -1
  81. package/build/src/elements/http/RequestConfigElement.js +7 -7
  82. package/build/src/elements/http/RequestConfigElement.js.map +1 -1
  83. package/build/src/elements/http/UrlParamsForm.d.ts +1 -1
  84. package/build/src/elements/http/UrlParamsForm.d.ts.map +1 -1
  85. package/build/src/elements/http/UrlParamsForm.js +1 -1
  86. package/build/src/elements/http/UrlParamsForm.js.map +1 -1
  87. package/build/src/elements/project/ProjectRunner.d.ts +1 -1
  88. package/build/src/elements/project/ProjectRunner.d.ts.map +1 -1
  89. package/build/src/elements/project/ProjectRunner.js +5 -5
  90. package/build/src/elements/project/ProjectRunner.js.map +1 -1
  91. package/build/src/md/input/Input.d.ts +0 -15
  92. package/build/src/md/input/Input.d.ts.map +1 -1
  93. package/build/src/md/input/Input.js +7 -42
  94. package/build/src/md/input/Input.js.map +1 -1
  95. package/build/src/md/list/internals/List.d.ts +7 -2
  96. package/build/src/md/list/internals/List.d.ts.map +1 -1
  97. package/build/src/md/list/internals/List.js +6 -0
  98. package/build/src/md/list/internals/List.js.map +1 -1
  99. package/build/src/md/list/internals/ListItem.styles.d.ts.map +1 -1
  100. package/build/src/md/list/internals/ListItem.styles.js +8 -0
  101. package/build/src/md/list/internals/ListItem.styles.js.map +1 -1
  102. package/build/src/md/listbox/internals/Listbox.d.ts +2 -2
  103. package/build/src/md/listbox/internals/Listbox.d.ts.map +1 -1
  104. package/build/src/md/listbox/internals/Listbox.js.map +1 -1
  105. package/build/src/md/text-area/internals/TextAreaElement.d.ts.map +1 -1
  106. package/build/src/md/text-area/internals/TextAreaElement.js +0 -5
  107. package/build/src/md/text-area/internals/TextAreaElement.js.map +1 -1
  108. package/build/src/md/text-area/ui-text-area.d.ts.map +1 -1
  109. package/build/src/md/text-area/ui-text-area.js +3 -2
  110. package/build/src/md/text-area/ui-text-area.js.map +1 -1
  111. package/build/src/md/text-field/internals/{TextFieldElement.d.ts → TextField.d.ts} +2 -2
  112. package/build/src/md/text-field/internals/TextField.d.ts.map +1 -0
  113. package/build/src/md/text-field/internals/{TextFieldElement.js → TextField.js} +2 -5
  114. package/build/src/md/text-field/internals/TextField.js.map +1 -0
  115. package/build/src/{visualization/elements/WorkspaceStyles.d.ts → md/text-field/internals/common.styles.d.ts} +1 -1
  116. package/build/src/md/text-field/internals/common.styles.d.ts.map +1 -0
  117. package/build/src/md/text-field/internals/{TextField.styles.js → common.styles.js} +8 -94
  118. package/build/src/md/text-field/internals/common.styles.js.map +1 -0
  119. package/build/src/md/text-field/internals/{TextField.styles.d.ts → filled.styles.d.ts} +1 -1
  120. package/build/src/md/text-field/internals/filled.styles.d.ts.map +1 -0
  121. package/build/src/md/text-field/internals/filled.styles.js +107 -0
  122. package/build/src/md/text-field/internals/filled.styles.js.map +1 -0
  123. package/build/src/md/text-field/internals/outlined.styles.d.ts +3 -0
  124. package/build/src/md/text-field/internals/outlined.styles.d.ts.map +1 -0
  125. package/build/src/md/text-field/internals/outlined.styles.js +43 -0
  126. package/build/src/md/text-field/internals/outlined.styles.js.map +1 -0
  127. package/build/src/md/text-field/ui-filled-text-field.d.ts +11 -0
  128. package/build/src/md/text-field/ui-filled-text-field.d.ts.map +1 -0
  129. package/build/src/md/text-field/ui-filled-text-field.js +28 -0
  130. package/build/src/md/text-field/ui-filled-text-field.js.map +1 -0
  131. package/build/src/md/text-field/ui-outlined-text-field.d.ts +11 -0
  132. package/build/src/md/text-field/ui-outlined-text-field.d.ts.map +1 -0
  133. package/build/src/md/text-field/ui-outlined-text-field.js +28 -0
  134. package/build/src/md/text-field/ui-outlined-text-field.js.map +1 -0
  135. package/build/src/types/input.d.ts +1 -1
  136. package/build/src/types/input.d.ts.map +1 -1
  137. package/build/src/types/input.js.map +1 -1
  138. package/demo/elements/authorization/oauth-authorize.html +4 -4
  139. package/demo/elements/authorization/oauth-authorize.ts +1 -1
  140. package/demo/elements/autocomplete/index.html +24 -0
  141. package/demo/elements/autocomplete/index.ts +123 -0
  142. package/demo/elements/http/body-editor.ts +3 -3
  143. package/demo/elements/index.html +15 -11
  144. package/demo/md/index.html +1 -1
  145. package/demo/md/inputs/input.html +10 -15
  146. package/demo/md/inputs/input.ts +389 -101
  147. package/demo/page.css +4 -0
  148. package/package.json +7 -2
  149. package/src/elements/authorization/ui/ApiKeyAuthorization.ts +7 -7
  150. package/src/elements/authorization/ui/Authorization.styles.ts +4 -4
  151. package/src/elements/authorization/ui/BasicAuthorization.ts +5 -5
  152. package/src/elements/authorization/ui/BearerAuthorization.ts +3 -3
  153. package/src/elements/authorization/ui/NtlmAuthorization.ts +7 -7
  154. package/src/elements/authorization/ui/OAuth2Authorization.ts +32 -27
  155. package/src/elements/authorization/ui/OidcAuthorization.ts +4 -4
  156. package/src/elements/autocomplete/autocomplete-input.ts +14 -0
  157. package/src/elements/autocomplete/internals/autocomplete.styles.ts +25 -0
  158. package/src/elements/autocomplete/internals/autocomplete.ts +490 -0
  159. package/src/elements/dialog/internals/DeleteCookieAction.element.ts +5 -5
  160. package/src/elements/dialog/internals/Rename.ts +3 -3
  161. package/src/elements/dialog/internals/SetCookieAction.element.ts +9 -9
  162. package/src/elements/environment/EnvironmentEditor.styles.ts +1 -1
  163. package/src/elements/environment/EnvironmentEditor.ts +3 -3
  164. package/src/elements/environment/ServerEditor.styles.ts +1 -1
  165. package/src/elements/environment/ServerEditor.ts +7 -7
  166. package/src/elements/http/BodyMultipartEditor.ts +4 -0
  167. package/src/elements/http/CertificateAdd.element.ts +8 -8
  168. package/src/elements/http/CertificateAdd.styles.ts +1 -1
  169. package/src/elements/http/HttpAssertions.element.ts +3 -3
  170. package/src/elements/http/HttpFlows.element.ts +3 -3
  171. package/src/elements/http/HttpFlowsUi.ts +31 -31
  172. package/src/elements/http/RequestConfigElement.ts +7 -7
  173. package/src/elements/http/UrlParamsForm.ts +1 -1
  174. package/src/elements/project/ProjectRunner.ts +5 -5
  175. package/src/md/input/Input.ts +6 -21
  176. package/src/md/list/internals/List.ts +14 -2
  177. package/src/md/list/internals/ListItem.styles.ts +8 -0
  178. package/src/md/listbox/internals/Listbox.ts +2 -2
  179. package/src/md/text-area/internals/TextAreaElement.ts +0 -5
  180. package/src/md/text-area/ui-text-area.ts +3 -2
  181. package/src/md/text-field/internals/{TextFieldElement.ts → TextField.ts} +1 -4
  182. package/src/md/text-field/internals/{TextField.styles.ts → common.styles.ts} +7 -93
  183. package/src/md/text-field/internals/filled.styles.ts +107 -0
  184. package/src/md/text-field/internals/outlined.styles.ts +43 -0
  185. package/src/md/text-field/ui-filled-text-field.ts +16 -0
  186. package/src/md/text-field/ui-outlined-text-field.ts +16 -0
  187. package/src/types/input.ts +0 -1
  188. package/test/elements/authorization/basic-method.test.ts +3 -3
  189. package/test/elements/authorization/bearer-method.test.ts +2 -2
  190. package/test/elements/authorization/ntlm-method.test.ts +4 -4
  191. package/test/elements/autocomplete/autocomplete-input.spec.ts +448 -0
  192. package/test/elements/http/BodyMultipartEditorElement.test.ts +15 -16
  193. package/test/elements/http/CertificateAdd.test.ts +11 -11
  194. package/test/elements/http/HttpAssertions.test.ts +9 -9
  195. package/test/elements/http/HttpFlows.test.ts +4 -4
  196. package/test/env.ts +15 -0
  197. package/test/tsconfig.json +1 -7
  198. package/web-test-runner.config.js +5 -1
  199. package/build/src/md/text-field/internals/TextField.styles.d.ts.map +0 -1
  200. package/build/src/md/text-field/internals/TextField.styles.js.map +0 -1
  201. package/build/src/md/text-field/internals/TextFieldElement.d.ts.map +0 -1
  202. package/build/src/md/text-field/internals/TextFieldElement.js.map +0 -1
  203. package/build/src/md/text-field/ui-text-field.d.ts +0 -11
  204. package/build/src/md/text-field/ui-text-field.d.ts.map +0 -1
  205. package/build/src/md/text-field/ui-text-field.js.map +0 -1
  206. package/build/src/visualization/elements/VizAssociationElement.d.ts +0 -4
  207. package/build/src/visualization/elements/VizAssociationElement.d.ts.map +0 -1
  208. package/build/src/visualization/elements/VizAssociationElement.js +0 -4
  209. package/build/src/visualization/elements/VizAssociationElement.js.map +0 -1
  210. package/build/src/visualization/elements/VizWorkspaceElement.d.ts +0 -110
  211. package/build/src/visualization/elements/VizWorkspaceElement.d.ts.map +0 -1
  212. package/build/src/visualization/elements/VizWorkspaceElement.js +0 -321
  213. package/build/src/visualization/elements/VizWorkspaceElement.js.map +0 -1
  214. package/build/src/visualization/elements/WorkspaceStyles.d.ts.map +0 -1
  215. package/build/src/visualization/elements/WorkspaceStyles.js +0 -168
  216. package/build/src/visualization/elements/WorkspaceStyles.js.map +0 -1
  217. package/build/src/visualization/lib/AnchorFinder.d.ts +0 -64
  218. package/build/src/visualization/lib/AnchorFinder.d.ts.map +0 -1
  219. package/build/src/visualization/lib/AnchorFinder.js +0 -107
  220. package/build/src/visualization/lib/AnchorFinder.js.map +0 -1
  221. package/build/src/visualization/lib/AnchorUtils.d.ts +0 -10
  222. package/build/src/visualization/lib/AnchorUtils.d.ts.map +0 -1
  223. package/build/src/visualization/lib/AnchorUtils.js +0 -44
  224. package/build/src/visualization/lib/AnchorUtils.js.map +0 -1
  225. package/build/src/visualization/lib/AssociationAnchors.d.ts +0 -134
  226. package/build/src/visualization/lib/AssociationAnchors.d.ts.map +0 -1
  227. package/build/src/visualization/lib/AssociationAnchors.js +0 -351
  228. package/build/src/visualization/lib/AssociationAnchors.js.map +0 -1
  229. package/build/src/visualization/lib/LabelSketch.d.ts +0 -16
  230. package/build/src/visualization/lib/LabelSketch.d.ts.map +0 -1
  231. package/build/src/visualization/lib/LabelSketch.js +0 -53
  232. package/build/src/visualization/lib/LabelSketch.js.map +0 -1
  233. package/build/src/visualization/lib/LineSketch.d.ts +0 -26
  234. package/build/src/visualization/lib/LineSketch.d.ts.map +0 -1
  235. package/build/src/visualization/lib/LineSketch.js +0 -55
  236. package/build/src/visualization/lib/LineSketch.js.map +0 -1
  237. package/build/src/visualization/lib/Point.d.ts +0 -74
  238. package/build/src/visualization/lib/Point.d.ts.map +0 -1
  239. package/build/src/visualization/lib/Point.js +0 -121
  240. package/build/src/visualization/lib/Point.js.map +0 -1
  241. package/build/src/visualization/lib/PositionUtils.d.ts +0 -65
  242. package/build/src/visualization/lib/PositionUtils.d.ts.map +0 -1
  243. package/build/src/visualization/lib/PositionUtils.js +0 -205
  244. package/build/src/visualization/lib/PositionUtils.js.map +0 -1
  245. package/build/src/visualization/lib/SelectionManager.d.ts +0 -183
  246. package/build/src/visualization/lib/SelectionManager.d.ts.map +0 -1
  247. package/build/src/visualization/lib/SelectionManager.js +0 -481
  248. package/build/src/visualization/lib/SelectionManager.js.map +0 -1
  249. package/build/src/visualization/lib/ShapeArtist.d.ts +0 -45
  250. package/build/src/visualization/lib/ShapeArtist.d.ts.map +0 -1
  251. package/build/src/visualization/lib/ShapeArtist.js +0 -209
  252. package/build/src/visualization/lib/ShapeArtist.js.map +0 -1
  253. package/build/src/visualization/lib/SvgMarkers.d.ts +0 -14
  254. package/build/src/visualization/lib/SvgMarkers.d.ts.map +0 -1
  255. package/build/src/visualization/lib/SvgMarkers.js +0 -77
  256. package/build/src/visualization/lib/SvgMarkers.js.map +0 -1
  257. package/build/src/visualization/lib/TipSketch.d.ts +0 -26
  258. package/build/src/visualization/lib/TipSketch.d.ts.map +0 -1
  259. package/build/src/visualization/lib/TipSketch.js +0 -77
  260. package/build/src/visualization/lib/TipSketch.js.map +0 -1
  261. package/build/src/visualization/lib/TouchSupport.d.ts +0 -14
  262. package/build/src/visualization/lib/TouchSupport.d.ts.map +0 -1
  263. package/build/src/visualization/lib/TouchSupport.js +0 -55
  264. package/build/src/visualization/lib/TouchSupport.js.map +0 -1
  265. package/build/src/visualization/lib/Utils.d.ts +0 -25
  266. package/build/src/visualization/lib/Utils.d.ts.map +0 -1
  267. package/build/src/visualization/lib/Utils.js +0 -59
  268. package/build/src/visualization/lib/Utils.js.map +0 -1
  269. package/build/src/visualization/lib/VisualizationTypes.d.ts +0 -216
  270. package/build/src/visualization/lib/VisualizationTypes.d.ts.map +0 -1
  271. package/build/src/visualization/lib/VisualizationTypes.js +0 -3
  272. package/build/src/visualization/lib/VisualizationTypes.js.map +0 -1
  273. package/build/src/visualization/lib/WorkspaceAlignment.d.ts +0 -51
  274. package/build/src/visualization/lib/WorkspaceAlignment.d.ts.map +0 -1
  275. package/build/src/visualization/lib/WorkspaceAlignment.js +0 -243
  276. package/build/src/visualization/lib/WorkspaceAlignment.js.map +0 -1
  277. package/build/src/visualization/lib/WorkspaceDebugging.d.ts +0 -104
  278. package/build/src/visualization/lib/WorkspaceDebugging.d.ts.map +0 -1
  279. package/build/src/visualization/lib/WorkspaceDebugging.js +0 -286
  280. package/build/src/visualization/lib/WorkspaceDebugging.js.map +0 -1
  281. package/build/src/visualization/lib/WorkspaceEdges.d.ts +0 -293
  282. package/build/src/visualization/lib/WorkspaceEdges.d.ts.map +0 -1
  283. package/build/src/visualization/lib/WorkspaceEdges.js +0 -1073
  284. package/build/src/visualization/lib/WorkspaceEdges.js.map +0 -1
  285. package/build/src/visualization/lib/WorkspaceGestures.d.ts +0 -119
  286. package/build/src/visualization/lib/WorkspaceGestures.d.ts.map +0 -1
  287. package/build/src/visualization/lib/WorkspaceGestures.js +0 -376
  288. package/build/src/visualization/lib/WorkspaceGestures.js.map +0 -1
  289. package/build/src/visualization/lib/WorkspaceSizing.d.ts +0 -66
  290. package/build/src/visualization/lib/WorkspaceSizing.d.ts.map +0 -1
  291. package/build/src/visualization/lib/WorkspaceSizing.js +0 -168
  292. package/build/src/visualization/lib/WorkspaceSizing.js.map +0 -1
  293. package/build/src/visualization/lib/lines/RectilinearLine.d.ts +0 -114
  294. package/build/src/visualization/lib/lines/RectilinearLine.d.ts.map +0 -1
  295. package/build/src/visualization/lib/lines/RectilinearLine.js +0 -605
  296. package/build/src/visualization/lib/lines/RectilinearLine.js.map +0 -1
  297. package/build/src/visualization/lib/tips/RectilinearTip.d.ts +0 -26
  298. package/build/src/visualization/lib/tips/RectilinearTip.d.ts.map +0 -1
  299. package/build/src/visualization/lib/tips/RectilinearTip.js +0 -149
  300. package/build/src/visualization/lib/tips/RectilinearTip.js.map +0 -1
  301. package/build/src/visualization/lib/tips/TipArtist.d.ts +0 -22
  302. package/build/src/visualization/lib/tips/TipArtist.d.ts.map +0 -1
  303. package/build/src/visualization/lib/tips/TipArtist.js +0 -31
  304. package/build/src/visualization/lib/tips/TipArtist.js.map +0 -1
  305. package/build/src/visualization/lib/types.d.ts +0 -164
  306. package/build/src/visualization/lib/types.d.ts.map +0 -1
  307. package/build/src/visualization/lib/types.js +0 -2
  308. package/build/src/visualization/lib/types.js.map +0 -1
  309. package/build/src/visualization/plugin/dnd/DragAndDropPlugin.d.ts +0 -126
  310. package/build/src/visualization/plugin/dnd/DragAndDropPlugin.d.ts.map +0 -1
  311. package/build/src/visualization/plugin/dnd/DragAndDropPlugin.js +0 -260
  312. package/build/src/visualization/plugin/dnd/DragAndDropPlugin.js.map +0 -1
  313. package/build/src/visualization/plugin/group-selection/GroupSelection.d.ts +0 -93
  314. package/build/src/visualization/plugin/group-selection/GroupSelection.d.ts.map +0 -1
  315. package/build/src/visualization/plugin/group-selection/GroupSelection.js +0 -250
  316. package/build/src/visualization/plugin/group-selection/GroupSelection.js.map +0 -1
  317. package/build/src/visualization/plugin/positioning/DataModelLayout.d.ts +0 -10
  318. package/build/src/visualization/plugin/positioning/DataModelLayout.d.ts.map +0 -1
  319. package/build/src/visualization/plugin/positioning/DataModelLayout.js +0 -105
  320. package/build/src/visualization/plugin/positioning/DataModelLayout.js.map +0 -1
  321. package/build/src/visualization/plugin/positioning/WorkspaceLayout.d.ts +0 -93
  322. package/build/src/visualization/plugin/positioning/WorkspaceLayout.d.ts.map +0 -1
  323. package/build/src/visualization/plugin/positioning/WorkspaceLayout.js +0 -96
  324. package/build/src/visualization/plugin/positioning/WorkspaceLayout.js.map +0 -1
  325. package/build/src/visualization/viz-association.d.ts +0 -7
  326. package/build/src/visualization/viz-association.d.ts.map +0 -1
  327. package/build/src/visualization/viz-association.js +0 -3
  328. package/build/src/visualization/viz-association.js.map +0 -1
  329. package/build/src/visualization/viz-workspace.d.ts +0 -7
  330. package/build/src/visualization/viz-workspace.d.ts.map +0 -1
  331. package/build/src/visualization/viz-workspace.js +0 -3
  332. package/build/src/visualization/viz-workspace.js.map +0 -1
  333. package/src/md/text-field/ui-text-field.ts +0 -15
  334. package/src/visualization/elements/VizAssociationElement.ts +0 -3
  335. package/src/visualization/elements/VizWorkspaceElement.ts +0 -302
  336. package/src/visualization/elements/WorkspaceStyles.ts +0 -168
  337. package/src/visualization/lib/AnchorFinder.ts +0 -112
  338. package/src/visualization/lib/AnchorUtils.ts +0 -53
  339. package/src/visualization/lib/AssociationAnchors.ts +0 -418
  340. package/src/visualization/lib/LabelSketch.ts +0 -67
  341. package/src/visualization/lib/LineSketch.ts +0 -62
  342. package/src/visualization/lib/Point.ts +0 -134
  343. package/src/visualization/lib/PositionUtils.ts +0 -218
  344. package/src/visualization/lib/SelectionManager.ts +0 -513
  345. package/src/visualization/lib/ShapeArtist.ts +0 -222
  346. package/src/visualization/lib/SvgMarkers.ts +0 -80
  347. package/src/visualization/lib/TipSketch.ts +0 -91
  348. package/src/visualization/lib/TouchSupport.ts +0 -72
  349. package/src/visualization/lib/Utils.ts +0 -63
  350. package/src/visualization/lib/VisualizationTypes.ts +0 -232
  351. package/src/visualization/lib/WorkspaceAlignment.ts +0 -261
  352. package/src/visualization/lib/WorkspaceDebugging.ts +0 -313
  353. package/src/visualization/lib/WorkspaceEdges.ts +0 -1153
  354. package/src/visualization/lib/WorkspaceGestures.ts +0 -400
  355. package/src/visualization/lib/WorkspaceSizing.ts +0 -181
  356. package/src/visualization/lib/lines/RectilinearLine.ts +0 -589
  357. package/src/visualization/lib/tips/RectilinearTip.ts +0 -156
  358. package/src/visualization/lib/tips/TipArtist.ts +0 -34
  359. package/src/visualization/lib/types.ts +0 -173
  360. package/src/visualization/plugin/dnd/DragAndDropPlugin.ts +0 -294
  361. package/src/visualization/plugin/group-selection/GroupSelection.ts +0 -271
  362. package/src/visualization/plugin/positioning/DataModelLayout.ts +0 -114
  363. package/src/visualization/plugin/positioning/WorkspaceLayout.ts +0 -149
  364. package/src/visualization/viz-association.ts +0 -9
  365. package/src/visualization/viz-workspace.ts +0 -9
  366. package/test/env.d.ts +0 -9
  367. package/test/env.js +0 -7
  368. package/test/visualization/lib/AnchorFinder.test.ts +0 -313
  369. package/test/visualization/lib/AnchorUtils.test.ts +0 -178
  370. package/test/visualization/lib/PositionUtils.test.ts +0 -406
  371. package/test/visualization/lib/test-styles.css +0 -80
@@ -1,107 +0,0 @@
1
- import { Point } from './Point.js';
2
- import { closetsPair } from './PositionUtils.js';
3
- export const anchorPadding = 40;
4
- /**
5
- * Creates an array of pots that can be placed on the East side of a rectangular object.
6
- *
7
- * | ------ | o
8
- * | |
9
- * | | o
10
- * | |
11
- * | ------ | o
12
- *
13
- * @param rect The object DOMRect
14
- * @param padding The padding from the top/bottom
15
- */
16
- export function readEastAnchorPoints(rect, padding) {
17
- const { right, top, bottom, height } = rect;
18
- const middle = height / 2;
19
- const p1 = new Point(right, top + padding);
20
- const p2 = new Point(right, top + middle);
21
- const p3 = new Point(right, bottom - padding);
22
- return [p1, p2, p3];
23
- }
24
- /**
25
- * Creates an array of pots that can be placed on the West side of a rectangular object.
26
- *
27
- * o | ------ |
28
- * | |
29
- * o | |
30
- * | |
31
- * o | ------ |
32
- *
33
- * @param {DOMRect} rect The object DOMRect
34
- * @param {number} padding The padding from the top/bottom
35
- * @returns {Point[]}
36
- */
37
- export function readWestAnchorPoints(rect, padding) {
38
- const { left, top, bottom, height } = rect;
39
- const middle = height / 2;
40
- const p1 = new Point(left, top + padding);
41
- const p2 = new Point(left, top + middle);
42
- const p3 = new Point(left, bottom - padding);
43
- return [p1, p2, p3];
44
- }
45
- /**
46
- * Creates an array of pots that can be placed on the North side of a rectangular object.
47
- *
48
- * o o o
49
- * | ------- |
50
- * | |
51
- * | |
52
- * | |
53
- * | ------- |
54
- *
55
- * @param rect The object DOMRect
56
- * @param padding The padding from the left/right
57
- */
58
- export function readNorthAnchorPoints(rect, padding) {
59
- const { left, top, width, right } = rect;
60
- const middle = width / 2;
61
- const p1 = new Point(left + padding, top);
62
- const p2 = new Point(left + middle, top);
63
- const p3 = new Point(right - padding, top);
64
- return [p1, p2, p3];
65
- }
66
- /**
67
- * Creates an array of pots that can be placed on the South side of a rectangular object.
68
- *
69
- * | ------- |
70
- * | |
71
- * | |
72
- * | |
73
- * | ------- |
74
- * o o o
75
- *
76
- * @param rect The object DOMRect
77
- * @param padding The padding from the left/right
78
- */
79
- export function readSouthAnchorPoints(rect, padding) {
80
- const { left, bottom, width, right } = rect;
81
- const middle = width / 2;
82
- const p1 = new Point(left + padding, bottom);
83
- const p2 = new Point(left + middle, bottom);
84
- const p3 = new Point(right - padding, bottom);
85
- return [p1, p2, p3];
86
- }
87
- /**
88
- * Finds a pair of virtual (created on the shape based on the size) anchor points.
89
- *
90
- * @param padding The padding from the left/right/top/bottom
91
- */
92
- export function findClosestAnchors(source, target, padding) {
93
- const sources = [
94
- ...readEastAnchorPoints(source, padding),
95
- ...readWestAnchorPoints(source, padding),
96
- ...readNorthAnchorPoints(source, padding),
97
- ...readSouthAnchorPoints(source, padding),
98
- ];
99
- const targets = [
100
- ...readEastAnchorPoints(target, padding),
101
- ...readWestAnchorPoints(target, padding),
102
- ...readNorthAnchorPoints(target, padding),
103
- ...readSouthAnchorPoints(target, padding),
104
- ];
105
- return closetsPair(sources, targets);
106
- }
107
- //# sourceMappingURL=AnchorFinder.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AnchorFinder.js","sourceRoot":"","sources":["../../../../src/visualization/lib/AnchorFinder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAEhD,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,CAAA;AAE/B;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAa,EAAE,OAAe;IACjE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;IAC3C,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,CAAA;IACzB,MAAM,EAAE,GAAG,IAAI,KAAK,CAAC,KAAK,E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OAAO,CAAY,CAAA;AACjD,CAAC","sourcesContent":["import { Point } from './Point.js'\nimport { closetsPair } from './PositionUtils.js'\n\nexport const anchorPadding = 40\n\n/**\n * Creates an array of pots that can be placed on the East side of a rectangular object.\n *\n * | ------ | o\n * | |\n * | | o\n * | |\n * | ------ | o\n *\n * @param rect The object DOMRect\n * @param padding The padding from the top/bottom\n */\nexport function readEastAnchorPoints(rect: DOMRect, padding: number): Point[] {\n const { right, top, bottom, height } = rect\n const middle = height / 2\n const p1 = new Point(right, top + padding)\n const p2 = new Point(right, top + middle)\n const p3 = new Point(right, bottom - padding)\n return [p1, p2, p3]\n}\n\n/**\n * Creates an array of pots that can be placed on the West side of a rectangular object.\n *\n * o | ------ |\n * | |\n * o | |\n * | |\n * o | ------ |\n *\n * @param {DOMRect} rect The object DOMRect\n * @param {number} padding The padding from the top/bottom\n * @returns {Point[]}\n */\nexport function readWestAnchorPoints(rect: DOMRect, padding: number): Point[] {\n const { left, top, bottom, height } = rect\n const middle = height / 2\n const p1 = new Point(left, top + padding)\n const p2 = new Point(left, top + middle)\n const p3 = new Point(left, bottom - padding)\n return [p1, p2, p3]\n}\n\n/**\n * Creates an array of pots that can be placed on the North side of a rectangular object.\n *\n * o o o\n * | ------- |\n * | |\n * | |\n * | |\n * | ------- |\n *\n * @param rect The object DOMRect\n * @param padding The padding from the left/right\n */\nexport function readNorthAnchorPoints(rect: DOMRect, padding: number): Point[] {\n const { left, top, width, right } = rect\n const middle = width / 2\n const p1 = new Point(left + padding, top)\n const p2 = new Point(left + middle, top)\n const p3 = new Point(right - padding, top)\n return [p1, p2, p3]\n}\n\n/**\n * Creates an array of pots that can be placed on the South side of a rectangular object.\n *\n * | ------- |\n * | |\n * | |\n * | |\n * | ------- |\n * o o o\n *\n * @param rect The object DOMRect\n * @param padding The padding from the left/right\n */\nexport function readSouthAnchorPoints(rect: DOMRect, padding: number): Point[] {\n const { left, bottom, width, right } = rect\n const middle = width / 2\n const p1 = new Point(left + padding, bottom)\n const p2 = new Point(left + middle, bottom)\n const p3 = new Point(right - padding, bottom)\n return [p1, p2, p3]\n}\n\n/**\n * Finds a pair of virtual (created on the shape based on the size) anchor points.\n *\n * @param padding The padding from the left/right/top/bottom\n */\nexport function findClosestAnchors(source: DOMRect, target: DOMRect, padding: number): Point[] {\n const sources = [\n ...readEastAnchorPoints(source, padding),\n ...readWestAnchorPoints(source, padding),\n ...readNorthAnchorPoints(source, padding),\n ...readSouthAnchorPoints(source, padding),\n ]\n const targets = [\n ...readEastAnchorPoints(target, padding),\n ...readWestAnchorPoints(target, padding),\n ...readNorthAnchorPoints(target, padding),\n ...readSouthAnchorPoints(target, padding),\n ]\n return closetsPair(sources, targets) as Point[]\n}\n"]}
@@ -1,10 +0,0 @@
1
- import VizWorkspaceElement from '../elements/VizWorkspaceElement.js';
2
- import { Point } from './Point.js';
3
- import { IWorkspaceEdge } from './types.js';
4
- /**
5
- * @param element The association anchor object
6
- * @returns The x,y position of the anchor.
7
- */
8
- export declare function anchorToPoint(element: HTMLElement, workspace: VizWorkspaceElement): Point;
9
- export declare function closestAnchors(elm1: HTMLElement, elm2: HTMLElement, workspace: VizWorkspaceElement, others?: IWorkspaceEdge[]): Point[] | null;
10
- //# sourceMappingURL=AnchorUtils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AnchorUtils.d.ts","sourceRoot":"","sources":["../../../../src/visualization/lib/AnchorUtils.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,MAAM,oCAAoC,CAAA;AACpE,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAElC,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAE3C;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,mBAAmB,GAAG,KAAK,CAiBzF;AAED,wBAAgB,cAAc,CAC5B,IAAI,EAAE,WAAW,EACjB,IAAI,EAAE,WAAW,EACjB,SAAS,EAAE,mBAAmB,EAC9B,MAAM,GAAE,cAAc,EAAO,GAC5B,KAAK,EAAE,GAAG,IAAI,CAmBhB"}
@@ -1,44 +0,0 @@
1
- import { closetsPair, getRelativeClickPoint } from './PositionUtils.js';
2
- /**
3
- * @param element The association anchor object
4
- * @returns The x,y position of the anchor.
5
- */
6
- export function anchorToPoint(element, workspace) {
7
- const box = element.getBoundingClientRect();
8
- let { x, y } = box;
9
- const { dataset } = element;
10
- if (dataset.verticalOffset) {
11
- const vo = Number(dataset.verticalOffset);
12
- if (!Number.isNaN(vo)) {
13
- y += vo;
14
- }
15
- }
16
- if (dataset.horizontalOffset) {
17
- const ho = Number(dataset.horizontalOffset);
18
- if (!Number.isNaN(ho)) {
19
- x += ho;
20
- }
21
- }
22
- return getRelativeClickPoint(x, y, workspace);
23
- }
24
- export function closestAnchors(elm1, elm2, workspace, others = []) {
25
- const dom1 = elm1.shadowRoot || elm1;
26
- const dom2 = elm2.shadowRoot || elm2;
27
- const anchors1 = Array.from(dom1.querySelectorAll('[data-association-slot]'));
28
- const anchors2 = Array.from(dom2.querySelectorAll('[data-association-slot]'));
29
- if (!anchors1.length || !anchors2.length) {
30
- return null;
31
- }
32
- const points1 = anchors1.map((item) => anchorToPoint(item, workspace));
33
- const points2 = anchors2.map((item) => anchorToPoint(item, workspace));
34
- const avoid1 = [];
35
- const avoid2 = [];
36
- others.forEach((i) => {
37
- avoid1.push(i.shape.line.startPoint);
38
- avoid2.push(i.shape.line.startPoint);
39
- avoid1.push(i.shape.line.endPoint);
40
- avoid2.push(i.shape.line.endPoint);
41
- });
42
- return closetsPair(points1, points2, avoid1, avoid2);
43
- }
44
- //# sourceMappingURL=AnchorUtils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AnchorUtils.js","sourceRoot":"","sources":["../../../../src/visualization/lib/AnchorUtils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAGvE;;;GAGG;AACH,MAAM,UAAU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AAC;QACzC,OAAO,IAAI,CAAA;IACb,CAAC;IACD,MAAM,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAA;IACtE,MAAM,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAA;IACtE,MAAM,MAAM,GAAY,EAAE,CAAA;IAC1B,MAAM,MAAM,GAAY,EAAE,CAAA;IAC1B,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;QACnB,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;QACpC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;QACpC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QAClC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IACpC,CAAC,CAAC,CAAA;IACF,OAAO,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;AACtD,CAAC","sourcesContent":["import VizWorkspaceElement from '../elements/VizWorkspaceElement.js'\nimport { Point } from './Point.js'\nimport { closetsPair, getRelativeClickPoint } from './PositionUtils.js'\nimport { IWorkspaceEdge } from './types.js'\n\n/**\n * @param element The association anchor object\n * @returns The x,y position of the anchor.\n */\nexport function anchorToPoint(element: HTMLElement, workspace: VizWorkspaceElement): Point {\n const box = element.getBoundingClientRect()\n let { x, y } = box\n const { dataset } = element\n if (dataset.verticalOffset) {\n const vo = Number(dataset.verticalOffset)\n if (!Number.isNaN(vo)) {\n y += vo\n }\n }\n if (dataset.horizontalOffset) {\n const ho = Number(dataset.horizontalOffset)\n if (!Number.isNaN(ho)) {\n x += ho\n }\n }\n return getRelativeClickPoint(x, y, workspace)\n}\n\nexport function closestAnchors(\n elm1: HTMLElement,\n elm2: HTMLElement,\n workspace: VizWorkspaceElement,\n others: IWorkspaceEdge[] = []\n): Point[] | null {\n const dom1 = elm1.shadowRoot || elm1\n const dom2 = elm2.shadowRoot || elm2\n const anchors1 = Array.from(dom1.querySelectorAll('[data-association-slot]')) as HTMLElement[]\n const anchors2 = Array.from(dom2.querySelectorAll('[data-association-slot]')) as HTMLElement[]\n if (!anchors1.length || !anchors2.length) {\n return null\n }\n const points1 = anchors1.map((item) => anchorToPoint(item, workspace))\n const points2 = anchors2.map((item) => anchorToPoint(item, workspace))\n const avoid1: Point[] = []\n const avoid2: Point[] = []\n others.forEach((i) => {\n avoid1.push(i.shape.line.startPoint)\n avoid2.push(i.shape.line.startPoint)\n avoid1.push(i.shape.line.endPoint)\n avoid2.push(i.shape.line.endPoint)\n })\n return closetsPair(points1, points2, avoid1, avoid2)\n}\n"]}
@@ -1,134 +0,0 @@
1
- import { LineSketch } from './LineSketch.js';
2
- import VizWorkspaceElement from '../elements/VizWorkspaceElement.js';
3
- import { Point } from './Point.js';
4
- export declare const connectedValue: unique symbol;
5
- export declare const mouseDownHandler: unique symbol;
6
- export declare const mouseMoveHandler: unique symbol;
7
- export declare const mouseUpHandler: unique symbol;
8
- export declare const keydownHandler: unique symbol;
9
- export interface EdgeCreateInfo {
10
- /**
11
- * The slot name of the source object.
12
- */
13
- slot: string;
14
- /**
15
- * The workspace coordinates of the staring point
16
- */
17
- point: Point;
18
- /**
19
- * The domain element that is the source of the association.
20
- */
21
- source: HTMLElement;
22
- }
23
- export interface IEdgeUpdateInfo {
24
- /**
25
- * The name of the tip that is being dragged.
26
- * It's either `start` or `end`.
27
- */
28
- direction: string;
29
- /**
30
- * The association domain id.
31
- */
32
- id: string;
33
- /**
34
- * The start point of the line
35
- */
36
- sp: Point;
37
- /**
38
- * The end point of the line
39
- */
40
- ep: Point;
41
- }
42
- /**
43
- * A helper that allows to manually draw a line from one visualization object to another.
44
- * The visualization object has to have the `data-association-slots` attribute set on the element
45
- * and the mouse event target having the `data-association-slot` attribute with the index of the slot.
46
- *
47
- * The association line can be drawn to another object that has both attributes.
48
- *
49
- * After the user finish a DOM event is dispatched from the visualization workspace.
50
- */
51
- export declare class AssociationAnchors {
52
- workspace: VizWorkspaceElement;
53
- [connectedValue]: boolean;
54
- /**
55
- * Whether a line is being constructed.
56
- */
57
- drawing: boolean;
58
- /**
59
- * A reference to the currently injected SVG element.
60
- */
61
- lineElement?: SVGElement;
62
- /**
63
- * Whether an association position is being updated.
64
- * In such case it dispatches different event at the end.
65
- */
66
- updating: boolean;
67
- /**
68
- * The processor used to draw lines
69
- */
70
- lineProcessor: LineSketch;
71
- /**
72
- * Set when a new association is being created
73
- */
74
- createInfo?: EdgeCreateInfo;
75
- /**
76
- * Set when an association update is performed
77
- */
78
- updateInfo?: IEdgeUpdateInfo;
79
- constructor(workspace: VizWorkspaceElement);
80
- /**
81
- * Starts listening for the user events
82
- */
83
- connect(): void;
84
- /**
85
- * Stops listening for the user events
86
- */
87
- disconnect(): void;
88
- findSlotParent(path: Node[]): Element;
89
- [mouseDownHandler](e: MouseEvent): void;
90
- [mouseMoveHandler](e: MouseEvent): void;
91
- [mouseUpHandler](e: MouseEvent): void;
92
- [keydownHandler](e: KeyboardEvent): void;
93
- /**
94
- * Cancels the operation.
95
- */
96
- cancel(): void;
97
- /**
98
- * Clears variables set in the `start()` function.
99
- */
100
- cleanup(): void;
101
- start(domainObject: HTMLElement, slot: string, startPoint: Point): void;
102
- /**
103
- * @param key The domain id of the association being updated
104
- * @param dir The name of the tip that is being dragged.
105
- */
106
- startUpdate(key: string, dir: string): void;
107
- end(id: string, slot: string, endPoint: Point): void;
108
- endUpdate(id: string, slot: string, endPoint: Point): void;
109
- /**
110
- * Insets a child with a line definition into the workspace's SVG element.
111
- * @param start The starting point of the line
112
- * @param end The ending point of the line
113
- */
114
- addLine(start: Point, end: Point): void;
115
- /**
116
- * Removes the previously added line from the SVG
117
- */
118
- removeLine(): void;
119
- /**
120
- * Updates the end position of the line.
121
- * @param {Point} point
122
- */
123
- updateLinePosition(point: Point): void;
124
- /**
125
- * Listens for the mouse move and mouse up events to draw the line and finish the operation.
126
- * This is only initialized when starting drawing a line.
127
- */
128
- listenDargEvents(): void;
129
- /**
130
- * Removes previously registered events.
131
- */
132
- unlistenDargEvents(): void;
133
- }
134
- //# sourceMappingURL=AssociationAnchors.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AssociationAnchors.d.ts","sourceRoot":"","sources":["../../../../src/visualization/lib/AssociationAnchors.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,mBAAmB,MAAM,oCAAoC,CAAA;AACpE,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAIlC,eAAO,MAAM,cAAc,eAA2B,CAAA;AACtD,eAAO,MAAM,gBAAgB,eAA6B,CAAA;AAC1D,eAAO,MAAM,gBAAgB,eAA6B,CAAA;AAC1D,eAAO,MAAM,cAAc,eAA2B,CAAA;AACtD,eAAO,MAAM,cAAc,eAA2B,CAAA;AAEtD,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,KAAK,EAAE,KAAK,CAAA;IACZ;;OAEG;IACH,MAAM,EAAE,WAAW,CAAA;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IACV;;OAEG;IACH,EAAE,EAAE,KAAK,CAAA;IACT;;OAEG;IACH,EAAE,EAAE,KAAK,CAAA;CACV;AAED;;;;;;;;GAQG;AACH,qBAAa,kBAAkB;IAkCV,SAAS,EAAE,mBAAmB;IA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C;;OAEG;IACH,UAAU,IAAI,IAAI;IAUlB;;;OAGG;IACH,kBAAkB,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAYtC;;;OAGG;IACH,gBAAgB,IAAI,IAAI;IAOxB;;OAEG;IACH,kBAAkB,IAAI,IAAI;CAM3B"}
@@ -1,351 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-non-null-assertion */
2
- import { getRelativeClickPoint } from './PositionUtils.js';
3
- import { anchorToPoint } from './AnchorUtils.js';
4
- import { LineSketch } from './LineSketch.js';
5
- const SvgNS = 'http://www.w3.org/2000/svg';
6
- export const connectedValue = Symbol('connectedValue');
7
- export const mouseDownHandler = Symbol('mouseDownHandler');
8
- export const mouseMoveHandler = Symbol('mouseMoveHandler');
9
- export const mouseUpHandler = Symbol('mouseUpHandler');
10
- export const keydownHandler = Symbol('keydownHandler');
11
- /**
12
- * A helper that allows to manually draw a line from one visualization object to another.
13
- * The visualization object has to have the `data-association-slots` attribute set on the element
14
- * and the mouse event target having the `data-association-slot` attribute with the index of the slot.
15
- *
16
- * The association line can be drawn to another object that has both attributes.
17
- *
18
- * After the user finish a DOM event is dispatched from the visualization workspace.
19
- */
20
- export class AssociationAnchors {
21
- workspace;
22
- [connectedValue] = false;
23
- /**
24
- * Whether a line is being constructed.
25
- */
26
- drawing = false;
27
- /**
28
- * A reference to the currently injected SVG element.
29
- */
30
- lineElement;
31
- /**
32
- * Whether an association position is being updated.
33
- * In such case it dispatches different event at the end.
34
- */
35
- updating = false;
36
- /**
37
- * The processor used to draw lines
38
- */
39
- lineProcessor = new LineSketch();
40
- /**
41
- * Set when a new association is being created
42
- */
43
- createInfo;
44
- /**
45
- * Set when an association update is performed
46
- */
47
- updateInfo;
48
- constructor(workspace) {
49
- this.workspace = workspace;
50
- this.workspace = workspace;
51
- this[mouseDownHandler] = this[mouseDownHandler].bind(this);
52
- this[mouseMoveHandler] = this[mouseMoveHandler].bind(this);
53
- this[mouseUpHandler] = this[mouseUpHandler].bind(this);
54
- this[keydownHandler] = this[keydownHandler].bind(this);
55
- }
56
- /**
57
- * Starts listening for the user events
58
- */
59
- connect() {
60
- if (this[connectedValue]) {
61
- return;
62
- }
63
- this[connectedValue] = true;
64
- const { workspace } = this;
65
- // const { canvas } = workspace;
66
- workspace.addEventListener('mousedown', this[mouseDownHandler], true);
67
- }
68
- /**
69
- * Stops listening for the user events
70
- */
71
- disconnect() {
72
- this[connectedValue] = false;
73
- const { workspace } = this;
74
- // const { canvas } = workspace;
75
- workspace.removeEventListener('mousedown', this[mouseDownHandler], true);
76
- }
77
- findSlotParent(path) {
78
- const element = path.find((node) => {
79
- if (node.nodeType !== Node.ELEMENT_NODE) {
80
- return false;
81
- }
82
- const typed = node;
83
- return typed.hasAttribute('data-association-slots');
84
- });
85
- return element;
86
- }
87
- [mouseDownHandler](e) {
88
- if (e.button !== 0) {
89
- return;
90
- }
91
- let node = e.target;
92
- if (!e.composed || node.nodeType !== Node.ELEMENT_NODE) {
93
- return;
94
- }
95
- const [source] = e.composedPath();
96
- if (node === source) {
97
- const parent = this.findSlotParent(e.composedPath());
98
- if (!parent) {
99
- return;
100
- }
101
- node = parent;
102
- }
103
- const { dataset } = source;
104
- const isSvgDraggable = source.classList && source.classList.contains('association-draggable');
105
- if (isSvgDraggable) {
106
- e.preventDefault();
107
- e.stopPropagation();
108
- this.startUpdate(dataset.key, dataset.dir);
109
- return;
110
- }
111
- if (!node.hasAttribute('data-association-slots')) {
112
- return;
113
- }
114
- if (source.nodeType !== Node.ELEMENT_NODE) {
115
- return;
116
- }
117
- if (!dataset.associationSlot) {
118
- return;
119
- }
120
- e.preventDefault();
121
- e.stopPropagation();
122
- const startPoint = anchorToPoint(source, this.workspace);
123
- this.start(node, dataset.associationSlot, startPoint);
124
- }
125
- [mouseMoveHandler](e) {
126
- if (!this.drawing) {
127
- return;
128
- }
129
- const { clientX, clientY } = e;
130
- const pos = getRelativeClickPoint(clientX, clientY, this.workspace);
131
- this.updateLinePosition(pos);
132
- }
133
- [mouseUpHandler](e) {
134
- if (!this.drawing) {
135
- return;
136
- }
137
- this.drawing = false;
138
- this.cancel();
139
- let node = e.target;
140
- if (!e.composed || node.nodeType !== Node.ELEMENT_NODE) {
141
- this.cleanup();
142
- return;
143
- }
144
- if (!node.hasAttribute('data-association-slots')) {
145
- const parent = this.findSlotParent(e.composedPath());
146
- if (!parent) {
147
- return;
148
- }
149
- node = parent;
150
- }
151
- if (!node.hasAttribute('data-association-slots')) {
152
- this.cleanup();
153
- return;
154
- }
155
- const [source] = e.composedPath();
156
- if (source.nodeType !== Node.ELEMENT_NODE) {
157
- this.cleanup();
158
- return;
159
- }
160
- const { dataset } = source;
161
- if (!dataset.associationSlot) {
162
- this.cleanup();
163
- return;
164
- }
165
- const { clientX, clientY } = e;
166
- const endPoint = getRelativeClickPoint(clientX, clientY, this.workspace);
167
- if (this.updating) {
168
- this.endUpdate(node.dataset.key, dataset.associationSlot, endPoint);
169
- }
170
- else {
171
- this.end(node.dataset.key, dataset.associationSlot, endPoint);
172
- }
173
- }
174
- [keydownHandler](e) {
175
- if (e.code !== 'Escape') {
176
- return;
177
- }
178
- this.cancel();
179
- this.cleanup();
180
- }
181
- /**
182
- * Cancels the operation.
183
- */
184
- cancel() {
185
- this.unlistenDargEvents();
186
- this.removeLine();
187
- if (this.updating) {
188
- const model = this.workspace.edges.get(this.updateInfo.id);
189
- model.shape.selection.hidden = false;
190
- this.workspace.requestUpdate();
191
- }
192
- }
193
- /**
194
- * Clears variables set in the `start()` function.
195
- */
196
- cleanup() {
197
- this.createInfo = undefined;
198
- this.updateInfo = undefined;
199
- this.updating = false;
200
- this.drawing = false;
201
- }
202
- start(domainObject, slot, startPoint) {
203
- this.drawing = true;
204
- this.createInfo = {
205
- slot,
206
- point: startPoint,
207
- source: domainObject,
208
- };
209
- this.addLine(startPoint, startPoint);
210
- this.listenDargEvents();
211
- }
212
- /**
213
- * @param key The domain id of the association being updated
214
- * @param dir The name of the tip that is being dragged.
215
- */
216
- startUpdate(key, dir) {
217
- const model = this.workspace.edges.get(key);
218
- if (!model) {
219
- throw new Error(`The edge is not prepared.`);
220
- }
221
- model.shape.selection.hidden = true;
222
- const { coordinates } = model.shape.line;
223
- const [sp] = coordinates;
224
- const ep = coordinates[coordinates.length - 1];
225
- const startPoint = dir === 'end' ? sp : ep;
226
- const endPoint = dir === 'end' ? ep : sp;
227
- this.updating = true;
228
- this.updateInfo = {
229
- direction: dir,
230
- ep: endPoint,
231
- sp: startPoint,
232
- id: key,
233
- };
234
- this.drawing = true;
235
- this.addLine(startPoint, endPoint);
236
- this.listenDargEvents();
237
- this.workspace.requestUpdate();
238
- }
239
- end(id, slot, endPoint) {
240
- const { createInfo } = this;
241
- if (!createInfo) {
242
- throw new Error(`updateInfo is not set.`);
243
- }
244
- const detail = {
245
- source: {
246
- id: createInfo.source.dataset.key,
247
- point: createInfo.point,
248
- slot: createInfo.slot,
249
- },
250
- target: {
251
- id, // : domainObject.dataset.key,
252
- point: endPoint,
253
- slot,
254
- },
255
- };
256
- createInfo.source.dispatchEvent(new CustomEvent('anchorassociationcreate', {
257
- composed: true,
258
- cancelable: true,
259
- bubbles: true,
260
- detail,
261
- }));
262
- this.cleanup();
263
- }
264
- endUpdate(id, slot, endPoint) {
265
- const { updateInfo } = this;
266
- if (!updateInfo) {
267
- throw new Error(`updateInfo is not set.`);
268
- }
269
- const detail = {
270
- source: {
271
- associationId: updateInfo.id,
272
- direction: updateInfo.direction,
273
- },
274
- target: {
275
- id, // : domainObject.dataset.key,
276
- point: endPoint,
277
- slot,
278
- },
279
- };
280
- const model = this.workspace.edges.get(updateInfo.id);
281
- const eventTarget = this.workspace.querySelector(`[data-key="${model.source}"]`);
282
- this.cleanup();
283
- eventTarget.dispatchEvent(new CustomEvent('anchorassociationupdate', {
284
- composed: true,
285
- cancelable: true,
286
- bubbles: true,
287
- detail,
288
- }));
289
- }
290
- /**
291
- * Insets a child with a line definition into the workspace's SVG element.
292
- * @param start The starting point of the line
293
- * @param end The ending point of the line
294
- */
295
- addLine(start, end) {
296
- const line = document.createElementNS(SvgNS, 'line');
297
- line.setAttribute('x1', `${start.x}`);
298
- line.setAttribute('y1', `${start.y}`);
299
- line.setAttribute('x2', `${end.x}`);
300
- line.setAttribute('y2', `${end.y}`);
301
- line.classList.add('association-line');
302
- const { associationSvg } = this.workspace;
303
- associationSvg.append(line);
304
- this.lineElement = line;
305
- }
306
- /**
307
- * Removes the previously added line from the SVG
308
- */
309
- removeLine() {
310
- const { lineElement } = this;
311
- if (!lineElement) {
312
- return;
313
- }
314
- const { associationSvg } = this.workspace;
315
- associationSvg.removeChild(lineElement);
316
- this.lineElement = undefined;
317
- }
318
- /**
319
- * Updates the end position of the line.
320
- * @param {Point} point
321
- */
322
- updateLinePosition(point) {
323
- const { lineElement } = this;
324
- if (!lineElement) {
325
- return;
326
- }
327
- // lineElement.setAttribute('d', definition.path);
328
- lineElement.setAttribute('x2', `${point.x}`);
329
- lineElement.setAttribute('y2', `${point.y}`);
330
- }
331
- /**
332
- * Listens for the mouse move and mouse up events to draw the line and finish the operation.
333
- * This is only initialized when starting drawing a line.
334
- */
335
- listenDargEvents() {
336
- const { workspace } = this;
337
- workspace.addEventListener('mousemove', this[mouseMoveHandler]);
338
- workspace.addEventListener('mouseup', this[mouseUpHandler]);
339
- window.addEventListener('keydown', this[keydownHandler]);
340
- }
341
- /**
342
- * Removes previously registered events.
343
- */
344
- unlistenDargEvents() {
345
- const { workspace } = this;
346
- workspace.removeEventListener('mousemove', this[mouseMoveHandler]);
347
- workspace.removeEventListener('mouseup', this[mouseUpHandler]);
348
- window.removeEventListener('keydown', this[keydownHandler]);
349
- }
350
- }
351
- //# sourceMappingURL=AssociationAnchors.js.map