Skip to content

An open source alternative to Tableau. Embeddable visual analytic

fix: context layer position

ObservedObserver642109fc9f14
diff --git a/packages/graphic-walker/src/index.tsx b/packages/graphic-walker/src/index.tsx
index 7dfe6ce5..619ad466 100644
--- a/packages/graphic-walker/src/index.tsx
+++ b/packages/graphic-walker/src/index.tsx
@@ -1,23 +1,22 @@
-import React, { createContext, useEffect, useRef, useState } from 'react';
-import { StyleSheetManager } from 'styled-components';
-import root from 'react-shadow';
-import { DOM } from '@kanaries/react-beautiful-dnd';
-import { observer } from 'mobx-react-lite';
-import App, { IGWProps } from './App';
-import { StoreWrapper } from './store/index';
-import { FieldsContextWrapper } from './fields/fieldsContext';
+import React, { createContext, useEffect, useRef, useState } from "react";
+import { StyleSheetManager } from "styled-components";
+import root from "react-shadow";
+import { DOM } from "@kanaries/react-beautiful-dnd";
+import { observer } from "mobx-react-lite";
+import App, { IGWProps } from "./App";
+import { StoreWrapper } from "./store/index";
+import { FieldsContextWrapper } from "./fields/fieldsContext";
-import './empty_sheet.css';
+import "./empty_sheet.css";
import tailwindStyle from "tailwindcss/tailwind.css?inline";
-import style from './index.css?inline';
-
+import style from "./index.css?inline";
export const ShadowDomContext = createContext<{ root: ShadowRoot | null }>({ root: null });
-export const GraphicWalker: React.FC<IGWProps> = observer(props => {
+export const GraphicWalker: React.FC<IGWProps> = observer((props) => {
const [shadowRoot, setShadowRoot] = useState<ShadowRoot | null>(null);
const rootRef = useRef<HTMLDivElement>(null);
- const { storeRef } = props
+ const { storeRef } = props;
useEffect(() => {
if (rootRef.current) {
@@ -33,20 +32,20 @@ export const GraphicWalker: React.FC<IGWProps> = observer(props => {
}, []);
return (
- <root.div mode="open" ref={rootRef}>
- <style>{tailwindStyle}</style>
- <style>{style}</style>
- {shadowRoot && (
- <StyleSheetManager target={shadowRoot}>
- <StoreWrapper keepAlive={props.keepAlive} storeRef={storeRef}>
+ <StoreWrapper keepAlive={props.keepAlive} storeRef={storeRef}>
+ <root.div mode="open" ref={rootRef}>
+ <style>{tailwindStyle}</style>
+ <style>{style}</style>
+ {shadowRoot && (
+ <StyleSheetManager target={shadowRoot}>
<FieldsContextWrapper>
<ShadowDomContext.Provider value={{ root: shadowRoot }}>
<App {...props} />
</ShadowDomContext.Provider>
</FieldsContextWrapper>
- </StoreWrapper>
- </StyleSheetManager>
- )}
- </root.div>
+ </StyleSheetManager>
+ )}
+ </root.div>
+ </StoreWrapper>
);
});