Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/reader-commentaries-mode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@

`$scaife.config.commentariesDisplayModeLabel`

Callback, passed rootGetters and `$scaife` config object.

Default value is `'Commentaries'`.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@
} from '@scaife-viewer/common';

const displayNameCallback = (rootGetters, $scaife) => {
return $scaife.config.commentariesDisplayModeLabel || 'Commentaries';
const callback = $scaife.config.commentariesDisplayModeLabel;
if (callback) {
return callback(rootGetters, $scaife)
}
return 'Commentaries';
};

export default {
Expand Down
1 change: 1 addition & 0 deletions packages/store/src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export const DISPLAY_MODE_METRICAL = 'metrical';
export const DISPLAY_MODE_DICTIONARY_ENTRIES = 'dictionary-entries';
export const DISPLAY_MODE_NAMED_ENTITIES = 'named-entities';
export const DISPLAY_MODE_COMMENTARIES = 'commentaries';
export const DISPLAY_MODE_TEXTUAL_NOTES = 'textual-notes';
export const DISPLAY_MODE_SYNTAX_TREES = 'syntax-trees';
export const DISPLAY_MODE_GRAMMATICAL_ENTRIES = 'grammatical-entries';
export const DISPLAY_MODE_FALLBACK = 'fallback';
Expand Down
2 changes: 2 additions & 0 deletions packages/store/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import {
DISPLAY_MODE_DICTIONARY_ENTRIES,
DISPLAY_MODE_NAMED_ENTITIES,
DISPLAY_MODE_COMMENTARIES,
DISPLAY_MODE_TEXTUAL_NOTES,
DISPLAY_MODE_SYNTAX_TREES,
DISPLAY_MODE_GRAMMATICAL_ENTRIES,
DISPLAY_MODE_FALLBACK,
Expand Down Expand Up @@ -107,6 +108,7 @@ export {
DISPLAY_MODE_DICTIONARY_ENTRIES,
DISPLAY_MODE_NAMED_ENTITIES,
DISPLAY_MODE_COMMENTARIES,
DISPLAY_MODE_TEXTUAL_NOTES,
DISPLAY_MODE_SYNTAX_TREES,
DISPLAY_MODE_GRAMMATICAL_ENTRIES,
DISPLAY_MODE_FALLBACK,
Expand Down
4 changes: 4 additions & 0 deletions packages/store/src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import {
DISPLAY_MODE_DICTIONARY_ENTRIES,
DISPLAY_MODE_NAMED_ENTITIES,
DISPLAY_MODE_COMMENTARIES,
DISPLAY_MODE_TEXTUAL_NOTES,
DISPLAY_MODE_DEFAULT,
DISPLAY_MODE_FALLBACK,
SENSE_EXPANSION_PASSAGE,
Expand Down Expand Up @@ -147,6 +148,9 @@ const createStore = client => {
commentariesMode: (_, getters) => {
return getters.displayMode === DISPLAY_MODE_COMMENTARIES;
},
textualNotesMode: (_, getters) => {
return getters.displayMode === DISPLAY_MODE_TEXTUAL_NOTES;
},
fallbackMode: (_, getters) => {
return getters.displayMode === DISPLAY_MODE_FALLBACK;
},
Expand Down
2 changes: 1 addition & 1 deletion packages/widget-commentary/src/CommentaryWidget2.vue
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
filteredLines: {
immediate: true,
handler(newVal) {
if (newVal) {
if (newVal && newVal.length) {
// TODO: Proper mutation
// OPTION B: Filter via selected lines
const lookup = this.buildTokenLookup(newVal);
Expand Down
6 changes: 4 additions & 2 deletions packages/widget-commentary/src/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
// TODO: Export / target SV 2
import CommentaryWidget from './CommentaryWidget.vue';

import CommentaryWidget2 from './CommentaryWidget2.vue';

// NOTE: Used by widget-textual-notes
import CommentaryLine from './CommentaryLine.vue';

const CommentaryWidgetSV1 = CommentaryWidget;
const CommentaryWidgetSV2 = CommentaryWidget2;

export default CommentaryWidgetSV1;

export { CommentaryWidgetSV1, CommentaryWidgetSV2 };
export { CommentaryWidgetSV1, CommentaryWidgetSV2, CommentaryLine };
7 changes: 6 additions & 1 deletion packages/widget-reader/src/ReaderToken.vue
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,11 @@
},
// TODO: Splat from store; revisit docs
commentariesMode() {
return this.$store.getters[`${MODULE_NS}/commentariesMode`];
// TODO: Add textualNotesMode
return (
this.$store.getters[`${MODULE_NS}/commentariesMode`] ||
this.$store.getters[`${MODULE_NS}/textualNotesMode`]
);
},
entities() {
return (this.token && this.token.entities) || [];
Expand Down Expand Up @@ -267,6 +271,7 @@
// //
// return this.$store.state[MODULE_NS].syncCommentary;
// },
// TODO: Textual notes
commentaries() {
if (!this.commentary) {
return [];
Expand Down
21 changes: 21 additions & 0 deletions packages/widget-textual-notes/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2017-2023 Perseus Digital Library

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
6 changes: 6 additions & 0 deletions packages/widget-textual-notes/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# widget-textual-notes

A widget that displays textual notes.

_NOTE:_ This widget reuses code from `@scaife-viewer/widget-commentary`

17 changes: 17 additions & 0 deletions packages/widget-textual-notes/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "@scaife-viewer/widget-textual-notes",
"packageManager": "yarn@3.6.4",
"version": "0.6.0",
"main": "src/index.js",
"publishConfig": {
"access": "public"
},
"author": "Eldarion",
"license": "MIT",
"dependencies": {
"@scaife-viewer/common": "^0.6.0",
"@scaife-viewer/store": "^0.6.0",
"@scaife-viewer/widget-commentary": "^0.6.0",
"graphql-tag": "^2.12.6"
}
}
Loading