Skip to content

Commit 5ca085e

Browse files
buddhajjigaejonocrxkevinparkwilliamdyoonMadinventorZero
committed
Cleaned up comments. Added prop drilling of name for DirectChildHTML.tsx to be used in annotations
Co-authored-by: jonocr <[email protected]> Co-authored-by: xkevinpark <[email protected]> Co-authored-by: williamdyoon <[email protected]> Co-authored-by: MadinventorZero <[email protected]>
1 parent dbb545a commit 5ca085e

File tree

5 files changed

+11
-5
lines changed

5 files changed

+11
-5
lines changed

app/src/components/left/HTMLPanel.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ const HTMLPanel = (props): JSX.Element => {
142142
};
143143

144144
const handleCreateElement = useCallback((e) => {
145+
// Canret
145146
if(e.key === 'Enter' && e.target.tagName !== "TEXTAREA") {
146147
e.preventDefault();
147148
document.getElementById('submitButton').click();

app/src/components/main/DirectChildHTML.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import Annotation from './Annotation'
1313

1414
function DirectChildHTML({
1515
childId,
16+
name,
1617
type,
1718
typeId,
1819
style,
@@ -68,11 +69,12 @@ function DirectChildHTML({
6869

6970
return (
7071
<div onClick={onClickHandler} style={combinedStyle} ref={drag}>
71-
<strong>{HTMLType.placeHolderShort}</strong>
72-
{` (${childId})`}
72+
<strong>{HTMLType.placeHolderShort}</strong>
7373
{/* Caret start */}
74+
{` (${childId})`}
7475
<Annotation
7576
id={childId}
77+
name={name}
7678
/>
7779
{/* Caret end */}
7880
</div>

app/src/components/main/DirectChildHTMLNestable.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,13 @@ const snapShotFunc = () => {
128128
return (
129129
<div onClick={onClickHandler} style={combinedStyle} ref={ref}>
130130
<strong>{HTMLType.placeHolderShort}</strong>
131+
{/* Caret start */}
131132
{` ( ${childId} )`}
132133
<Annotation
133134
id={childId}
134135
name={name}
135136
/>
136137
{renderChildren(children)}
137-
{/* Caret start */}
138-
139138
{/* Caret end */}
140139
</div>
141140
);

app/src/components/main/IndirectChild.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import StateContext from '../../context/context';
55
import { Component } from '../../interfaces/Interfaces';
66
import Annotation from './Annotation'
77

8-
function IndirectChild({ style, children, placeHolder, linkId, childId }) {
8+
function IndirectChild({ style, children, placeHolder, linkId, childId, name }) {
99
const [state, dispatch] = useContext(StateContext);
1010
let combinedStyle = combineStyles(globalDefaultStyle, style);
1111

@@ -34,10 +34,13 @@ function IndirectChild({ style, children, placeHolder, linkId, childId }) {
3434
placeHolder
3535
)}
3636
{children}
37+
{/* Caret start */}
3738
{` ( ${childId} )`}
3839
<Annotation
3940
id={childId}
41+
name={name}
4042
/>
43+
{/* Caret end */}
4144
</div>
4245
);
4346
}

app/src/components/right/ComponentPanel.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ const ComponentPanel = ({isThemeLight}): JSX.Element => {
109109
};
110110

111111
const keyBindCreateComponent = useCallback((e) => {
112+
// Caret
112113
if(e.key === 'Enter' && e.target.tagName !== "TEXTAREA") {
113114
e.preventDefault();
114115
document.getElementById('addComponentButton').click();

0 commit comments

Comments
 (0)