Line data Source code
1 : import { defineStore } from 'pinia'
2 : import { computed, ref } from 'vue'
3 :
4 : import type { ComfyNodeDefImpl } from '@/core/graph/nodeDef/ComfyNodeDefImpl'
5 :
6 2355 : export const useNodeHelpStore = defineStore('nodeHelp', () => {
7 50 : const currentHelpNode = ref<ComfyNodeDefImpl | null>(null)
8 50 : const isHelpOpen = computed(() => currentHelpNode.value !== null)
9 :
10 2 : function openHelp(nodeDef: ComfyNodeDefImpl) {
11 2 : currentHelpNode.value = nodeDef
12 : }
13 :
14 7 : function closeHelp() {
15 7 : currentHelpNode.value = null
16 : }
17 :
18 50 : return {
19 : currentHelpNode,
20 : isHelpOpen,
21 : openHelp,
22 : closeHelp
23 : }
24 : })
|