From 0a71ce795325572750fb4e2f0f2fb6a82eed1236 Mon Sep 17 00:00:00 2001 From: MrCoder Date: Thu, 10 Apr 2025 19:46:35 +1000 Subject: [PATCH 01/10] It can show and close color picker. --- package.json | 1 + pnpm-lock.yaml | 32 ++++- .../SeqDiagram/LifeLineLayer/ColorPicker.vue | 121 ++++++++++++++++++ .../SeqDiagram/LifeLineLayer/Participant.vue | 36 +++++- src/store/Store.ts | 56 ++++++++ 5 files changed, 241 insertions(+), 5 deletions(-) create mode 100644 src/components/DiagramFrame/SeqDiagram/LifeLineLayer/ColorPicker.vue diff --git a/package.json b/package.json index 814e9efde..1736148c4 100644 --- a/package.json +++ b/package.json @@ -49,6 +49,7 @@ "@types/ramda": "^0.28.20", "@vue/compat": "^3.2.45", "antlr4": "~4.11.0", + "click-outside-vue3": "^4.0.1", "color-string": "^1.5.5", "dom-to-image-more": "^2.13.0", "dompurify": "^3.1.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7c31ce90d..372e64828 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -28,6 +28,9 @@ importers: antlr4: specifier: ~4.11.0 version: 4.11.0 + click-outside-vue3: + specifier: ^4.0.1 + version: 4.0.1 color-string: specifier: ^1.5.5 version: 1.5.5 @@ -2564,6 +2567,12 @@ packages: integrity: sha512-V09KvXxFiutGp6B7XkpaDXlNadZxrzajcY50EuoLIpQ6WWYCSvf19lVIazzfIzQvhUN2HjX12spLojTnhuKlGg==, } + "@types/node@22.14.0": + resolution: + { + integrity: sha512-Kmpl+z84ILoG+3T/zQFyAJsU6EPTmOCj8/2+83fSN6djd6I4o7uOuGIH6vq3PrjY5BGitSbFuMN18j3iknubbA==, + } + "@types/ramda@0.28.20": resolution: { @@ -3688,6 +3697,13 @@ packages: } engines: { node: ^12.20.0 || ^14.13.1 || >=16.0.0 } + click-outside-vue3@4.0.1: + resolution: + { + integrity: sha512-sbplNecrup5oGqA3o4bo8XmvHRT6q9fvw21Z67aDbTqB9M6LF7CuYLTlLvNtOgKU6W3zst5H5zJuEh4auqA34g==, + } + engines: { node: ">=6" } + cliui@8.0.1: resolution: { @@ -7756,6 +7772,12 @@ packages: integrity: sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==, } + undici-types@6.21.0: + resolution: + { + integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==, + } + unicode-canonical-property-names-ecmascript@2.0.0: resolution: { @@ -9953,6 +9975,10 @@ snapshots: dependencies: undici-types: 6.20.0 + "@types/node@22.14.0": + dependencies: + undici-types: 6.21.0 + "@types/ramda@0.28.20": dependencies: ts-toolbelt: 6.15.5 @@ -10680,6 +10706,8 @@ snapshots: slice-ansi: 5.0.0 string-width: 5.1.2 + click-outside-vue3@4.0.1: {} + cliui@8.0.1: dependencies: string-width: 4.2.3 @@ -11813,7 +11841,7 @@ snapshots: jest-worker@27.5.1: dependencies: - "@types/node": 22.10.7 + "@types/node": 22.14.0 merge-stream: 2.0.0 supports-color: 8.1.1 @@ -13114,6 +13142,8 @@ snapshots: undici-types@6.20.0: {} + undici-types@6.21.0: {} + unicode-canonical-property-names-ecmascript@2.0.0: {} unicode-match-property-ecmascript@2.0.0: diff --git a/src/components/DiagramFrame/SeqDiagram/LifeLineLayer/ColorPicker.vue b/src/components/DiagramFrame/SeqDiagram/LifeLineLayer/ColorPicker.vue new file mode 100644 index 000000000..499db64b7 --- /dev/null +++ b/src/components/DiagramFrame/SeqDiagram/LifeLineLayer/ColorPicker.vue @@ -0,0 +1,121 @@ + + + + + diff --git a/src/components/DiagramFrame/SeqDiagram/LifeLineLayer/Participant.vue b/src/components/DiagramFrame/SeqDiagram/LifeLineLayer/Participant.vue index 8635c1bd0..d37fd70ee 100644 --- a/src/components/DiagramFrame/SeqDiagram/LifeLineLayer/Participant.vue +++ b/src/components/DiagramFrame/SeqDiagram/LifeLineLayer/Participant.vue @@ -22,6 +22,10 @@ v-if="!isDefaultStarter" class="h-5 group flex flex-col justify-center" > + @@ -46,7 +50,7 @@