@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,216 +0,0 @@
1
- import { Point } from './Point.js';
2
- import { IWorkspaceEdge } from './types.js';
3
- export interface IShapeOrientation {
4
- /**
5
- * The transformation origin of the shape. It consists of `x y` coordinates
6
- * expressed in pixel unit.
7
- * E.g. "20px 100px" meaning that all transformations applied to the shape are relative to this point.
8
- */
9
- transformOrigin: string;
10
- /**
11
- * The rotation of the object relative to the workspace.
12
- * It may not be set for shapes that are not rotated (like lines).
13
- */
14
- rotate?: number;
15
- }
16
- /**
17
- * A base class for a shape present in the SVG part of the visualization workspace.
18
- */
19
- export interface IVisualizationShape extends IShapeOrientation {
20
- /**
21
- * For the shapes that supports this. It is a value to be added to SVG's element `points` or `d` attribute.
22
- */
23
- path?: string;
24
- /**
25
- * The list of points that describe the shape.
26
- * For a line this would be the start and end coordinates of the shape.
27
- * For a triangle these are the coordinates of each vertex of it.
28
- */
29
- coordinates?: Point[];
30
- }
31
- /**
32
- * Represents the selection state of the shape.
33
- */
34
- export interface IVisualizationShapeSelection {
35
- /**
36
- * Whether the shape has the primary selection state.
37
- * @default false;
38
- */
39
- primary?: boolean;
40
- /**
41
- * Whether the shape has the secondary selection state.
42
- * Using primary and the secondary selection is discouraged.
43
- * @default false;
44
- */
45
- secondary?: boolean;
46
- /**
47
- * When set the shape should be hidden.
48
- */
49
- hidden?: boolean;
50
- /**
51
- * Whether the item is currently hovered.
52
- */
53
- hover?: boolean;
54
- }
55
- export interface ISelectableShape {
56
- /**
57
- * The selection state of the shape.
58
- */
59
- selection?: IVisualizationShapeSelection;
60
- }
61
- export type AssociationShapeType = 'linear' | 'rectilinear';
62
- /**
63
- * A base class for association related shapes
64
- */
65
- export interface IVisualizationAssociationShape extends IVisualizationShape {
66
- /**
67
- * The type of the line. This is defined in `lib/LineSketch`.
68
- */
69
- type: AssociationShapeType;
70
- startPoint: Point;
71
- endPoint: Point;
72
- }
73
- /**
74
- * Association description for rectilinear style line.
75
- */
76
- export interface IVisualizationRectilinearLineShape extends IVisualizationAssociationShape {
77
- /**
78
- * The list of points where the line breaks.
79
- */
80
- controlPoints: Point[];
81
- }
82
- /**
83
- * Cubic Bezier curve control points.
84
- */
85
- export interface ICubicControlPoints {
86
- /**
87
- * Coordinates of the first control point
88
- */
89
- cp1: Point;
90
- /**
91
- * Coordinates of the second control point
92
- */
93
- cp2: Point;
94
- }
95
- /**
96
- * The definition of an SVG shape that represents an association (edge) line between
97
- * two other shapes.
98
- */
99
- export interface IAssociationShape extends ISelectableShape {
100
- /**
101
- * Name of a CSS class to add to the line class attribute
102
- */
103
- style?: string;
104
- /**
105
- * The association label. May not be set when the association object does not have a label.
106
- */
107
- label?: IAssociationLabelShape;
108
- /**
109
- * The definition of the line start and end tips.
110
- */
111
- tips?: ILineTips;
112
- /**
113
- * Name of the slots to use when calculating the association line's start and end points.
114
- */
115
- slots?: IAssociationSlots;
116
- /**
117
- * The line definition for the shape.
118
- */
119
- line: IVisualizationAssociationShape;
120
- }
121
- export interface IAssociationLabelShape extends IShapeOrientation {
122
- /**
123
- * The x coordinate of the label
124
- */
125
- x: number;
126
- /**
127
- * The y coordinate of the label
128
- */
129
- y: number;
130
- /**
131
- * The label's text value
132
- */
133
- value: string;
134
- /**
135
- * The value to set on the `text-anchor` attribute of the `<text>`'s element.
136
- */
137
- anchor?: string;
138
- }
139
- export interface IAssociationTip extends IVisualizationShape {
140
- /**
141
- * Name of a CSS class to add to the tip's class attribute
142
- */
143
- style?: string;
144
- /**
145
- * The name of the SVG element to use to visualize the tip.
146
- * @default polygon
147
- */
148
- svg?: string;
149
- }
150
- /**
151
- * Dictionary for a line tips.
152
- */
153
- export interface ILineTips {
154
- /**
155
- * The tip placed where the line starts.
156
- */
157
- start?: IAssociationTip;
158
- /**
159
- * The tip placed where the line ends.
160
- */
161
- end?: IAssociationTip;
162
- }
163
- /**
164
- * Definition of slots used by an association
165
- */
166
- export interface IAssociationSlots {
167
- /**
168
- * The name of the slot in the source object
169
- */
170
- source?: string;
171
- /**
172
- * The name of the slot in the target object
173
- */
174
- target?: string;
175
- }
176
- export interface IAssociationVertexes {
177
- /**
178
- * The line's start position
179
- */
180
- start?: Point;
181
- /**
182
- * The line's end position
183
- */
184
- end?: Point;
185
- }
186
- /**
187
- * A definition used by the `lib/LineSketch` class sketch a line
188
- */
189
- export interface ILineSketchOptions {
190
- /**
191
- * The computation of `DOMRect` for the source element.
192
- */
193
- source: DOMRect;
194
- /**
195
- * The computation of `DOMRect` for the target element.
196
- */
197
- target: DOMRect;
198
- /**
199
- * The position where the line starts
200
- */
201
- startPoint: Point;
202
- /**
203
- * The position where the line ends
204
- */
205
- endPoint: Point;
206
- /**
207
- * The type of the line to draw. Depending on the type the result of the computation can be different.
208
- * Uses the default when missing
209
- */
210
- type?: AssociationShapeType;
211
- /**
212
- * Other associations already built between the two objects.
213
- */
214
- others?: IWorkspaceEdge[];
215
- }
216
- //# sourceMappingURL=VisualizationTypes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"VisualizationTypes.d.ts","sourceRoot":"","sources":["../../../../src/visualization/lib/VisualizationTypes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAE3C,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,eAAe,EAAE,MAAM,CAAA;IACvB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,iBAAiB;IAC5D;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;;OAIG;IACH,WAAW,CAAC,EAAE,KAAK,EAAE,CAAA;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C;;;OAGG;IACH,OAAO,CA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ChB;AAED,MAAM,WAAW,eAAgB,SAAQ,mBAAmB;IAC1D;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,KAAK,CAAC,EAAE,eAAe,CAAA;IACvB;;OAEG;IACH,GAAG,CAAC,EAAE,eAAe,CAAA;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAA;IACb;;OAEG;IACH,GAAG,CAAC,EAAE,KAAK,CAAA;CACZ;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,MAAM,EAAE,OAAO,CAAA;IACf;;OAEG;IACH,MAAM,EAAE,OAAO,CAAA;IACf;;OAEG;IACH,UAAU,EAAE,KAAK,CAAA;IACjB;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAA;IACf;;;OAGG;IACH,IAAI,CAAC,EAAE,oBAAoB,CAAA;IAC3B;;OAEG;IACH,MAAM,CAAC,EAAE,cAAc,EAAE,CAAA;CAC1B"}
@@ -1,3 +0,0 @@
1
- // new visualization types
2
- export {};
3
- //# sourceMappingURL=VisualizationTypes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"VisualizationTypes.js","sourceRoot":"","sources":["../../../../src/visualization/lib/VisualizationTypes.ts"],"names":[],"mappings":"AAAA,0BAA0B","sourcesContent":["// new visualization types\n\nimport { Point } from './Point.js'\nimport { IWorkspaceEdge } from './types.js'\n\nexport interface IShapeOrientation {\n /**\n * The transformation origin of the shape. It consists of `x y` coordinates\n * expressed in pixel unit.\n * E.g. \"20px 100px\" meaning that all transformations applied to the shape are relative to this point.\n */\n transformOrigin: string\n /**\n * The rotation of the object relative to the workspace.\n * It may not be set for shapes that are not rotated (like lines).\n */\n rotate?: number\n}\n\n/**\n * A base class for a shape present in the SVG part of the visualization workspace.\n */\nexport interface IVisualizationShape extends IShapeOrientation {\n /**\n * For the shapes that supports this. It is a value to be added to SVG's element `points` or `d` attribute.\n */\n path?: string\n /**\n * The list of points that describe the shape.\n * For a line this would be the start and end coordinates of the shape.\n * For a triangle these are the coordinates of each vertex of it.\n */\n coordinates?: Point[]\n}\n\n/**\n * Represents the selection state of the shape.\n */\nexport interface IVisualizationShapeSelection {\n /**\n * Whether the shape has the primary selection state.\n * @default false;\n */\n primary?: boolean\n /**\n * Whether the shape has the secondary selection state.\n * Using primary and the secondary selection is discouraged.\n * @default false;\n */\n secondary?: boolean\n /**\n * When set the shape should be hidden.\n */\n hidden?: boolean\n /**\n * Whether the item is currently hovered.\n */\n hover?: boolean\n}\n\nexport interface ISelectableShape {\n /**\n * The selection state of the shape.\n */\n selection?: IVisualizationShapeSelection\n}\n\nexport type AssociationShapeType = 'linear' | 'rectilinear'\n\n/**\n * A base class for association related shapes\n */\nexport interface IVisualizationAssociationShape extends IVisualizationShape {\n /**\n * The type of the line. This is defined in `lib/LineSketch`.\n */\n type: AssociationShapeType\n startPoint: Point\n endPoint: Point\n}\n\n/**\n * Association description for rectilinear style line.\n */\nexport interface IVisualizationRectilinearLineShape extends IVisualizationAssociationShape {\n /**\n * The list of points where the line breaks.\n */\n controlPoints: Point[]\n}\n\n/**\n * Cubic Bezier curve control points.\n */\nexport interface ICubicControlPoints {\n /**\n * Coordinates of the first control point\n */\n cp1: Point\n /**\n * Coordinates of the second control point\n */\n cp2: Point\n}\n\n/**\n * The definition of an SVG shape that represents an association (edge) line between\n * two other shapes.\n */\nexport interface IAssociationShape extends ISelectableShape {\n /**\n * Name of a CSS class to add to the line class attribute\n */\n style?: string\n /**\n * The association label. May not be set when the association object does not have a label.\n */\n label?: IAssociationLabelShape\n /**\n * The definition of the line start and end tips.\n */\n tips?: ILineTips\n /**\n * Name of the slots to use when calculating the association line's start and end points.\n */\n slots?: IAssociationSlots\n /**\n * The line definition for the shape.\n */\n line: IVisualizationAssociationShape\n}\n\nexport interface IAssociationLabelShape extends IShapeOrientation {\n /**\n * The x coordinate of the label\n */\n x: number\n /**\n * The y coordinate of the label\n */\n y: number\n /**\n * The label's text value\n */\n value: string\n /**\n * The value to set on the `text-anchor` attribute of the `<text>`'s element.\n */\n anchor?: string\n}\n\nexport interface IAssociationTip extends IVisualizationShape {\n /**\n * Name of a CSS class to add to the tip's class attribute\n */\n style?: string\n /**\n * The name of the SVG element to use to visualize the tip.\n * @default polygon\n */\n svg?: string\n}\n\n/**\n * Dictionary for a line tips.\n */\nexport interface ILineTips {\n /**\n * The tip placed where the line starts.\n */\n start?: IAssociationTip\n /**\n * The tip placed where the line ends.\n */\n end?: IAssociationTip\n}\n\n/**\n * Definition of slots used by an association\n */\nexport interface IAssociationSlots {\n /**\n * The name of the slot in the source object\n */\n source?: string\n /**\n * The name of the slot in the target object\n */\n target?: string\n}\n\nexport interface IAssociationVertexes {\n /**\n * The line's start position\n */\n start?: Point\n /**\n * The line's end position\n */\n end?: Point\n}\n\n/**\n * A definition used by the `lib/LineSketch` class sketch a line\n */\nexport interface ILineSketchOptions {\n /**\n * The computation of `DOMRect` for the source element.\n */\n source: DOMRect\n /**\n * The computation of `DOMRect` for the target element.\n */\n target: DOMRect\n /**\n * The position where the line starts\n */\n startPoint: Point\n /**\n * The position where the line ends\n */\n endPoint: Point\n /**\n * The type of the line to draw. Depending on the type the result of the computation can be different.\n * Uses the default when missing\n */\n type?: AssociationShapeType\n /**\n * Other associations already built between the two objects.\n */\n others?: IWorkspaceEdge[]\n}\n"]}
@@ -1,51 +0,0 @@
1
- import VizWorkspaceElement from '../elements/VizWorkspaceElement.js';
2
- /**
3
- * A class that adds support for the nodes alignment on the workspace.
4
- * It adds methods that can align and distribute selected nodes.
5
- */
6
- export declare class WorkspaceAlignment {
7
- workspace: VizWorkspaceElement;
8
- /**
9
- * @return Currently selected on the workspace items.
10
- */
11
- get items(): HTMLElement[];
12
- constructor(workspace: VizWorkspaceElement);
13
- /**
14
- * @returns True when the number of selected items is above 1.
15
- */
16
- multiSelection(): boolean;
17
- /**
18
- * Aligns selected items vertically to the top.
19
- */
20
- verticalTop(): void;
21
- /**
22
- * Aligns selected items vertically to the middle.
23
- */
24
- verticalCenter(): void;
25
- /**
26
- * Aligns selected items vertically to the bottom.
27
- */
28
- verticalBottom(): void;
29
- /**
30
- * Distributes selected items vertically.
31
- *
32
- */
33
- verticalDistribute(): void;
34
- /**
35
- * Aligns selected items horizontally to the left.
36
- */
37
- horizontalLeft(): void;
38
- /**
39
- * Aligns selected items horizontally to the center.
40
- */
41
- horizontalCenter(): void;
42
- /**
43
- * Aligns selected items horizontally to the bottom.
44
- */
45
- horizontalRight(): void;
46
- /**
47
- * Distributes selected items horizontally.
48
- */
49
- horizontalDistribute(): void;
50
- }
51
- //# sourceMappingURL=WorkspaceAlignment.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WorkspaceAlignment.d.ts","sourceRoot":"","sources":["../../../../src/visualization/lib/WorkspaceAlignment.ts"],"names":[],"mappings":"AACA,OAAO,mBAAmB,MAAM,oCAAoC,CAAA;AAQpE;;;GAGG;AACH,qBAAa,kBAAkB;IAgBV,SAAS,EAAE,mBAAmB;IAfjD;;OAEG;IACH,IAAI,KAAK,IAAI,WAAW,EAAE,CAUzB;gBAEkB,SAAS,EAAE,mBAAmB;IAEjD;;OAEG;IACH,cAAc,IAAI,OAAO;IAIzB;;OAEG;IACH,WAAW,IAAI,IAAI;IAgBnB;;OAEG;IACH,cAAc,IAAI,IAAI;IAkBtB;;OAEG;IACH,cAAc,IAAI,IAAI;IAiBtB;;;OAGG;IACH,kBAAkB,IAAI,IAAI;IAgD1B;;OAEG;IACH,cAAc,IAAI,IAAI;IAgBtB;;OAEG;IACH,gBAAgB,IAAI,IAAI;IAkBxB;;OAEG;IACH,eAAe,IAAI,IAAI;IAiBvB;;OAEG;IACH,oBAAoB,IAAI,IAAI;CA+C7B"}
@@ -1,243 +0,0 @@
1
- import { getObjectBoundingClientRect, notifyMoved } from './PositionUtils.js';
2
- /**
3
- * A class that adds support for the nodes alignment on the workspace.
4
- * It adds methods that can align and distribute selected nodes.
5
- */
6
- export class WorkspaceAlignment {
7
- workspace;
8
- /**
9
- * @return Currently selected on the workspace items.
10
- */
11
- get items() {
12
- const { workspace } = this;
13
- const result = [];
14
- workspace.selection.selected.forEach((i) => {
15
- const item = workspace.querySelector(`[data-key="${i.id}"][data-alignable]`);
16
- if (item) {
17
- result.push(item);
18
- }
19
- });
20
- return result;
21
- }
22
- constructor(workspace) {
23
- this.workspace = workspace;
24
- }
25
- /**
26
- * @returns True when the number of selected items is above 1.
27
- */
28
- multiSelection() {
29
- return this.items.length > 1;
30
- }
31
- /**
32
- * Aligns selected items vertically to the top.
33
- */
34
- verticalTop() {
35
- if (!this.multiSelection()) {
36
- return;
37
- }
38
- const { items } = this;
39
- const first = items.shift();
40
- const box = getObjectBoundingClientRect(first, this.workspace);
41
- items.forEach(async (node) => {
42
- const nodeBox = getObjectBoundingClientRect(node, this.workspace);
43
- const dy = box.y - nodeBox.y;
44
- if (dy !== 0) {
45
- notifyMoved(node, 0, dy);
46
- }
47
- });
48
- }
49
- /**
50
- * Aligns selected items vertically to the middle.
51
- */
52
- verticalCenter() {
53
- if (!this.multiSelection()) {
54
- return;
55
- }
56
- const { items } = this;
57
- const first = items.shift();
58
- const box = getObjectBoundingClientRect(first, this.workspace);
59
- const middle = box.height / 2 + box.y;
60
- items.forEach((node) => {
61
- const nodeBox = getObjectBoundingClientRect(node, this.workspace);
62
- const nodeMiddle = nodeBox.height / 2 + nodeBox.y;
63
- const dy = middle - nodeMiddle;
64
- if (dy !== 0) {
65
- notifyMoved(node, 0, dy);
66
- }
67
- });
68
- }
69
- /**
70
- * Aligns selected items vertically to the bottom.
71
- */
72
- verticalBottom() {
73
- if (!this.multiSelection()) {
74
- return;
75
- }
76
- const { items } = this;
77
- const first = items.shift();
78
- const box = getObjectBoundingClientRect(first, this.workspace);
79
- const end = box.height + box.top;
80
- items.forEach((node) => {
81
- const nodeBox = getObjectBoundingClientRect(node, this.workspace);
82
- const dy = end - nodeBox.height - nodeBox.y;
83
- if (dy !== 0) {
84
- notifyMoved(node, 0, dy);
85
- }
86
- });
87
- }
88
- /**
89
- * Distributes selected items vertically.
90
- *
91
- */
92
- verticalDistribute() {
93
- if (!this.multiSelection()) {
94
- return;
95
- }
96
- const { items } = this;
97
- let maxStart = 0; // minimum y value
98
- let maxEnd = 0; // maximum y value
99
- const positioned = [];
100
- items.forEach((node) => {
101
- const box = getObjectBoundingClientRect(node, this.workspace);
102
- positioned.push({
103
- node,
104
- box,
105
- });
106
- const heightY = box.height + box.y;
107
- if (!maxStart || box.y <= maxStart) {
108
- maxStart = box.y;
109
- }
110
- if (!maxEnd || heightY >= maxEnd) {
111
- maxEnd = heightY;
112
- }
113
- });
114
- const first = positioned.shift();
115
- const last = positioned.pop();
116
- // The first element is to be positioned to the top line.
117
- notifyMoved(first.node, 0, maxStart - first.box.y);
118
- // The last element is to be positioned to the bottom line,
119
- notifyMoved(last.node, 0, maxEnd - last.box.height - last.box.y);
120
- // Elements in between to be positioned to the remaining space between the first and the last
121
- // split into equal sections, and positioned in the middle of each section.
122
- const distributionLength = maxEnd - last.box.height - (maxStart + first.box.height);
123
- const boxesLength = positioned.reduce((result, item) => result + item.box.height, 0);
124
- const spaceAvailable = distributionLength - boxesLength;
125
- const spaceLength = spaceAvailable / (positioned.length + 1);
126
- let current = maxStart + first.box.height;
127
- positioned.forEach((item) => {
128
- const { node, box } = item;
129
- const newY = current + spaceLength;
130
- const dy = newY - box.y;
131
- current += spaceLength + box.height;
132
- if (dy !== 0) {
133
- notifyMoved(node, 0, dy);
134
- }
135
- });
136
- }
137
- /**
138
- * Aligns selected items horizontally to the left.
139
- */
140
- horizontalLeft() {
141
- if (!this.multiSelection()) {
142
- return;
143
- }
144
- const { items } = this;
145
- const first = items.shift();
146
- const box = getObjectBoundingClientRect(first, this.workspace);
147
- items.forEach((node) => {
148
- const nodeBox = getObjectBoundingClientRect(node, this.workspace);
149
- const dx = box.x - nodeBox.x;
150
- if (dx !== 0) {
151
- notifyMoved(node, dx, 0);
152
- }
153
- });
154
- }
155
- /**
156
- * Aligns selected items horizontally to the center.
157
- */
158
- horizontalCenter() {
159
- if (!this.multiSelection()) {
160
- return;
161
- }
162
- const { items } = this;
163
- const first = items.shift();
164
- const box = getObjectBoundingClientRect(first, this.workspace);
165
- const middle = box.width / 2 + box.x;
166
- items.forEach((node) => {
167
- const nodeBox = getObjectBoundingClientRect(node, this.workspace);
168
- const nodeMiddle = nodeBox.width / 2 + nodeBox.x;
169
- const dx = middle - nodeMiddle;
170
- if (dx !== 0) {
171
- notifyMoved(node, dx, 0);
172
- }
173
- });
174
- }
175
- /**
176
- * Aligns selected items horizontally to the bottom.
177
- */
178
- horizontalRight() {
179
- if (!this.multiSelection()) {
180
- return;
181
- }
182
- const { items } = this;
183
- const first = items.shift();
184
- const box = getObjectBoundingClientRect(first, this.workspace);
185
- const end = box.width + box.x;
186
- items.forEach((node) => {
187
- const nodeBox = getObjectBoundingClientRect(node, this.workspace);
188
- const dx = end - nodeBox.width - nodeBox.x;
189
- if (dx !== 0) {
190
- notifyMoved(node, dx, 0);
191
- }
192
- });
193
- }
194
- /**
195
- * Distributes selected items horizontally.
196
- */
197
- horizontalDistribute() {
198
- if (!this.multiSelection()) {
199
- return;
200
- }
201
- const { items } = this;
202
- let maxStart = 0; // minimum x value
203
- let maxEnd = 0; // maximum x value
204
- const positioned = [];
205
- items.forEach((node) => {
206
- const box = getObjectBoundingClientRect(node, this.workspace);
207
- positioned.push({
208
- node,
209
- box,
210
- });
211
- const widthX = box.width + box.x;
212
- if (!maxStart || box.x <= maxStart) {
213
- maxStart = box.x;
214
- }
215
- if (!maxEnd || widthX >= maxEnd) {
216
- maxEnd = widthX;
217
- }
218
- });
219
- const first = positioned.shift();
220
- const last = positioned.pop();
221
- // The first element is to be positioned to the left line.
222
- notifyMoved(first.node, maxStart - first.box.x, 0);
223
- // The last element is to be positioned to the right line,
224
- notifyMoved(last.node, maxEnd - last.box.width - last.box.x, 0);
225
- // Elements in between to be positioned to the remaining space between the first and the last
226
- // split into equal sections, and positioned in the middle of each section.
227
- const distributionLength = maxEnd - last.box.width - (maxStart + first.box.width);
228
- const boxesLength = positioned.reduce((result, item) => result + item.box.width, 0);
229
- const spaceAvailable = distributionLength - boxesLength;
230
- const spaceLength = spaceAvailable / (positioned.length + 1);
231
- let current = maxStart + first.box.width;
232
- positioned.forEach((item) => {
233
- const { node, box } = item;
234
- const newX = current + spaceLength;
235
- const dx = newX - box.x;
236
- current += spaceLength + box.width;
237
- if (dx !== 0) {
238
- notifyMoved(node, dx, 0);
239
- }
240
- });
241
- }
242
- }
243
- //# sourceMappingURL=WorkspaceAlignment.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WorkspaceAlignment.js","sourceRoot":"","sources":["../../../../src/visualization/lib/WorkspaceAlignment.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,2BAA2B,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAO7E;;;GAGG;AACH,MAAM,OAAO,kBAAkB;IAgBV;IAfnB;;OAEG;IACH,IAAI,KAAK;QACP,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,CAAA;QAC1B,MAAM,MAAM,GAAkB,EAAE,CAAA;QAChC,SAAS,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;YACzC,MAAM,IAAI,GAAG,SAAS,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC,EAAE,oBAAoB,CAAuB,CAAA;YAClG,IAAI,IAAI,EAAE,CAAC;gBACT,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YACnB,CAAC;QACH,CAAC,CAAC,C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CAAA;YAClC,MAAM,EAAE,GAAG,IAAI,GAAG,GAAG,CAAC,CAAC,CAAA;YACvB,OAAO,IAAI,WAAW,GAAG,GAAG,CAAC,KAAK,CAAA;YAClC,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC;gBACb,WAAW,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,CAAA;YAC1B,CAAC;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;CACF","sourcesContent":["/* eslint-disable @typescript-eslint/no-non-null-assertion */\nimport VizWorkspaceElement from '../elements/VizWorkspaceElement.js'\nimport { getObjectBoundingClientRect, notifyMoved } from './PositionUtils.js'\n\ninterface IPositionInfo {\n node: HTMLElement\n box: DOMRect\n}\n\n/**\n * A class that adds support for the nodes alignment on the workspace.\n * It adds methods that can align and distribute selected nodes.\n */\nexport class WorkspaceAlignment {\n /**\n * @return Currently selected on the workspace items.\n */\n get items(): HTMLElement[] {\n const { workspace } = this\n const result: HTMLElement[] = []\n workspace.selection.selected.forEach((i) => {\n const item = workspace.querySelector(`[data-key=\"${i.id}\"][data-alignable]`) as HTMLElement | null\n if (item) {\n result.push(item)\n }\n })\n return result\n }\n\n constructor(public workspace: VizWorkspaceElement) {}\n\n /**\n * @returns True when the number of selected items is above 1.\n */\n multiSelection(): boolean {\n return this.items.length > 1\n }\n\n /**\n * Aligns selected items vertically to the top.\n */\n verticalTop(): void {\n if (!this.multiSelection()) {\n return\n }\n const { items } = this\n const first = items.shift()!\n const box = getObjectBoundingClientRect(first, this.workspace)\n items.forEach(async (node) => {\n const nodeBox = getObjectBoundingClientRect(node, this.workspace)\n const dy = box.y - nodeBox.y\n if (dy !== 0) {\n notifyMoved(node, 0, dy)\n }\n })\n }\n\n /**\n * Aligns selected items vertically to the middle.\n */\n verticalCenter(): void {\n if (!this.multiSelection()) {\n return\n }\n const { items } = this\n const first = items.shift()!\n const box = getObjectBoundingClientRect(first, this.workspace)\n const middle = box.height / 2 + box.y\n items.forEach((node) => {\n const nodeBox = getObjectBoundingClientRect(node, this.workspace)\n const nodeMiddle = nodeBox.height / 2 + nodeBox.y\n const dy = middle - nodeMiddle\n if (dy !== 0) {\n notifyMoved(node, 0, dy)\n }\n })\n }\n\n /**\n * Aligns selected items vertically to the bottom.\n */\n verticalBottom(): void {\n if (!this.multiSelection()) {\n return\n }\n const { items } = this\n const first = items.shift()\n const box = getObjectBoundingClientRect(first!, this.workspace)\n const end = box.height + box.top\n items.forEach((node) => {\n const nodeBox = getObjectBoundingClientRect(node, this.workspace)\n const dy = end - nodeBox.height - nodeBox.y\n if (dy !== 0) {\n notifyMoved(node, 0, dy)\n }\n })\n }\n\n /**\n * Distributes selected items vertically.\n *\n */\n verticalDistribute(): void {\n if (!this.multiSelection()) {\n return\n }\n const { items } = this\n let maxStart = 0 // minimum y value\n let maxEnd = 0 // maximum y value\n const positioned: IPositionInfo[] = []\n items.forEach((node) => {\n const box = getObjectBoundingClientRect(node, this.workspace)\n positioned.push({\n node,\n box,\n })\n const heightY = box.height + box.y\n if (!maxStart || box.y <= maxStart) {\n maxStart = box.y\n }\n if (!maxEnd || heightY >= maxEnd) {\n maxEnd = heightY\n }\n })\n\n const first = positioned.shift()!\n const last = positioned.pop()!\n\n // The first element is to be positioned to the top line.\n notifyMoved(first.node, 0, maxStart - first.box.y)\n // The last element is to be positioned to the bottom line,\n notifyMoved(last.node, 0, maxEnd - last.box.height - last.box.y)\n // Elements in between to be positioned to the remaining space between the first and the last\n // split into equal sections, and positioned in the middle of each section.\n const distributionLength = maxEnd - last.box.height - (maxStart + first.box.height)\n const boxesLength = positioned.reduce((result, item) => result + item.box.height, 0)\n const spaceAvailable = distributionLength - boxesLength\n const spaceLength = spaceAvailable / (positioned.length + 1)\n let current = maxStart + first.box.height\n positioned.forEach((item) => {\n const { node, box } = item\n const newY = current + spaceLength\n const dy = newY - box.y\n current += spaceLength + box.height\n if (dy !== 0) {\n notifyMoved(node, 0, dy)\n }\n })\n }\n\n /**\n * Aligns selected items horizontally to the left.\n */\n horizontalLeft(): void {\n if (!this.multiSelection()) {\n return\n }\n const { items } = this\n const first = items.shift()\n const box = getObjectBoundingClientRect(first!, this.workspace)\n items.forEach((node) => {\n const nodeBox = getObjectBoundingClientRect(node, this.workspace)\n const dx = box.x - nodeBox.x\n if (dx !== 0) {\n notifyMoved(node, dx, 0)\n }\n })\n }\n\n /**\n * Aligns selected items horizontally to the center.\n */\n horizontalCenter(): void {\n if (!this.multiSelection()) {\n return\n }\n const { items } = this\n const first = items.shift()\n const box = getObjectBoundingClientRect(first!, this.workspace)\n const middle = box.width / 2 + box.x\n items.forEach((node) => {\n const nodeBox = getObjectBoundingClientRect(node, this.workspace)\n const nodeMiddle = nodeBox.width / 2 + nodeBox.x\n const dx = middle - nodeMiddle\n if (dx !== 0) {\n notifyMoved(node, dx, 0)\n }\n })\n }\n\n /**\n * Aligns selected items horizontally to the bottom.\n */\n horizontalRight(): void {\n if (!this.multiSelection()) {\n return\n }\n const { items } = this\n const first = items.shift()\n const box = getObjectBoundingClientRect(first!, this.workspace)\n const end = box.width + box.x\n items.forEach((node) => {\n const nodeBox = getObjectBoundingClientRect(node, this.workspace)\n const dx = end - nodeBox.width - nodeBox.x\n if (dx !== 0) {\n notifyMoved(node, dx, 0)\n }\n })\n }\n\n /**\n * Distributes selected items horizontally.\n */\n horizontalDistribute(): void {\n if (!this.multiSelection()) {\n return\n }\n const { items } = this\n let maxStart = 0 // minimum x value\n let maxEnd = 0 // maximum x value\n const positioned: IPositionInfo[] = []\n items.forEach((node) => {\n const box = getObjectBoundingClientRect(node, this.workspace)\n positioned.push({\n node,\n box,\n })\n const widthX = box.width + box.x\n if (!maxStart || box.x <= maxStart) {\n maxStart = box.x\n }\n if (!maxEnd || widthX >= maxEnd) {\n maxEnd = widthX\n }\n })\n\n const first = positioned.shift()!\n const last = positioned.pop()!\n\n // The first element is to be positioned to the left line.\n notifyMoved(first.node, maxStart - first.box.x, 0)\n // The last element is to be positioned to the right line,\n notifyMoved(last.node, maxEnd - last.box.width - last.box.x, 0)\n // Elements in between to be positioned to the remaining space between the first and the last\n // split into equal sections, and positioned in the middle of each section.\n const distributionLength = maxEnd - last.box.width - (maxStart + first.box.width)\n const boxesLength = positioned.reduce((result, item) => result + item.box.width, 0)\n const spaceAvailable = distributionLength - boxesLength\n const spaceLength = spaceAvailable / (positioned.length + 1)\n let current = maxStart + first.box.width\n positioned.forEach((item) => {\n const { node, box } = item\n const newX = current + spaceLength\n const dx = newX - box.x\n current += spaceLength + box.width\n if (dx !== 0) {\n notifyMoved(node, dx, 0)\n }\n })\n }\n}\n"]}
@@ -1,104 +0,0 @@
1
- import VizWorkspaceElement from '../elements/VizWorkspaceElement.js';
2
- declare const mousePortioningValue: unique symbol;
3
- declare const setupMousePositioning: unique symbol;
4
- declare const disableMousePositioning: unique symbol;
5
- declare const mouseMoveHandler: unique symbol;
6
- declare const mousePositionAnchor: unique symbol;
7
- declare const workspacePositioningValue: unique symbol;
8
- declare const setupWorkspacePositioning: unique symbol;
9
- declare const disableWorkspacePositioning: unique symbol;
10
- declare const mutationHandler: unique symbol;
11
- declare const mutationObserver: unique symbol;
12
- declare const observeItems: unique symbol;
13
- declare const processAddedNodes: unique symbol;
14
- declare const processRemovedNodes: unique symbol;
15
- declare const updateVisualizationItem: unique symbol;
16
- declare const positionedElements: unique symbol;
17
- declare const scrollHandler: unique symbol;
18
- declare const scrollTimeout: unique symbol;
19
- declare const onScroll: unique symbol;
20
- declare const createPositioningInfoElement: unique symbol;
21
- declare const ensurePositioningInfoElement: unique symbol;
22
- declare const updatePositioningInfoElement: unique symbol;
23
- /**
24
- * Debugging helpers for the visualization workspace.
25
- */
26
- export declare class WorkspaceDebugging {
27
- workspace: VizWorkspaceElement;
28
- [mousePortioningValue]: boolean;
29
- /**
30
- * @return Whether a mouse position value is rendered in the workspace
31
- */
32
- get mousePositioning(): boolean;
33
- /**
34
- * @param value Whether a mouse position value is rendered in the workspace
35
- */
36
- set mousePositioning(value: boolean);
37
- [workspacePositioningValue]: boolean;
38
- /**
39
- * @return Whether the position of each visualized element is rendered in the workspace
40
- */
41
- get workspacePositioning(): boolean;
42
- set workspacePositioning(value: boolean);
43
- [positionedElements]: WeakMap<HTMLElement, string>;
44
- [mousePositionAnchor]?: HTMLDivElement;
45
- [mutationObserver]?: MutationObserver;
46
- constructor(workspace: VizWorkspaceElement);
47
- [setupMousePositioning](): void;
48
- [disableMousePositioning](): void;
49
- /**
50
- * Redraws the position anchor
51
- */
52
- [mouseMoveHandler](e: MouseEvent): void;
53
- [setupWorkspacePositioning](): void;
54
- [disableWorkspacePositioning](): void;
55
- /**
56
- * Observe items change in the element's light DOM
57
- * @return The observer handler
58
- */
59
- [observeItems](): MutationObserver;
60
- /**
61
- * Processes mutations in the workspace and manages selection state.
62
- * @param mutationsList List of mutations.
63
- */
64
- [mutationHandler](mutationsList: MutationRecord[]): void;
65
- /**
66
- * Processes added to the canvas elements.
67
- * @param nodes The list of added nodes
68
- */
69
- [processAddedNodes](nodes: NodeList): void;
70
- isVisualizedObject(element: Element): boolean;
71
- /**
72
- * Processes removed from the canvas elements.
73
- * @param nodes The list of removed nodes
74
- */
75
- [processRemovedNodes](nodes: NodeList): void;
76
- [updateVisualizationItem](node: Node): void;
77
- /**
78
- * Ensures that element that is positioned relative to each visualized item exists.
79
- */
80
- [ensurePositioningInfoElement](targetElement: HTMLElement): void;
81
- /**
82
- * Creates an element that is positioned relative to each visualized item.
83
- * @param {HTMLElement} targetElement
84
- * @returns {HTMLDivElement}
85
- */
86
- [createPositioningInfoElement](targetElement: HTMLElement): HTMLDivElement;
87
- /**
88
- * Updates the position of the visualized element position label
89
- * @param {HTMLElement} targetElement
90
- * @param {DOMRect} rect
91
- */
92
- [updatePositioningInfoElement](targetElement: HTMLElement, rect: DOMRect): void;
93
- [scrollTimeout]?: number;
94
- /**
95
- * Updates the labels on each visualized item after the workspace scroll
96
- */
97
- [scrollHandler](): void;
98
- /**
99
- * Updates the labels on each visualized item after the workspace scroll
100
- */
101
- [onScroll](): void;
102
- }
103
- export {};
104
- //# sourceMappingURL=WorkspaceDebugging.d.ts.map