-
-
Notifications
You must be signed in to change notification settings - Fork 108
Description
When using the visual editor in both React and Vue implementations of Intlayer, changes are correctly tracked and stored. However, only the React implementation successfully renders the updated content in the frontend. In the Vue version, the edited content is not reflected in the DOM after editing.
React Behavior (✅ Works as expected):
- The visual editor stores changes in
EditedContentContext - Then,
useEditedContentRendererreplaces the current node with the edited version - This is correctly rendered in
IntlayerNodePlugin
→ https://github.com/aymericzip/intlayer/blob/main/packages/@intlayer/editor-react/src/EditedContentContext.tsx
→ https://github.com/aymericzip/intlayer/blob/main/packages/react-intlayer/src/editor/useEditedContentRenderer.tsx
→ https://github.com/aymericzip/intlayer/blob/main/packages/react-intlayer/src/plugins.tsx
Vue Behavior (❌ Buggy or Incomplete):
-
The editor correctly stores updated content in the
editedContentref -
However,
intlayerNodePluginsdo not seem to use or render this updated content→
https://github.com/aymericzip/intlayer/blob/main/packages/vue-intlayer/src/editor/editedContent.ts
→https://github.com/aymericzip/intlayer/blob/main/packages/vue-intlayer/src/plugins.ts
Expected Behavior:
Vue’s intlayerNodePlugins should mirror the React logic: after a node is edited and saved in the editedContent ref, the rendered node should reflect the update without requiring a full refresh or manual intervention.
Suggested Fix:
Ensure vue-intlayer/src/plugins.ts reads from editedContent and replaces the node tree similarly to useEditedContentRenderer.tsx in React. It may require introducing a computed mapping or watcher on editedContent to conditionally render edited nodes in intlayerNodePlugins.