mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-25 23:54:55 +01:00
Minor package rename
This commit is contained in:
parent
ed457612f6
commit
e34c1649f1
34
packages/editor/src/components/header/index.tsx
Normal file
34
packages/editor/src/components/header/index.tsx
Normal file
@ -0,0 +1,34 @@
|
||||
import React from 'react';
|
||||
import ActionConfig from '../../classes/action-config';
|
||||
import MaterialToolbar from '@mui/material/Toolbar';
|
||||
import AppBar from '@mui/material/AppBar';
|
||||
import { ToolbarMenuItem } from '../toolbar/Toolbar';
|
||||
|
||||
/**
|
||||
* App bar
|
||||
* @param props.configurations the configurations array
|
||||
* @returns toolbar wich contains an entry for each configuration in the array
|
||||
*/
|
||||
const Header = (props: { configurations: ActionConfig[] }) => {
|
||||
return (
|
||||
<AppBar
|
||||
role="menubar"
|
||||
position="absolute"
|
||||
color="default"
|
||||
className="material-menubar"
|
||||
sx={{
|
||||
'& MuiButtonBase-root': {
|
||||
marginX: '1rem',
|
||||
},
|
||||
}}
|
||||
>
|
||||
<MaterialToolbar>
|
||||
{props.configurations.map((c, i) => {
|
||||
return <ToolbarMenuItem key={i} configuration={c} />;
|
||||
})}
|
||||
</MaterialToolbar>
|
||||
</AppBar>
|
||||
);
|
||||
};
|
||||
|
||||
export default Header;
|
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import ActionConfig from '../../classes/actions-config';
|
||||
import ActionConfig from '../../classes/action-config';
|
||||
import MaterialToolbar from '@mui/material/Toolbar';
|
||||
import AppBar from '@mui/material/AppBar';
|
||||
import { ToolbarMenuItem } from './Toolbar';
|
||||
|
@ -6,7 +6,7 @@ import Popover, { PopoverOrigin } from '@mui/material/Popover';
|
||||
import Tooltip from '@mui/material/Tooltip';
|
||||
import './appbar-buttons.css';
|
||||
import Box from '@mui/material/Box';
|
||||
import ActionConfig from '../../classes/actions-config';
|
||||
import ActionConfig from '../../classes/action-config';
|
||||
import ToolbarPosition, { defaultPosition } from './ToolbarPositionInterface';
|
||||
|
||||
/**
|
||||
|
12
packages/editor/src/components/toolbar/contents.tsx
Normal file
12
packages/editor/src/components/toolbar/contents.tsx
Normal file
@ -0,0 +1,12 @@
|
||||
import React from 'react';
|
||||
import { NoteForm, UrlForm } from './toolbarCustomComponents';
|
||||
|
||||
function linkContent(linkModel, closeModal): React.ReactElement {
|
||||
return <UrlForm closeModal={closeModal} urlModel={linkModel}></UrlForm>;
|
||||
}
|
||||
|
||||
function noteContent(noteModel, closeModal): React.ReactElement {
|
||||
return <NoteForm closeModal={closeModal} noteModel={noteModel}></NoteForm>;
|
||||
}
|
||||
|
||||
export { linkContent, noteContent };
|
@ -34,7 +34,7 @@ import LogoTextBlackSvg from '../../../images/logo-text-black.svg';
|
||||
import Palette from '@mui/icons-material/Square';
|
||||
import SquareOutlined from '@mui/icons-material/SquareOutlined';
|
||||
import { $msg, Designer } from '@wisemapping/mindplot';
|
||||
import ActionConfig from '../../classes/actions-config';
|
||||
import ActionConfig from '../../classes/action-config';
|
||||
import { SwitchValueDirection, NodePropertyValueModelBuilder } from './ToolbarValueModelBuilder';
|
||||
import {
|
||||
ColorPicker,
|
||||
|
@ -19,7 +19,7 @@ import Link from '@mui/material/Link';
|
||||
import Tab from '@mui/material/Tab';
|
||||
import Tabs from '@mui/material/Tabs';
|
||||
import { ToolbarMenuItem } from './Toolbar';
|
||||
import ActionConfig from '../../classes/actions-config';
|
||||
import ActionConfig from '../../classes/action-config';
|
||||
|
||||
/**
|
||||
* Color picker for toolbar
|
||||
|
@ -0,0 +1,10 @@
|
||||
import { useState, useRef } from 'react';
|
||||
import DefaultWidgetManager from '../../classes/default-widget-manager';
|
||||
|
||||
export const useMuiWidgetManager = (): [boolean, Element | undefined, DefaultWidgetManager] => {
|
||||
const [popoverOpen, setPopoverOpen] = useState(false);
|
||||
const [popoverTarget, setPopoverTarget] = useState(undefined);
|
||||
const widgetManager = useRef(new DefaultWidgetManager(setPopoverOpen, setPopoverTarget));
|
||||
|
||||
return [popoverOpen, popoverTarget, widgetManager.current];
|
||||
};
|
@ -9,7 +9,7 @@ import Toolbar, {
|
||||
ToolbarMenuItem,
|
||||
ToolbarSubmenu,
|
||||
} from '../../../src/components/toolbar/Toolbar';
|
||||
import ActionConfig from '../../../src/classes/actions-config';
|
||||
import ActionConfig from '../../../src/classes/action-config';
|
||||
import Menubar from '../../../src/components/toolbar/AppBar';
|
||||
require('babel-polyfill');
|
||||
jest.mock('../../../src/components/toolbar/appbar-buttons.css', () => '');
|
||||
|
Loading…
Reference in New Issue
Block a user