Skip to content

Commit

Permalink
Merge pull request #48 from scaife-viewer/develop
Browse files Browse the repository at this point in the history
Prepare for v2020-10-13-001 release
  • Loading branch information
jacobwegner authored Oct 13, 2020
2 parents c2c9d90 + 9ed36dd commit 0e838fe
Show file tree
Hide file tree
Showing 5 changed files with 1,140 additions and 674 deletions.
2 changes: 2 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
[context."master".environment]
VUE_APP_ATLAS_GRAPHQL_ENDPOINT = "https://sv-mini-atlas.scaife-viewer.org/graphql/"
[context."frontend-updates".environment]
VUE_APP_ATLAS_GRAPHQL_ENDPOINT = "https://sv-mini-atlas-pr-36.herokuapp.com/graphql/"
81 changes: 47 additions & 34 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,58 +10,71 @@
"testDebug": "node --inspect-brk node_modules/.bin/jest --runInBand"
},
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^1.2.30",
"@fortawesome/free-solid-svg-icons": "^5.14.0",
"@fortawesome/vue-fontawesome": "^0.1.10",
"@scaife-viewer/skeleton": "^0.0.5",
"@scaife-viewer/store": "^0.0.4",
"@scaife-viewer/widget-library": "^0.0.4",
"@scaife-viewer/widget-metadata": "^0.0.4",
"@scaife-viewer/widget-new-alexandria": "^0.0.5",
"@scaife-viewer/widget-passage-ancestors": "^0.0.5",
"@scaife-viewer/widget-passage-children": "^0.0.5",
"@scaife-viewer/widget-passage-reference": "^0.0.8",
"@scaife-viewer/widget-reader": "^0.0.5",
"@scaife-viewer/widget-text-size": "^0.0.5",
"@scaife-viewer/widget-text-width": "^0.0.5",
"@scaife-viewer/widget-toc": "^0.0.4",
"@scaife-viewer/widget-word-list": "^0.0.5",
"@fortawesome/fontawesome-svg-core": "^1.2.31",
"@fortawesome/free-solid-svg-icons": "^5.15.0",
"@fortawesome/vue-fontawesome": "^2.0.0",
"@scaife-viewer/common": "^0.0.6",
"@scaife-viewer/reader-alignments-mode": "^0.0.9",
"@scaife-viewer/reader-image-mode": "^0.0.10",
"@scaife-viewer/reader-interlinear-mode": "^0.0.10",
"@scaife-viewer/reader-metrical-mode": "^0.0.10",
"@scaife-viewer/reader-named-entities-mode": "^0.0.10",
"@scaife-viewer/reader-syntax-trees-mode": "^0.0.6",
"@scaife-viewer/skeleton": "^0.0.10",
"@scaife-viewer/store": "^0.0.9",
"@scaife-viewer/widget-audio": "^0.0.10",
"@scaife-viewer/widget-display-mode": "^0.0.10",
"@scaife-viewer/widget-library": "^0.0.9",
"@scaife-viewer/widget-metadata": "^0.0.9",
"@scaife-viewer/widget-named-entities": "^0.0.10",
"@scaife-viewer/widget-new-alexandria": "^0.0.10",
"@scaife-viewer/widget-passage-ancestors": "^0.0.10",
"@scaife-viewer/widget-passage-children": "^0.0.10",
"@scaife-viewer/widget-passage-reference": "^0.0.13",
"@scaife-viewer/widget-passage-siblings": "^0.0.10",
"@scaife-viewer/widget-reader": "^0.0.10",
"@scaife-viewer/widget-scholia": "^0.0.11",
"@scaife-viewer/widget-text-size": "^0.0.10",
"@scaife-viewer/widget-text-width": "^0.0.10",
"@scaife-viewer/widget-toc": "^0.0.9",
"@scaife-viewer/widget-token-annotations": "^0.0.11",
"@scaife-viewer/widget-word-list": "^0.0.10",
"apollo-boost": "^0.4.9",
"core-js": "^3.6.5",
"graphql-tag": "^2.11.0",
"node-sass": "^4.14.1",
"path": "^0.12.7",
"sass-loader": "^9.0.3",
"vue": "^2.6.11",
"sass-loader": "^10.0.2",
"vue": "^2.6.12",
"vue-apollo": "^3.0.4",
"vue-router": "^3.4.3",
"vue-router": "^3.4.5",
"vuex": "^3.5.1",
"vuex-router-sync": "^5.0.0",
"webpack": "^4.44.1"
"webpack": "^4.44.2"
},
"devDependencies": {
"@babel/core": "^7.11.1",
"@babel/preset-env": "^7.11.0",
"@vue/cli-plugin-babel": "^4.5.4",
"@vue/cli-plugin-eslint": "^4.5.4",
"@vue/cli-plugin-unit-jest": "^4.5.4",
"@vue/cli-service": "^4.5.4",
"@babel/core": "^7.11.6",
"@babel/preset-env": "^7.11.5",
"@vue/cli-plugin-babel": "^4.5.6",
"@vue/cli-plugin-eslint": "^4.5.6",
"@vue/cli-plugin-unit-jest": "^4.5.6",
"@vue/cli-service": "^4.5.6",
"@vue/eslint-config-airbnb": "^5.1.0",
"@vue/eslint-config-prettier": "^6.0.0",
"@vue/server-test-utils": "^1.0.4",
"@vue/test-utils": "^1.0.4",
"@vue/server-test-utils": "^1.1.0",
"@vue/test-utils": "^1.1.0",
"babel-eslint": "^10.1.0",
"babel-jest": "^26.3.0",
"eslint": "^7.7.0",
"eslint": "^7.10.0",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-vue": "^6.2.2",
"jest": "^26.4.0",
"prettier": "^2.0.5",
"jest": "^26.4.2",
"prettier": "^2.1.2",
"style-resources-loader": "^1.3.3",
"vue-cli-plugin-style-resources-loader": "^0.1.4",
"vue-jest": "^3.0.6",
"vue-server-renderer": "2.6.11",
"vue-template-compiler": "^2.6.11"
"vue-jest": "^3.0.7",
"vue-server-renderer": "2.6.12",
"vue-template-compiler": "^2.6.12"
},
"postcss": {
"plugins": {
Expand Down
69 changes: 50 additions & 19 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,67 @@ import VueApollo from 'vue-apollo';
import { sync } from 'vuex-router-sync';

import {
faChevronLeft,
faChevronDown,
faChevronRight,
} from '@fortawesome/free-solid-svg-icons';

DISPLAY_MODE_ALIGNMENTS,
DISPLAY_MODE_FOLIO,
DISPLAY_MODE_INTERLINEAR,
DISPLAY_MODE_METRICAL,
DISPLAY_MODE_NAMED_ENTITIES,
DISPLAY_MODE_SYNTAX_TREES,
DISPLAY_MODE_DEFAULT,
} from '@scaife-viewer/store';
import { SkeletonPlugin } from '@scaife-viewer/skeleton';

import { DefaultModeReader } from '@scaife-viewer/widget-reader';
import { DISPLAY_MODE_DEFAULT } from '@scaife-viewer/store';

import AlignmentsModeReader from '@scaife-viewer/reader-alignments-mode';
import ImageModeReader, {
iconMap as imageModeReaderIconMap,
} from '@scaife-viewer/reader-image-mode';
import NamedEntitiesModeReader, {
iconMap as namedEntitesReaderIconMap,
} from '@scaife-viewer/reader-named-entities-mode';
import MetricalModeReader from '@scaife-viewer/reader-metrical-mode';
import InterlinearModeReader from '@scaife-viewer/reader-interlinear-mode';
import SyntaxTreesModeReader from '@scaife-viewer/reader-syntax-trees-mode';

import { iconMap as commonIconMap } from '@scaife-viewer/common';
import { iconMap as audioIconMap } from '@scaife-viewer/widget-audio';
// eslint-disable-next-line max-len
import { iconMap as namedEntitiesIconMap } from '@scaife-viewer/widget-named-entities';

import App from '@/App.vue';
import router from '@/router';
import store, { apolloProvider } from '@/store';

sync(store, router);

const iconMap = [faChevronLeft, faChevronDown, faChevronRight].reduce(
(map, obj) => {
// eslint-disable-next-line no-param-reassign
map[obj.iconName] = obj;
return map;
Vue.use(SkeletonPlugin, {
iconMap: {
...commonIconMap,
...audioIconMap,
...namedEntitiesIconMap,
...namedEntitesReaderIconMap,
...imageModeReaderIconMap,
},
{},
);

const config = {
readerComponents: {
[DISPLAY_MODE_DEFAULT]: DefaultModeReader,
config: {
entityMap: {
accessToken:
// eslint-disable-next-line max-len
'pk.eyJ1IjoicGFsdG1hbiIsImEiOiJja2JpNDVpbmUwOGF1MnJwZm91c3VybDVrIn0.KRcXBGtiUWFXkp2uaE5LLw',
mapStyle: 'mapbox://styles/paltman/ckbi4thqt156y1ijz5wldui14',
},
readerComponents: {
[DISPLAY_MODE_DEFAULT]: DefaultModeReader,
[DISPLAY_MODE_INTERLINEAR]: InterlinearModeReader,
[DISPLAY_MODE_FOLIO]: ImageModeReader,
[DISPLAY_MODE_METRICAL]: MetricalModeReader,
[DISPLAY_MODE_NAMED_ENTITIES]: NamedEntitiesModeReader,
[DISPLAY_MODE_ALIGNMENTS]: AlignmentsModeReader,
[DISPLAY_MODE_SYNTAX_TREES]: SyntaxTreesModeReader,
},
pageTitle: (title) => `SV Mini | ${title}`,
},
};
Vue.use(SkeletonPlugin, { iconMap, config });
});

Vue.use(VueApollo);

Expand Down
34 changes: 28 additions & 6 deletions src/views/ReaderView.vue
Original file line number Diff line number Diff line change
@@ -1,32 +1,44 @@
<template>
<FixedSkeleton
v-if="metaLoaded"
:main-widget="mainWidget"
:left-widgets="leftWidgets"
:right-widgets="rightWidgets"
/>
<LoaderBall v-else />
</template>

<script>
import FixedSkeleton from '@scaife-viewer/skeleton';
import {
MODULE_NS,
FETCH_METADATA,
FETCH_LIBRARY,
} from '@scaife-viewer/store';
import { LoaderBall } from '@scaife-viewer/common';
import LibraryWidget from '@scaife-viewer/widget-library';
import ReaderWidget from '@scaife-viewer/widget-reader';
import MetadataWidget from '@scaife-viewer/widget-metadata';
import NewAlexandriaWidget from '@scaife-viewer/widget-new-alexandria';
import PassageReferenceWidget from '@scaife-viewer/widget-passage-reference';
import PassageAncestorsWidget from '@scaife-viewer/widget-passage-ancestors';
import PassageSiblingsWidget from '@scaife-viewer/widget-passage-siblings';
import PassageChildrenWidget from '@scaife-viewer/widget-passage-children';
import PassageReferenceWidget from '@scaife-viewer/widget-passage-reference';
import LibraryWidget from '@scaife-viewer/widget-library';
import TokenAnnotationWidget from '@scaife-viewer/widget-token-annotations';
import NamedEntitiesWidget from '@scaife-viewer/widget-named-entities';
import DisplayModeWidget from '@scaife-viewer/widget-display-mode';
import ScholiaWidget from '@scaife-viewer/widget-scholia';
import AudioWidget from '@scaife-viewer/widget-audio';
import WordListWidget from '@scaife-viewer/widget-word-list';
import NewAlexandriaWidget from '@scaife-viewer/widget-new-alexandria';
import TextSizeWidget from '@scaife-viewer/widget-text-size';
import TextWidthWidget from '@scaife-viewer/widget-text-width';
import WordListWidget from '@scaife-viewer/widget-word-list';
import ReaderWidget from '@scaife-viewer/widget-reader';
// import TOCWidget from '@scaife-viewer/widget-toc';
export default {
name: 'ReaderView',
components: { FixedSkeleton, LoaderBall },
beforeCreate() {
if (!this.$route.query.urn) {
// load the first version returned from ATLAS
Expand All @@ -35,14 +47,19 @@
this.$store.dispatch(`${MODULE_NS}/${FETCH_LIBRARY}`);
},
computed: {
metaLoaded() {
return this.$store.state[MODULE_NS].libraryTree !== null;
// && this.$store.state[MODULE_NS].metadata !== null;
},
mainWidget() {
return ReaderWidget;
},
leftWidgets() {
return [
PassageReferenceWidget,
LibraryWidget,
PassageReferenceWidget,
PassageAncestorsWidget,
PassageSiblingsWidget,
PassageChildrenWidget,
// TOCWidget, - Requires the endpoints plugin to work
];
Expand All @@ -52,8 +69,13 @@
MetadataWidget,
TextSizeWidget,
TextWidthWidget,
AudioWidget,
DisplayModeWidget,
NamedEntitiesWidget,
TokenAnnotationWidget,
WordListWidget,
NewAlexandriaWidget,
ScholiaWidget,
];
},
},
Expand Down
Loading

0 comments on commit 0e838fe

Please sign in to comment.