Added PreviewFiles to devTool server side.

This commit is contained in:
2022-10-13 06:33:08 +03:00
parent 29a75a6e26
commit dfcd9681bc
13 changed files with 94 additions and 26 deletions
@@ -7,6 +7,7 @@ import {
SidebarStyle,
} from "./data-options.style.js";
import {isClickOutside, isEscHit} from "../responsive-button/ResponsiveButton.jsx";
import {DesignPreview} from "./DesignPreview.jsx";
function DataOptions(props = {}) {
props.rootAttributes = props.rootAttributes ?? {};
@@ -41,8 +42,9 @@ function DataOptions(props = {}) {
const handleBlur = async (e) => await isClickOutside(e) ? closeSidebar() : null;
return <>
<SidebarButtonToggleStyle onClick={() => openSidebar()} title="Open a Sidebar with Data Options">#</SidebarButtonToggleStyle>
return <div style={{display: 'flex', gap: '1rem', alignItems: 'center'}}>
<SidebarButtonToggleStyle onClick={() => openSidebar()} title="Open a Sidebar with Data Options"/>
<DesignPreview/>
<SidebarStyle className={sidebarOpen ? 'active sidebar-active' : ''} tabIndex='0' onBlur={handleBlur}>
<SidebarHeaderStyle>
@@ -66,7 +68,7 @@ function DataOptions(props = {}) {
<pre>{JSON.stringify(state.data, null, 2)}</pre>
}
</SidebarStyle>
</>;
</div>;
function openSidebar() {
setSidebarOpen(true);
@@ -0,0 +1,5 @@
import React, {useCallback, useEffect, useState} from 'react';
export function DesignPreview(props = {}) {
return <span style={{color: '#999'}}>Preview</span>
}