File tree Expand file tree Collapse file tree
packages/supersearch/src/lib Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22 color : var (--text-body );
33 font-size : var (--text-sm );
44 white-space : nowrap;
5-
6- @media screen and (min-width : 640px ) {
7- font-size : var (--text-sm );
8- }
95}
106
117.lxl-qualifier .editing {
4945 background-color : var (--color-accent-50 );
5046}
5147
52- .lxl-qualifier-value : not (: has (.lxl-ghost-paren )) {
48+ /* make up space for missing parens */
49+ .lxl-qualifier-value .editable : not (: has (.lxl-ghost-paren )) {
5350 padding-inline : calc (var (--spacing ) * 1.5 );
5451}
5552
53+ .lxl-qualifier-value .editable {
54+ margin-left : -2px ;
55+ }
56+
5657.atomic .lxl-qualifier-value {
5758 border-radius : 0 ;
5859}
Original file line number Diff line number Diff line change 11import { expect , test } from '@playwright/test' ;
2- // import AxeBuilder from '@axe-core/playwright';
2+ import AxeBuilder from '@axe-core/playwright' ;
33
44test . beforeEach ( async ( { page } ) => {
55 await page . goto ( '/help/filters' ) ;
66} ) ;
77
8- /*
98test ( 'should not have any detectable a11y issues' , async ( { page } ) => {
10- const accessibilityScanResults = await new AxeBuilder({ page }).analyze();
9+ const accessibilityScanResults = await new AxeBuilder ( { page } )
10+ . exclude ( '[role="combobox"][aria-placeholder]' ) // aria-placeholder issue in supersearch is a false alarm (see https://github.com/w3c/aria/issues/2689)
11+ . analyze ( ) ;
1112 await expect . soft ( accessibilityScanResults . violations ) . toEqual ( [ ] ) ;
1213} ) ;
13- */
1414
1515test ( 'qualifier keys can be added from filter list' , async ( { page } ) => {
1616 await page . getByRole ( 'main' ) . getByRole ( 'button' ) . getByText ( 'Ingår i bibliografi' ) . click ( ) ;
17+ await page . waitForResponse (
18+ ( res ) => res . url ( ) . includes ( '/supersearch?_q=' ) && res . status ( ) === 200
19+ ) ;
1720 await expect ( page . getByRole ( 'combobox' ) . first ( ) ) . toContainText ( 'Ingår i bibliografi' ) ;
1821 await expect ( page . getByRole ( 'combobox' ) . last ( ) ) . toContainText ( 'Ingår i bibliografi' ) ;
1922 await page . keyboard . press ( 'Escape' ) ;
2023 await page . getByRole ( 'main' ) . getByRole ( 'button' ) . getByText ( 'Bibliotek' ) . first ( ) . click ( ) ;
24+ await page . waitForResponse (
25+ ( res ) => res . url ( ) . includes ( '/supersearch?_q=' ) && res . status ( ) === 200
26+ ) ;
2127 await expect ( page . getByRole ( 'combobox' ) . first ( ) ) . toContainText ( 'Bibliotek' ) ;
2228} ) ;
Original file line number Diff line number Diff line change 3535 DispatchChangeParams
3636 } from ' $lib/types/superSearch.js' ;
3737 import { historyKeymap , standardKeymap } from ' @codemirror/commands' ;
38+ import { draw , theme } from ' $lib/extensions/theme' ;
3839
3940 export type ExpandedContentParams = {
4041 search: ReturnType <typeof useSearchRequest >;
224225 preventNewLine ({ replaceWithSpace: true }),
225226 ... (language ? [language ] : []),
226227 placeholderCompartment .of (placeholderExtension (placeholder )),
228+ draw ,
229+ theme ,
227230 ... extensions
228231 ]);
229232
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ class QualifierWidget extends WidgetType {
2727 toDOM ( view : EditorView ) : HTMLElement {
2828 const container = document . createElement ( 'span' ) ;
2929 container . className = 'atomic' ;
30+ container . setAttribute ( 'style' , 'margin-inline: 2px' ) ;
3031
3132 container . ondblclick = ( ) => {
3233 if ( this . props . atomicFrom != null && this . props . atomicTo != null ) {
@@ -78,7 +79,7 @@ export function addDecorations(view: EditorView) {
7879 if ( ! qualifier . valueLabel && valueNode ) {
7980 decorations . push (
8081 Decoration . mark ( {
81- class : 'lxl-qualifier-value' ,
82+ class : 'lxl-qualifier-value editable ' ,
8283 inclusive : false
8384 } ) . range ( valueNode . from , valueNode . node . to )
8485 ) ;
Original file line number Diff line number Diff line change 1+ import { EditorView } from '@codemirror/view' ;
2+ import { drawSelection } from '@codemirror/view' ;
3+
4+ export const draw = drawSelection ( ) ;
5+
6+ export const theme = EditorView . theme ( {
7+ '&.cm-focused .cm-cursor' : {
8+ borderLeft : '1.4px solid #000' ,
9+ marginLeft : '0px'
10+ } ,
11+ '&.cm-editor .cm-selectionLayer' : {
12+ zIndex : '1!important' ,
13+ pointerEvents : 'none'
14+ } ,
15+ '&.cm-focused .cm-selectionBackground' : {
16+ background : '#3b82f640!important'
17+ }
18+ } ) ;
You can’t perform that action at this time.
0 commit comments