@flowgram-vue/panel-manager-plugin 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/services/panel-restore.ts","../src/components/resize-bar/index.ts","../src/services/panel-config.ts","../src/utils.ts","../src/services/panel-factory.ts","../src/services/panel-manager.ts","../src/composables/use-global-css.ts","../src/composables/use-panel-manager.ts","../src/contexts.ts","../src/composables/use-panel.ts","../src/components/panel-layer/panel.ts","../src/components/panel-layer/css.ts","../src/components/panel-layer/panel-layer.ts","../src/components/panel-layer/docked-panel-layer.ts","../src/services/panel-layer.ts","../src/create-panel-manager-plugin.ts"],"names":["injectable","inject","onBeforeUnmount","defineComponent","ref","onMounted","h","clsx","PanelLayer","provide"],"mappings":";;;;;;;;;;;;;;;;;;;AAOO,IAAM,YAAA,0BAAsB,cAAc;AAO1C,IAAM,mBAAN,MAA+C;AAAA,EAA/C,WAAA,GAAA;AACL,IAAA,IAAA,CAAA,GAAA,uBAAU,GAAA,EAAiB;AAAA,EAAA;AAAA,EAE3B,KAAA,CAAM,GAAW,CAAA,EAAQ;AACvB,IAAA,IAAA,CAAK,GAAA,CAAI,GAAA,CAAI,CAAA,EAAG,CAAC,CAAA;AAAA,EACnB;AAAA,EAEA,QAAW,CAAA,EAA0B;AACnC,IAAA,OAAO,IAAA,CAAK,GAAA,CAAI,GAAA,CAAI,CAAC,CAAA;AAAA,EACvB;AACF,CAAA;AAVa,gBAAA,GAAN,eAAA,CAAA;AAAA,EADN,UAAA;AAAW,CAAA,EACC,gBAAA,CAAA;ACDb,IAAM,iBAAiB,eAAA,CAAgB;AAAA,EACrC,IAAA,EAAM,WAAA;AAAA,EACN,KAAA,EAAO;AAAA,IACL,IAAA,EAAM,EAAE,IAAA,EAAM,MAAA,EAAQ,UAAU,IAAA,EAAK;AAAA,IACrC,SAAA,EAAW,EAAE,IAAA,EAAM,MAAA,EAA+C,SAAS,MAA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iliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { injectable } from 'inversify';\n\nexport const PanelRestore = Symbol('PanelRestore');\nexport interface PanelRestore {\n store: (k: string, v: any) => void;\n restore: <T>(k: string) => T | undefined;\n}\n\n@injectable()\nexport class PanelRestoreImpl implements PanelRestore {\n map = new Map<string, any>();\n\n store(k: string, v: any) {\n this.map.set(k, v);\n }\n\n restore<T>(k: string): T | undefined {\n return this.map.get(k) as T;\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { defineComponent, h, onBeforeUnmount, ref, type PropType, type VNode } from 'vue';\n\nexport interface ResizeBarProps {\n size: number;\n direction?: 'vertical' | 'horizontal';\n onResize: (w: number) => void;\n}\n\nconst ResizeBarInner = defineComponent({\n name: 'ResizeBar',\n props: {\n size: { type: Number, required: true },\n direction: { type: String as PropType<'vertical' | 'horizontal'>, default: undefined },\n onResize: { type: Function as PropType<(w: number) => void>, required: true },\n },\n setup(props) {\n const currentPoint = ref<number | null>(null);\n const isDragging = ref(false);\n const isHovered = ref(false);\n const isVertical = () => props.direction === 'vertical';\n\n const onMouseMove = (e: MouseEvent) => {\n const delta = currentPoint.value! - (isVertical() ? e.clientX : e.clientY);\n props.onResize(props.size + delta);\n };\n\n const onMouseUp = () => {\n currentPoint.value = null;\n document.body.removeEventListener('mouseup', onMouseUp);\n document.body.removeEventListener('mousemove', onMouseMove);\n isDragging.value = false;\n };\n\n onBeforeUnmount(() => {\n document.body.removeEventListener('mouseup', onMouseUp);\n document.body.removeEventListener('mousemove', onMouseMove);\n });\n\n return () =>\n h(\n 'div',\n {\n onMousedown: (e: MouseEvent) => {\n currentPoint.value = isVertical() ? e.clientX : e.clientY;\n e.stopPropagation();\n e.preventDefault();\n isDragging.value = true;\n document.body.addEventListener('mouseup', onMouseUp);\n document.body.addEventListener('mousemove', onMouseMove);\n },\n onMouseenter: () => {\n isHovered.value = true;\n },\n onMouseleave: () => {\n isHovered.value = false;\n },\n style: {\n position: 'absolute',\n top: '0',\n left: '0',\n zIndex: 999,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n pointerEvents: 'auto',\n ...(isVertical()\n ? {\n cursor: 'ew-resize',\n height: '100%',\n marginLeft: '-5px',\n width: '10px',\n }\n : {\n cursor: 'ns-resize',\n width: '100%',\n marginTop: '-5px',\n height: '10px',\n }),\n },\n },\n [\n h('div', {\n style: {\n ...(isVertical()\n ? {\n width: '3px',\n height: '100%',\n }\n : {\n height: '3px',\n width: '100%',\n }),\n backgroundColor:\n isDragging.value || isHovered.value ? 'var(--g-playground-line)' : 'transparent',\n },\n }),\n ]\n );\n },\n});\n\nexport function ResizeBar(props: ResizeBarProps): VNode {\n return h(ResizeBarInner, props);\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport type { VNode } from 'vue';\nimport { PluginContext } from '@flowgram-vue/core';\n\nimport type { PanelFactory, PanelConfig } from '../types';\nimport { ResizeBar } from '../components/resize-bar';\nimport type { PanelLayerProps } from '../components/panel-layer';\n\nexport interface PanelManagerConfig {\n factories: PanelFactory<any>[];\n right: PanelConfig;\n bottom: PanelConfig;\n dockedRight: PanelConfig;\n dockedBottom: PanelConfig;\n /** Resizable, and multi-panel options mutually exclusive */\n autoResize: boolean;\n layerProps: PanelLayerProps;\n resizeBarRender: ({\n size,\n }: {\n size: number;\n direction?: 'vertical' | 'horizontal';\n onResize: (size: number) => void;\n }) => VNode | null;\n getPopupContainer: (ctx: PluginContext) => HTMLElement; // default playground.node.parentElement\n}\n\nexport const PanelManagerConfig = Symbol('PanelManagerConfig');\n\nexport const defineConfig = (config: Partial<PanelManagerConfig>) => {\n const defaultConfig: PanelManagerConfig = {\n right: {\n max: 1,\n },\n bottom: {\n max: 1,\n },\n dockedRight: {\n max: 1,\n },\n dockedBottom: {\n max: 1,\n },\n factories: [],\n autoResize: true,\n layerProps: {},\n resizeBarRender: ResizeBar,\n getPopupContainer: (ctx: PluginContext) => ctx.playground.node.parentNode as HTMLElement,\n };\n return {\n ...defaultConfig,\n ...config,\n };\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport const merge = <T>(...objs: Partial<T>[]) => {\n const result: any = {};\n\n for (const obj of objs) {\n if (!obj || typeof obj !== 'object') continue;\n\n for (const key of Object.keys(obj)) {\n const value = (obj as any)[key];\n\n if (result[key] === undefined) {\n result[key] = value;\n }\n }\n }\n\n return result as T;\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { createStore, StoreApi } from 'zustand/vanilla';\nimport { nanoid } from 'nanoid';\nimport { inject, injectable } from 'inversify';\nimport type { VNode } from 'vue';\n\nimport type { PanelFactory, PanelEntityConfig, Area } from '../types';\nimport { PanelRestore } from './panel-restore';\nimport { PanelManagerConfig } from './panel-config';\nimport { merge } from '../utils';\n\nexport const PanelEntityFactory = Symbol('PanelEntityFactory');\nexport type PanelEntityFactory = (options: {\n factory: PanelEntityFactoryConstant;\n config: PanelEntityConfigConstant;\n}) => PanelEntity;\n\nexport const PanelEntityFactoryConstant = Symbol('PanelEntityFactoryConstant');\nexport type PanelEntityFactoryConstant = PanelFactory<any>;\nexport const PanelEntityConfigConstant = Symbol('PanelEntityConfigConstant');\nexport type PanelEntityConfigConstant = PanelEntityConfig<any> & {\n area: Area;\n};\n\nconst PANEL_SIZE_DEFAULT = 400;\n\nexport interface PanelEntityState {\n size: number;\n fullscreen: boolean;\n visible: boolean;\n}\n\n@injectable()\nexport class PanelEntity {\n @inject(PanelRestore) restore: PanelRestore;\n\n /** 面板工厂 */\n @inject(PanelEntityFactoryConstant) public factory: PanelEntityFactoryConstant;\n\n @inject(PanelEntityConfigConstant) public config: PanelEntityConfigConstant;\n\n @inject(PanelManagerConfig) readonly globalConfig: PanelManagerConfig;\n\n private initialized = false;\n\n /** 实例唯一标识 */\n id: string = nanoid();\n\n /** 渲染缓存 */\n node: VNode | null = null;\n\n store: StoreApi<PanelEntityState>;\n\n get area() {\n return this.config.area;\n }\n\n get mode() {\n return this.config.area.startsWith('docked') ? 'docked' : 'floating';\n }\n\n get key() {\n return this.factory.key;\n }\n\n get renderer() {\n if (!this.node) {\n this.node = this.factory.render(this.config.props);\n }\n return this.node;\n }\n\n get fullscreen() {\n return this.store.getState().fullscreen;\n }\n\n set fullscreen(next: boolean) {\n this.store.setState({ fullscreen: next });\n }\n\n get resizable() {\n if (this.fullscreen) {\n return false;\n }\n return this.factory.resize !== undefined ? this.factory.resize : this.globalConfig.autoResize;\n }\n\n get keepDOM() {\n return this.factory.keepDOM;\n }\n\n get visible() {\n return this.store.getState().visible;\n }\n\n set visible(next: boolean) {\n this.store.setState({ visible: next });\n }\n\n get layer() {\n return document.querySelector(\n this.mode ? '.gedit-flow-panel-layer-wrap-docked' : '.gedit-flow-panel-layer-wrap-floating'\n );\n }\n\n init() {\n if (this.initialized) {\n return;\n }\n this.initialized = true;\n const cache = this.restore.restore<PanelEntityState>(this.key);\n\n const initialState = merge<PanelEntityState>(\n {\n size: this.config.defaultSize,\n fullscreen: this.config.fullscreen,\n },\n cache ? cache : {},\n {\n size: this.factory.defaultSize || PANEL_SIZE_DEFAULT,\n fullscreen: this.factory.fullscreen || false,\n ...(this.factory.keepDOM ? { visible: true } : {}),\n }\n );\n\n this.store = createStore<PanelEntityState>(() => initialState);\n }\n\n mergeState() {}\n\n dispose() {\n this.restore.store(this.key, this.store.getState());\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { injectable, inject } from 'inversify';\nimport { Emitter } from '@flowgram-vue/utils';\n\nimport { PanelManagerConfig } from './panel-config';\nimport type { Area, PanelEntityConfig, PanelFactory } from '../types';\nimport { PanelEntity, PanelEntityFactory } from './panel-factory';\n\n@injectable()\nexport class PanelManager {\n @inject(PanelManagerConfig) readonly config: PanelManagerConfig;\n\n @inject(PanelEntityFactory) readonly createPanel: PanelEntityFactory;\n\n readonly panelRegistry = new Map<string, PanelFactory<any>>();\n\n private panels = new Map<string, PanelEntity>();\n\n private onPanelsChangeEvent = new Emitter<void>();\n\n public onPanelsChange = this.onPanelsChangeEvent.event;\n\n init() {\n this.config.factories.forEach((factory) => this.register(factory));\n }\n\n /** registry panel factory */\n register<T extends any>(factory: PanelFactory<T>) {\n this.panelRegistry.set(factory.key, factory);\n }\n\n /** open panel */\n public open(key: string, area: Area = 'right', options?: PanelEntityConfig) {\n const factory = this.panelRegistry.get(key);\n if (!factory) {\n return;\n }\n\n const sameKeyPanels = this.getPanels(area).filter((p) => p.key === key);\n\n if (factory.keepDOM && sameKeyPanels.length) {\n const [panel] = sameKeyPanels;\n // move to last\n this.panels.delete(panel.id);\n this.panels.set(panel.id, panel);\n panel.visible = true;\n } else {\n if (!factory.allowDuplicates && sameKeyPanels.length) {\n sameKeyPanels.forEach((p) => this.remove(p.id));\n }\n const panel = this.createPanel({\n factory,\n config: {\n area,\n ...options,\n },\n });\n\n this.panels.set(panel.id, panel);\n }\n\n this.trim(area);\n this.onPanelsChangeEvent.fire();\n }\n\n /** close panel */\n public close(key?: string) {\n const panels = this.getPanels();\n const closedPanels = key ? panels.filter((p) => p.key === key) : panels;\n closedPanels.forEach((panel) => {\n this.remove(panel.id);\n });\n this.onPanelsChangeEvent.fire();\n }\n\n private trim(area: Area) {\n /** 1. general panel; 2. keepDOM visible panel */\n const panels = this.getPanels(area).filter((p) => !p.keepDOM || p.visible);\n const areaConfig = this.getAreaConfig(area);\n while (panels.length > areaConfig.max) {\n const removed = panels.shift();\n if (removed) {\n this.remove(removed.id);\n }\n }\n }\n\n private remove(id: string) {\n const panel = this.panels.get(id);\n if (!panel) {\n return;\n }\n if (panel.keepDOM) {\n panel.visible = false;\n } else {\n panel.dispose();\n this.panels.delete(id);\n }\n }\n\n getPanels(area?: Area) {\n const panels: PanelEntity[] = [];\n this.panels.forEach((panel) => {\n if (!area || panel.area === area) {\n panels.push(panel);\n }\n });\n return panels;\n }\n\n getAreaConfig(area: Area) {\n switch (area) {\n case 'docked-bottom':\n return this.config.dockedBottom;\n case 'docked-right':\n return this.config.dockedRight;\n case 'bottom':\n return this.config.bottom;\n case 'right':\n default:\n return this.config.right;\n }\n }\n\n dispose() {\n this.onPanelsChangeEvent.dispose();\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { onBeforeUnmount, onMounted } from 'vue';\n\ninterface UseGlobalCSSOptions {\n cssText: string;\n id: string;\n cleanup?: boolean;\n}\n\nexport const useGlobalCSS = ({ cssText, id, cleanup }: UseGlobalCSSOptions) => {\n onMounted(() => {\n if (typeof document === 'undefined') return;\n\n if (document.getElementById(id)) return;\n\n const style = document.createElement('style');\n style.id = id;\n style.textContent = cssText;\n document.head.appendChild(style);\n });\n\n onBeforeUnmount(() => {\n const existing = document.getElementById(id);\n if (existing && cleanup) existing.remove();\n });\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { useService } from '@flowgram-vue/core';\n\nimport { PanelManager } from '../services/panel-manager';\n\nexport const usePanelManager = () => useService<PanelManager>(PanelManager);\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport type { InjectionKey } from 'vue';\n\nimport type { PanelEntity } from './services/panel-factory';\n\nexport const PanelContextKey: InjectionKey<PanelEntity> = Symbol('PanelContext');\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { inject, onBeforeUnmount, shallowRef, type ShallowRef } from 'vue';\nimport type { StoreApi } from 'zustand';\nimport { shallow } from 'zustand/shallow';\n\nimport { PanelEntity, PanelEntityState } from '../services/panel-factory';\nimport { PanelContextKey } from '../contexts';\n\nexport const usePanel = (): PanelEntity => {\n const panel = inject(PanelContextKey);\n if (!panel) {\n throw new Error('usePanel must be used within a PanelContext provider');\n }\n return panel;\n};\n\nexport const usePanelStore = <T>(selector: (s: PanelEntityState) => T): ShallowRef<T> => {\n const panel = usePanel();\n const selected = shallowRef(selector(panel.store.getState()));\n const unsubscribe = (panel.store as StoreApi<PanelEntityState>).subscribe((state) => {\n const next = selector(state);\n if (!shallow(selected.value, next)) {\n selected.value = next;\n }\n });\n onBeforeUnmount(unsubscribe);\n return selected;\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport {\n computed,\n defineComponent,\n h,\n onBeforeUnmount,\n onMounted,\n provide,\n ref,\n type PropType,\n} from 'vue';\nimport clsx from 'clsx';\n\nimport type { Area } from '../../types';\nimport type { PanelEntity } from '../../services/panel-factory';\nimport { usePanelManager } from '../../composables/use-panel-manager';\nimport { usePanelStore } from '../../composables/use-panel';\nimport { PanelContextKey } from '../../contexts';\n\nconst PanelItem = defineComponent({\n name: 'PanelItem',\n props: {\n panel: { type: Object as PropType<PanelEntity>, required: true },\n hidden: { type: Boolean, default: false },\n },\n setup(props) {\n const panelManager = usePanelManager();\n const elRef = ref<HTMLDivElement | null>(null);\n const isHorizontal = computed(() => ['right', 'docked-right'].includes(props.panel.area));\n const storeState = usePanelStore((s) => ({\n size: s.size,\n fullscreen: s.fullscreen,\n }));\n const layerSize = ref(storeState.value.size);\n\n const currentSize = computed(() =>\n storeState.value.fullscreen ? layerSize.value : storeState.value.size\n );\n const sizeStyle = computed(() =>\n isHorizontal.value ? { width: `${currentSize.value}px` } : { height: `${currentSize.value}px` }\n );\n\n const handleResize = (next: number) => {\n let nextSize = next;\n if (typeof props.panel.factory.maxSize === 'number' && nextSize > props.panel.factory.maxSize) {\n nextSize = props.panel.factory.maxSize;\n } else if (\n typeof props.panel.factory.minSize === 'number' &&\n nextSize < props.panel.factory.minSize\n ) {\n nextSize = props.panel.factory.minSize;\n }\n props.panel.store.setState({ size: nextSize });\n };\n\n onMounted(() => {\n if (elRef.value && !storeState.value.fullscreen) {\n const { width, height } = elRef.value.getBoundingClientRect();\n const realSize = isHorizontal.value ? width : height;\n props.panel.store.setState({ size: realSize });\n }\n });\n\n let observer: ResizeObserver | undefined;\n const syncObserver = () => {\n observer?.disconnect();\n observer = undefined;\n if (!storeState.value.fullscreen) {\n return;\n }\n const layer = props.panel.layer;\n if (!layer) {\n return;\n }\n observer = new ResizeObserver(([entry]) => {\n const { width, height } = entry.contentRect;\n layerSize.value = isHorizontal.value ? width : height;\n });\n observer.observe(layer);\n };\n\n onMounted(syncObserver);\n onBeforeUnmount(() => observer?.disconnect());\n\n return () => {\n void storeState.value.fullscreen;\n syncObserver();\n const resizeBar = props.panel.resizable\n ? panelManager.config.resizeBarRender({\n size: storeState.value.size,\n direction: isHorizontal.value ? 'vertical' : 'horizontal',\n onResize: handleResize,\n })\n : null;\n return h(\n 'div',\n {\n class: clsx(\n 'gedit-flow-panel-wrap',\n isHorizontal.value ? 'panel-horizontal' : 'panel-vertical'\n ),\n ref: elRef,\n style: {\n display: props.hidden ? 'none' : 'block',\n ...props.panel.factory.style,\n ...props.panel.config.style,\n ...sizeStyle.value,\n },\n },\n [resizeBar, props.panel.renderer]\n );\n };\n },\n});\n\nconst PanelContextWrap = defineComponent({\n name: 'PanelContextWrap',\n props: {\n panel: { type: Object as PropType<PanelEntity>, required: true },\n hidden: { type: Boolean, default: false },\n },\n setup(props) {\n provide(PanelContextKey, props.panel);\n return () => h(PanelItem as any, { panel: props.panel, hidden: props.hidden });\n },\n});\n\nexport const PanelArea = defineComponent({\n name: 'PanelArea',\n props: {\n area: { type: String as PropType<Area>, required: true },\n },\n setup(props) {\n const panelManager = usePanelManager();\n const panels = ref(panelManager.getPanels(props.area));\n let pending: ReturnType<typeof setTimeout> | undefined;\n\n const dispose = panelManager.onPanelsChange(() => {\n if (pending) {\n clearTimeout(pending);\n }\n pending = setTimeout(() => {\n panels.value = panelManager.getPanels(props.area);\n }, 0);\n });\n\n onBeforeUnmount(() => {\n if (pending) {\n clearTimeout(pending);\n }\n dispose.dispose();\n });\n\n return () =>\n panels.value.map((panel) =>\n h(PanelContextWrap as any, {\n key: panel.id,\n panel,\n hidden: !!(panel.keepDOM && !panel.visible),\n })\n );\n },\n});\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport const globalCSS = `\n .gedit-flow-panel-layer-wrap * {\n box-sizing: border-box;\n }\n .gedit-flow-panel-layer-wrap {\n position: absolute;\n top: 0;\n left: 0;\n display: flex;\n width: 100%;\n height: 100%;\n overflow: hidden;\n }\n .gedit-flow-panel-layer-wrap-docked {\n\n }\n .gedit-flow-panel-layer-wrap-floating {\n pointer-events: none;\n }\n\n .gedit-flow-panel-left-area {\n width: 100%;\n min-width: 0;\n flex-grow: 0;\n flex-shrink: 1;\n display: flex;\n flex-direction: column;\n }\n .gedit-flow-panel-right-area {\n height: 100%;\n flex-grow: 1;\n flex-shrink: 0;\n min-width: 0;\n display: flex;\n max-width: 100%;\n }\n\n .gedit-flow-panel-main-area {\n position: relative;\n overflow: hidden;\n flex-grow: 0;\n flex-shrink: 1;\n width: 100%;\n height: 100%;\n }\n .gedit-flow-panel-bottom-area {\n flex-grow: 1;\n flex-shrink: 0;\n width: 100%;\n min-height: 0;\n }\n .gedit-flow-panel-wrap {\n pointer-events: auto;\n overflow: auto;\n position: relative;\n }\n .gedit-flow-panel-wrap.panel-horizontal {\n height: 100%;\n }\n .gedit-flow-panel-wrap.panel-vertical {\n width: 100%;\n }\n`;\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { defineComponent, h, type CSSProperties, type PropType, type VNode } from 'vue';\nimport clsx from 'clsx';\n\nimport { useGlobalCSS } from '../../composables/use-global-css';\nimport { PanelArea } from './panel';\nimport { globalCSS } from './css';\n\nexport interface PanelLayerProps {\n /** 模式:悬浮|挤压 */\n mode?: 'floating' | 'docked';\n className?: string;\n style?: CSSProperties;\n children?: VNode | VNode[];\n}\n\nexport const PanelLayer = defineComponent({\n name: 'PanelLayer',\n props: {\n mode: { type: String as PropType<'floating' | 'docked'>, default: 'floating' },\n className: { type: String, default: undefined },\n style: { type: Object as PropType<CSSProperties>, default: undefined },\n },\n setup(props, { slots }) {\n useGlobalCSS({\n cssText: globalCSS,\n id: 'flow-panel-layer-css',\n });\n\n return () =>\n h(\n 'div',\n {\n class: clsx(\n 'gedit-flow-panel-layer-wrap',\n props.mode === 'docked' && 'gedit-flow-panel-layer-wrap-docked',\n props.mode === 'floating' && 'gedit-flow-panel-layer-wrap-floating',\n props.className\n ),\n style: props.style,\n },\n [\n h('div', { class: 'gedit-flow-panel-left-area' }, [\n h('div', { class: 'gedit-flow-panel-main-area' }, slots.default?.()),\n h('div', { class: 'gedit-flow-panel-bottom-area' }, [\n h(PanelArea, { area: props.mode === 'docked' ? 'docked-bottom' : 'bottom' }),\n ]),\n ]),\n h('div', { class: 'gedit-flow-panel-right-area' }, [\n h(PanelArea, { area: props.mode === 'docked' ? 'docked-right' : 'right' }),\n ]),\n ]\n );\n },\n});\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { defineComponent, h, type CSSProperties } from 'vue';\n\nimport { PanelLayer, type PanelLayerProps } from './panel-layer';\n\nexport type DockedPanelLayerProps = Omit<PanelLayerProps, 'mode'>;\n\nexport const DockedPanelLayer = defineComponent({\n name: 'DockedPanelLayer',\n setup(_props: DockedPanelLayerProps, { attrs, slots }) {\n return () =>\n h(\n PanelLayer,\n {\n mode: 'docked',\n className: attrs.className as string | undefined,\n style: attrs.style as CSSProperties | undefined,\n },\n {\n default: () => slots.default?.(),\n }\n );\n },\n});\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { defineComponent, h, provide, Teleport, type VNode } from 'vue';\nimport { injectable, inject } from 'inversify';\nimport { domUtils, Disposable } from '@flowgram-vue/utils';\nimport {\n Layer,\n Playground,\n PlaygroundContainerFactory,\n PlaygroundVueContainerKey,\n PlaygroundVueRefKey,\n PluginContext,\n} from '@flowgram-vue/core';\n\nimport { PanelLayer as PanelLayerComp } from '../components/panel-layer';\nimport { PanelManagerConfig } from './panel-config';\n\n@injectable()\nexport class PanelLayer extends Layer {\n @inject(PanelManagerConfig) private readonly panelConfig: PanelManagerConfig;\n\n @inject(PluginContext) private readonly pluginContext: PluginContext;\n\n @inject(PlaygroundContainerFactory)\n private readonly playgroundContainer: PlaygroundContainerFactory;\n\n readonly panelRoot = domUtils.createDivWithClass('gedit-flow-panel-layer');\n\n layout: VNode | null = null;\n\n onReady(): void {\n this.panelConfig.getPopupContainer(this.pluginContext).appendChild(this.panelRoot);\n this.toDispose.push(\n Disposable.create(() => {\n this.panelRoot.remove();\n })\n );\n const commonStyle = {\n pointerEvents: 'none',\n width: '100%',\n height: '100%',\n position: 'absolute',\n left: 0,\n top: 0,\n zIndex: 100,\n };\n domUtils.setStyle(this.panelRoot, commonStyle);\n }\n\n render(): VNode {\n if (!this.layout) {\n const { children, ...layoutProps } = this.panelConfig.layerProps;\n const playgroundContainer = this.playgroundContainer;\n const panelRoot = this.panelRoot;\n const LayerProvide = defineComponent({\n name: 'PanelLayerProvide',\n setup() {\n provide(PlaygroundVueContainerKey, playgroundContainer as any);\n try {\n provide(PlaygroundVueRefKey, playgroundContainer.get(Playground));\n } catch {\n // ignore\n }\n return () =>\n h(Teleport, { to: panelRoot }, [\n h(PanelLayerComp, layoutProps as any, () => children as any),\n ]);\n },\n });\n this.layout = h(LayerProvide);\n }\n return this.layout;\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { definePluginCreator } from '@flowgram-vue/core';\n\nimport {\n PanelEntityFactory,\n PanelEntity,\n PanelEntityFactoryConstant,\n PanelEntityConfigConstant,\n} from './services/panel-factory';\nimport { defineConfig } from './services/panel-config';\nimport {\n PanelManager,\n PanelManagerConfig,\n PanelLayer,\n PanelRestore,\n PanelRestoreImpl,\n} from './services';\n\nexport const createPanelManagerPlugin = definePluginCreator<Partial<PanelManagerConfig>>({\n onBind: ({ bind }, opt) => {\n bind(PanelManager).to(PanelManager).inSingletonScope();\n bind(PanelRestore).to(PanelRestoreImpl).inSingletonScope();\n bind(PanelManagerConfig).toConstantValue(defineConfig(opt));\n bind(PanelEntityFactory).toFactory(\n (context) =>\n ({\n factory,\n config,\n }: {\n factory: PanelEntityFactoryConstant;\n config: PanelEntityConfigConstant;\n }) => {\n const container = context.container.createChild();\n container.bind(PanelEntityFactoryConstant).toConstantValue(factory);\n container.bind(PanelEntityConfigConstant).toConstantValue(config);\n const panel = container.resolve(PanelEntity);\n panel.init();\n return panel;\n }\n );\n },\n onInit(ctx) {\n ctx.playground.registerLayer(PanelLayer);\n const panelManager = ctx.container.get<PanelManager>(PanelManager);\n panelManager.init();\n },\n});\n"]}
package/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "@flowgram-vue/panel-manager-plugin",
3
+ "version": "0.2.0",
4
+ "type": "module",
5
+ "homepage": "https://flowgram.ai/",
6
+ "repository": "https://github.com/Crayon-hua/flowgram-vue",
7
+ "license": "MIT",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js",
12
+ "require": "./dist/index.cjs"
13
+ }
14
+ },
15
+ "main": "./dist/index.cjs",
16
+ "module": "./dist/index.js",
17
+ "types": "./dist/index.d.ts",
18
+ "files": [
19
+ "src",
20
+ "dist"
21
+ ],
22
+ "dependencies": {
23
+ "clsx": "^1.1.1",
24
+ "inversify": "^6.0.1",
25
+ "nanoid": "^5.0.9",
26
+ "zustand": "^4.5.5",
27
+ "@flowgram-vue/core": "0.2.0",
28
+ "@flowgram-vue/utils": "0.2.0"
29
+ },
30
+ "peerDependencies": {
31
+ "vue": "^3.5.0"
32
+ },
33
+ "devDependencies": {
34
+ "@types/node": "^20",
35
+ "@vitest/coverage-v8": "^3.2.4",
36
+ "eslint": "^9.0.0",
37
+ "jsdom": "^26.1.0",
38
+ "typescript": "^5.8.3",
39
+ "vitest": "^3.2.4",
40
+ "vue": "^3.5.18",
41
+ "@flowgram-vue/build-config": "0.2.0",
42
+ "@flowgram-vue/eslint-config": "0.2.0",
43
+ "@flowgram-vue/ts-config": "0.2.0"
44
+ },
45
+ "publishConfig": {
46
+ "access": "public",
47
+ "registry": "https://registry.npmjs.org/"
48
+ },
49
+ "scripts": {
50
+ "build": "flowgram-build",
51
+ "test": "vitest run --passWithNoTests",
52
+ "lint": "eslint .",
53
+ "ts-check": "tsc --noEmit",
54
+ "type-check": "tsc --noEmit",
55
+ "build:fast": "flowgram-build --fast",
56
+ "build:watch": "flowgram-build --watch"
57
+ }
58
+ }
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ export const globalCSS = `
7
+ .gedit-flow-panel-layer-wrap * {
8
+ box-sizing: border-box;
9
+ }
10
+ .gedit-flow-panel-layer-wrap {
11
+ position: absolute;
12
+ top: 0;
13
+ left: 0;
14
+ display: flex;
15
+ width: 100%;
16
+ height: 100%;
17
+ overflow: hidden;
18
+ }
19
+ .gedit-flow-panel-layer-wrap-docked {
20
+
21
+ }
22
+ .gedit-flow-panel-layer-wrap-floating {
23
+ pointer-events: none;
24
+ }
25
+
26
+ .gedit-flow-panel-left-area {
27
+ width: 100%;
28
+ min-width: 0;
29
+ flex-grow: 0;
30
+ flex-shrink: 1;
31
+ display: flex;
32
+ flex-direction: column;
33
+ }
34
+ .gedit-flow-panel-right-area {
35
+ height: 100%;
36
+ flex-grow: 1;
37
+ flex-shrink: 0;
38
+ min-width: 0;
39
+ display: flex;
40
+ max-width: 100%;
41
+ }
42
+
43
+ .gedit-flow-panel-main-area {
44
+ position: relative;
45
+ overflow: hidden;
46
+ flex-grow: 0;
47
+ flex-shrink: 1;
48
+ width: 100%;
49
+ height: 100%;
50
+ }
51
+ .gedit-flow-panel-bottom-area {
52
+ flex-grow: 1;
53
+ flex-shrink: 0;
54
+ width: 100%;
55
+ min-height: 0;
56
+ }
57
+ .gedit-flow-panel-wrap {
58
+ pointer-events: auto;
59
+ overflow: auto;
60
+ position: relative;
61
+ }
62
+ .gedit-flow-panel-wrap.panel-horizontal {
63
+ height: 100%;
64
+ }
65
+ .gedit-flow-panel-wrap.panel-vertical {
66
+ width: 100%;
67
+ }
68
+ `;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ import { defineComponent, h, type CSSProperties } from 'vue';
7
+
8
+ import { PanelLayer, type PanelLayerProps } from './panel-layer';
9
+
10
+ export type DockedPanelLayerProps = Omit<PanelLayerProps, 'mode'>;
11
+
12
+ export const DockedPanelLayer = defineComponent({
13
+ name: 'DockedPanelLayer',
14
+ setup(_props: DockedPanelLayerProps, { attrs, slots }) {
15
+ return () =>
16
+ h(
17
+ PanelLayer,
18
+ {
19
+ mode: 'docked',
20
+ className: attrs.className as string | undefined,
21
+ style: attrs.style as CSSProperties | undefined,
22
+ },
23
+ {
24
+ default: () => slots.default?.(),
25
+ }
26
+ );
27
+ },
28
+ });
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ export { PanelLayer, type PanelLayerProps } from './panel-layer';
7
+ export { DockedPanelLayer, type DockedPanelLayerProps } from './docked-panel-layer';
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ import { defineComponent, h, type CSSProperties, type PropType, type VNode } from 'vue';
7
+ import clsx from 'clsx';
8
+
9
+ import { useGlobalCSS } from '../../composables/use-global-css';
10
+ import { PanelArea } from './panel';
11
+ import { globalCSS } from './css';
12
+
13
+ export interface PanelLayerProps {
14
+ /** 模式:悬浮|挤压 */
15
+ mode?: 'floating' | 'docked';
16
+ className?: string;
17
+ style?: CSSProperties;
18
+ children?: VNode | VNode[];
19
+ }
20
+
21
+ export const PanelLayer = defineComponent({
22
+ name: 'PanelLayer',
23
+ props: {
24
+ mode: { type: String as PropType<'floating' | 'docked'>, default: 'floating' },
25
+ className: { type: String, default: undefined },
26
+ style: { type: Object as PropType<CSSProperties>, default: undefined },
27
+ },
28
+ setup(props, { slots }) {
29
+ useGlobalCSS({
30
+ cssText: globalCSS,
31
+ id: 'flow-panel-layer-css',
32
+ });
33
+
34
+ return () =>
35
+ h(
36
+ 'div',
37
+ {
38
+ class: clsx(
39
+ 'gedit-flow-panel-layer-wrap',
40
+ props.mode === 'docked' && 'gedit-flow-panel-layer-wrap-docked',
41
+ props.mode === 'floating' && 'gedit-flow-panel-layer-wrap-floating',
42
+ props.className
43
+ ),
44
+ style: props.style,
45
+ },
46
+ [
47
+ h('div', { class: 'gedit-flow-panel-left-area' }, [
48
+ h('div', { class: 'gedit-flow-panel-main-area' }, slots.default?.()),
49
+ h('div', { class: 'gedit-flow-panel-bottom-area' }, [
50
+ h(PanelArea, { area: props.mode === 'docked' ? 'docked-bottom' : 'bottom' }),
51
+ ]),
52
+ ]),
53
+ h('div', { class: 'gedit-flow-panel-right-area' }, [
54
+ h(PanelArea, { area: props.mode === 'docked' ? 'docked-right' : 'right' }),
55
+ ]),
56
+ ]
57
+ );
58
+ },
59
+ });
@@ -0,0 +1,167 @@
1
+ /**
2
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ import {
7
+ computed,
8
+ defineComponent,
9
+ h,
10
+ onBeforeUnmount,
11
+ onMounted,
12
+ provide,
13
+ ref,
14
+ type PropType,
15
+ } from 'vue';
16
+ import clsx from 'clsx';
17
+
18
+ import type { Area } from '../../types';
19
+ import type { PanelEntity } from '../../services/panel-factory';
20
+ import { usePanelManager } from '../../composables/use-panel-manager';
21
+ import { usePanelStore } from '../../composables/use-panel';
22
+ import { PanelContextKey } from '../../contexts';
23
+
24
+ const PanelItem = defineComponent({
25
+ name: 'PanelItem',
26
+ props: {
27
+ panel: { type: Object as PropType<PanelEntity>, required: true },
28
+ hidden: { type: Boolean, default: false },
29
+ },
30
+ setup(props) {
31
+ const panelManager = usePanelManager();
32
+ const elRef = ref<HTMLDivElement | null>(null);
33
+ const isHorizontal = computed(() => ['right', 'docked-right'].includes(props.panel.area));
34
+ const storeState = usePanelStore((s) => ({
35
+ size: s.size,
36
+ fullscreen: s.fullscreen,
37
+ }));
38
+ const layerSize = ref(storeState.value.size);
39
+
40
+ const currentSize = computed(() =>
41
+ storeState.value.fullscreen ? layerSize.value : storeState.value.size
42
+ );
43
+ const sizeStyle = computed(() =>
44
+ isHorizontal.value ? { width: `${currentSize.value}px` } : { height: `${currentSize.value}px` }
45
+ );
46
+
47
+ const handleResize = (next: number) => {
48
+ let nextSize = next;
49
+ if (typeof props.panel.factory.maxSize === 'number' && nextSize > props.panel.factory.maxSize) {
50
+ nextSize = props.panel.factory.maxSize;
51
+ } else if (
52
+ typeof props.panel.factory.minSize === 'number' &&
53
+ nextSize < props.panel.factory.minSize
54
+ ) {
55
+ nextSize = props.panel.factory.minSize;
56
+ }
57
+ props.panel.store.setState({ size: nextSize });
58
+ };
59
+
60
+ onMounted(() => {
61
+ if (elRef.value && !storeState.value.fullscreen) {
62
+ const { width, height } = elRef.value.getBoundingClientRect();
63
+ const realSize = isHorizontal.value ? width : height;
64
+ props.panel.store.setState({ size: realSize });
65
+ }
66
+ });
67
+
68
+ let observer: ResizeObserver | undefined;
69
+ const syncObserver = () => {
70
+ observer?.disconnect();
71
+ observer = undefined;
72
+ if (!storeState.value.fullscreen) {
73
+ return;
74
+ }
75
+ const layer = props.panel.layer;
76
+ if (!layer) {
77
+ return;
78
+ }
79
+ observer = new ResizeObserver(([entry]) => {
80
+ const { width, height } = entry.contentRect;
81
+ layerSize.value = isHorizontal.value ? width : height;
82
+ });
83
+ observer.observe(layer);
84
+ };
85
+
86
+ onMounted(syncObserver);
87
+ onBeforeUnmount(() => observer?.disconnect());
88
+
89
+ return () => {
90
+ void storeState.value.fullscreen;
91
+ syncObserver();
92
+ const resizeBar = props.panel.resizable
93
+ ? panelManager.config.resizeBarRender({
94
+ size: storeState.value.size,
95
+ direction: isHorizontal.value ? 'vertical' : 'horizontal',
96
+ onResize: handleResize,
97
+ })
98
+ : null;
99
+ return h(
100
+ 'div',
101
+ {
102
+ class: clsx(
103
+ 'gedit-flow-panel-wrap',
104
+ isHorizontal.value ? 'panel-horizontal' : 'panel-vertical'
105
+ ),
106
+ ref: elRef,
107
+ style: {
108
+ display: props.hidden ? 'none' : 'block',
109
+ ...props.panel.factory.style,
110
+ ...props.panel.config.style,
111
+ ...sizeStyle.value,
112
+ },
113
+ },
114
+ [resizeBar, props.panel.renderer]
115
+ );
116
+ };
117
+ },
118
+ });
119
+
120
+ const PanelContextWrap = defineComponent({
121
+ name: 'PanelContextWrap',
122
+ props: {
123
+ panel: { type: Object as PropType<PanelEntity>, required: true },
124
+ hidden: { type: Boolean, default: false },
125
+ },
126
+ setup(props) {
127
+ provide(PanelContextKey, props.panel);
128
+ return () => h(PanelItem as any, { panel: props.panel, hidden: props.hidden });
129
+ },
130
+ });
131
+
132
+ export const PanelArea = defineComponent({
133
+ name: 'PanelArea',
134
+ props: {
135
+ area: { type: String as PropType<Area>, required: true },
136
+ },
137
+ setup(props) {
138
+ const panelManager = usePanelManager();
139
+ const panels = ref(panelManager.getPanels(props.area));
140
+ let pending: ReturnType<typeof setTimeout> | undefined;
141
+
142
+ const dispose = panelManager.onPanelsChange(() => {
143
+ if (pending) {
144
+ clearTimeout(pending);
145
+ }
146
+ pending = setTimeout(() => {
147
+ panels.value = panelManager.getPanels(props.area);
148
+ }, 0);
149
+ });
150
+
151
+ onBeforeUnmount(() => {
152
+ if (pending) {
153
+ clearTimeout(pending);
154
+ }
155
+ dispose.dispose();
156
+ });
157
+
158
+ return () =>
159
+ panels.value.map((panel) =>
160
+ h(PanelContextWrap as any, {
161
+ key: panel.id,
162
+ panel,
163
+ hidden: !!(panel.keepDOM && !panel.visible),
164
+ })
165
+ );
166
+ },
167
+ });
@@ -0,0 +1,109 @@
1
+ /**
2
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ import { defineComponent, h, onBeforeUnmount, ref, type PropType, type VNode } from 'vue';
7
+
8
+ export interface ResizeBarProps {
9
+ size: number;
10
+ direction?: 'vertical' | 'horizontal';
11
+ onResize: (w: number) => void;
12
+ }
13
+
14
+ const ResizeBarInner = defineComponent({
15
+ name: 'ResizeBar',
16
+ props: {
17
+ size: { type: Number, required: true },
18
+ direction: { type: String as PropType<'vertical' | 'horizontal'>, default: undefined },
19
+ onResize: { type: Function as PropType<(w: number) => void>, required: true },
20
+ },
21
+ setup(props) {
22
+ const currentPoint = ref<number | null>(null);
23
+ const isDragging = ref(false);
24
+ const isHovered = ref(false);
25
+ const isVertical = () => props.direction === 'vertical';
26
+
27
+ const onMouseMove = (e: MouseEvent) => {
28
+ const delta = currentPoint.value! - (isVertical() ? e.clientX : e.clientY);
29
+ props.onResize(props.size + delta);
30
+ };
31
+
32
+ const onMouseUp = () => {
33
+ currentPoint.value = null;
34
+ document.body.removeEventListener('mouseup', onMouseUp);
35
+ document.body.removeEventListener('mousemove', onMouseMove);
36
+ isDragging.value = false;
37
+ };
38
+
39
+ onBeforeUnmount(() => {
40
+ document.body.removeEventListener('mouseup', onMouseUp);
41
+ document.body.removeEventListener('mousemove', onMouseMove);
42
+ });
43
+
44
+ return () =>
45
+ h(
46
+ 'div',
47
+ {
48
+ onMousedown: (e: MouseEvent) => {
49
+ currentPoint.value = isVertical() ? e.clientX : e.clientY;
50
+ e.stopPropagation();
51
+ e.preventDefault();
52
+ isDragging.value = true;
53
+ document.body.addEventListener('mouseup', onMouseUp);
54
+ document.body.addEventListener('mousemove', onMouseMove);
55
+ },
56
+ onMouseenter: () => {
57
+ isHovered.value = true;
58
+ },
59
+ onMouseleave: () => {
60
+ isHovered.value = false;
61
+ },
62
+ style: {
63
+ position: 'absolute',
64
+ top: '0',
65
+ left: '0',
66
+ zIndex: 999,
67
+ display: 'flex',
68
+ alignItems: 'center',
69
+ justifyContent: 'center',
70
+ pointerEvents: 'auto',
71
+ ...(isVertical()
72
+ ? {
73
+ cursor: 'ew-resize',
74
+ height: '100%',
75
+ marginLeft: '-5px',
76
+ width: '10px',
77
+ }
78
+ : {
79
+ cursor: 'ns-resize',
80
+ width: '100%',
81
+ marginTop: '-5px',
82
+ height: '10px',
83
+ }),
84
+ },
85
+ },
86
+ [
87
+ h('div', {
88
+ style: {
89
+ ...(isVertical()
90
+ ? {
91
+ width: '3px',
92
+ height: '100%',
93
+ }
94
+ : {
95
+ height: '3px',
96
+ width: '100%',
97
+ }),
98
+ backgroundColor:
99
+ isDragging.value || isHovered.value ? 'var(--g-playground-line)' : 'transparent',
100
+ },
101
+ }),
102
+ ]
103
+ );
104
+ },
105
+ });
106
+
107
+ export function ResizeBar(props: ResizeBarProps): VNode {
108
+ return h(ResizeBarInner, props);
109
+ }
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ import { onBeforeUnmount, onMounted } from 'vue';
7
+
8
+ interface UseGlobalCSSOptions {
9
+ cssText: string;
10
+ id: string;
11
+ cleanup?: boolean;
12
+ }
13
+
14
+ export const useGlobalCSS = ({ cssText, id, cleanup }: UseGlobalCSSOptions) => {
15
+ onMounted(() => {
16
+ if (typeof document === 'undefined') return;
17
+
18
+ if (document.getElementById(id)) return;
19
+
20
+ const style = document.createElement('style');
21
+ style.id = id;
22
+ style.textContent = cssText;
23
+ document.head.appendChild(style);
24
+ });
25
+
26
+ onBeforeUnmount(() => {
27
+ const existing = document.getElementById(id);
28
+ if (existing && cleanup) existing.remove();
29
+ });
30
+ };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ import { useService } from '@flowgram-vue/core';
7
+
8
+ import { PanelManager } from '../services/panel-manager';
9
+
10
+ export const usePanelManager = () => useService<PanelManager>(PanelManager);