@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.
- package/.vscode/settings.json +3 -3
- package/build/src/elements/authorization/ui/ApiKeyAuthorization.d.ts +1 -1
- package/build/src/elements/authorization/ui/ApiKeyAuthorization.d.ts.map +1 -1
- package/build/src/elements/authorization/ui/ApiKeyAuthorization.js +7 -7
- package/build/src/elements/authorization/ui/ApiKeyAuthorization.js.map +1 -1
- package/build/src/elements/authorization/ui/Authorization.styles.js +4 -4
- package/build/src/elements/authorization/ui/Authorization.styles.js.map +1 -1
- package/build/src/elements/authorization/ui/BasicAuthorization.d.ts +1 -1
- package/build/src/elements/authorization/ui/BasicAuthorization.d.ts.map +1 -1
- package/build/src/elements/authorization/ui/BasicAuthorization.js +5 -5
- package/build/src/elements/authorization/ui/BasicAuthorization.js.map +1 -1
- package/build/src/elements/authorization/ui/BearerAuthorization.d.ts +1 -1
- package/build/src/elements/authorization/ui/BearerAuthorization.d.ts.map +1 -1
- package/build/src/elements/authorization/ui/BearerAuthorization.js +3 -3
- package/build/src/elements/authorization/ui/BearerAuthorization.js.map +1 -1
- package/build/src/elements/authorization/ui/NtlmAuthorization.d.ts +1 -1
- package/build/src/elements/authorization/ui/NtlmAuthorization.d.ts.map +1 -1
- package/build/src/elements/authorization/ui/NtlmAuthorization.js +7 -7
- package/build/src/elements/authorization/ui/NtlmAuthorization.js.map +1 -1
- package/build/src/elements/authorization/ui/OAuth2Authorization.d.ts +1 -1
- package/build/src/elements/authorization/ui/OAuth2Authorization.d.ts.map +1 -1
- package/build/src/elements/authorization/ui/OAuth2Authorization.js +32 -27
- package/build/src/elements/authorization/ui/OAuth2Authorization.js.map +1 -1
- package/build/src/elements/authorization/ui/OidcAuthorization.js +4 -4
- package/build/src/elements/authorization/ui/OidcAuthorization.js.map +1 -1
- package/build/src/elements/autocomplete/autocomplete-input.d.ts +10 -0
- package/build/src/elements/autocomplete/autocomplete-input.d.ts.map +1 -0
- package/build/src/{md/text-field/ui-text-field.js → elements/autocomplete/autocomplete-input.js} +9 -9
- package/build/src/elements/autocomplete/autocomplete-input.js.map +1 -0
- package/build/src/elements/autocomplete/internals/autocomplete.d.ts +209 -0
- package/build/src/elements/autocomplete/internals/autocomplete.d.ts.map +1 -0
- package/build/src/elements/autocomplete/internals/autocomplete.js +493 -0
- package/build/src/elements/autocomplete/internals/autocomplete.js.map +1 -0
- package/build/src/elements/autocomplete/internals/autocomplete.styles.d.ts +3 -0
- package/build/src/elements/autocomplete/internals/autocomplete.styles.d.ts.map +1 -0
- package/build/src/elements/autocomplete/internals/autocomplete.styles.js +25 -0
- package/build/src/elements/autocomplete/internals/autocomplete.styles.js.map +1 -0
- package/build/src/elements/dialog/internals/DeleteCookieAction.element.d.ts +1 -1
- package/build/src/elements/dialog/internals/DeleteCookieAction.element.d.ts.map +1 -1
- package/build/src/elements/dialog/internals/DeleteCookieAction.element.js +5 -5
- package/build/src/elements/dialog/internals/DeleteCookieAction.element.js.map +1 -1
- package/build/src/elements/dialog/internals/Rename.d.ts +1 -1
- package/build/src/elements/dialog/internals/Rename.d.ts.map +1 -1
- package/build/src/elements/dialog/internals/Rename.js +3 -3
- package/build/src/elements/dialog/internals/Rename.js.map +1 -1
- package/build/src/elements/dialog/internals/SetCookieAction.element.d.ts +1 -1
- package/build/src/elements/dialog/internals/SetCookieAction.element.d.ts.map +1 -1
- package/build/src/elements/dialog/internals/SetCookieAction.element.js +9 -9
- package/build/src/elements/dialog/internals/SetCookieAction.element.js.map +1 -1
- package/build/src/elements/environment/EnvironmentEditor.d.ts +1 -1
- package/build/src/elements/environment/EnvironmentEditor.d.ts.map +1 -1
- package/build/src/elements/environment/EnvironmentEditor.js +3 -3
- package/build/src/elements/environment/EnvironmentEditor.js.map +1 -1
- package/build/src/elements/environment/EnvironmentEditor.styles.js +1 -1
- package/build/src/elements/environment/EnvironmentEditor.styles.js.map +1 -1
- package/build/src/elements/environment/ServerEditor.d.ts +1 -1
- package/build/src/elements/environment/ServerEditor.d.ts.map +1 -1
- package/build/src/elements/environment/ServerEditor.js +7 -7
- package/build/src/elements/environment/ServerEditor.js.map +1 -1
- package/build/src/elements/environment/ServerEditor.styles.js +1 -1
- package/build/src/elements/environment/ServerEditor.styles.js.map +1 -1
- package/build/src/elements/http/BodyMultipartEditor.d.ts.map +1 -1
- package/build/src/elements/http/BodyMultipartEditor.js +4 -0
- package/build/src/elements/http/BodyMultipartEditor.js.map +1 -1
- package/build/src/elements/http/CertificateAdd.element.d.ts +1 -1
- package/build/src/elements/http/CertificateAdd.element.d.ts.map +1 -1
- package/build/src/elements/http/CertificateAdd.element.js +8 -8
- package/build/src/elements/http/CertificateAdd.element.js.map +1 -1
- package/build/src/elements/http/CertificateAdd.styles.js +1 -1
- package/build/src/elements/http/CertificateAdd.styles.js.map +1 -1
- package/build/src/elements/http/HttpAssertions.element.js +3 -3
- package/build/src/elements/http/HttpAssertions.element.js.map +1 -1
- package/build/src/elements/http/HttpFlows.element.js +3 -3
- package/build/src/elements/http/HttpFlows.element.js.map +1 -1
- package/build/src/elements/http/HttpFlowsUi.d.ts +1 -1
- package/build/src/elements/http/HttpFlowsUi.d.ts.map +1 -1
- package/build/src/elements/http/HttpFlowsUi.js +31 -31
- package/build/src/elements/http/HttpFlowsUi.js.map +1 -1
- package/build/src/elements/http/RequestConfigElement.d.ts +1 -1
- package/build/src/elements/http/RequestConfigElement.d.ts.map +1 -1
- package/build/src/elements/http/RequestConfigElement.js +7 -7
- package/build/src/elements/http/RequestConfigElement.js.map +1 -1
- package/build/src/elements/http/UrlParamsForm.d.ts +1 -1
- package/build/src/elements/http/UrlParamsForm.d.ts.map +1 -1
- package/build/src/elements/http/UrlParamsForm.js +1 -1
- package/build/src/elements/http/UrlParamsForm.js.map +1 -1
- package/build/src/elements/project/ProjectRunner.d.ts +1 -1
- package/build/src/elements/project/ProjectRunner.d.ts.map +1 -1
- package/build/src/elements/project/ProjectRunner.js +5 -5
- package/build/src/elements/project/ProjectRunner.js.map +1 -1
- package/build/src/md/input/Input.d.ts +0 -15
- package/build/src/md/input/Input.d.ts.map +1 -1
- package/build/src/md/input/Input.js +7 -42
- package/build/src/md/input/Input.js.map +1 -1
- package/build/src/md/list/internals/List.d.ts +7 -2
- package/build/src/md/list/internals/List.d.ts.map +1 -1
- package/build/src/md/list/internals/List.js +6 -0
- package/build/src/md/list/internals/List.js.map +1 -1
- package/build/src/md/list/internals/ListItem.styles.d.ts.map +1 -1
- package/build/src/md/list/internals/ListItem.styles.js +8 -0
- package/build/src/md/list/internals/ListItem.styles.js.map +1 -1
- package/build/src/md/listbox/internals/Listbox.d.ts +2 -2
- package/build/src/md/listbox/internals/Listbox.d.ts.map +1 -1
- package/build/src/md/listbox/internals/Listbox.js.map +1 -1
- package/build/src/md/text-area/internals/TextAreaElement.d.ts.map +1 -1
- package/build/src/md/text-area/internals/TextAreaElement.js +0 -5
- package/build/src/md/text-area/internals/TextAreaElement.js.map +1 -1
- package/build/src/md/text-area/ui-text-area.d.ts.map +1 -1
- package/build/src/md/text-area/ui-text-area.js +3 -2
- package/build/src/md/text-area/ui-text-area.js.map +1 -1
- package/build/src/md/text-field/internals/{TextFieldElement.d.ts → TextField.d.ts} +2 -2
- package/build/src/md/text-field/internals/TextField.d.ts.map +1 -0
- package/build/src/md/text-field/internals/{TextFieldElement.js → TextField.js} +2 -5
- package/build/src/md/text-field/internals/TextField.js.map +1 -0
- package/build/src/{visualization/elements/WorkspaceStyles.d.ts → md/text-field/internals/common.styles.d.ts} +1 -1
- package/build/src/md/text-field/internals/common.styles.d.ts.map +1 -0
- package/build/src/md/text-field/internals/{TextField.styles.js → common.styles.js} +8 -94
- package/build/src/md/text-field/internals/common.styles.js.map +1 -0
- package/build/src/md/text-field/internals/{TextField.styles.d.ts → filled.styles.d.ts} +1 -1
- package/build/src/md/text-field/internals/filled.styles.d.ts.map +1 -0
- package/build/src/md/text-field/internals/filled.styles.js +107 -0
- package/build/src/md/text-field/internals/filled.styles.js.map +1 -0
- package/build/src/md/text-field/internals/outlined.styles.d.ts +3 -0
- package/build/src/md/text-field/internals/outlined.styles.d.ts.map +1 -0
- package/build/src/md/text-field/internals/outlined.styles.js +43 -0
- package/build/src/md/text-field/internals/outlined.styles.js.map +1 -0
- package/build/src/md/text-field/ui-filled-text-field.d.ts +11 -0
- package/build/src/md/text-field/ui-filled-text-field.d.ts.map +1 -0
- package/build/src/md/text-field/ui-filled-text-field.js +28 -0
- package/build/src/md/text-field/ui-filled-text-field.js.map +1 -0
- package/build/src/md/text-field/ui-outlined-text-field.d.ts +11 -0
- package/build/src/md/text-field/ui-outlined-text-field.d.ts.map +1 -0
- package/build/src/md/text-field/ui-outlined-text-field.js +28 -0
- package/build/src/md/text-field/ui-outlined-text-field.js.map +1 -0
- package/build/src/types/input.d.ts +1 -1
- package/build/src/types/input.d.ts.map +1 -1
- package/build/src/types/input.js.map +1 -1
- package/demo/elements/authorization/oauth-authorize.html +4 -4
- package/demo/elements/authorization/oauth-authorize.ts +1 -1
- package/demo/elements/autocomplete/index.html +24 -0
- package/demo/elements/autocomplete/index.ts +123 -0
- package/demo/elements/http/body-editor.ts +3 -3
- package/demo/elements/index.html +15 -11
- package/demo/md/index.html +1 -1
- package/demo/md/inputs/input.html +10 -15
- package/demo/md/inputs/input.ts +389 -101
- package/demo/page.css +4 -0
- package/package.json +7 -2
- package/src/elements/authorization/ui/ApiKeyAuthorization.ts +7 -7
- package/src/elements/authorization/ui/Authorization.styles.ts +4 -4
- package/src/elements/authorization/ui/BasicAuthorization.ts +5 -5
- package/src/elements/authorization/ui/BearerAuthorization.ts +3 -3
- package/src/elements/authorization/ui/NtlmAuthorization.ts +7 -7
- package/src/elements/authorization/ui/OAuth2Authorization.ts +32 -27
- package/src/elements/authorization/ui/OidcAuthorization.ts +4 -4
- package/src/elements/autocomplete/autocomplete-input.ts +14 -0
- package/src/elements/autocomplete/internals/autocomplete.styles.ts +25 -0
- package/src/elements/autocomplete/internals/autocomplete.ts +490 -0
- package/src/elements/dialog/internals/DeleteCookieAction.element.ts +5 -5
- package/src/elements/dialog/internals/Rename.ts +3 -3
- package/src/elements/dialog/internals/SetCookieAction.element.ts +9 -9
- package/src/elements/environment/EnvironmentEditor.styles.ts +1 -1
- package/src/elements/environment/EnvironmentEditor.ts +3 -3
- package/src/elements/environment/ServerEditor.styles.ts +1 -1
- package/src/elements/environment/ServerEditor.ts +7 -7
- package/src/elements/http/BodyMultipartEditor.ts +4 -0
- package/src/elements/http/CertificateAdd.element.ts +8 -8
- package/src/elements/http/CertificateAdd.styles.ts +1 -1
- package/src/elements/http/HttpAssertions.element.ts +3 -3
- package/src/elements/http/HttpFlows.element.ts +3 -3
- package/src/elements/http/HttpFlowsUi.ts +31 -31
- package/src/elements/http/RequestConfigElement.ts +7 -7
- package/src/elements/http/UrlParamsForm.ts +1 -1
- package/src/elements/project/ProjectRunner.ts +5 -5
- package/src/md/input/Input.ts +6 -21
- package/src/md/list/internals/List.ts +14 -2
- package/src/md/list/internals/ListItem.styles.ts +8 -0
- package/src/md/listbox/internals/Listbox.ts +2 -2
- package/src/md/text-area/internals/TextAreaElement.ts +0 -5
- package/src/md/text-area/ui-text-area.ts +3 -2
- package/src/md/text-field/internals/{TextFieldElement.ts → TextField.ts} +1 -4
- package/src/md/text-field/internals/{TextField.styles.ts → common.styles.ts} +7 -93
- package/src/md/text-field/internals/filled.styles.ts +107 -0
- package/src/md/text-field/internals/outlined.styles.ts +43 -0
- package/src/md/text-field/ui-filled-text-field.ts +16 -0
- package/src/md/text-field/ui-outlined-text-field.ts +16 -0
- package/src/types/input.ts +0 -1
- package/test/elements/authorization/basic-method.test.ts +3 -3
- package/test/elements/authorization/bearer-method.test.ts +2 -2
- package/test/elements/authorization/ntlm-method.test.ts +4 -4
- package/test/elements/autocomplete/autocomplete-input.spec.ts +448 -0
- package/test/elements/http/BodyMultipartEditorElement.test.ts +15 -16
- package/test/elements/http/CertificateAdd.test.ts +11 -11
- package/test/elements/http/HttpAssertions.test.ts +9 -9
- package/test/elements/http/HttpFlows.test.ts +4 -4
- package/test/env.ts +15 -0
- package/test/tsconfig.json +1 -7
- package/web-test-runner.config.js +5 -1
- package/build/src/md/text-field/internals/TextField.styles.d.ts.map +0 -1
- package/build/src/md/text-field/internals/TextField.styles.js.map +0 -1
- package/build/src/md/text-field/internals/TextFieldElement.d.ts.map +0 -1
- package/build/src/md/text-field/internals/TextFieldElement.js.map +0 -1
- package/build/src/md/text-field/ui-text-field.d.ts +0 -11
- package/build/src/md/text-field/ui-text-field.d.ts.map +0 -1
- package/build/src/md/text-field/ui-text-field.js.map +0 -1
- package/build/src/visualization/elements/VizAssociationElement.d.ts +0 -4
- package/build/src/visualization/elements/VizAssociationElement.d.ts.map +0 -1
- package/build/src/visualization/elements/VizAssociationElement.js +0 -4
- package/build/src/visualization/elements/VizAssociationElement.js.map +0 -1
- package/build/src/visualization/elements/VizWorkspaceElement.d.ts +0 -110
- package/build/src/visualization/elements/VizWorkspaceElement.d.ts.map +0 -1
- package/build/src/visualization/elements/VizWorkspaceElement.js +0 -321
- package/build/src/visualization/elements/VizWorkspaceElement.js.map +0 -1
- package/build/src/visualization/elements/WorkspaceStyles.d.ts.map +0 -1
- package/build/src/visualization/elements/WorkspaceStyles.js +0 -168
- package/build/src/visualization/elements/WorkspaceStyles.js.map +0 -1
- package/build/src/visualization/lib/AnchorFinder.d.ts +0 -64
- package/build/src/visualization/lib/AnchorFinder.d.ts.map +0 -1
- package/build/src/visualization/lib/AnchorFinder.js +0 -107
- package/build/src/visualization/lib/AnchorFinder.js.map +0 -1
- package/build/src/visualization/lib/AnchorUtils.d.ts +0 -10
- package/build/src/visualization/lib/AnchorUtils.d.ts.map +0 -1
- package/build/src/visualization/lib/AnchorUtils.js +0 -44
- package/build/src/visualization/lib/AnchorUtils.js.map +0 -1
- package/build/src/visualization/lib/AssociationAnchors.d.ts +0 -134
- package/build/src/visualization/lib/AssociationAnchors.d.ts.map +0 -1
- package/build/src/visualization/lib/AssociationAnchors.js +0 -351
- package/build/src/visualization/lib/AssociationAnchors.js.map +0 -1
- package/build/src/visualization/lib/LabelSketch.d.ts +0 -16
- package/build/src/visualization/lib/LabelSketch.d.ts.map +0 -1
- package/build/src/visualization/lib/LabelSketch.js +0 -53
- package/build/src/visualization/lib/LabelSketch.js.map +0 -1
- package/build/src/visualization/lib/LineSketch.d.ts +0 -26
- package/build/src/visualization/lib/LineSketch.d.ts.map +0 -1
- package/build/src/visualization/lib/LineSketch.js +0 -55
- package/build/src/visualization/lib/LineSketch.js.map +0 -1
- package/build/src/visualization/lib/Point.d.ts +0 -74
- package/build/src/visualization/lib/Point.d.ts.map +0 -1
- package/build/src/visualization/lib/Point.js +0 -121
- package/build/src/visualization/lib/Point.js.map +0 -1
- package/build/src/visualization/lib/PositionUtils.d.ts +0 -65
- package/build/src/visualization/lib/PositionUtils.d.ts.map +0 -1
- package/build/src/visualization/lib/PositionUtils.js +0 -205
- package/build/src/visualization/lib/PositionUtils.js.map +0 -1
- package/build/src/visualization/lib/SelectionManager.d.ts +0 -183
- package/build/src/visualization/lib/SelectionManager.d.ts.map +0 -1
- package/build/src/visualization/lib/SelectionManager.js +0 -481
- package/build/src/visualization/lib/SelectionManager.js.map +0 -1
- package/build/src/visualization/lib/ShapeArtist.d.ts +0 -45
- package/build/src/visualization/lib/ShapeArtist.d.ts.map +0 -1
- package/build/src/visualization/lib/ShapeArtist.js +0 -209
- package/build/src/visualization/lib/ShapeArtist.js.map +0 -1
- package/build/src/visualization/lib/SvgMarkers.d.ts +0 -14
- package/build/src/visualization/lib/SvgMarkers.d.ts.map +0 -1
- package/build/src/visualization/lib/SvgMarkers.js +0 -77
- package/build/src/visualization/lib/SvgMarkers.js.map +0 -1
- package/build/src/visualization/lib/TipSketch.d.ts +0 -26
- package/build/src/visualization/lib/TipSketch.d.ts.map +0 -1
- package/build/src/visualization/lib/TipSketch.js +0 -77
- package/build/src/visualization/lib/TipSketch.js.map +0 -1
- package/build/src/visualization/lib/TouchSupport.d.ts +0 -14
- package/build/src/visualization/lib/TouchSupport.d.ts.map +0 -1
- package/build/src/visualization/lib/TouchSupport.js +0 -55
- package/build/src/visualization/lib/TouchSupport.js.map +0 -1
- package/build/src/visualization/lib/Utils.d.ts +0 -25
- package/build/src/visualization/lib/Utils.d.ts.map +0 -1
- package/build/src/visualization/lib/Utils.js +0 -59
- package/build/src/visualization/lib/Utils.js.map +0 -1
- package/build/src/visualization/lib/VisualizationTypes.d.ts +0 -216
- package/build/src/visualization/lib/VisualizationTypes.d.ts.map +0 -1
- package/build/src/visualization/lib/VisualizationTypes.js +0 -3
- package/build/src/visualization/lib/VisualizationTypes.js.map +0 -1
- package/build/src/visualization/lib/WorkspaceAlignment.d.ts +0 -51
- package/build/src/visualization/lib/WorkspaceAlignment.d.ts.map +0 -1
- package/build/src/visualization/lib/WorkspaceAlignment.js +0 -243
- package/build/src/visualization/lib/WorkspaceAlignment.js.map +0 -1
- package/build/src/visualization/lib/WorkspaceDebugging.d.ts +0 -104
- package/build/src/visualization/lib/WorkspaceDebugging.d.ts.map +0 -1
- package/build/src/visualization/lib/WorkspaceDebugging.js +0 -286
- package/build/src/visualization/lib/WorkspaceDebugging.js.map +0 -1
- package/build/src/visualization/lib/WorkspaceEdges.d.ts +0 -293
- package/build/src/visualization/lib/WorkspaceEdges.d.ts.map +0 -1
- package/build/src/visualization/lib/WorkspaceEdges.js +0 -1073
- package/build/src/visualization/lib/WorkspaceEdges.js.map +0 -1
- package/build/src/visualization/lib/WorkspaceGestures.d.ts +0 -119
- package/build/src/visualization/lib/WorkspaceGestures.d.ts.map +0 -1
- package/build/src/visualization/lib/WorkspaceGestures.js +0 -376
- package/build/src/visualization/lib/WorkspaceGestures.js.map +0 -1
- package/build/src/visualization/lib/WorkspaceSizing.d.ts +0 -66
- package/build/src/visualization/lib/WorkspaceSizing.d.ts.map +0 -1
- package/build/src/visualization/lib/WorkspaceSizing.js +0 -168
- package/build/src/visualization/lib/WorkspaceSizing.js.map +0 -1
- package/build/src/visualization/lib/lines/RectilinearLine.d.ts +0 -114
- package/build/src/visualization/lib/lines/RectilinearLine.d.ts.map +0 -1
- package/build/src/visualization/lib/lines/RectilinearLine.js +0 -605
- package/build/src/visualization/lib/lines/RectilinearLine.js.map +0 -1
- package/build/src/visualization/lib/tips/RectilinearTip.d.ts +0 -26
- package/build/src/visualization/lib/tips/RectilinearTip.d.ts.map +0 -1
- package/build/src/visualization/lib/tips/RectilinearTip.js +0 -149
- package/build/src/visualization/lib/tips/RectilinearTip.js.map +0 -1
- package/build/src/visualization/lib/tips/TipArtist.d.ts +0 -22
- package/build/src/visualization/lib/tips/TipArtist.d.ts.map +0 -1
- package/build/src/visualization/lib/tips/TipArtist.js +0 -31
- package/build/src/visualization/lib/tips/TipArtist.js.map +0 -1
- package/build/src/visualization/lib/types.d.ts +0 -164
- package/build/src/visualization/lib/types.d.ts.map +0 -1
- package/build/src/visualization/lib/types.js +0 -2
- package/build/src/visualization/lib/types.js.map +0 -1
- package/build/src/visualization/plugin/dnd/DragAndDropPlugin.d.ts +0 -126
- package/build/src/visualization/plugin/dnd/DragAndDropPlugin.d.ts.map +0 -1
- package/build/src/visualization/plugin/dnd/DragAndDropPlugin.js +0 -260
- package/build/src/visualization/plugin/dnd/DragAndDropPlugin.js.map +0 -1
- package/build/src/visualization/plugin/group-selection/GroupSelection.d.ts +0 -93
- package/build/src/visualization/plugin/group-selection/GroupSelection.d.ts.map +0 -1
- package/build/src/visualization/plugin/group-selection/GroupSelection.js +0 -250
- package/build/src/visualization/plugin/group-selection/GroupSelection.js.map +0 -1
- package/build/src/visualization/plugin/positioning/DataModelLayout.d.ts +0 -10
- package/build/src/visualization/plugin/positioning/DataModelLayout.d.ts.map +0 -1
- package/build/src/visualization/plugin/positioning/DataModelLayout.js +0 -105
- package/build/src/visualization/plugin/positioning/DataModelLayout.js.map +0 -1
- package/build/src/visualization/plugin/positioning/WorkspaceLayout.d.ts +0 -93
- package/build/src/visualization/plugin/positioning/WorkspaceLayout.d.ts.map +0 -1
- package/build/src/visualization/plugin/positioning/WorkspaceLayout.js +0 -96
- package/build/src/visualization/plugin/positioning/WorkspaceLayout.js.map +0 -1
- package/build/src/visualization/viz-association.d.ts +0 -7
- package/build/src/visualization/viz-association.d.ts.map +0 -1
- package/build/src/visualization/viz-association.js +0 -3
- package/build/src/visualization/viz-association.js.map +0 -1
- package/build/src/visualization/viz-workspace.d.ts +0 -7
- package/build/src/visualization/viz-workspace.d.ts.map +0 -1
- package/build/src/visualization/viz-workspace.js +0 -3
- package/build/src/visualization/viz-workspace.js.map +0 -1
- package/src/md/text-field/ui-text-field.ts +0 -15
- package/src/visualization/elements/VizAssociationElement.ts +0 -3
- package/src/visualization/elements/VizWorkspaceElement.ts +0 -302
- package/src/visualization/elements/WorkspaceStyles.ts +0 -168
- package/src/visualization/lib/AnchorFinder.ts +0 -112
- package/src/visualization/lib/AnchorUtils.ts +0 -53
- package/src/visualization/lib/AssociationAnchors.ts +0 -418
- package/src/visualization/lib/LabelSketch.ts +0 -67
- package/src/visualization/lib/LineSketch.ts +0 -62
- package/src/visualization/lib/Point.ts +0 -134
- package/src/visualization/lib/PositionUtils.ts +0 -218
- package/src/visualization/lib/SelectionManager.ts +0 -513
- package/src/visualization/lib/ShapeArtist.ts +0 -222
- package/src/visualization/lib/SvgMarkers.ts +0 -80
- package/src/visualization/lib/TipSketch.ts +0 -91
- package/src/visualization/lib/TouchSupport.ts +0 -72
- package/src/visualization/lib/Utils.ts +0 -63
- package/src/visualization/lib/VisualizationTypes.ts +0 -232
- package/src/visualization/lib/WorkspaceAlignment.ts +0 -261
- package/src/visualization/lib/WorkspaceDebugging.ts +0 -313
- package/src/visualization/lib/WorkspaceEdges.ts +0 -1153
- package/src/visualization/lib/WorkspaceGestures.ts +0 -400
- package/src/visualization/lib/WorkspaceSizing.ts +0 -181
- package/src/visualization/lib/lines/RectilinearLine.ts +0 -589
- package/src/visualization/lib/tips/RectilinearTip.ts +0 -156
- package/src/visualization/lib/tips/TipArtist.ts +0 -34
- package/src/visualization/lib/types.ts +0 -173
- package/src/visualization/plugin/dnd/DragAndDropPlugin.ts +0 -294
- package/src/visualization/plugin/group-selection/GroupSelection.ts +0 -271
- package/src/visualization/plugin/positioning/DataModelLayout.ts +0 -114
- package/src/visualization/plugin/positioning/WorkspaceLayout.ts +0 -149
- package/src/visualization/viz-association.ts +0 -9
- package/src/visualization/viz-workspace.ts +0 -9
- package/test/env.d.ts +0 -9
- package/test/env.js +0 -7
- package/test/visualization/lib/AnchorFinder.test.ts +0 -313
- package/test/visualization/lib/AnchorUtils.test.ts +0 -178
- package/test/visualization/lib/PositionUtils.test.ts +0 -406
- package/test/visualization/lib/test-styles.css +0 -80
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
2
|
-
/* eslint-disable @typescript-eslint/no-extraneous-class */
|
|
3
|
-
import { svg } from 'lit';
|
|
4
|
-
import { classMap } from 'lit/directives/class-map.js';
|
|
5
|
-
import { styleMap } from 'lit/directives/style-map.js';
|
|
6
|
-
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
7
|
-
/**
|
|
8
|
-
* A class that builds templates for lines, tips, and labels.
|
|
9
|
-
*/
|
|
10
|
-
export class ShapeArtist {
|
|
11
|
-
/**
|
|
12
|
-
* @param info The definition of the line to visualize
|
|
13
|
-
* @param debug Whether debugging is enabled.
|
|
14
|
-
* @return The template for an association line
|
|
15
|
-
*/
|
|
16
|
-
static line(info, debug = false) {
|
|
17
|
-
const { line } = info.shape;
|
|
18
|
-
switch (line.type) {
|
|
19
|
-
case 'rectilinear':
|
|
20
|
-
return ShapeArtist.rectilinearLine(info, debug);
|
|
21
|
-
default:
|
|
22
|
-
return '';
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* @param info The line to visualize
|
|
27
|
-
* @param debug Whether debugging is enabled.
|
|
28
|
-
* @returns The template for an association line
|
|
29
|
-
*/
|
|
30
|
-
static rectilinearLine(info, debug) {
|
|
31
|
-
const { id, shape, directions, positionChange } = info;
|
|
32
|
-
const { line, label, tips, selection = {}, style } = shape;
|
|
33
|
-
const { transformOrigin, coordinates, path, controlPoints, type } = line;
|
|
34
|
-
const groupStyle = {
|
|
35
|
-
transformOrigin,
|
|
36
|
-
};
|
|
37
|
-
const groupClass = {
|
|
38
|
-
'selected': !!selection.primary,
|
|
39
|
-
'selectedSecondary': !!selection.secondary,
|
|
40
|
-
'hovered': !!selection.hover,
|
|
41
|
-
'hidden': !!selection.hidden,
|
|
42
|
-
'association-group': true,
|
|
43
|
-
};
|
|
44
|
-
if (style) {
|
|
45
|
-
groupClass[style] = true;
|
|
46
|
-
}
|
|
47
|
-
const [startPoint] = coordinates;
|
|
48
|
-
const endPoint = coordinates[coordinates.length - 1];
|
|
49
|
-
return svg `
|
|
50
|
-
<g
|
|
51
|
-
data-id="${id}"
|
|
52
|
-
data-type="association"
|
|
53
|
-
class="${classMap(groupClass)}"
|
|
54
|
-
style="${styleMap(groupStyle)}"
|
|
55
|
-
>
|
|
56
|
-
<circle cx="${startPoint.x}" cy="${startPoint.y}" r="4" class="edge-vertex"/>
|
|
57
|
-
<circle cx="${endPoint.x}" cy="${endPoint.y}" r="4" class="edge-vertex"/>
|
|
58
|
-
<polyline
|
|
59
|
-
points="${path}"
|
|
60
|
-
class="association-line-area"
|
|
61
|
-
data-type="association"
|
|
62
|
-
data-id="${id}"
|
|
63
|
-
/>
|
|
64
|
-
<polyline
|
|
65
|
-
points="${path}"
|
|
66
|
-
class="association-line"
|
|
67
|
-
data-type="association"
|
|
68
|
-
data-id="${id}"
|
|
69
|
-
/>
|
|
70
|
-
${tips && tips.start ? ShapeArtist.edgeTipTemplate(tips.start) : ''}
|
|
71
|
-
${tips && tips.end ? ShapeArtist.edgeTipTemplate(tips.end) : ''}
|
|
72
|
-
${selection.primary && positionChange ? ShapeArtist.associationDraggable(id, startPoint, endPoint, directions) : ''}
|
|
73
|
-
${debug ? ShapeArtist.controlPointsDebugTemplate(type, startPoint, endPoint, controlPoints) : ''}
|
|
74
|
-
${ShapeArtist.edgeLabelTemplate(label, id)}
|
|
75
|
-
</g>`;
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* @param tip The parent line to visualize
|
|
79
|
-
* @returns The template for the parent line tip
|
|
80
|
-
*/
|
|
81
|
-
static edgeTipTemplate(tip) {
|
|
82
|
-
const { rotate, path, style, transformOrigin, svg: elementType } = tip;
|
|
83
|
-
const transform = `rotate(${rotate}deg)`;
|
|
84
|
-
const styles = {
|
|
85
|
-
transform,
|
|
86
|
-
transformOrigin,
|
|
87
|
-
};
|
|
88
|
-
if (elementType === 'polyline') {
|
|
89
|
-
return svg `
|
|
90
|
-
<polyline
|
|
91
|
-
points="${path}"
|
|
92
|
-
class="edge-tip ${style}"
|
|
93
|
-
style="${styleMap(styles)}"
|
|
94
|
-
/>
|
|
95
|
-
`;
|
|
96
|
-
}
|
|
97
|
-
return svg `
|
|
98
|
-
<polygon
|
|
99
|
-
points="${path}"
|
|
100
|
-
class="edge-tip ${style}"
|
|
101
|
-
style="${styleMap(styles)}"
|
|
102
|
-
/>
|
|
103
|
-
`;
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* @param id The key of the association.
|
|
107
|
-
* @returns The template for the association drag handlers on the tips.
|
|
108
|
-
*/
|
|
109
|
-
static associationDraggable(id, start, end, directions) {
|
|
110
|
-
const size = 12;
|
|
111
|
-
const half = size / 2;
|
|
112
|
-
const padding = 4;
|
|
113
|
-
let sx = start.x;
|
|
114
|
-
let sy = start.y;
|
|
115
|
-
let ex = end.x;
|
|
116
|
-
let ey = end.y;
|
|
117
|
-
if (directions.start === 'west') {
|
|
118
|
-
sx -= size + padding;
|
|
119
|
-
sy -= half;
|
|
120
|
-
}
|
|
121
|
-
else if (directions.start === 'north') {
|
|
122
|
-
sx -= half;
|
|
123
|
-
sy -= size + padding;
|
|
124
|
-
}
|
|
125
|
-
else if (directions.start === 'east') {
|
|
126
|
-
sx += padding;
|
|
127
|
-
sy -= half;
|
|
128
|
-
}
|
|
129
|
-
else {
|
|
130
|
-
sx -= half;
|
|
131
|
-
sy += padding;
|
|
132
|
-
}
|
|
133
|
-
if (directions.end === 'west') {
|
|
134
|
-
ex += padding;
|
|
135
|
-
ey -= half;
|
|
136
|
-
}
|
|
137
|
-
else if (directions.end === 'north') {
|
|
138
|
-
ex -= half;
|
|
139
|
-
ey -= size + padding;
|
|
140
|
-
}
|
|
141
|
-
else if (directions.end === 'east') {
|
|
142
|
-
ex -= size + padding;
|
|
143
|
-
ey -= half;
|
|
144
|
-
}
|
|
145
|
-
else {
|
|
146
|
-
ex -= half;
|
|
147
|
-
ey += padding;
|
|
148
|
-
}
|
|
149
|
-
return svg `
|
|
150
|
-
<rect x="${sx}" y="${sy}" width="${size}" height="${size}" rx="3" data-key="${id}" data-dir="start" class="association-draggable"/>
|
|
151
|
-
<rect x="${ex}" y="${ey}" width="${size}" height="${size}" rx="3" data-key="${id}" data-dir="end" class="association-draggable"/>
|
|
152
|
-
`;
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* @param parentId The association key
|
|
156
|
-
* @returns The template for a text label for an association
|
|
157
|
-
*/
|
|
158
|
-
static edgeLabelTemplate(label, parentId) {
|
|
159
|
-
if (!label || !label.value) {
|
|
160
|
-
return '';
|
|
161
|
-
}
|
|
162
|
-
const { value, transformOrigin, rotate, x, y, anchor } = label;
|
|
163
|
-
const transform = `rotate(${rotate}deg)`;
|
|
164
|
-
const textStyles = {
|
|
165
|
-
transform,
|
|
166
|
-
transformOrigin,
|
|
167
|
-
};
|
|
168
|
-
return svg `
|
|
169
|
-
<text
|
|
170
|
-
x="${x}"
|
|
171
|
-
y="${y}"
|
|
172
|
-
data-id="${parentId}"
|
|
173
|
-
style="${styleMap(textStyles)}"
|
|
174
|
-
class="association-label"
|
|
175
|
-
text-anchor=${ifDefined(anchor)}
|
|
176
|
-
>${value}</text>
|
|
177
|
-
`;
|
|
178
|
-
}
|
|
179
|
-
/**
|
|
180
|
-
* Draws a debug control points positions for the given line type.
|
|
181
|
-
* @param start The start of the line
|
|
182
|
-
* @param end The end of the line
|
|
183
|
-
* @param cp Control points on the line
|
|
184
|
-
*/
|
|
185
|
-
static controlPointsDebugTemplate(type, start, end, cp) {
|
|
186
|
-
switch (type) {
|
|
187
|
-
case 'rectilinear':
|
|
188
|
-
return ShapeArtist.rectilinearPathDebugTemplate(start, end, cp);
|
|
189
|
-
default:
|
|
190
|
-
return '';
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
static rectilinearPathDebugTemplate(start, end, controlPoints) {
|
|
194
|
-
if (!controlPoints || !controlPoints.length) {
|
|
195
|
-
return '';
|
|
196
|
-
}
|
|
197
|
-
const [firstCp] = controlPoints;
|
|
198
|
-
const lastCp = controlPoints[controlPoints.length - 1];
|
|
199
|
-
return svg `
|
|
200
|
-
${controlPoints.map((cp, i) => svg `<circle cx="${cp.x}" cy="${cp.y}" r="4" fill="red" title="CP ${i}"/>`)}
|
|
201
|
-
<line x1="${firstCp.x}" y1="${firstCp.y}" x2="${start.x}" y2="${start.y}" style="stroke:red;stroke-width:2;stroke-dasharray: 6;" />
|
|
202
|
-
<line x1="${lastCp.x}" y1="${lastCp.y}" x2="${end.x}" y2="${end.y}" style="stroke:red;stroke-width:2;stroke-dasharray: 6;" />
|
|
203
|
-
|
|
204
|
-
<circle cx="${start.x}" cy="${start.y}" r="4" fill="yellow"/>
|
|
205
|
-
<circle cx="${end.x}" cy="${end.y}" r="4" fill="yellow"/>
|
|
206
|
-
`;
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
//# sourceMappingURL=ShapeArtist.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ShapeArtist.js","sourceRoot":"","sources":["../../../../src/visualization/lib/ShapeArtist.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,2DAA2D;AAC3D,OAAO,EAAE,GAAG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,CAAC,0BAA0B,CAC/B,IAA0B,EAC1B,KAAY,EACZ,GAAU,EACV,EAAW;QAEX,QAAQ,IAAI,EAAE,CAAC;YACb,KAAK,aAAa;gBAChB,OAAO,WAAW,CAAC,4BAA4B,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,CAAA;YACjE;gBACE,OAAO,EAAE,CAAA;QACb,CAAC;IACH,CAAC;IAED,MAAM,CAAC,4BAA4B,CAAC,KAAY,EAAE,GAAU,EAAE,aAAsB;QAClF,IAAI,CAAC,aAAa,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC;YAC5C,OAAO,EAAE,CAAA;QACX,CAAC;QACD,MAAM,CAAC,OAAO,CAAC,GAAG,aAAa,CAAA;QAC/B,MAAM,MAAM,GAAG,aAAa,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;QACtD,OAAO,GAAG,CAAA;MACR,aAAa,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,CAAA,eAAe,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,gCAAgC,CAAC,KAAK,CAAC;gBAC7F,OAAO,CAAC,CAAC,SAAS,OAAO,CAAC,CAAC,SAAS,KAAK,CAAC,CAAC,SAAS,KAAK,CAAC,CAAC;gBAC3D,MAAM,CAAC,CAAC,SAAS,MAAM,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC;;kBAEnD,KAAK,CAAC,CAAC,SAAS,KAAK,CAAC,CAAC;kBACvB,GAAG,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC;KAChC,CAAA;IACH,CAAC;CACF","sourcesContent":["/* eslint-disable @typescript-eslint/no-non-null-assertion */\n/* eslint-disable @typescript-eslint/no-extraneous-class */\nimport { svg, SVGTemplateResult } from 'lit'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { styleMap } from 'lit/directives/style-map.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { IEdgeDirections, IWorkspaceEdge } from './types.js'\nimport {\n IAssociationLabelShape,\n AssociationShapeType,\n IAssociationTip,\n IVisualizationRectilinearLineShape,\n} from './VisualizationTypes.js'\nimport { Point } from './Point.js'\n\n/**\n * A class that builds templates for lines, tips, and labels.\n */\nexport class ShapeArtist {\n /**\n * @param info The definition of the line to visualize\n * @param debug Whether debugging is enabled.\n * @return The template for an association line\n */\n static line(info: IWorkspaceEdge, debug = false): SVGTemplateResult | string {\n const { line } = info.shape\n switch (line.type) {\n case 'rectilinear':\n return ShapeArtist.rectilinearLine(info, debug)\n default:\n return ''\n }\n }\n\n /**\n * @param info The line to visualize\n * @param debug Whether debugging is enabled.\n * @returns The template for an association line\n */\n static rectilinearLine(info: IWorkspaceEdge, debug: boolean): SVGTemplateResult {\n const { id, shape, directions, positionChange } = info\n const { line, label, tips, selection = {}, style } = shape\n const { transformOrigin, coordinates, path, controlPoints, type } = line as IVisualizationRectilinearLineShape\n const groupStyle = {\n transformOrigin,\n }\n const groupClass: Record<string, boolean> = {\n 'selected': !!selection.primary,\n 'selectedSecondary': !!selection.secondary,\n 'hovered': !!selection.hover,\n 'hidden': !!selection.hidden,\n 'association-group': true,\n }\n if (style) {\n groupClass[style] = true\n }\n const [startPoint] = coordinates!\n const endPoint = coordinates![coordinates!.length - 1]\n return svg`\n <g \n data-id=\"${id}\" \n data-type=\"association\" \n class=\"${classMap(groupClass)}\"\n style=\"${styleMap(groupStyle)}\"\n >\n <circle cx=\"${startPoint.x}\" cy=\"${startPoint.y}\" r=\"4\" class=\"edge-vertex\"/>\n <circle cx=\"${endPoint.x}\" cy=\"${endPoint.y}\" r=\"4\" class=\"edge-vertex\"/>\n <polyline \n points=\"${path}\"\n class=\"association-line-area\"\n data-type=\"association\"\n data-id=\"${id}\"\n />\n <polyline \n points=\"${path}\"\n class=\"association-line\"\n data-type=\"association\"\n data-id=\"${id}\"\n />\n ${tips && tips.start ? ShapeArtist.edgeTipTemplate(tips.start) : ''}\n ${tips && tips.end ? ShapeArtist.edgeTipTemplate(tips.end) : ''}\n ${selection.primary && positionChange ? ShapeArtist.associationDraggable(id, startPoint, endPoint, directions) : ''}\n ${debug ? ShapeArtist.controlPointsDebugTemplate(type, startPoint, endPoint, controlPoints) : ''}\n ${ShapeArtist.edgeLabelTemplate(label!, id)}\n </g>`\n }\n\n /**\n * @param tip The parent line to visualize\n * @returns The template for the parent line tip\n */\n static edgeTipTemplate(tip: IAssociationTip): SVGTemplateResult {\n const { rotate, path, style, transformOrigin, svg: elementType } = tip\n const transform = `rotate(${rotate}deg)`\n const styles = {\n transform,\n transformOrigin,\n }\n if (elementType === 'polyline') {\n return svg`\n <polyline\n points=\"${path}\"\n class=\"edge-tip ${style}\"\n style=\"${styleMap(styles)}\"\n />\n `\n }\n return svg`\n <polygon\n points=\"${path}\"\n class=\"edge-tip ${style}\"\n style=\"${styleMap(styles)}\"\n />\n `\n }\n\n /**\n * @param id The key of the association.\n * @returns The template for the association drag handlers on the tips.\n */\n static associationDraggable(id: string, start: Point, end: Point, directions: IEdgeDirections): SVGTemplateResult {\n const size = 12\n const half = size / 2\n const padding = 4\n let sx = start.x\n let sy = start.y\n let ex = end.x\n let ey = end.y\n if (directions.start === 'west') {\n sx -= size + padding\n sy -= half\n } else if (directions.start === 'north') {\n sx -= half\n sy -= size + padding\n } else if (directions.start === 'east') {\n sx += padding\n sy -= half\n } else {\n sx -= half\n sy += padding\n }\n if (directions.end === 'west') {\n ex += padding\n ey -= half\n } else if (directions.end === 'north') {\n ex -= half\n ey -= size + padding\n } else if (directions.end === 'east') {\n ex -= size + padding\n ey -= half\n } else {\n ex -= half\n ey += padding\n }\n return svg`\n <rect x=\"${sx}\" y=\"${sy}\" width=\"${size}\" height=\"${size}\" rx=\"3\" data-key=\"${id}\" data-dir=\"start\" class=\"association-draggable\"/>\n <rect x=\"${ex}\" y=\"${ey}\" width=\"${size}\" height=\"${size}\" rx=\"3\" data-key=\"${id}\" data-dir=\"end\" class=\"association-draggable\"/>\n `\n }\n\n /**\n * @param parentId The association key\n * @returns The template for a text label for an association\n */\n static edgeLabelTemplate(label: IAssociationLabelShape, parentId: string): SVGTemplateResult | string {\n if (!label || !label.value) {\n return ''\n }\n const { value, transformOrigin, rotate, x, y, anchor } = label\n const transform = `rotate(${rotate}deg)`\n const textStyles = {\n transform,\n transformOrigin,\n }\n return svg`\n <text\n x=\"${x}\"\n y=\"${y}\"\n data-id=\"${parentId}\"\n style=\"${styleMap(textStyles)}\"\n class=\"association-label\"\n text-anchor=${ifDefined(anchor)}\n >${value}</text>\n `\n }\n\n /**\n * Draws a debug control points positions for the given line type.\n * @param start The start of the line\n * @param end The end of the line\n * @param cp Control points on the line\n */\n static controlPointsDebugTemplate(\n type: AssociationShapeType,\n start: Point,\n end: Point,\n cp: Point[]\n ): SVGTemplateResult | string {\n switch (type) {\n case 'rectilinear':\n return ShapeArtist.rectilinearPathDebugTemplate(start, end, cp)\n default:\n return ''\n }\n }\n\n static rectilinearPathDebugTemplate(start: Point, end: Point, controlPoints: Point[]): SVGTemplateResult | string {\n if (!controlPoints || !controlPoints.length) {\n return ''\n }\n const [firstCp] = controlPoints\n const lastCp = controlPoints[controlPoints.length - 1]\n return svg`\n ${controlPoints.map((cp, i) => svg`<circle cx=\"${cp.x}\" cy=\"${cp.y}\" r=\"4\" fill=\"red\" title=\"CP ${i}\"/>`)}\n <line x1=\"${firstCp.x}\" y1=\"${firstCp.y}\" x2=\"${start.x}\" y2=\"${start.y}\" style=\"stroke:red;stroke-width:2;stroke-dasharray: 6;\" />\n <line x1=\"${lastCp.x}\" y1=\"${lastCp.y}\" x2=\"${end.x}\" y2=\"${end.y}\" style=\"stroke:red;stroke-width:2;stroke-dasharray: 6;\" />\n\n <circle cx=\"${start.x}\" cy=\"${start.y}\" r=\"4\" fill=\"yellow\"/>\n <circle cx=\"${end.x}\" cy=\"${end.y}\" r=\"4\" fill=\"yellow\"/>\n `\n }\n}\n"]}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export declare const markerStyles: import("lit").CSSResult;
|
|
2
|
-
/**
|
|
3
|
-
* A template for the parent entity marker
|
|
4
|
-
*/
|
|
5
|
-
export declare const parentEntityMaker: import("lit-html").TemplateResult<2>;
|
|
6
|
-
/**
|
|
7
|
-
* A template for the operation parameter in marker
|
|
8
|
-
*/
|
|
9
|
-
export declare const parameterInMaker: import("lit-html").TemplateResult<2>;
|
|
10
|
-
/**
|
|
11
|
-
* A template for the operation parameter out marker
|
|
12
|
-
*/
|
|
13
|
-
export declare const parameterOutMaker: import("lit-html").TemplateResult<2>;
|
|
14
|
-
//# sourceMappingURL=SvgMarkers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SvgMarkers.d.ts","sourceRoot":"","sources":["../../../../src/visualization/lib/SvgMarkers.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,yBAoBxB,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB,sCAc7B,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB,sCAc5B,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB,sCAc7B,CAAA"}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { svg, css } from 'lit';
|
|
2
|
-
export const markerStyles = css `
|
|
3
|
-
.parent-marker {
|
|
4
|
-
fill: #90a4ae;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.parameter-in polyline {
|
|
8
|
-
stroke: #ff9e91;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.parameter-in-marker {
|
|
12
|
-
fill: #ff9e91;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.parameter-out polyline {
|
|
16
|
-
stroke: #fbc02d;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.parameter-out-marker {
|
|
20
|
-
fill: #fbc02d;
|
|
21
|
-
}
|
|
22
|
-
`;
|
|
23
|
-
/**
|
|
24
|
-
* A template for the parent entity marker
|
|
25
|
-
*/
|
|
26
|
-
export const parentEntityMaker = svg `
|
|
27
|
-
<marker
|
|
28
|
-
id="parent"
|
|
29
|
-
class="parent-marker"
|
|
30
|
-
viewBox="0 0 20 20"
|
|
31
|
-
refX="10"
|
|
32
|
-
refY="5"
|
|
33
|
-
markerWidth="32"
|
|
34
|
-
markerHeight="32"
|
|
35
|
-
orient="auto-start-reverse"
|
|
36
|
-
markerUnits="userSpaceOnUse"
|
|
37
|
-
>
|
|
38
|
-
<path d="M 0 0 L 10 5 L 0 10 z" />
|
|
39
|
-
</marker>
|
|
40
|
-
`;
|
|
41
|
-
/**
|
|
42
|
-
* A template for the operation parameter in marker
|
|
43
|
-
*/
|
|
44
|
-
export const parameterInMaker = svg `
|
|
45
|
-
<marker
|
|
46
|
-
id="parameterIn"
|
|
47
|
-
class="parameter-in-marker"
|
|
48
|
-
viewBox="0 0 20 20"
|
|
49
|
-
refX="10"
|
|
50
|
-
refY="5"
|
|
51
|
-
markerWidth="32"
|
|
52
|
-
markerHeight="32"
|
|
53
|
-
orient="auto-start-reverse"
|
|
54
|
-
markerUnits="userSpaceOnUse"
|
|
55
|
-
>
|
|
56
|
-
<path d="M 0 0 L 10 5 L 0 10 z" />
|
|
57
|
-
</marker>
|
|
58
|
-
`;
|
|
59
|
-
/**
|
|
60
|
-
* A template for the operation parameter out marker
|
|
61
|
-
*/
|
|
62
|
-
export const parameterOutMaker = svg `
|
|
63
|
-
<marker
|
|
64
|
-
id="parameterOut"
|
|
65
|
-
class="parameter-out-marker"
|
|
66
|
-
viewBox="0 0 20 20"
|
|
67
|
-
refX="10"
|
|
68
|
-
refY="5"
|
|
69
|
-
markerWidth="32"
|
|
70
|
-
markerHeight="32"
|
|
71
|
-
orient="auto-start-reverse"
|
|
72
|
-
markerUnits="userSpaceOnUse"
|
|
73
|
-
>
|
|
74
|
-
<path d="M 0 0 L 10 5 L 0 10 z" />
|
|
75
|
-
</marker>
|
|
76
|
-
`;
|
|
77
|
-
//# sourceMappingURL=SvgMarkers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SvgMarkers.js","sourceRoot":"","sources":["../../../../src/visualization/lib/SvgMarkers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAE9B,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;CAoB9B,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;CAcnC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;CAclC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;CAcnC,CAAA","sourcesContent":["import { svg, css } from 'lit'\n\nexport const markerStyles = css`\n .parent-marker {\n fill: #90a4ae;\n }\n\n .parameter-in polyline {\n stroke: #ff9e91;\n }\n\n .parameter-in-marker {\n fill: #ff9e91;\n }\n\n .parameter-out polyline {\n stroke: #fbc02d;\n }\n\n .parameter-out-marker {\n fill: #fbc02d;\n }\n`\n\n/**\n * A template for the parent entity marker\n */\nexport const parentEntityMaker = svg`\n<marker \n id=\"parent\" \n class=\"parent-marker\" \n viewBox=\"0 0 20 20\" \n refX=\"10\" \n refY=\"5\" \n markerWidth=\"32\" \n markerHeight=\"32\" \n orient=\"auto-start-reverse\" \n markerUnits=\"userSpaceOnUse\"\n>\n <path d=\"M 0 0 L 10 5 L 0 10 z\" />\n</marker>\n`\n\n/**\n * A template for the operation parameter in marker\n */\nexport const parameterInMaker = svg`\n<marker \n id=\"parameterIn\" \n class=\"parameter-in-marker\" \n viewBox=\"0 0 20 20\" \n refX=\"10\" \n refY=\"5\" \n markerWidth=\"32\" \n markerHeight=\"32\" \n orient=\"auto-start-reverse\" \n markerUnits=\"userSpaceOnUse\"\n>\n <path d=\"M 0 0 L 10 5 L 0 10 z\" />\n</marker>\n`\n\n/**\n * A template for the operation parameter out marker\n */\nexport const parameterOutMaker = svg`\n<marker \n id=\"parameterOut\" \n class=\"parameter-out-marker\" \n viewBox=\"0 0 20 20\" \n refX=\"10\" \n refY=\"5\" \n markerWidth=\"32\" \n markerHeight=\"32\" \n orient=\"auto-start-reverse\" \n markerUnits=\"userSpaceOnUse\"\n>\n <path d=\"M 0 0 L 10 5 L 0 10 z\" />\n</marker>\n`\n"]}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { IEdgeDirections } from './types.js';
|
|
2
|
-
import { IAssociationTip, IVisualizationAssociationShape } from './VisualizationTypes.js';
|
|
3
|
-
/**
|
|
4
|
-
* A class that is responsible for sketching different kind of line tips.
|
|
5
|
-
*/
|
|
6
|
-
export declare class TipSketch {
|
|
7
|
-
/**
|
|
8
|
-
* Builds a tip at the **end** of the line (at the target position).
|
|
9
|
-
*
|
|
10
|
-
* @param type The type of the tip to construct.
|
|
11
|
-
* @param line The definition of the line that the tip is attached to
|
|
12
|
-
* @param directions Computed line directions
|
|
13
|
-
* @returns The definition of a tip pointing at the parent (the other end)
|
|
14
|
-
*/
|
|
15
|
-
endMarker(type: string | 'parent' | 'parameterIn' | 'parameterOut' | 'association', line: IVisualizationAssociationShape, directions: IEdgeDirections): IAssociationTip;
|
|
16
|
-
/**
|
|
17
|
-
* Builds a tip at the **start** of the line (at the source position).
|
|
18
|
-
*
|
|
19
|
-
* @param type The type of the tip to construct.
|
|
20
|
-
* @param line The definition of the line that the tip is attached to
|
|
21
|
-
* @param directions Computed line directions
|
|
22
|
-
* @returns The definition of a tip pointing at the parent (the other end)
|
|
23
|
-
*/
|
|
24
|
-
startMarker(type: string | 'parent' | 'parameterIn' | 'parameterOut', line: IVisualizationAssociationShape, directions: IEdgeDirections): IAssociationTip;
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=TipSketch.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TipSketch.d.ts","sourceRoot":"","sources":["../../../../src/visualization/lib/TipSketch.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,EACL,eAAe,EACf,8BAA8B,EAE/B,MAAM,yBAAyB,CAAA;AAEhC;;GAEG;AACH,qBAAa,SAAS;IACpB;;;;;;;OAOG;IACH,SAAS,CACP,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,aAAa,GAAG,cAAc,GAAG,aAAa,EACxE,IAAI,EAAE,8BAA8B,EACpC,UAAU,EAAE,eAAe,GAC1B,eAAe;IA2BlB;;;;;;;OAOG;IACH,WAAW,CACT,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,aAAa,GAAG,cAAc,EACxD,IAAI,EAAE,8BAA8B,EACpC,UAAU,EAAE,eAAe,GAC1B,eAAe;CA0BnB"}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { RectilinearTip } from './tips/RectilinearTip.js';
|
|
2
|
-
/**
|
|
3
|
-
* A class that is responsible for sketching different kind of line tips.
|
|
4
|
-
*/
|
|
5
|
-
export class TipSketch {
|
|
6
|
-
/**
|
|
7
|
-
* Builds a tip at the **end** of the line (at the target position).
|
|
8
|
-
*
|
|
9
|
-
* @param type The type of the tip to construct.
|
|
10
|
-
* @param line The definition of the line that the tip is attached to
|
|
11
|
-
* @param directions Computed line directions
|
|
12
|
-
* @returns The definition of a tip pointing at the parent (the other end)
|
|
13
|
-
*/
|
|
14
|
-
endMarker(type, line, directions) {
|
|
15
|
-
let artist;
|
|
16
|
-
if (line.type === 'rectilinear') {
|
|
17
|
-
artist = new RectilinearTip('end', line, directions);
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
throw new Error(`Unknown tip type: ${line.type}`);
|
|
21
|
-
}
|
|
22
|
-
let shape;
|
|
23
|
-
switch (type) {
|
|
24
|
-
case 'parent':
|
|
25
|
-
shape = artist.parent();
|
|
26
|
-
break;
|
|
27
|
-
case 'direction':
|
|
28
|
-
shape = artist.direction();
|
|
29
|
-
break;
|
|
30
|
-
case 'association':
|
|
31
|
-
shape = artist.association();
|
|
32
|
-
break;
|
|
33
|
-
default:
|
|
34
|
-
throw new Error(`Unsupported association shape: ${type}.`);
|
|
35
|
-
}
|
|
36
|
-
if (!shape) {
|
|
37
|
-
throw new Error(`Unable to create a tip shape.`);
|
|
38
|
-
}
|
|
39
|
-
return shape;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Builds a tip at the **start** of the line (at the source position).
|
|
43
|
-
*
|
|
44
|
-
* @param type The type of the tip to construct.
|
|
45
|
-
* @param line The definition of the line that the tip is attached to
|
|
46
|
-
* @param directions Computed line directions
|
|
47
|
-
* @returns The definition of a tip pointing at the parent (the other end)
|
|
48
|
-
*/
|
|
49
|
-
startMarker(type, line, directions) {
|
|
50
|
-
let artist;
|
|
51
|
-
if (line.type === 'rectilinear') {
|
|
52
|
-
artist = new RectilinearTip('start', line, directions);
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
throw new Error(`Unknown tip type: ${line.type}`);
|
|
56
|
-
}
|
|
57
|
-
let shape;
|
|
58
|
-
switch (type) {
|
|
59
|
-
case 'parent':
|
|
60
|
-
shape = artist.parent();
|
|
61
|
-
break;
|
|
62
|
-
case 'direction':
|
|
63
|
-
shape = artist.direction();
|
|
64
|
-
break;
|
|
65
|
-
case 'association':
|
|
66
|
-
shape = artist.association();
|
|
67
|
-
break;
|
|
68
|
-
default:
|
|
69
|
-
throw new Error(`Unsupported association shape: ${type}.`);
|
|
70
|
-
}
|
|
71
|
-
if (!shape) {
|
|
72
|
-
throw new Error(`Unable to create a tip shape.`);
|
|
73
|
-
}
|
|
74
|
-
return shape;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
//# sourceMappingURL=TipSketch.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
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CAAA;QAC9F,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,KAAK,CAAC,qBAAqB,IAAI,CAAC,IAAI,EAAE,CAAC,CAAA;QACnD,CAAC;QACD,IAAI,KAAsB,CAAA;QAC1B,QAAQ,IAAI,EAAE,CAAC;YACb,KAAK,QAAQ;gBACX,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,CAAA;gBACvB,MAAK;YACP,KAAK,WAAW;gBACd,KAAK,GAAG,MAAM,CAAC,SAAS,EAAE,CAAA;gBAC1B,MAAK;YACP,KAAK,aAAa;gBAChB,KAAK,GAAG,MAAM,CAAC,WAAW,EAAE,CAAA;gBAC5B,MAAK;YACP;gBACE,MAAM,IAAI,KAAK,CAAC,kCAAkC,IAAI,GAAG,CAAC,CAAA;QAC9D,CAAC;QACD,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAA;QAClD,CAAC;QACD,OAAO,KAAK,CAAA;IACd,CAAC;CACF","sourcesContent":["import { RectilinearTip } from './tips/RectilinearTip.js'\nimport { TipArtist } from './tips/TipArtist.js'\nimport { IEdgeDirections } from './types.js'\nimport {\n IAssociationTip,\n IVisualizationAssociationShape,\n IVisualizationRectilinearLineShape,\n} from './VisualizationTypes.js'\n\n/**\n * A class that is responsible for sketching different kind of line tips.\n */\nexport class TipSketch {\n /**\n * Builds a tip at the **end** of the line (at the target position).\n *\n * @param type The type of the tip to construct.\n * @param line The definition of the line that the tip is attached to\n * @param directions Computed line directions\n * @returns The definition of a tip pointing at the parent (the other end)\n */\n endMarker(\n type: string | 'parent' | 'parameterIn' | 'parameterOut' | 'association',\n line: IVisualizationAssociationShape,\n directions: IEdgeDirections\n ): IAssociationTip {\n let artist: TipArtist\n if (line.type === 'rectilinear') {\n artist = new RectilinearTip('end', line as IVisualizationRectilinearLineShape, directions)\n } else {\n throw new Error(`Unknown tip type: ${line.type}`)\n }\n let shape: IAssociationTip\n switch (type) {\n case 'parent':\n shape = artist.parent()\n break\n case 'direction':\n shape = artist.direction()\n break\n case 'association':\n shape = artist.association()\n break\n default:\n throw new Error(`Unsupported association shape: ${type}.`)\n }\n if (!shape) {\n throw new Error(`Unable to create a tip shape.`)\n }\n return shape\n }\n\n /**\n * Builds a tip at the **start** of the line (at the source position).\n *\n * @param type The type of the tip to construct.\n * @param line The definition of the line that the tip is attached to\n * @param directions Computed line directions\n * @returns The definition of a tip pointing at the parent (the other end)\n */\n startMarker(\n type: string | 'parent' | 'parameterIn' | 'parameterOut',\n line: IVisualizationAssociationShape,\n directions: IEdgeDirections\n ): IAssociationTip {\n let artist: TipArtist\n if (line.type === 'rectilinear') {\n artist = new RectilinearTip('start', line as IVisualizationRectilinearLineShape, directions)\n } else {\n throw new Error(`Unknown tip type: ${line.type}`)\n }\n let shape: IAssociationTip\n switch (type) {\n case 'parent':\n shape = artist.parent()\n break\n case 'direction':\n shape = artist.direction()\n break\n case 'association':\n shape = artist.association()\n break\n default:\n throw new Error(`Unsupported association shape: ${type}.`)\n }\n if (!shape) {\n throw new Error(`Unable to create a tip shape.`)\n }\n return shape\n }\n}\n"]}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export declare interface TouchCopy {
|
|
2
|
-
identifier: number;
|
|
3
|
-
pageX: number;
|
|
4
|
-
pageY: number;
|
|
5
|
-
}
|
|
6
|
-
export declare interface TouchMoveResult {
|
|
7
|
-
identifier: number;
|
|
8
|
-
dx: number;
|
|
9
|
-
dy: number;
|
|
10
|
-
}
|
|
11
|
-
export declare function add(event: TouchEvent): void;
|
|
12
|
-
export declare function move(event: TouchEvent): TouchMoveResult[];
|
|
13
|
-
export declare function end(event: TouchEvent): void;
|
|
14
|
-
//# sourceMappingURL=TouchSupport.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TouchSupport.d.ts","sourceRoot":"","sources":["../../../../src/visualization/lib/TouchSupport.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,OAAO,WAAW,SAAS;IAChC,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,CAAC,OAAO,WAAW,eAAe;IACtC,UAAU,EAAE,MAAM,CAAA;IAClB,EAAE,EAAE,MAAM,CAAA;IACV,EAAE,EAAE,MAAM,CAAA;CACX;AAkBD,wBAAgB,GAAG,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAK3C;AAED,wBAAgB,IAAI,CAAC,KAAK,EAAE,UAAU,GAAG,eAAe,EAAE,CAuBzD;AAED,wBAAgB,GAAG,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAU3C"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
const cache = [];
|
|
2
|
-
function copyTouch({ identifier, pageX, pageY }) {
|
|
3
|
-
return { identifier, pageX, pageY };
|
|
4
|
-
}
|
|
5
|
-
function getTouchById(id) {
|
|
6
|
-
for (let i = 0; i < cache.length; i++) {
|
|
7
|
-
const { identifier } = cache[i];
|
|
8
|
-
if (id === identifier) {
|
|
9
|
-
return i;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
return -1;
|
|
13
|
-
}
|
|
14
|
-
export function add(event) {
|
|
15
|
-
const touches = event.changedTouches;
|
|
16
|
-
for (let i = 0; i < touches.length; i++) {
|
|
17
|
-
cache.push(copyTouch(touches[i]));
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
export function move(event) {
|
|
21
|
-
if (event.cancelable) {
|
|
22
|
-
event.preventDefault();
|
|
23
|
-
}
|
|
24
|
-
const touches = event.changedTouches;
|
|
25
|
-
const result = [];
|
|
26
|
-
for (let i = 0; i < touches.length; i++) {
|
|
27
|
-
const touch = touches[i];
|
|
28
|
-
const index = getTouchById(touch.identifier);
|
|
29
|
-
if (index === -1) {
|
|
30
|
-
continue;
|
|
31
|
-
}
|
|
32
|
-
const copy = copyTouch(touch);
|
|
33
|
-
const { pageX: opx, pageY: opy } = cache[index];
|
|
34
|
-
const { identifier, pageX, pageY } = copy;
|
|
35
|
-
cache.splice(index, 1, copy);
|
|
36
|
-
result.push({
|
|
37
|
-
identifier,
|
|
38
|
-
dx: -(pageX - opx),
|
|
39
|
-
dy: -(pageY - opy),
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
return result;
|
|
43
|
-
}
|
|
44
|
-
export function end(event) {
|
|
45
|
-
const touches = event.changedTouches;
|
|
46
|
-
for (let i = 0; i < touches.length; i++) {
|
|
47
|
-
const touch = touches[i];
|
|
48
|
-
const index = getTouchById(touch.identifier);
|
|
49
|
-
if (index === -1) {
|
|
50
|
-
continue;
|
|
51
|
-
}
|
|
52
|
-
cache.splice(index, 1);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
//# sourceMappingURL=TouchSupport.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TouchSupport.js","sourceRoot":"","sources":["../../../../src/visualization/lib/TouchSupport.ts"],"names":[],"mappings":"AAaA,MAAM,KAAK,GAAgB,EAAE,CAAA;AAE7B,SAAS,SAAS,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAS;IACpD,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;AACrC,CAAC;AAED,SAAS,YAAY,CAAC,EAAU;IAC9B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,MAAM,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;QAC/B,IAAI,EAAE,KAAK,UAAU,EAAE,CAAC;YACtB,OAAO,CAAC,CAAA;QACV,CAAC;IACH,CAAC;IACD,OAAO,CAAC,CAAC,CAAA;AACX,CAAC;AAED,MAAM,UAAU,GAAG,CAAC,KAAiB;IACnC,MAAM,OAAO,GAAG,KAAK,CAAC,cAAc,CAAA;IACpC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AM,UAAU,GAAG,CAAC,KAAiB;IACnC,MAAM,OAAO,GAAG,KAAK,CAAC,cAAc,CAAA;IACpC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACxC,MAAM,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;QACxB,MAAM,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;QAC5C,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC;YACjB,SAAQ;QACV,CAAC;QACD,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;IACxB,CAAC;AACH,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/prefer-for-of */\nexport declare interface TouchCopy {\n identifier: number\n pageX: number\n pageY: number\n}\n\nexport declare interface TouchMoveResult {\n identifier: number\n dx: number\n dy: number\n}\n\nconst cache: TouchCopy[] = []\n\nfunction copyTouch({ identifier, pageX, pageY }: Touch): TouchCopy {\n return { identifier, pageX, pageY }\n}\n\nfunction getTouchById(id: number): number {\n for (let i = 0; i < cache.length; i++) {\n const { identifier } = cache[i]\n if (id === identifier) {\n return i\n }\n }\n return -1\n}\n\nexport function add(event: TouchEvent): void {\n const touches = event.changedTouches\n for (let i = 0; i < touches.length; i++) {\n cache.push(copyTouch(touches[i]))\n }\n}\n\nexport function move(event: TouchEvent): TouchMoveResult[] {\n if (event.cancelable) {\n event.preventDefault()\n }\n const touches = event.changedTouches\n const result = []\n for (let i = 0; i < touches.length; i++) {\n const touch = touches[i]\n const index = getTouchById(touch.identifier)\n if (index === -1) {\n continue\n }\n const copy = copyTouch(touch)\n const { pageX: opx, pageY: opy } = cache[index]\n const { identifier, pageX, pageY } = copy\n cache.splice(index, 1, copy)\n result.push({\n identifier,\n dx: -(pageX - opx),\n dy: -(pageY - opy),\n })\n }\n return result\n}\n\nexport function end(event: TouchEvent): void {\n const touches = event.changedTouches\n for (let i = 0; i < touches.length; i++) {\n const touch = touches[i]\n const index = getTouchById(touch.identifier)\n if (index === -1) {\n continue\n }\n cache.splice(index, 1)\n }\n}\n"]}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Stops an event and cancels it.
|
|
3
|
-
* @param e The event to stop
|
|
4
|
-
*/
|
|
5
|
-
export declare function cancelEvent(e: Event): void;
|
|
6
|
-
/**
|
|
7
|
-
* Get the contrasting color for any hex color
|
|
8
|
-
* (c) 2019 Chris Ferdinandi, MIT License, https://gomakethings.com
|
|
9
|
-
* Derived from work by Brian Suda, https://24ways.org/2010/calculating-color-contrast/
|
|
10
|
-
*
|
|
11
|
-
* See https://gomakethings.com/dynamically-changing-the-text-color-based-on-background-color-contrast-with-vanilla-js/
|
|
12
|
-
*
|
|
13
|
-
* @param hexcolor A hexcolor value
|
|
14
|
-
* @returns The contrasting color (black or white)
|
|
15
|
-
*/
|
|
16
|
-
export declare function getContrast(hexcolor: string): string;
|
|
17
|
-
/**
|
|
18
|
-
* Awaits for a specified amount odf time.
|
|
19
|
-
* Zero or negative will result in the next microtask.
|
|
20
|
-
* A positive number will result in the next microtask + the set timeout.
|
|
21
|
-
*
|
|
22
|
-
* @param timeout The number of milliseconds to wait.
|
|
23
|
-
*/
|
|
24
|
-
export declare function aTimeout(timeout?: number): Promise<void>;
|
|
25
|
-
//# sourceMappingURL=Utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Utils.d.ts","sourceRoot":"","sources":["../../../../src/visualization/lib/Utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,GAAG,IAAI,CAI1C;AAED;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAyBpD;AAED;;;;;;GAMG;AACH,wBAAsB,QAAQ,CAAC,OAAO,SAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAQzD"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Stops an event and cancels it.
|
|
3
|
-
* @param e The event to stop
|
|
4
|
-
*/
|
|
5
|
-
export function cancelEvent(e) {
|
|
6
|
-
e.preventDefault();
|
|
7
|
-
e.stopPropagation();
|
|
8
|
-
e.stopImmediatePropagation();
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Get the contrasting color for any hex color
|
|
12
|
-
* (c) 2019 Chris Ferdinandi, MIT License, https://gomakethings.com
|
|
13
|
-
* Derived from work by Brian Suda, https://24ways.org/2010/calculating-color-contrast/
|
|
14
|
-
*
|
|
15
|
-
* See https://gomakethings.com/dynamically-changing-the-text-color-based-on-background-color-contrast-with-vanilla-js/
|
|
16
|
-
*
|
|
17
|
-
* @param hexcolor A hexcolor value
|
|
18
|
-
* @returns The contrasting color (black or white)
|
|
19
|
-
*/
|
|
20
|
-
export function getContrast(hexcolor) {
|
|
21
|
-
let color = hexcolor;
|
|
22
|
-
// If a leading # is provided, remove it
|
|
23
|
-
if (color.slice(0, 1) === '#') {
|
|
24
|
-
color = color.slice(1);
|
|
25
|
-
}
|
|
26
|
-
// If a three-character hexcode, make six-character
|
|
27
|
-
if (color.length === 3) {
|
|
28
|
-
color = color
|
|
29
|
-
.split('')
|
|
30
|
-
.map((hex) => hex + hex)
|
|
31
|
-
.join('');
|
|
32
|
-
}
|
|
33
|
-
// Convert to RGB value
|
|
34
|
-
const r = parseInt(color.substring(0, 2), 16);
|
|
35
|
-
const g = parseInt(color.substring(2, 2), 16);
|
|
36
|
-
const b = parseInt(color.substring(4, 2), 16);
|
|
37
|
-
// Get YIQ ratio
|
|
38
|
-
const yiq = (r * 299 + g * 587 + b * 114) / 1000;
|
|
39
|
-
// Check contrast
|
|
40
|
-
return yiq >= 128 ? 'black' : 'white';
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Awaits for a specified amount odf time.
|
|
44
|
-
* Zero or negative will result in the next microtask.
|
|
45
|
-
* A positive number will result in the next microtask + the set timeout.
|
|
46
|
-
*
|
|
47
|
-
* @param timeout The number of milliseconds to wait.
|
|
48
|
-
*/
|
|
49
|
-
export async function aTimeout(timeout = 0) {
|
|
50
|
-
return new Promise((resolve) => {
|
|
51
|
-
if (timeout <= 0) {
|
|
52
|
-
resolve();
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
setTimeout(() => resolve(), timeout);
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
//# sourceMappingURL=Utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Utils.js","sourceRoot":"","sources":["../../../../src/visualization/lib/Utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,CAAQ;IAClC,CAAC,CAAC,cAAc,EAAE,CAAA;IAClB,CAAC,CAAC,eAAe,EAAE,CAAA;IACnB,CAAC,CAAC,wBAAwB,EAAE,CAAA;AAC9B,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,WAAW,CAAC,QAAgB;IAC1C,IAAI,KAAK,GAAG,QAAQ,CAAA;IACpB,wCAAwC;IACxC,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;QAC9B,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IACxB,CAAC;IAED,mDAAmD;IACnD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,KAAK,GAAG,KAAK;aACV,KAAK,CAAC,EAAE,CAAC;aACT,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC;aACvB,IAAI,CAAC,EAAE,CAAC,CAAA;IACb,CAAC;IAED,uBAAuB;IACvB,MAAM,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;IAC7C,MAAM,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;IAC7C,MAAM,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;IAE7C,gBAAgB;IAChB,MAAM,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,IAAI,CAAA;IAEhD,iBAAiB;IACjB,OAAO,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAA;AACvC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,OAAO,GAAG,CAAC;IACxC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,IAAI,OAAO,IAAI,CAAC,EAAE,CAAC;YACjB,OAAO,EAAE,CAAA;QACX,CAAC;aAAM,CAAC;YACN,UAAU,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,CAAC,CAAA;QACtC,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC","sourcesContent":["/**\n * Stops an event and cancels it.\n * @param e The event to stop\n */\nexport function cancelEvent(e: Event): void {\n e.preventDefault()\n e.stopPropagation()\n e.stopImmediatePropagation()\n}\n\n/**\n * Get the contrasting color for any hex color\n * (c) 2019 Chris Ferdinandi, MIT License, https://gomakethings.com\n * Derived from work by Brian Suda, https://24ways.org/2010/calculating-color-contrast/\n *\n * See https://gomakethings.com/dynamically-changing-the-text-color-based-on-background-color-contrast-with-vanilla-js/\n *\n * @param hexcolor A hexcolor value\n * @returns The contrasting color (black or white)\n */\nexport function getContrast(hexcolor: string): string {\n let color = hexcolor\n // If a leading # is provided, remove it\n if (color.slice(0, 1) === '#') {\n color = color.slice(1)\n }\n\n // If a three-character hexcode, make six-character\n if (color.length === 3) {\n color = color\n .split('')\n .map((hex) => hex + hex)\n .join('')\n }\n\n // Convert to RGB value\n const r = parseInt(color.substring(0, 2), 16)\n const g = parseInt(color.substring(2, 2), 16)\n const b = parseInt(color.substring(4, 2), 16)\n\n // Get YIQ ratio\n const yiq = (r * 299 + g * 587 + b * 114) / 1000\n\n // Check contrast\n return yiq >= 128 ? 'black' : 'white'\n}\n\n/**\n * Awaits for a specified amount odf time.\n * Zero or negative will result in the next microtask.\n * A positive number will result in the next microtask + the set timeout.\n *\n * @param timeout The number of milliseconds to wait.\n */\nexport async function aTimeout(timeout = 0): Promise<void> {\n return new Promise((resolve) => {\n if (timeout <= 0) {\n resolve()\n } else {\n setTimeout(() => resolve(), timeout)\n }\n })\n}\n"]}
|