1 line
197 KiB
Plaintext
1 line
197 KiB
Plaintext
|
{"version":3,"file":"GraphView-DN9xGvF3.js","sources":["../../src/components/graph/TitleEditor.vue","../../node_modules/primevue/overlaybadge/style/index.mjs","../../node_modules/primevue/overlaybadge/index.mjs","../../src/components/sidebar/SidebarIcon.vue","../../src/components/sidebar/SidebarThemeToggleIcon.vue","../../src/components/sidebar/SidebarSettingsToggleIcon.vue","../../src/components/sidebar/SideToolbar.vue","../../node_modules/primevue/splitter/style/index.mjs","../../node_modules/primevue/splitter/index.mjs","../../node_modules/primevue/splitterpanel/style/index.mjs","../../node_modules/primevue/splitterpanel/index.mjs","../../src/components/LiteGraphCanvasSplitterOverlay.vue","../../node_modules/primevue/autocomplete/style/index.mjs","../../node_modules/primevue/autocomplete/index.mjs","../../src/components/primevueOverride/AutoCompletePlus.vue","../../src/components/searchbox/NodeSearchItem.vue","../../src/components/searchbox/NodeSearchBox.vue","../../src/types/litegraphTypes.ts","../../src/components/searchbox/NodeSearchBoxPopover.vue","../../src/components/graph/NodeTooltip.vue","../../src/components/graph/GraphCanvas.vue"],"sourcesContent":["<template>\n <div\n v-if=\"showInput\"\n class=\"group-title-editor node-title-editor\"\n :style=\"inputStyle\"\n >\n <EditableText\n :isEditing=\"showInput\"\n :modelValue=\"editedTitle\"\n @edit=\"onEdit\"\n />\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, onMounted, onUnmounted, CSSProperties, watch } from 'vue'\nimport { app } from '@/scripts/app'\nimport { LGraphGroup, LGraphNode, LiteGraph } from '@comfyorg/litegraph'\nimport EditableText from '@/components/common/EditableText.vue'\nimport { ComfyExtension } from '@/types/comfy'\nimport { useSettingStore } from '@/stores/settingStore'\nimport type { LiteGraphCanvasEvent } from '@comfyorg/litegraph'\nimport { useCanvasStore, useTitleEditorStore } from '@/stores/graphStore'\n\nconst settingStore = useSettingStore()\n\nconst showInput = ref(false)\nconst editedTitle = ref('')\nconst inputStyle = ref<CSSProperties>({\n position: 'fixed',\n left: '0px',\n top: '0px',\n width: '200px',\n height: '20px',\n fontSize: '12px'\n})\n\nconst titleEditorStore = useTitleEditorStore()\nconst canvasStore = useCanvasStore()\nconst previousCanvasDraggable = ref(true)\n\nconst onEdit = (newValue: string) => {\n if (titleEditorStore.titleEditorTarget && newValue.trim() !== '') {\n titleEditorStore.titleEditorTarget.title = newValue.trim()\n app.graph.setDirtyCanvas(true, true)\n }\n showInput.value = false\n titleEditorStore.titleEditorTarget = null\n canvasStore.canvas!.allow_dragcanvas = previousCanvasDraggable.value\n}\n\nwatch(\n () => titleEditorStore.titleEditorTarget,\n (target) => {\n if (target === null) {\n return\n }\n editedTitle.value = target.title\n showInput.value = true\n previousCanvasDraggable.value = canvasStore.canvas!.allow_dragcanvas\n canvasStore.canvas!.allow_dragcanvas = false\n\n if (target instanceof LGraphGroup) {\n const group = target\n const [x, y] = group.pos\n const [w, h] = group.size\n\n const [left, top] = app.canvasPosToClientPos([x, y])\n inputStyle.value.left = `${left}px`\n inputStyle.value.top = `${top}px`\n\n const width = w * app.canvas.ds.scale\n const height = group.titleHeight * app.canvas.ds.scale\n inputStyle.value.width = `${width}px`\n inputStyle.value.height = `${height}px`\n\n const fontSize = group.font_size * app.canvas.ds.scale\n inputStyle.value.fontSize = `${fontSize}px`\n } else if (target instanceof LGraphNode) {\n const node = target\n const [x, y] = node.getBounding()\n const canvasWidth = node.width\n const canvasHeight = LiteGraph.NODE_TITLE_HEIGHT\n\n const [left, top] = app.canvasPosToClientPos([x, y])\n inputStyle.value.left = `${left}px`\n inputStyle.value.top = `${top}px`\n\n const width = canvasWidth * app.canvas.ds.scale\n const height = canvasHeight * a
|