feat(core): Add support for building LLM applications (#7235)
This extracts all core and editor changes from #7246 and #7137, so that we can get these changes merged first. ADO-1120 [DB Tests](https://github.com/n8n-io/n8n/actions/runs/6379749011) [E2E Tests](https://github.com/n8n-io/n8n/actions/runs/6379751480) [Workflow Tests](https://github.com/n8n-io/n8n/actions/runs/6379752828) --------- Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com> Co-authored-by: Oleg Ivaniv <me@olegivaniv.com> Co-authored-by: Alex Grozav <alex@grozav.com> Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
committed by
GitHub
parent
04dfcd73be
commit
00a4b8b0c6
@@ -48,6 +48,7 @@ import PanelDragButton from './PanelDragButton.vue';
|
||||
import { LOCAL_STORAGE_MAIN_PANEL_RELATIVE_WIDTH, MAIN_NODE_PANEL_WIDTH } from '@/constants';
|
||||
import { debounceHelper } from '@/mixins/debounce';
|
||||
import { useNDVStore } from '@/stores/ndv.store';
|
||||
import { ndvEventBus } from '@/event-bus';
|
||||
|
||||
const SIDE_MARGIN = 24;
|
||||
const SIDE_PANELS_MARGIN = 80;
|
||||
@@ -118,9 +119,12 @@ export default defineComponent({
|
||||
setTimeout(() => {
|
||||
this.initialized = true;
|
||||
}, 0);
|
||||
|
||||
ndvEventBus.on('setPositionByName', this.setPositionByName);
|
||||
},
|
||||
beforeUnmount() {
|
||||
window.removeEventListener('resize', this.setTotalWidth);
|
||||
ndvEventBus.off('setPositionByName', this.setPositionByName);
|
||||
},
|
||||
computed: {
|
||||
...mapStores(useNDVStore),
|
||||
@@ -287,7 +291,7 @@ export default defineComponent({
|
||||
panelType: this.currentNodePaneType,
|
||||
dimensions: {
|
||||
relativeLeft: 1 - this.mainPanelDimensions.relativeWidth - this.maximumRightPosition,
|
||||
relativeRight: this.maximumRightPosition as number,
|
||||
relativeRight: this.maximumRightPosition,
|
||||
},
|
||||
});
|
||||
return;
|
||||
@@ -301,6 +305,15 @@ export default defineComponent({
|
||||
},
|
||||
});
|
||||
},
|
||||
setPositionByName(position: 'minLeft' | 'maxRight' | 'initial') {
|
||||
const positionByName: Record<string, number> = {
|
||||
minLeft: this.minimumLeftPosition,
|
||||
maxRight: this.maximumRightPosition,
|
||||
initial: this.getInitialLeftPosition(this.mainPanelDimensions.relativeWidth),
|
||||
};
|
||||
|
||||
this.setPositions(positionByName[position]);
|
||||
},
|
||||
pxToRelativeWidth(px: number) {
|
||||
return px / this.windowWidth;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user