From 64e25aa535b54d2df3c97f69cb3f0dd3cc2a3d2c Mon Sep 17 00:00:00 2001 From: Amphiluke Date: Sun, 24 Dec 2023 16:35:25 +0700 Subject: [PATCH] Replace the attribute selector with a datalist --- package-lock.json | 4 +- package.json | 2 +- src/assets/icons.svg | 2 +- src/components/PanelAttributes.vue | 152 ++++++++++------------------ src/components/PanelCollections.vue | 4 +- src/components/PanelSettings.vue | 4 +- src/components/TheSidebar.vue | 4 +- src/styles/interface.module.css | 17 ++-- 8 files changed, 67 insertions(+), 122 deletions(-) diff --git a/package-lock.json b/package-lock.json index c5b32be..e9edf02 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "lindsvg-pwa", - "version": "2.3.3", + "version": "2.3.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "lindsvg-pwa", - "version": "2.3.3", + "version": "2.3.4", "dependencies": { "@vueuse/core": "^10.7.0", "lindsvg": "^1.3.3", diff --git a/package.json b/package.json index 669fbaa..eec6863 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "lindsvg-pwa", "private": true, - "version": "2.3.3", + "version": "2.3.4", "type": "module", "scripts": { "lint": "eslint \"src/**/*.{mjs,vue}\"", diff --git a/src/assets/icons.svg b/src/assets/icons.svg index 239b81d..bb729a4 100644 --- a/src/assets/icons.svg +++ b/src/assets/icons.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/components/PanelAttributes.vue b/src/components/PanelAttributes.vue index 83c0dc9..ee12330 100644 --- a/src/components/PanelAttributes.vue +++ b/src/components/PanelAttributes.vue @@ -10,54 +10,48 @@ let interfaceStore = useInterfaceStore(); let newAttributeName = ref(""); let newAttributeValue = ref(""); -let attributes = { - // https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/Presentation - "Presentation Attributes": [ - "clip-path", - "clip-rule", - "color", - "color-interpolation", - "cursor", - "display", - "fill", - "fill-opacity", - "fill-rule", - "filter", - "marker-end", - "marker-mid", - "marker-start", - "mask", - "opacity", - "overflow", - "paint-order", - "pathLength", - "pointer-events", - "shape-rendering", - "stroke", - "stroke-dasharray", - "stroke-dashoffset", - "stroke-linecap", - "stroke-linejoin", - "stroke-miterlimit", - "stroke-opacity", - "stroke-width", - "transform", - "vector-effect", - "visibility", - ], - - // https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/Core - "Core Attributes": [ - "id", - "tabindex", - ], - - // https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/Styling - "Styling Attributes": [ - "class", - "style", - ], -}; +let attributes = [ + // Presentation Attributes (https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/Presentation) + "clip-path", + "clip-rule", + "color", + "color-interpolation", + "cursor", + "display", + "fill", + "fill-opacity", + "fill-rule", + "filter", + "marker-end", + "marker-mid", + "marker-start", + "mask", + "opacity", + "overflow", + "paint-order", + "pathLength", + "pointer-events", + "shape-rendering", + "stroke", + "stroke-dasharray", + "stroke-dashoffset", + "stroke-linecap", + "stroke-linejoin", + "stroke-miterlimit", + "stroke-opacity", + "stroke-width", + "transform", + "vector-effect", + "visibility", + + // Core Attributes (https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/Core) + "id", + "tabindex", + + // Styling Attributes (https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/Styling) + "class", + "style", +]; function setAttribute(name, value) { value = value.trim().split(/\r?\n/); @@ -120,36 +114,23 @@ function plot() {

Add a new attribute

- + +