Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.
TypeScript accessibilityalternativecloudflarecloudflare-workersdesignfreefrontendopen-sourceradix-uireactremixweb-developmentwebflowwebsite-builderwebsite-developmentwebsiteswebstudio
move text editor to wrapper component
Oleg Isonen35c5475c00f4
diff --git a/app/canvas/canvas.tsx b/app/canvas/canvas.tsxindex 9af0639327..91550b375d 100644--- a/app/canvas/canvas.tsx+++ b/app/canvas/canvas.tsx@@ -50,7 +50,10 @@ import {import { registerContainers } from "./shared/immerhin";import { useTrackHoveredElement } from "./shared/use-track-hovered-element";import { usePublishScrollState } from "./shared/use-publish-scroll-state";-import { LexicalComposer, config } from "~/shared/text-editor";+import {+ LexicalComposer,+ config,+} from "~/canvas/features/wrapper-component/text-editor";registerContainers();diff --git a/app/shared/text-editor/config.ts b/app/canvas/features/wrapper-component/text-editor/config.tssimilarity index 100%rename from app/shared/text-editor/config.tsrename to app/canvas/features/wrapper-component/text-editor/config.tsdiff --git a/app/shared/text-editor/content-editable.tsx b/app/canvas/features/wrapper-component/text-editor/content-editable.tsxsimilarity index 100%rename from app/shared/text-editor/content-editable.tsxrename to app/canvas/features/wrapper-component/text-editor/content-editable.tsxdiff --git a/app/canvas/features/wrapper-component/editor/editor.tsx b/app/canvas/features/wrapper-component/text-editor/editor.tsxsimilarity index 91%rename from app/canvas/features/wrapper-component/editor/editor.tsxrename to app/canvas/features/wrapper-component/text-editor/editor.tsxindex b41a708fd4..e7b592d9d8 100644--- a/app/canvas/features/wrapper-component/editor/editor.tsx+++ b/app/canvas/features/wrapper-component/text-editor/editor.tsx@@ -5,7 +5,7 @@ import {InstancePlugin,ToolbarConnectorPlugin,OnChangePlugin,-} from "~/shared/text-editor";+} from "~/canvas/features/wrapper-component/text-editor";type EditorProps = {editable: JSX.Element;diff --git a/app/shared/text-editor/example-text-editor.stories.tsx b/app/canvas/features/wrapper-component/text-editor/example-text-editor.stories.tsxsimilarity index 100%rename from app/shared/text-editor/example-text-editor.stories.tsxrename to app/canvas/features/wrapper-component/text-editor/example-text-editor.stories.tsxdiff --git a/app/shared/text-editor/example-text-editor.tsx b/app/canvas/features/wrapper-component/text-editor/example-text-editor.tsxsimilarity index 97%rename from app/shared/text-editor/example-text-editor.tsxrename to app/canvas/features/wrapper-component/text-editor/example-text-editor.tsxindex 7cbc60430d..04f31aa956 100644--- a/app/shared/text-editor/example-text-editor.tsx+++ b/app/canvas/features/wrapper-component/text-editor/example-text-editor.tsx@@ -13,7 +13,7 @@ import { OnChangePlugin } from "./plugins/plugin-on-change";import { InstancePlugin } from "./plugins/plugin-instance";import { TreeViewPlugin } from "./plugins/tree-view-plugin";import { config } from "./config";-import { createInstance } from "../tree-utils";+import { createInstance } from "../../../../shared/tree-utils";type ExampleTextEditorProps = {onChange: (state: ChildrenUpdates) => void;diff --git a/app/shared/text-editor/index.ts b/app/canvas/features/wrapper-component/text-editor/index.tssimilarity index 100%rename from app/shared/text-editor/index.tsrename to app/canvas/features/wrapper-component/text-editor/index.tsdiff --git a/app/shared/text-editor/lexical.ts b/app/canvas/features/wrapper-component/text-editor/lexical.tssimilarity index 100%rename from app/shared/text-editor/lexical.tsrename to app/canvas/features/wrapper-component/text-editor/lexical.tsdiff --git a/app/shared/text-editor/nodes/node-instance.tsx b/app/canvas/features/wrapper-component/text-editor/nodes/node-instance.tsxsimilarity index 97%rename from app/shared/text-editor/nodes/node-instance.tsxrename to app/canvas/features/wrapper-component/text-editor/nodes/node-instance.tsxindex 00c3115f3e..3331c34279 100644--- a/app/shared/text-editor/nodes/node-instance.tsx+++ b/app/canvas/features/wrapper-component/text-editor/nodes/node-instance.tsx@@ -3,7 +3,7 @@ import { render } from "react-dom";import { useMemo } from "react";import { useCss } from "~/canvas/features/wrapper-component/use-css";import { useBreakpoints } from "~/shared/nano-states";-import { primitives } from "../../canvas-components";+import { primitives } from "../../../../../shared/canvas-components";import {type EditorConfig,type SerializedTextNode,diff --git a/app/shared/text-editor/plugins/plugin-instance.tsx b/app/canvas/features/wrapper-component/text-editor/plugins/plugin-instance.tsxsimilarity index 100%rename from app/shared/text-editor/plugins/plugin-instance.tsxrename to app/canvas/features/wrapper-component/text-editor/plugins/plugin-instance.tsxdiff --git a/app/shared/text-editor/plugins/plugin-on-change.tsx b/app/canvas/features/wrapper-component/text-editor/plugins/plugin-on-change.tsxsimilarity index 100%rename from app/shared/text-editor/plugins/plugin-on-change.tsxrename to app/canvas/features/wrapper-component/text-editor/plugins/plugin-on-change.tsxdiff --git a/app/shared/text-editor/plugins/plugin-toolbar-connector.tsx b/app/canvas/features/wrapper-component/text-editor/plugins/plugin-toolbar-connector.tsxsimilarity index 100%rename from app/shared/text-editor/plugins/plugin-toolbar-connector.tsxrename to app/canvas/features/wrapper-component/text-editor/plugins/plugin-toolbar-connector.tsxdiff --git a/app/shared/text-editor/plugins/tree-view-plugin.tsx b/app/canvas/features/wrapper-component/text-editor/plugins/tree-view-plugin.tsxsimilarity index 100%rename from app/shared/text-editor/plugins/tree-view-plugin.tsxrename to app/canvas/features/wrapper-component/text-editor/plugins/tree-view-plugin.tsxdiff --git a/app/shared/text-editor/styles.css b/app/canvas/features/wrapper-component/text-editor/styles.csssimilarity index 100%rename from app/shared/text-editor/styles.cssrename to app/canvas/features/wrapper-component/text-editor/styles.cssdiff --git a/app/canvas/features/wrapper-component/editor/use-is-editing.ts b/app/canvas/features/wrapper-component/text-editor/use-is-editing.tssimilarity index 100%rename from app/canvas/features/wrapper-component/editor/use-is-editing.tsrename to app/canvas/features/wrapper-component/text-editor/use-is-editing.tsdiff --git a/app/shared/text-editor/utils/to-lexical-nodes.tsx b/app/canvas/features/wrapper-component/text-editor/utils/to-lexical-nodes.tsxsimilarity index 100%rename from app/shared/text-editor/utils/to-lexical-nodes.tsxrename to app/canvas/features/wrapper-component/text-editor/utils/to-lexical-nodes.tsxdiff --git a/app/shared/text-editor/utils/to-updates.test.ts b/app/canvas/features/wrapper-component/text-editor/utils/to-updates.test.tssimilarity index 100%rename from app/shared/text-editor/utils/to-updates.test.tsrename to app/canvas/features/wrapper-component/text-editor/utils/to-updates.test.tsdiff --git a/app/shared/text-editor/utils/to-updates.ts b/app/canvas/features/wrapper-component/text-editor/utils/to-updates.tssimilarity index 100%rename from app/shared/text-editor/utils/to-updates.tsrename to app/canvas/features/wrapper-component/text-editor/utils/to-updates.tsdiff --git a/app/canvas/features/wrapper-component/wrapper-component.tsx b/app/canvas/features/wrapper-component/wrapper-component.tsxindex d2066a28c4..8f24b34bca 100644--- a/app/canvas/features/wrapper-component/wrapper-component.tsx+++ b/app/canvas/features/wrapper-component/wrapper-component.tsx@@ -10,9 +10,9 @@ import { primitives } from "~/shared/canvas-components";import { useCss } from "./use-css";import { useDraggable } from "./use-draggable";import { useEnsureFocus } from "./use-ensure-focus";-import { Editor } from "./editor/editor";-import { useIsEditing } from "./editor/use-is-editing";-import { useContentEditable } from "~/shared/text-editor";+import { Editor } from "./text-editor/editor";+import { useIsEditing } from "./text-editor/use-is-editing";+import { useContentEditable } from "~/canvas/features/wrapper-component/text-editor";import noop from "lodash.noop";type WrapperComponentDevProps = {