Minor package rename

This commit is contained in:
Paulo Gustavo Veiga 2022-10-06 20:41:02 -07:00
parent ed457612f6
commit e34c1649f1
9 changed files with 61 additions and 5 deletions

View 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;

View File

@ -1,5 +1,5 @@
import React from 'react'; import React from 'react';
import ActionConfig from '../../classes/actions-config'; import ActionConfig from '../../classes/action-config';
import MaterialToolbar from '@mui/material/Toolbar'; import MaterialToolbar from '@mui/material/Toolbar';
import AppBar from '@mui/material/AppBar'; import AppBar from '@mui/material/AppBar';
import { ToolbarMenuItem } from './Toolbar'; import { ToolbarMenuItem } from './Toolbar';

View File

@ -6,7 +6,7 @@ import Popover, { PopoverOrigin } from '@mui/material/Popover';
import Tooltip from '@mui/material/Tooltip'; import Tooltip from '@mui/material/Tooltip';
import './appbar-buttons.css'; import './appbar-buttons.css';
import Box from '@mui/material/Box'; import Box from '@mui/material/Box';
import ActionConfig from '../../classes/actions-config'; import ActionConfig from '../../classes/action-config';
import ToolbarPosition, { defaultPosition } from './ToolbarPositionInterface'; import ToolbarPosition, { defaultPosition } from './ToolbarPositionInterface';
/** /**

View 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 };

View File

@ -34,7 +34,7 @@ import LogoTextBlackSvg from '../../../images/logo-text-black.svg';
import Palette from '@mui/icons-material/Square'; import Palette from '@mui/icons-material/Square';
import SquareOutlined from '@mui/icons-material/SquareOutlined'; import SquareOutlined from '@mui/icons-material/SquareOutlined';
import { $msg, Designer } from '@wisemapping/mindplot'; import { $msg, Designer } from '@wisemapping/mindplot';
import ActionConfig from '../../classes/actions-config'; import ActionConfig from '../../classes/action-config';
import { SwitchValueDirection, NodePropertyValueModelBuilder } from './ToolbarValueModelBuilder'; import { SwitchValueDirection, NodePropertyValueModelBuilder } from './ToolbarValueModelBuilder';
import { import {
ColorPicker, ColorPicker,

View File

@ -19,7 +19,7 @@ import Link from '@mui/material/Link';
import Tab from '@mui/material/Tab'; import Tab from '@mui/material/Tab';
import Tabs from '@mui/material/Tabs'; import Tabs from '@mui/material/Tabs';
import { ToolbarMenuItem } from './Toolbar'; import { ToolbarMenuItem } from './Toolbar';
import ActionConfig from '../../classes/actions-config'; import ActionConfig from '../../classes/action-config';
/** /**
* Color picker for toolbar * Color picker for toolbar

View File

@ -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];
};

View File

@ -9,7 +9,7 @@ import Toolbar, {
ToolbarMenuItem, ToolbarMenuItem,
ToolbarSubmenu, ToolbarSubmenu,
} from '../../../src/components/toolbar/Toolbar'; } 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'; import Menubar from '../../../src/components/toolbar/AppBar';
require('babel-polyfill'); require('babel-polyfill');
jest.mock('../../../src/components/toolbar/appbar-buttons.css', () => ''); jest.mock('../../../src/components/toolbar/appbar-buttons.css', () => '');