Skip to content

Commit

Permalink
Merge pull request #168 from mermaid-js/fix/async-message-alignment
Browse files Browse the repository at this point in the history
Fixed editing style and async message text-align.
  • Loading branch information
MrCoder authored Jun 17, 2024
2 parents e21f1c8 + 53c0395 commit dcfee8c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
>
{{ number }}
</div>
<div :style="textStyle" :class="classNames">
<MessageLabel
:labelText="labelText"
:labelPosition="labelPosition"
:isSelf="true"
/>
</div>
<MessageLabel
:style="textStyle"
:class="classNames"
:labelText="labelText"
:labelPosition="labelPosition"
:isSelf="true"
/>
</label>
<svg class="arrow text-skin-message-arrow" width="30" height="24">
<polyline
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
{{ number }}
</div>
<MessageLabel
:style="textStyle"
:class="classNames"
:labelText="labelText"
:labelPosition="labelPosition"
:isAsync="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@
'flex-row-reverse': rtl,
return: type === 'return',
'right-to-left': rtl,
'text-left': isAsync,
'text-center': !isAsync,
}"
:style="{ 'border-bottom-style': borderStyle || undefined }"
@click="onClick"
ref="messageRef"
>
<div
class="name group flex-grow relative hover:text-skin-message-hover hover:bg-skin-message-hover"
class="name group text-center flex-grow relative hover:text-skin-message-hover hover:bg-skin-message-hover"
>
<div class="inline-block static min-h-[1em]">
<div :style="textStyle" :class="classNames">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
class="px-1 cursor-text right hover:text-skin-message-hover hover:bg-skin-message-hover"
:class="{
'cursor-text': editing,
'absolute right-1/2 translate-x-1/2 bottom-0': editing && !isSelfAsync,
}"
:contenteditable="editing && mode === RenderMode.Dynamic"
@dblclick="handleDblClick"
Expand Down Expand Up @@ -34,14 +33,13 @@ const props = withDefaults(
},
);
const { labelText, labelPosition, isAsync, isSelf } = toRefs(props);
const { labelText, labelPosition, isAsync } = toRefs(props);
const store = useStore();
const mode = computed(() => store.state.mode);
const code = computed(() => store.getters.code);
const onContentChange = computed(
() => store.getters.onContentChange || (() => {}),
);
const isSelfAsync = computed(() => !!isAsync?.value && !!isSelf?.value);
function updateCode(code: string) {
store.dispatch("updateCode", { code });
Expand Down

0 comments on commit dcfee8c

Please sign in to comment.