Skip to content

Commit

Permalink
Merge pull request #156 from cu-mkp/dev
Browse files Browse the repository at this point in the history
`editioncrafter` 1.2.0
  • Loading branch information
camdendotlol authored Jan 7, 2025
2 parents 7a79f3f + e26d4a5 commit dfa728f
Show file tree
Hide file tree
Showing 133 changed files with 20,126 additions and 858 deletions.
4 changes: 2 additions & 2 deletions editioncrafter-umd/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion editioncrafter-umd/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cu-mkp/editioncrafter-umd",
"version": "1.1.0",
"version": "1.2.0",
"homepage": "https://editioncrafter.org/",
"description": "A simple digital critical edition publication tool",
"private": false,
Expand Down
4 changes: 1 addition & 3 deletions editioncrafter/.storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { transformWithEsbuild } from 'vite'

/** @type { import('@storybook/react-webpack5').StorybookConfig } */
const config = {
stories: ['../stories/**/*.mdx', '../stories/**/*.stories.@(js|jsx|ts|tsx)'],
Expand All @@ -25,7 +23,7 @@ const config = {
},
async viteFinal(config) {
// Merge custom configuration into the default config
const { mergeConfig } = await import('vite')
const { mergeConfig, transformWithEsbuild } = await import('vite')

return mergeConfig(config, {
plugins: [
Expand Down
26 changes: 19 additions & 7 deletions editioncrafter/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions editioncrafter/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@cu-mkp/editioncrafter",
"type": "module",
"version": "1.1.0",
"version": "1.2.0",
"private": false,
"description": "A simple digital critical edition publication tool",
"license": "MIT",
Expand Down Expand Up @@ -37,15 +37,16 @@
"html-react-parser": "^4.2.2",
"openseadragon": "^4.1.0",
"prop-types": "^15.5.10",
"react-icons": "^4.8.0",
"react-icons": "^4.12.0",
"react-infinite-scroller": "^1.1.3",
"react-markdown": "^8.0.7",
"react-redux": "^8.0.5",
"react-router": "^6.11.0",
"react-router-dom": "^6.11.0",
"react-scroll": "^1.7.10",
"redux": "^4.2.1",
"redux-saga": "^1.2.2"
"redux-saga": "^1.2.2",
"sql.js": "^1.12.0"
},
"devDependencies": {
"@antfu/eslint-config": "^3.8.0",
Expand Down Expand Up @@ -73,6 +74,8 @@
"glob": "^7.1.4",
"http-server": "^14.1.0",
"jsdom": "^19.0.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-refresh": "^0.14.0",
"redux-mock-store": "^1.5.1",
"redux-saga-test-plan": "^4.0.6",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,20 @@ DocumentActions.loadDocument = function loadDocument(state, manifestData) {
}
}

DocumentActions.loadTags = function loadTags(state, tags) {
return {
...state,
tags,
}
}

DocumentActions.loadFolio = function loadFolio(state, folio) {
const oldFolio = state.folioIndex[folio.id]
const folioIdx = state.folios.indexOf(oldFolio)
state.folios[folioIdx] = folio
state.folioIndex[folio.id] = folio
state.folioByName[folio.name] = folio

return {
...state,
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
function getHeaderUrlFromManifestUrl(manifestUrl) {
const truncated = manifestUrl.replace('/iiif/manifest.json', '')
return `${truncated}/html/index.html`
}

export default function documentInitalState(iiifManifest, documentName, transcriptionTypes, variorum = false, derivativeNames = null, threePanel = false) {
return {
documentName,
derivativeNames,
manifestURL: iiifManifest,
headerUrl: getHeaderUrlFromManifestUrl(iiifManifest),
transcriptionTypes,
variorum,
threePanel,
folios: [],
loaded: false,
folioIndex: {},
folioByName: {},
tags: null,
}
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
Route,
Routes,
} from 'react-router-dom'
import TagFilterProvider from '../context/TagFilter'
import DocumentView from './DocumentView'
import RouteListener from './RouteListener'

Expand Down Expand Up @@ -38,27 +39,29 @@ function DiploMatic(props) {
return (
<Provider store={props.store}>
<HashRouter>
<div id="diplomatic" className={fixedFrameModeClass} ref={containerRef} style={{ height: containerHeight }}>
<RouteListener />
<div id="content" style={{ height: '100%' }}>
<Routes>
<Route path="/ec/:folioID/:transcriptionType/:folioID2/:transcriptionType2/:folioID3/:transcriptionType3" element={<DocumentView {...props} containerWidth={containerWidth} />} exact />
<Route path="/ec/:folioID/:transcriptionType/:folioID2/:transcriptionType2" element={<DocumentView {...props} containerWidth={containerWidth} />} exact />
<Route path="/ec/:folioID/:transcriptionType" element={<DocumentView {...props} containerWidth={containerWidth} />} exact />
<Route path="/ec/:folioID" element={<DocumentView {...props} containerWidth={containerWidth} />} exact />
<Route path="/ec" element={<DocumentView {...props} containerWidth={containerWidth} />} exact />
<Route path="/" element={<Navigate to="/ec" />} exact />
</Routes>
<TagFilterProvider>
<div id="diplomatic" className={fixedFrameModeClass} ref={containerRef} style={{ height: containerHeight }}>
<RouteListener />
<div id="content" style={{ height: '100%' }}>
<Routes>
<Route path="/ec/:folioID/:transcriptionType/:folioID2/:transcriptionType2/:folioID3/:transcriptionType3" element={<DocumentView {...props} containerWidth={containerWidth} />} exact />
<Route path="/ec/:folioID/:transcriptionType/:folioID2/:transcriptionType2" element={<DocumentView {...props} containerWidth={containerWidth} />} exact />
<Route path="/ec/:folioID/:transcriptionType" element={<DocumentView {...props} containerWidth={containerWidth} />} exact />
<Route path="/ec/:folioID" element={<DocumentView {...props} containerWidth={containerWidth} />} exact />
<Route path="/ec" element={<DocumentView {...props} containerWidth={containerWidth} />} exact />
<Route path="/" element={<Navigate to="/ec" />} exact />
</Routes>
</div>
</div>
</div>
</TagFilterProvider>
</HashRouter>
</Provider>
)
}

DiploMatic.propTypes = {
store: PropTypes.isRequired,
config: PropTypes.isRequired,
store: PropTypes.object.isRequired,
config: PropTypes.object.isRequired,
}

function mapStateToProps(state) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function DocumentView(props) {

// "reload" the page if the config props change
useEffect(() => {
dispatchAction(props, 'RouteListenerSaga.userNavigatation', location)
dispatchAction(props, 'RouteListenerSaga.userNavigation', location.pathname)
}, [props.config])

useEffect(() => {
Expand Down Expand Up @@ -429,7 +429,9 @@ function DocumentView(props) {
side={side}
/>
)
} if (viewType === 'TranscriptionView') {
}

if (viewType === 'TranscriptionView') {
return (
<TranscriptionView
key={key}
Expand All @@ -440,7 +442,9 @@ function DocumentView(props) {
transcriptionType={transcriptionType}
/>
)
} if (viewType === 'XMLView') {
}

if (viewType === 'XMLView') {
return (
<XMLView
key={key}
Expand All @@ -451,7 +455,9 @@ function DocumentView(props) {
side={side}
/>
)
} if (viewType === 'ImageGridView') {
}

if (viewType === 'ImageGridView') {
return (
<ImageGridView
key={key}
Expand All @@ -461,7 +467,9 @@ function DocumentView(props) {
selectedDoc={document || props.document.variorum && Object.keys(props.document.derivativeNames)[side === 'left' ? 0 : side === 'right' ? 1 : Object.keys(props.document.derivativeNames).length > 2 ? 2 : 1]}
/>
)
} if (viewType === 'GlossaryView') {
}

if (viewType === 'GlossaryView') {
return (
<GlossaryView
key={key}
Expand Down Expand Up @@ -492,7 +500,9 @@ function DocumentView(props) {
return `${side}-${pane.viewType}`
}

if (!props.document.loaded) { return null }
if (!props.document.loaded) {
return null
}

// combine component state with state from props
const docView = {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit dfa728f

Please sign in to comment.