diff --git a/packages/editor-ui/src/__tests__/setup.ts b/packages/editor-ui/src/__tests__/setup.ts index 9316e30a30c96..4c75c226e6d37 100644 --- a/packages/editor-ui/src/__tests__/setup.ts +++ b/packages/editor-ui/src/__tests__/setup.ts @@ -12,3 +12,10 @@ window.ResizeObserver = })); Element.prototype.scrollIntoView = vi.fn(); + +Range.prototype.getBoundingClientRect = vi.fn(); +Range.prototype.getClientRects = vi.fn(() => ({ + item: vi.fn(), + length: 0, + [Symbol.iterator]: vi.fn(), +})); diff --git a/packages/editor-ui/src/components/AssignmentCollection/Assignment.vue b/packages/editor-ui/src/components/AssignmentCollection/Assignment.vue index c1ee16976b52e..f18b5d5c81142 100644 --- a/packages/editor-ui/src/components/AssignmentCollection/Assignment.vue +++ b/packages/editor-ui/src/components/AssignmentCollection/Assignment.vue @@ -169,7 +169,6 @@ const onBlur = (): void => { display-options hide-label hide-hint - :rows="3" :is-read-only="isReadOnly" :parameter="nameParameter" :value="assignment.name" @@ -196,7 +195,6 @@ const onBlur = (): void => { hide-label hide-issues hide-hint - :rows="3" is-assignment :is-read-only="isReadOnly" :options-position="breakpoint === 'default' ? 'top' : 'bottom'" diff --git a/packages/editor-ui/src/components/FilterConditions/Condition.vue b/packages/editor-ui/src/components/FilterConditions/Condition.vue index 18eb28b03415e..e3b1be0e1878e 100644 --- a/packages/editor-ui/src/components/FilterConditions/Condition.vue +++ b/packages/editor-ui/src/components/FilterConditions/Condition.vue @@ -156,7 +156,6 @@ const onBlur = (): void => { hide-label hide-hint hide-issues - :rows="3" :is-read-only="readOnly" :parameter="leftParameter" :value="condition.leftValue" @@ -181,7 +180,6 @@ const onBlur = (): void => { hide-label hide-hint hide-issues - :rows="3" :is-read-only="readOnly" :options-position="breakpoint === 'default' ? 'top' : 'bottom'" :parameter="rightParameter" diff --git a/packages/editor-ui/src/components/InlineExpressionEditor/InlineExpressionEditorOutput.vue b/packages/editor-ui/src/components/InlineExpressionEditor/InlineExpressionEditorOutput.vue index 65102dabbe198..4c2bda319505a 100644 --- a/packages/editor-ui/src/components/InlineExpressionEditor/InlineExpressionEditorOutput.vue +++ b/packages/editor-ui/src/components/InlineExpressionEditor/InlineExpressionEditorOutput.vue @@ -45,21 +45,24 @@ const resolvedExpression = computed(() => { }); const plaintextSegments = computed(() => { - if (props.segments.length === 0) { - return [ - { - from: 0, - to: resolvedExpression.value.length - 1, - plaintext: resolvedExpression.value, - kind: 'plaintext', - }, - ]; - } - return props.segments.filter((s): s is Plaintext => s.kind === 'plaintext'); }); const resolvedSegments = computed(() => { + if (props.segments.length === 0) { + const emptyExpression = resolvedExpression.value; + const emptySegment: Resolved = { + from: 0, + to: emptyExpression.length, + kind: 'resolvable', + error: null, + resolvable: '', + resolved: emptyExpression, + state: 'pending', + }; + return [emptySegment]; + } + let cursor = 0; return props.segments diff --git a/packages/editor-ui/src/components/ParameterInputFull.vue b/packages/editor-ui/src/components/ParameterInputFull.vue index ceda6d05d75e7..20c7a81d5d729 100644 --- a/packages/editor-ui/src/components/ParameterInputFull.vue +++ b/packages/editor-ui/src/components/ParameterInputFull.vue @@ -1,6 +1,6 @@