From 59fab944f4ba61bb2e6e3685053ae467ccdb8056 Mon Sep 17 00:00:00 2001 From: Adityajaiswal03 <140907684+Adityajaiswal03@users.noreply.github.com> Date: Tue, 13 Aug 2024 01:40:38 +0530 Subject: [PATCH] feat: change blocklyEditableText to blocklyEditableField and blocklyNonEditableText to blocklyNonEditableField BREAKING CHANGE: The blocklyEditableText and blocklyNonEditableText identifiers have been renamed to blocklyEditableField and blocklyNonEditableField respectively. This change may require updates to any existing code that references the old identifiers. (#8475) --- core/css.ts | 2 +- core/field.ts | 8 ++++---- core/renderers/common/constants.ts | 10 +++++----- core/renderers/zelos/constants.ts | 16 ++++++++-------- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/core/css.ts b/core/css.ts index 5d1f07499..c7ae55397 100644 --- a/core/css.ts +++ b/core/css.ts @@ -219,7 +219,7 @@ let content = ` font-family: monospace; } -.blocklyNonEditableText>text { +.blocklyNonEditableField>text { pointer-events: none; } diff --git a/core/field.ts b/core/field.ts index 229c3626d..2d50c04eb 100644 --- a/core/field.ts +++ b/core/field.ts @@ -534,12 +534,12 @@ export abstract class Field return; } if (this.enabled_ && block.isEditable()) { - dom.addClass(group, 'blocklyEditableText'); - dom.removeClass(group, 'blocklyNonEditableText'); + dom.addClass(group, 'blocklyEditableField'); + dom.removeClass(group, 'blocklyNonEditableField'); group.style.cursor = this.CURSOR; } else { - dom.addClass(group, 'blocklyNonEditableText'); - dom.removeClass(group, 'blocklyEditableText'); + dom.addClass(group, 'blocklyNonEditableField'); + dom.removeClass(group, 'blocklyEditableField'); group.style.cursor = ''; } } diff --git a/core/renderers/common/constants.ts b/core/renderers/common/constants.ts index 568b7f444..c4ea9b24e 100644 --- a/core/renderers/common/constants.ts +++ b/core/renderers/common/constants.ts @@ -1132,14 +1132,14 @@ export class ConstantProvider { `${selector} .blocklyText {`, `fill: #fff;`, `}`, - `${selector} .blocklyNonEditableText>rect,`, - `${selector} .blocklyEditableText>rect {`, + `${selector} .blocklyNonEditableField>rect,`, + `${selector} .blocklyEditableField>rect {`, `fill: ${this.FIELD_BORDER_RECT_COLOUR};`, `fill-opacity: .6;`, `stroke: none;`, `}`, - `${selector} .blocklyNonEditableText>text,`, - `${selector} .blocklyEditableText>text {`, + `${selector} .blocklyNonEditableField>text,`, + `${selector} .blocklyEditableField>text {`, `fill: #000;`, `}`, @@ -1154,7 +1154,7 @@ export class ConstantProvider { `}`, // Editable field hover. - `${selector} .blocklyEditableText:not(.blocklyEditing):hover>rect {`, + `${selector} .blocklyEditableField:not(.blocklyEditing):hover>rect {`, `stroke: #fff;`, `stroke-width: 2;`, `}`, diff --git a/core/renderers/zelos/constants.ts b/core/renderers/zelos/constants.ts index 22e3f3782..28c2cb4fc 100644 --- a/core/renderers/zelos/constants.ts +++ b/core/renderers/zelos/constants.ts @@ -802,14 +802,14 @@ export class ConstantProvider extends BaseConstantProvider { `${selector} .blocklyText {`, `fill: #fff;`, `}`, - `${selector} .blocklyNonEditableText>rect:not(.blocklyDropdownRect),`, - `${selector} .blocklyEditableText>rect:not(.blocklyDropdownRect) {`, + `${selector} .blocklyNonEditableField>rect:not(.blocklyDropdownRect),`, + `${selector} .blocklyEditableField>rect:not(.blocklyDropdownRect) {`, `fill: ${this.FIELD_BORDER_RECT_COLOUR};`, `}`, - `${selector} .blocklyNonEditableText>text,`, - `${selector} .blocklyEditableText>text,`, - `${selector} .blocklyNonEditableText>g>text,`, - `${selector} .blocklyEditableText>g>text {`, + `${selector} .blocklyNonEditableField>text,`, + `${selector} .blocklyEditableField>text,`, + `${selector} .blocklyNonEditableField>g>text,`, + `${selector} .blocklyEditableField>g>text {`, `fill: #575E75;`, `}`, @@ -825,9 +825,9 @@ export class ConstantProvider extends BaseConstantProvider { // Editable field hover. `${selector} .blocklyDraggable:not(.blocklyDisabled)`, - ` .blocklyEditableText:not(.blocklyEditing):hover>rect,`, + ` .blocklyEditableField:not(.blocklyEditing):hover>rect,`, `${selector} .blocklyDraggable:not(.blocklyDisabled)`, - ` .blocklyEditableText:not(.blocklyEditing):hover>.blocklyPath {`, + ` .blocklyEditableField:not(.blocklyEditing):hover>.blocklyPath {`, `stroke: #fff;`, `stroke-width: 2;`, `}`,