You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/07-Pro Features/01-live-preview-edit.md
+26Lines changed: 26 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -122,3 +122,29 @@ You can apply formatting to selected text using standard keyboard shortcuts:
122
122
<!-- TODO: add video showing the edit text workflow -->
123
123
124
124
---
125
+
126
+
## Drag and Drop
127
+
128
+
The **Drag and Drop** feature lets you reposition elements in the Live Preview by dragging them to a new location. The source code is automatically updated with the new structure when you drop the element.
129
+
130
+
To drag an element: click and hold the element, then move your mouse to the desired location. The element becomes semi-transparent while dragging. As you hover over potential drop targets, Phoenix Code displays visual indicators showing where the element will be placed.
131
+
132
+
#### Visual Indicators
133
+
-**Arrow markers** to indicate the drop position:
134
+
-**Up (↑) or Down (↓) arrows** — Places the element before or after the target element
135
+
-**Left (←) or Right (→) arrows** — Places the element before or after the target element (appears for flex row layouts)
136
+
-**⊕ symbol with a dashed border** — Places the element inside the target as a child
137
+
138
+
-**Target label** — A small box next to the marker displays the target element's tag name, ID, and classes
139
+
140
+
> When multiple drop targets overlap *(for example, an `img` inside a `div` with aligned edges)*, you can scroll slightly to cycle through targets and drop the element when the correct label appears.
141
+
142
+
Phoenix Code validates drops to prevent invalid HTML structure. *For example, list items can only be placed inside list containers, and block elements cannot be placed inside inline elements*. If a drop location is invalid, Phoenix Code shows the marker for the closest valid drop target. In some cases, when no valid drop target is found, Phoenix Code won't show any indicators.
143
+
144
+
To cancel a drag, press `Esc`.
145
+
146
+
> When you drag an element near the top or bottom edge of the viewport, the Live Preview automatically scrolls in that direction.
147
+
148
+
<!-- TODO: add video showing drag and drop workflow with visual feedback -->
Copy file name to clipboardExpand all lines: docs/07-Pro Features/01-live-preview-edit.md~
+50-3Lines changed: 50 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ Alternatively, you can switch to Edit Mode by updating the `livePreviewMode` set
26
26
27
27
The **Info Box** displays information about an element. It is normally shown at the top-left of the element, but if there is not enough space, Phoenix Code may display it on another side where sufficient space is available. Phoenix Code attempts to position the Info Box as close to the element as possible while keeping it visible.
28
28
29
-
> By default, the Info Box appears when you hover over an element in the Live Preview, but this behavior can be changed. See the **Edit Highlights on Hover** section for more details.
29
+
> By default, the Info Box appears when you hover over an element in the Live Preview, but this behavior can be changed. See the [Edit Highlights on Hover](#edit-highlights-on-hover) section for more details.
30
30
31
31
<!-- TODO: add image showing Info Box -->
32
32
@@ -59,9 +59,8 @@ The Tool Box displays different options depending on the selected element type.
59
59
- **Select Parent** *(up-arrow icon)*: Selects the parent of the currently selected element.
60
60
*This button appears only when a valid parent exists (it is not shown when the parent is `body`, `html`, or a JavaScript-rendered element).*
61
61
62
-
- **Edit Text** *(pencil icon)*: Opens inline text editing for the selected element. You can edit text directly in the Live Preview, and Phoenix Code automatically updates the source code. Press `Enter` to save the edited text or `Esc` to cancel.
62
+
- **Edit Text** *(pencil icon)*: Opens inline text editing for the selected element. You can edit text directly in the Live Preview, and Phoenix Code automatically updates the source code. See the [Editing Text](#editing-text) section for more details.
63
63
*This button appears only for elements that can contain text (it is not available for `<img>`, `<video>`, `<br>`, etc.).*
64
-
> You can also edit text by double-clicking the element in the Live Preview.
65
64
66
65
- **Edit Hyperlink** *(link icon)*: Opens a floating input box that lets you edit the element’s `href` attribute.
67
66
*This button appears only for `<a>` elements.*
@@ -101,3 +100,51 @@ When **Edit Highlights on Hover** is unchecked:
101
100
Alternatively, you can change this setting by updating the `livePreviewElementHighlights` preference in the preferences file. Set it to `"hover"` (default) or `"click"`. See [Editing Preferences](../editing-text#editing-preferences) to learn how to edit the preferences file.
102
101
103
102
---
103
+
104
+
## Editing Text
105
+
106
+
The **Editing Text** feature lets you modify text content directly in the Live Preview, with all changes automatically synced to the source code.
107
+
108
+
To start editing, **double-click** an element in the Live Preview or click the **Edit Text** button *(pencil icon)* in the Tool Box.
109
+
Edit the text as needed, then press `Enter` to save or `Esc` to cancel.
110
+
To insert a line break, press `Shift + Enter`.
111
+
112
+
> Text editing is available only for elements that can contain text. It is not supported for elements such as `<img>`, `<video>`, `<br>`, and similar non-text elements.
113
+
114
+
### Text Formatting
115
+
116
+
You can apply formatting to selected text using standard keyboard shortcuts:
117
+
- **Ctrl/Cmd + B** — Bold; wraps selected text in `<b>` tags
118
+
- **Ctrl/Cmd + I** — Italic; wraps selected text in `<i>` tags
119
+
- **Ctrl/Cmd + U** — Underline; wraps selected text in `<u>` tags
120
+
> If the text is already formatted, the formatting will be removed.
121
+
122
+
<!-- TODO: add video showing the edit text workflow -->
123
+
124
+
---
125
+
126
+
## Drag and Drop
127
+
128
+
The **Drag and Drop** feature lets you reposition elements in the Live Preview by dragging them to a new location. The source code is automatically updated with the new structure when you drop the element.
129
+
130
+
To drag an element: click and hold the element, then move your mouse to the desired location. The element becomes semi-transparent while dragging. As you hover over potential drop targets, Phoenix Code displays visual indicators showing where the element will be placed.
131
+
132
+
#### Visual Indicators
133
+
- **Arrow markers** to indicate the drop position:
134
+
- **Up (↑) or Down (↓) arrows** — Places the element before or after the target element
135
+
- **Left (←) or Right (→) arrows** — Places the element before or after the target element (appears for flex row layouts)
136
+
- **⊕ symbol with a dashed border** — Places the element inside the target as a child
137
+
138
+
- **Target label** — A small box next to the marker displays the target element's tag name, ID, and classes
139
+
140
+
> When multiple drop targets overlap *(for example, an `img` inside a `div` with aligned edges)*, you can scroll slightly to cycle through targets and drop the element when the correct label appears.
141
+
142
+
Phoenix Code validates drops to prevent invalid HTML structure. *For example, list items can only be placed inside list containers, and block elements cannot be placed inside inline elements*. If a drop location is invalid, Phoenix Code shows the marker for the closest valid drop target.no marker will appear and the element cannot be dropped there. In some cases,
143
+
144
+
To cancel a drag, press `Esc`.
145
+
146
+
> When you drag an element near the top or bottom edge of the viewport, the Live Preview automatically scrolls in that direction.
147
+
148
+
<!-- TODO: add video showing drag and drop workflow with visual feedback -->
0 commit comments