diff --git a/package-lock.json b/package-lock.json index 8837735..f141fa4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,6 @@ "@vueuse/core": "^13.5.0", "async-mutex": "^0.5.0", "highlight.js": "^11.11.1", - "konva": "^9.3.20", "lodash": "^4.17.21", "log-symbols": "^7.0.0", "lucide-vue-next": "^0.525.0", @@ -24,7 +23,6 @@ "ts-log": "^2.2.7", "ts-results-es": "^5.0.1", "vue": "^3.5.13", - "vue-konva": "^3.2.1", "vue-router": "4", "yocto-queue": "^1.2.1", "zod": "^3.24.2" @@ -3174,26 +3172,6 @@ "dev": true, "license": "MIT" }, - "node_modules/konva": { - "version": "9.3.20", - "resolved": "https://registry.npmjs.org/konva/-/konva-9.3.20.tgz", - "integrity": "sha512-7XPD/YtgfzC8b1c7z0hhY5TF1IO/pBYNa29zMTA2PeBaqI0n5YplUeo4JRuRcljeAF8lWtW65jePZZF7064c8w==", - "funding": [ - { - "type": "patreon", - "url": "https://www.patreon.com/lavrton" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/konva" - }, - { - "type": "github", - "url": "https://github.com/sponsors/lavrton" - } - ], - "license": "MIT" - }, "node_modules/lightningcss": { "version": "1.29.2", "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.29.2.tgz", @@ -4660,34 +4638,6 @@ } } }, - "node_modules/vue-konva": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/vue-konva/-/vue-konva-3.2.1.tgz", - "integrity": "sha512-gLF+VYnlrBfwtaN3NkgzzEqlj9nyCll80VZv2DdvLUM3cisUsdcRJJuMwGTBJOTebcnn6MB22r33IFd2m+m/ig==", - "funding": [ - { - "type": "patreon", - "url": "https://www.patreon.com/lavrton" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/konva" - }, - { - "type": "github", - "url": "https://github.com/sponsors/lavrton" - } - ], - "license": "MIT", - "engines": { - "node": ">= 4.0.0", - "npm": ">= 3.0.0" - }, - "peerDependencies": { - "konva": ">7", - "vue": "^3" - } - }, "node_modules/vue-router": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.5.0.tgz", diff --git a/package.json b/package.json index 25ddf1a..83c0023 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,6 @@ "@vueuse/core": "^13.5.0", "async-mutex": "^0.5.0", "highlight.js": "^11.11.1", - "konva": "^9.3.20", "lodash": "^4.17.21", "log-symbols": "^7.0.0", "lucide-vue-next": "^0.525.0", @@ -30,7 +29,6 @@ "ts-log": "^2.2.7", "ts-results-es": "^5.0.1", "vue": "^3.5.13", - "vue-konva": "^3.2.1", "vue-router": "4", "yocto-queue": "^1.2.1", "zod": "^3.24.2" diff --git a/src/components/LabCanvasNew/LabCanvas.vue b/src/components/LabCanvasNew/LabCanvas.vue deleted file mode 100644 index 0f13d59..0000000 --- a/src/components/LabCanvasNew/LabCanvas.vue +++ /dev/null @@ -1,536 +0,0 @@ - - - - - diff --git a/src/components/LabCanvasNew/LabCanvasType.ts b/src/components/LabCanvasNew/LabCanvasType.ts deleted file mode 100644 index 50c2359..0000000 --- a/src/components/LabCanvasNew/LabCanvasType.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { VNode } from "@/utils/VueKonvaType"; -import Konva from "konva"; -import BaseBoard from "../equipments/BaseBoard.vue"; - -export type LabCanvasComponentConfig = { - id: string; - component: VNode; - x: number; - y: number; - config: Konva.ShapeConfig; - isHoverring: boolean; - hoverBox: { - x: number; - y: number; - width: number; - height: number; - }; -}; - -export type LabCanvasComponent = typeof BaseBoard; \ No newline at end of file diff --git a/src/components/LabCanvasNew/LabComponentsDrawer.vue b/src/components/LabCanvasNew/LabComponentsDrawer.vue deleted file mode 100644 index b4e878b..0000000 --- a/src/components/LabCanvasNew/LabComponentsDrawer.vue +++ /dev/null @@ -1,618 +0,0 @@ - - - - - diff --git a/src/components/LabCanvasNew/composable/LabCanvasManager.ts b/src/components/LabCanvasNew/composable/LabCanvasManager.ts deleted file mode 100644 index 4976c67..0000000 --- a/src/components/LabCanvasNew/composable/LabCanvasManager.ts +++ /dev/null @@ -1,123 +0,0 @@ -import { computed, shallowRef } from "vue"; -import { createInjectionState, useStorage } from "@vueuse/core"; -import { type LabCanvasComponentConfig } from "../LabCanvasType"; -import type Konva from "konva"; - -const [useProvideLabCanvasStore, useLabCanvasStore] = createInjectionState( - (initialStageConfig: Konva.StageConfig) => { - const components = useStorage( - "LabCanvasComponents", - [] as LabCanvasComponentConfig[], - ); - - // state - const stageConfig = shallowRef(initialStageConfig); - - // getters - const getComponentById = computed(() => (id: string) => { - return components.value.find(component => component.id === id); - }); - - const componentCount = computed(() => components.value.length); - - // actions - function addComponent(componentData: { - id: string; - component: any; - x?: number; - y?: number; - config: Konva.ShapeConfig; - }) { - const newComponent: LabCanvasComponentConfig = { - id: componentData.id, - component: componentData.component, - x: componentData.x ?? 100, - y: componentData.y ?? 100, - config: componentData.config, - isHoverring: false, - hoverBox: { - x: 0, - y: 0, - width: componentData.config.width || 100, - height: componentData.config.height || 100, - }, - }; - - components.value.push(newComponent); - return newComponent; - } - - function removeComponent(id: string) { - const index = components.value.findIndex(component => component.id === id); - if (index !== -1) { - const removedComponent = components.value[index]; - components.value.splice(index, 1); - return removedComponent; - } - return null; - } - - function removeComponents(ids: string[]) { - const removedComponents: LabCanvasComponentConfig[] = []; - - ids.forEach(id => { - const removed = removeComponent(id); - if (removed) { - removedComponents.push(removed); - } - }); - - return removedComponents; - } - - function updateComponent(id: string, updates: Partial) { - const component = components.value.find(comp => comp.id === id); - if (component) { - Object.assign(component, updates); - return component; - } - return null; - } - - function updateComponentPosition(id: string, x: number, y: number) { - return updateComponent(id, { x, y }); - } - - function updateComponentConfig(id: string, config: Partial) { - const component = components.value.find(comp => comp.id === id); - if (component) { - component.config = { ...component.config, ...config }; - return component; - } - return null; - } - - function clearComponents() { - const clearedComponents = [...components.value]; - components.value.splice(0); - return clearedComponents; - } - - function setComponents(newComponents: LabCanvasComponentConfig[]) { - components.value.splice(0, components.value.length, ...newComponents); - } - - return { - stageConfig, - components, - // getters - getComponentById, - componentCount, - // actions - addComponent, - removeComponent, - removeComponents, - updateComponent, - updateComponentPosition, - updateComponentConfig, - clearComponents, - setComponents, - }; - }); - -export { useProvideLabCanvasStore, useLabCanvasStore }; diff --git a/src/components/LabCanvasNew/index.ts b/src/components/LabCanvasNew/index.ts deleted file mode 100644 index cf6f248..0000000 --- a/src/components/LabCanvasNew/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -import LabCanvas from './LabCanvas.vue'; -import LabComponentsDrawer from './LabComponentsDrawer.vue'; -import { useProvideLabCanvasStore, useLabCanvasStore } from './composable/LabCanvasManager'; - -export {LabCanvas, LabComponentsDrawer}; \ No newline at end of file diff --git a/src/views/ProjectViewNew.vue b/src/views/ProjectViewNew.vue deleted file mode 100644 index 6705c88..0000000 --- a/src/views/ProjectViewNew.vue +++ /dev/null @@ -1,38 +0,0 @@ - - - - -