mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-24 01:18:23 +00:00
moving editorFunc to Editor.jsx
This commit is contained in:
parent
601cb74f53
commit
c0e991720f
5 changed files with 1627 additions and 3435 deletions
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -3,7 +3,7 @@ import React from 'react';
|
|||
import config from 'config';
|
||||
import { RoomProvider } from '@y-presence/react';
|
||||
import Spinner from '@/_ui/Spinner';
|
||||
import { EditorFunc } from '@/Editor'; //!Update: EditorFunc to Editor.jsx
|
||||
import { Editor } from '@/Editor';
|
||||
const Y = require('yjs');
|
||||
const psl = require('psl');
|
||||
const { WebsocketProvider } = require('y-websocket');
|
||||
|
|
@ -65,7 +65,7 @@ export const RealtimeEditor = (props) => {
|
|||
|
||||
return (
|
||||
<RoomProvider awareness={provider.awareness} initialPresence={initialPresence}>
|
||||
<EditorFunc provider={provider} ymap={ydoc.getMap('appDef')} {...props} />
|
||||
<Editor provider={provider} ymap={ydoc.getMap('appDef')} {...props} />
|
||||
</RoomProvider>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2,4 +2,3 @@
|
|||
export * from './Editor';
|
||||
export * from './Viewer';
|
||||
export * from './DataSourceManager';
|
||||
export * from './EditorFunc';
|
||||
|
|
|
|||
|
|
@ -1471,6 +1471,35 @@ export const cloneComponents = (
|
|||
});
|
||||
};
|
||||
|
||||
// const getAllChildComponents = (allComponents, parentId) => {
|
||||
// const childComponents = [];
|
||||
|
||||
// Object.keys(allComponents).forEach((componentId) => {
|
||||
// const componentParentId = allComponents[componentId].component?.parent;
|
||||
|
||||
// const isParentTabORCalendar =
|
||||
// allComponents[parentId]?.component?.component === 'Tabs' ||
|
||||
// allComponents[parentId]?.component?.component === 'Calendar';
|
||||
|
||||
// if (componentParentId && isParentTabORCalendar) {
|
||||
// const childComponent = allComponents[componentId];
|
||||
// const childTabId = componentParentId.split('-').at(-1);
|
||||
// if (componentParentId === `${parentId}-${childTabId}`) {
|
||||
// childComponent.componentId = componentId;
|
||||
// childComponents.push(childComponent);
|
||||
// }
|
||||
// }
|
||||
|
||||
// if (componentParentId === parentId) {
|
||||
// const childComponent = allComponents[componentId];
|
||||
// childComponent.componentId = componentId;
|
||||
// childComponents.push(childComponent);
|
||||
// }
|
||||
// });
|
||||
|
||||
// return childComponents;
|
||||
// };
|
||||
|
||||
const getAllChildComponents = (allComponents, parentId) => {
|
||||
const childComponents = [];
|
||||
|
||||
|
|
@ -1487,6 +1516,10 @@ const getAllChildComponents = (allComponents, parentId) => {
|
|||
if (componentParentId === `${parentId}-${childTabId}`) {
|
||||
childComponent.componentId = componentId;
|
||||
childComponents.push(childComponent);
|
||||
|
||||
// Recursively find children of the current child component
|
||||
const childrenOfChild = getAllChildComponents(allComponents, componentId);
|
||||
childComponents.push(...childrenOfChild);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1494,6 +1527,10 @@ const getAllChildComponents = (allComponents, parentId) => {
|
|||
const childComponent = allComponents[componentId];
|
||||
childComponent.componentId = componentId;
|
||||
childComponents.push(childComponent);
|
||||
|
||||
// Recursively find children of the current child component
|
||||
const childrenOfChild = getAllChildComponents(allComponents, componentId);
|
||||
childComponents.push(...childrenOfChild);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -1598,6 +1635,8 @@ export const addComponents = (
|
|||
};
|
||||
|
||||
finalComponents[newComponentId] = newComponent;
|
||||
|
||||
// const doesComponentHaveChildren = getAllChildComponents
|
||||
});
|
||||
|
||||
if (currentPageId === pageId) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue