-
-
Notifications
You must be signed in to change notification settings - Fork 34
Feature/display reversals/685 #802
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 71 commits
Commits
Show all changes
76 commits
Select commit
Hold shift + click to select a range
f943d5d
Create route for lexicon page
aidanpscott 3dffb58
Removed page.ts
EthanFennell a94997e
Changed use of "slot" to "render" for navbar
EthanFennell 702d50b
List of words
EthanFennell e4fade1
Fix mobile layout
aidanpscott 1df629e
Fix lexicon auto load
aidanpscott 395f895
Fix word id mismatch
MrCars0n 775a0c0
Add margins to alphabet strip
aidanpscott d033725
Add first draft of vernacular letter id handling
MrCars0n 7a60099
Restore dictionary functionality while preserving styling
aidanpscott acc6751
Fixed vernacular letter id handling
MrCars0n ba1bf5d
Create XML element and reorganize
MrCars0n c5d9837
Fix loading of second letter on tab change
MrCars0n c4a298e
Fix alphabet bar navigation bug
MrCars0n 65230fe
Store selectedLanguage after XMLView
MrCars0n ff8ade0
Add word subtexts, indexes, and alphabet strip size change
MrCars0n 8e8e9db
Add word navigation component
aidanpscott 00f5160
Add XML new lines
MrCars0n 06fa8a2
Add multi-index XML call and new line formatting
MrCars0n b88233d
Bug fixes
EthanFennell 0ad9475
Moved vernacular query to page.js, simplified page.svelte
EthanFennell 17909f8
Revert to threshold
EthanFennell 586f27d
Fixed lazy loading glitches on firefox
EthanFennell 177eace
Fixed sqlite fetch issue
EthanFennell ae26814
add single entry style type
AslanRules 4ff134a
Merge branch 'feature/display-reversals/685' of github.com:sillsdev/a…
AslanRules c0664e7
Add hyperlinks to headwords in XML
MrCars0n 3b36c1b
Remove unused variable and comments
MrCars0n 9461d04
show single entry styles
AslanRules d9ad301
Added stores. Refactored lexicon code. Included reversal/vernacular m…
EthanFennell c95120b
Merge and formatting
EthanFennell c616955
Applied suggestions
EthanFennell 4d70312
Small changes
EthanFennell f1392b7
Small changes
EthanFennell 0f55156
miscellaneous small refactors
AslanRules 071ec65
Format
EthanFennell b88c6c3
Fix test
EthanFennell ef9aaf7
Fix accessibility issues
aidanpscott ba77bdc
Add fallback for summary without matches
MrCars0n 4531462
Fix comma issue. Fix duplicate listeners
EthanFennell 7a5cb54
Add proper type definition for vernacularWordsStore
MrCars0n 1585440
Improve store definitions
MrCars0n fc0081c
Vernacular word hyperlink fix
MrCars0n 9dc61e4
Fix lint issues
chrisvire facc036
Fix language tab to match native app
aidanpscott 0300807
Remove padding
MrCars0n 4bed4c7
Applied feedback for language tabs
EthanFennell e2fcdb6
fix lint
chrisvire c9b048c
Fix spacing
EthanFennell d0a9562
Adjust word list spacing
aidanpscott 2dccab3
Fix navbar hiding on scroll and div organization
MrCars0n e848ba0
Fix more div organizaiton
MrCars0n a791eeb
Spacing fix
MrCars0n d2f7d05
Implement lexicon error handling
aidanpscott 1d141aa
Implement fetch logic for reversal view
aidanpscott e82a119
Fix a potential security vulnerability
aidanpscott 0fa7c90
fix lint
chrisvire 40e9333
Remove hardcoded colors
aidanpscott bdf07c1
Split LexiconReversalListView into separate components.
chrisvire 52859d0
Remove hardcoded color
aidanpscott c2f7e40
Remove alphabetStrip artifact
MrCars0n da80dab
Add proper reversal file fetch
aidanpscott 23fa6e5
Remove phantom endpoint call
MrCars0n 6ff83a3
Add grid view
MrCars0n 843b73a
Remove HEAD request in file loading
aidanpscott 92eedb1
Remove unnecessary comments
aidanpscott 248cb73
Add grid view
MrCars0n cc26d25
Add grid view
MrCars0n a0c31de
Remove redundancy
aidanpscott 4231b70
convertReversalIndex create index.json
chrisvire 3ae4202
Use ReversalIndex to load reversal files
chrisvire ab03d14
Fix wide screen gap
MrCars0n 14c5e45
Fix display on wide screen
chrisvire be9693a
Rename AlphabetStrip
chrisvire 144d55e
Rename LexiconReversalView
chrisvire a41d30a
Rename LexiconXMLView
chrisvire File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| <script lang="ts"> | ||
| export let alphabet: string[]; | ||
| export let activeLetter: string; | ||
| export let onLetterSelect: (letter: string) => void; | ||
| </script> | ||
|
|
||
| <div | ||
| class="flex m-2 gap-1 md:gap-2 mb-4 justify-start overflow-x-auto whitespace-nowrap pb-2 snap-x" | ||
| > | ||
| {#each alphabet as letter} | ||
| <button | ||
| class="px-3 py-2 text-sm font-bold border rounded-md bg-gray-100 hover:bg-gray-200 cursor-pointer snap-start | ||
| sm:px-4 sm:py-3 sm:text-base | ||
| md:px-5 md:py-4 md:text-base | ||
| lg:px-6 lg:py-4 lg:text-lg" | ||
| style={activeLetter === letter | ||
| ? 'background-color: var(--TitleBackgroundColor); border-color: black;' | ||
| : ''} | ||
| on:click={() => onLetterSelect(letter)} | ||
| > | ||
| {letter} | ||
| </button> | ||
| {/each} | ||
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| <script> | ||
| import { expoInOut } from 'svelte/easing'; | ||
| import { fly } from 'svelte/transition'; | ||
|
|
||
| export let reversalLanguage; | ||
| export let selectedLanguage; | ||
| export let onSwitchLanguage; | ||
| export let vernacularLanguage; | ||
| </script> | ||
|
|
||
| <div class="flex w-full" style="background-color: var(--TabBackgroundColor);"> | ||
| <div | ||
| role="button" | ||
| tabindex="0" | ||
| aria-pressed={selectedLanguage === vernacularLanguage} | ||
| on:click={() => onSwitchLanguage(vernacularLanguage)} | ||
| on:keydown={(e) => e.key === 'Enter' && onSwitchLanguage(vernacularLanguage)} | ||
| class="py-2.5 px-3.5 text-sm uppercase text-center relative dy-tabs dy-tabs-bordered mb-1" | ||
| > | ||
| {vernacularLanguage} | ||
| {#if selectedLanguage === vernacularLanguage} | ||
| <div | ||
| transition:fly={{ axis: 'x', easing: expoInOut, x: 70 }} | ||
| class="absolute -bottom-1 left-0 w-full h-1 bg-black" | ||
| ></div> | ||
| {/if} | ||
| </div> | ||
| <div | ||
| role="button" | ||
| tabindex="0" | ||
| aria-pressed={selectedLanguage === reversalLanguage} | ||
| on:click={() => onSwitchLanguage(reversalLanguage)} | ||
| on:keydown={(e) => e.key === 'Enter' && onSwitchLanguage(reversalLanguage)} | ||
| class="py-2.5 px-3.5 text-sm uppercase text-center relative dy-tabs dy-tabs-bordered mb-1" | ||
| > | ||
| {reversalLanguage} | ||
| {#if selectedLanguage === reversalLanguage} | ||
| <div | ||
| transition:fly={{ axis: 'x', easing: expoInOut, x: -70 }} | ||
| class="absolute -bottom-1 left-0 w-full h-1 bg-black" | ||
| ></div> | ||
| {/if} | ||
| </div> | ||
| <div class="flex-1"></div> | ||
| </div> |
|
chrisvire marked this conversation as resolved.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| <script> | ||
| export let reversalWordsList; | ||
| export let onSelectWord; | ||
| </script> | ||
|
|
||
| <ul class="space-y-3 px-4 pb-4"> | ||
| {#each reversalWordsList as { word, indexes, vernacularWords, letter }} | ||
| <li class="cursor-pointer text-lg mb-3" id="letter-{letter}"> | ||
| <button | ||
| type="button" | ||
| class="w-full text-left py-1" | ||
| aria-label={`Select word ${word}`} | ||
| on:click={() => onSelectWord({ word, indexes })} | ||
| on:keydown={(event) => { | ||
| if (event.key === 'Enter' || event.key === ' ') { | ||
| onSelectWord({ word, indexes }); | ||
| event.preventDefault(); | ||
| } | ||
| }} | ||
| > | ||
| <p class="font-bold break-words">{word}</p> | ||
| <p class="text-md ml-4"> | ||
| {#each vernacularWords as { name, homonymIndex }, i} | ||
| {#if i > 0}, | ||
| {/if} | ||
| {name}{#if homonymIndex > 0}<sub>{homonymIndex}</sub>{/if} | ||
| {/each} | ||
| </p> | ||
| </button> | ||
| </li> | ||
| {/each} | ||
| </ul> |
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this called LexiconReversalView? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| <script> | ||
| import AlphabetStrip from './AlphabetStrip.svelte'; | ||
| import LexiconLanguageTabs from './LexiconLanguageTabs.svelte'; | ||
|
|
||
| export let alphabet = []; | ||
| export let selectedLanguage; | ||
| export let vernacularLanguage; | ||
| export let reversalLanguage; | ||
| export let selectedLetter; | ||
| export let onSwitchLanguage; | ||
| export let onLetterChange; | ||
|
|
||
| let currentLetter = alphabet[0]; | ||
|
|
||
| async function handleLetterSelect(letter) { | ||
| currentLetter = letter; | ||
| onLetterChange(letter); | ||
| } | ||
|
|
||
| $: if (alphabet && alphabet.length > 0) { | ||
| currentLetter = alphabet[0]; | ||
| } | ||
| $: if (selectedLetter !== currentLetter) { | ||
| currentLetter = selectedLetter; | ||
| } | ||
| </script> | ||
|
|
||
| <LexiconLanguageTabs | ||
| {reversalLanguage} | ||
| {selectedLanguage} | ||
| {onSwitchLanguage} | ||
| {vernacularLanguage} | ||
| /> | ||
|
|
||
| <AlphabetStrip {alphabet} activeLetter={currentLetter} onLetterSelect={handleLetterSelect} /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| <script> | ||
| export let vernacularWordsList; | ||
| export let onSelectWord; | ||
| </script> | ||
|
|
||
| <ul class="space-y-3 px-4 pb-4"> | ||
| {#each vernacularWordsList as { id, name, homonym_index, type, num_senses, summary, letter }} | ||
| <li class="cursor-pointer text-lg mb-3 scroll-mt-16" id="letter-{letter}"> | ||
| <button | ||
| type="button" | ||
| class="w-full text-left py-1" | ||
| aria-label={`Select word ${name}`} | ||
| on:click={() => onSelectWord({ word: name, index: id })} | ||
| on:keydown={(event) => { | ||
| if (event.key === 'Enter' || event.key === ' ') { | ||
| onSelectWord({ word: name, index: id }); | ||
| event.preventDefault(); | ||
| } | ||
| }} | ||
| > | ||
| <p class="font-bold break-words"> | ||
| {name}{#if homonym_index > 0}<sub>{homonym_index}</sub>{/if} | ||
| </p> | ||
| {#if summary} | ||
| <p class="ml-4 italic"> | ||
| {#each summary.match(/{(.*?)}/g) || [] as match} | ||
| {match.replace(/[{}]/g, '')} | ||
| {/each} | ||
| </p> | ||
| {/if} | ||
| </button> | ||
| </li> | ||
| {/each} | ||
| </ul> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.