File tree Expand file tree Collapse file tree 8 files changed +14
-11
lines changed
fields/inputFields/fields Expand file tree Collapse file tree 8 files changed +14
-11
lines changed Original file line number Diff line number Diff line change 33 import type { InputFieldSvelteProps } from ' packages/core/src/fields/inputFields/InputFieldSvelteWrapper' ;
44 import Button from ' packages/core/src/utils/components/Button.svelte' ;
55 import type { ContextMenuItemDefinition } from ' packages/core/src/utils/IContextMenu' ;
6+ import { stringifyLiteral } from ' packages/core/src/utils/Literal' ;
67
78 const props: InputFieldSvelteProps <string []> & {
89 showSuggester: () => void ;
8485
8586<div class =" mb-image-card-grid" >
8687 {#each value as image , i }
87- <div class ="mb-image-card" oncontextmenu ={e => openContextMenuForElement (e , i )} role =" listitem" >
88+ <div class ="mb-image-card" oncontextmenu ={e => openContextMenuForElement (e , i )} role ="listitem" data-value ={ stringifyLiteral ( image )} >
8889 <img
8990 class =" mb-image-card-image"
9091 src ={props .plugin .internal .imagePathToUri (image )}
Original file line number Diff line number Diff line change 9292
9393<div class =" mb-inline-list" >
9494 {#each value as entry , i }
95- <div class ="mb-inline-list-item" oncontextmenu ={e => openContextMenuForElement (e , i )} role =" listitem" >
95+ <div class ="mb-inline-list-item" oncontextmenu ={e => openContextMenuForElement (e , i )} role ="listitem" data-value ={ stringifyLiteral ( entry )} >
9696 <LiteralRenderComponent value ={entry }></LiteralRenderComponent >
9797 </div >
9898 {/each }
Original file line number Diff line number Diff line change 33 import Icon from ' packages/core/src/utils/components/Icon.svelte' ;
44 import LiteralRenderComponent from ' packages/core/src/utils/components/LiteralRenderComponent.svelte' ;
55 import type { ContextMenuItemDefinition } from ' packages/core/src/utils/IContextMenu' ;
6- import type { MBLiteral } from ' packages/core/src/utils/Literal' ;
6+ import { stringifyLiteral , type MBLiteral } from ' packages/core/src/utils/Literal' ;
77
88 const props: InputFieldSvelteProps <MBLiteral []> & {
99 showSuggester: () => void ;
9595
9696<div class =" mb-inline-list" >
9797 {#each value as entry , i }
98- <div class ="mb-inline-list-item" oncontextmenu ={e => openContextMenuForElement (e , i )} role =" listitem" >
98+ <div class ="mb-inline-list-item" oncontextmenu ={e => openContextMenuForElement (e , i )} role ="listitem" data-value ={ stringifyLiteral ( entry )} >
9999 <LiteralRenderComponent value ={entry }></LiteralRenderComponent >
100100 </div >
101101 {/each }
Original file line number Diff line number Diff line change 9999
100100<div class =" mb-list-items" >
101101 {#each value as entry , i }
102- <div class ="mb-list-item" oncontextmenu ={e => openContextMenuForElement (e , i )} role =" listitem" >
102+ <div class ="mb-list-item" oncontextmenu ={e => openContextMenuForElement (e , i )} role ="listitem" data-value ={ stringifyLiteral ( entry )} >
103103 <LiteralRenderComponent value ={entry }></LiteralRenderComponent >
104104 </div >
105105 {:else }
Original file line number Diff line number Diff line change 44 import Button from ' packages/core/src/utils/components/Button.svelte' ;
55 import LiteralRenderComponent from ' packages/core/src/utils/components/LiteralRenderComponent.svelte' ;
66 import type { ContextMenuItemDefinition } from ' packages/core/src/utils/IContextMenu' ;
7- import type { MBLiteral } from ' packages/core/src/utils/Literal' ;
7+ import { stringifyLiteral , type MBLiteral } from ' packages/core/src/utils/Literal' ;
88
99 const props: InputFieldSvelteProps <MBLiteral []> & {
1010 showSuggester: () => void ;
7070
7171<div class =" mb-list-items" >
7272 {#each value as entry , i }
73- <div class ="mb-list-item" oncontextmenu ={e => openContextMenuForElement (e , i )} role =" listitem" >
73+ <div class ="mb-list-item" oncontextmenu ={e => openContextMenuForElement (e , i )} role ="listitem" data-value ={ stringifyLiteral ( entry )} >
7474 <LiteralRenderComponent value ={entry }></LiteralRenderComponent >
7575 </div >
7676 {:else }
Original file line number Diff line number Diff line change 22 import type { OptionInputFieldArgument } from ' packages/core/src/fields/fieldArguments/inputFieldArguments/arguments/OptionInputFieldArgument' ;
33 import type { InputFieldSvelteProps } from ' packages/core/src/fields/inputFields/InputFieldSvelteWrapper' ;
44 import LiteralRenderComponent from ' packages/core/src/utils/components/LiteralRenderComponent.svelte' ;
5- import type { MBLiteral } from ' packages/core/src/utils/Literal' ;
5+ import { stringifyLiteral , type MBLiteral } from ' packages/core/src/utils/Literal' ;
66
77 const props: InputFieldSvelteProps <MBLiteral []> & {
88 options: OptionInputFieldArgument [];
4444 selectOption (option .value );
4545 }}
4646 onkeypress ={event => selectOptionOnKey (event , option .value )}
47+ data-value ={stringifyLiteral (option .value )}
4748 >
4849 <input type ="checkbox" checked ={value .includes (option .value )} oninput ={() => selectOption (option .value )} />
4950 <LiteralRenderComponent value ={option .name }></LiteralRenderComponent >
Original file line number Diff line number Diff line change 22 import type { OptionInputFieldArgument } from ' packages/core/src/fields/fieldArguments/inputFieldArguments/arguments/OptionInputFieldArgument' ;
33 import type { InputFieldSvelteProps } from ' packages/core/src/fields/inputFields/InputFieldSvelteWrapper' ;
44 import LiteralRenderComponent from ' packages/core/src/utils/components/LiteralRenderComponent.svelte' ;
5- import type { MBLiteral } from ' packages/core/src/utils/Literal' ;
5+ import { stringifyLiteral , type MBLiteral } from ' packages/core/src/utils/Literal' ;
66
77 const props: InputFieldSvelteProps <MBLiteral > & {
88 options: OptionInputFieldArgument [];
4343 selectOption (option .value );
4444 }}
4545 onkeypress ={event => selectOptionOnKey (event , option .value )}
46+ data-value ={stringifyLiteral (option .value )}
4647 >
4748 <input type ="checkbox" checked ={option .value === value } oninput ={() => selectOption (option .value )} />
4849 <LiteralRenderComponent value ={option .name }></LiteralRenderComponent >
Original file line number Diff line number Diff line change 1212 </script >
1313
1414{#if typeof parsedValue === ' string' }
15- <span data-value ={ parsedValue } class ="mb-whitespace-pre" >{parsedValue }</span >
15+ <span class ="mb-whitespace-pre" >{parsedValue }</span >
1616{:else if Array .isArray (parsedValue )}
1717 <span >
1818 <ListWrapper elements ={parsedValue }>
1919 {#snippet children (element )}
2020 {#if typeof element === ' string' }
21- <span data-value ={ element } >{element }</span >
21+ <span >{element }</span >
2222 {:else }
2323 <LinkComponent mdLink ={element }></LinkComponent >
2424 {/if }
You can’t perform that action at this time.
0 commit comments