ui-editor icon indicating copy to clipboard operation
ui-editor copied to clipboard

first-commit

Open imvetri opened this issue 2 years ago • 17 comments

  • added react, babel in html. learnt that script type set to text/babel or text/jsx will let babel automatically transpile the code. without EVAL setup

imvetri avatar Feb 24 '23 05:02 imvetri

shows a blank page in Chrome

bilogic avatar Apr 08 '24 06:04 bilogic

I'm building it from scratch outside github

imvetri avatar Apr 10 '24 02:04 imvetri

I meant the commited file here ui-editor.html, it is a blank page

bilogic avatar Apr 10 '24 02:04 bilogic

May I know why are you curious about this project?

imvetri avatar Apr 10 '24 04:04 imvetri

You are trying to PR something that does not seem to work

bilogic avatar Apr 10 '24 04:04 bilogic

image

Are you sure its a blank page ? check this out. its in chrome

imvetri avatar Apr 10 '24 06:04 imvetri

        function Flow() {
            return (
                <div style={{ height: '100vh' }}>
                    <ReactFlow.default>
                        <ReactFlow.Background />
                        <ReactFlow.Controls />
                    </ReactFlow.default>
                </div>
            );
        }

Thanks! It works now. Would you know why changing to <div style='height: 100vh'> makes it not work?

bilogic avatar Apr 10 '24 06:04 bilogic

<div style='height: 100vh'> This is the container for the react-flow. which means, only if the parent DOM of react-flow component has any visible space, react-flow will be visible.

correction

Would you know why changing to <div style='height: 100vh'> makes it not work?

Did you mean to say

Would you know why changing to <div style='height: 100vh'> makes it work?

imvetri avatar Apr 10 '24 09:04 imvetri

My post was correct. I'm using a HTML processor, so I had to rewrite {{ in another way. I changed it to <div style='height: 100vh'> and it caused the example to not work. Anyway, it has been solved.

There are no nodes in your example. I'm not sure how to import react-flow based on the examples on their website.

bilogic avatar Apr 10 '24 17:04 bilogic

I updated with an example. Unfortunately react-flow is rendering only one node and ignoring an edge and node. I opened up a question with them.

imvetri avatar Apr 11 '24 12:04 imvetri

The rendering is due to a bug in your code, I fixed it. See my PR. There is another thing I could not fix, the scroll bar shows up because there is an additional 8 px of height and I'm not sure where it is coming from.

bilogic avatar Apr 11 '24 15:04 bilogic

fixed the scroll bar. Its from the chrome . Added zero margin to body.

imvetri avatar Apr 12 '24 04:04 imvetri

Added a nodes, edges viewer to bottom of react flow. Next make node added and deleted from the viewer, and it should reflect on the react-flow canvas

https://github.com/imvetri/ui-editor/assets/6542274/53001f7c-6f74-408f-b2d9-5d1f833616aa

imvetri avatar Apr 12 '24 04:04 imvetri

https://reactflow.dev/examples/interaction/save-and-restore I'm trying to add save and load to your example

bilogic avatar Apr 12 '24 04:04 bilogic

I saw your latest changes, I don't think 98vh is a proper fix. Also, possible to avoid the use of {{? Then I can help contribute to this example.

bilogic avatar Apr 12 '24 04:04 bilogic

by mistake I made an update on your branch.

the scroll bar I fixed, as I added the node editor, the scroll bar showed up. The original scroll bar issue is fixed.

imvetri avatar Apr 12 '24 04:04 imvetri

:root {
  font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  font-weight: 400;
}

html,
body,
#root {
  height: 100%;
  margin: 0;
}

this is how react flow fill their height, not 100vh

bilogic avatar Apr 12 '24 07:04 bilogic