Skip to content

Commit

Permalink
disable spellcheck globally
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Dec 17, 2024
1 parent ca9bdd2 commit ebb9a63
Show file tree
Hide file tree
Showing 15 changed files with 17 additions and 54 deletions.
6 changes: 3 additions & 3 deletions packages/eez-studio-ui/_stylesheets/project-editor.less
Original file line number Diff line number Diff line change
Expand Up @@ -3852,15 +3852,15 @@
}

.EezStudio_ListLabel_Badge {
margin-left: 8px;
margin-right: 8px;
transform: translateY(-1px);

display: inline-block;
padding: 0px 5px;
font-size: 80%;
font-weight: bold;
color: rgb(238, 238, 238);
background-color: var(--bs-secondary);
color: var(--bs-secondary);
background-color: var(--bs-secondary-bg);
white-space: nowrap;
border-radius: 4px;
}
Expand Down
6 changes: 0 additions & 6 deletions packages/eez-studio-ui/search-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export class SearchInput extends React.Component<{
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
onKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
onClear: () => void;
disableSpellcheck?: boolean;
}> {
render() {
return (
Expand All @@ -21,11 +20,6 @@ export class SearchInput extends React.Component<{
value={this.props.searchText}
onChange={this.props.onChange}
onKeyDown={this.props.onKeyDown}
spellCheck={
this.props.disableSpellcheck === true
? false
: undefined
}
/>
{this.props.searchText && (
<IconAction
Expand Down
2 changes: 1 addition & 1 deletion packages/home/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
/>
</head>

<body>
<body spellcheck="false">
<div id="EezStudio_Content"></div>
<div id="EezStudio_ModalContent"></div>

Expand Down
1 change: 0 additions & 1 deletion packages/project-editor/core/object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,6 @@ export interface PropertyInfo {
) => boolean;

monospaceFont?: boolean;
disableSpellcheck?: boolean;
cssAttributeName?: string;
checkboxStyleSwitch?: boolean;
checkboxHideLabel?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion packages/project-editor/features/action/action.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -279,13 +279,13 @@ export class Action extends Flow {
const projectStore = getProjectStore(action);
return (
<>
<span>{action.name}</span>
{projectStore.projectTypeTraits.hasFlowSupport &&
action.implementationType == "native" && (
<span className="EezStudio_ListLabel_Badge">
NATIVE
</span>
)}
<span>{action.name}</span>
</>
);
},
Expand Down
3 changes: 1 addition & 2 deletions packages/project-editor/features/variable/value-type.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -976,8 +976,7 @@ export const variableTypeProperty: PropertyInfo = {
name: "type",
type: PropertyType.String,
propertyGridColumnComponent: VariableTypeUI,
monospaceFont: true,
disableSpellcheck: true
monospaceFont: true
};

////////////////////////////////////////////////////////////////////////////////
Expand Down
18 changes: 8 additions & 10 deletions packages/project-editor/features/variable/variable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,6 @@ export class Variable extends EezObject {
expressionIsConstant: true,
flowProperty: "input",
monospaceFont: true,
disableSpellcheck: true,
disabled: object => {
const project = ProjectEditor.getProject(object);
return (
Expand Down Expand Up @@ -450,8 +449,7 @@ export class Variable extends EezObject {
type: PropertyType.MultilineText,
disabled: object =>
isLVGLProject(object) || hasFlowSupport(object),
monospaceFont: true,
disableSpellcheck: true
monospaceFont: true
},
{
name: "usedIn",
Expand Down Expand Up @@ -492,13 +490,6 @@ export class Variable extends EezObject {
listLabel: (variable: Variable) => {
return (
<>
<span>{variable.name}</span>
<em
className="font-monospace"
style={{ opacity: 0.5, marginLeft: 8 }}
>
{variable.type}
</em>
{!isPropertyDisabled(
variable,
findPropertyByNameInObject(variable, "native")!
Expand All @@ -517,6 +508,13 @@ export class Variable extends EezObject {
PERSISTENT
</span>
)}
<span>{variable.name}</span>
<em
className="font-monospace"
style={{ opacity: 0.5, marginLeft: 8 }}
>
{variable.type}
</em>
</>
);
},
Expand Down
9 changes: 3 additions & 6 deletions packages/project-editor/flow/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -529,8 +529,7 @@ export function makeExpressionProperty(
},
params
),
monospaceFont: true,
disableSpellcheck: true
monospaceFont: true
} as Partial<PropertyInfo>,
propertyInfo
);
Expand Down Expand Up @@ -558,8 +557,7 @@ export function makeAssignableExpressionProperty(
},
params
),
monospaceFont: true,
disableSpellcheck: true
monospaceFont: true
} as Partial<PropertyInfo>,
propertyInfo
);
Expand All @@ -572,8 +570,7 @@ export function makeTemplateLiteralProperty(
{
flowProperty: "template-literal",
expressionType: "string",
monospaceFont: true,
disableSpellcheck: true
monospaceFont: true
} as Partial<PropertyInfo>,
propertyInfo
);
Expand Down
1 change: 0 additions & 1 deletion packages/project-editor/flow/components/actions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,6 @@ export class EvalJSExprActionComponent extends ActionComponent {
type: PropertyType.MultilineText,
propertyGridGroup: specificGroup,
monospaceFont: true,
disableSpellcheck: true,
flowProperty: "template-literal"
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ export class SCPIActionComponent extends ActionComponent {
type: PropertyType.MultilineText,
propertyGridGroup: specificGroup,
monospaceFont: true,
disableSpellcheck: true,
flowProperty: "scpi-template-literal",
expressionType: undefined,
getInstrumentId: (component: SCPIActionComponent) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1271,7 +1271,6 @@ const SelectItemDialog = observer(
this.value = event.target.value;
})}
onSelect={this.onSelectionChange}
spellCheck={false}
/>
{tabs}
<div
Expand Down
1 change: 0 additions & 1 deletion packages/project-editor/project/project.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,6 @@ export class ExtensionDirective extends EezObject {
{
name: "extensionName",
type: PropertyType.String,
disableSpellcheck: true,

onSelect: async (
object: IEezObject,
Expand Down
3 changes: 0 additions & 3 deletions packages/project-editor/project/ui/Wizard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2744,7 +2744,6 @@ class NameInput extends React.Component<{
className="form-control"
value={this.props.value || ""}
onChange={event => this.props.onChange(event.target.value)}
spellCheck={false}
onKeyDown={this.props.onKeyDown}
/>
);
Expand Down Expand Up @@ -2775,7 +2774,6 @@ class DirectoryBrowserInput extends React.Component<{
className="form-control"
value={this.props.value || ""}
onChange={event => this.props.onChange(event.target.value)}
spellCheck={false}
/>
<>
<button
Expand Down Expand Up @@ -2819,7 +2817,6 @@ class FileBrowserInput extends React.Component<{
className="form-control"
value={this.props.value || ""}
onChange={event => this.props.onChange(event.target.value)}
spellCheck={false}
/>
<>
<button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ export const ObjectReferenceInput = observer(
})}
onChange={this.onSearchChange}
onKeyDown={this.onSearchChange}
disableSpellcheck={true}
/>
</div>
<div>
Expand Down
16 changes: 0 additions & 16 deletions packages/project-editor/ui-components/PropertyGrid/Property.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -522,11 +522,6 @@ export const Property = observer(
overflowY: "hidden"
}}
readOnly={propertyInfo.computed}
spellCheck={
propertyInfo.disableSpellcheck
? false
: true
}
/>
<button
className="btn btn-secondary"
Expand Down Expand Up @@ -555,9 +550,6 @@ export const Property = observer(
onChange={this.onChange}
style={{ resize: "none", overflowY: "hidden" }}
readOnly={readOnly || propertyInfo.computed}
spellCheck={
propertyInfo.disableSpellcheck ? false : true
}
/>
);
}
Expand Down Expand Up @@ -725,9 +717,6 @@ export const Property = observer(
onChange={this.onChange}
style={{ resize: "none", overflowY: "hidden" }}
readOnly={readOnly || propertyInfo.computed}
spellCheck={
propertyInfo.disableSpellcheck ? false : true
}
onClick={this.props.onClick}
/>
);
Expand All @@ -751,11 +740,6 @@ export const Property = observer(
overflowY: "hidden"
}}
readOnly={propertyInfo.computed}
spellCheck={
propertyInfo.disableSpellcheck
? false
: true
}
/>
<button
className="btn btn-secondary"
Expand Down

0 comments on commit ebb9a63

Please sign in to comment.